]> Pileus Git - ~andy/linux/commitdiff
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 27 Nov 2007 22:20:35 +0000 (14:20 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 27 Nov 2007 22:20:35 +0000 (14:20 -0800)
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: adds the context menu key (HUT GenDesc 0x84)
  Input: add definitions for frame forward and frame back keys
  Input: bf54x-keys - keypad does not exist on BF544 parts
  Input: gpio-keys - request and configure GPIOs
  Input: i8042 - add i8042.noloop quirk for MS Virtual Machine
  Sonypi: use synchronize_irq instead of sycnronize_sched
  sonypi: fit input devices into sysfs tree
  sony-laptop: fit input devices into sysfs tree

1560 files changed:
Documentation/SubmittingPatches
Documentation/accounting/getdelays.c
Documentation/feature-removal-schedule.txt
Documentation/hwmon/sysfs-interface
Documentation/i386/boot.txt
Documentation/i386/zero-page.txt
Documentation/ja_JP/SubmittingPatches [new file with mode: 0644]
Documentation/kernel-parameters.txt
Documentation/lguest/lguest.c
Documentation/local_ops.txt
Documentation/markers.txt
Documentation/networking/00-INDEX
Documentation/networking/3c505.txt
Documentation/networking/Configurable [deleted file]
Documentation/networking/comx.txt [deleted file]
Documentation/networking/ncsa-telnet [deleted file]
Documentation/networking/pt.txt [deleted file]
Documentation/networking/routing.txt [deleted file]
Documentation/networking/slicecom.hun [deleted file]
Documentation/networking/slicecom.txt [deleted file]
Documentation/parport-lowlevel.txt
Documentation/powerpc/booting-without-of.txt
Documentation/rtc.txt
Documentation/scsi/link_power_management_policy.txt [new file with mode: 0644]
Documentation/thinkpad-acpi.txt
Documentation/video4linux/CARDLIST.em28xx
MAINTAINERS
Makefile
arch/arm/Kconfig
arch/arm/configs/zylonite_defconfig [new file with mode: 0644]
arch/arm/mach-iop32x/n2100.c
arch/arm/mach-ixp2000/Kconfig
arch/arm/mach-netx/xc.c
arch/arm/mach-omap1/board-h2.c
arch/arm/mach-omap2/clock.c
arch/arm/mach-pxa/mfp.c
arch/arm/mach-pxa/pxa300.c
arch/arm/mach-pxa/pxa320.c
arch/arm/mach-pxa/pxa3xx.c
arch/arm/mach-pxa/time.c
arch/arm/mach-pxa/zylonite.c
arch/arm/mach-pxa/zylonite_pxa300.c
arch/arm/mach-pxa/zylonite_pxa320.c
arch/arm/mm/consistent.c
arch/arm/mm/proc-arm926.S
arch/arm/plat-omap/fb.c
arch/avr32/Kconfig
arch/avr32/mach-at32ap/at32ap7000.c
arch/avr32/mach-at32ap/hsmc.c
arch/avr32/mach-at32ap/intc.c
arch/blackfin/Kconfig
arch/blackfin/Kconfig.debug [new file with mode: 0644]
arch/blackfin/Makefile
arch/blackfin/configs/BF527-EZKIT_defconfig
arch/blackfin/configs/BF533-EZKIT_defconfig
arch/blackfin/configs/BF533-STAMP_defconfig
arch/blackfin/configs/BF537-STAMP_defconfig
arch/blackfin/configs/BF548-EZKIT_defconfig
arch/blackfin/configs/BF561-EZKIT_defconfig
arch/blackfin/configs/H8606_defconfig [new file with mode: 0644]
arch/blackfin/configs/PNAV-10_defconfig
arch/blackfin/kernel/bfin_dma_5xx.c
arch/blackfin/kernel/bfin_ksyms.c
arch/blackfin/kernel/cplbinit.c
arch/blackfin/kernel/early_printk.c
arch/blackfin/kernel/entry.S
arch/blackfin/kernel/fixed_code.S
arch/blackfin/kernel/gptimers.c
arch/blackfin/kernel/process.c
arch/blackfin/kernel/setup.c
arch/blackfin/kernel/traps.c
arch/blackfin/kernel/vmlinux.lds.S
arch/blackfin/lib/Makefile
arch/blackfin/lib/ins.S
arch/blackfin/lib/strcmp.c
arch/blackfin/lib/strcpy.c
arch/blackfin/lib/strncmp.c
arch/blackfin/lib/strncpy.c
arch/blackfin/lib/udivdi3.S [deleted file]
arch/blackfin/mach-bf527/Kconfig
arch/blackfin/mach-bf527/boards/Kconfig [new file with mode: 0644]
arch/blackfin/mach-bf527/boards/Makefile
arch/blackfin/mach-bf527/boards/eth_mac.c [deleted file]
arch/blackfin/mach-bf527/boards/ezkit.c
arch/blackfin/mach-bf533/Kconfig
arch/blackfin/mach-bf533/boards/H8606.c [new file with mode: 0644]
arch/blackfin/mach-bf533/boards/Kconfig [new file with mode: 0644]
arch/blackfin/mach-bf533/boards/Makefile
arch/blackfin/mach-bf533/boards/cm_bf533.c
arch/blackfin/mach-bf533/boards/ezkit.c
arch/blackfin/mach-bf533/boards/generic_board.c
arch/blackfin/mach-bf533/boards/stamp.c
arch/blackfin/mach-bf537/Kconfig
arch/blackfin/mach-bf537/boards/Kconfig [new file with mode: 0644]
arch/blackfin/mach-bf537/boards/Makefile
arch/blackfin/mach-bf537/boards/cm_bf537.c
arch/blackfin/mach-bf537/boards/eth_mac.c [deleted file]
arch/blackfin/mach-bf537/boards/generic_board.c
arch/blackfin/mach-bf537/boards/pnav10.c
arch/blackfin/mach-bf537/boards/stamp.c
arch/blackfin/mach-bf548/Kconfig
arch/blackfin/mach-bf548/boards/Kconfig [new file with mode: 0644]
arch/blackfin/mach-bf548/boards/Makefile
arch/blackfin/mach-bf548/boards/ezkit.c
arch/blackfin/mach-bf548/head.S
arch/blackfin/mach-bf561/Kconfig
arch/blackfin/mach-bf561/boards/Kconfig [new file with mode: 0644]
arch/blackfin/mach-bf561/boards/Makefile
arch/blackfin/mach-bf561/boards/cm_bf561.c
arch/blackfin/mach-bf561/boards/ezkit.c
arch/blackfin/mach-bf561/boards/generic_board.c
arch/blackfin/mach-bf561/boards/tepla.c
arch/blackfin/mach-common/cplbinfo.c
arch/blackfin/mach-common/cplbmgr.S
arch/blackfin/mach-common/entry.S
arch/blackfin/mach-common/interrupt.S
arch/blackfin/mach-common/ints-priority-dc.c
arch/blackfin/mach-common/ints-priority-sc.c
arch/blackfin/mach-common/irqpanic.c
arch/blackfin/mm/blackfin_sram.c
arch/cris/Kconfig
arch/cris/arch-v10/defconfig
arch/cris/arch-v10/drivers/Kconfig
arch/cris/arch-v10/drivers/axisflashmap.c
arch/cris/arch-v10/drivers/gpio.c
arch/cris/arch-v10/kernel/entry.S
arch/cris/arch-v10/kernel/fasttimer.c
arch/cris/arch-v10/kernel/io_interface_mux.c
arch/cris/arch-v10/kernel/irq.c
arch/cris/arch-v10/kernel/setup.c
arch/cris/arch-v10/kernel/time.c
arch/cris/arch-v10/lib/memset.c
arch/cris/arch-v10/lib/string.c
arch/cris/arch-v10/lib/usercopy.c
arch/cris/arch-v32/drivers/Kconfig
arch/cris/arch-v32/drivers/axisflashmap.c
arch/cris/arch-v32/drivers/sync_serial.c
arch/cris/arch-v32/kernel/cache.c [new file with mode: 0644]
arch/cris/arch-v32/kernel/cacheflush.S [new file with mode: 0644]
arch/cris/arch-v32/kernel/io.c
arch/cris/arch-v32/kernel/setup.c
arch/cris/defconfig
arch/cris/kernel/crisksyms.c
arch/cris/kernel/irq.c
arch/cris/kernel/process.c
arch/cris/kernel/ptrace.c
arch/cris/kernel/sys_cris.c
arch/cris/kernel/time.c
arch/frv/mb93090-mb00/pci-dma.c
arch/frv/mm/init.c
arch/h8300/Kconfig
arch/ia64/configs/sn2_defconfig
arch/ia64/hp/sim/boot/fw-emu.c
arch/ia64/ia32/ia32priv.h
arch/ia64/kernel/.gitignore [new file with mode: 0644]
arch/ia64/kernel/acpi.c
arch/ia64/kernel/efi.c
arch/ia64/kernel/gate.lds.S
arch/ia64/kernel/iosapic.c
arch/ia64/kernel/irq.c
arch/ia64/kernel/mca.c
arch/ia64/kernel/msi_ia64.c
arch/ia64/kernel/palinfo.c
arch/ia64/kernel/patch.c
arch/ia64/kernel/perfmon.c
arch/ia64/kernel/setup.c
arch/ia64/kernel/smpboot.c
arch/ia64/mm/contig.c
arch/ia64/mm/init.c
arch/ia64/scripts/check-segrel.lds
arch/ia64/sn/kernel/irq.c
arch/ia64/sn/kernel/mca.c
arch/ia64/sn/kernel/xpc_main.c
arch/m68k/atari/atakeyb.c
arch/mips/Kconfig
arch/mips/Makefile
arch/mips/au1000/Kconfig
arch/mips/au1000/common/irq.c
arch/mips/au1000/common/time.c
arch/mips/au1000/mtx-1/Makefile
arch/mips/au1000/mtx-1/platform.c [new file with mode: 0644]
arch/mips/au1000/pb1200/Makefile
arch/mips/au1000/pb1200/board_setup.c
arch/mips/au1000/pb1200/irqmap.c
arch/mips/basler/excite/excite_setup.c
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/pb1100_defconfig
arch/mips/configs/pb1500_defconfig
arch/mips/configs/pb1550_defconfig
arch/mips/configs/sb1250-swarm_defconfig
arch/mips/gt64120/wrppmc/time.c
arch/mips/jazz/irq.c
arch/mips/jmr3927/rbhma3100/setup.c
arch/mips/kernel/Makefile
arch/mips/kernel/cevt-bcm1480.c [new file with mode: 0644]
arch/mips/kernel/cevt-gt641xx.c
arch/mips/kernel/cevt-r4k.c
arch/mips/kernel/cevt-sb1250.c [new file with mode: 0644]
arch/mips/kernel/cevt-txx9.c [new file with mode: 0644]
arch/mips/kernel/cpu-probe.c
arch/mips/kernel/csrc-bcm1480.c [new file with mode: 0644]
arch/mips/kernel/csrc-r4k.c [new file with mode: 0644]
arch/mips/kernel/csrc-sb1250.c [new file with mode: 0644]
arch/mips/kernel/genex.S
arch/mips/kernel/i8253.c
arch/mips/kernel/irixsig.c
arch/mips/kernel/irq-rm7000.c
arch/mips/kernel/irq-rm9000.c
arch/mips/kernel/irq_cpu.c
arch/mips/kernel/proc.c
arch/mips/kernel/ptrace.c
arch/mips/kernel/ptrace32.c
arch/mips/kernel/scall64-n32.S
arch/mips/kernel/setup.c
arch/mips/kernel/smp-up.c [new file with mode: 0644]
arch/mips/kernel/smtc.c
arch/mips/kernel/syscall.c
arch/mips/kernel/time.c
arch/mips/kernel/traps.c
arch/mips/kernel/vmlinux.lds.S
arch/mips/kernel/vpe.c
arch/mips/lasat/interrupt.c
arch/mips/lasat/setup.c
arch/mips/math-emu/ieee754.c
arch/mips/math-emu/ieee754dp.c
arch/mips/math-emu/ieee754sp.c
arch/mips/mips-boards/generic/time.c
arch/mips/mipssim/sim_time.c
arch/mips/mm/c-r3k.c
arch/mips/mm/c-r4k.c
arch/mips/mm/cerr-sb1.c
arch/mips/mm/dma-default.c
arch/mips/mm/init.c
arch/mips/pci/fixup-pmcmsp.c
arch/mips/pci/fixup-sni.c
arch/mips/pci/fixup-tb0219.c
arch/mips/pci/ops-pmcmsp.c
arch/mips/pci/pci-lasat.c
arch/mips/pci/pci-vr41xx.c
arch/mips/pmc-sierra/Kconfig
arch/mips/pmc-sierra/msp71xx/msp_serial.c
arch/mips/qemu/Makefile
arch/mips/qemu/q-console.c [new file with mode: 0644]
arch/mips/qemu/q-firmware.c
arch/mips/qemu/q-irq.c
arch/mips/qemu/q-setup.c
arch/mips/sgi-ip22/ip22-eisa.c
arch/mips/sgi-ip22/ip22-nvram.c
arch/mips/sgi-ip27/ip27-timer.c
arch/mips/sgi-ip32/ip32-irq.c
arch/mips/sgi-ip32/ip32-platform.c
arch/mips/sibyte/Kconfig
arch/mips/sibyte/bcm1480/irq.c
arch/mips/sibyte/bcm1480/time.c
arch/mips/sibyte/sb1250/irq.c
arch/mips/sibyte/sb1250/time.c
arch/mips/sni/pcimt.c
arch/mips/sni/time.c
arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c
arch/mips/tx4938/toshiba_rbtx4938/setup.c
arch/mips/vr41xx/Kconfig
arch/mips/vr41xx/common/icu.c
arch/powerpc/Makefile
arch/powerpc/boot/dts/mpc832x_mds.dts
arch/powerpc/boot/dts/mpc834x_mds.dts
arch/powerpc/boot/dts/mpc836x_mds.dts
arch/powerpc/boot/dts/mpc8544ds.dts
arch/powerpc/boot/dts/mpc8572ds.dts
arch/powerpc/boot/dts/mpc8641_hpcn.dts
arch/powerpc/boot/dts/walnut.dts
arch/powerpc/boot/wrapper
arch/powerpc/configs/mpc832x_mds_defconfig
arch/powerpc/configs/mpc832x_rdb_defconfig
arch/powerpc/configs/mpc834x_itx_defconfig
arch/powerpc/configs/mpc834x_itxgp_defconfig
arch/powerpc/configs/mpc834x_mds_defconfig
arch/powerpc/configs/mpc836x_mds_defconfig
arch/powerpc/configs/mpc8568mds_defconfig
arch/powerpc/configs/pasemi_defconfig
arch/powerpc/configs/ppc64_defconfig
arch/powerpc/kernel/asm-offsets.c
arch/powerpc/kernel/btext.c
arch/powerpc/kernel/cputable.c
arch/powerpc/kernel/entry_32.S
arch/powerpc/kernel/head_64.S
arch/powerpc/kernel/idle.c
arch/powerpc/kernel/misc_32.S
arch/powerpc/kernel/process.c
arch/powerpc/kernel/prom.c
arch/powerpc/kernel/prom_init.c
arch/powerpc/kernel/rtas.c
arch/powerpc/kernel/setup_64.c
arch/powerpc/kernel/swsusp_32.S
arch/powerpc/kernel/time.c
arch/powerpc/kernel/vdso.c
arch/powerpc/kernel/vdso32/cacheflush.S
arch/powerpc/kernel/vdso64/cacheflush.S
arch/powerpc/kernel/vmlinux.lds.S
arch/powerpc/mm/40x_mmu.c
arch/powerpc/mm/44x_mmu.c
arch/powerpc/mm/fault.c
arch/powerpc/mm/hash_low_64.S
arch/powerpc/mm/hash_utils_64.c
arch/powerpc/mm/init_64.c
arch/powerpc/mm/mem.c
arch/powerpc/mm/mmu_decl.h
arch/powerpc/mm/slb.c
arch/powerpc/mm/stab.c
arch/powerpc/mm/tlb_64.c
arch/powerpc/platforms/40x/walnut.c
arch/powerpc/platforms/44x/bamboo.c
arch/powerpc/platforms/44x/ebony.c
arch/powerpc/platforms/44x/sequoia.c
arch/powerpc/platforms/83xx/mpc832x_mds.c
arch/powerpc/platforms/83xx/mpc832x_rdb.c
arch/powerpc/platforms/83xx/mpc834x_mds.c
arch/powerpc/platforms/83xx/mpc836x_mds.c
arch/powerpc/platforms/83xx/usb.c
arch/powerpc/platforms/cell/interrupt.c
arch/powerpc/platforms/cell/smp.c
arch/powerpc/platforms/cell/spufs/inode.c
arch/powerpc/platforms/celleb/setup.c
arch/powerpc/platforms/embedded6xx/prpmc2800.c
arch/powerpc/platforms/iseries/irq.h
arch/powerpc/platforms/iseries/setup.c
arch/powerpc/platforms/iseries/vio.c
arch/powerpc/platforms/pasemi/setup.c
arch/powerpc/platforms/pseries/Kconfig
arch/powerpc/platforms/pseries/eeh.c
arch/powerpc/platforms/pseries/eeh_driver.c
arch/powerpc/platforms/pseries/firmware.c
arch/powerpc/platforms/pseries/msi.c
arch/powerpc/platforms/pseries/setup.c
arch/powerpc/sysdev/cpm_common.c
arch/powerpc/sysdev/i8259.c
arch/powerpc/sysdev/mv64x60_pci.c
arch/powerpc/sysdev/uic.c
arch/ppc/kernel/entry.S
arch/ppc/kernel/misc.S
arch/ppc/kernel/setup.c
arch/ppc/mm/44x_mmu.c
arch/ppc/mm/4xx_mmu.c
arch/ppc/mm/fault.c
arch/ppc/mm/init.c
arch/ppc/mm/mmu_decl.h
arch/ppc/platforms/4xx/ebony.c
arch/ppc/platforms/4xx/luan.c
arch/ppc/platforms/4xx/ocotea.c
arch/ppc/platforms/4xx/taishan.c
arch/ppc/platforms/4xx/yucca.c
arch/ppc/syslib/i8259.c
arch/ppc/syslib/m8260_setup.c
arch/ppc/syslib/virtex_devices.c
arch/s390/Kconfig
arch/s390/appldata/appldata.h
arch/s390/appldata/appldata_base.c
arch/s390/appldata/appldata_mem.c
arch/s390/appldata/appldata_net_sum.c
arch/s390/appldata/appldata_os.c
arch/s390/kernel/early.c
arch/s390/kernel/entry.S
arch/s390/kernel/entry64.S
arch/s390/kernel/process.c
arch/s390/kernel/setup.c
arch/s390/kernel/smp.c
arch/s390/kernel/time.c
arch/s390/kernel/traps.c
arch/s390/kernel/vtime.c
arch/s390/mm/cmm.c
arch/sh/Kconfig
arch/sh/Kconfig.debug
arch/sh/Makefile
arch/sh/boards/renesas/hs7751rvoip/irq.c
arch/sh/boards/renesas/hs7751rvoip/setup.c
arch/sh/boards/renesas/r7780rp/setup.c
arch/sh/boards/renesas/rts7751r2d/setup.c
arch/sh/boards/renesas/sh7710voipgw/setup.c
arch/sh/boards/se/7206/irq.c
arch/sh/boards/se/770x/setup.c
arch/sh/boards/se/7722/setup.c
arch/sh/boards/se/7780/setup.c
arch/sh/boards/snapgear/Makefile
arch/sh/boards/snapgear/rtc.c [deleted file]
arch/sh/boards/snapgear/setup.c
arch/sh/boot/Makefile
arch/sh/cchips/hd6446x/Makefile
arch/sh/cchips/voyagergx/Makefile
arch/sh/configs/r7780mp_defconfig
arch/sh/configs/r7785rp_defconfig
arch/sh/drivers/pci/Makefile
arch/sh/drivers/pci/pci-st40.c [deleted file]
arch/sh/drivers/pci/pci-st40.h [deleted file]
arch/sh/kernel/Makefile
arch/sh/kernel/cpu/irq/ipr.c
arch/sh/kernel/cpu/sh3/ex.S
arch/sh/kernel/cpu/sh4/probe.c
arch/sh/kernel/cpu/sh4a/setup-sh7722.c
arch/sh/kernel/irq.c
arch/sh/kernel/kgdb_stub.c
arch/sh/kernel/setup.c
arch/sh/kernel/sh_ksyms.c
arch/sh/kernel/vmlinux.lds.S
arch/sh/kernel/vsyscall/vsyscall.lds.S
arch/sh/lib/Makefile
arch/sh/mm/Kconfig
arch/sh/mm/Makefile
arch/sh/mm/clear_page.S
arch/sh/mm/copy_page.S
arch/sh/mm/fault.c
arch/sh/mm/pg-sh4.c
arch/sh/oprofile/Makefile
arch/sh/oprofile/op_model_sh7750.c
arch/sh/tools/mach-types
arch/sh64/Kconfig
arch/sh64/configs/cayman_defconfig
arch/sh64/configs/harp_defconfig
arch/sh64/configs/sim_defconfig
arch/sh64/kernel/process.c
arch/sh64/kernel/traps.c
arch/sparc/kernel/irq.c
arch/sparc64/Kconfig
arch/sparc64/defconfig
arch/sparc64/kernel/ds.c
arch/sparc64/kernel/module.c
arch/sparc64/kernel/sparc64_ksyms.c
arch/sparc64/kernel/sys_sparc32.c
arch/sparc64/kernel/sys_sunos32.c
arch/sparc64/kernel/time.c
arch/sparc64/mm/tsb.c
arch/sparc64/mm/ultra.S
arch/um/Kconfig.i386
arch/um/Makefile
arch/um/Makefile-i386
arch/um/Makefile-x86_64
arch/um/drivers/net_kern.c
arch/um/drivers/ubd_kern.c
arch/um/include/user.h
arch/um/kernel/irq.c
arch/um/kernel/mem.c
arch/um/kernel/skas/clone.c
arch/um/os-Linux/file.c
arch/um/sys-i386/ptrace.c
arch/um/sys-x86_64/ptrace.c
arch/x86/Kconfig [moved from arch/x86/Kconfig.i386 with 74% similarity]
arch/x86/Kconfig.cpu
arch/x86/Kconfig.debug
arch/x86/Kconfig.x86_64 [deleted file]
arch/x86/Makefile
arch/x86/Makefile_32
arch/x86/Makefile_64
arch/x86/boot/Makefile
arch/x86/boot/compressed/head_32.S
arch/x86/boot/compressed/head_64.S
arch/x86/boot/cpucheck.c
arch/x86/boot/pmjump.S
arch/x86/configs/x86_64_defconfig
arch/x86/ia32/ia32entry.S
arch/x86/ia32/ptrace32.c
arch/x86/kernel/Makefile_32
arch/x86/kernel/Makefile_64
arch/x86/kernel/acpi/boot.c
arch/x86/kernel/acpi/processor.c
arch/x86/kernel/acpi/sleep_64.c
arch/x86/kernel/aperture_64.c
arch/x86/kernel/apic_32.c
arch/x86/kernel/asm-offsets_64.c
arch/x86/kernel/cpu/cpufreq/Kconfig [moved from arch/x86/kernel/cpu/cpufreq/Kconfig_32 with 77% similarity]
arch/x86/kernel/cpu/cpufreq/Kconfig_64 [deleted file]
arch/x86/kernel/cpu/cpufreq/powernow-k8.c
arch/x86/kernel/cpu/cpufreq/powernow-k8.h
arch/x86/kernel/cpu/mcheck/mce_64.c
arch/x86/kernel/cpu/mtrr/main.c
arch/x86/kernel/cpu/proc.c
arch/x86/kernel/early-quirks.c
arch/x86/kernel/i386_ksyms_32.c
arch/x86/kernel/i387_64.c
arch/x86/kernel/io_apic_32.c
arch/x86/kernel/io_apic_64.c
arch/x86/kernel/kprobes_32.c
arch/x86/kernel/kprobes_64.c
arch/x86/kernel/machine_kexec_64.c
arch/x86/kernel/nmi_32.c
arch/x86/kernel/pci-calgary_64.c
arch/x86/kernel/pci-dma_64.c
arch/x86/kernel/pci-gart_64.c
arch/x86/kernel/pci-nommu_64.c
arch/x86/kernel/pci-swiotlb_64.c
arch/x86/kernel/reboot_64.c
arch/x86/kernel/reboot_fixups_32.c
arch/x86/kernel/setup_32.c
arch/x86/kernel/setup_64.c
arch/x86/kernel/smp_32.c
arch/x86/kernel/time_64.c
arch/x86/kernel/traps_32.c
arch/x86/kernel/traps_64.c
arch/x86/lguest/boot.c
arch/x86/lib/delay_32.c
arch/x86/lib/delay_64.c
arch/x86/mach-voyager/voyager_cat.c
arch/x86/mach-voyager/voyager_smp.c
arch/x86/mm/discontig_32.c
arch/x86/mm/fault_32.c
arch/x86/mm/fault_64.c
arch/x86/mm/init_64.c
arch/x86/pci/acpi.c
arch/x86/pci/common.c
arch/x86/vdso/Makefile
arch/x86/vdso/vgetcpu.c
arch/xtensa/Kconfig
block/cfq-iosched.c
block/compat_ioctl.c
block/deadline-iosched.c
block/ll_rw_blk.c
crypto/algapi.c
crypto/anubis.c
crypto/authenc.c
crypto/blowfish.c
crypto/compress.c
crypto/crypto_null.c
crypto/khazad.c
crypto/sha1_generic.c
crypto/sha256_generic.c
crypto/sha512.c
crypto/tea.c
crypto/tgr192.c
crypto/wp512.c
drivers/acpi/Kconfig
drivers/acpi/Makefile
drivers/acpi/ac.c
drivers/acpi/battery.c
drivers/acpi/bus.c
drivers/acpi/button.c
drivers/acpi/ec.c
drivers/acpi/fan.c
drivers/acpi/osl.c
drivers/acpi/power.c
drivers/acpi/processor_core.c
drivers/acpi/processor_idle.c
drivers/acpi/processor_throttling.c
drivers/acpi/sbs.c
drivers/acpi/sleep/main.c
drivers/acpi/tables/tbutils.c
drivers/acpi/toshiba_acpi.c
drivers/acpi/video.c
drivers/ata/ahci.c
drivers/ata/ata_piix.c
drivers/ata/libata-acpi.c
drivers/ata/libata-core.c
drivers/ata/libata-eh.c
drivers/ata/libata-scsi.c
drivers/ata/libata.h
drivers/ata/pata_acpi.c
drivers/ata/pata_ali.c
drivers/ata/pata_bf54x.c
drivers/ata/pata_hpt37x.c
drivers/ata/pata_isapnp.c
drivers/ata/pata_jmicron.c
drivers/ata/pata_ns87415.c
drivers/ata/pata_optidma.c
drivers/ata/pata_pcmcia.c
drivers/ata/pata_pdc2027x.c
drivers/ata/pata_pdc202xx_old.c
drivers/ata/pata_platform.c
drivers/ata/pata_scc.c
drivers/ata/pata_serverworks.c
drivers/ata/pata_sil680.c
drivers/ata/pata_sis.c
drivers/ata/pata_via.c
drivers/ata/pata_winbond.c
drivers/ata/pdc_adma.c
drivers/ata/sata_fsl.c
drivers/ata/sata_inic162x.c
drivers/ata/sata_mv.c
drivers/ata/sata_nv.c
drivers/ata/sata_promise.c
drivers/ata/sata_qstor.c
drivers/ata/sata_sil.c
drivers/ata/sata_sil24.c
drivers/ata/sata_sis.c
drivers/ata/sata_svw.c
drivers/ata/sata_sx4.c
drivers/ata/sata_uli.c
drivers/ata/sata_via.c
drivers/ata/sata_vsc.c
drivers/atm/he.c
drivers/base/core.c
drivers/base/dmapool.c
drivers/block/cciss.c
drivers/block/cciss_scsi.c
drivers/block/cciss_scsi.h
drivers/block/nbd.c
drivers/block/paride/pf.c
drivers/block/paride/pt.c
drivers/block/pktcdvd.c
drivers/block/rd.c
drivers/block/virtio_blk.c
drivers/char/agp/Kconfig
drivers/char/agp/amd64-agp.c
drivers/char/drm/drmP.h
drivers/char/drm/drm_ioctl.c
drivers/char/drm/drm_os_linux.h
drivers/char/drm/radeon_cp.c
drivers/char/drm/radeon_drv.h
drivers/char/drm/savage_bci.c
drivers/char/drm/sis_mm.c
drivers/char/mem.c
drivers/char/pcmcia/cm4000_cs.c
drivers/char/pcmcia/cm4040_cs.c
drivers/char/random.c
drivers/char/rtc.c
drivers/char/tty_ioctl.c
drivers/char/virtio_console.c
drivers/connector/connector.c
drivers/cpufreq/cpufreq_conservative.c
drivers/cpuidle/cpuidle.c
drivers/cpuidle/governor.c
drivers/crypto/geode-aes.c
drivers/dma/Kconfig
drivers/dma/dmaengine.c
drivers/dma/ioat.c
drivers/dma/ioat_dca.c
drivers/dma/ioat_dma.c
drivers/dma/ioatdma.h
drivers/dma/ioatdma_hw.h
drivers/dma/ioatdma_registers.h
drivers/edac/i5000_edac.c
drivers/firewire/fw-ohci.c
drivers/firewire/fw-sbp2.c
drivers/hid/hid-input.c
drivers/hid/usbhid/hid-quirks.c
drivers/hid/usbhid/hiddev.c
drivers/hwmon/Kconfig
drivers/hwmon/Makefile
drivers/hwmon/abituguru3.c
drivers/hwmon/applesmc.c
drivers/hwmon/f75375s.c
drivers/hwmon/i5k_amb.c [new file with mode: 0644]
drivers/hwmon/ibmpex.c
drivers/hwmon/lm70.c
drivers/hwmon/sis5595.c
drivers/hwmon/w83627hf.c
drivers/hwmon/w83781d.c
drivers/i2c/busses/i2c-pasemi.c
drivers/i2c/chips/eeprom.c
drivers/i2c/i2c-core.c
drivers/i2c/i2c-dev.c
drivers/ide/Kconfig
drivers/ide/arm/icside.c
drivers/ide/cris/ide-cris.c
drivers/ide/ide-dma.c
drivers/ide/ide-io.c
drivers/ide/ide-iops.c
drivers/ide/ide-lib.c
drivers/ide/ide-probe.c
drivers/ide/ide-taskfile.c
drivers/ide/pci/cmd64x.c
drivers/ide/pci/cs5530.c
drivers/ide/pci/cy82c693.c
drivers/ide/pci/generic.c
drivers/ide/pci/hpt366.c
drivers/ide/pci/it821x.c
drivers/ide/pci/jmicron.c
drivers/ide/pci/piix.c
drivers/ide/pci/sc1200.c
drivers/ide/pci/sis5513.c
drivers/ide/ppc/pmac.c
drivers/ide/setup-pci.c
drivers/ieee1394/dma.c
drivers/ieee1394/ieee1394_transactions.c
drivers/ieee1394/sbp2.c
drivers/infiniband/core/fmr_pool.c
drivers/infiniband/hw/cxgb3/iwch_provider.c
drivers/infiniband/hw/ehca/ehca_av.c
drivers/infiniband/hw/ehca/ehca_classes.h
drivers/infiniband/hw/ehca/ehca_hca.c
drivers/infiniband/hw/ehca/ehca_iverbs.h
drivers/infiniband/hw/ehca/ehca_main.c
drivers/infiniband/hw/ehca/ehca_qp.c
drivers/infiniband/hw/ehca/hipz_hw.h
drivers/infiniband/hw/ipath/ipath_cq.c
drivers/infiniband/hw/ipath/ipath_eeprom.c
drivers/infiniband/hw/ipath/ipath_intr.c
drivers/infiniband/hw/ipath/ipath_rc.c
drivers/infiniband/hw/ipath/ipath_ruc.c
drivers/infiniband/hw/mlx4/qp.c
drivers/infiniband/ulp/ipoib/ipoib_cm.c
drivers/input/misc/pcspkr.c
drivers/input/serio/Kconfig
drivers/isdn/capi/capidrv.c
drivers/isdn/hisax/Kconfig
drivers/isdn/hisax/avm_pci.c
drivers/isdn/hisax/diva.c
drivers/isdn/hisax/elsa.c
drivers/isdn/hisax/gazel.c
drivers/isdn/hisax/niccy.c
drivers/isdn/hisax/sedlbauer.c
drivers/isdn/i4l/isdn_net.c
drivers/isdn/sc/card.h
drivers/isdn/sc/packet.c
drivers/isdn/sc/shmem.c
drivers/kvm/svm.c
drivers/kvm/x86_emulate.c
drivers/leds/leds-gpio.c
drivers/lguest/lguest_device.c
drivers/lguest/lguest_user.c
drivers/macintosh/windfarm_core.c
drivers/md/bitmap.c
drivers/md/dm-table.c
drivers/md/linear.c
drivers/md/md.c
drivers/md/multipath.c
drivers/md/raid0.c
drivers/md/raid1.c
drivers/md/raid10.c
drivers/md/raid5.c
drivers/md/raid6algos.c
drivers/md/raid6mmx.c
drivers/md/raid6sse1.c
drivers/md/raid6sse2.c
drivers/md/raid6x86.h
drivers/media/Kconfig
drivers/media/common/saa7146_core.c
drivers/media/dvb/frontends/mt2131.c
drivers/media/dvb/frontends/s5h1409.c
drivers/media/dvb/frontends/stv0297.c
drivers/media/dvb/frontends/tda10021.c
drivers/media/dvb/frontends/ves1820.c
drivers/media/dvb/ttpci/Kconfig
drivers/media/video/Kconfig
drivers/media/video/bt8xx/bttv-driver.c
drivers/media/video/bt8xx/bttvp.h
drivers/media/video/cafe_ccic.c
drivers/media/video/cx23885/Kconfig
drivers/media/video/cx88/Kconfig
drivers/media/video/em28xx/Kconfig
drivers/media/video/em28xx/em28xx-i2c.c
drivers/media/video/em28xx/em28xx-video.c
drivers/media/video/ivtv/ivtv-i2c.c
drivers/media/video/ivtv/ivtv-i2c.h
drivers/media/video/planb.c
drivers/media/video/pvrusb2/pvrusb2-ctrl.c
drivers/media/video/pvrusb2/pvrusb2-main.c
drivers/media/video/pvrusb2/pvrusb2-sysfs.c
drivers/media/video/saa7134/Kconfig
drivers/media/video/saa7134/saa7134-alsa.c
drivers/media/video/saa7134/saa7134-cards.c
drivers/media/video/tuner-core.c
drivers/media/video/tvp5150.c
drivers/message/i2o/i2o_block.c
drivers/misc/fujitsu-laptop.c
drivers/misc/ioc4.c
drivers/misc/thinkpad_acpi.c
drivers/misc/thinkpad_acpi.h
drivers/mmc/card/block.c
drivers/mmc/card/queue.c
drivers/mmc/core/core.c
drivers/mmc/core/mmc_ops.c
drivers/mmc/core/sd_ops.c
drivers/mmc/core/sdio_ops.c
drivers/mmc/host/au1xmmc.c
drivers/mmc/host/imxmmc.c
drivers/mmc/host/pxamci.c
drivers/mmc/host/sdhci.c
drivers/mmc/host/tifm_sd.c
drivers/net/82596.c
drivers/net/Kconfig
drivers/net/Makefile
drivers/net/arcnet/Kconfig
drivers/net/arm/ep93xx_eth.c
drivers/net/bfin_mac.c
drivers/net/bfin_mac.h
drivers/net/bonding/bond_main.c
drivers/net/bonding/bond_sysfs.c
drivers/net/chelsio/sge.c
drivers/net/cris/eth_v10.c
drivers/net/e1000/e1000.h
drivers/net/e1000/e1000_ethtool.c
drivers/net/e1000/e1000_hw.c
drivers/net/e1000/e1000_main.c
drivers/net/e1000/e1000_param.c
drivers/net/e1000e/82571.c
drivers/net/e1000e/e1000.h
drivers/net/e1000e/ethtool.c
drivers/net/e1000e/netdev.c
drivers/net/e1000e/param.c
drivers/net/ehea/ehea.h
drivers/net/ehea/ehea_main.c
drivers/net/fec_mpc52xx.c [new file with mode: 0644]
drivers/net/fec_mpc52xx.h [new file with mode: 0644]
drivers/net/fec_mpc52xx_phy.c [new file with mode: 0644]
drivers/net/fs_enet/Kconfig
drivers/net/fs_enet/Makefile
drivers/net/hamradio/6pack.c
drivers/net/irda/au1k_ir.c
drivers/net/irda/irtty-sir.c
drivers/net/ixgb/ixgb.h
drivers/net/ixgb/ixgb_ethtool.c
drivers/net/ixgb/ixgb_hw.c
drivers/net/ixgb/ixgb_main.c
drivers/net/ixgb/ixgb_param.c
drivers/net/ixgbe/ixgbe.h
drivers/net/ixgbe/ixgbe_82598.c
drivers/net/ixgbe/ixgbe_main.c
drivers/net/loopback.c
drivers/net/meth.c
drivers/net/mlx4/alloc.c
drivers/net/mlx4/qp.c
drivers/net/myri10ge/myri10ge.c
drivers/net/myri_sbus.c
drivers/net/netx-eth.c
drivers/net/pasemi_mac.c
drivers/net/pcmcia/3c574_cs.c
drivers/net/pcmcia/3c589_cs.c
drivers/net/pcmcia/axnet_cs.c
drivers/net/pcmcia/fmvj18x_cs.c
drivers/net/pcmcia/pcnet_cs.c
drivers/net/pcmcia/smc91c92_cs.c
drivers/net/pcmcia/xirc2ps_cs.c
drivers/net/phy/marvell.c
drivers/net/phy/phy_device.c
drivers/net/plip.c
drivers/net/ppp_async.c
drivers/net/ppp_generic.c
drivers/net/ppp_synctty.c
drivers/net/pppoe.c
drivers/net/pppol2tp.c
drivers/net/qla3xxx.c
drivers/net/qla3xxx.h
drivers/net/r8169.c
drivers/net/rrunner.c
drivers/net/s2io.c
drivers/net/skge.c
drivers/net/sky2.c
drivers/net/sky2.h
drivers/net/slip.c
drivers/net/smc91x.h
drivers/net/sungem.c
drivers/net/sunhme.c
drivers/net/tehuti.c
drivers/net/tg3.c
drivers/net/tg3.h
drivers/net/tulip/Kconfig
drivers/net/ucc_geth.c
drivers/net/usb/Kconfig
drivers/net/usb/dm9601.c
drivers/net/usb/usbnet.c
drivers/net/via-velocity.c
drivers/net/virtio_net.c
drivers/net/wan/lmc/lmc_main.c
drivers/net/wan/x25_asy.c
drivers/net/wireless/Kconfig
drivers/net/wireless/b43/Kconfig
drivers/net/wireless/b43/debugfs.c
drivers/net/wireless/b43/main.c
drivers/net/wireless/b43/pcmcia.c
drivers/net/wireless/b43/rfkill.c
drivers/net/wireless/b43/rfkill.h
drivers/net/wireless/b43legacy/debugfs.c
drivers/net/wireless/b43legacy/main.c
drivers/net/wireless/hostap/hostap_pci.c
drivers/net/wireless/ipw2100.c
drivers/net/wireless/ipw2200.c
drivers/net/wireless/iwlwifi/Kconfig
drivers/net/wireless/iwlwifi/iwl-3945-rs.c
drivers/net/wireless/iwlwifi/iwl-3945-rs.h
drivers/net/wireless/iwlwifi/iwl-3945.c
drivers/net/wireless/iwlwifi/iwl-4965.c
drivers/net/wireless/iwlwifi/iwl3945-base.c
drivers/net/wireless/iwlwifi/iwl4965-base.c
drivers/net/wireless/libertas/cmd.c
drivers/net/wireless/libertas/if_cs.c
drivers/net/wireless/libertas/if_sdio.c
drivers/net/wireless/rt2x00/rt2500pci.c
drivers/net/wireless/rt2x00/rt2500usb.c
drivers/net/wireless/rt2x00/rt2x00.h
drivers/net/wireless/rt2x00/rt2x00lib.h
drivers/net/wireless/rt2x00/rt2x00mac.c
drivers/net/wireless/rt2x00/rt2x00usb.c
drivers/net/wireless/rt2x00/rt73usb.c
drivers/net/wireless/rtl8187_dev.c
drivers/net/wireless/strip.c
drivers/oprofile/cpu_buffer.c
drivers/oprofile/cpu_buffer.h
drivers/oprofile/oprofile_stats.c
drivers/pci/Kconfig
drivers/pci/hotplug/Kconfig
drivers/pci/hotplug/cpqphp_ctrl.c
drivers/pci/intel-iommu.c
drivers/pci/intel-iommu.h
drivers/pci/msi.c
drivers/pci/pci-driver.c
drivers/pci/quirks.c
drivers/pci/search.c
drivers/pnp/pnpacpi/rsparser.c
drivers/rtc/Kconfig
drivers/rtc/hctosys.c
drivers/rtc/rtc-cmos.c
drivers/rtc/rtc-ds1307.c
drivers/rtc/rtc-ds1553.c
drivers/rtc/rtc-ds1742.c
drivers/rtc/rtc-m48t59.c
drivers/rtc/rtc-s3c.c
drivers/rtc/rtc-sh.c
drivers/rtc/rtc-stk17ta8.c
drivers/s390/block/dcssblk.c
drivers/s390/cio/cmf.c
drivers/s390/cio/css.c
drivers/s390/cio/device.c
drivers/s390/cio/device_fsm.c
drivers/s390/cio/device_id.c
drivers/s390/net/smsgiucv.c
drivers/s390/scsi/zfcp_def.h
drivers/scsi/Kconfig
drivers/scsi/aacraid/commctrl.c
drivers/scsi/aacraid/comminit.c
drivers/scsi/aacraid/dpcsup.c
drivers/scsi/aic94xx/aic94xx_sds.c
drivers/scsi/arcmsr/arcmsr.h
drivers/scsi/arcmsr/arcmsr_attr.c
drivers/scsi/arcmsr/arcmsr_hba.c
drivers/scsi/arm/scsi.h
drivers/scsi/ibmvscsi/ibmvscsi.c
drivers/scsi/lpfc/lpfc_scsi.c
drivers/scsi/osst.c
drivers/scsi/scsi_lib.c
drivers/scsi/scsi_scan.c
drivers/scsi/scsi_sysfs.c
drivers/scsi/sg.c
drivers/serial/8250_early.c
drivers/serial/8250_pci.c
drivers/serial/8250_pnp.c
drivers/serial/Kconfig
drivers/serial/atmel_serial.c
drivers/serial/crisv10.c
drivers/serial/crisv10.h [new file with mode: 0644]
drivers/serial/serial_cs.c
drivers/serial/serial_txx9.c
drivers/serial/sh-sci.h
drivers/serial/uartlite.c
drivers/sh/maple/maple.c
drivers/sh/superhyway/superhyway.c
drivers/spi/Kconfig
drivers/spi/spi.c
drivers/spi/spi_txx9.c
drivers/spi/spidev.c
drivers/spi/tle62x0.c
drivers/ssb/main.c
drivers/ssb/pcmcia.c
drivers/telephony/phonedev.c
drivers/usb/core/buffer.c
drivers/usb/core/hcd.c
drivers/usb/core/message.c
drivers/usb/core/usb.c
drivers/usb/serial/keyspan.c
drivers/video/Kconfig
drivers/video/aty/radeon_base.c
drivers/video/aty/radeon_pm.c
drivers/video/cirrusfb.c
drivers/video/console/Kconfig
drivers/video/cyber2000fb.c
drivers/video/gbefb.c
drivers/video/geode/lxfb.h
drivers/video/omap/Kconfig
drivers/video/ps3fb.c
drivers/video/s1d13xxxfb.c
drivers/video/sis/sis_main.c
drivers/video/uvesafb.c
drivers/virtio/virtio.c
drivers/virtio/virtio_ring.c
drivers/w1/Kconfig
drivers/w1/masters/ds2490.c
drivers/watchdog/Kconfig
drivers/watchdog/alim1535_wdt.c
drivers/watchdog/davinci_wdt.c
drivers/watchdog/i6300esb.c
drivers/watchdog/iTCO_wdt.c
drivers/watchdog/ib700wdt.c
drivers/watchdog/machzwd.c
drivers/watchdog/mpc83xx_wdt.c
drivers/watchdog/pc87413_wdt.c
drivers/watchdog/pnx4008_wdt.c
drivers/watchdog/sbc8360.c
drivers/watchdog/sc1200wdt.c
drivers/watchdog/sc520_wdt.c
drivers/watchdog/smsc37b787_wdt.c
drivers/watchdog/w83627hf_wdt.c
drivers/watchdog/w83697hf_wdt.c
drivers/watchdog/w83877f_wdt.c
drivers/watchdog/w83977f_wdt.c
drivers/watchdog/wafer5823wdt.c
drivers/watchdog/wdt.c
drivers/watchdog/wdt977.c
drivers/watchdog/wdt_pci.c
drivers/zorro/zorro-driver.c
fs/9p/v9fs.c
fs/9p/vfs_super.c
fs/Kconfig
fs/afs/vlocation.c
fs/bfs/bfs.h
fs/bfs/dir.c
fs/bfs/file.c
fs/bfs/inode.c
fs/cifs/CHANGES
fs/cifs/Makefile
fs/cifs/README
fs/cifs/TODO
fs/cifs/asn1.c
fs/cifs/cifs_spnego.c [new file with mode: 0644]
fs/cifs/cifs_spnego.h [new file with mode: 0644]
fs/cifs/cifsacl.c
fs/cifs/cifsacl.h
fs/cifs/cifsencrypt.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/dir.c
fs/cifs/file.c
fs/cifs/inode.c
fs/cifs/md5.c
fs/cifs/misc.c
fs/cifs/netmisc.c
fs/cifs/readdir.c
fs/cifs/sess.c
fs/cifs/smbencrypt.c
fs/cifs/transport.c
fs/cifs/xattr.c
fs/compat_ioctl.c
fs/dlm/lowcomms.c
fs/ecryptfs/crypto.c
fs/ecryptfs/read_write.c
fs/exec.c
fs/ext2/balloc.c
fs/ext2/ioctl.c
fs/ext3/balloc.c
fs/ext3/dir.c
fs/ext3/ioctl.c
fs/ext3/namei.c
fs/ext4/balloc.c
fs/ext4/ioctl.c
fs/fuse/file.c
fs/hugetlbfs/inode.c
fs/ioprio.c
fs/jfs/ioctl.c
fs/locks.c
fs/nfs/dir.c
fs/nfs/direct.c
fs/nfs/getroot.c
fs/nfs/super.c
fs/nfs/write.c
fs/nfsd/nfs2acl.c
fs/nfsd/nfs3acl.c
fs/nfsd/nfs4recover.c
fs/nfsd/nfsfh.c
fs/ntfs/aops.c
fs/ntfs/attrib.c
fs/ntfs/compress.c
fs/ocfs2/alloc.c
fs/ocfs2/aops.c
fs/ocfs2/cluster/heartbeat.c
fs/ocfs2/cluster/tcp.c
fs/ocfs2/dcache.c
fs/ocfs2/dir.c
fs/ocfs2/dlmglue.c
fs/ocfs2/file.c
fs/ocfs2/namei.c
fs/open.c
fs/proc/array.c
fs/proc/base.c
fs/proc/generic.c
fs/proc/internal.h
fs/proc/proc_net.c
fs/proc/root.c
fs/read_write.c
fs/reiserfs/ioctl.c
fs/reiserfs/stree.c
fs/smbfs/file.c
fs/smbfs/inode.c
fs/smbfs/proc.c
fs/smbfs/smbiod.c
fs/sysfs/dir.c
fs/sysfs/sysfs.h
fs/ufs/super.c
include/acpi/acpi_bus.h
include/acpi/processor.h
include/asm-arm/arch-at91/board.h
include/asm-arm/arch-davinci/gpio.h
include/asm-arm/arch-pxa/mfp-pxa300.h
include/asm-arm/arch-pxa/mfp-pxa320.h
include/asm-arm/arch-pxa/mfp.h
include/asm-arm/flat.h
include/asm-arm/hardware/iop3xx.h
include/asm-arm/pgtable.h
include/asm-arm/plat-s3c/regs-nand.h
include/asm-arm26/irq_regs.h [deleted file]
include/asm-avr32/sysreg.h
include/asm-blackfin/bfin-global.h
include/asm-blackfin/cplbinit.h
include/asm-blackfin/delay.h
include/asm-blackfin/fixed_code.h
include/asm-blackfin/gptimers.h
include/asm-blackfin/io.h
include/asm-blackfin/mach-bf527/defBF52x_base.h
include/asm-blackfin/mach-bf527/dma.h
include/asm-blackfin/mach-bf527/irq.h
include/asm-blackfin/mach-bf527/mem_map.h
include/asm-blackfin/mach-bf533/irq.h
include/asm-blackfin/mach-bf533/mem_map.h
include/asm-blackfin/mach-bf537/irq.h
include/asm-blackfin/mach-bf537/mem_map.h
include/asm-blackfin/mach-bf548/bf548.h
include/asm-blackfin/mach-bf548/defBF544.h
include/asm-blackfin/mach-bf548/defBF548.h
include/asm-blackfin/mach-bf548/defBF549.h
include/asm-blackfin/mach-bf548/defBF54x_base.h
include/asm-blackfin/mach-bf548/irq.h
include/asm-blackfin/mach-bf548/mem_map.h
include/asm-blackfin/mach-bf548/portmux.h
include/asm-blackfin/mach-bf561/bf561.h
include/asm-blackfin/mach-bf561/defBF561.h
include/asm-blackfin/mach-bf561/irq.h
include/asm-blackfin/mach-bf561/mem_map.h
include/asm-blackfin/mach-common/def_LPBlackfin.h
include/asm-blackfin/page_offset.h
include/asm-blackfin/string.h
include/asm-blackfin/traps.h
include/asm-cris/atomic.h
include/asm-cris/checksum.h
include/asm-cris/ethernet.h
include/asm-cris/fasttimer.h
include/asm-cris/hardirq.h
include/asm-cris/posix_types.h
include/asm-cris/termbits.h
include/asm-cris/thread_info.h
include/asm-cris/tlb.h
include/asm-cris/unistd.h
include/asm-frv/irq.h
include/asm-generic/resource.h
include/asm-ia64/acpi.h
include/asm-ia64/pal.h
include/asm-ia64/percpu.h
include/asm-ia64/smp.h
include/asm-m68knommu/unistd.h
include/asm-mips/8253pit.h [deleted file]
include/asm-mips/cpu-info.h
include/asm-mips/dma.h
include/asm-mips/futex.h
include/asm-mips/i8253.h
include/asm-mips/ip32/ip32_ints.h
include/asm-mips/jmr3927/jmr3927.h
include/asm-mips/jmr3927/tx3927.h
include/asm-mips/jmr3927/txx927.h
include/asm-mips/lasat/lasatint.h
include/asm-mips/mach-au1x00/timex.h [deleted file]
include/asm-mips/mach-cobalt/irq.h
include/asm-mips/mach-generic/timex.h [deleted file]
include/asm-mips/mach-jazz/timex.h [deleted file]
include/asm-mips/mach-lasat/irq.h [new file with mode: 0644]
include/asm-mips/mach-qemu/timex.h [deleted file]
include/asm-mips/mach-rm/timex.h [deleted file]
include/asm-mips/system.h
include/asm-mips/time.h
include/asm-mips/timex.h
include/asm-mips/tx4927/tx4927_pci.h
include/asm-mips/tx4938/tx4938.h
include/asm-mips/txx9tmr.h [new file with mode: 0644]
include/asm-powerpc/commproc.h
include/asm-powerpc/cputable.h
include/asm-powerpc/page_32.h
include/asm-powerpc/pci-bridge.h
include/asm-powerpc/pgtable-ppc32.h
include/asm-powerpc/rtas.h
include/asm-powerpc/systbl.h
include/asm-powerpc/time.h
include/asm-powerpc/tlbflush.h
include/asm-powerpc/vdso_datapage.h
include/asm-s390/system.h
include/asm-sh/cache.h
include/asm-sh/cacheflush.h
include/asm-sh/cpu-sh3/timer.h
include/asm-sh/irq.h
include/asm-sh/page.h
include/asm-sh/pgtable.h
include/asm-sh/processor.h
include/asm-sh/ptrace.h
include/asm-sh/setup.h
include/asm-sh/vga.h [new file with mode: 0644]
include/asm-sh64/dma-mapping.h
include/asm-sh64/pci.h
include/asm-sh64/ptrace.h
include/asm-sh64/scatterlist.h
include/asm-sparc64/futex.h
include/asm-sparc64/system.h
include/asm-sparc64/uaccess.h
include/asm-sparc64/vio.h
include/asm-um/pgtable-3level.h
include/asm-um/unistd.h
include/asm-x86/acpi.h
include/asm-x86/apic_32.h
include/asm-x86/gart.h [new file with mode: 0644]
include/asm-x86/i387_64.h
include/asm-x86/iommu.h
include/asm-x86/irqflags_32.h
include/asm-x86/irqflags_64.h
include/asm-x86/lguest_hcall.h
include/asm-x86/mach-default/mach_reboot.h
include/asm-x86/mach-es7000/mach_mpparse.h
include/asm-x86/mach-voyager/setup_arch.h
include/asm-x86/pci_64.h
include/asm-x86/ptrace.h
include/asm-x86/smp_32.h
include/linux/Kbuild
include/linux/acpi.h
include/linux/ata.h
include/linux/blkdev.h
include/linux/bootmem.h
include/linux/cgroup_subsys.h
include/linux/cpu_acct.h [deleted file]
include/linux/cpuidle.h
include/linux/device-mapper.h
include/linux/eventpoll.h
include/linux/ext3_fs.h
include/linux/f75375s.h [new file with mode: 0644]
include/linux/futex.h
include/linux/hugetlb.h
include/linux/i2c.h
include/linux/ide.h
include/linux/ipmi_smi.h
include/linux/kallsyms.h
include/linux/libata.h
include/linux/mc146818rtc.h
include/linux/mroute.h
include/linux/mv643xx_eth.h
include/linux/net.h
include/linux/netdevice.h
include/linux/netfilter/Kbuild
include/linux/netfilter_ipv4/Kbuild
include/linux/netfilter_ipv6/Kbuild
include/linux/netlink.h
include/linux/nfs_fs.h
include/linux/pci.h
include/linux/pci_ids.h
include/linux/pid_namespace.h
include/linux/proc_fs.h
include/linux/rtnetlink.h
include/linux/scatterlist.h
include/linux/sched.h
include/linux/selinux.h
include/linux/skbuff.h
include/linux/smp.h
include/linux/string.h
include/linux/sunrpc/debug.h
include/linux/sunrpc/rpc_rdma.h
include/linux/sunrpc/xprtsock.h
include/linux/sysctl.h
include/linux/timex.h
include/linux/tty.h
include/linux/types.h
include/linux/virtio_ring.h
include/net/af_unix.h
include/net/dst.h
include/net/esp.h
include/net/fib_rules.h
include/net/ieee80211.h
include/net/inet_common.h
include/net/inet_hashtables.h
include/net/inetpeer.h
include/net/ip_fib.h
include/net/ip_vs.h
include/net/mac80211.h
include/net/net_namespace.h
include/net/request_sock.h
include/net/sctp/auth.h
include/net/sctp/command.h
include/net/sctp/constants.h
include/net/sctp/sctp.h
include/net/sctp/structs.h
include/net/sock.h
include/net/tcp.h
include/pcmcia/cs_types.h
include/rdma/ib_verbs.h
include/scsi/libsas.h
include/scsi/scsi_device.h
include/sound/version.h
init/Kconfig
init/main.c
ipc/mqueue.c
kernel/Makefile
kernel/acct.c
kernel/cgroup.c
kernel/cpu_acct.c [deleted file]
kernel/exit.c
kernel/fork.c
kernel/futex.c
kernel/futex_compat.c
kernel/hrtimer.c
kernel/irq/handle.c
kernel/lockdep.c
kernel/marker.c
kernel/module.c
kernel/params.c
kernel/pid.c
kernel/power/disk.c
kernel/resource.c
kernel/sched.c
kernel/sched_debug.c
kernel/sched_fair.c
kernel/sched_stats.h
kernel/signal.c
kernel/sys.c
kernel/sys_ni.c
kernel/sysctl.c
kernel/sysctl_check.c
kernel/taskstats.c
kernel/time/ntp.c
kernel/time/tick-broadcast.c
kernel/time/tick-sched.c
kernel/time/timer_list.c
kernel/timer.c
kernel/user.c
lib/Kconfig.debug
lib/Makefile
lib/bitmap.c
lib/kobject.c
lib/libcrc32c.c
mm/filemap.c
mm/hugetlb.c
mm/memory.c
mm/memory_hotplug.c
mm/mempolicy.c
mm/nommu.c
mm/page-writeback.c
mm/page_alloc.c
mm/page_isolation.c
mm/rmap.c
mm/shmem.c
mm/slab.c
mm/slob.c
mm/slub.c
mm/sparse-vmemmap.c
mm/sparse.c
mm/util.c
mm/vmstat.c
net/8021q/vlan.c
net/8021q/vlan.h
net/8021q/vlan_dev.c
net/9p/mod.c
net/9p/trans_fd.c
net/appletalk/ddp.c
net/atm/common.c
net/ax25/af_ax25.c
net/bluetooth/bnep/sock.c
net/bluetooth/cmtp/sock.c
net/bluetooth/hci_sock.c
net/bluetooth/hidp/sock.c
net/bluetooth/l2cap.c
net/bluetooth/rfcomm/sock.c
net/bluetooth/sco.c
net/bridge/br_netfilter.c
net/bridge/netfilter/ebt_among.c
net/bridge/netfilter/ebt_arp.c
net/core/dev.c
net/core/dev_mcast.c
net/core/dst.c
net/core/fib_rules.c
net/core/neighbour.c
net/core/net_namespace.c
net/core/netpoll.c
net/core/pktgen.c
net/core/request_sock.c
net/core/skbuff.c
net/core/sock.c
net/dccp/ccids/lib/loss_interval.c
net/dccp/ipv4.c
net/dccp/ipv6.c
net/dccp/proto.c
net/decnet/af_decnet.c
net/decnet/dn_dev.c
net/decnet/dn_route.c
net/decnet/dn_rules.c
net/econet/af_econet.c
net/ieee80211/ieee80211_crypt_ccmp.c
net/ieee80211/ieee80211_crypt_tkip.c
net/ieee80211/ieee80211_crypt_wep.c
net/ieee80211/softmac/ieee80211softmac_wx.c
net/ipv4/af_inet.c
net/ipv4/ah4.c
net/ipv4/arp.c
net/ipv4/esp4.c
net/ipv4/fib_frontend.c
net/ipv4/fib_rules.c
net/ipv4/inet_diag.c
net/ipv4/inet_hashtables.c
net/ipv4/inet_timewait_sock.c
net/ipv4/inetpeer.c
net/ipv4/ip_output.c
net/ipv4/ip_sockglue.c
net/ipv4/ipcomp.c
net/ipv4/ipvs/ip_vs_conn.c
net/ipv4/ipvs/ip_vs_core.c
net/ipv4/ipvs/ip_vs_ctl.c
net/ipv4/ipvs/ip_vs_lblc.c
net/ipv4/ipvs/ip_vs_lblcr.c
net/ipv4/ipvs/ip_vs_proto.c
net/ipv4/ipvs/ip_vs_sync.c
net/ipv4/netfilter/Kconfig
net/ipv4/netfilter/Makefile
net/ipv4/netfilter/ip_queue.c
net/ipv4/netfilter/iptable_raw.c
net/ipv4/netfilter/nf_nat_amanda.c
net/ipv4/netfilter/nf_nat_core.c
net/ipv4/netfilter/nf_nat_ftp.c
net/ipv4/netfilter/nf_nat_h323.c
net/ipv4/netfilter/nf_nat_irc.c
net/ipv4/netfilter/nf_nat_pptp.c
net/ipv4/netfilter/nf_nat_sip.c
net/ipv4/netfilter/nf_nat_tftp.c
net/ipv4/proc.c
net/ipv4/raw.c
net/ipv4/route.c
net/ipv4/sysctl_net_ipv4.c
net/ipv4/tcp.c
net/ipv4/tcp_input.c
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_output.c
net/ipv4/tcp_vegas.c
net/ipv4/tunnel4.c
net/ipv4/udp.c
net/ipv4/udplite.c
net/ipv6/addrconf.c
net/ipv6/af_inet6.c
net/ipv6/ah6.c
net/ipv6/esp6.c
net/ipv6/fib6_rules.c
net/ipv6/inet6_hashtables.c
net/ipv6/ip6_output.c
net/ipv6/ipcomp6.c
net/ipv6/ndisc.c
net/ipv6/netfilter/Makefile
net/ipv6/netfilter/ip6_queue.c
net/ipv6/proc.c
net/ipv6/raw.c
net/ipv6/route.c
net/ipv6/tcp_ipv6.c
net/ipv6/udp.c
net/ipv6/udplite.c
net/ipx/af_ipx.c
net/irda/af_irda.c
net/irda/iriap.c
net/irda/irlan/irlan_eth.c
net/irda/irnet/irnet_ppp.c
net/iucv/af_iucv.c
net/iucv/iucv.c
net/key/af_key.c
net/llc/llc_conn.c
net/mac80211/Kconfig
net/mac80211/Makefile
net/mac80211/aes_ccm.c
net/mac80211/ieee80211.c
net/mac80211/ieee80211_common.h [deleted file]
net/mac80211/ieee80211_i.h
net/mac80211/ieee80211_ioctl.c
net/mac80211/ieee80211_rate.c
net/mac80211/ieee80211_rate.h
net/mac80211/ieee80211_sta.c
net/mac80211/rc80211_simple.c
net/mac80211/rx.c
net/mac80211/wep.c
net/mac80211/wpa.c
net/netfilter/Kconfig
net/netfilter/Makefile
net/netfilter/nf_conntrack_core.c
net/netfilter/nf_conntrack_extend.c
net/netfilter/nf_sockopt.c
net/netfilter/xt_connlimit.c
net/netfilter/xt_time.c
net/netfilter/xt_u32.c
net/netlink/af_netlink.c
net/netrom/af_netrom.c
net/packet/af_packet.c
net/rfkill/rfkill.c
net/rose/af_rose.c
net/rxrpc/af_rxrpc.c
net/rxrpc/ar-local.c
net/rxrpc/rxkad.c
net/sched/cls_u32.c
net/sched/sch_generic.c
net/sched/sch_teql.c
net/sctp/associola.c
net/sctp/auth.c
net/sctp/bind_addr.c
net/sctp/endpointola.c
net/sctp/input.c
net/sctp/inqueue.c
net/sctp/ipv6.c
net/sctp/outqueue.c
net/sctp/proc.c
net/sctp/protocol.c
net/sctp/sm_make_chunk.c
net/sctp/sm_sideeffect.c
net/sctp/sm_statefuns.c
net/sctp/socket.c
net/sctp/sysctl.c
net/sctp/transport.c
net/sctp/ulpqueue.c
net/socket.c
net/sunrpc/auth_gss/auth_gss.c
net/sunrpc/auth_gss/gss_krb5_crypto.c
net/sunrpc/auth_gss/gss_krb5_mech.c
net/sunrpc/auth_gss/gss_krb5_seal.c
net/sunrpc/auth_gss/gss_krb5_wrap.c
net/sunrpc/rpc_pipe.c
net/sunrpc/sysctl.c
net/sunrpc/xprt.c
net/sunrpc/xprtrdma/rpc_rdma.c
net/sunrpc/xprtrdma/transport.c
net/sunrpc/xprtsock.c
net/tipc/socket.c
net/unix/af_unix.c
net/unix/garbage.c
net/wireless/wext.c
net/x25/af_x25.c
net/xfrm/xfrm_algo.c
net/xfrm/xfrm_state.c
net/xfrm/xfrm_user.c
samples/markers/marker-example.c
samples/markers/probe-example.c
scripts/kconfig/Makefile
scripts/kconfig/confdata.c
security/commoncap.c
security/selinux/ss/avtab.c
security/selinux/ss/avtab.h
security/selinux/ss/conditional.c
security/selinux/ss/ebitmap.c
security/selinux/ss/mls.c
security/selinux/ss/mls.h
security/selinux/ss/policydb.c
security/selinux/ss/policydb.h
security/selinux/xfrm.c
sound/drivers/mpu401/mpu401_uart.c
sound/drivers/portman2x4.c
sound/pci/ca0106/ca0106_mixer.c
sound/pci/ca0106/ca0106_proc.c
sound/pci/cmipci.c
sound/pci/emu10k1/emumixer.c
sound/pci/emu10k1/p16v.c
sound/pci/hda/hda_codec.c
sound/pci/hda/hda_local.h
sound/pci/hda/patch_analog.c
sound/pci/hda/patch_realtek.c
sound/pci/hda/patch_sigmatel.c
sound/soc/codecs/cs4270.c
sound/soc/s3c24xx/s3c2443-ac97.c

index a30dd4480ad4f389e3eb80677870c216e3de38e1..681e2b36195c98ea5271b76383b3a574b190b04f 100644 (file)
@@ -464,8 +464,8 @@ section Linus Computer Science 101.
 Nuff said.  If your code deviates too much from this, it is likely
 to be rejected without further review, and without comment.
 
-Once significant exception is when moving code from one file to
-another in this case you should not modify the moved code at all in
+One significant exception is when moving code from one file to
+another -- in this case you should not modify the moved code at all in
 the same patch which moves it.  This clearly delineates the act of
 moving the code and your changes.  This greatly aids review of the
 actual differences and allows tools to better track the history of
index ab82b7f53312a58719766e68dd5081d0724a4d75..d6cb1a86fd61ebcdf05b95d95e5517a891b2e63c 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <linux/genetlink.h>
 #include <linux/taskstats.h>
+#include <linux/cgroupstats.h>
 
 /*
  * Generic macros for dealing with netlink sockets. Might be duplicated
@@ -78,6 +79,7 @@ static void usage(void)
        fprintf(stderr, "  -i: print IO accounting (works only with -p)\n");
        fprintf(stderr, "  -l: listen forever\n");
        fprintf(stderr, "  -v: debug on\n");
+       fprintf(stderr, "  -C: container path\n");
 }
 
 /*
@@ -212,6 +214,14 @@ void task_context_switch_counts(struct taskstats *t)
               t->nvcsw, t->nivcsw);
 }
 
+void print_cgroupstats(struct cgroupstats *c)
+{
+       printf("sleeping %llu, blocked %llu, running %llu, stopped %llu, "
+               "uninterruptible %llu\n", c->nr_sleeping, c->nr_io_wait,
+               c->nr_running, c->nr_stopped, c->nr_uninterruptible);
+}
+
+
 void print_ioacct(struct taskstats *t)
 {
        printf("%s: read=%llu, write=%llu, cancelled_write=%llu\n",
@@ -239,11 +249,14 @@ int main(int argc, char *argv[])
        int maskset = 0;
        char *logfile = NULL;
        int loop = 0;
+       int containerset = 0;
+       char containerpath[1024];
+       int cfd = 0;
 
        struct msgtemplate msg;
 
        while (1) {
-               c = getopt(argc, argv, "qdiw:r:m:t:p:vl");
+               c = getopt(argc, argv, "qdiw:r:m:t:p:vlC:");
                if (c < 0)
                        break;
 
@@ -260,6 +273,10 @@ int main(int argc, char *argv[])
                        printf("printing task/process context switch rates\n");
                        print_task_context_switch_counts = 1;
                        break;
+               case 'C':
+                       containerset = 1;
+                       strncpy(containerpath, optarg, strlen(optarg) + 1);
+                       break;
                case 'w':
                        logfile = strdup(optarg);
                        printf("write to file %s\n", logfile);
@@ -334,6 +351,11 @@ int main(int argc, char *argv[])
                }
        }
 
+       if (tid && containerset) {
+               fprintf(stderr, "Select either -t or -C, not both\n");
+               goto err;
+       }
+
        if (tid) {
                rc = send_cmd(nl_sd, id, mypid, TASKSTATS_CMD_GET,
                              cmd_type, &tid, sizeof(__u32));
@@ -344,6 +366,20 @@ int main(int argc, char *argv[])
                }
        }
 
+       if (containerset) {
+               cfd = open(containerpath, O_RDONLY);
+               if (cfd < 0) {
+                       perror("error opening container file");
+                       goto err;
+               }
+               rc = send_cmd(nl_sd, id, mypid, CGROUPSTATS_CMD_GET,
+                             CGROUPSTATS_CMD_ATTR_FD, &cfd, sizeof(__u32));
+               if (rc < 0) {
+                       perror("error sending cgroupstats command");
+                       goto err;
+               }
+       }
+
        do {
                int i;
 
@@ -422,6 +458,9 @@ int main(int argc, char *argv[])
                                }
                                break;
 
+                       case CGROUPSTATS_TYPE_CGROUP_STATS:
+                               print_cgroupstats(NLA_DATA(na));
+                               break;
                        default:
                                fprintf(stderr, "Unknown nla_type %d\n",
                                        na->nla_type);
@@ -443,5 +482,7 @@ err:
        close(nl_sd);
        if (fd)
                close(fd);
+       if (cfd)
+               close(cfd);
        return 0;
 }
index 6bb9be54ab767817557b680407edca2f582e03e9..20c4c8bac9d7d599fa43e1162b7db62cb7ad9011 100644 (file)
@@ -181,15 +181,6 @@ Who:       Nick Piggin <npiggin@suse.de>
 
 ---------------------------
 
-What:  Interrupt only SA_* flags
-When:  September 2007
-Why:   The interrupt related SA_* flags are replaced by IRQF_* to move them
-       out of the signal namespace.
-
-Who:   Thomas Gleixner <tglx@linutronix.de>
-
----------------------------
-
 What:  PHYSDEVPATH, PHYSDEVBUS, PHYSDEVDRIVER in the uevent environment
 When:  October 2008
 Why:   The stacking of class devices makes these values misleading and
index a17b692d2679ca520adfa986d9035a19ea88bd57..f4a8ebc1ef1acc11ae4bdd22c9299f4b84467c73 100644 (file)
@@ -328,6 +328,37 @@ curr[1-*]_input    Current input value
                Unit: milliampere
                RO
 
+*********
+* Power *
+*********
+
+power[1-*]_average             Average power use
+                               Unit: microWatt
+                               RO
+
+power[1-*]_average_highest     Historical average maximum power use
+                               Unit: microWatt
+                               RO
+
+power[1-*]_average_lowest      Historical average minimum power use
+                               Unit: microWatt
+                               RO
+
+power[1-*]_input               Instantaneous power use
+                               Unit: microWatt
+                               RO
+
+power[1-*]_input_highest       Historical maximum power use
+                               Unit: microWatt
+                               RO
+
+power[1-*]_input_lowest                Historical minimum power use
+                               Unit: microWatt
+                               RO
+
+power[1-*]_reset_history       Reset input_highest, input_lowest,
+                               average_highest and average_lowest.
+                               WO
 
 **********
 * Alarms *
index 2f75e750e4f5c650a89df593ead1a1ff320eee62..fc49b79bc1ab3341b16fe19ea49402f9fd1955e2 100644 (file)
@@ -785,3 +785,41 @@ IMPORTANT: All the hooks are required to preserve %esp, %ebp, %esi and
        After completing your hook, you should jump to the address
        that was in this field before your boot loader overwrote it
        (relocated, if appropriate.)
+
+
+**** 32-bit BOOT PROTOCOL
+
+For machine with some new BIOS other than legacy BIOS, such as EFI,
+LinuxBIOS, etc, and kexec, the 16-bit real mode setup code in kernel
+based on legacy BIOS can not be used, so a 32-bit boot protocol needs
+to be defined.
+
+In 32-bit boot protocol, the first step in loading a Linux kernel
+should be to setup the boot parameters (struct boot_params,
+traditionally known as "zero page"). The memory for struct boot_params
+should be allocated and initialized to all zero. Then the setup header
+from offset 0x01f1 of kernel image on should be loaded into struct
+boot_params and examined. The end of setup header can be calculated as
+follow:
+
+       0x0202 + byte value at offset 0x0201
+
+In addition to read/modify/write the setup header of the struct
+boot_params as that of 16-bit boot protocol, the boot loader should
+also fill the additional fields of the struct boot_params as that
+described in zero-page.txt.
+
+After setupping the struct boot_params, the boot loader can load the
+32/64-bit kernel in the same way as that of 16-bit boot protocol.
+
+In 32-bit boot protocol, the kernel is started by jumping to the
+32-bit kernel entry point, which is the start address of loaded
+32/64-bit kernel.
+
+At entry, the CPU must be in 32-bit protected mode with paging
+disabled; a GDT must be loaded with the descriptors for selectors
+__BOOT_CS(0x10) and __BOOT_DS(0x18); both descriptors must be 4G flat
+segment; __BOOS_CS must have execute/read permission, and __BOOT_DS
+must have read/write permission; CS must be __BOOT_CS and DS, ES, SS
+must be __BOOT_DS; interrupt must be disabled; %esi must hold the base
+address of the struct boot_params; %ebp, %edi and %ebx must be zero.
index 6c0817c45683fd07f6367c8234d419a4e824ee48..169ad423a3d12243023d5807d1d7a4025d1a3978 100644 (file)
@@ -1,99 +1,31 @@
----------------------------------------------------------------------------
-!!!!!!!!!!!!!!!WARNING!!!!!!!!
-The zero page is a kernel internal data structure, not a stable ABI.  It might change
-without warning and the kernel has no way to detect old version of it.
-If you're writing some external code like a boot loader you should only use
-the stable versioned real mode boot protocol described in boot.txt. Otherwise the kernel
-might break you at any time.
-!!!!!!!!!!!!!WARNING!!!!!!!!!!!
-----------------------------------------------------------------------------
+The additional fields in struct boot_params as a part of 32-bit boot
+protocol of kernel. These should be filled by bootloader or 16-bit
+real-mode setup code of the kernel. References/settings to it mainly
+are in:
 
-Summary of boot_params layout (kernel point of view)
-     ( collected by Hans Lermen and Martin Mares )
-The contents of boot_params are used to pass parameters from the
-16-bit realmode code of the kernel to the 32-bit part. References/settings
-to it mainly are in:
+  include/asm-x86/bootparam.h
 
-  arch/i386/boot/setup.S
-  arch/i386/boot/video.S
-  arch/i386/kernel/head.S
-  arch/i386/kernel/setup.c
 
-Offset Type            Description
-------  ----           -----------
-    0  32 bytes        struct screen_info, SCREEN_INFO
-                       ATTENTION, overlaps the following !!!
-    2  unsigned short  EXT_MEM_K, extended memory size in Kb (from int 0x15)
- 0x20  unsigned short  CL_MAGIC, commandline magic number (=0xA33F)
- 0x22  unsigned short  CL_OFFSET, commandline offset
-                       Address of commandline is calculated:
-                         0x90000 + contents of CL_OFFSET
-                       (only taken, when CL_MAGIC = 0xA33F)
- 0x40  20 bytes        struct apm_bios_info, APM_BIOS_INFO
- 0x60  16 bytes        Intel SpeedStep (IST) BIOS support information
- 0x80  16 bytes        hd0-disk-parameter from intvector 0x41
- 0x90  16 bytes        hd1-disk-parameter from intvector 0x46
+Offset Proto   Name            Meaning
+/Size
 
- 0xa0  16 bytes        System description table truncated to 16 bytes.
-                       ( struct sys_desc_table_struct )
- 0xb0 - 0x13f          Free. Add more parameters here if you really need them.
- 0x140- 0x1be          EDID_INFO Video mode setup
-
-0x1c4  unsigned long   EFI system table pointer
-0x1c8  unsigned long   EFI memory descriptor size
-0x1cc  unsigned long   EFI memory descriptor version
-0x1d0  unsigned long   EFI memory descriptor map pointer
-0x1d4  unsigned long   EFI memory descriptor map size
-0x1e0  unsigned long   ALT_MEM_K, alternative mem check, in Kb
-0x1e4  unsigned long   Scratch field for the kernel setup code
-0x1e8  char            number of entries in E820MAP (below)
-0x1e9  unsigned char   number of entries in EDDBUF (below)
-0x1ea  unsigned char   number of entries in EDD_MBR_SIG_BUFFER (below)
-0x1f1  char            size of setup.S, number of sectors
-0x1f2  unsigned short  MOUNT_ROOT_RDONLY (if !=0)
-0x1f4  unsigned short  size of compressed kernel-part in the
-                       (b)zImage-file (in 16 byte units, rounded up)
-0x1f6  unsigned short  swap_dev (unused AFAIK)
-0x1f8  unsigned short  RAMDISK_FLAGS
-0x1fa  unsigned short  VGA-Mode (old one)
-0x1fc  unsigned short  ORIG_ROOT_DEV (high=Major, low=minor)
-0x1ff  char            AUX_DEVICE_INFO
-
-0x200  short jump to start of setup code aka "reserved" field.
-0x202  4 bytes         Signature for SETUP-header, ="HdrS"
-0x206  unsigned short  Version number of header format
-                       Current version is 0x0201...
-0x208  8 bytes         (used by setup.S for communication with boot loaders,
-                        look there)
-0x210  char            LOADER_TYPE, = 0, old one
-                       else it is set by the loader:
-                       0xTV: T=0 for LILO
-                               1 for Loadlin
-                               2 for bootsect-loader
-                               3 for SYSLINUX
-                               4 for ETHERBOOT
-                               5 for ELILO
-                               7 for GRuB
-                               8 for U-BOOT
-                               9 for Xen
-                               V = version
-0x211  char            loadflags:
-                       bit0 = 1: kernel is loaded high (bzImage)
-                       bit7 = 1: Heap and pointer (see below) set by boot
-                                 loader.
-0x212  unsigned short  (setup.S)
-0x214  unsigned long   KERNEL_START, where the loader started the kernel
-0x218  unsigned long   INITRD_START, address of loaded ramdisk image
-0x21c  unsigned long   INITRD_SIZE, size in bytes of ramdisk image
-0x220  4 bytes         (setup.S)
-0x224  unsigned short  setup.S heap end pointer
-0x226   unsigned short zero_pad
-0x228   unsigned long  cmd_line_ptr
-0x22c   unsigned long  ramdisk_max
-0x230   16 bytes       trampoline
-0x290 - 0x2cf          EDD_MBR_SIG_BUFFER (edd.S)
-0x2d0 - 0xd00          E820MAP
-0xd00 - 0xeff          EDDBUF (edd.S) for disk signature read sector
-0xd00 - 0xeeb          EDDBUF (edd.S) for edd data
+000/040        ALL     screen_info     Text mode or frame buffer information
+                               (struct screen_info)
+040/014        ALL     apm_bios_info   APM BIOS information (struct apm_bios_info)
+060/010        ALL     ist_info        Intel SpeedStep (IST) BIOS support information
+                               (struct ist_info)
+080/010        ALL     hd0_info        hd0 disk parameter, OBSOLETE!!
+090/010        ALL     hd1_info        hd1 disk parameter, OBSOLETE!!
+0A0/010        ALL     sys_desc_table  System description table (struct sys_desc_table)
+140/080        ALL     edid_info       Video mode setup (struct edid_info)
+1C0/020        ALL     efi_info        EFI 32 information (struct efi_info)
+1E0/004        ALL     alk_mem_k       Alternative mem check, in KB
+1E4/004        ALL     scratch         Scratch field for the kernel setup code
+1E8/001        ALL     e820_entries    Number of entries in e820_map (below)
+1E9/001        ALL     eddbuf_entries  Number of entries in eddbuf (below)
+1EA/001        ALL     edd_mbr_sig_buf_entries Number of entries in edd_mbr_sig_buffer
+                               (below)
+290/040        ALL     edd_mbr_sig_buffer EDD MBR signatures
+2D0/A00        ALL     e820_map        E820 memory map table
+                               (array of struct e820entry)
+D00/1EC        ALL     eddbuf          EDD data (array of struct edd_info)
diff --git a/Documentation/ja_JP/SubmittingPatches b/Documentation/ja_JP/SubmittingPatches
new file mode 100644 (file)
index 0000000..a9dc124
--- /dev/null
@@ -0,0 +1,556 @@
+NOTE:
+This is a version of Documentation/SubmittingPatches into Japanese.
+This document is maintained by Keiichi KII <k-keiichi@bx.jp.nec.com>
+and the JF Project team <http://www.linux.or.jp/JF/>.
+If you find any difference between this document and the original file
+or a problem with the translation,
+please contact the maintainer of this file or JF project.
+
+Please also note that the purpose of this file is to be easier to read
+for non English (read: Japanese) speakers and is not intended as a
+fork. So if you have any comments or updates of this file, please try
+to update the original English file first.
+
+Last Updated: 2007/10/24
+==================================
+これは、
+linux-2.6.23/Documentation/SubmittingPatches の和訳
+です。
+翻訳団体: JF プロジェクト < http://www.linux.or.jp/JF/ >
+翻訳日: 2007/10/17
+翻訳者: Keiichi Kii <k-keiichi at bx dot jp dot nec dot com>
+校正者: Masanari Kobayashi さん <zap03216 at nifty dot ne dot jp>
+         Matsukura さん <nbh--mats at nifty dot com>
+==================================
+
+        Linux カーネルに変更を加えるための Howto
+        又は
+        かの Linus Torvalds の取り扱い説明書
+
+Linux カーネルに変更を加えたいと思っている個人又は会社にとって、パッ
+チの投稿に関連した仕組みに慣れていなければ、その過程は時々みなさんを
+おじけづかせることもあります。この文章はあなたの変更を大いに受け入れ
+てもらえやすくする提案を集めたものです。
+
+コードを投稿する前に、Documentation/SubmitChecklist の項目リストに目
+を通してチェックしてください。もしあなたがドライバーを投稿しようとし
+ているなら、Documentation/SubmittingDrivers にも目を通してください。
+
+--------------------------------------------
+セクション1 パッチの作り方と送り方
+--------------------------------------------
+
+1) 「 diff -up 」
+------------
+
+パッチの作成には「 diff -up 」又は「 diff -uprN 」を使ってください。
+
+Linux カーネルに対する全ての変更は diff(1) コマンドによるパッチの形式で
+生成してください。パッチを作成するときには、diff(1) コマンドに「 -u 」引
+数を指定して、unified 形式のパッチを作成することを確認してください。また、
+変更がどの C 関数で行われたのかを表示する「 -p 」引数を使ってください。
+この引数は生成した差分をずっと読みやすくしてくれます。パッチは Linux
+カーネルソースの中のサブディレクトリではなく Linux カーネルソースのルート
+ディレクトリを基準にしないといけません。
+
+1個のファイルについてのパッチを作成するためには、ほとんどの場合、
+以下の作業を行えば十分です。
+
+       SRCTREE= linux-2.6
+       MYFILE=  drivers/net/mydriver.c
+
+       cd $SRCTREE
+       cp $MYFILE $MYFILE.orig
+       vi $MYFILE      # make your change
+       cd ..
+       diff -up $SRCTREE/$MYFILE{.orig,} > /tmp/patch
+
+複数のファイルについてのパッチを作成するためには、素の( vanilla )、す
+なわち変更を加えてない Linux カーネルを展開し、自分の Linux カーネル
+ソースとの差分を生成しないといけません。例えば、
+
+       MYSRC= /devel/linux-2.6
+
+       tar xvfz linux-2.6.12.tar.gz
+       mv linux-2.6.12 linux-2.6.12-vanilla
+       diff -uprN -X linux-2.6.12-vanilla/Documentation/dontdiff \
+               linux-2.6.12-vanilla $MYSRC > /tmp/patch
+
+dontdiff ファイルには Linux カーネルのビルドプロセスの過程で生成された
+ファイルの一覧がのっています。そして、それらはパッチを生成する diff(1)
+コマンドで無視されるべきです。dontdiff ファイルは 2.6.12 以後のバージョ
+ンの Linux カーネルソースツリーに含まれています。それより前のバージョン
+の Linux カーネルソースツリーに対する dontdiff ファイルは、
+<http://www.xenotime.net/linux/doc/dontdiff>から取得することができます。
+
+投稿するパッチの中に関係のない余分なファイルが含まれていないことを確
+認してください。diff(1) コマンドで生成したパッチがあなたの意図したとお
+りのものであることを確認してください。
+
+もしあなたのパッチが多くの差分を生み出すのであれば、あなたはパッチ
+を意味のあるひとまとまりごとに分けたいと思うかもしれません。
+これは他のカーネル開発者にとってレビューしやすくなるので、あなたの
+パッチを受け入れてもらうためにはとても重要なことです。これを補助でき
+る多くのスクリプトがあります。
+
+Quilt:
+http://savannah.nongnu.org/projects/quilt
+
+Andrew Morton's patch scripts:
+http://www.zip.com.au/~akpm/linux/patches/
+このリンクの先のスクリプトの代わりとして、quilt がパッチマネジメント
+ツールとして推奨されています(上のリンクを見てください)。
+
+2) パッチに対する説明
+
+パッチの中の変更点に対する技術的な詳細について説明してください。
+
+説明はできる限り具体的に。もっとも悪い説明は「ドライバー X を更新」、
+「ドライバー X に対するバグフィックス」あるいは「このパッチはサブシス
+テム X に対する更新を含んでいます。どうか取り入れてください。」などです。
+
+説明が長くなりだしたのであれば、おそらくそれはパッチを分ける必要がある
+という兆候です。次の #3 を見てください。
+
+3) パッチの分割
+
+意味のあるひとまとまりごとに変更を個々のパッチファイルに分けてください。
+
+例えば、もし1つのドライバーに対するバグフィックスとパフォーマンス強
+化の両方の変更を含んでいるのであれば、その変更を2つ以上のパッチに分
+けてください。もし変更箇所に API の更新と、その新しい API を使う新たな
+ドライバーが含まれているなら、2つのパッチに分けてください。
+
+一方で、もしあなたが多数のファイルに対して意味的に同じ1つの変更を加え
+るのであれば、その変更を1つのパッチにまとめてください。言いかえると、
+意味的に同じ1つの変更は1つのパッチの中に含まれます。
+
+あるパッチが変更を完結させるために他のパッチに依存していたとしても、
+それは問題ありません。パッチの説明の中で「このパッチはパッチ X に依存
+している」と簡単に注意書きをつけてください。
+
+もしパッチをより小さなパッチの集合に凝縮することができないなら、まずは
+15かそこらのパッチを送り、そのレビューと統合を待って下さい。
+
+4) パッチのスタイルチェック
+
+あなたのパッチが基本的な( Linux カーネルの)コーディングスタイルに違反し
+ていないかをチェックして下さい。その詳細を Documentation/CodingStyle で
+見つけることができます。コーディングスタイルの違反はレビューする人の
+時間を無駄にするだけなので、恐らくあなたのパッチは読まれることすらなく
+拒否されるでしょう。
+
+あなたはパッチを投稿する前に最低限パッチスタイルチェッカー
+( scripts/patchcheck.pl )を利用してパッチをチェックすべきです。
+もしパッチに違反がのこっているならば、それらの全てについてあなたは正当な
+理由を示せるようにしておく必要があります。
+
+5) 電子メールの宛先の選び方
+
+MAINTAINERS ファイルとソースコードに目を通してください。そして、その変
+更がメンテナのいる特定のサブシステムに加えられるものであることが分か
+れば、その人に電子メールを送ってください。
+
+もし、メンテナが載っていなかったり、メンテナからの応答がないなら、
+LKML ( linux-kernel@vger.kernel.org )へパッチを送ってください。ほとんど
+のカーネル開発者はこのメーリングリストに目を通しており、変更に対して
+コメントを得ることができます。
+
+15個より多くのパッチを同時に vger.kernel.org のメーリングリストへ送らな
+いでください!!!
+
+Linus Torvalds は Linux カーネルに入る全ての変更に対する最終的な意思決定者
+です。電子メールアドレスは torvalds@linux-foundation.org になります。彼は
+多くの電子メールを受け取っているため、できる限り彼に電子メールを送るのは
+避けるべきです。
+
+バグフィックスであったり、自明な変更であったり、話し合いをほとんど
+必要としないパッチは Linus へ電子メールを送るか CC しなければなりません。
+話し合いを必要としたり、明確なアドバンテージがないパッチは、通常まず
+は LKML へ送られるべきです。パッチが議論された後にだけ、そのパッチを
+Linus へ送るべきです。
+
+6) CC (カーボンコピー)先の選び方
+
+特に理由がないなら、LKML にも CC してください。
+
+Linus 以外のカーネル開発者は変更に気づく必要があり、その結果、彼らはそ
+の変更に対してコメントをくれたり、コードに対してレビューや提案をくれ
+るかもしれません。LKML とは Linux カーネル開発者にとって一番中心的なメー
+リングリストです。USB やフレームバッファデバイスや VFS や SCSI サブシステ
+ムなどの特定のサブシステムに関するメーリングリストもあります。あなた
+の変更に、はっきりと関連のあるメーリングリストについて知りたければ
+MAINTAINERS ファイルを参照してください。
+
+VGER.KERNEL.ORG でホスティングされているメーリングリストの一覧が下記の
+サイトに載っています。
+<http://vger.kernel.org/vger-lists.html>
+
+もし、変更がユーザランドのカーネルインタフェースに影響を与え
+るのであれば、MAN-PAGES のメンテナ( MAINTAINERS ファイルに一覧
+があります)に man ページのパッチを送ってください。少なくとも
+情報がマニュアルページの中に入ってくるように、変更が起きたという
+通知を送ってください。
+
+たとえ、メンテナが #4 で反応がなかったとしても、メンテナのコードに変更を
+加えたときには、いつもメンテナに CC するのを忘れないようにしてください。
+
+小さなパッチであれば、Adrian Bunk が管理している Trivial Patch Monkey
+(ちょっとしたパッチを集めている)<trivial@kernel.org>に CC してもいい
+です。ちょっとしたパッチとは以下のルールのどれか1つを満たしていなけ
+ればなりません。
+ ・ドキュメントのスペルミスの修正
+ ・grep(1) コマンドによる検索を困難にしているスペルの修正
+ ・コンパイル時の警告の修正(無駄な警告が散乱することは好ましくないた
+   めです)
+ ・コンパイル問題の修正(それらの修正が本当に正しい場合に限る)
+ ・実行時の問題の修正(それらの修正が本当に問題を修正している場合に限る)
+ ・廃止予定の関数やマクロを使用しているコードの除去(例 check_region )
+ ・問い合わせ先やドキュメントの修正
+ ・移植性のないコードから移植性のあるコードへの置き換え(小さい範囲で
+   あればアーキテクチャ特有のことでも他の人がコピーできます)
+ ・作者やメンテナによる修正(すなわち patch monkey の再転送モード)
+URL: <http://www.kernel.org/pub/linux/kernel/people/bunk/trivial/>
+
+7) MIME やリンクや圧縮ファイルや添付ファイルではなくプレインテキストのみ
+
+Linus や他のカーネル開発者はあなたが投稿した変更を読んで、コメントでき
+る必要があります。カーネル開発者にとって、あなたが書いたコードの特定の
+部分にコメントをするために、標準的な電子メールクライアントで変更が引用
+できることは重要です。
+
+上記の理由で、すべてのパッチは文中に含める形式の電子メールで投稿さ
+れるべきです。警告:あなたがパッチをコピー&ペーストする際には、パッ
+チを改悪するエディターの折り返し機能に注意してください。
+
+パッチを圧縮の有無に関わらず MIME 形式で添付しないでください。多くのポ
+ピュラーな電子メールクライアントは MIME 形式の添付ファイルをプレーンテ
+キストとして送信するとは限らないでしょう。そうなると、電子メールクラ
+イアントがコードに対するコメントを付けることをできなくします。また、
+MIME 形式の添付ファイルは Linus に手間を取らせることになり、その変更を
+受け入れてもらう可能性が低くなってしまいます。
+
+例外:お使いの電子メールクライアントがパッチをめちゃくちゃにするので
+あれば、誰かが MIME 形式のパッチを再送するよう求めるかもしれません。
+
+警告: Mozilla のような特定の電子メールクライアントは電子メールの
+ヘッダに以下のものを付加して送ります。
+---- message header ----
+Content-Type: text/plain; charset=us-ascii; format=flowed
+---- message header ----
+問題は、「 format=flowed 」が付いた電子メールを特定の受信側の電子メール
+クライアントがタブをスペースに置き換えるというような変更をすることです。
+したがって送られてきたパッチは壊れているように見えるでしょう。
+
+これを修正するには、mozilla の defaults/pref/mailnews.js ファイルを
+以下のように修正します。
+pref("mailnews.send_plaintext_flowed", false); // RFC 2646=======
+pref("mailnews.display.disable_format_flowed_support", true);
+
+8) 電子メールのサイズ
+
+パッチを Linus へ送るときは常に #7 の手順に従ってください。
+
+大きなパッチはメーリングリストやメンテナにとって不親切です。パッチが
+未圧縮で 40KB を超えるようであるなら、インターネット上のアクセス可能な
+サーバに保存し、保存場所を示す URL を伝えるほうが適切です。
+
+9) カーネルバージョンの明記
+
+パッチが対象とするカーネルのバージョンをパッチの概要か電子メールの
+サブジェクトに付けることが重要です。
+
+パッチが最新バージョンのカーネルに正しく適用できなければ、Linus は
+そのパッチを採用しないでしょう。
+
+10) がっかりせず再投稿
+
+パッチを投稿した後は、辛抱強く待っていてください。Linus があなたのパッ
+チを気に入って採用すれば、Linus がリリースする次のバージョンのカーネル
+の中で姿を見せるでしょう。
+
+しかし、パッチが次のバージョンのカーネルに入っていないなら、いくつもの
+理由があるのでしょう。その原因を絞り込み、間違っているものを正し、更新
+したパッチを投稿するのはあなたの仕事です。
+
+Linus があなたのパッチに対して何のコメントもなく不採用にすることは極め
+て普通のことです。それは自然な姿です。もし、Linus があなたのパッチを受
+け取っていないのであれば、以下の理由が考えられます。
+* パッチが最新バージョンの Linux カーネルにきちんと適用できなかった
+* パッチが LKML で十分に議論されていなかった
+* スタイルの問題(セクション2を参照)
+* 電子メールフォーマットの問題(このセクションを参照)
+* パッチに対する技術的な問題
+* Linus はたくさんの電子メールを受け取っているので、どさくさに紛れて見
+  失った
+* 不愉快にさせている
+
+判断できない場合は、LKML にコメントを頼んでください。
+
+11) サブジェクトに「 PATCH 」
+
+Linus や LKML への大量の電子メールのために、サブジェクトのプレフィックスに
+「 [PATCH] 」を付けることが慣習となっています。これによって Linus や他の
+カーネル開発者がパッチであるのか、又は、他の議論に関する電子メールであるの
+かをより簡単に識別できます。
+
+12) パッチへの署名
+
+誰が何をしたのかを追いかけやすくするために (特に、パッチが何人かの
+メンテナを経て最終的に Linux カーネルに取り込まれる場合のために)、電子
+メールでやり取りされるパッチに対して「 sign-off 」という手続きを導入し
+ました。
+
+「 sign-off 」とは、パッチがあなたの書いたものであるか、あるいは、
+あなたがそのパッチをオープンソースとして提供する権利を保持している、
+という証明をパッチの説明の末尾に一行記載するというものです。
+ルールはとても単純です。以下の項目を確認して下さい。
+
+        原作者の証明書( DCO ) 1.1
+
+        このプロジェクトに寄与するものとして、以下のことを証明する。
+
+        (a) 本寄与は私が全体又は一部作成したものであり、私がそのファイ
+            ル中に明示されたオープンソースライセンスの下で公開する権利
+            を持っている。もしくは、
+
+        (b) 本寄与は、私が知る限り、適切なオープンソースライセンスでカバ
+            ーされている既存の作品を元にしている。同時に、私はそのライセ
+            ンスの下で、私が全体又は一部作成した修正物を、ファイル中で示
+            される同一のオープンソースライセンスで(異なるライセンスの下で
+            投稿することが許可されている場合を除いて)投稿する権利を持って
+            いる。もしくは、
+
+        (c) 本寄与は(a)、(b)、(c)を証明する第3者から私へ直接提供された
+            ものであり、私はそれに変更を加えていない。
+
+       (d) 私はこのプロジェクトと本寄与が公のものであることに理解及び同意す
+            る。同時に、関与した記録(投稿の際の全ての個人情報と sign-off を
+            含む)が無期限に保全されることと、当該プロジェクト又は関連する
+            オープンソースライセンスに沿った形で再配布されることに理解及び
+            同意する。
+
+もしこれに同意できるなら、以下のような1行を追加してください。
+
+       Signed-off-by: Random J Developer <random@developer.example.org>
+
+実名を使ってください。(残念ですが、偽名や匿名による寄与はできません。)
+
+人によっては sign-off の近くに追加のタグを付加しています。それらは今のところ
+無視されますが、あなたはそのタグを社内の手続きに利用したり、sign-off に特別
+な情報を示したりすることができます。
+
+13) いつ Acked-by: を使うのか
+
+「 Signed-off-by: 」タグはその署名者がパッチの開発に関わっていたことやパッチ
+の伝播パスにいたことを示しています。
+
+ある人が直接パッチの準備や作成に関わっていないけれど、その人のパッチに対す
+る承認を記録し、示したいとします。その場合、その人を示すのに Acked-by: が使
+えます。Acked-by: はパッチのチェンジログにも追加されます。
+
+パッチの影響を受けるコードのメンテナがパッチに関わっていなかったり、パッチ
+の伝播パスにいなかった時にも、メンテナは Acked-by: をしばしば利用します。
+
+Acked-by: は Signed-off-by: のように公式なタグではありません。それはメンテナが
+少なくともパッチをレビューし、同意を示しているという記録です。そのような
+ことからパッチの統合者がメンテナの「うん、良いと思うよ」という発言を
+Acked-by: へ置き換えることがあります。
+
+Acked-by: が必ずしもパッチ全体の承認を示しているわけではありません。例えば、
+あるパッチが複数のサブシステムへ影響を与えており、その中の1つのサブシステム
+のメンテナからの Acked-by: を持っているとします。その場合、Acked-by: は通常
+そのメンテナのコードに影響を与える一部分だけに対する承認を示しています。
+この点は、ご自分で判断してください。(その Acked-by: が)疑わしい場合は、
+メーリングリストアーカイブの中の大元の議論を参照すべきです。
+
+14) 標準的なパッチのフォーマット
+
+標準的なパッチのサブジェクトは以下のとおりです。
+
+    Subject: [PATCH 001/123] subsystem: summary phrase
+
+標準的なパッチの、電子メールのボディは以下の項目を含んでいます。
+
+  - パッチの作成者を明記する「 from 」行
+
+  - 空行
+
+  - 説明本体。これはこのパッチを説明するために無期限のチェンジログ
+    (変更履歴)にコピーされます。
+
+  - 上述した「 Signed-off-by: 」行。これも説明本体と同じくチェン
+    ジログ内にコピーされます。
+
+  - マーカー行は単純に「 --- 」です。
+
+  - 余計なコメントは、チェンジログには不適切です。
+
+  - 実際のパッチ(差分出力)
+
+サブジェクト行のフォーマットは、アルファベット順で電子メールをとても
+ソートしやすいものになっています。(ほとんどの電子メールクライアント
+はソートをサポートしています)パッチのサブジェクトの連番は0詰めであ
+るため、数字でのソートとアルファベットでのソートは同じ結果になります。
+
+電子メールのサブジェクト内のサブシステム表記は、パッチが適用される
+分野またはサブシステムを識別できるようにすべきです。
+
+電子メールのサブジェクトの「概要の言い回し」はそのパッチの概要を正確
+に表現しなければなりません。「概要の言い回し」をファイル名にしてはい
+けません。一連のパッチ中でそれぞれのパッチは同じ「概要の言い回し」を
+使ってはいけません(「一連のパッチ」とは順序付けられた関連のある複数の
+パッチ群です)。
+
+あなたの電子メールの「概要の言い回し」がそのパッチにとって世界で唯
+一の識別子になるように心がけてください。「概要の言い回し」は git の
+チェンジログの中へずっと伝播していきます。「概要の言い回し」は、開
+発者が後でパッチを参照するために議論の中で利用するかもしれません。
+人々はそのパッチに関連した議論を読むために「概要の言い回し」を使って
+google で検索したがるでしょう。
+
+サブジェクトの例を二つ
+
+    Subject: [patch 2/5] ext2: improve scalability of bitmap searching
+    Subject: [PATCHv2 001/207] x86: fix eflags tracking
+
+「 from 」行は電子メールのボディの一番最初の行でなければなりません。
+その形式は以下のとおりです。
+
+        From: Original Author <author@example.com>
+
+「 from 」行はチェンジログの中で、そのパッチの作成者としてクレジットされ
+ている人を特定するものです。「 from 」行がかけていると、電子メールのヘッ
+ダーの「 From: 」が、チェンジログの中でパッチの作成者を決定するために使わ
+れるでしょう。
+
+説明本体は無期限のソースのチェンジログにコミットされます。なので、説明
+本体はそのパッチに至った議論の詳細を忘れているある程度の技量を持っている人
+がその詳細を思い出すことができるものでなければなりません。
+
+「 --- 」マーカー行はパッチ処理ツールに対して、チェンジログメッセージの終端
+部分を認識させるという重要な役目を果たします。
+
+「 --- 」マーカー行の後の追加コメントの良い使用方法の1つに diffstat コマンド
+があります。diffstat コマンドとは何のファイルが変更され、1ファイル当たり何行
+追加され何行消されたかを示すものです。diffstat コマンドは特に大きなパッチに
+おいて役立ちます。その時点でだけ又はメンテナにとってのみ関係のあるコメント
+は無期限に保存されるチェンジログにとって適切ではありません。そのため、この
+ようなコメントもマーカー行の後に書かれるべきです。ファイル名はカーネルソー
+スツリーのトップディレクトリからの表記でリストされるため、横方向のスペース
+をとり過ぎないように、diffstat コマンドにオプション「  -p 1 -w 70 」を指定し
+てください(インデントを含めてちょうど80列に合うでしょう)。
+
+適切なパッチのフォーマットの詳細についてはセクション3の参考文献を参照して
+ください。
+
+------------------------------------
+セクション2 - ヒントとTIPSと小技
+------------------------------------
+
+このセクションは Linux カーネルに変更を適用することに関係のある一般的な
+「お約束」の多くを載せています。物事には例外というものがあります。しか
+し例外を適用するには、本当に妥当な理由が不可欠です。あなたは恐らくこの
+セクションを Linus のコンピュータ・サイエンス101と呼ぶでしょう。
+
+1) Documentation/CodingStyleを参照
+
+言うまでもなく、あなたのコードがこのコーディングスタイルからあまりに
+も逸脱していると、レビューやコメントなしに受け取ってもらえないかもし
+れません。
+
+唯一の特筆すべき例外は、コードをあるファイルから別のファイルに移動
+するときです。この場合、コードを移動するパッチでは、移動されるコード
+に関して移動以外の変更を一切加えるべきではありません。これにより、
+コードの移動とあなたが行ったコードの修正を明確に区別できるようにな
+ります。これは実際に何が変更されたかをレビューする際の大きな助けに
+なるとともに、ツールにコードの履歴を追跡させることも容易になります。
+
+投稿するより前にパッチのスタイルチェッカー( scripts/checkpatch.pl )で
+あなたのパッチをチェックしてください。このスタイルチェッカーは最終結
+論としてではなく、指標としてみるべきです。もし、あなたのコードが違反
+はしているが修正するより良く見えるのであれば、おそらくそのままにする
+のがベストです。
+
+スタイルチェッカーによる3段階のレポート:
+ - エラー: 間違っている可能性が高い
+ - 警告:注意してレビューする必要がある
+ - チェック:考慮する必要がある
+
+あなたはパッチに残っている全ての違反について、それがなぜ必要なのか正当な
+理由を示せるようにしておく必要があります。
+
+2) #ifdefは見苦しい
+
+ifdef が散乱したコードは、読むのもメンテナンスするのも面倒です。コードの中
+で ifdef を使わないでください。代わりに、ヘッダファイルの中に ifdef を入れて、
+条件付きで、コードの中で使われる関数を「 static inline 」関数かマクロで定義し
+てください。後はコンパイラが、何もしない箇所を最適化して取り去ってくれるで
+しょう。
+
+まずいコードの簡単な例
+
+       dev = alloc_etherdev (sizeof(struct funky_private));
+       if (!dev)
+               return -ENODEV;
+       #ifdef CONFIG_NET_FUNKINESS
+       init_funky_net(dev);
+       #endif
+
+クリーンアップしたコードの例
+
+(in header)
+       #ifndef CONFIG_NET_FUNKINESS
+       static inline void init_funky_net (struct net_device *d) {}
+       #endif
+
+(in the code itself)
+       dev = alloc_etherdev (sizeof(struct funky_private));
+       if (!dev)
+               return -ENODEV;
+       init_funky_net(dev);
+
+3) マクロより「 static inline 」を推奨
+
+「 static inline 」関数はマクロよりもずっと推奨されています。それらは、
+型安全性があり、長さにも制限が無く、フォーマットの制限もありません。
+gcc においては、マクロと同じくらい軽いです。
+
+マクロは「 static inline 」が明らかに不適切であると分かる場所(高速化パスの
+いくつかの特定のケース)や「 static inline 」関数を使うことができないような
+場所(マクロの引数の文字列連結のような)にだけ使われるべきです。
+
+「 static inline 」は「 static __inline__ 」や「 extern inline 」や
+「 extern __inline__ 」よりも適切です。
+
+4) 設計に凝りすぎるな
+
+それが有用になるかどうか分からないような不明瞭な将来を見越した設計
+をしないでください。「できる限り簡単に、そして、それ以上簡単になら
+ないような設計をしてください。」
+
+----------------------
+セクション3 参考文献
+----------------------
+
+Andrew Morton, "The perfect patch" (tpp).
+  <http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt>
+
+Jeff Garzik, "Linux kernel patch submission format".
+  <http://linux.yyz.us/patch-format.html>
+
+Greg Kroah-Hartman, "How to piss off a kernel subsystem maintainer".
+  <http://www.kroah.com/log/2005/03/31/>
+  <http://www.kroah.com/log/2005/07/08/>
+  <http://www.kroah.com/log/2005/10/19/>
+  <http://www.kroah.com/log/2006/01/11/>
+
+NO!!!! No more huge patch bombs to linux-kernel@vger.kernel.org people!
+  <http://marc.theaimsgroup.com/?l=linux-kernel&m=112112749912944&w=2>
+
+Kernel Documentation/CodingStyle:
+  <http://users.sosdg.org/~qiyong/lxr/source/Documentation/CodingStyle>
+
+Linus Torvalds's mail on the canonical patch format:
+  <http://lkml.org/lkml/2005/4/7/183>
+--
index 8ae5fac08dfa54087880678867698aea3bea96b9..33121d6c827c6e5fcc85d72b1f5ee5f166b743a2 100644 (file)
@@ -586,11 +586,6 @@ and is between 256 and 4096 characters. It is defined in the file
 
        eata=           [HW,SCSI]
 
-       ec_intr=        [HW,ACPI] ACPI Embedded Controller interrupt mode
-                       Format: <int>
-                       0: polling mode
-                       non-0: interrupt mode (default)
-
        edd=            [EDD]
                        Format: {"of[f]" | "sk[ipmbr]"}
                        See comment in arch/i386/boot/edd.S
index f2668390e8f773276357917e79625790d4e98b5a..9b0e322118b5402eb83868c70266f8afdf420ed1 100644 (file)
@@ -62,8 +62,8 @@ typedef uint8_t u8;
 #endif
 /* We can have up to 256 pages for devices. */
 #define DEVICE_PAGES 256
-/* This fits nicely in a single 4096-byte page. */
-#define VIRTQUEUE_NUM 127
+/* This will occupy 2 pages: it must be a power of 2. */
+#define VIRTQUEUE_NUM 128
 
 /*L:120 verbose is both a global flag and a macro.  The C preprocessor allows
  * this, and although I wouldn't recommend it, it works quite nicely here. */
@@ -1036,16 +1036,22 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs,
        void *p;
 
        /* First we need some pages for this virtqueue. */
-       pages = (vring_size(num_descs) + getpagesize() - 1) / getpagesize();
+       pages = (vring_size(num_descs, getpagesize()) + getpagesize() - 1)
+               / getpagesize();
        p = get_pages(pages);
 
+       /* Initialize the virtqueue */
+       vq->next = NULL;
+       vq->last_avail_idx = 0;
+       vq->dev = dev;
+
        /* Initialize the configuration. */
        vq->config.num = num_descs;
        vq->config.irq = devices.next_irq++;
        vq->config.pfn = to_guest_phys(p) / getpagesize();
 
        /* Initialize the vring. */
-       vring_init(&vq->vring, num_descs, p);
+       vring_init(&vq->vring, num_descs, p, getpagesize());
 
        /* Add the configuration information to this device's descriptor. */
        add_desc_field(dev, VIRTIO_CONFIG_F_VIRTQUEUE,
@@ -1056,9 +1062,6 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs,
        for (i = &dev->vq; *i; i = &(*i)->next);
        *i = vq;
 
-       /* Link virtqueue back to device. */
-       vq->dev = dev;
-
        /* Set the routine to call when the Guest does something to this
         * virtqueue. */
        vq->handle_output = handle_output;
@@ -1092,6 +1095,7 @@ static struct device *new_device(const char *name, u16 type, int fd,
        dev->desc = new_dev_desc(type);
        dev->handle_input = handle_input;
        dev->name = name;
+       dev->vq = NULL;
        return dev;
 }
 
@@ -1342,7 +1346,7 @@ static bool service_io(struct device *dev)
        if (out->type & VIRTIO_BLK_T_SCSI_CMD) {
                fprintf(stderr, "Scsi commands unsupported\n");
                in->status = VIRTIO_BLK_S_UNSUPP;
-               wlen = sizeof(in);
+               wlen = sizeof(*in);
        } else if (out->type & VIRTIO_BLK_T_OUT) {
                /* Write */
 
@@ -1363,7 +1367,7 @@ static bool service_io(struct device *dev)
                        /* Die, bad Guest, die. */
                        errx(1, "Write past end %llu+%u", off, ret);
                }
-               wlen = sizeof(in);
+               wlen = sizeof(*in);
                in->status = (ret >= 0 ? VIRTIO_BLK_S_OK : VIRTIO_BLK_S_IOERR);
        } else {
                /* Read */
@@ -1376,10 +1380,10 @@ static bool service_io(struct device *dev)
                ret = readv(vblk->fd, iov+1, in_num-1);
                verbose("READ from sector %llu: %i\n", out->sector, ret);
                if (ret >= 0) {
-                       wlen = sizeof(in) + ret;
+                       wlen = sizeof(*in) + ret;
                        in->status = VIRTIO_BLK_S_OK;
                } else {
-                       wlen = sizeof(in);
+                       wlen = sizeof(*in);
                        in->status = VIRTIO_BLK_S_IOERR;
                }
        }
index 4269a1105b378fafcc689435a2531b9d9d4287db..1a45f11e645e978f445ba7396f0c5411a1695e06 100644 (file)
@@ -45,6 +45,29 @@ long fails. The definition looks like :
 typedef struct { atomic_long_t a; } local_t;
 
 
+* Rules to follow when using local atomic operations
+
+- Variables touched by local ops must be per cpu variables.
+- _Only_ the CPU owner of these variables must write to them.
+- This CPU can use local ops from any context (process, irq, softirq, nmi, ...)
+  to update its local_t variables.
+- Preemption (or interrupts) must be disabled when using local ops in
+  process context to   make sure the process won't be migrated to a
+  different CPU between getting the per-cpu variable and doing the
+  actual local op.
+- When using local ops in interrupt context, no special care must be
+  taken on a mainline kernel, since they will run on the local CPU with
+  preemption already disabled. I suggest, however, to explicitly
+  disable preemption anyway to make sure it will still work correctly on
+  -rt kernels.
+- Reading the local cpu variable will provide the current copy of the
+  variable.
+- Reads of these variables can be done from any CPU, because updates to
+  "long", aligned, variables are always atomic. Since no memory
+  synchronization is done by the writer CPU, an outdated copy of the
+  variable can be read when reading some _other_ cpu's variables.
+
+
 * Rules to follow when using local atomic operations
 
 - Variables touched by local ops must be per cpu variables.
index 295a71bc301ebb067fbf7d2ee6770e14426c063a..d9f50a19fa0c48185968e875aa2c9163bae3e6fa 100644 (file)
@@ -35,12 +35,14 @@ In order to use the macro trace_mark, you should include linux/marker.h.
 
 And,
 
-trace_mark(subsystem_event, "%d %s", someint, somestring);
+trace_mark(subsystem_event, "myint %d mystring %s", someint, somestring);
 Where :
 - subsystem_event is an identifier unique to your event
     - subsystem is the name of your subsystem.
     - event is the name of the event to mark.
-- "%d %s" is the formatted string for the serializer.
+- "myint %d mystring %s" is the formatted string for the serializer. "myint" and
+  "mystring" are repectively the field names associated with the first and
+  second parameter.
 - someint is an integer.
 - somestring is a char pointer.
 
index f5a5e6d3d5419598775d096aa351bd4f5f90741e..563e442f2d4246a37ffd46250fa64fa0e494c645 100644 (file)
@@ -4,8 +4,6 @@
        - information on the 3Com EtherLink Plus (3c505) driver.
 6pack.txt
        - info on the 6pack protocol, an alternative to KISS for AX.25
-Configurable
-       - info on some of the configurable network parameters
 DLINK.txt
        - info on the D-Link DE-600/DE-620 parallel port pocket adapters
 PLIP.txt
@@ -26,8 +24,6 @@ baycom.txt
        - info on the driver for Baycom style amateur radio modems
 bridge.txt
        - where to get user space programs for ethernet bridging with Linux.
-comx.txt
-       - info on drivers for COMX line of synchronous serial adapters.
 cops.txt
        - info on the COPS LocalTalk Linux driver
 cs89x0.txt
@@ -78,20 +74,14 @@ ltpc.txt
        - the Apple or Farallon LocalTalk PC card driver
 multicast.txt
        - Behaviour of cards under Multicast
-ncsa-telnet
-       - notes on how NCSA telnet (DOS) breaks with MTU discovery enabled.
 netdevices.txt
        - info on network device driver functions exported to the kernel.
 olympic.txt
        - IBM PCI Pit/Pit-Phy/Olympic Token Ring driver info.
 policy-routing.txt
        - IP policy-based routing
-pt.txt
-       - the Gracilis Packetwin AX.25 device driver
 ray_cs.txt
        - Raylink Wireless LAN card driver info.
-routing.txt
-       - the new routing mechanism
 shaper.txt
        - info on the module that can shape/limit transmitted traffic.
 sk98lin.txt
index b9d5b723011882a4f3eff65fe80252a0bf7b36d4..72f38b13101d74c5eb8e6f32e2d5ae4c7559f005 100644 (file)
@@ -14,8 +14,7 @@ If no base address is given at boot time, the driver will autoprobe
 ports 0x300, 0x280 and 0x310 (in that order).  If no IRQ is given, the driver
 will try to probe for it.
 
-The driver can be used as a loadable module.  See net-modules.txt for details
-of the parameters it can take.  
+The driver can be used as a loadable module.
 
 Theoretically, one instance of the driver can now run multiple cards,
 in the standard way (when loading a module, say "modprobe 3c505
diff --git a/Documentation/networking/Configurable b/Documentation/networking/Configurable
deleted file mode 100644 (file)
index 69c0dd4..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-
-There are a few network parameters that can be tuned to better match
-the kernel to your system hardware and intended usage. The defaults
-are usually a good choice for 99% of the people 99% of the time, but
-you should be aware they do exist and can be changed.
-
-The current list of parameters can be found in the files:
-
-       linux/net/TUNABLE
-       Documentation/networking/ip-sysctl.txt
-
-Some of these are accessible via the sysctl interface, and many more are
-scheduled to be added in this way. For example, some parameters related 
-to Address Resolution Protocol (ARP) are very easily viewed and altered.
-
-       # cat /proc/sys/net/ipv4/arp_timeout
-       6000
-       # echo 7000 > /proc/sys/net/ipv4/arp_timeout
-       # cat /proc/sys/net/ipv4/arp_timeout
-       7000
-
-Others are already accessible via the related user space programs.
-For example, MAX_WINDOW has a default of 32 k which is a good choice for
-modern hardware, but if you have a slow (8 bit) Ethernet card and/or a slow
-machine, then this will be far too big for the card to keep up with fast 
-machines transmitting on the same net, resulting in overruns and receive errors.
-A value of about 4 k would be more appropriate, which can be set via:
-
-       # route add -net 192.168.3.0 window 4096
-
-The remainder of these can only be presently changed by altering a #define
-in the related header file. This means an edit and recompile cycle.
-
-                                               Paul Gortmaker 06/96
diff --git a/Documentation/networking/comx.txt b/Documentation/networking/comx.txt
deleted file mode 100644 (file)
index d1526eb..0000000
+++ /dev/null
@@ -1,248 +0,0 @@
-
-               COMX drivers for the 2.2 kernel
-
-Originally written by: Tivadar Szemethy, <tiv@itc.hu>
-Currently maintained by: Gergely Madarasz <gorgo@itc.hu>
-
-Last change: 21/06/1999.
-
-INTRODUCTION
-
-This document describes the software drivers and their use for the 
-COMX line of synchronous serial adapters for Linux version 2.2.0 and
-above.
-The cards are produced and sold by ITC-Pro Ltd. Budapest, Hungary
-For further info contact <info@itc.hu> 
-or http://www.itc.hu (mostly in Hungarian).
-The firmware files and software are available from ftp://ftp.itc.hu
-
-Currently, the drivers support the following cards and protocols:
-
-COMX (2x64 kbps intelligent board)
-CMX (1x256 + 1x128 kbps intelligent board)
-HiCOMX (2x2Mbps intelligent board)
-LoCOMX (1x512 kbps passive board)
-MixCOM (1x512 or 2x512kbps passive board with a hardware watchdog an
-       optional BRI interface and optional flashROM (1-32M))
-SliceCOM       (1x2Mbps channelized E1 board)
-PciCOM (X21)
-
-At the moment of writing this document, the (Cisco)-HDLC, LAPB, SyncPPP and
-Frame Relay (DTE, rfc1294 IP encapsulation with partially implemented Q933a 
-LMI) protocols are available as link-level protocol. 
-X.25 support is being worked on.
-
-USAGE
-
-Load the comx.o module and the hardware-specific and protocol-specific 
-modules you'll need into the running kernel using the insmod utility.
-This creates the /proc/comx directory.
-See the example scripts in the 'etc' directory.
-
-/proc INTERFACE INTRO
-
-The COMX driver set has a new type of user interface based on the /proc 
-filesystem which eliminates the need for external user-land software doing 
-IOCTL calls. 
-Each network interface or device (i.e. those ones you configure with 'ifconfig'
-and 'route' etc.) has a corresponding directory under /proc/comx. You can
-dynamically create a new interface by saying 'mkdir /proc/comx/comx0' (or you
-can name it whatever you want up to 8 characters long, comx[n] is just a 
-convention).
-Generally the files contained in these directories are text files, which can
-be viewed by 'cat filename' and you can write a string to such a file by
-saying 'echo _string_ >filename'. This is very similar to the sysctl interface.
-Don't use a text editor to edit these files, always use 'echo' (or 'cat'
-where appropriate).
-When you've created the comx[n] directory, two files are created automagically
-in it: 'boardtype' and 'protocol'. You have to fill in these files correctly
-for your board and protocol you intend to use (see the board and protocol 
-descriptions in this file below or the example scripts in the 'etc' directory).
-After filling in these files, other files will appear in the directory for 
-setting the various hardware- and protocol-related informations (for example
-irq and io addresses, keepalive values etc.) These files are set to default 
-values upon creation, so you don't necessarily have to change all of them.
-
-When you're ready with filling in the files in the comx[n] directory, you can
-configure the corresponding network interface with the standard network 
-configuration utilities. If you're unable to bring the interfaces up, look up
-the various kernel log files on your system, and consult the messages for
-a probable reason.
-
-EXAMPLE
-
-To create the interface 'comx0' which is the first channel of a COMX card:
-
-insmod comx 
-# insmod comx-hw-comx ; insmod comx-proto-ppp  (these are usually
-autoloaded if you use the kernel module loader)
-
-mkdir /proc/comx/comx0
-echo comx >/proc/comx/comx0/boardtype
-echo 0x360 >/proc/comx/comx0/io                <- jumper-selectable I/O port 
-echo 0x0a >/proc/comx/comx0/irq                <- jumper-selectable IRQ line
-echo 0xd000 >/proc/comx/comx0/memaddr  <- software-configurable memory
-                                          address. COMX uses 64 KB, and this
-                                          can be: 0xa000, 0xb000, 0xc000, 
-                                          0xd000, 0xe000. Avoid conflicts
-                                          with other hardware.
-cat </etc/siol1.rom >/proc/comx/comx0/firmware <- the firmware for the card
-echo HDLC >/proc/comx/comx0/protocol   <- the data-link protocol
-echo 10 >/proc/comx/comx0/keepalive    <- the keepalive for the protocol
-ifconfig comx0 1.2.3.4 pointopoint 5.6.7.8 netmask 255.255.255.255 <-
-                                          finally configure it with ifconfig
-Check its status:
-cat /proc/comx/comx0/status
-
-If you want to use the second channel of this board:
-
-mkdir /proc/comx/comx1
-echo comx >/proc/comx/comx1/boardtype
-echo 0x360 >/proc/comx/comx1/io        
-echo 10 >/proc/comx/comx1/irq          
-echo 0xd000 >/proc/comx/comx1/memaddr
-echo 1 >/proc/comx/comx1/channel       <- channels are numbered 
-                                          as 0 (default) and 1
-
-Now, check if the driver recognized that you're going to use the other
-channel of the same adapter:
-
-cat /proc/comx/comx0/twin
-comx1
-cat /proc/comx/comx1/twin
-comx0
-
-You don't have to load the firmware twice, if you use both channels of
-an adapter, just write it into the channel 0's /proc firmware file.
-
-Default values: io 0x360 for COMX, 0x320 (HICOMX), irq 10, memaddr 0xd0000
-
-THE LOCOMX HARDWARE DRIVER
-
-The LoCOMX driver doesn't require firmware, and it doesn't use memory either,
-but it uses DMA channels 1 and 3. You can set the clock rate (if enabled by
-jumpers on the board) by writing the kbps value into the file named 'clock'.
-Set it to 'external' (it is the default) if you have external clock source.
-
-(Note: currently the LoCOMX driver does not support the internal clock)
-
-THE COMX, CMX AND HICOMX DRIVERS
-
-On the HICOMX, COMX and CMX, you have to load the firmware (it is different for
-the three cards!). All these adapters can share the same memory
-address (we usually use 0xd0000). On the CMX you can set the internal
-clock rate (if enabled by jumpers on the small adapter boards) by writing
-the kbps value into the 'clock' file. You have to do this before initializing
-the card. If you use both HICOMX and CMX/COMX cards, initialize the HICOMX
-first. The I/O address of the HICOMX board is not configurable by any
-method available to the user: it is hardwired to 0x320, and if you have to 
-change it, consult ITC-Pro Ltd.
-
-THE MIXCOM DRIVER
-
-The MixCOM board doesn't require firmware, the driver communicates with
-it through I/O ports. You can have three of these cards in one machine.
-
-THE SLICECOM DRIVER
-
-The SliceCOM board doesn't require firmware. You can have 4 of these cards
-in one machine. The driver doesn't (yet) support shared interrupts, so
-you will need a separate IRQ line for every board.
-Read Documentation/networking/slicecom.txt for help on configuring
-this adapter.
-
-THE HDLC/PPP LINE PROTOCOL DRIVER
-
-The HDLC/SyncPPP line protocol driver uses the kernel's built-in syncppp
-driver (syncppp.o). You don't have to manually select syncppp.o when building
-the kernel, the dependencies compile it in automatically.
-
-
-
-
-EXAMPLE
-(setting up hw parameters, see above)
-
-# using HDLC:
-echo hdlc >/proc/comx/comx0/protocol
-echo 10 >/proc/comx/comx0/keepalive    <- not necessary, 10 is the default
-ifconfig comx0 1.2.3.4 pointopoint 5.6.7.8 netmask 255.255.255.255
-
-(setting up hw parameters, see above)
-
-# using PPP:
-echo ppp >/proc/comx/comx0/protocol
-ifconfig comx0 up
-ifconfig comx0 1.2.3.4 pointopoint 5.6.7.8 netmask 255.255.255.255
-
-
-THE LAPB LINE PROTOCOL DRIVER
-
-For this, you'll need to configure LAPB support (See 'LAPB Data Link Driver' in
-'Network options' section) into your kernel (thanks to Jonathan Naylor for his 
-excellent implementation). 
-comx-proto-lapb.o provides the following files in the appropriate directory
-(the default values in parens): t1 (5), t2 (1), n2 (20), mode (DTE, STD) and
-window (7). Agree with the administrator of your peer router on these
-settings (most people use defaults, but you have to know if you are DTE or
-DCE).
-
-EXAMPLE
-
-(setting up hw parameters, see above)
-echo lapb >/proc/comx/comx0/protocol
-echo dce >/proc/comx/comx0/mode                <- DCE interface in this example
-ifconfig comx0 1.2.3.4 pointopoint 5.6.7.8 netmask 255.255.255.255
-
-
-THE FRAME RELAY PROTOCOL DRIVER
-
-You DON'T need any other frame relay related modules from the kernel to use
-COMX-Frame Relay. This protocol is a bit more complicated than the others, 
-because it allows to use 'subinterfaces' or DLCIs within one physical device.
-First you have to create the 'master' device (the actual physical interface)
-as you would do for other protocols. Specify 'frad' as protocol type.
-Now you can bring this interface up by saying 'ifconfig comx0 up' (or whatever
-you've named the interface). Do not assign any IP address to this interface
-and do not set any routes through it.
-Then, set up your DLCIs the following way: create a comx interface for each
-DLCI you intend to use (with mkdir), and write 'dlci' to the 'boardtype' file, 
-and 'ietf-ip' to the 'protocol' file. Currently, the only supported 
-encapsulation type is this (also called as RFC1294/1490 IP encapsulation).
-Write the DLCI number to the 'dlci' file, and write the name of the physical
-COMX device to the file called 'master'. 
-Now you can assign an IP address to this interface and set routes using it.
-See the example file for further info and example config script.
-Notes: this driver implements a DTE interface with partially implemented
-Q933a LMI.
-You can find an extensively commented example in the 'etc' directory.
-
-FURTHER /proc FILES
-
-boardtype:
-Type of the hardware. Valid values are:
- 'comx', 'hicomx', 'locomx', 'cmx', 'slicecom'.
-
-protocol:
-Data-link protocol on this channel. Can be: HDLC, LAPB, PPP, FRAD
-
-status:
-You can read the channel's actual status from the 'status' file, for example
-'cat /proc/comx/comx3/status'.
-
-lineup_delay:
-Interpreted in seconds (default is 1). Used to avoid line jitter: the system
-will consider the line status 'UP' only if it is up for at least this number
-of seconds.
-
-debug: 
-You can set various debug options through this file. Valid options are:
-'comx_events', 'comx_tx', 'comx_rx', 'hw_events', 'hw_tx', 'hw_rx'.
-You can enable a debug options by writing its name prepended by a '+' into
-the debug file, for example 'echo +comx_rx >comx0/debug'. 
-Disabling an option happens similarly, use the '-' prefix 
-(e.g. 'echo -hw_rx >debug').
-Debug results can be read from the debug file, for example: 
-tail -f /proc/comx/comx2/debug
-
-
diff --git a/Documentation/networking/ncsa-telnet b/Documentation/networking/ncsa-telnet
deleted file mode 100644 (file)
index d77d28b..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-NCSA telnet doesn't work with path MTU discovery enabled. This is due to a
-bug in NCSA that also stops it working with other modern networking code
-such as Solaris.
-
-The following information is courtesy of 
-Marek <marekm@i17linuxb.ists.pwr.wroc.pl>
-
-There is a fixed version somewhere on ftp.upe.ac.za (sorry, I don't
-remember the exact pathname, and this site is very slow from here).
-It may or may not be faster for you to get it from
-ftp://ftp.ists.pwr.wroc.pl/pub/msdos/telnet/ncsa_upe/tel23074.zip
-(source is in v230704s.zip).  I have tested it with 1.3.79 (with
-path mtu discovery enabled - ncsa 2.3.08 didn't work) and it seems
-to work.  I don't know if anyone is working on this code - this
-version is over a year old.  Too bad - it's faster and often more
-stable than these windoze telnets, and runs on almost anything...
diff --git a/Documentation/networking/pt.txt b/Documentation/networking/pt.txt
deleted file mode 100644 (file)
index 72e888c..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-This is the README for the Gracilis Packetwin device driver, version 0.5
-ALPHA for Linux 1.3.43.
-
-These files will allow you to talk to the PackeTwin (now know as PT) and
-connect through it just like a pair of TNCs.  To do this you will also
-require the AX.25 code in the kernel enabled.
-
-There are four files in this archive; this readme, a patch file, a .c file
-and finally a .h file.  The two program files need to be put into the
-drivers/net directory in the Linux source tree, for me this is the
-directory /usr/src/linux/drivers/net.  The patch file needs to be patched in
-at the top of the Linux source tree (/usr/src/linux in my case).
-
-You will most probably have to edit the pt.c file to suit your own setup,
-this should just involve changing some of the defines at the top of the file. 
-Please note that if you run an external modem you must specify a speed of 0.
-
-The program is currently setup to run a 4800 baud external modem on port A
-and a Kantronics DE-9600 daughter board on port B so if you have this (or
-something similar) then you're right.
-
-To compile in the driver, put the files in the correct place and patch in
-the diff.  You will have to re-configure the kernel again before you
-recompile it. 
-
-The driver is not real good at the moment for finding the card.  You can
-'help' it by changing the order of the potential addresses in the structure
-found in the pt_init() function so the address of where the card is is put
-first.
-
-After compiling, you have to get them going, they are pretty well like any
-other net device and just need ifconfig to get them going.
-As an example, here is my /etc/rc.net
---------------------------
-
-#
-# Configure the PackeTwin, port A.
-/sbin/ifconfig pt0a 44.136.8.87 hw ax25 vk2xlz mtu 512 
-/sbin/ifconfig pt0a 44.136.8.87 broadcast 44.136.8.255 netmask 255.255.255.0
-/sbin/route add -net 44.136.8.0 netmask 255.255.255.0 dev pt0a
-/sbin/route add -net 44.0.0.0 netmask 255.0.0.0 gw 44.136.8.68 dev pt0a
-/sbin/route add -net 138.25.16.0 netmask 255.255.240.0 dev pt0a
-/sbin/route add -host 44.136.8.255 dev pt0a
-#
-# Configure the PackeTwin, port B.
-/sbin/ifconfig pt0b 44.136.8.87 hw ax25 vk2xlz-1 mtu 512
-/sbin/ifconfig pt0b 44.136.8.87 broadcast 44.255.255.255 netmask 255.0.0.0
-/sbin/route add -host 44.136.8.216 dev pt0b
-/sbin/route add -host 44.136.8.95  dev pt0b
-/sbin/route add -host 44.255.255.255 dev pt0b
-
-This version of the driver comes under the GNU GPL.  If you have one of my
-previous (non-GPL) versions of the driver, please update to this one.
-
-I hope that this all works well for you.  I would be pleased to hear how
-many people use the driver and if it does its job.
-
-  - Craig vk2xlz <csmall@small.dropbear.id.au>
diff --git a/Documentation/networking/routing.txt b/Documentation/networking/routing.txt
deleted file mode 100644 (file)
index a26838b..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-The directory ftp.inr.ac.ru:/ip-routing contains:
-
-- iproute.c - "professional" routing table maintenance utility.
-
-- rdisc.tar.gz - rdisc daemon, ported from Sun.
-       STRONGLY RECOMMENDED FOR ALL HOSTS.
-
-- routing.tgz - original Mike McLagan's route by source patch.
-               Currently it is obsolete.
-
-- gated.dif-ss<NEWEST>.gz - gated-R3_6Alpha_2 fixes.
-               Look at README.gated
-
-- mrouted-3.8.dif.gz - mrouted-3.8 fixes.
-
-- rtmon.c - trivial debugging utility: reads and stores netlink.
-
-
-NEWS for user.
-
-- Policy based routing. Routing decisions are made on the basis
-  not only of destination address, but also source address,
-  TOS and incoming interface.
-- Complete set of IP level control messages.
-  Now Linux is the only OS in the world complying to RFC requirements.
-  Great win 8)
-- New interface addressing paradigm.
-  Assignment of address ranges to interface,
-  multiple prefixes etc. etc.
-  Do not bother, it is compatible with the old one. Moreover:
-- You don't need to do "route add aaa.bbb.ccc... eth0" anymore,
-  it is done automatically.
-- "Abstract" UNIX sockets and security enhancements.
-  This is necessary to use TIRPC and TLI emulation library.
-
-NEWS for hacker.
-
-- New destination cache. Flexible, robust and just beautiful.
-- Network stack is reordered, simplified, optimized, a lot of bugs fixed.
-  (well, and new bugs were introduced, but I haven't seen them yet 8))
-  It is difficult to describe all the changes, look into source.
-
-If you see this file, then this patch works 8)
-
-Alexey Kuznetsov.
-kuznet@ms2.inr.ac.ru
diff --git a/Documentation/networking/slicecom.hun b/Documentation/networking/slicecom.hun
deleted file mode 100644 (file)
index bed2f04..0000000
+++ /dev/null
@@ -1,371 +0,0 @@
-
-SliceCOM adapter felhasznaloi dokumentacioja - 0.51 verziohoz
-
-Bartók István <bartoki@itc.hu>
-Utolso modositas: Wed Aug 29 17:26:58 CEST 2001
-
------------------------------------------------------------------
-
-Hasznalata:
-
-Forditas:
-
-Code maturity level options
-       [*] Prompt for development and/or incomplete code/drivers
-
-Network device support
-       Wan interfaces
-               <M> MultiGate (COMX) synchronous
-                       <M> Support for MUNICH based boards: SliceCOM, PCICOM (NEW)
-                       <M> Support for HDLC and syncPPP...
-
-
-A modulok betoltese:
-
-modprobe comx
-
-modprobe comx-proto-ppp                # a Cisco-HDLC es a SyncPPP protokollt is
-                               # ez a modul adja
-
-modprobe comx-hw-munich                # a modul betoltodeskor azonnal jelent a
-                               # syslogba a detektalt kartyakrol
-
-
-Konfiguralas:
-
-# Ezen az interfeszen Cisco-HDLC vonali protokoll fog futni
-# Az interfeszhez rendelt idoszeletek: 1,2 (128 kbit/sec-es vonal)
-# (a G.703 keretben az elso adatot vivo idoszelet az 1-es)
-#
-mkdir /proc/comx/comx0.1/
-echo slicecom  >/proc/comx/comx0.1/boardtype
-echo hdlc      >/proc/comx/comx0.1/protocol
-echo 1 2       >/proc/comx/comx0.1/timeslots
-
-
-# Ezen az interfeszen SyncPPP vonali protokoll fog futni
-# Az interfeszhez rendelt idoszelet: 3 (64 kbit/sec-es vonal)
-#
-mkdir /proc/comx/comx0.2/
-echo slicecom  >/proc/comx/comx0.2/boardtype
-echo ppp       >/proc/comx/comx0.2/protocol
-echo 3         >/proc/comx/comx0.2/timeslots
-
-...
-
-ifconfig comx0.1 up
-ifconfig comx0.2 up
-
------------------------------------------------------------------
-
-A COMX driverek default 20 csomagnyi transmit queue-t rendelnek a halozati
-interfeszekhez. WAN halozatokban ennel hosszabbat is szokas hasznalni
-(20 es 100 kozott), hogy a vonal kihasznaltsaga nagy terheles eseten jobb
-legyen (bar ezzel megno a varhato kesleltetes a csomagok sorban allasa miatt):
-
-# ifconfig comx0 txqueuelen 50
-
-Ezt a beallitasi lehetoseget csak az ujabb disztribuciok ifconfig parancsa
-tamogatja (amik mar a 2.2 kernelekhez keszultek, mint a RedHat 6.1 vagy a
-Debian 2.2).
-
-A 2.1-es Debian disztribuciohoz a http://www.debian.org/~rcw/2.2/netbase/
-cimrol toltheto le ujabb netbase csomag, ami mar ilyet tamogato ifconfig
-parancsot tartalmaz. Bovebben a 2.2 kernel hasznalatarol Debian 2.1 alatt:
-http://www.debian.org/releases/stable/running-kernel-2.2
-
------------------------------------------------------------------
-
-A kartya LED-jeinek jelentese:
-
-piros  - eg, ha Remote Alarm-ot kuld a tuloldal
-zold   - eg, ha a vett jelben megtalalja a keretszinkront
-
-Reszletesebben:
-
-piros: zold:   jelentes:
-
--      -       nincs keretszinkron (nincs jel, vagy rossz a jel)
--      eg      "minden rendben"
-eg     eg      a vetel OK, de a tuloldal Remote Alarm-ot kuld
-eg     -       ez nincs ertelmezve, egyelore funkcio nelkul
-
------------------------------------------------------------------
-
-Reszletesebb leiras a hardver beallitasi lehetosegeirol:
-
-Az altalanos,- es a protokoll-retegek beallitasi lehetosegeirol a 'comx.txt'
-fajlban leirtak SliceCOM kartyanal is ervenyesek, itt csak a hardver-specifikus
-beallitasi lehetosegek vannak osszefoglalva:
-
-Konfiguralasi interfesz a /proc/comx/ alatt:
-
-Minden timeslot-csoportnak kulon comx* interfeszt kell letrehozni mkdir-rel:
-comx0, comx1, .. stb. Itt beallithato, hogy az adott interfesz hanyadik kartya
-melyik timeslotja(i)bol alljon ossze. A Cisco-fele serial3:1 elnevezesek
-(serial3:1 = a 3. kartyaban az 1-es idoszelet-csoport) Linuxon aliasing-ot
-jelentenenek, ezert mi nem tudunk ilyen elnevezest hasznalni.
-
-Tobb kartya eseten a comx0.1, comx0.2, ... vagy slice0.1, slice0.2 nevek
-hasznalhatoak.
-
-Tobb SliceCOM kartya is lehet egy gepben, de sajat interrupt kell mindegyiknek,
-nem tud meg megosztott interruptot kezelni.
-
-Az egesz kartyat erinto beallitasok:
-
-Az ioport es irq beallitas nincs: amit a PCI BIOS kioszt a rendszernek,
-azt hasznalja a driver.
-
-
-comx0/boardnum - hanyadik SliceCOM kartya a gepben (a 'termeszetes' PCI
-               sorrendben ertve: ahogyan a /proc/pci-ban vagy az 'lspci'
-               kimeneteben megjelenik, altalaban az alaplapi PCI meghajto
-               aramkorokhoz kozelebb eso kartyak a kisebb sorszamuak)
-
-               Default: 0 (0-tol kezdodik a szamolas)
-
-
-Bar a kovetkezoket csak egy-egy interfeszen allitjuk at, megis az egesz kartya
-mukodeset egyszerre allitjak. A megkotes hogy csak UP-ban levo interfeszen
-hasznalhatoak, azert van, mert kulonben nem vart eredmenyekre vezetne egy ilyen
-paranccsorozat:
-
-       echo 0        >boardnum
-       echo internal >clock_source
-       echo 1        >boardnum
-
-- Ez a 0-s board clock_source-at allitana at.
-
-Ezek a beallitasok megmaradnak az osszes interfesz torlesekor, de torlodnek
-a driver modul ki/betoltesekor.
-
-
-comx0/clock_source - A Tx orajelforrasa, a Cisco-val hasonlatosra keszult.
-       Hasznalata:
-
-       papaya:# echo line     >/proc/comx/comx0/clock_source
-       papaya:# echo internal >/proc/comx/comx0/clock_source
-
-       line     - A Tx orajelet a vett adatfolyambol dekodolja, igyekszik
-               igazodni hozza. Ha nem lat orajelet az inputon, akkor
-               atall a sajat orajelgeneratorara.
-       internal - A Tx orajelet a sajat orajelgeneratora szolgaltatja.
-
-       Default: line
-
-       Normal osszeallitas eseten a tavkozlesi szolgaltato eszkoze
-       (pl. HDSL modem) adja az orajelet, ezert ez a default.
-
-
-comx0/framing  - A CRC4 ki/be kapcsolasa
-
-       A CRC4: 16 PCM keretet (A PCM keret az, amibe a 32 darab 64
-       kilobites csatorna van bemultiplexalva. Nem osszetevesztendo a HDLC
-       kerettel.) 2x8 -as csoportokra osztanak, es azokhoz 4-4 bites CRC-t
-       szamolnak. Elsosorban a vonal minosegenek a monitorozasara szolgal.
-
-       papaya:~# echo crc4     >/proc/comx/comx0/framing
-       papaya:~# echo no-crc4  >/proc/comx/comx0/framing
-
-       Default a 'crc4', a MATAV vonalak altalaban igy futnak. De ha nem
-       egyforma is a beallitas a vonal ket vegen, attol a forgalom altalaban
-       at tud menni.
-
-
-comx0/linecode - A vonali kodolas beallitasa
-
-       papaya:~# echo hdb3     >/proc/comx/comx0/linecode
-       papaya:~# echo ami      >/proc/comx/comx0/linecode
-
-       Default a 'hdb3', a MATAV vonalak igy futnak.
-       
-       (az AMI kodolas igen ritka E1-es vonalaknal). Ha ez a beallitas nem
-       egyezik a vonal ket vegen, akkor elofordulhat hogy a keretszinkron
-       osszejon, de CRC4-hibak es a vonalakon atvitt adatokban is hibak
-       keletkeznek (amit a HDLC/SyncPPP szinten CRC-hibaval jelez)
-
-
-comx0/reg      - a kartya aramkoreinek, a MUNICH (reg) es a FALC (lbireg)
-comx0/lbireg   regisztereinek kozvetlen elerese. Hasznalata:
-
-               echo >reg 0x04 0x0      - a 4-es regiszterbe 0-t ir
-               echo >reg 0x104         - printk()-val kiirja a 4-es regiszter
-                                       tartalmat a syslogba.
-
-               WARNING: ezek csak a fejleszteshez keszultek, sok galibat
-               lehet veluk okozni!
-
-
-comx0/loopback - A kartya G.703 jelenek a visszahurkolasara is van lehetoseg:
-
-       papaya:# echo none   >/proc/comx/comx0/loopback
-       papaya:# echo local  >/proc/comx/comx0/loopback
-       papaya:# echo remote >/proc/comx/comx0/loopback
-
-       none   - nincs visszahurkolas, normal mukodes
-       local  - a kartya a sajat maga altal adott jelet kapja vissza
-       remote - a kartya a kivulrol vett jelet adja kifele
-
-       Default: none
-
------------------------------------------------------------------
-
-Az interfeszhez (Cisco terminologiaban 'channel-group') kapcsolodo beallitasok:
-
-comx0/timeslots        - mely timeslotok (idoszeletek) tartoznak az adott interfeszhez.
-
-       papaya:~# cat /proc/comx/comx0/timeslots
-       1 3 4 5 6
-       papaya:~#
-
-       Egy timeslot megkeresese (hanyas interfeszbe tartozik nalunk):
-
-       papaya:~# grep ' 4' /proc/comx/comx*/timeslots
-       /proc/comx/comx0/timeslots:1 3 4 5 6
-       papaya:~#
-
-       Beallitasa:
-       papaya:~# echo '1 5 2 6 7 8' >/proc/comx/comx0/timeslots
-       
-       A timeslotok sorrendje nem szamit, '1 3 2' ugyanaz mint az '1 2 3'.
-
-       Beallitashoz az adott interfesznek DOWN-ban kell lennie
-       (ifconfig comx0 down), de ugyanannak a kartyanak a tobbi interfesze
-       uzemelhet kozben.
-
-       Beallitaskor leellenorzi, hogy az uj timeslotok nem utkoznek-e egy
-       masik interfesz timeslotjaival. Ha utkoznek, akkor nem allitja at.
-
-       Mindig 10-es szamrendszerben tortenik a timeslotok ertelmezese, nehogy
-       a 08, 09 alaku felirast rosszul ertelmezze.
-
------------------------------------------------------------------
-
-Az interfeszek es a kartya allapotanak lekerdezese:
-
-- A ' '-szel kezdodo sorok az eredeti kimenetet, a //-rel kezdodo sorok a
-magyarazatot jelzik.
-
- papaya:~$ cat /proc/comx/comx1/status
- Interface administrative status is UP, modem status is UP, protocol is UP
- Modem status changes: 0, Transmitter status is IDLE, tbusy: 0
- Interface load (input): 978376 / 947808 / 951024 bits/s (5s/5m/15m)
-               (output): 978376 / 947848 / 951024 bits/s (5s/5m/15m)
- Debug flags: none
- RX errors: len: 22, overrun: 1, crc: 0, aborts: 0
-            buffer overrun: 0, pbuffer overrun: 0
- TX errors: underrun: 0
- Line keepalive (value: 10) status UP [0]
-
-// Itt kezdodik a hardver-specifikus resz:
- Controller status:
-         No alarms
-
-// Alarm: hibajelzes:
-//
-// No alarms - minden rendben
-//
-// LOS  - Loss Of Signal - nem erzekel jelet a bemeneten.
-// AIS  - Alarm Indication Signal - csak egymas utani 1-esek jonnek
-//     a bemeneten, a tuloldal igy is jelezheti hogy meghibasodott vagy
-//     nincs inicializalva.
-// AUXP - Auxiliary Pattern Indication - 01010101.. sorozat jon a bemeneten.
-// LFA  - Loss of Frame Alignment - nincs keretszinkron
-// RRA  - Receive Remote Alarm - a tuloldal el, de hibat jelez.
-// LMFA - Loss of CRC4 Multiframe Alignment - nincs CRC4-multikeret-szinkron
-// NMF  - No Multiframe alignment Found after 400 msec - ilyen alarm a no-crc4
-//     es crc4 keretezesek eseten nincs, lasd lentebb
-//
-// Egyeb lehetseges hibajelzesek:
-//
-// Transmit Line Short - a kartya ugy erzi hogy az adasi kimenete rovidre
-//     van zarva, ezert kikapcsolta az adast. (nem feltetlenul veszi eszre
-//     a kulso rovidzarat)
-
-// A veteli oldal csomagjainak lancolt listai, debug celokra:
-
- Rx ring:
-         rafutott: 0
-         lastcheck: 50845731, jiffies: 51314281
-         base: 017b1858
-         rx_desc_ptr: 0
-         rx_desc_ptr: 017b1858
-         hw_curr_ptr: 017b1858
-         06040000 017b1868 017b1898 c016ff00
-         06040000 017b1878 017b1e9c c016ff00
-         46040000 017b1888 017b24a0 c016ff00
-         06040000 017b1858 017b2aa4 c016ff00
-
-// A kartyat hasznalo tobbi interfesz: a 0-s channel-group a comx1 interfesz,
-// es az 1,2,...,16 timeslotok tartoznak hozza:
-
- Interfaces using this board: (channel-group, interface, timeslots)
-          0 comx1: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
-          1 comx2: 17
-          2 comx3: 18
-          3 comx4: 19
-          4 comx5: 20
-          5 comx6: 21
-          6 comx7: 22
-          7 comx8: 23
-          8 comx9: 24
-          9 comx10: 25
-         10 comx11: 26
-         11 comx12: 27
-         12 comx13: 28
-         13 comx14: 29
-         14 comx15: 30
-         15 comx16: 31
-
-// Hany esemenyt kezelt le a driver egy-egy hardver-interrupt kiszolgalasanal:
-
- Interrupt work histogram:
- hist[ 0]:        0 hist[ 1]:        2 hist[ 2]:    18574 hist[ 3]:       79
- hist[ 4]:       14 hist[ 5]:        1 hist[ 6]:        0 hist[ 7]:        1
- hist[ 8]:        0 hist[ 9]:        7
-
-// Hany kikuldendo csomag volt mar a Tx-ringben amikor ujabb lett irva bele:
-
- Tx ring histogram:
- hist[ 0]:     2329 hist[ 1]:        0 hist[ 2]:        0 hist[ 3]:        0
-
-// Az E1-interfesz hiba-szamlaloi, az rfc2495-nek megfeleloen:
-// (kb. a Cisco routerek "show controllers e1" formatumaban: http://www.cisco.com/univercd/cc/td/doc/product/software/ios11/rbook/rinterfc.htm#xtocid25669126)
-
-Data in current interval (91 seconds elapsed):
-   9516 Line Code Violations, 65 Path Code Violations, 2 E-Bit Errors
-   0 Slip Secs, 2 Fr Loss Secs, 2 Line Err Secs, 0 Degraded Mins
-   0 Errored Secs, 0 Bursty Err Secs, 0 Severely Err Secs, 11 Unavail Secs
-Data in Interval 1 (15 minutes):
-   0 Line Code Violations, 0 Path Code Violations, 0 E-Bit Errors
-   0 Slip Secs, 0 Fr Loss Secs, 0 Line Err Secs, 0 Degraded Mins
-   0 Errored Secs, 0 Bursty Err Secs, 0 Severely Err Secs, 0 Unavail Secs
-Data in last 4 intervals (1 hour):
-   0 Line Code Violations, 0 Path Code Violations, 0 E-Bit Errors
-   0 Slip Secs, 0 Fr Loss Secs, 0 Line Err Secs, 0 Degraded Mins
-   0 Errored Secs, 0 Bursty Err Secs, 0 Severely Err Secs, 0 Unavail Secs
-Data in last 96 intervals (24 hours):
-   0 Line Code Violations, 0 Path Code Violations, 0 E-Bit Errors
-   0 Slip Secs, 0 Fr Loss Secs, 0 Line Err Secs, 0 Degraded Mins
-   0 Errored Secs, 0 Bursty Err Secs, 0 Severely Err Secs, 0 Unavail Secs
-
------------------------------------------------------------------
-
-Nehany kulonlegesebb beallitasi lehetoseg (idovel beepulhetnek majd a driverbe):
-Ezekkel sok galibat lehet okozni, nagyon ovatosan kell oket hasznalni!
-
-       modified CRC-4, for improved interworking of CRC-4 and non-CRC-4
-       devices: (lasd page 107 es g706 Annex B)
-               lbireg[ 0x1b ] |= 0x08
-               lbireg[ 0x1c ] |= 0xc0
-       - ilyenkor ertelmezett az NMF - 'No Multiframe alignment Found after
-       400 msec' alarm.
-
-       FALC - a vonali meghajto IC
-       local loop - a sajat adasomat halljam vissza
-       remote loop - a kivulrol jovo adast adom vissza
-
-       Egy hibakeresesre hasznalhato dolog:
-               - 1-es timeslot local loop a FALC-ban:  echo >lbireg 0x1d 0x21
-               - local loop kikapcsolasa:              echo >lbireg 0x1d 0x00
diff --git a/Documentation/networking/slicecom.txt b/Documentation/networking/slicecom.txt
deleted file mode 100644 (file)
index c82c0cf..0000000
+++ /dev/null
@@ -1,369 +0,0 @@
-
-SliceCOM adapter user's documentation - for the 0.51 driver version
-
-Written by Bartók István <bartoki@itc.hu>
-
-English translation: Lakatos György <gyuri@itc.hu>
-Mon Dec 11 15:28:42 CET 2000
-
-Last modified: Wed Aug 29 17:25:37 CEST 2001
-
------------------------------------------------------------------
-
-Usage:
-
-Compiling the kernel:
-
-Code maturity level options
-       [*] Prompt for development and/or incomplete code/drivers
-
-Network device support
-       Wan interfaces
-               <M> MultiGate (COMX) synchronous
-                       <M> Support for MUNICH based boards: SliceCOM, PCICOM (NEW)
-                       <M> Support for HDLC and syncPPP...
-
-
-Loading the modules:
-
-modprobe comx
-
-modprobe comx-proto-ppp                # module for  Cisco-HDLC and SyncPPP protocols
-
-modprobe comx-hw-munich                # the module logs information by the kernel
-                               # about the detected boards
-
-
-Configuring the board:
-
-# This interface will use the Cisco-HDLC line protocol,
-# the timeslices assigned are 1,2 (128 KiBit line speed)
-# (the first data timeslice in the G.703 frame is no. 1)
-#
-mkdir /proc/comx/comx0.1/
-echo slicecom  >/proc/comx/comx0.1/boardtype
-echo hdlc      >/proc/comx/comx0.1/protocol
-echo 1 2       >/proc/comx/comx0.1/timeslots
-
-
-# This interface uses SyncPPP line protocol, the assigned 
-# is no. 3 (64 KiBit line speed)
-#
-mkdir /proc/comx/comx0.2/
-echo slicecom  >/proc/comx/comx0.2/boardtype
-echo ppp       >/proc/comx/comx0.2/protocol
-echo 3         >/proc/comx/comx0.2/timeslots
-
-...
-
-ifconfig comx0.1 up
-ifconfig comx0.2 up
-
------------------------------------------------------------------
-
-The COMX interfaces use a 10 packet transmit queue by default, however WAN
-networks sometimes use bigger values (20 to 100), to utilize the line better
-by large traffic (though the line delay increases because of more packets
-join the queue).
-
-# ifconfig comx0 txqueuelen 50
-
-This option is only supported by the ifconfig command of the later 
-distributions, which came with 2.2 kernels, such as RedHat 6.1 or Debian 2.2.
-
-You can download a newer netbase packet from 
-http://www.debian.org/~rcw/2.2/netbase/ for Debian 2.1, which has a new
-ifconfig. You can get further information about using 2.2 kernel with
-Debian 2.1 from http://www.debian.org/releases/stable/running-kernel-2.2
-
------------------------------------------------------------------
-
-The SliceCom LEDs:
-
-red    - on, if the interface is unconfigured, or it gets Remote Alarm-s
-green  - on, if the board finds frame-sync in the received signal      
-
-A bit more detailed:
-
-red:   green:  meaning:
-
--      -       no frame-sync, no signal received, or signal SNAFU.
--      on      "Everything is OK"
-on     on      Reception is ok, but the remote end sends Remote Alarm
-on     -       The interface is unconfigured
-
------------------------------------------------------------------
-
-A more detailed description of the hardware setting options:
-
-The general and the protocol layer options described in the 'comx.txt' file
-apply to the SliceCom as well, I only summarize the SliceCom hardware specific
-settings below.
-
-The '/proc/comx' configuring interface:
-
-An interface directory should be created for every timeslot group with
-'mkdir', e,g: 'comx0', 'comx1' etc. The timeslots can be assigned here to the
-specific interface. The Cisco-like naming convention (serial3:1 - first
-timeslot group of the 3rd. board) can't be used here, because these mean IP
-aliasing in Linux.
-
-You can give any meaningful name to keep the configuration clear; 
-e.g: 'comx0.1', 'comx0.2', 'comx1.1', comx1.2', if you have two boards
-with two interfaces each.
-
-Settings, which apply to the board:
-
-Neither 'io' nor 'irq' settings required, the driver uses the resources
-given by the PCI BIOS.
-
-comx0/boardnum - board number of the SliceCom in the PC (using the 'natural'
-               PCI order) as listed in '/proc/pci' or the output of the
-               'lspci' command, generally the slots nearer to the motherboard
-               PCI driver chips have the lower numbers.
-               
-               Default: 0 (the counting starts with 0)
-
-Though the options below are to be set on a single interface, they apply to the
-whole board. The restriction, to use them on 'UP' interfaces, is because the 
-command sequence below could lead to unpredictable results.
-
-       # echo 0        >boardnum
-       # echo internal >clock_source
-       # echo 1        >boardnum
-
-The sequence would set the clock source of board 0.
-
-These settings will persist after all the interfaces are cleared, but are
-cleared when the driver module is unloaded and loaded again.
-
-comx0/clock_source - source of the transmit clock
-       Usage:
-
-       # echo line     >/proc/comx/comx0/clock_source
-       # echo internal >/proc/comx/comx0/clock_source
-
-       line    - The Tx clock is being decoded if the input data stream,
-               if no clock seen on the input, then the board will use it's
-               own clock generator.
-
-       internal - The Tx clock is supplied by the builtin clock generator.     
-
-       Default: line
-
-       Normally, the telecommunication company's end device (the HDSL
-       modem) provides the Tx clock, that's why 'line' is the default.
-
-comx0/framing  - Switching CRC4 off/on
-
-       CRC4: 16 PCM frames (The 32 64Kibit channels are multiplexed into a
-       PCM frame, nothing to do with HDLC frames) are divided into 2x8
-       groups, each group has a 4 bit CRC.
-
-       # echo crc4     >/proc/comx/comx0/framing
-       # echo no-crc4  >/proc/comx/comx0/framing
-
-       Default is 'crc4', the Hungarian MATAV lines behave like this. 
-       The traffic generally passes if this setting on both ends don't match.
-
-comx0/linecode - Setting the line coding
-
-       # echo hdb3     >/proc/comx/comx0/linecode
-       # echo ami      >/proc/comx/comx0/linecode
-
-       Default a 'hdb3', MATAV lines use this.
-       
-       (AMI coding is rarely used with E1 lines). Frame sync may occur, if
-       this setting doesn't match the other end's, but CRC4 and data errors
-       will come, which will result in CRC errors on HDLC/SyncPPP level. 
-
-comx0/reg      - direct access to the board's MUNICH (reg) and FALC (lbireg)
-comx0/lbireg   circuit's registers  
-
-       # echo >reg 0x04 0x0    - write 0 to register 4
-       # echo >reg 0x104       - write the contents of register 4 with
-                               printk() to syslog
-
-WARNING! These are only for development purposes, messing with this will
-       result much trouble!
-
-comx0/loopback - Places a loop to the board's G.703 signals
-
-       # echo none   >/proc/comx/comx0/loopback
-       # echo local  >/proc/comx/comx0/loopback
-       # echo remote >/proc/comx/comx0/loopback
-
-       none   - normal operation, no loop
-       local  - the board receives it's own output
-       remote - the board sends the received data to the remote side
-
-       Default: none
-
------------------------------------------------------------------
-
-Interface (channel group in Cisco terms) settings: 
-
-comx0/timeslots        - which timeslots belong to the given interface
-
-       Setting:
-
-       # echo '1 5 2 6 7 8' >/proc/comx/comx0/timeslots
-
-       # cat /proc/comx/comx0/timeslots
-       1 2 5 6 7 8 
-       #
-
-       Finding a timeslot: 
-
-       # grep ' 4' /proc/comx/comx*/timeslots
-       /proc/comx/comx0/timeslots:1 3 4 5 6
-       #
-
-       The timeslots can be in any order, '1 2 3' is the same as '1 3 2'.
-
-       The interface has to be DOWN during the setting ('ifconfig comx0
-       down'), but the other interfaces could operate normally.
-
-       The driver checks if the assigned timeslots are vacant, if not, then
-       the setting won't be applied.
-
-       The timeslot values are treated as decimal numbers, not to misunderstand
-       values of 08, 09 form.
-
------------------------------------------------------------------
-
-Checking the interface and board status:
-
-- Lines beginning with ' ' (space) belong to the original output, the lines
-which begin with '//' are the comments.
-
- papaya:~$ cat /proc/comx/comx1/status
- Interface administrative status is UP, modem status is UP, protocol is UP
- Modem status changes: 0, Transmitter status is IDLE, tbusy: 0
- Interface load (input): 978376 / 947808 / 951024 bits/s (5s/5m/15m)
-               (output): 978376 / 947848 / 951024 bits/s (5s/5m/15m)
- Debug flags: none
- RX errors: len: 22, overrun: 1, crc: 0, aborts: 0
-            buffer overrun: 0, pbuffer overrun: 0
- TX errors: underrun: 0
- Line keepalive (value: 10) status UP [0]
-
-// The hardware specific part starts here:
- Controller status:
-         No alarms
-
-// Alarm: 
-//
-// No alarms - Everything OK
-//
-// LOS  - Loss Of Signal - No signal sensed on the input
-// AIS  - Alarm Indication Signal - The remote side sends '11111111'-s, 
-//     it tells, that there's an error condition, or it's not
-//     initialised.
-// AUXP - Auxiliary Pattern Indication - 01010101.. received.
-// LFA  - Loss of Frame Alignment - no frame sync received.
-// RRA  - Receive Remote Alarm - the remote end's OK, but signals error cond.
-// LMFA - Loss of CRC4 Multiframe Alignment - no CRC4 multiframe sync.
-// NMF  - No Multiframe alignment Found after 400 msec - no such alarm using
-//     no-crc4 or crc4 framing, see below.
-//
-// Other possible error messages:
-//
-// Transmit Line Short - the board felt, that it's output is short-circuited,
-//     so it switched the transmission off. (The board can't definitely tell,
-//     that it's output is short-circuited.)
-
-// Chained list of the received packets, for debug purposes:
-
- Rx ring:
-         rafutott: 0
-         lastcheck: 50845731, jiffies: 51314281
-         base: 017b1858
-         rx_desc_ptr: 0
-         rx_desc_ptr: 017b1858
-         hw_curr_ptr: 017b1858
-         06040000 017b1868 017b1898 c016ff00
-         06040000 017b1878 017b1e9c c016ff00
-         46040000 017b1888 017b24a0 c016ff00
-         06040000 017b1858 017b2aa4 c016ff00
-
-// All the interfaces using the board: comx1, using the 1,2,...16 timeslots,
-// comx2, using timeslot 17, etc.
-
- Interfaces using this board: (channel-group, interface, timeslots)
-          0 comx1: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
-          1 comx2: 17
-          2 comx3: 18
-          3 comx4: 19
-          4 comx5: 20
-          5 comx6: 21
-          6 comx7: 22
-          7 comx8: 23
-          8 comx9: 24
-          9 comx10: 25
-         10 comx11: 26
-         11 comx12: 27
-         12 comx13: 28
-         13 comx14: 29
-         14 comx15: 30
-         15 comx16: 31
-
-// The number of events handled by the driver during an interrupt cycle:
-
- Interrupt work histogram:
- hist[ 0]:        0 hist[ 1]:        2 hist[ 2]:    18574 hist[ 3]:       79
- hist[ 4]:       14 hist[ 5]:        1 hist[ 6]:        0 hist[ 7]:        1
- hist[ 8]:        0 hist[ 9]:        7
-
-// The number of packets to send in the Tx ring, when a new one arrived:
-
- Tx ring histogram:
- hist[ 0]:     2329 hist[ 1]:        0 hist[ 2]:        0 hist[ 3]:        0
-
-// The error counters of the E1 interface, according to the RFC2495,
-// (similar to the Cisco "show controllers e1" command's output:
-// http://www.cisco.com/univercd/cc/td/doc/product/software/ios11/rbook/rinterfc.htm#xtocid25669126)
-
-Data in current interval (91 seconds elapsed):
-   9516 Line Code Violations, 65 Path Code Violations, 2 E-Bit Errors
-   0 Slip Secs, 2 Fr Loss Secs, 2 Line Err Secs, 0 Degraded Mins
-   0 Errored Secs, 0 Bursty Err Secs, 0 Severely Err Secs, 11 Unavail Secs
-Data in Interval 1 (15 minutes):
-   0 Line Code Violations, 0 Path Code Violations, 0 E-Bit Errors
-   0 Slip Secs, 0 Fr Loss Secs, 0 Line Err Secs, 0 Degraded Mins
-   0 Errored Secs, 0 Bursty Err Secs, 0 Severely Err Secs, 0 Unavail Secs
-Data in last 4 intervals (1 hour):
-   0 Line Code Violations, 0 Path Code Violations, 0 E-Bit Errors
-   0 Slip Secs, 0 Fr Loss Secs, 0 Line Err Secs, 0 Degraded Mins
-   0 Errored Secs, 0 Bursty Err Secs, 0 Severely Err Secs, 0 Unavail Secs
-Data in last 96 intervals (24 hours):
-   0 Line Code Violations, 0 Path Code Violations, 0 E-Bit Errors
-   0 Slip Secs, 0 Fr Loss Secs, 0 Line Err Secs, 0 Degraded Mins
-   0 Errored Secs, 0 Bursty Err Secs, 0 Severely Err Secs, 0 Unavail Secs
-
------------------------------------------------------------------
-
-Some unique options, (may get into the driver later):
-Treat them very carefully, these can cause much trouble!
-
-       modified CRC-4, for improved interworking of CRC-4 and non-CRC-4
-       devices: (see page 107 and g706 Annex B)
-               lbireg[ 0x1b ] |= 0x08
-               lbireg[ 0x1c ] |= 0xc0
-
-       - The NMF - 'No Multiframe alignment Found after 400 msec' alarm 
-       comes into account.
-
-       FALC - the line driver chip.
-       local loop - I hear my transmission back.
-       remote loop - I echo the remote transmission back.
-
-       Something useful for finding errors:
-       
-               - local loop for timeslot 1 in the FALC chip:
-
-       # echo >lbireg 0x1d 0x21
-
-               - Switching the loop off:
-
-       # echo >lbireg 0x1d 0x00
index 265fcdcb8e5f3cdc4a0826697be57ae7ebda3c54..120eb20dbb09199afc1628a2ca1187812789bde9 100644 (file)
@@ -339,6 +339,10 @@ Use this function to register your device driver on a parallel port
 ('port').  Once you have done that, you will be able to use
 parport_claim and parport_release in order to use the port.
 
+The ('name') argument is the name of the device that appears in /proc
+filesystem. The string must be valid for the whole lifetime of the
+device (until parport_unregister_device is called).
+
 This function will register three callbacks into your driver:
 'preempt', 'wakeup' and 'irq'.  Each of these may be NULL in order to
 indicate that you do not want a callback.
index a96e85397eb792cb10e5e5cc066664846a1b289e..e9a3cb1d6b06b18a3e0bba0d5a0bf85dc3fde77f 100644 (file)
@@ -52,6 +52,7 @@ Table of Contents
       i) Freescale QUICC Engine module (QE)
       j) CFI or JEDEC memory-mapped NOR flash
       k) Global Utilities Block
+      l) Xilinx IP cores
 
   VII - Specifying interrupt information for devices
     1) interrupts property
@@ -851,12 +852,18 @@ address which can extend beyond that limit.
         /cpus/PowerPC,970FX@0
         /cpus/PowerPC,970FX@1
       (unit addresses do not require leading zeroes)
-    - d-cache-line-size : one cell, L1 data cache line size in bytes
-    - i-cache-line-size : one cell, L1 instruction cache line size in
+    - d-cache-block-size : one cell, L1 data cache block size in bytes (*)
+    - i-cache-block-size : one cell, L1 instruction cache block size in
       bytes
     - d-cache-size : one cell, size of L1 data cache in bytes
     - i-cache-size : one cell, size of L1 instruction cache in bytes
 
+(*) The cache "block" size is the size on which the cache management
+instructions operate. Historically, this document used the cache
+"line" size here which is incorrect. The kernel will prefer the cache
+block size and will fallback to cache line size for backward
+compatibility.
+
   Recommended properties:
 
     - timebase-frequency : a cell indicating the frequency of the
@@ -870,6 +877,10 @@ address which can extend beyond that limit.
       for the above, the common code doesn't use that property, but
       you are welcome to re-use the pSeries or Maple one. A future
       kernel version might provide a common function for this.
+    - d-cache-line-size : one cell, L1 data cache line size in bytes
+      if different from the block size
+    - i-cache-line-size : one cell, L1 instruction cache line size in
+      bytes if different from the block size
 
   You are welcome to add any property you find relevant to your board,
   like some information about the mechanism used to soft-reset the
@@ -1634,8 +1645,9 @@ platforms are moved over to use the flattened-device-tree model.
      MAC addresses passed by the firmware when no information other
      than indices is available to associate an address with a device.
    - phy-connection-type : a string naming the controller/PHY interface type,
-     i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id", "tbi",
-     or "rtbi".
+     i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id" (Internal
+     Delay), "rgmii-txid" (delay on TX only), "rgmii-rxid" (delay on RX only),
+     "tbi", or "rtbi".
 
    Example:
        ucc@2000 {
@@ -2242,6 +2254,266 @@ platforms are moved over to use the flattened-device-tree model.
                           available.
                           For Axon: 0x0000012a
 
+   l) Xilinx IP cores
+
+   The Xilinx EDK toolchain ships with a set of IP cores (devices) for use
+   in Xilinx Spartan and Virtex FPGAs.  The devices cover the whole range
+   of standard device types (network, serial, etc.) and miscellanious
+   devices (gpio, LCD, spi, etc).  Also, since these devices are
+   implemented within the fpga fabric every instance of the device can be
+   synthesised with different options that change the behaviour.
+
+   Each IP-core has a set of parameters which the FPGA designer can use to
+   control how the core is synthesized.  Historically, the EDK tool would
+   extract the device parameters relevant to device drivers and copy them
+   into an 'xparameters.h' in the form of #define symbols.  This tells the
+   device drivers how the IP cores are configured, but it requres the kernel
+   to be recompiled every time the FPGA bitstream is resynthesized.
+
+   The new approach is to export the parameters into the device tree and
+   generate a new device tree each time the FPGA bitstream changes.  The
+   parameters which used to be exported as #defines will now become
+   properties of the device node.  In general, device nodes for IP-cores
+   will take the following form:
+
+       (name)@(base-address) {
+               compatible = "xlnx,(ip-core-name)-(HW_VER)"
+                            [, (list of compatible devices), ...];
+               reg = <(baseaddr) (size)>;
+               interrupt-parent = <&interrupt-controller-phandle>;
+               interrupts = < ... >;
+               xlnx,(parameter1) = "(string-value)";
+               xlnx,(parameter2) = <(int-value)>;
+       };
+
+       (ip-core-name): the name of the ip block (given after the BEGIN
+                       directive in system.mhs).  Should be in lowercase
+                       and all underscores '_' converted to dashes '-'.
+       (name):         is derived from the "PARAMETER INSTANCE" value.
+       (parameter#):   C_* parameters from system.mhs.  The C_ prefix is
+                       dropped from the parameter name, the name is converted
+                       to lowercase and all underscore '_' characters are
+                       converted to dashes '-'.
+       (baseaddr):     the C_BASEADDR parameter.
+       (HW_VER):       from the HW_VER parameter.
+       (size):         equals C_HIGHADDR - C_BASEADDR + 1
+
+   Typically, the compatible list will include the exact IP core version
+   followed by an older IP core version which implements the same
+   interface or any other device with the same interface.
+
+   'reg', 'interrupt-parent' and 'interrupts' are all optional properties.
+
+   For example, the following block from system.mhs:
+
+       BEGIN opb_uartlite
+               PARAMETER INSTANCE = opb_uartlite_0
+               PARAMETER HW_VER = 1.00.b
+               PARAMETER C_BAUDRATE = 115200
+               PARAMETER C_DATA_BITS = 8
+               PARAMETER C_ODD_PARITY = 0
+               PARAMETER C_USE_PARITY = 0
+               PARAMETER C_CLK_FREQ = 50000000
+               PARAMETER C_BASEADDR = 0xEC100000
+               PARAMETER C_HIGHADDR = 0xEC10FFFF
+               BUS_INTERFACE SOPB = opb_7
+               PORT OPB_Clk = CLK_50MHz
+               PORT Interrupt = opb_uartlite_0_Interrupt
+               PORT RX = opb_uartlite_0_RX
+               PORT TX = opb_uartlite_0_TX
+               PORT OPB_Rst = sys_bus_reset_0
+       END
+
+   becomes the following device tree node:
+
+       opb-uartlite-0@ec100000 {
+               device_type = "serial";
+               compatible = "xlnx,opb-uartlite-1.00.b";
+               reg = <ec100000 10000>;
+               interrupt-parent = <&opb-intc>;
+               interrupts = <1 0>; // got this from the opb_intc parameters
+               current-speed = <d#115200>;     // standard serial device prop
+               clock-frequency = <d#50000000>; // standard serial device prop
+               xlnx,data-bits = <8>;
+               xlnx,odd-parity = <0>;
+               xlnx,use-parity = <0>;
+       };
+
+   Some IP cores actually implement 2 or more logical devices.  In this case,
+   the device should still describe the whole IP core with a single node
+   and add a child node for each logical device.  The ranges property can
+   be used to translate from parent IP-core to the registers of each device.
+   (Note: this makes the assumption that both logical devices have the same
+   bus binding.  If this is not true, then separate nodes should be used for
+   each logical device).  The 'cell-index' property can be used to enumerate
+   logical devices within an IP core.  For example, the following is the
+   system.mhs entry for the dual ps2 controller found on the ml403 reference
+   design.
+
+       BEGIN opb_ps2_dual_ref
+               PARAMETER INSTANCE = opb_ps2_dual_ref_0
+               PARAMETER HW_VER = 1.00.a
+               PARAMETER C_BASEADDR = 0xA9000000
+               PARAMETER C_HIGHADDR = 0xA9001FFF
+               BUS_INTERFACE SOPB = opb_v20_0
+               PORT Sys_Intr1 = ps2_1_intr
+               PORT Sys_Intr2 = ps2_2_intr
+               PORT Clkin1 = ps2_clk_rx_1
+               PORT Clkin2 = ps2_clk_rx_2
+               PORT Clkpd1 = ps2_clk_tx_1
+               PORT Clkpd2 = ps2_clk_tx_2
+               PORT Rx1 = ps2_d_rx_1
+               PORT Rx2 = ps2_d_rx_2
+               PORT Txpd1 = ps2_d_tx_1
+               PORT Txpd2 = ps2_d_tx_2
+       END
+
+   It would result in the following device tree nodes:
+
+       opb_ps2_dual_ref_0@a9000000 {
+               ranges = <0 a9000000 2000>;
+               // If this device had extra parameters, then they would
+               // go here.
+               ps2@0 {
+                       compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
+                       reg = <0 40>;
+                       interrupt-parent = <&opb-intc>;
+                       interrupts = <3 0>;
+                       cell-index = <0>;
+               };
+               ps2@1000 {
+                       compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
+                       reg = <1000 40>;
+                       interrupt-parent = <&opb-intc>;
+                       interrupts = <3 0>;
+                       cell-index = <0>;
+               };
+       };
+
+   Also, the system.mhs file defines bus attachments from the processor
+   to the devices.  The device tree structure should reflect the bus
+   attachments.  Again an example; this system.mhs fragment:
+
+       BEGIN ppc405_virtex4
+               PARAMETER INSTANCE = ppc405_0
+               PARAMETER HW_VER = 1.01.a
+               BUS_INTERFACE DPLB = plb_v34_0
+               BUS_INTERFACE IPLB = plb_v34_0
+       END
+
+       BEGIN opb_intc
+               PARAMETER INSTANCE = opb_intc_0
+               PARAMETER HW_VER = 1.00.c
+               PARAMETER C_BASEADDR = 0xD1000FC0
+               PARAMETER C_HIGHADDR = 0xD1000FDF
+               BUS_INTERFACE SOPB = opb_v20_0
+       END
+
+       BEGIN opb_uart16550
+               PARAMETER INSTANCE = opb_uart16550_0
+               PARAMETER HW_VER = 1.00.d
+               PARAMETER C_BASEADDR = 0xa0000000
+               PARAMETER C_HIGHADDR = 0xa0001FFF
+               BUS_INTERFACE SOPB = opb_v20_0
+       END
+
+       BEGIN plb_v34
+               PARAMETER INSTANCE = plb_v34_0
+               PARAMETER HW_VER = 1.02.a
+       END
+
+       BEGIN plb_bram_if_cntlr
+               PARAMETER INSTANCE = plb_bram_if_cntlr_0
+               PARAMETER HW_VER = 1.00.b
+               PARAMETER C_BASEADDR = 0xFFFF0000
+               PARAMETER C_HIGHADDR = 0xFFFFFFFF
+               BUS_INTERFACE SPLB = plb_v34_0
+       END
+
+       BEGIN plb2opb_bridge
+               PARAMETER INSTANCE = plb2opb_bridge_0
+               PARAMETER HW_VER = 1.01.a
+               PARAMETER C_RNG0_BASEADDR = 0x20000000
+               PARAMETER C_RNG0_HIGHADDR = 0x3FFFFFFF
+               PARAMETER C_RNG1_BASEADDR = 0x60000000
+               PARAMETER C_RNG1_HIGHADDR = 0x7FFFFFFF
+               PARAMETER C_RNG2_BASEADDR = 0x80000000
+               PARAMETER C_RNG2_HIGHADDR = 0xBFFFFFFF
+               PARAMETER C_RNG3_BASEADDR = 0xC0000000
+               PARAMETER C_RNG3_HIGHADDR = 0xDFFFFFFF
+               BUS_INTERFACE SPLB = plb_v34_0
+               BUS_INTERFACE MOPB = opb_v20_0
+       END
+
+   Gives this device tree (some properties removed for clarity):
+
+       plb-v34-0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               device_type = "ibm,plb";
+               ranges; // 1:1 translation
+
+               plb-bram-if-cntrl-0@ffff0000 {
+                       reg = <ffff0000 10000>;
+               }
+
+               opb-v20-0 {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <20000000 20000000 20000000
+                                 60000000 60000000 20000000
+                                 80000000 80000000 40000000
+                                 c0000000 c0000000 20000000>;
+
+                       opb-uart16550-0@a0000000 {
+                               reg = <a00000000 2000>;
+                       };
+
+                       opb-intc-0@d1000fc0 {
+                               reg = <d1000fc0 20>;
+                       };
+               };
+       };
+
+   That covers the general approach to binding xilinx IP cores into the
+   device tree.  The following are bindings for specific devices:
+
+      i) Xilinx ML300 Framebuffer
+
+      Simple framebuffer device from the ML300 reference design (also on the
+      ML403 reference design as well as others).
+
+      Optional properties:
+       - resolution = <xres yres> : pixel resolution of framebuffer.  Some
+                                    implementations use a different resolution.
+                                    Default is <d#640 d#480>
+       - virt-resolution = <xvirt yvirt> : Size of framebuffer in memory.
+                                           Default is <d#1024 d#480>.
+       - rotate-display (empty) : rotate display 180 degrees.
+
+      ii) Xilinx SystemACE
+
+      The Xilinx SystemACE device is used to program FPGAs from an FPGA
+      bitstream stored on a CF card.  It can also be used as a generic CF
+      interface device.
+
+      Optional properties:
+       - 8-bit (empty) : Set this property for SystemACE in 8 bit mode
+
+      iii) Xilinx EMAC and Xilinx TEMAC
+
+      Xilinx Ethernet devices.  In addition to general xilinx properties
+      listed above, nodes for these devices should include a phy-handle
+      property, and may include other common network device properties
+      like local-mac-address.
+      
+      iv) Xilinx Uartlite
+
+      Xilinx uartlite devices are simple fixed speed serial ports.
+
+      Requred properties:
+       - current-speed : Baud rate of uartlite
+
    More devices will be defined as this spec matures.
 
 VII - Specifying interrupt information for devices
index c931d613f6410cb7dce6732ac1f68ddaf6a3ee9d..e20b19c1b60da04b95cfc62a0cec57428a53bb12 100644 (file)
@@ -180,9 +180,10 @@ driver returns ENOIOCTLCMD.  Some common examples:
     *  RTC_IRQP_SET, RTC_IRQP_READ: the irq_set_freq function will be called
        to set the frequency while the framework will handle the read for you
        since the frequency is stored in the irq_freq member of the rtc_device
-       structure.  Also make sure you set the max_user_freq member in your
-       initialization routines so the framework can sanity check the user
-       input for you.
+       structure.  Your driver needs to initialize the irq_freq member during
+       init.  Make sure you check the requested frequency is in range of your
+       hardware in the irq_set_freq function.  If you cannot actually change
+       the frequency, just return -ENOTTY.
 
 If all else fails, check out the rtc-test.c driver!
 
diff --git a/Documentation/scsi/link_power_management_policy.txt b/Documentation/scsi/link_power_management_policy.txt
new file mode 100644 (file)
index 0000000..d18993d
--- /dev/null
@@ -0,0 +1,19 @@
+This parameter allows the user to set the link (interface) power management.
+There are 3 possible options:
+
+Value                  Effect
+----------------------------------------------------------------------------
+min_power              Tell the controller to try to make the link use the
+                       least possible power when possible.  This may
+                       sacrifice some performance due to increased latency
+                       when coming out of lower power states.
+
+max_performance                Generally, this means no power management.  Tell
+                       the controller to have performance be a priority
+                       over power management.
+
+medium_power           Tell the controller to enter a lower power state
+                       when possible, but do not enter the lowest power
+                       state, thus improving latency over min_power setting.
+
+
index ec499265decaa45b7c2495e51bdc660f1959dc6f..10c041ca13c70c8f0e8d9c44a1e3118f34e9d793 100644 (file)
@@ -1,7 +1,7 @@
                     ThinkPad ACPI Extras Driver
 
-                            Version 0.16
-                          August 2nd, 2007
+                            Version 0.17
+                         October 04th, 2007
 
                Borislav Deianov <borislav@users.sf.net>
              Henrique de Moraes Holschuh <hmh@hmh.eng.br>
@@ -923,19 +923,34 @@ sysfs backlight device "thinkpad_screen"
 This feature allows software control of the LCD brightness on ThinkPad
 models which don't have a hardware brightness slider.
 
-It has some limitations: the LCD backlight cannot be actually turned on or off
-by this interface, and in many ThinkPad models, the "dim while on battery"
-functionality will be enabled by the BIOS when this interface is used, and
-cannot be controlled.
-
-The backlight control has eight levels, ranging from 0 to 7.  Some of the
-levels may not be distinct.
-
-There are two interfaces to the firmware for brightness control, EC and CMOS.
-To select which one should be used, use the brightness_mode module parameter:
-brightness_mode=1 selects EC mode, brightness_mode=2 selects CMOS mode,
-brightness_mode=3 selects both EC and CMOS.  The driver tries to autodetect
-which interface to use.
+It has some limitations: the LCD backlight cannot be actually turned on or
+off by this interface, and in many ThinkPad models, the "dim while on
+battery" functionality will be enabled by the BIOS when this interface is
+used, and cannot be controlled.
+
+On IBM (and some of the earlier Lenovo) ThinkPads, the backlight control
+has eight brightness levels, ranging from 0 to 7.  Some of the levels
+may not be distinct.  Later Lenovo models that implement the ACPI
+display backlight brightness control methods have 16 levels, ranging
+from 0 to 15.
+
+There are two interfaces to the firmware for direct brightness control,
+EC and CMOS.  To select which one should be used, use the
+brightness_mode module parameter: brightness_mode=1 selects EC mode,
+brightness_mode=2 selects CMOS mode, brightness_mode=3 selects both EC
+and CMOS.  The driver tries to autodetect which interface to use.
+
+When display backlight brightness controls are available through the
+standard ACPI interface, it is best to use it instead of this direct
+ThinkPad-specific interface.  The driver will disable its native
+backlight brightness control interface if it detects that the standard
+ACPI interface is available in the ThinkPad.
+
+The brightness_enable module parameter can be used to control whether
+the LCD brightness control feature will be enabled when available.
+brightness_enable=0 forces it to be disabled.  brightness_enable=1
+forces it to be enabled when available, even if the standard ACPI
+interface is also available.
 
 Procfs notes:
 
@@ -947,11 +962,11 @@ Procfs notes:
 
 Sysfs notes:
 
-The interface is implemented through the backlight sysfs class, which is poorly
-documented at this time.
+The interface is implemented through the backlight sysfs class, which is
+poorly documented at this time.
 
-Locate the thinkpad_screen device under /sys/class/backlight, and inside it
-there will be the following attributes:
+Locate the thinkpad_screen device under /sys/class/backlight, and inside
+it there will be the following attributes:
 
        max_brightness:
                Reads the maximum brightness the hardware can be set to.
@@ -961,17 +976,19 @@ there will be the following attributes:
                Reads what brightness the screen is set to at this instant.
 
        brightness:
-               Writes request the driver to change brightness to the given
-               value.  Reads will tell you what brightness the driver is trying
-               to set the display to when "power" is set to zero and the display
-               has not been dimmed by a kernel power management event.
+               Writes request the driver to change brightness to the
+               given value.  Reads will tell you what brightness the
+               driver is trying to set the display to when "power" is set
+               to zero and the display has not been dimmed by a kernel
+               power management event.
 
        power:
-               power management mode, where 0 is "display on", and 1 to 3 will
-               dim the display backlight to brightness level 0 because
-               thinkpad-acpi cannot really turn the backlight off.  Kernel
-               power management events can temporarily increase the current
-               power management level, i.e. they can dim the display.
+               power management mode, where 0 is "display on", and 1 to 3
+               will dim the display backlight to brightness level 0
+               because thinkpad-acpi cannot really turn the backlight
+               off.  Kernel power management events can temporarily
+               increase the current power management level, i.e. they can
+               dim the display.
 
 
 Volume control -- /proc/acpi/ibm/volume
index a3026689bbe6b62b60878c89c16355dd5c8ace8a..37f0e3cedf43dba5dacbba345ea58ecc05364888 100644 (file)
@@ -8,4 +8,7 @@
   7 -> Leadtek Winfast USB II                   (em2800)
   8 -> Kworld USB2800                           (em2800)
   9 -> Pinnacle Dazzle DVC 90                   (em2820/em2840) [2304:0207]
+ 10 -> Hauppauge WinTV HVR 900                  (em2880)
+ 11 -> Terratec Hybrid XS                       (em2880)
  12 -> Kworld PVR TV 2800 RF                    (em2820/em2840)
+ 13 -> Terratec Prodigy XS                      (em2880)
index 892afcb81f302f3eda0e369cb1943caabeef7ff2..f5bd9bab7ed6eb3b2db50af5cffcd255e3846c72 100644 (file)
@@ -216,7 +216,7 @@ P:  Len Brown
 M:     len.brown@intel.com
 M:     lenb@kernel.org
 L:     linux-acpi@vger.kernel.org
-W:     http://acpi.sourceforge.net/
+W:     http://www.lesswatts.org/projects/acpi/
 T:     git kernel.org:/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git
 S:     Supported
 
@@ -235,8 +235,8 @@ W:  http://acpi.sourceforge.net/
 S:     Supported
 
 ACPI FAN DRIVER
-P:     Konstantin A. Karasyov
-M:     konstantin.a.karasyov@intel.com
+P:     Len Brown
+M:     len.brown@intel.com
 L:     linux-acpi@vger.kernel.org
 W:     http://acpi.sourceforge.net/
 S:     Supported
@@ -248,15 +248,15 @@ L:        pcihpd-discuss@lists.sourceforge.net
 S:     Supported
 
 ACPI THERMAL DRIVER
-P:     Konstantin A. Karasyov
-M:     konstantin.a.karasyov@intel.com
+P:     Len Brown
+M:     len.brown@intel.com
 L:     linux-acpi@vger.kernel.org
 W:     http://acpi.sourceforge.net/
 S:     Supported
 
 ACPI VIDEO DRIVER
-P:     Luming Yu
-M:     luming.yu@intel.com
+P:     Rui Zhang
+M:     rui.zhang@intel.com
 L:     linux-acpi@vger.kernel.org
 W:     http://acpi.sourceforge.net/
 S:     Supported
@@ -787,23 +787,25 @@ B43 WIRELESS DRIVER
 P:     Michael Buesch
 M:     mb@bu3sch.de
 P:     Stefano Brivio
-M:     st3@riseup.net
+M:     stefano.brivio@polimi.it
 L:     linux-wireless@vger.kernel.org
-W:     http://bcm43xx.berlios.de/
+W:     http://linuxwireless.org/en/users/Drivers/b43
 S:     Maintained
 
 B43LEGACY WIRELESS DRIVER
 P:     Larry Finger
 M:     Larry.Finger@lwfinger.net
+P:     Stefano Brivio
+M:     stefano.brivio@polimi.it
 L:     linux-wireless@vger.kernel.org
-W:     http://bcm43xx.berlios.de/
+W:     http://linuxwireless.org/en/users/Drivers/b43
 S:     Maintained
 
 BCM43XX WIRELESS DRIVER (SOFTMAC BASED VERSION)
 P:     Larry Finger
 M:     Larry.Finger@lwfinger.net
 P:     Stefano Brivio
-M:     st3@riseup.net
+M:     stefano.brivio@polimi.it
 L:     linux-wireless@vger.kernel.org
 W:     http://bcm43xx.berlios.de/
 S:     Maintained
@@ -1912,10 +1914,8 @@ L:       linux1394-devel@lists.sourceforge.net
 S:     Maintained
 
 IMS TWINTURBO FRAMEBUFFER DRIVER
-P:     Paul Mundt
-M:     lethal@chaoticdreams.org
 L:     linux-fbdev-devel@lists.sourceforge.net (subscribers-only)
-S:     Maintained
+S:     Orphan
 
 INFINIBAND SUBSYSTEM
 P:     Roland Dreier
@@ -2444,7 +2444,7 @@ M68K ON APPLE MACINTOSH
 P:     Joshua Thompson
 M:     funaho@jurai.org
 W:     http://www.mac.linux-m68k.org/
-L:     linux-mac68k@mac.linux-m68k.org
+L:     linux-m68k@lists.linux-m68k.org
 S:     Maintained
 
 M68K ON HP9000/300
@@ -2549,7 +2549,7 @@ S:        Supported
 
 MISCELLANEOUS MCA-SUPPORT
 P:     James Bottomley
-M:     jejb@steeleye.com
+M:     James.Bottomley@HansenPartnership.com
 L:     linux-kernel@vger.kernel.org
 S:     Maintained
 
@@ -3301,9 +3301,11 @@ S:       Maintained
 
 SCSI SUBSYSTEM
 P:     James E.J. Bottomley
-M:     James.Bottomley@SteelEye.com
+M:     James.Bottomley@HansenPartnership.com
 L:     linux-scsi@vger.kernel.org
 T:     git kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git
+T:     git kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6.git
+T:     git kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-pending-2.6.git
 S:     Maintained
 
 SCSI TAPE DRIVER
@@ -3450,15 +3452,10 @@ L:      lm-sensors@lm-sensors.org
 S:     Maintained
 
 SOFTMAC LAYER (IEEE 802.11)
-P:     Johannes Berg
-M:     johannes@sipsolutions.net
-P:     Joe Jezak
-M:     josejx@gentoo.org
 P:     Daniel Drake
 M:     dsd@gentoo.org
-W:     http://softmac.sipsolutions.net/
 L:     linux-wireless@vger.kernel.org
-S:     Maintained
+S:     Obsolete
 
 SOFTWARE RAID (Multiple Disks) SUPPORT
 P:     Ingo Molnar
@@ -3477,12 +3474,14 @@ L:      linux-pm@lists.linux-foundation.org
 S:     Supported
 
 SUSPEND TO RAM:
+P:     Len Brown
+M:     len.brown@intel.com
 P:     Pavel Machek
 M:     pavel@suse.cz
 P:     Rafael J. Wysocki
 M:     rjw@sisk.pl
 L:     linux-pm@lists.linux-foundation.org
-S:     Maintained
+S:     Supported
 
 SONIC NETWORK DRIVER
 P:     Thomas Bogendoerfer
@@ -3635,18 +3634,12 @@ M:      laredo@gnu.org
 W:     http://www.stradis.com/
 S:     Maintained
 
-SUPERH (sh)
-P:     Paul Mundt
-M:     lethal@linux-sh.org
-L:     linuxsh-dev@lists.sourceforge.net (subscribers-only)
-W:     http://www.linux-sh.org
-S:     Maintained
-
-SUPERH64 (sh64)
+SUPERH
 P:     Paul Mundt
 M:     lethal@linux-sh.org
-L:     linuxsh-shmedia-dev@lists.sourceforge.net
+L:     linux-sh@vger.kernel.org
 W:     http://www.linux-sh.org
+T:     git kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6.git
 S:     Maintained
 
 SUN3/3X
@@ -3732,7 +3725,7 @@ S:        Maintained
 TLAN NETWORK DRIVER
 P:     Samuel Chessman
 M:     chessman@tux.org
-L:     tlan-devel@lists.sourceforge.net
+L:     tlan-devel@lists.sourceforge.net (subscribers-only)
 W:     http://sourceforge.net/projects/tlan/
 S:     Maintained
 
index 8816060cdf4046a62221838d899a604f64dc8526..a65ffd27de6b5f6786f2d17cc716f003efa628b9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 24
-EXTRAVERSION = -rc1
+EXTRAVERSION = -rc3
 NAME = Arr Matey! A Hairy Bilge Rat!
 
 # *DOCUMENTATION*
@@ -168,7 +168,8 @@ export srctree objtree VPATH TOPDIR
 SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
                                  -e s/arm.*/arm/ -e s/sa110/arm/ \
                                  -e s/s390x/s390/ -e s/parisc64/parisc/ \
-                                 -e s/ppc.*/powerpc/ -e s/mips.*/mips/ )
+                                 -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
+                                 -e s/sh[234].*/sh/ )
 
 # Cross compiling and selecting different set of gcc/bin-utils
 # ---------------------------------------------------------------------------
@@ -196,8 +197,13 @@ CROSS_COMPILE      ?=
 UTS_MACHINE    := $(ARCH)
 SRCARCH        := $(ARCH)
 
-# for i386 and x86_64 we use SRCARCH equal to x86
-SRCARCH := $(if $(filter x86_64 i386,$(SRCARCH)),x86,$(SRCARCH))
+# Additional ARCH settings for x86
+ifeq ($(ARCH),i386)
+        SRCARCH := x86
+endif
+ifeq ($(ARCH),x86_64)
+        SRCARCH := x86
+endif
 
 KCONFIG_CONFIG ?= .config
 
@@ -527,9 +533,22 @@ KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
 KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,)
 
 # Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments
-KBUILD_CPPFLAGS += $(CPPFLAGS)
-KBUILD_AFLAGS   += $(AFLAGS)
-KBUILD_CFLAGS   += $(CFLAGS)
+# But warn user when we do so
+warn-assign = \
+$(warning "WARNING: Appending $$K$(1) ($(K$(1))) from $(origin K$(1)) to kernel $$$(1)")
+
+ifneq ($(KCPPFLAGS),)
+        $(call warn-assign,CPPFLAGS)
+        KBUILD_CPPFLAGS += $(KCPPFLAGS)
+endif
+ifneq ($(KAFLAGS),)
+        $(call warn-assign,AFLAGS)
+        KBUILD_AFLAGS += $(KAFLAGS)
+endif
+ifneq ($(KCFLAGS),)
+        $(call warn-assign,CFLAGS)
+        KBUILD_CFLAGS += $(KCFLAGS)
+endif
 
 # Use --build-id when available.
 LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\
@@ -1313,12 +1332,7 @@ else
 ALLINCLUDE_ARCHS := $(ALLSOURCE_ARCHS)
 endif
 
-# Take care of arch/x86
-ifeq ($(ARCH), $(SRCARCH))
-ALLSOURCE_ARCHS := $(ARCH)
-else
-ALLSOURCE_ARCHS := $(ARCH) $(SRCARCH)
-endif
+ALLSOURCE_ARCHS := $(SRCARCH)
 
 define find-sources
         ( for arch in $(ALLSOURCE_ARCHS) ; do \
index a0cdaafa115b65accca46e4fdf8a4307d4ee2408..a7e9fea978a65fbb89508f428d870471b0fb7a6b 100644 (file)
@@ -1040,6 +1040,8 @@ source "drivers/power/Kconfig"
 
 source "drivers/hwmon/Kconfig"
 
+source "drivers/watchdog/Kconfig"
+
 source "drivers/ssb/Kconfig"
 
 #source "drivers/l3/Kconfig"
diff --git a/arch/arm/configs/zylonite_defconfig b/arch/arm/configs/zylonite_defconfig
new file mode 100644 (file)
index 0000000..7949d04
--- /dev/null
@@ -0,0 +1,736 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.23
+# Tue Oct 23 13:33:20 2007
+#
+CONFIG_ARM=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_GENERIC_GPIO=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_MMU=y
+# CONFIG_NO_IOPORT is not set
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_ZONE_DMA=y
+CONFIG_ARCH_MTD_XIP=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=18
+# CONFIG_CGROUPS is not set
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FAIR_USER_SCHED=y
+# CONFIG_FAIR_CGROUP_SCHED is not set
+CONFIG_SYSFS_DEPRECATED=y
+# CONFIG_RELAY is not set
+# CONFIG_BLK_DEV_INITRD is not set
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+# CONFIG_EMBEDDED is not set
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLUB_DEBUG=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+# CONFIG_SLOB is not set
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+# CONFIG_KMOD is not set
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="cfq"
+
+#
+# System Type
+#
+# CONFIG_ARCH_AAEC2000 is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_VERSATILE is not set
+# CONFIG_ARCH_AT91 is not set
+# CONFIG_ARCH_CLPS7500 is not set
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_CO285 is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_IOP13XX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_PNX4008 is not set
+CONFIG_ARCH_PXA=y
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_DAVINCI is not set
+# CONFIG_ARCH_OMAP is not set
+
+#
+# Intel PXA2xx/PXA3xx Implementations
+#
+
+#
+# Supported PXA3xx Processor Variants
+#
+CONFIG_CPU_PXA300=y
+CONFIG_CPU_PXA310=y
+CONFIG_CPU_PXA320=y
+# CONFIG_ARCH_LUBBOCK is not set
+# CONFIG_MACH_LOGICPD_PXA270 is not set
+# CONFIG_MACH_MAINSTONE is not set
+# CONFIG_ARCH_PXA_IDP is not set
+# CONFIG_PXA_SHARPSL is not set
+# CONFIG_MACH_TRIZEPS4 is not set
+# CONFIG_MACH_EM_X270 is not set
+CONFIG_MACH_ZYLONITE=y
+# CONFIG_MACH_ARMCORE is not set
+CONFIG_PXA3xx=y
+
+#
+# Boot options
+#
+
+#
+# Power management
+#
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_XSC3=y
+CONFIG_CPU_32v5=y
+CONFIG_CPU_ABRT_EV5T=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_TLB_V4WBI=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+CONFIG_IO_36=y
+
+#
+# Processor Features
+#
+# CONFIG_ARM_THUMB is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_BPREDICT_DISABLE is not set
+# CONFIG_OUTER_CACHE is not set
+CONFIG_IWMMXT=y
+
+#
+# Bus support
+#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+# CONFIG_PREEMPT is not set
+CONFIG_HZ=100
+CONFIG_AEABI=y
+CONFIG_OABI_COMPAT=y
+# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4096
+# CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="root=/dev/nfs rootfstype=nfs nfsroot=192.168.1.100:/nfs/rootfs/ ip=192.168.1.101:192.168.1.100::255.255.255.0::eth0:on console=ttyS0,38400 mem=64M debug"
+# CONFIG_XIP_KERNEL is not set
+# CONFIG_KEXEC is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_FPE_NWFPE=y
+# CONFIG_FPE_NWFPE_XP is not set
+# CONFIG_FPE_FASTFPE is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+
+#
+# Power management options
+#
+# CONFIG_PM is not set
+CONFIG_SUSPEND_UP_POSSIBLE=y
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+CONFIG_IP_PNP_RARP=y
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+# CONFIG_INET_DIAG is not set
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+
+#
+# Wireless
+#
+# CONFIG_CFG80211 is not set
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_MAC80211 is not set
+# CONFIG_IEEE80211 is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+# CONFIG_MTD is not set
+# CONFIG_PARPORT is not set
+# CONFIG_BLK_DEV is not set
+# CONFIG_MISC_DEVICES is not set
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SCSI_NETLINK is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+CONFIG_NETDEVICES=y
+# CONFIG_NETDEVICES_MULTIQUEUE is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+# CONFIG_PHYLIB is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_AX88796 is not set
+CONFIG_SMC91X=y
+# CONFIG_DM9000 is not set
+# CONFIG_SMC911X is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_B44 is not set
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+# CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_PXA=y
+CONFIG_SERIAL_PXA_CONSOLE=y
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_NVRAM is not set
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+# CONFIG_I2C is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_SM501 is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+CONFIG_FB=y
+# CONFIG_FIRMWARE_EDID is not set
+# CONFIG_FB_DDC is not set
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_SYS_FOPS is not set
+CONFIG_FB_DEFERRED_IO=y
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_S1D13XXX is not set
+CONFIG_FB_PXA=y
+# CONFIG_FB_PXA_PARAMETERS is not set
+# CONFIG_FB_MBX is not set
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
+# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
+CONFIG_FONTS=y
+# CONFIG_FONT_8x8 is not set
+# CONFIG_FONT_8x16 is not set
+CONFIG_FONT_6x11=y
+# CONFIG_FONT_7x14 is not set
+# CONFIG_FONT_PEARL_8x8 is not set
+# CONFIG_FONT_ACORN_8x8 is not set
+# CONFIG_FONT_MINI_4x6 is not set
+# CONFIG_FONT_SUN8x16 is not set
+# CONFIG_FONT_SUN12x22 is not set
+# CONFIG_FONT_10x18 is not set
+CONFIG_LOGO=y
+CONFIG_LOGO_LINUX_MONO=y
+CONFIG_LOGO_LINUX_VGA16=y
+CONFIG_LOGO_LINUX_CLUT224=y
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+# CONFIG_HID_SUPPORT is not set
+# CONFIG_USB_SUPPORT is not set
+# CONFIG_MMC is not set
+# CONFIG_NEW_LEDS is not set
+CONFIG_RTC_LIB=y
+# CONFIG_RTC_CLASS is not set
+
+#
+# File systems
+#
+# CONFIG_EXT2_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_EXT4DEV_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+CONFIG_FS_POSIX_ACL=y
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_INOTIFY is not set
+# CONFIG_QUOTA is not set
+CONFIG_DNOTIFY=y
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+# CONFIG_TMPFS is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+CONFIG_NFS_DIRECTIO=y
+# CONFIG_NFSD is not set
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_ACL_SUPPORT=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_BIND34 is not set
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_NLS is not set
+# CONFIG_DLM is not set
+# CONFIG_INSTRUMENTATION is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_MUST_CHECK=y
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+# CONFIG_SLUB_DEBUG_ON is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+CONFIG_FRAME_POINTER=y
+# CONFIG_SAMPLES is not set
+CONFIG_DEBUG_USER=y
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_MANAGER=y
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_XCBC is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=y
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_WP512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_GF128MUL is not set
+# CONFIG_CRYPTO_ECB is not set
+CONFIG_CRYPTO_CBC=y
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_XTS is not set
+# CONFIG_CRYPTO_CRYPTD is not set
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_TEST is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_HW is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
index 1873bd8cd1b2cb167e6ba780916c0ef6933acede..bc91d6e66bc4ea05e067d3b322b3ed8f1f64ac07 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <linux/mm.h>
 #include <linux/init.h>
+#include <linux/f75375s.h>
 #include <linux/delay.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
@@ -200,11 +201,21 @@ static struct platform_device n2100_serial_device = {
        .resource       = &n2100_uart_resource,
 };
 
+static struct f75375s_platform_data n2100_f75375s = {
+       .pwm            = { 255, 255 },
+       .pwm_enable = { 0, 0 },
+};
+
 static struct i2c_board_info __initdata n2100_i2c_devices[] = {
        {
                I2C_BOARD_INFO("rtc-rs5c372", 0x32),
                .type = "rs5c372b",
        },
+       {
+               I2C_BOARD_INFO("f75375", 0x2e),
+               .type = "f75375",
+               .platform_data = &n2100_f75375s,
+       },
 };
 
 /*
index 86f53f8ccbf5bbac71554736b4051fc487c1f894..08d2707f6ca8aab66ffdfbb502175a31fd144f9e 100644 (file)
@@ -14,7 +14,7 @@ config ARCH_ENP2611
        help
          Say 'Y' here if you want your kernel to support the Radisys
          ENP2611 PCI network processing card. For more information on
-         this card, see <file:Documentation/arm/ENP2611>.
+         this card, see <file:Documentation/arm/IXP2000>.
 
 config ARCH_IXDP2400
        bool "Support Intel IXDP2400"
index 172a058ddd6611cd2dc51b4a7b224ce7aa4841fb..ca9c5b61283acd5ebe1d7c3ecce9cbb53bfd6083 100644 (file)
@@ -190,15 +190,15 @@ struct xc *request_xc(int xcno, struct device *dev)
                goto exit;
 
        if (!request_mem_region
-           (NETX_PA_XPEC(xcno), XPEC_MEM_SIZE, dev->kobj.name))
+           (NETX_PA_XPEC(xcno), XPEC_MEM_SIZE, kobject_name(&dev->kobj)))
                goto exit_free;
 
        if (!request_mem_region
-           (NETX_PA_XMAC(xcno), XMAC_MEM_SIZE, dev->kobj.name))
+           (NETX_PA_XMAC(xcno), XMAC_MEM_SIZE, kobject_name(&dev->kobj)))
                goto exit_release_1;
 
        if (!request_mem_region
-           (SRAM_INTERNAL_PHYS(xcno), SRAM_MEM_SIZE, dev->kobj.name))
+           (SRAM_INTERNAL_PHYS(xcno), SRAM_MEM_SIZE, kobject_name(&dev->kobj)))
                goto exit_release_2;
 
        x->xpec_base = (void * __iomem)io_p2v(NETX_PA_XPEC(xcno));
index b0921622566f34c1745cd9f28bff45f81f334780..130681201c19266d17d66f2c1a6faa5371809268 100644 (file)
@@ -343,6 +343,7 @@ static struct platform_device *h2_devices[] __initdata = {
        &h2_mcbsp1_device,
 };
 
+#ifdef CONFIG_I2C_BOARDINFO
 static struct i2c_board_info __initdata h2_i2c_board_info[] = {
        {
                I2C_BOARD_INFO("tps65010", 0x48),
@@ -356,6 +357,7 @@ static struct i2c_board_info __initdata h2_i2c_board_info[] = {
         *  - ... etc
         */
 };
+#endif
 
 static void __init h2_init_smc91x(void)
 {
@@ -467,8 +469,10 @@ static void __init h2_init(void)
        if (gpio_request(58, "tps65010") == 0)
                gpio_direction_input(58);
 
+#ifdef CONFIG_I2C_BOARDINFO
        i2c_register_board_info(1, h2_i2c_board_info,
                        ARRAY_SIZE(h2_i2c_board_info));
+#endif
 }
 
 static void __init h2_map_io(void)
index d9af4367f8bb033376c1f2863bc0de95c27d70f4..e6e85b7b097b0e926f977034aea98515da2321fb 100644 (file)
@@ -651,7 +651,7 @@ static u32 omap2_get_clksel(u32 *div_sel, u32 *field_mask,
                break;
        case CM_SYSCLKOUT_SEL1:
                div_addr = (u32)&PRCM_CLKOUT_CTRL;
-               if ((div_off == 3) || (div_off = 11))
+               if ((div_off == 3) || (div_off == 11))
                        mask= 0x3;
                break;
        case CM_CORE_SEL1:
index 5cd3cadbbd10dd00030d52d231854f141ff002fe..436f965749641abd7bb80fb4c957aee91641c5ad 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Copyright (C) 2007 Marvell Internation Ltd.
  *
- * 2007-08-21: eric miao <eric.y.miao@gmail.com>
+ * 2007-08-21: eric miao <eric.miao@marvell.com>
  *             initial version
  *
  *  This program is free software; you can redistribute it and/or modify
index 7a34231f31726ba66dcff10b357750d14dd12cbd..0a0d3877f2125e65fa09db0aba2f401c080291fa 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Copyright (C) 2007 Marvell Internation Ltd.
  *
- * 2007-08-21: eric miao <eric.y.miao@gmail.com>
+ * 2007-08-21: eric miao <eric.miao@marvell.com>
  *             initial version
  *
  * This program is free software; you can redistribute it and/or modify
index cd9eba5b3df95063c2d955fd7dbf20c061a8c462..1010f77d977a480ea8295aa359277ae9e44f0a4d 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Copyright (C) 2007 Marvell Internation Ltd.
  *
- * 2007-08-21: eric miao <eric.y.miao@gmail.com>
+ * 2007-08-21: eric miao <eric.miao@marvell.com>
  *             initial version
  *
  * This program is free software; you can redistribute it and/or modify
index 39f0de8c189e7737ff981da4c217b5deb5f7db07..61d9c9d69e6b54c17d49067a3f3822e161c33d09 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Copyright (C) 2006 Marvell International Ltd.
  *
- * 2007-09-02: eric miao <eric.y.miao@gmail.com>
+ * 2007-09-02: eric miao <eric.miao@marvell.com>
  *             initial version
  *
  * This program is free software; you can redistribute it and/or modify
@@ -150,22 +150,45 @@ static void clk_pxa3xx_cken_disable(struct clk *clk)
        local_irq_enable();
 }
 
+static const struct clkops clk_pxa3xx_cken_ops = {
+       .enable         = clk_pxa3xx_cken_enable,
+       .disable        = clk_pxa3xx_cken_disable,
+};
+
 static const struct clkops clk_pxa3xx_hsio_ops = {
        .enable         = clk_pxa3xx_cken_enable,
        .disable        = clk_pxa3xx_cken_disable,
        .getrate        = clk_pxa3xx_hsio_getrate,
 };
 
+#define PXA3xx_CKEN(_name, _cken, _rate, _delay, _dev) \
+       {                                               \
+               .name   = _name,                        \
+               .dev    = _dev,                         \
+               .ops    = &clk_pxa3xx_cken_ops,         \
+               .rate   = _rate,                        \
+               .cken   = CKEN_##_cken,                 \
+               .delay  = _delay,                       \
+       }
+
+#define PXA3xx_CK(_name, _cken, _ops, _dev)            \
+       {                                               \
+               .name   = _name,                        \
+               .dev    = _dev,                         \
+               .ops    = _ops,                         \
+               .cken   = CKEN_##_cken,                 \
+       }
+
 static struct clk pxa3xx_clks[] = {
-       INIT_CK("LCDCLK", LCD,    &clk_pxa3xx_hsio_ops, &pxa_device_fb.dev),
-       INIT_CK("CAMCLK", CAMERA, &clk_pxa3xx_hsio_ops, NULL),
+       PXA3xx_CK("LCDCLK", LCD,    &clk_pxa3xx_hsio_ops, &pxa_device_fb.dev),
+       PXA3xx_CK("CAMCLK", CAMERA, &clk_pxa3xx_hsio_ops, NULL),
 
-       INIT_CKEN("UARTCLK", FFUART, 14857000, 1, &pxa_device_ffuart.dev),
-       INIT_CKEN("UARTCLK", BTUART, 14857000, 1, &pxa_device_btuart.dev),
-       INIT_CKEN("UARTCLK", STUART, 14857000, 1, NULL),
+       PXA3xx_CKEN("UARTCLK", FFUART, 14857000, 1, &pxa_device_ffuart.dev),
+       PXA3xx_CKEN("UARTCLK", BTUART, 14857000, 1, &pxa_device_btuart.dev),
+       PXA3xx_CKEN("UARTCLK", STUART, 14857000, 1, NULL),
 
-       INIT_CKEN("I2CCLK",  I2C,  32842000, 0, &pxa_device_i2c.dev),
-       INIT_CKEN("UDCCLK",  UDC,  48000000, 5, &pxa_device_udc.dev),
+       PXA3xx_CKEN("I2CCLK", I2C,  32842000, 0, &pxa_device_i2c.dev),
+       PXA3xx_CKEN("UDCCLK", UDC,  48000000, 5, &pxa_device_udc.dev),
 };
 
 void __init pxa3xx_init_irq(void)
index ec4286c7931cfdb821a996565c29ed17699d22cd..fbfa1920353d8c9c12ef5535342d8bb2b4b5f5fd 100644 (file)
@@ -68,6 +68,7 @@ pxa_ost0_interrupt(int irq, void *dev_id)
        if (c->mode == CLOCK_EVT_MODE_ONESHOT) {
                /* Disarm the compare/match, signal the event. */
                OIER &= ~OIER_E0;
+               OSSR = OSSR_M0;
                c->event_handler(c);
        } else if (c->mode == CLOCK_EVT_MODE_PERIODIC) {
                /* Call the event handler as many times as necessary
@@ -100,9 +101,9 @@ pxa_ost0_interrupt(int irq, void *dev_id)
                 * anything that might put us "very close".
         */
 #define MIN_OSCR_DELTA 16
-       do {
+               do {
                        OSSR = OSSR_M0;
-               next_match = (OSMR0 += LATCH);
+                       next_match = (OSMR0 += LATCH);
                        c->event_handler(c);
                } while (((signed long)(next_match - OSCR) <= MIN_OSCR_DELTA)
                         && (c->mode == CLOCK_EVT_MODE_PERIODIC));
@@ -114,14 +115,16 @@ pxa_ost0_interrupt(int irq, void *dev_id)
 static int
 pxa_osmr0_set_next_event(unsigned long delta, struct clock_event_device *dev)
 {
-       unsigned long irqflags;
+       unsigned long flags, next, oscr;
 
-       raw_local_irq_save(irqflags);
-       OSMR0 = OSCR + delta;
-       OSSR = OSSR_M0;
+       raw_local_irq_save(flags);
        OIER |= OIER_E0;
-       raw_local_irq_restore(irqflags);
-       return 0;
+       next = OSCR + delta;
+       OSMR0 = next;
+       oscr = OSCR;
+       raw_local_irq_restore(flags);
+
+       return (signed)(next - oscr) <= MIN_OSCR_DELTA ? -ETIME : 0;
 }
 
 static void
@@ -132,15 +135,16 @@ pxa_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *dev)
        switch (mode) {
        case CLOCK_EVT_MODE_PERIODIC:
                raw_local_irq_save(irqflags);
-               OSMR0 = OSCR + LATCH;
                OSSR = OSSR_M0;
                OIER |= OIER_E0;
+               OSMR0 = OSCR + LATCH;
                raw_local_irq_restore(irqflags);
                break;
 
        case CLOCK_EVT_MODE_ONESHOT:
                raw_local_irq_save(irqflags);
                OIER &= ~OIER_E0;
+               OSSR = OSSR_M0;
                raw_local_irq_restore(irqflags);
                break;
 
@@ -149,8 +153,12 @@ pxa_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *dev)
                /* initializing, released, or preparing for suspend */
                raw_local_irq_save(irqflags);
                OIER &= ~OIER_E0;
+               OSSR = OSSR_M0;
                raw_local_irq_restore(irqflags);
                break;
+
+       case CLOCK_EVT_MODE_RESUME:
+               break;
        }
 }
 
index 3f18d760dd1b5296e5881cd9cda61672e47f06fb..743a87b2faa132a7710ddece44ecd84651eb15d3 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Copyright (C) 2006 Marvell International Ltd.
  *
- * 2007-09-04: eric miao <eric.y.miao@gmail.com>
+ * 2007-09-04: eric miao <eric.miao@marvell.com>
  *             rewrite to align with latest kernel
  *
  * This program is free software; you can redistribute it and/or modify
index b5fbd2f4c693a07c1f7e86d01b788c69122d623f..1832bc316501a07071dfaf08519fefb74ed3cce5 100644 (file)
@@ -5,7 +5,7 @@
  * PXA3xx Development Platform (aka Zylonite)
  *
  * Copyright (C) 2007 Marvell Internation Ltd.
- * 2007-08-21: eric miao <eric.y.miao@gmail.com>
+ * 2007-08-21: eric miao <eric.miao@marvell.com>
  *             initial version
  *
  * This program is free software; you can redistribute it and/or modify
index 63cb36be086bfda5ebeb0d17903d7b3704e7b35d..94c715808b591b676a70b8ab45a1c4e557d542e7 100644 (file)
@@ -5,7 +5,7 @@
  * PXA3xx Development Platform (aka Zylonite)
  *
  * Copyright (C) 2007 Marvell Internation Ltd.
- * 2007-08-21: eric miao <eric.y.miao@gmail.com>
+ * 2007-08-21: eric miao <eric.miao@marvell.com>
  *             initial version
  *
  * This program is free software; you can redistribute it and/or modify
index cefdf2f9f26e2b758fd7b96ecafded6fa8b73ff3..333a82a3717e07daa8979986480579b943507e53 100644 (file)
@@ -322,7 +322,6 @@ static int dma_mmap(struct device *dev, struct vm_area_struct *vma,
 
                if (off < kern_size &&
                    user_size <= (kern_size - off)) {
-                       vma->vm_flags |= VM_RESERVED;
                        ret = remap_pfn_range(vma, vma->vm_start,
                                              page_to_pfn(c->vm_pages) + off,
                                              user_size << PAGE_SHIFT,
index 5b80b6bdd0cb3676a65e7d6b7f211c2a2e7f1ce9..194ef48968e600b2cb1818fcf9dc961d3d998c83 100644 (file)
@@ -105,9 +105,13 @@ ENTRY(cpu_arm926_do_idle)
        mrc     p15, 0, r1, c1, c0, 0           @ Read control register
        mcr     p15, 0, r0, c7, c10, 4          @ Drain write buffer
        bic     r2, r1, #1 << 12
+       mrs     r3, cpsr                        @ Disable FIQs while Icache
+       orr     ip, r3, #PSR_F_BIT              @ is disabled
+       msr     cpsr_c, ip
        mcr     p15, 0, r2, c1, c0, 0           @ Disable I cache
        mcr     p15, 0, r0, c7, c0, 4           @ Wait for interrupt
        mcr     p15, 0, r1, c1, c0, 0           @ Restore ICache enable
+       msr     cpsr_c, r3                      @ Restore FIQ state
        mov     pc, lr
 
 /*
index 4493bcff51729a2e4340d0d196ce67e10a1611ca..ee40c1a0b83d6788f24bd66b8530661b357c5b07 100644 (file)
@@ -171,7 +171,7 @@ static int check_fbmem_region(int region_idx, struct omapfb_mem_region *rg,
  * Called from map_io. We need to call to this early enough so that we
  * can reserve the fixed SDRAM regions before VM could get hold of them.
  */
-void omapfb_reserve_sdram(void)
+void __init omapfb_reserve_sdram(void)
 {
        struct bootmem_data     *bdata;
        unsigned long           sdram_start, sdram_size;
index bbecbd8469b59a449b6d525c1bc0725f81b7da29..4f402c92450496342bd0ea4a92bd2c09b4478b68 100644 (file)
@@ -19,9 +19,6 @@ config AVR32
          There is an AVR32 Linux project with a web page at
          http://avr32linux.org/.
 
-config UID16
-       bool
-
 config GENERIC_GPIO
        bool
        default y
index a9d9ec081e3d7b8c729dfff3100ca3f2bc5f2b45..7c4388f4f17ff697405455c39a0bd78641ae4ca9 100644 (file)
@@ -474,7 +474,7 @@ static struct resource at32ap700x_rtc0_resource[] = {
 static struct resource at32_wdt0_resource[] = {
        {
                .start  = 0xfff000b0,
-               .end    = 0xfff000bf,
+               .end    = 0xfff000cf,
                .flags  = IORESOURCE_MEM,
        },
 };
@@ -690,7 +690,7 @@ static struct resource atmel_usart0_resource[] = {
        IRQ(6),
 };
 DEFINE_DEV_DATA(atmel_usart, 0);
-DEV_CLK(usart, atmel_usart0, pba, 4);
+DEV_CLK(usart, atmel_usart0, pba, 3);
 
 static struct atmel_uart_data atmel_usart1_data = {
        .use_dma_tx     = 1,
index 704607fbcc696d2223241ff26103176daa254b46..fa427ed427874843ea523c30c2c69b46089914be 100644 (file)
@@ -7,7 +7,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#define DEBUG
 #include <linux/clk.h>
 #include <linux/err.h>
 #include <linux/init.h>
index dd5c009cf224838379af65d498c35ed7357afcf2..0b286cd53028a469441af1ad99b56f97a6c37287 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/irq.h>
 #include <linux/platform_device.h>
 
+#include <asm/intc.h>
 #include <asm/io.h>
 
 #include "intc.h"
@@ -136,7 +137,8 @@ fail:
        panic("Interrupt controller initialization failed!\n");
 }
 
-unsigned long intc_get_pending(int group)
+unsigned long intc_get_pending(unsigned int group)
 {
        return intc_readl(&intc0, INTREQ0 + 4 * group);
 }
+EXPORT_SYMBOL_GPL(intc_get_pending);
index 7888551ed93992163438f5e0b56173b09d282a0e..2a3a7ea5958c004085e034bd5c9091a87ea751b3 100644 (file)
@@ -3,7 +3,7 @@
 # see Documentation/kbuild/kconfig-language.txt.
 #
 
-mainmenu "uClinux/Blackfin (w/o MMU) Kernel Configuration"
+mainmenu "Blackfin Kernel Configuration"
 
 config MMU
        bool
@@ -29,10 +29,6 @@ config ZONE_DMA
        bool
        default y
 
-config BFIN
-       bool
-       default y
-
 config SEMAPHORE_SLEEPERS
        bool
        default y
@@ -50,7 +46,7 @@ config GENERIC_HARDIRQS
        default y
 
 config GENERIC_IRQ_PROBE
-        bool
+       bool
        default y
 
 config GENERIC_TIME
@@ -69,11 +65,6 @@ config GENERIC_CALIBRATE_DELAY
        bool
        default y
 
-config IRQCHIP_DEMUX_GPIO
-       bool
-       depends on (BF52x || BF53x || BF561 || BF54x)
-       default y
-
 source "init/Kconfig"
 source "kernel/Kconfig.preempt"
 
@@ -140,6 +131,11 @@ config BF544
        help
          BF544 Processor Support.
 
+config BF547
+       bool "BF547"
+       help
+         BF547 Processor Support.
+
 config BF548
        bool "BF548"
        help
@@ -166,11 +162,11 @@ choice
 
 config BF_REV_0_0
        bool "0.0"
-       depends on (BF549 || BF527)
+       depends on (BF52x || BF54x)
 
 config BF_REV_0_1
-       bool "0.2"
-       depends on (BF549 || BF527)
+       bool "0.1"
+       depends on (BF52x || BF54x)
 
 config BF_REV_0_2
        bool "0.2"
@@ -208,7 +204,7 @@ config BF53x
 
 config BF54x
        bool
-       depends on (BF542 || BF544 || BF548 || BF549)
+       depends on (BF542 || BF544 || BF547 || BF548 || BF549)
        default y
 
 config BFIN_DUAL_CORE
@@ -221,89 +217,6 @@ config BFIN_SINGLE_CORE
        depends on !BFIN_DUAL_CORE
        default y
 
-choice
-       prompt "System type"
-       default BFIN533_STAMP
-       help
-         Do NOT change the board here.  Please use the top level
-         configuration to ensure that all the other settings are
-         correct.
-
-config BFIN527_EZKIT
-       bool "BF527-EZKIT"
-       depends on (BF522 || BF525 || BF527)
-       help
-         BF533-EZKIT-LITE board Support.
-
-config BFIN533_EZKIT
-       bool "BF533-EZKIT"
-       depends on (BF533 || BF532 || BF531)
-       help
-         BF533-EZKIT-LITE board Support.
-
-config  BFIN533_STAMP
-       bool "BF533-STAMP"
-       depends on (BF533 || BF532 || BF531)
-       help
-         BF533-STAMP board Support.
-
-config BFIN537_STAMP
-       bool "BF537-STAMP"
-       depends on (BF537 || BF536 || BF534)
-       help
-         BF537-STAMP board Support.
-
-config BFIN533_BLUETECHNIX_CM
-       bool "Bluetechnix CM-BF533"
-       depends on (BF533)
-       help
-         CM-BF533 support for EVAL- and DEV-Board.
-
-config BFIN537_BLUETECHNIX_CM
-       bool "Bluetechnix CM-BF537"
-       depends on (BF537)
-       help
-         CM-BF537 support for EVAL- and DEV-Board.
-
-config BFIN548_EZKIT
-       bool "BF548-EZKIT"
-       depends on (BF548 || BF549)
-         help
-         BFIN548-EZKIT board Support.
-
-config BFIN561_BLUETECHNIX_CM
-       bool "Bluetechnix CM-BF561"
-       depends on (BF561)
-       help
-         CM-BF561 support for EVAL- and DEV-Board.
-
-config BFIN561_EZKIT
-       bool "BF561-EZKIT"
-       depends on (BF561)
-       help
-         BF561-EZKIT-LITE board Support.
-
-config BFIN561_TEPLA
-       bool "BF561-TEPLA"
-       depends on (BF561)
-       help
-        BF561-TEPLA board Support.
-
-config PNAV10
-       bool "PNAV 1.0 board"
-       depends on (BF537)
-       help
-         PNAV 1.0 board Support.
-
-config GENERIC_BOARD
-       bool "Custom"
-       depends on (BF537 || BF536 \
-               || BF534 || BF561 || BF535 || BF533 || BF532 || BF531)
-       help
-         GENERIC or Custom board Support.
-
-endchoice
-
 config MEM_GENERIC_BOARD
        bool
        depends on GENERIC_BOARD
@@ -317,7 +230,8 @@ config MEM_MT48LC64M4A2FB_7E
 config MEM_MT48LC16M16A2TG_75
        bool
        depends on (BFIN533_EZKIT || BFIN561_EZKIT \
-               || BFIN533_BLUETECHNIX_CM || BFIN537_BLUETECHNIX_CM)
+               || BFIN533_BLUETECHNIX_CM || BFIN537_BLUETECHNIX_CM \
+               || H8606_HVSISTEMAS)
        default y
 
 config MEM_MT48LC32M8A2_75
@@ -366,7 +280,7 @@ config CLKIN_HZ
        int "Crystal Frequency in Hz"
        default "11059200" if BFIN533_STAMP
        default "27000000" if BFIN533_EZKIT
-       default "25000000" if (BFIN537_STAMP || BFIN527_EZKIT)
+       default "25000000" if (BFIN537_STAMP || BFIN527_EZKIT || H8606_HVSISTEMAS)
        default "30000000" if BFIN561_EZKIT
        default "24576000" if PNAV10
        help
@@ -382,9 +296,9 @@ config BFIN_KERNEL_CLOCK
          configuration.
 
 config PLL_BYPASS
-        bool "Bypass PLL"
-        depends on BFIN_KERNEL_CLOCK
-        default n
+       bool "Bypass PLL"
+       depends on BFIN_KERNEL_CLOCK
+       default n
 
 config CLKIN_HALF
        bool "Half Clock In"
@@ -404,6 +318,7 @@ config VCO_MULT
        default "20" if BFIN537_BLUETECHNIX_CM
        default "20" if BFIN561_BLUETECHNIX_CM
        default "20" if BFIN561_EZKIT
+       default "16" if H8606_HVSISTEMAS
        help
          This controls the frequency of the on-chip PLL. This can be between 1 and 64.
          PLL Frequency = (Crystal Frequency) * (this setting)
@@ -440,6 +355,7 @@ config SCLK_DIV
        default 4 if BFIN537_BLUETECHNIX_CM
        default 4 if BFIN561_BLUETECHNIX_CM
        default 5 if BFIN561_EZKIT
+       default 3 if H8606_HVSISTEMAS
        help
          This sets the frequency of the system clock (including SDRAM or DDR).
          This can be between 1 and 15
@@ -459,11 +375,11 @@ config MAX_VCO_HZ
        default 500000000 if BF534
        default 400000000 if BF536
        default 600000000 if BF537
-       default 533000000 if BF538
-       default 533000000 if BF539
+       default 533333333 if BF538
+       default 533333333 if BF539
        default 600000000 if BF542
-       default 533000000 if BF544
-       default 533000000 if BF549
+       default 533333333 if BF544
+       default 533333333 if BF549
        default 600000000 if BF561
 
 config MIN_VCO_HZ
@@ -472,7 +388,7 @@ config MIN_VCO_HZ
 
 config MAX_SCLK_HZ
        int
-       default 133000000
+       default 133333333
 
 config MIN_SCLK_HZ
        int
@@ -492,11 +408,13 @@ config MEM_SIZE
        default  64 if BFIN561_EZKIT
        default 128 if BFIN533_STAMP
        default  64 if PNAV10
+       default  32 if H8606_HVSISTEMAS
 
 config MEM_ADD_WIDTH
        int "SDRAM Memory Address Width"
        default  9 if BFIN533_EZKIT
        default  9 if BFIN561_EZKIT
+       default  9 if H8606_HVSISTEMAS
        default 10 if BFIN527_EZKIT
        default 10 if BFIN537_STAMP
        default 11 if BFIN533_STAMP
@@ -948,6 +866,20 @@ config BANK_3
        default 0x99B3
 endmenu
 
+config EBIU_MBSCTLVAL
+       hex "EBIU Bank Select Control Register"
+       depends on BF54x
+       default 0
+
+config EBIU_MODEVAL
+       hex "Flash Memory Mode Control Register"
+       depends on BF54x
+       default 1
+
+config EBIU_FCTLVAL
+       hex "Flash Memory Bank Control Register"
+       depends on BF54x
+       default 6
 endmenu
 
 #############################################################################
@@ -1064,174 +996,7 @@ source "fs/Kconfig"
 
 source "kernel/Kconfig.instrumentation"
 
-menu "Kernel hacking"
-
-source "lib/Kconfig.debug"
-
-config DEBUG_HWERR
-       bool "Hardware error interrupt debugging"
-       depends on DEBUG_KERNEL
-       help
-         When enabled, the hardware error interrupt is never disabled, and
-         will happen immediately when an error condition occurs.  This comes
-         at a slight cost in code size, but is necessary if you are getting
-         hardware error interrupts and need to know where they are coming
-         from.
-
-config DEBUG_ICACHE_CHECK
-       bool "Check Instruction cache coherency"
-       depends on DEBUG_KERNEL
-       depends on DEBUG_HWERR
-       help
-         Say Y here if you are getting weird unexplained errors. This will
-         ensure that icache is what SDRAM says it should be by doing a
-         byte wise comparison between SDRAM and instruction cache. This
-         also relocates the irq_panic() function to L1 memory, (which is
-         un-cached).
-
-config DEBUG_HUNT_FOR_ZERO
-       bool "Catch NULL pointer reads/writes"
-       default y
-       help
-         Say Y here to catch reads/writes to anywhere in the memory range
-         from 0x0000 - 0x0FFF (the first 4k) of memory.  This is useful in
-         catching common programming errors such as NULL pointer dereferences.
-
-         Misbehaving applications will be killed (generate a SEGV) while the
-         kernel will trigger a panic.
-
-         Enabling this option will take up an extra entry in CPLB table.
-         Otherwise, there is no extra overhead.
-
-config DEBUG_BFIN_HWTRACE_ON
-       bool "Turn on Blackfin's Hardware Trace"
-       default y
-       help
-         All Blackfins include a Trace Unit which stores a history of the last
-         16 changes in program flow taken by the program sequencer. The history
-         allows the user to recreate the program sequencer’s recent path. This
-         can be handy when an application dies - we print out the execution
-         path of how it got to the offending instruction.
-
-         By turning this off, you may save a tiny amount of power.
-
-choice
-       prompt "Omit loop Tracing"
-       default DEBUG_BFIN_HWTRACE_COMPRESSION_OFF
-       depends on DEBUG_BFIN_HWTRACE_ON
-       help
-         The trace buffer can be configured to omit recording of changes in
-         program flow that match either the last entry or one of the last
-         two entries. Omitting one of these entries from the record prevents
-         the trace buffer from overflowing because of any sort of loop (for, do
-         while, etc) in the program.
-
-         Because zero-overhead Hardware loops are not recorded in the trace buffer,
-         this feature can be used to prevent trace overflow from loops that
-         are nested four deep.
-
-config DEBUG_BFIN_HWTRACE_COMPRESSION_OFF
-       bool "Trace all Loops"
-       help
-         The trace buffer records all changes of flow 
-
-config DEBUG_BFIN_HWTRACE_COMPRESSION_ONE
-       bool "Compress single-level loops"
-       help
-         The trace buffer does not record single loops - helpful if trace 
-         is spinning on a while or do loop.
-
-config DEBUG_BFIN_HWTRACE_COMPRESSION_TWO
-       bool "Compress two-level loops"
-       help
-         The trace buffer does not record loops two levels deep. Helpful if
-         the trace is spinning in a nested loop
-
-endchoice
-
-config DEBUG_BFIN_HWTRACE_COMPRESSION
-       int
-       depends on DEBUG_BFIN_HWTRACE_ON
-       default 0 if DEBUG_BFIN_HWTRACE_COMPRESSION_OFF
-       default 1 if DEBUG_BFIN_HWTRACE_COMPRESSION_ONE
-       default 2 if DEBUG_BFIN_HWTRACE_COMPRESSION_TWO
-
-
-config DEBUG_BFIN_HWTRACE_EXPAND
-       bool "Expand Trace Buffer greater than 16 entries"
-       depends on DEBUG_BFIN_HWTRACE_ON
-       default n
-       help
-         By selecting this option, every time the 16 hardware entries in
-         the Blackfin's HW Trace buffer are full, the kernel will move them
-         into a software buffer, for dumping when there is an issue. This 
-         has a great impact on performance, (an interrupt every 16 change of 
-         flows) and should normally be turned off, except in those nasty
-         debugging sessions
-
-config DEBUG_BFIN_HWTRACE_EXPAND_LEN
-       int "Size of Trace buffer (in power of 2k)"
-       range 0 4
-       depends on DEBUG_BFIN_HWTRACE_EXPAND
-       default 1
-       help
-         This sets the size of the software buffer that the trace information
-         is kept in.
-         0 for (2^0)  1k, or 256 entries,
-         1 for (2^1)  2k, or 512 entries,
-         2 for (2^2)  4k, or 1024 entries,
-         3 for (2^3)  8k, or 2048 entries,
-         4 for (2^4) 16k, or 4096 entries
-
-config DEBUG_BFIN_NO_KERN_HWTRACE
-       bool "Trace user apps (turn off hwtrace in kernel)"
-       depends on DEBUG_BFIN_HWTRACE_ON
-       default n
-       help
-         Some pieces of the kernel contain a lot of flow changes which can
-         quickly fill up the hardware trace buffer.  When debugging crashes,
-         the hardware trace may indicate that the problem lies in kernel
-         space when in reality an application is buggy.
-
-         Say Y here to disable hardware tracing in some known "jumpy" pieces
-         of code so that the trace buffer will extend further back.
-
-config EARLY_PRINTK
-       bool "Early printk" 
-       default n
-       help
-         This option enables special console drivers which allow the kernel
-         to print messages very early in the bootup process.
-
-         This is useful for kernel debugging when your machine crashes very
-         early before the console code is initialized. After enabling this
-         feature, you must add "earlyprintk=serial,uart0,57600" to the
-         command line (bootargs). It is safe to say Y here in all cases, as
-         all of this lives in the init section and is thrown away after the
-         kernel boots completely.
-
-config DUAL_CORE_TEST_MODULE
-       tristate "Dual Core Test Module"
-       depends on (BF561)
-       default n
-       help
-         Say Y here to build-in dual core test module for dual core test.
-
-config CPLB_INFO
-       bool "Display the CPLB information"
-       help
-         Display the CPLB information.
-
-config ACCESS_CHECK
-       bool "Check the user pointer address"
-       default y
-       help
-         Usually the pointer transfer from user space is checked to see if its
-         address is in the kernel space.
-
-         Say N here to disable that check to improve the performance.
-
-endmenu
+source "arch/blackfin/Kconfig.debug"
 
 source "security/Kconfig"
 
diff --git a/arch/blackfin/Kconfig.debug b/arch/blackfin/Kconfig.debug
new file mode 100644 (file)
index 0000000..59b87a4
--- /dev/null
@@ -0,0 +1,178 @@
+menu "Kernel hacking"
+
+source "lib/Kconfig.debug"
+
+config DEBUG_MMRS
+       bool "Generate Blackfin MMR tree"
+       select DEBUG_FS
+       help
+         Create a tree of Blackfin MMRs via the debugfs tree.  If
+         you enable this, you will find all MMRs laid out in the
+         /sys/kernel/debug/blackfin/ directory where you can read/write
+         MMRs directly from userspace.  This is obviously just a debug
+         feature.
+
+config DEBUG_HWERR
+       bool "Hardware error interrupt debugging"
+       depends on DEBUG_KERNEL
+       help
+         When enabled, the hardware error interrupt is never disabled, and
+         will happen immediately when an error condition occurs.  This comes
+         at a slight cost in code size, but is necessary if you are getting
+         hardware error interrupts and need to know where they are coming
+         from.
+
+config DEBUG_ICACHE_CHECK
+       bool "Check Instruction cache coherency"
+       depends on DEBUG_KERNEL
+       depends on DEBUG_HWERR
+       help
+         Say Y here if you are getting weird unexplained errors. This will
+         ensure that icache is what SDRAM says it should be by doing a
+         byte wise comparison between SDRAM and instruction cache. This
+         also relocates the irq_panic() function to L1 memory, (which is
+         un-cached).
+
+config DEBUG_HUNT_FOR_ZERO
+       bool "Catch NULL pointer reads/writes"
+       default y
+       help
+         Say Y here to catch reads/writes to anywhere in the memory range
+         from 0x0000 - 0x0FFF (the first 4k) of memory.  This is useful in
+         catching common programming errors such as NULL pointer dereferences.
+
+         Misbehaving applications will be killed (generate a SEGV) while the
+         kernel will trigger a panic.
+
+         Enabling this option will take up an extra entry in CPLB table.
+         Otherwise, there is no extra overhead.
+
+config DEBUG_BFIN_HWTRACE_ON
+       bool "Turn on Blackfin's Hardware Trace"
+       default y
+       help
+         All Blackfins include a Trace Unit which stores a history of the last
+         16 changes in program flow taken by the program sequencer. The history
+         allows the user to recreate the program sequencer’s recent path. This
+         can be handy when an application dies - we print out the execution
+         path of how it got to the offending instruction.
+
+         By turning this off, you may save a tiny amount of power.
+
+choice
+       prompt "Omit loop Tracing"
+       default DEBUG_BFIN_HWTRACE_COMPRESSION_OFF
+       depends on DEBUG_BFIN_HWTRACE_ON
+       help
+         The trace buffer can be configured to omit recording of changes in
+         program flow that match either the last entry or one of the last
+         two entries. Omitting one of these entries from the record prevents
+         the trace buffer from overflowing because of any sort of loop (for, do
+         while, etc) in the program.
+
+         Because zero-overhead Hardware loops are not recorded in the trace buffer,
+         this feature can be used to prevent trace overflow from loops that
+         are nested four deep.
+
+config DEBUG_BFIN_HWTRACE_COMPRESSION_OFF
+       bool "Trace all Loops"
+       help
+         The trace buffer records all changes of flow 
+
+config DEBUG_BFIN_HWTRACE_COMPRESSION_ONE
+       bool "Compress single-level loops"
+       help
+         The trace buffer does not record single loops - helpful if trace 
+         is spinning on a while or do loop.
+
+config DEBUG_BFIN_HWTRACE_COMPRESSION_TWO
+       bool "Compress two-level loops"
+       help
+         The trace buffer does not record loops two levels deep. Helpful if
+         the trace is spinning in a nested loop
+
+endchoice
+
+config DEBUG_BFIN_HWTRACE_COMPRESSION
+       int
+       depends on DEBUG_BFIN_HWTRACE_ON
+       default 0 if DEBUG_BFIN_HWTRACE_COMPRESSION_OFF
+       default 1 if DEBUG_BFIN_HWTRACE_COMPRESSION_ONE
+       default 2 if DEBUG_BFIN_HWTRACE_COMPRESSION_TWO
+
+
+config DEBUG_BFIN_HWTRACE_EXPAND
+       bool "Expand Trace Buffer greater than 16 entries"
+       depends on DEBUG_BFIN_HWTRACE_ON
+       default n
+       help
+         By selecting this option, every time the 16 hardware entries in
+         the Blackfin's HW Trace buffer are full, the kernel will move them
+         into a software buffer, for dumping when there is an issue. This 
+         has a great impact on performance, (an interrupt every 16 change of 
+         flows) and should normally be turned off, except in those nasty
+         debugging sessions
+
+config DEBUG_BFIN_HWTRACE_EXPAND_LEN
+       int "Size of Trace buffer (in power of 2k)"
+       range 0 4
+       depends on DEBUG_BFIN_HWTRACE_EXPAND
+       default 1
+       help
+         This sets the size of the software buffer that the trace information
+         is kept in.
+         0 for (2^0)  1k, or 256 entries,
+         1 for (2^1)  2k, or 512 entries,
+         2 for (2^2)  4k, or 1024 entries,
+         3 for (2^3)  8k, or 2048 entries,
+         4 for (2^4) 16k, or 4096 entries
+
+config DEBUG_BFIN_NO_KERN_HWTRACE
+       bool "Trace user apps (turn off hwtrace in kernel)"
+       depends on DEBUG_BFIN_HWTRACE_ON
+       default n
+       help
+         Some pieces of the kernel contain a lot of flow changes which can
+         quickly fill up the hardware trace buffer.  When debugging crashes,
+         the hardware trace may indicate that the problem lies in kernel
+         space when in reality an application is buggy.
+
+         Say Y here to disable hardware tracing in some known "jumpy" pieces
+         of code so that the trace buffer will extend further back.
+
+config EARLY_PRINTK
+       bool "Early printk" 
+       default n
+       help
+         This option enables special console drivers which allow the kernel
+         to print messages very early in the bootup process.
+
+         This is useful for kernel debugging when your machine crashes very
+         early before the console code is initialized. After enabling this
+         feature, you must add "earlyprintk=serial,uart0,57600" to the
+         command line (bootargs). It is safe to say Y here in all cases, as
+         all of this lives in the init section and is thrown away after the
+         kernel boots completely.
+
+config DUAL_CORE_TEST_MODULE
+       tristate "Dual Core Test Module"
+       depends on (BF561)
+       default n
+       help
+         Say Y here to build-in dual core test module for dual core test.
+
+config CPLB_INFO
+       bool "Display the CPLB information"
+       help
+         Display the CPLB information.
+
+config ACCESS_CHECK
+       bool "Check the user pointer address"
+       default y
+       help
+         Usually the pointer transfer from user space is checked to see if its
+         address is in the kernel space.
+
+         Say N here to disable that check to improve the performance.
+
+endmenu
index f7cac7c51e7e5303848ea847370f6f93e5c7354a..c47e000f83240ac9c0c1dd085a816b363e861fcc 100644 (file)
@@ -31,6 +31,7 @@ machine-$(CONFIG_BF536) := bf537
 machine-$(CONFIG_BF537) := bf537
 machine-$(CONFIG_BF542) := bf548
 machine-$(CONFIG_BF544) := bf548
+machine-$(CONFIG_BF547) := bf548
 machine-$(CONFIG_BF548) := bf548
 machine-$(CONFIG_BF549) := bf548
 machine-$(CONFIG_BF561) := bf561
@@ -48,6 +49,7 @@ cpu-$(CONFIG_BF536) := bf536
 cpu-$(CONFIG_BF537) := bf537
 cpu-$(CONFIG_BF542) := bf542
 cpu-$(CONFIG_BF544) := bf544
+cpu-$(CONFIG_BF547) := bf547
 cpu-$(CONFIG_BF548) := bf548
 cpu-$(CONFIG_BF549) := bf549
 cpu-$(CONFIG_BF561) := bf561
index df974e785ee24f3eb226ed800a52eb41ed9e90e8..fa6eb4e00fae4a3ca9efd982b7412cb6b96ed1c9 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.22.9
+# Linux kernel version: 2.6.22.12
 #
 # CONFIG_MMU is not set
 # CONFIG_FPU is not set
@@ -8,7 +8,6 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
 CONFIG_BLACKFIN=y
 CONFIG_ZONE_DMA=y
-CONFIG_BFIN=y
 CONFIG_SEMAPHORE_SLEEPERS=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_GENERIC_HWEIGHT=y
@@ -18,7 +17,6 @@ CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_GENERIC_GPIO=y
 CONFIG_FORCE_MAX_ZONEORDER=14
 CONFIG_GENERIC_CALIBRATE_DELAY=y
-CONFIG_IRQCHIP_DEMUX_GPIO=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
@@ -127,6 +125,7 @@ CONFIG_BF527=y
 # CONFIG_BF537 is not set
 # CONFIG_BF542 is not set
 # CONFIG_BF544 is not set
+# CONFIG_BF547 is not set
 # CONFIG_BF548 is not set
 # CONFIG_BF549 is not set
 # CONFIG_BF561 is not set
@@ -140,19 +139,8 @@ CONFIG_BF_REV_0_0=y
 # CONFIG_BF_REV_NONE is not set
 CONFIG_BF52x=y
 CONFIG_BFIN_SINGLE_CORE=y
-CONFIG_BFIN527_EZKIT=y
-# CONFIG_BFIN533_EZKIT is not set
-# CONFIG_BFIN533_STAMP is not set
-# CONFIG_BFIN537_STAMP is not set
-# CONFIG_BFIN533_BLUETECHNIX_CM is not set
-# CONFIG_BFIN537_BLUETECHNIX_CM is not set
-# CONFIG_BFIN548_EZKIT is not set
-# CONFIG_BFIN561_BLUETECHNIX_CM is not set
-# CONFIG_BFIN561_EZKIT is not set
-# CONFIG_BFIN561_TEPLA is not set
-# CONFIG_PNAV10 is not set
-# CONFIG_GENERIC_BOARD is not set
 CONFIG_MEM_MT48LC32M16A2TG_75=y
+CONFIG_BFIN527_EZKIT=y
 
 #
 # BF527 Specific Configuration
@@ -301,6 +289,7 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_LARGE_ALLOCS=y
+# CONFIG_BFIN_GPTIMERS is not set
 CONFIG_BFIN_DMA_5XX=y
 # CONFIG_DMA_UNCACHED_2M is not set
 CONFIG_DMA_UNCACHED_1M=y
@@ -322,7 +311,7 @@ CONFIG_L1_MAX_PIECE=16
 #
 
 #
-# EBIU_AMBCTL Global Control
+# EBIU_AMGCTL Global Control
 #
 CONFIG_C_AMCKEN=y
 CONFIG_C_CDPRIO=y
@@ -548,6 +537,7 @@ CONFIG_BFIN_NAND_CLE=2
 CONFIG_BFIN_NAND_ALE=1
 CONFIG_BFIN_NAND_READY=3
 CONFIG_MTD_NAND_IDS=m
+# CONFIG_MTD_NAND_BF5XX is not set
 # CONFIG_MTD_NAND_DISKONCHIP is not set
 # CONFIG_MTD_NAND_NANDSIM is not set
 # CONFIG_MTD_NAND_PLATFORM is not set
@@ -637,6 +627,7 @@ CONFIG_BFIN_MAC_RMII=y
 # CONFIG_DM9000 is not set
 CONFIG_NETDEV_1000=y
 CONFIG_NETDEV_10000=y
+# CONFIG_AX88180 is not set
 
 #
 # Wireless LAN
@@ -708,7 +699,7 @@ CONFIG_INPUT_MISC=y
 # CONFIG_SPI_ADC_BF533 is not set
 # CONFIG_BF5xx_PFLAGS is not set
 # CONFIG_BF5xx_PPIFCD is not set
-# CONFIG_BF5xx_TIMERS is not set
+# CONFIG_BFIN_SIMPLE_TIMER is not set
 # CONFIG_BF5xx_PPI is not set
 # CONFIG_BFIN_SPORT is not set
 # CONFIG_BFIN_TIMER_LATENCY is not set
index 57f58d5cd47a14e5a088a541d86e9a680c678956..4fdb49362ba30dcd9d9f2220a42242fce46bc63a 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.22.6
+# Linux kernel version: 2.6.22.12
 #
 # CONFIG_MMU is not set
 # CONFIG_FPU is not set
@@ -8,7 +8,6 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
 CONFIG_BLACKFIN=y
 CONFIG_ZONE_DMA=y
-CONFIG_BFIN=y
 CONFIG_SEMAPHORE_SLEEPERS=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_GENERIC_HWEIGHT=y
@@ -18,7 +17,6 @@ CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_GENERIC_GPIO=y
 CONFIG_FORCE_MAX_ZONEORDER=14
 CONFIG_GENERIC_CALIBRATE_DELAY=y
-CONFIG_IRQCHIP_DEMUX_GPIO=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
@@ -64,7 +62,6 @@ CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
 CONFIG_EPOLL=y
 CONFIG_SIGNALFD=y
-CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3
@@ -117,6 +114,9 @@ CONFIG_PREEMPT_VOLUNTARY=y
 #
 # Processor and Board Settings
 #
+# CONFIG_BF522 is not set
+# CONFIG_BF525 is not set
+# CONFIG_BF527 is not set
 # CONFIG_BF531 is not set
 # CONFIG_BF532 is not set
 CONFIG_BF533=y
@@ -125,10 +125,12 @@ CONFIG_BF533=y
 # CONFIG_BF537 is not set
 # CONFIG_BF542 is not set
 # CONFIG_BF544 is not set
+# CONFIG_BF547 is not set
 # CONFIG_BF548 is not set
 # CONFIG_BF549 is not set
 # CONFIG_BF561 is not set
 # CONFIG_BF_REV_0_0 is not set
+# CONFIG_BF_REV_0_1 is not set
 # CONFIG_BF_REV_0_2 is not set
 CONFIG_BF_REV_0_3=y
 # CONFIG_BF_REV_0_4 is not set
@@ -137,18 +139,12 @@ CONFIG_BF_REV_0_3=y
 # CONFIG_BF_REV_NONE is not set
 CONFIG_BF53x=y
 CONFIG_BFIN_SINGLE_CORE=y
+CONFIG_MEM_MT48LC16M16A2TG_75=y
 CONFIG_BFIN533_EZKIT=y
 # CONFIG_BFIN533_STAMP is not set
-# CONFIG_BFIN537_STAMP is not set
 # CONFIG_BFIN533_BLUETECHNIX_CM is not set
-# CONFIG_BFIN537_BLUETECHNIX_CM is not set
-# CONFIG_BFIN548_EZKIT is not set
-# CONFIG_BFIN561_BLUETECHNIX_CM is not set
-# CONFIG_BFIN561_EZKIT is not set
-# CONFIG_BFIN561_TEPLA is not set
-# CONFIG_PNAV10 is not set
-# CONFIG_GENERIC_BOARD is not set
-CONFIG_MEM_MT48LC16M16A2TG_75=y
+# CONFIG_H8606_HVSISTEMAS is not set
+# CONFIG_GENERIC_BF533_BOARD is not set
 
 #
 # BF533/2/1 Specific Configuration
@@ -255,6 +251,7 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_LARGE_ALLOCS=y
+# CONFIG_BFIN_GPTIMERS is not set
 CONFIG_BFIN_DMA_5XX=y
 # CONFIG_DMA_UNCACHED_2M is not set
 CONFIG_DMA_UNCACHED_1M=y
@@ -276,7 +273,7 @@ CONFIG_L1_MAX_PIECE=16
 #
 
 #
-# EBIU_AMBCTL Global Control
+# EBIU_AMGCTL Global Control
 #
 CONFIG_C_AMCKEN=y
 CONFIG_C_CDPRIO=y
@@ -526,14 +523,6 @@ CONFIG_MTD_COMPLEX_MAPPINGS=y
 CONFIG_MTD_BF5xx=m
 CONFIG_BFIN_FLASH_SIZE=0x400000
 CONFIG_EBIU_FLASH_BASE=0x20000000
-
-#
-# FLASH_EBIU_AMBCTL Control
-#
-CONFIG_BFIN_FLASH_BANK_0=0x7BB0
-CONFIG_BFIN_FLASH_BANK_1=0x7BB0
-CONFIG_BFIN_FLASH_BANK_2=0x7BB0
-CONFIG_BFIN_FLASH_BANK_3=0x7BB0
 # CONFIG_MTD_UCLINUX is not set
 # CONFIG_MTD_PLATRAM is not set
 
@@ -622,6 +611,7 @@ CONFIG_SMC91X=y
 # CONFIG_DM9000 is not set
 CONFIG_NETDEV_1000=y
 CONFIG_NETDEV_10000=y
+# CONFIG_AX88180 is not set
 
 #
 # Wireless LAN
@@ -683,9 +673,9 @@ CONFIG_INPUT_EVDEV=m
 #
 # CONFIG_AD9960 is not set
 # CONFIG_SPI_ADC_BF533 is not set
-# CONFIG_BFIN_PFLAGS is not set
+# CONFIG_BF5xx_PFLAGS is not set
 # CONFIG_BF5xx_PPIFCD is not set
-# CONFIG_BF5xx_TIMERS is not set
+# CONFIG_BFIN_SIMPLE_TIMER is not set
 # CONFIG_BF5xx_PPI is not set
 CONFIG_BFIN_SPORT=y
 # CONFIG_BFIN_TIMER_LATENCY is not set
@@ -708,6 +698,7 @@ CONFIG_SERIAL_BFIN_DMA=y
 # CONFIG_SERIAL_BFIN_PIO is not set
 CONFIG_SERIAL_BFIN_UART0=y
 # CONFIG_BFIN_UART0_CTSRTS is not set
+# CONFIG_SERIAL_BFIN_UART1 is not set
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 # CONFIG_SERIAL_BFIN_SPORT is not set
index 306302baff06c4fba06c1e2cd91643482dec6cde..b04e8e533e9afbea51ed34d9f930cc0727f07c2d 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.22.6
+# Linux kernel version: 2.6.22.12
 #
 # CONFIG_MMU is not set
 # CONFIG_FPU is not set
@@ -8,7 +8,6 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
 CONFIG_BLACKFIN=y
 CONFIG_ZONE_DMA=y
-CONFIG_BFIN=y
 CONFIG_SEMAPHORE_SLEEPERS=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_GENERIC_HWEIGHT=y
@@ -18,7 +17,6 @@ CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_GENERIC_GPIO=y
 CONFIG_FORCE_MAX_ZONEORDER=14
 CONFIG_GENERIC_CALIBRATE_DELAY=y
-CONFIG_IRQCHIP_DEMUX_GPIO=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
@@ -64,7 +62,6 @@ CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
 CONFIG_EPOLL=y
 CONFIG_SIGNALFD=y
-CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3
@@ -117,6 +114,9 @@ CONFIG_PREEMPT_VOLUNTARY=y
 #
 # Processor and Board Settings
 #
+# CONFIG_BF522 is not set
+# CONFIG_BF525 is not set
+# CONFIG_BF527 is not set
 # CONFIG_BF531 is not set
 # CONFIG_BF532 is not set
 CONFIG_BF533=y
@@ -125,10 +125,12 @@ CONFIG_BF533=y
 # CONFIG_BF537 is not set
 # CONFIG_BF542 is not set
 # CONFIG_BF544 is not set
+# CONFIG_BF547 is not set
 # CONFIG_BF548 is not set
 # CONFIG_BF549 is not set
 # CONFIG_BF561 is not set
 # CONFIG_BF_REV_0_0 is not set
+# CONFIG_BF_REV_0_1 is not set
 # CONFIG_BF_REV_0_2 is not set
 CONFIG_BF_REV_0_3=y
 # CONFIG_BF_REV_0_4 is not set
@@ -137,19 +139,13 @@ CONFIG_BF_REV_0_3=y
 # CONFIG_BF_REV_NONE is not set
 CONFIG_BF53x=y
 CONFIG_BFIN_SINGLE_CORE=y
+CONFIG_MEM_MT48LC64M4A2FB_7E=y
+CONFIG_BFIN_SHARED_FLASH_ENET=y
 # CONFIG_BFIN533_EZKIT is not set
 CONFIG_BFIN533_STAMP=y
-# CONFIG_BFIN537_STAMP is not set
 # CONFIG_BFIN533_BLUETECHNIX_CM is not set
-# CONFIG_BFIN537_BLUETECHNIX_CM is not set
-# CONFIG_BFIN548_EZKIT is not set
-# CONFIG_BFIN561_BLUETECHNIX_CM is not set
-# CONFIG_BFIN561_EZKIT is not set
-# CONFIG_BFIN561_TEPLA is not set
-# CONFIG_PNAV10 is not set
-# CONFIG_GENERIC_BOARD is not set
-CONFIG_MEM_MT48LC64M4A2FB_7E=y
-CONFIG_BFIN_SHARED_FLASH_ENET=y
+# CONFIG_H8606_HVSISTEMAS is not set
+# CONFIG_GENERIC_BF533_BOARD is not set
 
 #
 # BF533/2/1 Specific Configuration
@@ -267,6 +263,7 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_LARGE_ALLOCS=y
+# CONFIG_BFIN_GPTIMERS is not set
 CONFIG_BFIN_DMA_5XX=y
 # CONFIG_DMA_UNCACHED_2M is not set
 CONFIG_DMA_UNCACHED_1M=y
@@ -288,7 +285,7 @@ CONFIG_L1_MAX_PIECE=16
 #
 
 #
-# EBIU_AMBCTL Global Control
+# EBIU_AMGCTL Global Control
 #
 CONFIG_C_AMCKEN=y
 CONFIG_C_CDPRIO=y
@@ -634,6 +631,7 @@ CONFIG_SMC91X=y
 # CONFIG_DM9000 is not set
 CONFIG_NETDEV_1000=y
 CONFIG_NETDEV_10000=y
+# CONFIG_AX88180 is not set
 
 #
 # Wireless LAN
@@ -704,9 +702,9 @@ CONFIG_BFIN_TWIKEYPAD_IRQ_PFX=39
 #
 # CONFIG_AD9960 is not set
 # CONFIG_SPI_ADC_BF533 is not set
-# CONFIG_BFIN_PFLAGS is not set
+# CONFIG_BF5xx_PFLAGS is not set
 # CONFIG_BF5xx_PPIFCD is not set
-# CONFIG_BF5xx_TIMERS is not set
+# CONFIG_BFIN_SIMPLE_TIMER is not set
 # CONFIG_BF5xx_PPI is not set
 CONFIG_BFIN_SPORT=y
 # CONFIG_BFIN_TIMER_LATENCY is not set
@@ -732,6 +730,7 @@ CONFIG_SERIAL_BFIN_DMA=y
 # CONFIG_SERIAL_BFIN_PIO is not set
 CONFIG_SERIAL_BFIN_UART0=y
 # CONFIG_BFIN_UART0_CTSRTS is not set
+# CONFIG_SERIAL_BFIN_UART1 is not set
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 # CONFIG_SERIAL_BFIN_SPORT is not set
@@ -925,6 +924,7 @@ CONFIG_NTSC=y
 # CONFIG_PAL_YCBCR is not set
 CONFIG_ADV7393_1XMEM=y
 # CONFIG_ADV7393_2XMEM is not set
+# CONFIG_FB_BFIN_T350MCQB is not set
 # CONFIG_FB_S1D13XXX is not set
 # CONFIG_FB_VIRTUAL is not set
 # CONFIG_LOGO is not set
@@ -978,11 +978,6 @@ CONFIG_SND_BFIN_AD73311_SE=4
 #
 # CONFIG_SND_SOC is not set
 
-#
-# SoC Audio for the ADI Blackfin
-#
-# CONFIG_SND_BF5XX_HAVE_COLD_RESET is not set
-
 #
 # Open Sound System
 #
index 828b604438eb153ebb861c8849823ee0bb698681..f812b66318b912642b8ee65e8bdccba97ef09628 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.22.6
+# Linux kernel version: 2.6.22.12
 #
 # CONFIG_MMU is not set
 # CONFIG_FPU is not set
@@ -8,7 +8,6 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
 CONFIG_BLACKFIN=y
 CONFIG_ZONE_DMA=y
-CONFIG_BFIN=y
 CONFIG_SEMAPHORE_SLEEPERS=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_GENERIC_HWEIGHT=y
@@ -18,7 +17,6 @@ CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_GENERIC_GPIO=y
 CONFIG_FORCE_MAX_ZONEORDER=14
 CONFIG_GENERIC_CALIBRATE_DELAY=y
-CONFIG_IRQCHIP_DEMUX_GPIO=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
@@ -64,7 +62,6 @@ CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
 CONFIG_EPOLL=y
 CONFIG_SIGNALFD=y
-CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3
@@ -117,6 +114,9 @@ CONFIG_PREEMPT_VOLUNTARY=y
 #
 # Processor and Board Settings
 #
+# CONFIG_BF522 is not set
+# CONFIG_BF525 is not set
+# CONFIG_BF527 is not set
 # CONFIG_BF531 is not set
 # CONFIG_BF532 is not set
 # CONFIG_BF533 is not set
@@ -125,10 +125,12 @@ CONFIG_PREEMPT_VOLUNTARY=y
 CONFIG_BF537=y
 # CONFIG_BF542 is not set
 # CONFIG_BF544 is not set
+# CONFIG_BF547 is not set
 # CONFIG_BF548 is not set
 # CONFIG_BF549 is not set
 # CONFIG_BF561 is not set
 # CONFIG_BF_REV_0_0 is not set
+# CONFIG_BF_REV_0_1 is not set
 CONFIG_BF_REV_0_2=y
 # CONFIG_BF_REV_0_3 is not set
 # CONFIG_BF_REV_0_4 is not set
@@ -137,33 +139,8 @@ CONFIG_BF_REV_0_2=y
 # CONFIG_BF_REV_NONE is not set
 CONFIG_BF53x=y
 CONFIG_BFIN_SINGLE_CORE=y
-# CONFIG_BFIN533_EZKIT is not set
-# CONFIG_BFIN533_STAMP is not set
-CONFIG_BFIN537_STAMP=y
-# CONFIG_BFIN533_BLUETECHNIX_CM is not set
-# CONFIG_BFIN537_BLUETECHNIX_CM is not set
-# CONFIG_BFIN548_EZKIT is not set
-# CONFIG_BFIN561_BLUETECHNIX_CM is not set
-# CONFIG_BFIN561_EZKIT is not set
-# CONFIG_BFIN561_TEPLA is not set
-# CONFIG_PNAV10 is not set
-# CONFIG_GENERIC_BOARD is not set
 CONFIG_MEM_MT48LC32M8A2_75=y
 CONFIG_IRQ_PLL_WAKEUP=7
-
-#
-# BF537 Specific Configuration
-#
-
-#
-# Interrupt Priority Assignment
-#
-
-#
-# Priority
-#
-CONFIG_IRQ_DMA_ERROR=7
-CONFIG_IRQ_ERROR=7
 CONFIG_IRQ_RTC=8
 CONFIG_IRQ_PPI=8
 CONFIG_IRQ_SPORT0_RX=9
@@ -176,8 +153,6 @@ CONFIG_IRQ_UART0_RX=10
 CONFIG_IRQ_UART0_TX=10
 CONFIG_IRQ_UART1_RX=10
 CONFIG_IRQ_UART1_TX=10
-CONFIG_IRQ_CAN_RX=11
-CONFIG_IRQ_CAN_TX=11
 CONFIG_IRQ_MAC_RX=11
 CONFIG_IRQ_MAC_TX=11
 CONFIG_IRQ_TMR0=12
@@ -188,11 +163,31 @@ CONFIG_IRQ_TMR4=12
 CONFIG_IRQ_TMR5=12
 CONFIG_IRQ_TMR6=12
 CONFIG_IRQ_TMR7=12
-CONFIG_IRQ_PROG_INTA=12
 CONFIG_IRQ_PORTG_INTB=12
 CONFIG_IRQ_MEM_DMA0=13
 CONFIG_IRQ_MEM_DMA1=13
 CONFIG_IRQ_WATCH=13
+CONFIG_BFIN537_STAMP=y
+# CONFIG_BFIN537_BLUETECHNIX_CM is not set
+# CONFIG_PNAV10 is not set
+# CONFIG_GENERIC_BF537_BOARD is not set
+
+#
+# BF537 Specific Configuration
+#
+
+#
+# Interrupt Priority Assignment
+#
+
+#
+# Priority
+#
+CONFIG_IRQ_DMA_ERROR=7
+CONFIG_IRQ_ERROR=7
+CONFIG_IRQ_CAN_RX=11
+CONFIG_IRQ_CAN_TX=11
+CONFIG_IRQ_PROG_INTA=12
 
 #
 # Board customizations
@@ -263,6 +258,7 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_LARGE_ALLOCS=y
+# CONFIG_BFIN_GPTIMERS is not set
 CONFIG_BFIN_DMA_5XX=y
 # CONFIG_DMA_UNCACHED_2M is not set
 CONFIG_DMA_UNCACHED_1M=y
@@ -284,7 +280,7 @@ CONFIG_L1_MAX_PIECE=16
 #
 
 #
-# EBIU_AMBCTL Global Control
+# EBIU_AMGCTL Global Control
 #
 CONFIG_C_AMCKEN=y
 CONFIG_C_CDPRIO=y
@@ -534,14 +530,6 @@ CONFIG_MTD_COMPLEX_MAPPINGS=y
 CONFIG_MTD_BF5xx=m
 CONFIG_BFIN_FLASH_SIZE=0x400000
 CONFIG_EBIU_FLASH_BASE=0x20000000
-
-#
-# FLASH_EBIU_AMBCTL Control
-#
-CONFIG_BFIN_FLASH_BANK_0=0x7BB0
-CONFIG_BFIN_FLASH_BANK_1=0x7BB0
-CONFIG_BFIN_FLASH_BANK_2=0x7BB0
-CONFIG_BFIN_FLASH_BANK_3=0x7BB0
 # CONFIG_MTD_UCLINUX is not set
 # CONFIG_MTD_PLATRAM is not set
 
@@ -660,6 +648,7 @@ CONFIG_BFIN_RX_DESC_NUM=20
 # CONFIG_DM9000 is not set
 CONFIG_NETDEV_1000=y
 CONFIG_NETDEV_10000=y
+# CONFIG_AX88180 is not set
 
 #
 # Wireless LAN
@@ -730,9 +719,9 @@ CONFIG_BFIN_TWIKEYPAD_IRQ_PFX=72
 #
 # CONFIG_AD9960 is not set
 # CONFIG_SPI_ADC_BF533 is not set
-# CONFIG_BFIN_PFLAGS is not set
+# CONFIG_BF5xx_PFLAGS is not set
 # CONFIG_BF5xx_PPIFCD is not set
-# CONFIG_BF5xx_TIMERS is not set
+# CONFIG_BFIN_SIMPLE_TIMER is not set
 # CONFIG_BF5xx_PPI is not set
 CONFIG_BFIN_SPORT=y
 # CONFIG_BFIN_TIMER_LATENCY is not set
@@ -967,6 +956,7 @@ CONFIG_FB_BF537_LQ035=m
 CONFIG_LQ035_SLAVE_ADDR=0x58
 # CONFIG_FB_BFIN_LANDSCAPE is not set
 # CONFIG_FB_BFIN_BGR is not set
+# CONFIG_FB_BFIN_T350MCQB is not set
 # CONFIG_FB_S1D13XXX is not set
 # CONFIG_FB_VIRTUAL is not set
 # CONFIG_LOGO is not set
@@ -1020,11 +1010,6 @@ CONFIG_SND_BFIN_AD73311_SE=4
 #
 # CONFIG_SND_SOC is not set
 
-#
-# SoC Audio for the ADI Blackfin
-#
-# CONFIG_SND_BF5XX_HAVE_COLD_RESET is not set
-
 #
 # Open Sound System
 #
index d8569888a1c84a6abf82c5951eba18f096bc83fa..48367cc9fe35adf3e39326d9a1a832975dad1fde 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.22.6
+# Linux kernel version: 2.6.22.12
 #
 # CONFIG_MMU is not set
 # CONFIG_FPU is not set
@@ -8,7 +8,6 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
 CONFIG_BLACKFIN=y
 CONFIG_ZONE_DMA=y
-CONFIG_BFIN=y
 CONFIG_SEMAPHORE_SLEEPERS=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_GENERIC_HWEIGHT=y
@@ -18,7 +17,6 @@ CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_GENERIC_GPIO=y
 CONFIG_FORCE_MAX_ZONEORDER=14
 CONFIG_GENERIC_CALIBRATE_DELAY=y
-CONFIG_IRQCHIP_DEMUX_GPIO=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
@@ -64,7 +62,6 @@ CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
 CONFIG_EPOLL=y
 CONFIG_SIGNALFD=y
-CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3
@@ -117,6 +114,9 @@ CONFIG_PREEMPT_VOLUNTARY=y
 #
 # Processor and Board Settings
 #
+# CONFIG_BF522 is not set
+# CONFIG_BF525 is not set
+# CONFIG_BF527 is not set
 # CONFIG_BF531 is not set
 # CONFIG_BF532 is not set
 # CONFIG_BF533 is not set
@@ -125,10 +125,12 @@ CONFIG_PREEMPT_VOLUNTARY=y
 # CONFIG_BF537 is not set
 # CONFIG_BF542 is not set
 # CONFIG_BF544 is not set
+# CONFIG_BF547 is not set
 # CONFIG_BF548 is not set
 CONFIG_BF549=y
 # CONFIG_BF561 is not set
 CONFIG_BF_REV_0_0=y
+# CONFIG_BF_REV_0_1 is not set
 # CONFIG_BF_REV_0_2 is not set
 # CONFIG_BF_REV_0_3 is not set
 # CONFIG_BF_REV_0_4 is not set
@@ -137,18 +139,21 @@ CONFIG_BF_REV_0_0=y
 # CONFIG_BF_REV_NONE is not set
 CONFIG_BF54x=y
 CONFIG_BFIN_SINGLE_CORE=y
-# CONFIG_BFIN533_EZKIT is not set
-# CONFIG_BFIN533_STAMP is not set
-# CONFIG_BFIN537_STAMP is not set
-# CONFIG_BFIN533_BLUETECHNIX_CM is not set
-# CONFIG_BFIN537_BLUETECHNIX_CM is not set
-CONFIG_BFIN548_EZKIT=y
-# CONFIG_BFIN561_BLUETECHNIX_CM is not set
-# CONFIG_BFIN561_EZKIT is not set
-# CONFIG_BFIN561_TEPLA is not set
-# CONFIG_PNAV10 is not set
-# CONFIG_GENERIC_BOARD is not set
 CONFIG_IRQ_PLL_WAKEUP=7
+CONFIG_IRQ_RTC=8
+CONFIG_IRQ_SPORT0_RX=9
+CONFIG_IRQ_SPORT0_TX=9
+CONFIG_IRQ_SPORT1_RX=9
+CONFIG_IRQ_SPORT1_TX=9
+CONFIG_IRQ_UART0_RX=10
+CONFIG_IRQ_UART0_TX=10
+CONFIG_IRQ_UART1_RX=10
+CONFIG_IRQ_UART1_TX=10
+CONFIG_IRQ_CNT=8
+CONFIG_IRQ_USB_INT0=11
+CONFIG_IRQ_USB_INT1=11
+CONFIG_IRQ_USB_INT2=11
+CONFIG_IRQ_USB_DMA=11
 CONFIG_IRQ_TIMER0=11
 CONFIG_IRQ_TIMER1=11
 CONFIG_IRQ_TIMER2=11
@@ -160,15 +165,7 @@ CONFIG_IRQ_TIMER7=11
 CONFIG_IRQ_TIMER8=11
 CONFIG_IRQ_TIMER9=11
 CONFIG_IRQ_TIMER10=11
-CONFIG_IRQ_RTC=8
-CONFIG_IRQ_SPORT0_RX=9
-CONFIG_IRQ_SPORT0_TX=9
-CONFIG_IRQ_SPORT1_RX=9
-CONFIG_IRQ_SPORT1_TX=9
-CONFIG_IRQ_UART0_RX=10
-CONFIG_IRQ_UART0_TX=10
-CONFIG_IRQ_UART1_RX=10
-CONFIG_IRQ_UART1_TX=10
+CONFIG_BFIN548_EZKIT=y
 
 #
 # BF548 Specific Configuration
@@ -236,16 +233,11 @@ CONFIG_IRQ_PIXC_IN0=8
 CONFIG_IRQ_PIXC_IN1=8
 CONFIG_IRQ_PIXC_OUT=8
 CONFIG_IRQ_SDH=8
-CONFIG_IRQ_CNT=8
 CONFIG_IRQ_KEY=8
 CONFIG_IRQ_CAN1_RX=11
 CONFIG_IRQ_CAN1_TX=11
 CONFIG_IRQ_SDH_MASK0=11
 CONFIG_IRQ_SDH_MASK1=11
-CONFIG_IRQ_USB_INT0=11
-CONFIG_IRQ_USB_INT1=11
-CONFIG_IRQ_USB_INT2=11
-CONFIG_IRQ_USB_DMA=11
 CONFIG_IRQ_OTPSEC=11
 CONFIG_IRQ_PINT2=11
 CONFIG_IRQ_PINT3=11
@@ -332,9 +324,10 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_LARGE_ALLOCS=y
+# CONFIG_BFIN_GPTIMERS is not set
 CONFIG_BFIN_DMA_5XX=y
-# CONFIG_DMA_UNCACHED_2M is not set
-CONFIG_DMA_UNCACHED_1M=y
+CONFIG_DMA_UNCACHED_2M=y
+# CONFIG_DMA_UNCACHED_1M is not set
 # CONFIG_DMA_UNCACHED_NONE is not set
 
 #
@@ -353,7 +346,7 @@ CONFIG_L1_MAX_PIECE=16
 #
 
 #
-# EBIU_AMBCTL Global Control
+# EBIU_AMGCTL Global Control
 #
 CONFIG_C_AMCKEN=y
 # CONFIG_C_AMBEN is not set
@@ -369,6 +362,9 @@ CONFIG_BANK_0=0x7BB0
 CONFIG_BANK_1=0x5554
 CONFIG_BANK_2=0x7BB0
 CONFIG_BANK_3=0x99B3
+CONFIG_EBUI_MBSCTLVAL=0x0
+CONFIG_EBUI_MODEVAL=0x1
+CONFIG_EBUI_FCTLVAL=0x6
 
 #
 # Bus options (PCI, PCMCIA, EISA, MCA, ISA)
@@ -695,6 +691,7 @@ CONFIG_SMSC911X=y
 # CONFIG_DM9000 is not set
 CONFIG_NETDEV_1000=y
 CONFIG_NETDEV_10000=y
+# CONFIG_AX88180 is not set
 
 #
 # Wireless LAN
@@ -722,7 +719,7 @@ CONFIG_NETDEV_10000=y
 #
 # Input device support
 #
-CONFIG_INPUT=y
+CONFIG_INPUT=m
 # CONFIG_INPUT_FF_MEMLESS is not set
 # CONFIG_INPUT_POLLDEV is not set
 
@@ -731,18 +728,39 @@ CONFIG_INPUT=y
 #
 # CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
-# CONFIG_INPUT_EVDEV is not set
-# CONFIG_INPUT_EVBUG is not set
+CONFIG_INPUT_TSDEV=m
+CONFIG_INPUT_TSDEV_SCREEN_X=240
+CONFIG_INPUT_TSDEV_SCREEN_Y=320
+CONFIG_INPUT_EVDEV=m
+CONFIG_INPUT_EVBUG=m
 
 #
 # Input Device Drivers
 #
-# CONFIG_INPUT_KEYBOARD is not set
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ATKBD is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_GPIO is not set
+CONFIG_KEYBOARD_BFIN=m
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TABLET is not set
-# CONFIG_INPUT_TOUCHSCREEN is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+# CONFIG_TOUCHSCREEN_ADS7846 is not set
+CONFIG_TOUCHSCREEN_AD7877=m
+# CONFIG_TOUCHSCREEN_GUNZE is not set
+# CONFIG_TOUCHSCREEN_ELO is not set
+# CONFIG_TOUCHSCREEN_MTOUCH is not set
+# CONFIG_TOUCHSCREEN_MK712 is not set
+# CONFIG_TOUCHSCREEN_PENMOUNT is not set
+# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
+# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
+# CONFIG_TOUCHSCREEN_UCB1400 is not set
+# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
 CONFIG_INPUT_MISC=y
 # CONFIG_INPUT_ATI_REMOTE is not set
 # CONFIG_INPUT_ATI_REMOTE2 is not set
@@ -764,9 +782,9 @@ CONFIG_INPUT_MISC=y
 #
 # CONFIG_AD9960 is not set
 # CONFIG_SPI_ADC_BF533 is not set
-# CONFIG_BFIN_PFLAGS is not set
+# CONFIG_BF5xx_PFLAGS is not set
 # CONFIG_BF5xx_PPIFCD is not set
-# CONFIG_BF5xx_TIMERS is not set
+# CONFIG_BFIN_SIMPLE_TIMER is not set
 # CONFIG_BF5xx_PPI is not set
 # CONFIG_BFIN_SPORT is not set
 # CONFIG_BFIN_TIMER_LATENCY is not set
@@ -958,17 +976,94 @@ CONFIG_DAB=y
 #
 # CONFIG_DISPLAY_SUPPORT is not set
 # CONFIG_VGASTATE is not set
-# CONFIG_FB is not set
+CONFIG_FB=m
+CONFIG_FIRMWARE_EDID=y
+# CONFIG_FB_DDC is not set
+CONFIG_FB_CFB_FILLRECT=m
+CONFIG_FB_CFB_COPYAREA=m
+CONFIG_FB_CFB_IMAGEBLIT=m
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_SYS_FOPS is not set
+CONFIG_FB_DEFERRED_IO=y
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_BFIN_7171 is not set
+# CONFIG_FB_BFIN_7393 is not set
+CONFIG_FB_BF54X_LQ043=m
+# CONFIG_FB_BFIN_T350MCQB is not set
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_LOGO is not set
 
 #
 # Sound
 #
-# CONFIG_SOUND is not set
+CONFIG_SOUND=y
+
+#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=y
+CONFIG_SND_TIMER=y
+CONFIG_SND_PCM=y
+# CONFIG_SND_SEQUENCER is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=y
+CONFIG_SND_PCM_OSS=y
+CONFIG_SND_PCM_OSS_PLUGINS=y
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+CONFIG_SND_VERBOSE_PROCFS=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+
+#
+# Generic devices
+#
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+
+#
+# ALSA Blackfin devices
+#
+# CONFIG_SND_BLACKFIN_AD1836 is not set
+# CONFIG_SND_BFIN_AD73311 is not set
+
+#
+# System on Chip audio support
+#
+CONFIG_SND_SOC_AC97_BUS=y
+CONFIG_SND_SOC=y
+CONFIG_SND_BF5XX_SOC=y
+CONFIG_SND_BF5XX_SOC_AC97=y
+CONFIG_SND_BF5XX_SOC_BF548_EZKIT=y
+# CONFIG_SND_BF5XX_SOC_WM8750 is not set
+# CONFIG_SND_BF5XX_SOC_WM8731 is not set
+CONFIG_SND_BF5XX_SPORT_NUM=0
+# CONFIG_SND_BF5XX_HAVE_COLD_RESET is not set
+CONFIG_SND_SOC_AD1980=y
+
+#
+# Open Sound System
+#
+# CONFIG_SOUND_PRIME is not set
+CONFIG_AC97_BUS=y
 
 #
 # HID Devices
 #
-CONFIG_HID=y
+CONFIG_HID=m
 # CONFIG_HID_DEBUG is not set
 
 #
@@ -1101,8 +1196,13 @@ CONFIG_EXT2_FS=y
 CONFIG_EXT2_FS_XATTR=y
 # CONFIG_EXT2_FS_POSIX_ACL is not set
 # CONFIG_EXT2_FS_SECURITY is not set
-# CONFIG_EXT3_FS is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_POSIX_ACL is not set
+# CONFIG_EXT3_FS_SECURITY is not set
 # CONFIG_EXT4DEV_FS is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
 CONFIG_FS_MBCACHE=y
 # CONFIG_REISERFS_FS is not set
 # CONFIG_JFS_FS is not set
@@ -1123,15 +1223,22 @@ CONFIG_DNOTIFY=y
 #
 # CD-ROM/DVD Filesystems
 #
-# CONFIG_ISO9660_FS is not set
+CONFIG_ISO9660_FS=m
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
 # CONFIG_UDF_FS is not set
 
 #
 # DOS/FAT/NT Filesystems
 #
-# CONFIG_MSDOS_FS is not set
-# CONFIG_VFAT_FS is not set
-# CONFIG_NTFS_FS is not set
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+CONFIG_NTFS_FS=m
+# CONFIG_NTFS_DEBUG is not set
+CONFIG_NTFS_RW=y
 
 #
 # Pseudo filesystems
@@ -1183,10 +1290,33 @@ CONFIG_JFFS2_RTIME=y
 #
 # Network File Systems
 #
-# CONFIG_NFS_FS is not set
-# CONFIG_NFSD is not set
-# CONFIG_SMB_FS is not set
-# CONFIG_CIFS is not set
+CONFIG_NFS_FS=m
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
+CONFIG_NFSD=m
+CONFIG_NFSD_V3=y
+# CONFIG_NFSD_V3_ACL is not set
+# CONFIG_NFSD_V4 is not set
+CONFIG_NFSD_TCP=y
+CONFIG_LOCKD=m
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=m
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=m
+# CONFIG_SUNRPC_BIND34 is not set
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+CONFIG_SMB_FS=m
+CONFIG_SMB_NLS_DEFAULT=y
+CONFIG_SMB_NLS_REMOTE="cp437"
+CONFIG_CIFS=y
+# CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_WEAK_PW_HASH is not set
+# CONFIG_CIFS_XATTR is not set
+# CONFIG_CIFS_DEBUG2 is not set
+# CONFIG_CIFS_EXPERIMENTAL is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
@@ -1195,13 +1325,68 @@ CONFIG_JFFS2_RTIME=y
 #
 # Partition Types
 #
-# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
 CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+# CONFIG_SYSV68_PARTITION is not set
 
 #
 # Native Language Support
 #
-# CONFIG_NLS is not set
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=m
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=m
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=m
 
 #
 # Distributed Lock Manager
index 85e647f877590de234fb67f94b46d775620f407a..e9f100b45eb180ba60103f8eec093065715fa8ec 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.22.6
+# Linux kernel version: 2.6.22.12
 #
 # CONFIG_MMU is not set
 # CONFIG_FPU is not set
@@ -8,7 +8,6 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
 CONFIG_BLACKFIN=y
 CONFIG_ZONE_DMA=y
-CONFIG_BFIN=y
 CONFIG_SEMAPHORE_SLEEPERS=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_GENERIC_HWEIGHT=y
@@ -18,7 +17,6 @@ CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_GENERIC_GPIO=y
 CONFIG_FORCE_MAX_ZONEORDER=14
 CONFIG_GENERIC_CALIBRATE_DELAY=y
-CONFIG_IRQCHIP_DEMUX_GPIO=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
@@ -64,7 +62,6 @@ CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
 CONFIG_EPOLL=y
 CONFIG_SIGNALFD=y
-CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3
@@ -117,6 +114,9 @@ CONFIG_PREEMPT_VOLUNTARY=y
 #
 # Processor and Board Settings
 #
+# CONFIG_BF522 is not set
+# CONFIG_BF525 is not set
+# CONFIG_BF527 is not set
 # CONFIG_BF531 is not set
 # CONFIG_BF532 is not set
 # CONFIG_BF533 is not set
@@ -125,10 +125,12 @@ CONFIG_PREEMPT_VOLUNTARY=y
 # CONFIG_BF537 is not set
 # CONFIG_BF542 is not set
 # CONFIG_BF544 is not set
+# CONFIG_BF547 is not set
 # CONFIG_BF548 is not set
 # CONFIG_BF549 is not set
 CONFIG_BF561=y
 # CONFIG_BF_REV_0_0 is not set
+# CONFIG_BF_REV_0_1 is not set
 # CONFIG_BF_REV_0_2 is not set
 CONFIG_BF_REV_0_3=y
 # CONFIG_BF_REV_0_4 is not set
@@ -136,18 +138,15 @@ CONFIG_BF_REV_0_3=y
 # CONFIG_BF_REV_ANY is not set
 # CONFIG_BF_REV_NONE is not set
 CONFIG_BFIN_DUAL_CORE=y
-# CONFIG_BFIN533_EZKIT is not set
-# CONFIG_BFIN533_STAMP is not set
-# CONFIG_BFIN537_STAMP is not set
-# CONFIG_BFIN533_BLUETECHNIX_CM is not set
-# CONFIG_BFIN537_BLUETECHNIX_CM is not set
-# CONFIG_BFIN548_EZKIT is not set
-# CONFIG_BFIN561_BLUETECHNIX_CM is not set
+CONFIG_MEM_MT48LC16M16A2TG_75=y
+CONFIG_IRQ_PLL_WAKEUP=7
+CONFIG_IRQ_SPORT0_ERROR=7
+CONFIG_IRQ_SPORT1_ERROR=7
+CONFIG_IRQ_SPI_ERROR=7
 CONFIG_BFIN561_EZKIT=y
 # CONFIG_BFIN561_TEPLA is not set
-# CONFIG_PNAV10 is not set
-# CONFIG_GENERIC_BOARD is not set
-CONFIG_MEM_MT48LC16M16A2TG_75=y
+# CONFIG_BFIN561_BLUETECHNIX_CM is not set
+# CONFIG_GENERIC_BF561_BOARD is not set
 
 #
 # BF561 Specific Configuration
@@ -170,15 +169,11 @@ CONFIG_BF561_COREB_RESET=y
 #
 # Priority
 #
-CONFIG_IRQ_PLL_WAKEUP=7
 CONFIG_IRQ_DMA1_ERROR=7
 CONFIG_IRQ_DMA2_ERROR=7
 CONFIG_IRQ_IMDMA_ERROR=7
 CONFIG_IRQ_PPI0_ERROR=7
 CONFIG_IRQ_PPI1_ERROR=7
-CONFIG_IRQ_SPORT0_ERROR=7
-CONFIG_IRQ_SPORT1_ERROR=7
-CONFIG_IRQ_SPI_ERROR=7
 CONFIG_IRQ_UART_ERROR=7
 CONFIG_IRQ_RESERVED_ERROR=7
 CONFIG_IRQ_DMA1_0=8
@@ -300,6 +295,7 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_LARGE_ALLOCS=y
+# CONFIG_BFIN_GPTIMERS is not set
 CONFIG_BFIN_DMA_5XX=y
 # CONFIG_DMA_UNCACHED_2M is not set
 CONFIG_DMA_UNCACHED_1M=y
@@ -321,7 +317,7 @@ CONFIG_L1_MAX_PIECE=16
 #
 
 #
-# EBIU_AMBCTL Global Control
+# EBIU_AMGCTL Global Control
 #
 CONFIG_C_AMCKEN=y
 CONFIG_C_CDPRIO=y
@@ -564,14 +560,6 @@ CONFIG_MTD_COMPLEX_MAPPINGS=y
 CONFIG_MTD_BF5xx=m
 CONFIG_BFIN_FLASH_SIZE=0x0400000
 CONFIG_EBIU_FLASH_BASE=0x20000000
-
-#
-# FLASH_EBIU_AMBCTL Control
-#
-CONFIG_BFIN_FLASH_BANK_0=0x7BB0
-CONFIG_BFIN_FLASH_BANK_1=0x7BB0
-CONFIG_BFIN_FLASH_BANK_2=0x7BB0
-CONFIG_BFIN_FLASH_BANK_3=0x7BB0
 # CONFIG_MTD_UCLINUX is not set
 # CONFIG_MTD_PLATRAM is not set
 
@@ -660,6 +648,7 @@ CONFIG_SMC91X=y
 # CONFIG_DM9000 is not set
 CONFIG_NETDEV_1000=y
 CONFIG_NETDEV_10000=y
+# CONFIG_AX88180 is not set
 
 #
 # Wireless LAN
@@ -721,9 +710,9 @@ CONFIG_INPUT_EVDEV=m
 #
 # CONFIG_AD9960 is not set
 # CONFIG_SPI_ADC_BF533 is not set
-# CONFIG_BFIN_PFLAGS is not set
+# CONFIG_BF5xx_PFLAGS is not set
 # CONFIG_BF5xx_PPIFCD is not set
-# CONFIG_BF5xx_TIMERS is not set
+# CONFIG_BFIN_SIMPLE_TIMER is not set
 # CONFIG_BF5xx_PPI is not set
 # CONFIG_BFIN_SPORT is not set
 # CONFIG_BFIN_TIMER_LATENCY is not set
diff --git a/arch/blackfin/configs/H8606_defconfig b/arch/blackfin/configs/H8606_defconfig
new file mode 100644 (file)
index 0000000..18cbb8c
--- /dev/null
@@ -0,0 +1,1160 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.22.12
+#
+# CONFIG_MMU is not set
+# CONFIG_FPU is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
+CONFIG_BLACKFIN=y
+CONFIG_ZONE_DMA=y
+CONFIG_SEMAPHORE_SLEEPERS=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+# CONFIG_GENERIC_TIME is not set
+CONFIG_GENERIC_GPIO=y
+CONFIG_FORCE_MAX_ZONEORDER=14
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SYSVIPC=y
+# CONFIG_IPC_NS is not set
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_UTS_NS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_SYSFS_DEPRECATED=y
+# CONFIG_RELAY is not set
+# CONFIG_BLK_DEV_INITRD is not set
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_EVENTFD=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3
+# CONFIG_NP2 is not set
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_RT_MUTEXES=y
+CONFIG_TINY_SHMEM=y
+CONFIG_BASE_SMALL=0
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+
+#
+# Block layer
+#
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+# CONFIG_IOSCHED_DEADLINE is not set
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+
+#
+# Blackfin Processor Options
+#
+
+#
+# Processor and Board Settings
+#
+# CONFIG_BF522 is not set
+# CONFIG_BF525 is not set
+# CONFIG_BF527 is not set
+# CONFIG_BF531 is not set
+CONFIG_BF532=y
+# CONFIG_BF533 is not set
+# CONFIG_BF534 is not set
+# CONFIG_BF536 is not set
+# CONFIG_BF537 is not set
+# CONFIG_BF542 is not set
+# CONFIG_BF544 is not set
+# CONFIG_BF547 is not set
+# CONFIG_BF548 is not set
+# CONFIG_BF549 is not set
+# CONFIG_BF561 is not set
+# CONFIG_BF_REV_0_0 is not set
+# CONFIG_BF_REV_0_1 is not set
+# CONFIG_BF_REV_0_2 is not set
+# CONFIG_BF_REV_0_3 is not set
+# CONFIG_BF_REV_0_4 is not set
+CONFIG_BF_REV_0_5=y
+# CONFIG_BF_REV_ANY is not set
+# CONFIG_BF_REV_NONE is not set
+CONFIG_BF53x=y
+CONFIG_BFIN_SINGLE_CORE=y
+CONFIG_MEM_MT48LC16M16A2TG_75=y
+# CONFIG_BFIN533_EZKIT is not set
+# CONFIG_BFIN533_STAMP is not set
+# CONFIG_BFIN533_BLUETECHNIX_CM is not set
+CONFIG_H8606_HVSISTEMAS=y
+# CONFIG_GENERIC_BF533_BOARD is not set
+
+#
+# BF533/2/1 Specific Configuration
+#
+
+#
+# Interrupt Priority Assignment
+#
+
+#
+# Priority
+#
+CONFIG_UART_ERROR=7
+CONFIG_SPORT0_ERROR=7
+CONFIG_SPI_ERROR=7
+CONFIG_SPORT1_ERROR=7
+CONFIG_PPI_ERROR=7
+CONFIG_DMA_ERROR=7
+CONFIG_PLLWAKE_ERROR=7
+CONFIG_RTC_ERROR=8
+CONFIG_DMA0_PPI=8
+CONFIG_DMA1_SPORT0RX=9
+CONFIG_DMA2_SPORT0TX=9
+CONFIG_DMA3_SPORT1RX=9
+CONFIG_DMA4_SPORT1TX=9
+CONFIG_DMA5_SPI=10
+CONFIG_DMA6_UARTRX=10
+CONFIG_DMA7_UARTTX=10
+CONFIG_TIMER0=11
+CONFIG_TIMER1=11
+CONFIG_TIMER2=11
+CONFIG_PFA=12
+CONFIG_PFB=12
+CONFIG_MEMDMA0=13
+CONFIG_MEMDMA1=13
+CONFIG_WDTIMER=13
+
+#
+# Board customizations
+#
+# CONFIG_CMDLINE_BOOL is not set
+
+#
+# Clock/PLL Setup
+#
+CONFIG_CLKIN_HZ=25000000
+# CONFIG_BFIN_KERNEL_CLOCK is not set
+CONFIG_MAX_VCO_HZ=400000000
+CONFIG_MIN_VCO_HZ=50000000
+CONFIG_MAX_SCLK_HZ=133000000
+CONFIG_MIN_SCLK_HZ=27000000
+
+#
+# Kernel Timer/Scheduler
+#
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+
+#
+# Memory Setup
+#
+CONFIG_MEM_SIZE=32
+CONFIG_MEM_ADD_WIDTH=9
+CONFIG_BOOT_LOAD=0x1000
+CONFIG_BFIN_SCRATCH_REG_RETN=y
+# CONFIG_BFIN_SCRATCH_REG_RETE is not set
+# CONFIG_BFIN_SCRATCH_REG_CYCLES is not set
+
+#
+# Blackfin Kernel Optimizations
+#
+
+#
+# Memory Optimizations
+#
+CONFIG_I_ENTRY_L1=y
+CONFIG_EXCPT_IRQ_SYSC_L1=y
+CONFIG_DO_IRQ_L1=y
+CONFIG_CORE_TIMER_IRQ_L1=y
+CONFIG_IDLE_L1=y
+CONFIG_SCHEDULE_L1=y
+CONFIG_ARITHMETIC_OPS_L1=y
+CONFIG_ACCESS_OK_L1=y
+CONFIG_MEMSET_L1=y
+CONFIG_MEMCPY_L1=y
+CONFIG_SYS_BFIN_SPINLOCK_L1=y
+# CONFIG_IP_CHECKSUM_L1 is not set
+# CONFIG_CACHELINE_ALIGNED_L1 is not set
+# CONFIG_SYSCALL_TAB_L1 is not set
+# CONFIG_CPLB_SWITCH_TAB_L1 is not set
+CONFIG_RAMKERNEL=y
+# CONFIG_ROMKERNEL is not set
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_LARGE_ALLOCS=y
+CONFIG_BFIN_GPTIMERS=y
+CONFIG_BFIN_DMA_5XX=y
+# CONFIG_DMA_UNCACHED_2M is not set
+CONFIG_DMA_UNCACHED_1M=y
+# CONFIG_DMA_UNCACHED_NONE is not set
+
+#
+# Cache Support
+#
+CONFIG_BFIN_ICACHE=y
+CONFIG_BFIN_DCACHE=y
+# CONFIG_BFIN_DCACHE_BANKA is not set
+CONFIG_BFIN_ICACHE_LOCK=y
+CONFIG_BFIN_WB=y
+# CONFIG_BFIN_WT is not set
+CONFIG_L1_MAX_PIECE=16
+
+#
+# Asynchonous Memory Configuration
+#
+
+#
+# EBIU_AMGCTL Global Control
+#
+CONFIG_C_AMCKEN=y
+CONFIG_C_CDPRIO=y
+# CONFIG_C_AMBEN is not set
+# CONFIG_C_AMBEN_B0 is not set
+# CONFIG_C_AMBEN_B0_B1 is not set
+# CONFIG_C_AMBEN_B0_B1_B2 is not set
+CONFIG_C_AMBEN_ALL=y
+
+#
+# EBIU_AMBCTL Control
+#
+CONFIG_BANK_0=0x7BB0
+CONFIG_BANK_1=0x7BB0
+CONFIG_BANK_2=0x7BB0
+CONFIG_BANK_3=0x99B3
+
+#
+# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
+#
+# CONFIG_PCI is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF_FDPIC=y
+CONFIG_BINFMT_FLAT=y
+CONFIG_BINFMT_ZFLAT=y
+# CONFIG_BINFMT_SHARED_FLAT is not set
+# CONFIG_BINFMT_MISC is not set
+
+#
+# Power management options
+#
+CONFIG_PM=y
+CONFIG_PM_LEGACY=y
+# CONFIG_PM_DEBUG is not set
+# CONFIG_PM_SYSFS_DEPRECATED is not set
+CONFIG_PM_WAKEUP_GPIO_BY_SIC_IWR=y
+# CONFIG_PM_WAKEUP_BY_GPIO is not set
+# CONFIG_PM_WAKEUP_GPIO_API is not set
+CONFIG_PM_WAKEUP_SIC_IWR=0x100000
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+# CONFIG_XFRM_USER is not set
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+# CONFIG_IP_PNP_DHCP is not set
+# CONFIG_IP_PNP_BOOTP is not set
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+# CONFIG_NETLABEL is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+CONFIG_IRDA=m
+
+#
+# IrDA protocols
+#
+CONFIG_IRLAN=m
+CONFIG_IRCOMM=m
+# CONFIG_IRDA_ULTRA is not set
+
+#
+# IrDA options
+#
+CONFIG_IRDA_CACHE_LAST_LSAP=y
+# CONFIG_IRDA_FAST_RR is not set
+# CONFIG_IRDA_DEBUG is not set
+
+#
+# Infrared-port device drivers
+#
+
+#
+# SIR device drivers
+#
+CONFIG_IRTTY_SIR=m
+
+#
+# Dongle support
+#
+# CONFIG_DONGLE is not set
+
+#
+# Old SIR device drivers
+#
+# CONFIG_IRPORT_SIR is not set
+
+#
+# Old Serial dongle support
+#
+
+#
+# FIR device drivers
+#
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+
+#
+# Wireless
+#
+# CONFIG_CFG80211 is not set
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_MAC80211 is not set
+# CONFIG_IEEE80211 is not set
+# CONFIG_RFKILL is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_FW_LOADER is not set
+# CONFIG_SYS_HYPERVISOR is not set
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_CONCAT is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+CONFIG_MTD_RAM=y
+CONFIG_MTD_ROM=y
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+# CONFIG_MTD_PHYSMAP is not set
+# CONFIG_MTD_BF5xx is not set
+# CONFIG_MTD_UCLINUX is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_DATAFLASH is not set
+CONFIG_MTD_M25P80=y
+CONFIG_M25PXX_USE_FAST_READ=y
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+# CONFIG_MTD_NAND is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# UBI - Unsorted block images
+#
+# CONFIG_MTD_UBI is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Plug and Play support
+#
+# CONFIG_PNPACPI is not set
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_COW_COMMON is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# Misc devices
+#
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+# CONFIG_SCSI_NETLINK is not set
+# CONFIG_ATA is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_PHYLIB is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_SMC91X is not set
+# CONFIG_SMSC911X is not set
+CONFIG_DM9000=y
+CONFIG_NETDEV_1000=y
+CONFIG_NETDEV_10000=y
+# CONFIG_AX88180 is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+# CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+
+#
+# Userland interfaces
+#
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+CONFIG_INPUT_EVDEV=m
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+CONFIG_INPUT_MISC=y
+# CONFIG_INPUT_ATI_REMOTE is not set
+# CONFIG_INPUT_ATI_REMOTE2 is not set
+# CONFIG_INPUT_KEYSPAN_REMOTE is not set
+# CONFIG_INPUT_POWERMATE is not set
+# CONFIG_INPUT_YEALINK is not set
+# CONFIG_INPUT_UINPUT is not set
+# CONFIG_BF53X_PFBUTTONS is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+# CONFIG_AD9960 is not set
+# CONFIG_SPI_ADC_BF533 is not set
+CONFIG_BF5xx_PFLAGS=y
+# CONFIG_BF5xx_PFLAGS_PROC is not set
+# CONFIG_BF5xx_PPIFCD is not set
+CONFIG_BFIN_SIMPLE_TIMER=y
+# CONFIG_BF5xx_PPI is not set
+CONFIG_BFIN_SPORT=y
+CONFIG_BFIN_TIMER_LATENCY=y
+# CONFIG_AD5304 is not set
+# CONFIG_BF5xx_FBDMA is not set
+# CONFIG_VT is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_BFIN=y
+CONFIG_SERIAL_BFIN_CONSOLE=y
+CONFIG_SERIAL_BFIN_DMA=y
+# CONFIG_SERIAL_BFIN_PIO is not set
+CONFIG_SERIAL_BFIN_UART0=y
+# CONFIG_BFIN_UART0_CTSRTS is not set
+# CONFIG_SERIAL_BFIN_UART1 is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_BFIN_SPORT is not set
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+
+#
+# CAN, the car bus and industrial fieldbus
+#
+# CONFIG_CAN4LINUX is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+# CONFIG_BFIN_WDT is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_GEN_RTC is not set
+CONFIG_BLACKFIN_DPMC=y
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+# CONFIG_I2C is not set
+
+#
+# SPI support
+#
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_BFIN=y
+# CONFIG_SPI_BITBANG is not set
+
+#
+# SPI Protocol Masters
+#
+CONFIG_SPI_AT25=y
+CONFIG_SPI_SPIDEV=y
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_ABITUGURU is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_LM70 is not set
+# CONFIG_SENSORS_PC87427 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_VT1211 is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_SM501 is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+CONFIG_DAB=y
+
+#
+# Graphics support
+#
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+# CONFIG_VGASTATE is not set
+# CONFIG_FB is not set
+
+#
+# Sound
+#
+CONFIG_SOUND=m
+
+#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+# CONFIG_SND_SEQUENCER is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_PCM_OSS_PLUGINS=y
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+CONFIG_SND_VERBOSE_PROCFS=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+
+#
+# Generic devices
+#
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+
+#
+# ALSA Blackfin devices
+#
+CONFIG_SND_BLACKFIN_AD1836=m
+CONFIG_SND_BLACKFIN_AD1836_TDM=y
+# CONFIG_SND_BLACKFIN_AD1836_I2S is not set
+CONFIG_SND_BLACKFIN_AD1836_MULSUB=y
+# CONFIG_SND_BLACKFIN_AD1836_5P1 is not set
+CONFIG_SND_BLACKFIN_SPORT=0
+CONFIG_SND_BLACKFIN_SPI_PFBIT=4
+# CONFIG_SND_BFIN_AD73311 is not set
+
+#
+# System on Chip audio support
+#
+# CONFIG_SND_SOC is not set
+
+#
+# Open Sound System
+#
+# CONFIG_SOUND_PRIME is not set
+
+#
+# HID Devices
+#
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+# CONFIG_USB_ARCH_HAS_OHCI is not set
+# CONFIG_USB_ARCH_HAS_EHCI is not set
+# CONFIG_USB is not set
+
+#
+# Enable Host or Gadget support to see Inventra options
+#
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+# CONFIG_MMC is not set
+
+#
+# LED devices
+#
+# CONFIG_NEW_LEDS is not set
+
+#
+# LED drivers
+#
+
+#
+# LED Triggers
+#
+
+#
+# InfiniBand support
+#
+
+#
+# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
+#
+
+#
+# Real Time Clock
+#
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+# CONFIG_RTC_DEBUG is not set
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+CONFIG_RTC_INTF_DEV_UIE_EMUL=y
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+
+#
+# SPI RTC drivers
+#
+# CONFIG_RTC_DRV_RS5C348 is not set
+# CONFIG_RTC_DRV_MAX6902 is not set
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+CONFIG_RTC_DRV_BFIN=y
+
+#
+# DMA Engine support
+#
+# CONFIG_DMA_ENGINE is not set
+
+#
+# DMA Clients
+#
+
+#
+# DMA Devices
+#
+
+#
+# PBX support
+#
+# CONFIG_PBX is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+# CONFIG_EXT2_FS_POSIX_ACL is not set
+# CONFIG_EXT2_FS_SECURITY is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_EXT4DEV_FS is not set
+CONFIG_FS_MBCACHE=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+CONFIG_DNOTIFY=y
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+# CONFIG_TMPFS is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_YAFFS_FS is not set
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_SUMMARY is not set
+# CONFIG_JFFS2_FS_XATTR is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=m
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
+# CONFIG_NFSD is not set
+CONFIG_LOCKD=m
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=m
+# CONFIG_SUNRPC_BIND34 is not set
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+# CONFIG_9P_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+
+#
+# Native Language Support
+#
+CONFIG_NLS=m
+CONFIG_NLS_DEFAULT="iso8859-1"
+# CONFIG_NLS_CODEPAGE_437 is not set
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
+# CONFIG_NLS_ISO8859_1 is not set
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+# CONFIG_NLS_UTF8 is not set
+
+#
+# Distributed Lock Manager
+#
+# CONFIG_DLM is not set
+
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_MUST_CHECK=y
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_MMRS is not set
+CONFIG_DEBUG_HUNT_FOR_ZERO=y
+CONFIG_DEBUG_BFIN_HWTRACE_ON=y
+CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y
+# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE is not set
+# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set
+CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=0
+# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set
+# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set
+# CONFIG_EARLY_PRINTK is not set
+CONFIG_CPLB_INFO=y
+CONFIG_ACCESS_CHECK=y
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+CONFIG_SECURITY=y
+# CONFIG_SECURITY_NETWORK is not set
+CONFIG_SECURITY_CAPABILITIES=y
+
+#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_CRC_CCITT=m
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
index 15e36aaf21865d49e24cbf30aa1dfcd6761a842f..25709f504d8f6f4f7874c5ccef392e90748c1b6a 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.22.6
+# Linux kernel version: 2.6.22.12
 #
 # CONFIG_MMU is not set
 # CONFIG_FPU is not set
@@ -8,7 +8,6 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
 CONFIG_BLACKFIN=y
 CONFIG_ZONE_DMA=y
-CONFIG_BFIN=y
 CONFIG_SEMAPHORE_SLEEPERS=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_GENERIC_HWEIGHT=y
@@ -18,7 +17,6 @@ CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_GENERIC_GPIO=y
 CONFIG_FORCE_MAX_ZONEORDER=14
 CONFIG_GENERIC_CALIBRATE_DELAY=y
-CONFIG_IRQCHIP_DEMUX_GPIO=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
@@ -62,7 +60,6 @@ CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
 CONFIG_EPOLL=y
 CONFIG_SIGNALFD=y
-CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=9
@@ -115,6 +112,9 @@ CONFIG_PREEMPT_VOLUNTARY=y
 #
 # Processor and Board Settings
 #
+# CONFIG_BF522 is not set
+# CONFIG_BF525 is not set
+# CONFIG_BF527 is not set
 # CONFIG_BF531 is not set
 # CONFIG_BF532 is not set
 # CONFIG_BF533 is not set
@@ -123,10 +123,12 @@ CONFIG_PREEMPT_VOLUNTARY=y
 CONFIG_BF537=y
 # CONFIG_BF542 is not set
 # CONFIG_BF544 is not set
+# CONFIG_BF547 is not set
 # CONFIG_BF548 is not set
 # CONFIG_BF549 is not set
 # CONFIG_BF561 is not set
 # CONFIG_BF_REV_0_0 is not set
+# CONFIG_BF_REV_0_1 is not set
 CONFIG_BF_REV_0_2=y
 # CONFIG_BF_REV_0_3 is not set
 # CONFIG_BF_REV_0_4 is not set
@@ -135,33 +137,8 @@ CONFIG_BF_REV_0_2=y
 # CONFIG_BF_REV_NONE is not set
 CONFIG_BF53x=y
 CONFIG_BFIN_SINGLE_CORE=y
-# CONFIG_BFIN533_EZKIT is not set
-# CONFIG_BFIN533_STAMP is not set
-# CONFIG_BFIN537_STAMP is not set
-# CONFIG_BFIN533_BLUETECHNIX_CM is not set
-# CONFIG_BFIN537_BLUETECHNIX_CM is not set
-# CONFIG_BFIN548_EZKIT is not set
-# CONFIG_BFIN561_BLUETECHNIX_CM is not set
-# CONFIG_BFIN561_EZKIT is not set
-# CONFIG_BFIN561_TEPLA is not set
-CONFIG_PNAV10=y
-# CONFIG_GENERIC_BOARD is not set
 CONFIG_MEM_MT48LC32M8A2_75=y
 CONFIG_IRQ_PLL_WAKEUP=7
-
-#
-# BF537 Specific Configuration
-#
-
-#
-# Interrupt Priority Assignment
-#
-
-#
-# Priority
-#
-CONFIG_IRQ_DMA_ERROR=7
-CONFIG_IRQ_ERROR=7
 CONFIG_IRQ_RTC=8
 CONFIG_IRQ_PPI=8
 CONFIG_IRQ_SPORT0_RX=9
@@ -174,8 +151,6 @@ CONFIG_IRQ_UART0_RX=10
 CONFIG_IRQ_UART0_TX=10
 CONFIG_IRQ_UART1_RX=10
 CONFIG_IRQ_UART1_TX=10
-CONFIG_IRQ_CAN_RX=11
-CONFIG_IRQ_CAN_TX=11
 CONFIG_IRQ_MAC_RX=11
 CONFIG_IRQ_MAC_TX=11
 CONFIG_IRQ_TMR0=12
@@ -186,11 +161,31 @@ CONFIG_IRQ_TMR4=12
 CONFIG_IRQ_TMR5=12
 CONFIG_IRQ_TMR6=12
 CONFIG_IRQ_TMR7=12
-CONFIG_IRQ_PROG_INTA=12
 CONFIG_IRQ_PORTG_INTB=12
 CONFIG_IRQ_MEM_DMA0=13
 CONFIG_IRQ_MEM_DMA1=13
 CONFIG_IRQ_WATCH=13
+# CONFIG_BFIN537_STAMP is not set
+# CONFIG_BFIN537_BLUETECHNIX_CM is not set
+CONFIG_PNAV10=y
+# CONFIG_GENERIC_BF537_BOARD is not set
+
+#
+# BF537 Specific Configuration
+#
+
+#
+# Interrupt Priority Assignment
+#
+
+#
+# Priority
+#
+CONFIG_IRQ_DMA_ERROR=7
+CONFIG_IRQ_ERROR=7
+CONFIG_IRQ_CAN_RX=11
+CONFIG_IRQ_CAN_TX=11
+CONFIG_IRQ_PROG_INTA=12
 
 #
 # Board customizations
@@ -261,6 +256,7 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_LARGE_ALLOCS=y
+# CONFIG_BFIN_GPTIMERS is not set
 CONFIG_BFIN_DMA_5XX=y
 # CONFIG_DMA_UNCACHED_2M is not set
 CONFIG_DMA_UNCACHED_1M=y
@@ -282,7 +278,7 @@ CONFIG_L1_MAX_PIECE=16
 #
 
 #
-# EBIU_AMBCTL Global Control
+# EBIU_AMGCTL Global Control
 #
 CONFIG_C_AMCKEN=y
 CONFIG_C_CDPRIO=y
@@ -593,6 +589,7 @@ CONFIG_BFIN_MAC_RMII=y
 # CONFIG_DM9000 is not set
 CONFIG_NETDEV_1000=y
 CONFIG_NETDEV_10000=y
+# CONFIG_AX88180 is not set
 
 #
 # Wireless LAN
@@ -675,9 +672,9 @@ CONFIG_INPUT_UINPUT=y
 #
 # CONFIG_AD9960 is not set
 # CONFIG_SPI_ADC_BF533 is not set
-# CONFIG_BFIN_PFLAGS is not set
+# CONFIG_BF5xx_PFLAGS is not set
 # CONFIG_BF5xx_PPIFCD is not set
-# CONFIG_BF5xx_TIMERS is not set
+# CONFIG_BFIN_SIMPLE_TIMER is not set
 # CONFIG_BF5xx_PPI is not set
 CONFIG_BFIN_SPORT=y
 # CONFIG_BFIN_TIMER_LATENCY is not set
@@ -897,6 +894,7 @@ CONFIG_FB_BF537_LQ035=y
 CONFIG_LQ035_SLAVE_ADDR=0x58
 CONFIG_FB_BFIN_LANDSCAPE=y
 # CONFIG_FB_BFIN_BGR is not set
+# CONFIG_FB_BFIN_T350MCQB is not set
 # CONFIG_FB_S1D13XXX is not set
 # CONFIG_FB_VIRTUAL is not set
 # CONFIG_LOGO is not set
@@ -938,11 +936,6 @@ CONFIG_SND=m
 #
 # CONFIG_SND_SOC is not set
 
-#
-# SoC Audio for the ADI Blackfin
-#
-# CONFIG_SND_BF5XX_HAVE_COLD_RESET is not set
-
 #
 # Open Sound System
 #
index 503eef4c7fec26b831476be01e98a532a2a25e96..b54446055a43c3360ba8551ef5a80e1205664d4e 100644 (file)
@@ -436,6 +436,7 @@ unsigned long get_dma_curr_desc_ptr(unsigned int channel)
 
        return dma_ch[channel].regs->curr_desc_ptr;
 }
+EXPORT_SYMBOL(get_dma_curr_desc_ptr);
 
 unsigned long get_dma_curr_addr(unsigned int channel)
 {
index 2198afe40f338efae030e7516055cf2596936c6d..0bfbb269e350ce49835acb94e0bd432fef280275 100644 (file)
@@ -37,9 +37,6 @@
 /* platform dependent support */
 
 EXPORT_SYMBOL(__ioremap);
-EXPORT_SYMBOL(strcmp);
-EXPORT_SYMBOL(strncmp);
-EXPORT_SYMBOL(dump_thread);
 
 EXPORT_SYMBOL(ip_fast_csum);
 
@@ -51,6 +48,7 @@ EXPORT_SYMBOL(__down_trylock);
 EXPORT_SYMBOL(__down_interruptible);
 
 EXPORT_SYMBOL(is_in_rom);
+EXPORT_SYMBOL(bfin_return_from_exception);
 
 /* Networking helper routines. */
 EXPORT_SYMBOL(csum_partial_copy);
@@ -60,13 +58,11 @@ EXPORT_SYMBOL(csum_partial_copy);
  * their interface isn't gonna change any time soon now, so
  * it's OK to leave it out of version control.
  */
-EXPORT_SYMBOL(strcpy);
 EXPORT_SYMBOL(memcpy);
 EXPORT_SYMBOL(memset);
 EXPORT_SYMBOL(memcmp);
 EXPORT_SYMBOL(memmove);
 EXPORT_SYMBOL(memchr);
-EXPORT_SYMBOL(get_wchan);
 
 /*
  * libgcc functions - functions that are used internally by the
@@ -102,6 +98,7 @@ EXPORT_SYMBOL(outsw);
 EXPORT_SYMBOL(insw);
 EXPORT_SYMBOL(outsl);
 EXPORT_SYMBOL(insl);
+EXPORT_SYMBOL(insl_16);
 EXPORT_SYMBOL(irq_flags);
 EXPORT_SYMBOL(iounmap);
 EXPORT_SYMBOL(blackfin_dcache_invalidate_range);
index f2db6a5e2b5b987852828d4a95cadf88923d005c..6320bc45fbba6b6d55c1e803bde124732646700a 100644 (file)
 #include <asm/cplb.h>
 #include <asm/cplbinit.h>
 
-u_long icplb_table[MAX_CPLBS+1];
-u_long dcplb_table[MAX_CPLBS+1];
+u_long icplb_table[MAX_CPLBS + 1];
+u_long dcplb_table[MAX_CPLBS + 1];
 
 #ifdef CONFIG_CPLB_SWITCH_TAB_L1
-u_long ipdt_table[MAX_SWITCH_I_CPLBS+1]__attribute__((l1_data));
-u_long dpdt_table[MAX_SWITCH_D_CPLBS+1]__attribute__((l1_data));
-
-#ifdef CONFIG_CPLB_INFO
-u_long ipdt_swapcount_table[MAX_SWITCH_I_CPLBS]__attribute__((l1_data));
-u_long dpdt_swapcount_table[MAX_SWITCH_D_CPLBS]__attribute__((l1_data));
-#endif /* CONFIG_CPLB_INFO */
-
+# define PDT_ATTR __attribute__((l1_data))
 #else
+# define PDT_ATTR
+#endif
 
-u_long ipdt_table[MAX_SWITCH_I_CPLBS+1];
-u_long dpdt_table[MAX_SWITCH_D_CPLBS+1];
+u_long ipdt_table[MAX_SWITCH_I_CPLBS + 1] PDT_ATTR;
+u_long dpdt_table[MAX_SWITCH_D_CPLBS + 1] PDT_ATTR;
 
 #ifdef CONFIG_CPLB_INFO
-u_long ipdt_swapcount_table[MAX_SWITCH_I_CPLBS];
-u_long dpdt_swapcount_table[MAX_SWITCH_D_CPLBS];
-#endif /* CONFIG_CPLB_INFO */
-
-#endif /*CONFIG_CPLB_SWITCH_TAB_L1*/
+u_long ipdt_swapcount_table[MAX_SWITCH_I_CPLBS] PDT_ATTR;
+u_long dpdt_swapcount_table[MAX_SWITCH_D_CPLBS] PDT_ATTR;
+#endif
 
 struct s_cplb {
        struct cplb_tab init_i;
@@ -71,7 +64,7 @@ static struct cplb_desc cplb_data[] = {
 #else
                .valid = 0,
 #endif
-               .name = "ZERO Pointer Saveguard",
+               .name = "Zero Pointer Guard Page",
        },
        {
                .start = L1_CODE_START,
@@ -102,20 +95,20 @@ static struct cplb_desc cplb_data[] = {
                .end = 0,  /* dynamic */
                .psize = 0,
                .attr = INITIAL_T | SWITCH_T | I_CPLB | D_CPLB,
-               .i_conf =  SDRAM_IGENERIC,
-               .d_conf =  SDRAM_DGENERIC,
+               .i_conf = SDRAM_IGENERIC,
+               .d_conf = SDRAM_DGENERIC,
                .valid = 1,
-               .name = "SDRAM Kernel",
+               .name = "Kernel Memory",
        },
        {
                .start = 0, /* dynamic */
                .end = 0, /* dynamic */
                .psize = 0,
                .attr = INITIAL_T | SWITCH_T | D_CPLB,
-               .i_conf =  SDRAM_IGENERIC,
-               .d_conf =  SDRAM_DNON_CHBL,
+               .i_conf = SDRAM_IGENERIC,
+               .d_conf = SDRAM_DNON_CHBL,
                .valid = 1,
-               .name = "SDRAM RAM MTD",
+               .name = "uClinux MTD Memory",
        },
        {
                .start = 0, /* dynamic */
@@ -124,7 +117,7 @@ static struct cplb_desc cplb_data[] = {
                .attr = INITIAL_T | SWITCH_T | D_CPLB,
                .d_conf = SDRAM_DNON_CHBL,
                .valid = 1,
-               .name = "SDRAM Uncached DMA ZONE",
+               .name = "Uncached DMA Zone",
        },
        {
                .start = 0, /* dynamic */
@@ -134,7 +127,7 @@ static struct cplb_desc cplb_data[] = {
                .i_conf = 0, /* dynamic */
                .d_conf = 0, /* dynamic */
                .valid = 1,
-               .name = "SDRAM Reserved Memory",
+               .name = "Reserved Memory",
        },
        {
                .start = ASYNC_BANK0_BASE,
@@ -143,14 +136,14 @@ static struct cplb_desc cplb_data[] = {
                .attr = SWITCH_T | D_CPLB,
                .d_conf = SDRAM_EBIU,
                .valid = 1,
-               .name = "ASYNC Memory",
+               .name = "Asynchronous Memory Banks",
        },
        {
-#if defined(CONFIG_BF561)
-               .start = L2_SRAM,
-               .end = L2_SRAM_END,
+#ifdef L2_START
+               .start = L2_START,
+               .end = L2_START + L2_LENGTH,
                .psize = SIZE_1M,
-               .attr = SWITCH_T | D_CPLB,
+               .attr = SWITCH_T | I_CPLB | D_CPLB,
                .i_conf = L2_MEMORY,
                .d_conf = L2_MEMORY,
                .valid = 1,
@@ -158,13 +151,23 @@ static struct cplb_desc cplb_data[] = {
                .valid = 0,
 #endif
                .name = "L2 Memory",
-       }
+       },
+       {
+               .start = BOOT_ROM_START,
+               .end = BOOT_ROM_START + BOOT_ROM_LENGTH,
+               .psize = SIZE_1M,
+               .attr = SWITCH_T | I_CPLB | D_CPLB,
+               .i_conf = SDRAM_IGENERIC,
+               .d_conf = SDRAM_DGENERIC,
+               .valid = 1,
+               .name = "On-Chip BootROM",
+       },
 };
 
 static u16 __init lock_kernel_check(u32 start, u32 end)
 {
-       if ((start <= (u32) _stext && end >= (u32) _end)
-           || (start >= (u32) _stext && end <= (u32) _end))
+       if ((end   <= (u32) _end && end   >= (u32)_stext) ||
+           (start <= (u32) _end && start >= (u32)_stext))
                return IN_KERNEL;
        return 0;
 }
@@ -350,7 +353,7 @@ void __init generate_cpl_tables(void)
        else
                cplb_data[RES_MEM].i_conf = SDRAM_INON_CHBL;
 
-       for (i = ZERO_P; i <= L2_MEM; i++) {
+       for (i = ZERO_P; i < ARRAY_SIZE(cplb_data); ++i) {
                if (!cplb_data[i].valid)
                        continue;
 
index 6ec518a81113c2571df593dd6fe6f2e08c7a24ec..724f4a5a1d46b3339bdc9047750eb7dffc3e7470 100644 (file)
@@ -205,7 +205,8 @@ asmlinkage void __init early_trap_c(struct pt_regs *fp, void *retaddr)
        if (likely(early_console == NULL))
                setup_early_printk(DEFAULT_EARLY_PORT);
 
-       dump_bfin_regs(fp, retaddr);
+       dump_bfin_mem((void *)fp->retx);
+       show_regs(fp);
        dump_bfin_trace_buffer();
 
        panic("Died early");
index 65c5ba4260b0042d078aac225960eedf48acef3f..65f4e67a65c4c0c3f0a8d2ad31ca12bee231e6ea 100644 (file)
@@ -54,9 +54,11 @@ ENTRY(_ret_from_fork)
        [sp + PT_IPEND] = r0;
        /* do a 'fake' RTI by jumping to [RETI]
         * to avoid clearing supervisor mode in child
-       */
+        */
+       r0 = [sp + PT_PC];
+       [sp + PT_P0] = r0;
+
        RESTORE_ALL_SYS
-       p0 = reti;
        jump (p0);
 ENDPROC(_ret_from_fork)
 
index d8b1ebc7099684d1dd46fea05cf4d94186fcd7df..90262691b11a299993108608e0ad63d19feb0a63 100644 (file)
@@ -129,4 +129,18 @@ ENTRY(_atomic_xor32)
        rts;
 ENDPROC (_atomic_ior32)
 
+.align 16
+       /*
+        * safe_user_instruction
+        * Four NOPS are enough to allow the pipeline to speculativily load
+        * execute anything it wants. After that, things have gone bad, and
+        * we are stuck - so panic. Since we might be in user space, we can't
+        * call panic, so just cause a unhandled exception, this should cause
+        * a dump of the trace buffer so we can tell were we are, and a reboot
+        */
+ENTRY(_safe_user_instruction)
+       NOP; NOP; NOP; NOP;
+       EXCPT 0x4;
+ENDPROC(_safe_user_instruction)
+
 ENTRY(_fixed_code_end)
index cb7ba9bfc79ca55be3d6127a49d1090d98db647c..5cf4bdb1df3bffdd09bea1bd295033345fddcfc9 100644 (file)
@@ -20,8 +20,7 @@
 #else
 # define tassert(expr) \
        if (!(expr)) \
-               printk(KERN_DEBUG "%s:%s:%i: Assertion failed: " #expr "\n", \
-                       __FILE__, __func__, __LINE__);
+               printk(KERN_DEBUG "%s:%s:%i: Assertion failed: " #expr "\n", __FILE__, __func__, __LINE__);
 #endif
 
 #define BFIN_TIMER_NUM_GROUP  (BFIN_TIMER_OCTET(MAX_BLACKFIN_GPTIMERS - 1) + 1)
@@ -70,7 +69,7 @@ static volatile GPTIMER_group_regs *const group_regs[BFIN_TIMER_NUM_GROUP] =
 #endif
 };
 
-static uint32_t const dis_mask[MAX_BLACKFIN_GPTIMERS] =
+static uint32_t const trun_mask[MAX_BLACKFIN_GPTIMERS] =
 {
        TIMER_STATUS_TRUN0,
        TIMER_STATUS_TRUN1,
@@ -90,7 +89,27 @@ static uint32_t const dis_mask[MAX_BLACKFIN_GPTIMERS] =
 #endif
 };
 
-static uint32_t const irq_mask[MAX_BLACKFIN_GPTIMERS] =
+static uint32_t const tovf_mask[MAX_BLACKFIN_GPTIMERS] =
+{
+       TIMER_STATUS_TOVF0,
+       TIMER_STATUS_TOVF1,
+       TIMER_STATUS_TOVF2,
+#if (MAX_BLACKFIN_GPTIMERS > 3)
+       TIMER_STATUS_TOVF3,
+       TIMER_STATUS_TOVF4,
+       TIMER_STATUS_TOVF5,
+       TIMER_STATUS_TOVF6,
+       TIMER_STATUS_TOVF7,
+#endif
+#if (MAX_BLACKFIN_GPTIMERS > 8)
+       TIMER_STATUS_TOVF8,
+       TIMER_STATUS_TOVF9,
+       TIMER_STATUS_TOVF10,
+       TIMER_STATUS_TOVF11,
+#endif
+};
+
+static uint32_t const timil_mask[MAX_BLACKFIN_GPTIMERS] =
 {
        TIMER_STATUS_TIMIL0,
        TIMER_STATUS_TIMIL1,
@@ -165,17 +184,31 @@ EXPORT_SYMBOL(set_gptimer_status);
 uint16_t get_gptimer_intr(int timer_id)
 {
        tassert(timer_id < MAX_BLACKFIN_GPTIMERS);
-       return (group_regs[BFIN_TIMER_OCTET(timer_id)]->status & irq_mask[timer_id]) ? 1 : 0;
+       return (group_regs[BFIN_TIMER_OCTET(timer_id)]->status & timil_mask[timer_id]) ? 1 : 0;
 }
 EXPORT_SYMBOL(get_gptimer_intr);
 
 void clear_gptimer_intr(int timer_id)
 {
        tassert(timer_id < MAX_BLACKFIN_GPTIMERS);
-       group_regs[BFIN_TIMER_OCTET(timer_id)]->status = irq_mask[timer_id];
+       group_regs[BFIN_TIMER_OCTET(timer_id)]->status = timil_mask[timer_id];
 }
 EXPORT_SYMBOL(clear_gptimer_intr);
 
+uint16_t get_gptimer_over(int timer_id)
+{
+       tassert(timer_id < MAX_BLACKFIN_GPTIMERS);
+       return (group_regs[BFIN_TIMER_OCTET(timer_id)]->status & tovf_mask[timer_id]) ? 1 : 0;
+}
+EXPORT_SYMBOL(get_gptimer_over);
+
+void clear_gptimer_over(int timer_id)
+{
+       tassert(timer_id < MAX_BLACKFIN_GPTIMERS);
+       group_regs[BFIN_TIMER_OCTET(timer_id)]->status = tovf_mask[timer_id];
+}
+EXPORT_SYMBOL(clear_gptimer_over);
+
 void set_gptimer_config(int timer_id, uint16_t config)
 {
        tassert(timer_id < MAX_BLACKFIN_GPTIMERS);
@@ -214,7 +247,7 @@ void disable_gptimers(uint16_t mask)
        }
        for (i = 0; i < MAX_BLACKFIN_GPTIMERS; ++i)
                if (mask & (1 << i))
-                       group_regs[BFIN_TIMER_OCTET(i)]->status |= dis_mask[i];
+                       group_regs[BFIN_TIMER_OCTET(i)]->status |= trun_mask[i];
        SSYNC();
 }
 EXPORT_SYMBOL(disable_gptimers);
index 9124467651c4a794659b147f37e874b603524521..5bf15125f0d6064fa14f6e5ce4b6cccd4847cd59 100644 (file)
@@ -134,27 +134,6 @@ void cpu_idle(void)
        }
 }
 
-void show_regs(struct pt_regs *regs)
-{
-       printk(KERN_NOTICE "\n");
-       printk(KERN_NOTICE
-              "PC: %08lu  Status: %04lu  SysStatus: %04lu  RETS: %08lu\n",
-              regs->pc, regs->astat, regs->seqstat, regs->rets);
-       printk(KERN_NOTICE
-              "A0.x: %08lx  A0.w: %08lx  A1.x: %08lx  A1.w: %08lx\n",
-              regs->a0x, regs->a0w, regs->a1x, regs->a1w);
-       printk(KERN_NOTICE "P0: %08lx  P1: %08lx  P2: %08lx  P3: %08lx\n",
-              regs->p0, regs->p1, regs->p2, regs->p3);
-       printk(KERN_NOTICE "P4: %08lx  P5: %08lx\n", regs->p4, regs->p5);
-       printk(KERN_NOTICE "R0: %08lx  R1: %08lx  R2: %08lx  R3: %08lx\n",
-              regs->r0, regs->r1, regs->r2, regs->r3);
-       printk(KERN_NOTICE "R4: %08lx  R5: %08lx  R6: %08lx  R7: %08lx\n",
-              regs->r4, regs->r5, regs->r6, regs->r7);
-
-       if (!regs->ipend)
-               printk(KERN_NOTICE "USP: %08lx\n", rdusp());
-}
-
 /* Fill in the fpu structure for a core dump.  */
 
 int dump_fpu(struct pt_regs *regs, elf_fpregset_t * fpregs)
@@ -238,51 +217,6 @@ copy_thread(int nr, unsigned long clone_flags,
        return 0;
 }
 
-/*
- * fill in the user structure for a core dump..
- */
-void dump_thread(struct pt_regs *regs, struct user *dump)
-{
-       dump->magic = CMAGIC;
-       dump->start_code = 0;
-       dump->start_stack = rdusp() & ~(PAGE_SIZE - 1);
-       dump->u_tsize = ((unsigned long)current->mm->end_code) >> PAGE_SHIFT;
-       dump->u_dsize = ((unsigned long)(current->mm->brk +
-                                        (PAGE_SIZE - 1))) >> PAGE_SHIFT;
-       dump->u_dsize -= dump->u_tsize;
-       dump->u_ssize = 0;
-
-       if (dump->start_stack < TASK_SIZE)
-               dump->u_ssize =
-                   ((unsigned long)(TASK_SIZE -
-                                    dump->start_stack)) >> PAGE_SHIFT;
-
-       dump->u_ar0 = (struct user_regs_struct *)((int)&dump->regs - (int)dump);
-
-       dump->regs.r0 = regs->r0;
-       dump->regs.r1 = regs->r1;
-       dump->regs.r2 = regs->r2;
-       dump->regs.r3 = regs->r3;
-       dump->regs.r4 = regs->r4;
-       dump->regs.r5 = regs->r5;
-       dump->regs.r6 = regs->r6;
-       dump->regs.r7 = regs->r7;
-       dump->regs.p0 = regs->p0;
-       dump->regs.p1 = regs->p1;
-       dump->regs.p2 = regs->p2;
-       dump->regs.p3 = regs->p3;
-       dump->regs.p4 = regs->p4;
-       dump->regs.p5 = regs->p5;
-       dump->regs.orig_p0 = regs->orig_p0;
-       dump->regs.a0w = regs->a0w;
-       dump->regs.a1w = regs->a1w;
-       dump->regs.a0x = regs->a0x;
-       dump->regs.a1x = regs->a1x;
-       dump->regs.rets = regs->rets;
-       dump->regs.astat = regs->astat;
-       dump->regs.pc = regs->pc;
-}
-
 /*
  * sys_execve() executes a new program.
  */
index f1b059e5a06cb171516804f441438011b26eaf11..d2822010b7ce4318ef2eed5446c9a7694fb10489 100644 (file)
@@ -43,6 +43,7 @@
 #include <asm/cacheflush.h>
 #include <asm/blackfin.h>
 #include <asm/cplbinit.h>
+#include <asm/div64.h>
 #include <asm/fixed_code.h>
 #include <asm/early_printk.h>
 
@@ -316,6 +317,15 @@ void __init setup_arch(char **cmdline_p)
 
        init_leds();
 
+       _bfin_swrst = bfin_read_SWRST();
+
+       if (_bfin_swrst & RESET_DOUBLE)
+               printk(KERN_INFO "Recovering from Double Fault event\n");
+       else if (_bfin_swrst & RESET_WDOG)
+               printk(KERN_INFO "Recovering from Watchdog event\n");
+       else if (_bfin_swrst & RESET_SOFTWARE)
+               printk(KERN_NOTICE "Reset caused by Software reset\n");
+
        printk(KERN_INFO "Blackfin support (C) 2004-2007 Analog Devices, Inc.\n");
        if (bfin_compiled_revid() == 0xffff)
                printk(KERN_INFO "Compiled for ADSP-%s Rev any\n", CPU);
@@ -402,8 +412,6 @@ void __init setup_arch(char **cmdline_p)
        if (l1_length > L1_DATA_A_LENGTH)
                panic("L1 data memory overflow\n");
 
-       _bfin_swrst = bfin_read_SWRST();
-
        /* Copy atomic sequences to their fixed location, and sanity check that
           these locations are the ones that we advertise to userspace.  */
        memcpy((void *)FIXED_CODE_START, &fixed_code_start,
@@ -424,6 +432,8 @@ void __init setup_arch(char **cmdline_p)
               != ATOMIC_AND32 - FIXED_CODE_START);
        BUG_ON((char *)&atomic_xor32 - (char *)&fixed_code_start
               != ATOMIC_XOR32 - FIXED_CODE_START);
+       BUG_ON((char *)&safe_user_instruction - (char *)&fixed_code_start
+               != SAFE_USER_INSTRUCTION - FIXED_CODE_START);
 
        init_exception_vectors();
        bf53x_cache_init();
@@ -495,13 +505,17 @@ EXPORT_SYMBOL(get_sclk);
 
 unsigned long sclk_to_usecs(unsigned long sclk)
 {
-       return (USEC_PER_SEC * (u64)sclk) / get_sclk();
+       u64 tmp = USEC_PER_SEC * (u64)sclk;
+       do_div(tmp, get_sclk());
+       return tmp;
 }
 EXPORT_SYMBOL(sclk_to_usecs);
 
 unsigned long usecs_to_sclk(unsigned long usecs)
 {
-       return (get_sclk() * (u64)usecs) / USEC_PER_SEC;
+       u64 tmp = get_sclk() * (u64)usecs;
+       do_div(tmp, USEC_PER_SEC);
+       return tmp;
 }
 EXPORT_SYMBOL(usecs_to_sclk);
 
index afd044e78af677ce483fe919408fd5cb98046bb3..21a55ef19cbd3d89fe8213a6f1ba442156584178 100644 (file)
 #include <asm/blackfin.h>
 #include <asm/irq_handler.h>
 #include <asm/trace.h>
+#include <asm/fixed_code.h>
 
 #ifdef CONFIG_KGDB
 # include <linux/debugger.h>
 # include <linux/kgdb.h>
+
+# define CHK_DEBUGGER_TRAP() \
+       do { \
+               CHK_DEBUGGER(trapnr, sig, info.si_code, fp, ); \
+       } while (0)
+# define CHK_DEBUGGER_TRAP_MAYBE() \
+       do { \
+               if (kgdb_connected) \
+                       CHK_DEBUGGER_TRAP(); \
+       } while (0)
+#else
+# define CHK_DEBUGGER_TRAP() do { } while (0)
+# define CHK_DEBUGGER_TRAP_MAYBE() do { } while (0)
 #endif
 
 /* Initiate the event table handler */
@@ -53,13 +67,13 @@ void __init trap_init(void)
 
 int kstack_depth_to_print = 48;
 
-#ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
-static int printk_address(unsigned long address)
+static void decode_address(char *buf, unsigned long address)
 {
        struct vm_list_struct *vml;
        struct task_struct *p;
        struct mm_struct *mm;
-       unsigned long offset;
+       unsigned long flags, offset;
+       unsigned int in_exception = bfin_read_IPEND() & 0x10;
 
 #ifdef CONFIG_KALLSYMS
        unsigned long symsize;
@@ -75,20 +89,33 @@ static int printk_address(unsigned long address)
                /* yeah! kernel space! */
                if (!modname)
                        modname = delim = "";
-               return printk("<0x%p> { %s%s%s%s + 0x%lx }",
+               sprintf(buf, "<0x%p> { %s%s%s%s + 0x%lx }",
                              (void *)address, delim, modname, delim, symname,
                              (unsigned long)offset);
+               return;
 
        }
 #endif
 
+       /* Problem in fixed code section? */
+       if (address >= FIXED_CODE_START && address < FIXED_CODE_END) {
+               sprintf(buf, "<0x%p> /* Maybe fixed code section */", (void *)address);
+               return;
+       }
+
+       /* Problem somewhere before the kernel start address */
+       if (address < CONFIG_BOOT_LOAD) {
+               sprintf(buf, "<0x%p> /* Maybe null pointer? */", (void *)address);
+               return;
+       }
+
        /* looks like we're off in user-land, so let's walk all the
         * mappings of all our processes and see if we can't be a whee
         * bit more specific
         */
-       write_lock_irq(&tasklist_lock);
+       write_lock_irqsave(&tasklist_lock, flags);
        for_each_process(p) {
-               mm = get_task_mm(p);
+               mm = (in_exception ? p->mm : get_task_mm(p));
                if (!mm)
                        continue;
 
@@ -117,27 +144,34 @@ static int printk_address(unsigned long address)
                                else
                                        offset = (address - vma->vm_start) + (vma->vm_pgoff << PAGE_SHIFT);
 
-                               write_unlock_irq(&tasklist_lock);
-                               mmput(mm);
-                               return printk("<0x%p> [ %s + 0x%lx ]",
-                                             (void *)address, name, offset);
+                               sprintf(buf, "<0x%p> [ %s + 0x%lx ]",
+                                       (void *)address, name, offset);
+                               if (!in_exception)
+                                       mmput(mm);
+                               goto done;
                        }
 
                        vml = vml->next;
                }
-               mmput(mm);
+               if (!in_exception)
+                       mmput(mm);
        }
-       write_unlock_irq(&tasklist_lock);
 
        /* we were unable to find this address anywhere */
-       return printk("[<0x%p>]", (void *)address);
+       sprintf(buf, "<0x%p> /* unknown address */", (void *)address);
+
+done:
+       write_unlock_irqrestore(&tasklist_lock, flags);
 }
-#endif
 
 asmlinkage void double_fault_c(struct pt_regs *fp)
 {
+       console_verbose();
+       oops_in_progress = 1;
        printk(KERN_EMERG "\n" KERN_EMERG "Double Fault\n");
-       dump_bfin_regs(fp, (void *)fp->retx);
+       dump_bfin_process(fp);
+       dump_bfin_mem((void *)fp->retx);
+       show_regs(fp);
        panic("Double Fault - unrecoverable event\n");
 
 }
@@ -151,22 +185,29 @@ asmlinkage void trap_c(struct pt_regs *fp)
        siginfo_t info;
        unsigned long trapnr = fp->seqstat & SEQSTAT_EXCAUSE;
 
+       trace_buffer_save(j);
+
+       /* Important - be very careful dereferncing pointers - will lead to
+        * double faults if the stack has become corrupt
+        */
+
+       /* If the fault was caused by a kernel thread, or interrupt handler
+        * we will kernel panic, so the system reboots.
+        * If KGDB is enabled, don't set this for kernel breakpoints
+       */
+       if ((bfin_read_IPEND() & 0xFFC0)
 #ifdef CONFIG_KGDB
-# define CHK_DEBUGGER_TRAP() \
-       do { \
-               CHK_DEBUGGER(trapnr, sig, info.si_code, fp, ); \
-       } while (0)
-# define CHK_DEBUGGER_TRAP_MAYBE() \
-       do { \
-               if (kgdb_connected) \
-                       CHK_DEBUGGER_TRAP(); \
-       } while (0)
-#else
-# define CHK_DEBUGGER_TRAP() do { } while (0)
-# define CHK_DEBUGGER_TRAP_MAYBE() do { } while (0)
+               && trapnr != VEC_EXCPT02
 #endif
-
-       trace_buffer_save(j);
+       ){
+               console_verbose();
+               oops_in_progress = 1;
+       } else if (current) {
+               if (current->mm == NULL) {
+                       console_verbose();
+                       oops_in_progress = 1;
+               }
+       }
 
        /* trap_c() will be called for exceptions. During exceptions
         * processing, the pc value should be set with retx value.
@@ -211,7 +252,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
        case VEC_EXCPT03:
                info.si_code = SEGV_STACKFLOW;
                sig = SIGSEGV;
-               printk(KERN_EMERG EXC_0x03);
+               printk(KERN_NOTICE EXC_0x03(KERN_NOTICE));
                CHK_DEBUGGER_TRAP();
                break;
        /* 0x04 - User Defined, Caught by default */
@@ -240,7 +281,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
        case VEC_OVFLOW:
                info.si_code = TRAP_TRACEFLOW;
                sig = SIGTRAP;
-               printk(KERN_EMERG EXC_0x11);
+               printk(KERN_NOTICE EXC_0x11(KERN_NOTICE));
                CHK_DEBUGGER_TRAP();
                break;
        /* 0x12 - Reserved, Caught by default */
@@ -262,36 +303,35 @@ asmlinkage void trap_c(struct pt_regs *fp)
        case VEC_UNDEF_I:
                info.si_code = ILL_ILLOPC;
                sig = SIGILL;
-               printk(KERN_EMERG EXC_0x21);
+               printk(KERN_NOTICE EXC_0x21(KERN_NOTICE));
                CHK_DEBUGGER_TRAP();
                break;
        /* 0x22 - Illegal Instruction Combination, handled here */
        case VEC_ILGAL_I:
                info.si_code = ILL_ILLPARAOP;
                sig = SIGILL;
-               printk(KERN_EMERG EXC_0x22);
+               printk(KERN_NOTICE EXC_0x22(KERN_NOTICE));
                CHK_DEBUGGER_TRAP();
                break;
-       /* 0x23 - Data CPLB Protection Violation,
-                normal case is handled in _cplb_hdr */
+       /* 0x23 - Data CPLB protection violation, handled here */
        case VEC_CPLB_VL:
                info.si_code = ILL_CPLB_VI;
-               sig = SIGILL;
-               printk(KERN_EMERG EXC_0x23);
+               sig = SIGBUS;
+               printk(KERN_NOTICE EXC_0x23(KERN_NOTICE));
                CHK_DEBUGGER_TRAP();
                break;
        /* 0x24 - Data access misaligned, handled here */
        case VEC_MISALI_D:
                info.si_code = BUS_ADRALN;
                sig = SIGBUS;
-               printk(KERN_EMERG EXC_0x24);
+               printk(KERN_NOTICE EXC_0x24(KERN_NOTICE));
                CHK_DEBUGGER_TRAP();
                break;
        /* 0x25 - Unrecoverable Event, handled here */
        case VEC_UNCOV:
                info.si_code = ILL_ILLEXCPT;
                sig = SIGILL;
-               printk(KERN_EMERG EXC_0x25);
+               printk(KERN_NOTICE EXC_0x25(KERN_NOTICE));
                CHK_DEBUGGER_TRAP();
                break;
        /* 0x26 - Data CPLB Miss, normal case is handled in _cplb_hdr,
@@ -299,7 +339,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
        case VEC_CPLB_M:
                info.si_code = BUS_ADRALN;
                sig = SIGBUS;
-               printk(KERN_EMERG EXC_0x26);
+               printk(KERN_NOTICE EXC_0x26(KERN_NOTICE));
                CHK_DEBUGGER_TRAP();
                break;
        /* 0x27 - Data CPLB Multiple Hits - Linux Trap Zero, handled here */
@@ -307,11 +347,10 @@ asmlinkage void trap_c(struct pt_regs *fp)
                info.si_code = ILL_CPLB_MULHIT;
 #ifdef CONFIG_DEBUG_HUNT_FOR_ZERO
                sig = SIGSEGV;
-               printk(KERN_EMERG "\n"
-                       KERN_EMERG "NULL pointer access (probably)\n");
+               printk(KERN_NOTICE "NULL pointer access (probably)\n");
 #else
                sig = SIGILL;
-               printk(KERN_EMERG EXC_0x27);
+               printk(KERN_NOTICE EXC_0x27(KERN_NOTICE));
 #endif
                CHK_DEBUGGER_TRAP();
                break;
@@ -319,7 +358,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
        case VEC_WATCH:
                info.si_code = TRAP_WATCHPT;
                sig = SIGTRAP;
-               pr_debug(EXC_0x28);
+               pr_debug(EXC_0x28(KERN_DEBUG));
                CHK_DEBUGGER_TRAP_MAYBE();
                /* Check if this is a watchpoint in kernel space */
                if (fp->ipend & 0xffc0)
@@ -331,7 +370,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
        case VEC_ISTRU_VL:      /* ADSP-BF535 only (MH) */
                info.si_code = BUS_OPFETCH;
                sig = SIGBUS;
-               printk(KERN_EMERG "BF535: VEC_ISTRU_VL\n");
+               printk(KERN_NOTICE "BF535: VEC_ISTRU_VL\n");
                CHK_DEBUGGER_TRAP();
                break;
 #else
@@ -341,22 +380,21 @@ asmlinkage void trap_c(struct pt_regs *fp)
        case VEC_MISALI_I:
                info.si_code = BUS_ADRALN;
                sig = SIGBUS;
-               printk(KERN_EMERG EXC_0x2A);
+               printk(KERN_NOTICE EXC_0x2A(KERN_NOTICE));
                CHK_DEBUGGER_TRAP();
                break;
-       /* 0x2B - Instruction CPLB protection Violation,
-               handled in _cplb_hdr */
+       /* 0x2B - Instruction CPLB protection violation, handled here */
        case VEC_CPLB_I_VL:
                info.si_code = ILL_CPLB_VI;
-               sig = SIGILL;
-               printk(KERN_EMERG EXC_0x2B);
+               sig = SIGBUS;
+               printk(KERN_NOTICE EXC_0x2B(KERN_NOTICE));
                CHK_DEBUGGER_TRAP();
                break;
        /* 0x2C - Instruction CPLB miss, handled in _cplb_hdr */
        case VEC_CPLB_I_M:
                info.si_code = ILL_CPLB_MISS;
                sig = SIGBUS;
-               printk(KERN_EMERG EXC_0x2C);
+               printk(KERN_NOTICE EXC_0x2C(KERN_NOTICE));
                CHK_DEBUGGER_TRAP();
                break;
        /* 0x2D - Instruction CPLB Multiple Hits, handled here */
@@ -364,10 +402,10 @@ asmlinkage void trap_c(struct pt_regs *fp)
                info.si_code = ILL_CPLB_MULHIT;
 #ifdef CONFIG_DEBUG_HUNT_FOR_ZERO
                sig = SIGSEGV;
-               printk(KERN_EMERG "\n\nJump to address 0 - 0x0fff\n");
+               printk(KERN_NOTICE "Jump to address 0 - 0x0fff\n");
 #else
                sig = SIGILL;
-               printk(KERN_EMERG EXC_0x2D);
+               printk(KERN_NOTICE EXC_0x2D(KERN_NOTICE));
 #endif
                CHK_DEBUGGER_TRAP();
                break;
@@ -375,7 +413,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
        case VEC_ILL_RES:
                info.si_code = ILL_PRVOPC;
                sig = SIGILL;
-               printk(KERN_EMERG EXC_0x2E);
+               printk(KERN_NOTICE EXC_0x2E(KERN_NOTICE));
                CHK_DEBUGGER_TRAP();
                break;
        /* 0x2F - Reserved, Caught by default */
@@ -404,37 +442,44 @@ asmlinkage void trap_c(struct pt_regs *fp)
                break;
        }
 
-       if (sig != 0 && sig != SIGTRAP) {
+       BUG_ON(sig == 0);
+
+       if (sig != SIGTRAP) {
                unsigned long stack;
-               dump_bfin_regs(fp, (void *)fp->retx);
-               dump_bfin_trace_buffer();
+               dump_bfin_process(fp);
+               dump_bfin_mem((void *)fp->retx);
+               show_regs(fp);
+
+               /* Print out the trace buffer if it makes sense */
+#ifndef CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE
+               if (trapnr == VEC_CPLB_I_M || trapnr == VEC_CPLB_M)
+                       printk(KERN_NOTICE "No trace since you do not have "
+                               "CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE enabled\n"
+                               KERN_NOTICE "\n");
+               else
+#endif
+                       dump_bfin_trace_buffer();
                show_stack(current, &stack);
-               if (current->mm == NULL)
+               if (oops_in_progress) {
+#ifndef CONFIG_ACCESS_CHECK
+                       printk(KERN_EMERG "Please turn on "
+                              "CONFIG_ACCESS_CHECK\n");
+#endif
                        panic("Kernel exception");
+               }
        }
+
        info.si_signo = sig;
        info.si_errno = 0;
        info.si_addr = (void *)fp->pc;
        force_sig_info(sig, &info, current);
 
-       /* if the address that we are about to return to is not valid, set it
-        * to a valid address, if we have a current application or panic
+       /* Ensure that bad return addresses don't end up in an infinite
+        * loop, due to speculative loads/reads. This needs to be done after
+        * the signal has been sent.
         */
-       if (!(fp->pc <= physical_mem_end
-#if L1_CODE_LENGTH != 0
-           || (fp->pc >= L1_CODE_START &&
-               fp->pc <= (L1_CODE_START + L1_CODE_LENGTH))
-#endif
-       )) {
-               if (current->mm) {
-                       fp->pc = current->mm->start_code;
-               } else {
-                       printk(KERN_EMERG
-                               "I can't return to memory that doesn't exist"
-                               " - bad things happen\n");
-                       panic("Help - I've fallen and can't get up\n");
-               }
-       }
+       if (trapnr == VEC_CPLB_I_M && sig != SIGTRAP)
+               fp->pc = SAFE_USER_INSTRUCTION;
 
        trace_buffer_restore(j);
        return;
@@ -448,21 +493,21 @@ void dump_bfin_trace_buffer(void)
 {
 #ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
        int tflags, i = 0;
+       char buf[150];
 #ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
        int j, index;
 #endif
 
        trace_buffer_save(tflags);
 
-       printk(KERN_EMERG "Hardware Trace:\n");
+       printk(KERN_NOTICE "Hardware Trace:\n");
 
        if (likely(bfin_read_TBUFSTAT() & TBUFCNT)) {
                for (; bfin_read_TBUFSTAT() & TBUFCNT; i++) {
-                       printk(KERN_EMERG "%4i Target : ", i);
-                       printk_address((unsigned long)bfin_read_TBUF());
-                       printk("\n" KERN_EMERG "     Source : ");
-                       printk_address((unsigned long)bfin_read_TBUF());
-                       printk("\n");
+                       decode_address(buf, (unsigned long)bfin_read_TBUF());
+                       printk(KERN_NOTICE "%4i Target : %s\n", i, buf);
+                       decode_address(buf, (unsigned long)bfin_read_TBUF());
+                       printk(KERN_NOTICE "     Source : %s\n", buf);
                }
        }
 
@@ -474,17 +519,16 @@ void dump_bfin_trace_buffer(void)
 
        j = (1 << CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN) * 128;
        while (j) {
-               printk(KERN_EMERG "%4i Target : ", i);
-               printk_address(software_trace_buff[index]);
+               decode_address(buf, software_trace_buff[index]);
+               printk(KERN_NOTICE "%4i Target : %s\n", i, buf);
                index -= 1;
                if (index < 0 )
                        index = EXPAND_LEN;
-               printk("\n" KERN_EMERG "     Source : ");
-               printk_address(software_trace_buff[index]);
+               decode_address(buf, software_trace_buff[index]);
+               printk(KERN_NOTICE "     Source : %s\n", buf);
                index -= 1;
                if (index < 0)
                        index = EXPAND_LEN;
-               printk("\n");
                j--;
                i++;
        }
@@ -499,10 +543,7 @@ static void show_trace(struct task_struct *tsk, unsigned long *sp)
 {
        unsigned long addr;
 
-       printk("\nCall Trace:");
-#ifdef CONFIG_KALLSYMS
-       printk("\n");
-#endif
+       printk(KERN_NOTICE "\n" KERN_NOTICE "Call Trace:\n");
 
        while (!kstack_end(sp)) {
                addr = *sp++;
@@ -518,7 +559,7 @@ static void show_trace(struct task_struct *tsk, unsigned long *sp)
                        print_ip_sym(addr);
        }
 
-       printk("\n");
+       printk(KERN_NOTICE "\n");
 }
 
 void show_stack(struct task_struct *task, unsigned long *stack)
@@ -540,14 +581,15 @@ void show_stack(struct task_struct *task, unsigned long *stack)
        addr = (unsigned long)stack;
        endstack = (unsigned long *)PAGE_ALIGN(addr);
 
-       printk(KERN_EMERG "Stack from %08lx:", (unsigned long)stack);
+       printk(KERN_NOTICE "Stack from %08lx:", (unsigned long)stack);
        for (i = 0; i < kstack_depth_to_print; i++) {
                if (stack + 1 > endstack)
                        break;
                if (i % 8 == 0)
-                       printk("\n" KERN_EMERG "       ");
+                       printk("\n" KERN_NOTICE "       ");
                printk(" %08lx", *stack++);
        }
+       printk("\n");
 
        show_trace(task, stack);
 }
@@ -563,38 +605,50 @@ void dump_stack(void)
        show_stack(current, &stack);
        trace_buffer_restore(tflags);
 }
-
 EXPORT_SYMBOL(dump_stack);
 
-void dump_bfin_regs(struct pt_regs *fp, void *retaddr)
+void dump_bfin_process(struct pt_regs *fp)
 {
-       if (current->pid) {
-               printk(KERN_EMERG "\n" KERN_EMERG "CURRENT PROCESS:\n"
-                       KERN_EMERG "\n");
-               printk(KERN_EMERG "COMM=%s PID=%d\n",
+       /* We should be able to look at fp->ipend, but we don't push it on the
+        * stack all the time, so do this until we fix that */
+       unsigned int context = bfin_read_IPEND();
+
+       if (oops_in_progress)
+               printk(KERN_EMERG "Kernel OOPS in progress\n");
+
+       if (context & 0x0020)
+               printk(KERN_NOTICE "Deferred excecption or HW Error context\n");
+       else if (context & 0x3FC0)
+               printk(KERN_NOTICE "Interrupt context\n");
+       else if (context & 0x4000)
+               printk(KERN_NOTICE "Deferred Interrupt context\n");
+       else if (context & 0x8000)
+               printk(KERN_NOTICE "Kernel process context\n");
+
+       if (current->pid && current->mm) {
+               printk(KERN_NOTICE "CURRENT PROCESS:\n");
+               printk(KERN_NOTICE "COMM=%s PID=%d\n",
                        current->comm, current->pid);
-       } else {
-               printk
-                   (KERN_EMERG "\n" KERN_EMERG
-                    "No Valid pid - Either things are really messed up,"
-                    " or you are in the kernel\n");
-       }
 
-       if (current->mm) {
-               printk(KERN_EMERG "TEXT = 0x%p-0x%p  DATA = 0x%p-0x%p\n"
-                      KERN_EMERG "BSS = 0x%p-0x%p   USER-STACK = 0x%p\n"
-                      KERN_EMERG "\n",
-                      (void *)current->mm->start_code,
-                      (void *)current->mm->end_code,
-                      (void *)current->mm->start_data,
-                      (void *)current->mm->end_data,
-                      (void *)current->mm->end_data,
-                      (void *)current->mm->brk,
-                      (void *)current->mm->start_stack);
-       }
+               printk(KERN_NOTICE "TEXT = 0x%p-0x%p  DATA = 0x%p-0x%p\n"
+                       KERN_NOTICE "BSS = 0x%p-0x%p   USER-STACK = 0x%p\n"
+                       KERN_NOTICE "\n",
+                       (void *)current->mm->start_code,
+                       (void *)current->mm->end_code,
+                       (void *)current->mm->start_data,
+                       (void *)current->mm->end_data,
+                       (void *)current->mm->end_data,
+                       (void *)current->mm->brk,
+                       (void *)current->mm->start_stack);
+       } else
+               printk(KERN_NOTICE "\n" KERN_NOTICE
+                    "No Valid process in current context\n");
+}
 
-       printk(KERN_EMERG "return address: [0x%p]; contents of:", retaddr);
-       if (retaddr != 0 && retaddr <= (void *)physical_mem_end
+void dump_bfin_mem(void *retaddr)
+{
+
+       if (retaddr >= (void *)FIXED_CODE_START  && retaddr < (void *)physical_mem_end
 #if L1_CODE_LENGTH != 0
            /* FIXME: Copy the code out of L1 Instruction SRAM through dma
               memcpy.  */
@@ -604,18 +658,20 @@ void dump_bfin_regs(struct pt_regs *fp, void *retaddr)
        ) {
                int i = ((unsigned int)retaddr & 0xFFFFFFF0) - 32;
                unsigned short x = 0;
+               printk(KERN_NOTICE "return address: [0x%p]; contents of:", retaddr);
                for (; i < ((unsigned int)retaddr & 0xFFFFFFF0) + 32; i += 2) {
                        if (!(i & 0xF))
-                               printk("\n" KERN_EMERG "0x%08x: ", i);
+                               printk("\n" KERN_NOTICE "0x%08x: ", i);
 
                        if (get_user(x, (unsigned short *)i))
                                break;
 #ifndef CONFIG_DEBUG_HWERR
                        /* If one of the last few instructions was a STI
                         * it is likely that the error occured awhile ago
-                        * and we just noticed
+                        * and we just noticed. This only happens in kernel
+                        * context, which should mean an oops is happening
                         */
-                       if (x >= 0x0040 && x <= 0x0047 && i <= 0)
+                       if (oops_in_progress && x >= 0x0040 && x <= 0x0047 && i <= 0)
                                panic("\n\nWARNING : You should reconfigure"
                                        " the kernel to turn on\n"
                                        " 'Hardware error interrupt"
@@ -628,56 +684,67 @@ void dump_bfin_regs(struct pt_regs *fp, void *retaddr)
                        else
                                printk(" %04x ", x);
                }
-               printk("\n" KERN_EMERG "\n");
+               printk("\n");
        } else
-               printk(KERN_EMERG
-                       "Cannot look at the [PC] for it is"
-                       "in unreadable L1 SRAM - sorry\n");
-
-
-       printk(KERN_EMERG
-               "RETE:  %08lx  RETN: %08lx  RETX: %08lx  RETS: %08lx\n",
-               fp->rete, fp->retn, fp->retx, fp->rets);
-       printk(KERN_EMERG "IPEND: %04lx  SYSCFG: %04lx\n",
-               fp->ipend, fp->syscfg);
-       printk(KERN_EMERG "SEQSTAT: %08lx    SP: %08lx\n",
-               (long)fp->seqstat, (long)fp);
-       printk(KERN_EMERG "R0: %08lx    R1: %08lx    R2: %08lx    R3: %08lx\n",
+               printk("\n" KERN_NOTICE
+                       "Cannot look at the [PC] <%p> for it is"
+                       " in unreadable memory - sorry\n", retaddr);
+}
+
+void show_regs(struct pt_regs *fp)
+{
+       char buf [150];
+
+       printk(KERN_NOTICE "\n" KERN_NOTICE "SEQUENCER STATUS:\n");
+       printk(KERN_NOTICE " SEQSTAT: %08lx  IPEND: %04lx  SYSCFG: %04lx\n",
+               (long)fp->seqstat, fp->ipend, fp->syscfg);
+
+       decode_address(buf, fp->rete);
+       printk(KERN_NOTICE " RETE: %s\n", buf);
+       decode_address(buf, fp->retn);
+       printk(KERN_NOTICE " RETN: %s\n", buf);
+       decode_address(buf, fp->retx);
+       printk(KERN_NOTICE " RETX: %s\n", buf);
+       decode_address(buf, fp->rets);
+       printk(KERN_NOTICE " RETS: %s\n", buf);
+       decode_address(buf, fp->pc);
+       printk(KERN_NOTICE " PC: %s\n", buf);
+
+       if ((long)fp->seqstat & SEQSTAT_EXCAUSE) {
+               decode_address(buf, bfin_read_DCPLB_FAULT_ADDR());
+               printk(KERN_NOTICE "DCPLB_FAULT_ADDR: %s\n", buf);
+               decode_address(buf, bfin_read_ICPLB_FAULT_ADDR());
+               printk(KERN_NOTICE "ICPLB_FAULT_ADDR: %s\n", buf);
+       }
+
+       printk(KERN_NOTICE "\n" KERN_NOTICE "PROCESSOR STATE:\n");
+       printk(KERN_NOTICE " R0 : %08lx    R1 : %08lx    R2 : %08lx    R3 : %08lx\n",
                fp->r0, fp->r1, fp->r2, fp->r3);
-       printk(KERN_EMERG "R4: %08lx    R5: %08lx    R6: %08lx    R7: %08lx\n",
+       printk(KERN_NOTICE " R4 : %08lx    R5 : %08lx    R6 : %08lx    R7 : %08lx\n",
                fp->r4, fp->r5, fp->r6, fp->r7);
-       printk(KERN_EMERG "P0: %08lx    P1: %08lx    P2: %08lx    P3: %08lx\n",
+       printk(KERN_NOTICE " P0 : %08lx    P1 : %08lx    P2 : %08lx    P3 : %08lx\n",
                fp->p0, fp->p1, fp->p2, fp->p3);
-       printk(KERN_EMERG
-               "P4: %08lx    P5: %08lx    FP: %08lx\n",
-               fp->p4, fp->p5, fp->fp);
-       printk(KERN_EMERG
-               "A0.w: %08lx    A0.x: %08lx    A1.w: %08lx    A1.x: %08lx\n",
-               fp->a0w, fp->a0x, fp->a1w, fp->a1x);
-
-       printk(KERN_EMERG "LB0: %08lx  LT0: %08lx  LC0: %08lx\n",
+       printk(KERN_NOTICE " P4 : %08lx    P5 : %08lx    FP : %08lx    SP : %08lx\n",
+               fp->p4, fp->p5, fp->fp, (long)fp);
+       printk(KERN_NOTICE " LB0: %08lx    LT0: %08lx    LC0: %08lx\n",
                fp->lb0, fp->lt0, fp->lc0);
-       printk(KERN_EMERG "LB1: %08lx  LT1: %08lx  LC1: %08lx\n",
+       printk(KERN_NOTICE " LB1: %08lx    LT1: %08lx    LC1: %08lx\n",
                fp->lb1, fp->lt1, fp->lc1);
-       printk(KERN_EMERG "B0: %08lx  L0: %08lx  M0: %08lx  I0: %08lx\n",
+       printk(KERN_NOTICE " B0 : %08lx    L0 : %08lx    M0 : %08lx    I0 : %08lx\n",
                fp->b0, fp->l0, fp->m0, fp->i0);
-       printk(KERN_EMERG "B1: %08lx  L1: %08lx  M1: %08lx  I1: %08lx\n",
+       printk(KERN_NOTICE " B1 : %08lx    L1 : %08lx    M1 : %08lx    I1 : %08lx\n",
                fp->b1, fp->l1, fp->m1, fp->i1);
-       printk(KERN_EMERG "B2: %08lx  L2: %08lx  M2: %08lx  I2: %08lx\n",
+       printk(KERN_NOTICE " B2 : %08lx    L2 : %08lx    M2 : %08lx    I2 : %08lx\n",
                fp->b2, fp->l2, fp->m2, fp->i2);
-       printk(KERN_EMERG "B3: %08lx  L3: %08lx  M3: %08lx  I3: %08lx\n",
+       printk(KERN_NOTICE " B3 : %08lx    L3 : %08lx    M3 : %08lx    I3 : %08lx\n",
                fp->b3, fp->l3, fp->m3, fp->i3);
+       printk(KERN_NOTICE "A0.w: %08lx   A0.x: %08lx   A1.w: %08lx   A1.x: %08lx\n",
+               fp->a0w, fp->a0x, fp->a1w, fp->a1x);
 
-       printk(KERN_EMERG "\n" KERN_EMERG "USP: %08lx   ASTAT: %08lx\n",
+       printk(KERN_NOTICE "USP : %08lx  ASTAT: %08lx\n",
                rdusp(), fp->astat);
-       if ((long)fp->seqstat & SEQSTAT_EXCAUSE) {
-               printk(KERN_EMERG "DCPLB_FAULT_ADDR=%p\n",
-                       (void *)bfin_read_DCPLB_FAULT_ADDR());
-               printk(KERN_EMERG "ICPLB_FAULT_ADDR=%p\n",
-                       (void *)bfin_read_ICPLB_FAULT_ADDR());
-       }
 
-       printk("\n\n");
+       printk(KERN_NOTICE "\n");
 }
 
 #ifdef CONFIG_SYS_BFIN_SPINLOCK_L1
@@ -752,9 +819,13 @@ void panic_cplb_error(int cplb_panic, struct pt_regs *fp)
                break;
        }
 
+       oops_in_progress = 1;
+
        printk(KERN_EMERG "DCPLB_FAULT_ADDR=%p\n", (void *)bfin_read_DCPLB_FAULT_ADDR());
        printk(KERN_EMERG "ICPLB_FAULT_ADDR=%p\n", (void *)bfin_read_ICPLB_FAULT_ADDR());
-       dump_bfin_regs(fp, (void *)fp->retx);
+       dump_bfin_process(fp);
+       dump_bfin_mem((void *)fp->retx);
+       show_regs(fp);
        dump_stack();
        panic("Unrecoverable event\n");
 }
index eec43674a46589a05411566d009ccc585e699904..9b75bc83c71fac9847cd8e0f578183dbfb87115c 100644 (file)
@@ -172,9 +172,14 @@ SECTIONS
                __ebss_b_l1 = .;
        }
 
-       ___init_end = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1);
-
-       .bss LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1) :
+       /* Force trailing alignment of our init section so that when we
+        * free our init memory, we don't leave behind a partial page.
+        */
+       . = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1);
+       . = ALIGN(PAGE_SIZE);
+       ___init_end = .;
+
+       .bss :
        {
                . = ALIGN(4);
                ___bss_start = .;
index bfdad52c570b9864824738247381a5e1408c5f5f..635288fc5f5432c2d3d89d1226968c8bd7077c72 100644 (file)
@@ -4,7 +4,7 @@
 
 lib-y := \
        ashldi3.o ashrdi3.o lshrdi3.o \
-       muldi3.o divsi3.o udivsi3.o udivdi3.o modsi3.o umodsi3.o \
+       muldi3.o divsi3.o udivsi3.o modsi3.o umodsi3.o \
        checksum.o memcpy.o memset.o memcmp.o memchr.o memmove.o \
        strcmp.o strcpy.o strncmp.o strncpy.o \
        umulsi3_highpart.o smulsi3_highpart.o \
index a17cc77ac36f2faefcf9ffa8d214691aa7682f2d..df7b8833a0c56abf7a5a4ad6df43253f006331c8 100644 (file)
@@ -77,3 +77,22 @@ ENTRY(_insb)
        sti R3;
        RTS;
 ENDPROC(_insb)
+
+
+
+ENTRY(_insl_16)
+       P0 = R0;        /* P0 = port */
+       cli R3;
+       P1 = R1;        /* P1 = address */
+       P2 = R2;        /* P2 = count */
+       SSYNC;
+       LSETUP( .Llong16_loop_s, .Llong16_loop_e) LC0 = P2;
+.Llong16_loop_s:  R0 = [P0];
+                 W[P1++] = R0;
+                 R0 = R0 >> 16;
+                 W[P1++] = R0;
+                 NOP;
+.Llong16_loop_e:  NOP;
+       sti R3;
+       RTS;
+ENDPROC(_insl_16)
index 4eeefd86907f0ff460f04768b6eaf2c90b97bb52..fde39a1950ce8903124831d8758692cad384f648 100644 (file)
@@ -1,10 +1,19 @@
-#include <linux/types.h>
+/*
+ * Provide symbol in case str func is not inlined.
+ *
+ * Copyright (c) 2006-2007 Analog Devices Inc.
+ *
+ * Licensed under the GPL-2 or later.
+ */
 
 #define strcmp __inline_strcmp
 #include <asm/string.h>
 #undef strcmp
 
+#include <linux/module.h>
+
 int strcmp(const char *dest, const char *src)
 {
        return __inline_strcmp(dest, src);
 }
+EXPORT_SYMBOL(strcmp);
index 534589db725619797bb44c51fe296ea8fbea9bde..2a8836b1f4d37abf3700693d39f8cccbf93c2fe7 100644 (file)
@@ -1,10 +1,19 @@
-#include <linux/types.h>
+/*
+ * Provide symbol in case str func is not inlined.
+ *
+ * Copyright (c) 2006-2007 Analog Devices Inc.
+ *
+ * Licensed under the GPL-2 or later.
+ */
 
 #define strcpy __inline_strcpy
 #include <asm/string.h>
 #undef strcpy
 
+#include <linux/module.h>
+
 char *strcpy(char *dest, const char *src)
 {
        return __inline_strcpy(dest, src);
 }
+EXPORT_SYMBOL(strcpy);
index d791f120bff7388252f3add58d20aade76cc03b2..2aaae78a68e0ae3ef345442b2467d30dd50c82ab 100644 (file)
@@ -1,10 +1,19 @@
-#include <linux/types.h>
+/*
+ * Provide symbol in case str func is not inlined.
+ *
+ * Copyright (c) 2006-2007 Analog Devices Inc.
+ *
+ * Licensed under the GPL-2 or later.
+ */
 
 #define strncmp __inline_strncmp
 #include <asm/string.h>
 #undef strncmp
 
+#include <linux/module.h>
+
 int strncmp(const char *cs, const char *ct, size_t count)
 {
        return __inline_strncmp(cs, ct, count);
 }
+EXPORT_SYMBOL(strncmp);
index 1fecb5c71ffb21ec581d157b81ef2d2d8776bc8c..ea1dc6bf2373c7a6a3485706ef11c47f07a2fcc5 100644 (file)
@@ -1,10 +1,19 @@
-#include <linux/types.h>
+/*
+ * Provide symbol in case str func is not inlined.
+ *
+ * Copyright (c) 2006-2007 Analog Devices Inc.
+ *
+ * Licensed under the GPL-2 or later.
+ */
 
 #define strncpy __inline_strncpy
 #include <asm/string.h>
 #undef strncpy
 
+#include <linux/module.h>
+
 char *strncpy(char *dest, const char *src, size_t n)
 {
        return __inline_strncpy(dest, src, n);
 }
+EXPORT_SYMBOL(strncpy);
diff --git a/arch/blackfin/lib/udivdi3.S b/arch/blackfin/lib/udivdi3.S
deleted file mode 100644 (file)
index ad1ebee..0000000
+++ /dev/null
@@ -1,375 +0,0 @@
-/*
- * udivdi3.S - unsigned long long division
- *
- * Copyright 2003-2007 Analog Devices Inc.
- * Enter bugs at http://blackfin.uclinux.org/
- *
- * Licensed under the GPLv2 or later.
- */
-
-#include <linux/linkage.h>
-
-#define CARRY AC0
-
-#ifdef CONFIG_ARITHMETIC_OPS_L1
-.section .l1.text
-#else
-.text
-#endif
-
-
-ENTRY(___udivdi3)
-   R3 = [SP + 12];
-   [--SP] = (R7:4, P5:3);
-
-   /* Attempt to use divide primitive first; these will handle
-   **  most cases, and they're quick - avoids stalls incurred by
-   ** testing for identities.
-   */
-
-   R4 = R2 | R3;
-   CC = R4 == 0;
-   IF CC JUMP .LDIV_BY_ZERO;
-
-   R4.H = 0x8000;
-   R4 >>>= 16;                  // R4 now 0xFFFF8000
-   R5 = R0 | R2;                // If either dividend or
-   R4 = R5 & R4;                // divisor have bits in
-   CC = R4;                     // top half or low half's sign
-   IF CC JUMP .LIDENTS;          // bit, skip builtins.
-   R4 = R1 | R3;                // Also check top halves
-   CC = R4;
-   IF CC JUMP .LIDENTS;
-
-   /* Can use the builtins. */
-
-   AQ = CC;                     // Clear AQ (CC==0)
-   DIVQ(R0, R2);
-   DIVQ(R0, R2);
-   DIVQ(R0, R2);
-   DIVQ(R0, R2);
-   DIVQ(R0, R2);
-   DIVQ(R0, R2);
-   DIVQ(R0, R2);
-   DIVQ(R0, R2);
-   DIVQ(R0, R2);
-   DIVQ(R0, R2);
-   DIVQ(R0, R2);
-   DIVQ(R0, R2);
-   DIVQ(R0, R2);
-   DIVQ(R0, R2);
-   DIVQ(R0, R2);
-   DIVQ(R0, R2);
-   DIVQ(R0, R2);
-   R0 = R0.L (Z);
-   R1 = 0;
-   (R7:4, P5:3) = [SP++];
-   RTS;
-
-.LIDENTS:
-   /* Test for common identities. Value to be returned is
-   ** placed in R6,R7.
-   */
-                                // Check for 0/y, return 0
-   R4 = R0 | R1;
-   CC = R4 == 0;
-   IF CC JUMP .LRETURN_R0;
-
-                                // Check for x/x, return 1
-   R6 = R0 - R2;                // If x == y, then both R6 and R7 will be zero
-   R7 = R1 - R3;
-   R4 = R6 | R7;                // making R4 zero.
-   R6 += 1;                     // which would now make R6:R7==1.
-   CC = R4 == 0;
-   IF CC JUMP .LRETURN_IDENT;
-
-                                // Check for x/1, return x
-   R6 = R0;
-   R7 = R1;
-   CC = R3 == 0;
-   IF !CC JUMP .Lnexttest;
-   CC = R2 == 1;
-   IF CC JUMP .LRETURN_IDENT;
-
-.Lnexttest:
-   R4.L = ONES R2;              // check for div by power of two which
-   R5.L = ONES R3;              // can be done using a shift
-   R6 = PACK (R5.L, R4.L);
-   CC = R6 == 1;
-   IF CC JUMP .Lpower_of_two_upper_zero;
-   R6 = PACK (R4.L, R5.L);
-   CC = R6 == 1;
-   IF CC JUMP .Lpower_of_two_lower_zero;
-
-                                // Check for x < y, return 0
-   R6 = 0;
-   R7 = R6;
-   CC = R1 < R3 (IU);
-   IF CC JUMP .LRETURN_IDENT;
-   CC = R1 == R3;
-   IF !CC JUMP .Lno_idents;
-   CC = R0 < R2 (IU);
-   IF CC JUMP .LRETURN_IDENT;
-
-.Lno_idents:                    // Idents don't match. Go for the full operation
-
-
-   // If X, or X and Y have high bit set, it'll affect the
-   // results, so shift right one to stop this. Note: we've already
-   // checked that X >= Y, so Y's msb won't be set unless X's
-   // is.
-
-   R4 = 0;
-   CC = R1 < 0;
-   IF !CC JUMP .Lx_msb_clear;
-   CC = !CC;                   // 1 -> 0;
-   R1 = ROT R1 BY -1;          // Shift X >> 1
-   R0 = ROT R0 BY -1;          // lsb -> CC
-   BITSET(R4,31);              // to record only x msb was set
-   CC = R3 < 0;
-   IF !CC JUMP .Ly_msb_clear;
-   CC = !CC;
-   R3 = ROT R3 BY -1;          // Shift Y >> 1
-   R2 = ROT R2 BY -1;
-   BITCLR(R4,31);              // clear bit to record only x msb was set
-
-.Ly_msb_clear:
-.Lx_msb_clear:
-   // Bit 31 in R4 indicates X msb set, but Y msb wasn't, and no bits
-   // were lost, so we should shift result left by one.
-
-   [--SP] = R4;                // save for later
-
-   // In the loop that follows, each iteration we add
-   // either Y' or -Y' to the Remainder. We compute the
-   // negated Y', and store, for convenience. Y' goes
-   // into P0:P1, while -Y' goes into P2:P3.
-
-   P0 = R2;
-   P1 = R3;
-   R2 = -R2;
-   CC = CARRY;
-   CC = !CC;
-   R4 = CC;
-   R3 = -R3;
-   R3 = R3 - R4;
-
-   R6 = 0;                     // remainder = 0
-   R7 = R6;
-
-   [--SP] = R2; P2 = SP;
-   [--SP] = R3; P3 = SP;
-   [--SP] = R6; P5 = SP;       // AQ = 0
-   [--SP] = P1;
-
-   /* In the loop that follows, we use the following
-   ** register assignments:
-   ** R0,R1 X, workspace
-   ** R2,R3 Y, workspace
-   ** R4,R5 partial Div
-   ** R6,R7 partial remainder
-   ** P5 AQ
-   ** The remainder and div form a 128-bit number, with
-   ** the remainder in the high 64-bits.
-   */
-   R4 = R0;                    // Div = X'
-   R5 = R1;
-   R3 = 0;
-
-   P4 = 64;                    // Iterate once per bit
-   LSETUP(.LULST,.LULEND) LC0 = P4;
-.LULST:
-        /* Shift Div and remainder up by one. The bit shifted
-        ** out of the top of the quotient is shifted into the bottom
-        ** of the remainder.
-        */
-        CC = R3;
-        R4 = ROT R4 BY 1;
-        R5 = ROT R5 BY 1 ||        // low q to high q
-             R2 = [P5];            // load saved AQ
-        R6 = ROT R6 BY 1 ||        // high q to low r
-             R0 = [P2];            // load -Y'
-        R7 = ROT R7 BY 1 ||        // low r to high r
-             R1 = [P3];
-
-                                   // Assume add -Y'
-        CC = R2 < 0;               // But if AQ is set...
-        IF CC R0 = P0;             // then add Y' instead
-        IF CC R1 = P1;
-
-        R6 = R6 + R0;              // Rem += (Y' or -Y')
-        CC = CARRY;
-        R0 = CC;
-        R7 = R7 + R1;
-        R7 = R7 + R0 (NS) ||
-             R1 = [SP];
-                                   // Set the next AQ bit
-        R1 = R7 ^ R1;              // from Remainder and Y'
-        R1 = R1 >> 31 ||           // Negate AQ's value, and
-             [P5] = R1;            // save next AQ
-        BITTGL(R1, 0);             // add neg AQ  to the Div
-.LULEND: R4 = R4 + R1;
-
-   R6 = [SP + 16];
-
-   R0 = R4;
-   R1 = R5;
-   CC = BITTST(R6,30);         // Just set CC=0
-   R4 = ROT R0 BY 1;           // but if we had to shift X,
-   R5 = ROT R1 BY 1;           // and didn't shift any bits out,
-   CC = BITTST(R6,31);         // then the result will be half as
-   IF CC R0 = R4;              // much as required, so shift left
-   IF CC R1 = R5;              // one space.
-
-   SP += 20;
-   (R7:4, P5:3) = [SP++];
-   RTS;
-
-.Lpower_of_two:
-   /* Y has a single bit set, which means it's a power of two.
-   ** That means we can perform the division just by shifting
-   ** X to the right the appropriate number of bits
-   */
-
-   /* signbits returns the number of sign bits, minus one.
-   ** 1=>30, 2=>29, ..., 0x40000000=>0. Which means we need
-   ** to shift right n-signbits spaces. It also means 0x80000000
-   ** is a special case, because that *also* gives a signbits of 0
-   */
-.Lpower_of_two_lower_zero:
-   R7 = 0;
-   R6 = R1 >> 31;
-   CC = R3 < 0;
-   IF CC JUMP .LRETURN_IDENT;
-
-   R2.L = SIGNBITS R3;
-   R2 = R2.L (Z);
-   R2 += -62;
-   (R7:4, P5:3) = [SP++];
-   JUMP ___lshftli;
-
-.Lpower_of_two_upper_zero:
-   CC = R2 < 0;
-   IF CC JUMP .Lmaxint_shift;
-
-   R2.L = SIGNBITS R2;
-   R2 = R2.L (Z);
-   R2 += -30;
-   (R7:4, P5:3) = [SP++];
-   JUMP ___lshftli;
-
-.Lmaxint_shift:
-   R2 = -31;
-   (R7:4, P5:3) = [SP++];
-   JUMP ___lshftli;
-
-.LRETURN_IDENT:
-   R0 = R6;
-   R1 = R7;
-.LRETURN_R0:
-   (R7:4, P5:3) = [SP++];
-   RTS;
-.LDIV_BY_ZERO:
-   R0 = ~R2;
-   R1 = R0;
-   (R7:4, P5:3) = [SP++];
-   RTS;
-
-ENDPROC(___udivdi3)
-
-
-ENTRY(___lshftli)
-       CC = R2 == 0;
-       IF CC JUMP .Lfinished;  // nothing to do
-       CC = R2 < 0;
-       IF CC JUMP .Lrshift;
-       R3 = 64;
-       CC = R2 < R3;
-       IF !CC JUMP .Lretzero;
-
-       // We're shifting left, and it's less than 64 bits, so
-       // a valid result will be returned.
-
-       R3 >>= 1;       // R3 now 32
-       CC = R2 < R3;
-
-       IF !CC JUMP .Lzerohalf;
-
-       // We're shifting left, between 1 and 31 bits, which means
-       // some of the low half will be shifted into the high half.
-       // Work out how much.
-
-       R3 = R3 - R2;
-
-       // Save that much data from the bottom half.
-
-       P1 = R7;
-       R7 = R0;
-       R7 >>= R3;
-
-       // Adjust both parts of the parameter.
-
-       R0 <<= R2;
-       R1 <<= R2;
-
-       // And include the bits moved across.
-
-       R1 = R1 | R7;
-       R7 = P1;
-       RTS;
-
-.Lzerohalf:
-       // We're shifting left, between 32 and 63 bits, so the
-       // bottom half will become zero, and the top half will
-       // lose some bits. How many?
-
-       R2 = R2 - R3;   // N - 32
-       R1 = LSHIFT R0 BY R2.L;
-       R0 = R0 - R0;
-       RTS;
-
-.Lretzero:
-       R0 = R0 - R0;
-       R1 = R0;
-.Lfinished:
-       RTS;
-
-.Lrshift:
-       // We're shifting right, but by how much?
-       R2 = -R2;
-       R3 = 64;
-       CC = R2 < R3;
-       IF !CC JUMP .Lretzero;
-
-       // Shifting right less than 64 bits, so some result bits will
-       // be retained.
-
-       R3 >>= 1;       // R3 now 32
-       CC = R2 < R3;
-       IF !CC JUMP .Lsignhalf;
-
-       // Shifting right between 1 and 31 bits, so need to copy
-       // data across words.
-
-       P1 = R7;
-       R3 = R3 - R2;
-       R7 = R1;
-       R7 <<= R3;
-       R1 >>= R2;
-       R0 >>= R2;
-       R0 = R7 | R0;
-       R7 = P1;
-       RTS;
-
-.Lsignhalf:
-       // Shifting right between 32 and 63 bits, so the top half
-       // will become all zero-bits, and the bottom half is some
-       // of the top half. But how much?
-
-       R2 = R2 - R3;
-       R0 = R1;
-       R0 >>= R2;
-       R1 = 0;
-       RTS;
-
-ENDPROC(___lshftli)
index 50321f723dee3936239777e3d95a171ea6dcaf94..5c736837d4bfc727d720ab15ed1076544c159b43 100644 (file)
@@ -1,5 +1,7 @@
 if (BF52x)
 
+source "arch/blackfin/mach-bf527/boards/Kconfig"
+
 menu "BF527 Specific Configuration"
 
 comment "Alternative Multiplexing Scheme"
diff --git a/arch/blackfin/mach-bf527/boards/Kconfig b/arch/blackfin/mach-bf527/boards/Kconfig
new file mode 100644 (file)
index 0000000..6a570ad
--- /dev/null
@@ -0,0 +1,12 @@
+choice
+       prompt "System type"
+       default BFIN527_EZKIT
+       help
+         Select your board!
+
+config BFIN527_EZKIT
+       bool "BF527-EZKIT"
+       help
+         BF527-EZKIT-LITE board support.
+
+endchoice
index 912ac8ebc889e525eb9b7fe41f2c33427f5f23f8..7277d35ef11174e91803f74bf81cd7b88e2b92af 100644 (file)
@@ -1,7 +1,5 @@
 #
-# arch/blackfin/mach-bf532/boards/Makefile
+# arch/blackfin/mach-bf527/boards/Makefile
 #
 
-obj-y                                  += eth_mac.o
-obj-$(CONFIG_BFIN527_EZKIT)            += ezkit.o
-
+obj-$(CONFIG_BFIN527_EZKIT)            += ezkit.o
diff --git a/arch/blackfin/mach-bf527/boards/eth_mac.c b/arch/blackfin/mach-bf527/boards/eth_mac.c
deleted file mode 100644 (file)
index a725cc8..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- *  arch/blackfin/mach-bf537/board/eth_mac.c
- *
- *  Copyright (C) 2007 Analog Devices, Inc.
- *
- * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#include <linux/module.h>
-#include <asm/blackfin.h>
-
-#if    defined(CONFIG_GENERIC_BOARD) || defined(CONFIG_BFIN537_STAMP)
-
-/*
- * Currently the MAC address is saved in Flash by U-Boot
- */
-#define FLASH_MAC      0x203f0000
-
-void get_bf537_ether_addr(char *addr)
-{
-       unsigned int flash_mac = (unsigned int) FLASH_MAC;
-       *(u32 *)(&(addr[0])) = bfin_read32(flash_mac);
-       flash_mac += 4;
-       *(u16 *)(&(addr[4])) = bfin_read16(flash_mac);
-}
-
-#else
-
-/*
- * Provide MAC address function for other specific board setting
- */
-void get_bf537_ether_addr(char *addr)
-{
-       printk(KERN_WARNING "%s: No valid Ethernet MAC address found\n", __FILE__);
-}
-
-#endif
-
-EXPORT_SYMBOL(get_bf537_ether_addr);
index 3e884f3a8182ff1f4e02ef6847627ed7831b9bf1..003e2ac654d8629665c256e1683571b632517468 100644 (file)
 #include <linux/spi/spi.h>
 #include <linux/spi/flash.h>
 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
-#include <linux/usb_isp1362.h>
+#include <linux/usb/isp1362.h>
 #endif
 #include <linux/pata_platform.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
-#include <linux/usb_sl811.h>
+#include <linux/usb/sl811.h>
+#include <asm/cplb.h>
 #include <asm/dma.h>
 #include <asm/bfin5xx_spi.h>
 #include <asm/reboot.h>
+#include <asm/nand.h>
+#include <asm/portmux.h>
 #include <linux/spi/ad7877.h>
 
 /*
@@ -102,6 +105,53 @@ void __exit bfin_isp1761_exit(void)
 arch_initcall(bfin_isp1761_init);
 #endif
 
+#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
+static struct mtd_partition partition_info[] = {
+       {
+               .name = "Linux Kernel",
+               .offset = 0,
+               .size = 4 * SIZE_1M,
+       },
+       {
+               .name = "File System",
+               .offset = 4 * SIZE_1M,
+               .size = (256 - 4) * SIZE_1M,
+       },
+};
+
+static struct bf5xx_nand_platform bf5xx_nand_platform = {
+       .page_size = NFC_PG_SIZE_256,
+       .data_width = NFC_NWIDTH_8,
+       .partitions = partition_info,
+       .nr_partitions = ARRAY_SIZE(partition_info),
+       .rd_dly = 3,
+       .wr_dly = 3,
+};
+
+static struct resource bf5xx_nand_resources[] = {
+       {
+               .start = NFC_CTL,
+               .end = NFC_DATA_RD + 2,
+               .flags = IORESOURCE_MEM,
+       },
+       {
+               .start = CH_NFC,
+               .end = CH_NFC,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device bf5xx_nand_device = {
+       .name = "bf5xx-nand",
+       .id = 0,
+       .num_resources = ARRAY_SIZE(bf5xx_nand_resources),
+       .resource = bf5xx_nand_resources,
+       .dev = {
+               .platform_data = &bf5xx_nand_platform,
+       },
+};
+#endif
+
 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
 static struct resource bfin_pcmcia_cf_resources[] = {
        {
@@ -401,6 +451,13 @@ static const struct ad7877_platform_data bfin_ad7877_ts_info = {
 };
 #endif
 
+#if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
+        && defined(CONFIG_SND_SOC_WM8731_SPI)
+static struct bfin5xx_spi_chip spi_wm8731_chip_info = {
+       .enable_dma = 0,
+       .bits_per_word = 16,
+};
+#endif
 static struct spi_board_info bfin_spi_board_info[] __initdata = {
 #if defined(CONFIG_MTD_M25P80) \
        || defined(CONFIG_MTD_M25P80_MODULE)
@@ -502,17 +559,29 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
                .platform_data          = &bfin_ad7877_ts_info,
                .irq                    = IRQ_PF6,
                .max_speed_hz   = 12500000,     /* max spi clock (SCK) speed in HZ */
-               .bus_num        = 1,
+               .bus_num        = 0,
                .chip_select  = 1,
                .controller_data = &spi_ad7877_chip_info,
        },
 #endif
+#if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
+        && defined(CONFIG_SND_SOC_WM8731_SPI)
+       {
+               .modalias       = "wm8731",
+               .max_speed_hz   = 3125000,     /* max spi clock (SCK) speed in HZ */
+               .bus_num        = 0,
+               .chip_select    = 5,
+               .controller_data = &spi_wm8731_chip_info,
+               .mode = SPI_MODE_0,
+       },
+#endif
 };
 
 /* SPI controller data */
 static struct bfin5xx_spi_master bfin_spi0_info = {
        .num_chipselect = 8,
        .enable_dma = 1,  /* master has the ability to do dma transfer */
+       .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
 };
 
 /* SPI (0) */
@@ -650,6 +719,10 @@ static struct platform_device bfin_pata_device = {
 #endif
 
 static struct platform_device *stamp_devices[] __initdata = {
+#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
+       &bf5xx_nand_device,
+#endif
+
 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
        &bfin_pcmcia_cf_device,
 #endif
@@ -735,3 +808,14 @@ void native_machine_restart(char *cmd)
        if ((bfin_read_SYSCR() & 0x7) == 0x3)
                bfin_gpio_reset_spi0_ssel1();
 }
+
+/*
+ * Currently the MAC address is saved in Flash by U-Boot
+ */
+#define FLASH_MAC      0x203f0000
+void bfin_get_ether_addr(char *addr)
+{
+       *(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC);
+       *(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4);
+}
+EXPORT_SYMBOL(bfin_get_ether_addr);
index 14297b3ed5c33cde4b55de896ca219c353ffeb40..76beb75f12dadcbcca496a42bf88dea013a0795c 100644 (file)
@@ -1,5 +1,7 @@
 if (BF533 || BF532 || BF531)
 
+source "arch/blackfin/mach-bf533/boards/Kconfig"
+
 menu "BF533/2/1 Specific Configuration"
 
 comment "Interrupt Priority Assignment"
diff --git a/arch/blackfin/mach-bf533/boards/H8606.c b/arch/blackfin/mach-bf533/boards/H8606.c
new file mode 100644 (file)
index 0000000..6bcf404
--- /dev/null
@@ -0,0 +1,343 @@
+/*
+ * File:         arch/blackfin/mach-bf533/H8606.c
+ * Based on:     arch/blackfin/mach-bf533/stamp.c
+ * Author:       Javier Herrero <jherrero@hvsistemas.es>
+ *
+ * Created:      2007
+ * Description:  Board Info File for the HV Sistemas H8606 board
+ *
+ * Modified:
+ *               Copyright 2005 National ICT Australia (NICTA)
+ *               Copyright 2004-2006 Analog Devices Inc
+ *              Copyright 2007 HV Sistemas S.L.
+ *
+ * Bugs:         Enter bugs at http://blackfin.uclinux.org/
+ *
+ * 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, see the file COPYING, or write
+ * to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include <linux/device.h>
+#include <linux/platform_device.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/flash.h>
+#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
+#include <linux/usb/isp1362.h>
+#endif
+#include <linux/pata_platform.h>
+#include <linux/irq.h>
+#include <asm/dma.h>
+#include <asm/bfin5xx_spi.h>
+#include <asm/reboot.h>
+#include <asm/portmux.h>
+
+/*
+ * Name the Board for the /proc/cpuinfo
+ */
+const char bfin_board_name[] = "HV Sistemas H8606";
+
+#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
+static struct platform_device rtc_device = {
+       .name = "rtc-bfin",
+       .id   = -1,
+};
+#endif
+
+/*
+*  Driver needs to know address, irq and flag pin.
+ */
+ #if   defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
+static struct resource dm9000_resources[] = {
+       [0] = {
+               .start  = 0x20300000,
+               .end    = 0x20300000 + 8,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = IRQ_PF10,
+               .end    = IRQ_PF10,
+               .flags  = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
+       },
+};
+
+static struct platform_device dm9000_device = {
+    .id                        = 0,
+    .name              = "dm9000",
+    .resource          = dm9000_resources,
+    .num_resources     = ARRAY_SIZE(dm9000_resources),
+};
+#endif
+
+#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
+static struct resource smc91x_resources[] = {
+       {
+               .name = "smc91x-regs",
+               .start = 0x20300300,
+               .end = 0x20300300 + 16,
+               .flags = IORESOURCE_MEM,
+       }, {
+               .start = IRQ_PROG_INTB,
+               .end = IRQ_PROG_INTB,
+               .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
+       }, {
+               .start = IRQ_PF7,
+               .end = IRQ_PF7,
+               .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
+       },
+};
+
+static struct platform_device smc91x_device = {
+       .name = "smc91x",
+       .id = 0,
+       .num_resources = ARRAY_SIZE(smc91x_resources),
+       .resource = smc91x_resources,
+};
+#endif
+
+#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
+static struct resource net2272_bfin_resources[] = {
+       {
+               .start = 0x20300000,
+               .end = 0x20300000 + 0x100,
+               .flags = IORESOURCE_MEM,
+       }, {
+               .start = IRQ_PF10,
+               .end = IRQ_PF10,
+               .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
+       },
+};
+
+static struct platform_device net2272_bfin_device = {
+       .name = "net2272",
+       .id = -1,
+       .num_resources = ARRAY_SIZE(net2272_bfin_resources),
+       .resource = net2272_bfin_resources,
+};
+#endif
+
+#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
+/* all SPI peripherals info goes here */
+
+#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
+static struct mtd_partition bfin_spi_flash_partitions[] = {
+       {
+               .name = "bootloader",
+               .size = 0x00060000,
+               .offset = 0,
+               .mask_flags = MTD_CAP_ROM
+       }, {
+               .name = "kernel",
+               .size = 0x100000,
+               .offset = 0x60000
+       }, {
+               .name = "file system",
+               .size = 0x6a0000,
+               .offset = 0x00160000,
+       }
+};
+
+static struct flash_platform_data bfin_spi_flash_data = {
+       .name = "m25p80",
+       .parts = bfin_spi_flash_partitions,
+       .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
+       .type = "m25p64",
+};
+
+/* SPI flash chip (m25p64) */
+static struct bfin5xx_spi_chip spi_flash_chip_info = {
+       .enable_dma = 0,         /* use dma transfer with this chip*/
+       .bits_per_word = 8,
+};
+#endif
+
+#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
+/* SPI ADC chip */
+static struct bfin5xx_spi_chip spi_adc_chip_info = {
+       .ctl_reg = 0x1000,
+       .enable_dma = 1,         /* use dma transfer with this chip*/
+       .bits_per_word = 16,
+};
+#endif
+
+#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
+static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
+       .ctl_reg = 0x1000,
+       .enable_dma = 0,
+       .bits_per_word = 16,
+};
+#endif
+
+#if defined(CONFIG_PBX)
+static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
+       .ctl_reg        = 0x1c04,
+       .enable_dma     = 0,
+       .bits_per_word  = 8,
+       .cs_change_per_word = 1,
+};
+#endif
+
+/* Notice: for blackfin, the speed_hz is the value of register
+ * SPI_BAUD, not the real baudrate */
+static struct spi_board_info bfin_spi_board_info[] __initdata = {
+#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
+       {
+               /* the modalias must be the same as spi device driver name */
+               .modalias = "m25p80", /* Name of spi_driver for this device */
+               /* this value is the baudrate divisor */
+               .max_speed_hz = 50000000, /* actual baudrate is SCLK/(2xspeed_hz) */
+               .bus_num = 0, /* Framework bus number */
+               .chip_select = 2, /* Framework chip select. On STAMP537 it is SPISSEL2*/
+               .platform_data = &bfin_spi_flash_data,
+               .controller_data = &spi_flash_chip_info,
+               .mode = SPI_MODE_3,
+       },
+#endif
+
+#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
+       {
+               .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
+               .max_speed_hz = 4,     /* actual baudrate is SCLK/(2xspeed_hz) */
+               .bus_num = 1, /* Framework bus number */
+               .chip_select = 1, /* Framework chip select. */
+               .platform_data = NULL, /* No spi_driver specific config */
+               .controller_data = &spi_adc_chip_info,
+       },
+#endif
+
+#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
+       {
+               .modalias = "ad1836-spi",
+               .max_speed_hz = 16,
+               .bus_num = 1,
+               .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
+               .controller_data = &ad1836_spi_chip_info,
+       },
+#endif
+
+#if defined(CONFIG_PBX)
+       {
+               .modalias        = "fxs-spi",
+               .max_speed_hz    = 4,
+               .bus_num         = 1,
+               .chip_select     = 3,
+               .controller_data = &spi_si3xxx_chip_info,
+       },
+
+       {
+               .modalias        = "fxo-spi",
+               .max_speed_hz    = 4,
+               .bus_num         = 1,
+               .chip_select     = 2,
+               .controller_data = &spi_si3xxx_chip_info,
+       },
+#endif
+};
+
+/* SPI (0) */
+static struct resource bfin_spi0_resource[] = {
+       [0] = {
+               .start = SPI0_REGBASE,
+               .end   = SPI0_REGBASE + 0xFF,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = CH_SPI,
+               .end   = CH_SPI,
+               .flags = IORESOURCE_IRQ,
+       }
+};
+
+
+/* SPI controller data */
+static struct bfin5xx_spi_master bfin_spi0_info = {
+       .num_chipselect = 8,
+       .enable_dma = 1,  /* master has the ability to do dma transfer */
+       .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
+};
+
+static struct platform_device bfin_spi0_device = {
+       .name = "bfin-spi",
+       .id = 0, /* Bus number */
+       .num_resources = ARRAY_SIZE(bfin_spi0_resource),
+       .resource = bfin_spi0_resource,
+       .dev = {
+               .platform_data = &bfin_spi0_info, /* Passed to driver */
+       },
+};
+#endif  /* spi master and devices */
+
+#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
+static struct platform_device bfin_fb_device = {
+       .name = "bf537-fb",
+};
+#endif
+
+#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
+static struct resource bfin_uart_resources[] = {
+       {
+               .start = 0xFFC00400,
+               .end = 0xFFC004FF,
+               .flags = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device bfin_uart_device = {
+       .name = "bfin-uart",
+       .id = 1,
+       .num_resources = ARRAY_SIZE(bfin_uart_resources),
+       .resource = bfin_uart_resources,
+};
+#endif
+
+static struct platform_device *stamp_devices[] __initdata = {
+#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
+       &rtc_device,
+#endif
+
+#if    defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
+       &dm9000_device,
+#endif
+
+#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
+       &smc91x_device,
+#endif
+
+#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
+       &net2272_bfin_device,
+#endif
+
+#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
+       &bfin_spi0_device,
+#endif
+
+#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
+       &bfin_uart_device,
+#endif
+};
+
+static int __init H8606_init(void)
+{
+       printk(KERN_INFO "HV Sistemas H8606 board support by http://www.hvsistemas.com\n");
+       printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__);
+       platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
+#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
+       spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
+#endif
+       return 0;
+}
+
+arch_initcall(H8606_init);
diff --git a/arch/blackfin/mach-bf533/boards/Kconfig b/arch/blackfin/mach-bf533/boards/Kconfig
new file mode 100644 (file)
index 0000000..751de51
--- /dev/null
@@ -0,0 +1,34 @@
+choice
+       prompt "System type"
+       default BFIN533_STAMP
+       help
+         Select your board!
+
+config BFIN533_EZKIT
+       bool "BF533-EZKIT"
+       help
+         BF533-EZKIT-LITE board support.
+
+config BFIN533_STAMP
+       bool "BF533-STAMP"
+       help
+         BF533-STAMP board support.
+
+config BFIN533_BLUETECHNIX_CM
+       bool "Bluetechnix CM-BF533"
+       depends on (BF533)
+       help
+         CM-BF533 support for EVAL- and DEV-Board.
+
+config H8606_HVSISTEMAS
+       bool "HV Sistemas H8606"
+       depends on (BF532)
+       help
+         HV Sistemas H8606 board support.
+
+config GENERIC_BF533_BOARD
+       bool "Generic"
+       help
+         Generic or Custom board support.
+
+endchoice
index 12a631ab389d467fdcad73fa95fc2c83caa4a5b6..54f57fb9791e0c501256d30a5a99897c46170d67 100644 (file)
@@ -2,7 +2,8 @@
 # arch/blackfin/mach-bf533/boards/Makefile
 #
 
-obj-$(CONFIG_GENERIC_BOARD)            += generic_board.o
+obj-$(CONFIG_GENERIC_BF533_BOARD)      += generic_board.o
 obj-$(CONFIG_BFIN533_STAMP)            += stamp.o
 obj-$(CONFIG_BFIN533_EZKIT)            += ezkit.o
 obj-$(CONFIG_BFIN533_BLUETECHNIX_CM)   += cm_bf533.o
+obj-$(CONFIG_H8606_HVSISTEMAS)         += H8606.o
index 1c5a86adfab79158b19ea2dd5dbd78ba475f6f51..21df2f3754975b44ae60746ebe93ddbcfcee7ad6 100644 (file)
 #include <linux/mtd/partitions.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/flash.h>
-#include <linux/usb_isp1362.h>
+#include <linux/usb/isp1362.h>
 #include <linux/pata_platform.h>
 #include <linux/irq.h>
 #include <asm/dma.h>
 #include <asm/bfin5xx_spi.h>
+#include <asm/portmux.h>
 
 /*
  * Name the Board for the /proc/cpuinfo
@@ -46,7 +47,7 @@ const char bfin_board_name[] = "Bluetechnix CM BF533";
 
 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
 /* all SPI peripherals info goes here */
-
+#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
 static struct mtd_partition bfin_spi_flash_partitions[] = {
        {
                .name = "bootloader",
@@ -76,12 +77,15 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
        .enable_dma = 0,         /* use dma transfer with this chip*/
        .bits_per_word = 8,
 };
+#endif
 
 /* SPI ADC chip */
+#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
 static struct bfin5xx_spi_chip spi_adc_chip_info = {
        .enable_dma = 1,         /* use dma transfer with this chip*/
        .bits_per_word = 16,
 };
+#endif
 
 #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
 static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
@@ -90,7 +94,15 @@ static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
 };
 #endif
 
+#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
+static struct bfin5xx_spi_chip spi_mmc_chip_info = {
+       .enable_dma = 1,
+       .bits_per_word = 8,
+};
+#endif
+
 static struct spi_board_info bfin_spi_board_info[] __initdata = {
+#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
        {
                /* the modalias must be the same as spi device driver name */
                .modalias = "m25p80",       /* Name of spi_driver for this device */
@@ -100,7 +112,11 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
                .platform_data = &bfin_spi_flash_data,
                .controller_data = &spi_flash_chip_info,
                .mode = SPI_MODE_3,
-       }, {
+       },
+#endif
+
+#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
+       {
                .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
                .max_speed_hz = 6250000,     /* max spi clock (SCK) speed in HZ */
                .bus_num = 0,               /* Framework bus number */
@@ -108,6 +124,8 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
                .platform_data = NULL,      /* No spi_driver specific config */
                .controller_data = &spi_adc_chip_info,
        },
+#endif
+
 #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
        {
                .modalias = "ad1836-spi",
@@ -117,6 +135,27 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
                .controller_data = &ad1836_spi_chip_info,
        },
 #endif
+
+#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
+       {
+               .modalias = "spi_mmc_dummy",
+               .max_speed_hz = 25000000,     /* max spi clock (SCK) speed in HZ */
+               .bus_num = 0,
+               .chip_select = 0,
+               .platform_data = NULL,
+               .controller_data = &spi_mmc_chip_info,
+               .mode = SPI_MODE_3,
+       },
+       {
+               .modalias = "spi_mmc",
+               .max_speed_hz = 25000000,     /* max spi clock (SCK) speed in HZ */
+               .bus_num = 0,
+               .chip_select = CONFIG_SPI_MMC_CS_CHAN,
+               .platform_data = NULL,
+               .controller_data = &spi_mmc_chip_info,
+               .mode = SPI_MODE_3,
+       },
+#endif
 };
 
 /* SPI (0) */
@@ -137,6 +176,7 @@ static struct resource bfin_spi0_resource[] = {
 static struct bfin5xx_spi_master bfin_spi0_info = {
        .num_chipselect = 8,
        .enable_dma = 1,  /* master has the ability to do dma transfer */
+       .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
 };
 
 static struct platform_device bfin_spi0_device = {
index 34b63920e272ef0321ad5bee525ec80e22f4d567..be852034a68b3e3cfb0f00b82f338e6da1eaac16 100644 (file)
 #include <linux/mtd/partitions.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/flash.h>
-#include <linux/usb_isp1362.h>
+#include <linux/usb/isp1362.h>
 #include <linux/pata_platform.h>
 #include <linux/irq.h>
 #include <asm/dma.h>
 #include <asm/bfin5xx_spi.h>
+#include <asm/portmux.h>
 
 /*
  * Name the Board for the /proc/cpuinfo
@@ -187,6 +188,7 @@ static struct resource bfin_spi0_resource[] = {
 static struct bfin5xx_spi_master bfin_spi0_info = {
        .num_chipselect = 8,
        .enable_dma = 1,  /* master has the ability to do dma transfer */
+       .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
 };
 
 static struct platform_device bfin_spi0_device = {
index 310b7772c458cf512e1dfbf341d9af5fb9666b34..e359a0d6467fd846c66c68e9fce44c480b877582 100644 (file)
@@ -58,10 +58,6 @@ static struct resource smc91x_resources[] = {
                .end = IRQ_PROG_INTB,
                .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
        }, {
-               /*
-                *  denotes the flag pin and is used directly if
-                *  CONFIG_IRQCHIP_DEMUX_GPIO is defined.
-                */
                .start = IRQ_PF7,
                .end = IRQ_PF7,
                .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
index f84be4eabfd1985af425717cfeb353c48ecd60a6..8fde8d8328502a9a39aec4f7c9f64187973442d2 100644 (file)
 #include <linux/spi/spi.h>
 #include <linux/spi/flash.h>
 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
-#include <linux/usb_isp1362.h>
+#include <linux/usb/isp1362.h>
 #endif
 #include <linux/pata_platform.h>
 #include <linux/irq.h>
 #include <asm/dma.h>
 #include <asm/bfin5xx_spi.h>
 #include <asm/reboot.h>
+#include <asm/portmux.h>
 
 /*
  * Name the Board for the /proc/cpuinfo
@@ -218,7 +219,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
 #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
        {
                .modalias = "spi_mmc_dummy",
-               .max_speed_hz = 25000000,     /* max spi clock (SCK) speed in HZ */
+               .max_speed_hz = 20000000,     /* max spi clock (SCK) speed in HZ */
                .bus_num = 0,
                .chip_select = 0,
                .platform_data = NULL,
@@ -227,7 +228,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
        },
        {
                .modalias = "spi_mmc",
-               .max_speed_hz = 25000000,     /* max spi clock (SCK) speed in HZ */
+               .max_speed_hz = 20000000,     /* max spi clock (SCK) speed in HZ */
                .bus_num = 0,
                .chip_select = CONFIG_SPI_MMC_CS_CHAN,
                .platform_data = NULL,
@@ -286,6 +287,7 @@ static struct resource bfin_spi0_resource[] = {
 static struct bfin5xx_spi_master bfin_spi0_info = {
        .num_chipselect = 8,
        .enable_dma = 1,  /* master has the ability to do dma transfer */
+       .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
 };
 
 static struct platform_device bfin_spi0_device = {
index e6648db0951931a694bd4c28c3b2b6e19889ec31..8255374c04aa5a38ceac476c3cf4d97303c42844 100644 (file)
@@ -1,5 +1,7 @@
 if (BF537 || BF534 || BF536)
 
+source "arch/blackfin/mach-bf537/boards/Kconfig"
+
 menu "BF537 Specific Configuration"
 
 comment "Interrupt Priority Assignment"
diff --git a/arch/blackfin/mach-bf537/boards/Kconfig b/arch/blackfin/mach-bf537/boards/Kconfig
new file mode 100644 (file)
index 0000000..96a1519
--- /dev/null
@@ -0,0 +1,29 @@
+choice
+       prompt "System type"
+       default BFIN537_STAMP
+       help
+         Select your board!
+
+config BFIN537_STAMP
+       bool "BF537-STAMP"
+       help
+         BF537-STAMP board support.
+
+config BFIN537_BLUETECHNIX_CM
+       bool "Bluetechnix CM-BF537"
+       depends on (BF537)
+       help
+         CM-BF537 support for EVAL- and DEV-Board.
+
+config PNAV10
+       bool "PNAV board"
+       depends on (BF537)
+       help
+         PNAV board support.
+
+config GENERIC_BF537_BOARD
+       bool "Generic"
+       help
+         Generic or Custom board support.
+
+endchoice
index 23323cacc3aa423176a901ddafcd53dfd0459e59..94a85174283a7d6f56c4fc272458d239a88a4b32 100644 (file)
@@ -2,8 +2,7 @@
 # arch/blackfin/mach-bf537/boards/Makefile
 #
 
-obj-y                                  += eth_mac.o
-obj-$(CONFIG_GENERIC_BOARD)            += generic_board.o
-obj-$(CONFIG_BFIN537_STAMP)            += stamp.o led.o
-obj-$(CONFIG_BFIN537_BLUETECHNIX_CM)   += cm_bf537.o
-obj-$(CONFIG_PNAV10)                   += pnav10.o
+obj-$(CONFIG_GENERIC_BF537_BOARD)      += generic_board.o
+obj-$(CONFIG_BFIN537_STAMP)            += stamp.o led.o
+obj-$(CONFIG_BFIN537_BLUETECHNIX_CM)   += cm_bf537.o
+obj-$(CONFIG_PNAV10)                   += pnav10.o
index 52e2320307de028e19e75fdafe4e643b3324e03b..c0fb06dbc42e65281208206f676d038993978c1b 100644 (file)
 #include <linux/mtd/partitions.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/flash.h>
-#include <linux/usb_isp1362.h>
+#include <linux/usb/isp1362.h>
 #include <linux/pata_platform.h>
 #include <linux/irq.h>
 #include <asm/dma.h>
 #include <asm/bfin5xx_spi.h>
+#include <asm/portmux.h>
 
 /*
  * Name the Board for the /proc/cpuinfo
@@ -194,6 +195,7 @@ static struct resource bfin_spi0_resource[] = {
 static struct bfin5xx_spi_master bfin_spi0_info = {
        .num_chipselect = 8,
        .enable_dma = 1,  /* master has the ability to do dma transfer */
+       .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
 };
 
 static struct platform_device bfin_spi0_device = {
@@ -281,8 +283,8 @@ static struct resource net2272_bfin_resources[] = {
                .end = 0x20200000 + 0x100,
                .flags = IORESOURCE_MEM,
        }, {
-               .start = IRQ_PF7,
-               .end = IRQ_PF7,
+               .start = IRQ_PH14,
+               .end = IRQ_PH14,
                .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
        },
 };
@@ -425,3 +427,10 @@ static int __init cm_bf537_init(void)
 }
 
 arch_initcall(cm_bf537_init);
+
+void bfin_get_ether_addr(char *addr)
+{
+       random_ether_addr(addr);
+       printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
+}
+EXPORT_SYMBOL(bfin_get_ether_addr);
diff --git a/arch/blackfin/mach-bf537/boards/eth_mac.c b/arch/blackfin/mach-bf537/boards/eth_mac.c
deleted file mode 100644 (file)
index a725cc8..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- *  arch/blackfin/mach-bf537/board/eth_mac.c
- *
- *  Copyright (C) 2007 Analog Devices, Inc.
- *
- * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#include <linux/module.h>
-#include <asm/blackfin.h>
-
-#if    defined(CONFIG_GENERIC_BOARD) || defined(CONFIG_BFIN537_STAMP)
-
-/*
- * Currently the MAC address is saved in Flash by U-Boot
- */
-#define FLASH_MAC      0x203f0000
-
-void get_bf537_ether_addr(char *addr)
-{
-       unsigned int flash_mac = (unsigned int) FLASH_MAC;
-       *(u32 *)(&(addr[0])) = bfin_read32(flash_mac);
-       flash_mac += 4;
-       *(u16 *)(&(addr[4])) = bfin_read16(flash_mac);
-}
-
-#else
-
-/*
- * Provide MAC address function for other specific board setting
- */
-void get_bf537_ether_addr(char *addr)
-{
-       printk(KERN_WARNING "%s: No valid Ethernet MAC address found\n", __FILE__);
-}
-
-#endif
-
-EXPORT_SYMBOL(get_bf537_ether_addr);
index 255da7a984817ce0c1f7180181c6f26b6f5834c5..09f4bfbd23506c4edb5313d28c7a8c22b4e61ed6 100644 (file)
@@ -35,7 +35,7 @@
 #include <linux/spi/spi.h>
 #include <linux/spi/flash.h>
 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
-#include <linux/usb_isp1362.h>
+#include <linux/usb/isp1362.h>
 #endif
 #include <linux/pata_platform.h>
 #include <linux/irq.h>
@@ -44,6 +44,7 @@
 #include <asm/dma.h>
 #include <asm/bfin5xx_spi.h>
 #include <asm/reboot.h>
+#include <asm/portmux.h>
 #include <linux/spi/ad7877.h>
 
 /*
@@ -502,7 +503,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
                .platform_data          = &bfin_ad7877_ts_info,
                .irq                    = IRQ_PF6,
                .max_speed_hz   = 12500000,     /* max spi clock (SCK) speed in HZ */
-               .bus_num        = 1,
+               .bus_num        = 0,
                .chip_select  = 1,
                .controller_data = &spi_ad7877_chip_info,
        },
@@ -513,6 +514,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
 static struct bfin5xx_spi_master bfin_spi0_info = {
        .num_chipselect = 8,
        .enable_dma = 1,  /* master has the ability to do dma transfer */
+       .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
 };
 
 /* SPI (0) */
@@ -730,3 +732,10 @@ void native_machine_restart(char *cmd)
        if ((bfin_read_SYSCR() & 0x7) == 0x3)
                bfin_gpio_reset_spi0_ssel1();
 }
+
+void bfin_get_ether_addr(char *addr)
+{
+       random_ether_addr(addr);
+       printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
+}
+EXPORT_SYMBOL(bfin_get_ether_addr);
index 87b808926789b46acfb7c5513155dc2f4a05d9b8..fd5f4a6f08e48efbe5f4afc98c80b32752d74a2e 100644 (file)
 #include <linux/spi/spi.h>
 #include <linux/spi/flash.h>
 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
-#include <linux/usb_isp1362.h>
+#include <linux/usb/isp1362.h>
 #endif
 #include <linux/irq.h>
 #include <asm/dma.h>
 #include <asm/bfin5xx_spi.h>
+#include <asm/portmux.h>
 #include <linux/usb/sl811.h>
 
 #include <linux/spi/ad7877.h>
@@ -295,7 +296,7 @@ static struct bfin5xx_spi_chip spi_mmc_chip_info = {
 
 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
 static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
-       .cs_change_per_word = 1,
+       .cs_change_per_word = 0,
        .enable_dma = 0,
        .bits_per_word = 16,
 };
@@ -387,7 +388,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
        .platform_data          = &bfin_ad7877_ts_info,
        .irq                    = IRQ_PF2,
        .max_speed_hz           = 12500000,     /* max spi clock (SCK) speed in HZ */
-       .bus_num                = 1,
+       .bus_num                = 0,
        .chip_select            = 5,
        .controller_data = &spi_ad7877_chip_info,
 },
@@ -413,6 +414,7 @@ static struct resource bfin_spi0_resource[] = {
 static struct bfin5xx_spi_master bfin_spi0_info = {
        .num_chipselect = 8,
        .enable_dma = 1,  /* master has the ability to do dma transfer */
+       .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
 };
 
 static struct platform_device bfin_spi0_device = {
@@ -508,3 +510,10 @@ static int __init stamp_init(void)
 }
 
 arch_initcall(stamp_init);
+
+void bfin_get_ether_addr(char *addr)
+{
+       random_ether_addr(addr);
+       printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
+}
+EXPORT_SYMBOL(bfin_get_ether_addr);
index cc41f6c2ef4f515c65f5e4f99b3e027b41d96045..07b0dc273d2f0b13ba87a3ec089b52f54af356be 100644 (file)
@@ -35,7 +35,7 @@
 #include <linux/spi/spi.h>
 #include <linux/spi/flash.h>
 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
-#include <linux/usb_isp1362.h>
+#include <linux/usb/isp1362.h>
 #endif
 #include <linux/pata_platform.h>
 #include <linux/irq.h>
@@ -44,6 +44,7 @@
 #include <asm/dma.h>
 #include <asm/bfin5xx_spi.h>
 #include <asm/reboot.h>
+#include <asm/portmux.h>
 #include <linux/spi/ad7877.h>
 
 /*
@@ -182,6 +183,28 @@ static struct platform_device dm9000_device = {
 };
 #endif
 
+#if defined(CONFIG_AX88180) || defined(CONFIG_AX88180_MODULE)
+static struct resource ax88180_resources[] = {
+       [0] = {
+               .start  = 0x20300000,
+               .end    = 0x20300000 + 0x8000,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = IRQ_PF7,
+               .end    = IRQ_PF7,
+               .flags  = (IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL),
+       },
+};
+
+static struct platform_device ax88180_device = {
+       .name           = "ax88180",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(ax88180_resources),
+       .resource       = ax88180_resources,
+};
+#endif
+
 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
 static struct resource sl811_hcd_resources[] = {
        {
@@ -450,7 +473,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
 #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
        {
                .modalias = "spi_mmc_dummy",
-               .max_speed_hz = 25000000,     /* max spi clock (SCK) speed in HZ */
+               .max_speed_hz = 20000000,     /* max spi clock (SCK) speed in HZ */
                .bus_num = 0,
                .chip_select = 0,
                .platform_data = NULL,
@@ -459,7 +482,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
        },
        {
                .modalias = "spi_mmc",
-               .max_speed_hz = 25000000,     /* max spi clock (SCK) speed in HZ */
+               .max_speed_hz = 20000000,     /* max spi clock (SCK) speed in HZ */
                .bus_num = 0,
                .chip_select = CONFIG_SPI_MMC_CS_CHAN,
                .platform_data = NULL,
@@ -502,7 +525,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
                .platform_data          = &bfin_ad7877_ts_info,
                .irq                    = IRQ_PF6,
                .max_speed_hz   = 12500000,     /* max spi clock (SCK) speed in HZ */
-               .bus_num        = 1,
+               .bus_num        = 0,
                .chip_select  = 1,
                .controller_data = &spi_ad7877_chip_info,
        },
@@ -513,6 +536,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
 static struct bfin5xx_spi_master bfin_spi0_info = {
        .num_chipselect = 8,
        .enable_dma = 1,  /* master has the ability to do dma transfer */
+       .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
 };
 
 /* SPI (0) */
@@ -554,15 +578,20 @@ static struct platform_device bfin_fb_adv7393_device = {
 
 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
 static struct resource bfin_uart_resources[] = {
+#ifdef CONFIG_SERIAL_BFIN_UART0
        {
                .start = 0xFFC00400,
                .end = 0xFFC004FF,
                .flags = IORESOURCE_MEM,
-       }, {
+       },
+#endif
+#ifdef CONFIG_SERIAL_BFIN_UART1
+       {
                .start = 0xFFC02000,
                .end = 0xFFC020FF,
                .flags = IORESOURCE_MEM,
        },
+#endif
 };
 
 static struct platform_device bfin_uart_device = {
@@ -612,7 +641,7 @@ static struct platform_device bfin_sport1_uart_device = {
 
 static struct pata_platform_info bfin_pata_platform_data = {
        .ioport_shift = 1,
-       .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
+       .irq_flags = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
 };
 
 static struct resource bfin_pata_resources[] = {
@@ -669,6 +698,10 @@ static struct platform_device *stamp_devices[] __initdata = {
        &dm9000_device,
 #endif
 
+#if defined(CONFIG_AX88180) || defined(CONFIG_AX88180_MODULE)
+       &ax88180_device,
+#endif
+
 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
        &bfin_mac_device,
 #endif
@@ -730,3 +763,14 @@ void native_machine_restart(char *cmd)
        if ((bfin_read_SYSCR() & 0x7) == 0x3)
                bfin_gpio_reset_spi0_ssel1();
 }
+
+/*
+ * Currently the MAC address is saved in Flash by U-Boot
+ */
+#define FLASH_MAC      0x203f0000
+void bfin_get_ether_addr(char *addr)
+{
+       *(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC);
+       *(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4);
+}
+EXPORT_SYMBOL(bfin_get_ether_addr);
index 08d8dc83701c3e7cb3d279f757358155fba662f7..d8bd3b49f150275cf5e32ccbd0c0cfbf648d4e65 100644 (file)
@@ -1,5 +1,7 @@
 if (BF54x)
 
+source "arch/blackfin/mach-bf548/boards/Kconfig"
+
 menu "BF548 Specific Configuration"
 
 config DEB_DMA_URGENT
diff --git a/arch/blackfin/mach-bf548/boards/Kconfig b/arch/blackfin/mach-bf548/boards/Kconfig
new file mode 100644 (file)
index 0000000..0571290
--- /dev/null
@@ -0,0 +1,12 @@
+choice
+       prompt "System type"
+       default BFIN548_EZKIT
+       help
+         Select your board!
+
+config BFIN548_EZKIT
+       bool "BF548-EZKIT"
+       help
+         BFIN548-EZKIT board support.
+
+endchoice
index 486e07c99a515fcb5dcd4be9ca83f88ef02bdc6c..a444cc739578bc8f286a4b06ee7fb74a79ae4d59 100644 (file)
@@ -2,4 +2,4 @@
 # arch/blackfin/mach-bf548/boards/Makefile
 #
 
-obj-$(CONFIG_BFIN548_EZKIT)            += ezkit.o led.o
+obj-$(CONFIG_BFIN548_EZKIT)            += ezkit.o led.o
index 6b6490e66b30dd11086d901acdcf8e4cf6353c1c..d37d6653c4bc574da7f80e3aed9161c40f4890c2 100644 (file)
@@ -42,6 +42,7 @@
 #include <asm/dma.h>
 #include <asm/gpio.h>
 #include <asm/nand.h>
+#include <asm/portmux.h>
 #include <asm/mach/bf54x_keys.h>
 #include <linux/input.h>
 #include <linux/spi/ad7877.h>
@@ -377,7 +378,7 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
 
 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
 static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
-       .cs_change_per_word = 1,
+       .cs_change_per_word = 0,
        .enable_dma = 0,
        .bits_per_word = 16,
 };
@@ -453,9 +454,10 @@ static struct resource bfin_spi1_resource[] = {
 };
 
 /* SPI controller data */
-static struct bfin5xx_spi_master bf54x_spi_master_info = {
+static struct bfin5xx_spi_master bf54x_spi_master_info0 = {
        .num_chipselect = 8,
        .enable_dma = 1,  /* master has the ability to do dma transfer */
+       .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
 };
 
 static struct platform_device bf54x_spi_master0 = {
@@ -464,17 +466,23 @@ static struct platform_device bf54x_spi_master0 = {
        .num_resources = ARRAY_SIZE(bfin_spi0_resource),
        .resource = bfin_spi0_resource,
        .dev = {
-               .platform_data = &bf54x_spi_master_info, /* Passed to driver */
+               .platform_data = &bf54x_spi_master_info0, /* Passed to driver */
                },
 };
 
+static struct bfin5xx_spi_master bf54x_spi_master_info1 = {
+       .num_chipselect = 8,
+       .enable_dma = 1,  /* master has the ability to do dma transfer */
+       .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0},
+};
+
 static struct platform_device bf54x_spi_master1 = {
        .name = "bfin-spi",
        .id = 1, /* Bus number */
        .num_resources = ARRAY_SIZE(bfin_spi1_resource),
        .resource = bfin_spi1_resource,
        .dev = {
-               .platform_data = &bf54x_spi_master_info, /* Passed to driver */
+               .platform_data = &bf54x_spi_master_info1, /* Passed to driver */
                },
 };
 #endif  /* spi master and devices */
@@ -500,6 +508,7 @@ static struct platform_device i2c_bfin_twi0_device = {
        .resource = bfin_twi0_resource,
 };
 
+#if !defined(CONFIG_BF542)     /* The BF542 only has 1 TWI */
 static struct resource bfin_twi1_resource[] = {
        [0] = {
                .start = TWI1_REGBASE,
@@ -520,6 +529,7 @@ static struct platform_device i2c_bfin_twi1_device = {
        .resource = bfin_twi1_resource,
 };
 #endif
+#endif
 
 static struct platform_device *ezkit_devices[] __initdata = {
 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
@@ -569,8 +579,10 @@ static struct platform_device *ezkit_devices[] __initdata = {
 
 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
        &i2c_bfin_twi0_device,
+#if !defined(CONFIG_BF542)
        &i2c_bfin_twi1_device,
 #endif
+#endif
 };
 
 static int __init stamp_init(void)
index 3071c243d42672147e83bfe415ca602c5e2acbb9..74b34c7f36295000a080f33e2d279d7162462da2 100644 (file)
@@ -158,6 +158,27 @@ ENTRY(__stext)
        w[p2] = r0;
        ssync;
 
+       p2.h = hi(EBIU_MBSCTL);
+       p2.l = lo(EBIU_MBSCTL);
+       r0.h = hi(CONFIG_EBIU_MBSCTLVAL);
+       r0.l = lo(CONFIG_EBIU_MBSCTLVAL);
+       [p2] = r0;
+       ssync;
+
+       p2.h = hi(EBIU_MODE);
+       p2.l = lo(EBIU_MODE);
+       r0.h = hi(CONFIG_EBIU_MODEVAL);
+       r0.l = lo(CONFIG_EBIU_MODEVAL);
+       [p2] = r0;
+       ssync;
+
+       p2.h = hi(EBIU_FCTL);
+       p2.l = lo(EBIU_FCTL);
+       r0.h = hi(CONFIG_EBIU_FCTLVAL);
+       r0.l = lo(CONFIG_EBIU_FCTLVAL);
+       [p2] = r0;
+       ssync;
+
        /* This section keeps the processor in supervisor mode
         * during kernel boot.  Switches to user mode at end of boot.
         * See page 3-9 of Hardware Reference manual for documentation.
index 0a17c4cf0059708aaa5052e992c7fda60b6e4468..3f4895450bea0286fcbbe8b5b8b512cb9c8a1434 100644 (file)
@@ -1,4 +1,6 @@
-if BF561
+if (BF561)
+
+source "arch/blackfin/mach-bf561/boards/Kconfig"
 
 menu "BF561 Specific Configuration"
 
diff --git a/arch/blackfin/mach-bf561/boards/Kconfig b/arch/blackfin/mach-bf561/boards/Kconfig
new file mode 100644 (file)
index 0000000..e41a67b
--- /dev/null
@@ -0,0 +1,27 @@
+choice
+       prompt "System type"
+       default BFIN561_EZKIT
+       help
+         Select your board!
+
+config BFIN561_EZKIT
+       bool "BF561-EZKIT"
+       help
+         BF561-EZKIT-LITE board support.
+
+config BFIN561_TEPLA
+       bool "BF561-TEPLA"
+       help
+        BF561-TEPLA board support.
+
+config BFIN561_BLUETECHNIX_CM
+       bool "Bluetechnix CM-BF561"
+       help
+         CM-BF561 support for EVAL- and DEV-Board.
+
+config GENERIC_BF561_BOARD
+       bool "Generic"
+       help
+         Generic or Custom board support.
+
+endchoice
index 495a1cf9d4529dc04ab81e0dcd77d840d84cd8b8..04add010b568459da6d324afd87bf4ae46d40b55 100644 (file)
@@ -2,7 +2,7 @@
 # arch/blackfin/mach-bf561/boards/Makefile
 #
 
-obj-$(CONFIG_GENERIC_BOARD)            += generic_board.o
+obj-$(CONFIG_GENERIC_BF561_BOARD)      += generic_board.o
 obj-$(CONFIG_BFIN561_BLUETECHNIX_CM)   += cm_bf561.o
 obj-$(CONFIG_BFIN561_EZKIT)            += ezkit.o
 obj-$(CONFIG_BFIN561_TEPLA)            += tepla.o
index 97aeb43fd8b46e05eead1e481d0b3dca3507da34..c19cd29b948adfef35900341d2a36502fca7dd75 100644 (file)
 #include <linux/mtd/partitions.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/flash.h>
-#include <linux/usb_isp1362.h>
+#include <linux/usb/isp1362.h>
 #include <linux/pata_platform.h>
 #include <linux/irq.h>
 #include <asm/dma.h>
 #include <asm/bfin5xx_spi.h>
+#include <asm/portmux.h>
 
 /*
  * Name the Board for the /proc/cpuinfo
@@ -182,6 +183,7 @@ static struct resource bfin_spi0_resource[] = {
 static struct bfin5xx_spi_master bfin_spi0_info = {
        .num_chipselect = 8,
        .enable_dma = 1,  /* master has the ability to do dma transfer */
+       .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
 };
 
 static struct platform_device bfin_spi0_device = {
index 059d516cec23e4bc9877d5271cf300bbf3a600c4..4ff8f6e7a11f4c82dad89d309a48fc693c538d8f 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/pata_platform.h>
 #include <asm/dma.h>
 #include <asm/bfin5xx_spi.h>
+#include <asm/portmux.h>
 
 /*
  * Name the Board for the /proc/cpuinfo
@@ -115,6 +116,28 @@ static struct platform_device smc91x_device = {
 };
 #endif
 
+#if defined(CONFIG_AX88180) || defined(CONFIG_AX88180_MODULE)
+static struct resource ax88180_resources[] = {
+       [0] = {
+               .start  = 0x2c000000,
+               .end    = 0x2c000000 + 0x8000,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = IRQ_PF10,
+               .end    = IRQ_PF10,
+               .flags  = (IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL),
+       },
+};
+
+static struct platform_device ax88180_device = {
+       .name           = "ax88180",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(ax88180_resources),
+       .resource       = ax88180_resources,
+};
+#endif
+
 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
 static struct resource bfin_uart_resources[] = {
        {
@@ -160,6 +183,7 @@ static struct resource bfin_spi0_resource[] = {
 static struct bfin5xx_spi_master bfin_spi0_info = {
        .num_chipselect = 8,
        .enable_dma = 1,  /* master has the ability to do dma transfer */
+       .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
 };
 
 static struct platform_device bfin_spi0_device = {
@@ -226,6 +250,11 @@ static struct platform_device *ezkit_devices[] __initdata = {
 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
        &smc91x_device,
 #endif
+
+#if defined(CONFIG_AX88180) || defined(CONFIG_AX88180_MODULE)
+       &ax88180_device,
+#endif
+
 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
        &bfin_spi0_device,
 #endif
index 46816be4b2bab8dac67a052f5bd00f4cddd68b38..fc80c5d059f8b28cbd29471f37c152f7d21e9322 100644 (file)
@@ -48,10 +48,6 @@ static struct resource smc91x_resources[] = {
                .end = IRQ_PROG_INTB,
                .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
        }, {
-               /*
-                *  denotes the flag pin and is used directly if
-                *  CONFIG_IRQCHIP_DEMUX_GPIO is defined.
-                */
                .start = IRQ_PF9,
                .end = IRQ_PF9,
                .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
index 4a17c6da2a594e10c1c8849a6880adf879669316..ec6a2207c202491f347cd3ab2f45721fb33ec634 100644 (file)
@@ -31,10 +31,6 @@ static struct resource smc91x_resources[] = {
                .end    = IRQ_PROG_INTB,
                .flags  = IORESOURCE_IRQ|IORESOURCE_IRQ_HIGHLEVEL,
        }, {
-               /*
-                *  denotes the flag pin and is used directly if
-                *  CONFIG_IRQCHIP_DEMUX_GPIO is defined.
-                */
                .start  = IRQ_PF7,
                .end    = IRQ_PF7,
                .flags  = IORESOURCE_IRQ|IORESOURCE_IRQ_HIGHLEVEL,
index 785ca981697105973a8079fde7ecddde7179274e..a4f0b428a34da88f1bcd0543973f46f3bf5dbb34 100644 (file)
@@ -91,7 +91,7 @@ static char *cplb_print_entry(char *buf, int type)
        } else
                buf += sprintf(buf, "Data CPLB entry:\n");
 
-       buf += sprintf(buf, "Address\t\tData\tSize\tValid\tLocked\tSwapin\n\tiCount\toCount\n");
+       buf += sprintf(buf, "Address\t\tData\tSize\tValid\tLocked\tSwapin\tiCount\toCount\n");
 
        while (*p_addr != 0xffffffff) {
                entry = cplb_find_entry(cplb_addr, cplb_data, *p_addr, *p_data);
index 946703ef48ffc912a45b93c7c10a05d0ccb848bc..6f909cbfac7b1c340fcbde3f6c4e2aea05fb5dd9 100644 (file)
@@ -73,7 +73,7 @@ ENTRY(_cplb_mgr)
        /* ICPLB Miss Exception. We need to choose one of the
        * currently-installed CPLBs, and replace it with one
        * from the configuration table.
-       */
+       */
 
        P4.L = LO(ICPLB_FAULT_ADDR);
        P4.H = HI(ICPLB_FAULT_ADDR);
@@ -222,7 +222,7 @@ ENTRY(_cplb_mgr)
 
        /* See if failed address > start address */
        CC = R4 <= R0(IU);
-       IF !CC JUMP .Linext;
+       IF !CC JUMP .Linext;
 
        /* extract page size (17:16)*/
        R3 = EXTRACT(R2, R1.L) (Z);
@@ -271,16 +271,27 @@ ENTRY(_cplb_mgr)
 
 /* FAILED CASES*/
 .Lno_page_in_table:
-       ( R7:4,P5:3 ) = [SP++];
        R0 = CPLB_NO_ADDR_MATCH;
-       RTS;
+       JUMP .Lfail_ret;
+
 .Lall_locked:
-       ( R7:4,P5:3 ) = [SP++];
        R0 = CPLB_NO_UNLOCKED;
-       RTS;
+       JUMP .Lfail_ret;
+
 .Lprot_violation:
-       ( R7:4,P5:3 ) = [SP++];
        R0 = CPLB_PROT_VIOL;
+
+.Lfail_ret:
+       /* Make sure we turn protection/cache back on, even in the failing case */
+       BITSET(R5,ENICPLB_P);
+       CLI R2;
+       SSYNC;          /* SSYNC required before writing to IMEM_CONTROL. */
+       .align 8;
+       [P4] = R5;
+       SSYNC;
+       STI R2;
+
+       ( R7:4,P5:3 ) = [SP++];
        RTS;
 
 .Ldcplb_write:
index e3ad5802868a2489865a761ae32b824b6a87ecc4..dc9d3ee2e69113ef9168c5ce4acf501e1057c760 100644 (file)
@@ -33,7 +33,7 @@
  * after a timer-interrupt and after each system call.
  */
 
-
+#include <linux/init.h>
 #include <linux/linkage.h>
 #include <linux/unistd.h>
 #include <asm/blackfin.h>
@@ -71,25 +71,44 @@ ENDPROC(_safe_speculative_execution)
  * This one does not lower the level to IRQ5, and thus can be used to
  * patch up CPLB misses on the kernel stack.
  */
-ENTRY(_ex_dcplb)
 #if ANOMALY_05000261
+#define _ex_dviol _ex_workaround_261
+#define _ex_dmiss _ex_workaround_261
+#define _ex_dmult _ex_workaround_261
+
+ENTRY(_ex_workaround_261)
        /*
         * Work around an anomaly: if we see a new DCPLB fault, return
         * without doing anything.  Then, if we get the same fault again,
         * handle it.
         */
+       P4 = R7;        /* Store EXCAUSE */
        p5.l = _last_cplb_fault_retx;
        p5.h = _last_cplb_fault_retx;
        r7 = [p5];
        r6 = retx;
        [p5] = r6;
        cc = r6 == r7;
-       if !cc jump _return_from_exception;
+       if !cc jump _bfin_return_from_exception;
        /* fall through */
+       R7 = P4;
+       R6 = 0x26;      /* Data CPLB Miss */
+       cc = R6 == R7;
+       if cc jump _ex_dcplb_miss (BP);
+       /* Handle 0x23 Data CPLB Protection Violation
+        * and Data CPLB Multiple Hits - Linux Trap Zero
+        */
+       jump _ex_trap_c;
+ENDPROC(_ex_workaround_261)
+
+#else
+#define _ex_dviol _ex_trap_c
+#define _ex_dmiss _ex_dcplb_miss
+#define _ex_dmult _ex_trap_c
 #endif
-ENDPROC(_ex_dcplb)
 
-ENTRY(_ex_icplb)
+ENTRY(_ex_dcplb_miss)
+ENTRY(_ex_icplb_miss)
        (R7:6,P5:4) = [sp++];
        ASTAT = [sp++];
        SAVE_ALL_SYS
@@ -98,7 +117,7 @@ ENTRY(_ex_icplb)
        RESTORE_ALL_SYS
        SP = EX_SCRATCH_REG;
        rtx;
-ENDPROC(_ex_icplb)
+ENDPROC(_ex_icplb_miss)
 
 ENTRY(_ex_syscall)
        DEBUG_START_HWTRACE(p5, r7)
@@ -120,7 +139,7 @@ ENTRY(_ex_single_step)
        r7 = retx;
        r6 = reti;
        cc = r7 == r6;
-       if cc jump _return_from_exception
+       if cc jump _bfin_return_from_exception
        r7 = syscfg;
        bitclr (r7, 0);
        syscfg = R7;
@@ -137,8 +156,9 @@ ENTRY(_ex_single_step)
        r7 = [p4];
        cc = r6 == r7;
        if !cc jump _ex_trap_c;
+ENDPROC(_ex_single_step)
 
-ENTRY(_return_from_exception)
+ENTRY(_bfin_return_from_exception)
        DEBUG_START_HWTRACE(p5, r7)
 #if ANOMALY_05000257
        R7=LC0;
@@ -150,7 +170,7 @@ ENTRY(_return_from_exception)
        ASTAT = [sp++];
        sp = EX_SCRATCH_REG;
        rtx;
-ENDPROC(_ex_soft_bp)
+ENDPROC(_bfin_return_from_exception)
 
 ENTRY(_handle_bad_cplb)
        /* To get here, we just tried and failed to change a CPLB
@@ -843,7 +863,7 @@ ENTRY(_ex_trace_buff_full)
        LC0 = [sp++];
        P2 = [sp++];
        P3 = [sp++];
-       jump _return_from_exception;
+       jump _bfin_return_from_exception;
 ENDPROC(_ex_trace_buff_full)
 
 #if CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN == 4
@@ -861,7 +881,7 @@ ENTRY(_software_trace_buff)
 #endif /* CONFIG_DEBUG_BFIN_HWTRACE_EXPAND */
 
 #if CONFIG_EARLY_PRINTK
-.section .init.text
+__INIT
 ENTRY(_early_trap)
        SAVE_ALL_SYS
        trace_buffer_stop(p0,r0);
@@ -896,6 +916,7 @@ ENTRY(_early_trap)
        call _early_trap_c;
        SP += 12;
 ENDPROC(_early_trap)
+__FINIT
 #endif /* CONFIG_EARLY_PRINTK */
 
 /*
@@ -908,6 +929,7 @@ ENDPROC(_early_trap)
 #else
 .data
 #endif
+
 ENTRY(_ex_table)
        /* entry for each EXCAUSE[5:0]
         * This table must be in sync with the table in ./kernel/traps.c
@@ -917,7 +939,7 @@ ENTRY(_ex_table)
        .long _ex_soft_bp       /* 0x01 - User Defined - Software breakpoint */
        .long _ex_replaceable   /* 0x02 - User Defined */
        .long _ex_trap_c        /* 0x03 - User Defined - userspace stack overflow */
-       .long _ex_replaceable   /* 0x04 - User Defined */
+       .long _ex_trap_c        /* 0x04 - User Defined - dump trace buffer */
        .long _ex_replaceable   /* 0x05 - User Defined */
        .long _ex_replaceable   /* 0x06 - User Defined */
        .long _ex_replaceable   /* 0x07 - User Defined */
@@ -952,16 +974,16 @@ ENTRY(_ex_table)
        .long _ex_trap_c        /* 0x20 - Reserved */
        .long _ex_trap_c        /* 0x21 - Undefined Instruction */
        .long _ex_trap_c        /* 0x22 - Illegal Instruction Combination */
-       .long _ex_dcplb         /* 0x23 - Data CPLB Protection Violation */
+       .long _ex_dviol         /* 0x23 - Data CPLB Protection Violation */
        .long _ex_trap_c        /* 0x24 - Data access misaligned */
        .long _ex_trap_c        /* 0x25 - Unrecoverable Event */
-       .long _ex_dcplb         /* 0x26 - Data CPLB Miss */
-       .long _ex_trap_c        /* 0x27 - Data CPLB Multiple Hits - Linux Trap Zero */
+       .long _ex_dmiss         /* 0x26 - Data CPLB Miss */
+       .long _ex_dmult         /* 0x27 - Data CPLB Multiple Hits - Linux Trap Zero */
        .long _ex_trap_c        /* 0x28 - Emulation Watchpoint */
        .long _ex_trap_c        /* 0x29 - Instruction fetch access error (535 only) */
        .long _ex_trap_c        /* 0x2A - Instruction fetch misaligned */
-       .long _ex_icplb         /* 0x2B - Instruction CPLB protection Violation */
-       .long _ex_icplb         /* 0x2C - Instruction CPLB miss */
+       .long _ex_trap_c        /* 0x2B - Instruction CPLB protection Violation */
+       .long _ex_icplb_miss    /* 0x2C - Instruction CPLB miss */
        .long _ex_trap_c        /* 0x2D - Instruction CPLB Multiple Hits */
        .long _ex_trap_c        /* 0x2E - Illegal use of Supervisor Resource */
        .long _ex_trap_c        /* 0x2E - Illegal use of Supervisor Resource */
index c6b32fe0f6e9f0b2cc12ebcaa3fd28e4e6ed89ef..4de376418a18650d2e956c5337a351384e2fe977 100644 (file)
@@ -30,7 +30,6 @@
 
 #include <asm/blackfin.h>
 #include <asm/mach/irq.h>
-#include <linux/autoconf.h>
 #include <linux/linkage.h>
 #include <asm/entry.h>
 #include <asm/asm-offsets.h>
index c2f05fabedc1c8f47e859d4821cecfe59e17c7b9..4882f0e801a9df1df9b40b36e4404775f1b5cc24 100644 (file)
@@ -181,7 +181,6 @@ static struct irq_chip bf561_internal_irqchip = {
        .unmask = bf561_internal_unmask_irq,
 };
 
-#ifdef CONFIG_IRQCHIP_DEMUX_GPIO
 static unsigned short gpio_enabled[gpio_bank(MAX_BLACKFIN_GPIOS)];
 static unsigned short gpio_edge_triggered[gpio_bank(MAX_BLACKFIN_GPIOS)];
 
@@ -362,8 +361,6 @@ static void bf561_demux_gpio_irq(unsigned int inta_irq,
 
 }
 
-#endif                         /* CONFIG_IRQCHIP_DEMUX_GPIO */
-
 void __init init_exception_vectors(void)
 {
        SSYNC();
@@ -413,26 +410,21 @@ int __init init_arch_irq(void)
                        set_irq_chip(irq, &bf561_core_irqchip);
                else
                        set_irq_chip(irq, &bf561_internal_irqchip);
-#ifdef CONFIG_IRQCHIP_DEMUX_GPIO
+
                if ((irq != IRQ_PROG0_INTA) &&
-                   (irq != IRQ_PROG1_INTA) && (irq != IRQ_PROG2_INTA)) {
-#endif
+                   (irq != IRQ_PROG1_INTA) &&
+                   (irq != IRQ_PROG2_INTA))
                        set_irq_handler(irq, handle_simple_irq);
-#ifdef CONFIG_IRQCHIP_DEMUX_GPIO
-               } else {
+               else
                        set_irq_chained_handler(irq, bf561_demux_gpio_irq);
-               }
-#endif
-
        }
 
-#ifdef CONFIG_IRQCHIP_DEMUX_GPIO
        for (irq = IRQ_PF0; irq <= IRQ_PF47; irq++) {
                set_irq_chip(irq, &bf561_gpio_irqchip);
                /* if configured as edge, then will be changed to do_edge_IRQ */
                set_irq_handler(irq, handle_level_irq);
        }
-#endif
+
        bfin_write_IMASK(0);
        CSYNC();
        ilat = bfin_read_ILAT();
@@ -457,9 +449,8 @@ int __init init_arch_irq(void)
 }
 
 #ifdef CONFIG_DO_IRQ_L1
-void do_irq(int vec, struct pt_regs *fp)__attribute__((l1_text));
+__attribute__((l1_text))
 #endif
-
 void do_irq(int vec, struct pt_regs *fp)
 {
        if (vec == EVT_IVTMR_P) {
index 2d2b63567b301d80c7223e8025e4acab279847ca..147f0731087a031bb2514e29bdecdab7147138fe 100644 (file)
@@ -308,7 +308,7 @@ static void bfin_demux_error_irq(unsigned int int_err_irq,
 }
 #endif                         /* BF537_GENERIC_ERROR_INT_DEMUX */
 
-#if defined(CONFIG_IRQCHIP_DEMUX_GPIO) && !defined(CONFIG_BF54x)
+#if !defined(CONFIG_BF54x)
 
 static unsigned short gpio_enabled[gpio_bank(MAX_BLACKFIN_GPIOS)];
 static unsigned short gpio_edge_triggered[gpio_bank(MAX_BLACKFIN_GPIOS)];
@@ -464,7 +464,7 @@ static void bfin_demux_gpio_irq(unsigned int intb_irq,
        }
 }
 
-#else                          /* CONFIG_IRQCHIP_DEMUX_GPIO */
+#else                          /* CONFIG_BF54x */
 
 #define NR_PINT_SYS_IRQS       4
 #define NR_PINT_BITS           32
@@ -726,7 +726,7 @@ static void bfin_demux_gpio_irq(unsigned int intb_irq,
        }
 
 }
-#endif                         /* CONFIG_IRQCHIP_DEMUX_GPIO */
+#endif
 
 void __init init_exception_vectors(void)
 {
@@ -766,10 +766,10 @@ int __init init_arch_irq(void)
        bfin_write_SIC_IMASK1(SIC_UNMASK_ALL);
        bfin_write_SIC_IWR0(IWR_ENABLE_ALL);
        bfin_write_SIC_IWR1(IWR_ENABLE_ALL);
-#ifdef CONFIG_BF54x
+# ifdef CONFIG_BF54x
        bfin_write_SIC_IMASK2(SIC_UNMASK_ALL);
        bfin_write_SIC_IWR2(IWR_ENABLE_ALL);
-#endif
+# endif
 #else
        bfin_write_SIC_IMASK(SIC_UNMASK_ALL);
        bfin_write_SIC_IWR(IWR_ENABLE_ALL);
@@ -778,13 +778,13 @@ int __init init_arch_irq(void)
 
        local_irq_disable();
 
-#if defined(CONFIG_IRQCHIP_DEMUX_GPIO) && defined(CONFIG_BF54x)
-#ifdef CONFIG_PINTx_REASSIGN
+#ifdef CONFIG_BF54x
+# ifdef CONFIG_PINTx_REASSIGN
        pint[0]->assign = CONFIG_PINT0_ASSIGN;
        pint[1]->assign = CONFIG_PINT1_ASSIGN;
        pint[2]->assign = CONFIG_PINT2_ASSIGN;
        pint[3]->assign = CONFIG_PINT3_ASSIGN;
-#endif
+# endif
        /* Whenever PINTx_ASSIGN is altered init_pint_lut() must be executed! */
        init_pint_lut();
 #endif
@@ -799,18 +799,17 @@ int __init init_arch_irq(void)
 #endif
 
                        switch (irq) {
-#ifdef CONFIG_IRQCHIP_DEMUX_GPIO
 #if defined(CONFIG_BF53x)
                        case IRQ_PROG_INTA:
                                set_irq_chained_handler(irq,
                                                        bfin_demux_gpio_irq);
                                break;
-#if defined(BF537_FAMILY) && !(defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE))
+# if defined(BF537_FAMILY) && !(defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE))
                        case IRQ_MAC_RX:
                                set_irq_chained_handler(irq,
                                                        bfin_demux_gpio_irq);
                                break;
-#endif
+# endif
 #elif defined(CONFIG_BF54x)
                        case IRQ_PINT0:
                                set_irq_chained_handler(irq,
@@ -841,7 +840,6 @@ int __init init_arch_irq(void)
                                set_irq_chained_handler(irq,
                                                        bfin_demux_gpio_irq);
                                break;
-#endif
 #endif
                        default:
                                set_irq_handler(irq, handle_simple_irq);
@@ -861,7 +859,6 @@ int __init init_arch_irq(void)
        }
 #endif
 
-#ifdef CONFIG_IRQCHIP_DEMUX_GPIO
 #ifndef CONFIG_BF54x
        for (irq = IRQ_PF0; irq < NR_IRQS; irq++) {
 #else
@@ -871,7 +868,7 @@ int __init init_arch_irq(void)
                /* if configured as edge, then will be changed to do_edge_IRQ */
                set_irq_handler(irq, handle_level_irq);
        }
-#endif
+
        bfin_write_IMASK(0);
        CSYNC();
        ilat = bfin_read_ILAT();
@@ -896,9 +893,8 @@ int __init init_arch_irq(void)
 }
 
 #ifdef CONFIG_DO_IRQ_L1
-void do_irq(int vec, struct pt_regs *fp) __attribute__((l1_text));
+__attribute__((l1_text))
 #endif
-
 void do_irq(int vec, struct pt_regs *fp)
 {
        if (vec == EVT_IVTMR_P) {
index f05e3dadaf335c0f28d8fe5c42ade7a514427f69..b22959b197e5c3e3d0643c19653092fa93238072 100644 (file)
@@ -153,27 +153,29 @@ asmlinkage void irq_panic(int reason, struct pt_regs *regs)
                case (SEQSTAT_HWERRCAUSE_SYSTEM_MMR):   /* System MMR Error */
                        info.si_code = BUS_ADRALN;
                        sig = SIGBUS;
-                       printk(KERN_EMERG HWC_x2);
+                       printk(KERN_EMERG HWC_x2(KERN_EMERG));
                        break;
                case (SEQSTAT_HWERRCAUSE_EXTERN_ADDR):  /* External Memory Addressing Error */
                        info.si_code = BUS_ADRERR;
                        sig = SIGBUS;
-                       printk(KERN_EMERG HWC_x3);
+                       printk(KERN_EMERG HWC_x3(KERN_EMERG));
                        break;
                case (SEQSTAT_HWERRCAUSE_PERF_FLOW):    /* Performance Monitor Overflow */
-                       printk(KERN_EMERG HWC_x12);
+                       printk(KERN_EMERG HWC_x12(KERN_EMERG));
                        break;
                case (SEQSTAT_HWERRCAUSE_RAISE_5):      /* RAISE 5 instruction */
-                       printk(KERN_EMERG HWC_x18);
+                       printk(KERN_EMERG HWC_x18(KERN_EMERG));
                        break;
                default:        /* Reserved */
-                       printk(KERN_EMERG HWC_default);
+                       printk(KERN_EMERG HWC_default(KERN_EMERG));
                        break;
                }
        }
 
        regs->ipend = bfin_read_IPEND();
-       dump_bfin_regs(regs, (void *)regs->pc);
+       dump_bfin_process(regs);
+       dump_bfin_mem((void *)regs->pc);
+       show_regs(regs);
        if (0 == (info.si_signo = sig) || 0 == user_mode(regs)) /* in kernelspace */
                panic("Unhandled IRQ or exceptions!\n");
        else {                  /* in userspace */
index b99ea883cd22bdafa38377d1e8d4d66c9a55da93..e41f0e8ecacbd33d463295897aa1454d7b1e6023 100644 (file)
@@ -27,7 +27,6 @@
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <linux/autoconf.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
index 21900a9378bbc04b4bb5fccd6161fb86a4d86ecd..222da1501f47c0e81508996e8f74ec7c5ff21353 100644 (file)
@@ -13,6 +13,10 @@ config ZONE_DMA
        bool
        default y
 
+config NO_DMA
+       bool
+       default y
+
 config RWSEM_GENERIC_SPINLOCK
        bool
        default y
@@ -57,6 +61,10 @@ menu "General setup"
 
 source "fs/Kconfig.binfmt"
 
+config GENERIC_HARDIRQS
+       bool
+       default y
+
 config ETRAX_CMDLINE
        string "Kernel command line"
        default "root=/dev/mtdblock3"
@@ -149,7 +157,8 @@ source "net/Kconfig"
 
 # bring in ETRAX built-in drivers
 menu "Drivers for built-in interfaces"
-source arch/cris/arch-v10/drivers/Kconfig
+# arch/cris/arch is a symlink to correct arch (arch-v10 or arch-v32)
+source arch/cris/arch/drivers/Kconfig
 
 endmenu
 
@@ -180,6 +189,10 @@ source "drivers/isdn/Kconfig"
 
 source "drivers/telephony/Kconfig"
 
+source "drivers/i2c/Kconfig"
+
+source "drivers/rtc/Kconfig"
+
 #
 # input before char - char/joystick depends on it. As does USB.
 #
@@ -194,6 +207,10 @@ source "fs/Kconfig"
 
 source "sound/Kconfig"
 
+source "drivers/pcmcia/Kconfig"
+
+source "drivers/pci/Kconfig"
+
 source "drivers/usb/Kconfig"
 
 source "kernel/Kconfig.instrumentation"
index 710c20ba2be7ae79fdf618317a2c4e845dc47a19..572f119263996bbd23050fd6dc32c353b2675664 100644 (file)
@@ -99,7 +99,6 @@ CONFIG_MTD=y
 CONFIG_MTD_CFI=y
 # CONFIG_MTD_CFI_INTELEXT is not set
 CONFIG_MTD_CFI_AMDSTD=y
-CONFIG_MTD_AMDSTD=y
 CONFIG_MTD_CHAR=y
 CONFIG_MTD_BLOCK=y
 CONFIG_ETRAX_I2C=y
@@ -145,7 +144,6 @@ CONFIG_MTD_CFI=y
 # CONFIG_MTD_CFI_GEOMETRY is not set
 # CONFIG_MTD_CFI_INTELEXT is not set
 CONFIG_MTD_CFI_AMDSTD=y
-CONFIG_MTD_AMDSTD=y
 # CONFIG_MTD_SHARP is not set
 # CONFIG_MTD_PHYSMAP is not set
 # CONFIG_MTD_NORA is not set
index 03e2e68f947dd7c3d49424e5781ec9e1f4e3cf57..faf8b4d3ca01c66f37e5d4d9e4fd43a2d0728c27 100644 (file)
@@ -2,6 +2,7 @@ config ETRAX_ETHERNET
        bool "Ethernet support"
        depends on ETRAX_ARCH_V10
        select NET_ETHERNET
+       select MII
        help
          This option enables the ETRAX 100LX built-in 10/100Mbit Ethernet
          controller.
@@ -605,8 +606,6 @@ config ETRAX_AXISFLASHMAP
        select MTD
        select MTD_CFI
        select MTD_CFI_AMDSTD
-       select MTD_OBSOLETE_CHIPS
-       select MTD_AMDSTD
        select MTD_CHAR
        select MTD_BLOCK
        select MTD_PARTITIONS
index efd7b0f3a91042aa85455309594979ec6de44a3a..ea3cf2e39a14d943ab5532f53aeaf1560cd7be32 100644 (file)
@@ -312,12 +312,12 @@ static struct mtd_info *probe_cs(struct map_info *map_cs)
                "%s: Probing a 0x%08lx bytes large window at 0x%08lx.\n",
               map_cs->name, map_cs->size, map_cs->map_priv_1);
 
-#ifdef CONFIG_MTD_AMDSTD
-       mtd_cs = do_map_probe("amd_flash", map_cs);
-#endif
 #ifdef CONFIG_MTD_CFI
+       mtd_cs = do_map_probe("cfi_probe", map_cs);
+#endif
+#ifdef CONFIG_MTD_JEDECPROBE
        if (!mtd_cs) {
-               mtd_cs = do_map_probe("cfi_probe", map_cs);
+               mtd_cs = do_map_probe("jedec_probe", map_cs);
        }
 #endif
 
index f389ed6998fe4f92ec9fc28b95ce2cc8cbd65e34..0d347a7058355c0d9ff7e90cbd0e73a0b535b6af 100644 (file)
@@ -297,8 +297,10 @@ gpio_poll(struct file *file,
                data = *R_PORT_PB_DATA;
        else if (priv->minor == GPIO_MINOR_G)
                data = *R_PORT_G_DATA;
-       else
+       else {
+               spin_unlock(&gpio_lock);
                return 0;
+       }
        
        if ((data & priv->highalarm) ||
            (~data & priv->lowalarm)) {
@@ -381,18 +383,21 @@ static ssize_t gpio_write(struct file * file, const char * buf, size_t count,
 
        ssize_t retval = count;
        if (priv->minor !=GPIO_MINOR_A && priv->minor != GPIO_MINOR_B) {
-               return -EFAULT;
+               retval = -EFAULT;
+               goto out;
        }
     
        if (!access_ok(VERIFY_READ, buf, count)) {
-               return -EFAULT;
+               retval = -EFAULT;
+               goto out;
        }
        clk_mask = priv->clk_mask;
        data_mask = priv->data_mask;
        /* It must have been configured using the IO_CFG_WRITE_MODE */
        /* Perhaps a better error code? */
        if (clk_mask == 0 || data_mask == 0) {
-               return -EPERM;
+               retval = -EPERM;
+               goto out;
        }
        write_msb = priv->write_msb;
        D(printk("gpio_write: %lu to data 0x%02X clk 0x%02X msb: %i\n",count, data_mask, clk_mask, write_msb));
@@ -425,6 +430,7 @@ static ssize_t gpio_write(struct file * file, const char * buf, size_t count,
                        }
                }
        }
+out:
        spin_unlock(&gpio_lock);
        return retval;
 }
@@ -506,6 +512,7 @@ gpio_release(struct inode *inode, struct file *filp)
        while (p) {
                if (p->highalarm | p->lowalarm) {
                        gpio_some_alarms = 1;
+                       spin_unlock(&gpio_lock);
                        return 0;
                }
                p = p->next;
index c5844cb70f095bc96333bc46f9b114db2f725439..ec62c951fa3cc37a1dd709609cd1a9bfa669ef1a 100644 (file)
@@ -500,9 +500,8 @@ _work_notifysig:
        ;; deal with pending signals and notify-resume requests
 
        move.d  $r9, $r10       ; do_notify_resume syscall/irq param
-       moveq   0, $r11         ; oldset param - 0 in this case
-       move.d  $sp, $r12       ; the regs param
-       move.d  $r1, $r13       ; the thread_info_flags parameter
+       move.d  $sp, $r11       ; the regs param
+       move.d  $r1, $r12       ; the thread_info_flags parameter
        jsr     do_notify_resume
        
        ba _Rexit
@@ -678,13 +677,19 @@ IRQ1_interrupt:
        push    $r10            ; push orig_r10
        clear.d [$sp=$sp-4]     ; frametype == 0, normal frame
 
+       ;; If there is a glitch on the NMI pin shorter than ~100ns
+       ;; (i.e. non-active by the time we get here) then the nmi_pin bit
+       ;; in R_IRQ_MASK0_RD will already be cleared.  The watchdog_nmi bit
+       ;; is cleared by us however (when feeding the watchdog), which is why
+       ;; we use that bit to determine what brought us here.
+
        move.d  [R_IRQ_MASK0_RD], $r1 ; External NMI or watchdog?
-       and.d   0x80000000, $r1
-       beq     wdog
+       and.d   (1<<30), $r1
+       bne     wdog
        move.d  $sp, $r10
        jsr     handle_nmi
        setf m                  ; Enable NMI again
-       retb                    ; Return from NMI
+       ba      _Rexit          ; Return the standard way
        nop
 wdog:
 #if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM)
@@ -775,22 +780,9 @@ multiple_interrupt:
        push    $r10            ; push orig_r10
        clear.d [$sp=$sp-4]     ; frametype == 0, normal frame
        
-       moveq   2, $r2          ; first bit we care about is the timer0 irq
-       move.d  [R_VECT_MASK_RD], $r0; read the irq bits that triggered the multiple irq
-       move.d  $r0, [R_VECT_MASK_CLR] ; Block all active IRQs
-1:     
-       btst    $r2, $r0        ; check for the irq given by bit r2
-       bpl     2f
-       move.d  $r2, $r10       ; First argument to do_IRQ
-       move.d  $sp, $r11       ; second argument to do_IRQ
-       jsr     do_IRQ
-2:
-       addq    1, $r2          ; next vector bit
-       cmp.b   32, $r2
-       bne     1b      ; process all irq's up to and including number 31
-       moveq   0, $r9  ; make ret_from_intr realise we came from an ir
+       move.d  $sp, $r10
+       jsr     do_multiple_IRQ
        
-       move.d  $r0, [R_VECT_MASK_SET] ;  Unblock all the IRQs
        jump    ret_from_intr
 
 do_sigtrap:
@@ -837,6 +829,13 @@ _ugdb_handle_breakpoint:
        ba      do_sigtrap              ; SIGTRAP the offending process. 
        pop     $dccr                   ; Restore dccr in delay slot.
        
+       .global kernel_execve
+kernel_execve:
+       move.d __NR_execve, $r9
+       break 13
+       ret
+       nop
+
        .data
 
 hw_bp_trigs:
@@ -1135,6 +1134,42 @@ sys_call_table:
        .long sys_add_key
        .long sys_request_key
        .long sys_keyctl
+       .long sys_ioprio_set
+       .long sys_ioprio_get            /* 290 */
+       .long sys_inotify_init
+       .long sys_inotify_add_watch
+       .long sys_inotify_rm_watch
+       .long sys_migrate_pages
+       .long sys_openat                /* 295 */
+       .long sys_mkdirat
+       .long sys_mknodat
+       .long sys_fchownat
+       .long sys_futimesat
+       .long sys_fstatat64             /* 300 */
+       .long sys_unlinkat
+       .long sys_renameat
+       .long sys_linkat
+       .long sys_symlinkat
+       .long sys_readlinkat            /* 305 */
+       .long sys_fchmodat
+       .long sys_faccessat
+       .long sys_pselect6
+       .long sys_ppoll
+       .long sys_unshare               /* 310 */
+       .long sys_set_robust_list
+       .long sys_get_robust_list
+       .long sys_splice
+       .long sys_sync_file_range
+       .long sys_tee                   /* 315 */
+       .long sys_vmsplice
+       .long sys_move_pages
+       .long sys_getcpu
+       .long sys_epoll_pwait
+       .long sys_utimensat             /* 320 */
+       .long sys_signalfd
+       .long sys_timerfd
+       .long sys_eventfd
+       .long sys_fallocate
 
         /*
          * NOTE!! This doesn't have to be exact - we just have
index d3ea052e5ee148581a64d451e45d3033ad23ea67..c1a3a2100ee71e1094a8df045bec8f5948ef5023 100644 (file)
@@ -1,97 +1,9 @@
-/* $Id: fasttimer.c,v 1.9 2005/03/04 08:16:16 starvik Exp $
+/*
  * linux/arch/cris/kernel/fasttimer.c
  *
  * Fast timers for ETRAX100/ETRAX100LX
- * This may be useful in other OS than Linux so use 2 space indentation...
  *
- * $Log: fasttimer.c,v $
- * Revision 1.9  2005/03/04 08:16:16  starvik
- * Merge of Linux 2.6.11.
- *
- * Revision 1.8  2005/01/05 06:09:29  starvik
- * cli()/sti() will be obsolete in 2.6.11.
- *
- * Revision 1.7  2005/01/03 13:35:46  starvik
- * Removed obsolete stuff.
- * Mark fast timer IRQ as not shared.
- *
- * Revision 1.6  2004/05/14 10:18:39  starvik
- * Export fast_timer_list
- *
- * Revision 1.5  2004/05/14 07:58:01  starvik
- * Merge of changes from 2.4
- *
- * Revision 1.4  2003/07/04 08:27:41  starvik
- * Merge of Linux 2.5.74
- *
- * Revision 1.3  2002/12/12 08:26:32  starvik
- * Don't use C-comments inside CVS comments
- *
- * Revision 1.2  2002/12/11 15:42:02  starvik
- * Extracted v10 (ETRAX 100LX) specific stuff from arch/cris/kernel/
- *
- * Revision 1.1  2002/11/18 07:58:06  starvik
- * Fast timers (from Linux 2.4)
- *
- * Revision 1.5  2002/10/15 06:21:39  starvik
- * Added call to init_waitqueue_head
- *
- * Revision 1.4  2002/05/28 17:47:59  johana
- * Added del_fast_timer()
- *
- * Revision 1.3  2002/05/28 16:16:07  johana
- * Handle empty fast_timer_list
- *
- * Revision 1.2  2002/05/27 15:38:42  johana
- * Made it compile without warnings on Linux 2.4.
- * (includes, wait_queue, PROC_FS and snprintf)
- *
- * Revision 1.1  2002/05/27 15:32:25  johana
- * arch/etrax100/kernel/fasttimer.c v1.8 from the elinux tree.
- *
- * Revision 1.8  2001/11/27 13:50:40  pkj
- * Disable interrupts while stopping the timer and while modifying the
- * list of active timers in timer1_handler() as it may be interrupted
- * by other interrupts (e.g., the serial interrupt) which may add fast
- * timers.
- *
- * Revision 1.7  2001/11/22 11:50:32  pkj
- * * Only store information about the last 16 timers.
- * * proc_fasttimer_read() now uses an allocated buffer, since it
- *   requires more space than just a page even for only writing the
- *   last 16 timers. The buffer is only allocated on request, so
- *   unless /proc/fasttimer is read, it is never allocated.
- * * Renamed fast_timer_started to fast_timers_started to match
- *   fast_timers_added and fast_timers_expired.
- * * Some clean-up.
- *
- * Revision 1.6  2000/12/13 14:02:08  johana
- * Removed volatile for fast_timer_list
- *
- * Revision 1.5  2000/12/13 13:55:35  johana
- * Added DEBUG_LOG, added som cli() and cleanup
- *
- * Revision 1.4  2000/12/05 13:48:50  johana
- * Added range check when writing proc file, modified timer int handling
- *
- * Revision 1.3  2000/11/23 10:10:20  johana
- * More debug/logging possibilities.
- * Moved GET_JIFFIES_USEC() to timex.h and time.c
- *
- * Revision 1.2  2000/11/01 13:41:04  johana
- * Clean up and bugfixes.
- * Created new do_gettimeofday_fast() that gets a timeval struct
- * with time based on jiffies and *R_TIMER0_DATA, uses a table
- * for fast conversion of timer value to microseconds.
- * (Much faster the standard do_gettimeofday() and we don't really
- * want to use the true time - we want the "uptime" so timers don't screw up
- * when we change the time.
- * TODO: Add efficient support for continuous timers as well.
- *
- * Revision 1.1  2000/10/26 15:49:16  johana
- * Added fasttimer, highresolution timers.
- *
- * Copyright (C) 2000,2001 2002 Axis Communications AB, Lund, Sweden
+ * Copyright (C) 2000-2007 Axis Communications AB, Lund, Sweden
  */
 
 #include <linux/errno.h>
 
 #ifdef FAST_TIMER_SANITY_CHECKS
 #define SANITYCHECK(x) x
-static int sanity_failed = 0;
+static int sanity_failed;
 #else
 #define SANITYCHECK(x)
 #endif
@@ -134,15 +46,13 @@ static int sanity_failed = 0;
 #define D2(x)
 #define DP(x)
 
-#define __INLINE__ inline
-
-static int fast_timer_running = 0;
-static int fast_timers_added = 0;
-static int fast_timers_started = 0;
-static int fast_timers_expired = 0;
-static int fast_timers_deleted = 0;
-static int fast_timer_is_init = 0;
-static int fast_timer_ints = 0;
+static unsigned int fast_timer_running;
+static unsigned int fast_timers_added;
+static unsigned int fast_timers_started;
+static unsigned int fast_timers_expired;
+static unsigned int fast_timers_deleted;
+static unsigned int fast_timer_is_init;
+static unsigned int fast_timer_ints;
 
 struct fast_timer *fast_timer_list = NULL;
 
@@ -150,8 +60,8 @@ struct fast_timer *fast_timer_list = NULL;
 #define DEBUG_LOG_MAX 128
 static const char * debug_log_string[DEBUG_LOG_MAX];
 static unsigned long debug_log_value[DEBUG_LOG_MAX];
-static int debug_log_cnt = 0;
-static int debug_log_cnt_wrapped = 0;
+static unsigned int debug_log_cnt;
+static unsigned int debug_log_cnt_wrapped;
 
 #define DEBUG_LOG(string, value) \
 { \
@@ -206,45 +116,29 @@ int timer_freq_settings[NUM_TIMER_STATS];
 int timer_delay_settings[NUM_TIMER_STATS];
 
 /* Not true gettimeofday, only checks the jiffies (uptime) + useconds */
-void __INLINE__ do_gettimeofday_fast(struct timeval *tv)
+inline void do_gettimeofday_fast(struct fasttime_t *tv)
 {
-  unsigned long sec = jiffies;
-  unsigned long usec = GET_JIFFIES_USEC();
-
-  usec += (sec % HZ) * (1000000 / HZ);
-  sec = sec / HZ;
-
-  if (usec > 1000000)
-  {
-    usec -= 1000000;
-    sec++;
-  }
-  tv->tv_sec = sec;
-  tv->tv_usec = usec;
+       tv->tv_jiff = jiffies;
+       tv->tv_usec = GET_JIFFIES_USEC();
 }
 
-int __INLINE__ timeval_cmp(struct timeval *t0, struct timeval *t1)
+inline int fasttime_cmp(struct fasttime_t *t0, struct fasttime_t *t1)
 {
-  if (t0->tv_sec < t1->tv_sec)
-  {
-    return -1;
-  }
-  else if (t0->tv_sec > t1->tv_sec)
-  {
-    return 1;
-  }
-  if (t0->tv_usec < t1->tv_usec)
-  {
-    return -1;
-  }
-  else if (t0->tv_usec > t1->tv_usec)
-  {
-    return 1;
-  }
-  return 0;
+       /* Compare jiffies. Takes care of wrapping */
+       if (time_before(t0->tv_jiff, t1->tv_jiff))
+               return -1;
+       else if (time_after(t0->tv_jiff, t1->tv_jiff))
+               return 1;
+
+       /* Compare us */
+       if (t0->tv_usec < t1->tv_usec)
+               return -1;
+       else if (t0->tv_usec > t1->tv_usec)
+               return 1;
+       return 0;
 }
 
-void __INLINE__ start_timer1(unsigned long delay_us)
+inline void start_timer1(unsigned long delay_us)
 {
   int freq_index = 0; /* This is the lowest resolution */
   unsigned long upper_limit = MAX_DELAY_US;
@@ -285,7 +179,7 @@ void __INLINE__ start_timer1(unsigned long delay_us)
   timer_freq_settings[fast_timers_started % NUM_TIMER_STATS] = freq_index;
   timer_delay_settings[fast_timers_started % NUM_TIMER_STATS] = delay_us;
 
-  D1(printk("start_timer1 : %d us freq: %i div: %i\n",
+       D1(printk(KERN_DEBUG "start_timer1 : %d us freq: %i div: %i\n",
             delay_us, freq_index, div));
   /* Clear timer1 irq */
   *R_IRQ_MASK0_CLR = IO_STATE(R_IRQ_MASK0_CLR, timer1, clr);
@@ -340,7 +234,7 @@ void start_one_shot_timer(struct fast_timer *t,
         printk(KERN_WARNING
                "timer name: %s data: 0x%08lX already in list!\n", name, data);
         sanity_failed++;
-        return;
+                               goto done;
       }
       else
       {
@@ -356,11 +250,11 @@ void start_one_shot_timer(struct fast_timer *t,
   t->name = name;
 
   t->tv_expires.tv_usec = t->tv_set.tv_usec + delay_us % 1000000;
-  t->tv_expires.tv_sec  = t->tv_set.tv_sec  + delay_us / 1000000;
+       t->tv_expires.tv_jiff = t->tv_set.tv_jiff + delay_us / 1000000 / HZ;
   if (t->tv_expires.tv_usec > 1000000)
   {
     t->tv_expires.tv_usec -= 1000000;
-    t->tv_expires.tv_sec++;
+               t->tv_expires.tv_jiff += HZ;
   }
 #ifdef FAST_TIMER_LOG
   timer_added_log[fast_timers_added % NUM_TIMER_STATS] = *t;
@@ -368,7 +262,7 @@ void start_one_shot_timer(struct fast_timer *t,
   fast_timers_added++;
 
   /* Check if this should timeout before anything else */
-  if (tmp == NULL || timeval_cmp(&t->tv_expires, &tmp->tv_expires) < 0)
+       if (tmp == NULL || fasttime_cmp(&t->tv_expires, &tmp->tv_expires) < 0)
   {
     /* Put first in list and modify the timer value */
     t->prev = NULL;
@@ -384,8 +278,8 @@ void start_one_shot_timer(struct fast_timer *t,
     start_timer1(delay_us);
   } else {
     /* Put in correct place in list */
-    while (tmp->next &&
-           timeval_cmp(&t->tv_expires, &tmp->next->tv_expires) > 0)
+               while (tmp->next && fasttime_cmp(&t->tv_expires,
+                               &tmp->next->tv_expires) > 0)
     {
       tmp = tmp->next;
     }
@@ -401,6 +295,7 @@ void start_one_shot_timer(struct fast_timer *t,
 
   D2(printk("start_one_shot_timer: %d us done\n", delay_us));
 
+done:
   local_irq_restore(flags);
 } /* start_one_shot_timer */
 
@@ -444,11 +339,18 @@ int del_fast_timer(struct fast_timer * t)
 /* Timer 1 interrupt handler */
 
 static irqreturn_t
-timer1_handler(int irq, void *dev_id, struct pt_regs *regs)
+timer1_handler(int irq, void *dev_id)
 {
   struct fast_timer *t;
   unsigned long flags;
 
+       /* We keep interrupts disabled not only when we modify the
+        * fast timer list, but any time we hold a reference to a
+        * timer in the list, since del_fast_timer may be called
+        * from (another) interrupt context.  Thus, the only time
+        * when interrupts are enabled is when calling the timer
+        * callback function.
+        */
   local_irq_save(flags);
 
   /* Clear timer1 irq */
@@ -466,18 +368,19 @@ timer1_handler(int irq, void *dev_id, struct pt_regs *regs)
   fast_timer_running = 0;
   fast_timer_ints++;
 
-  local_irq_restore(flags);
-
   t = fast_timer_list;
   while (t)
   {
-    struct timeval tv;
+               struct fasttime_t tv;
+               fast_timer_function_type *f;
+               unsigned long d;
 
     /* Has it really expired? */
     do_gettimeofday_fast(&tv);
-    D1(printk("t: %is %06ius\n", tv.tv_sec, tv.tv_usec));
+               D1(printk(KERN_DEBUG "t: %is %06ius\n",
+                       tv.tv_jiff, tv.tv_usec));
 
-    if (timeval_cmp(&t->tv_expires, &tv) <= 0)
+               if (fasttime_cmp(&t->tv_expires, &tv) <= 0)
     {
       /* Yes it has expired */
 #ifdef FAST_TIMER_LOG
@@ -486,7 +389,6 @@ timer1_handler(int irq, void *dev_id, struct pt_regs *regs)
       fast_timers_expired++;
 
       /* Remove this timer before call, since it may reuse the timer */
-      local_irq_save(flags);
       if (t->prev)
       {
         t->prev->next = t->next;
@@ -501,16 +403,23 @@ timer1_handler(int irq, void *dev_id, struct pt_regs *regs)
       }
       t->prev = NULL;
       t->next = NULL;
-      local_irq_restore(flags);
 
-      if (t->function != NULL)
-      {
-        t->function(t->data);
-      }
-      else
-      {
+                       /* Save function callback data before enabling
+                        * interrupts, since the timer may be removed and
+                        * we don't know how it was allocated
+                        * (e.g. ->function and ->data may become overwritten
+                        * after deletion if the timer was stack-allocated).
+                        */
+                       f = t->function;
+                       d = t->data;
+
+                       if (f != NULL) {
+                               /* Run callback with interrupts enabled. */
+                               local_irq_restore(flags);
+                               f(d);
+                               local_irq_save(flags);
+                       } else
         DEBUG_LOG("!timer1 %i function==NULL!\n", fast_timer_ints);
-      }
     }
     else
     {
@@ -518,16 +427,20 @@ timer1_handler(int irq, void *dev_id, struct pt_regs *regs)
       D1(printk(".\n"));
     }
 
-    local_irq_save(flags);
     if ((t = fast_timer_list) != NULL)
     {
       /* Start next timer.. */
-      long us;
-      struct timeval tv;
+                       long us = 0;
+                       struct fasttime_t tv;
 
       do_gettimeofday_fast(&tv);
-      us = ((t->tv_expires.tv_sec - tv.tv_sec) * 1000000 +
-            t->tv_expires.tv_usec - tv.tv_usec);
+
+                       /* time_after_eq takes care of wrapping */
+                       if (time_after_eq(t->tv_expires.tv_jiff, tv.tv_jiff))
+                               us = ((t->tv_expires.tv_jiff - tv.tv_jiff) *
+                                       1000000 / HZ + t->tv_expires.tv_usec -
+                                       tv.tv_usec);
+
       if (us > 0)
       {
         if (!fast_timer_running)
@@ -537,7 +450,6 @@ timer1_handler(int irq, void *dev_id, struct pt_regs *regs)
 #endif
           start_timer1(us);
         }
-        local_irq_restore(flags);
         break;
       }
       else
@@ -548,9 +460,10 @@ timer1_handler(int irq, void *dev_id, struct pt_regs *regs)
         D1(printk("e! %d\n", us));
       }
     }
-    local_irq_restore(flags);
   }
 
+       local_irq_restore(flags);
+
   if (!t)
   {
     D1(printk("t1 stop!\n"));
@@ -575,28 +488,17 @@ static void wake_up_func(unsigned long data)
 void schedule_usleep(unsigned long us)
 {
   struct fast_timer t;
-#ifdef DECLARE_WAITQUEUE
   wait_queue_head_t sleep_wait;
   init_waitqueue_head(&sleep_wait);
-  {
-  DECLARE_WAITQUEUE(wait, current);
-#else
-  struct wait_queue *sleep_wait = NULL;
-  struct wait_queue wait = { current, NULL };
-#endif
 
   D1(printk("schedule_usleep(%d)\n", us));
-  add_wait_queue(&sleep_wait, &wait);
-  set_current_state(TASK_INTERRUPTIBLE);
   start_one_shot_timer(&t, wake_up_func, (unsigned long)&sleep_wait, us,
                        "usleep");
-  schedule();
-  set_current_state(TASK_RUNNING);
-  remove_wait_queue(&sleep_wait, &wait);
+       /* Uninterruptible sleep on the fast timer. (The condition is somewhat
+        * redundant since the timer is what wakes us up.) */
+       wait_event(sleep_wait, !fast_timer_pending(&t));
+
   D1(printk("done schedule_usleep(%d)\n", us));
-#ifdef DECLARE_WAITQUEUE
-  }
-#endif  
 }
 
 #ifdef CONFIG_PROC_FS
@@ -616,7 +518,7 @@ static int proc_fasttimer_read(char *buf, char **start, off_t offset, int len
   unsigned long flags;
   int i = 0;
   int num_to_show;
-  struct timeval tv;
+       struct fasttime_t tv;
   struct fast_timer *t, *nextt;
   static char *bigbuf = NULL;
   static unsigned long used;
@@ -624,7 +526,8 @@ static int proc_fasttimer_read(char *buf, char **start, off_t offset, int len
   if (!bigbuf && !(bigbuf = vmalloc(BIG_BUF_SIZE)))
   {
     used = 0;
-    bigbuf[0] = '\0';
+       if (buf)
+               buf[0] = '\0';
     return 0;
   }
 
@@ -646,7 +549,7 @@ static int proc_fasttimer_read(char *buf, char **start, off_t offset, int len
     used += sprintf(bigbuf + used, "Fast timer running:    %s\n",
                     fast_timer_running ? "yes" : "no");
     used += sprintf(bigbuf + used, "Current time:          %lu.%06lu\n",
-                    (unsigned long)tv.tv_sec,
+                       (unsigned long)tv.tv_jiff,
                     (unsigned long)tv.tv_usec);
 #ifdef FAST_TIMER_SANITY_CHECKS
     used += sprintf(bigbuf + used, "Sanity failed:         %i\n",
@@ -696,9 +599,9 @@ static int proc_fasttimer_read(char *buf, char **start, off_t offset, int len
                       "d: %6li us data: 0x%08lX"
                       "\n",
                       t->name,
-                      (unsigned long)t->tv_set.tv_sec,
+                       (unsigned long)t->tv_set.tv_jiff,
                       (unsigned long)t->tv_set.tv_usec,
-                      (unsigned long)t->tv_expires.tv_sec,
+                       (unsigned long)t->tv_expires.tv_jiff,
                       (unsigned long)t->tv_expires.tv_usec,
                       t->delay_us,
                       t->data
@@ -718,9 +621,9 @@ static int proc_fasttimer_read(char *buf, char **start, off_t offset, int len
                       "d: %6li us data: 0x%08lX"
                       "\n",
                       t->name,
-                      (unsigned long)t->tv_set.tv_sec,
+                       (unsigned long)t->tv_set.tv_jiff,
                       (unsigned long)t->tv_set.tv_usec,
-                      (unsigned long)t->tv_expires.tv_sec,
+                       (unsigned long)t->tv_expires.tv_jiff,
                       (unsigned long)t->tv_expires.tv_usec,
                       t->delay_us,
                       t->data
@@ -738,9 +641,9 @@ static int proc_fasttimer_read(char *buf, char **start, off_t offset, int len
                       "d: %6li us data: 0x%08lX"
                       "\n",
                       t->name,
-                      (unsigned long)t->tv_set.tv_sec,
+                       (unsigned long)t->tv_set.tv_jiff,
                       (unsigned long)t->tv_set.tv_usec,
-                      (unsigned long)t->tv_expires.tv_sec,
+                       (unsigned long)t->tv_expires.tv_jiff,
                       (unsigned long)t->tv_expires.tv_usec,
                       t->delay_us,
                       t->data
@@ -761,15 +664,15 @@ static int proc_fasttimer_read(char *buf, char **start, off_t offset, int len
 /*                      " func: 0x%08lX" */
                       "\n",
                       t->name,
-                      (unsigned long)t->tv_set.tv_sec,
+                       (unsigned long)t->tv_set.tv_jiff,
                       (unsigned long)t->tv_set.tv_usec,
-                      (unsigned long)t->tv_expires.tv_sec,
+                       (unsigned long)t->tv_expires.tv_jiff,
                       (unsigned long)t->tv_expires.tv_usec,
                       t->delay_us,
                       t->data
 /*                      , t->function */
                       );
-      local_irq_disable();
+       local_irq_save(flags);
       if (t->next != nextt)
       {
         printk(KERN_WARNING "timer removed!\n");
@@ -798,7 +701,7 @@ static volatile int num_test_timeout = 0;
 static struct fast_timer tr[10];
 static int exp_num[10];
 
-static struct timeval tv_exp[100];
+static struct fasttime_t tv_exp[100];
 
 static void test_timeout(unsigned long data)
 {
@@ -836,7 +739,7 @@ static void fast_timer_test(void)
   int prev_num;
   int j;
 
-  struct timeval tv, tv0, tv1, tv2;
+       struct fasttime_t tv, tv0, tv1, tv2;
 
   printk("fast_timer_test() start\n");
   do_gettimeofday_fast(&tv);
@@ -849,7 +752,8 @@ static void fast_timer_test(void)
   {
     do_gettimeofday_fast(&tv_exp[j]);
   }
-  printk("fast_timer_test() %is %06i\n", tv.tv_sec, tv.tv_usec);
+       printk(KERN_DEBUG "fast_timer_test() %is %06i\n",
+               tv.tv_jiff, tv.tv_usec);
 
   for (j = 0; j < 1000; j++)
   {
@@ -858,12 +762,12 @@ static void fast_timer_test(void)
   }
   for (j = 0; j < 100; j++)
   {
-    printk("%i.%i %i.%i %i.%i %i.%i %i.%i\n",
-           tv_exp[j].tv_sec,tv_exp[j].tv_usec,
-           tv_exp[j+1].tv_sec,tv_exp[j+1].tv_usec,
-           tv_exp[j+2].tv_sec,tv_exp[j+2].tv_usec,
-           tv_exp[j+3].tv_sec,tv_exp[j+3].tv_usec,
-           tv_exp[j+4].tv_sec,tv_exp[j+4].tv_usec);
+               printk(KERN_DEBUG "%i.%i %i.%i %i.%i %i.%i %i.%i\n",
+                       tv_exp[j].tv_jiff, tv_exp[j].tv_usec,
+                       tv_exp[j+1].tv_jiff, tv_exp[j+1].tv_usec,
+                       tv_exp[j+2].tv_jiff, tv_exp[j+2].tv_usec,
+                       tv_exp[j+3].tv_jiff, tv_exp[j+3].tv_usec,
+                       tv_exp[j+4].tv_jiff, tv_exp[j+4].tv_usec);
     j += 4;
   }
   do_gettimeofday_fast(&tv0);
@@ -895,9 +799,12 @@ static void fast_timer_test(void)
     }
   }
   do_gettimeofday_fast(&tv2);
-  printk("Timers started    %is %06i\n", tv0.tv_sec, tv0.tv_usec);
-  printk("Timers started at %is %06i\n", tv1.tv_sec, tv1.tv_usec);
-  printk("Timers done       %is %06i\n", tv2.tv_sec, tv2.tv_usec);
+       printk(KERN_DEBUG "Timers started    %is %06i\n",
+               tv0.tv_jiff, tv0.tv_usec);
+       printk(KERN_DEBUG "Timers started at %is %06i\n",
+               tv1.tv_jiff, tv1.tv_usec);
+       printk(KERN_DEBUG "Timers done       %is %06i\n",
+               tv2.tv_jiff, tv2.tv_usec);
   DP(printk("buf0:\n");
      printk(buf0);
      printk("buf1:\n");
@@ -919,9 +826,9 @@ static void fast_timer_test(void)
     printk("%-10s set: %6is %06ius exp: %6is %06ius "
            "data: 0x%08X func: 0x%08X\n",
            t->name,
-           t->tv_set.tv_sec,
+                       t->tv_set.tv_jiff,
            t->tv_set.tv_usec,
-           t->tv_expires.tv_sec,
+                       t->tv_expires.tv_jiff,
            t->tv_expires.tv_usec,
            t->data,
            t->function
@@ -929,10 +836,12 @@ static void fast_timer_test(void)
 
     printk("           del: %6ius     did exp: %6is %06ius as #%i error: %6li\n",
            t->delay_us,
-           tv_exp[j].tv_sec,
+                       tv_exp[j].tv_jiff,
            tv_exp[j].tv_usec,
            exp_num[j],
-           (tv_exp[j].tv_sec - t->tv_expires.tv_sec)*1000000 + tv_exp[j].tv_usec - t->tv_expires.tv_usec);
+                       (tv_exp[j].tv_jiff - t->tv_expires.tv_jiff) *
+                               1000000 + tv_exp[j].tv_usec -
+                               t->tv_expires.tv_usec);
   }
   proc_fasttimer_read(buf5, NULL, 0, 0, 0);
   printk("buf5 after all done:\n");
@@ -942,7 +851,7 @@ static void fast_timer_test(void)
 #endif
 
 
-void fast_timer_init(void)
+int fast_timer_init(void)
 {
   /* For some reason, request_irq() hangs when called froom time_init() */
   if (!fast_timer_is_init)
@@ -975,4 +884,6 @@ void fast_timer_init(void)
     fast_timer_test();
 #endif
   }
+       return 0;
 }
+__initcall(fast_timer_init);
index 29d48ad00df934bd96e519ec1fd847d4360d6be4..3a9114e89edfcc1f2ef6e87b8e7c7bc6ca1fd35d 100644 (file)
@@ -304,7 +304,7 @@ static unsigned char clear_group_from_set(const unsigned char groups, struct if_
 static struct if_group *get_group(const unsigned char groups)
 {
        int i;
-       for (i = 0; i < sizeof(if_groups)/sizeof(struct if_group); i++) {
+       for (i = 0; i < ARRAY_SIZE(if_groups); i++) {
                if (groups & if_groups[i].group) {
                        return &if_groups[i];
                }
index 845c95f6e87117318511e164ada754c321d97b6d..e06ab0050d375156ff94eb3a2602a6a9493a57e5 100644 (file)
  */
 
 #include <asm/irq.h>
+#include <asm/current.h>
 #include <linux/irq.h>
+#include <linux/interrupt.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 
+/* From kgdb.c. */
+extern void kgdb_init(void);
+extern void breakpoint(void);
+
 #define mask_irq(irq_nr) (*R_VECT_MASK_CLR = 1 << (irq_nr));
 #define unmask_irq(irq_nr) (*R_VECT_MASK_SET = 1 << (irq_nr));
 
@@ -75,8 +81,8 @@ BUILD_IRQ(12, 0x1000)
 BUILD_IRQ(13, 0x2000)
 void mmu_bus_fault(void);      /* IRQ 14 is the bus fault interrupt */
 void multiple_interrupt(void); /* IRQ 15 is the multiple IRQ interrupt */
-BUILD_IRQ(16, 0x10000)
-BUILD_IRQ(17, 0x20000)
+BUILD_IRQ(16, 0x10000 | 0x20000)  /* ethernet tx interrupt needs to block rx */
+BUILD_IRQ(17, 0x20000 | 0x10000)  /* ...and vice versa */
 BUILD_IRQ(18, 0x40000)
 BUILD_IRQ(19, 0x80000)
 BUILD_IRQ(20, 0x100000)
@@ -147,6 +153,55 @@ void system_call(void);  /* from entry.S */
 void do_sigtrap(void); /* from entry.S */
 void gdb_handle_breakpoint(void); /* from entry.S */
 
+extern void do_IRQ(int irq, struct pt_regs * regs);
+
+/* Handle multiple IRQs */
+void do_multiple_IRQ(struct pt_regs* regs)
+{
+       int bit;
+       unsigned masked;
+       unsigned mask;
+       unsigned ethmask = 0;
+
+       /* Get interrupts to mask and handle */
+       mask = masked = *R_VECT_MASK_RD;
+
+       /* Never mask timer IRQ */
+       mask &= ~(IO_MASK(R_VECT_MASK_RD, timer0));
+
+       /*
+        * If either ethernet interrupt (rx or tx) is active then block
+        * the other one too. Unblock afterwards also.
+        */
+       if (mask &
+           (IO_STATE(R_VECT_MASK_RD, dma0, active) |
+            IO_STATE(R_VECT_MASK_RD, dma1, active))) {
+               ethmask = (IO_MASK(R_VECT_MASK_RD, dma0) |
+                          IO_MASK(R_VECT_MASK_RD, dma1));
+       }
+
+       /* Block them */
+       *R_VECT_MASK_CLR = (mask | ethmask);
+
+       /* An extra irq_enter here to prevent softIRQs to run after
+        * each do_IRQ. This will decrease the interrupt latency.
+        */
+       irq_enter();
+
+       /* Handle all IRQs */
+       for (bit = 2; bit < 32; bit++) {
+               if (masked & (1 << bit)) {
+                       do_IRQ(bit, regs);
+               }
+       }
+
+       /* This irq_exit() will trigger the soft IRQs. */
+       irq_exit();
+
+       /* Unblock the IRQs again */
+       *R_VECT_MASK_SET = (masked | ethmask);
+}
+
 /* init_IRQ() is called by start_kernel and is responsible for fixing IRQ masks and
    setting the irq vector table.
 */
index 682ef955aec4b526bff04756a09d959333fc321c..de27b50b72a24fb678865d5b58a7f7d426650ad6 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/seq_file.h>
 #include <linux/proc_fs.h>
 #include <linux/delay.h>
+#include <linux/param.h>
 
 #ifdef CONFIG_PROC_FS
 #define HAS_FPU                0x0001
@@ -56,8 +57,8 @@ int show_cpuinfo(struct seq_file *m, void *v)
 
        revision = rdvr();
 
-       if (revision >= sizeof cpu_info/sizeof *cpu_info)
-               info = &cpu_info[sizeof cpu_info/sizeof *cpu_info - 1];
+       if (revision >= ARRAY_SIZE(cpu_info))
+               info = &cpu_info[ARRAY_SIZE(cpu_info) - 1];
        else
                info = &cpu_info[revision];
 
index 575a14bb110613bfba8dfc3eaf8d53191fe8bbfb..5976f6199c47237937b2e7a4bd15709203472cf9 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: time.c,v 1.5 2004/09/29 06:12:46 starvik Exp $
- *
+/*
  *  linux/arch/cris/arch-v10/kernel/time.c
  *
  *  Copyright (C) 1991, 1992, 1995  Linus Torvalds
@@ -20,6 +19,7 @@
 #include <asm/io.h>
 #include <asm/delay.h>
 #include <asm/rtc.h>
+#include <asm/irq_regs.h>
 
 /* define this if you need to use print_timestamp */
 /* it will make jiffies at 96 hz instead of 100 hz though */
@@ -201,8 +201,9 @@ static long last_rtc_update = 0;
 extern void cris_do_profile(struct pt_regs *regs);
 
 static inline irqreturn_t
-timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+timer_interrupt(int irq, void *dev_id)
 {
+       struct pt_regs *regs = get_irq_regs();
        /* acknowledge the timer irq */
 
 #ifdef USE_CASCADE_TIMERS
@@ -221,9 +222,11 @@ timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 #endif
 
        /* reset watchdog otherwise it resets us! */
-
        reset_watchdog();
        
+       /* Update statistics. */
+       update_process_times(user_mode(regs));
+
        /* call the real timer interrupt handler */
 
        do_timer(1);
index 82bb668391715279afb0619a46d3d4b208323ed5..42c1101043a3229481acf644ad947d0f427083dc 100644 (file)
@@ -66,7 +66,7 @@ void *memset(void *pdst,
 
   {
     register char *dst __asm__ ("r13") = pdst;
+
   /* This is NONPORTABLE, but since this whole routine is     */
   /* grossly nonportable that doesn't matter.                 */
 
@@ -110,52 +110,52 @@ void *memset(void *pdst,
       If you want to check that the allocation was right; then
       check the equalities in the first comment.  It should say
       "r13=r13, r12=r12, r11=r11" */
-    __asm__ volatile ("
-        ;; Check that the following is true (same register names on
-        ;; both sides of equal sign, as in r8=r8):
-        ;; %0=r13, %1=r12, %4=r11
-        ;;
-       ;; Save the registers we'll clobber in the movem process
-       ;; on the stack.  Don't mention them to gcc, it will only be
-       ;; upset.
-       subq    11*4,$sp
-        movem   $r10,[$sp]
-
-        move.d  $r11,$r0
-        move.d  $r11,$r1
-        move.d  $r11,$r2
-        move.d  $r11,$r3
-        move.d  $r11,$r4
-        move.d  $r11,$r5
-        move.d  $r11,$r6
-        move.d  $r11,$r7
-        move.d  $r11,$r8
-        move.d  $r11,$r9
-        move.d  $r11,$r10
-
-        ;; Now we've got this:
-       ;; r13 - dst
-       ;; r12 - n
-       
-        ;; Update n for the first loop
-        subq    12*4,$r12
-0:
-        subq   12*4,$r12
-        bge     0b
-       movem   $r11,[$r13+]
-
-        addq   12*4,$r12  ;; compensate for last loop underflowing n
-
-       ;; Restore registers from stack
-        movem [$sp+],$r10" 
+    __asm__ volatile ("\n\
+       ;; Check that the following is true (same register names on     \n\
+       ;; both sides of equal sign, as in r8=r8):                      \n\
+       ;; %0=r13, %1=r12, %4=r11                                       \n\
+       ;;                                                              \n\
+       ;; Save the registers we'll clobber in the movem process        \n\
+       ;; on the stack.  Don't mention them to gcc, it will only be    \n\
+       ;; upset.                                                       \n\
+       subq    11*4,$sp                                                \n\
+       movem   $r10,[$sp]                                              \n\
+                                                                       \n\
+       move.d  $r11,$r0                                                \n\
+       move.d  $r11,$r1                                                \n\
+       move.d  $r11,$r2                                                \n\
+       move.d  $r11,$r3                                                \n\
+       move.d  $r11,$r4                                                \n\
+       move.d  $r11,$r5                                                \n\
+       move.d  $r11,$r6                                                \n\
+       move.d  $r11,$r7                                                \n\
+       move.d  $r11,$r8                                                \n\
+       move.d  $r11,$r9                                                \n\
+       move.d  $r11,$r10                                               \n\
+                                                                       \n\
+       ;; Now we've got this:                                          \n\
+       ;; r13 - dst                                                    \n\
+       ;; r12 - n                                                      \n\
+                                                                       \n\
+       ;; Update n for the first loop                                  \n\
+       subq    12*4,$r12                                               \n\
+0:                                                                     \n\
+       subq    12*4,$r12                                               \n\
+       bge     0b                                                      \n\
+       movem   $r11,[$r13+]                                            \n\
+                                                                       \n\
+       addq    12*4,$r12 ;; compensate for last loop underflowing n    \n\
+                                                                       \n\
+       ;; Restore registers from stack                                 \n\
+       movem   [$sp+],$r10"
 
      /* Outputs */ : "=r" (dst), "=r" (n)
      /* Inputs */ : "0" (dst), "1" (n), "r" (lc));
-    
+
   }
 
     /* Either we directly starts copying, using dword copying
-       in a loop, or we copy as much as possible with 'movem' 
+       in a loop, or we copy as much as possible with 'movem'
        and then the last block (<44 bytes) is copied here.
        This will work since 'movem' will have updated src,dst,n. */
 
index 15d6662b03b17212e2f57fb2588a93e0ae247859..7161a2bef4fe341e694780106ced3cccac5421c3 100644 (file)
@@ -95,33 +95,33 @@ void *memcpy(void *pdst,
       If you want to check that the allocation was right; then
       check the equalities in the first comment.  It should say
       "r13=r13, r11=r11, r12=r12" */
-    __asm__ volatile ("
-        ;; Check that the following is true (same register names on
-        ;; both sides of equal sign, as in r8=r8):
-        ;; %0=r13, %1=r11, %2=r12
-        ;;
-       ;; Save the registers we'll use in the movem process
-       ;; on the stack.
-       subq    11*4,$sp
-       movem   $r10,[$sp]
-
-        ;; Now we've got this:
-       ;; r11 - src
-       ;; r13 - dst
-       ;; r12 - n
-       
-        ;; Update n for the first loop
-        subq    44,$r12
-0:
-       movem   [$r11+],$r10
-        subq   44,$r12
-        bge     0b
-       movem   $r10,[$r13+]
-
-        addq   44,$r12  ;; compensate for last loop underflowing n
-
-       ;; Restore registers from stack
-        movem [$sp+],$r10" 
+    __asm__ volatile ("\n\
+       ;; Check that the following is true (same register names on     \n\
+       ;; both sides of equal sign, as in r8=r8):                      \n\
+       ;; %0=r13, %1=r11, %2=r12                                       \n\
+       ;;                                                              \n\
+       ;; Save the registers we'll use in the movem process            \n\
+       ;; on the stack.                                                \n\
+       subq    11*4,$sp                                                \n\
+       movem   $r10,[$sp]                                              \n\
+                                                                       \n\
+       ;; Now we've got this:                                          \n\
+       ;; r11 - src                                                    \n\
+       ;; r13 - dst                                                    \n\
+       ;; r12 - n                                                      \n\
+                                                                       \n\
+       ;; Update n for the first loop                                  \n\
+       subq    44,$r12                                                 \n\
+0:                                                                     \n\
+       movem   [$r11+],$r10                                            \n\
+       subq    44,$r12                                                 \n\
+       bge     0b                                                      \n\
+       movem   $r10,[$r13+]                                            \n\
+                                                                       \n\
+       addq    44,$r12 ;; compensate for last loop underflowing n      \n\
+                                                                       \n\
+       ;; Restore registers from stack                                 \n\
+       movem   [$sp+],$r10"
 
      /* Outputs */ : "=r" (dst), "=r" (src), "=r" (n) 
      /* Inputs */ : "0" (dst), "1" (src), "2" (n));
index a12c708afc9a46ad12d83ca1bcafa5ee22af449b..b8e6c0430e5b8832b6c9a5314c4f21a371405e57 100644 (file)
@@ -92,58 +92,58 @@ __copy_user (void __user *pdst, const void *psrc, unsigned long pn)
        .ifnc %0%1%2%3,$r13$r11$r12$r10                                 \n\
        .err                                                            \n\
        .endif                                                          \n\
-
-       ;; Save the registers we'll use in the movem process
-       ;; on the stack.
-       subq    11*4,$sp
-       movem   $r10,[$sp]
-
-       ;; Now we've got this:
-       ;; r11 - src
-       ;; r13 - dst
-       ;; r12 - n
-
-       ;; Update n for the first loop
-       subq    44,$r12
-
-; Since the noted PC of a faulting instruction in a delay-slot of a taken
-; branch, is that of the branch target, we actually point at the from-movem
-; for this case.  There is no ambiguity here; if there was a fault in that
-; instruction (meaning a kernel oops), the faulted PC would be the address
-; after *that* movem.
-
-0:
-       movem   [$r11+],$r10
-       subq   44,$r12
-       bge     0b
-       movem   $r10,[$r13+]
-1:
-       addq   44,$r12  ;; compensate for last loop underflowing n
-
-       ;; Restore registers from stack
-       movem [$sp+],$r10
-2:
-       .section .fixup,\"ax\"
-
-; To provide a correct count in r10 of bytes that failed to be copied,
-; we jump back into the loop if the loop-branch was taken.  There is no
-; performance penalty for sany use; the program will segfault soon enough.
-
-3:
-       move.d [$sp],$r10
-       addq 44,$r10
-       move.d $r10,[$sp]
-       jump 0b
-4:
-       movem [$sp+],$r10
-       addq 44,$r10
-       addq 44,$r12
-       jump 2b
-
-       .previous
-       .section __ex_table,\"a\"
-       .dword 0b,3b
-       .dword 1b,4b
+                                                                       \n\
+       ;; Save the registers we'll use in the movem process            \n\
+       ;; on the stack.                                                \n\
+       subq    11*4,$sp                                                \n\
+       movem   $r10,[$sp]                                              \n\
+                                                                       \n\
+       ;; Now we've got this:                                          \n\
+       ;; r11 - src                                                    \n\
+       ;; r13 - dst                                                    \n\
+       ;; r12 - n                                                      \n\
+                                                                       \n\
+       ;; Update n for the first loop                                  \n\
+       subq    44,$r12                                                 \n\
+                                                                       \n\
+; Since the noted PC of a faulting instruction in a delay-slot of a taken \n\
+; branch, is that of the branch target, we actually point at the from-movem \n\
+; for this case.  There is no ambiguity here; if there was a fault in that \n\
+; instruction (meaning a kernel oops), the faulted PC would be the address \n\
+; after *that* movem.                                                  \n\
+                                                                       \n\
+0:                                                                     \n\
+       movem   [$r11+],$r10                                            \n\
+       subq   44,$r12                                                  \n\
+       bge     0b                                                      \n\
+       movem   $r10,[$r13+]                                            \n\
+1:                                                                     \n\
+       addq   44,$r12  ;; compensate for last loop underflowing n      \n\
+                                                                       \n\
+       ;; Restore registers from stack                                 \n\
+       movem [$sp+],$r10                                               \n\
+2:                                                                     \n\
+       .section .fixup,\"ax\"                                          \n\
+                                                                       \n\
+; To provide a correct count in r10 of bytes that failed to be copied, \n\
+; we jump back into the loop if the loop-branch was taken.  There is no        \n\
+; performance penalty for sany use; the program will segfault soon enough.\n\
+                                                                       \n\
+3:                                                                     \n\
+       move.d [$sp],$r10                                               \n\
+       addq 44,$r10                                                    \n\
+       move.d $r10,[$sp]                                               \n\
+       jump 0b                                                         \n\
+4:                                                                     \n\
+       movem [$sp+],$r10                                               \n\
+       addq 44,$r10                                                    \n\
+       addq 44,$r12                                                    \n\
+       jump 2b                                                         \n\
+                                                                       \n\
+       .previous                                                       \n\
+       .section __ex_table,\"a\"                                       \n\
+       .dword 0b,3b                                                    \n\
+       .dword 1b,4b                                                    \n\
        .previous"
 
      /* Outputs */ : "=r" (dst), "=r" (src), "=r" (n), "=r" (retn)
@@ -253,59 +253,59 @@ __copy_user_zeroing (void __user *pdst, const void *psrc, unsigned long pn)
        If you want to check that the allocation was right; then
        check the equalities in the first comment.  It should say
        "r13=r13, r11=r11, r12=r12" */
-    __asm__ volatile ("
+    __asm__ volatile ("\n\
        .ifnc %0%1%2%3,$r13$r11$r12$r10                                 \n\
        .err                                                            \n\
        .endif                                                          \n\
-
-       ;; Save the registers we'll use in the movem process
-       ;; on the stack.
-       subq    11*4,$sp
-       movem   $r10,[$sp]
-
-       ;; Now we've got this:
-       ;; r11 - src
-       ;; r13 - dst
-       ;; r12 - n
-
-       ;; Update n for the first loop
-       subq    44,$r12
-0:
-       movem   [$r11+],$r10
-1:
-       subq   44,$r12
-       bge     0b
-       movem   $r10,[$r13+]
-
-       addq   44,$r12  ;; compensate for last loop underflowing n
-
-       ;; Restore registers from stack
-       movem [$sp+],$r10
-4:
-       .section .fixup,\"ax\"
-
-;; Do not jump back into the loop if we fail.  For some uses, we get a
-;; page fault somewhere on the line.  Without checking for page limits,
-;; we don't know where, but we need to copy accurately and keep an
-;; accurate count; not just clear the whole line.  To do that, we fall
-;; down in the code below, proceeding with smaller amounts.  It should
-;; be kept in mind that we have to cater to code like what at one time
-;; was in fs/super.c:
-;;  i = size - copy_from_user((void *)page, data, size);
-;; which would cause repeated faults while clearing the remainder of
-;; the SIZE bytes at PAGE after the first fault.
-;; A caveat here is that we must not fall through from a failing page
-;; to a valid page.
-
-3:
-       movem  [$sp+],$r10
-       addq    44,$r12 ;; Get back count before faulting point.
-       subq    44,$r11 ;; Get back pointer to faulting movem-line.
-       jump    4b      ;; Fall through, pretending the fault didn't happen.
-
-       .previous
-       .section __ex_table,\"a\"
-       .dword 1b,3b
+                                                                       \n\
+       ;; Save the registers we'll use in the movem process            \n\
+       ;; on the stack.                                                \n\
+       subq    11*4,$sp                                                \n\
+       movem   $r10,[$sp]                                              \n\
+                                                                       \n\
+       ;; Now we've got this:                                          \n\
+       ;; r11 - src                                                    \n\
+       ;; r13 - dst                                                    \n\
+       ;; r12 - n                                                      \n\
+                                                                       \n\
+       ;; Update n for the first loop                                  \n\
+       subq    44,$r12                                                 \n\
+0:                                                                     \n\
+       movem   [$r11+],$r10                                            \n\
+1:                                                                     \n\
+       subq   44,$r12                                                  \n\
+       bge     0b                                                      \n\
+       movem   $r10,[$r13+]                                            \n\
+                                                                       \n\
+       addq   44,$r12  ;; compensate for last loop underflowing n      \n\
+                                                                       \n\
+       ;; Restore registers from stack                                 \n\
+       movem [$sp+],$r10                                               \n\
+4:                                                                     \n\
+       .section .fixup,\"ax\"                                          \n\
+                                                                       \n\
+;; Do not jump back into the loop if we fail.  For some uses, we get a \n\
+;; page fault somewhere on the line.  Without checking for page limits,        \n\
+;; we don't know where, but we need to copy accurately and keep an     \n\
+;; accurate count; not just clear the whole line.  To do that, we fall \n\
+;; down in the code below, proceeding with smaller amounts.  It should \n\
+;; be kept in mind that we have to cater to code like what at one time \n\
+;; was in fs/super.c:                                                  \n\
+;;  i = size - copy_from_user((void *)page, data, size);               \n\
+;; which would cause repeated faults while clearing the remainder of   \n\
+;; the SIZE bytes at PAGE after the first fault.                       \n\
+;; A caveat here is that we must not fall through from a failing page  \n\
+;; to a valid page.                                                    \n\
+                                                                       \n\
+3:                                                                     \n\
+       movem  [$sp+],$r10                                              \n\
+       addq    44,$r12 ;; Get back count before faulting point.        \n\
+       subq    44,$r11 ;; Get back pointer to faulting movem-line.     \n\
+       jump    4b      ;; Fall through, pretending the fault didn't happen.\n\
+                                                                       \n\
+       .previous                                                       \n\
+       .section __ex_table,\"a\"                                       \n\
+       .dword 1b,3b                                                    \n\
        .previous"
 
      /* Outputs */ : "=r" (dst), "=r" (src), "=r" (n), "=r" (retn)
@@ -425,64 +425,64 @@ __do_clear_user (void __user *pto, unsigned long pn)
       If you want to check that the allocation was right; then
       check the equalities in the first comment.  It should say
       something like "r13=r13, r11=r11, r12=r12". */
-    __asm__ volatile ("
+    __asm__ volatile ("\n\
        .ifnc %0%1%2,$r13$r12$r10                                       \n\
        .err                                                            \n\
        .endif                                                          \n\
-
-       ;; Save the registers we'll clobber in the movem process
-       ;; on the stack.  Don't mention them to gcc, it will only be
-       ;; upset.
-       subq    11*4,$sp
-       movem   $r10,[$sp]
-
-       clear.d $r0
-       clear.d $r1
-       clear.d $r2
-       clear.d $r3
-       clear.d $r4
-       clear.d $r5
-       clear.d $r6
-       clear.d $r7
-       clear.d $r8
-       clear.d $r9
-       clear.d $r10
-       clear.d $r11
-
-       ;; Now we've got this:
-       ;; r13 - dst
-       ;; r12 - n
-
-       ;; Update n for the first loop
-       subq    12*4,$r12
-0:
-       subq   12*4,$r12
-       bge     0b
-       movem   $r11,[$r13+]
-1:
-       addq   12*4,$r12        ;; compensate for last loop underflowing n
-
-       ;; Restore registers from stack
-       movem [$sp+],$r10
-2:
-       .section .fixup,\"ax\"
-3:
-       move.d [$sp],$r10
-       addq 12*4,$r10
-       move.d $r10,[$sp]
-       clear.d $r10
-       jump 0b
-
-4:
-       movem [$sp+],$r10
-       addq 12*4,$r10
-       addq 12*4,$r12
-       jump 2b
-
-       .previous
-       .section __ex_table,\"a\"
-       .dword 0b,3b
-       .dword 1b,4b
+                                                                       \n\
+       ;; Save the registers we'll clobber in the movem process        \n\
+       ;; on the stack.  Don't mention them to gcc, it will only be    \n\
+       ;; upset.                                                       \n\
+       subq    11*4,$sp                                                \n\
+       movem   $r10,[$sp]                                              \n\
+                                                                       \n\
+       clear.d $r0                                                     \n\
+       clear.d $r1                                                     \n\
+       clear.d $r2                                                     \n\
+       clear.d $r3                                                     \n\
+       clear.d $r4                                                     \n\
+       clear.d $r5                                                     \n\
+       clear.d $r6                                                     \n\
+       clear.d $r7                                                     \n\
+       clear.d $r8                                                     \n\
+       clear.d $r9                                                     \n\
+       clear.d $r10                                                    \n\
+       clear.d $r11                                                    \n\
+                                                                       \n\
+       ;; Now we've got this:                                          \n\
+       ;; r13 - dst                                                    \n\
+       ;; r12 - n                                                      \n\
+                                                                       \n\
+       ;; Update n for the first loop                                  \n\
+       subq    12*4,$r12                                               \n\
+0:                                                                     \n\
+       subq   12*4,$r12                                                \n\
+       bge     0b                                                      \n\
+       movem   $r11,[$r13+]                                            \n\
+1:                                                                     \n\
+       addq   12*4,$r12        ;; compensate for last loop underflowing n\n\
+                                                                       \n\
+       ;; Restore registers from stack                                 \n\
+       movem [$sp+],$r10                                               \n\
+2:                                                                     \n\
+       .section .fixup,\"ax\"                                          \n\
+3:                                                                     \n\
+       move.d [$sp],$r10                                               \n\
+       addq 12*4,$r10                                                  \n\
+       move.d $r10,[$sp]                                               \n\
+       clear.d $r10                                                    \n\
+       jump 0b                                                         \n\
+                                                                       \n\
+4:                                                                     \n\
+       movem [$sp+],$r10                                               \n\
+       addq 12*4,$r10                                                  \n\
+       addq 12*4,$r12                                                  \n\
+       jump 2b                                                         \n\
+                                                                       \n\
+       .previous                                                       \n\
+       .section __ex_table,\"a\"                                       \n\
+       .dword 0b,3b                                                    \n\
+       .dword 1b,4b                                                    \n\
        .previous"
 
      /* Outputs */ : "=r" (dst), "=r" (n), "=r" (retn)
index cc6ba542375472be1147f122b5ebd3a41e434a4b..7f72d7c9e1ce0f2bf6d29a1657d936b12de32e71 100644 (file)
@@ -362,8 +362,6 @@ config ETRAX_AXISFLASHMAP
        select MTD
        select MTD_CFI
        select MTD_CFI_AMDSTD
-       select MTD_OBSOLETE_CHIPS
-       select MTD_AMDSTD
        select MTD_CHAR
        select MTD_BLOCK
        select MTD_PARTITIONS
index 3ec12ea44e8ede39efda94ac85b3c6562243c4e7..c5ff95e18269b44220113d4187dc584b6796bce6 100644 (file)
@@ -190,13 +190,12 @@ static struct mtd_info *probe_cs(struct map_info *map_cs)
               "%s: Probing a 0x%08lx bytes large window at 0x%08lx.\n",
               map_cs->name, map_cs->size, map_cs->map_priv_1);
 
-#ifdef CONFIG_MTD_AMDSTD
-       mtd_cs = do_map_probe("amd_flash", map_cs);
-#endif
 #ifdef CONFIG_MTD_CFI
-       if (!mtd_cs) {
                mtd_cs = do_map_probe("cfi_probe", map_cs);
-       }
+#endif
+#ifdef CONFIG_MTD_JEDECPROBE
+       if (!mtd_cs)
+               mtd_cs = do_map_probe("jedec_probe", map_cs);
 #endif
 
        return mtd_cs;
index df89298aafc46121fb445649f0c1f50818d70b60..d581b0a92a3f10e56fc9ec340b4d249ca472ae71 100644 (file)
@@ -185,7 +185,7 @@ static struct sync_port ports[]=
        }
 };
 
-#define NUMBER_OF_PORTS (sizeof(ports)/sizeof(sync_port))
+#define NUMBER_OF_PORTS ARRAY_SIZE(ports)
 
 static const struct file_operations sync_serial_fops = {
        .owner   = THIS_MODULE,
diff --git a/arch/cris/arch-v32/kernel/cache.c b/arch/cris/arch-v32/kernel/cache.c
new file mode 100644 (file)
index 0000000..80da7b8
--- /dev/null
@@ -0,0 +1,33 @@
+#include <linux/module.h>
+#include <asm/io.h>
+#include <asm/arch/cache.h>
+#include <asm/arch/hwregs/dma.h>
+
+/* This file is used to workaround a cache bug, Guinness TR 106. */
+
+inline void flush_dma_descr(struct dma_descr_data *descr, int flush_buf)
+{
+       /* Flush descriptor to make sure we get correct in_eop and after. */
+       asm volatile ("ftagd [%0]" :: "r" (descr));
+       /* Flush buffer pointed out by descriptor. */
+       if (flush_buf)
+               cris_flush_cache_range(phys_to_virt((unsigned)descr->buf),
+                               (unsigned)(descr->after - descr->buf));
+}
+EXPORT_SYMBOL(flush_dma_descr);
+
+void flush_dma_list(struct dma_descr_data *descr)
+{
+       while (1) {
+               flush_dma_descr(descr, 1);
+               if (descr->eol)
+                       break;
+               descr = phys_to_virt((unsigned)descr->next);
+       }
+}
+EXPORT_SYMBOL(flush_dma_list);
+
+/* From cacheflush.S */
+EXPORT_SYMBOL(cris_flush_cache);
+/* From cacheflush.S */
+EXPORT_SYMBOL(cris_flush_cache_range);
diff --git a/arch/cris/arch-v32/kernel/cacheflush.S b/arch/cris/arch-v32/kernel/cacheflush.S
new file mode 100644 (file)
index 0000000..956e8fb
--- /dev/null
@@ -0,0 +1,94 @@
+       .global cris_flush_cache_range
+cris_flush_cache_range:
+       move.d 1024, $r12
+       cmp.d $r11, $r12
+       bhi cris_flush_1KB
+       nop
+       add.d $r10, $r11
+       ftagd [$r10]
+cris_flush_last:
+       addq 32, $r10
+       cmp.d $r11, $r10
+       blt cris_flush_last
+       ftagd [$r10]
+       ret
+       nop
+cris_flush_1KB:
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ftagd [$r10]
+       addq 32, $r10
+       ba cris_flush_cache_range
+       sub.d $r12, $r11
+
+       .global cris_flush_cache
+cris_flush_cache:
+       moveq 0, $r10
+cris_flush_line:
+       move.d 16*1024, $r11
+       addq 16, $r10
+       cmp.d $r10, $r11
+       blt cris_flush_line
+       fidxd [$r10]
+       ret
+       nop
index dfbfcb8d2585b664fe7a0ef362aae1b14d8f682c..a22a9e02e09309829b9c60448776ec85ccfd4e0c 100644 (file)
@@ -49,7 +49,7 @@ struct crisv32_ioport crisv32_ioports[] =
        }
 };
 
-#define NBR_OF_PORTS sizeof(crisv32_ioports)/sizeof(struct crisv32_ioport)
+#define NBR_OF_PORTS ARRAY_SIZE(crisv32_ioports)
 
 struct crisv32_iopin crisv32_led1_green;
 struct crisv32_iopin crisv32_led1_red;
index 4662f363df638371dc4336d0b4233bcd9aed242a..72e9e8331f63a2aff9410a2be971250467cbf028 100644 (file)
@@ -54,12 +54,10 @@ show_cpuinfo(struct seq_file *m, void *v)
 {
        int i;
        int cpu = (int)v - 1;
-       int entries;
        unsigned long revision;
        struct cpu_info *info;
 
-       entries = sizeof cpinfo / sizeof(struct cpu_info);
-       info = &cpinfo[entries - 1];
+       info = &cpinfo[ARRAY_SIZE(cpinfo) - 1];
 
 #ifdef CONFIG_SMP
        if (!cpu_online(cpu))
@@ -68,7 +66,7 @@ show_cpuinfo(struct seq_file *m, void *v)
 
        revision = rdvr();
 
-       for (i = 0; i < entries; i++) {
+       for (i = 0; i < ARRAY_SIZE(cpinfo); i++) {
                if (cpinfo[i].rev == revision) {
                        info = &cpinfo[i];
                        break;
index 142a10818af37a4049b797ffbb6e27ba453a2ff0..9c33ae65993444d3f53fd0f69a3bff2b557e1d6d 100644 (file)
@@ -226,8 +226,6 @@ CONFIG_MTD_CFI_UTIL=y
 CONFIG_MTD_RAM=y
 # CONFIG_MTD_ROM is not set
 # CONFIG_MTD_ABSENT is not set
-CONFIG_MTD_OBSOLETE_CHIPS=y
-CONFIG_MTD_AMDSTD=y
 # CONFIG_MTD_SHARP is not set
 # CONFIG_MTD_JEDEC is not set
 
@@ -276,6 +274,7 @@ CONFIG_MTDRAM_ABS_POS=0x0
 # CONFIG_BLK_DEV_FD is not set
 # CONFIG_BLK_DEV_COW_COMMON is not set
 # CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
 # CONFIG_BLK_DEV_UB is not set
 CONFIG_BLK_DEV_RAM=y
@@ -302,16 +301,14 @@ CONFIG_IOSCHED_CFQ=y
 #
 # ATA/ATAPI/MFM/RLL support
 #
-CONFIG_IDE=y
-CONFIG_BLK_DEV_IDE=y
+# CONFIG_IDE is not set
+# CONFIG_PARIDE is not set
 
 #
 # Please see Documentation/ide.txt for help/info on IDE drives
 #
 # CONFIG_BLK_DEV_IDE_SATA is not set
-CONFIG_BLK_DEV_IDEDISK=y
 # CONFIG_IDEDISK_MULTI_MODE is not set
-CONFIG_BLK_DEV_IDECD=y
 # CONFIG_BLK_DEV_IDETAPE is not set
 # CONFIG_BLK_DEV_IDEFLOPPY is not set
 # CONFIG_IDE_TASK_IOCTL is not set
@@ -321,7 +318,6 @@ CONFIG_BLK_DEV_IDECD=y
 #
 # CONFIG_IDE_GENERIC is not set
 # CONFIG_IDE_ARM is not set
-CONFIG_BLK_DEV_IDEDMA=y
 # CONFIG_IDEDMA_AUTO is not set
 # CONFIG_BLK_DEV_HD is not set
 
@@ -329,6 +325,7 @@ CONFIG_BLK_DEV_IDEDMA=y
 # SCSI device support
 #
 # CONFIG_SCSI is not set
+# CONFIG_ISCSI_TCP is not set
 
 #
 # IEEE 1394 (FireWire) support
@@ -414,26 +411,11 @@ CONFIG_NETFILTER=y
 # CONFIG_NET_POLL_CONTROLLER is not set
 # CONFIG_HAMRADIO is not set
 # CONFIG_IRDA is not set
-CONFIG_BT=y
-CONFIG_BT_L2CAP=y
-# CONFIG_BT_SCO is not set
-CONFIG_BT_RFCOMM=y
-# CONFIG_BT_RFCOMM_TTY is not set
-CONFIG_BT_BNEP=y
-# CONFIG_BT_BNEP_MC_FILTER is not set
-# CONFIG_BT_BNEP_PROTO_FILTER is not set
-# CONFIG_BT_HIDP is not set
-
-#
-# Bluetooth device drivers
-#
-CONFIG_BT_HCIUSB=y
-# CONFIG_BT_HCIUSB_SCO is not set
-# CONFIG_BT_HCIUART is not set
-# CONFIG_BT_HCIBCM203X is not set
-# CONFIG_BT_HCIBPA10X is not set
-# CONFIG_BT_HCIBFUSB is not set
-# CONFIG_BT_HCIVHCI is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_AF_RXRPC_DEBUG is not set
+# CONFIG_BT is not set
+# CONFIG_I2C is not set
+
 CONFIG_NETDEVICES=y
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
@@ -485,31 +467,17 @@ CONFIG_NET_ETHERNET=y
 #
 # Input device support
 #
-CONFIG_INPUT=y
-
-#
-# Userland interfaces
-#
-CONFIG_INPUT_MOUSEDEV=y
-CONFIG_INPUT_MOUSEDEV_PSAUX=y
-CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
-CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
-# CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
-# CONFIG_INPUT_EVDEV is not set
-# CONFIG_INPUT_EVBUG is not set
+# CONFIG_INPUT is not set
 
 #
 # Input I/O drivers
 #
-# CONFIG_GAMEPORT is not set
-CONFIG_SOUND_GAMEPORT=y
 CONFIG_SERIO=y
 # CONFIG_SERIO_I8042 is not set
 # CONFIG_SERIO_SERPORT is not set
-# CONFIG_SERIO_CT82C710 is not set
-CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_LIBPS2 is not set
 # CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
 
 #
 # Input Device Drivers
@@ -525,6 +493,7 @@ CONFIG_MOUSE_PS2=y
 # CONFIG_MOUSE_SERIAL is not set
 # CONFIG_MOUSE_VSXXXAA is not set
 # CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
 # CONFIG_INPUT_TOUCHSCREEN is not set
 # CONFIG_INPUT_MISC is not set
 
@@ -542,6 +511,8 @@ CONFIG_MOUSE_PS2=y
 #
 # Non-8250 serial port support
 #
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
@@ -559,6 +530,8 @@ CONFIG_LEGACY_PTY_COUNT=256
 # CONFIG_GEN_RTC is not set
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
+# CONFIG_RTC_LIB is not set
+# CONFIG_RTC_CLASS is not set
 
 #
 # Ftape, the floppy tape device driver
@@ -660,7 +633,9 @@ CONFIG_NFS_V3=y
 # CONFIG_NFSD is not set
 CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
+CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=y
+# CONFIG_SUNRPC_BIND34 is not set
 # CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 # CONFIG_SMB_FS is not set
@@ -685,10 +660,22 @@ CONFIG_MSDOS_PARTITION=y
 #
 # CONFIG_SOUND is not set
 
+#
+# Generic devices
+#
+# CONFIG_SND_MPU401_UART is not set
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_VIRMIDI is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+
 #
 # PCCARD (PCMCIA/CardBus) support
 #
 # CONFIG_PCCARD is not set
+# CONFIG_PARPORT_PC_PCMCIA is not set
+# CONFIG_NET_PCMCIA is not set
 
 #
 # PC-card bridges
@@ -734,6 +721,7 @@ CONFIG_USB_DEVICEFS=y
 # USB Input Devices
 #
 # CONFIG_USB_HID is not set
+# HID_SUPPORT is not set
 
 #
 # USB HID Boot Protocol drivers
@@ -829,7 +817,7 @@ CONFIG_USB_RTL8150=y
 
 #
 # Hardware crypto devices
-#
+# CONFIG_CRYPTO_HW is not set
 
 #
 # Library routines
index 105bb5ed48f7d3d5ed1b3ac791b3fc1655479050..62f0e752915a253ef3e8b97dec7519e8e205e219 100644 (file)
@@ -27,6 +27,7 @@ extern void __Mod(void);
 extern void __ashldi3(void);
 extern void __ashrdi3(void);
 extern void __lshrdi3(void);
+extern void __negdi2(void);
 extern void iounmap(volatile void * __iomem);
 
 /* Platform dependent support */
@@ -34,19 +35,6 @@ EXPORT_SYMBOL(kernel_thread);
 EXPORT_SYMBOL(get_cmos_time);
 EXPORT_SYMBOL(loops_per_usec);
 
-/* String functions */
-EXPORT_SYMBOL(memcmp);
-EXPORT_SYMBOL(memmove);
-EXPORT_SYMBOL(strstr);
-EXPORT_SYMBOL(strcpy);
-EXPORT_SYMBOL(strchr);
-EXPORT_SYMBOL(strcmp);
-EXPORT_SYMBOL(strlen);
-EXPORT_SYMBOL(strcat);
-EXPORT_SYMBOL(strncat);
-EXPORT_SYMBOL(strncmp);
-EXPORT_SYMBOL(strncpy);
-
 /* Math functions */
 EXPORT_SYMBOL(__Udiv);
 EXPORT_SYMBOL(__Umod);
@@ -55,6 +43,7 @@ EXPORT_SYMBOL(__Mod);
 EXPORT_SYMBOL(__ashldi3);
 EXPORT_SYMBOL(__ashrdi3);
 EXPORT_SYMBOL(__lshrdi3);
+EXPORT_SYMBOL(__negdi2);
 
 /* Memory functions */
 EXPORT_SYMBOL(__ioremap);
@@ -84,4 +73,4 @@ EXPORT_SYMBOL(start_one_shot_timer);
 EXPORT_SYMBOL(del_fast_timer);
 EXPORT_SYMBOL(schedule_usleep);
 #endif
-
+EXPORT_SYMBOL(csum_partial);
index 5c27ff86121b9c40ccb39a60b9e3772d52c8a331..2dfac8c79090a248291375e8ed3f392878530ca8 100644 (file)
@@ -2,7 +2,7 @@
  *
  *     linux/arch/cris/kernel/irq.c
  *
- *      Copyright (c) 2000,2001 Axis Communications AB
+ *      Copyright (c) 2000,2007 Axis Communications AB
  *
  *      Authors: Bjorn Wesen (bjornw@axis.com)
  *
@@ -92,14 +92,16 @@ skip:
 asmlinkage void do_IRQ(int irq, struct pt_regs * regs)
 {
        unsigned long sp;
+       struct pt_regs *old_regs = set_irq_regs(regs);
        irq_enter();
        sp = rdsp();
        if (unlikely((sp & (PAGE_SIZE - 1)) < (PAGE_SIZE/8))) {
                printk("do_IRQ: stack overflow: %lX\n", sp);
                show_stack(NULL, (unsigned long *)sp);
        }
-       __do_IRQ(irq, regs);
+       __do_IRQ(irq);
         irq_exit();
+       set_irq_regs(old_regs);
 }
 
 void weird_irq(void)
index 123451c44154f5961ae740e41c5117670e1fb8d1..9ca558fc5bc8454f2a2e5f3a06c919b416ff1d0a 100644 (file)
@@ -195,6 +195,11 @@ EXPORT_SYMBOL(enable_hlt);
  */
 void (*pm_idle)(void);
 
+extern void default_idle(void);
+
+void (*pm_power_off)(void);
+EXPORT_SYMBOL(pm_power_off);
+
 /*
  * The idle thread. There's no useful work to be
  * done, so just try to conserve power and have a
index 1085d037027b2cd20b972b797c0a655d282911b3..3ccd20e85dce07eb8a2e54a505bfbfe2b0db1c0e 100644 (file)
 /* notification of userspace execution resumption
  * - triggered by current->work.notify_resume
  */
-extern int do_signal(int canrestart, sigset_t *oldset, struct pt_regs *regs);
+extern int do_signal(int canrestart, struct pt_regs *regs);
 
 
-void do_notify_resume(int canrestart, sigset_t *oldset, struct pt_regs *regs, 
+void do_notify_resume(int canrestart, struct pt_regs *regs,
                      __u32 thread_info_flags  )
 {
        /* deal with pending signal delivery */
        if (thread_info_flags & _TIF_SIGPENDING)
-               do_signal(canrestart,oldset,regs);
+               do_signal(canrestart,regs);
 }
index 514359b8122e5b14a2e99a8f6c0a001953f1a27a..8b9984197edcc57878356a56848c237ea06aa109 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/sched.h>
 #include <linux/syscalls.h>
 #include <linux/mm.h>
+#include <linux/fs.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
 #include <linux/sem.h>
index acfd0455940590c5e5292ce86b89dde0e1b0200e..7a2cc7efbcf8be986601d8b5f31e646b7ff9afc9 100644 (file)
@@ -171,10 +171,6 @@ get_cmos_time(void)
        mon = CMOS_READ(RTC_MONTH);
        year = CMOS_READ(RTC_YEAR);
 
-       printk(KERN_DEBUG
-              "rtc: sec 0x%x min 0x%x hour 0x%x day 0x%x mon 0x%x year 0x%x\n",
-              sec, min, hour, day, mon, year);
-
        BCD_TO_BIN(sec);
        BCD_TO_BIN(min);
        BCD_TO_BIN(hour);
@@ -207,12 +203,12 @@ void
 cris_do_profile(struct pt_regs* regs)
 {
 
-#if CONFIG_SYSTEM_PROFILER
+#ifdef CONFIG_SYSTEM_PROFILER
         cris_profile_sample(regs);
 #endif
 
-#if CONFIG_PROFILING
-        profile_tick(CPU_PROFILING, regs);
+#ifdef CONFIG_PROFILING
+        profile_tick(CPU_PROFILING);
 #endif
 }
 
index 671ce1e8434f2d27c9a956f2957eb6fcdb29d3fd..662f7b12d005fa532b834ec06838cf5ae56bc264 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/list.h>
 #include <linux/pci.h>
 #include <linux/highmem.h>
+#include <linux/scatterlist.h>
 #include <asm/io.h>
 
 void *dma_alloc_coherent(struct device *hwdev, size_t size, dma_addr_t *dma_handle, gfp_t gfp)
@@ -86,7 +87,7 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
        dampr2 = __get_DAMPR(2);
 
        for (i = 0; i < nents; i++) {
-               vaddr = kmap_atomic(sg[i].page, __KM_CACHE);
+               vaddr = kmap_atomic(sg_page(&sg[i]), __KM_CACHE);
 
                frv_dcache_writeback((unsigned long) vaddr,
                                     (unsigned long) vaddr + PAGE_SIZE);
index 4103c2c487f3a114654f242f16b18d0e99281447..b841ecfd5d5a991fb15a048e2bcf0c7e4f2b38a6 100644 (file)
@@ -197,7 +197,7 @@ void __init mem_init(void)
 /*
  * free the memory that was only required for initialisation
  */
-void __init free_initmem(void)
+void free_initmem(void)
 {
 #if defined(CONFIG_RAMKERNEL) && !defined(CONFIG_PROTECT_KERNEL)
        unsigned long start, end, addr;
index e2e9f57abe2e33c012961f49734dea1837a69834..ff6a8712bd6d8c3f59f7724050d9793a22db3fcf 100644 (file)
@@ -1,6 +1,6 @@
 #
 # For a description of the syntax of this configuration file,
-# see Documentation/kbuild/config-language.txt.
+# see Documentation/kbuild/kconfig-language.txt.
 #
 
 mainmenu "uClinux/h8300 (w/o MMU) Kernel Configuration"
index 75fd90dc76a3e73165a3f75964b7ea1823445392..7f6b2377d13fa815a9a0a3e0c10a6554125723e1 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.23-rc6
-# Tue Sep 18 11:24:01 2007
+# Linux kernel version: 2.6.23
+# Thu Oct 18 16:03:40 2007
 #
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
@@ -28,6 +28,8 @@ CONFIG_TASK_IO_ACCOUNTING=y
 CONFIG_LOG_BUF_SHIFT=20
 CONFIG_CGROUPS=y
 CONFIG_CPUSETS=y
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FAIR_USER_SCHED=y
 CONFIG_SYSFS_DEPRECATED=y
 CONFIG_RELAY=y
 CONFIG_BLK_DEV_INITRD=y
@@ -48,7 +50,6 @@ CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
 CONFIG_EPOLL=y
 CONFIG_SIGNALFD=y
-CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
 CONFIG_VM_EVENT_COUNTERS=y
@@ -69,6 +70,7 @@ CONFIG_STOP_MACHINE=y
 CONFIG_BLOCK=y
 # CONFIG_BLK_DEV_IO_TRACE is not set
 CONFIG_BLK_DEV_BSG=y
+CONFIG_BLOCK_COMPAT=y
 
 #
 # IO Schedulers
@@ -93,6 +95,7 @@ CONFIG_MMU=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 # CONFIG_ARCH_HAS_ILOG2_U32 is not set
 # CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_HUGETLB_PAGE_SIZE_VARIABLE=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_GENERIC_TIME=y
@@ -113,10 +116,10 @@ CONFIG_IA64_SGI_SN2=y
 CONFIG_MCKINLEY=y
 # CONFIG_IA64_PAGE_SIZE_4KB is not set
 # CONFIG_IA64_PAGE_SIZE_8KB is not set
-CONFIG_IA64_PAGE_SIZE_16KB=y
-# CONFIG_IA64_PAGE_SIZE_64KB is not set
-# CONFIG_PGTABLE_3 is not set
-CONFIG_PGTABLE_4=y
+# CONFIG_IA64_PAGE_SIZE_16KB is not set
+CONFIG_IA64_PAGE_SIZE_64KB=y
+CONFIG_PGTABLE_3=y
+# CONFIG_PGTABLE_4 is not set
 # CONFIG_HZ_100 is not set
 CONFIG_HZ_250=y
 # CONFIG_HZ_300 is not set
@@ -131,6 +134,7 @@ CONFIG_SMP=y
 CONFIG_NR_CPUS=1024
 # CONFIG_HOTPLUG_CPU is not set
 CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
 CONFIG_SCHED_SMT=y
 CONFIG_PREEMPT_NONE=y
 # CONFIG_PREEMPT_VOLUNTARY is not set
@@ -144,6 +148,7 @@ CONFIG_DISCONTIGMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_NEED_MULTIPLE_NODES=y
 # CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_MIGRATION=y
 CONFIG_RESOURCES_64BIT=y
@@ -171,6 +176,7 @@ CONFIG_IA64_PALINFO=y
 CONFIG_IA64_MC_ERR_INJECT=y
 CONFIG_SGI_SN=y
 # CONFIG_IA64_ESI is not set
+# CONFIG_IA64_HP_AML_NFW is not set
 
 #
 # SN Devices
@@ -220,7 +226,6 @@ CONFIG_PCI_DOMAINS=y
 CONFIG_PCI_SYSCALL=y
 CONFIG_PCIEPORTBUS=y
 CONFIG_HOTPLUG_PCI_PCIE=y
-# CONFIG_HOTPLUG_PCI_PCIE_POLL_EVENT_MODE is not set
 CONFIG_PCIEAER=y
 CONFIG_ARCH_SUPPORTS_MSI=y
 # CONFIG_PCI_MSI is not set
@@ -231,10 +236,6 @@ CONFIG_HOTPLUG_PCI=y
 # CONFIG_HOTPLUG_PCI_CPCI is not set
 # CONFIG_HOTPLUG_PCI_SHPC is not set
 CONFIG_HOTPLUG_PCI_SGI=y
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
 # CONFIG_PCCARD is not set
 
 #
@@ -271,6 +272,7 @@ CONFIG_INET_TUNNEL=m
 CONFIG_INET_XFRM_MODE_TRANSPORT=y
 CONFIG_INET_XFRM_MODE_TUNNEL=y
 CONFIG_INET_XFRM_MODE_BEET=y
+CONFIG_INET_LRO=y
 CONFIG_INET_DIAG=m
 CONFIG_INET_TCP_DIAG=m
 # CONFIG_TCP_CONG_ADVANCED is not set
@@ -342,6 +344,7 @@ CONFIG_IPV6_SIT=m
 #
 # Generic Driver Options
 #
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
@@ -402,7 +405,12 @@ CONFIG_IDE_PROC_FS=y
 # IDE chipset support/bugfixes
 #
 CONFIG_IDE_GENERIC=y
+# CONFIG_BLK_DEV_PLATFORM is not set
 # CONFIG_BLK_DEV_IDEPNP is not set
+
+#
+# PCI IDE chipsets support
+#
 CONFIG_BLK_DEV_IDEPCI=y
 CONFIG_IDEPCI_SHARE_IRQ=y
 CONFIG_IDEPCI_PCIBUS_ORDER=y
@@ -410,8 +418,6 @@ CONFIG_IDEPCI_PCIBUS_ORDER=y
 # CONFIG_BLK_DEV_GENERIC is not set
 # CONFIG_BLK_DEV_OPTI621 is not set
 CONFIG_BLK_DEV_IDEDMA_PCI=y
-# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
-# CONFIG_IDEDMA_ONLYDISK is not set
 # CONFIG_BLK_DEV_AEC62XX is not set
 # CONFIG_BLK_DEV_ALI15X3 is not set
 # CONFIG_BLK_DEV_AMD74XX is not set
@@ -439,7 +445,6 @@ CONFIG_BLK_DEV_SGIIOC4=y
 # CONFIG_BLK_DEV_TC86C001 is not set
 # CONFIG_IDE_ARM is not set
 CONFIG_BLK_DEV_IDEDMA=y
-# CONFIG_IDEDMA_IVB is not set
 # CONFIG_BLK_DEV_HD is not set
 
 #
@@ -482,6 +487,7 @@ CONFIG_SCSI_SAS_ATTRS=y
 CONFIG_SCSI_SAS_LIBSAS=y
 # CONFIG_SCSI_SAS_ATA is not set
 # CONFIG_SCSI_SAS_LIBSAS_DEBUG is not set
+CONFIG_SCSI_SRP_ATTRS=y
 CONFIG_SCSI_LOWLEVEL=y
 CONFIG_ISCSI_TCP=m
 # CONFIG_BLK_DEV_3W_XXXX_RAID is not set
@@ -492,6 +498,7 @@ CONFIG_ISCSI_TCP=m
 # CONFIG_SCSI_AIC7XXX_OLD is not set
 # CONFIG_SCSI_AIC79XX is not set
 # CONFIG_SCSI_AIC94XX is not set
+# CONFIG_SCSI_ADVANSYS is not set
 # CONFIG_SCSI_ARCMSR is not set
 # CONFIG_MEGARAID_NEWGEN is not set
 # CONFIG_MEGARAID_LEGACY is not set
@@ -532,6 +539,7 @@ CONFIG_ATA_ACPI=y
 # CONFIG_SATA_VIA is not set
 CONFIG_SATA_VITESSE=y
 # CONFIG_SATA_INIC162X is not set
+# CONFIG_PATA_ACPI is not set
 # CONFIG_PATA_ALI is not set
 # CONFIG_PATA_AMD is not set
 # CONFIG_PATA_ARTOP is not set
@@ -556,6 +564,7 @@ CONFIG_SATA_VITESSE=y
 # CONFIG_PATA_OLDPIIX is not set
 # CONFIG_PATA_NETCELL is not set
 # CONFIG_PATA_NS87410 is not set
+# CONFIG_PATA_NS87415 is not set
 # CONFIG_PATA_OPTI is not set
 # CONFIG_PATA_OPTIDMA is not set
 # CONFIG_PATA_PDC_OLD is not set
@@ -588,10 +597,6 @@ CONFIG_DM_MULTIPATH=m
 CONFIG_DM_MULTIPATH_EMC=m
 # CONFIG_DM_MULTIPATH_RDAC is not set
 # CONFIG_DM_DELAY is not set
-
-#
-# Fusion MPT device support
-#
 CONFIG_FUSION=y
 CONFIG_FUSION_SPI=y
 CONFIG_FUSION_FC=y
@@ -613,13 +618,16 @@ CONFIG_NETDEVICES=y
 # CONFIG_MACVLAN is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
+# CONFIG_VETH is not set
 # CONFIG_NET_SB1000 is not set
+# CONFIG_IP1000 is not set
 # CONFIG_ARCNET is not set
 # CONFIG_NET_ETHERNET is not set
 CONFIG_NETDEV_1000=y
 # CONFIG_ACENIC is not set
 # CONFIG_DL2K is not set
 # CONFIG_E1000 is not set
+# CONFIG_E1000E is not set
 # CONFIG_NS83820 is not set
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
@@ -638,12 +646,15 @@ CONFIG_CHELSIO_T1=m
 CONFIG_CHELSIO_T1_1G=y
 # CONFIG_CHELSIO_T1_NAPI is not set
 CONFIG_CHELSIO_T3=m
+CONFIG_IXGBE=m
 # CONFIG_IXGB is not set
 CONFIG_S2IO=m
 # CONFIG_S2IO_NAPI is not set
 # CONFIG_MYRI10GE is not set
 # CONFIG_NETXEN_NIC is not set
+# CONFIG_NIU is not set
 # CONFIG_MLX4_CORE is not set
+# CONFIG_TEHUTI is not set
 # CONFIG_TR is not set
 
 #
@@ -669,6 +680,7 @@ CONFIG_S2IO=m
 # CONFIG_NET_FC is not set
 # CONFIG_SHAPER is not set
 CONFIG_NETCONSOLE=y
+# CONFIG_NETCONSOLE_DYNAMIC is not set
 CONFIG_NETPOLL=y
 # CONFIG_NETPOLL_TRAP is not set
 CONFIG_NET_POLL_CONTROLLER=y
@@ -690,7 +702,6 @@ CONFIG_INPUT_MOUSEDEV=y
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
 # CONFIG_INPUT_EVDEV is not set
 # CONFIG_INPUT_EVBUG is not set
 
@@ -714,6 +725,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # Character devices
 #
 CONFIG_VT=y
+# CONFIG_VT_UNICODE is not set
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 # CONFIG_VT_HW_CONSOLE_BINDING is not set
@@ -760,9 +772,6 @@ CONFIG_LEGACY_PTY_COUNT=256
 CONFIG_EFI_RTC=y
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
-CONFIG_AGP=y
-CONFIG_AGP_SGI_TIOCA=y
-# CONFIG_DRM is not set
 CONFIG_RAW_DRIVER=m
 CONFIG_MAX_RAW_DEVS=256
 # CONFIG_HPET is not set
@@ -781,6 +790,12 @@ CONFIG_DEVPORT=y
 # CONFIG_POWER_SUPPLY is not set
 # CONFIG_HWMON is not set
 
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
+
 #
 # Multifunction device drivers
 #
@@ -796,15 +811,18 @@ CONFIG_DEVPORT=y
 #
 # Graphics support
 #
+CONFIG_AGP=y
+CONFIG_AGP_SGI_TIOCA=y
+# CONFIG_DRM is not set
+# CONFIG_VGASTATE is not set
+CONFIG_VIDEO_OUTPUT_CONTROL=m
+# CONFIG_FB is not set
 # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
 # Display device support
 #
 # CONFIG_DISPLAY_SUPPORT is not set
-# CONFIG_VGASTATE is not set
-CONFIG_VIDEO_OUTPUT_CONTROL=m
-# CONFIG_FB is not set
 
 #
 # Console display driver support
@@ -820,6 +838,7 @@ CONFIG_DUMMY_CONSOLE=y
 CONFIG_HID_SUPPORT=y
 CONFIG_HID=y
 CONFIG_HID_DEBUG=y
+# CONFIG_HIDRAW is not set
 
 #
 # USB Input Devices
@@ -950,19 +969,6 @@ CONFIG_INFINIBAND_SRP=m
 # CONFIG_INFINIBAND_ISER is not set
 # CONFIG_RTC_CLASS is not set
 
-#
-# DMA Engine support
-#
-# CONFIG_DMA_ENGINE is not set
-
-#
-# DMA Clients
-#
-
-#
-# DMA Devices
-#
-
 #
 # Userspace I/O
 #
@@ -1005,6 +1011,8 @@ CONFIG_XFS_RT=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
 CONFIG_QUOTA=y
+CONFIG_QUOTA_NETLINK_INTERFACE=y
+CONFIG_PRINT_QUOTA_WARNING=y
 # CONFIG_QFMT_V1 is not set
 # CONFIG_QFMT_V2 is not set
 CONFIG_QUOTACTL=y
@@ -1043,7 +1051,6 @@ CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
 CONFIG_HUGETLBFS=y
 CONFIG_HUGETLB_PAGE=y
-CONFIG_RAMFS=y
 # CONFIG_CONFIGFS_FS is not set
 
 #
@@ -1062,10 +1069,7 @@ CONFIG_RAMFS=y
 # CONFIG_QNX4FS_FS is not set
 # CONFIG_SYSV_FS is not set
 # CONFIG_UFS_FS is not set
-
-#
-# Network File Systems
-#
+CONFIG_NETWORK_FILESYSTEMS=y
 CONFIG_NFS_FS=m
 CONFIG_NFS_V3=y
 # CONFIG_NFS_V3_ACL is not set
@@ -1082,6 +1086,7 @@ CONFIG_EXPORTFS=m
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=m
 CONFIG_SUNRPC_GSS=m
+CONFIG_SUNRPC_XPRT_RDMA=m
 # CONFIG_SUNRPC_BIND34 is not set
 CONFIG_RPCSEC_GSS_KRB5=m
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -1118,10 +1123,6 @@ CONFIG_SGI_PARTITION=y
 # CONFIG_KARMA_PARTITION is not set
 CONFIG_EFI_PARTITION=y
 # CONFIG_SYSV68_PARTITION is not set
-
-#
-# Native Language Support
-#
 CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="iso8859-1"
 CONFIG_NLS_CODEPAGE_437=y
@@ -1162,10 +1163,6 @@ CONFIG_NLS_ISO8859_1=y
 # CONFIG_NLS_KOI8_R is not set
 # CONFIG_NLS_KOI8_U is not set
 CONFIG_NLS_UTF8=y
-
-#
-# Distributed Lock Manager
-#
 # CONFIG_DLM is not set
 
 #
@@ -1223,6 +1220,7 @@ CONFIG_DEBUG_INFO=y
 # CONFIG_DEBUG_VM is not set
 # CONFIG_DEBUG_LIST is not set
 CONFIG_FORCED_INLINING=y
+# CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_FAULT_INJECTION is not set
 CONFIG_IA64_GRANULE_16MB=y
@@ -1238,6 +1236,7 @@ CONFIG_SYSVIPC_COMPAT=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_XOR_BLOCKS=y
 CONFIG_ASYNC_CORE=y
 CONFIG_ASYNC_MEMCPY=y
@@ -1262,6 +1261,7 @@ CONFIG_CRYPTO_ECB=m
 CONFIG_CRYPTO_CBC=m
 CONFIG_CRYPTO_PCBC=m
 # CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_XTS is not set
 # CONFIG_CRYPTO_CRYPTD is not set
 CONFIG_CRYPTO_DES=m
 # CONFIG_CRYPTO_FCRYPT is not set
@@ -1275,9 +1275,11 @@ CONFIG_CRYPTO_DES=m
 # CONFIG_CRYPTO_ARC4 is not set
 # CONFIG_CRYPTO_KHAZAD is not set
 # CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_SEED is not set
 CONFIG_CRYPTO_DEFLATE=m
 # CONFIG_CRYPTO_MICHAEL_MIC is not set
 CONFIG_CRYPTO_CRC32C=m
 # CONFIG_CRYPTO_CAMELLIA is not set
 # CONFIG_CRYPTO_TEST is not set
+# CONFIG_CRYPTO_AUTHENC is not set
 # CONFIG_CRYPTO_HW is not set
index 1189d035d316e6f853e464b5736d81eafe72f937..bf6d9d8c802fdb9d20e087e28c05a0501f8d9896 100644 (file)
@@ -285,7 +285,7 @@ sys_fw_init (const char *args, int arglen)
        }
        cmd_line[arglen] = '\0';
 
-       memset(efi_systab, 0, sizeof(efi_systab));
+       memset(efi_systab, 0, sizeof(*efi_systab));
        efi_systab->hdr.signature = EFI_SYSTEM_TABLE_SIGNATURE;
        efi_systab->hdr.revision  = ((1 << 16) | 00);
        efi_systab->hdr.headersize = sizeof(efi_systab->hdr);
index 466bbcb138b2f57beed7181010beeda0d2513726..c5c872b250da5e420a661fb25223115fe2c7b424 100644 (file)
@@ -290,7 +290,6 @@ struct old_linux32_dirent {
 #define _ASM_IA64_ELF_H                /* Don't include elf.h */
 
 #include <linux/sched.h>
-#include <asm/processor.h>
 
 /*
  * This is used to ensure we don't load something for the wrong architecture.
diff --git a/arch/ia64/kernel/.gitignore b/arch/ia64/kernel/.gitignore
new file mode 100644 (file)
index 0000000..9830775
--- /dev/null
@@ -0,0 +1 @@
+gate.lds
index 3d45d24a9d613ce66215c5399d513dd24239e3c2..897e2083a3b1b4c77f8dd200d3ab593b377677e8 100644 (file)
@@ -678,9 +678,11 @@ int __init acpi_boot_init(void)
        /* I/O APIC */
 
        if (acpi_table_parse_madt
-           (ACPI_MADT_TYPE_IO_SAPIC, acpi_parse_iosapic, NR_IOSAPICS) < 1)
-               printk(KERN_ERR PREFIX
-                      "Error parsing MADT - no IOSAPIC entries\n");
+           (ACPI_MADT_TYPE_IO_SAPIC, acpi_parse_iosapic, NR_IOSAPICS) < 1) {
+               if (!ia64_platform_is("sn2"))
+                       printk(KERN_ERR PREFIX
+                              "Error parsing MADT - no IOSAPIC entries\n");
+       }
 
        /* System-Level Interrupt Routing */
 
index 3f7ea13358e952366eeef347a208facb92d5e57f..8e8f8b6193eea5038fb9bff9a53baa03b7694f7b 100644 (file)
@@ -218,9 +218,10 @@ efi_gettimeofday (struct timespec *ts)
 {
        efi_time_t tm;
 
-       memset(ts, 0, sizeof(ts));
-       if ((*efi.get_time)(&tm, NULL) != EFI_SUCCESS)
+       if ((*efi.get_time)(&tm, NULL) != EFI_SUCCESS) {
+               memset(ts, 0, sizeof(*ts));
                return;
+       }
 
        ts->tv_sec = mktime(tm.year, tm.month, tm.day, tm.hour, tm.minute, tm.second);
        ts->tv_nsec = tm.nanosecond;
@@ -1112,7 +1113,7 @@ efi_initialize_iomem_resources(struct resource *code_resource,
                if (md->num_pages == 0) /* should not happen */
                        continue;
 
-               flags = IORESOURCE_MEM;
+               flags = IORESOURCE_MEM | IORESOURCE_BUSY;
                switch (md->type) {
 
                        case EFI_MEMORY_MAPPED_IO:
@@ -1134,12 +1135,11 @@ efi_initialize_iomem_resources(struct resource *code_resource,
 
                        case EFI_ACPI_MEMORY_NVS:
                                name = "ACPI Non-volatile Storage";
-                               flags |= IORESOURCE_BUSY;
                                break;
 
                        case EFI_UNUSABLE_MEMORY:
                                name = "reserved";
-                               flags |= IORESOURCE_BUSY | IORESOURCE_DISABLED;
+                               flags |= IORESOURCE_DISABLED;
                                break;
 
                        case EFI_RESERVED_TYPE:
@@ -1148,7 +1148,6 @@ efi_initialize_iomem_resources(struct resource *code_resource,
                        case EFI_ACPI_RECLAIM_MEMORY:
                        default:
                                name = "reserved";
-                               flags |= IORESOURCE_BUSY;
                                break;
                }
 
@@ -1231,7 +1230,7 @@ kdump_find_rsvd_region (unsigned long size,
 
 #ifdef CONFIG_PROC_VMCORE
 /* locate the size find a the descriptor at a certain address */
-unsigned long
+unsigned long __init
 vmcore_find_descriptor_size (unsigned long address)
 {
        void *efi_map_start, *efi_map_end, *p;
index 44817d97ab43c91b7921ca83064d447da79034ad..454d7a7dfa9d99e7a8d64382b1adce1ee67945f5 100644 (file)
@@ -20,6 +20,8 @@ SECTIONS
        .gnu.version_d          : { *(.gnu.version_d) }
        .gnu.version_r          : { *(.gnu.version_r) }
 
+       .note                   : { *(.note*) }         :readable       :note
+
        .dynamic                : { *(.dynamic) }       :readable       :dynamic
 
        /*
@@ -83,6 +85,7 @@ PHDRS
        epc             PT_LOAD FILEHDR PHDRS   FLAGS(1);       /* PF_X */
 #endif
        dynamic         PT_DYNAMIC              FLAGS(4);       /* PF_R */
+       note            PT_NOTE                 FLAGS(4);       /* PF_R */
        unwind          PT_IA_64_UNWIND;
 }
 
index cfe4654838f445423455979bca494d0e8fd1394a..274a593830432ba711a32725820f520071426a3d 100644 (file)
@@ -748,6 +748,15 @@ skip_numa_setup:
 #endif
 }
 
+static inline unsigned char choose_dmode(void)
+{
+#ifdef CONFIG_SMP
+       if (smp_int_redirect & SMP_IRQ_REDIRECTION)
+               return IOSAPIC_LOWEST_PRIORITY;
+#endif
+       return IOSAPIC_FIXED;
+}
+
 /*
  * ACPI can describe IOSAPIC interrupts via static tables and namespace
  * methods.  This provides an interface to register those interrupts and
@@ -762,6 +771,7 @@ iosapic_register_intr (unsigned int gsi,
        unsigned long flags;
        struct iosapic_rte_info *rte;
        u32 low32;
+       unsigned char dmode;
 
        /*
         * If this GSI has already been registered (i.e., it's a
@@ -791,8 +801,8 @@ iosapic_register_intr (unsigned int gsi,
 
        spin_lock(&irq_desc[irq].lock);
        dest = get_target_cpu(gsi, irq);
-       err = register_intr(gsi, irq, IOSAPIC_LOWEST_PRIORITY,
-                           polarity, trigger);
+       dmode = choose_dmode();
+       err = register_intr(gsi, irq, dmode, polarity, trigger);
        if (err < 0) {
                spin_unlock(&irq_desc[irq].lock);
                irq = err;
@@ -961,10 +971,12 @@ iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi,
 {
        int vector, irq;
        unsigned int dest = cpu_physical_id(smp_processor_id());
+       unsigned char dmode;
 
        irq = vector = isa_irq_to_vector(isa_irq);
        BUG_ON(bind_irq_vector(irq, vector, CPU_MASK_ALL));
-       register_intr(gsi, irq, IOSAPIC_LOWEST_PRIORITY, polarity, trigger);
+       dmode = choose_dmode();
+       register_intr(gsi, irq, dmode, polarity, trigger);
 
        DBG("ISA: IRQ %u -> GSI %u (%s,%s) -> CPU %d (0x%04x) vector %d\n",
            isa_irq, gsi, trigger == IOSAPIC_EDGE ? "edge" : "level",
index 44be1c952b7ca2cc6761f65c112a7f737c1f0b7f..6dee579f205fc451bcffbcbaddd0c370b6d35104 100644 (file)
@@ -61,9 +61,11 @@ int show_interrupts(struct seq_file *p, void *v)
        unsigned long flags;
 
        if (i == 0) {
-               seq_printf(p, "           ");
+               char cpuname[16];
+               seq_printf(p, "     ");
                for_each_online_cpu(j) {
-                       seq_printf(p, "CPU%d       ",j);
+                       snprintf(cpuname, 10, "CPU%d", j);
+                       seq_printf(p, "%10s ", cpuname);
                }
                seq_putc(p, '\n');
        }
index cc87025e8f54c0d2656584376949a44642432815..10b48cd15a878c399503d5bc5da4334906748978 100644 (file)
@@ -571,7 +571,7 @@ out:
  *  Outputs
  *      None
  */
-static void __init
+void
 ia64_mca_register_cpev (int cpev)
 {
        /* Register the CPE interrupt vector with SAL */
index 2fdbd5c3f21342beb82046bc4ca6c4c3d08b50b5..e86d0295979465a56c257298028d5fc9798fb249 100644 (file)
@@ -109,7 +109,7 @@ int ia64_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc)
        write_msi_msg(irq, &msg);
        set_irq_chip_and_handler(irq, &ia64_msi_chip, handle_edge_irq);
 
-       return irq;
+       return 0;
 }
 
 void ia64_teardown_msi_irq(unsigned int irq)
index 6ef6ffb943a0cd368c1d11c9dc79888bc4f7674c..396004e8cd1432af8fa1440ea0e2b93c385175bd 100644 (file)
@@ -470,7 +470,7 @@ register_info(char *page)
        return p - page;
 }
 
-static const char *proc_features[]={
+static char *proc_features_0[]={               /* Feature set 0 */
        NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
        NULL,NULL,NULL,NULL,NULL,NULL,NULL, NULL,NULL,
        NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
@@ -502,25 +502,92 @@ static const char *proc_features[]={
        "Enable BERR promotion"
 };
 
+static char *proc_features_16[]={              /* Feature set 16 */
+       "Disable ETM",
+       "Enable ETM",
+       "Enable MCA on half-way timer",
+       "Enable snoop WC",
+       NULL,
+       "Enable Fast Deferral",
+       "Disable MCA on memory aliasing",
+       "Enable RSB",
+       NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+       "DP system processor",
+       "Low Voltage",
+       "HT supported",
+       NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+       NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+       NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+       NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+       NULL, NULL, NULL, NULL, NULL
+};
+
+static char **proc_features[]={
+       proc_features_0,
+       NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+       NULL, NULL, NULL, NULL,
+       proc_features_16,
+       NULL, NULL, NULL, NULL,
+};
+
+static char *
+feature_set_info(char *page, u64 avail, u64 status, u64 control, u64 set)
+{
+       char *p = page;
+       char **vf, **v;
+       int i;
+
+       vf = v = proc_features[set];
+       for(i=0; i < 64; i++, avail >>=1, status >>=1, control >>=1) {
+
+               if (!(control))         /* No remaining bits set */
+                       break;
+               if (!(avail & 0x1))     /* Print only bits that are available */
+                       continue;
+               if (vf)
+                       v = vf + i;
+               if ( v && *v ) {
+                       p += sprintf(p, "%-40s : %s %s\n", *v,
+                               avail & 0x1 ? (status & 0x1 ?
+                                               "On " : "Off"): "",
+                               avail & 0x1 ? (control & 0x1 ?
+                                               "Ctrl" : "NoCtrl"): "");
+               } else {
+                       p += sprintf(p, "Feature set %2ld bit %2d\t\t\t"
+                                       " : %s %s\n",
+                               set, i,
+                               avail & 0x1 ? (status & 0x1 ?
+                                               "On " : "Off"): "",
+                               avail & 0x1 ? (control & 0x1 ?
+                                               "Ctrl" : "NoCtrl"): "");
+               }
+       }
+       return p;
+}
 
 static int
 processor_info(char *page)
 {
        char *p = page;
-       const char **v = proc_features;
-       u64 avail=1, status=1, control=1;
-       int i;
+       u64 avail=1, status=1, control=1, feature_set=0;
        s64 ret;
 
-       if ((ret=ia64_pal_proc_get_features(&avail, &status, &control)) != 0) return 0;
+       do {
+               ret = ia64_pal_proc_get_features(&avail, &status, &control,
+                                               feature_set);
+               if (ret < 0) {
+                       return p - page;
+               }
+               if (ret == 1) {
+                       feature_set++;
+                       continue;
+               }
+
+               p = feature_set_info(p, avail, status, control, feature_set);
+
+               feature_set++;
+       } while(1);
 
-       for(i=0; i < 64; i++, v++,avail >>=1, status >>=1, control >>=1) {
-               if ( ! *v ) continue;
-               p += sprintf(p, "%-40s : %s%s %s\n", *v,
-                               avail & 0x1 ? "" : "NotImpl",
-                               avail & 0x1 ? (status & 0x1 ? "On" : "Off"): "",
-                               avail & 0x1 ? (control & 0x1 ? "Ctrl" : "NoCtrl"): "");
-       }
        return p - page;
 }
 
index e796e29f8e156df255c93f85fa5cd8f7a882dace..2cb9425e04210fed5de6e6168074f04193210971 100644 (file)
@@ -129,9 +129,6 @@ ia64_patch_mckinley_e9 (unsigned long start, unsigned long end)
                first_time = 0;
                if (need_workaround)
                        printk(KERN_INFO "Leaving McKinley Errata 9 workaround enabled\n");
-               else
-                       printk(KERN_INFO "McKinley Errata 9 workaround not needed; "
-                              "disabling it\n");
        }
        if (need_workaround)
                return;
index 59169bf7145f69f955708f49c4a9debb5c2fa713..73e7c2e40b54713e69566772b79d3b92fc44a7da 100644 (file)
@@ -558,7 +558,7 @@ static ctl_table pfm_sysctl_dir[] = {
        {
                .ctl_name       = CTL_UNNUMBERED,
                .procname       = "perfmon",
-               .mode           = 0755,
+               .mode           = 0555,
                .child          = pfm_ctl_table,
        },
        {}
@@ -567,7 +567,7 @@ static ctl_table pfm_sysctl_root[] = {
        {
                .ctl_name       = CTL_KERN,
                .procname       = "kernel",
-               .mode           = 0755,
+               .mode           = 0555,
                .child          = pfm_sysctl_dir,
        },
        {}
index ae6c3c02e1170e63f1810bf37929cdf523d4d025..2b3751eef5ce716506706134e19b3d520b196119 100644 (file)
@@ -417,34 +417,6 @@ mark_bsp_online (void)
 #endif
 }
 
-#ifdef CONFIG_SMP
-static void __init
-check_for_logical_procs (void)
-{
-       pal_logical_to_physical_t info;
-       s64 status;
-
-       status = ia64_pal_logical_to_phys(0, &info);
-       if (status == -1) {
-               printk(KERN_INFO "No logical to physical processor mapping "
-                      "available\n");
-               return;
-       }
-       if (status) {
-               printk(KERN_ERR "ia64_pal_logical_to_phys failed with %ld\n",
-                      status);
-               return;
-       }
-       /*
-        * Total number of siblings that BSP has.  Though not all of them 
-        * may have booted successfully. The correct number of siblings 
-        * booted is in info.overview_num_log.
-        */
-       smp_num_siblings = info.overview_tpc;
-       smp_num_cpucores = info.overview_cpp;
-}
-#endif
-
 static __initdata int nomca;
 static __init int setup_nomca(char *s)
 {
@@ -540,15 +512,6 @@ setup_arch (char **cmdline_p)
 
 #ifdef CONFIG_SMP
        cpu_physical_id(0) = hard_smp_processor_id();
-       check_for_logical_procs();
-       if (smp_num_cpucores > 1)
-               printk(KERN_INFO
-                      "cpu package is Multi-Core capable: number of cores=%d\n",
-                      smp_num_cpucores);
-       if (smp_num_siblings > 1)
-               printk(KERN_INFO
-                      "cpu package is Multi-Threading capable: number of siblings=%d\n",
-                      smp_num_siblings);
 #endif
 
        cpu_init();     /* initialize the bootstrap CPU */
@@ -661,12 +624,13 @@ show_cpuinfo (struct seq_file *m, void *v)
                   lpj*HZ/500000, (lpj*HZ/5000) % 100);
 #ifdef CONFIG_SMP
        seq_printf(m, "siblings   : %u\n", cpus_weight(cpu_core_map[cpunum]));
+       if (c->socket_id != -1)
+               seq_printf(m, "physical id: %u\n", c->socket_id);
        if (c->threads_per_core > 1 || c->cores_per_socket > 1)
                seq_printf(m,
-                          "physical id: %u\n"
-                          "core id    : %u\n"
-                          "thread id  : %u\n",
-                          c->socket_id, c->core_id, c->thread_id);
+                          "core id    : %u\n"
+                          "thread id  : %u\n",
+                          c->core_id, c->thread_id);
 #endif
        seq_printf(m,"\n");
 
@@ -778,6 +742,9 @@ identify_cpu (struct cpuinfo_ia64 *c)
        c->socket_id = -1;
 
        identify_siblings(c);
+
+       if (c->threads_per_core > smp_num_siblings)
+               smp_num_siblings = c->threads_per_core;
 #endif
        c->ppn = cpuid.field.ppn;
        c->number = cpuid.field.number;
index c57dbce25c12f2b7cbdc05557d2d3c8a7cd4b8bc..f0fc4d8465ad172cc9f4f0ce4215de85b3b3a09a 100644 (file)
@@ -142,7 +142,6 @@ DEFINE_PER_CPU_SHARED_ALIGNED(cpumask_t, cpu_sibling_map);
 EXPORT_PER_CPU_SYMBOL(cpu_sibling_map);
 
 int smp_num_siblings = 1;
-int smp_num_cpucores = 1;
 
 /* which logical CPU number maps to which CPU (physical APIC ID) */
 volatile int ia64_cpu_to_sapicid[NR_CPUS];
@@ -886,13 +885,17 @@ identify_siblings(struct cpuinfo_ia64 *c)
        u16 pltid;
        pal_logical_to_physical_t info;
 
-       if (smp_num_cpucores == 1 && smp_num_siblings == 1)
-               return;
-
        if ((status = ia64_pal_logical_to_phys(-1, &info)) != PAL_STATUS_SUCCESS) {
-               printk(KERN_ERR "ia64_pal_logical_to_phys failed with %ld\n",
-                      status);
-               return;
+               if (status != PAL_STATUS_UNIMPLEMENTED) {
+                       printk(KERN_ERR
+                               "ia64_pal_logical_to_phys failed with %ld\n",
+                               status);
+                       return;
+               }
+
+               info.overview_ppid = 0;
+               info.overview_cpp  = 1;
+               info.overview_tpc  = 1;
        }
        if ((status = ia64_sal_physical_id_info(&pltid)) != PAL_STATUS_SUCCESS) {
                printk(KERN_ERR "ia64_sal_pltid failed with %ld\n", status);
@@ -900,6 +903,10 @@ identify_siblings(struct cpuinfo_ia64 *c)
        }
 
        c->socket_id =  (pltid << 8) | info.overview_ppid;
+
+       if (info.overview_cpp == 1 && info.overview_tpc == 1)
+               return;
+
        c->cores_per_socket = info.overview_cpp;
        c->threads_per_core = info.overview_tpc;
        c->num_log = info.overview_num_log;
index d3c538be466c8e82d5e76719230de21fa3121d79..7e9c275ea148579b8b792583f497ae15e21927f3 100644 (file)
@@ -146,6 +146,46 @@ find_bootmap_location (unsigned long start, unsigned long end, void *arg)
        return 0;
 }
 
+#ifdef CONFIG_SMP
+static void *cpu_data;
+/**
+ * per_cpu_init - setup per-cpu variables
+ *
+ * Allocate and setup per-cpu data areas.
+ */
+void * __cpuinit
+per_cpu_init (void)
+{
+       int cpu;
+       static int first_time=1;
+
+       /*
+        * get_free_pages() cannot be used before cpu_init() done.  BSP
+        * allocates "NR_CPUS" pages for all CPUs to avoid that AP calls
+        * get_zeroed_page().
+        */
+       if (first_time) {
+               first_time=0;
+               for (cpu = 0; cpu < NR_CPUS; cpu++) {
+                       memcpy(cpu_data, __phys_per_cpu_start, __per_cpu_end - __per_cpu_start);
+                       __per_cpu_offset[cpu] = (char *) cpu_data - __per_cpu_start;
+                       cpu_data += PERCPU_PAGE_SIZE;
+                       per_cpu(local_per_cpu_offset, cpu) = __per_cpu_offset[cpu];
+               }
+       }
+       return __per_cpu_start + __per_cpu_offset[smp_processor_id()];
+}
+
+static inline void
+alloc_per_cpu_data(void)
+{
+       cpu_data = __alloc_bootmem(PERCPU_PAGE_SIZE * NR_CPUS,
+                                  PERCPU_PAGE_SIZE, __pa(MAX_DMA_ADDRESS));
+}
+#else
+#define alloc_per_cpu_data() do { } while (0)
+#endif /* CONFIG_SMP */
+
 /**
  * find_memory - setup memory map
  *
@@ -182,41 +222,9 @@ find_memory (void)
 
        find_initrd();
 
+       alloc_per_cpu_data();
 }
 
-#ifdef CONFIG_SMP
-/**
- * per_cpu_init - setup per-cpu variables
- *
- * Allocate and setup per-cpu data areas.
- */
-void * __cpuinit
-per_cpu_init (void)
-{
-       void *cpu_data;
-       int cpu;
-       static int first_time=1;
-
-       /*
-        * get_free_pages() cannot be used before cpu_init() done.  BSP
-        * allocates "NR_CPUS" pages for all CPUs to avoid that AP calls
-        * get_zeroed_page().
-        */
-       if (first_time) {
-               first_time=0;
-               cpu_data = __alloc_bootmem(PERCPU_PAGE_SIZE * NR_CPUS,
-                                          PERCPU_PAGE_SIZE, __pa(MAX_DMA_ADDRESS));
-               for (cpu = 0; cpu < NR_CPUS; cpu++) {
-                       memcpy(cpu_data, __phys_per_cpu_start, __per_cpu_end - __per_cpu_start);
-                       __per_cpu_offset[cpu] = (char *) cpu_data - __per_cpu_start;
-                       cpu_data += PERCPU_PAGE_SIZE;
-                       per_cpu(local_per_cpu_offset, cpu) = __per_cpu_offset[cpu];
-               }
-       }
-       return __per_cpu_start + __per_cpu_offset[smp_processor_id()];
-}
-#endif /* CONFIG_SMP */
-
 static int
 count_pages (u64 start, u64 end, void *arg)
 {
index c6c19bf11becd573c38362462bf3c1ad0cce91bd..25aef6211a54be964778e5e42165bb2d0e3738f1 100644 (file)
@@ -472,7 +472,7 @@ struct memmap_init_callback_data {
        unsigned long zone;
 };
 
-static int
+static int __meminit
 virtual_memmap_init (u64 start, u64 end, void *arg)
 {
        struct memmap_init_callback_data *args;
@@ -503,7 +503,7 @@ virtual_memmap_init (u64 start, u64 end, void *arg)
        return 0;
 }
 
-void
+void __meminit
 memmap_init (unsigned long size, int nid, unsigned long zone,
             unsigned long start_pfn)
 {
index 1c2f13e181d0bff8ff2f2cbada0f282f8ab5a8b7..85a0d54fb5abf928fb48af225d7d2b2f119bd202 100644 (file)
@@ -1,6 +1,7 @@
 SECTIONS {
        . = SIZEOF_HEADERS;
        .rodata : { *(.rodata) } :ro
+       .note : { *(.note*) }
        . = 0xa0000;
        .data : { *(.data) } :dat
        /DISCARD/ : { *(*) }
index 0f9b12683bf39bfb44da0adb2f1b21816a6c19c0..53351c3cd7b1ef071fb6ff53ccdfc219f135182d 100644 (file)
@@ -5,7 +5,7 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (c) 2000-2006 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2007 Silicon Graphics, Inc.  All Rights Reserved.
  */
 
 #include <linux/irq.h>
@@ -85,12 +85,18 @@ static void sn_shutdown_irq(unsigned int irq)
 {
 }
 
+extern void ia64_mca_register_cpev(int);
+
 static void sn_disable_irq(unsigned int irq)
 {
+       if (irq == local_vector_to_irq(IA64_CPE_VECTOR))
+               ia64_mca_register_cpev(0);
 }
 
 static void sn_enable_irq(unsigned int irq)
 {
+       if (irq == local_vector_to_irq(IA64_CPE_VECTOR))
+               ia64_mca_register_cpev(irq);
 }
 
 static void sn_ack_irq(unsigned int irq)
index 3db62f24596ca6e76d9756d3c4e96ee9b630d443..868c9aa64fe2db7af71a78016ab637b9b0a18a12 100644 (file)
@@ -98,6 +98,7 @@ sn_platform_plat_specific_err_print(const u8 * sect_header, u8 ** oemdata,
        while (*sn_oemdata_size > sn_oemdata_bufsize) {
                u8 *newbuf = vmalloc(*sn_oemdata_size);
                if (!newbuf) {
+                       mutex_unlock(&sn_oemdata_mutex);
                        printk(KERN_ERR "%s: unable to extend sn_oemdata\n",
                               __FUNCTION__);
                        return 1;
index e336e1692a734cb137734f555133a68887915e57..81785b78bc1ecc5e4c53053567d5bfffbc9aa230 100644 (file)
@@ -3,7 +3,7 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (c) 2004-2006 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2004-2007 Silicon Graphics, Inc.  All Rights Reserved.
  */
 
 
@@ -257,7 +257,9 @@ xpc_hb_checker(void *ignore)
 
        set_cpus_allowed(current, cpumask_of_cpu(XPC_HB_CHECK_CPU));
 
+       /* set our heartbeating to other partitions into motion */
        xpc_hb_check_timeout = jiffies + (xpc_hb_check_interval * HZ);
+       xpc_hb_beater(0);
 
        while (!(volatile int) xpc_exiting) {
 
@@ -1338,16 +1340,8 @@ xpc_init(void)
                dev_warn(xpc_part, "can't register die notifier\n");
        }
 
-
-       /*
-        * Set the beating to other partitions into motion.  This is
-        * the last requirement for other partitions' discovery to
-        * initiate communications with us.
-        */
        init_timer(&xpc_hb_timer);
        xpc_hb_timer.function = xpc_hb_beater;
-       xpc_hb_beater(0);
-
 
        /*
         * The real work-horse behind xpc.  This processes incoming
index 880add120eb3208715cb51a82bbd286ccbed877b..8a2a53b33616708a7bbe6815bfd9d58dce42bf98 100644 (file)
@@ -565,7 +565,7 @@ void atari_kbd_leds(unsigned int leds)
 
 static int atari_keyb_done = 0;
 
-int __init atari_keyb_init(void)
+int atari_keyb_init(void)
 {
        if (atari_keyb_done)
                return 0;
@@ -631,6 +631,7 @@ int __init atari_keyb_init(void)
        atari_keyb_done = 1;
        return 0;
 }
+EXPORT_SYMBOL_GPL(atari_keyb_init);
 
 int atari_kbd_translate(unsigned char keycode, unsigned char *keycodep, char raw_mode)
 {
index 61262c5f9c6299d440271ba5a596208c67444e11..455bd1f560aa2adc80cfc2891665c93acdb9ec4f 100644 (file)
@@ -22,6 +22,7 @@ config MACH_ALCHEMY
 config BASLER_EXCITE
        bool "Basler eXcite smart camera"
        select CEVT_R4K
+       select CSRC_R4K
        select DMA_COHERENT
        select HW_HAS_PCI
        select IRQ_CPU
@@ -49,6 +50,7 @@ config BASLER_EXCITE_PROTOTYPE
 config BCM47XX
        bool "BCM47XX based boards"
        select CEVT_R4K
+       select CSRC_R4K
        select DMA_NONCOHERENT
        select HW_HAS_PCI
        select IRQ_CPU
@@ -66,6 +68,7 @@ config BCM47XX
 config MIPS_COBALT
        bool "Cobalt Server"
        select CEVT_R4K
+       select CSRC_R4K
        select CEVT_GT641XX
        select DMA_NONCOHERENT
        select HW_HAS_PCI
@@ -85,6 +88,7 @@ config MACH_DECSTATION
        bool "DECstations"
        select BOOT_ELF32
        select CEVT_R4K
+       select CSRC_R4K
        select DMA_NONCOHERENT
        select NO_IOPORT
        select IRQ_CPU
@@ -117,6 +121,7 @@ config MACH_JAZZ
        select ARC32
        select ARCH_MAY_HAVE_PC_FDC
        select CEVT_R4K
+       select CSRC_R4K
        select GENERIC_ISA_DMA
        select IRQ_CPU
        select I8253
@@ -137,6 +142,7 @@ config MACH_JAZZ
 config LASAT
        bool "LASAT Networks platforms"
        select CEVT_R4K
+       select CSRC_R4K
        select DMA_NONCOHERENT
        select SYS_HAS_EARLY_PRINTK
        select HW_HAS_PCI
@@ -154,6 +160,7 @@ config LEMOTE_FULONG
        bool "Lemote Fulong mini-PC"
        select ARCH_SPARSEMEM_ENABLE
        select CEVT_R4K
+       select CSRC_R4K
        select SYS_HAS_CPU_LOONGSON2
        select DMA_NONCOHERENT
        select BOOT_ELF32
@@ -179,6 +186,7 @@ config MIPS_ATLAS
        bool "MIPS Atlas board"
        select BOOT_ELF32
        select CEVT_R4K
+       select CSRC_R4K
        select DMA_NONCOHERENT
        select SYS_HAS_EARLY_PRINTK
        select IRQ_CPU
@@ -210,6 +218,7 @@ config MIPS_MALTA
        select ARCH_MAY_HAVE_PC_FDC
        select BOOT_ELF32
        select CEVT_R4K
+       select CSRC_R4K
        select DMA_NONCOHERENT
        select GENERIC_ISA_DMA
        select IRQ_CPU
@@ -241,6 +250,7 @@ config MIPS_MALTA
 config MIPS_SEAD
        bool "MIPS SEAD board"
        select CEVT_R4K
+       select CSRC_R4K
        select IRQ_CPU
        select DMA_NONCOHERENT
        select SYS_HAS_EARLY_PRINTK
@@ -260,6 +270,7 @@ config MIPS_SEAD
 config MIPS_SIM
        bool 'MIPS simulator (MIPSsim)'
        select CEVT_R4K
+       select CSRC_R4K
        select DMA_NONCOHERENT
        select SYS_HAS_EARLY_PRINTK
        select IRQ_CPU
@@ -278,6 +289,7 @@ config MIPS_SIM
 config MARKEINS
        bool "NEC EMMA2RH Mark-eins"
        select CEVT_R4K
+       select CSRC_R4K
        select DMA_NONCOHERENT
        select HW_HAS_PCI
        select IRQ_CPU
@@ -293,6 +305,7 @@ config MARKEINS
 config MACH_VR41XX
        bool "NEC VR4100 series based machines"
        select CEVT_R4K
+       select CSRC_R4K
        select SYS_HAS_CPU_VR41XX
        select GENERIC_HARDIRQS_NO__DO_IRQ
 
@@ -330,6 +343,7 @@ config PMC_MSP
 config PMC_YOSEMITE
        bool "PMC-Sierra Yosemite eval board"
        select CEVT_R4K
+       select CSRC_R4K
        select DMA_COHERENT
        select HW_HAS_PCI
        select IRQ_CPU
@@ -351,6 +365,7 @@ config PMC_YOSEMITE
 config QEMU
        bool "Qemu"
        select CEVT_R4K
+       select CSRC_R4K
        select DMA_COHERENT
        select GENERIC_ISA_DMA
        select HAVE_STD_PC_SERIAL_PORT
@@ -361,10 +376,10 @@ config QEMU
        select PCSPEAKER
        select SWAP_IO_SPACE
        select SYS_HAS_CPU_MIPS32_R1
+       select SYS_HAS_EARLY_PRINTK
        select SYS_SUPPORTS_32BIT_KERNEL
        select SYS_SUPPORTS_BIG_ENDIAN
        select SYS_SUPPORTS_LITTLE_ENDIAN
-       select ARCH_SPARSEMEM_ENABLE
        select GENERIC_HARDIRQS_NO__DO_IRQ
        select NR_CPUS_DEFAULT_1
        select SYS_SUPPORTS_SMP
@@ -382,9 +397,11 @@ config SGI_IP22
        select ARC32
        select BOOT_ELF32
        select CEVT_R4K
+       select CSRC_R4K
        select DMA_NONCOHERENT
        select HW_HAS_EISA
        select I8253
+       select I8259
        select IP22_CPU_SCACHE
        select IRQ_CPU
        select GENERIC_ISA_DMA_SUPPORT_BROKEN
@@ -427,6 +444,7 @@ config SGI_IP32
        select ARC32
        select BOOT_ELF32
        select CEVT_R4K
+       select CSRC_R4K
        select DMA_NONCOHERENT
        select HW_HAS_PCI
        select IRQ_CPU
@@ -498,6 +516,7 @@ config SIBYTE_SWARM
        select SYS_SUPPORTS_HIGHMEM
        select SYS_SUPPORTS_KGDB
        select SYS_SUPPORTS_LITTLE_ENDIAN
+       select ZONE_DMA32 if 64BIT
 
 config SIBYTE_LITTLESUR
        bool "Sibyte BCM91250C2-LittleSur"
@@ -546,7 +565,9 @@ config SIBYTE_BIGSUR
        select SWAP_IO_SPACE
        select SYS_HAS_CPU_SB1
        select SYS_SUPPORTS_BIG_ENDIAN
+       select SYS_SUPPORTS_HIGHMEM
        select SYS_SUPPORTS_LITTLE_ENDIAN
+       select ZONE_DMA32 if 64BIT
 
 config SNI_RM
        bool "SNI RM200/300/400"
@@ -555,6 +576,7 @@ config SNI_RM
        select ARCH_MAY_HAVE_PC_FDC
        select BOOT_ELF32
        select CEVT_R4K
+       select CSRC_R4K
        select DMA_NONCOHERENT
        select GENERIC_ISA_DMA
        select HW_HAS_EISA
@@ -583,6 +605,7 @@ config SNI_RM
 
 config TOSHIBA_JMR3927
        bool "Toshiba JMR-TX3927 board"
+       select CEVT_TXX9
        select DMA_NONCOHERENT
        select HW_HAS_PCI
        select MIPS_TX3927
@@ -597,6 +620,8 @@ config TOSHIBA_JMR3927
 config TOSHIBA_RBTX4927
        bool "Toshiba RBTX49[23]7 board"
        select CEVT_R4K
+       select CSRC_R4K
+       select CEVT_TXX9
        select DMA_NONCOHERENT
        select HAS_TXX9_SERIAL
        select HW_HAS_PCI
@@ -618,6 +643,8 @@ config TOSHIBA_RBTX4927
 config TOSHIBA_RBTX4938
        bool "Toshiba RBTX4938 board"
        select CEVT_R4K
+       select CSRC_R4K
+       select CEVT_TXX9
        select DMA_NONCOHERENT
        select HAS_TXX9_SERIAL
        select HW_HAS_PCI
@@ -638,6 +665,7 @@ config TOSHIBA_RBTX4938
 config WR_PPMC
        bool "Wind River PPMC board"
        select CEVT_R4K
+       select CSRC_R4K
        select IRQ_CPU
        select BOOT_ELF32
        select DMA_NONCOHERENT
@@ -730,12 +758,30 @@ config ARCH_MAY_HAVE_PC_FDC
 config BOOT_RAW
        bool
 
+config CEVT_BCM1480
+       bool
+
 config CEVT_GT641XX
        bool
 
 config CEVT_R4K
        bool
 
+config CEVT_SB1250
+       bool
+
+config CEVT_TXX9
+       bool
+
+config CSRC_BCM1480
+       bool
+
+config CSRC_R4K
+       bool
+
+config CSRC_SB1250
+       bool
+
 config CFE
        bool
 
@@ -1390,7 +1436,6 @@ config MIPS_MT_SMP
        depends on SYS_SUPPORTS_MULTITHREADING
        select CPU_MIPSR2_IRQ_VI
        select CPU_MIPSR2_IRQ_EI
-       select CPU_MIPSR2_SRS
        select MIPS_MT
        select NR_CPUS_DEFAULT_2
        select SMP
@@ -1407,7 +1452,6 @@ config MIPS_MT_SMTC
        select GENERIC_CLOCKEVENTS_BROADCAST
        select CPU_MIPSR2_IRQ_VI
        select CPU_MIPSR2_IRQ_EI
-       select CPU_MIPSR2_SRS
        select MIPS_MT
        select NR_CPUS_DEFAULT_8
        select SMP
@@ -1434,7 +1478,6 @@ config MIPS_VPE_LOADER
        depends on SYS_SUPPORTS_MULTITHREADING
        select CPU_MIPSR2_IRQ_VI
        select CPU_MIPSR2_IRQ_EI
-       select CPU_MIPSR2_SRS
        select MIPS_MT
        help
          Includes a loader for loading an elf relocatable object
@@ -1563,12 +1606,6 @@ config CPU_MIPSR2_IRQ_VI
 config CPU_MIPSR2_IRQ_EI
        bool
 
-#
-# Shadow registers are an R2 feature
-#
-config CPU_MIPSR2_SRS
-       bool
-
 config CPU_HAS_SYNC
        bool
        depends on !CPU_R3000
@@ -1630,6 +1667,9 @@ config ARCH_DISCONTIGMEM_ENABLE
          or have huge holes in the physical address space for other reasons.
          See <file:Documentation/vm/numa> for more.
 
+config ARCH_POPULATES_NODE_MAP
+       def_bool y
+
 config ARCH_SPARSEMEM_ENABLE
        bool
        select SPARSEMEM_STATIC
@@ -1935,6 +1975,9 @@ config I8253
 config PCSPEAKER
        bool
 
+config ZONE_DMA32
+       bool
+
 source "drivers/pcmcia/Kconfig"
 
 source "drivers/pci/hotplug/Kconfig"
index 23c17755eca07a0b6e46f416da5316e3e6638984..a1f8d8b96b03faf5217d597ae59d28356012fb96 100644 (file)
@@ -44,7 +44,7 @@ endif
 
 ifneq ($(SUBARCH),$(ARCH))
   ifeq ($(CROSS_COMPILE),)
-    CROSS_COMPILE := $(call cc-cross-prefix, $(tool-archpref)-linux-  $(tool-archpref)-gnu-linux-  $(tool-archpref)-unknown-gnu-linux-)
+    CROSS_COMPILE := $(call cc-cross-prefix, $(tool-archpref)-linux-  $(tool-archpref)-linux-gnu-  $(tool-archpref)-unknown-linux-gnu-)
   endif
 endif
 
index b36cec58a9a848df2e7be884d85c23c9adb71da1..05d1354aad3a5dca791a46bd017de81a42ff68d8 100644 (file)
@@ -138,6 +138,7 @@ config SOC_AU1X00
        bool
        select 64BIT_PHYS_ADDR
        select CEVT_R4K
+       select CSRC_R4K
        select IRQ_CPU
        select SYS_HAS_CPU_MIPS32_R1
        select SYS_SUPPORTS_32BIT_KERNEL
index 59e932a928d2001eac06acfdd3cf14e24da25605..ddfb7f0a17a627f52679b8b13a44e934bb6dc1f8 100644 (file)
@@ -318,38 +318,6 @@ static struct irq_chip level_irq_type = {
        .end            = end_irq,
 };
 
-#ifdef CONFIG_PM
-void startup_match20_interrupt(irq_handler_t handler)
-{
-       struct irq_desc *desc = &irq_desc[AU1000_TOY_MATCH2_INT];
-
-       static struct irqaction action;
-       memset(&action, 0, sizeof(struct irqaction));
-
-       /*
-        * This is a big problem.... since we didn't use request_irq
-        * when kernel/irq.c calls probe_irq_xxx this interrupt will
-        * be probed for usage. This will end up disabling the device :(
-        * Give it a bogus "action" pointer -- this will keep it from
-        * getting auto-probed!
-        *
-        * By setting the status to match that of request_irq() we
-        * can avoid it.  --cgray
-       */
-       action.dev_id = handler;
-       action.flags = IRQF_DISABLED;
-       cpus_clear(action.mask);
-       action.name = "Au1xxx TOY";
-       action.handler = handler;
-       action.next = NULL;
-
-       desc->action = &action;
-       desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING | IRQ_INPROGRESS);
-
-       local_enable_irq(AU1000_TOY_MATCH2_INT);
-}
-#endif
-
 static void __init setup_local_irq(unsigned int irq_nr, int type, int int_req)
 {
        unsigned int bit = irq_nr - AU1000_INTC0_INT_BASE;
index 2556399708ba452278d2c05c73b319d4fe864750..f113b512d7b166b81c9b32ece83516693cf72123 100644 (file)
@@ -67,7 +67,7 @@ static DEFINE_SPINLOCK(time_lock);
 unsigned long wtimer;
 
 #ifdef CONFIG_PM
-irqreturn_t counter0_irq(int irq, void *dev_id)
+static irqreturn_t counter0_irq(int irq, void *dev_id)
 {
        unsigned long pc0;
        int time_elapsed;
@@ -117,6 +117,13 @@ irqreturn_t counter0_irq(int irq, void *dev_id)
        return IRQ_HANDLED;
 }
 
+struct irqaction counter0_action = {
+       .handler        = counter0_irq,
+       .flags          = IRQF_DISABLED,
+       .name           = "alchemy-toy",
+       .dev_id         = NULL,
+};
+
 /* When we wakeup from sleep, we have to "catch up" on all of the
  * timer ticks we have missed.
  */
@@ -221,7 +228,7 @@ unsigned long cal_r4koff(void)
        return (cpu_speed / HZ);
 }
 
-void __init plat_timer_setup(struct irqaction *irq)
+void __init plat_time_init(void)
 {
        unsigned int est_freq;
 
@@ -255,15 +262,10 @@ void __init plat_timer_setup(struct irqaction *irq)
         * we do this.
         */
        if (no_au1xxx_32khz) {
-               unsigned int c0_status;
-
                printk("WARNING: no 32KHz clock found.\n");
 
-               /* Ensure we get CPO_COUNTER interrupts.
-               */
-               c0_status = read_c0_status();
-               c0_status |= IE_IRQ5;
-               write_c0_status(c0_status);
+               /* Ensure we get CPO_COUNTER interrupts.  */
+               set_c0_status(IE_IRQ5);
        }
        else {
                while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C0S);
@@ -280,7 +282,7 @@ void __init plat_timer_setup(struct irqaction *irq)
                au_writel(last_match20 + MATCH20_INC, SYS_TOYMATCH2);
                au_sync();
                while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20);
-               startup_match20_interrupt(counter0_irq);
+               setup_irq(AU1000_TOY_MATCH2_INT, &counter0_action);
 
                /* We can use the real 'wait' instruction.
                */
index 764bf9f7e281d2cffcc39264ab4e5acd2a1c17b5..85a90941de4ff9c1b900fe52f44e3900e84ec5f2 100644 (file)
@@ -8,3 +8,6 @@
 #
 
 lib-y := init.o board_setup.o irqmap.o
+obj-y := platform.o
+
+EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/au1000/mtx-1/platform.c b/arch/mips/au1000/mtx-1/platform.c
new file mode 100644 (file)
index 0000000..49c0fb4
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * MTX-1 platform devices registration
+ *
+ * Copyright (C) 2007, Florian Fainelli <florian@openwrt.org>
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/platform_device.h>
+#include <linux/leds.h>
+
+#include <asm/gpio.h>
+
+static struct resource mtx1_wdt_res[] = {
+       [0] = {
+               .start  = 15,
+               .end    = 15,
+               .name   = "mtx1-wdt-gpio",
+               .flags  = IORESOURCE_IRQ,
+       }
+};
+
+static struct platform_device mtx1_wdt = {
+       .name = "mtx1-wdt",
+       .id = 0,
+       .num_resources = ARRAY_SIZE(mtx1_wdt_res),
+       .resource = mtx1_wdt_res,
+};
+
+static struct gpio_led default_leds[] = {
+       {
+               .name   = "mtx1:green",
+               .gpio = 211,
+       }, {
+               .name = "mtx1:red",
+               .gpio = 212,
+       },
+};
+
+static struct gpio_led_platform_data mtx1_led_data = {
+       .num_leds = ARRAY_SIZE(default_leds),
+       .leds = default_leds,
+};
+
+static struct platform_device mtx1_gpio_leds = {
+       .name = "leds-gpio",
+       .id = -1,
+       .dev = {
+               .platform_data = &mtx1_led_data,
+       }
+};
+
+static struct __initdata platform_device * mtx1_devs[] = {
+       &mtx1_gpio_leds,
+       &mtx1_wdt
+};
+
+static int __init mtx1_register_devices(void)
+{
+       return platform_add_devices(mtx1_devs, ARRAY_SIZE(mtx1_devs));
+}
+
+arch_initcall(mtx1_register_devices);
index 22b673cf55afdcb12bfa78bf0588781d2af9f719..970b1b1d5cda63cf06702cbc1ed60ca4f8454ab2 100644 (file)
@@ -3,3 +3,5 @@
 #
 
 lib-y := init.o board_setup.o irqmap.o
+
+EXTRA_CFLAGS += -Werror
index 5dbc9868f598594031354abc4a690b54c8e01e88..b98bebfa87c6acd7c50e835b98c74f48ba8a3548 100644 (file)
@@ -68,9 +68,11 @@ void board_reset(void)
 void __init board_setup(void)
 {
        char *argptr = NULL;
-       u32 pin_func;
 
 #if 0
+       {
+       u32 pin_func;
+
        /* Enable PSC1 SYNC for AC97.  Normaly done in audio driver,
         * but it is board specific code, so put it here.
         */
@@ -81,11 +83,13 @@ void __init board_setup(void)
 
        au_writel(0, (u32)bcsr|0x10); /* turn off pcmcia power */
        au_sync();
+       }
 #endif
 
 #if defined(CONFIG_I2C_AU1550)
        {
        u32 freq0, clksrc;
+       u32 pin_func;
 
        /* Select SMBUS in CPLD */
        bcsr->resets &= ~(BCSR_RESETS_PCS0MUX);
index bdf00e2a35e47db2fd10c59cb4f29a30cefe7588..c096be4ed4e785f8c2a9a625360aec1b715cefcf 100644 (file)
@@ -94,51 +94,41 @@ inline void pb1200_disable_irq(unsigned int irq_nr)
        bcsr->intclr = 1<<(irq_nr - PB1200_INT_BEGIN);
 }
 
-static unsigned int pb1200_startup_irq( unsigned int irq_nr )
+static unsigned int pb1200_setup_cascade(void)
 {
-       if (++pb1200_cascade_en == 1)
-       {
-               request_irq(AU1000_GPIO_7, &pb1200_cascade_handler,
-                       0, "Pb1200 Cascade", (void *)&pb1200_cascade_handler );
-#ifdef CONFIG_MIPS_PB1200
-    /* We have a problem with CPLD rev3. Enable a workaround */
-       if( ((bcsr->whoami & BCSR_WHOAMI_CPLD)>>4) <= 3)
-       {
-               printk("\nWARNING!!!\n");
-               printk("\nWARNING!!!\n");
-               printk("\nWARNING!!!\n");
-               printk("\nWARNING!!!\n");
-               printk("\nWARNING!!!\n");
-               printk("\nWARNING!!!\n");
-               printk("Pb1200 must be at CPLD rev4. Please have Pb1200\n");
-               printk("updated to latest revision. This software will not\n");
-               printk("work on anything less than CPLD rev4\n");
-               printk("\nWARNING!!!\n");
-               printk("\nWARNING!!!\n");
-               printk("\nWARNING!!!\n");
-               printk("\nWARNING!!!\n");
-               printk("\nWARNING!!!\n");
-               printk("\nWARNING!!!\n");
-               while(1);
-       }
-#endif
-       }
-       pb1200_enable_irq(irq_nr);
+       int err;
+
+       err = request_irq(AU1000_GPIO_7, &pb1200_cascade_handler,
+                         0, "Pb1200 Cascade", &pb1200_cascade_handler);
+       if (err)
+               return err;
+
        return 0;
 }
 
-static void pb1200_shutdown_irq( unsigned int irq_nr )
+static unsigned int pb1200_startup_irq(unsigned int irq)
 {
-       pb1200_disable_irq(irq_nr);
-       if (--pb1200_cascade_en == 0)
-       {
-               free_irq(AU1000_GPIO_7, &pb1200_cascade_handler );
+       if (++pb1200_cascade_en == 1) {
+               int res;
+
+               res = pb1200_setup_cascade();
+               if (res)
+                       return res;
        }
-       return;
+
+       pb1200_enable_irq(irq);
+
+       return 0;
 }
 
-static struct irq_chip external_irq_type =
+static void pb1200_shutdown_irq(unsigned int irq)
 {
+       pb1200_disable_irq(irq);
+       if (--pb1200_cascade_en == 0)
+               free_irq(AU1000_GPIO_7, &pb1200_cascade_handler);
+}
+
+static struct irq_chip external_irq_type = {
 #ifdef CONFIG_MIPS_PB1200
        .name = "Pb1200 Ext",
 #endif
@@ -155,16 +145,38 @@ static struct irq_chip external_irq_type =
 
 void _board_init_irq(void)
 {
-       int irq_nr;
+       unsigned int irq;
 
-       for (irq_nr = PB1200_INT_BEGIN; irq_nr <= PB1200_INT_END; irq_nr++)
-       {
-               set_irq_chip_and_handler(irq_nr, &external_irq_type,
+#ifdef CONFIG_MIPS_PB1200
+       /* We have a problem with CPLD rev3. Enable a workaround */
+       if (((bcsr->whoami & BCSR_WHOAMI_CPLD) >> 4) <= 3) {
+               printk("\nWARNING!!!\n");
+               printk("\nWARNING!!!\n");
+               printk("\nWARNING!!!\n");
+               printk("\nWARNING!!!\n");
+               printk("\nWARNING!!!\n");
+               printk("\nWARNING!!!\n");
+               printk("Pb1200 must be at CPLD rev4. Please have Pb1200\n");
+               printk("updated to latest revision. This software will not\n");
+               printk("work on anything less than CPLD rev4\n");
+               printk("\nWARNING!!!\n");
+               printk("\nWARNING!!!\n");
+               printk("\nWARNING!!!\n");
+               printk("\nWARNING!!!\n");
+               printk("\nWARNING!!!\n");
+               printk("\nWARNING!!!\n");
+               panic("Game over.  Your score is 0.");
+       }
+#endif
+
+       for (irq = PB1200_INT_BEGIN; irq <= PB1200_INT_END; irq++) {
+               set_irq_chip_and_handler(irq, &external_irq_type,
                                         handle_level_irq);
-               pb1200_disable_irq(irq_nr);
+               pb1200_disable_irq(irq);
        }
 
-       /* GPIO_7 can not be hooked here, so it is hooked upon first
-       request of any source attached to the cascade */
+       /*
+        * GPIO_7 can not be hooked here, so it is hooked upon first
+        * request of any source attached to the cascade
+        */
 }
-
index 404ca9284b309e35cde4b663eaf63fc52dfdb938..6dd8f0d46d096f1b8ad57d0510abed786bb09b42 100644 (file)
@@ -68,24 +68,23 @@ DEFINE_SPINLOCK(titan_lock);
 int titan_irqflags;
 
 
+/*
+ * The eXcite platform uses the alternate timer interrupt
+ *
+ * Fixme: At the time of this writing cevt-r4k.c doesn't yet know about how
+ * to handle the alternate timer interrupt of the RM9000.
+ */
 void __init plat_time_init(void)
 {
        const u32 modebit5 = ocd_readl(0x00e4);
-       unsigned int
-               mult = ((modebit5 >> 11) & 0x1f) + 2,
-               div = ((modebit5 >> 16) & 0x1f) + 2;
+       unsigned int mult = ((modebit5 >> 11) & 0x1f) + 2;
+       unsigned int div = ((modebit5 >> 16) & 0x1f) + 2;
 
-       if (div == 33) div = 1;
+       if (div == 33)
+               div = 1;
        mips_hpt_frequency = EXCITE_CPU_EXT_CLOCK * mult / div / 2;
 }
 
-void __init plat_timer_setup(struct irqaction *irq)
-{
-       /* The eXcite platform uses the alternate timer interrupt */
-       set_c0_intcontrol(0x80);
-       setup_irq(TIMER_IRQ, irq);
-}
-
 static int __init excite_init_console(void)
 {
 #if defined(CONFIG_SERIAL_8250)
index 885b633647e96e34be965243da16bd52f989835b..5a8b7acb7dd7edc6df31bff29603633d2a02c991 100644 (file)
@@ -738,7 +738,6 @@ CONFIG_HW_CONSOLE=y
 CONFIG_VT_HW_CONSOLE_BINDING=y
 # CONFIG_SERIAL_NONSTANDARD is not set
 # CONFIG_AU1X00_GPIO is not set
-# CONFIG_TS_AU1X00_ADS7846 is not set
 
 #
 # Serial drivers
index e3c3a07e8a7c54d2d0eeeee731d850ac27aa270e..d4ed90bca2691498f7c64033d4f211c664645da3 100644 (file)
@@ -714,7 +714,6 @@ CONFIG_HW_CONSOLE=y
 CONFIG_VT_HW_CONSOLE_BINDING=y
 # CONFIG_SERIAL_NONSTANDARD is not set
 # CONFIG_AU1X00_GPIO is not set
-# CONFIG_TS_AU1X00_ADS7846 is not set
 
 #
 # Serial drivers
index 9aa7c3ebfa3f775ea2d481ab13c47fcb3ce6cc98..a055657e69834d095296f4af72b514d8fc103c5d 100644 (file)
@@ -775,7 +775,6 @@ CONFIG_HW_CONSOLE=y
 CONFIG_VT_HW_CONSOLE_BINDING=y
 # CONFIG_SERIAL_NONSTANDARD is not set
 # CONFIG_AU1X00_GPIO is not set
-# CONFIG_TS_AU1X00_ADS7846 is not set
 
 #
 # Serial drivers
index 99240668bca1d088e7e3113981599f21e841504f..0ad08cf446ecea39aeaa54a36ac4454c38bf1dfe 100644 (file)
@@ -811,7 +811,6 @@ CONFIG_SERIO_RAW=m
 # CONFIG_VT is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
 # CONFIG_AU1X00_GPIO is not set
-# CONFIG_TS_AU1X00_ADS7846 is not set
 
 #
 # Serial drivers
index 19992f76c60d5956c179df13bb1ec4bc4caa3d54..057c7d429c80dcef0bfb2a0f6bf5a73646299f88 100644 (file)
@@ -856,7 +856,6 @@ CONFIG_SERIO_RAW=m
 # CONFIG_VT is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
 # CONFIG_AU1X00_GPIO is not set
-# CONFIG_TS_AU1X00_ADS7846 is not set
 
 #
 # Serial drivers
index d53fa8f8e099ef507e30018a74047954365665e7..703d28db05b9e7b4f86c9b48cc98fa9f98dc5e6c 100644 (file)
@@ -731,7 +731,6 @@ CONFIG_HW_CONSOLE=y
 CONFIG_VT_HW_CONSOLE_BINDING=y
 # CONFIG_SERIAL_NONSTANDARD is not set
 # CONFIG_AU1X00_GPIO is not set
-# CONFIG_TS_AU1X00_ADS7846 is not set
 
 #
 # Serial drivers
index dc4aa0c6684795e3a36e199f205a56ebd095445d..82f0c5cee0dc21c346f82ca0b637a1667a26e20b 100644 (file)
@@ -849,7 +849,6 @@ CONFIG_SERIO_RAW=m
 # CONFIG_VT is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
 # CONFIG_AU1X00_GPIO is not set
-# CONFIG_TS_AU1X00_ADS7846 is not set
 
 #
 # Serial drivers
index 24428e13002b09da34b9c1312231387bb3f7a43a..147a4fc7fdd8dabca7882446a967ba6492814226 100644 (file)
@@ -842,7 +842,6 @@ CONFIG_SERIO_RAW=m
 # CONFIG_VT is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
 # CONFIG_AU1X00_GPIO is not set
-# CONFIG_TS_AU1X00_ADS7846 is not set
 
 #
 # Serial drivers
index 49dfcef2518ce3bf9ea5f282d1adf421be923df4..c2798229cbfb8609e893a998c585789bf9d0664c 100644 (file)
@@ -468,7 +468,7 @@ CONFIG_BLK_DEV_IDEFLOPPY=y
 #
 CONFIG_IDE_GENERIC=y
 # CONFIG_BLK_DEV_IDEPCI is not set
-# CONFIG_BLK_DEV_IDE_SWARM is not set
+CONFIG_BLK_DEV_IDE_SWARM=y
 # CONFIG_IDE_ARM is not set
 # CONFIG_BLK_DEV_IDEDMA is not set
 # CONFIG_IDEDMA_AUTO is not set
index b207e7f1417a41482eeab6f6a6cfbfd8529d3170..668dbd5f12c5b756751507c9dfdab2586993ba33 100644 (file)
 
 #define WRPPMC_CPU_CLK_FREQ 40000000 /* 40MHZ */
 
-void __init plat_timer_setup(struct irqaction *irq)
-{
-       /* Install ISR for timer interrupt */
-       setup_irq(WRPPMC_MIPS_TIMER_IRQ, irq);
-}
-
 /*
  * Estimate CPU frequency.  Sets mips_hpt_frequency as a side-effect
  *
index ae25b480723e8161366a692c0f36061852e8fbb8..d7f8a782aae4d9a3200c307f383be28ed83b2b18 100644 (file)
@@ -97,9 +97,10 @@ asmlinkage void plat_irq_dispatch(void)
        if (pending & IE_IRQ4) {
                r4030_read_reg32(JAZZ_TIMER_REGISTER);
                do_IRQ(JAZZ_TIMER_IRQ);
-       } else if (pending & IE_IRQ2)
-               do_IRQ(r4030_read_reg32(JAZZ_EISA_IRQ_ACK));
-       else if (pending & IE_IRQ1) {
+       } else if (pending & IE_IRQ2) {
+               irq = *(volatile u8 *)JAZZ_EISA_IRQ_ACK;
+               do_IRQ(irq);
+       } else if (pending & IE_IRQ1) {
                irq = *(volatile u8 *)JAZZ_IO_IRQ_SOURCE >> 2;
                if (likely(irq > 0))
                        do_IRQ(irq + JAZZ_IRQ_START - 1);
@@ -117,16 +118,16 @@ static void r4030_set_mode(enum clock_event_mode mode,
 struct clock_event_device r4030_clockevent = {
        .name           = "r4030",
        .features       = CLOCK_EVT_FEAT_PERIODIC,
-       .rating         = 100,
+       .rating         = 300,
        .irq            = JAZZ_TIMER_IRQ,
-       .cpumask        = CPU_MASK_CPU0,
        .set_mode       = r4030_set_mode,
 };
 
 static irqreturn_t r4030_timer_interrupt(int irq, void *dev_id)
 {
-       r4030_clockevent.event_handler(&r4030_clockevent);
+       struct clock_event_device *cd = dev_id;
 
+       cd->event_handler(cd);
        return IRQ_HANDLED;
 }
 
@@ -134,15 +135,22 @@ static struct irqaction r4030_timer_irqaction = {
        .handler        = r4030_timer_interrupt,
        .flags          = IRQF_DISABLED,
        .mask           = CPU_MASK_CPU0,
-       .name           = "timer",
+       .name           = "R4030 timer",
 };
 
 void __init plat_time_init(void)
 {
-       struct irqaction *irq = &r4030_timer_irqaction;
+       struct clock_event_device *cd = &r4030_clockevent;
+       struct irqaction *action = &r4030_timer_irqaction;
+       unsigned int cpu = smp_processor_id();
 
        BUG_ON(HZ != 100);
 
+       cd->cpumask             = cpumask_of_cpu(cpu);
+       clockevents_register_device(cd);
+       action->dev_id = cd;
+       setup_irq(JAZZ_TIMER_IRQ, action);
+
        /*
         * Set clock to 100Hz.
         *
@@ -150,8 +158,5 @@ void __init plat_time_init(void)
         * a programmable 4-bit divider.  This makes it fairly inflexible.
         */
        r4030_write_reg32(JAZZ_TIMER_INTERVAL, 9);
-       setup_irq(JAZZ_TIMER_IRQ, irq);
-
-       clockevents_register_device(&r4030_clockevent);
        setup_pit_timer();
 }
index edb9e59248ecea7860dde0f16c5623a54d00e16b..06e01c8f4e3a56a96d415758af245f4622a1770d 100644 (file)
  * Copyright (C) 2007 Ralf Baechle (ralf@linux-mips.org)
  */
 
-#include <linux/clockchips.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/kdev_t.h>
 #include <linux/types.h>
-#include <linux/sched.h>
 #include <linux/pci.h>
 #include <linux/ide.h>
-#include <linux/irq.h>
 #include <linux/ioport.h>
-#include <linux/param.h>       /* for HZ */
 #include <linux/delay.h>
 #include <linux/pm.h>
 #include <linux/platform_device.h>
 #endif
 
 #include <asm/addrspace.h>
-#include <asm/time.h>
+#include <asm/txx9tmr.h>
 #include <asm/reboot.h>
 #include <asm/jmr3927/jmr3927.h>
 #include <asm/mipsregs.h>
 
 extern void puts(const char *cp);
 
-/* Tick Timer divider */
-#define JMR3927_TIMER_CCD      0       /* 1/2 */
-#define JMR3927_TIMER_CLK      (JMR3927_IMCLK / (2 << JMR3927_TIMER_CCD))
-
 /* don't enable - see errata */
 static int jmr3927_ccfg_toeon;
 
@@ -93,66 +85,12 @@ static void jmr3927_machine_power_off(void)
        while (1);
 }
 
-static cycle_t jmr3927_hpt_read(void)
-{
-       /* We assume this function is called xtime_lock held. */
-       return jiffies * (JMR3927_TIMER_CLK / HZ) + jmr3927_tmrptr->trr;
-}
-
-static void jmr3927_set_mode(enum clock_event_mode mode,
-       struct clock_event_device *evt)
-{
-       /* Nothing to do here */
-}
-
-struct clock_event_device jmr3927_clock_event_device = {
-       .name           = "MIPS",
-       .features       = CLOCK_EVT_FEAT_PERIODIC,
-       .shift          = 32,
-       .rating         = 300,
-       .cpumask        = CPU_MASK_CPU0,
-       .irq            = JMR3927_IRQ_TICK,
-       .set_mode       = jmr3927_set_mode,
-};
-
-static irqreturn_t jmr3927_timer_interrupt(int irq, void *dev_id)
-{
-       struct clock_event_device *cd = &jmr3927_clock_event_device;
-
-       jmr3927_tmrptr->tisr = 0;       /* ack interrupt */
-
-       cd->event_handler(cd);
-
-       return IRQ_HANDLED;
-}
-
-static struct irqaction jmr3927_timer_irqaction = {
-       .handler        = jmr3927_timer_interrupt,
-       .flags          = IRQF_DISABLED | IRQF_PERCPU,
-       .name           = "jmr3927-timer",
-};
-
 void __init plat_time_init(void)
 {
-       struct clock_event_device *cd;
-
-       clocksource_mips.read = jmr3927_hpt_read;
-       mips_hpt_frequency = JMR3927_TIMER_CLK;
-
-       jmr3927_tmrptr->cpra = JMR3927_TIMER_CLK / HZ;
-       jmr3927_tmrptr->itmr = TXx927_TMTITMR_TIIE | TXx927_TMTITMR_TZCE;
-       jmr3927_tmrptr->ccdr = JMR3927_TIMER_CCD;
-       jmr3927_tmrptr->tcr =
-               TXx927_TMTCR_TCE | TXx927_TMTCR_CCDE | TXx927_TMTCR_TMODE_ITVL;
-
-       cd = &jmr3927_clock_event_device;
-       /* Calculate the min / max delta */
-       cd->mult = div_sc((unsigned long) JMR3927_IMCLK, NSEC_PER_SEC, 32);
-       cd->max_delta_ns        = clockevent_delta2ns(0x7fffffff, cd);
-       cd->min_delta_ns        = clockevent_delta2ns(0x300, cd);
-       clockevents_register_device(cd);
-
-       setup_irq(JMR3927_IRQ_TICK, &jmr3927_timer_irqaction);
+       txx9_clockevent_init(TX3927_TMR_REG(0),
+                            TXX9_IRQ_BASE + JMR3927_IRQ_IRC_TMR(0),
+                            JMR3927_IMCLK);
+       txx9_clocksource_init(TX3927_TMR_REG(1), JMR3927_IMCLK);
 }
 
 #define DO_WRITE_THROUGH
@@ -317,15 +255,8 @@ static void __init tx3927_setup(void)
               tx3927_ccfgptr->ccfg, tx3927_ccfgptr->pcfg);
 
        /* TMR */
-       /* disable all timers */
-       for (i = 0; i < TX3927_NR_TMR; i++) {
-               tx3927_tmrptr(i)->tcr = TXx927_TMTCR_CRE;
-               tx3927_tmrptr(i)->tisr = 0;
-               tx3927_tmrptr(i)->cpra = 0xffffffff;
-               tx3927_tmrptr(i)->itmr = 0;
-               tx3927_tmrptr(i)->ccdr = 0;
-               tx3927_tmrptr(i)->pgmr = 0;
-       }
+       for (i = 0; i < TX3927_NR_TMR; i++)
+               txx9_tmr_init(TX3927_TMR_REG(i));
 
        /* DMA */
        tx3927_dmaptr->mcr = 0;
index d7745c8976f697a5e38351f240c2bf859c802b08..ffa08362de170d3c09790b4511c6cdd5f973f6bc 100644 (file)
@@ -8,8 +8,14 @@ obj-y          += cpu-probe.o branch.o entry.o genex.o irq.o process.o \
                   ptrace.o reset.o semaphore.o setup.o signal.o syscall.o \
                   time.o topology.o traps.o unaligned.o
 
+obj-$(CONFIG_CEVT_BCM1480)     += cevt-bcm1480.o
 obj-$(CONFIG_CEVT_R4K)         += cevt-r4k.o
 obj-$(CONFIG_CEVT_GT641XX)     += cevt-gt641xx.o
+obj-$(CONFIG_CEVT_SB1250)      += cevt-sb1250.o
+obj-$(CONFIG_CEVT_TXX9)                += cevt-txx9.o
+obj-$(CONFIG_CSRC_BCM1480)     += csrc-bcm1480.o
+obj-$(CONFIG_CSRC_R4K)         += csrc-r4k.o
+obj-$(CONFIG_CSRC_SB1250)      += csrc-sb1250.o
 
 binfmt_irix-objs       := irixelf.o irixinv.o irixioctl.o irixsig.o    \
                           irix5sys.o sysirix.o
@@ -38,6 +44,7 @@ obj-$(CONFIG_CPU_TX49XX)      += r4k_fpu.o r4k_switch.o
 obj-$(CONFIG_CPU_VR41XX)       += r4k_fpu.o r4k_switch.o
 
 obj-$(CONFIG_SMP)              += smp.o
+obj-$(CONFIG_SMP_UP)           += smp-up.o
 
 obj-$(CONFIG_MIPS_MT)          += mips-mt.o
 obj-$(CONFIG_MIPS_MT_FPAFF)    += mips-mt-fpaff.o
diff --git a/arch/mips/kernel/cevt-bcm1480.c b/arch/mips/kernel/cevt-bcm1480.c
new file mode 100644 (file)
index 0000000..0a57f86
--- /dev/null
@@ -0,0 +1,153 @@
+/*
+ * Copyright (C) 2000,2001,2004 Broadcom Corporation
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+#include <linux/clockchips.h>
+#include <linux/interrupt.h>
+#include <linux/percpu.h>
+
+#include <asm/addrspace.h>
+#include <asm/io.h>
+#include <asm/time.h>
+
+#include <asm/sibyte/bcm1480_regs.h>
+#include <asm/sibyte/sb1250_regs.h>
+#include <asm/sibyte/bcm1480_int.h>
+#include <asm/sibyte/bcm1480_scd.h>
+
+#include <asm/sibyte/sb1250.h>
+
+#define IMR_IP2_VAL    K_BCM1480_INT_MAP_I0
+#define IMR_IP3_VAL    K_BCM1480_INT_MAP_I1
+#define IMR_IP4_VAL    K_BCM1480_INT_MAP_I2
+
+/*
+ * The general purpose timer ticks at 1MHz independent if
+ * the rest of the system
+ */
+static void sibyte_set_mode(enum clock_event_mode mode,
+                           struct clock_event_device *evt)
+{
+       unsigned int cpu = smp_processor_id();
+       void __iomem *cfg, *init;
+
+       cfg = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG));
+       init = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT));
+
+       switch (mode) {
+       case CLOCK_EVT_MODE_PERIODIC:
+               __raw_writeq(0, cfg);
+               __raw_writeq((V_SCD_TIMER_FREQ / HZ) - 1, init);
+               __raw_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS,
+                            cfg);
+               break;
+
+       case CLOCK_EVT_MODE_ONESHOT:
+               /* Stop the timer until we actually program a shot */
+       case CLOCK_EVT_MODE_SHUTDOWN:
+               __raw_writeq(0, cfg);
+               break;
+
+       case CLOCK_EVT_MODE_UNUSED:     /* shuddup gcc */
+       case CLOCK_EVT_MODE_RESUME:
+               ;
+       }
+}
+
+static int sibyte_next_event(unsigned long delta, struct clock_event_device *cd)
+{
+       unsigned int cpu = smp_processor_id();
+       void __iomem *cfg, *init;
+
+       cfg = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG));
+       init = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT));
+
+       __raw_writeq(0, cfg);
+       __raw_writeq(delta - 1, init);
+       __raw_writeq(M_SCD_TIMER_ENABLE, cfg);
+
+       return 0;
+}
+
+static irqreturn_t sibyte_counter_handler(int irq, void *dev_id)
+{
+       unsigned int cpu = smp_processor_id();
+       struct clock_event_device *cd = dev_id;
+       void __iomem *cfg;
+       unsigned long tmode;
+
+       if (cd->mode == CLOCK_EVT_MODE_PERIODIC)
+               tmode = M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS;
+       else
+               tmode = 0;
+
+       /* ACK interrupt */
+       cfg = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG));
+       ____raw_writeq(tmode, cfg);
+
+       cd->event_handler(cd);
+
+       return IRQ_HANDLED;
+}
+
+static DEFINE_PER_CPU(struct clock_event_device, sibyte_hpt_clockevent);
+static DEFINE_PER_CPU(struct irqaction, sibyte_hpt_irqaction);
+static DEFINE_PER_CPU(char [18], sibyte_hpt_name);
+
+void __cpuinit sb1480_clockevent_init(void)
+{
+       unsigned int cpu = smp_processor_id();
+       unsigned int irq = K_BCM1480_INT_TIMER_0 + cpu;
+       struct irqaction *action = &per_cpu(sibyte_hpt_irqaction, cpu);
+       struct clock_event_device *cd = &per_cpu(sibyte_hpt_clockevent, cpu);
+       unsigned char *name = per_cpu(sibyte_hpt_name, cpu);
+
+       BUG_ON(cpu > 3);        /* Only have 4 general purpose timers */
+
+       sprintf(name, "bcm1480-counter-%d", cpu);
+       cd->name                = name;
+       cd->features            = CLOCK_EVT_FEAT_PERIODIC |
+                                 CLOCK_EVT_FEAT_ONESHOT;
+       clockevent_set_clock(cd, V_SCD_TIMER_FREQ);
+       cd->max_delta_ns        = clockevent_delta2ns(0x7fffff, cd);
+       cd->min_delta_ns        = clockevent_delta2ns(2, cd);
+       cd->rating              = 200;
+       cd->irq                 = irq;
+       cd->cpumask             = cpumask_of_cpu(cpu);
+       cd->set_next_event      = sibyte_next_event;
+       cd->set_mode            = sibyte_set_mode;
+       clockevents_register_device(cd);
+
+       bcm1480_mask_irq(cpu, irq);
+
+       /*
+        * Map the timer interrupt to IP[4] of this cpu
+        */
+       __raw_writeq(IMR_IP4_VAL,
+                    IOADDR(A_BCM1480_IMR_REGISTER(cpu,
+                       R_BCM1480_IMR_INTERRUPT_MAP_BASE_H) + (irq << 3)));
+
+       bcm1480_unmask_irq(cpu, irq);
+
+       action->handler = sibyte_counter_handler;
+       action->flags   = IRQF_DISABLED | IRQF_PERCPU;
+       action->mask    = cpumask_of_cpu(cpu);
+       action->name    = name;
+       action->dev_id  = cd;
+
+       irq_set_affinity(irq, cpumask_of_cpu(cpu));
+       setup_irq(irq, action);
+}
index 4c651b2680f975dd77749c8fb3f5399dece61537..c36772631fe0e7b9524fbfe2ad6ed4b6da9435f4 100644 (file)
@@ -49,10 +49,9 @@ int gt641xx_timer0_state(void)
 static int gt641xx_timer0_set_next_event(unsigned long delta,
                                         struct clock_event_device *evt)
 {
-       unsigned long flags;
        u32 ctrl;
 
-       spin_lock_irqsave(&gt641xx_timer_lock, flags);
+       spin_lock(&gt641xx_timer_lock);
 
        ctrl = GT_READ(GT_TC_CONTROL_OFS);
        ctrl &= ~(GT_TC_CONTROL_ENTC0_MSK | GT_TC_CONTROL_SELTC0_MSK);
@@ -61,7 +60,7 @@ static int gt641xx_timer0_set_next_event(unsigned long delta,
        GT_WRITE(GT_TC0_OFS, delta);
        GT_WRITE(GT_TC_CONTROL_OFS, ctrl);
 
-       spin_unlock_irqrestore(&gt641xx_timer_lock, flags);
+       spin_unlock(&gt641xx_timer_lock);
 
        return 0;
 }
@@ -69,10 +68,9 @@ static int gt641xx_timer0_set_next_event(unsigned long delta,
 static void gt641xx_timer0_set_mode(enum clock_event_mode mode,
                                    struct clock_event_device *evt)
 {
-       unsigned long flags;
        u32 ctrl;
 
-       spin_lock_irqsave(&gt641xx_timer_lock, flags);
+       spin_lock(&gt641xx_timer_lock);
 
        ctrl = GT_READ(GT_TC_CONTROL_OFS);
        ctrl &= ~(GT_TC_CONTROL_ENTC0_MSK | GT_TC_CONTROL_SELTC0_MSK);
@@ -90,7 +88,7 @@ static void gt641xx_timer0_set_mode(enum clock_event_mode mode,
 
        GT_WRITE(GT_TC_CONTROL_OFS, ctrl);
 
-       spin_unlock_irqrestore(&gt641xx_timer_lock, flags);
+       spin_unlock(&gt641xx_timer_lock);
 }
 
 static void gt641xx_timer0_event_handler(struct clock_event_device *dev)
@@ -133,9 +131,9 @@ static int __init gt641xx_timer0_clockevent_init(void)
 
        cd = &gt641xx_timer0_clockevent;
        cd->rating = 200 + gt641xx_base_clock / 10000000;
+       clockevent_set_clock(cd, gt641xx_base_clock);
        cd->max_delta_ns = clockevent_delta2ns(0x7fffffff, cd);
        cd->min_delta_ns = clockevent_delta2ns(0x300, cd);
-       clockevent_set_clock(cd, gt641xx_base_clock);
 
        clockevents_register_device(&gt641xx_timer0_clockevent);
 
index ae2984fff580026cb30c597bbfc83704867a2230..24a2d907aa0de4c022c0d5e89227dceae2a8a572 100644 (file)
@@ -28,7 +28,7 @@ static int mips_next_event(unsigned long delta,
        cnt = read_c0_count();
        cnt += delta;
        write_c0_compare(cnt);
-       res = ((long)(read_c0_count() - cnt ) > 0) ? -ETIME : 0;
+       res = ((int)(read_c0_count() - cnt) > 0) ? -ETIME : 0;
 #ifdef CONFIG_MIPS_MT_SMTC
        evpe(vpflags);
        local_irq_restore(flags);
@@ -179,7 +179,7 @@ static int c0_compare_int_pending(void)
 
 static int c0_compare_int_usable(void)
 {
-       const unsigned int delta = 0x300000;
+       unsigned int delta;
        unsigned int cnt;
 
        /*
@@ -192,11 +192,17 @@ static int c0_compare_int_usable(void)
                        return 0;
        }
 
-       cnt = read_c0_count();
-       cnt += delta;
-       write_c0_compare(cnt);
+       for (delta = 0x10; delta <= 0x400000; delta <<= 1) {
+               cnt = read_c0_count();
+               cnt += delta;
+               write_c0_compare(cnt);
+               irq_disable_hazard();
+               if ((int)(read_c0_count() - cnt) < 0)
+                   break;
+               /* increase delta if the timer was already expired */
+       }
 
-       while ((long)(read_c0_count() - cnt) <= 0)
+       while ((int)(read_c0_count() - cnt) <= 0)
                ;       /* Wait for expiry  */
 
        if (!c0_compare_int_pending())
@@ -213,15 +219,15 @@ static int c0_compare_int_usable(void)
        return 1;
 }
 
-void __cpuinit mips_clockevent_init(void)
+int __cpuinit mips_clockevent_init(void)
 {
        uint64_t mips_freq = mips_hpt_frequency;
        unsigned int cpu = smp_processor_id();
        struct clock_event_device *cd;
-       unsigned int irq = MIPS_CPU_IRQ_BASE + 7;
+       unsigned int irq;
 
-       if (!cpu_has_counter)
-               return;
+       if (!cpu_has_counter || !mips_hpt_frequency)
+               return -ENXIO;
 
 #ifdef CONFIG_MIPS_MT_SMTC
        setup_smtc_dummy_clockevent_device();
@@ -231,11 +237,20 @@ void __cpuinit mips_clockevent_init(void)
         * device.
         */
        if (cpu)
-               return;
+               return 0;
 #endif
 
        if (!c0_compare_int_usable())
-               return;
+               return -ENXIO;
+
+       /*
+        * With vectored interrupts things are getting platform specific.
+        * get_c0_compare_int is a hook to allow a platform to return the
+        * interrupt number of it's liking.
+        */
+       irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq;
+       if (get_c0_compare_int)
+               irq = get_c0_compare_int();
 
        cd = &per_cpu(mips_clockevent_device, cpu);
 
@@ -261,13 +276,17 @@ void __cpuinit mips_clockevent_init(void)
 
        clockevents_register_device(cd);
 
-       if (!cp0_timer_irq_installed) {
+       if (cp0_timer_irq_installed)
+               return 0;
+
+       cp0_timer_irq_installed = 1;
+
 #ifdef CONFIG_MIPS_MT_SMTC
 #define CPUCTR_IMASKBIT (0x100 << cp0_compare_irq)
-               setup_irq_smtc(irq, &c0_compare_irqaction, CPUCTR_IMASKBIT);
+       setup_irq_smtc(irq, &c0_compare_irqaction, CPUCTR_IMASKBIT);
 #else
-               setup_irq(irq, &c0_compare_irqaction);
-#endif /* CONFIG_MIPS_MT_SMTC */
-               cp0_timer_irq_installed = 1;
-       }
+       setup_irq(irq, &c0_compare_irqaction);
+#endif
+
+       return 0;
 }
diff --git a/arch/mips/kernel/cevt-sb1250.c b/arch/mips/kernel/cevt-sb1250.c
new file mode 100644 (file)
index 0000000..63ac3ad
--- /dev/null
@@ -0,0 +1,152 @@
+/*
+ * Copyright (C) 2000, 2001 Broadcom Corporation
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+#include <linux/clockchips.h>
+#include <linux/interrupt.h>
+#include <linux/percpu.h>
+
+#include <asm/addrspace.h>
+#include <asm/io.h>
+#include <asm/time.h>
+
+#include <asm/sibyte/sb1250.h>
+#include <asm/sibyte/sb1250_regs.h>
+#include <asm/sibyte/sb1250_int.h>
+#include <asm/sibyte/sb1250_scd.h>
+
+#define IMR_IP2_VAL    K_INT_MAP_I0
+#define IMR_IP3_VAL    K_INT_MAP_I1
+#define IMR_IP4_VAL    K_INT_MAP_I2
+
+/*
+ * The general purpose timer ticks at 1MHz independent if
+ * the rest of the system
+ */
+static void sibyte_set_mode(enum clock_event_mode mode,
+                           struct clock_event_device *evt)
+{
+       unsigned int cpu = smp_processor_id();
+       void __iomem *cfg, *init;
+
+       cfg = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG));
+       init = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT));
+
+       switch (mode) {
+       case CLOCK_EVT_MODE_PERIODIC:
+               __raw_writeq(0, cfg);
+               __raw_writeq((V_SCD_TIMER_FREQ / HZ) - 1, init);
+               __raw_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS,
+                            cfg);
+               break;
+
+       case CLOCK_EVT_MODE_ONESHOT:
+               /* Stop the timer until we actually program a shot */
+       case CLOCK_EVT_MODE_SHUTDOWN:
+               __raw_writeq(0, cfg);
+               break;
+
+       case CLOCK_EVT_MODE_UNUSED:     /* shuddup gcc */
+       case CLOCK_EVT_MODE_RESUME:
+               ;
+       }
+}
+
+static int sibyte_next_event(unsigned long delta, struct clock_event_device *cd)
+{
+       unsigned int cpu = smp_processor_id();
+       void __iomem *cfg, *init;
+
+       cfg = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG));
+       init = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT));
+
+       __raw_writeq(0, cfg);
+       __raw_writeq(delta - 1, init);
+       __raw_writeq(M_SCD_TIMER_ENABLE, cfg);
+
+       return 0;
+}
+
+static irqreturn_t sibyte_counter_handler(int irq, void *dev_id)
+{
+       unsigned int cpu = smp_processor_id();
+       struct clock_event_device *cd = dev_id;
+       void __iomem *cfg;
+       unsigned long tmode;
+
+       if (cd->mode == CLOCK_EVT_MODE_PERIODIC)
+               tmode = M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS;
+       else
+               tmode = 0;
+
+       /* ACK interrupt */
+       cfg = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG));
+       ____raw_writeq(tmode, cfg);
+
+       cd->event_handler(cd);
+
+       return IRQ_HANDLED;
+}
+
+static DEFINE_PER_CPU(struct clock_event_device, sibyte_hpt_clockevent);
+static DEFINE_PER_CPU(struct irqaction, sibyte_hpt_irqaction);
+static DEFINE_PER_CPU(char [18], sibyte_hpt_name);
+
+void __cpuinit sb1250_clockevent_init(void)
+{
+       unsigned int cpu = smp_processor_id();
+       unsigned int irq = K_INT_TIMER_0 + cpu;
+       struct irqaction *action = &per_cpu(sibyte_hpt_irqaction, cpu);
+       struct clock_event_device *cd = &per_cpu(sibyte_hpt_clockevent, cpu);
+       unsigned char *name = per_cpu(sibyte_hpt_name, cpu);
+
+       /* Only have 4 general purpose timers, and we use last one as hpt */
+       BUG_ON(cpu > 2);
+
+       sprintf(name, "sb1250-counter-%d", cpu);
+       cd->name                = name;
+       cd->features            = CLOCK_EVT_FEAT_PERIODIC |
+                                 CLOCK_EVT_FEAT_ONESHOT;
+       clockevent_set_clock(cd, V_SCD_TIMER_FREQ);
+       cd->max_delta_ns        = clockevent_delta2ns(0x7fffff, cd);
+       cd->min_delta_ns        = clockevent_delta2ns(2, cd);
+       cd->rating              = 200;
+       cd->irq                 = irq;
+       cd->cpumask             = cpumask_of_cpu(cpu);
+       cd->set_next_event      = sibyte_next_event;
+       cd->set_mode            = sibyte_set_mode;
+       clockevents_register_device(cd);
+
+       sb1250_mask_irq(cpu, irq);
+
+       /*
+        * Map the timer interrupt to IP[4] of this cpu
+        */
+       __raw_writeq(IMR_IP4_VAL,
+                    IOADDR(A_IMR_REGISTER(cpu, R_IMR_INTERRUPT_MAP_BASE) +
+                           (irq << 3)));
+
+       sb1250_unmask_irq(cpu, irq);
+
+       action->handler = sibyte_counter_handler;
+       action->flags   = IRQF_DISABLED | IRQF_PERCPU;
+       action->mask    = cpumask_of_cpu(cpu);
+       action->name    = name;
+       action->dev_id  = cd;
+
+       irq_set_affinity(irq, cpumask_of_cpu(cpu));
+       setup_irq(irq, action);
+}
diff --git a/arch/mips/kernel/cevt-txx9.c b/arch/mips/kernel/cevt-txx9.c
new file mode 100644 (file)
index 0000000..795cb8f
--- /dev/null
@@ -0,0 +1,171 @@
+/*
+ * 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.
+ *
+ * Based on linux/arch/mips/kernel/cevt-r4k.c,
+ *          linux/arch/mips/jmr3927/rbhma3100/setup.c
+ *
+ * Copyright 2001 MontaVista Software Inc.
+ * Copyright (C) 2000-2001 Toshiba Corporation
+ * Copyright (C) 2007 MIPS Technologies, Inc.
+ * Copyright (C) 2007 Ralf Baechle <ralf@linux-mips.org>
+ */
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <asm/time.h>
+#include <asm/txx9tmr.h>
+
+#define TCR_BASE (TXx9_TMTCR_CCDE | TXx9_TMTCR_CRE | TXx9_TMTCR_TMODE_ITVL)
+#define TIMER_CCD      0       /* 1/2 */
+#define TIMER_CLK(imclk)       ((imclk) / (2 << TIMER_CCD))
+
+static struct txx9_tmr_reg __iomem *txx9_cs_tmrptr;
+
+static cycle_t txx9_cs_read(void)
+{
+       return __raw_readl(&txx9_cs_tmrptr->trr);
+}
+
+/* Use 1 bit smaller width to use full bits in that width */
+#define TXX9_CLOCKSOURCE_BITS (TXX9_TIMER_BITS - 1)
+
+static struct clocksource txx9_clocksource = {
+       .name           = "TXx9",
+       .rating         = 200,
+       .read           = txx9_cs_read,
+       .mask           = CLOCKSOURCE_MASK(TXX9_CLOCKSOURCE_BITS),
+       .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
+};
+
+void __init txx9_clocksource_init(unsigned long baseaddr,
+                                 unsigned int imbusclk)
+{
+       struct txx9_tmr_reg __iomem *tmrptr;
+
+       clocksource_set_clock(&txx9_clocksource, TIMER_CLK(imbusclk));
+       clocksource_register(&txx9_clocksource);
+
+       tmrptr = ioremap(baseaddr, sizeof(struct txx9_tmr_reg));
+       __raw_writel(TCR_BASE, &tmrptr->tcr);
+       __raw_writel(0, &tmrptr->tisr);
+       __raw_writel(TIMER_CCD, &tmrptr->ccdr);
+       __raw_writel(TXx9_TMITMR_TZCE, &tmrptr->itmr);
+       __raw_writel(1 << TXX9_CLOCKSOURCE_BITS, &tmrptr->cpra);
+       __raw_writel(TCR_BASE | TXx9_TMTCR_TCE, &tmrptr->tcr);
+       txx9_cs_tmrptr = tmrptr;
+}
+
+static struct txx9_tmr_reg __iomem *txx9_tmrptr;
+
+static void txx9tmr_stop_and_clear(struct txx9_tmr_reg __iomem *tmrptr)
+{
+       /* stop and reset counter */
+       __raw_writel(TCR_BASE, &tmrptr->tcr);
+       /* clear pending interrupt */
+       __raw_writel(0, &tmrptr->tisr);
+}
+
+static void txx9tmr_set_mode(enum clock_event_mode mode,
+                            struct clock_event_device *evt)
+{
+       struct txx9_tmr_reg __iomem *tmrptr = txx9_tmrptr;
+
+       txx9tmr_stop_and_clear(tmrptr);
+       switch (mode) {
+       case CLOCK_EVT_MODE_PERIODIC:
+               __raw_writel(TXx9_TMITMR_TIIE | TXx9_TMITMR_TZCE,
+                            &tmrptr->itmr);
+               /* start timer */
+               __raw_writel(((u64)(NSEC_PER_SEC / HZ) * evt->mult) >>
+                            evt->shift,
+                            &tmrptr->cpra);
+               __raw_writel(TCR_BASE | TXx9_TMTCR_TCE, &tmrptr->tcr);
+               break;
+       case CLOCK_EVT_MODE_SHUTDOWN:
+       case CLOCK_EVT_MODE_UNUSED:
+               __raw_writel(0, &tmrptr->itmr);
+               break;
+       case CLOCK_EVT_MODE_ONESHOT:
+               __raw_writel(TXx9_TMITMR_TIIE, &tmrptr->itmr);
+               break;
+       case CLOCK_EVT_MODE_RESUME:
+               __raw_writel(TIMER_CCD, &tmrptr->ccdr);
+               __raw_writel(0, &tmrptr->itmr);
+               break;
+       }
+}
+
+static int txx9tmr_set_next_event(unsigned long delta,
+                                 struct clock_event_device *evt)
+{
+       struct txx9_tmr_reg __iomem *tmrptr = txx9_tmrptr;
+
+       txx9tmr_stop_and_clear(tmrptr);
+       /* start timer */
+       __raw_writel(delta, &tmrptr->cpra);
+       __raw_writel(TCR_BASE | TXx9_TMTCR_TCE, &tmrptr->tcr);
+       return 0;
+}
+
+static struct clock_event_device txx9tmr_clock_event_device = {
+       .name           = "TXx9",
+       .features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
+       .rating         = 200,
+       .cpumask        = CPU_MASK_CPU0,
+       .set_mode       = txx9tmr_set_mode,
+       .set_next_event = txx9tmr_set_next_event,
+};
+
+static irqreturn_t txx9tmr_interrupt(int irq, void *dev_id)
+{
+       struct clock_event_device *cd = &txx9tmr_clock_event_device;
+       struct txx9_tmr_reg __iomem *tmrptr = txx9_tmrptr;
+
+       __raw_writel(0, &tmrptr->tisr); /* ack interrupt */
+       cd->event_handler(cd);
+       return IRQ_HANDLED;
+}
+
+static struct irqaction txx9tmr_irq = {
+       .handler        = txx9tmr_interrupt,
+       .flags          = IRQF_DISABLED | IRQF_PERCPU,
+       .name           = "txx9tmr",
+};
+
+void __init txx9_clockevent_init(unsigned long baseaddr, int irq,
+                                unsigned int imbusclk)
+{
+       struct clock_event_device *cd = &txx9tmr_clock_event_device;
+       struct txx9_tmr_reg __iomem *tmrptr;
+
+       tmrptr = ioremap(baseaddr, sizeof(struct txx9_tmr_reg));
+       txx9tmr_stop_and_clear(tmrptr);
+       __raw_writel(TIMER_CCD, &tmrptr->ccdr);
+       __raw_writel(0, &tmrptr->itmr);
+       txx9_tmrptr = tmrptr;
+
+       clockevent_set_clock(cd, TIMER_CLK(imbusclk));
+       cd->max_delta_ns =
+               clockevent_delta2ns(0xffffffff >> (32 - TXX9_TIMER_BITS), cd);
+       cd->min_delta_ns = clockevent_delta2ns(0xf, cd);
+       cd->irq = irq;
+       clockevents_register_device(cd);
+       setup_irq(irq, &txx9tmr_irq);
+       printk(KERN_INFO "TXx9: clockevent device at 0x%lx, irq %d\n",
+              baseaddr, irq);
+}
+
+void __init txx9_tmr_init(unsigned long baseaddr)
+{
+       struct txx9_tmr_reg __iomem *tmrptr;
+
+       tmrptr = ioremap(baseaddr, sizeof(struct txx9_tmr_reg));
+       __raw_writel(TXx9_TMTCR_CRE, &tmrptr->tcr);
+       __raw_writel(0, &tmrptr->tisr);
+       __raw_writel(0xffffffff, &tmrptr->cpra);
+       __raw_writel(0, &tmrptr->itmr);
+       __raw_writel(0, &tmrptr->ccdr);
+       __raw_writel(0, &tmrptr->pgmr);
+       iounmap(tmrptr);
+}
index c8c47a2d1972f5cb6c3a8dadd155ea32206b634a..5c2794391bf53423d8cd4a1282e17603701023f8 100644 (file)
@@ -943,6 +943,11 @@ __init void cpu_probe(void)
        }
 
        __cpu_name[cpu] = cpu_to_name(c);
+
+       if (cpu_has_mips_r2)
+               c->srsets = ((read_c0_srsctl() >> 26) & 0x0f) + 1;
+       else
+               c->srsets = 1;
 }
 
 __init void cpu_report(void)
diff --git a/arch/mips/kernel/csrc-bcm1480.c b/arch/mips/kernel/csrc-bcm1480.c
new file mode 100644 (file)
index 0000000..868745e
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2000,2001,2004 Broadcom Corporation
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+#include <linux/clocksource.h>
+
+#include <asm/addrspace.h>
+#include <asm/io.h>
+#include <asm/time.h>
+
+#include <asm/sibyte/bcm1480_regs.h>
+#include <asm/sibyte/sb1250_regs.h>
+#include <asm/sibyte/bcm1480_int.h>
+#include <asm/sibyte/bcm1480_scd.h>
+
+#include <asm/sibyte/sb1250.h>
+
+static cycle_t bcm1480_hpt_read(void)
+{
+       return (cycle_t) __raw_readq(IOADDR(A_SCD_ZBBUS_CYCLE_COUNT));
+}
+
+struct clocksource bcm1480_clocksource = {
+       .name   = "zbbus-cycles",
+       .rating = 200,
+       .read   = bcm1480_hpt_read,
+       .mask   = CLOCKSOURCE_MASK(64),
+       .flags  = CLOCK_SOURCE_IS_CONTINUOUS,
+};
+
+void __init sb1480_clocksource_init(void)
+{
+       struct clocksource *cs = &bcm1480_clocksource;
+       unsigned int plldiv;
+       unsigned long zbbus;
+
+       plldiv = G_BCM1480_SYS_PLL_DIV(__raw_readq(IOADDR(A_SCD_SYSTEM_CFG)));
+       zbbus = ((plldiv >> 1) * 50000000) + ((plldiv & 1) * 25000000);
+       clocksource_set_clock(cs, zbbus);
+       clocksource_register(cs);
+}
diff --git a/arch/mips/kernel/csrc-r4k.c b/arch/mips/kernel/csrc-r4k.c
new file mode 100644 (file)
index 0000000..74c5c62
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * 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) 2007 by Ralf Baechle
+ */
+
+static cycle_t c0_hpt_read(void)
+{
+       return read_c0_count();
+}
+
+static struct clocksource clocksource_mips = {
+       .name           = "MIPS",
+       .read           = c0_hpt_read,
+       .mask           = CLOCKSOURCE_MASK(32),
+       .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
+};
+
+static void __init init_mips_clocksource(void)
+{
+       /* Calclate a somewhat reasonable rating value */
+       clocksource_mips.rating = 200 + mips_hpt_frequency / 10000000;
+
+       clocksource_set_clock(&clocksource_mips, mips_hpt_frequency);
+
+       clocksource_register(&clocksource_mips);
+}
diff --git a/arch/mips/kernel/csrc-sb1250.c b/arch/mips/kernel/csrc-sb1250.c
new file mode 100644 (file)
index 0000000..92212bb
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2000, 2001 Broadcom Corporation
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+#include <linux/clocksource.h>
+
+#include <asm/addrspace.h>
+#include <asm/io.h>
+#include <asm/time.h>
+
+#include <asm/sibyte/sb1250.h>
+#include <asm/sibyte/sb1250_regs.h>
+#include <asm/sibyte/sb1250_int.h>
+#include <asm/sibyte/sb1250_scd.h>
+
+#define SB1250_HPT_NUM         3
+#define SB1250_HPT_VALUE       M_SCD_TIMER_CNT /* max value */
+
+/*
+ * The HPT is free running from SB1250_HPT_VALUE down to 0 then starts over
+ * again.
+ */
+static cycle_t sb1250_hpt_read(void)
+{
+       unsigned int count;
+
+       count = G_SCD_TIMER_CNT(__raw_readq(IOADDR(A_SCD_TIMER_REGISTER(SB1250_HPT_NUM, R_SCD_TIMER_CNT))));
+
+       return SB1250_HPT_VALUE - count;
+}
+
+struct clocksource bcm1250_clocksource = {
+       .name   = "bcm1250-counter-3",
+       .rating = 200,
+       .read   = sb1250_hpt_read,
+       .mask   = CLOCKSOURCE_MASK(23),
+       .flags  = CLOCK_SOURCE_IS_CONTINUOUS,
+};
+
+void __init sb1250_clocksource_init(void)
+{
+       struct clocksource *cs = &bcm1250_clocksource;
+
+       /* Setup hpt using timer #3 but do not enable irq for it */
+       __raw_writeq(0,
+                    IOADDR(A_SCD_TIMER_REGISTER(SB1250_HPT_NUM,
+                                                R_SCD_TIMER_CFG)));
+       __raw_writeq(SB1250_HPT_VALUE,
+                    IOADDR(A_SCD_TIMER_REGISTER(SB1250_HPT_NUM,
+                                                R_SCD_TIMER_INIT)));
+       __raw_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS,
+                    IOADDR(A_SCD_TIMER_REGISTER(SB1250_HPT_NUM,
+                                                R_SCD_TIMER_CFG)));
+
+       clocksource_set_clock(cs, V_SCD_TIMER_FREQ);
+       clocksource_register(cs);
+}
index c0f19d638b986c4f5be93b801a90b4e6717c6419..e76a76bf0b3de0cad4de6099e45f81884a994d53 100644 (file)
@@ -146,7 +146,7 @@ NESTED(handle_int, PT_SIZE, sp)
        and     k0, ST0_IEP
        bnez    k0, 1f
 
-       mfc0    k0, EP0_EPC
+       mfc0    k0, CP0_EPC
        .set    noreorder
        j       k0
        rfe
index 5d9830df3595d6fb9625b9acbb1a3560413969cb..c2d497ceffdd3249c9275157160daddbf705c45a 100644 (file)
@@ -12,8 +12,9 @@
 #include <asm/delay.h>
 #include <asm/i8253.h>
 #include <asm/io.h>
+#include <asm/time.h>
 
-static DEFINE_SPINLOCK(i8253_lock);
+DEFINE_SPINLOCK(i8253_lock);
 
 /*
  * Initialize the PIT timer.
@@ -87,11 +88,10 @@ struct clock_event_device pit_clockevent = {
        .features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
        .set_mode       = init_pit_timer,
        .set_next_event = pit_next_event,
-       .shift          = 32,
        .irq            = 0,
 };
 
-irqreturn_t timer_interrupt(int irq, void *dev_id)
+static irqreturn_t timer_interrupt(int irq, void *dev_id)
 {
        pit_clockevent.event_handler(&pit_clockevent);
 
@@ -111,19 +111,20 @@ static struct irqaction irq0  = {
  */
 void __init setup_pit_timer(void)
 {
+       struct clock_event_device *cd = &pit_clockevent;
+       unsigned int cpu = smp_processor_id();
+
        /*
         * Start pit with the boot cpu mask and make it global after the
         * IO_APIC has been initialized.
         */
-       pit_clockevent.cpumask = cpumask_of_cpu(0);
-       pit_clockevent.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, 32);
-       pit_clockevent.max_delta_ns =
-               clockevent_delta2ns(0x7FFF, &pit_clockevent);
-       pit_clockevent.min_delta_ns =
-               clockevent_delta2ns(0xF, &pit_clockevent);
-       clockevents_register_device(&pit_clockevent);
-
-       irq0.mask = cpumask_of_cpu(0);
+       cd->cpumask = cpumask_of_cpu(cpu);
+       clockevent_set_clock(cd, CLOCK_TICK_RATE);
+       cd->max_delta_ns = clockevent_delta2ns(0x7FFF, cd);
+       cd->min_delta_ns = clockevent_delta2ns(0xF, cd);
+       clockevents_register_device(cd);
+
+       irq0.mask = cpumask_of_cpu(cpu);
        setup_irq(0, &irq0);
 }
 
index a0a91056fda722472edd644e9fa73e379d697a3a..5b10ac133ec837b4ccd91844a42321d6a68769fd 100644 (file)
 
 #define _BLOCKABLE (~(_S(SIGKILL) | _S(SIGSTOP)))
 
+#define _IRIX_NSIG             128
+#define _IRIX_NSIG_BPW         BITS_PER_LONG
+#define _IRIX_NSIG_WORDS       (_IRIX_NSIG / _IRIX_NSIG_BPW)
+
 typedef struct {
-       unsigned long sig[4];
+       unsigned long sig[_IRIX_NSIG_WORDS];
 } irix_sigset_t;
 
 struct sigctx_irix5 {
@@ -426,6 +430,7 @@ asmlinkage int irix_sigprocmask(int how, irix_sigset_t __user *new,
                        break;
 
                default:
+                       spin_unlock_irq(&current->sighand->siglock);
                        return -EINVAL;
                }
                recalc_sigpending();
@@ -527,7 +532,7 @@ asmlinkage int irix_sigpoll_sys(unsigned long __user *set,
 
                expire = schedule_timeout_interruptible(expire);
 
-               for (i=0; i<=4; i++)
+               for (i=0; i < _IRIX_NSIG_WORDS; i++)
                        tmp |= (current->pending.signal.sig[i] & kset.sig[i]);
 
                if (tmp)
index 2507328834886e7f6151799713cb1de5ae505fef..971adf6ef4f4d527b94c94dbff5edab0e57f78b1 100644 (file)
@@ -44,5 +44,5 @@ void __init rm7k_cpu_irq_init(void)
 
        for (i = base; i < base + 4; i++)
                set_irq_chip_and_handler(i, &rm7k_irq_controller,
-                                        handle_level_irq);
+                                        handle_percpu_irq);
 }
index ae83d2df6f31d51dc47a223b45622add5633bd76..7b04583bd800410a5a0d24e92865d0640c081b8d 100644 (file)
@@ -104,5 +104,5 @@ void __init rm9k_cpu_irq_init(void)
 
        rm9000_perfcount_irq = base + 1;
        set_irq_chip_and_handler(rm9000_perfcount_irq, &rm9k_perfcounter_irq,
-                                handle_level_irq);
+                                handle_percpu_irq);
 }
index 7b66e03b58994e1e7f3daf6f88ead0628a1a4e12..0ee2567b780d4c4d6496eab4ff043a19bc1f3397 100644 (file)
@@ -116,5 +116,5 @@ void __init mips_cpu_irq_init(void)
 
        for (i = irq_base + 2; i < irq_base + 8; i++)
                set_irq_chip_and_handler(i, &mips_cpu_irq_controller,
-                                        handle_level_irq);
+                                        handle_percpu_irq);
 }
index efd2d1314123b54c371774af644181770f719fea..6e6e947cce1efe6fac56d54f1a795a6ac9ad7b03 100644 (file)
@@ -60,6 +60,8 @@ static int show_cpuinfo(struct seq_file *m, void *v)
                      cpu_has_dsp ? " dsp" : "",
                      cpu_has_mipsmt ? " mt" : ""
                );
+       seq_printf(m, "shadow register sets\t: %d\n",
+                      cpu_data[n].srsets);
 
        sprintf(fmt, "VCE%%c exceptions\t\t: %s\n",
                cpu_has_vce ? "%u" : "not available");
index 999f7853de26162893be99098d2a7221809ca40d..35234b92b9a58f9d5c9e8a2063c292e35c3ac327 100644 (file)
@@ -65,13 +65,13 @@ int ptrace_getregs(struct task_struct *child, __s64 __user *data)
        regs = task_pt_regs(child);
 
        for (i = 0; i < 32; i++)
-               __put_user(regs->regs[i], data + i);
-       __put_user(regs->lo, data + EF_LO - EF_R0);
-       __put_user(regs->hi, data + EF_HI - EF_R0);
-       __put_user(regs->cp0_epc, data + EF_CP0_EPC - EF_R0);
-       __put_user(regs->cp0_badvaddr, data + EF_CP0_BADVADDR - EF_R0);
-       __put_user(regs->cp0_status, data + EF_CP0_STATUS - EF_R0);
-       __put_user(regs->cp0_cause, data + EF_CP0_CAUSE - EF_R0);
+               __put_user((long)regs->regs[i], data + i);
+       __put_user((long)regs->lo, data + EF_LO - EF_R0);
+       __put_user((long)regs->hi, data + EF_HI - EF_R0);
+       __put_user((long)regs->cp0_epc, data + EF_CP0_EPC - EF_R0);
+       __put_user((long)regs->cp0_badvaddr, data + EF_CP0_BADVADDR - EF_R0);
+       __put_user((long)regs->cp0_status, data + EF_CP0_STATUS - EF_R0);
+       __put_user((long)regs->cp0_cause, data + EF_CP0_CAUSE - EF_R0);
 
        return 0;
 }
@@ -390,11 +390,11 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                }
 
        case PTRACE_GETREGS:
-               ret = ptrace_getregs(child, (__u64 __user *) data);
+               ret = ptrace_getregs(child, (__s64 __user *) data);
                break;
 
        case PTRACE_SETREGS:
-               ret = ptrace_setregs(child, (__u64 __user *) data);
+               ret = ptrace_setregs(child, (__s64 __user *) data);
                break;
 
        case PTRACE_GETFPREGS:
index f2bffed94fa312ba4c9b0c8f68a8d7b79cb58b32..76818be6ba7ce1511b37061c5cf4c9649d9397c7 100644 (file)
@@ -346,11 +346,11 @@ asmlinkage int sys32_ptrace(int request, int pid, int addr, int data)
                }
 
        case PTRACE_GETREGS:
-               ret = ptrace_getregs(child, (__u64 __user *) (__u64) data);
+               ret = ptrace_getregs(child, (__s64 __user *) (__u64) data);
                break;
 
        case PTRACE_SETREGS:
-               ret = ptrace_setregs(child, (__u64 __user *) (__u64) data);
+               ret = ptrace_setregs(child, (__s64 __user *) (__u64) data);
                break;
 
        case PTRACE_GETFPREGS:
index 118be24224f2a849a0fa16662daa674c66103b22..01993ec3368b5344caabcca54f8b1bc75e7641bc 100644 (file)
@@ -293,7 +293,7 @@ EXPORT(sysn32_call_table)
        PTR     sys_ni_syscall                  /* 6170, was get_kernel_syms */
        PTR     sys_ni_syscall                  /* was query_module */
        PTR     sys_quotactl
-       PTR     sys_nfsservctl
+       PTR     compat_sys_nfsservctl
        PTR     sys_ni_syscall                  /* res. for getpmsg */
        PTR     sys_ni_syscall                  /* 6175  for putpmsg */
        PTR     sys_ni_syscall                  /* res. for afs_syscall */
index a06a27d6cfcdef8050f57f48d31d933c00b9ddbc..7f6ddcb5d48532657a52b80461644dd05c467551 100644 (file)
@@ -269,7 +269,7 @@ static void __init bootmem_init(void)
 
 static void __init bootmem_init(void)
 {
-       unsigned long reserved_end;
+       unsigned long init_begin, reserved_end;
        unsigned long mapstart = ~0UL;
        unsigned long bootmap_size;
        int i;
@@ -342,6 +342,35 @@ static void __init bootmem_init(void)
         */
        bootmap_size = init_bootmem_node(NODE_DATA(0), mapstart,
                                         min_low_pfn, max_low_pfn);
+
+
+       init_begin = PFN_UP(__pa_symbol(&__init_begin));
+       for (i = 0; i < boot_mem_map.nr_map; i++) {
+               unsigned long start, end;
+
+               start = PFN_UP(boot_mem_map.map[i].addr);
+               end = PFN_DOWN(boot_mem_map.map[i].addr
+                               + boot_mem_map.map[i].size);
+
+               if (start <= init_begin)
+                       start = init_begin;
+               if (start >= end)
+                       continue;
+
+#ifndef CONFIG_HIGHMEM
+               if (end > max_low_pfn)
+                       end = max_low_pfn;
+
+               /*
+                * ... finally, is the area going away?
+                */
+               if (end <= start)
+                       continue;
+#endif
+
+               add_active_range(0, start, end);
+       }
+
        /*
         * Register fully available low RAM pages with the bootmem allocator.
         */
diff --git a/arch/mips/kernel/smp-up.c b/arch/mips/kernel/smp-up.c
new file mode 100644 (file)
index 0000000..ead6c30
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * 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) 2006, 07 by Ralf Baechle (ralf@linux-mips.org)
+ *
+ * Symmetric Uniprocessor (TM) Support
+ */
+#include <linux/kernel.h>
+#include <linux/sched.h>
+
+/*
+ * Send inter-processor interrupt
+ */
+void up_send_ipi_single(int cpu, unsigned int action)
+{
+       panic(KERN_ERR "%s called", __func__);
+}
+
+static inline void up_send_ipi_mask(cpumask_t mask, unsigned int action)
+{
+       panic(KERN_ERR "%s called", __func__);
+}
+
+/*
+ *  After we've done initial boot, this function is called to allow the
+ *  board code to clean up state, if needed
+ */
+void __cpuinit up_init_secondary(void)
+{
+}
+
+void __cpuinit up_smp_finish(void)
+{
+}
+
+/* Hook for after all CPUs are online */
+void up_cpus_done(void)
+{
+}
+
+/*
+ * Firmware CPU startup hook
+ */
+void __cpuinit up_boot_secondary(int cpu, struct task_struct *idle)
+{
+}
+
+void __init up_smp_setup(void)
+{
+}
+
+void __init up_prepare_cpus(unsigned int max_cpus)
+{
+}
+
+struct plat_smp_ops up_smp_ops = {
+       .send_ipi_single        = up_send_ipi_single,
+       .send_ipi_mask          = up_send_ipi_mask,
+       .init_secondary         = up_init_secondary,
+       .smp_finish             = up_smp_finish,
+       .cpus_done              = up_cpus_done,
+       .boot_secondary         = up_boot_secondary,
+       .smp_setup              = up_smp_setup,
+       .prepare_cpus           = up_prepare_cpus,
+};
index a8c1a698d5889f722b80419de6707296148528e5..9c92d42996cb48eade410f317d9e9e68821ffd45 100644 (file)
@@ -88,11 +88,19 @@ unsigned int smtc_status = 0;
 
 /* Boot command line configuration overrides */
 
+static int vpe0limit;
 static int ipibuffers = 0;
 static int nostlb = 0;
 static int asidmask = 0;
 unsigned long smtc_asid_mask = 0xff;
 
+static int __init vpe0tcs(char *str)
+{
+       get_option(&str, &vpe0limit);
+
+       return 1;
+}
+
 static int __init ipibufs(char *str)
 {
        get_option(&str, &ipibuffers);
@@ -125,6 +133,7 @@ static int __init asidmask_set(char *str)
        return 1;
 }
 
+__setup("vpe0tcs=", vpe0tcs);
 __setup("ipibufs=", ipibufs);
 __setup("nostlb", stlb_disable);
 __setup("asidmask=", asidmask_set);
@@ -340,7 +349,7 @@ static void smtc_tc_setup(int vpe, int tc, int cpu)
 
 void mipsmt_prepare_cpus(void)
 {
-       int i, vpe, tc, ntc, nvpe, tcpervpe, slop, cpu;
+       int i, vpe, tc, ntc, nvpe, tcpervpe[NR_CPUS], slop, cpu;
        unsigned long flags;
        unsigned long val;
        int nipi;
@@ -401,8 +410,39 @@ void mipsmt_prepare_cpus(void)
                ntc = NR_CPUS;
        if (tclimit > 0 && ntc > tclimit)
                ntc = tclimit;
-       tcpervpe = ntc / nvpe;
-       slop = ntc % nvpe;      /* Residual TCs, < NVPE */
+       slop = ntc % nvpe;
+       for (i = 0; i < nvpe; i++) {
+               tcpervpe[i] = ntc / nvpe;
+               if (slop) {
+                       if((slop - i) > 0) tcpervpe[i]++;
+               }
+       }
+       /* Handle command line override for VPE0 */
+       if (vpe0limit > ntc) vpe0limit = ntc;
+       if (vpe0limit > 0) {
+               int slopslop;
+               if (vpe0limit < tcpervpe[0]) {
+                   /* Reducing TC count - distribute to others */
+                   slop = tcpervpe[0] - vpe0limit;
+                   slopslop = slop % (nvpe - 1);
+                   tcpervpe[0] = vpe0limit;
+                   for (i = 1; i < nvpe; i++) {
+                       tcpervpe[i] += slop / (nvpe - 1);
+                       if(slopslop && ((slopslop - (i - 1) > 0)))
+                               tcpervpe[i]++;
+                   }
+               } else if (vpe0limit > tcpervpe[0]) {
+                   /* Increasing TC count - steal from others */
+                   slop = vpe0limit - tcpervpe[0];
+                   slopslop = slop % (nvpe - 1);
+                   tcpervpe[0] = vpe0limit;
+                   for (i = 1; i < nvpe; i++) {
+                       tcpervpe[i] -= slop / (nvpe - 1);
+                       if(slopslop && ((slopslop - (i - 1) > 0)))
+                               tcpervpe[i]--;
+                   }
+               }
+       }
 
        /* Set up shared TLB */
        smtc_configure_tlb();
@@ -416,7 +456,7 @@ void mipsmt_prepare_cpus(void)
                if (vpe != 0)
                        printk(", ");
                printk("VPE %d: TC", vpe);
-               for (i = 0; i < tcpervpe; i++) {
+               for (i = 0; i < tcpervpe[vpe]; i++) {
                        /*
                         * TC 0 is bound to VPE 0 at reset,
                         * and is presumably executing this
@@ -429,15 +469,6 @@ void mipsmt_prepare_cpus(void)
                        printk(" %d", tc);
                        tc++;
                }
-               if (slop) {
-                       if (tc != 0) {
-                               smtc_tc_setup(vpe, tc, cpu);
-                               cpu++;
-                       }
-                       printk(" %d", tc);
-                       tc++;
-                       slop--;
-               }
                if (vpe != 0) {
                        /*
                         * Clear any stale software interrupts from VPE's Cause
index b95fe93dd646dad70290be9694bba0d7e37715c6..af1bdc897488acf4d71f65bc69579f58b03183ce 100644 (file)
@@ -73,7 +73,14 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
 
        task_size = STACK_TOP;
 
+       if (len > task_size)
+               return -ENOMEM;
+
        if (flags & MAP_FIXED) {
+               /* Even MAP_FIXED mappings must reside within task_size.  */
+               if (task_size - len < addr)
+                       return -EINVAL;
+
                /*
                 * We do not accept a shared mapping if it would violate
                 * cache aliasing constraints.
@@ -83,8 +90,6 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
                return addr;
        }
 
-       if (len > task_size)
-               return -ENOMEM;
        do_color_align = 0;
        if (filp || (flags & MAP_SHARED))
                do_color_align = 1;
index 6c6849a8f136988baed2d30a2f5e5eac5fd0bbc1..52075426c37338a46f7ab3f1990c41030d23ed45 100644 (file)
@@ -3,42 +3,31 @@
  * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
  * Copyright (c) 2003, 2004  Maciej W. Rozycki
  *
- * Common time service routines for MIPS machines. See
- * Documentation/mips/time.README.
+ * Common time service routines for MIPS machines.
  *
  * 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.
  */
+#include <linux/bug.h>
 #include <linux/clockchips.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/param.h>
-#include <linux/profile.h>
 #include <linux/time.h>
 #include <linux/timex.h>
 #include <linux/smp.h>
-#include <linux/kernel_stat.h>
 #include <linux/spinlock.h>
-#include <linux/interrupt.h>
 #include <linux/module.h>
-#include <linux/kallsyms.h>
 
-#include <asm/bootinfo.h>
-#include <asm/cache.h>
-#include <asm/compiler.h>
-#include <asm/cpu.h>
 #include <asm/cpu-features.h>
 #include <asm/div64.h>
-#include <asm/sections.h>
 #include <asm/smtc_ipi.h>
 #include <asm/time.h>
 
-#include <irq.h>
-
 /*
  * forward reference
  */
@@ -61,40 +50,8 @@ int update_persistent_clock(struct timespec now)
        return rtc_mips_set_mmss(now.tv_sec);
 }
 
-/*
- * Null high precision timer functions for systems lacking one.
- */
-static cycle_t null_hpt_read(void)
-{
-       return 0;
-}
-
-/*
- * High precision timer functions for a R4k-compatible timer.
- */
-static cycle_t c0_hpt_read(void)
-{
-       return read_c0_count();
-}
-
 int (*mips_timer_state)(void);
 
-/*
- * local_timer_interrupt() does profiling and process accounting
- * on a per-CPU basis.
- *
- * In UP mode, it is invoked from the (global) timer_interrupt.
- *
- * In SMP mode, it might invoked by per-CPU timer interrupt, or
- * a broadcasted inter-processor interrupt which itself is triggered
- * by the global timer interrupt.
- */
-void local_timer_interrupt(int irq, void *dev_id)
-{
-       profile_tick(CPU_PROFILING);
-       update_process_times(user_mode(get_irq_regs()));
-}
-
 int null_perf_irq(void)
 {
        return 0;
@@ -115,62 +72,10 @@ EXPORT_SYMBOL(perf_irq);
  *         (only needed if you intended to use cpu counter as timer interrupt
  *          source)
  * 2) calculate a couple of cached variables for later usage
- * 3) plat_timer_setup() -
- *     a) (optional) over-write any choices made above by time_init().
- *     b) machine specific code should setup the timer irqaction.
- *     c) enable the timer interrupt
  */
 
 unsigned int mips_hpt_frequency;
 
-static unsigned int __init calibrate_hpt(void)
-{
-       cycle_t frequency, hpt_start, hpt_end, hpt_count, hz;
-
-       const int loops = HZ / 10;
-       int log_2_loops = 0;
-       int i;
-
-       /*
-        * We want to calibrate for 0.1s, but to avoid a 64-bit
-        * division we round the number of loops up to the nearest
-        * power of 2.
-        */
-       while (loops > 1 << log_2_loops)
-               log_2_loops++;
-       i = 1 << log_2_loops;
-
-       /*
-        * Wait for a rising edge of the timer interrupt.
-        */
-       while (mips_timer_state());
-       while (!mips_timer_state());
-
-       /*
-        * Now see how many high precision timer ticks happen
-        * during the calculated number of periods between timer
-        * interrupts.
-        */
-       hpt_start = clocksource_mips.read();
-       do {
-               while (mips_timer_state());
-               while (!mips_timer_state());
-       } while (--i);
-       hpt_end = clocksource_mips.read();
-
-       hpt_count = (hpt_end - hpt_start) & clocksource_mips.mask;
-       hz = HZ;
-       frequency = hpt_count * hz;
-
-       return frequency >> log_2_loops;
-}
-
-struct clocksource clocksource_mips = {
-       .name           = "MIPS",
-       .mask           = CLOCKSOURCE_MASK(32),
-       .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
-};
-
 void __init clocksource_set_clock(struct clocksource *cs, unsigned int clock)
 {
        u64 temp;
@@ -204,55 +109,60 @@ void __cpuinit clockevent_set_clock(struct clock_event_device *cd,
        cd->mult = (u32) temp;
 }
 
-static void __init init_mips_clocksource(void)
+void __init __weak plat_time_init(void)
 {
-       if (!mips_hpt_frequency || clocksource_mips.read == null_hpt_read)
-               return;
-
-       /* Calclate a somewhat reasonable rating value */
-       clocksource_mips.rating = 200 + mips_hpt_frequency / 10000000;
-
-       clocksource_set_clock(&clocksource_mips, mips_hpt_frequency);
-
-       clocksource_register(&clocksource_mips);
 }
 
-void __init __weak plat_time_init(void)
+/*
+ * This function exists in order to cause an error due to a duplicate
+ * definition if platform code should have its own implementation.  The hook
+ * to use instead is plat_time_init.  plat_time_init does not receive the
+ * irqaction pointer argument anymore.  This is because any function which
+ * initializes an interrupt timer now takes care of its own request_irq rsp.
+ * setup_irq calls and each clock_event_device should use its own
+ * struct irqrequest.
+ */
+void __init plat_timer_setup(void)
 {
+       BUG();
 }
 
-void __init __weak plat_timer_setup(struct irqaction *irq)
+static __init int cpu_has_mfc0_count_bug(void)
 {
+       switch (current_cpu_type()) {
+       case CPU_R4000PC:
+       case CPU_R4000SC:
+       case CPU_R4000MC:
+               /*
+                * V3.0 is documented as suffering from the mfc0 from count bug.
+                * Afaik this is the last version of the R4000.  Later versions
+                * were marketed as R4400.
+                */
+               return 1;
+
+       case CPU_R4400PC:
+       case CPU_R4400SC:
+       case CPU_R4400MC:
+               /*
+                * The published errata for the R4400 upto 3.0 say the CPU
+                * has the mfc0 from count bug.
+                */
+               if ((current_cpu_data.processor_id & 0xff) <= 0x30)
+                       return 1;
+
+               /*
+                * I don't have erratas for newer R4400 so be paranoid.
+                */
+               return 1;
+       }
+
+       return 0;
 }
 
 void __init time_init(void)
 {
        plat_time_init();
 
-       /* Choose appropriate high precision timer routines.  */
-       if (!cpu_has_counter && !clocksource_mips.read)
-               /* No high precision timer -- sorry.  */
-               clocksource_mips.read = null_hpt_read;
-       else if (!mips_hpt_frequency && !mips_timer_state) {
-               /* A high precision timer of unknown frequency.  */
-               if (!clocksource_mips.read)
-                       /* No external high precision timer -- use R4k.  */
-                       clocksource_mips.read = c0_hpt_read;
-       } else {
-               /* We know counter frequency.  Or we can get it.  */
-               if (!clocksource_mips.read) {
-                       /* No external high precision timer -- use R4k.  */
-                       clocksource_mips.read = c0_hpt_read;
-               }
-               if (!mips_hpt_frequency)
-                       mips_hpt_frequency = calibrate_hpt();
-
-               /* Report the high precision timer rate for a reference.  */
-               printk("Using %u.%03u MHz high precision timer.\n",
-                      ((mips_hpt_frequency + 500) / 1000) / 1000,
-                      ((mips_hpt_frequency + 500) / 1000) % 1000);
-       }
-
-       init_mips_clocksource();
-       mips_clockevent_init();
+       if (mips_clockevent_init() || !cpu_has_mfc0_count_bug())
+               init_mips_clocksource();
 }
index fa500787152d2cfbc40ffc38075f7ee7545ea103..23e73d0650a3bfd599a3c2dbab43dac23efa8004 100644 (file)
@@ -1100,59 +1100,6 @@ void *set_except_vector(int n, void *addr)
        return (void *)old_handler;
 }
 
-#ifdef CONFIG_CPU_MIPSR2_SRS
-/*
- * MIPSR2 shadow register set allocation
- * FIXME: SMP...
- */
-
-static struct shadow_registers {
-       /*
-        * Number of shadow register sets supported
-        */
-       unsigned long sr_supported;
-       /*
-        * Bitmap of allocated shadow registers
-        */
-       unsigned long sr_allocated;
-} shadow_registers;
-
-static void mips_srs_init(void)
-{
-       shadow_registers.sr_supported = ((read_c0_srsctl() >> 26) & 0x0f) + 1;
-       printk(KERN_INFO "%ld MIPSR2 register sets available\n",
-              shadow_registers.sr_supported);
-       shadow_registers.sr_allocated = 1;      /* Set 0 used by kernel */
-}
-
-int mips_srs_max(void)
-{
-       return shadow_registers.sr_supported;
-}
-
-int mips_srs_alloc(void)
-{
-       struct shadow_registers *sr = &shadow_registers;
-       int set;
-
-again:
-       set = find_first_zero_bit(&sr->sr_allocated, sr->sr_supported);
-       if (set >= sr->sr_supported)
-               return -1;
-
-       if (test_and_set_bit(set, &sr->sr_allocated))
-               goto again;
-
-       return set;
-}
-
-void mips_srs_free(int set)
-{
-       struct shadow_registers *sr = &shadow_registers;
-
-       clear_bit(set, &sr->sr_allocated);
-}
-
 static asmlinkage void do_default_vi(void)
 {
        show_regs(get_irq_regs());
@@ -1163,6 +1110,7 @@ static void *set_vi_srs_handler(int n, vi_handler_t addr, int srs)
 {
        unsigned long handler;
        unsigned long old_handler = vi_handlers[n];
+       int srssets = current_cpu_data.srsets;
        u32 *w;
        unsigned char *b;
 
@@ -1178,7 +1126,7 @@ static void *set_vi_srs_handler(int n, vi_handler_t addr, int srs)
 
        b = (unsigned char *)(ebase + 0x200 + n*VECTORSPACING);
 
-       if (srs >= mips_srs_max())
+       if (srs >= srssets)
                panic("Shadow register set %d not supported", srs);
 
        if (cpu_has_veic) {
@@ -1186,7 +1134,7 @@ static void *set_vi_srs_handler(int n, vi_handler_t addr, int srs)
                        board_bind_eic_interrupt(n, srs);
        } else if (cpu_has_vint) {
                /* SRSMap is only defined if shadow sets are implemented */
-               if (mips_srs_max() > 1)
+               if (srssets > 1)
                        change_c0_srsmap(0xf << n*4, srs << n*4);
        }
 
@@ -1253,14 +1201,6 @@ void *set_vi_handler(int n, vi_handler_t addr)
        return set_vi_srs_handler(n, addr, 0);
 }
 
-#else
-
-static inline void mips_srs_init(void)
-{
-}
-
-#endif /* CONFIG_CPU_MIPSR2_SRS */
-
 /*
  * This is used by native signal handling
  */
@@ -1503,8 +1443,6 @@ void __init trap_init(void)
        else
                ebase = CAC_BASE;
 
-       mips_srs_init();
-
        per_cpu_trap_init();
 
        /*
index 2781cff1485ebc62dc934d51cf043084b7a67495..5fc2398bdb76673ac8ebf92cbd21db0a5d34b7b9 100644 (file)
@@ -63,21 +63,23 @@ SECTIONS
 
        /* writeable */
        .data : {       /* Data */
-         . = . + DATAOFFSET;           /* for CONFIG_MAPPED_KERNEL */
-         /*
-          * This ALIGN is needed as a workaround for a bug a gcc bug upto 4.1 which
-          * limits the maximum alignment to at most 32kB and results in the following
-          * warning:
-          *
-          *  CC      arch/mips/kernel/init_task.o
-          * arch/mips/kernel/init_task.c:30: warning: alignment of ‘init_thread_union’
-          * is greater than maximum object file alignment.  Using 32768
-          */
-         . = ALIGN(_PAGE_SIZE);
-         *(.data.init_task)
-
-         DATA_DATA
-         CONSTRUCTORS
+               . = . + DATAOFFSET;             /* for CONFIG_MAPPED_KERNEL */
+               /*
+                * This ALIGN is needed as a workaround for a bug a
+                * gcc bug upto 4.1 which limits the maximum alignment
+                * to at most 32kB and results in the following
+                * warning:
+                *
+                *  CC      arch/mips/kernel/init_task.o
+                * arch/mips/kernel/init_task.c:30: warning: alignment
+                * of ‘init_thread_union’ is greater than maximum
+                * object file alignment.  Using 32768
+                */
+               . = ALIGN(_PAGE_SIZE);
+               *(.data.init_task)
+
+               DATA_DATA
+               CONSTRUCTORS
        }
        _gp = . + 0x8000;
        .lit8 : {
index df8cbe4c7c0d43c22f89a3f19ff797a6296ebfc0..c06eb812a95e1dc3d096926ed8ffeac58d900c5e 100644 (file)
@@ -470,7 +470,7 @@ static int apply_r_mips_lo16(struct module *me, uint32_t *location,
                         */
                        if (v != l->value) {
                                printk(KERN_DEBUG "VPE loader: "
-                                      "apply_r_mips_lo16/hi16:         "
+                                      "apply_r_mips_lo16/hi16: \t"
                                       "inconsistent value information\n");
                                return -ENOEXEC;
                        }
@@ -629,7 +629,7 @@ static void simplify_symbols(Elf_Shdr * sechdrs,
                        break;
 
                case SHN_MIPS_SCOMMON:
-                       printk(KERN_DEBUG "simplify_symbols: ignoring SHN_MIPS_SCOMMON"
+                       printk(KERN_DEBUG "simplify_symbols: ignoring SHN_MIPS_SCOMMON "
                               "symbol <%s> st_shndx %d\n", strtab + sym[i].st_name,
                               sym[i].st_shndx);
                        // .sbss section
@@ -942,8 +942,8 @@ static int vpe_elfload(struct vpe * v)
                        if (phdr->p_type != PT_LOAD)
                                continue;
 
-                       memcpy((void *)phdr->p_vaddr, (char *)hdr + phdr->p_offset, phdr->p_filesz);
-                       memset((void *)phdr->p_vaddr + phdr->p_filesz, 0, phdr->p_memsz - phdr->p_filesz);
+                       memcpy((void *)phdr->p_paddr, (char *)hdr + phdr->p_offset, phdr->p_filesz);
+                       memset((void *)phdr->p_paddr + phdr->p_filesz, 0, phdr->p_memsz - phdr->p_filesz);
                        phdr++;
                }
 
@@ -1003,6 +1003,7 @@ static void cleanup_tc(struct tc *tc)
        write_tc_c0_tcstatus(tmp);
 
        write_tc_c0_tchalt(TCHALT_H);
+       mips_ihb();
 
        /* bind it to anything other than VPE1 */
 //     write_tc_c0_tcbind(read_tc_c0_tcbind() & ~TCBIND_CURVPE); // | TCBIND_CURVPE
@@ -1235,9 +1236,12 @@ int vpe_free(vpe_handle vpe)
        settc(t->index);
        write_vpe_c0_vpeconf0(read_vpe_c0_vpeconf0() & ~VPECONF0_VPA);
 
-       /* mark the TC unallocated and halt'ed */
-       write_tc_c0_tcstatus(read_tc_c0_tcstatus() & ~TCSTATUS_A);
+       /* halt the TC */
        write_tc_c0_tchalt(TCHALT_H);
+       mips_ihb();
+
+       /* mark the TC unallocated */
+       write_tc_c0_tcstatus(read_tc_c0_tcstatus() & ~TCSTATUS_A);
 
        v->state = VPE_STATE_UNUSED;
 
@@ -1533,14 +1537,16 @@ static int __init vpe_module_init(void)
                                t->pvpe = get_vpe(0);   /* set the parent vpe */
                        }
 
+                       /* halt the TC */
+                       write_tc_c0_tchalt(TCHALT_H);
+                       mips_ihb();
+
                        tmp = read_tc_c0_tcstatus();
 
                        /* mark not activated and not dynamically allocatable */
                        tmp &= ~(TCSTATUS_A | TCSTATUS_DA);
                        tmp |= TCSTATUS_IXMT;   /* interrupt exempt */
                        write_tc_c0_tcstatus(tmp);
-
-                       write_tc_c0_tchalt(TCHALT_H);
                }
        }
 
index ba9692be3564c32b48eaacb2199c54376d0b0a95..cfeab669782f04ec30e472f2b4b39476980bedbf 100644 (file)
  * Lasat boards.
  */
 #include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/sched.h>
-#include <linux/slab.h>
 #include <linux/interrupt.h>
-#include <linux/kernel_stat.h>
+#include <linux/irq.h>
 
 #include <asm/bootinfo.h>
 #include <asm/irq_cpu.h>
 #include <asm/lasat/lasatint.h>
-#include <asm/time.h>
-#include <asm/gdb-stub.h>
+
+#include <irq.h>
 
 static volatile int *lasat_int_status;
 static volatile int *lasat_int_mask;
@@ -97,12 +94,18 @@ asmlinkage void plat_irq_dispatch(void)
 
        /* if int_status == 0, then the interrupt has already been cleared */
        if (int_status) {
-               irq = LASATINT_BASE + ls1bit32(int_status);
+               irq = LASAT_IRQ_BASE + ls1bit32(int_status);
 
                do_IRQ(irq);
        }
 }
 
+static struct irqaction cascade = {
+       .handler        = no_action,
+       .mask           = CPU_MASK_NONE,
+       .name           = "cascade",
+};
+
 void __init arch_init_irq(void)
 {
        int i;
@@ -127,6 +130,9 @@ void __init arch_init_irq(void)
        }
 
        mips_cpu_irq_init();
-       for (i = LASATINT_BASE; i <= LASATINT_END; i++)
+
+       for (i = LASAT_IRQ_BASE; i <= LASAT_IRQ_END; i++)
                set_irq_chip_and_handler(i, &lasat_irq_type, handle_level_irq);
+
+       setup_irq(LASAT_CASCADE_IRQ, &cascade);
 }
index 54827d0174bfe208cd2552482450bb60a975998f..e072da4ff3b3c6398e5f2cbb53ed8c7d402572e8 100644 (file)
@@ -117,14 +117,11 @@ static struct notifier_block lasat_panic_block[] =
        }
 };
 
-void plat_time_init(void)
+void __init plat_time_init(void)
 {
        mips_hpt_frequency = lasat_board_info.li_cpu_hz / 2;
-}
 
-void __init plat_timer_setup(struct irqaction *irq)
-{
-       change_c0_status(ST0_IM, IE_IRQ0 | IE_IRQ5);
+       change_c0_status(ST0_IM, IE_IRQ0);
 }
 
 void __init plat_mem_setup(void)
index 946aee331788a12734bf87bba2b709c23d166a56..cb1b6822711ab90c04591d84e8dc2570f16ba8ec 100644 (file)
@@ -108,6 +108,7 @@ int ieee754si_xcpt(int r, const char *op, ...)
        ax.rv.si = r;
        va_start(ax.ap, op);
        ieee754_xcpt(&ax);
+       va_end(ax.ap);
        return ax.rv.si;
 }
 
@@ -122,5 +123,6 @@ s64 ieee754di_xcpt(s64 r, const char *op, ...)
        ax.rv.di = r;
        va_start(ax.ap, op);
        ieee754_xcpt(&ax);
+       va_end(ax.ap);
        return ax.rv.di;
 }
index 3e214aac4b12f51bd103aca37d0a545395434849..6d2d89f324721115a6577d8726f1f38404d08c9d 100644 (file)
@@ -57,6 +57,7 @@ ieee754dp ieee754dp_xcpt(ieee754dp r, const char *op, ...)
        ax.rv.dp = r;
        va_start(ax.ap, op);
        ieee754_xcpt(&ax);
+       va_end(ax.ap);
        return ax.rv.dp;
 }
 
@@ -83,6 +84,7 @@ ieee754dp ieee754dp_nanxcpt(ieee754dp r, const char *op, ...)
        ax.rv.dp = r;
        va_start(ax.ap, op);
        ieee754_xcpt(&ax);
+       va_end(ax.ap);
        return ax.rv.dp;
 }
 
index adda851cd04f5e19f7b84ad26b9244cc0791622d..463534045ab60ac68243b1bf5a2b104b77ccad83 100644 (file)
@@ -58,6 +58,7 @@ ieee754sp ieee754sp_xcpt(ieee754sp r, const char *op, ...)
        ax.rv.sp = r;
        va_start(ax.ap, op);
        ieee754_xcpt(&ax);
+       va_end(ax.ap);
        return ax.rv.sp;
 }
 
@@ -84,6 +85,7 @@ ieee754sp ieee754sp_nanxcpt(ieee754sp r, const char *op, ...)
        ax.rv.sp = r;
        va_start(ax.ap, op);
        ieee754_xcpt(&ax);
+       va_end(ax.ap);
        return ax.rv.sp;
 }
 
index 9d6243a8c15a25e430141833eadc4614005733f7..f02ce6308e51d839dd9e366a7cbdea60cc4e7625 100644 (file)
@@ -127,26 +127,6 @@ unsigned long read_persistent_clock(void)
        return mc146818_get_cmos_time();
 }
 
-void __init plat_time_init(void)
-{
-       unsigned int est_freq;
-
-        /* Set Data mode - binary. */
-        CMOS_WRITE(CMOS_READ(RTC_CONTROL) | RTC_DM_BINARY, RTC_CONTROL);
-
-       est_freq = estimate_cpu_frequency();
-
-       printk("CPU frequency %d.%02d MHz\n", est_freq/1000000,
-              (est_freq%1000000)*100/1000000);
-
-        cpu_khz = est_freq / 1000;
-
-       mips_scroll_message();
-#ifdef CONFIG_I8253            /* Only Malta has a PIT */
-       setup_pit_timer();
-#endif
-}
-
 void __init plat_perf_setup(void)
 {
        cp0_perfcount_irq = -1;
@@ -166,14 +146,13 @@ void __init plat_perf_setup(void)
        }
 }
 
-void __init plat_timer_setup(struct irqaction *irq)
+unsigned int __init get_c0_compare_int(void)
 {
 #ifdef MSC01E_INT_BASE
        if (cpu_has_veic) {
                set_vi_handler(MSC01E_INT_CPUCTR, mips_timer_dispatch);
                mips_cpu_timer_irq = MSC01E_INT_BASE + MSC01E_INT_CPUCTR;
-       }
-       else
+       } else
 #endif
        {
                if (cpu_has_vint)
@@ -181,13 +160,26 @@ void __init plat_timer_setup(struct irqaction *irq)
                mips_cpu_timer_irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq;
        }
 
-#ifdef CONFIG_MIPS_MT_SMTC
-       setup_irq_smtc(mips_cpu_timer_irq, irq, 0x100 << cp0_compare_irq);
-#else
-       setup_irq(mips_cpu_timer_irq, irq);
-#endif /* CONFIG_MIPS_MT_SMTC */
-#ifdef CONFIG_SMP
-       set_irq_handler(mips_cpu_timer_irq, handle_percpu_irq);
+       return mips_cpu_timer_irq;
+}
+
+void __init plat_time_init(void)
+{
+       unsigned int est_freq;
+
+        /* Set Data mode - binary. */
+        CMOS_WRITE(CMOS_READ(RTC_CONTROL) | RTC_DM_BINARY, RTC_CONTROL);
+
+       est_freq = estimate_cpu_frequency();
+
+       printk("CPU frequency %d.%02d MHz\n", est_freq/1000000,
+              (est_freq%1000000)*100/1000000);
+
+        cpu_khz = est_freq / 1000;
+
+       mips_scroll_message();
+#ifdef CONFIG_I8253            /* Only Malta has a PIT */
+       setup_pit_timer();
 #endif
 
        plat_perf_setup();
index e7fa0d1078a383685e16abe15d7876a441f7bddf..e39bbe989da34b85a0ec7dbe703efdbef4e5270a 100644 (file)
@@ -75,25 +75,6 @@ static unsigned int __init estimate_cpu_frequency(void)
        return count;
 }
 
-void __init plat_time_init(void)
-{
-       unsigned int est_freq, flags;
-
-       local_irq_save(flags);
-
-       /* Set Data mode - binary. */
-       CMOS_WRITE(CMOS_READ(RTC_CONTROL) | RTC_DM_BINARY, RTC_CONTROL);
-
-       est_freq = estimate_cpu_frequency();
-
-       printk(KERN_INFO "CPU frequency %d.%02d MHz\n", est_freq / 1000000,
-              (est_freq % 1000000) * 100 / 1000000);
-
-       cpu_khz = est_freq / 1000;
-
-       local_irq_restore(flags);
-}
-
 static int mips_cpu_timer_irq;
 
 static void mips_timer_dispatch(void)
@@ -102,26 +83,33 @@ static void mips_timer_dispatch(void)
 }
 
 
-void __init plat_timer_setup(struct irqaction *irq)
+unsigned __init get_c0_compare_int(void)
 {
+#ifdef MSC01E_INT_BASE
        if (cpu_has_veic) {
                set_vi_handler(MSC01E_INT_CPUCTR, mips_timer_dispatch);
                mips_cpu_timer_irq = MSC01E_INT_BASE + MSC01E_INT_CPUCTR;
        } else {
+#endif
                if (cpu_has_vint)
                        set_vi_handler(cp0_compare_irq, mips_timer_dispatch);
                mips_cpu_timer_irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq;
        }
 
-       /* we are using the cpu counter for timer interrupts */
-       setup_irq(mips_cpu_timer_irq, irq);
+       return mips_cpu_timer_irq;
+}
 
-#ifdef CONFIG_SMP
-       /* irq_desc(riptor) is a global resource, when the interrupt overlaps
-          on seperate cpu's the first one tries to handle the second interrupt.
-          The effect is that the int remains disabled on the second cpu.
-          Mark the interrupt with IRQ_PER_CPU to avoid any confusion */
-       irq_desc[mips_cpu_timer_irq].flags |= IRQ_PER_CPU;
-       set_irq_handler(mips_cpu_timer_irq, handle_percpu_irq);
-#endif
+void __init plat_time_init(void)
+{
+       unsigned int est_freq;
+
+       /* Set Data mode - binary. */
+       CMOS_WRITE(CMOS_READ(RTC_CONTROL) | RTC_DM_BINARY, RTC_CONTROL);
+
+       est_freq = estimate_cpu_frequency();
+
+       printk(KERN_INFO "CPU frequency %d.%02d MHz\n", est_freq / 1000000,
+              (est_freq % 1000000) * 100 / 1000000);
+
+       cpu_khz = est_freq / 1000;
 }
index c55312f6fd3a9afd4250f0d63c754ff79708f847..562abb77d1d543864a80b2a09318aadf1c464733 100644 (file)
@@ -7,7 +7,7 @@
  * Tx39XX R4k style caches added. HK
  * Copyright (C) 1998, 1999, 2000 Harald Koerfgen
  * Copyright (C) 1998 Gleb Raiko & Vladimir Roganov
- * Copyright (C) 2001, 2004  Maciej W. Rozycki
+ * Copyright (C) 2001, 2004, 2007  Maciej W. Rozycki
  */
 #include <linux/init.h>
 #include <linux/kernel.h>
@@ -26,8 +26,6 @@
 static unsigned long icache_size, dcache_size;         /* Size in bytes */
 static unsigned long icache_lsize, dcache_lsize;       /* Size in bytes */
 
-#undef DEBUG_CACHE
-
 unsigned long __init r3k_cache_size(unsigned long ca_flags)
 {
        unsigned long flags, status, dummy, size;
@@ -217,26 +215,6 @@ static void r3k_flush_dcache_range(unsigned long start, unsigned long end)
        write_c0_status(flags);
 }
 
-static inline unsigned long get_phys_page(unsigned long addr,
-                                         struct mm_struct *mm)
-{
-       pgd_t *pgd;
-       pud_t *pud;
-       pmd_t *pmd;
-       pte_t *pte;
-       unsigned long physpage;
-
-       pgd = pgd_offset(mm, addr);
-       pud = pud_offset(pgd, addr);
-       pmd = pmd_offset(pud, addr);
-       pte = pte_offset(pmd, addr);
-
-       if ((physpage = pte_val(*pte)) & _PAGE_VALID)
-               return KSEG0ADDR(physpage & PAGE_MASK);
-
-       return 0;
-}
-
 static inline void r3k_flush_cache_all(void)
 {
 }
@@ -252,12 +230,40 @@ static void r3k_flush_cache_mm(struct mm_struct *mm)
 }
 
 static void r3k_flush_cache_range(struct vm_area_struct *vma,
-       unsigned long start, unsigned long end)
+                                 unsigned long start, unsigned long end)
 {
 }
 
-static void r3k_flush_cache_page(struct vm_area_struct *vma, unsigned long page, unsigned long pfn)
+static void r3k_flush_cache_page(struct vm_area_struct *vma,
+                                unsigned long addr, unsigned long pfn)
 {
+       unsigned long kaddr = KSEG0ADDR(pfn << PAGE_SHIFT);
+       int exec = vma->vm_flags & VM_EXEC;
+       struct mm_struct *mm = vma->vm_mm;
+       pgd_t *pgdp;
+       pud_t *pudp;
+       pmd_t *pmdp;
+       pte_t *ptep;
+
+       pr_debug("cpage[%08lx,%08lx]\n",
+                cpu_context(smp_processor_id(), mm), addr);
+
+       /* No ASID => no such page in the cache.  */
+       if (cpu_context(smp_processor_id(), mm) == 0)
+               return;
+
+       pgdp = pgd_offset(mm, addr);
+       pudp = pud_offset(pgdp, addr);
+       pmdp = pmd_offset(pudp, addr);
+       ptep = pte_offset(pmdp, addr);
+
+       /* Invalid => no such page in the cache.  */
+       if (!(pte_val(*ptep) & _PAGE_PRESENT))
+               return;
+
+       r3k_flush_dcache_range(kaddr, kaddr + PAGE_SIZE);
+       if (exec)
+               r3k_flush_icache_range(kaddr, kaddr + PAGE_SIZE);
 }
 
 static void local_r3k_flush_data_cache_page(void *addr)
@@ -272,9 +278,7 @@ static void r3k_flush_cache_sigtramp(unsigned long addr)
 {
        unsigned long flags;
 
-#ifdef DEBUG_CACHE
-       printk("csigtramp[%08lx]", addr);
-#endif
+       pr_debug("csigtramp[%08lx]\n", addr);
 
        flags = read_c0_status();
 
index d7088331fb0fa53f15a3849469ba17e9f46ee486..9355f1c9325f1b7056c1be4f1af2afdf379ea891 100644 (file)
@@ -7,6 +7,7 @@
  * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Ralf Baechle (ralf@gnu.org)
  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  */
+#include <linux/hardirq.h>
 #include <linux/init.h>
 #include <linux/highmem.h>
 #include <linux/kernel.h>
@@ -345,11 +346,26 @@ static void r4k___flush_cache_all(void)
        r4k_on_each_cpu(local_r4k___flush_cache_all, NULL, 1, 1);
 }
 
+static inline int has_valid_asid(const struct mm_struct *mm)
+{
+#if defined(CONFIG_MIPS_MT_SMP) || defined(CONFIG_MIPS_MT_SMTC)
+       int i;
+
+       for_each_online_cpu(i)
+               if (cpu_context(i, mm))
+                       return 1;
+
+       return 0;
+#else
+       return cpu_context(smp_processor_id(), mm);
+#endif
+}
+
 static inline void local_r4k_flush_cache_range(void * args)
 {
        struct vm_area_struct *vma = args;
 
-       if (!(cpu_context(smp_processor_id(), vma->vm_mm)))
+       if (!(has_valid_asid(vma->vm_mm)))
                return;
 
        r4k_blast_dcache();
@@ -368,7 +384,7 @@ static inline void local_r4k_flush_cache_mm(void * args)
 {
        struct mm_struct *mm = args;
 
-       if (!cpu_context(smp_processor_id(), mm))
+       if (!has_valid_asid(mm))
                return;
 
        /*
@@ -420,7 +436,7 @@ static inline void local_r4k_flush_cache_page(void *args)
         * If ownes no valid ASID yet, cannot possibly have gotten
         * this page into the cache.
         */
-       if (cpu_context(smp_processor_id(), mm) == 0)
+       if (!has_valid_asid(mm))
                return;
 
        addr &= PAGE_MASK;
@@ -492,7 +508,11 @@ static inline void local_r4k_flush_data_cache_page(void * addr)
 
 static void r4k_flush_data_cache_page(unsigned long addr)
 {
-       r4k_on_each_cpu(local_r4k_flush_data_cache_page, (void *) addr, 1, 1);
+       if (in_atomic())
+               local_r4k_flush_data_cache_page((void *)addr);
+       else
+               r4k_on_each_cpu(local_r4k_flush_data_cache_page, (void *) addr,
+                               1, 1);
 }
 
 struct flush_icache_range_args {
index e7f539e3284b91c232b44bbbaa1142d334260b1d..1bd1f18ac23c5d0fe0120555051b98bb5cb7169c 100644 (file)
@@ -154,7 +154,7 @@ static void check_bus_watcher(void)
        if (status & ~(1UL << 31)) {
                l2_err = csr_in32(IOADDR(A_BUS_L2_ERRORS));
 #ifdef DUMP_L2_ECC_TAG_ON_ERROR
-               l2_tag = in64(IO_SPACE_BASE | A_L2_ECC_TAG);
+               l2_tag = in64(IOADDR(A_L2_ECC_TAG));
 #endif
                memio_err = csr_in32(IOADDR(A_BUS_MEM_IO_ERRORS));
                printk("Bus watcher error counters: %08x %08x\n", l2_err, memio_err);
@@ -183,9 +183,9 @@ asmlinkage void sb1_cache_error(void)
 #ifdef CONFIG_SIBYTE_BW_TRACE
        /* Freeze the trace buffer now */
 #if defined(CONFIG_SIBYTE_BCM1x55) || defined(CONFIG_SIBYTE_BCM1x80)
-       csr_out32(M_BCM1480_SCD_TRACE_CFG_FREEZE, IO_SPACE_BASE | A_SCD_TRACE_CFG);
+       csr_out32(M_BCM1480_SCD_TRACE_CFG_FREEZE, IOADDR(A_SCD_TRACE_CFG));
 #else
-       csr_out32(M_SCD_TRACE_CFG_FREEZE, IO_SPACE_BASE | A_SCD_TRACE_CFG);
+       csr_out32(M_SCD_TRACE_CFG_FREEZE, IOADDR(A_SCD_TRACE_CFG));
 #endif
        printk("Trace buffer frozen\n");
 #endif
index b1b40527658b12185ba7b2a0e935ae0920affb33..ae76795685cc2ee2789596dfbdfeba6c40b47808 100644 (file)
@@ -12,8 +12,8 @@
 #include <linux/dma-mapping.h>
 #include <linux/mm.h>
 #include <linux/module.h>
-#include <linux/string.h>
 #include <linux/scatterlist.h>
+#include <linux/string.h>
 
 #include <asm/cache.h>
 #include <asm/io.h>
@@ -40,16 +40,38 @@ static inline int cpu_is_noncoherent_r10000(struct device *dev)
               current_cpu_type() == CPU_R12000);
 }
 
+static gfp_t massage_gfp_flags(const struct device *dev, gfp_t gfp)
+{
+       /* ignore region specifiers */
+       gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM);
+
+#ifdef CONFIG_ZONE_DMA32
+       if (dev == NULL)
+               gfp |= __GFP_DMA;
+       else if (dev->coherent_dma_mask < DMA_BIT_MASK(24))
+               gfp |= __GFP_DMA;
+       else
+#endif
+#ifdef CONFIG_ZONE_DMA32
+            if (dev->coherent_dma_mask < DMA_BIT_MASK(32))
+               gfp |= __GFP_DMA32;
+       else
+#endif
+               ;
+
+       /* Don't invoke OOM killer */
+       gfp |= __GFP_NORETRY;
+
+       return gfp;
+}
+
 void *dma_alloc_noncoherent(struct device *dev, size_t size,
        dma_addr_t * dma_handle, gfp_t gfp)
 {
        void *ret;
 
-       /* ignore region specifiers */
-       gfp &= ~(__GFP_DMA | __GFP_HIGHMEM);
+       gfp = massage_gfp_flags(dev, gfp);
 
-       if (dev == NULL || (dev->coherent_dma_mask < 0xffffffff))
-               gfp |= GFP_DMA;
        ret = (void *) __get_free_pages(gfp, get_order(size));
 
        if (ret != NULL) {
@@ -67,11 +89,8 @@ void *dma_alloc_coherent(struct device *dev, size_t size,
 {
        void *ret;
 
-       /* ignore region specifiers */
-       gfp &= ~(__GFP_DMA | __GFP_HIGHMEM);
+       gfp = massage_gfp_flags(dev, gfp);
 
-       if (dev == NULL || (dev->coherent_dma_mask < 0xffffffff))
-               gfp |= GFP_DMA;
        ret = (void *) __get_free_pages(gfp, get_order(size));
 
        if (ret) {
@@ -343,7 +362,7 @@ int dma_supported(struct device *dev, u64 mask)
         * so we can't guarantee allocations that must be
         * within a tighter range than GFP_DMA..
         */
-       if (mask < 0x00ffffff)
+       if (mask < DMA_BIT_MASK(24))
                return 0;
 
        return 1;
index 110ee7656b41a9b1ee27057604c923213700e06d..480dec04f552cbe086f6fa96aedbaf73ff09ff7c 100644 (file)
@@ -347,11 +347,8 @@ static int __init page_is_ram(unsigned long pagenr)
 
 void __init paging_init(void)
 {
-       unsigned long zones_size[MAX_NR_ZONES] = { 0, };
-#ifndef CONFIG_FLATMEM
-       unsigned long zholes_size[MAX_NR_ZONES] = { 0, };
-       unsigned long i, j, pfn;
-#endif
+       unsigned long max_zone_pfns[MAX_NR_ZONES];
+       unsigned long lastpfn;
 
        pagetable_init();
 
@@ -361,35 +358,27 @@ void __init paging_init(void)
        kmap_coherent_init();
 
 #ifdef CONFIG_ZONE_DMA
-       if (min_low_pfn < MAX_DMA_PFN && MAX_DMA_PFN <= max_low_pfn) {
-               zones_size[ZONE_DMA] = MAX_DMA_PFN - min_low_pfn;
-               zones_size[ZONE_NORMAL] = max_low_pfn - MAX_DMA_PFN;
-       } else if (max_low_pfn < MAX_DMA_PFN)
-               zones_size[ZONE_DMA] = max_low_pfn - min_low_pfn;
-       else
+       max_zone_pfns[ZONE_DMA] = MAX_DMA_PFN;
 #endif
-       zones_size[ZONE_NORMAL] = max_low_pfn - min_low_pfn;
-
+#ifdef CONFIG_ZONE_DMA32
+       max_zone_pfns[ZONE_DMA32] = MAX_DMA32_PFN;
+#endif
+       max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
+       lastpfn = max_low_pfn;
 #ifdef CONFIG_HIGHMEM
-       zones_size[ZONE_HIGHMEM] = highend_pfn - highstart_pfn;
+       max_zone_pfns[ZONE_HIGHMEM] = highend_pfn;
+       lastpfn = highend_pfn;
 
-       if (cpu_has_dc_aliases && zones_size[ZONE_HIGHMEM]) {
+       if (cpu_has_dc_aliases && max_low_pfn != highend_pfn) {
                printk(KERN_WARNING "This processor doesn't support highmem."
-                      " %ldk highmem ignored\n", zones_size[ZONE_HIGHMEM]);
-               zones_size[ZONE_HIGHMEM] = 0;
+                      " %ldk highmem ignored\n",
+                      (highend_pfn - max_low_pfn) << (PAGE_SHIFT - 10));
+               max_zone_pfns[ZONE_HIGHMEM] = max_low_pfn;
+               lastpfn = max_low_pfn;
        }
 #endif
 
-#ifdef CONFIG_FLATMEM
-       free_area_init(zones_size);
-#else
-       pfn = min_low_pfn;
-       for (i = 0; i < MAX_NR_ZONES; i++)
-               for (j = 0; j < zones_size[i]; j++, pfn++)
-                       if (!page_is_ram(pfn))
-                               zholes_size[i]++;
-       free_area_init_node(0, NODE_DATA(0), zones_size, 0, zholes_size);
-#endif
+       free_area_init_nodes(max_zone_pfns);
 }
 
 static struct kcore_list kcore_mem, kcore_vmalloc;
@@ -426,7 +415,7 @@ void __init mem_init(void)
 
 #ifdef CONFIG_HIGHMEM
        for (tmp = highstart_pfn; tmp < highend_pfn; tmp++) {
-               struct page *page = mem_map + tmp;
+               struct page *page = pfn_to_page(tmp);
 
                if (!page_is_ram(tmp)) {
                        SetPageReserved(page);
index 00261211dbfae199b8f9ce98a826b411ad915254..65735b1b7665b08291fc11f30f0fcac66e5ef522 100644 (file)
@@ -202,7 +202,7 @@ int pcibios_plat_dev_init(struct pci_dev *dev)
  *  RETURNS:     IRQ number
  *
  ****************************************************************************/
-int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 #if !defined(CONFIG_PMC_MSP7120_GW) && !defined(CONFIG_PMC_MSP7120_EVAL)
        printk(KERN_WARNING "PCI: unknown board, no PCI IRQs assigned.\n");
index a45bedd17233ce36b5959c3e533ddd24f41b4dc5..5c8a79bb26613a23cdbffd6319d6d90d3dee59dc 100644 (file)
@@ -113,6 +113,16 @@ static char irq_tab_pcit[13][5] __initdata = {
        {     0,  INTA,  INTB,  INTC,  INTD },  /* Slot 5 */
 };
 
+static char irq_tab_pcit_cplus[13][5] __initdata = {
+       /*       INTA  INTB  INTC  INTD */
+       {     0,     0,     0,     0,     0 },  /* HOST bridge */
+       {     0,  INTB,  INTC,  INTD,  INTA },  /* PCI Slot 9 */
+       {     0,     0,     0,     0,     0 },  /* PCI-EISA */
+       {     0,     0,     0,     0,     0 },  /* Unused */
+       {     0,  INTA,  INTB,  INTC,  INTD },  /* PCI-PCI bridge */
+       {     0,  INTB,  INTC,  INTD,  INTA },  /* fixup */
+};
+
 static inline int is_rm300_revd(void)
 {
        unsigned char csmsr = *(volatile unsigned char *)PCIMT_CSMSR;
@@ -123,8 +133,19 @@ static inline int is_rm300_revd(void)
 int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
        switch (sni_brd_type) {
-       case SNI_BRD_PCI_TOWER:
        case SNI_BRD_PCI_TOWER_CPLUS:
+               if (slot == 4) {
+                       /*
+                        * SNI messed up interrupt wiring for onboard
+                        * PCI bus 1; we need to fix this up here
+                        */
+                       while (dev && dev->bus->number != 1)
+                               dev = dev->bus->self;
+                       if (dev && dev->devfn >= PCI_DEVFN(4, 0))
+                               slot = 5;
+               }
+               return irq_tab_pcit_cplus[slot][pin];
+       case SNI_BRD_PCI_TOWER:
                return irq_tab_pcit[slot][pin];
 
        case SNI_BRD_PCI_MTOWER:
index 720a2b720c5c5a30f3c46c76b7c813e82028f56f..ed87733f679682d778b4b31a1cd62c10ffbe3f45 100644 (file)
@@ -2,7 +2,7 @@
  *  fixup-tb0219.c, The TANBAC TB0219 specific PCI fixups.
  *
  *  Copyright (C) 2003  Megasolution Inc. <matsu@megasolution.jp>
- *  Copyright (C) 2004  Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
+ *  Copyright (C) 2004-2005  Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
  *
  *  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
index 059eade96f2e74fdd3aa29da8fe30919f5a84379..109c95ca698bb9cb3aefde8b584d4f1bfa7d834d 100644 (file)
@@ -404,7 +404,7 @@ int msp_pcibios_config_access(unsigned char access_type,
        if (pciirqflag == 0) {
                request_irq(MSP_INT_PCI,/* Hardcoded internal MSP7120 wiring */
                                bpci_interrupt,
-                               SA_SHIRQ | SA_INTERRUPT,
+                               IRQF_SHARED | IRQF_DISABLED,
                                "PMC MSP PCI Host",
                                preg);
                pciirqflag = ~0;
index 174f314933b51931dc7c30776bb84b6d013221d7..e70ae3236e0b4d045d974c0ee9c291c3e6185dc7 100644 (file)
@@ -5,12 +5,14 @@
  *
  * Copyright (C) 2000, 2001, 04 Keith M Wesolowski
  */
-#include <linux/kernel.h>
 #include <linux/init.h>
+#include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/types.h>
+
 #include <asm/bootinfo.h>
-#include <asm/lasat/lasatint.h>
+
+#include <irq.h>
 
 extern struct pci_ops nile4_pci_ops;
 extern struct pci_ops gt64xxx_pci0_ops;
@@ -55,15 +57,15 @@ static int __init lasat_pci_setup(void)
 
 arch_initcall(lasat_pci_setup);
 
-#define LASATINT_ETH1   (LASATINT_BASE + 0)
-#define LASATINT_ETH0   (LASATINT_BASE + 1)
-#define LASATINT_HDC    (LASATINT_BASE + 2)
-#define LASATINT_COMP   (LASATINT_BASE + 3)
-#define LASATINT_HDLC   (LASATINT_BASE + 4)
-#define LASATINT_PCIA   (LASATINT_BASE + 5)
-#define LASATINT_PCIB   (LASATINT_BASE + 6)
-#define LASATINT_PCIC   (LASATINT_BASE + 7)
-#define LASATINT_PCID   (LASATINT_BASE + 8)
+#define LASAT_IRQ_ETH1   (LASAT_IRQ_BASE + 0)
+#define LASAT_IRQ_ETH0   (LASAT_IRQ_BASE + 1)
+#define LASAT_IRQ_HDC    (LASAT_IRQ_BASE + 2)
+#define LASAT_IRQ_COMP   (LASAT_IRQ_BASE + 3)
+#define LASAT_IRQ_HDLC   (LASAT_IRQ_BASE + 4)
+#define LASAT_IRQ_PCIA   (LASAT_IRQ_BASE + 5)
+#define LASAT_IRQ_PCIB   (LASAT_IRQ_BASE + 6)
+#define LASAT_IRQ_PCIC   (LASAT_IRQ_BASE + 7)
+#define LASAT_IRQ_PCID   (LASAT_IRQ_BASE + 8)
 
 int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
@@ -71,13 +73,13 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
        case 1:
        case 2:
        case 3:
-               return LASATINT_PCIA + (((slot-1) + (pin-1)) % 4);
+               return LASAT_IRQ_PCIA + (((slot-1) + (pin-1)) % 4);
        case 4:
-               return LASATINT_ETH1;   /* Ethernet 1 (LAN 2) */
+               return LASAT_IRQ_ETH1;   /* Ethernet 1 (LAN 2) */
        case 5:
-               return LASATINT_ETH0;   /* Ethernet 0 (LAN 1) */
+               return LASAT_IRQ_ETH0;   /* Ethernet 0 (LAN 1) */
        case 6:
-               return LASATINT_HDC;    /* IDE controller */
+               return LASAT_IRQ_HDC;    /* IDE controller */
        default:
                return 0xff;            /* Illegal */
        }
index 240df9e338132323305cb613b1e001f335381141..33c4f683d067063488115e720b3c0b83861e73e9 100644 (file)
@@ -154,6 +154,7 @@ static int __init vr41xx_pciu_init(void)
                pciu_write(PCICLKSELREG, QUARTER_VTCLOCK);
        else {
                printk(KERN_ERR "PCI Clock is over 33MHz.\n");
+               iounmap(pciu_base);
                return -EINVAL;
        }
 
index 6b293ce0935f020552490de88a0165f9cbb253f1..90261b83db04d492c7839c139a722f43766f7ea5 100644 (file)
@@ -5,12 +5,14 @@ choice
 config PMC_MSP4200_EVAL
        bool "PMC-Sierra MSP4200 Eval Board"
        select CEVT_R4K
+       select CSRC_R4K
        select IRQ_MSP_SLP
        select HW_HAS_PCI
 
 config PMC_MSP4200_GW
        bool "PMC-Sierra MSP4200 VoIP Gateway"
        select CEVT_R4K
+       select CSRC_R4K
        select IRQ_MSP_SLP
        select HW_HAS_PCI
 
index 15e7b8000b4c34413b5a9a8a121dc270aac06101..9de34302e5f4004ef21ba4b8de6c4f1771fb47f3 100644 (file)
@@ -122,7 +122,7 @@ void __init msp_serial_setup(void)
        up.uartclk      = uartclk;
        up.regshift     = 2;
        up.iotype       = UPIO_DWAPB; /* UPIO_MEM like */
-       up.flags        = STD_COM_FLAGS;
+       up.flags        = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST;
        up.type         = PORT_16550A;
        up.line         = 0;
        up.private_data         = (void*)UART0_STATUS_REG;
index cec24c117f6e21448d42a4867f63699c57459e6a..2ba4ef34b4a76cb5bbfa5e58f93d3750833adbff 100644 (file)
@@ -4,6 +4,7 @@
 
 obj-y          = q-firmware.o q-irq.o q-mem.o q-setup.o q-reset.o
 
-obj-$(CONFIG_SMP) += q-smp.o
+obj-$(CONFIG_EARLY_PRINTK)     += q-console.o
+obj-$(CONFIG_SMP)              += q-smp.o
 
 EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/qemu/q-console.c b/arch/mips/qemu/q-console.c
new file mode 100644 (file)
index 0000000..81101ae
--- /dev/null
@@ -0,0 +1,26 @@
+#include <linux/console.h>
+#include <linux/init.h>
+#include <linux/serial_reg.h>
+#include <asm/io.h>
+
+#define PORT(offset) (0x3f8 + (offset))
+
+static inline unsigned int serial_in(int offset)
+{
+       return inb(PORT(offset));
+}
+
+static inline void serial_out(int offset, int value)
+{
+       outb(value, PORT(offset));
+}
+
+int prom_putchar(char c)
+{
+       while ((serial_in(UART_LSR) & UART_LSR_THRE) == 0)
+               ;
+
+       serial_out(UART_TX, c);
+
+       return 1;
+}
index c2239b417587f81c9f8b0f6ccd392d8eebfd98e3..3ed43f416cd15e0513fdb6931db9c096fd732477 100644 (file)
@@ -2,6 +2,9 @@
 #include <linux/string.h>
 #include <asm/addrspace.h>
 #include <asm/bootinfo.h>
+#include <asm/io.h>
+
+#define QEMU_PORT_BASE 0xb4000000
 
 void __init prom_init(void)
 {
@@ -15,4 +18,7 @@ void __init prom_init(void)
        } else {
                add_memory_region(0x0<<20, 0x10<<20, BOOT_MEM_RAM);
        }
+
+
+       set_io_port_base(QEMU_PORT_BASE);
 }
index 4681757460a118e50192772b4218cb8407e1bbb0..11f984767880b9e07f1c2b597779aa6ee2da6e79 100644 (file)
@@ -1,4 +1,5 @@
 #include <linux/init.h>
+#include <linux/interrupt.h>
 #include <linux/linkage.h>
 
 #include <asm/i8259.h>
index 23d34c1917c00fa07208f18aea99d0a482ca36b7..969cedc8d8b91d0e19e157686e3c62e6c2aa3d67 100644 (file)
@@ -6,8 +6,6 @@
 
 extern void qemu_reboot_setup(void);
 
-#define QEMU_PORT_BASE 0xb4000000
-
 const char *get_system_type(void)
 {
        return "Qemu";
@@ -20,6 +18,5 @@ void __init plat_time_init(void)
 
 void __init plat_mem_setup(void)
 {
-       set_io_port_base(QEMU_PORT_BASE);
        qemu_reboot_setup();
 }
index 26854fb11e7cefea9b007fb3d992517e7944a9d6..1617241d2737e79acbf4fe3684797cb751c83b02 100644 (file)
@@ -36,6 +36,7 @@
 #include <asm/sgi/ioc.h>
 #include <asm/sgi/mc.h>
 #include <asm/sgi/ip22.h>
+#include <asm/i8259.h>
 
 /* I2 has four EISA slots. */
 #define IP22_EISA_MAX_SLOTS      4
@@ -93,126 +94,11 @@ static irqreturn_t ip22_eisa_intr(int irq, void *dev_id)
        return IRQ_NONE;
 }
 
-static void enable_eisa1_irq(unsigned int irq)
-{
-       u8 mask;
-
-       mask = inb(EISA_INT1_MASK);
-       mask &= ~((u8) (1 << irq));
-       outb(mask, EISA_INT1_MASK);
-}
-
-static unsigned int startup_eisa1_irq(unsigned int irq)
-{
-       u8 edge;
-
-       /* Only use edge interrupts for EISA */
-
-       edge = inb(EISA_INT1_EDGE_LEVEL);
-       edge &= ~((u8) (1 << irq));
-       outb(edge, EISA_INT1_EDGE_LEVEL);
-
-       enable_eisa1_irq(irq);
-       return 0;
-}
-
-static void disable_eisa1_irq(unsigned int irq)
-{
-       u8 mask;
-
-       mask = inb(EISA_INT1_MASK);
-       mask |= ((u8) (1 << irq));
-       outb(mask, EISA_INT1_MASK);
-}
-
-static void mask_and_ack_eisa1_irq(unsigned int irq)
-{
-       disable_eisa1_irq(irq);
-
-       outb(0x20, EISA_INT1_CTRL);
-}
-
-static void end_eisa1_irq(unsigned int irq)
-{
-       if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
-               enable_eisa1_irq(irq);
-}
-
-static struct irq_chip ip22_eisa1_irq_type = {
-       .name           = "IP22 EISA",
-       .startup        = startup_eisa1_irq,
-       .ack            = mask_and_ack_eisa1_irq,
-       .mask           = disable_eisa1_irq,
-       .mask_ack       = mask_and_ack_eisa1_irq,
-       .unmask         = enable_eisa1_irq,
-       .end            = end_eisa1_irq,
-};
-
-static void enable_eisa2_irq(unsigned int irq)
-{
-       u8 mask;
-
-       mask = inb(EISA_INT2_MASK);
-       mask &= ~((u8) (1 << (irq - 8)));
-       outb(mask, EISA_INT2_MASK);
-}
-
-static unsigned int startup_eisa2_irq(unsigned int irq)
-{
-       u8 edge;
-
-       /* Only use edge interrupts for EISA */
-
-       edge = inb(EISA_INT2_EDGE_LEVEL);
-       edge &= ~((u8) (1 << (irq - 8)));
-       outb(edge, EISA_INT2_EDGE_LEVEL);
-
-       enable_eisa2_irq(irq);
-       return 0;
-}
-
-static void disable_eisa2_irq(unsigned int irq)
-{
-       u8 mask;
-
-       mask = inb(EISA_INT2_MASK);
-       mask |= ((u8) (1 << (irq - 8)));
-       outb(mask, EISA_INT2_MASK);
-}
-
-static void mask_and_ack_eisa2_irq(unsigned int irq)
-{
-       disable_eisa2_irq(irq);
-
-       outb(0x20, EISA_INT2_CTRL);
-}
-
-static void end_eisa2_irq(unsigned int irq)
-{
-       if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
-               enable_eisa2_irq(irq);
-}
-
-static struct irq_chip ip22_eisa2_irq_type = {
-       .name           = "IP22 EISA",
-       .startup        = startup_eisa2_irq,
-       .ack            = mask_and_ack_eisa2_irq,
-       .mask           = disable_eisa2_irq,
-       .mask_ack       = mask_and_ack_eisa2_irq,
-       .unmask         = enable_eisa2_irq,
-       .end            = end_eisa2_irq,
-};
-
 static struct irqaction eisa_action = {
        .handler        = ip22_eisa_intr,
        .name           = "EISA",
 };
 
-static struct irqaction cascade_action = {
-       .handler        = no_action,
-       .name           = "EISA cascade",
-};
-
 int __init ip22_eisa_init(void)
 {
        int i, c;
@@ -248,29 +134,13 @@ int __init ip22_eisa_init(void)
        outb(1, EISA_EXT_NMI_RESET_CTRL);
        udelay(50);     /* Wait long enough for the dust to settle */
        outb(0, EISA_EXT_NMI_RESET_CTRL);
-       outb(0x11, EISA_INT1_CTRL);
-       outb(0x11, EISA_INT2_CTRL);
-       outb(0, EISA_INT1_MASK);
-       outb(8, EISA_INT2_MASK);
-       outb(4, EISA_INT1_MASK);
-       outb(2, EISA_INT2_MASK);
-       outb(1, EISA_INT1_MASK);
-       outb(1, EISA_INT2_MASK);
-       outb(0xfb, EISA_INT1_MASK);
-       outb(0xff, EISA_INT2_MASK);
        outb(0, EISA_DMA2_WRITE_SINGLE);
 
-       for (i = SGINT_EISA; i < (SGINT_EISA + EISA_MAX_IRQ); i++) {
-               if (i < (SGINT_EISA + 8))
-                       set_irq_chip(i, &ip22_eisa1_irq_type);
-               else
-                       set_irq_chip(i, &ip22_eisa2_irq_type);
-       }
+       init_i8259_irqs();
 
        /* Cannot use request_irq because of kmalloc not being ready at such
         * an early stage. Yes, I've been bitten... */
        setup_irq(SGI_EISA_IRQ, &eisa_action);
-       setup_irq(SGINT_EISA + 2, &cascade_action);
 
        EISA_bus = 1;
        return 0;
index e19d60d5fcc1b9dbdcef9267d98d21b0818f0f92..0177566475d4cd42ae3a68d2eb1c73a4c39789c9 100644 (file)
        for (x=0; x<100000; x++) __asm__ __volatile__(""); })
 
 #define eeprom_cs_on(ptr) ({   \
-       *ptr &= ~EEPROM_DATO;   \
-       *ptr &= ~EEPROM_ECLK;   \
-       *ptr &= ~EEPROM_EPROT;  \
-       delay();                \
-       *ptr |= EEPROM_CSEL;    \
-       *ptr |= EEPROM_ECLK; })
+       __raw_writel(__raw_readl(ptr) & ~EEPROM_DATO, ptr);     \
+       __raw_writel(__raw_readl(ptr) & ~EEPROM_ECLK, ptr);     \
+       __raw_writel(__raw_readl(ptr) & ~EEPROM_EPROT, ptr);    \
+       delay();                                                \
+       __raw_writel(__raw_readl(ptr) | EEPROM_CSEL, ptr);      \
+       __raw_writel(__raw_readl(ptr) | EEPROM_ECLK, ptr); })
 
 
 #define eeprom_cs_off(ptr) ({  \
-       *ptr &= ~EEPROM_ECLK;   \
-       *ptr &= ~EEPROM_CSEL;   \
-       *ptr |= EEPROM_EPROT;   \
-       *ptr |= EEPROM_ECLK; })
+       __raw_writel(__raw_readl(ptr) & ~EEPROM_ECLK, ptr);     \
+       __raw_writel(__raw_readl(ptr) & ~EEPROM_CSEL, ptr);     \
+       __raw_writel(__raw_readl(ptr) | EEPROM_EPROT, ptr);     \
+       __raw_writel(__raw_readl(ptr) | EEPROM_ECLK, ptr); })
 
 #define        BITS_IN_COMMAND 11
 /*
@@ -60,15 +60,17 @@ static inline void eeprom_cmd(unsigned int *ctrl, unsigned cmd, unsigned reg)
        ser_cmd = cmd | (reg << (16 - BITS_IN_COMMAND));
        for (i = 0; i < BITS_IN_COMMAND; i++) {
                if (ser_cmd & (1<<15))  /* if high order bit set */
-                       writel(readl(ctrl) | EEPROM_DATO, ctrl);
+                       __raw_writel(__raw_readl(ctrl) | EEPROM_DATO, ctrl);
                else
-                       writel(readl(ctrl) & ~EEPROM_DATO, ctrl);
-               writel(readl(ctrl) & ~EEPROM_ECLK, ctrl);
-               writel(readl(ctrl) | EEPROM_ECLK, ctrl);
+                       __raw_writel(__raw_readl(ctrl) & ~EEPROM_DATO, ctrl);
+               __raw_writel(__raw_readl(ctrl) & ~EEPROM_ECLK, ctrl);
+               delay();
+               __raw_writel(__raw_readl(ctrl) | EEPROM_ECLK, ctrl);
+               delay();
                ser_cmd <<= 1;
        }
        /* see data sheet timing diagram */
-       writel(readl(ctrl) & ~EEPROM_DATO, ctrl);
+       __raw_writel(__raw_readl(ctrl) & ~EEPROM_DATO, ctrl);
 }
 
 unsigned short ip22_eeprom_read(unsigned int *ctrl, int reg)
@@ -76,18 +78,18 @@ unsigned short ip22_eeprom_read(unsigned int *ctrl, int reg)
        unsigned short res = 0;
        int i;
 
-       writel(readl(ctrl) & ~EEPROM_EPROT, ctrl);
+       __raw_writel(__raw_readl(ctrl) & ~EEPROM_EPROT, ctrl);
        eeprom_cs_on(ctrl);
        eeprom_cmd(ctrl, EEPROM_READ, reg);
 
        /* clock the data ouf of serial mem */
        for (i = 0; i < 16; i++) {
-               writel(readl(ctrl) & ~EEPROM_ECLK, ctrl);
+               __raw_writel(__raw_readl(ctrl) & ~EEPROM_ECLK, ctrl);
                delay();
-               writel(readl(ctrl) | EEPROM_ECLK, ctrl);
+               __raw_writel(__raw_readl(ctrl) | EEPROM_ECLK, ctrl);
                delay();
                res <<= 1;
-               if (readl(ctrl) & EEPROM_DATI)
+               if (__raw_readl(ctrl) & EEPROM_DATI)
                        res |= 1;
        }
 
index f5dccf01da115adb516adfc451c770439262fe54..08d45369be45c40a4895a00c9c831e109de9fd7f 100644 (file)
@@ -131,12 +131,12 @@ static struct irq_chip rt_irq_type = {
 static int rt_next_event(unsigned long delta, struct clock_event_device *evt)
 {
        unsigned int cpu = smp_processor_id();
-       int slice = cputoslice(cpu) == 0;
+       int slice = cputoslice(cpu);
        unsigned long cnt;
 
        cnt = LOCAL_HUB_L(PI_RT_COUNT);
        cnt += delta;
-       LOCAL_HUB_S(slice ? PI_RT_COMPARE_A : PI_RT_COMPARE_B, cnt);
+       LOCAL_HUB_S(PI_RT_COMPARE_A + PI_COUNT_OFFSET * slice, cnt);
 
        return LOCAL_HUB_L(PI_RT_COUNT) >= cnt ? -ETIME : 0;
 }
@@ -164,9 +164,12 @@ static irqreturn_t hub_rt_counter_handler(int irq, void *dev_id)
 {
        struct clock_event_device *cd = dev_id;
        unsigned int cpu = smp_processor_id();
-       int slice = cputoslice(cpu) == 0;
+       int slice = cputoslice(cpu);
 
-       LOCAL_HUB_S(slice ? PI_RT_PEND_A : PI_RT_PEND_B, 0);    /* Ack  */
+       /*
+        * Ack
+        */
+       LOCAL_HUB_S(PI_RT_PEND_A + PI_COUNT_OFFSET * slice, 0);
        cd->event_handler(cd);
 
        return IRQ_HANDLED;
index 7e8094f617bfd9048edc2179118ec270f40f7403..cab7cc22ab67407a8f2f37d4706a574c303ed3fb 100644 (file)
@@ -40,13 +40,6 @@ static void inline flush_mace_bus(void)
        mace->perif.ctrl.misc;
 }
 
-#undef DEBUG_IRQ
-#ifdef DEBUG_IRQ
-#define DBG(x...) printk(x)
-#else
-#define DBG(x...)
-#endif
-
 /*
  * O2 irq map
  *
@@ -125,6 +118,7 @@ struct irqaction memerr_irq = {
        .mask = CPU_MASK_NONE,
        .name = "CRIME memory error",
 };
+
 struct irqaction cpuerr_irq = {
        .handler = crime_cpuerr_intr,
        .flags = IRQF_DISABLED,
@@ -139,46 +133,70 @@ struct irqaction cpuerr_irq = {
 
 static uint64_t crime_mask;
 
-static void enable_crime_irq(unsigned int irq)
+static inline void crime_enable_irq(unsigned int irq)
 {
-       crime_mask |= 1 << (irq - 1);
+       unsigned int bit = irq - CRIME_IRQ_BASE;
+
+       crime_mask |= 1 << bit;
        crime->imask = crime_mask;
 }
 
-static void disable_crime_irq(unsigned int irq)
+static inline void crime_disable_irq(unsigned int irq)
 {
-       crime_mask &= ~(1 << (irq - 1));
+       unsigned int bit = irq - CRIME_IRQ_BASE;
+
+       crime_mask &= ~(1 << bit);
        crime->imask = crime_mask;
        flush_crime_bus();
 }
 
-static void mask_and_ack_crime_irq(unsigned int irq)
+static void crime_level_mask_and_ack_irq(unsigned int irq)
+{
+       crime_disable_irq(irq);
+}
+
+static void crime_level_end_irq(unsigned int irq)
+{
+       if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
+               crime_enable_irq(irq);
+}
+
+static struct irq_chip crime_level_interrupt = {
+       .name           = "IP32 CRIME",
+       .ack            = crime_level_mask_and_ack_irq,
+       .mask           = crime_disable_irq,
+       .mask_ack       = crime_level_mask_and_ack_irq,
+       .unmask         = crime_enable_irq,
+       .end            = crime_level_end_irq,
+};
+
+static void crime_edge_mask_and_ack_irq(unsigned int irq)
 {
+       unsigned int bit = irq - CRIME_IRQ_BASE;
+       uint64_t crime_int;
+
        /* Edge triggered interrupts must be cleared. */
-       if ((irq >= CRIME_GBE0_IRQ && irq <= CRIME_GBE3_IRQ)
-           || (irq >= CRIME_RE_EMPTY_E_IRQ && irq <= CRIME_RE_IDLE_E_IRQ)
-           || (irq >= CRIME_SOFT0_IRQ && irq <= CRIME_SOFT2_IRQ)) {
-               uint64_t crime_int;
-               crime_int = crime->hard_int;
-               crime_int &= ~(1 << (irq - 1));
-               crime->hard_int = crime_int;
-       }
-       disable_crime_irq(irq);
+
+       crime_int = crime->hard_int;
+       crime_int &= ~(1 << bit);
+       crime->hard_int = crime_int;
+
+       crime_disable_irq(irq);
 }
 
-static void end_crime_irq(unsigned int irq)
+static void crime_edge_end_irq(unsigned int irq)
 {
        if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
-               enable_crime_irq(irq);
+               crime_enable_irq(irq);
 }
 
-static struct irq_chip ip32_crime_interrupt = {
-       .name = "IP32 CRIME",
-       .ack = mask_and_ack_crime_irq,
-       .mask = disable_crime_irq,
-       .mask_ack = mask_and_ack_crime_irq,
-       .unmask = enable_crime_irq,
-       .end = end_crime_irq,
+static struct irq_chip crime_edge_interrupt = {
+       .name           = "IP32 CRIME",
+       .ack            = crime_edge_mask_and_ack_irq,
+       .mask           = crime_disable_irq,
+       .mask_ack       = crime_edge_mask_and_ack_irq,
+       .unmask         = crime_enable_irq,
+       .end            = crime_edge_end_irq,
 };
 
 /*
@@ -191,18 +209,18 @@ static unsigned long macepci_mask;
 
 static void enable_macepci_irq(unsigned int irq)
 {
-       macepci_mask |= MACEPCI_CONTROL_INT(irq - 9);
+       macepci_mask |= MACEPCI_CONTROL_INT(irq - MACEPCI_SCSI0_IRQ);
        mace->pci.control = macepci_mask;
-       crime_mask |= 1 << (irq - 1);
+       crime_mask |= 1 << (irq - CRIME_IRQ_BASE);
        crime->imask = crime_mask;
 }
 
 static void disable_macepci_irq(unsigned int irq)
 {
-       crime_mask &= ~(1 << (irq - 1));
+       crime_mask &= ~(1 << (irq - CRIME_IRQ_BASE));
        crime->imask = crime_mask;
        flush_crime_bus();
-       macepci_mask &= ~MACEPCI_CONTROL_INT(irq - 9);
+       macepci_mask &= ~MACEPCI_CONTROL_INT(irq - MACEPCI_SCSI0_IRQ);
        mace->pci.control = macepci_mask;
        flush_mace_bus();
 }
@@ -265,7 +283,7 @@ static void enable_maceisa_irq(unsigned int irq)
 {
        unsigned int crime_int = 0;
 
-       DBG("maceisa enable: %u\n", irq);
+       pr_debug("maceisa enable: %u\n", irq);
 
        switch (irq) {
        case MACEISA_AUDIO_SW_IRQ ... MACEISA_AUDIO3_MERR_IRQ:
@@ -278,10 +296,10 @@ static void enable_maceisa_irq(unsigned int irq)
                crime_int = MACE_SUPERIO_INT;
                break;
        }
-       DBG("crime_int %08x enabled\n", crime_int);
+       pr_debug("crime_int %08x enabled\n", crime_int);
        crime_mask |= crime_int;
        crime->imask = crime_mask;
-       maceisa_mask |= 1 << (irq - 33);
+       maceisa_mask |= 1 << (irq - MACEISA_AUDIO_SW_IRQ);
        mace->perif.ctrl.imask = maceisa_mask;
 }
 
@@ -289,12 +307,12 @@ static void disable_maceisa_irq(unsigned int irq)
 {
        unsigned int crime_int = 0;
 
-       maceisa_mask &= ~(1 << (irq - 33));
-        if(!(maceisa_mask & MACEISA_AUDIO_INT))
+       maceisa_mask &= ~(1 << (irq - MACEISA_AUDIO_SW_IRQ));
+        if (!(maceisa_mask & MACEISA_AUDIO_INT))
                crime_int |= MACE_AUDIO_INT;
-        if(!(maceisa_mask & MACEISA_MISC_INT))
+        if (!(maceisa_mask & MACEISA_MISC_INT))
                crime_int |= MACE_MISC_INT;
-        if(!(maceisa_mask & MACEISA_SUPERIO_INT))
+        if (!(maceisa_mask & MACEISA_SUPERIO_INT))
                crime_int |= MACE_SUPERIO_INT;
        crime_mask &= ~crime_int;
        crime->imask = crime_mask;
@@ -313,7 +331,7 @@ static void mask_and_ack_maceisa_irq(unsigned int irq)
        case MACEISA_SERIAL2_TDMAPR_IRQ:
                /* edge triggered */
                mace_int = mace->perif.ctrl.istat;
-               mace_int &= ~(1 << (irq - 33));
+               mace_int &= ~(1 << (irq - MACEISA_AUDIO_SW_IRQ));
                mace->perif.ctrl.istat = mace_int;
                break;
        }
@@ -327,12 +345,12 @@ static void end_maceisa_irq(unsigned irq)
 }
 
 static struct irq_chip ip32_maceisa_interrupt = {
-       .name = "IP32 MACE ISA",
-       .ack = mask_and_ack_maceisa_irq,
-       .mask = disable_maceisa_irq,
-       .mask_ack = mask_and_ack_maceisa_irq,
-       .unmask = enable_maceisa_irq,
-       .end = end_maceisa_irq,
+       .name           = "IP32 MACE ISA",
+       .ack            = mask_and_ack_maceisa_irq,
+       .mask           = disable_maceisa_irq,
+       .mask_ack       = mask_and_ack_maceisa_irq,
+       .unmask         = enable_maceisa_irq,
+       .end            = end_maceisa_irq,
 };
 
 /* This is used for regular non-ISA, non-PCI MACE interrupts.  That means
@@ -341,13 +359,17 @@ static struct irq_chip ip32_maceisa_interrupt = {
 
 static void enable_mace_irq(unsigned int irq)
 {
-       crime_mask |= 1 << (irq - 1);
+       unsigned int bit = irq - CRIME_IRQ_BASE;
+
+       crime_mask |= (1 << bit);
        crime->imask = crime_mask;
 }
 
 static void disable_mace_irq(unsigned int irq)
 {
-       crime_mask &= ~(1 << (irq - 1));
+       unsigned int bit = irq - CRIME_IRQ_BASE;
+
+       crime_mask &= ~(1 << bit);
        crime->imask = crime_mask;
        flush_crime_bus();
 }
@@ -411,7 +433,7 @@ static void ip32_irq0(void)
                irq = __ffs(mace_int & maceisa_mask) + MACEISA_AUDIO_SW_IRQ;
        }
 
-       DBG("*irq %u*\n", irq);
+       pr_debug("*irq %u*\n", irq);
        do_IRQ(irq);
 }
 
@@ -471,24 +493,32 @@ void __init arch_init_irq(void)
        mace->perif.ctrl.imask = 0;
 
        mips_cpu_irq_init();
-       for (irq = MIPS_CPU_IRQ_BASE + 8; irq <= IP32_IRQ_MAX; irq++) {
-               struct irq_chip *chip;
-
+       for (irq = CRIME_IRQ_BASE; irq <= IP32_IRQ_MAX; irq++) {
                switch (irq) {
                case MACE_VID_IN1_IRQ ... MACE_PCI_BRIDGE_IRQ:
-                       chip = &ip32_mace_interrupt;
+                       set_irq_chip(irq, &ip32_mace_interrupt);
                        break;
                case MACEPCI_SCSI0_IRQ ...  MACEPCI_SHARED2_IRQ:
-                       chip = &ip32_macepci_interrupt;
+                       set_irq_chip(irq, &ip32_macepci_interrupt);
+                       break;
+               case CRIME_GBE0_IRQ ... CRIME_GBE3_IRQ:
+                       set_irq_chip(irq, &crime_edge_interrupt);
+                       break;
+               case CRIME_CPUERR_IRQ:
+               case CRIME_MEMERR_IRQ:
+                       set_irq_chip(irq, &crime_level_interrupt);
                        break;
-               case CRIME_GBE0_IRQ ... CRIME_VICE_IRQ:
-                       chip = &ip32_crime_interrupt;
+               case CRIME_RE_EMPTY_E_IRQ ... CRIME_RE_IDLE_E_IRQ:
+               case CRIME_SOFT0_IRQ ... CRIME_SOFT2_IRQ:
+                       set_irq_chip(irq, &crime_edge_interrupt);
+                       break;
+               case CRIME_VICE_IRQ:
+                       set_irq_chip(irq, &crime_edge_interrupt);
                        break;
                default:
-                       chip = &ip32_maceisa_interrupt;
+                       set_irq_chip(irq, &ip32_maceisa_interrupt);
+                       break;
                }
-
-               set_irq_chip(irq, chip);
        }
        setup_irq(CRIME_MEMERR_IRQ, &memerr_irq);
        setup_irq(CRIME_CPUERR_IRQ, &cpuerr_irq);
index 7309e48d163d1535facc87aef51ee4608ed3f3fc..77febd68fcd47ec0ea6b5bcd7876b62fe283121e 100644 (file)
@@ -42,7 +42,7 @@ static struct platform_device uart8250_device = {
 static int __init uart8250_init(void)
 {
        uart8250_data[0].membase = (void __iomem *) &mace->isa.serial1;
-       uart8250_data[1].membase = (void __iomem *) &mace->isa.serial1;
+       uart8250_data[1].membase = (void __iomem *) &mace->isa.serial2;
 
        return platform_device_register(&uart8250_device);
 }
index e8fb880272bd143ba42b8cec34a037f016771135..366b19d33f77f7c826f5f935c4bb6a39760d84af 100644 (file)
@@ -1,5 +1,7 @@
 config SIBYTE_SB1250
        bool
+       select CEVT_SB1250
+       select CSRC_SB1250
        select HW_HAS_PCI
        select IRQ_CPU
        select SIBYTE_ENABLE_LDT_IF_PCI
@@ -9,6 +11,8 @@ config SIBYTE_SB1250
 
 config SIBYTE_BCM1120
        bool
+       select CEVT_SB1250
+       select CSRC_SB1250
        select IRQ_CPU
        select SIBYTE_BCM112X
        select SIBYTE_HAS_ZBUS_PROFILING
@@ -16,6 +20,8 @@ config SIBYTE_BCM1120
 
 config SIBYTE_BCM1125
        bool
+       select CEVT_SB1250
+       select CSRC_SB1250
        select HW_HAS_PCI
        select IRQ_CPU
        select SIBYTE_BCM112X
@@ -24,6 +30,8 @@ config SIBYTE_BCM1125
 
 config SIBYTE_BCM1125H
        bool
+       select CEVT_SB1250
+       select CSRC_SB1250
        select HW_HAS_PCI
        select IRQ_CPU
        select SIBYTE_BCM112X
@@ -33,12 +41,16 @@ config SIBYTE_BCM1125H
 
 config SIBYTE_BCM112X
        bool
+       select CEVT_SB1250
+       select CSRC_SB1250
        select IRQ_CPU
        select SIBYTE_SB1xxx_SOC
        select SIBYTE_HAS_ZBUS_PROFILING
 
 config SIBYTE_BCM1x80
        bool
+       select CEVT_BCM1480
+       select CSRC_BCM1480
        select HW_HAS_PCI
        select IRQ_CPU
        select SIBYTE_HAS_ZBUS_PROFILING
@@ -47,6 +59,8 @@ config SIBYTE_BCM1x80
 
 config SIBYTE_BCM1x55
        bool
+       select CEVT_BCM1480
+       select CSRC_BCM1480
        select HW_HAS_PCI
        select IRQ_CPU
        select SIBYTE_SB1xxx_SOC
index 10299bafeab761aeb682d423be6223fd0176461b..db372a0f106d1e8631aff8c001ba2891448aebb7 100644 (file)
@@ -265,42 +265,6 @@ void __init init_bcm1480_irqs(void)
        }
 }
 
-
-static irqreturn_t bcm1480_dummy_handler(int irq, void *dev_id)
-{
-       return IRQ_NONE;
-}
-
-static struct irqaction bcm1480_dummy_action = {
-       .handler = bcm1480_dummy_handler,
-       .flags   = 0,
-       .mask    = CPU_MASK_NONE,
-       .name    = "bcm1480-private",
-       .next    = NULL,
-       .dev_id  = 0
-};
-
-int bcm1480_steal_irq(int irq)
-{
-       struct irq_desc *desc = irq_desc + irq;
-       unsigned long flags;
-       int retval = 0;
-
-       if (irq >= BCM1480_NR_IRQS)
-               return -EINVAL;
-
-       spin_lock_irqsave(&desc->lock, flags);
-       /* Don't allow sharing at all for these */
-       if (desc->action != NULL)
-               retval = -EBUSY;
-       else {
-               desc->action = &bcm1480_dummy_action;
-               desc->depth = 0;
-       }
-       spin_unlock_irqrestore(&desc->lock, flags);
-       return 0;
-}
-
 /*
  *  init_IRQ is called early in the boot sequence from init/main.c.  It
  *  is responsible for setting up the interrupt mapper and installing the
@@ -329,7 +293,6 @@ int bcm1480_steal_irq(int irq)
 
 void __init arch_init_irq(void)
 {
-
        unsigned int i, cpu;
        u64 tmp;
        unsigned int imask = STATUSF_IP4 | STATUSF_IP3 | STATUSF_IP2 |
@@ -386,8 +349,6 @@ void __init arch_init_irq(void)
                __raw_writeq(tmp, IOADDR(A_BCM1480_IMR_REGISTER(cpu, R_BCM1480_IMR_INTERRUPT_MASK_L)));
        }
 
-       bcm1480_steal_irq(K_BCM1480_INT_MBOX_0_0);
-
        /*
         * Note that the timer interrupts are also mapped, but this is
         * done in bcm1480_time_init().  Also, the profiling driver
@@ -409,12 +370,11 @@ void __init arch_init_irq(void)
 #endif
                /* Setup uart 1 settings, mapper */
                /* QQQ FIXME */
-               __raw_writeq(M_DUART_IMR_BRK, IO_SPACE_BASE + A_DUART_IMRREG(kgdb_port));
+               __raw_writeq(M_DUART_IMR_BRK, IOADDR(A_DUART_IMRREG(kgdb_port)));
 
-               bcm1480_steal_irq(kgdb_irq);
                __raw_writeq(IMR_IP6_VAL,
-                            IO_SPACE_BASE + A_BCM1480_IMR_REGISTER(0, R_BCM1480_IMR_INTERRUPT_MAP_BASE_H) +
-                            (kgdb_irq<<3));
+                            IOADDR(A_BCM1480_IMR_REGISTER(0, R_BCM1480_IMR_INTERRUPT_MAP_BASE_H) +
+                            (kgdb_irq << 3)));
                bcm1480_unmask_irq(0, kgdb_irq);
 
 #ifdef CONFIG_GDB_CONSOLE
@@ -452,18 +412,6 @@ static void bcm1480_kgdb_interrupt(void)
 
 extern void bcm1480_mailbox_interrupt(void);
 
-static inline void dispatch_ip4(void)
-{
-       int cpu = smp_processor_id();
-       int irq = K_BCM1480_INT_TIMER_0 + cpu;
-
-       /* Reset the timer */
-       __raw_writeq(M_SCD_TIMER_ENABLE|M_SCD_TIMER_MODE_CONTINUOUS,
-                   IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG)));
-
-       do_IRQ(irq);
-}
-
 static inline void dispatch_ip2(void)
 {
        unsigned long long mask_h, mask_l;
@@ -491,6 +439,7 @@ static inline void dispatch_ip2(void)
 
 asmlinkage void plat_irq_dispatch(void)
 {
+       unsigned int cpu = smp_processor_id();
        unsigned int pending;
 
 #ifdef CONFIG_SIBYTE_BCM1480_PROF
@@ -507,7 +456,7 @@ asmlinkage void plat_irq_dispatch(void)
 #endif
 
        if (pending & CAUSEF_IP4)
-               dispatch_ip4();
+               do_IRQ(K_BCM1480_INT_TIMER_0 + cpu);
 #ifdef CONFIG_SMP
        else if (pending & CAUSEF_IP3)
                bcm1480_mailbox_interrupt();
index 610f0253954dbb5151bb87215d3ab0d424e3ef0e..1680a68952ae1be6e9e738afe4ebaa4cb8ed19f5 100644 (file)
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
-#include <linux/clockchips.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <linux/percpu.h>
-#include <linux/spinlock.h>
+#include <linux/init.h>
 
-#include <asm/addrspace.h>
-#include <asm/time.h>
-#include <asm/io.h>
-
-#include <asm/sibyte/bcm1480_regs.h>
-#include <asm/sibyte/sb1250_regs.h>
-#include <asm/sibyte/bcm1480_int.h>
-#include <asm/sibyte/bcm1480_scd.h>
-
-#include <asm/sibyte/sb1250.h>
-
-
-#define IMR_IP2_VAL    K_BCM1480_INT_MAP_I0
-#define IMR_IP3_VAL    K_BCM1480_INT_MAP_I1
-#define IMR_IP4_VAL    K_BCM1480_INT_MAP_I2
-
-extern int bcm1480_steal_irq(int irq);
-
-/*
- * The general purpose timer ticks at 1MHz independent if
- * the rest of the system
- */
-static void sibyte_set_mode(enum clock_event_mode mode,
-                           struct clock_event_device *evt)
-{
-       unsigned int cpu = smp_processor_id();
-       void __iomem *timer_cfg, *timer_init;
-
-       timer_cfg = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG));
-       timer_init = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT));
-
-       switch (mode) {
-       case CLOCK_EVT_MODE_PERIODIC:
-               __raw_writeq(0, timer_cfg);
-               __raw_writeq((V_SCD_TIMER_FREQ / HZ) - 1, timer_init);
-               __raw_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS,
-                            timer_cfg);
-               break;
-
-       case CLOCK_EVT_MODE_ONESHOT:
-               /* Stop the timer until we actually program a shot */
-       case CLOCK_EVT_MODE_SHUTDOWN:
-               __raw_writeq(0, timer_cfg);
-               break;
-
-       case CLOCK_EVT_MODE_UNUSED:     /* shuddup gcc */
-       case CLOCK_EVT_MODE_RESUME:
-               ;
-       }
-}
-
-static int sibyte_next_event(unsigned long delta, struct clock_event_device *cd)
-{
-       unsigned int cpu = smp_processor_id();
-       void __iomem *timer_init;
-       unsigned int cnt;
-       int res;
-
-       timer_init = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT));
-       cnt = __raw_readq(timer_init);
-       cnt += delta;
-       __raw_writeq(cnt, timer_init);
-       res = ((long)(__raw_readq(timer_init) - cnt ) > 0) ? -ETIME : 0;
-
-       return res;
-}
-
-static irqreturn_t sibyte_counter_handler(int irq, void *dev_id)
-{
-       unsigned int cpu = smp_processor_id();
-       struct clock_event_device *cd = dev_id;
-       void __iomem *timer_cfg;
-
-       timer_cfg = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG));
-
-       /* Reset the timer */
-       __raw_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS,
-                    timer_cfg);
-       cd->event_handler(cd);
-
-       return IRQ_HANDLED;
-}
-
-static DEFINE_PER_CPU(struct clock_event_device, sibyte_hpt_clockevent);
-static DEFINE_PER_CPU(struct irqaction, sibyte_hpt_irqaction);
-static DEFINE_PER_CPU(char [18], sibyte_hpt_name);
-
-void __cpuinit sb1480_clockevent_init(void)
-{
-       unsigned int cpu = smp_processor_id();
-       unsigned int irq = K_BCM1480_INT_TIMER_0 + cpu;
-       struct irqaction *action = &per_cpu(sibyte_hpt_irqaction, cpu);
-       struct clock_event_device *cd = &per_cpu(sibyte_hpt_clockevent, cpu);
-       unsigned char *name = per_cpu(sibyte_hpt_name, cpu);
-
-       BUG_ON(cpu > 3);        /* Only have 4 general purpose timers */
-
-       sprintf(name, "bcm1480-counter %d", cpu);
-       cd->name                = name;
-       cd->features            = CLOCK_EVT_FEAT_PERIODIC |
-                                 CLOCK_EVT_MODE_ONESHOT;
-       clockevent_set_clock(cd, V_SCD_TIMER_FREQ);
-       cd->max_delta_ns        = clockevent_delta2ns(0x7fffff, cd);
-       cd->min_delta_ns        = clockevent_delta2ns(1, cd);
-       cd->rating              = 200;
-       cd->irq                 = irq;
-       cd->cpumask             = cpumask_of_cpu(cpu);
-       cd->set_next_event      = sibyte_next_event;
-       cd->set_mode            = sibyte_set_mode;
-       clockevents_register_device(cd);
-
-       bcm1480_mask_irq(cpu, irq);
-
-       /*
-        * Map timer interrupt to IP[4] of this cpu
-        */
-       __raw_writeq(IMR_IP4_VAL,
-                    IOADDR(A_BCM1480_IMR_REGISTER(cpu,
-                       R_BCM1480_IMR_INTERRUPT_MAP_BASE_H) + (irq << 3)));
-
-       bcm1480_unmask_irq(cpu, irq);
-       bcm1480_steal_irq(irq);
-
-       action->handler = sibyte_counter_handler;
-       action->flags   = IRQF_DISABLED | IRQF_PERCPU;
-       action->name    = name;
-       action->dev_id  = cd;
-       setup_irq(irq, action);
-}
-
-static cycle_t bcm1480_hpt_read(void)
-{
-       return (cycle_t) __raw_readq(IOADDR(A_SCD_ZBBUS_CYCLE_COUNT));
-}
-
-struct clocksource bcm1480_clocksource = {
-       .name   = "zbbus-cycles",
-       .rating = 200,
-       .read   = bcm1480_hpt_read,
-       .mask   = CLOCKSOURCE_MASK(64),
-       .flags  = CLOCK_SOURCE_IS_CONTINUOUS,
-};
-
-void __init sb1480_clocksource_init(void)
-{
-       struct clocksource *cs = &bcm1480_clocksource;
-       unsigned int plldiv;
-       unsigned long zbbus;
-
-       plldiv = G_BCM1480_SYS_PLL_DIV(__raw_readq(IOADDR(A_SCD_SYSTEM_CFG)));
-       zbbus = ((plldiv >> 1) * 50000000) + ((plldiv & 1) * 25000000);
-       clocksource_set_clock(cs, zbbus);
-       clocksource_register(cs);
-}
+extern void sb1480_clockevent_init(void);
+extern void sb1480_clocksource_init(void);
 
 void __init plat_time_init(void)
 {
index 53780a179d1d94efe7804b017f2d820a27485b4f..eac9065ffe0ccc4c5f0811f8ee20d45375abd21f 100644 (file)
@@ -236,41 +236,6 @@ void __init init_sb1250_irqs(void)
 }
 
 
-static irqreturn_t  sb1250_dummy_handler(int irq, void *dev_id)
-{
-       return IRQ_NONE;
-}
-
-static struct irqaction sb1250_dummy_action = {
-       .handler = sb1250_dummy_handler,
-       .flags   = 0,
-       .mask    = CPU_MASK_NONE,
-       .name    = "sb1250-private",
-       .next    = NULL,
-       .dev_id  = 0
-};
-
-int sb1250_steal_irq(int irq)
-{
-       struct irq_desc *desc = irq_desc + irq;
-       unsigned long flags;
-       int retval = 0;
-
-       if (irq >= SB1250_NR_IRQS)
-               return -EINVAL;
-
-       spin_lock_irqsave(&desc->lock, flags);
-       /* Don't allow sharing at all for these */
-       if (desc->action != NULL)
-               retval = -EBUSY;
-       else {
-               desc->action = &sb1250_dummy_action;
-               desc->depth = 0;
-       }
-       spin_unlock_irqrestore(&desc->lock, flags);
-       return 0;
-}
-
 /*
  *  arch_init_irq is called early in the boot sequence from init/main.c via
  *  init_IRQ.  It is responsible for setting up the interrupt mapper and
@@ -342,8 +307,6 @@ void __init arch_init_irq(void)
        __raw_writeq(tmp, IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MASK)));
        __raw_writeq(tmp, IOADDR(A_IMR_REGISTER(1, R_IMR_INTERRUPT_MASK)));
 
-       sb1250_steal_irq(K_INT_MBOX_0);
-
        /*
         * Note that the timer interrupts are also mapped, but this is
         * done in sb1250_time_init().  Also, the profiling driver
@@ -367,7 +330,6 @@ void __init arch_init_irq(void)
                __raw_writeq(M_DUART_IMR_BRK,
                             IOADDR(A_DUART_IMRREG(kgdb_port)));
 
-               sb1250_steal_irq(kgdb_irq);
                __raw_writeq(IMR_IP6_VAL,
                             IOADDR(A_IMR_REGISTER(0,
                                                   R_IMR_INTERRUPT_MAP_BASE) +
index a41e908bc2182395cdc4f24f994da985d3374f71..68337bf7a5aa6d0d5c9429032ed365e20ad272b8 100644 (file)
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
+#include <linux/init.h>
 
-/*
- * These are routines to set up and handle interrupts from the
- * sb1250 general purpose timer 0.  We're using the timer as a
- * system clock, so we set it up to run at 100 Hz.  On every
- * interrupt, we update our idea of what the time of day is,
- * then call do_timer() in the architecture-independent kernel
- * code to do general bookkeeping (e.g. update jiffies, run
- * bottom halves, etc.)
- */
-#include <linux/clockchips.h>
-#include <linux/interrupt.h>
-#include <linux/sched.h>
-#include <linux/spinlock.h>
-#include <linux/kernel_stat.h>
-
-#include <asm/irq.h>
-#include <asm/addrspace.h>
-#include <asm/time.h>
-#include <asm/io.h>
-
-#include <asm/sibyte/sb1250.h>
-#include <asm/sibyte/sb1250_regs.h>
-#include <asm/sibyte/sb1250_int.h>
-#include <asm/sibyte/sb1250_scd.h>
-
-
-#define IMR_IP2_VAL    K_INT_MAP_I0
-#define IMR_IP3_VAL    K_INT_MAP_I1
-#define IMR_IP4_VAL    K_INT_MAP_I2
-
-#define SB1250_HPT_NUM         3
-#define SB1250_HPT_VALUE       M_SCD_TIMER_CNT /* max value */
-
-
-extern int sb1250_steal_irq(int irq);
-
-/*
- * The general purpose timer ticks at 1 Mhz independent if
- * the rest of the system
- */
-static void sibyte_set_mode(enum clock_event_mode mode,
-                           struct clock_event_device *evt)
-{
-       unsigned int cpu = smp_processor_id();
-       void __iomem *timer_cfg, *timer_init;
-
-       timer_cfg = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG));
-       timer_init = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT));
-
-       switch(mode) {
-       case CLOCK_EVT_MODE_PERIODIC:
-               __raw_writeq(0, timer_cfg);
-               __raw_writeq((V_SCD_TIMER_FREQ / HZ) - 1, timer_init);
-               __raw_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS,
-                            timer_cfg);
-               break;
-
-       case CLOCK_EVT_MODE_ONESHOT:
-               /* Stop the timer until we actually program a shot */
-       case CLOCK_EVT_MODE_SHUTDOWN:
-               __raw_writeq(0, timer_cfg);
-               break;
-
-       case CLOCK_EVT_MODE_UNUSED:     /* shuddup gcc */
-       case CLOCK_EVT_MODE_RESUME:
-               ;
-       }
-}
-
-static int
-sibyte_next_event(unsigned long delta, struct clock_event_device *evt)
-{
-       unsigned int cpu = smp_processor_id();
-       void __iomem *timer_cfg, *timer_init;
-
-       timer_cfg = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG));
-       timer_init = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT));
-
-       __raw_writeq(0, timer_cfg);
-       __raw_writeq(delta, timer_init);
-       __raw_writeq(M_SCD_TIMER_ENABLE, timer_cfg);
-
-       return 0;
-}
-
-static irqreturn_t sibyte_counter_handler(int irq, void *dev_id)
-{
-       unsigned int cpu = smp_processor_id();
-       struct clock_event_device *cd = dev_id;
-
-       /* ACK interrupt */
-       ____raw_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS,
-                      IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG)));
-
-       cd->event_handler(cd);
-
-       return IRQ_HANDLED;
-}
-
-static struct irqaction sibyte_irqaction = {
-       .handler        = sibyte_counter_handler,
-       .flags          = IRQF_DISABLED | IRQF_PERCPU,
-       .name           = "timer",
-};
-
-static DEFINE_PER_CPU(struct clock_event_device, sibyte_hpt_clockevent);
-static DEFINE_PER_CPU(struct irqaction, sibyte_hpt_irqaction);
-static DEFINE_PER_CPU(char [18], sibyte_hpt_name);
-
-void __cpuinit sb1250_clockevent_init(void)
-{
-       unsigned int cpu = smp_processor_id();
-       unsigned int irq = K_INT_TIMER_0 + cpu;
-       struct irqaction *action = &per_cpu(sibyte_hpt_irqaction, cpu);
-       struct clock_event_device *cd = &per_cpu(sibyte_hpt_clockevent, cpu);
-       unsigned char *name = per_cpu(sibyte_hpt_name, cpu);
-
-       /* Only have 4 general purpose timers, and we use last one as hpt */
-       BUG_ON(cpu > 2);
-
-       sprintf(name, "bcm1480-counter %d", cpu);
-       cd->name                = name;
-       cd->features            = CLOCK_EVT_FEAT_PERIODIC |
-                                 CLOCK_EVT_MODE_ONESHOT;
-       clockevent_set_clock(cd, V_SCD_TIMER_FREQ);
-       cd->max_delta_ns        = clockevent_delta2ns(0x7fffff, cd);
-       cd->min_delta_ns        = clockevent_delta2ns(1, cd);
-       cd->rating              = 200;
-       cd->irq                 = irq;
-       cd->cpumask             = cpumask_of_cpu(cpu);
-       cd->set_next_event      = sibyte_next_event;
-       cd->set_mode            = sibyte_set_mode;
-       clockevents_register_device(cd);
-
-       sb1250_mask_irq(cpu, irq);
-
-       /* Map the timer interrupt to ip[4] of this cpu */
-       __raw_writeq(IMR_IP4_VAL,
-                    IOADDR(A_IMR_REGISTER(cpu, R_IMR_INTERRUPT_MAP_BASE) +
-                           (irq << 3)));
-       cd->cpumask = cpumask_of_cpu(0);
-
-       sb1250_unmask_irq(cpu, irq);
-       sb1250_steal_irq(irq);
-
-       action->handler = sibyte_counter_handler;
-       action->flags   = IRQF_DISABLED | IRQF_PERCPU;
-       action->name    = name;
-       action->dev_id  = cd;
-       setup_irq(irq, &sibyte_irqaction);
-}
-
-/*
- * The HPT is free running from SB1250_HPT_VALUE down to 0 then starts over
- * again.
- */
-static cycle_t sb1250_hpt_read(void)
-{
-       unsigned int count;
-
-       count = G_SCD_TIMER_CNT(__raw_readq(IOADDR(A_SCD_TIMER_REGISTER(SB1250_HPT_NUM, R_SCD_TIMER_CNT))));
-
-       return SB1250_HPT_VALUE - count;
-}
-
-struct clocksource bcm1250_clocksource = {
-       .name   = "MIPS",
-       .rating = 200,
-       .read   = sb1250_hpt_read,
-       .mask   = CLOCKSOURCE_MASK(23),
-       .flags  = CLOCK_SOURCE_IS_CONTINUOUS,
-};
-
-void __init sb1250_clocksource_init(void)
-{
-       struct clocksource *cs = &bcm1250_clocksource;
-
-       /* Setup hpt using timer #3 but do not enable irq for it */
-       __raw_writeq(0,
-                    IOADDR(A_SCD_TIMER_REGISTER(SB1250_HPT_NUM,
-                                                R_SCD_TIMER_CFG)));
-       __raw_writeq(SB1250_HPT_VALUE,
-                    IOADDR(A_SCD_TIMER_REGISTER(SB1250_HPT_NUM,
-                                                R_SCD_TIMER_INIT)));
-       __raw_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS,
-                    IOADDR(A_SCD_TIMER_REGISTER(SB1250_HPT_NUM,
-                                                R_SCD_TIMER_CFG)));
-
-       clocksource_set_clock(cs, V_SCD_TIMER_FREQ);
-       clocksource_register(cs);
-}
+extern void sb1250_clocksource_init(void);
+extern void sb1250_clockevent_init(void);
 
 void __init plat_time_init(void)
 {
index 4df070f2ff5dd488736cd49af07674e6f3844f1d..834650f371e08ebb5917cd8b7ca9a1659eaaf54f 100644 (file)
@@ -244,7 +244,7 @@ static void pcimt_hwint1(void)
        if (pend & IT_EISA) {
                int irq;
                /*
-                * Note: ASIC PCI's builtin interrupt achknowledge feature is
+                * Note: ASIC PCI's builtin interrupt acknowledge feature is
                 * broken.  Using it may result in loss of some or all i8259
                 * interrupts, so don't use PCIMT_INT_ACKNOWLEDGE ...
                 */
index 0910b35cb71fb0861cfb3c2d98ebf58804b16fbd..6f339af08d225a50b0dd6a6712aa30adf0f723e0 100644 (file)
@@ -1,6 +1,7 @@
 #include <linux/types.h>
 #include <linux/interrupt.h>
 #include <linux/time.h>
+#include <linux/clockchips.h>
 
 #include <asm/i8253.h>
 #include <asm/sni.h>
 #define SNI_COUNTER2_DIV        64
 #define SNI_COUNTER0_DIV        ((SNI_CLOCK_TICK_RATE / SNI_COUNTER2_DIV) / HZ)
 
-static void sni_a20r_timer_ack(void)
+static void a20r_set_mode(enum clock_event_mode mode,
+                          struct clock_event_device *evt)
 {
-        *(volatile u8 *)A20R_PT_TIM0_ACK = 0x0; wmb();
+       switch (mode) {
+       case CLOCK_EVT_MODE_PERIODIC:
+               *(volatile u8 *)(A20R_PT_CLOCK_BASE + 12) = 0x34;
+               wmb();
+               *(volatile u8 *)(A20R_PT_CLOCK_BASE +  0) = SNI_COUNTER0_DIV;
+               wmb();
+               *(volatile u8 *)(A20R_PT_CLOCK_BASE +  0) = SNI_COUNTER0_DIV >> 8;
+               wmb();
+
+               *(volatile u8 *)(A20R_PT_CLOCK_BASE + 12) = 0xb4;
+               wmb();
+               *(volatile u8 *)(A20R_PT_CLOCK_BASE +  8) = SNI_COUNTER2_DIV;
+               wmb();
+               *(volatile u8 *)(A20R_PT_CLOCK_BASE +  8) = SNI_COUNTER2_DIV >> 8;
+               wmb();
+
+                break;
+        case CLOCK_EVT_MODE_ONESHOT:
+        case CLOCK_EVT_MODE_UNUSED:
+        case CLOCK_EVT_MODE_SHUTDOWN:
+                break;
+        case CLOCK_EVT_MODE_RESUME:
+                break;
+        }
 }
 
+static struct clock_event_device a20r_clockevent_device = {
+       .name           = "a20r-timer",
+       .features       = CLOCK_EVT_FEAT_PERIODIC,
+
+       /* .mult, .shift, .max_delta_ns and .min_delta_ns left uninitialized */
+
+       .rating         = 300,
+       .irq            = SNI_A20R_IRQ_TIMER,
+       .set_mode       = a20r_set_mode,
+};
+
+static irqreturn_t a20r_interrupt(int irq, void *dev_id)
+{
+       struct clock_event_device *cd = dev_id;
+
+       *(volatile u8 *)A20R_PT_TIM0_ACK = 0;
+       wmb();
+
+       cd->event_handler(cd);
+
+       return IRQ_HANDLED;
+}
+
+static struct irqaction a20r_irqaction = {
+       .handler        = a20r_interrupt,
+       .flags          = IRQF_DISABLED | IRQF_PERCPU,
+       .name           = "a20r-timer",
+};
+
 /*
  * a20r platform uses 2 counters to divide the input frequency.
  * Counter 2 output is connected to Counter 0 & 1 input.
  */
-static void __init sni_a20r_timer_setup(struct irqaction *irq)
+static void __init sni_a20r_timer_setup(void)
 {
-        *(volatile u8 *)(A20R_PT_CLOCK_BASE + 12) = 0x34; wmb();
-        *(volatile u8 *)(A20R_PT_CLOCK_BASE +  0) = (SNI_COUNTER0_DIV) & 0xff; wmb();
-        *(volatile u8 *)(A20R_PT_CLOCK_BASE +  0) = (SNI_COUNTER0_DIV >> 8) & 0xff; wmb();
-
-        *(volatile u8 *)(A20R_PT_CLOCK_BASE + 12) = 0xb4; wmb();
-        *(volatile u8 *)(A20R_PT_CLOCK_BASE +  8) = (SNI_COUNTER2_DIV) & 0xff; wmb();
-        *(volatile u8 *)(A20R_PT_CLOCK_BASE +  8) = (SNI_COUNTER2_DIV >> 8) & 0xff; wmb();
-
-        setup_irq(SNI_A20R_IRQ_TIMER, irq);
-        mips_timer_ack = sni_a20r_timer_ack;
+       struct clock_event_device *cd = &a20r_clockevent_device;
+       struct irqaction *action = &a20r_irqaction;
+       unsigned int cpu = smp_processor_id();
+
+       cd->cpumask             = cpumask_of_cpu(cpu);
+       clockevents_register_device(cd);
+       action->dev_id = cd;
+       setup_irq(SNI_A20R_IRQ_TIMER, &a20r_irqaction);
 }
 
 #define SNI_8254_TICK_RATE        1193182UL
@@ -118,18 +170,13 @@ void __init plat_time_init(void)
 
        mips_hpt_frequency = r4k_tick * HZ;
 
-       setup_pit_timer();
-}
-
-void __init plat_timer_setup(struct irqaction *irq)
-{
        switch (sni_brd_type) {
        case SNI_BRD_10:
        case SNI_BRD_10NEW:
        case SNI_BRD_TOWER_OASIC:
        case SNI_BRD_MINITOWER:
-               sni_a20r_timer_setup(irq);
-               break;
+               sni_a20r_timer_setup();
+               break;
        }
 }
 
index c7470fba6180d4ff9a57dc00fdc15517a6a3dfb7..0299595ce1c4267ad432d65c68d08cc4a7ddd2f3 100644 (file)
@@ -63,6 +63,7 @@
 #include <asm/processor.h>
 #include <asm/reboot.h>
 #include <asm/time.h>
+#include <asm/txx9tmr.h>
 #include <linux/bootmem.h>
 #include <linux/blkdev.h>
 #ifdef CONFIG_TOSHIBA_FPCIB0
@@ -93,7 +94,6 @@
 
 #define TOSHIBA_RBTX4927_SETUP_EFWFU       ( 1 <<  3 )
 #define TOSHIBA_RBTX4927_SETUP_SETUP       ( 1 <<  4 )
-#define TOSHIBA_RBTX4927_SETUP_TIME_INIT   ( 1 <<  5 )
 #define TOSHIBA_RBTX4927_SETUP_PCIBIOS     ( 1 <<  7 )
 #define TOSHIBA_RBTX4927_SETUP_PCI1        ( 1 <<  8 )
 #define TOSHIBA_RBTX4927_SETUP_PCI2        ( 1 <<  9 )
@@ -130,7 +130,6 @@ extern void toshiba_rbtx4927_power_off(void);
 
 int tx4927_using_backplane = 0;
 
-extern void gt64120_time_init(void);
 extern void toshiba_rbtx4927_irq_setup(void);
 
 char *prom_getcmdline(void);
@@ -721,6 +720,7 @@ void toshiba_rbtx4927_power_off(void)
 
 void __init toshiba_rbtx4927_setup(void)
 {
+       int i;
        u32 cp0_config;
        char *argptr;
 
@@ -764,6 +764,9 @@ void __init toshiba_rbtx4927_setup(void)
        _machine_halt = toshiba_rbtx4927_halt;
        pm_power_off = toshiba_rbtx4927_power_off;
 
+       for (i = 0; i < TX4927_NR_TMR; i++)
+               txx9_tmr_init(TX4927_TMR_REG(0) & 0xfffffffffULL);
+
 #ifdef CONFIG_PCI
 
        /* PCIC */
@@ -892,7 +895,6 @@ void __init toshiba_rbtx4927_setup(void)
 #ifdef CONFIG_SERIAL_TXX9
        {
                extern int early_serial_txx9_setup(struct uart_port *port);
-               int i;
                struct uart_port req;
                for(i = 0; i < 2; i++) {
                        memset(&req, 0, sizeof(req));
@@ -937,12 +939,11 @@ void __init toshiba_rbtx4927_setup(void)
 void __init
 toshiba_rbtx4927_time_init(void)
 {
-       TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_TIME_INIT, "-\n");
-
        mips_hpt_frequency = tx4927_cpu_clock / 2;
-
-       TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_TIME_INIT, "+\n");
-
+       if (tx4927_ccfgptr->ccfg & TX4927_CCFG_TINTDIS)
+               txx9_clockevent_init(TX4927_TMR_REG(0) & 0xfffffffffULL,
+                                    TXX9_IRQ_BASE + 17,
+                                    50000000);
 }
 
 static int __init toshiba_rbtx4927_rtc_init(void)
index ceecaf498957313d1bc1f02b65d6ba4ff1433102..4a8152375efe2614a3947cca200b96006f92d6f8 100644 (file)
@@ -26,6 +26,7 @@
 #include <asm/reboot.h>
 #include <asm/irq.h>
 #include <asm/time.h>
+#include <asm/txx9tmr.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
 #include <asm/bootinfo.h>
@@ -773,15 +774,8 @@ void __init tx4938_board_setup(void)
        }
 
        /* TMR */
-       /* disable all timers */
-       for (i = 0; i < TX4938_NR_TMR; i++) {
-               tx4938_tmrptr(i)->tcr  = 0x00000020;
-               tx4938_tmrptr(i)->tisr = 0;
-               tx4938_tmrptr(i)->cpra = 0xffffffff;
-               tx4938_tmrptr(i)->itmr = 0;
-               tx4938_tmrptr(i)->ccdr = 0;
-               tx4938_tmrptr(i)->pgmr = 0;
-       }
+       for (i = 0; i < TX4938_NR_TMR; i++)
+               txx9_tmr_init(TX4938_TMR_REG(i) & 0xfffffffffULL);
 
        /* enable DMA */
        TX4938_WR64(0xff1fb150, TX4938_DMA_MCR_MSTEN);
@@ -852,12 +846,13 @@ void tx4938_report_pcic_status(void)
 
 #endif /* CONFIG_PCI */
 
-/* We use onchip r4k counter or TMR timer as our system wide timer
- * interrupt running at 100HZ. */
-
 void __init plat_time_init(void)
 {
        mips_hpt_frequency = txx9_cpu_clock / 2;
+       if (tx4938_ccfgptr->ccfg & TX4938_CCFG_TINTDIS)
+               txx9_clockevent_init(TX4938_TMR_REG(0) & 0xfffffffffULL,
+                                    TXX9_IRQ_BASE + TX4938_IR_TMR(0),
+                                    txx9_gbus_clock / 2);
 }
 
 void __init toshiba_rbtx4938_setup(void)
index eeb089f20c0db183902a47faa22c217aee4765ee..559acc09c819f3c53efbc8327514368f41b5af2e 100644 (file)
@@ -6,6 +6,7 @@ choice
 config CASIO_E55
        bool "CASIO CASSIOPEIA E-10/15/55/65"
        select CEVT_R4K
+       select CSRC_R4K
        select DMA_NONCOHERENT
        select IRQ_CPU
        select ISA
@@ -15,6 +16,7 @@ config CASIO_E55
 config IBM_WORKPAD
        bool "IBM WorkPad z50"
        select CEVT_R4K
+       select CSRC_R4K
        select DMA_NONCOHERENT
        select IRQ_CPU
        select ISA
@@ -24,6 +26,7 @@ config IBM_WORKPAD
 config NEC_CMBVR4133
        bool "NEC CMB-VR4133"
        select CEVT_R4K
+       select CSRC_R4K
        select DMA_NONCOHERENT
        select IRQ_CPU
        select HW_HAS_PCI
@@ -33,6 +36,7 @@ config NEC_CMBVR4133
 config TANBAC_TB022X
        bool "TANBAC VR4131 multichip module and TANBAC VR4131DIMM"
        select CEVT_R4K
+       select CSRC_R4K
        select DMA_NONCOHERENT
        select IRQ_CPU
        select HW_HAS_PCI
@@ -48,6 +52,7 @@ config TANBAC_TB022X
 config VICTOR_MPC30X
        bool "Victor MP-C303/304"
        select CEVT_R4K
+       select CSRC_R4K
        select DMA_NONCOHERENT
        select IRQ_CPU
        select HW_HAS_PCI
@@ -58,6 +63,7 @@ config VICTOR_MPC30X
 config ZAO_CAPCELLA
        bool "ZAO Networks Capcella"
        select CEVT_R4K
+       select CSRC_R4K
        select DMA_NONCOHERENT
        select IRQ_CPU
        select HW_HAS_PCI
index 1899601e5862210e5dd83212dc67587ea75d18d9..3f23d9fda662621e2879ff37a2d1ecbef24cf1a5 100644 (file)
@@ -525,6 +525,7 @@ static inline int set_sysint1_assign(unsigned int irq, unsigned char assign)
                intassign1 |= (uint16_t)assign << 9;
                break;
        default:
+               spin_unlock_irq(&desc->lock);
                return -EINVAL;
        }
 
@@ -592,6 +593,7 @@ static inline int set_sysint2_assign(unsigned int irq, unsigned char assign)
                intassign3 |= (uint16_t)assign << 12;
                break;
        default:
+               spin_unlock_irq(&desc->lock);
                return -EINVAL;
        }
 
index 4e165342210aa84b508a91e11ef6a8c44148b980..bd87626c1f6041664ed777fcd4349116bb32ea32 100644 (file)
@@ -107,6 +107,9 @@ endif
 # No AltiVec instruction when building kernel
 KBUILD_CFLAGS += $(call cc-option,-mno-altivec)
 
+# No SPE instruction when building kernel
+KBUILD_CFLAGS += $(call cc-option,-mno-spe)
+
 # Enable unit-at-a-time mode when possible. It shrinks the
 # kernel considerably.
 KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time)
index fcd333c391ec15c285b1c23e370b5c24cf289c0d..c64f3037a13b4a0fd33fc1faec3ab106bf13e8e2 100644 (file)
                };
 
                i2c@3000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                        device_type = "i2c";
                        compatible = "fsl-i2c";
                        reg = <3000 100>;
                        interrupts = <e 8>;
                        interrupt-parent = < &ipic >;
                        dfsrr;
+
+                       rtc@68 {
+                               compatible = "dallas,ds1374";
+                               reg = <68>;
+                       };
                };
 
                serial@4500 {
                        reg = <700 100>;
                        device_type = "ipic";
                };
-               
+
                par_io@1400 {
                        reg = <1400 100>;
                        device_type = "par_io";
                                        3  5  1  0  2  0  /* MDC */
                                        0  d  2  0  1  0        /* RX_CLK (CLK9) */
                                        3 18  2  0  1  0        /* TX_CLK (CLK10) */
-                                       1  1  1  0  1  0        /* TxD1 */
                                        1  0  1  0  1  0        /* TxD0 */
                                        1  1  1  0  1  0        /* TxD1 */
                                        1  2  1  0  1  0        /* TxD2 */
                reg = <e0100000 480>;
                brg-frequency = <0>;
                bus-frequency = <BCD3D80>;
-               
+
                muram@10000 {
                        device_type = "muram";
                        ranges = <0 00010000 00004000>;
-       
+
                        data-only@0 {
                                reg = <0 4000>;
                        };
                        compatible = "ucc_geth";
                        model = "UCC";
                        device-id = <4>;
-                       reg = <3000 200>;
+                       reg = <3200 200>;
                        interrupts = <23>;
                        interrupt-parent = < &qeic >;
                        /*
index e5a84ef9f4b074318bf14e41fef517261a13d7c0..49363f89cb712494e64db301eafb7ebbbbfac187 100644 (file)
                };
 
                i2c@3000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                        device_type = "i2c";
                        compatible = "fsl-i2c";
                        reg = <3000 100>;
                        interrupts = <e 8>;
                        interrupt-parent = < &ipic >;
                        dfsrr;
+
+                       rtc@68 {
+                               compatible = "dallas,ds1374";
+                               reg = <68>;
+                       };
                };
 
                i2c@3100 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                        device_type = "i2c";
                        compatible = "fsl-i2c";
                        reg = <3100 100>;
index fbd1573c348b5601bab89a5cbca5b15d7b1521ca..0b2d2b588daa0c907523bb258e8aa11ec628fb25 100644 (file)
                };
 
                i2c@3000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                        device_type = "i2c";
                        compatible = "fsl-i2c";
                        reg = <3000 100>;
                        interrupts = <e 8>;
                        interrupt-parent = < &ipic >;
                        dfsrr;
+
+                       rtc@68 {
+                               compatible = "dallas,ds1374";
+                               reg = <68>;
+                       };
                };
 
                i2c@3100 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                        device_type = "i2c";
                        compatible = "fsl-i2c";
                        reg = <3100 100>;
index 3f9d15cf13e0121e919a037b8d686ea6425b9360..6c608de1fc1b53e499bf972a9d6dd48dc2a613db 100644 (file)
                clock-frequency = <1fca055>;
                interrupt-parent = <&mpic>;
                interrupts = <1b 2>;
-               interrupt-map-mask = <fb00 0 0 0>;
+               interrupt-map-mask = <ff00 0 0 1>;
                interrupt-map = <
                        // IDSEL 0x1c  USB
-                       e000 0 0 0 &i8259 c 2
-                       e100 0 0 0 &i8259 9 2
-                       e200 0 0 0 &i8259 a 2
-                       e300 0 0 0 &i8259 b 2
+                       e000 0 0 1 &i8259 c 2
+                       e100 0 0 1 &i8259 9 2
+                       e200 0 0 1 &i8259 a 2
+                       e300 0 0 1 &i8259 b 2
 
                        // IDSEL 0x1d  Audio
-                       e800 0 0 0 &i8259 6 2
+                       e800 0 0 1 &i8259 6 2
 
                        // IDSEL 0x1e Legacy
-                       f000 0 0 0 &i8259 7 2
-                       f100 0 0 0 &i8259 7 2
+                       f000 0 0 1 &i8259 7 2
+                       f100 0 0 1 &i8259 7 2
 
                        // IDSEL 0x1f IDE/SATA
-                       f800 0 0 0 &i8259 e 2
-                       f900 0 0 0 &i8259 5 2
+                       f800 0 0 1 &i8259 e 2
+                       f900 0 0 1 &i8259 5 2
                >;
 
                pcie@0 {
index d638deec76529720f39ad73b630cf45a73a1566e..0eb44fb9647dbccf50177d452d0486af529b51ae 100644 (file)
                clock-frequency = <1fca055>;
                interrupt-parent = <&mpic>;
                interrupts = <18 2>;
-               interrupt-map-mask = <fb00 0 0 0>;
+               interrupt-map-mask = <ff00 0 0 7>;
                interrupt-map = <
-                       /* IDSEL 0x11 - PCI slot 1 */
+                       /* IDSEL 0x11 func 0 - PCI slot 1 */
                        8800 0 0 1 &mpic 2 1
                        8800 0 0 2 &mpic 3 1
                        8800 0 0 3 &mpic 4 1
                        8800 0 0 4 &mpic 1 1
 
-                       /* IDSEL 0x12 - PCI slot 2 */
+                       /* IDSEL 0x11 func 1 - PCI slot 1 */
+                       8900 0 0 1 &mpic 2 1
+                       8900 0 0 2 &mpic 3 1
+                       8900 0 0 3 &mpic 4 1
+                       8900 0 0 4 &mpic 1 1
+
+                       /* IDSEL 0x11 func 2 - PCI slot 1 */
+                       8a00 0 0 1 &mpic 2 1
+                       8a00 0 0 2 &mpic 3 1
+                       8a00 0 0 3 &mpic 4 1
+                       8a00 0 0 4 &mpic 1 1
+
+                       /* IDSEL 0x11 func 3 - PCI slot 1 */
+                       8b00 0 0 1 &mpic 2 1
+                       8b00 0 0 2 &mpic 3 1
+                       8b00 0 0 3 &mpic 4 1
+                       8b00 0 0 4 &mpic 1 1
+
+                       /* IDSEL 0x11 func 4 - PCI slot 1 */
+                       8c00 0 0 1 &mpic 2 1
+                       8c00 0 0 2 &mpic 3 1
+                       8c00 0 0 3 &mpic 4 1
+                       8c00 0 0 4 &mpic 1 1
+
+                       /* IDSEL 0x11 func 5 - PCI slot 1 */
+                       8d00 0 0 1 &mpic 2 1
+                       8d00 0 0 2 &mpic 3 1
+                       8d00 0 0 3 &mpic 4 1
+                       8d00 0 0 4 &mpic 1 1
+
+                       /* IDSEL 0x11 func 6 - PCI slot 1 */
+                       8e00 0 0 1 &mpic 2 1
+                       8e00 0 0 2 &mpic 3 1
+                       8e00 0 0 3 &mpic 4 1
+                       8e00 0 0 4 &mpic 1 1
+
+                       /* IDSEL 0x11 func 7 - PCI slot 1 */
+                       8f00 0 0 1 &mpic 2 1
+                       8f00 0 0 2 &mpic 3 1
+                       8f00 0 0 3 &mpic 4 1
+                       8f00 0 0 4 &mpic 1 1
+
+                       /* IDSEL 0x12 func 0 - PCI slot 2 */
                        9000 0 0 1 &mpic 3 1
                        9000 0 0 2 &mpic 4 1
                        9000 0 0 3 &mpic 1 1
                        9000 0 0 4 &mpic 2 1
 
+                       /* IDSEL 0x12 func 1 - PCI slot 2 */
+                       9100 0 0 1 &mpic 3 1
+                       9100 0 0 2 &mpic 4 1
+                       9100 0 0 3 &mpic 1 1
+                       9100 0 0 4 &mpic 2 1
+
+                       /* IDSEL 0x12 func 2 - PCI slot 2 */
+                       9200 0 0 1 &mpic 3 1
+                       9200 0 0 2 &mpic 4 1
+                       9200 0 0 3 &mpic 1 1
+                       9200 0 0 4 &mpic 2 1
+
+                       /* IDSEL 0x12 func 3 - PCI slot 2 */
+                       9300 0 0 1 &mpic 3 1
+                       9300 0 0 2 &mpic 4 1
+                       9300 0 0 3 &mpic 1 1
+                       9300 0 0 4 &mpic 2 1
+
+                       /* IDSEL 0x12 func 4 - PCI slot 2 */
+                       9400 0 0 1 &mpic 3 1
+                       9400 0 0 2 &mpic 4 1
+                       9400 0 0 3 &mpic 1 1
+                       9400 0 0 4 &mpic 2 1
+
+                       /* IDSEL 0x12 func 5 - PCI slot 2 */
+                       9500 0 0 1 &mpic 3 1
+                       9500 0 0 2 &mpic 4 1
+                       9500 0 0 3 &mpic 1 1
+                       9500 0 0 4 &mpic 2 1
+
+                       /* IDSEL 0x12 func 6 - PCI slot 2 */
+                       9600 0 0 1 &mpic 3 1
+                       9600 0 0 2 &mpic 4 1
+                       9600 0 0 3 &mpic 1 1
+                       9600 0 0 4 &mpic 2 1
+
+                       /* IDSEL 0x12 func 7 - PCI slot 2 */
+                       9700 0 0 1 &mpic 3 1
+                       9700 0 0 2 &mpic 4 1
+                       9700 0 0 3 &mpic 1 1
+                       9700 0 0 4 &mpic 2 1
+
                        // IDSEL 0x1c  USB
-                       e000 0 0 0 &i8259 c 2
-                       e100 0 0 0 &i8259 9 2
-                       e200 0 0 0 &i8259 a 2
-                       e300 0 0 0 &i8259 b 2
+                       e000 0 0 1 &i8259 c 2
+                       e100 0 0 1 &i8259 9 2
+                       e200 0 0 1 &i8259 a 2
+                       e300 0 0 1 &i8259 b 2
 
                        // IDSEL 0x1d  Audio
-                       e800 0 0 0 &i8259 6 2
+                       e800 0 0 1 &i8259 6 2
 
                        // IDSEL 0x1e Legacy
-                       f000 0 0 0 &i8259 7 2
-                       f100 0 0 0 &i8259 7 2
+                       f000 0 0 1 &i8259 7 2
+                       f100 0 0 1 &i8259 7 2
 
                        // IDSEL 0x1f IDE/SATA
-                       f800 0 0 0 &i8259 e 2
-                       f900 0 0 0 &i8259 5 2
+                       f800 0 0 1 &i8259 e 2
+                       f900 0 0 1 &i8259 5 2
 
                        >;
 
index 367765937a06eb37c0aa026344911e58a7d76209..abb26dc425588aeb38782d7a1a0b459224568000 100644 (file)
                clock-frequency = <1fca055>;
                interrupt-parent = <&mpic>;
                interrupts = <18 2>;
-               interrupt-map-mask = <fb00 0 0 0>;
+               interrupt-map-mask = <ff00 0 0 7>;
                interrupt-map = <
-                       /* IDSEL 0x11 */
-                       8800 0 0 1 &i8259 9 2
-                       8800 0 0 2 &i8259 a 2
-                       8800 0 0 3 &i8259 b 2
-                       8800 0 0 4 &i8259 c 2
-
-                       /* IDSEL 0x12 */
-                       9000 0 0 1 &i8259 a 2
-                       9000 0 0 2 &i8259 b 2
-                       9000 0 0 3 &i8259 c 2
-                       9000 0 0 4 &i8259 9 2
+                       /* IDSEL 0x11 func 0 - PCI slot 1 */
+                       8800 0 0 1 &mpic 2 1
+                       8800 0 0 2 &mpic 3 1
+                       8800 0 0 3 &mpic 4 1
+                       8800 0 0 4 &mpic 1 1
+
+                       /* IDSEL 0x11 func 1 - PCI slot 1 */
+                       8900 0 0 1 &mpic 2 1
+                       8900 0 0 2 &mpic 3 1
+                       8900 0 0 3 &mpic 4 1
+                       8900 0 0 4 &mpic 1 1
+
+                       /* IDSEL 0x11 func 2 - PCI slot 1 */
+                       8a00 0 0 1 &mpic 2 1
+                       8a00 0 0 2 &mpic 3 1
+                       8a00 0 0 3 &mpic 4 1
+                       8a00 0 0 4 &mpic 1 1
+
+                       /* IDSEL 0x11 func 3 - PCI slot 1 */
+                       8b00 0 0 1 &mpic 2 1
+                       8b00 0 0 2 &mpic 3 1
+                       8b00 0 0 3 &mpic 4 1
+                       8b00 0 0 4 &mpic 1 1
+
+                       /* IDSEL 0x11 func 4 - PCI slot 1 */
+                       8c00 0 0 1 &mpic 2 1
+                       8c00 0 0 2 &mpic 3 1
+                       8c00 0 0 3 &mpic 4 1
+                       8c00 0 0 4 &mpic 1 1
+
+                       /* IDSEL 0x11 func 5 - PCI slot 1 */
+                       8d00 0 0 1 &mpic 2 1
+                       8d00 0 0 2 &mpic 3 1
+                       8d00 0 0 3 &mpic 4 1
+                       8d00 0 0 4 &mpic 1 1
+
+                       /* IDSEL 0x11 func 6 - PCI slot 1 */
+                       8e00 0 0 1 &mpic 2 1
+                       8e00 0 0 2 &mpic 3 1
+                       8e00 0 0 3 &mpic 4 1
+                       8e00 0 0 4 &mpic 1 1
+
+                       /* IDSEL 0x11 func 7 - PCI slot 1 */
+                       8f00 0 0 1 &mpic 2 1
+                       8f00 0 0 2 &mpic 3 1
+                       8f00 0 0 3 &mpic 4 1
+                       8f00 0 0 4 &mpic 1 1
+
+                       /* IDSEL 0x12 func 0 - PCI slot 2 */
+                       9000 0 0 1 &mpic 3 1
+                       9000 0 0 2 &mpic 4 1
+                       9000 0 0 3 &mpic 1 1
+                       9000 0 0 4 &mpic 2 1
+
+                       /* IDSEL 0x12 func 1 - PCI slot 2 */
+                       9100 0 0 1 &mpic 3 1
+                       9100 0 0 2 &mpic 4 1
+                       9100 0 0 3 &mpic 1 1
+                       9100 0 0 4 &mpic 2 1
+
+                       /* IDSEL 0x12 func 2 - PCI slot 2 */
+                       9200 0 0 1 &mpic 3 1
+                       9200 0 0 2 &mpic 4 1
+                       9200 0 0 3 &mpic 1 1
+                       9200 0 0 4 &mpic 2 1
+
+                       /* IDSEL 0x12 func 3 - PCI slot 2 */
+                       9300 0 0 1 &mpic 3 1
+                       9300 0 0 2 &mpic 4 1
+                       9300 0 0 3 &mpic 1 1
+                       9300 0 0 4 &mpic 2 1
+
+                       /* IDSEL 0x12 func 4 - PCI slot 2 */
+                       9400 0 0 1 &mpic 3 1
+                       9400 0 0 2 &mpic 4 1
+                       9400 0 0 3 &mpic 1 1
+                       9400 0 0 4 &mpic 2 1
+
+                       /* IDSEL 0x12 func 5 - PCI slot 2 */
+                       9500 0 0 1 &mpic 3 1
+                       9500 0 0 2 &mpic 4 1
+                       9500 0 0 3 &mpic 1 1
+                       9500 0 0 4 &mpic 2 1
+
+                       /* IDSEL 0x12 func 6 - PCI slot 2 */
+                       9600 0 0 1 &mpic 3 1
+                       9600 0 0 2 &mpic 4 1
+                       9600 0 0 3 &mpic 1 1
+                       9600 0 0 4 &mpic 2 1
+
+                       /* IDSEL 0x12 func 7 - PCI slot 2 */
+                       9700 0 0 1 &mpic 3 1
+                       9700 0 0 2 &mpic 4 1
+                       9700 0 0 3 &mpic 1 1
+                       9700 0 0 4 &mpic 2 1
 
                        // IDSEL 0x1c  USB
-                       e000 0 0 0 &i8259 c 2
-                       e100 0 0 0 &i8259 9 2
-                       e200 0 0 0 &i8259 a 2
-                       e300 0 0 0 &i8259 b 2
+                       e000 0 0 1 &i8259 c 2
+                       e100 0 0 1 &i8259 9 2
+                       e200 0 0 1 &i8259 a 2
+                       e300 0 0 1 &i8259 b 2
 
                        // IDSEL 0x1d  Audio
-                       e800 0 0 0 &i8259 6 2
+                       e800 0 0 1 &i8259 6 2
 
                        // IDSEL 0x1e Legacy
-                       f000 0 0 0 &i8259 7 2
-                       f100 0 0 0 &i8259 7 2
+                       f000 0 0 1 &i8259 7 2
+                       f100 0 0 1 &i8259 7 2
 
                        // IDSEL 0x1f IDE/SATA
-                       f800 0 0 0 &i8259 e 2
-                       f900 0 0 0 &i8259 5 2
+                       f800 0 0 1 &i8259 e 2
+                       f900 0 0 1 &i8259 5 2
                        >;
 
                pcie@0 {
index fa681f5343fec196dd5a51cd029bd34097427aef..754fa3960f8331813aede79d855bf57bbf49730c 100644 (file)
                                device_type = "network";
                                compatible = "ibm,emac-405gp", "ibm,emac";
                                interrupt-parent = <&UIC0>;
-                               interrupts = <9 4 f 4>;
+                               interrupts = <
+                                       f 4 /* Ethernet */
+                                       9 4 /* Ethernet Wake Up */>;
                                local-mac-address = [000000000000]; /* Filled in by zImage */
                                reg = <ef600800 70>;
                                mal-device = <&MAL>;
index 39b27e5ef6c19a840d4b2a9fc0f87d621e72d789..31147a0377283e179b473aa4fa4c9f720ce8ed48 100755 (executable)
 #              (default ./arch/powerpc/boot)
 # -W dir       specify working directory for temporary files (default .)
 
+# Stop execution if any command fails
+set -e
+
+# Allow for verbose output
+if [ "$V" = 1 ]; then
+    set -x
+fi
+
 # defaults
 kernel=
 ofile=zImage
@@ -111,7 +119,7 @@ if [ -n "$dts" ]; then
     if [ -z "$dtb" ]; then
        dtb="$platform.dtb"
     fi
-    dtc -O dtb -o "$dtb" -b 0 -V 16 "$dts" || exit 1
+    dtc -O dtb -o "$dtb" -b 0 -V 16 "$dts"
 fi
 
 if [ -z "$kernel" ]; then
@@ -149,7 +157,6 @@ cuboot*)
 ps3)
     platformo="$object/ps3-head.o $object/ps3-hvcall.o $object/ps3.o"
     lds=$object/zImage.ps3.lds
-    binary=y
     gzip=
     ext=bin
     objflags="-O binary --set-section-flags=.bss=contents,alloc,load,data"
@@ -233,7 +240,7 @@ entry=`${CROSS}objdump -f "$ofile" | grep '^start address ' | cut -d' ' -f3`
 
 if [ -n "$binary" ]; then
     mv "$ofile" "$ofile".elf
-    ${CROSS}objcopy -O binary "$ofile".elf "$ofile".bin
+    ${CROSS}objcopy -O binary "$ofile".elf "$ofile"
 fi
 
 # post-processing needed for some platforms
@@ -246,9 +253,9 @@ coff)
     $object/hack-coff "$ofile"
     ;;
 cuboot*)
-    gzip -f -9 "$ofile".bin
+    gzip -f -9 "$ofile"
     mkimage -A ppc -O linux -T kernel -C gzip -a "$base" -e "$entry" \
-            $uboot_version -d "$ofile".bin.gz "$ofile"
+            $uboot_version -d "$ofile".gz "$ofile"
     ;;
 treeboot*)
     mv "$ofile" "$ofile.elf"
@@ -269,11 +276,11 @@ ps3)
     # then copied to offset 0x100.  At runtime the bootwrapper program
     # copies the 0x100 bytes at __system_reset_kernel to addr 0x100.
 
-    system_reset_overlay=0x`${CROSS}nm "$ofile".elf \
+    system_reset_overlay=0x`${CROSS}nm "$ofile" \
         | grep ' __system_reset_overlay$'       \
         | cut -d' ' -f1`
     system_reset_overlay=`printf "%d" $system_reset_overlay`
-    system_reset_kernel=0x`${CROSS}nm "$ofile".elf \
+    system_reset_kernel=0x`${CROSS}nm "$ofile" \
         | grep ' __system_reset_kernel$'       \
         | cut -d' ' -f1`
     system_reset_kernel=`printf "%d" $system_reset_kernel`
@@ -282,23 +289,15 @@ ps3)
 
     rm -f "$object/otheros.bld"
 
-    msg=$(dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \
-        skip=$overlay_dest seek=$system_reset_kernel      \
-        count=$overlay_size bs=1 2>&1)
+    ${CROSS}objcopy -O binary "$ofile" "$ofile.bin"
 
-    if [ $? -ne "0" ]; then
-       echo $msg
-       exit 1
-    fi
-
-    msg=$(dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \
-        skip=$system_reset_overlay seek=$overlay_dest     \
-        count=$overlay_size bs=1 2>&1)
+    dd if="$ofile.bin" of="$ofile.bin" conv=notrunc   \
+        skip=$overlay_dest seek=$system_reset_kernel  \
+        count=$overlay_size bs=1
 
-    if [ $? -ne "0" ]; then
-       echo $msg
-       exit 2
-    fi
+    dd if="$ofile.bin" of="$ofile.bin" conv=notrunc   \
+        skip=$system_reset_overlay seek=$overlay_dest \
+        count=$overlay_size bs=1
 
     gzip --force -9 --stdout "$ofile.bin" > "$object/otheros.bld"
     ;;
index dd68d1818d6b3ce0fa55eec1c82936e731f4a56d..e069018276ca2e8f5f8ed35c4f61141bb7e8b8d0 100644 (file)
@@ -774,7 +774,53 @@ CONFIG_USB_ARCH_HAS_EHCI=y
 # CONFIG_NEW_LEDS is not set
 # CONFIG_INFINIBAND is not set
 # CONFIG_EDAC is not set
-# CONFIG_RTC_CLASS is not set
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+# CONFIG_RTC_DEBUG is not set
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS1307 is not set
+CONFIG_RTC_DRV_DS1374=y
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# CONFIG_RTC_DRV_X1205 is not set
+# CONFIG_RTC_DRV_PCF8563 is not set
+# CONFIG_RTC_DRV_PCF8583 is not set
+# CONFIG_RTC_DRV_M41T80 is not set
+
+#
+# SPI RTC drivers
+#
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
 
 #
 # DMA Engine support
index 4f391028c79c5414cc964001f6feb8d464af706f..7a5b13f4140f66c3e55d0b5eb8ec501bdfb6a3cf 100644 (file)
@@ -685,8 +685,21 @@ CONFIG_I2C_MPC=y
 #
 # SPI support
 #
-# CONFIG_SPI is not set
-# CONFIG_SPI_MASTER is not set
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_BITBANG=y
+CONFIG_SPI_MPC83xx=y
+
+#
+# SPI Protocol Masters
+#
+# CONFIG_SPI_AT25 is not set
+# CONFIG_SPI_SPIDEV is not set
+# CONFIG_SPI_TLE62X0 is not set
 # CONFIG_W1 is not set
 # CONFIG_POWER_SUPPLY is not set
 CONFIG_HWMON=y
@@ -710,6 +723,7 @@ CONFIG_HWMON=y
 # CONFIG_SENSORS_GL520SM is not set
 # CONFIG_SENSORS_IT87 is not set
 # CONFIG_SENSORS_LM63 is not set
+# CONFIG_SENSORS_LM70 is not set
 # CONFIG_SENSORS_LM75 is not set
 # CONFIG_SENSORS_LM77 is not set
 # CONFIG_SENSORS_LM78 is not set
@@ -896,7 +910,24 @@ CONFIG_USB_MON=y
 # USB Gadget Support
 #
 # CONFIG_USB_GADGET is not set
-# CONFIG_MMC is not set
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+# CONFIG_MMC_UNSAFE_RESUME is not set
+
+#
+# MMC/SD Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_BOUNCE=y
+# CONFIG_SDIO_UART is not set
+
+#
+# MMC/SD Host Controller Drivers
+#
+# CONFIG_MMC_SDHCI is not set
+# CONFIG_MMC_WBSD is not set
+# CONFIG_MMC_TIFM_SD is not set
+CONFIG_MMC_SPI=y
 # CONFIG_NEW_LEDS is not set
 # CONFIG_INFINIBAND is not set
 # CONFIG_EDAC is not set
@@ -1101,9 +1132,9 @@ CONFIG_UCC=y
 CONFIG_BITREVERSE=y
 # CONFIG_CRC_CCITT is not set
 # CONFIG_CRC16 is not set
-# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC_ITU_T=y
 CONFIG_CRC32=y
-# CONFIG_CRC7 is not set
+CONFIG_CRC7=y
 # CONFIG_LIBCRC32C is not set
 CONFIG_PLIST=y
 CONFIG_HAS_IOMEM=y
index eb28dd85cb2b6b0b1f5b665f3aed6ecf3e416275..ba512d13f3a3ed4496ecd3f58fd7b8562778279c 100644 (file)
@@ -867,7 +867,7 @@ CONFIG_USB_EHCI_ROOT_HUB_TT=y
 CONFIG_USB_EHCI_FSL=y
 # CONFIG_USB_ISP116X_HCD is not set
 # CONFIG_USB_OHCI_HCD is not set
-# CONFIG_USB_UHCI_HCD is not set
+CONFIG_USB_UHCI_HCD=y
 # CONFIG_USB_SL811_HCD is not set
 # CONFIG_USB_R8A66597_HCD is not set
 
index 22b95462c9138c1726448ad21ec60e60b69cfe3e..9faa948c22ad71d5f9a631964942f57940aa0fc6 100644 (file)
@@ -760,14 +760,100 @@ CONFIG_USB_SUPPORT=y
 CONFIG_USB_ARCH_HAS_HCD=y
 CONFIG_USB_ARCH_HAS_OHCI=y
 CONFIG_USB_ARCH_HAS_EHCI=y
-# CONFIG_USB is not set
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+# CONFIG_USB_DEVICEFS is not set
+CONFIG_USB_DEVICE_CLASS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_EHCI_HCD=y
+# CONFIG_USB_EHCI_SPLIT_ISO is not set
 CONFIG_USB_EHCI_ROOT_HUB_TT=y
+# CONFIG_USB_EHCI_TT_NEWSCHED is not set
 CONFIG_USB_EHCI_FSL=y
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_OHCI_HCD is not set
+CONFIG_USB_UHCI_HCD=y
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
 
 #
 # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
 #
 
+#
+# may also be needed; see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=y
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+CONFIG_USB_MON=y
+
+#
+# USB port drivers
+#
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_BERRY_CHARGE is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGET is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_SISUSBVGA is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
+
+#
+# USB DSL modem support
+#
+
 #
 # USB Gadget Support
 #
index e59a88e954865597775bcfcd0bf49fa846dea700..356f736a5d3d2875e58fd00fcf9c51ff84a247da 100644 (file)
@@ -721,7 +721,53 @@ CONFIG_USB_EHCI_FSL=y
 # CONFIG_NEW_LEDS is not set
 # CONFIG_INFINIBAND is not set
 # CONFIG_EDAC is not set
-# CONFIG_RTC_CLASS is not set
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+# CONFIG_RTC_DEBUG is not set
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS1307 is not set
+CONFIG_RTC_DRV_DS1374=y
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# CONFIG_RTC_DRV_X1205 is not set
+# CONFIG_RTC_DRV_PCF8563 is not set
+# CONFIG_RTC_DRV_PCF8583 is not set
+# CONFIG_RTC_DRV_M41T80 is not set
+
+#
+# SPI RTC drivers
+#
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
 
 #
 # DMA Engine support
index 75657528518e7339ab9bd72aeefff5120692f838..1b4d37570eb1f3891cac9f655a21fa5d44d980af 100644 (file)
@@ -773,7 +773,53 @@ CONFIG_USB_ARCH_HAS_EHCI=y
 # CONFIG_NEW_LEDS is not set
 # CONFIG_INFINIBAND is not set
 # CONFIG_EDAC is not set
-# CONFIG_RTC_CLASS is not set
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+# CONFIG_RTC_DEBUG is not set
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS1307 is not set
+CONFIG_RTC_DRV_DS1374=y
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# CONFIG_RTC_DRV_X1205 is not set
+# CONFIG_RTC_DRV_PCF8563 is not set
+# CONFIG_RTC_DRV_PCF8583 is not set
+# CONFIG_RTC_DRV_M41T80 is not set
+
+#
+# SPI RTC drivers
+#
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
 
 #
 # DMA Engine support
index 883d8af9debd1549f653862324d10eefa382ab50..d665e7a797c0dc1e9f784096fd4b15d3058292fd 100644 (file)
@@ -768,7 +768,53 @@ CONFIG_USB_ARCH_HAS_EHCI=y
 # CONFIG_NEW_LEDS is not set
 # CONFIG_INFINIBAND is not set
 # CONFIG_EDAC is not set
-# CONFIG_RTC_CLASS is not set
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+# CONFIG_RTC_DEBUG is not set
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS1307 is not set
+CONFIG_RTC_DRV_DS1374=y
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# CONFIG_RTC_DRV_X1205 is not set
+# CONFIG_RTC_DRV_PCF8563 is not set
+# CONFIG_RTC_DRV_PCF8583 is not set
+# CONFIG_RTC_DRV_M41T80 is not set
+
+#
+# SPI RTC drivers
+#
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
 
 #
 # DMA Engine support
index 1ccf3ed7693e876d8be9332693166030fbec1905..78c968aade4ed2617866b0efecfdad548557156d 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.23-rc4
-# Thu Aug 30 16:40:47 2007
+# Linux kernel version: 2.6.24-rc2
+# Tue Nov  6 23:23:50 2007
 #
 CONFIG_PPC64=y
 
@@ -10,6 +10,7 @@ CONFIG_PPC64=y
 #
 CONFIG_POWER4_ONLY=y
 CONFIG_POWER4=y
+# CONFIG_TUNE_CELL is not set
 CONFIG_PPC_FPU=y
 CONFIG_ALTIVEC=y
 CONFIG_PPC_STD_MMU=y
@@ -18,8 +19,13 @@ CONFIG_PPC_MM_SLICES=y
 CONFIG_SMP=y
 CONFIG_NR_CPUS=2
 CONFIG_64BIT=y
+CONFIG_WORD_SIZE=64
 CONFIG_PPC_MERGE=y
 CONFIG_MMU=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_IRQ_PER_CPU=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
@@ -65,7 +71,10 @@ CONFIG_SYSVIPC_SYSCTL=y
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=17
-# CONFIG_CPUSETS is not set
+# CONFIG_CGROUPS is not set
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FAIR_USER_SCHED=y
+# CONFIG_FAIR_CGROUP_SCHED is not set
 CONFIG_SYSFS_DEPRECATED=y
 # CONFIG_RELAY is not set
 CONFIG_BLK_DEV_INITRD=y
@@ -86,7 +95,6 @@ CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
 CONFIG_EPOLL=y
 CONFIG_SIGNALFD=y
-CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
 CONFIG_VM_EVENT_COUNTERS=y
@@ -107,14 +115,15 @@ CONFIG_STOP_MACHINE=y
 CONFIG_BLOCK=y
 # CONFIG_BLK_DEV_IO_TRACE is not set
 # CONFIG_BLK_DEV_BSG is not set
+CONFIG_BLOCK_COMPAT=y
 
 #
 # IO Schedulers
 #
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
-# CONFIG_IOSCHED_DEADLINE is not set
-# CONFIG_IOSCHED_CFQ is not set
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_DEADLINE is not set
 # CONFIG_DEFAULT_CFQ is not set
@@ -125,7 +134,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
 # Platform support
 #
 CONFIG_PPC_MULTIPLATFORM=y
-# CONFIG_EMBEDDED6xx is not set
 # CONFIG_PPC_82xx is not set
 # CONFIG_PPC_83xx is not set
 # CONFIG_PPC_86xx is not set
@@ -141,6 +149,7 @@ CONFIG_PPC_PASEMI=y
 # PA Semi PWRficient options
 #
 CONFIG_PPC_PASEMI_IOMMU=y
+# CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE is not set
 CONFIG_PPC_PASEMI_MDIO=y
 CONFIG_ELECTRA_IDE=y
 # CONFIG_PPC_CELLEB is not set
@@ -156,29 +165,52 @@ CONFIG_MPIC=y
 # CONFIG_U3_DART is not set
 # CONFIG_PPC_RTAS is not set
 # CONFIG_MMIO_NVRAM is not set
+CONFIG_MPIC_BROKEN_REGREAD=y
 # CONFIG_PPC_MPC106 is not set
 # CONFIG_PPC_970_NAP is not set
 # CONFIG_PPC_INDIRECT_IO is not set
 # CONFIG_GENERIC_IOMAP is not set
-# CONFIG_CPU_FREQ is not set
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_TABLE=y
+CONFIG_CPU_FREQ_DEBUG=y
+CONFIG_CPU_FREQ_STAT=y
+# CONFIG_CPU_FREQ_STAT_DETAILS is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=y
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
+
+#
+# CPU Frequency drivers
+#
+CONFIG_PPC_PASEMI_CPUFREQ=y
 # CONFIG_CPM2 is not set
 # CONFIG_FSL_ULI1575 is not set
 
 #
 # Kernel options
 #
-CONFIG_HZ_100=y
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+# CONFIG_HZ_100 is not set
 # CONFIG_HZ_250 is not set
 # CONFIG_HZ_300 is not set
-# CONFIG_HZ_1000 is not set
-CONFIG_HZ=100
+CONFIG_HZ_1000=y
+CONFIG_HZ=1000
 CONFIG_PREEMPT_NONE=y
 # CONFIG_PREEMPT_VOLUNTARY is not set
 # CONFIG_PREEMPT is not set
-CONFIG_PREEMPT_BKL=y
+# CONFIG_PREEMPT_BKL is not set
 CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
-CONFIG_FORCE_MAX_ZONEORDER=13
+CONFIG_FORCE_MAX_ZONEORDER=9
 CONFIG_IOMMU_VMERGE=y
 CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
 # CONFIG_KEXEC is not set
@@ -196,12 +228,13 @@ CONFIG_FLATMEM_MANUAL=y
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_RESOURCES_64BIT=y
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_BOUNCE=y
-# CONFIG_PPC_HAS_HASH_64K is not set
-# CONFIG_PPC_64K_PAGES is not set
+CONFIG_PPC_HAS_HASH_64K=y
+CONFIG_PPC_64K_PAGES=y
 # CONFIG_SCHED_SMT is not set
 CONFIG_PROC_DEVICETREE=y
 # CONFIG_CMDLINE_BOOL is not set
@@ -222,11 +255,8 @@ CONFIG_PCI_SYSCALL=y
 # CONFIG_PCIEPORTBUS is not set
 CONFIG_ARCH_SUPPORTS_MSI=y
 # CONFIG_PCI_MSI is not set
+CONFIG_PCI_LEGACY=y
 # CONFIG_PCI_DEBUG is not set
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
 CONFIG_PCCARD=y
 CONFIG_PCMCIA_DEBUG=y
 CONFIG_PCMCIA=y
@@ -240,6 +270,7 @@ CONFIG_CARDBUS=y
 # CONFIG_YENTA is not set
 # CONFIG_PD6729 is not set
 # CONFIG_I82092 is not set
+# CONFIG_ELECTRA_CF is not set
 # CONFIG_HOTPLUG_PCI is not set
 CONFIG_KERNEL_START=0xc000000000000000
 
@@ -255,7 +286,7 @@ CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
 CONFIG_XFRM=y
-# CONFIG_XFRM_USER is not set
+CONFIG_XFRM_USER=y
 # CONFIG_XFRM_SUB_POLICY is not set
 # CONFIG_XFRM_MIGRATE is not set
 CONFIG_NET_KEY=y
@@ -281,6 +312,7 @@ CONFIG_INET_TUNNEL=y
 CONFIG_INET_XFRM_MODE_TRANSPORT=y
 CONFIG_INET_XFRM_MODE_TUNNEL=y
 CONFIG_INET_XFRM_MODE_BEET=y
+CONFIG_INET_LRO=y
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
@@ -306,10 +338,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_LAPB is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
-
-#
-# QoS and/or fair queueing
-#
 # CONFIG_NET_SCHED is not set
 
 #
@@ -338,6 +366,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 #
 # Generic Driver Options
 #
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
@@ -361,6 +390,7 @@ CONFIG_MTD_BLOCK=y
 # CONFIG_INFTL is not set
 # CONFIG_RFD_FTL is not set
 # CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
 
 #
 # RAM/ROM/Flash chip drivers
@@ -385,6 +415,7 @@ CONFIG_MTD_CFI_I2=y
 # Mapping drivers for chip access
 #
 # CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_INTEL_VR_NOR is not set
 # CONFIG_MTD_PLATRAM is not set
 
 #
@@ -402,7 +433,15 @@ CONFIG_MTD_PHRAM=y
 # CONFIG_MTD_DOC2000 is not set
 # CONFIG_MTD_DOC2001 is not set
 # CONFIG_MTD_DOC2001PLUS is not set
-# CONFIG_MTD_NAND is not set
+CONFIG_MTD_NAND=y
+# CONFIG_MTD_NAND_VERIFY_WRITE is not set
+# CONFIG_MTD_NAND_ECC_SMC is not set
+# CONFIG_MTD_NAND_MUSEUM_IDS is not set
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_CAFE is not set
+# CONFIG_MTD_NAND_PLATFORM is not set
+# CONFIG_MTD_ALAUDA is not set
 # CONFIG_MTD_ONENAND is not set
 
 #
@@ -455,10 +494,42 @@ CONFIG_IDE_PROC_FS=y
 # IDE chipset support/bugfixes
 #
 # CONFIG_IDE_GENERIC is not set
-# CONFIG_BLK_DEV_IDEPCI is not set
+# CONFIG_BLK_DEV_PLATFORM is not set
+
+#
+# PCI IDE chipsets support
+#
 # CONFIG_IDEPCI_PCIBUS_ORDER is not set
+# CONFIG_BLK_DEV_GENERIC is not set
+# CONFIG_BLK_DEV_OPTI621 is not set
+# CONFIG_BLK_DEV_AEC62XX is not set
+# CONFIG_BLK_DEV_ALI15X3 is not set
+# CONFIG_BLK_DEV_AMD74XX is not set
+# CONFIG_BLK_DEV_CMD64X is not set
+# CONFIG_BLK_DEV_TRIFLEX is not set
+# CONFIG_BLK_DEV_CY82C693 is not set
+# CONFIG_BLK_DEV_CS5520 is not set
+# CONFIG_BLK_DEV_CS5530 is not set
+# CONFIG_BLK_DEV_HPT34X is not set
+# CONFIG_BLK_DEV_HPT366 is not set
+# CONFIG_BLK_DEV_JMICRON is not set
+# CONFIG_BLK_DEV_SC1200 is not set
+# CONFIG_BLK_DEV_PIIX is not set
+# CONFIG_BLK_DEV_IT8213 is not set
+# CONFIG_BLK_DEV_IT821X is not set
+# CONFIG_BLK_DEV_NS87415 is not set
+# CONFIG_BLK_DEV_PDC202XX_OLD is not set
+# CONFIG_BLK_DEV_PDC202XX_NEW is not set
+# CONFIG_BLK_DEV_SVWKS is not set
+# CONFIG_BLK_DEV_SIIMAGE is not set
+# CONFIG_BLK_DEV_SL82C105 is not set
+# CONFIG_BLK_DEV_SLC90E66 is not set
+# CONFIG_BLK_DEV_TRM290 is not set
+# CONFIG_BLK_DEV_VIA82CXXX is not set
+# CONFIG_BLK_DEV_TC86C001 is not set
 # CONFIG_IDE_ARM is not set
 # CONFIG_BLK_DEV_IDEDMA is not set
+CONFIG_IDE_ARCH_OBSOLETE_INIT=y
 # CONFIG_BLK_DEV_HD is not set
 
 #
@@ -498,10 +569,11 @@ CONFIG_SCSI_WAIT_SCAN=m
 # CONFIG_SCSI_FC_ATTRS is not set
 # CONFIG_SCSI_ISCSI_ATTRS is not set
 # CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
 CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_ISCSI_TCP is not set
-CONFIG_BLK_DEV_3W_XXXX_RAID=y
-CONFIG_SCSI_3W_9XXX=y
+# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_3W_9XXX is not set
 # CONFIG_SCSI_ACARD is not set
 # CONFIG_SCSI_AACRAID is not set
 # CONFIG_SCSI_AIC7XXX is not set
@@ -574,9 +646,10 @@ CONFIG_ATA_GENERIC=y
 # CONFIG_PATA_OLDPIIX is not set
 # CONFIG_PATA_NETCELL is not set
 # CONFIG_PATA_NS87410 is not set
+# CONFIG_PATA_NS87415 is not set
 # CONFIG_PATA_OPTI is not set
 # CONFIG_PATA_OPTIDMA is not set
-# CONFIG_PATA_PCMCIA is not set
+CONFIG_PATA_PCMCIA=y
 # CONFIG_PATA_PDC_OLD is not set
 # CONFIG_PATA_RADISYS is not set
 # CONFIG_PATA_RZ1000 is not set
@@ -589,41 +662,13 @@ CONFIG_ATA_GENERIC=y
 # CONFIG_PATA_WINBOND is not set
 CONFIG_PATA_PLATFORM=y
 # CONFIG_MD is not set
-
-#
-# Fusion MPT device support
-#
 # CONFIG_FUSION is not set
-# CONFIG_FUSION_SPI is not set
-# CONFIG_FUSION_FC is not set
-# CONFIG_FUSION_SAS is not set
 
 #
 # IEEE 1394 (FireWire) support
 #
 # CONFIG_FIREWIRE is not set
-CONFIG_IEEE1394=y
-
-#
-# Subsystem Options
-#
-# CONFIG_IEEE1394_VERBOSEDEBUG is not set
-
-#
-# Controllers
-#
-CONFIG_IEEE1394_PCILYNX=y
-CONFIG_IEEE1394_OHCI1394=y
-
-#
-# Protocols
-#
-# CONFIG_IEEE1394_VIDEO1394 is not set
-CONFIG_IEEE1394_SBP2=y
-# CONFIG_IEEE1394_ETH1394_ROM_ENTRY is not set
-# CONFIG_IEEE1394_ETH1394 is not set
-# CONFIG_IEEE1394_DV1394 is not set
-CONFIG_IEEE1394_RAWIO=y
+# CONFIG_IEEE1394 is not set
 # CONFIG_I2O is not set
 # CONFIG_MACINTOSH_DRIVERS is not set
 CONFIG_NETDEVICES=y
@@ -633,6 +678,8 @@ CONFIG_DUMMY=y
 # CONFIG_MACVLAN is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
+# CONFIG_VETH is not set
+# CONFIG_IP1000 is not set
 # CONFIG_ARCNET is not set
 CONFIG_PHYLIB=y
 
@@ -649,6 +696,7 @@ CONFIG_MARVELL_PHY=y
 # CONFIG_BROADCOM_PHY is not set
 # CONFIG_ICPLUS_PHY is not set
 # CONFIG_FIXED_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
 CONFIG_NET_ETHERNET=y
 CONFIG_MII=y
 # CONFIG_HAPPYMEAL is not set
@@ -657,13 +705,16 @@ CONFIG_MII=y
 # CONFIG_NET_VENDOR_3COM is not set
 # CONFIG_NET_TULIP is not set
 # CONFIG_HP100 is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
 CONFIG_NET_PCI=y
 # CONFIG_PCNET32 is not set
 # CONFIG_AMD8111_ETH is not set
 # CONFIG_ADAPTEC_STARFIRE is not set
 # CONFIG_B44 is not set
 # CONFIG_FORCEDETH is not set
-# CONFIG_DGRS is not set
 # CONFIG_EEPRO100 is not set
 # CONFIG_E100 is not set
 # CONFIG_FEALNX is not set
@@ -682,6 +733,7 @@ CONFIG_NETDEV_1000=y
 CONFIG_E1000=y
 CONFIG_E1000_NAPI=y
 # CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
+# CONFIG_E1000E is not set
 # CONFIG_NS83820 is not set
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
@@ -689,6 +741,7 @@ CONFIG_E1000_NAPI=y
 # CONFIG_SIS190 is not set
 # CONFIG_SKGE is not set
 # CONFIG_SKY2 is not set
+# CONFIG_SK98LIN is not set
 # CONFIG_VIA_VELOCITY is not set
 CONFIG_TIGON3=y
 # CONFIG_BNX2 is not set
@@ -697,12 +750,15 @@ CONFIG_TIGON3=y
 CONFIG_NETDEV_10000=y
 # CONFIG_CHELSIO_T1 is not set
 # CONFIG_CHELSIO_T3 is not set
+# CONFIG_IXGBE is not set
 # CONFIG_IXGB is not set
 # CONFIG_S2IO is not set
 # CONFIG_MYRI10GE is not set
 # CONFIG_NETXEN_NIC is not set
+# CONFIG_NIU is not set
 CONFIG_PASEMI_MAC=y
 # CONFIG_MLX4_CORE is not set
+# CONFIG_TEHUTI is not set
 # CONFIG_TR is not set
 
 #
@@ -749,7 +805,6 @@ CONFIG_INPUT_MOUSEDEV_PSAUX=y
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 CONFIG_INPUT_JOYDEV=y
-# CONFIG_INPUT_TSDEV is not set
 CONFIG_INPUT_EVDEV=y
 # CONFIG_INPUT_EVBUG is not set
 
@@ -810,15 +865,12 @@ CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=4
 # CONFIG_IPMI_HANDLER is not set
-# CONFIG_WATCHDOG is not set
 CONFIG_HW_RANDOM=y
 CONFIG_HW_RANDOM_PASEMI=y
 CONFIG_GEN_RTC=y
 CONFIG_GEN_RTC_X=y
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
-# CONFIG_AGP is not set
-# CONFIG_DRM is not set
 
 #
 # PCMCIA character devices
@@ -896,8 +948,6 @@ CONFIG_SENSORS_EEPROM=y
 # CONFIG_POWER_SUPPLY is not set
 CONFIG_HWMON=y
 CONFIG_HWMON_VID=y
-# CONFIG_SENSORS_ABITUGURU is not set
-# CONFIG_SENSORS_ABITUGURU3 is not set
 # CONFIG_SENSORS_AD7418 is not set
 # CONFIG_SENSORS_ADM1021 is not set
 # CONFIG_SENSORS_ADM1025 is not set
@@ -905,12 +955,12 @@ CONFIG_HWMON_VID=y
 # CONFIG_SENSORS_ADM1029 is not set
 # CONFIG_SENSORS_ADM1031 is not set
 # CONFIG_SENSORS_ADM9240 is not set
-# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_ADT7470 is not set
 # CONFIG_SENSORS_ATXP1 is not set
 # CONFIG_SENSORS_DS1621 is not set
 # CONFIG_SENSORS_F71805F is not set
-# CONFIG_SENSORS_FSCHER is not set
-# CONFIG_SENSORS_FSCPOS is not set
+# CONFIG_SENSORS_F71882FG is not set
+# CONFIG_SENSORS_F75375S is not set
 # CONFIG_SENSORS_GL518SM is not set
 # CONFIG_SENSORS_GL520SM is not set
 # CONFIG_SENSORS_IT87 is not set
@@ -946,6 +996,13 @@ CONFIG_SENSORS_LM90=y
 # CONFIG_SENSORS_W83627HF is not set
 # CONFIG_SENSORS_W83627EHF is not set
 # CONFIG_HWMON_DEBUG_CHIP is not set
+# CONFIG_WATCHDOG is not set
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
 
 #
 # Multifunction device drivers
@@ -963,14 +1020,14 @@ CONFIG_DAB=y
 #
 # Graphics support
 #
-CONFIG_BACKLIGHT_LCD_SUPPORT=y
-CONFIG_LCD_CLASS_DEVICE=m
-CONFIG_BACKLIGHT_CLASS_DEVICE=y
-
-#
-# Display device support
-#
-# CONFIG_DISPLAY_SUPPORT is not set
+# CONFIG_AGP is not set
+CONFIG_DRM=y
+# CONFIG_DRM_TDFX is not set
+# CONFIG_DRM_R128 is not set
+CONFIG_DRM_RADEON=y
+# CONFIG_DRM_MGA is not set
+# CONFIG_DRM_VIA is not set
+# CONFIG_DRM_SAVAGE is not set
 CONFIG_VGASTATE=y
 # CONFIG_VIDEO_OUTPUT_CONTROL is not set
 CONFIG_FB=y
@@ -979,6 +1036,7 @@ CONFIG_FB_DDC=y
 CONFIG_FB_CFB_FILLRECT=y
 CONFIG_FB_CFB_COPYAREA=y
 CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
 # CONFIG_FB_SYS_FILLRECT is not set
 # CONFIG_FB_SYS_COPYAREA is not set
 # CONFIG_FB_SYS_IMAGEBLIT is not set
@@ -1026,6 +1084,15 @@ CONFIG_FB_RADEON_BACKLIGHT=y
 # CONFIG_FB_PM3 is not set
 # CONFIG_FB_IBM_GXT4500 is not set
 # CONFIG_FB_VIRTUAL is not set
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+# CONFIG_LCD_CLASS_DEVICE is not set
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+# CONFIG_BACKLIGHT_CORGI is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
 
 #
 # Console display driver support
@@ -1178,6 +1245,7 @@ CONFIG_SND_USB_USX2Y=y
 CONFIG_HID_SUPPORT=y
 CONFIG_HID=y
 # CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
 
 #
 # USB Input Devices
@@ -1328,6 +1396,7 @@ CONFIG_RTC_INTF_DEV=y
 # I2C RTC drivers
 #
 CONFIG_RTC_DRV_DS1307=y
+# CONFIG_RTC_DRV_DS1374 is not set
 # CONFIG_RTC_DRV_DS1672 is not set
 # CONFIG_RTC_DRV_MAX6900 is not set
 # CONFIG_RTC_DRV_RS5C372 is not set
@@ -1356,19 +1425,6 @@ CONFIG_RTC_DRV_DS1307=y
 # on-CPU RTC drivers
 #
 
-#
-# DMA Engine support
-#
-# CONFIG_DMA_ENGINE is not set
-
-#
-# DMA Clients
-#
-
-#
-# DMA Devices
-#
-
 #
 # Userspace I/O
 #
@@ -1388,7 +1444,6 @@ CONFIG_EXT3_FS_XATTR=y
 # CONFIG_EXT3_FS_SECURITY is not set
 # CONFIG_EXT4DEV_FS is not set
 CONFIG_JBD=y
-# CONFIG_JBD_DEBUG is not set
 CONFIG_FS_MBCACHE=y
 # CONFIG_REISERFS_FS is not set
 # CONFIG_JFS_FS is not set
@@ -1436,7 +1491,6 @@ CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
 CONFIG_HUGETLBFS=y
 CONFIG_HUGETLB_PAGE=y
-CONFIG_RAMFS=y
 CONFIG_CONFIGFS_FS=y
 
 #
@@ -1449,30 +1503,43 @@ CONFIG_CONFIGFS_FS=y
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
-# CONFIG_JFFS2_FS is not set
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
+# CONFIG_JFFS2_SUMMARY is not set
+# CONFIG_JFFS2_FS_XATTR is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+# CONFIG_JFFS2_LZO is not set
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
 # CONFIG_HPFS_FS is not set
 # CONFIG_QNX4FS_FS is not set
 # CONFIG_SYSV_FS is not set
 # CONFIG_UFS_FS is not set
-
-#
-# Network File Systems
-#
+CONFIG_NETWORK_FILESYSTEMS=y
 CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 # CONFIG_NFS_V3_ACL is not set
 # CONFIG_NFS_V4 is not set
 # CONFIG_NFS_DIRECTIO is not set
-# CONFIG_NFSD is not set
+CONFIG_NFSD=y
+CONFIG_NFSD_V3=y
+# CONFIG_NFSD_V3_ACL is not set
+CONFIG_NFSD_V4=y
+CONFIG_NFSD_TCP=y
 CONFIG_ROOT_NFS=y
 CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=y
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
 # CONFIG_SUNRPC_BIND34 is not set
-# CONFIG_RPCSEC_GSS_KRB5 is not set
+CONFIG_RPCSEC_GSS_KRB5=y
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 # CONFIG_SMB_FS is not set
 # CONFIG_CIFS is not set
@@ -1501,10 +1568,6 @@ CONFIG_MSDOS_PARTITION=y
 # CONFIG_KARMA_PARTITION is not set
 # CONFIG_EFI_PARTITION is not set
 # CONFIG_SYSV68_PARTITION is not set
-
-#
-# Native Language Support
-#
 CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="iso8859-1"
 CONFIG_NLS_CODEPAGE_437=y
@@ -1545,10 +1608,6 @@ CONFIG_NLS_ISO8859_1=y
 # CONFIG_NLS_KOI8_R is not set
 # CONFIG_NLS_KOI8_U is not set
 # CONFIG_NLS_UTF8 is not set
-
-#
-# Distributed Lock Manager
-#
 # CONFIG_DLM is not set
 # CONFIG_UCC_SLOW is not set
 
@@ -1561,23 +1620,24 @@ CONFIG_CRC_CCITT=y
 # CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
 # CONFIG_CRC7 is not set
-# CONFIG_LIBCRC32C is not set
+CONFIG_LIBCRC32C=m
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
 CONFIG_PLIST=y
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT=y
 CONFIG_HAS_DMA=y
-
-#
-# Instrumentation Support
-#
+CONFIG_INSTRUMENTATION=y
 CONFIG_PROFILING=y
 CONFIG_OPROFILE=y
 # CONFIG_KPROBES is not set
+# CONFIG_MARKERS is not set
 
 #
 # Kernel hacking
 #
 # CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
 CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_UNUSED_SYMBOLS is not set
@@ -1586,7 +1646,7 @@ CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
 # CONFIG_DEBUG_SHIRQ is not set
 CONFIG_DETECT_SOFTLOCKUP=y
-CONFIG_SCHED_DEBUG=y
+# CONFIG_SCHED_DEBUG is not set
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_TIMER_STATS is not set
 # CONFIG_SLUB_DEBUG_ON is not set
@@ -1601,9 +1661,12 @@ CONFIG_DEBUG_BUGVERBOSE=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_DEBUG_VM is not set
 # CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
 # CONFIG_FORCED_INLINING is not set
+# CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_FAULT_INJECTION is not set
+# CONFIG_SAMPLES is not set
 # CONFIG_DEBUG_STACKOVERFLOW is not set
 # CONFIG_DEBUG_STACK_USAGE is not set
 # CONFIG_DEBUG_PAGEALLOC is not set
@@ -1620,6 +1683,7 @@ CONFIG_XMON_DISASSEMBLY=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_CRYPTO=y
 CONFIG_CRYPTO_ALGAPI=y
 CONFIG_CRYPTO_BLKCIPHER=y
@@ -1628,34 +1692,38 @@ CONFIG_CRYPTO_MANAGER=y
 CONFIG_CRYPTO_HMAC=y
 # CONFIG_CRYPTO_XCBC is not set
 # CONFIG_CRYPTO_NULL is not set
-# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD4=y
 CONFIG_CRYPTO_MD5=y
 CONFIG_CRYPTO_SHA1=y
-# CONFIG_CRYPTO_SHA256 is not set
-# CONFIG_CRYPTO_SHA512 is not set
+CONFIG_CRYPTO_SHA256=y
+CONFIG_CRYPTO_SHA512=y
 # CONFIG_CRYPTO_WP512 is not set
 # CONFIG_CRYPTO_TGR192 is not set
 # CONFIG_CRYPTO_GF128MUL is not set
-CONFIG_CRYPTO_ECB=m
+# CONFIG_CRYPTO_ECB is not set
 CONFIG_CRYPTO_CBC=y
-CONFIG_CRYPTO_PCBC=m
+# CONFIG_CRYPTO_PCBC is not set
 # CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_XTS is not set
 # CONFIG_CRYPTO_CRYPTD is not set
 CONFIG_CRYPTO_DES=y
 # CONFIG_CRYPTO_FCRYPT is not set
-# CONFIG_CRYPTO_BLOWFISH is not set
+CONFIG_CRYPTO_BLOWFISH=y
 # CONFIG_CRYPTO_TWOFISH is not set
 # CONFIG_CRYPTO_SERPENT is not set
-# CONFIG_CRYPTO_AES is not set
+CONFIG_CRYPTO_AES=y
 # CONFIG_CRYPTO_CAST5 is not set
 # CONFIG_CRYPTO_CAST6 is not set
 # CONFIG_CRYPTO_TEA is not set
 # CONFIG_CRYPTO_ARC4 is not set
 # CONFIG_CRYPTO_KHAZAD is not set
 # CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_SEED is not set
 # CONFIG_CRYPTO_DEFLATE is not set
 # CONFIG_CRYPTO_MICHAEL_MIC is not set
 # CONFIG_CRYPTO_CRC32C is not set
 # CONFIG_CRYPTO_CAMELLIA is not set
 # CONFIG_CRYPTO_TEST is not set
-# CONFIG_CRYPTO_HW is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+CONFIG_CRYPTO_HW=y
+# CONFIG_PPC_CLOCK is not set
index 05582af50c5beb8c45494b18c916b5848ac88678..3e90c835fe12ad21a3938720d18fff5509e6d007 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.23-rc4
-# Thu Aug 30 16:47:09 2007
+# Linux kernel version: 2.6.24-rc2
+# Tue Nov  6 23:43:56 2007
 #
 CONFIG_PPC64=y
 
@@ -11,6 +11,7 @@ CONFIG_PPC64=y
 # CONFIG_POWER4_ONLY is not set
 CONFIG_POWER3=y
 CONFIG_POWER4=y
+# CONFIG_TUNE_CELL is not set
 CONFIG_PPC_FPU=y
 CONFIG_ALTIVEC=y
 CONFIG_PPC_STD_MMU=y
@@ -19,8 +20,13 @@ CONFIG_VIRT_CPU_ACCOUNTING=y
 CONFIG_SMP=y
 CONFIG_NR_CPUS=32
 CONFIG_64BIT=y
+CONFIG_WORD_SIZE=64
 CONFIG_PPC_MERGE=y
 CONFIG_MMU=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_IRQ_PER_CPU=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
@@ -72,8 +78,15 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=17
 CONFIG_CGROUPS=y
+# CONFIG_CGROUP_DEBUG is not set
+# CONFIG_CGROUP_NS is not set
+# CONFIG_CGROUP_CPUACCT is not set
 CONFIG_CPUSETS=y
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FAIR_USER_SCHED=y
+# CONFIG_FAIR_CGROUP_SCHED is not set
 CONFIG_SYSFS_DEPRECATED=y
+CONFIG_PROC_PID_CPUSET=y
 CONFIG_RELAY=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_INITRAMFS_SOURCE=""
@@ -93,7 +106,6 @@ CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
 CONFIG_EPOLL=y
 CONFIG_SIGNALFD=y
-CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
 CONFIG_VM_EVENT_COUNTERS=y
@@ -114,6 +126,7 @@ CONFIG_STOP_MACHINE=y
 CONFIG_BLOCK=y
 CONFIG_BLK_DEV_IO_TRACE=y
 CONFIG_BLK_DEV_BSG=y
+CONFIG_BLOCK_COMPAT=y
 
 #
 # IO Schedulers
@@ -132,7 +145,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
 # Platform support
 #
 CONFIG_PPC_MULTIPLATFORM=y
-# CONFIG_EMBEDDED6xx is not set
 # CONFIG_PPC_82xx is not set
 # CONFIG_PPC_83xx is not set
 # CONFIG_PPC_86xx is not set
@@ -155,7 +167,15 @@ CONFIG_VIOPATH=y
 CONFIG_PPC_PMAC=y
 CONFIG_PPC_PMAC64=y
 CONFIG_PPC_MAPLE=y
-# CONFIG_PPC_PASEMI is not set
+CONFIG_PPC_PASEMI=y
+
+#
+# PA Semi PWRficient options
+#
+CONFIG_PPC_PASEMI_IOMMU=y
+# CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE is not set
+CONFIG_PPC_PASEMI_MDIO=y
+CONFIG_ELECTRA_IDE=y
 CONFIG_PPC_CELLEB=y
 # CONFIG_PPC_PS3 is not set
 CONFIG_PPC_CELL=y
@@ -188,6 +208,7 @@ CONFIG_RTAS_FLASH=m
 CONFIG_PPC_PMI=m
 CONFIG_MMIO_NVRAM=y
 CONFIG_MPIC_U3_HT_IRQS=y
+CONFIG_MPIC_BROKEN_REGREAD=y
 CONFIG_IBMVIO=y
 # CONFIG_IBMEBUS is not set
 # CONFIG_PPC_MPC106 is not set
@@ -201,6 +222,8 @@ CONFIG_CPU_FREQ_STAT=y
 # CONFIG_CPU_FREQ_STAT_DETAILS is not set
 CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
 # CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
 CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
 CONFIG_CPU_FREQ_GOV_POWERSAVE=y
 CONFIG_CPU_FREQ_GOV_USERSPACE=y
@@ -211,6 +234,7 @@ CONFIG_CPU_FREQ_GOV_USERSPACE=y
 # CPU Frequency drivers
 #
 CONFIG_CPU_FREQ_PMAC64=y
+CONFIG_PPC_PASEMI_CPUFREQ=y
 # CONFIG_CPM2 is not set
 CONFIG_AXON_RAM=m
 # CONFIG_FSL_ULI1575 is not set
@@ -254,6 +278,8 @@ CONFIG_SPARSEMEM=y
 CONFIG_HAVE_MEMORY_PRESENT=y
 # CONFIG_SPARSEMEM_STATIC is not set
 CONFIG_SPARSEMEM_EXTREME=y
+CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
+CONFIG_SPARSEMEM_VMEMMAP=y
 CONFIG_MEMORY_HOTPLUG=y
 CONFIG_MEMORY_HOTPLUG_SPARSE=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
@@ -268,6 +294,7 @@ CONFIG_PROC_DEVICETREE=y
 # CONFIG_CMDLINE_BOOL is not set
 # CONFIG_PM is not set
 CONFIG_SUSPEND_SMP_POSSIBLE=y
+CONFIG_HIBERNATION_SMP_POSSIBLE=y
 CONFIG_SECCOMP=y
 # CONFIG_WANT_DEVICE_TREE is not set
 CONFIG_ISA_DMA_API=y
@@ -284,12 +311,22 @@ CONFIG_PCI_SYSCALL=y
 # CONFIG_PCIEPORTBUS is not set
 CONFIG_ARCH_SUPPORTS_MSI=y
 CONFIG_PCI_MSI=y
+CONFIG_PCI_LEGACY=y
 # CONFIG_PCI_DEBUG is not set
+CONFIG_PCCARD=y
+# CONFIG_PCMCIA_DEBUG is not set
+CONFIG_PCMCIA=y
+CONFIG_PCMCIA_LOAD_CIS=y
+CONFIG_PCMCIA_IOCTL=y
+CONFIG_CARDBUS=y
 
 #
-# PCCARD (PCMCIA/CardBus) support
+# PC-card bridges
 #
-# CONFIG_PCCARD is not set
+# CONFIG_YENTA is not set
+# CONFIG_PD6729 is not set
+# CONFIG_I82092 is not set
+CONFIG_ELECTRA_CF=y
 CONFIG_HOTPLUG_PCI=m
 # CONFIG_HOTPLUG_PCI_FAKE is not set
 # CONFIG_HOTPLUG_PCI_CPCI is not set
@@ -319,7 +356,10 @@ CONFIG_INET=y
 CONFIG_IP_MULTICAST=y
 # CONFIG_IP_ADVANCED_ROUTER is not set
 CONFIG_IP_FIB_HASH=y
-# CONFIG_IP_PNP is not set
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
 CONFIG_NET_IPIP=y
 # CONFIG_NET_IPGRE is not set
 # CONFIG_IP_MROUTE is not set
@@ -333,6 +373,7 @@ CONFIG_INET_TUNNEL=y
 CONFIG_INET_XFRM_MODE_TRANSPORT=y
 CONFIG_INET_XFRM_MODE_TUNNEL=y
 CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
@@ -404,6 +445,7 @@ CONFIG_NETFILTER_XT_MATCH_STATE=m
 CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
 CONFIG_NETFILTER_XT_MATCH_STRING=m
 CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
+# CONFIG_NETFILTER_XT_MATCH_TIME is not set
 CONFIG_NETFILTER_XT_MATCH_U32=m
 CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
 
@@ -465,10 +507,6 @@ CONFIG_LLC=y
 # CONFIG_LAPB is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
-
-#
-# QoS and/or fair queueing
-#
 # CONFIG_NET_SCHED is not set
 CONFIG_NET_CLS_ROUTE=y
 
@@ -498,6 +536,7 @@ CONFIG_NET_CLS_ROUTE=y
 #
 # Generic Driver Options
 #
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
@@ -539,6 +578,8 @@ CONFIG_BLK_DEV_IDE=y
 # CONFIG_BLK_DEV_IDE_SATA is not set
 CONFIG_BLK_DEV_IDEDISK=y
 # CONFIG_IDEDISK_MULTI_MODE is not set
+# CONFIG_BLK_DEV_IDECS is not set
+# CONFIG_BLK_DEV_DELKIN is not set
 CONFIG_BLK_DEV_IDECD=y
 # CONFIG_BLK_DEV_IDETAPE is not set
 # CONFIG_BLK_DEV_IDEFLOPPY is not set
@@ -550,6 +591,11 @@ CONFIG_IDE_PROC_FS=y
 # IDE chipset support/bugfixes
 #
 CONFIG_IDE_GENERIC=y
+# CONFIG_BLK_DEV_PLATFORM is not set
+
+#
+# PCI IDE chipsets support
+#
 CONFIG_BLK_DEV_IDEPCI=y
 CONFIG_IDEPCI_SHARE_IRQ=y
 CONFIG_IDEPCI_PCIBUS_ORDER=y
@@ -557,8 +603,6 @@ CONFIG_IDEPCI_PCIBUS_ORDER=y
 CONFIG_BLK_DEV_GENERIC=y
 # CONFIG_BLK_DEV_OPTI621 is not set
 CONFIG_BLK_DEV_IDEDMA_PCI=y
-# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
-# CONFIG_IDEDMA_ONLYDISK is not set
 # CONFIG_BLK_DEV_AEC62XX is not set
 # CONFIG_BLK_DEV_ALI15X3 is not set
 CONFIG_BLK_DEV_AMD74XX=y
@@ -590,7 +634,7 @@ CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST=y
 CONFIG_BLK_DEV_IDEDMA_PMAC=y
 # CONFIG_IDE_ARM is not set
 CONFIG_BLK_DEV_IDEDMA=y
-# CONFIG_IDEDMA_IVB is not set
+CONFIG_IDE_ARCH_OBSOLETE_INIT=y
 # CONFIG_BLK_DEV_HD is not set
 
 #
@@ -631,6 +675,7 @@ CONFIG_SCSI_FC_ATTRS=y
 CONFIG_SCSI_ISCSI_ATTRS=m
 # CONFIG_SCSI_SAS_ATTRS is not set
 # CONFIG_SCSI_SAS_LIBSAS is not set
+CONFIG_SCSI_SRP_ATTRS=y
 CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_ISCSI_TCP is not set
 # CONFIG_BLK_DEV_3W_XXXX_RAID is not set
@@ -671,19 +716,20 @@ CONFIG_SCSI_LPFC=m
 # CONFIG_SCSI_DC390T is not set
 CONFIG_SCSI_DEBUG=m
 # CONFIG_SCSI_SRP is not set
+# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
 CONFIG_ATA=y
 CONFIG_ATA_NONSTANDARD=y
 # CONFIG_SATA_AHCI is not set
 CONFIG_SATA_SVW=y
 # CONFIG_ATA_PIIX is not set
-# CONFIG_SATA_MV is not set
+CONFIG_SATA_MV=y
 # CONFIG_SATA_NV is not set
 # CONFIG_PDC_ADMA is not set
 # CONFIG_SATA_QSTOR is not set
 # CONFIG_SATA_PROMISE is not set
 # CONFIG_SATA_SX4 is not set
 # CONFIG_SATA_SIL is not set
-# CONFIG_SATA_SIL24 is not set
+CONFIG_SATA_SIL24=y
 # CONFIG_SATA_SIS is not set
 # CONFIG_SATA_ULI is not set
 # CONFIG_SATA_VIA is not set
@@ -713,8 +759,10 @@ CONFIG_SATA_SVW=y
 # CONFIG_PATA_OLDPIIX is not set
 # CONFIG_PATA_NETCELL is not set
 # CONFIG_PATA_NS87410 is not set
+# CONFIG_PATA_NS87415 is not set
 # CONFIG_PATA_OPTI is not set
 # CONFIG_PATA_OPTIDMA is not set
+CONFIG_PATA_PCMCIA=y
 # CONFIG_PATA_PDC_OLD is not set
 # CONFIG_PATA_RADISYS is not set
 # CONFIG_PATA_RZ1000 is not set
@@ -725,6 +773,7 @@ CONFIG_SATA_SVW=y
 # CONFIG_PATA_SIS is not set
 # CONFIG_PATA_VIA is not set
 CONFIG_PATA_WINBOND=y
+CONFIG_PATA_PLATFORM=y
 CONFIG_PATA_SCC=y
 CONFIG_MD=y
 CONFIG_BLK_DEV_MD=y
@@ -745,15 +794,10 @@ CONFIG_DM_ZERO=m
 CONFIG_DM_MULTIPATH=m
 CONFIG_DM_MULTIPATH_EMC=m
 # CONFIG_DM_MULTIPATH_RDAC is not set
+# CONFIG_DM_MULTIPATH_HP is not set
 # CONFIG_DM_DELAY is not set
-
-#
-# Fusion MPT device support
-#
+# CONFIG_DM_UEVENT is not set
 # CONFIG_FUSION is not set
-# CONFIG_FUSION_SPI is not set
-# CONFIG_FUSION_FC is not set
-# CONFIG_FUSION_SAS is not set
 
 #
 # IEEE 1394 (FireWire) support
@@ -800,13 +844,15 @@ CONFIG_BONDING=m
 # CONFIG_MACVLAN is not set
 # CONFIG_EQUALIZER is not set
 CONFIG_TUN=m
+# CONFIG_VETH is not set
+# CONFIG_IP1000 is not set
 # CONFIG_ARCNET is not set
-CONFIG_PHYLIB=m
+CONFIG_PHYLIB=y
 
 #
 # MII PHY device drivers
 #
-CONFIG_MARVELL_PHY=m
+CONFIG_MARVELL_PHY=y
 # CONFIG_DAVICOM_PHY is not set
 # CONFIG_QSEMI_PHY is not set
 # CONFIG_LXT_PHY is not set
@@ -818,6 +864,9 @@ CONFIG_BROADCOM_PHY=m
 CONFIG_FIXED_PHY=m
 CONFIG_FIXED_MII_10_FDX=y
 CONFIG_FIXED_MII_100_FDX=y
+# CONFIG_FIXED_MII_1000_FDX is not set
+CONFIG_FIXED_MII_AMNT=1
+# CONFIG_MDIO_BITBANG is not set
 CONFIG_NET_ETHERNET=y
 CONFIG_MII=y
 # CONFIG_HAPPYMEAL is not set
@@ -829,6 +878,11 @@ CONFIG_VORTEX=y
 # CONFIG_NET_TULIP is not set
 # CONFIG_HP100 is not set
 CONFIG_IBMVETH=m
+# CONFIG_IBM_NEW_EMAC is not set
+CONFIG_IBM_NEW_EMAC_ZMII=y
+CONFIG_IBM_NEW_EMAC_RGMII=y
+CONFIG_IBM_NEW_EMAC_TAH=y
+CONFIG_IBM_NEW_EMAC_EMAC4=y
 CONFIG_NET_PCI=y
 CONFIG_PCNET32=y
 # CONFIG_PCNET32_NAPI is not set
@@ -836,7 +890,6 @@ CONFIG_PCNET32=y
 # CONFIG_ADAPTEC_STARFIRE is not set
 # CONFIG_B44 is not set
 # CONFIG_FORCEDETH is not set
-# CONFIG_DGRS is not set
 # CONFIG_EEPRO100 is not set
 CONFIG_E100=y
 # CONFIG_FEALNX is not set
@@ -856,6 +909,7 @@ CONFIG_ACENIC_OMIT_TIGON_I=y
 CONFIG_E1000=y
 # CONFIG_E1000_NAPI is not set
 # CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
+# CONFIG_E1000E is not set
 # CONFIG_NS83820 is not set
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
@@ -863,6 +917,7 @@ CONFIG_E1000=y
 # CONFIG_SIS190 is not set
 # CONFIG_SKGE is not set
 # CONFIG_SKY2 is not set
+# CONFIG_SK98LIN is not set
 # CONFIG_VIA_VELOCITY is not set
 CONFIG_TIGON3=y
 # CONFIG_BNX2 is not set
@@ -872,13 +927,16 @@ CONFIG_SPIDER_NET=m
 CONFIG_NETDEV_10000=y
 # CONFIG_CHELSIO_T1 is not set
 # CONFIG_CHELSIO_T3 is not set
+# CONFIG_IXGBE is not set
 CONFIG_IXGB=m
 # CONFIG_IXGB_NAPI is not set
 # CONFIG_S2IO is not set
 # CONFIG_MYRI10GE is not set
 # CONFIG_NETXEN_NIC is not set
-CONFIG_PASEMI_MAC=m
+# CONFIG_NIU is not set
+CONFIG_PASEMI_MAC=y
 # CONFIG_MLX4_CORE is not set
+# CONFIG_TEHUTI is not set
 CONFIG_TR=y
 CONFIG_IBMOL=y
 # CONFIG_3C359 is not set
@@ -899,6 +957,7 @@ CONFIG_IBMOL=y
 # CONFIG_USB_RTL8150 is not set
 # CONFIG_USB_USBNET_MII is not set
 # CONFIG_USB_USBNET is not set
+# CONFIG_NET_PCMCIA is not set
 # CONFIG_WAN is not set
 CONFIG_ISERIES_VETH=m
 # CONFIG_FDDI is not set
@@ -918,6 +977,7 @@ CONFIG_SLHC=m
 # CONFIG_NET_FC is not set
 # CONFIG_SHAPER is not set
 CONFIG_NETCONSOLE=y
+# CONFIG_NETCONSOLE_DYNAMIC is not set
 CONFIG_NETPOLL=y
 CONFIG_NETPOLL_TRAP=y
 CONFIG_NET_POLL_CONTROLLER=y
@@ -939,7 +999,6 @@ CONFIG_INPUT_MOUSEDEV=y
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
 CONFIG_INPUT_EVDEV=m
 # CONFIG_INPUT_EVBUG is not set
 
@@ -1002,6 +1061,7 @@ CONFIG_HW_CONSOLE=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_PCI=y
+# CONFIG_SERIAL_8250_CS is not set
 CONFIG_SERIAL_8250_NR_UARTS=4
 CONFIG_SERIAL_8250_RUNTIME_UARTS=4
 # CONFIG_SERIAL_8250_EXTENDED is not set
@@ -1029,14 +1089,18 @@ CONFIG_HVC_RTAS=y
 CONFIG_HVC_BEAT=y
 CONFIG_HVCS=m
 # CONFIG_IPMI_HANDLER is not set
-# CONFIG_WATCHDOG is not set
 # CONFIG_HW_RANDOM is not set
 CONFIG_GEN_RTC=y
 # CONFIG_GEN_RTC_X is not set
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
-# CONFIG_AGP is not set
-# CONFIG_DRM is not set
+
+#
+# PCMCIA character devices
+#
+# CONFIG_SYNCLINK_CS is not set
+# CONFIG_CARDMAN_4000 is not set
+# CONFIG_CARDMAN_4040 is not set
 CONFIG_RAW_DRIVER=y
 CONFIG_MAX_RAW_DEVS=256
 # CONFIG_HANGCHECK_TIMER is not set
@@ -1068,6 +1132,7 @@ CONFIG_I2C_POWERMAC=y
 # CONFIG_I2C_NFORCE2 is not set
 # CONFIG_I2C_OCORES is not set
 # CONFIG_I2C_PARPORT_LIGHT is not set
+CONFIG_I2C_PASEMI=y
 # CONFIG_I2C_PROSAVAGE is not set
 # CONFIG_I2C_SAVAGE4 is not set
 # CONFIG_I2C_SIMTEC is not set
@@ -1106,6 +1171,13 @@ CONFIG_I2C_POWERMAC=y
 # CONFIG_W1 is not set
 # CONFIG_POWER_SUPPLY is not set
 # CONFIG_HWMON is not set
+# CONFIG_WATCHDOG is not set
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
 
 #
 # Multifunction device drivers
@@ -1122,18 +1194,8 @@ CONFIG_I2C_POWERMAC=y
 #
 # Graphics support
 #
-CONFIG_BACKLIGHT_LCD_SUPPORT=y
-CONFIG_LCD_CLASS_DEVICE=y
-CONFIG_BACKLIGHT_CLASS_DEVICE=y
-
-#
-# Display device support
-#
-CONFIG_DISPLAY_SUPPORT=y
-
-#
-# Display hardware drivers
-#
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
 # CONFIG_VGASTATE is not set
 CONFIG_VIDEO_OUTPUT_CONTROL=m
 CONFIG_FB=y
@@ -1142,6 +1204,7 @@ CONFIG_FB_DDC=y
 CONFIG_FB_CFB_FILLRECT=y
 CONFIG_FB_CFB_COPYAREA=y
 CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
 # CONFIG_FB_SYS_FILLRECT is not set
 # CONFIG_FB_SYS_COPYAREA is not set
 # CONFIG_FB_SYS_IMAGEBLIT is not set
@@ -1192,6 +1255,19 @@ CONFIG_FB_RADEON_BACKLIGHT=y
 # CONFIG_FB_PM3 is not set
 CONFIG_FB_IBM_GXT4500=y
 # CONFIG_FB_VIRTUAL is not set
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CLASS_DEVICE=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+# CONFIG_BACKLIGHT_CORGI is not set
+
+#
+# Display device support
+#
+CONFIG_DISPLAY_SUPPORT=y
+
+#
+# Display hardware drivers
+#
 
 #
 # Console display driver support
@@ -1332,6 +1408,12 @@ CONFIG_SND_AOA_SOUNDBUS_I2S=m
 # CONFIG_SND_USB_USX2Y is not set
 # CONFIG_SND_USB_CAIAQ is not set
 
+#
+# PCMCIA devices
+#
+# CONFIG_SND_VXPOCKET is not set
+# CONFIG_SND_PDAUDIOCF is not set
+
 #
 # System on Chip audio support
 #
@@ -1348,6 +1430,7 @@ CONFIG_SND_AOA_SOUNDBUS_I2S=m
 CONFIG_HID_SUPPORT=y
 CONFIG_HID=y
 # CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
 
 #
 # USB Input Devices
@@ -1489,19 +1572,53 @@ CONFIG_EDAC=y
 #
 # CONFIG_EDAC_DEBUG is not set
 CONFIG_EDAC_MM_EDAC=y
-# CONFIG_RTC_CLASS is not set
+CONFIG_EDAC_PASEMI=y
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+# CONFIG_RTC_DEBUG is not set
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+CONFIG_RTC_DRV_DS1307=y
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# CONFIG_RTC_DRV_X1205 is not set
+# CONFIG_RTC_DRV_PCF8563 is not set
+# CONFIG_RTC_DRV_PCF8583 is not set
+# CONFIG_RTC_DRV_M41T80 is not set
 
 #
-# DMA Engine support
+# SPI RTC drivers
 #
-# CONFIG_DMA_ENGINE is not set
 
 #
-# DMA Clients
+# Platform RTC drivers
 #
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_V3020 is not set
 
 #
-# DMA Devices
+# on-CPU RTC drivers
 #
 
 #
@@ -1585,7 +1702,6 @@ CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
 CONFIG_HUGETLBFS=y
 CONFIG_HUGETLB_PAGE=y
-CONFIG_RAMFS=y
 # CONFIG_CONFIGFS_FS is not set
 
 #
@@ -1604,10 +1720,7 @@ CONFIG_CRAMFS=y
 # CONFIG_QNX4FS_FS is not set
 # CONFIG_SYSV_FS is not set
 # CONFIG_UFS_FS is not set
-
-#
-# Network File Systems
-#
+CONFIG_NETWORK_FILESYSTEMS=y
 CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 CONFIG_NFS_V3_ACL=y
@@ -1619,6 +1732,7 @@ CONFIG_NFSD_V3=y
 CONFIG_NFSD_V3_ACL=y
 CONFIG_NFSD_V4=y
 CONFIG_NFSD_TCP=y
+CONFIG_ROOT_NFS=y
 CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
 CONFIG_EXPORTFS=m
@@ -1626,6 +1740,7 @@ CONFIG_NFS_ACL_SUPPORT=y
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=y
 CONFIG_SUNRPC_GSS=y
+CONFIG_SUNRPC_XPRT_RDMA=m
 # CONFIG_SUNRPC_BIND34 is not set
 CONFIG_RPCSEC_GSS_KRB5=y
 CONFIG_RPCSEC_GSS_SPKM3=m
@@ -1662,10 +1777,6 @@ CONFIG_MSDOS_PARTITION=y
 # CONFIG_KARMA_PARTITION is not set
 # CONFIG_EFI_PARTITION is not set
 # CONFIG_SYSV68_PARTITION is not set
-
-#
-# Native Language Support
-#
 CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="iso8859-1"
 CONFIG_NLS_CODEPAGE_437=y
@@ -1706,10 +1817,6 @@ CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_KOI8_R=m
 CONFIG_NLS_KOI8_U=m
 CONFIG_NLS_UTF8=m
-
-#
-# Distributed Lock Manager
-#
 # CONFIG_DLM is not set
 # CONFIG_UCC_SLOW is not set
 
@@ -1733,18 +1840,17 @@ CONFIG_PLIST=y
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT=y
 CONFIG_HAS_DMA=y
-
-#
-# Instrumentation Support
-#
+CONFIG_INSTRUMENTATION=y
 CONFIG_PROFILING=y
 CONFIG_OPROFILE=y
 # CONFIG_KPROBES is not set
+# CONFIG_MARKERS is not set
 
 #
 # Kernel hacking
 #
 # CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
 CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_UNUSED_SYMBOLS is not set
@@ -1768,9 +1874,12 @@ CONFIG_DEBUG_BUGVERBOSE=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_DEBUG_VM is not set
 # CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
 CONFIG_FORCED_INLINING=y
+# CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_FAULT_INJECTION is not set
+# CONFIG_SAMPLES is not set
 CONFIG_DEBUG_STACKOVERFLOW=y
 CONFIG_DEBUG_STACK_USAGE=y
 # CONFIG_DEBUG_PAGEALLOC is not set
@@ -1780,6 +1889,7 @@ CONFIG_XMON=y
 # CONFIG_XMON_DEFAULT is not set
 CONFIG_XMON_DISASSEMBLY=y
 CONFIG_IRQSTACKS=y
+# CONFIG_VIRQ_DEBUG is not set
 CONFIG_BOOTX_TEXT=y
 # CONFIG_PPC_EARLY_DEBUG is not set
 
@@ -1788,6 +1898,7 @@ CONFIG_BOOTX_TEXT=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_XOR_BLOCKS=y
 CONFIG_ASYNC_CORE=y
 CONFIG_ASYNC_MEMCPY=y
@@ -1812,6 +1923,7 @@ CONFIG_CRYPTO_ECB=m
 CONFIG_CRYPTO_CBC=y
 CONFIG_CRYPTO_PCBC=m
 # CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_XTS is not set
 # CONFIG_CRYPTO_CRYPTD is not set
 CONFIG_CRYPTO_DES=y
 # CONFIG_CRYPTO_FCRYPT is not set
@@ -1826,9 +1938,12 @@ CONFIG_CRYPTO_TEA=m
 CONFIG_CRYPTO_ARC4=m
 CONFIG_CRYPTO_KHAZAD=m
 CONFIG_CRYPTO_ANUBIS=m
+# CONFIG_CRYPTO_SEED is not set
 CONFIG_CRYPTO_DEFLATE=m
 CONFIG_CRYPTO_MICHAEL_MIC=m
 CONFIG_CRYPTO_CRC32C=m
 # CONFIG_CRYPTO_CAMELLIA is not set
 CONFIG_CRYPTO_TEST=m
+# CONFIG_CRYPTO_AUTHENC is not set
 # CONFIG_CRYPTO_HW is not set
+# CONFIG_PPC_CLOCK is not set
index 2c8e756d19a39846db6f9c986dcce7ebbd099c39..d67bcd84f32966b50e9745cb847d092dee415556 100644 (file)
@@ -284,6 +284,10 @@ int main(void)
        DEFINE(CFG_SYSCALL_MAP32, offsetof(struct vdso_data, syscall_map_32));
        DEFINE(WTOM_CLOCK_SEC, offsetof(struct vdso_data, wtom_clock_sec));
        DEFINE(WTOM_CLOCK_NSEC, offsetof(struct vdso_data, wtom_clock_nsec));
+       DEFINE(CFG_ICACHE_BLOCKSZ, offsetof(struct vdso_data, icache_block_size));
+       DEFINE(CFG_DCACHE_BLOCKSZ, offsetof(struct vdso_data, dcache_block_size));
+       DEFINE(CFG_ICACHE_LOGBLOCKSZ, offsetof(struct vdso_data, icache_log_block_size));
+       DEFINE(CFG_DCACHE_LOGBLOCKSZ, offsetof(struct vdso_data, dcache_log_block_size));
 #ifdef CONFIG_PPC64
        DEFINE(CFG_SYSCALL_MAP64, offsetof(struct vdso_data, syscall_map_64));
        DEFINE(TVAL64_TV_SEC, offsetof(struct timeval, tv_sec));
index 3ef51fb6f107a57d3ca82f4c18ddfd84f689ce3a..9c74fdf29eeccc8f5c56adb7b1a5c98fc09a21e3 100644 (file)
@@ -186,7 +186,9 @@ int btext_initialize(struct device_node *np)
                pitch = *prop;
        if (pitch == 1)
                pitch = 0x1000;
-       prop = of_get_property(np, "address", NULL);
+       prop = of_get_property(np, "linux,bootx-addr", NULL);
+       if (prop == NULL)
+               prop = of_get_property(np, "address", NULL);
        if (prop)
                address = *prop;
 
index d3fb7d0c6c1c255b3569dc845a671962d0e5393f..9ed351f3c96625dd6e4862cb7c40bc5d1393a8bd 100644 (file)
@@ -1104,6 +1104,16 @@ static struct cpu_spec __initdata cpu_specs[] = {
        {
                .pvr_mask               = 0xf0000fff,
                .pvr_value              = 0x40000850,
+               .cpu_name               = "440GR Rev. A",
+               .cpu_features           = CPU_FTRS_44X,
+               .cpu_user_features      = COMMON_USER_BOOKE,
+               .icache_bsize           = 32,
+               .dcache_bsize           = 32,
+               .platform               = "ppc440",
+       },
+       { /* Use logical PVR for 440EP (logical pvr = pvr | 0x8) */
+               .pvr_mask               = 0xf0000fff,
+               .pvr_value              = 0x40000858,
                .cpu_name               = "440EP Rev. A",
                .cpu_features           = CPU_FTRS_44X,
                .cpu_user_features      = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
@@ -1115,28 +1125,27 @@ static struct cpu_spec __initdata cpu_specs[] = {
        {
                .pvr_mask               = 0xf0000fff,
                .pvr_value              = 0x400008d3,
-               .cpu_name               = "440EP Rev. B",
+               .cpu_name               = "440GR Rev. B",
                .cpu_features           = CPU_FTRS_44X,
                .cpu_user_features      = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
-               .cpu_setup              = __setup_cpu_440ep,
                .platform               = "ppc440",
        },
-       { /* 440EPX */
-               .pvr_mask               = 0xf0000ffb,
-               .pvr_value              = 0x200008D0,
-               .cpu_name               = "440EPX",
+       { /* Use logical PVR for 440EP (logical pvr = pvr | 0x8) */
+               .pvr_mask               = 0xf0000fff,
+               .pvr_value              = 0x400008db,
+               .cpu_name               = "440EP Rev. B",
                .cpu_features           = CPU_FTRS_44X,
                .cpu_user_features      = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
-               .cpu_setup              = __setup_cpu_440epx,
+               .cpu_setup              = __setup_cpu_440ep,
                .platform               = "ppc440",
        },
        { /* 440GRX */
                .pvr_mask               = 0xf0000ffb,
-               .pvr_value              = 0x200008D8,
+               .pvr_value              = 0x200008D0,
                .cpu_name               = "440GRX",
                .cpu_features           = CPU_FTRS_44X,
                .cpu_user_features      = COMMON_USER_BOOKE,
@@ -1145,6 +1154,17 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .cpu_setup              = __setup_cpu_440grx,
                .platform               = "ppc440",
        },
+       { /* Use logical PVR for 440EPx (logical pvr = pvr | 0x8) */
+               .pvr_mask               = 0xf0000ffb,
+               .pvr_value              = 0x200008D8,
+               .cpu_name               = "440EPX",
+               .cpu_features           = CPU_FTRS_44X,
+               .cpu_user_features      = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
+               .icache_bsize           = 32,
+               .dcache_bsize           = 32,
+               .cpu_setup              = __setup_cpu_440epx,
+               .platform               = "ppc440",
+       },
        {       /* 440GP Rev. B */
                .pvr_mask               = 0xf0000fff,
                .pvr_value              = 0x40000440,
index 21d889e63e87520d9e49112a99d20fc8d887da90..69a91bd46115e171bb73cf76282db673ce5d054e 100644 (file)
@@ -244,6 +244,16 @@ syscall_exit_cont:
        andis.  r10,r0,DBCR0_IC@h
        bnel-   load_dbcr0
 #endif
+#ifdef CONFIG_44x
+       lis     r4,icache_44x_need_flush@ha
+       lwz     r5,icache_44x_need_flush@l(r4)
+       cmplwi  cr0,r5,0
+       bne-    2f
+1:
+#endif /* CONFIG_44x */
+BEGIN_FTR_SECTION
+       lwarx   r7,0,r1
+END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX)
        stwcx.  r0,0,r1                 /* to clear the reservation */
        lwz     r4,_LINK(r1)
        lwz     r5,_CCR(r1)
@@ -258,6 +268,12 @@ syscall_exit_cont:
        mtspr   SPRN_SRR1,r8
        SYNC
        RFI
+#ifdef CONFIG_44x
+2:     li      r7,0
+       iccci   r0,r0
+       stw     r7,icache_44x_need_flush@l(r4)
+       b       1b
+#endif  /* CONFIG_44x */
 
 66:    li      r3,-ENOSYS
        b       ret_from_syscall
@@ -683,6 +699,16 @@ resume_kernel:
 
        /* interrupts are hard-disabled at this point */
 restore:
+#ifdef CONFIG_44x
+       lis     r4,icache_44x_need_flush@ha
+       lwz     r5,icache_44x_need_flush@l(r4)
+       cmplwi  cr0,r5,0
+       beq+    1f
+       li      r6,0
+       iccci   r0,r0
+       stw     r6,icache_44x_need_flush@l(r4)
+1:
+#endif  /* CONFIG_44x */
        lwz     r0,GPR0(r1)
        lwz     r2,GPR2(r1)
        REST_4GPRS(3, r1)
@@ -694,6 +720,9 @@ restore:
        mtctr   r11
 
        PPC405_ERR77(0,r1)
+BEGIN_FTR_SECTION
+       lwarx   r11,0,r1
+END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX)
        stwcx.  r0,0,r1                 /* to clear the reservation */
 
 #if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE))
index 97c5857faf00d830d3022fdc4bd99caeefaed974..c34986835a4e6f80593ed4588b0bf681f5628c9c 100644 (file)
@@ -904,7 +904,7 @@ handle_page_fault:
  */
 12:    bl      .save_nvgprs
        addi    r3,r1,STACK_FRAME_OVERHEAD
-       lwz     r4,_DAR(r1)
+       l     r4,_DAR(r1)
        bl      .low_hash_fault
        b       .ret_from_except
 
index abd2957fe5378ba59c4ccf6c58a9ecdd6f892798..c3cf0e8f3ac173332a01148946ace8c43f45a5a5 100644 (file)
@@ -122,7 +122,7 @@ static ctl_table powersave_nap_sysctl_root[] = {
        {
                .ctl_name       = CTL_KERN,
                .procname       = "kernel",
-               .mode           = 0755,
+               .mode           = 0555,
                .child          = powersave_nap_ctl_table,
        },
        {}
index 8533de50347d5284b23cbe0538673ba74b6b95fe..8b642ab26d3767c23205125b1022dcad45964efd 100644 (file)
@@ -288,7 +288,16 @@ _GLOBAL(_tlbia)
  */
 _GLOBAL(_tlbie)
 #if defined(CONFIG_40x)
+       /* We run the search with interrupts disabled because we have to change
+        * the PID and I don't want to preempt when that happens.
+        */
+       mfmsr   r5
+       mfspr   r6,SPRN_PID
+       wrteei  0
+       mtspr   SPRN_PID,r4
        tlbsx.  r3, 0, r3
+       mtspr   SPRN_PID,r6
+       wrtee   r5
        bne     10f
        sync
        /* There are only 64 TLB entries, so r3 < 64, which means bit 25 is clear.
@@ -297,23 +306,23 @@ _GLOBAL(_tlbie)
        tlbwe   r3, r3, TLB_TAG
        isync
 10:
+
 #elif defined(CONFIG_44x)
-       mfspr   r4,SPRN_MMUCR
-       mfspr   r5,SPRN_PID                     /* Get PID */
-       rlwimi  r4,r5,0,24,31                   /* Set TID */
+       mfspr   r5,SPRN_MMUCR
+       rlwimi  r5,r4,0,24,31                   /* Set TID */
 
        /* We have to run the search with interrupts disabled, even critical
         * and debug interrupts (in fact the only critical exceptions we have
         * are debug and machine check).  Otherwise  an interrupt which causes
         * a TLB miss can clobber the MMUCR between the mtspr and the tlbsx. */
-       mfmsr   r5
+       mfmsr   r4
        lis     r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@ha
        addi    r6,r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@l
-       andc    r6,r5,r6
+       andc    r6,r4,r6
        mtmsr   r6
-       mtspr   SPRN_MMUCR,r4
+       mtspr   SPRN_MMUCR,r5
        tlbsx.  r3, 0, r3
-       mtmsr   r5
+       mtmsr   r4
        bne     10f
        sync
        /* There are only 64 TLB entries, so r3 < 64,
@@ -534,12 +543,21 @@ END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE)
        addi    r3,r3,L1_CACHE_BYTES
        bdnz    0b
        sync
+#ifndef CONFIG_44x
+       /* We don't flush the icache on 44x. Those have a virtual icache
+        * and we don't have access to the virtual address here (it's
+        * not the page vaddr but where it's mapped in user space). The
+        * flushing of the icache on these is handled elsewhere, when
+        * a change in the address space occurs, before returning to
+        * user space
+        */
        mtctr   r4
 1:     icbi    0,r6
        addi    r6,r6,L1_CACHE_BYTES
        bdnz    1b
        sync
        isync
+#endif /* CONFIG_44x */
        blr
 
 /*
index b9d88374f14f07abe21e51367110e6c82129ba99..41e13f4cc6e3da1e34ac662d4f558f5fa668fccd 100644 (file)
@@ -350,7 +350,7 @@ struct task_struct *__switch_to(struct task_struct *prev,
        local_irq_save(flags);
 
        account_system_vtime(current);
-       account_process_vtime(current);
+       account_process_tick(current, 0);
        calculate_steal_time();
 
        last = _switch(old_thread, new_thread);
index 9f329a8928eaed27f3192e27c729e24bb73ac888..acc0d247d3c3a83920c92cb11f33639a86e8da1b 100644 (file)
@@ -697,6 +697,18 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
                prop = of_get_flat_dt_prop(node, "cpu-version", NULL);
                if (prop && (*prop & 0xff000000) == 0x0f000000)
                        identify_cpu(0, *prop);
+#if defined(CONFIG_44x) && defined(CONFIG_PPC_FPU)
+               /*
+                * Since 440GR(x)/440EP(x) processors have the same pvr,
+                * we check the node path and set bit 28 in the cur_cpu_spec
+                * pvr for EP(x) processor version. This bit is always 0 in
+                * the "real" pvr. Then we call identify_cpu again with
+                * the new logical pvr to enable FPU support.
+                */
+               if (strstr(uname, "440EP")) {
+                       identify_cpu(0, cur_cpu_spec->pvr_value | 0x8);
+               }
+#endif
        }
 
        check_cpu_feature_properties(node);
index 1db10f70ae69bb0d4da938d068bb81fbd434f1b3..1add6efdb315065e4b424114944911ddb89a3c0e 100644 (file)
@@ -1244,7 +1244,7 @@ static void __init prom_initialize_tce_table(void)
                        local_alloc_bottom = base;
 
                /* It seems OF doesn't null-terminate the path :-( */
-               memset(path, 0, sizeof(path));
+               memset(path, 0, PROM_SCRATCH_SIZE);
                /* Call OF to setup the TCE hardware */
                if (call_prom("package-to-path", 3, 1, node,
                              path, PROM_SCRATCH_SIZE-1) == PROM_ERROR) {
index 214780798289212eda799ebcbdde8025602e7c53..053cac19f71414f3ac4956cdf4c66cb903af8294 100644 (file)
@@ -19,6 +19,9 @@
 #include <linux/init.h>
 #include <linux/capability.h>
 #include <linux/delay.h>
+#include <linux/smp.h>
+#include <linux/completion.h>
+#include <linux/cpumask.h>
 
 #include <asm/prom.h>
 #include <asm/rtas.h>
@@ -34,6 +37,8 @@
 #include <asm/lmb.h>
 #include <asm/udbg.h>
 #include <asm/syscalls.h>
+#include <asm/smp.h>
+#include <asm/atomic.h>
 
 struct rtas_t rtas = {
        .lock = SPIN_LOCK_UNLOCKED
@@ -41,8 +46,10 @@ struct rtas_t rtas = {
 EXPORT_SYMBOL(rtas);
 
 struct rtas_suspend_me_data {
-       long waiting;
-       struct rtas_args *args;
+       atomic_t working; /* number of cpus accessing this struct */
+       int token; /* ibm,suspend-me */
+       int error;
+       struct completion *complete; /* wait on this until working == 0 */
 };
 
 DEFINE_SPINLOCK(rtas_data_buf_lock);
@@ -631,18 +638,18 @@ void rtas_halt(void)
 /* Must be in the RMO region, so we place it here */
 static char rtas_os_term_buf[2048];
 
-void rtas_os_term(char *str)
+void rtas_panic_msg(char *str)
 {
-       int status;
+       snprintf(rtas_os_term_buf, 2048, "OS panic: %s", str);
+}
 
-       if (panic_timeout)
-               return;
+void rtas_os_term(void)
+{
+       int status;
 
        if (RTAS_UNKNOWN_SERVICE == rtas_token("ibm,os-term"))
                return;
 
-       snprintf(rtas_os_term_buf, 2048, "OS panic: %s", str);
-
        do {
                status = rtas_call(rtas_token("ibm,os-term"), 1, 1, NULL,
                                   __pa(rtas_os_term_buf));
@@ -657,50 +664,62 @@ static int ibm_suspend_me_token = RTAS_UNKNOWN_SERVICE;
 #ifdef CONFIG_PPC_PSERIES
 static void rtas_percpu_suspend_me(void *info)
 {
-       int i;
        long rc;
-       long flags;
+       unsigned long msr_save;
+       int cpu;
        struct rtas_suspend_me_data *data =
                (struct rtas_suspend_me_data *)info;
 
-       /*
-        * We use "waiting" to indicate our state.  As long
-        * as it is >0, we are still trying to all join up.
-        * If it goes to 0, we have successfully joined up and
-        * one thread got H_CONTINUE.  If any error happens,
-        * we set it to <0.
-        */
-       local_irq_save(flags);
-       do {
-               rc = plpar_hcall_norets(H_JOIN);
-               smp_rmb();
-       } while (rc == H_SUCCESS && data->waiting > 0);
-       if (rc == H_SUCCESS)
-               goto out;
+       atomic_inc(&data->working);
+
+       /* really need to ensure MSR.EE is off for H_JOIN */
+       msr_save = mfmsr();
+       mtmsr(msr_save & ~(MSR_EE));
+
+       rc = plpar_hcall_norets(H_JOIN);
 
-       if (rc == H_CONTINUE) {
-               data->waiting = 0;
-               data->args->args[data->args->nargs] =
-                       rtas_call(ibm_suspend_me_token, 0, 1, NULL);
-               for_each_possible_cpu(i)
-                       plpar_hcall_norets(H_PROD,i);
+       mtmsr(msr_save);
+
+       if (rc == H_SUCCESS) {
+               /* This cpu was prodded and the suspend is complete. */
+               goto out;
+       } else if (rc == H_CONTINUE) {
+               /* All other cpus are in H_JOIN, this cpu does
+                * the suspend.
+                */
+               printk(KERN_DEBUG "calling ibm,suspend-me on cpu %i\n",
+                      smp_processor_id());
+               data->error = rtas_call(data->token, 0, 1, NULL);
+
+               if (data->error)
+                       printk(KERN_DEBUG "ibm,suspend-me returned %d\n",
+                              data->error);
        } else {
-               data->waiting = -EBUSY;
-               printk(KERN_ERR "Error on H_JOIN hypervisor call\n");
+               printk(KERN_ERR "H_JOIN on cpu %i failed with rc = %ld\n",
+                      smp_processor_id(), rc);
+               data->error = rc;
        }
-
+       /* This cpu did the suspend or got an error; in either case,
+        * we need to prod all other other cpus out of join state.
+        * Extra prods are harmless.
+        */
+       for_each_online_cpu(cpu)
+               plpar_hcall_norets(H_PROD, get_hard_smp_processor_id(cpu));
 out:
-       local_irq_restore(flags);
-       return;
+       if (atomic_dec_return(&data->working) == 0)
+               complete(data->complete);
 }
 
 static int rtas_ibm_suspend_me(struct rtas_args *args)
 {
-       int i;
        long state;
        long rc;
        unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
        struct rtas_suspend_me_data data;
+       DECLARE_COMPLETION_ONSTACK(done);
+
+       if (!rtas_service_present("ibm,suspend-me"))
+               return -ENOSYS;
 
        /* Make sure the state is valid */
        rc = plpar_hcall(H_VASI_STATE, retbuf,
@@ -721,25 +740,23 @@ static int rtas_ibm_suspend_me(struct rtas_args *args)
                return 0;
        }
 
-       data.waiting = 1;
-       data.args = args;
+       atomic_set(&data.working, 0);
+       data.token = rtas_token("ibm,suspend-me");
+       data.error = 0;
+       data.complete = &done;
 
        /* Call function on all CPUs.  One of us will make the
         * rtas call
         */
        if (on_each_cpu(rtas_percpu_suspend_me, &data, 1, 0))
-               data.waiting = -EINVAL;
+               data.error = -EINVAL;
 
-       if (data.waiting != 0)
-               printk(KERN_ERR "Error doing global join\n");
+       wait_for_completion(&done);
 
-       /* Prod each CPU.  This won't hurt, and will wake
-        * anyone we successfully put to sleep with H_JOIN.
-        */
-       for_each_possible_cpu(i)
-               plpar_hcall_norets(H_PROD, i);
+       if (data.error != 0)
+               printk(KERN_ERR "Error doing global join\n");
 
-       return data.waiting;
+       return data.error;
 }
 #else /* CONFIG_PPC_PSERIES */
 static int rtas_ibm_suspend_me(struct rtas_args *args)
index ede77dbbd4df7fa3338e343973f93a71accb7de5..3b1529c103ef4a545da877bfe4d2de81cf41abe7 100644 (file)
@@ -291,23 +291,16 @@ static void __init initialize_cache_info(void)
                if ( num_cpus == 1 ) {
                        const u32 *sizep, *lsizep;
                        u32 size, lsize;
-                       const char *dc, *ic;
-
-                       /* Then read cache informations */
-                       if (machine_is(powermac)) {
-                               dc = "d-cache-block-size";
-                               ic = "i-cache-block-size";
-                       } else {
-                               dc = "d-cache-line-size";
-                               ic = "i-cache-line-size";
-                       }
 
                        size = 0;
                        lsize = cur_cpu_spec->dcache_bsize;
                        sizep = of_get_property(np, "d-cache-size", NULL);
                        if (sizep != NULL)
                                size = *sizep;
-                       lsizep = of_get_property(np, dc, NULL);
+                       lsizep = of_get_property(np, "d-cache-block-size", NULL);
+                       /* fallback if block size missing */
+                       if (lsizep == NULL)
+                               lsizep = of_get_property(np, "d-cache-line-size", NULL);
                        if (lsizep != NULL)
                                lsize = *lsizep;
                        if (sizep == 0 || lsizep == 0)
@@ -324,7 +317,9 @@ static void __init initialize_cache_info(void)
                        sizep = of_get_property(np, "i-cache-size", NULL);
                        if (sizep != NULL)
                                size = *sizep;
-                       lsizep = of_get_property(np, ic, NULL);
+                       lsizep = of_get_property(np, "i-cache-block-size", NULL);
+                       if (lsizep == NULL)
+                               lsizep = of_get_property(np, "i-cache-line-size", NULL);
                        if (lsizep != NULL)
                                lsize = *lsizep;
                        if (sizep == 0 || lsizep == 0)
index 69e8f86aa4f843a2f248c9e7888a6f5283b64ad8..77fc76607ab2080d41667f3171fcdef9ee44dfd1 100644 (file)
@@ -133,10 +133,12 @@ _GLOBAL(swsusp_arch_suspend)
 /* Resume code */
 _GLOBAL(swsusp_arch_resume)
 
+#ifdef CONFIG_ALTIVEC
        /* Stop pending alitvec streams and memory accesses */
 BEGIN_FTR_SECTION
        DSSALL
 END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
+#endif
        sync
 
        /* Disable MSR:DR to make sure we don't take a TLB or
index 9eb3284deac4e5d4e9942b5e643ab59fede4af85..a925a8eae121e1946c8d39959775b4b07de1c561 100644 (file)
@@ -241,8 +241,9 @@ void account_system_vtime(struct task_struct *tsk)
                /* deltascaled includes both user and system time.
                 * Hence scale it based on the purr ratio to estimate
                 * the system time */
-               deltascaled = deltascaled * get_paca()->system_time /
-                       (get_paca()->system_time + get_paca()->user_time);
+               if (get_paca()->user_time)
+                       deltascaled = deltascaled * get_paca()->system_time /
+                            (get_paca()->system_time + get_paca()->user_time);
                delta += get_paca()->system_time;
                get_paca()->system_time = 0;
        }
@@ -259,7 +260,7 @@ void account_system_vtime(struct task_struct *tsk)
  * user and system time records.
  * Must be called with interrupts disabled.
  */
-void account_process_vtime(struct task_struct *tsk)
+void account_process_tick(struct task_struct *tsk, int user_tick)
 {
        cputime_t utime, utimescaled;
 
@@ -274,18 +275,6 @@ void account_process_vtime(struct task_struct *tsk)
        account_user_time_scaled(tsk, utimescaled);
 }
 
-static void account_process_time(struct pt_regs *regs)
-{
-       int cpu = smp_processor_id();
-
-       account_process_vtime(current);
-       run_local_timers();
-       if (rcu_pending(cpu))
-               rcu_check_callbacks(cpu, user_mode(regs));
-       scheduler_tick();
-       run_posix_cpu_timers(current);
-}
-
 /*
  * Stuff for accounting stolen time.
  */
@@ -375,7 +364,6 @@ static void snapshot_purr(void)
 
 #else /* ! CONFIG_VIRT_CPU_ACCOUNTING */
 #define calc_cputime_factors()
-#define account_process_time(regs)     update_process_times(user_mode(regs))
 #define calculate_steal_time()         do { } while (0)
 #endif
 
@@ -586,7 +574,7 @@ void timer_interrupt(struct pt_regs * regs)
                /* not time for this event yet */
                now = per_cpu(decrementer_next_tb, cpu) - now;
                if (now <= DECREMENTER_MAX)
-                       set_dec((unsigned int)now - 1);
+                       set_dec((int)now);
                return;
        }
        old_regs = set_irq_regs(regs);
@@ -599,20 +587,8 @@ void timer_interrupt(struct pt_regs * regs)
                get_lppaca()->int_dword.fields.decr_int = 0;
 #endif
 
-       /*
-        * We cannot disable the decrementer, so in the period
-        * between this cpu's being marked offline in cpu_online_map
-        * and calling stop-self, it is taking timer interrupts.
-        * Avoid calling into the scheduler rebalancing code if this
-        * is the case.
-        */
-       if (!cpu_is_offline(cpu))
-               account_process_time(regs);
-
        if (evt->event_handler)
                evt->event_handler(evt);
-       else
-               evt->set_next_event(DECREMENTER_MAX, evt);
 
 #ifdef CONFIG_PPC_ISERIES
        if (firmware_has_feature(FW_FEATURE_ISERIES) && hvlpevent_is_pending())
@@ -836,9 +812,6 @@ static int decrementer_set_next_event(unsigned long evt,
                                      struct clock_event_device *dev)
 {
        __get_cpu_var(decrementer_next_tb) = get_tb_or_rtc() + evt;
-       /* The decrementer interrupts on the 0 -> -1 transition */
-       if (evt)
-               --evt;
        set_dec(evt);
        return 0;
 }
@@ -857,7 +830,7 @@ static void register_decrementer_clockevent(int cpu)
        *dec = decrementer_clockevent;
        dec->cpumask = cpumask_of_cpu(cpu);
 
-       printk(KERN_INFO "clockevent: %s mult[%lx] shift[%d] cpu[%d]\n",
+       printk(KERN_DEBUG "clockevent: %s mult[%lx] shift[%d] cpu[%d]\n",
               dec->name, dec->mult, dec->shift, cpu);
 
        clockevents_register_device(dec);
@@ -871,7 +844,8 @@ void init_decrementer_clockevent(void)
                                             decrementer_clockevent.shift);
        decrementer_clockevent.max_delta_ns =
                clockevent_delta2ns(DECREMENTER_MAX, &decrementer_clockevent);
-       decrementer_clockevent.min_delta_ns = 1000;
+       decrementer_clockevent.min_delta_ns =
+               clockevent_delta2ns(2, &decrementer_clockevent);
 
        register_decrementer_clockevent(cpu);
 }
index 2322ba5cce4ce23c3eca48336686518671d05283..3702df7dc567e160f08cfe09b5b825b5298a0f94 100644 (file)
@@ -699,11 +699,22 @@ static int __init vdso_init(void)
        vdso_data->icache_size = ppc64_caches.isize;
        vdso_data->icache_line_size = ppc64_caches.iline_size;
 
+       /* XXXOJN: Blocks should be added to ppc64_caches and used instead */
+       vdso_data->dcache_block_size = ppc64_caches.dline_size;
+       vdso_data->icache_block_size = ppc64_caches.iline_size;
+       vdso_data->dcache_log_block_size = ppc64_caches.log_dline_size;
+       vdso_data->icache_log_block_size = ppc64_caches.log_iline_size;
+
        /*
         * Calculate the size of the 64 bits vDSO
         */
        vdso64_pages = (&vdso64_end - &vdso64_start) >> PAGE_SHIFT;
        DBG("vdso64_kbase: %p, 0x%x pages\n", vdso64_kbase, vdso64_pages);
+#else
+       vdso_data->dcache_block_size = L1_CACHE_BYTES;
+       vdso_data->dcache_log_block_size = L1_CACHE_SHIFT;
+       vdso_data->icache_block_size = L1_CACHE_BYTES;
+       vdso_data->icache_log_block_size = L1_CACHE_SHIFT;
 #endif /* CONFIG_PPC64 */
 
 
index 9cb319992c3888dab15552977dab9dd4e0c4ec6e..1ba6feb71b313fd1b1208cc827f617a8f2692390 100644 (file)
  *
  * Flushes the data cache & invalidate the instruction cache for the
  * provided range [start, end[
- *
- * Note: all CPUs supported by this kernel have a 128 bytes cache
- * line size so we don't have to peek that info from the datapage
  */
 V_FUNCTION_BEGIN(__kernel_sync_dicache)
   .cfi_startproc
-       li      r5,127
-       andc    r6,r3,r5                /* round low to line bdy */
+       mflr    r12
+  .cfi_register lr,r12
+       mr      r11,r3
+       bl      __get_datapage@local
+       mtlr    r12
+       mr      r10,r3
+
+       lwz     r7,CFG_DCACHE_BLOCKSZ(r10)
+       addi    r5,r7,-1
+       andc    r6,r11,r5               /* round low to line bdy */
        subf    r8,r6,r4                /* compute length */
        add     r8,r8,r5                /* ensure we get enough */
-       srwi.   r8,r8,7                 /* compute line count */
+       lwz     r9,CFG_DCACHE_LOGBLOCKSZ(r10)
+       srw.    r8,r8,r9                /* compute line count */
        crclr   cr0*4+so
        beqlr                           /* nothing to do? */
        mtctr   r8
-       mr      r3,r6
-1:     dcbst   0,r3
-       addi    r3,r3,128
+1:     dcbst   0,r6
+       add     r6,r6,r7
        bdnz    1b
        sync
+
+/* Now invalidate the instruction cache */
+
+       lwz     r7,CFG_ICACHE_BLOCKSZ(r10)
+       addi    r5,r7,-1
+       andc    r6,r11,r5               /* round low to line bdy */
+       subf    r8,r6,r4                /* compute length */
+       add     r8,r8,r5
+       lwz     r9,CFG_ICACHE_LOGBLOCKSZ(r10)
+       srw.    r8,r8,r9                /* compute line count */
+       crclr   cr0*4+so
+       beqlr                           /* nothing to do? */
        mtctr   r8
-1:     icbi    0,r6
-       addi    r6,r6,128
-       bdnz    1b
+2:     icbi    0,r6
+       add     r6,r6,r7
+       bdnz    2b
        isync
        li      r3,0
        blr
index 66a36d3cc6ad13ae02173f6b41a52fba3e043086..69c5af2b3c96cfd46a85a2c250a9727e585fcabf 100644 (file)
  *
  * Flushes the data cache & invalidate the instruction cache for the
  * provided range [start, end[
- *
- * Note: all CPUs supported by this kernel have a 128 bytes cache
- * line size so we don't have to peek that info from the datapage
  */
 V_FUNCTION_BEGIN(__kernel_sync_dicache)
   .cfi_startproc
-       li      r5,127
-       andc    r6,r3,r5                /* round low to line bdy */
+       mflr    r12
+  .cfi_register lr,r12
+       mr      r11,r3
+       bl      V_LOCAL_FUNC(__get_datapage)
+       mtlr    r12
+       mr      r10,r3
+
+       lwz     r7,CFG_DCACHE_BLOCKSZ(r10)
+       addi    r5,r7,-1
+       andc    r6,r11,r5               /* round low to line bdy */
        subf    r8,r6,r4                /* compute length */
        add     r8,r8,r5                /* ensure we get enough */
-       srwi.   r8,r8,7                 /* compute line count */
+       lwz     r9,CFG_DCACHE_LOGBLOCKSZ(r10)
+       srw.    r8,r8,r9                /* compute line count */
        crclr   cr0*4+so
        beqlr                           /* nothing to do? */
        mtctr   r8
-       mr      r3,r6
-1:     dcbst   0,r3
-       addi    r3,r3,128
+1:     dcbst   0,r6
+       add     r6,r6,r7
        bdnz    1b
        sync
+
+/* Now invalidate the instruction cache */
+
+       lwz     r7,CFG_ICACHE_BLOCKSZ(r10)
+       addi    r5,r7,-1
+       andc    r6,r11,r5               /* round low to line bdy */
+       subf    r8,r6,r4                /* compute length */
+       add     r8,r8,r5
+       lwz     r9,CFG_ICACHE_LOGBLOCKSZ(r10)
+       srw.    r8,r8,r9                /* compute line count */
+       crclr   cr0*4+so
+       beqlr                           /* nothing to do? */
        mtctr   r8
-1:     icbi    0,r6
-       addi    r6,r6,128
-       bdnz    1b
+2:     icbi    0,r6
+       add     r6,r6,r7
+       bdnz    2b
        isync
        li      r3,0
        blr
index 823a8cbd60b5bffd1025cff71ee2b56e0c751f76..f66fa5d966b0d75ebecf99d53ac4723e8f2622ce 100644 (file)
@@ -37,11 +37,10 @@ SECTIONS
                ALIGN_FUNCTION();
                *(.text.head)
                _text = .;
-               TEXT_TEXT
+               *(.text .fixup .text.init.refok .exit.text.refok)
                SCHED_TEXT
                LOCK_TEXT
                KPROBES_TEXT
-               *(.fixup)
 
 #ifdef CONFIG_PPC32
                *(.got1)
index e067df836be20954b319b7c2efe7aa6731f4b762..3899ea97fbdff935b23869fbe8c8db9c6de78283 100644 (file)
@@ -98,13 +98,12 @@ unsigned long __init mmu_mapin_ram(void)
 
        v = KERNELBASE;
        p = PPC_MEMSTART;
-       s = 0;
+       s = total_lowmem;
 
-       if (__map_without_ltlbs) {
-               return s;
-       }
+       if (__map_without_ltlbs)
+               return 0;
 
-       while (s <= (total_lowmem - LARGE_PAGE_SIZE_16M)) {
+       while (s >= LARGE_PAGE_SIZE_16M) {
                pmd_t *pmdp;
                unsigned long val = p | _PMD_SIZE_16M | _PAGE_HWEXEC | _PAGE_HWWRITE;
 
@@ -116,10 +115,10 @@ unsigned long __init mmu_mapin_ram(void)
 
                v += LARGE_PAGE_SIZE_16M;
                p += LARGE_PAGE_SIZE_16M;
-               s += LARGE_PAGE_SIZE_16M;
+               s -= LARGE_PAGE_SIZE_16M;
        }
 
-       while (s <= (total_lowmem - LARGE_PAGE_SIZE_4M)) {
+       while (s >= LARGE_PAGE_SIZE_4M) {
                pmd_t *pmdp;
                unsigned long val = p | _PMD_SIZE_4M | _PAGE_HWEXEC | _PAGE_HWWRITE;
 
@@ -128,8 +127,8 @@ unsigned long __init mmu_mapin_ram(void)
 
                v += LARGE_PAGE_SIZE_4M;
                p += LARGE_PAGE_SIZE_4M;
-               s += LARGE_PAGE_SIZE_4M;
+               s -= LARGE_PAGE_SIZE_4M;
        }
 
-       return s;
+       return total_lowmem - s;
 }
index c3df504765393b05f01ca8a6128b1db7992adc8c..04dc08798d3d1ff9c4bdbc2da09f9fbc8ce49c02 100644 (file)
@@ -35,6 +35,7 @@
  */
 unsigned int tlb_44x_index; /* = 0 */
 unsigned int tlb_44x_hwater = PPC44x_TLB_SIZE - 1 - PPC44x_EARLY_TLBS;
+int icache_44x_need_flush;
 
 /*
  * "Pins" a 256MB TLB entry in AS0 for kernel lowmem
index a18fda361cc0fe19103add8034d5b3485b012079..8135da06e0a44e4e320e7157e3b9fec364e67793 100644 (file)
@@ -309,7 +309,7 @@ good_area:
                                        set_bit(PG_arch_1, &page->flags);
                                }
                                pte_update(ptep, 0, _PAGE_HWEXEC);
-                               _tlbie(address);
+                               _tlbie(address, mm->context.id);
                                pte_unmap_unlock(ptep, ptl);
                                up_read(&mm->mmap_sem);
                                return 0;
index ad253b959030b9720221bc2190ad4cf5b108016e..e935edd6b72b44645ddf9a6d82af9c8e0b02c13b 100644 (file)
@@ -331,7 +331,7 @@ htab_pte_insert_failure:
  *****************************************************************************/
 
 /* _hash_page_4K(unsigned long ea, unsigned long access, unsigned long vsid,
- *              pte_t *ptep, unsigned long trap, int local)
+ *              pte_t *ptep, unsigned long trap, int local, int ssize)
  */
 
 /*
@@ -557,7 +557,8 @@ htab_inval_old_hpte:
        mr      r4,r31                  /* PTE.pte */
        li      r5,0                    /* PTE.hidx */
        li      r6,MMU_PAGE_64K         /* psize */
-       ld      r7,STK_PARM(r8)(r1)     /* local */
+       ld      r7,STK_PARM(r9)(r1)     /* ssize */
+       ld      r8,STK_PARM(r8)(r1)     /* local */
        bl      .flush_hash_page
        b       htab_insert_pte
        
index c78dc912411f9f6aa57c951023a733a7370b81c7..f09730bf3a335bc20de567bd5e596b727317faca 100644 (file)
@@ -51,6 +51,7 @@
 #include <asm/cputable.h>
 #include <asm/sections.h>
 #include <asm/spu.h>
+#include <asm/udbg.h>
 
 #ifdef DEBUG
 #define DBG(fmt...) udbg_printf(fmt)
@@ -791,8 +792,7 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
        }
        if (user_region) {
                if (psize != get_paca()->context.user_psize) {
-                       get_paca()->context.user_psize =
-                               mm->context.user_psize;
+                       get_paca()->context = mm->context;
                        slb_flush_and_rebolt();
                }
        } else if (get_paca()->vmalloc_sllp !=
@@ -885,6 +885,9 @@ void hash_preload(struct mm_struct *mm, unsigned long ea,
        local_irq_restore(flags);
 }
 
+/* WARNING: This is called from hash_low_64.S, if you change this prototype,
+ *          do not forget to update the assembly call site !
+ */
 void flush_hash_page(unsigned long va, real_pte_t pte, int psize, int ssize,
                     int local)
 {
index d9c82d3d64821d4ed15fa48ec745ebb39d9fccb8..c0f5cff77035e8d1abae6fe746e96af2cbcd6dd2 100644 (file)
@@ -19,8 +19,6 @@
  *
  */
 
-#undef DEBUG
-
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
 
 #include "mmu_decl.h"
 
-#ifdef DEBUG
-#define DBG(fmt...) printk(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
 #if PGTABLE_RANGE > USER_VSID_RANGE
 #warning Limited user VSID range means pagetable space is wasted
 #endif
@@ -175,8 +167,8 @@ void pgtable_cache_init(void)
                int size = pgtable_cache_size[i];
                const char *name = pgtable_cache_name[i];
 
-               DBG("Allocating page table cache %s (#%d) "
-                   "for size: %08x...\n", name, i, size);
+               pr_debug("Allocating page table cache %s (#%d) "
+                       "for size: %08x...\n", name, i, size);
                pgtable_cache[i] = kmem_cache_create(name,
                                                     size, size,
                                                     SLAB_PANIC,
@@ -239,8 +231,8 @@ int __meminit vmemmap_populate(struct page *start_page,
                if (!p)
                        return -ENOMEM;
 
-               printk(KERN_WARNING "vmemmap %08lx allocated at %p, "
-                                   "physical %08lx.\n", start, p, __pa(p));
+               pr_debug("vmemmap %08lx allocated at %p, physical %08lx.\n",
+                       start, p, __pa(p));
 
                mapped = htab_bolt_mapping(start, start + page_size,
                                        __pa(p), mode_rw, mmu_linear_psize,
index 81eb96ec13b2de917bb8d12666aeed587f4b8838..5402fb6b3aae2b49377d56016996e02e7ded55b8 100644 (file)
@@ -464,7 +464,7 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
                 * we invalidate the TLB here, thus avoiding dcbst
                 * misbehaviour.
                 */
-               _tlbie(address);
+               _tlbie(address, 0 /* 8xx doesn't care about PID */);
 #endif
                if (!PageReserved(page)
                    && !test_bit(PG_arch_1, &page->flags)) {
index c94a64fd3c01d2b1b4abec580c532ea634e37aa7..ebfd13dc9d19f1a8d437d12adb06269a385855b4 100644 (file)
@@ -56,17 +56,17 @@ extern unsigned long total_lowmem;
  * architectures.  -- Dan
  */
 #if defined(CONFIG_8xx)
-#define flush_HPTE(X, va, pg)  _tlbie(va)
+#define flush_HPTE(X, va, pg)  _tlbie(va, 0 /* 8xx doesn't care about PID */)
 #define MMU_init_hw()          do { } while(0)
 #define mmu_mapin_ram()                (0UL)
 
 #elif defined(CONFIG_4xx)
-#define flush_HPTE(X, va, pg)  _tlbie(va)
+#define flush_HPTE(pid, va, pg)        _tlbie(va, pid)
 extern void MMU_init_hw(void);
 extern unsigned long mmu_mapin_ram(void);
 
 #elif defined(CONFIG_FSL_BOOKE)
-#define flush_HPTE(X, va, pg)  _tlbie(va)
+#define flush_HPTE(pid, va, pg)        _tlbie(va, pid)
 extern void MMU_init_hw(void);
 extern unsigned long mmu_mapin_ram(void);
 extern void adjust_total_lowmem(void);
index bbd2c512ee0530ded1aa374242b06cce5b4f319b..27922dff8b94e34614890f7764ce10c014b6fb65 100644 (file)
@@ -25,6 +25,7 @@
 #include <asm/smp.h>
 #include <asm/firmware.h>
 #include <linux/compiler.h>
+#include <asm/udbg.h>
 
 #ifdef DEBUG
 #define DBG(fmt...) udbg_printf(fmt)
@@ -148,6 +149,35 @@ void slb_vmalloc_update(void)
        slb_flush_and_rebolt();
 }
 
+/* Helper function to compare esids.  There are four cases to handle.
+ * 1. The system is not 1T segment size capable.  Use the GET_ESID compare.
+ * 2. The system is 1T capable, both addresses are < 1T, use the GET_ESID compare.
+ * 3. The system is 1T capable, only one of the two addresses is > 1T.  This is not a match.
+ * 4. The system is 1T capable, both addresses are > 1T, use the GET_ESID_1T macro to compare.
+ */
+static inline int esids_match(unsigned long addr1, unsigned long addr2)
+{
+       int esid_1t_count;
+
+       /* System is not 1T segment size capable. */
+       if (!cpu_has_feature(CPU_FTR_1T_SEGMENT))
+               return (GET_ESID(addr1) == GET_ESID(addr2));
+
+       esid_1t_count = (((addr1 >> SID_SHIFT_1T) != 0) +
+                               ((addr2 >> SID_SHIFT_1T) != 0));
+
+       /* both addresses are < 1T */
+       if (esid_1t_count == 0)
+               return (GET_ESID(addr1) == GET_ESID(addr2));
+
+       /* One address < 1T, the other > 1T.  Not a match */
+       if (esid_1t_count == 1)
+               return 0;
+
+       /* Both addresses are > 1T. */
+       return (GET_ESID_1T(addr1) == GET_ESID_1T(addr2));
+}
+
 /* Flush all user entries from the segment table of the current processor. */
 void switch_slb(struct task_struct *tsk, struct mm_struct *mm)
 {
@@ -193,15 +223,14 @@ void switch_slb(struct task_struct *tsk, struct mm_struct *mm)
                return;
        slb_allocate(pc);
 
-       if (GET_ESID(pc) == GET_ESID(stack))
+       if (esids_match(pc,stack))
                return;
 
        if (is_kernel_addr(stack))
                return;
        slb_allocate(stack);
 
-       if ((GET_ESID(pc) == GET_ESID(unmapped_base))
-           || (GET_ESID(stack) == GET_ESID(unmapped_base)))
+       if (esids_match(pc,unmapped_base) || esids_match(stack,unmapped_base))
                return;
 
        if (is_kernel_addr(unmapped_base))
index 9e85bda762166a7c16e54cabcab97114815fbbf7..50448d5de9d247c9657c66a85e76f225483fc4f4 100644 (file)
@@ -20,6 +20,7 @@
 #include <asm/lmb.h>
 #include <asm/abs_addr.h>
 #include <asm/firmware.h>
+#include <asm/iseries/hv_call.h>
 
 struct stab_entry {
        unsigned long esid_data;
index eafbca52bff9ce1e4e58cc23d5ff03943434e6a0..e2d867ce1c7eb46fb259993ebf8f99c0a177bca9 100644 (file)
@@ -54,12 +54,10 @@ unsigned long pte_freelist_forced_free;
        ((PAGE_SIZE - sizeof(struct pte_freelist_batch)) \
          / sizeof(pgtable_free_t))
 
-#ifdef CONFIG_SMP
 static void pte_free_smp_sync(void *arg)
 {
        /* Do nothing, just ensure we sync with all CPUs */
 }
-#endif
 
 /* This is only called when we are critically out of memory
  * (and fail to get a page in pte_free_tlb).
index eb0c136b1c4408f2bd64fe8c403389a17a7c8440..ff6db243179887cccc3f5da9da5c564e2b1fb418 100644 (file)
  */
 
 #include <linux/init.h>
+#include <linux/of_platform.h>
+
 #include <asm/machdep.h>
 #include <asm/prom.h>
 #include <asm/udbg.h>
 #include <asm/time.h>
 #include <asm/uic.h>
-#include <asm/of_platform.h>
 
 static struct of_device_id walnut_of_bus[] = {
        { .compatible = "ibm,plb3", },
index 470e1a3fd755cced07b812f6507908daab22fcd1..be23f112184f66be1b175cc612f5a7ae2e142ec1 100644 (file)
  * option) any later version.
  */
 #include <linux/init.h>
+#include <linux/of_platform.h>
+
 #include <asm/machdep.h>
 #include <asm/prom.h>
 #include <asm/udbg.h>
 #include <asm/time.h>
 #include <asm/uic.h>
-#include <asm/of_platform.h>
 #include "44x.h"
 
 static struct of_device_id bamboo_of_bus[] = {
index 40e18fcb666c09ba0f1d7822ded77d560182cc5c..6cd3476767cc3b8583332dd8e351166ebc761d97 100644 (file)
  */
 
 #include <linux/init.h>
+#include <linux/of_platform.h>
+
 #include <asm/machdep.h>
 #include <asm/prom.h>
 #include <asm/udbg.h>
 #include <asm/time.h>
 #include <asm/uic.h>
-#include <asm/of_platform.h>
 
 #include "44x.h"
 
index 30700b31d43b7687d94495e0653fffb0e7c88a9c..21a9dd14f297c87175e81d88c1b6f997aed03ab7 100644 (file)
  * option) any later version.
  */
 #include <linux/init.h>
+#include <linux/of_platform.h>
+
 #include <asm/machdep.h>
 #include <asm/prom.h>
 #include <asm/udbg.h>
 #include <asm/time.h>
 #include <asm/uic.h>
-#include <asm/of_platform.h>
 #include "44x.h"
 
 static struct of_device_id sequoia_of_bus[] = {
index 972fa8528a8c606614767ec12f2539c8c001cad6..39ee7a13b25a61622dab10bf9f95c75f9299b03b 100644 (file)
@@ -90,10 +90,11 @@ static void __init mpc832x_sys_setup_arch(void)
 
        if ((np = of_find_compatible_node(NULL, "network", "ucc_geth"))
                        != NULL){
-               /* Reset the Ethernet PHY */
-               bcsr_regs[9] &= ~0x20;
+               /* Reset the Ethernet PHYs */
+#define BCSR8_FETH_RST 0x50
+               bcsr_regs[8] &= ~BCSR8_FETH_RST;
                udelay(1000);
-               bcsr_regs[9] |= 0x20;
+               bcsr_regs[8] |= BCSR8_FETH_RST;
                iounmap(bcsr_regs);
                of_node_put(np);
        }
@@ -145,30 +146,6 @@ static void __init mpc832x_sys_init_IRQ(void)
 #endif                         /* CONFIG_QUICC_ENGINE */
 }
 
-#if defined(CONFIG_I2C_MPC) && defined(CONFIG_SENSORS_DS1374)
-extern ulong ds1374_get_rtc_time(void);
-extern int ds1374_set_rtc_time(ulong);
-
-static int __init mpc832x_rtc_hookup(void)
-{
-       struct timespec tv;
-
-       if (!machine_is(mpc832x_mds))
-               return 0;
-
-       ppc_md.get_rtc_time = ds1374_get_rtc_time;
-       ppc_md.set_rtc_time = ds1374_set_rtc_time;
-
-       tv.tv_nsec = 0;
-       tv.tv_sec = (ppc_md.get_rtc_time) ();
-       do_settimeofday(&tv);
-
-       return 0;
-}
-
-late_initcall(mpc832x_rtc_hookup);
-#endif
-
 /*
  * Called very early, MMU is off, device-tree isn't unflattened
  */
index fbca336aa0ae8466f0b94cd0c96adf57bca636f3..d4bd04001b99567035247758b1d22919955b56ae 100644 (file)
  */
 
 #include <linux/pci.h>
+#include <linux/interrupt.h>
 #include <linux/spi/spi.h>
+#include <linux/spi/mmc_spi.h>
+#include <linux/mmc/host.h>
 
 #include <asm/of_platform.h>
 #include <asm/time.h>
@@ -46,15 +49,16 @@ static void mpc83xx_spi_deactivate_cs(u8 cs, u8 polarity)
        par_io_data_set(3, 13, !polarity);
 }
 
+static struct mmc_spi_platform_data mpc832x_mmc_pdata = {
+       .ocr_mask = MMC_VDD_33_34,
+};
+
 static struct spi_board_info mpc832x_spi_boardinfo = {
        .bus_num = 0x4c0,
        .chip_select = 0,
        .max_speed_hz = 50000000,
-       /*
-        * XXX: This is spidev (spi in userspace) stub, should
-        * be replaced by "mmc_spi" when mmc_spi will hit mainline.
-        */
-       .modalias = "spidev",
+       .modalias = "mmc_spi",
+       .platform_data = &mpc832x_mmc_pdata,
 };
 
 static int __init mpc832x_spi_init(void)
index 00aed7c2269ea4e56cc74950cb3ccf92736d04a8..a81bb3ce6b94460faf95cffe7f8a88e45696e289 100644 (file)
@@ -106,30 +106,6 @@ static void __init mpc834x_mds_init_IRQ(void)
        ipic_set_default_priority();
 }
 
-#if defined(CONFIG_I2C_MPC) && defined(CONFIG_SENSORS_DS1374)
-extern ulong ds1374_get_rtc_time(void);
-extern int ds1374_set_rtc_time(ulong);
-
-static int __init mpc834x_rtc_hookup(void)
-{
-       struct timespec tv;
-
-       if (!machine_is(mpc834x_mds))
-               return 0;
-
-       ppc_md.get_rtc_time = ds1374_get_rtc_time;
-       ppc_md.set_rtc_time = ds1374_set_rtc_time;
-
-       tv.tv_nsec = 0;
-       tv.tv_sec = (ppc_md.get_rtc_time) ();
-       do_settimeofday(&tv);
-
-       return 0;
-}
-
-late_initcall(mpc834x_rtc_hookup);
-#endif
-
 /*
  * Called very early, MMU is off, device-tree isn't unflattened
  */
index 0f3855c95ff5c6c0a4bc5d1caf78bfb2d6561be0..e40012f8f4886b323a83442baabf5dc720185d8a 100644 (file)
@@ -96,14 +96,39 @@ static void __init mpc836x_mds_setup_arch(void)
 
        if ((np = of_find_compatible_node(NULL, "network", "ucc_geth"))
                        != NULL){
+               uint svid;
+
                /* Reset the Ethernet PHY */
-               bcsr_regs[9] &= ~0x20;
+#define BCSR9_GETHRST 0x20
+               clrbits8(&bcsr_regs[9], BCSR9_GETHRST);
                udelay(1000);
-               bcsr_regs[9] |= 0x20;
+               setbits8(&bcsr_regs[9], BCSR9_GETHRST);
+
+               /* handle mpc8360ea rev.2.1 erratum 2: RGMII Timing */
+               svid = mfspr(SPRN_SVR);
+               if (svid == 0x80480021) {
+                       void __iomem *immap;
+
+                       immap = ioremap(get_immrbase() + 0x14a8, 8);
+
+                       /*
+                        * IMMR + 0x14A8[4:5] = 11 (clk delay for UCC 2)
+                        * IMMR + 0x14A8[18:19] = 11 (clk delay for UCC 1)
+                        */
+                       setbits32(immap, 0x0c003000);
+
+                       /*
+                        * IMMR + 0x14AC[20:27] = 10101010
+                        * (data delay for both UCC's)
+                        */
+                       clrsetbits_be32(immap + 4, 0xff0, 0xaa0);
+
+                       iounmap(immap);
+               }
+
                iounmap(bcsr_regs);
                of_node_put(np);
        }
-
 #endif                         /* CONFIG_QUICC_ENGINE */
 }
 
@@ -152,30 +177,6 @@ static void __init mpc836x_mds_init_IRQ(void)
 #endif                         /* CONFIG_QUICC_ENGINE */
 }
 
-#if defined(CONFIG_I2C_MPC) && defined(CONFIG_SENSORS_DS1374)
-extern ulong ds1374_get_rtc_time(void);
-extern int ds1374_set_rtc_time(ulong);
-
-static int __init mpc8360_rtc_hookup(void)
-{
-       struct timespec tv;
-
-       if (!machine_is(mpc836x_mds))
-               return 0;
-
-       ppc_md.get_rtc_time = ds1374_get_rtc_time;
-       ppc_md.set_rtc_time = ds1374_set_rtc_time;
-
-       tv.tv_nsec = 0;
-       tv.tv_sec = (ppc_md.get_rtc_time) ();
-       do_settimeofday(&tv);
-
-       return 0;
-}
-
-late_initcall(mpc8360_rtc_hookup);
-#endif
-
 /*
  * Called very early, MMU is off, device-tree isn't unflattened
  */
index eafe7605cdaca6f3d10b8966c8682ceeec0167c3..b45160f8d084b3e248abfeaa1853b6dabfa2cb7e 100644 (file)
@@ -130,7 +130,7 @@ int mpc831x_usb_cfg(void)
        out_be32(immap + MPC83XX_SCCR_OFFS, temp);
 
        /* Configure pin mux for ULPI.  There is no pin mux for UTMI */
-       if (!strcmp(prop, "ulpi")) {
+       if (prop && !strcmp(prop, "ulpi")) {
                temp = in_be32(immap + MPC83XX_SICRL_OFFS);
                temp &= ~MPC831X_SICRL_USB_MASK;
                temp |= MPC831X_SICRL_USB_ULPI;
@@ -153,13 +153,13 @@ int mpc831x_usb_cfg(void)
        usb_regs = ioremap(res.start, res.end - res.start + 1);
 
        /* Using on-chip PHY */
-       if (!strcmp(prop, "utmi_wide") ||
-                       !strcmp(prop, "utmi")) {
+       if (prop && (!strcmp(prop, "utmi_wide") ||
+                    !strcmp(prop, "utmi"))) {
                /* Set UTMI_PHY_EN, REFSEL to 48MHZ */
                out_be32(usb_regs + FSL_USB2_CONTROL_OFFS,
                                CONTROL_UTMI_PHY_EN | CONTROL_REFSEL_48MHZ);
        /* Using external UPLI PHY */
-       } else if (!strcmp(prop, "ulpi")) {
+       } else if (prop && !strcmp(prop, "ulpi")) {
                /* Set PHY_CLK_SEL to ULPI */
                temp = CONTROL_PHY_CLK_SEL_ULPI;
 #ifdef CONFIG_USB_OTG
index 151fd8b82d63b2e0878a7ee48118b3cda0ca0576..04f74f9f9ab67dcae27a706a7c3de449bab22ac6 100644 (file)
@@ -158,6 +158,18 @@ static unsigned int iic_get_irq(void)
        return virq;
 }
 
+void iic_setup_cpu(void)
+{
+       out_be64(&__get_cpu_var(iic).regs->prio, 0xff);
+}
+
+u8 iic_get_target_id(int cpu)
+{
+       return per_cpu(iic, cpu).target_id;
+}
+
+EXPORT_SYMBOL_GPL(iic_get_target_id);
+
 #ifdef CONFIG_SMP
 
 /* Use the highest interrupt priorities for IPI */
@@ -166,29 +178,17 @@ static inline int iic_ipi_to_irq(int ipi)
        return IIC_IRQ_TYPE_IPI + 0xf - ipi;
 }
 
-void iic_setup_cpu(void)
-{
-       out_be64(&__get_cpu_var(iic).regs->prio, 0xff);
-}
-
 void iic_cause_IPI(int cpu, int mesg)
 {
        out_be64(&per_cpu(iic, cpu).regs->generate, (0xf - mesg) << 4);
 }
 
-u8 iic_get_target_id(int cpu)
-{
-       return per_cpu(iic, cpu).target_id;
-}
-EXPORT_SYMBOL_GPL(iic_get_target_id);
-
 struct irq_host *iic_get_irq_host(int node)
 {
        return iic_host;
 }
 EXPORT_SYMBOL_GPL(iic_get_irq_host);
 
-
 static irqreturn_t iic_ipi_action(int irq, void *dev_id)
 {
        int ipi = (int)(long)dev_id;
index 1c0acbad7425b63e194726b109e95a01422c3bc2..e4438456c8675c8917052ba9e95cdd8a9e828809 100644 (file)
@@ -44,6 +44,7 @@
 #include <asm/rtas.h>
 
 #include "interrupt.h"
+#include <asm/udbg.h>
 
 #ifdef DEBUG
 #define DBG(fmt...) udbg_printf(fmt)
index 0966d093db4321925baf4fb6057c1760c01a1bf6..c0e968a4c21116d5ffd4a8bfb8ed7182cc79f15d 100644 (file)
@@ -171,6 +171,7 @@ static int spufs_rmdir(struct inode *parent, struct dentry *dir)
 {
        /* remove all entries */
        spufs_prune_dir(dir);
+       d_drop(dir);
 
        return simple_rmdir(parent, dir);
 }
index 1769d755eff30670eee5bd58f0c498b618aec4ce..ddfb35ae741ff2abbdea105a79a2609623f67d07 100644 (file)
@@ -49,6 +49,7 @@
 #include <asm/machdep.h>
 #include <asm/cputable.h>
 #include <asm/irq.h>
+#include <asm/time.h>
 #include <asm/spu_priv1.h>
 #include <asm/firmware.h>
 #include <asm/of_platform.h>
index e484cac750955bbdec66800ab00fb832136dfc81..653a5eb91c905049610d7168044c26da5f9e642e 100644 (file)
@@ -144,6 +144,7 @@ static int __init prpmc2800_probe(void)
                strncpy(prpmc2800_platform_name, m,
                        min((int)len, PLATFORM_NAME_MAX - 1));
 
+       _set_L2CR(_get_L2CR() | L2CR_L2E);
        return 1;
 }
 
index 69f1b437fc7bb4b90708a6d1e79facc3864a9c39..a1c2360740347478a983b7ba2df1d36a98bcc07e 100644 (file)
@@ -1,9 +1,13 @@
 #ifndef        _ISERIES_IRQ_H
 #define        _ISERIES_IRQ_H
 
+#ifdef CONFIG_PCI
 extern void iSeries_init_IRQ(void);
 extern int  iSeries_allocate_IRQ(HvBusNumber, HvSubBusNumber, u32);
 extern void iSeries_activate_IRQs(void);
+#else
+#define iSeries_init_IRQ       NULL
+#endif
 extern unsigned int iSeries_get_irq(void);
 
 #endif /* _ISERIES_IRQ_H */
index 37ae07ee54a9886944d5f15e932deac4abeb9432..0877a88341100e7cdf25a49c3167f0c3a94fdffc 100644 (file)
@@ -617,10 +617,6 @@ static void iseries_dedicated_idle(void)
        }
 }
 
-#ifndef CONFIG_PCI
-void __init iSeries_init_IRQ(void) { }
-#endif
-
 static void __iomem *iseries_ioremap(phys_addr_t address, unsigned long size,
                                     unsigned long flags)
 {
index d6435b03971f1e9d087a7d643828a653e559e1fd..be06cfd9fa3d5e20afbeaf7f444ce5bc4ea5c172 100644 (file)
@@ -523,15 +523,16 @@ static void __init get_viotape_info(struct device_node *vio_root)
 static int __init iseries_vio_init(void)
 {
        struct device_node *vio_root;
+       int ret = -ENODEV;
 
        if (!firmware_has_feature(FW_FEATURE_ISERIES))
-               return -ENODEV;
+               goto out;
 
        iommu_vio_init();
 
        vio_root = of_find_node_by_path("/vdevice");
        if (!vio_root)
-               return -ENODEV;
+               goto out;
 
        if (viopath_hostLp == HvLpIndexInvalid) {
                vio_set_hostlp();
@@ -544,10 +545,11 @@ static int __init iseries_vio_init(void)
        get_viocd_info(vio_root);
        get_viotape_info(vio_root);
 
-       return 0;
+       ret = 0;
 
  put_node:
        of_node_put(vio_root);
-       return -ENODEV;
+ out:
+       return ret;
 }
 arch_initcall(iseries_vio_init);
index 3a5d112af5e096632657e59dce37252ef5b7a243..3d62060498b4256151a3e63aa28e94350552fcec 100644 (file)
@@ -214,7 +214,7 @@ static __init void pas_init_IRQ(void)
        printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr);
 
        mpic = mpic_alloc(mpic_node, openpic_addr,
-                         MPIC_PRIMARY|MPIC_LARGE_VECTORS|MPIC_WANTS_RESET,
+                         MPIC_PRIMARY|MPIC_LARGE_VECTORS,
                          0, 0, " PAS-OPIC  ");
        BUG_ON(!mpic);
 
index 16e4e401b8203f1668dd83c0c0ee0d1bfb8b54d5..306a9d07491de3ea786695ba205472c1155589d0 100644 (file)
@@ -21,7 +21,7 @@ config PPC_SPLPAR
 
 config EEH
        bool "PCI Extended Error Handling (EEH)" if EMBEDDED
-       depends on PPC_PSERIES
+       depends on PPC_PSERIES && PCI
        default y if !EMBEDDED
 
 config SCANLOG
index 22322b35a0ffd1224e4e0c7c9f19c64a0b7bc12f..fb3d636e088be7eaf049d5af89dcf8e72add7cee 100644 (file)
@@ -186,6 +186,11 @@ static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len)
        n += scnprintf(buf+n, len-n, "cmd/stat:%x\n", cfg);
        printk(KERN_WARNING "EEH: PCI cmd/status register: %08x\n", cfg);
 
+       if (!dev) {
+               printk(KERN_WARNING "EEH: no PCI device for this of node\n");
+               return n;
+       }
+
        /* Gather bridge-specific registers */
        if (dev->class >> 16 == PCI_BASE_CLASS_BRIDGE) {
                rtas_read_config(pdn, PCI_SEC_STATUS, 2, &cfg);
@@ -198,7 +203,7 @@ static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len)
        }
 
        /* Dump out the PCI-X command and status regs */
-       cap = pci_find_capability(pdn->pcidev, PCI_CAP_ID_PCIX);
+       cap = pci_find_capability(dev, PCI_CAP_ID_PCIX);
        if (cap) {
                rtas_read_config(pdn, cap, 4, &cfg);
                n += scnprintf(buf+n, len-n, "pcix-cmd:%x\n", cfg);
@@ -210,7 +215,7 @@ static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len)
        }
 
        /* If PCI-E capable, dump PCI-E cap 10, and the AER */
-       cap = pci_find_capability(pdn->pcidev, PCI_CAP_ID_EXP);
+       cap = pci_find_capability(dev, PCI_CAP_ID_EXP);
        if (cap) {
                n += scnprintf(buf+n, len-n, "pci-e cap10:\n");
                printk(KERN_WARNING
@@ -222,7 +227,7 @@ static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len)
                        printk(KERN_WARNING "EEH: PCI-E %02x: %08x\n", i, cfg);
                }
 
-               cap = pci_find_ext_capability(pdn->pcidev, PCI_EXT_CAP_ID_ERR);
+               cap = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR);
                if (cap) {
                        n += scnprintf(buf+n, len-n, "pci-e AER:\n");
                        printk(KERN_WARNING
@@ -318,7 +323,7 @@ eeh_wait_for_slot_status(struct pci_dn *pdn, int max_wait_msecs)
 
                if (rets[2] == 0) return -1; /* permanently unavailable */
 
-               if (max_wait_msecs <= 0) return -1;
+               if (max_wait_msecs <= 0) break;
 
                mwait = rets[2];
                if (mwait <= 0) {
index 15e015ef68653f78dec23d8ca4008be911b4acb4..57e025e84ab4ae0132b3145c96689730989ef6f9 100644 (file)
@@ -105,17 +105,18 @@ static void eeh_report_error(struct pci_dev *dev, void *userdata)
                return;
 
        rc = driver->err_handler->error_detected (dev, pci_channel_io_frozen);
+
+       /* A driver that needs a reset trumps all others */
+       if (rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;
        if (*res == PCI_ERS_RESULT_NONE) *res = rc;
-       if (*res == PCI_ERS_RESULT_DISCONNECT &&
-            rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;
 }
 
 /**
  * eeh_report_mmio_enabled - tell drivers that MMIO has been enabled
  *
- * Report an EEH error to each device driver, collect up and
- * merge the device driver responses. Cumulative response
- * passed back in "userdata".
+ * Tells each device driver that IO ports, MMIO and config space I/O
+ * are now enabled. Collects up and merges the device driver responses.
+ * Cumulative response passed back in "userdata".
  */
 
 static void eeh_report_mmio_enabled(struct pci_dev *dev, void *userdata)
@@ -123,17 +124,16 @@ static void eeh_report_mmio_enabled(struct pci_dev *dev, void *userdata)
        enum pci_ers_result rc, *res = userdata;
        struct pci_driver *driver = dev->driver;
 
-       // dev->error_state = pci_channel_mmio_enabled;
-
        if (!driver ||
            !driver->err_handler ||
            !driver->err_handler->mmio_enabled)
                return;
 
        rc = driver->err_handler->mmio_enabled (dev);
+
+       /* A driver that needs a reset trumps all others */
+       if (rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;
        if (*res == PCI_ERS_RESULT_NONE) *res = rc;
-       if (*res == PCI_ERS_RESULT_DISCONNECT &&
-            rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;
 }
 
 /**
index 8b18a1c40092c5e7c68402c8ce78a1232a67ef41..b765b7c77b65ddacdeb806ce10904d6e5697ea42 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <asm/firmware.h>
 #include <asm/prom.h>
+#include <asm/udbg.h>
 
 #ifdef DEBUG
 #define DBG(fmt...) udbg_printf(fmt)
index 2793a1b100e64260e062eca9ca7517a78183f7b7..f15222bbe136a1020de443d3ff6c434c152c8d4b 100644 (file)
@@ -171,6 +171,7 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
        struct pci_dn *pdn;
        int hwirq, virq, i, rc;
        struct msi_desc *entry;
+       struct msi_msg msg;
 
        pdn = get_pdn(pdev);
        if (!pdn)
@@ -213,6 +214,11 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
 
                dev_dbg(&pdev->dev, "rtas_msi: allocated virq %d\n", virq);
                set_irq_msi(virq, entry);
+
+               /* Read config space back so we can restore after reset */
+               read_msi_msg(virq, &msg);
+               entry->msg = msg;
+
                unmask_msi_irq(virq);
        }
 
index fdb9b1c8f977e06704c714ff5d0c54366923fef4..fdeefe54ea91356fa4ad9d3526577a751a4fc022 100644 (file)
@@ -507,7 +507,8 @@ define_machine(pseries) {
        .restart                = rtas_restart,
        .power_off              = pSeries_power_off,
        .halt                   = rtas_halt,
-       .panic                  = rtas_os_term,
+       .panic                  = rtas_panic_msg,
+       .machine_shutdown       = rtas_os_term,
        .get_boot_time          = rtas_get_boot_time,
        .get_rtc_time           = rtas_get_rtc_time,
        .set_rtc_time           = rtas_set_rtc_time,
index 66c8ad4cfce64075a52044238eab4b98ed28b0f8..165981c87786bc2832e2f7bef8436a69663c88de 100644 (file)
@@ -77,8 +77,6 @@ int __init cpm_muram_init(void)
        int i = 0;
        int ret = 0;
 
-       printk("cpm_muram_init\n");
-
        spin_lock_init(&cpm_muram_lock);
        /* initialize the info header */
        rh_init(&cpm_muram_info, 1,
@@ -193,7 +191,7 @@ void __iomem *cpm_muram_addr(unsigned long offset)
 EXPORT_SYMBOL(cpm_muram_addr);
 
 /**
- * cpm_muram_phys - turn a muram virtual address into a DMA address
+ * cpm_muram_dma - turn a muram virtual address into a DMA address
  * @offset: virtual address from cpm_muram_addr() to convert
  */
 dma_addr_t cpm_muram_dma(void __iomem *addr)
index 7c1b27ac7d3caf70f1cc59f0b7fff3dff05fb109..216c0f5680d25ee0b5411e6dd30ecddfb2311ed5 100644 (file)
@@ -137,6 +137,7 @@ static void i8259_unmask_irq(unsigned int irq_nr)
 static struct irq_chip i8259_pic = {
        .typename       = " i8259    ",
        .mask           = i8259_mask_irq,
+       .disable        = i8259_mask_irq,
        .unmask         = i8259_unmask_irq,
        .mask_ack       = i8259_mask_and_ack_irq,
 };
index 9b3baa7317d749ea24e698995767b75b237ae36d..6933f9c73b43accc8ec55ac26ff6190a62529669 100644 (file)
@@ -24,8 +24,9 @@
 #define MV64X60_VAL_LEN_MAX            11
 #define MV64X60_PCICFG_CPCI_HOTSWAP    0x68
 
-static ssize_t mv64x60_hs_reg_read(struct kobject *kobj, char *buf, loff_t off,
-                                  size_t count)
+static ssize_t mv64x60_hs_reg_read(struct kobject *kobj,
+                                  struct bin_attribute *attr, char *buf,
+                                  loff_t off, size_t count)
 {
        struct pci_dev *phb;
        u32 v;
@@ -44,8 +45,9 @@ static ssize_t mv64x60_hs_reg_read(struct kobject *kobj, char *buf, loff_t off,
        return sprintf(buf, "0x%08x\n", v);
 }
 
-static ssize_t mv64x60_hs_reg_write(struct kobject *kobj, char *buf, loff_t off,
-                                   size_t count)
+static ssize_t mv64x60_hs_reg_write(struct kobject *kobj,
+                                   struct bin_attribute *attr, char *buf,
+                                   loff_t off, size_t count)
 {
        struct pci_dev *phb;
        u32 v;
index 5149716c734d9cf605ed9d8cc2cff65f7c7cee9b..847a5496b86985b194c1c46fbd8dcd26ccdfa89f 100644 (file)
@@ -97,6 +97,22 @@ static void uic_ack_irq(unsigned int virq)
        spin_unlock_irqrestore(&uic->lock, flags);
 }
 
+static void uic_mask_ack_irq(unsigned int virq)
+{
+       struct uic *uic = get_irq_chip_data(virq);
+       unsigned int src = uic_irq_to_hw(virq);
+       unsigned long flags;
+       u32 er, sr;
+
+       sr = 1 << (31-src);
+       spin_lock_irqsave(&uic->lock, flags);
+       er = mfdcr(uic->dcrbase + UIC_ER);
+       er &= ~sr;
+       mtdcr(uic->dcrbase + UIC_ER, er);
+       mtdcr(uic->dcrbase + UIC_SR, sr);
+       spin_unlock_irqrestore(&uic->lock, flags);
+}
+
 static int uic_set_irq_type(unsigned int virq, unsigned int flow_type)
 {
        struct uic *uic = get_irq_chip_data(virq);
@@ -152,7 +168,7 @@ static struct irq_chip uic_irq_chip = {
        .typename       = " UIC  ",
        .unmask         = uic_unmask_irq,
        .mask           = uic_mask_irq,
-/*     .mask_ack       = uic_mask_irq_and_ack, */
+       .mask_ack       = uic_mask_ack_irq,
        .ack            = uic_ack_irq,
        .set_type       = uic_set_irq_type,
 };
index fba7ca17a67e1565cdb8cb83628f828b7640b77d..59e77eb63338de4ea3bab18462967a6e16d4b208 100644 (file)
@@ -244,6 +244,16 @@ syscall_exit_cont:
        andis.  r10,r0,DBCR0_IC@h
        bnel-   load_dbcr0
 #endif
+#ifdef CONFIG_44x
+       lis     r4,icache_44x_need_flush@ha
+       lwz     r5,icache_44x_need_flush@l(r4)
+       cmplwi  cr0,r5,0
+       bne-    2f
+1:
+#endif /* CONFIG_44x */
+BEGIN_FTR_SECTION
+       lwarx   r7,0,r1
+END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX)
        stwcx.  r0,0,r1                 /* to clear the reservation */
        lwz     r4,_LINK(r1)
        lwz     r5,_CCR(r1)
@@ -258,6 +268,12 @@ syscall_exit_cont:
        mtspr   SPRN_SRR1,r8
        SYNC
        RFI
+#ifdef CONFIG_44x
+2:     li      r7,0
+       iccci   r0,r0
+       stw     r7,icache_44x_need_flush@l(r4)
+       b       1b
+#endif  /* CONFIG_44x */
 
 66:    li      r3,-ENOSYS
        b       ret_from_syscall
@@ -679,6 +695,16 @@ resume_kernel:
 
        /* interrupts are hard-disabled at this point */
 restore:
+#ifdef CONFIG_44x
+       lis     r4,icache_44x_need_flush@ha
+       lwz     r5,icache_44x_need_flush@l(r4)
+       cmplwi  cr0,r5,0
+       beq+    1f
+       li      r6,0
+       iccci   r0,r0
+       stw     r6,icache_44x_need_flush@l(r4)
+1:
+#endif  /* CONFIG_44x */
        lwz     r0,GPR0(r1)
        lwz     r2,GPR2(r1)
        REST_4GPRS(3, r1)
@@ -690,6 +716,9 @@ restore:
        mtctr   r11
 
        PPC405_ERR77(0,r1)
+BEGIN_FTR_SECTION
+       lwarx   r11,0,r1
+END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX)
        stwcx.  r0,0,r1                 /* to clear the reservation */
 
 #if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE))
index a22e1f4d94c82edd1c3ee92d7ea491b82a716b30..e0c850d85c530b933515a123bf66fb42d81ebed2 100644 (file)
@@ -224,7 +224,16 @@ _GLOBAL(_tlbia)
  */
 _GLOBAL(_tlbie)
 #if defined(CONFIG_40x)
+       /* We run the search with interrupts disabled because we have to change
+        * the PID and I don't want to preempt when that happens.
+        */
+       mfmsr   r5
+       mfspr   r6,SPRN_PID
+       wrteei  0
+       mtspr   SPRN_PID,r4
        tlbsx.  r3, 0, r3
+       mtspr   SPRN_PID,r6
+       wrtee   r5
        bne     10f
        sync
        /* There are only 64 TLB entries, so r3 < 64, which means bit 25 is clear.
@@ -234,22 +243,21 @@ _GLOBAL(_tlbie)
        isync
 10:
 #elif defined(CONFIG_44x)
-       mfspr   r4,SPRN_MMUCR
-       mfspr   r5,SPRN_PID                     /* Get PID */
-       rlwimi  r4,r5,0,24,31                   /* Set TID */
+       mfspr   r5,SPRN_MMUCR
+       rlwimi  r5,r4,0,24,31                   /* Set TID */
 
        /* We have to run the search with interrupts disabled, even critical
         * and debug interrupts (in fact the only critical exceptions we have
         * are debug and machine check).  Otherwise  an interrupt which causes
         * a TLB miss can clobber the MMUCR between the mtspr and the tlbsx. */
-       mfmsr   r5
+       mfmsr   r4
        lis     r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@ha
        addi    r6,r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@l
-       andc    r6,r5,r6
+       andc    r6,r4,r6
        mtmsr   r6
-       mtspr   SPRN_MMUCR,r4
+       mtspr   SPRN_MMUCR,r5
        tlbsx.  r3, 0, r3
-       mtmsr   r5
+       mtmsr   r4
        bne     10f
        sync
        /* There are only 64 TLB entries, so r3 < 64,
@@ -491,12 +499,21 @@ END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE)
        addi    r3,r3,L1_CACHE_BYTES
        bdnz    0b
        sync
+#ifndef CONFIG_44x
+       /* We don't flush the icache on 44x. Those have a virtual icache
+        * and we don't have access to the virtual address here (it's
+        * not the page vaddr but where it's mapped in user space). The
+        * flushing of the icache on these is handled elsewhere, when
+        * a change in the address space occurs, before returning to
+        * user space
+        */
        mtctr   r4
 1:     icbi    0,r6
        addi    r6,r6,L1_CACHE_BYTES
        bdnz    1b
        sync
        isync
+#endif /* CONFIG_44x */
        blr
 
 /*
index aac88c2f3db9d7d07b9b6e63e431f4fdb6a328b1..5255bd80aa6b2ec10fd7cb2c6aa5bd5d978368f7 100644 (file)
@@ -312,7 +312,14 @@ early_init(int r3, int r4, int r5)
         * Identify the CPU type and fix up code sections
         * that depend on which cpu we have.
         */
+#if defined(CONFIG_440EP) && defined(CONFIG_PPC_FPU)
+       /* We pass the virtual PVR here for 440EP as 440EP and 440GR have
+        * identical PVRs and there is no reliable way to check for the FPU
+        */
+       spec = identify_cpu(offset, (mfspr(SPRN_PVR) | 0x8));
+#else
        spec = identify_cpu(offset, mfspr(SPRN_PVR));
+#endif
        do_feature_fixups(spec->cpu_features,
                          PTRRELOC(&__start___ftr_fixup),
                          PTRRELOC(&__stop___ftr_fixup));
index 0a0a0487b33435f350713fc730a8b370b5e43b17..6536a25cfcb8117c371aa07008ec4ce7478553ae 100644 (file)
@@ -61,6 +61,7 @@ extern char etext[], _stext[];
  */
 unsigned int tlb_44x_index = 0;
 unsigned int tlb_44x_hwater = 62;
+int icache_44x_need_flush;
 
 /*
  * "Pins" a 256MB TLB entry in AS0 for kernel lowmem
index 838e09db71d97f56ca3721917dd2fd0ada843042..ea785dbaac7cec8441925edd6e0be9688406759d 100644 (file)
@@ -99,13 +99,12 @@ unsigned long __init mmu_mapin_ram(void)
 
        v = KERNELBASE;
        p = PPC_MEMSTART;
-       s = 0;
+       s = total_lowmem;
 
-       if (__map_without_ltlbs) {
-               return s;
-       }
+       if (__map_without_ltlbs)
+               return 0;
 
-       while (s <= (total_lowmem - LARGE_PAGE_SIZE_16M)) {
+       while (s >= LARGE_PAGE_SIZE_16M) {
                pmd_t *pmdp;
                unsigned long val = p | _PMD_SIZE_16M | _PAGE_HWEXEC | _PAGE_HWWRITE;
 
@@ -117,10 +116,10 @@ unsigned long __init mmu_mapin_ram(void)
 
                v += LARGE_PAGE_SIZE_16M;
                p += LARGE_PAGE_SIZE_16M;
-               s += LARGE_PAGE_SIZE_16M;
+               s -= LARGE_PAGE_SIZE_16M;
        }
 
-       while (s <= (total_lowmem - LARGE_PAGE_SIZE_4M)) {
+       while (s >= LARGE_PAGE_SIZE_4M) {
                pmd_t *pmdp;
                unsigned long val = p | _PMD_SIZE_4M | _PAGE_HWEXEC | _PAGE_HWWRITE;
 
@@ -129,8 +128,8 @@ unsigned long __init mmu_mapin_ram(void)
 
                v += LARGE_PAGE_SIZE_4M;
                p += LARGE_PAGE_SIZE_4M;
-               s += LARGE_PAGE_SIZE_4M;
+               s -= LARGE_PAGE_SIZE_4M;
        }
 
-       return s;
+       return total_lowmem - s;
 }
index 254c23b755e689006a7073a13a57cbf35db4643b..36c0e7529edbc89f1e7c7dc8d3c000024a2f433d 100644 (file)
@@ -227,7 +227,7 @@ good_area:
                                        set_bit(PG_arch_1, &page->flags);
                                }
                                pte_update(ptep, 0, _PAGE_HWEXEC);
-                               _tlbie(address);
+                               _tlbie(address, mm->context.id);
                                pte_unmap_unlock(ptep, ptl);
                                up_read(&mm->mmap_sem);
                                return 0;
index 390dd1995c2a4ee2e7cbe4267227b76069e02eba..dd898d32480ef981d65267637da2bfecfa083641 100644 (file)
@@ -561,7 +561,7 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
                 * That means the zeroed TLB has to be invalidated
                 * whenever a page miss occurs.
                 */
-               _tlbie(address);
+               _tlbie(address, 0 /* 8xx doesn't care about PID */);
 #endif
                if (!PageReserved(page)
                    && !test_bit(PG_arch_1, &page->flags)) {
index 540f3292b2291f0c1e2cc78ccbdf87b5feac39b3..b298b60c202f814281ea68b21dc6c5464b3b48c9 100644 (file)
@@ -49,17 +49,17 @@ extern unsigned int num_tlbcam_entries;
  * architectures.  -- Dan
  */
 #if defined(CONFIG_8xx)
-#define flush_HPTE(X, va, pg)  _tlbie(va)
+#define flush_HPTE(X, va, pg)  _tlbie(va, 0 /* 8xx doesn't care about PID */)
 #define MMU_init_hw()          do { } while(0)
 #define mmu_mapin_ram()                (0UL)
 
 #elif defined(CONFIG_4xx)
-#define flush_HPTE(X, va, pg)  _tlbie(va)
+#define flush_HPTE(pid, va, pg)        _tlbie(va, pid)
 extern void MMU_init_hw(void);
 extern unsigned long mmu_mapin_ram(void);
 
 #elif defined(CONFIG_FSL_BOOKE)
-#define flush_HPTE(X, va, pg)  _tlbie(va)
+#define flush_HPTE(pid, va, pg)        _tlbie(va, pid)
 extern void MMU_init_hw(void);
 extern unsigned long mmu_mapin_ram(void);
 extern void adjust_total_lowmem(void);
index 05d7184d7e1454ec2f85022fb82e4513ca38de3d..453643a0eeea04e50f12783c331f3ae509658063 100644 (file)
@@ -236,7 +236,7 @@ ebony_early_serial_map(void)
        gen550_init(0, &port);
 
        /* Purge TLB entry added in head_44x.S for early serial access */
-       _tlbie(UART0_IO_BASE);
+       _tlbie(UART0_IO_BASE, 0);
 #endif
 
        port.membase = ioremap64(PPC440GP_UART1_ADDR, 8);
index 4b169610f15425865e3993726390123c60350c30..b79ebb8a3e6cd16ccde2ff5bca8d1d1cd9a7c4ad 100644 (file)
@@ -230,9 +230,14 @@ luan_setup_hoses(void)
 
        /* Allocate hoses for PCIX1 and PCIX2 */
        hose1 = pcibios_alloc_controller();
+       if (!hose1)
+               return;
+
        hose2 = pcibios_alloc_controller();
-       if (!hose1 || !hose2)
+       if (!hose2) {
+               pcibios_free_controller(hose1);
                return;
+       }
 
        /* Setup PCIX1 */
        hose1->first_busno = 0;
index fd0f971881d67763c0b6fc36ee0708c674e14f38..28a712cd4800dbdc272e15c2ef0f582ffbce6394 100644 (file)
@@ -259,7 +259,7 @@ ocotea_early_serial_map(void)
        gen550_init(0, &port);
 
        /* Purge TLB entry added in head_44x.S for early serial access */
-       _tlbie(UART0_IO_BASE);
+       _tlbie(UART0_IO_BASE, 0);
 #endif
 
        port.membase = ioremap64(PPC440GX_UART1_ADDR, 8);
index 888c492b4a4535dea8730f56a42d52ad66f2cc4b..f6a0c6650f3309c69a2d5194ccdef9fac08e47a8 100644 (file)
@@ -316,7 +316,7 @@ taishan_early_serial_map(void)
        gen550_init(0, &port);
 
        /* Purge TLB entry added in head_44x.S for early serial access */
-       _tlbie(UART0_IO_BASE);
+       _tlbie(UART0_IO_BASE, 0);
 #endif
 
        port.membase = ioremap64(PPC440GX_UART1_ADDR, 8);
index a83b0baea011f17811cda760540dab989e1f631c..66a44ff0d9263acdc1732e358ab82f60ddf2ecf6 100644 (file)
@@ -211,6 +211,7 @@ static void __init yucca_setup_pcie_fpga_rootpoint(int port)
                break;
 
        default:
+               iounmap(pcie_reg_fpga_base);
                return;
        }
 
index 1e5a00a4b5f55a5280dcc37452ccf847619b7274..559f27c6aefe823b1b53a3e29688a8d70b17f024 100644 (file)
@@ -127,6 +127,7 @@ static void i8259_unmask_irq(unsigned int irq_nr)
 static struct irq_chip i8259_pic = {
        .typename       = " i8259    ",
        .mask           = i8259_mask_irq,
+       .disable        = i8259_mask_irq,
        .unmask         = i8259_unmask_irq,
        .mask_ack       = i8259_mask_and_ack_irq,
 };
index 15f0d7323535f400b81603dd21f1bc00f2ecc50e..46588fa9438139657fc04f188d8ca258e27c5f39 100644 (file)
@@ -25,6 +25,7 @@
 #include <asm/machdep.h>
 #include <asm/bootinfo.h>
 #include <asm/time.h>
+#include <asm/ppc_sys.h>
 
 #include "cpm2_pic.h"
 
@@ -61,7 +62,7 @@ m8260_setup_arch(void)
 #endif
 
        identify_ppc_sys_by_name_and_id(BOARD_CHIP_NAME,
-                               in_be32(CPM_MAP_ADDR + CPM_IMMR_OFFSET));
+                       in_be32((void *)CPM_MAP_ADDR + CPM_IMMR_OFFSET));
 
        m82xx_board_setup();
 }
@@ -147,12 +148,12 @@ m8260_show_cpuinfo(struct seq_file *m)
        seq_printf(m, "vendor\t\t: %s\n"
                   "machine\t\t: %s\n"
                   "\n"
-                  "mem size\t\t: 0x%08x\n"
-                  "console baud\t\t: %d\n"
+                  "mem size\t\t: 0x%08lx\n"
+                  "console baud\t\t: %ld\n"
                   "\n"
-                  "core clock\t: %u MHz\n"
-                  "CPM  clock\t: %u MHz\n"
-                  "bus  clock\t: %u MHz\n",
+                  "core clock\t: %lu MHz\n"
+                  "CPM  clock\t: %lu MHz\n"
+                  "bus  clock\t: %lu MHz\n",
                   CPUINFO_VENDOR, CPUINFO_MACHINE, bp->bi_memsize,
                   bp->bi_baudrate, bp->bi_intfreq / 1000000,
                   bp->bi_cpmfreq / 1000000, bp->bi_busfreq / 1000000);
index ace4ec08de5118f5e68fc4286f19ec8f5b27d094..f658ff3b3890ef0e474edc9017bb89ad94df631a 100644 (file)
        }, \
 }
 
+#define XPAR_AC97_CONTROLLER_REFERENCE(num) { \
+       .name = "ml403_ac97cr", \
+       .id = num, \
+       .num_resources = 3, \
+       .resource = (struct resource[]) { \
+               { \
+                       .start = XPAR_OPB_AC97_CONTROLLER_REF_##num##_BASEADDR, \
+                       .end = XPAR_OPB_AC97_CONTROLLER_REF_##num##_HIGHADDR, \
+                       .flags = IORESOURCE_MEM, \
+               }, \
+               { \
+                       .start = XPAR_OPB_INTC_0_OPB_AC97_CONTROLLER_REF_##num##_PLAYBACK_INTERRUPT_INTR, \
+                       .end = XPAR_OPB_INTC_0_OPB_AC97_CONTROLLER_REF_##num##_PLAYBACK_INTERRUPT_INTR, \
+                       .flags = IORESOURCE_IRQ, \
+               }, \
+               { \
+                       .start = XPAR_OPB_INTC_0_OPB_AC97_CONTROLLER_REF_##num##_RECORD_INTERRUPT_INTR, \
+                       .end = XPAR_OPB_INTC_0_OPB_AC97_CONTROLLER_REF_##num##_RECORD_INTERRUPT_INTR, \
+                       .flags = IORESOURCE_IRQ, \
+               }, \
+       }, \
+}
+
 /* UART 8250 driver platform data table */
 struct plat_serial8250_port virtex_serial_platform_data[] = {
 #if defined(XPAR_UARTNS550_0_BASEADDR)
@@ -173,6 +196,14 @@ struct platform_device virtex_platform_devices[] = {
 #if defined(XPAR_TFT_3_BASEADDR)
        XPAR_TFT(3),
 #endif
+
+       /* AC97 Controller Reference instances */
+#if defined(XPAR_OPB_AC97_CONTROLLER_REF_0_BASEADDR)
+       XPAR_AC97_CONTROLLER_REFERENCE(0),
+#endif
+#if defined(XPAR_OPB_AC97_CONTROLLER_REF_1_BASEADDR)
+       XPAR_AC97_CONTROLLER_REFERENCE(1),
+#endif
 };
 
 /* Early serial support functions */
index 4ec716d8c1a623b4e123b8e2923d4443a3f3b42a..1330061020ab54e718ddaed14d71b05c20ae4bf9 100644 (file)
@@ -513,7 +513,7 @@ config ZFCPDUMP
        default n
        help
          Select this option if you want to build an zfcpdump enabled kernel.
-         Refer to "Documentation/s390/zfcpdump.txt" for more details on this.
+         Refer to <file:Documentation/s390/zfcpdump.txt> for more details on this.
 
 endmenu
 
index 4069b81f7f1d159f1fb2b6fc1bc6b9f7d788a8a0..db3ae8505103812a49b0d7e5a675251ec005f928 100644 (file)
@@ -45,7 +45,6 @@ struct appldata_ops {
        int    active;                          /* monitoring status */
 
        /* fill in from here */
-       unsigned int ctl_nr;                    /* sysctl ID */
        char name[APPLDATA_PROC_NAME_LENGTH];   /* name of /proc fs node */
        unsigned char record_nr;                /* Record Nr. for Product ID */
        void (*callback)(void *data);           /* callback function */
index ac61cf43a7d950b36cf1316165ea499c63c6283d..655d52543e2d24b1d12d168c037feaeb0b660c84 100644 (file)
@@ -53,29 +53,26 @@ static int appldata_interval_handler(ctl_table *ctl, int write,
 static struct ctl_table_header *appldata_sysctl_header;
 static struct ctl_table appldata_table[] = {
        {
-               .ctl_name       = CTL_APPLDATA_TIMER,
                .procname       = "timer",
                .mode           = S_IRUGO | S_IWUSR,
                .proc_handler   = &appldata_timer_handler,
        },
        {
-               .ctl_name       = CTL_APPLDATA_INTERVAL,
                .procname       = "interval",
                .mode           = S_IRUGO | S_IWUSR,
                .proc_handler   = &appldata_interval_handler,
        },
-       { .ctl_name = 0 }
+       { },
 };
 
 static struct ctl_table appldata_dir_table[] = {
        {
-               .ctl_name       = CTL_APPLDATA,
                .procname       = appldata_proc_name,
                .maxlen         = 0,
                .mode           = S_IRUGO | S_IXUGO,
                .child          = appldata_table,
        },
-       { .ctl_name = 0 }
+       { },
 };
 
 /*
@@ -441,75 +438,38 @@ out:
  */
 int appldata_register_ops(struct appldata_ops *ops)
 {
-       struct list_head *lh;
-       struct appldata_ops *tmp_ops;
-       int i;
-
-       i = 0;
+       if ((ops->size > APPLDATA_MAX_REC_SIZE) || (ops->size < 0))
+               return -EINVAL;
 
-       if ((ops->size > APPLDATA_MAX_REC_SIZE) ||
-               (ops->size < 0)){
-               P_ERROR("Invalid size of %s record = %i, maximum = %i!\n",
-                       ops->name, ops->size, APPLDATA_MAX_REC_SIZE);
-               return -ENOMEM;
-       }
-       if ((ops->ctl_nr == CTL_APPLDATA) ||
-           (ops->ctl_nr == CTL_APPLDATA_TIMER) ||
-           (ops->ctl_nr == CTL_APPLDATA_INTERVAL)) {
-               P_ERROR("ctl_nr %i already in use!\n", ops->ctl_nr);
-               return -EBUSY;
-       }
-       ops->ctl_table = kzalloc(4*sizeof(struct ctl_table), GFP_KERNEL);
-       if (ops->ctl_table == NULL) {
-               P_ERROR("Not enough memory for %s ctl_table!\n", ops->name);
+       ops->ctl_table = kzalloc(4 * sizeof(struct ctl_table), GFP_KERNEL);
+       if (!ops->ctl_table)
                return -ENOMEM;
-       }
 
        spin_lock(&appldata_ops_lock);
-       list_for_each(lh, &appldata_ops_list) {
-               tmp_ops = list_entry(lh, struct appldata_ops, list);
-               P_DEBUG("register_ops loop: %i) name = %s, ctl = %i\n",
-                       ++i, tmp_ops->name, tmp_ops->ctl_nr);
-               P_DEBUG("Comparing %s (ctl %i) with %s (ctl %i)\n",
-                       tmp_ops->name, tmp_ops->ctl_nr, ops->name,
-                       ops->ctl_nr);
-               if (strncmp(tmp_ops->name, ops->name,
-                               APPLDATA_PROC_NAME_LENGTH) == 0) {
-                       P_ERROR("Name \"%s\" already registered!\n", ops->name);
-                       kfree(ops->ctl_table);
-                       spin_unlock(&appldata_ops_lock);
-                       return -EBUSY;
-               }
-               if (tmp_ops->ctl_nr == ops->ctl_nr) {
-                       P_ERROR("ctl_nr %i already registered!\n", ops->ctl_nr);
-                       kfree(ops->ctl_table);
-                       spin_unlock(&appldata_ops_lock);
-                       return -EBUSY;
-               }
-       }
        list_add(&ops->list, &appldata_ops_list);
        spin_unlock(&appldata_ops_lock);
 
-       ops->ctl_table[0].ctl_name = CTL_APPLDATA;
        ops->ctl_table[0].procname = appldata_proc_name;
        ops->ctl_table[0].maxlen   = 0;
        ops->ctl_table[0].mode     = S_IRUGO | S_IXUGO;
        ops->ctl_table[0].child    = &ops->ctl_table[2];
 
-       ops->ctl_table[1].ctl_name = 0;
-
-       ops->ctl_table[2].ctl_name = ops->ctl_nr;
        ops->ctl_table[2].procname = ops->name;
        ops->ctl_table[2].mode     = S_IRUGO | S_IWUSR;
        ops->ctl_table[2].proc_handler = appldata_generic_handler;
        ops->ctl_table[2].data = ops;
 
-       ops->ctl_table[3].ctl_name = 0;
-
        ops->sysctl_header = register_sysctl_table(ops->ctl_table);
-
+       if (!ops->sysctl_header)
+               goto out;
        P_INFO("%s-ops registered!\n", ops->name);
        return 0;
+out:
+       spin_lock(&appldata_ops_lock);
+       list_del(&ops->list);
+       spin_unlock(&appldata_ops_lock);
+       kfree(ops->ctl_table);
+       return -ENOMEM;
 }
 
 /*
@@ -519,15 +479,11 @@ int appldata_register_ops(struct appldata_ops *ops)
  */
 void appldata_unregister_ops(struct appldata_ops *ops)
 {
-       void *table;
        spin_lock(&appldata_ops_lock);
        list_del(&ops->list);
-       /* at that point any incoming access will fail */
-       table = ops->ctl_table;
-       ops->ctl_table = NULL;
        spin_unlock(&appldata_ops_lock);
        unregister_sysctl_table(ops->sysctl_header);
-       kfree(table);
+       kfree(ops->ctl_table);
        P_INFO("%s-ops unregistered!\n", ops->name);
 }
 /********************** module-ops management <END> **************************/
index 697eb30a68a329dd6bfdb842efd037503bbe42bb..51181ccdb87b255699a3857f24d0ddac80e45699 100644 (file)
@@ -147,7 +147,6 @@ static void appldata_get_mem_data(void *data)
 
 
 static struct appldata_ops ops = {
-       .ctl_nr    = CTL_APPLDATA_MEM,
        .name      = "mem",
        .record_nr = APPLDATA_RECORD_MEM_ID,
        .size      = sizeof(struct appldata_mem_data),
index 6c1815a47714389e0f6664722e7c3563907a930a..4d8344336001c8d90edeb7b731fd6558a726d016 100644 (file)
@@ -142,7 +142,6 @@ static void appldata_get_net_sum_data(void *data)
 
 
 static struct appldata_ops ops = {
-       .ctl_nr    = CTL_APPLDATA_NET_SUM,
        .name      = "net_sum",
        .record_nr = APPLDATA_RECORD_NET_SUM_ID,
        .size      = sizeof(struct appldata_net_sum_data),
index 76a15523ae9e0e4c81f3bb3ce4dd7ed88c9880db..6b3eafe104533587e9e439a5852d5020164959ca 100644 (file)
@@ -82,7 +82,6 @@ struct appldata_os_data {
 static struct appldata_os_data *appldata_os_data;
 
 static struct appldata_ops ops = {
-       .ctl_nr    = CTL_APPLDATA_OS,
        .name      = "os",
        .record_nr = APPLDATA_RECORD_OS_ID,
        .owner     = THIS_MODULE,
index e6289ee74ecd400bcfaf606d8f9585191225462f..1b3af7dab8161bf08ec6fd3d5110170b2c89f914 100644 (file)
@@ -200,11 +200,13 @@ static noinline __init void find_memory_chunks(unsigned long memsize)
                cc = __tprot(addr);
                while (cc == old_cc) {
                        addr += CHUNK_INCR;
-                       cc = __tprot(addr);
+                       if (memsize && addr >= memsize)
+                               break;
 #ifndef CONFIG_64BIT
                        if (addr == ADDR2G)
                                break;
 #endif
+                       cc = __tprot(addr);
                }
 
                if (old_addr != addr &&
index 139ca153d5cc1dece7d4ac3679946d29a9baada9..b2b2edc40eb111e05232ca8303d8b92bd2da5743 100644 (file)
@@ -69,13 +69,31 @@ STACK_SIZE  = 1 << STACK_SHIFT
        basr    %r14,%r1
        .endm
 
-       .macro  LOCKDEP_SYS_EXIT
-       l       %r1,BASED(.Llockdep_sys_exit)
+       .macro  TRACE_IRQS_CHECK
+       tm      SP_PSW(%r15),0x03       # irqs enabled?
+       jz      0f
+       l       %r1,BASED(.Ltrace_irq_on)
        basr    %r14,%r1
+       j       1f
+0:     l       %r1,BASED(.Ltrace_irq_off)
+       basr    %r14,%r1
+1:
        .endm
 #else
 #define TRACE_IRQS_ON
 #define TRACE_IRQS_OFF
+#define TRACE_IRQS_CHECK
+#endif
+
+#ifdef CONFIG_LOCKDEP
+       .macro  LOCKDEP_SYS_EXIT
+       tm      SP_PSW+1(%r15),0x01     # returning to user ?
+       jz      0f
+       l       %r1,BASED(.Llockdep_sys_exit)
+       basr    %r14,%r1
+0:
+       .endm
+#else
 #define LOCKDEP_SYS_EXIT
 #endif
 
@@ -234,8 +252,6 @@ sysc_saveall:
        lh      %r7,0x8a          # get svc number from lowcore
 #ifdef CONFIG_VIRT_CPU_ACCOUNTING
 sysc_vtime:
-       tm      SP_PSW+1(%r15),0x01     # interrupting from user ?
-       bz      BASED(sysc_do_svc)
        UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER
 sysc_stime:
        UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
@@ -263,19 +279,34 @@ sysc_do_restart:
 
 sysc_return:
        tm      SP_PSW+1(%r15),0x01     # returning to user ?
-       bno     BASED(sysc_leave)
+       bno     BASED(sysc_restore)
        tm      __TI_flags+3(%r9),_TIF_WORK_SVC
        bnz     BASED(sysc_work)  # there is work to do (signals etc.)
+sysc_restore:
+#ifdef CONFIG_TRACE_IRQFLAGS
+       la      %r1,BASED(sysc_restore_trace_psw)
+       lpsw    0(%r1)
+sysc_restore_trace:
+       TRACE_IRQS_CHECK
        LOCKDEP_SYS_EXIT
+#endif
 sysc_leave:
        RESTORE_ALL __LC_RETURN_PSW,1
+sysc_done:
+
+#ifdef CONFIG_TRACE_IRQFLAGS
+       .align  8
+       .globl  sysc_restore_trace_psw
+sysc_restore_trace_psw:
+       .long   0, sysc_restore_trace + 0x80000000
+#endif
 
 #
 # recheck if there is more work to do
 #
 sysc_work_loop:
        tm      __TI_flags+3(%r9),_TIF_WORK_SVC
-       bz      BASED(sysc_leave)       # there is no work to do
+       bz      BASED(sysc_restore)     # there is no work to do
 #
 # One of the work bits is on. Find out which one.
 #
@@ -290,8 +321,8 @@ sysc_work:
        bo      BASED(sysc_restart)
        tm      __TI_flags+3(%r9),_TIF_SINGLE_STEP
        bo      BASED(sysc_singlestep)
-       LOCKDEP_SYS_EXIT
-       b       BASED(sysc_leave)
+       b       BASED(sysc_restore)
+sysc_work_done:
 
 #
 # _TIF_NEED_RESCHED is set, call schedule
@@ -458,6 +489,7 @@ pgm_check_handler:
 pgm_no_vtime:
 #endif
        l       %r9,__LC_THREAD_INFO    # load pointer to thread_info struct
+       TRACE_IRQS_OFF
        l       %r3,__LC_PGM_ILC        # load program interruption code
        la      %r8,0x7f
        nr      %r8,%r3
@@ -497,6 +529,7 @@ pgm_per_std:
 pgm_no_vtime2:
 #endif
        l       %r9,__LC_THREAD_INFO    # load pointer to thread_info struct
+       TRACE_IRQS_OFF
        l       %r1,__TI_task(%r9)
        mvc     __THREAD_per+__PER_atmid(2,%r1),__LC_PER_ATMID
        mvc     __THREAD_per+__PER_address(4,%r1),__LC_PER_ADDRESS
@@ -517,15 +550,13 @@ pgm_svcper:
        SAVE_ALL_SYNC __LC_SVC_OLD_PSW,__LC_SAVE_AREA
        CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA
 #ifdef CONFIG_VIRT_CPU_ACCOUNTING
-       tm      SP_PSW+1(%r15),0x01     # interrupting from user ?
-       bz      BASED(pgm_no_vtime3)
        UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER
        UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
        mvc     __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER
-pgm_no_vtime3:
 #endif
        lh      %r7,0x8a                # get svc number from lowcore
        l       %r9,__LC_THREAD_INFO    # load pointer to thread_info struct
+       TRACE_IRQS_OFF
        l       %r1,__TI_task(%r9)
        mvc     __THREAD_per+__PER_atmid(2,%r1),__LC_PER_ATMID
        mvc     __THREAD_per+__PER_address(4,%r1),__LC_PER_ADDRESS
@@ -542,7 +573,7 @@ kernel_per:
        mvi     SP_TRAP+1(%r15),0x28    # set trap indication to pgm check
        la      %r2,SP_PTREGS(%r15)     # address of register-save area
        l       %r1,BASED(.Lhandle_per) # load adr. of per handler
-       la      %r14,BASED(sysc_leave)  # load adr. of system return
+       la      %r14,BASED(sysc_restore)# load adr. of system return
        br      %r1                     # branch to do_single_step
 
 /*
@@ -569,26 +600,38 @@ io_no_vtime:
        l       %r1,BASED(.Ldo_IRQ)     # load address of do_IRQ
        la      %r2,SP_PTREGS(%r15)     # address of register-save area
        basr    %r14,%r1                # branch to standard irq handler
-       TRACE_IRQS_ON
-
 io_return:
        tm      SP_PSW+1(%r15),0x01     # returning to user ?
 #ifdef CONFIG_PREEMPT
        bno     BASED(io_preempt)       # no -> check for preemptive scheduling
 #else
-       bno     BASED(io_leave)         # no-> skip resched & signal
+       bno     BASED(io_restore)       # no-> skip resched & signal
 #endif
        tm      __TI_flags+3(%r9),_TIF_WORK_INT
        bnz     BASED(io_work)          # there is work to do (signals etc.)
+io_restore:
+#ifdef CONFIG_TRACE_IRQFLAGS
+       la      %r1,BASED(io_restore_trace_psw)
+       lpsw    0(%r1)
+io_restore_trace:
+       TRACE_IRQS_CHECK
        LOCKDEP_SYS_EXIT
+#endif
 io_leave:
        RESTORE_ALL __LC_RETURN_PSW,0
 io_done:
 
+#ifdef CONFIG_TRACE_IRQFLAGS
+       .align  8
+       .globl  io_restore_trace_psw
+io_restore_trace_psw:
+       .long   0, io_restore_trace + 0x80000000
+#endif
+
 #ifdef CONFIG_PREEMPT
 io_preempt:
        icm     %r0,15,__TI_precount(%r9)
-       bnz     BASED(io_leave)
+       bnz     BASED(io_restore)
        l       %r1,SP_R15(%r15)
        s       %r1,BASED(.Lc_spsize)
        mvc     SP_PTREGS(__PT_SIZE,%r1),SP_PTREGS(%r15)
@@ -596,14 +639,10 @@ io_preempt:
        lr      %r15,%r1
 io_resume_loop:
        tm      __TI_flags+3(%r9),_TIF_NEED_RESCHED
-       bno     BASED(io_leave)
-       mvc     __TI_precount(4,%r9),BASED(.Lc_pactive)
-       stosm   __SF_EMPTY(%r15),0x03  # reenable interrupts
-       l       %r1,BASED(.Lschedule)
-       basr    %r14,%r1               # call schedule
-       stnsm   __SF_EMPTY(%r15),0xfc  # disable I/O and ext. interrupts
-       xc      __TI_precount(4,%r9),__TI_precount(%r9)
-       b       BASED(io_resume_loop)
+       bno     BASED(io_restore)
+       l       %r1,BASED(.Lpreempt_schedule_irq)
+       la      %r14,BASED(io_resume_loop)
+       br      %r1                     # call schedule
 #endif
 
 #
@@ -627,40 +666,42 @@ io_work_loop:
        bo      BASED(io_reschedule)
        tm      __TI_flags+3(%r9),(_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK)
        bnz     BASED(io_sigpending)
-       LOCKDEP_SYS_EXIT
-       b       BASED(io_leave)
+       b       BASED(io_restore)
+io_work_done:
 
 #
 # _TIF_MCCK_PENDING is set, call handler
 #
 io_mcck_pending:
-       TRACE_IRQS_OFF
        l       %r1,BASED(.Ls390_handle_mcck)
        basr    %r14,%r1                # TIF bit will be cleared by handler
-       TRACE_IRQS_ON
        b       BASED(io_work_loop)
 
 #
 # _TIF_NEED_RESCHED is set, call schedule
 #
 io_reschedule:
+       TRACE_IRQS_ON
        l       %r1,BASED(.Lschedule)
        stosm   __SF_EMPTY(%r15),0x03   # reenable interrupts
        basr    %r14,%r1                # call scheduler
        stnsm   __SF_EMPTY(%r15),0xfc   # disable I/O and ext. interrupts
+       TRACE_IRQS_OFF
        tm      __TI_flags+3(%r9),_TIF_WORK_INT
-       bz      BASED(io_leave)         # there is no work to do
+       bz      BASED(io_restore)       # there is no work to do
        b       BASED(io_work_loop)
 
 #
 # _TIF_SIGPENDING or _TIF_RESTORE_SIGMASK is set, call do_signal
 #
 io_sigpending:
+       TRACE_IRQS_ON
        stosm   __SF_EMPTY(%r15),0x03   # reenable interrupts
        la      %r2,SP_PTREGS(%r15)     # load pt_regs
        l       %r1,BASED(.Ldo_signal)
        basr    %r14,%r1                # call do_signal
        stnsm   __SF_EMPTY(%r15),0xfc   # disable I/O and ext. interrupts
+       TRACE_IRQS_OFF
        b       BASED(io_work_loop)
 
 /*
@@ -688,7 +729,6 @@ ext_no_vtime:
        lh      %r3,__LC_EXT_INT_CODE   # get interruption code
        l       %r1,BASED(.Ldo_extint)
        basr    %r14,%r1
-       TRACE_IRQS_ON
        b       BASED(io_return)
 
 __critical_end:
@@ -853,15 +893,15 @@ cleanup_table_system_call:
 cleanup_table_sysc_return:
        .long   sysc_return + 0x80000000, sysc_leave + 0x80000000
 cleanup_table_sysc_leave:
-       .long   sysc_leave + 0x80000000, sysc_work_loop + 0x80000000
+       .long   sysc_leave + 0x80000000, sysc_done + 0x80000000
 cleanup_table_sysc_work_loop:
-       .long   sysc_work_loop + 0x80000000, sysc_reschedule + 0x80000000
+       .long   sysc_work_loop + 0x80000000, sysc_work_done + 0x80000000
 cleanup_table_io_return:
        .long   io_return + 0x80000000, io_leave + 0x80000000
 cleanup_table_io_leave:
        .long   io_leave + 0x80000000, io_done + 0x80000000
 cleanup_table_io_work_loop:
-       .long   io_work_loop + 0x80000000, io_mcck_pending + 0x80000000
+       .long   io_work_loop + 0x80000000, io_work_done + 0x80000000
 
 cleanup_critical:
        clc     4(4,%r12),BASED(cleanup_table_system_call)
@@ -930,8 +970,6 @@ cleanup_system_call:
 cleanup_vtime:
        clc     __LC_RETURN_PSW+4(4),BASED(cleanup_system_call_insn+12)
        bhe     BASED(cleanup_stime)
-       tm      SP_PSW+1(%r15),0x01     # interrupting from user ?
-       bz      BASED(cleanup_novtime)
        UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER
 cleanup_stime:
        clc     __LC_RETURN_PSW+4(4),BASED(cleanup_system_call_insn+16)
@@ -939,7 +977,6 @@ cleanup_stime:
        UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
 cleanup_update:
        mvc     __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER
-cleanup_novtime:
 #endif
        mvc     __LC_RETURN_PSW+4(4),BASED(cleanup_table_system_call+4)
        la      %r12,__LC_RETURN_PSW
@@ -978,10 +1015,10 @@ cleanup_sysc_leave:
 2:     la      %r12,__LC_RETURN_PSW
        br      %r14
 cleanup_sysc_leave_insn:
+       .long   sysc_done - 4 + 0x80000000
 #ifdef CONFIG_VIRT_CPU_ACCOUNTING
-       .long   sysc_leave + 14 + 0x80000000
+       .long   sysc_done - 8 + 0x80000000
 #endif
-       .long   sysc_leave + 10 + 0x80000000
 
 cleanup_io_return:
        mvc     __LC_RETURN_PSW(4),0(%r12)
@@ -1008,10 +1045,10 @@ cleanup_io_leave:
 2:     la      %r12,__LC_RETURN_PSW
        br      %r14
 cleanup_io_leave_insn:
+       .long   io_done - 4 + 0x80000000
 #ifdef CONFIG_VIRT_CPU_ACCOUNTING
-       .long   io_leave + 18 + 0x80000000
+       .long   io_done - 8 + 0x80000000
 #endif
-       .long   io_leave + 14 + 0x80000000
 
 /*
  * Integer constants
@@ -1019,7 +1056,6 @@ cleanup_io_leave_insn:
                .align  4
 .Lc_spsize:    .long   SP_SIZE
 .Lc_overhead:  .long   STACK_FRAME_OVERHEAD
-.Lc_pactive:   .long   PREEMPT_ACTIVE
 .Lnr_syscalls: .long   NR_syscalls
 .L0x018:       .short  0x018
 .L0x020:       .short  0x020
@@ -1043,6 +1079,8 @@ cleanup_io_leave_insn:
 .Lexecve_tail: .long   execve_tail
 .Ljump_table:  .long   pgm_check_table
 .Lschedule:    .long   schedule
+.Lpreempt_schedule_irq:
+               .long   preempt_schedule_irq
 .Ltrace:       .long   syscall_trace
 .Lschedtail:   .long   schedule_tail
 .Lsysc_table:  .long   sys_call_table
index 05e26d1fdf405dc21696b35aabb0217a6164d8d4..a3e47b893f079ca812c54b727f4b3dd4b2a6a6c2 100644 (file)
@@ -67,12 +67,28 @@ _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK | _TIF_NEED_RESCHED | \
         brasl  %r14,trace_hardirqs_off
        .endm
 
-       .macro  LOCKDEP_SYS_EXIT
-        brasl  %r14,lockdep_sys_exit
+       .macro TRACE_IRQS_CHECK
+       tm      SP_PSW(%r15),0x03       # irqs enabled?
+       jz      0f
+       brasl   %r14,trace_hardirqs_on
+       j       1f
+0:     brasl   %r14,trace_hardirqs_off
+1:
        .endm
 #else
 #define TRACE_IRQS_ON
 #define TRACE_IRQS_OFF
+#define TRACE_IRQS_CHECK
+#endif
+
+#ifdef CONFIG_LOCKDEP
+       .macro  LOCKDEP_SYS_EXIT
+       tm      SP_PSW+1(%r15),0x01     # returning to user ?
+       jz      0f
+       brasl   %r14,lockdep_sys_exit
+0:
+       .endm
+#else
 #define LOCKDEP_SYS_EXIT
 #endif
 
@@ -222,8 +238,6 @@ sysc_saveall:
        llgh    %r7,__LC_SVC_INT_CODE   # get svc number from lowcore
 #ifdef CONFIG_VIRT_CPU_ACCOUNTING
 sysc_vtime:
-       tm      SP_PSW+1(%r15),0x01     # interrupting from user ?
-       jz      sysc_do_svc
        UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER
 sysc_stime:
        UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
@@ -257,19 +271,34 @@ sysc_noemu:
 
 sysc_return:
        tm      SP_PSW+1(%r15),0x01     # returning to user ?
-       jno     sysc_leave
+       jno     sysc_restore
        tm      __TI_flags+7(%r9),_TIF_WORK_SVC
        jnz     sysc_work       # there is work to do (signals etc.)
+sysc_restore:
+#ifdef CONFIG_TRACE_IRQFLAGS
+       larl    %r1,sysc_restore_trace_psw
+       lpswe   0(%r1)
+sysc_restore_trace:
+       TRACE_IRQS_CHECK
        LOCKDEP_SYS_EXIT
+#endif
 sysc_leave:
        RESTORE_ALL __LC_RETURN_PSW,1
+sysc_done:
+
+#ifdef CONFIG_TRACE_IRQFLAGS
+       .align  8
+       .globl sysc_restore_trace_psw
+sysc_restore_trace_psw:
+       .quad   0, sysc_restore_trace
+#endif
 
 #
 # recheck if there is more work to do
 #
 sysc_work_loop:
        tm      __TI_flags+7(%r9),_TIF_WORK_SVC
-       jz      sysc_leave        # there is no work to do
+       jz      sysc_restore      # there is no work to do
 #
 # One of the work bits is on. Find out which one.
 #
@@ -284,8 +313,8 @@ sysc_work:
        jo      sysc_restart
        tm      __TI_flags+7(%r9),_TIF_SINGLE_STEP
        jo      sysc_singlestep
-       LOCKDEP_SYS_EXIT
-       j       sysc_leave
+       j       sysc_restore
+sysc_work_done:
 
 #
 # _TIF_NEED_RESCHED is set, call schedule
@@ -445,6 +474,7 @@ pgm_check_handler:
 pgm_no_vtime:
 #endif
        lg      %r9,__LC_THREAD_INFO    # load pointer to thread_info struct
+       TRACE_IRQS_OFF
        lgf     %r3,__LC_PGM_ILC        # load program interruption code
        lghi    %r8,0x7f
        ngr     %r8,%r3
@@ -484,6 +514,7 @@ pgm_per_std:
 pgm_no_vtime2:
 #endif
        lg      %r9,__LC_THREAD_INFO    # load pointer to thread_info struct
+       TRACE_IRQS_OFF
        lg      %r1,__TI_task(%r9)
        tm      SP_PSW+1(%r15),0x01     # kernel per event ?
        jz      kernel_per
@@ -504,12 +535,9 @@ pgm_svcper:
        SAVE_ALL_SYNC __LC_SVC_OLD_PSW,__LC_SAVE_AREA
        CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA
 #ifdef CONFIG_VIRT_CPU_ACCOUNTING
-       tm      SP_PSW+1(%r15),0x01     # interrupting from user ?
-       jz      pgm_no_vtime3
        UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER
        UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
        mvc     __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER
-pgm_no_vtime3:
 #endif
        llgh    %r7,__LC_SVC_INT_CODE   # get svc number from lowcore
        lg      %r9,__LC_THREAD_INFO    # load pointer to thread_info struct
@@ -529,7 +557,7 @@ kernel_per:
        lhi     %r0,__LC_PGM_OLD_PSW
        sth     %r0,SP_TRAP(%r15)       # set trap indication to pgm check
        la      %r2,SP_PTREGS(%r15)     # address of register-save area
-       larl    %r14,sysc_leave         # load adr. of system ret, no work
+       larl    %r14,sysc_restore       # load adr. of system ret, no work
        jg      do_single_step          # branch to do_single_step
 
 /*
@@ -554,26 +582,38 @@ io_no_vtime:
        TRACE_IRQS_OFF
        la      %r2,SP_PTREGS(%r15)     # address of register-save area
        brasl   %r14,do_IRQ             # call standard irq handler
-       TRACE_IRQS_ON
-
 io_return:
        tm      SP_PSW+1(%r15),0x01     # returning to user ?
 #ifdef CONFIG_PREEMPT
        jno     io_preempt              # no -> check for preemptive scheduling
 #else
-       jno     io_leave                # no-> skip resched & signal
+       jno     io_restore              # no-> skip resched & signal
 #endif
        tm      __TI_flags+7(%r9),_TIF_WORK_INT
        jnz     io_work                 # there is work to do (signals etc.)
+io_restore:
+#ifdef CONFIG_TRACE_IRQFLAGS
+       larl    %r1,io_restore_trace_psw
+       lpswe   0(%r1)
+io_restore_trace:
+       TRACE_IRQS_CHECK
        LOCKDEP_SYS_EXIT
+#endif
 io_leave:
        RESTORE_ALL __LC_RETURN_PSW,0
 io_done:
 
+#ifdef CONFIG_TRACE_IRQFLAGS
+       .align  8
+       .globl io_restore_trace_psw
+io_restore_trace_psw:
+       .quad   0, io_restore_trace
+#endif
+
 #ifdef CONFIG_PREEMPT
 io_preempt:
        icm     %r0,15,__TI_precount(%r9)
-       jnz     io_leave
+       jnz     io_restore
        # switch to kernel stack
        lg      %r1,SP_R15(%r15)
        aghi    %r1,-SP_SIZE
@@ -582,14 +622,9 @@ io_preempt:
        lgr     %r15,%r1
 io_resume_loop:
        tm      __TI_flags+7(%r9),_TIF_NEED_RESCHED
-       jno     io_leave
-       larl    %r1,.Lc_pactive
-       mvc     __TI_precount(4,%r9),0(%r1)
-       stosm   __SF_EMPTY(%r15),0x03   # reenable interrupts
-       brasl   %r14,schedule           # call schedule
-       stnsm   __SF_EMPTY(%r15),0xfc   # disable I/O and ext. interrupts
-       xc      __TI_precount(4,%r9),__TI_precount(%r9)
-       j       io_resume_loop
+       jno     io_restore
+       larl    %r14,io_resume_loop
+       jg      preempt_schedule_irq
 #endif
 
 #
@@ -613,37 +648,39 @@ io_work_loop:
        jo      io_reschedule
        tm      __TI_flags+7(%r9),(_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK)
        jnz     io_sigpending
-       LOCKDEP_SYS_EXIT
-       j       io_leave
+       j       io_restore
+io_work_done:
 
 #
 # _TIF_MCCK_PENDING is set, call handler
 #
 io_mcck_pending:
-       TRACE_IRQS_OFF
        brasl   %r14,s390_handle_mcck   # TIF bit will be cleared by handler
-       TRACE_IRQS_ON
        j       io_work_loop
 
 #
 # _TIF_NEED_RESCHED is set, call schedule
 #
 io_reschedule:
+       TRACE_IRQS_ON
        stosm   __SF_EMPTY(%r15),0x03   # reenable interrupts
        brasl   %r14,schedule           # call scheduler
        stnsm   __SF_EMPTY(%r15),0xfc   # disable I/O and ext. interrupts
+       TRACE_IRQS_OFF
        tm      __TI_flags+7(%r9),_TIF_WORK_INT
-       jz      io_leave                # there is no work to do
+       jz      io_restore              # there is no work to do
        j       io_work_loop
 
 #
 # _TIF_SIGPENDING or _TIF_RESTORE_SIGMASK is set, call do_signal
 #
 io_sigpending:
+       TRACE_IRQS_ON
        stosm   __SF_EMPTY(%r15),0x03   # reenable interrupts
        la      %r2,SP_PTREGS(%r15)     # load pt_regs
        brasl   %r14,do_signal          # call do_signal
        stnsm   __SF_EMPTY(%r15),0xfc   # disable I/O and ext. interrupts
+       TRACE_IRQS_OFF
        j       io_work_loop
 
 /*
@@ -669,7 +706,6 @@ ext_no_vtime:
        la      %r2,SP_PTREGS(%r15)     # address of register-save area
        llgh    %r3,__LC_EXT_INT_CODE   # get interruption code
        brasl   %r14,do_extint
-       TRACE_IRQS_ON
        j       io_return
 
 __critical_end:
@@ -824,15 +860,15 @@ cleanup_table_system_call:
 cleanup_table_sysc_return:
        .quad   sysc_return, sysc_leave
 cleanup_table_sysc_leave:
-       .quad   sysc_leave, sysc_work_loop
+       .quad   sysc_leave, sysc_done
 cleanup_table_sysc_work_loop:
-       .quad   sysc_work_loop, sysc_reschedule
+       .quad   sysc_work_loop, sysc_work_done
 cleanup_table_io_return:
        .quad   io_return, io_leave
 cleanup_table_io_leave:
        .quad   io_leave, io_done
 cleanup_table_io_work_loop:
-       .quad   io_work_loop, io_mcck_pending
+       .quad   io_work_loop, io_work_done
 
 cleanup_critical:
        clc     8(8,%r12),BASED(cleanup_table_system_call)
@@ -901,8 +937,6 @@ cleanup_system_call:
 cleanup_vtime:
        clc     __LC_RETURN_PSW+8(8),BASED(cleanup_system_call_insn+24)
        jhe     cleanup_stime
-       tm      SP_PSW+1(%r15),0x01     # interrupting from user ?
-       jz      cleanup_novtime
        UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER
 cleanup_stime:
        clc     __LC_RETURN_PSW+8(8),BASED(cleanup_system_call_insn+32)
@@ -910,7 +944,6 @@ cleanup_stime:
        UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
 cleanup_update:
        mvc     __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER
-cleanup_novtime:
 #endif
        mvc     __LC_RETURN_PSW+8(8),BASED(cleanup_table_system_call+8)
        la      %r12,__LC_RETURN_PSW
@@ -949,10 +982,10 @@ cleanup_sysc_leave:
 2:     la      %r12,__LC_RETURN_PSW
        br      %r14
 cleanup_sysc_leave_insn:
+       .quad   sysc_done - 4
 #ifdef CONFIG_VIRT_CPU_ACCOUNTING
-       .quad   sysc_leave + 16
+       .quad   sysc_done - 8
 #endif
-       .quad   sysc_leave + 12
 
 cleanup_io_return:
        mvc     __LC_RETURN_PSW(8),0(%r12)
@@ -979,17 +1012,16 @@ cleanup_io_leave:
 2:     la      %r12,__LC_RETURN_PSW
        br      %r14
 cleanup_io_leave_insn:
+       .quad   io_done - 4
 #ifdef CONFIG_VIRT_CPU_ACCOUNTING
-       .quad   io_leave + 20
+       .quad   io_done - 8
 #endif
-       .quad   io_leave + 16
 
 /*
  * Integer constants
  */
                .align  4
 .Lconst:
-.Lc_pactive:   .long   PREEMPT_ACTIVE
 .Lnr_syscalls: .long   NR_syscalls
 .L0x0130:      .short  0x130
 .L0x0140:      .short  0x140
index 96492cf2d491d38d4d6000cddb1a38fb4b1463fb..29f7884b4ffad57c3f709f714959dc8c52c7f3f1 100644 (file)
@@ -92,6 +92,7 @@ EXPORT_SYMBOL(unregister_idle_notifier);
 
 void do_monitor_call(struct pt_regs *regs, long interruption_code)
 {
+#ifdef CONFIG_SMP
        struct s390_idle_data *idle;
 
        idle = &__get_cpu_var(s390_idle);
@@ -99,7 +100,7 @@ void do_monitor_call(struct pt_regs *regs, long interruption_code)
        idle->idle_time += get_clock() - idle->idle_enter;
        idle->in_idle = 0;
        spin_unlock(&idle->lock);
-
+#endif
        /* disable monitor call class 0 */
        __ctl_clear_bit(8, 15);
 
@@ -114,7 +115,9 @@ extern void s390_handle_mcck(void);
 static void default_idle(void)
 {
        int cpu, rc;
+#ifdef CONFIG_SMP
        struct s390_idle_data *idle;
+#endif
 
        /* CPU is going idle. */
        cpu = smp_processor_id();
@@ -151,13 +154,14 @@ static void default_idle(void)
                s390_handle_mcck();
                return;
        }
-
+#ifdef CONFIG_SMP
        idle = &__get_cpu_var(s390_idle);
        spin_lock(&idle->lock);
        idle->idle_count++;
        idle->in_idle = 1;
        idle->idle_enter = get_clock();
        spin_unlock(&idle->lock);
+#endif
        trace_hardirqs_on();
        /* Wait for external, I/O or machine check interrupt. */
        __load_psw_mask(psw_kernel_bits | PSW_MASK_WAIT |
index 7e1bfb98406404c87bd290b2fe4d9a181980ebe0..50f8f1e3760e0689ae0564fc1ce7ca0bfc63b1b1 100644 (file)
@@ -347,7 +347,7 @@ void (*_machine_power_off)(void) = do_machine_power_off_nonsmp;
 
 void machine_restart(char *command)
 {
-       if (!in_interrupt() || oops_in_progress)
+       if ((!in_interrupt() && !in_atomic()) || oops_in_progress)
                /*
                 * Only unblank the console if we are called in enabled
                 * context or a bust_spinlocks cleared the way for us.
@@ -492,6 +492,10 @@ static void setup_addressing_mode(void)
                printk("S390 address spaces switched, ");
                set_amode_and_uaccess(PSW_ASC_PRIMARY, PSW32_ASC_PRIMARY);
        }
+#ifdef CONFIG_TRACE_IRQFLAGS
+       sysc_restore_trace_psw.mask = psw_kernel_bits & ~PSW_MASK_MCHECK;
+       io_restore_trace_psw.mask = psw_kernel_bits & ~PSW_MASK_MCHECK;
+#endif
 }
 
 static void __init
index 1d97fe1c0e538d1df29aebd133522d09dfcf08c3..264ea906db4c1cb2b8c5258b4d448e18e9293de9 100644 (file)
@@ -193,71 +193,29 @@ int smp_call_function_single(int cpu, void (*func) (void *info), void *info,
 }
 EXPORT_SYMBOL(smp_call_function_single);
 
-static void do_send_stop(void)
+void smp_send_stop(void)
 {
        int cpu, rc;
 
-       /* stop all processors */
-       for_each_online_cpu(cpu) {
-               if (cpu == smp_processor_id())
-                       continue;
-               do {
-                       rc = signal_processor(cpu, sigp_stop);
-               } while (rc == sigp_busy);
-       }
-}
+       /* Disable all interrupts/machine checks */
+       __load_psw_mask(psw_kernel_bits & ~PSW_MASK_MCHECK);
 
-static void do_store_status(void)
-{
-       int cpu, rc;
+       /* write magic number to zero page (absolute 0) */
+       lowcore_ptr[smp_processor_id()]->panic_magic = __PANIC_MAGIC;
 
-       /* store status of all processors in their lowcores (real 0) */
+       /* stop all processors */
        for_each_online_cpu(cpu) {
                if (cpu == smp_processor_id())
                        continue;
                do {
-                       rc = signal_processor_p(
-                               (__u32)(unsigned long) lowcore_ptr[cpu], cpu,
-                               sigp_store_status_at_address);
+                       rc = signal_processor(cpu, sigp_stop);
                } while (rc == sigp_busy);
-       }
-}
 
-static void do_wait_for_stop(void)
-{
-       int cpu;
-
-       /* Wait for all other cpus to enter stopped state */
-       for_each_online_cpu(cpu) {
-               if (cpu == smp_processor_id())
-                       continue;
                while (!smp_cpu_not_running(cpu))
                        cpu_relax();
        }
 }
 
-/*
- * this function sends a 'stop' sigp to all other CPUs in the system.
- * it goes straight through.
- */
-void smp_send_stop(void)
-{
-       /* Disable all interrupts/machine checks */
-       __load_psw_mask(psw_kernel_bits & ~PSW_MASK_MCHECK);
-
-       /* write magic number to zero page (absolute 0) */
-       lowcore_ptr[smp_processor_id()]->panic_magic = __PANIC_MAGIC;
-
-       /* stop other processors. */
-       do_send_stop();
-
-       /* wait until other processors are stopped */
-       do_wait_for_stop();
-
-       /* store status of other processors. */
-       do_store_status();
-}
-
 /*
  * Reboot, halt and power_off routines for SMP.
  */
@@ -788,14 +746,14 @@ static ssize_t show_idle_time(struct sys_device *dev, char *buf)
        }
        new_time = idle->idle_time;
        spin_unlock_irq(&idle->lock);
-       return sprintf(buf, "%llu us\n", new_time >> 12);
+       return sprintf(buf, "%llu\n", new_time >> 12);
 }
-static SYSDEV_ATTR(idle_time, 0444, show_idle_time, NULL);
+static SYSDEV_ATTR(idle_time_us, 0444, show_idle_time, NULL);
 
 static struct attribute *cpu_attrs[] = {
        &attr_capability.attr,
        &attr_idle_count.attr,
-       &attr_idle_time.attr,
+       &attr_idle_time_us.attr,
        NULL,
 };
 
index 48dae49bc1ec474ffe80f3eed427a610f48d48bf..22b800ce2126d0fed3c47400229ef95f4060310b 100644 (file)
@@ -145,12 +145,8 @@ void account_ticks(u64 time)
        do_timer(ticks);
 #endif
 
-#ifdef CONFIG_VIRT_CPU_ACCOUNTING
-       account_tick_vtime(current);
-#else
        while (ticks--)
                update_process_times(user_mode(get_irq_regs()));
-#endif
 
        s390_do_profile();
 }
@@ -307,7 +303,7 @@ static cycle_t read_tod_clock(void)
 
 static struct clocksource clocksource_tod = {
        .name           = "tod",
-       .rating         = 100,
+       .rating         = 400,
        .read           = read_tod_clock,
        .mask           = -1ULL,
        .mult           = 1000,
index 8ec9def83ccbd401f336ee74e36461b25e07048a..8ed16a83fba756932ee6bf16aa3d3b927cdcca89 100644 (file)
@@ -260,6 +260,7 @@ void die(const char * str, struct pt_regs * regs, long err)
        bust_spinlocks(1);
        printk("%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter);
        print_modules();
+       notify_die(DIE_OOPS, str, regs, err, current->thread.trap_no, SIGSEGV);
        show_regs(regs);
        bust_spinlocks(0);
        add_taint(TAINT_DIE);
index 84ff78de6bacdeec58a16261e58fdaea24a0932e..c5f05b3fb2c30f1548a062280be08fc12411340d 100644 (file)
@@ -32,7 +32,7 @@ static DEFINE_PER_CPU(struct vtimer_queue, virt_cpu_timer);
  * Update process times based on virtual cpu times stored by entry.S
  * to the lowcore fields user_timer, system_timer & steal_clock.
  */
-void account_tick_vtime(struct task_struct *tsk)
+void account_process_tick(struct task_struct *tsk, int user_tick)
 {
        cputime_t cputime;
        __u64 timer, clock;
@@ -64,12 +64,6 @@ void account_tick_vtime(struct task_struct *tsk)
                S390_lowcore.steal_clock -= cputime << 12;
                account_steal_time(tsk, cputime);
        }
-
-       run_local_timers();
-       if (rcu_pending(smp_processor_id()))
-               rcu_check_callbacks(smp_processor_id(), rcu_user_flag);
-       scheduler_tick();
-       run_posix_cpu_timers(tsk);
 }
 
 /*
index d4ed93dfb9c7fba3eada5ccbcf4cdf66c39ebc8a..413c240cbca773bb964b01cfc75506d0345180e1 100644 (file)
@@ -341,19 +341,16 @@ cmm_timeout_handler(ctl_table *ctl, int write, struct file *filp,
 
 static struct ctl_table cmm_table[] = {
        {
-               .ctl_name       = VM_CMM_PAGES,
                .procname       = "cmm_pages",
                .mode           = 0644,
                .proc_handler   = &cmm_pages_handler,
        },
        {
-               .ctl_name       = VM_CMM_TIMED_PAGES,
                .procname       = "cmm_timed_pages",
                .mode           = 0644,
                .proc_handler   = &cmm_pages_handler,
        },
        {
-               .ctl_name       = VM_CMM_TIMEOUT,
                .procname       = "cmm_timeout",
                .mode           = 0644,
                .proc_handler   = &cmm_timeout_handler,
index 247f8a65e7333c585c06566eb4069051327c2c87..496d635f89b216722df77895005ab35698ec4e8f 100644 (file)
@@ -182,9 +182,7 @@ config CPU_HAS_IPR_IRQ
        bool
 
 config CPU_HAS_SR_RB
-       bool "CPU has SR.RB"
-       depends on CPU_SH3 || CPU_SH4
-       default y
+       bool
        help
          This will enable the use of SR.RB register bank usage. Processors
          that are lacking this bit must have another method in place for
@@ -213,10 +211,12 @@ config SH_SOLUTION_ENGINE
        bool "SolutionEngine"
        select SOLUTION_ENGINE
        select CPU_HAS_IPR_IRQ
-       depends on CPU_SUBTYPE_SH7709 || CPU_SUBTYPE_SH7750
+       depends on CPU_SUBTYPE_SH7705 || CPU_SUBTYPE_SH7709 || CPU_SUBTYPE_SH7710 || \
+         CPU_SUBTYPE_SH7712 || CPU_SUBTYPE_SH7750 || CPU_SUBTYPE_SH7750S || \
+         CPU_SUBTYPE_SH7750R 
        help
-         Select SolutionEngine if configuring for a Hitachi SH7709
-         or SH7750 evaluation board.
+         Select SolutionEngine if configuring for a Hitachi SH7705, SH7709,
+         SH7710, SH7712, SH7750, SH7750S or SH7750R evaluation board.
 
 config SH_7206_SOLUTION_ENGINE
        bool "SolutionEngine7206"
@@ -291,9 +291,7 @@ config SH_DREAMCAST
        depends on CPU_SUBTYPE_SH7091
        help
          Select Dreamcast if configuring for a SEGA Dreamcast.
-         More information at
-         <http://www.m17n.org/linux-sh/dreamcast/>.  There is a
-         Dreamcast project is at <http://linuxdc.sourceforge.net/>.
+         More information at <http://www.linux-sh.org>
 
 config SH_MPC1211
        bool "Interface MPC1211"
@@ -607,7 +605,7 @@ config BOOT_LINK_OFFSET
 
 config UBC_WAKEUP
        bool "Wakeup UBC on startup"
-       depends on CPU_SH4
+       depends on CPU_SH4 && !CPU_SH4A
        help
          Selecting this option will wakeup the User Break Controller (UBC) on
          startup. Although the UBC is left in an awake state when the processor
index b507b501f0cf2f4b24190945eb2742f8babdb261..722da6851f569abe5ee44bec961ac958a2f4ad33 100644 (file)
@@ -86,6 +86,14 @@ config 4KSTACKS
          on the VM subsystem for higher order allocations. This option
          will also use IRQ stacks to compensate for the reduced stackspace.
 
+config IRQSTACKS
+       bool "Use separate kernel stacks when processing interrupts"
+       depends on DEBUG_KERNEL
+       help
+         If you say Y here the kernel will use separate kernel stacks
+         for handling hard and soft interrupts.  This can help avoid
+         overflowing the process kernel stacks.
+
 config SH_KGDB
        bool "Include KGDB kernel debugger"
        select FRAME_POINTER
@@ -116,12 +124,13 @@ config KGDB_NMI
 
 config SH_KGDB_CONSOLE
        bool "Console messages through GDB"
-       depends on !SERIAL_SH_SCI_CONSOLE
+       depends on !SERIAL_SH_SCI_CONSOLE && SERIAL_SH_SCI=y
        select SERIAL_CORE_CONSOLE
        default n
 
 config KGDB_SYSRQ
        bool "Allow SysRq 'G' to enter KGDB"
+       depends on MAGIC_SYSRQ
        default y
 
 comment "Serial port setup"
index 408342b175c8b55820b44380a7f91b955e5448f3..e189fae8b60c15d84eecb3067adfd852532aa4cc 100644 (file)
@@ -66,7 +66,7 @@ cflags-y      += $(isaflags-y) -ffreestanding
 cflags-$(CONFIG_MORE_COMPILE_OPTIONS)  += \
        $(shell echo $(CONFIG_COMPILE_OPTIONS) | sed -e 's/"//g')
 
-OBJCOPYFLAGS   := -O binary -R .note -R .comment -R .stab -R .stabstr -S
+OBJCOPYFLAGS   := -O binary -R .note -R .note.gnu.build-id -R .comment -R .stab -R .stabstr -S
 
 #
 # arch/sh/defconfig doesn't reflect any real hardware, and as such should
index 943f93aa6052cc8ddc5a3723c804819b52a84bd7..e55c6686b21fce00656724afa0b1a9fd3e35fc85 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <linux/init.h>
 #include <linux/irq.h>
+#include <linux/interrupt.h>
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/hs7751rvoip.h>
index fa5fa39202227f97e5e23d619f0482b3e348293a..c05625975f2c7fb62c2064b628247a3b6ae0d077 100644 (file)
 #include <asm/io.h>
 #include <asm/machvec.h>
 
-static struct ipr_data hs77501rvoip_ipr_map[] = {
-#if defined(CONFIG_HS7751RVOIP_CODEC)
-       { DMTE0_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY },
-       { DMTE1_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY },
-#endif
-};
-
-static void __init hs7751rvoip_init_irq(void)
-{
-       make_ipr_irq(hs77501rvoip_ipr_map, ARRAY_SIZE(hs77501rvoip_ipr_map));
-
-       init_hs7751rvoip_IRQ();
-}
-
 static void hs7751rvoip_power_off(void)
 {
        ctrl_outw(ctrl_inw(PA_OUTPORTR) & 0xffdf, PA_OUTPORTR);
@@ -75,14 +61,13 @@ static int __init hs7751rvoip_cf_init(void)
 
        return 0;
 }
+device_initcall(hs7751rvoip_cf_init);
 
 /*
  * Initialize the board
  */
 static void __init hs7751rvoip_setup(char **cmdline_p)
 {
-       device_initcall(hs7751rvoip_cf_init);
-
        ctrl_outb(0xf0, PA_OUTPORTR);
        pm_power_off = hs7751rvoip_power_off;
 
@@ -115,6 +100,6 @@ static struct sh_machine_vector mv_hs7751rvoip __initmv = {
        .mv_outsw               = hs7751rvoip_outsw,
        .mv_outsl               = hs7751rvoip_outsl,
 
-       .mv_init_irq            = hs7751rvoip_init_irq,
+       .mv_init_irq            = init_hs7751rvoip_IRQ,
        .mv_ioport_map          = hs7751rvoip_ioport_map,
 };
index afe9de73666ad8117f8e63b4abd054c16e012427..0fdc0bc19145d8f2f8a37bfb79b21b2db741903e 100644 (file)
@@ -16,6 +16,8 @@
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/pata_platform.h>
+#include <linux/types.h>
+#include <net/ax88796.h>
 #include <asm/machvec.h>
 #include <asm/r7780rp.h>
 #include <asm/clock.h>
@@ -136,11 +138,50 @@ static struct platform_device heartbeat_device = {
        .resource       = heartbeat_resources,
 };
 
+static struct ax_plat_data ax88796_platdata = {
+       .flags          = AXFLG_HAS_93CX6,
+       .wordlength     = 2,
+       .dcr_val        = 0x1,
+       .rcr_val        = 0x40,
+};
+
+static struct resource ax88796_resources[] = {
+       {
+#ifdef CONFIG_SH_R7780RP
+               .start  = 0xa5800400,
+               .end    = 0xa5800400 + (0x20 * 0x2) - 1,
+#else
+               .start  = 0xa4100400,
+               .end    = 0xa4100400 + (0x20 * 0x2) - 1,
+#endif
+               .flags  = IORESOURCE_MEM,
+       },
+       {
+               .start  = IRQ_AX88796,
+               .end    = IRQ_AX88796,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device ax88796_device = {
+       .name           = "ax88796",
+       .id             = 0,
+
+       .dev    = {
+               .platform_data = &ax88796_platdata,
+       },
+
+       .num_resources  = ARRAY_SIZE(ax88796_resources),
+       .resource       = ax88796_resources,
+};
+
+
 static struct platform_device *r7780rp_devices[] __initdata = {
        &r8a66597_usb_host_device,
        &m66592_usb_peripheral_device,
        &cf_ide_device,
        &heartbeat_device,
+       &ax88796_device,
 };
 
 static int __init r7780rp_devices_setup(void)
@@ -183,6 +224,34 @@ static void r7780rp_power_off(void)
                ctrl_outw(0x0001, PA_POFF);
 }
 
+static inline unsigned char is_ide_ioaddr(unsigned long addr)
+{
+       return ((cf_ide_resources[0].start <= addr &&
+                addr <= cf_ide_resources[0].end) ||
+               (cf_ide_resources[1].start <= addr &&
+                addr <= cf_ide_resources[1].end));
+}
+
+void highlander_writeb(u8 b, void __iomem *addr)
+{
+       unsigned long tmp = (unsigned long __force)addr;
+
+       if (is_ide_ioaddr(tmp))
+               ctrl_outw((u16)b, tmp);
+       else
+               ctrl_outb(b, tmp);
+}
+
+u8 highlander_readb(void __iomem *addr)
+{
+       unsigned long tmp = (unsigned long __force)addr;
+
+       if (is_ide_ioaddr(tmp))
+               return ctrl_inw(tmp) & 0xff;
+       else
+               return ctrl_inb(tmp);
+}
+
 /*
  * Initialize the board
  */
@@ -267,4 +336,6 @@ static struct sh_machine_vector mv_highlander __initmv = {
        .mv_setup               = highlander_setup,
        .mv_init_irq            = highlander_init_irq,
        .mv_irq_demux           = highlander_irq_demux,
+       .mv_readb               = highlander_readb,
+       .mv_writeb              = highlander_writeb,
 };
index 37f2c0b447fe48798b64e07fd2a28d626bcfea02..8125d20fdbd8695e722ae848c71a87db29e4d7dc 100644 (file)
@@ -53,10 +53,12 @@ static struct resource cf_ide_resources[] = {
                .end    = PA_AREA5_IO + 0x80c,
                .flags  = IORESOURCE_MEM,
        },
+#ifndef CONFIG_RTS7751R2D_1 /* For R2D-1 polling is preferred */
        [2] = {
                .start  = IRQ_CF_IDE,
                .flags  = IORESOURCE_IRQ,
        },
+#endif
 };
 
 static struct pata_platform_info pata_info = {
index 2dce8bd97f90408a9f2229399955664d8ddffc96..0d56fd83bcba750c07c3267e30fed4565a92064f 100644 (file)
@@ -11,7 +11,6 @@
 #include <asm/machvec.h>
 #include <asm/irq.h>
 #include <asm/io.h>
-#include <asm/irq.h>
 
 static struct ipr_data sh7710voipgw_ipr_map[] = {
        { TIMER2_IRQ, TIMER2_IPR_ADDR, TIMER2_IPR_POS, TIMER2_PRIORITY },
index 27da88486f73bb4bf84aab19787a28ce6ac68702..9d5bfc77d0de2ad62e8346158f1b97ee15bcf7fc 100644 (file)
@@ -9,7 +9,6 @@
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/io.h>
-#include <linux/irq.h>
 #include <linux/interrupt.h>
 #include <asm/se7206.h>
 
index d07a3368f5462d4253ac1d4b6ca6c5ce6cfbab6d..318bc8a3969c2d1d03fbbbb68a8b75225287302a 100644 (file)
@@ -94,6 +94,7 @@ static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
 static struct heartbeat_data heartbeat_data = {
        .bit_pos        = heartbeat_bit_pos,
        .nr_bits        = ARRAY_SIZE(heartbeat_bit_pos),
+       .regsize        = 16,
 };
 
 static struct resource heartbeat_resources[] = {
index 03b63457e1780c9fb3c77ec5bf185eaa4abfd7f0..eb97dca5b736c4fce596c74c55476ace350b3424 100644 (file)
 #include <asm/machvec.h>
 #include <asm/se7722.h>
 #include <asm/io.h>
+#include <asm/heartbeat.h>
 
 /* Heartbeat */
+static struct heartbeat_data heartbeat_data = {
+       .regsize = 16,
+};
+
 static struct resource heartbeat_resources[] = {
        [0] = {
                .start  = PA_LED,
@@ -29,6 +34,9 @@ static struct resource heartbeat_resources[] = {
 static struct platform_device heartbeat_device = {
        .name           = "heartbeat",
        .id             = -1,
+       .dev = {
+               .platform_data = &heartbeat_data,
+       },
        .num_resources  = ARRAY_SIZE(heartbeat_resources),
        .resource       = heartbeat_resources,
 };
@@ -103,8 +111,8 @@ static void __init se7722_setup(char **cmdline_p)
 
        ctrl_outl(0x00051001, MSTPCR0);
        ctrl_outl(0x00000000, MSTPCR1);
-       /* KEYSC, VOU, BEU, CEU, VEU, VPU, LCDC */
-       ctrl_outl(0xffffbfC0, MSTPCR2);
+       /* KEYSC, VOU, BEU, CEU, VEU, VPU, LCDC, USB */
+       ctrl_outl(0xffffb7c0, MSTPCR2);
 
        ctrl_outw(0x0000, PORT_PECR);   /* PORT E 1 = IRQ5 ,E 0 = BS */
        ctrl_outw(0x1000, PORT_PJCR);   /* PORT J 1 = IRQ1,J 0 =IRQ0 */
index 76e53b26a808d4a8dc976acd87d7e6711c41951d..0f08ab3b2beca4ca26d6d348e114b23fd740a087 100644 (file)
 #include <asm/machvec.h>
 #include <asm/se7780.h>
 #include <asm/io.h>
+#include <asm/heartbeat.h>
 
 /* Heartbeat */
+static struct heartbeat_data heartbeat_data = {
+       .regsize = 16,
+};
+
 static struct resource heartbeat_resources[] = {
        [0] = {
                .start  = PA_LED,
@@ -27,6 +32,9 @@ static struct resource heartbeat_resources[] = {
 static struct platform_device heartbeat_device = {
        .name           = "heartbeat",
        .id             = -1,
+       .dev = {
+               .platform_data = &heartbeat_data,
+       },
        .num_resources  = ARRAY_SIZE(heartbeat_resources),
        .resource       = heartbeat_resources,
 };
index 59fc976bfc2f99bc5c4cfd424f9b47039b59ab13..d2d2f4b6a502469006440148b0d12b83bdfc7e49 100644 (file)
@@ -2,5 +2,4 @@
 # Makefile for the SnapGear specific parts of the kernel
 #
 
-obj-y   := setup.o io.o rtc.o
-
+obj-y   := setup.o io.o
diff --git a/arch/sh/boards/snapgear/rtc.c b/arch/sh/boards/snapgear/rtc.c
deleted file mode 100644 (file)
index edb3dd9..0000000
+++ /dev/null
@@ -1,309 +0,0 @@
-/****************************************************************************/
-/*
- * linux/arch/sh/boards/snapgear/rtc.c -- Secureedge5410 RTC code
- *
- *  Copyright (C) 2002  David McCullough <davidm@snapgear.com>
- *  Copyright (C) 2003  Paul Mundt <lethal@linux-sh.org>
- *
- * The SecureEdge5410 can have one of 2 real time clocks, the SH
- * built in version or the preferred external DS1302.  Here we work out
- * each to see what we have and then run with it.
- */
-/****************************************************************************/
-
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/time.h>
-#include <linux/rtc.h>
-#include <linux/mc146818rtc.h>
-#include <asm/io.h>
-
-static int use_ds1302;
-
-/****************************************************************************/
-/*
- *     we need to implement a DS1302 driver here that can operate in
- *     conjunction with the builtin rtc driver which is already quite friendly
- */
-/*****************************************************************************/
-
-#define        RTC_CMD_READ    0x81            /* Read command */
-#define        RTC_CMD_WRITE   0x80            /* Write command */
-
-#define        RTC_ADDR_YEAR   0x06            /* Address of year register */
-#define        RTC_ADDR_DAY    0x05            /* Address of day of week register */
-#define        RTC_ADDR_MON    0x04            /* Address of month register */
-#define        RTC_ADDR_DATE   0x03            /* Address of day of month register */
-#define        RTC_ADDR_HOUR   0x02            /* Address of hour register */
-#define        RTC_ADDR_MIN    0x01            /* Address of minute register */
-#define        RTC_ADDR_SEC    0x00            /* Address of second register */
-
-#define        RTC_RESET       0x1000
-#define        RTC_IODATA      0x0800
-#define        RTC_SCLK        0x0400
-
-#define set_dirp(x)
-#define get_dirp(x) 0
-#define set_dp(x)      SECUREEDGE_WRITE_IOPORT(x, 0x1c00)
-#define get_dp(x)      SECUREEDGE_READ_IOPORT()
-
-static void ds1302_sendbits(unsigned int val)
-{
-       int     i;
-
-       for (i = 8; (i); i--, val >>= 1) {
-               set_dp((get_dp() & ~RTC_IODATA) | ((val & 0x1) ? RTC_IODATA : 0));
-               set_dp(get_dp() | RTC_SCLK);    // clock high
-               set_dp(get_dp() & ~RTC_SCLK);   // clock low
-       }
-}
-
-static unsigned int ds1302_recvbits(void)
-{
-       unsigned int    val;
-       int             i;
-
-       for (i = 0, val = 0; (i < 8); i++) {
-               val |= (((get_dp() & RTC_IODATA) ? 1 : 0) << i);
-               set_dp(get_dp() | RTC_SCLK);    // clock high
-               set_dp(get_dp() & ~RTC_SCLK);   // clock low
-       }
-       return(val);
-}
-
-static unsigned int ds1302_readbyte(unsigned int addr)
-{
-       unsigned int    val;
-       unsigned long   flags;
-
-       local_irq_save(flags);
-       set_dirp(get_dirp() | RTC_RESET | RTC_IODATA | RTC_SCLK);
-       set_dp(get_dp() & ~(RTC_RESET | RTC_IODATA | RTC_SCLK));
-
-       set_dp(get_dp() | RTC_RESET);
-       ds1302_sendbits(((addr & 0x3f) << 1) | RTC_CMD_READ);
-       set_dirp(get_dirp() & ~RTC_IODATA);
-       val = ds1302_recvbits();
-       set_dp(get_dp() & ~RTC_RESET);
-       local_irq_restore(flags);
-
-       return(val);
-}
-
-static void ds1302_writebyte(unsigned int addr, unsigned int val)
-{
-       unsigned long   flags;
-
-       local_irq_save(flags);
-       set_dirp(get_dirp() | RTC_RESET | RTC_IODATA | RTC_SCLK);
-       set_dp(get_dp() & ~(RTC_RESET | RTC_IODATA | RTC_SCLK));
-       set_dp(get_dp() | RTC_RESET);
-       ds1302_sendbits(((addr & 0x3f) << 1) | RTC_CMD_WRITE);
-       ds1302_sendbits(val);
-       set_dp(get_dp() & ~RTC_RESET);
-       local_irq_restore(flags);
-}
-
-static void ds1302_reset(void)
-{
-       unsigned long   flags;
-       /* Hardware dependent reset/init */
-       local_irq_save(flags);
-       set_dirp(get_dirp() | RTC_RESET | RTC_IODATA | RTC_SCLK);
-       set_dp(get_dp() & ~(RTC_RESET | RTC_IODATA | RTC_SCLK));
-       local_irq_restore(flags);
-}
-
-/*****************************************************************************/
-
-static inline int bcd2int(int val)
-{
-       return((((val & 0xf0) >> 4) * 10) + (val & 0xf));
-}
-
-static inline int int2bcd(int val)
-{
-       return(((val / 10) << 4) + (val % 10));
-}
-
-/*****************************************************************************/
-/*
- *     Write and Read some RAM in the DS1302,  if it works assume it's there
- *     Otherwise use the SH4 internal RTC
- */
-
-void snapgear_rtc_gettimeofday(struct timespec *);
-int snapgear_rtc_settimeofday(const time_t);
-
-void __init secureedge5410_rtc_init(void)
-{
-       unsigned char *test = "snapgear";
-       int i;
-
-       ds1302_reset();
-
-       use_ds1302 = 1;
-
-       for (i = 0; test[i]; i++)
-               ds1302_writebyte(32 + i, test[i]);
-
-       for (i = 0; test[i]; i++)
-               if (ds1302_readbyte(32 + i) != test[i]) {
-                       use_ds1302 = 0;
-                       break;
-               }
-
-       if (use_ds1302) {
-               rtc_sh_get_time = snapgear_rtc_gettimeofday;
-               rtc_sh_set_time = snapgear_rtc_settimeofday;
-       }
-               
-       printk("SnapGear RTC: using %s rtc.\n", use_ds1302 ? "ds1302" : "internal");
-}
-
-/****************************************************************************/
-/*
- *     our generic interface that chooses the correct code to use
- */
-
-void snapgear_rtc_gettimeofday(struct timespec *ts)
-{
-       unsigned int sec, min, hr, day, mon, yr;
-
-       if (!use_ds1302)
-               return;
-
-       sec = bcd2int(ds1302_readbyte(RTC_ADDR_SEC));
-       min = bcd2int(ds1302_readbyte(RTC_ADDR_MIN));
-       hr  = bcd2int(ds1302_readbyte(RTC_ADDR_HOUR));
-       day = bcd2int(ds1302_readbyte(RTC_ADDR_DATE));
-       mon = bcd2int(ds1302_readbyte(RTC_ADDR_MON));
-       yr  = bcd2int(ds1302_readbyte(RTC_ADDR_YEAR));
-
-bad_time:
-       if (yr > 99 || mon < 1 || mon > 12 || day > 31 || day < 1 ||
-           hr > 23 || min > 59 || sec > 59) {
-               printk(KERN_ERR
-                      "SnapGear RTC: invalid value, resetting to 1 Jan 2000\n");
-               ds1302_writebyte(RTC_ADDR_MIN,  min = 0);
-               ds1302_writebyte(RTC_ADDR_HOUR, hr  = 0);
-               ds1302_writebyte(RTC_ADDR_DAY,        7);
-               ds1302_writebyte(RTC_ADDR_DATE, day = 1);
-               ds1302_writebyte(RTC_ADDR_MON,  mon = 1);
-               ds1302_writebyte(RTC_ADDR_YEAR, yr  = 0);
-               ds1302_writebyte(RTC_ADDR_SEC,  sec = 0);
-       }
-
-       ts->tv_sec = mktime(2000 + yr, mon, day, hr, min, sec);
-       if (ts->tv_sec < 0) {
-#if 0
-               printk("BAD TIME %d %d %d %d %d %d\n", yr, mon, day, hr, min, sec);
-#endif
-               yr = 100;
-               goto bad_time;
-       }
-       ts->tv_nsec = 0;
-}
-
-int snapgear_rtc_settimeofday(const time_t secs)
-{
-       int retval = 0;
-       int real_seconds, real_minutes, cmos_minutes;
-       unsigned long nowtime;
-
-       if (!use_ds1302)
-               return 0;
-
-/*
- *     This is called direct from the kernel timer handling code.
- *     It is supposed to synchronize the kernel clock to the RTC.
- */
-
-       nowtime = secs;
-
-       /* STOP RTC */
-       ds1302_writebyte(RTC_ADDR_SEC, ds1302_readbyte(RTC_ADDR_SEC) | 0x80);
-
-       cmos_minutes = bcd2int(ds1302_readbyte(RTC_ADDR_MIN));
-
-       /*
-        * since we're only adjusting minutes and seconds,
-        * don't interfere with hour overflow. This avoids
-        * messing with unknown time zones but requires your
-        * RTC not to be off by more than 15 minutes
-        */
-       real_seconds = nowtime % 60;
-       real_minutes = nowtime / 60;
-       if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1)
-               real_minutes += 30;     /* correct for half hour time zone */
-       real_minutes %= 60;
-
-       if (abs(real_minutes - cmos_minutes) < 30) {
-               ds1302_writebyte(RTC_ADDR_MIN, int2bcd(real_minutes));
-               ds1302_writebyte(RTC_ADDR_SEC, int2bcd(real_seconds));
-       } else {
-               printk(KERN_WARNING
-                      "SnapGear RTC: can't update from %d to %d\n",
-                      cmos_minutes, real_minutes);
-               retval = -1;
-       }
-
-       /* START RTC */
-       ds1302_writebyte(RTC_ADDR_SEC, ds1302_readbyte(RTC_ADDR_SEC) & ~0x80);
-       return(0);
-}
-
-unsigned char secureedge5410_cmos_read(int addr)
-{
-       unsigned char val = 0;
-
-       if (!use_ds1302)
-               return(__CMOS_READ(addr, w));
-
-       switch(addr) {
-       case RTC_SECONDS:       val = ds1302_readbyte(RTC_ADDR_SEC);  break;
-       case RTC_SECONDS_ALARM:                                       break;
-       case RTC_MINUTES:       val = ds1302_readbyte(RTC_ADDR_MIN);  break;
-       case RTC_MINUTES_ALARM:                                       break;
-       case RTC_HOURS:         val = ds1302_readbyte(RTC_ADDR_HOUR); break;
-       case RTC_HOURS_ALARM:                                         break;
-       case RTC_DAY_OF_WEEK:   val = ds1302_readbyte(RTC_ADDR_DAY);  break;
-       case RTC_DAY_OF_MONTH:  val = ds1302_readbyte(RTC_ADDR_DATE); break;
-       case RTC_MONTH:         val = ds1302_readbyte(RTC_ADDR_MON);  break;
-       case RTC_YEAR:          val = ds1302_readbyte(RTC_ADDR_YEAR); break;
-       case RTC_REG_A:         /* RTC_FREQ_SELECT */                 break;
-       case RTC_REG_B:         /* RTC_CONTROL */                     break;
-       case RTC_REG_C:         /* RTC_INTR_FLAGS */                  break;
-       case RTC_REG_D:         val = RTC_VRT /* RTC_VALID */;        break;
-       default:                                                      break;
-       }
-
-       return(val);
-}
-
-void secureedge5410_cmos_write(unsigned char val, int addr)
-{
-       if (!use_ds1302) {
-               __CMOS_WRITE(val, addr, w);
-               return;
-       }
-
-       switch(addr) {
-       case RTC_SECONDS:       ds1302_writebyte(RTC_ADDR_SEC, val);  break;
-       case RTC_SECONDS_ALARM:                                       break;
-       case RTC_MINUTES:       ds1302_writebyte(RTC_ADDR_MIN, val);  break;
-       case RTC_MINUTES_ALARM:                                       break;
-       case RTC_HOURS:         ds1302_writebyte(RTC_ADDR_HOUR, val); break;
-       case RTC_HOURS_ALARM:                                         break;
-       case RTC_DAY_OF_WEEK:   ds1302_writebyte(RTC_ADDR_DAY, val);  break;
-       case RTC_DAY_OF_MONTH:  ds1302_writebyte(RTC_ADDR_DATE, val); break;
-       case RTC_MONTH:         ds1302_writebyte(RTC_ADDR_MON, val);  break;
-       case RTC_YEAR:          ds1302_writebyte(RTC_ADDR_YEAR, val); break;
-       case RTC_REG_A:         /* RTC_FREQ_SELECT */                 break;
-       case RTC_REG_B:         /* RTC_CONTROL */                     break;
-       case RTC_REG_C:         /* RTC_INTR_FLAGS */                  break;
-       case RTC_REG_D:         /* RTC_VALID */                       break;
-       default:                                                      break;
-       }
-}
index 2b594f6000022c9904ea9df0a9ab1aabb8483328..7022483f98e8d8f6e73a0e6d6dbf99b3f05e9b99 100644 (file)
 #include <asm/snapgear.h>
 #include <asm/irq.h>
 #include <asm/io.h>
-#include <asm/rtc.h>
 #include <asm/cpu/timer.h>
 
-extern void secureedge5410_rtc_init(void);
-extern void pcibios_init(void);
-
-/****************************************************************************/
 /*
  * EraseConfig handling functions
  */
 
 static irqreturn_t eraseconfig_interrupt(int irq, void *dev_id)
 {
-       volatile char dummy __attribute__((unused)) = * (volatile char *) 0xb8000000;
+       (void)ctrl_inb(0xb8000000);     /* dummy read */
 
        printk("SnapGear: erase switch interrupt!\n");
 
@@ -75,20 +70,11 @@ static void __init init_snapgear_IRQ(void)
        plat_irq_setup_pins(IRQ_MODE_IRQ);
 }
 
-/*
- * Initialize the board
- */
-static void __init snapgear_setup(char **cmdline_p)
-{
-       board_time_init = secureedge5410_rtc_init;
-}
-
 /*
  * The Machine Vector
  */
 static struct sh_machine_vector mv_snapgear __initmv = {
        .mv_name                = "SnapGear SecureEdge5410",
-       .mv_setup               = snapgear_setup,
        .mv_nr_irqs             = 72,
 
        .mv_inb                 = snapgear_inb,
index 4c5ffdcd55b675aead50a32aaffe86c095ce8456..1b0f5be01d10af623d497bf9a19d0063302a74e9 100644 (file)
@@ -39,7 +39,7 @@ KERNEL_LOAD   := $(shell /bin/bash -c 'printf "0x%8x" \
 
 quiet_cmd_uimage = UIMAGE  $@
       cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \
-                  -C gzip -a $(KERNEL_LOAD) -e $(KERNEL_LOAD) \
+                  -C none -a $(KERNEL_LOAD) -e $(KERNEL_LOAD) \
                   -n 'Linux-$(KERNELRELEASE)' -d $< $@
 
 $(obj)/uImage: $(obj)/zImage FORCE
index a106dd9db98639945396f06e8a6c4c1f5bc7e4c6..f7de4076e242de1c30097344d711389b67ab5637 100644 (file)
@@ -1,2 +1,4 @@
 obj-$(CONFIG_HD64461)  += hd64461.o
 obj-$(CONFIG_HD64465)  += hd64465/
+
+EXTRA_CFLAGS += -Werror
index 085de72fd327b8d69cacd8eaecfbe06aaa71442f..f73963cb3744d0635ce8484ac3fa0315df67b6a6 100644 (file)
@@ -6,3 +6,4 @@ obj-y   := irq.o setup.o
 
 obj-$(CONFIG_USB_OHCI_HCD)     += consistent.o
 
+EXTRA_CFLAGS += -Werror
index ac4de4973b60c74b73a39b5ec8ec6a4a1955eb69..2ad804ec920a62d6f3373f74955f595f2dc138f0 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.22-rc4
-# Mon Jun 11 10:24:57 2007
+# Linux kernel version: 2.6.24-rc2
+# Tue Nov 13 20:32:39 2007
 #
 CONFIG_SUPERH=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
@@ -13,38 +13,39 @@ CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_GENERIC_TIME=y
 CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_SYS_SUPPORTS_PCI=y
 CONFIG_STACKTRACE_SUPPORT=y
 CONFIG_LOCKDEP_SUPPORT=y
 # CONFIG_ARCH_HAS_ILOG2_U32 is not set
 # CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_ARCH_NO_VIRT_TO_BUS=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
-# Code maturity level options
+# General setup
 #
 CONFIG_EXPERIMENTAL=y
 CONFIG_BROKEN_ON_SMP=y
 CONFIG_LOCK_KERNEL=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
-
-#
-# General setup
-#
 CONFIG_LOCALVERSION=""
 CONFIG_LOCALVERSION_AUTO=y
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
-# CONFIG_IPC_NS is not set
 CONFIG_SYSVIPC_SYSCTL=y
 # CONFIG_POSIX_MQUEUE is not set
 CONFIG_BSD_PROCESS_ACCT=y
 # CONFIG_BSD_PROCESS_ACCT_V3 is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_UTS_NS is not set
+# CONFIG_USER_NS is not set
 # CONFIG_AUDIT is not set
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FAIR_USER_SCHED=y
+# CONFIG_FAIR_CGROUP_SCHED is not set
 # CONFIG_SYSFS_DEPRECATED is not set
 # CONFIG_RELAY is not set
 # CONFIG_BLK_DEV_INITRD is not set
@@ -65,7 +66,6 @@ CONFIG_BASE_FULL=y
 CONFIG_ANON_INODES=y
 # CONFIG_EPOLL is not set
 CONFIG_SIGNALFD=y
-CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
 CONFIG_VM_EVENT_COUNTERS=y
@@ -74,24 +74,17 @@ CONFIG_SLAB=y
 # CONFIG_SLOB is not set
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
-
-#
-# Loadable module support
-#
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_FORCE_UNLOAD is not set
 # CONFIG_MODVERSIONS is not set
 # CONFIG_MODULE_SRCVERSION_ALL is not set
 CONFIG_KMOD=y
-
-#
-# Block layer
-#
 CONFIG_BLOCK=y
 # CONFIG_LBD is not set
 # CONFIG_BLK_DEV_IO_TRACE is not set
 # CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
 
 #
 # IO Schedulers
@@ -113,7 +106,6 @@ CONFIG_CPU_SH4=y
 CONFIG_CPU_SH4A=y
 # CONFIG_CPU_SUBTYPE_SH7619 is not set
 # CONFIG_CPU_SUBTYPE_SH7206 is not set
-# CONFIG_CPU_SUBTYPE_SH7300 is not set
 # CONFIG_CPU_SUBTYPE_SH7705 is not set
 # CONFIG_CPU_SUBTYPE_SH7706 is not set
 # CONFIG_CPU_SUBTYPE_SH7707 is not set
@@ -121,6 +113,7 @@ CONFIG_CPU_SH4A=y
 # CONFIG_CPU_SUBTYPE_SH7709 is not set
 # CONFIG_CPU_SUBTYPE_SH7710 is not set
 # CONFIG_CPU_SUBTYPE_SH7712 is not set
+# CONFIG_CPU_SUBTYPE_SH7720 is not set
 # CONFIG_CPU_SUBTYPE_SH7750 is not set
 # CONFIG_CPU_SUBTYPE_SH7091 is not set
 # CONFIG_CPU_SUBTYPE_SH7750R is not set
@@ -129,12 +122,10 @@ CONFIG_CPU_SH4A=y
 # CONFIG_CPU_SUBTYPE_SH7751R is not set
 # CONFIG_CPU_SUBTYPE_SH7760 is not set
 # CONFIG_CPU_SUBTYPE_SH4_202 is not set
-# CONFIG_CPU_SUBTYPE_ST40STB1 is not set
-# CONFIG_CPU_SUBTYPE_ST40GX1 is not set
 # CONFIG_CPU_SUBTYPE_SH7770 is not set
 CONFIG_CPU_SUBTYPE_SH7780=y
 # CONFIG_CPU_SUBTYPE_SH7785 is not set
-# CONFIG_CPU_SUBTYPE_SH73180 is not set
+# CONFIG_CPU_SUBTYPE_SHX3 is not set
 # CONFIG_CPU_SUBTYPE_SH7343 is not set
 # CONFIG_CPU_SUBTYPE_SH7722 is not set
 
@@ -169,6 +160,7 @@ CONFIG_FLATMEM_MANUAL=y
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_SPARSEMEM_STATIC=y
+# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=0
@@ -178,8 +170,9 @@ CONFIG_NR_QUICK=2
 # Cache configuration
 #
 # CONFIG_SH_DIRECT_MAPPED is not set
-# CONFIG_SH_WRITETHROUGH is not set
-# CONFIG_SH_OCRAM is not set
+CONFIG_CACHE_WRITEBACK=y
+# CONFIG_CACHE_WRITETHROUGH is not set
+# CONFIG_CACHE_OFF is not set
 
 #
 # Processor features
@@ -187,12 +180,11 @@ CONFIG_NR_QUICK=2
 CONFIG_CPU_LITTLE_ENDIAN=y
 # CONFIG_CPU_BIG_ENDIAN is not set
 CONFIG_SH_FPU=y
-# CONFIG_SH_DSP is not set
 CONFIG_SH_STORE_QUEUES=y
 CONFIG_SPECULATIVE_EXECUTION=y
 CONFIG_CPU_HAS_INTEVT=y
-CONFIG_CPU_HAS_INTC_IRQ=y
 CONFIG_CPU_HAS_SR_RB=y
+CONFIG_CPU_HAS_FPU=y
 
 #
 # Board support
@@ -212,6 +204,7 @@ CONFIG_SH_PCLK_FREQ=32000000
 # CONFIG_TICK_ONESHOT is not set
 # CONFIG_NO_HZ is not set
 # CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
 
 #
 # CPU Frequency scaling
@@ -226,7 +219,6 @@ CONFIG_SH_PCLK_FREQ=32000000
 #
 # Companion Chips
 #
-# CONFIG_HD6446X_SERIES is not set
 
 #
 # Additional SuperH Device Drivers
@@ -244,18 +236,17 @@ CONFIG_HZ_250=y
 CONFIG_HZ=250
 CONFIG_KEXEC=y
 # CONFIG_CRASH_DUMP is not set
-# CONFIG_SMP is not set
 # CONFIG_PREEMPT_NONE is not set
 # CONFIG_PREEMPT_VOLUNTARY is not set
 CONFIG_PREEMPT=y
 CONFIG_PREEMPT_BKL=y
+CONFIG_GUSA=y
 
 #
 # Boot options
 #
 CONFIG_ZERO_PAGE_OFFSET=0x00001000
 CONFIG_BOOT_LINK_OFFSET=0x00800000
-# CONFIG_UBC_WAKEUP is not set
 CONFIG_CMDLINE_BOOL=y
 CONFIG_CMDLINE="console=ttySC0,115200 root=/dev/sda1"
 
@@ -267,11 +258,8 @@ CONFIG_SH_PCIDMA_NONCOHERENT=y
 CONFIG_PCI_AUTO=y
 CONFIG_PCI_AUTO_UPDATE_RESOURCES=y
 # CONFIG_ARCH_SUPPORTS_MSI is not set
+CONFIG_PCI_LEGACY=y
 # CONFIG_PCI_DEBUG is not set
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
 # CONFIG_PCCARD is not set
 # CONFIG_HOTPLUG_PCI is not set
 
@@ -281,11 +269,6 @@ CONFIG_PCI_AUTO_UPDATE_RESOURCES=y
 CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
 
-#
-# Power management options (EXPERIMENTAL)
-#
-# CONFIG_PM is not set
-
 #
 # Networking
 #
@@ -327,6 +310,7 @@ CONFIG_IP_PNP_DHCP=y
 CONFIG_INET_XFRM_MODE_TRANSPORT=y
 CONFIG_INET_XFRM_MODE_TUNNEL=y
 CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
@@ -353,10 +337,6 @@ CONFIG_LLC=m
 # CONFIG_LAPB is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
-
-#
-# QoS and/or fair queueing
-#
 # CONFIG_NET_SCHED is not set
 
 #
@@ -376,6 +356,7 @@ CONFIG_WIRELESS_EXT=y
 # CONFIG_MAC80211 is not set
 # CONFIG_IEEE80211 is not set
 # CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
 
 #
 # Device Drivers
@@ -384,33 +365,17 @@ CONFIG_WIRELESS_EXT=y
 #
 # Generic Driver Options
 #
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=m
 # CONFIG_DEBUG_DRIVER is not set
 # CONFIG_DEBUG_DEVRES is not set
 # CONFIG_SYS_HYPERVISOR is not set
-
-#
-# Connector - unified userspace <-> kernelspace linker
-#
 # CONFIG_CONNECTOR is not set
 # CONFIG_MTD is not set
-
-#
-# Parallel port support
-#
 # CONFIG_PARPORT is not set
-
-#
-# Plug and Play support
-#
-# CONFIG_PNPACPI is not set
-
-#
-# Block devices
-#
-# CONFIG_BLK_CPQ_DA is not set
+CONFIG_BLK_DEV=y
 # CONFIG_BLK_CPQ_CISS_DA is not set
 # CONFIG_BLK_DEV_DAC960 is not set
 # CONFIG_BLK_DEV_UMEM is not set
@@ -424,14 +389,11 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
 CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
-
-#
-# Misc devices
-#
+CONFIG_MISC_DEVICES=y
 # CONFIG_PHANTOM is not set
+CONFIG_EEPROM_93CX6=y
 # CONFIG_SGI_IOC4 is not set
 # CONFIG_TIFM_CORE is not set
-# CONFIG_BLINK is not set
 # CONFIG_IDE is not set
 
 #
@@ -439,6 +401,7 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
 #
 # CONFIG_RAID_ATTRS is not set
 CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
 # CONFIG_SCSI_TGT is not set
 # CONFIG_SCSI_NETLINK is not set
 CONFIG_SCSI_PROC_FS=y
@@ -468,12 +431,9 @@ CONFIG_SCSI_WAIT_SCAN=m
 # CONFIG_SCSI_SPI_ATTRS is not set
 # CONFIG_SCSI_FC_ATTRS is not set
 # CONFIG_SCSI_ISCSI_ATTRS is not set
-# CONFIG_SCSI_SAS_ATTRS is not set
 # CONFIG_SCSI_SAS_LIBSAS is not set
-
-#
-# SCSI low-level drivers
-#
+# CONFIG_SCSI_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_ISCSI_TCP is not set
 # CONFIG_BLK_DEV_3W_XXXX_RAID is not set
 # CONFIG_SCSI_3W_9XXX is not set
@@ -483,7 +443,6 @@ CONFIG_SCSI_WAIT_SCAN=m
 # CONFIG_SCSI_AIC7XXX_OLD is not set
 # CONFIG_SCSI_AIC79XX is not set
 # CONFIG_SCSI_AIC94XX is not set
-# CONFIG_SCSI_DPT_I2O is not set
 # CONFIG_SCSI_ARCMSR is not set
 # CONFIG_MEGARAID_NEWGEN is not set
 # CONFIG_MEGARAID_LEGACY is not set
@@ -548,6 +507,7 @@ CONFIG_SATA_SIL=y
 # CONFIG_PATA_OLDPIIX is not set
 # CONFIG_PATA_NETCELL is not set
 # CONFIG_PATA_NS87410 is not set
+# CONFIG_PATA_NS87415 is not set
 # CONFIG_PATA_OPTI is not set
 # CONFIG_PATA_OPTIDMA is not set
 # CONFIG_PATA_PDC_OLD is not set
@@ -561,59 +521,43 @@ CONFIG_SATA_SIL=y
 # CONFIG_PATA_VIA is not set
 # CONFIG_PATA_WINBOND is not set
 CONFIG_PATA_PLATFORM=y
-
-#
-# Multi-device support (RAID and LVM)
-#
 # CONFIG_MD is not set
-
-#
-# Fusion MPT device support
-#
 # CONFIG_FUSION is not set
-# CONFIG_FUSION_SPI is not set
-# CONFIG_FUSION_FC is not set
-# CONFIG_FUSION_SAS is not set
 
 #
 # IEEE 1394 (FireWire) support
 #
 # CONFIG_FIREWIRE is not set
 # CONFIG_IEEE1394 is not set
-
-#
-# I2O device support
-#
 # CONFIG_I2O is not set
-
-#
-# Network device support
-#
 CONFIG_NETDEVICES=y
+# CONFIG_NETDEVICES_MULTIQUEUE is not set
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
+# CONFIG_VETH is not set
+# CONFIG_IP1000 is not set
 # CONFIG_ARCNET is not set
 # CONFIG_PHYLIB is not set
-
-#
-# Ethernet (10 or 100Mbit)
-#
 CONFIG_NET_ETHERNET=y
 CONFIG_MII=y
+CONFIG_AX88796=y
+CONFIG_AX88796_93CX6=y
 # CONFIG_STNIC is not set
 # CONFIG_HAPPYMEAL is not set
 # CONFIG_SUNGEM is not set
 # CONFIG_CASSINI is not set
 # CONFIG_NET_VENDOR_3COM is not set
 # CONFIG_SMC91X is not set
-
-#
-# Tulip family network device support
-#
+# CONFIG_SMC911X is not set
 # CONFIG_NET_TULIP is not set
 # CONFIG_HP100 is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
 CONFIG_NET_PCI=y
 CONFIG_PCNET32=m
 # CONFIG_PCNET32_NAPI is not set
@@ -621,7 +565,6 @@ CONFIG_PCNET32=m
 # CONFIG_ADAPTEC_STARFIRE is not set
 # CONFIG_B44 is not set
 # CONFIG_FORCEDETH is not set
-# CONFIG_DGRS is not set
 # CONFIG_EEPRO100 is not set
 # CONFIG_E100 is not set
 # CONFIG_FEALNX is not set
@@ -647,6 +590,7 @@ CONFIG_NETDEV_1000=y
 CONFIG_E1000=m
 # CONFIG_E1000_NAPI is not set
 # CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
+# CONFIG_E1000E is not set
 # CONFIG_NS83820 is not set
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
@@ -664,11 +608,14 @@ CONFIG_R8169=y
 CONFIG_NETDEV_10000=y
 # CONFIG_CHELSIO_T1 is not set
 # CONFIG_CHELSIO_T3 is not set
+# CONFIG_IXGBE is not set
 # CONFIG_IXGB is not set
 # CONFIG_S2IO is not set
 # CONFIG_MYRI10GE is not set
 # CONFIG_NETXEN_NIC is not set
+# CONFIG_NIU is not set
 # CONFIG_MLX4_CORE is not set
+# CONFIG_TEHUTI is not set
 # CONFIG_TR is not set
 
 #
@@ -686,15 +633,7 @@ CONFIG_NETDEV_10000=y
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
-
-#
-# ISDN subsystem
-#
 # CONFIG_ISDN is not set
-
-#
-# Telephony Support
-#
 # CONFIG_PHONE is not set
 
 #
@@ -702,6 +641,7 @@ CONFIG_NETDEV_10000=y
 #
 CONFIG_INPUT=y
 # CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
 
 #
 # Userland interfaces
@@ -711,7 +651,6 @@ CONFIG_INPUT_MOUSEDEV=y
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
 # CONFIG_INPUT_EVDEV is not set
 # CONFIG_INPUT_EVBUG is not set
 
@@ -765,21 +704,11 @@ CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
-
-#
-# IPMI
-#
 # CONFIG_IPMI_HANDLER is not set
-# CONFIG_WATCHDOG is not set
 CONFIG_HW_RANDOM=y
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
-# CONFIG_DRM is not set
 # CONFIG_RAW_DRIVER is not set
-
-#
-# TPM devices
-#
 # CONFIG_TCG_TPM is not set
 CONFIG_DEVPORT=y
 # CONFIG_I2C is not set
@@ -789,21 +718,31 @@ CONFIG_DEVPORT=y
 #
 # CONFIG_SPI is not set
 # CONFIG_SPI_MASTER is not set
-
-#
-# Dallas's 1-wire bus
-#
 # CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
 CONFIG_HWMON=y
 # CONFIG_HWMON_VID is not set
-# CONFIG_SENSORS_ABITUGURU is not set
 # CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_F71882FG is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_PC87360 is not set
 # CONFIG_SENSORS_PC87427 is not set
+# CONFIG_SENSORS_SIS5595 is not set
 # CONFIG_SENSORS_SMSC47M1 is not set
 # CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_VIA686A is not set
 # CONFIG_SENSORS_VT1211 is not set
+# CONFIG_SENSORS_VT8231 is not set
 # CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
 # CONFIG_HWMON_DEBUG_CHIP is not set
+# CONFIG_WATCHDOG is not set
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
 
 #
 # Multifunction device drivers
@@ -820,14 +759,16 @@ CONFIG_DAB=y
 #
 # Graphics support
 #
+# CONFIG_DRM is not set
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+# CONFIG_FB is not set
 # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
 # Display device support
 #
 # CONFIG_DISPLAY_SUPPORT is not set
-# CONFIG_VGASTATE is not set
-# CONFIG_FB is not set
 
 #
 # Sound
@@ -843,20 +784,14 @@ CONFIG_SOUND=m
 # Open Sound System
 #
 CONFIG_SOUND_PRIME=m
-# CONFIG_OSS_OBSOLETE is not set
 # CONFIG_SOUND_TRIDENT is not set
 # CONFIG_SOUND_MSNDCLAS is not set
 # CONFIG_SOUND_MSNDPIN is not set
-
-#
-# HID Devices
-#
+CONFIG_HID_SUPPORT=y
 CONFIG_HID=y
 # CONFIG_HID_DEBUG is not set
-
-#
-# USB support
-#
+# CONFIG_HIDRAW is not set
+CONFIG_USB_SUPPORT=y
 CONFIG_USB_ARCH_HAS_HCD=y
 CONFIG_USB_ARCH_HAS_OHCI=y
 CONFIG_USB_ARCH_HAS_EHCI=y
@@ -871,32 +806,8 @@ CONFIG_USB_ARCH_HAS_EHCI=y
 #
 # CONFIG_USB_GADGET is not set
 # CONFIG_MMC is not set
-
-#
-# LED devices
-#
 # CONFIG_NEW_LEDS is not set
-
-#
-# LED drivers
-#
-
-#
-# LED Triggers
-#
-
-#
-# InfiniBand support
-#
 # CONFIG_INFINIBAND is not set
-
-#
-# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
-#
-
-#
-# Real Time Clock
-#
 CONFIG_RTC_LIB=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_HCTOSYS=y
@@ -912,10 +823,6 @@ CONFIG_RTC_INTF_DEV=y
 # CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
 # CONFIG_RTC_DRV_TEST is not set
 
-#
-# I2C RTC drivers
-#
-
 #
 # SPI RTC drivers
 #
@@ -924,8 +831,10 @@ CONFIG_RTC_INTF_DEV=y
 # Platform RTC drivers
 #
 # CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
 # CONFIG_RTC_DRV_DS1742 is not set
 # CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
 # CONFIG_RTC_DRV_V3020 is not set
 
 #
@@ -934,17 +843,9 @@ CONFIG_RTC_INTF_DEV=y
 CONFIG_RTC_DRV_SH=y
 
 #
-# DMA Engine support
-#
-# CONFIG_DMA_ENGINE is not set
-
-#
-# DMA Clients
-#
-
-#
-# DMA Devices
+# Userspace I/O
 #
+# CONFIG_UIO is not set
 
 #
 # File systems
@@ -1005,7 +906,6 @@ CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
 CONFIG_HUGETLBFS=y
 CONFIG_HUGETLB_PAGE=y
-CONFIG_RAMFS=y
 CONFIG_CONFIGFS_FS=m
 
 #
@@ -1024,10 +924,7 @@ CONFIG_CONFIGFS_FS=m
 # CONFIG_QNX4FS_FS is not set
 # CONFIG_SYSV_FS is not set
 # CONFIG_UFS_FS is not set
-
-#
-# Network File Systems
-#
+CONFIG_NETWORK_FILESYSTEMS=y
 CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 # CONFIG_NFS_V3_ACL is not set
@@ -1053,17 +950,12 @@ CONFIG_RPCSEC_GSS_KRB5=y
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
-# CONFIG_9P_FS is not set
 
 #
 # Partition Types
 #
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
-
-#
-# Native Language Support
-#
 CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="iso8859-1"
 CONFIG_NLS_CODEPAGE_437=y
@@ -1104,23 +996,18 @@ CONFIG_NLS_ISO8859_1=y
 # CONFIG_NLS_KOI8_R is not set
 # CONFIG_NLS_KOI8_U is not set
 # CONFIG_NLS_UTF8 is not set
-
-#
-# Distributed Lock Manager
-#
 # CONFIG_DLM is not set
-
-#
-# Profiling support
-#
+CONFIG_INSTRUMENTATION=y
 CONFIG_PROFILING=y
 CONFIG_OPROFILE=m
+# CONFIG_MARKERS is not set
 
 #
 # Kernel hacking
 #
 CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
 CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_UNUSED_SYMBOLS is not set
@@ -1129,6 +1016,7 @@ CONFIG_DEBUG_FS=y
 CONFIG_DEBUG_KERNEL=y
 # CONFIG_DEBUG_SHIRQ is not set
 CONFIG_DETECT_SOFTLOCKUP=y
+CONFIG_SCHED_DEBUG=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_TIMER_STATS is not set
 # CONFIG_DEBUG_SLAB is not set
@@ -1137,6 +1025,7 @@ CONFIG_DETECT_SOFTLOCKUP=y
 # CONFIG_DEBUG_MUTEXES is not set
 # CONFIG_DEBUG_LOCK_ALLOC is not set
 # CONFIG_PROVE_LOCKING is not set
+# CONFIG_LOCK_STAT is not set
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
 # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
 # CONFIG_DEBUG_KOBJECT is not set
@@ -1144,10 +1033,13 @@ CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_DEBUG_INFO=y
 # CONFIG_DEBUG_VM is not set
 # CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
 # CONFIG_FRAME_POINTER is not set
 CONFIG_FORCED_INLINING=y
+# CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_FAULT_INJECTION is not set
+# CONFIG_SAMPLES is not set
 CONFIG_SH_STANDARD_BIOS=y
 # CONFIG_EARLY_SCIF_CONSOLE is not set
 CONFIG_EARLY_PRINTK=y
@@ -1155,6 +1047,7 @@ CONFIG_EARLY_PRINTK=y
 CONFIG_DEBUG_STACKOVERFLOW=y
 # CONFIG_DEBUG_STACK_USAGE is not set
 # CONFIG_4KSTACKS is not set
+# CONFIG_IRQSTACKS is not set
 # CONFIG_SH_KGDB is not set
 
 #
@@ -1162,10 +1055,7 @@ CONFIG_DEBUG_STACKOVERFLOW=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
-
-#
-# Cryptographic options
-#
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_CRYPTO=y
 CONFIG_CRYPTO_ALGAPI=y
 CONFIG_CRYPTO_BLKCIPHER=y
@@ -1186,6 +1076,7 @@ CONFIG_CRYPTO_ECB=m
 CONFIG_CRYPTO_CBC=y
 CONFIG_CRYPTO_PCBC=m
 # CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_XTS is not set
 # CONFIG_CRYPTO_CRYPTD is not set
 CONFIG_CRYPTO_DES=y
 # CONFIG_CRYPTO_FCRYPT is not set
@@ -1199,15 +1090,14 @@ CONFIG_CRYPTO_DES=y
 # CONFIG_CRYPTO_ARC4 is not set
 # CONFIG_CRYPTO_KHAZAD is not set
 # CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_SEED is not set
 # CONFIG_CRYPTO_DEFLATE is not set
 # CONFIG_CRYPTO_MICHAEL_MIC is not set
 # CONFIG_CRYPTO_CRC32C is not set
 # CONFIG_CRYPTO_CAMELLIA is not set
 # CONFIG_CRYPTO_TEST is not set
-
-#
-# Hardware crypto devices
-#
+# CONFIG_CRYPTO_AUTHENC is not set
+CONFIG_CRYPTO_HW=y
 
 #
 # Library routines
@@ -1217,6 +1107,7 @@ CONFIG_BITREVERSE=y
 # CONFIG_CRC16 is not set
 # CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
 # CONFIG_LIBCRC32C is not set
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT=y
index 5c29338532da14209164a5c1366058cd8f606601..2e43a2a971a927f450680a41988c491ee3e42449 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.22-rc4
-# Thu Jul 12 12:33:15 2007
+# Linux kernel version: 2.6.24-rc2
+# Tue Nov 13 20:34:57 2007
 #
 CONFIG_SUPERH=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
@@ -13,39 +13,40 @@ CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_GENERIC_TIME=y
 CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_SYS_SUPPORTS_NUMA=y
 CONFIG_SYS_SUPPORTS_PCI=y
 CONFIG_STACKTRACE_SUPPORT=y
 CONFIG_LOCKDEP_SUPPORT=y
 # CONFIG_ARCH_HAS_ILOG2_U32 is not set
 # CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_ARCH_NO_VIRT_TO_BUS=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
-# Code maturity level options
+# General setup
 #
 CONFIG_EXPERIMENTAL=y
 CONFIG_BROKEN_ON_SMP=y
 CONFIG_LOCK_KERNEL=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
-
-#
-# General setup
-#
 CONFIG_LOCALVERSION=""
 CONFIG_LOCALVERSION_AUTO=y
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
-# CONFIG_IPC_NS is not set
 CONFIG_SYSVIPC_SYSCTL=y
 # CONFIG_POSIX_MQUEUE is not set
 CONFIG_BSD_PROCESS_ACCT=y
 # CONFIG_BSD_PROCESS_ACCT_V3 is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_UTS_NS is not set
+# CONFIG_USER_NS is not set
 # CONFIG_AUDIT is not set
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FAIR_USER_SCHED=y
+# CONFIG_FAIR_CGROUP_SCHED is not set
 # CONFIG_SYSFS_DEPRECATED is not set
 # CONFIG_RELAY is not set
 # CONFIG_BLK_DEV_INITRD is not set
@@ -66,7 +67,6 @@ CONFIG_BASE_FULL=y
 CONFIG_ANON_INODES=y
 # CONFIG_EPOLL is not set
 CONFIG_SIGNALFD=y
-CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
 CONFIG_VM_EVENT_COUNTERS=y
@@ -75,24 +75,17 @@ CONFIG_SLAB=y
 # CONFIG_SLOB is not set
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
-
-#
-# Loadable module support
-#
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_FORCE_UNLOAD is not set
 # CONFIG_MODVERSIONS is not set
 # CONFIG_MODULE_SRCVERSION_ALL is not set
 CONFIG_KMOD=y
-
-#
-# Block layer
-#
 CONFIG_BLOCK=y
 # CONFIG_LBD is not set
 # CONFIG_BLK_DEV_IO_TRACE is not set
 # CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
 
 #
 # IO Schedulers
@@ -115,7 +108,6 @@ CONFIG_CPU_SH4A=y
 CONFIG_CPU_SHX2=y
 # CONFIG_CPU_SUBTYPE_SH7619 is not set
 # CONFIG_CPU_SUBTYPE_SH7206 is not set
-# CONFIG_CPU_SUBTYPE_SH7300 is not set
 # CONFIG_CPU_SUBTYPE_SH7705 is not set
 # CONFIG_CPU_SUBTYPE_SH7706 is not set
 # CONFIG_CPU_SUBTYPE_SH7707 is not set
@@ -123,6 +115,7 @@ CONFIG_CPU_SHX2=y
 # CONFIG_CPU_SUBTYPE_SH7709 is not set
 # CONFIG_CPU_SUBTYPE_SH7710 is not set
 # CONFIG_CPU_SUBTYPE_SH7712 is not set
+# CONFIG_CPU_SUBTYPE_SH7720 is not set
 # CONFIG_CPU_SUBTYPE_SH7750 is not set
 # CONFIG_CPU_SUBTYPE_SH7091 is not set
 # CONFIG_CPU_SUBTYPE_SH7750R is not set
@@ -131,13 +124,10 @@ CONFIG_CPU_SHX2=y
 # CONFIG_CPU_SUBTYPE_SH7751R is not set
 # CONFIG_CPU_SUBTYPE_SH7760 is not set
 # CONFIG_CPU_SUBTYPE_SH4_202 is not set
-# CONFIG_CPU_SUBTYPE_ST40STB1 is not set
-# CONFIG_CPU_SUBTYPE_ST40GX1 is not set
 # CONFIG_CPU_SUBTYPE_SH7770 is not set
 # CONFIG_CPU_SUBTYPE_SH7780 is not set
 CONFIG_CPU_SUBTYPE_SH7785=y
 # CONFIG_CPU_SUBTYPE_SHX3 is not set
-# CONFIG_CPU_SUBTYPE_SH73180 is not set
 # CONFIG_CPU_SUBTYPE_SH7343 is not set
 # CONFIG_CPU_SUBTYPE_SH7722 is not set
 
@@ -149,15 +139,17 @@ CONFIG_MMU=y
 CONFIG_PAGE_OFFSET=0x80000000
 CONFIG_MEMORY_START=0x08000000
 CONFIG_MEMORY_SIZE=0x08000000
-CONFIG_32BIT=y
+# CONFIG_32BIT is not set
 # CONFIG_X2TLB is not set
 CONFIG_VSYSCALL=y
+# CONFIG_NUMA is not set
 CONFIG_ARCH_FLATMEM_ENABLE=y
 CONFIG_ARCH_SPARSEMEM_ENABLE=y
 CONFIG_ARCH_SPARSEMEM_DEFAULT=y
-CONFIG_MAX_ACTIVE_REGIONS=1
+CONFIG_MAX_ACTIVE_REGIONS=2
 CONFIG_ARCH_POPULATES_NODE_MAP=y
 CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
 CONFIG_PAGE_SIZE_4KB=y
 # CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
@@ -167,12 +159,14 @@ CONFIG_HUGETLB_PAGE_SIZE_1MB=y
 # CONFIG_HUGETLB_PAGE_SIZE_4MB is not set
 # CONFIG_HUGETLB_PAGE_SIZE_64MB is not set
 CONFIG_SELECT_MEMORY_MODEL=y
-CONFIG_FLATMEM_MANUAL=y
+# CONFIG_FLATMEM_MANUAL is not set
 # CONFIG_DISCONTIGMEM_MANUAL is not set
-# CONFIG_SPARSEMEM_MANUAL is not set
-CONFIG_FLATMEM=y
-CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_SPARSEMEM_MANUAL=y
+CONFIG_SPARSEMEM=y
+CONFIG_HAVE_MEMORY_PRESENT=y
 CONFIG_SPARSEMEM_STATIC=y
+# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
+# CONFIG_MEMORY_HOTPLUG is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=0
@@ -182,7 +176,9 @@ CONFIG_NR_QUICK=2
 # Cache configuration
 #
 # CONFIG_SH_DIRECT_MAPPED is not set
-# CONFIG_SH_WRITETHROUGH is not set
+CONFIG_CACHE_WRITEBACK=y
+# CONFIG_CACHE_WRITETHROUGH is not set
+# CONFIG_CACHE_OFF is not set
 
 #
 # Processor features
@@ -190,12 +186,11 @@ CONFIG_NR_QUICK=2
 CONFIG_CPU_LITTLE_ENDIAN=y
 # CONFIG_CPU_BIG_ENDIAN is not set
 CONFIG_SH_FPU=y
-# CONFIG_SH_DSP is not set
 CONFIG_SH_STORE_QUEUES=y
 CONFIG_CPU_HAS_INTEVT=y
-CONFIG_CPU_HAS_INTC2_IRQ=y
 CONFIG_CPU_HAS_SR_RB=y
 CONFIG_CPU_HAS_PTEA=y
+CONFIG_CPU_HAS_FPU=y
 
 #
 # Board support
@@ -214,6 +209,7 @@ CONFIG_SH_PCLK_FREQ=50000000
 # CONFIG_TICK_ONESHOT is not set
 # CONFIG_NO_HZ is not set
 # CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
 
 #
 # CPU Frequency scaling
@@ -249,13 +245,13 @@ CONFIG_KEXEC=y
 # CONFIG_PREEMPT_VOLUNTARY is not set
 CONFIG_PREEMPT=y
 CONFIG_PREEMPT_BKL=y
+CONFIG_GUSA=y
 
 #
 # Boot options
 #
 CONFIG_ZERO_PAGE_OFFSET=0x00001000
 CONFIG_BOOT_LINK_OFFSET=0x00800000
-# CONFIG_UBC_WAKEUP is not set
 CONFIG_CMDLINE_BOOL=y
 CONFIG_CMDLINE="console=ttySC0,115200 root=/dev/sda1"
 
@@ -267,11 +263,8 @@ CONFIG_SH_PCIDMA_NONCOHERENT=y
 CONFIG_PCI_AUTO=y
 CONFIG_PCI_AUTO_UPDATE_RESOURCES=y
 # CONFIG_ARCH_SUPPORTS_MSI is not set
+CONFIG_PCI_LEGACY=y
 # CONFIG_PCI_DEBUG is not set
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
 # CONFIG_PCCARD is not set
 # CONFIG_HOTPLUG_PCI is not set
 
@@ -322,6 +315,7 @@ CONFIG_IP_PNP_DHCP=y
 CONFIG_INET_XFRM_MODE_TRANSPORT=y
 CONFIG_INET_XFRM_MODE_TUNNEL=y
 CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
@@ -348,10 +342,6 @@ CONFIG_LLC=m
 # CONFIG_LAPB is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
-
-#
-# QoS and/or fair queueing
-#
 # CONFIG_NET_SCHED is not set
 
 #
@@ -371,6 +361,7 @@ CONFIG_WIRELESS_EXT=y
 # CONFIG_MAC80211 is not set
 # CONFIG_IEEE80211 is not set
 # CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
 
 #
 # Device Drivers
@@ -379,33 +370,17 @@ CONFIG_WIRELESS_EXT=y
 #
 # Generic Driver Options
 #
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=m
 # CONFIG_DEBUG_DRIVER is not set
 # CONFIG_DEBUG_DEVRES is not set
 # CONFIG_SYS_HYPERVISOR is not set
-
-#
-# Connector - unified userspace <-> kernelspace linker
-#
 # CONFIG_CONNECTOR is not set
 # CONFIG_MTD is not set
-
-#
-# Parallel port support
-#
 # CONFIG_PARPORT is not set
-
-#
-# Plug and Play support
-#
-# CONFIG_PNPACPI is not set
-
-#
-# Block devices
-#
-# CONFIG_BLK_CPQ_DA is not set
+CONFIG_BLK_DEV=y
 # CONFIG_BLK_CPQ_CISS_DA is not set
 # CONFIG_BLK_DEV_DAC960 is not set
 # CONFIG_BLK_DEV_UMEM is not set
@@ -419,14 +394,11 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
 CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
-
-#
-# Misc devices
-#
+CONFIG_MISC_DEVICES=y
 # CONFIG_PHANTOM is not set
+CONFIG_EEPROM_93CX6=y
 # CONFIG_SGI_IOC4 is not set
 # CONFIG_TIFM_CORE is not set
-# CONFIG_BLINK is not set
 # CONFIG_IDE is not set
 
 #
@@ -434,6 +406,7 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
 #
 # CONFIG_RAID_ATTRS is not set
 CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
 # CONFIG_SCSI_TGT is not set
 # CONFIG_SCSI_NETLINK is not set
 CONFIG_SCSI_PROC_FS=y
@@ -463,12 +436,9 @@ CONFIG_SCSI_WAIT_SCAN=m
 # CONFIG_SCSI_SPI_ATTRS is not set
 # CONFIG_SCSI_FC_ATTRS is not set
 # CONFIG_SCSI_ISCSI_ATTRS is not set
-# CONFIG_SCSI_SAS_ATTRS is not set
 # CONFIG_SCSI_SAS_LIBSAS is not set
-
-#
-# SCSI low-level drivers
-#
+# CONFIG_SCSI_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_ISCSI_TCP is not set
 # CONFIG_BLK_DEV_3W_XXXX_RAID is not set
 # CONFIG_SCSI_3W_9XXX is not set
@@ -478,7 +448,6 @@ CONFIG_SCSI_WAIT_SCAN=m
 # CONFIG_SCSI_AIC7XXX_OLD is not set
 # CONFIG_SCSI_AIC79XX is not set
 # CONFIG_SCSI_AIC94XX is not set
-# CONFIG_SCSI_DPT_I2O is not set
 # CONFIG_SCSI_ARCMSR is not set
 # CONFIG_MEGARAID_NEWGEN is not set
 # CONFIG_MEGARAID_LEGACY is not set
@@ -543,6 +512,7 @@ CONFIG_SATA_SIL=y
 # CONFIG_PATA_OLDPIIX is not set
 # CONFIG_PATA_NETCELL is not set
 # CONFIG_PATA_NS87410 is not set
+# CONFIG_PATA_NS87415 is not set
 # CONFIG_PATA_OPTI is not set
 # CONFIG_PATA_OPTIDMA is not set
 # CONFIG_PATA_PDC_OLD is not set
@@ -556,64 +526,50 @@ CONFIG_SATA_SIL=y
 # CONFIG_PATA_VIA is not set
 # CONFIG_PATA_WINBOND is not set
 CONFIG_PATA_PLATFORM=y
-
-#
-# Multi-device support (RAID and LVM)
-#
 # CONFIG_MD is not set
-
-#
-# Fusion MPT device support
-#
 # CONFIG_FUSION is not set
-# CONFIG_FUSION_SPI is not set
-# CONFIG_FUSION_FC is not set
-# CONFIG_FUSION_SAS is not set
 
 #
 # IEEE 1394 (FireWire) support
 #
 # CONFIG_FIREWIRE is not set
 # CONFIG_IEEE1394 is not set
-
-#
-# I2O device support
-#
 # CONFIG_I2O is not set
-
-#
-# Network device support
-#
 CONFIG_NETDEVICES=y
+# CONFIG_NETDEVICES_MULTIQUEUE is not set
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
+# CONFIG_VETH is not set
+# CONFIG_IP1000 is not set
 # CONFIG_ARCNET is not set
 # CONFIG_PHYLIB is not set
-
-#
-# Ethernet (10 or 100Mbit)
-#
 CONFIG_NET_ETHERNET=y
 CONFIG_MII=y
+CONFIG_AX88796=y
+CONFIG_AX88796_93CX6=y
 # CONFIG_STNIC is not set
 # CONFIG_HAPPYMEAL is not set
 # CONFIG_SUNGEM is not set
 # CONFIG_CASSINI is not set
 # CONFIG_NET_VENDOR_3COM is not set
 # CONFIG_SMC91X is not set
-
-#
-# Tulip family network device support
-#
+# CONFIG_SMC911X is not set
 # CONFIG_NET_TULIP is not set
 # CONFIG_HP100 is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
 # CONFIG_NET_PCI is not set
+# CONFIG_B44 is not set
 CONFIG_NETDEV_1000=y
 # CONFIG_ACENIC is not set
 # CONFIG_DL2K is not set
 # CONFIG_E1000 is not set
+# CONFIG_E1000E is not set
 # CONFIG_NS83820 is not set
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
@@ -631,11 +587,14 @@ CONFIG_R8169=y
 CONFIG_NETDEV_10000=y
 # CONFIG_CHELSIO_T1 is not set
 # CONFIG_CHELSIO_T3 is not set
+# CONFIG_IXGBE is not set
 # CONFIG_IXGB is not set
 # CONFIG_S2IO is not set
 # CONFIG_MYRI10GE is not set
 # CONFIG_NETXEN_NIC is not set
+# CONFIG_NIU is not set
 # CONFIG_MLX4_CORE is not set
+# CONFIG_TEHUTI is not set
 # CONFIG_TR is not set
 
 #
@@ -653,15 +612,7 @@ CONFIG_NETDEV_10000=y
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
-
-#
-# ISDN subsystem
-#
 # CONFIG_ISDN is not set
-
-#
-# Telephony Support
-#
 # CONFIG_PHONE is not set
 
 #
@@ -669,6 +620,7 @@ CONFIG_NETDEV_10000=y
 #
 CONFIG_INPUT=y
 # CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
 
 #
 # Userland interfaces
@@ -678,7 +630,6 @@ CONFIG_INPUT_MOUSEDEV=y
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
 # CONFIG_INPUT_EVDEV is not set
 # CONFIG_INPUT_EVBUG is not set
 
@@ -732,21 +683,11 @@ CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
-
-#
-# IPMI
-#
 # CONFIG_IPMI_HANDLER is not set
-# CONFIG_WATCHDOG is not set
 CONFIG_HW_RANDOM=y
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
-# CONFIG_DRM is not set
 # CONFIG_RAW_DRIVER is not set
-
-#
-# TPM devices
-#
 # CONFIG_TCG_TPM is not set
 CONFIG_DEVPORT=y
 # CONFIG_I2C is not set
@@ -756,21 +697,31 @@ CONFIG_DEVPORT=y
 #
 # CONFIG_SPI is not set
 # CONFIG_SPI_MASTER is not set
-
-#
-# Dallas's 1-wire bus
-#
 # CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
 CONFIG_HWMON=y
 # CONFIG_HWMON_VID is not set
-# CONFIG_SENSORS_ABITUGURU is not set
 # CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_F71882FG is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_PC87360 is not set
 # CONFIG_SENSORS_PC87427 is not set
+# CONFIG_SENSORS_SIS5595 is not set
 # CONFIG_SENSORS_SMSC47M1 is not set
 # CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_VIA686A is not set
 # CONFIG_SENSORS_VT1211 is not set
+# CONFIG_SENSORS_VT8231 is not set
 # CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
 # CONFIG_HWMON_DEBUG_CHIP is not set
+# CONFIG_WATCHDOG is not set
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
 
 #
 # Multifunction device drivers
@@ -787,19 +738,16 @@ CONFIG_HWMON=y
 #
 # Graphics support
 #
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
-
-#
-# Display device support
-#
-# CONFIG_DISPLAY_SUPPORT is not set
+# CONFIG_DRM is not set
 # CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
 CONFIG_FB=y
 # CONFIG_FIRMWARE_EDID is not set
 # CONFIG_FB_DDC is not set
 # CONFIG_FB_CFB_FILLRECT is not set
 # CONFIG_FB_CFB_COPYAREA is not set
 # CONFIG_FB_CFB_IMAGEBLIT is not set
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
 # CONFIG_FB_SYS_FILLRECT is not set
 # CONFIG_FB_SYS_COPYAREA is not set
 # CONFIG_FB_SYS_IMAGEBLIT is not set
@@ -819,7 +767,6 @@ CONFIG_FB_DEFERRED_IO=y
 # CONFIG_FB_CYBER2000 is not set
 # CONFIG_FB_ASILIANT is not set
 # CONFIG_FB_IMSTT is not set
-# CONFIG_FB_EPSON1355 is not set
 # CONFIG_FB_S1D13XXX is not set
 # CONFIG_FB_NVIDIA is not set
 # CONFIG_FB_RIVA is not set
@@ -839,6 +786,12 @@ CONFIG_FB_DEFERRED_IO=y
 # CONFIG_FB_ARK is not set
 # CONFIG_FB_PM3 is not set
 # CONFIG_FB_VIRTUAL is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
 # CONFIG_LOGO is not set
 
 #
@@ -855,20 +808,14 @@ CONFIG_SOUND=m
 # Open Sound System
 #
 CONFIG_SOUND_PRIME=m
-# CONFIG_OSS_OBSOLETE is not set
 # CONFIG_SOUND_TRIDENT is not set
 # CONFIG_SOUND_MSNDCLAS is not set
 # CONFIG_SOUND_MSNDPIN is not set
-
-#
-# HID Devices
-#
+CONFIG_HID_SUPPORT=y
 CONFIG_HID=y
 # CONFIG_HID_DEBUG is not set
-
-#
-# USB support
-#
+# CONFIG_HIDRAW is not set
+CONFIG_USB_SUPPORT=y
 CONFIG_USB_ARCH_HAS_HCD=y
 CONFIG_USB_ARCH_HAS_OHCI=y
 CONFIG_USB_ARCH_HAS_EHCI=y
@@ -883,32 +830,8 @@ CONFIG_USB_ARCH_HAS_EHCI=y
 #
 # CONFIG_USB_GADGET is not set
 # CONFIG_MMC is not set
-
-#
-# LED devices
-#
 # CONFIG_NEW_LEDS is not set
-
-#
-# LED drivers
-#
-
-#
-# LED Triggers
-#
-
-#
-# InfiniBand support
-#
 # CONFIG_INFINIBAND is not set
-
-#
-# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
-#
-
-#
-# Real Time Clock
-#
 CONFIG_RTC_LIB=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_HCTOSYS=y
@@ -924,10 +847,6 @@ CONFIG_RTC_INTF_DEV=y
 # CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
 # CONFIG_RTC_DRV_TEST is not set
 
-#
-# I2C RTC drivers
-#
-
 #
 # SPI RTC drivers
 #
@@ -936,8 +855,10 @@ CONFIG_RTC_INTF_DEV=y
 # Platform RTC drivers
 #
 # CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
 # CONFIG_RTC_DRV_DS1742 is not set
 # CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
 # CONFIG_RTC_DRV_V3020 is not set
 
 #
@@ -946,17 +867,9 @@ CONFIG_RTC_INTF_DEV=y
 CONFIG_RTC_DRV_SH=y
 
 #
-# DMA Engine support
-#
-# CONFIG_DMA_ENGINE is not set
-
-#
-# DMA Clients
-#
-
-#
-# DMA Devices
+# Userspace I/O
 #
+# CONFIG_UIO is not set
 
 #
 # File systems
@@ -1017,7 +930,6 @@ CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
 CONFIG_HUGETLBFS=y
 CONFIG_HUGETLB_PAGE=y
-CONFIG_RAMFS=y
 CONFIG_CONFIGFS_FS=m
 
 #
@@ -1036,10 +948,7 @@ CONFIG_CONFIGFS_FS=m
 # CONFIG_QNX4FS_FS is not set
 # CONFIG_SYSV_FS is not set
 # CONFIG_UFS_FS is not set
-
-#
-# Network File Systems
-#
+CONFIG_NETWORK_FILESYSTEMS=y
 CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 # CONFIG_NFS_V3_ACL is not set
@@ -1065,17 +974,12 @@ CONFIG_RPCSEC_GSS_KRB5=y
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
-# CONFIG_9P_FS is not set
 
 #
 # Partition Types
 #
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
-
-#
-# Native Language Support
-#
 CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="iso8859-1"
 CONFIG_NLS_CODEPAGE_437=y
@@ -1116,23 +1020,18 @@ CONFIG_NLS_ISO8859_1=y
 # CONFIG_NLS_KOI8_R is not set
 # CONFIG_NLS_KOI8_U is not set
 # CONFIG_NLS_UTF8 is not set
-
-#
-# Distributed Lock Manager
-#
 # CONFIG_DLM is not set
-
-#
-# Profiling support
-#
+CONFIG_INSTRUMENTATION=y
 CONFIG_PROFILING=y
 CONFIG_OPROFILE=m
+# CONFIG_MARKERS is not set
 
 #
 # Kernel hacking
 #
 CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
 CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_UNUSED_SYMBOLS is not set
@@ -1141,6 +1040,7 @@ CONFIG_DEBUG_FS=y
 CONFIG_DEBUG_KERNEL=y
 # CONFIG_DEBUG_SHIRQ is not set
 # CONFIG_DETECT_SOFTLOCKUP is not set
+CONFIG_SCHED_DEBUG=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_TIMER_STATS is not set
 # CONFIG_DEBUG_SLAB is not set
@@ -1150,6 +1050,7 @@ CONFIG_DEBUG_MUTEXES=y
 CONFIG_DEBUG_LOCK_ALLOC=y
 # CONFIG_PROVE_LOCKING is not set
 CONFIG_LOCKDEP=y
+# CONFIG_LOCK_STAT is not set
 # CONFIG_DEBUG_LOCKDEP is not set
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
 CONFIG_DEBUG_LOCKING_API_SELFTESTS=y
@@ -1159,17 +1060,21 @@ CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_DEBUG_INFO=y
 # CONFIG_DEBUG_VM is not set
 # CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
 CONFIG_FRAME_POINTER=y
 CONFIG_FORCED_INLINING=y
+# CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_FAULT_INJECTION is not set
+# CONFIG_SAMPLES is not set
 CONFIG_SH_STANDARD_BIOS=y
 # CONFIG_EARLY_SCIF_CONSOLE is not set
 CONFIG_EARLY_PRINTK=y
 # CONFIG_DEBUG_BOOTMEM is not set
 CONFIG_DEBUG_STACKOVERFLOW=y
 CONFIG_DEBUG_STACK_USAGE=y
-# CONFIG_4KSTACKS is not set
+CONFIG_4KSTACKS=y
+# CONFIG_IRQSTACKS is not set
 # CONFIG_SH_KGDB is not set
 
 #
@@ -1177,10 +1082,7 @@ CONFIG_DEBUG_STACK_USAGE=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
-
-#
-# Cryptographic options
-#
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_CRYPTO=y
 CONFIG_CRYPTO_ALGAPI=y
 CONFIG_CRYPTO_BLKCIPHER=y
@@ -1201,6 +1103,7 @@ CONFIG_CRYPTO_ECB=m
 CONFIG_CRYPTO_CBC=y
 CONFIG_CRYPTO_PCBC=m
 # CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_XTS is not set
 # CONFIG_CRYPTO_CRYPTD is not set
 CONFIG_CRYPTO_DES=y
 # CONFIG_CRYPTO_FCRYPT is not set
@@ -1214,15 +1117,14 @@ CONFIG_CRYPTO_DES=y
 # CONFIG_CRYPTO_ARC4 is not set
 # CONFIG_CRYPTO_KHAZAD is not set
 # CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_SEED is not set
 # CONFIG_CRYPTO_DEFLATE is not set
 # CONFIG_CRYPTO_MICHAEL_MIC is not set
 # CONFIG_CRYPTO_CRC32C is not set
 # CONFIG_CRYPTO_CAMELLIA is not set
 # CONFIG_CRYPTO_TEST is not set
-
-#
-# Hardware crypto devices
-#
+# CONFIG_CRYPTO_AUTHENC is not set
+CONFIG_CRYPTO_HW=y
 
 #
 # Library routines
@@ -1232,6 +1134,7 @@ CONFIG_BITREVERSE=y
 # CONFIG_CRC16 is not set
 # CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
 # CONFIG_LIBCRC32C is not set
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT=y
index 2f65ac72f48ae7b1ee931ed79861c14dc373910a..fba6b5ba0b3a6519ecdf58437dc5868e59d21e53 100644 (file)
@@ -5,7 +5,6 @@
 obj-y                                  += pci.o
 obj-$(CONFIG_PCI_AUTO)                 += pci-auto.o
 
-obj-$(CONFIG_CPU_SUBTYPE_ST40STB1)     += pci-st40.o
 obj-$(CONFIG_CPU_SUBTYPE_SH7751)       += pci-sh7751.o ops-sh4.o
 obj-$(CONFIG_CPU_SUBTYPE_SH7751R)      += pci-sh7751.o ops-sh4.o
 obj-$(CONFIG_CPU_SUBTYPE_SH7780)       += pci-sh7780.o ops-sh4.o
diff --git a/arch/sh/drivers/pci/pci-st40.c b/arch/sh/drivers/pci/pci-st40.c
deleted file mode 100644 (file)
index 1502a14..0000000
+++ /dev/null
@@ -1,488 +0,0 @@
-/* 
- * Copyright (C) 2001 David J. Mckay (david.mckay@st.com)
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.                            
- *
- * Support functions for the ST40 PCI hardware.
- */
-
-#include <linux/kernel.h>
-#include <linux/smp.h>
-#include <linux/init.h>
-#include <linux/errno.h>
-#include <linux/pci.h>
-#include <linux/delay.h>
-#include <linux/types.h>
-#include <asm/pci.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>   /* irqreturn_t */
-
-#include "pci-st40.h"
-
-/* This is in P2 of course */
-#define ST40PCI_BASE_ADDRESS     (0xb0000000)
-#define ST40PCI_MEM_ADDRESS      (ST40PCI_BASE_ADDRESS+0x0)
-#define ST40PCI_IO_ADDRESS       (ST40PCI_BASE_ADDRESS+0x06000000)
-#define ST40PCI_REG_ADDRESS      (ST40PCI_BASE_ADDRESS+0x07000000)
-
-#define ST40PCI_REG(x) (ST40PCI_REG_ADDRESS+(ST40PCI_##x))
-#define ST40PCI_REG_INDEXED(reg, index)                                \
-       (ST40PCI_REG(reg##0) +                                  \
-         ((ST40PCI_REG(reg##1) - ST40PCI_REG(reg##0))*index))
-
-#define ST40PCI_WRITE(reg,val) writel((val),ST40PCI_REG(reg))
-#define ST40PCI_WRITE_SHORT(reg,val) writew((val),ST40PCI_REG(reg))
-#define ST40PCI_WRITE_BYTE(reg,val) writeb((val),ST40PCI_REG(reg))
-#define ST40PCI_WRITE_INDEXED(reg, index, val)                         \
-        writel((val), ST40PCI_REG_INDEXED(reg, index));
-
-#define ST40PCI_READ(reg) readl(ST40PCI_REG(reg))
-#define ST40PCI_READ_SHORT(reg) readw(ST40PCI_REG(reg))
-#define ST40PCI_READ_BYTE(reg) readb(ST40PCI_REG(reg))
-
-#define ST40PCI_SERR_IRQ       64
-#define ST40PCI_ERR_IRQ                65
-
-
-/* Macros to extract PLL params */
-#define PLL_MDIV(reg)  ( ((unsigned)reg) & 0xff )
-#define PLL_NDIV(reg) ( (((unsigned)reg)>>8) & 0xff )
-#define PLL_PDIV(reg) ( (((unsigned)reg)>>16) & 0x3 )
-#define PLL_SETUP(reg) ( (((unsigned)reg)>>19) & 0x1ff )
-
-/* Build up the appropriate settings */
-#define PLL_SET(mdiv,ndiv,pdiv,setup) \
-( ((mdiv)&0xff) | (((ndiv)&0xff)<<8) | (((pdiv)&3)<<16)| (((setup)&0x1ff)<<19))
-
-#define PLLPCICR (0xbb040000+0x10)
-
-#define PLLPCICR_POWERON (1<<28)
-#define PLLPCICR_OUT_EN (1<<29)
-#define PLLPCICR_LOCKSELECT (1<<30)
-#define PLLPCICR_LOCK (1<<31)
-
-
-#define PLL_25MHZ 0x793c8512
-#define PLL_33MHZ PLL_SET(18,88,3,295)
-
-static void pci_set_rbar_region(unsigned int region,     unsigned long localAddr,
-                        unsigned long pciOffset, unsigned long regionSize);
-
-static __init void SetPCIPLL(void)
-{
-       {
-               /* Lets play with the PLL values */
-               unsigned long pll1cr1;
-               unsigned long mdiv, ndiv, pdiv;
-               unsigned long muxcr;
-               unsigned int muxcr_ratios[4] = { 8, 16, 21, 1 };
-               unsigned int freq;
-
-#define CLKGENA            0xbb040000
-#define CLKGENA_PLL2_MUXCR CLKGENA + 0x48
-               pll1cr1 = ctrl_inl(PLLPCICR);
-               printk("PLL1CR1 %08lx\n", pll1cr1);
-               mdiv = PLL_MDIV(pll1cr1);
-               ndiv = PLL_NDIV(pll1cr1);
-               pdiv = PLL_PDIV(pll1cr1);
-               printk("mdiv %02lx ndiv %02lx pdiv %02lx\n", mdiv, ndiv, pdiv);
-               freq = ((2*27*ndiv)/mdiv) / (1 << pdiv);
-               printk("PLL freq %dMHz\n", freq);
-               muxcr = ctrl_inl(CLKGENA_PLL2_MUXCR);
-               printk("PCI freq %dMhz\n", freq / muxcr_ratios[muxcr & 3]);
-       }
-}
-
-
-struct pci_err {
-  unsigned mask;
-  const char *error_string;
-};
-
-static struct pci_err int_error[]={
-  { INT_MNLTDIM,"MNLTDIM: Master non-lock transfer"},
-  { INT_TTADI,  "TTADI: Illegal byte enable in I/O transfer"},
-  { INT_TMTO,   "TMTO: Target memory read/write timeout"},
-  { INT_MDEI,   "MDEI: Master function disable error"},
-  { INT_APEDI,  "APEDI: Address parity error"},
-  { INT_SDI,    "SDI: SERR detected"},
-  { INT_DPEITW, "DPEITW: Data parity error target write"},
-  { INT_PEDITR, "PEDITR: PERR detected"},
-  { INT_TADIM,  "TADIM: Target abort detected"},
-  { INT_MADIM,  "MADIM: Master abort detected"},
-  { INT_MWPDI,  "MWPDI: PERR from target at data write"},
-  { INT_MRDPEI, "MRDPEI: Master read data parity error"}
-};
-#define NUM_PCI_INT_ERRS (sizeof(int_error)/sizeof(struct pci_err))
-
-static struct pci_err aint_error[]={
-  { AINT_MBI,   "MBI: Master broken"},
-  { AINT_TBTOI, "TBTOI: Target bus timeout"},
-  { AINT_MBTOI, "MBTOI: Master bus timeout"},
-  { AINT_TAI,   "TAI: Target abort"},
-  { AINT_MAI,   "MAI: Master abort"},
-  { AINT_RDPEI, "RDPEI: Read data parity"},
-  { AINT_WDPE,  "WDPE: Write data parity"}
-};
-
-#define NUM_PCI_AINT_ERRS (sizeof(aint_error)/sizeof(struct pci_err))
-
-static void print_pci_errors(unsigned reg,struct pci_err *error,int num_errors)
-{
-  int i;
-
-  for(i=0;i<num_errors;i++) {
-    if(reg & error[i].mask) {
-      printk("%s\n",error[i].error_string);
-    }
-  }
-
-}
-
-
-static char * pci_commands[16]={
-       "Int Ack",
-       "Special Cycle",
-       "I/O Read",
-       "I/O Write",
-       "Reserved",
-       "Reserved",
-       "Memory Read",
-       "Memory Write",
-       "Reserved",
-       "Reserved",
-       "Configuration Read",
-       "Configuration Write",
-       "Memory Read Multiple",
-       "Dual Address Cycle",
-       "Memory Read Line",
-       "Memory Write-and-Invalidate"
-};
-
-static irqreturn_t st40_pci_irq(int irq, void *dev_instance)
-{
-       unsigned pci_int, pci_air, pci_cir, pci_aint;
-       static int count=0;
-
-
-       pci_int = ST40PCI_READ(INT);pci_aint = ST40PCI_READ(AINT);
-       pci_cir = ST40PCI_READ(CIR);pci_air = ST40PCI_READ(AIR);
-
-       /* Reset state to stop multiple interrupts */
-        ST40PCI_WRITE(INT, ~0); ST40PCI_WRITE(AINT, ~0);
-
-
-       if(++count>1) return IRQ_HANDLED;
-
-       printk("** PCI ERROR **\n");
-
-        if(pci_int) {
-               printk("** INT register status\n");
-               print_pci_errors(pci_int,int_error,NUM_PCI_INT_ERRS);
-       }
-
-        if(pci_aint) {
-               printk("** AINT register status\n");
-               print_pci_errors(pci_aint,aint_error,NUM_PCI_AINT_ERRS);
-       }
-
-       printk("** Address and command info\n");
-
-       printk("** Command  %s : Address 0x%x\n",
-              pci_commands[pci_cir&0xf],pci_air);
-
-       if(pci_cir&CIR_PIOTEM) {
-               printk("CIR_PIOTEM:PIO transfer error for master\n");
-       }
-        if(pci_cir&CIR_RWTET) {
-               printk("CIR_RWTET:Read/Write transfer error for target\n");
-       }
-
-       return IRQ_HANDLED;
-}
-
-
-/* Rounds a number UP to the nearest power of two. Used for
- * sizing the PCI window.
- */
-static u32 r2p2(u32 num)
-{
-       int i = 31;
-       u32 tmp = num;
-
-       if (num == 0)
-               return 0;
-
-       do {
-               if (tmp & (1 << 31))
-                       break;
-               i--;
-               tmp <<= 1;
-       } while (i >= 0);
-
-       tmp = 1 << i;
-       /* If the original number isn't a power of 2, round it up */
-       if (tmp != num)
-               tmp <<= 1;
-
-       return tmp;
-}
-
-static void __init pci_fixup_ide_bases(struct pci_dev *d)
-{
-       int i;
-
-       /*
-        * PCI IDE controllers use non-standard I/O port decoding, respect it.
-        */
-       if ((d->class >> 8) != PCI_CLASS_STORAGE_IDE)
-               return;
-       printk("PCI: IDE base address fixup for %s\n", pci_name(d));
-       for(i=0; i<4; i++) {
-               struct resource *r = &d->resource[i];
-               if ((r->start & ~0x80) == 0x374) {
-                       r->start |= 2;
-                       r->end = r->start;
-               }
-       }
-}
-DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_ide_bases);
-
-int __init st40pci_init(unsigned memStart, unsigned memSize)
-{
-       u32 lsr0;
-
-       SetPCIPLL();
-
-       /* Initialises the ST40 pci subsystem, performing a reset, then programming
-        * up the address space decoders appropriately
-        */
-
-       /* Should reset core here as well methink */
-
-       ST40PCI_WRITE(CR, CR_LOCK_MASK | CR_SOFT_RESET);
-
-       /* Loop while core resets */
-       while (ST40PCI_READ(CR) & CR_SOFT_RESET);
-
-       /* Switch off interrupts */
-       ST40PCI_WRITE(INTM, 0);
-       ST40PCI_WRITE(AINT, 0);
-
-       /* Now, lets reset all the cards on the bus with extreme prejudice */
-       ST40PCI_WRITE(CR, CR_LOCK_MASK | CR_RSTCTL);
-       udelay(250);
-
-       /* Set bus active, take it out of reset */
-       ST40PCI_WRITE(CR, CR_LOCK_MASK | CR_BMAM | CR_CFINT | CR_PFCS | CR_PFE);
-
-       /* The PCI spec says that no access must be made to the bus until 1 second
-        * after reset. This seem ludicrously long, but some delay is needed here
-        */
-       mdelay(1000);
-
-       /* Switch off interrupts */
-       ST40PCI_WRITE(INTM, 0);
-       ST40PCI_WRITE(AINT, 0);
-
-       /* Allow it to be a master */
-
-       ST40PCI_WRITE_SHORT(CSR_CMD,
-                           PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER |
-                           PCI_COMMAND_IO);
-
-       /* Access to the 0xb0000000 -> 0xb6000000 area will go through to 0x10000000 -> 0x16000000
-        * on the PCI bus. This allows a nice 1-1 bus to phys mapping.
-        */
-
-
-       ST40PCI_WRITE(MBR, 0x10000000);
-       /* Always set the max size 128M (actually, it is only 96MB wide) */
-       ST40PCI_WRITE(MBMR, 0x07ff0000);
-
-       /* I/O addresses are mapped at 0xb6000000 -> 0xb7000000. These are changed to 0, to 
-        * allow cards that have legacy io such as vga to function correctly. This gives a 
-        * maximum of 64K of io/space as only the bottom 16 bits of the address are copied 
-        * over to the bus  when the transaction is made. 64K of io space is more than enough
-        */
-       ST40PCI_WRITE(IOBR, 0x0);
-       /* Set up the 64K window */
-       ST40PCI_WRITE(IOBMR, 0x0);
-
-       /* Now we set up the mbars so the PCI bus can see the local memory */
-       /* Expose a 256M window starting at PCI address 0... */
-       ST40PCI_WRITE(CSR_MBAR0, 0);
-       ST40PCI_WRITE(LSR0, 0x0fff0001);
-
-       /* ... and set up the initial incoming window to expose all of RAM */
-       pci_set_rbar_region(7, memStart, memStart, memSize);
-
-       /* Maximise timeout values */
-       ST40PCI_WRITE_BYTE(CSR_TRDY, 0xff);
-       ST40PCI_WRITE_BYTE(CSR_RETRY, 0xff);
-       ST40PCI_WRITE_BYTE(CSR_MIT, 0xff);
-
-       ST40PCI_WRITE_BYTE(PERF,PERF_MASTER_WRITE_POSTING);
-
-       return 1;
-}
-
-char * __devinit pcibios_setup(char *str)
-{
-       return str;
-}
-
-
-#define SET_CONFIG_BITS(bus,devfn,where)\
-  (((bus) << 16) | ((devfn) << 8) | ((where) & ~3) | (bus!=0))
-
-#define CONFIG_CMD(bus, devfn, where) SET_CONFIG_BITS(bus->number,devfn,where)
-
-
-static int CheckForMasterAbort(void)
-{
-       if (ST40PCI_READ(INT) & INT_MADIM) {
-               /* Should we clear config space version as well ??? */
-               ST40PCI_WRITE(INT, INT_MADIM);
-               ST40PCI_WRITE_SHORT(CSR_STATUS, 0);
-               return 1;
-       }
-
-       return 0;
-}
-
-/* Write to config register */
-static int st40pci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 * val)
-{
-       ST40PCI_WRITE(PAR, CONFIG_CMD(bus, devfn, where));
-       switch (size) {
-               case 1:
-                       *val = (u8)ST40PCI_READ_BYTE(PDR + (where & 3));
-                       break;
-               case 2:
-                       *val = (u16)ST40PCI_READ_SHORT(PDR + (where & 2));
-                       break;
-               case 4:
-                       *val = ST40PCI_READ(PDR);
-                       break;
-       }
-
-       if (CheckForMasterAbort()){
-               switch (size) {
-                       case 1:
-                               *val = (u8)0xff;
-                               break;
-                       case 2:
-                               *val = (u16)0xffff;
-                               break;
-                       case 4:
-                               *val = 0xffffffff;
-                               break;
-               }
-       }
-
-       return PCIBIOS_SUCCESSFUL;
-}
-
-static int st40pci_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val)
-{
-       ST40PCI_WRITE(PAR, CONFIG_CMD(bus, devfn, where));
-
-       switch (size) {
-               case 1:
-                       ST40PCI_WRITE_BYTE(PDR + (where & 3), (u8)val);
-                       break;
-               case 2:
-                       ST40PCI_WRITE_SHORT(PDR + (where & 2), (u16)val);
-                       break;
-               case 4:
-                       ST40PCI_WRITE(PDR, val);
-                       break;
-       }
-
-       CheckForMasterAbort();
-
-       return PCIBIOS_SUCCESSFUL;
-}
-
-struct pci_ops st40pci_config_ops = {
-       .read =         st40pci_read,
-       .write =        st40pci_write,
-};
-
-
-/* Everything hangs off this */
-static struct pci_bus *pci_root_bus;
-
-static int __init pcibios_init(void)
-{
-       extern unsigned long memory_start, memory_end;
-
-       printk(KERN_ALERT "pci-st40.c: pcibios_init\n");
-
-       if (sh_mv.mv_init_pci != NULL) {
-               sh_mv.mv_init_pci();
-       }
-
-       /* The pci subsytem needs to know where memory is and how much 
-        * of it there is. I've simply made these globals. A better mechanism
-        * is probably needed.
-        */
-       st40pci_init(PHYSADDR(memory_start),
-                    PHYSADDR(memory_end) - PHYSADDR(memory_start));
-
-       if (request_irq(ST40PCI_ERR_IRQ, st40_pci_irq, 
-                        IRQF_DISABLED, "st40pci", NULL)) {
-               printk(KERN_ERR "st40pci: Cannot hook interrupt\n");
-               return -EIO;
-       }
-
-       /* Enable the PCI interrupts on the device */
-       ST40PCI_WRITE(INTM, ~0);
-       ST40PCI_WRITE(AINT, ~0);
-
-       /* Map the io address apprioately */
-#ifdef CONFIG_HD64465
-       hd64465_port_map(PCIBIOS_MIN_IO, (64 * 1024) - PCIBIOS_MIN_IO + 1,
-                        ST40_IO_ADDR + PCIBIOS_MIN_IO, 0);
-#endif
-
-       /* ok, do the scan man */
-       pci_root_bus = pci_scan_bus(0, &st40pci_config_ops, NULL);
-       pci_assign_unassigned_resources();
-
-       return 0;
-}
-subsys_initcall(pcibios_init);
-
-/*
- * Publish a region of local address space over the PCI bus
- * to other devices.
- */
-static void pci_set_rbar_region(unsigned int region,     unsigned long localAddr,
-                        unsigned long pciOffset, unsigned long regionSize)
-{
-       unsigned long mask;
-
-       if (region > 7)
-               return;
-
-       if (regionSize > (512 * 1024 * 1024))
-               return;
-
-       mask = r2p2(regionSize) - 0x10000;
-
-       /* Disable the region (in case currently in use, should never happen) */
-       ST40PCI_WRITE_INDEXED(RSR, region, 0);
-
-       /* Start of local address space to publish */
-       ST40PCI_WRITE_INDEXED(RLAR, region, PHYSADDR(localAddr) );
-
-       /* Start of region in PCI address space as an offset from MBAR0 */
-       ST40PCI_WRITE_INDEXED(RBAR, region, pciOffset);
-
-       /* Size of region */
-       ST40PCI_WRITE_INDEXED(RSR, region, mask | 1);
-}
-
diff --git a/arch/sh/drivers/pci/pci-st40.h b/arch/sh/drivers/pci/pci-st40.h
deleted file mode 100644 (file)
index cf0d35b..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/* 
- * Copyright (C) 2001 David J. Mckay (david.mckay@st.com)
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.                            
- *
- * Definitions for the ST40 PCI hardware.
- */
-
-#ifndef __PCI_ST40_H__
-#define __PCI_ST40_H__
-
-#define ST40PCI_VCR_STATUS    0x00
-
-#define ST40PCI_VCR_VERSION   0x08
-
-#define ST40PCI_CR            0x10
-
-#define CR_SOFT_RESET (1<<12)
-#define CR_PFCS       (1<<11)
-#define CR_PFE        (1<<9)
-#define CR_BMAM       (1<<6)
-#define CR_HOST       (1<<5)
-#define CR_CLKEN      (1<<4)
-#define CR_SOCS       (1<<3)
-#define CR_IOCS       (1<<2)
-#define CR_RSTCTL     (1<<1)
-#define CR_CFINT      (1<<0)
-#define CR_LOCK_MASK  0x5a000000
-
-
-#define ST40PCI_LSR0          0X14
-#define ST40PCI_LAR0          0x1c
-
-#define ST40PCI_INT           0x24
-#define INT_MNLTDIM           (1<<15)
-#define INT_TTADI             (1<<14)
-#define INT_TMTO              (1<<9)
-#define INT_MDEI              (1<<8)
-#define INT_APEDI             (1<<7)
-#define INT_SDI               (1<<6)
-#define INT_DPEITW            (1<<5)
-#define INT_PEDITR            (1<<4)
-#define INT_TADIM             (1<<3)
-#define INT_MADIM             (1<<2)
-#define INT_MWPDI             (1<<1)
-#define INT_MRDPEI            (1<<0)
-
-
-#define ST40PCI_INTM          0x28
-#define ST40PCI_AIR           0x2c
-
-#define ST40PCI_CIR           0x30
-#define CIR_PIOTEM            (1<<31)
-#define CIR_RWTET             (1<<26)
-
-#define ST40PCI_AINT          0x40
-#define AINT_MBI              (1<<13)
-#define AINT_TBTOI            (1<<12)
-#define AINT_MBTOI            (1<<11)
-#define AINT_TAI              (1<<3)
-#define AINT_MAI              (1<<2)
-#define AINT_RDPEI            (1<<1)
-#define AINT_WDPE             (1<<0)
-
-#define ST40PCI_AINTM         0x44
-#define ST40PCI_BMIR          0x48
-#define ST40PCI_PAR           0x4c
-#define ST40PCI_MBR           0x50
-#define ST40PCI_IOBR          0x54
-#define ST40PCI_PINT          0x58
-#define ST40PCI_PINTM         0x5c
-#define ST40PCI_MBMR          0x70
-#define ST40PCI_IOBMR         0x74
-#define ST40PCI_PDR           0x78
-
-/* H8 specific registers start here */
-#define ST40PCI_WCBAR         0x7c
-#define ST40PCI_LOCCFG_UNLOCK 0x34
-
-#define ST40PCI_RBAR0         0x100
-#define ST40PCI_RSR0          0x104
-#define ST40PCI_RLAR0         0x108
-
-#define ST40PCI_RBAR1         0x110
-#define ST40PCI_RSR1          0x114
-#define ST40PCI_RLAR1         0x118
-
-
-#define ST40PCI_RBAR2         0x120
-#define ST40PCI_RSR2          0x124
-#define ST40PCI_RLAR2         0x128
-
-#define ST40PCI_RBAR3         0x130
-#define ST40PCI_RSR3          0x134
-#define ST40PCI_RLAR3         0x138
-
-#define ST40PCI_RBAR4         0x140
-#define ST40PCI_RSR4          0x144
-#define ST40PCI_RLAR4         0x148
-
-#define ST40PCI_RBAR5         0x150
-#define ST40PCI_RSR5          0x154
-#define ST40PCI_RLAR5         0x158
-
-#define ST40PCI_RBAR6         0x160
-#define ST40PCI_RSR6          0x164
-#define ST40PCI_RLAR6         0x168
-
-#define ST40PCI_RBAR7         0x170
-#define ST40PCI_RSR7          0x174
-#define ST40PCI_RLAR7         0x178
-
-
-#define ST40PCI_RBAR(n)      (0x100+(0x10*(n)))
-#define ST40PCI_RSR(n)       (0x104+(0x10*(n)))
-#define ST40PCI_RLAR(n)      (0x108+(0x10*(n)))
-
-#define ST40PCI_PERF               0x80
-#define PERF_MASTER_WRITE_POSTING  (1<<4)
-/* H8 specific registers end here */
-
-
-/* These are configs space registers */
-#define ST40PCI_CSR_VID               0x10000
-#define ST40PCI_CSR_DID               0x10002
-#define ST40PCI_CSR_CMD               0x10004
-#define ST40PCI_CSR_STATUS            0x10006
-#define ST40PCI_CSR_MBAR0             0x10010
-#define ST40PCI_CSR_TRDY              0x10040
-#define ST40PCI_CSR_RETRY             0x10041
-#define ST40PCI_CSR_MIT               0x1000d
-
-#define ST40_IO_ADDR 0xb6000000       
-
-#endif /* __PCI_ST40_H__ */
index 1f141a8ba17c09726d026161c9579c835d9896d9..4b81d9c47b0093cdf1b097ec4d8a41c91f826241 100644 (file)
@@ -10,7 +10,6 @@ obj-y := debugtraps.o io.o io_generic.o irq.o machvec.o process.o ptrace.o \
 
 obj-y                          += cpu/ timers/
 obj-$(CONFIG_VSYSCALL)         += vsyscall/
-
 obj-$(CONFIG_SMP)              += smp.o
 obj-$(CONFIG_CF_ENABLER)       += cf-enabler.o
 obj-$(CONFIG_SH_STANDARD_BIOS) += sh_bios.o
@@ -22,3 +21,5 @@ obj-$(CONFIG_KEXEC)           += machine_kexec.o relocate_kernel.o
 obj-$(CONFIG_CRASH_DUMP)       += crash_dump.o
 obj-$(CONFIG_PM)               += pm.o
 obj-$(CONFIG_STACKTRACE)       += stacktrace.o
+
+EXTRA_CFLAGS += -Werror
index 5da325414880abb50f68231cb001a80888cf7517..56ea7b269b59c4fdc3d0503bdfc411b39cb45971 100644 (file)
@@ -49,7 +49,6 @@ static void enable_ipr_irq(unsigned int irq)
  * bits/4. This is to make it easier to read the value directly from the
  * datasheets. The IPR address is calculated using the ipr_offset table.
  */
-
 void register_ipr_controller(struct ipr_desc *desc)
 {
        int i;
@@ -71,12 +70,4 @@ void register_ipr_controller(struct ipr_desc *desc)
                disable_ipr_irq(p->irq);
        }
 }
-
 EXPORT_SYMBOL(register_ipr_controller);
-
-#if !defined(CONFIG_CPU_HAS_PINT_IRQ)
-int ipr_irq_demux(int irq)
-{
-       return irq;
-}
-#endif
index 2b2a9e02fb752d1e358f41787369cb8731412501..b6abf38d3a8d158e720e653a36d6383f1308a59f 100644 (file)
@@ -46,7 +46,7 @@ ENTRY(exception_handling_table)
        .long   exception_error ! illegal_slot_instruction (filled by trap_init) /*1A0*/
 ENTRY(nmi_slot)
 #if defined (CONFIG_KGDB_NMI)
-       .long   debug_enter     /* 1C0 */       ! Allow trap to debugger
+       .long   kgdb_handle_exception   /* 1C0 */       ! Allow trap to debugger
 #else
        .long   exception_none  /* 1C0 */       ! Not implemented yet
 #endif
index 21375d777e9993687da782446a3ad27e96a3b2c3..bc9c28a69bf1933bfa2fb2ceee13c370c94ff3ef 100644 (file)
@@ -139,14 +139,6 @@ int __init detect_cpu_and_cache_system(void)
                boot_cpu_data.flags |= CPU_HAS_FPU | CPU_HAS_PERF_COUNTER |
                                          CPU_HAS_LLSC;
                break;
-       case 0x8000:
-               boot_cpu_data.type = CPU_ST40RA;
-               boot_cpu_data.flags |= CPU_HAS_FPU;
-               break;
-       case 0x8100:
-               boot_cpu_data.type = CPU_ST40GX1;
-               boot_cpu_data.flags |= CPU_HAS_FPU;
-               break;
        case 0x700:
                boot_cpu_data.type = CPU_SH4_501;
                boot_cpu_data.icache.ways = 2;
index 55f66104431db8cbe97b144c224be5c97e4155eb..b9c6547c4a90dcb2b822bdb5c7d8b7e27f0ce9f6 100644 (file)
 #include <asm/mmzone.h>
 #include <asm/sci.h>
 
+static struct resource usbf_resources[] = {
+       [0] = {
+               .name   = "m66592_udc",
+               .start  = 0xA4480000,
+               .end    = 0xA44800FF,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .name   = "m66592_udc",
+               .start  = 65,
+               .end    = 65,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device usbf_device = {
+       .name           = "m66592_udc",
+       .id             = -1,
+       .dev = {
+               .dma_mask               = NULL,
+               .coherent_dma_mask      = 0xffffffff,
+       },
+       .num_resources  = ARRAY_SIZE(usbf_resources),
+       .resource       = usbf_resources,
+};
+
 static struct plat_sci_port sci_platform_data[] = {
        {
                .mapbase        = 0xffe00000,
@@ -47,6 +73,7 @@ static struct platform_device sci_device = {
 };
 
 static struct platform_device *sh7722_devices[] __initdata = {
+       &usbf_device,
        &sci_device,
 };
 
index 4b49d03ffbd2edd6b1598f35c58e5ab7a37d18d5..0586bc62ad96506567549d9fe54f72837407c7a3 100644 (file)
@@ -11,7 +11,6 @@
 #include <linux/module.h>
 #include <linux/kernel_stat.h>
 #include <linux/seq_file.h>
-#include <linux/irq.h>
 #include <asm/processor.h>
 #include <asm/machvec.h>
 #include <asm/uaccess.h>
@@ -69,7 +68,7 @@ unlock:
 }
 #endif
 
-#ifdef CONFIG_4KSTACKS
+#ifdef CONFIG_IRQSTACKS
 /*
  * per-CPU IRQ handling contexts (thread information and stack)
  */
@@ -85,7 +84,7 @@ static union irq_ctx *softirq_ctx[NR_CPUS] __read_mostly;
 asmlinkage int do_IRQ(unsigned int irq, struct pt_regs *regs)
 {
        struct pt_regs *old_regs = set_irq_regs(regs);
-#ifdef CONFIG_4KSTACKS
+#ifdef CONFIG_IRQSTACKS
        union irq_ctx *curctx, *irqctx;
 #endif
 
@@ -109,7 +108,7 @@ asmlinkage int do_IRQ(unsigned int irq, struct pt_regs *regs)
 
        irq = irq_demux(evt2irq(irq));
 
-#ifdef CONFIG_4KSTACKS
+#ifdef CONFIG_IRQSTACKS
        curctx = (union irq_ctx *)current_thread_info();
        irqctx = hardirq_ctx[smp_processor_id()];
 
@@ -157,7 +156,7 @@ asmlinkage int do_IRQ(unsigned int irq, struct pt_regs *regs)
        return 1;
 }
 
-#ifdef CONFIG_4KSTACKS
+#ifdef CONFIG_IRQSTACKS
 static char softirq_stack[NR_CPUS * THREAD_SIZE]
                __attribute__((__section__(".bss.page_aligned")));
 
index 2fdc700dfd6e72be2bed5e8c4db4489967781d6c..d453c3a1c79f485377a870456cef74488d601e27 100644 (file)
 #include <linux/init.h>
 #include <linux/console.h>
 #include <linux/sysrq.h>
+#include <linux/module.h>
 #include <asm/system.h>
 #include <asm/cacheflush.h>
 #include <asm/current.h>
@@ -116,7 +117,9 @@ kgdb_debug_hook_t *kgdb_debug_hook;
 kgdb_bus_error_hook_t *kgdb_bus_err_hook;
 
 int (*kgdb_getchar)(void);
+EXPORT_SYMBOL_GPL(kgdb_getchar);
 void (*kgdb_putchar)(int);
+EXPORT_SYMBOL_GPL(kgdb_putchar);
 
 static void put_debug_char(int c)
 {
@@ -136,7 +139,7 @@ static int get_debug_char(void)
 #define NUMREGBYTES (MAXREG*4)
 #define OUTBUFMAX (NUMREGBYTES*2+512)
 
-enum regs {
+enum {
        R0 = 0, R1,  R2,  R3,   R4,   R5,  R6, R7,
        R8, R9, R10, R11, R12,  R13,  R14, R15,
        PC, PR, GBR, VBR, MACH, MACL, SR,
@@ -176,9 +179,13 @@ int kgdb_nofault;          /* Boolean to ignore bus errs (i.e. in GDB) */
 
 /* SCI/UART settings, used in kgdb_console_setup() */
 int  kgdb_portnum = CONFIG_KGDB_DEFPORT;
+EXPORT_SYMBOL_GPL(kgdb_portnum);
 int  kgdb_baud = CONFIG_KGDB_DEFBAUD;
+EXPORT_SYMBOL_GPL(kgdb_baud);
 char kgdb_parity = CONFIG_KGDB_DEFPARITY;
+EXPORT_SYMBOL_GPL(kgdb_parity);
 char kgdb_bits = CONFIG_KGDB_DEFBITS;
+EXPORT_SYMBOL_GPL(kgdb_bits);
 
 /* Jump buffer for setjmp/longjmp */
 static jmp_buf rem_com_env;
index b749403f6b382fe3c4108be924e5caa5e10afe80..4156aac8c27d2113b1211d97178269a58aec2d9f 100644 (file)
 #include <asm/clock.h>
 #include <asm/mmu_context.h>
 
-extern void * __rd_start, * __rd_end;
-
-/*
- * Machine setup..
- */
-
 /*
  * Initialize loops_per_jiffy as 10000000 (1000MIPS).
  * This value will be used at the very early stage of serial setup.
@@ -63,33 +57,25 @@ struct screen_info screen_info;
 
 extern int root_mountflags;
 
-/*
- * This is set up by the setup-routine at boot-time
- */
-#define PARAM  ((unsigned char *)empty_zero_page)
-
-#define MOUNT_ROOT_RDONLY (*(unsigned long *) (PARAM+0x000))
-#define RAMDISK_FLAGS (*(unsigned long *) (PARAM+0x004))
-#define ORIG_ROOT_DEV (*(unsigned long *) (PARAM+0x008))
-#define LOADER_TYPE (*(unsigned long *) (PARAM+0x00c))
-#define INITRD_START (*(unsigned long *) (PARAM+0x010))
-#define INITRD_SIZE (*(unsigned long *) (PARAM+0x014))
-/* ... */
-#define COMMAND_LINE ((char *) (PARAM+0x100))
-
 #define RAMDISK_IMAGE_START_MASK       0x07FF
 #define RAMDISK_PROMPT_FLAG            0x8000
 #define RAMDISK_LOAD_FLAG              0x4000
 
 static char __initdata command_line[COMMAND_LINE_SIZE] = { 0, };
 
-static struct resource code_resource = { .name = "Kernel code", };
-static struct resource data_resource = { .name = "Kernel data", };
+static struct resource code_resource = {
+       .name = "Kernel code",
+       .flags = IORESOURCE_BUSY | IORESOURCE_MEM,
+};
+
+static struct resource data_resource = {
+       .name = "Kernel data",
+       .flags = IORESOURCE_BUSY | IORESOURCE_MEM,
+};
 
 unsigned long memory_start;
 EXPORT_SYMBOL(memory_start);
-
-unsigned long memory_end;
+unsigned long memory_end = 0;
 EXPORT_SYMBOL(memory_end);
 
 static int __init early_parse_mem(char *p)
@@ -195,14 +181,7 @@ void __init setup_bootmem_allocator(unsigned long free_pfn)
        sparse_memory_present_with_active_regions(0);
 
 #ifdef CONFIG_BLK_DEV_INITRD
-       ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0);
-       if (&__rd_start != &__rd_end) {
-               LOADER_TYPE = 1;
-               INITRD_START = PHYSADDR((unsigned long)&__rd_start) -
-                                       __MEMORY_START;
-               INITRD_SIZE = (unsigned long)&__rd_end -
-                             (unsigned long)&__rd_start;
-       }
+       ROOT_DEV = Root_RAM0;
 
        if (LOADER_TYPE && INITRD_START) {
                if (INITRD_START + INITRD_SIZE <= (max_low_pfn << PAGE_SHIFT)) {
@@ -265,7 +244,8 @@ void __init setup_arch(char **cmdline_p)
        data_resource.end = virt_to_phys(_edata)-1;
 
        memory_start = (unsigned long)PAGE_OFFSET+__MEMORY_START;
-       memory_end = memory_start + __MEMORY_SIZE;
+       if (!memory_end)
+               memory_end = memory_start + __MEMORY_SIZE;
 
 #ifdef CONFIG_CMDLINE_BOOL
        strlcpy(command_line, CONFIG_CMDLINE, sizeof(command_line));
@@ -323,7 +303,6 @@ static const char *cpu_name[] = {
        [CPU_SH7750S]   = "SH7750S",    [CPU_SH7750R]   = "SH7750R",
        [CPU_SH7751]    = "SH7751",     [CPU_SH7751R]   = "SH7751R",
        [CPU_SH7760]    = "SH7760",
-       [CPU_ST40RA]    = "ST40RA",     [CPU_ST40GX1]   = "ST40GX1",
        [CPU_SH4_202]   = "SH4-202",    [CPU_SH4_501]   = "SH4-501",
        [CPU_SH7770]    = "SH7770",     [CPU_SH7780]    = "SH7780",
        [CPU_SH7781]    = "SH7781",     [CPU_SH7343]    = "SH7343",
index 548e4285b37569e82e731dd5ba1f8e79dff45739..e1a6de9088b5bde648fcae3f8ab0e9fcf89cb158 100644 (file)
@@ -106,7 +106,6 @@ DECLARE_EXPORT(__movmem);
 DECLARE_EXPORT(__movstr);
 #endif
 
-#ifdef CONFIG_CPU_SH4
 #if __GNUC__ == 4
 DECLARE_EXPORT(__movmem_i4_even);
 DECLARE_EXPORT(__movmem_i4_odd);
@@ -126,7 +125,6 @@ DECLARE_EXPORT(__movstr_i4_even);
 DECLARE_EXPORT(__movstr_i4_odd);
 DECLARE_EXPORT(__movstrSI12_i4);
 #endif /* __GNUC__ == 4 */
-#endif
 
 #if !defined(CONFIG_CACHE_OFF) && (defined(CONFIG_CPU_SH4) || \
        defined(CONFIG_SH7705_CACHE_32KB))
index 6d5abba2ee271a8147be2f56b2502ccd75600859..0956fb3681a316dfa4cbc538326fff5c35724903 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: vmlinux.lds.S,v 1.8 2003/05/16 17:18:14 lethal Exp $
+/*
  * ld script to make SuperH Linux kernel
  * Written by Niibe Yutaka
  */
@@ -15,121 +15,124 @@ OUTPUT_ARCH(sh)
 ENTRY(_start)
 SECTIONS
 {
-  . = CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START + CONFIG_ZERO_PAGE_OFFSET;
-  _text = .;                   /* Text and read-only data */
-  text = .;                    /* Text and read-only data */
-  .empty_zero_page : {
-       *(.empty_zero_page)
+       . = CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START + CONFIG_ZERO_PAGE_OFFSET;
+       _text = .;                      /* Text and read-only data */
+
+       .empty_zero_page : {
+               *(.empty_zero_page)
        } = 0
-  .text : {
-       *(.text.head)
-       TEXT_TEXT
-       SCHED_TEXT
-       LOCK_TEXT
-       *(.fixup)
-       *(.gnu.warning)
+
+       .text : {
+               *(.text.head)
+               TEXT_TEXT
+               SCHED_TEXT
+               LOCK_TEXT
+               KPROBES_TEXT
+               *(.fixup)
+               *(.gnu.warning)
        } = 0x0009
 
-  . = ALIGN(16);               /* Exception table */
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
+       . = ALIGN(16);          /* Exception table */
+       __start___ex_table = .;
+       __ex_table : { *(__ex_table) }
+       __stop___ex_table = .;
+
+       _etext = .;                     /* End of text section */
 
-  _etext = .;                  /* End of text section */
+       BUG_TABLE
+       NOTES
+       RO_DATA(PAGE_SIZE)
 
-  RODATA
+       . = ALIGN(THREAD_SIZE);
+       .data : {                       /* Data */
+               *(.data.init_task)
 
-  BUG_TABLE
+               . = ALIGN(L1_CACHE_BYTES);
+               *(.data.cacheline_aligned)
 
-  .data : {                    /* Data */
-       DATA_DATA
+               . = ALIGN(L1_CACHE_BYTES);
+               *(.data.read_mostly)
 
-        /* Align the initial ramdisk image (INITRD) on page boundaries. */
-        . = ALIGN(PAGE_SIZE);
-        __rd_start = .;
-        *(.initrd)
-        . = ALIGN(PAGE_SIZE);
-        __rd_end = .;
+               . = ALIGN(PAGE_SIZE);
+               *(.data.page_aligned)
 
-       CONSTRUCTORS
+               __nosave_begin = .;
+               *(.data.nosave)
+               . = ALIGN(PAGE_SIZE);
+               __nosave_end = .;
+
+               DATA_DATA
+               CONSTRUCTORS
        }
 
-  . = ALIGN(PAGE_SIZE);
-  .data.page_aligned : { *(.data.page_aligned) }
-  __nosave_begin = .;
-  .data_nosave : { *(.data.nosave) }
-  . = ALIGN(PAGE_SIZE);
-  __nosave_end = .;
-
-  PERCPU(PAGE_SIZE)
-
-  . = ALIGN(L1_CACHE_BYTES);
-  .data.cacheline_aligned : { *(.data.cacheline_aligned) }
-
-  _edata = .;                  /* End of data section */
-
-  . = ALIGN(THREAD_SIZE);              /* init_task */
-  .data.init_task : { *(.data.init_task) }
-
-  . = ALIGN(PAGE_SIZE);                /* Init code and data */
-  __init_begin = .;
-  _sinittext = .;
-  .init.text : { *(.init.text) }
-  _einittext = .;
-  .init.data : { *(.init.data) }
-  . = ALIGN(16);
-  __setup_start = .;
-  .init.setup : { *(.init.setup) }
-  __setup_end = .;
-  __initcall_start = .;
-  .initcall.init : {
-       INITCALLS
-  }
-  __initcall_end = .;
-  __con_initcall_start = .;
-  .con_initcall.init : { *(.con_initcall.init) }
-  __con_initcall_end = .;
-  SECURITY_INIT
-
-  /* .exit.text is discarded at runtime, not link time, to deal with
-     references from .rodata */
-  .exit.text : { *(.exit.text) }
-  .exit.data : { *(.exit.data) }
+       _edata = .;                     /* End of data section */
 
-#ifdef CONFIG_BLK_DEV_INITRD
-  . = ALIGN(PAGE_SIZE);
+       . = ALIGN(PAGE_SIZE);           /* Init code and data */
+       __init_begin = .;
+       _sinittext = .;
+       .init.text : { *(.init.text) }
+       _einittext = .;
+       .init.data : { *(.init.data) }
+
+       . = ALIGN(16);
+       __setup_start = .;
+       .init.setup : { *(.init.setup) }
+       __setup_end = .;
 
-  __initramfs_start = .;
-  .init.ramfs : { *(.init.ramfs) }
-  __initramfs_end = .;
+       __initcall_start = .;
+       .initcall.init : {
+               INITCALLS
+       }
+       __initcall_end = .;
+       __con_initcall_start = .;
+       .con_initcall.init : { *(.con_initcall.init) }
+       __con_initcall_end = .;
+
+       SECURITY_INIT
+
+#ifdef CONFIG_BLK_DEV_INITRD
+       . = ALIGN(PAGE_SIZE);
+       __initramfs_start = .;
+       .init.ramfs : { *(.init.ramfs) }
+       __initramfs_end = .;
 #endif
 
- . = ALIGN(4);
-  __machvec_start = .;
-  .machvec.init : { *(.machvec.init) }
-  __machvec_end = .;
-
-  . = ALIGN(PAGE_SIZE);
-  .bss : {
-       __init_end = .;
-       __bss_start = .;                /* BSS */
-       *(.bss.page_aligned)
-       *(.bss)
        . = ALIGN(4);
-       _ebss = .;                      /* uClinux MTD sucks */
-       _end = . ;
-  }
-
-  /* When something in the kernel is NOT compiled as a module, the
-   * module cleanup code and data are put into these segments.  Both
-   * can then be thrown away, as cleanup code is never called unless
-   * it's a module.
-   */
-  /DISCARD/ : {
-       *(.exitcall.exit)
+       __machvec_start = .;
+       .machvec.init : { *(.machvec.init) }
+       __machvec_end = .;
+
+       PERCPU(PAGE_SIZE)
+
+       /*
+        * .exit.text is discarded at runtime, not link time, to deal with
+        * references from __bug_table
+        */
+       .exit.text : { *(.exit.text) }
+       .exit.data : { *(.exit.data) }
+
+       . = ALIGN(PAGE_SIZE);
+       .bss : {
+               __init_end = .;
+               __bss_start = .;                /* BSS */
+               *(.bss.page_aligned)
+               *(.bss)
+               *(COMMON)
+               . = ALIGN(4);
+               _ebss = .;                      /* uClinux MTD sucks */
+               _end = . ;
        }
 
-  STABS_DEBUG
+       /*
+        * When something in the kernel is NOT compiled as a module, the
+        * module cleanup code and data are put into these segments. Both
+        * can then be thrown away, as cleanup code is never called unless
+        * it's a module.
+        */
+       /DISCARD/ : {
+               *(.exitcall.exit)
+       }
 
-  DWARF_DEBUG
+       STABS_DEBUG
+       DWARF_DEBUG
 }
index c9bf2af35d359550238ea83cf1de05246875eb80..6d59ee7c23dd52ed27e199d8e2597f1e1fc3f26b 100644 (file)
@@ -38,7 +38,10 @@ SECTIONS
        .text           : { *(.text) }                  :text   =0x90909090
        .note           : { *(.note.*) }                :text   :note
        .eh_frame_hdr   : { *(.eh_frame_hdr ) }         :text   :eh_frame_hdr
-       .eh_frame       : { KEEP (*(.eh_frame)) }       :text
+       .eh_frame       : {
+               KEEP (*(.eh_frame))
+               LONG (0)
+       }                                               :text
        .dynamic        : { *(.dynamic) }               :text   :dynamic
        .useless        : {
              *(.got.plt) *(.got)
index e23dd1a3fccd8f102eba02d24ac4cf3cc46fc607..9dc7b698505294001addab04ba2aecdbc82825d2 100644 (file)
@@ -9,3 +9,5 @@ memcpy-y                        := memcpy.o
 memcpy-$(CONFIG_CPU_SH4)       := memcpy-sh4.o
 
 lib-y  += $(memcpy-y)
+
+EXTRA_CFLAGS += -Werror
index cf446bbab5b08c03aa615240791ace492cfd8957..1265f204f7d1b65698027a717f95fcd52a1c70db 100644 (file)
@@ -17,7 +17,7 @@ config CPU_SH4
        bool
        select CPU_HAS_INTEVT
        select CPU_HAS_SR_RB
-       select CPU_HAS_PTEA if (!CPU_SUBTYPE_ST40 && !CPU_SH4A) || CPU_SHX2
+       select CPU_HAS_PTEA if !CPU_SH4A || CPU_SHX2
        select CPU_HAS_FPU if !CPU_SH4AL_DSP
 
 config CPU_SH4A
@@ -29,10 +29,6 @@ config CPU_SH4AL_DSP
        select CPU_SH4A
        select CPU_HAS_DSP
 
-config CPU_SUBTYPE_ST40
-       bool
-       select CPU_SH4
-
 config CPU_SHX2
        bool
 
@@ -152,21 +148,6 @@ config CPU_SUBTYPE_SH4_202
        bool "Support SH4-202 processor"
        select CPU_SH4
 
-# ST40 Processor Support
-
-config CPU_SUBTYPE_ST40STB1
-       bool "Support ST40STB1/ST40RA processors"
-       select CPU_SUBTYPE_ST40
-       help
-         Select ST40STB1 if you have a ST40RA CPU.
-         This was previously called the ST40STB1, hence the option name.
-
-config CPU_SUBTYPE_ST40GX1
-       bool "Support ST40GX1 processor"
-       select CPU_SUBTYPE_ST40
-       help
-         Select ST40GX1 if you have a ST40GX1 CPU.
-
 # SH-4A Processor Support
 
 config CPU_SUBTYPE_SH7770
index ee30fb44dfe107d1acc1e5f70292c3d57438baf3..aa44607f072d9ae771bb8de57c230027494bd0cd 100644 (file)
@@ -33,3 +33,5 @@ endif
 obj-$(CONFIG_HUGETLB_PAGE)     += hugetlbpage.o
 obj-$(CONFIG_32BIT)            += pmb.o
 obj-$(CONFIG_NUMA)             += numa.o
+
+EXTRA_CFLAGS += -Werror
index 8a706131e521d9c03485538bc5718130a53c57a1..7a7c81ee3f01659b14f24d818c02cb4e5f525f07 100644 (file)
@@ -150,48 +150,3 @@ ENTRY(__clear_user)
        .long   8b, .Lbad_clear_user
        .long   9b, .Lbad_clear_user
 .previous
-
-#if defined(CONFIG_CPU_SH4)
-/*
- * __clear_user_page
- * @to: P3 address (with same color)
- * @orig_to: P1 address
- *
- * void __clear_user_page(void *to, void *orig_to)
- */
-
-/*
- * r0 --- scratch 
- * r4 --- to
- * r5 --- orig_to
- * r6 --- to + PAGE_SIZE
- */
-ENTRY(__clear_user_page)
-       mov.l   .Lpsz,r0
-       mov     r4,r6
-       add     r0,r6
-       mov     #0,r0
-       !
-1:     ocbi    @r5
-       add     #32,r5
-       movca.l r0,@r4
-       mov     r4,r1
-       add     #32,r4
-       mov.l   r0,@-r4
-       mov.l   r0,@-r4
-       mov.l   r0,@-r4
-       mov.l   r0,@-r4
-       mov.l   r0,@-r4
-       mov.l   r0,@-r4
-       mov.l   r0,@-r4
-       add     #28,r4
-       cmp/eq  r6,r4
-       bf/s    1b
-        ocbwb  @r1
-       !
-       rts
-        nop
-.Lpsz: .long   PAGE_SIZE
-
-#endif
-
index a81dbdb05596993a580e9fb69d876133c1990d9c..40685018b95294ecce543f03a6127bedad77fdc2 100644 (file)
@@ -68,67 +68,6 @@ ENTRY(copy_page_slow)
        rts
         nop
 
-#if defined(CONFIG_CPU_SH4)
-/*
- * __copy_user_page
- * @to: P1 address (with same color)
- * @from: P1 address
- * @orig_to: P1 address
- *
- * void __copy_user_page(void *to, void *from, void *orig_to)
- */
-
-/*
- * r0, r1, r2, r3, r4, r5, r6, r7 --- scratch 
- * r8 --- from + PAGE_SIZE
- * r9 --- orig_to
- * r10 --- to
- * r11 --- from
- */
-ENTRY(__copy_user_page)
-       mov.l   r8,@-r15
-       mov.l   r9,@-r15
-       mov.l   r10,@-r15
-       mov.l   r11,@-r15
-       mov     r4,r10
-       mov     r5,r11
-       mov     r6,r9
-       mov     r5,r8
-       mov.l   .Lpsz,r0
-       add     r0,r8
-       !
-1:     ocbi    @r9
-       add     #32,r9
-       mov.l   @r11+,r0
-       mov.l   @r11+,r1
-       mov.l   @r11+,r2
-       mov.l   @r11+,r3
-       mov.l   @r11+,r4
-       mov.l   @r11+,r5
-       mov.l   @r11+,r6
-       mov.l   @r11+,r7
-       movca.l r0,@r10
-       mov     r10,r0
-       add     #32,r10
-       mov.l   r7,@-r10
-       mov.l   r6,@-r10
-       mov.l   r5,@-r10
-       mov.l   r4,@-r10
-       mov.l   r3,@-r10
-       mov.l   r2,@-r10
-       mov.l   r1,@-r10
-       ocbwb   @r0
-       cmp/eq  r11,r8
-       bf/s    1b
-        add    #28,r10
-       !
-       mov.l   @r15+,r11
-       mov.l   @r15+,r10
-       mov.l   @r15+,r9
-       mov.l   @r15+,r8
-       rts
-        nop
-#endif
        .align 2
 .Lpsz: .long   PAGE_SIZE
 /*
@@ -255,7 +194,11 @@ EX(        mov.l   @r5+,r8         )
 EX(    mov.l   @r5+,r9         )
 EX(    mov.l   @r5+,r10        )
 EX(    mov.l   @r5+,r11        )
+#ifdef CONFIG_CPU_SH4
 EX(    movca.l r0,@r4          )
+#else
+EX(    mov.l   r0,@r4          )
+#endif
        add     #-32, r6
 EX(    mov.l   r1,@(4,r4)      )
        mov     #32, r0
index f33cedb353fc6af215bc7f86b37120553d8e7532..60d74f793a1d33969a68d6c303b37dda4f4cd214 100644 (file)
@@ -258,9 +258,6 @@ asmlinkage int __kprobes __do_page_fault(struct pt_regs *regs,
        pmd_t *pmd;
        pte_t *pte;
        pte_t entry;
-       struct mm_struct *mm = current->mm;
-       spinlock_t *ptl = NULL;
-       int ret = 1;
 
 #ifdef CONFIG_SH_KGDB
        if (kgdb_nofault && kgdb_bus_err_hook)
@@ -274,12 +271,11 @@ asmlinkage int __kprobes __do_page_fault(struct pt_regs *regs,
         */
        if (address >= P3SEG && address < P3_ADDR_MAX) {
                pgd = pgd_offset_k(address);
-               mm = NULL;
        } else {
-               if (unlikely(address >= TASK_SIZE || !mm))
+               if (unlikely(address >= TASK_SIZE || !current->mm))
                        return 1;
 
-               pgd = pgd_offset(mm, address);
+               pgd = pgd_offset(current->mm, address);
        }
 
        pud = pud_offset(pgd, address);
@@ -289,34 +285,19 @@ asmlinkage int __kprobes __do_page_fault(struct pt_regs *regs,
        if (pmd_none_or_clear_bad(pmd))
                return 1;
 
-       if (mm)
-               pte = pte_offset_map_lock(mm, pmd, address, &ptl);
-       else
-               pte = pte_offset_kernel(pmd, address);
-
+       pte = pte_offset_kernel(pmd, address);
        entry = *pte;
        if (unlikely(pte_none(entry) || pte_not_present(entry)))
-               goto unlock;
+               return 1;
        if (unlikely(writeaccess && !pte_write(entry)))
-               goto unlock;
+               return 1;
 
        if (writeaccess)
                entry = pte_mkdirty(entry);
        entry = pte_mkyoung(entry);
 
-#ifdef CONFIG_CPU_SH4
-       /*
-        * ITLB is not affected by "ldtlb" instruction.
-        * So, we need to flush the entry by ourselves.
-        */
-       local_flush_tlb_one(get_asid(), address & PAGE_MASK);
-#endif
-
        set_pte(pte, entry);
        update_mmu_cache(NULL, address, entry);
-       ret = 0;
-unlock:
-       if (mm)
-               pte_unmap_unlock(pte, ptl);
-       return ret;
+
+       return 0;
 }
index 25f5c6f6821def36b1f796a66bb969f62044daa3..8c7a9ca79879aef2de7de1f253a6e8c8b5969121 100644 (file)
@@ -9,6 +9,8 @@
 #include <linux/mm.h>
 #include <linux/mutex.h>
 #include <linux/fs.h>
+#include <linux/highmem.h>
+#include <linux/module.h>
 #include <asm/mmu_context.h>
 #include <asm/cacheflush.h>
 
@@ -50,34 +52,61 @@ static inline void kunmap_coherent(struct page *page)
 void clear_user_page(void *to, unsigned long address, struct page *page)
 {
        __set_bit(PG_mapped, &page->flags);
-       if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0)
-               clear_page(to);
-       else {
-               void *vto = kmap_coherent(page, address);
-               __clear_user_page(vto, to);
-               kunmap_coherent(vto);
-       }
+
+       clear_page(to);
+       if ((((address & PAGE_MASK) ^ (unsigned long)to) & CACHE_ALIAS))
+               __flush_wback_region(to, PAGE_SIZE);
 }
 
-/*
- * copy_user_page
- * @to: P1 address
- * @from: P1 address
- * @address: U0 address to be mapped
- * @page: page (virt_to_page(to))
- */
-void copy_user_page(void *to, void *from, unsigned long address,
-                   struct page *page)
+void copy_to_user_page(struct vm_area_struct *vma, struct page *page,
+                      unsigned long vaddr, void *dst, const void *src,
+                      unsigned long len)
 {
+       void *vto;
+
        __set_bit(PG_mapped, &page->flags);
-       if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0)
-               copy_page(to, from);
-       else {
-               void *vfrom = kmap_coherent(page, address);
-               __copy_user_page(vfrom, from, to);
-               kunmap_coherent(vfrom);
-       }
+
+       vto = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK);
+       memcpy(vto, src, len);
+       kunmap_coherent(vto);
+
+       if (vma->vm_flags & VM_EXEC)
+               flush_cache_page(vma, vaddr, page_to_pfn(page));
+}
+
+void copy_from_user_page(struct vm_area_struct *vma, struct page *page,
+                        unsigned long vaddr, void *dst, const void *src,
+                        unsigned long len)
+{
+       void *vfrom;
+
+       __set_bit(PG_mapped, &page->flags);
+
+       vfrom = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK);
+       memcpy(dst, vfrom, len);
+       kunmap_coherent(vfrom);
+}
+
+void copy_user_highpage(struct page *to, struct page *from,
+                       unsigned long vaddr, struct vm_area_struct *vma)
+{
+       void *vfrom, *vto;
+
+       __set_bit(PG_mapped, &to->flags);
+
+       vto = kmap_atomic(to, KM_USER1);
+       vfrom = kmap_coherent(from, vaddr);
+       copy_page(vto, vfrom);
+       kunmap_coherent(vfrom);
+
+       if (((vaddr ^ (unsigned long)vto) & CACHE_ALIAS))
+               __flush_wback_region(vto, PAGE_SIZE);
+
+       kunmap_atomic(vto, KM_USER1);
+       /* Make sure this page is cleared on other CPU's too before using it */
+       smp_wmb();
 }
+EXPORT_SYMBOL(copy_user_highpage);
 
 /*
  * For SH-4, we have our own implementation for ptep_get_and_clear
index 1f25d9bb7538a511d3d9ff8d9d4dc88658d84b97..2efc2e79fd297019e7f207175fba437e668b7852 100644 (file)
@@ -15,3 +15,4 @@ profdrvr-$(CONFIG_CPU_SUBTYPE_SH7091) := op_model_sh7750.o
 
 oprofile-y                             := $(DRIVER_OBJS) $(profdrvr-y)
 
+EXTRA_CFLAGS += -Werror
index ebee7e24ede9e253cf87f7d78ca5fc35114f848b..6b9a98e07004a09f30e34d4335e26aa62e788328 100644 (file)
@@ -16,7 +16,6 @@
 #include <linux/errno.h>
 #include <linux/interrupt.h>
 #include <linux/fs.h>
-#include <linux/notifier.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
 
@@ -44,8 +43,6 @@
  */
 #define NR_CNTRS       2
 
-extern const char *get_cpu_subtype(void);
-
 struct op_counter_config {
        unsigned long enabled;
        unsigned long event;
@@ -111,17 +108,12 @@ static struct op_counter_config ctr[NR_CNTRS];
  * behavior.
  */
 
-static int sh7750_timer_notify(struct notifier_block *self,
-                              unsigned long val, void *regs)
+static int sh7750_timer_notify(struct pt_regs *regs)
 {
-       oprofile_add_sample((struct pt_regs *)regs, 0);
+       oprofile_add_sample(regs, 0);
        return 0;
 }
 
-static struct notifier_block sh7750_timer_notifier = {
-       .notifier_call          = sh7750_timer_notify,
-};
-
 static u64 sh7750_read_counter(int counter)
 {
        u32 hi, lo;
@@ -240,7 +232,7 @@ static int sh7750_perf_counter_start(void)
                ctrl_outw(pmcr | PMCR_ENABLE, PMCR2);
        }
 
-       return register_profile_notifier(&sh7750_timer_notifier);
+       return register_timer_hook(sh7750_timer_notify);
 }
 
 static void sh7750_perf_counter_stop(void)
@@ -248,7 +240,7 @@ static void sh7750_perf_counter_stop(void)
        ctrl_outw(ctrl_inw(PMCR1) & ~PMCR_PMEN, PMCR1);
        ctrl_outw(ctrl_inw(PMCR2) & ~PMCR_PMEN, PMCR2);
 
-       unregister_profile_notifier(&sh7750_timer_notifier);
+       unregister_timer_hook(sh7750_timer_notify);
 }
 
 static struct oprofile_operations sh7750_perf_counter_ops = {
@@ -257,13 +249,13 @@ static struct oprofile_operations sh7750_perf_counter_ops = {
        .stop           = sh7750_perf_counter_stop,
 };
 
-int __init oprofile_arch_init(struct oprofile_operations **ops)
+int __init oprofile_arch_init(struct oprofile_operations *ops)
 {
        if (!(current_cpu_data.flags & CPU_HAS_PERF_COUNTER))
                return -ENODEV;
 
-       sh7750_perf_counter_ops.cpu_type = (char *)get_cpu_subtype();
-       *ops = &sh7750_perf_counter_ops;
+       ops = &sh7750_perf_counter_ops;
+       ops->cpu_type = (char *)get_cpu_subtype(&current_cpu_data);
 
        printk(KERN_INFO "oprofile: using SH-4 (%s) performance monitoring.\n",
               sh7750_perf_counter_ops.cpu_type);
index 439bfe3d29af6a5362e4172c3826035b0d74fb22..ff071693325c48ff679cecc5da788afe6e9887ac 100644 (file)
@@ -1,26 +1,35 @@
 #
-# List of boards.
+# MACH_<xxx>           CONFIG_<xxx>
 #
 
 #
-# MACH_<xxx>           CONFIG_<xxx>
+# List of board groups.
 #
 SE                     SH_SOLUTION_ENGINE
-7751SE                 SH_7751_SOLUTION_ENGINE         
-7722SE                 SH_7722_SOLUTION_ENGINE         
-7343SE                 SH_7343_SOLUTION_ENGINE
+HIGHLANDER             SH_HIGHLANDER
+RTS7751R2D             SH_RTS7751R2D
+
+#
+# List of companion chips / MFDs.
+#
+HD64461                        HD64461
+HD64465                        HD64465
+
+#
+# List of boards.
+#
 7206SE                 SH_7206_SOLUTION_ENGINE
+7343SE                 SH_7343_SOLUTION_ENGINE
 7619SE                 SH_7619_SOLUTION_ENGINE
+7722SE                 SH_7722_SOLUTION_ENGINE         
+7751SE                 SH_7751_SOLUTION_ENGINE         
 7780SE                 SH_7780_SOLUTION_ENGINE
 7751SYSTEMH            SH_7751_SYSTEMH
 HP6XX                  SH_HP6XX
-HD64461                        HD64461
-HD64465                        HD64465
 DREAMCAST              SH_DREAMCAST
 MPC1211                        SH_MPC1211
 SNAPGEAR               SH_SECUREEDGE5410
 HS7751RVOIP            SH_HS7751RVOIP
-RTS7751R2D             SH_RTS7751R2D
 EDOSK7705              SH_EDOSK7705
 SH4202_MICRODEV                SH_SH4202_MICRODEV
 SH03                   SH_SH03
@@ -32,3 +41,7 @@ TITAN                 SH_TITAN
 SHMIN                  SH_SHMIN
 7710VOIPGW             SH_7710VOIPGW
 LBOXRE2                        SH_LBOX_RE2
+X3PROTO                        SH_X3PROTO
+MAGICPANELR2           SH_MAGIC_PANEL_R2
+R2D_PLUS               RTS7751R2D_PLUS
+R2D_1                  RTS7751R2D_1
index ba204bac49dfa32536ff8561821f2cc3a5ffc2cb..6884d5a518ad78315ec8fcf107da8661c82d933d 100644 (file)
@@ -1,6 +1,6 @@
 #
 # For a description of the syntax of this configuration file,
-# see Documentation/kbuild/config-language.txt.
+# see Documentation/kbuild/kconfig-language.txt.
 #
 
 mainmenu "Linux/SH64 Kernel Configuration"
index 91b59118c1b19f28737555b88fbdccde9613c062..75552bb0140582f2d2e9744b786f764826180fef 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.23-rc8
-# Tue Oct  9 15:37:16 2007
+# Linux kernel version: 2.6.24-rc1
+# Fri Nov  2 14:35:27 2007
 #
 CONFIG_SUPERH=y
 CONFIG_SUPERH64=y
@@ -36,6 +36,10 @@ CONFIG_POSIX_MQUEUE=y
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FAIR_USER_SCHED=y
+# CONFIG_FAIR_CGROUP_SCHED is not set
 CONFIG_SYSFS_DEPRECATED=y
 # CONFIG_RELAY is not set
 # CONFIG_BLK_DEV_INITRD is not set
@@ -148,6 +152,7 @@ CONFIG_FLATMEM_MANUAL=y
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
+# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=0
@@ -160,10 +165,6 @@ CONFIG_PCI=y
 CONFIG_SH_PCIDMA_NONCOHERENT=y
 # CONFIG_ARCH_SUPPORTS_MSI is not set
 # CONFIG_PCI_DEBUG is not set
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
 # CONFIG_PCCARD is not set
 # CONFIG_HOTPLUG_PCI is not set
 
@@ -209,6 +210,7 @@ CONFIG_IP_PNP=y
 CONFIG_INET_XFRM_MODE_TRANSPORT=y
 CONFIG_INET_XFRM_MODE_TUNNEL=y
 CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
@@ -234,10 +236,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_LAPB is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
-
-#
-# QoS and/or fair queueing
-#
 # CONFIG_NET_SCHED is not set
 
 #
@@ -266,6 +264,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 #
 # Generic Driver Options
 #
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_FW_LOADER is not set
@@ -333,6 +332,7 @@ CONFIG_SCSI_SPI_ATTRS=y
 # CONFIG_SCSI_FC_ATTRS is not set
 # CONFIG_SCSI_ISCSI_ATTRS is not set
 # CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
 CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_ISCSI_TCP is not set
 # CONFIG_BLK_DEV_3W_XXXX_RAID is not set
@@ -370,14 +370,7 @@ CONFIG_SCSI_SYM53C8XX_MMIO=y
 # CONFIG_SCSI_SRP is not set
 # CONFIG_ATA is not set
 # CONFIG_MD is not set
-
-#
-# Fusion MPT device support
-#
 # CONFIG_FUSION is not set
-# CONFIG_FUSION_SPI is not set
-# CONFIG_FUSION_FC is not set
-# CONFIG_FUSION_SAS is not set
 
 #
 # IEEE 1394 (FireWire) support
@@ -392,6 +385,8 @@ CONFIG_NETDEVICES=y
 # CONFIG_MACVLAN is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
+# CONFIG_VETH is not set
+# CONFIG_IP1000 is not set
 # CONFIG_ARCNET is not set
 # CONFIG_PHYLIB is not set
 CONFIG_NET_ETHERNET=y
@@ -402,6 +397,7 @@ CONFIG_NET_ETHERNET=y
 # CONFIG_CASSINI is not set
 # CONFIG_NET_VENDOR_3COM is not set
 # CONFIG_SMC91X is not set
+# CONFIG_SMC911X is not set
 CONFIG_NET_TULIP=y
 # CONFIG_DE2104X is not set
 CONFIG_TULIP=y
@@ -413,13 +409,16 @@ CONFIG_TULIP=y
 # CONFIG_DM9102 is not set
 # CONFIG_ULI526X is not set
 # CONFIG_HP100 is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
 CONFIG_NET_PCI=y
 # CONFIG_PCNET32 is not set
 # CONFIG_AMD8111_ETH is not set
 # CONFIG_ADAPTEC_STARFIRE is not set
 # CONFIG_B44 is not set
 # CONFIG_FORCEDETH is not set
-# CONFIG_DGRS is not set
 # CONFIG_EEPRO100 is not set
 # CONFIG_E100 is not set
 # CONFIG_FEALNX is not set
@@ -437,6 +436,7 @@ CONFIG_NETDEV_1000=y
 # CONFIG_ACENIC is not set
 # CONFIG_DL2K is not set
 # CONFIG_E1000 is not set
+# CONFIG_E1000E is not set
 # CONFIG_NS83820 is not set
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
@@ -453,11 +453,14 @@ CONFIG_NETDEV_1000=y
 CONFIG_NETDEV_10000=y
 # CONFIG_CHELSIO_T1 is not set
 # CONFIG_CHELSIO_T3 is not set
+# CONFIG_IXGBE is not set
 # CONFIG_IXGB is not set
 # CONFIG_S2IO is not set
 # CONFIG_MYRI10GE is not set
 # CONFIG_NETXEN_NIC is not set
+# CONFIG_NIU is not set
 # CONFIG_MLX4_CORE is not set
+# CONFIG_TEHUTI is not set
 # CONFIG_TR is not set
 
 #
@@ -493,7 +496,6 @@ CONFIG_INPUT_MOUSEDEV_PSAUX=y
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
 # CONFIG_INPUT_EVDEV is not set
 # CONFIG_INPUT_EVBUG is not set
 
@@ -561,23 +563,9 @@ CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
 # CONFIG_IPMI_HANDLER is not set
-CONFIG_WATCHDOG=y
-# CONFIG_WATCHDOG_NOWAYOUT is not set
-
-#
-# Watchdog Device Drivers
-#
-# CONFIG_SOFT_WATCHDOG is not set
-
-#
-# PCI-based Watchdog Cards
-#
-# CONFIG_PCIPCWATCHDOG is not set
-# CONFIG_WDTPCI is not set
 CONFIG_HW_RANDOM=y
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
-# CONFIG_DRM is not set
 # CONFIG_RAW_DRIVER is not set
 # CONFIG_TCG_TPM is not set
 CONFIG_DEVPORT=y
@@ -644,8 +632,6 @@ CONFIG_I2C_BOARDINFO=y
 # CONFIG_POWER_SUPPLY is not set
 CONFIG_HWMON=y
 # CONFIG_HWMON_VID is not set
-# CONFIG_SENSORS_ABITUGURU is not set
-# CONFIG_SENSORS_ABITUGURU3 is not set
 # CONFIG_SENSORS_AD7418 is not set
 # CONFIG_SENSORS_ADM1021 is not set
 # CONFIG_SENSORS_ADM1025 is not set
@@ -653,12 +639,12 @@ CONFIG_HWMON=y
 # CONFIG_SENSORS_ADM1029 is not set
 # CONFIG_SENSORS_ADM1031 is not set
 # CONFIG_SENSORS_ADM9240 is not set
-# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_ADT7470 is not set
 # CONFIG_SENSORS_ATXP1 is not set
 # CONFIG_SENSORS_DS1621 is not set
 # CONFIG_SENSORS_F71805F is not set
-# CONFIG_SENSORS_FSCHER is not set
-# CONFIG_SENSORS_FSCPOS is not set
+# CONFIG_SENSORS_F71882FG is not set
+# CONFIG_SENSORS_F75375S is not set
 # CONFIG_SENSORS_GL518SM is not set
 # CONFIG_SENSORS_GL520SM is not set
 # CONFIG_SENSORS_IT87 is not set
@@ -694,6 +680,25 @@ CONFIG_HWMON=y
 # CONFIG_SENSORS_W83627HF is not set
 # CONFIG_SENSORS_W83627EHF is not set
 # CONFIG_HWMON_DEBUG_CHIP is not set
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+
+#
+# PCI-based Watchdog Cards
+#
+# CONFIG_PCIPCWATCHDOG is not set
+# CONFIG_WDTPCI is not set
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
 
 #
 # Multifunction device drivers
@@ -713,11 +718,11 @@ CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
 # CONFIG_VIDEO_VIVI is not set
 # CONFIG_VIDEO_SAA5246A is not set
 # CONFIG_VIDEO_SAA5249 is not set
-# CONFIG_TUNER_TEA5761 is not set
 # CONFIG_VIDEO_SAA7134 is not set
 # CONFIG_VIDEO_HEXIUM_ORION is not set
 # CONFIG_VIDEO_HEXIUM_GEMINI is not set
 # CONFIG_VIDEO_CX88 is not set
+# CONFIG_VIDEO_CX23885 is not set
 # CONFIG_VIDEO_CAFE_CCIC is not set
 # CONFIG_RADIO_ADAPTERS is not set
 CONFIG_DVB_CORE=y
@@ -796,6 +801,7 @@ CONFIG_DVB_CAPTURE_DRIVERS=y
 # CONFIG_DVB_OR51132 is not set
 # CONFIG_DVB_BCM3510 is not set
 # CONFIG_DVB_LGDT330X is not set
+# CONFIG_DVB_S5H1409 is not set
 
 #
 # Tuners/PLL support
@@ -805,6 +811,9 @@ CONFIG_DVB_CAPTURE_DRIVERS=y
 # CONFIG_DVB_TDA827X is not set
 # CONFIG_DVB_TUNER_QT1010 is not set
 # CONFIG_DVB_TUNER_MT2060 is not set
+# CONFIG_DVB_TUNER_MT2266 is not set
+# CONFIG_DVB_TUNER_MT2131 is not set
+# CONFIG_DVB_TUNER_DIB0070 is not set
 
 #
 # Miscellaneous devices
@@ -817,12 +826,7 @@ CONFIG_DAB=y
 #
 # Graphics support
 #
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
-
-#
-# Display device support
-#
-# CONFIG_DISPLAY_SUPPORT is not set
+# CONFIG_DRM is not set
 # CONFIG_VGASTATE is not set
 CONFIG_VIDEO_OUTPUT_CONTROL=y
 CONFIG_FB=y
@@ -831,6 +835,7 @@ CONFIG_FIRMWARE_EDID=y
 CONFIG_FB_CFB_FILLRECT=y
 CONFIG_FB_CFB_COPYAREA=y
 CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
 # CONFIG_FB_SYS_FILLRECT is not set
 # CONFIG_FB_SYS_COPYAREA is not set
 # CONFIG_FB_SYS_IMAGEBLIT is not set
@@ -869,6 +874,12 @@ CONFIG_FB_KYRO=y
 # CONFIG_FB_ARK is not set
 # CONFIG_FB_PM3 is not set
 # CONFIG_FB_VIRTUAL is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
 
 #
 # Console display driver support
@@ -903,6 +914,7 @@ CONFIG_LOGO_SUPERH_CLUT224=y
 CONFIG_HID_SUPPORT=y
 CONFIG_HID=y
 # CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
 CONFIG_USB_SUPPORT=y
 CONFIG_USB_ARCH_HAS_HCD=y
 CONFIG_USB_ARCH_HAS_OHCI=y
@@ -922,19 +934,6 @@ CONFIG_USB_ARCH_HAS_EHCI=y
 # CONFIG_INFINIBAND is not set
 # CONFIG_RTC_CLASS is not set
 
-#
-# DMA Engine support
-#
-# CONFIG_DMA_ENGINE is not set
-
-#
-# DMA Clients
-#
-
-#
-# DMA Devices
-#
-
 #
 # Userspace I/O
 #
@@ -994,7 +993,6 @@ CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
 CONFIG_HUGETLBFS=y
 CONFIG_HUGETLB_PAGE=y
-CONFIG_RAMFS=y
 # CONFIG_CONFIGFS_FS is not set
 
 #
@@ -1013,10 +1011,7 @@ CONFIG_RAMFS=y
 # CONFIG_QNX4FS_FS is not set
 # CONFIG_SYSV_FS is not set
 # CONFIG_UFS_FS is not set
-
-#
-# Network File Systems
-#
+CONFIG_NETWORK_FILESYSTEMS=y
 CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 # CONFIG_NFS_V3_ACL is not set
@@ -1058,26 +1053,17 @@ CONFIG_MSDOS_PARTITION=y
 # CONFIG_KARMA_PARTITION is not set
 # CONFIG_EFI_PARTITION is not set
 # CONFIG_SYSV68_PARTITION is not set
-
-#
-# Native Language Support
-#
 # CONFIG_NLS is not set
-
-#
-# Distributed Lock Manager
-#
 # CONFIG_DLM is not set
-
-#
-# Profiling support
-#
+CONFIG_INSTRUMENTATION=y
 # CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
 
 #
 # Kernel hacking
 #
 # CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
 CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_UNUSED_SYMBOLS is not set
@@ -1101,10 +1087,13 @@ CONFIG_DEBUG_BUGVERBOSE=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_DEBUG_VM is not set
 # CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
 CONFIG_FRAME_POINTER=y
 CONFIG_FORCED_INLINING=y
+# CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_FAULT_INJECTION is not set
+# CONFIG_SAMPLES is not set
 # CONFIG_EARLY_PRINTK is not set
 CONFIG_SH64_PROC_TLB=y
 CONFIG_SH64_PROC_ASIDS=y
@@ -1118,6 +1107,7 @@ CONFIG_SH64_SR_WATCH=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
 # CONFIG_CRYPTO is not set
 
 #
index e4b84b51baf8882b8891f44e8c93a80d2139ca68..ba302cd0c28516d31e57c1ac01b4af4b022fbe84 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.23-rc8
-# Mon Oct  1 18:01:38 2007
+# Linux kernel version: 2.6.24-rc1
+# Fri Nov  2 14:35:57 2007
 #
 CONFIG_SUPERH=y
 CONFIG_SUPERH64=y
@@ -36,6 +36,10 @@ CONFIG_POSIX_MQUEUE=y
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FAIR_USER_SCHED=y
+# CONFIG_FAIR_CGROUP_SCHED is not set
 CONFIG_SYSFS_DEPRECATED=y
 # CONFIG_RELAY is not set
 # CONFIG_BLK_DEV_INITRD is not set
@@ -141,6 +145,7 @@ CONFIG_FLATMEM_MANUAL=y
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
+# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=0
@@ -150,10 +155,6 @@ CONFIG_NR_QUICK=1
 # Bus options (PCI, PCMCIA, EISA, MCA, ISA)
 #
 # CONFIG_ARCH_SUPPORTS_MSI is not set
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
 # CONFIG_PCCARD is not set
 
 #
@@ -198,6 +199,7 @@ CONFIG_IP_PNP=y
 CONFIG_INET_XFRM_MODE_TRANSPORT=y
 CONFIG_INET_XFRM_MODE_TUNNEL=y
 CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
@@ -223,10 +225,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_LAPB is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
-
-#
-# QoS and/or fair queueing
-#
 # CONFIG_NET_SCHED is not set
 
 #
@@ -255,6 +253,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 #
 # Generic Driver Options
 #
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_FW_LOADER is not set
@@ -314,6 +313,7 @@ CONFIG_SCSI_SPI_ATTRS=y
 # CONFIG_SCSI_FC_ATTRS is not set
 # CONFIG_SCSI_ISCSI_ATTRS is not set
 # CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
 CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_ISCSI_TCP is not set
 # CONFIG_SCSI_DEBUG is not set
@@ -326,11 +326,18 @@ CONFIG_NETDEVICES=y
 # CONFIG_MACVLAN is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
+# CONFIG_VETH is not set
 # CONFIG_PHYLIB is not set
 CONFIG_NET_ETHERNET=y
 # CONFIG_MII is not set
 # CONFIG_STNIC is not set
 # CONFIG_SMC91X is not set
+# CONFIG_SMC911X is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_B44 is not set
 CONFIG_NETDEV_1000=y
 CONFIG_NETDEV_10000=y
 
@@ -364,7 +371,6 @@ CONFIG_INPUT_MOUSEDEV=y
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
 # CONFIG_INPUT_EVDEV is not set
 # CONFIG_INPUT_EVBUG is not set
 
@@ -410,13 +416,6 @@ CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
 # CONFIG_IPMI_HANDLER is not set
-CONFIG_WATCHDOG=y
-# CONFIG_WATCHDOG_NOWAYOUT is not set
-
-#
-# Watchdog Device Drivers
-#
-# CONFIG_SOFT_WATCHDOG is not set
 CONFIG_HW_RANDOM=y
 # CONFIG_R3964 is not set
 # CONFIG_RAW_DRIVER is not set
@@ -432,9 +431,8 @@ CONFIG_HW_RANDOM=y
 # CONFIG_POWER_SUPPLY is not set
 CONFIG_HWMON=y
 # CONFIG_HWMON_VID is not set
-# CONFIG_SENSORS_ABITUGURU is not set
-# CONFIG_SENSORS_ABITUGURU3 is not set
 # CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_F71882FG is not set
 # CONFIG_SENSORS_IT87 is not set
 # CONFIG_SENSORS_PC87360 is not set
 # CONFIG_SENSORS_PC87427 is not set
@@ -444,6 +442,19 @@ CONFIG_HWMON=y
 # CONFIG_SENSORS_W83627HF is not set
 # CONFIG_SENSORS_W83627EHF is not set
 # CONFIG_HWMON_DEBUG_CHIP is not set
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
 
 #
 # Multifunction device drivers
@@ -460,12 +471,6 @@ CONFIG_DAB=y
 #
 # Graphics support
 #
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
-
-#
-# Display device support
-#
-# CONFIG_DISPLAY_SUPPORT is not set
 # CONFIG_VGASTATE is not set
 CONFIG_VIDEO_OUTPUT_CONTROL=y
 CONFIG_FB=y
@@ -474,6 +479,7 @@ CONFIG_FIRMWARE_EDID=y
 # CONFIG_FB_CFB_FILLRECT is not set
 # CONFIG_FB_CFB_COPYAREA is not set
 # CONFIG_FB_CFB_IMAGEBLIT is not set
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
 # CONFIG_FB_SYS_FILLRECT is not set
 # CONFIG_FB_SYS_COPYAREA is not set
 # CONFIG_FB_SYS_IMAGEBLIT is not set
@@ -490,6 +496,12 @@ CONFIG_FB_MODE_HELPERS=y
 #
 # CONFIG_FB_S1D13XXX is not set
 # CONFIG_FB_VIRTUAL is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
 
 #
 # Console display driver support
@@ -524,6 +536,7 @@ CONFIG_LOGO_SUPERH_CLUT224=y
 CONFIG_HID_SUPPORT=y
 CONFIG_HID=y
 # CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
 CONFIG_USB_SUPPORT=y
 CONFIG_USB_ARCH_HAS_HCD=y
 # CONFIG_USB_ARCH_HAS_OHCI is not set
@@ -542,19 +555,6 @@ CONFIG_USB_ARCH_HAS_HCD=y
 # CONFIG_NEW_LEDS is not set
 # CONFIG_RTC_CLASS is not set
 
-#
-# DMA Engine support
-#
-# CONFIG_DMA_ENGINE is not set
-
-#
-# DMA Clients
-#
-
-#
-# DMA Devices
-#
-
 #
 # Userspace I/O
 #
@@ -614,7 +614,6 @@ CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
 CONFIG_HUGETLBFS=y
 CONFIG_HUGETLB_PAGE=y
-CONFIG_RAMFS=y
 # CONFIG_CONFIGFS_FS is not set
 
 #
@@ -633,10 +632,7 @@ CONFIG_RAMFS=y
 # CONFIG_QNX4FS_FS is not set
 # CONFIG_SYSV_FS is not set
 # CONFIG_UFS_FS is not set
-
-#
-# Network File Systems
-#
+CONFIG_NETWORK_FILESYSTEMS=y
 CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 # CONFIG_NFS_V3_ACL is not set
@@ -678,26 +674,17 @@ CONFIG_MSDOS_PARTITION=y
 # CONFIG_KARMA_PARTITION is not set
 # CONFIG_EFI_PARTITION is not set
 # CONFIG_SYSV68_PARTITION is not set
-
-#
-# Native Language Support
-#
 # CONFIG_NLS is not set
-
-#
-# Distributed Lock Manager
-#
 # CONFIG_DLM is not set
-
-#
-# Profiling support
-#
+CONFIG_INSTRUMENTATION=y
 # CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
 
 #
 # Kernel hacking
 #
 # CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
 CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_UNUSED_SYMBOLS is not set
@@ -721,16 +708,17 @@ CONFIG_DEBUG_BUGVERBOSE=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_DEBUG_VM is not set
 # CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
 CONFIG_FRAME_POINTER=y
 CONFIG_FORCED_INLINING=y
+# CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_FAULT_INJECTION is not set
+# CONFIG_SAMPLES is not set
 # CONFIG_EARLY_PRINTK is not set
-# CONFIG_DEBUG_KERNEL_WITH_GDB_STUB is not set
 CONFIG_SH64_PROC_TLB=y
 CONFIG_SH64_PROC_ASIDS=y
 CONFIG_SH64_SR_WATCH=y
 # CONFIG_POOR_MANS_STRACE is not set
-# CONFIG_SH_ALPHANUMERIC is not set
 # CONFIG_SH_NO_BSS_INIT is not set
 
 #
@@ -738,6 +726,7 @@ CONFIG_SH64_SR_WATCH=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
 # CONFIG_CRYPTO is not set
 
 #
index f83bae659dc3a8860005e26227bfdd3e73d6c35b..18476cc522c3ed4720c05200bd8a53d930c8e736 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.23-rc8
-# Mon Oct  1 17:50:35 2007
+# Linux kernel version: 2.6.24-rc1
+# Fri Nov  2 14:36:08 2007
 #
 CONFIG_SUPERH=y
 CONFIG_SUPERH64=y
@@ -33,6 +33,10 @@ CONFIG_SWAP=y
 # CONFIG_USER_NS is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FAIR_USER_SCHED=y
+# CONFIG_FAIR_CGROUP_SCHED is not set
 CONFIG_SYSFS_DEPRECATED=y
 # CONFIG_RELAY is not set
 # CONFIG_BLK_DEV_INITRD is not set
@@ -138,6 +142,7 @@ CONFIG_FLATMEM_MANUAL=y
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
+# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=0
@@ -147,10 +152,6 @@ CONFIG_NR_QUICK=1
 # Bus options (PCI, PCMCIA, EISA, MCA, ISA)
 #
 # CONFIG_ARCH_SUPPORTS_MSI is not set
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
 # CONFIG_PCCARD is not set
 
 #
@@ -171,6 +172,7 @@ CONFIG_BINFMT_ELF=y
 #
 # Generic Driver Options
 #
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_FW_LOADER is not set
@@ -217,6 +219,7 @@ CONFIG_SCSI_MULTI_LUN=y
 CONFIG_SCSI_SPI_ATTRS=y
 # CONFIG_SCSI_FC_ATTRS is not set
 # CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
 CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_SCSI_DEBUG is not set
 # CONFIG_ATA is not set
@@ -238,7 +241,6 @@ CONFIG_INPUT_MOUSEDEV=y
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
 # CONFIG_INPUT_EVDEV is not set
 # CONFIG_INPUT_EVBUG is not set
 
@@ -283,7 +285,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 # CONFIG_LEGACY_PTYS is not set
 # CONFIG_IPMI_HANDLER is not set
-# CONFIG_WATCHDOG is not set
 # CONFIG_HW_RANDOM is not set
 # CONFIG_R3964 is not set
 # CONFIG_RAW_DRIVER is not set
@@ -298,6 +299,13 @@ CONFIG_UNIX98_PTYS=y
 # CONFIG_W1 is not set
 # CONFIG_POWER_SUPPLY is not set
 # CONFIG_HWMON is not set
+# CONFIG_WATCHDOG is not set
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
 
 #
 # Multifunction device drivers
@@ -313,12 +321,6 @@ CONFIG_DAB=y
 #
 # Graphics support
 #
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
-
-#
-# Display device support
-#
-# CONFIG_DISPLAY_SUPPORT is not set
 # CONFIG_VGASTATE is not set
 CONFIG_VIDEO_OUTPUT_CONTROL=y
 CONFIG_FB=y
@@ -327,6 +329,7 @@ CONFIG_FIRMWARE_EDID=y
 # CONFIG_FB_CFB_FILLRECT is not set
 # CONFIG_FB_CFB_COPYAREA is not set
 # CONFIG_FB_CFB_IMAGEBLIT is not set
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
 # CONFIG_FB_SYS_FILLRECT is not set
 # CONFIG_FB_SYS_COPYAREA is not set
 # CONFIG_FB_SYS_IMAGEBLIT is not set
@@ -343,6 +346,12 @@ CONFIG_FB_MODE_HELPERS=y
 #
 # CONFIG_FB_S1D13XXX is not set
 # CONFIG_FB_VIRTUAL is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
 
 #
 # Console display driver support
@@ -380,19 +389,6 @@ CONFIG_LOGO_SUPERH_CLUT224=y
 # CONFIG_NEW_LEDS is not set
 # CONFIG_RTC_CLASS is not set
 
-#
-# DMA Engine support
-#
-# CONFIG_DMA_ENGINE is not set
-
-#
-# DMA Clients
-#
-
-#
-# DMA Devices
-#
-
 #
 # Userspace I/O
 #
@@ -451,7 +447,6 @@ CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
 CONFIG_HUGETLBFS=y
 CONFIG_HUGETLB_PAGE=y
-CONFIG_RAMFS=y
 # CONFIG_CONFIGFS_FS is not set
 
 #
@@ -492,22 +487,17 @@ CONFIG_MSDOS_PARTITION=y
 # CONFIG_KARMA_PARTITION is not set
 # CONFIG_EFI_PARTITION is not set
 # CONFIG_SYSV68_PARTITION is not set
-
-#
-# Native Language Support
-#
 # CONFIG_NLS is not set
-
-#
-# Profiling support
-#
+CONFIG_INSTRUMENTATION=y
 CONFIG_PROFILING=y
 # CONFIG_OPROFILE is not set
+# CONFIG_MARKERS is not set
 
 #
 # Kernel hacking
 #
 # CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
 CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_UNUSED_SYMBOLS is not set
@@ -531,16 +521,17 @@ CONFIG_DEBUG_BUGVERBOSE=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_DEBUG_VM is not set
 # CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
 CONFIG_FRAME_POINTER=y
 CONFIG_FORCED_INLINING=y
+# CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_FAULT_INJECTION is not set
+# CONFIG_SAMPLES is not set
 # CONFIG_EARLY_PRINTK is not set
-# CONFIG_DEBUG_KERNEL_WITH_GDB_STUB is not set
 CONFIG_SH64_PROC_TLB=y
 CONFIG_SH64_PROC_ASIDS=y
 CONFIG_SH64_SR_WATCH=y
 # CONFIG_POOR_MANS_STRACE is not set
-# CONFIG_SH_ALPHANUMERIC is not set
 CONFIG_SH_NO_BSS_INIT=y
 
 #
@@ -548,6 +539,7 @@ CONFIG_SH_NO_BSS_INIT=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
 # CONFIG_CRYPTO is not set
 
 #
index ceb9458abda4bdec2415eda4925dcd618a33c32b..0761af4d2a424a77a7409e90800bd98560bcde52 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/reboot.h>
 #include <linux/init.h>
 #include <linux/module.h>
+#include <linux/proc_fs.h>
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 
@@ -656,9 +657,6 @@ unsigned long get_wchan(struct task_struct *p)
    */
 
 #if defined(CONFIG_SH64_PROC_ASIDS)
-#include <linux/init.h>
-#include <linux/proc_fs.h>
-
 static int
 asids_proc_info(char *buf, char **start, off_t fpos, int length, int *eof, void *data)
 {
@@ -686,10 +684,8 @@ asids_proc_info(char *buf, char **start, off_t fpos, int length, int *eof, void
 
 static int __init register_proc_asids(void)
 {
-  create_proc_read_entry("asids", 0, NULL, asids_proc_info, NULL);
-  return 0;
+       create_proc_read_entry("asids", 0, NULL, asids_proc_info, NULL);
+       return 0;
 }
-
 __initcall(register_proc_asids);
 #endif
-
index c03101fab467443a8b6d33e9cf0111d4d48972cb..f32df3831f45168f3c3c542d044dab1e659543bc 100644 (file)
@@ -30,7 +30,6 @@
 #include <linux/interrupt.h>
 #include <linux/sysctl.h>
 #include <linux/module.h>
-
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
@@ -242,9 +241,6 @@ DO_ERROR(12, SIGILL,  "reserved instruction", reserved_inst, current)
 
 #endif /* CONFIG_SH64_ID2815_WORKAROUND */
 
-
-#include <asm/system.h>
-
 /* Called with interrupts disabled */
 asmlinkage void do_exception_error(unsigned long ex, struct pt_regs *regs)
 {
@@ -984,4 +980,3 @@ asmlinkage void do_debug_interrupt(unsigned long code, struct pt_regs *regs)
        /* Clear all DEBUGINT causes */
        poke_real_address_q(DM_EXP_CAUSE_PHY, 0x0);
 }
-
index e1e24f31aa5463c7a55e2d30ac77a3e1900d12a5..01a6756ba3718182bdd93753ad8db4c5f1f5d0e9 100644 (file)
@@ -18,7 +18,6 @@
 #include <linux/linkage.h>
 #include <linux/kernel_stat.h>
 #include <linux/signal.h>
-#include <linux/sched.h>
 #include <linux/interrupt.h>
 #include <linux/slab.h>
 #include <linux/random.h>
index bd59ab0760b3fe5c75ea7ade8ffe1f1af1d6155b..10b212a1f9f5aa046dbe1e2b5702dbcba9a3b7c0 100644 (file)
@@ -408,7 +408,7 @@ config SUNOS_EMUL
 
 config SOLARIS_EMUL
        tristate "Solaris binary emulation (EXPERIMENTAL)"
-       depends on SPARC32_COMPAT && EXPERIMENTAL
+       depends on SPARC32_COMPAT && NET && EXPERIMENTAL
        help
          This is experimental code which will enable you to run (many)
          Solaris binaries on your SPARC Linux machine.
index e023d4b2fef4c11fa49476c7f07f6d18e49c627d..22734ac08c8a678a8ffa3f28553c8c6c40c21fdd 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.23
-# Sun Oct 21 19:57:44 2007
+# Linux kernel version: 2.6.24-rc1
+# Wed Oct 31 15:36:47 2007
 #
 CONFIG_SPARC=y
 CONFIG_SPARC64=y
@@ -19,6 +19,7 @@ CONFIG_ARCH_MAY_HAVE_PC_FDC=y
 CONFIG_AUDIT_ARCH=y
 CONFIG_ARCH_NO_VIRT_TO_BUS=y
 CONFIG_OF=y
+CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
 CONFIG_SPARC64_PAGE_SIZE_8KB=y
 # CONFIG_SPARC64_PAGE_SIZE_64KB is not set
 # CONFIG_SPARC64_PAGE_SIZE_512KB is not set
@@ -55,7 +56,8 @@ CONFIG_FAIR_USER_SCHED=y
 # CONFIG_FAIR_CGROUP_SCHED is not set
 CONFIG_SYSFS_DEPRECATED=y
 CONFIG_RELAY=y
-# CONFIG_BLK_DEV_INITRD is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
 # CONFIG_EMBEDDED is not set
@@ -117,22 +119,7 @@ CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
 CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
 # CONFIG_SMP is not set
-CONFIG_CPU_FREQ=y
-CONFIG_CPU_FREQ_TABLE=m
-# CONFIG_CPU_FREQ_DEBUG is not set
-CONFIG_CPU_FREQ_STAT=m
-CONFIG_CPU_FREQ_STAT_DETAILS=y
-CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
-# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
-# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
-# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
-CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
-CONFIG_CPU_FREQ_GOV_POWERSAVE=m
-CONFIG_CPU_FREQ_GOV_USERSPACE=m
-CONFIG_CPU_FREQ_GOV_ONDEMAND=m
-CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
-CONFIG_US3_FREQ=m
-CONFIG_US2E_FREQ=m
+# CONFIG_CPU_FREQ is not set
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_GENERIC_HWEIGHT=y
@@ -161,7 +148,7 @@ CONFIG_SBUS=y
 CONFIG_SBUSCHAR=y
 CONFIG_SUN_AUXIO=y
 CONFIG_SUN_IO=y
-# CONFIG_SUN_LDOMS is not set
+CONFIG_SUN_LDOMS=y
 CONFIG_PCI=y
 CONFIG_PCI_DOMAINS=y
 CONFIG_PCI_SYSCALL=y
@@ -338,6 +325,7 @@ CONFIG_CDROM_PKTCDVD=m
 CONFIG_CDROM_PKTCDVD_BUFFERS=8
 CONFIG_CDROM_PKTCDVD_WCACHE=y
 CONFIG_ATA_OVER_ETH=m
+CONFIG_SUNVDC=m
 CONFIG_MISC_DEVICES=y
 # CONFIG_PHANTOM is not set
 # CONFIG_EEPROM_93CX6 is not set
@@ -440,12 +428,12 @@ CONFIG_SCSI_WAIT_SCAN=m
 #
 CONFIG_SCSI_SPI_ATTRS=y
 CONFIG_SCSI_FC_ATTRS=y
-CONFIG_SCSI_ISCSI_ATTRS=m
+# CONFIG_SCSI_ISCSI_ATTRS is not set
 # CONFIG_SCSI_SAS_ATTRS is not set
 # CONFIG_SCSI_SAS_LIBSAS is not set
 # CONFIG_SCSI_SRP_ATTRS is not set
 CONFIG_SCSI_LOWLEVEL=y
-CONFIG_ISCSI_TCP=m
+# CONFIG_ISCSI_TCP is not set
 # CONFIG_BLK_DEV_3W_XXXX_RAID is not set
 # CONFIG_SCSI_3W_9XXX is not set
 # CONFIG_SCSI_ACARD is not set
@@ -506,7 +494,7 @@ CONFIG_DM_ZERO=m
 # CONFIG_I2O is not set
 CONFIG_NETDEVICES=y
 # CONFIG_NETDEVICES_MULTIQUEUE is not set
-CONFIG_DUMMY=m
+# CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
 # CONFIG_MACVLAN is not set
 # CONFIG_EQUALIZER is not set
@@ -523,6 +511,7 @@ CONFIG_MII=m
 # CONFIG_SUNQE is not set
 # CONFIG_SUNGEM is not set
 CONFIG_CASSINI=m
+CONFIG_SUNVNET=m
 # CONFIG_NET_VENDOR_3COM is not set
 # CONFIG_NET_TULIP is not set
 # CONFIG_HP100 is not set
@@ -577,7 +566,7 @@ CONFIG_NETDEV_10000=y
 # CONFIG_S2IO is not set
 # CONFIG_MYRI10GE is not set
 # CONFIG_NETXEN_NIC is not set
-# CONFIG_NIU is not set
+CONFIG_NIU=m
 # CONFIG_MLX4_CORE is not set
 # CONFIG_TEHUTI is not set
 # CONFIG_TR is not set
@@ -702,7 +691,8 @@ CONFIG_SERIAL_SUNCORE=y
 # CONFIG_SERIAL_SUNZILOG is not set
 CONFIG_SERIAL_SUNSU=y
 CONFIG_SERIAL_SUNSU_CONSOLE=y
-CONFIG_SERIAL_SUNSAB=m
+CONFIG_SERIAL_SUNSAB=y
+CONFIG_SERIAL_SUNSAB_CONSOLE=y
 CONFIG_SERIAL_SUNHV=y
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
@@ -880,9 +870,17 @@ CONFIG_FB_TILEBLITTING=y
 # CONFIG_FB_ASILIANT is not set
 # CONFIG_FB_IMSTT is not set
 # CONFIG_FB_UVESA is not set
-# CONFIG_FB_SBUS is not set
-# CONFIG_FB_XVR500 is not set
-# CONFIG_FB_XVR2500 is not set
+CONFIG_FB_SBUS=y
+# CONFIG_FB_BW2 is not set
+# CONFIG_FB_CG3 is not set
+CONFIG_FB_CG6=y
+CONFIG_FB_FFB=y
+# CONFIG_FB_TCX is not set
+# CONFIG_FB_CG14 is not set
+# CONFIG_FB_P9100 is not set
+# CONFIG_FB_LEO is not set
+CONFIG_FB_XVR500=y
+CONFIG_FB_XVR2500=y
 # CONFIG_FB_S1D13XXX is not set
 # CONFIG_FB_NVIDIA is not set
 # CONFIG_FB_RIVA is not set
@@ -892,7 +890,11 @@ CONFIG_FB_RADEON_I2C=y
 # CONFIG_FB_RADEON_BACKLIGHT is not set
 # CONFIG_FB_RADEON_DEBUG is not set
 # CONFIG_FB_ATY128 is not set
-# CONFIG_FB_ATY is not set
+CONFIG_FB_ATY=y
+CONFIG_FB_ATY_CT=y
+# CONFIG_FB_ATY_GENERIC_LCD is not set
+CONFIG_FB_ATY_GX=y
+# CONFIG_FB_ATY_BACKLIGHT is not set
 # CONFIG_FB_S3 is not set
 # CONFIG_FB_SAVAGE is not set
 # CONFIG_FB_SIS is not set
@@ -1191,18 +1193,13 @@ CONFIG_USB_STORAGE=m
 #
 # Misc Linux/SPARC drivers
 #
-CONFIG_SUN_OPENPROMIO=m
+CONFIG_SUN_OPENPROMIO=y
 # CONFIG_OBP_FLASH is not set
 # CONFIG_SUN_BPP is not set
 # CONFIG_BBC_I2C is not set
 # CONFIG_ENVCTRL is not set
 # CONFIG_DISPLAY7SEG is not set
 
-#
-# Fibre Channel support
-#
-# CONFIG_FC4 is not set
-
 #
 # File systems
 #
@@ -1345,6 +1342,7 @@ CONFIG_KPROBES=y
 #
 CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 CONFIG_PRINTK_TIME=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
 CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_UNUSED_SYMBOLS is not set
@@ -1371,6 +1369,7 @@ CONFIG_DEBUG_BUGVERBOSE=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_DEBUG_VM is not set
 # CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
 CONFIG_FORCED_INLINING=y
 # CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_RCU_TORTURE_TEST is not set
index 9f472a79d37e04236add3ad9138bc0de33695bd9..eeb5a2fc788d2615e47660ae7c6962ca1777126a 100644 (file)
@@ -6,7 +6,6 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/types.h>
-#include <linux/module.h>
 #include <linux/string.h>
 #include <linux/slab.h>
 #include <linux/sched.h>
index 579871527699ed616a7a5c838be648a88884ca1a..158484bf59993dd915b6190d0ac31eeac7938404 100644 (file)
@@ -11,7 +11,6 @@
 #include <linux/fs.h>
 #include <linux/string.h>
 #include <linux/slab.h>
-#include <linux/vmalloc.h>
 #include <linux/mm.h>
 
 #include <asm/processor.h>
index 23fad7ebdd0dc7c1a79d60b7f55d993c866bf581..60765e314bd8624dfb1dd94329fd2fb0f59ad7f9 100644 (file)
@@ -221,7 +221,7 @@ EXPORT_SYMBOL(pci_dma_supported);
 /* I/O device mmaping on Sparc64. */
 EXPORT_SYMBOL(io_remap_pfn_range);
 
-#ifdef CONFIG_COMPAT
+#if defined(CONFIG_COMPAT) && defined(CONFIG_NET)
 /* Solaris/SunOS binary compatibility */
 EXPORT_SYMBOL(verify_compat_iovec);
 #endif
index 78caff926737b532fc3216a8b5312d2be97375df..98c468803ce35d345e72439280485fe546906ad2 100644 (file)
@@ -51,7 +51,6 @@
 #include <linux/vfs.h>
 #include <linux/netfilter_ipv4/ip_tables.h>
 #include <linux/ptrace.h>
-#include <linux/highuid.h>
 
 #include <asm/types.h>
 #include <asm/uaccess.h>
index 170d6ca8de6f0e4d36b26c81ffdd0592059acfe2..cfc22d3fe54c1cdd631ff3ffe1160d73e78aec18 100644 (file)
@@ -57,7 +57,6 @@
 #include <linux/personality.h>
 
 /* For SOCKET_I */
-#include <linux/socket.h>
 #include <net/sock.h>
 #include <net/compat.h>
 
index cd8c740cba1da72fccf69c78736b662383e8539b..4352ee4d8dac32863bd588f47ce91ad5f2d8859c 100644 (file)
@@ -28,7 +28,6 @@
 #include <linux/jiffies.h>
 #include <linux/cpufreq.h>
 #include <linux/percpu.h>
-#include <linux/profile.h>
 #include <linux/miscdevice.h>
 #include <linux/rtc.h>
 #include <linux/kernel_stat.h>
@@ -47,7 +46,6 @@
 #include <asm/sections.h>
 #include <asm/cpudata.h>
 #include <asm/uaccess.h>
-#include <asm/prom.h>
 #include <asm/irq_regs.h>
 
 DEFINE_SPINLOCK(mostek_lock);
@@ -1070,7 +1068,7 @@ static int set_rtc_mmss(unsigned long nowtime)
         * Not having a register set can lead to trouble.
         * Also starfire doesn't have a tod clock.
         */
-       if (!mregs && !dregs & !bregs)
+       if (!mregs && !dregs && !bregs)
                return -1;
 
        if (mregs) {
index 7ff0a02f58132e524a092f50b164605554e725ce..a3e6e4b635b3cc174aa91a33cb0a352b5261578a 100644 (file)
@@ -182,7 +182,9 @@ static void setup_tsb_params(struct mm_struct *mm, unsigned long tsb_idx, unsign
                break;
 
        default:
-               BUG();
+               printk(KERN_ERR "TSB[%s:%d]: Impossible TSB size %lu, killing process.\n",
+                      current->comm, current->pid, tsb_bytes);
+               do_exit(SIGSEGV);
        };
        tte |= pte_sz_bits(page_sz);
 
index 737c26923c0963470a6059f3ed80056b9ac04367..2865c105b6a43927d84e00080ca61e8f571f1c3e 100644 (file)
@@ -120,13 +120,6 @@ __spitfire_flush_tlb_mm_slow:
 /*
  * The following code flushes one page_size worth.
  */
-#if (PAGE_SHIFT == 13)
-#define ITAG_MASK 0xfe
-#elif (PAGE_SHIFT == 16)
-#define ITAG_MASK 0x7fe
-#else
-#error unsupported PAGE_SIZE
-#endif
        .section .kprobes.text, "ax"
        .align          32
        .globl          __flush_icache_page
index 9876d80d85ddccdba00e5e89cd1e54db6ab8612b..e0ac74e5d4c4d7c754d37bfafd44be0788e9c3dc 100644 (file)
@@ -1,6 +1,6 @@
 menu "Host processor type and features"
 
-source "arch/i386/Kconfig.cpu"
+source "arch/x86/Kconfig.cpu"
 
 endmenu
 
index 82c2ac48040da2cddf7c645fca724796a16668ad..31999bc1c8a475eec23f88f9ceeb9b63ed8da146 100644 (file)
@@ -70,9 +70,12 @@ include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS)
 # in KBUILD_CFLAGS.  Otherwise, it would cause ld to complain about the two different
 # errnos.
 # These apply to kernelspace only.
+#
+# strip leading and trailing whitespace to make the USER_CFLAGS removal of these
+# defines more robust
 
-KERNEL_DEFINES = -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask \
-       -Dmktime=kernel_mktime $(ARCH_KERNEL_DEFINES)
+KERNEL_DEFINES = $(strip -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask \
+                        -Dmktime=kernel_mktime $(ARCH_KERNEL_DEFINES))
 KBUILD_CFLAGS += $(KERNEL_DEFINES)
 KBUILD_CFLAGS += $(call cc-option,-fno-unit-at-a-time,)
 
@@ -165,7 +168,7 @@ ifneq ($(KBUILD_SRC),)
        $(Q)mkdir -p $(objtree)/include/asm-um
        $(Q)ln -fsn $(srctree)/include/asm-$(HEADER_ARCH) include/asm-um/arch
 else
-       $(Q)cd $(TOPDIR)/include/asm-um && ln -sf ../asm-$(HEADER_ARCH) arch
+       $(Q)cd $(TOPDIR)/include/asm-um && ln -fsn ../asm-$(SUBARCH) arch
 endif
 
 $(objtree)/$(ARCH_DIR)/include:
@@ -177,7 +180,7 @@ $(ARCH_DIR)/include/sysdep: $(objtree)/$(ARCH_DIR)/include
 ifneq ($(KBUILD_SRC),)
        $(Q)ln -fsn $(srctree)/$(ARCH_DIR)/include/sysdep-$(SUBARCH) $(ARCH_DIR)/include/sysdep
 else
-       $(Q)cd $(ARCH_DIR)/include && ln -sf sysdep-$(SUBARCH) sysdep
+       $(Q)cd $(ARCH_DIR)/include && ln -fsn sysdep-$(SUBARCH) sysdep
 endif
 
 $(ARCH_DIR)/os:
@@ -185,7 +188,7 @@ $(ARCH_DIR)/os:
 ifneq ($(KBUILD_SRC),)
        $(Q)ln -fsn $(srctree)/$(ARCH_DIR)/os-$(OS) $(ARCH_DIR)/os
 else
-       $(Q)cd $(ARCH_DIR) && ln -sf os-$(OS) os
+       $(Q)cd $(ARCH_DIR) && ln -fsn os-$(OS) os
 endif
 
 # Generated files
index 0178df306939b856aef436456e7ffe194ed3b5a5..67290117d90924ff0dc712af68725562b574c450 100644 (file)
@@ -9,6 +9,7 @@ ELF_ARCH                := $(SUBARCH)
 ELF_FORMAT             := elf32-$(SUBARCH)
 OBJCOPYFLAGS           := -O binary -R .note -R .comment -S
 HEADER_ARCH            := x86
+CHECKFLAGS     += -D__i386__
 
 ifeq ("$(origin SUBARCH)", "command line")
 ifneq ("$(shell uname -m | sed -e s/i.86/i386/)", "$(SUBARCH)")
@@ -21,15 +22,13 @@ export LDFLAGS HOSTCFLAGS HOSTLDFLAGS UML_OBJCOPYFLAGS
 endif
 endif
 
-CFLAGS                 += -DCONFIG_X86_32
-AFLAGS                 += -DCONFIG_X86_32
+KBUILD_CFLAGS          += -DCONFIG_X86_32
+KBUILD_AFLAGS          += -DCONFIG_X86_32
 CONFIG_X86_32          := y
 export CONFIG_X86_32
 
-ARCH_KERNEL_DEFINES += -U__$(SUBARCH)__ -U$(SUBARCH)
-
 # First of all, tune CFLAGS for the specific CPU. This actually sets cflags-y.
-include $(srctree)/arch/i386/Makefile.cpu
+include $(srctree)/arch/x86/Makefile_32.cpu
 
 # prevent gcc from keeping the stack 16 byte aligned. Taken from i386.
 cflags-y += $(call cc-option,-mpreferred-stack-boundary=2)
index fe5316f0c6a55778fbda6bf7fb679c2f9a75a493..8ed362f93582e9723aaacde7325553f9de435383 100644 (file)
@@ -6,12 +6,9 @@ START := 0x60000000
 
 _extra_flags_ = -fno-builtin -m64
 
-#We #undef __x86_64__ for kernelspace, not for userspace where
-#it's needed for headers to work!
-ARCH_KERNEL_DEFINES = -U__$(SUBARCH)__
 KBUILD_CFLAGS += $(_extra_flags_)
 
-CHECKFLAGS  += -m64
+CHECKFLAGS  += -m64 -D__x86_64__
 KBUILD_AFLAGS += -m64
 LDFLAGS += -m elf_x86_64
 KBUILD_CPPFLAGS += -m64
index 8c01fa81a1aec094ce6f30a10ffe5f2c8eaec954..73681f14f9fc17daaf3261fcf1562e33fb71fbfb 100644 (file)
@@ -753,6 +753,7 @@ static struct mc_device net_mc = {
        .remove         = net_remove,
 };
 
+#ifdef CONFIG_INET
 static int uml_inetaddr_event(struct notifier_block *this, unsigned long event,
                              void *ptr)
 {
@@ -789,14 +790,13 @@ struct notifier_block uml_inetaddr_notifier = {
        .notifier_call          = uml_inetaddr_event,
 };
 
-static int uml_net_init(void)
+static void inet_register(void)
 {
        struct list_head *ele;
        struct uml_net_private *lp;
        struct in_device *ip;
        struct in_ifaddr *in;
 
-       mconsole_register_dev(&net_mc);
        register_inetaddr_notifier(&uml_inetaddr_notifier);
 
        /* Devices may have been opened already, so the uml_inetaddr_notifier
@@ -816,7 +816,17 @@ static int uml_net_init(void)
                }
        }
        spin_unlock(&opened_lock);
+}
+#else
+static inline void inet_register(void)
+{
+}
+#endif
 
+static int uml_net_init(void)
+{
+       mconsole_register_dev(&net_mc);
+       inet_register();
        return 0;
 }
 
index e184b44b1011e45bce17a0cb61460f2747bbdc8f..7e6cdde62ead261e6140c30cc51d8517e0b65aac 100644 (file)
@@ -705,7 +705,7 @@ static int ubd_add(int n, char **error_out)
        ubd_dev->size = ROUND_BLOCK(ubd_dev->size);
 
        INIT_LIST_HEAD(&ubd_dev->restart);
-       sg_init_table(&ubd_dev->sg, MAX_SG);
+       sg_init_table(ubd_dev->sg, MAX_SG);
 
        err = -ENOMEM;
        ubd_dev->queue = blk_init_queue(do_ubd_request, &ubd_dev->lock);
index 99033ff28a78872996f64cc5e3a732ef6022d664..1723fac6f40d1eb45329133e4d9146666769076a 100644 (file)
@@ -1,11 +1,13 @@
 /* 
- * Copyright (C) 2000 Jeff Dike (jdike@karaya.com)
+ * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
  * Licensed under the GPL
  */
 
 #ifndef __USER_H__
 #define __USER_H__
 
+#include "uml-config.h"
+
 /*
  * The usual definition - copied here because the kernel provides its own,
  * fancier, type-safe, definition.  Using that one would require
 
 extern void panic(const char *fmt, ...)
        __attribute__ ((format (printf, 1, 2)));
+
+#ifdef UML_CONFIG_PRINTK
 extern int printk(const char *fmt, ...)
        __attribute__ ((format (printf, 1, 2)));
+#else
+static inline int printk(const char *fmt, ...)
+{
+       return 0;
+}
+#endif
+
 extern void schedule(void);
 extern int in_aton(char *str);
 extern int open_gdb_chan(void);
index 70c2d625b0702a284c5b72c65fa3eb4c907e4428..ba11ccd6a8a3f72e4ab641a5f79f21a740a1ad0a 100644 (file)
@@ -347,14 +347,15 @@ int um_request_irq(unsigned int irq, int fd, int type,
 {
        int err;
 
-       err = request_irq(irq, handler, irqflags, devname, dev_id);
-       if (err)
-               return err;
-
-       if (fd != -1)
+       if (fd != -1) {
                err = activate_fd(irq, fd, type, dev_id);
-       return err;
+               if (err)
+                       return err;
+       }
+
+       return request_irq(irq, handler, irqflags, devname, dev_id);
 }
+
 EXPORT_SYMBOL(um_request_irq);
 EXPORT_SYMBOL(reactivate_fd);
 
index 8456397f5f4d614e3df04dc728c2ae79f08f6675..59822dee438adfe53f373569f9b74d675726b56d 100644 (file)
@@ -165,7 +165,7 @@ static void __init kmap_init(void)
        kmap_prot = PAGE_KERNEL;
 }
 
-static void init_highmem(void)
+static void __init init_highmem(void)
 {
        pgd_t *pgd;
        pud_t *pud;
index d119f4f7d8971ee7576e6c7db57c59bd3d4704a5..8d07a7acb909c707bd5ec4d0bcf3ce6d53045db1 100644 (file)
@@ -3,7 +3,6 @@
 #include <sys/mman.h>
 #include <sys/time.h>
 #include <asm/unistd.h>
-#include <asm/page.h>
 #include "as-layout.h"
 #include "ptrace_user.h"
 #include "skas.h"
index b542a3a021bf8cee34276bd5fa4e73f599cee759..f834627586272b80c4702b499553ac24c296c9dd 100644 (file)
@@ -496,8 +496,7 @@ int os_rcv_fd(int fd, int *helper_pid_out)
        n = recvmsg(fd, &msg, 0);
        if(n < 0)
                return -errno;
-
-       else if(n != sizeof(iov.iov_len))
+       else if(n != iov.iov_len)
                *helper_pid_out = -1;
 
        cmsg = CMSG_FIRSTHDR(&msg);
index 9657c89fdf31cd5d9024b8786053def3814315ce..bd3da8a61f645810bc7af9ec42a6db240379b778 100644 (file)
@@ -155,7 +155,7 @@ int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
        if (err)
                return err;
 
-       n = copy_to_user((void *) buf, fpregs, sizeof(fpregs));
+       n = copy_to_user(buf, fpregs, sizeof(fpregs));
        if(n > 0)
                return -EFAULT;
 
@@ -168,7 +168,7 @@ int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
        long fpregs[HOST_FP_SIZE];
 
        BUG_ON(sizeof(*buf) != sizeof(fpregs));
-       n = copy_from_user(fpregs, (void *) buf, sizeof(fpregs));
+       n = copy_from_user(fpregs, buf, sizeof(fpregs));
        if (n > 0)
                return -EFAULT;
 
@@ -185,7 +185,7 @@ int get_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child)
        if (err)
                return err;
 
-       n = copy_to_user((void *) buf, fpregs, sizeof(fpregs));
+       n = copy_to_user(buf, fpregs, sizeof(fpregs));
        if(n > 0)
                return -EFAULT;
 
@@ -198,7 +198,7 @@ int set_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child)
        long fpregs[HOST_XFP_SIZE];
 
        BUG_ON(sizeof(*buf) != sizeof(fpregs));
-       n = copy_from_user(fpregs, (void *) buf, sizeof(fpregs));
+       n = copy_from_user(fpregs, buf, sizeof(fpregs));
        if (n > 0)
                return -EFAULT;
 
index a3cfeed17af42138e475b112208e72a462be9c98..b7631b0e9ddc212a12966652925646e996768188 100644 (file)
@@ -154,7 +154,7 @@ int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
        if (err)
                return err;
 
-       n = copy_to_user((void *) buf, fpregs, sizeof(fpregs));
+       n = copy_to_user(buf, fpregs, sizeof(fpregs));
        if(n > 0)
                return -EFAULT;
 
@@ -167,7 +167,7 @@ int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
        long fpregs[HOST_FP_SIZE];
 
        BUG_ON(sizeof(*buf) != sizeof(fpregs));
-       n = copy_from_user(fpregs, (void *) buf, sizeof(fpregs));
+       n = copy_from_user(fpregs, buf, sizeof(fpregs));
        if (n > 0)
                return -EFAULT;
 
similarity index 74%
rename from arch/x86/Kconfig.i386
rename to arch/x86/Kconfig
index 7331efe891a7cb5d5e0b9d4f3cafa8339b1cab00..368864dfe6eb635ef210f046ec351f04e96f42ef 100644 (file)
@@ -1,18 +1,24 @@
-#
-# For a description of the syntax of this configuration file,
-# see Documentation/kbuild/kconfig-language.txt.
-#
+# x86 configuration
+mainmenu "Linux Kernel Configuration for x86"
 
-mainmenu "Linux Kernel Configuration"
+# Select 32 or 64 bit
+config 64BIT
+       bool "64-bit kernel" if ARCH = "x86"
+       default ARCH = "x86_64"
+       help
+         Say yes to build a 64-bit kernel - formerly known as x86_64
+         Say no to build a 32-bit kernel - formerly known as i386
 
 config X86_32
+       def_bool !64BIT
+
+config X86_64
+       def_bool 64BIT
+
+### Arch settings
+config X86
        bool
        default y
-       help
-         This is Linux's home port.  Linux was originally native to the Intel
-         386, and runs on all the later x86 processors including the Intel
-         486, 586, Pentiums, and various instruction-set-compatible chips by
-         AMD, Cyrix, and others.
 
 config GENERIC_TIME
        bool
@@ -33,7 +39,7 @@ config GENERIC_CLOCKEVENTS
 config GENERIC_CLOCKEVENTS_BROADCAST
        bool
        default y
-       depends on X86_LOCAL_APIC
+       depends on X86_64 || (X86_32 && X86_LOCAL_APIC)
 
 config LOCKDEP_SUPPORT
        bool
@@ -47,10 +53,6 @@ config SEMAPHORE_SLEEPERS
        bool
        default y
 
-config X86
-       bool
-       default y
-
 config MMU
        bool
        default y
@@ -61,7 +63,7 @@ config ZONE_DMA
 
 config QUICKLIST
        bool
-       default y
+       default X86_32
 
 config SBUS
        bool
@@ -91,6 +93,76 @@ config DMI
        bool
        default y
 
+config RWSEM_GENERIC_SPINLOCK
+       def_bool !X86_XADD
+
+config RWSEM_XCHGADD_ALGORITHM
+       def_bool X86_XADD
+
+config ARCH_HAS_ILOG2_U32
+       def_bool n
+
+config ARCH_HAS_ILOG2_U64
+       def_bool n
+
+config GENERIC_CALIBRATE_DELAY
+       def_bool y
+
+config GENERIC_TIME_VSYSCALL
+       bool
+       default X86_64
+
+
+
+
+
+config ZONE_DMA32
+       bool
+       default X86_64
+
+config ARCH_POPULATES_NODE_MAP
+       def_bool y
+
+config AUDIT_ARCH
+       bool
+       default X86_64
+
+# Use the generic interrupt handling code in kernel/irq/:
+config GENERIC_HARDIRQS
+       bool
+       default y
+
+config GENERIC_IRQ_PROBE
+       bool
+       default y
+
+config GENERIC_PENDING_IRQ
+       bool
+       depends on GENERIC_HARDIRQS && SMP
+       default y
+
+config X86_SMP
+       bool
+       depends on X86_32 && SMP && !X86_VOYAGER
+       default y
+
+config X86_HT
+       bool
+       depends on SMP && !(X86_VISWS || X86_VOYAGER || MK8)
+       default y
+
+config X86_BIOS_REBOOT
+       bool
+       depends on X86_32 && !(X86_VISWS || X86_VOYAGER)
+       default y
+
+config X86_TRAMPOLINE
+       bool
+       depends on X86_SMP || (X86_VOYAGER && SMP)
+       default y
+
+config KTIME_SCALAR
+       def_bool X86_32
 source "init/Kconfig"
 
 menu "Processor type and features"
@@ -137,6 +209,7 @@ config X86_PC
 
 config X86_ELAN
        bool "AMD Elan"
+       depends on X86_32
        help
          Select this for an AMD Elan processor.
 
@@ -146,6 +219,7 @@ config X86_ELAN
 
 config X86_VOYAGER
        bool "Voyager (NCR)"
+       depends on X86_32
        select SMP if !BROKEN
        help
          Voyager is an MCA-based 32-way capable SMP architecture proprietary
@@ -160,6 +234,7 @@ config X86_NUMAQ
        bool "NUMAQ (IBM/Sequent)"
        select SMP
        select NUMA
+       depends on X86_32
        help
          This option is used for getting Linux to run on a (IBM/Sequent) NUMA
          multiquad box. This changes the way that processors are bootstrapped,
@@ -169,7 +244,7 @@ config X86_NUMAQ
 
 config X86_SUMMIT
        bool "Summit/EXA (IBM x440)"
-       depends on SMP
+       depends on X86_32 && SMP
        help
          This option is needed for IBM systems that use the Summit/EXA chipset.
          In particular, it is needed for the x440.
@@ -179,7 +254,7 @@ config X86_SUMMIT
 
 config X86_BIGSMP
        bool "Support for other sub-arch SMP systems with more than 8 CPUs"
-       depends on SMP
+       depends on X86_32 && SMP
        help
          This option is needed for the systems that have more than 8 CPUs
          and if the system is not of any sub-arch type above.
@@ -188,6 +263,7 @@ config X86_BIGSMP
 
 config X86_VISWS
        bool "SGI 320/540 (Visual Workstation)"
+       depends on X86_32
        help
          The SGI Visual Workstation series is an IA32-based workstation
          based on SGI systems chips with some legacy PC hardware attached.
@@ -199,6 +275,7 @@ config X86_VISWS
 
 config X86_GENERICARCH
        bool "Generic architecture (Summit, bigsmp, ES7000, default)"
+       depends on X86_32
        help
           This option compiles in the Summit, bigsmp, ES7000, default subarchitectures.
          It is intended for a generic binary kernel.
@@ -206,18 +283,27 @@ config X86_GENERICARCH
 
 config X86_ES7000
        bool "Support for Unisys ES7000 IA32 series"
-       depends on SMP
+       depends on X86_32 && SMP
        help
          Support for Unisys ES7000 systems.  Say 'Y' here if this kernel is
          supposed to run on an IA32-based Unisys ES7000 system.
          Only choose this option if you have such a system, otherwise you
          should say N here.
 
+config X86_VSMP
+       bool "Support for ScaleMP vSMP"
+       depends on X86_64 && PCI
+        help
+         Support for ScaleMP vSMP systems.  Say 'Y' here if this kernel is
+         supposed to run on these EM64T-based machines.  Only choose this option
+         if you have one of these machines.
+
 endchoice
 
 config SCHED_NO_NO_OMIT_FRAME_POINTER
        bool "Single-depth WCHAN output"
        default y
+       depends on X86_32
        help
          Calculate simpler /proc/<PID>/wchan values. If this option
          is disabled then wchan values will recurse back to the
@@ -228,7 +314,7 @@ config SCHED_NO_NO_OMIT_FRAME_POINTER
 
 config PARAVIRT
        bool
-       depends on !(X86_VISWS || X86_VOYAGER)
+       depends on X86_32 && !(X86_VISWS || X86_VOYAGER)
        help
          This changes the kernel so it can modify itself when it is run
          under a hypervisor, potentially improving performance significantly
@@ -237,6 +323,7 @@ config PARAVIRT
 
 menuconfig PARAVIRT_GUEST
        bool "Paravirtualized guest support"
+       depends on X86_32
        help
          Say Y here to get to see options related to running Linux under
          various hypervisors.  This option alone does not add any kernel code.
@@ -264,7 +351,7 @@ endif
 config ACPI_SRAT
        bool
        default y
-       depends on ACPI && NUMA && (X86_SUMMIT || X86_GENERICARCH)
+       depends on X86_32 && ACPI && NUMA && (X86_SUMMIT || X86_GENERICARCH)
        select ACPI_NUMA
 
 config HAVE_ARCH_PARSE_SRAT
@@ -275,12 +362,12 @@ config HAVE_ARCH_PARSE_SRAT
 config X86_SUMMIT_NUMA
        bool
        default y
-       depends on NUMA && (X86_SUMMIT || X86_GENERICARCH)
+       depends on X86_32 && NUMA && (X86_SUMMIT || X86_GENERICARCH)
 
 config X86_CYCLONE_TIMER
        bool
        default y
-       depends on X86_SUMMIT || X86_GENERICARCH
+       depends on X86_32 && X86_SUMMIT || X86_GENERICARCH
 
 config ES7000_CLUSTERED_APIC
        bool
@@ -290,21 +377,89 @@ config ES7000_CLUSTERED_APIC
 source "arch/x86/Kconfig.cpu"
 
 config HPET_TIMER
-       bool "HPET Timer Support"
+       bool
+       prompt "HPET Timer Support" if X86_32
+       default X86_64
        help
-         This enables the use of the HPET for the kernel's internal timer.
-         HPET is the next generation timer replacing legacy 8254s.
-         You can safely choose Y here.  However, HPET will only be
-         activated if the platform and the BIOS support this feature.
-         Otherwise the 8254 will be used for timing services.
+         Use the IA-PC HPET (High Precision Event Timer) to manage
+         time in preference to the PIT and RTC, if a HPET is
+         present.
+         HPET is the next generation timer replacing legacy 8254s.
+         The HPET provides a stable time base on SMP
+         systems, unlike the TSC, but it is more expensive to access,
+         as it is off-chip.  You can find the HPET spec at
+         <http://www.intel.com/hardwaredesign/hpetspec.htm>.
+
+         You can safely choose Y here.  However, HPET will only be
+         activated if the platform and the BIOS support this feature.
+         Otherwise the 8254 will be used for timing services.
 
-         Choose N to continue using the legacy 8254 timer.
+         Choose N to continue using the legacy 8254 timer.
 
 config HPET_EMULATE_RTC
        bool
        depends on HPET_TIMER && RTC=y
        default y
 
+# Mark as embedded because too many people got it wrong.
+# The code disables itself when not needed.
+config GART_IOMMU
+       bool "GART IOMMU support" if EMBEDDED
+       default y
+       select SWIOTLB
+       select AGP
+       depends on X86_64 && PCI
+       help
+         Support for full DMA access of devices with 32bit memory access only
+         on systems with more than 3GB. This is usually needed for USB,
+         sound, many IDE/SATA chipsets and some other devices.
+         Provides a driver for the AMD Athlon64/Opteron/Turion/Sempron GART
+         based hardware IOMMU and a software bounce buffer based IOMMU used
+         on Intel systems and as fallback.
+         The code is only active when needed (enough memory and limited
+         device) unless CONFIG_IOMMU_DEBUG or iommu=force is specified
+         too.
+
+config CALGARY_IOMMU
+       bool "IBM Calgary IOMMU support"
+       select SWIOTLB
+       depends on X86_64 && PCI && EXPERIMENTAL
+       help
+         Support for hardware IOMMUs in IBM's xSeries x366 and x460
+         systems. Needed to run systems with more than 3GB of memory
+         properly with 32-bit PCI devices that do not support DAC
+         (Double Address Cycle). Calgary also supports bus level
+         isolation, where all DMAs pass through the IOMMU.  This
+         prevents them from going anywhere except their intended
+         destination. This catches hard-to-find kernel bugs and
+         mis-behaving drivers and devices that do not use the DMA-API
+         properly to set up their DMA buffers.  The IOMMU can be
+         turned off at boot time with the iommu=off parameter.
+         Normally the kernel will make the right choice by itself.
+         If unsure, say Y.
+
+config CALGARY_IOMMU_ENABLED_BY_DEFAULT
+       bool "Should Calgary be enabled by default?"
+       default y
+       depends on CALGARY_IOMMU
+       help
+         Should Calgary be enabled by default? if you choose 'y', Calgary
+         will be used (if it exists). If you choose 'n', Calgary will not be
+         used even if it exists. If you choose 'n' and would like to use
+         Calgary anyway, pass 'iommu=calgary' on the kernel command line.
+         If unsure, say Y.
+
+# need this always selected by IOMMU for the VIA workaround
+config SWIOTLB
+       bool
+       help
+         Support for software bounce buffers used on x86-64 systems
+         which don't have a hardware IOMMU (e.g. the current generation
+         of Intel's x86-64 CPUs). Using this PCI devices which can only
+         access 32-bits of memory can be used on systems with more than
+         3 GB of memory. If unsure, say Y.
+
+
 config NR_CPUS
        int "Maximum number of CPUs (2-255)"
        range 2 255
@@ -321,7 +476,7 @@ config NR_CPUS
 
 config SCHED_SMT
        bool "SMT (Hyperthreading) scheduler support"
-       depends on X86_HT
+       depends on (X86_64 && SMP) || (X86_32 && X86_HT)
        help
          SMT scheduler support improves the CPU scheduler's decision making
          when dealing with Intel Pentium 4 chips with HyperThreading at a
@@ -330,7 +485,7 @@ config SCHED_SMT
 
 config SCHED_MC
        bool "Multi-core scheduler support"
-       depends on X86_HT
+       depends on (X86_64 && SMP) || (X86_32 && X86_HT)
        default y
        help
          Multi-core scheduler support improves the CPU scheduler's decision
@@ -341,7 +496,7 @@ source "kernel/Kconfig.preempt"
 
 config X86_UP_APIC
        bool "Local APIC support on uniprocessors"
-       depends on !SMP && !(X86_VISWS || X86_VOYAGER || X86_GENERICARCH)
+       depends on X86_32 && !SMP && !(X86_VISWS || X86_VOYAGER || X86_GENERICARCH)
        help
          A local APIC (Advanced Programmable Interrupt Controller) is an
          integrated interrupt controller in the CPU. If you have a single-CPU
@@ -366,17 +521,17 @@ config X86_UP_IOAPIC
 
 config X86_LOCAL_APIC
        bool
-       depends on X86_UP_APIC || ((X86_VISWS || SMP) && !X86_VOYAGER) || X86_GENERICARCH
+       depends on X86_64 || (X86_32 && (X86_UP_APIC || ((X86_VISWS || SMP) && !X86_VOYAGER) || X86_GENERICARCH))
        default y
 
 config X86_IO_APIC
        bool
-       depends on X86_UP_IOAPIC || (SMP && !(X86_VISWS || X86_VOYAGER)) || X86_GENERICARCH
+       depends on X86_64 || (X86_32 && (X86_UP_IOAPIC || (SMP && !(X86_VISWS || X86_VOYAGER)) || X86_GENERICARCH))
        default y
 
 config X86_VISWS_APIC
        bool
-       depends on X86_VISWS
+       depends on X86_32 && X86_VISWS
        default y
 
 config X86_MCE
@@ -396,9 +551,25 @@ config X86_MCE
          to disable it.  MCE support simply ignores non-MCE processors like
          the 386 and 486, so nearly everyone can say Y here.
 
+config X86_MCE_INTEL
+       bool "Intel MCE features"
+       depends on X86_64 && X86_MCE && X86_LOCAL_APIC
+       default y
+       help
+          Additional support for intel specific MCE features such as
+          the thermal monitor.
+
+config X86_MCE_AMD
+       bool "AMD MCE features"
+       depends on X86_64 && X86_MCE && X86_LOCAL_APIC
+       default y
+       help
+          Additional support for AMD specific MCE features such as
+          the DRAM Error Threshold.
+
 config X86_MCE_NONFATAL
        tristate "Check for non-fatal errors on AMD Athlon/Duron / Intel Pentium 4"
-       depends on X86_MCE
+       depends on X86_32 && X86_MCE
        help
          Enabling this feature starts a timer that triggers every 5 seconds which
          will look at the machine check registers to see if anything happened.
@@ -411,14 +582,15 @@ config X86_MCE_NONFATAL
 
 config X86_MCE_P4THERMAL
        bool "check for P4 thermal throttling interrupt."
-       depends on X86_MCE && (X86_UP_APIC || SMP) && !X86_VISWS
+       depends on X86_32 && X86_MCE && (X86_UP_APIC || SMP) && !X86_VISWS
        help
          Enabling this feature will cause a message to be printed when the P4
          enters thermal throttling.
 
 config VM86
-       default y
        bool "Enable VM86 support" if EMBEDDED
+       default y
+       depends on X86_32
        help
           This option is required by programs like DOSEMU to run 16-bit legacy
          code on X86 processors. It also may be needed by software like
@@ -427,6 +599,7 @@ config VM86
 
 config TOSHIBA
        tristate "Toshiba Laptop support"
+       depends on X86_32
        ---help---
          This adds a driver to safely access the System Management Mode of
          the CPU on Toshiba portables with a genuine Toshiba BIOS. It does
@@ -442,6 +615,7 @@ config TOSHIBA
 
 config I8K
        tristate "Dell laptop support"
+       depends on X86_32
        ---help---
          This adds a driver to safely access the System Management Mode
          of the CPU on the Dell Inspiron 8000. The System Management Mode
@@ -462,7 +636,7 @@ config I8K
 
 config X86_REBOOTFIXUPS
        bool "Enable X86 board specific fixups for reboot"
-       depends on X86
+       depends on X86_32 && X86
        default n
        ---help---
          This enables chipset and/or board specific fixups to be done
@@ -517,12 +691,11 @@ config X86_CPUID
          with major 203 and minors 0 to 31 for /dev/cpu/0/cpuid to
          /dev/cpu/31/cpuid.
 
-source "drivers/firmware/Kconfig"
-
 choice
        prompt "High Memory Support"
        default HIGHMEM4G if !X86_NUMAQ
        default HIGHMEM64G if X86_NUMAQ
+       depends on X86_32
 
 config NOHIGHMEM
        bool "off"
@@ -582,6 +755,7 @@ choice
        depends on EXPERIMENTAL
        prompt "Memory split" if EMBEDDED
        default VMSPLIT_3G
+       depends on X86_32
        help
          Select the desired split between kernel and user memory.
 
@@ -619,16 +793,17 @@ config PAGE_OFFSET
        default 0x78000000 if VMSPLIT_2G_OPT
        default 0x40000000 if VMSPLIT_1G
        default 0xC0000000
+       depends on X86_32
 
 config HIGHMEM
        bool
-       depends on HIGHMEM64G || HIGHMEM4G
+       depends on X86_32 && (HIGHMEM64G || HIGHMEM4G)
        default y
 
 config X86_PAE
        bool "PAE (Physical Address Extension) Support"
        default n
-       depends on !HIGHMEM4G
+       depends on X86_32 && !HIGHMEM4G
        select RESOURCES_64BIT
        help
          PAE is required for NX support, and furthermore enables
@@ -639,46 +814,82 @@ config X86_PAE
 # Common NUMA Features
 config NUMA
        bool "Numa Memory Allocation and Scheduler Support (EXPERIMENTAL)"
-       depends on SMP && HIGHMEM64G && (X86_NUMAQ || (X86_SUMMIT || X86_GENERICARCH) && ACPI) && EXPERIMENTAL
+       depends on SMP
+       depends on X86_64 || (X86_32 && HIGHMEM64G && (X86_NUMAQ || (X86_SUMMIT || X86_GENERICARCH) && ACPI) && EXPERIMENTAL)
        default n if X86_PC
        default y if (X86_NUMAQ || X86_SUMMIT)
        help
-         NUMA support for i386. This is currently highly experimental
-         and should be only used for kernel development. It might also
-         cause boot failures.
+         Enable NUMA (Non Uniform Memory Access) support.
+         The kernel will try to allocate memory used by a CPU on the
+         local memory controller of the CPU and add some more
+         NUMA awareness to the kernel.
+
+         For i386 this is currently highly experimental and should be only
+         used for kernel development. It might also cause boot failures.
+         For x86_64 this is recommended on all multiprocessor Opteron systems.
+         If the system is EM64T, you should say N unless your system is
+         EM64T NUMA.
 
 comment "NUMA (Summit) requires SMP, 64GB highmem support, ACPI"
-       depends on X86_SUMMIT && (!HIGHMEM64G || !ACPI)
+       depends on X86_32 && X86_SUMMIT && (!HIGHMEM64G || !ACPI)
+
+config K8_NUMA
+       bool "Old style AMD Opteron NUMA detection"
+       depends on X86_64 && NUMA && PCI
+       default y
+       help
+        Enable K8 NUMA node topology detection.  You should say Y here if
+        you have a multi processor AMD K8 system. This uses an old
+        method to read the NUMA configuration directly from the builtin
+        Northbridge of Opteron. It is recommended to use X86_64_ACPI_NUMA
+        instead, which also takes priority if both are compiled in.
+
+config X86_64_ACPI_NUMA
+       bool "ACPI NUMA detection"
+       depends on X86_64 && NUMA && ACPI && PCI
+       select ACPI_NUMA
+       default y
+       help
+         Enable ACPI SRAT based node topology detection.
+
+config NUMA_EMU
+       bool "NUMA emulation"
+       depends on X86_64 && NUMA
+       help
+         Enable NUMA emulation. A flat machine will be split
+         into virtual nodes when booted with "numa=fake=N", where N is the
+         number of nodes. This is only useful for debugging.
 
 config NODES_SHIFT
        int
+       default "6" if X86_64
        default "4" if X86_NUMAQ
        default "3"
        depends on NEED_MULTIPLE_NODES
 
 config HAVE_ARCH_BOOTMEM_NODE
        bool
-       depends on NUMA
+       depends on X86_32 && NUMA
        default y
 
 config ARCH_HAVE_MEMORY_PRESENT
        bool
-       depends on DISCONTIGMEM
+       depends on X86_32 && DISCONTIGMEM
        default y
 
 config NEED_NODE_MEMMAP_SIZE
        bool
-       depends on DISCONTIGMEM || SPARSEMEM
+       depends on X86_32 && (DISCONTIGMEM || SPARSEMEM)
        default y
 
 config HAVE_ARCH_ALLOC_REMAP
        bool
-       depends on NUMA
+       depends on X86_32 && NUMA
        default y
 
 config ARCH_FLATMEM_ENABLE
        def_bool y
-       depends on (ARCH_SELECT_MEMORY_MODEL && X86_PC)
+       depends on (X86_32 && ARCH_SELECT_MEMORY_MODEL && X86_PC) || (X86_64 && !NUMA)
 
 config ARCH_DISCONTIGMEM_ENABLE
        def_bool y
@@ -690,21 +901,23 @@ config ARCH_DISCONTIGMEM_DEFAULT
 
 config ARCH_SPARSEMEM_ENABLE
        def_bool y
-       depends on (NUMA || (X86_PC && EXPERIMENTAL))
-       select SPARSEMEM_STATIC
+       depends on NUMA || (EXPERIMENTAL && (X86_PC || X86_64))
+       select SPARSEMEM_STATIC if X86_32
+       select SPARSEMEM_VMEMMAP_ENABLE if X86_64
 
 config ARCH_SELECT_MEMORY_MODEL
        def_bool y
-       depends on ARCH_SPARSEMEM_ENABLE
+       depends on X86_32 && ARCH_SPARSEMEM_ENABLE
 
-config ARCH_POPULATES_NODE_MAP
-       def_bool y
+config ARCH_MEMORY_PROBE
+       def_bool X86_64
+       depends on MEMORY_HOTPLUG
 
 source "mm/Kconfig"
 
 config HIGHPTE
        bool "Allocate 3rd-level pagetables from highmem"
-       depends on HIGHMEM4G || HIGHMEM64G
+       depends on X86_32 && (HIGHMEM4G || HIGHMEM64G)
        help
          The VM uses one page table entry for each page of physical memory.
          For systems with a lot of RAM, this can be wasteful of precious
@@ -712,7 +925,8 @@ config HIGHPTE
          entries in high memory.
 
 config MATH_EMULATION
-       bool "Math emulation"
+       bool
+       prompt "Math emulation" if X86_32
        ---help---
          Linux can emulate a math coprocessor (used for floating point
          operations) if you don't have one. 486DX and Pentium processors have
@@ -772,7 +986,7 @@ config MTRR
 
 config EFI
        bool "Boot from EFI support"
-       depends on ACPI
+       depends on X86_32 && ACPI
        default n
        ---help---
        This enables the kernel to boot on EFI platforms using
@@ -789,18 +1003,18 @@ config EFI
        kernel should continue to boot on existing non-EFI platforms.
 
 config IRQBALANCE
-       bool "Enable kernel irq balancing"
-       depends on SMP && X86_IO_APIC
+       bool "Enable kernel irq balancing"
+       depends on X86_32 && SMP && X86_IO_APIC
        default y
        help
-         The default yes will allow the kernel to do irq load balancing.
+         The default yes will allow the kernel to do irq load balancing.
          Saying no will keep the kernel from doing irq load balancing.
 
 # turning this on wastes a bunch of space.
 # Summit needs it only when NUMA is on
 config BOOT_IOREMAP
        bool
-       depends on (((X86_SUMMIT || X86_GENERICARCH) && NUMA) || (X86 && EFI))
+       depends on X86_32 && (((X86_SUMMIT || X86_GENERICARCH) && NUMA) || (X86 && EFI))
        default y
 
 config SECCOMP
@@ -820,6 +1034,30 @@ config SECCOMP
 
          If unsure, say Y. Only embedded should say N here.
 
+config CC_STACKPROTECTOR
+       bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)"
+       depends on X86_64 && EXPERIMENTAL
+       help
+         This option turns on the -fstack-protector GCC feature. This
+         feature puts, at the beginning of critical functions, a canary
+         value on the stack just before the return address, and validates
+         the value just before actually returning.  Stack based buffer
+         overflows (that need to overwrite this return address) now also
+         overwrite the canary, which gets detected and the attack is then
+         neutralized via a kernel panic.
+
+         This feature requires gcc version 4.2 or above, or a distribution
+         gcc with the feature backported. Older versions are automatically
+         detected and for those versions, this configuration option is ignored.
+
+config CC_STACKPROTECTOR_ALL
+       bool "Use stack-protector for all functions"
+       depends on CC_STACKPROTECTOR
+       help
+         Normally, GCC only inserts the canary value protection for
+         functions that use large-ish on-stack buffers. By enabling
+         this option, GCC will be asked to do this for ALL functions.
+
 source kernel/Kconfig.hz
 
 config KEXEC
@@ -841,7 +1079,7 @@ config KEXEC
 config CRASH_DUMP
        bool "kernel crash dumps (EXPERIMENTAL)"
        depends on EXPERIMENTAL
-       depends on HIGHMEM
+       depends on X86_64 || (X86_32 && HIGHMEM)
        help
          Generate crash dump after being started by kexec.
          This should be normally only set in special crash dump kernels
@@ -856,6 +1094,7 @@ config CRASH_DUMP
 config PHYSICAL_START
        hex "Physical address where the kernel is loaded" if (EMBEDDED || CRASH_DUMP)
        default "0x1000000" if X86_NUMAQ
+       default "0x200000" if X86_64
        default "0x100000"
        help
          This gives the physical address where the kernel is loaded.
@@ -908,25 +1147,31 @@ config RELOCATABLE
          must live at a different physical address than the primary
          kernel.
 
+         Note: If CONFIG_RELOCATABLE=y, then the kernel runs from the address
+         it has been loaded at and the compile time physical address
+         (CONFIG_PHYSICAL_START) is ignored.
+
 config PHYSICAL_ALIGN
-       hex "Alignment value to which kernel should be aligned"
-       default "0x100000"
+       hex
+       prompt "Alignment value to which kernel should be aligned" if X86_32
+       default "0x100000" if X86_32
+       default "0x200000" if X86_64
        range 0x2000 0x400000
        help
          This value puts the alignment restrictions on physical address
-         where kernel is loaded and run from. Kernel is compiled for an
-         address which meets above alignment restriction.
-
-         If bootloader loads the kernel at a non-aligned address and
-         CONFIG_RELOCATABLE is set, kernel will move itself to nearest
-         address aligned to above value and run from there.
-
-         If bootloader loads the kernel at a non-aligned address and
-         CONFIG_RELOCATABLE is not set, kernel will ignore the run time
-         load address and decompress itself to the address it has been
-         compiled for and run from there. The address for which kernel is
-         compiled already meets above alignment restrictions. Hence the
-         end result is that kernel runs from a physical address meeting
+         where kernel is loaded and run from. Kernel is compiled for an
+         address which meets above alignment restriction.
+
+         If bootloader loads the kernel at a non-aligned address and
+         CONFIG_RELOCATABLE is set, kernel will move itself to nearest
+         address aligned to above value and run from there.
+
+         If bootloader loads the kernel at a non-aligned address and
+         CONFIG_RELOCATABLE is not set, kernel will ignore the run time
+         load address and decompress itself to the address it has been
+         compiled for and run from there. The address for which kernel is
+         compiled already meets above alignment restrictions. Hence the
+         end result is that kernel runs from a physical address meeting
          above alignment restrictions.
 
          Don't change this unless you know what you are doing.
@@ -938,10 +1183,13 @@ config HOTPLUG_CPU
          Say Y here to experiment with turning CPUs off and on, and to
          enable suspend on SMP systems. CPUs can be controlled through
          /sys/devices/system/cpu.
+         Say N if you want to disable CPU hotplug and don't need to
+         suspend.
 
 config COMPAT_VDSO
        bool "Compat VDSO support"
        default y
+       depends on X86_32
        help
          Map the VDSO to the predictable old-style address too.
        ---help---
@@ -955,18 +1203,35 @@ endmenu
 
 config ARCH_ENABLE_MEMORY_HOTPLUG
        def_bool y
-       depends on HIGHMEM
+       depends on X86_64 || (X86_32 && HIGHMEM)
+
+config MEMORY_HOTPLUG_RESERVE
+       def_bool X86_64
+       depends on (MEMORY_HOTPLUG && DISCONTIGMEM)
+
+config HAVE_ARCH_EARLY_PFN_TO_NID
+       def_bool X86_64
+       depends on NUMA
 
-menu "Power management options (ACPI, APM)"
+config OUT_OF_LINE_PFN_TO_PAGE
+       def_bool X86_64
+       depends on DISCONTIGMEM
+
+menu "Power management options"
        depends on !X86_VOYAGER
 
-source kernel/power/Kconfig
+config ARCH_HIBERNATION_HEADER
+       bool
+       depends on X86_64 && HIBERNATION
+       default y
+
+source "kernel/power/Kconfig"
 
 source "drivers/acpi/Kconfig"
 
 menuconfig APM
        tristate "APM (Advanced Power Management) BIOS support"
-       depends on PM_SLEEP && !X86_VISWS
+       depends on X86_32 && PM_SLEEP && !X86_VISWS
        ---help---
          APM is a BIOS specification for saving power using several different
          techniques. This is mostly useful for battery powered laptops with
@@ -1092,13 +1357,14 @@ config APM_REAL_MODE_POWER_OFF
 
 endif # APM
 
-source "arch/x86/kernel/cpu/cpufreq/Kconfig_32"
+source "arch/x86/kernel/cpu/cpufreq/Kconfig"
 
 source "drivers/cpuidle/Kconfig"
 
 endmenu
 
-menu "Bus options (PCI, PCMCIA, EISA, MCA, ISA)"
+
+menu "Bus options (PCI etc.)"
 
 config PCI
        bool "PCI support" if !X86_VISWS
@@ -1118,7 +1384,7 @@ config PCI
 
 choice
        prompt "PCI access mode"
-       depends on PCI && !X86_VISWS
+       depends on X86_32 && PCI && !X86_VISWS
        default PCI_GOANY
        ---help---
          On PCI systems, the BIOS can be used to detect the PCI devices and
@@ -1151,17 +1417,18 @@ endchoice
 
 config PCI_BIOS
        bool
-       depends on !X86_VISWS && PCI && (PCI_GOBIOS || PCI_GOANY)
+       depends on X86_32 && !X86_VISWS && PCI && (PCI_GOBIOS || PCI_GOANY)
        default y
 
+# x86-64 doesn't support PCI BIOS access from long mode so always go direct.
 config PCI_DIRECT
        bool
-       depends on PCI && ((PCI_GODIRECT || PCI_GOANY) || X86_VISWS)
+       depends on PCI && (X86_64 || (PCI_GODIRECT || PCI_GOANY) || X86_VISWS)
        default y
 
 config PCI_MMCONFIG
        bool
-       depends on PCI && ACPI && (PCI_GOMMCONFIG || PCI_GOANY)
+       depends on X86_32 && PCI && ACPI && (PCI_GOMMCONFIG || PCI_GOANY)
        default y
 
 config PCI_DOMAINS
@@ -1169,14 +1436,52 @@ config PCI_DOMAINS
        depends on PCI
        default y
 
+config PCI_MMCONFIG
+       bool "Support mmconfig PCI config space access"
+       depends on X86_64 && PCI && ACPI
+
+config DMAR
+       bool "Support for DMA Remapping Devices (EXPERIMENTAL)"
+       depends on X86_64 && PCI_MSI && ACPI && EXPERIMENTAL
+       help
+         DMA remapping (DMAR) devices support enables independent address
+         translations for Direct Memory Access (DMA) from devices.
+         These DMA remapping devices are reported via ACPI tables
+         and include PCI device scope covered by these DMA
+         remapping devices.
+
+config DMAR_GFX_WA
+       bool "Support for Graphics workaround"
+       depends on DMAR
+       default y
+       help
+        Current Graphics drivers tend to use physical address
+        for DMA and avoid using DMA APIs. Setting this config
+        option permits the IOMMU driver to set a unity map for
+        all the OS-visible memory. Hence the driver can continue
+        to use physical addresses for DMA.
+
+config DMAR_FLOPPY_WA
+       bool
+       depends on DMAR
+       default y
+       help
+        Floppy disk drivers are know to bypass DMA API calls
+        thereby failing to work when IOMMU is enabled. This
+        workaround will setup a 1:1 mapping for the first
+        16M to make floppy (an ISA device) work.
+
 source "drivers/pci/pcie/Kconfig"
 
 source "drivers/pci/Kconfig"
 
+# x86_64 have no ISA slots, but do have ISA-style DMA.
 config ISA_DMA_API
        bool
        default y
 
+if X86_32
+
 config ISA
        bool "ISA support"
        depends on !(X86_VOYAGER || X86_VISWS)
@@ -1248,9 +1553,11 @@ config GEODE_MFGPT_TIMER
          MFGPTs have a better resolution and max interval than the
          generic PIT, and are suitable for use as high-res timers.
 
+endif # X86_32
+
 config K8_NB
        def_bool y
-       depends on AGP_AMD64
+       depends on AGP_AMD64 || (X86_64 && (GART_IOMMU || (PCI && NUMA)))
 
 source "drivers/pcmcia/Kconfig"
 
@@ -1258,16 +1565,48 @@ source "drivers/pci/hotplug/Kconfig"
 
 endmenu
 
-menu "Executable file formats"
+
+menu "Executable file formats / Emulations"
 
 source "fs/Kconfig.binfmt"
 
+config IA32_EMULATION
+       bool "IA32 Emulation"
+       depends on X86_64
+       help
+         Include code to run 32-bit programs under a 64-bit kernel. You should
+         likely turn this on, unless you're 100% sure that you don't have any
+         32-bit programs left.
+
+config IA32_AOUT
+       tristate "IA32 a.out support"
+       depends on IA32_EMULATION
+       help
+         Support old a.out binaries in the 32bit emulation.
+
+config COMPAT
+       bool
+       depends on IA32_EMULATION
+       default y
+
+config COMPAT_FOR_U64_ALIGNMENT
+       def_bool COMPAT
+       depends on X86_64
+
+config SYSVIPC_COMPAT
+       bool
+       depends on X86_64 && COMPAT && SYSVIPC
+       default y
+
 endmenu
 
+
 source "net/Kconfig"
 
 source "drivers/Kconfig"
 
+source "drivers/firmware/Kconfig"
+
 source "fs/Kconfig"
 
 source "kernel/Kconfig.instrumentation"
@@ -1279,43 +1618,3 @@ source "security/Kconfig"
 source "crypto/Kconfig"
 
 source "lib/Kconfig"
-
-#
-# Use the generic interrupt handling code in kernel/irq/:
-#
-config GENERIC_HARDIRQS
-       bool
-       default y
-
-config GENERIC_IRQ_PROBE
-       bool
-       default y
-
-config GENERIC_PENDING_IRQ
-       bool
-       depends on GENERIC_HARDIRQS && SMP
-       default y
-
-config X86_SMP
-       bool
-       depends on SMP && !X86_VOYAGER
-       default y
-
-config X86_HT
-       bool
-       depends on SMP && !(X86_VISWS || X86_VOYAGER)
-       default y
-
-config X86_BIOS_REBOOT
-       bool
-       depends on !(X86_VISWS || X86_VOYAGER)
-       default y
-
-config X86_TRAMPOLINE
-       bool
-       depends on X86_SMP || (X86_VOYAGER && SMP)
-       default y
-
-config KTIME_SCALAR
-       bool
-       default y
index 0e2adadf59057dc906466786f4049ac8ca33aa64..c30162202dc4b10f767ee71728c13769369d1fae 100644 (file)
@@ -3,11 +3,12 @@ if !X86_ELAN
 
 choice
        prompt "Processor family"
-       default M686
+       default M686 if X86_32
+       default GENERIC_CPU if X86_64
 
 config M386
        bool "386"
-       depends on !UML
+       depends on X86_32 && !UML
        ---help---
          This is the processor type of your CPU. This information is used for
          optimizing purposes. In order to compile a kernel that can run on
@@ -49,6 +50,7 @@ config M386
 
 config M486
        bool "486"
+       depends on X86_32
        help
          Select this for a 486 series processor, either Intel or one of the
          compatible processors from AMD, Cyrix, IBM, or Intel.  Includes DX,
@@ -57,6 +59,7 @@ config M486
 
 config M586
        bool "586/K5/5x86/6x86/6x86MX"
+       depends on X86_32
        help
          Select this for an 586 or 686 series processor such as the AMD K5,
          the Cyrix 5x86, 6x86 and 6x86MX.  This choice does not
@@ -64,18 +67,21 @@ config M586
 
 config M586TSC
        bool "Pentium-Classic"
+       depends on X86_32
        help
          Select this for a Pentium Classic processor with the RDTSC (Read
          Time Stamp Counter) instruction for benchmarking.
 
 config M586MMX
        bool "Pentium-MMX"
+       depends on X86_32
        help
          Select this for a Pentium with the MMX graphics/multimedia
          extended instructions.
 
 config M686
        bool "Pentium-Pro"
+       depends on X86_32
        help
          Select this for Intel Pentium Pro chips.  This enables the use of
          Pentium Pro extended instructions, and disables the init-time guard
@@ -83,6 +89,7 @@ config M686
 
 config MPENTIUMII
        bool "Pentium-II/Celeron(pre-Coppermine)"
+       depends on X86_32
        help
          Select this for Intel chips based on the Pentium-II and
          pre-Coppermine Celeron core.  This option enables an unaligned
@@ -92,6 +99,7 @@ config MPENTIUMII
 
 config MPENTIUMIII
        bool "Pentium-III/Celeron(Coppermine)/Pentium-III Xeon"
+       depends on X86_32
        help
          Select this for Intel chips based on the Pentium-III and
          Celeron-Coppermine core.  This option enables use of some
@@ -100,19 +108,14 @@ config MPENTIUMIII
 
 config MPENTIUMM
        bool "Pentium M"
+       depends on X86_32
        help
          Select this for Intel Pentium M (not Pentium-4 M)
          notebook chips.
 
-config MCORE2
-       bool "Core 2/newer Xeon"
-       help
-         Select this for Intel Core 2 and newer Core 2 Xeons (Xeon 51xx and 53xx)
-         CPUs. You can distinguish newer from older Xeons by the CPU family
-         in /proc/cpuinfo. Newer ones have 6 and older ones 15 (not a typo)
-
 config MPENTIUM4
        bool "Pentium-4/Celeron(P4-based)/Pentium-4 M/older Xeon"
+       depends on X86_32
        help
          Select this for Intel Pentium 4 chips.  This includes the
          Pentium 4, Pentium D, P4-based Celeron and Xeon, and
@@ -148,6 +151,7 @@ config MPENTIUM4
 
 config MK6
        bool "K6/K6-II/K6-III"
+       depends on X86_32
        help
          Select this for an AMD K6-family processor.  Enables use of
          some extended instructions, and passes appropriate optimization
@@ -155,6 +159,7 @@ config MK6
 
 config MK7
        bool "Athlon/Duron/K7"
+       depends on X86_32
        help
          Select this for an AMD Athlon K7-family processor.  Enables use of
          some extended instructions, and passes appropriate optimization
@@ -169,6 +174,7 @@ config MK8
 
 config MCRUSOE
        bool "Crusoe"
+       depends on X86_32
        help
          Select this for a Transmeta Crusoe processor.  Treats the processor
          like a 586 with TSC, and sets some GCC optimization flags (like a
@@ -176,11 +182,13 @@ config MCRUSOE
 
 config MEFFICEON
        bool "Efficeon"
+       depends on X86_32
        help
          Select this for a Transmeta Efficeon processor.
 
 config MWINCHIPC6
        bool "Winchip-C6"
+       depends on X86_32
        help
          Select this for an IDT Winchip C6 chip.  Linux and GCC
          treat this chip as a 586TSC with some extended instructions
@@ -188,6 +196,7 @@ config MWINCHIPC6
 
 config MWINCHIP2
        bool "Winchip-2"
+       depends on X86_32
        help
          Select this for an IDT Winchip-2.  Linux and GCC
          treat this chip as a 586TSC with some extended instructions
@@ -195,6 +204,7 @@ config MWINCHIP2
 
 config MWINCHIP3D
        bool "Winchip-2A/Winchip-3"
+       depends on X86_32
        help
          Select this for an IDT Winchip-2A or 3.  Linux and GCC
          treat this chip as a 586TSC with some extended instructions
@@ -204,16 +214,19 @@ config MWINCHIP3D
 
 config MGEODEGX1
        bool "GeodeGX1"
+       depends on X86_32
        help
          Select this for a Geode GX1 (Cyrix MediaGX) chip.
 
 config MGEODE_LX
        bool "Geode GX/LX"
+       depends on X86_32
        help
          Select this for AMD Geode GX and LX processors.
 
 config MCYRIXIII
        bool "CyrixIII/VIA-C3"
+       depends on X86_32
        help
          Select this for a Cyrix III or C3 chip.  Presently Linux and GCC
          treat this chip as a generic 586. Whilst the CPU is 686 class,
@@ -225,6 +238,7 @@ config MCYRIXIII
 
 config MVIAC3_2
        bool "VIA C3-2 (Nehemiah)"
+       depends on X86_32
        help
          Select this for a VIA C3 "Nehemiah". Selecting this enables usage
          of SSE and tells gcc to treat the CPU as a 686.
@@ -232,15 +246,42 @@ config MVIAC3_2
 
 config MVIAC7
        bool "VIA C7"
+       depends on X86_32
        help
          Select this for a VIA C7.  Selecting this uses the correct cache
          shift and tells gcc to treat the CPU as a 686.
 
+config MPSC
+       bool "Intel P4 / older Netburst based Xeon"
+       depends on X86_64
+       help
+         Optimize for Intel Pentium 4, Pentium D and older Nocona/Dempsey
+         Xeon CPUs with Intel 64bit which is compatible with x86-64.
+         Note that the latest Xeons (Xeon 51xx and 53xx) are not based on the
+          Netburst core and shouldn't use this option. You can distinguish them
+         using the cpu family field
+         in /proc/cpuinfo. Family 15 is an older Xeon, Family 6 a newer one.
+
+config MCORE2
+       bool "Core 2/newer Xeon"
+       help
+         Select this for Intel Core 2 and newer Core 2 Xeons (Xeon 51xx and 53xx)
+         CPUs. You can distinguish newer from older Xeons by the CPU family
+         in /proc/cpuinfo. Newer ones have 6 and older ones 15 (not a typo)
+
+config GENERIC_CPU
+       bool "Generic-x86-64"
+       depends on X86_64
+       help
+         Generic x86-64 CPU.
+         Run equally well on all x86-64 CPUs.
+
 endchoice
 
 config X86_GENERIC
-       bool "Generic x86 support"
-       help
+       bool "Generic x86 support"
+       depends on X86_32
+       help
          Instead of just including optimizations for the selected
          x86 variant (e.g. PII, Crusoe or Athlon), include some more
          generic optimizations as well. This will make the kernel
@@ -253,44 +294,31 @@ endif
 
 #
 # Define implied options from the CPU selection here
-#
+config X86_L1_CACHE_BYTES
+       int
+       default "128" if GENERIC_CPU || MPSC
+       default "64" if MK8 || MCORE2
+       depends on X86_64
+
+config X86_INTERNODE_CACHE_BYTES
+       int
+       default "4096" if X86_VSMP
+       default X86_L1_CACHE_BYTES if !X86_VSMP
+       depends on X86_64
+
 config X86_CMPXCHG
-       bool
-       depends on !M386
-       default y
+       def_bool X86_64 || (X86_32 && !M386)
 
 config X86_L1_CACHE_SHIFT
        int
-       default "7" if MPENTIUM4 || X86_GENERIC
+       default "7" if MPENTIUM4 || X86_GENERIC || GENERIC_CPU || MPSC
        default "4" if X86_ELAN || M486 || M386 || MGEODEGX1
        default "5" if MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX
        default "6" if MK7 || MK8 || MPENTIUMM || MCORE2 || MVIAC7
 
 config X86_XADD
        bool
-       depends on !M386
-       default y
-
-config RWSEM_GENERIC_SPINLOCK
-       bool
-       depends on !X86_XADD
-       default y
-
-config RWSEM_XCHGADD_ALGORITHM
-       bool
-       depends on X86_XADD
-       default y
-
-config ARCH_HAS_ILOG2_U32
-       bool
-       default n
-
-config ARCH_HAS_ILOG2_U64
-       bool
-       default n
-
-config GENERIC_CALIBRATE_DELAY
-       bool
+       depends on X86_32 && !M386
        default y
 
 config X86_PPRO_FENCE
@@ -305,22 +333,22 @@ config X86_F00F_BUG
 
 config X86_WP_WORKS_OK
        bool
-       depends on !M386
+       depends on X86_32 && !M386
        default y
 
 config X86_INVLPG
        bool
-       depends on !M386
+       depends on X86_32 && !M386
        default y
 
 config X86_BSWAP
        bool
-       depends on !M386
+       depends on X86_32 && !M386
        default y
 
 config X86_POPAD_OK
        bool
-       depends on !M386
+       depends on X86_32 && !M386
        default y
 
 config X86_ALIGNMENT_16
@@ -330,7 +358,7 @@ config X86_ALIGNMENT_16
 
 config X86_GOOD_APIC
        bool
-       depends on MK7 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || MK8 || MEFFICEON || MCORE2 || MVIAC7
+       depends on MK7 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || MK8 || MEFFICEON || MCORE2 || MVIAC7 || X86_64
        default y
 
 config X86_INTEL_USERCOPY
@@ -355,7 +383,7 @@ config X86_OOSTORE
 
 config X86_TSC
        bool
-       depends on (MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MVIAC7 || MGEODEGX1 || MGEODE_LX || MCORE2) && !X86_NUMAQ
+       depends on ((MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MVIAC7 || MGEODEGX1 || MGEODE_LX || MCORE2) && !X86_NUMAQ) || X86_64
        default y
 
 # this should be set for all -march=.. options where the compiler
@@ -367,6 +395,7 @@ config X86_CMOV
 
 config X86_MINIMUM_CPU_FAMILY
        int
-       default "4" if X86_XADD || X86_CMPXCHG || X86_BSWAP || X86_WP_WORKS_OK
+       default "64" if X86_64
+       default "4" if X86_32 && (X86_XADD || X86_CMPXCHG || X86_BSWAP || X86_WP_WORKS_OK)
        default "3"
 
index 970b2defe7df3206a7706a39a98c79279866ae04..761ca7b5f120e6cb0d52d2352dc4bb26d23b74e3 100644 (file)
@@ -6,9 +6,8 @@ config TRACE_IRQFLAGS_SUPPORT
 source "lib/Kconfig.debug"
 
 config EARLY_PRINTK
-       bool "Early printk" if EMBEDDED && DEBUG_KERNEL
+       bool "Early printk" if EMBEDDED && DEBUG_KERNEL && X86_32
        default y
-       depends on X86_32
        help
          Write kernel log output directly into the VGA buffer or to a serial
          port.
@@ -91,7 +90,7 @@ config DOUBLEFAULT
 
 config IOMMU_DEBUG
        bool "Enable IOMMU debugging"
-       depends on IOMMU && DEBUG_KERNEL
+       depends on GART_IOMMU && DEBUG_KERNEL
        depends on X86_64
        help
          Force the IOMMU to on even when you have less than 4GB of
@@ -113,7 +112,4 @@ config IOMMU_LEAK
          Add a simple leak tracer to the IOMMU code. This is useful when you
          are debugging a buggy device driver that leaks IOMMU mappings.
 
-#config X86_REMOTE_DEBUG
-#      bool "kgdb debugging stub"
-
 endmenu
diff --git a/arch/x86/Kconfig.x86_64 b/arch/x86/Kconfig.x86_64
deleted file mode 100644 (file)
index e2542e5..0000000
+++ /dev/null
@@ -1,844 +0,0 @@
-#
-# For a description of the syntax of this configuration file,
-# see Documentation/kbuild/kconfig-language.txt.
-#
-# Note: ISA is disabled and will hopefully never be enabled.
-# If you managed to buy an ISA x86-64 box you'll have to fix all the
-# ISA drivers you need yourself.
-#
-
-mainmenu "Linux Kernel Configuration"
-
-config X86_64
-       bool
-       default y
-       help
-         Port to the x86-64 architecture. x86-64 is a 64-bit extension to the
-         classical 32-bit x86 architecture. For details see
-         <http://www.x86-64.org/>.
-
-config 64BIT
-       def_bool y
-
-config X86
-       bool
-       default y
-
-config GENERIC_TIME
-       bool
-       default y
-
-config GENERIC_TIME_VSYSCALL
-       bool
-       default y
-
-config GENERIC_CMOS_UPDATE
-       bool
-       default y
-
-config CLOCKSOURCE_WATCHDOG
-       bool
-       default y
-
-config GENERIC_CLOCKEVENTS
-       bool
-       default y
-
-config GENERIC_CLOCKEVENTS_BROADCAST
-       bool
-       default y
-
-config ZONE_DMA32
-       bool
-       default y
-
-config LOCKDEP_SUPPORT
-       bool
-       default y
-
-config STACKTRACE_SUPPORT
-       bool
-       default y
-
-config SEMAPHORE_SLEEPERS
-       bool
-       default y
-
-config MMU
-       bool
-       default y
-
-config ZONE_DMA
-       bool
-       default y
-
-config ISA
-       bool
-
-config SBUS
-       bool
-
-config RWSEM_GENERIC_SPINLOCK
-       bool
-       default y
-
-config RWSEM_XCHGADD_ALGORITHM
-       bool
-
-config GENERIC_HWEIGHT
-       bool
-       default y
-
-config GENERIC_CALIBRATE_DELAY
-       bool
-       default y
-
-config X86_CMPXCHG
-       bool
-       default y
-
-config EARLY_PRINTK
-       bool
-       default y
-
-config GENERIC_ISA_DMA
-       bool
-       default y
-
-config GENERIC_IOMAP
-       bool
-       default y
-
-config ARCH_MAY_HAVE_PC_FDC
-       bool
-       default y
-
-config ARCH_POPULATES_NODE_MAP
-       def_bool y
-
-config DMI
-       bool
-       default y
-
-config AUDIT_ARCH
-       bool
-       default y
-
-config GENERIC_BUG
-       bool
-       default y
-       depends on BUG
-
-config ARCH_HAS_ILOG2_U32
-       bool
-       default n
-
-config ARCH_HAS_ILOG2_U64
-       bool
-       default n
-
-source "init/Kconfig"
-
-
-menu "Processor type and features"
-
-source "kernel/time/Kconfig"
-
-choice
-       prompt "Subarchitecture Type"
-       default X86_PC
-
-config X86_PC
-       bool "PC-compatible"
-       help
-         Choose this option if your computer is a standard PC or compatible.
-
-config X86_VSMP
-       bool "Support for ScaleMP vSMP"
-       depends on PCI
-        help
-         Support for ScaleMP vSMP systems.  Say 'Y' here if this kernel is
-         supposed to run on these EM64T-based machines.  Only choose this option
-         if you have one of these machines.
-
-endchoice
-
-choice
-       prompt "Processor family"
-       default GENERIC_CPU
-
-config MK8
-       bool "AMD-Opteron/Athlon64"
-       help
-         Optimize for AMD Opteron/Athlon64/Hammer/K8 CPUs.
-
-config MPSC
-       bool "Intel P4 / older Netburst based Xeon"
-       help
-         Optimize for Intel Pentium 4, Pentium D and older Nocona/Dempsey
-         Xeon CPUs with Intel 64bit which is compatible with x86-64.
-         Note that the latest Xeons (Xeon 51xx and 53xx) are not based on the
-          Netburst core and shouldn't use this option. You can distinguish them
-         using the cpu family field
-         in /proc/cpuinfo. Family 15 is an older Xeon, Family 6 a newer one.
-
-config MCORE2
-       bool "Intel Core2 / newer Xeon"
-       help
-         Optimize for Intel Core2 and newer Xeons (51xx)
-         You can distinguish the newer Xeons from the older ones using
-         the cpu family field in /proc/cpuinfo. 15 is an older Xeon
-         (use CONFIG_MPSC then), 6 is a newer one.
-
-config GENERIC_CPU
-       bool "Generic-x86-64"
-       help
-         Generic x86-64 CPU.
-         Run equally well on all x86-64 CPUs.
-
-endchoice
-
-#
-# Define implied options from the CPU selection here
-#
-config X86_L1_CACHE_BYTES
-       int
-       default "128" if GENERIC_CPU || MPSC
-       default "64" if MK8 || MCORE2
-
-config X86_L1_CACHE_SHIFT
-       int
-       default "7" if GENERIC_CPU || MPSC
-       default "6" if MK8 || MCORE2
-
-config X86_INTERNODE_CACHE_BYTES
-       int
-       default "4096" if X86_VSMP
-       default X86_L1_CACHE_BYTES if !X86_VSMP
-
-config X86_TSC
-       bool
-       default y
-
-config X86_GOOD_APIC
-       bool
-       default y
-
-config MICROCODE
-       tristate "/dev/cpu/microcode - Intel CPU microcode support"
-       select FW_LOADER
-       ---help---
-         If you say Y here the 'File systems' section, you will be
-         able to update the microcode on Intel processors. You will
-         obviously need the actual microcode binary data itself which is
-         not shipped with the Linux kernel.
-
-         For latest news and information on obtaining all the required
-         ingredients for this driver, check:
-         <http://www.urbanmyth.org/microcode/>.
-
-         To compile this driver as a module, choose M here: the
-         module will be called microcode.
-         If you use modprobe or kmod you may also want to add the line
-         'alias char-major-10-184 microcode' to your /etc/modules.conf file.
-
-config MICROCODE_OLD_INTERFACE
-       bool
-       depends on MICROCODE
-       default y
-
-config X86_MSR
-       tristate "/dev/cpu/*/msr - Model-specific register support"
-       help
-         This device gives privileged processes access to the x86
-         Model-Specific Registers (MSRs).  It is a character device with
-         major 202 and minors 0 to 31 for /dev/cpu/0/msr to /dev/cpu/31/msr.
-         MSR accesses are directed to a specific CPU on multi-processor
-         systems.
-
-config X86_CPUID
-       tristate "/dev/cpu/*/cpuid - CPU information support"
-       help
-         This device gives processes access to the x86 CPUID instruction to
-         be executed on a specific processor.  It is a character device
-         with major 203 and minors 0 to 31 for /dev/cpu/0/cpuid to
-         /dev/cpu/31/cpuid.
-
-config X86_HT
-       bool
-       depends on SMP && !MK8
-       default y
-
-config MATH_EMULATION
-       bool
-
-config MCA
-       bool
-
-config EISA
-       bool
-
-config X86_IO_APIC
-       bool
-       default y
-
-config X86_LOCAL_APIC
-       bool
-       default y
-
-config MTRR
-       bool "MTRR (Memory Type Range Register) support"
-       ---help---
-         On Intel P6 family processors (Pentium Pro, Pentium II and later)
-         the Memory Type Range Registers (MTRRs) may be used to control
-         processor access to memory ranges. This is most useful if you have
-         a video (VGA) card on a PCI or AGP bus. Enabling write-combining
-         allows bus write transfers to be combined into a larger transfer
-         before bursting over the PCI/AGP bus. This can increase performance
-         of image write operations 2.5 times or more. Saying Y here creates a
-         /proc/mtrr file which may be used to manipulate your processor's
-         MTRRs. Typically the X server should use this.
-
-         This code has a reasonably generic interface so that similar
-         control registers on other processors can be easily supported
-         as well.
-
-         Saying Y here also fixes a problem with buggy SMP BIOSes which only
-         set the MTRRs for the boot CPU and not for the secondary CPUs. This
-         can lead to all sorts of problems, so it's good to say Y here.
-
-         Just say Y here, all x86-64 machines support MTRRs.
-
-         See <file:Documentation/mtrr.txt> for more information.
-
-config SMP
-       bool "Symmetric multi-processing support"
-       ---help---
-         This enables support for systems with more than one CPU. If you have
-         a system with only one CPU, like most personal computers, say N. If
-         you have a system with more than one CPU, say Y.
-
-         If you say N here, the kernel will run on single and multiprocessor
-         machines, but will use only one CPU of a multiprocessor machine. If
-         you say Y here, the kernel will run on many, but not all,
-         singleprocessor machines. On a singleprocessor machine, the kernel
-         will run faster if you say N here.
-
-         If you don't know what to do here, say N.
-
-config SCHED_SMT
-       bool "SMT (Hyperthreading) scheduler support"
-       depends on SMP
-       default n
-       help
-         SMT scheduler support improves the CPU scheduler's decision making
-         when dealing with Intel Pentium 4 chips with HyperThreading at a
-         cost of slightly increased overhead in some places. If unsure say
-         N here.
-
-config SCHED_MC
-       bool "Multi-core scheduler support"
-       depends on SMP
-       default y
-       help
-         Multi-core scheduler support improves the CPU scheduler's decision
-         making when dealing with multi-core CPU chips at a cost of slightly
-         increased overhead in some places. If unsure say N here.
-
-source "kernel/Kconfig.preempt"
-
-config NUMA
-       bool "Non Uniform Memory Access (NUMA) Support"
-       depends on SMP
-       help
-        Enable NUMA (Non Uniform Memory Access) support. The kernel 
-        will try to allocate memory used by a CPU on the local memory 
-        controller of the CPU and add some more NUMA awareness to the kernel.
-        This code is recommended on all multiprocessor Opteron systems.
-        If the system is EM64T, you should say N unless your system is EM64T 
-        NUMA. 
-
-config K8_NUMA
-       bool "Old style AMD Opteron NUMA detection"
-       depends on NUMA && PCI
-       default y
-       help
-        Enable K8 NUMA node topology detection.  You should say Y here if
-        you have a multi processor AMD K8 system. This uses an old
-        method to read the NUMA configuration directly from the builtin
-        Northbridge of Opteron. It is recommended to use X86_64_ACPI_NUMA
-        instead, which also takes priority if both are compiled in.   
-
-config NODES_SHIFT
-       int
-       default "6"
-       depends on NEED_MULTIPLE_NODES
-
-# Dummy CONFIG option to select ACPI_NUMA from drivers/acpi/Kconfig.
-
-config X86_64_ACPI_NUMA
-       bool "ACPI NUMA detection"
-       depends on NUMA
-       select ACPI 
-       select PCI
-       select ACPI_NUMA
-       default y
-       help
-        Enable ACPI SRAT based node topology detection.
-
-config NUMA_EMU
-       bool "NUMA emulation"
-       depends on NUMA
-       help
-         Enable NUMA emulation. A flat machine will be split
-         into virtual nodes when booted with "numa=fake=N", where N is the
-         number of nodes. This is only useful for debugging.
-
-config ARCH_DISCONTIGMEM_ENABLE
-       bool
-       depends on NUMA
-       default y
-
-config ARCH_DISCONTIGMEM_DEFAULT
-       def_bool y
-       depends on NUMA
-
-config ARCH_SPARSEMEM_ENABLE
-       def_bool y
-       depends on (NUMA || EXPERIMENTAL)
-       select SPARSEMEM_VMEMMAP_ENABLE
-
-config ARCH_MEMORY_PROBE
-       def_bool y
-       depends on MEMORY_HOTPLUG
-
-config ARCH_FLATMEM_ENABLE
-       def_bool y
-       depends on !NUMA
-
-source "mm/Kconfig"
-
-config MEMORY_HOTPLUG_RESERVE
-       def_bool y
-       depends on (MEMORY_HOTPLUG && DISCONTIGMEM)
-
-config HAVE_ARCH_EARLY_PFN_TO_NID
-       def_bool y
-       depends on NUMA
-
-config OUT_OF_LINE_PFN_TO_PAGE
-       def_bool y
-       depends on DISCONTIGMEM
-
-config NR_CPUS
-       int "Maximum number of CPUs (2-255)"
-       range 2 255
-       depends on SMP
-       default "8"
-       help
-         This allows you to specify the maximum number of CPUs which this
-         kernel will support. Current maximum is 255 CPUs due to
-         APIC addressing limits. Less depending on the hardware.
-
-         This is purely to save memory - each supported CPU requires
-         memory in the static kernel configuration.
-
-config PHYSICAL_ALIGN
-       hex
-       default "0x200000"
-
-config HOTPLUG_CPU
-       bool "Support for suspend on SMP and hot-pluggable CPUs (EXPERIMENTAL)"
-       depends on SMP && HOTPLUG && EXPERIMENTAL
-       help
-               Say Y here to experiment with turning CPUs off and on.  CPUs
-               can be controlled through /sys/devices/system/cpu/cpu#.
-               This is also required for suspend/hibernation on SMP systems.
-
-               Say N if you want to disable CPU hotplug and don't need to
-               suspend.
-
-config ARCH_ENABLE_MEMORY_HOTPLUG
-       def_bool y
-
-config HPET_TIMER
-       bool
-       default y
-       help
-         Use the IA-PC HPET (High Precision Event Timer) to manage
-         time in preference to the PIT and RTC, if a HPET is
-         present.  The HPET provides a stable time base on SMP
-         systems, unlike the TSC, but it is more expensive to access,
-         as it is off-chip.  You can find the HPET spec at
-         <http://www.intel.com/hardwaredesign/hpetspec.htm>.
-
-config HPET_EMULATE_RTC
-       bool
-       depends on HPET_TIMER && RTC=y
-       default y
-
-# Mark as embedded because too many people got it wrong.
-# The code disables itself when not needed.
-config IOMMU
-       bool "IOMMU support" if EMBEDDED
-       default y
-       select SWIOTLB
-       select AGP
-       depends on PCI
-       help
-         Support for full DMA access of devices with 32bit memory access only
-         on systems with more than 3GB. This is usually needed for USB,
-         sound, many IDE/SATA chipsets and some other devices.
-         Provides a driver for the AMD Athlon64/Opteron/Turion/Sempron GART
-         based hardware IOMMU and a software bounce buffer based IOMMU used
-         on Intel systems and as fallback.
-         The code is only active when needed (enough memory and limited
-         device) unless CONFIG_IOMMU_DEBUG or iommu=force is specified
-         too.
-
-config CALGARY_IOMMU
-       bool "IBM Calgary IOMMU support"
-       select SWIOTLB
-       depends on PCI && EXPERIMENTAL
-       help
-         Support for hardware IOMMUs in IBM's xSeries x366 and x460
-         systems. Needed to run systems with more than 3GB of memory
-         properly with 32-bit PCI devices that do not support DAC
-         (Double Address Cycle). Calgary also supports bus level
-         isolation, where all DMAs pass through the IOMMU.  This
-         prevents them from going anywhere except their intended
-         destination. This catches hard-to-find kernel bugs and
-         mis-behaving drivers and devices that do not use the DMA-API
-         properly to set up their DMA buffers.  The IOMMU can be
-         turned off at boot time with the iommu=off parameter.
-         Normally the kernel will make the right choice by itself.
-         If unsure, say Y.
-
-config CALGARY_IOMMU_ENABLED_BY_DEFAULT
-       bool "Should Calgary be enabled by default?"
-       default y
-       depends on CALGARY_IOMMU
-       help
-         Should Calgary be enabled by default? if you choose 'y', Calgary
-         will be used (if it exists). If you choose 'n', Calgary will not be
-         used even if it exists. If you choose 'n' and would like to use
-         Calgary anyway, pass 'iommu=calgary' on the kernel command line.
-         If unsure, say Y.
-
-# need this always selected by IOMMU for the VIA workaround
-config SWIOTLB
-       bool
-       help
-         Support for software bounce buffers used on x86-64 systems
-         which don't have a hardware IOMMU (e.g. the current generation
-         of Intel's x86-64 CPUs). Using this PCI devices which can only
-         access 32-bits of memory can be used on systems with more than
-         3 GB of memory. If unsure, say Y.
-
-config X86_MCE
-       bool "Machine check support" if EMBEDDED
-       default y
-       help
-          Include a machine check error handler to report hardware errors.
-          This version will require the mcelog utility to decode some
-          machine check error logs. See
-          ftp://ftp.x86-64.org/pub/linux/tools/mcelog
-
-config X86_MCE_INTEL
-       bool "Intel MCE features"
-       depends on X86_MCE && X86_LOCAL_APIC
-       default y
-       help
-          Additional support for intel specific MCE features such as
-          the thermal monitor.
-
-config X86_MCE_AMD
-       bool "AMD MCE features"
-       depends on X86_MCE && X86_LOCAL_APIC
-       default y
-       help
-          Additional support for AMD specific MCE features such as
-          the DRAM Error Threshold.
-
-config KEXEC
-       bool "kexec system call"
-       help
-         kexec is a system call that implements the ability to shutdown your
-         current kernel, and to start another kernel.  It is like a reboot
-         but it is independent of the system firmware.   And like a reboot
-         you can start any kernel with it, not just Linux.
-
-         The name comes from the similarity to the exec system call.
-
-         It is an ongoing process to be certain the hardware in a machine
-         is properly shutdown, so do not be surprised if this code does not
-         initially work for you.  It may help to enable device hotplugging
-         support.  As of this writing the exact hardware interface is
-         strongly in flux, so no good recommendation can be made.
-
-config CRASH_DUMP
-       bool "kernel crash dumps (EXPERIMENTAL)"
-       depends on EXPERIMENTAL
-       help
-         Generate crash dump after being started by kexec.
-         This should be normally only set in special crash dump kernels
-         which are loaded in the main kernel with kexec-tools into
-         a specially reserved region and then later executed after
-         a crash by kdump/kexec. The crash dump kernel must be compiled
-         to a memory address not used by the main kernel or BIOS using
-         PHYSICAL_START, or it must be built as a relocatable image
-         (CONFIG_RELOCATABLE=y).
-         For more details see Documentation/kdump/kdump.txt
-
-config RELOCATABLE
-       bool "Build a relocatable kernel (EXPERIMENTAL)"
-       depends on EXPERIMENTAL
-       help
-         Builds a relocatable kernel. This enables loading and running
-         a kernel binary from a different physical address than it has
-         been compiled for.
-
-         One use is for the kexec on panic case where the recovery kernel
-         must live at a different physical address than the primary
-         kernel.
-
-         Note: If CONFIG_RELOCATABLE=y, then the kernel runs from the address
-         it has been loaded at and the compile time physical address
-         (CONFIG_PHYSICAL_START) is ignored.
-
-config PHYSICAL_START
-       hex "Physical address where the kernel is loaded" if (EMBEDDED || CRASH_DUMP)
-       default "0x200000"
-       help
-         This gives the physical address where the kernel is loaded. It
-         should be aligned to 2MB boundary.
-
-         If kernel is a not relocatable (CONFIG_RELOCATABLE=n) then
-         bzImage will decompress itself to above physical address and
-         run from there. Otherwise, bzImage will run from the address where
-         it has been loaded by the boot loader and will ignore above physical
-         address.
-
-         In normal kdump cases one does not have to set/change this option
-         as now bzImage can be compiled as a completely relocatable image
-         (CONFIG_RELOCATABLE=y) and be used to load and run from a different
-         address. This option is mainly useful for the folks who don't want
-         to use a bzImage for capturing the crash dump and want to use a
-         vmlinux instead.
-
-         So if you are using bzImage for capturing the crash dump, leave
-         the value here unchanged to 0x200000 and set CONFIG_RELOCATABLE=y.
-         Otherwise if you plan to use vmlinux for capturing the crash dump
-         change this value to start of the reserved region (Typically 16MB
-         0x1000000). In other words, it can be set based on the "X" value as
-         specified in the "crashkernel=YM@XM" command line boot parameter
-         passed to the panic-ed kernel. Typically this parameter is set as
-         crashkernel=64M@16M. Please take a look at
-         Documentation/kdump/kdump.txt for more details about crash dumps.
-
-         Usage of bzImage for capturing the crash dump is advantageous as
-         one does not have to build two kernels. Same kernel can be used
-         as production kernel and capture kernel.
-
-         Don't change this unless you know what you are doing.
-
-config SECCOMP
-       bool "Enable seccomp to safely compute untrusted bytecode"
-       depends on PROC_FS
-       default y
-       help
-         This kernel feature is useful for number crunching applications
-         that may need to compute untrusted bytecode during their
-         execution. By using pipes or other transports made available to
-         the process as file descriptors supporting the read/write
-         syscalls, it's possible to isolate those applications in
-         their own address space using seccomp. Once seccomp is
-         enabled via /proc/<pid>/seccomp, it cannot be disabled
-         and the task is only allowed to execute a few safe syscalls
-         defined by each seccomp mode.
-
-         If unsure, say Y. Only embedded should say N here.
-
-config CC_STACKPROTECTOR
-       bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)"
-       depends on EXPERIMENTAL
-       help
-         This option turns on the -fstack-protector GCC feature. This
-         feature puts, at the beginning of critical functions, a canary
-         value on the stack just before the return address, and validates
-         the value just before actually returning.  Stack based buffer
-         overflows (that need to overwrite this return address) now also
-         overwrite the canary, which gets detected and the attack is then
-         neutralized via a kernel panic.
-
-         This feature requires gcc version 4.2 or above, or a distribution
-         gcc with the feature backported. Older versions are automatically
-         detected and for those versions, this configuration option is ignored.
-
-config CC_STACKPROTECTOR_ALL
-       bool "Use stack-protector for all functions"
-       depends on CC_STACKPROTECTOR
-       help
-         Normally, GCC only inserts the canary value protection for
-         functions that use large-ish on-stack buffers. By enabling
-         this option, GCC will be asked to do this for ALL functions.
-
-source kernel/Kconfig.hz
-
-config K8_NB
-       def_bool y
-       depends on AGP_AMD64 || IOMMU || (PCI && NUMA)
-
-endmenu
-
-#
-# Use the generic interrupt handling code in kernel/irq/:
-#
-config GENERIC_HARDIRQS
-       bool
-       default y
-
-config GENERIC_IRQ_PROBE
-       bool
-       default y
-
-# we have no ISA slots, but we do have ISA-style DMA.
-config ISA_DMA_API
-       bool
-       default y
-
-config GENERIC_PENDING_IRQ
-       bool
-       depends on GENERIC_HARDIRQS && SMP
-       default y
-
-menu "Power management options"
-
-source kernel/power/Kconfig
-
-config ARCH_HIBERNATION_HEADER
-       bool
-       depends on HIBERNATION
-       default y
-
-source "drivers/acpi/Kconfig"
-
-source "arch/x86/kernel/cpu/cpufreq/Kconfig_64"
-
-source "drivers/cpuidle/Kconfig"
-
-endmenu
-
-menu "Bus options (PCI etc.)"
-
-config PCI
-       bool "PCI support"
-       select ARCH_SUPPORTS_MSI if (X86_LOCAL_APIC && X86_IO_APIC)
-
-# x86-64 doesn't support PCI BIOS access from long mode so always go direct.
-config PCI_DIRECT
-       bool
-       depends on PCI
-       default y
-
-config PCI_MMCONFIG
-       bool "Support mmconfig PCI config space access"
-       depends on PCI && ACPI
-
-config PCI_DOMAINS
-       bool
-       depends on PCI
-       default y
-
-config DMAR
-       bool "Support for DMA Remapping Devices (EXPERIMENTAL)"
-       depends on PCI_MSI && ACPI && EXPERIMENTAL
-       default y
-       help
-         DMA remapping (DMAR) devices support enables independent address
-         translations for Direct Memory Access (DMA) from devices.
-         These DMA remapping devices are reported via ACPI tables
-         and include PCI device scope covered by these DMA
-         remapping devices.
-
-config DMAR_GFX_WA
-       bool "Support for Graphics workaround"
-       depends on DMAR
-       default y
-       help
-        Current Graphics drivers tend to use physical address
-        for DMA and avoid using DMA APIs. Setting this config
-        option permits the IOMMU driver to set a unity map for
-        all the OS-visible memory. Hence the driver can continue
-        to use physical addresses for DMA.
-
-config DMAR_FLOPPY_WA
-       bool
-       depends on DMAR
-       default y
-       help
-        Floppy disk drivers are know to bypass DMA API calls
-        thereby failing to work when IOMMU is enabled. This
-        workaround will setup a 1:1 mapping for the first
-        16M to make floppy (an ISA device) work.
-
-source "drivers/pci/pcie/Kconfig"
-
-source "drivers/pci/Kconfig"
-
-source "drivers/pcmcia/Kconfig"
-
-source "drivers/pci/hotplug/Kconfig"
-
-endmenu
-
-
-menu "Executable file formats / Emulations"
-
-source "fs/Kconfig.binfmt"
-
-config IA32_EMULATION
-       bool "IA32 Emulation"
-       help
-         Include code to run 32-bit programs under a 64-bit kernel. You should
-         likely turn this on, unless you're 100% sure that you don't have any
-         32-bit programs left.
-
-config IA32_AOUT
-       tristate "IA32 a.out support"
-       depends on IA32_EMULATION
-       help
-         Support old a.out binaries in the 32bit emulation.
-
-config COMPAT
-       bool
-       depends on IA32_EMULATION
-       default y
-
-config COMPAT_FOR_U64_ALIGNMENT
-       def_bool COMPAT
-
-config SYSVIPC_COMPAT
-       bool
-       depends on COMPAT && SYSVIPC
-       default y
-
-endmenu
-
-source "net/Kconfig"
-
-source drivers/Kconfig
-
-source "drivers/firmware/Kconfig"
-
-source fs/Kconfig
-
-source "kernel/Kconfig.instrumentation"
-
-source "arch/x86/Kconfig.debug"
-
-source "security/Kconfig"
-
-source "crypto/Kconfig"
-
-source "lib/Kconfig"
index 309597386a77c7811ea3bc594084d5deec6a5d9c..7aa1dc6d67c88f73067ff4be2ab6bf7ee204c9c1 100644 (file)
@@ -1,16 +1,19 @@
 # Unified Makefile for i386 and x86_64
 
 # select defconfig based on actual architecture
-KBUILD_DEFCONFIG := $(ARCH)_defconfig
+ifeq ($(ARCH),x86)
+        KBUILD_DEFCONFIG := i386_defconfig
+else
+        KBUILD_DEFCONFIG := $(ARCH)_defconfig
+endif
 
-# No need to remake these files
+# No need to remake these files
 $(srctree)/arch/x86/Makefile%: ;
 
-ifeq ($(ARCH),i386)
+ifeq ($(CONFIG_X86_32),y)
+        UTS_MACHINE := i386
         include $(srctree)/arch/x86/Makefile_32
 else
+        UTS_MACHINE := x86_64
         include $(srctree)/arch/x86/Makefile_64
 endif
-
-
-
index 346ac07668758f2beb24450d942c039451b01056..50394da2f6c122da4bac4234a4c6ad41d7dc83e3 100644 (file)
@@ -160,7 +160,7 @@ archclean:
        $(Q)$(MAKE) $(clean)=arch/x86/boot
 
 define archhelp
-  echo  '* bzImage     - Compressed kernel image (arch/$(ARCH)/boot/bzImage)'
+  echo  '* bzImage     - Compressed kernel image (arch/x86/boot/bzImage)'
   echo  '  install     - Install kernel using'
   echo  '                 (your) ~/bin/installkernel or'
   echo  '                 (distribution) /sbin/installkernel or'
@@ -170,6 +170,6 @@ define archhelp
   echo  '  isoimage     - Create a boot CD-ROM image'
 endef
 
-CLEAN_FILES += arch/$(ARCH)/boot/fdimage \
-              arch/$(ARCH)/boot/image.iso \
-              arch/$(ARCH)/boot/mtools.conf
+CLEAN_FILES += arch/x86/boot/fdimage \
+              arch/x86/boot/image.iso \
+              arch/x86/boot/mtools.conf
index 57e714a47af7aff0e78512860c9a004db49c1d5f..a804860022e65a7ec6c5f71a81b7011d0cee6852 100644 (file)
@@ -127,7 +127,7 @@ archclean:
        $(Q)$(MAKE) $(clean)=$(boot)
 
 define archhelp
-  echo  '* bzImage     - Compressed kernel image (arch/$(ARCH)/boot/bzImage)'
+  echo  '* bzImage     - Compressed kernel image (arch/x86/boot/bzImage)'
   echo  '  install     - Install kernel using'
   echo  '                 (your) ~/bin/installkernel or'
   echo  '                 (distribution) /sbin/installkernel or'
@@ -137,8 +137,8 @@ define archhelp
   echo  '  isoimage     - Create a boot CD-ROM image'
 endef
 
-CLEAN_FILES += arch/$(ARCH)/boot/fdimage \
-              arch/$(ARCH)/boot/image.iso \
-              arch/$(ARCH)/boot/mtools.conf
+CLEAN_FILES += arch/x86/boot/fdimage \
+              arch/x86/boot/image.iso \
+              arch/x86/boot/mtools.conf
 
 
index 89dbf970e058c845e676f8b2be9efc65dcbdfe84..7a3116ccf3878d6e3212f8d4e346a3ceef912e8b 100644 (file)
@@ -49,10 +49,10 @@ HOSTCFLAGS_build.o := $(LINUXINCLUDE)
 
 # How to compile the 16-bit code.  Note we always compile for -march=i386,
 # that way we can complain to the user if the CPU is insufficient.
-cflags-i386   := 
-cflags-x86_64 := -m32
+cflags-$(CONFIG_X86_32) :=
+cflags-$(CONFIG_X86_64) := -m32
 KBUILD_CFLAGS  := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \
-                  $(cflags-$(ARCH)) \
+                  $(cflags-y) \
                   -Wall -Wstrict-prototypes \
                   -march=i386 -mregparm=3 \
                   -include $(srctree)/$(src)/code16gcc.h \
index a0ae2e7f6cecbcf0c0311a0ce6029408fd350268..036e635f18a3f14391fa39033fb70d37f8cad8d2 100644 (file)
        .globl startup_32
 
 startup_32:
-       /* check to see if KEEP_SEGMENTS flag is meaningful */
-       cmpw $0x207, BP_version(%esi)
-       jb 1f
-
+       cld
        /* test KEEP_SEGMENTS flag to see if the bootloader is asking
         * us to not reload segments */
        testb $(1<<6), BP_loadflags(%esi)
-       jnz 2f
+       jnz 1f
 
-1:     cli
+       cli
        movl $(__BOOT_DS),%eax
        movl %eax,%ds
        movl %eax,%es
        movl %eax,%fs
        movl %eax,%gs
        movl %eax,%ss
-
-2:     cld
+1:
 
 /* Calculate the delta between where we were compiled to run
  * at and where we were actually loaded at.  This can only be done
index 49467640751fc0eb0a67c96ca7e9fa0b3d973fb0..1ccb38a7f0d2c72610c906bf89d5c142a97e9229 100644 (file)
@@ -29,6 +29,7 @@
 #include <asm/pgtable.h>
 #include <asm/page.h>
 #include <asm/msr.h>
+#include <asm/asm-offsets.h>
 
 .section ".text.head"
        .code32
 
 startup_32:
        cld
+       /* test KEEP_SEGMENTS flag to see if the bootloader is asking
+        * us to not reload segments */
+       testb $(1<<6), BP_loadflags(%esi)
+       jnz 1f
+
        cli
        movl    $(__KERNEL_DS), %eax
        movl    %eax, %ds
        movl    %eax, %es
        movl    %eax, %ss
+1:
 
 /* Calculate the delta between where we were compiled to run
  * at and where we were actually loaded at.  This can only be done
index e655a89c5510fc929f787680811eb9ae981a03e1..769065bd23d776dc6c96a171f87b7071fd3719a6 100644 (file)
@@ -42,13 +42,7 @@ static struct cpu_features cpu;
 static u32 cpu_vendor[3];
 static u32 err_flags[NCAPINTS];
 
-#ifdef CONFIG_X86_64
-static const int req_level = 64;
-#elif defined(CONFIG_X86_MINIMUM_CPU_FAMILY)
 static const int req_level = CONFIG_X86_MINIMUM_CPU_FAMILY;
-#else
-static const int req_level = 3;
-#endif
 
 static const u32 req_flags[NCAPINTS] =
 {
index 2e559233725a453845d03e19179e8620399f15ce..fa6bed1fac14862b86936f1bc45af5c9b64aa7cf 100644 (file)
  * void protected_mode_jump(u32 entrypoint, u32 bootparams);
  */
 protected_mode_jump:
-       xorl    %ebx, %ebx              # Flag to indicate this is a boot
        movl    %edx, %esi              # Pointer to boot_params table
        movl    %eax, 2f                # Patch ljmpl instruction
-       jmp     1f                      # Short jump to flush instruction q.
 
-1:
        movw    $__BOOT_DS, %cx
+       xorl    %ebx, %ebx              # Per the 32-bit boot protocol
+       xorl    %ebp, %ebp              # Per the 32-bit boot protocol
+       xorl    %edi, %edi              # Per the 32-bit boot protocol
 
        movl    %cr0, %edx
        orb     $1, %dl                 # Protected mode (PE) bit
        movl    %edx, %cr0
+       jmp     1f                      # Short jump to serialize on 386/486
+1:
 
        movw    %cx, %ds
        movw    %cx, %es
index b091c5e35558c1daedf34688e296c08166f85f60..38a83f9c966ff252be2218a53fae5d65c8b41d24 100644 (file)
@@ -170,7 +170,7 @@ CONFIG_HOTPLUG_CPU=y
 CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
 CONFIG_HPET_TIMER=y
 CONFIG_HPET_EMULATE_RTC=y
-CONFIG_IOMMU=y
+CONFIG_GART_IOMMU=y
 # CONFIG_CALGARY_IOMMU is not set
 CONFIG_SWIOTLB=y
 CONFIG_X86_MCE=y
index 18b23181090808b953f91568d6183345b8028fd1..df588f0f76e1c9c3d8027a3baced0089de612832 100644 (file)
@@ -159,20 +159,16 @@ sysenter_do_call:
 
 sysenter_tracesys:
        CFI_RESTORE_STATE
+       xchgl   %r9d,%ebp
        SAVE_REST
        CLEAR_RREGS
+       movq    %r9,R9(%rsp)
        movq    $-ENOSYS,RAX(%rsp)      /* really needed? */
        movq    %rsp,%rdi        /* &pt_regs -> arg1 */
        call    syscall_trace_enter
        LOAD_ARGS32 ARGOFFSET  /* reload args from stack in case ptrace changed it */
        RESTORE_REST
-       movl    %ebp, %ebp
-       /* no need to do an access_ok check here because rbp has been
-          32bit zero extended */ 
-1:     movl    (%rbp),%r9d
-       .section __ex_table,"a"
-       .quad 1b,ia32_badarg
-       .previous
+       xchgl   %ebp,%r9d
        jmp     sysenter_do_call
        CFI_ENDPROC
 ENDPROC(ia32_sysenter_target)
@@ -262,20 +258,17 @@ cstar_do_call:
        
 cstar_tracesys:        
        CFI_RESTORE_STATE
+       xchgl %r9d,%ebp
        SAVE_REST
        CLEAR_RREGS
+       movq %r9,R9(%rsp)
        movq $-ENOSYS,RAX(%rsp) /* really needed? */
        movq %rsp,%rdi        /* &pt_regs -> arg1 */
        call syscall_trace_enter
        LOAD_ARGS32 ARGOFFSET  /* reload args from stack in case ptrace changed it */
        RESTORE_REST
+       xchgl %ebp,%r9d
        movl RSP-ARGOFFSET(%rsp), %r8d
-       /* no need to do an access_ok check here because r8 has been
-          32bit zero extended */ 
-1:     movl    (%r8),%r9d
-       .section __ex_table,"a"
-       .quad 1b,ia32_badarg
-       .previous
        jmp cstar_do_call
 END(ia32_cstar_target)
                                
index f52770ef0ee3efea18ca5b44ebbee95117e42f91..4a233ad6269cce1f2e7408af2137f9e8e92ba39a 100644 (file)
@@ -228,8 +228,6 @@ static long ptrace32_siginfo(unsigned request, u32 pid, u32 addr, u32 data)
        return ret;
 }
 
-#define COMPAT_GDT_ENTRY_TLS_MIN 6
-
 asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data)
 {
        struct task_struct *child;
@@ -248,6 +246,8 @@ asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data)
        case PTRACE_SYSCALL:
        case PTRACE_OLDSETOPTIONS:
        case PTRACE_SETOPTIONS:
+       case PTRACE_SET_THREAD_AREA:
+       case PTRACE_GET_THREAD_AREA:
                return sys_ptrace(request, pid, addr, data); 
 
        default:
@@ -271,12 +271,6 @@ asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data)
        case PTRACE_SETSIGINFO:
        case PTRACE_GETSIGINFO:
                return ptrace32_siginfo(request, pid, addr, data);
-
-       case PTRACE_SET_THREAD_AREA:
-       case PTRACE_GET_THREAD_AREA:
-               return sys_ptrace(request, pid,
-                       addr + GDT_ENTRY_TLS_MIN - COMPAT_GDT_ENTRY_TLS_MIN,
-                       data);
        }
 
        child = ptrace_get_task_struct(pid);
index b9d679820306d10d69078d14d7cb18cfbec33c26..a7bc93c27662f058711fe5349acb44cd08876bf1 100644 (file)
@@ -3,6 +3,7 @@
 #
 
 extra-y := head_32.o init_task.o vmlinux.lds
+CPPFLAGS_vmlinux.lds += -Ui386
 
 obj-y  := process_32.o signal_32.o entry_32.o traps_32.o irq_32.o \
                ptrace_32.o time_32.o ioport_32.o ldt_32.o setup_32.o i8259_32.o sys_i386_32.o \
@@ -60,7 +61,7 @@ quiet_cmd_syscall = SYSCALL $@
       cmd_syscall = $(CC) -m elf_i386 -nostdlib $(SYSCFLAGS_$(@F)) \
                          -Wl,-T,$(filter-out FORCE,$^) -o $@
 
-export CPPFLAGS_vsyscall_32.lds += -P -C -U$(ARCH)
+export CPPFLAGS_vsyscall_32.lds += -P -C -Ui386
 
 vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 \
                 $(call ld-option, -Wl$(comma)--hash-style=sysv)
index 466337ae9a1e675e313cf9cc3d9b2e6bd8d37b3f..5a88890d8ee9a4561c956bbd4b6f293c9933cb8f 100644 (file)
@@ -3,7 +3,9 @@
 #
 
 extra-y        := head_64.o head64.o init_task.o vmlinux.lds
+CPPFLAGS_vmlinux.lds += -Ux86_64
 EXTRA_AFLAGS   := -traditional
+
 obj-y  := process_64.o signal_64.o entry_64.o traps_64.o irq_64.o \
                ptrace_64.o time_64.o ioport_64.o ldt_64.o setup_64.o i8259_64.o sys_x86_64.o \
                x8664_ksyms_64.o i387_64.o syscall_64.o vsyscall_64.o \
@@ -25,7 +27,7 @@ obj-$(CONFIG_CRASH_DUMP)      += crash_dump_64.o
 obj-$(CONFIG_PM)               += suspend_64.o
 obj-$(CONFIG_HIBERNATION)      += suspend_asm_64.o
 obj-$(CONFIG_EARLY_PRINTK)     += early_printk.o
-obj-$(CONFIG_IOMMU)            += pci-gart_64.o aperture_64.o
+obj-$(CONFIG_GART_IOMMU)       += pci-gart_64.o aperture_64.o
 obj-$(CONFIG_CALGARY_IOMMU)    += pci-calgary_64.o tce_64.o
 obj-$(CONFIG_SWIOTLB)          += pci-swiotlb_64.o
 obj-$(CONFIG_KPROBES)          += kprobes_64.o
index 289247d974c60fe77ed4b989a2a2634734392ab9..0ca27c7b0e8db00335d47dc158557bf4915aede6 100644 (file)
@@ -637,6 +637,38 @@ static int __init acpi_parse_hpet(struct acpi_table_header *table)
        }
 
        hpet_address = hpet_tbl->address.address;
+
+       /*
+        * Some broken BIOSes advertise HPET at 0x0. We really do not
+        * want to allocate a resource there.
+        */
+       if (!hpet_address) {
+               printk(KERN_WARNING PREFIX
+                      "HPET id: %#x base: %#lx is invalid\n",
+                      hpet_tbl->id, hpet_address);
+               return 0;
+       }
+#ifdef CONFIG_X86_64
+       /*
+        * Some even more broken BIOSes advertise HPET at
+        * 0xfed0000000000000 instead of 0xfed00000. Fix it up and add
+        * some noise:
+        */
+       if (hpet_address == 0xfed0000000000000UL) {
+               if (!hpet_force_user) {
+                       printk(KERN_WARNING PREFIX "HPET id: %#x "
+                              "base: 0xfed0000000000000 is bogus\n "
+                              "try hpet=force on the kernel command line to "
+                              "fix it up to 0xfed00000.\n", hpet_tbl->id);
+                       hpet_address = 0;
+                       return 0;
+               }
+               printk(KERN_WARNING PREFIX
+                      "HPET id: %#x base: 0xfed0000000000000 fixed up "
+                      "to 0xfed00000.\n", hpet_tbl->id);
+               hpet_address >>= 32;
+       }
+#endif
        printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n",
               hpet_tbl->id, hpet_address);
 
index 2ed0a4ce62f02ebc77750fe11adec66e7e6f9f8e..a25db514c719ef939bbb9e8069339a50e39c4dbc 100644 (file)
@@ -49,6 +49,9 @@ static void init_intel_pdc(struct acpi_processor *pr, struct cpuinfo_x86 *c)
        if (cpu_has(c, X86_FEATURE_EST))
                buf[2] |= ACPI_PDC_EST_CAPABILITY_SWSMP;
 
+       if (cpu_has(c, X86_FEATURE_ACPI))
+               buf[2] |= ACPI_PDC_T_FFH;
+
        obj->type = ACPI_TYPE_BUFFER;
        obj->buffer.length = 12;
        obj->buffer.pointer = (u8 *) buf;
@@ -62,8 +65,7 @@ static void init_intel_pdc(struct acpi_processor *pr, struct cpuinfo_x86 *c)
 /* Initialize _PDC data based on the CPU vendor */
 void arch_acpi_processor_init_pdc(struct acpi_processor *pr)
 {
-       unsigned int cpu = pr->id;
-       struct cpuinfo_x86 *c = &cpu_data(cpu);
+       struct cpuinfo_x86 *c = &cpu_data(pr->id);
 
        pr->pdc = NULL;
        if (c->x86_vendor == X86_VENDOR_INTEL)
index 79475d2370713a96cff45a1cc5aada1a4eedc093..da42de261ba8d7b4394b319a46aa04ebea5dbeea 100644 (file)
@@ -115,6 +115,3 @@ static int __init acpi_sleep_setup(char *str)
 
 __setup("acpi_sleep=", acpi_sleep_setup);
 
-void acpi_pci_link_exit(void)
-{
-}
index 8f681cae7bf7df3c8a6749799d1d5b2f14682170..5b6992799c9d20882bab7fd1efa0f0772ad77243 100644 (file)
 #include <linux/ioport.h>
 #include <asm/e820.h>
 #include <asm/io.h>
-#include <asm/iommu.h>
+#include <asm/gart.h>
 #include <asm/pci-direct.h>
 #include <asm/dma.h>
 #include <asm/k8.h>
 
-int iommu_aperture;
-int iommu_aperture_disabled __initdata = 0;
-int iommu_aperture_allowed __initdata = 0;
+int gart_iommu_aperture;
+int gart_iommu_aperture_disabled __initdata = 0;
+int gart_iommu_aperture_allowed __initdata = 0;
 
 int fallback_aper_order __initdata = 1; /* 64MB */
 int fallback_aper_force __initdata = 0; 
@@ -204,14 +204,15 @@ static __u32 __init search_agp_bridge(u32 *order, int *valid_agp)
        return 0;
 }
 
-void __init iommu_hole_init(void) 
+void __init gart_iommu_hole_init(void)
 { 
        int fix, num; 
        u32 aper_size, aper_alloc = 0, aper_order = 0, last_aper_order = 0;
        u64 aper_base, last_aper_base = 0;
        int valid_agp = 0;
 
-       if (iommu_aperture_disabled || !fix_aperture || !early_pci_allowed())
+       if (gart_iommu_aperture_disabled || !fix_aperture ||
+           !early_pci_allowed())
                return;
 
        printk(KERN_INFO  "Checking aperture...\n");
@@ -222,7 +223,7 @@ void __init iommu_hole_init(void)
                        continue;
 
                iommu_detected = 1;
-               iommu_aperture = 1; 
+               gart_iommu_aperture = 1;
 
                aper_order = (read_pci_config(0, num, 3, 0x90) >> 1) & 7; 
                aper_size = (32 * 1024 * 1024) << aper_order; 
index 08b07c176962f9c525d402adf5609d5c7c64f771..96986b46bc856844a8bed97a8b8a871293df92e8 100644 (file)
@@ -789,7 +789,7 @@ void __init sync_Arb_IDs(void)
         * Unsupported on P4 - see Intel Dev. Manual Vol. 3, Ch. 8.6.1 And not
         * needed on AMD.
         */
-       if (modern_apic())
+       if (modern_apic() || boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
                return;
        /*
         * Wait for idle.
index 7e50bda565b4ac09907b07d09ca4e0586d29ce44..d1b6ed98774e3f635aaaef7ec16d84ffde1fefa7 100644 (file)
 #include <asm/segment.h>
 #include <asm/thread_info.h>
 #include <asm/ia32.h>
+#include <asm/bootparam.h>
 
 #define DEFINE(sym, val) \
         asm volatile("\n->" #sym " %0 " #val : : "i" (val))
 
 #define BLANK() asm volatile("\n->" : : )
 
+#define OFFSET(sym, str, mem) \
+       DEFINE(sym, offsetof(struct str, mem))
+
 #define __NO_STUBS 1
 #undef __SYSCALL
 #undef _ASM_X86_64_UNISTD_H_
@@ -109,5 +113,11 @@ int main(void)
        DEFINE(crypto_tfm_ctx_offset, offsetof(struct crypto_tfm, __crt_ctx));
        BLANK();
        DEFINE(__NR_syscall_max, sizeof(syscalls) - 1);
+
+       BLANK();
+       OFFSET(BP_scratch, boot_params, scratch);
+       OFFSET(BP_loadflags, boot_params, hdr.loadflags);
+       OFFSET(BP_hardware_subarch, boot_params, hdr.hardware_subarch);
+       OFFSET(BP_version, boot_params, hdr.version);
        return 0;
 }
similarity index 77%
rename from arch/x86/kernel/cpu/cpufreq/Kconfig_32
rename to arch/x86/kernel/cpu/cpufreq/Kconfig
index d8c6f132dc7a1f7ca95306e2e15ab2536f5966f1..151eda0a23fc40be379c71b409b6cf846d0d3e2f 100644 (file)
@@ -19,6 +19,9 @@ config X86_ACPI_CPUFREQ
          Processor Performance States.
          This driver also supports Intel Enhanced Speedstep.
 
+         To compile this driver as a module, choose M here: the
+         module will be called acpi-cpufreq.
+
          For details, take a look at <file:Documentation/cpu-freq/>.
 
          If in doubt, say N.
@@ -26,7 +29,7 @@ config X86_ACPI_CPUFREQ
 config ELAN_CPUFREQ
        tristate "AMD Elan SC400 and SC410"
        select CPU_FREQ_TABLE
-       depends on X86_ELAN
+       depends on X86_32 && X86_ELAN
        ---help---
          This adds the CPUFreq driver for AMD Elan SC400 and SC410
          processors.
@@ -42,7 +45,7 @@ config ELAN_CPUFREQ
 config SC520_CPUFREQ
        tristate "AMD Elan SC520"
        select CPU_FREQ_TABLE
-       depends on X86_ELAN
+       depends on X86_32 && X86_ELAN
        ---help---
          This adds the CPUFreq driver for AMD Elan SC520 processor.
 
@@ -54,6 +57,7 @@ config SC520_CPUFREQ
 config X86_POWERNOW_K6
        tristate "AMD Mobile K6-2/K6-3 PowerNow!"
        select CPU_FREQ_TABLE
+       depends on X86_32
        help
          This adds the CPUFreq driver for mobile AMD K6-2+ and mobile
          AMD K6-3+ processors.
@@ -65,6 +69,7 @@ config X86_POWERNOW_K6
 config X86_POWERNOW_K7
        tristate "AMD Mobile Athlon/Duron PowerNow!"
        select CPU_FREQ_TABLE
+       depends on X86_32
        help
          This adds the CPUFreq driver for mobile AMD K7 mobile processors.
 
@@ -76,23 +81,27 @@ config X86_POWERNOW_K7_ACPI
        bool
        depends on X86_POWERNOW_K7 && ACPI_PROCESSOR
        depends on !(X86_POWERNOW_K7 = y && ACPI_PROCESSOR = m)
+       depends on X86_32
        default y
 
 config X86_POWERNOW_K8
        tristate "AMD Opteron/Athlon64 PowerNow!"
        select CPU_FREQ_TABLE
-       depends on EXPERIMENTAL
        help
          This adds the CPUFreq driver for mobile AMD Opteron/Athlon64 processors.
 
+         To compile this driver as a module, choose M here: the
+         module will be called powernow-k8.
+
          For details, take a look at <file:Documentation/cpu-freq/>.
 
          If in doubt, say N.
 
 config X86_POWERNOW_K8_ACPI
-       bool "ACPI Support"
-       select ACPI_PROCESSOR
-       depends on ACPI && X86_POWERNOW_K8
+       bool
+       prompt "ACPI Support" if X86_32
+       depends on ACPI && X86_POWERNOW_K8 && ACPI_PROCESSOR
+       depends on !(X86_POWERNOW_K8 = y && ACPI_PROCESSOR = m)
        default y
        help
          This provides access to the K8s Processor Performance States via ACPI.
@@ -104,7 +113,7 @@ config X86_POWERNOW_K8_ACPI
 
 config X86_GX_SUSPMOD
        tristate "Cyrix MediaGX/NatSemi Geode Suspend Modulation"
-       depends on PCI
+       depends on X86_32 && PCI
        help
         This add the CPUFreq driver for NatSemi Geode processors which
         support suspend modulation.
@@ -114,15 +123,20 @@ config X86_GX_SUSPMOD
         If in doubt, say N.
 
 config X86_SPEEDSTEP_CENTRINO
-       tristate "Intel Enhanced SpeedStep"
+       tristate "Intel Enhanced SpeedStep (deprecated)"
        select CPU_FREQ_TABLE
-       select X86_SPEEDSTEP_CENTRINO_TABLE
+       select X86_SPEEDSTEP_CENTRINO_TABLE if X86_32
+       depends on X86_32 || (X86_64 && ACPI_PROCESSOR)
        help
+         This is deprecated and this functionality is now merged into
+         acpi_cpufreq (X86_ACPI_CPUFREQ). Use that driver instead of
+         speedstep_centrino.
          This adds the CPUFreq driver for Enhanced SpeedStep enabled
-         mobile CPUs.  This means Intel Pentium M (Centrino) CPUs. However,
-         you also need to say Y to "Use ACPI tables to decode..." below
-         [which might imply enabling ACPI] if you want to use this driver
-         on non-Banias CPUs.
+         mobile CPUs.  This means Intel Pentium M (Centrino) CPUs
+         or 64bit enabled Intel Xeons.
+
+         To compile this driver as a module, choose M here: the
+         module will be called speedstep-centrino.
 
          For details, take a look at <file:Documentation/cpu-freq/>.
 
@@ -130,7 +144,7 @@ config X86_SPEEDSTEP_CENTRINO
 
 config X86_SPEEDSTEP_CENTRINO_TABLE
        bool "Built-in tables for Banias CPUs"
-       depends on X86_SPEEDSTEP_CENTRINO
+       depends on X86_32 && X86_SPEEDSTEP_CENTRINO
        default y
        help
          Use built-in tables for Banias CPUs if ACPI encoding
@@ -141,6 +155,7 @@ config X86_SPEEDSTEP_CENTRINO_TABLE
 config X86_SPEEDSTEP_ICH
        tristate "Intel Speedstep on ICH-M chipsets (ioport interface)"
        select CPU_FREQ_TABLE
+       depends on X86_32
        help
          This adds the CPUFreq driver for certain mobile Intel Pentium III
          (Coppermine), all mobile Intel Pentium III-M (Tualatin) and all
@@ -154,7 +169,7 @@ config X86_SPEEDSTEP_ICH
 config X86_SPEEDSTEP_SMI
        tristate "Intel SpeedStep on 440BX/ZX/MX chipsets (SMI interface)"
        select CPU_FREQ_TABLE
-       depends on EXPERIMENTAL
+       depends on X86_32 && EXPERIMENTAL
        help
          This adds the CPUFreq driver for certain mobile Intel Pentium III
          (Coppermine), all mobile Intel Pentium III-M (Tualatin)
@@ -169,15 +184,24 @@ config X86_P4_CLOCKMOD
        select CPU_FREQ_TABLE
        help
          This adds the CPUFreq driver for Intel Pentium 4 / XEON
-         processors.
+         processors.  When enabled it will lower CPU temperature by skipping
+         clocks.
+
+         This driver should be only used in exceptional
+         circumstances when very low power is needed because it causes severe
+         slowdowns and noticeable latencies.  Normally Speedstep should be used
+         instead.
+
+         To compile this driver as a module, choose M here: the
+         module will be called p4-clockmod.
 
          For details, take a look at <file:Documentation/cpu-freq/>.
 
-         If in doubt, say N.
+         Unless you are absolutely sure say N.
 
 config X86_CPUFREQ_NFORCE2
        tristate "nVidia nForce2 FSB changing"
-       depends on EXPERIMENTAL
+       depends on X86_32 && EXPERIMENTAL
        help
          This adds the CPUFreq driver for FSB changing on nVidia nForce2
          platforms.
@@ -188,6 +212,7 @@ config X86_CPUFREQ_NFORCE2
 
 config X86_LONGRUN
        tristate "Transmeta LongRun"
+       depends on X86_32
        help
          This adds the CPUFreq driver for Transmeta Crusoe and Efficeon processors
          which support LongRun.
@@ -199,7 +224,7 @@ config X86_LONGRUN
 config X86_LONGHAUL
        tristate "VIA Cyrix III Longhaul"
        select CPU_FREQ_TABLE
-       depends on ACPI_PROCESSOR
+       depends on X86_32 && ACPI_PROCESSOR
        help
          This adds the CPUFreq driver for VIA Samuel/CyrixIII,
          VIA Cyrix Samuel/C3, VIA Cyrix Ezra and VIA Cyrix Ezra-T
@@ -212,7 +237,7 @@ config X86_LONGHAUL
 config X86_E_POWERSAVER
        tristate "VIA C7 Enhanced PowerSaver (EXPERIMENTAL)"
        select CPU_FREQ_TABLE
-       depends on EXPERIMENTAL
+       depends on X86_32 && EXPERIMENTAL
        help
          This adds the CPUFreq driver for VIA C7 processors.
 
@@ -233,11 +258,11 @@ config X86_ACPI_CPUFREQ_PROC_INTF
 
 config X86_SPEEDSTEP_LIB
        tristate
-       default X86_SPEEDSTEP_ICH || X86_SPEEDSTEP_SMI || X86_P4_CLOCKMOD
+       default (X86_SPEEDSTEP_ICH || X86_SPEEDSTEP_SMI || X86_P4_CLOCKMOD)
 
 config X86_SPEEDSTEP_RELAXED_CAP_CHECK
        bool "Relaxed speedstep capability checks"
-       depends on (X86_SPEEDSTEP_SMI || X86_SPEEDSTEP_ICH)
+       depends on X86_32 && (X86_SPEEDSTEP_SMI || X86_SPEEDSTEP_ICH)
        help
          Don't perform all checks for a speedstep capable system which would
          normally be done. Some ancient or strange systems, though speedstep
diff --git a/arch/x86/kernel/cpu/cpufreq/Kconfig_64 b/arch/x86/kernel/cpu/cpufreq/Kconfig_64
deleted file mode 100644 (file)
index 9c9699f..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-#
-# CPU Frequency scaling
-#
-
-menu "CPU Frequency scaling"
-
-source "drivers/cpufreq/Kconfig"
-
-if CPU_FREQ
-
-comment "CPUFreq processor drivers"
-
-config X86_POWERNOW_K8
-       tristate "AMD Opteron/Athlon64 PowerNow!"
-       select CPU_FREQ_TABLE
-       help
-         This adds the CPUFreq driver for mobile AMD Opteron/Athlon64 processors.
-
-         To compile this driver as a module, choose M here: the
-         module will be called powernow-k8.
-
-         For details, take a look at <file:Documentation/cpu-freq/>.
-
-         If in doubt, say N.
-
-config X86_POWERNOW_K8_ACPI
-       bool
-       depends on X86_POWERNOW_K8 && ACPI_PROCESSOR
-       depends on !(X86_POWERNOW_K8 = y && ACPI_PROCESSOR = m)
-       default y
-
-config X86_SPEEDSTEP_CENTRINO
-       tristate "Intel Enhanced SpeedStep (deprecated)"
-       select CPU_FREQ_TABLE
-       depends on ACPI_PROCESSOR
-       help
-         This is deprecated and this functionality is now merged into
-         acpi_cpufreq (X86_ACPI_CPUFREQ). Use that driver instead of
-         speedstep_centrino.
-         This adds the CPUFreq driver for Enhanced SpeedStep enabled
-         mobile CPUs.  This means Intel Pentium M (Centrino) CPUs
-         or 64bit enabled Intel Xeons.
-
-         To compile this driver as a module, choose M here: the
-         module will be called speedstep-centrino.
-
-         For details, take a look at <file:Documentation/cpu-freq/>.
-
-         If in doubt, say N.
-
-config X86_ACPI_CPUFREQ
-       tristate "ACPI Processor P-States driver"
-       select CPU_FREQ_TABLE
-       depends on ACPI_PROCESSOR
-       help
-         This driver adds a CPUFreq driver which utilizes the ACPI
-         Processor Performance States.
-         This driver also supports Intel Enhanced Speedstep.
-
-         To compile this driver as a module, choose M here: the
-         module will be called acpi-cpufreq.
-
-         For details, take a look at <file:Documentation/cpu-freq/>.
-
-         If in doubt, say N.
-
-comment "shared options"
-
-config X86_ACPI_CPUFREQ_PROC_INTF
-       bool "/proc/acpi/processor/../performance interface (deprecated)"
-       depends on PROC_FS
-       depends on X86_ACPI_CPUFREQ || X86_POWERNOW_K8_ACPI
-       help
-         This enables the deprecated /proc/acpi/processor/../performance
-         interface. While it is helpful for debugging, the generic,
-         cross-architecture cpufreq interfaces should be used.
-
-         If in doubt, say N.
-
-config X86_P4_CLOCKMOD
-       tristate "Intel Pentium 4 clock modulation"
-       depends on EMBEDDED
-       select CPU_FREQ_TABLE
-       help
-         This adds the clock modulation driver for Intel Pentium 4 / XEON
-         processors.  When enabled it will lower CPU temperature by skipping
-         clocks.
-
-         This driver should be only used in exceptional
-         circumstances when very low power is needed because it causes severe
-         slowdowns and noticeable latencies.  Normally Speedstep should be used
-         instead.
-
-         To compile this driver as a module, choose M here: the
-         module will be called p4-clockmod.
-
-         For details, take a look at <file:Documentation/cpu-freq/>.
-
-         Unless you are absolutely sure say N.
-
-
-config X86_SPEEDSTEP_LIB
-       tristate
-       default X86_P4_CLOCKMOD
-
-endif
-
-endmenu
index 9c36a53676b770830e1efffb5770788d34ab2ee4..99e1ef9939bec24bc210791eecc6f23f328c24ae 100644 (file)
@@ -46,7 +46,7 @@
 
 #define PFX "powernow-k8: "
 #define BFX PFX "BIOS error: "
-#define VERSION "version 2.00.00"
+#define VERSION "version 2.20.00"
 #include "powernow-k8.h"
 
 /* serialize freq changes  */
@@ -73,33 +73,11 @@ static u32 find_khz_freq_from_fid(u32 fid)
        return 1000 * find_freq_from_fid(fid);
 }
 
-/* Return a frequency in MHz, given an input fid and did */
-static u32 find_freq_from_fiddid(u32 fid, u32 did)
+static u32 find_khz_freq_from_pstate(struct cpufreq_frequency_table *data, u32 pstate)
 {
-       if (current_cpu_data.x86 == 0x10)
-               return 100 * (fid + 0x10) >> did;
-       else
-               return 100 * (fid + 0x8) >> did;
-}
-
-static u32 find_khz_freq_from_fiddid(u32 fid, u32 did)
-{
-       return 1000 * find_freq_from_fiddid(fid, did);
-}
-
-static u32 find_fid_from_pstate(u32 pstate)
-{
-       u32 hi, lo;
-       rdmsr(MSR_PSTATE_DEF_BASE + pstate, lo, hi);
-       return lo & HW_PSTATE_FID_MASK;
+       return data[pstate].frequency;
 }
 
-static u32 find_did_from_pstate(u32 pstate)
-{
-       u32 hi, lo;
-       rdmsr(MSR_PSTATE_DEF_BASE + pstate, lo, hi);
-       return (lo & HW_PSTATE_DID_MASK) >> HW_PSTATE_DID_SHIFT;
-}
 
 /* Return the vco fid for an input fid
  *
@@ -142,9 +120,7 @@ static int query_current_values_with_pending_wait(struct powernow_k8_data *data)
        if (cpu_family == CPU_HW_PSTATE) {
                rdmsr(MSR_PSTATE_STATUS, lo, hi);
                i = lo & HW_PSTATE_MASK;
-               rdmsr(MSR_PSTATE_DEF_BASE + i, lo, hi);
-               data->currfid = lo & HW_PSTATE_FID_MASK;
-               data->currdid = (lo & HW_PSTATE_DID_MASK) >> HW_PSTATE_DID_SHIFT;
+               data->currpstate = i;
                return 0;
        }
        do {
@@ -295,7 +271,7 @@ static int decrease_vid_code_by_step(struct powernow_k8_data *data, u32 reqvid,
 static int transition_pstate(struct powernow_k8_data *data, u32 pstate)
 {
        wrmsr(MSR_PSTATE_CTRL, pstate, 0);
-       data->currfid = find_fid_from_pstate(pstate);
+       data->currpstate = pstate;
        return 0;
 }
 
@@ -845,17 +821,20 @@ err_out:
 static int fill_powernow_table_pstate(struct powernow_k8_data *data, struct cpufreq_frequency_table *powernow_table)
 {
        int i;
+       u32 hi = 0, lo = 0;
+       rdmsr(MSR_PSTATE_CUR_LIMIT, hi, lo);
+       data->max_hw_pstate = (hi & HW_PSTATE_MAX_MASK) >> HW_PSTATE_MAX_SHIFT;
 
        for (i = 0; i < data->acpi_data.state_count; i++) {
                u32 index;
                u32 hi = 0, lo = 0;
-               u32 fid;
-               u32 did;
 
                index = data->acpi_data.states[i].control & HW_PSTATE_MASK;
-               if (index > MAX_HW_PSTATE) {
+               if (index > data->max_hw_pstate) {
                        printk(KERN_ERR PFX "invalid pstate %d - bad value %d.\n", i, index);
                        printk(KERN_ERR PFX "Please report to BIOS manufacturer\n");
+                       powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID;
+                       continue;
                }
                rdmsr(MSR_PSTATE_DEF_BASE + index, lo, hi);
                if (!(hi & HW_PSTATE_VALID_MASK)) {
@@ -864,22 +843,9 @@ static int fill_powernow_table_pstate(struct powernow_k8_data *data, struct cpuf
                        continue;
                }
 
-               fid = lo & HW_PSTATE_FID_MASK;
-               did = (lo & HW_PSTATE_DID_MASK) >> HW_PSTATE_DID_SHIFT;
+               powernow_table[i].index = index;
 
-               dprintk("   %d : fid 0x%x, did 0x%x\n", index, fid, did);
-
-               powernow_table[i].index = index | (fid << HW_FID_INDEX_SHIFT) | (did << HW_DID_INDEX_SHIFT);
-
-               powernow_table[i].frequency = find_khz_freq_from_fiddid(fid, did);
-
-               if (powernow_table[i].frequency != (data->acpi_data.states[i].core_frequency * 1000)) {
-                       printk(KERN_INFO PFX "invalid freq entries %u kHz vs. %u kHz\n",
-                               powernow_table[i].frequency,
-                               (unsigned int) (data->acpi_data.states[i].core_frequency * 1000));
-                       powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID;
-                       continue;
-               }
+               powernow_table[i].frequency = data->acpi_data.states[i].core_frequency * 1000;
        }
        return 0;
 }
@@ -1020,22 +986,18 @@ static int transition_frequency_fidvid(struct powernow_k8_data *data, unsigned i
 /* Take a frequency, and issue the hardware pstate transition command */
 static int transition_frequency_pstate(struct powernow_k8_data *data, unsigned int index)
 {
-       u32 fid = 0;
-       u32 did = 0;
        u32 pstate = 0;
        int res, i;
        struct cpufreq_freqs freqs;
 
        dprintk("cpu %d transition to index %u\n", smp_processor_id(), index);
 
-       /* get fid did for hardware pstate transition */
+       /* get MSR index for hardware pstate transition */
        pstate = index & HW_PSTATE_MASK;
-       if (pstate > MAX_HW_PSTATE)
+       if (pstate > data->max_hw_pstate)
                return 0;
-       fid = (index & HW_FID_INDEX_MASK) >> HW_FID_INDEX_SHIFT;
-       did = (index & HW_DID_INDEX_MASK) >> HW_DID_INDEX_SHIFT;
-       freqs.old = find_khz_freq_from_fiddid(data->currfid, data->currdid);
-       freqs.new = find_khz_freq_from_fiddid(fid, did);
+       freqs.old = find_khz_freq_from_pstate(data->powernow_table, data->currpstate);
+       freqs.new = find_khz_freq_from_pstate(data->powernow_table, pstate);
 
        for_each_cpu_mask(i, *(data->available_cores)) {
                freqs.cpu = i;
@@ -1043,9 +1005,7 @@ static int transition_frequency_pstate(struct powernow_k8_data *data, unsigned i
        }
 
        res = transition_pstate(data, pstate);
-       data->currfid = find_fid_from_pstate(pstate);
-       data->currdid = find_did_from_pstate(pstate);
-       freqs.new = find_khz_freq_from_fiddid(data->currfid, data->currdid);
+       freqs.new = find_khz_freq_from_pstate(data->powernow_table, pstate);
 
        for_each_cpu_mask(i, *(data->available_cores)) {
                freqs.cpu = i;
@@ -1090,10 +1050,7 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
        if (query_current_values_with_pending_wait(data))
                goto err_out;
 
-       if (cpu_family == CPU_HW_PSTATE)
-               dprintk("targ: curr fid 0x%x, did 0x%x\n",
-                       data->currfid, data->currdid);
-       else {
+       if (cpu_family != CPU_HW_PSTATE) {
                dprintk("targ: curr fid 0x%x, vid 0x%x\n",
                data->currfid, data->currvid);
 
@@ -1124,7 +1081,7 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
        mutex_unlock(&fidvid_mutex);
 
        if (cpu_family == CPU_HW_PSTATE)
-               pol->cur = find_khz_freq_from_fiddid(data->currfid, data->currdid);
+               pol->cur = find_khz_freq_from_pstate(data->powernow_table, newstate);
        else
                pol->cur = find_khz_freq_from_fid(data->currfid);
        ret = 0;
@@ -1223,7 +1180,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
            + (3 * (1 << data->irt) * 10)) * 1000;
 
        if (cpu_family == CPU_HW_PSTATE)
-               pol->cur = find_khz_freq_from_fiddid(data->currfid, data->currdid);
+               pol->cur = find_khz_freq_from_pstate(data->powernow_table, data->currpstate);
        else
                pol->cur = find_khz_freq_from_fid(data->currfid);
        dprintk("policy current frequency %d kHz\n", pol->cur);
@@ -1240,8 +1197,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
        cpufreq_frequency_table_get_attr(data->powernow_table, pol->cpu);
 
        if (cpu_family == CPU_HW_PSTATE)
-               dprintk("cpu_init done, current fid 0x%x, did 0x%x\n",
-                       data->currfid, data->currdid);
+               dprintk("cpu_init done, current pstate 0x%x\n", data->currpstate);
        else
                dprintk("cpu_init done, current fid 0x%x, vid 0x%x\n",
                        data->currfid, data->currvid);
@@ -1297,7 +1253,7 @@ static unsigned int powernowk8_get (unsigned int cpu)
                goto out;
 
        if (cpu_family == CPU_HW_PSTATE)
-               khz = find_khz_freq_from_fiddid(data->currfid, data->currdid);
+               khz = find_khz_freq_from_pstate(data->powernow_table, data->currpstate);
        else
                khz = find_khz_freq_from_fid(data->currfid);
 
index 7c4f6e0faed4a555ac599837d347dee7958d4feb..afd2b520d35c6258a25a2bc0f804279b647ae430 100644 (file)
@@ -10,6 +10,7 @@ struct powernow_k8_data {
 
        u32 numps;  /* number of p-states */
        u32 batps;  /* number of p-states supported on battery */
+       u32 max_hw_pstate; /* maximum legal hardware pstate */
 
        /* these values are constant when the PSB is used to determine
         * vid/fid pairings, but are modified during the ->target() call
@@ -21,8 +22,8 @@ struct powernow_k8_data {
        u32 plllock; /* pll lock time, units 1 us */
         u32 exttype; /* extended interface = 1 */
 
-       /* keep track of the current fid / vid or did */
-       u32 currvid, currfid, currdid;
+       /* keep track of the current fid / vid or pstate */
+       u32 currvid, currfid, currpstate;
 
        /* the powernow_table includes all frequency and vid/fid pairings:
         * fid are the lower 8 bits of the index, vid are the upper 8 bits.
@@ -87,23 +88,14 @@ struct powernow_k8_data {
 
 /* Hardware Pstate _PSS and MSR definitions */
 #define USE_HW_PSTATE          0x00000080
-#define HW_PSTATE_FID_MASK     0x0000003f
-#define HW_PSTATE_DID_MASK     0x000001c0
-#define HW_PSTATE_DID_SHIFT    6
 #define HW_PSTATE_MASK                 0x00000007
 #define HW_PSTATE_VALID_MASK   0x80000000
-#define HW_FID_INDEX_SHIFT     8
-#define HW_FID_INDEX_MASK      0x0000ff00
-#define HW_DID_INDEX_SHIFT     16
-#define HW_DID_INDEX_MASK      0x00ff0000
-#define HW_WATTS_MASK          0xff
-#define HW_PWR_DVR_MASK                0x300
-#define HW_PWR_DVR_SHIFT       8
-#define HW_PWR_MAX_MULT                3
-#define MAX_HW_PSTATE          8       /* hw pstate supports up to 8 */
+#define HW_PSTATE_MAX_MASK     0x000000f0
+#define HW_PSTATE_MAX_SHIFT    4
 #define MSR_PSTATE_DEF_BASE    0xc0010064 /* base of Pstate MSRs */
 #define MSR_PSTATE_STATUS      0xc0010063 /* Pstate Status MSR */
 #define MSR_PSTATE_CTRL        0xc0010062 /* Pstate control MSR */
+#define MSR_PSTATE_CUR_LIMIT   0xc0010061 /* pstate current limit MSR */
 
 /* define the two driver architectures */
 #define CPU_OPTERON 0
index b9f802e35209187a45045b3576027f9f0ac9de25..4b21d29fb5aa575b6146132db6dadd319ac5ca4a 100644 (file)
@@ -802,13 +802,15 @@ static struct sysdev_attribute *mce_attributes[] = {
        NULL
 };
 
+static cpumask_t mce_device_initialized = CPU_MASK_NONE;
+
 /* Per cpu sysdev init.  All of the cpus still share the same ctl bank */
 static __cpuinit int mce_create_device(unsigned int cpu)
 {
        int err;
        int i;
 
-       if (!mce_available(&cpu_data(cpu)))
+       if (!mce_available(&boot_cpu_data))
                return -EIO;
 
        memset(&per_cpu(device_mce, cpu).kobj, 0, sizeof(struct kobject));
@@ -825,6 +827,7 @@ static __cpuinit int mce_create_device(unsigned int cpu)
                if (err)
                        goto error;
        }
+       cpu_set(cpu, mce_device_initialized);
 
        return 0;
 error:
@@ -841,10 +844,14 @@ static void mce_remove_device(unsigned int cpu)
 {
        int i;
 
+       if (!cpu_isset(cpu, mce_device_initialized))
+               return;
+
        for (i = 0; mce_attributes[i]; i++)
                sysdev_remove_file(&per_cpu(device_mce,cpu),
                        mce_attributes[i]);
        sysdev_unregister(&per_cpu(device_mce,cpu));
+       cpu_clear(cpu, mce_device_initialized);
 }
 
 /* Get notified when a cpu comes on/off. Be hotplug friendly. */
@@ -852,21 +859,18 @@ static int
 mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
 {
        unsigned int cpu = (unsigned long)hcpu;
-       int err = 0;
 
        switch (action) {
-       case CPU_UP_PREPARE:
-       case CPU_UP_PREPARE_FROZEN:
-               err = mce_create_device(cpu);
+       case CPU_ONLINE:
+       case CPU_ONLINE_FROZEN:
+               mce_create_device(cpu);
                break;
-       case CPU_UP_CANCELED:
-       case CPU_UP_CANCELED_FROZEN:
        case CPU_DEAD:
        case CPU_DEAD_FROZEN:
                mce_remove_device(cpu);
                break;
        }
-       return err ? NOTIFY_BAD : NOTIFY_OK;
+       return NOTIFY_OK;
 }
 
 static struct notifier_block mce_cpu_notifier = {
index 9abbdf7562c50ffe86a3024d07cc5829f902d8d6..3b20613325dcbf88ef7cd7c3626d8a744b12ca4a 100644 (file)
@@ -139,13 +139,12 @@ struct set_mtrr_data {
        mtrr_type       smp_type;
 };
 
-#ifdef CONFIG_SMP
-
 static void ipi_handler(void *info)
 /*  [SUMMARY] Synchronisation handler. Executed by "other" CPUs.
     [RETURNS] Nothing.
 */
 {
+#ifdef CONFIG_SMP
        struct set_mtrr_data *data = info;
        unsigned long flags;
 
@@ -168,9 +167,8 @@ static void ipi_handler(void *info)
 
        atomic_dec(&data->count);
        local_irq_restore(flags);
-}
-
 #endif
+}
 
 static inline int types_compatible(mtrr_type type1, mtrr_type type2) {
        return type1 == MTRR_TYPE_UNCACHABLE ||
index 2d42b414b7779b37604d9c564f044642c8cb0832..3900e46d66db4c91ea8b898504af963dc3ff4df4 100644 (file)
@@ -49,7 +49,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
                /* Intel-defined (#2) */
                "pni", NULL, NULL, "monitor", "ds_cpl", "vmx", "smx", "est",
                "tm2", "ssse3", "cid", NULL, NULL, "cx16", "xtpr", NULL,
-               NULL, NULL, "dca", NULL, NULL, NULL, NULL, "popcnt",
+               NULL, NULL, "dca", "sse4_1", "sse4_2", NULL, NULL, "popcnt",
                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 
                /* VIA/Cyrix/Centaur-defined */
@@ -59,10 +59,10 @@ static int show_cpuinfo(struct seq_file *m, void *v)
                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 
                /* AMD-defined (#2) */
-               "lahf_lm", "cmp_legacy", "svm", "extapic", "cr8_legacy",
-               "altmovcr8", "abm", "sse4a",
-               "misalignsse", "3dnowprefetch",
-               "osvw", "ibs", NULL, NULL, NULL, NULL,
+               "lahf_lm", "cmp_legacy", "svm", "extapic",
+               "cr8_legacy", "abm", "sse4a", "misalignsse",
+               "3dnowprefetch", "osvw", "ibs", "sse5",
+               "skinit", "wdt", NULL, NULL,
                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 
@@ -89,8 +89,6 @@ static int show_cpuinfo(struct seq_file *m, void *v)
        int fpu_exception;
 
 #ifdef CONFIG_SMP
-       if (!cpu_online(n))
-               return 0;
        n = c->cpu_index;
 #endif
        seq_printf(m, "processor\t: %d\n"
@@ -177,14 +175,14 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 static void *c_start(struct seq_file *m, loff_t *pos)
 {
        if (*pos == 0)  /* just in case, cpu 0 is not the first */
-               *pos = first_cpu(cpu_possible_map);
-       if ((*pos) < NR_CPUS && cpu_possible(*pos))
+               *pos = first_cpu(cpu_online_map);
+       if ((*pos) < NR_CPUS && cpu_online(*pos))
                return &cpu_data(*pos);
        return NULL;
 }
 static void *c_next(struct seq_file *m, void *v, loff_t *pos)
 {
-       *pos = next_cpu(*pos, cpu_possible_map);
+       *pos = next_cpu(*pos, cpu_online_map);
        return c_start(m, pos);
 }
 static void c_stop(struct seq_file *m, void *v)
index dc34acbd54aafd1710808e422eea853edaba1531..88bb83ec895f0d2899f15f4f98f75c5aedac479b 100644 (file)
 #include <asm/io_apic.h>
 #include <asm/apic.h>
 
-#ifdef CONFIG_IOMMU
-#include <asm/iommu.h>
+#ifdef CONFIG_GART_IOMMU
+#include <asm/gart.h>
 #endif
 
 static void __init via_bugs(void)
 {
-#ifdef CONFIG_IOMMU
+#ifdef CONFIG_GART_IOMMU
        if ((end_pfn > MAX_DMA32_PFN ||  force_iommu) &&
-           !iommu_aperture_allowed) {
+           !gart_iommu_aperture_allowed) {
                printk(KERN_INFO
                       "Looks like a VIA chipset. Disabling IOMMU."
                       " Override with iommu=allowed\n");
-               iommu_aperture_disabled = 1;
+               gart_iommu_aperture_disabled = 1;
        }
 #endif
 }
 
 #ifdef CONFIG_ACPI
+#ifdef CONFIG_X86_IO_APIC
 
 static int __init nvidia_hpet_check(struct acpi_table_header *header)
 {
        return 0;
 }
-#endif
+#endif /* CONFIG_X86_IO_APIC */
+#endif /* CONFIG_ACPI */
 
 static void __init nvidia_bugs(void)
 {
index edd39ccf139e0f9586a48fb17e75f453b3b8a4ee..02112fcc0de7ea3ff7a752e84d2b071d7a6ff74c 100644 (file)
@@ -2,6 +2,7 @@
 #include <asm/semaphore.h>
 #include <asm/checksum.h>
 #include <asm/desc.h>
+#include <asm/pgtable.h>
 
 EXPORT_SYMBOL(__down_failed);
 EXPORT_SYMBOL(__down_failed_interruptible);
@@ -29,3 +30,4 @@ EXPORT_SYMBOL(__read_lock_failed);
 #endif
 
 EXPORT_SYMBOL(csum_partial);
+EXPORT_SYMBOL(empty_zero_page);
index 56c1f11471099103292b5aa291a388113d27fa9b..bfaff28fb1348f41f14b7caadf363ca86879595e 100644 (file)
@@ -92,13 +92,14 @@ int save_i387(struct _fpstate __user *buf)
        if (task_thread_info(tsk)->status & TS_USEDFPU) {
                err = save_i387_checking((struct i387_fxsave_struct __user *)buf);
                if (err) return err;
+               task_thread_info(tsk)->status &= ~TS_USEDFPU;
                stts();
-               } else {
-               if (__copy_to_user(buf, &tsk->thread.i387.fxsave, 
+       } else {
+               if (__copy_to_user(buf, &tsk->thread.i387.fxsave,
                                   sizeof(struct i387_fxsave_struct)))
                        return -1;
-       } 
-               return 1;
+       }
+       return 1;
 }
 
 /*
index f35c6eb33da9b7a5e0caa1dee4f0e075121349af..6cf27319a91c3938b457e6b2eb94e2f5d3c35464 100644 (file)
@@ -962,7 +962,7 @@ static int EISA_ELCR(unsigned int irq)
 #define default_MCA_trigger(idx)       (1)
 #define default_MCA_polarity(idx)      (0)
 
-static int __init MPBIOS_polarity(int idx)
+static int MPBIOS_polarity(int idx)
 {
        int bus = mp_irqs[idx].mpc_srcbus;
        int polarity;
@@ -2166,6 +2166,10 @@ static inline void __init check_timer(void)
 {
        int apic1, pin1, apic2, pin2;
        int vector;
+       unsigned int ver;
+
+       ver = apic_read(APIC_LVR);
+       ver = GET_APIC_VERSION(ver);
 
        /*
         * get/set the timer IRQ vector:
@@ -2179,11 +2183,15 @@ static inline void __init check_timer(void)
         * mode for the 8259A whenever interrupts are routed
         * through I/O APICs.  Also IRQ0 has to be enabled in
         * the 8259A which implies the virtual wire has to be
-        * disabled in the local APIC.
+        * disabled in the local APIC.  Finally timer interrupts
+        * need to be acknowledged manually in the 8259A for
+        * timer_interrupt() and for the i82489DX when using
+        * the NMI watchdog.
         */
        apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT);
        init_8259A(1);
-       timer_ack = 1;
+       timer_ack = !cpu_has_tsc;
+       timer_ack |= (nmi_watchdog == NMI_IO_APIC && !APIC_INTEGRATED(ver));
        if (timer_over_8254 > 0)
                enable_8259A_irq(0);
 
@@ -2830,6 +2838,25 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
        return 0;
 }
 
+int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity)
+{
+       int i;
+
+       if (skip_ioapic_setup)
+               return -1;
+
+       for (i = 0; i < mp_irq_entries; i++)
+               if (mp_irqs[i].mpc_irqtype == mp_INT &&
+                   mp_irqs[i].mpc_srcbusirq == bus_irq)
+                       break;
+       if (i >= mp_irq_entries)
+               return -1;
+
+       *trigger = irq_trigger(i);
+       *polarity = irq_polarity(i);
+       return 0;
+}
+
 #endif /* CONFIG_ACPI */
 
 static int __init parse_disable_timer_pin_1(char *arg)
index 953328b55a30503c58f2f8b3ed0f30939ff4047c..435a8c9b55f854bce24e145f20e5cc04ff7b1509 100644 (file)
@@ -546,7 +546,7 @@ int IO_APIC_get_PCI_irq_vector(int bus, int slot, int pin)
 #define default_PCI_trigger(idx)       (1)
 #define default_PCI_polarity(idx)      (1)
 
-static int __init MPBIOS_polarity(int idx)
+static int MPBIOS_polarity(int idx)
 {
        int bus = mp_irqs[idx].mpc_srcbus;
        int polarity;
@@ -2222,8 +2222,27 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int triggering, int p
        return 0;
 }
 
-#endif /* CONFIG_ACPI */
 
+int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity)
+{
+       int i;
+
+       if (skip_ioapic_setup)
+               return -1;
+
+       for (i = 0; i < mp_irq_entries; i++)
+               if (mp_irqs[i].mpc_irqtype == mp_INT &&
+                   mp_irqs[i].mpc_srcbusirq == bus_irq)
+                       break;
+       if (i >= mp_irq_entries)
+               return -1;
+
+       *trigger = irq_trigger(i);
+       *polarity = irq_polarity(i);
+       return 0;
+}
+
+#endif /* CONFIG_ACPI */
 
 /*
  * This function currently is only a helper for the i386 smp boot process where
@@ -2260,3 +2279,4 @@ void __init setup_ioapic_dest(void)
        }
 }
 #endif
+
index 90f778c04b3f1b847ea6c8653ae2f0c9503a8e39..d87a523070d111d853cf8ca05a0d3dbad4bcf0cd 100644 (file)
@@ -564,12 +564,7 @@ static int __kprobes post_kprobe_handler(struct pt_regs *regs)
 
        resume_execution(cur, regs, kcb);
        regs->eflags |= kcb->kprobe_saved_eflags;
-#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT
-       if (raw_irqs_disabled_flags(regs->eflags))
-               trace_hardirqs_off();
-       else
-               trace_hardirqs_on();
-#endif
+       trace_hardirqs_fixup_flags(regs->eflags);
 
        /*Restore back the original saved kprobes variables and continue. */
        if (kcb->kprobe_status == KPROBE_REENTER) {
index 681b801c5e26bf7be2a09c24134f590381214258..0c467644589c728e2a25ba10aaa17fc682a6bb6c 100644 (file)
@@ -58,7 +58,7 @@ const int kretprobe_blacklist_size = ARRAY_SIZE(kretprobe_blacklist);
 /*
  * returns non-zero if opcode modifies the interrupt flag.
  */
-static __always_inline int is_IF_modifier(kprobe_opcode_t *insn)
+static int __kprobes is_IF_modifier(kprobe_opcode_t *insn)
 {
        switch (*insn) {
        case 0xfa:              /* cli */
@@ -551,12 +551,7 @@ int __kprobes post_kprobe_handler(struct pt_regs *regs)
 
        resume_execution(cur, regs, kcb);
        regs->eflags |= kcb->kprobe_saved_rflags;
-#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT
-       if (raw_irqs_disabled_flags(regs->eflags))
-               trace_hardirqs_off();
-       else
-               trace_hardirqs_on();
-#endif
+       trace_hardirqs_fixup_flags(regs->eflags);
 
        /* Restore the original saved kprobes variables and continue. */
        if (kcb->kprobe_status == KPROBE_REENTER) {
index 0d8577f0542257c325031d45693e7458622166ad..aa3d2c8f7737851562923d37105ad7f719b8aa0b 100644 (file)
@@ -233,6 +233,8 @@ NORET_TYPE void machine_kexec(struct kimage *image)
 
 void arch_crash_save_vmcoreinfo(void)
 {
+       VMCOREINFO_SYMBOL(init_level4_pgt);
+
 #ifdef CONFIG_ARCH_DISCONTIGMEM_ENABLE
        VMCOREINFO_SYMBOL(node_data);
        VMCOREINFO_LENGTH(node_data, MAX_NUMNODES);
index f803ed0ed1c41ffea809a87ad70bb5e655346cfe..f5cc47c60b1372729568c5c0f7fdd5bad369b70e 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <asm/smp.h>
 #include <asm/nmi.h>
+#include <asm/timer.h>
 
 #include "mach_traps.h"
 
@@ -51,13 +52,13 @@ static int unknown_nmi_panic_callback(struct pt_regs *regs, int cpu);
 
 static int endflag __initdata = 0;
 
-#ifdef CONFIG_SMP
 /* The performance counters used by NMI_LOCAL_APIC don't trigger when
  * the CPU is idle. To make sure the NMI watchdog really ticks on all
  * CPUs during the test make them busy.
  */
 static __init void nmi_cpu_busy(void *data)
 {
+#ifdef CONFIG_SMP
        local_irq_enable_in_hardirq();
        /* Intentionally don't use cpu_relax here. This is
           to make sure that the performance counter really ticks,
@@ -67,8 +68,8 @@ static __init void nmi_cpu_busy(void *data)
           care if they get somewhat less cycles. */
        while (endflag == 0)
                mb();
-}
 #endif
+}
 
 static int __init check_nmi_watchdog(void)
 {
@@ -83,7 +84,7 @@ static int __init check_nmi_watchdog(void)
 
        prev_nmi_count = kmalloc(NR_CPUS * sizeof(int), GFP_KERNEL);
        if (!prev_nmi_count)
-               return -1;
+               goto error;
 
        printk(KERN_INFO "Testing NMI watchdog ... ");
 
@@ -117,7 +118,7 @@ static int __init check_nmi_watchdog(void)
        if (!atomic_read(&nmi_active)) {
                kfree(prev_nmi_count);
                atomic_set(&nmi_active, -1);
-               return -1;
+               goto error;
        }
        printk("OK.\n");
 
@@ -128,6 +129,10 @@ static int __init check_nmi_watchdog(void)
 
        kfree(prev_nmi_count);
        return 0;
+error:
+       timer_ack = !cpu_has_tsc;
+
+       return -1;
 }
 /* This needs to happen later in boot so counters are working */
 late_initcall(check_nmi_watchdog);
index 1a20fe31338b18ea302d5ac035fd521d458bd6e7..6bf1f716909da5fddf6674adc4b0974f3fbd1ab6 100644 (file)
@@ -36,7 +36,7 @@
 #include <linux/pci.h>
 #include <linux/delay.h>
 #include <linux/scatterlist.h>
-#include <asm/iommu.h>
+#include <asm/gart.h>
 #include <asm/calgary.h>
 #include <asm/tce.h>
 #include <asm/pci-direct.h>
index 393e2725a6e31a386a9b28817317990ef5d79871..5552d23d23c27558ec32f64930f14f6870181ba5 100644 (file)
@@ -9,10 +9,10 @@
 #include <linux/module.h>
 #include <linux/dmar.h>
 #include <asm/io.h>
-#include <asm/iommu.h>
+#include <asm/gart.h>
 #include <asm/calgary.h>
 
-int iommu_merge __read_mostly = 1;
+int iommu_merge __read_mostly = 0;
 EXPORT_SYMBOL(iommu_merge);
 
 dma_addr_t bad_dma_address __read_mostly;
@@ -275,7 +275,7 @@ __init int iommu_setup(char *p)
                        swiotlb = 1;
 #endif
 
-#ifdef CONFIG_IOMMU
+#ifdef CONFIG_GART_IOMMU
                gart_parse_options(p);
 #endif
 
@@ -298,8 +298,8 @@ void __init pci_iommu_alloc(void)
         * The order of these functions is important for
         * fall-back/fail-over reasons
         */
-#ifdef CONFIG_IOMMU
-       iommu_hole_init();
+#ifdef CONFIG_GART_IOMMU
+       gart_iommu_hole_init();
 #endif
 
 #ifdef CONFIG_CALGARY_IOMMU
@@ -321,7 +321,7 @@ static int __init pci_iommu_init(void)
 
        intel_iommu_init();
 
-#ifdef CONFIG_IOMMU
+#ifdef CONFIG_GART_IOMMU
        gart_iommu_init();
 #endif
 
index ae7e0161ce46e9e1eacbca8c2cb24a5a599456b9..06bcba536045ae5ca038ffa9ac3f6c16b6b26a2e 100644 (file)
 #include <asm/mtrr.h>
 #include <asm/pgtable.h>
 #include <asm/proto.h>
-#include <asm/iommu.h>
+#include <asm/gart.h>
 #include <asm/cacheflush.h>
 #include <asm/swiotlb.h>
 #include <asm/dma.h>
 #include <asm/k8.h>
 
-unsigned long iommu_bus_base;  /* GART remapping area (physical) */
+static unsigned long iommu_bus_base;   /* GART remapping area (physical) */
 static unsigned long iommu_size;       /* size of remapping area bytes */
 static unsigned long iommu_pages;      /* .. and in pages */
 
-u32 *iommu_gatt_base;          /* Remapping table */
+static u32 *iommu_gatt_base;           /* Remapping table */
 
 /* If this is disabled the IOMMU will use an optimized flushing strategy
    of only flushing when an mapping is reused. With it true the GART is flushed 
@@ -135,8 +135,8 @@ static void flush_gart(void)
 /* Debugging aid for drivers that don't free their IOMMU tables */
 static void **iommu_leak_tab; 
 static int leak_trace;
-int iommu_leak_pages = 20; 
-void dump_leak(void)
+static int iommu_leak_pages = 20;
+static void dump_leak(void)
 {
        int i;
        static int dump; 
@@ -435,7 +435,7 @@ static int gart_map_sg(struct device *dev, struct scatterlist *sg, int nents,
 
 error:
        flush_gart();
-       gart_unmap_sg(dev, sg, nents, dir);
+       gart_unmap_sg(dev, sg, out, dir);
        /* When it was forced or merged try again in a dumb way */
        if (force_iommu || iommu_merge) {
                out = dma_map_sg_nonforce(dev, sg, nents, dir);
@@ -627,12 +627,12 @@ void __init gart_iommu_init(void)
                return;
 
        /* Did we detect a different HW IOMMU? */
-       if (iommu_detected && !iommu_aperture)
+       if (iommu_detected && !gart_iommu_aperture)
                return;
 
        if (no_iommu ||
            (!force_iommu && end_pfn <= MAX_DMA32_PFN) ||
-           !iommu_aperture ||
+           !gart_iommu_aperture ||
            (no_agp && init_k8_gatt(&info) < 0)) {
                if (end_pfn > MAX_DMA32_PFN) {
                        printk(KERN_ERR "WARNING more than 4GB of memory "
@@ -733,9 +733,9 @@ void __init gart_parse_options(char *p)
                fix_aperture = 0;
        /* duplicated from pci-dma.c */
        if (!strncmp(p,"force",5))
-               iommu_aperture_allowed = 1;
+               gart_iommu_aperture_allowed = 1;
        if (!strncmp(p,"allowed",7))
-               iommu_aperture_allowed = 1;
+               gart_iommu_aperture_allowed = 1;
        if (!strncmp(p, "memaper", 7)) {
                fallback_aper_force = 1;
                p += 7;
index faf70bdca335c5c21dfb6e03941923234bc4deb1..ab08e1832228a74869bc6e7aeb517b0e29e8b044 100644 (file)
@@ -7,7 +7,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/scatterlist.h>
 
-#include <asm/iommu.h>
+#include <asm/gart.h>
 #include <asm/processor.h>
 #include <asm/dma.h>
 
index b2f405ea7c85002b779b3c928a26ce424c9a0a0e..102866d729a5a244f368b258150ec2718087467c 100644 (file)
@@ -5,7 +5,7 @@
 #include <linux/module.h>
 #include <linux/dma-mapping.h>
 
-#include <asm/iommu.h>
+#include <asm/gart.h>
 #include <asm/swiotlb.h>
 #include <asm/dma.h>
 
index 776eb06b6512dcf61e0a0d85daa23992870ac7e2..71b13c5f5817dd0d1ffbe2285fe003c11e6ea088 100644 (file)
@@ -17,7 +17,7 @@
 #include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/apic.h>
-#include <asm/iommu.h>
+#include <asm/gart.h>
 
 /*
  * Power off function, if any
index 1a07bbea7be36eadcea68843d7b727eaa03ee9a4..f452726c0fe276c2482e79b70ac1a1caedec7c5d 100644 (file)
@@ -39,6 +39,7 @@ struct device_fixup {
 static struct device_fixup fixups_table[] = {
 { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY, cs5530a_warm_reset },
 { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_ISA, cs5536_warm_reset },
+{ PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_SC1100_BRIDGE, cs5530a_warm_reset },
 };
 
 /*
index cc0e91447b76252411352ba3bb18c6ad4b3ea043..e1e18c34c8219e5760db76bb06097fba5c2dec5a 100644 (file)
@@ -86,9 +86,6 @@ unsigned long mmu_cr4_features;
 
 /* for MCA, but anyone else can use it if they want */
 unsigned int machine_id;
-#ifdef CONFIG_MCA
-EXPORT_SYMBOL(machine_id);
-#endif
 unsigned int machine_submodel_id;
 unsigned int BIOS_revision;
 unsigned int mca_pentium_flag;
index e7a9e36bd52d5159ab214e457d12f3a898691be7..30d94d1d5f5f38e222b8ac7e4a869a6e0ee91b01 100644 (file)
@@ -892,7 +892,6 @@ void __cpuinit early_identify_cpu(struct cpuinfo_x86 *c)
 
 #ifdef CONFIG_SMP
        c->phys_proc_id = (cpuid_ebx(1) >> 24) & 0xff;
-       c->cpu_index = 0;
 #endif
 }
 
@@ -1040,7 +1039,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
                /* Intel-defined (#2) */
                "pni", NULL, NULL, "monitor", "ds_cpl", "vmx", "smx", "est",
                "tm2", "ssse3", "cid", NULL, NULL, "cx16", "xtpr", NULL,
-               NULL, NULL, "dca", NULL, NULL, NULL, NULL, "popcnt",
+               NULL, NULL, "dca", "sse4_1", "sse4_2", NULL, NULL, "popcnt",
                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 
                /* VIA/Cyrix/Centaur-defined */
@@ -1050,10 +1049,10 @@ static int show_cpuinfo(struct seq_file *m, void *v)
                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 
                /* AMD-defined (#2) */
-               "lahf_lm", "cmp_legacy", "svm", "extapic", "cr8_legacy",
-               "altmovcr8", "abm", "sse4a",
-               "misalignsse", "3dnowprefetch",
-               "osvw", "ibs", NULL, NULL, NULL, NULL,
+               "lahf_lm", "cmp_legacy", "svm", "extapic",
+               "cr8_legacy", "abm", "sse4a", "misalignsse",
+               "3dnowprefetch", "osvw", "ibs", "sse5",
+               "skinit", "wdt", NULL, NULL,
                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 
@@ -1078,8 +1077,6 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 
 
 #ifdef CONFIG_SMP
-       if (!cpu_online(c->cpu_index))
-               return 0;
        cpu = c->cpu_index;
 #endif
 
@@ -1171,15 +1168,15 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 static void *c_start(struct seq_file *m, loff_t *pos)
 {
        if (*pos == 0)  /* just in case, cpu 0 is not the first */
-               *pos = first_cpu(cpu_possible_map);
-       if ((*pos) < NR_CPUS && cpu_possible(*pos))
+               *pos = first_cpu(cpu_online_map);
+       if ((*pos) < NR_CPUS && cpu_online(*pos))
                return &cpu_data(*pos);
        return NULL;
 }
 
 static void *c_next(struct seq_file *m, void *v, loff_t *pos)
 {
-       *pos = next_cpu(*pos, cpu_possible_map);
+       *pos = next_cpu(*pos, cpu_online_map);
        return c_start(m, pos);
 }
 
index f32115308399453305598431f9955f97eb22387e..fcaa026eb80729f99ef68e8b7695ed59a8498842 100644 (file)
@@ -708,10 +708,4 @@ struct smp_ops smp_ops = {
        .smp_send_reschedule = native_smp_send_reschedule,
        .smp_call_function_mask = native_smp_call_function_mask,
 };
-
-int smp_call_function_mask(cpumask_t mask, void (*func) (void *info),
-                          void *info, int wait)
-{
-       return smp_ops.smp_call_function_mask(mask, func, info, wait);
-}
-EXPORT_SYMBOL(smp_call_function_mask);
+EXPORT_SYMBOL_GPL(smp_ops);
index c821edc32216b88c674d2a704f105fdf063c1014..368b1942b39aba509cfafe7fae629ef400a7a243 100644 (file)
@@ -82,18 +82,15 @@ static int set_rtc_mmss(unsigned long nowtime)
        int retval = 0;
        int real_seconds, real_minutes, cmos_minutes;
        unsigned char control, freq_select;
+       unsigned long flags;
 
 /*
- * IRQs are disabled when we're called from the timer interrupt,
- * no need for spin_lock_irqsave()
+ * set_rtc_mmss is called when irqs are enabled, so disable irqs here
  */
-
-       spin_lock(&rtc_lock);
-
+       spin_lock_irqsave(&rtc_lock, flags);
 /*
  * Tell the clock it's being set and stop it.
  */
-
        control = CMOS_READ(RTC_CONTROL);
        CMOS_WRITE(control | RTC_SET, RTC_CONTROL);
 
@@ -138,7 +135,7 @@ static int set_rtc_mmss(unsigned long nowtime)
        CMOS_WRITE(control, RTC_CONTROL);
        CMOS_WRITE(freq_select, RTC_FREQ_SELECT);
 
-       spin_unlock(&rtc_lock);
+       spin_unlock_irqrestore(&rtc_lock, flags);
 
        return retval;
 }
@@ -164,21 +161,27 @@ unsigned long read_persistent_clock(void)
        unsigned century = 0;
 
        spin_lock_irqsave(&rtc_lock, flags);
+       /*
+        * if UIP is clear, then we have >= 244 microseconds before RTC
+        * registers will be updated.  Spec sheet says that this is the
+        * reliable way to read RTC - registers invalid (off bus) during update
+        */
+       while ((CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP))
+               cpu_relax();
 
-       do {
-               sec = CMOS_READ(RTC_SECONDS);
-               min = CMOS_READ(RTC_MINUTES);
-               hour = CMOS_READ(RTC_HOURS);
-               day = CMOS_READ(RTC_DAY_OF_MONTH);
-               mon = CMOS_READ(RTC_MONTH);
-               year = CMOS_READ(RTC_YEAR);
+
+       /* now read all RTC registers while stable with interrupts disabled */
+       sec = CMOS_READ(RTC_SECONDS);
+       min = CMOS_READ(RTC_MINUTES);
+       hour = CMOS_READ(RTC_HOURS);
+       day = CMOS_READ(RTC_DAY_OF_MONTH);
+       mon = CMOS_READ(RTC_MONTH);
+       year = CMOS_READ(RTC_YEAR);
 #ifdef CONFIG_ACPI
-               if (acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID &&
-                                       acpi_gbl_FADT.century)
-                       century = CMOS_READ(acpi_gbl_FADT.century);
+       if (acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID &&
+                               acpi_gbl_FADT.century)
+               century = CMOS_READ(acpi_gbl_FADT.century);
 #endif
-       } while (sec != CMOS_READ(RTC_SECONDS));
-
        spin_unlock_irqrestore(&rtc_lock, flags);
 
        /*
index cc9acace7e23ba05b810afcf3c9d96bff0516d6c..ef601026259775ae1f426b63f8808257615a37ef 100644 (file)
@@ -283,6 +283,11 @@ void dump_stack(void)
 {
        unsigned long stack;
 
+       printk("Pid: %d, comm: %.20s %s %s %.*s\n",
+               current->pid, current->comm, print_tainted(),
+               init_utsname()->release,
+               (int)strcspn(init_utsname()->version, " "),
+               init_utsname()->version);
        show_trace(current, NULL, &stack);
 }
 
@@ -789,6 +794,8 @@ void restart_nmi(void)
 #ifdef CONFIG_KPROBES
 fastcall void __kprobes do_int3(struct pt_regs *regs, long error_code)
 {
+       trace_hardirqs_fixup();
+
        if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP)
                        == NOTIFY_STOP)
                return;
@@ -826,6 +833,8 @@ fastcall void __kprobes do_debug(struct pt_regs * regs, long error_code)
        unsigned int condition;
        struct task_struct *tsk = current;
 
+       trace_hardirqs_fixup();
+
        get_debugreg(condition, 6);
 
        if (notify_die(DIE_DEBUG, "debug", regs, condition, error_code,
index d0c2bc7ab2ec561dc91e12dee87fde8b563f8770..d11525ad81b40676cd99736cf729329993b580ab 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/uaccess.h>
 #include <linux/bug.h>
 #include <linux/kdebug.h>
+#include <linux/utsname.h>
 
 #if defined(CONFIG_EDAC)
 #include <linux/edac.h>
@@ -400,6 +401,12 @@ void show_stack(struct task_struct *tsk, unsigned long * rsp)
 void dump_stack(void)
 {
        unsigned long dummy;
+
+       printk("Pid: %d, comm: %.20s %s %s %.*s\n",
+               current->pid, current->comm, print_tainted(),
+               init_utsname()->release,
+               (int)strcspn(init_utsname()->version, " "),
+               init_utsname()->version);
        show_trace(NULL, NULL, &dummy);
 }
 
@@ -807,6 +814,8 @@ asmlinkage __kprobes void default_do_nmi(struct pt_regs *regs)
 /* runs on IST stack. */
 asmlinkage void __kprobes do_int3(struct pt_regs * regs, long error_code)
 {
+       trace_hardirqs_fixup();
+
        if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) == NOTIFY_STOP) {
                return;
        }
@@ -844,6 +853,8 @@ asmlinkage void __kprobes do_debug(struct pt_regs * regs,
        struct task_struct *tsk = current;
        siginfo_t info;
 
+       trace_hardirqs_fixup();
+
        get_debugreg(condition, 6);
 
        if (notify_die(DIE_DEBUG, "debug", regs, condition, error_code,
index a55b0902f9d3d08637a449032e5aa89f5a7aa027..92c56117eae5ed2af3cbdc37c6086d7a7dd25120 100644 (file)
@@ -93,38 +93,7 @@ struct lguest_data lguest_data = {
 };
 static cycle_t clock_base;
 
-/*G:035 Notice the lazy_hcall() above, rather than hcall().  This is our first
- * real optimization trick!
- *
- * When lazy_mode is set, it means we're allowed to defer all hypercalls and do
- * them as a batch when lazy_mode is eventually turned off.  Because hypercalls
- * are reasonably expensive, batching them up makes sense.  For example, a
- * large munmap might update dozens of page table entries: that code calls
- * paravirt_enter_lazy_mmu(), does the dozen updates, then calls
- * lguest_leave_lazy_mode().
- *
- * So, when we're in lazy mode, we call async_hypercall() to store the call for
- * future processing.  When lazy mode is turned off we issue a hypercall to
- * flush the stored calls.
- */
-static void lguest_leave_lazy_mode(void)
-{
-       paravirt_leave_lazy(paravirt_get_lazy_mode());
-       hcall(LHCALL_FLUSH_ASYNC, 0, 0, 0);
-}
-
-static void lazy_hcall(unsigned long call,
-                      unsigned long arg1,
-                      unsigned long arg2,
-                      unsigned long arg3)
-{
-       if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE)
-               hcall(call, arg1, arg2, arg3);
-       else
-               async_hcall(call, arg1, arg2, arg3);
-}
-
-/* async_hcall() is pretty simple: I'm quite proud of it really.  We have a
+/*G:037 async_hcall() is pretty simple: I'm quite proud of it really.  We have a
  * ring buffer of stored hypercalls which the Host will run though next time we
  * do a normal hypercall.  Each entry in the ring has 4 slots for the hypercall
  * arguments, and a "hcall_status" word which is 0 if the call is ready to go,
@@ -134,8 +103,8 @@ static void lazy_hcall(unsigned long call,
  * full and we just make the hypercall directly.  This has the nice side
  * effect of causing the Host to run all the stored calls in the ring buffer
  * which empties it for next time! */
-void async_hcall(unsigned long call,
-                unsigned long arg1, unsigned long arg2, unsigned long arg3)
+static void async_hcall(unsigned long call, unsigned long arg1,
+                       unsigned long arg2, unsigned long arg3)
 {
        /* Note: This code assumes we're uniprocessor. */
        static unsigned int next_call;
@@ -161,7 +130,37 @@ void async_hcall(unsigned long call,
        }
        local_irq_restore(flags);
 }
-/*:*/
+
+/*G:035 Notice the lazy_hcall() above, rather than hcall().  This is our first
+ * real optimization trick!
+ *
+ * When lazy_mode is set, it means we're allowed to defer all hypercalls and do
+ * them as a batch when lazy_mode is eventually turned off.  Because hypercalls
+ * are reasonably expensive, batching them up makes sense.  For example, a
+ * large munmap might update dozens of page table entries: that code calls
+ * paravirt_enter_lazy_mmu(), does the dozen updates, then calls
+ * lguest_leave_lazy_mode().
+ *
+ * So, when we're in lazy mode, we call async_hcall() to store the call for
+ * future processing. */
+static void lazy_hcall(unsigned long call,
+                      unsigned long arg1,
+                      unsigned long arg2,
+                      unsigned long arg3)
+{
+       if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE)
+               hcall(call, arg1, arg2, arg3);
+       else
+               async_hcall(call, arg1, arg2, arg3);
+}
+
+/* When lazy mode is turned off reset the per-cpu lazy mode variable and then
+ * issue a hypercall to flush any stored calls. */
+static void lguest_leave_lazy_mode(void)
+{
+       paravirt_leave_lazy(paravirt_get_lazy_mode());
+       hcall(LHCALL_FLUSH_ASYNC, 0, 0, 0);
+}
 
 /*G:033
  * After that diversion we return to our first native-instruction
index 952e7a89c2ac4f0cc218b310e6a0f84da3845d99..aad9d95469dc68dcb25b9fac93b743d44b7d9038 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <linux/module.h>
 #include <linux/sched.h>
+#include <linux/preempt.h>
 #include <linux/delay.h>
 
 #include <asm/processor.h>
@@ -42,11 +43,13 @@ static void delay_tsc(unsigned long loops)
 {
        unsigned long bclock, now;
 
+       preempt_disable();              /* TSC's are per-cpu */
        rdtscl(bclock);
        do {
                rep_nop();
                rdtscl(now);
        } while ((now-bclock) < loops);
+       preempt_enable();
 }
 
 /*
index 0ebbfb9e7c7f8d2b86abeb23f07b0cfbf0ebe56f..45cdd3fbd91c514f38e2c2782f7dbc0dcecd8e90 100644 (file)
@@ -10,7 +10,9 @@
 
 #include <linux/module.h>
 #include <linux/sched.h>
+#include <linux/preempt.h>
 #include <linux/delay.h>
+
 #include <asm/delay.h>
 #include <asm/msr.h>
 
@@ -27,14 +29,15 @@ int read_current_timer(unsigned long *timer_value)
 void __delay(unsigned long loops)
 {
        unsigned bclock, now;
-       
+
+       preempt_disable();              /* TSC's are pre-cpu */
        rdtscl(bclock);
-       do
-       {
+       do {
                rep_nop(); 
                rdtscl(now);
        }
-       while((now-bclock) < loops);
+       while ((now-bclock) < loops);
+       preempt_enable();
 }
 EXPORT_SYMBOL(__delay);
 
index 26a2d4c54b684e8d3da8f451ad3c2be9e1ce262c..2132ca652df1d65de50fefab33bb81bde854c3db 100644 (file)
@@ -568,7 +568,7 @@ static voyager_module_t *voyager_initial_module;
  * boot cpu *after* all memory initialisation has been done (so we can
  * use kmalloc) but before smp initialisation, so we can probe the SMP
  * configuration and pick up necessary information.  */
-void
+void __init
 voyager_cat_init(void)
 {
        voyager_module_t **modpp = &voyager_initial_module;
index 361ac5107b33efcc2331eabc6342912e071e2090..88124dd35406d2484f999c837833d4a9c270ba03 100644 (file)
 #include <asm/arch_hooks.h>
 
 /* TLB state -- visible externally, indexed physically */
-DEFINE_PER_CPU(struct tlb_state, cpu_tlbstate) ____cacheline_aligned = { &init_mm, 0 };
+DEFINE_PER_CPU_SHARED_ALIGNED(struct tlb_state, cpu_tlbstate) = { &init_mm, 0 };
 
 /* CPU IRQ affinity -- set to all ones initially */
 static unsigned long cpu_irq_affinity[NR_CPUS] __cacheline_aligned = { [0 ... NR_CPUS-1]  = ~0UL };
 
 /* per CPU data structure (for /proc/cpuinfo et al), visible externally
  * indexed physically */
-DEFINE_PER_CPU(cpuinfo_x86, cpu_info) __cacheline_aligned;
+DEFINE_PER_CPU_SHARED_ALIGNED(struct cpuinfo_x86, cpu_info);
 EXPORT_PER_CPU_SYMBOL(cpu_info);
 
 /* physical ID of the CPU used to boot the system */
@@ -1900,7 +1900,7 @@ voyager_smp_prepare_cpus(unsigned int max_cpus)
        smp_boot_cpus();
 }
 
-static void __devinit voyager_smp_prepare_boot_cpu(void)
+static void __cpuinit voyager_smp_prepare_boot_cpu(void)
 {
        init_gdt(smp_processor_id());
        switch_to_new_gdt();
@@ -1911,7 +1911,7 @@ static void __devinit voyager_smp_prepare_boot_cpu(void)
        cpu_set(smp_processor_id(), cpu_present_map);
 }
 
-static int __devinit
+static int __cpuinit
 voyager_cpu_up(unsigned int cpu)
 {
        /* This only works at boot for x86.  See "rewrite" above. */
index fe608a45ffb66956e67b31b60d80b1c83bfa408f..13a474d3c6e9732d742fb389c7202477c2fa9fda 100644 (file)
@@ -40,7 +40,7 @@
 
 struct pglist_data *node_data[MAX_NUMNODES] __read_mostly;
 EXPORT_SYMBOL(node_data);
-bootmem_data_t node0_bdata;
+static bootmem_data_t node0_bdata;
 
 /*
  * numa interface - we expect the numa architecture specific code to have
@@ -404,7 +404,7 @@ void __init set_highmem_pages_init(int bad_ppro)
 }
 
 #ifdef CONFIG_MEMORY_HOTPLUG
-int paddr_to_nid(u64 addr)
+static int paddr_to_nid(u64 addr)
 {
        int nid;
        unsigned long pfn = PFN_DOWN(addr);
index 33563ee8eb0fe9d0bc77e46d3cf5b10e8fb513e2..a2273d44aa279fae2dd739d6247d60a487e93ea0 100644 (file)
@@ -303,6 +303,11 @@ fastcall void __kprobes do_page_fault(struct pt_regs *regs,
        int write, si_code;
        int fault;
 
+       /*
+        * We can fault from pretty much anywhere, with unknown IRQ state.
+        */
+       trace_hardirqs_fixup();
+
        /* get the address */
         address = read_cr2();
 
index 644b4f7ece10acc498fd9ac61c0d93637f519a82..0e26230669ca21aabb92a60f134100d8f453f5fc 100644 (file)
@@ -304,6 +304,11 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
        unsigned long flags;
        siginfo_t info;
 
+       /*
+        * We can fault from pretty much anywhere, with unknown IRQ state.
+        */
+       trace_hardirqs_fixup();
+
        tsk = current;
        mm = tsk->mm;
        prefetchw(&mm->mmap_sem);
index 1e3862e410658b7cd3d2422476e0797b8ff4b511..a7308b2cd058291bbde282fd0e544ff469c6d417 100644 (file)
@@ -728,12 +728,6 @@ int in_gate_area_no_task(unsigned long addr)
        return (addr >= VSYSCALL_START) && (addr < VSYSCALL_END);
 }
 
-void * __init alloc_bootmem_high_node(pg_data_t *pgdat, unsigned long size)
-{
-       return __alloc_bootmem_core(pgdat->bdata, size,
-                       SMP_CACHE_BYTES, (4UL*1024*1024*1024), 0);
-}
-
 const char *arch_vma_name(struct vm_area_struct *vma)
 {
        if (vma->vm_mm && vma->vm_start == (long)vma->vm_mm->context.vdso)
index 2d88f7c6d6ac901a3f2f2ffe2f64f680706b435a..0234f2831bf371194f69779753ce2fb017570984 100644 (file)
@@ -13,7 +13,7 @@ static int __devinit can_skip_ioresource_align(const struct dmi_system_id *d)
        return 0;
 }
 
-static struct dmi_system_id acpi_pciprobe_dmi_table[] = {
+static struct dmi_system_id acpi_pciprobe_dmi_table[] __devinitdata = {
 /*
  * Systems where PCI IO resource ISA alignment can be skipped
  * when the ISA enable bit in the bridge control is not set
@@ -77,6 +77,9 @@ count_resource(struct acpi_resource *acpi_res, void *data)
        struct acpi_resource_address64 addr;
        acpi_status status;
 
+       if (info->res_num >= PCI_BUS_NUM_RESOURCES)
+               return AE_OK;
+
        status = resource_to_addr(acpi_res, &addr);
        if (ACPI_SUCCESS(status))
                info->res_num++;
@@ -93,6 +96,9 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
        unsigned long flags;
        struct resource *root;
 
+       if (info->res_num >= PCI_BUS_NUM_RESOURCES)
+               return AE_OK;
+
        status = resource_to_addr(acpi_res, &addr);
        if (!ACPI_SUCCESS(status))
                return AE_OK;
index f4386990b150c442f67cb8d463ecee6241448d83..862746390666daa6da34942889321d6eebcbe9b2 100644 (file)
@@ -315,6 +315,22 @@ static struct dmi_system_id __devinitdata pciprobe_dmi_table[] = {
                },
        },
 #endif
+       {
+               .callback = set_bf_sort,
+               .ident = "HP ProLiant DL385 G2",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "HP"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL385 G2"),
+               },
+       },
+       {
+               .callback = set_bf_sort,
+               .ident = "HP ProLiant DL585 G2",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "HP"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL585 G2"),
+               },
+       },
        {}
 };
 
index 7a2ba4583939672ff39de6236172dafd1b14228a..e7bff0fbac235715ca5e8601d510414c38e56a9c 100644 (file)
@@ -20,7 +20,7 @@ quiet_cmd_syscall = SYSCALL $@
       cmd_syscall = $(CC) -m elf_x86_64 -nostdlib $(SYSCFLAGS_$(@F)) \
                          -Wl,-T,$(filter-out FORCE,$^) -o $@
 
-export CPPFLAGS_vdso.lds += -P -C -U$(ARCH)
+export CPPFLAGS_vdso.lds += -P -C
 
 vdso-flags = -fPIC -shared -Wl,-soname=linux-vdso.so.1 \
                 $(call ld-option, -Wl$(comma)--hash-style=sysv) \
index 91f6e85d0fc2d7219c15816749337c64041ea3a2..3b1ae1abfba9abc1f00332ccb6c7af0805a8e403 100644 (file)
 #include <asm/vgtod.h>
 #include "vextern.h"
 
-long __vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *tcache)
+long __vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused)
 {
        unsigned int dummy, p;
-       unsigned long j = 0;
 
-       /* Fast cache - only recompute value once per jiffies and avoid
-          relatively costly rdtscp/cpuid otherwise.
-          This works because the scheduler usually keeps the process
-          on the same CPU and this syscall doesn't guarantee its
-          results anyways.
-          We do this here because otherwise user space would do it on
-          its own in a likely inferior way (no access to jiffies).
-          If you don't like it pass NULL. */
-       if (tcache && tcache->blob[0] == (j = *vdso_jiffies)) {
-               p = tcache->blob[1];
-       } else if (*vdso_vgetcpu_mode == VGETCPU_RDTSCP) {
+       if (*vdso_vgetcpu_mode == VGETCPU_RDTSCP) {
                /* Load per CPU data from RDTSCP */
                rdtscp(dummy, dummy, p);
        } else {
                /* Load per CPU data from GDT */
                asm("lsl %1,%0" : "=r" (p) : "r" (__PER_CPU_SEG));
        }
-       if (tcache) {
-               tcache->blob[0] = j;
-               tcache->blob[1] = p;
-       }
        if (cpu)
                *cpu = p & 0xfff;
        if (node)
index 85ffbb491490b47f78b4347c4af35d375ca6c988..d3cb3d6af4c8da3249b4e4cda5602724831dd549 100644 (file)
@@ -1,5 +1,5 @@
 # For a description of the syntax of this configuration file,
-# see Documentation/kbuild/config-language.txt.
+# see Documentation/kbuild/kconfig-language.txt.
 
 mainmenu "Linux/Xtensa Kernel Configuration"
 
index 54dc05439009d09968572e6f12ce30d0fef151e8..0b4a47905575f2ee658d8a2f1e373aec71e935e5 100644 (file)
@@ -789,6 +789,20 @@ static inline void cfq_slice_expired(struct cfq_data *cfqd, int timed_out)
                __cfq_slice_expired(cfqd, cfqq, timed_out);
 }
 
+static int start_idle_class_timer(struct cfq_data *cfqd)
+{
+       unsigned long end = cfqd->last_end_request + CFQ_IDLE_GRACE;
+       unsigned long now = jiffies;
+
+       if (time_before(now, end) &&
+           time_after_eq(now, cfqd->last_end_request)) {
+               mod_timer(&cfqd->idle_class_timer, end);
+               return 1;
+       }
+
+       return 0;
+}
+
 /*
  * Get next queue for service. Unless we have a queue preemption,
  * we'll simply select the first cfqq in the service tree.
@@ -805,19 +819,14 @@ static struct cfq_queue *cfq_get_next_queue(struct cfq_data *cfqd)
        cfqq = rb_entry(n, struct cfq_queue, rb_node);
 
        if (cfq_class_idle(cfqq)) {
-               unsigned long end;
-
                /*
                 * if we have idle queues and no rt or be queues had
                 * pending requests, either allow immediate service if
                 * the grace period has passed or arm the idle grace
                 * timer
                 */
-               end = cfqd->last_end_request + CFQ_IDLE_GRACE;
-               if (time_before(jiffies, end)) {
-                       mod_timer(&cfqd->idle_class_timer, end);
+               if (start_idle_class_timer(cfqd))
                        cfqq = NULL;
-               }
        }
 
        return cfqq;
@@ -1443,8 +1452,11 @@ cfq_get_queue(struct cfq_data *cfqd, int is_sync, struct task_struct *tsk,
                cfqq = *async_cfqq;
        }
 
-       if (!cfqq)
+       if (!cfqq) {
                cfqq = cfq_find_alloc_queue(cfqd, is_sync, tsk, gfp_mask);
+               if (!cfqq)
+                       return NULL;
+       }
 
        /*
         * pin the queue now that it's allocated, scheduler exit will prune it
@@ -2033,17 +2045,14 @@ out_cont:
 static void cfq_idle_class_timer(unsigned long data)
 {
        struct cfq_data *cfqd = (struct cfq_data *) data;
-       unsigned long flags, end;
+       unsigned long flags;
 
        spin_lock_irqsave(cfqd->queue->queue_lock, flags);
 
        /*
         * race with a non-idle queue, reset timer
         */
-       end = cfqd->last_end_request + CFQ_IDLE_GRACE;
-       if (!time_after_eq(jiffies, end))
-               mod_timer(&cfqd->idle_class_timer, end);
-       else
+       if (!start_idle_class_timer(cfqd))
                cfq_schedule_dispatch(cfqd);
 
        spin_unlock_irqrestore(cfqd->queue->queue_lock, flags);
@@ -2053,7 +2062,7 @@ static void cfq_shutdown_timer_wq(struct cfq_data *cfqd)
 {
        del_timer_sync(&cfqd->idle_slice_timer);
        del_timer_sync(&cfqd->idle_class_timer);
-       blk_sync_queue(cfqd->queue);
+       kblockd_flush_work(&cfqd->unplug_work);
 }
 
 static void cfq_put_async_queues(struct cfq_data *cfqd)
@@ -2065,9 +2074,10 @@ static void cfq_put_async_queues(struct cfq_data *cfqd)
                        cfq_put_queue(cfqd->async_cfqq[0][i]);
                if (cfqd->async_cfqq[1][i])
                        cfq_put_queue(cfqd->async_cfqq[1][i]);
-               if (cfqd->async_idle_cfqq)
-                       cfq_put_queue(cfqd->async_idle_cfqq);
        }
+
+       if (cfqd->async_idle_cfqq)
+               cfq_put_queue(cfqd->async_idle_cfqq);
 }
 
 static void cfq_exit_queue(elevator_t *e)
@@ -2122,6 +2132,7 @@ static void *cfq_init_queue(struct request_queue *q)
 
        INIT_WORK(&cfqd->unplug_work, cfq_kick_queue);
 
+       cfqd->last_end_request = jiffies;
        cfqd->cfq_quantum = cfq_quantum;
        cfqd->cfq_fifo_expire[0] = cfq_fifo_expire[0];
        cfqd->cfq_fifo_expire[1] = cfq_fifo_expire[1];
index f84093b97f704f3d7720708b6ca035741ca6a67f..cae0a852619e372a7a2e87b53b7f818a402f8d86 100644 (file)
@@ -581,7 +581,7 @@ static int compat_blkdev_driver_ioctl(struct inode *inode, struct file *file,
 {
        int ret;
 
-       switch (arg) {
+       switch (cmd) {
        case HDIO_GET_UNMASKINTR:
        case HDIO_GET_MULTCOUNT:
        case HDIO_GET_KEEPSETTINGS:
index 1a511ffaf8a4edb49425fb88bba610fcfb45fdf4..a054eef8dff63c19548f74e8d2b58db78e704822 100644 (file)
@@ -55,6 +55,20 @@ static void deadline_move_request(struct deadline_data *, struct request *);
 
 #define RQ_RB_ROOT(dd, rq)     (&(dd)->sort_list[rq_data_dir((rq))])
 
+/*
+ * get the request after `rq' in sector-sorted order
+ */
+static inline struct request *
+deadline_latter_request(struct request *rq)
+{
+       struct rb_node *node = rb_next(&rq->rb_node);
+
+       if (node)
+               return rb_entry_rq(node);
+
+       return NULL;
+}
+
 static void
 deadline_add_rq_rb(struct deadline_data *dd, struct request *rq)
 {
@@ -74,13 +88,8 @@ deadline_del_rq_rb(struct deadline_data *dd, struct request *rq)
 {
        const int data_dir = rq_data_dir(rq);
 
-       if (dd->next_rq[data_dir] == rq) {
-               struct rb_node *rbnext = rb_next(&rq->rb_node);
-
-               dd->next_rq[data_dir] = NULL;
-               if (rbnext)
-                       dd->next_rq[data_dir] = rb_entry_rq(rbnext);
-       }
+       if (dd->next_rq[data_dir] == rq)
+               dd->next_rq[data_dir] = deadline_latter_request(rq);
 
        elv_rb_del(RQ_RB_ROOT(dd, rq), rq);
 }
@@ -198,14 +207,11 @@ static void
 deadline_move_request(struct deadline_data *dd, struct request *rq)
 {
        const int data_dir = rq_data_dir(rq);
-       struct rb_node *rbnext = rb_next(&rq->rb_node);
 
        dd->next_rq[READ] = NULL;
        dd->next_rq[WRITE] = NULL;
+       dd->next_rq[data_dir] = deadline_latter_request(rq);
 
-       if (rbnext)
-               dd->next_rq[data_dir] = rb_entry_rq(rbnext);
-       
        dd->last_sector = rq->sector + rq->nr_sectors;
 
        /*
@@ -301,30 +307,23 @@ dispatch_find_request:
        /*
         * we are not running a batch, find best request for selected data_dir
         */
-       if (deadline_check_fifo(dd, data_dir)) {
-               /* An expired request exists - satisfy it */
-               dd->batching = 0;
+       if (deadline_check_fifo(dd, data_dir) || !dd->next_rq[data_dir]) {
+               /*
+                * A deadline has expired, the last request was in the other
+                * direction, or we have run out of higher-sectored requests.
+                * Start again from the request with the earliest expiry time.
+                */
                rq = rq_entry_fifo(dd->fifo_list[data_dir].next);
-               
-       } else if (dd->next_rq[data_dir]) {
+       } else {
                /*
                 * The last req was the same dir and we have a next request in
                 * sort order. No expired requests so continue on from here.
                 */
                rq = dd->next_rq[data_dir];
-       } else {
-               struct rb_node *node;
-               /*
-                * The last req was the other direction or we have run out of
-                * higher-sectored requests. Go back to the lowest sectored
-                * request (1 way elevator) and start a new batch.
-                */
-               dd->batching = 0;
-               node = rb_first(&dd->sort_list[data_dir]);
-               if (node)
-                       rq = rb_entry_rq(node);
        }
 
+       dd->batching = 0;
+
 dispatch_request:
        /*
         * rq is the selected appropriate request.
index b01dee3ae7f36c1d29014bc91fee09466ed7b922..3b927be038501f178577da45ebb447c6dc27b90f 100644 (file)
@@ -39,7 +39,7 @@
 
 static void blk_unplug_work(struct work_struct *work);
 static void blk_unplug_timeout(unsigned long data);
-static void drive_stat_acct(struct request *rq, int nr_sectors, int new_io);
+static void drive_stat_acct(struct request *rq, int new_io);
 static void init_request_from_bio(struct request *req, struct bio *bio);
 static int __make_request(struct request_queue *q, struct bio *bio);
 static struct io_context *current_io_context(gfp_t gfp_flags, int node);
@@ -791,7 +791,6 @@ static int __blk_free_tags(struct blk_queue_tag *bqt)
        retval = atomic_dec_and_test(&bqt->refcnt);
        if (retval) {
                BUG_ON(bqt->busy);
-               BUG_ON(!list_empty(&bqt->busy_list));
 
                kfree(bqt->tag_index);
                bqt->tag_index = NULL;
@@ -903,7 +902,6 @@ static struct blk_queue_tag *__blk_queue_init_tags(struct request_queue *q,
        if (init_tag_map(q, tags, depth))
                goto fail;
 
-       INIT_LIST_HEAD(&tags->busy_list);
        tags->busy = 0;
        atomic_set(&tags->refcnt, 1);
        return tags;
@@ -954,6 +952,7 @@ int blk_queue_init_tags(struct request_queue *q, int depth,
         */
        q->queue_tags = tags;
        q->queue_flags |= (1 << QUEUE_FLAG_QUEUED);
+       INIT_LIST_HEAD(&q->tag_busy_list);
        return 0;
 fail:
        kfree(tags);
@@ -1057,18 +1056,16 @@ void blk_queue_end_tag(struct request_queue *q, struct request *rq)
 
        bqt->tag_index[tag] = NULL;
 
-       /*
-        * We use test_and_clear_bit's memory ordering properties here.
-        * The tag_map bit acts as a lock for tag_index[bit], so we need
-        * a barrer before clearing the bit (precisely: release semantics).
-        * Could use clear_bit_unlock when it is merged.
-        */
-       if (unlikely(!test_and_clear_bit(tag, bqt->tag_map))) {
+       if (unlikely(!test_bit(tag, bqt->tag_map))) {
                printk(KERN_ERR "%s: attempt to clear non-busy tag (%d)\n",
                       __FUNCTION__, tag);
                return;
        }
-
+       /*
+        * The tag_map bit acts as a lock for tag_index[bit], so we need
+        * unlock memory barrier semantics.
+        */
+       clear_bit_unlock(tag, bqt->tag_map);
        bqt->busy--;
 }
 
@@ -1114,17 +1111,17 @@ int blk_queue_start_tag(struct request_queue *q, struct request *rq)
                if (tag >= bqt->max_depth)
                        return 1;
 
-       } while (test_and_set_bit(tag, bqt->tag_map));
+       } while (test_and_set_bit_lock(tag, bqt->tag_map));
        /*
-        * We rely on test_and_set_bit providing lock memory ordering semantics
-        * (could use test_and_set_bit_lock when it is merged).
+        * We need lock ordering semantics given by test_and_set_bit_lock.
+        * See blk_queue_end_tag for details.
         */
 
        rq->cmd_flags |= REQ_QUEUED;
        rq->tag = tag;
        bqt->tag_index[tag] = rq;
        blkdev_dequeue_request(rq);
-       list_add(&rq->queuelist, &bqt->busy_list);
+       list_add(&rq->queuelist, &q->tag_busy_list);
        bqt->busy++;
        return 0;
 }
@@ -1145,24 +1142,10 @@ EXPORT_SYMBOL(blk_queue_start_tag);
  **/
 void blk_queue_invalidate_tags(struct request_queue *q)
 {
-       struct blk_queue_tag *bqt = q->queue_tags;
        struct list_head *tmp, *n;
-       struct request *rq;
 
-       list_for_each_safe(tmp, n, &bqt->busy_list) {
-               rq = list_entry_rq(tmp);
-
-               if (rq->tag == -1) {
-                       printk(KERN_ERR
-                              "%s: bad tag found on list\n", __FUNCTION__);
-                       list_del_init(&rq->queuelist);
-                       rq->cmd_flags &= ~REQ_QUEUED;
-               } else
-                       blk_queue_end_tag(q, rq);
-
-               rq->cmd_flags &= ~REQ_STARTED;
-               __elv_add_request(q, rq, ELEVATOR_INSERT_BACK, 0);
-       }
+       list_for_each_safe(tmp, n, &q->tag_busy_list)
+               blk_requeue_request(q, list_entry_rq(tmp));
 }
 
 EXPORT_SYMBOL(blk_queue_invalidate_tags);
@@ -1373,7 +1356,7 @@ new_segment:
        } /* segments in rq */
 
        if (sg)
-               __sg_mark_end(sg);
+               sg_mark_end(sg);
 
        return nsegs;
 }
@@ -1638,15 +1621,7 @@ static void blk_backing_dev_unplug(struct backing_dev_info *bdi,
 {
        struct request_queue *q = bdi->unplug_io_data;
 
-       /*
-        * devices don't necessarily have an ->unplug_fn defined
-        */
-       if (q->unplug_fn) {
-               blk_add_trace_pdu_int(q, BLK_TA_UNPLUG_IO, NULL,
-                                       q->rq.count[READ] + q->rq.count[WRITE]);
-
-               q->unplug_fn(q);
-       }
+       blk_unplug(q);
 }
 
 static void blk_unplug_work(struct work_struct *work)
@@ -1670,6 +1645,20 @@ static void blk_unplug_timeout(unsigned long data)
        kblockd_schedule_work(&q->unplug_work);
 }
 
+void blk_unplug(struct request_queue *q)
+{
+       /*
+        * devices don't necessarily have an ->unplug_fn defined
+        */
+       if (q->unplug_fn) {
+               blk_add_trace_pdu_int(q, BLK_TA_UNPLUG_IO, NULL,
+                                       q->rq.count[READ] + q->rq.count[WRITE]);
+
+               q->unplug_fn(q);
+       }
+}
+EXPORT_SYMBOL(blk_unplug);
+
 /**
  * blk_start_queue - restart a previously stopped queue
  * @q:    The &struct request_queue in question
@@ -1738,6 +1727,7 @@ EXPORT_SYMBOL(blk_stop_queue);
 void blk_sync_queue(struct request_queue *q)
 {
        del_timer_sync(&q->unplug_timer);
+       kblockd_flush_work(&q->unplug_work);
 }
 EXPORT_SYMBOL(blk_sync_queue);
 
@@ -2341,7 +2331,7 @@ void blk_insert_request(struct request_queue *q, struct request *rq,
        if (blk_rq_tagged(rq))
                blk_queue_end_tag(q, rq);
 
-       drive_stat_acct(rq, rq->nr_sectors, 1);
+       drive_stat_acct(rq, 1);
        __elv_add_request(q, rq, where, 0);
        blk_start_queueing(q);
        spin_unlock_irqrestore(q->queue_lock, flags);
@@ -2736,7 +2726,7 @@ int blkdev_issue_flush(struct block_device *bdev, sector_t *error_sector)
 
 EXPORT_SYMBOL(blkdev_issue_flush);
 
-static void drive_stat_acct(struct request *rq, int nr_sectors, int new_io)
+static void drive_stat_acct(struct request *rq, int new_io)
 {
        int rw = rq_data_dir(rq);
 
@@ -2758,7 +2748,7 @@ static void drive_stat_acct(struct request *rq, int nr_sectors, int new_io)
  */
 static inline void add_request(struct request_queue * q, struct request * req)
 {
-       drive_stat_acct(req, req->nr_sectors, 1);
+       drive_stat_acct(req, 1);
 
        /*
         * elevator indicated where it wants this request to be
@@ -3015,7 +3005,7 @@ static int __make_request(struct request_queue *q, struct bio *bio)
                        req->biotail = bio;
                        req->nr_sectors = req->hard_nr_sectors += nr_sectors;
                        req->ioprio = ioprio_best(req->ioprio, prio);
-                       drive_stat_acct(req, nr_sectors, 0);
+                       drive_stat_acct(req, 0);
                        if (!attempt_back_merge(q, req))
                                elv_merged_request(q, req, el_ret);
                        goto out;
@@ -3042,7 +3032,7 @@ static int __make_request(struct request_queue *q, struct bio *bio)
                        req->sector = req->hard_sector = bio->bi_sector;
                        req->nr_sectors = req->hard_nr_sectors += nr_sectors;
                        req->ioprio = ioprio_best(req->ioprio, prio);
-                       drive_stat_acct(req, nr_sectors, 0);
+                       drive_stat_acct(req, 0);
                        if (!attempt_front_merge(q, req))
                                elv_merged_request(q, req, el_ret);
                        goto out;
@@ -3224,6 +3214,7 @@ static inline void __generic_make_request(struct bio *bio)
        sector_t old_sector;
        int ret, nr_sectors = bio_sectors(bio);
        dev_t old_dev;
+       int err = -EIO;
 
        might_sleep();
 
@@ -3251,7 +3242,7 @@ static inline void __generic_make_request(struct bio *bio)
                                bdevname(bio->bi_bdev, b),
                                (long long) bio->bi_sector);
 end_io:
-                       bio_endio(bio, -EIO);
+                       bio_endio(bio, err);
                        break;
                }
 
@@ -3286,6 +3277,10 @@ end_io:
 
                if (bio_check_eod(bio, nr_sectors))
                        goto end_io;
+               if (bio_empty_barrier(bio) && !q->prepare_flush_fn) {
+                       err = -EOPNOTSUPP;
+                       goto end_io;
+               }
 
                ret = q->make_request_fn(q, bio);
        } while (ret);
index 8ff8c2656d9c492902a5608436c145965f52723f..8383282de1ddc39422cd227b7a800a095ad14f67 100644 (file)
@@ -95,6 +95,9 @@ static void crypto_remove_spawn(struct crypto_spawn *spawn,
                return;
 
        inst->alg.cra_flags |= CRYPTO_ALG_DEAD;
+       if (hlist_unhashed(&inst->list))
+               return;
+
        if (!tmpl || !crypto_tmpl_get(tmpl))
                return;
 
@@ -335,9 +338,6 @@ int crypto_register_instance(struct crypto_template *tmpl,
        LIST_HEAD(list);
        int err = -EINVAL;
 
-       if (inst->alg.cra_destroy)
-               goto err;
-
        err = crypto_check_alg(&inst->alg);
        if (err)
                goto err;
index 1c771f7f4dc5ee355d2f6d84ac6c76a547591fd8..4ff0e1e243ad331f07aba9d5423df61f37a4764c 100644 (file)
@@ -33,7 +33,6 @@
 #include <linux/module.h>
 #include <linux/mm.h>
 #include <asm/byteorder.h>
-#include <asm/scatterlist.h>
 #include <linux/crypto.h>
 #include <linux/types.h>
 
index 0b29a6ae673d257baba2eb5b1a17460e28204f4a..126a529b496d5df32959499ff22739767eca52a3 100644 (file)
@@ -84,8 +84,8 @@ static int crypto_authenc_hash(struct aead_request *req)
                .tfm = auth,
        };
        u8 *hash = aead_request_ctx(req);
-       struct scatterlist *dst;
-       unsigned int cryptlen;
+       struct scatterlist *dst = req->dst;
+       unsigned int cryptlen = req->cryptlen;
        int err;
 
        hash = (u8 *)ALIGN((unsigned long)hash + crypto_hash_alignmask(auth), 
@@ -100,8 +100,6 @@ static int crypto_authenc_hash(struct aead_request *req)
        if (err)
                goto auth_unlock;
 
-       cryptlen = req->cryptlen;
-       dst = req->dst;
        err = crypto_hash_update(&desc, dst, cryptlen);
        if (err)
                goto auth_unlock;
@@ -159,8 +157,8 @@ static int crypto_authenc_verify(struct aead_request *req)
        };
        u8 *ohash = aead_request_ctx(req);
        u8 *ihash;
-       struct scatterlist *src;
-       unsigned int cryptlen;
+       struct scatterlist *src = req->src;
+       unsigned int cryptlen = req->cryptlen;
        unsigned int authsize;
        int err;
 
@@ -177,8 +175,6 @@ static int crypto_authenc_verify(struct aead_request *req)
        if (err)
                goto auth_unlock;
 
-       cryptlen = req->cryptlen;
-       src = req->src;
        err = crypto_hash_update(&desc, src, cryptlen);
        if (err)
                goto auth_unlock;
index 55238c4e37f039c59872d5b049707a41cebc5160..80c3fd8be97cd729157a347f22f8b74b494ac4a1 100644 (file)
@@ -20,7 +20,6 @@
 #include <linux/module.h>
 #include <linux/mm.h>
 #include <asm/byteorder.h>
-#include <asm/scatterlist.h>
 #include <linux/crypto.h>
 #include <linux/types.h>
 
index 0a6570048c1efb6ffaf6199662e4e33ee7ae9010..1ee357085d3a40bfdd8e3013e7fc7b501eb32948 100644 (file)
@@ -14,7 +14,6 @@
 #include <linux/types.h>
 #include <linux/crypto.h>
 #include <linux/errno.h>
-#include <asm/scatterlist.h>
 #include <linux/string.h>
 #include "internal.h"
 
index 24dbb5d8617e03584bc7dd4938b06ea2736488b2..29f77477d701859e5dc34c72035d2c9e39108c67 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/mm.h>
-#include <asm/scatterlist.h>
 #include <linux/crypto.h>
 #include <linux/string.h>
 
index 9fa24a2dd6ffbee4e9c7aff2d06b6f3b51cf8388..704ebfe26b55e903d55c902d219e01340159d7e7 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/module.h>
 #include <linux/mm.h>
 #include <asm/byteorder.h>
-#include <asm/scatterlist.h>
 #include <linux/crypto.h>
 #include <linux/types.h>
 
index 48a3c3e0bf5f8b4fb974c2e8aeddabb80fca8043..68c62f528eb59ed86c40086e4261c5824792bcaf 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/cryptohash.h>
 #include <linux/types.h>
 #include <crypto/sha.h>
-#include <asm/scatterlist.h>
 #include <asm/byteorder.h>
 
 struct sha1_ctx {
index 5f4332edcf6ba64b4e18d43406322c200f4fb63d..fd3918be58b51be9637a854f3bab569032b9f3a0 100644 (file)
@@ -22,7 +22,6 @@
 #include <linux/crypto.h>
 #include <linux/types.h>
 #include <crypto/sha.h>
-#include <asm/scatterlist.h>
 #include <asm/byteorder.h>
 
 struct sha256_ctx {
index e736596ca5741a86adf19f44129b0a4399eecdd6..c39c803ecc02dabc90bddecf52c837efdea6c902 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/types.h>
 #include <crypto/sha.h>
 
-#include <asm/scatterlist.h>
 #include <asm/byteorder.h>
 
 struct sha512_ctx {
index 1c54e26fa529342d6ee893b7636233f9c317f3ba..6893b3fdf9d6e9c4408b392df117bbebb06cc0a3 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/module.h>
 #include <linux/mm.h>
 #include <asm/byteorder.h>
-#include <asm/scatterlist.h>
 #include <linux/crypto.h>
 #include <linux/types.h>
 
index a0fadf3dd3e2d094bc635464c33781c4ab8be88c..2e7ea1680c7f72a6e3e945fac880ccad40c41183 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/module.h>
 #include <linux/mm.h>
 #include <asm/byteorder.h>
-#include <asm/scatterlist.h>
 #include <linux/crypto.h>
 #include <linux/types.h>
 
index 727d05a19ff4e4ada1d23b09ca9303ee70243352..f746952b93fc8eb411d5dd78d9a16ecc61707bb9 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/module.h>
 #include <linux/mm.h>
 #include <asm/byteorder.h>
-#include <asm/scatterlist.h>
 #include <linux/crypto.h>
 #include <linux/types.h>
 
index 5d0e26a5c34cd55455ee776891acac0e861b93f6..b9f923ef173d8fc283e2122bc600e59039f0f396 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 menuconfig ACPI
-       bool "ACPI Support (Advanced Configuration and Power Interface) Support"
+       bool "ACPI (Advanced Configuration and Power Interface) Support"
        depends on !X86_NUMAQ
        depends on !X86_VISWS
        depends on !IA64_HP_SIM
@@ -67,7 +67,21 @@ config ACPI_PROCFS
          and functions which do not yet exist in /sys.
 
          Say N to delete /proc/acpi/ files that have moved to /sys/
-
+config ACPI_PROCFS_POWER
+       bool "Deprecated power /proc/acpi folders"
+       depends on PROC_FS
+       default y
+       ---help---
+         For backwards compatibility, this option allows
+          deprecated power /proc/acpi/ folders to exist, even when
+          they have been replaced by functions in /sys.
+          The deprecated folders (and their replacements) include:
+         /proc/acpi/battery/* (/sys/class/power_supply/*)
+         /proc/acpi/ac_adapter/* (sys/class/power_supply/*)
+         This option has no effect on /proc/acpi/ folders
+         and functions, which do not yet exist in /sys
+
+         Say N to delete power /proc/acpi/ folders that have moved to /sys/
 config ACPI_PROC_EVENT
        bool "Deprecated /proc/acpi/event support"
        depends on PROC_FS
@@ -88,7 +102,8 @@ config ACPI_PROC_EVENT
 
 config ACPI_AC
        tristate "AC Adapter"
-       depends on X86 && POWER_SUPPLY
+       depends on X86
+       select POWER_SUPPLY
        default y
        help
          This driver adds support for the AC Adapter object, which indicates
@@ -97,7 +112,8 @@ config ACPI_AC
 
 config ACPI_BATTERY
        tristate "Battery"
-       depends on X86 && POWER_SUPPLY
+       depends on X86
+       select POWER_SUPPLY
        default y
        help
          This driver adds support for battery information through
@@ -352,7 +368,7 @@ config ACPI_HOTPLUG_MEMORY
 config ACPI_SBS
        tristate "Smart Battery System"
        depends on X86
-       depends on POWER_SUPPLY
+       select POWER_SUPPLY
        help
          This driver adds support for the Smart Battery System, another
          type of access to battery information, found on some laptops.
index 54e3ab0e5fc011e3a807eec08304a2603251fbbb..456446f9007780eac345479b5fc9d173ddfdbe7c 100644 (file)
@@ -58,6 +58,6 @@ obj-$(CONFIG_ACPI_NUMA)               += numa.o
 obj-$(CONFIG_ACPI_ASUS)                += asus_acpi.o
 obj-$(CONFIG_ACPI_TOSHIBA)     += toshiba_acpi.o
 obj-$(CONFIG_ACPI_HOTPLUG_MEMORY)      += acpi_memhotplug.o
-obj-y                          += cm_sbs.o
+obj-$(CONFIG_ACPI_PROCFS_POWER)        += cm_sbs.o
 obj-$(CONFIG_ACPI_SBS)         += sbs.o
 obj-$(CONFIG_ACPI_SBS)         += sbshc.o
index e03de37a750d547d7e69d91264b224500dc063b8..76ed4f52bebd6df84be95abc388fa45a8d5e35d0 100644 (file)
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/types.h>
+#ifdef CONFIG_ACPI_PROCFS_POWER
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
+#endif
 #include <linux/power_supply.h>
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
@@ -49,12 +51,15 @@ MODULE_AUTHOR("Paul Diefenbaugh");
 MODULE_DESCRIPTION("ACPI AC Adapter Driver");
 MODULE_LICENSE("GPL");
 
+#ifdef CONFIG_ACPI_PROCFS_POWER
 extern struct proc_dir_entry *acpi_lock_ac_dir(void);
 extern void *acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir);
+static int acpi_ac_open_fs(struct inode *inode, struct file *file);
+#endif
 
 static int acpi_ac_add(struct acpi_device *device);
 static int acpi_ac_remove(struct acpi_device *device, int type);
-static int acpi_ac_open_fs(struct inode *inode, struct file *file);
+static int acpi_ac_resume(struct acpi_device *device);
 
 const static struct acpi_device_id ac_device_ids[] = {
        {"ACPI0003", 0},
@@ -69,6 +74,7 @@ static struct acpi_driver acpi_ac_driver = {
        .ops = {
                .add = acpi_ac_add,
                .remove = acpi_ac_remove,
+               .resume = acpi_ac_resume,
                },
 };
 
@@ -80,12 +86,15 @@ struct acpi_ac {
 
 #define to_acpi_ac(x) container_of(x, struct acpi_ac, charger);
 
+#ifdef CONFIG_ACPI_PROCFS_POWER
 static const struct file_operations acpi_ac_fops = {
        .open = acpi_ac_open_fs,
        .read = seq_read,
        .llseek = seq_lseek,
        .release = single_release,
 };
+#endif
+
 static int get_ac_property(struct power_supply *psy,
                           enum power_supply_property psp,
                           union power_supply_propval *val)
@@ -127,6 +136,7 @@ static int acpi_ac_get_state(struct acpi_ac *ac)
        return 0;
 }
 
+#ifdef CONFIG_ACPI_PROCFS_POWER
 /* --------------------------------------------------------------------------
                               FS Interface (/proc)
    -------------------------------------------------------------------------- */
@@ -206,6 +216,7 @@ static int acpi_ac_remove_fs(struct acpi_device *device)
 
        return 0;
 }
+#endif
 
 /* --------------------------------------------------------------------------
                                    Driver Model
@@ -264,7 +275,9 @@ static int acpi_ac_add(struct acpi_device *device)
        if (result)
                goto end;
 
+#ifdef CONFIG_ACPI_PROCFS_POWER
        result = acpi_ac_add_fs(device);
+#endif
        if (result)
                goto end;
        ac->charger.name = acpi_device_bid(device);
@@ -287,13 +300,30 @@ static int acpi_ac_add(struct acpi_device *device)
 
       end:
        if (result) {
+#ifdef CONFIG_ACPI_PROCFS_POWER
                acpi_ac_remove_fs(device);
+#endif
                kfree(ac);
        }
 
        return result;
 }
 
+static int acpi_ac_resume(struct acpi_device *device)
+{
+       struct acpi_ac *ac;
+       unsigned old_state;
+       if (!device || !acpi_driver_data(device))
+               return -EINVAL;
+       ac = acpi_driver_data(device);
+       old_state = ac->state;
+       if (acpi_ac_get_state(ac))
+               return 0;
+       if (old_state != ac->state)
+               kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE);
+       return 0;
+}
+
 static int acpi_ac_remove(struct acpi_device *device, int type)
 {
        acpi_status status = AE_OK;
@@ -309,7 +339,9 @@ static int acpi_ac_remove(struct acpi_device *device, int type)
                                            ACPI_ALL_NOTIFY, acpi_ac_notify);
        if (ac->charger.dev)
                power_supply_unregister(&ac->charger);
+#ifdef CONFIG_ACPI_PROCFS_POWER
        acpi_ac_remove_fs(device);
+#endif
 
        kfree(ac);
 
@@ -323,13 +355,17 @@ static int __init acpi_ac_init(void)
        if (acpi_disabled)
                return -ENODEV;
 
+#ifdef CONFIG_ACPI_PROCFS_POWER
        acpi_ac_dir = acpi_lock_ac_dir();
        if (!acpi_ac_dir)
                return -ENODEV;
+#endif
 
        result = acpi_bus_register_driver(&acpi_ac_driver);
        if (result < 0) {
+#ifdef CONFIG_ACPI_PROCFS_POWER
                acpi_unlock_ac_dir(acpi_ac_dir);
+#endif
                return -ENODEV;
        }
 
@@ -341,7 +377,9 @@ static void __exit acpi_ac_exit(void)
 
        acpi_bus_unregister_driver(&acpi_ac_driver);
 
+#ifdef CONFIG_ACPI_PROCFS_POWER
        acpi_unlock_ac_dir(acpi_ac_dir);
+#endif
 
        return;
 }
index 681e26b56b11c2b37a3e242db63ee9ef1dc6444a..7d6be23eff89f49a81b5ce55c3f44596bd7e4d8c 100644 (file)
@@ -31,7 +31,7 @@
 #include <linux/types.h>
 #include <linux/jiffies.h>
 
-#ifdef CONFIG_ACPI_PROCFS
+#ifdef CONFIG_ACPI_PROCFS_POWER
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 #include <asm/uaccess.h>
@@ -63,7 +63,7 @@ static unsigned int cache_time = 1000;
 module_param(cache_time, uint, 0644);
 MODULE_PARM_DESC(cache_time, "cache time in milliseconds");
 
-#ifdef CONFIG_ACPI_PROCFS
+#ifdef CONFIG_ACPI_PROCFS_POWER
 extern struct proc_dir_entry *acpi_lock_battery_dir(void);
 extern void *acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir);
 
@@ -125,19 +125,25 @@ static int acpi_battery_technology(struct acpi_battery *battery)
                return POWER_SUPPLY_TECHNOLOGY_NiMH;
        if (!strcasecmp("LION", battery->type))
                return POWER_SUPPLY_TECHNOLOGY_LION;
+       if (!strcasecmp("LI-ION", battery->type))
+               return POWER_SUPPLY_TECHNOLOGY_LION;
        if (!strcasecmp("LiP", battery->type))
                return POWER_SUPPLY_TECHNOLOGY_LIPO;
        return POWER_SUPPLY_TECHNOLOGY_UNKNOWN;
 }
 
+static int acpi_battery_get_state(struct acpi_battery *battery);
+
 static int acpi_battery_get_property(struct power_supply *psy,
                                     enum power_supply_property psp,
                                     union power_supply_propval *val)
 {
        struct acpi_battery *battery = to_acpi_battery(psy);
 
-       if ((!acpi_battery_present(battery)) &&
-            psp != POWER_SUPPLY_PROP_PRESENT)
+       if (acpi_battery_present(battery)) {
+               /* run battery update only if it is present */
+               acpi_battery_get_state(battery);
+       } else if (psp != POWER_SUPPLY_PROP_PRESENT)
                return -ENODEV;
        switch (psp) {
        case POWER_SUPPLY_PROP_STATUS:
@@ -147,6 +153,8 @@ static int acpi_battery_get_property(struct power_supply *psy,
                        val->intval = POWER_SUPPLY_STATUS_CHARGING;
                else if (battery->state == 0)
                        val->intval = POWER_SUPPLY_STATUS_FULL;
+               else
+                       val->intval = POWER_SUPPLY_STATUS_UNKNOWN;
                break;
        case POWER_SUPPLY_PROP_PRESENT:
                val->intval = acpi_battery_present(battery);
@@ -215,7 +223,7 @@ static enum power_supply_property energy_battery_props[] = {
        POWER_SUPPLY_PROP_MANUFACTURER,
 };
 
-#ifdef CONFIG_ACPI_PROCFS
+#ifdef CONFIG_ACPI_PROCFS_POWER
 inline char *acpi_battery_units(struct acpi_battery *battery)
 {
        return (battery->power_unit)?"mA":"mW";
@@ -257,7 +265,7 @@ static int extract_package(struct acpi_battery *battery,
                           union acpi_object *package,
                           struct acpi_offsets *offsets, int num)
 {
-       int i, *x;
+       int i;
        union acpi_object *element;
        if (package->type != ACPI_TYPE_PACKAGE)
                return -EFAULT;
@@ -266,16 +274,21 @@ static int extract_package(struct acpi_battery *battery,
                        return -EFAULT;
                element = &package->package.elements[i];
                if (offsets[i].mode) {
-                       if (element->type != ACPI_TYPE_STRING &&
-                           element->type != ACPI_TYPE_BUFFER)
-                               return -EFAULT;
-                       strncpy((u8 *)battery + offsets[i].offset,
-                               element->string.pointer, 32);
+                       u8 *ptr = (u8 *)battery + offsets[i].offset;
+                       if (element->type == ACPI_TYPE_STRING ||
+                           element->type == ACPI_TYPE_BUFFER)
+                               strncpy(ptr, element->string.pointer, 32);
+                       else if (element->type == ACPI_TYPE_INTEGER) {
+                               strncpy(ptr, (u8 *)&element->integer.value,
+                                       sizeof(acpi_integer));
+                               ptr[sizeof(acpi_integer)] = 0;
+                       } else return -EFAULT;
                } else {
-                       if (element->type != ACPI_TYPE_INTEGER)
-                               return -EFAULT;
-                       x = (int *)((u8 *)battery + offsets[i].offset);
-                       *x = element->integer.value;
+                       if (element->type == ACPI_TYPE_INTEGER) {
+                               int *x = (int *)((u8 *)battery +
+                                               offsets[i].offset);
+                               *x = element->integer.value;
+                       } else return -EFAULT;
                }
        }
        return 0;
@@ -385,29 +398,82 @@ static int acpi_battery_init_alarm(struct acpi_battery *battery)
        return acpi_battery_set_alarm(battery);
 }
 
+static ssize_t acpi_battery_alarm_show(struct device *dev,
+                                       struct device_attribute *attr,
+                                       char *buf)
+{
+       struct acpi_battery *battery = to_acpi_battery(dev_get_drvdata(dev));
+       return sprintf(buf, "%d\n", battery->alarm * 1000);
+}
+
+static ssize_t acpi_battery_alarm_store(struct device *dev,
+                                       struct device_attribute *attr,
+                                       const char *buf, size_t count)
+{
+       unsigned long x;
+       struct acpi_battery *battery = to_acpi_battery(dev_get_drvdata(dev));
+       if (sscanf(buf, "%ld\n", &x) == 1)
+               battery->alarm = x/1000;
+       if (acpi_battery_present(battery))
+               acpi_battery_set_alarm(battery);
+       return count;
+}
+
+static struct device_attribute alarm_attr = {
+       .attr = {.name = "alarm", .mode = 0644, .owner = THIS_MODULE},
+       .show = acpi_battery_alarm_show,
+       .store = acpi_battery_alarm_store,
+};
+
+static int sysfs_add_battery(struct acpi_battery *battery)
+{
+       int result;
+
+       battery->update_time = 0;
+       result = acpi_battery_get_info(battery);
+       acpi_battery_init_alarm(battery);
+       if (result)
+               return result;
+       if (battery->power_unit) {
+               battery->bat.properties = charge_battery_props;
+               battery->bat.num_properties =
+                       ARRAY_SIZE(charge_battery_props);
+       } else {
+               battery->bat.properties = energy_battery_props;
+               battery->bat.num_properties =
+                       ARRAY_SIZE(energy_battery_props);
+       }
+
+       battery->bat.name = acpi_device_bid(battery->device);
+       battery->bat.type = POWER_SUPPLY_TYPE_BATTERY;
+       battery->bat.get_property = acpi_battery_get_property;
+
+       result = power_supply_register(&battery->device->dev, &battery->bat);
+       if (result)
+               return result;
+       return device_create_file(battery->bat.dev, &alarm_attr);
+}
+
+static void sysfs_remove_battery(struct acpi_battery *battery)
+{
+       if (!battery->bat.dev)
+               return;
+       device_remove_file(battery->bat.dev, &alarm_attr);
+       power_supply_unregister(&battery->bat);
+       battery->bat.dev = NULL;
+}
+
 static int acpi_battery_update(struct acpi_battery *battery)
 {
-       int saved_present = acpi_battery_present(battery);
        int result = acpi_battery_get_status(battery);
-       if (result || !acpi_battery_present(battery))
+       if (result)
                return result;
-       if (saved_present != acpi_battery_present(battery) ||
-           !battery->update_time) {
-               battery->update_time = 0;
-               result = acpi_battery_get_info(battery);
-               if (result)
-                       return result;
-               if (battery->power_unit) {
-                       battery->bat.properties = charge_battery_props;
-                       battery->bat.num_properties =
-                               ARRAY_SIZE(charge_battery_props);
-               } else {
-                       battery->bat.properties = energy_battery_props;
-                       battery->bat.num_properties =
-                               ARRAY_SIZE(energy_battery_props);
-               }
-               acpi_battery_init_alarm(battery);
+       if (!acpi_battery_present(battery)) {
+               sysfs_remove_battery(battery);
+               return 0;
        }
+       if (!battery->bat.dev)
+               sysfs_add_battery(battery);
        return acpi_battery_get_state(battery);
 }
 
@@ -415,7 +481,7 @@ static int acpi_battery_update(struct acpi_battery *battery)
                               FS Interface (/proc)
    -------------------------------------------------------------------------- */
 
-#ifdef CONFIG_ACPI_PROCFS
+#ifdef CONFIG_ACPI_PROCFS_POWER
 static struct proc_dir_entry *acpi_battery_dir;
 
 static int acpi_battery_print_info(struct seq_file *seq, int result)
@@ -554,10 +620,6 @@ static ssize_t acpi_battery_write_alarm(struct file *file,
 
        if (!battery || (count > sizeof(alarm_string) - 1))
                return -EINVAL;
-       if (result) {
-               result = -ENODEV;
-               goto end;
-       }
        if (!acpi_battery_present(battery)) {
                result = -ENODEV;
                goto end;
@@ -688,33 +750,6 @@ static void acpi_battery_remove_fs(struct acpi_device *device)
 
 #endif
 
-static ssize_t acpi_battery_alarm_show(struct device *dev,
-                                       struct device_attribute *attr,
-                                       char *buf)
-{
-       struct acpi_battery *battery = to_acpi_battery(dev_get_drvdata(dev));
-       return sprintf(buf, "%d\n", battery->alarm * 1000);
-}
-
-static ssize_t acpi_battery_alarm_store(struct device *dev,
-                                       struct device_attribute *attr,
-                                       const char *buf, size_t count)
-{
-       unsigned long x;
-       struct acpi_battery *battery = to_acpi_battery(dev_get_drvdata(dev));
-       if (sscanf(buf, "%ld\n", &x) == 1)
-               battery->alarm = x/1000;
-       if (acpi_battery_present(battery))
-               acpi_battery_set_alarm(battery);
-       return count;
-}
-
-static struct device_attribute alarm_attr = {
-       .attr = {.name = "alarm", .mode = 0644, .owner = THIS_MODULE},
-       .show = acpi_battery_alarm_show,
-       .store = acpi_battery_alarm_store,
-};
-
 /* --------------------------------------------------------------------------
                                  Driver Interface
    -------------------------------------------------------------------------- */
@@ -732,7 +767,9 @@ static void acpi_battery_notify(acpi_handle handle, u32 event, void *data)
        acpi_bus_generate_netlink_event(device->pnp.device_class,
                                        device->dev.bus_id, event,
                                        acpi_battery_present(battery));
-       kobject_uevent(&battery->bat.dev->kobj, KOBJ_CHANGE);
+       /* acpi_batter_update could remove power_supply object */
+       if (battery->bat.dev)
+               kobject_uevent(&battery->bat.dev->kobj, KOBJ_CHANGE);
 }
 
 static int acpi_battery_add(struct acpi_device *device)
@@ -751,16 +788,11 @@ static int acpi_battery_add(struct acpi_device *device)
        acpi_driver_data(device) = battery;
        mutex_init(&battery->lock);
        acpi_battery_update(battery);
-#ifdef CONFIG_ACPI_PROCFS
+#ifdef CONFIG_ACPI_PROCFS_POWER
        result = acpi_battery_add_fs(device);
        if (result)
                goto end;
 #endif
-       battery->bat.name = acpi_device_bid(device);
-       battery->bat.type = POWER_SUPPLY_TYPE_BATTERY;
-       battery->bat.get_property = acpi_battery_get_property;
-       result = power_supply_register(&battery->device->dev, &battery->bat);
-       result = device_create_file(battery->bat.dev, &alarm_attr);
        status = acpi_install_notify_handler(device->handle,
                                             ACPI_ALL_NOTIFY,
                                             acpi_battery_notify, battery);
@@ -774,7 +806,7 @@ static int acpi_battery_add(struct acpi_device *device)
               device->status.battery_present ? "present" : "absent");
       end:
        if (result) {
-#ifdef CONFIG_ACPI_PROCFS
+#ifdef CONFIG_ACPI_PROCFS_POWER
                acpi_battery_remove_fs(device);
 #endif
                kfree(battery);
@@ -793,13 +825,10 @@ static int acpi_battery_remove(struct acpi_device *device, int type)
        status = acpi_remove_notify_handler(device->handle,
                                            ACPI_ALL_NOTIFY,
                                            acpi_battery_notify);
-#ifdef CONFIG_ACPI_PROCFS
+#ifdef CONFIG_ACPI_PROCFS_POWER
        acpi_battery_remove_fs(device);
 #endif
-       if (battery->bat.dev) {
-               device_remove_file(battery->bat.dev, &alarm_attr);
-               power_supply_unregister(&battery->bat);
-       }
+       sysfs_remove_battery(battery);
        mutex_destroy(&battery->lock);
        kfree(battery);
        return 0;
@@ -813,6 +842,7 @@ static int acpi_battery_resume(struct acpi_device *device)
                return -EINVAL;
        battery = acpi_driver_data(device);
        battery->update_time = 0;
+       acpi_battery_update(battery);
        return 0;
 }
 
@@ -831,13 +861,13 @@ static int __init acpi_battery_init(void)
 {
        if (acpi_disabled)
                return -ENODEV;
-#ifdef CONFIG_ACPI_PROCFS
+#ifdef CONFIG_ACPI_PROCFS_POWER
        acpi_battery_dir = acpi_lock_battery_dir();
        if (!acpi_battery_dir)
                return -ENODEV;
 #endif
        if (acpi_bus_register_driver(&acpi_battery_driver) < 0) {
-#ifdef CONFIG_ACPI_PROCFS
+#ifdef CONFIG_ACPI_PROCFS_POWER
                acpi_unlock_battery_dir(acpi_battery_dir);
 #endif
                return -ENODEV;
@@ -848,7 +878,7 @@ static int __init acpi_battery_init(void)
 static void __exit acpi_battery_exit(void)
 {
        acpi_bus_unregister_driver(&acpi_battery_driver);
-#ifdef CONFIG_ACPI_PROCFS
+#ifdef CONFIG_ACPI_PROCFS_POWER
        acpi_unlock_battery_dir(acpi_battery_dir);
 #endif
 }
index fb2cff9a2d24679cf99e9c82b9f04a4e32ea4bb0..49d432d0a12c6d7682b5325015f6612124058d19 100644 (file)
@@ -198,12 +198,10 @@ int acpi_bus_set_power(acpi_handle handle, int state)
                return -ENODEV;
        }
        /*
-        * Get device's current power state if it's unknown
-        * This means device power state isn't initialized or previous setting failed
+        * Get device's current power state
         */
-       if ((device->power.state == ACPI_STATE_UNKNOWN) || device->flags.force_power_state)
-               acpi_bus_get_power(device->handle, &device->power.state);
-       if ((state == device->power.state) && !device->flags.force_power_state) {
+       acpi_bus_get_power(device->handle, &device->power.state);
+       if (state == device->power.state) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at D%d\n",
                                  state));
                return 0;
index 301e832e6961290912396f92fd54244f30b5ba7f..24a7865a57cb2515c740fbee5d9b038ca3927630 100644 (file)
@@ -78,6 +78,7 @@ MODULE_DEVICE_TABLE(acpi, button_device_ids);
 
 static int acpi_button_add(struct acpi_device *device);
 static int acpi_button_remove(struct acpi_device *device, int type);
+static int acpi_button_resume(struct acpi_device *device);
 static int acpi_button_info_open_fs(struct inode *inode, struct file *file);
 static int acpi_button_state_open_fs(struct inode *inode, struct file *file);
 
@@ -87,6 +88,7 @@ static struct acpi_driver acpi_button_driver = {
        .ids = button_device_ids,
        .ops = {
                .add = acpi_button_add,
+               .resume = acpi_button_resume,
                .remove = acpi_button_remove,
        },
 };
@@ -253,6 +255,19 @@ static int acpi_button_remove_fs(struct acpi_device *device)
 /* --------------------------------------------------------------------------
                                 Driver Interface
    -------------------------------------------------------------------------- */
+static int acpi_lid_send_state(struct acpi_button *button)
+{
+       unsigned long state;
+       acpi_status status;
+
+       status = acpi_evaluate_integer(button->device->handle, "_LID", NULL,
+                                       &state);
+       if (ACPI_FAILURE(status))
+               return -ENODEV;
+       /* input layer checks if event is redundant */
+       input_report_switch(button->input, SW_LID, !state);
+       return 0;
+}
 
 static void acpi_button_notify(acpi_handle handle, u32 event, void *data)
 {
@@ -265,15 +280,8 @@ static void acpi_button_notify(acpi_handle handle, u32 event, void *data)
        switch (event) {
        case ACPI_BUTTON_NOTIFY_STATUS:
                input = button->input;
-
                if (button->type == ACPI_BUTTON_TYPE_LID) {
-                       struct acpi_handle *handle = button->device->handle;
-                       unsigned long state;
-
-                       if (!ACPI_FAILURE(acpi_evaluate_integer(handle, "_LID",
-                                                               NULL, &state)))
-                               input_report_switch(input, SW_LID, !state);
-
+                       acpi_lid_send_state(button);
                } else {
                        int keycode = test_bit(KEY_SLEEP, input->keybit) ?
                                                KEY_SLEEP : KEY_POWER;
@@ -336,6 +344,17 @@ static int acpi_button_install_notify_handlers(struct acpi_button *button)
        return ACPI_FAILURE(status) ? -ENODEV : 0;
 }
 
+static int acpi_button_resume(struct acpi_device *device)
+{
+       struct acpi_button *button;
+       if (!device)
+               return -EINVAL;
+       button = acpi_driver_data(device);
+       if (button && button->type == ACPI_BUTTON_TYPE_LID)
+               return acpi_lid_send_state(button);
+       return 0;
+}
+
 static void acpi_button_remove_notify_handlers(struct acpi_button *button)
 {
        switch (button->type) {
@@ -453,6 +472,8 @@ static int acpi_button_add(struct acpi_device *device)
        error = input_register_device(input);
        if (error)
                goto err_remove_handlers;
+       if (button->type == ACPI_BUTTON_TYPE_LID)
+               acpi_lid_send_state(button);
 
        if (device->wakeup.flags.valid) {
                /* Button's GPE is run-wake GPE */
index 7b4178393e34856e8b6525a0c476a99a37b6962e..d411017f8c066994cc0c06065a0776b9105397d6 100644 (file)
@@ -47,6 +47,9 @@
 #undef PREFIX
 #define PREFIX                         "ACPI: EC: "
 
+/* Uncomment next line to get verbose print outs*/
+/* #define DEBUG */
+
 /* EC status register */
 #define ACPI_EC_FLAG_OBF       0x01    /* Output buffer full */
 #define ACPI_EC_FLAG_IBF       0x02    /* Input buffer full */
@@ -65,16 +68,21 @@ enum ec_command {
 /* EC events */
 enum ec_event {
        ACPI_EC_EVENT_OBF_1 = 1,        /* Output buffer full */
-       ACPI_EC_EVENT_IBF_0,    /* Input buffer empty */
+       ACPI_EC_EVENT_IBF_0,            /* Input buffer empty */
 };
 
 #define ACPI_EC_DELAY          500     /* Wait 500ms max. during EC ops */
 #define ACPI_EC_UDELAY_GLK     1000    /* Wait 1ms max. to get global lock */
 
-static enum ec_mode {
-       EC_INTR = 1,            /* Output buffer full */
-       EC_POLL,                /* Input buffer empty */
-} acpi_ec_mode = EC_INTR;
+enum {
+       EC_FLAGS_WAIT_GPE = 0,          /* Don't check status until GPE arrives */
+       EC_FLAGS_QUERY_PENDING,         /* Query is pending */
+       EC_FLAGS_GPE_MODE,              /* Expect GPE to be sent for status change */
+       EC_FLAGS_NO_ADDRESS_GPE,        /* Expect GPE only for non-address event */
+       EC_FLAGS_ADDRESS,               /* Address is being written */
+       EC_FLAGS_NO_WDATA_GPE,          /* Don't expect WDATA GPE event */
+       EC_FLAGS_WDATA,                 /* Data is being written */
+};
 
 static int acpi_ec_remove(struct acpi_device *device, int type);
 static int acpi_ec_start(struct acpi_device *device);
@@ -116,9 +124,8 @@ static struct acpi_ec {
        unsigned long command_addr;
        unsigned long data_addr;
        unsigned long global_lock;
+       unsigned long flags;
        struct mutex lock;
-       atomic_t query_pending;
-       atomic_t event_count;
        wait_queue_head_t wait;
        struct list_head list;
        u8 handlers_installed;
@@ -130,64 +137,95 @@ static struct acpi_ec {
 
 static inline u8 acpi_ec_read_status(struct acpi_ec *ec)
 {
-       return inb(ec->command_addr);
+       u8 x = inb(ec->command_addr);
+       pr_debug(PREFIX "---> status = 0x%2x\n", x);
+       return x;
 }
 
 static inline u8 acpi_ec_read_data(struct acpi_ec *ec)
 {
+       u8 x = inb(ec->data_addr);
+       pr_debug(PREFIX "---> data = 0x%2x\n", x);
        return inb(ec->data_addr);
 }
 
 static inline void acpi_ec_write_cmd(struct acpi_ec *ec, u8 command)
 {
+       pr_debug(PREFIX "<--- command = 0x%2x\n", command);
        outb(command, ec->command_addr);
 }
 
 static inline void acpi_ec_write_data(struct acpi_ec *ec, u8 data)
 {
+       pr_debug(PREFIX "<--- data = 0x%2x\n", data);
        outb(data, ec->data_addr);
 }
 
-static inline int acpi_ec_check_status(struct acpi_ec *ec, enum ec_event event,
-                                      unsigned old_count)
+static inline int acpi_ec_check_status(struct acpi_ec *ec, enum ec_event event)
 {
-       u8 status = acpi_ec_read_status(ec);
-       if (old_count == atomic_read(&ec->event_count))
+       if (test_bit(EC_FLAGS_WAIT_GPE, &ec->flags))
                return 0;
        if (event == ACPI_EC_EVENT_OBF_1) {
-               if (status & ACPI_EC_FLAG_OBF)
+               if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_OBF)
                        return 1;
        } else if (event == ACPI_EC_EVENT_IBF_0) {
-               if (!(status & ACPI_EC_FLAG_IBF))
+               if (!(acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF))
                        return 1;
        }
 
        return 0;
 }
 
-static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event,
-                        unsigned count, int force_poll)
+static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event, int force_poll)
 {
-       if (unlikely(force_poll) || acpi_ec_mode == EC_POLL) {
+       int ret = 0;
+       if (unlikely(test_bit(EC_FLAGS_ADDRESS, &ec->flags) &&
+                    test_bit(EC_FLAGS_NO_ADDRESS_GPE, &ec->flags)))
+               force_poll = 1;
+       if (unlikely(test_bit(EC_FLAGS_WDATA, &ec->flags) &&
+                    test_bit(EC_FLAGS_NO_WDATA_GPE, &ec->flags)))
+               force_poll = 1;
+       if (likely(test_bit(EC_FLAGS_GPE_MODE, &ec->flags)) &&
+           likely(!force_poll)) {
+               if (wait_event_timeout(ec->wait, acpi_ec_check_status(ec, event),
+                                      msecs_to_jiffies(ACPI_EC_DELAY)))
+                       goto end;
+               clear_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
+               if (acpi_ec_check_status(ec, event)) {
+                       if (test_bit(EC_FLAGS_ADDRESS, &ec->flags)) {
+                               /* miss address GPE, don't expect it anymore */
+                               pr_info(PREFIX "missing address confirmation, "
+                                       "don't expect it any longer.\n");
+                               set_bit(EC_FLAGS_NO_ADDRESS_GPE, &ec->flags);
+                       } else if (test_bit(EC_FLAGS_WDATA, &ec->flags)) {
+                               /* miss write data GPE, don't expect it */
+                               pr_info(PREFIX "missing write data confirmation, "
+                                       "don't expect it any longer.\n");
+                               set_bit(EC_FLAGS_NO_WDATA_GPE, &ec->flags);
+                       } else {
+                               /* missing GPEs, switch back to poll mode */
+                               if (printk_ratelimit())
+                                       pr_info(PREFIX "missing confirmations, "
+                                               "switch off interrupt mode.\n");
+                               clear_bit(EC_FLAGS_GPE_MODE, &ec->flags);
+                       }
+                       goto end;
+               }
+       } else {
                unsigned long delay = jiffies + msecs_to_jiffies(ACPI_EC_DELAY);
+               clear_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
                while (time_before(jiffies, delay)) {
-                       if (acpi_ec_check_status(ec, event, 0))
-                               return 0;
+                       if (acpi_ec_check_status(ec, event))
+                               goto end;
                }
-       } else {
-               if (wait_event_timeout(ec->wait,
-                                      acpi_ec_check_status(ec, event, count),
-                                      msecs_to_jiffies(ACPI_EC_DELAY)) ||
-                   acpi_ec_check_status(ec, event, 0)) {
-                       return 0;
-               } else {
-                       printk(KERN_ERR PREFIX "acpi_ec_wait timeout,"
+       }
+       pr_err(PREFIX "acpi_ec_wait timeout,"
                               " status = %d, expect_event = %d\n",
                               acpi_ec_read_status(ec), event);
-               }
-       }
-
-       return -ETIME;
+       ret = -ETIME;
+      end:
+       clear_bit(EC_FLAGS_ADDRESS, &ec->flags);
+       return ret;
 }
 
 static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, u8 command,
@@ -196,42 +234,47 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, u8 command,
                                        int force_poll)
 {
        int result = 0;
-       unsigned count = atomic_read(&ec->event_count);
+       set_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
        acpi_ec_write_cmd(ec, command);
-
+       pr_debug(PREFIX "transaction start\n");
        for (; wdata_len > 0; --wdata_len) {
-               result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, count, force_poll);
+               result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, force_poll);
                if (result) {
-                       printk(KERN_ERR PREFIX
+                       pr_err(PREFIX
                               "write_cmd timeout, command = %d\n", command);
                        goto end;
                }
-               count = atomic_read(&ec->event_count);
+               /* mark the address byte written to EC */
+               if (rdata_len + wdata_len > 1)
+                       set_bit(EC_FLAGS_ADDRESS, &ec->flags);
+               set_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
                acpi_ec_write_data(ec, *(wdata++));
        }
 
        if (!rdata_len) {
-               result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, count, force_poll);
+               set_bit(EC_FLAGS_WDATA, &ec->flags);
+               result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, force_poll);
                if (result) {
-                       printk(KERN_ERR PREFIX
+                       pr_err(PREFIX
                               "finish-write timeout, command = %d\n", command);
                        goto end;
                }
-       } else if (command == ACPI_EC_COMMAND_QUERY) {
-               atomic_set(&ec->query_pending, 0);
-       }
+       } else if (command == ACPI_EC_COMMAND_QUERY)
+               clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags);
 
        for (; rdata_len > 0; --rdata_len) {
-               result = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF_1, count, force_poll);
+               result = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF_1, force_poll);
                if (result) {
-                       printk(KERN_ERR PREFIX "read timeout, command = %d\n",
-                              command);
+                       pr_err(PREFIX "read timeout, command = %d\n", command);
                        goto end;
                }
-               count = atomic_read(&ec->event_count);
+               /* Don't expect GPE after last read */
+               if (rdata_len > 1)
+                       set_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
                *(rdata++) = acpi_ec_read_data(ec);
        }
       end:
+       pr_debug(PREFIX "transaction end\n");
        return result;
 }
 
@@ -258,13 +301,10 @@ static int acpi_ec_transaction(struct acpi_ec *ec, u8 command,
                }
        }
 
-       /* Make sure GPE is enabled before doing transaction */
-       acpi_enable_gpe(NULL, ec->gpe, ACPI_NOT_ISR);
-
-       status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, 0, 0);
+       status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, 0);
        if (status) {
-               printk(KERN_ERR PREFIX
-                      "input buffer is not empty, aborting transaction\n");
+               pr_err(PREFIX "input buffer is not empty, "
+                               "aborting transaction\n");
                goto end;
        }
 
@@ -435,9 +475,9 @@ EXPORT_SYMBOL_GPL(acpi_ec_add_query_handler);
 
 void acpi_ec_remove_query_handler(struct acpi_ec *ec, u8 query_bit)
 {
-       struct acpi_ec_query_handler *handler;
+       struct acpi_ec_query_handler *handler, *tmp;
        mutex_lock(&ec->lock);
-       list_for_each_entry(handler, &ec->list, node) {
+       list_for_each_entry_safe(handler, tmp, &ec->list, node) {
                if (query_bit == handler->query_bit) {
                        list_del(&handler->node);
                        kfree(handler);
@@ -476,23 +516,26 @@ static void acpi_ec_gpe_query(void *ec_cxt)
 static u32 acpi_ec_gpe_handler(void *data)
 {
        acpi_status status = AE_OK;
-       u8 value;
        struct acpi_ec *ec = data;
 
-       atomic_inc(&ec->event_count);
-
-       if (acpi_ec_mode == EC_INTR) {
+       pr_debug(PREFIX "~~~> interrupt\n");
+       clear_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
+       if (test_bit(EC_FLAGS_GPE_MODE, &ec->flags))
                wake_up(&ec->wait);
-       }
 
-       value = acpi_ec_read_status(ec);
-       if ((value & ACPI_EC_FLAG_SCI) && !atomic_read(&ec->query_pending)) {
-               atomic_set(&ec->query_pending, 1);
-               status =
-                   acpi_os_execute(OSL_EC_BURST_HANDLER, acpi_ec_gpe_query, ec);
+       if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_SCI) {
+               if (!test_and_set_bit(EC_FLAGS_QUERY_PENDING, &ec->flags))
+                       status = acpi_os_execute(OSL_EC_BURST_HANDLER,
+                               acpi_ec_gpe_query, ec);
+       } else if (unlikely(!test_bit(EC_FLAGS_GPE_MODE, &ec->flags))) {
+               /* this is non-query, must be confirmation */
+               if (printk_ratelimit())
+                       pr_info(PREFIX "non-query interrupt received,"
+                               " switching to interrupt mode\n");
+               set_bit(EC_FLAGS_GPE_MODE, &ec->flags);
        }
 
-       return status == AE_OK ?
+       return ACPI_SUCCESS(status) ?
            ACPI_INTERRUPT_HANDLED : ACPI_INTERRUPT_NOT_HANDLED;
 }
 
@@ -641,13 +684,10 @@ static struct acpi_ec *make_acpi_ec(void)
        struct acpi_ec *ec = kzalloc(sizeof(struct acpi_ec), GFP_KERNEL);
        if (!ec)
                return NULL;
-
-       atomic_set(&ec->query_pending, 1);
-       atomic_set(&ec->event_count, 1);
+       ec->flags = 1 << EC_FLAGS_QUERY_PENDING;
        mutex_init(&ec->lock);
        init_waitqueue_head(&ec->wait);
        INIT_LIST_HEAD(&ec->list);
-
        return ec;
 }
 
@@ -693,10 +733,10 @@ static void ec_remove_handlers(struct acpi_ec *ec)
 {
        if (ACPI_FAILURE(acpi_remove_address_space_handler(ec->handle,
                                ACPI_ADR_SPACE_EC, &acpi_ec_space_handler)))
-               printk(KERN_ERR PREFIX "failed to remove space handler\n");
+               pr_err(PREFIX "failed to remove space handler\n");
        if (ACPI_FAILURE(acpi_remove_gpe_handler(NULL, ec->gpe,
                                &acpi_ec_gpe_handler)))
-               printk(KERN_ERR PREFIX "failed to remove gpe handler\n");
+               pr_err(PREFIX "failed to remove gpe handler\n");
        ec->handlers_installed = 0;
 }
 
@@ -739,8 +779,10 @@ static int acpi_ec_add(struct acpi_device *device)
                first_ec = ec;
        acpi_driver_data(device) = ec;
        acpi_ec_add_fs(device);
-       printk(KERN_INFO PREFIX "GPE = 0x%lx, I/O: command/status = 0x%lx, data = 0x%lx\n",
+       pr_info(PREFIX "GPE = 0x%lx, I/O: command/status = 0x%lx, data = 0x%lx\n",
                          ec->gpe, ec->command_addr, ec->data_addr);
+       pr_info(PREFIX "driver started in %s mode\n",
+               (test_bit(EC_FLAGS_GPE_MODE, &ec->flags))?"interrupt":"poll");
        return 0;
 }
 
@@ -833,7 +875,7 @@ static int acpi_ec_start(struct acpi_device *device)
        ret = ec_install_handlers(ec);
 
        /* EC is fully operational, allow queries */
-       atomic_set(&ec->query_pending, 0);
+       clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags);
        return ret;
 }
 
@@ -865,18 +907,26 @@ int __init acpi_ec_ecdt_probe(void)
        status = acpi_get_table(ACPI_SIG_ECDT, 1,
                                (struct acpi_table_header **)&ecdt_ptr);
        if (ACPI_SUCCESS(status)) {
-               printk(KERN_INFO PREFIX "EC description table is found, configuring boot EC\n");
+               pr_info(PREFIX "EC description table is found, configuring boot EC\n");
                boot_ec->command_addr = ecdt_ptr->control.address;
                boot_ec->data_addr = ecdt_ptr->data.address;
                boot_ec->gpe = ecdt_ptr->gpe;
                boot_ec->handle = ACPI_ROOT_OBJECT;
        } else {
+               /* This workaround is needed only on some broken machines,
+                * which require early EC, but fail to provide ECDT */
+               acpi_handle x;
                printk(KERN_DEBUG PREFIX "Look up EC in DSDT\n");
                status = acpi_get_devices(ec_device_ids[0].id, ec_parse_device,
                                                boot_ec, NULL);
                /* Check that acpi_get_devices actually find something */
                if (ACPI_FAILURE(status) || !boot_ec->handle)
                        goto error;
+               /* We really need to limit this workaround, the only ASUS,
+                * which needs it, has fake EC._INI method, so use it as flag.
+                */
+               if (ACPI_FAILURE(acpi_get_handle(boot_ec->handle, "_INI", &x)))
+                       goto error;
        }
 
        ret = ec_install_handlers(boot_ec);
@@ -924,20 +974,4 @@ static void __exit acpi_ec_exit(void)
 
        return;
 }
-#endif                         /* 0 */
-
-static int __init acpi_ec_set_intr_mode(char *str)
-{
-       int intr;
-
-       if (!get_option(&str, &intr))
-               return 0;
-
-       acpi_ec_mode = (intr) ? EC_INTR : EC_POLL;
-
-       printk(KERN_NOTICE PREFIX "%s mode.\n", intr ? "interrupt" : "polling");
-
-       return 1;
-}
-
-__setup("ec_intr=", acpi_ec_set_intr_mode);
+#endif /* 0 */
index c81f6bdb68b8a8271e5a3d525effe39ea8b3ae18..a5a5532db268084307ae31d655a04af6b9913925 100644 (file)
@@ -47,8 +47,6 @@ MODULE_LICENSE("GPL");
 
 static int acpi_fan_add(struct acpi_device *device);
 static int acpi_fan_remove(struct acpi_device *device, int type);
-static int acpi_fan_suspend(struct acpi_device *device, pm_message_t state);
-static int acpi_fan_resume(struct acpi_device *device);
 
 static const struct acpi_device_id fan_device_ids[] = {
        {"PNP0C0B", 0},
@@ -63,15 +61,9 @@ static struct acpi_driver acpi_fan_driver = {
        .ops = {
                .add = acpi_fan_add,
                .remove = acpi_fan_remove,
-               .suspend = acpi_fan_suspend,
-               .resume = acpi_fan_resume,
                },
 };
 
-struct acpi_fan {
-       struct acpi_device * device;
-};
-
 /* --------------------------------------------------------------------------
                               FS Interface (/proc)
    -------------------------------------------------------------------------- */
@@ -80,12 +72,12 @@ static struct proc_dir_entry *acpi_fan_dir;
 
 static int acpi_fan_read_state(struct seq_file *seq, void *offset)
 {
-       struct acpi_fan *fan = seq->private;
+       struct acpi_device *device = seq->private;
        int state = 0;
 
 
-       if (fan) {
-               if (acpi_bus_get_power(fan->device->handle, &state))
+       if (device) {
+               if (acpi_bus_get_power(device->handle, &state))
                        seq_printf(seq, "status:                  ERROR\n");
                else
                        seq_printf(seq, "status:                  %s\n",
@@ -105,11 +97,10 @@ acpi_fan_write_state(struct file *file, const char __user * buffer,
 {
        int result = 0;
        struct seq_file *m = file->private_data;
-       struct acpi_fan *fan = m->private;
+       struct acpi_device *device = m->private;
        char state_string[12] = { '\0' };
 
-
-       if (!fan || (count > sizeof(state_string) - 1))
+       if (count > sizeof(state_string) - 1)
                return -EINVAL;
 
        if (copy_from_user(state_string, buffer, count))
@@ -117,7 +108,7 @@ acpi_fan_write_state(struct file *file, const char __user * buffer,
 
        state_string[count] = '\0';
 
-       result = acpi_bus_set_power(fan->device->handle,
+       result = acpi_bus_set_power(device->handle,
                                    simple_strtoul(state_string, NULL, 0));
        if (result)
                return result;
@@ -158,7 +149,7 @@ static int acpi_fan_add_fs(struct acpi_device *device)
                return -ENODEV;
        else {
                entry->proc_fops = &acpi_fan_state_ops;
-               entry->data = acpi_driver_data(device);
+               entry->data = device;
                entry->owner = THIS_MODULE;
        }
 
@@ -191,14 +182,8 @@ static int acpi_fan_add(struct acpi_device *device)
        if (!device)
                return -EINVAL;
 
-       fan = kzalloc(sizeof(struct acpi_fan), GFP_KERNEL);
-       if (!fan)
-               return -ENOMEM;
-
-       fan->device = device;
        strcpy(acpi_device_name(device), "Fan");
        strcpy(acpi_device_class(device), ACPI_FAN_CLASS);
-       acpi_driver_data(device) = fan;
 
        result = acpi_bus_get_power(device->handle, &state);
        if (result) {
@@ -206,10 +191,6 @@ static int acpi_fan_add(struct acpi_device *device)
                goto end;
        }
 
-       device->flags.force_power_state = 1;
-       acpi_bus_set_power(device->handle, state);
-       device->flags.force_power_state = 0;
-
        result = acpi_fan_add_fs(device);
        if (result)
                goto end;
@@ -227,53 +208,14 @@ static int acpi_fan_add(struct acpi_device *device)
 
 static int acpi_fan_remove(struct acpi_device *device, int type)
 {
-       struct acpi_fan *fan = NULL;
-
-
        if (!device || !acpi_driver_data(device))
                return -EINVAL;
 
-       fan = acpi_driver_data(device);
-
        acpi_fan_remove_fs(device);
 
-       kfree(fan);
-
        return 0;
 }
 
-static int acpi_fan_suspend(struct acpi_device *device, pm_message_t state)
-{
-       if (!device)
-               return -EINVAL;
-
-       acpi_bus_set_power(device->handle, ACPI_STATE_D0);
-
-       return AE_OK;
-}
-
-static int acpi_fan_resume(struct acpi_device *device)
-{
-       int result = 0;
-       int power_state = 0;
-
-       if (!device)
-               return -EINVAL;
-
-       result = acpi_bus_get_power(device->handle, &power_state);
-       if (result) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Error reading fan power state\n"));
-               return result;
-       }
-
-       device->flags.force_power_state = 1;
-       acpi_bus_set_power(device->handle, power_state);
-       device->flags.force_power_state = 0;
-
-       return result;
-}
-
 static int __init acpi_fan_init(void)
 {
        int result = 0;
index aabc6ca4a81c72463529c3e711b012f8b6e909a7..e3a673a008453dfda694aab503dad0c89b19cb1e 100644 (file)
@@ -387,17 +387,14 @@ acpi_status acpi_os_read_port(acpi_io_address port, u32 * value, u32 width)
        if (!value)
                value = &dummy;
 
-       switch (width) {
-       case 8:
+       *value = 0;
+       if (width <= 8) {
                *(u8 *) value = inb(port);
-               break;
-       case 16:
+       } else if (width <= 16) {
                *(u16 *) value = inw(port);
-               break;
-       case 32:
+       } else if (width <= 32) {
                *(u32 *) value = inl(port);
-               break;
-       default:
+       } else {
                BUG();
        }
 
@@ -408,17 +405,13 @@ EXPORT_SYMBOL(acpi_os_read_port);
 
 acpi_status acpi_os_write_port(acpi_io_address port, u32 value, u32 width)
 {
-       switch (width) {
-       case 8:
+       if (width <= 8) {
                outb(value, port);
-               break;
-       case 16:
+       } else if (width <= 16) {
                outw(value, port);
-               break;
-       case 32:
+       } else if (width <= 32) {
                outl(value, port);
-               break;
-       default:
+       } else {
                BUG();
        }
 
index 57b9a2998fd0ce54e76f5ee22f0bb62a60dbdcbe..af1769a20c7a6ba3f0ee665b204a79c0a1f0c74c 100644 (file)
@@ -86,7 +86,6 @@ struct acpi_power_resource {
        acpi_bus_id name;
        u32 system_level;
        u32 order;
-       int state;
        struct mutex resource_lock;
        struct list_head reference;
 };
@@ -128,33 +127,31 @@ acpi_power_get_context(acpi_handle handle,
        return 0;
 }
 
-static int acpi_power_get_state(struct acpi_power_resource *resource)
+static int acpi_power_get_state(struct acpi_power_resource *resource, int *state)
 {
        acpi_status status = AE_OK;
        unsigned long sta = 0;
 
 
-       if (!resource)
+       if (!resource || !state)
                return -EINVAL;
 
        status = acpi_evaluate_integer(resource->device->handle, "_STA", NULL, &sta);
        if (ACPI_FAILURE(status))
                return -ENODEV;
 
-       if (sta & 0x01)
-               resource->state = ACPI_POWER_RESOURCE_STATE_ON;
-       else
-               resource->state = ACPI_POWER_RESOURCE_STATE_OFF;
+       *state = (sta & 0x01)?ACPI_POWER_RESOURCE_STATE_ON:
+                             ACPI_POWER_RESOURCE_STATE_OFF;
 
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] is %s\n",
-                         resource->name, resource->state ? "on" : "off"));
+                         resource->name, state ? "on" : "off"));
 
        return 0;
 }
 
 static int acpi_power_get_list_state(struct acpi_handle_list *list, int *state)
 {
-       int result = 0;
+       int result = 0, state1;
        struct acpi_power_resource *resource = NULL;
        u32 i = 0;
 
@@ -168,11 +165,11 @@ static int acpi_power_get_list_state(struct acpi_handle_list *list, int *state)
                result = acpi_power_get_context(list->handles[i], &resource);
                if (result)
                        return result;
-               result = acpi_power_get_state(resource);
+               result = acpi_power_get_state(resource, &state1);
                if (result)
                        return result;
 
-               *state = resource->state;
+               *state = state1;
 
                if (*state != ACPI_POWER_RESOURCE_STATE_ON)
                        break;
@@ -186,7 +183,7 @@ static int acpi_power_get_list_state(struct acpi_handle_list *list, int *state)
 
 static int acpi_power_on(acpi_handle handle, struct acpi_device *dev)
 {
-       int result = 0;
+       int result = 0, state;
        int found = 0;
        acpi_status status = AE_OK;
        struct acpi_power_resource *resource = NULL;
@@ -224,20 +221,14 @@ static int acpi_power_on(acpi_handle handle, struct acpi_device *dev)
        }
        mutex_unlock(&resource->resource_lock);
 
-       if (resource->state == ACPI_POWER_RESOURCE_STATE_ON) {
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] already on\n",
-                                 resource->name));
-               return 0;
-       }
-
        status = acpi_evaluate_object(resource->device->handle, "_ON", NULL, NULL);
        if (ACPI_FAILURE(status))
                return -ENODEV;
 
-       result = acpi_power_get_state(resource);
+       result = acpi_power_get_state(resource, &state);
        if (result)
                return result;
-       if (resource->state != ACPI_POWER_RESOURCE_STATE_ON)
+       if (state != ACPI_POWER_RESOURCE_STATE_ON)
                return -ENOEXEC;
 
        /* Update the power resource's _device_ power state */
@@ -250,7 +241,7 @@ static int acpi_power_on(acpi_handle handle, struct acpi_device *dev)
 
 static int acpi_power_off_device(acpi_handle handle, struct acpi_device *dev)
 {
-       int result = 0;
+       int result = 0, state;
        acpi_status status = AE_OK;
        struct acpi_power_resource *resource = NULL;
        struct list_head *node, *next;
@@ -281,20 +272,14 @@ static int acpi_power_off_device(acpi_handle handle, struct acpi_device *dev)
        }
        mutex_unlock(&resource->resource_lock);
 
-       if (resource->state == ACPI_POWER_RESOURCE_STATE_OFF) {
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] already off\n",
-                                 resource->name));
-               return 0;
-       }
-
        status = acpi_evaluate_object(resource->device->handle, "_OFF", NULL, NULL);
        if (ACPI_FAILURE(status))
                return -ENODEV;
 
-       result = acpi_power_get_state(resource);
+       result = acpi_power_get_state(resource, &state);
        if (result)
                return result;
-       if (resource->state != ACPI_POWER_RESOURCE_STATE_OFF)
+       if (state != ACPI_POWER_RESOURCE_STATE_OFF)
                return -ENOEXEC;
 
        /* Update the power resource's _device_ power state */
@@ -494,7 +479,7 @@ static struct proc_dir_entry *acpi_power_dir;
 static int acpi_power_seq_show(struct seq_file *seq, void *offset)
 {
        int count = 0;
-       int result = 0;
+       int result = 0, state;
        struct acpi_power_resource *resource = NULL;
        struct list_head *node, *next;
        struct acpi_power_reference *ref;
@@ -505,12 +490,12 @@ static int acpi_power_seq_show(struct seq_file *seq, void *offset)
        if (!resource)
                goto end;
 
-       result = acpi_power_get_state(resource);
+       result = acpi_power_get_state(resource, &state);
        if (result)
                goto end;
 
        seq_puts(seq, "state:                   ");
-       switch (resource->state) {
+       switch (state) {
        case ACPI_POWER_RESOURCE_STATE_ON:
                seq_puts(seq, "on\n");
                break;
@@ -591,7 +576,7 @@ static int acpi_power_remove_fs(struct acpi_device *device)
 
 static int acpi_power_add(struct acpi_device *device)
 {
-       int result = 0;
+       int result = 0, state;
        acpi_status status = AE_OK;
        struct acpi_power_resource *resource = NULL;
        union acpi_object acpi_object;
@@ -622,11 +607,11 @@ static int acpi_power_add(struct acpi_device *device)
        resource->system_level = acpi_object.power_resource.system_level;
        resource->order = acpi_object.power_resource.resource_order;
 
-       result = acpi_power_get_state(resource);
+       result = acpi_power_get_state(resource, &state);
        if (result)
                goto end;
 
-       switch (resource->state) {
+       switch (state) {
        case ACPI_POWER_RESOURCE_STATE_ON:
                device->power.state = ACPI_STATE_D0;
                break;
@@ -643,7 +628,7 @@ static int acpi_power_add(struct acpi_device *device)
                goto end;
 
        printk(KERN_INFO PREFIX "%s [%s] (%s)\n", acpi_device_name(device),
-              acpi_device_bid(device), resource->state ? "on" : "off");
+              acpi_device_bid(device), state ? "on" : "off");
 
       end:
        if (result)
@@ -680,7 +665,7 @@ static int acpi_power_remove(struct acpi_device *device, int type)
 
 static int acpi_power_resume(struct acpi_device *device)
 {
-       int result = 0;
+       int result = 0, state;
        struct acpi_power_resource *resource = NULL;
        struct acpi_power_reference *ref;
 
@@ -689,12 +674,12 @@ static int acpi_power_resume(struct acpi_device *device)
 
        resource = (struct acpi_power_resource *)acpi_driver_data(device);
 
-       result = acpi_power_get_state(resource);
+       result = acpi_power_get_state(resource, &state);
        if (result)
                return result;
 
        mutex_lock(&resource->resource_lock);
-       if ((resource->state == ACPI_POWER_RESOURCE_STATE_OFF) &&
+       if (state == ACPI_POWER_RESOURCE_STATE_OFF &&
            !list_empty(&resource->reference)) {
                ref = container_of(resource->reference.next, struct acpi_power_reference, node);
                mutex_unlock(&resource->resource_lock);
index 235a51e328c3467522e16ac1d4bb26c5a7227537..015689d295c7289b38db8bfa08a87b111d64bf2d 100644 (file)
@@ -612,12 +612,6 @@ static int acpi_processor_get_info(struct acpi_processor *pr, unsigned has_uid)
                request_region(pr->throttling.address, 6, "ACPI CPU throttle");
        }
 
-#ifdef CONFIG_CPU_FREQ
-       acpi_processor_ppc_has_changed(pr);
-#endif
-       acpi_processor_get_throttling_info(pr);
-       acpi_processor_get_limit_info(pr);
-
        return 0;
 }
 
@@ -647,7 +641,7 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
         */
        if (processor_device_array[pr->id] != NULL &&
            processor_device_array[pr->id] != device) {
-               printk(KERN_WARNING "BIOS reported wrong ACPI id"
+               printk(KERN_WARNING "BIOS reported wrong ACPI id "
                        "for the processor\n");
                return -ENODEV;
        }
@@ -665,6 +659,12 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
        /* _PDC call should be done before doing anything else (if reqd.). */
        arch_acpi_processor_init_pdc(pr);
        acpi_processor_set_pdc(pr);
+#ifdef CONFIG_CPU_FREQ
+       acpi_processor_ppc_has_changed(pr);
+#endif
+       acpi_processor_get_throttling_info(pr);
+       acpi_processor_get_limit_info(pr);
+
 
        acpi_processor_power_init(pr, device);
 
@@ -684,7 +684,7 @@ static void acpi_processor_notify(acpi_handle handle, u32 event, void *data)
 {
        struct acpi_processor *pr = data;
        struct acpi_device *device = NULL;
-
+       int saved;
 
        if (!pr)
                return;
@@ -694,7 +694,10 @@ static void acpi_processor_notify(acpi_handle handle, u32 event, void *data)
 
        switch (event) {
        case ACPI_PROCESSOR_NOTIFY_PERFORMANCE:
+               saved = pr->performance_platform_limit;
                acpi_processor_ppc_has_changed(pr);
+               if (saved == pr->performance_platform_limit)
+                       break;
                acpi_bus_generate_proc_event(device, event,
                                        pr->performance_platform_limit);
                acpi_bus_generate_netlink_event(device->pnp.device_class,
index f996d0e37689c402642a0c884b0126ad15a505bc..b1fbee3f7fe1aff55771ccef5cdee7dc703ac901 100644 (file)
@@ -197,6 +197,19 @@ static inline u32 ticks_elapsed_in_us(u32 t1, u32 t2)
                return PM_TIMER_TICKS_TO_US((0xFFFFFFFF - t1) + t2);
 }
 
+static void acpi_safe_halt(void)
+{
+       current_thread_info()->status &= ~TS_POLLING;
+       /*
+        * TS_POLLING-cleared state must be visible before we
+        * test NEED_RESCHED:
+        */
+       smp_mb();
+       if (!need_resched())
+               safe_halt();
+       current_thread_info()->status |= TS_POLLING;
+}
+
 #ifndef CONFIG_CPU_IDLE
 
 static void
@@ -239,19 +252,6 @@ acpi_processor_power_activate(struct acpi_processor *pr,
        return;
 }
 
-static void acpi_safe_halt(void)
-{
-       current_thread_info()->status &= ~TS_POLLING;
-       /*
-        * TS_POLLING-cleared state must be visible before we
-        * test NEED_RESCHED:
-        */
-       smp_mb();
-       if (!need_resched())
-               safe_halt();
-       current_thread_info()->status |= TS_POLLING;
-}
-
 static atomic_t c3_cpu_count;
 
 /* Common C-state entry for C2, C3, .. */
@@ -1373,15 +1373,7 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev,
        if (pr->flags.bm_check)
                acpi_idle_update_bm_rld(pr, cx);
 
-       current_thread_info()->status &= ~TS_POLLING;
-       /*
-        * TS_POLLING-cleared state must be visible before we test
-        * NEED_RESCHED:
-        */
-       smp_mb();
-       if (!need_resched())
-               safe_halt();
-       current_thread_info()->status |= TS_POLLING;
+       acpi_safe_halt();
 
        cx->usage++;
 
@@ -1399,6 +1391,8 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
        struct acpi_processor *pr;
        struct acpi_processor_cx *cx = cpuidle_get_statedata(state);
        u32 t1, t2;
+       int sleep_ticks = 0;
+
        pr = processors[smp_processor_id()];
 
        if (unlikely(!pr))
@@ -1428,6 +1422,8 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
                ACPI_FLUSH_CPU_CACHE();
 
        t1 = inl(acpi_gbl_FADT.xpm_timer_block.address);
+       /* Tell the scheduler that we are going deep-idle: */
+       sched_clock_idle_sleep_event();
        acpi_state_timer_broadcast(pr, cx, 1);
        acpi_idle_do_entry(cx);
        t2 = inl(acpi_gbl_FADT.xpm_timer_block.address);
@@ -1436,6 +1432,10 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
        /* TSC could halt in idle, so notify users */
        mark_tsc_unstable("TSC halts in idle");;
 #endif
+       sleep_ticks = ticks_elapsed(t1, t2);
+
+       /* Tell the scheduler how much we idled: */
+       sched_clock_idle_wakeup_event(sleep_ticks*PM_TIMER_TICK_NS);
 
        local_irq_enable();
        current_thread_info()->status |= TS_POLLING;
@@ -1443,7 +1443,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
        cx->usage++;
 
        acpi_state_timer_broadcast(pr, cx, 0);
-       cx->time += ticks_elapsed(t1, t2);
+       cx->time += sleep_ticks;
        return ticks_elapsed_in_us(t1, t2);
 }
 
@@ -1463,6 +1463,8 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
        struct acpi_processor *pr;
        struct acpi_processor_cx *cx = cpuidle_get_statedata(state);
        u32 t1, t2;
+       int sleep_ticks = 0;
+
        pr = processors[smp_processor_id()];
 
        if (unlikely(!pr))
@@ -1471,6 +1473,15 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
        if (acpi_idle_suspend)
                return(acpi_idle_enter_c1(dev, state));
 
+       if (acpi_idle_bm_check()) {
+               if (dev->safe_state) {
+                       return dev->safe_state->enter(dev, dev->safe_state);
+               } else {
+                       acpi_safe_halt();
+                       return 0;
+               }
+       }
+
        local_irq_disable();
        current_thread_info()->status &= ~TS_POLLING;
        /*
@@ -1485,38 +1496,45 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
                return 0;
        }
 
+       /* Tell the scheduler that we are going deep-idle: */
+       sched_clock_idle_sleep_event();
        /*
         * Must be done before busmaster disable as we might need to
         * access HPET !
         */
        acpi_state_timer_broadcast(pr, cx, 1);
 
-       if (acpi_idle_bm_check()) {
-               cx = pr->power.bm_state;
-
-               acpi_idle_update_bm_rld(pr, cx);
-
-               t1 = inl(acpi_gbl_FADT.xpm_timer_block.address);
-               acpi_idle_do_entry(cx);
-               t2 = inl(acpi_gbl_FADT.xpm_timer_block.address);
-       } else {
-               acpi_idle_update_bm_rld(pr, cx);
+       acpi_idle_update_bm_rld(pr, cx);
 
+       /*
+        * disable bus master
+        * bm_check implies we need ARB_DIS
+        * !bm_check implies we need cache flush
+        * bm_control implies whether we can do ARB_DIS
+        *
+        * That leaves a case where bm_check is set and bm_control is
+        * not set. In that case we cannot do much, we enter C3
+        * without doing anything.
+        */
+       if (pr->flags.bm_check && pr->flags.bm_control) {
                spin_lock(&c3_lock);
                c3_cpu_count++;
                /* Disable bus master arbitration when all CPUs are in C3 */
                if (c3_cpu_count == num_online_cpus())
                        acpi_set_register(ACPI_BITREG_ARB_DISABLE, 1);
                spin_unlock(&c3_lock);
+       } else if (!pr->flags.bm_check) {
+               ACPI_FLUSH_CPU_CACHE();
+       }
 
-               t1 = inl(acpi_gbl_FADT.xpm_timer_block.address);
-               acpi_idle_do_entry(cx);
-               t2 = inl(acpi_gbl_FADT.xpm_timer_block.address);
+       t1 = inl(acpi_gbl_FADT.xpm_timer_block.address);
+       acpi_idle_do_entry(cx);
+       t2 = inl(acpi_gbl_FADT.xpm_timer_block.address);
 
+       /* Re-enable bus master arbitration */
+       if (pr->flags.bm_check && pr->flags.bm_control) {
                spin_lock(&c3_lock);
-               /* Re-enable bus master arbitration */
-               if (c3_cpu_count == num_online_cpus())
-                       acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0);
+               acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0);
                c3_cpu_count--;
                spin_unlock(&c3_lock);
        }
@@ -1525,6 +1543,9 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
        /* TSC could halt in idle, so notify users */
        mark_tsc_unstable("TSC halts in idle");
 #endif
+       sleep_ticks = ticks_elapsed(t1, t2);
+       /* Tell the scheduler how much we idled: */
+       sched_clock_idle_wakeup_event(sleep_ticks*PM_TIMER_TICK_NS);
 
        local_irq_enable();
        current_thread_info()->status |= TS_POLLING;
@@ -1532,7 +1553,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
        cx->usage++;
 
        acpi_state_timer_broadcast(pr, cx, 0);
-       cx->time += ticks_elapsed(t1, t2);
+       cx->time += sleep_ticks;
        return ticks_elapsed_in_us(t1, t2);
 }
 
@@ -1584,12 +1605,14 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr)
                        case ACPI_STATE_C1:
                        state->flags |= CPUIDLE_FLAG_SHALLOW;
                        state->enter = acpi_idle_enter_c1;
+                       dev->safe_state = state;
                        break;
 
                        case ACPI_STATE_C2:
                        state->flags |= CPUIDLE_FLAG_BALANCED;
                        state->flags |= CPUIDLE_FLAG_TIME_VALID;
                        state->enter = acpi_idle_enter_simple;
+                       dev->safe_state = state;
                        break;
 
                        case ACPI_STATE_C3:
@@ -1610,14 +1633,6 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr)
        if (!count)
                return -EINVAL;
 
-       /* find the deepest state that can handle active BM */
-       if (pr->flags.bm_check) {
-               for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++)
-                       if (pr->power.states[i].type == ACPI_STATE_C3)
-                               break;
-               pr->power.bm_state = &pr->power.states[i-1];
-       }
-
        return 0;
 }
 
@@ -1658,6 +1673,7 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr,
 
        if (!first_run) {
                dmi_check_system(processor_power_dmi_table);
+               max_cstate = acpi_processor_cstate_check(max_cstate);
                if (max_cstate < ACPI_C_STATES_MAX)
                        printk(KERN_NOTICE
                               "ACPI: processor limited to max C-state %d\n",
index 0b8204e7082a366232b3d29121926ff0892f57cd..c26c61fb36c3ac0a16f719016f1a8634bfda71db 100644 (file)
@@ -70,7 +70,55 @@ static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
 
 int acpi_processor_tstate_has_changed(struct acpi_processor *pr)
 {
-       return acpi_processor_get_platform_limit(pr);
+       int result = 0;
+       int throttling_limit;
+       int current_state;
+       struct acpi_processor_limit *limit;
+       int target_state;
+
+       result = acpi_processor_get_platform_limit(pr);
+       if (result) {
+               /* Throttling Limit is unsupported */
+               return result;
+       }
+
+       throttling_limit = pr->throttling_platform_limit;
+       if (throttling_limit >= pr->throttling.state_count) {
+               /* Uncorrect Throttling Limit */
+               return -EINVAL;
+       }
+
+       current_state = pr->throttling.state;
+       if (current_state > throttling_limit) {
+               /*
+                * The current state can meet the requirement of
+                * _TPC limit. But it is reasonable that OSPM changes
+                * t-states from high to low for better performance.
+                * Of course the limit condition of thermal
+                * and user should be considered.
+                */
+               limit = &pr->limit;
+               target_state = throttling_limit;
+               if (limit->thermal.tx > target_state)
+                       target_state = limit->thermal.tx;
+               if (limit->user.tx > target_state)
+                       target_state = limit->user.tx;
+       } else if (current_state == throttling_limit) {
+               /*
+                * Unnecessary to change the throttling state
+                */
+               return 0;
+       } else {
+               /*
+                * If the current state is lower than the limit of _TPC, it
+                * will be forced to switch to the throttling state defined
+                * by throttling_platfor_limit.
+                * Because the previous state meets with the limit condition
+                * of thermal and user, it is unnecessary to check it again.
+                */
+               target_state = throttling_limit;
+       }
+       return acpi_processor_set_throttling(pr, target_state);
 }
 
 /*
@@ -83,6 +131,7 @@ static int acpi_processor_get_throttling_control(struct acpi_processor *pr)
        struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
        union acpi_object *ptc = NULL;
        union acpi_object obj = { 0 };
+       struct acpi_processor_throttling *throttling;
 
        status = acpi_evaluate_object(pr->handle, "_PTC", NULL, &buffer);
        if (ACPI_FAILURE(status)) {
@@ -134,6 +183,22 @@ static int acpi_processor_get_throttling_control(struct acpi_processor *pr)
        memcpy(&pr->throttling.status_register, obj.buffer.pointer,
               sizeof(struct acpi_ptc_register));
 
+       throttling = &pr->throttling;
+
+       if ((throttling->control_register.bit_width +
+               throttling->control_register.bit_offset) > 32) {
+               printk(KERN_ERR PREFIX "Invalid _PTC control register\n");
+               result = -EFAULT;
+               goto end;
+       }
+
+       if ((throttling->status_register.bit_width +
+               throttling->status_register.bit_offset) > 32) {
+               printk(KERN_ERR PREFIX "Invalid _PTC status register\n");
+               result = -EFAULT;
+               goto end;
+       }
+
       end:
        kfree(buffer.pointer);
 
@@ -328,44 +393,132 @@ static int acpi_processor_get_throttling_fadt(struct acpi_processor *pr)
        return 0;
 }
 
-static int acpi_read_throttling_status(struct acpi_processor_throttling
-                                      *throttling)
+#ifdef CONFIG_X86
+static int acpi_throttling_rdmsr(struct acpi_processor *pr,
+                                       acpi_integer * value)
 {
-       int value = -1;
+       struct cpuinfo_x86 *c;
+       u64 msr_high, msr_low;
+       unsigned int cpu;
+       u64 msr = 0;
+       int ret = -1;
+
+       cpu = pr->id;
+       c = &cpu_data(cpu);
+
+       if ((c->x86_vendor != X86_VENDOR_INTEL) ||
+               !cpu_has(c, X86_FEATURE_ACPI)) {
+               printk(KERN_ERR PREFIX
+                       "HARDWARE addr space,NOT supported yet\n");
+       } else {
+               msr_low = 0;
+               msr_high = 0;
+               rdmsr_on_cpu(cpu, MSR_IA32_THERM_CONTROL,
+                       (u32 *)&msr_low , (u32 *) &msr_high);
+               msr = (msr_high << 32) | msr_low;
+               *value = (acpi_integer) msr;
+               ret = 0;
+       }
+       return ret;
+}
+
+static int acpi_throttling_wrmsr(struct acpi_processor *pr, acpi_integer value)
+{
+       struct cpuinfo_x86 *c;
+       unsigned int cpu;
+       int ret = -1;
+       u64 msr;
+
+       cpu = pr->id;
+       c = &cpu_data(cpu);
+
+       if ((c->x86_vendor != X86_VENDOR_INTEL) ||
+               !cpu_has(c, X86_FEATURE_ACPI)) {
+               printk(KERN_ERR PREFIX
+                       "HARDWARE addr space,NOT supported yet\n");
+       } else {
+               msr = value;
+               wrmsr_on_cpu(cpu, MSR_IA32_THERM_CONTROL,
+                       msr & 0xffffffff, msr >> 32);
+               ret = 0;
+       }
+       return ret;
+}
+#else
+static int acpi_throttling_rdmsr(struct acpi_processor *pr,
+                               acpi_integer * value)
+{
+       printk(KERN_ERR PREFIX
+               "HARDWARE addr space,NOT supported yet\n");
+       return -1;
+}
+
+static int acpi_throttling_wrmsr(struct acpi_processor *pr, acpi_integer value)
+{
+       printk(KERN_ERR PREFIX
+               "HARDWARE addr space,NOT supported yet\n");
+       return -1;
+}
+#endif
+
+static int acpi_read_throttling_status(struct acpi_processor *pr,
+                                       acpi_integer *value)
+{
+       u32 bit_width, bit_offset;
+       u64 ptc_value;
+       u64 ptc_mask;
+       struct acpi_processor_throttling *throttling;
+       int ret = -1;
+
+       throttling = &pr->throttling;
        switch (throttling->status_register.space_id) {
        case ACPI_ADR_SPACE_SYSTEM_IO:
+               ptc_value = 0;
+               bit_width = throttling->status_register.bit_width;
+               bit_offset = throttling->status_register.bit_offset;
+
                acpi_os_read_port((acpi_io_address) throttling->status_register.
-                                 address, &value,
-                                 (u32) throttling->status_register.bit_width *
-                                 8);
+                                 address, (u32 *) &ptc_value,
+                                 (u32) (bit_width + bit_offset));
+               ptc_mask = (1 << bit_width) - 1;
+               *value = (acpi_integer) ((ptc_value >> bit_offset) & ptc_mask);
+               ret = 0;
                break;
        case ACPI_ADR_SPACE_FIXED_HARDWARE:
-               printk(KERN_ERR PREFIX
-                      "HARDWARE addr space,NOT supported yet\n");
+               ret = acpi_throttling_rdmsr(pr, value);
                break;
        default:
                printk(KERN_ERR PREFIX "Unknown addr space %d\n",
                       (u32) (throttling->status_register.space_id));
        }
-       return value;
+       return ret;
 }
 
-static int acpi_write_throttling_state(struct acpi_processor_throttling
-                                      *throttling, int value)
+static int acpi_write_throttling_state(struct acpi_processor *pr,
+                               acpi_integer value)
 {
+       u32 bit_width, bit_offset;
+       u64 ptc_value;
+       u64 ptc_mask;
+       struct acpi_processor_throttling *throttling;
        int ret = -1;
 
+       throttling = &pr->throttling;
        switch (throttling->control_register.space_id) {
        case ACPI_ADR_SPACE_SYSTEM_IO:
+               bit_width = throttling->control_register.bit_width;
+               bit_offset = throttling->control_register.bit_offset;
+               ptc_mask = (1 << bit_width) - 1;
+               ptc_value = value & ptc_mask;
+
                acpi_os_write_port((acpi_io_address) throttling->
-                                  control_register.address, value,
-                                  (u32) throttling->control_register.
-                                  bit_width * 8);
+                                       control_register.address,
+                                       (u32) (ptc_value << bit_offset),
+                                       (u32) (bit_width + bit_offset));
                ret = 0;
                break;
        case ACPI_ADR_SPACE_FIXED_HARDWARE:
-               printk(KERN_ERR PREFIX
-                      "HARDWARE addr space,NOT supported yet\n");
+               ret = acpi_throttling_wrmsr(pr, value);
                break;
        default:
                printk(KERN_ERR PREFIX "Unknown addr space %d\n",
@@ -374,7 +527,8 @@ static int acpi_write_throttling_state(struct acpi_processor_throttling
        return ret;
 }
 
-static int acpi_get_throttling_state(struct acpi_processor *pr, int value)
+static int acpi_get_throttling_state(struct acpi_processor *pr,
+                               acpi_integer value)
 {
        int i;
 
@@ -390,22 +544,26 @@ static int acpi_get_throttling_state(struct acpi_processor *pr, int value)
        return i;
 }
 
-static int acpi_get_throttling_value(struct acpi_processor *pr, int state)
+static int acpi_get_throttling_value(struct acpi_processor *pr,
+                       int state, acpi_integer *value)
 {
-       int value = -1;
+       int ret = -1;
+
        if (state >= 0 && state <= pr->throttling.state_count) {
                struct acpi_processor_tx_tss *tx =
                    (struct acpi_processor_tx_tss *)&(pr->throttling.
                                                      states_tss[state]);
-               value = tx->control;
+               *value = tx->control;
+               ret = 0;
        }
-       return value;
+       return ret;
 }
 
 static int acpi_processor_get_throttling_ptc(struct acpi_processor *pr)
 {
        int state = 0;
-       u32 value = 0;
+       int ret;
+       acpi_integer value;
 
        if (!pr)
                return -EINVAL;
@@ -415,8 +573,9 @@ static int acpi_processor_get_throttling_ptc(struct acpi_processor *pr)
 
        pr->throttling.state = 0;
        local_irq_disable();
-       value = acpi_read_throttling_status(&pr->throttling);
-       if (value >= 0) {
+       value = 0;
+       ret = acpi_read_throttling_status(pr, &value);
+       if (ret >= 0) {
                state = acpi_get_throttling_state(pr, value);
                pr->throttling.state = state;
        }
@@ -430,6 +589,40 @@ static int acpi_processor_get_throttling(struct acpi_processor *pr)
        return pr->throttling.acpi_processor_get_throttling(pr);
 }
 
+static int acpi_processor_get_fadt_info(struct acpi_processor *pr)
+{
+       int i, step;
+
+       if (!pr->throttling.address) {
+               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling register\n"));
+               return -EINVAL;
+       } else if (!pr->throttling.duty_width) {
+               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling states\n"));
+               return -EINVAL;
+       }
+       /* TBD: Support duty_cycle values that span bit 4. */
+       else if ((pr->throttling.duty_offset + pr->throttling.duty_width) > 4) {
+               printk(KERN_WARNING PREFIX "duty_cycle spans bit 4\n");
+               return -EINVAL;
+       }
+
+       pr->throttling.state_count = 1 << acpi_gbl_FADT.duty_width;
+
+       /*
+        * Compute state values. Note that throttling displays a linear power
+        * performance relationship (at 50% performance the CPU will consume
+        * 50% power).  Values are in 1/10th of a percent to preserve accuracy.
+        */
+
+       step = (1000 / pr->throttling.state_count);
+
+       for (i = 0; i < pr->throttling.state_count; i++) {
+               pr->throttling.states[i].performance = 1000 - step * i;
+               pr->throttling.states[i].power = 1000 - step * i;
+       }
+       return 0;
+}
+
 static int acpi_processor_set_throttling_fadt(struct acpi_processor *pr,
                                              int state)
 {
@@ -506,7 +699,8 @@ static int acpi_processor_set_throttling_fadt(struct acpi_processor *pr,
 static int acpi_processor_set_throttling_ptc(struct acpi_processor *pr,
                                             int state)
 {
-       u32 value = 0;
+       int ret;
+       acpi_integer value;
 
        if (!pr)
                return -EINVAL;
@@ -524,10 +718,10 @@ static int acpi_processor_set_throttling_ptc(struct acpi_processor *pr,
                return -EPERM;
 
        local_irq_disable();
-
-       value = acpi_get_throttling_value(pr, state);
-       if (value >= 0) {
-               acpi_write_throttling_state(&pr->throttling, value);
+       value = 0;
+       ret = acpi_get_throttling_value(pr, state, &value);
+       if (ret >= 0) {
+               acpi_write_throttling_state(pr, value);
                pr->throttling.state = state;
        }
        local_irq_enable();
@@ -543,8 +737,6 @@ int acpi_processor_set_throttling(struct acpi_processor *pr, int state)
 int acpi_processor_get_throttling_info(struct acpi_processor *pr)
 {
        int result = 0;
-       int step = 0;
-       int i = 0;
 
        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                          "pblk_address[0x%08x] duty_offset[%d] duty_width[%d]\n",
@@ -563,6 +755,8 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
                acpi_processor_get_throttling_states(pr) ||
                acpi_processor_get_platform_limit(pr))
        {
+               if (acpi_processor_get_fadt_info(pr))
+                       return 0;
                pr->throttling.acpi_processor_get_throttling =
                    &acpi_processor_get_throttling_fadt;
                pr->throttling.acpi_processor_set_throttling =
@@ -576,19 +770,6 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
 
        acpi_processor_get_tsd(pr);
 
-       if (!pr->throttling.address) {
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling register\n"));
-               return 0;
-       } else if (!pr->throttling.duty_width) {
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling states\n"));
-               return 0;
-       }
-       /* TBD: Support duty_cycle values that span bit 4. */
-       else if ((pr->throttling.duty_offset + pr->throttling.duty_width) > 4) {
-               printk(KERN_WARNING PREFIX "duty_cycle spans bit 4\n");
-               return 0;
-       }
-
        /*
         * PIIX4 Errata: We don't support throttling on the original PIIX4.
         * This shouldn't be an issue as few (if any) mobile systems ever
@@ -600,21 +781,6 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
                return 0;
        }
 
-       pr->throttling.state_count = 1 << acpi_gbl_FADT.duty_width;
-
-       /*
-        * Compute state values. Note that throttling displays a linear power/
-        * performance relationship (at 50% performance the CPU will consume
-        * 50% power).  Values are in 1/10th of a percent to preserve accuracy.
-        */
-
-       step = (1000 / pr->throttling.state_count);
-
-       for (i = 0; i < pr->throttling.state_count; i++) {
-               pr->throttling.states[i].performance = step * i;
-               pr->throttling.states[i].power = step * i;
-       }
-
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %d throttling states\n",
                          pr->throttling.state_count));
 
index 90fd09c65f95eed69d07fc624277d20fb9c44f8b..6045cdbe176beafe7f250c65a0bf93b3fa428da7 100644 (file)
@@ -29,7 +29,7 @@
 #include <linux/moduleparam.h>
 #include <linux/kernel.h>
 
-#ifdef CONFIG_ACPI_PROCFS
+#ifdef CONFIG_ACPI_PROCFS_POWER
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 #include <asm/uaccess.h>
@@ -88,7 +88,7 @@ MODULE_DEVICE_TABLE(acpi, sbs_device_ids);
 struct acpi_battery {
        struct power_supply bat;
        struct acpi_sbs *sbs;
-#ifdef CONFIG_ACPI_PROCFS
+#ifdef CONFIG_ACPI_PROCFS_POWER
        struct proc_dir_entry *proc_entry;
 #endif
        unsigned long update_time;
@@ -113,6 +113,7 @@ struct acpi_battery {
        u16 spec;
        u8 id;
        u8 present:1;
+       u8 have_sysfs_alarm:1;
 };
 
 #define to_acpi_battery(x) container_of(x, struct acpi_battery, bat);
@@ -122,7 +123,7 @@ struct acpi_sbs {
        struct acpi_device *device;
        struct acpi_smb_hc *hc;
        struct mutex lock;
-#ifdef CONFIG_ACPI_PROCFS
+#ifdef CONFIG_ACPI_PROCFS_POWER
        struct proc_dir_entry *charger_entry;
 #endif
        struct acpi_battery battery[MAX_SBS_BAT];
@@ -468,7 +469,7 @@ static struct device_attribute alarm_attr = {
                               FS Interface (/proc/acpi)
    -------------------------------------------------------------------------- */
 
-#ifdef CONFIG_ACPI_PROCFS
+#ifdef CONFIG_ACPI_PROCFS_POWER
 /* Generic Routines */
 static int
 acpi_sbs_add_fs(struct proc_dir_entry **dir,
@@ -789,7 +790,7 @@ static int acpi_battery_add(struct acpi_sbs *sbs, int id)
                return result;
 
        sprintf(battery->name, ACPI_BATTERY_DIR_NAME, id);
-#ifdef CONFIG_ACPI_PROCFS
+#ifdef CONFIG_ACPI_PROCFS_POWER
        acpi_sbs_add_fs(&battery->proc_entry, acpi_battery_dir,
                        battery->name, &acpi_battery_info_fops,
                        &acpi_battery_state_fops, &acpi_battery_alarm_fops,
@@ -808,7 +809,13 @@ static int acpi_battery_add(struct acpi_sbs *sbs, int id)
        }
        battery->bat.get_property = acpi_sbs_battery_get_property;
        result = power_supply_register(&sbs->device->dev, &battery->bat);
-       device_create_file(battery->bat.dev, &alarm_attr);
+       if (result)
+               goto end;
+       result = device_create_file(battery->bat.dev, &alarm_attr);
+       if (result)
+               goto end;
+       battery->have_sysfs_alarm = 1;
+      end:
        printk(KERN_INFO PREFIX "%s [%s]: Battery Slot [%s] (battery %s)\n",
               ACPI_SBS_DEVICE_NAME, acpi_device_bid(sbs->device),
               battery->name, sbs->battery->present ? "present" : "absent");
@@ -817,14 +824,16 @@ static int acpi_battery_add(struct acpi_sbs *sbs, int id)
 
 static void acpi_battery_remove(struct acpi_sbs *sbs, int id)
 {
-       if (sbs->battery[id].bat.dev)
-               device_remove_file(sbs->battery[id].bat.dev, &alarm_attr);
-               power_supply_unregister(&sbs->battery[id].bat);
-#ifdef CONFIG_ACPI_PROCFS
-       if (sbs->battery[id].proc_entry) {
-               acpi_sbs_remove_fs(&(sbs->battery[id].proc_entry),
-                                  acpi_battery_dir);
+       struct acpi_battery *battery = &sbs->battery[id];
+
+       if (battery->bat.dev) {
+               if (battery->have_sysfs_alarm)
+                       device_remove_file(battery->bat.dev, &alarm_attr);
+               power_supply_unregister(&battery->bat);
        }
+#ifdef CONFIG_ACPI_PROCFS_POWER
+       if (battery->proc_entry)
+               acpi_sbs_remove_fs(&battery->proc_entry, acpi_battery_dir);
 #endif
 }
 
@@ -835,7 +844,7 @@ static int acpi_charger_add(struct acpi_sbs *sbs)
        result = acpi_ac_get_present(sbs);
        if (result)
                goto end;
-#ifdef CONFIG_ACPI_PROCFS
+#ifdef CONFIG_ACPI_PROCFS_POWER
        result = acpi_sbs_add_fs(&sbs->charger_entry, acpi_ac_dir,
                                 ACPI_AC_DIR_NAME, NULL,
                                 &acpi_ac_state_fops, NULL, sbs);
@@ -859,7 +868,7 @@ static void acpi_charger_remove(struct acpi_sbs *sbs)
 {
        if (sbs->charger.dev)
                power_supply_unregister(&sbs->charger);
-#ifdef CONFIG_ACPI_PROCFS
+#ifdef CONFIG_ACPI_PROCFS_POWER
        if (sbs->charger_entry)
                acpi_sbs_remove_fs(&sbs->charger_entry, acpi_ac_dir);
 #endif
@@ -965,7 +974,7 @@ static int acpi_sbs_remove(struct acpi_device *device, int type)
 
 static void acpi_sbs_rmdirs(void)
 {
-#ifdef CONFIG_ACPI_PROCFS
+#ifdef CONFIG_ACPI_PROCFS_POWER
        if (acpi_ac_dir) {
                acpi_unlock_ac_dir(acpi_ac_dir);
                acpi_ac_dir = NULL;
@@ -1004,7 +1013,7 @@ static int __init acpi_sbs_init(void)
 
        if (acpi_disabled)
                return -ENODEV;
-#ifdef CONFIG_ACPI_PROCFS
+#ifdef CONFIG_ACPI_PROCFS_POWER
        acpi_ac_dir = acpi_lock_ac_dir();
        if (!acpi_ac_dir)
                return -ENODEV;
index f3d3867303ec61602958f135494cc1ccbe86309b..2c0b6630f8ba54603530fce4574f8697faaabe9e 100644 (file)
@@ -167,8 +167,8 @@ static void acpi_pm_finish(void)
 {
        u32 acpi_state = acpi_target_sleep_state;
 
-       acpi_leave_sleep_state(acpi_state);
        acpi_disable_wakeup_device(acpi_state);
+       acpi_leave_sleep_state(acpi_state);
 
        /* reset firmware waking vector */
        acpi_set_firmware_waking_vector((acpi_physical_address) 0);
@@ -272,8 +272,8 @@ static void acpi_hibernation_finish(void)
         * enable it here.
         */
        acpi_enable();
-       acpi_leave_sleep_state(ACPI_STATE_S4);
        acpi_disable_wakeup_device(ACPI_STATE_S4);
+       acpi_leave_sleep_state(ACPI_STATE_S4);
 
        /* reset firmware waking vector */
        acpi_set_firmware_waking_vector((acpi_physical_address) 0);
@@ -410,6 +410,7 @@ static void acpi_power_off(void)
        /* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */
        printk("%s called\n", __FUNCTION__);
        local_irq_disable();
+       acpi_enable_wakeup_device(ACPI_STATE_S5);
        acpi_enter_sleep_state(ACPI_STATE_S5);
 }
 
index 5f1d85f2ffe4cf375b19a97d0a392bc5ed52d18a..010f19652f80a633305a9da6c73729a73f58f545 100644 (file)
@@ -449,7 +449,7 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address, u8 flags)
                        /* XSDT has NULL entry, RSDT is used */
                        address = rsdt_address;
                        table_entry_size = sizeof(u32);
-                       ACPI_WARNING((AE_INFO, "BIOS XSDT has NULL entry,"
+                       ACPI_WARNING((AE_INFO, "BIOS XSDT has NULL entry, "
                                        "using RSDT"));
                }
        }
index a736ef7bdee4726e3ef03c50b8fd1100c4b7b6ad..9e8c20c6a0b7243e708876a4dfffa30dd8f47506 100644 (file)
@@ -591,9 +591,12 @@ static int __init toshiba_acpi_init(void)
                                                NULL,
                                                &toshiba_backlight_data);
         if (IS_ERR(toshiba_backlight_device)) {
+               int ret = PTR_ERR(toshiba_backlight_device);
+
                printk(KERN_ERR "Could not register toshiba backlight device\n");
                toshiba_backlight_device = NULL;
                toshiba_acpi_exit();
+               return ret;
        }
         toshiba_backlight_device->props.max_brightness = HCI_LCD_BRIGHTNESS_LEVELS - 1;
 
index bac956b30c57b94fafe71c951331723122bbd926..44a0d9ba9bd67268747d4ef9d6355981d0120f09 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/init.h>
 #include <linux/types.h>
 #include <linux/list.h>
+#include <linux/mutex.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 #include <linux/input.h>
@@ -135,8 +136,8 @@ struct acpi_video_bus {
        u8 attached_count;
        struct acpi_video_bus_cap cap;
        struct acpi_video_bus_flags flags;
-       struct semaphore sem;
        struct list_head video_device_list;
+       struct mutex device_list_lock;  /* protects video_device_list */
        struct proc_dir_entry *dir;
        struct input_dev *input;
        char phys[32];  /* for input device */
@@ -896,7 +897,7 @@ acpi_video_device_write_brightness(struct file *file,
 {
        struct seq_file *m = file->private_data;
        struct acpi_video_device *dev = m->private;
-       char str[4] = { 0 };
+       char str[5] = { 0 };
        unsigned int level = 0;
        int i;
 
@@ -1436,9 +1437,9 @@ acpi_video_bus_get_one_device(struct acpi_device *device,
                        return -ENODEV;
                }
 
-               down(&video->sem);
+               mutex_lock(&video->device_list_lock);
                list_add_tail(&data->entry, &video->video_device_list);
-               up(&video->sem);
+               mutex_unlock(&video->device_list_lock);
 
                acpi_video_device_add_fs(device);
 
@@ -1462,12 +1463,14 @@ acpi_video_bus_get_one_device(struct acpi_device *device,
 
 static void acpi_video_device_rebind(struct acpi_video_bus *video)
 {
-       struct list_head *node, *next;
-       list_for_each_safe(node, next, &video->video_device_list) {
-               struct acpi_video_device *dev =
-                   container_of(node, struct acpi_video_device, entry);
+       struct acpi_video_device *dev;
+
+       mutex_lock(&video->device_list_lock);
+
+       list_for_each_entry(dev, &video->video_device_list, entry)
                acpi_video_device_bind(video, dev);
-       }
+
+       mutex_unlock(&video->device_list_lock);
 }
 
 /*
@@ -1592,30 +1595,33 @@ static int acpi_video_device_enumerate(struct acpi_video_bus *video)
 
 static int acpi_video_switch_output(struct acpi_video_bus *video, int event)
 {
-       struct list_head *node, *next;
+       struct list_head *node;
        struct acpi_video_device *dev = NULL;
        struct acpi_video_device *dev_next = NULL;
        struct acpi_video_device *dev_prev = NULL;
        unsigned long state;
        int status = 0;
 
+       mutex_lock(&video->device_list_lock);
 
-       list_for_each_safe(node, next, &video->video_device_list) {
+       list_for_each(node, &video->video_device_list) {
                dev = container_of(node, struct acpi_video_device, entry);
                status = acpi_video_device_get_state(dev, &state);
                if (state & 0x2) {
-                       dev_next =
-                           container_of(node->next, struct acpi_video_device,
-                                        entry);
-                       dev_prev =
-                           container_of(node->prev, struct acpi_video_device,
-                                        entry);
+                       dev_next = container_of(node->next,
+                                       struct acpi_video_device, entry);
+                       dev_prev = container_of(node->prev,
+                                       struct acpi_video_device, entry);
                        goto out;
                }
        }
+
        dev_next = container_of(node->next, struct acpi_video_device, entry);
        dev_prev = container_of(node->prev, struct acpi_video_device, entry);
-      out:
+
+ out:
+       mutex_unlock(&video->device_list_lock);
+
        switch (event) {
        case ACPI_VIDEO_NOTIFY_CYCLE:
        case ACPI_VIDEO_NOTIFY_NEXT_OUTPUT:
@@ -1691,24 +1697,17 @@ acpi_video_bus_get_devices(struct acpi_video_bus *video,
                           struct acpi_device *device)
 {
        int status = 0;
-       struct list_head *node, *next;
-
+       struct acpi_device *dev;
 
        acpi_video_device_enumerate(video);
 
-       list_for_each_safe(node, next, &device->children) {
-               struct acpi_device *dev =
-                   list_entry(node, struct acpi_device, node);
-
-               if (!dev)
-                       continue;
+       list_for_each_entry(dev, &device->children, node) {
 
                status = acpi_video_bus_get_one_device(dev, video);
                if (ACPI_FAILURE(status)) {
                        ACPI_EXCEPTION((AE_INFO, status, "Cant attach device"));
                        continue;
                }
-
        }
        return status;
 }
@@ -1724,9 +1723,6 @@ static int acpi_video_bus_put_one_device(struct acpi_video_device *device)
 
        video = device->video;
 
-       down(&video->sem);
-       list_del(&device->entry);
-       up(&video->sem);
        acpi_video_device_remove_fs(device->dev);
 
        status = acpi_remove_notify_handler(device->dev->handle,
@@ -1734,32 +1730,34 @@ static int acpi_video_bus_put_one_device(struct acpi_video_device *device)
                                            acpi_video_device_notify);
        backlight_device_unregister(device->backlight);
        video_output_unregister(device->output_dev);
+
        return 0;
 }
 
 static int acpi_video_bus_put_devices(struct acpi_video_bus *video)
 {
        int status;
-       struct list_head *node, *next;
+       struct acpi_video_device *dev, *next;
 
+       mutex_lock(&video->device_list_lock);
 
-       list_for_each_safe(node, next, &video->video_device_list) {
-               struct acpi_video_device *data =
-                   list_entry(node, struct acpi_video_device, entry);
-               if (!data)
-                       continue;
+       list_for_each_entry_safe(dev, next, &video->video_device_list, entry) {
 
-               status = acpi_video_bus_put_one_device(data);
+               status = acpi_video_bus_put_one_device(dev);
                if (ACPI_FAILURE(status))
                        printk(KERN_WARNING PREFIX
                               "hhuuhhuu bug in acpi video driver.\n");
 
-               if (data->brightness)
-                       kfree(data->brightness->levels);
-               kfree(data->brightness);
-               kfree(data);
+               if (dev->brightness) {
+                       kfree(dev->brightness->levels);
+                       kfree(dev->brightness);
+               }
+               list_del(&dev->entry);
+               kfree(dev);
        }
 
+       mutex_unlock(&video->device_list_lock);
+
        return 0;
 }
 
@@ -1782,9 +1780,6 @@ static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data)
        struct input_dev *input;
        int keycode;
 
-
-       printk("video bus notify\n");
-
        if (!video)
                return;
 
@@ -1897,14 +1892,10 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data)
 static int instance;
 static int acpi_video_bus_add(struct acpi_device *device)
 {
-       int result = 0;
-       acpi_status status = 0;
-       struct acpi_video_bus *video = NULL;
+       acpi_status status;
+       struct acpi_video_bus *video;
        struct input_dev *input;
-
-
-       if (!device)
-               return -EINVAL;
+       int error;
 
        video = kzalloc(sizeof(struct acpi_video_bus), GFP_KERNEL);
        if (!video)
@@ -1923,15 +1914,15 @@ static int acpi_video_bus_add(struct acpi_device *device)
        acpi_driver_data(device) = video;
 
        acpi_video_bus_find_cap(video);
-       result = acpi_video_bus_check(video);
-       if (result)
-               goto end;
+       error = acpi_video_bus_check(video);
+       if (error)
+               goto err_free_video;
 
-       result = acpi_video_bus_add_fs(device);
-       if (result)
-               goto end;
+       error = acpi_video_bus_add_fs(device);
+       if (error)
+               goto err_free_video;
 
-       init_MUTEX(&video->sem);
+       mutex_init(&video->device_list_lock);
        INIT_LIST_HEAD(&video->video_device_list);
 
        acpi_video_bus_get_devices(video, device);
@@ -1943,16 +1934,15 @@ static int acpi_video_bus_add(struct acpi_device *device)
        if (ACPI_FAILURE(status)) {
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
                                  "Error installing notify handler\n"));
-               acpi_video_bus_stop_devices(video);
-               acpi_video_bus_put_devices(video);
-               kfree(video->attached_array);
-               acpi_video_bus_remove_fs(device);
-               result = -ENODEV;
-               goto end;
+               error = -ENODEV;
+               goto err_stop_video;
        }
 
-
        video->input = input = input_allocate_device();
+       if (!input) {
+               error = -ENOMEM;
+               goto err_uninstall_notify;
+       }
 
        snprintf(video->phys, sizeof(video->phys),
                "%s/video/input0", acpi_device_hid(video->device));
@@ -1961,6 +1951,7 @@ static int acpi_video_bus_add(struct acpi_device *device)
        input->phys = video->phys;
        input->id.bustype = BUS_HOST;
        input->id.product = 0x06;
+       input->dev.parent = &device->dev;
        input->evbit[0] = BIT(EV_KEY);
        set_bit(KEY_SWITCHVIDEOMODE, input->keybit);
        set_bit(KEY_VIDEO_NEXT, input->keybit);
@@ -1971,18 +1962,10 @@ static int acpi_video_bus_add(struct acpi_device *device)
        set_bit(KEY_BRIGHTNESS_ZERO, input->keybit);
        set_bit(KEY_DISPLAY_OFF, input->keybit);
        set_bit(KEY_UNKNOWN, input->keybit);
-       result = input_register_device(input);
-       if (result) {
-               acpi_remove_notify_handler(video->device->handle,
-                                               ACPI_DEVICE_NOTIFY,
-                                               acpi_video_bus_notify);
-               acpi_video_bus_stop_devices(video);
-               acpi_video_bus_put_devices(video);
-               kfree(video->attached_array);
-               acpi_video_bus_remove_fs(device);
-               goto end;
-        }
 
+       error = input_register_device(input);
+       if (error)
+               goto err_free_input_dev;
 
        printk(KERN_INFO PREFIX "%s [%s] (multi-head: %s  rom: %s  post: %s)\n",
               ACPI_VIDEO_DEVICE_NAME, acpi_device_bid(device),
@@ -1990,11 +1973,23 @@ static int acpi_video_bus_add(struct acpi_device *device)
               video->flags.rom ? "yes" : "no",
               video->flags.post ? "yes" : "no");
 
-      end:
-       if (result)
-               kfree(video);
+       return 0;
+
+ err_free_input_dev:
+       input_free_device(input);
+ err_uninstall_notify:
+       acpi_remove_notify_handler(device->handle, ACPI_DEVICE_NOTIFY,
+                                  acpi_video_bus_notify);
+ err_stop_video:
+       acpi_video_bus_stop_devices(video);
+       acpi_video_bus_put_devices(video);
+       kfree(video->attached_array);
+       acpi_video_bus_remove_fs(device);
+ err_free_video:
+       kfree(video);
+       acpi_driver_data(device) = NULL;
 
-       return result;
+       return error;
 }
 
 static int acpi_video_bus_remove(struct acpi_device *device, int type)
index 49cf4cf1a5a2959c6dbf1921e19592775db827e6..ed9b407e42d4ec3f7112a4b763b217085511e5d1 100644 (file)
@@ -49,6 +49,9 @@
 #define DRV_NAME       "ahci"
 #define DRV_VERSION    "3.0"
 
+static int ahci_enable_alpm(struct ata_port *ap,
+               enum link_pm policy);
+static void ahci_disable_alpm(struct ata_port *ap);
 
 enum {
        AHCI_PCI_BAR            = 5,
@@ -99,6 +102,7 @@ enum {
        HOST_CAP_SSC            = (1 << 14), /* Slumber capable */
        HOST_CAP_PMP            = (1 << 17), /* Port Multiplier support */
        HOST_CAP_CLO            = (1 << 24), /* Command List Override support */
+       HOST_CAP_ALPM           = (1 << 26), /* Aggressive Link PM support */
        HOST_CAP_SSS            = (1 << 27), /* Staggered Spin-up */
        HOST_CAP_SNTF           = (1 << 29), /* SNotification register */
        HOST_CAP_NCQ            = (1 << 30), /* Native Command Queueing */
@@ -155,6 +159,8 @@ enum {
                                  PORT_IRQ_PIOS_FIS | PORT_IRQ_D2H_REG_FIS,
 
        /* PORT_CMD bits */
+       PORT_CMD_ASP            = (1 << 27), /* Aggressive Slumber/Partial */
+       PORT_CMD_ALPE           = (1 << 26), /* Aggressive Link PM enable */
        PORT_CMD_ATAPI          = (1 << 24), /* Device is ATAPI */
        PORT_CMD_PMP            = (1 << 17), /* PMP attached */
        PORT_CMD_LIST_ON        = (1 << 15), /* cmd list DMA engine running */
@@ -178,13 +184,14 @@ enum {
        AHCI_HFLAG_MV_PATA              = (1 << 4), /* PATA port */
        AHCI_HFLAG_NO_MSI               = (1 << 5), /* no PCI MSI */
        AHCI_HFLAG_NO_PMP               = (1 << 6), /* no PMP */
+       AHCI_HFLAG_NO_HOTPLUG           = (1 << 7), /* ignore PxSERR.DIAG.N */
 
        /* ap->flags bits */
-       AHCI_FLAG_NO_HOTPLUG            = (1 << 24), /* ignore PxSERR.DIAG.N */
 
        AHCI_FLAG_COMMON                = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
                                          ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA |
-                                         ATA_FLAG_ACPI_SATA | ATA_FLAG_AN,
+                                         ATA_FLAG_ACPI_SATA | ATA_FLAG_AN |
+                                         ATA_FLAG_IPM,
        AHCI_LFLAG_COMMON               = ATA_LFLAG_SKIP_D2H_BSY,
 };
 
@@ -254,6 +261,11 @@ static int ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg);
 static int ahci_pci_device_resume(struct pci_dev *pdev);
 #endif
 
+static struct class_device_attribute *ahci_shost_attrs[] = {
+       &class_device_attr_link_power_management_policy,
+       NULL
+};
+
 static struct scsi_host_template ahci_sht = {
        .module                 = THIS_MODULE,
        .name                   = DRV_NAME,
@@ -271,6 +283,7 @@ static struct scsi_host_template ahci_sht = {
        .slave_configure        = ata_scsi_slave_config,
        .slave_destroy          = ata_scsi_slave_destroy,
        .bios_param             = ata_std_bios_param,
+       .shost_attrs            = ahci_shost_attrs,
 };
 
 static const struct ata_port_operations ahci_ops = {
@@ -302,6 +315,8 @@ static const struct ata_port_operations ahci_ops = {
        .port_suspend           = ahci_port_suspend,
        .port_resume            = ahci_port_resume,
 #endif
+       .enable_pm              = ahci_enable_alpm,
+       .disable_pm             = ahci_disable_alpm,
 
        .port_start             = ahci_port_start,
        .port_stop              = ahci_port_stop,
@@ -836,6 +851,130 @@ static void ahci_power_up(struct ata_port *ap)
        writel(cmd | PORT_CMD_ICC_ACTIVE, port_mmio + PORT_CMD);
 }
 
+static void ahci_disable_alpm(struct ata_port *ap)
+{
+       struct ahci_host_priv *hpriv = ap->host->private_data;
+       void __iomem *port_mmio = ahci_port_base(ap);
+       u32 cmd;
+       struct ahci_port_priv *pp = ap->private_data;
+
+       /* IPM bits should be disabled by libata-core */
+       /* get the existing command bits */
+       cmd = readl(port_mmio + PORT_CMD);
+
+       /* disable ALPM and ASP */
+       cmd &= ~PORT_CMD_ASP;
+       cmd &= ~PORT_CMD_ALPE;
+
+       /* force the interface back to active */
+       cmd |= PORT_CMD_ICC_ACTIVE;
+
+       /* write out new cmd value */
+       writel(cmd, port_mmio + PORT_CMD);
+       cmd = readl(port_mmio + PORT_CMD);
+
+       /* wait 10ms to be sure we've come out of any low power state */
+       msleep(10);
+
+       /* clear out any PhyRdy stuff from interrupt status */
+       writel(PORT_IRQ_PHYRDY, port_mmio + PORT_IRQ_STAT);
+
+       /* go ahead and clean out PhyRdy Change from Serror too */
+       ahci_scr_write(ap, SCR_ERROR, ((1 << 16) | (1 << 18)));
+
+       /*
+        * Clear flag to indicate that we should ignore all PhyRdy
+        * state changes
+        */
+       hpriv->flags &= ~AHCI_HFLAG_NO_HOTPLUG;
+
+       /*
+        * Enable interrupts on Phy Ready.
+        */
+       pp->intr_mask |= PORT_IRQ_PHYRDY;
+       writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK);
+
+       /*
+        * don't change the link pm policy - we can be called
+        * just to turn of link pm temporarily
+        */
+}
+
+static int ahci_enable_alpm(struct ata_port *ap,
+       enum link_pm policy)
+{
+       struct ahci_host_priv *hpriv = ap->host->private_data;
+       void __iomem *port_mmio = ahci_port_base(ap);
+       u32 cmd;
+       struct ahci_port_priv *pp = ap->private_data;
+       u32 asp;
+
+       /* Make sure the host is capable of link power management */
+       if (!(hpriv->cap & HOST_CAP_ALPM))
+               return -EINVAL;
+
+       switch (policy) {
+       case MAX_PERFORMANCE:
+       case NOT_AVAILABLE:
+               /*
+                * if we came here with NOT_AVAILABLE,
+                * it just means this is the first time we
+                * have tried to enable - default to max performance,
+                * and let the user go to lower power modes on request.
+                */
+               ahci_disable_alpm(ap);
+               return 0;
+       case MIN_POWER:
+               /* configure HBA to enter SLUMBER */
+               asp = PORT_CMD_ASP;
+               break;
+       case MEDIUM_POWER:
+               /* configure HBA to enter PARTIAL */
+               asp = 0;
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       /*
+        * Disable interrupts on Phy Ready. This keeps us from
+        * getting woken up due to spurious phy ready interrupts
+        * TBD - Hot plug should be done via polling now, is
+        * that even supported?
+        */
+       pp->intr_mask &= ~PORT_IRQ_PHYRDY;
+       writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK);
+
+       /*
+        * Set a flag to indicate that we should ignore all PhyRdy
+        * state changes since these can happen now whenever we
+        * change link state
+        */
+       hpriv->flags |= AHCI_HFLAG_NO_HOTPLUG;
+
+       /* get the existing command bits */
+       cmd = readl(port_mmio + PORT_CMD);
+
+       /*
+        * Set ASP based on Policy
+        */
+       cmd |= asp;
+
+       /*
+        * Setting this bit will instruct the HBA to aggressively
+        * enter a lower power link state when it's appropriate and
+        * based on the value set above for ASP
+        */
+       cmd |= PORT_CMD_ALPE;
+
+       /* write out new cmd value */
+       writel(cmd, port_mmio + PORT_CMD);
+       cmd = readl(port_mmio + PORT_CMD);
+
+       /* IPM bits should be set by libata-core */
+       return 0;
+}
+
 #ifdef CONFIG_PM
 static void ahci_power_down(struct ata_port *ap)
 {
@@ -898,8 +1037,10 @@ static int ahci_reset_controller(struct ata_host *host)
         * AHCI-specific, such as HOST_RESET.
         */
        tmp = readl(mmio + HOST_CTL);
-       if (!(tmp & HOST_AHCI_EN))
-               writel(tmp | HOST_AHCI_EN, mmio + HOST_CTL);
+       if (!(tmp & HOST_AHCI_EN)) {
+               tmp |= HOST_AHCI_EN;
+               writel(tmp, mmio + HOST_CTL);
+       }
 
        /* global controller reset */
        if ((tmp & HOST_RESET) == 0) {
@@ -1153,15 +1294,8 @@ static int ahci_do_softreset(struct ata_link *link, unsigned int *class,
        tf.ctl &= ~ATA_SRST;
        ahci_exec_polled_cmd(ap, pmp, &tf, 0, 0, 0);
 
-       /* spec mandates ">= 2ms" before checking status.
-        * We wait 150ms, because that was the magic delay used for
-        * ATAPI devices in Hale Landis's ATADRVR, for the period of time
-        * between when the ATA command register is written, and then
-        * status is checked.  Because waiting for "a while" before
-        * checking status is fine, post SRST, we perform this magic
-        * delay here as well.
-        */
-       msleep(150);
+       /* wait a while before checking status */
+       ata_wait_after_reset(ap, deadline);
 
        rc = ata_wait_ready(ap, deadline);
        /* link occupied, -ENODEV too is an error */
@@ -1509,6 +1643,17 @@ static void ahci_port_intr(struct ata_port *ap)
        if (unlikely(resetting))
                status &= ~PORT_IRQ_BAD_PMP;
 
+       /* If we are getting PhyRdy, this is
+        * just a power state change, we should
+        * clear out this, plus the PhyRdy/Comm
+        * Wake bits from Serror
+        */
+       if ((hpriv->flags & AHCI_HFLAG_NO_HOTPLUG) &&
+               (status & PORT_IRQ_PHYRDY)) {
+               status &= ~PORT_IRQ_PHYRDY;
+               ahci_scr_write(ap, SCR_ERROR, ((1 << 16) | (1 << 18)));
+       }
+
        if (unlikely(status & PORT_IRQ_ERROR)) {
                ahci_error_intr(ap, status);
                return;
@@ -2156,6 +2301,9 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
                ata_port_pbar_desc(ap, AHCI_PCI_BAR,
                                   0x100 + ap->port_no * 0x80, "port");
 
+               /* set initial link pm policy */
+               ap->pm_policy = NOT_AVAILABLE;
+
                /* standard SATA port setup */
                if (hpriv->port_map & (1 << i))
                        ap->ioaddr.cmd_addr = port_mmio;
index a4b2cb29f46c8f32df1a4162894ee4b6390814e4..483269db2c7d44037a4b7268470c6bae6574e831 100644 (file)
@@ -119,18 +119,19 @@ enum {
        PIIX_80C_SEC            = (1 << 7) | (1 << 6),
 
        /* controller IDs */
-       piix_pata_33            = 0,    /* PIIX4 at 33Mhz */
-       ich_pata_33             = 1,    /* ICH up to UDMA 33 only */
-       ich_pata_66             = 2,    /* ICH up to 66 Mhz */
-       ich_pata_100            = 3,    /* ICH up to UDMA 100 */
-       ich5_sata               = 5,
-       ich6_sata               = 6,
-       ich6_sata_ahci          = 7,
-       ich6m_sata_ahci         = 8,
-       ich8_sata_ahci          = 9,
-       piix_pata_mwdma         = 10,   /* PIIX3 MWDMA only */
-       tolapai_sata_ahci       = 11,
-       ich9_2port_sata         = 12,
+       piix_pata_mwdma         = 0,    /* PIIX3 MWDMA only */
+       piix_pata_33,                   /* PIIX4 at 33Mhz */
+       ich_pata_33,                    /* ICH up to UDMA 33 only */
+       ich_pata_66,                    /* ICH up to 66 Mhz */
+       ich_pata_100,                   /* ICH up to UDMA 100 */
+       ich5_sata,
+       ich6_sata,
+       ich6_sata_ahci,
+       ich6m_sata_ahci,
+       ich8_sata_ahci,
+       ich8_2port_sata,
+       ich8m_apple_sata_ahci,          /* locks up on second port enable */
+       tolapai_sata_ahci,
 
        /* constants for mapping table */
        P0                      = 0,  /* port 0 */
@@ -239,19 +240,21 @@ static const struct pci_device_id piix_pci_tbl[] = {
        /* SATA Controller 1 IDE (ICH8) */
        { 0x8086, 0x2820, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
        /* SATA Controller 2 IDE (ICH8) */
-       { 0x8086, 0x2825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata },
+       { 0x8086, 0x2825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
        /* Mobile SATA Controller IDE (ICH8M) */
        { 0x8086, 0x2828, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
+       /* Mobile SATA Controller IDE (ICH8M), Apple */
+       { 0x8086, 0x2828, 0x106b, 0x00a0, 0, 0, ich8m_apple_sata_ahci },
        /* SATA Controller IDE (ICH9) */
        { 0x8086, 0x2920, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
        /* SATA Controller IDE (ICH9) */
-       { 0x8086, 0x2921, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata },
+       { 0x8086, 0x2921, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
        /* SATA Controller IDE (ICH9) */
-       { 0x8086, 0x2926, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata },
+       { 0x8086, 0x2926, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
        /* SATA Controller IDE (ICH9M) */
-       { 0x8086, 0x2928, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata },
+       { 0x8086, 0x2928, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
        /* SATA Controller IDE (ICH9M) */
-       { 0x8086, 0x292d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata },
+       { 0x8086, 0x292d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
        /* SATA Controller IDE (ICH9M) */
        { 0x8086, 0x292e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
        /* SATA Controller IDE (Tolapai) */
@@ -427,7 +430,7 @@ static const struct piix_map_db ich6m_map_db = {
 
 static const struct piix_map_db ich8_map_db = {
        .mask = 0x3,
-       .port_enable = 0x3,
+       .port_enable = 0xf,
        .map = {
                /* PM   PS   SM   SS       MAP */
                {  P0,  P2,  P1,  P3 }, /* 00b (hardwired when in AHCI) */
@@ -437,7 +440,7 @@ static const struct piix_map_db ich8_map_db = {
        },
 };
 
-static const struct piix_map_db tolapai_map_db = {
+static const struct piix_map_db ich8_2port_map_db = {
        .mask = 0x3,
        .port_enable = 0x3,
        .map = {
@@ -449,7 +452,19 @@ static const struct piix_map_db tolapai_map_db = {
        },
 };
 
-static const struct piix_map_db ich9_2port_map_db = {
+static const struct piix_map_db ich8m_apple_map_db = {
+       .mask = 0x3,
+       .port_enable = 0x1,
+       .map = {
+               /* PM   PS   SM   SS       MAP */
+               {  P0,  NA,  NA,  NA }, /* 00b */
+               {  RV,  RV,  RV,  RV },
+               {  P0,  P2, IDE, IDE }, /* 10b */
+               {  RV,  RV,  RV,  RV },
+       },
+};
+
+static const struct piix_map_db tolapai_map_db = {
        .mask = 0x3,
        .port_enable = 0x3,
        .map = {
@@ -467,11 +482,21 @@ static const struct piix_map_db *piix_map_db_table[] = {
        [ich6_sata_ahci]        = &ich6_map_db,
        [ich6m_sata_ahci]       = &ich6m_map_db,
        [ich8_sata_ahci]        = &ich8_map_db,
+       [ich8_2port_sata]       = &ich8_2port_map_db,
+       [ich8m_apple_sata_ahci] = &ich8m_apple_map_db,
        [tolapai_sata_ahci]     = &tolapai_map_db,
-       [ich9_2port_sata]       = &ich9_2port_map_db,
 };
 
 static struct ata_port_info piix_port_info[] = {
+       [piix_pata_mwdma] =     /* PIIX3 MWDMA only */
+       {
+               .sht            = &piix_sht,
+               .flags          = PIIX_PATA_FLAGS,
+               .pio_mask       = 0x1f, /* pio0-4 */
+               .mwdma_mask     = 0x06, /* mwdma1-2 ?? CHECK 0 should be ok but slow */
+               .port_ops       = &piix_pata_ops,
+       },
+
        [piix_pata_33] =        /* PIIX4 at 33MHz */
        {
                .sht            = &piix_sht,
@@ -565,13 +590,15 @@ static struct ata_port_info piix_port_info[] = {
                .port_ops       = &piix_sata_ops,
        },
 
-       [piix_pata_mwdma] =     /* PIIX3 MWDMA only */
+       [ich8_2port_sata] =
        {
                .sht            = &piix_sht,
-               .flags          = PIIX_PATA_FLAGS,
+               .flags          = PIIX_SATA_FLAGS | PIIX_FLAG_SCR |
+                                 PIIX_FLAG_AHCI,
                .pio_mask       = 0x1f, /* pio0-4 */
-               .mwdma_mask     = 0x06, /* mwdma1-2 ?? CHECK 0 should be ok but slow */
-               .port_ops       = &piix_pata_ops,
+               .mwdma_mask     = 0x07, /* mwdma0-2 */
+               .udma_mask      = ATA_UDMA6,
+               .port_ops       = &piix_sata_ops,
        },
 
        [tolapai_sata_ahci] =
@@ -585,7 +612,7 @@ static struct ata_port_info piix_port_info[] = {
                .port_ops       = &piix_sata_ops,
        },
 
-       [ich9_2port_sata] =
+       [ich8m_apple_sata_ahci] =
        {
                .sht            = &piix_sht,
                .flags          = PIIX_SATA_FLAGS | PIIX_FLAG_SCR |
@@ -595,6 +622,7 @@ static struct ata_port_info piix_port_info[] = {
                .udma_mask      = ATA_UDMA6,
                .port_ops       = &piix_sata_ops,
        },
+
 };
 
 static struct pci_bits piix_enable_bits[] = {
@@ -621,6 +649,7 @@ struct ich_laptop {
 static const struct ich_laptop ich_laptop[] = {
        /* devid, subvendor, subdev */
        { 0x27DF, 0x0005, 0x0280 },     /* ICH7 on Acer 5602WLMi */
+       { 0x27DF, 0x1025, 0x0102 },     /* ICH7 on Acer 5602aWLMi */
        { 0x27DF, 0x1025, 0x0110 },     /* ICH7 on Acer 3682WLMi */
        { 0x27DF, 0x1043, 0x1267 },     /* ICH7 on Asus W5F */
        { 0x27DF, 0x103C, 0x30A1 },     /* ICH7 on HP Compaq nc2400 */
@@ -958,6 +987,13 @@ static int piix_broken_suspend(void)
                                DMI_MATCH(DMI_PRODUCT_NAME, "Satellite U200"),
                        },
                },
+               {
+                       .ident = "Satellite Pro U200",
+                       .matches = {
+                               DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
+                               DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE PRO U200"),
+                       },
+               },
                {
                        .ident = "Satellite U205",
                        .matches = {
@@ -965,6 +1001,13 @@ static int piix_broken_suspend(void)
                                DMI_MATCH(DMI_PRODUCT_NAME, "Satellite U205"),
                        },
                },
+               {
+                       .ident = "SATELLITE U205",
+                       .matches = {
+                               DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
+                               DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE U205"),
+                       },
+               },
                {
                        .ident = "Portege M500",
                        .matches = {
@@ -1078,12 +1121,12 @@ static int piix_disable_ahci(struct pci_dev *pdev)
        if (!mmio)
                return -ENOMEM;
 
-       tmp = readl(mmio + AHCI_GLOBAL_CTL);
+       tmp = ioread32(mmio + AHCI_GLOBAL_CTL);
        if (tmp & AHCI_ENABLE) {
                tmp &= ~AHCI_ENABLE;
-               writel(tmp, mmio + AHCI_GLOBAL_CTL);
+               iowrite32(tmp, mmio + AHCI_GLOBAL_CTL);
 
-               tmp = readl(mmio + AHCI_GLOBAL_CTL);
+               tmp = ioread32(mmio + AHCI_GLOBAL_CTL);
                if (tmp & AHCI_ENABLE)
                        rc = -EIO;
        }
index 08a52dd45fb6a4bd686ee0ef05f1cc069f863713..545ea865ceb522bf37b675558f9eedab1da7332d 100644 (file)
@@ -312,7 +312,7 @@ EXPORT_SYMBOL_GPL(ata_acpi_stm);
  *
  * RETURNS:
  * Number of taskfiles on success, 0 if _GTF doesn't exist or doesn't
- * contain valid data.  -errno on other errors.
+ * contain valid data.
  */
 static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf,
                           void **ptr_to_free)
@@ -339,7 +339,6 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf,
                        ata_dev_printk(dev, KERN_WARNING,
                                       "_GTF evaluation failed (AE 0x%x)\n",
                                       status);
-                       rc = -EIO;
                }
                goto out_free;
        }
@@ -359,7 +358,6 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf,
                ata_dev_printk(dev, KERN_WARNING,
                               "_GTF unexpected object type 0x%x\n",
                               out_obj->type);
-               rc = -EINVAL;
                goto out_free;
        }
 
@@ -367,7 +365,6 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf,
                ata_dev_printk(dev, KERN_WARNING,
                               "unexpected _GTF length (%d)\n",
                               out_obj->buffer.length);
-               rc = -EINVAL;
                goto out_free;
        }
 
@@ -511,10 +508,7 @@ static int ata_acpi_exec_tfs(struct ata_device *dev)
        int gtf_count, i, rc;
 
        /* get taskfiles */
-       rc = ata_dev_get_GTF(dev, &gtf, &ptr_to_free);
-       if (rc < 0)
-               return rc;
-       gtf_count = rc;
+       gtf_count = ata_dev_get_GTF(dev, &gtf, &ptr_to_free);
 
        /* execute them */
        for (i = 0, rc = 0; i < gtf_count; i++) {
index 081e3dfb64d485e9382d253add9ae07a03f4651e..33f06277b3be2ab81f41c539ea19f65227867e1f 100644 (file)
  *  Hardware documentation available from http://www.t13.org/ and
  *  http://www.sata-io.org/
  *
+ *  Standards documents from:
+ *     http://www.t13.org (ATA standards, PCI DMA IDE spec)
+ *     http://www.t10.org (SCSI MMC - for ATAPI MMC)
+ *     http://www.sata-io.org (SATA)
+ *     http://www.compactflash.org (CF)
+ *     http://www.qic.org (QIC157 - Tape and DSC)
+ *     http://www.ce-ata.org (CE-ATA: not supported)
+ *
  */
 
 #include <linux/kernel.h>
@@ -620,6 +628,183 @@ void ata_dev_disable(struct ata_device *dev)
        }
 }
 
+static int ata_dev_set_dipm(struct ata_device *dev, enum link_pm policy)
+{
+       struct ata_link *link = dev->link;
+       struct ata_port *ap = link->ap;
+       u32 scontrol;
+       unsigned int err_mask;
+       int rc;
+
+       /*
+        * disallow DIPM for drivers which haven't set
+        * ATA_FLAG_IPM.  This is because when DIPM is enabled,
+        * phy ready will be set in the interrupt status on
+        * state changes, which will cause some drivers to
+        * think there are errors - additionally drivers will
+        * need to disable hot plug.
+        */
+       if (!(ap->flags & ATA_FLAG_IPM) || !ata_dev_enabled(dev)) {
+               ap->pm_policy = NOT_AVAILABLE;
+               return -EINVAL;
+       }
+
+       /*
+        * For DIPM, we will only enable it for the
+        * min_power setting.
+        *
+        * Why?  Because Disks are too stupid to know that
+        * If the host rejects a request to go to SLUMBER
+        * they should retry at PARTIAL, and instead it
+        * just would give up.  So, for medium_power to
+        * work at all, we need to only allow HIPM.
+        */
+       rc = sata_scr_read(link, SCR_CONTROL, &scontrol);
+       if (rc)
+               return rc;
+
+       switch (policy) {
+       case MIN_POWER:
+               /* no restrictions on IPM transitions */
+               scontrol &= ~(0x3 << 8);
+               rc = sata_scr_write(link, SCR_CONTROL, scontrol);
+               if (rc)
+                       return rc;
+
+               /* enable DIPM */
+               if (dev->flags & ATA_DFLAG_DIPM)
+                       err_mask = ata_dev_set_feature(dev,
+                                       SETFEATURES_SATA_ENABLE, SATA_DIPM);
+               break;
+       case MEDIUM_POWER:
+               /* allow IPM to PARTIAL */
+               scontrol &= ~(0x1 << 8);
+               scontrol |= (0x2 << 8);
+               rc = sata_scr_write(link, SCR_CONTROL, scontrol);
+               if (rc)
+                       return rc;
+
+               /*
+                * we don't have to disable DIPM since IPM flags
+                * disallow transitions to SLUMBER, which effectively
+                * disable DIPM if it does not support PARTIAL
+                */
+               break;
+       case NOT_AVAILABLE:
+       case MAX_PERFORMANCE:
+               /* disable all IPM transitions */
+               scontrol |= (0x3 << 8);
+               rc = sata_scr_write(link, SCR_CONTROL, scontrol);
+               if (rc)
+                       return rc;
+
+               /*
+                * we don't have to disable DIPM since IPM flags
+                * disallow all transitions which effectively
+                * disable DIPM anyway.
+                */
+               break;
+       }
+
+       /* FIXME: handle SET FEATURES failure */
+       (void) err_mask;
+
+       return 0;
+}
+
+/**
+ *     ata_dev_enable_pm - enable SATA interface power management
+ *     @dev:  device to enable power management
+ *     @policy: the link power management policy
+ *
+ *     Enable SATA Interface power management.  This will enable
+ *     Device Interface Power Management (DIPM) for min_power
+ *     policy, and then call driver specific callbacks for
+ *     enabling Host Initiated Power management.
+ *
+ *     Locking: Caller.
+ *     Returns: -EINVAL if IPM is not supported, 0 otherwise.
+ */
+void ata_dev_enable_pm(struct ata_device *dev, enum link_pm policy)
+{
+       int rc = 0;
+       struct ata_port *ap = dev->link->ap;
+
+       /* set HIPM first, then DIPM */
+       if (ap->ops->enable_pm)
+               rc = ap->ops->enable_pm(ap, policy);
+       if (rc)
+               goto enable_pm_out;
+       rc = ata_dev_set_dipm(dev, policy);
+
+enable_pm_out:
+       if (rc)
+               ap->pm_policy = MAX_PERFORMANCE;
+       else
+               ap->pm_policy = policy;
+       return /* rc */;        /* hopefully we can use 'rc' eventually */
+}
+
+#ifdef CONFIG_PM
+/**
+ *     ata_dev_disable_pm - disable SATA interface power management
+ *     @dev: device to disable power management
+ *
+ *     Disable SATA Interface power management.  This will disable
+ *     Device Interface Power Management (DIPM) without changing
+ *     policy,  call driver specific callbacks for disabling Host
+ *     Initiated Power management.
+ *
+ *     Locking: Caller.
+ *     Returns: void
+ */
+static void ata_dev_disable_pm(struct ata_device *dev)
+{
+       struct ata_port *ap = dev->link->ap;
+
+       ata_dev_set_dipm(dev, MAX_PERFORMANCE);
+       if (ap->ops->disable_pm)
+               ap->ops->disable_pm(ap);
+}
+#endif /* CONFIG_PM */
+
+void ata_lpm_schedule(struct ata_port *ap, enum link_pm policy)
+{
+       ap->pm_policy = policy;
+       ap->link.eh_info.action |= ATA_EHI_LPM;
+       ap->link.eh_info.flags |= ATA_EHI_NO_AUTOPSY;
+       ata_port_schedule_eh(ap);
+}
+
+#ifdef CONFIG_PM
+static void ata_lpm_enable(struct ata_host *host)
+{
+       struct ata_link *link;
+       struct ata_port *ap;
+       struct ata_device *dev;
+       int i;
+
+       for (i = 0; i < host->n_ports; i++) {
+               ap = host->ports[i];
+               ata_port_for_each_link(link, ap) {
+                       ata_link_for_each_dev(dev, link)
+                               ata_dev_disable_pm(dev);
+               }
+       }
+}
+
+static void ata_lpm_disable(struct ata_host *host)
+{
+       int i;
+
+       for (i = 0; i < host->n_ports; i++) {
+               struct ata_port *ap = host->ports[i];
+               ata_lpm_schedule(ap, ap->pm_policy);
+       }
+}
+#endif /* CONFIG_PM */
+
+
 /**
  *     ata_devchk - PATA device presence detection
  *     @ap: ATA channel to examine
@@ -2101,6 +2286,13 @@ int ata_dev_configure(struct ata_device *dev)
        if (dev->flags & ATA_DFLAG_LBA48)
                dev->max_sectors = ATA_MAX_SECTORS_LBA48;
 
+       if (!(dev->horkage & ATA_HORKAGE_IPM)) {
+               if (ata_id_has_hipm(dev->id))
+                       dev->flags |= ATA_DFLAG_HIPM;
+               if (ata_id_has_dipm(dev->id))
+                       dev->flags |= ATA_DFLAG_DIPM;
+       }
+
        if (dev->horkage & ATA_HORKAGE_DIAGNOSTIC) {
                /* Let the user know. We don't want to disallow opens for
                   rescue purposes, or in case the vendor is just a blithering
@@ -2122,10 +2314,23 @@ int ata_dev_configure(struct ata_device *dev)
                dev->max_sectors = ATA_MAX_SECTORS;
        }
 
+       if ((dev->class == ATA_DEV_ATAPI) &&
+           (atapi_command_packet_set(id) == TYPE_TAPE)) {
+               dev->max_sectors = ATA_MAX_SECTORS_TAPE;
+               dev->horkage |= ATA_HORKAGE_STUCK_ERR;
+       }
+
        if (dev->horkage & ATA_HORKAGE_MAX_SEC_128)
                dev->max_sectors = min_t(unsigned int, ATA_MAX_SECTORS_128,
                                         dev->max_sectors);
 
+       if (ata_dev_blacklisted(dev) & ATA_HORKAGE_IPM) {
+               dev->horkage |= ATA_HORKAGE_IPM;
+
+               /* reset link pm_policy for this port to no pm */
+               ap->pm_policy = MAX_PERFORMANCE;
+       }
+
        if (ap->ops->dev_config)
                ap->ops->dev_config(dev);
 
@@ -2219,6 +2424,25 @@ int ata_bus_probe(struct ata_port *ap)
                tries[dev->devno] = ATA_PROBE_MAX_TRIES;
 
  retry:
+       ata_link_for_each_dev(dev, &ap->link) {
+               /* If we issue an SRST then an ATA drive (not ATAPI)
+                * may change configuration and be in PIO0 timing. If
+                * we do a hard reset (or are coming from power on)
+                * this is true for ATA or ATAPI. Until we've set a
+                * suitable controller mode we should not touch the
+                * bus as we may be talking too fast.
+                */
+               dev->pio_mode = XFER_PIO_0;
+
+               /* If the controller has a pio mode setup function
+                * then use it to set the chipset to rights. Don't
+                * touch the DMA setup as that will be dealt with when
+                * configuring devices.
+                */
+               if (ap->ops->set_piomode)
+                       ap->ops->set_piomode(ap, dev);
+       }
+
        /* reset and determine device classes */
        ap->ops->phy_reset(ap);
 
@@ -2234,12 +2458,6 @@ int ata_bus_probe(struct ata_port *ap)
 
        ata_port_probe(ap);
 
-       /* after the reset the device state is PIO 0 and the controller
-          state is undefined. Record the mode */
-
-       ata_link_for_each_dev(dev, &ap->link)
-               dev->pio_mode = XFER_PIO_0;
-
        /* read IDENTIFY page and configure devices. We have to do the identify
           specific sequence bass-ackwards so that PDIAG- is released by
           the slave device */
@@ -2372,81 +2590,6 @@ void sata_print_link_status(struct ata_link *link)
        }
 }
 
-/**
- *     __sata_phy_reset - Wake/reset a low-level SATA PHY
- *     @ap: SATA port associated with target SATA PHY.
- *
- *     This function issues commands to standard SATA Sxxx
- *     PHY registers, to wake up the phy (and device), and
- *     clear any reset condition.
- *
- *     LOCKING:
- *     PCI/etc. bus probe sem.
- *
- */
-void __sata_phy_reset(struct ata_port *ap)
-{
-       struct ata_link *link = &ap->link;
-       unsigned long timeout = jiffies + (HZ * 5);
-       u32 sstatus;
-
-       if (ap->flags & ATA_FLAG_SATA_RESET) {
-               /* issue phy wake/reset */
-               sata_scr_write_flush(link, SCR_CONTROL, 0x301);
-               /* Couldn't find anything in SATA I/II specs, but
-                * AHCI-1.1 10.4.2 says at least 1 ms. */
-               mdelay(1);
-       }
-       /* phy wake/clear reset */
-       sata_scr_write_flush(link, SCR_CONTROL, 0x300);
-
-       /* wait for phy to become ready, if necessary */
-       do {
-               msleep(200);
-               sata_scr_read(link, SCR_STATUS, &sstatus);
-               if ((sstatus & 0xf) != 1)
-                       break;
-       } while (time_before(jiffies, timeout));
-
-       /* print link status */
-       sata_print_link_status(link);
-
-       /* TODO: phy layer with polling, timeouts, etc. */
-       if (!ata_link_offline(link))
-               ata_port_probe(ap);
-       else
-               ata_port_disable(ap);
-
-       if (ap->flags & ATA_FLAG_DISABLED)
-               return;
-
-       if (ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT)) {
-               ata_port_disable(ap);
-               return;
-       }
-
-       ap->cbl = ATA_CBL_SATA;
-}
-
-/**
- *     sata_phy_reset - Reset SATA bus.
- *     @ap: SATA port associated with target SATA PHY.
- *
- *     This function resets the SATA bus, and then probes
- *     the bus for devices.
- *
- *     LOCKING:
- *     PCI/etc. bus probe sem.
- *
- */
-void sata_phy_reset(struct ata_port *ap)
-{
-       __sata_phy_reset(ap);
-       if (ap->flags & ATA_FLAG_DISABLED)
-               return;
-       ata_bus_reset(ap);
-}
-
 /**
  *     ata_dev_pair            -       return other device on cable
  *     @adev: device
@@ -2545,17 +2688,27 @@ int sata_down_spd_limit(struct ata_link *link)
 
 static int __sata_set_spd_needed(struct ata_link *link, u32 *scontrol)
 {
-       u32 spd, limit;
+       struct ata_link *host_link = &link->ap->link;
+       u32 limit, target, spd;
+
+       limit = link->sata_spd_limit;
+
+       /* Don't configure downstream link faster than upstream link.
+        * It doesn't speed up anything and some PMPs choke on such
+        * configuration.
+        */
+       if (!ata_is_host_link(link) && host_link->sata_spd)
+               limit &= (1 << host_link->sata_spd) - 1;
 
-       if (link->sata_spd_limit == UINT_MAX)
-               limit = 0;
+       if (limit == UINT_MAX)
+               target = 0;
        else
-               limit = fls(link->sata_spd_limit);
+               target = fls(limit);
 
        spd = (*scontrol >> 4) & 0xf;
-       *scontrol = (*scontrol & ~0xf0) | ((limit & 0xf) << 4);
+       *scontrol = (*scontrol & ~0xf0) | ((target & 0xf) << 4);
 
-       return spd != limit;
+       return spd != target;
 }
 
 /**
@@ -2578,7 +2731,7 @@ int sata_set_spd_needed(struct ata_link *link)
        u32 scontrol;
 
        if (sata_scr_read(link, SCR_CONTROL, &scontrol))
-               return 0;
+               return 1;
 
        return __sata_set_spd_needed(link, &scontrol);
 }
@@ -3117,6 +3270,61 @@ int ata_busy_sleep(struct ata_port *ap,
        return 0;
 }
 
+/**
+ *     ata_wait_after_reset - wait before checking status after reset
+ *     @ap: port containing status register to be polled
+ *     @deadline: deadline jiffies for the operation
+ *
+ *     After reset, we need to pause a while before reading status.
+ *     Also, certain combination of controller and device report 0xff
+ *     for some duration (e.g. until SATA PHY is up and running)
+ *     which is interpreted as empty port in ATA world.  This
+ *     function also waits for such devices to get out of 0xff
+ *     status.
+ *
+ *     LOCKING:
+ *     Kernel thread context (may sleep).
+ */
+void ata_wait_after_reset(struct ata_port *ap, unsigned long deadline)
+{
+       unsigned long until = jiffies + ATA_TMOUT_FF_WAIT;
+
+       if (time_before(until, deadline))
+               deadline = until;
+
+       /* Spec mandates ">= 2ms" before checking status.  We wait
+        * 150ms, because that was the magic delay used for ATAPI
+        * devices in Hale Landis's ATADRVR, for the period of time
+        * between when the ATA command register is written, and then
+        * status is checked.  Because waiting for "a while" before
+        * checking status is fine, post SRST, we perform this magic
+        * delay here as well.
+        *
+        * Old drivers/ide uses the 2mS rule and then waits for ready.
+        */
+       msleep(150);
+
+       /* Wait for 0xff to clear.  Some SATA devices take a long time
+        * to clear 0xff after reset.  For example, HHD424020F7SV00
+        * iVDR needs >= 800ms while.  Quantum GoVault needs even more
+        * than that.
+        *
+        * Note that some PATA controllers (pata_ali) explode if
+        * status register is read more than once when there's no
+        * device attached.
+        */
+       if (ap->flags & ATA_FLAG_SATA) {
+               while (1) {
+                       u8 status = ata_chk_status(ap);
+
+                       if (status != 0xff || time_after(jiffies, deadline))
+                               return;
+
+                       msleep(50);
+               }
+       }
+}
+
 /**
  *     ata_wait_ready - sleep until BSY clears, or timeout
  *     @ap: port containing status register to be polled
@@ -3223,8 +3431,6 @@ static int ata_bus_softreset(struct ata_port *ap, unsigned int devmask,
                             unsigned long deadline)
 {
        struct ata_ioports *ioaddr = &ap->ioaddr;
-       struct ata_device *dev;
-       int i = 0;
 
        DPRINTK("ata%u: bus reset via SRST\n", ap->print_id);
 
@@ -3235,36 +3441,8 @@ static int ata_bus_softreset(struct ata_port *ap, unsigned int devmask,
        udelay(20);     /* FIXME: flush */
        iowrite8(ap->ctl, ioaddr->ctl_addr);
 
-       /* If we issued an SRST then an ATA drive (not ATAPI)
-        * may have changed configuration and be in PIO0 timing. If
-        * we did a hard reset (or are coming from power on) this is
-        * true for ATA or ATAPI. Until we've set a suitable controller
-        * mode we should not touch the bus as we may be talking too fast.
-        */
-
-       ata_link_for_each_dev(dev, &ap->link)
-               dev->pio_mode = XFER_PIO_0;
-
-       /* If the controller has a pio mode setup function then use
-          it to set the chipset to rights. Don't touch the DMA setup
-          as that will be dealt with when revalidating */
-       if (ap->ops->set_piomode) {
-               ata_link_for_each_dev(dev, &ap->link)
-                       if (devmask & (1 << i++))
-                               ap->ops->set_piomode(ap, dev);
-       }
-
-       /* spec mandates ">= 2ms" before checking status.
-        * We wait 150ms, because that was the magic delay used for
-        * ATAPI devices in Hale Landis's ATADRVR, for the period of time
-        * between when the ATA command register is written, and then
-        * status is checked.  Because waiting for "a while" before
-        * checking status is fine, post SRST, we perform this magic
-        * delay here as well.
-        *
-        * Old drivers/ide uses the 2mS rule and then waits for ready
-        */
-       msleep(150);
+       /* wait a while before checking status */
+       ata_wait_after_reset(ap, deadline);
 
        /* Before we perform post reset processing we want to see if
         * the bus shows 0xFF because the odd clown forgets the D7
@@ -3691,8 +3869,8 @@ int sata_std_hardreset(struct ata_link *link, unsigned int *class,
                return 0;
        }
 
-       /* wait a while before checking status, see SRST for more info */
-       msleep(150);
+       /* wait a while before checking status */
+       ata_wait_after_reset(ap, deadline);
 
        /* If PMP is supported, we have to do follow-up SRST.  Note
         * that some PMPs don't send D2H Reg FIS after hardreset at
@@ -3992,6 +4170,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
        { "ST3160812AS",        "3.ADJ",        ATA_HORKAGE_NONCQ, },
        { "ST980813AS",         "3.ADB",        ATA_HORKAGE_NONCQ, },
        { "SAMSUNG HD401LJ",    "ZZ100-15",     ATA_HORKAGE_NONCQ, },
+       { "Maxtor 7V300F0",     "VA111900",     ATA_HORKAGE_NONCQ, },
 
        /* devices which puke on READ_NATIVE_MAX */
        { "HDS724040KLSA80",    "KFAOA20N",     ATA_HORKAGE_BROKEN_HPA, },
@@ -4003,6 +4182,10 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
        { "ST340823A",          NULL,           ATA_HORKAGE_HPA_SIZE, },
        { "ST320413A",          NULL,           ATA_HORKAGE_HPA_SIZE, },
 
+       /* Devices which get the IVB wrong */
+       { "QUANTUM FIREBALLlct10 05", "A03.0900", ATA_HORKAGE_IVB, },
+       { "TSSTcorp CDDVDW SH-S202J", "SB00",     ATA_HORKAGE_IVB, },
+
        /* End Marker */
        { }
 };
@@ -4063,6 +4246,21 @@ static int ata_dma_blacklisted(const struct ata_device *dev)
        return (dev->horkage & ATA_HORKAGE_NODMA) ? 1 : 0;
 }
 
+/**
+ *     ata_is_40wire           -       check drive side detection
+ *     @dev: device
+ *
+ *     Perform drive side detection decoding, allowing for device vendors
+ *     who can't follow the documentation.
+ */
+
+static int ata_is_40wire(struct ata_device *dev)
+{
+       if (dev->horkage & ATA_HORKAGE_IVB)
+               return ata_drive_40wire_relaxed(dev->id);
+       return ata_drive_40wire(dev->id);
+}
+
 /**
  *     ata_dev_xfermask - Compute supported xfermask of the given device
  *     @dev: Device to compute xfermask for
@@ -4132,7 +4330,7 @@ static void ata_dev_xfermask(struct ata_device *dev)
        if (xfer_mask & (0xF8 << ATA_SHIFT_UDMA))
                /* UDMA/44 or higher would be available */
                if ((ap->cbl == ATA_CBL_PATA40) ||
-                   (ata_drive_40wire(dev->id) &&
+                   (ata_is_40wire(dev) &&
                    (ap->cbl == ATA_CBL_PATA_UNK ||
                     ap->cbl == ATA_CBL_PATA80))) {
                        ata_dev_printk(dev, KERN_WARNING,
@@ -4689,6 +4887,7 @@ static int ata_sg_setup(struct ata_queued_cmd *qc)
                 * data in this function or read data in ata_sg_clean.
                 */
                offset = lsg->offset + lsg->length - qc->pad_len;
+               sg_init_table(psg, 1);
                sg_set_page(psg, nth_page(sg_page(lsg), offset >> PAGE_SHIFT),
                                qc->pad_len, offset_in_page(offset));
 
@@ -5226,11 +5425,19 @@ fsm_start:
                 * let the EH abort the command or reset the device.
                 */
                if (unlikely(status & (ATA_ERR | ATA_DF))) {
-                       ata_port_printk(ap, KERN_WARNING, "DRQ=1 with device "
-                                       "error, dev_stat 0x%X\n", status);
-                       qc->err_mask |= AC_ERR_HSM;
-                       ap->hsm_task_state = HSM_ST_ERR;
-                       goto fsm_start;
+                       /* Some ATAPI tape drives forget to clear the ERR bit
+                        * when doing the next command (mostly request sense).
+                        * We ignore ERR here to workaround and proceed sending
+                        * the CDB.
+                        */
+                       if (!(qc->dev->horkage & ATA_HORKAGE_STUCK_ERR)) {
+                               ata_port_printk(ap, KERN_WARNING,
+                                               "DRQ=1 with device error, "
+                                               "dev_stat 0x%X\n", status);
+                               qc->err_mask |= AC_ERR_HSM;
+                               ap->hsm_task_state = HSM_ST_ERR;
+                               goto fsm_start;
+                       }
                }
 
                /* Send the CDB (atapi) or the first data block (ata pio out).
@@ -5594,6 +5801,9 @@ void ata_qc_complete(struct ata_queued_cmd *qc)
         * taken care of.
         */
        if (ap->ops->error_handler) {
+               struct ata_device *dev = qc->dev;
+               struct ata_eh_info *ehi = &dev->link->eh_info;
+
                WARN_ON(ap->pflags & ATA_PFLAG_FROZEN);
 
                if (unlikely(qc->err_mask))
@@ -5612,6 +5822,27 @@ void ata_qc_complete(struct ata_queued_cmd *qc)
                if (qc->flags & ATA_QCFLAG_RESULT_TF)
                        fill_result_tf(qc);
 
+               /* Some commands need post-processing after successful
+                * completion.
+                */
+               switch (qc->tf.command) {
+               case ATA_CMD_SET_FEATURES:
+                       if (qc->tf.feature != SETFEATURES_WC_ON &&
+                           qc->tf.feature != SETFEATURES_WC_OFF)
+                               break;
+                       /* fall through */
+               case ATA_CMD_INIT_DEV_PARAMS: /* CHS translation changed */
+               case ATA_CMD_SET_MULTI: /* multi_count changed */
+                       /* revalidate device */
+                       ehi->dev_action[dev->devno] |= ATA_EH_REVALIDATE;
+                       ata_port_schedule_eh(ap);
+                       break;
+
+               case ATA_CMD_SLEEP:
+                       dev->flags |= ATA_DFLAG_SLEEPING;
+                       break;
+               }
+
                __ata_qc_complete(qc);
        } else {
                if (qc->flags & ATA_QCFLAG_EH_SCHEDULED)
@@ -5749,6 +5980,14 @@ void ata_qc_issue(struct ata_queued_cmd *qc)
                qc->flags &= ~ATA_QCFLAG_DMAMAP;
        }
 
+       /* if device is sleeping, schedule softreset and abort the link */
+       if (unlikely(qc->dev->flags & ATA_DFLAG_SLEEPING)) {
+               link->eh_info.action |= ATA_EH_SOFTRESET;
+               ata_ehi_push_desc(&link->eh_info, "waking up from sleep");
+               ata_link_abort(link);
+               return;
+       }
+
        ap->ops->qc_prep(qc);
 
        qc->err_mask |= ap->ops->qc_issue(qc);
@@ -6296,6 +6535,12 @@ int ata_host_suspend(struct ata_host *host, pm_message_t mesg)
 {
        int rc;
 
+       /*
+        * disable link pm on all ports before requesting
+        * any pm activity
+        */
+       ata_lpm_enable(host);
+
        rc = ata_host_request_pm(host, mesg, 0, ATA_EHI_QUIET, 1);
        if (rc == 0)
                host->dev->power.power_state = mesg;
@@ -6318,6 +6563,9 @@ void ata_host_resume(struct ata_host *host)
        ata_host_request_pm(host, PMSG_ON, ATA_EH_SOFTRESET,
                            ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET, 0);
        host->dev->power.power_state = PMSG_ON;
+
+       /* reenable link pm */
+       ata_lpm_disable(host);
 }
 #endif
 
@@ -6516,19 +6764,6 @@ static void ata_host_release(struct device *gendev, void *res)
        struct ata_host *host = dev_get_drvdata(gendev);
        int i;
 
-       for (i = 0; i < host->n_ports; i++) {
-               struct ata_port *ap = host->ports[i];
-
-               if (!ap)
-                       continue;
-
-               if ((host->flags & ATA_HOST_STARTED) && ap->ops->port_stop)
-                       ap->ops->port_stop(ap);
-       }
-
-       if ((host->flags & ATA_HOST_STARTED) && host->ops->host_stop)
-               host->ops->host_stop(host);
-
        for (i = 0; i < host->n_ports; i++) {
                struct ata_port *ap = host->ports[i];
 
@@ -6661,6 +6896,24 @@ struct ata_host *ata_host_alloc_pinfo(struct device *dev,
        return host;
 }
 
+static void ata_host_stop(struct device *gendev, void *res)
+{
+       struct ata_host *host = dev_get_drvdata(gendev);
+       int i;
+
+       WARN_ON(!(host->flags & ATA_HOST_STARTED));
+
+       for (i = 0; i < host->n_ports; i++) {
+               struct ata_port *ap = host->ports[i];
+
+               if (ap->ops->port_stop)
+                       ap->ops->port_stop(ap);
+       }
+
+       if (host->ops->host_stop)
+               host->ops->host_stop(host);
+}
+
 /**
  *     ata_host_start - start and freeze ports of an ATA host
  *     @host: ATA host to start ports for
@@ -6679,6 +6932,8 @@ struct ata_host *ata_host_alloc_pinfo(struct device *dev,
  */
 int ata_host_start(struct ata_host *host)
 {
+       int have_stop = 0;
+       void *start_dr = NULL;
        int i, rc;
 
        if (host->flags & ATA_HOST_STARTED)
@@ -6690,6 +6945,22 @@ int ata_host_start(struct ata_host *host)
                if (!host->ops && !ata_port_is_dummy(ap))
                        host->ops = ap->ops;
 
+               if (ap->ops->port_stop)
+                       have_stop = 1;
+       }
+
+       if (host->ops->host_stop)
+               have_stop = 1;
+
+       if (have_stop) {
+               start_dr = devres_alloc(ata_host_stop, 0, GFP_KERNEL);
+               if (!start_dr)
+                       return -ENOMEM;
+       }
+
+       for (i = 0; i < host->n_ports; i++) {
+               struct ata_port *ap = host->ports[i];
+
                if (ap->ops->port_start) {
                        rc = ap->ops->port_start(ap);
                        if (rc) {
@@ -6702,6 +6973,8 @@ int ata_host_start(struct ata_host *host)
                ata_eh_freeze_port(ap);
        }
 
+       if (start_dr)
+               devres_add(host->dev, start_dr);
        host->flags |= ATA_HOST_STARTED;
        return 0;
 
@@ -6712,6 +6985,7 @@ int ata_host_start(struct ata_host *host)
                if (ap->ops->port_stop)
                        ap->ops->port_stop(ap);
        }
+       devres_free(start_dr);
        return rc;
 }
 
@@ -6860,6 +7134,7 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
                struct ata_port *ap = host->ports[i];
 
                ata_scsi_scan_host(ap, 1);
+               ata_lpm_schedule(ap, ap->pm_policy);
        }
 
        return 0;
@@ -6878,6 +7153,10 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
  *     request IRQ and register it.  This helper takes necessasry
  *     arguments and performs the three steps in one go.
  *
+ *     An invalid IRQ skips the IRQ registration and expects the host to
+ *     have set polling mode on the port. In this case, @irq_handler
+ *     should be NULL.
+ *
  *     LOCKING:
  *     Inherited from calling layer (may sleep).
  *
@@ -6894,6 +7173,12 @@ int ata_host_activate(struct ata_host *host, int irq,
        if (rc)
                return rc;
 
+       /* Special case for polling mode */
+       if (!irq) {
+               WARN_ON(irq_handler);
+               return ata_host_register(host, sht);
+       }
+
        rc = devm_request_irq(host->dev, irq, irq_handler, irq_flags,
                              dev_driver_string(host->dev), host);
        if (rc)
@@ -7256,7 +7541,6 @@ const struct ata_port_info ata_dummy_port_info = {
  * likely to change as new drivers are added and updated.
  * Do not depend on ABI/API stability.
  */
-
 EXPORT_SYMBOL_GPL(sata_deb_timing_normal);
 EXPORT_SYMBOL_GPL(sata_deb_timing_hotplug);
 EXPORT_SYMBOL_GPL(sata_deb_timing_long);
@@ -7312,8 +7596,6 @@ EXPORT_SYMBOL_GPL(ata_dev_disable);
 EXPORT_SYMBOL_GPL(sata_set_spd);
 EXPORT_SYMBOL_GPL(sata_link_debounce);
 EXPORT_SYMBOL_GPL(sata_link_resume);
-EXPORT_SYMBOL_GPL(sata_phy_reset);
-EXPORT_SYMBOL_GPL(__sata_phy_reset);
 EXPORT_SYMBOL_GPL(ata_bus_reset);
 EXPORT_SYMBOL_GPL(ata_std_prereset);
 EXPORT_SYMBOL_GPL(ata_std_softreset);
@@ -7326,6 +7608,7 @@ EXPORT_SYMBOL_GPL(ata_port_disable);
 EXPORT_SYMBOL_GPL(ata_ratelimit);
 EXPORT_SYMBOL_GPL(ata_wait_register);
 EXPORT_SYMBOL_GPL(ata_busy_sleep);
+EXPORT_SYMBOL_GPL(ata_wait_after_reset);
 EXPORT_SYMBOL_GPL(ata_wait_ready);
 EXPORT_SYMBOL_GPL(ata_port_queue_task);
 EXPORT_SYMBOL_GPL(ata_scsi_ioctl);
@@ -7383,7 +7666,6 @@ EXPORT_SYMBOL_GPL(ata_port_desc);
 #ifdef CONFIG_PCI
 EXPORT_SYMBOL_GPL(ata_port_pbar_desc);
 #endif /* CONFIG_PCI */
-EXPORT_SYMBOL_GPL(ata_eng_timeout);
 EXPORT_SYMBOL_GPL(ata_port_schedule_eh);
 EXPORT_SYMBOL_GPL(ata_link_abort);
 EXPORT_SYMBOL_GPL(ata_port_abort);
index 8cb35bb8760575c2c5b1b20bcd6b80febbb74096..0dac69db1fdf151399f764826cc8cf7561398c37 100644 (file)
@@ -559,101 +559,6 @@ void ata_port_wait_eh(struct ata_port *ap)
        }
 }
 
-/**
- *     ata_qc_timeout - Handle timeout of queued command
- *     @qc: Command that timed out
- *
- *     Some part of the kernel (currently, only the SCSI layer)
- *     has noticed that the active command on port @ap has not
- *     completed after a specified length of time.  Handle this
- *     condition by disabling DMA (if necessary) and completing
- *     transactions, with error if necessary.
- *
- *     This also handles the case of the "lost interrupt", where
- *     for some reason (possibly hardware bug, possibly driver bug)
- *     an interrupt was not delivered to the driver, even though the
- *     transaction completed successfully.
- *
- *     TODO: kill this function once old EH is gone.
- *
- *     LOCKING:
- *     Inherited from SCSI layer (none, can sleep)
- */
-static void ata_qc_timeout(struct ata_queued_cmd *qc)
-{
-       struct ata_port *ap = qc->ap;
-       u8 host_stat = 0, drv_stat;
-       unsigned long flags;
-
-       DPRINTK("ENTER\n");
-
-       ap->hsm_task_state = HSM_ST_IDLE;
-
-       spin_lock_irqsave(ap->lock, flags);
-
-       switch (qc->tf.protocol) {
-
-       case ATA_PROT_DMA:
-       case ATA_PROT_ATAPI_DMA:
-               host_stat = ap->ops->bmdma_status(ap);
-
-               /* before we do anything else, clear DMA-Start bit */
-               ap->ops->bmdma_stop(qc);
-
-               /* fall through */
-
-       default:
-               ata_altstatus(ap);
-               drv_stat = ata_chk_status(ap);
-
-               /* ack bmdma irq events */
-               ap->ops->irq_clear(ap);
-
-               ata_dev_printk(qc->dev, KERN_ERR, "command 0x%x timeout, "
-                              "stat 0x%x host_stat 0x%x\n",
-                              qc->tf.command, drv_stat, host_stat);
-
-               /* complete taskfile transaction */
-               qc->err_mask |= AC_ERR_TIMEOUT;
-               break;
-       }
-
-       spin_unlock_irqrestore(ap->lock, flags);
-
-       ata_eh_qc_complete(qc);
-
-       DPRINTK("EXIT\n");
-}
-
-/**
- *     ata_eng_timeout - Handle timeout of queued command
- *     @ap: Port on which timed-out command is active
- *
- *     Some part of the kernel (currently, only the SCSI layer)
- *     has noticed that the active command on port @ap has not
- *     completed after a specified length of time.  Handle this
- *     condition by disabling DMA (if necessary) and completing
- *     transactions, with error if necessary.
- *
- *     This also handles the case of the "lost interrupt", where
- *     for some reason (possibly hardware bug, possibly driver bug)
- *     an interrupt was not delivered to the driver, even though the
- *     transaction completed successfully.
- *
- *     TODO: kill this function once old EH is gone.
- *
- *     LOCKING:
- *     Inherited from SCSI layer (none, can sleep)
- */
-void ata_eng_timeout(struct ata_port *ap)
-{
-       DPRINTK("ENTER\n");
-
-       ata_qc_timeout(ata_qc_from_tag(ap, ap->link.active_tag));
-
-       DPRINTK("EXIT\n");
-}
-
 static int ata_eh_nr_in_flight(struct ata_port *ap)
 {
        unsigned int tag;
@@ -1747,6 +1652,7 @@ static void ata_eh_link_autopsy(struct ata_link *link)
 {
        struct ata_port *ap = link->ap;
        struct ata_eh_context *ehc = &link->eh_context;
+       struct ata_device *dev;
        unsigned int all_err_mask = 0;
        int tag, is_io = 0;
        u32 serror;
@@ -1800,10 +1706,8 @@ static void ata_eh_link_autopsy(struct ata_link *link)
                        qc->err_mask &= ~AC_ERR_OTHER;
 
                /* SENSE_VALID trumps dev/unknown error and revalidation */
-               if (qc->flags & ATA_QCFLAG_SENSE_VALID) {
+               if (qc->flags & ATA_QCFLAG_SENSE_VALID)
                        qc->err_mask &= ~(AC_ERR_DEV | AC_ERR_OTHER);
-                       ehc->i.action &= ~ATA_EH_REVALIDATE;
-               }
 
                /* accumulate error info */
                ehc->i.dev = qc->dev;
@@ -1816,21 +1720,28 @@ static void ata_eh_link_autopsy(struct ata_link *link)
        if (ap->pflags & ATA_PFLAG_FROZEN ||
            all_err_mask & (AC_ERR_HSM | AC_ERR_TIMEOUT))
                ehc->i.action |= ATA_EH_SOFTRESET;
-       else if (all_err_mask)
+       else if ((is_io && all_err_mask) ||
+                (!is_io && (all_err_mask & ~AC_ERR_DEV)))
                ehc->i.action |= ATA_EH_REVALIDATE;
 
-       /* if we have offending qcs and the associated failed device */
+       /* If we have offending qcs and the associated failed device,
+        * perform per-dev EH action only on the offending device.
+        */
        if (ehc->i.dev) {
-               /* speed down */
-               ehc->i.action |= ata_eh_speed_down(ehc->i.dev, is_io,
-                                                  all_err_mask);
-
-               /* perform per-dev EH action only on the offending device */
                ehc->i.dev_action[ehc->i.dev->devno] |=
                        ehc->i.action & ATA_EH_PERDEV_MASK;
                ehc->i.action &= ~ATA_EH_PERDEV_MASK;
        }
 
+       /* consider speeding down */
+       dev = ehc->i.dev;
+       if (!dev && ata_link_max_devices(link) == 1 &&
+           ata_dev_enabled(link->device))
+               dev = link->device;
+
+       if (dev)
+               ehc->i.action |= ata_eh_speed_down(dev, is_io, all_err_mask);
+
        DPRINTK("EXIT\n");
 }
 
@@ -1879,7 +1790,9 @@ static void ata_eh_link_report(struct ata_link *link)
        for (tag = 0; tag < ATA_MAX_QUEUE; tag++) {
                struct ata_queued_cmd *qc = __ata_qc_from_tag(ap, tag);
 
-               if (!(qc->flags & ATA_QCFLAG_FAILED) || qc->dev->link != link)
+               if (!(qc->flags & ATA_QCFLAG_FAILED) || qc->dev->link != link ||
+                   ((qc->flags & ATA_QCFLAG_QUIET) &&
+                    qc->err_mask == AC_ERR_DEV))
                        continue;
                if (qc->flags & ATA_QCFLAG_SENSE_VALID && !qc->err_mask)
                        continue;
@@ -2064,16 +1977,19 @@ int ata_eh_reset(struct ata_link *link, int classify,
                 ata_prereset_fn_t prereset, ata_reset_fn_t softreset,
                 ata_reset_fn_t hardreset, ata_postreset_fn_t postreset)
 {
+       const int max_tries = ARRAY_SIZE(ata_eh_reset_timeouts);
        struct ata_port *ap = link->ap;
        struct ata_eh_context *ehc = &link->eh_context;
        unsigned int *classes = ehc->classes;
+       unsigned int lflags = link->flags;
        int verbose = !(ehc->i.flags & ATA_EHI_QUIET);
        int try = 0;
        struct ata_device *dev;
-       unsigned long deadline;
+       unsigned long deadline, now;
        unsigned int tmp_action;
        ata_reset_fn_t reset;
        unsigned long flags;
+       u32 sstatus;
        int rc;
 
        /* about to reset */
@@ -2083,10 +1999,29 @@ int ata_eh_reset(struct ata_link *link, int classify,
 
        ata_eh_about_to_do(link, NULL, ehc->i.action & ATA_EH_RESET_MASK);
 
+       ata_link_for_each_dev(dev, link) {
+               /* If we issue an SRST then an ATA drive (not ATAPI)
+                * may change configuration and be in PIO0 timing. If
+                * we do a hard reset (or are coming from power on)
+                * this is true for ATA or ATAPI. Until we've set a
+                * suitable controller mode we should not touch the
+                * bus as we may be talking too fast.
+                */
+               dev->pio_mode = XFER_PIO_0;
+
+               /* If the controller has a pio mode setup function
+                * then use it to set the chipset to rights. Don't
+                * touch the DMA setup as that will be dealt with when
+                * configuring devices.
+                */
+               if (ap->ops->set_piomode)
+                       ap->ops->set_piomode(ap, dev);
+       }
+
        /* Determine which reset to use and record in ehc->i.action.
         * prereset() may examine and modify it.
         */
-       if (softreset && (!hardreset || (!(link->flags & ATA_LFLAG_NO_SRST) &&
+       if (softreset && (!hardreset || (!(lflags & ATA_LFLAG_NO_SRST) &&
                                         !sata_set_spd_needed(link) &&
                                         !(ehc->i.action & ATA_EH_HARDRESET))))
                tmp_action = ATA_EH_SOFTRESET;
@@ -2161,80 +2096,64 @@ int ata_eh_reset(struct ata_link *link, int classify,
                                        "follow-up softreset required "
                                        "but no softreset avaliable\n");
                        rc = -EINVAL;
-                       goto out;
+                       goto fail;
                }
 
                ata_eh_about_to_do(link, NULL, ATA_EH_RESET_MASK);
                rc = ata_do_reset(link, reset, classes, deadline);
-
-               if (rc == 0 && classify && classes[0] == ATA_DEV_UNKNOWN &&
-                   !(link->flags & ATA_LFLAG_ASSUME_CLASS)) {
-                       ata_link_printk(link, KERN_ERR,
-                                       "classification failed\n");
-                       rc = -EINVAL;
-                       goto out;
-               }
        }
 
-       /* if we skipped follow-up srst, clear rc */
-       if (rc == -EAGAIN)
-               rc = 0;
-
-       if (rc && rc != -ERESTART && try < ARRAY_SIZE(ata_eh_reset_timeouts)) {
-               unsigned long now = jiffies;
-
-               if (time_before(now, deadline)) {
-                       unsigned long delta = deadline - jiffies;
+       /* -EAGAIN can happen if we skipped followup SRST */
+       if (rc && rc != -EAGAIN)
+               goto fail;
 
-                       ata_link_printk(link, KERN_WARNING, "reset failed "
-                               "(errno=%d), retrying in %u secs\n",
-                               rc, (jiffies_to_msecs(delta) + 999) / 1000);
-
-                       while (delta)
-                               delta = schedule_timeout_uninterruptible(delta);
+       /* was classification successful? */
+       if (classify && classes[0] == ATA_DEV_UNKNOWN &&
+           !(lflags & ATA_LFLAG_ASSUME_CLASS)) {
+               if (try < max_tries) {
+                       ata_link_printk(link, KERN_WARNING,
+                                       "classification failed\n");
+                       rc = -EINVAL;
+                       goto fail;
                }
 
-               if (rc == -EPIPE ||
-                   try == ARRAY_SIZE(ata_eh_reset_timeouts) - 1)
-                       sata_down_spd_limit(link);
-               if (hardreset)
-                       reset = hardreset;
-               goto retry;
+               ata_link_printk(link, KERN_WARNING,
+                               "classfication failed, assuming ATA\n");
+               lflags |= ATA_LFLAG_ASSUME_ATA;
        }
 
-       if (rc == 0) {
-               u32 sstatus;
+       ata_link_for_each_dev(dev, link) {
+               /* After the reset, the device state is PIO 0 and the
+                * controller state is undefined.  Reset also wakes up
+                * drives from sleeping mode.
+                */
+               dev->pio_mode = XFER_PIO_0;
+               dev->flags &= ~ATA_DFLAG_SLEEPING;
 
-               ata_link_for_each_dev(dev, link) {
-                       /* After the reset, the device state is PIO 0
-                        * and the controller state is undefined.
-                        * Record the mode.
-                        */
-                       dev->pio_mode = XFER_PIO_0;
+               if (ata_link_offline(link))
+                       continue;
 
-                       if (ata_link_offline(link))
-                               continue;
+               /* apply class override and convert UNKNOWN to NONE */
+               if (lflags & ATA_LFLAG_ASSUME_ATA)
+                       classes[dev->devno] = ATA_DEV_ATA;
+               else if (lflags & ATA_LFLAG_ASSUME_SEMB)
+                       classes[dev->devno] = ATA_DEV_SEMB_UNSUP; /* not yet */
+               else if (classes[dev->devno] == ATA_DEV_UNKNOWN)
+                       classes[dev->devno] = ATA_DEV_NONE;
+       }
 
-                       /* apply class override and convert UNKNOWN to NONE */
-                       if (link->flags & ATA_LFLAG_ASSUME_ATA)
-                               classes[dev->devno] = ATA_DEV_ATA;
-                       else if (link->flags & ATA_LFLAG_ASSUME_SEMB)
-                               classes[dev->devno] = ATA_DEV_SEMB_UNSUP; /* not yet */
-                       else if (classes[dev->devno] == ATA_DEV_UNKNOWN)
-                               classes[dev->devno] = ATA_DEV_NONE;
-               }
+       /* record current link speed */
+       if (sata_scr_read(link, SCR_STATUS, &sstatus) == 0)
+               link->sata_spd = (sstatus >> 4) & 0xf;
 
-               /* record current link speed */
-               if (sata_scr_read(link, SCR_STATUS, &sstatus) == 0)
-                       link->sata_spd = (sstatus >> 4) & 0xf;
+       if (postreset)
+               postreset(link, classes);
 
-               if (postreset)
-                       postreset(link, classes);
+       /* reset successful, schedule revalidation */
+       ata_eh_done(link, NULL, ehc->i.action & ATA_EH_RESET_MASK);
+       ehc->i.action |= ATA_EH_REVALIDATE;
 
-               /* reset successful, schedule revalidation */
-               ata_eh_done(link, NULL, ehc->i.action & ATA_EH_RESET_MASK);
-               ehc->i.action |= ATA_EH_REVALIDATE;
-       }
+       rc = 0;
  out:
        /* clear hotplug flag */
        ehc->i.flags &= ~ATA_EHI_HOTPLUGGED;
@@ -2244,6 +2163,28 @@ int ata_eh_reset(struct ata_link *link, int classify,
        spin_unlock_irqrestore(ap->lock, flags);
 
        return rc;
+
+ fail:
+       if (rc == -ERESTART || try >= max_tries)
+               goto out;
+
+       now = jiffies;
+       if (time_before(now, deadline)) {
+               unsigned long delta = deadline - now;
+
+               ata_link_printk(link, KERN_WARNING, "reset failed "
+                               "(errno=%d), retrying in %u secs\n",
+                               rc, (jiffies_to_msecs(delta) + 999) / 1000);
+
+               while (delta)
+                       delta = schedule_timeout_uninterruptible(delta);
+       }
+
+       if (rc == -EPIPE || try == max_tries - 1)
+               sata_down_spd_limit(link);
+       if (hardreset)
+               reset = hardreset;
+       goto retry;
 }
 
 static int ata_eh_revalidate_and_attach(struct ata_link *link,
@@ -2416,7 +2357,7 @@ static int ata_eh_handle_dev_fail(struct ata_device *dev, int err)
                /* give it just one more chance */
                ehc->tries[dev->devno] = min(ehc->tries[dev->devno], 1);
        case -EIO:
-               if (ehc->tries[dev->devno] == 1) {
+               if (ehc->tries[dev->devno] == 1 && dev->pio_mode > XFER_PIO_0) {
                        /* This is the last chance, better to slow
                         * down than lose it.
                         */
@@ -2607,6 +2548,10 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
                        ehc->i.flags &= ~ATA_EHI_SETMODE;
                }
 
+               if (ehc->i.action & ATA_EHI_LPM)
+                       ata_link_for_each_dev(dev, link)
+                               ata_dev_enable_pm(dev, ap->pm_policy);
+
                /* this link is okay now */
                ehc->i.flags = 0;
                continue;
@@ -2672,8 +2617,15 @@ void ata_eh_finish(struct ata_port *ap)
                        /* FIXME: Once EH migration is complete,
                         * generate sense data in this function,
                         * considering both err_mask and tf.
+                        *
+                        * There's no point in retrying invalid
+                        * (detected by libata) and non-IO device
+                        * errors (rejected by device).  Finish them
+                        * immediately.
                         */
-                       if (qc->err_mask & AC_ERR_INVALID)
+                       if ((qc->err_mask & AC_ERR_INVALID) ||
+                           (!(qc->flags & ATA_QCFLAG_IO) &&
+                            qc->err_mask == AC_ERR_DEV))
                                ata_eh_qc_complete(qc);
                        else
                                ata_eh_qc_retry(qc);
index f5d5420a1ba2f79e4c6db55f83917305895e6cfa..a883bb03d4c7762dc21605974740c3ff4014ae49 100644 (file)
@@ -110,6 +110,74 @@ static struct scsi_transport_template ata_scsi_transport_template = {
 };
 
 
+static const struct {
+       enum link_pm    value;
+       const char      *name;
+} link_pm_policy[] = {
+       { NOT_AVAILABLE, "max_performance" },
+       { MIN_POWER, "min_power" },
+       { MAX_PERFORMANCE, "max_performance" },
+       { MEDIUM_POWER, "medium_power" },
+};
+
+static const char *ata_scsi_lpm_get(enum link_pm policy)
+{
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(link_pm_policy); i++)
+               if (link_pm_policy[i].value == policy)
+                       return link_pm_policy[i].name;
+
+       return NULL;
+}
+
+static ssize_t ata_scsi_lpm_put(struct class_device *class_dev,
+       const char *buf, size_t count)
+{
+       struct Scsi_Host *shost = class_to_shost(class_dev);
+       struct ata_port *ap = ata_shost_to_port(shost);
+       enum link_pm policy = 0;
+       int i;
+
+       /*
+        * we are skipping array location 0 on purpose - this
+        * is because a value of NOT_AVAILABLE is displayed
+        * to the user as max_performance, but when the user
+        * writes "max_performance", they actually want the
+        * value to match MAX_PERFORMANCE.
+        */
+       for (i = 1; i < ARRAY_SIZE(link_pm_policy); i++) {
+               const int len = strlen(link_pm_policy[i].name);
+               if (strncmp(link_pm_policy[i].name, buf, len) == 0 &&
+                  buf[len] == '\n') {
+                       policy = link_pm_policy[i].value;
+                       break;
+               }
+       }
+       if (!policy)
+               return -EINVAL;
+
+       ata_lpm_schedule(ap, policy);
+       return count;
+}
+
+static ssize_t
+ata_scsi_lpm_show(struct class_device *class_dev, char *buf)
+{
+       struct Scsi_Host *shost = class_to_shost(class_dev);
+       struct ata_port *ap = ata_shost_to_port(shost);
+       const char *policy =
+               ata_scsi_lpm_get(ap->pm_policy);
+
+       if (!policy)
+               return -EINVAL;
+
+       return snprintf(buf, 23, "%s\n", policy);
+}
+CLASS_DEVICE_ATTR(link_power_management_policy, S_IRUGO | S_IWUSR,
+               ata_scsi_lpm_show, ata_scsi_lpm_put);
+EXPORT_SYMBOL_GPL(class_device_attr_link_power_management_policy);
+
 static void ata_scsi_invalid_field(struct scsi_cmnd *cmd,
                                   void (*done)(struct scsi_cmnd *))
 {
@@ -773,6 +841,9 @@ static void ata_scsi_dev_config(struct scsi_device *sdev,
                blk_queue_max_hw_segments(q, q->max_hw_segments - 1);
        }
 
+       if (dev->flags & ATA_DFLAG_AN)
+               set_bit(SDEV_EVT_MEDIA_CHANGE, sdev->supported_events);
+
        if (dev->flags & ATA_DFLAG_NCQ) {
                int depth;
 
@@ -1040,6 +1111,9 @@ static unsigned int ata_scsi_flush_xlat(struct ata_queued_cmd *qc)
        else
                tf->command = ATA_CMD_FLUSH;
 
+       /* flush is critical for IO integrity, consider it an IO command */
+       qc->flags |= ATA_QCFLAG_IO;
+
        return 0;
 }
 
@@ -1361,33 +1435,10 @@ nothing_to_do:
 static void ata_scsi_qc_complete(struct ata_queued_cmd *qc)
 {
        struct ata_port *ap = qc->ap;
-       struct ata_eh_info *ehi = &qc->dev->link->eh_info;
        struct scsi_cmnd *cmd = qc->scsicmd;
        u8 *cdb = cmd->cmnd;
        int need_sense = (qc->err_mask != 0);
 
-       /* We snoop the SET_FEATURES - Write Cache ON/OFF command, and
-        * schedule EH_REVALIDATE operation to update the IDENTIFY DEVICE
-        * cache
-        */
-       if (ap->ops->error_handler && !need_sense) {
-               switch (qc->tf.command) {
-               case ATA_CMD_SET_FEATURES:
-                       if ((qc->tf.feature == SETFEATURES_WC_ON) ||
-                           (qc->tf.feature == SETFEATURES_WC_OFF)) {
-                               ehi->action |= ATA_EH_REVALIDATE;
-                               ata_port_schedule_eh(ap);
-                       }
-                       break;
-
-               case ATA_CMD_INIT_DEV_PARAMS: /* CHS translation changed */
-               case ATA_CMD_SET_MULTI: /* multi_count changed */
-                       ehi->action |= ATA_EH_REVALIDATE;
-                       ata_port_schedule_eh(ap);
-                       break;
-               }
-       }
-
        /* For ATA pass thru (SAT) commands, generate a sense block if
         * user mandated it or if there's an error.  Note that if we
         * generate because the user forced us to, a check condition
@@ -2434,11 +2485,40 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc)
        if (!using_pio && ata_check_atapi_dma(qc))
                using_pio = 1;
 
-       /* Some controller variants snoop this value for Packet transfers
-          to do state machine and FIFO management. Thus we want to set it
-          properly, and for DMA where it is effectively meaningless */
+       /* Some controller variants snoop this value for Packet
+        * transfers to do state machine and FIFO management.  Thus we
+        * want to set it properly, and for DMA where it is
+        * effectively meaningless.
+        */
        nbytes = min(qc->nbytes, (unsigned int)63 * 1024);
 
+       /* Most ATAPI devices which honor transfer chunk size don't
+        * behave according to the spec when odd chunk size which
+        * matches the transfer length is specified.  If the number of
+        * bytes to transfer is 2n+1.  According to the spec, what
+        * should happen is to indicate that 2n+1 is going to be
+        * transferred and transfer 2n+2 bytes where the last byte is
+        * padding.
+        *
+        * In practice, this doesn't happen.  ATAPI devices first
+        * indicate and transfer 2n bytes and then indicate and
+        * transfer 2 bytes where the last byte is padding.
+        *
+        * This inconsistency confuses several controllers which
+        * perform PIO using DMA such as Intel AHCIs and sil3124/32.
+        * These controllers use actual number of transferred bytes to
+        * update DMA poitner and transfer of 4n+2 bytes make those
+        * controller push DMA pointer by 4n+4 bytes because SATA data
+        * FISes are aligned to 4 bytes.  This causes data corruption
+        * and buffer overrun.
+        *
+        * Always setting nbytes to even number solves this problem
+        * because then ATAPI devices don't have to split data at 2n
+        * boundaries.
+        */
+       if (nbytes & 0x1)
+               nbytes++;
+
        qc->tf.lbam = (nbytes & 0xFF);
        qc->tf.lbah = (nbytes >> 8);
 
@@ -2719,8 +2799,8 @@ static unsigned int ata_scsi_pass_thru(struct ata_queued_cmd *qc)
         */
        qc->nbytes = scsi_bufflen(scmd);
 
-       /* request result TF */
-       qc->flags |= ATA_QCFLAG_RESULT_TF;
+       /* request result TF and be quiet about device error */
+       qc->flags |= ATA_QCFLAG_RESULT_TF | ATA_QCFLAG_QUIET;
 
        return 0;
 
@@ -2818,7 +2898,8 @@ static inline int __ata_scsi_queuecmd(struct scsi_cmnd *scmd,
                xlat_func = NULL;
                if (likely((scsi_op != ATA_16) || !atapi_passthru16)) {
                        /* relay SCSI command to ATAPI device */
-                       if (unlikely(scmd->cmd_len > dev->cdb_len))
+                       int len = COMMAND_SIZE(scsi_op);
+                       if (unlikely(len > scmd->cmd_len || len > dev->cdb_len))
                                goto bad_cdb_len;
 
                        xlat_func = atapi_xlat;
@@ -3248,10 +3329,9 @@ static void ata_scsi_handle_link_detach(struct ata_link *link)
  */
 void ata_scsi_media_change_notify(struct ata_device *dev)
 {
-#ifdef OTHER_AN_PATCHES_HAVE_BEEN_APPLIED
        if (dev->sdev)
-               scsi_device_event_notify(dev->sdev, SDEV_MEDIA_CHANGE);
-#endif
+               sdev_evt_send_simple(dev->sdev, SDEV_EVT_MEDIA_CHANGE,
+                                    GFP_ATOMIC);
 }
 
 /**
index 90df58a3edc95ff4cdab4bc43fc2046c20b430c6..0e6cf3a484dc6dce78834f51b69070b0f8ecc030 100644 (file)
@@ -101,6 +101,8 @@ extern int sata_link_init_spd(struct ata_link *link);
 extern int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg);
 extern int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg);
 extern struct ata_port *ata_port_alloc(struct ata_host *host);
+extern void ata_dev_enable_pm(struct ata_device *dev, enum link_pm policy);
+extern void ata_lpm_schedule(struct ata_port *ap, enum link_pm);
 
 /* libata-acpi.c */
 #ifdef CONFIG_ATA_ACPI
index 0f6f7bcc3defa8e39bdb235bcdd7b18e086b4614..e4542ab9c7f840fcf59102c8e92bb6422f79ff48 100644 (file)
@@ -181,7 +181,7 @@ static void pacpi_set_piomode(struct ata_port *ap, struct ata_device *adev)
        int unit = adev->devno;
        struct pata_acpi *acpi = ap->private_data;
 
-       if(!(acpi->gtm.flags & 0x10))
+       if (!(acpi->gtm.flags & 0x10))
                unit = 0;
 
        /* Now stuff the nS values into the structure */
@@ -202,7 +202,7 @@ static void pacpi_set_dmamode(struct ata_port *ap, struct ata_device *adev)
        int unit = adev->devno;
        struct pata_acpi *acpi = ap->private_data;
 
-       if(!(acpi->gtm.flags & 0x10))
+       if (!(acpi->gtm.flags & 0x10))
                unit = 0;
 
        /* Now stuff the nS values into the structure */
index 364534e7aff4522105d1c043502e15da2ddfa1d3..8caf9afc8b905061097d10fedbd4627cabc88084 100644 (file)
@@ -63,6 +63,9 @@ static int ali_cable_override(struct pci_dev *pdev)
        /* Fujitsu P2000 */
        if (pdev->subsystem_vendor == 0x10CF && pdev->subsystem_device == 0x10AF)
                return 1;
+       /* Mitac 8317 (Winbook-A) and relatives */
+       if (pdev->subsystem_vendor == 0x1071  && pdev->subsystem_device == 0x8317)
+               return 1;
        /* Systems by DMI */
        if (dmi_check_system(cable_dmi_table))
                return 1;
@@ -282,6 +285,21 @@ static void ali_lock_sectors(struct ata_device *adev)
        adev->max_sectors = 255;
 }
 
+/**
+ *     ali_check_atapi_dma     -       DMA check for most ALi controllers
+ *     @adev: Device
+ *
+ *     Called to decide whether commands should be sent by DMA or PIO
+ */
+
+static int ali_check_atapi_dma(struct ata_queued_cmd *qc)
+{
+       /* If its not a media command, its not worth it */
+       if (qc->nbytes < 2048)
+               return -EOPNOTSUPP;
+       return 0;
+}
+
 static struct scsi_host_template ali_sht = {
        .module                 = THIS_MODULE,
        .name                   = DRV_NAME,
@@ -378,6 +396,7 @@ static struct ata_port_operations ali_c2_port_ops = {
        .mode_filter    = ata_pci_default_filter,
        .tf_load        = ata_tf_load,
        .tf_read        = ata_tf_read,
+       .check_atapi_dma = ali_check_atapi_dma,
        .check_status   = ata_check_status,
        .exec_command   = ata_exec_command,
        .dev_select     = ata_std_dev_select,
@@ -415,6 +434,7 @@ static struct ata_port_operations ali_c5_port_ops = {
        .mode_filter    = ata_pci_default_filter,
        .tf_load        = ata_tf_load,
        .tf_read        = ata_tf_read,
+       .check_atapi_dma = ali_check_atapi_dma,
        .check_status   = ata_check_status,
        .exec_command   = ata_exec_command,
        .dev_select     = ata_std_dev_select,
index b5e38426b815ec4ed64854d467ee0548f1a90c8b..81db405a5445bfe1a685cb374d406c4ac97de672 100644 (file)
@@ -1145,13 +1145,13 @@ static unsigned char bfin_bmdma_status(struct ata_port *ap)
        unsigned short int_status = ATAPI_GET_INT_STATUS(base);
 
        if (ATAPI_GET_STATUS(base) & (MULTI_XFER_ON|ULTRA_XFER_ON)) {
-               host_stat = ATA_DMA_ACTIVE;
+               host_stat |= ATA_DMA_ACTIVE;
        }
        if (int_status & (MULTI_DONE_INT|UDMAIN_DONE_INT|UDMAOUT_DONE_INT)) {
-               host_stat = ATA_DMA_INTR;
+               host_stat |= ATA_DMA_INTR;
        }
        if (int_status & (MULTI_TERM_INT|UDMAIN_TERM_INT|UDMAOUT_TERM_INT)) {
-               host_stat = ATA_DMA_ERR;
+               host_stat |= ATA_DMA_ERR;
        }
 
        return host_stat;
index e61cb1fd57b209d518665a6798e0f5d03ed7e1b9..46dc70e0dee7ee7d8add0e4541d28d64cc17f5ff 100644 (file)
@@ -295,7 +295,7 @@ static unsigned long hpt370_filter(struct ata_device *adev, unsigned long mask)
 
 static unsigned long hpt370a_filter(struct ata_device *adev, unsigned long mask)
 {
-       if (adev->class != ATA_DEV_ATA) {
+       if (adev->class == ATA_DEV_ATA) {
                if (hpt_dma_blacklisted(adev, "UDMA100", bad_ata100_5))
                        mask &= ~ (0x1F << ATA_SHIFT_UDMA);
        }
@@ -329,7 +329,7 @@ static int hpt37x_pre_reset(struct ata_link *link, unsigned long deadline)
        /* Restore state */
        pci_write_config_byte(pdev, 0x5B, scr2);
 
-       if (ata66 & (1 << ap->port_no))
+       if (ata66 & (2 >> ap->port_no))
                ap->cbl = ATA_CBL_PATA40;
        else
                ap->cbl = ATA_CBL_PATA80;
@@ -359,28 +359,25 @@ static int hpt374_pre_reset(struct ata_link *link, unsigned long deadline)
                { 0x50, 1, 0x04, 0x04 },
                { 0x54, 1, 0x04, 0x04 }
        };
-       u16 mcr3, mcr6;
+       u16 mcr3;
        u8 ata66;
        struct ata_port *ap = link->ap;
        struct pci_dev *pdev = to_pci_dev(ap->host->dev);
+       unsigned int mcrbase = 0x50 + 4 * ap->port_no;
 
        if (!pci_test_config_bits(pdev, &hpt37x_enable_bits[ap->port_no]))
                return -ENOENT;
 
        /* Do the extra channel work */
-       pci_read_config_word(pdev, 0x52, &mcr3);
-       pci_read_config_word(pdev, 0x56, &mcr6);
+       pci_read_config_word(pdev, mcrbase + 2, &mcr3);
        /* Set bit 15 of 0x52 to enable TCBLID as input
-          Set bit 15 of 0x56 to enable FCBLID as input
         */
-       pci_write_config_word(pdev, 0x52, mcr3 | 0x8000);
-       pci_write_config_word(pdev, 0x56, mcr6 | 0x8000);
+       pci_write_config_word(pdev, mcrbase + 2, mcr3 | 0x8000);
        pci_read_config_byte(pdev, 0x5A, &ata66);
        /* Reset TCBLID/FCBLID to output */
        pci_write_config_word(pdev, 0x52, mcr3);
-       pci_write_config_word(pdev, 0x56, mcr6);
 
-       if (ata66 & (1 << ap->port_no))
+       if (ata66 & (2 >> ap->port_no))
                ap->cbl = ATA_CBL_PATA40;
        else
                ap->cbl = ATA_CBL_PATA80;
@@ -844,6 +841,25 @@ static int hpt37x_calibrate_dpll(struct pci_dev *dev)
        /* Never went stable */
        return 0;
 }
+
+static u32 hpt374_read_freq(struct pci_dev *pdev)
+{
+       u32 freq;
+       unsigned long io_base = pci_resource_start(pdev, 4);
+       if (PCI_FUNC(pdev->devfn) & 1) {
+               struct pci_dev *pdev_0 = pci_get_slot(pdev->bus, pdev->devfn - 1);
+               /* Someone hot plugged the controller on us ? */
+               if (pdev_0 == NULL)
+                       return 0;
+               io_base = pci_resource_start(pdev_0, 4);
+               freq = inl(io_base + 0x90);
+               pci_dev_put(pdev_0);
+       }
+       else
+               freq = inl(io_base + 0x90);
+       return freq;
+}
+
 /**
  *     hpt37x_init_one         -       Initialise an HPT37X/302
  *     @dev: PCI device
@@ -902,7 +918,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
                .flags = ATA_FLAG_SLAVE_POSS,
                .pio_mask = 0x1f,
                .mwdma_mask = 0x07,
-               .udma_mask = 0x0f,
+               .udma_mask = ATA_UDMA5,
                .port_ops = &hpt370_port_ops
        };
        /* HPT370A - UDMA100 */
@@ -911,7 +927,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
                .flags = ATA_FLAG_SLAVE_POSS,
                .pio_mask = 0x1f,
                .mwdma_mask = 0x07,
-               .udma_mask = 0x0f,
+               .udma_mask = ATA_UDMA5,
                .port_ops = &hpt370a_port_ops
        };
        /* HPT371, 372 and friends - UDMA133 */
@@ -1047,9 +1063,16 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
                outb(0x0e, iobase + 0x9c);
 
        /* Some devices do not let this value be accessed via PCI space
-          according to the old driver */
+          according to the old driver. In addition we must use the value
+          from FN 0 on the HPT374 */
+
+       if (chip_table == &hpt374) {
+               freq = hpt374_read_freq(dev);
+               if (freq == 0)
+                       return -ENODEV;
+       } else
+               freq = inl(iobase + 0x90);
 
-       freq = inl(iobase + 0x90);
        if ((freq >> 12) != 0xABCDE) {
                int i;
                u8 sr;
index 88ab0e1d353fb506d1ac1de6b3b9eac1d81d6bb9..4320e79863219d6858e74d376c991be6588a6cf7 100644 (file)
@@ -75,13 +75,16 @@ static int isapnp_init_one(struct pnp_dev *idev, const struct pnp_device_id *dev
        struct ata_host *host;
        struct ata_port *ap;
        void __iomem *cmd_addr, *ctl_addr;
+       int irq = 0;
+       irq_handler_t handler = NULL;
 
        if (pnp_port_valid(idev, 0) == 0)
                return -ENODEV;
 
-       /* FIXME: Should selected polled PIO here not fail */
-       if (pnp_irq_valid(idev, 0) == 0)
-               return -ENODEV;
+       if (pnp_irq_valid(idev, 0)) {
+               irq = pnp_irq(idev, 0);
+               handler = ata_interrupt;
+       }
 
        /* allocate host */
        host = ata_host_alloc(&idev->dev, 1);
@@ -115,7 +118,7 @@ static int isapnp_init_one(struct pnp_dev *idev, const struct pnp_device_id *dev
                      (unsigned long long)pnp_port_start(idev, 1));
 
        /* activate */
-       return ata_host_activate(host, pnp_irq(idev, 0), ata_interrupt, 0,
+       return ata_host_activate(host, irq, handler, 0,
                                 &isapnp_sht);
 }
 
index 225a7223a726066bdc14181d225dfc16a541b298..5b8174d940670493e5439ab2338276c5b1b4de31 100644 (file)
@@ -80,11 +80,10 @@ static int jmicron_pre_reset(struct ata_link *link, unsigned long deadline)
         *      actually do our cable checking etc. Thankfully we don't need
         *      to do the plumbing for other cases.
         */
-       switch (port_map[port])
-       {
+       switch (port_map[port]) {
        case PORT_PATA0:
-               if (control & (1 << 5))
-                       return 0;
+               if ((control & (1 << 5)) == 0)
+                       return -ENOENT;
                if (control & (1 << 3)) /* 40/80 pin primary */
                        ap->cbl = ATA_CBL_PATA40;
                else
@@ -93,7 +92,7 @@ static int jmicron_pre_reset(struct ata_link *link, unsigned long deadline)
        case PORT_PATA1:
                /* Bit 21 is set if the port is enabled */
                if ((control5 & (1 << 21)) == 0)
-                       return 0;
+                       return -ENOENT;
                if (control5 & (1 << 19))       /* 40/80 pin secondary */
                        ap->cbl = ATA_CBL_PATA40;
                else
index b9a17eb100d0fbd297fee0290c21156602f6dc1c..d0e2e50823b1144ed1735ae8524b7dbb3536c186 100644 (file)
@@ -215,6 +215,8 @@ static int ns87415_check_atapi_dma(struct ata_queued_cmd *qc)
 
 #include <asm/superio.h>
 
+#define SUPERIO_IDE_MAX_RETRIES 25
+
 /**
  *     ns87560_read_buggy      -       workaround buggy Super I/O chip
  *     @port: Port to read
index 6b07b5b48532ff015a9f6ef08dd7619e1c7561d6..f9b485a487ae75c7da9ed0097e241a898154df81 100644 (file)
@@ -449,7 +449,7 @@ static int optiplus_with_udma(struct pci_dev *pdev)
 
        /* Find function 1 */
        dev1 = pci_get_device(0x1045, 0xC701, NULL);
-       if(dev1 == NULL)
+       if (dev1 == NULL)
                return 0;
 
        /* Rev must be >= 0x10 */
index 5db2013230b31c048798f242a4c91a66f36d5f50..fd36099428a45cbf85b84a46d457bcef57a56209 100644 (file)
@@ -74,8 +74,7 @@ static int pcmcia_set_mode(struct ata_link *link, struct ata_device **r_failed_d
                return ata_do_set_mode(link, r_failed_dev);
 
        if (memcmp(master->id + ATA_ID_FW_REV,  slave->id + ATA_ID_FW_REV,
-                          ATA_ID_FW_REV_LEN + ATA_ID_PROD_LEN) == 0)
-       {
+                          ATA_ID_FW_REV_LEN + ATA_ID_PROD_LEN) == 0) {
                /* Suspicious match, but could be two cards from
                   the same vendor - check serial */
                if (memcmp(master->id + ATA_ID_SERNO, slave->id + ATA_ID_SERNO,
@@ -248,7 +247,8 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
                                        goto next_entry;
                                io_base = pdev->io.BasePort1;
                                ctl_base = pdev->io.BasePort1 + 0x0e;
-                       } else goto next_entry;
+                       } else
+                               goto next_entry;
                        /* If we've got this far, we're done */
                        break;
                }
@@ -285,8 +285,8 @@ next_entry:
                printk(KERN_WARNING DRV_NAME ": second channel not yet supported.\n");
 
        /*
-        *      Having done the PCMCIA plumbing the ATA side is relatively
-        *      sane.
+        *      Having done the PCMCIA plumbing the ATA side is relatively
+        *      sane.
         */
        ret = -ENOMEM;
        host = ata_host_alloc(&pdev->dev, 1);
@@ -363,7 +363,7 @@ static struct pcmcia_device_id pcmcia_devices[] = {
        PCMCIA_DEVICE_MANF_CARD(0x0098, 0x0000),        /* Toshiba */
        PCMCIA_DEVICE_MANF_CARD(0x00a4, 0x002d),
        PCMCIA_DEVICE_MANF_CARD(0x00ce, 0x0000),        /* Samsung */
-       PCMCIA_DEVICE_MANF_CARD(0x0319, 0x0000),        /* Hitachi */
+       PCMCIA_DEVICE_MANF_CARD(0x0319, 0x0000),        /* Hitachi */
        PCMCIA_DEVICE_MANF_CARD(0x2080, 0x0001),
        PCMCIA_DEVICE_MANF_CARD(0x4e01, 0x0100),        /* Viking CFA */
        PCMCIA_DEVICE_MANF_CARD(0x4e01, 0x0200),        /* Lexar, Viking CFA */
index 3d3f1558cdee7e9be3c9e92e3059c711b4ad3478..2622577521a13386f655aa70d922f2a94596efd2 100644 (file)
@@ -348,7 +348,7 @@ static unsigned long pdc2027x_mode_filter(struct ata_device *adev, unsigned long
        ata_id_c_string(pair->id, model_num, ATA_ID_PROD,
                          ATA_ID_PROD_LEN + 1);
        /* If the master is a maxtor in UDMA6 then the slave should not use UDMA 6 */
-       if(strstr(model_num, "Maxtor") == 0 && pair->dma_mode == XFER_UDMA_6)
+       if (strstr(model_num, "Maxtor") == 0 && pair->dma_mode == XFER_UDMA_6)
                mask &= ~ (1 << (6 + ATA_SHIFT_UDMA));
 
        return ata_pci_default_filter(adev, mask);
index 65d951618c605d1c9e908a508c528014ac4b2b6c..bc7c2d5d8d5ecee9fbc5fa93e98b19d7fb783e26 100644 (file)
@@ -351,9 +351,9 @@ static int pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id
                struct pci_dev *bridge = dev->bus->self;
                /* Don't grab anything behind a Promise I2O RAID */
                if (bridge && bridge->vendor == PCI_VENDOR_ID_INTEL) {
-                       ifbridge->device == PCI_DEVICE_ID_INTEL_I960)
+                       if (bridge->device == PCI_DEVICE_ID_INTEL_I960)
                                return -ENODEV;
-                       ifbridge->device == PCI_DEVICE_ID_INTEL_I960RM)
+                       if (bridge->device == PCI_DEVICE_ID_INTEL_I960RM)
                                return -ENODEV;
                }
        }
index fc72a965643d8951f45e5957d98fc5924fefae24..ac03a90a616829cc1b04d58f8b624caddff070f4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Generic platform device PATA driver
  *
- * Copyright (C) 2006  Paul Mundt
+ * Copyright (C) 2006 - 2007  Paul Mundt
  *
  * Based on pata_pcmcia:
  *
@@ -22,7 +22,7 @@
 #include <linux/pata_platform.h>
 
 #define DRV_NAME "pata_platform"
-#define DRV_VERSION "1.1"
+#define DRV_VERSION "1.2"
 
 static int pio_mask = 1;
 
@@ -120,15 +120,20 @@ static void pata_platform_setup_port(struct ata_ioports *ioaddr,
  *     Register a platform bus IDE interface. Such interfaces are PIO and we
  *     assume do not support IRQ sharing.
  *
- *     Platform devices are expected to contain 3 resources per port:
+ *     Platform devices are expected to contain at least 2 resources per port:
  *
  *             - I/O Base (IORESOURCE_IO or IORESOURCE_MEM)
  *             - CTL Base (IORESOURCE_IO or IORESOURCE_MEM)
+ *
+ *     and optionally:
+ *
  *             - IRQ      (IORESOURCE_IRQ)
  *
  *     If the base resources are both mem types, the ioremap() is handled
  *     here. For IORESOURCE_IO, it's assumed that there's no remapping
  *     necessary.
+ *
+ *     If no IRQ resource is present, PIO polling mode is used instead.
  */
 static int __devinit pata_platform_probe(struct platform_device *pdev)
 {
@@ -137,11 +142,12 @@ static int __devinit pata_platform_probe(struct platform_device *pdev)
        struct ata_port *ap;
        struct pata_platform_info *pp_info;
        unsigned int mmio;
+       int irq;
 
        /*
         * Simple resource validation ..
         */
-       if (unlikely(pdev->num_resources != 3)) {
+       if ((pdev->num_resources != 3) && (pdev->num_resources != 2)) {
                dev_err(&pdev->dev, "invalid number of resources\n");
                return -EINVAL;
        }
@@ -172,6 +178,13 @@ static int __devinit pata_platform_probe(struct platform_device *pdev)
        mmio = (( io_res->flags == IORESOURCE_MEM) &&
                (ctl_res->flags == IORESOURCE_MEM));
 
+       /*
+        * And the IRQ
+        */
+       irq = platform_get_irq(pdev, 0);
+       if (irq < 0)
+               irq = 0;        /* no irq */
+
        /*
         * Now that that's out of the way, wire up the port..
         */
@@ -184,6 +197,14 @@ static int __devinit pata_platform_probe(struct platform_device *pdev)
        ap->pio_mask = pio_mask;
        ap->flags |= ATA_FLAG_SLAVE_POSS;
 
+       /*
+        * Use polling mode if there's no IRQ
+        */
+       if (!irq) {
+               ap->flags |= ATA_FLAG_PIO_POLLING;
+               ata_port_desc(ap, "no IRQ, using PIO polling");
+       }
+
        /*
         * Handle the MMIO case
         */
@@ -213,9 +234,9 @@ static int __devinit pata_platform_probe(struct platform_device *pdev)
                      (unsigned long long)ctl_res->start);
 
        /* activate */
-       return ata_host_activate(host, platform_get_irq(pdev, 0),
-                                ata_interrupt, pp_info ? pp_info->irq_flags
-                                : 0, &pata_platform_sht);
+       return ata_host_activate(host, irq, irq ? ata_interrupt : NULL,
+                                pp_info ? pp_info->irq_flags : 0,
+                                &pata_platform_sht);
 }
 
 /**
index 55576138faea7a421bb83fec45b3eacfb21e9196..ea2ef9fc15be6e2aa131497cc387b613c9466066 100644 (file)
@@ -570,17 +570,8 @@ static unsigned int scc_bus_softreset(struct ata_port *ap, unsigned int devmask,
        udelay(20);
        out_be32(ioaddr->ctl_addr, ap->ctl);
 
-       /* spec mandates ">= 2ms" before checking status.
-        * We wait 150ms, because that was the magic delay used for
-        * ATAPI devices in Hale Landis's ATADRVR, for the period of time
-        * between when the ATA command register is written, and then
-        * status is checked.  Because waiting for "a while" before
-        * checking status is fine, post SRST, we perform this magic
-        * delay here as well.
-        *
-        * Old drivers/ide uses the 2mS rule and then waits for ready
-        */
-       msleep(150);
+       /* wait a while before checking status */
+       ata_wait_after_reset(ap, deadline);
 
        /* Before we perform post reset processing we want to see if
         * the bus shows 0xFF because the odd clown forgets the D7
index df68806df4be195e07295c58e113f60defdcdc7d..8bed888737206cae257c43ae9f0a600568bf91cc 100644 (file)
@@ -274,28 +274,27 @@ static void serverworks_set_dmamode(struct ata_port *ap, struct ata_device *adev
 {
        static const u8 dma_mode[] = { 0x77, 0x21, 0x20 };
        int offset = 1 + 2 * ap->port_no - adev->devno;
-       int devbits = (2 * ap->port_no + adev->devno);
+       int devbits = 2 * ap->port_no + adev->devno;
        u8 ultra;
        u8 ultra_cfg;
        struct pci_dev *pdev = to_pci_dev(ap->host->dev);
 
        pci_read_config_byte(pdev, 0x54, &ultra_cfg);
+       pci_read_config_byte(pdev, 0x56 + ap->port_no, &ultra);
+       ultra &= ~(0x0F << (adev->devno * 4));
 
        if (adev->dma_mode >= XFER_UDMA_0) {
                pci_write_config_byte(pdev, 0x44 + offset,  0x20);
 
-               pci_read_config_byte(pdev, 0x56 + ap->port_no, &ultra);
-               ultra &= ~(0x0F << (ap->port_no * 4));
                ultra |= (adev->dma_mode - XFER_UDMA_0)
-                                       << (ap->port_no * 4);
-               pci_write_config_byte(pdev, 0x56 + ap->port_no, ultra);
-
+                                       << (adev->devno * 4);
                ultra_cfg |=  (1 << devbits);
        } else {
                pci_write_config_byte(pdev, 0x44 + offset,
                        dma_mode[adev->dma_mode - XFER_MW_DMA_0]);
                ultra_cfg &= ~(1 << devbits);
        }
+       pci_write_config_byte(pdev, 0x56 + ap->port_no, ultra);
        pci_write_config_byte(pdev, 0x54, ultra_cfg);
 }
 
index 5c1e9cb59ecb66ed07ace0e1739516300e7c0280..503245a1eafadba2126c4d310abe9dad4509396f 100644 (file)
@@ -33,7 +33,7 @@
 #include <linux/libata.h>
 
 #define DRV_NAME "pata_sil680"
-#define DRV_VERSION "0.4.7"
+#define DRV_VERSION "0.4.8"
 
 #define SIL680_MMIO_BAR                5
 
@@ -93,34 +93,6 @@ static int sil680_cable_detect(struct ata_port *ap) {
                return ATA_CBL_PATA40;
 }
 
-/**
- *     sil680_bus_reset        -       reset the SIL680 bus
- *     @link: ATA link to reset
- *     @deadline: deadline jiffies for the operation
- *
- *     Perform the SIL680 housekeeping when doing an ATA bus reset
- */
-
-static int sil680_bus_reset(struct ata_link *link, unsigned int *classes,
-                           unsigned long deadline)
-{
-       struct ata_port *ap = link->ap;
-       struct pci_dev *pdev = to_pci_dev(ap->host->dev);
-       unsigned long addr = sil680_selreg(ap, 0);
-       u8 reset;
-
-       pci_read_config_byte(pdev, addr, &reset);
-       pci_write_config_byte(pdev, addr, reset | 0x03);
-       udelay(25);
-       pci_write_config_byte(pdev, addr, reset);
-       return ata_std_softreset(link, classes, deadline);
-}
-
-static void sil680_error_handler(struct ata_port *ap)
-{
-       ata_bmdma_drive_eh(ap, ata_std_prereset, sil680_bus_reset, NULL, ata_std_postreset);
-}
-
 /**
  *     sil680_set_piomode      -       set initial PIO mode data
  *     @ap: ATA interface
@@ -249,7 +221,7 @@ static struct ata_port_operations sil680_port_ops = {
 
        .freeze         = ata_bmdma_freeze,
        .thaw           = ata_bmdma_thaw,
-       .error_handler  = sil680_error_handler,
+       .error_handler  = ata_bmdma_error_handler,
        .post_internal_cmd = ata_bmdma_post_internal_cmd,
        .cable_detect   = sil680_cable_detect,
 
index 3b5be77e861c77139eab0cc15f4f9fd26c3954db..87546d9f1ca0839cf5067d94116af34ae297c7e7 100644 (file)
@@ -55,6 +55,7 @@ static const struct sis_laptop sis_laptop[] = {
        /* devid, subvendor, subdev */
        { 0x5513, 0x1043, 0x1107 },     /* ASUS A6K */
        { 0x5513, 0x1734, 0x105F },     /* FSC Amilo A1630 */
+       { 0x5513, 0x1071, 0x8640 },     /* EasyNote K5305 */
        /* end marker */
        { 0, }
 };
index ea7a9a652e6118c8ab1cc2c20088abcb67670067..a4175fbdd1704dcf6c231dcf6bf55b0552d3f1b5 100644 (file)
@@ -176,7 +176,7 @@ static int via_cable_detect(struct ata_port *ap) {
        if ((config->flags & VIA_UDMA) < VIA_UDMA_66)
                return ATA_CBL_PATA40;
        /* UDMA 66 chips have only drive side logic */
-       else if((config->flags & VIA_UDMA) < VIA_UDMA_100)
+       else if ((config->flags & VIA_UDMA) < VIA_UDMA_100)
                return ATA_CBL_PATA_UNK;
        /* UDMA 100 or later */
        pci_read_config_dword(pdev, 0x50, &ata66);
index 549cbbe9fd07f21162baa54cd16270fc3f79b6b1..311cdb3a5566caec1d60e788327f3004fc662b8d 100644 (file)
@@ -279,7 +279,7 @@ static __init int winbond_init(void)
 
                        if (request_region(port, 2, "pata_winbond")) {
                                ret = winbond_init_one(port);
-                               if(ret <= 0)
+                               if (ret <= 0)
                                        release_region(port, 2);
                                else ct+= ret;
                        }
index 199f7e150eb37822f556753f7b7902580926aa3b..bd4c2a3c88d7f17794b3505794ff69c1f6c7c895 100644 (file)
 #define DRV_VERSION    "1.0"
 
 /* macro to calculate base address for ATA regs */
-#define ADMA_ATA_REGS(base,port_no)    ((base) + ((port_no) * 0x40))
+#define ADMA_ATA_REGS(base, port_no)   ((base) + ((port_no) * 0x40))
 
 /* macro to calculate base address for ADMA regs */
-#define ADMA_REGS(base,port_no)                ((base) + 0x80 + ((port_no) * 0x20))
+#define ADMA_REGS(base, port_no)       ((base) + 0x80 + ((port_no) * 0x20))
 
 /* macro to obtain addresses from ata_port */
 #define ADMA_PORT_REGS(ap) \
@@ -128,7 +128,7 @@ struct adma_port_priv {
        adma_state_t            state;
 };
 
-static int adma_ata_init_one (struct pci_dev *pdev,
+static int adma_ata_init_one(struct pci_dev *pdev,
                                const struct pci_device_id *ent);
 static int adma_port_start(struct ata_port *ap);
 static void adma_host_stop(struct ata_host *host);
@@ -340,8 +340,8 @@ static int adma_fill_sg(struct ata_queued_cmd *qc)
                buf[i++] = 0;   /* pPKLW */
                buf[i++] = 0;   /* reserved */
 
-               *(__le32 *)(buf + i)
-                       (pFLAGS & pEND) ? 0 : cpu_to_le32(pp->pkt_dma + i + 4);
+               *(__le32 *)(buf + i) =
+                       (pFLAGS & pEND) ? 0 : cpu_to_le32(pp->pkt_dma + i + 4);
                i += 4;
 
                VPRINTK("PRD[%u] = (0x%lX, 0x%X)\n", i/4,
@@ -617,7 +617,7 @@ static int adma_port_start(struct ata_port *ap)
                return -ENOMEM;
        /* paranoia? */
        if ((pp->pkt_dma & 7) != 0) {
-               printk("bad alignment for pp->pkt_dma: %08x\n",
+               printk(KERN_ERR "bad alignment for pp->pkt_dma: %08x\n",
                                                (u32)pp->pkt_dma);
                return -ENOMEM;
        }
index b4c37b9e413c1268cd95bd9da40ac5fa9e0493f0..d015b4adcfe098402fd9e8b307a829f580e36636 100644 (file)
@@ -34,7 +34,8 @@ enum {
 
        SATA_FSL_HOST_FLAGS     = (ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
                                ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA |
-                               ATA_FLAG_NCQ  | ATA_FLAG_SKIP_D2H_BSY),
+                               ATA_FLAG_NCQ),
+       SATA_FSL_HOST_LFLAGS    = ATA_LFLAG_SKIP_D2H_BSY,
 
        SATA_FSL_MAX_CMDS       = SATA_FSL_QUEUE_DEPTH,
        SATA_FSL_CMD_HDR_SIZE   = 16,   /* 4 DWORDS */
@@ -264,10 +265,11 @@ struct sata_fsl_host_priv {
        void __iomem *hcr_base;
        void __iomem *ssr_base;
        void __iomem *csr_base;
+       int irq;
 };
 
 static inline unsigned int sata_fsl_tag(unsigned int tag,
-                                       void __iomem * hcr_base)
+                                       void __iomem *hcr_base)
 {
        /* We let libATA core do actual (queue) tag allocation */
 
@@ -306,7 +308,7 @@ static void sata_fsl_setup_cmd_hdr_entry(struct sata_fsl_port_priv *pp,
        pp->cmdslot[tag].prde_fis_len =
            cpu_to_le32((num_prde << 16) | (fis_len << 2));
        pp->cmdslot[tag].ttl = cpu_to_le32(data_xfer_len & ~0x03);
-       pp->cmdslot[tag].desc_info = cpu_to_le32((desc_info | (tag & 0x1F)));
+       pp->cmdslot[tag].desc_info = cpu_to_le32(desc_info | (tag & 0x1F));
 
        VPRINTK("cda=0x%x, prde_fis_len=0x%x, ttl=0x%x, di=0x%x\n",
                pp->cmdslot[tag].cda,
@@ -316,7 +318,7 @@ static void sata_fsl_setup_cmd_hdr_entry(struct sata_fsl_port_priv *pp,
 }
 
 static unsigned int sata_fsl_fill_sg(struct ata_queued_cmd *qc, void *cmd_desc,
-                                    u32 * ttl, dma_addr_t cmd_desc_paddr)
+                                    u32 *ttl, dma_addr_t cmd_desc_paddr)
 {
        struct scatterlist *sg;
        unsigned int num_prde = 0;
@@ -353,7 +355,7 @@ static unsigned int sata_fsl_fill_sg(struct ata_queued_cmd *qc, void *cmd_desc,
                                        "s/g len unaligned : 0x%x\n", sg_len);
 
                if ((num_prde == (SATA_FSL_MAX_PRD_DIRECT - 1)) &&
-                   !ata_sg_is_last(sg, qc)) {
+                   (qc->n_iter + 1 != qc->n_elem)) {
                        VPRINTK("setting indirect prde\n");
                        prd_ptr_to_indirect_ext = prd;
                        prd->dba = cpu_to_le32(indirect_ext_segment_paddr);
@@ -404,7 +406,7 @@ static void sata_fsl_qc_prep(struct ata_queued_cmd *qc)
        cd = (struct command_desc *)pp->cmdentry + tag;
        cd_paddr = pp->cmdentry_paddr + tag * SATA_FSL_CMD_DESC_SIZE;
 
-       ata_tf_to_fis(&qc->tf, 0, 1, (u8 *) & cd->cfis);
+       ata_tf_to_fis(&qc->tf, 0, 1, (u8 *) &cd->cfis);
 
        VPRINTK("Dumping cfis : 0x%x, 0x%x, 0x%x\n",
                cd->cfis[0], cd->cfis[1], cd->cfis[2]);
@@ -470,16 +472,10 @@ static int sata_fsl_scr_write(struct ata_port *ap, unsigned int sc_reg_in,
 
        switch (sc_reg_in) {
        case SCR_STATUS:
-               sc_reg = 0;
-               break;
        case SCR_ERROR:
-               sc_reg = 1;
-               break;
        case SCR_CONTROL:
-               sc_reg = 2;
-               break;
        case SCR_ACTIVE:
-               sc_reg = 3;
+               sc_reg = sc_reg_in;
                break;
        default:
                return -EINVAL;
@@ -487,7 +483,7 @@ static int sata_fsl_scr_write(struct ata_port *ap, unsigned int sc_reg_in,
 
        VPRINTK("xx_scr_write, reg_in = %d\n", sc_reg);
 
-       iowrite32(val, (void __iomem *)ssr_base + (sc_reg * 4));
+       iowrite32(val, ssr_base + (sc_reg * 4));
        return 0;
 }
 
@@ -500,16 +496,10 @@ static int sata_fsl_scr_read(struct ata_port *ap, unsigned int sc_reg_in,
 
        switch (sc_reg_in) {
        case SCR_STATUS:
-               sc_reg = 0;
-               break;
        case SCR_ERROR:
-               sc_reg = 1;
-               break;
        case SCR_CONTROL:
-               sc_reg = 2;
-               break;
        case SCR_ACTIVE:
-               sc_reg = 3;
+               sc_reg = sc_reg_in;
                break;
        default:
                return -EINVAL;
@@ -517,7 +507,7 @@ static int sata_fsl_scr_read(struct ata_port *ap, unsigned int sc_reg_in,
 
        VPRINTK("xx_scr_read, reg_in = %d\n", sc_reg);
 
-       *val = ioread32((void __iomem *)ssr_base + (sc_reg * 4));
+       *val = ioread32(ssr_base + (sc_reg * 4));
        return 0;
 }
 
@@ -571,7 +561,6 @@ static inline void sata_fsl_cache_taskfile_from_d2h_fis(struct ata_queued_cmd
                                                        struct ata_port *ap)
 {
        struct sata_fsl_port_priv *pp = ap->private_data;
-       u8 fis[6 * 4];
        struct sata_fsl_host_priv *host_priv = ap->host->private_data;
        void __iomem *hcr_base = host_priv->hcr_base;
        unsigned int tag = sata_fsl_tag(qc->tag, hcr_base);
@@ -579,8 +568,7 @@ static inline void sata_fsl_cache_taskfile_from_d2h_fis(struct ata_queued_cmd
 
        cd = pp->cmdentry + tag;
 
-       memcpy(fis, &cd->sfis, 6 * 4);  /* should we use memcpy_from_io() */
-       ata_tf_from_fis(fis, &pp->tf);
+       ata_tf_from_fis(cd->sfis, &pp->tf);
 }
 
 static u8 sata_fsl_check_status(struct ata_port *ap)
@@ -664,6 +652,7 @@ static int sata_fsl_port_start(struct ata_port *ap)
        VPRINTK("HControl = 0x%x\n", ioread32(hcr_base + HCONTROL));
        VPRINTK("CHBA  = 0x%x\n", ioread32(hcr_base + CHBA));
 
+#ifdef CONFIG_MPC8315_DS
        /*
         * Workaround for 8315DS board 3gbps link-up issue,
         * currently limit SATA port to GEN1 speed
@@ -676,6 +665,7 @@ static int sata_fsl_port_start(struct ata_port *ap)
        sata_fsl_scr_read(ap, SCR_CONTROL, &temp);
        dev_printk(KERN_WARNING, dev, "scr_control, speed limited to %x\n",
                        temp);
+#endif
 
        return 0;
 }
@@ -728,9 +718,10 @@ static unsigned int sata_fsl_dev_classify(struct ata_port *ap)
        return ata_dev_classify(&tf);
 }
 
-static int sata_fsl_softreset(struct ata_port *ap, unsigned int *class,
+static int sata_fsl_softreset(struct ata_link *link, unsigned int *class,
                              unsigned long deadline)
 {
+       struct ata_port *ap = link->ap;
        struct sata_fsl_port_priv *pp = ap->private_data;
        struct sata_fsl_host_priv *host_priv = ap->host->private_data;
        void __iomem *hcr_base = host_priv->hcr_base;
@@ -739,10 +730,6 @@ static int sata_fsl_softreset(struct ata_port *ap, unsigned int *class,
        u8 *cfis;
        u32 Serror;
        int i = 0;
-       struct ata_queued_cmd qc;
-       u8 *buf;
-       dma_addr_t dma_address;
-       struct scatterlist *sg;
        unsigned long start_jiffies;
 
        DPRINTK("in xx_softreset\n");
@@ -811,7 +798,7 @@ try_offline_again:
         */
 
        temp = ata_wait_register(hcr_base + HSTATUS, 0xFF, 0, 1, 500);
-       if ((!(temp & 0x10)) || ata_port_offline(ap)) {
+       if ((!(temp & 0x10)) || ata_link_offline(link)) {
                ata_port_printk(ap, KERN_WARNING,
                                "No Device OR PHYRDY change,Hstatus = 0x%x\n",
                                ioread32(hcr_base + HSTATUS));
@@ -842,13 +829,10 @@ try_offline_again:
         * reached here, we can send a command to the target device
         */
 
-       if (ap->sactive)
-               goto skip_srst_do_ncq_error_handling;
-
        DPRINTK("Sending SRST/device reset\n");
 
-       ata_tf_init(ap->device, &tf);
-       cfis = (u8 *) & pp->cmdentry->cfis;
+       ata_tf_init(link->device, &tf);
+       cfis = (u8 *) &pp->cmdentry->cfis;
 
        /* device reset/SRST is a control register update FIS, uses tag0 */
        sata_fsl_setup_cmd_hdr_entry(pp, 0,
@@ -912,76 +896,13 @@ try_offline_again:
         * command bit of the CCreg
         */
        iowrite32(0x01, CC + hcr_base); /* We know it will be cmd#0 always */
-       goto check_device_signature;
-
-skip_srst_do_ncq_error_handling:
-
-       VPRINTK("Sending read log ext(10h) command\n");
-
-       memset(&qc, 0, sizeof(struct ata_queued_cmd));
-       ata_tf_init(ap->device, &tf);
-
-       tf.command = ATA_CMD_READ_LOG_EXT;
-       tf.lbal = ATA_LOG_SATA_NCQ;
-       tf.nsect = 1;
-       tf.hob_nsect = 0;
-       tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_LBA48 | ATA_TFLAG_DEVICE;
-       tf.protocol = ATA_PROT_PIO;
-
-       qc.tag = ATA_TAG_INTERNAL;
-       qc.scsicmd = NULL;
-       qc.ap = ap;
-       qc.dev = ap->device;
-
-       qc.tf = tf;
-       qc.flags |= ATA_QCFLAG_RESULT_TF;
-       qc.dma_dir = DMA_FROM_DEVICE;
-
-       buf = ap->sector_buf;
-       ata_sg_init_one(&qc, buf, 1 * ATA_SECT_SIZE);
-
-       /*
-        * Need to DMA-map the memory buffer associated with the command
-        */
-
-       sg = qc.__sg;
-       dma_address = dma_map_single(ap->dev, qc.buf_virt,
-                                    sg->length, DMA_FROM_DEVICE);
-
-       sg_dma_address(sg) = dma_address;
-       sg_dma_len(sg) = sg->length;
-
-       VPRINTK("EH, addr = 0x%x, len = 0x%x\n", dma_address, sg->length);
-
-       sata_fsl_qc_prep(&qc);
-       sata_fsl_qc_issue(&qc);
-
-       temp = ata_wait_register(CQ + hcr_base, 0x1, 0x1, 1, 5000);
-       if (temp & 0x1) {
-               VPRINTK("READ_LOG_EXT_10H issue failed\n");
-
-               VPRINTK("READ_LOG@5000,CQ=0x%x,CA=0x%x,CC=0x%x\n",
-                       ioread32(CQ + hcr_base),
-                       ioread32(CA + hcr_base), ioread32(CC + hcr_base));
-
-               sata_fsl_scr_read(ap, SCR_ERROR, &Serror);
-
-               VPRINTK("HStatus = 0x%x\n", ioread32(hcr_base + HSTATUS));
-               VPRINTK("HControl = 0x%x\n", ioread32(hcr_base + HCONTROL));
-               VPRINTK("Serror = 0x%x\n", Serror);
-               goto err;
-       }
-
-       iowrite32(0x01, CC + hcr_base); /* We know it will be cmd#0 always */
-
-      check_device_signature:
 
        DPRINTK("SATA FSL : Now checking device signature\n");
 
        *class = ATA_DEV_NONE;
 
        /* Verify if SStatus indicates device presence */
-       if (ata_port_online(ap)) {
+       if (ata_link_online(link)) {
                /*
                 * if we are here, device presence has been detected,
                 * 1st D2H FIS would have been received, but sfis in
@@ -1002,25 +923,13 @@ err:
        return -EIO;
 }
 
-static int sata_fsl_hardreset(struct ata_port *ap, unsigned int *class,
-                             unsigned long deadline)
-{
-       int retval;
-
-       retval = sata_std_hardreset(ap, class, deadline);
-
-       DPRINTK("SATA FSL : in xx_hardreset, retval = 0x%d\n", retval);
-
-       return retval;
-}
-
 static void sata_fsl_error_handler(struct ata_port *ap)
 {
 
        DPRINTK("in xx_error_handler\n");
 
        /* perform recovery */
-       ata_do_eh(ap, ata_std_prereset, sata_fsl_softreset, sata_fsl_hardreset,
+       ata_do_eh(ap, ata_std_prereset, sata_fsl_softreset, sata_std_hardreset,
                  ata_std_postreset);
 }
 
@@ -1042,7 +951,8 @@ static void sata_fsl_irq_clear(struct ata_port *ap)
 
 static void sata_fsl_error_intr(struct ata_port *ap)
 {
-       struct ata_eh_info *ehi = &ap->eh_info;
+       struct ata_link *link = &ap->link;
+       struct ata_eh_info *ehi = &link->eh_info;
        struct sata_fsl_host_priv *host_priv = ap->host->private_data;
        void __iomem *hcr_base = host_priv->hcr_base;
        u32 hstatus, dereg, cereg = 0, SError = 0;
@@ -1111,7 +1021,7 @@ static void sata_fsl_error_intr(struct ata_port *ap)
        }
 
        /* record error info */
-       qc = ata_qc_from_tag(ap, ap->active_tag);
+       qc = ata_qc_from_tag(ap, link->active_tag);
 
        if (qc) {
                sata_fsl_cache_taskfile_from_d2h_fis(qc, qc->ap);
@@ -1139,6 +1049,7 @@ static void sata_fsl_qc_complete(struct ata_queued_cmd *qc)
 
 static void sata_fsl_host_intr(struct ata_port *ap)
 {
+       struct ata_link *link = &ap->link;
        struct sata_fsl_host_priv *host_priv = ap->host->private_data;
        void __iomem *hcr_base = host_priv->hcr_base;
        u32 hstatus, qc_active = 0;
@@ -1161,7 +1072,7 @@ static void sata_fsl_host_intr(struct ata_port *ap)
                return;
        }
 
-       if (ap->sactive) {      /* only true for NCQ commands */
+       if (link->sactive) {    /* only true for NCQ commands */
                int i;
                /* Read command completed register */
                qc_active = ioread32(hcr_base + CC);
@@ -1190,10 +1101,10 @@ static void sata_fsl_host_intr(struct ata_port *ap)
 
        } else if (ap->qc_active) {
                iowrite32(1, hcr_base + CC);
-               qc = ata_qc_from_tag(ap, ap->active_tag);
+               qc = ata_qc_from_tag(ap, link->active_tag);
 
                DPRINTK("completing non-ncq cmd, tag=%d,CC=0x%x\n",
-                       ap->active_tag, ioread32(hcr_base + CC));
+                       link->active_tag, ioread32(hcr_base + CC));
 
                if (qc) {
                        sata_fsl_qc_complete(qc);
@@ -1312,15 +1223,9 @@ static struct scsi_host_template sata_fsl_sht = {
        .slave_configure = ata_scsi_slave_config,
        .slave_destroy = ata_scsi_slave_destroy,
        .bios_param = ata_std_bios_param,
-#ifdef CONFIG_PM
-       .suspend = ata_scsi_device_suspend,
-       .resume = ata_scsi_device_resume,
-#endif
 };
 
 static const struct ata_port_operations sata_fsl_ops = {
-       .port_disable = ata_port_disable,
-
        .check_status = sata_fsl_check_status,
        .check_altstatus = sata_fsl_check_status,
        .dev_select = ata_noop_dev_select,
@@ -1330,8 +1235,6 @@ static const struct ata_port_operations sata_fsl_ops = {
        .qc_prep = sata_fsl_qc_prep,
        .qc_issue = sata_fsl_qc_issue,
        .irq_clear = sata_fsl_irq_clear,
-       .irq_on = ata_dummy_irq_on,
-       .irq_ack = ata_dummy_irq_ack,
 
        .scr_read = sata_fsl_scr_read,
        .scr_write = sata_fsl_scr_write,
@@ -1348,6 +1251,7 @@ static const struct ata_port_operations sata_fsl_ops = {
 static const struct ata_port_info sata_fsl_port_info[] = {
        {
         .flags = SATA_FSL_HOST_FLAGS,
+        .link_flags = SATA_FSL_HOST_LFLAGS,
         .pio_mask = 0x1f,      /* pio 0-4 */
         .udma_mask = 0x7f,     /* udma 0-6 */
         .port_ops = &sata_fsl_ops,
@@ -1398,6 +1302,7 @@ static int sata_fsl_probe(struct of_device *ofdev,
                dev_printk(KERN_ERR, &ofdev->dev, "invalid irq from platform\n");
                goto error_exit_with_cleanup;
        }
+       host_priv->irq = irq;
 
        /* allocate host structure */
        host = ata_host_alloc_pinfo(&ofdev->dev, ppi, SATA_FSL_MAX_PORTS);
@@ -1444,7 +1349,7 @@ static int sata_fsl_remove(struct of_device *ofdev)
 
        dev_set_drvdata(&ofdev->dev, NULL);
 
-       irq_dispose_mapping(host->irq);
+       irq_dispose_mapping(host_priv->irq);
        iounmap(host_priv->hcr_base);
        kfree(host_priv);
 
index 08595f34b3e8cdaa2df597b799cf9a479fe713d1..323c087e8cc122bb04189ee361952147c6b8faa8 100644 (file)
@@ -143,7 +143,7 @@ static const int scr_map[] = {
        [SCR_CONTROL]   = 2,
 };
 
-static void __iomem * inic_port_base(struct ata_port *ap)
+static void __iomem *inic_port_base(struct ata_port *ap)
 {
        return ap->host->iomap[MMIO_BAR] + ap->port_no * PORT_SIZE;
 }
@@ -448,7 +448,7 @@ static int inic_hardreset(struct ata_link *link, unsigned int *class,
                struct ata_taskfile tf;
 
                /* wait a while before checking status */
-               msleep(150);
+               ata_wait_after_reset(ap, deadline);
 
                rc = ata_wait_ready(ap, deadline);
                /* link occupied, -ENODEV too is an error */
index b39648f0914b023f9bedd8d3b7c206d8a5fc3fbd..a43f64d2775b9cf74214a83c7170368dab82595f 100644 (file)
@@ -1156,7 +1156,7 @@ static void mv_fill_sg(struct ata_queued_cmd *qc)
                last_sg->flags_size |= cpu_to_le32(EPRD_FLAG_END_OF_TBL);
 }
 
-static inline void mv_crqb_pack_cmd(__le16 *cmdw, u8 data, u8 addr, unsigned last)
+static void mv_crqb_pack_cmd(__le16 *cmdw, u8 data, u8 addr, unsigned last)
 {
        u16 tmp = data | (addr << CRQB_CMD_ADDR_SHIFT) | CRQB_CMD_CS |
                (last ? CRQB_CMD_LAST : 0);
@@ -2429,7 +2429,7 @@ static int mv_chip_id(struct ata_host *host, unsigned int board_idx)
        struct mv_host_priv *hpriv = host->private_data;
        u32 hp_flags = hpriv->hp_flags;
 
-       switch(board_idx) {
+       switch (board_idx) {
        case chip_5080:
                hpriv->ops = &mv5xxx_ops;
                hp_flags |= MV_HP_GEN_I;
@@ -2510,7 +2510,8 @@ static int mv_chip_id(struct ata_host *host, unsigned int board_idx)
                break;
 
        default:
-               printk(KERN_ERR DRV_NAME ": BUG: invalid board index %u\n", board_idx);
+               dev_printk(KERN_ERR, &pdev->dev,
+                          "BUG: invalid board index %u\n", board_idx);
                return 1;
        }
 
index f1b422f7c74937f43dc32848d506dbd4620d5673..44f9e5d9e36238e00b45de0cf2840f1489b052c6 100644 (file)
@@ -291,7 +291,7 @@ struct nv_swncq_port_priv {
 };
 
 
-#define NV_ADMA_CHECK_INTR(GCTL, PORT) ((GCTL) & ( 1 << (19 + (12 * (PORT)))))
+#define NV_ADMA_CHECK_INTR(GCTL, PORT) ((GCTL) & (1 << (19 + (12 * (PORT)))))
 
 static int nv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
 #ifdef CONFIG_PM
@@ -884,8 +884,9 @@ static int nv_adma_check_cpb(struct ata_port *ap, int cpb_num, int force_err)
                        /* Notifier bits set without a command may indicate the drive
                           is misbehaving. Raise host state machine violation on this
                           condition. */
-                       ata_port_printk(ap, KERN_ERR, "notifier for tag %d with no command?\n",
-                               cpb_num);
+                       ata_port_printk(ap, KERN_ERR,
+                                       "notifier for tag %d with no cmd?\n",
+                                       cpb_num);
                        ehi->err_mask |= AC_ERR_HSM;
                        ehi->action |= ATA_EH_SOFTRESET;
                        ata_port_freeze(ap);
@@ -1012,7 +1013,7 @@ static irqreturn_t nv_adma_interrupt(int irq, void *dev_instance)
                                u32 check_commands;
                                int pos, error = 0;
 
-                               if(ata_tag_valid(ap->link.active_tag))
+                               if (ata_tag_valid(ap->link.active_tag))
                                        check_commands = 1 << ap->link.active_tag;
                                else
                                        check_commands = ap->link.sactive;
@@ -1021,14 +1022,14 @@ static irqreturn_t nv_adma_interrupt(int irq, void *dev_instance)
                                while ((pos = ffs(check_commands)) && !error) {
                                        pos--;
                                        error = nv_adma_check_cpb(ap, pos,
-                                               notifier_error & (1 << pos) );
-                                       check_commands &= ~(1 << pos );
+                                               notifier_error & (1 << pos));
+                                       check_commands &= ~(1 << pos);
                                }
                        }
                }
        }
 
-       if(notifier_clears[0] || notifier_clears[1]) {
+       if (notifier_clears[0] || notifier_clears[1]) {
                /* Note: Both notifier clear registers must be written
                   if either is set, even if one is zero, according to NVIDIA. */
                struct nv_adma_port_priv *pp = host->ports[0]->private_data;
@@ -1061,7 +1062,7 @@ static void nv_adma_freeze(struct ata_port *ap)
        tmp = readw(mmio + NV_ADMA_CTL);
        writew(tmp & ~(NV_ADMA_CTL_AIEN | NV_ADMA_CTL_HOTPLUG_IEN),
                mmio + NV_ADMA_CTL);
-       readw(mmio + NV_ADMA_CTL );     /* flush posted write */
+       readw(mmio + NV_ADMA_CTL);      /* flush posted write */
 }
 
 static void nv_adma_thaw(struct ata_port *ap)
@@ -1079,7 +1080,7 @@ static void nv_adma_thaw(struct ata_port *ap)
        tmp = readw(mmio + NV_ADMA_CTL);
        writew(tmp | (NV_ADMA_CTL_AIEN | NV_ADMA_CTL_HOTPLUG_IEN),
                mmio + NV_ADMA_CTL);
-       readw(mmio + NV_ADMA_CTL );     /* flush posted write */
+       readw(mmio + NV_ADMA_CTL);      /* flush posted write */
 }
 
 static void nv_adma_irq_clear(struct ata_port *ap)
@@ -1119,7 +1120,7 @@ static void nv_adma_post_internal_cmd(struct ata_queued_cmd *qc)
 {
        struct nv_adma_port_priv *pp = qc->ap->private_data;
 
-       if(pp->flags & NV_ADMA_PORT_REGISTER_MODE)
+       if (pp->flags & NV_ADMA_PORT_REGISTER_MODE)
                ata_bmdma_post_internal_cmd(qc);
 }
 
@@ -1165,7 +1166,7 @@ static int nv_adma_port_start(struct ata_port *ap)
        pp->cpb_dma = mem_dma;
 
        writel(mem_dma & 0xFFFFFFFF,    mmio + NV_ADMA_CPB_BASE_LOW);
-       writel((mem_dma >> 16 ) >> 16,  mmio + NV_ADMA_CPB_BASE_HIGH);
+       writel((mem_dma >> 16) >> 16,   mmio + NV_ADMA_CPB_BASE_HIGH);
 
        mem     += NV_ADMA_MAX_CPBS * NV_ADMA_CPB_SZ;
        mem_dma += NV_ADMA_MAX_CPBS * NV_ADMA_CPB_SZ;
@@ -1189,15 +1190,15 @@ static int nv_adma_port_start(struct ata_port *ap)
 
        /* clear GO for register mode, enable interrupt */
        tmp = readw(mmio + NV_ADMA_CTL);
-       writew( (tmp & ~NV_ADMA_CTL_GO) | NV_ADMA_CTL_AIEN |
-                NV_ADMA_CTL_HOTPLUG_IEN, mmio + NV_ADMA_CTL);
+       writew((tmp & ~NV_ADMA_CTL_GO) | NV_ADMA_CTL_AIEN |
+               NV_ADMA_CTL_HOTPLUG_IEN, mmio + NV_ADMA_CTL);
 
        tmp = readw(mmio + NV_ADMA_CTL);
        writew(tmp | NV_ADMA_CTL_CHANNEL_RESET, mmio + NV_ADMA_CTL);
-       readw( mmio + NV_ADMA_CTL );    /* flush posted write */
+       readw(mmio + NV_ADMA_CTL);      /* flush posted write */
        udelay(1);
        writew(tmp & ~NV_ADMA_CTL_CHANNEL_RESET, mmio + NV_ADMA_CTL);
-       readw( mmio + NV_ADMA_CTL );    /* flush posted write */
+       readw(mmio + NV_ADMA_CTL);      /* flush posted write */
 
        return 0;
 }
@@ -1237,7 +1238,7 @@ static int nv_adma_port_resume(struct ata_port *ap)
 
        /* set CPB block location */
        writel(pp->cpb_dma & 0xFFFFFFFF,        mmio + NV_ADMA_CPB_BASE_LOW);
-       writel((pp->cpb_dma >> 16 ) >> 16,      mmio + NV_ADMA_CPB_BASE_HIGH);
+       writel((pp->cpb_dma >> 16) >> 16,       mmio + NV_ADMA_CPB_BASE_HIGH);
 
        /* clear any outstanding interrupt conditions */
        writew(0xffff, mmio + NV_ADMA_STAT);
@@ -1250,15 +1251,15 @@ static int nv_adma_port_resume(struct ata_port *ap)
 
        /* clear GO for register mode, enable interrupt */
        tmp = readw(mmio + NV_ADMA_CTL);
-       writew( (tmp & ~NV_ADMA_CTL_GO) | NV_ADMA_CTL_AIEN |
-                NV_ADMA_CTL_HOTPLUG_IEN, mmio + NV_ADMA_CTL);
+       writew((tmp & ~NV_ADMA_CTL_GO) | NV_ADMA_CTL_AIEN |
+               NV_ADMA_CTL_HOTPLUG_IEN, mmio + NV_ADMA_CTL);
 
        tmp = readw(mmio + NV_ADMA_CTL);
        writew(tmp | NV_ADMA_CTL_CHANNEL_RESET, mmio + NV_ADMA_CTL);
-       readw( mmio + NV_ADMA_CTL );    /* flush posted write */
+       readw(mmio + NV_ADMA_CTL);      /* flush posted write */
        udelay(1);
        writew(tmp & ~NV_ADMA_CTL_CHANNEL_RESET, mmio + NV_ADMA_CTL);
-       readw( mmio + NV_ADMA_CTL );    /* flush posted write */
+       readw(mmio + NV_ADMA_CTL);      /* flush posted write */
 
        return 0;
 }
@@ -1342,7 +1343,8 @@ static void nv_adma_fill_sg(struct ata_queued_cmd *qc, struct nv_adma_cpb *cpb)
        idx = 0;
 
        ata_for_each_sg(sg, qc) {
-               aprd = (idx < 5) ? &cpb->aprd[idx] : &pp->aprd[NV_ADMA_SGTBL_LEN * qc->tag + (idx-5)];
+               aprd = (idx < 5) ? &cpb->aprd[idx] :
+                              &pp->aprd[NV_ADMA_SGTBL_LEN * qc->tag + (idx-5)];
                nv_adma_fill_aprd(qc, sg, idx, aprd);
                idx++;
        }
@@ -1359,12 +1361,12 @@ static int nv_adma_use_reg_mode(struct ata_queued_cmd *qc)
        /* ADMA engine can only be used for non-ATAPI DMA commands,
           or interrupt-driven no-data commands, where a result taskfile
           is not required. */
-       if((pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) ||
+       if ((pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) ||
           (qc->tf.flags & ATA_TFLAG_POLLING) ||
           (qc->flags & ATA_QCFLAG_RESULT_TF))
                return 1;
 
-       if((qc->flags & ATA_QCFLAG_DMAMAP) ||
+       if ((qc->flags & ATA_QCFLAG_DMAMAP) ||
           (qc->tf.protocol == ATA_PROT_NODATA))
                return 0;
 
@@ -1401,14 +1403,14 @@ static void nv_adma_qc_prep(struct ata_queued_cmd *qc)
 
        nv_adma_tf_to_cpb(&qc->tf, cpb->tf);
 
-       if(qc->flags & ATA_QCFLAG_DMAMAP) {
+       if (qc->flags & ATA_QCFLAG_DMAMAP) {
                nv_adma_fill_sg(qc, cpb);
                ctl_flags |= NV_CPB_CTL_APRD_VALID;
        } else
                memset(&cpb->aprd[0], 0, sizeof(struct nv_adma_prd) * 5);
 
-       /* Be paranoid and don't let the device see NV_CPB_CTL_CPB_VALID until we are
-          finished filling in all of the contents */
+       /* Be paranoid and don't let the device see NV_CPB_CTL_CPB_VALID
+          until we are finished filling in all of the contents */
        wmb();
        cpb->ctl_flags = ctl_flags;
        wmb();
@@ -1435,16 +1437,16 @@ static unsigned int nv_adma_qc_issue(struct ata_queued_cmd *qc)
           and (number of cpbs to append -1) in top 8 bits */
        wmb();
 
-       if(curr_ncq != pp->last_issue_ncq) {
-               /* Seems to need some delay before switching between NCQ and non-NCQ
-                  commands, else we get command timeouts and such. */
+       if (curr_ncq != pp->last_issue_ncq) {
+               /* Seems to need some delay before switching between NCQ and
+                  non-NCQ commands, else we get command timeouts and such. */
                udelay(20);
                pp->last_issue_ncq = curr_ncq;
        }
 
        writew(qc->tag, mmio + NV_ADMA_APPEND);
 
-       DPRINTK("Issued tag %u\n",qc->tag);
+       DPRINTK("Issued tag %u\n", qc->tag);
 
        return 0;
 }
@@ -1627,7 +1629,7 @@ static int nv_hardreset(struct ata_link *link, unsigned int *class,
 
        /* SATA hardreset fails to retrieve proper device signature on
         * some controllers.  Don't classify on hardreset.  For more
-        * info, see http://bugme.osdl.org/show_bug.cgi?id=3352
+        * info, see http://bugzilla.kernel.org/show_bug.cgi?id=3352
         */
        return sata_std_hardreset(link, &dummy, deadline);
 }
@@ -1641,12 +1643,12 @@ static void nv_error_handler(struct ata_port *ap)
 static void nv_adma_error_handler(struct ata_port *ap)
 {
        struct nv_adma_port_priv *pp = ap->private_data;
-       if(!(pp->flags & NV_ADMA_PORT_REGISTER_MODE)) {
+       if (!(pp->flags & NV_ADMA_PORT_REGISTER_MODE)) {
                void __iomem *mmio = pp->ctl_block;
                int i;
                u16 tmp;
 
-               if(ata_tag_valid(ap->link.active_tag) || ap->link.sactive) {
+               if (ata_tag_valid(ap->link.active_tag) || ap->link.sactive) {
                        u32 notifier = readl(mmio + NV_ADMA_NOTIFIER);
                        u32 notifier_error = readl(mmio + NV_ADMA_NOTIFIER_ERROR);
                        u32 gen_ctl = readl(pp->gen_block + NV_ADMA_GEN_CTL);
@@ -1654,16 +1656,17 @@ static void nv_adma_error_handler(struct ata_port *ap)
                        u8 cpb_count = readb(mmio + NV_ADMA_CPB_COUNT);
                        u8 next_cpb_idx = readb(mmio + NV_ADMA_NEXT_CPB_IDX);
 
-                       ata_port_printk(ap, KERN_ERR, "EH in ADMA mode, notifier 0x%X "
+                       ata_port_printk(ap, KERN_ERR,
+                               "EH in ADMA mode, notifier 0x%X "
                                "notifier_error 0x%X gen_ctl 0x%X status 0x%X "
                                "next cpb count 0x%X next cpb idx 0x%x\n",
                                notifier, notifier_error, gen_ctl, status,
                                cpb_count, next_cpb_idx);
 
-                       for( i=0;i<NV_ADMA_MAX_CPBS;i++) {
+                       for (i = 0; i < NV_ADMA_MAX_CPBS; i++) {
                                struct nv_adma_cpb *cpb = &pp->cpb[i];
-                               if(ata_tag_valid(ap->link.active_tag) && i == ap->link.active_tag) ||
-                                   ap->link.sactive & (1 << i) )
+                               if ((ata_tag_valid(ap->link.active_tag) && i == ap->link.active_tag) ||
+                                   ap->link.sactive & (1 << i))
                                        ata_port_printk(ap, KERN_ERR,
                                                "CPB %d: ctl_flags 0x%x, resp_flags 0x%x\n",
                                                i, cpb->ctl_flags, cpb->resp_flags);
@@ -1673,8 +1676,9 @@ static void nv_adma_error_handler(struct ata_port *ap)
                /* Push us back into port register mode for error handling. */
                nv_adma_register_mode(ap);
 
-               /* Mark all of the CPBs as invalid to prevent them from being executed */
-               for( i=0;i<NV_ADMA_MAX_CPBS;i++)
+               /* Mark all of the CPBs as invalid to prevent them from
+                  being executed */
+               for (i = 0; i < NV_ADMA_MAX_CPBS; i++)
                        pp->cpb[i].ctl_flags &= ~NV_CPB_CTL_CPB_VALID;
 
                /* clear CPB fetch count */
@@ -1683,10 +1687,10 @@ static void nv_adma_error_handler(struct ata_port *ap)
                /* Reset channel */
                tmp = readw(mmio + NV_ADMA_CTL);
                writew(tmp | NV_ADMA_CTL_CHANNEL_RESET, mmio + NV_ADMA_CTL);
-               readw( mmio + NV_ADMA_CTL );    /* flush posted write */
+               readw(mmio + NV_ADMA_CTL);      /* flush posted write */
                udelay(1);
                writew(tmp & ~NV_ADMA_CTL_CHANNEL_RESET, mmio + NV_ADMA_CTL);
-               readw( mmio + NV_ADMA_CTL );    /* flush posted write */
+               readw(mmio + NV_ADMA_CTL);      /* flush posted write */
        }
 
        ata_bmdma_drive_eh(ap, ata_std_prereset, ata_std_softreset,
@@ -2350,9 +2354,9 @@ static irqreturn_t nv_swncq_interrupt(int irq, void *dev_instance)
        return IRQ_RETVAL(handled);
 }
 
-static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
+static int nv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
-       static int printed_version = 0;
+       static int printed_version;
        const struct ata_port_info *ppi[] = { NULL, NULL };
        struct ata_host *host;
        struct nv_host_priv *hpriv;
@@ -2364,7 +2368,7 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
         // Make sure this is a SATA controller by counting the number of bars
         // (NVIDIA SATA controllers will always have six bars).  Otherwise,
         // it's an IDE controller and we ignore it.
-       for (bar=0; bar<6; bar++)
+       for (bar = 0; bar < 6; bar++)
                if (pci_resource_start(pdev, bar) == 0)
                        return -ENODEV;
 
@@ -2381,6 +2385,14 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
                type = ADMA;
        }
 
+       if (type == SWNCQ) {
+               if (swncq_enabled)
+                       dev_printk(KERN_NOTICE, &pdev->dev,
+                                  "Using SWNCQ mode\n");
+               else
+                       type = GENERIC;
+       }
+
        ppi[0] = &nv_port_info[type];
        rc = ata_pci_prepare_sff_host(pdev, ppi, &host);
        if (rc)
@@ -2422,10 +2434,8 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
                rc = nv_adma_host_init(host);
                if (rc)
                        return rc;
-       } else if (type == SWNCQ && swncq_enabled) {
-               dev_printk(KERN_NOTICE, &pdev->dev, "Using SWNCQ mode\n");
+       } else if (type == SWNCQ)
                nv_swncq_host_init(host);
-       }
 
        pci_set_master(pdev);
        return ata_host_activate(host, pdev->irq, ppi[0]->irq_handler,
@@ -2440,37 +2450,37 @@ static int nv_pci_device_resume(struct pci_dev *pdev)
        int rc;
 
        rc = ata_pci_device_do_resume(pdev);
-       if(rc)
+       if (rc)
                return rc;
 
        if (pdev->dev.power.power_state.event == PM_EVENT_SUSPEND) {
-               if(hpriv->type >= CK804) {
+               if (hpriv->type >= CK804) {
                        u8 regval;
 
                        pci_read_config_byte(pdev, NV_MCP_SATA_CFG_20, &regval);
                        regval |= NV_MCP_SATA_CFG_20_SATA_SPACE_EN;
                        pci_write_config_byte(pdev, NV_MCP_SATA_CFG_20, regval);
                }
-               if(hpriv->type == ADMA) {
+               if (hpriv->type == ADMA) {
                        u32 tmp32;
                        struct nv_adma_port_priv *pp;
                        /* enable/disable ADMA on the ports appropriately */
                        pci_read_config_dword(pdev, NV_MCP_SATA_CFG_20, &tmp32);
 
                        pp = host->ports[0]->private_data;
-                       if(pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE)
+                       if (pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE)
                                tmp32 &= ~(NV_MCP_SATA_CFG_20_PORT0_EN |
-                                          NV_MCP_SATA_CFG_20_PORT0_PWB_EN);
+                                          NV_MCP_SATA_CFG_20_PORT0_PWB_EN);
                        else
                                tmp32 |=  (NV_MCP_SATA_CFG_20_PORT0_EN |
-                                          NV_MCP_SATA_CFG_20_PORT0_PWB_EN);
+                                          NV_MCP_SATA_CFG_20_PORT0_PWB_EN);
                        pp = host->ports[1]->private_data;
-                       if(pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE)
+                       if (pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE)
                                tmp32 &= ~(NV_MCP_SATA_CFG_20_PORT1_EN |
-                                          NV_MCP_SATA_CFG_20_PORT1_PWB_EN);
+                                          NV_MCP_SATA_CFG_20_PORT1_PWB_EN);
                        else
                                tmp32 |=  (NV_MCP_SATA_CFG_20_PORT1_EN |
-                                          NV_MCP_SATA_CFG_20_PORT1_PWB_EN);
+                                          NV_MCP_SATA_CFG_20_PORT1_PWB_EN);
 
                        pci_write_config_dword(pdev, NV_MCP_SATA_CFG_20, tmp32);
                }
index 903213153b5d98ada9df5d817f3a06506a52e053..7914def54fa3552fcbd2134d97f469eaccd859b6 100644 (file)
@@ -2,6 +2,7 @@
  *  sata_promise.c - Promise SATA
  *
  *  Maintained by:  Jeff Garzik <jgarzik@pobox.com>
+ *                 Mikael Pettersson <mikpe@it.uu.se>
  *                 Please ALWAYS copy linux-ide@vger.kernel.org
  *                 on emails.
  *
 #include "sata_promise.h"
 
 #define DRV_NAME       "sata_promise"
-#define DRV_VERSION    "2.10"
+#define DRV_VERSION    "2.11"
 
 enum {
        PDC_MAX_PORTS           = 4,
        PDC_MMIO_BAR            = 3,
+       PDC_MAX_PRD             = LIBATA_MAX_PRD - 1, /* -1 for ASIC PRD bug workaround */
 
        /* register offsets */
        PDC_FEATURE             = 0x04, /* Feature/Error reg (per port) */
@@ -83,10 +85,12 @@ enum {
        PDC_PCI_SYS_ERR         = (1 << 22), /* PCI system error */
        PDC1_PCI_PARITY_ERR     = (1 << 23), /* PCI parity error (from SATA150 driver) */
        PDC1_ERR_MASK           = PDC1_PCI_PARITY_ERR,
-       PDC2_ERR_MASK           = PDC2_HTO_ERR | PDC2_ATA_HBA_ERR | PDC2_ATA_DMA_CNT_ERR,
-       PDC_ERR_MASK            = (PDC_PH_ERR | PDC_SH_ERR | PDC_DH_ERR | PDC_OVERRUN_ERR
-                                  | PDC_UNDERRUN_ERR | PDC_DRIVE_ERR | PDC_PCI_SYS_ERR
-                                  | PDC1_ERR_MASK | PDC2_ERR_MASK),
+       PDC2_ERR_MASK           = PDC2_HTO_ERR | PDC2_ATA_HBA_ERR |
+                                 PDC2_ATA_DMA_CNT_ERR,
+       PDC_ERR_MASK            = PDC_PH_ERR | PDC_SH_ERR | PDC_DH_ERR |
+                                 PDC_OVERRUN_ERR | PDC_UNDERRUN_ERR |
+                                 PDC_DRIVE_ERR | PDC_PCI_SYS_ERR |
+                                 PDC1_ERR_MASK | PDC2_ERR_MASK,
 
        board_2037x             = 0,    /* FastTrak S150 TX2plus */
        board_2037x_pata        = 1,    /* FastTrak S150 TX2plus PATA port */
@@ -155,7 +159,7 @@ static struct scsi_host_template pdc_ata_sht = {
        .queuecommand           = ata_scsi_queuecmd,
        .can_queue              = ATA_DEF_QUEUE,
        .this_id                = ATA_SHT_THIS_ID,
-       .sg_tablesize           = LIBATA_MAX_PRD,
+       .sg_tablesize           = PDC_MAX_PRD,
        .cmd_per_lun            = ATA_SHT_CMD_PER_LUN,
        .emulated               = ATA_SHT_EMULATED,
        .use_clustering         = ATA_SHT_USE_CLUSTERING,
@@ -238,7 +242,7 @@ static const struct ata_port_operations pdc_pata_ops = {
 };
 
 static const struct ata_port_info pdc_port_info[] = {
-       /* board_2037x */
+       [board_2037x] =
        {
                .flags          = PDC_COMMON_FLAGS | ATA_FLAG_SATA |
                                  PDC_FLAG_SATA_PATA,
@@ -248,7 +252,7 @@ static const struct ata_port_info pdc_port_info[] = {
                .port_ops       = &pdc_old_sata_ops,
        },
 
-       /* board_2037x_pata */
+       [board_2037x_pata] =
        {
                .flags          = PDC_COMMON_FLAGS | ATA_FLAG_SLAVE_POSS,
                .pio_mask       = 0x1f, /* pio0-4 */
@@ -257,7 +261,7 @@ static const struct ata_port_info pdc_port_info[] = {
                .port_ops       = &pdc_pata_ops,
        },
 
-       /* board_20319 */
+       [board_20319] =
        {
                .flags          = PDC_COMMON_FLAGS | ATA_FLAG_SATA |
                                  PDC_FLAG_4_PORTS,
@@ -267,7 +271,7 @@ static const struct ata_port_info pdc_port_info[] = {
                .port_ops       = &pdc_old_sata_ops,
        },
 
-       /* board_20619 */
+       [board_20619] =
        {
                .flags          = PDC_COMMON_FLAGS | ATA_FLAG_SLAVE_POSS |
                                  PDC_FLAG_4_PORTS,
@@ -277,7 +281,7 @@ static const struct ata_port_info pdc_port_info[] = {
                .port_ops       = &pdc_pata_ops,
        },
 
-       /* board_2057x */
+       [board_2057x] =
        {
                .flags          = PDC_COMMON_FLAGS | ATA_FLAG_SATA |
                                  PDC_FLAG_GEN_II | PDC_FLAG_SATA_PATA,
@@ -287,7 +291,7 @@ static const struct ata_port_info pdc_port_info[] = {
                .port_ops       = &pdc_sata_ops,
        },
 
-       /* board_2057x_pata */
+       [board_2057x_pata] =
        {
                .flags          = PDC_COMMON_FLAGS | ATA_FLAG_SLAVE_POSS |
                                  PDC_FLAG_GEN_II,
@@ -297,7 +301,7 @@ static const struct ata_port_info pdc_port_info[] = {
                .port_ops       = &pdc_pata_ops,
        },
 
-       /* board_40518 */
+       [board_40518] =
        {
                .flags          = PDC_COMMON_FLAGS | ATA_FLAG_SATA |
                                  PDC_FLAG_GEN_II | PDC_FLAG_4_PORTS,
@@ -521,6 +525,84 @@ static void pdc_atapi_pkt(struct ata_queued_cmd *qc)
        memcpy(buf+31, cdb, cdb_len);
 }
 
+/**
+ *     pdc_fill_sg - Fill PCI IDE PRD table
+ *     @qc: Metadata associated with taskfile to be transferred
+ *
+ *     Fill PCI IDE PRD (scatter-gather) table with segments
+ *     associated with the current disk command.
+ *     Make sure hardware does not choke on it.
+ *
+ *     LOCKING:
+ *     spin_lock_irqsave(host lock)
+ *
+ */
+static void pdc_fill_sg(struct ata_queued_cmd *qc)
+{
+       struct ata_port *ap = qc->ap;
+       struct scatterlist *sg;
+       unsigned int idx;
+       const u32 SG_COUNT_ASIC_BUG = 41*4;
+
+       if (!(qc->flags & ATA_QCFLAG_DMAMAP))
+               return;
+
+       WARN_ON(qc->__sg == NULL);
+       WARN_ON(qc->n_elem == 0 && qc->pad_len == 0);
+
+       idx = 0;
+       ata_for_each_sg(sg, qc) {
+               u32 addr, offset;
+               u32 sg_len, len;
+
+               /* determine if physical DMA addr spans 64K boundary.
+                * Note h/w doesn't support 64-bit, so we unconditionally
+                * truncate dma_addr_t to u32.
+                */
+               addr = (u32) sg_dma_address(sg);
+               sg_len = sg_dma_len(sg);
+
+               while (sg_len) {
+                       offset = addr & 0xffff;
+                       len = sg_len;
+                       if ((offset + sg_len) > 0x10000)
+                               len = 0x10000 - offset;
+
+                       ap->prd[idx].addr = cpu_to_le32(addr);
+                       ap->prd[idx].flags_len = cpu_to_le32(len & 0xffff);
+                       VPRINTK("PRD[%u] = (0x%X, 0x%X)\n", idx, addr, len);
+
+                       idx++;
+                       sg_len -= len;
+                       addr += len;
+               }
+       }
+
+       if (idx) {
+               u32 len = le32_to_cpu(ap->prd[idx - 1].flags_len);
+
+               if (len > SG_COUNT_ASIC_BUG) {
+                       u32 addr;
+
+                       VPRINTK("Splitting last PRD.\n");
+
+                       addr = le32_to_cpu(ap->prd[idx - 1].addr);
+                       ap->prd[idx - 1].flags_len = cpu_to_le32(len - SG_COUNT_ASIC_BUG);
+                       VPRINTK("PRD[%u] = (0x%X, 0x%X)\n", idx - 1, addr, SG_COUNT_ASIC_BUG);
+
+                       addr = addr + len - SG_COUNT_ASIC_BUG;
+                       len = SG_COUNT_ASIC_BUG;
+                       ap->prd[idx].addr = cpu_to_le32(addr);
+                       ap->prd[idx].flags_len = cpu_to_le32(len);
+                       VPRINTK("PRD[%u] = (0x%X, 0x%X)\n", idx, addr, len);
+
+                       idx++;
+               }
+
+               ap->prd[idx - 1].flags_len |= cpu_to_le32(ATA_PRD_EOT);
+       }
+}
+
 static void pdc_qc_prep(struct ata_queued_cmd *qc)
 {
        struct pdc_port_priv *pp = qc->ap->private_data;
@@ -530,7 +612,7 @@ static void pdc_qc_prep(struct ata_queued_cmd *qc)
 
        switch (qc->tf.protocol) {
        case ATA_PROT_DMA:
-               ata_qc_prep(qc);
+               pdc_fill_sg(qc);
                /* fall through */
 
        case ATA_PROT_NODATA:
@@ -546,11 +628,11 @@ static void pdc_qc_prep(struct ata_queued_cmd *qc)
                break;
 
        case ATA_PROT_ATAPI:
-               ata_qc_prep(qc);
+               pdc_fill_sg(qc);
                break;
 
        case ATA_PROT_ATAPI_DMA:
-               ata_qc_prep(qc);
+               pdc_fill_sg(qc);
                /*FALLTHROUGH*/
        case ATA_PROT_ATAPI_NODATA:
                pdc_atapi_pkt(qc);
@@ -695,19 +777,20 @@ static void pdc_irq_clear(struct ata_port *ap)
        readl(mmio + PDC_INT_SEQMASK);
 }
 
-static inline int pdc_is_sataii_tx4(unsigned long flags)
+static int pdc_is_sataii_tx4(unsigned long flags)
 {
        const unsigned long mask = PDC_FLAG_GEN_II | PDC_FLAG_4_PORTS;
        return (flags & mask) == mask;
 }
 
-static inline unsigned int pdc_port_no_to_ata_no(unsigned int port_no, int is_sataii_tx4)
+static unsigned int pdc_port_no_to_ata_no(unsigned int port_no,
+                                         int is_sataii_tx4)
 {
        static const unsigned char sataii_tx4_port_remap[4] = { 3, 1, 0, 2};
        return is_sataii_tx4 ? sataii_tx4_port_remap[port_no] : port_no;
 }
 
-static irqreturn_t pdc_interrupt (int irq, void *dev_instance)
+static irqreturn_t pdc_interrupt(int irq, void *dev_instance)
 {
        struct ata_host *host = dev_instance;
        struct ata_port *ap;
@@ -839,15 +922,16 @@ static unsigned int pdc_qc_issue_prot(struct ata_queued_cmd *qc)
 
 static void pdc_tf_load_mmio(struct ata_port *ap, const struct ata_taskfile *tf)
 {
-       WARN_ON (tf->protocol == ATA_PROT_DMA ||
-                tf->protocol == ATA_PROT_ATAPI_DMA);
+       WARN_ON(tf->protocol == ATA_PROT_DMA ||
+               tf->protocol == ATA_PROT_ATAPI_DMA);
        ata_tf_load(ap, tf);
 }
 
-static void pdc_exec_command_mmio(struct ata_port *ap, const struct ata_taskfile *tf)
+static void pdc_exec_command_mmio(struct ata_port *ap,
+                                 const struct ata_taskfile *tf)
 {
-       WARN_ON (tf->protocol == ATA_PROT_DMA ||
-                tf->protocol == ATA_PROT_ATAPI_DMA);
+       WARN_ON(tf->protocol == ATA_PROT_DMA ||
+               tf->protocol == ATA_PROT_ATAPI_DMA);
        ata_exec_command(ap, tf);
 }
 
@@ -870,8 +954,11 @@ static int pdc_check_atapi_dma(struct ata_queued_cmd *qc)
        }
        /* -45150 (FFFF4FA2) to -1 (FFFFFFFF) shall use PIO mode */
        if (scsicmd[0] == WRITE_10) {
-               unsigned int lba;
-               lba = (scsicmd[2] << 24) | (scsicmd[3] << 16) | (scsicmd[4] << 8) | scsicmd[5];
+               unsigned int lba =
+                       (scsicmd[2] << 24) |
+                       (scsicmd[3] << 16) |
+                       (scsicmd[4] << 8) |
+                       scsicmd[5];
                if (lba >= 0xFFFF4FA2)
                        pio = 1;
        }
@@ -956,7 +1043,8 @@ static void pdc_host_init(struct ata_host *host)
        writel(tmp, mmio + PDC_SLEW_CTL);
 }
 
-static int pdc_ata_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
+static int pdc_ata_init_one(struct pci_dev *pdev,
+                           const struct pci_device_id *ent)
 {
        static int printed_version;
        const struct ata_port_info *pi = &pdc_port_info[ent->driver_data];
index c4c4cd29eebba87bfc84e8eeb9c2e20c41bc5e74..2f1de6ec044c52f2dd5a4318ba5d2812e00db382 100644 (file)
@@ -103,7 +103,7 @@ enum {
        QS_DMA_BOUNDARY         = ~0UL
 };
 
-typedef enum { qs_state_idle, qs_state_pkt, qs_state_mmio } qs_state_t;
+typedef enum { qs_state_mmio, qs_state_pkt } qs_state_t;
 
 struct qs_port_priv {
        u8                      *pkt;
@@ -113,17 +113,18 @@ struct qs_port_priv {
 
 static int qs_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val);
 static int qs_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val);
-static int qs_ata_init_one (struct pci_dev *pdev, const struct pci_device_id *ent);
+static int qs_ata_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
 static int qs_port_start(struct ata_port *ap);
 static void qs_host_stop(struct ata_host *host);
-static void qs_phy_reset(struct ata_port *ap);
 static void qs_qc_prep(struct ata_queued_cmd *qc);
 static unsigned int qs_qc_issue(struct ata_queued_cmd *qc);
 static int qs_check_atapi_dma(struct ata_queued_cmd *qc);
 static void qs_bmdma_stop(struct ata_queued_cmd *qc);
 static u8 qs_bmdma_status(struct ata_port *ap);
 static void qs_irq_clear(struct ata_port *ap);
-static void qs_eng_timeout(struct ata_port *ap);
+static void qs_freeze(struct ata_port *ap);
+static void qs_thaw(struct ata_port *ap);
+static void qs_error_handler(struct ata_port *ap);
 
 static struct scsi_host_template qs_ata_sht = {
        .module                 = THIS_MODULE,
@@ -135,7 +136,6 @@ static struct scsi_host_template qs_ata_sht = {
        .sg_tablesize           = QS_MAX_PRD,
        .cmd_per_lun            = ATA_SHT_CMD_PER_LUN,
        .emulated               = ATA_SHT_EMULATED,
-       //FIXME .use_clustering         = ATA_SHT_USE_CLUSTERING,
        .use_clustering         = ENABLE_CLUSTERING,
        .proc_name              = DRV_NAME,
        .dma_boundary           = QS_DMA_BOUNDARY,
@@ -151,11 +151,12 @@ static const struct ata_port_operations qs_ata_ops = {
        .check_atapi_dma        = qs_check_atapi_dma,
        .exec_command           = ata_exec_command,
        .dev_select             = ata_std_dev_select,
-       .phy_reset              = qs_phy_reset,
        .qc_prep                = qs_qc_prep,
        .qc_issue               = qs_qc_issue,
        .data_xfer              = ata_data_xfer,
-       .eng_timeout            = qs_eng_timeout,
+       .freeze                 = qs_freeze,
+       .thaw                   = qs_thaw,
+       .error_handler          = qs_error_handler,
        .irq_clear              = qs_irq_clear,
        .irq_on                 = ata_irq_on,
        .scr_read               = qs_scr_read,
@@ -170,8 +171,6 @@ static const struct ata_port_info qs_port_info[] = {
        /* board_2068_idx */
        {
                .flags          = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
-                                 ATA_FLAG_SATA_RESET |
-                                 //FIXME ATA_FLAG_SRST |
                                  ATA_FLAG_MMIO | ATA_FLAG_PIO_POLLING,
                .pio_mask       = 0x10, /* pio4 */
                .udma_mask      = ATA_UDMA6,
@@ -220,7 +219,9 @@ static void qs_irq_clear(struct ata_port *ap)
 static inline void qs_enter_reg_mode(struct ata_port *ap)
 {
        u8 __iomem *chan = qs_mmio_base(ap->host) + (ap->port_no * 0x4000);
+       struct qs_port_priv *pp = ap->private_data;
 
+       pp->state = qs_state_mmio;
        writeb(QS_CTR0_REG, chan + QS_CCT_CTR0);
        readb(chan + QS_CCT_CTR0);        /* flush */
 }
@@ -234,23 +235,28 @@ static inline void qs_reset_channel_logic(struct ata_port *ap)
        qs_enter_reg_mode(ap);
 }
 
-static void qs_phy_reset(struct ata_port *ap)
+static void qs_freeze(struct ata_port *ap)
 {
-       struct qs_port_priv *pp = ap->private_data;
+       u8 __iomem *mmio_base = qs_mmio_base(ap->host);
 
-       pp->state = qs_state_idle;
-       qs_reset_channel_logic(ap);
-       sata_phy_reset(ap);
+       writeb(0, mmio_base + QS_HCT_CTRL); /* disable host interrupts */
+       qs_enter_reg_mode(ap);
 }
 
-static void qs_eng_timeout(struct ata_port *ap)
+static void qs_thaw(struct ata_port *ap)
 {
-       struct qs_port_priv *pp = ap->private_data;
+       u8 __iomem *mmio_base = qs_mmio_base(ap->host);
+
+       qs_enter_reg_mode(ap);
+       writeb(1, mmio_base + QS_HCT_CTRL); /* enable host interrupts */
+}
+
+static int qs_prereset(struct ata_link *link, unsigned long deadline)
+{
+       struct ata_port *ap = link->ap;
 
-       if (pp->state != qs_state_idle) /* healthy paranoia */
-               pp->state = qs_state_mmio;
        qs_reset_channel_logic(ap);
-       ata_eng_timeout(ap);
+       return ata_std_prereset(link, deadline);
 }
 
 static int qs_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val)
@@ -261,6 +267,13 @@ static int qs_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val)
        return 0;
 }
 
+static void qs_error_handler(struct ata_port *ap)
+{
+       qs_enter_reg_mode(ap);
+       ata_do_eh(ap, qs_prereset, ata_std_softreset, NULL,
+                 ata_std_postreset);
+}
+
 static int qs_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val)
 {
        if (sc_reg > SCR_CONTROL)
@@ -359,7 +372,6 @@ static unsigned int qs_qc_issue(struct ata_queued_cmd *qc)
 
        switch (qc->tf.protocol) {
        case ATA_PROT_DMA:
-
                pp->state = qs_state_pkt;
                qs_packet_start(qc);
                return 0;
@@ -376,6 +388,26 @@ static unsigned int qs_qc_issue(struct ata_queued_cmd *qc)
        return ata_qc_issue_prot(qc);
 }
 
+static void qs_do_or_die(struct ata_queued_cmd *qc, u8 status)
+{
+       qc->err_mask |= ac_err_mask(status);
+
+       if (!qc->err_mask) {
+               ata_qc_complete(qc);
+       } else {
+               struct ata_port    *ap  = qc->ap;
+               struct ata_eh_info *ehi = &ap->link.eh_info;
+
+               ata_ehi_clear_desc(ehi);
+               ata_ehi_push_desc(ehi, "status 0x%02X", status);
+
+               if (qc->err_mask == AC_ERR_DEV)
+                       ata_port_abort(ap);
+               else
+                       ata_port_freeze(ap);
+       }
+}
+
 static inline unsigned int qs_intr_pkt(struct ata_host *host)
 {
        unsigned int handled = 0;
@@ -407,10 +439,8 @@ static inline unsigned int qs_intr_pkt(struct ata_host *host)
                                        switch (sHST) {
                                        case 0: /* successful CPB */
                                        case 3: /* device error */
-                                               pp->state = qs_state_idle;
                                                qs_enter_reg_mode(qc->ap);
-                                               qc->err_mask |= ac_err_mask(sDST);
-                                               ata_qc_complete(qc);
+                                               qs_do_or_die(qc, sDST);
                                                break;
                                        default:
                                                break;
@@ -432,25 +462,27 @@ static inline unsigned int qs_intr_mmio(struct ata_host *host)
                if (ap &&
                    !(ap->flags & ATA_FLAG_DISABLED)) {
                        struct ata_queued_cmd *qc;
-                       struct qs_port_priv *pp = ap->private_data;
-                       if (!pp || pp->state != qs_state_mmio)
-                               continue;
+                       struct qs_port_priv *pp;
                        qc = ata_qc_from_tag(ap, ap->link.active_tag);
-                       if (qc && (!(qc->tf.flags & ATA_TFLAG_POLLING))) {
-
-                               /* check main status, clearing INTRQ */
-                               u8 status = ata_check_status(ap);
-                               if ((status & ATA_BUSY))
-                                       continue;
-                               DPRINTK("ata%u: protocol %d (dev_stat 0x%X)\n",
-                                       ap->print_id, qc->tf.protocol, status);
-
-                               /* complete taskfile transaction */
-                               pp->state = qs_state_idle;
-                               qc->err_mask |= ac_err_mask(status);
-                               ata_qc_complete(qc);
+                       if (!qc || !(qc->flags & ATA_QCFLAG_ACTIVE)) {
+                               /*
+                                * The qstor hardware generates spurious
+                                * interrupts from time to time when switching
+                                * in and out of packet mode.
+                                * There's no obvious way to know if we're
+                                * here now due to that, so just ack the irq
+                                * and pretend we knew it was ours.. (ugh).
+                                * This does not affect packet mode.
+                                */
+                               ata_check_status(ap);
                                handled = 1;
+                               continue;
                        }
+                       pp = ap->private_data;
+                       if (!pp || pp->state != qs_state_mmio)
+                               continue;
+                       if (!(qc->tf.flags & ATA_TFLAG_POLLING))
+                               handled |= ata_host_intr(ap, qc);
                }
        }
        return handled;
@@ -460,12 +492,13 @@ static irqreturn_t qs_intr(int irq, void *dev_instance)
 {
        struct ata_host *host = dev_instance;
        unsigned int handled = 0;
+       unsigned long flags;
 
        VPRINTK("ENTER\n");
 
-       spin_lock(&host->lock);
+       spin_lock_irqsave(&host->lock, flags);
        handled  = qs_intr_pkt(host) | qs_intr_mmio(host);
-       spin_unlock(&host->lock);
+       spin_unlock_irqrestore(&host->lock, flags);
 
        VPRINTK("EXIT\n");
 
@@ -502,7 +535,6 @@ static int qs_port_start(struct ata_port *ap)
        rc = ata_port_start(ap);
        if (rc)
                return rc;
-       qs_enter_reg_mode(ap);
        pp = devm_kzalloc(dev, sizeof(*pp), GFP_KERNEL);
        if (!pp)
                return -ENOMEM;
@@ -513,6 +545,7 @@ static int qs_port_start(struct ata_port *ap)
        memset(pp->pkt, 0, QS_PKT_BYTES);
        ap->private_data = pp;
 
+       qs_enter_reg_mode(ap);
        addr = (u64)pp->pkt_dma;
        writel((u32) addr,        chan + QS_CCF_CPBA);
        writel((u32)(addr >> 32), chan + QS_CCF_CPBA + 4);
index ea3a0ab7e027baf1d684f45eee9739c8f4ac8f55..4e6e381279cc657556924c136fca91ac5ebd7284 100644 (file)
@@ -111,7 +111,7 @@ enum {
        SIL_QUIRK_UDMA5MAX      = (1 << 1),
 };
 
-static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent);
+static int sil_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
 #ifdef CONFIG_PM
 static int sil_pci_device_resume(struct pci_dev *pdev);
 #endif
@@ -138,7 +138,7 @@ static const struct pci_device_id sil_pci_tbl[] = {
 
 /* TODO firmware versions should be added - eric */
 static const struct sil_drivelist {
-       const char * product;
+       const char *product;
        unsigned int quirk;
 } sil_blacklist [] = {
        { "ST320012AS",         SIL_QUIRK_MOD15WRITE },
@@ -279,7 +279,7 @@ MODULE_LICENSE("GPL");
 MODULE_DEVICE_TABLE(pci, sil_pci_tbl);
 MODULE_VERSION(DRV_VERSION);
 
-static int slow_down = 0;
+static int slow_down;
 module_param(slow_down, int, 0444);
 MODULE_PARM_DESC(slow_down, "Sledgehammer used to work around random problems, by limiting commands to 15 sectors (0=off, 1=on)");
 
@@ -332,7 +332,8 @@ static int sil_set_mode(struct ata_link *link, struct ata_device **r_failed)
        return 0;
 }
 
-static inline void __iomem *sil_scr_addr(struct ata_port *ap, unsigned int sc_reg)
+static inline void __iomem *sil_scr_addr(struct ata_port *ap,
+                                        unsigned int sc_reg)
 {
        void __iomem *offset = ap->ioaddr.scr_addr;
 
@@ -643,7 +644,7 @@ static void sil_init_controller(struct ata_host *host)
        }
 }
 
-static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
+static int sil_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
        static int printed_version;
        int board_id = ent->driver_data;
index 26ebffc10f3e1254634d3ed9272e567ac4d33fe0..96fd5260446db812dbe938c903b4e47779dfc363 100644 (file)
@@ -63,6 +63,21 @@ enum {
        SIL24_HOST_BAR          = 0,
        SIL24_PORT_BAR          = 2,
 
+       /* sil24 fetches in chunks of 64bytes.  The first block
+        * contains the PRB and two SGEs.  From the second block, it's
+        * consisted of four SGEs and called SGT.  Calculate the
+        * number of SGTs that fit into one page.
+        */
+       SIL24_PRB_SZ            = sizeof(struct sil24_prb)
+                                 + 2 * sizeof(struct sil24_sge),
+       SIL24_MAX_SGT           = (PAGE_SIZE - SIL24_PRB_SZ)
+                                 / (4 * sizeof(struct sil24_sge)),
+
+       /* This will give us one unused SGEs for ATA.  This extra SGE
+        * will be used to store CDB for ATAPI devices.
+        */
+       SIL24_MAX_SGE           = 4 * SIL24_MAX_SGT + 1,
+
        /*
         * Global controller registers (128 bytes @ BAR0)
         */
@@ -247,13 +262,13 @@ enum {
 
 struct sil24_ata_block {
        struct sil24_prb prb;
-       struct sil24_sge sge[LIBATA_MAX_PRD];
+       struct sil24_sge sge[SIL24_MAX_SGE];
 };
 
 struct sil24_atapi_block {
        struct sil24_prb prb;
        u8 cdb[16];
-       struct sil24_sge sge[LIBATA_MAX_PRD - 1];
+       struct sil24_sge sge[SIL24_MAX_SGE];
 };
 
 union sil24_cmd_block {
@@ -265,11 +280,11 @@ static struct sil24_cerr_info {
        unsigned int err_mask, action;
        const char *desc;
 } sil24_cerr_db[] = {
-       [0]                     = { AC_ERR_DEV, ATA_EH_REVALIDATE,
+       [0]                     = { AC_ERR_DEV, 0,
                                    "device error" },
-       [PORT_CERR_DEV]         = { AC_ERR_DEV, ATA_EH_REVALIDATE,
+       [PORT_CERR_DEV]         = { AC_ERR_DEV, 0,
                                    "device error via D2H FIS" },
-       [PORT_CERR_SDB]         = { AC_ERR_DEV, ATA_EH_REVALIDATE,
+       [PORT_CERR_SDB]         = { AC_ERR_DEV, 0,
                                    "device error via SDB FIS" },
        [PORT_CERR_DATA]        = { AC_ERR_ATA_BUS, ATA_EH_SOFTRESET,
                                    "error in data FIS" },
@@ -378,7 +393,7 @@ static struct scsi_host_template sil24_sht = {
        .change_queue_depth     = ata_scsi_change_queue_depth,
        .can_queue              = SIL24_MAX_CMDS,
        .this_id                = ATA_SHT_THIS_ID,
-       .sg_tablesize           = LIBATA_MAX_PRD,
+       .sg_tablesize           = SIL24_MAX_SGE,
        .cmd_per_lun            = ATA_SHT_CMD_PER_LUN,
        .emulated               = ATA_SHT_EMULATED,
        .use_clustering         = ATA_SHT_USE_CLUSTERING,
@@ -674,7 +689,7 @@ static int sil24_do_softreset(struct ata_link *link, unsigned int *class,
 
        /* put the port into known state */
        if (sil24_init_port(ap)) {
-               reason ="port not ready";
+               reason = "port not ready";
                goto err;
        }
 
@@ -756,7 +771,8 @@ static int sil24_hardreset(struct ata_link *link, unsigned int *class,
 
        writel(PORT_CS_DEV_RST, port + PORT_CTRL_STAT);
        tmp = ata_wait_register(port + PORT_CTRL_STAT,
-                               PORT_CS_DEV_RST, PORT_CS_DEV_RST, 10, tout_msec);
+                               PORT_CS_DEV_RST, PORT_CS_DEV_RST, 10,
+                               tout_msec);
 
        /* SStatus oscillates between zero and valid status after
         * DEV_RST, debounce it.
@@ -1270,7 +1286,7 @@ static void sil24_init_controller(struct ata_host *host)
                                                PORT_CS_PORT_RST, 10, 100);
                        if (tmp & PORT_CS_PORT_RST)
                                dev_printk(KERN_ERR, host->dev,
-                                          "failed to clear port RST\n");
+                                          "failed to clear port RST\n");
                }
 
                /* configure port */
@@ -1283,7 +1299,8 @@ static void sil24_init_controller(struct ata_host *host)
 
 static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
-       static int printed_version = 0;
+       extern int __MARKER__sil24_cmd_block_is_sized_wrongly;
+       static int printed_version;
        struct ata_port_info pi = sil24_port_info[ent->driver_data];
        const struct ata_port_info *ppi[] = { &pi, NULL };
        void __iomem * const *iomap;
@@ -1291,6 +1308,10 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        int i, rc;
        u32 tmp;
 
+       /* cause link error if sil24_cmd_block is sized wrongly */
+       if (sizeof(union sil24_cmd_block) != PAGE_SIZE)
+               __MARKER__sil24_cmd_block_is_sized_wrongly = 1;
+
        if (!printed_version++)
                dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
 
index f147dc7bf464ff74f404440bb74c75df0f3ea622..a01260a564324490787c4a93cba20778cd4dbb8f 100644 (file)
@@ -63,17 +63,17 @@ enum {
        GENCTL_IOMAPPED_SCR     = (1 << 26), /* if set, SCRs are in IO space */
 };
 
-static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent);
-static int sis_scr_read (struct ata_port *ap, unsigned int sc_reg, u32 *val);
-static int sis_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val);
+static int sis_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
+static int sis_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val);
+static int sis_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val);
 
 static const struct pci_device_id sis_pci_tbl[] = {
-       { PCI_VDEVICE(SI, 0x0180), sis_180 },           /* SiS 964/180 */
-       { PCI_VDEVICE(SI, 0x0181), sis_180 },           /* SiS 964/180 */
-       { PCI_VDEVICE(SI, 0x0182), sis_180 },           /* SiS 965/965L */
-       { PCI_VDEVICE(SI, 0x0183), sis_180 },           /* SiS 965/965L */
-       { PCI_VDEVICE(SI, 0x1182), sis_180 },           /* SiS 966/680 */
-       { PCI_VDEVICE(SI, 0x1183), sis_180 },           /* SiS 966/966L/968/680 */
+       { PCI_VDEVICE(SI, 0x0180), sis_180 },   /* SiS 964/180 */
+       { PCI_VDEVICE(SI, 0x0181), sis_180 },   /* SiS 964/180 */
+       { PCI_VDEVICE(SI, 0x0182), sis_180 },   /* SiS 965/965L */
+       { PCI_VDEVICE(SI, 0x0183), sis_180 },   /* SiS 965/965L */
+       { PCI_VDEVICE(SI, 0x1182), sis_180 },   /* SiS 966/680 */
+       { PCI_VDEVICE(SI, 0x1183), sis_180 },   /* SiS 966/966L/968/680 */
 
        { }     /* terminate list */
 };
@@ -149,24 +149,24 @@ static unsigned int get_scr_cfg_addr(struct ata_port *ap, unsigned int sc_reg)
 
        if (ap->port_no)  {
                switch (pdev->device) {
-                       case 0x0180:
-                       case 0x0181:
-                               pci_read_config_byte(pdev, SIS_PMR, &pmr);
-                               if ((pmr & SIS_PMR_COMBINED) == 0)
-                                       addr += SIS180_SATA1_OFS;
-                               break;
-
-                       case 0x0182:
-                       case 0x0183:
-                       case 0x1182:
-                               addr += SIS182_SATA1_OFS;
-                               break;
+               case 0x0180:
+               case 0x0181:
+                       pci_read_config_byte(pdev, SIS_PMR, &pmr);
+                       if ((pmr & SIS_PMR_COMBINED) == 0)
+                               addr += SIS180_SATA1_OFS;
+                       break;
+
+               case 0x0182:
+               case 0x0183:
+               case 0x1182:
+                       addr += SIS182_SATA1_OFS;
+                       break;
                }
        }
        return addr;
 }
 
-static u32 sis_scr_cfg_read (struct ata_port *ap, unsigned int sc_reg, u32 *val)
+static u32 sis_scr_cfg_read(struct ata_port *ap, unsigned int sc_reg, u32 *val)
 {
        struct pci_dev *pdev = to_pci_dev(ap->host->dev);
        unsigned int cfg_addr = get_scr_cfg_addr(ap, sc_reg);
@@ -190,7 +190,7 @@ static u32 sis_scr_cfg_read (struct ata_port *ap, unsigned int sc_reg, u32 *val)
        return 0;
 }
 
-static void sis_scr_cfg_write (struct ata_port *ap, unsigned int sc_reg, u32 val)
+static void sis_scr_cfg_write(struct ata_port *ap, unsigned int sc_reg, u32 val)
 {
        struct pci_dev *pdev = to_pci_dev(ap->host->dev);
        unsigned int cfg_addr = get_scr_cfg_addr(ap, sc_reg);
@@ -253,7 +253,7 @@ static int sis_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val)
        return 0;
 }
 
-static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
+static int sis_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
        static int printed_version;
        struct ata_port_info pi = sis_port_info;
@@ -309,29 +309,33 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
                } else {
                        dev_printk(KERN_INFO, &pdev->dev,
                                   "Detected SiS 180/181 chipset in combined mode\n");
-                       port2_start=0;
+                       port2_start = 0;
                        pi.flags |= ATA_FLAG_SLAVE_POSS;
                }
                break;
 
        case 0x0182:
        case 0x0183:
-               pci_read_config_dword ( pdev, 0x6C, &val);
+               pci_read_config_dword(pdev, 0x6C, &val);
                if (val & (1L << 31)) {
-                       dev_printk(KERN_INFO, &pdev->dev, "Detected SiS 182/965 chipset\n");
+                       dev_printk(KERN_INFO, &pdev->dev,
+                                  "Detected SiS 182/965 chipset\n");
                        pi.flags |= ATA_FLAG_SLAVE_POSS;
                } else {
-                       dev_printk(KERN_INFO, &pdev->dev, "Detected SiS 182/965L chipset\n");
+                       dev_printk(KERN_INFO, &pdev->dev,
+                                  "Detected SiS 182/965L chipset\n");
                }
                break;
 
        case 0x1182:
-               dev_printk(KERN_INFO, &pdev->dev, "Detected SiS 1182/966/680 SATA controller\n");
+               dev_printk(KERN_INFO, &pdev->dev,
+                          "Detected SiS 1182/966/680 SATA controller\n");
                pi.flags |= ATA_FLAG_SLAVE_POSS;
                break;
 
        case 0x1183:
-               dev_printk(KERN_INFO, &pdev->dev, "Detected SiS 1183/966/966L/968/680 controller in PATA mode\n");
+               dev_printk(KERN_INFO, &pdev->dev,
+                          "Detected SiS 1183/966/966L/968/680 controller in PATA mode\n");
                ppi[0] = &sis_info133_for_sata;
                ppi[1] = &sis_info133_for_sata;
                break;
index 12d613c48c19100b101d3608dcca720b6cae22a2..69f651e0bc98dc9106917c9c46c90d6451da419a 100644 (file)
@@ -182,7 +182,7 @@ static void k2_sata_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
                tf->hob_lbal = lbal >> 8;
                tf->hob_lbam = lbam >> 8;
                tf->hob_lbah = lbah >> 8;
-        }
+       }
 }
 
 /**
@@ -193,7 +193,7 @@ static void k2_sata_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
  *     spin_lock_irqsave(host lock)
  */
 
-static void k2_bmdma_setup_mmio (struct ata_queued_cmd *qc)
+static void k2_bmdma_setup_mmio(struct ata_queued_cmd *qc)
 {
        struct ata_port *ap = qc->ap;
        unsigned int rw = (qc->tf.flags & ATA_TFLAG_WRITE);
@@ -224,7 +224,7 @@ static void k2_bmdma_setup_mmio (struct ata_queued_cmd *qc)
  *     spin_lock_irqsave(host lock)
  */
 
-static void k2_bmdma_start_mmio (struct ata_queued_cmd *qc)
+static void k2_bmdma_start_mmio(struct ata_queued_cmd *qc)
 {
        struct ata_port *ap = qc->ap;
        void __iomem *mmio = ap->ioaddr.bmdma_addr;
@@ -255,7 +255,7 @@ static void k2_bmdma_start_mmio (struct ata_queued_cmd *qc)
 
 static u8 k2_stat_check_status(struct ata_port *ap)
 {
-               return readl(ap->ioaddr.status_addr);
+       return readl(ap->ioaddr.status_addr);
 }
 
 #ifdef CONFIG_PPC_OF
@@ -395,7 +395,7 @@ static void k2_sata_setup_port(struct ata_ioports *port, void __iomem *base)
 }
 
 
-static int k2_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
+static int k2_sata_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
        static int printed_version;
        const struct ata_port_info *ppi[] =
index b6026bceccd1628325ab2b2a6953196059932b5c..4d857185f33b2627cdfc43b52cea1b2f9848ecac 100644 (file)
@@ -212,9 +212,9 @@ struct pdc_host_priv {
 };
 
 
-static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *ent);
+static int pdc_sata_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
 static void pdc_eng_timeout(struct ata_port *ap);
-static void pdc_20621_phy_reset (struct ata_port *ap);
+static void pdc_20621_phy_reset(struct ata_port *ap);
 static int pdc_port_start(struct ata_port *ap);
 static void pdc20621_qc_prep(struct ata_queued_cmd *qc);
 static void pdc_tf_load_mmio(struct ata_port *ap, const struct ata_taskfile *tf);
@@ -320,16 +320,16 @@ static int pdc_port_start(struct ata_port *ap)
        return 0;
 }
 
-static void pdc_20621_phy_reset (struct ata_port *ap)
+static void pdc_20621_phy_reset(struct ata_port *ap)
 {
        VPRINTK("ENTER\n");
-        ap->cbl = ATA_CBL_SATA;
-        ata_port_probe(ap);
-        ata_bus_reset(ap);
+       ap->cbl = ATA_CBL_SATA;
+       ata_port_probe(ap);
+       ata_bus_reset(ap);
 }
 
 static inline void pdc20621_ata_sg(struct ata_taskfile *tf, u8 *buf,
-                                          unsigned int portno,
+                                  unsigned int portno,
                                           unsigned int total_len)
 {
        u32 addr;
@@ -351,7 +351,7 @@ static inline void pdc20621_ata_sg(struct ata_taskfile *tf, u8 *buf,
 }
 
 static inline void pdc20621_host_sg(struct ata_taskfile *tf, u8 *buf,
-                                           unsigned int portno,
+                                   unsigned int portno,
                                            unsigned int total_len)
 {
        u32 addr;
@@ -711,8 +711,8 @@ static unsigned int pdc20621_qc_issue_prot(struct ata_queued_cmd *qc)
        return ata_qc_issue_prot(qc);
 }
 
-static inline unsigned int pdc20621_host_intr( struct ata_port *ap,
-                                          struct ata_queued_cmd *qc,
+static inline unsigned int pdc20621_host_intr(struct ata_port *ap,
+                                         struct ata_queued_cmd *qc,
                                          unsigned int doing_hdma,
                                          void __iomem *mmio)
 {
@@ -803,7 +803,7 @@ static void pdc20621_irq_clear(struct ata_port *ap)
        readl(mmio + PDC_20621_SEQMASK);
 }
 
-static irqreturn_t pdc20621_interrupt (int irq, void *dev_instance)
+static irqreturn_t pdc20621_interrupt(int irq, void *dev_instance)
 {
        struct ata_host *host = dev_instance;
        struct ata_port *ap;
@@ -836,9 +836,9 @@ static irqreturn_t pdc20621_interrupt (int irq, void *dev_instance)
                return IRQ_NONE;
        }
 
-        spin_lock(&host->lock);
+       spin_lock(&host->lock);
 
-        for (i = 1; i < 9; i++) {
+       for (i = 1; i < 9; i++) {
                port_no = i - 1;
                if (port_no > 3)
                        port_no -= 4;
@@ -859,7 +859,7 @@ static irqreturn_t pdc20621_interrupt (int irq, void *dev_instance)
                }
        }
 
-        spin_unlock(&host->lock);
+       spin_unlock(&host->lock);
 
        VPRINTK("mask == 0x%x\n", mask);
 
@@ -906,16 +906,16 @@ static void pdc_eng_timeout(struct ata_port *ap)
 
 static void pdc_tf_load_mmio(struct ata_port *ap, const struct ata_taskfile *tf)
 {
-       WARN_ON (tf->protocol == ATA_PROT_DMA ||
-                tf->protocol == ATA_PROT_NODATA);
+       WARN_ON(tf->protocol == ATA_PROT_DMA ||
+               tf->protocol == ATA_PROT_NODATA);
        ata_tf_load(ap, tf);
 }
 
 
 static void pdc_exec_command_mmio(struct ata_port *ap, const struct ata_taskfile *tf)
 {
-       WARN_ON (tf->protocol == ATA_PROT_DMA ||
-                tf->protocol == ATA_PROT_NODATA);
+       WARN_ON(tf->protocol == ATA_PROT_DMA ||
+               tf->protocol == ATA_PROT_NODATA);
        ata_exec_command(ap, tf);
 }
 
@@ -953,7 +953,7 @@ static void pdc20621_get_from_dimm(struct ata_host *host, void *psource,
        mmio += PDC_CHIP0_OFS;
 
        page_mask = 0x00;
-       window_size = 0x2000 * 4; /* 32K byte uchar size */
+       window_size = 0x2000 * 4; /* 32K byte uchar size */
        idx = (u16) (offset / window_size);
 
        writel(0x01, mmio + PDC_GENERAL_CTLR);
@@ -979,7 +979,7 @@ static void pdc20621_get_from_dimm(struct ata_host *host, void *psource,
                              window_size / 4);
                psource += window_size;
                size -= window_size;
-               idx ++;
+               idx++;
        }
 
        if (size) {
@@ -1008,7 +1008,7 @@ static void pdc20621_put_to_dimm(struct ata_host *host, void *psource,
        mmio += PDC_CHIP0_OFS;
 
        page_mask = 0x00;
-       window_size = 0x2000 * 4;       /* 32K byte uchar size */
+       window_size = 0x2000 * 4;       /* 32K byte uchar size */
        idx = (u16) (offset / window_size);
 
        writel(((idx) << page_mask), mmio + PDC_DIMM_WINDOW_CTLR);
@@ -1031,7 +1031,7 @@ static void pdc20621_put_to_dimm(struct ata_host *host, void *psource,
                readl(mmio + PDC_GENERAL_CTLR);
                psource += window_size;
                size -= window_size;
-               idx ++;
+               idx++;
        }
 
        if (size) {
@@ -1050,7 +1050,7 @@ static unsigned int pdc20621_i2c_read(struct ata_host *host, u32 device,
        void __iomem *mmio = host->iomap[PDC_MMIO_BAR];
        u32 i2creg  = 0;
        u32 status;
-       u32 count =0;
+       u32 count = 0;
 
        /* hard-code chip #0 */
        mmio += PDC_CHIP0_OFS;
@@ -1082,21 +1082,21 @@ static unsigned int pdc20621_i2c_read(struct ata_host *host, u32 device,
 
 static int pdc20621_detect_dimm(struct ata_host *host)
 {
-       u32 data=0 ;
+       u32 data = 0;
        if (pdc20621_i2c_read(host, PDC_DIMM0_SPD_DEV_ADDRESS,
                             PDC_DIMM_SPD_SYSTEM_FREQ, &data)) {
-               if (data == 100)
+               if (data == 100)
                        return 100;
-       } else
+       } else
                return 0;
 
        if (pdc20621_i2c_read(host, PDC_DIMM0_SPD_DEV_ADDRESS, 9, &data)) {
-               if(data <= 0x75)
+               if (data <= 0x75)
                        return 133;
-       } else
+       } else
                return 0;
 
-       return 0;
+       return 0;
 }
 
 
@@ -1104,8 +1104,8 @@ static int pdc20621_prog_dimm0(struct ata_host *host)
 {
        u32 spd0[50];
        u32 data = 0;
-       int size, i;
-       u8 bdimmsize;
+       int size, i;
+       u8 bdimmsize;
        void __iomem *mmio = host->iomap[PDC_MMIO_BAR];
        static const struct {
                unsigned int reg;
@@ -1128,40 +1128,40 @@ static int pdc20621_prog_dimm0(struct ata_host *host)
        /* hard-code chip #0 */
        mmio += PDC_CHIP0_OFS;
 
-       for(i=0; i<ARRAY_SIZE(pdc_i2c_read_data); i++)
+       for (i = 0; i < ARRAY_SIZE(pdc_i2c_read_data); i++)
                pdc20621_i2c_read(host, PDC_DIMM0_SPD_DEV_ADDRESS,
                                  pdc_i2c_read_data[i].reg,
                                  &spd0[pdc_i2c_read_data[i].ofs]);
 
-       data |= (spd0[4] - 8) | ((spd0[21] != 0) << 3) | ((spd0[3]-11) << 4);
-       data |= ((spd0[17] / 4) << 6) | ((spd0[5] / 2) << 7) |
+       data |= (spd0[4] - 8) | ((spd0[21] != 0) << 3) | ((spd0[3]-11) << 4);
+       data |= ((spd0[17] / 4) << 6) | ((spd0[5] / 2) << 7) |
                ((((spd0[27] + 9) / 10) - 1) << 8) ;
-       data |= (((((spd0[29] > spd0[28])
+       data |= (((((spd0[29] > spd0[28])
                    ? spd0[29] : spd0[28]) + 9) / 10) - 1) << 10;
-       data |= ((spd0[30] - spd0[29] + 9) / 10 - 2) << 12;
+       data |= ((spd0[30] - spd0[29] + 9) / 10 - 2) << 12;
 
-       if (spd0[18] & 0x08)
+       if (spd0[18] & 0x08)
                data |= ((0x03) << 14);
-       else if (spd0[18] & 0x04)
+       else if (spd0[18] & 0x04)
                data |= ((0x02) << 14);
-       else if (spd0[18] & 0x01)
+       else if (spd0[18] & 0x01)
                data |= ((0x01) << 14);
-       else
+       else
                data |= (0 << 14);
 
-       /*
+       /*
           Calculate the size of bDIMMSize (power of 2) and
           merge the DIMM size by program start/end address.
        */
 
-       bdimmsize = spd0[4] + (spd0[5] / 2) + spd0[3] + (spd0[17] / 2) + 3;
-       size = (1 << bdimmsize) >> 20;  /* size = xxx(MB) */
-       data |= (((size / 16) - 1) << 16);
-       data |= (0 << 23);
+       bdimmsize = spd0[4] + (spd0[5] / 2) + spd0[3] + (spd0[17] / 2) + 3;
+       size = (1 << bdimmsize) >> 20;  /* size = xxx(MB) */
+       data |= (((size / 16) - 1) << 16);
+       data |= (0 << 23);
        data |= 8;
-       writel(data, mmio + PDC_DIMM0_CONTROL);
+       writel(data, mmio + PDC_DIMM0_CONTROL);
        readl(mmio + PDC_DIMM0_CONTROL);
-       return size;
+       return size;
 }
 
 
@@ -1172,9 +1172,9 @@ static unsigned int pdc20621_prog_dimm_global(struct ata_host *host)
        void __iomem *mmio = host->iomap[PDC_MMIO_BAR];
 
        /* hard-code chip #0 */
-       mmio += PDC_CHIP0_OFS;
+       mmio += PDC_CHIP0_OFS;
 
-       /*
+       /*
          Set To Default : DIMM Module Global Control Register (0x022259F1)
          DIMM Arbitration Disable (bit 20)
          DIMM Data/Control Output Driving Selection (bit12 - bit15)
@@ -1193,40 +1193,40 @@ static unsigned int pdc20621_prog_dimm_global(struct ata_host *host)
                writel(data, mmio + PDC_SDRAM_CONTROL);
                readl(mmio + PDC_SDRAM_CONTROL);
                printk(KERN_ERR "Local DIMM ECC Enabled\n");
-       }
+       }
 
-       /* DIMM Initialization Select/Enable (bit 18/19) */
-       data &= (~(1<<18));
-       data |= (1<<19);
-       writel(data, mmio + PDC_SDRAM_CONTROL);
+       /* DIMM Initialization Select/Enable (bit 18/19) */
+       data &= (~(1<<18));
+       data |= (1<<19);
+       writel(data, mmio + PDC_SDRAM_CONTROL);
 
-       error = 1;
-       for (i = 1; i <= 10; i++) {   /* polling ~5 secs */
+       error = 1;
+       for (i = 1; i <= 10; i++) {   /* polling ~5 secs */
                data = readl(mmio + PDC_SDRAM_CONTROL);
                if (!(data & (1<<19))) {
-                       error = 0;
-                       break;
+                       error = 0;
+                       break;
                }
                msleep(i*100);
-       }
-       return error;
+       }
+       return error;
 }
 
 
 static unsigned int pdc20621_dimm_init(struct ata_host *host)
 {
        int speed, size, length;
-       u32 addr,spd0,pci_status;
-       u32 tmp=0;
-       u32 time_period=0;
-       u32 tcount=0;
-       u32 ticks=0;
-       u32 clock=0;
-       u32 fparam=0;
+       u32 addr, spd0, pci_status;
+       u32 tmp = 0;
+       u32 time_period = 0;
+       u32 tcount = 0;
+       u32 ticks = 0;
+       u32 clock = 0;
+       u32 fparam = 0;
        void __iomem *mmio = host->iomap[PDC_MMIO_BAR];
 
        /* hard-code chip #0 */
-       mmio += PDC_CHIP0_OFS;
+       mmio += PDC_CHIP0_OFS;
 
        /* Initialize PLL based upon PCI Bus Frequency */
 
@@ -1254,7 +1254,7 @@ static unsigned int pdc20621_dimm_init(struct ata_host *host)
           If SX4 is on PCI-X bus, after 3 seconds, the timer counter
           register should be >= (0xffffffff - 3x10^8).
        */
-       if(tcount >= PCI_X_TCOUNT) {
+       if (tcount >= PCI_X_TCOUNT) {
                ticks = (time_period - tcount);
                VPRINTK("Num counters 0x%x (%d)\n", ticks, ticks);
 
@@ -1285,41 +1285,43 @@ static unsigned int pdc20621_dimm_init(struct ata_host *host)
        if (!(speed = pdc20621_detect_dimm(host))) {
                printk(KERN_ERR "Detect Local DIMM Fail\n");
                return 1;       /* DIMM error */
-       }
-       VPRINTK("Local DIMM Speed = %d\n", speed);
+       }
+       VPRINTK("Local DIMM Speed = %d\n", speed);
 
-       /* Programming DIMM0 Module Control Register (index_CID0:80h) */
+       /* Programming DIMM0 Module Control Register (index_CID0:80h) */
        size = pdc20621_prog_dimm0(host);
-       VPRINTK("Local DIMM Size = %dMB\n",size);
+       VPRINTK("Local DIMM Size = %dMB\n", size);
 
-       /* Programming DIMM Module Global Control Register (index_CID0:88h) */
+       /* Programming DIMM Module Global Control Register (index_CID0:88h) */
        if (pdc20621_prog_dimm_global(host)) {
                printk(KERN_ERR "Programming DIMM Module Global Control Register Fail\n");
                return 1;
-       }
+       }
 
 #ifdef ATA_VERBOSE_DEBUG
        {
-               u8 test_parttern1[40] = {0x55,0xAA,'P','r','o','m','i','s','e',' ',
-                               'N','o','t',' ','Y','e','t',' ','D','e','f','i','n','e','d',' ',
-                                '1','.','1','0',
-                               '9','8','0','3','1','6','1','2',0,0};
+               u8 test_parttern1[40] =
+                       {0x55,0xAA,'P','r','o','m','i','s','e',' ',
+                       'N','o','t',' ','Y','e','t',' ',
+                       'D','e','f','i','n','e','d',' ',
+                       '1','.','1','0',
+                       '9','8','0','3','1','6','1','2',0,0};
                u8 test_parttern2[40] = {0};
 
-               pdc20621_put_to_dimm(host, (void *) test_parttern2, 0x10040, 40);
-               pdc20621_put_to_dimm(host, (void *) test_parttern2, 0x40, 40);
+               pdc20621_put_to_dimm(host, test_parttern2, 0x10040, 40);
+               pdc20621_put_to_dimm(host, test_parttern2, 0x40, 40);
 
-               pdc20621_put_to_dimm(host, (void *) test_parttern1, 0x10040, 40);
-               pdc20621_get_from_dimm(host, (void *) test_parttern2, 0x40, 40);
+               pdc20621_put_to_dimm(host, test_parttern1, 0x10040, 40);
+               pdc20621_get_from_dimm(host, test_parttern2, 0x40, 40);
                printk(KERN_ERR "%x, %x, %s\n", test_parttern2[0],
                       test_parttern2[1], &(test_parttern2[2]));
-               pdc20621_get_from_dimm(host, (void *) test_parttern2, 0x10040,
+               pdc20621_get_from_dimm(host, test_parttern2, 0x10040,
                                       40);
                printk(KERN_ERR "%x, %x, %s\n", test_parttern2[0],
                       test_parttern2[1], &(test_parttern2[2]));
 
-               pdc20621_put_to_dimm(host, (void *) test_parttern1, 0x40, 40);
-               pdc20621_get_from_dimm(host, (void *) test_parttern2, 0x40, 40);
+               pdc20621_put_to_dimm(host, test_parttern1, 0x40, 40);
+               pdc20621_get_from_dimm(host, test_parttern2, 0x40, 40);
                printk(KERN_ERR "%x, %x, %s\n", test_parttern2[0],
                       test_parttern2[1], &(test_parttern2[2]));
        }
@@ -1375,7 +1377,8 @@ static void pdc_20621_init(struct ata_host *host)
        readl(mmio + PDC_HDMA_CTLSTAT);         /* flush */
 }
 
-static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
+static int pdc_sata_init_one(struct pci_dev *pdev,
+                            const struct pci_device_id *ent)
 {
        static int printed_version;
        const struct ata_port_info *ppi[] =
index d394da085ae45e57f3909560a1d18e02be809b80..e710e71b7b92ca89da03b14c1266d83dacc7dd19 100644 (file)
@@ -56,9 +56,9 @@ struct uli_priv {
        unsigned int            scr_cfg_addr[uli_max_ports];
 };
 
-static int uli_init_one (struct pci_dev *pdev, const struct pci_device_id *ent);
-static int uli_scr_read (struct ata_port *ap, unsigned int sc_reg, u32 *val);
-static int uli_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val);
+static int uli_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
+static int uli_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val);
+static int uli_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val);
 
 static const struct pci_device_id uli_pci_tbl[] = {
        { PCI_VDEVICE(AL, 0x5289), uli_5289 },
@@ -143,7 +143,7 @@ static unsigned int get_scr_cfg_addr(struct ata_port *ap, unsigned int sc_reg)
        return hpriv->scr_cfg_addr[ap->port_no] + (4 * sc_reg);
 }
 
-static u32 uli_scr_cfg_read (struct ata_port *ap, unsigned int sc_reg)
+static u32 uli_scr_cfg_read(struct ata_port *ap, unsigned int sc_reg)
 {
        struct pci_dev *pdev = to_pci_dev(ap->host->dev);
        unsigned int cfg_addr = get_scr_cfg_addr(ap, sc_reg);
@@ -153,7 +153,7 @@ static u32 uli_scr_cfg_read (struct ata_port *ap, unsigned int sc_reg)
        return val;
 }
 
-static void uli_scr_cfg_write (struct ata_port *ap, unsigned int scr, u32 val)
+static void uli_scr_cfg_write(struct ata_port *ap, unsigned int scr, u32 val)
 {
        struct pci_dev *pdev = to_pci_dev(ap->host->dev);
        unsigned int cfg_addr = get_scr_cfg_addr(ap, scr);
@@ -161,7 +161,7 @@ static void uli_scr_cfg_write (struct ata_port *ap, unsigned int scr, u32 val)
        pci_write_config_dword(pdev, cfg_addr, val);
 }
 
-static int uli_scr_read (struct ata_port *ap, unsigned int sc_reg, u32 *val)
+static int uli_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val)
 {
        if (sc_reg > SCR_CONTROL)
                return -EINVAL;
@@ -170,16 +170,16 @@ static int uli_scr_read (struct ata_port *ap, unsigned int sc_reg, u32 *val)
        return 0;
 }
 
-static int uli_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val)
+static int uli_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val)
 {
-       if (sc_reg > SCR_CONTROL)       //SCR_CONTROL=2, SCR_ERROR=1, SCR_STATUS=0
+       if (sc_reg > SCR_CONTROL) //SCR_CONTROL=2, SCR_ERROR=1, SCR_STATUS=0
                return -EINVAL;
 
        uli_scr_cfg_write(ap, sc_reg, val);
        return 0;
 }
 
-static int uli_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
+static int uli_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
        static int printed_version;
        const struct ata_port_info *ppi[] = { &uli_port_info, NULL };
index cc6ee0890f56c1ddcb24581bbad7bbc27ae2640e..3ef072ff319d28b8514e9ade2fde843d1a23ad2f 100644 (file)
@@ -3,7 +3,7 @@
  *
  *  Maintained by:  Jeff Garzik <jgarzik@pobox.com>
  *                Please ALWAYS copy linux-ide@vger.kernel.org
                 on emails.
*                on emails.
  *
  *  Copyright 2003-2004 Red Hat, Inc.  All rights reserved.
  *  Copyright 2003-2004 Jeff Garzik
@@ -69,7 +69,7 @@ enum {
        SATA_EXT_PHY            = (1 << 6), /* 0==use PATA, 1==ext phy */
 };
 
-static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent);
+static int svia_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
 static int svia_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val);
 static int svia_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val);
 static void svia_noop_freeze(struct ata_port *ap);
@@ -372,12 +372,12 @@ static const unsigned int vt6421_bar_sizes[] = {
        16, 16, 16, 16, 32, 128
 };
 
-static void __iomem * svia_scr_addr(void __iomem *addr, unsigned int port)
+static void __iomem *svia_scr_addr(void __iomem *addr, unsigned int port)
 {
        return addr + (port * 128);
 }
 
-static void __iomem * vt6421_scr_addr(void __iomem *addr, unsigned int port)
+static void __iomem *vt6421_scr_addr(void __iomem *addr, unsigned int port)
 {
        return addr + (port * 64);
 }
@@ -472,7 +472,7 @@ static void svia_configure(struct pci_dev *pdev)
        if ((tmp8 & ALL_PORTS) != ALL_PORTS) {
                dev_printk(KERN_DEBUG, &pdev->dev,
                           "enabling SATA channels (0x%x)\n",
-                          (int) tmp8);
+                          (int) tmp8);
                tmp8 |= ALL_PORTS;
                pci_write_config_byte(pdev, SATA_CHAN_ENAB, tmp8);
        }
@@ -482,7 +482,7 @@ static void svia_configure(struct pci_dev *pdev)
        if ((tmp8 & ALL_PORTS) != ALL_PORTS) {
                dev_printk(KERN_DEBUG, &pdev->dev,
                           "enabling SATA channel interrupts (0x%x)\n",
-                          (int) tmp8);
+                          (int) tmp8);
                tmp8 |= ALL_PORTS;
                pci_write_config_byte(pdev, SATA_INT_GATE, tmp8);
        }
@@ -492,13 +492,13 @@ static void svia_configure(struct pci_dev *pdev)
        if ((tmp8 & NATIVE_MODE_ALL) != NATIVE_MODE_ALL) {
                dev_printk(KERN_DEBUG, &pdev->dev,
                           "enabling SATA channel native mode (0x%x)\n",
-                          (int) tmp8);
+                          (int) tmp8);
                tmp8 |= NATIVE_MODE_ALL;
                pci_write_config_byte(pdev, SATA_NATIVE_MODE, tmp8);
        }
 }
 
-static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
+static int svia_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
        static int printed_version;
        unsigned int i;
@@ -525,8 +525,8 @@ static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
                        dev_printk(KERN_ERR, &pdev->dev,
                                "invalid PCI BAR %u (sz 0x%llx, val 0x%llx)\n",
                                i,
-                               (unsigned long long)pci_resource_start(pdev, i),
-                               (unsigned long long)pci_resource_len(pdev, i));
+                               (unsigned long long)pci_resource_start(pdev, i),
+                               (unsigned long long)pci_resource_len(pdev, i));
                        return -ENODEV;
                }
 
index 0d9be168487326504ba799b38bab2091c1ed4ab2..95ae3ed24a9dd39eb6b223e87dbb16b918ba2108 100644 (file)
@@ -162,7 +162,8 @@ static void vsc_sata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf)
        /*
         * The only thing the ctl register is used for is SRST.
         * That is not enabled or disabled via tf_load.
-        * However, if ATA_NIEN is changed, then we need to change the interrupt register.
+        * However, if ATA_NIEN is changed, then we need to change
+        * the interrupt register.
         */
        if ((tf->ctl & ATA_NIEN) != (ap->last_ctl & ATA_NIEN)) {
                ap->last_ctl = tf->ctl;
@@ -219,7 +220,7 @@ static void vsc_sata_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
                tf->hob_lbal = lbal >> 8;
                tf->hob_lbam = lbam >> 8;
                tf->hob_lbah = lbah >> 8;
-        }
+       }
 }
 
 static inline void vsc_error_intr(u8 port_status, struct ata_port *ap)
@@ -256,9 +257,10 @@ static void vsc_port_intr(u8 port_status, struct ata_port *ap)
 /*
  * vsc_sata_interrupt
  *
- * Read the interrupt register and process for the devices that have them pending.
+ * Read the interrupt register and process for the devices that have
+ * them pending.
  */
-static irqreturn_t vsc_sata_interrupt (int irq, void *dev_instance)
+static irqreturn_t vsc_sata_interrupt(int irq, void *dev_instance)
 {
        struct ata_host *host = dev_instance;
        unsigned int i;
@@ -287,7 +289,7 @@ static irqreturn_t vsc_sata_interrupt (int irq, void *dev_instance)
                                handled++;
                        } else
                                dev_printk(KERN_ERR, host->dev,
-                                       "interrupt from disabled port %d\n", i);
+                                       "interrupt from disabled port %d\n", i);
                }
        }
 
@@ -363,7 +365,8 @@ static void __devinit vsc_sata_setup_port(struct ata_ioports *port,
 }
 
 
-static int __devinit vsc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
+static int __devinit vsc_sata_init_one(struct pci_dev *pdev,
+                                      const struct pci_device_id *ent)
 {
        static const struct ata_port_info pi = {
                .flags          = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
index d33aba6864c247e34a05f3dd94db131a2c62fc50..3b64a99772ea826187dbc792875332722f77f94b 100644 (file)
@@ -394,6 +394,11 @@ he_init_one(struct pci_dev *pci_dev, const struct pci_device_id *pci_ent)
        he_dev->atm_dev->dev_data = he_dev;
        atm_dev->dev_data = he_dev;
        he_dev->number = atm_dev->number;
+#ifdef USE_TASKLET
+       tasklet_init(&he_dev->tasklet, he_tasklet, (unsigned long) he_dev);
+#endif
+       spin_lock_init(&he_dev->global_lock);
+
        if (he_start(atm_dev)) {
                he_stop(he_dev);
                err = -ENODEV;
@@ -1173,11 +1178,6 @@ he_start(struct atm_dev *dev)
        if ((err = he_init_irq(he_dev)) != 0)
                return err;
 
-#ifdef USE_TASKLET
-       tasklet_init(&he_dev->tasklet, he_tasklet, (unsigned long) he_dev);
-#endif
-       spin_lock_init(&he_dev->global_lock);
-
        /* 4.11 enable pci bus controller state machines */
        host_cntl |= (OUTFF_ENB | CMDFF_ENB |
                                QUICK_RD_RETRY | QUICK_WR_RETRY | PERR_INT_ENB);
index c1343414d285e29f57fe17e089e635be20af3aed..3f4d6aa139909e49ac77541bdd8b94f46979dae2 100644 (file)
@@ -1228,18 +1228,18 @@ int device_rename(struct device *dev, char *new_name)
                        sysfs_remove_link(&dev->parent->kobj, old_class_name);
                }
        }
-#endif
-
+#else
        if (dev->class) {
                sysfs_remove_link(&dev->class->subsys.kobj, old_device_name);
                error = sysfs_create_link(&dev->class->subsys.kobj, &dev->kobj,
                                          dev->bus_id);
                if (error) {
-                       /* Uh... how to unravel this if restoring can fail? */
                        dev_err(dev, "%s: sysfs_create_symlink failed (%d)\n",
                                __FUNCTION__, error);
                }
        }
+#endif
+
 out:
        put_device(dev);
 
index 5beddc322e6f86f0df9c43b1207f5cef8aad753a..b5034dc72a05f7f5d111692bcab3929af0b009da 100644 (file)
@@ -2,7 +2,6 @@
 #include <linux/device.h>
 #include <linux/mm.h>
 #include <asm/io.h>            /* Needed for i386 to build */
-#include <asm/scatterlist.h>   /* Needed for i386 to build */
 #include <linux/dma-mapping.h>
 #include <linux/dmapool.h>
 #include <linux/slab.h>
index 5a6fe17fc6382bec43217bb11ce8a316f20e804a..7d704968765f308ac87726e310c64242e96db8fc 100644 (file)
@@ -1,20 +1,20 @@
 /*
- *    Disk Array driver for HP SA 5xxx and 6xxx Controllers
- *    Copyright 2000, 2006 Hewlett-Packard Development Company, L.P.
+ *    Disk Array driver for HP Smart Array controllers.
+ *    (C) Copyright 2000, 2007 Hewlett-Packard Development Company, L.P.
  *
  *    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.
+ *    the Free Software Foundation; version 2 of the License.
  *
  *    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, GOOD TITLE or
- *    NON INFRINGEMENT.  See the GNU General Public License for more details.
+ *    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.
+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ *    02111-1307, USA.
  *
  *    Questions/Comments/Bugfixes to iss_storagedev@hp.com
  *
index 4aca7ddfdddf9c242730d9cb625eb7b23486f4c3..63ee6c076cb3ec61771c05b2743998a9a4da1b49 100644 (file)
@@ -1,20 +1,20 @@
 /*
- *    Disk Array driver for Compaq SA53xx Controllers, SCSI Tape module
- *    Copyright 2001 Compaq Computer Corporation
+ *    Disk Array driver for HP Smart Array controllers, SCSI Tape module.
+ *    (C) Copyright 2001, 2007 Hewlett-Packard Development Company, L.P.
  *
  *    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.
+ *    the Free Software Foundation; version 2 of the License.
  *
  *    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, GOOD TITLE or
- *    NON INFRINGEMENT.  See the GNU General Public License for more details.
+ *    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.
+ *    Foundation, Inc., 59 Temple Place, Suite 300, Boston, MA
+ *    02111-1307, USA.
  *
  *    Questions/Comments/Bugfixes to iss_storagedev@hp.com
  *    
index 5e7e06c07d6c8cfcbcc022072e2d3110b50b66a9..d9c2c586502fbc224d19bc3f4ddc2b075f7e9e02 100644 (file)
@@ -1,20 +1,20 @@
 /*
- *    Disk Array driver for Compaq SA53xx Controllers, SCSI Tape module
- *    Copyright 2001 Compaq Computer Corporation
+ *    Disk Array driver for HP Smart Array controllers, SCSI Tape module.
+ *    (C) Copyright 2001, 2007 Hewlett-Packard Development Company, L.P.
  *
  *    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.
+ *    the Free Software Foundation; version 2 of the License.
  *
  *    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, GOOD TITLE or
- *    NON INFRINGEMENT.  See the GNU General Public License for more details.
+ *    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.
+ *    Foundation, Inc., 59 Temple Place, Suite 300, Boston, MA
+ *    02111-1307, USA.
  *
  *    Questions/Comments/Bugfixes to iss_storagedev@hp.com
  *
index 6332acad078c5f6976854b0f394e3496dc1f4e81..b4c0888aedc3113c8eb442726a4237c9f7d9dd92 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/err.h>
 #include <linux/kernel.h>
 #include <net/sock.h>
+#include <linux/net.h>
 
 #include <asm/uaccess.h>
 #include <asm/system.h>
@@ -126,7 +127,7 @@ static void sock_shutdown(struct nbd_device *lo, int lock)
        if (lo->sock) {
                printk(KERN_WARNING "%s: shutting down socket\n",
                        lo->disk->disk_name);
-               lo->sock->ops->shutdown(lo->sock, SEND_SHUTDOWN|RCV_SHUTDOWN);
+               kernel_sock_shutdown(lo->sock, SHUT_RDWR);
                lo->sock = NULL;
        }
        if (lock)
index ceffa6034e2044f81340a3fadb2241f9053d0abf..e7fe6ca97dd8a4027142a763bcc8cdc4018e52f4 100644 (file)
@@ -488,13 +488,11 @@ static int pf_atapi(struct pf_unit *pf, char *cmd, int dlen, char *buf, char *fu
        return r;
 }
 
-#define DBMSG(msg)      ((verbose>1)?(msg):NULL)
-
 static void pf_lock(struct pf_unit *pf, int func)
 {
        char lo_cmd[12] = { ATAPI_LOCK, pf->lun << 5, 0, 0, func, 0, 0, 0, 0, 0, 0, 0 };
 
-       pf_atapi(pf, lo_cmd, 0, pf_scratch, func ? "unlock" : "lock");
+       pf_atapi(pf, lo_cmd, 0, pf_scratch, func ? "lock" : "unlock");
 }
 
 static void pf_eject(struct pf_unit *pf)
@@ -555,7 +553,7 @@ static void pf_mode_sense(struct pf_unit *pf)
            { ATAPI_MODE_SENSE, pf->lun << 5, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0 };
        char buf[8];
 
-       pf_atapi(pf, ms_cmd, 8, buf, DBMSG("mode sense"));
+       pf_atapi(pf, ms_cmd, 8, buf, "mode sense");
        pf->media_status = PF_RW;
        if (buf[3] & 0x80)
                pf->media_status = PF_RO;
@@ -591,7 +589,7 @@ static void pf_get_capacity(struct pf_unit *pf)
        char buf[8];
        int bs;
 
-       if (pf_atapi(pf, rc_cmd, 8, buf, DBMSG("get capacity"))) {
+       if (pf_atapi(pf, rc_cmd, 8, buf, "get capacity")) {
                pf->media_status = PF_NM;
                return;
        }
@@ -804,13 +802,18 @@ static int pf_next_buf(void)
        pf_buf += 512;
        pf_block++;
        if (!pf_run)
-               return 0;
-       if (!pf_count)
                return 1;
-       spin_lock_irqsave(&pf_spin_lock, saved_flags);
-       pf_end_request(1);
-       spin_unlock_irqrestore(&pf_spin_lock, saved_flags);
-       return 1;
+       if (!pf_count) {
+               spin_lock_irqsave(&pf_spin_lock, saved_flags);
+               pf_end_request(1);
+               pf_req = elv_next_request(pf_queue);
+               spin_unlock_irqrestore(&pf_spin_lock, saved_flags);
+               if (!pf_req)
+                       return 1;
+               pf_count = pf_req->current_nr_sectors;
+               pf_buf = pf_req->buffer;
+       }
+       return 0;
 }
 
 static inline void next_request(int success)
index 9f4e67ee1eb0628917155e99c31810bcbb4a6404..b91accf12656581066811fa68c18e78cfb655018 100644 (file)
@@ -664,7 +664,7 @@ static int pt_open(struct inode *inode, struct file *file)
                goto out;
 
        err = -EROFS;
-       if ((!tape->flags & PT_WRITE_OK) && (file->f_mode & 2))
+       if ((!(tape->flags & PT_WRITE_OK)) && (file->f_mode & 2))
                goto out;
 
        if (!(iminor(inode) & 128))
index a8130a4ad6d4329572b722b2947059db776fa8e2..a5ee21319d37fa2633bd5625099fb429a5c353ca 100644 (file)
@@ -358,10 +358,19 @@ static ssize_t class_pktcdvd_store_add(struct class *c, const char *buf,
                                        size_t count)
 {
        unsigned int major, minor;
+
        if (sscanf(buf, "%u:%u", &major, &minor) == 2) {
+               /* pkt_setup_dev() expects caller to hold reference to self */
+               if (!try_module_get(THIS_MODULE))
+                       return -ENODEV;
+
                pkt_setup_dev(MKDEV(major, minor), NULL);
+
+               module_put(THIS_MODULE);
+
                return count;
        }
+
        return -EINVAL;
 }
 
index 47f8ac6cce574c81b1e845099000e019a0098468..82f4eecc8699d19e42e899b043e2c45842cdbcc1 100644 (file)
@@ -189,6 +189,18 @@ static int ramdisk_set_page_dirty(struct page *page)
        return 0;
 }
 
+/*
+ * releasepage is called by pagevec_strip/try_to_release_page if
+ * buffers_heads_over_limit is true. Without a releasepage function
+ * try_to_free_buffers is called instead. That can unset the dirty
+ * bit of our ram disk pages, which will be eventually freed, even
+ * if the page is still in use.
+ */
+static int ramdisk_releasepage(struct page *page, gfp_t dummy)
+{
+       return 0;
+}
+
 static const struct address_space_operations ramdisk_aops = {
        .readpage       = ramdisk_readpage,
        .prepare_write  = ramdisk_prepare_write,
@@ -196,6 +208,7 @@ static const struct address_space_operations ramdisk_aops = {
        .writepage      = ramdisk_writepage,
        .set_page_dirty = ramdisk_set_page_dirty,
        .writepages     = ramdisk_writepages,
+       .releasepage    = ramdisk_releasepage,
 };
 
 static int rd_blkdev_pagecache_IO(int rw, struct bio_vec *vec, sector_t sector,
index 3cf7129d83e6ae0a3c35c53fe74a9bc02d58a9d6..924ddd8bccd2b8fdd32e06a7db1c3e05918ebc12 100644 (file)
@@ -223,7 +223,7 @@ static int virtblk_probe(struct virtio_device *vdev)
        err = virtio_config_val(vdev, VIRTIO_CONFIG_BLK_F_CAPACITY, &cap);
        if (err) {
                dev_err(&vdev->dev, "Bad/missing capacity in config\n");
-               goto out_put_disk;
+               goto out_cleanup_queue;
        }
 
        /* If capacity is too big, truncate with warning. */
@@ -239,7 +239,7 @@ static int virtblk_probe(struct virtio_device *vdev)
                blk_queue_max_segment_size(vblk->disk->queue, v);
        else if (err != -ENOENT) {
                dev_err(&vdev->dev, "Bad SIZE_MAX in config\n");
-               goto out_put_disk;
+               goto out_cleanup_queue;
        }
 
        err = virtio_config_val(vdev, VIRTIO_CONFIG_BLK_F_SEG_MAX, &v);
@@ -247,12 +247,14 @@ static int virtblk_probe(struct virtio_device *vdev)
                blk_queue_max_hw_segments(vblk->disk->queue, v);
        else if (err != -ENOENT) {
                dev_err(&vdev->dev, "Bad SEG_MAX in config\n");
-               goto out_put_disk;
+               goto out_cleanup_queue;
        }
 
        add_disk(vblk->disk);
        return 0;
 
+out_cleanup_queue:
+       blk_cleanup_queue(vblk->disk->queue);
 out_put_disk:
        put_disk(vblk->disk);
 out_unregister_blkdev:
@@ -277,6 +279,8 @@ static void virtblk_remove(struct virtio_device *vdev)
        put_disk(vblk->disk);
        unregister_blkdev(major, "virtblk");
        mempool_destroy(vblk->pool);
+       /* There should be nothing in the queue now, so no need to shutdown */
+       vdev->config->del_vq(vblk->vq);
        kfree(vblk);
 }
 
index f22c253bc09fbb4bcb84b6d5642848a82a3920c0..ccb1fa89de2976e99bcb5d7bb94094f989e3b974 100644 (file)
@@ -56,9 +56,9 @@ config AGP_AMD
          X on AMD Irongate, 761, and 762 chipsets.
 
 config AGP_AMD64
-       tristate "AMD Opteron/Athlon64 on-CPU GART support" if !IOMMU
+       tristate "AMD Opteron/Athlon64 on-CPU GART support" if !GART_IOMMU
        depends on AGP && X86
-       default y if IOMMU
+       default y if GART_IOMMU
        help
          This option gives you AGP support for the GLX component of
          X using the on-CPU northbridge of the AMD Athlon64/Opteron CPUs.
index d95662e96326dfe152029b2042890f24ccfa5148..d8200ac8f8cbb8643355719aa78bd144eccee9ef 100644 (file)
@@ -787,7 +787,7 @@ static void __exit agp_amd64_cleanup(void)
 
 /* On AMD64 the PCI driver needs to initialize this driver early
    for the IOMMU, so it has to be called via a backdoor. */
-#ifndef CONFIG_IOMMU
+#ifndef CONFIG_GART_IOMMU
 module_init(agp_amd64_init);
 module_exit(agp_amd64_cleanup);
 #endif
index 9dd0760dd87a7e89b405f2f83172cc26d803962c..dde02a15fa59d0f584dbf4bd63feaede1803afe6 100644 (file)
@@ -559,8 +559,6 @@ struct drm_mm {
  * a family of cards. There will one drm_device for each card present
  * in this family
  */
-struct drm_device;
-
 struct drm_driver {
        int (*load) (struct drm_device *, unsigned long flags);
        int (*firstopen) (struct drm_device *);
index d9be14624526e9553279f61f9c788526c6562894..3cbebf868e6832c2e61fa1885da3b970132be038 100644 (file)
@@ -272,7 +272,7 @@ int drm_getstats(struct drm_device *dev, void *data,
        struct drm_stats *stats = data;
        int i;
 
-       memset(stats, 0, sizeof(stats));
+       memset(stats, 0, sizeof(*stats));
 
        mutex_lock(&dev->struct_mutex);
 
index 76e44ac94fb52f4315a6c3498359d1e7d523ec69..daa69c9d8977b9cf8055c082eca364abd13b5635 100644 (file)
@@ -62,14 +62,6 @@ static __inline__ int mtrr_del(int reg, unsigned long base, unsigned long size)
 
 #endif
 
-/** For data going into the kernel through the ioctl argument */
-#define DRM_COPY_FROM_USER_IOCTL(arg1, arg2, arg3)     \
-       if ( copy_from_user(&arg1, arg2, arg3) )        \
-               return -EFAULT
-/** For data going from the kernel through the ioctl argument */
-#define DRM_COPY_TO_USER_IOCTL(arg1, arg2, arg3)       \
-       if ( copy_to_user(arg1, &arg2, arg3) )          \
-               return -EFAULT
 /** Other copying of data to kernel space */
 #define DRM_COPY_FROM_USER(arg1, arg2, arg3)           \
        copy_from_user(arg1, arg2, arg3)
index 335423c5c18662e4993428d49db05d37c4e4fdd0..24fca8ec137957524240bbf018a0ff3374e29c03 100644 (file)
@@ -1679,7 +1679,7 @@ static int radeon_do_init_cp(struct drm_device * dev, drm_radeon_init_t * init)
                        dev_priv->gart_info.bus_addr =
                            dev_priv->pcigart_offset + dev_priv->fb_location;
                        dev_priv->gart_info.mapping.offset =
-                           dev_priv->gart_info.bus_addr;
+                           dev_priv->pcigart_offset + dev_priv->fb_aper_offset;
                        dev_priv->gart_info.mapping.size =
                            dev_priv->gart_info.table_size;
 
@@ -2275,7 +2275,8 @@ int radeon_driver_firstopen(struct drm_device *dev)
        if (ret != 0)
                return ret;
 
-       ret = drm_addmap(dev, drm_get_resource_start(dev, 0),
+       dev_priv->fb_aper_offset = drm_get_resource_start(dev, 0);
+       ret = drm_addmap(dev, dev_priv->fb_aper_offset,
                         drm_get_resource_len(dev, 0), _DRM_FRAME_BUFFER,
                         _DRM_WRITE_COMBINING, &map);
        if (ret != 0)
index e4077bc212b32fb0460ddba4db60fcbf28415d87..bfbb60a9298ca7d57e0ad030751fe61799ccc73e 100644 (file)
@@ -293,6 +293,7 @@ typedef struct drm_radeon_private {
 
        /* starting from here on, data is preserved accross an open */
        uint32_t flags;         /* see radeon_chip_flags */
+       unsigned long fb_aper_offset;
 } drm_radeon_private_t;
 
 typedef struct drm_radeon_buf_priv {
index 59484d56b3338e1e8533cf4c5c04f013785ddccd..d465b2f9c1cdb999a3ec168d910a0c60db5580fa 100644 (file)
@@ -968,9 +968,6 @@ static int savage_bci_event_wait(struct drm_device *dev, void *data, struct drm_
 
        DRM_DEBUG("\n");
 
-       DRM_COPY_FROM_USER_IOCTL(event, (drm_savage_event_wait_t __user *) data,
-                                sizeof(event));
-
        UPDATE_EVENT_COUNTER();
        if (dev_priv->status_ptr)
                hw_e = dev_priv->status_ptr[1] & 0xffff;
index 6be1c575758063ff0721bf723544ff3d3d418a63..a6b7ccdaf73deae309099868a1a21a7e13f94a7a 100644 (file)
@@ -134,6 +134,7 @@ static int sis_drm_alloc(struct drm_device *dev, struct drm_file *file_priv,
                      dev_priv->agp_initialized)) {
                DRM_ERROR
                    ("Attempt to allocate from uninitialized memory manager.\n");
+               mutex_unlock(&dev->struct_mutex);
                return -EINVAL;
        }
 
index 0e937f64a789f8cafe985236e1164f632de1589a..20070b7c573d0087416213cec1fd16bf6ba825d7 100644 (file)
@@ -41,7 +41,7 @@
  */
 static inline int uncached_access(struct file *file, unsigned long addr)
 {
-#if defined(__i386__)
+#if defined(__i386__) && !defined(__arch_um__)
        /*
         * On the PPro and successors, the MTRRs are used to set
         * memory types for physical addresses outside main memory,
@@ -57,7 +57,7 @@ static inline int uncached_access(struct file *file, unsigned long addr)
                  test_bit(X86_FEATURE_CYRIX_ARR, boot_cpu_data.x86_capability) ||
                  test_bit(X86_FEATURE_CENTAUR_MCR, boot_cpu_data.x86_capability) )
          && addr >= __pa(high_memory);
-#elif defined(__x86_64__)
+#elif defined(__x86_64__) && !defined(__arch_um__)
        /* 
         * This is broken because it can generate memory type aliases,
         * which can cause cache corruptions
index cc5d77797defc66781da7c8c390bbfdc693b09a8..02518da6a386a934ef7c3af885c4630e3c46741f 100644 (file)
@@ -47,7 +47,7 @@
 /* #define ATR_CSUM */
 
 #ifdef PCMCIA_DEBUG
-#define reader_to_dev(x)       (&handle_to_dev(x->p_dev->handle))
+#define reader_to_dev(x)       (&handle_to_dev(x->p_dev))
 static int pc_debug = PCMCIA_DEBUG;
 module_param(pc_debug, int, 0600);
 #define DEBUGP(n, rdr, x, args...) do {                                \
index a0b9c8728d5685c80b51807ee7faa377ca2cf456..5f291bf739a627901dbad1fbebfe970311f538a3 100644 (file)
@@ -41,7 +41,7 @@
 
 
 #ifdef PCMCIA_DEBUG
-#define reader_to_dev(x)       (&handle_to_dev(x->p_dev->handle))
+#define reader_to_dev(x)       (&handle_to_dev(x->p_dev))
 static int pc_debug = PCMCIA_DEBUG;
 module_param(pc_debug, int, 0600);
 #define DEBUGP(n, rdr, x, args...) do {                                \
index 1756b1f7cb7252b8a596ff25767c1d9155fab5f4..5fee05661823766a0ed5651724d81fad0ee951b8 100644 (file)
@@ -1494,7 +1494,7 @@ __u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr,
        seq = twothirdsMD4Transform((const __u32 *)daddr, hash) & HASH_MASK;
        seq += keyptr->count;
 
-       seq += ktime_get_real().tv64;
+       seq += ktime_to_ns(ktime_get_real());
 
        return seq;
 }
@@ -1556,7 +1556,7 @@ __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr,
         *      overlaps less than one time per MSL (2 minutes).
         *      Choosing a clock of 64 ns period is OK. (period of 274 s)
         */
-       seq += ktime_get_real().tv64 >> 6;
+       seq += ktime_to_ns(ktime_get_real()) >> 6;
 #if 0
        printk("init_seq(%lx, %lx, %d, %d) = %d\n",
               saddr, daddr, sport, dport, seq);
@@ -1616,7 +1616,7 @@ u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr,
        seq = half_md4_transform(hash, keyptr->secret);
        seq |= ((u64)keyptr->count) << (32 - HASH_BITS);
 
-       seq += ktime_get_real().tv64;
+       seq += ktime_to_ns(ktime_get_real());
        seq &= (1ull << 48) - 1;
 #if 0
        printk("dccp init_seq(%lx, %lx, %d, %d) = %d\n",
index ec6b65ec69ea6f1726e400667c2462c5af7d5028..0c66b802736a10540bca3ed9d7ef34f5b0208b4a 100644 (file)
@@ -918,6 +918,31 @@ static const struct file_operations rtc_proc_fops = {
 };
 #endif
 
+static resource_size_t rtc_size;
+
+static struct resource * __init rtc_request_region(resource_size_t size)
+{
+       struct resource *r;
+
+       if (RTC_IOMAPPED)
+               r = request_region(RTC_PORT(0), size, "rtc");
+       else
+               r = request_mem_region(RTC_PORT(0), size, "rtc");
+
+       if (r)
+               rtc_size = size;
+
+       return r;
+}
+
+static void rtc_release_region(void)
+{
+       if (RTC_IOMAPPED)
+               release_region(RTC_PORT(0), rtc_size);
+       else
+               release_mem_region(RTC_PORT(0), rtc_size);
+}
+
 static int __init rtc_init(void)
 {
 #ifdef CONFIG_PROC_FS
@@ -968,10 +993,17 @@ found:
        }
 no_irq:
 #else
-       if (RTC_IOMAPPED)
-               r = request_region(RTC_PORT(0), RTC_IO_EXTENT, "rtc");
-       else
-               r = request_mem_region(RTC_PORT(0), RTC_IO_EXTENT, "rtc");
+       r = rtc_request_region(RTC_IO_EXTENT);
+
+       /*
+        * If we've already requested a smaller range (for example, because
+        * PNPBIOS or ACPI told us how the device is configured), the request
+        * above might fail because it's too big.
+        *
+        * If so, request just the range we actually use.
+        */
+       if (!r)
+               r = rtc_request_region(RTC_IO_EXTENT_USED);
        if (!r) {
 #ifdef RTC_IRQ
                rtc_has_irq = 0;
@@ -992,10 +1024,7 @@ no_irq:
                /* Yeah right, seeing as irq 8 doesn't even hit the bus. */
                rtc_has_irq = 0;
                printk(KERN_ERR "rtc: IRQ %d is not free.\n", RTC_IRQ);
-               if (RTC_IOMAPPED)
-                       release_region(RTC_PORT(0), RTC_IO_EXTENT);
-               else
-                       release_mem_region(RTC_PORT(0), RTC_IO_EXTENT);
+               rtc_release_region();
                return -EIO;
        }
        hpet_rtc_timer_init();
@@ -1009,7 +1038,7 @@ no_irq:
                free_irq(RTC_IRQ, NULL);
                rtc_has_irq = 0;
 #endif
-               release_region(RTC_PORT(0), RTC_IO_EXTENT);
+               rtc_release_region();
                return -ENODEV;
        }
 
@@ -1091,10 +1120,7 @@ static void __exit rtc_exit (void)
        if (rtc_has_irq)
                free_irq (rtc_irq, &rtc_port);
 #else
-       if (RTC_IOMAPPED)
-               release_region(RTC_PORT(0), RTC_IO_EXTENT);
-       else
-               release_mem_region(RTC_PORT(0), RTC_IO_EXTENT);
+       rtc_release_region();
 #ifdef RTC_IRQ
        if (rtc_has_irq)
                free_irq (RTC_IRQ, NULL);
index 7a003504c265f73ee5f99aaffb140d97d1853991..1bdd2bf4f37d74808bd60bcce01e67a2c6d57f5d 100644 (file)
@@ -730,13 +730,23 @@ static int send_prio_char(struct tty_struct *tty, char ch)
        return 0;
 }
 
-int n_tty_ioctl(struct tty_struct * tty, struct file * file,
-                      unsigned int cmd, unsigned long arg)
+/**
+ *     tty_mode_ioctl          -       mode related ioctls
+ *     @tty: tty for the ioctl
+ *     @file: file pointer for the tty
+ *     @cmd: command
+ *     @arg: ioctl argument
+ *
+ *     Perform non line discipline specific mode control ioctls. This
+ *     is designed to be called by line disciplines to ensure they provide
+ *     consistent mode setting.
+ */
+
+int tty_mode_ioctl(struct tty_struct * tty, struct file *file,
+                       unsigned int cmd, unsigned long arg)
 {
        struct tty_struct * real_tty;
        void __user *p = (void __user *)arg;
-       int retval;
-       struct tty_ldisc *ld;
 
        if (tty->driver->type == TTY_DRIVER_TYPE_PTY &&
            tty->driver->subtype == PTY_TYPE_MASTER)
@@ -799,6 +809,93 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file,
                        return set_termios(real_tty, p, TERMIOS_WAIT | TERMIOS_TERMIO);
                case TCSETA:
                        return set_termios(real_tty, p, TERMIOS_TERMIO);
+#ifndef TCGETS2
+               case TIOCGLCKTRMIOS:
+                       if (kernel_termios_to_user_termios((struct termios __user *)arg, real_tty->termios_locked))
+                               return -EFAULT;
+                       return 0;
+
+               case TIOCSLCKTRMIOS:
+                       if (!capable(CAP_SYS_ADMIN))
+                               return -EPERM;
+                       if (user_termios_to_kernel_termios(real_tty->termios_locked, (struct termios __user *) arg))
+                               return -EFAULT;
+                       return 0;
+#else
+               case TIOCGLCKTRMIOS:
+                       if (kernel_termios_to_user_termios_1((struct termios __user *)arg, real_tty->termios_locked))
+                               return -EFAULT;
+                       return 0;
+
+               case TIOCSLCKTRMIOS:
+                       if (!capable(CAP_SYS_ADMIN))
+                               return -EPERM;
+                       if (user_termios_to_kernel_termios_1(real_tty->termios_locked, (struct termios __user *) arg))
+                               return -EFAULT;
+                       return 0;
+#endif
+               case TIOCGSOFTCAR:
+                       return put_user(C_CLOCAL(tty) ? 1 : 0, (int __user *)arg);
+               case TIOCSSOFTCAR:
+                       if (get_user(arg, (unsigned int __user *) arg))
+                               return -EFAULT;
+                       mutex_lock(&tty->termios_mutex);
+                       tty->termios->c_cflag =
+                               ((tty->termios->c_cflag & ~CLOCAL) |
+                                (arg ? CLOCAL : 0));
+                       mutex_unlock(&tty->termios_mutex);
+                       return 0;
+               default:
+                       return -ENOIOCTLCMD;
+       }
+}
+
+EXPORT_SYMBOL_GPL(tty_mode_ioctl);
+
+int tty_perform_flush(struct tty_struct *tty, unsigned long arg)
+{
+       struct tty_ldisc *ld;
+       int retval = tty_check_change(tty);
+       if (retval)
+               return retval;
+
+       ld = tty_ldisc_ref(tty);
+       switch (arg) {
+       case TCIFLUSH:
+               if (ld && ld->flush_buffer)
+                       ld->flush_buffer(tty);
+               break;
+       case TCIOFLUSH:
+               if (ld && ld->flush_buffer)
+                       ld->flush_buffer(tty);
+               /* fall through */
+       case TCOFLUSH:
+               if (tty->driver->flush_buffer)
+                       tty->driver->flush_buffer(tty);
+               break;
+       default:
+               tty_ldisc_deref(ld);
+               return -EINVAL;
+       }
+       tty_ldisc_deref(ld);
+       return 0;
+}
+
+EXPORT_SYMBOL_GPL(tty_perform_flush);
+
+int n_tty_ioctl(struct tty_struct * tty, struct file * file,
+                      unsigned int cmd, unsigned long arg)
+{
+       struct tty_struct * real_tty;
+       int retval;
+
+       if (tty->driver->type == TTY_DRIVER_TYPE_PTY &&
+           tty->driver->subtype == PTY_TYPE_MASTER)
+               real_tty = tty->link;
+       else
+               real_tty = tty;
+
+       switch (cmd) {
                case TCXONC:
                        retval = tty_check_change(tty);
                        if (retval)
@@ -829,30 +926,7 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file,
                        }
                        return 0;
                case TCFLSH:
-                       retval = tty_check_change(tty);
-                       if (retval)
-                               return retval;
-                               
-                       ld = tty_ldisc_ref(tty);
-                       switch (arg) {
-                       case TCIFLUSH:
-                               if (ld && ld->flush_buffer)
-                                       ld->flush_buffer(tty);
-                               break;
-                       case TCIOFLUSH:
-                               if (ld && ld->flush_buffer)
-                                       ld->flush_buffer(tty);
-                               /* fall through */
-                       case TCOFLUSH:
-                               if (tty->driver->flush_buffer)
-                                       tty->driver->flush_buffer(tty);
-                               break;
-                       default:
-                               tty_ldisc_deref(ld);
-                               return -EINVAL;
-                       }
-                       tty_ldisc_deref(ld);
-                       return 0;
+                       return tty_perform_flush(tty, arg);
                case TIOCOUTQ:
                        return put_user(tty->driver->chars_in_buffer ?
                                        tty->driver->chars_in_buffer(tty) : 0,
@@ -862,32 +936,6 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file,
                        if (L_ICANON(tty))
                                retval = inq_canon(tty);
                        return put_user(retval, (unsigned int __user *) arg);
-#ifndef TCGETS2
-               case TIOCGLCKTRMIOS:
-                       if (kernel_termios_to_user_termios((struct termios __user *)arg, real_tty->termios_locked))
-                               return -EFAULT;
-                       return 0;
-
-               case TIOCSLCKTRMIOS:
-                       if (!capable(CAP_SYS_ADMIN))
-                               return -EPERM;
-                       if (user_termios_to_kernel_termios(real_tty->termios_locked, (struct termios __user *) arg))
-                               return -EFAULT;
-                       return 0;
-#else
-               case TIOCGLCKTRMIOS:
-                       if (kernel_termios_to_user_termios_1((struct termios __user *)arg, real_tty->termios_locked))
-                               return -EFAULT;
-                       return 0;
-
-               case TIOCSLCKTRMIOS:
-                       if (!capable(CAP_SYS_ADMIN))
-                               return -EPERM;
-                       if (user_termios_to_kernel_termios_1(real_tty->termios_locked, (struct termios __user *) arg))
-                               return -EFAULT;
-                       return 0;
-#endif
-
                case TIOCPKT:
                {
                        int pktmode;
@@ -906,19 +954,9 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file,
                                tty->packet = 0;
                        return 0;
                }
-               case TIOCGSOFTCAR:
-                       return put_user(C_CLOCAL(tty) ? 1 : 0, (int __user *)arg);
-               case TIOCSSOFTCAR:
-                       if (get_user(arg, (unsigned int __user *) arg))
-                               return -EFAULT;
-                       mutex_lock(&tty->termios_mutex);
-                       tty->termios->c_cflag =
-                               ((tty->termios->c_cflag & ~CLOCAL) |
-                                (arg ? CLOCAL : 0));
-                       mutex_unlock(&tty->termios_mutex);
-                       return 0;
                default:
-                       return -ENOIOCTLCMD;
+                       /* Try the mode commands */
+                       return tty_mode_ioctl(tty, file, cmd, arg);
                }
 }
 
index 100e8a201e3aa5d2a8890cb79b171373dc829afe..e34da5c971966fc87d68b40588ea4f22e3f94189 100644 (file)
@@ -141,7 +141,7 @@ int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int))
  * never remove the console device we never need this pointer again.
  *
  * Finally we put our input buffer in the input queue, ready to receive. */
-static int virtcons_probe(struct virtio_device *dev)
+static int __devinit virtcons_probe(struct virtio_device *dev)
 {
        int err;
        struct hvc_struct *hvc;
index 0e328d387af4cbecdb326238b12d904dfe4988b1..6883fcb79ad35d27cd3eb5d65d2f6eaab82ded4c 100644 (file)
@@ -218,7 +218,7 @@ static void cn_rx_skb(struct sk_buff *__skb)
                    skb->len < nlh->nlmsg_len ||
                    nlh->nlmsg_len > CONNECTOR_MAX_MSG_SIZE) {
                        kfree_skb(skb);
-                       goto out;
+                       return;
                }
 
                len = NLMSG_ALIGN(nlh->nlmsg_len);
@@ -229,9 +229,6 @@ static void cn_rx_skb(struct sk_buff *__skb)
                if (err < 0)
                        kfree_skb(skb);
        }
-
-out:
-       kfree_skb(__skb);
 }
 
 /*
index 4bd33ce8a6f3398a0aa37995582e619c3b938590..1bba99747f5b3da806fea25aa991d3ac151673be 100644 (file)
 #define DEF_FREQUENCY_UP_THRESHOLD             (80)
 #define DEF_FREQUENCY_DOWN_THRESHOLD           (20)
 
-/* 
- * The polling frequency of this governor depends on the capability of 
+/*
+ * The polling frequency of this governor depends on the capability of
  * the processor. Default polling frequency is 1000 times the transition
- * latency of the processor. The governor will work on any processor with 
- * transition latency <= 10mS, using appropriate sampling 
+ * latency of the processor. The governor will work on any processor with
+ * transition latency <= 10mS, using appropriate sampling
  * rate.
  * For CPUs with transition latency > 10mS (mostly drivers
  * with CPUFREQ_ETERNAL), this governor will not work.
  * All times here are in uS.
  */
-static unsigned int                            def_sampling_rate;
+static unsigned int def_sampling_rate;
 #define MIN_SAMPLING_RATE_RATIO                        (2)
 /* for correct statistics, we need at least 10 ticks between each measure */
 #define MIN_STAT_SAMPLING_RATE                 \
@@ -63,12 +63,12 @@ static unsigned int                                 def_sampling_rate;
 static void do_dbs_timer(struct work_struct *work);
 
 struct cpu_dbs_info_s {
-       struct cpufreq_policy   *cur_policy;
-       unsigned int            prev_cpu_idle_up;
-       unsigned int            prev_cpu_idle_down;
-       unsigned int            enable;
-       unsigned int            down_skip;
-       unsigned int            requested_freq;
+       struct cpufreq_policy *cur_policy;
+       unsigned int prev_cpu_idle_up;
+       unsigned int prev_cpu_idle_down;
+       unsigned int enable;
+       unsigned int down_skip;
+       unsigned int requested_freq;
 };
 static DEFINE_PER_CPU(struct cpu_dbs_info_s, cpu_dbs_info);
 
@@ -82,24 +82,24 @@ static unsigned int dbs_enable;     /* number of CPUs using this policy */
  * cpu_hotplug lock should be taken before that. Note that cpu_hotplug lock
  * is recursive for the same process. -Venki
  */
-static DEFINE_MUTEX    (dbs_mutex);
+static DEFINE_MUTEX (dbs_mutex);
 static DECLARE_DELAYED_WORK(dbs_work, do_dbs_timer);
 
 struct dbs_tuners {
-       unsigned int            sampling_rate;
-       unsigned int            sampling_down_factor;
-       unsigned int            up_threshold;
-       unsigned int            down_threshold;
-       unsigned int            ignore_nice;
-       unsigned int            freq_step;
+       unsigned int sampling_rate;
+       unsigned int sampling_down_factor;
+       unsigned int up_threshold;
+       unsigned int down_threshold;
+       unsigned int ignore_nice;
+       unsigned int freq_step;
 };
 
 static struct dbs_tuners dbs_tuners_ins = {
-       .up_threshold           = DEF_FREQUENCY_UP_THRESHOLD,
-       .down_threshold         = DEF_FREQUENCY_DOWN_THRESHOLD,
-       .sampling_down_factor   = DEF_SAMPLING_DOWN_FACTOR,
-       .ignore_nice            = 0,
-       .freq_step              = 5,
+       .up_threshold = DEF_FREQUENCY_UP_THRESHOLD,
+       .down_threshold = DEF_FREQUENCY_DOWN_THRESHOLD,
+       .sampling_down_factor = DEF_SAMPLING_DOWN_FACTOR,
+       .ignore_nice = 0,
+       .freq_step = 5,
 };
 
 static inline unsigned int get_cpu_idle_time(unsigned int cpu)
@@ -109,13 +109,34 @@ static inline unsigned int get_cpu_idle_time(unsigned int cpu)
        if (dbs_tuners_ins.ignore_nice)
                add_nice = kstat_cpu(cpu).cpustat.nice;
 
-       ret =   kstat_cpu(cpu).cpustat.idle +
+       ret = kstat_cpu(cpu).cpustat.idle +
                kstat_cpu(cpu).cpustat.iowait +
                add_nice;
 
        return ret;
 }
 
+/* keep track of frequency transitions */
+static int
+dbs_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
+                    void *data)
+{
+       struct cpufreq_freqs *freq = data;
+       struct cpu_dbs_info_s *this_dbs_info = &per_cpu(cpu_dbs_info,
+                                                       freq->cpu);
+
+       if (!this_dbs_info->enable)
+               return 0;
+
+       this_dbs_info->requested_freq = freq->new;
+
+       return 0;
+}
+
+static struct notifier_block dbs_cpufreq_notifier_block = {
+       .notifier_call = dbs_cpufreq_notifier
+};
+
 /************************** sysfs interface ************************/
 static ssize_t show_sampling_rate_max(struct cpufreq_policy *policy, char *buf)
 {
@@ -127,8 +148,8 @@ static ssize_t show_sampling_rate_min(struct cpufreq_policy *policy, char *buf)
        return sprintf (buf, "%u\n", MIN_SAMPLING_RATE);
 }
 
-#define define_one_ro(_name)                                   \
-static struct freq_attr _name =                                \
+#define define_one_ro(_name)                           \
+static struct freq_attr _name =                                \
 __ATTR(_name, 0444, show_##_name, NULL)
 
 define_one_ro(sampling_rate_max);
@@ -148,7 +169,7 @@ show_one(down_threshold, down_threshold);
 show_one(ignore_nice_load, ignore_nice);
 show_one(freq_step, freq_step);
 
-static ssize_t store_sampling_down_factor(struct cpufreq_policy *unused, 
+static ssize_t store_sampling_down_factor(struct cpufreq_policy *unused,
                const char *buf, size_t count)
 {
        unsigned int input;
@@ -164,7 +185,7 @@ static ssize_t store_sampling_down_factor(struct cpufreq_policy *unused,
        return count;
 }
 
-static ssize_t store_sampling_rate(struct cpufreq_policy *unused, 
+static ssize_t store_sampling_rate(struct cpufreq_policy *unused,
                const char *buf, size_t count)
 {
        unsigned int input;
@@ -183,7 +204,7 @@ static ssize_t store_sampling_rate(struct cpufreq_policy *unused,
        return count;
 }
 
-static ssize_t store_up_threshold(struct cpufreq_policy *unused, 
+static ssize_t store_up_threshold(struct cpufreq_policy *unused,
                const char *buf, size_t count)
 {
        unsigned int input;
@@ -202,7 +223,7 @@ static ssize_t store_up_threshold(struct cpufreq_policy *unused,
        return count;
 }
 
-static ssize_t store_down_threshold(struct cpufreq_policy *unused, 
+static ssize_t store_down_threshold(struct cpufreq_policy *unused,
                const char *buf, size_t count)
 {
        unsigned int input;
@@ -228,16 +249,16 @@ static ssize_t store_ignore_nice_load(struct cpufreq_policy *policy,
        int ret;
 
        unsigned int j;
-       
-       ret = sscanf (buf, "%u", &input);
-       if ( ret != 1 )
+
+       ret = sscanf(buf, "%u", &input);
+       if (ret != 1)
                return -EINVAL;
 
-       if ( input > 1 )
+       if (input > 1)
                input = 1;
-       
+
        mutex_lock(&dbs_mutex);
-       if ( input == dbs_tuners_ins.ignore_nice ) { /* nothing to do */
+       if (input == dbs_tuners_ins.ignore_nice) { /* nothing to do */
                mutex_unlock(&dbs_mutex);
                return count;
        }
@@ -261,14 +282,14 @@ static ssize_t store_freq_step(struct cpufreq_policy *policy,
        unsigned int input;
        int ret;
 
-       ret = sscanf (buf, "%u", &input);
+       ret = sscanf(buf, "%u", &input);
 
-       if ( ret != 1 )
+       if (ret != 1)
                return -EINVAL;
 
-       if ( input > 100 )
+       if (input > 100)
                input = 100;
-       
+
        /* no need to test here if freq_step is zero as the user might actually
         * want this, they would be crazy though :) */
        mutex_lock(&dbs_mutex);
@@ -322,18 +343,18 @@ static void dbs_check_cpu(int cpu)
 
        policy = this_dbs_info->cur_policy;
 
-       /* 
-        * The default safe range is 20% to 80% 
+       /*
+        * The default safe range is 20% to 80%
         * Every sampling_rate, we check
-        *      - If current idle time is less than 20%, then we try to 
-        *        increase frequency
+        *      - If current idle time is less than 20%, then we try to
+        *        increase frequency
         * Every sampling_rate*sampling_down_factor, we check
-        *      - If current idle time is more than 80%, then we try to
-        *        decrease frequency
+        *      - If current idle time is more than 80%, then we try to
+        *        decrease frequency
         *
-        * Any frequency increase takes it to the maximum frequency. 
-        * Frequency reduction happens at minimum steps of 
-        * 5% (default) of max_frequency 
+        * Any frequency increase takes it to the maximum frequency.
+        * Frequency reduction happens at minimum steps of
+        * 5% (default) of max_frequency
         */
 
        /* Check for frequency increase */
@@ -361,13 +382,13 @@ static void dbs_check_cpu(int cpu)
                /* if we are already at full speed then break out early */
                if (this_dbs_info->requested_freq == policy->max)
                        return;
-               
+
                freq_step = (dbs_tuners_ins.freq_step * policy->max) / 100;
 
                /* max freq cannot be less than 100. But who knows.... */
                if (unlikely(freq_step == 0))
                        freq_step = 5;
-               
+
                this_dbs_info->requested_freq += freq_step;
                if (this_dbs_info->requested_freq > policy->max)
                        this_dbs_info->requested_freq = policy->max;
@@ -427,15 +448,15 @@ static void dbs_check_cpu(int cpu)
 }
 
 static void do_dbs_timer(struct work_struct *work)
-{ 
+{
        int i;
        mutex_lock(&dbs_mutex);
        for_each_online_cpu(i)
                dbs_check_cpu(i);
-       schedule_delayed_work(&dbs_work, 
+       schedule_delayed_work(&dbs_work,
                        usecs_to_jiffies(dbs_tuners_ins.sampling_rate));
        mutex_unlock(&dbs_mutex);
-} 
+}
 
 static inline void dbs_timer_init(void)
 {
@@ -462,13 +483,12 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
 
        switch (event) {
        case CPUFREQ_GOV_START:
-               if ((!cpu_online(cpu)) || 
-                   (!policy->cur))
+               if ((!cpu_online(cpu)) || (!policy->cur))
                        return -EINVAL;
 
                if (this_dbs_info->enable) /* Already enabled */
                        break;
-                
+
                mutex_lock(&dbs_mutex);
 
                rc = sysfs_create_group(&policy->kobj, &dbs_attr_group);
@@ -481,7 +501,7 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
                        struct cpu_dbs_info_s *j_dbs_info;
                        j_dbs_info = &per_cpu(cpu_dbs_info, j);
                        j_dbs_info->cur_policy = policy;
-               
+
                        j_dbs_info->prev_cpu_idle_up = get_cpu_idle_time(cpu);
                        j_dbs_info->prev_cpu_idle_down
                                = j_dbs_info->prev_cpu_idle_up;
@@ -511,8 +531,11 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
                        dbs_tuners_ins.sampling_rate = def_sampling_rate;
 
                        dbs_timer_init();
+                       cpufreq_register_notifier(
+                                       &dbs_cpufreq_notifier_block,
+                                       CPUFREQ_TRANSITION_NOTIFIER);
                }
-               
+
                mutex_unlock(&dbs_mutex);
                break;
 
@@ -525,9 +548,13 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
                 * Stop the timerschedule work, when this governor
                 * is used for first time
                 */
-               if (dbs_enable == 0) 
+               if (dbs_enable == 0) {
                        dbs_timer_exit();
-               
+                       cpufreq_unregister_notifier(
+                                       &dbs_cpufreq_notifier_block,
+                                       CPUFREQ_TRANSITION_NOTIFIER);
+               }
+
                mutex_unlock(&dbs_mutex);
 
                break;
@@ -537,11 +564,11 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
                if (policy->max < this_dbs_info->cur_policy->cur)
                        __cpufreq_driver_target(
                                        this_dbs_info->cur_policy,
-                                       policy->max, CPUFREQ_RELATION_H);
+                                       policy->max, CPUFREQ_RELATION_H);
                else if (policy->min > this_dbs_info->cur_policy->cur)
                        __cpufreq_driver_target(
                                        this_dbs_info->cur_policy,
-                                       policy->min, CPUFREQ_RELATION_L);
+                                       policy->min, CPUFREQ_RELATION_L);
                mutex_unlock(&dbs_mutex);
                break;
        }
index fdf4106b817bfc0501c6b1a0d88751f4f6ee2a08..d2fabe7863a96345e096f5a644c111436a492819 100644 (file)
@@ -19,7 +19,6 @@
 #include "cpuidle.h"
 
 DEFINE_PER_CPU(struct cpuidle_device *, cpuidle_devices);
-EXPORT_PER_CPU_SYMBOL_GPL(cpuidle_devices);
 
 DEFINE_MUTEX(cpuidle_lock);
 LIST_HEAD(cpuidle_detected_devices);
index bb699cb2dc5ae1915a4ae0d70f2f45393a816202..70b59642a7087a7593fffdfd9158ddfe4ba619b5 100644 (file)
@@ -94,8 +94,6 @@ int cpuidle_register_governor(struct cpuidle_governor *gov)
        return ret;
 }
 
-EXPORT_SYMBOL_GPL(cpuidle_register_governor);
-
 /**
  * cpuidle_replace_governor - find a replacement governor
  * @exclude_rating: the rating that will be skipped while looking for
@@ -138,4 +136,3 @@ void cpuidle_unregister_governor(struct cpuidle_governor *gov)
        mutex_unlock(&cpuidle_lock);
 }
 
-EXPORT_SYMBOL_GPL(cpuidle_unregister_governor);
index f9a34abbf4faed143e8597f2769f114534acaa64..711e246e1ef021ee66fd297105482328580b0cd8 100644 (file)
@@ -110,8 +110,7 @@ geode_aes_crypt(struct geode_aes_op *op)
         * we don't need to worry
         */
 
-       if (op->src == op->dst)
-               flags |= (AES_CTRL_DCA | AES_CTRL_SCA);
+       flags |= (AES_CTRL_DCA | AES_CTRL_SCA);
 
        if (op->dir == AES_DIR_ENCRYPT)
                flags |= AES_CTRL_ENCRYPT;
index 9c91b0fd134f231c83a89a4d250f6922575b49a0..6a7d25fc247068f079fb095bfb65b59e0fbd38e4 100644 (file)
@@ -43,7 +43,6 @@ comment "DMA Clients"
 config NET_DMA
        bool "Network: TCP receive copy offload"
        depends on DMA_ENGINE && NET
-       default y
        help
          This enables the use of DMA engines in the network stack to
          offload receive copy-to-user operations, freeing CPU cycles.
index 82489923af09a6ae048a50c1bf471e43f9260492..d59b2f417306f91af453962991c5c681aa20381b 100644 (file)
@@ -182,10 +182,9 @@ static void dma_client_chan_alloc(struct dma_client *client)
                                /* we are done once this client rejects
                                 * an available resource
                                 */
-                               if (ack == DMA_ACK) {
+                               if (ack == DMA_ACK)
                                        dma_chan_get(chan);
-                                       kref_get(&device->refcount);
-                               } else if (ack == DMA_NAK)
+                               else if (ack == DMA_NAK)
                                        return;
                        }
                }
@@ -272,11 +271,8 @@ static void dma_clients_notify_removed(struct dma_chan *chan)
                /* client was holding resources for this channel so
                 * free it
                 */
-               if (ack == DMA_ACK) {
+               if (ack == DMA_ACK)
                        dma_chan_put(chan);
-                       kref_put(&chan->device->refcount,
-                               dma_async_device_cleanup);
-               }
        }
 
        mutex_unlock(&dma_list_mutex);
@@ -316,11 +312,8 @@ void dma_async_client_unregister(struct dma_client *client)
                        ack = client->event_callback(client, chan,
                                DMA_RESOURCE_REMOVED);
 
-                       if (ack == DMA_ACK) {
+                       if (ack == DMA_ACK)
                                dma_chan_put(chan);
-                               kref_put(&chan->device->refcount,
-                                       dma_async_device_cleanup);
-                       }
                }
 
        list_del(&client->global_node);
@@ -397,6 +390,8 @@ int dma_async_device_register(struct dma_device *device)
                        goto err_out;
                }
 
+               /* One for the channel, one of the class device */
+               kref_get(&device->refcount);
                kref_get(&device->refcount);
                kref_init(&chan->refcount);
                chan->slow_ref = 0;
index f204c39fb412e2c25469ffbe41dc7e483d65096d..16e0fd8facfb8ca30aaa4427815f165b0f60317f 100644 (file)
@@ -39,10 +39,14 @@ MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Intel Corporation");
 
 static struct pci_device_id ioat_pci_tbl[] = {
+       /* I/OAT v1 platforms */
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT) },
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT_CNB)  },
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT_SCNB) },
        { PCI_DEVICE(PCI_VENDOR_ID_UNISYS, PCI_DEVICE_ID_UNISYS_DMA_DIRECTOR) },
+
+       /* I/OAT v2 platforms */
+       { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT_SNB) },
        { 0, }
 };
 
@@ -74,10 +78,17 @@ static int ioat_setup_functionality(struct pci_dev *pdev, void __iomem *iobase)
                if (device->dma && ioat_dca_enabled)
                        device->dca = ioat_dca_init(pdev, iobase);
                break;
+       case IOAT_VER_2_0:
+               device->dma = ioat_dma_probe(pdev, iobase);
+               if (device->dma && ioat_dca_enabled)
+                       device->dca = ioat2_dca_init(pdev, iobase);
+               break;
        default:
                err = -ENODEV;
                break;
        }
+       if (!device->dma)
+               err = -ENODEV;
        return err;
 }
 
index ba985715b80306fe568018c59ffe016a1404db24..0fa8a98051a8b05f8f0b1705e1ca430c2c91bbf8 100644 (file)
@@ -261,3 +261,167 @@ struct dca_provider *ioat_dca_init(struct pci_dev *pdev, void __iomem *iobase)
        return dca;
 }
 
+
+static int ioat2_dca_add_requester(struct dca_provider *dca, struct device *dev)
+{
+       struct ioat_dca_priv *ioatdca = dca_priv(dca);
+       struct pci_dev *pdev;
+       int i;
+       u16 id;
+       u16 global_req_table;
+
+       /* This implementation only supports PCI-Express */
+       if (dev->bus != &pci_bus_type)
+               return -ENODEV;
+       pdev = to_pci_dev(dev);
+       id = dcaid_from_pcidev(pdev);
+
+       if (ioatdca->requester_count == ioatdca->max_requesters)
+               return -ENODEV;
+
+       for (i = 0; i < ioatdca->max_requesters; i++) {
+               if (ioatdca->req_slots[i].pdev == NULL) {
+                       /* found an empty slot */
+                       ioatdca->requester_count++;
+                       ioatdca->req_slots[i].pdev = pdev;
+                       ioatdca->req_slots[i].rid = id;
+                       global_req_table =
+                             readw(ioatdca->dca_base + IOAT_DCA_GREQID_OFFSET);
+                       writel(id | IOAT_DCA_GREQID_VALID,
+                              ioatdca->iobase + global_req_table + (i * 4));
+                       return i;
+               }
+       }
+       /* Error, ioatdma->requester_count is out of whack */
+       return -EFAULT;
+}
+
+static int ioat2_dca_remove_requester(struct dca_provider *dca,
+                                     struct device *dev)
+{
+       struct ioat_dca_priv *ioatdca = dca_priv(dca);
+       struct pci_dev *pdev;
+       int i;
+       u16 global_req_table;
+
+       /* This implementation only supports PCI-Express */
+       if (dev->bus != &pci_bus_type)
+               return -ENODEV;
+       pdev = to_pci_dev(dev);
+
+       for (i = 0; i < ioatdca->max_requesters; i++) {
+               if (ioatdca->req_slots[i].pdev == pdev) {
+                       global_req_table =
+                             readw(ioatdca->dca_base + IOAT_DCA_GREQID_OFFSET);
+                       writel(0, ioatdca->iobase + global_req_table + (i * 4));
+                       ioatdca->req_slots[i].pdev = NULL;
+                       ioatdca->req_slots[i].rid = 0;
+                       ioatdca->requester_count--;
+                       return i;
+               }
+       }
+       return -ENODEV;
+}
+
+static u8 ioat2_dca_get_tag(struct dca_provider *dca, int cpu)
+{
+       u8 tag;
+
+       tag = ioat_dca_get_tag(dca, cpu);
+       tag = (~tag) & 0x1F;
+       return tag;
+}
+
+static struct dca_ops ioat2_dca_ops = {
+       .add_requester          = ioat2_dca_add_requester,
+       .remove_requester       = ioat2_dca_remove_requester,
+       .get_tag                = ioat2_dca_get_tag,
+};
+
+static int ioat2_dca_count_dca_slots(void *iobase, u16 dca_offset)
+{
+       int slots = 0;
+       u32 req;
+       u16 global_req_table;
+
+       global_req_table = readw(iobase + dca_offset + IOAT_DCA_GREQID_OFFSET);
+       if (global_req_table == 0)
+               return 0;
+       do {
+               req = readl(iobase + global_req_table + (slots * sizeof(u32)));
+               slots++;
+       } while ((req & IOAT_DCA_GREQID_LASTID) == 0);
+
+       return slots;
+}
+
+struct dca_provider *ioat2_dca_init(struct pci_dev *pdev, void __iomem *iobase)
+{
+       struct dca_provider *dca;
+       struct ioat_dca_priv *ioatdca;
+       int slots;
+       int i;
+       int err;
+       u32 tag_map;
+       u16 dca_offset;
+       u16 csi_fsb_control;
+       u16 pcie_control;
+       u8 bit;
+
+       if (!system_has_dca_enabled(pdev))
+               return NULL;
+
+       dca_offset = readw(iobase + IOAT_DCAOFFSET_OFFSET);
+       if (dca_offset == 0)
+               return NULL;
+
+       slots = ioat2_dca_count_dca_slots(iobase, dca_offset);
+       if (slots == 0)
+               return NULL;
+
+       dca = alloc_dca_provider(&ioat2_dca_ops,
+                                sizeof(*ioatdca)
+                                     + (sizeof(struct ioat_dca_slot) * slots));
+       if (!dca)
+               return NULL;
+
+       ioatdca = dca_priv(dca);
+       ioatdca->iobase = iobase;
+       ioatdca->dca_base = iobase + dca_offset;
+       ioatdca->max_requesters = slots;
+
+       /* some bios might not know to turn these on */
+       csi_fsb_control = readw(ioatdca->dca_base + IOAT_FSB_CAP_ENABLE_OFFSET);
+       if ((csi_fsb_control & IOAT_FSB_CAP_ENABLE_PREFETCH) == 0) {
+               csi_fsb_control |= IOAT_FSB_CAP_ENABLE_PREFETCH;
+               writew(csi_fsb_control,
+                      ioatdca->dca_base + IOAT_FSB_CAP_ENABLE_OFFSET);
+       }
+       pcie_control = readw(ioatdca->dca_base + IOAT_PCI_CAP_ENABLE_OFFSET);
+       if ((pcie_control & IOAT_PCI_CAP_ENABLE_MEMWR) == 0) {
+               pcie_control |= IOAT_PCI_CAP_ENABLE_MEMWR;
+               writew(pcie_control,
+                      ioatdca->dca_base + IOAT_PCI_CAP_ENABLE_OFFSET);
+       }
+
+
+       /* TODO version, compatibility and configuration checks */
+
+       /* copy out the APIC to DCA tag map */
+       tag_map = readl(ioatdca->dca_base + IOAT_APICID_TAG_MAP_OFFSET);
+       for (i = 0; i < 5; i++) {
+               bit = (tag_map >> (4 * i)) & 0x0f;
+               if (bit < 8)
+                       ioatdca->tag_map[i] = bit | DCA_TAG_MAP_VALID;
+               else
+                       ioatdca->tag_map[i] = 0;
+       }
+
+       err = register_dca_provider(dca, &pdev->dev);
+       if (err) {
+               free_dca_provider(dca);
+               return NULL;
+       }
+
+       return dca;
+}
index 7e4a785c2dff6fdb5d1640e9b0499974f27f8cc5..c1c2dcc6fc2eea413ed8367a4e839b93a7f2362e 100644 (file)
 #include "ioatdma_registers.h"
 #include "ioatdma_hw.h"
 
-#define INITIAL_IOAT_DESC_COUNT 128
-
 #define to_ioat_chan(chan) container_of(chan, struct ioat_dma_chan, common)
 #define to_ioatdma_device(dev) container_of(dev, struct ioatdma_device, common)
 #define to_ioat_desc(lh) container_of(lh, struct ioat_desc_sw, node)
 #define tx_to_ioat_desc(tx) container_of(tx, struct ioat_desc_sw, async_tx)
 
+static int ioat_pending_level = 4;
+module_param(ioat_pending_level, int, 0644);
+MODULE_PARM_DESC(ioat_pending_level,
+                "high-water mark for pushing ioat descriptors (default: 4)");
+
 /* internal functions */
 static void ioat_dma_start_null_desc(struct ioat_dma_chan *ioat_chan);
 static void ioat_dma_memcpy_cleanup(struct ioat_dma_chan *ioat_chan);
+
+static struct ioat_desc_sw *
+ioat1_dma_get_next_descriptor(struct ioat_dma_chan *ioat_chan);
 static struct ioat_desc_sw *
-ioat_dma_get_next_descriptor(struct ioat_dma_chan *ioat_chan);
+ioat2_dma_get_next_descriptor(struct ioat_dma_chan *ioat_chan);
 
 static inline struct ioat_dma_chan *ioat_lookup_chan_by_index(
                                                struct ioatdma_device *device,
@@ -130,6 +136,12 @@ static int ioat_dma_enumerate_channels(struct ioatdma_device *device)
                ioat_chan->device = device;
                ioat_chan->reg_base = device->reg_base + (0x80 * (i + 1));
                ioat_chan->xfercap = xfercap;
+               ioat_chan->desccount = 0;
+               if (ioat_chan->device->version != IOAT_VER_1_2) {
+                       writel(IOAT_DCACTRL_CMPL_WRITE_ENABLE
+                                       | IOAT_DMA_DCA_ANY_CPU,
+                               ioat_chan->reg_base + IOAT_DCACTRL_OFFSET);
+               }
                spin_lock_init(&ioat_chan->cleanup_lock);
                spin_lock_init(&ioat_chan->desc_lock);
                INIT_LIST_HEAD(&ioat_chan->free_desc);
@@ -161,13 +173,17 @@ static void ioat_set_dest(dma_addr_t addr,
        tx_to_ioat_desc(tx)->dst = addr;
 }
 
-static dma_cookie_t ioat_tx_submit(struct dma_async_tx_descriptor *tx)
+static inline void __ioat1_dma_memcpy_issue_pending(
+                                              struct ioat_dma_chan *ioat_chan);
+static inline void __ioat2_dma_memcpy_issue_pending(
+                                              struct ioat_dma_chan *ioat_chan);
+
+static dma_cookie_t ioat1_tx_submit(struct dma_async_tx_descriptor *tx)
 {
        struct ioat_dma_chan *ioat_chan = to_ioat_chan(tx->chan);
        struct ioat_desc_sw *first = tx_to_ioat_desc(tx);
        struct ioat_desc_sw *prev, *new;
        struct ioat_dma_descriptor *hw;
-       int append = 0;
        dma_cookie_t cookie;
        LIST_HEAD(new_chain);
        u32 copy;
@@ -209,7 +225,7 @@ static dma_cookie_t ioat_tx_submit(struct dma_async_tx_descriptor *tx)
                list_add_tail(&new->node, &new_chain);
                desc_count++;
                prev = new;
-       } while (len && (new = ioat_dma_get_next_descriptor(ioat_chan)));
+       } while (len && (new = ioat1_dma_get_next_descriptor(ioat_chan)));
 
        hw->ctl = IOAT_DMA_DESCRIPTOR_CTL_CP_STS;
        if (new->async_tx.callback) {
@@ -246,20 +262,98 @@ static dma_cookie_t ioat_tx_submit(struct dma_async_tx_descriptor *tx)
                                                        first->async_tx.phys;
        __list_splice(&new_chain, ioat_chan->used_desc.prev);
 
+       ioat_chan->dmacount += desc_count;
        ioat_chan->pending += desc_count;
-       if (ioat_chan->pending >= 4) {
-               append = 1;
-               ioat_chan->pending = 0;
-       }
+       if (ioat_chan->pending >= ioat_pending_level)
+               __ioat1_dma_memcpy_issue_pending(ioat_chan);
        spin_unlock_bh(&ioat_chan->desc_lock);
 
-       if (append)
-               writeb(IOAT_CHANCMD_APPEND,
-                       ioat_chan->reg_base + IOAT_CHANCMD_OFFSET);
+       return cookie;
+}
+
+static dma_cookie_t ioat2_tx_submit(struct dma_async_tx_descriptor *tx)
+{
+       struct ioat_dma_chan *ioat_chan = to_ioat_chan(tx->chan);
+       struct ioat_desc_sw *first = tx_to_ioat_desc(tx);
+       struct ioat_desc_sw *new;
+       struct ioat_dma_descriptor *hw;
+       dma_cookie_t cookie;
+       u32 copy;
+       size_t len;
+       dma_addr_t src, dst;
+       int orig_ack;
+       unsigned int desc_count = 0;
+
+       /* src and dest and len are stored in the initial descriptor */
+       len = first->len;
+       src = first->src;
+       dst = first->dst;
+       orig_ack = first->async_tx.ack;
+       new = first;
+
+       /* ioat_chan->desc_lock is still in force in version 2 path */
+
+       do {
+               copy = min((u32) len, ioat_chan->xfercap);
+
+               new->async_tx.ack = 1;
+
+               hw = new->hw;
+               hw->size = copy;
+               hw->ctl = 0;
+               hw->src_addr = src;
+               hw->dst_addr = dst;
+
+               len -= copy;
+               dst += copy;
+               src += copy;
+               desc_count++;
+       } while (len && (new = ioat2_dma_get_next_descriptor(ioat_chan)));
+
+       hw->ctl = IOAT_DMA_DESCRIPTOR_CTL_CP_STS;
+       if (new->async_tx.callback) {
+               hw->ctl |= IOAT_DMA_DESCRIPTOR_CTL_INT_GN;
+               if (first != new) {
+                       /* move callback into to last desc */
+                       new->async_tx.callback = first->async_tx.callback;
+                       new->async_tx.callback_param
+                                       = first->async_tx.callback_param;
+                       first->async_tx.callback = NULL;
+                       first->async_tx.callback_param = NULL;
+               }
+       }
+
+       new->tx_cnt = desc_count;
+       new->async_tx.ack = orig_ack; /* client is in control of this ack */
+
+       /* store the original values for use in later cleanup */
+       if (new != first) {
+               new->src = first->src;
+               new->dst = first->dst;
+               new->len = first->len;
+       }
+
+       /* cookie incr and addition to used_list must be atomic */
+       cookie = ioat_chan->common.cookie;
+       cookie++;
+       if (cookie < 0)
+               cookie = 1;
+       ioat_chan->common.cookie = new->async_tx.cookie = cookie;
+
+       ioat_chan->dmacount += desc_count;
+       ioat_chan->pending += desc_count;
+       if (ioat_chan->pending >= ioat_pending_level)
+               __ioat2_dma_memcpy_issue_pending(ioat_chan);
+       spin_unlock_bh(&ioat_chan->desc_lock);
 
        return cookie;
 }
 
+/**
+ * ioat_dma_alloc_descriptor - allocate and return a sw and hw descriptor pair
+ * @ioat_chan: the channel supplying the memory pool for the descriptors
+ * @flags: allocation flags
+ */
 static struct ioat_desc_sw *ioat_dma_alloc_descriptor(
                                        struct ioat_dma_chan *ioat_chan,
                                        gfp_t flags)
@@ -284,15 +378,57 @@ static struct ioat_desc_sw *ioat_dma_alloc_descriptor(
        dma_async_tx_descriptor_init(&desc_sw->async_tx, &ioat_chan->common);
        desc_sw->async_tx.tx_set_src = ioat_set_src;
        desc_sw->async_tx.tx_set_dest = ioat_set_dest;
-       desc_sw->async_tx.tx_submit = ioat_tx_submit;
+       switch (ioat_chan->device->version) {
+       case IOAT_VER_1_2:
+               desc_sw->async_tx.tx_submit = ioat1_tx_submit;
+               break;
+       case IOAT_VER_2_0:
+               desc_sw->async_tx.tx_submit = ioat2_tx_submit;
+               break;
+       }
        INIT_LIST_HEAD(&desc_sw->async_tx.tx_list);
+
        desc_sw->hw = desc;
        desc_sw->async_tx.phys = phys;
 
        return desc_sw;
 }
 
-/* returns the actual number of allocated descriptors */
+static int ioat_initial_desc_count = 256;
+module_param(ioat_initial_desc_count, int, 0644);
+MODULE_PARM_DESC(ioat_initial_desc_count,
+                "initial descriptors per channel (default: 256)");
+
+/**
+ * ioat2_dma_massage_chan_desc - link the descriptors into a circle
+ * @ioat_chan: the channel to be massaged
+ */
+static void ioat2_dma_massage_chan_desc(struct ioat_dma_chan *ioat_chan)
+{
+       struct ioat_desc_sw *desc, *_desc;
+
+       /* setup used_desc */
+       ioat_chan->used_desc.next = ioat_chan->free_desc.next;
+       ioat_chan->used_desc.prev = NULL;
+
+       /* pull free_desc out of the circle so that every node is a hw
+        * descriptor, but leave it pointing to the list
+        */
+       ioat_chan->free_desc.prev->next = ioat_chan->free_desc.next;
+       ioat_chan->free_desc.next->prev = ioat_chan->free_desc.prev;
+
+       /* circle link the hw descriptors */
+       desc = to_ioat_desc(ioat_chan->free_desc.next);
+       desc->hw->next = to_ioat_desc(desc->node.next)->async_tx.phys;
+       list_for_each_entry_safe(desc, _desc, ioat_chan->free_desc.next, node) {
+               desc->hw->next = to_ioat_desc(desc->node.next)->async_tx.phys;
+       }
+}
+
+/**
+ * ioat_dma_alloc_chan_resources - returns the number of allocated descriptors
+ * @chan: the channel to be filled out
+ */
 static int ioat_dma_alloc_chan_resources(struct dma_chan *chan)
 {
        struct ioat_dma_chan *ioat_chan = to_ioat_chan(chan);
@@ -304,7 +440,7 @@ static int ioat_dma_alloc_chan_resources(struct dma_chan *chan)
 
        /* have we already been set up? */
        if (!list_empty(&ioat_chan->free_desc))
-               return INITIAL_IOAT_DESC_COUNT;
+               return ioat_chan->desccount;
 
        /* Setup register to interrupt and write completion status on error */
        chanctrl = IOAT_CHANCTRL_ERR_INT_EN |
@@ -320,7 +456,7 @@ static int ioat_dma_alloc_chan_resources(struct dma_chan *chan)
        }
 
        /* Allocate descriptors */
-       for (i = 0; i < INITIAL_IOAT_DESC_COUNT; i++) {
+       for (i = 0; i < ioat_initial_desc_count; i++) {
                desc = ioat_dma_alloc_descriptor(ioat_chan, GFP_KERNEL);
                if (!desc) {
                        dev_err(&ioat_chan->device->pdev->dev,
@@ -330,7 +466,10 @@ static int ioat_dma_alloc_chan_resources(struct dma_chan *chan)
                list_add_tail(&desc->node, &tmp_list);
        }
        spin_lock_bh(&ioat_chan->desc_lock);
+       ioat_chan->desccount = i;
        list_splice(&tmp_list, &ioat_chan->free_desc);
+       if (ioat_chan->device->version != IOAT_VER_1_2)
+               ioat2_dma_massage_chan_desc(ioat_chan);
        spin_unlock_bh(&ioat_chan->desc_lock);
 
        /* allocate a completion writeback area */
@@ -347,10 +486,14 @@ static int ioat_dma_alloc_chan_resources(struct dma_chan *chan)
               ioat_chan->reg_base + IOAT_CHANCMP_OFFSET_HIGH);
 
        tasklet_enable(&ioat_chan->cleanup_task);
-       ioat_dma_start_null_desc(ioat_chan);
-       return i;
+       ioat_dma_start_null_desc(ioat_chan);  /* give chain to dma device */
+       return ioat_chan->desccount;
 }
 
+/**
+ * ioat_dma_free_chan_resources - release all the descriptors
+ * @chan: the channel to be cleaned
+ */
 static void ioat_dma_free_chan_resources(struct dma_chan *chan)
 {
        struct ioat_dma_chan *ioat_chan = to_ioat_chan(chan);
@@ -364,22 +507,45 @@ static void ioat_dma_free_chan_resources(struct dma_chan *chan)
        /* Delay 100ms after reset to allow internal DMA logic to quiesce
         * before removing DMA descriptor resources.
         */
-       writeb(IOAT_CHANCMD_RESET, ioat_chan->reg_base + IOAT_CHANCMD_OFFSET);
+       writeb(IOAT_CHANCMD_RESET,
+              ioat_chan->reg_base
+                       + IOAT_CHANCMD_OFFSET(ioat_chan->device->version));
        mdelay(100);
 
        spin_lock_bh(&ioat_chan->desc_lock);
-       list_for_each_entry_safe(desc, _desc, &ioat_chan->used_desc, node) {
-               in_use_descs++;
-               list_del(&desc->node);
-               pci_pool_free(ioatdma_device->dma_pool, desc->hw,
-                             desc->async_tx.phys);
-               kfree(desc);
-       }
-       list_for_each_entry_safe(desc, _desc, &ioat_chan->free_desc, node) {
-               list_del(&desc->node);
+       switch (ioat_chan->device->version) {
+       case IOAT_VER_1_2:
+               list_for_each_entry_safe(desc, _desc,
+                                        &ioat_chan->used_desc, node) {
+                       in_use_descs++;
+                       list_del(&desc->node);
+                       pci_pool_free(ioatdma_device->dma_pool, desc->hw,
+                                     desc->async_tx.phys);
+                       kfree(desc);
+               }
+               list_for_each_entry_safe(desc, _desc,
+                                        &ioat_chan->free_desc, node) {
+                       list_del(&desc->node);
+                       pci_pool_free(ioatdma_device->dma_pool, desc->hw,
+                                     desc->async_tx.phys);
+                       kfree(desc);
+               }
+               break;
+       case IOAT_VER_2_0:
+               list_for_each_entry_safe(desc, _desc,
+                                        ioat_chan->free_desc.next, node) {
+                       list_del(&desc->node);
+                       pci_pool_free(ioatdma_device->dma_pool, desc->hw,
+                                     desc->async_tx.phys);
+                       kfree(desc);
+               }
+               desc = to_ioat_desc(ioat_chan->free_desc.next);
                pci_pool_free(ioatdma_device->dma_pool, desc->hw,
                              desc->async_tx.phys);
                kfree(desc);
+               INIT_LIST_HEAD(&ioat_chan->free_desc);
+               INIT_LIST_HEAD(&ioat_chan->used_desc);
+               break;
        }
        spin_unlock_bh(&ioat_chan->desc_lock);
 
@@ -395,6 +561,7 @@ static void ioat_dma_free_chan_resources(struct dma_chan *chan)
 
        ioat_chan->last_completion = ioat_chan->completion_addr = 0;
        ioat_chan->pending = 0;
+       ioat_chan->dmacount = 0;
 }
 
 /**
@@ -406,7 +573,7 @@ static void ioat_dma_free_chan_resources(struct dma_chan *chan)
  * has run out.
  */
 static struct ioat_desc_sw *
-ioat_dma_get_next_descriptor(struct ioat_dma_chan *ioat_chan)
+ioat1_dma_get_next_descriptor(struct ioat_dma_chan *ioat_chan)
 {
        struct ioat_desc_sw *new = NULL;
 
@@ -425,7 +592,82 @@ ioat_dma_get_next_descriptor(struct ioat_dma_chan *ioat_chan)
        return new;
 }
 
-static struct dma_async_tx_descriptor *ioat_dma_prep_memcpy(
+static struct ioat_desc_sw *
+ioat2_dma_get_next_descriptor(struct ioat_dma_chan *ioat_chan)
+{
+       struct ioat_desc_sw *new = NULL;
+
+       /*
+        * used.prev points to where to start processing
+        * used.next points to next free descriptor
+        * if used.prev == NULL, there are none waiting to be processed
+        * if used.next == used.prev.prev, there is only one free descriptor,
+        *      and we need to use it to as a noop descriptor before
+        *      linking in a new set of descriptors, since the device
+        *      has probably already read the pointer to it
+        */
+       if (ioat_chan->used_desc.prev &&
+           ioat_chan->used_desc.next == ioat_chan->used_desc.prev->prev) {
+
+               struct ioat_desc_sw *desc = NULL;
+               struct ioat_desc_sw *noop_desc = NULL;
+               int i;
+
+               /* set up the noop descriptor */
+               noop_desc = to_ioat_desc(ioat_chan->used_desc.next);
+               noop_desc->hw->size = 0;
+               noop_desc->hw->ctl = IOAT_DMA_DESCRIPTOR_NUL;
+               noop_desc->hw->src_addr = 0;
+               noop_desc->hw->dst_addr = 0;
+
+               ioat_chan->used_desc.next = ioat_chan->used_desc.next->next;
+               ioat_chan->pending++;
+               ioat_chan->dmacount++;
+
+               /* get a few more descriptors */
+               for (i = 16; i; i--) {
+                       desc = ioat_dma_alloc_descriptor(ioat_chan, GFP_ATOMIC);
+                       BUG_ON(!desc);
+                       list_add_tail(&desc->node, ioat_chan->used_desc.next);
+
+                       desc->hw->next
+                               = to_ioat_desc(desc->node.next)->async_tx.phys;
+                       to_ioat_desc(desc->node.prev)->hw->next
+                               = desc->async_tx.phys;
+                       ioat_chan->desccount++;
+               }
+
+               ioat_chan->used_desc.next = noop_desc->node.next;
+       }
+       new = to_ioat_desc(ioat_chan->used_desc.next);
+       prefetch(new);
+       ioat_chan->used_desc.next = new->node.next;
+
+       if (ioat_chan->used_desc.prev == NULL)
+               ioat_chan->used_desc.prev = &new->node;
+
+       prefetch(new->hw);
+       return new;
+}
+
+static struct ioat_desc_sw *ioat_dma_get_next_descriptor(
+                                               struct ioat_dma_chan *ioat_chan)
+{
+       if (!ioat_chan)
+               return NULL;
+
+       switch (ioat_chan->device->version) {
+       case IOAT_VER_1_2:
+               return ioat1_dma_get_next_descriptor(ioat_chan);
+               break;
+       case IOAT_VER_2_0:
+               return ioat2_dma_get_next_descriptor(ioat_chan);
+               break;
+       }
+       return NULL;
+}
+
+static struct dma_async_tx_descriptor *ioat1_dma_prep_memcpy(
                                                struct dma_chan *chan,
                                                size_t len,
                                                int int_en)
@@ -441,19 +683,62 @@ static struct dma_async_tx_descriptor *ioat_dma_prep_memcpy(
        return new ? &new->async_tx : NULL;
 }
 
+static struct dma_async_tx_descriptor *ioat2_dma_prep_memcpy(
+                                               struct dma_chan *chan,
+                                               size_t len,
+                                               int int_en)
+{
+       struct ioat_dma_chan *ioat_chan = to_ioat_chan(chan);
+       struct ioat_desc_sw *new;
+
+       spin_lock_bh(&ioat_chan->desc_lock);
+       new = ioat2_dma_get_next_descriptor(ioat_chan);
+       new->len = len;
+
+       /* leave ioat_chan->desc_lock set in version 2 path */
+       return new ? &new->async_tx : NULL;
+}
+
+
 /**
  * ioat_dma_memcpy_issue_pending - push potentially unrecognized appended
  *                                 descriptors to hw
  * @chan: DMA channel handle
  */
-static void ioat_dma_memcpy_issue_pending(struct dma_chan *chan)
+static inline void __ioat1_dma_memcpy_issue_pending(
+                                               struct ioat_dma_chan *ioat_chan)
+{
+       ioat_chan->pending = 0;
+       writeb(IOAT_CHANCMD_APPEND, ioat_chan->reg_base + IOAT1_CHANCMD_OFFSET);
+}
+
+static void ioat1_dma_memcpy_issue_pending(struct dma_chan *chan)
 {
        struct ioat_dma_chan *ioat_chan = to_ioat_chan(chan);
 
        if (ioat_chan->pending != 0) {
-               ioat_chan->pending = 0;
-               writeb(IOAT_CHANCMD_APPEND,
-                      ioat_chan->reg_base + IOAT_CHANCMD_OFFSET);
+               spin_lock_bh(&ioat_chan->desc_lock);
+               __ioat1_dma_memcpy_issue_pending(ioat_chan);
+               spin_unlock_bh(&ioat_chan->desc_lock);
+       }
+}
+
+static inline void __ioat2_dma_memcpy_issue_pending(
+                                               struct ioat_dma_chan *ioat_chan)
+{
+       ioat_chan->pending = 0;
+       writew(ioat_chan->dmacount,
+              ioat_chan->reg_base + IOAT_CHAN_DMACOUNT_OFFSET);
+}
+
+static void ioat2_dma_memcpy_issue_pending(struct dma_chan *chan)
+{
+       struct ioat_dma_chan *ioat_chan = to_ioat_chan(chan);
+
+       if (ioat_chan->pending != 0) {
+               spin_lock_bh(&ioat_chan->desc_lock);
+               __ioat2_dma_memcpy_issue_pending(ioat_chan);
+               spin_unlock_bh(&ioat_chan->desc_lock);
        }
 }
 
@@ -465,11 +750,17 @@ static void ioat_dma_cleanup_tasklet(unsigned long data)
               chan->reg_base + IOAT_CHANCTRL_OFFSET);
 }
 
+/**
+ * ioat_dma_memcpy_cleanup - cleanup up finished descriptors
+ * @chan: ioat channel to be cleaned up
+ */
 static void ioat_dma_memcpy_cleanup(struct ioat_dma_chan *ioat_chan)
 {
        unsigned long phys_complete;
        struct ioat_desc_sw *desc, *_desc;
        dma_cookie_t cookie = 0;
+       unsigned long desc_phys;
+       struct ioat_desc_sw *latest_desc;
 
        prefetch(ioat_chan->completion_virt);
 
@@ -507,56 +798,115 @@ static void ioat_dma_memcpy_cleanup(struct ioat_dma_chan *ioat_chan)
 
        cookie = 0;
        spin_lock_bh(&ioat_chan->desc_lock);
-       list_for_each_entry_safe(desc, _desc, &ioat_chan->used_desc, node) {
-
-               /*
-                * Incoming DMA requests may use multiple descriptors, due to
-                * exceeding xfercap, perhaps. If so, only the last one will
-                * have a cookie, and require unmapping.
-                */
-               if (desc->async_tx.cookie) {
-                       cookie = desc->async_tx.cookie;
+       switch (ioat_chan->device->version) {
+       case IOAT_VER_1_2:
+               list_for_each_entry_safe(desc, _desc,
+                                        &ioat_chan->used_desc, node) {
 
                        /*
-                        * yes we are unmapping both _page and _single alloc'd
-                        * regions with unmap_page. Is this *really* that bad?
+                        * Incoming DMA requests may use multiple descriptors,
+                        * due to exceeding xfercap, perhaps. If so, only the
+                        * last one will have a cookie, and require unmapping.
                         */
-                       pci_unmap_page(ioat_chan->device->pdev,
-                                       pci_unmap_addr(desc, dst),
-                                       pci_unmap_len(desc, len),
-                                       PCI_DMA_FROMDEVICE);
-                       pci_unmap_page(ioat_chan->device->pdev,
-                                       pci_unmap_addr(desc, src),
-                                       pci_unmap_len(desc, len),
-                                       PCI_DMA_TODEVICE);
-                       if (desc->async_tx.callback) {
-                               desc->async_tx.callback(
-                                               desc->async_tx.callback_param);
-                               desc->async_tx.callback = NULL;
+                       if (desc->async_tx.cookie) {
+                               cookie = desc->async_tx.cookie;
+
+                               /*
+                                * yes we are unmapping both _page and _single
+                                * alloc'd regions with unmap_page. Is this
+                                * *really* that bad?
+                                */
+                               pci_unmap_page(ioat_chan->device->pdev,
+                                               pci_unmap_addr(desc, dst),
+                                               pci_unmap_len(desc, len),
+                                               PCI_DMA_FROMDEVICE);
+                               pci_unmap_page(ioat_chan->device->pdev,
+                                               pci_unmap_addr(desc, src),
+                                               pci_unmap_len(desc, len),
+                                               PCI_DMA_TODEVICE);
+
+                               if (desc->async_tx.callback) {
+                                       desc->async_tx.callback(desc->async_tx.callback_param);
+                                       desc->async_tx.callback = NULL;
+                               }
                        }
-               }
 
-               if (desc->async_tx.phys != phys_complete) {
-                       /*
-                        * a completed entry, but not the last, so cleanup
-                        * if the client is done with the descriptor
-                        */
-                       if (desc->async_tx.ack) {
-                               list_del(&desc->node);
-                               list_add_tail(&desc->node,
-                                             &ioat_chan->free_desc);
-                       } else
+                       if (desc->async_tx.phys != phys_complete) {
+                               /*
+                                * a completed entry, but not the last, so clean
+                                * up if the client is done with the descriptor
+                                */
+                               if (desc->async_tx.ack) {
+                                       list_del(&desc->node);
+                                       list_add_tail(&desc->node,
+                                                     &ioat_chan->free_desc);
+                               } else
+                                       desc->async_tx.cookie = 0;
+                       } else {
+                               /*
+                                * last used desc. Do not remove, so we can
+                                * append from it, but don't look at it next
+                                * time, either
+                                */
                                desc->async_tx.cookie = 0;
-               } else {
-                       /*
-                        * last used desc. Do not remove, so we can append from
-                        * it, but don't look at it next time, either
-                        */
-                       desc->async_tx.cookie = 0;
 
-                       /* TODO check status bits? */
+                               /* TODO check status bits? */
+                               break;
+                       }
+               }
+               break;
+       case IOAT_VER_2_0:
+               /* has some other thread has already cleaned up? */
+               if (ioat_chan->used_desc.prev == NULL)
                        break;
+
+               /* work backwards to find latest finished desc */
+               desc = to_ioat_desc(ioat_chan->used_desc.next);
+               latest_desc = NULL;
+               do {
+                       desc = to_ioat_desc(desc->node.prev);
+                       desc_phys = (unsigned long)desc->async_tx.phys
+                                      & IOAT_CHANSTS_COMPLETED_DESCRIPTOR_ADDR;
+                       if (desc_phys == phys_complete) {
+                               latest_desc = desc;
+                               break;
+                       }
+               } while (&desc->node != ioat_chan->used_desc.prev);
+
+               if (latest_desc != NULL) {
+
+                       /* work forwards to clear finished descriptors */
+                       for (desc = to_ioat_desc(ioat_chan->used_desc.prev);
+                            &desc->node != latest_desc->node.next &&
+                            &desc->node != ioat_chan->used_desc.next;
+                            desc = to_ioat_desc(desc->node.next)) {
+                               if (desc->async_tx.cookie) {
+                                       cookie = desc->async_tx.cookie;
+                                       desc->async_tx.cookie = 0;
+
+                                       pci_unmap_page(ioat_chan->device->pdev,
+                                                     pci_unmap_addr(desc, dst),
+                                                     pci_unmap_len(desc, len),
+                                                     PCI_DMA_FROMDEVICE);
+                                       pci_unmap_page(ioat_chan->device->pdev,
+                                                     pci_unmap_addr(desc, src),
+                                                     pci_unmap_len(desc, len),
+                                                     PCI_DMA_TODEVICE);
+
+                                       if (desc->async_tx.callback) {
+                                               desc->async_tx.callback(desc->async_tx.callback_param);
+                                               desc->async_tx.callback = NULL;
+                                       }
+                               }
+                       }
+
+                       /* move used.prev up beyond those that are finished */
+                       if (&desc->node == ioat_chan->used_desc.next)
+                               ioat_chan->used_desc.prev = NULL;
+                       else
+                               ioat_chan->used_desc.prev = &desc->node;
                }
+               break;
        }
 
        spin_unlock_bh(&ioat_chan->desc_lock);
@@ -621,8 +971,6 @@ static enum dma_status ioat_dma_is_complete(struct dma_chan *chan,
        return dma_async_is_complete(cookie, last_complete, last_used);
 }
 
-/* PCI API */
-
 static void ioat_dma_start_null_desc(struct ioat_dma_chan *ioat_chan)
 {
        struct ioat_desc_sw *desc;
@@ -633,21 +981,34 @@ static void ioat_dma_start_null_desc(struct ioat_dma_chan *ioat_chan)
        desc->hw->ctl = IOAT_DMA_DESCRIPTOR_NUL
                                | IOAT_DMA_DESCRIPTOR_CTL_INT_GN
                                | IOAT_DMA_DESCRIPTOR_CTL_CP_STS;
-       desc->hw->next = 0;
        desc->hw->size = 0;
        desc->hw->src_addr = 0;
        desc->hw->dst_addr = 0;
        desc->async_tx.ack = 1;
-
-       list_add_tail(&desc->node, &ioat_chan->used_desc);
+       switch (ioat_chan->device->version) {
+       case IOAT_VER_1_2:
+               desc->hw->next = 0;
+               list_add_tail(&desc->node, &ioat_chan->used_desc);
+
+               writel(((u64) desc->async_tx.phys) & 0x00000000FFFFFFFF,
+                      ioat_chan->reg_base + IOAT1_CHAINADDR_OFFSET_LOW);
+               writel(((u64) desc->async_tx.phys) >> 32,
+                      ioat_chan->reg_base + IOAT1_CHAINADDR_OFFSET_HIGH);
+
+               writeb(IOAT_CHANCMD_START, ioat_chan->reg_base
+                       + IOAT_CHANCMD_OFFSET(ioat_chan->device->version));
+               break;
+       case IOAT_VER_2_0:
+               writel(((u64) desc->async_tx.phys) & 0x00000000FFFFFFFF,
+                      ioat_chan->reg_base + IOAT2_CHAINADDR_OFFSET_LOW);
+               writel(((u64) desc->async_tx.phys) >> 32,
+                      ioat_chan->reg_base + IOAT2_CHAINADDR_OFFSET_HIGH);
+
+               ioat_chan->dmacount++;
+               __ioat2_dma_memcpy_issue_pending(ioat_chan);
+               break;
+       }
        spin_unlock_bh(&ioat_chan->desc_lock);
-
-       writel(((u64) desc->async_tx.phys) & 0x00000000FFFFFFFF,
-              ioat_chan->reg_base + IOAT_CHAINADDR_OFFSET_LOW);
-       writel(((u64) desc->async_tx.phys) >> 32,
-              ioat_chan->reg_base + IOAT_CHAINADDR_OFFSET_HIGH);
-
-       writeb(IOAT_CHANCMD_START, ioat_chan->reg_base + IOAT_CHANCMD_OFFSET);
 }
 
 /*
@@ -693,14 +1054,14 @@ static int ioat_dma_self_test(struct ioatdma_device *device)
        dma_chan = container_of(device->common.channels.next,
                                struct dma_chan,
                                device_node);
-       if (ioat_dma_alloc_chan_resources(dma_chan) < 1) {
+       if (device->common.device_alloc_chan_resources(dma_chan) < 1) {
                dev_err(&device->pdev->dev,
                        "selftest cannot allocate chan resource\n");
                err = -ENODEV;
                goto out;
        }
 
-       tx = ioat_dma_prep_memcpy(dma_chan, IOAT_TEST_SIZE, 0);
+       tx = device->common.device_prep_dma_memcpy(dma_chan, IOAT_TEST_SIZE, 0);
        if (!tx) {
                dev_err(&device->pdev->dev,
                        "Self-test prep failed, disabling\n");
@@ -710,24 +1071,25 @@ static int ioat_dma_self_test(struct ioatdma_device *device)
 
        async_tx_ack(tx);
        addr = dma_map_single(dma_chan->device->dev, src, IOAT_TEST_SIZE,
-                       DMA_TO_DEVICE);
-       ioat_set_src(addr, tx, 0);
+                             DMA_TO_DEVICE);
+       tx->tx_set_src(addr, tx, 0);
        addr = dma_map_single(dma_chan->device->dev, dest, IOAT_TEST_SIZE,
-                       DMA_FROM_DEVICE);
-       ioat_set_dest(addr, tx, 0);
+                             DMA_FROM_DEVICE);
+       tx->tx_set_dest(addr, tx, 0);
        tx->callback = ioat_dma_test_callback;
        tx->callback_param = (void *)0x8086;
-       cookie = ioat_tx_submit(tx);
+       cookie = tx->tx_submit(tx);
        if (cookie < 0) {
                dev_err(&device->pdev->dev,
                        "Self-test setup failed, disabling\n");
                err = -ENODEV;
                goto free_resources;
        }
-       ioat_dma_memcpy_issue_pending(dma_chan);
+       device->common.device_issue_pending(dma_chan);
        msleep(1);
 
-       if (ioat_dma_is_complete(dma_chan, cookie, NULL, NULL) != DMA_SUCCESS) {
+       if (device->common.device_is_tx_complete(dma_chan, cookie, NULL, NULL)
+                                       != DMA_SUCCESS) {
                dev_err(&device->pdev->dev,
                        "Self-test copy timed out, disabling\n");
                err = -ENODEV;
@@ -741,7 +1103,7 @@ static int ioat_dma_self_test(struct ioatdma_device *device)
        }
 
 free_resources:
-       ioat_dma_free_chan_resources(dma_chan);
+       device->common.device_free_chan_resources(dma_chan);
 out:
        kfree(src);
        kfree(dest);
@@ -941,16 +1303,28 @@ struct ioatdma_device *ioat_dma_probe(struct pci_dev *pdev,
        INIT_LIST_HEAD(&device->common.channels);
        ioat_dma_enumerate_channels(device);
 
-       dma_cap_set(DMA_MEMCPY, device->common.cap_mask);
        device->common.device_alloc_chan_resources =
                                                ioat_dma_alloc_chan_resources;
        device->common.device_free_chan_resources =
                                                ioat_dma_free_chan_resources;
-       device->common.device_prep_dma_memcpy = ioat_dma_prep_memcpy;
+       device->common.dev = &pdev->dev;
+
+       dma_cap_set(DMA_MEMCPY, device->common.cap_mask);
        device->common.device_is_tx_complete = ioat_dma_is_complete;
-       device->common.device_issue_pending = ioat_dma_memcpy_issue_pending;
        device->common.device_dependency_added = ioat_dma_dependency_added;
-       device->common.dev = &pdev->dev;
+       switch (device->version) {
+       case IOAT_VER_1_2:
+               device->common.device_prep_dma_memcpy = ioat1_dma_prep_memcpy;
+               device->common.device_issue_pending =
+                                               ioat1_dma_memcpy_issue_pending;
+               break;
+       case IOAT_VER_2_0:
+               device->common.device_prep_dma_memcpy = ioat2_dma_prep_memcpy;
+               device->common.device_issue_pending =
+                                               ioat2_dma_memcpy_issue_pending;
+               break;
+       }
+
        dev_err(&device->pdev->dev,
                "Intel(R) I/OAT DMA Engine found,"
                " %d channels, device version 0x%02x, driver version %s\n",
index 5f9881e7b0ed25bc2722ac67c3f2b2cd10a1ed4d..b668234ef654b2590e88d752c4cf83d53a4d2585 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 2004 - 2006 Intel Corporation. All rights reserved.
+ * Copyright(c) 2004 - 2007 Intel Corporation. All rights reserved.
  *
  * 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
@@ -28,7 +28,7 @@
 #include <linux/cache.h>
 #include <linux/pci_ids.h>
 
-#define IOAT_DMA_VERSION "1.26"
+#define IOAT_DMA_VERSION  "2.04"
 
 enum ioat_interrupt {
        none = 0,
@@ -39,6 +39,8 @@ enum ioat_interrupt {
 };
 
 #define IOAT_LOW_COMPLETION_MASK       0xffffffc0
+#define IOAT_DMA_DCA_ANY_CPU           ~0
+
 
 /**
  * struct ioatdma_device - internal representation of a IOAT device
@@ -47,6 +49,9 @@ enum ioat_interrupt {
  * @dma_pool: for allocating DMA descriptors
  * @common: embedded struct dma_device
  * @version: version of ioatdma device
+ * @irq_mode: which style irq to use
+ * @msix_entries: irq handlers
+ * @idx: per channel data
  */
 
 struct ioatdma_device {
@@ -63,23 +68,7 @@ struct ioatdma_device {
 
 /**
  * struct ioat_dma_chan - internal representation of a DMA channel
- * @device:
- * @reg_base:
- * @sw_in_use:
- * @completion:
- * @completion_low:
- * @completion_high:
- * @completed_cookie: last cookie seen completed on cleanup
- * @cookie: value of last cookie given to client
- * @last_completion:
- * @xfercap:
- * @desc_lock:
- * @free_desc:
- * @used_desc:
- * @resource:
- * @device_node:
  */
-
 struct ioat_dma_chan {
 
        void __iomem *reg_base;
@@ -95,6 +84,8 @@ struct ioat_dma_chan {
        struct list_head used_desc;
 
        int pending;
+       int dmacount;
+       int desccount;
 
        struct ioatdma_device *device;
        struct dma_chan common;
@@ -134,12 +125,13 @@ struct ioat_desc_sw {
 struct ioatdma_device *ioat_dma_probe(struct pci_dev *pdev,
                                      void __iomem *iobase);
 void ioat_dma_remove(struct ioatdma_device *device);
-struct dca_provider *ioat_dca_init(struct pci_dev *pdev,
-                                  void __iomem *iobase);
+struct dca_provider *ioat_dca_init(struct pci_dev *pdev, void __iomem *iobase);
+struct dca_provider *ioat2_dca_init(struct pci_dev *pdev, void __iomem *iobase);
 #else
 #define ioat_dma_probe(pdev, iobase)    NULL
 #define ioat_dma_remove(device)         do { } while (0)
 #define ioat_dca_init(pdev, iobase)    NULL
+#define ioat2_dca_init(pdev, iobase)   NULL
 #endif
 
 #endif /* IOATDMA_H */
index 9e7434e1551f9b02ba5bae19dd96b55821622184..dd470fa91d86a4e10d8187e63d095125fb5a8526 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 2004 - 2006 Intel Corporation. All rights reserved.
+ * Copyright(c) 2004 - 2007 Intel Corporation. All rights reserved.
  *
  * 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
 #define _IOAT_HW_H_
 
 /* PCI Configuration Space Values */
-#define IOAT_PCI_VID                   0x8086
-#define IOAT_PCI_DID                   0x1A38
-#define IOAT_PCI_RID                   0x00
-#define IOAT_PCI_SVID                  0x8086
-#define IOAT_PCI_SID                   0x8086
-#define IOAT_VER_1_2                   0x12    /* Version 1.2 */
+#define IOAT_PCI_VID            0x8086
+
+/* CB device ID's */
+#define IOAT_PCI_DID_5000       0x1A38
+#define IOAT_PCI_DID_CNB        0x360B
+#define IOAT_PCI_DID_SCNB       0x65FF
+#define IOAT_PCI_DID_SNB        0x402F
+
+#define IOAT_PCI_RID            0x00
+#define IOAT_PCI_SVID           0x8086
+#define IOAT_PCI_SID            0x8086
+#define IOAT_VER_1_2            0x12    /* Version 1.2 */
+#define IOAT_VER_2_0            0x20    /* Version 2.0 */
 
 struct ioat_dma_descriptor {
        uint32_t        size;
@@ -47,6 +54,16 @@ struct ioat_dma_descriptor {
 #define IOAT_DMA_DESCRIPTOR_CTL_CP_STS 0x00000008
 #define IOAT_DMA_DESCRIPTOR_CTL_FRAME  0x00000010
 #define IOAT_DMA_DESCRIPTOR_NUL                0x00000020
-#define IOAT_DMA_DESCRIPTOR_OPCODE     0xFF000000
+#define IOAT_DMA_DESCRIPTOR_CTL_SP_BRK 0x00000040
+#define IOAT_DMA_DESCRIPTOR_CTL_DP_BRK 0x00000080
+#define IOAT_DMA_DESCRIPTOR_CTL_BNDL   0x00000100
+#define IOAT_DMA_DESCRIPTOR_CTL_DCA    0x00000200
+#define IOAT_DMA_DESCRIPTOR_CTL_BUFHINT        0x00000400
+
+#define IOAT_DMA_DESCRIPTOR_CTL_OPCODE_CONTEXT 0xFF000000
+#define IOAT_DMA_DESCRIPTOR_CTL_OPCODE_DMA     0x00000000
+
+#define IOAT_DMA_DESCRIPTOR_CTL_CONTEXT_DCA    0x00000001
+#define IOAT_DMA_DESCRIPTOR_CTL_OPCODE_MASK    0xFF000000
 
 #endif
index baaab5ea146a757e4faf3ec98ffe9d54d1f18d9b..9832d7ebd931a0a76dafc6d66948b37e4a16da52 100644 (file)
 #define IOAT_INTRCTRL_MASTER_INT_EN            0x01    /* Master Interrupt Enable */
 #define IOAT_INTRCTRL_INT_STATUS               0x02    /* ATTNSTATUS -or- Channel Int */
 #define IOAT_INTRCTRL_INT                      0x04    /* INT_STATUS -and- MASTER_INT_EN */
-#define IOAT_INTRCTRL_MSIX_VECTOR_CONTROL      0x08    /* Enable all MSI-X vectors */
+#define IOAT_INTRCTRL_MSIX_VECTOR_CONTROL      0x08    /* Enable all MSI-X vectors */
 
 #define IOAT_ATTNSTATUS_OFFSET                 0x04    /* Each bit is a channel */
 
 #define IOAT_VER_OFFSET                                0x08    /*  8-bit */
 #define IOAT_VER_MAJOR_MASK                    0xF0
 #define IOAT_VER_MINOR_MASK                    0x0F
-#define GET_IOAT_VER_MAJOR(x)                  ((x) & IOAT_VER_MAJOR_MASK)
+#define GET_IOAT_VER_MAJOR(x)                  (((x) & IOAT_VER_MAJOR_MASK) >> 4)
 #define GET_IOAT_VER_MINOR(x)                  ((x) & IOAT_VER_MINOR_MASK)
 
 #define IOAT_PERPORTOFFSET_OFFSET              0x0A    /* 16-bit */
 
 #define IOAT_INTRDELAY_OFFSET                  0x0C    /* 16-bit */
 #define IOAT_INTRDELAY_INT_DELAY_MASK          0x3FFF  /* Interrupt Delay Time */
-#define IOAT_INTRDELAY_COALESE_SUPPORT         0x8000  /* Interrupt Coalesing Supported */
+#define IOAT_INTRDELAY_COALESE_SUPPORT         0x8000  /* Interrupt Coalescing Supported */
 
 #define IOAT_DEVICE_STATUS_OFFSET              0x0E    /* 16-bit */
 #define IOAT_DEVICE_STATUS_DEGRADED_MODE       0x0001
 
-
 #define IOAT_CHANNEL_MMIO_SIZE                 0x80    /* Each Channel MMIO space is this size */
 
 /* DMA Channel Registers */
 #define IOAT_CHANCTRL_ERR_COMPLETION_EN                0x0004
 #define IOAT_CHANCTRL_INT_DISABLE              0x0001
 
-#define IOAT_DMA_COMP_OFFSET                   0x02    /* 16-bit DMA channel compatability */
-#define IOAT_DMA_COMP_V1                       0x0001  /* Compatability with DMA version 1 */
-
-#define IOAT_CHANSTS_OFFSET                    0x04    /* 64-bit Channel Status Register */
-#define IOAT_CHANSTS_OFFSET_LOW                        0x04
-#define IOAT_CHANSTS_OFFSET_HIGH               0x08
-#define IOAT_CHANSTS_COMPLETED_DESCRIPTOR_ADDR 0xFFFFFFFFFFFFFFC0UL
+#define IOAT_DMA_COMP_OFFSET                   0x02    /* 16-bit DMA channel compatibility */
+#define IOAT_DMA_COMP_V1                       0x0001  /* Compatibility with DMA version 1 */
+#define IOAT_DMA_COMP_V2                       0x0002  /* Compatibility with DMA version 2 */
+
+
+#define IOAT1_CHANSTS_OFFSET           0x04    /* 64-bit Channel Status Register */
+#define IOAT2_CHANSTS_OFFSET           0x08    /* 64-bit Channel Status Register */
+#define IOAT_CHANSTS_OFFSET(ver)               ((ver) < IOAT_VER_2_0 \
+                                               ? IOAT1_CHANSTS_OFFSET : IOAT2_CHANSTS_OFFSET)
+#define IOAT1_CHANSTS_OFFSET_LOW       0x04
+#define IOAT2_CHANSTS_OFFSET_LOW       0x08
+#define IOAT_CHANSTS_OFFSET_LOW(ver)           ((ver) < IOAT_VER_2_0 \
+                                               ? IOAT1_CHANSTS_OFFSET_LOW : IOAT2_CHANSTS_OFFSET_LOW)
+#define IOAT1_CHANSTS_OFFSET_HIGH      0x08
+#define IOAT2_CHANSTS_OFFSET_HIGH      0x0C
+#define IOAT_CHANSTS_OFFSET_HIGH(ver)          ((ver) < IOAT_VER_2_0 \
+                                               ? IOAT1_CHANSTS_OFFSET_HIGH : IOAT2_CHANSTS_OFFSET_HIGH)
+#define IOAT_CHANSTS_COMPLETED_DESCRIPTOR_ADDR ~0x3F
 #define IOAT_CHANSTS_SOFT_ERR                  0x0000000000000010
+#define IOAT_CHANSTS_UNAFFILIATED_ERR          0x0000000000000008
 #define IOAT_CHANSTS_DMA_TRANSFER_STATUS       0x0000000000000007
 #define IOAT_CHANSTS_DMA_TRANSFER_STATUS_ACTIVE        0x0
 #define IOAT_CHANSTS_DMA_TRANSFER_STATUS_DONE  0x1
 #define IOAT_CHANSTS_DMA_TRANSFER_STATUS_SUSPENDED     0x2
 #define IOAT_CHANSTS_DMA_TRANSFER_STATUS_HALTED        0x3
 
-#define IOAT_CHAINADDR_OFFSET                  0x0C    /* 64-bit Descriptor Chain Address Register */
-#define IOAT_CHAINADDR_OFFSET_LOW              0x0C
-#define IOAT_CHAINADDR_OFFSET_HIGH             0x10
 
-#define IOAT_CHANCMD_OFFSET                    0x14    /*  8-bit DMA Channel Command Register */
+
+#define IOAT_CHAN_DMACOUNT_OFFSET      0x06    /* 16-bit DMA Count register */
+
+#define IOAT_DCACTRL_OFFSET         0x30   /* 32 bit Direct Cache Access Control Register */
+#define IOAT_DCACTRL_CMPL_WRITE_ENABLE 0x10000
+#define IOAT_DCACTRL_TARGET_CPU_MASK   0xFFFF /* APIC ID */
+
+/* CB DCA Memory Space Registers */
+#define IOAT_DCAOFFSET_OFFSET       0x14
+/* CB_BAR + IOAT_DCAOFFSET value */
+#define IOAT_DCA_VER_OFFSET         0x00
+#define IOAT_DCA_VER_MAJOR_MASK     0xF0
+#define IOAT_DCA_VER_MINOR_MASK     0x0F
+
+#define IOAT_DCA_COMP_OFFSET        0x02
+#define IOAT_DCA_COMP_V1            0x1
+
+#define IOAT_FSB_CAPABILITY_OFFSET  0x04
+#define IOAT_FSB_CAPABILITY_PREFETCH    0x1
+
+#define IOAT_PCI_CAPABILITY_OFFSET  0x06
+#define IOAT_PCI_CAPABILITY_MEMWR   0x1
+
+#define IOAT_FSB_CAP_ENABLE_OFFSET  0x08
+#define IOAT_FSB_CAP_ENABLE_PREFETCH    0x1
+
+#define IOAT_PCI_CAP_ENABLE_OFFSET  0x0A
+#define IOAT_PCI_CAP_ENABLE_MEMWR   0x1
+
+#define IOAT_APICID_TAG_MAP_OFFSET  0x0C
+#define IOAT_APICID_TAG_MAP_TAG0    0x0000000F
+#define IOAT_APICID_TAG_MAP_TAG0_SHIFT 0
+#define IOAT_APICID_TAG_MAP_TAG1    0x000000F0
+#define IOAT_APICID_TAG_MAP_TAG1_SHIFT 4
+#define IOAT_APICID_TAG_MAP_TAG2    0x00000F00
+#define IOAT_APICID_TAG_MAP_TAG2_SHIFT 8
+#define IOAT_APICID_TAG_MAP_TAG3    0x0000F000
+#define IOAT_APICID_TAG_MAP_TAG3_SHIFT 12
+#define IOAT_APICID_TAG_MAP_TAG4    0x000F0000
+#define IOAT_APICID_TAG_MAP_TAG4_SHIFT 16
+#define IOAT_APICID_TAG_CB2_VALID   0x8080808080
+
+#define IOAT_DCA_GREQID_OFFSET      0x10
+#define IOAT_DCA_GREQID_SIZE        0x04
+#define IOAT_DCA_GREQID_MASK        0xFFFF
+#define IOAT_DCA_GREQID_IGNOREFUN   0x10000000
+#define IOAT_DCA_GREQID_VALID       0x20000000
+#define IOAT_DCA_GREQID_LASTID      0x80000000
+
+
+
+#define IOAT1_CHAINADDR_OFFSET         0x0C    /* 64-bit Descriptor Chain Address Register */
+#define IOAT2_CHAINADDR_OFFSET         0x10    /* 64-bit Descriptor Chain Address Register */
+#define IOAT_CHAINADDR_OFFSET(ver)             ((ver) < IOAT_VER_2_0 \
+                                               ? IOAT1_CHAINADDR_OFFSET : IOAT2_CHAINADDR_OFFSET)
+#define IOAT1_CHAINADDR_OFFSET_LOW     0x0C
+#define IOAT2_CHAINADDR_OFFSET_LOW     0x10
+#define IOAT_CHAINADDR_OFFSET_LOW(ver)         ((ver) < IOAT_VER_2_0 \
+                                               ? IOAT1_CHAINADDR_OFFSET_LOW : IOAT2_CHAINADDR_OFFSET_LOW)
+#define IOAT1_CHAINADDR_OFFSET_HIGH    0x10
+#define IOAT2_CHAINADDR_OFFSET_HIGH    0x14
+#define IOAT_CHAINADDR_OFFSET_HIGH(ver)                ((ver) < IOAT_VER_2_0 \
+                                               ? IOAT1_CHAINADDR_OFFSET_HIGH : IOAT2_CHAINADDR_OFFSET_HIGH)
+
+#define IOAT1_CHANCMD_OFFSET           0x14    /*  8-bit DMA Channel Command Register */
+#define IOAT2_CHANCMD_OFFSET           0x04    /*  8-bit DMA Channel Command Register */
+#define IOAT_CHANCMD_OFFSET(ver)               ((ver) < IOAT_VER_2_0 \
+                                               ? IOAT1_CHANCMD_OFFSET : IOAT2_CHANCMD_OFFSET)
 #define IOAT_CHANCMD_RESET                     0x20
 #define IOAT_CHANCMD_RESUME                    0x10
 #define IOAT_CHANCMD_ABORT                     0x08
 #define IOAT_CHANERR_COMPLETION_ADDR_ERR       0x1000
 #define IOAT_CHANERR_INT_CONFIGURATION_ERR     0x2000
 #define IOAT_CHANERR_SOFT_ERR                  0x4000
+#define IOAT_CHANERR_UNAFFILIATED_ERR          0x8000
 
 #define IOAT_CHANERR_MASK_OFFSET               0x2C    /* 32-bit Channel Error Register */
 
index 96f7e63e39969122ef132fc9a266d575944598c5..a1f24c42d5ff45176984727961c245df1d0908fc 100644 (file)
@@ -1462,7 +1462,7 @@ MODULE_DEVICE_TABLE(pci, i5000_pci_tbl);
  *
  */
 static struct pci_driver i5000_driver = {
-       .name = __stringify(KBUILD_BASENAME),
+       .name = KBUILD_BASENAME,
        .probe = i5000_init_one,
        .remove = __devexit_p(i5000_remove_one),
        .id_table = i5000_pci_tbl,
index 67588326ae56e2a9810207415e15c09141fc0622..c9b9081831daed59b0201a2bc6b68671e51fdf8f 100644 (file)
@@ -984,8 +984,10 @@ static void bus_reset_tasklet(unsigned long data)
         */
 
        if (ohci->next_config_rom != NULL) {
-               free_rom     = ohci->config_rom;
-               free_rom_bus = ohci->config_rom_bus;
+               if (ohci->next_config_rom != ohci->config_rom) {
+                       free_rom      = ohci->config_rom;
+                       free_rom_bus  = ohci->config_rom_bus;
+               }
                ohci->config_rom      = ohci->next_config_rom;
                ohci->config_rom_bus  = ohci->next_config_rom_bus;
                ohci->next_config_rom = NULL;
@@ -1161,19 +1163,30 @@ static int ohci_enable(struct fw_card *card, u32 *config_rom, size_t length)
         * the right values in the bus reset tasklet.
         */
 
-       ohci->next_config_rom =
-               dma_alloc_coherent(ohci->card.device, CONFIG_ROM_SIZE,
-                                  &ohci->next_config_rom_bus, GFP_KERNEL);
-       if (ohci->next_config_rom == NULL)
-               return -ENOMEM;
+       if (config_rom) {
+               ohci->next_config_rom =
+                       dma_alloc_coherent(ohci->card.device, CONFIG_ROM_SIZE,
+                                          &ohci->next_config_rom_bus,
+                                          GFP_KERNEL);
+               if (ohci->next_config_rom == NULL)
+                       return -ENOMEM;
 
-       memset(ohci->next_config_rom, 0, CONFIG_ROM_SIZE);
-       fw_memcpy_to_be32(ohci->next_config_rom, config_rom, length * 4);
+               memset(ohci->next_config_rom, 0, CONFIG_ROM_SIZE);
+               fw_memcpy_to_be32(ohci->next_config_rom, config_rom, length * 4);
+       } else {
+               /*
+                * In the suspend case, config_rom is NULL, which
+                * means that we just reuse the old config rom.
+                */
+               ohci->next_config_rom = ohci->config_rom;
+               ohci->next_config_rom_bus = ohci->config_rom_bus;
+       }
 
-       ohci->next_header = config_rom[0];
+       ohci->next_header = be32_to_cpu(ohci->next_config_rom[0]);
        ohci->next_config_rom[0] = 0;
        reg_write(ohci, OHCI1394_ConfigROMhdr, 0);
-       reg_write(ohci, OHCI1394_BusOptions, config_rom[2]);
+       reg_write(ohci, OHCI1394_BusOptions,
+                 be32_to_cpu(ohci->next_config_rom[2]));
        reg_write(ohci, OHCI1394_ConfigROMmap, ohci->next_config_rom_bus);
 
        reg_write(ohci, OHCI1394_AsReqFilterHiSet, 0x80000000);
@@ -1984,7 +1997,7 @@ static int pci_resume(struct pci_dev *pdev)
                return err;
        }
 
-       return ohci_enable(&ohci->card, ohci->config_rom, CONFIG_ROM_SIZE);
+       return ohci_enable(&ohci->card, NULL, 0);
 }
 #endif
 
index 5596df65c8ed3b11d49c91d97cc36f3e858478c0..624ff3e082f68116f4efe158c80fcdd0c7f27a74 100644 (file)
@@ -650,13 +650,14 @@ static void sbp2_login(struct work_struct *work)
        if (sbp2_send_management_orb(lu, node_id, generation,
                                SBP2_LOGIN_REQUEST, lu->lun, &response) < 0) {
                if (lu->retries++ < 5) {
-                       queue_delayed_work(sbp2_wq, &lu->work,
-                                          DIV_ROUND_UP(HZ, 5));
+                       if (queue_delayed_work(sbp2_wq, &lu->work,
+                                              DIV_ROUND_UP(HZ, 5)))
+                               kref_get(&lu->tgt->kref);
                } else {
                        fw_error("failed to login to %s LUN %04x\n",
                                 unit->device.bus_id, lu->lun);
-                       kref_put(&lu->tgt->kref, sbp2_release_target);
                }
+               kref_put(&lu->tgt->kref, sbp2_release_target);
                return;
        }
 
@@ -914,7 +915,9 @@ static void sbp2_reconnect(struct work_struct *work)
                        lu->retries = 0;
                        PREPARE_DELAYED_WORK(&lu->work, sbp2_login);
                }
-               queue_delayed_work(sbp2_wq, &lu->work, DIV_ROUND_UP(HZ, 5));
+               if (queue_delayed_work(sbp2_wq, &lu->work, DIV_ROUND_UP(HZ, 5)))
+                       kref_get(&lu->tgt->kref);
+               kref_put(&lu->tgt->kref, sbp2_release_target);
                return;
        }
 
index dd332f28e08cb31106c6aa1598f6824fca69298d..0b27da7d749700b4d0e2481b7c121ce9fa033aaa 100644 (file)
@@ -297,7 +297,7 @@ static struct hid_usage *hidinput_find_key(struct hid_device *hid,
 static int hidinput_getkeycode(struct input_dev *dev, int scancode,
                                int *keycode)
 {
-       struct hid_device *hid = dev->private;
+       struct hid_device *hid = input_get_drvdata(dev);
        struct hid_usage *usage;
 
        usage = hidinput_find_key(hid, scancode, 0);
@@ -311,7 +311,7 @@ static int hidinput_getkeycode(struct input_dev *dev, int scancode,
 static int hidinput_setkeycode(struct input_dev *dev, int scancode,
                                int keycode)
 {
-       struct hid_device *hid = dev->private;
+       struct hid_device *hid = input_get_drvdata(dev);
        struct hid_usage *usage;
        int old_keycode;
 
@@ -1152,7 +1152,7 @@ int hidinput_connect(struct hid_device *hid)
                                        kfree(hidinput);
                                        input_free_device(input_dev);
                                        err_hid("Out of memory during hid input probe");
-                                       return -1;
+                                       goto out_unwind;
                                }
 
                                input_set_drvdata(input_dev, hid);
@@ -1186,15 +1186,25 @@ int hidinput_connect(struct hid_device *hid)
                                 * UGCI) cram a lot of unrelated inputs into the
                                 * same interface. */
                                hidinput->report = report;
-                               input_register_device(hidinput->input);
+                               if (input_register_device(hidinput->input))
+                                       goto out_cleanup;
                                hidinput = NULL;
                        }
                }
 
-       if (hidinput)
-               input_register_device(hidinput->input);
+       if (hidinput && input_register_device(hidinput->input))
+               goto out_cleanup;
 
        return 0;
+
+out_cleanup:
+       input_free_device(hidinput->input);
+       kfree(hidinput);
+out_unwind:
+       /* unwind the ones we already registered */
+       hidinput_disconnect(hid);
+
+       return -1;
 }
 EXPORT_SYMBOL_GPL(hidinput_connect);
 
index 41a59a80e7edff34299d0a0d3f93225eedc9381a..a2552856476b2940633f4831e48c85bcfe91d9d7 100644 (file)
 #define USB_DEVICE_ID_0_8_8_IF_KIT     0x0053
 #define USB_DEVICE_ID_PHIDGET_MOTORCONTROL     0x0058
 
+#define USB_VENDOR_ID_GOTOP            0x08f2
+#define USB_DEVICE_ID_SUPER_Q2         0x007f
+#define USB_DEVICE_ID_GOGOPEN          0x00ce
+#define USB_DEVICE_ID_PENPOWER         0x00f4
+
 #define USB_VENDOR_ID_GRIFFIN          0x077d
 #define USB_DEVICE_ID_POWERMATE                0x0410
 #define USB_DEVICE_ID_SOUNDKNOB                0x04AA
@@ -415,6 +420,9 @@ static const struct hid_blacklist {
        { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_0_8_7_IF_KIT, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_0_8_8_IF_KIT, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_PHIDGET_MOTORCONTROL, HID_QUIRK_IGNORE },
+       { USB_VENDOR_ID_GOTOP, USB_DEVICE_ID_SUPER_Q2, HID_QUIRK_IGNORE },
+       { USB_VENDOR_ID_GOTOP, USB_DEVICE_ID_GOGOPEN, HID_QUIRK_IGNORE },
+       { USB_VENDOR_ID_GOTOP, USB_DEVICE_ID_PENPOWER, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_POWERMATE, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_SOUNDKNOB, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_90, HID_QUIRK_IGNORE },
index 9837adcb17e940478568fa33e89e194508c1cad1..5fc4019956ba2ffe17b2d5dda04206aa7b5d9a4d 100644 (file)
@@ -743,7 +743,7 @@ inval:
 static long hiddev_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
        struct inode *inode = file->f_path.dentry->d_inode;
-       return hiddev_ioctl(inode, file, cmd, compat_ptr(arg));
+       return hiddev_ioctl(inode, file, cmd, (unsigned long)compat_ptr(arg));
 }
 #endif
 
index 700a1657554f4b3b5f4910268343790ddb33c1eb..a0445bea9f75ade0411a2949fe0ff43f1ad75b32 100644 (file)
@@ -216,6 +216,16 @@ config SENSORS_DS1621
          This driver can also be built as a module.  If so, the module
          will be called ds1621.
 
+config SENSORS_I5K_AMB
+       tristate "FB-DIMM AMB temperature sensor on Intel 5000 series chipsets"
+       depends on PCI && EXPERIMENTAL
+       help
+         If you say yes here you get support for FB-DIMM AMB temperature
+         monitoring chips on systems with the Intel 5000 series chipset.
+
+         This driver can also be built as a module. If so, the module
+         will be called i5k_amb.
+
 config SENSORS_F71805F
        tristate "Fintek F71805F/FG, F71806F/FG and F71872F/FG"
        depends on EXPERIMENTAL
index 6da3eef943064a82302fda6ae75b68dc6f5f2e64..55595f6e1aa632a8ecb05eb1306540905ac5a729 100644 (file)
@@ -38,6 +38,7 @@ obj-$(CONFIG_SENSORS_FSCPOS)  += fscpos.o
 obj-$(CONFIG_SENSORS_GL518SM)  += gl518sm.o
 obj-$(CONFIG_SENSORS_GL520SM)  += gl520sm.o
 obj-$(CONFIG_SENSORS_HDAPS)    += hdaps.o
+obj-$(CONFIG_SENSORS_I5K_AMB)  += i5k_amb.o
 obj-$(CONFIG_SENSORS_IBMPEX)   += ibmpex.o
 obj-$(CONFIG_SENSORS_IT87)     += it87.o
 obj-$(CONFIG_SENSORS_K8TEMP)   += k8temp.o
index cb2331bfd9d5a0f040c49e61fdba8fe0daca7111..d9f04ce903273e7b214eac1659f0086186550d7e 100644 (file)
@@ -503,7 +503,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
                { "AUX3 FAN",           36, 2, 60, 1, 0 },
                { NULL, 0, 0, 0, 0, 0 } }
        },
-       { 0x001A, "unknown", {
+       { 0x001A, "Abit IP35 Pro", {
                { "CPU Core",            0, 0, 10, 1, 0 },
                { "DDR2",                1, 0, 20, 1, 0 },
                { "DDR2 VTT",            2, 0, 10, 1, 0 },
@@ -530,6 +530,60 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
                { "AUX3 Fan",           36, 2, 60, 1, 0 },
                { NULL, 0, 0, 0, 0, 0 } }
        },
+       { 0x001B, "unknown", {
+               { "CPU Core",            0, 0, 10, 1, 0 },
+               { "DDR3",                1, 0, 20, 1, 0 },
+               { "DDR3 VTT",            2, 0, 10, 1, 0 },
+               { "CPU VTT",             3, 0, 10, 1, 0 },
+               { "MCH 1.25V",           4, 0, 10, 1, 0 },
+               { "ICHIO 1.5V",          5, 0, 10, 1, 0 },
+               { "ICH 1.05V",           6, 0, 10, 1, 0 },
+               { "ATX +12V (24-Pin)",   7, 0, 60, 1, 0 },
+               { "ATX +12V (8-pin)",    8, 0, 60, 1, 0 },
+               { "ATX +5V",             9, 0, 30, 1, 0 },
+               { "+3.3V",              10, 0, 20, 1, 0 },
+               { "5VSB",               11, 0, 30, 1, 0 },
+               { "CPU",                24, 1, 1, 1, 0 },
+               { "System",             25, 1, 1, 1, 0 },
+               { "PWM Phase1",         26, 1, 1, 1, 0 },
+               { "PWM Phase2",         27, 1, 1, 1, 0 },
+               { "PWM Phase3",         28, 1, 1, 1, 0 },
+               { "PWM Phase4",         29, 1, 1, 1, 0 },
+               { "PWM Phase5",         30, 1, 1, 1, 0 },
+               { "CPU Fan",            32, 2, 60, 1, 0 },
+               { "SYS Fan",            34, 2, 60, 1, 0 },
+               { "AUX1 Fan",           33, 2, 60, 1, 0 },
+               { "AUX2 Fan",           35, 2, 60, 1, 0 },
+               { "AUX3 Fan",           36, 2, 60, 1, 0 },
+               { NULL, 0, 0, 0, 0, 0 } }
+       },
+       { 0x001C, "unknown", {
+               { "CPU Core",            0, 0, 10, 1, 0 },
+               { "DDR2",                1, 0, 20, 1, 0 },
+               { "DDR2 VTT",            2, 0, 10, 1, 0 },
+               { "CPU VTT",             3, 0, 10, 1, 0 },
+               { "MCH 1.25V",           4, 0, 10, 1, 0 },
+               { "ICHIO 1.5V",          5, 0, 10, 1, 0 },
+               { "ICH 1.05V",           6, 0, 10, 1, 0 },
+               { "ATX +12V (24-Pin)",   7, 0, 60, 1, 0 },
+               { "ATX +12V (8-pin)",    8, 0, 60, 1, 0 },
+               { "ATX +5V",             9, 0, 30, 1, 0 },
+               { "+3.3V",              10, 0, 20, 1, 0 },
+               { "5VSB",               11, 0, 30, 1, 0 },
+               { "CPU",                24, 1, 1, 1, 0 },
+               { "System",             25, 1, 1, 1, 0 },
+               { "PWM Phase1",         26, 1, 1, 1, 0 },
+               { "PWM Phase2",         27, 1, 1, 1, 0 },
+               { "PWM Phase3",         28, 1, 1, 1, 0 },
+               { "PWM Phase4",         29, 1, 1, 1, 0 },
+               { "PWM Phase5",         30, 1, 1, 1, 0 },
+               { "CPU Fan",            32, 2, 60, 1, 0 },
+               { "SYS Fan",            34, 2, 60, 1, 0 },
+               { "AUX1 Fan",           33, 2, 60, 1, 0 },
+               { "AUX2 Fan",           35, 2, 60, 1, 0 },
+               { "AUX3 Fan",           36, 2, 60, 1, 0 },
+               { NULL, 0, 0, 0, 0, 0 } }
+       },
        { 0x0000, NULL, { { NULL, 0, 0, 0, 0, 0 } } }
 };
 
index 1001d2e122a262eafa72bb80857260bcc1659472..86c66c345f8b76f8274272796917c740ba312e26 100644 (file)
@@ -80,7 +80,7 @@
 /*
  * Temperature sensors keys (sp78 - 2 bytes).
  */
-static const char* temperature_sensors_sets[][13] = {
+static const char* temperature_sensors_sets[][36] = {
 /* Set 0: Macbook Pro */
        { "TA0P", "TB0T", "TC0D", "TC0P", "TG0H", "TG0P", "TG0T", "Th0H",
          "Th1H", "Tm0P", "Ts0P", "Ts1P", NULL },
@@ -88,7 +88,13 @@ static const char* temperature_sensors_sets[][13] = {
        { "TB0T", "TC0D", "TC0P", "TM0P", "TN0P", "TN1P", "Th0H", "Th0S",
          "Th1H", "Ts0P", NULL },
 /* Set 2: Macmini set */
-       { "TC0D", "TC0P", NULL }
+       { "TC0D", "TC0P", NULL },
+/* Set 3: Mac Pro (2 x Quad-Core) */
+       { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", "TC0C", "TC0D", "TC0P",
+         "TC1C", "TC1D", "TC2C", "TC2D", "TC3C", "TC3D", "THTG", "TH0P",
+         "TH1P", "TH2P", "TH3P", "TMAP", "TMAS", "TMBS", "TM0P", "TM0S",
+         "TM1P", "TM1S", "TM2P", "TM2S", "TM3S", "TM8P", "TM8S", "TM9P",
+         "TM9S", "TN0H", "TS0C", NULL },
 };
 
 /* List of keys used to read/write fan speeds */
@@ -990,14 +996,18 @@ static struct attribute *fan##offset##_attributes[] = { \
 
 /*
  * Create the needed functions for each fan using the macro defined above
- * (2 fans are supported)
+ * (4 fans are supported)
  */
 sysfs_fan_speeds_offset(1);
 sysfs_fan_speeds_offset(2);
+sysfs_fan_speeds_offset(3);
+sysfs_fan_speeds_offset(4);
 
 static const struct attribute_group fan_attribute_groups[] = {
        { .attrs = fan1_attributes },
-       { .attrs = fan2_attributes }
+       { .attrs = fan2_attributes },
+       { .attrs = fan3_attributes },
+       { .attrs = fan4_attributes },
 };
 
 /*
@@ -1027,6 +1037,52 @@ static SENSOR_DEVICE_ATTR(temp11_input, S_IRUGO,
                                        applesmc_show_temperature, NULL, 10);
 static SENSOR_DEVICE_ATTR(temp12_input, S_IRUGO,
                                        applesmc_show_temperature, NULL, 11);
+static SENSOR_DEVICE_ATTR(temp13_input, S_IRUGO,
+                                       applesmc_show_temperature, NULL, 12);
+static SENSOR_DEVICE_ATTR(temp14_input, S_IRUGO,
+                                       applesmc_show_temperature, NULL, 13);
+static SENSOR_DEVICE_ATTR(temp15_input, S_IRUGO,
+                                       applesmc_show_temperature, NULL, 14);
+static SENSOR_DEVICE_ATTR(temp16_input, S_IRUGO,
+                                       applesmc_show_temperature, NULL, 15);
+static SENSOR_DEVICE_ATTR(temp17_input, S_IRUGO,
+                                       applesmc_show_temperature, NULL, 16);
+static SENSOR_DEVICE_ATTR(temp18_input, S_IRUGO,
+                                       applesmc_show_temperature, NULL, 17);
+static SENSOR_DEVICE_ATTR(temp19_input, S_IRUGO,
+                                       applesmc_show_temperature, NULL, 18);
+static SENSOR_DEVICE_ATTR(temp20_input, S_IRUGO,
+                                       applesmc_show_temperature, NULL, 19);
+static SENSOR_DEVICE_ATTR(temp21_input, S_IRUGO,
+                                       applesmc_show_temperature, NULL, 20);
+static SENSOR_DEVICE_ATTR(temp22_input, S_IRUGO,
+                                       applesmc_show_temperature, NULL, 21);
+static SENSOR_DEVICE_ATTR(temp23_input, S_IRUGO,
+                                       applesmc_show_temperature, NULL, 22);
+static SENSOR_DEVICE_ATTR(temp24_input, S_IRUGO,
+                                       applesmc_show_temperature, NULL, 23);
+static SENSOR_DEVICE_ATTR(temp25_input, S_IRUGO,
+                                       applesmc_show_temperature, NULL, 24);
+static SENSOR_DEVICE_ATTR(temp26_input, S_IRUGO,
+                                       applesmc_show_temperature, NULL, 25);
+static SENSOR_DEVICE_ATTR(temp27_input, S_IRUGO,
+                                       applesmc_show_temperature, NULL, 26);
+static SENSOR_DEVICE_ATTR(temp28_input, S_IRUGO,
+                                       applesmc_show_temperature, NULL, 27);
+static SENSOR_DEVICE_ATTR(temp29_input, S_IRUGO,
+                                       applesmc_show_temperature, NULL, 28);
+static SENSOR_DEVICE_ATTR(temp30_input, S_IRUGO,
+                                       applesmc_show_temperature, NULL, 29);
+static SENSOR_DEVICE_ATTR(temp31_input, S_IRUGO,
+                                       applesmc_show_temperature, NULL, 30);
+static SENSOR_DEVICE_ATTR(temp32_input, S_IRUGO,
+                                       applesmc_show_temperature, NULL, 31);
+static SENSOR_DEVICE_ATTR(temp33_input, S_IRUGO,
+                                       applesmc_show_temperature, NULL, 32);
+static SENSOR_DEVICE_ATTR(temp34_input, S_IRUGO,
+                                       applesmc_show_temperature, NULL, 33);
+static SENSOR_DEVICE_ATTR(temp35_input, S_IRUGO,
+                                       applesmc_show_temperature, NULL, 34);
 
 static struct attribute *temperature_attributes[] = {
        &sensor_dev_attr_temp1_input.dev_attr.attr,
@@ -1041,6 +1097,29 @@ static struct attribute *temperature_attributes[] = {
        &sensor_dev_attr_temp10_input.dev_attr.attr,
        &sensor_dev_attr_temp11_input.dev_attr.attr,
        &sensor_dev_attr_temp12_input.dev_attr.attr,
+       &sensor_dev_attr_temp13_input.dev_attr.attr,
+       &sensor_dev_attr_temp14_input.dev_attr.attr,
+       &sensor_dev_attr_temp15_input.dev_attr.attr,
+       &sensor_dev_attr_temp16_input.dev_attr.attr,
+       &sensor_dev_attr_temp17_input.dev_attr.attr,
+       &sensor_dev_attr_temp18_input.dev_attr.attr,
+       &sensor_dev_attr_temp19_input.dev_attr.attr,
+       &sensor_dev_attr_temp20_input.dev_attr.attr,
+       &sensor_dev_attr_temp21_input.dev_attr.attr,
+       &sensor_dev_attr_temp22_input.dev_attr.attr,
+       &sensor_dev_attr_temp23_input.dev_attr.attr,
+       &sensor_dev_attr_temp24_input.dev_attr.attr,
+       &sensor_dev_attr_temp25_input.dev_attr.attr,
+       &sensor_dev_attr_temp26_input.dev_attr.attr,
+       &sensor_dev_attr_temp27_input.dev_attr.attr,
+       &sensor_dev_attr_temp28_input.dev_attr.attr,
+       &sensor_dev_attr_temp29_input.dev_attr.attr,
+       &sensor_dev_attr_temp30_input.dev_attr.attr,
+       &sensor_dev_attr_temp31_input.dev_attr.attr,
+       &sensor_dev_attr_temp32_input.dev_attr.attr,
+       &sensor_dev_attr_temp33_input.dev_attr.attr,
+       &sensor_dev_attr_temp34_input.dev_attr.attr,
+       &sensor_dev_attr_temp35_input.dev_attr.attr,
        NULL
 };
 
@@ -1137,6 +1216,8 @@ static __initdata struct dmi_match_data applesmc_dmi_data[] = {
        { .accelerometer = 1, .light = 0, .temperature_set = 1 },
 /* MacMini: temperature set 2 */
        { .accelerometer = 0, .light = 0, .temperature_set = 2 },
+/* MacPro: temperature set 3 */
+       { .accelerometer = 0, .light = 0, .temperature_set = 3 },
 };
 
 /* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1".
@@ -1154,6 +1235,10 @@ static __initdata struct dmi_system_id applesmc_whitelist[] = {
          DMI_MATCH(DMI_BOARD_VENDOR,"Apple"),
          DMI_MATCH(DMI_PRODUCT_NAME,"Macmini") },
                (void*)&applesmc_dmi_data[2]},
+       { applesmc_dmi_match, "Apple MacPro2", {
+         DMI_MATCH(DMI_BOARD_VENDOR,"Apple"),
+         DMI_MATCH(DMI_PRODUCT_NAME,"MacPro2") },
+               (void*)&applesmc_dmi_data[3]},
        { .ident = NULL }
 };
 
@@ -1204,9 +1289,19 @@ static int __init applesmc_init(void)
 
                switch (count) {
                default:
-                       printk(KERN_WARNING "applesmc: More than 2 fans found,"
-                                       " but at most 2 fans are supported"
+                       printk(KERN_WARNING "applesmc: More than 4 fans found,"
+                                       " but at most 4 fans are supported"
                                                " by the driver.\n");
+               case 4:
+                       ret = sysfs_create_group(&pdev->dev.kobj,
+                                                &fan_attribute_groups[3]);
+                       if (ret)
+                               goto out_key_enumeration;
+               case 3:
+                       ret = sysfs_create_group(&pdev->dev.kobj,
+                                                &fan_attribute_groups[2]);
+                       if (ret)
+                               goto out_key_enumeration;
                case 2:
                        ret = sysfs_create_group(&pdev->dev.kobj,
                                                 &fan_attribute_groups[1]);
index 13a041326a04643c63324357acb2c9e4e45e65d7..6892f76fc18ab42190168efab9a61a857a8d02a7 100644 (file)
@@ -34,6 +34,7 @@
 #include <linux/i2c.h>
 #include <linux/err.h>
 #include <linux/mutex.h>
+#include <linux/f75375s.h>
 
 /* Addresses to scan */
 static unsigned short normal_i2c[] = { 0x2d, 0x2e, I2C_CLIENT_END };
@@ -86,7 +87,7 @@ I2C_CLIENT_INSMOD_2(f75373, f75375);
 
 struct f75375_data {
        unsigned short addr;
-       struct i2c_client client;
+       struct i2c_client *client;
        struct device *hwmon_dev;
 
        const char *name;
@@ -116,15 +117,25 @@ struct f75375_data {
 static int f75375_attach_adapter(struct i2c_adapter *adapter);
 static int f75375_detect(struct i2c_adapter *adapter, int address, int kind);
 static int f75375_detach_client(struct i2c_client *client);
+static int f75375_probe(struct i2c_client *client);
+static int f75375_remove(struct i2c_client *client);
 
-static struct i2c_driver f75375_driver = {
+static struct i2c_driver f75375_legacy_driver = {
        .driver = {
-               .name = "f75375",
+               .name = "f75375_legacy",
        },
        .attach_adapter = f75375_attach_adapter,
        .detach_client = f75375_detach_client,
 };
 
+static struct i2c_driver f75375_driver = {
+       .driver = {
+               .name = "f75375",
+       },
+       .probe = f75375_probe,
+       .remove = f75375_remove,
+};
+
 static inline int f75375_read8(struct i2c_client *client, u8 reg)
 {
        return i2c_smbus_read_byte_data(client, reg);
@@ -276,19 +287,14 @@ static ssize_t show_pwm_enable(struct device *dev, struct device_attribute
        return sprintf(buf, "%d\n", data->pwm_enable[nr]);
 }
 
-static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *attr,
-               const char *buf, size_t count)
+static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val)
 {
-       int nr = to_sensor_dev_attr(attr)->index;
-       struct i2c_client *client = to_i2c_client(dev);
        struct f75375_data *data = i2c_get_clientdata(client);
-       int val = simple_strtoul(buf, NULL, 10);
        u8 fanmode;
 
        if (val < 0 || val > 4)
                return -EINVAL;
 
-       mutex_lock(&data->update_lock);
        fanmode = f75375_read8(client, F75375_REG_FAN_TIMER);
        fanmode = ~(3 << FAN_CTRL_MODE(nr));
 
@@ -310,8 +316,22 @@ static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *attr,
        }
        f75375_write8(client, F75375_REG_FAN_TIMER, fanmode);
        data->pwm_enable[nr] = val;
+       return 0;
+}
+
+static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *attr,
+               const char *buf, size_t count)
+{
+       int nr = to_sensor_dev_attr(attr)->index;
+       struct i2c_client *client = to_i2c_client(dev);
+       struct f75375_data *data = i2c_get_clientdata(client);
+       int val = simple_strtoul(buf, NULL, 10);
+       int err = 0;
+
+       mutex_lock(&data->update_lock);
+       err = set_pwm_enable_direct(client, nr, val);
        mutex_unlock(&data->update_lock);
-       return count;
+       return err ? err : count;
 }
 
 static ssize_t set_pwm_mode(struct device *dev, struct device_attribute *attr,
@@ -323,7 +343,7 @@ static ssize_t set_pwm_mode(struct device *dev, struct device_attribute *attr,
        int val = simple_strtoul(buf, NULL, 10);
        u8 conf = 0;
 
-       if (val != 0 || val != 1 || data->kind == f75373)
+       if (!(val == 0 || val == 1))
                return -EINVAL;
 
        mutex_lock(&data->update_lock);
@@ -529,13 +549,13 @@ static SENSOR_DEVICE_ATTR(pwm1, S_IRUGO|S_IWUSR,
        show_pwm, set_pwm, 0);
 static SENSOR_DEVICE_ATTR(pwm1_enable, S_IRUGO|S_IWUSR,
        show_pwm_enable, set_pwm_enable, 0);
-static SENSOR_DEVICE_ATTR(pwm1_mode, S_IRUGO|S_IWUSR,
+static SENSOR_DEVICE_ATTR(pwm1_mode, S_IRUGO,
        show_pwm_mode, set_pwm_mode, 0);
 static SENSOR_DEVICE_ATTR(pwm2, S_IRUGO | S_IWUSR,
        show_pwm, set_pwm, 1);
 static SENSOR_DEVICE_ATTR(pwm2_enable, S_IRUGO|S_IWUSR,
        show_pwm_enable, set_pwm_enable, 1);
-static SENSOR_DEVICE_ATTR(pwm2_mode, S_IRUGO|S_IWUSR,
+static SENSOR_DEVICE_ATTR(pwm2_mode, S_IRUGO,
        show_pwm_mode, set_pwm_mode, 1);
 
 static struct attribute *f75375_attributes[] = {
@@ -580,12 +600,9 @@ static const struct attribute_group f75375_group = {
 
 static int f75375_detach_client(struct i2c_client *client)
 {
-       struct f75375_data *data = i2c_get_clientdata(client);
        int err;
 
-       hwmon_device_unregister(data->hwmon_dev);
-       sysfs_remove_group(&client->dev.kobj, &f75375_group);
-
+       f75375_remove(client);
        err = i2c_detach_client(client);
        if (err) {
                dev_err(&client->dev,
@@ -593,7 +610,91 @@ static int f75375_detach_client(struct i2c_client *client)
                        "client not detached.\n");
                return err;
        }
+       kfree(client);
+       return 0;
+}
+
+static void f75375_init(struct i2c_client *client, struct f75375_data *data,
+               struct f75375s_platform_data *f75375s_pdata)
+{
+       int nr;
+       set_pwm_enable_direct(client, 0, f75375s_pdata->pwm_enable[0]);
+       set_pwm_enable_direct(client, 1, f75375s_pdata->pwm_enable[1]);
+       for (nr = 0; nr < 2; nr++) {
+               data->pwm[nr] = SENSORS_LIMIT(f75375s_pdata->pwm[nr], 0, 255);
+               f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr),
+                       data->pwm[nr]);
+       }
+
+}
+
+static int f75375_probe(struct i2c_client *client)
+{
+       struct f75375_data *data = i2c_get_clientdata(client);
+       struct f75375s_platform_data *f75375s_pdata = client->dev.platform_data;
+       int err;
+
+       if (!i2c_check_functionality(client->adapter,
+                               I2C_FUNC_SMBUS_BYTE_DATA))
+               return -EIO;
+       if (!(data = kzalloc(sizeof(struct f75375_data), GFP_KERNEL)))
+               return -ENOMEM;
+
+       i2c_set_clientdata(client, data);
+       data->client = client;
+       mutex_init(&data->update_lock);
+
+       if (strcmp(client->name, "f75375") == 0)
+               data->kind = f75375;
+       else if (strcmp(client->name, "f75373") == 0)
+               data->kind = f75373;
+       else {
+               dev_err(&client->dev, "Unsupported device: %s\n", client->name);
+               return -ENODEV;
+       }
+
+       if ((err = sysfs_create_group(&client->dev.kobj, &f75375_group)))
+               goto exit_free;
+
+       if (data->kind == f75375) {
+               err = sysfs_chmod_file(&client->dev.kobj,
+                       &sensor_dev_attr_pwm1_mode.dev_attr.attr,
+                       S_IRUGO | S_IWUSR);
+               if (err)
+                       goto exit_remove;
+               err = sysfs_chmod_file(&client->dev.kobj,
+                       &sensor_dev_attr_pwm2_mode.dev_attr.attr,
+                       S_IRUGO | S_IWUSR);
+               if (err)
+                       goto exit_remove;
+       }
+
+       data->hwmon_dev = hwmon_device_register(&client->dev);
+       if (IS_ERR(data->hwmon_dev)) {
+               err = PTR_ERR(data->hwmon_dev);
+               goto exit_remove;
+       }
+
+       if (f75375s_pdata != NULL)
+               f75375_init(client, data, f75375s_pdata);
+
+       return 0;
+
+exit_remove:
+       sysfs_remove_group(&client->dev.kobj, &f75375_group);
+exit_free:
        kfree(data);
+       i2c_set_clientdata(client, NULL);
+       return err;
+}
+
+static int f75375_remove(struct i2c_client *client)
+{
+       struct f75375_data *data = i2c_get_clientdata(client);
+       hwmon_device_unregister(data->hwmon_dev);
+       sysfs_remove_group(&client->dev.kobj, &f75375_group);
+       kfree(data);
+       i2c_set_clientdata(client, NULL);
        return 0;
 }
 
@@ -608,20 +709,17 @@ static int f75375_attach_adapter(struct i2c_adapter *adapter)
 static int f75375_detect(struct i2c_adapter *adapter, int address, int kind)
 {
        struct i2c_client *client;
-       struct f75375_data *data;
        u8 version = 0;
        int err = 0;
        const char *name = "";
 
-       if (!(data = kzalloc(sizeof(struct f75375_data), GFP_KERNEL))) {
+       if (!(client = kzalloc(sizeof(*client), GFP_KERNEL))) {
                err = -ENOMEM;
                goto exit;
        }
-       client = &data->client;
-       i2c_set_clientdata(client, data);
        client->addr = address;
        client->adapter = adapter;
-       client->driver = &f75375_driver;
+       client->driver = &f75375_legacy_driver;
 
        if (kind < 0) {
                u16 vendid = f75375_read16(client, F75375_REG_VENDOR);
@@ -644,42 +742,42 @@ static int f75375_detect(struct i2c_adapter *adapter, int address, int kind)
        } else if (kind == f75373) {
                name = "f75373";
        }
-
        dev_info(&adapter->dev, "found %s version: %02X\n", name, version);
        strlcpy(client->name, name, I2C_NAME_SIZE);
-       data->kind = kind;
-       mutex_init(&data->update_lock);
+
        if ((err = i2c_attach_client(client)))
                goto exit_free;
 
-       if ((err = sysfs_create_group(&client->dev.kobj, &f75375_group)))
+       if ((err = f75375_probe(client)) < 0)
                goto exit_detach;
 
-       data->hwmon_dev = hwmon_device_register(&client->dev);
-       if (IS_ERR(data->hwmon_dev)) {
-               err = PTR_ERR(data->hwmon_dev);
-               goto exit_remove;
-       }
-
        return 0;
 
-exit_remove:
-       sysfs_remove_group(&client->dev.kobj, &f75375_group);
 exit_detach:
        i2c_detach_client(client);
 exit_free:
-       kfree(data);
+       kfree(client);
 exit:
        return err;
 }
 
 static int __init sensors_f75375_init(void)
 {
-       return i2c_add_driver(&f75375_driver);
+       int status;
+       status = i2c_add_driver(&f75375_driver);
+       if (status)
+               return status;
+
+       status = i2c_add_driver(&f75375_legacy_driver);
+       if (status)
+               i2c_del_driver(&f75375_driver);
+
+       return status;
 }
 
 static void __exit sensors_f75375_exit(void)
 {
+       i2c_del_driver(&f75375_legacy_driver);
        i2c_del_driver(&f75375_driver);
 }
 
diff --git a/drivers/hwmon/i5k_amb.c b/drivers/hwmon/i5k_amb.c
new file mode 100644 (file)
index 0000000..6ac5c6f
--- /dev/null
@@ -0,0 +1,552 @@
+/*
+ * A hwmon driver for the Intel 5000 series chipset FB-DIMM AMB
+ * temperature sensors
+ * Copyright (C) 2007 IBM
+ *
+ * Author: Darrick J. Wong <djwong@us.ibm.com>
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/module.h>
+#include <linux/jiffies.h>
+#include <linux/hwmon.h>
+#include <linux/hwmon-sysfs.h>
+#include <linux/err.h>
+#include <linux/mutex.h>
+#include <linux/delay.h>
+#include <linux/log2.h>
+#include <linux/pci.h>
+#include <linux/platform_device.h>
+
+#define DRVNAME "i5k_amb"
+
+#define I5K_REG_AMB_BASE_ADDR          0x48
+#define I5K_REG_AMB_LEN_ADDR           0x50
+#define I5K_REG_CHAN0_PRESENCE_ADDR    0x64
+#define I5K_REG_CHAN1_PRESENCE_ADDR    0x66
+
+#define AMB_REG_TEMP_MIN_ADDR          0x80
+#define AMB_REG_TEMP_MID_ADDR          0x81
+#define AMB_REG_TEMP_MAX_ADDR          0x82
+#define AMB_REG_TEMP_STATUS_ADDR       0x84
+#define AMB_REG_TEMP_ADDR              0x85
+
+#define AMB_CONFIG_SIZE                        2048
+#define AMB_FUNC_3_OFFSET              768
+
+static unsigned long amb_reg_temp_status(unsigned int amb)
+{
+       return AMB_FUNC_3_OFFSET + AMB_REG_TEMP_STATUS_ADDR +
+              AMB_CONFIG_SIZE * amb;
+}
+
+static unsigned long amb_reg_temp_min(unsigned int amb)
+{
+       return AMB_FUNC_3_OFFSET + AMB_REG_TEMP_MIN_ADDR +
+              AMB_CONFIG_SIZE * amb;
+}
+
+static unsigned long amb_reg_temp_mid(unsigned int amb)
+{
+       return AMB_FUNC_3_OFFSET + AMB_REG_TEMP_MID_ADDR +
+              AMB_CONFIG_SIZE * amb;
+}
+
+static unsigned long amb_reg_temp_max(unsigned int amb)
+{
+       return AMB_FUNC_3_OFFSET + AMB_REG_TEMP_MAX_ADDR +
+              AMB_CONFIG_SIZE * amb;
+}
+
+static unsigned long amb_reg_temp(unsigned int amb)
+{
+       return AMB_FUNC_3_OFFSET + AMB_REG_TEMP_ADDR +
+              AMB_CONFIG_SIZE * amb;
+}
+
+#define MAX_MEM_CHANNELS               4
+#define MAX_AMBS_PER_CHANNEL           16
+#define MAX_AMBS                       (MAX_MEM_CHANNELS * \
+                                        MAX_AMBS_PER_CHANNEL)
+/*
+ * Ugly hack: For some reason the highest bit is set if there
+ * are _any_ DIMMs in the channel.  Attempting to read from
+ * this "high-order" AMB results in a memory bus error, so
+ * for now we'll just ignore that top bit, even though that
+ * might prevent us from seeing the 16th DIMM in the channel.
+ */
+#define REAL_MAX_AMBS_PER_CHANNEL      15
+#define KNOBS_PER_AMB                  5
+
+static unsigned long amb_num_from_reg(unsigned int byte_num, unsigned int bit)
+{
+       return byte_num * MAX_AMBS_PER_CHANNEL + bit;
+}
+
+#define AMB_SYSFS_NAME_LEN             16
+struct i5k_device_attribute {
+       struct sensor_device_attribute s_attr;
+       char name[AMB_SYSFS_NAME_LEN];
+};
+
+struct i5k_amb_data {
+       struct device *hwmon_dev;
+
+       unsigned long amb_base;
+       unsigned long amb_len;
+       u16 amb_present[MAX_MEM_CHANNELS];
+       void __iomem *amb_mmio;
+       struct i5k_device_attribute *attrs;
+       unsigned int num_attrs;
+};
+
+static ssize_t show_name(struct device *dev, struct device_attribute *devattr,
+                        char *buf)
+{
+       return sprintf(buf, "%s\n", DRVNAME);
+}
+
+
+static DEVICE_ATTR(name, S_IRUGO, show_name, NULL);
+
+static struct platform_device *amb_pdev;
+
+static u8 amb_read_byte(struct i5k_amb_data *data, unsigned long offset)
+{
+       return ioread8(data->amb_mmio + offset);
+}
+
+static void amb_write_byte(struct i5k_amb_data *data, unsigned long offset,
+                          u8 val)
+{
+       iowrite8(val, data->amb_mmio + offset);
+}
+
+static ssize_t show_amb_alarm(struct device *dev,
+                            struct device_attribute *devattr,
+                            char *buf)
+{
+       struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+       struct i5k_amb_data *data = dev_get_drvdata(dev);
+
+       if (!(amb_read_byte(data, amb_reg_temp_status(attr->index)) & 0x20) &&
+            (amb_read_byte(data, amb_reg_temp_status(attr->index)) & 0x8))
+               return sprintf(buf, "1\n");
+       else
+               return sprintf(buf, "0\n");
+}
+
+static ssize_t store_amb_min(struct device *dev,
+                            struct device_attribute *devattr,
+                            const char *buf,
+                            size_t count)
+{
+       struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+       struct i5k_amb_data *data = dev_get_drvdata(dev);
+       unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;
+
+       if (temp > 255)
+               temp = 255;
+
+       amb_write_byte(data, amb_reg_temp_min(attr->index), temp);
+       return count;
+}
+
+static ssize_t store_amb_mid(struct device *dev,
+                            struct device_attribute *devattr,
+                            const char *buf,
+                            size_t count)
+{
+       struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+       struct i5k_amb_data *data = dev_get_drvdata(dev);
+       unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;
+
+       if (temp > 255)
+               temp = 255;
+
+       amb_write_byte(data, amb_reg_temp_mid(attr->index), temp);
+       return count;
+}
+
+static ssize_t store_amb_max(struct device *dev,
+                            struct device_attribute *devattr,
+                            const char *buf,
+                            size_t count)
+{
+       struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+       struct i5k_amb_data *data = dev_get_drvdata(dev);
+       unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;
+
+       if (temp > 255)
+               temp = 255;
+
+       amb_write_byte(data, amb_reg_temp_max(attr->index), temp);
+       return count;
+}
+
+static ssize_t show_amb_min(struct device *dev,
+                            struct device_attribute *devattr,
+                            char *buf)
+{
+       struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+       struct i5k_amb_data *data = dev_get_drvdata(dev);
+       return sprintf(buf, "%d\n",
+               500 * amb_read_byte(data, amb_reg_temp_min(attr->index)));
+}
+
+static ssize_t show_amb_mid(struct device *dev,
+                            struct device_attribute *devattr,
+                            char *buf)
+{
+       struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+       struct i5k_amb_data *data = dev_get_drvdata(dev);
+       return sprintf(buf, "%d\n",
+               500 * amb_read_byte(data, amb_reg_temp_mid(attr->index)));
+}
+
+static ssize_t show_amb_max(struct device *dev,
+                            struct device_attribute *devattr,
+                            char *buf)
+{
+       struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+       struct i5k_amb_data *data = dev_get_drvdata(dev);
+       return sprintf(buf, "%d\n",
+               500 * amb_read_byte(data, amb_reg_temp_max(attr->index)));
+}
+
+static ssize_t show_amb_temp(struct device *dev,
+                            struct device_attribute *devattr,
+                            char *buf)
+{
+       struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+       struct i5k_amb_data *data = dev_get_drvdata(dev);
+       return sprintf(buf, "%d\n",
+               500 * amb_read_byte(data, amb_reg_temp(attr->index)));
+}
+
+static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev)
+{
+       int i, j, k, d = 0;
+       u16 c;
+       int res = 0;
+       int num_ambs = 0;
+       struct i5k_amb_data *data = platform_get_drvdata(pdev);
+
+       /* Count the number of AMBs found */
+       /* ignore the high-order bit, see "Ugly hack" comment above */
+       for (i = 0; i < MAX_MEM_CHANNELS; i++)
+               num_ambs += hweight16(data->amb_present[i] & 0x7fff);
+
+       /* Set up sysfs stuff */
+       data->attrs = kzalloc(sizeof(*data->attrs) * num_ambs * KNOBS_PER_AMB,
+                               GFP_KERNEL);
+       if (!data->attrs)
+               return -ENOMEM;
+       data->num_attrs = 0;
+
+       for (i = 0; i < MAX_MEM_CHANNELS; i++) {
+               c = data->amb_present[i];
+               for (j = 0; j < REAL_MAX_AMBS_PER_CHANNEL; j++, c >>= 1) {
+                       struct i5k_device_attribute *iattr;
+
+                       k = amb_num_from_reg(i, j);
+                       if (!(c & 0x1))
+                               continue;
+                       d++;
+
+                       /* Temperature sysfs knob */
+                       iattr = data->attrs + data->num_attrs;
+                       snprintf(iattr->name, AMB_SYSFS_NAME_LEN,
+                                "temp%d_input", d);
+                       iattr->s_attr.dev_attr.attr.name = iattr->name;
+                       iattr->s_attr.dev_attr.attr.mode = S_IRUGO;
+                       iattr->s_attr.dev_attr.show = show_amb_temp;
+                       iattr->s_attr.index = k;
+                       res = device_create_file(&pdev->dev,
+                                                &iattr->s_attr.dev_attr);
+                       if (res)
+                               goto exit_remove;
+                       data->num_attrs++;
+
+                       /* Temperature min sysfs knob */
+                       iattr = data->attrs + data->num_attrs;
+                       snprintf(iattr->name, AMB_SYSFS_NAME_LEN,
+                                "temp%d_min", d);
+                       iattr->s_attr.dev_attr.attr.name = iattr->name;
+                       iattr->s_attr.dev_attr.attr.mode = S_IWUSR | S_IRUGO;
+                       iattr->s_attr.dev_attr.show = show_amb_min;
+                       iattr->s_attr.dev_attr.store = store_amb_min;
+                       iattr->s_attr.index = k;
+                       res = device_create_file(&pdev->dev,
+                                                &iattr->s_attr.dev_attr);
+                       if (res)
+                               goto exit_remove;
+                       data->num_attrs++;
+
+                       /* Temperature mid sysfs knob */
+                       iattr = data->attrs + data->num_attrs;
+                       snprintf(iattr->name, AMB_SYSFS_NAME_LEN,
+                                "temp%d_mid", d);
+                       iattr->s_attr.dev_attr.attr.name = iattr->name;
+                       iattr->s_attr.dev_attr.attr.mode = S_IWUSR | S_IRUGO;
+                       iattr->s_attr.dev_attr.show = show_amb_mid;
+                       iattr->s_attr.dev_attr.store = store_amb_mid;
+                       iattr->s_attr.index = k;
+                       res = device_create_file(&pdev->dev,
+                                                &iattr->s_attr.dev_attr);
+                       if (res)
+                               goto exit_remove;
+                       data->num_attrs++;
+
+                       /* Temperature max sysfs knob */
+                       iattr = data->attrs + data->num_attrs;
+                       snprintf(iattr->name, AMB_SYSFS_NAME_LEN,
+                                "temp%d_max", d);
+                       iattr->s_attr.dev_attr.attr.name = iattr->name;
+                       iattr->s_attr.dev_attr.attr.mode = S_IWUSR | S_IRUGO;
+                       iattr->s_attr.dev_attr.show = show_amb_max;
+                       iattr->s_attr.dev_attr.store = store_amb_max;
+                       iattr->s_attr.index = k;
+                       res = device_create_file(&pdev->dev,
+                                                &iattr->s_attr.dev_attr);
+                       if (res)
+                               goto exit_remove;
+                       data->num_attrs++;
+
+                       /* Temperature alarm sysfs knob */
+                       iattr = data->attrs + data->num_attrs;
+                       snprintf(iattr->name, AMB_SYSFS_NAME_LEN,
+                                "temp%d_alarm", d);
+                       iattr->s_attr.dev_attr.attr.name = iattr->name;
+                       iattr->s_attr.dev_attr.attr.mode = S_IRUGO;
+                       iattr->s_attr.dev_attr.show = show_amb_alarm;
+                       iattr->s_attr.index = k;
+                       res = device_create_file(&pdev->dev,
+                                                &iattr->s_attr.dev_attr);
+                       if (res)
+                               goto exit_remove;
+                       data->num_attrs++;
+               }
+       }
+
+       res = device_create_file(&pdev->dev, &dev_attr_name);
+       if (res)
+               goto exit_remove;
+
+       data->hwmon_dev = hwmon_device_register(&pdev->dev);
+       if (IS_ERR(data->hwmon_dev)) {
+               res = PTR_ERR(data->hwmon_dev);
+               goto exit_remove;
+       }
+
+       return res;
+
+exit_remove:
+       device_remove_file(&pdev->dev, &dev_attr_name);
+       for (i = 0; i < data->num_attrs; i++)
+               device_remove_file(&pdev->dev, &data->attrs[i].s_attr.dev_attr);
+       kfree(data->attrs);
+
+       return res;
+}
+
+static int __devinit i5k_amb_add(void)
+{
+       int res = -ENODEV;
+
+       /* only ever going to be one of these */
+       amb_pdev = platform_device_alloc(DRVNAME, 0);
+       if (!amb_pdev)
+               return -ENOMEM;
+
+       res = platform_device_add(amb_pdev);
+       if (res)
+               goto err;
+       return 0;
+
+err:
+       platform_device_put(amb_pdev);
+       return res;
+}
+
+static int __devinit i5k_find_amb_registers(struct i5k_amb_data *data)
+{
+       struct pci_dev *pcidev;
+       u32 val32;
+       int res = -ENODEV;
+
+       /* Find AMB register memory space */
+       pcidev = pci_get_device(PCI_VENDOR_ID_INTEL,
+                               PCI_DEVICE_ID_INTEL_5000_ERR,
+                               NULL);
+       if (!pcidev)
+               return -ENODEV;
+
+       if (pci_read_config_dword(pcidev, I5K_REG_AMB_BASE_ADDR, &val32))
+               goto out;
+       data->amb_base = val32;
+
+       if (pci_read_config_dword(pcidev, I5K_REG_AMB_LEN_ADDR, &val32))
+               goto out;
+       data->amb_len = val32;
+
+       /* Is it big enough? */
+       if (data->amb_len < AMB_CONFIG_SIZE * MAX_AMBS) {
+               dev_err(&pcidev->dev, "AMB region too small!\n");
+               goto out;
+       }
+
+       res = 0;
+out:
+       pci_dev_put(pcidev);
+       return res;
+}
+
+static int __devinit i5k_channel_probe(u16 *amb_present, unsigned long dev_id)
+{
+       struct pci_dev *pcidev;
+       u16 val16;
+       int res = -ENODEV;
+
+       /* Copy the DIMM presence map for these two channels */
+       pcidev = pci_get_device(PCI_VENDOR_ID_INTEL, dev_id, NULL);
+       if (!pcidev)
+               return -ENODEV;
+
+       if (pci_read_config_word(pcidev, I5K_REG_CHAN0_PRESENCE_ADDR, &val16))
+               goto out;
+       amb_present[0] = val16;
+
+       if (pci_read_config_word(pcidev, I5K_REG_CHAN1_PRESENCE_ADDR, &val16))
+               goto out;
+       amb_present[1] = val16;
+
+       res = 0;
+
+out:
+       pci_dev_put(pcidev);
+       return res;
+}
+
+static int __devinit i5k_amb_probe(struct platform_device *pdev)
+{
+       struct i5k_amb_data *data;
+       struct resource *reso;
+       int res = -ENODEV;
+
+       data = kzalloc(sizeof(*data), GFP_KERNEL);
+       if (!data)
+               return -ENOMEM;
+
+       /* Figure out where the AMB registers live */
+       res = i5k_find_amb_registers(data);
+       if (res)
+               goto err;
+
+       /* Copy the DIMM presence map for the first two channels */
+       res = i5k_channel_probe(&data->amb_present[0],
+                               PCI_DEVICE_ID_INTEL_5000_FBD0);
+       if (res)
+               goto err;
+
+       /* Copy the DIMM presence map for the optional second two channels */
+       i5k_channel_probe(&data->amb_present[2],
+                         PCI_DEVICE_ID_INTEL_5000_FBD1);
+
+       /* Set up resource regions */
+       reso = request_mem_region(data->amb_base, data->amb_len, DRVNAME);
+       if (!reso) {
+               res = -EBUSY;
+               goto err;
+       }
+
+       data->amb_mmio = ioremap_nocache(data->amb_base, data->amb_len);
+       if (!data->amb_mmio) {
+               res = -EBUSY;
+               goto err_map_failed;
+       }
+
+       platform_set_drvdata(pdev, data);
+
+       res = i5k_amb_hwmon_init(pdev);
+       if (res)
+               goto err_init_failed;
+
+       return res;
+
+err_init_failed:
+       iounmap(data->amb_mmio);
+       platform_set_drvdata(pdev, NULL);
+err_map_failed:
+       release_mem_region(data->amb_base, data->amb_len);
+err:
+       kfree(data);
+       return res;
+}
+
+static int __devexit i5k_amb_remove(struct platform_device *pdev)
+{
+       int i;
+       struct i5k_amb_data *data = platform_get_drvdata(pdev);
+
+       hwmon_device_unregister(data->hwmon_dev);
+       device_remove_file(&pdev->dev, &dev_attr_name);
+       for (i = 0; i < data->num_attrs; i++)
+               device_remove_file(&pdev->dev, &data->attrs[i].s_attr.dev_attr);
+       kfree(data->attrs);
+       iounmap(data->amb_mmio);
+       release_mem_region(data->amb_base, data->amb_len);
+       platform_set_drvdata(pdev, NULL);
+       kfree(data);
+       return 0;
+}
+
+static struct platform_driver i5k_amb_driver = {
+       .driver = {
+               .owner = THIS_MODULE,
+               .name = DRVNAME,
+       },
+       .probe = i5k_amb_probe,
+       .remove = __devexit_p(i5k_amb_remove),
+};
+
+static int __init i5k_amb_init(void)
+{
+       int res;
+
+       res = platform_driver_register(&i5k_amb_driver);
+       if (res)
+               return res;
+
+       res = i5k_amb_add();
+       if (res)
+               platform_driver_unregister(&i5k_amb_driver);
+
+       return res;
+}
+
+static void __exit i5k_amb_exit(void)
+{
+       platform_device_unregister(amb_pdev);
+       platform_driver_unregister(&i5k_amb_driver);
+}
+
+MODULE_AUTHOR("Darrick J. Wong <djwong@us.ibm.com>");
+MODULE_DESCRIPTION("Intel 5000 chipset FB-DIMM AMB temperature sensor");
+MODULE_LICENSE("GPL");
+
+module_init(i5k_amb_init);
+module_exit(i5k_amb_exit);
index c462824ffccfe9936d0f6236dc8788a3d5d2dacf..9c9cdb0685e43511928c400ce89a1205d20ec8c9 100644 (file)
@@ -140,10 +140,10 @@ static int ibmpex_send_message(struct ibmpex_bmc_data *data)
 
        return 0;
 out1:
-       printk(KERN_ERR "%s: request_settime=%x\n", __FUNCTION__, err);
+       dev_err(data->bmc_device, "request_settime=%x\n", err);
        return err;
 out:
-       printk(KERN_ERR "%s: validate_addr=%x\n", __FUNCTION__, err);
+       dev_err(data->bmc_device, "validate_addr=%x\n", err);
        return err;
 }
 
@@ -161,14 +161,14 @@ static int ibmpex_ver_check(struct ibmpex_bmc_data *data)
        data->sensor_major = data->rx_msg_data[0];
        data->sensor_minor = data->rx_msg_data[1];
 
-       printk(KERN_INFO DRVNAME ": Found BMC with sensor interface "
-              "v%d.%d %d-%02d-%02d on interface %d\n",
-              data->sensor_major,
-              data->sensor_minor,
-              extract_value(data->rx_msg_data, 2),
-              data->rx_msg_data[4],
-              data->rx_msg_data[5],
-              data->interface);
+       dev_info(data->bmc_device, "Found BMC with sensor interface "
+                "v%d.%d %d-%02d-%02d on interface %d\n",
+                data->sensor_major,
+                data->sensor_minor,
+                extract_value(data->rx_msg_data, 2),
+                data->rx_msg_data[4],
+                data->rx_msg_data[5],
+                data->interface);
 
        return 0;
 }
@@ -212,8 +212,8 @@ static int ibmpex_query_sensor_data(struct ibmpex_bmc_data *data, int sensor)
        wait_for_completion(&data->read_complete);
 
        if (data->rx_result || data->rx_msg_len < 26) {
-               printk(KERN_ERR "Error reading sensor %d, please check.\n",
-                      sensor);
+               dev_err(data->bmc_device, "Error reading sensor %d.\n",
+                       sensor);
                return -ENOENT;
        }
 
@@ -456,8 +456,7 @@ static void ibmpex_register_bmc(int iface, struct device *dev)
 
        data = kzalloc(sizeof(*data), GFP_KERNEL);
        if (!data) {
-               printk(KERN_ERR DRVNAME ": Insufficient memory for BMC "
-                      "interface %d.\n", data->interface);
+               dev_err(dev, "Insufficient memory for BMC interface.\n");
                return;
        }
 
@@ -471,9 +470,8 @@ static void ibmpex_register_bmc(int iface, struct device *dev)
        err = ipmi_create_user(data->interface, &driver_data.ipmi_hndlrs,
                               data, &data->user);
        if (err < 0) {
-               printk(KERN_ERR DRVNAME ": Error, unable to register user with "
-                      "ipmi interface %d\n",
-                      data->interface);
+               dev_err(dev, "Unable to register user with IPMI "
+                       "interface %d\n", data->interface);
                goto out;
        }
 
@@ -495,9 +493,9 @@ static void ibmpex_register_bmc(int iface, struct device *dev)
        data->hwmon_dev = hwmon_device_register(data->bmc_device);
 
        if (IS_ERR(data->hwmon_dev)) {
-               printk(KERN_ERR DRVNAME ": Error, unable to register hwmon "
-                      "class device for interface %d\n",
-                      data->interface);
+               dev_err(data->bmc_device, "Unable to register hwmon "
+                       "device for IPMI interface %d\n",
+                       data->interface);
                goto out_user;
        }
 
@@ -508,7 +506,7 @@ static void ibmpex_register_bmc(int iface, struct device *dev)
        /* Now go find all the sensors */
        err = ibmpex_find_sensors(data);
        if (err) {
-               printk(KERN_ERR "Error %d allocating memory\n", err);
+               dev_err(data->bmc_device, "Error %d finding sensors\n", err);
                goto out_register;
        }
 
@@ -561,10 +559,10 @@ static void ibmpex_msg_handler(struct ipmi_recv_msg *msg, void *user_msg_data)
        struct ibmpex_bmc_data *data = (struct ibmpex_bmc_data *)user_msg_data;
 
        if (msg->msgid != data->tx_msgid) {
-               printk(KERN_ERR "Received msgid (%02x) and transmitted "
-                      "msgid (%02x) mismatch!\n",
-                      (int)msg->msgid,
-                      (int)data->tx_msgid);
+               dev_err(data->bmc_device, "Mismatch between received msgid "
+                       "(%02x) and transmitted msgid (%02x)!\n",
+                       (int)msg->msgid,
+                       (int)data->tx_msgid);
                ipmi_free_recv_msg(msg);
                return;
        }
index dd366889ce9b8038c2e59342a70b8c7d340c818b..d435f003292dfd290a2d89fda730fa597c45eef2 100644 (file)
 #include <linux/err.h>
 #include <linux/sysfs.h>
 #include <linux/hwmon.h>
+#include <linux/mutex.h>
 #include <linux/spi/spi.h>
-#include <asm/semaphore.h>
+
 
 #define DRVNAME                "lm70"
 
 struct lm70 {
        struct device *hwmon_dev;
-       struct semaphore sem;
+       struct mutex lock;
 };
 
 /* sysfs hook function */
@@ -51,7 +52,7 @@ static ssize_t lm70_sense_temp(struct device *dev,
        s16 raw=0;
        struct lm70 *p_lm70 = dev_get_drvdata(&spi->dev);
 
-       if (down_interruptible(&p_lm70->sem))
+       if (mutex_lock_interruptible(&p_lm70->lock))
                return -ERESTARTSYS;
 
        /*
@@ -83,7 +84,7 @@ static ssize_t lm70_sense_temp(struct device *dev,
        val = ((int)raw/32) * 250;
        status = sprintf(buf, "%d\n", val); /* millidegrees Celsius */
 out:
-       up(&p_lm70->sem);
+       mutex_unlock(&p_lm70->lock);
        return status;
 }
 
@@ -112,7 +113,7 @@ static int __devinit lm70_probe(struct spi_device *spi)
        if (!p_lm70)
                return -ENOMEM;
 
-       init_MUTEX(&p_lm70->sem);
+       mutex_init(&p_lm70->lock);
 
        /* sysfs hook */
        p_lm70->hwmon_dev = hwmon_device_register(&spi->dev);
index 7e2d9787babc4b5776ea262a84473f0d36824331..a276806f3d53cd8b9ab192f3283019b7550531c5 100644 (file)
@@ -435,6 +435,22 @@ static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, ch
 }
 static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
 
+static ssize_t show_alarm(struct device *dev, struct device_attribute *da,
+                         char *buf)
+{
+       struct sis5595_data *data = sis5595_update_device(dev);
+       int nr = to_sensor_dev_attr(da)->index;
+       return sprintf(buf, "%u\n", (data->alarms >> nr) & 1);
+}
+static SENSOR_DEVICE_ATTR(in0_alarm, S_IRUGO, show_alarm, NULL, 0);
+static SENSOR_DEVICE_ATTR(in1_alarm, S_IRUGO, show_alarm, NULL, 1);
+static SENSOR_DEVICE_ATTR(in2_alarm, S_IRUGO, show_alarm, NULL, 2);
+static SENSOR_DEVICE_ATTR(in3_alarm, S_IRUGO, show_alarm, NULL, 3);
+static SENSOR_DEVICE_ATTR(in4_alarm, S_IRUGO, show_alarm, NULL, 15);
+static SENSOR_DEVICE_ATTR(fan1_alarm, S_IRUGO, show_alarm, NULL, 6);
+static SENSOR_DEVICE_ATTR(fan2_alarm, S_IRUGO, show_alarm, NULL, 7);
+static SENSOR_DEVICE_ATTR(temp1_alarm, S_IRUGO, show_alarm, NULL, 15);
+
 static ssize_t show_name(struct device *dev, struct device_attribute *attr,
                         char *buf)
 {
@@ -447,22 +463,28 @@ static struct attribute *sis5595_attributes[] = {
        &sensor_dev_attr_in0_input.dev_attr.attr,
        &sensor_dev_attr_in0_min.dev_attr.attr,
        &sensor_dev_attr_in0_max.dev_attr.attr,
+       &sensor_dev_attr_in0_alarm.dev_attr.attr,
        &sensor_dev_attr_in1_input.dev_attr.attr,
        &sensor_dev_attr_in1_min.dev_attr.attr,
        &sensor_dev_attr_in1_max.dev_attr.attr,
+       &sensor_dev_attr_in1_alarm.dev_attr.attr,
        &sensor_dev_attr_in2_input.dev_attr.attr,
        &sensor_dev_attr_in2_min.dev_attr.attr,
        &sensor_dev_attr_in2_max.dev_attr.attr,
+       &sensor_dev_attr_in2_alarm.dev_attr.attr,
        &sensor_dev_attr_in3_input.dev_attr.attr,
        &sensor_dev_attr_in3_min.dev_attr.attr,
        &sensor_dev_attr_in3_max.dev_attr.attr,
+       &sensor_dev_attr_in3_alarm.dev_attr.attr,
 
        &sensor_dev_attr_fan1_input.dev_attr.attr,
        &sensor_dev_attr_fan1_min.dev_attr.attr,
        &sensor_dev_attr_fan1_div.dev_attr.attr,
+       &sensor_dev_attr_fan1_alarm.dev_attr.attr,
        &sensor_dev_attr_fan2_input.dev_attr.attr,
        &sensor_dev_attr_fan2_min.dev_attr.attr,
        &sensor_dev_attr_fan2_div.dev_attr.attr,
+       &sensor_dev_attr_fan2_alarm.dev_attr.attr,
 
        &dev_attr_alarms.attr,
        &dev_attr_name.attr,
@@ -473,19 +495,28 @@ static const struct attribute_group sis5595_group = {
        .attrs = sis5595_attributes,
 };
 
-static struct attribute *sis5595_attributes_opt[] = {
+static struct attribute *sis5595_attributes_in4[] = {
        &sensor_dev_attr_in4_input.dev_attr.attr,
        &sensor_dev_attr_in4_min.dev_attr.attr,
        &sensor_dev_attr_in4_max.dev_attr.attr,
+       &sensor_dev_attr_in4_alarm.dev_attr.attr,
+       NULL
+};
+
+static const struct attribute_group sis5595_group_in4 = {
+       .attrs = sis5595_attributes_in4,
+};
 
+static struct attribute *sis5595_attributes_temp1[] = {
        &dev_attr_temp1_input.attr,
        &dev_attr_temp1_max.attr,
        &dev_attr_temp1_max_hyst.attr,
+       &sensor_dev_attr_temp1_alarm.dev_attr.attr,
        NULL
 };
 
-static const struct attribute_group sis5595_group_opt = {
-       .attrs = sis5595_attributes_opt,
+static const struct attribute_group sis5595_group_temp1 = {
+       .attrs = sis5595_attributes_temp1,
 };
  
 /* This is called when the module is loaded */
@@ -540,20 +571,12 @@ static int __devinit sis5595_probe(struct platform_device *pdev)
        if ((err = sysfs_create_group(&pdev->dev.kobj, &sis5595_group)))
                goto exit_free;
        if (data->maxins == 4) {
-               if ((err = device_create_file(&pdev->dev,
-                                       &sensor_dev_attr_in4_input.dev_attr))
-                || (err = device_create_file(&pdev->dev,
-                                       &sensor_dev_attr_in4_min.dev_attr))
-                || (err = device_create_file(&pdev->dev,
-                                       &sensor_dev_attr_in4_max.dev_attr)))
+               if ((err = sysfs_create_group(&pdev->dev.kobj,
+                                             &sis5595_group_in4)))
                        goto exit_remove_files;
        } else {
-               if ((err = device_create_file(&pdev->dev,
-                                             &dev_attr_temp1_input))
-                || (err = device_create_file(&pdev->dev,
-                                             &dev_attr_temp1_max))
-                || (err = device_create_file(&pdev->dev,
-                                             &dev_attr_temp1_max_hyst)))
+               if ((err = sysfs_create_group(&pdev->dev.kobj,
+                                             &sis5595_group_temp1)))
                        goto exit_remove_files;
        }
 
@@ -567,7 +590,8 @@ static int __devinit sis5595_probe(struct platform_device *pdev)
 
 exit_remove_files:
        sysfs_remove_group(&pdev->dev.kobj, &sis5595_group);
-       sysfs_remove_group(&pdev->dev.kobj, &sis5595_group_opt);
+       sysfs_remove_group(&pdev->dev.kobj, &sis5595_group_in4);
+       sysfs_remove_group(&pdev->dev.kobj, &sis5595_group_temp1);
 exit_free:
        kfree(data);
 exit_release:
@@ -582,7 +606,8 @@ static int __devexit sis5595_remove(struct platform_device *pdev)
 
        hwmon_device_unregister(data->hwmon_dev);
        sysfs_remove_group(&pdev->dev.kobj, &sis5595_group);
-       sysfs_remove_group(&pdev->dev.kobj, &sis5595_group_opt);
+       sysfs_remove_group(&pdev->dev.kobj, &sis5595_group_in4);
+       sysfs_remove_group(&pdev->dev.kobj, &sis5595_group_temp1);
 
        release_region(data->addr, SIS5595_EXTENT);
        platform_set_drvdata(pdev, NULL);
index 20ae425a1980ce7add4c6a29b055279908a54a60..879d0a6544ccfb865ef0c6ddeead32e542f3a0bd 100644 (file)
@@ -170,20 +170,16 @@ superio_exit(void)
 #define W83781D_REG_IN(nr)     ((nr < 7) ? (0x20 + (nr)) : \
                                           (0x550 + (nr) - 7))
 
-#define W83781D_REG_FAN_MIN(nr) (0x3a + (nr))
-#define W83781D_REG_FAN(nr) (0x27 + (nr))
-
-#define W83781D_REG_TEMP2_CONFIG 0x152
-#define W83781D_REG_TEMP3_CONFIG 0x252
-#define W83781D_REG_TEMP(nr)           ((nr == 3) ? (0x0250) : \
-                                       ((nr == 2) ? (0x0150) : \
-                                                    (0x27)))
-#define W83781D_REG_TEMP_HYST(nr)      ((nr == 3) ? (0x253) : \
-                                       ((nr == 2) ? (0x153) : \
-                                                    (0x3A)))
-#define W83781D_REG_TEMP_OVER(nr)      ((nr == 3) ? (0x255) : \
-                                       ((nr == 2) ? (0x155) : \
-                                                    (0x39)))
+/* nr:0-2 for fans:1-3 */
+#define W83627HF_REG_FAN_MIN(nr)       (0x3b + (nr))
+#define W83627HF_REG_FAN(nr)           (0x28 + (nr))
+
+#define W83627HF_REG_TEMP2_CONFIG 0x152
+#define W83627HF_REG_TEMP3_CONFIG 0x252
+/* these are zero-based, unlike config constants above */
+static const u16 w83627hf_reg_temp[]           = { 0x27, 0x150, 0x250 };
+static const u16 w83627hf_reg_temp_hyst[]      = { 0x3A, 0x153, 0x253 };
+static const u16 w83627hf_reg_temp_over[]      = { 0x39, 0x155, 0x255 };
 
 #define W83781D_REG_BANK 0x4E
 
@@ -360,12 +356,9 @@ struct w83627hf_data {
        u8 in_min[9];           /* Register value */
        u8 fan[3];              /* Register value */
        u8 fan_min[3];          /* Register value */
-       u8 temp;
-       u8 temp_max;            /* Register value */
-       u8 temp_max_hyst;       /* Register value */
-       u16 temp_add[2];        /* Register value */
-       u16 temp_max_add[2];    /* Register value */
-       u16 temp_max_hyst_add[2]; /* Register value */
+       u16 temp[3];            /* Register value */
+       u16 temp_max[3];        /* Register value */
+       u16 temp_max_hyst[3];   /* Register value */
        u8 fan_div[3];          /* Register encoding, shifted right */
        u8 vid;                 /* Register encoding, combined */
        u32 alarms;             /* Register encoding, combined */
@@ -590,7 +583,7 @@ store_fan_min(struct device *dev, struct device_attribute *devattr,
 
        mutex_lock(&data->update_lock);
        data->fan_min[nr] = FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr]));
-       w83627hf_write_value(data, W83781D_REG_FAN_MIN(nr+1),
+       w83627hf_write_value(data, W83627HF_REG_FAN_MIN(nr),
                             data->fan_min[nr]);
 
        mutex_unlock(&data->update_lock);
@@ -611,12 +604,10 @@ show_temp(struct device *dev, struct device_attribute *devattr, char *buf)
 {
        int nr = to_sensor_dev_attr(devattr)->index;
        struct w83627hf_data *data = w83627hf_update_device(dev);
-       if (nr >= 2) {  /* TEMP2 and TEMP3 */
-               return sprintf(buf, "%ld\n",
-                       (long)LM75_TEMP_FROM_REG(data->temp_add[nr-2]));
-       } else {        /* TEMP1 */
-               return sprintf(buf, "%ld\n", (long)TEMP_FROM_REG(data->temp));
-       }
+
+       u16 tmp = data->temp[nr];
+       return sprintf(buf, "%ld\n", (nr) ? (long) LM75_TEMP_FROM_REG(tmp)
+                                         : (long) TEMP_FROM_REG(tmp));
 }
 
 static ssize_t
@@ -625,13 +616,10 @@ show_temp_max(struct device *dev, struct device_attribute *devattr,
 {
        int nr = to_sensor_dev_attr(devattr)->index;
        struct w83627hf_data *data = w83627hf_update_device(dev);
-       if (nr >= 2) {  /* TEMP2 and TEMP3 */
-               return sprintf(buf, "%ld\n",
-                       (long)LM75_TEMP_FROM_REG(data->temp_max_add[nr-2]));
-       } else {        /* TEMP1 */
-               return sprintf(buf, "%ld\n",
-                       (long)TEMP_FROM_REG(data->temp_max));
-       }
+
+       u16 tmp = data->temp_max[nr];
+       return sprintf(buf, "%ld\n", (nr) ? (long) LM75_TEMP_FROM_REG(tmp)
+                                         : (long) TEMP_FROM_REG(tmp));
 }
 
 static ssize_t
@@ -640,13 +628,10 @@ show_temp_max_hyst(struct device *dev, struct device_attribute *devattr,
 {
        int nr = to_sensor_dev_attr(devattr)->index;
        struct w83627hf_data *data = w83627hf_update_device(dev);
-       if (nr >= 2) {  /* TEMP2 and TEMP3 */
-               return sprintf(buf, "%ld\n",
-                       (long)LM75_TEMP_FROM_REG(data->temp_max_hyst_add[nr-2]));
-       } else {        /* TEMP1 */
-               return sprintf(buf, "%ld\n",
-                       (long)TEMP_FROM_REG(data->temp_max_hyst));
-       }
+
+       u16 tmp = data->temp_max_hyst[nr];
+       return sprintf(buf, "%ld\n", (nr) ? (long) LM75_TEMP_FROM_REG(tmp)
+                                         : (long) TEMP_FROM_REG(tmp));
 }
 
 static ssize_t
@@ -656,18 +641,11 @@ store_temp_max(struct device *dev, struct device_attribute *devattr,
        int nr = to_sensor_dev_attr(devattr)->index;
        struct w83627hf_data *data = dev_get_drvdata(dev);
        long val = simple_strtol(buf, NULL, 10);
+       u16 tmp = (nr) ? LM75_TEMP_TO_REG(val) : TEMP_TO_REG(val);
 
        mutex_lock(&data->update_lock);
-
-       if (nr >= 2) {  /* TEMP2 and TEMP3 */
-               data->temp_max_add[nr-2] = LM75_TEMP_TO_REG(val);
-               w83627hf_write_value(data, W83781D_REG_TEMP_OVER(nr),
-                               data->temp_max_add[nr-2]);
-       } else {        /* TEMP1 */
-               data->temp_max = TEMP_TO_REG(val);
-               w83627hf_write_value(data, W83781D_REG_TEMP_OVER(nr),
-                       data->temp_max);
-       }
+       data->temp_max[nr] = tmp;
+       w83627hf_write_value(data, w83627hf_reg_temp_over[nr], tmp);
        mutex_unlock(&data->update_lock);
        return count;
 }
@@ -679,29 +657,22 @@ store_temp_max_hyst(struct device *dev, struct device_attribute *devattr,
        int nr = to_sensor_dev_attr(devattr)->index;
        struct w83627hf_data *data = dev_get_drvdata(dev);
        long val = simple_strtol(buf, NULL, 10);
+       u16 tmp = (nr) ? LM75_TEMP_TO_REG(val) : TEMP_TO_REG(val);
 
        mutex_lock(&data->update_lock);
-
-       if (nr >= 2) {  /* TEMP2 and TEMP3 */
-               data->temp_max_hyst_add[nr-2] = LM75_TEMP_TO_REG(val);
-               w83627hf_write_value(data, W83781D_REG_TEMP_HYST(nr),
-                               data->temp_max_hyst_add[nr-2]);
-       } else {        /* TEMP1 */
-               data->temp_max_hyst = TEMP_TO_REG(val);
-               w83627hf_write_value(data, W83781D_REG_TEMP_HYST(nr),
-                       data->temp_max_hyst);
-       }
+       data->temp_max_hyst[nr] = tmp;
+       w83627hf_write_value(data, w83627hf_reg_temp_hyst[nr], tmp);
        mutex_unlock(&data->update_lock);
        return count;
 }
 
 #define sysfs_temp_decl(offset) \
 static SENSOR_DEVICE_ATTR(temp##offset##_input, S_IRUGO,               \
-                         show_temp, NULL, offset);                     \
+                         show_temp, NULL, offset - 1);                 \
 static SENSOR_DEVICE_ATTR(temp##offset##_max, S_IRUGO|S_IWUSR,         \
-                         show_temp_max, store_temp_max, offset);       \
+                         show_temp_max, store_temp_max, offset - 1);   \
 static SENSOR_DEVICE_ATTR(temp##offset##_max_hyst, S_IRUGO|S_IWUSR,    \
-                         show_temp_max_hyst, store_temp_max_hyst, offset);
+                         show_temp_max_hyst, store_temp_max_hyst, offset - 1);
 
 sysfs_temp_decl(1);
 sysfs_temp_decl(2);
@@ -844,7 +815,7 @@ store_fan_div(struct device *dev, struct device_attribute *devattr,
 
        /* Restore fan_min */
        data->fan_min[nr] = FAN_TO_REG(min, DIV_FROM_REG(data->fan_div[nr]));
-       w83627hf_write_value(data, W83781D_REG_FAN_MIN(nr+1), data->fan_min[nr]);
+       w83627hf_write_value(data, W83627HF_REG_FAN_MIN(nr), data->fan_min[nr]);
 
        mutex_unlock(&data->update_lock);
        return count;
@@ -1170,7 +1141,7 @@ static int __devinit w83627hf_probe(struct platform_device *pdev)
        struct w83627hf_sio_data *sio_data = dev->platform_data;
        struct w83627hf_data *data;
        struct resource *res;
-       int err;
+       int err, i;
 
        static const char *names[] = {
                "w83627hf",
@@ -1204,9 +1175,9 @@ static int __devinit w83627hf_probe(struct platform_device *pdev)
        w83627hf_init_device(pdev);
 
        /* A few vars need to be filled upon startup */
-       data->fan_min[0] = w83627hf_read_value(data, W83781D_REG_FAN_MIN(1));
-       data->fan_min[1] = w83627hf_read_value(data, W83781D_REG_FAN_MIN(2));
-       data->fan_min[2] = w83627hf_read_value(data, W83781D_REG_FAN_MIN(3));
+       for (i = 0; i <= 2; i++)
+               data->fan_min[i] = w83627hf_read_value(
+                                       data, W83627HF_REG_FAN_MIN(i));
        w83627hf_update_fan_div(data);
 
        /* Register common device attributes */
@@ -1514,23 +1485,23 @@ static void __devinit w83627hf_init_device(struct platform_device *pdev)
 
        if(init) {
                /* Enable temp2 */
-               tmp = w83627hf_read_value(data, W83781D_REG_TEMP2_CONFIG);
+               tmp = w83627hf_read_value(data, W83627HF_REG_TEMP2_CONFIG);
                if (tmp & 0x01) {
                        dev_warn(&pdev->dev, "Enabling temp2, readings "
                                 "might not make sense\n");
-                       w83627hf_write_value(data, W83781D_REG_TEMP2_CONFIG,
+                       w83627hf_write_value(data, W83627HF_REG_TEMP2_CONFIG,
                                tmp & 0xfe);
                }
 
                /* Enable temp3 */
                if (type != w83697hf) {
                        tmp = w83627hf_read_value(data,
-                               W83781D_REG_TEMP3_CONFIG);
+                               W83627HF_REG_TEMP3_CONFIG);
                        if (tmp & 0x01) {
                                dev_warn(&pdev->dev, "Enabling temp3, "
                                         "readings might not make sense\n");
                                w83627hf_write_value(data,
-                                       W83781D_REG_TEMP3_CONFIG, tmp & 0xfe);
+                                       W83627HF_REG_TEMP3_CONFIG, tmp & 0xfe);
                        }
                }
        }
@@ -1563,7 +1534,7 @@ static void w83627hf_update_fan_div(struct w83627hf_data *data)
 static struct w83627hf_data *w83627hf_update_device(struct device *dev)
 {
        struct w83627hf_data *data = dev_get_drvdata(dev);
-       int i;
+       int i, num_temps = (data->type == w83697hf) ? 2 : 3;
 
        mutex_lock(&data->update_lock);
 
@@ -1584,12 +1555,12 @@ static struct w83627hf_data *w83627hf_update_device(struct device *dev)
                            w83627hf_read_value(data,
                                               W83781D_REG_IN_MAX(i));
                }
-               for (i = 1; i <= 3; i++) {
-                       data->fan[i - 1] =
-                           w83627hf_read_value(data, W83781D_REG_FAN(i));
-                       data->fan_min[i - 1] =
+               for (i = 0; i <= 2; i++) {
+                       data->fan[i] =
+                           w83627hf_read_value(data, W83627HF_REG_FAN(i));
+                       data->fan_min[i] =
                            w83627hf_read_value(data,
-                                              W83781D_REG_FAN_MIN(i));
+                                              W83627HF_REG_FAN_MIN(i));
                }
                for (i = 0; i <= 2; i++) {
                        u8 tmp = w83627hf_read_value(data,
@@ -1616,25 +1587,13 @@ static struct w83627hf_data *w83627hf_update_device(struct device *dev)
                                        break;
                        }
                }
-
-               data->temp = w83627hf_read_value(data, W83781D_REG_TEMP(1));
-               data->temp_max =
-                   w83627hf_read_value(data, W83781D_REG_TEMP_OVER(1));
-               data->temp_max_hyst =
-                   w83627hf_read_value(data, W83781D_REG_TEMP_HYST(1));
-               data->temp_add[0] =
-                   w83627hf_read_value(data, W83781D_REG_TEMP(2));
-               data->temp_max_add[0] =
-                   w83627hf_read_value(data, W83781D_REG_TEMP_OVER(2));
-               data->temp_max_hyst_add[0] =
-                   w83627hf_read_value(data, W83781D_REG_TEMP_HYST(2));
-               if (data->type != w83697hf) {
-                       data->temp_add[1] =
-                         w83627hf_read_value(data, W83781D_REG_TEMP(3));
-                       data->temp_max_add[1] =
-                         w83627hf_read_value(data, W83781D_REG_TEMP_OVER(3));
-                       data->temp_max_hyst_add[1] =
-                         w83627hf_read_value(data, W83781D_REG_TEMP_HYST(3));
+               for (i = 0; i < num_temps; i++) {
+                       data->temp[i] = w83627hf_read_value(
+                                               data, w83627hf_reg_temp[i]);
+                       data->temp_max[i] = w83627hf_read_value(
+                                               data, w83627hf_reg_temp_over[i]);
+                       data->temp_max_hyst[i] = w83627hf_read_value(
+                                               data, w83627hf_reg_temp_hyst[i]);
                }
 
                w83627hf_update_fan_div(data);
index a6a1edfe76141e8a9fb5fb058a13014d90787ac9..e0fa7520400d8c565f0b7c77034a6c0e35cf4a1a 100644 (file)
@@ -1122,12 +1122,13 @@ w83781d_create_files(struct device *dev, int kind, int is_isa)
                                &sensor_dev_attr_temp3_beep.dev_attr)))
                        return err;
 
-               if (kind != w83781d)
+               if (kind != w83781d) {
                        err = sysfs_chmod_file(&dev->kobj,
                                &sensor_dev_attr_temp3_alarm.dev_attr.attr,
                                S_IRUGO | S_IWUSR);
                        if (err)
                                return err;
+               }
        }
 
        if (kind != w83781d && kind != as99127f) {
index 58e32714afb5b881068c9ca096d8ec271a448cd7..ca18e0be4901a52b2881c1f0e2b996bc2612abe3 100644 (file)
@@ -51,6 +51,7 @@ struct pasemi_smbus {
 #define MRXFIFO_DATA_M 0x000000ff
 
 #define SMSTA_XEN      0x08000000
+#define SMSTA_MTN      0x00200000
 
 #define CTL_MRR                0x00000400
 #define CTL_MTR                0x00000200
@@ -98,6 +99,10 @@ static unsigned int pasemi_smb_waitready(struct pasemi_smbus *smbus)
                status = reg_read(smbus, REG_SMSTA);
        }
 
+       /* Got NACK? */
+       if (status & SMSTA_MTN)
+               return -ENXIO;
+
        if (timeout < 0) {
                dev_warn(&smbus->dev->dev, "Timeout, status 0x%08x\n", status);
                reg_write(smbus, REG_SMSTA, status);
@@ -364,7 +369,7 @@ static int __devinit pasemi_smb_probe(struct pci_dev *dev,
        smbus->adapter.algo = &smbus_algorithm;
        smbus->adapter.algo_data = smbus;
 
-       /* set up the driverfs linkage to our parent device */
+       /* set up the sysfs linkage to our parent device */
        smbus->adapter.dev.parent = &dev->dev;
 
        reg_write(smbus, REG_CTL, (CTL_MTR | CTL_MRR |
index d3da1fb05b9bebe13d342f7d3a09fbbda585e58d..1a7eeebac506d63b05d8f1c96e98c29040bd5f41 100644 (file)
@@ -128,13 +128,20 @@ static ssize_t eeprom_read(struct kobject *kobj, struct bin_attribute *bin_attr,
        for (slice = off >> 5; slice <= (off + count - 1) >> 5; slice++)
                eeprom_update_client(client, slice);
 
-       /* Hide Vaio security settings to regular users (16 first bytes) */
-       if (data->nature == VAIO && off < 16 && !capable(CAP_SYS_ADMIN)) {
-               size_t in_row1 = 16 - off;
-               in_row1 = min(in_row1, count);
-               memset(buf, 0, in_row1);
-               if (count - in_row1 > 0)
-                       memcpy(buf + in_row1, &data->data[16], count - in_row1);
+       /* Hide Vaio private settings to regular users:
+          - BIOS passwords: bytes 0x00 to 0x0f
+          - UUID: bytes 0x10 to 0x1f
+          - Serial number: 0xc0 to 0xdf */
+       if (data->nature == VAIO && !capable(CAP_SYS_ADMIN)) {
+               int i;
+
+               for (i = 0; i < count; i++) {
+                       if ((off + i <= 0x1f) ||
+                           (off + i >= 0xc0 && off + i <= 0xdf))
+                               buf[i] = 0;
+                       else
+                               buf[i] = data->data[off + i];
+               }
        } else {
                memcpy(buf, &data->data[off], count);
        }
@@ -197,14 +204,18 @@ static int eeprom_detect(struct i2c_adapter *adapter, int address, int kind)
                goto exit_kfree;
 
        /* Detect the Vaio nature of EEPROMs.
-          We use the "PCG-" prefix as the signature. */
+          We use the "PCG-" or "VGN-" prefix as the signature. */
        if (address == 0x57) {
-               if (i2c_smbus_read_byte_data(new_client, 0x80) == 'P'
-                && i2c_smbus_read_byte(new_client) == 'C'
-                && i2c_smbus_read_byte(new_client) == 'G'
-                && i2c_smbus_read_byte(new_client) == '-') {
+               char name[4];
+
+               name[0] = i2c_smbus_read_byte_data(new_client, 0x80);
+               name[1] = i2c_smbus_read_byte(new_client);
+               name[2] = i2c_smbus_read_byte(new_client);
+               name[3] = i2c_smbus_read_byte(new_client);
+
+               if (!memcmp(name, "PCG-", 4) || !memcmp(name, "VGN-", 4)) {
                        dev_info(&new_client->dev, "Vaio EEPROM detected, "
-                               "enabling password protection\n");
+                                "enabling privacy protection\n");
                        data->nature = VAIO;
                }
        }
index 1a4e8dc03b365dfb2e5b99fd3e56d617bbe4b113..b5e13e405e72f8b3339f6701482ee336ae6ad2fe 100644 (file)
@@ -673,7 +673,7 @@ static int __i2c_check_addr(struct i2c_adapter *adapter, unsigned int addr)
        return 0;
 }
 
-int i2c_check_addr(struct i2c_adapter *adapter, int addr)
+static int i2c_check_addr(struct i2c_adapter *adapter, int addr)
 {
        int rval;
 
@@ -683,7 +683,6 @@ int i2c_check_addr(struct i2c_adapter *adapter, int addr)
 
        return rval;
 }
-EXPORT_SYMBOL(i2c_check_addr);
 
 int i2c_attach_client(struct i2c_client *client)
 {
index 5a15e50748de11076202b2c91bc8c0afc9974701..c21ae20ae362b059a2c347238f0e063616e0411e 100644 (file)
 
 static struct i2c_driver i2cdev_driver;
 
+/*
+ * An i2c_dev represents an i2c_adapter ... an I2C or SMBus master, not a
+ * slave (i2c_client) with which messages will be exchanged.  It's coupled
+ * with a character special file which is accessed by user mode drivers.
+ *
+ * The list of i2c_dev structures is parallel to the i2c_adapter lists
+ * maintained by the driver model, and is updated using notifications
+ * delivered to the i2cdev_driver.
+ */
 struct i2c_dev {
        struct list_head list;
        struct i2c_adapter *adap;
@@ -103,6 +112,25 @@ static ssize_t show_adapter_name(struct device *dev,
 }
 static DEVICE_ATTR(name, S_IRUGO, show_adapter_name, NULL);
 
+/* ------------------------------------------------------------------------- */
+
+/*
+ * After opening an instance of this character special file, a file
+ * descriptor starts out associated only with an i2c_adapter (and bus).
+ *
+ * Using the I2C_RDWR ioctl(), you can then *immediately* issue i2c_msg
+ * traffic to any devices on the bus used by that adapter.  That's because
+ * the i2c_msg vectors embed all the addressing information they need, and
+ * are submitted directly to an i2c_adapter.  However, SMBus-only adapters
+ * don't support that interface.
+ *
+ * To use read()/write() system calls on that file descriptor, or to use
+ * SMBus interfaces (and work with SMBus-only hosts!), you must first issue
+ * an I2C_SLAVE (or I2C_SLAVE_FORCE) ioctl.  That configures an anonymous
+ * (never registered) i2c_client so it holds the addressing information
+ * needed by those system calls and by this SMBus interface.
+ */
+
 static ssize_t i2cdev_read (struct file *file, char __user *buf, size_t count,
                             loff_t *offset)
 {
@@ -154,6 +182,29 @@ static ssize_t i2cdev_write (struct file *file, const char __user *buf, size_t c
        return ret;
 }
 
+/* This address checking function differs from the one in i2c-core
+   in that it considers an address with a registered device, but no
+   bounded driver, as NOT busy. */
+static int i2cdev_check_addr(struct i2c_adapter *adapter, unsigned int addr)
+{
+       struct list_head *item;
+       struct i2c_client *client;
+       int res = 0;
+
+       mutex_lock(&adapter->clist_lock);
+       list_for_each(item, &adapter->clients) {
+               client = list_entry(item, struct i2c_client, list);
+               if (client->addr == addr) {
+                       if (client->driver)
+                               res = -EBUSY;
+                       break;
+               }
+       }
+       mutex_unlock(&adapter->clist_lock);
+
+       return res;
+}
+
 static int i2cdev_ioctl(struct inode *inode, struct file *file,
                unsigned int cmd, unsigned long arg)
 {
@@ -172,11 +223,22 @@ static int i2cdev_ioctl(struct inode *inode, struct file *file,
        switch ( cmd ) {
        case I2C_SLAVE:
        case I2C_SLAVE_FORCE:
+               /* NOTE:  devices set up to work with "new style" drivers
+                * can't use I2C_SLAVE, even when the device node is not
+                * bound to a driver.  Only I2C_SLAVE_FORCE will work.
+                *
+                * Setting the PEC flag here won't affect kernel drivers,
+                * which will be using the i2c_client node registered with
+                * the driver model core.  Likewise, when that client has
+                * the PEC flag already set, the i2c-dev driver won't see
+                * (or use) this setting.
+                */
                if ((arg > 0x3ff) ||
                    (((client->flags & I2C_M_TEN) == 0) && arg > 0x7f))
                        return -EINVAL;
-               if ((cmd == I2C_SLAVE) && i2c_check_addr(client->adapter,arg))
+               if (cmd == I2C_SLAVE && i2cdev_check_addr(client->adapter, arg))
                        return -EBUSY;
+               /* REVISIT: address could become busy later */
                client->addr = arg;
                return 0;
        case I2C_TENBIT:
@@ -386,6 +448,13 @@ static int i2cdev_open(struct inode *inode, struct file *file)
        if (!adap)
                return -ENODEV;
 
+       /* This creates an anonymous i2c_client, which may later be
+        * pointed to some address using I2C_SLAVE or I2C_SLAVE_FORCE.
+        *
+        * This client is ** NEVER REGISTERED ** with the driver model
+        * or I2C core code!!  It just holds private copies of addressing
+        * information and maybe a PEC flag.
+        */
        client = kzalloc(sizeof(*client), GFP_KERNEL);
        if (!client) {
                i2c_put_adapter(adap);
@@ -394,7 +463,6 @@ static int i2cdev_open(struct inode *inode, struct file *file)
        snprintf(client->name, I2C_NAME_SIZE, "i2c-dev %d", adap->nr);
        client->driver = &i2cdev_driver;
 
-       /* registered with adapter, passed as client to user */
        client->adapter = adap;
        file->private_data = client;
 
@@ -422,6 +490,14 @@ static const struct file_operations i2cdev_fops = {
        .release        = i2cdev_release,
 };
 
+/* ------------------------------------------------------------------------- */
+
+/*
+ * The legacy "i2cdev_driver" is used primarily to get notifications when
+ * I2C adapters are added or removed, so that each one gets an i2c_dev
+ * and is thus made available to userspace driver code.
+ */
+
 static struct class *i2c_dev_class;
 
 static int i2cdev_attach_adapter(struct i2c_adapter *adap)
@@ -486,6 +562,12 @@ static struct i2c_driver i2cdev_driver = {
        .detach_client  = i2cdev_detach_client,
 };
 
+/* ------------------------------------------------------------------------- */
+
+/*
+ * module load/unload record keeping
+ */
+
 static int __init i2c_dev_init(void)
 {
        int res;
index 6eaece96524eac2c9e7d709559c4c99f4eb8a2a1..e445fe6e4ba9d7df6f39ff141f6b699c1481cf63 100644 (file)
@@ -152,9 +152,22 @@ config BLK_DEV_IDEDISK
          If unsure, say Y.
 
 config IDEDISK_MULTI_MODE
-       bool "Use multi-mode by default"
-       help
-         If you get this error, try to say Y here:
+       bool "Use multiple sector mode for Programmed Input/Output by default"
+       help
+         This setting is irrelevant for most IDE disks, with direct memory
+         access, to which multiple sector mode does not apply. Multiple sector
+         mode is a feature of most modern IDE hard drives, permitting the
+         transfer of multiple sectors per Programmed Input/Output interrupt,
+         rather than the usual one sector per interrupt. When this feature is
+         enabled, it can reduce operating system overhead for disk Programmed
+         Input/Output. On some systems, it also can increase the data
+         throughput of Programmed Input/Output. Some drives, however, seemed
+         to run slower with multiple sector mode enabled. Some drives claimed
+         to support multiple sector mode, but lost data at some settings.
+         Under rare circumstances, such failures could result in massive
+         filesystem corruption.
+
+         If you get the following error, try to say Y here:
 
          hda: set_multmode: status=0x51 { DriveReady SeekComplete Error }
          hda: set_multmode: error=0x04 { DriveStatusError }
@@ -190,10 +203,6 @@ config BLK_DEV_IDECD
          CD-ROM drive, you can say N to all other CD-ROM options, but be sure
          to say Y or M to "ISO 9660 CD-ROM file system support".
 
-         Note that older versions of LILO (LInux LOader) cannot properly deal
-         with IDE/ATAPI CD-ROMs, so install LILO 16 or higher, available from
-         <http://lilo.go.dyndns.org/>.
-
          To compile this driver as a module, choose M here: the
          module will be called ide-cd.
 
@@ -380,9 +389,10 @@ config IDEPCI_SHARE_IRQ
 config IDEPCI_PCIBUS_ORDER
        def_bool BLK_DEV_IDE=y && BLK_DEV_IDEPCI
 
+# TODO: split it on per host driver config options (or module parameters)
 config BLK_DEV_OFFBOARD
        bool "Boot off-board chipsets first support"
-       depends on BLK_DEV_IDEPCI
+       depends on BLK_DEV_IDEPCI && (BLK_DEV_AEC62XX || BLK_DEV_GENERIC || BLK_DEV_HPT34X || BLK_DEV_HPT366 || BLK_DEV_PDC202XX_NEW || BLK_DEV_PDC202XX_OLD || BLK_DEV_TC86C001)
        help
          Normally, IDE controllers built into the motherboard (on-board
          controllers) are assigned to ide0 and ide1 while those on add-in PCI
index 410a0d13e35e847ad8695a7e8585cbb3d322e72b..93f71fcfc04df46a571aa72e14726d36a3d81f58 100644 (file)
@@ -316,13 +316,13 @@ static int icside_dma_end(ide_drive_t *drive)
 
        drive->waiting_for_dma = 0;
 
-       disable_dma(state->dev->dma);
+       disable_dma(ECARD_DEV(state->dev)->dma);
 
        /* Teardown mappings after DMA has completed. */
        dma_unmap_sg(state->dev, hwif->sg_table, hwif->sg_nents,
                     hwif->sg_dma_direction);
 
-       return get_dma_residue(state->dev->dma) != 0;
+       return get_dma_residue(ECARD_DEV(state->dev)->dma) != 0;
 }
 
 static void icside_dma_start(ide_drive_t *drive)
@@ -331,8 +331,8 @@ static void icside_dma_start(ide_drive_t *drive)
        struct icside_state *state = hwif->hwif_data;
 
        /* We can not enable DMA on both channels simultaneously. */
-       BUG_ON(dma_channel_active(state->dev->dma));
-       enable_dma(state->dev->dma);
+       BUG_ON(dma_channel_active(ECARD_DEV(state->dev)->dma));
+       enable_dma(ECARD_DEV(state->dev)->dma);
 }
 
 static int icside_dma_setup(ide_drive_t *drive)
@@ -350,7 +350,7 @@ static int icside_dma_setup(ide_drive_t *drive)
        /*
         * We can not enable DMA on both channels.
         */
-       BUG_ON(dma_channel_active(state->dev->dma));
+       BUG_ON(dma_channel_active(ECARD_DEV(state->dev)->dma));
 
        icside_build_sglist(drive, rq);
 
@@ -367,14 +367,14 @@ static int icside_dma_setup(ide_drive_t *drive)
        /*
         * Select the correct timing for this drive.
         */
-       set_dma_speed(state->dev->dma, drive->drive_data);
+       set_dma_speed(ECARD_DEV(state->dev)->dma, drive->drive_data);
 
        /*
         * Tell the DMA engine about the SG table and
         * data direction.
         */
-       set_dma_sg(state->dev->dma, hwif->sg_table, hwif->sg_nents);
-       set_dma_mode(state->dev->dma, dma_mode);
+       set_dma_sg(ECARD_DEV(state->dev)->dma, hwif->sg_table, hwif->sg_nents);
+       set_dma_mode(ECARD_DEV(state->dev)->dma, dma_mode);
 
        drive->waiting_for_dma = 1;
 
index e196aefa2070c2f2c54e79498cfc1dcf5e19e419..7f5bc2ee6c7e554d631ea6c0c1e8f42cc3a66940 100644 (file)
@@ -748,8 +748,7 @@ static void cris_set_dma_mode(ide_drive_t *drive, const u8 speed)
                        hold = ATA_DMA2_HOLD;
                        break;
                default:
-                       BUG();
-                       break;
+                       return;
        }
 
        if (speed >= XFER_UDMA_0)
index 428f7a8a00b628715d86d7f9c27007db33952d3d..e3add70b9cd8b29f45156e4ad9b6d4ad2b4d8adc 100644 (file)
@@ -340,7 +340,7 @@ static int config_drive_for_dma (ide_drive_t *drive)
 
        if (drive->media != ide_disk) {
                if (hwif->host_flags & IDE_HFLAG_NO_ATAPI_DMA)
-                       return -1;
+                       return 0;
        }
 
        /*
@@ -752,7 +752,8 @@ u8 ide_find_dma_mode(ide_drive_t *drive, u8 req_mode)
                        mode = XFER_MW_DMA_1;
        }
 
-       printk(KERN_DEBUG "%s: selected mode 0x%x\n", drive->name, mode);
+       printk(KERN_DEBUG "%s: %s mode selected\n", drive->name,
+                         mode ? ide_xfer_verbose(mode) : "no DMA");
 
        return min(mode, req_mode);
 }
index c89f0d3058e934767bc1c2a3b8b7e2231b43a587..db22d1ff4e559ff1eb2652de98b23e5c6ae22267 100644 (file)
@@ -340,6 +340,8 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
                if (args) {
                        args[0] = stat;
                        args[1] = err;
+                       /* be sure we're looking at the low order bits */
+                       hwif->OUTB(drive->ctl & ~0x80, IDE_CONTROL_REG);
                        args[2] = hwif->INB(IDE_NSECTOR_REG);
                        args[3] = hwif->INB(IDE_SECTOR_REG);
                        args[4] = hwif->INB(IDE_LCYL_REG);
@@ -654,7 +656,8 @@ static ide_startstop_t drive_cmd_intr (ide_drive_t *drive)
        int retries = 10;
 
        local_irq_enable_in_hardirq();
-       if ((stat & DRQ_STAT) && args && args[3]) {
+       if (rq->cmd_type == REQ_TYPE_ATA_CMD &&
+           (stat & DRQ_STAT) && args && args[3]) {
                u8 io_32bit = drive->io_32bit;
                drive->io_32bit = 0;
                hwif->ata_input_data(drive, &args[4], args[3] * SECTOR_WORDS);
@@ -882,7 +885,6 @@ static ide_startstop_t execute_drive_cmd (ide_drive_t *drive,
                return do_rw_taskfile(drive, args);
        } else if (rq->cmd_type == REQ_TYPE_ATA_TASK) {
                u8 *args = rq->buffer;
-               u8 sel;
  
                if (!args)
                        goto done;
@@ -900,10 +902,7 @@ static ide_startstop_t execute_drive_cmd (ide_drive_t *drive,
                hwif->OUTB(args[3], IDE_SECTOR_REG);
                hwif->OUTB(args[4], IDE_LCYL_REG);
                hwif->OUTB(args[5], IDE_HCYL_REG);
-               sel = (args[6] & ~0x10);
-               if (drive->select.b.unit)
-                       sel |= 0x10;
-               hwif->OUTB(sel, IDE_SELECT_REG);
+               hwif->OUTB((args[6] & 0xEF)|drive->select.all, IDE_SELECT_REG);
                ide_cmd(drive, args[0], args[2], &drive_cmd_intr);
                return ide_started;
        } else if (rq->cmd_type == REQ_TYPE_ATA_CMD) {
index 95168833d0691a82c896197a7a4d01beae361479..e17a9ee120ead8182c24cdc8fca7b81a043ed288 100644 (file)
@@ -403,8 +403,12 @@ void ide_fix_driveid (struct hd_driveid *id)
 #endif
 }
 
-/* FIXME: exported for use by the USB storage (isd200.c) code only */
-EXPORT_SYMBOL(ide_fix_driveid);
+/*
+ * ide_fixstring() cleans up and (optionally) byte-swaps a text string,
+ * removing leading/trailing blanks and compressing internal blanks.
+ * It is primarily used to tidy up the model name/number fields as
+ * returned by the WIN_[P]IDENTIFY commands.
+ */
 
 void ide_fixstring (u8 *s, const int bytecount, const int byteswap)
 {
@@ -582,9 +586,12 @@ EXPORT_SYMBOL_GPL(ide_in_drive_list);
 /*
  * Early UDMA66 devices don't set bit14 to 1, only bit13 is valid.
  * We list them here and depend on the device side cable detection for them.
+ *
+ * Some optical devices with the buggy firmwares have the same problem.
  */
 static const struct drive_list_entry ivb_list[] = {
        { "QUANTUM FIREBALLlct10 05"    , "A03.0900"    },
+       { "TSSTcorp CDDVDW SH-S202J"    , "SB00"        },
        { NULL                          , NULL          }
 };
 
index af86433baede6c7011d2a24adf39af490bae6be2..1609b8604f567b8c976848e3a8e97f2861c27f2f 100644 (file)
@@ -514,6 +514,7 @@ static u8 ide_dump_ata_status(ide_drive_t *drive, const char *msg, u8 stat)
                        if (drive->addressing == 1) {
                                __u64 sectors = 0;
                                u32 low = 0, high = 0;
+                               hwif->OUTB(drive->ctl&~0x80, IDE_CONTROL_REG);
                                low = ide_read_24(drive);
                                hwif->OUTB(drive->ctl|0x80, IDE_CONTROL_REG);
                                high = ide_read_24(drive);
index 6a6f2e066b4679b7c1a2ff16704af8a67bbc7673..56fb0b84342959d9a51e116ff3b0686d47998251 100644 (file)
@@ -172,11 +172,12 @@ static inline void do_identify (ide_drive_t *drive, u8 cmd)
        ide_fixstring(id->fw_rev,    sizeof(id->fw_rev),    bswap);
        ide_fixstring(id->serial_no, sizeof(id->serial_no), bswap);
 
+       /* we depend on this a lot! */
+       id->model[sizeof(id->model)-1] = '\0';
+
        if (strstr(id->model, "E X A B Y T E N E S T"))
                goto err_misc;
 
-       /* we depend on this a lot! */
-       id->model[sizeof(id->model)-1] = '\0';
        printk("%s: %s, ", drive->name, id->model);
        drive->present = 1;
        drive->dead = 0;
index d066546f2831e8cab14800c4602f406e39c21302..2b60f1b0437e9aa790d446369ac285243bd6719f 100644 (file)
@@ -471,6 +471,7 @@ static int ide_diag_taskfile(ide_drive_t *drive, ide_task_t *args, unsigned long
        struct request rq;
 
        memset(&rq, 0, sizeof(rq));
+       rq.ref_count = 1;
        rq.cmd_type = REQ_TYPE_ATA_TASKFILE;
        rq.buffer = buf;
 
@@ -511,6 +512,7 @@ int ide_raw_taskfile (ide_drive_t *drive, ide_task_t *args, u8 *buf)
 
 EXPORT_SYMBOL(ide_raw_taskfile);
 
+#ifdef CONFIG_IDE_TASK_IOCTL
 int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
 {
        ide_task_request_t      *req_task;
@@ -660,6 +662,7 @@ abort:
 
        return err;
 }
+#endif
 
 int ide_wait_cmd (ide_drive_t *drive, u8 cmd, u8 nsect, u8 feature, u8 sectors, u8 *buf)
 {
index ea0143ef5fe5aee02df0e09442f790f5f68a6fcd..51fca441c2946c59e69b0b9638ab88dee7f808c5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * linux/drivers/ide/pci/cmd64x.c              Version 1.50    May 10, 2007
+ * linux/drivers/ide/pci/cmd64x.c              Version 1.51    Nov 8, 2007
  *
  * cmd64x.c: Enable interrupts at initialization time on Ultra/PCI machines.
  *           Due to massive hardware bugs, UltraDMA is only supported
@@ -339,7 +339,8 @@ static int cmd648_ide_dma_end (ide_drive_t *drive)
        u8  mrdmode             = inb(hwif->dma_master + 0x01);
 
        /* clear the interrupt bit */
-       outb(mrdmode | irq_mask, hwif->dma_master + 0x01);
+       outb((mrdmode & ~(MRDMODE_INTR_CH0 | MRDMODE_INTR_CH1)) | irq_mask,
+            hwif->dma_master + 0x01);
 
        return err;
 }
index 599408952bd4cbae54410f3de2e306eda9c101b4..547690395eee6e3b07bf0c597843ab3a1b0fc106 100644 (file)
@@ -117,8 +117,7 @@ static void cs5530_set_dma_mode(ide_drive_t *drive, const u8 mode)
                case XFER_MW_DMA_1:     timings = 0x00012121; break;
                case XFER_MW_DMA_2:     timings = 0x00002020; break;
                default:
-                       BUG();
-                       break;
+                       return;
        }
        basereg = CS5530_BASEREG(drive->hwif);
        reg = inl(basereg + 4);                 /* get drive0 config register */
index 3ef4fc10fe2cf596e463634d19c8fe01c842458b..1cd4e9cb0521d0532bc24c21c21506d348b3df9c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * linux/drivers/ide/pci/cy82c693.c            Version 0.41    Aug 27, 2007
+ * linux/drivers/ide/pci/cy82c693.c            Version 0.42    Oct 23, 2007
  *
  *  Copyright (C) 1998-2000 Andreas S. Krebs (akrebs@altavista.net), Maintainer
  *  Copyright (C) 1998-2002 Andre Hedrick <andre@linux-ide.org>, Integrator
@@ -436,10 +436,10 @@ static void __devinit init_hwif_cy82c693(ide_hwif_t *hwif)
        hwif->ide_dma_on = &cy82c693_ide_dma_on;
 }
 
-static __devinitdata ide_hwif_t *primary;
-
 static void __devinit init_iops_cy82c693(ide_hwif_t *hwif)
 {
+       static ide_hwif_t *primary;
+
        if (PCI_FUNC(hwif->pci_dev->devfn) == 1)
                primary = hwif;
        else {
index f44d70852c3cc9c18efcb4bae6b75ba3294f2762..06885697ed7b95c444fcd961b9f067ad7d02b1ee 100644 (file)
@@ -49,7 +49,7 @@ static int __init ide_generic_all_on(char *unused)
        printk(KERN_INFO "IDE generic will claim all unknown PCI IDE storage controllers.\n");
        return 1;
 }
-__setup("all-generic-ide", ide_generic_all_on);
+const __setup("all-generic-ide", ide_generic_all_on);
 #endif
 module_param_named(all_generic_ide, ide_generic_all, bool, 0444);
 MODULE_PARM_DESC(all_generic_ide, "IDE generic will claim all unknown PCI IDE storage controllers.");
index 612b795241bfc5bf5741de77b633c81e6b416563..5682895d36d997d556bc442a2399e4ccdb30ab70 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * linux/drivers/ide/pci/hpt366.c              Version 1.20    Oct 1, 2007
+ * linux/drivers/ide/pci/hpt366.c              Version 1.21    Oct 23, 2007
  *
  * Copyright (C) 1999-2003             Andre Hedrick <andre@linux-ide.org>
  * Portions Copyright (C) 2001         Sun Microsystems, Inc.
@@ -433,7 +433,7 @@ static u32 *hpt37x_settings[NUM_ATA_CLOCKS] = {
        sixty_six_base_hpt37x
 };
 
-static struct hpt_info hpt36x __devinitdata = {
+static const struct hpt_info hpt36x __devinitdata = {
        .chip_name      = "HPT36x",
        .chip_type      = HPT36x,
        .udma_mask      = HPT366_ALLOW_ATA66_3 ? (HPT366_ALLOW_ATA66_4 ? ATA_UDMA4 : ATA_UDMA3) : ATA_UDMA2,
@@ -441,7 +441,7 @@ static struct hpt_info hpt36x __devinitdata = {
        .settings       = hpt36x_settings
 };
 
-static struct hpt_info hpt370 __devinitdata = {
+static const struct hpt_info hpt370 __devinitdata = {
        .chip_name      = "HPT370",
        .chip_type      = HPT370,
        .udma_mask      = HPT370_ALLOW_ATA100_5 ? ATA_UDMA5 : ATA_UDMA4,
@@ -449,7 +449,7 @@ static struct hpt_info hpt370 __devinitdata = {
        .settings       = hpt37x_settings
 };
 
-static struct hpt_info hpt370a __devinitdata = {
+static const struct hpt_info hpt370a __devinitdata = {
        .chip_name      = "HPT370A",
        .chip_type      = HPT370A,
        .udma_mask      = HPT370_ALLOW_ATA100_5 ? ATA_UDMA5 : ATA_UDMA4,
@@ -457,7 +457,7 @@ static struct hpt_info hpt370a __devinitdata = {
        .settings       = hpt37x_settings
 };
 
-static struct hpt_info hpt374 __devinitdata = {
+static const struct hpt_info hpt374 __devinitdata = {
        .chip_name      = "HPT374",
        .chip_type      = HPT374,
        .udma_mask      = ATA_UDMA5,
@@ -465,7 +465,7 @@ static struct hpt_info hpt374 __devinitdata = {
        .settings       = hpt37x_settings
 };
 
-static struct hpt_info hpt372 __devinitdata = {
+static const struct hpt_info hpt372 __devinitdata = {
        .chip_name      = "HPT372",
        .chip_type      = HPT372,
        .udma_mask      = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
@@ -473,7 +473,7 @@ static struct hpt_info hpt372 __devinitdata = {
        .settings       = hpt37x_settings
 };
 
-static struct hpt_info hpt372a __devinitdata = {
+static const struct hpt_info hpt372a __devinitdata = {
        .chip_name      = "HPT372A",
        .chip_type      = HPT372A,
        .udma_mask      = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
@@ -481,7 +481,7 @@ static struct hpt_info hpt372a __devinitdata = {
        .settings       = hpt37x_settings
 };
 
-static struct hpt_info hpt302 __devinitdata = {
+static const struct hpt_info hpt302 __devinitdata = {
        .chip_name      = "HPT302",
        .chip_type      = HPT302,
        .udma_mask      = HPT302_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
@@ -489,7 +489,7 @@ static struct hpt_info hpt302 __devinitdata = {
        .settings       = hpt37x_settings
 };
 
-static struct hpt_info hpt371 __devinitdata = {
+static const struct hpt_info hpt371 __devinitdata = {
        .chip_name      = "HPT371",
        .chip_type      = HPT371,
        .udma_mask      = HPT371_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
@@ -497,7 +497,7 @@ static struct hpt_info hpt371 __devinitdata = {
        .settings       = hpt37x_settings
 };
 
-static struct hpt_info hpt372n __devinitdata = {
+static const struct hpt_info hpt372n __devinitdata = {
        .chip_name      = "HPT372N",
        .chip_type      = HPT372N,
        .udma_mask      = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
@@ -505,7 +505,7 @@ static struct hpt_info hpt372n __devinitdata = {
        .settings       = hpt37x_settings
 };
 
-static struct hpt_info hpt302n __devinitdata = {
+static const struct hpt_info hpt302n __devinitdata = {
        .chip_name      = "HPT302N",
        .chip_type      = HPT302N,
        .udma_mask      = HPT302_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
@@ -513,7 +513,7 @@ static struct hpt_info hpt302n __devinitdata = {
        .settings       = hpt37x_settings
 };
 
-static struct hpt_info hpt371n __devinitdata = {
+static const struct hpt_info hpt371n __devinitdata = {
        .chip_name      = "HPT371N",
        .chip_type      = HPT371N,
        .udma_mask      = HPT371_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
@@ -1508,7 +1508,7 @@ static const struct ide_port_info hpt366_chipsets[] __devinitdata = {
  */
 static int __devinit hpt366_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
-       struct hpt_info *info = NULL;
+       const struct hpt_info *info = NULL;
        struct pci_dev *dev2 = NULL;
        struct ide_port_info d;
        u8 idx = id->driver_data;
@@ -1522,7 +1522,7 @@ static int __devinit hpt366_init_one(struct pci_dev *dev, const struct pci_devic
                if (rev < 3)
                        info = &hpt36x;
                else {
-                       static struct hpt_info *hpt37x_info[] =
+                       static const struct hpt_info *hpt37x_info[] =
                                { &hpt370, &hpt370a, &hpt372, &hpt372n };
 
                        info = hpt37x_info[min_t(u8, rev, 6) - 3];
@@ -1552,7 +1552,7 @@ static int __devinit hpt366_init_one(struct pci_dev *dev, const struct pci_devic
        d.name = info->chip_name;
        d.udma_mask = info->udma_mask;
 
-       pci_set_drvdata(dev, info);
+       pci_set_drvdata(dev, (void *)info);
 
        if (info == &hpt36x || info == &hpt374)
                dev2 = pci_get_slot(dev->bus, dev->devfn + 1);
@@ -1560,7 +1560,7 @@ static int __devinit hpt366_init_one(struct pci_dev *dev, const struct pci_devic
        if (dev2) {
                int ret;
 
-               pci_set_drvdata(dev2, info);
+               pci_set_drvdata(dev2, (void *)info);
 
                if (info == &hpt374)
                        hpt374_init(dev, dev2);
index 5c99754353194478890a3ae073bddcdd509e07f5..99b7d763b6c7a445445e14e038716bbb3d8e9d57 100644 (file)
@@ -653,8 +653,7 @@ static const struct ide_port_info it821x_chipsets[] __devinitdata = {
 
 static int __devinit it821x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
-       ide_setup_pci_device(dev, &it821x_chipsets[id->driver_data]);
-       return 0;
+       return ide_setup_pci_device(dev, &it821x_chipsets[id->driver_data]);
 }
 
 static const struct pci_device_id it821x_pci_tbl[] = {
index bdf64d99770805313647814c848cedc5d43ff600..0083eaf89c773ca61760b4a180d870e77f9fa8e4 100644 (file)
@@ -139,8 +139,7 @@ static const struct ide_port_info jmicron_chipset __devinitdata = {
 
 static int __devinit jmicron_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
-       ide_setup_pci_device(dev, &jmicron_chipset);
-       return 0;
+       return ide_setup_pci_device(dev, &jmicron_chipset);
 }
 
 /* All JMB PATA controllers have and will continue to have the same
index 9329d4a810e50fe4a25b45c5f9b6e8b26640e6c6..63625a0be71298b114b276a38125e3fba51b7863 100644 (file)
@@ -302,6 +302,7 @@ struct ich_laptop {
 
 static const struct ich_laptop ich_laptop[] = {
        /* devid, subvendor, subdev */
+       { 0x27DF, 0x1025, 0x0102 },     /* ICH7 on Acer 5602aWLMi */
        { 0x27DF, 0x0005, 0x0280 },     /* ICH7 on Acer 5602WLMi */
        { 0x27DF, 0x1025, 0x0110 },     /* ICH7 on Acer 3682WLMi */
        { 0x27DF, 0x1043, 0x1267 },     /* ICH7 on Asus W5F */
index d2c8b5524f283df712581463e0c80a59b99fa0dc..707d5ff66b0300941429177d1beed7a26905e229 100644 (file)
@@ -186,8 +186,7 @@ static void sc1200_set_dma_mode(ide_drive_t *drive, const u8 mode)
                        }
                        break;
                default:
-                       BUG();
-                       break;
+                       return;
        }
 
        if (unit == 0) {                        /* are we configuring drive0? */
@@ -324,17 +323,18 @@ static int sc1200_suspend (struct pci_dev *dev, pm_message_t state)
 
        pci_disable_device(dev);
        pci_set_power_state(dev, pci_choose_state(dev, state));
-       dev->current_state = state.event;
        return 0;
 }
 
 static int sc1200_resume (struct pci_dev *dev)
 {
        ide_hwif_t      *hwif = NULL;
+       int             i;
+
+       i = pci_enable_device(dev);
+       if (i)
+               return i;
 
-       pci_set_power_state(dev, PCI_D0);       // bring chip back from sleep state
-       dev->current_state = PM_EVENT_ON;
-       pci_enable_device(dev);
        //
        // loop over all interfaces that are part of this pci device:
        //
index 6b7bb53acefdc68d1928bd0bd85eb3d0c3e4a5c3..f6e2ab3dd1664d2003986906226a384b5379a5fb 100644 (file)
@@ -356,7 +356,6 @@ static void sis_set_dma_mode(ide_drive_t *drive, const u8 speed)
                        sis_program_timings(drive, speed);
                        break;
                default:
-                       BUG();
                        break;
        }
 }
index 816b5311dad647febb4577991f53102c4e537d1b..5afdfef7264c512bc4594f8e1f21da3581bc42b4 100644 (file)
@@ -1138,6 +1138,7 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
        hwif->drives[0].autotune = IDE_TUNE_AUTO;
        hwif->drives[1].autotune = IDE_TUNE_AUTO;
        hwif->host_flags = IDE_HFLAG_SET_PIO_MODE_KEEP_DMA |
+                          IDE_HFLAG_PIO_NO_DOWNGRADE |
                           IDE_HFLAG_POST_SET_MODE;
        hwif->pio_mask = ATA_PIO4;
        hwif->set_pio_mode = pmac_ide_set_pio_mode;
index 02d14bf85ab2112b11a589e8fad9c73d428686bb..25fd090532206197212576093088ebbcbeced62b 100644 (file)
@@ -7,11 +7,6 @@
  *  May be copied or modified under the terms of the GNU General Public License
  */
 
-/*
- *  This module provides support for automatic detection and
- *  configuration of all PCI IDE interfaces present in a system.  
- */
-
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index f5f4983dfbf3db5cc85fc77522ddc510e6839504..7c4eb39b70241ef55f2bcc6ff4e7330acdc03938 100644 (file)
@@ -103,8 +103,7 @@ int dma_region_alloc(struct dma_region *dma, unsigned long n_bytes,
                goto err;
        }
 
-       /* just to be safe - this will become unnecessary once sglist->address goes away */
-       memset(dma->sglist, 0, dma->n_pages * sizeof(*dma->sglist));
+       sg_init_table(dma->sglist, dma->n_pages);
 
        /* fill scatter/gather list with pages */
        for (i = 0; i < dma->n_pages; i++) {
index c39c70a8aa9fce1e8eae54cdd0df6ab3a0c4a1e5..677989320951fc394229b74a69b65ef2317eb7c4 100644 (file)
@@ -235,7 +235,6 @@ int hpsb_packet_success(struct hpsb_packet *packet)
                                 packet->node_id);
                        return -EAGAIN;
                }
-               BUG();
 
        case ACK_BUSY_X:
        case ACK_BUSY_A:
@@ -282,7 +281,6 @@ int hpsb_packet_success(struct hpsb_packet *packet)
                         packet->ack_code, packet->node_id, packet->tcode);
                return -EAGAIN;
        }
-       BUG();
 }
 
 struct hpsb_packet *hpsb_make_readpacket(struct hpsb_host *host, nodeid_t node,
index d5dfe11aa5c6ded52e40b6c65c353c22db827b39..b83d254bc86edec605f1f78ba510a59566f2baef 100644 (file)
 #include <linux/types.h>
 #include <linux/wait.h>
 #include <linux/workqueue.h>
+#include <linux/scatterlist.h>
 
 #include <asm/byteorder.h>
 #include <asm/errno.h>
 #include <asm/param.h>
-#include <asm/scatterlist.h>
 #include <asm/system.h>
 #include <asm/types.h>
 
index d7f64525469b5769d23621c22f4842a7b49387a9..e8d5f6b6499823893a38c263dd8428a214813d59 100644 (file)
@@ -291,10 +291,10 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd             *pd,
        atomic_set(&pool->flush_ser, 0);
        init_waitqueue_head(&pool->force_wait);
 
-       pool->thread = kthread_create(ib_fmr_cleanup_thread,
-                                     pool,
-                                     "ib_fmr(%s)",
-                                     device->name);
+       pool->thread = kthread_run(ib_fmr_cleanup_thread,
+                                  pool,
+                                  "ib_fmr(%s)",
+                                  device->name);
        if (IS_ERR(pool->thread)) {
                printk(KERN_WARNING PFX "couldn't start cleanup thread\n");
                ret = PTR_ERR(pool->thread);
index f0c777589374cccf1af919534805675246e05f2c..b5436ca92e68cdb8d09063861ecd7af6bb89eeb5 100644 (file)
@@ -1000,6 +1000,7 @@ static int iwch_query_device(struct ib_device *ibdev,
        props->max_sge = dev->attr.max_sge_per_wr;
        props->max_sge_rd = 1;
        props->max_qp_rd_atom = dev->attr.max_rdma_reads_per_qp;
+       props->max_qp_init_rd_atom = dev->attr.max_rdma_reads_per_qp;
        props->max_cq = dev->attr.max_cqs;
        props->max_cqe = dev->attr.max_cqes_per_cq;
        props->max_mr = dev->attr.max_mem_regs;
index 97d108634c5830c27012869d494be6656f92c23d..453eb995c1d47b59255e46d4fcad70147d83c9e5 100644 (file)
 
 static struct kmem_cache *av_cache;
 
+int ehca_calc_ipd(struct ehca_shca *shca, int port,
+                 enum ib_rate path_rate, u32 *ipd)
+{
+       int path = ib_rate_to_mult(path_rate);
+       int link, ret;
+       struct ib_port_attr pa;
+
+       if (path_rate == IB_RATE_PORT_CURRENT) {
+               *ipd = 0;
+               return 0;
+       }
+
+       if (unlikely(path < 0)) {
+               ehca_err(&shca->ib_device, "Invalid static rate! path_rate=%x",
+                        path_rate);
+               return -EINVAL;
+       }
+
+       ret = ehca_query_port(&shca->ib_device, port, &pa);
+       if (unlikely(ret < 0)) {
+               ehca_err(&shca->ib_device, "Failed to query port  ret=%i", ret);
+               return ret;
+       }
+
+       link = ib_width_enum_to_int(pa.active_width) * pa.active_speed;
+
+       /* IPD = round((link / path) - 1) */
+       *ipd = ((link + (path >> 1)) / path) - 1;
+
+       return 0;
+}
+
 struct ib_ah *ehca_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr)
 {
        int ret;
@@ -69,15 +101,13 @@ struct ib_ah *ehca_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr)
        av->av.slid_path_bits = ah_attr->src_path_bits;
 
        if (ehca_static_rate < 0) {
-               int ah_mult = ib_rate_to_mult(ah_attr->static_rate);
-               int ehca_mult =
-                       ib_rate_to_mult(shca->sport[ah_attr->port_num].rate );
-
-               if (ah_mult >= ehca_mult)
-                       av->av.ipd = 0;
-               else
-                       av->av.ipd = (ah_mult > 0) ?
-                               ((ehca_mult - 1) / ah_mult) : 0;
+               u32 ipd;
+               if (ehca_calc_ipd(shca, ah_attr->port_num,
+                                 ah_attr->static_rate, &ipd)) {
+                       ret = -EINVAL;
+                       goto create_ah_exit1;
+               }
+               av->av.ipd = ipd;
        } else
                av->av.ipd = ehca_static_rate;
 
index 2d660ae189e544b54b3895cc4f0fc2f7d58312ea..87f12d4312a70be74fd5d68196793ec869cdf033 100644 (file)
@@ -95,7 +95,6 @@ struct ehca_sma_attr {
 struct ehca_sport {
        struct ib_cq *ibcq_aqp1;
        struct ib_qp *ibqp_aqp1;
-       enum ib_rate  rate;
        enum ib_port_state port_state;
        struct ehca_sma_attr saved_attr;
 };
index 15806d1404612d1b34c849080ef4fb2d26627b94..5bd7b591987ed3c77b545197714858a62a470108 100644 (file)
@@ -151,7 +151,6 @@ int ehca_query_port(struct ib_device *ibdev,
        }
 
        memset(props, 0, sizeof(struct ib_port_attr));
-       props->state = rblock->state;
 
        switch (rblock->max_mtu) {
        case 0x1:
@@ -188,11 +187,20 @@ int ehca_query_port(struct ib_device *ibdev,
        props->subnet_timeout  = rblock->subnet_timeout;
        props->init_type_reply = rblock->init_type_reply;
 
-       props->active_width    = IB_WIDTH_12X;
-       props->active_speed    = 0x1;
-
-       /* at the moment (logical) link state is always LINK_UP */
-       props->phys_state      = 0x5;
+       if (rblock->state && rblock->phys_width) {
+               props->phys_state      = rblock->phys_pstate;
+               props->state           = rblock->phys_state;
+               props->active_width    = rblock->phys_width;
+               props->active_speed    = rblock->phys_speed;
+       } else {
+               /* old firmware releases don't report physical
+                * port info, so use default values
+                */
+               props->phys_state      = 5;
+               props->state           = rblock->state;
+               props->active_width    = IB_WIDTH_12X;
+               props->active_speed    = 0x1;
+       }
 
 query_port1:
        ehca_free_fw_ctrlblock(rblock);
index dce503bb7d6b471315ed6d3a55190cfda2273193..5485799cdc8d633360b0174c350a42fa16956f0b 100644 (file)
@@ -189,6 +189,9 @@ int ehca_mmap(struct ib_ucontext *context, struct vm_area_struct *vma);
 
 void ehca_poll_eqs(unsigned long data);
 
+int ehca_calc_ipd(struct ehca_shca *shca, int port,
+                 enum ib_rate path_rate, u32 *ipd);
+
 #ifdef CONFIG_PPC_64K_PAGES
 void *ehca_alloc_fw_ctrlblock(gfp_t flags);
 void ehca_free_fw_ctrlblock(void *ptr);
index c6cd38c5321fb2a11c553bd7754a9dad88b58a44..90d4334179bf2e5466a108c184af10e6d9ecd59b 100644 (file)
@@ -327,9 +327,6 @@ static int ehca_sense_attributes(struct ehca_shca *shca)
                shca->hw_level = ehca_hw_level;
        ehca_gen_dbg(" ... hardware level=%x", shca->hw_level);
 
-       shca->sport[0].rate = IB_RATE_30_GBPS;
-       shca->sport[1].rate = IB_RATE_30_GBPS;
-
        shca->hca_cap = rblock->hca_cap_indicators;
        ehca_gen_dbg(" ... HCA capabilities:");
        for (i = 0; i < ARRAY_SIZE(hca_cap_descr); i++)
index de182648b2823404ebfc6188f1a68508e9972c00..2e3e6547cb784318859da7efa40059a689a0e266 100644 (file)
@@ -1196,10 +1196,6 @@ static int internal_modify_qp(struct ib_qp *ibqp,
                update_mask |= EHCA_BMASK_SET(MQPCB_MASK_QKEY, 1);
        }
        if (attr_mask & IB_QP_AV) {
-               int ah_mult = ib_rate_to_mult(attr->ah_attr.static_rate);
-               int ehca_mult = ib_rate_to_mult(shca->sport[my_qp->
-                                               init_attr.port_num].rate);
-
                mqpcb->dlid = attr->ah_attr.dlid;
                update_mask |= EHCA_BMASK_SET(MQPCB_MASK_DLID, 1);
                mqpcb->source_path_bits = attr->ah_attr.src_path_bits;
@@ -1207,11 +1203,12 @@ static int internal_modify_qp(struct ib_qp *ibqp,
                mqpcb->service_level = attr->ah_attr.sl;
                update_mask |= EHCA_BMASK_SET(MQPCB_MASK_SERVICE_LEVEL, 1);
 
-               if (ah_mult < ehca_mult)
-                       mqpcb->max_static_rate = (ah_mult > 0) ?
-                       ((ehca_mult - 1) / ah_mult) : 0;
-               else
-                       mqpcb->max_static_rate = 0;
+               if (ehca_calc_ipd(shca, my_qp->init_attr.port_num,
+                                 attr->ah_attr.static_rate,
+                                 &mqpcb->max_static_rate)) {
+                       ret = -EINVAL;
+                       goto modify_qp_exit2;
+               }
                update_mask |= EHCA_BMASK_SET(MQPCB_MASK_MAX_STATIC_RATE, 1);
 
                /*
@@ -1280,10 +1277,6 @@ static int internal_modify_qp(struct ib_qp *ibqp,
                        (MQPCB_MASK_RDMA_ATOMIC_OUTST_DEST_QP, 1);
        }
        if (attr_mask & IB_QP_ALT_PATH) {
-               int ah_mult = ib_rate_to_mult(attr->alt_ah_attr.static_rate);
-               int ehca_mult = ib_rate_to_mult(
-                       shca->sport[my_qp->init_attr.port_num].rate);
-
                if (attr->alt_port_num < 1
                    || attr->alt_port_num > shca->num_ports) {
                        ret = -EINVAL;
@@ -1309,10 +1302,12 @@ static int internal_modify_qp(struct ib_qp *ibqp,
                mqpcb->source_path_bits_al = attr->alt_ah_attr.src_path_bits;
                mqpcb->service_level_al = attr->alt_ah_attr.sl;
 
-               if (ah_mult > 0 && ah_mult < ehca_mult)
-                       mqpcb->max_static_rate_al = (ehca_mult - 1) / ah_mult;
-               else
-                       mqpcb->max_static_rate_al = 0;
+               if (ehca_calc_ipd(shca, my_qp->init_attr.port_num,
+                                 attr->alt_ah_attr.static_rate,
+                                 &mqpcb->max_static_rate_al)) {
+                       ret = -EINVAL;
+                       goto modify_qp_exit2;
+               }
 
                /* OpenIB doesn't support alternate retry counts - copy them */
                mqpcb->retry_count_al = mqpcb->retry_count;
index d9739e554515eb7796803f55b88e82bf80572925..485b8400359e756898f864f767695e3292affe35 100644 (file)
@@ -402,7 +402,11 @@ struct hipz_query_port {
        u64 max_msg_sz;
        u32 max_mtu;
        u32 vl_cap;
-       u8  reserved2[1900];
+       u32 phys_pstate;
+       u32 phys_state;
+       u32 phys_speed;
+       u32 phys_width;
+       u8  reserved2[1884];
        u64 guid_entries[255];
 } __attribute__ ((packed));
 
index 645ed71fd7972f58a73980f8910798423a2b291c..08d8ae148cd030ca99896d885e4d7a38af8804fd 100644 (file)
@@ -404,7 +404,7 @@ int ipath_resize_cq(struct ib_cq *ibcq, int cqe, struct ib_udata *udata)
 
                ret = ib_copy_to_udata(udata, &offset, sizeof(offset));
                if (ret)
-                       goto bail;
+                       goto bail_free;
        }
 
        spin_lock_irq(&cq->lock);
@@ -424,10 +424,8 @@ int ipath_resize_cq(struct ib_cq *ibcq, int cqe, struct ib_udata *udata)
        else
                n = head - tail;
        if (unlikely((u32)cqe < n)) {
-               spin_unlock_irq(&cq->lock);
-               vfree(wc);
                ret = -EOVERFLOW;
-               goto bail;
+               goto bail_unlock;
        }
        for (n = 0; tail != head; n++) {
                if (cq->ip)
@@ -459,7 +457,12 @@ int ipath_resize_cq(struct ib_cq *ibcq, int cqe, struct ib_udata *udata)
        }
 
        ret = 0;
+       goto bail;
 
+bail_unlock:
+       spin_unlock_irq(&cq->lock);
+bail_free:
+       vfree(wc);
 bail:
        return ret;
 }
index bcfa3ccb555f988cfba9e719602f130767356001..e7c25dbbcdc9ba77f5018ce06fe52b3cb6b84b73 100644 (file)
@@ -538,7 +538,15 @@ static u8 flash_csum(struct ipath_flash *ifp, int adjust)
        u8 *ip = (u8 *) ifp;
        u8 csum = 0, len;
 
-       for (len = 0; len < ifp->if_length; len++)
+       /*
+        * Limit length checksummed to max length of actual data.
+        * Checksum of erased eeprom will still be bad, but we avoid
+        * reading past the end of the buffer we were passed.
+        */
+       len = ifp->if_length;
+       if (len > sizeof(struct ipath_flash))
+               len = sizeof(struct ipath_flash);
+       while (len--)
                csum += *ip++;
        csum -= ifp->if_csum;
        csum = ~csum;
index 6a5dd5cd773d13cead689c6ffc16a702af4045e4..c61f9da2964ab25a51bb686808ffaa3c4ceb1e33 100644 (file)
@@ -453,7 +453,7 @@ skip_ibchange:
 }
 
 static void handle_supp_msgs(struct ipath_devdata *dd,
-                            unsigned supp_msgs, char msg[512])
+                            unsigned supp_msgs, char *msg, int msgsz)
 {
        /*
         * Print the message unless it's ibc status change only, which
@@ -461,9 +461,9 @@ static void handle_supp_msgs(struct ipath_devdata *dd,
         */
        if (dd->ipath_lasterror & ~INFINIPATH_E_IBSTATUSCHANGED) {
                int iserr;
-               iserr = ipath_decode_err(msg, sizeof msg,
-                               dd->ipath_lasterror &
-                               ~INFINIPATH_E_IBSTATUSCHANGED);
+               iserr = ipath_decode_err(msg, msgsz,
+                                        dd->ipath_lasterror &
+                                        ~INFINIPATH_E_IBSTATUSCHANGED);
                if (dd->ipath_lasterror &
                        ~(INFINIPATH_E_RRCVEGRFULL |
                        INFINIPATH_E_RRCVHDRFULL | INFINIPATH_E_PKTERRS))
@@ -492,8 +492,8 @@ static void handle_supp_msgs(struct ipath_devdata *dd,
 }
 
 static unsigned handle_frequent_errors(struct ipath_devdata *dd,
-                                      ipath_err_t errs, char msg[512],
-                                      int *noprint)
+                                      ipath_err_t errs, char *msg,
+                                      int msgsz, int *noprint)
 {
        unsigned long nc;
        static unsigned long nextmsg_time;
@@ -512,7 +512,7 @@ static unsigned handle_frequent_errors(struct ipath_devdata *dd,
                                nextmsg_time = nc + HZ * 3;
                }
                else if (supp_msgs) {
-                       handle_supp_msgs(dd, supp_msgs, msg);
+                       handle_supp_msgs(dd, supp_msgs, msg, msgsz);
                        supp_msgs = 0;
                        nmsgs = 0;
                }
@@ -525,14 +525,14 @@ static unsigned handle_frequent_errors(struct ipath_devdata *dd,
 
 static int handle_errors(struct ipath_devdata *dd, ipath_err_t errs)
 {
-       char msg[512];
+       char msg[128];
        u64 ignore_this_time = 0;
        int i, iserr = 0;
        int chkerrpkts = 0, noprint = 0;
        unsigned supp_msgs;
        int log_idx;
 
-       supp_msgs = handle_frequent_errors(dd, errs, msg, &noprint);
+       supp_msgs = handle_frequent_errors(dd, errs, msg, sizeof msg, &noprint);
 
        /* don't report errors that are masked */
        errs &= ~dd->ipath_maskederrs;
index 5c29b2bfea17b7c6236181f214b4224fbf4cb60d..120a61b03bc4846de8423c436767806e563e97d6 100644 (file)
@@ -959,8 +959,9 @@ static int do_rc_ack(struct ipath_qp *qp, u32 aeth, u32 psn, int opcode,
                /* If this is a partial ACK, reset the retransmit timer. */
                if (qp->s_last != qp->s_tail) {
                        spin_lock(&dev->pending_lock);
-                       list_add_tail(&qp->timerwait,
-                                     &dev->pending[dev->pending_index]);
+                       if (list_empty(&qp->timerwait))
+                               list_add_tail(&qp->timerwait,
+                                       &dev->pending[dev->pending_index]);
                        spin_unlock(&dev->pending_lock);
                        /*
                         * If we get a partial ACK for a resent operation,
index 4b6b7ee8e5c14f4dda64e3ae0fb05e784b07136e..54c61a972de24153ad7940ba93f080d190765646 100644 (file)
@@ -630,11 +630,8 @@ bail:;
 void ipath_send_complete(struct ipath_qp *qp, struct ipath_swqe *wqe,
                         enum ib_wc_status status)
 {
-       u32 last = qp->s_last;
-
-       if (++last == qp->s_size)
-               last = 0;
-       qp->s_last = last;
+       unsigned long flags;
+       u32 last;
 
        /* See ch. 11.2.4.1 and 10.7.3.1 */
        if (!(qp->s_flags & IPATH_S_SIGNAL_REQ_WR) ||
@@ -658,4 +655,11 @@ void ipath_send_complete(struct ipath_qp *qp, struct ipath_swqe *wqe,
                wc.port_num = 0;
                ipath_cq_enter(to_icq(qp->ibqp.send_cq), &wc, 0);
        }
+
+       spin_lock_irqsave(&qp->s_lock, flags);
+       last = qp->s_last;
+       if (++last >= qp->s_size)
+               last = 0;
+       qp->s_last = last;
+       spin_unlock_irqrestore(&qp->s_lock, flags);
 }
index 6b3322486b5e2e66a0e2de0db16914f185f6f298..8cba9c532e6425b38a8554384d144bb06c32c8fa 100644 (file)
@@ -1282,7 +1282,7 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
        int size;
        int i;
 
-       spin_lock_irqsave(&qp->rq.lock, flags);
+       spin_lock_irqsave(&qp->sq.lock, flags);
 
        ind = qp->sq.head;
 
@@ -1448,7 +1448,7 @@ out:
                               (qp->sq.wqe_cnt - 1));
        }
 
-       spin_unlock_irqrestore(&qp->rq.lock, flags);
+       spin_unlock_irqrestore(&qp->sq.lock, flags);
 
        return err;
 }
index 87610772a97944448ee2965e0ae5b9a5f787abb7..059cf92b60a5a540b9754edfafad93134a8958bc 100644 (file)
@@ -60,7 +60,7 @@ static struct ib_qp_attr ipoib_cm_err_attr = {
        .qp_state = IB_QPS_ERR
 };
 
-#define IPOIB_CM_RX_DRAIN_WRID 0x7fffffff
+#define IPOIB_CM_RX_DRAIN_WRID 0xffffffff
 
 static struct ib_send_wr ipoib_cm_rx_drain_wr = {
        .wr_id = IPOIB_CM_RX_DRAIN_WRID,
index 4941a9e61e902967a410404f0b67171bdbdb51d5..43aaa5cebd1224f8a39dcac296546c49f73597f2 100644 (file)
@@ -24,7 +24,7 @@ MODULE_DESCRIPTION("PC Speaker beeper driver");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("platform:pcspkr");
 
-#ifdef CONFIG_X86
+#if defined(CONFIG_MIPS) || defined(CONFIG_X86)
 /* Use the global PIT lock ! */
 #include <asm/i8253.h>
 #else
index 5ce632ca6815e34c6cf2ce0416f63c8ec9817608..b88569e21d60e017625a073e44c765601d8e1017 100644 (file)
@@ -21,7 +21,7 @@ if SERIO
 config SERIO_I8042
        tristate "i8042 PC Keyboard controller" if EMBEDDED || !X86
        default y
-       depends on !PARISC && (!ARM || ARCH_SHARK || FOOTBRIDGE_HOST) && !M68K && !BFIN
+       depends on !PARISC && (!ARM || ARCH_SHARK || FOOTBRIDGE_HOST) && !M68K && !BLACKFIN
        ---help---
          i8042 is the chip over which the standard AT keyboard and PS/2
          mouse are connected to the computer. If you use these devices,
index 476012b6dfac331d11a7728f714ab4f04c831554..48c1775ef5b3de68404f90649b3ea9ede2d30d8a 100644 (file)
@@ -1843,6 +1843,7 @@ static int if_sendbuf(int id, int channel, int doack, struct sk_buff *skb)
        int msglen;
        u16 errcode;
        u16 datahandle;
+       u32 data;
 
        if (!card) {
                printk(KERN_ERR "capidrv: if_sendbuf called with invalid driverId %d!\n",
@@ -1860,9 +1861,26 @@ static int if_sendbuf(int id, int channel, int doack, struct sk_buff *skb)
                return 0;
        }
        datahandle = nccip->datahandle;
+
+       /*
+        * Here we copy pointer skb->data into the 32-bit 'Data' field.
+        * The 'Data' field is not used in practice in linux kernel
+        * (neither in 32 or 64 bit), but should have some value,
+        * since a CAPI message trace will display it.
+        *
+        * The correct value in the 32 bit case is the address of the
+        * data, in 64 bit it makes no sense, we use 0 there.
+        */
+
+#ifdef CONFIG_64BIT
+       data = 0;
+#else
+       data = (unsigned long) skb->data;
+#endif
+
        capi_fill_DATA_B3_REQ(&sendcmsg, global.ap.applid, card->msgid++,
                              nccip->ncci,      /* adr */
-                             (u32) skb->data,  /* Data */
+                             data,             /* Data */
                              skb->len,         /* DataLength */
                              datahandle,       /* DataHandle */
                              0 /* Flags */
@@ -2123,7 +2141,10 @@ static int capidrv_delcontr(u16 contr)
                printk(KERN_ERR "capidrv: delcontr: no contr %u\n", contr);
                return -1;
        }
-       #warning FIXME: maybe a race condition the card should be removed here from global list /kkeil
+
+       /* FIXME: maybe a race condition the card should be removed
+        * here from global list /kkeil
+        */
        spin_unlock_irqrestore(&global_lock, flags);
 
        del_timer(&card->listentimer);
index a3b945ac32565be264096637b88901e1f6bfc0fe..7832d8ba8e444d9ae47a1af89b15f1756f7e8632 100644 (file)
@@ -109,7 +109,7 @@ config HISAX_16_3
 
 config HISAX_TELESPCI
        bool "Teles PCI"
-       depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV))
+       depends on PCI && PCI_LEGACY && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV))
        help
          This enables HiSax support for the Teles PCI.
          See <file:Documentation/isdn/README.HiSax> on how to configure it.
@@ -237,7 +237,7 @@ config HISAX_MIC
 
 config HISAX_NETJET
        bool "NETjet card"
-       depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV))
+       depends on PCI && PCI_LEGACY && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV))
        help
          This enables HiSax support for the NetJet from Traverse
          Technologies.
@@ -248,7 +248,7 @@ config HISAX_NETJET
 
 config HISAX_NETJET_U
        bool "NETspider U card"
-       depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV))
+       depends on PCI && PCI_LEGACY && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV))
        help
          This enables HiSax support for the Netspider U interface ISDN card
          from Traverse Technologies.
@@ -287,7 +287,7 @@ config HISAX_HSTSAPHIR
 
 config HISAX_BKM_A4T
        bool "Telekom A4T card"
-       depends on PCI
+       depends on PCI && PCI_LEGACY
        help
          This enables HiSax support for the Telekom A4T card.
 
@@ -297,7 +297,7 @@ config HISAX_BKM_A4T
 
 config HISAX_SCT_QUADRO
        bool "Scitel Quadro card"
-       depends on PCI
+       depends on PCI && PCI_LEGACY
        help
          This enables HiSax support for the Scitel Quadro card.
 
@@ -316,7 +316,7 @@ config HISAX_GAZEL
 
 config HISAX_HFC_PCI
        bool "HFC PCI-Bus cards"
-       depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV))
+       depends on PCI && PCI_LEGACY && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV))
        help
          This enables HiSax support for the HFC-S PCI 2BDS0 based cards.
 
@@ -325,7 +325,7 @@ config HISAX_HFC_PCI
 
 config HISAX_W6692
        bool "Winbond W6692 based cards"
-       depends on PCI
+       depends on PCI && PCI_LEGACY
        help
          This enables HiSax support for Winbond W6692 based PCI ISDN cards.
 
@@ -341,7 +341,7 @@ config HISAX_HFC_SX
 
 config HISAX_ENTERNOW_PCI
        bool "Formula-n enter:now PCI card"
-       depends on HISAX_NETJET && PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV))
+       depends on HISAX_NETJET && PCI && PCI_LEGACY && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV))
        help
          This enables HiSax support for the Formula-n enter:now PCI
          ISDN card.
@@ -411,7 +411,7 @@ config HISAX_HFC4S8S
 
 config HISAX_FRITZ_PCIPNP
        tristate "AVM Fritz!Card PCI/PCIv2/PnP support (EXPERIMENTAL)"
-       depends on PCI && EXPERIMENTAL
+       depends on PCI && PCI_LEGACY && EXPERIMENTAL
        help
          This enables the driver for the AVM Fritz!Card PCI,
          Fritz!Card PCI v2 and Fritz!Card PnP.
index f8b79783c8b375128a50bf119785e849e1b3e7f1..035d158779df75f328eca89c77a3e968497fb0ba 100644 (file)
@@ -830,7 +830,7 @@ static int __devinit avm_pnp_setup(struct IsdnCardState *cs)
 
 #endif /* __ISAPNP__ */
 
-#ifndef CONFIG_PCI
+#ifndef CONFIG_PCI_LEGACY
 
 static int __devinit avm_pci_setup(struct IsdnCardState *cs)
 {
@@ -872,7 +872,7 @@ static int __devinit avm_pci_setup(struct IsdnCardState *cs)
        return (1);
 }
 
-#endif /* CONFIG_PCI */
+#endif /* CONFIG_PCI_LEGACY */
 
 int __devinit
 setup_avm_pcipnp(struct IsdnCard *card)
index 82674507874647a07504e295c1a890962ce2dd98..2d670856d141bcb0a9668faabba046ca40d0a9f7 100644 (file)
@@ -1148,7 +1148,7 @@ static int __devinit setup_diva_isapnp(struct IsdnCard *card)
 
 #endif /* ISAPNP */
 
-#ifdef CONFIG_PCI
+#ifdef CONFIG_PCI_LEGACY
 static struct pci_dev *dev_diva __devinitdata = NULL;
 static struct pci_dev *dev_diva_u __devinitdata = NULL;
 static struct pci_dev *dev_diva201 __devinitdata = NULL;
@@ -1229,14 +1229,14 @@ static int __devinit setup_diva_pci(struct IsdnCard *card)
        return (1);             /* card found */
 }
 
-#else  /* if !CONFIG_PCI */
+#else  /* if !CONFIG_PCI_LEGACY */
 
 static int __devinit setup_diva_pci(struct IsdnCard *card)
 {
        return (-1);    /* card not found; continue search */
 }
 
-#endif /* CONFIG_PCI */
+#endif /* CONFIG_PCI_LEGACY */
 
 int __devinit
 setup_diva(struct IsdnCard *card)
index 948a9b290fd1146933a9d1cb38a9d6993db989a2..d272d8ce65375a5d3159688c19a8559c8db4f872 100644 (file)
@@ -883,7 +883,7 @@ setup_elsa_isa(struct IsdnCard *card)
        val += 'A' - 3;
        if (val == 'B' || val == 'C')
                val ^= 1;
-       if ((cs->subtyp == ELSA_PCFPRO) && (val = 'G'))
+       if ((cs->subtyp == ELSA_PCFPRO) && (val == 'G'))
                val = 'C';
        printk(KERN_INFO
               "Elsa: %s found at %#lx Rev.:%c IRQ %d\n",
@@ -1025,7 +1025,7 @@ setup_elsa_pcmcia(struct IsdnCard *card)
               cs->irq);
 }
 
-#ifdef CONFIG_PCI
+#ifdef CONFIG_PCI_LEGACY
 static         struct pci_dev *dev_qs1000 __devinitdata = NULL;
 static         struct pci_dev *dev_qs3000 __devinitdata = NULL;
 
@@ -1093,7 +1093,7 @@ setup_elsa_pci(struct IsdnCard *card)
 {
        return (1);
 }
-#endif /* CONFIG_PCI */
+#endif /* CONFIG_PCI_LEGACY */
 
 static int __devinit
 setup_elsa_common(struct IsdnCard *card)
index 3efa719b6d29f73ef38890bbeb0ba9224cddf168..f66620ad8e7c998f89c74084cffec895b78c463f 100644 (file)
@@ -532,6 +532,7 @@ setup_gazelisa(struct IsdnCard *card, struct IsdnCardState *cs)
        return (0);
 }
 
+#ifdef CONFIG_PCI_LEGACY
 static struct pci_dev *dev_tel __devinitdata = NULL;
 
 static int __devinit
@@ -620,6 +621,7 @@ setup_gazelpci(struct IsdnCardState *cs)
 
        return (0);
 }
+#endif /* CONFIG_PCI_LEGACY */
 
 int __devinit
 setup_gazel(struct IsdnCard *card)
@@ -639,7 +641,7 @@ setup_gazel(struct IsdnCard *card)
                        return (0);
        } else {
 
-#ifdef CONFIG_PCI
+#ifdef CONFIG_PCI_LEGACY
                if (setup_gazelpci(cs))
                        return (0);
 #else
index e5918c6fe73d09bfb99a4dc91f05ca2c4b09646b..bd9921128aa862f15add2ee1fe63fc60e0f24d93 100644 (file)
@@ -223,7 +223,6 @@ static int niccy_card_msg(struct IsdnCardState *cs, int mt, void *arg)
        return 0;
 }
 
-static struct pci_dev *niccy_dev __devinitdata = NULL;
 #ifdef __ISAPNP__
 static struct pnp_card *pnp_c __devinitdata = NULL;
 #endif
@@ -299,7 +298,9 @@ int __devinit setup_niccy(struct IsdnCard *card)
                        return 0;
                }
        } else {
-#ifdef CONFIG_PCI
+#ifdef CONFIG_PCI_LEGACY
+               static struct pci_dev *niccy_dev __devinitdata;
+
                u_int pci_ioaddr;
                cs->subtyp = 0;
                if ((niccy_dev = pci_find_device(PCI_VENDOR_ID_SATSAGEM,
@@ -356,7 +357,7 @@ int __devinit setup_niccy(struct IsdnCard *card)
                printk(KERN_WARNING "Niccy: io0 0 and NO_PCI_BIOS\n");
                printk(KERN_WARNING "Niccy: unable to config NICCY PCI\n");
                return 0;
-#endif                         /* CONFIG_PCI */
+#endif                         /* CONFIG_PCI_LEGACY */
        }
        printk(KERN_INFO "HiSax: %s %s config irq:%d data:0x%X ale:0x%X\n",
                CardType[cs->typ], (cs->subtyp == 1) ? "PnP" : "PCI",
index 03dfc32166a09ea057e861d8eaa93d47e6239dfe..95425f3d22209291620bc57cb2646885f2b71acf 100644 (file)
@@ -600,7 +600,7 @@ setup_sedlbauer_isapnp(struct IsdnCard *card, int *bytecnt)
 }
 #endif /* __ISAPNP__ */
 
-#ifdef CONFIG_PCI
+#ifdef CONFIG_PCI_LEGACY
 static struct pci_dev *dev_sedl __devinitdata = NULL;
 
 static int __devinit
@@ -675,7 +675,7 @@ setup_sedlbauer_pci(struct IsdnCard *card)
        return (1);
 }
 
-#endif /* CONFIG_PCI */
+#endif /* CONFIG_PCI_LEGACY */
 
 int __devinit
 setup_sedlbauer(struct IsdnCard *card)
index b39d1f5b378e5b06f88769a6c17566f4cf94edf5..ced83c202cacefe6b0b79b990dcbaa47b2448a79 100644 (file)
@@ -2104,7 +2104,7 @@ isdn_net_find_icall(int di, int ch, int idx, setup_parm *setup)
        u_long flags;
        isdn_net_dev *p;
        isdn_net_phone *n;
-       char nr[32];
+       char nr[ISDN_MSNLEN];
        char *my_eaz;
 
        /* Search name in netdev-chain */
@@ -2113,7 +2113,7 @@ isdn_net_find_icall(int di, int ch, int idx, setup_parm *setup)
                nr[1] = '\0';
                printk(KERN_INFO "isdn_net: Incoming call without OAD, assuming '0'\n");
        } else
-               strcpy(nr, setup->phone);
+               strlcpy(nr, setup->phone, ISDN_MSNLEN);
        si1 = (int) setup->si1;
        si2 = (int) setup->si2;
        if (!setup->eazmsn[0]) {
@@ -2789,7 +2789,7 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg)
                                chidx = -1;
                        }
                }
-               strcpy(lp->msn, cfg->eaz);
+               strlcpy(lp->msn, cfg->eaz, sizeof(lp->msn));
                lp->pre_device = drvidx;
                lp->pre_channel = chidx;
                lp->onhtime = cfg->onhtime;
@@ -2936,7 +2936,7 @@ isdn_net_addphone(isdn_net_ioctl_phone * phone)
        if (p) {
                if (!(n = kmalloc(sizeof(isdn_net_phone), GFP_KERNEL)))
                        return -ENOMEM;
-               strcpy(n->num, phone->phone);
+               strlcpy(n->num, phone->phone, sizeof(n->num));
                n->next = p->local->phone[phone->outgoing & 1];
                p->local->phone[phone->outgoing & 1] = n;
                return 0;
index 5992f63c383edd2fc6fc32a833544e0bbb5fee87..0120bcf883110fc974c5148eddb34c6f07de6081 100644 (file)
@@ -109,7 +109,7 @@ void memcpy_fromshmem(int card, void *dest, const void *src, size_t n);
 int get_card_from_id(int driver);
 int indicate_status(int card, int event, ulong Channel, char *Data);
 irqreturn_t interrupt_handler(int interrupt, void *cardptr);
-int sndpkt(int devId, int channel, struct sk_buff *data);
+int sndpkt(int devId, int channel, int ack, struct sk_buff *data);
 void rcvpkt(int card, RspMessage *rcvmsg);
 int command(isdn_ctrl *cmd);
 int reset(int card);
index 92016a2608e9516663c238e0f8ca08493c48199c..5ff6ae8684403fd83e48050d6e56552a473a7336 100644 (file)
@@ -20,7 +20,7 @@
 #include "message.h"
 #include "card.h"
 
-int sndpkt(int devId, int channel, struct sk_buff *data)
+int sndpkt(int devId, int channel, int ack, struct sk_buff *data)
 {
        LLData  ReqLnkWrite;
        int status;
index e0331e0094f1d582ad621bed719196aa1634503b..712220cef139469f93bd82ad5c97239c932d4841 100644 (file)
@@ -50,7 +50,7 @@ void memcpy_toshmem(int card, void *dest, const void *src, size_t n)
 
        outb(((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE) >> 14) | 0x80,
                sc_adapter[card]->ioport[sc_adapter[card]->shmem_pgport]);
-       memcpy_toio(sc_adapter[card]->rambase + dest_rem, src, n);
+       memcpy_toio((void __iomem *)(sc_adapter[card]->rambase + dest_rem), src, n);
        spin_unlock_irqrestore(&sc_adapter[card]->lock, flags);
        pr_debug("%s: set page to %#x\n",sc_adapter[card]->devicename,
                ((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE)>>14)|0x80);
index 729f1cd93606e86315b0330e0c2af7c740b22de6..7a6eead63a6bc14537d36fb09756ba5001bc8634 100644 (file)
@@ -494,6 +494,7 @@ static void init_vmcb(struct vmcb *vmcb)
                 */
                /*              (1ULL << INTERCEPT_SELECTIVE_CR0) | */
                                (1ULL << INTERCEPT_CPUID) |
+                               (1ULL << INTERCEPT_INVD) |
                                (1ULL << INTERCEPT_HLT) |
                                (1ULL << INTERCEPT_INVLPGA) |
                                (1ULL << INTERCEPT_IOIO_PROT) |
@@ -507,6 +508,7 @@ static void init_vmcb(struct vmcb *vmcb)
                                (1ULL << INTERCEPT_STGI) |
                                (1ULL << INTERCEPT_CLGI) |
                                (1ULL << INTERCEPT_SKINIT) |
+                               (1ULL << INTERCEPT_WBINVD) |
                                (1ULL << INTERCEPT_MONITOR) |
                                (1ULL << INTERCEPT_MWAIT);
 
@@ -561,6 +563,12 @@ static void svm_vcpu_reset(struct kvm_vcpu *vcpu)
        struct vcpu_svm *svm = to_svm(vcpu);
 
        init_vmcb(svm->vmcb);
+
+       if (vcpu->vcpu_id != 0) {
+               svm->vmcb->save.rip = 0;
+               svm->vmcb->save.cs.base = svm->vcpu.sipi_vector << 12;
+               svm->vmcb->save.cs.selector = svm->vcpu.sipi_vector << 8;
+       }
 }
 
 static struct kvm_vcpu *svm_create_vcpu(struct kvm *kvm, unsigned int id)
@@ -1241,6 +1249,7 @@ static int (*svm_exit_handlers[])(struct vcpu_svm *svm,
        [SVM_EXIT_VINTR]                        = interrupt_window_interception,
        /* [SVM_EXIT_CR0_SEL_WRITE]             = emulate_on_interception, */
        [SVM_EXIT_CPUID]                        = cpuid_interception,
+       [SVM_EXIT_INVD]                         = emulate_on_interception,
        [SVM_EXIT_HLT]                          = halt_interception,
        [SVM_EXIT_INVLPG]                       = emulate_on_interception,
        [SVM_EXIT_INVLPGA]                      = invalid_op_interception,
@@ -1255,6 +1264,7 @@ static int (*svm_exit_handlers[])(struct vcpu_svm *svm,
        [SVM_EXIT_STGI]                         = invalid_op_interception,
        [SVM_EXIT_CLGI]                         = invalid_op_interception,
        [SVM_EXIT_SKINIT]                       = invalid_op_interception,
+       [SVM_EXIT_WBINVD]                       = emulate_on_interception,
        [SVM_EXIT_MONITOR]                      = invalid_op_interception,
        [SVM_EXIT_MWAIT]                        = invalid_op_interception,
 };
@@ -1579,10 +1589,6 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
 #endif
                : "cc", "memory" );
 
-       local_irq_disable();
-
-       stgi();
-
        if ((svm->vmcb->save.dr7 & 0xff))
                load_db_regs(svm->host_db_regs);
 
@@ -1599,6 +1605,10 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
 
        reload_tss(vcpu);
 
+       local_irq_disable();
+
+       stgi();
+
        svm->next_rip = 0;
 }
 
index a6ace302e0cd454f1f413306013b0920305e4a67..33b181451557ad926df9c09a4a401c7fc71ae933 100644 (file)
@@ -167,7 +167,7 @@ static u8 opcode_table[256] = {
 static u16 twobyte_table[256] = {
        /* 0x00 - 0x0F */
        0, SrcMem | ModRM | DstReg, 0, 0, 0, 0, ImplicitOps, 0,
-       0, ImplicitOps, 0, 0, 0, ImplicitOps | ModRM, 0, 0,
+       ImplicitOps, ImplicitOps, 0, 0, 0, ImplicitOps | ModRM, 0, 0,
        /* 0x10 - 0x1F */
        0, 0, 0, 0, 0, 0, 0, 0, ImplicitOps | ModRM, 0, 0, 0, 0, 0, 0, 0,
        /* 0x20 - 0x2F */
@@ -980,17 +980,6 @@ done_prefixes:
                        goto cannot_emulate;
                dst.val = (s32) src.val;
                break;
-       case 0x6a: /* push imm8 */
-               src.val = 0L;
-               src.val = insn_fetch(s8, 1, _eip);
-push:
-               dst.type  = OP_MEM;
-               dst.bytes = op_bytes;
-               dst.val = src.val;
-               register_address_increment(_regs[VCPU_REGS_RSP], -op_bytes);
-               dst.ptr = (void *) register_address(ctxt->ss_base,
-                                                       _regs[VCPU_REGS_RSP]);
-               break;
        case 0x80 ... 0x83:     /* Grp1 */
                switch (modrm_reg) {
                case 0:
@@ -1243,6 +1232,17 @@ special_insn:
                register_address_increment(_regs[VCPU_REGS_RSP], op_bytes);
                no_wb = 1; /* Disable writeback. */
                break;
+       case 0x6a: /* push imm8 */
+               src.val = 0L;
+               src.val = insn_fetch(s8, 1, _eip);
+       push:
+               dst.type  = OP_MEM;
+               dst.bytes = op_bytes;
+               dst.val = src.val;
+               register_address_increment(_regs[VCPU_REGS_RSP], -op_bytes);
+               dst.ptr = (void *) register_address(ctxt->ss_base,
+                                                       _regs[VCPU_REGS_RSP]);
+               break;
        case 0x6c:              /* insb */
        case 0x6d:              /* insw/insd */
                 if (kvm_emulate_pio_string(ctxt->vcpu, NULL,
@@ -1532,6 +1532,8 @@ twobyte_special_insn:
        case 0x06:
                emulate_clts(ctxt->vcpu);
                break;
+       case 0x08:              /* invd */
+               break;
        case 0x09:              /* wbinvd */
                break;
        case 0x0d:              /* GrpP (prefetch) */
index 47d90db280ceb5a2485e34dcc18c3cf3c704cd02..99bc50059d3531499fa78ca369129a5f7d8c0e39 100644 (file)
@@ -60,7 +60,7 @@ static void gpio_led_set(struct led_classdev *led_cdev,
                gpio_set_value(led_dat->gpio, level);
 }
 
-static int __init gpio_led_probe(struct platform_device *pdev)
+static int gpio_led_probe(struct platform_device *pdev)
 {
        struct gpio_led_platform_data *pdata = pdev->dev.platform_data;
        struct gpio_led *cur_led;
@@ -93,13 +93,13 @@ static int __init gpio_led_probe(struct platform_device *pdev)
 
                gpio_direction_output(led_dat->gpio, led_dat->active_low);
 
+               INIT_WORK(&led_dat->work, gpio_led_work);
+
                ret = led_classdev_register(&pdev->dev, &led_dat->cdev);
                if (ret < 0) {
                        gpio_free(led_dat->gpio);
                        goto err;
                }
-
-               INIT_WORK(&led_dat->work, gpio_led_work);
        }
 
        platform_set_drvdata(pdev, leds_data);
@@ -110,17 +110,17 @@ err:
        if (i > 0) {
                for (i = i - 1; i >= 0; i--) {
                        led_classdev_unregister(&leds_data[i].cdev);
+                       cancel_work_sync(&leds_data[i].work);
                        gpio_free(leds_data[i].gpio);
                }
        }
 
-       flush_scheduled_work();
        kfree(leds_data);
 
        return ret;
 }
 
-static int __exit gpio_led_remove(struct platform_device *pdev)
+static int __devexit gpio_led_remove(struct platform_device *pdev)
 {
        int i;
        struct gpio_led_platform_data *pdata = pdev->dev.platform_data;
@@ -130,9 +130,10 @@ static int __exit gpio_led_remove(struct platform_device *pdev)
 
        for (i = 0; i < pdata->num_leds; i++) {
                led_classdev_unregister(&leds_data[i].cdev);
+               cancel_work_sync(&leds_data[i].work);
                gpio_free(leds_data[i].gpio);
        }
-       
+
        kfree(leds_data);
 
        return 0;
@@ -144,7 +145,7 @@ static int gpio_led_suspend(struct platform_device *pdev, pm_message_t state)
        struct gpio_led_platform_data *pdata = pdev->dev.platform_data;
        struct gpio_led_data *leds_data;
        int i;
-       
+
        leds_data = platform_get_drvdata(pdev);
 
        for (i = 0; i < pdata->num_leds; i++)
@@ -172,7 +173,8 @@ static int gpio_led_resume(struct platform_device *pdev)
 #endif
 
 static struct platform_driver gpio_led_driver = {
-       .remove         = __exit_p(gpio_led_remove),
+       .probe          = gpio_led_probe,
+       .remove         = __devexit_p(gpio_led_remove),
        .suspend        = gpio_led_suspend,
        .resume         = gpio_led_resume,
        .driver         = {
@@ -183,7 +185,7 @@ static struct platform_driver gpio_led_driver = {
 
 static int __init gpio_led_init(void)
 {
-       return platform_driver_probe(&gpio_led_driver, gpio_led_probe);
+       return platform_driver_register(&gpio_led_driver);
 }
 
 static void __exit gpio_led_exit(void)
index 8904f72f97c6fd00ff60c0b7a904d632983db03e..e2eec38c83c2ef21248353d132e3308810e1e17d 100644 (file)
@@ -200,7 +200,8 @@ static struct virtqueue *lg_find_vq(struct virtio_device *vdev,
 
        /* Figure out how many pages the ring will take, and map that memory */
        lvq->pages = lguest_map((unsigned long)lvq->config.pfn << PAGE_SHIFT,
-                               DIV_ROUND_UP(vring_size(lvq->config.num),
+                               DIV_ROUND_UP(vring_size(lvq->config.num,
+                                                       PAGE_SIZE),
                                             PAGE_SIZE));
        if (!lvq->pages) {
                err = -ENOMEM;
@@ -246,6 +247,8 @@ static void lg_del_vq(struct virtqueue *vq)
 {
        struct lguest_vq_info *lvq = vq->priv;
 
+       /* Release the interrupt */
+       free_irq(lvq->config.irq, vq);
        /* Tell virtio_ring.c to free the virtqueue. */
        vring_del_virtqueue(vq);
        /* Unmap the pages containing the ring. */
index 9d716fa42cad39f00dc2e20cdc364c752679409e..3b92a61ba8d23b14e1ac8e5b342929a314b669be 100644 (file)
@@ -184,7 +184,7 @@ static int initialize(struct file *file, const unsigned long __user *input)
 free_regs:
        free_page(lg->regs_page);
 release_guest:
-       memset(lg, 0, sizeof(*lg));
+       kfree(lg);
 unlock:
        mutex_unlock(&lguest_lock);
        return err;
index 516d943227e240750475c482c221de5dbdd066cb..075b4d99e35497c9a8f505af04d1fdf617489680 100644 (file)
@@ -94,7 +94,9 @@ static int wf_thread_func(void *data)
        DBG("wf: thread started\n");
 
        set_freezable();
-       while(!kthread_should_stop()) {
+       while (!kthread_should_stop()) {
+               try_to_freeze();
+
                if (time_after_eq(jiffies, next)) {
                        wf_notify(WF_EVENT_TICK, NULL);
                        if (wf_overtemp) {
@@ -116,12 +118,6 @@ static int wf_thread_func(void *data)
                delay = next - jiffies;
                if (delay <= HZ)
                        schedule_timeout_interruptible(delay);
-
-               /* there should be no non-suspend signal, but oh well */
-               if (signal_pending(current) && !try_to_freeze()) {
-                       printk(KERN_WARNING "windfarm: thread got sigl !\n");
-                       break;
-               }
        }
 
        DBG("wf: thread stopped\n");
index 7c426d07a555c0426855571552289c6ed9fcaaaa..1b1ef3130e6e8cbbe32ea6d659882b92a408d59e 100644 (file)
@@ -1207,8 +1207,7 @@ int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, unsigned long sect
                        prepare_to_wait(&bitmap->overflow_wait, &__wait,
                                        TASK_UNINTERRUPTIBLE);
                        spin_unlock_irq(&bitmap->lock);
-                       bitmap->mddev->queue
-                               ->unplug_fn(bitmap->mddev->queue);
+                       blk_unplug(bitmap->mddev->queue);
                        schedule();
                        finish_wait(&bitmap->overflow_wait, &__wait);
                        continue;
index 8939e61050884cd81cda3cdcbf7126b5b55e3dad..e298d8d11f24bb1892d959833dbd84cf4f9e16e6 100644 (file)
@@ -102,6 +102,8 @@ static void combine_restrictions_low(struct io_restrictions *lhs,
        lhs->seg_boundary_mask =
                min_not_zero(lhs->seg_boundary_mask, rhs->seg_boundary_mask);
 
+       lhs->bounce_pfn = min_not_zero(lhs->bounce_pfn, rhs->bounce_pfn);
+
        lhs->no_cluster |= rhs->no_cluster;
 }
 
@@ -566,6 +568,8 @@ void dm_set_device_limits(struct dm_target *ti, struct block_device *bdev)
                min_not_zero(rs->seg_boundary_mask,
                             q->seg_boundary_mask);
 
+       rs->bounce_pfn = min_not_zero(rs->bounce_pfn, q->bounce_pfn);
+
        rs->no_cluster |= !test_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags);
 }
 EXPORT_SYMBOL_GPL(dm_set_device_limits);
@@ -707,6 +711,8 @@ static void check_for_valid_limits(struct io_restrictions *rs)
                rs->max_segment_size = MAX_SEGMENT_SIZE;
        if (!rs->seg_boundary_mask)
                rs->seg_boundary_mask = -1;
+       if (!rs->bounce_pfn)
+               rs->bounce_pfn = -1;
 }
 
 int dm_table_add_target(struct dm_table *t, const char *type,
@@ -891,6 +897,7 @@ void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q)
        q->hardsect_size = t->limits.hardsect_size;
        q->max_segment_size = t->limits.max_segment_size;
        q->seg_boundary_mask = t->limits.seg_boundary_mask;
+       q->bounce_pfn = t->limits.bounce_pfn;
        if (t->limits.no_cluster)
                q->queue_flags &= ~(1 << QUEUE_FLAG_CLUSTER);
        else
@@ -993,8 +1000,7 @@ void dm_table_unplug_all(struct dm_table *t)
                struct dm_dev *dd = list_entry(d, struct dm_dev, list);
                struct request_queue *q = bdev_get_queue(dd->bdev);
 
-               if (q->unplug_fn)
-                       q->unplug_fn(q);
+               blk_unplug(q);
        }
 }
 
index 56a11f6c127b888f0518b8da9c2dd838d70fc74c..3dac1cfb81896655f953939a447bb731e9539747 100644 (file)
@@ -87,8 +87,7 @@ static void linear_unplug(struct request_queue *q)
 
        for (i=0; i < mddev->raid_disks; i++) {
                struct request_queue *r_queue = bdev_get_queue(conf->disks[i].rdev->bdev);
-               if (r_queue->unplug_fn)
-                       r_queue->unplug_fn(r_queue);
+               blk_unplug(r_queue);
        }
 }
 
index 808cd95494563d260456733e0d1e9ba80cbee21e..cef9ebd5a04652d4c3e9f293448c45425531d775 100644 (file)
@@ -5445,7 +5445,7 @@ void md_do_sync(mddev_t *mddev)
                 * about not overloading the IO subsystem. (things like an
                 * e2fsck being done on the RAID array should execute fast)
                 */
-               mddev->queue->unplug_fn(mddev->queue);
+               blk_unplug(mddev->queue);
                cond_resched();
 
                currspeed = ((unsigned long)(io_sectors-mddev->resync_mark_cnt))/2
@@ -5464,7 +5464,7 @@ void md_do_sync(mddev_t *mddev)
         * this also signals 'finished resyncing' to md_stop
         */
  out:
-       mddev->queue->unplug_fn(mddev->queue);
+       blk_unplug(mddev->queue);
 
        wait_event(mddev->recovery_wait, !atomic_read(&mddev->recovery_active));
 
index b35731cceac671ee647e108174a44cacfa82c381..eb631ebed6860b3f19ae8c3161a10e509d448d3e 100644 (file)
@@ -125,8 +125,7 @@ static void unplug_slaves(mddev_t *mddev)
                        atomic_inc(&rdev->nr_pending);
                        rcu_read_unlock();
 
-                       if (r_queue->unplug_fn)
-                               r_queue->unplug_fn(r_queue);
+                       blk_unplug(r_queue);
 
                        rdev_dec_pending(rdev, mddev);
                        rcu_read_lock();
index c111105fc2dc66ae162cb44039b27ccd100ad352..f8e591708d1fa7768fda354aa8da006b1f26d549 100644 (file)
@@ -35,8 +35,7 @@ static void raid0_unplug(struct request_queue *q)
        for (i=0; i<mddev->raid_disks; i++) {
                struct request_queue *r_queue = bdev_get_queue(devlist[i]->bdev);
 
-               if (r_queue->unplug_fn)
-                       r_queue->unplug_fn(r_queue);
+               blk_unplug(r_queue);
        }
 }
 
index 85478d6a9c1af645dfdfdb824aa1b6c7286e9daf..4a69c416e045c97f24ef4582c9d3b9f83588ba15 100644 (file)
@@ -549,8 +549,7 @@ static void unplug_slaves(mddev_t *mddev)
                        atomic_inc(&rdev->nr_pending);
                        rcu_read_unlock();
 
-                       if (r_queue->unplug_fn)
-                               r_queue->unplug_fn(r_queue);
+                       blk_unplug(r_queue);
 
                        rdev_dec_pending(rdev, mddev);
                        rcu_read_lock();
index fc6607acb6e4734f12c4dbed23bf9e82ab5816ec..5cdcc938620050b39fb30593565847859d6ad1a4 100644 (file)
@@ -593,8 +593,7 @@ static void unplug_slaves(mddev_t *mddev)
                        atomic_inc(&rdev->nr_pending);
                        rcu_read_unlock();
 
-                       if (r_queue->unplug_fn)
-                               r_queue->unplug_fn(r_queue);
+                       blk_unplug(r_queue);
 
                        rdev_dec_pending(rdev, mddev);
                        rcu_read_lock();
index 80a67d789b7252c4311fc1adc54a1af06a519787..a5aad8cad84332a138e741d56ed49bbcf58e1c6c 100644 (file)
@@ -688,7 +688,8 @@ ops_run_prexor(struct stripe_head *sh, struct dma_async_tx_descriptor *tx)
 }
 
 static struct dma_async_tx_descriptor *
-ops_run_biodrain(struct stripe_head *sh, struct dma_async_tx_descriptor *tx)
+ops_run_biodrain(struct stripe_head *sh, struct dma_async_tx_descriptor *tx,
+                unsigned long pending)
 {
        int disks = sh->disks;
        int pd_idx = sh->pd_idx, i;
@@ -696,7 +697,7 @@ ops_run_biodrain(struct stripe_head *sh, struct dma_async_tx_descriptor *tx)
        /* check if prexor is active which means only process blocks
         * that are part of a read-modify-write (Wantprexor)
         */
-       int prexor = test_bit(STRIPE_OP_PREXOR, &sh->ops.pending);
+       int prexor = test_bit(STRIPE_OP_PREXOR, &pending);
 
        pr_debug("%s: stripe %llu\n", __FUNCTION__,
                (unsigned long long)sh->sector);
@@ -773,7 +774,8 @@ static void ops_complete_write(void *stripe_head_ref)
 }
 
 static void
-ops_run_postxor(struct stripe_head *sh, struct dma_async_tx_descriptor *tx)
+ops_run_postxor(struct stripe_head *sh, struct dma_async_tx_descriptor *tx,
+               unsigned long pending)
 {
        /* kernel stack size limits the total number of disks */
        int disks = sh->disks;
@@ -781,7 +783,7 @@ ops_run_postxor(struct stripe_head *sh, struct dma_async_tx_descriptor *tx)
 
        int count = 0, pd_idx = sh->pd_idx, i;
        struct page *xor_dest;
-       int prexor = test_bit(STRIPE_OP_PREXOR, &sh->ops.pending);
+       int prexor = test_bit(STRIPE_OP_PREXOR, &pending);
        unsigned long flags;
        dma_async_tx_callback callback;
 
@@ -808,7 +810,7 @@ ops_run_postxor(struct stripe_head *sh, struct dma_async_tx_descriptor *tx)
        }
 
        /* check whether this postxor is part of a write */
-       callback = test_bit(STRIPE_OP_BIODRAIN, &sh->ops.pending) ?
+       callback = test_bit(STRIPE_OP_BIODRAIN, &pending) ?
                ops_complete_write : ops_complete_postxor;
 
        /* 1/ if we prexor'd then the dest is reused as a source
@@ -896,12 +898,12 @@ static void raid5_run_ops(struct stripe_head *sh, unsigned long pending)
                tx = ops_run_prexor(sh, tx);
 
        if (test_bit(STRIPE_OP_BIODRAIN, &pending)) {
-               tx = ops_run_biodrain(sh, tx);
+               tx = ops_run_biodrain(sh, tx, pending);
                overlap_clear++;
        }
 
        if (test_bit(STRIPE_OP_POSTXOR, &pending))
-               ops_run_postxor(sh, tx);
+               ops_run_postxor(sh, tx, pending);
 
        if (test_bit(STRIPE_OP_CHECK, &pending))
                ops_run_check(sh);
@@ -2624,6 +2626,13 @@ static void handle_stripe5(struct stripe_head *sh)
        s.expanded = test_bit(STRIPE_EXPAND_READY, &sh->state);
        /* Now to look around and see what can be done */
 
+       /* clean-up completed biofill operations */
+       if (test_bit(STRIPE_OP_BIOFILL, &sh->ops.complete)) {
+               clear_bit(STRIPE_OP_BIOFILL, &sh->ops.pending);
+               clear_bit(STRIPE_OP_BIOFILL, &sh->ops.ack);
+               clear_bit(STRIPE_OP_BIOFILL, &sh->ops.complete);
+       }
+
        rcu_read_lock();
        for (i=disks; i--; ) {
                mdk_rdev_t *rdev;
@@ -2897,13 +2906,6 @@ static void handle_stripe6(struct stripe_head *sh, struct page *tmp_page)
        s.expanded = test_bit(STRIPE_EXPAND_READY, &sh->state);
        /* Now to look around and see what can be done */
 
-       /* clean-up completed biofill operations */
-       if (test_bit(STRIPE_OP_BIOFILL, &sh->ops.complete)) {
-               clear_bit(STRIPE_OP_BIOFILL, &sh->ops.pending);
-               clear_bit(STRIPE_OP_BIOFILL, &sh->ops.ack);
-               clear_bit(STRIPE_OP_BIOFILL, &sh->ops.complete);
-       }
-
        rcu_read_lock();
        for (i=disks; i--; ) {
                mdk_rdev_t *rdev;
@@ -3186,8 +3188,7 @@ static void unplug_slaves(mddev_t *mddev)
                        atomic_inc(&rdev->nr_pending);
                        rcu_read_unlock();
 
-                       if (r_queue->unplug_fn)
-                               r_queue->unplug_fn(r_queue);
+                       blk_unplug(r_queue);
 
                        rdev_dec_pending(rdev, mddev);
                        rcu_read_lock();
index 926576156578b399ecd82e914c38bab94ae9bdd3..77a6e4bf503d2257ed754ea6072f84263f2654a8 100644 (file)
@@ -52,7 +52,7 @@ const struct raid6_calls * const raid6_algos[] = {
        &raid6_intx16,
        &raid6_intx32,
 #endif
-#if defined(__i386__)
+#if defined(__i386__) && !defined(__arch_um__)
        &raid6_mmxx1,
        &raid6_mmxx2,
        &raid6_sse1x1,
@@ -60,7 +60,7 @@ const struct raid6_calls * const raid6_algos[] = {
        &raid6_sse2x1,
        &raid6_sse2x2,
 #endif
-#if defined(__x86_64__)
+#if defined(__x86_64__) && !defined(__arch_um__)
        &raid6_sse2x1,
        &raid6_sse2x2,
        &raid6_sse2x4,
index 6181a5a3365a198d3aad83b52f6c7e09a4d5aad3..d4e4a1bd70ad2f0841a8dd4036a167dfd1e9a3c0 100644 (file)
@@ -16,7 +16,7 @@
  * MMX implementation of RAID-6 syndrome functions
  */
 
-#if defined(__i386__)
+#if defined(__i386__) && !defined(__arch_um__)
 
 #include "raid6.h"
 #include "raid6x86.h"
index f0a1ba8f40ba90c6b59fdc69073c4bb997b425b4..0666237276ff37283e06aacc8980340eada56840 100644 (file)
@@ -21,7 +21,7 @@
  * worthwhile as a separate implementation.
  */
 
-#if defined(__i386__)
+#if defined(__i386__) && !defined(__arch_um__)
 
 #include "raid6.h"
 #include "raid6x86.h"
index 0f019762a7c3cba42cba1ea68a99459465f17223..b034ad8680397e0ab62eff5d55ddf6f5820979eb 100644 (file)
@@ -17,7 +17,7 @@
  *
  */
 
-#if defined(__i386__) || defined(__x86_64__)
+#if (defined(__i386__) || defined(__x86_64__)) && !defined(__arch_um__)
 
 #include "raid6.h"
 #include "raid6x86.h"
@@ -161,7 +161,7 @@ const struct raid6_calls raid6_sse2x2 = {
 
 #endif
 
-#ifdef __x86_64__
+#if defined(__x86_64__) && !defined(__arch_um__)
 
 /*
  * Unrolled-by-4 SSE2 implementation
index 9111950414ff2d71c003591f2ad4c3503303de5c..99fea7a70ca70ace27cca159e039b0ab318368ae 100644 (file)
@@ -19,7 +19,7 @@
 #ifndef LINUX_RAID_RAID6X86_H
 #define LINUX_RAID_RAID6X86_H
 
-#if defined(__i386__) || defined(__x86_64__)
+#if (defined(__i386__) || defined(__x86_64__)) && !defined(__arch_um__)
 
 #ifdef __KERNEL__ /* Real code */
 
index dd9bd4310c848cabf6c5a6b415695ef299209868..1604f049040494dff638038665dd61c1de9586f3 100644 (file)
@@ -151,6 +151,7 @@ config VIDEO_IR_I2C
 
 config VIDEO_IR
        tristate
+       depends on INPUT
        select VIDEO_IR_I2C if I2C
 
 config VIDEO_TVEEPROM
index cb034ead95ab8e5b88d2867cecdf7a7d5fe566fc..7d04a6fd1acb03affddb06faada0a40018066a19 100644 (file)
@@ -59,43 +59,89 @@ void saa7146_setgpio(struct saa7146_dev *dev, int port, u32 data)
 }
 
 /* This DEBI code is based on the saa7146 Stradis driver by Nathan Laredo */
-int saa7146_wait_for_debi_done(struct saa7146_dev *dev, int nobusyloop)
+static inline int saa7146_wait_for_debi_done_sleep(struct saa7146_dev *dev,
+                               unsigned long us1, unsigned long us2)
 {
-       unsigned long start;
+       unsigned long timeout;
        int err;
 
        /* wait for registers to be programmed */
-       start = jiffies;
+       timeout = jiffies + usecs_to_jiffies(us1);
        while (1) {
-               err = time_after(jiffies, start + HZ/20);
+               err = time_after(jiffies, timeout);
                if (saa7146_read(dev, MC2) & 2)
                        break;
                if (err) {
-                       DEB_S(("timed out while waiting for registers getting programmed\n"));
+                       printk(KERN_ERR "%s: %s timed out while waiting for "
+                                       "registers getting programmed\n",
+                                       dev->name, __FUNCTION__);
                        return -ETIMEDOUT;
                }
-               if (nobusyloop)
-                       msleep(1);
+               msleep(1);
        }
 
        /* wait for transfer to complete */
-       start = jiffies;
+       timeout = jiffies + usecs_to_jiffies(us2);
        while (1) {
-               err = time_after(jiffies, start + HZ/4);
+               err = time_after(jiffies, timeout);
                if (!(saa7146_read(dev, PSR) & SPCI_DEBI_S))
                        break;
                saa7146_read(dev, MC2);
                if (err) {
-                       DEB_S(("timed out while waiting for transfer completion\n"));
+                       DEB_S(("%s: %s timed out while waiting for transfer "
+                               "completion\n", dev->name, __FUNCTION__));
                        return -ETIMEDOUT;
                }
-               if (nobusyloop)
-                       msleep(1);
+               msleep(1);
        }
 
        return 0;
 }
 
+static inline int saa7146_wait_for_debi_done_busyloop(struct saa7146_dev *dev,
+                               unsigned long us1, unsigned long us2)
+{
+       unsigned long loops;
+
+       /* wait for registers to be programmed */
+       loops = us1;
+       while (1) {
+               if (saa7146_read(dev, MC2) & 2)
+                       break;
+               if (!loops--) {
+                       printk(KERN_ERR "%s: %s timed out while waiting for "
+                                       "registers getting programmed\n",
+                                       dev->name, __FUNCTION__);
+                       return -ETIMEDOUT;
+               }
+               udelay(1);
+       }
+
+       /* wait for transfer to complete */
+       loops = us2 / 5;
+       while (1) {
+               if (!(saa7146_read(dev, PSR) & SPCI_DEBI_S))
+                       break;
+               saa7146_read(dev, MC2);
+               if (!loops--) {
+                       DEB_S(("%s: %s timed out while waiting for transfer "
+                               "completion\n", dev->name, __FUNCTION__));
+                       return -ETIMEDOUT;
+               }
+               udelay(5);
+       }
+
+       return 0;
+}
+
+int saa7146_wait_for_debi_done(struct saa7146_dev *dev, int nobusyloop)
+{
+       if (nobusyloop)
+               return saa7146_wait_for_debi_done_sleep(dev, 50000, 250000);
+       else
+               return saa7146_wait_for_debi_done_busyloop(dev, 50000, 250000);
+}
+
 /****************************************************************************
  * general helper functions
  ****************************************************************************/
index 4b93931de4e1c44aabaa308c1e9b67f01afc0976..13cf16668171bb611b73ac143e7a77bfcf34b89e 100644 (file)
@@ -116,7 +116,7 @@ static int mt2131_set_params(struct dvb_frontend *fe,
        f_lo1 = (f_lo1 / 250) * 250;
        f_lo2 = f_lo1 - freq - MT2131_IF2;
 
-       priv->frequency =  (f_lo1 - f_lo2 - MT2131_IF2) * 1000,
+       priv->frequency =  (f_lo1 - f_lo2 - MT2131_IF2) * 1000;
 
        /* Frequency LO1 = 16MHz * (DIV1 + NUM1/8192 ) */
        num1 = f_lo1 * 64 / (MT2131_FREF / 128);
index 30e8a705fad4d7bb8f83a19c9fa2e6a4eb3fb7c4..8dee7ec9456ae02d919581fb1a034ff5f8a51dff 100644 (file)
@@ -42,6 +42,9 @@ struct s5h1409_state {
        fe_modulation_t current_modulation;
 
        u32 current_frequency;
+
+       u32 is_qam_locked;
+       u32 qam_state;
 };
 
 static int debug = 0;
@@ -94,6 +97,7 @@ static struct init_tab {
        { 0xac, 0x1003, },
        { 0xad, 0x103f, },
        { 0xe2, 0x0100, },
+       { 0xe3, 0x0000, },
        { 0x28, 0x1010, },
        { 0xb1, 0x000e, },
 };
@@ -335,6 +339,8 @@ static int s5h1409_softreset(struct dvb_frontend* fe)
 
        s5h1409_writereg(state, 0xf5, 0);
        s5h1409_writereg(state, 0xf5, 1);
+       state->is_qam_locked = 0;
+       state->qam_state = 0;
        return 0;
 }
 
@@ -349,6 +355,11 @@ static int s5h1409_set_if_freq(struct dvb_frontend* fe, int KHz)
                s5h1409_writereg(state, 0x87, 0x01be);
                s5h1409_writereg(state, 0x88, 0x0436);
                s5h1409_writereg(state, 0x89, 0x054d);
+       } else
+       if (KHz == 4000) {
+               s5h1409_writereg(state, 0x87, 0x014b);
+               s5h1409_writereg(state, 0x88, 0x0cb5);
+               s5h1409_writereg(state, 0x89, 0x03e2);
        } else {
                printk("%s() Invalid arg = %d KHz\n", __FUNCTION__, KHz);
                ret = -1;
@@ -361,7 +372,7 @@ static int s5h1409_set_spectralinversion(struct dvb_frontend* fe, int inverted)
 {
        struct s5h1409_state* state = fe->demodulator_priv;
 
-       dprintk("%s()\n", __FUNCTION__);
+       dprintk("%s(%d)\n", __FUNCTION__, inverted);
 
        if(inverted == 1)
                return s5h1409_writereg(state, 0x1b, 0x1101); /* Inverted */
@@ -382,14 +393,10 @@ static int s5h1409_enable_modulation(struct dvb_frontend* fe,
                s5h1409_writereg(state, 0xf4, 0);
                break;
        case QAM_64:
-               dprintk("%s() QAM_64\n", __FUNCTION__);
-               s5h1409_writereg(state, 0xf4, 1);
-               s5h1409_writereg(state, 0x85, 0x100);
-               break;
        case QAM_256:
-               dprintk("%s() QAM_256\n", __FUNCTION__);
+               dprintk("%s() QAM_AUTO (64/256)\n", __FUNCTION__);
                s5h1409_writereg(state, 0xf4, 1);
-               s5h1409_writereg(state, 0x85, 0x101);
+               s5h1409_writereg(state, 0x85, 0x110);
                break;
        default:
                dprintk("%s() Invalid modulation\n", __FUNCTION__);
@@ -423,7 +430,7 @@ static int s5h1409_set_gpio(struct dvb_frontend* fe, int enable)
        if (enable)
                return s5h1409_writereg(state, 0xe3, 0x1100);
        else
-               return s5h1409_writereg(state, 0xe3, 0);
+               return s5h1409_writereg(state, 0xe3, 0x1000);
 }
 
 static int s5h1409_sleep(struct dvb_frontend* fe, int enable)
@@ -444,6 +451,66 @@ static int s5h1409_register_reset(struct dvb_frontend* fe)
        return s5h1409_writereg(state, 0xfa, 0);
 }
 
+static void s5h1409_set_qam_amhum_mode(struct dvb_frontend *fe)
+{
+       struct s5h1409_state *state = fe->demodulator_priv;
+       u16 reg;
+
+       if (state->is_qam_locked)
+               return;
+
+       /* QAM EQ lock check */
+       reg = s5h1409_readreg(state, 0xf0);
+
+       if ((reg >> 13) & 0x1) {
+
+               state->is_qam_locked = 1;
+               reg &= 0xff;
+
+               s5h1409_writereg(state, 0x96, 0x00c);
+               if ((reg < 0x38) || (reg > 0x68) ) {
+                       s5h1409_writereg(state, 0x93, 0x3332);
+                       s5h1409_writereg(state, 0x9e, 0x2c37);
+               } else {
+                       s5h1409_writereg(state, 0x93, 0x3130);
+                       s5h1409_writereg(state, 0x9e, 0x2836);
+               }
+
+       } else {
+               s5h1409_writereg(state, 0x96, 0x0008);
+               s5h1409_writereg(state, 0x93, 0x3332);
+               s5h1409_writereg(state, 0x9e, 0x2c37);
+       }
+}
+
+static void s5h1409_set_qam_interleave_mode(struct dvb_frontend *fe)
+{
+       struct s5h1409_state *state = fe->demodulator_priv;
+       u16 reg, reg1, reg2;
+
+       reg = s5h1409_readreg(state, 0xf1);
+
+       /* Master lock */
+       if ((reg >> 15) & 0x1) {
+               if (state->qam_state != 2) {
+                       state->qam_state = 2;
+                       reg1 = s5h1409_readreg(state, 0xb2);
+                       reg2 = s5h1409_readreg(state, 0xad);
+
+                       s5h1409_writereg(state, 0x96, 0x20);
+                       s5h1409_writereg(state, 0xad,
+                               ( ((reg1 & 0xf000) >> 4) | (reg2 & 0xf0ff)) );
+                       s5h1409_writereg(state, 0xab, 0x1100);
+               }
+       } else {
+               if (state->qam_state != 1) {
+                       state->qam_state = 1;
+                       s5h1409_writereg(state, 0x96, 0x08);
+                       s5h1409_writereg(state, 0xab, 0x1101);
+               }
+       }
+}
+
 /* Talk to the demod, set the FEC, GUARD, QAM settings etc */
 static int s5h1409_set_frontend (struct dvb_frontend* fe,
                                 struct dvb_frontend_parameters *p)
@@ -458,12 +525,21 @@ static int s5h1409_set_frontend (struct dvb_frontend* fe,
 
        s5h1409_enable_modulation(fe, p->u.vsb.modulation);
 
+       /* Allow the demod to settle */
+       msleep(100);
+
        if (fe->ops.tuner_ops.set_params) {
                if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 1);
                fe->ops.tuner_ops.set_params(fe, p);
                if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
        }
 
+       /* Optimize the demod for QAM */
+       if (p->u.vsb.modulation != VSB_8) {
+               s5h1409_set_qam_amhum_mode(fe);
+               s5h1409_set_qam_interleave_mode(fe);
+       }
+
        return 0;
 }
 
@@ -495,8 +571,8 @@ static int s5h1409_init (struct dvb_frontend* fe)
        s5h1409_set_gpio(fe, state->config->gpio);
        s5h1409_softreset(fe);
 
-       /* Note: Leaving the I2C gate open here. */
-       s5h1409_i2c_gate_ctrl(fe, 1);
+       /* Note: Leaving the I2C gate closed. */
+       s5h1409_i2c_gate_ctrl(fe, 0);
 
        return 0;
 }
index 17e5cb561cd8569a77752f0a3df7984648f056d3..7c23775f77dbe0582734c49ee9ffe5e9f1904cbc 100644 (file)
@@ -358,11 +358,23 @@ static int stv0297_read_ber(struct dvb_frontend *fe, u32 * ber)
 static int stv0297_read_signal_strength(struct dvb_frontend *fe, u16 * strength)
 {
        struct stv0297_state *state = fe->demodulator_priv;
-       u8 STRENGTH[2];
-
-       stv0297_readregs(state, 0x41, STRENGTH, 2);
-       *strength = (STRENGTH[1] & 0x03) << 8 | STRENGTH[0];
-
+       u8 STRENGTH[3];
+       u16 tmp;
+
+       stv0297_readregs(state, 0x41, STRENGTH, 3);
+       tmp = (STRENGTH[1] & 0x03) << 8 | STRENGTH[0];
+       if (STRENGTH[2] & 0x20) {
+               if (tmp < 0x200)
+                       tmp = 0;
+               else
+                       tmp = tmp - 0x200;
+       } else {
+               if (tmp > 0x1ff)
+                       tmp = 0;
+               else
+                       tmp = 0x1ff - tmp;
+       }
+       *strength = (tmp << 7) | (tmp >> 2);
        return 0;
 }
 
index 4cd9e82c4669fd857eb07d37981c2483e12f876c..45137d2ebfb9846b3462e20981eb0dd91adc0973 100644 (file)
@@ -301,6 +301,8 @@ static int tda10021_read_ber(struct dvb_frontend* fe, u32* ber)
        u32 _ber = tda10021_readreg(state, 0x14) |
                (tda10021_readreg(state, 0x15) << 8) |
                ((tda10021_readreg(state, 0x16) & 0x0f) << 16);
+       _tda10021_writereg(state, 0x10, (tda10021_readreg(state, 0x10) & ~0xc0)
+                                       | (tda10021_inittab[0x10] & 0xc0));
        *ber = 10 * _ber;
 
        return 0;
@@ -310,7 +312,11 @@ static int tda10021_read_signal_strength(struct dvb_frontend* fe, u16* strength)
 {
        struct tda10021_state* state = fe->demodulator_priv;
 
+       u8 config = tda10021_readreg(state, 0x02);
        u8 gain = tda10021_readreg(state, 0x17);
+       if (config & 0x02)
+               /* the agc value is inverted */
+               gain = ~gain;
        *strength = (gain << 8) | gain;
 
        return 0;
index 066b73b75698e88e674ab4f0534b3e76835fc1f7..60433b5011fde27e1ddaadc6279a40165352e379 100644 (file)
@@ -47,7 +47,7 @@ struct ves1820_state {
 static int verbose;
 
 static u8 ves1820_inittab[] = {
-       0x69, 0x6A, 0x93, 0x12, 0x12, 0x46, 0x26, 0x1A,
+       0x69, 0x6A, 0x93, 0x1A, 0x12, 0x46, 0x26, 0x1A,
        0x43, 0x6A, 0xAA, 0xAA, 0x1E, 0x85, 0x43, 0x20,
        0xE0, 0x00, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
index 6d53289b327693887881714e3ee79ad5a5602df2..54b91f26ca63a233515c04d16615be787c5e4b48 100644 (file)
@@ -84,7 +84,7 @@ config DVB_BUDGET
 
 config DVB_BUDGET_CI
        tristate "Budget cards with onboard CI connector"
-       depends on DVB_CORE && PCI && I2C && VIDEO_V4L1
+       depends on DVB_CORE && PCI && I2C && VIDEO_V4L1 && INPUT
        select VIDEO_SAA7146
        select DVB_STV0297 if !DVB_FE_CUSTOMISE
        select DVB_STV0299 if !DVB_FE_CUSTOMISE
index 2e571eb9313ae6d5b8e49b5829c83ec8a590c354..c9f14bfc85441cf28ce522875ba9169a6b82f56e 100644 (file)
@@ -363,7 +363,7 @@ endmenu # encoder / decoder chips
 
 config VIDEO_VIVI
        tristate "Virtual Video Driver"
-       depends on VIDEO_V4L2 && !SPARC32 && !SPARC64 && PCI
+       depends on VIDEO_V4L2 && !SPARC32 && !SPARC64
        select VIDEOBUF_VMALLOC
        default n
        ---help---
index 9feeb636ff9b6e4e05c9913c06a77975de232cc9..a88b56e6ca05c3c2d990e2313c2bd79b857124f6 100644 (file)
@@ -2881,10 +2881,6 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
                if (NULL == fmt)
                        return -EINVAL;
                mutex_lock(&fh->cap.lock);
-               if (fmt->depth != pic->depth) {
-                       retval = -EINVAL;
-                       goto fh_unlock_and_return;
-               }
                if (fmt->flags & FORMAT_FLAGS_RAW) {
                        /* VIDIOCMCAPTURE uses gbufsize, not RAW_BPL *
                           RAW_LINES * 2. F1 is stored at offset 0, F2
@@ -3117,6 +3113,8 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
                                             vm->width,vm->height,field);
                if (0 != retval)
                        goto fh_unlock_and_return;
+               btv->init.width = vm->width;
+               btv->init.height = vm->height;
                spin_lock_irqsave(&btv->s_lock,flags);
                buffer_queue(&fh->cap,&buf->vb);
                spin_unlock_irqrestore(&btv->s_lock,flags);
index 0b92c35a8435cd86a8abbd9b7df5cf2fa5218cb7..d4ac4c4b49b459a9b71a952aac453ec456ed4dcc 100644 (file)
@@ -36,7 +36,7 @@
 #include <linux/pci.h>
 #include <linux/input.h>
 #include <linux/mutex.h>
-#include <asm/scatterlist.h>
+#include <linux/scatterlist.h>
 #include <asm/io.h>
 #include <media/v4l2-common.h>
 
index b63cab33692072a6163463211aaace9fb29619e1..7ae499c9c54c8785e497e9ddabdcde740c017f01 100644 (file)
@@ -3,6 +3,9 @@
  * multifunction chip.  Currently works with the Omnivision OV7670
  * sensor.
  *
+ * The data sheet for this device can be found at:
+ *    http://www.marvell.com/products/pcconn/88ALP01.jsp
+ *
  * Copyright 2006 One Laptop Per Child Association, Inc.
  * Copyright 2006-7 Jonathan Corbet <corbet@lwn.net>
  *
@@ -2232,13 +2235,16 @@ static int cafe_pci_suspend(struct pci_dev *pdev, pm_message_t state)
 {
        struct cafe_camera *cam = cafe_find_by_pdev(pdev);
        int ret;
+       enum cafe_state cstate;
 
        ret = pci_save_state(pdev);
        if (ret)
                return ret;
+       cstate = cam->state; /* HACK - stop_dma sets to idle */
        cafe_ctlr_stop_dma(cam);
        cafe_ctlr_power_down(cam);
        pci_disable_device(pdev);
+       cam->state = cstate;
        return 0;
 }
 
index 72004a07b2d5c85199e9a06150c2f6110aa795a9..d8b1ccb44913bcdba7692dc48406ed0f7f068aa9 100644 (file)
@@ -1,6 +1,6 @@
 config VIDEO_CX23885
        tristate "Conexant cx23885 (2388x successor) support"
-       depends on DVB_CORE && VIDEO_DEV && PCI && I2C
+       depends on DVB_CORE && VIDEO_DEV && PCI && I2C && INPUT
        select I2C_ALGOBIT
        select FW_LOADER
        select VIDEO_BTCX
index eeb5224ca1018fda4708c8e4fbf29ecb552b46c1..ceb31d4a251267f66d5d2baf265d6463e2d05f95 100644 (file)
@@ -1,6 +1,6 @@
 config VIDEO_CX88
        tristate "Conexant 2388x (bt878 successor) support"
-       depends on VIDEO_DEV && PCI && I2C
+       depends on VIDEO_DEV && PCI && I2C && INPUT
        select I2C_ALGOBIT
        select FW_LOADER
        select VIDEO_BTCX
index 5b6a4037160245e848119eda244cd64b9b58f20e..c1127802ad9cd3cf1f6f2f7baacf4dc23f25509d 100644 (file)
@@ -1,6 +1,6 @@
 config VIDEO_EM28XX
        tristate "Empia EM2800/2820/2840 USB video capture support"
-       depends on VIDEO_V4L1 && I2C
+       depends on VIDEO_V4L1 && I2C && INPUT
        select VIDEO_TUNER
        select VIDEO_TVEEPROM
        select VIDEO_IR
index 997d067e32e07e839eaa548a112639c99cd4d73a..e3a4aa7a9df414769bf0b8e208e3487a154fd200 100644 (file)
@@ -416,8 +416,10 @@ static int attach_inform(struct i2c_client *client)
        struct em28xx *dev = client->adapter->algo_data;
 
        switch (client->addr << 1) {
-               case 0x43:
-               case 0x4b:
+               case 0x86:
+               case 0x84:
+               case 0x96:
+               case 0x94:
                {
                        struct tuner_setup tun_setup;
 
index a4c2a907124a6529c38e143e2eeb60ed3958746d..2529c298b862a4c80c83404894783af34ca4534a 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/usb.h>
 #include <linux/i2c.h>
 #include <linux/version.h>
+#include <linux/mm.h>
 #include <linux/video_decoder.h>
 #include <linux/mutex.h>
 
index 285fca676a69a7cd77c68da68ca78bea868dbd97..623eea2652ca1fda2844d29b4c5cb0fb7c792163 100644 (file)
@@ -741,7 +741,7 @@ int __devinit init_ivtv_i2c(struct ivtv *itv)
                return i2c_bit_add_bus(&itv->i2c_adap);
 }
 
-void __devexit exit_ivtv_i2c(struct ivtv *itv)
+void exit_ivtv_i2c(struct ivtv *itv)
 {
        IVTV_DEBUG_I2C("i2c exit\n");
 
index 677c3292855e7da8edc6a056fe9e005d8397d15f..de6a07442298d44d6735cde7266a201a48cba39c 100644 (file)
@@ -36,6 +36,6 @@ void ivtv_call_i2c_clients(struct ivtv *itv, unsigned int cmd, void *arg);
 
 /* init + register i2c algo-bit adapter */
 int __devinit init_ivtv_i2c(struct ivtv *itv);
-void __devexit exit_ivtv_i2c(struct ivtv *itv);
+void exit_ivtv_i2c(struct ivtv *itv);
 
 #endif
index ce4b2f9791ee5718535435f59f9e833ce4087c01..36047d4e70f625d1fa693e210c60eebbb9d20fc8 100644 (file)
@@ -91,7 +91,6 @@ static void planb_close(struct video_device *);
 static int planb_ioctl(struct video_device *, unsigned int, void *);
 static int planb_init_done(struct video_device *);
 static int planb_mmap(struct video_device *, const char *, unsigned long);
-static void planb_irq(int, void *);
 static void release_planb(void);
 int init_planbs(struct video_init *);
 
@@ -1315,7 +1314,7 @@ cmd_tab_data_end:
        return c1;
 }
 
-static void planb_irq(int irq, void *dev_id)
+static irqreturn_t planb_irq(int irq, void *dev_id)
 {
        unsigned int stat, astat;
        struct planb *pb = (struct planb *)dev_id;
@@ -1358,13 +1357,14 @@ static void planb_irq(int irq, void *dev_id)
                pb->frame_stat[fr] = GBUFFER_DONE;
                pb->grabbing--;
                wake_up_interruptible(&pb->capq);
-               return;
+               return IRQ_HANDLED;
        }
        /* incorrect interrupts? */
        pb->intr_mask = PLANB_CLR_IRQ;
        out_le32(&pb->planb_base->intr_stat, PLANB_CLR_IRQ);
        printk(KERN_ERR "PlanB: IRQ lockup, cleared intrrupts"
                                                        " unconditionally\n");
+       return IRQ_HANDLED;
 }
 
 /*******************************
@@ -2090,7 +2090,7 @@ static int init_planb(struct planb *pb)
        /* clear interrupt mask */
        pb->intr_mask = PLANB_CLR_IRQ;
 
-       result = request_irq(pb->irq, planb_irq, 0, "PlanB", (void *)pb);
+       result = request_irq(pb->irq, planb_irq, 0, "PlanB", pb);
        if (result < 0) {
                if (result==-EINVAL)
                        printk(KERN_ERR "PlanB: Bad irq number (%d) "
index f569b00201ddb09924e854cf84f4977795fee729..46f156fb108c79ffe2506470b857466f03ea6d10 100644 (file)
@@ -410,7 +410,7 @@ static int parse_mtoken(const char *ptr,unsigned int len,
        int msk;
        *valptr = 0;
        for (idx = 0, msk = 1; valid_bits; idx++, msk <<= 1) {
-               if (!msk & valid_bits) continue;
+               if (!(msk & valid_bits)) continue;
                valid_bits &= ~msk;
                if (!names[idx]) continue;
                slen = strlen(names[idx]);
index ca9e2789c8ca58d5c00988cb56158a4cbffb519b..11b3b2e84b9092da3983fab9ab130a8f485a85d8 100644 (file)
@@ -136,14 +136,13 @@ static int __init pvr_init(void)
 
 static void __exit pvr_exit(void)
 {
-
        pvr2_trace(PVR2_TRACE_INIT,"pvr_exit");
 
+       usb_deregister(&pvr_driver);
+
 #ifdef CONFIG_VIDEO_PVRUSB2_SYSFS
        pvr2_sysfs_class_destroy(class_ptr);
 #endif /* CONFIG_VIDEO_PVRUSB2_SYSFS */
-
-       usb_deregister(&pvr_driver);
 }
 
 module_init(pvr_init);
index 2ee3c3049e8f3dd1a9154821cbfdf1b989305c5d..3c57a7d8200bfd9724c96f50707e217b50fbb4b1 100644 (file)
@@ -905,13 +905,6 @@ struct pvr2_sysfs *pvr2_sysfs_create(struct pvr2_context *mp,
 }
 
 
-static int pvr2_sysfs_hotplug(struct device *d,
-                             struct kobj_uevent_env *env)
-{
-       /* Even though we don't do anything here, we still need this function
-          because sysfs will still try to call it. */
-       return 0;
-}
 
 struct pvr2_sysfs_class *pvr2_sysfs_class_create(void)
 {
@@ -922,7 +915,6 @@ struct pvr2_sysfs_class *pvr2_sysfs_class_create(void)
        clp->class.name = "pvrusb2";
        clp->class.class_release = pvr2_sysfs_class_release;
        clp->class.dev_release = pvr2_sysfs_release;
-       clp->class.dev_uevent = pvr2_sysfs_hotplug;
        if (class_register(&clp->class)) {
                pvr2_sysfs_trace(
                        "Registration failed for pvr2_sysfs_class id=%p",clp);
index d6d8d660196d992c6fad885c30fb7c7b0661eda5..3aa8cb2b860ae3d570ca051a275cea1bff9942e2 100644 (file)
@@ -1,6 +1,6 @@
 config VIDEO_SAA7134
        tristate "Philips SAA7134 support"
-       depends on VIDEO_DEV && PCI && I2C
+       depends on VIDEO_DEV && PCI && I2C && INPUT
        select VIDEOBUF_DMA_SG
        select VIDEO_IR
        select VIDEO_TUNER
index c6f7279669c184257dbcd8961478edced7f1627f..b9c5cf7dc849224c1cfcd83da1f20ff074a29e1c 100644 (file)
@@ -543,8 +543,10 @@ static int snd_card_saa7134_hw_params(struct snd_pcm_substream * substream,
           V4L functions, and force ALSA to use that as the DMA area */
 
        substream->runtime->dma_area = dev->dmasound.dma.vmalloc;
+       substream->runtime->dma_bytes = dev->dmasound.bufsize;
+       substream->runtime->dma_addr = 0;
 
-       return 1;
+       return 0;
 
 }
 
@@ -651,6 +653,17 @@ static int snd_card_saa7134_capture_open(struct snd_pcm_substream * substream)
        return 0;
 }
 
+/*
+ * page callback (needed for mmap)
+ */
+
+static struct page *snd_card_saa7134_page(struct snd_pcm_substream *substream,
+                                       unsigned long offset)
+{
+       void *pageptr = substream->runtime->dma_area + offset;
+       return vmalloc_to_page(pageptr);
+}
+
 /*
  * ALSA capture callbacks definition
  */
@@ -664,6 +677,7 @@ static struct snd_pcm_ops snd_card_saa7134_capture_ops = {
        .prepare =              snd_card_saa7134_capture_prepare,
        .trigger =              snd_card_saa7134_capture_trigger,
        .pointer =              snd_card_saa7134_capture_pointer,
+       .page =                 snd_card_saa7134_page,
 };
 
 /*
index a4c192fb4e41172cb97e7a8104aecdda16341d74..4f3dad9ae6d6a3193434ee9ccfabad677b2791e1 100644 (file)
@@ -2996,11 +2996,11 @@ struct saa7134_board saa7134_boards[] = {
                },{
                        .name   = name_comp1,
                        .vmux   = 0,
-                       .amux   = LINE2,
+                       .amux   = LINE1,
                },{
                        .name   = name_svideo,
                        .vmux   = 8,
-                       .amux   = LINE2,
+                       .amux   = LINE1,
                }},
        },
        [SAA7134_BOARD_FLYDVBS_LR300] = {
index 6a777604f0708d36570a74fd96c704ec71fa3733..9e99f3636d3dc36a407f46007486b8fe7af252b2 100644 (file)
@@ -30,7 +30,7 @@
 
 /* standard i2c insmod options */
 static unsigned short normal_i2c[] = {
-#ifdef CONFIG_TUNER_TEA5761
+#if defined(CONFIG_TUNER_TEA5761) || (defined(CONFIG_TUNER_TEA5761_MODULE) && defined(MODULE))
        0x10,
 #endif
        0x42, 0x43, 0x4a, 0x4b,                 /* tda8290 */
@@ -292,7 +292,6 @@ static void set_type(struct i2c_client *c, unsigned int type,
                }
                t->mode_mask = T_RADIO;
                break;
-#ifdef CONFIG_TUNER_TEA5761
        case TUNER_TEA5761:
                if (tea5761_attach(&t->fe, t->i2c.adapter, t->i2c.addr) == NULL) {
                        t->type = TUNER_ABSENT;
@@ -301,7 +300,6 @@ static void set_type(struct i2c_client *c, unsigned int type,
                }
                t->mode_mask = T_RADIO;
                break;
-#endif
        case TUNER_PHILIPS_FMD1216ME_MK3:
                buffer[0] = 0x0b;
                buffer[1] = 0xdc;
@@ -594,7 +592,6 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind)
        /* autodetection code based on the i2c addr */
        if (!no_autodetect) {
                switch (addr) {
-#ifdef CONFIG_TUNER_TEA5761
                case 0x10:
                        if (tea5761_autodetection(t->i2c.adapter, t->i2c.addr) != EINVAL) {
                                t->type = TUNER_TEA5761;
@@ -606,7 +603,6 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind)
                                goto register_client;
                        }
                        break;
-#endif
                case 0x42:
                case 0x43:
                case 0x4a:
index e2f1c972754bc56487222b023c2a63b5d914d4bf..25d0aef88ef51392c69e15992cbc0fbcb93414f9 100644 (file)
@@ -799,10 +799,10 @@ static inline void tvp5150_reset(struct i2c_client *c)
        tvp5150_write_inittab(c, tvp5150_init_enable);
 
        /* Initialize image preferences */
-       tvp5150_write(c, TVP5150_BRIGHT_CTL, decoder->bright >> 8);
-       tvp5150_write(c, TVP5150_CONTRAST_CTL, decoder->contrast >> 8);
-       tvp5150_write(c, TVP5150_SATURATION_CTL, decoder->contrast >> 8);
-       tvp5150_write(c, TVP5150_HUE_CTL, (decoder->hue - 32768) >> 8);
+       tvp5150_write(c, TVP5150_BRIGHT_CTL, decoder->bright);
+       tvp5150_write(c, TVP5150_CONTRAST_CTL, decoder->contrast);
+       tvp5150_write(c, TVP5150_SATURATION_CTL, decoder->contrast);
+       tvp5150_write(c, TVP5150_HUE_CTL, decoder->hue);
 
        tvp5150_set_std(c, decoder->norm);
 };
@@ -1077,10 +1077,10 @@ static int tvp5150_detect_client(struct i2c_adapter *adapter,
        core->norm = V4L2_STD_ALL;      /* Default is autodetect */
        core->route.input = TVP5150_COMPOSITE1;
        core->enable = 1;
-       core->bright = 32768;
-       core->contrast = 32768;
-       core->hue = 32768;
-       core->sat = 32768;
+       core->bright = 128;
+       core->contrast = 128;
+       core->hue = 0;
+       core->sat = 128;
 
        if (rv) {
                kfree(c);
index 682406168de9fca39e8581cdaca638019c9ad5da..e4ad7a1c4fbddaae4670478162728f6dbdff4c17 100644 (file)
@@ -1077,8 +1077,8 @@ static int i2o_block_probe(struct device *dev)
        blk_queue_max_sectors(queue, max_sectors);
        blk_queue_max_hw_segments(queue, i2o_sg_tablesize(c, body_size));
 
-       osm_debug("max sectors = %d\n", queue->max_phys_segments);
-       osm_debug("phys segments = %d\n", queue->max_sectors);
+       osm_debug("max sectors = %d\n", queue->max_sectors);
+       osm_debug("phys segments = %d\n", queue->max_phys_segments);
        osm_debug("max hw segments = %d\n", queue->max_hw_segments);
 
        /*
index d366a6cc1fd94807db5f6a50311324423d5fdf81..c8d62c268b11729dd2916105d26a8105fd01c905 100644 (file)
@@ -122,9 +122,6 @@ static int get_lcd_level(void)
        else
                fujitsu->brightness_changed = 0;
 
-       if (status < 0)
-               return status;
-
        return fujitsu->brightness_level;
 }
 
@@ -198,7 +195,7 @@ static struct platform_driver fujitsupf_driver = {
 
 /* ACPI device */
 
-int acpi_fujitsu_add(struct acpi_device *device)
+static int acpi_fujitsu_add(struct acpi_device *device)
 {
        int result = 0;
        int state = 0;
@@ -229,7 +226,7 @@ int acpi_fujitsu_add(struct acpi_device *device)
        return result;
 }
 
-int acpi_fujitsu_remove(struct acpi_device *device, int type)
+static int acpi_fujitsu_remove(struct acpi_device *device, int type)
 {
        ACPI_FUNCTION_TRACE("acpi_fujitsu_remove");
 
index 6a5a05d1f3923d81ee54ce2df63a0e2fca7f4d37..05172d2613d66d3f980c2b2c148bd40992c4e64d 100644 (file)
@@ -244,10 +244,11 @@ ioc4_variant(struct ioc4_driver_data *idd)
                    idd->idd_pdev->bus->number == pdev->bus->number &&
                    3 == PCI_SLOT(pdev->devfn))
                        found = 1;
-               pci_dev_put(pdev);
        } while (pdev && !found);
-       if (NULL != pdev)
+       if (NULL != pdev) {
+               pci_dev_put(pdev);
                return IOC4_VARIANT_IO9;
+       }
 
        /* IO10: Look for a Vitesse VSC 7174 at the same bus and slot 3. */
        pdev = NULL;
@@ -258,10 +259,11 @@ ioc4_variant(struct ioc4_driver_data *idd)
                    idd->idd_pdev->bus->number == pdev->bus->number &&
                    3 == PCI_SLOT(pdev->devfn))
                        found = 1;
-               pci_dev_put(pdev);
        } while (pdev && !found);
-       if (NULL != pdev)
+       if (NULL != pdev) {
+               pci_dev_put(pdev);
                return IOC4_VARIANT_IO10;
+       }
 
        /* PCI-RT: No SCSI/SATA controller will be present */
        return IOC4_VARIANT_PCI_RT;
index e953276664a0f77aef6a0a997452488d75a294c3..ab23a3221585302fec8a33d79ceade142b93f7dc 100644 (file)
@@ -21,7 +21,7 @@
  *  02110-1301, USA.
  */
 
-#define IBM_VERSION "0.16"
+#define IBM_VERSION "0.17"
 #define TPACPI_SYSFS_VERSION 0x020000
 
 /*
@@ -964,15 +964,15 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
                KEY_UNKNOWN,    /* 0x0C: FN+BACKSPACE */
                KEY_UNKNOWN,    /* 0x0D: FN+INSERT */
                KEY_UNKNOWN,    /* 0x0E: FN+DELETE */
-               KEY_BRIGHTNESSUP,       /* 0x0F: FN+HOME (brightness up) */
+               KEY_RESERVED,   /* 0x0F: FN+HOME (brightness up) */
                /* Scan codes 0x10 to 0x1F: Extended ACPI HKEY hot keys */
-               KEY_BRIGHTNESSDOWN,     /* 0x10: FN+END (brightness down) */
+               KEY_RESERVED,   /* 0x10: FN+END (brightness down) */
                KEY_RESERVED,   /* 0x11: FN+PGUP (thinklight toggle) */
                KEY_UNKNOWN,    /* 0x12: FN+PGDOWN */
                KEY_ZOOM,       /* 0x13: FN+SPACE (zoom) */
-               KEY_VOLUMEUP,   /* 0x14: VOLUME UP */
-               KEY_VOLUMEDOWN, /* 0x15: VOLUME DOWN */
-               KEY_MUTE,       /* 0x16: MUTE */
+               KEY_RESERVED,   /* 0x14: VOLUME UP */
+               KEY_RESERVED,   /* 0x15: VOLUME DOWN */
+               KEY_RESERVED,   /* 0x16: MUTE */
                KEY_VENDOR,     /* 0x17: Thinkpad/AccessIBM/Lenovo */
                /* (assignments unknown, please report if found) */
                KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN,
@@ -993,9 +993,9 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
                KEY_RESERVED,   /* 0x11: FN+PGUP (thinklight toggle) */
                KEY_UNKNOWN,    /* 0x12: FN+PGDOWN */
                KEY_ZOOM,       /* 0x13: FN+SPACE (zoom) */
-               KEY_VOLUMEUP,   /* 0x14: VOLUME UP */
-               KEY_VOLUMEDOWN, /* 0x15: VOLUME DOWN */
-               KEY_MUTE,       /* 0x16: MUTE */
+               KEY_RESERVED,   /* 0x14: VOLUME UP */
+               KEY_RESERVED,   /* 0x15: VOLUME DOWN */
+               KEY_RESERVED,   /* 0x16: MUTE */
                KEY_VENDOR,     /* 0x17: Thinkpad/AccessIBM/Lenovo */
                /* (assignments unknown, please report if found) */
                KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN,
@@ -1342,9 +1342,8 @@ static int hotkey_read(char *p)
                return len;
        }
 
-       res = mutex_lock_interruptible(&hotkey_mutex);
-       if (res < 0)
-               return res;
+       if (mutex_lock_interruptible(&hotkey_mutex))
+               return -ERESTARTSYS;
        res = hotkey_get(&status, &mask);
        mutex_unlock(&hotkey_mutex);
        if (res)
@@ -1373,9 +1372,8 @@ static int hotkey_write(char *buf)
        if (!tp_features.hotkey)
                return -ENODEV;
 
-       res = mutex_lock_interruptible(&hotkey_mutex);
-       if (res < 0)
-               return res;
+       if (mutex_lock_interruptible(&hotkey_mutex))
+               return -ERESTARTSYS;
 
        res = hotkey_get(&status, &mask);
        if (res)
@@ -3114,6 +3112,99 @@ static struct backlight_ops ibm_backlight_data = {
 
 static struct mutex brightness_mutex;
 
+static int __init tpacpi_query_bcll_levels(acpi_handle handle)
+{
+       struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
+       union acpi_object *obj;
+       int rc;
+
+       if (ACPI_SUCCESS(acpi_evaluate_object(handle, NULL, NULL, &buffer))) {
+               obj = (union acpi_object *)buffer.pointer;
+               if (!obj || (obj->type != ACPI_TYPE_PACKAGE)) {
+                       printk(IBM_ERR "Unknown BCLL data, "
+                              "please report this to %s\n", IBM_MAIL);
+                       rc = 0;
+               } else {
+                       rc = obj->package.count;
+               }
+       } else {
+               return 0;
+       }
+
+       kfree(buffer.pointer);
+       return rc;
+}
+
+static acpi_status __init brightness_find_bcll(acpi_handle handle, u32 lvl,
+                                       void *context, void **rv)
+{
+       char name[ACPI_PATH_SEGMENT_LENGTH];
+       struct acpi_buffer buffer = { sizeof(name), &name };
+
+       if (ACPI_SUCCESS(acpi_get_name(handle, ACPI_SINGLE_NAME, &buffer)) &&
+           !strncmp("BCLL", name, sizeof(name) - 1)) {
+               if (tpacpi_query_bcll_levels(handle) == 16) {
+                       *rv = handle;
+                       return AE_CTRL_TERMINATE;
+               } else {
+                       return AE_OK;
+               }
+       } else {
+               return AE_OK;
+       }
+}
+
+static int __init brightness_check_levels(void)
+{
+       int status;
+       void *found_node = NULL;
+
+       if (!vid_handle) {
+               IBM_ACPIHANDLE_INIT(vid);
+       }
+       if (!vid_handle)
+               return 0;
+
+       /* Search for a BCLL package with 16 levels */
+       status = acpi_walk_namespace(ACPI_TYPE_PACKAGE, vid_handle, 3,
+                                       brightness_find_bcll, NULL, &found_node);
+
+       return (ACPI_SUCCESS(status) && found_node != NULL);
+}
+
+static acpi_status __init brightness_find_bcl(acpi_handle handle, u32 lvl,
+                                       void *context, void **rv)
+{
+       char name[ACPI_PATH_SEGMENT_LENGTH];
+       struct acpi_buffer buffer = { sizeof(name), &name };
+
+       if (ACPI_SUCCESS(acpi_get_name(handle, ACPI_SINGLE_NAME, &buffer)) &&
+           !strncmp("_BCL", name, sizeof(name) - 1)) {
+               *rv = handle;
+               return AE_CTRL_TERMINATE;
+       } else {
+               return AE_OK;
+       }
+}
+
+static int __init brightness_check_std_acpi_support(void)
+{
+       int status;
+       void *found_node = NULL;
+
+       if (!vid_handle) {
+               IBM_ACPIHANDLE_INIT(vid);
+       }
+       if (!vid_handle)
+               return 0;
+
+       /* Search for a _BCL method, but don't execute it */
+       status = acpi_walk_namespace(ACPI_TYPE_METHOD, vid_handle, 3,
+                                    brightness_find_bcl, NULL, &found_node);
+
+       return (ACPI_SUCCESS(status) && found_node != NULL);
+}
+
 static int __init brightness_init(struct ibm_init_struct *iibm)
 {
        int b;
@@ -3122,6 +3213,18 @@ static int __init brightness_init(struct ibm_init_struct *iibm)
 
        mutex_init(&brightness_mutex);
 
+       if (!brightness_enable) {
+               dbg_printk(TPACPI_DBG_INIT,
+                          "brightness support disabled by module parameter\n");
+               return 1;
+       } else if (brightness_enable > 1) {
+               if (brightness_check_std_acpi_support()) {
+                       printk(IBM_NOTICE
+                              "standard ACPI backlight interface available, not loading native one...\n");
+                       return 1;
+               }
+       }
+
        if (!brightness_mode) {
                if (thinkpad_id.vendor == PCI_VENDOR_ID_LENOVO)
                        brightness_mode = 2;
@@ -3135,10 +3238,17 @@ static int __init brightness_init(struct ibm_init_struct *iibm)
        if (brightness_mode > 3)
                return -EINVAL;
 
+       tp_features.bright_16levels =
+                       thinkpad_id.vendor == PCI_VENDOR_ID_LENOVO &&
+                       brightness_check_levels();
+
        b = brightness_get(NULL);
        if (b < 0)
                return 1;
 
+       if (tp_features.bright_16levels)
+               printk(IBM_INFO "detected a 16-level brightness capable ThinkPad\n");
+
        ibm_backlight_device = backlight_device_register(
                                        TPACPI_BACKLIGHT_DEV_NAME, NULL, NULL,
                                        &ibm_backlight_data);
@@ -3148,7 +3258,8 @@ static int __init brightness_init(struct ibm_init_struct *iibm)
        }
        vdbg_printk(TPACPI_DBG_INIT, "brightness is supported\n");
 
-       ibm_backlight_device->props.max_brightness = 7;
+       ibm_backlight_device->props.max_brightness =
+                               (tp_features.bright_16levels)? 15 : 7;
        ibm_backlight_device->props.brightness = b;
        backlight_update_status(ibm_backlight_device);
 
@@ -3167,6 +3278,8 @@ static void brightness_exit(void)
 
 static int brightness_update_status(struct backlight_device *bd)
 {
+       /* it is the backlight class's job (caller) to handle
+        * EINTR and other errors properly */
        return brightness_set(
                (bd->props.fb_blank == FB_BLANK_UNBLANK &&
                 bd->props.power == FB_BLANK_UNBLANK) ?
@@ -3184,13 +3297,14 @@ static int brightness_get(struct backlight_device *bd)
        if (brightness_mode & 1) {
                if (!acpi_ec_read(brightness_offset, &lec))
                        return -EIO;
-               lec &= 7;
+               lec &= (tp_features.bright_16levels)? 0x0f : 0x07;
                level = lec;
        };
        if (brightness_mode & 2) {
                lcmos = (nvram_read_byte(TP_NVRAM_ADDR_BRIGHTNESS)
                         & TP_NVRAM_MASK_LEVEL_BRIGHTNESS)
                        >> TP_NVRAM_POS_LEVEL_BRIGHTNESS;
+               lcmos &= (tp_features.bright_16levels)? 0x0f : 0x07;
                level = lcmos;
        }
 
@@ -3206,12 +3320,13 @@ static int brightness_get(struct backlight_device *bd)
        return level;
 }
 
+/* May return EINTR which can always be mapped to ERESTARTSYS */
 static int brightness_set(int value)
 {
        int cmos_cmd, inc, i, res;
        int current_value;
 
-       if (value > 7)
+       if (value > ((tp_features.bright_16levels)? 15 : 7))
                return -EINVAL;
 
        res = mutex_lock_interruptible(&brightness_mutex);
@@ -3227,7 +3342,7 @@ static int brightness_set(int value)
        cmos_cmd = value > current_value ?
                        TP_CMOS_BRIGHTNESS_UP :
                        TP_CMOS_BRIGHTNESS_DOWN;
-       inc = value > current_value ? 1 : -1;
+       inc = (value > current_value)? 1 : -1;
 
        res = 0;
        for (i = current_value; i != value; i += inc) {
@@ -3256,10 +3371,11 @@ static int brightness_read(char *p)
        if ((level = brightness_get(NULL)) < 0) {
                len += sprintf(p + len, "level:\t\tunreadable\n");
        } else {
-               len += sprintf(p + len, "level:\t\t%d\n", level & 0x7);
+               len += sprintf(p + len, "level:\t\t%d\n", level);
                len += sprintf(p + len, "commands:\tup, down\n");
                len += sprintf(p + len, "commands:\tlevel <level>"
-                              " (<level> is 0-7)\n");
+                              " (<level> is 0-%d)\n",
+                              (tp_features.bright_16levels) ? 15 : 7);
        }
 
        return len;
@@ -3268,28 +3384,34 @@ static int brightness_read(char *p)
 static int brightness_write(char *buf)
 {
        int level;
-       int new_level;
+       int rc;
        char *cmd;
+       int max_level = (tp_features.bright_16levels) ? 15 : 7;
 
-       while ((cmd = next_cmd(&buf))) {
-               if ((level = brightness_get(NULL)) < 0)
-                       return level;
-               level &= 7;
+       level = brightness_get(NULL);
+       if (level < 0)
+               return level;
 
+       while ((cmd = next_cmd(&buf))) {
                if (strlencmp(cmd, "up") == 0) {
-                       new_level = level == 7 ? 7 : level + 1;
+                       if (level < max_level)
+                               level++;
                } else if (strlencmp(cmd, "down") == 0) {
-                       new_level = level == 0 ? 0 : level - 1;
-               } else if (sscanf(cmd, "level %d", &new_level) == 1 &&
-                          new_level >= 0 && new_level <= 7) {
-                       /* new_level set */
+                       if (level > 0)
+                               level--;
+               } else if (sscanf(cmd, "level %d", &level) == 1 &&
+                          level >= 0 && level <= max_level) {
+                       /* new level set */
                } else
                        return -EINVAL;
-
-               brightness_set(new_level);
        }
 
-       return 0;
+       /*
+        * Now we know what the final level should be, so we try to set it.
+        * Doing it this way makes the syscall restartable in case of EINTR
+        */
+       rc = brightness_set(level);
+       return (rc == -EINTR)? ERESTARTSYS : rc;
 }
 
 static struct ibm_struct brightness_driver_data = {
@@ -3652,9 +3774,8 @@ static ssize_t fan_pwm1_store(struct device *dev,
        /* scale down from 0-255 to 0-7 */
        newlevel = (s >> 5) & 0x07;
 
-       rc = mutex_lock_interruptible(&fan_mutex);
-       if (rc < 0)
-               return rc;
+       if (mutex_lock_interruptible(&fan_mutex))
+               return -ERESTARTSYS;
 
        rc = fan_get_status(&status);
        if (!rc && (status &
@@ -3904,9 +4025,8 @@ static int fan_get_status_safe(u8 *status)
        int rc;
        u8 s;
 
-       rc = mutex_lock_interruptible(&fan_mutex);
-       if (rc < 0)
-               return rc;
+       if (mutex_lock_interruptible(&fan_mutex))
+               return -ERESTARTSYS;
        rc = fan_get_status(&s);
        if (!rc)
                fan_update_desired_level(s);
@@ -4040,9 +4160,8 @@ static int fan_set_level_safe(int level)
        if (!fan_control_allowed)
                return -EPERM;
 
-       rc = mutex_lock_interruptible(&fan_mutex);
-       if (rc < 0)
-               return rc;
+       if (mutex_lock_interruptible(&fan_mutex))
+               return -ERESTARTSYS;
 
        if (level == TPACPI_FAN_LAST_LEVEL)
                level = fan_control_desired_level;
@@ -4063,9 +4182,8 @@ static int fan_set_enable(void)
        if (!fan_control_allowed)
                return -EPERM;
 
-       rc = mutex_lock_interruptible(&fan_mutex);
-       if (rc < 0)
-               return rc;
+       if (mutex_lock_interruptible(&fan_mutex))
+               return -ERESTARTSYS;
 
        switch (fan_control_access_mode) {
        case TPACPI_FAN_WR_ACPI_FANS:
@@ -4119,9 +4237,8 @@ static int fan_set_disable(void)
        if (!fan_control_allowed)
                return -EPERM;
 
-       rc = mutex_lock_interruptible(&fan_mutex);
-       if (rc < 0)
-               return rc;
+       if (mutex_lock_interruptible(&fan_mutex))
+               return -ERESTARTSYS;
 
        rc = 0;
        switch (fan_control_access_mode) {
@@ -4158,9 +4275,8 @@ static int fan_set_speed(int speed)
        if (!fan_control_allowed)
                return -EPERM;
 
-       rc = mutex_lock_interruptible(&fan_mutex);
-       if (rc < 0)
-               return rc;
+       if (mutex_lock_interruptible(&fan_mutex))
+               return -ERESTARTSYS;
 
        rc = 0;
        switch (fan_control_access_mode) {
@@ -4701,9 +4817,15 @@ static int __init set_ibm_param(const char *val, struct kernel_param *kp)
        unsigned int i;
        struct ibm_struct *ibm;
 
+       if (!kp || !kp->name || !val)
+               return -EINVAL;
+
        for (i = 0; i < ARRAY_SIZE(ibms_init); i++) {
                ibm = ibms_init[i].data;
-               BUG_ON(ibm == NULL);
+               WARN_ON(ibm == NULL);
+
+               if (!ibm || !ibm->name)
+                       continue;
 
                if (strcmp(ibm->name, kp->name) == 0 && ibm->write) {
                        if (strlen(val) > sizeof(ibms_init[i].param) - 2)
@@ -4732,6 +4854,9 @@ module_param_named(fan_control, fan_control_allowed, bool, 0);
 static int brightness_mode;
 module_param_named(brightness_mode, brightness_mode, int, 0);
 
+static unsigned int brightness_enable = 2; /* 2 = auto, 0 = no, 1 = yes */
+module_param(brightness_enable, uint, 0);
+
 static unsigned int hotkey_report_mode;
 module_param(hotkey_report_mode, uint, 0);
 
index 3abcc812063433e664a23df7d5275918d6906351..8fba2bbe345ee3ad46808d7e522058d2983e8a97 100644 (file)
@@ -84,7 +84,7 @@
 
 /* ThinkPad CMOS NVRAM constants */
 #define TP_NVRAM_ADDR_BRIGHTNESS       0x5e
-#define TP_NVRAM_MASK_LEVEL_BRIGHTNESS 0x07
+#define TP_NVRAM_MASK_LEVEL_BRIGHTNESS 0x0f
 #define TP_NVRAM_POS_LEVEL_BRIGHTNESS 0
 
 #define onoff(status,bit) ((status) & (1 << (bit)) ? "on" : "off")
@@ -246,6 +246,7 @@ static struct {
        u32 hotkey_wlsw:1;
        u32 light:1;
        u32 light_status:1;
+       u32 bright_16levels:1;
        u32 wan:1;
        u32 fan_ctrl_status_undef:1;
        u32 input_device_registered:1;
@@ -338,6 +339,7 @@ static int bluetooth_write(char *buf);
 static struct backlight_device *ibm_backlight_device;
 static int brightness_offset = 0x31;
 static int brightness_mode;
+static unsigned int brightness_enable; /* 0 = no, 1 = yes, 2 = auto */
 
 static int brightness_init(struct ibm_init_struct *iibm);
 static void brightness_exit(void);
index e38d5a3b2a899d6f9988e12ad294bf47862959c6..aeb32a93f6a08f1379c17914ec067260933a555a 100644 (file)
@@ -44,6 +44,9 @@
  * max 8 partitions per card
  */
 #define MMC_SHIFT      3
+#define MMC_NUM_MINORS (256 >> MMC_SHIFT)
+
+static unsigned long dev_use[MMC_NUM_MINORS/(8*sizeof(unsigned long))];
 
 /*
  * There is one mmc_blk_data per slot.
@@ -80,6 +83,9 @@ static void mmc_blk_put(struct mmc_blk_data *md)
        mutex_lock(&open_lock);
        md->usage--;
        if (md->usage == 0) {
+               int devidx = md->disk->first_minor >> MMC_SHIFT;
+               __clear_bit(devidx, dev_use);
+
                put_disk(md->disk);
                kfree(md);
        }
@@ -321,7 +327,13 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
                                               req->rq_disk->disk_name, err);
                                        goto cmd_err;
                                }
-                       } while (!(cmd.resp[0] & R1_READY_FOR_DATA));
+                               /*
+                                * Some cards mishandle the status bits,
+                                * so make sure to check both the busy
+                                * indication and the card state.
+                                */
+                       } while (!(cmd.resp[0] & R1_READY_FOR_DATA) ||
+                               (R1_CURRENT_STATE(cmd.resp[0]) == 7));
 
 #if 0
                        if (cmd.resp[0] & ~0x00000900)
@@ -400,9 +412,6 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
        return 0;
 }
 
-#define MMC_NUM_MINORS (256 >> MMC_SHIFT)
-
-static unsigned long dev_use[MMC_NUM_MINORS/(8*sizeof(unsigned long))];
 
 static inline int mmc_blk_readonly(struct mmc_card *card)
 {
@@ -568,17 +577,12 @@ static void mmc_blk_remove(struct mmc_card *card)
        struct mmc_blk_data *md = mmc_get_drvdata(card);
 
        if (md) {
-               int devidx;
-
                /* Stop new requests from getting into the queue */
                del_gendisk(md->disk);
 
                /* Then flush out any already in there */
                mmc_cleanup_queue(&md->queue);
 
-               devidx = md->disk->first_minor >> MMC_SHIFT;
-               __clear_bit(devidx, dev_use);
-
                mmc_blk_put(md);
        }
        mmc_set_drvdata(card, NULL);
index 9203a0b221b3364b47531f0af4e963e23e17a49d..1b9c9b6da5b7349b39148129c7a6ce4a709e7717 100644 (file)
@@ -310,7 +310,7 @@ static void copy_sg(struct scatterlist *dst, unsigned int dst_len,
                }
 
                if (src_size == 0) {
-                       src_buf = sg_virt(dst);
+                       src_buf = sg_virt(src);
                        src_size = src->length;
                }
 
index 09435e0ec6806fa4771fb616227413bbc5c2dd33..b96667448eb5618ffcfae4e02e15cfaeca52146f 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/pagemap.h>
 #include <linux/err.h>
 #include <linux/leds.h>
-#include <asm/scatterlist.h>
 #include <linux/scatterlist.h>
 
 #include <linux/mmc/card.h>
index 7471d49909b25fbad327cf67a41aed52b6433fbb..64b05c6270f2f3aef54d88e309f8772694c4347a 100644 (file)
@@ -10,7 +10,6 @@
  */
 
 #include <linux/types.h>
-#include <asm/scatterlist.h>
 #include <linux/scatterlist.h>
 
 #include <linux/mmc/host.h>
index a6dafe62b992416f00c776f61312c1c9a00b61df..0d96080d44b098431af53b15764c0f8e6fdd1e81 100644 (file)
@@ -10,7 +10,6 @@
  */
 
 #include <linux/types.h>
-#include <asm/scatterlist.h>
 #include <linux/scatterlist.h>
 
 #include <linux/mmc/host.h>
index 4d289b2750317b32f4a5a08d2ef0fb33a789cf3e..e1fca588e3853b5a10c477b6bd55ee7078fd19b8 100644 (file)
@@ -9,7 +9,6 @@
  * your option) any later version.
  */
 
-#include <asm/scatterlist.h>
 #include <linux/scatterlist.h>
 
 #include <linux/mmc/host.h>
index b2104d4f87afec75d07768874c9184dcbc33033c..c3926eb3bf439eedd470c8cc98864aed28b7fd32 100644 (file)
@@ -40,7 +40,7 @@
 #include <linux/mm.h>
 #include <linux/interrupt.h>
 #include <linux/dma-mapping.h>
-#include <scatterlist/scatterlist.h>
+#include <linux/scatterlist.h>
 
 #include <linux/mmc/host.h>
 #include <asm/io.h>
index fc72e1fadb6adf291356e796d16cc3e036d764c5..f2070a19cfa77fe25ff57aad4d60d54a90864a27 100644 (file)
@@ -262,7 +262,7 @@ static void imxmci_setup_data(struct imxmci_host *host, struct mmc_data *data)
                }
 
                /* Convert back to virtual address */
-               host->data_ptr = (u16*)sg_virt(sg);
+               host->data_ptr = (u16*)sg_virt(data->sg);
                host->data_cnt = 0;
 
                clear_bit(IMXMCI_PEND_DMA_DATA_b, &host->pending_events);
index a25ee71998a9090393b4e20653d90cbed53ab71b..1654a3330340a2bfdfb1fd740d15ed4af0e76f95 100644 (file)
@@ -39,6 +39,7 @@
 #define DRIVER_NAME    "pxa2xx-mci"
 
 #define NR_SG  1
+#define CLKRT_OFF      (~0)
 
 struct pxamci_host {
        struct mmc_host         *mmc;
@@ -371,6 +372,9 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
                unsigned long rate = host->clkrate;
                unsigned int clk = rate / ios->clock;
 
+               if (host->clkrt == CLKRT_OFF)
+                       clk_enable(host->clk);
+
                /*
                 * clk might result in a lower divisor than we
                 * desire.  check for that condition and adjust
@@ -379,14 +383,16 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
                if (rate / clk > ios->clock)
                        clk <<= 1;
                host->clkrt = fls(clk) - 1;
-               clk_enable(host->clk);
 
                /*
                 * we write clkrt on the next command
                 */
        } else {
                pxamci_stop_clock(host);
-               clk_disable(host->clk);
+               if (host->clkrt != CLKRT_OFF) {
+                       host->clkrt = CLKRT_OFF;
+                       clk_disable(host->clk);
+               }
        }
 
        if (host->power_mode != ios->power_mode) {
@@ -498,6 +504,7 @@ static int pxamci_probe(struct platform_device *pdev)
        host->mmc = mmc;
        host->dma = -1;
        host->pdata = pdev->dev.platform_data;
+       host->clkrt = CLKRT_OFF;
 
        host->clk = clk_get(&pdev->dev, "MMCCLK");
        if (IS_ERR(host->clk)) {
index 6b80bf77a4efda8f0738bc9e1c1a56df4b0a839e..ff59d2e0475bfe620bb71dca843219bd76cf79f9 100644 (file)
@@ -1301,7 +1301,7 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
 
        if ((chip->quirks & SDHCI_QUIRK_BROKEN_DMA) &&
                (host->flags & SDHCI_USE_DMA)) {
-               DBG("Disabling DMA as it is marked broken");
+               DBG("Disabling DMA as it is marked broken\n");
                host->flags &= ~SDHCI_USE_DMA;
        }
 
index c11a3d25605141a2f8017e24055984fb2b8d2160..20d5c7bd940a7c48eaa42b8af06484d918e6e6b8 100644 (file)
@@ -16,7 +16,6 @@
 #include <linux/mmc/host.h>
 #include <linux/highmem.h>
 #include <linux/scatterlist.h>
-#include <linux/log2.h>
 #include <asm/io.h>
 
 #define DRIVER_NAME "tifm_sd"
@@ -638,17 +637,15 @@ static void tifm_sd_request(struct mmc_host *mmc, struct mmc_request *mrq)
                goto err_out;
        }
 
-       if (mrq->data && !is_power_of_2(mrq->data->blksz)) {
-               printk(KERN_ERR "%s: Unsupported block size (%d bytes)\n",
-                       sock->dev.bus_id, mrq->data->blksz);
-               mrq->cmd->error = -EINVAL;
-               goto err_out;
-       }
-
        host->cmd_flags = 0;
        host->block_pos = 0;
        host->sg_pos = 0;
 
+       if (mrq->data && !is_power_of_2(mrq->data->blksz))
+               host->no_dma = 1;
+       else
+               host->no_dma = no_dma ? 1 : 0;
+
        if (r_data) {
                tifm_sd_set_data_timeout(host, r_data);
 
@@ -676,7 +673,7 @@ static void tifm_sd_request(struct mmc_host *mmc, struct mmc_request *mrq)
                                            : PCI_DMA_FROMDEVICE)) {
                                printk(KERN_ERR "%s : scatterlist map failed\n",
                                       sock->dev.bus_id);
-                               spin_unlock_irqrestore(&sock->lock, flags);
+                               mrq->cmd->error = -ENOMEM;
                                goto err_out;
                        }
                        host->sg_len = tifm_map_sg(sock, r_data->sg,
@@ -692,7 +689,7 @@ static void tifm_sd_request(struct mmc_host *mmc, struct mmc_request *mrq)
                                              r_data->flags & MMC_DATA_WRITE
                                              ? PCI_DMA_TODEVICE
                                              : PCI_DMA_FROMDEVICE);
-                               spin_unlock_irqrestore(&sock->lock, flags);
+                               mrq->cmd->error = -ENOMEM;
                                goto err_out;
                        }
 
@@ -966,7 +963,6 @@ static int tifm_sd_probe(struct tifm_dev *sock)
                return -ENOMEM;
 
        host = mmc_priv(mmc);
-       host->no_dma = no_dma;
        tifm_set_drvdata(sock, mmc);
        host->dev = sock;
        host->timeout_jiffies = msecs_to_jiffies(1000);
index bb30d5be7824c0f51ece10e49b3c5ee9e2ecf807..2797da7eeee665c4c99a3eb9c6ffbc350460e812 100644 (file)
@@ -1192,6 +1192,8 @@ struct net_device * __init i82596_probe(int unit)
                        goto out;
                }
 
+               dev->base_addr = ioaddr;
+
                for (i = 0; i < 8; i++) {
                        eth_addr[i] = inb(ioaddr + 8 + i);
                        checksum += eth_addr[i];
@@ -1209,7 +1211,6 @@ struct net_device * __init i82596_probe(int unit)
                        goto out1;
                }
 
-               dev->base_addr = ioaddr;
                dev->irq = 10;
        }
 #endif
index 86b8641b4664871cbeef5631599765145aeba489..e8d69b0adf90a8efc47adde0b54875b44d19c5eb 100644 (file)
@@ -136,10 +136,11 @@ config TUN
          If you don't know what to use this for, you don't need it.
 
 config VETH
-       tristate "Virtual ethernet device"
+       tristate "Virtual ethernet pair device"
        ---help---
-         The device is an ethernet tunnel. Devices are created in pairs. When
-         one end receives the packet it appears on its pair and vice versa.
+         This device is a local ethernet tunnel. Devices are created in pairs.
+         When one end receives the packet it appears on its pair and vice
+         versa.
 
 config NET_SB1000
        tristate "General Instruments Surfboard 1000"
@@ -166,13 +167,14 @@ config NET_SB1000
          If you don't have this card, of course say N.
 
 config IP1000
-       tristate "IP1000 Gigabit Ethernet support"
-       depends on PCI && EXPERIMENTAL
-       ---help---
-         This driver supports IP1000 gigabit Ethernet cards.
+       tristate "IP1000 Gigabit Ethernet support"
+       depends on PCI && EXPERIMENTAL
+       select MII
+       ---help---
+         This driver supports IP1000 gigabit Ethernet cards.
 
-         To compile this driver as a module, choose M here: the module
-         will be called ipg.  This is recommended.
+         To compile this driver as a module, choose M here: the module
+         will be called ipg.  This is recommended.
 
 source "drivers/net/arcnet/Kconfig"
 
@@ -233,7 +235,7 @@ source "drivers/net/arm/Kconfig"
 
 config AX88796
        tristate "ASIX AX88796 NE2000 clone support"
-       depends on ARM || MIPS
+       depends on ARM || MIPS || SUPERH
        select CRC32
        select MII
        help
@@ -364,8 +366,7 @@ config MAC89x0
          read the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  This module will
+         To compile this driver as a module, choose M here. This module will
          be called mac89x0.
 
 config MACSONIC
@@ -378,8 +379,7 @@ config MACSONIC
          one of these say Y and read the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  This module will
+         To compile this driver as a module, choose M here. This module will
          be called macsonic.
 
 config MACMACE
@@ -617,8 +617,7 @@ config EL1
          have problems.  Some people suggest to ping ("man ping") a nearby
          machine every minute ("man cron") when using this card.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called 3c501.
 
 config EL2
@@ -630,8 +629,7 @@ config EL2
          the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called 3c503.
 
 config ELPLUS
@@ -643,8 +641,7 @@ config ELPLUS
          this type, say Y and read the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called 3c505.
 
 config EL16
@@ -655,8 +652,7 @@ config EL16
          the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called 3c507.
 
 config EL3
@@ -671,8 +667,7 @@ config EL3
          setup disk to disable Plug & Play mode, and to select the default
          media type.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called 3c509.
 
 config 3C515
@@ -683,8 +678,7 @@ config 3C515
          network card, say Y and read the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called 3c515.
 
 config ELMC
@@ -695,8 +689,7 @@ config ELMC
          the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called 3c523.
 
 config ELMC_II
@@ -707,8 +700,7 @@ config ELMC_II
          the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called 3c527.
 
 config VORTEX
@@ -731,8 +723,7 @@ config VORTEX
          <file:Documentation/networking/vortex.txt> and in the comments at
          the beginning of <file:drivers/net/3c59x.c>.
 
-         To compile this support as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.
+         To compile this support as a module, choose M here.
 
 config TYPHOON
        tristate "3cr990 series \"Typhoon\" support"
@@ -749,8 +740,7 @@ config TYPHOON
          the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called typhoon.
 
 config LANCE
@@ -787,8 +777,7 @@ config WD80x3
          the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called wd.
 
 config ULTRAMCA
@@ -800,8 +789,7 @@ config ULTRAMCA
          an MCA based system (PS/2), say Y and read the Ethernet-HOWTO,
          available from <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called smc-mca.
 
 config ULTRA
@@ -820,8 +808,7 @@ config ULTRA
          this but keep it in mind if you have such a SCSI card and have
          problems.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called smc-ultra.
 
 config ULTRA32
@@ -833,8 +820,7 @@ config ULTRA32
          the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called smc-ultra32.
 
 config BFIN_MAC
@@ -895,8 +881,7 @@ config SMC9194
          <file:Documentation/networking/smc9.txt> and the Ethernet-HOWTO,
          available from <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called smc9194.
 
 config SMC91X
@@ -914,8 +899,7 @@ config SMC91X
          This driver is also available as a module ( = code which can be
          inserted in and removed from the running kernel whenever you want).
          The module will be called smc91x.  If you want to compile it as a
-         module, say M here and read <file:Documentation/kbuild/modules.txt>
-         as well as <file:Documentation/networking/net-modules.txt>.
+         module, say M here and read <file:Documentation/kbuild/modules.txt>.
 
 config NET_NETX
        tristate "NetX Ethernet support"
@@ -924,8 +908,7 @@ config NET_NETX
        help
          This is support for the Hilscher netX builtin Ethernet ports
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called netx-eth.
 
 config DM9000
@@ -936,9 +919,8 @@ config DM9000
        ---help---
          Support for DM9000 chipset.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module will be
-         called dm9000.
+         To compile this driver as a module, choose M here.  The module
+         will be called dm9000.
 
 config SMC911X
        tristate "SMSC LAN911[5678] support"
@@ -978,8 +960,7 @@ config NI5010
          <http://www.tldp.org/docs.html#howto>. Note that this is still
          experimental code.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called ni5010.
 
 config NI52
@@ -990,8 +971,7 @@ config NI52
          the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called ni52.
 
 config NI65
@@ -1002,8 +982,7 @@ config NI65
          the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called ni65.
 
 source "drivers/net/tulip/Kconfig"
@@ -1017,8 +996,7 @@ config AT1700
          the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called at1700.
 
 config DEPCA
@@ -1031,8 +1009,7 @@ config DEPCA
          <http://www.tldp.org/docs.html#howto> as well as
          <file:drivers/net/depca.c>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called depca.
 
 config HP100
@@ -1043,8 +1020,7 @@ config HP100
          the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called hp100.
 
 config NET_ISA
@@ -1073,8 +1049,7 @@ config E2100
          the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called e2100.
 
 config EWRK3
@@ -1088,8 +1063,7 @@ config EWRK3
          well as the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called ewrk3.
 
 config EEXPRESS
@@ -1103,8 +1077,7 @@ config EEXPRESS
          because the driver was very unreliable. We now have a new driver
          that should do better.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called eexpress.
 
 config EEXPRESS_PRO
@@ -1117,8 +1090,7 @@ config EEXPRESS_PRO
          driver.  Please read the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called eepro.
 
 config HPLAN_PLUS
@@ -1130,8 +1102,7 @@ config HPLAN_PLUS
          the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called hp-plus.
 
 config HPLAN
@@ -1143,8 +1114,7 @@ config HPLAN
          the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called hp.
 
 config LP486E
@@ -1163,8 +1133,7 @@ config ETH16I
          the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called eth16i.
 
 config NE2000
@@ -1184,8 +1153,7 @@ config NE2000
          laptops), say N here and Y to "NE/2 (ne2000 MCA version) support",
          below.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called ne.
 
 config ZNET
@@ -1206,8 +1174,7 @@ config SEEQ8005
          is for you, read the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called seeq8005.
 
 config NE2_MCA
@@ -1219,8 +1186,7 @@ config NE2_MCA
          the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called ne2.
 
 config IBMLANA
@@ -1231,8 +1197,7 @@ config IBMLANA
          CONFIG_MCA to use this driver.  It is both available as an in-kernel
          driver and as a module.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The only
+         To compile this driver as a module, choose M here. The only
          currently supported card is the IBM LAN Adapter/A for Ethernet.  It
          will both support 16K and 32K memory windows, however a 32K window
          gives a better security against packet losses.  Usage of multiple
@@ -1246,8 +1211,7 @@ config IBMVETH
          This driver supports virtual ethernet adapters on newer IBM iSeries
          and pSeries systems.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module will
+         To compile this driver as a module, choose M here. The module will
          be called ibmveth.
 
 source "drivers/net/ibm_emac/Kconfig"
@@ -1277,8 +1241,7 @@ config PCNET32
          answer Y here and read the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called pcnet32.
 
 config PCNET32_NAPI
@@ -1305,8 +1268,7 @@ config AMD8111_ETH
          answer Y here and read the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called amd8111e.
 
 config AMD8111E_NAPI
@@ -1360,8 +1322,7 @@ config AC3200
          the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called ac3200.
 
 config APRICOT
@@ -1372,9 +1333,8 @@ config APRICOT
          read the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module will be
-         called apricot.
+         To compile this driver as a module, choose M here. The module
+         will be called apricot.
 
 config B44
        tristate "Broadcom 440x/47xx ethernet support"
@@ -1386,9 +1346,8 @@ config B44
          or M and read the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module will be
-         called b44.
+         To compile this driver as a module, choose M here. The module
+         will be called b44.
 
 # Auto-select SSB PCI-HOST support, if possible
 config B44_PCI_AUTOSELECT
@@ -1417,9 +1376,8 @@ config FORCEDETH
          read the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module will be
-         called forcedeth.
+         To compile this driver as a module, choose M here. The module
+         will be called forcedeth.
 
 config FORCEDETH_NAPI
        bool "Use Rx Polling (NAPI) (EXPERIMENTAL)"
@@ -1445,9 +1403,8 @@ config CS89x0
          <http://www.tldp.org/docs.html#howto> as well as
          <file:Documentation/networking/cs89x0.txt>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module will be
-         called cs89x0.
+         To compile this driver as a module, choose M here. The module
+         will be called cs89x0.
 
 config TC35815
        tristate "TOSHIBA TC35815 Ethernet support"
@@ -1463,8 +1420,7 @@ config EEPRO100
          card, say Y and read the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module
+         To compile this driver as a module, choose M here. The module
          will be called eepro100.
 
 
@@ -1491,8 +1447,7 @@ config E100
          More specific information on configuring the driver is in 
          <file:Documentation/networking/e100.txt>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module
+         To compile this driver as a module, choose M here. The module
          will be called e100.
 
 config LNE390
@@ -1504,8 +1459,7 @@ config LNE390
          the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module
+         To compile this driver as a module, choose M here. The module
          will be called lne390.
 
 config FEALNX
@@ -1545,8 +1499,7 @@ config NE2K_PCI
          NetVin NV5000SC   Via 86C926      SureCom NE34   Winbond
          Holtek HT80232    Holtek HT80229
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module
+         To compile this driver as a module, choose M here. The module
          will be called ne2k-pci.
 
 config NE3210
@@ -1559,8 +1512,7 @@ config NE3210
          <http://www.tldp.org/docs.html#howto>.  Note that this driver
          will NOT WORK for NE3200 cards as they are completely different.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module
+         To compile this driver as a module, choose M here. The module
          will be called ne3210.
 
 config ES3210
@@ -1572,8 +1524,7 @@ config ES3210
          the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module
+         To compile this driver as a module, choose M here. The module
          will be called es3210.
 
 config 8139CP
@@ -1703,8 +1654,7 @@ config TLAN
          Compaq NetFlex and Olicom cards.  Please read the file
          <file:Documentation/networking/tlan.txt> for more details.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module
+         To compile this driver as a module, choose M here. The module
          will be called tlan.
 
          Please email feedback to <torben.mathiasen@compaq.com>.
@@ -1880,6 +1830,28 @@ config FEC2
          Say Y here if you want to use the second built-in 10/100 Fast
          ethernet controller on some Motorola ColdFire processors.
 
+config FEC_MPC52xx
+       tristate "MPC52xx FEC driver"
+       depends on PPC_MERGE && PPC_MPC52xx && PPC_BESTCOMM_FEC
+       select CRC32
+       select PHYLIB
+       ---help---
+         This option enables support for the MPC5200's on-chip
+         Fast Ethernet Controller
+         If compiled as module, it will be called 'fec_mpc52xx.ko'.
+
+config FEC_MPC52xx_MDIO
+       bool "MPC52xx FEC MDIO bus driver"
+       depends on FEC_MPC52xx
+       default y
+       ---help---
+         The MPC5200's FEC can connect to the Ethernet either with
+         an external MII PHY chip or 10 Mbps 7-wire interface
+         (Motorola? industry standard).
+         If your board uses an external PHY connected to FEC, enable this.
+         If not sure, enable.
+         If compiled as module, it will be called 'fec_mpc52xx_phy.ko'.
+
 config NE_H8300
        tristate "NE2000 compatible support for H8/300"
        depends on H8300
@@ -1972,8 +1944,7 @@ config E1000
          More specific information on configuring the driver is in 
          <file:Documentation/networking/e1000.txt>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module
+         To compile this driver as a module, choose M here. The module
          will be called e1000.
 
 config E1000_NAPI
@@ -2018,8 +1989,7 @@ config E1000E
          More specific information on configuring the driver is in
          <file:Documentation/networking/e1000e.txt>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module
+         To compile this driver as a module, choose M here. The module
          will be called e1000e.
 
 source "drivers/net/ixp2000/Kconfig"
@@ -2052,8 +2022,7 @@ config HAMACHI
          the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module will be
+         To compile this driver as a module, choose M here. The module will be
          called hamachi.
 
 config YELLOWFIN
@@ -2502,8 +2471,7 @@ config IXGBE
          More specific information on configuring the driver is in
          <file:Documentation/networking/ixgbe.txt>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module
+         To compile this driver as a module, choose M here. The module
          will be called ixgbe.
 
 config IXGB
@@ -2525,8 +2493,7 @@ config IXGB
          More specific information on configuring the driver is in 
          <file:Documentation/networking/ixgb.txt>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module
+         To compile this driver as a module, choose M here. The module
          will be called ixgb.
 
 config IXGB_NAPI
@@ -2579,8 +2546,7 @@ config MYRI10GE
 
          <http://www.myri.com/scs/download-Myri10GE.html>
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module
+         To compile this driver as a module, choose M here. The module
          will be called myri10ge.
 
 config NETXEN_NIC
@@ -2804,10 +2770,9 @@ config PLIP
          with the PLIP support in Linux versions 1.0.x.  This option enlarges
          your kernel by about 8 KB.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module will be
-         called plip.  If unsure, say Y or M, in case you buy a laptop
-         later.
+         To compile this driver as a module, choose M here. The module
+         will be called plip. If unsure, say Y or M, in case you buy
+         a laptop later.
 
 config PPP
        tristate "PPP (point-to-point protocol) support"
@@ -2837,8 +2802,7 @@ config PPP
          If you said Y to "Version information on all symbols" above, then
          you cannot compile the PPP driver into the kernel; you can then only
          compile it as a module. To compile this driver as a module, choose M
-         here and read <file:Documentation/networking/net-modules.txt>.
-         The module will be called ppp_generic.
+         here. The module will be called ppp_generic.
 
 config PPP_MULTILINK
        bool "PPP multilink support (EXPERIMENTAL)"
@@ -2999,9 +2963,8 @@ config SLIP
          <http://www.bart.nl/~patrickr/term-howto/Term-HOWTO.html>). SLIP
          support will enlarge your kernel by about 4 KB. If unsure, say N.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>. The module will be
-         called slip.
+         To compile this driver as a module, choose M here. The module
+         will be called slip.
 
 config SLIP_COMPRESSED
        bool "CSLIP compressed headers"
index 593262065c9b8b852437034e2fdcaa5fd71981fa..0e5fde4a1b2cea165d7e3691429bb00425717766 100644 (file)
@@ -96,6 +96,10 @@ obj-$(CONFIG_SHAPER) += shaper.o
 obj-$(CONFIG_HP100) += hp100.o
 obj-$(CONFIG_SMC9194) += smc9194.o
 obj-$(CONFIG_FEC) += fec.o
+obj-$(CONFIG_FEC_MPC52xx) += fec_mpc52xx.o
+ifeq ($(CONFIG_FEC_MPC52xx_MDIO),y)
+       obj-$(CONFIG_FEC_MPC52xx) += fec_mpc52xx_phy.o
+endif
 obj-$(CONFIG_68360_ENET) += 68360enet.o
 obj-$(CONFIG_WD80x3) += wd.o 8390.o
 obj-$(CONFIG_EL2) += 3c503.o 8390.o
index 4030274fe788d1bf3f1e7f0fdc3f589965856bb0..3b2f7f11546489aaf48bb016d0469020b511b724 100644 (file)
@@ -19,8 +19,7 @@ menuconfig ARCNET
          from <http://www.tldp.org/docs.html#howto>(even though ARCnet
          is not really Ethernet).
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module will
+         To compile this driver as a module, choose M here. The module will
          be called arcnet.
 
 if ARCNET
@@ -81,8 +80,7 @@ config ARCNET_COM90xx
          have always used the old ARCnet driver without knowing what type of
          card you had, this is probably the one for you.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module will
+         To compile this driver as a module, choose M here. The module will
          be called com90xx.
 
 config ARCNET_COM90xxIO
@@ -93,8 +91,7 @@ config ARCNET_COM90xxIO
          the normal driver. Only use it if your card doesn't support shared
          memory.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module will
+         To compile this driver as a module, choose M here. The module will
          be called com90io.
 
 config ARCNET_RIM_I
@@ -105,8 +102,7 @@ config ARCNET_RIM_I
          driver is completely untested, so if you have one of these cards,
          please mail <dwmw2@infradead.org>, especially if it works!
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module will
+         To compile this driver as a module, choose M here. The module will
          be called arc-rimi.
 
 config ARCNET_COM20020
@@ -116,8 +112,7 @@ config ARCNET_COM20020
          things as promiscuous mode, so packet sniffing is possible, and
          extra diagnostic information.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module will
+         To compile this driver as a module, choose M here. The module will
          be called com20020.
 
 config ARCNET_COM20020_ISA
index 7f016f3d5bf0ea3cd4f7675d50e0dd1c24d8f5f9..91a6590d107b181177a74e0bcd71003e9c4a906c 100644 (file)
@@ -417,7 +417,7 @@ static irqreturn_t ep93xx_irq(int irq, void *dev_id)
 
        if (status & REG_INTSTS_RX) {
                spin_lock(&ep->rx_lock);
-               if (likely(__netif_rx_schedule_prep(dev, &ep->napi))) {
+               if (likely(netif_rx_schedule_prep(dev, &ep->napi))) {
                        wrl(ep, REG_INTEN, REG_INTEN_TX);
                        __netif_rx_schedule(dev, &ep->napi);
                }
index 53fe7ded5d509275b0827891f4551d376e6b749d..0b99b554929545cecf0abf93812873d7306518d4 100644 (file)
@@ -371,7 +371,6 @@ static void bf537_adjust_link(struct net_device *dev)
                if (phydev->speed != lp->old_speed) {
 #if defined(CONFIG_BFIN_MAC_RMII)
                        u32 opmode = bfin_read_EMAC_OPMODE();
-                       bf537mac_disable();
                        switch (phydev->speed) {
                        case 10:
                                opmode |= RMII_10;
@@ -386,7 +385,6 @@ static void bf537_adjust_link(struct net_device *dev)
                                break;
                        }
                        bfin_write_EMAC_OPMODE(opmode);
-                       bf537mac_enable();
 #endif
 
                        new_state = 1;
@@ -926,7 +924,7 @@ static int __init bf537mac_probe(struct net_device *dev)
        if (!is_valid_ether_addr(dev->dev_addr)) {
                /* Grab the MAC from the board somehow - this is done in the
                   arch/blackfin/mach-bf537/boards/eth_mac.c */
-               get_bf537_ether_addr(dev->dev_addr);
+               bfin_get_ether_addr(dev->dev_addr);
        }
 
        /* If still not valid, get a random one */
index 3a107ad75381ecd7ac18305952b0194f8f8844c0..5970ea7142cd53c3e5f1d4234110a484f8af0191 100644 (file)
@@ -92,4 +92,4 @@ struct bf537mac_local {
        struct mii_bus mii_bus;
 };
 
-extern void get_bf537_ether_addr(char *addr);
+extern void bfin_get_ether_addr(char *addr);
index 6937ef0e7275f40a14b227055f0f65886b24a052..423298c84a1da7a9f36668a15e1178d30ee163a5 100644 (file)
@@ -1847,9 +1847,9 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
 */
 void bond_destroy(struct bonding *bond)
 {
-       unregister_netdevice(bond->dev);
        bond_deinit(bond->dev);
        bond_destroy_sysfs_entry(bond);
+       unregister_netdevice(bond->dev);
 }
 
 /*
@@ -4405,6 +4405,7 @@ static int bond_init(struct net_device *bond_dev, struct bond_params *params)
        bond_dev->set_multicast_list = bond_set_multicast_list;
        bond_dev->change_mtu = bond_change_mtu;
        bond_dev->set_mac_address = bond_set_mac_address;
+       bond_dev->validate_addr = NULL;
 
        bond_set_mode_ops(bond, bond->params.mode);
 
@@ -4474,8 +4475,8 @@ static void bond_free_all(void)
                bond_mc_list_destroy(bond);
                /* Release the bonded slaves */
                bond_release_all(bond_dev);
-               unregister_netdevice(bond_dev);
                bond_deinit(bond_dev);
+               unregister_netdevice(bond_dev);
        }
 
 #ifdef CONFIG_PROC_FS
index 7a06ade85b02e79279244da770921243f83bfd0f..b29330d8e309955a4f85008cbbddf8b7aea4465d 100644 (file)
@@ -1193,8 +1193,6 @@ static ssize_t bonding_show_active_slave(struct device *d,
        struct bonding *bond = to_bond(d);
        int count;
 
-       rtnl_lock();
-
        read_lock(&bond->curr_slave_lock);
        curr = bond->curr_active_slave;
        read_unlock(&bond->curr_slave_lock);
@@ -1216,7 +1214,9 @@ static ssize_t bonding_store_active_slave(struct device *d,
         struct slave *new_active = NULL;
        struct bonding *bond = to_bond(d);
 
+       rtnl_lock();
        write_lock_bh(&bond->lock);
+
        if (!USES_PRIMARY(bond->params.mode)) {
                printk(KERN_INFO DRV_NAME
                       ": %s: Unable to change active slave; %s is in mode %d\n",
index ffa7e649a6ef37514333cd225ab07c6e1fe61d12..443666292a5ce44ea9ce21c0a15a8de6adfdc511 100644 (file)
@@ -1379,11 +1379,11 @@ static void sge_rx(struct sge *sge, struct freelQ *fl, unsigned int len)
        }
        __skb_pull(skb, sizeof(*p));
 
-       skb->dev->last_rx = jiffies;
        st = per_cpu_ptr(sge->port_stats[p->iff], smp_processor_id());
        st->rx_packets++;
 
        skb->protocol = eth_type_trans(skb, adapter->port[p->iff].dev);
+       skb->dev->last_rx = jiffies;
        if ((adapter->flags & RX_CSUM_ENABLED) && p->csum == 0xffff &&
            skb->protocol == htons(ETH_P_IP) &&
            (skb->data[9] == IPPROTO_TCP || skb->data[9] == IPPROTO_UDP)) {
index edd6828f0a78c594649b3f354836cffe56066939..917b7b46f1a72d409d7babfb3fa0ca369bb83da2 100644 (file)
 #include <asm/system.h>
 #include <asm/ethernet.h>
 #include <asm/cache.h>
+#include <asm/arch/io_interface_mux.h>
 
 //#define ETHDEBUG
 #define D(x)
@@ -279,6 +280,9 @@ struct net_local {
         * by this lock as well.
         */
        spinlock_t lock;
+
+       spinlock_t led_lock; /* Protect LED state */
+       spinlock_t transceiver_lock; /* Protect transceiver state. */
 };
 
 typedef struct etrax_eth_descr
@@ -295,8 +299,6 @@ struct transceiver_ops
        void (*check_duplex)(struct net_device* dev);
 };
 
-struct transceiver_ops* transceiver;
-
 /* Duplex settings */
 enum duplex
 {
@@ -307,7 +309,7 @@ enum duplex
 
 /* Dma descriptors etc. */
 
-#define MAX_MEDIA_DATA_SIZE 1518
+#define MAX_MEDIA_DATA_SIZE 1522
 
 #define MIN_PACKET_LEN      46
 #define ETHER_HEAD_LEN      14
@@ -332,8 +334,8 @@ enum duplex
 
 /*Intel LXT972A specific*/
 #define MDIO_INT_STATUS_REG_2                  0x0011
-#define MDIO_INT_FULL_DUPLEX_IND               ( 1 << 9 )
-#define MDIO_INT_SPEED                         ( 1 << 14 )
+#define MDIO_INT_FULL_DUPLEX_IND       (1 << 9)
+#define MDIO_INT_SPEED                (1 << 14)
 
 /* Network flash constants */
 #define NET_FLASH_TIME                  (HZ/50) /* 20 ms */
@@ -344,8 +346,8 @@ enum duplex
 #define NO_NETWORK_ACTIVITY 0
 #define NETWORK_ACTIVITY    1
 
-#define NBR_OF_RX_DESC     64
-#define NBR_OF_TX_DESC     256
+#define NBR_OF_RX_DESC     32
+#define NBR_OF_TX_DESC     16
 
 /* Large packets are sent directly to upper layers while small packets are */
 /* copied (to reduce memory waste). The following constant decides the breakpoint */
@@ -367,7 +369,6 @@ enum duplex
 static etrax_eth_descr *myNextRxDesc;  /* Points to the next descriptor to
                                           to be processed */
 static etrax_eth_descr *myLastRxDesc;  /* The last processed descriptor */
-static etrax_eth_descr *myPrevRxDesc;  /* The descriptor right before myNextRxDesc */
 
 static etrax_eth_descr RxDescList[NBR_OF_RX_DESC] __attribute__ ((aligned(32)));
 
@@ -377,7 +378,6 @@ static etrax_eth_descr* myNextTxDesc;  /* Next descriptor to use */
 static etrax_eth_descr TxDescList[NBR_OF_TX_DESC] __attribute__ ((aligned(32)));
 
 static unsigned int network_rec_config_shadow = 0;
-static unsigned int mdio_phy_addr; /* Transciever address */
 
 static unsigned int network_tr_ctrl_shadow = 0;
 
@@ -411,7 +411,7 @@ static int e100_set_config(struct net_device* dev, struct ifmap* map);
 static void e100_tx_timeout(struct net_device *dev);
 static struct net_device_stats *e100_get_stats(struct net_device *dev);
 static void set_multicast_list(struct net_device *dev);
-static void e100_hardware_send_packet(char *buf, int length);
+static void e100_hardware_send_packet(struct net_local* np, char *buf, int length);
 static void update_rx_stats(struct net_device_stats *);
 static void update_tx_stats(struct net_device_stats *);
 static int e100_probe_transceiver(struct net_device* dev);
@@ -434,7 +434,10 @@ static void e100_clear_network_leds(unsigned long dummy);
 static void e100_set_network_leds(int active);
 
 static const struct ethtool_ops e100_ethtool_ops;
-
+#if defined(CONFIG_ETRAX_NO_PHY)
+static void dummy_check_speed(struct net_device* dev);
+static void dummy_check_duplex(struct net_device* dev);
+#else
 static void broadcom_check_speed(struct net_device* dev);
 static void broadcom_check_duplex(struct net_device* dev);
 static void tdk_check_speed(struct net_device* dev);
@@ -443,16 +446,28 @@ static void intel_check_speed(struct net_device* dev);
 static void intel_check_duplex(struct net_device* dev);
 static void generic_check_speed(struct net_device* dev);
 static void generic_check_duplex(struct net_device* dev);
+#endif
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void e100_netpoll(struct net_device* dev);
+#endif
+
+static int autoneg_normal = 1;
 
 struct transceiver_ops transceivers[] =
 {
+#if defined(CONFIG_ETRAX_NO_PHY)
+       {0x0000, dummy_check_speed, dummy_check_duplex}        /* Dummy */
+#else
        {0x1018, broadcom_check_speed, broadcom_check_duplex},  /* Broadcom */
        {0xC039, tdk_check_speed, tdk_check_duplex},            /* TDK 2120 */
        {0x039C, tdk_check_speed, tdk_check_duplex},            /* TDK 2120C */
         {0x04de, intel_check_speed, intel_check_duplex},       /* Intel LXT972A*/
        {0x0000, generic_check_speed, generic_check_duplex}     /* Generic, must be last */
+#endif
 };
 
+struct transceiver_ops* transceiver = &transceivers[0];
+
 #define tx_done(dev) (*R_DMA_CH0_CMD == 0)
 
 /*
@@ -471,14 +486,22 @@ etrax_ethernet_init(void)
        int i, err;
 
        printk(KERN_INFO
-              "ETRAX 100LX 10/100MBit ethernet v2.0 (c) 2000-2003 Axis Communications AB\n");
+              "ETRAX 100LX 10/100MBit ethernet v2.0 (c) 1998-2007 Axis Communications AB\n");
 
-       dev = alloc_etherdev(sizeof(struct net_local));
-       np = dev->priv;
+       if (cris_request_io_interface(if_eth, cardname)) {
+               printk(KERN_CRIT "etrax_ethernet_init failed to get IO interface\n");
+               return -EBUSY;
+       }
 
+       dev = alloc_etherdev(sizeof(struct net_local));
        if (!dev)
                return -ENOMEM;
 
+       np = netdev_priv(dev);
+
+       /* we do our own locking */
+       dev->features |= NETIF_F_LLTX;
+
        dev->base_addr = (unsigned int)R_NETWORK_SA_0; /* just to have something to show */
 
        /* now setup our etrax specific stuff */
@@ -498,14 +521,22 @@ etrax_ethernet_init(void)
        dev->do_ioctl           = e100_ioctl;
        dev->set_config         = e100_set_config;
        dev->tx_timeout         = e100_tx_timeout;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+       dev->poll_controller = e100_netpoll;
+#endif
+
+       spin_lock_init(&np->lock);
+       spin_lock_init(&np->led_lock);
+       spin_lock_init(&np->transceiver_lock);
 
        /* Initialise the list of Etrax DMA-descriptors */
 
        /* Initialise receive descriptors */
 
        for (i = 0; i < NBR_OF_RX_DESC; i++) {
-               /* Allocate two extra cachelines to make sure that buffer used by DMA
-                * does not share cacheline with any other data (to avoid cache bug)
+               /* Allocate two extra cachelines to make sure that buffer used
+                * by DMA does not share cacheline with any other data (to
+                * avoid cache bug)
                 */
                RxDescList[i].skb = dev_alloc_skb(MAX_MEDIA_DATA_SIZE + 2 * L1_CACHE_BYTES);
                if (!RxDescList[i].skb)
@@ -541,7 +572,6 @@ etrax_ethernet_init(void)
 
        myNextRxDesc  = &RxDescList[0];
        myLastRxDesc  = &RxDescList[NBR_OF_RX_DESC - 1];
-       myPrevRxDesc  = &RxDescList[NBR_OF_RX_DESC - 1];
        myFirstTxDesc = &TxDescList[0];
        myNextTxDesc  = &TxDescList[0];
        myLastTxDesc  = &TxDescList[NBR_OF_TX_DESC - 1];
@@ -562,10 +592,11 @@ etrax_ethernet_init(void)
        current_speed = 10;
        current_speed_selection = 0; /* Auto */
        speed_timer.expires = jiffies + NET_LINK_UP_CHECK_INTERVAL;
-        duplex_timer.data = (unsigned long)dev;
+       speed_timer.data = (unsigned long)dev;
        speed_timer.function = e100_check_speed;
 
        clear_led_timer.function = e100_clear_network_leds;
+       clear_led_timer.data = (unsigned long)dev;
 
        full_duplex = 0;
        current_duplex = autoneg;
@@ -574,7 +605,6 @@ etrax_ethernet_init(void)
        duplex_timer.function = e100_check_duplex;
 
         /* Initialize mii interface */
-       np->mii_if.phy_id = mdio_phy_addr;
        np->mii_if.phy_id_mask = 0x1f;
        np->mii_if.reg_num_mask = 0x1f;
        np->mii_if.dev = dev;
@@ -585,6 +615,9 @@ etrax_ethernet_init(void)
        /* unwanted addresses are matched */
        *R_NETWORK_GA_0 = 0x00000000;
        *R_NETWORK_GA_1 = 0x00000000;
+
+       /* Initialize next time the led can flash */
+       led_next_time = jiffies;
        return 0;
 }
 
@@ -595,9 +628,9 @@ etrax_ethernet_init(void)
 static int
 e100_set_mac_address(struct net_device *dev, void *p)
 {
-       struct net_local *np = (struct net_local *)dev->priv;
+       struct net_local *np = netdev_priv(dev);
        struct sockaddr *addr = p;
-       int i;
+       DECLARE_MAC_BUF(mac);
 
        spin_lock(&np->lock); /* preemption protection */
 
@@ -686,6 +719,25 @@ e100_open(struct net_device *dev)
                goto grace_exit2;
        }
 
+       /*
+        * Always allocate the DMA channels after the IRQ,
+        * and clean up on failure.
+        */
+
+       if (cris_request_dma(NETWORK_TX_DMA_NBR,
+                            cardname,
+                            DMA_VERBOSE_ON_ERROR,
+                            dma_eth)) {
+               goto grace_exit3;
+        }
+
+       if (cris_request_dma(NETWORK_RX_DMA_NBR,
+                            cardname,
+                            DMA_VERBOSE_ON_ERROR,
+                            dma_eth)) {
+               goto grace_exit4;
+        }
+
        /* give the HW an idea of what MAC address we want */
 
        *R_NETWORK_SA_0 = dev->dev_addr[0] | (dev->dev_addr[1] << 8) |
@@ -700,6 +752,7 @@ e100_open(struct net_device *dev)
 
        *R_NETWORK_REC_CONFIG = 0xd; /* broadcast rec, individ. rec, ma0 enabled */
 #else
+       SETS(network_rec_config_shadow, R_NETWORK_REC_CONFIG, max_size, size1522);
        SETS(network_rec_config_shadow, R_NETWORK_REC_CONFIG, broadcast, receive);
        SETS(network_rec_config_shadow, R_NETWORK_REC_CONFIG, ma0, enable);
        SETF(network_rec_config_shadow, R_NETWORK_REC_CONFIG, duplex, full_duplex);
@@ -719,8 +772,7 @@ e100_open(struct net_device *dev)
        SETS(network_tr_ctrl_shadow, R_NETWORK_TR_CTRL, crc, enable);
        *R_NETWORK_TR_CTRL = network_tr_ctrl_shadow;
 
-       save_flags(flags);
-       cli();
+       local_irq_save(flags);
 
        /* enable the irq's for ethernet DMA */
 
@@ -752,12 +804,13 @@ e100_open(struct net_device *dev)
 
        *R_DMA_CH0_FIRST = 0;
        *R_DMA_CH0_DESCR = virt_to_phys(myLastTxDesc);
+       netif_start_queue(dev);
 
-       restore_flags(flags);
+       local_irq_restore(flags);
 
        /* Probe for transceiver */
        if (e100_probe_transceiver(dev))
-               goto grace_exit3;
+               goto grace_exit5;
 
        /* Start duplex/speed timers */
        add_timer(&speed_timer);
@@ -766,10 +819,14 @@ e100_open(struct net_device *dev)
        /* We are now ready to accept transmit requeusts from
         * the queueing layer of the networking.
         */
-       netif_start_queue(dev);
+       netif_carrier_on(dev);
 
        return 0;
 
+grace_exit5:
+       cris_free_dma(NETWORK_RX_DMA_NBR, cardname);
+grace_exit4:
+       cris_free_dma(NETWORK_TX_DMA_NBR, cardname);
 grace_exit3:
        free_irq(NETWORK_STATUS_IRQ_NBR, (void *)dev);
 grace_exit2:
@@ -780,12 +837,20 @@ grace_exit0:
        return -EAGAIN;
 }
 
-
+#if defined(CONFIG_ETRAX_NO_PHY)
+static void
+dummy_check_speed(struct net_device* dev)
+{
+       current_speed = 100;
+}
+#else
 static void
 generic_check_speed(struct net_device* dev)
 {
        unsigned long data;
-       data = e100_get_mdio_reg(dev, mdio_phy_addr, MII_ADVERTISE);
+       struct net_local *np = netdev_priv(dev);
+
+       data = e100_get_mdio_reg(dev, np->mii_if.phy_id, MII_ADVERTISE);
        if ((data & ADVERTISE_100FULL) ||
            (data & ADVERTISE_100HALF))
                current_speed = 100;
@@ -797,7 +862,10 @@ static void
 tdk_check_speed(struct net_device* dev)
 {
        unsigned long data;
-       data = e100_get_mdio_reg(dev, mdio_phy_addr, MDIO_TDK_DIAGNOSTIC_REG);
+       struct net_local *np = netdev_priv(dev);
+
+       data = e100_get_mdio_reg(dev, np->mii_if.phy_id,
+                                MDIO_TDK_DIAGNOSTIC_REG);
        current_speed = (data & MDIO_TDK_DIAGNOSTIC_RATE ? 100 : 10);
 }
 
@@ -805,7 +873,10 @@ static void
 broadcom_check_speed(struct net_device* dev)
 {
        unsigned long data;
-       data = e100_get_mdio_reg(dev, mdio_phy_addr, MDIO_AUX_CTRL_STATUS_REG);
+       struct net_local *np = netdev_priv(dev);
+
+       data = e100_get_mdio_reg(dev, np->mii_if.phy_id,
+                                MDIO_AUX_CTRL_STATUS_REG);
        current_speed = (data & MDIO_BC_SPEED ? 100 : 10);
 }
 
@@ -813,46 +884,62 @@ static void
 intel_check_speed(struct net_device* dev)
 {
        unsigned long data;
-       data = e100_get_mdio_reg(dev, mdio_phy_addr, MDIO_INT_STATUS_REG_2);
+       struct net_local *np = netdev_priv(dev);
+
+       data = e100_get_mdio_reg(dev, np->mii_if.phy_id,
+                                MDIO_INT_STATUS_REG_2);
        current_speed = (data & MDIO_INT_SPEED ? 100 : 10);
 }
-
+#endif
 static void
 e100_check_speed(unsigned long priv)
 {
        struct net_device* dev = (struct net_device*)priv;
+       struct net_local *np = netdev_priv(dev);
        static int led_initiated = 0;
        unsigned long data;
        int old_speed = current_speed;
 
-       data = e100_get_mdio_reg(dev, mdio_phy_addr, MII_BMSR);
+       spin_lock(&np->transceiver_lock);
+
+       data = e100_get_mdio_reg(dev, np->mii_if.phy_id, MII_BMSR);
        if (!(data & BMSR_LSTATUS)) {
                current_speed = 0;
        } else {
                transceiver->check_speed(dev);
        }
 
+       spin_lock(&np->led_lock);
        if ((old_speed != current_speed) || !led_initiated) {
                led_initiated = 1;
                e100_set_network_leds(NO_NETWORK_ACTIVITY);
+               if (current_speed)
+                       netif_carrier_on(dev);
+               else
+                       netif_carrier_off(dev);
        }
+       spin_unlock(&np->led_lock);
 
        /* Reinitialize the timer. */
        speed_timer.expires = jiffies + NET_LINK_UP_CHECK_INTERVAL;
        add_timer(&speed_timer);
+
+       spin_unlock(&np->transceiver_lock);
 }
 
 static void
 e100_negotiate(struct net_device* dev)
 {
-       unsigned short data = e100_get_mdio_reg(dev, mdio_phy_addr, MII_ADVERTISE);
+       struct net_local *np = netdev_priv(dev);
+       unsigned short data = e100_get_mdio_reg(dev, np->mii_if.phy_id,
+                                               MII_ADVERTISE);
 
        /* Discard old speed and duplex settings */
        data &= ~(ADVERTISE_100HALF | ADVERTISE_100FULL |
                  ADVERTISE_10HALF | ADVERTISE_10FULL);
 
        switch (current_speed_selection) {
-               case 10 :
+               case 10:
                        if (current_duplex == full)
                                data |= ADVERTISE_10FULL;
                        else if (current_duplex == half)
@@ -861,7 +948,7 @@ e100_negotiate(struct net_device* dev)
                                data |= ADVERTISE_10HALF | ADVERTISE_10FULL;
                        break;
 
-               case 100 :
+               case 100:
                         if (current_duplex == full)
                                data |= ADVERTISE_100FULL;
                        else if (current_duplex == half)
@@ -870,7 +957,7 @@ e100_negotiate(struct net_device* dev)
                                data |= ADVERTISE_100HALF | ADVERTISE_100FULL;
                        break;
 
-               case 0 : /* Auto */
+               case 0: /* Auto */
                         if (current_duplex == full)
                                data |= ADVERTISE_100FULL | ADVERTISE_10FULL;
                        else if (current_duplex == half)
@@ -880,35 +967,44 @@ e100_negotiate(struct net_device* dev)
                                  ADVERTISE_100HALF | ADVERTISE_100FULL;
                        break;
 
-               default : /* assume autoneg speed and duplex */
+               default: /* assume autoneg speed and duplex */
                        data |= ADVERTISE_10HALF | ADVERTISE_10FULL |
                                  ADVERTISE_100HALF | ADVERTISE_100FULL;
+                       break;
        }
 
-       e100_set_mdio_reg(dev, mdio_phy_addr, MII_ADVERTISE, data);
+       e100_set_mdio_reg(dev, np->mii_if.phy_id, MII_ADVERTISE, data);
 
        /* Renegotiate with link partner */
-       data = e100_get_mdio_reg(dev, mdio_phy_addr, MII_BMCR);
+       if (autoneg_normal) {
+         data = e100_get_mdio_reg(dev, np->mii_if.phy_id, MII_BMCR);
        data |= BMCR_ANENABLE | BMCR_ANRESTART;
-
-       e100_set_mdio_reg(dev, mdio_phy_addr, MII_BMCR, data);
+       }
+       e100_set_mdio_reg(dev, np->mii_if.phy_id, MII_BMCR, data);
 }
 
 static void
 e100_set_speed(struct net_device* dev, unsigned long speed)
 {
+       struct net_local *np = netdev_priv(dev);
+
+       spin_lock(&np->transceiver_lock);
        if (speed != current_speed_selection) {
                current_speed_selection = speed;
                e100_negotiate(dev);
        }
+       spin_unlock(&np->transceiver_lock);
 }
 
 static void
 e100_check_duplex(unsigned long priv)
 {
        struct net_device *dev = (struct net_device *)priv;
-       struct net_local *np = (struct net_local *)dev->priv;
-       int old_duplex = full_duplex;
+       struct net_local *np = netdev_priv(dev);
+       int old_duplex;
+
+       spin_lock(&np->transceiver_lock);
+       old_duplex = full_duplex;
        transceiver->check_duplex(dev);
        if (old_duplex != full_duplex) {
                /* Duplex changed */
@@ -920,13 +1016,22 @@ e100_check_duplex(unsigned long priv)
        duplex_timer.expires = jiffies + NET_DUPLEX_CHECK_INTERVAL;
        add_timer(&duplex_timer);
        np->mii_if.full_duplex = full_duplex;
+       spin_unlock(&np->transceiver_lock);
 }
-
+#if defined(CONFIG_ETRAX_NO_PHY)
+static void
+dummy_check_duplex(struct net_device* dev)
+{
+       full_duplex = 1;
+}
+#else
 static void
 generic_check_duplex(struct net_device* dev)
 {
        unsigned long data;
-       data = e100_get_mdio_reg(dev, mdio_phy_addr, MII_ADVERTISE);
+       struct net_local *np = netdev_priv(dev);
+
+       data = e100_get_mdio_reg(dev, np->mii_if.phy_id, MII_ADVERTISE);
        if ((data & ADVERTISE_10FULL) ||
            (data & ADVERTISE_100FULL))
                full_duplex = 1;
@@ -938,7 +1043,10 @@ static void
 tdk_check_duplex(struct net_device* dev)
 {
        unsigned long data;
-       data = e100_get_mdio_reg(dev, mdio_phy_addr, MDIO_TDK_DIAGNOSTIC_REG);
+       struct net_local *np = netdev_priv(dev);
+
+       data = e100_get_mdio_reg(dev, np->mii_if.phy_id,
+                                MDIO_TDK_DIAGNOSTIC_REG);
        full_duplex = (data & MDIO_TDK_DIAGNOSTIC_DPLX) ? 1 : 0;
 }
 
@@ -946,7 +1054,10 @@ static void
 broadcom_check_duplex(struct net_device* dev)
 {
        unsigned long data;
-       data = e100_get_mdio_reg(dev, mdio_phy_addr, MDIO_AUX_CTRL_STATUS_REG);
+       struct net_local *np = netdev_priv(dev);
+
+       data = e100_get_mdio_reg(dev, np->mii_if.phy_id,
+                                MDIO_AUX_CTRL_STATUS_REG);
        full_duplex = (data & MDIO_BC_FULL_DUPLEX_IND) ? 1 : 0;
 }
 
@@ -954,38 +1065,55 @@ static void
 intel_check_duplex(struct net_device* dev)
 {
        unsigned long data;
-       data = e100_get_mdio_reg(dev, mdio_phy_addr, MDIO_INT_STATUS_REG_2);
+       struct net_local *np = netdev_priv(dev);
+
+       data = e100_get_mdio_reg(dev, np->mii_if.phy_id,
+                                MDIO_INT_STATUS_REG_2);
        full_duplex = (data & MDIO_INT_FULL_DUPLEX_IND) ? 1 : 0;
 }
-
+#endif
 static void
 e100_set_duplex(struct net_device* dev, enum duplex new_duplex)
 {
+       struct net_local *np = netdev_priv(dev);
+
+       spin_lock(&np->transceiver_lock);
        if (new_duplex != current_duplex) {
                current_duplex = new_duplex;
                e100_negotiate(dev);
        }
+       spin_unlock(&np->transceiver_lock);
 }
 
 static int
 e100_probe_transceiver(struct net_device* dev)
 {
+       int ret = 0;
+
+#if !defined(CONFIG_ETRAX_NO_PHY)
        unsigned int phyid_high;
        unsigned int phyid_low;
        unsigned int oui;
        struct transceiver_ops* ops = NULL;
+       struct net_local *np = netdev_priv(dev);
+
+       spin_lock(&np->transceiver_lock);
 
        /* Probe MDIO physical address */
-       for (mdio_phy_addr = 0; mdio_phy_addr <= 31; mdio_phy_addr++) {
-               if (e100_get_mdio_reg(dev, mdio_phy_addr, MII_BMSR) != 0xffff)
+       for (np->mii_if.phy_id = 0; np->mii_if.phy_id <= 31;
+            np->mii_if.phy_id++) {
+               if (e100_get_mdio_reg(dev,
+                                     np->mii_if.phy_id, MII_BMSR) != 0xffff)
                        break;
        }
-       if (mdio_phy_addr == 32)
-                return -ENODEV;
+       if (np->mii_if.phy_id == 32) {
+               ret = -ENODEV;
+               goto out;
+       }
 
        /* Get manufacturer */
-       phyid_high = e100_get_mdio_reg(dev, mdio_phy_addr, MII_PHYSID1);
-       phyid_low = e100_get_mdio_reg(dev, mdio_phy_addr, MII_PHYSID2);
+       phyid_high = e100_get_mdio_reg(dev, np->mii_if.phy_id, MII_PHYSID1);
+       phyid_low = e100_get_mdio_reg(dev, np->mii_if.phy_id, MII_PHYSID2);
        oui = (phyid_high << 6) | (phyid_low >> 10);
 
        for (ops = &transceivers[0]; ops->oui; ops++) {
@@ -993,8 +1121,10 @@ e100_probe_transceiver(struct net_device* dev)
                        break;
        }
        transceiver = ops;
-
-       return 0;
+out:
+       spin_unlock(&np->transceiver_lock);
+#endif
+       return ret;
 }
 
 static int
@@ -1088,13 +1218,14 @@ e100_receive_mdio_bit()
 static void
 e100_reset_transceiver(struct net_device* dev)
 {
+       struct net_local *np = netdev_priv(dev);
        unsigned short cmd;
        unsigned short data;
        int bitCounter;
 
-       data = e100_get_mdio_reg(dev, mdio_phy_addr, MII_BMCR);
+       data = e100_get_mdio_reg(dev, np->mii_if.phy_id, MII_BMCR);
 
-       cmd = (MDIO_START << 14) | (MDIO_WRITE << 12) | (mdio_phy_addr << 7) | (MII_BMCR << 2);
+       cmd = (MDIO_START << 14) | (MDIO_WRITE << 12) | (np->mii_if.phy_id << 7) | (MII_BMCR << 2);
 
        e100_send_mdio_cmd(cmd, 1);
 
@@ -1112,7 +1243,7 @@ e100_reset_transceiver(struct net_device* dev)
 static void
 e100_tx_timeout(struct net_device *dev)
 {
-       struct net_local *np = (struct net_local *)dev->priv;
+       struct net_local *np = netdev_priv(dev);
        unsigned long flags;
 
        spin_lock_irqsave(&np->lock, flags);
@@ -1134,8 +1265,7 @@ e100_tx_timeout(struct net_device *dev)
        e100_reset_transceiver(dev);
 
        /* and get rid of the packets that never got an interrupt */
-       while (myFirstTxDesc != myNextTxDesc)
-       {
+       while (myFirstTxDesc != myNextTxDesc) {
                dev_kfree_skb(myFirstTxDesc->skb);
                myFirstTxDesc->skb = 0;
                myFirstTxDesc = phys_to_virt(myFirstTxDesc->descr.next);
@@ -1161,7 +1291,7 @@ e100_tx_timeout(struct net_device *dev)
 static int
 e100_send_packet(struct sk_buff *skb, struct net_device *dev)
 {
-       struct net_local *np = (struct net_local *)dev->priv;
+       struct net_local *np = netdev_priv(dev);
        unsigned char *buf = skb->data;
        unsigned long flags;
 
@@ -1174,7 +1304,7 @@ e100_send_packet(struct sk_buff *skb, struct net_device *dev)
 
        dev->trans_start = jiffies;
 
-       e100_hardware_send_packet(buf, skb->len);
+       e100_hardware_send_packet(np, buf, skb->len);
 
        myNextTxDesc = phys_to_virt(myNextTxDesc->descr.next);
 
@@ -1197,13 +1327,15 @@ static irqreturn_t
 e100rxtx_interrupt(int irq, void *dev_id)
 {
        struct net_device *dev = (struct net_device *)dev_id;
-       struct net_local *np = (struct net_local *)dev->priv;
-       unsigned long irqbits = *R_IRQ_MASK2_RD;
+       struct net_local *np = netdev_priv(dev);
+       unsigned long irqbits;
 
-       /* Disable RX/TX IRQs to avoid reentrancy */
-       *R_IRQ_MASK2_CLR =
-         IO_STATE(R_IRQ_MASK2_CLR, dma0_eop, clr) |
-         IO_STATE(R_IRQ_MASK2_CLR, dma1_eop, clr);
+       /*
+        * Note that both rx and tx interrupts are blocked at this point,
+        * regardless of which got us here.
+        */
+
+       irqbits = *R_IRQ_MASK2_RD;
 
        /* Handle received packets */
        if (irqbits & IO_STATE(R_IRQ_MASK2_RD, dma1_eop, active)) {
@@ -1219,7 +1351,7 @@ e100rxtx_interrupt(int irq, void *dev_id)
                         * allocate a new buffer to put a packet in.
                         */
                        e100_rx(dev);
-                       ((struct net_local *)dev->priv)->stats.rx_packets++;
+                       np->stats.rx_packets++;
                        /* restart/continue on the channel, for safety */
                        *R_DMA_CH1_CMD = IO_STATE(R_DMA_CH1_CMD, cmd, restart);
                        /* clear dma channel 1 eop/descr irq bits */
@@ -1233,9 +1365,8 @@ e100rxtx_interrupt(int irq, void *dev_id)
        }
 
        /* Report any packets that have been sent */
-       while (myFirstTxDesc != phys_to_virt(*R_DMA_CH0_FIRST) &&
-              myFirstTxDesc != myNextTxDesc)
-       {
+       while (virt_to_phys(myFirstTxDesc) != *R_DMA_CH0_FIRST &&
+              (netif_queue_stopped(dev) || myFirstTxDesc != myNextTxDesc)) {
                np->stats.tx_bytes += myFirstTxDesc->skb->len;
                np->stats.tx_packets++;
 
@@ -1244,19 +1375,15 @@ e100rxtx_interrupt(int irq, void *dev_id)
                dev_kfree_skb_irq(myFirstTxDesc->skb);
                myFirstTxDesc->skb = 0;
                myFirstTxDesc = phys_to_virt(myFirstTxDesc->descr.next);
+                /* Wake up queue. */
+               netif_wake_queue(dev);
        }
 
        if (irqbits & IO_STATE(R_IRQ_MASK2_RD, dma0_eop, active)) {
-               /* acknowledge the eop interrupt and wake up queue */
+               /* acknowledge the eop interrupt. */
                *R_DMA_CH0_CLR_INTR = IO_STATE(R_DMA_CH0_CLR_INTR, clr_eop, do);
-               netif_wake_queue(dev);
        }
 
-       /* Enable RX/TX IRQs again */
-       *R_IRQ_MASK2_SET =
-         IO_STATE(R_IRQ_MASK2_SET, dma0_eop, set) |
-         IO_STATE(R_IRQ_MASK2_SET, dma1_eop, set);
-
        return IRQ_HANDLED;
 }
 
@@ -1264,7 +1391,7 @@ static irqreturn_t
 e100nw_interrupt(int irq, void *dev_id)
 {
        struct net_device *dev = (struct net_device *)dev_id;
-       struct net_local *np = (struct net_local *)dev->priv;
+       struct net_local *np = netdev_priv(dev);
        unsigned long irqbits = *R_IRQ_MASK0_RD;
 
        /* check for underrun irq */
@@ -1286,7 +1413,6 @@ e100nw_interrupt(int irq, void *dev_id)
                SETS(network_tr_ctrl_shadow, R_NETWORK_TR_CTRL, clr_error, clr);
                *R_NETWORK_TR_CTRL = network_tr_ctrl_shadow;
                SETS(network_tr_ctrl_shadow, R_NETWORK_TR_CTRL, clr_error, nop);
-               *R_NETWORK_TR_CTRL = IO_STATE(R_NETWORK_TR_CTRL, clr_error, clr);
                np->stats.tx_errors++;
                D(printk("ethernet excessive collisions!\n"));
        }
@@ -1299,12 +1425,13 @@ e100_rx(struct net_device *dev)
 {
        struct sk_buff *skb;
        int length = 0;
-       struct net_local *np = (struct net_local *)dev->priv;
+       struct net_local *np = netdev_priv(dev);
        unsigned char *skb_data_ptr;
 #ifdef ETHDEBUG
        int i;
 #endif
-
+       etrax_eth_descr *prevRxDesc;  /* The descriptor right before myNextRxDesc */
+       spin_lock(&np->led_lock);
        if (!led_active && time_after(jiffies, led_next_time)) {
                /* light the network leds depending on the current speed. */
                e100_set_network_leds(NETWORK_ACTIVITY);
@@ -1314,9 +1441,10 @@ e100_rx(struct net_device *dev)
                led_active = 1;
                mod_timer(&clear_led_timer, jiffies + HZ/10);
        }
+       spin_unlock(&np->led_lock);
 
        length = myNextRxDesc->descr.hw_len - 4;
-       ((struct net_local *)dev->priv)->stats.rx_bytes += length;
+       np->stats.rx_bytes += length;
 
 #ifdef ETHDEBUG
        printk("Got a packet of length %d:\n", length);
@@ -1336,7 +1464,7 @@ e100_rx(struct net_device *dev)
                if (!skb) {
                        np->stats.rx_errors++;
                        printk(KERN_NOTICE "%s: Memory squeeze, dropping packet.\n", dev->name);
-                       return;
+                       goto update_nextrxdesc;
                }
 
                skb_put(skb, length - ETHER_HEAD_LEN);        /* allocate room for the packet body */
@@ -1354,15 +1482,15 @@ e100_rx(struct net_device *dev)
        else {
                /* Large packet, send directly to upper layers and allocate new
                 * memory (aligned to cache line boundary to avoid bug).
-                * Before sending the skb to upper layers we must make sure that
-                * skb->data points to the aligned start of the packet.
+                * Before sending the skb to upper layers we must make sure
+                * that skb->data points to the aligned start of the packet.
                 */
                int align;
                struct sk_buff *new_skb = dev_alloc_skb(MAX_MEDIA_DATA_SIZE + 2 * L1_CACHE_BYTES);
                if (!new_skb) {
                        np->stats.rx_errors++;
                        printk(KERN_NOTICE "%s: Memory squeeze, dropping packet.\n", dev->name);
-                       return;
+                       goto update_nextrxdesc;
                }
                skb = myNextRxDesc->skb;
                align = (int)phys_to_virt(myNextRxDesc->descr.buf) - (int)skb->data;
@@ -1377,9 +1505,10 @@ e100_rx(struct net_device *dev)
        /* Send the packet to the upper layers */
        netif_rx(skb);
 
+  update_nextrxdesc:
        /* Prepare for next packet */
        myNextRxDesc->descr.status = 0;
-       myPrevRxDesc = myNextRxDesc;
+       prevRxDesc = myNextRxDesc;
        myNextRxDesc = phys_to_virt(myNextRxDesc->descr.next);
 
        rx_queue_len++;
@@ -1387,9 +1516,9 @@ e100_rx(struct net_device *dev)
        /* Check if descriptors should be returned */
        if (rx_queue_len == RX_QUEUE_THRESHOLD) {
                flush_etrax_cache();
-               myPrevRxDesc->descr.ctrl |= d_eol;
+               prevRxDesc->descr.ctrl |= d_eol;
                myLastRxDesc->descr.ctrl &= ~d_eol;
-               myLastRxDesc = myPrevRxDesc;
+               myLastRxDesc = prevRxDesc;
                rx_queue_len = 0;
        }
 }
@@ -1398,7 +1527,7 @@ e100_rx(struct net_device *dev)
 static int
 e100_close(struct net_device *dev)
 {
-       struct net_local *np = (struct net_local *)dev->priv;
+       struct net_local *np = netdev_priv(dev);
 
        printk(KERN_INFO "Closing %s.\n", dev->name);
 
@@ -1426,6 +1555,9 @@ e100_close(struct net_device *dev)
        free_irq(NETWORK_DMA_TX_IRQ_NBR, (void *)dev);
        free_irq(NETWORK_STATUS_IRQ_NBR, (void *)dev);
 
+       cris_free_dma(NETWORK_TX_DMA_NBR, cardname);
+       cris_free_dma(NETWORK_RX_DMA_NBR, cardname);
+
        /* Update the statistics here. */
 
        update_rx_stats(&np->stats);
@@ -1443,18 +1575,11 @@ e100_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {
        struct mii_ioctl_data *data = if_mii(ifr);
        struct net_local *np = netdev_priv(dev);
+       int rc = 0;
+        int old_autoneg;
 
        spin_lock(&np->lock); /* Preempt protection */
        switch (cmd) {
-               case SIOCGMIIPHY: /* Get PHY address */
-                       data->phy_id = mdio_phy_addr;
-                       break;
-               case SIOCGMIIREG: /* Read MII register */
-                       data->val_out = e100_get_mdio_reg(dev, mdio_phy_addr, data->reg_num);
-                       break;
-               case SIOCSMIIREG: /* Write MII register */
-                       e100_set_mdio_reg(dev, mdio_phy_addr, data->reg_num, data->val_in);
-                       break;
                /* The ioctls below should be considered obsolete but are */
                /* still present for compatability with old scripts/apps  */
                case SET_ETH_SPEED_10:                  /* 10 Mbps */
@@ -1463,60 +1588,47 @@ e100_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
                case SET_ETH_SPEED_100:                /* 100 Mbps */
                        e100_set_speed(dev, 100);
                        break;
-               case SET_ETH_SPEED_AUTO:              /* Auto negotiate speed */
+               case SET_ETH_SPEED_AUTO:        /* Auto-negotiate speed */
                        e100_set_speed(dev, 0);
                        break;
-               case SET_ETH_DUPLEX_HALF:              /* Half duplex. */
+               case SET_ETH_DUPLEX_HALF:       /* Half duplex */
                        e100_set_duplex(dev, half);
                        break;
-               case SET_ETH_DUPLEX_FULL:              /* Full duplex. */
+               case SET_ETH_DUPLEX_FULL:       /* Full duplex */
                        e100_set_duplex(dev, full);
                        break;
-               case SET_ETH_DUPLEX_AUTO:             /* Autonegotiate duplex*/
+               case SET_ETH_DUPLEX_AUTO:       /* Auto-negotiate duplex */
                        e100_set_duplex(dev, autoneg);
                        break;
+               case SET_ETH_AUTONEG:
+                       old_autoneg = autoneg_normal;
+                       autoneg_normal = *(int*)data;
+                       if (autoneg_normal != old_autoneg)
+                               e100_negotiate(dev);
+                       break;
                default:
-                       return -EINVAL;
+                       rc = generic_mii_ioctl(&np->mii_if, if_mii(ifr),
+                                               cmd, NULL);
+                       break;
        }
        spin_unlock(&np->lock);
-       return 0;
+       return rc;
 }
 
-static int e100_set_settings(struct net_device *dev,
-                            struct ethtool_cmd *ecmd)
+static int e100_get_settings(struct net_device *dev,
+                            struct ethtool_cmd *cmd)
 {
-       ecmd->supported = SUPPORTED_Autoneg | SUPPORTED_TP | SUPPORTED_MII |
-                         SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full |
-                         SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full;
-       ecmd->port = PORT_TP;
-       ecmd->transceiver = XCVR_EXTERNAL;
-       ecmd->phy_address = mdio_phy_addr;
-       ecmd->speed = current_speed;
-       ecmd->duplex = full_duplex ? DUPLEX_FULL : DUPLEX_HALF;
-       ecmd->advertising = ADVERTISED_TP;
+       struct net_local *np = netdev_priv(dev);
+       int err;
 
-       if (current_duplex == autoneg && current_speed_selection == 0)
-               ecmd->advertising |= ADVERTISED_Autoneg;
-       else {
-               ecmd->advertising |=
-                       ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full |
-                       ADVERTISED_100baseT_Half | ADVERTISED_100baseT_Full;
-               if (current_speed_selection == 10)
-                       ecmd->advertising &= ~(ADVERTISED_100baseT_Half |
-                                              ADVERTISED_100baseT_Full);
-               else if (current_speed_selection == 100)
-                       ecmd->advertising &= ~(ADVERTISED_10baseT_Half |
-                                              ADVERTISED_10baseT_Full);
-               if (current_duplex == half)
-                       ecmd->advertising &= ~(ADVERTISED_10baseT_Full |
-                                              ADVERTISED_100baseT_Full);
-               else if (current_duplex == full)
-                       ecmd->advertising &= ~(ADVERTISED_10baseT_Half |
-                                              ADVERTISED_100baseT_Half);
-       }
+       spin_lock_irq(&np->lock);
+       err = mii_ethtool_gset(&np->mii_if, cmd);
+       spin_unlock_irq(&np->lock);
 
-       ecmd->autoneg = AUTONEG_ENABLE;
-       return 0;
+       /* The PHY may support 1000baseT, but the Etrax100 does not.  */
+       cmd->supported &= ~(SUPPORTED_1000baseT_Half
+                           | SUPPORTED_1000baseT_Full);
+       return err;
 }
 
 static int e100_set_settings(struct net_device *dev,
@@ -1560,7 +1672,8 @@ static const struct ethtool_ops e100_ethtool_ops = {
 static int
 e100_set_config(struct net_device *dev, struct ifmap *map)
 {
-       struct net_local *np = (struct net_local *)dev->priv;
+       struct net_local *np = netdev_priv(dev);
+
        spin_lock(&np->lock); /* Preempt protection */
 
        switch(map->port) {
@@ -1612,7 +1725,6 @@ update_tx_stats(struct net_device_stats *es)
        es->collisions +=
                IO_EXTRACT(R_TR_COUNTERS, single_col, r) +
                IO_EXTRACT(R_TR_COUNTERS, multiple_col, r);
-       es->tx_errors += IO_EXTRACT(R_TR_COUNTERS, deferred, r);
 }
 
 /*
@@ -1622,8 +1734,9 @@ update_tx_stats(struct net_device_stats *es)
 static struct net_device_stats *
 e100_get_stats(struct net_device *dev)
 {
-       struct net_local *lp = (struct net_local *)dev->priv;
+       struct net_local *lp = netdev_priv(dev);
        unsigned long flags;
+
        spin_lock_irqsave(&lp->lock, flags);
 
        update_rx_stats(&lp->stats);
@@ -1643,13 +1756,13 @@ e100_get_stats(struct net_device *dev)
 static void
 set_multicast_list(struct net_device *dev)
 {
-       struct net_local *lp = (struct net_local *)dev->priv;
+       struct net_local *lp = netdev_priv(dev);
        int num_addr = dev->mc_count;
        unsigned long int lo_bits;
        unsigned long int hi_bits;
+
        spin_lock(&lp->lock);
-       if (dev->flags & IFF_PROMISC)
-       {
+       if (dev->flags & IFF_PROMISC) {
                /* promiscuous mode */
                lo_bits = 0xfffffffful;
                hi_bits = 0xfffffffful;
@@ -1679,9 +1792,10 @@ set_multicast_list(struct net_device *dev)
                struct dev_mc_list *dmi = dev->mc_list;
                int i;
                char *baddr;
+
                lo_bits = 0x00000000ul;
                hi_bits = 0x00000000ul;
-               for (i=0; i<num_addr; i++) {
+               for (i = 0; i < num_addr; i++) {
                        /* Calculate the hash index for the GA registers */
 
                        hash_ix = 0;
@@ -1708,8 +1822,7 @@ set_multicast_list(struct net_device *dev)
 
                        if (hash_ix >= 32) {
                                hi_bits |= (1 << (hash_ix-32));
-                       }
-                       else {
+                       } else {
                                lo_bits |= (1 << hash_ix);
                        }
                        dmi = dmi->next;
@@ -1724,10 +1837,11 @@ set_multicast_list(struct net_device *dev)
 }
 
 void
-e100_hardware_send_packet(char *buf, int length)
+e100_hardware_send_packet(struct net_local *np, char *buf, int length)
 {
        D(printk("e100 send pack, buf 0x%x len %d\n", buf, length));
 
+       spin_lock(&np->led_lock);
        if (!led_active && time_after(jiffies, led_next_time)) {
                /* light the network leds depending on the current speed. */
                e100_set_network_leds(NETWORK_ACTIVITY);
@@ -1737,6 +1851,7 @@ e100_hardware_send_packet(char *buf, int length)
                led_active = 1;
                mod_timer(&clear_led_timer, jiffies + HZ/10);
        }
+       spin_unlock(&np->led_lock);
 
        /* configure the tx dma descriptor */
        myNextTxDesc->descr.sw_len = length;
@@ -1754,6 +1869,11 @@ e100_hardware_send_packet(char *buf, int length)
 static void
 e100_clear_network_leds(unsigned long dummy)
 {
+       struct net_device *dev = (struct net_device *)dummy;
+       struct net_local *np = netdev_priv(dev);
+
+       spin_lock(&np->led_lock);
+
        if (led_active && time_after(jiffies, led_next_time)) {
                e100_set_network_leds(NO_NETWORK_ACTIVITY);
 
@@ -1761,6 +1881,8 @@ e100_clear_network_leds(unsigned long dummy)
                led_next_time = jiffies + NET_FLASH_PAUSE;
                led_active = 0;
        }
+
+       spin_unlock(&np->led_lock);
 }
 
 static void
@@ -1781,19 +1903,25 @@ e100_set_network_leds(int active)
 #else
                LED_NETWORK_SET(LED_OFF);
 #endif
-       }
-       else if (light_leds) {
+       } else if (light_leds) {
                if (current_speed == 10) {
                        LED_NETWORK_SET(LED_ORANGE);
                } else {
                        LED_NETWORK_SET(LED_GREEN);
                }
-       }
-       else {
+       } else {
                LED_NETWORK_SET(LED_OFF);
        }
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void
+e100_netpoll(struct net_device* netdev)
+{
+       e100rxtx_interrupt(NETWORK_DMA_TX_IRQ_NBR, netdev, NULL);
+}
+#endif
+
 static int
 etrax_init_module(void)
 {
index 781ed99684894b2ba72cfdfb301c21a79b01f62a..3b840283a9c31c41c98e6564577d6fce3d204082 100644 (file)
@@ -351,4 +351,12 @@ enum e1000_state_t {
        __E1000_DOWN
 };
 
+extern char e1000_driver_name[];
+extern const char e1000_driver_version[];
+
+extern void e1000_power_up_phy(struct e1000_adapter *);
+extern void e1000_set_ethtool_ops(struct net_device *netdev);
+extern void e1000_check_options(struct e1000_adapter *adapter);
+
+
 #endif /* _E1000_H_ */
index 6c9a643426f59eba5019393b5c6cf69705a69ab7..667f18bcc1725b41b43529033c38a059606cfbec 100644 (file)
@@ -32,9 +32,6 @@
 
 #include <asm/uaccess.h>
 
-extern char e1000_driver_name[];
-extern char e1000_driver_version[];
-
 extern int e1000_up(struct e1000_adapter *adapter);
 extern void e1000_down(struct e1000_adapter *adapter);
 extern void e1000_reinit_locked(struct e1000_adapter *adapter);
@@ -733,16 +730,16 @@ err_setup:
 
 #define REG_PATTERN_TEST(R, M, W)                                              \
 {                                                                              \
-       uint32_t pat, value;                                                   \
-       uint32_t test[] =                                                      \
+       uint32_t pat, val;                                                     \
+       const uint32_t test[] =                                                \
                {0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF};              \
-       for (pat = 0; pat < ARRAY_SIZE(test); pat++) {              \
+       for (pat = 0; pat < ARRAY_SIZE(test); pat++) {                         \
                E1000_WRITE_REG(&adapter->hw, R, (test[pat] & W));             \
-               value = E1000_READ_REG(&adapter->hw, R);                       \
-               if (value != (test[pat] & W & M)) {                             \
+               val = E1000_READ_REG(&adapter->hw, R);                         \
+               if (val != (test[pat] & W & M)) {                              \
                        DPRINTK(DRV, ERR, "pattern test reg %04X failed: got " \
                                "0x%08X expected 0x%08X\n",                    \
-                               E1000_##R, value, (test[pat] & W & M));        \
+                               E1000_##R, val, (test[pat] & W & M));          \
                        *data = (adapter->hw.mac_type < e1000_82543) ?         \
                                E1000_82542_##R : E1000_##R;                   \
                        return 1;                                              \
@@ -752,12 +749,12 @@ err_setup:
 
 #define REG_SET_AND_CHECK(R, M, W)                                             \
 {                                                                              \
-       uint32_t value;                                                        \
+       uint32_t val;                                                          \
        E1000_WRITE_REG(&adapter->hw, R, W & M);                               \
-       value = E1000_READ_REG(&adapter->hw, R);                               \
-       if ((W & M) != (value & M)) {                                          \
+       val = E1000_READ_REG(&adapter->hw, R);                                 \
+       if ((W & M) != (val & M)) {                                            \
                DPRINTK(DRV, ERR, "set/check reg %04X test failed: got 0x%08X "\
-                       "expected 0x%08X\n", E1000_##R, (value & M), (W & M)); \
+                       "expected 0x%08X\n", E1000_##R, (val & M), (W & M));   \
                *data = (adapter->hw.mac_type < e1000_82543) ?                 \
                        E1000_82542_##R : E1000_##R;                           \
                return 1;                                                      \
@@ -1621,8 +1618,6 @@ e1000_get_sset_count(struct net_device *netdev, int sset)
        }
 }
 
-extern void e1000_power_up_phy(struct e1000_adapter *);
-
 static void
 e1000_diag_test(struct net_device *netdev,
                   struct ethtool_test *eth_test, uint64_t *data)
@@ -1859,8 +1854,8 @@ e1000_phys_id(struct net_device *netdev, uint32_t data)
 {
        struct e1000_adapter *adapter = netdev_priv(netdev);
 
-       if (!data || data > (uint32_t)(MAX_SCHEDULE_TIMEOUT / HZ))
-               data = (uint32_t)(MAX_SCHEDULE_TIMEOUT / HZ);
+       if (!data)
+               data = INT_MAX;
 
        if (adapter->hw.mac_type < e1000_82571) {
                if (!adapter->blink_timer.function) {
index 8fa0fe4009d56872fa1e30425251275f9be2d77b..7c6888c58c21d2e6e6033a9b6219caf3a6a8f6b6 100644 (file)
@@ -8607,7 +8607,7 @@ e1000_read_ich8_data(struct e1000_hw *hw, uint32_t index,
 
     DEBUGFUNC("e1000_read_ich8_data");
 
-    if (size < 1  || size > 2 || data == 0x0 ||
+    if (size < 1  || size > 2 || data == NULL ||
         index > ICH_FLASH_LINEAR_ADDR_MASK)
         return error;
 
@@ -8841,7 +8841,7 @@ e1000_read_ich8_word(struct e1000_hw *hw, uint32_t index, uint16_t *data)
  * amount of NVM used in each bank is a *minimum* of 4 KBytes, but in fact the
  * bank size may be 4, 8 or 64 KBytes
  *****************************************************************************/
-int32_t
+static int32_t
 e1000_erase_ich8_4k_segment(struct e1000_hw *hw, uint32_t bank)
 {
     union ich8_hws_flash_status hsfsts;
index f1ce348470cc14afa6e8ea68eeb0875d4b927094..cf39473ef90a5e04ea65c04ac247a30bc6f06915 100644 (file)
@@ -37,8 +37,8 @@ static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
 #define DRIVERNAPI "-NAPI"
 #endif
 #define DRV_VERSION "7.3.20-k2"DRIVERNAPI
-char e1000_driver_version[] = DRV_VERSION;
-static char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation.";
+const char e1000_driver_version[] = DRV_VERSION;
+static const char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation.";
 
 /* e1000_pci_tbl - PCI Device ID Table
  *
@@ -188,7 +188,6 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
 static int e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd);
 static int e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr,
                           int cmd);
-void e1000_set_ethtool_ops(struct net_device *netdev);
 static void e1000_enter_82542_rst(struct e1000_adapter *adapter);
 static void e1000_leave_82542_rst(struct e1000_adapter *adapter);
 static void e1000_tx_timeout(struct net_device *dev);
@@ -213,8 +212,6 @@ static void e1000_shutdown(struct pci_dev *pdev);
 static void e1000_netpoll (struct net_device *netdev);
 #endif
 
-extern void e1000_check_options(struct e1000_adapter *adapter);
-
 #define COPYBREAK_DEFAULT 256
 static unsigned int copybreak __read_mostly = COPYBREAK_DEFAULT;
 module_param(copybreak, uint, 0644);
@@ -4807,6 +4804,7 @@ e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
                        spin_unlock_irqrestore(&adapter->stats_lock, flags);
                        return -EIO;
                }
+               spin_unlock_irqrestore(&adapter->stats_lock, flags);
                if (adapter->hw.media_type == e1000_media_type_copper) {
                        switch (data->reg_num) {
                        case PHY_CTRL:
@@ -4827,12 +4825,8 @@ e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
                                                   DUPLEX_HALF;
                                        retval = e1000_set_spd_dplx(adapter,
                                                                    spddplx);
-                                       if (retval) {
-                                               spin_unlock_irqrestore(
-                                                       &adapter->stats_lock,
-                                                       flags);
+                                       if (retval)
                                                return retval;
-                                       }
                                }
                                if (netif_running(adapter->netdev))
                                        e1000_reinit_locked(adapter);
@@ -4841,11 +4835,8 @@ e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
                                break;
                        case M88E1000_PHY_SPEC_CTRL:
                        case M88E1000_EXT_PHY_SPEC_CTRL:
-                               if (e1000_phy_reset(&adapter->hw)) {
-                                       spin_unlock_irqrestore(
-                                               &adapter->stats_lock, flags);
+                               if (e1000_phy_reset(&adapter->hw))
                                        return -EIO;
-                               }
                                break;
                        }
                } else {
@@ -4860,7 +4851,6 @@ e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
                                break;
                        }
                }
-               spin_unlock_irqrestore(&adapter->stats_lock, flags);
                break;
        default:
                return -EOPNOTSUPP;
index f485874a63f56f6d5b0eaee18e3813cf3aa75c7a..e6565ce686bcefd91499e6304ebac33f0aa97445 100644 (file)
@@ -46,7 +46,7 @@
 #define E1000_PARAM_INIT { [0 ... E1000_MAX_NIC] = OPTION_UNSET }
 #define E1000_PARAM(X, desc) \
        static int __devinitdata X[E1000_MAX_NIC+1] = E1000_PARAM_INIT; \
-       static int num_##X = 0; \
+       static unsigned int num_##X; \
        module_param_array_named(X, X, int, &num_##X, 0); \
        MODULE_PARM_DESC(X, desc);
 
@@ -198,9 +198,9 @@ E1000_PARAM(KumeranLockLoss, "Enable Kumeran lock loss workaround");
 
 struct e1000_option {
        enum { enable_option, range_option, list_option } type;
-       char *name;
-       char *err;
-       int  def;
+       const char *name;
+       const char *err;
+       int def;
        union {
                struct { /* range_option info */
                        int min;
@@ -214,8 +214,9 @@ struct e1000_option {
 };
 
 static int __devinit
-e1000_validate_option(int *value, struct e1000_option *opt,
-               struct e1000_adapter *adapter)
+e1000_validate_option(unsigned int *value,
+                     const struct e1000_option *opt,
+                     struct e1000_adapter *adapter)
 {
        if (*value == OPTION_UNSET) {
                *value = opt->def;
@@ -348,7 +349,7 @@ e1000_check_options(struct e1000_adapter *adapter)
                };
 
                if (num_XsumRX > bd) {
-                       int rx_csum = XsumRX[bd];
+                       unsigned int rx_csum = XsumRX[bd];
                        e1000_validate_option(&rx_csum, &opt, adapter);
                        adapter->rx_csum = rx_csum;
                } else {
@@ -374,7 +375,7 @@ e1000_check_options(struct e1000_adapter *adapter)
                };
 
                if (num_FlowControl > bd) {
-                       int fc = FlowControl[bd];
+                       unsigned int fc = FlowControl[bd];
                        e1000_validate_option(&fc, &opt, adapter);
                        adapter->hw.fc = adapter->hw.original_fc = fc;
                } else {
@@ -506,7 +507,7 @@ e1000_check_options(struct e1000_adapter *adapter)
                };
 
                if (num_SmartPowerDownEnable > bd) {
-                       int spd = SmartPowerDownEnable[bd];
+                       unsigned int spd = SmartPowerDownEnable[bd];
                        e1000_validate_option(&spd, &opt, adapter);
                        adapter->smart_power_down = spd;
                } else {
@@ -522,7 +523,7 @@ e1000_check_options(struct e1000_adapter *adapter)
                };
 
                if (num_KumeranLockLoss > bd) {
-                       int kmrn_lock_loss = KumeranLockLoss[bd];
+                       unsigned int kmrn_lock_loss = KumeranLockLoss[bd];
                        e1000_validate_option(&kmrn_lock_loss, &opt, adapter);
                        adapter->hw.kmrn_lock_loss_workaround_disabled = !kmrn_lock_loss;
                } else {
@@ -581,7 +582,7 @@ e1000_check_fiber_options(struct e1000_adapter *adapter)
 static void __devinit
 e1000_check_copper_options(struct e1000_adapter *adapter)
 {
-       int speed, dplx, an;
+       unsigned int speed, dplx, an;
        int bd = adapter->bd_number;
 
        { /* Speed */
index cf70522fc85160d9900dc5558c732511b3b453eb..14141a55eaa6f1f14754a09ada3377321fba8c76 100644 (file)
@@ -283,7 +283,7 @@ static s32 e1000_get_invariants_82571(struct e1000_adapter *adapter)
                        adapter->flags &= ~FLAG_HAS_WOL;
                /* quad ports only support WoL on port A */
                if (adapter->flags & FLAG_IS_QUAD_PORT &&
-                   (!adapter->flags & FLAG_IS_QUAD_PORT_A))
+                   (!(adapter->flags & FLAG_IS_QUAD_PORT_A)))
                        adapter->flags &= ~FLAG_HAS_WOL;
                break;
 
index d2499bb07c13c5d4f17e489b519453b2e53909e4..473f78de4be0d0bce40f3ed370a64f77ff692341 100644 (file)
@@ -122,7 +122,8 @@ struct e1000_buffer {
                        u16 next_to_watch;
                };
                /* RX */
-               struct page *page;
+               /* arrays of page information for packet split */
+               struct e1000_ps_page *ps_pages;
        };
 
 };
@@ -142,8 +143,6 @@ struct e1000_ring {
        /* array of buffer information structs */
        struct e1000_buffer *buffer_info;
 
-       /* arrays of page information for packet split */
-       struct e1000_ps_page *ps_pages;
        struct sk_buff *rx_skb_top;
 
        struct e1000_queue_stats stats;
index 0666e62e9ad29fb0fcbcd34043ac0178ed3325b3..6a39784e7ee2a02de8ff32c4b6eece49465d3cad 100644 (file)
@@ -1680,8 +1680,8 @@ static int e1000_phys_id(struct net_device *netdev, u32 data)
 {
        struct e1000_adapter *adapter = netdev_priv(netdev);
 
-       if (!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ))
-               data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ);
+       if (!data)
+               data = INT_MAX;
 
        if (adapter->hw.phy.type == e1000_phy_ife) {
                if (!adapter->blink_timer.function) {
index 033e124d1c1f5424c70e633f726d92f4c68d4c7d..4fd2e23720b69f080569b9c9a789ba2b8fcb7964 100644 (file)
@@ -245,37 +245,36 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
                rx_desc = E1000_RX_DESC_PS(*rx_ring, i);
 
                for (j = 0; j < PS_PAGE_BUFFERS; j++) {
-                       ps_page = &rx_ring->ps_pages[(i * PS_PAGE_BUFFERS)
-                                                    + j];
-                       if (j < adapter->rx_ps_pages) {
+                       ps_page = &buffer_info->ps_pages[j];
+                       if (j >= adapter->rx_ps_pages) {
+                               /* all unused desc entries get hw null ptr */
+                               rx_desc->read.buffer_addr[j+1] = ~0;
+                               continue;
+                       }
+                       if (!ps_page->page) {
+                               ps_page->page = alloc_page(GFP_ATOMIC);
                                if (!ps_page->page) {
-                                       ps_page->page = alloc_page(GFP_ATOMIC);
-                                       if (!ps_page->page) {
-                                               adapter->alloc_rx_buff_failed++;
-                                               goto no_buffers;
-                                       }
-                                       ps_page->dma = pci_map_page(pdev,
-                                                          ps_page->page,
-                                                          0, PAGE_SIZE,
-                                                          PCI_DMA_FROMDEVICE);
-                                       if (pci_dma_mapping_error(
-                                                       ps_page->dma)) {
-                                               dev_err(&adapter->pdev->dev,
-                                                 "RX DMA page map failed\n");
-                                               adapter->rx_dma_failed++;
-                                               goto no_buffers;
-                                       }
+                                       adapter->alloc_rx_buff_failed++;
+                                       goto no_buffers;
+                               }
+                               ps_page->dma = pci_map_page(pdev,
+                                                  ps_page->page,
+                                                  0, PAGE_SIZE,
+                                                  PCI_DMA_FROMDEVICE);
+                               if (pci_dma_mapping_error(ps_page->dma)) {
+                                       dev_err(&adapter->pdev->dev,
+                                         "RX DMA page map failed\n");
+                                       adapter->rx_dma_failed++;
+                                       goto no_buffers;
                                }
-                               /*
-                                * Refresh the desc even if buffer_addrs
-                                * didn't change because each write-back
-                                * erases this info.
-                                */
-                               rx_desc->read.buffer_addr[j+1] =
-                                    cpu_to_le64(ps_page->dma);
-                       } else {
-                               rx_desc->read.buffer_addr[j+1] = ~0;
                        }
+                       /*
+                        * Refresh the desc even if buffer_addrs
+                        * didn't change because each write-back
+                        * erases this info.
+                        */
+                       rx_desc->read.buffer_addr[j+1] =
+                            cpu_to_le64(ps_page->dma);
                }
 
                skb = netdev_alloc_skb(netdev,
@@ -333,94 +332,6 @@ no_buffers:
        }
 }
 
-/**
- * e1000_alloc_rx_buffers_jumbo - Replace used jumbo receive buffers
- *
- * @adapter: address of board private structure
- * @cleaned_count: number of buffers to allocate this pass
- **/
-static void e1000_alloc_rx_buffers_jumbo(struct e1000_adapter *adapter,
-                                        int cleaned_count)
-{
-       struct net_device *netdev = adapter->netdev;
-       struct pci_dev *pdev = adapter->pdev;
-       struct e1000_ring *rx_ring = adapter->rx_ring;
-       struct e1000_rx_desc *rx_desc;
-       struct e1000_buffer *buffer_info;
-       struct sk_buff *skb;
-       unsigned int i;
-       unsigned int bufsz = 256 -
-                            16 /*for skb_reserve */ -
-                            NET_IP_ALIGN;
-
-       i = rx_ring->next_to_use;
-       buffer_info = &rx_ring->buffer_info[i];
-
-       while (cleaned_count--) {
-               skb = buffer_info->skb;
-               if (skb) {
-                       skb_trim(skb, 0);
-                       goto check_page;
-               }
-
-               skb = netdev_alloc_skb(netdev, bufsz);
-               if (!skb) {
-                       /* Better luck next round */
-                       adapter->alloc_rx_buff_failed++;
-                       break;
-               }
-
-               /* Make buffer alignment 2 beyond a 16 byte boundary
-                * this will result in a 16 byte aligned IP header after
-                * the 14 byte MAC header is removed
-                */
-               skb_reserve(skb, NET_IP_ALIGN);
-
-               buffer_info->skb = skb;
-check_page:
-               /* allocate a new page if necessary */
-               if (!buffer_info->page) {
-                       buffer_info->page = alloc_page(GFP_ATOMIC);
-                       if (!buffer_info->page) {
-                               adapter->alloc_rx_buff_failed++;
-                               break;
-                       }
-               }
-
-               if (!buffer_info->dma)
-                       buffer_info->dma = pci_map_page(pdev,
-                                                       buffer_info->page, 0,
-                                                       PAGE_SIZE,
-                                                       PCI_DMA_FROMDEVICE);
-               if (pci_dma_mapping_error(buffer_info->dma)) {
-                       dev_err(&adapter->pdev->dev, "RX DMA page map failed\n");
-                       adapter->rx_dma_failed++;
-                       break;
-               }
-
-               rx_desc = E1000_RX_DESC(*rx_ring, i);
-               rx_desc->buffer_addr = cpu_to_le64(buffer_info->dma);
-
-               i++;
-               if (i == rx_ring->count)
-                       i = 0;
-               buffer_info = &rx_ring->buffer_info[i];
-       }
-
-       if (rx_ring->next_to_use != i) {
-               rx_ring->next_to_use = i;
-               if (i-- == 0)
-                       i = (rx_ring->count - 1);
-
-               /* Force memory writes to complete before letting h/w
-                * know there are new descriptors to fetch.  (Only
-                * applicable for weak-ordered memory model archs,
-                * such as IA-64). */
-               wmb();
-               writel(i, adapter->hw.hw_addr + rx_ring->tail);
-       }
-}
-
 /**
  * e1000_clean_rx_irq - Send received data up the network stack; legacy
  * @adapter: board private structure
@@ -495,10 +406,6 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
                        goto next_desc;
                }
 
-               /* adjust length to remove Ethernet CRC */
-               length -= 4;
-
-               /* probably a little skewed due to removing CRC */
                total_rx_bytes += length;
                total_rx_packets++;
 
@@ -554,15 +461,6 @@ next_desc:
        return cleaned;
 }
 
-static void e1000_consume_page(struct e1000_buffer *bi, struct sk_buff *skb,
-                              u16 length)
-{
-       bi->page = NULL;
-       skb->len += length;
-       skb->data_len += length;
-       skb->truesize += length;
-}
-
 static void e1000_put_txbuf(struct e1000_adapter *adapter,
                             struct e1000_buffer *buffer_info)
 {
@@ -698,174 +596,6 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
        return cleaned;
 }
 
-/**
- * e1000_clean_rx_irq_jumbo - Send received data up the network stack; legacy
- * @adapter: board private structure
- *
- * the return value indicates whether actual cleaning was done, there
- * is no guarantee that everything was cleaned
- **/
-static bool e1000_clean_rx_irq_jumbo(struct e1000_adapter *adapter,
-                                    int *work_done, int work_to_do)
-{
-       struct net_device *netdev = adapter->netdev;
-       struct pci_dev *pdev = adapter->pdev;
-       struct e1000_ring *rx_ring = adapter->rx_ring;
-       struct e1000_rx_desc *rx_desc, *next_rxd;
-       struct e1000_buffer *buffer_info, *next_buffer;
-       u32 length;
-       unsigned int i;
-       int cleaned_count = 0;
-       bool cleaned = 0;
-       unsigned int total_rx_bytes = 0, total_rx_packets = 0;
-
-       i = rx_ring->next_to_clean;
-       rx_desc = E1000_RX_DESC(*rx_ring, i);
-       buffer_info = &rx_ring->buffer_info[i];
-
-       while (rx_desc->status & E1000_RXD_STAT_DD) {
-               struct sk_buff *skb;
-               u8 status;
-
-               if (*work_done >= work_to_do)
-                       break;
-               (*work_done)++;
-
-               status = rx_desc->status;
-               skb = buffer_info->skb;
-               buffer_info->skb = NULL;
-
-               i++;
-               if (i == rx_ring->count)
-                       i = 0;
-               next_rxd = E1000_RX_DESC(*rx_ring, i);
-               prefetch(next_rxd);
-
-               next_buffer = &rx_ring->buffer_info[i];
-
-               cleaned = 1;
-               cleaned_count++;
-               pci_unmap_page(pdev,
-                              buffer_info->dma,
-                              PAGE_SIZE,
-                              PCI_DMA_FROMDEVICE);
-               buffer_info->dma = 0;
-
-               length = le16_to_cpu(rx_desc->length);
-
-               /* errors is only valid for DD + EOP descriptors */
-               if ((status & E1000_RXD_STAT_EOP) &&
-                   (rx_desc->errors & E1000_RXD_ERR_FRAME_ERR_MASK)) {
-                       /* recycle both page and skb */
-                       buffer_info->skb = skb;
-                       /* an error means any chain goes out the window too */
-                       if (rx_ring->rx_skb_top)
-                               dev_kfree_skb(rx_ring->rx_skb_top);
-                       rx_ring->rx_skb_top = NULL;
-                       goto next_desc;
-               }
-
-#define rxtop rx_ring->rx_skb_top
-               if (!(status & E1000_RXD_STAT_EOP)) {
-                       /* this descriptor is only the beginning (or middle) */
-                       if (!rxtop) {
-                               /* this is the beginning of a chain */
-                               rxtop = skb;
-                               skb_fill_page_desc(rxtop, 0, buffer_info->page,
-                                                  0, length);
-                       } else {
-                               /* this is the middle of a chain */
-                               skb_fill_page_desc(rxtop,
-                                                  skb_shinfo(rxtop)->nr_frags,
-                                                  buffer_info->page, 0,
-                                                  length);
-                               /* re-use the skb, only consumed the page */
-                               buffer_info->skb = skb;
-                       }
-                       e1000_consume_page(buffer_info, rxtop, length);
-                       goto next_desc;
-               } else {
-                       if (rxtop) {
-                               /* end of the chain */
-                               skb_fill_page_desc(rxtop,
-                                   skb_shinfo(rxtop)->nr_frags,
-                                   buffer_info->page, 0, length);
-                               /* re-use the current skb, we only consumed the
-                                * page */
-                               buffer_info->skb = skb;
-                               skb = rxtop;
-                               rxtop = NULL;
-                               e1000_consume_page(buffer_info, skb, length);
-                       } else {
-                               /* no chain, got EOP, this buf is the packet
-                                * copybreak to save the put_page/alloc_page */
-                               if (length <= copybreak &&
-                                   skb_tailroom(skb) >= length) {
-                                       u8 *vaddr;
-                                       vaddr = kmap_atomic(buffer_info->page,
-                                                          KM_SKB_DATA_SOFTIRQ);
-                                       memcpy(skb_tail_pointer(skb),
-                                              vaddr, length);
-                                       kunmap_atomic(vaddr,
-                                                     KM_SKB_DATA_SOFTIRQ);
-                                       /* re-use the page, so don't erase
-                                        * buffer_info->page */
-                                       skb_put(skb, length);
-                               } else {
-                                       skb_fill_page_desc(skb, 0,
-                                                          buffer_info->page, 0,
-                                                          length);
-                                       e1000_consume_page(buffer_info, skb,
-                                                          length);
-                               }
-                       }
-               }
-
-               /* Receive Checksum Offload XXX recompute due to CRC strip? */
-               e1000_rx_checksum(adapter,
-                                 (u32)(status) |
-                                 ((u32)(rx_desc->errors) << 24),
-                                 le16_to_cpu(rx_desc->csum), skb);
-
-               pskb_trim(skb, skb->len - 4);
-
-               /* probably a little skewed due to removing CRC */
-               total_rx_bytes += skb->len;
-               total_rx_packets++;
-
-               /* eth type trans needs skb->data to point to something */
-               if (!pskb_may_pull(skb, ETH_HLEN)) {
-                       ndev_err(netdev, "__pskb_pull_tail failed.\n");
-                       dev_kfree_skb(skb);
-                       goto next_desc;
-               }
-
-               e1000_receive_skb(adapter, netdev, skb,status,rx_desc->special);
-
-next_desc:
-               rx_desc->status = 0;
-
-               /* return some buffers to hardware, one at a time is too slow */
-               if (cleaned_count >= E1000_RX_BUFFER_WRITE) {
-                       adapter->alloc_rx_buf(adapter, cleaned_count);
-                       cleaned_count = 0;
-               }
-
-               /* use prefetched values */
-               rx_desc = next_rxd;
-               buffer_info = next_buffer;
-       }
-       rx_ring->next_to_clean = i;
-
-       cleaned_count = e1000_desc_unused(rx_ring);
-       if (cleaned_count)
-               adapter->alloc_rx_buf(adapter, cleaned_count);
-
-       adapter->total_rx_packets += total_rx_packets;
-       adapter->total_rx_bytes += total_rx_bytes;
-       return cleaned;
-}
-
 /**
  * e1000_clean_rx_irq_ps - Send received data up the network stack; packet split
  * @adapter: board private structure
@@ -953,7 +683,7 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
                    ((length + l1) <= adapter->rx_ps_bsize0)) {
                        u8 *vaddr;
 
-                       ps_page = &rx_ring->ps_pages[i * PS_PAGE_BUFFERS];
+                       ps_page = &buffer_info->ps_pages[0];
 
                        /* there is no documentation about how to call
                         * kmap_atomic, so we can't hold the mapping
@@ -965,8 +695,7 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
                        kunmap_atomic(vaddr, KM_SKB_DATA_SOFTIRQ);
                        pci_dma_sync_single_for_device(pdev, ps_page->dma,
                                PAGE_SIZE, PCI_DMA_FROMDEVICE);
-                       /* remove the CRC */
-                       l1 -= 4;
+
                        skb_put(skb, l1);
                        goto copydone;
                } /* if */
@@ -977,7 +706,7 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
                        if (!length)
                                break;
 
-                       ps_page = &rx_ring->ps_pages[(i * PS_PAGE_BUFFERS) + j];
+                       ps_page = &buffer_info->ps_pages[j];
                        pci_unmap_page(pdev, ps_page->dma, PAGE_SIZE,
                                       PCI_DMA_FROMDEVICE);
                        ps_page->dma = 0;
@@ -988,10 +717,6 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
                        skb->truesize += length;
                }
 
-               /* strip the ethernet crc, problem is we're using pages now so
-                * this whole operation can get a little cpu intensive */
-               pskb_trim(skb, skb->len - 4);
-
 copydone:
                total_rx_bytes += skb->len;
                total_rx_packets++;
@@ -1043,7 +768,6 @@ static void e1000_clean_rx_ring(struct e1000_adapter *adapter)
        struct e1000_buffer *buffer_info;
        struct e1000_ps_page *ps_page;
        struct pci_dev *pdev = adapter->pdev;
-       unsigned long size;
        unsigned int i, j;
 
        /* Free all the Rx ring sk_buffs */
@@ -1054,9 +778,6 @@ static void e1000_clean_rx_ring(struct e1000_adapter *adapter)
                                pci_unmap_single(pdev, buffer_info->dma,
                                                 adapter->rx_buffer_len,
                                                 PCI_DMA_FROMDEVICE);
-                       else if (adapter->clean_rx == e1000_clean_rx_irq_jumbo)
-                               pci_unmap_page(pdev, buffer_info->dma,
-                                              PAGE_SIZE, PCI_DMA_FROMDEVICE);
                        else if (adapter->clean_rx == e1000_clean_rx_irq_ps)
                                pci_unmap_single(pdev, buffer_info->dma,
                                                 adapter->rx_ps_bsize0,
@@ -1064,19 +785,13 @@ static void e1000_clean_rx_ring(struct e1000_adapter *adapter)
                        buffer_info->dma = 0;
                }
 
-               if (buffer_info->page) {
-                       put_page(buffer_info->page);
-                       buffer_info->page = NULL;
-               }
-
                if (buffer_info->skb) {
                        dev_kfree_skb(buffer_info->skb);
                        buffer_info->skb = NULL;
                }
 
                for (j = 0; j < PS_PAGE_BUFFERS; j++) {
-                       ps_page = &rx_ring->ps_pages[(i * PS_PAGE_BUFFERS)
-                                                    + j];
+                       ps_page = &buffer_info->ps_pages[j];
                        if (!ps_page->page)
                                break;
                        pci_unmap_page(pdev, ps_page->dma, PAGE_SIZE,
@@ -1093,12 +808,6 @@ static void e1000_clean_rx_ring(struct e1000_adapter *adapter)
                rx_ring->rx_skb_top = NULL;
        }
 
-       size = sizeof(struct e1000_buffer) * rx_ring->count;
-       memset(rx_ring->buffer_info, 0, size);
-       size = sizeof(struct e1000_ps_page)
-              * (rx_ring->count * PS_PAGE_BUFFERS);
-       memset(rx_ring->ps_pages, 0, size);
-
        /* Zero out the descriptor ring */
        memset(rx_ring->desc, 0, rx_ring->size);
 
@@ -1421,7 +1130,8 @@ err:
 int e1000e_setup_rx_resources(struct e1000_adapter *adapter)
 {
        struct e1000_ring *rx_ring = adapter->rx_ring;
-       int size, desc_len, err = -ENOMEM;
+       struct e1000_buffer *buffer_info;
+       int i, size, desc_len, err = -ENOMEM;
 
        size = sizeof(struct e1000_buffer) * rx_ring->count;
        rx_ring->buffer_info = vmalloc(size);
@@ -1429,11 +1139,14 @@ int e1000e_setup_rx_resources(struct e1000_adapter *adapter)
                goto err;
        memset(rx_ring->buffer_info, 0, size);
 
-       rx_ring->ps_pages = kcalloc(rx_ring->count * PS_PAGE_BUFFERS,
-                                   sizeof(struct e1000_ps_page),
-                                   GFP_KERNEL);
-       if (!rx_ring->ps_pages)
-               goto err;
+       for (i = 0; i < rx_ring->count; i++) {
+               buffer_info = &rx_ring->buffer_info[i];
+               buffer_info->ps_pages = kcalloc(PS_PAGE_BUFFERS,
+                                               sizeof(struct e1000_ps_page),
+                                               GFP_KERNEL);
+               if (!buffer_info->ps_pages)
+                       goto err_pages;
+       }
 
        desc_len = sizeof(union e1000_rx_desc_packet_split);
 
@@ -1443,16 +1156,21 @@ int e1000e_setup_rx_resources(struct e1000_adapter *adapter)
 
        err = e1000_alloc_ring_dma(adapter, rx_ring);
        if (err)
-               goto err;
+               goto err_pages;
 
        rx_ring->next_to_clean = 0;
        rx_ring->next_to_use = 0;
        rx_ring->rx_skb_top = NULL;
 
        return 0;
+
+err_pages:
+       for (i = 0; i < rx_ring->count; i++) {
+               buffer_info = &rx_ring->buffer_info[i];
+               kfree(buffer_info->ps_pages);
+       }
 err:
        vfree(rx_ring->buffer_info);
-       kfree(rx_ring->ps_pages);
        ndev_err(adapter->netdev,
        "Unable to allocate memory for the transmit descriptor ring\n");
        return err;
@@ -1518,15 +1236,17 @@ void e1000e_free_rx_resources(struct e1000_adapter *adapter)
 {
        struct pci_dev *pdev = adapter->pdev;
        struct e1000_ring *rx_ring = adapter->rx_ring;
+       int i;
 
        e1000_clean_rx_ring(adapter);
 
+       for (i = 0; i < rx_ring->count; i++) {
+               kfree(rx_ring->buffer_info[i].ps_pages);
+       }
+
        vfree(rx_ring->buffer_info);
        rx_ring->buffer_info = NULL;
 
-       kfree(rx_ring->ps_pages);
-       rx_ring->ps_pages = NULL;
-
        dma_free_coherent(&pdev->dev, rx_ring->size, rx_ring->desc,
                          rx_ring->dma);
        rx_ring->desc = NULL;
@@ -2032,9 +1752,11 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)
 
                ew32(RFCTL, rfctl);
 
-               /* disable the stripping of CRC because it breaks
-                * BMC firmware connected over SMBUS */
-               rctl |= E1000_RCTL_DTYP_PS /* | E1000_RCTL_SECRC */;
+               /* Enable Packet split descriptors */
+               rctl |= E1000_RCTL_DTYP_PS;
+               
+               /* Enable hardware CRC frame stripping */
+               rctl |= E1000_RCTL_SECRC;
 
                psrctl |= adapter->rx_ps_bsize0 >>
                        E1000_PSRCTL_BSIZE0_SHIFT;
@@ -2077,11 +1799,6 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
                        sizeof(union e1000_rx_desc_packet_split);
                adapter->clean_rx = e1000_clean_rx_irq_ps;
                adapter->alloc_rx_buf = e1000_alloc_rx_buffers_ps;
-       } else if (adapter->netdev->mtu > ETH_FRAME_LEN + VLAN_HLEN + 4) {
-               rdlen = rx_ring->count *
-                       sizeof(struct e1000_rx_desc);
-               adapter->clean_rx = e1000_clean_rx_irq_jumbo;
-               adapter->alloc_rx_buf = e1000_alloc_rx_buffers_jumbo;
        } else {
                rdlen = rx_ring->count *
                        sizeof(struct e1000_rx_desc);
@@ -2326,8 +2043,11 @@ void e1000e_reset(struct e1000_adapter *adapter)
        struct e1000_mac_info *mac = &adapter->hw.mac;
        struct e1000_hw *hw = &adapter->hw;
        u32 tx_space, min_tx_space, min_rx_space;
+       u32 pba;
        u16 hwm;
 
+       ew32(PBA, adapter->pba);
+
        if (mac->max_frame_size > ETH_FRAME_LEN + ETH_FCS_LEN ) {
                /* To maintain wire speed transmits, the Tx FIFO should be
                 * large enough to accommodate two full transmit packets,
@@ -2335,11 +2055,11 @@ void e1000e_reset(struct e1000_adapter *adapter)
                 * the Rx FIFO should be large enough to accommodate at least
                 * one full receive packet and is similarly rounded up and
                 * expressed in KB. */
-               adapter->pba = er32(PBA);
+               pba = er32(PBA);
                /* upper 16 bits has Tx packet buffer allocation size in KB */
-               tx_space = adapter->pba >> 16;
+               tx_space = pba >> 16;
                /* lower 16 bits has Rx packet buffer allocation size in KB */
-               adapter->pba &= 0xffff;
+               pba &= 0xffff;
                /* the tx fifo also stores 16 bytes of information about the tx
                 * but don't include ethernet FCS because hardware appends it */
                min_tx_space = (mac->max_frame_size +
@@ -2355,20 +2075,21 @@ void e1000e_reset(struct e1000_adapter *adapter)
                /* If current Tx allocation is less than the min Tx FIFO size,
                 * and the min Tx FIFO size is less than the current Rx FIFO
                 * allocation, take space away from current Rx allocation */
-               if (tx_space < min_tx_space &&
-                   ((min_tx_space - tx_space) < adapter->pba)) {
-                       adapter->pba -= - (min_tx_space - tx_space);
+               if ((tx_space < min_tx_space) &&
+                   ((min_tx_space - tx_space) < pba)) {
+                       pba -= min_tx_space - tx_space;
 
                        /* if short on rx space, rx wins and must trump tx
                         * adjustment or use Early Receive if available */
-                       if ((adapter->pba < min_rx_space) &&
+                       if ((pba < min_rx_space) &&
                            (!(adapter->flags & FLAG_HAS_ERT)))
                                /* ERT enabled in e1000_configure_rx */
-                               adapter->pba = min_rx_space;
+                               pba = min_rx_space;
                }
+
+               ew32(PBA, pba);
        }
 
-       ew32(PBA, adapter->pba);
 
        /* flow control settings */
        /* The high water mark must be low enough to fit one full frame
@@ -3624,9 +3345,7 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
        /* NOTE: netdev_alloc_skb reserves 16 bytes, and typically NET_IP_ALIGN
         * means we reserve 2 more, this pushes us to allocate from the next
         * larger slab size.
-        * i.e. RXBUFFER_2048 --> size-4096 slab
-        *  however with the new *_jumbo* routines, jumbo receives will use
-        *  fragmented skbs */
+        * i.e. RXBUFFER_2048 --> size-4096 slab */
 
        if (max_frame <= 256)
                adapter->rx_buffer_len = 256;
index e4e655efb23cbd8b9cfe0e06896ced7db796b2ab..332789238b9c9309a63210877700b021b3c9acfd 100644 (file)
@@ -52,10 +52,11 @@ MODULE_PARM_DESC(copybreak,
  */
 
 #define E1000_PARAM_INIT { [0 ... E1000_MAX_NIC] = OPTION_UNSET }
-#define E1000_PARAM(X, desc) \
-       static int __devinitdata X[E1000_MAX_NIC+1] = E1000_PARAM_INIT; \
-       static int num_##X; \
-       module_param_array_named(X, X, int, &num_##X, 0); \
+#define E1000_PARAM(X, desc)                                   \
+       static int __devinitdata X[E1000_MAX_NIC+1]             \
+               = E1000_PARAM_INIT;                             \
+       static unsigned int num_##X;                            \
+       module_param_array_named(X, X, int, &num_##X, 0);       \
        MODULE_PARM_DESC(X, desc);
 
 
@@ -124,9 +125,9 @@ E1000_PARAM(KumeranLockLoss, "Enable Kumeran lock loss workaround");
 
 struct e1000_option {
        enum { enable_option, range_option, list_option } type;
-       char *name;
-       char *err;
-       int  def;
+       const char *name;
+       const char *err;
+       int def;
        union {
                struct { /* range_option info */
                        int min;
@@ -139,8 +140,8 @@ struct e1000_option {
        } arg;
 };
 
-static int __devinit e1000_validate_option(int *value,
-                                          struct e1000_option *opt,
+static int __devinit e1000_validate_option(unsigned int *value,
+                                          const struct e1000_option *opt,
                                           struct e1000_adapter *adapter)
 {
        if (*value == OPTION_UNSET) {
@@ -213,7 +214,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
        }
 
        { /* Transmit Interrupt Delay */
-               struct e1000_option opt = {
+               const struct e1000_option opt = {
                        .type = range_option,
                        .name = "Transmit Interrupt Delay",
                        .err  = "using default of "
@@ -232,7 +233,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
                }
        }
        { /* Transmit Absolute Interrupt Delay */
-               struct e1000_option opt = {
+               const struct e1000_option opt = {
                        .type = range_option,
                        .name = "Transmit Absolute Interrupt Delay",
                        .err  = "using default of "
@@ -277,7 +278,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
                }
        }
        { /* Receive Absolute Interrupt Delay */
-               struct e1000_option opt = {
+               const struct e1000_option opt = {
                        .type = range_option,
                        .name = "Receive Absolute Interrupt Delay",
                        .err  = "using default of "
@@ -296,7 +297,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
                }
        }
        { /* Interrupt Throttling Rate */
-               struct e1000_option opt = {
+               const struct e1000_option opt = {
                        .type = range_option,
                        .name = "Interrupt Throttling Rate (ints/sec)",
                        .err  = "using default of "
@@ -344,7 +345,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
                }
        }
        { /* Smart Power Down */
-               struct e1000_option opt = {
+               const struct e1000_option opt = {
                        .type = enable_option,
                        .name = "PHY Smart Power Down",
                        .err  = "defaulting to Disabled",
@@ -352,7 +353,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
                };
 
                if (num_SmartPowerDownEnable > bd) {
-                       int spd = SmartPowerDownEnable[bd];
+                       unsigned int spd = SmartPowerDownEnable[bd];
                        e1000_validate_option(&spd, &opt, adapter);
                        if ((adapter->flags & FLAG_HAS_SMART_POWER_DOWN)
                            && spd)
@@ -360,7 +361,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
                }
        }
        { /* Kumeran Lock Loss Workaround */
-               struct e1000_option opt = {
+               const struct e1000_option opt = {
                        .type = enable_option,
                        .name = "Kumeran Lock Loss Workaround",
                        .err  = "defaulting to Enabled",
@@ -368,7 +369,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
                };
 
                if (num_KumeranLockLoss > bd) {
-                       int kmrn_lock_loss = KumeranLockLoss[bd];
+                       unsigned int kmrn_lock_loss = KumeranLockLoss[bd];
                        e1000_validate_option(&kmrn_lock_loss, &opt, adapter);
                        if (hw->mac.type == e1000_ich8lan)
                                e1000e_set_kmrn_lock_loss_workaround_ich8lan(hw,
index 4b4b74e47a670d1d958120a6f4c5b1f74051af30..f78e5bf7cb3334f7dba7e1dcdddf35c10fd79a7b 100644 (file)
@@ -40,7 +40,7 @@
 #include <asm/io.h>
 
 #define DRV_NAME       "ehea"
-#define DRV_VERSION    "EHEA_0079"
+#define DRV_VERSION    "EHEA_0080"
 
 /* eHEA capability flags */
 #define DLPAR_PORT_ADD_REM 1
index 0a7e789255402c306d88eedf01c9ef426f401733..f0319f1e8e052e99adfde7ca658cfaf7074b1ac1 100644 (file)
@@ -33,6 +33,9 @@
 #include <linux/if.h>
 #include <linux/list.h>
 #include <linux/if_ether.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+
 #include <net/ip.h>
 
 #include "ehea.h"
@@ -3295,6 +3298,20 @@ static int __devexit ehea_remove(struct of_device *dev)
        return 0;
 }
 
+static int ehea_reboot_notifier(struct notifier_block *nb,
+                               unsigned long action, void *unused)
+{
+       if (action == SYS_RESTART) {
+               ehea_info("Reboot: freeing all eHEA resources");
+               ibmebus_unregister_driver(&ehea_driver);
+       }
+       return NOTIFY_DONE;
+}
+
+static struct notifier_block ehea_reboot_nb = {
+        .notifier_call = ehea_reboot_notifier,
+};
+
 static int check_module_parm(void)
 {
        int ret = 0;
@@ -3351,6 +3368,8 @@ int __init ehea_module_init(void)
        if (ret)
                goto out;
 
+       register_reboot_notifier(&ehea_reboot_nb);
+
        ret = ibmebus_register_driver(&ehea_driver);
        if (ret) {
                ehea_error("failed registering eHEA device driver on ebus");
@@ -3362,6 +3381,7 @@ int __init ehea_module_init(void)
        if (ret) {
                ehea_error("failed to register capabilities attribute, ret=%d",
                           ret);
+               unregister_reboot_notifier(&ehea_reboot_nb);
                ibmebus_unregister_driver(&ehea_driver);
                goto out;
        }
@@ -3375,6 +3395,7 @@ static void __exit ehea_module_exit(void)
        flush_scheduled_work();
        driver_remove_file(&ehea_driver.driver, &driver_attr_capabilities);
        ibmebus_unregister_driver(&ehea_driver);
+       unregister_reboot_notifier(&ehea_reboot_nb);
        ehea_destroy_busmap();
 }
 
diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c
new file mode 100644 (file)
index 0000000..a8a0ee2
--- /dev/null
@@ -0,0 +1,1112 @@
+/*
+ * Driver for the MPC5200 Fast Ethernet Controller
+ *
+ * Originally written by Dale Farnsworth <dfarnsworth@mvista.com> and
+ * now maintained by Sylvain Munaut <tnt@246tNt.com>
+ *
+ * Copyright (C) 2007  Domen Puncer, Telargo, Inc.
+ * Copyright (C) 2007  Sylvain Munaut <tnt@246tNt.com>
+ * Copyright (C) 2003-2004  MontaVista, Software, Inc.
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ *
+ */
+
+#include <linux/module.h>
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/spinlock.h>
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/crc32.h>
+#include <linux/hardirq.h>
+#include <linux/delay.h>
+#include <linux/of_device.h>
+#include <linux/of_platform.h>
+
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <linux/ethtool.h>
+#include <linux/skbuff.h>
+
+#include <asm/io.h>
+#include <asm/delay.h>
+#include <asm/mpc52xx.h>
+
+#include <sysdev/bestcomm/bestcomm.h>
+#include <sysdev/bestcomm/fec.h>
+
+#include "fec_mpc52xx.h"
+
+#define DRIVER_NAME "mpc52xx-fec"
+
+static irqreturn_t mpc52xx_fec_interrupt(int, void *);
+static irqreturn_t mpc52xx_fec_rx_interrupt(int, void *);
+static irqreturn_t mpc52xx_fec_tx_interrupt(int, void *);
+static void mpc52xx_fec_stop(struct net_device *dev);
+static void mpc52xx_fec_start(struct net_device *dev);
+static void mpc52xx_fec_reset(struct net_device *dev);
+
+static u8 mpc52xx_fec_mac_addr[6];
+module_param_array_named(mac, mpc52xx_fec_mac_addr, byte, NULL, 0);
+MODULE_PARM_DESC(mac, "six hex digits, ie. 0x1,0x2,0xc0,0x01,0xba,0xbe");
+
+#define MPC52xx_MESSAGES_DEFAULT ( NETIF_MSG_DRV | NETIF_MSG_PROBE | \
+               NETIF_MSG_LINK | NETIF_MSG_IFDOWN | NETIF_MSG_IFDOWN )
+static int debug = -1; /* the above default */
+module_param(debug, int, 0);
+MODULE_PARM_DESC(debug, "debugging messages level");
+
+static void mpc52xx_fec_tx_timeout(struct net_device *dev)
+{
+       dev_warn(&dev->dev, "transmit timed out\n");
+
+       mpc52xx_fec_reset(dev);
+
+       dev->stats.tx_errors++;
+
+       netif_wake_queue(dev);
+}
+
+static void mpc52xx_fec_set_paddr(struct net_device *dev, u8 *mac)
+{
+       struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+       struct mpc52xx_fec __iomem *fec = priv->fec;
+
+       out_be32(&fec->paddr1, *(u32 *)(&mac[0]));
+       out_be32(&fec->paddr2, (*(u16 *)(&mac[4]) << 16) | FEC_PADDR2_TYPE);
+}
+
+static void mpc52xx_fec_get_paddr(struct net_device *dev, u8 *mac)
+{
+       struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+       struct mpc52xx_fec __iomem *fec = priv->fec;
+
+       *(u32 *)(&mac[0]) = in_be32(&fec->paddr1);
+       *(u16 *)(&mac[4]) = in_be32(&fec->paddr2) >> 16;
+}
+
+static int mpc52xx_fec_set_mac_address(struct net_device *dev, void *addr)
+{
+       struct sockaddr *sock = addr;
+
+       memcpy(dev->dev_addr, sock->sa_data, dev->addr_len);
+
+       mpc52xx_fec_set_paddr(dev, sock->sa_data);
+       return 0;
+}
+
+static void mpc52xx_fec_free_rx_buffers(struct net_device *dev, struct bcom_task *s)
+{
+       while (!bcom_queue_empty(s)) {
+               struct bcom_fec_bd *bd;
+               struct sk_buff *skb;
+
+               skb = bcom_retrieve_buffer(s, NULL, (struct bcom_bd **)&bd);
+               dma_unmap_single(&dev->dev, bd->skb_pa, skb->len, DMA_FROM_DEVICE);
+               kfree_skb(skb);
+       }
+}
+
+static int mpc52xx_fec_alloc_rx_buffers(struct net_device *dev, struct bcom_task *rxtsk)
+{
+       while (!bcom_queue_full(rxtsk)) {
+               struct sk_buff *skb;
+               struct bcom_fec_bd *bd;
+
+               skb = dev_alloc_skb(FEC_RX_BUFFER_SIZE);
+               if (skb == NULL)
+                       return -EAGAIN;
+
+               /* zero out the initial receive buffers to aid debugging */
+               memset(skb->data, 0, FEC_RX_BUFFER_SIZE);
+
+               bd = (struct bcom_fec_bd *)bcom_prepare_next_buffer(rxtsk);
+
+               bd->status = FEC_RX_BUFFER_SIZE;
+               bd->skb_pa = dma_map_single(&dev->dev, skb->data,
+                               FEC_RX_BUFFER_SIZE, DMA_FROM_DEVICE);
+
+               bcom_submit_next_buffer(rxtsk, skb);
+       }
+
+       return 0;
+}
+
+/* based on generic_adjust_link from fs_enet-main.c */
+static void mpc52xx_fec_adjust_link(struct net_device *dev)
+{
+       struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+       struct phy_device *phydev = priv->phydev;
+       int new_state = 0;
+
+       if (phydev->link != PHY_DOWN) {
+               if (phydev->duplex != priv->duplex) {
+                       struct mpc52xx_fec __iomem *fec = priv->fec;
+                       u32 rcntrl;
+                       u32 tcntrl;
+
+                       new_state = 1;
+                       priv->duplex = phydev->duplex;
+
+                       rcntrl = in_be32(&fec->r_cntrl);
+                       tcntrl = in_be32(&fec->x_cntrl);
+
+                       rcntrl &= ~FEC_RCNTRL_DRT;
+                       tcntrl &= ~FEC_TCNTRL_FDEN;
+                       if (phydev->duplex == DUPLEX_FULL)
+                               tcntrl |= FEC_TCNTRL_FDEN;      /* FD enable */
+                       else
+                               rcntrl |= FEC_RCNTRL_DRT;       /* disable Rx on Tx (HD) */
+
+                       out_be32(&fec->r_cntrl, rcntrl);
+                       out_be32(&fec->x_cntrl, tcntrl);
+               }
+
+               if (phydev->speed != priv->speed) {
+                       new_state = 1;
+                       priv->speed = phydev->speed;
+               }
+
+               if (priv->link == PHY_DOWN) {
+                       new_state = 1;
+                       priv->link = phydev->link;
+                       netif_schedule(dev);
+                       netif_carrier_on(dev);
+                       netif_start_queue(dev);
+               }
+
+       } else if (priv->link) {
+               new_state = 1;
+               priv->link = PHY_DOWN;
+               priv->speed = 0;
+               priv->duplex = -1;
+               netif_stop_queue(dev);
+               netif_carrier_off(dev);
+       }
+
+       if (new_state && netif_msg_link(priv))
+               phy_print_status(phydev);
+}
+
+static int mpc52xx_fec_init_phy(struct net_device *dev)
+{
+       struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+       struct phy_device *phydev;
+       char phy_id[BUS_ID_SIZE];
+
+       snprintf(phy_id, BUS_ID_SIZE, PHY_ID_FMT,
+                       (unsigned int)dev->base_addr, priv->phy_addr);
+
+       priv->link = PHY_DOWN;
+       priv->speed = 0;
+       priv->duplex = -1;
+
+       phydev = phy_connect(dev, phy_id, &mpc52xx_fec_adjust_link, 0, PHY_INTERFACE_MODE_MII);
+       if (IS_ERR(phydev)) {
+               dev_err(&dev->dev, "phy_connect failed\n");
+               return PTR_ERR(phydev);
+       }
+       dev_info(&dev->dev, "attached phy %i to driver %s\n",
+                       phydev->addr, phydev->drv->name);
+
+       priv->phydev = phydev;
+
+       return 0;
+}
+
+static int mpc52xx_fec_phy_start(struct net_device *dev)
+{
+       struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+       int err;
+
+       if (!priv->has_phy)
+               return 0;
+
+       err = mpc52xx_fec_init_phy(dev);
+       if (err) {
+               dev_err(&dev->dev, "mpc52xx_fec_init_phy failed\n");
+               return err;
+       }
+
+       /* reset phy - this also wakes it from PDOWN */
+       phy_write(priv->phydev, MII_BMCR, BMCR_RESET);
+       phy_start(priv->phydev);
+
+       return 0;
+}
+
+static void mpc52xx_fec_phy_stop(struct net_device *dev)
+{
+       struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+
+       if (!priv->has_phy)
+               return;
+
+       phy_disconnect(priv->phydev);
+       /* power down phy */
+       phy_stop(priv->phydev);
+       phy_write(priv->phydev, MII_BMCR, BMCR_PDOWN);
+}
+
+static int mpc52xx_fec_phy_mii_ioctl(struct mpc52xx_fec_priv *priv,
+               struct mii_ioctl_data *mii_data, int cmd)
+{
+       if (!priv->has_phy)
+               return -ENOTSUPP;
+
+       return phy_mii_ioctl(priv->phydev, mii_data, cmd);
+}
+
+static void mpc52xx_fec_phy_hw_init(struct mpc52xx_fec_priv *priv)
+{
+       struct mpc52xx_fec __iomem *fec = priv->fec;
+
+       if (!priv->has_phy)
+               return;
+
+       out_be32(&fec->mii_speed, priv->phy_speed);
+}
+
+static int mpc52xx_fec_open(struct net_device *dev)
+{
+       struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+       int err = -EBUSY;
+
+       if (request_irq(dev->irq, &mpc52xx_fec_interrupt, IRQF_SHARED,
+                       DRIVER_NAME "_ctrl", dev)) {
+               dev_err(&dev->dev, "ctrl interrupt request failed\n");
+               goto out;
+       }
+       if (request_irq(priv->r_irq, &mpc52xx_fec_rx_interrupt, 0,
+                       DRIVER_NAME "_rx", dev)) {
+               dev_err(&dev->dev, "rx interrupt request failed\n");
+               goto free_ctrl_irq;
+       }
+       if (request_irq(priv->t_irq, &mpc52xx_fec_tx_interrupt, 0,
+                       DRIVER_NAME "_tx", dev)) {
+               dev_err(&dev->dev, "tx interrupt request failed\n");
+               goto free_2irqs;
+       }
+
+       bcom_fec_rx_reset(priv->rx_dmatsk);
+       bcom_fec_tx_reset(priv->tx_dmatsk);
+
+       err = mpc52xx_fec_alloc_rx_buffers(dev, priv->rx_dmatsk);
+       if (err) {
+               dev_err(&dev->dev, "mpc52xx_fec_alloc_rx_buffers failed\n");
+               goto free_irqs;
+       }
+
+       err = mpc52xx_fec_phy_start(dev);
+       if (err)
+               goto free_skbs;
+
+       bcom_enable(priv->rx_dmatsk);
+       bcom_enable(priv->tx_dmatsk);
+
+       mpc52xx_fec_start(dev);
+
+       netif_start_queue(dev);
+
+       return 0;
+
+ free_skbs:
+       mpc52xx_fec_free_rx_buffers(dev, priv->rx_dmatsk);
+
+ free_irqs:
+       free_irq(priv->t_irq, dev);
+ free_2irqs:
+       free_irq(priv->r_irq, dev);
+ free_ctrl_irq:
+       free_irq(dev->irq, dev);
+ out:
+
+       return err;
+}
+
+static int mpc52xx_fec_close(struct net_device *dev)
+{
+       struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+
+       netif_stop_queue(dev);
+
+       mpc52xx_fec_stop(dev);
+
+       mpc52xx_fec_free_rx_buffers(dev, priv->rx_dmatsk);
+
+       free_irq(dev->irq, dev);
+       free_irq(priv->r_irq, dev);
+       free_irq(priv->t_irq, dev);
+
+       mpc52xx_fec_phy_stop(dev);
+
+       return 0;
+}
+
+/* This will only be invoked if your driver is _not_ in XOFF state.
+ * What this means is that you need not check it, and that this
+ * invariant will hold if you make sure that the netif_*_queue()
+ * calls are done at the proper times.
+ */
+static int mpc52xx_fec_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
+{
+       struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+       struct bcom_fec_bd *bd;
+
+       if (bcom_queue_full(priv->tx_dmatsk)) {
+               if (net_ratelimit())
+                       dev_err(&dev->dev, "transmit queue overrun\n");
+               return 1;
+       }
+
+       spin_lock_irq(&priv->lock);
+       dev->trans_start = jiffies;
+
+       bd = (struct bcom_fec_bd *)
+               bcom_prepare_next_buffer(priv->tx_dmatsk);
+
+       bd->status = skb->len | BCOM_FEC_TX_BD_TFD | BCOM_FEC_TX_BD_TC;
+       bd->skb_pa = dma_map_single(&dev->dev, skb->data, skb->len, DMA_TO_DEVICE);
+
+       bcom_submit_next_buffer(priv->tx_dmatsk, skb);
+
+       if (bcom_queue_full(priv->tx_dmatsk)) {
+               netif_stop_queue(dev);
+       }
+
+       spin_unlock_irq(&priv->lock);
+
+       return 0;
+}
+
+/* This handles BestComm transmit task interrupts
+ */
+static irqreturn_t mpc52xx_fec_tx_interrupt(int irq, void *dev_id)
+{
+       struct net_device *dev = dev_id;
+       struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+
+       spin_lock(&priv->lock);
+
+       while (bcom_buffer_done(priv->tx_dmatsk)) {
+               struct sk_buff *skb;
+               struct bcom_fec_bd *bd;
+               skb = bcom_retrieve_buffer(priv->tx_dmatsk, NULL,
+                               (struct bcom_bd **)&bd);
+               dma_unmap_single(&dev->dev, bd->skb_pa, skb->len, DMA_TO_DEVICE);
+
+               dev_kfree_skb_irq(skb);
+       }
+
+       netif_wake_queue(dev);
+
+       spin_unlock(&priv->lock);
+
+       return IRQ_HANDLED;
+}
+
+static irqreturn_t mpc52xx_fec_rx_interrupt(int irq, void *dev_id)
+{
+       struct net_device *dev = dev_id;
+       struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+
+       while (bcom_buffer_done(priv->rx_dmatsk)) {
+               struct sk_buff *skb;
+               struct sk_buff *rskb;
+               struct bcom_fec_bd *bd;
+               u32 status;
+
+               rskb = bcom_retrieve_buffer(priv->rx_dmatsk, &status,
+                               (struct bcom_bd **)&bd);
+               dma_unmap_single(&dev->dev, bd->skb_pa, skb->len, DMA_FROM_DEVICE);
+
+               /* Test for errors in received frame */
+               if (status & BCOM_FEC_RX_BD_ERRORS) {
+                       /* Drop packet and reuse the buffer */
+                       bd = (struct bcom_fec_bd *)
+                               bcom_prepare_next_buffer(priv->rx_dmatsk);
+
+                       bd->status = FEC_RX_BUFFER_SIZE;
+                       bd->skb_pa = dma_map_single(&dev->dev, rskb->data,
+                                       FEC_RX_BUFFER_SIZE, DMA_FROM_DEVICE);
+
+                       bcom_submit_next_buffer(priv->rx_dmatsk, rskb);
+
+                       dev->stats.rx_dropped++;
+
+                       continue;
+               }
+
+               /* skbs are allocated on open, so now we allocate a new one,
+                * and remove the old (with the packet) */
+               skb = dev_alloc_skb(FEC_RX_BUFFER_SIZE);
+               if (skb) {
+                       /* Process the received skb */
+                       int length = status & BCOM_FEC_RX_BD_LEN_MASK;
+
+                       skb_put(rskb, length - 4);      /* length without CRC32 */
+
+                       rskb->dev = dev;
+                       rskb->protocol = eth_type_trans(rskb, dev);
+
+                       netif_rx(rskb);
+                       dev->last_rx = jiffies;
+               } else {
+                       /* Can't get a new one : reuse the same & drop pkt */
+                       dev_notice(&dev->dev, "Memory squeeze, dropping packet.\n");
+                       dev->stats.rx_dropped++;
+
+                       skb = rskb;
+               }
+
+               bd = (struct bcom_fec_bd *)
+                       bcom_prepare_next_buffer(priv->rx_dmatsk);
+
+               bd->status = FEC_RX_BUFFER_SIZE;
+               bd->skb_pa = dma_map_single(&dev->dev, rskb->data,
+                               FEC_RX_BUFFER_SIZE, DMA_FROM_DEVICE);
+
+               bcom_submit_next_buffer(priv->rx_dmatsk, skb);
+       }
+
+       return IRQ_HANDLED;
+}
+
+static irqreturn_t mpc52xx_fec_interrupt(int irq, void *dev_id)
+{
+       struct net_device *dev = dev_id;
+       struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+       struct mpc52xx_fec __iomem *fec = priv->fec;
+       u32 ievent;
+
+       ievent = in_be32(&fec->ievent);
+
+       ievent &= ~FEC_IEVENT_MII;      /* mii is handled separately */
+       if (!ievent)
+               return IRQ_NONE;
+
+       out_be32(&fec->ievent, ievent);         /* clear pending events */
+
+       if (ievent & ~(FEC_IEVENT_RFIFO_ERROR | FEC_IEVENT_XFIFO_ERROR)) {
+               if (ievent & ~FEC_IEVENT_TFINT)
+                       dev_dbg(&dev->dev, "ievent: %08x\n", ievent);
+               return IRQ_HANDLED;
+       }
+
+       if (net_ratelimit() && (ievent & FEC_IEVENT_RFIFO_ERROR))
+               dev_warn(&dev->dev, "FEC_IEVENT_RFIFO_ERROR\n");
+       if (net_ratelimit() && (ievent & FEC_IEVENT_XFIFO_ERROR))
+               dev_warn(&dev->dev, "FEC_IEVENT_XFIFO_ERROR\n");
+
+       mpc52xx_fec_reset(dev);
+
+       netif_wake_queue(dev);
+       return IRQ_HANDLED;
+}
+
+/*
+ * Get the current statistics.
+ * This may be called with the card open or closed.
+ */
+static struct net_device_stats *mpc52xx_fec_get_stats(struct net_device *dev)
+{
+       struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+       struct net_device_stats *stats = &dev->stats;
+       struct mpc52xx_fec __iomem *fec = priv->fec;
+
+       stats->rx_bytes = in_be32(&fec->rmon_r_octets);
+       stats->rx_packets = in_be32(&fec->rmon_r_packets);
+       stats->rx_errors = in_be32(&fec->rmon_r_crc_align) +
+               in_be32(&fec->rmon_r_undersize) +
+               in_be32(&fec->rmon_r_oversize) +
+               in_be32(&fec->rmon_r_frag) +
+               in_be32(&fec->rmon_r_jab);
+
+       stats->tx_bytes = in_be32(&fec->rmon_t_octets);
+       stats->tx_packets = in_be32(&fec->rmon_t_packets);
+       stats->tx_errors = in_be32(&fec->rmon_t_crc_align) +
+               in_be32(&fec->rmon_t_undersize) +
+               in_be32(&fec->rmon_t_oversize) +
+               in_be32(&fec->rmon_t_frag) +
+               in_be32(&fec->rmon_t_jab);
+
+       stats->multicast = in_be32(&fec->rmon_r_mc_pkt);
+       stats->collisions = in_be32(&fec->rmon_t_col);
+
+       /* detailed rx_errors: */
+       stats->rx_length_errors = in_be32(&fec->rmon_r_undersize)
+                                       + in_be32(&fec->rmon_r_oversize)
+                                       + in_be32(&fec->rmon_r_frag)
+                                       + in_be32(&fec->rmon_r_jab);
+       stats->rx_over_errors = in_be32(&fec->r_macerr);
+       stats->rx_crc_errors = in_be32(&fec->ieee_r_crc);
+       stats->rx_frame_errors = in_be32(&fec->ieee_r_align);
+       stats->rx_fifo_errors = in_be32(&fec->rmon_r_drop);
+       stats->rx_missed_errors = in_be32(&fec->rmon_r_drop);
+
+       /* detailed tx_errors: */
+       stats->tx_aborted_errors = 0;
+       stats->tx_carrier_errors = in_be32(&fec->ieee_t_cserr);
+       stats->tx_fifo_errors = in_be32(&fec->rmon_t_drop);
+       stats->tx_heartbeat_errors = in_be32(&fec->ieee_t_sqe);
+       stats->tx_window_errors = in_be32(&fec->ieee_t_lcol);
+
+       return stats;
+}
+
+/*
+ * Read MIB counters in order to reset them,
+ * then zero all the stats fields in memory
+ */
+static void mpc52xx_fec_reset_stats(struct net_device *dev)
+{
+       struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+       struct mpc52xx_fec __iomem *fec = priv->fec;
+
+       out_be32(&fec->mib_control, FEC_MIB_DISABLE);
+       memset_io(&fec->rmon_t_drop, 0, (__force u32)&fec->reserved10 -
+                       (__force u32)&fec->rmon_t_drop);
+       out_be32(&fec->mib_control, 0);
+
+       memset(&dev->stats, 0, sizeof(dev->stats));
+}
+
+/*
+ * Set or clear the multicast filter for this adaptor.
+ */
+static void mpc52xx_fec_set_multicast_list(struct net_device *dev)
+{
+       struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+       struct mpc52xx_fec __iomem *fec = priv->fec;
+       u32 rx_control;
+
+       rx_control = in_be32(&fec->r_cntrl);
+
+       if (dev->flags & IFF_PROMISC) {
+               rx_control |= FEC_RCNTRL_PROM;
+               out_be32(&fec->r_cntrl, rx_control);
+       } else {
+               rx_control &= ~FEC_RCNTRL_PROM;
+               out_be32(&fec->r_cntrl, rx_control);
+
+               if (dev->flags & IFF_ALLMULTI) {
+                       out_be32(&fec->gaddr1, 0xffffffff);
+                       out_be32(&fec->gaddr2, 0xffffffff);
+               } else {
+                       u32 crc;
+                       int i;
+                       struct dev_mc_list *dmi;
+                       u32 gaddr1 = 0x00000000;
+                       u32 gaddr2 = 0x00000000;
+
+                       dmi = dev->mc_list;
+                       for (i=0; i<dev->mc_count; i++) {
+                               crc = ether_crc_le(6, dmi->dmi_addr) >> 26;
+                               if (crc >= 32)
+                                       gaddr1 |= 1 << (crc-32);
+                               else
+                                       gaddr2 |= 1 << crc;
+                               dmi = dmi->next;
+                       }
+                       out_be32(&fec->gaddr1, gaddr1);
+                       out_be32(&fec->gaddr2, gaddr2);
+               }
+       }
+}
+
+/**
+ * mpc52xx_fec_hw_init
+ * @dev: network device
+ *
+ * Setup various hardware setting, only needed once on start
+ */
+static void mpc52xx_fec_hw_init(struct net_device *dev)
+{
+       struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+       struct mpc52xx_fec __iomem *fec = priv->fec;
+       int i;
+
+       /* Whack a reset.  We should wait for this. */
+       out_be32(&fec->ecntrl, FEC_ECNTRL_RESET);
+       for (i = 0; i < FEC_RESET_DELAY; ++i) {
+               if ((in_be32(&fec->ecntrl) & FEC_ECNTRL_RESET) == 0)
+                       break;
+               udelay(1);
+       }
+       if (i == FEC_RESET_DELAY)
+               dev_err(&dev->dev, "FEC Reset timeout!\n");
+
+       /* set pause to 0x20 frames */
+       out_be32(&fec->op_pause, FEC_OP_PAUSE_OPCODE | 0x20);
+
+       /* high service request will be deasserted when there's < 7 bytes in fifo
+        * low service request will be deasserted when there's < 4*7 bytes in fifo
+        */
+       out_be32(&fec->rfifo_cntrl, FEC_FIFO_CNTRL_FRAME | FEC_FIFO_CNTRL_LTG_7);
+       out_be32(&fec->tfifo_cntrl, FEC_FIFO_CNTRL_FRAME | FEC_FIFO_CNTRL_LTG_7);
+
+       /* alarm when <= x bytes in FIFO */
+       out_be32(&fec->rfifo_alarm, 0x0000030c);
+       out_be32(&fec->tfifo_alarm, 0x00000100);
+
+       /* begin transmittion when 256 bytes are in FIFO (or EOF or FIFO full) */
+       out_be32(&fec->x_wmrk, FEC_FIFO_WMRK_256B);
+
+       /* enable crc generation */
+       out_be32(&fec->xmit_fsm, FEC_XMIT_FSM_APPEND_CRC | FEC_XMIT_FSM_ENABLE_CRC);
+       out_be32(&fec->iaddr1, 0x00000000);     /* No individual filter */
+       out_be32(&fec->iaddr2, 0x00000000);     /* No individual filter */
+
+       /* set phy speed.
+        * this can't be done in phy driver, since it needs to be called
+        * before fec stuff (even on resume) */
+       mpc52xx_fec_phy_hw_init(priv);
+}
+
+/**
+ * mpc52xx_fec_start
+ * @dev: network device
+ *
+ * This function is called to start or restart the FEC during a link
+ * change.  This happens on fifo errors or when switching between half
+ * and full duplex.
+ */
+static void mpc52xx_fec_start(struct net_device *dev)
+{
+       struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+       struct mpc52xx_fec __iomem *fec = priv->fec;
+       u32 rcntrl;
+       u32 tcntrl;
+       u32 tmp;
+
+       /* clear sticky error bits */
+       tmp = FEC_FIFO_STATUS_ERR | FEC_FIFO_STATUS_UF | FEC_FIFO_STATUS_OF;
+       out_be32(&fec->rfifo_status, in_be32(&fec->rfifo_status) & tmp);
+       out_be32(&fec->tfifo_status, in_be32(&fec->tfifo_status) & tmp);
+
+       /* FIFOs will reset on mpc52xx_fec_enable */
+       out_be32(&fec->reset_cntrl, FEC_RESET_CNTRL_ENABLE_IS_RESET);
+
+       /* Set station address. */
+       mpc52xx_fec_set_paddr(dev, dev->dev_addr);
+
+       mpc52xx_fec_set_multicast_list(dev);
+
+       /* set max frame len, enable flow control, select mii mode */
+       rcntrl = FEC_RX_BUFFER_SIZE << 16;      /* max frame length */
+       rcntrl |= FEC_RCNTRL_FCE;
+
+       if (priv->has_phy)
+               rcntrl |= FEC_RCNTRL_MII_MODE;
+
+       if (priv->duplex == DUPLEX_FULL)
+               tcntrl = FEC_TCNTRL_FDEN;       /* FD enable */
+       else {
+               rcntrl |= FEC_RCNTRL_DRT;       /* disable Rx on Tx (HD) */
+               tcntrl = 0;
+       }
+       out_be32(&fec->r_cntrl, rcntrl);
+       out_be32(&fec->x_cntrl, tcntrl);
+
+       /* Clear any outstanding interrupt. */
+       out_be32(&fec->ievent, 0xffffffff);
+
+       /* Enable interrupts we wish to service. */
+       out_be32(&fec->imask, FEC_IMASK_ENABLE);
+
+       /* And last, enable the transmit and receive processing. */
+       out_be32(&fec->ecntrl, FEC_ECNTRL_ETHER_EN);
+       out_be32(&fec->r_des_active, 0x01000000);
+}
+
+/**
+ * mpc52xx_fec_stop
+ * @dev: network device
+ *
+ * stop all activity on fec and empty dma buffers
+ */
+static void mpc52xx_fec_stop(struct net_device *dev)
+{
+       struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+       struct mpc52xx_fec __iomem *fec = priv->fec;
+       unsigned long timeout;
+
+       /* disable all interrupts */
+       out_be32(&fec->imask, 0);
+
+       /* Disable the rx task. */
+       bcom_disable(priv->rx_dmatsk);
+
+       /* Wait for tx queue to drain, but only if we're in process context */
+       if (!in_interrupt()) {
+               timeout = jiffies + msecs_to_jiffies(2000);
+               while (time_before(jiffies, timeout) &&
+                               !bcom_queue_empty(priv->tx_dmatsk))
+                       msleep(100);
+
+               if (time_after_eq(jiffies, timeout))
+                       dev_err(&dev->dev, "queues didn't drain\n");
+#if 1
+               if (time_after_eq(jiffies, timeout)) {
+                       dev_err(&dev->dev, "  tx: index: %i, outdex: %i\n",
+                                       priv->tx_dmatsk->index,
+                                       priv->tx_dmatsk->outdex);
+                       dev_err(&dev->dev, "  rx: index: %i, outdex: %i\n",
+                                       priv->rx_dmatsk->index,
+                                       priv->rx_dmatsk->outdex);
+               }
+#endif
+       }
+
+       bcom_disable(priv->tx_dmatsk);
+
+       /* Stop FEC */
+       out_be32(&fec->ecntrl, in_be32(&fec->ecntrl) & ~FEC_ECNTRL_ETHER_EN);
+
+       return;
+}
+
+/* reset fec and bestcomm tasks */
+static void mpc52xx_fec_reset(struct net_device *dev)
+{
+       struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+       struct mpc52xx_fec __iomem *fec = priv->fec;
+
+       mpc52xx_fec_stop(dev);
+
+       out_be32(&fec->rfifo_status, in_be32(&fec->rfifo_status));
+       out_be32(&fec->reset_cntrl, FEC_RESET_CNTRL_RESET_FIFO);
+
+       mpc52xx_fec_free_rx_buffers(dev, priv->rx_dmatsk);
+
+       mpc52xx_fec_hw_init(dev);
+
+       phy_stop(priv->phydev);
+       phy_write(priv->phydev, MII_BMCR, BMCR_RESET);
+       phy_start(priv->phydev);
+
+       bcom_fec_rx_reset(priv->rx_dmatsk);
+       bcom_fec_tx_reset(priv->tx_dmatsk);
+
+       mpc52xx_fec_alloc_rx_buffers(dev, priv->rx_dmatsk);
+
+       bcom_enable(priv->rx_dmatsk);
+       bcom_enable(priv->tx_dmatsk);
+
+       mpc52xx_fec_start(dev);
+}
+
+
+/* ethtool interface */
+static void mpc52xx_fec_get_drvinfo(struct net_device *dev,
+               struct ethtool_drvinfo *info)
+{
+       strcpy(info->driver, DRIVER_NAME);
+}
+
+static int mpc52xx_fec_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+{
+       struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+       return phy_ethtool_gset(priv->phydev, cmd);
+}
+
+static int mpc52xx_fec_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+{
+       struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+       return phy_ethtool_sset(priv->phydev, cmd);
+}
+
+static u32 mpc52xx_fec_get_msglevel(struct net_device *dev)
+{
+       struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+       return priv->msg_enable;
+}
+
+static void mpc52xx_fec_set_msglevel(struct net_device *dev, u32 level)
+{
+       struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+       priv->msg_enable = level;
+}
+
+static const struct ethtool_ops mpc52xx_fec_ethtool_ops = {
+       .get_drvinfo = mpc52xx_fec_get_drvinfo,
+       .get_settings = mpc52xx_fec_get_settings,
+       .set_settings = mpc52xx_fec_set_settings,
+       .get_link = ethtool_op_get_link,
+       .get_msglevel = mpc52xx_fec_get_msglevel,
+       .set_msglevel = mpc52xx_fec_set_msglevel,
+};
+
+
+static int mpc52xx_fec_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
+{
+       struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+
+       return mpc52xx_fec_phy_mii_ioctl(priv, if_mii(rq), cmd);
+}
+
+/* ======================================================================== */
+/* OF Driver                                                                */
+/* ======================================================================== */
+
+static int __devinit
+mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match)
+{
+       int rv;
+       struct net_device *ndev;
+       struct mpc52xx_fec_priv *priv = NULL;
+       struct resource mem;
+       const phandle *ph;
+
+       phys_addr_t rx_fifo;
+       phys_addr_t tx_fifo;
+
+       /* Get the ether ndev & it's private zone */
+       ndev = alloc_etherdev(sizeof(struct mpc52xx_fec_priv));
+       if (!ndev)
+               return -ENOMEM;
+
+       priv = netdev_priv(ndev);
+
+       /* Reserve FEC control zone */
+       rv = of_address_to_resource(op->node, 0, &mem);
+       if (rv) {
+               printk(KERN_ERR DRIVER_NAME ": "
+                               "Error while parsing device node resource\n" );
+               return rv;
+       }
+       if ((mem.end - mem.start + 1) < sizeof(struct mpc52xx_fec)) {
+               printk(KERN_ERR DRIVER_NAME
+                       " - invalid resource size (%lx < %x), check mpc52xx_devices.c\n",
+                       (unsigned long)(mem.end - mem.start + 1), sizeof(struct mpc52xx_fec));
+               return -EINVAL;
+       }
+
+       if (!request_mem_region(mem.start, sizeof(struct mpc52xx_fec), DRIVER_NAME))
+               return -EBUSY;
+
+       /* Init ether ndev with what we have */
+       ndev->open              = mpc52xx_fec_open;
+       ndev->stop              = mpc52xx_fec_close;
+       ndev->hard_start_xmit   = mpc52xx_fec_hard_start_xmit;
+       ndev->do_ioctl          = mpc52xx_fec_ioctl;
+       ndev->ethtool_ops       = &mpc52xx_fec_ethtool_ops;
+       ndev->get_stats         = mpc52xx_fec_get_stats;
+       ndev->set_mac_address   = mpc52xx_fec_set_mac_address;
+       ndev->set_multicast_list = mpc52xx_fec_set_multicast_list;
+       ndev->tx_timeout        = mpc52xx_fec_tx_timeout;
+       ndev->watchdog_timeo    = FEC_WATCHDOG_TIMEOUT;
+       ndev->base_addr         = mem.start;
+
+       priv->t_irq = priv->r_irq = ndev->irq = NO_IRQ; /* IRQ are free for now */
+
+       spin_lock_init(&priv->lock);
+
+       /* ioremap the zones */
+       priv->fec = ioremap(mem.start, sizeof(struct mpc52xx_fec));
+
+       if (!priv->fec) {
+               rv = -ENOMEM;
+               goto probe_error;
+       }
+
+       /* Bestcomm init */
+       rx_fifo = ndev->base_addr + offsetof(struct mpc52xx_fec, rfifo_data);
+       tx_fifo = ndev->base_addr + offsetof(struct mpc52xx_fec, tfifo_data);
+
+       priv->rx_dmatsk = bcom_fec_rx_init(FEC_RX_NUM_BD, rx_fifo, FEC_RX_BUFFER_SIZE);
+       priv->tx_dmatsk = bcom_fec_tx_init(FEC_TX_NUM_BD, tx_fifo);
+
+       if (!priv->rx_dmatsk || !priv->tx_dmatsk) {
+               printk(KERN_ERR DRIVER_NAME ": Can not init SDMA tasks\n" );
+               rv = -ENOMEM;
+               goto probe_error;
+       }
+
+       /* Get the IRQ we need one by one */
+               /* Control */
+       ndev->irq = irq_of_parse_and_map(op->node, 0);
+
+               /* RX */
+       priv->r_irq = bcom_get_task_irq(priv->rx_dmatsk);
+
+               /* TX */
+       priv->t_irq = bcom_get_task_irq(priv->tx_dmatsk);
+
+       /* MAC address init */
+       if (!is_zero_ether_addr(mpc52xx_fec_mac_addr))
+               memcpy(ndev->dev_addr, mpc52xx_fec_mac_addr, 6);
+       else
+               mpc52xx_fec_get_paddr(ndev, ndev->dev_addr);
+
+       priv->msg_enable = netif_msg_init(debug, MPC52xx_MESSAGES_DEFAULT);
+       priv->duplex = DUPLEX_FULL;
+
+       /* is the phy present in device tree? */
+       ph = of_get_property(op->node, "phy-handle", NULL);
+       if (ph) {
+               const unsigned int *prop;
+               struct device_node *phy_dn;
+               priv->has_phy = 1;
+
+               phy_dn = of_find_node_by_phandle(*ph);
+               prop = of_get_property(phy_dn, "reg", NULL);
+               priv->phy_addr = *prop;
+
+               of_node_put(phy_dn);
+
+               /* Phy speed */
+               priv->phy_speed = ((mpc52xx_find_ipb_freq(op->node) >> 20) / 5) << 1;
+       } else {
+               dev_info(&ndev->dev, "can't find \"phy-handle\" in device"
+                               " tree, using 7-wire mode\n");
+       }
+
+       /* Hardware init */
+       mpc52xx_fec_hw_init(ndev);
+
+       mpc52xx_fec_reset_stats(ndev);
+
+       /* Register the new network device */
+       rv = register_netdev(ndev);
+       if (rv < 0)
+               goto probe_error;
+
+       /* We're done ! */
+       dev_set_drvdata(&op->dev, ndev);
+
+       return 0;
+
+
+       /* Error handling - free everything that might be allocated */
+probe_error:
+
+       irq_dispose_mapping(ndev->irq);
+
+       if (priv->rx_dmatsk)
+               bcom_fec_rx_release(priv->rx_dmatsk);
+       if (priv->tx_dmatsk)
+               bcom_fec_tx_release(priv->tx_dmatsk);
+
+       if (priv->fec)
+               iounmap(priv->fec);
+
+       release_mem_region(mem.start, sizeof(struct mpc52xx_fec));
+
+       free_netdev(ndev);
+
+       return rv;
+}
+
+static int
+mpc52xx_fec_remove(struct of_device *op)
+{
+       struct net_device *ndev;
+       struct mpc52xx_fec_priv *priv;
+
+       ndev = dev_get_drvdata(&op->dev);
+       priv = netdev_priv(ndev);
+
+       unregister_netdev(ndev);
+
+       irq_dispose_mapping(ndev->irq);
+
+       bcom_fec_rx_release(priv->rx_dmatsk);
+       bcom_fec_tx_release(priv->tx_dmatsk);
+
+       iounmap(priv->fec);
+
+       release_mem_region(ndev->base_addr, sizeof(struct mpc52xx_fec));
+
+       free_netdev(ndev);
+
+       dev_set_drvdata(&op->dev, NULL);
+       return 0;
+}
+
+#ifdef CONFIG_PM
+static int mpc52xx_fec_of_suspend(struct of_device *op, pm_message_t state)
+{
+       struct net_device *dev = dev_get_drvdata(&op->dev);
+
+       if (netif_running(dev))
+               mpc52xx_fec_close(dev);
+
+       return 0;
+}
+
+static int mpc52xx_fec_of_resume(struct of_device *op)
+{
+       struct net_device *dev = dev_get_drvdata(&op->dev);
+
+       mpc52xx_fec_hw_init(dev);
+       mpc52xx_fec_reset_stats(dev);
+
+       if (netif_running(dev))
+               mpc52xx_fec_open(dev);
+
+       return 0;
+}
+#endif
+
+static struct of_device_id mpc52xx_fec_match[] = {
+       {
+               .type           = "network",
+               .compatible     = "mpc5200-fec",
+       },
+       { }
+};
+
+MODULE_DEVICE_TABLE(of, mpc52xx_fec_match);
+
+static struct of_platform_driver mpc52xx_fec_driver = {
+       .owner          = THIS_MODULE,
+       .name           = DRIVER_NAME,
+       .match_table    = mpc52xx_fec_match,
+       .probe          = mpc52xx_fec_probe,
+       .remove         = mpc52xx_fec_remove,
+#ifdef CONFIG_PM
+       .suspend        = mpc52xx_fec_of_suspend,
+       .resume         = mpc52xx_fec_of_resume,
+#endif
+};
+
+
+/* ======================================================================== */
+/* Module                                                                   */
+/* ======================================================================== */
+
+static int __init
+mpc52xx_fec_init(void)
+{
+#ifdef CONFIG_FEC_MPC52xx_MDIO
+       int ret;
+       ret = of_register_platform_driver(&mpc52xx_fec_mdio_driver);
+       if (ret) {
+               printk(KERN_ERR DRIVER_NAME ": failed to register mdio driver\n");
+               return ret;
+       }
+#endif
+       return of_register_platform_driver(&mpc52xx_fec_driver);
+}
+
+static void __exit
+mpc52xx_fec_exit(void)
+{
+       of_unregister_platform_driver(&mpc52xx_fec_driver);
+#ifdef CONFIG_FEC_MPC52xx_MDIO
+       of_unregister_platform_driver(&mpc52xx_fec_mdio_driver);
+#endif
+}
+
+
+module_init(mpc52xx_fec_init);
+module_exit(mpc52xx_fec_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Dale Farnsworth");
+MODULE_DESCRIPTION("Ethernet driver for the Freescale MPC52xx FEC");
diff --git a/drivers/net/fec_mpc52xx.h b/drivers/net/fec_mpc52xx.h
new file mode 100644 (file)
index 0000000..8b1f753
--- /dev/null
@@ -0,0 +1,313 @@
+/*
+ * drivers/drivers/net/fec_mpc52xx/fec.h
+ *
+ * Driver for the MPC5200 Fast Ethernet Controller
+ *
+ * Author: Dale Farnsworth <dfarnsworth@mvista.com>
+ *
+ * 2003-2004 (c) MontaVista, Software, Inc.  This file is licensed under
+ * the terms of the GNU General Public License version 2.  This program
+ * is licensed "as is" without any warranty of any kind, whether express
+ * or implied.
+ */
+
+#ifndef __DRIVERS_NET_MPC52XX_FEC_H__
+#define __DRIVERS_NET_MPC52XX_FEC_H__
+
+#include <linux/phy.h>
+
+/* Tunable constant */
+/* FEC_RX_BUFFER_SIZE includes 4 bytes for CRC32 */
+#define FEC_RX_BUFFER_SIZE     1522    /* max receive packet size */
+#define FEC_RX_NUM_BD          256
+#define FEC_TX_NUM_BD          64
+
+#define FEC_RESET_DELAY                50      /* uS */
+
+#define FEC_WATCHDOG_TIMEOUT   ((400*HZ)/1000)
+
+struct mpc52xx_fec_priv {
+       int duplex;
+       int r_irq;
+       int t_irq;
+       struct mpc52xx_fec __iomem *fec;
+       struct bcom_task *rx_dmatsk;
+       struct bcom_task *tx_dmatsk;
+       spinlock_t lock;
+       int msg_enable;
+
+       int has_phy;
+       unsigned int phy_speed;
+       unsigned int phy_addr;
+       struct phy_device *phydev;
+       enum phy_state link;
+       int speed;
+};
+
+
+/* ======================================================================== */
+/* Hardware register sets & bits                                            */
+/* ======================================================================== */
+
+struct mpc52xx_fec {
+       u32 fec_id;                     /* FEC + 0x000 */
+       u32 ievent;                     /* FEC + 0x004 */
+       u32 imask;                      /* FEC + 0x008 */
+
+       u32 reserved0[1];               /* FEC + 0x00C */
+       u32 r_des_active;               /* FEC + 0x010 */
+       u32 x_des_active;               /* FEC + 0x014 */
+       u32 r_des_active_cl;            /* FEC + 0x018 */
+       u32 x_des_active_cl;            /* FEC + 0x01C */
+       u32 ivent_set;                  /* FEC + 0x020 */
+       u32 ecntrl;                     /* FEC + 0x024 */
+
+       u32 reserved1[6];               /* FEC + 0x028-03C */
+       u32 mii_data;                   /* FEC + 0x040 */
+       u32 mii_speed;                  /* FEC + 0x044 */
+       u32 mii_status;                 /* FEC + 0x048 */
+
+       u32 reserved2[5];               /* FEC + 0x04C-05C */
+       u32 mib_data;                   /* FEC + 0x060 */
+       u32 mib_control;                /* FEC + 0x064 */
+
+       u32 reserved3[6];               /* FEC + 0x068-7C */
+       u32 r_activate;                 /* FEC + 0x080 */
+       u32 r_cntrl;                    /* FEC + 0x084 */
+       u32 r_hash;                     /* FEC + 0x088 */
+       u32 r_data;                     /* FEC + 0x08C */
+       u32 ar_done;                    /* FEC + 0x090 */
+       u32 r_test;                     /* FEC + 0x094 */
+       u32 r_mib;                      /* FEC + 0x098 */
+       u32 r_da_low;                   /* FEC + 0x09C */
+       u32 r_da_high;                  /* FEC + 0x0A0 */
+
+       u32 reserved4[7];               /* FEC + 0x0A4-0BC */
+       u32 x_activate;                 /* FEC + 0x0C0 */
+       u32 x_cntrl;                    /* FEC + 0x0C4 */
+       u32 backoff;                    /* FEC + 0x0C8 */
+       u32 x_data;                     /* FEC + 0x0CC */
+       u32 x_status;                   /* FEC + 0x0D0 */
+       u32 x_mib;                      /* FEC + 0x0D4 */
+       u32 x_test;                     /* FEC + 0x0D8 */
+       u32 fdxfc_da1;                  /* FEC + 0x0DC */
+       u32 fdxfc_da2;                  /* FEC + 0x0E0 */
+       u32 paddr1;                     /* FEC + 0x0E4 */
+       u32 paddr2;                     /* FEC + 0x0E8 */
+       u32 op_pause;                   /* FEC + 0x0EC */
+
+       u32 reserved5[4];               /* FEC + 0x0F0-0FC */
+       u32 instr_reg;                  /* FEC + 0x100 */
+       u32 context_reg;                /* FEC + 0x104 */
+       u32 test_cntrl;                 /* FEC + 0x108 */
+       u32 acc_reg;                    /* FEC + 0x10C */
+       u32 ones;                       /* FEC + 0x110 */
+       u32 zeros;                      /* FEC + 0x114 */
+       u32 iaddr1;                     /* FEC + 0x118 */
+       u32 iaddr2;                     /* FEC + 0x11C */
+       u32 gaddr1;                     /* FEC + 0x120 */
+       u32 gaddr2;                     /* FEC + 0x124 */
+       u32 random;                     /* FEC + 0x128 */
+       u32 rand1;                      /* FEC + 0x12C */
+       u32 tmp;                        /* FEC + 0x130 */
+
+       u32 reserved6[3];               /* FEC + 0x134-13C */
+       u32 fifo_id;                    /* FEC + 0x140 */
+       u32 x_wmrk;                     /* FEC + 0x144 */
+       u32 fcntrl;                     /* FEC + 0x148 */
+       u32 r_bound;                    /* FEC + 0x14C */
+       u32 r_fstart;                   /* FEC + 0x150 */
+       u32 r_count;                    /* FEC + 0x154 */
+       u32 r_lag;                      /* FEC + 0x158 */
+       u32 r_read;                     /* FEC + 0x15C */
+       u32 r_write;                    /* FEC + 0x160 */
+       u32 x_count;                    /* FEC + 0x164 */
+       u32 x_lag;                      /* FEC + 0x168 */
+       u32 x_retry;                    /* FEC + 0x16C */
+       u32 x_write;                    /* FEC + 0x170 */
+       u32 x_read;                     /* FEC + 0x174 */
+
+       u32 reserved7[2];               /* FEC + 0x178-17C */
+       u32 fm_cntrl;                   /* FEC + 0x180 */
+       u32 rfifo_data;                 /* FEC + 0x184 */
+       u32 rfifo_status;               /* FEC + 0x188 */
+       u32 rfifo_cntrl;                /* FEC + 0x18C */
+       u32 rfifo_lrf_ptr;              /* FEC + 0x190 */
+       u32 rfifo_lwf_ptr;              /* FEC + 0x194 */
+       u32 rfifo_alarm;                /* FEC + 0x198 */
+       u32 rfifo_rdptr;                /* FEC + 0x19C */
+       u32 rfifo_wrptr;                /* FEC + 0x1A0 */
+       u32 tfifo_data;                 /* FEC + 0x1A4 */
+       u32 tfifo_status;               /* FEC + 0x1A8 */
+       u32 tfifo_cntrl;                /* FEC + 0x1AC */
+       u32 tfifo_lrf_ptr;              /* FEC + 0x1B0 */
+       u32 tfifo_lwf_ptr;              /* FEC + 0x1B4 */
+       u32 tfifo_alarm;                /* FEC + 0x1B8 */
+       u32 tfifo_rdptr;                /* FEC + 0x1BC */
+       u32 tfifo_wrptr;                /* FEC + 0x1C0 */
+
+       u32 reset_cntrl;                /* FEC + 0x1C4 */
+       u32 xmit_fsm;                   /* FEC + 0x1C8 */
+
+       u32 reserved8[3];               /* FEC + 0x1CC-1D4 */
+       u32 rdes_data0;                 /* FEC + 0x1D8 */
+       u32 rdes_data1;                 /* FEC + 0x1DC */
+       u32 r_length;                   /* FEC + 0x1E0 */
+       u32 x_length;                   /* FEC + 0x1E4 */
+       u32 x_addr;                     /* FEC + 0x1E8 */
+       u32 cdes_data;                  /* FEC + 0x1EC */
+       u32 status;                     /* FEC + 0x1F0 */
+       u32 dma_control;                /* FEC + 0x1F4 */
+       u32 des_cmnd;                   /* FEC + 0x1F8 */
+       u32 data;                       /* FEC + 0x1FC */
+
+       u32 rmon_t_drop;                /* FEC + 0x200 */
+       u32 rmon_t_packets;             /* FEC + 0x204 */
+       u32 rmon_t_bc_pkt;              /* FEC + 0x208 */
+       u32 rmon_t_mc_pkt;              /* FEC + 0x20C */
+       u32 rmon_t_crc_align;           /* FEC + 0x210 */
+       u32 rmon_t_undersize;           /* FEC + 0x214 */
+       u32 rmon_t_oversize;            /* FEC + 0x218 */
+       u32 rmon_t_frag;                /* FEC + 0x21C */
+       u32 rmon_t_jab;                 /* FEC + 0x220 */
+       u32 rmon_t_col;                 /* FEC + 0x224 */
+       u32 rmon_t_p64;                 /* FEC + 0x228 */
+       u32 rmon_t_p65to127;            /* FEC + 0x22C */
+       u32 rmon_t_p128to255;           /* FEC + 0x230 */
+       u32 rmon_t_p256to511;           /* FEC + 0x234 */
+       u32 rmon_t_p512to1023;          /* FEC + 0x238 */
+       u32 rmon_t_p1024to2047;         /* FEC + 0x23C */
+       u32 rmon_t_p_gte2048;           /* FEC + 0x240 */
+       u32 rmon_t_octets;              /* FEC + 0x244 */
+       u32 ieee_t_drop;                /* FEC + 0x248 */
+       u32 ieee_t_frame_ok;            /* FEC + 0x24C */
+       u32 ieee_t_1col;                /* FEC + 0x250 */
+       u32 ieee_t_mcol;                /* FEC + 0x254 */
+       u32 ieee_t_def;                 /* FEC + 0x258 */
+       u32 ieee_t_lcol;                /* FEC + 0x25C */
+       u32 ieee_t_excol;               /* FEC + 0x260 */
+       u32 ieee_t_macerr;              /* FEC + 0x264 */
+       u32 ieee_t_cserr;               /* FEC + 0x268 */
+       u32 ieee_t_sqe;                 /* FEC + 0x26C */
+       u32 t_fdxfc;                    /* FEC + 0x270 */
+       u32 ieee_t_octets_ok;           /* FEC + 0x274 */
+
+       u32 reserved9[2];               /* FEC + 0x278-27C */
+       u32 rmon_r_drop;                /* FEC + 0x280 */
+       u32 rmon_r_packets;             /* FEC + 0x284 */
+       u32 rmon_r_bc_pkt;              /* FEC + 0x288 */
+       u32 rmon_r_mc_pkt;              /* FEC + 0x28C */
+       u32 rmon_r_crc_align;           /* FEC + 0x290 */
+       u32 rmon_r_undersize;           /* FEC + 0x294 */
+       u32 rmon_r_oversize;            /* FEC + 0x298 */
+       u32 rmon_r_frag;                /* FEC + 0x29C */
+       u32 rmon_r_jab;                 /* FEC + 0x2A0 */
+
+       u32 rmon_r_resvd_0;             /* FEC + 0x2A4 */
+
+       u32 rmon_r_p64;                 /* FEC + 0x2A8 */
+       u32 rmon_r_p65to127;            /* FEC + 0x2AC */
+       u32 rmon_r_p128to255;           /* FEC + 0x2B0 */
+       u32 rmon_r_p256to511;           /* FEC + 0x2B4 */
+       u32 rmon_r_p512to1023;          /* FEC + 0x2B8 */
+       u32 rmon_r_p1024to2047;         /* FEC + 0x2BC */
+       u32 rmon_r_p_gte2048;           /* FEC + 0x2C0 */
+       u32 rmon_r_octets;              /* FEC + 0x2C4 */
+       u32 ieee_r_drop;                /* FEC + 0x2C8 */
+       u32 ieee_r_frame_ok;            /* FEC + 0x2CC */
+       u32 ieee_r_crc;                 /* FEC + 0x2D0 */
+       u32 ieee_r_align;               /* FEC + 0x2D4 */
+       u32 r_macerr;                   /* FEC + 0x2D8 */
+       u32 r_fdxfc;                    /* FEC + 0x2DC */
+       u32 ieee_r_octets_ok;           /* FEC + 0x2E0 */
+
+       u32 reserved10[7];              /* FEC + 0x2E4-2FC */
+
+       u32 reserved11[64];             /* FEC + 0x300-3FF */
+};
+
+#define        FEC_MIB_DISABLE                 0x80000000
+
+#define        FEC_IEVENT_HBERR                0x80000000
+#define        FEC_IEVENT_BABR                 0x40000000
+#define        FEC_IEVENT_BABT                 0x20000000
+#define        FEC_IEVENT_GRA                  0x10000000
+#define        FEC_IEVENT_TFINT                0x08000000
+#define        FEC_IEVENT_MII                  0x00800000
+#define        FEC_IEVENT_LATE_COL             0x00200000
+#define        FEC_IEVENT_COL_RETRY_LIM        0x00100000
+#define        FEC_IEVENT_XFIFO_UN             0x00080000
+#define        FEC_IEVENT_XFIFO_ERROR          0x00040000
+#define        FEC_IEVENT_RFIFO_ERROR          0x00020000
+
+#define        FEC_IMASK_HBERR                 0x80000000
+#define        FEC_IMASK_BABR                  0x40000000
+#define        FEC_IMASK_BABT                  0x20000000
+#define        FEC_IMASK_GRA                   0x10000000
+#define        FEC_IMASK_MII                   0x00800000
+#define        FEC_IMASK_LATE_COL              0x00200000
+#define        FEC_IMASK_COL_RETRY_LIM         0x00100000
+#define        FEC_IMASK_XFIFO_UN              0x00080000
+#define        FEC_IMASK_XFIFO_ERROR           0x00040000
+#define        FEC_IMASK_RFIFO_ERROR           0x00020000
+
+/* all but MII, which is enabled separately */
+#define FEC_IMASK_ENABLE       (FEC_IMASK_HBERR | FEC_IMASK_BABR | \
+               FEC_IMASK_BABT | FEC_IMASK_GRA | FEC_IMASK_LATE_COL | \
+               FEC_IMASK_COL_RETRY_LIM | FEC_IMASK_XFIFO_UN | \
+               FEC_IMASK_XFIFO_ERROR | FEC_IMASK_RFIFO_ERROR)
+
+#define        FEC_RCNTRL_MAX_FL_SHIFT         16
+#define        FEC_RCNTRL_LOOP                 0x01
+#define        FEC_RCNTRL_DRT                  0x02
+#define        FEC_RCNTRL_MII_MODE             0x04
+#define        FEC_RCNTRL_PROM                 0x08
+#define        FEC_RCNTRL_BC_REJ               0x10
+#define        FEC_RCNTRL_FCE                  0x20
+
+#define        FEC_TCNTRL_GTS                  0x00000001
+#define        FEC_TCNTRL_HBC                  0x00000002
+#define        FEC_TCNTRL_FDEN                 0x00000004
+#define        FEC_TCNTRL_TFC_PAUSE            0x00000008
+#define        FEC_TCNTRL_RFC_PAUSE            0x00000010
+
+#define        FEC_ECNTRL_RESET                0x00000001
+#define        FEC_ECNTRL_ETHER_EN             0x00000002
+
+#define FEC_MII_DATA_ST                        0x40000000      /* Start frame */
+#define FEC_MII_DATA_OP_RD             0x20000000      /* Perform read */
+#define FEC_MII_DATA_OP_WR             0x10000000      /* Perform write */
+#define FEC_MII_DATA_PA_MSK            0x0f800000      /* PHY Address mask */
+#define FEC_MII_DATA_RA_MSK            0x007c0000      /* PHY Register mask */
+#define FEC_MII_DATA_TA                        0x00020000      /* Turnaround */
+#define FEC_MII_DATA_DATAMSK           0x0000ffff      /* PHY data mask */
+
+#define FEC_MII_READ_FRAME     (FEC_MII_DATA_ST | FEC_MII_DATA_OP_RD | FEC_MII_DATA_TA)
+#define FEC_MII_WRITE_FRAME    (FEC_MII_DATA_ST | FEC_MII_DATA_OP_WR | FEC_MII_DATA_TA)
+
+#define FEC_MII_DATA_RA_SHIFT          0x12            /* MII reg addr bits */
+#define FEC_MII_DATA_PA_SHIFT          0x17            /* MII PHY addr bits */
+
+#define FEC_PADDR2_TYPE                        0x8808
+
+#define FEC_OP_PAUSE_OPCODE            0x00010000
+
+#define FEC_FIFO_WMRK_256B             0x3
+
+#define FEC_FIFO_STATUS_ERR            0x00400000
+#define FEC_FIFO_STATUS_UF             0x00200000
+#define FEC_FIFO_STATUS_OF             0x00100000
+
+#define FEC_FIFO_CNTRL_FRAME           0x08000000
+#define FEC_FIFO_CNTRL_LTG_7           0x07000000
+
+#define FEC_RESET_CNTRL_RESET_FIFO     0x02000000
+#define FEC_RESET_CNTRL_ENABLE_IS_RESET        0x01000000
+
+#define FEC_XMIT_FSM_APPEND_CRC                0x02000000
+#define FEC_XMIT_FSM_ENABLE_CRC                0x01000000
+
+
+extern struct of_platform_driver mpc52xx_fec_mdio_driver;
+
+#endif /* __DRIVERS_NET_MPC52XX_FEC_H__ */
diff --git a/drivers/net/fec_mpc52xx_phy.c b/drivers/net/fec_mpc52xx_phy.c
new file mode 100644 (file)
index 0000000..ba6e8b2
--- /dev/null
@@ -0,0 +1,198 @@
+/*
+ * Driver for the MPC5200 Fast Ethernet Controller - MDIO bus driver
+ *
+ * Copyright (C) 2007  Domen Puncer, Telargo, Inc.
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/netdevice.h>
+#include <linux/phy.h>
+#include <linux/of_platform.h>
+#include <asm/io.h>
+#include <asm/mpc52xx.h>
+#include "fec_mpc52xx.h"
+
+struct mpc52xx_fec_mdio_priv {
+       struct mpc52xx_fec __iomem *regs;
+};
+
+static int mpc52xx_fec_mdio_read(struct mii_bus *bus, int phy_id, int reg)
+{
+       struct mpc52xx_fec_mdio_priv *priv = bus->priv;
+       struct mpc52xx_fec __iomem *fec;
+       int tries = 100;
+       u32 request = FEC_MII_READ_FRAME;
+
+       fec = priv->regs;
+       out_be32(&fec->ievent, FEC_IEVENT_MII);
+
+       request |= (phy_id << FEC_MII_DATA_PA_SHIFT) & FEC_MII_DATA_PA_MSK;
+       request |= (reg << FEC_MII_DATA_RA_SHIFT) & FEC_MII_DATA_RA_MSK;
+
+       out_be32(&priv->regs->mii_data, request);
+
+       /* wait for it to finish, this takes about 23 us on lite5200b */
+       while (!(in_be32(&fec->ievent) & FEC_IEVENT_MII) && --tries)
+               udelay(5);
+
+       if (tries == 0)
+               return -ETIMEDOUT;
+
+       return in_be32(&priv->regs->mii_data) & FEC_MII_DATA_DATAMSK;
+}
+
+static int mpc52xx_fec_mdio_write(struct mii_bus *bus, int phy_id, int reg, u16 data)
+{
+       struct mpc52xx_fec_mdio_priv *priv = bus->priv;
+       struct mpc52xx_fec __iomem *fec;
+       u32 value = data;
+       int tries = 100;
+
+       fec = priv->regs;
+       out_be32(&fec->ievent, FEC_IEVENT_MII);
+
+       value |= FEC_MII_WRITE_FRAME;
+       value |= (phy_id << FEC_MII_DATA_PA_SHIFT) & FEC_MII_DATA_PA_MSK;
+       value |= (reg << FEC_MII_DATA_RA_SHIFT) & FEC_MII_DATA_RA_MSK;
+
+       out_be32(&priv->regs->mii_data, value);
+
+       /* wait for request to finish */
+       while (!(in_be32(&fec->ievent) & FEC_IEVENT_MII) && --tries)
+               udelay(5);
+
+       if (tries == 0)
+               return -ETIMEDOUT;
+
+       return 0;
+}
+
+static int mpc52xx_fec_mdio_probe(struct of_device *of, const struct of_device_id *match)
+{
+       struct device *dev = &of->dev;
+       struct device_node *np = of->node;
+       struct device_node *child = NULL;
+       struct mii_bus *bus;
+       struct mpc52xx_fec_mdio_priv *priv;
+       struct resource res = {};
+       int err;
+       int i;
+
+       bus = kzalloc(sizeof(*bus), GFP_KERNEL);
+       if (bus == NULL)
+               return -ENOMEM;
+       priv = kzalloc(sizeof(*priv), GFP_KERNEL);
+       if (priv == NULL) {
+               err = -ENOMEM;
+               goto out_free;
+       }
+
+       bus->name = "mpc52xx MII bus";
+       bus->read = mpc52xx_fec_mdio_read;
+       bus->write = mpc52xx_fec_mdio_write;
+
+       /* setup irqs */
+       bus->irq = kmalloc(sizeof(bus->irq[0]) * PHY_MAX_ADDR, GFP_KERNEL);
+       if (bus->irq == NULL) {
+               err = -ENOMEM;
+               goto out_free;
+       }
+       for (i=0; i<PHY_MAX_ADDR; i++)
+               bus->irq[i] = PHY_POLL;
+
+       while ((child = of_get_next_child(np, child)) != NULL) {
+               int irq = irq_of_parse_and_map(child, 0);
+               if (irq != NO_IRQ) {
+                       const u32 *id = of_get_property(child, "reg", NULL);
+                       bus->irq[*id] = irq;
+               }
+       }
+
+       /* setup registers */
+       err = of_address_to_resource(np, 0, &res);
+       if (err)
+               goto out_free;
+       priv->regs = ioremap(res.start, res.end - res.start + 1);
+       if (priv->regs == NULL) {
+               err = -ENOMEM;
+               goto out_free;
+       }
+
+       bus->id = res.start;
+       bus->priv = priv;
+
+       bus->dev = dev;
+       dev_set_drvdata(dev, bus);
+
+       /* set MII speed */
+       out_be32(&priv->regs->mii_speed, ((mpc52xx_find_ipb_freq(of->node) >> 20) / 5) << 1);
+
+       /* enable MII interrupt */
+       out_be32(&priv->regs->imask, in_be32(&priv->regs->imask) | FEC_IMASK_MII);
+
+       err = mdiobus_register(bus);
+       if (err)
+               goto out_unmap;
+
+       return 0;
+
+ out_unmap:
+       iounmap(priv->regs);
+ out_free:
+       for (i=0; i<PHY_MAX_ADDR; i++)
+               if (bus->irq[i] != PHY_POLL)
+                       irq_dispose_mapping(bus->irq[i]);
+       kfree(bus->irq);
+       kfree(priv);
+       kfree(bus);
+
+       return err;
+}
+
+static int mpc52xx_fec_mdio_remove(struct of_device *of)
+{
+       struct device *dev = &of->dev;
+       struct mii_bus *bus = dev_get_drvdata(dev);
+       struct mpc52xx_fec_mdio_priv *priv = bus->priv;
+       int i;
+
+       mdiobus_unregister(bus);
+       dev_set_drvdata(dev, NULL);
+
+       iounmap(priv->regs);
+       for (i=0; i<PHY_MAX_ADDR; i++)
+               if (bus->irq[i])
+                       irq_dispose_mapping(bus->irq[i]);
+       kfree(priv);
+       kfree(bus->irq);
+       kfree(bus);
+
+       return 0;
+}
+
+
+static struct of_device_id mpc52xx_fec_mdio_match[] = {
+       {
+               .type = "mdio",
+               .compatible = "mpc5200b-fec-phy",
+       },
+       {},
+};
+
+struct of_platform_driver mpc52xx_fec_mdio_driver = {
+       .name = "mpc5200b-fec-phy",
+       .probe = mpc52xx_fec_mdio_probe,
+       .remove = mpc52xx_fec_mdio_remove,
+       .match_table = mpc52xx_fec_mdio_match,
+};
+
+/* let fec driver call it, since this has to be registered before it */
+EXPORT_SYMBOL_GPL(mpc52xx_fec_mdio_driver);
+
+
+MODULE_LICENSE("Dual BSD/GPL");
index 2765e49e07df121982e8c4ebe5bc4f0bff2f28b8..562ea68ed99b3f2f4c00d0e69e8e10640a0c6b88 100644 (file)
@@ -2,6 +2,7 @@ config FS_ENET
        tristate "Freescale Ethernet Driver"
        depends on CPM1 || CPM2
        select MII
+       select PHYLIB
 
 config FS_ENET_HAS_SCC
        bool "Chip has an SCC usable for ethernet"
@@ -11,11 +12,19 @@ config FS_ENET_HAS_SCC
 config FS_ENET_HAS_FCC
        bool "Chip has an FCC usable for ethernet"
        depends on FS_ENET && CPM2
-       select MDIO_BITBANG
        default y
 
 config FS_ENET_HAS_FEC
        bool "Chip has an FEC usable for ethernet"
        depends on FS_ENET && CPM1
+       select FS_ENET_MDIO_FEC
        default y
 
+config FS_ENET_MDIO_FEC
+       tristate "MDIO driver for FEC"
+       depends on FS_ENET && CPM1
+
+config FS_ENET_MDIO_FCC
+       tristate "MDIO driver for FCC"
+       depends on FS_ENET && CPM2
+       select MDIO_BITBANG
index 02d4dc18ba693c0f7daa0c3d0a2edc478a0a5241..1ffbe0756a0c6bde820e736b4e5ae424ffbace70 100644 (file)
@@ -4,7 +4,16 @@
 
 obj-$(CONFIG_FS_ENET) += fs_enet.o
 
-obj-$(CONFIG_8xx) += mac-fec.o mac-scc.o mii-fec.o
-obj-$(CONFIG_CPM2) += mac-fcc.o mii-bitbang.o
+fs_enet-$(CONFIG_FS_ENET_HAS_SCC) += mac-scc.o
+fs_enet-$(CONFIG_FS_ENET_HAS_FEC) += mac-fec.o
+fs_enet-$(CONFIG_FS_ENET_HAS_FCC) += mac-fcc.o
 
-fs_enet-objs := fs_enet-main.o
+ifeq ($(CONFIG_PPC_CPM_NEW_BINDING),y)
+obj-$(CONFIG_FS_ENET_MDIO_FEC) += mii-fec.o
+obj-$(CONFIG_FS_ENET_MDIO_FCC) += mii-bitbang.o
+else
+fs_enet-$(CONFIG_FS_ENET_MDIO_FEC) += mii-fec.o
+fs_enet-$(CONFIG_FS_ENET_MDIO_FCC) += mii-bitbang.o
+endif
+
+fs_enet-objs := fs_enet-main.o $(fs_enet-m)
index e0119f6a3319b2fca40af251d7bd3bf09dcde038..580cb4ab2af10042fccc2d94e5fad7448944cac1 100644 (file)
@@ -762,26 +762,20 @@ static int sixpack_ioctl(struct tty_struct *tty, struct file *file,
 
                if (copy_from_user(&addr,
                                   (void __user *) arg, AX25_ADDR_LEN)) {
-                       err = -EFAULT;
-                       break;
-               }
+                               err = -EFAULT;
+                               break;
+                       }
 
-               netif_tx_lock_bh(dev);
-               memcpy(dev->dev_addr, &addr, AX25_ADDR_LEN);
-               netif_tx_unlock_bh(dev);
+                       netif_tx_lock_bh(dev);
+                       memcpy(dev->dev_addr, &addr, AX25_ADDR_LEN);
+                       netif_tx_unlock_bh(dev);
 
-               err = 0;
-               break;
-       }
-
-       /* Allow stty to read, but not set, the serial port */
-       case TCGETS:
-       case TCGETA:
-               err = n_tty_ioctl(tty, (struct file *) file, cmd, arg);
-               break;
+                       err = 0;
+                       break;
+               }
 
        default:
-               err = -ENOIOCTLCMD;
+               err = tty_mode_ioctl(tty, file, cmd, arg);
        }
 
        sp_put(sp);
index 4dbdfaaf37bf4473003b198cec87f718bafcfcc5..a1e4508717c8743bfa8f8d15c77a1383318e8884 100644 (file)
@@ -627,19 +627,16 @@ static int au1k_irda_rx(struct net_device *dev)
 }
 
 
-void au1k_irda_interrupt(int irq, void *dev_id)
+static irqreturn_t au1k_irda_interrupt(int dummy, void *dev_id)
 {
-       struct net_device *dev = (struct net_device *) dev_id;
-
-       if (dev == NULL) {
-               printk(KERN_ERR "%s: isr: null dev ptr\n", dev->name);
-               return;
-       }
+       struct net_device *dev = dev_id;
 
        writel(0, IR_INT_CLEAR); /* ack irda interrupts */
 
        au1k_irda_rx(dev);
        au1k_tx_ack(dev);
+
+       return IRQ_HANDLED;
 }
 
 
index 2c6f7be36e8aa8eb9d712c44fd7c84be92b9530a..fc753d7f674e41b0a231ac45663806c7b84ab06a 100644 (file)
@@ -434,11 +434,6 @@ static int irtty_ioctl(struct tty_struct *tty, struct file *file, unsigned int c
        IRDA_ASSERT(dev != NULL, return -1;);
 
        switch (cmd) {
-       case TCGETS:
-       case TCGETA:
-               err = n_tty_ioctl(tty, file, cmd, arg);
-               break;
-
        case IRTTY_IOCTDONGLE:
                /* this call blocks for completion */
                err = sirdev_set_dongle(dev, (IRDA_DONGLE) arg);
@@ -454,7 +449,7 @@ static int irtty_ioctl(struct tty_struct *tty, struct file *file, unsigned int c
                        err = -EFAULT;
                break;
        default:
-               err = -ENOIOCTLCMD;
+               err = tty_mode_ioctl(tty, file, cmd, arg);
                break;
        }
        return err;
index 1eee8894c732e0aac48be5fcab68c44c8cd62fa6..3d2e7217e9af04a9afd5beac494d67b0761255a8 100644 (file)
@@ -196,4 +196,11 @@ struct ixgb_adapter {
        uint32_t alloc_rx_buff_failed;
        boolean_t have_msi;
 };
+
+/* Exported from other modules */
+extern void ixgb_check_options(struct ixgb_adapter *adapter);
+extern void ixgb_set_ethtool_ops(struct net_device *netdev);
+extern char ixgb_driver_name[];
+extern const char ixgb_driver_version[];
+
 #endif /* _IXGB_H_ */
index fddd5844168d69202d4c39748ae24ed282999f6e..a267dd86252072927755fec2d120af904804e0fc 100644 (file)
@@ -32,9 +32,6 @@
 
 #include <asm/uaccess.h>
 
-extern char ixgb_driver_name[];
-extern char ixgb_driver_version[];
-
 extern int ixgb_up(struct ixgb_adapter *adapter);
 extern void ixgb_down(struct ixgb_adapter *adapter, boolean_t kill_watchdog);
 extern void ixgb_reset(struct ixgb_adapter *adapter);
@@ -639,8 +636,8 @@ ixgb_phys_id(struct net_device *netdev, uint32_t data)
 {
        struct ixgb_adapter *adapter = netdev_priv(netdev);
 
-       if(!data || data > (uint32_t)(MAX_SCHEDULE_TIMEOUT / HZ))
-               data = (uint32_t)(MAX_SCHEDULE_TIMEOUT / HZ);
+       if (!data)
+               data = INT_MAX;
 
        if(!adapter->blink_timer.function) {
                init_timer(&adapter->blink_timer);
index ecbf45861c6825c34c91adad1322c72d6137107d..2c6367ace3cd9a5a4f3b17c70d2c0e69845150f1 100644 (file)
@@ -1174,7 +1174,7 @@ mac_addr_valid(uint8_t *mac_addr)
  *
  * hw - Struct containing variables accessed by shared code
  *****************************************************************************/
-boolean_t
+static boolean_t
 ixgb_link_reset(struct ixgb_hw *hw)
 {
        boolean_t link_status = FALSE;
@@ -1205,7 +1205,7 @@ ixgb_link_reset(struct ixgb_hw *hw)
  *
  * hw - Struct containing variables accessed by shared code
  *****************************************************************************/
-void
+static void
 ixgb_optics_reset(struct ixgb_hw *hw)
 {
        if (hw->phy_type == ixgb_phy_type_txn17401) {
index d444de58ba341455b40cf823e31736f270c01836..3021234b1e173f5653603bcde3998db26ea3abba 100644 (file)
@@ -37,8 +37,8 @@ static char ixgb_driver_string[] = "Intel(R) PRO/10GbE Network Driver";
 #define DRIVERNAPI "-NAPI"
 #endif
 #define DRV_VERSION            "1.0.126-k2"DRIVERNAPI
-char ixgb_driver_version[] = DRV_VERSION;
-static char ixgb_copyright[] = "Copyright (c) 1999-2006 Intel Corporation.";
+const char ixgb_driver_version[] = DRV_VERSION;
+static const char ixgb_copyright[] = "Copyright (c) 1999-2006 Intel Corporation.";
 
 /* ixgb_pci_tbl - PCI Device ID Table
  *
@@ -104,7 +104,6 @@ static boolean_t ixgb_clean_rx_irq(struct ixgb_adapter *adapter,
 static boolean_t ixgb_clean_rx_irq(struct ixgb_adapter *adapter);
 #endif
 static void ixgb_alloc_rx_buffers(struct ixgb_adapter *adapter);
-void ixgb_set_ethtool_ops(struct net_device *netdev);
 static void ixgb_tx_timeout(struct net_device *dev);
 static void ixgb_tx_timeout_task(struct work_struct *work);
 static void ixgb_vlan_rx_register(struct net_device *netdev,
@@ -123,9 +122,6 @@ static pci_ers_result_t ixgb_io_error_detected (struct pci_dev *pdev,
 static pci_ers_result_t ixgb_io_slot_reset (struct pci_dev *pdev);
 static void ixgb_io_resume (struct pci_dev *pdev);
 
-/* Exported from other modules */
-extern void ixgb_check_options(struct ixgb_adapter *adapter);
-
 static struct pci_error_handlers ixgb_err_handler = {
        .error_detected = ixgb_io_error_detected,
        .slot_reset = ixgb_io_slot_reset,
@@ -1085,7 +1081,8 @@ ixgb_set_multi(struct net_device *netdev)
                rctl |= IXGB_RCTL_MPE;
                IXGB_WRITE_REG(hw, RCTL, rctl);
        } else {
-               uint8_t mta[netdev->mc_count * IXGB_ETH_LENGTH_OF_ADDRESS];
+               uint8_t mta[IXGB_MAX_NUM_MULTICAST_ADDRESSES *
+                           IXGB_ETH_LENGTH_OF_ADDRESS];
 
                IXGB_WRITE_REG(hw, RCTL, rctl);
 
@@ -1324,8 +1321,8 @@ ixgb_tx_map(struct ixgb_adapter *adapter, struct sk_buff *skb,
 
                        /* Workaround for premature desc write-backs
                         * in TSO mode.  Append 4-byte sentinel desc */
-                       if (unlikely(mss && !nr_frags && size == len
-                                    && size > 8))
+                       if (unlikely(mss && (f == (nr_frags - 1))
+                                    && size == len && size > 8))
                                size -= 4;
 
                        buffer_info->length = size;
index 5d5ddabf4360ccfdf6f15fb9c4600aa7c395933e..865d14d6e5a734513836a032cce28f3916ca46f7 100644 (file)
  */
 
 #define IXGB_PARAM_INIT { [0 ... IXGB_MAX_NIC] = OPTION_UNSET }
-#define IXGB_PARAM(X, desc) \
-       static int __devinitdata X[IXGB_MAX_NIC+1] = IXGB_PARAM_INIT; \
-       static int num_##X = 0; \
-       module_param_array_named(X, X, int, &num_##X, 0); \
+#define IXGB_PARAM(X, desc)                                    \
+       static int __devinitdata X[IXGB_MAX_NIC+1]              \
+               = IXGB_PARAM_INIT;                              \
+       static unsigned int num_##X = 0;                        \
+       module_param_array_named(X, X, int, &num_##X, 0);       \
        MODULE_PARM_DESC(X, desc);
 
 /* Transmit Descriptor Count
@@ -178,8 +179,8 @@ IXGB_PARAM(IntDelayEnable, "Transmit Interrupt Delay Enable");
 
 struct ixgb_option {
        enum { enable_option, range_option, list_option } type;
-       char *name;
-       char *err;
+       const char *name;
+       const char *err;
        int def;
        union {
                struct {        /* range_option info */
@@ -197,7 +198,7 @@ struct ixgb_option {
 };
 
 static int __devinit
-ixgb_validate_option(int *value, struct ixgb_option *opt)
+ixgb_validate_option(unsigned int *value, const struct ixgb_option *opt)
 {
        if(*value == OPTION_UNSET) {
                *value = opt->def;
@@ -266,7 +267,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
        }
 
        { /* Transmit Descriptor Count */
-               struct ixgb_option opt = {
+               const struct ixgb_option opt = {
                        .type = range_option,
                        .name = "Transmit Descriptors",
                        .err  = "using default of " __MODULE_STRING(DEFAULT_TXD),
@@ -285,7 +286,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
                tx_ring->count = ALIGN(tx_ring->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE);
        }
        { /* Receive Descriptor Count */
-               struct ixgb_option opt = {
+               const struct ixgb_option opt = {
                        .type = range_option,
                        .name = "Receive Descriptors",
                        .err  = "using default of " __MODULE_STRING(DEFAULT_RXD),
@@ -304,7 +305,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
                rx_ring->count = ALIGN(rx_ring->count, IXGB_REQ_RX_DESCRIPTOR_MULTIPLE);
        }
        { /* Receive Checksum Offload Enable */
-               struct ixgb_option opt = {
+               const struct ixgb_option opt = {
                        .type = enable_option,
                        .name = "Receive Checksum Offload",
                        .err  = "defaulting to Enabled",
@@ -312,7 +313,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
                };
 
                if(num_XsumRX > bd) {
-                       int rx_csum = XsumRX[bd];
+                       unsigned int rx_csum = XsumRX[bd];
                        ixgb_validate_option(&rx_csum, &opt);
                        adapter->rx_csum = rx_csum;
                } else {
@@ -328,7 +329,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
                         { ixgb_fc_full,        "Flow Control Enabled" },
                         { ixgb_fc_default, "Flow Control Hardware Default" }};
 
-               struct ixgb_option opt = {
+               const struct ixgb_option opt = {
                        .type = list_option,
                        .name = "Flow Control",
                        .err  = "reading default settings from EEPROM",
@@ -338,7 +339,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
                };
 
                if(num_FlowControl > bd) {
-                       int fc = FlowControl[bd];
+                       unsigned int fc = FlowControl[bd];
                        ixgb_validate_option(&fc, &opt);
                        adapter->hw.fc.type = fc;
                } else {
@@ -346,7 +347,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
                }
        }
        { /* Receive Flow Control High Threshold */
-               struct ixgb_option opt = {
+               const struct ixgb_option opt = {
                        .type = range_option,
                        .name = "Rx Flow Control High Threshold",
                        .err  = "using default of " __MODULE_STRING(DEFAULT_FCRTH),
@@ -366,7 +367,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
                                "Ignoring RxFCHighThresh when no RxFC\n");
        }
        { /* Receive Flow Control Low Threshold */
-               struct ixgb_option opt = {
+               const struct ixgb_option opt = {
                        .type = range_option,
                        .name = "Rx Flow Control Low Threshold",
                        .err  = "using default of " __MODULE_STRING(DEFAULT_FCRTL),
@@ -386,7 +387,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
                                "Ignoring RxFCLowThresh when no RxFC\n");
        }
        { /* Flow Control Pause Time Request*/
-               struct ixgb_option opt = {
+               const struct ixgb_option opt = {
                        .type = range_option,
                        .name = "Flow Control Pause Time Request",
                        .err  = "using default of "__MODULE_STRING(DEFAULT_FCPAUSE),
@@ -396,7 +397,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
                };
 
                if(num_FCReqTimeout > bd) {
-                       int pause_time = FCReqTimeout[bd];
+                       unsigned int pause_time = FCReqTimeout[bd];
                        ixgb_validate_option(&pause_time, &opt);
                        adapter->hw.fc.pause_time = pause_time;
                } else {
@@ -419,7 +420,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
                }
        }
        { /* Receive Interrupt Delay */
-               struct ixgb_option opt = {
+               const struct ixgb_option opt = {
                        .type = range_option,
                        .name = "Receive Interrupt Delay",
                        .err  = "using default of " __MODULE_STRING(DEFAULT_RDTR),
@@ -436,7 +437,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
                }
        }
        { /* Transmit Interrupt Delay */
-               struct ixgb_option opt = {
+               const struct ixgb_option opt = {
                        .type = range_option,
                        .name = "Transmit Interrupt Delay",
                        .err  = "using default of " __MODULE_STRING(DEFAULT_TIDV),
@@ -454,7 +455,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
        }
 
        { /* Transmit Interrupt Delay Enable */
-               struct ixgb_option opt = {
+               const struct ixgb_option opt = {
                        .type = enable_option,
                        .name = "Tx Interrupt Delay Enable",
                        .err  = "defaulting to Enabled",
@@ -462,7 +463,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
                };
 
                if(num_IntDelayEnable > bd) {
-                       int ide = IntDelayEnable[bd];
+                       unsigned int ide = IntDelayEnable[bd];
                        ixgb_validate_option(&ide, &opt);
                        adapter->tx_int_delay_enable = ide;
                } else {
index c160a7d91e21a2c3b24e289665c93387cd72095f..bc51432b8d266cd20bd4e18bba1524433d349dcb 100644 (file)
@@ -244,7 +244,7 @@ extern struct ixgbe_info ixgbe_82598EB_info;
 extern struct ixgbe_info ixgbe_82598AT_info;
 
 extern char ixgbe_driver_name[];
-extern char ixgbe_driver_version[];
+extern const char ixgbe_driver_version[];
 
 extern int ixgbe_up(struct ixgbe_adapter *adapter);
 extern void ixgbe_down(struct ixgbe_adapter *adapter);
index 00ee20125ca9c94e92e0ab77659ef9a76a0d79c4..4d64673164ca5e580cfd4cf74d4556d8b4cf73e7 100644 (file)
@@ -30,8 +30,7 @@
 #include <linux/delay.h>
 #include <linux/sched.h>
 
-#include "ixgbe_type.h"
-#include "ixgbe_common.h"
+#include "ixgbe.h"
 #include "ixgbe_phy.h"
 
 #define IXGBE_82598_MAX_TX_QUEUES 32
index b75f1c6efc42b589516a1e4efa5fbd7ae504723d..00bc525c656071aebb25b8c4151eba246ce72686 100644 (file)
 #include "ixgbe_common.h"
 
 char ixgbe_driver_name[] = "ixgbe";
-static char ixgbe_driver_string[] =
-                       "Intel(R) 10 Gigabit PCI Express Network Driver";
+static const char ixgbe_driver_string[] =
+       "Intel(R) 10 Gigabit PCI Express Network Driver";
 
 #define DRV_VERSION "1.1.18"
-char ixgbe_driver_version[] = DRV_VERSION;
-static char ixgbe_copyright[] = "Copyright (c) 1999-2007 Intel Corporation.";
+const char ixgbe_driver_version[] = DRV_VERSION;
+static const char ixgbe_copyright[] =
+        "Copyright (c) 1999-2007 Intel Corporation.";
 
 static const struct ixgbe_info *ixgbe_info_tbl[] = {
        [board_82598AF]                 = &ixgbe_82598AF_info,
index 45f30a2974b8f49405ec5ab07e4e605c6be60cb8..662b8d16803ce7fec85f59af645b60aabee75c41 100644 (file)
@@ -284,7 +284,7 @@ static __net_exit void loopback_net_exit(struct net *net)
        unregister_netdev(dev);
 }
 
-static struct pernet_operations loopback_net_ops = {
+static struct pernet_operations __net_initdata loopback_net_ops = {
        .init = loopback_net_init,
        .exit = loopback_net_exit,
 };
index e25dbab67363c3b5ede9eea2fec63b1197577848..0c89b028a80c5f04c7b1ca0cdfe3ff62f6b974ce 100644 (file)
@@ -33,7 +33,6 @@
 #include <asm/ip32/ip32_ints.h>
 
 #include <asm/io.h>
-#include <asm/scatterlist.h>
 
 #include "meth.h"
 
index f8d63d39f59246bc80da046ee72963e2303c8644..b226e019bc8b70ab18fee4d8a8c6f6540f40711e 100644 (file)
@@ -171,9 +171,10 @@ void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf)
                                  buf->u.direct.map);
        else {
                for (i = 0; i < buf->nbufs; ++i)
-                       dma_free_coherent(&dev->pdev->dev, PAGE_SIZE,
-                                         buf->u.page_list[i].buf,
-                                         buf->u.page_list[i].map);
+                       if (buf->u.page_list[i].buf)
+                               dma_free_coherent(&dev->pdev->dev, PAGE_SIZE,
+                                                 buf->u.page_list[i].buf,
+                                                 buf->u.page_list[i].map);
                kfree(buf->u.page_list);
        }
 }
index cc4b1be182196c8b11836def9387215272d4bba8..42b47639c81cb6f4753ea728bd86d81d060c5792 100644 (file)
@@ -240,7 +240,7 @@ void mlx4_qp_free(struct mlx4_dev *dev, struct mlx4_qp *qp)
        mlx4_table_put(dev, &qp_table->auxc_table, qp->qpn);
        mlx4_table_put(dev, &qp_table->qp_table, qp->qpn);
 
-       if (qp->qpn < dev->caps.sqp_start + 8)
+       if (qp->qpn >= dev->caps.sqp_start + 8)
                mlx4_bitmap_free(&qp_table->bitmap, qp->qpn);
 }
 EXPORT_SYMBOL_GPL(mlx4_qp_free);
index 366e62a2b1e5dacea1e1afd7fa0e89870afbf07d..0f306ddb5630eb05257d21d44bc533b88c184d23 100644 (file)
@@ -1151,7 +1151,7 @@ static inline int myri10ge_clean_rx_done(struct myri10ge_priv *mgp, int budget)
        u16 length;
        __wsum checksum;
 
-       while (rx_done->entry[idx].length != 0 && work_done++ < budget) {
+       while (rx_done->entry[idx].length != 0 && work_done < budget) {
                length = ntohs(rx_done->entry[idx].length);
                rx_done->entry[idx].length = 0;
                checksum = csum_unfold(rx_done->entry[idx].checksum);
@@ -1167,6 +1167,7 @@ static inline int myri10ge_clean_rx_done(struct myri10ge_priv *mgp, int budget)
                rx_bytes += rx_ok * (unsigned long)length;
                cnt++;
                idx = cnt & (myri10ge_max_intr_slots - 1);
+               work_done++;
        }
        rx_done->idx = idx;
        rx_done->cnt = cnt;
@@ -1233,13 +1234,12 @@ static int myri10ge_poll(struct napi_struct *napi, int budget)
        struct myri10ge_priv *mgp =
            container_of(napi, struct myri10ge_priv, napi);
        struct net_device *netdev = mgp->dev;
-       struct myri10ge_rx_done *rx_done = &mgp->rx_done;
        int work_done;
 
        /* process as many rx events as NAPI will allow */
        work_done = myri10ge_clean_rx_done(mgp, budget);
 
-       if (rx_done->entry[rx_done->idx].length == 0 || !netif_running(netdev)) {
+       if (work_done < budget || !netif_running(netdev)) {
                netif_rx_complete(netdev, napi);
                put_be32(htonl(3), mgp->irq_claim);
        }
index 8d29319cc5cb39b88b3f13a37cb017bf28b595b2..656a260fc956b1cf52912da2b3c8aa108d7154c9 100644 (file)
@@ -134,7 +134,7 @@ static int myri_do_handshake(struct myri_eth *mp)
 
        myri_disable_irq(mp->lregs, cregs);
 
-       while (tick++ <= 25) {
+       while (tick++ < 25) {
                u32 softstate;
 
                /* Wake it up. */
index eb0aff787dfda8e5c910c45f752d4bb07c82eef4..5267e031daa0b3ab27d3d1dde092cb2fdc8e6159 100644 (file)
@@ -128,8 +128,8 @@ netx_eth_hard_start_xmit(struct sk_buff *skb, struct net_device *ndev)
                   FIFO_PTR_FRAMELEN(len));
 
        ndev->trans_start = jiffies;
-       dev->stats.tx_packets++;
-       dev->stats.tx_bytes += skb->len;
+       ndev->stats.tx_packets++;
+       ndev->stats.tx_bytes += skb->len;
 
        netif_stop_queue(ndev);
        spin_unlock_irq(&priv->lock);
@@ -155,7 +155,7 @@ static void netx_eth_receive(struct net_device *ndev)
        if (unlikely(skb == NULL)) {
                printk(KERN_NOTICE "%s: Low memory, packet dropped.\n",
                        ndev->name);
-               dev->stats.rx_dropped++;
+               ndev->stats.rx_dropped++;
                return;
        }
 
index ab4d309a858fab572782a534b334d4a8b35babf4..09b4fde8d924978d05a63d8e57b834dea02ecea9 100644 (file)
@@ -580,6 +580,16 @@ static int pasemi_mac_clean_rx(struct pasemi_mac *mac, int limit)
 
                len = (macrx & XCT_MACRX_LLEN_M) >> XCT_MACRX_LLEN_S;
 
+               pci_unmap_single(mac->dma_pdev, dma, len, PCI_DMA_FROMDEVICE);
+
+               if (macrx & XCT_MACRX_CRC) {
+                       /* CRC error flagged */
+                       mac->netdev->stats.rx_errors++;
+                       mac->netdev->stats.rx_crc_errors++;
+                       dev_kfree_skb_irq(skb);
+                       goto next;
+               }
+
                if (len < 256) {
                        struct sk_buff *new_skb;
 
@@ -595,11 +605,10 @@ static int pasemi_mac_clean_rx(struct pasemi_mac *mac, int limit)
                } else
                        info->skb = NULL;
 
-               pci_unmap_single(mac->dma_pdev, dma, len, PCI_DMA_FROMDEVICE);
-
                info->dma = 0;
 
-               skb_put(skb, len);
+               /* Don't include CRC */
+               skb_put(skb, len-4);
 
                if (likely((macrx & XCT_MACRX_HTY_M) == XCT_MACRX_HTY_IPV4_OK)) {
                        skb->ip_summed = CHECKSUM_UNNECESSARY;
@@ -614,6 +623,7 @@ static int pasemi_mac_clean_rx(struct pasemi_mac *mac, int limit)
                skb->protocol = eth_type_trans(skb, mac->netdev);
                netif_receive_skb(skb);
 
+next:
                RX_RING(mac, n) = 0;
                RX_RING(mac, n+1) = 0;
 
@@ -1126,7 +1136,7 @@ static int pasemi_mac_start_tx(struct sk_buff *skb, struct net_device *dev)
        unsigned long flags;
        int i, nfrags;
 
-       dflags = XCT_MACTX_O | XCT_MACTX_ST | XCT_MACTX_SS | XCT_MACTX_CRC_PAD;
+       dflags = XCT_MACTX_O | XCT_MACTX_ST | XCT_MACTX_CRC_PAD;
 
        if (skb->ip_summed == CHECKSUM_PARTIAL) {
                const unsigned char *nh = skb_network_header(skb);
index 73dcbb7296dad2fa20d3b71cc5d3729c2a7d5724..ad134a61302ac95700c52e6270031ff0451d2573 100644 (file)
@@ -274,7 +274,7 @@ static int tc574_probe(struct pcmcia_device *link)
        spin_lock_init(&lp->window_lock);
        link->io.NumPorts1 = 32;
        link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-       link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT;
+       link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_HANDLE_PRESENT;
        link->irq.IRQInfo1 = IRQ_LEVEL_ID;
        link->irq.Handler = &el3_interrupt;
        link->irq.Instance = dev;
index 32076ca6a9e1ff35fd32fd742b966540246600f4..a98fe07cce70e0f6b591334dfa3ecfd038a3feff 100644 (file)
@@ -188,7 +188,7 @@ static int tc589_probe(struct pcmcia_device *link)
     spin_lock_init(&lp->lock);
     link->io.NumPorts1 = 16;
     link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-    link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT;
+    link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_HANDLE_PRESENT;
     link->irq.IRQInfo1 = IRQ_LEVEL_ID;
     link->irq.Handler = &el3_interrupt;
     link->irq.Instance = dev;
index a95a2cae6b23ef56d2a5ecf036f9713ff33d7271..8d910a372f89ae9d5e64ce85791a17bbab0eba53 100644 (file)
@@ -158,7 +158,7 @@ static int axnet_probe(struct pcmcia_device *link)
     info = PRIV(dev);
     info->p_dev = link;
     link->priv = dev;
-    link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
+    link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
     link->irq.IRQInfo1 = IRQ_LEVEL_ID;
     link->conf.Attributes = CONF_ENABLE_IRQ;
     link->conf.IntType = INT_MEMORY_AND_IO;
index 62844677c784d43fc0974cd6517cf5f41c52532c..8c719b4df54401a0f95388d2285e918fe743e76f 100644 (file)
@@ -249,7 +249,7 @@ static int fmvj18x_probe(struct pcmcia_device *link)
     link->io.IOAddrLines = 5;
 
     /* Interrupt setup */
-    link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT;
+    link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_HANDLE_PRESENT;
     link->irq.IRQInfo1 = IRQ_LEVEL_ID;
     link->irq.Handler = &fjn_interrupt;
     link->irq.Instance = dev;
index 9d45e9696e161534a9589a5e5c298dde7e35d9bc..db6a97d1d7b1e7292d60a4e642ed1e35e545b2a3 100644 (file)
@@ -254,7 +254,7 @@ static int pcnet_probe(struct pcmcia_device *link)
     info->p_dev = link;
     link->priv = dev;
 
-    link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
+    link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
     link->irq.IRQInfo1 = IRQ_LEVEL_ID;
     link->conf.Attributes = CONF_ENABLE_IRQ;
     link->conf.IntType = INT_MEMORY_AND_IO;
index 58d716fd17cfac318e7d87876137c966967012d6..c9868e9dac4caa70675f9367498e93dc8a63ae99 100644 (file)
@@ -328,7 +328,7 @@ static int smc91c92_probe(struct pcmcia_device *link)
     link->io.NumPorts1 = 16;
     link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
     link->io.IOAddrLines = 4;
-    link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT;
+    link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_HANDLE_PRESENT;
     link->irq.IRQInfo1 = IRQ_LEVEL_ID;
     link->irq.Handler = &smc_interrupt;
     link->irq.Instance = dev;
index c3b69602e275d7f90650f57aa69989ab4130f0c0..1f09bea6db5ab8024c87f6dc37ff13a1707f3a2d 100644 (file)
@@ -886,7 +886,7 @@ xirc2ps_config(struct pcmcia_device * link)
        }
        printk(KNOT_XIRC "no ports available\n");
     } else {
-       link->irq.Attributes |= IRQ_TYPE_EXCLUSIVE;
+       link->irq.Attributes |= IRQ_TYPE_DYNAMIC_SHARING;
        link->io.NumPorts1 = 16;
        for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) {
            link->io.BasePort1 = ioaddr;
index d2ede5ff9fffc5e70136207738c7fada30ca31e4..035fd41fb61f01408517d7fef176b8e42f8173d7 100644 (file)
@@ -265,7 +265,7 @@ static struct phy_driver marvell_drivers[] = {
                .read_status = &genphy_read_status,
                .ack_interrupt = &marvell_ack_interrupt,
                .config_intr = &marvell_config_intr,
-               .driver = {.owner = THIS_MODULE,},
+               .driver = { .owner = THIS_MODULE },
        },
        {
                .phy_id = 0x01410c90,
@@ -278,7 +278,7 @@ static struct phy_driver marvell_drivers[] = {
                .read_status = &genphy_read_status,
                .ack_interrupt = &marvell_ack_interrupt,
                .config_intr = &marvell_config_intr,
-               .driver = {.owner = THIS_MODULE,},
+               .driver = { .owner = THIS_MODULE },
        },
        {
                .phy_id = 0x01410cc0,
@@ -291,7 +291,7 @@ static struct phy_driver marvell_drivers[] = {
                .read_status = &genphy_read_status,
                .ack_interrupt = &marvell_ack_interrupt,
                .config_intr = &marvell_config_intr,
-               .driver = {.owner = THIS_MODULE,},
+               .driver = { .owner = THIS_MODULE },
        },
        {
                .phy_id = 0x01410cd0,
@@ -304,8 +304,21 @@ static struct phy_driver marvell_drivers[] = {
                .read_status = &genphy_read_status,
                .ack_interrupt = &marvell_ack_interrupt,
                .config_intr = &marvell_config_intr,
-               .driver = {.owner = THIS_MODULE,},
-       }
+               .driver = { .owner = THIS_MODULE },
+       },
+       {
+               .phy_id = 0x01410e30,
+               .phy_id_mask = 0xfffffff0,
+               .name = "Marvell 88E1240",
+               .features = PHY_GBIT_FEATURES,
+               .flags = PHY_HAS_INTERRUPT,
+               .config_init = &m88e1111_config_init,
+               .config_aneg = &marvell_config_aneg,
+               .read_status = &genphy_read_status,
+               .ack_interrupt = &marvell_ack_interrupt,
+               .config_intr = &marvell_config_intr,
+               .driver = { .owner = THIS_MODULE },
+       },
 };
 
 static int __init marvell_init(void)
index c0461217b1084e9ed1264ee82b357cc770ce6321..f6e484812a98f73df8541aebd6835fe11ff54196 100644 (file)
@@ -706,7 +706,7 @@ int phy_driver_register(struct phy_driver *new_driver)
                return retval;
        }
 
-       pr_info("%s: Registered new driver\n", new_driver->name);
+       pr_debug("%s: Registered new driver\n", new_driver->name);
 
        return 0;
 }
index 5071fcd8a0bd18a08cc21b4b7e48a625a971017e..57c98669984db34dbc921216e7256a0dec8e8f40 100644 (file)
@@ -663,7 +663,7 @@ plip_receive_packet(struct net_device *dev, struct net_local *nl,
        case PLIP_PK_DONE:
                /* Inform the upper layer for the arrival of a packet. */
                rcv->skb->protocol=plip_type_trans(rcv->skb, dev);
-               netif_rx(rcv->skb);
+               netif_rx_ni(rcv->skb);
                dev->last_rx = jiffies;
                dev->stats.rx_bytes += rcv->length.h;
                dev->stats.rx_packets++;
@@ -1269,7 +1269,7 @@ static void plip_attach (struct parport *port)
 
                nl = netdev_priv(dev);
                nl->dev = dev;
-               nl->pardev = parport_register_device(port, name, plip_preempt,
+               nl->pardev = parport_register_device(port, dev->name, plip_preempt,
                                                 plip_wakeup, plip_interrupt,
                                                 0, dev);
 
index 27f5b904f48ec403f2008a27a1e292f98a8d211f..f023d5b67e6efcc38d1673ef56b9de8536371392 100644 (file)
@@ -160,7 +160,7 @@ ppp_asynctty_open(struct tty_struct *tty)
 
        err = -ENOMEM;
        ap = kzalloc(sizeof(*ap), GFP_KERNEL);
-       if (ap == 0)
+       if (!ap)
                goto out;
 
        /* initialize the asyncppp structure */
@@ -215,7 +215,7 @@ ppp_asynctty_close(struct tty_struct *tty)
        ap = tty->disc_data;
        tty->disc_data = NULL;
        write_unlock_irq(&disc_data_lock);
-       if (ap == 0)
+       if (!ap)
                return;
 
        /*
@@ -230,10 +230,10 @@ ppp_asynctty_close(struct tty_struct *tty)
        tasklet_kill(&ap->tsk);
 
        ppp_unregister_channel(&ap->chan);
-       if (ap->rpkt != 0)
+       if (ap->rpkt)
                kfree_skb(ap->rpkt);
        skb_queue_purge(&ap->rqueue);
-       if (ap->tpkt != 0)
+       if (ap->tpkt)
                kfree_skb(ap->tpkt);
        kfree(ap);
 }
@@ -285,13 +285,13 @@ ppp_asynctty_ioctl(struct tty_struct *tty, struct file *file,
        int err, val;
        int __user *p = (int __user *)arg;
 
-       if (ap == 0)
+       if (!ap)
                return -ENXIO;
        err = -EFAULT;
        switch (cmd) {
        case PPPIOCGCHAN:
                err = -ENXIO;
-               if (ap == 0)
+               if (!ap)
                        break;
                err = -EFAULT;
                if (put_user(ppp_channel_index(&ap->chan), p))
@@ -301,7 +301,7 @@ ppp_asynctty_ioctl(struct tty_struct *tty, struct file *file,
 
        case PPPIOCGUNIT:
                err = -ENXIO;
-               if (ap == 0)
+               if (!ap)
                        break;
                err = -EFAULT;
                if (put_user(ppp_unit_number(&ap->chan), p))
@@ -309,16 +309,11 @@ ppp_asynctty_ioctl(struct tty_struct *tty, struct file *file,
                err = 0;
                break;
 
-       case TCGETS:
-       case TCGETA:
-               err = n_tty_ioctl(tty, file, cmd, arg);
-               break;
-
        case TCFLSH:
                /* flush our buffers and the serial port's buffer */
                if (arg == TCIOFLUSH || arg == TCOFLUSH)
                        ppp_async_flush_output(ap);
-               err = n_tty_ioctl(tty, file, cmd, arg);
+               err = tty_perform_flush(tty, arg);
                break;
 
        case FIONREAD:
@@ -329,7 +324,8 @@ ppp_asynctty_ioctl(struct tty_struct *tty, struct file *file,
                break;
 
        default:
-               err = -ENOIOCTLCMD;
+               /* Try the various mode ioctls */
+               err = tty_mode_ioctl(tty, file, cmd, arg);
        }
 
        ap_put(ap);
@@ -354,7 +350,7 @@ ppp_asynctty_receive(struct tty_struct *tty, const unsigned char *buf,
        struct asyncppp *ap = ap_get(tty);
        unsigned long flags;
 
-       if (ap == 0)
+       if (!ap)
                return;
        spin_lock_irqsave(&ap->recv_lock, flags);
        ppp_async_input(ap, buf, cflags, count);
@@ -373,7 +369,7 @@ ppp_asynctty_wakeup(struct tty_struct *tty)
        struct asyncppp *ap = ap_get(tty);
 
        clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
-       if (ap == 0)
+       if (!ap)
                return;
        set_bit(XMIT_WAKEUP, &ap->xmit_flags);
        tasklet_schedule(&ap->tsk);
@@ -688,7 +684,7 @@ ppp_async_push(struct asyncppp *ap)
                                tty_stuffed = 1;
                        continue;
                }
-               if (ap->optr >= ap->olim && ap->tpkt != 0) {
+               if (ap->optr >= ap->olim && ap->tpkt) {
                        if (ppp_async_encode(ap)) {
                                /* finished processing ap->tpkt */
                                clear_bit(XMIT_FULL, &ap->xmit_flags);
@@ -708,7 +704,7 @@ ppp_async_push(struct asyncppp *ap)
                clear_bit(XMIT_BUSY, &ap->xmit_flags);
                /* any more work to do? if not, exit the loop */
                if (!(test_bit(XMIT_WAKEUP, &ap->xmit_flags)
-                     || (!tty_stuffed && ap->tpkt != 0)))
+                     || (!tty_stuffed && ap->tpkt)))
                        break;
                /* more work to do, see if we can do it now */
                if (test_and_set_bit(XMIT_BUSY, &ap->xmit_flags))
@@ -719,7 +715,7 @@ ppp_async_push(struct asyncppp *ap)
 
 flush:
        clear_bit(XMIT_BUSY, &ap->xmit_flags);
-       if (ap->tpkt != 0) {
+       if (ap->tpkt) {
                kfree_skb(ap->tpkt);
                ap->tpkt = NULL;
                clear_bit(XMIT_FULL, &ap->xmit_flags);
@@ -852,7 +848,7 @@ ppp_async_input(struct asyncppp *ap, const unsigned char *buf,
                s = 0;
                for (i = 0; i < count; ++i) {
                        c = buf[i];
-                       if (flags != 0 && flags[i] != 0)
+                       if (flags && flags[i] != 0)
                                continue;
                        s |= (c & 0x80)? SC_RCV_B7_1: SC_RCV_B7_0;
                        c = ((c >> 4) ^ c) & 0xf;
@@ -869,7 +865,7 @@ ppp_async_input(struct asyncppp *ap, const unsigned char *buf,
                        n = scan_ordinary(ap, buf, count);
 
                f = 0;
-               if (flags != 0 && (ap->state & SC_TOSS) == 0) {
+               if (flags && (ap->state & SC_TOSS) == 0) {
                        /* check the flags to see if any char had an error */
                        for (j = 0; j < n; ++j)
                                if ((f = flags[j]) != 0)
@@ -882,9 +878,9 @@ ppp_async_input(struct asyncppp *ap, const unsigned char *buf,
                } else if (n > 0 && (ap->state & SC_TOSS) == 0) {
                        /* stuff the chars in the skb */
                        skb = ap->rpkt;
-                       if (skb == 0) {
+                       if (!skb) {
                                skb = dev_alloc_skb(ap->mru + PPP_HDRLEN + 2);
-                               if (skb == 0)
+                               if (!skb)
                                        goto nomem;
                                ap->rpkt = skb;
                        }
@@ -931,7 +927,7 @@ ppp_async_input(struct asyncppp *ap, const unsigned char *buf,
                ++n;
 
                buf += n;
-               if (flags != 0)
+               if (flags)
                        flags += n;
                count -= n;
        }
index 4b49d0e8c7ebcf911a7ebe55fb53529e32692782..4f690378bb77119f58eb3c18bbfb7ecf88fbf004 100644 (file)
@@ -367,7 +367,7 @@ static int ppp_release(struct inode *inode, struct file *file)
        struct ppp_file *pf = file->private_data;
        struct ppp *ppp;
 
-       if (pf != 0) {
+       if (pf) {
                file->private_data = NULL;
                if (pf->kind == INTERFACE) {
                        ppp = PF_TO_PPP(pf);
@@ -398,7 +398,7 @@ static ssize_t ppp_read(struct file *file, char __user *buf,
 
        ret = count;
 
-       if (pf == 0)
+       if (!pf)
                return -ENXIO;
        add_wait_queue(&pf->rwait, &wait);
        for (;;) {
@@ -431,7 +431,7 @@ static ssize_t ppp_read(struct file *file, char __user *buf,
        set_current_state(TASK_RUNNING);
        remove_wait_queue(&pf->rwait, &wait);
 
-       if (skb == 0)
+       if (!skb)
                goto out;
 
        ret = -EOVERFLOW;
@@ -455,11 +455,11 @@ static ssize_t ppp_write(struct file *file, const char __user *buf,
        struct sk_buff *skb;
        ssize_t ret;
 
-       if (pf == 0)
+       if (!pf)
                return -ENXIO;
        ret = -ENOMEM;
        skb = alloc_skb(count + pf->hdrlen, GFP_KERNEL);
-       if (skb == 0)
+       if (!skb)
                goto out;
        skb_reserve(skb, pf->hdrlen);
        ret = -EFAULT;
@@ -491,11 +491,11 @@ static unsigned int ppp_poll(struct file *file, poll_table *wait)
        struct ppp_file *pf = file->private_data;
        unsigned int mask;
 
-       if (pf == 0)
+       if (!pf)
                return 0;
        poll_wait(file, &pf->rwait, wait);
        mask = POLLOUT | POLLWRNORM;
-       if (skb_peek(&pf->rq) != 0)
+       if (skb_peek(&pf->rq))
                mask |= POLLIN | POLLRDNORM;
        if (pf->dead)
                mask |= POLLHUP;
@@ -559,7 +559,7 @@ static int ppp_ioctl(struct inode *inode, struct file *file,
        void __user *argp = (void __user *)arg;
        int __user *p = argp;
 
-       if (pf == 0)
+       if (!pf)
                return ppp_unattached_ioctl(pf, file, cmd, arg);
 
        if (cmd == PPPIOCDETACH) {
@@ -689,13 +689,13 @@ static int ppp_ioctl(struct inode *inode, struct file *file,
                        val &= 0xffff;
                }
                vj = slhc_init(val2+1, val+1);
-               if (vj == 0) {
+               if (!vj) {
                        printk(KERN_ERR "PPP: no memory (VJ compressor)\n");
                        err = -ENOMEM;
                        break;
                }
                ppp_lock(ppp);
-               if (ppp->vj != 0)
+               if (ppp->vj)
                        slhc_free(ppp->vj);
                ppp->vj = vj;
                ppp_unlock(ppp);
@@ -786,7 +786,7 @@ static int ppp_unattached_ioctl(struct ppp_file *pf, struct file *file,
                if (get_user(unit, p))
                        break;
                ppp = ppp_create_interface(unit, &err);
-               if (ppp == 0)
+               if (!ppp)
                        break;
                file->private_data = &ppp->file;
                ppp->owner = file;
@@ -803,7 +803,7 @@ static int ppp_unattached_ioctl(struct ppp_file *pf, struct file *file,
                mutex_lock(&all_ppp_mutex);
                err = -ENXIO;
                ppp = ppp_find_unit(unit);
-               if (ppp != 0) {
+               if (ppp) {
                        atomic_inc(&ppp->file.refcnt);
                        file->private_data = &ppp->file;
                        err = 0;
@@ -817,7 +817,7 @@ static int ppp_unattached_ioctl(struct ppp_file *pf, struct file *file,
                spin_lock_bh(&all_channels_lock);
                err = -ENXIO;
                chan = ppp_find_channel(unit);
-               if (chan != 0) {
+               if (chan) {
                        atomic_inc(&chan->file.refcnt);
                        file->private_data = &chan->file;
                        err = 0;
@@ -946,9 +946,9 @@ ppp_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 
        case SIOCGPPPCSTATS:
                memset(&cstats, 0, sizeof(cstats));
-               if (ppp->xc_state != 0)
+               if (ppp->xc_state)
                        ppp->xcomp->comp_stat(ppp->xc_state, &cstats.c);
-               if (ppp->rc_state != 0)
+               if (ppp->rc_state)
                        ppp->rcomp->decomp_stat(ppp->rc_state, &cstats.d);
                if (copy_to_user(addr, &cstats, sizeof(cstats)))
                        break;
@@ -993,14 +993,14 @@ ppp_xmit_process(struct ppp *ppp)
        struct sk_buff *skb;
 
        ppp_xmit_lock(ppp);
-       if (ppp->dev != 0) {
+       if (ppp->dev) {
                ppp_push(ppp);
-               while (ppp->xmit_pending == 0
-                      && (skb = skb_dequeue(&ppp->file.xq)) != 0)
+               while (!ppp->xmit_pending
+                      && (skb = skb_dequeue(&ppp->file.xq)))
                        ppp_send_frame(ppp, skb);
                /* If there's no work left to do, tell the core net
                   code that we can accept some more. */
-               if (ppp->xmit_pending == 0 && skb_peek(&ppp->file.xq) == 0)
+               if (!ppp->xmit_pending && !skb_peek(&ppp->file.xq))
                        netif_wake_queue(ppp->dev);
        }
        ppp_xmit_unlock(ppp);
@@ -1100,12 +1100,12 @@ ppp_send_frame(struct ppp *ppp, struct sk_buff *skb)
 
        switch (proto) {
        case PPP_IP:
-               if (ppp->vj == 0 || (ppp->flags & SC_COMP_TCP) == 0)
+               if (!ppp->vj || (ppp->flags & SC_COMP_TCP) == 0)
                        break;
                /* try to do VJ TCP header compression */
                new_skb = alloc_skb(skb->len + ppp->dev->hard_header_len - 2,
                                    GFP_ATOMIC);
-               if (new_skb == 0) {
+               if (!new_skb) {
                        printk(KERN_ERR "PPP: no memory (VJ comp pkt)\n");
                        goto drop;
                }
@@ -1140,7 +1140,7 @@ ppp_send_frame(struct ppp *ppp, struct sk_buff *skb)
        }
 
        /* try to do packet compression */
-       if ((ppp->xstate & SC_COMP_RUN) && ppp->xc_state != 0
+       if ((ppp->xstate & SC_COMP_RUN) && ppp->xc_state
            && proto != PPP_LCP && proto != PPP_CCP) {
                if (!(ppp->flags & SC_CCP_UP) && (ppp->flags & SC_MUST_COMP)) {
                        if (net_ratelimit())
@@ -1185,7 +1185,7 @@ ppp_push(struct ppp *ppp)
        struct channel *pch;
        struct sk_buff *skb = ppp->xmit_pending;
 
-       if (skb == 0)
+       if (!skb)
                return;
 
        list = &ppp->channels;
@@ -1355,7 +1355,7 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb)
                if (flen == len && nfree == 0)
                        bits |= E;
                frag = alloc_skb(flen + hdrlen + (flen == 0), GFP_ATOMIC);
-               if (frag == 0)
+               if (!frag)
                        goto noskb;
                q = skb_put(frag, flen + hdrlen);
 
@@ -1425,7 +1425,7 @@ ppp_channel_push(struct channel *pch)
        struct ppp *ppp;
 
        spin_lock_bh(&pch->downl);
-       if (pch->chan != 0) {
+       if (pch->chan) {
                while (!skb_queue_empty(&pch->file.xq)) {
                        skb = skb_dequeue(&pch->file.xq);
                        if (!pch->chan->ops->start_xmit(pch->chan, skb)) {
@@ -1443,7 +1443,7 @@ ppp_channel_push(struct channel *pch)
        if (skb_queue_empty(&pch->file.xq)) {
                read_lock_bh(&pch->upl);
                ppp = pch->ppp;
-               if (ppp != 0)
+               if (ppp)
                        ppp_xmit_process(ppp);
                read_unlock_bh(&pch->upl);
        }
@@ -1462,7 +1462,7 @@ ppp_do_recv(struct ppp *ppp, struct sk_buff *skb, struct channel *pch)
 {
        ppp_recv_lock(ppp);
        /* ppp->dev == 0 means interface is closing down */
-       if (ppp->dev != 0)
+       if (ppp->dev)
                ppp_receive_frame(ppp, skb, pch);
        else
                kfree_skb(skb);
@@ -1475,19 +1475,19 @@ ppp_input(struct ppp_channel *chan, struct sk_buff *skb)
        struct channel *pch = chan->ppp;
        int proto;
 
-       if (pch == 0 || skb->len == 0) {
+       if (!pch || skb->len == 0) {
                kfree_skb(skb);
                return;
        }
 
        proto = PPP_PROTO(skb);
        read_lock_bh(&pch->upl);
-       if (pch->ppp == 0 || proto >= 0xc000 || proto == PPP_CCPFRAG) {
+       if (!pch->ppp || proto >= 0xc000 || proto == PPP_CCPFRAG) {
                /* put it on the channel queue */
                skb_queue_tail(&pch->file.rq, skb);
                /* drop old frames if queue too long */
                while (pch->file.rq.qlen > PPP_MAX_RQLEN
-                      && (skb = skb_dequeue(&pch->file.rq)) != 0)
+                      && (skb = skb_dequeue(&pch->file.rq)))
                        kfree_skb(skb);
                wake_up_interruptible(&pch->file.rwait);
        } else {
@@ -1503,13 +1503,13 @@ ppp_input_error(struct ppp_channel *chan, int code)
        struct channel *pch = chan->ppp;
        struct sk_buff *skb;
 
-       if (pch == 0)
+       if (!pch)
                return;
 
        read_lock_bh(&pch->upl);
-       if (pch->ppp != 0) {
+       if (pch->ppp) {
                skb = alloc_skb(0, GFP_ATOMIC);
-               if (skb != 0) {
+               if (skb) {
                        skb->len = 0;           /* probably unnecessary */
                        skb->cb[0] = code;
                        ppp_do_recv(pch->ppp, skb, pch);
@@ -1548,7 +1548,7 @@ static void
 ppp_receive_error(struct ppp *ppp)
 {
        ++ppp->stats.rx_errors;
-       if (ppp->vj != 0)
+       if (ppp->vj)
                slhc_toss(ppp->vj);
 }
 
@@ -1563,7 +1563,7 @@ ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff *skb)
         * Note that some decompressors need to see uncompressed frames
         * that come in as well as compressed frames.
         */
-       if (ppp->rc_state != 0 && (ppp->rstate & SC_DECOMP_RUN)
+       if (ppp->rc_state && (ppp->rstate & SC_DECOMP_RUN)
            && (ppp->rstate & (SC_DC_FERROR | SC_DC_ERROR)) == 0)
                skb = ppp_decompress_frame(ppp, skb);
 
@@ -1574,13 +1574,13 @@ ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff *skb)
        switch (proto) {
        case PPP_VJC_COMP:
                /* decompress VJ compressed packets */
-               if (ppp->vj == 0 || (ppp->flags & SC_REJ_COMP_TCP))
+               if (!ppp->vj || (ppp->flags & SC_REJ_COMP_TCP))
                        goto err;
 
                if (skb_tailroom(skb) < 124 || skb_cloned(skb)) {
                        /* copy to a new sk_buff with more tailroom */
                        ns = dev_alloc_skb(skb->len + 128);
-                       if (ns == 0) {
+                       if (!ns) {
                                printk(KERN_ERR"PPP: no memory (VJ decomp)\n");
                                goto err;
                        }
@@ -1606,7 +1606,7 @@ ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff *skb)
                break;
 
        case PPP_VJC_UNCOMP:
-               if (ppp->vj == 0 || (ppp->flags & SC_REJ_COMP_TCP))
+               if (!ppp->vj || (ppp->flags & SC_REJ_COMP_TCP))
                        goto err;
 
                /* Until we fix the decompressor need to make sure
@@ -1636,7 +1636,7 @@ ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff *skb)
                skb_queue_tail(&ppp->file.rq, skb);
                /* limit queue length by dropping old frames */
                while (ppp->file.rq.qlen > PPP_MAX_RQLEN
-                      && (skb = skb_dequeue(&ppp->file.rq)) != 0)
+                      && (skb = skb_dequeue(&ppp->file.rq)))
                        kfree_skb(skb);
                /* wake up any process polling or blocking on read */
                wake_up_interruptible(&ppp->file.rwait);
@@ -1718,7 +1718,7 @@ ppp_decompress_frame(struct ppp *ppp, struct sk_buff *skb)
                }
 
                ns = dev_alloc_skb(obuff_size);
-               if (ns == 0) {
+               if (!ns) {
                        printk(KERN_ERR "ppp_decompress_frame: no memory\n");
                        goto err;
                }
@@ -1836,7 +1836,7 @@ ppp_receive_mp_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch)
                ppp->minseq = ppp->mrq.next->sequence;
 
        /* Pull completed packets off the queue and receive them. */
-       while ((skb = ppp_mp_reconstruct(ppp)) != 0)
+       while ((skb = ppp_mp_reconstruct(ppp)))
                ppp_receive_nonmp_frame(ppp, skb);
 
        return;
@@ -2002,7 +2002,7 @@ ppp_register_channel(struct ppp_channel *chan)
        struct channel *pch;
 
        pch = kzalloc(sizeof(struct channel), GFP_KERNEL);
-       if (pch == 0)
+       if (!pch)
                return -ENOMEM;
        pch->ppp = NULL;
        pch->chan = chan;
@@ -2030,7 +2030,7 @@ int ppp_channel_index(struct ppp_channel *chan)
 {
        struct channel *pch = chan->ppp;
 
-       if (pch != 0)
+       if (pch)
                return pch->file.index;
        return -1;
 }
@@ -2043,9 +2043,9 @@ int ppp_unit_number(struct ppp_channel *chan)
        struct channel *pch = chan->ppp;
        int unit = -1;
 
-       if (pch != 0) {
+       if (pch) {
                read_lock_bh(&pch->upl);
-               if (pch->ppp != 0)
+               if (pch->ppp)
                        unit = pch->ppp->file.index;
                read_unlock_bh(&pch->upl);
        }
@@ -2061,7 +2061,7 @@ ppp_unregister_channel(struct ppp_channel *chan)
 {
        struct channel *pch = chan->ppp;
 
-       if (pch == 0)
+       if (!pch)
                return;         /* should never happen */
        chan->ppp = NULL;
 
@@ -2093,7 +2093,7 @@ ppp_output_wakeup(struct ppp_channel *chan)
 {
        struct channel *pch = chan->ppp;
 
-       if (pch == 0)
+       if (!pch)
                return;
        ppp_channel_push(pch);
 }
@@ -2124,18 +2124,18 @@ ppp_set_compress(struct ppp *ppp, unsigned long arg)
 
        cp = find_compressor(ccp_option[0]);
 #ifdef CONFIG_KMOD
-       if (cp == 0) {
+       if (!cp) {
                request_module("ppp-compress-%d", ccp_option[0]);
                cp = find_compressor(ccp_option[0]);
        }
 #endif /* CONFIG_KMOD */
-       if (cp == 0)
+       if (!cp)
                goto out;
 
        err = -ENOBUFS;
        if (data.transmit) {
                state = cp->comp_alloc(ccp_option, data.length);
-               if (state != 0) {
+               if (state) {
                        ppp_xmit_lock(ppp);
                        ppp->xstate &= ~SC_COMP_RUN;
                        ocomp = ppp->xcomp;
@@ -2143,7 +2143,7 @@ ppp_set_compress(struct ppp *ppp, unsigned long arg)
                        ppp->xcomp = cp;
                        ppp->xc_state = state;
                        ppp_xmit_unlock(ppp);
-                       if (ostate != 0) {
+                       if (ostate) {
                                ocomp->comp_free(ostate);
                                module_put(ocomp->owner);
                        }
@@ -2153,7 +2153,7 @@ ppp_set_compress(struct ppp *ppp, unsigned long arg)
 
        } else {
                state = cp->decomp_alloc(ccp_option, data.length);
-               if (state != 0) {
+               if (state) {
                        ppp_recv_lock(ppp);
                        ppp->rstate &= ~SC_DECOMP_RUN;
                        ocomp = ppp->rcomp;
@@ -2161,7 +2161,7 @@ ppp_set_compress(struct ppp *ppp, unsigned long arg)
                        ppp->rcomp = cp;
                        ppp->rc_state = state;
                        ppp_recv_unlock(ppp);
-                       if (ostate != 0) {
+                       if (ostate) {
                                ocomp->decomp_free(ostate);
                                module_put(ocomp->owner);
                        }
@@ -2228,7 +2228,7 @@ ppp_ccp_peek(struct ppp *ppp, struct sk_buff *skb, int inbound)
                        break;
                if (inbound) {
                        /* we will start receiving compressed packets */
-                       if (ppp->rc_state == 0)
+                       if (!ppp->rc_state)
                                break;
                        if (ppp->rcomp->decomp_init(ppp->rc_state, dp, len,
                                        ppp->file.index, 0, ppp->mru, ppp->debug)) {
@@ -2237,7 +2237,7 @@ ppp_ccp_peek(struct ppp *ppp, struct sk_buff *skb, int inbound)
                        }
                } else {
                        /* we will soon start sending compressed packets */
-                       if (ppp->xc_state == 0)
+                       if (!ppp->xc_state)
                                break;
                        if (ppp->xcomp->comp_init(ppp->xc_state, dp, len,
                                        ppp->file.index, 0, ppp->debug))
@@ -2320,11 +2320,11 @@ ppp_register_compressor(struct compressor *cp)
        int ret;
        spin_lock(&compressor_list_lock);
        ret = -EEXIST;
-       if (find_comp_entry(cp->compress_proto) != 0)
+       if (find_comp_entry(cp->compress_proto))
                goto out;
        ret = -ENOMEM;
        ce = kmalloc(sizeof(struct compressor_entry), GFP_ATOMIC);
-       if (ce == 0)
+       if (!ce)
                goto out;
        ret = 0;
        ce->comp = cp;
@@ -2342,7 +2342,7 @@ ppp_unregister_compressor(struct compressor *cp)
 
        spin_lock(&compressor_list_lock);
        ce = find_comp_entry(cp->compress_proto);
-       if (ce != 0 && ce->comp == cp) {
+       if (ce && ce->comp == cp) {
                list_del(&ce->list);
                kfree(ce);
        }
@@ -2358,7 +2358,7 @@ find_compressor(int type)
 
        spin_lock(&compressor_list_lock);
        ce = find_comp_entry(type);
-       if (ce != 0) {
+       if (ce) {
                cp = ce->comp;
                if (!try_module_get(cp->owner))
                        cp = NULL;
@@ -2383,7 +2383,7 @@ ppp_get_stats(struct ppp *ppp, struct ppp_stats *st)
        st->p.ppp_opackets = ppp->stats.tx_packets;
        st->p.ppp_oerrors = ppp->stats.tx_errors;
        st->p.ppp_obytes = ppp->stats.tx_bytes;
-       if (vj == 0)
+       if (!vj)
                return;
        st->vj.vjs_packets = vj->sls_o_compressed + vj->sls_o_uncompressed;
        st->vj.vjs_compressed = vj->sls_o_compressed;
@@ -2604,11 +2604,11 @@ ppp_connect_channel(struct channel *pch, int unit)
 
        mutex_lock(&all_ppp_mutex);
        ppp = ppp_find_unit(unit);
-       if (ppp == 0)
+       if (!ppp)
                goto out;
        write_lock_bh(&pch->upl);
        ret = -EINVAL;
-       if (pch->ppp != 0)
+       if (pch->ppp)
                goto outl;
 
        ppp_lock(ppp);
@@ -2644,7 +2644,7 @@ ppp_disconnect_channel(struct channel *pch)
        ppp = pch->ppp;
        pch->ppp = NULL;
        write_unlock_bh(&pch->upl);
-       if (ppp != 0) {
+       if (ppp) {
                /* remove it from the ppp unit's list */
                ppp_lock(ppp);
                list_del(&pch->clist);
index ce64032a465af512dae7b961ce80f1cc2203a4de..f0c6a1926a02970c9a5573f97276c217d87157bb 100644 (file)
@@ -209,7 +209,7 @@ ppp_sync_open(struct tty_struct *tty)
 
        ap = kzalloc(sizeof(*ap), GFP_KERNEL);
        err = -ENOMEM;
-       if (ap == 0)
+       if (!ap)
                goto out;
 
        /* initialize the syncppp structure */
@@ -262,7 +262,7 @@ ppp_sync_close(struct tty_struct *tty)
        ap = tty->disc_data;
        tty->disc_data = NULL;
        write_unlock_irq(&disc_data_lock);
-       if (ap == 0)
+       if (!ap)
                return;
 
        /*
@@ -278,7 +278,7 @@ ppp_sync_close(struct tty_struct *tty)
 
        ppp_unregister_channel(&ap->chan);
        skb_queue_purge(&ap->rqueue);
-       if (ap->tpkt != 0)
+       if (ap->tpkt)
                kfree_skb(ap->tpkt);
        kfree(ap);
 }
@@ -325,13 +325,13 @@ ppp_synctty_ioctl(struct tty_struct *tty, struct file *file,
        int __user *p = (int __user *)arg;
        int err, val;
 
-       if (ap == 0)
+       if (!ap)
                return -ENXIO;
        err = -EFAULT;
        switch (cmd) {
        case PPPIOCGCHAN:
                err = -ENXIO;
-               if (ap == 0)
+               if (!ap)
                        break;
                err = -EFAULT;
                if (put_user(ppp_channel_index(&ap->chan), p))
@@ -341,7 +341,7 @@ ppp_synctty_ioctl(struct tty_struct *tty, struct file *file,
 
        case PPPIOCGUNIT:
                err = -ENXIO;
-               if (ap == 0)
+               if (!ap)
                        break;
                err = -EFAULT;
                if (put_user(ppp_unit_number(&ap->chan), p))
@@ -349,16 +349,11 @@ ppp_synctty_ioctl(struct tty_struct *tty, struct file *file,
                err = 0;
                break;
 
-       case TCGETS:
-       case TCGETA:
-               err = n_tty_ioctl(tty, file, cmd, arg);
-               break;
-
        case TCFLSH:
                /* flush our buffers and the serial port's buffer */
                if (arg == TCIOFLUSH || arg == TCOFLUSH)
                        ppp_sync_flush_output(ap);
-               err = n_tty_ioctl(tty, file, cmd, arg);
+               err = tty_perform_flush(tty, arg);
                break;
 
        case FIONREAD:
@@ -369,7 +364,8 @@ ppp_synctty_ioctl(struct tty_struct *tty, struct file *file,
                break;
 
        default:
-               err = -ENOIOCTLCMD;
+               err = tty_mode_ioctl(tty, file, cmd, arg);
+               break;
        }
 
        sp_put(ap);
@@ -394,7 +390,7 @@ ppp_sync_receive(struct tty_struct *tty, const unsigned char *buf,
        struct syncppp *ap = sp_get(tty);
        unsigned long flags;
 
-       if (ap == 0)
+       if (!ap)
                return;
        spin_lock_irqsave(&ap->recv_lock, flags);
        ppp_sync_input(ap, buf, cflags, count);
@@ -413,7 +409,7 @@ ppp_sync_wakeup(struct tty_struct *tty)
        struct syncppp *ap = sp_get(tty);
 
        clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
-       if (ap == 0)
+       if (!ap)
                return;
        set_bit(XMIT_WAKEUP, &ap->xmit_flags);
        tasklet_schedule(&ap->tsk);
@@ -655,7 +651,7 @@ ppp_sync_push(struct syncppp *ap)
        for (;;) {
                if (test_and_clear_bit(XMIT_WAKEUP, &ap->xmit_flags))
                        tty_stuffed = 0;
-               if (!tty_stuffed && ap->tpkt != 0) {
+               if (!tty_stuffed && ap->tpkt) {
                        set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
                        sent = tty->driver->write(tty, ap->tpkt->data, ap->tpkt->len);
                        if (sent < 0)
@@ -673,7 +669,7 @@ ppp_sync_push(struct syncppp *ap)
                /* haven't made any progress */
                spin_unlock_bh(&ap->xmit_lock);
                if (!(test_bit(XMIT_WAKEUP, &ap->xmit_flags)
-                     || (!tty_stuffed && ap->tpkt != 0)))
+                     || (!tty_stuffed && ap->tpkt)))
                        break;
                if (!spin_trylock_bh(&ap->xmit_lock))
                        break;
@@ -681,7 +677,7 @@ ppp_sync_push(struct syncppp *ap)
        return done;
 
 flush:
-       if (ap->tpkt != 0) {
+       if (ap->tpkt) {
                kfree_skb(ap->tpkt);
                ap->tpkt = NULL;
                clear_bit(XMIT_FULL, &ap->xmit_flags);
@@ -736,7 +732,8 @@ ppp_sync_input(struct syncppp *ap, const unsigned char *buf,
                ppp_print_buffer ("receive buffer", buf, count);
 
        /* stuff the chars in the skb */
-       if ((skb = dev_alloc_skb(ap->mru + PPP_HDRLEN + 2)) == 0) {
+       skb = dev_alloc_skb(ap->mru + PPP_HDRLEN + 2);
+       if (!skb) {
                printk(KERN_ERR "PPPsync: no memory (input pkt)\n");
                goto err;
        }
@@ -744,7 +741,7 @@ ppp_sync_input(struct syncppp *ap, const unsigned char *buf,
        if (buf[0] != PPP_ALLSTATIONS)
                skb_reserve(skb, 2 + (buf[0] & 1));
 
-       if (flags != 0 && *flags) {
+       if (flags && *flags) {
                /* error flag set, ignore frame */
                goto err;
        } else if (count > skb_tailroom(skb)) {
index 8936ed3469cf0744a68ace9e205ea6a804ce3b85..a005d8f4c38e545e80237abbcb83cdba34e161e3 100644 (file)
@@ -491,7 +491,7 @@ static int pppoe_create(struct net *net, struct socket *sock)
        int error = -ENOMEM;
        struct sock *sk;
 
-       sk = sk_alloc(net, PF_PPPOX, GFP_KERNEL, &pppoe_sk_proto, 1);
+       sk = sk_alloc(net, PF_PPPOX, GFP_KERNEL, &pppoe_sk_proto);
        if (!sk)
                goto out;
 
index 921d4ef6d14b66d1b66c0c4b606a571cbec82020..a7556cd2df7939cbfd37fb3c1e57e8c9e82632dc 100644 (file)
@@ -488,7 +488,7 @@ static int pppol2tp_recv_core(struct sock *sock, struct sk_buff *skb)
 {
        struct pppol2tp_session *session = NULL;
        struct pppol2tp_tunnel *tunnel;
-       unsigned char *ptr;
+       unsigned char *ptr, *optr;
        u16 hdrflags;
        u16 tunnel_id, session_id;
        int length;
@@ -496,7 +496,7 @@ static int pppol2tp_recv_core(struct sock *sock, struct sk_buff *skb)
 
        tunnel = pppol2tp_sock_to_tunnel(sock);
        if (tunnel == NULL)
-               goto error;
+               goto no_tunnel;
 
        /* UDP always verifies the packet length. */
        __skb_pull(skb, sizeof(struct udphdr));
@@ -509,7 +509,7 @@ static int pppol2tp_recv_core(struct sock *sock, struct sk_buff *skb)
        }
 
        /* Point to L2TP header */
-       ptr = skb->data;
+       optr = ptr = skb->data;
 
        /* Get L2TP header flags */
        hdrflags = ntohs(*(__be16*)ptr);
@@ -637,12 +637,14 @@ static int pppol2tp_recv_core(struct sock *sock, struct sk_buff *skb)
        /* If offset bit set, skip it. */
        if (hdrflags & L2TP_HDRFLAG_O) {
                offset = ntohs(*(__be16 *)ptr);
-               skb->transport_header += 2 + offset;
-               if (!pskb_may_pull(skb, skb_transport_offset(skb) + 2))
-                       goto discard;
+               ptr += 2 + offset;
        }
 
-       __skb_pull(skb, skb_transport_offset(skb));
+       offset = ptr - optr;
+       if (!pskb_may_pull(skb, offset))
+               goto discard;
+
+       __skb_pull(skb, offset);
 
        /* Skip PPP header, if present.  In testing, Microsoft L2TP clients
         * don't send the PPP header (PPP header compression enabled), but
@@ -652,6 +654,9 @@ static int pppol2tp_recv_core(struct sock *sock, struct sk_buff *skb)
         * Note that skb->data[] isn't dereferenced from a u16 ptr here since
         * the field may be unaligned.
         */
+       if (!pskb_may_pull(skb, 2))
+               goto discard;
+
        if ((skb->data[0] == 0xff) && (skb->data[1] == 0x03))
                skb_pull(skb, 2);
 
@@ -709,6 +714,10 @@ discard:
        return 0;
 
 error:
+       /* Put UDP header back */
+       __skb_push(skb, sizeof(struct udphdr));
+
+no_tunnel:
        return 1;
 }
 
@@ -1050,6 +1059,8 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
        /* Get routing info from the tunnel socket */
        dst_release(skb->dst);
        skb->dst = sk_dst_get(sk_tun);
+       skb_orphan(skb);
+       skb->sk = sk_tun;
 
        /* Queue the packet to IP for output */
        len = skb->len;
@@ -1416,7 +1427,7 @@ static int pppol2tp_create(struct net *net, struct socket *sock)
        int error = -ENOMEM;
        struct sock *sk;
 
-       sk = sk_alloc(net, PF_PPPOX, GFP_KERNEL, &pppol2tp_sk_proto, 1);
+       sk = sk_alloc(net, PF_PPPOX, GFP_KERNEL, &pppol2tp_sk_proto);
        if (!sk)
                goto out;
 
index 30adf726743cba4993b2936e4f4d9ae2f092f182..a5791114b7bde59eddd6aed9c0dc79c590a8d688 100644 (file)
@@ -1456,16 +1456,11 @@ static void ql_phy_start_neg_ex(struct ql3_adapter *qdev)
                           PHYAddr[qdev->mac_index]);
        reg &= ~PHY_GIG_ALL_PARAMS;
 
-       if(portConfiguration &
-          PORT_CONFIG_FULL_DUPLEX_ENABLED &
-          PORT_CONFIG_1000MB_SPEED) {
-               reg |= PHY_GIG_ADV_1000F;
-       }
-
-       if(portConfiguration &
-          PORT_CONFIG_HALF_DUPLEX_ENABLED &
-          PORT_CONFIG_1000MB_SPEED) {
-               reg |= PHY_GIG_ADV_1000H;
+       if(portConfiguration & PORT_CONFIG_1000MB_SPEED) {
+               if(portConfiguration & PORT_CONFIG_FULL_DUPLEX_ENABLED) 
+                       reg |= PHY_GIG_ADV_1000F;
+               else 
+                       reg |= PHY_GIG_ADV_1000H;
        }
 
        ql_mii_write_reg_ex(qdev, PHY_GIG_CONTROL, reg,
@@ -1645,8 +1640,11 @@ static int ql_finish_auto_neg(struct ql3_adapter *qdev)
        return 0;
 }
 
-static void ql_link_state_machine(struct ql3_adapter *qdev)
+static void ql_link_state_machine_work(struct work_struct *work)
 {
+       struct ql3_adapter *qdev =
+               container_of(work, struct ql3_adapter, link_state_work.work);
+
        u32 curr_link_state;
        unsigned long hw_flags;
 
@@ -1661,6 +1659,10 @@ static void ql_link_state_machine(struct ql3_adapter *qdev)
                               "state.\n", qdev->ndev->name);
 
                spin_unlock_irqrestore(&qdev->hw_lock, hw_flags);
+
+               /* Restart timer on 2 second interval. */
+               mod_timer(&qdev->adapter_timer, jiffies + HZ * 1);\
+
                return;
        }
 
@@ -1705,6 +1707,9 @@ static void ql_link_state_machine(struct ql3_adapter *qdev)
                break;
        }
        spin_unlock_irqrestore(&qdev->hw_lock, hw_flags);
+
+       /* Restart timer on 2 second interval. */
+       mod_timer(&qdev->adapter_timer, jiffies + HZ * 1);
 }
 
 /*
@@ -3941,19 +3946,7 @@ static void ql_get_board_info(struct ql3_adapter *qdev)
 static void ql3xxx_timer(unsigned long ptr)
 {
        struct ql3_adapter *qdev = (struct ql3_adapter *)ptr;
-
-       if (test_bit(QL_RESET_ACTIVE,&qdev->flags)) {
-               printk(KERN_DEBUG PFX
-                      "%s: Reset in progress.\n",
-                      qdev->ndev->name);
-               goto end;
-       }
-
-       ql_link_state_machine(qdev);
-
-       /* Restart timer on 2 second interval. */
-end:
-       mod_timer(&qdev->adapter_timer, jiffies + HZ * 1);
+       queue_delayed_work(qdev->workqueue, &qdev->link_state_work, 0);
 }
 
 static int __devinit ql3xxx_probe(struct pci_dev *pdev,
@@ -4103,6 +4096,7 @@ static int __devinit ql3xxx_probe(struct pci_dev *pdev,
        qdev->workqueue = create_singlethread_workqueue(ndev->name);
        INIT_DELAYED_WORK(&qdev->reset_work, ql_reset_work);
        INIT_DELAYED_WORK(&qdev->tx_timeout_work, ql_tx_timeout_work);
+       INIT_DELAYED_WORK(&qdev->link_state_work, ql_link_state_machine_work);
 
        init_timer(&qdev->adapter_timer);
        qdev->adapter_timer.function = ql3xxx_timer;
index fbcb0b9496390247b20e3f626e611b5a9b086c3b..d0ffb30ef371a10d91732a446dc5a7ac4a4a1e40 100644 (file)
@@ -1286,6 +1286,7 @@ struct ql3_adapter {
        struct workqueue_struct *workqueue;
        struct delayed_work reset_work;
        struct delayed_work tx_timeout_work;
+       struct delayed_work link_state_work;
        u32 max_frame_size;
        u32 device_id;
        u16 phyType;
index e8960f294a6e04d8cfe5ed0b2cc5469bf4ebd918..1f647b9ce352128ae65fbc3d15d15062615adeea 100644 (file)
@@ -171,6 +171,8 @@ static struct pci_device_id rtl8169_pci_tbl[] = {
        { PCI_DEVICE(0x16ec,                    0x0116), 0, 0, RTL_CFG_0 },
        { PCI_VENDOR_ID_LINKSYS,                0x1032,
                PCI_ANY_ID, 0x0024, 0, 0, RTL_CFG_0 },
+       { 0x0001,                               0x8168,
+               PCI_ANY_ID, 0x2410, 0, 0, RTL_CFG_2 },
        {0,},
 };
 
@@ -392,7 +394,9 @@ struct rtl8169_private {
        void __iomem *mmio_addr;        /* memory map physical address */
        struct pci_dev *pci_dev;        /* Index of PCI device */
        struct net_device *dev;
+#ifdef CONFIG_R8169_NAPI
        struct napi_struct napi;
+#endif
        spinlock_t lock;                /* spin lock flag */
        u32 msg_enable;
        int chipset;
@@ -466,7 +470,7 @@ static void mdio_write(void __iomem *ioaddr, int reg_addr, int value)
 {
        int i;
 
-       RTL_W32(PHYAR, 0x80000000 | (reg_addr & 0xFF) << 16 | value);
+       RTL_W32(PHYAR, 0x80000000 | (reg_addr & 0x1f) << 16 | (value & 0xffff));
 
        for (i = 20; i > 0; i--) {
                /*
@@ -483,7 +487,7 @@ static int mdio_read(void __iomem *ioaddr, int reg_addr)
 {
        int i, value = -1;
 
-       RTL_W32(PHYAR, 0x0 | (reg_addr & 0xFF) << 16);
+       RTL_W32(PHYAR, 0x0 | (reg_addr & 0x1f) << 16);
 
        for (i = 20; i > 0; i--) {
                /*
@@ -491,7 +495,7 @@ static int mdio_read(void __iomem *ioaddr, int reg_addr)
                 * the specified MII register.
                 */
                if (RTL_R32(PHYAR) & 0x80000000) {
-                       value = (int) (RTL_R32(PHYAR) & 0xFFFF);
+                       value = RTL_R32(PHYAR) & 0xffff;
                        break;
                }
                udelay(25);
@@ -1243,16 +1247,6 @@ static void rtl8169sb_hw_phy_config(void __iomem *ioaddr)
 
        rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
 }
-static void rtl8168b_hw_phy_config(void __iomem *ioaddr)
-{
-       struct phy_reg phy_reg_init[] = {
-               { 0x1f, 0x0000 },
-               { 0x10, 0xf41b },
-               { 0x1f, 0x0000 }
-       };
-
-       rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
-}
 
 static void rtl8168cp_hw_phy_config(void __iomem *ioaddr)
 {
@@ -1322,11 +1316,6 @@ static void rtl_hw_phy_config(struct net_device *dev)
        case RTL_GIGA_MAC_VER_04:
                rtl8169sb_hw_phy_config(ioaddr);
                break;
-       case RTL_GIGA_MAC_VER_11:
-       case RTL_GIGA_MAC_VER_12:
-       case RTL_GIGA_MAC_VER_17:
-               rtl8168b_hw_phy_config(ioaddr);
-               break;
        case RTL_GIGA_MAC_VER_18:
                rtl8168cp_hw_phy_config(ioaddr);
                break;
@@ -1737,7 +1726,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        tp->features |= rtl_try_msi(pdev, ioaddr, cfg);
        RTL_W8(Cfg9346, Cfg9346_Lock);
 
-       if (RTL_R8(PHYstatus) & TBI_Enable) {
+       if ((tp->mac_version <= RTL_GIGA_MAC_VER_06) &&
+           (RTL_R8(PHYstatus) & TBI_Enable)) {
                tp->set_speed = rtl8169_set_speed_tbi;
                tp->get_settings = rtl8169_gset_tbi;
                tp->phy_reset_enable = rtl8169_tbi_reset_enable;
@@ -2989,13 +2979,16 @@ static void rtl8169_down(struct net_device *dev)
 {
        struct rtl8169_private *tp = netdev_priv(dev);
        void __iomem *ioaddr = tp->mmio_addr;
-       unsigned int poll_locked = 0;
        unsigned int intrmask;
 
        rtl8169_delete_timer(dev);
 
        netif_stop_queue(dev);
 
+#ifdef CONFIG_R8169_NAPI
+       napi_disable(&tp->napi);
+#endif
+
 core_down:
        spin_lock_irq(&tp->lock);
 
@@ -3009,11 +3002,6 @@ core_down:
 
        synchronize_irq(dev->irq);
 
-       if (!poll_locked) {
-               napi_disable(&tp->napi);
-               poll_locked++;
-       }
-
        /* Give a racing hard_start_xmit a few cycles to complete. */
        synchronize_sched();  /* FIXME: should this be synchronize_irq()? */
 
index b822859c8de31079dbb100c4cf91a1947fc87184..73a7e6529ee0f91abb46f1bda1e05bcd21330bef 100644 (file)
@@ -78,12 +78,6 @@ static char version[] __devinitdata = "rrunner.c: v0.50 11/11/2002  Jes Sorensen
  * stack will need to know about I/O vectors or something similar.
  */
 
-/*
- * sysctl_[wr]mem_max are checked at init time to see if they are at
- * least 256KB and increased to 256KB if they are not. This is done to
- * avoid ending up with socket buffers smaller than the MTU size,
- */
-
 static int __devinit rr_init_one(struct pci_dev *pdev,
        const struct pci_device_id *ent)
 {
@@ -561,18 +555,6 @@ static int __devinit rr_init(struct net_device *dev)
        sram_size = rr_read_eeprom_word(rrpriv, (void *)8);
        printk("  SRAM size 0x%06x\n", sram_size);
 
-       if (sysctl_rmem_max < 262144){
-               printk("  Receive socket buffer limit too low (%i), "
-                      "setting to 262144\n", sysctl_rmem_max);
-               sysctl_rmem_max = 262144;
-       }
-
-       if (sysctl_wmem_max < 262144){
-               printk("  Transmit socket buffer limit too low (%i), "
-                      "setting to 262144\n", sysctl_wmem_max);
-               sysctl_wmem_max = 262144;
-       }
-
        return 0;
 }
 
index b8c0e7b4ca1cdd0e0d4d3a9251af47cff784a326..632666706247708e88574805f9023f6f616ffdce 100644 (file)
@@ -84,7 +84,7 @@
 #include "s2io.h"
 #include "s2io-regs.h"
 
-#define DRV_VERSION "2.0.26.5"
+#define DRV_VERSION "2.0.26.6"
 
 /* S2io Driver name & version. */
 static char s2io_driver_name[] = "Neterion";
@@ -3775,6 +3775,40 @@ static int __devinit s2io_test_msi(struct s2io_nic *sp)
 
        return err;
 }
+
+static void remove_msix_isr(struct s2io_nic *sp)
+{
+       int i;
+       u16 msi_control;
+
+       for (i = 0; i < MAX_REQUESTED_MSI_X; i++) {
+               if (sp->s2io_entries[i].in_use ==
+                       MSIX_REGISTERED_SUCCESS) {
+                       int vector = sp->entries[i].vector;
+                       void *arg = sp->s2io_entries[i].arg;
+                       free_irq(vector, arg);
+               }
+       }
+
+       kfree(sp->entries);
+       kfree(sp->s2io_entries);
+       sp->entries = NULL;
+       sp->s2io_entries = NULL;
+
+       pci_read_config_word(sp->pdev, 0x42, &msi_control);
+       msi_control &= 0xFFFE; /* Disable MSI */
+       pci_write_config_word(sp->pdev, 0x42, msi_control);
+
+       pci_disable_msix(sp->pdev);
+}
+
+static void remove_inta_isr(struct s2io_nic *sp)
+{
+       struct net_device *dev = sp->dev;
+
+       free_irq(sp->pdev->irq, dev);
+}
+
 /* ********************************************************* *
  * Functions defined below concern the OS part of the driver *
  * ********************************************************* */
@@ -3809,28 +3843,9 @@ static int s2io_open(struct net_device *dev)
                int ret = s2io_enable_msi_x(sp);
 
                if (!ret) {
-                       u16 msi_control;
-
                        ret = s2io_test_msi(sp);
-
                        /* rollback MSI-X, will re-enable during add_isr() */
-                       kfree(sp->entries);
-                       sp->mac_control.stats_info->sw_stat.mem_freed +=
-                               (MAX_REQUESTED_MSI_X *
-                               sizeof(struct msix_entry));
-                       kfree(sp->s2io_entries);
-                       sp->mac_control.stats_info->sw_stat.mem_freed +=
-                               (MAX_REQUESTED_MSI_X *
-                               sizeof(struct s2io_msix_entry));
-                       sp->entries = NULL;
-                       sp->s2io_entries = NULL;
-
-                       pci_read_config_word(sp->pdev, 0x42, &msi_control);
-                       msi_control &= 0xFFFE; /* Disable MSI */
-                       pci_write_config_word(sp->pdev, 0x42, msi_control);
-
-                       pci_disable_msix(sp->pdev);
-
+                       remove_msix_isr(sp);
                }
                if (ret) {
 
@@ -6719,15 +6734,22 @@ static int s2io_add_isr(struct s2io_nic * sp)
                                }
                        }
                        if (err) {
+                               remove_msix_isr(sp);
                                DBG_PRINT(ERR_DBG,"%s:MSI-X-%d registration "
                                          "failed\n", dev->name, i);
-                               DBG_PRINT(ERR_DBG, "Returned: %d\n", err);
-                               return -1;
+                               DBG_PRINT(ERR_DBG, "%s: defaulting to INTA\n",
+                                                dev->name);
+                               sp->config.intr_type = INTA;
+                               break;
                        }
                        sp->s2io_entries[i].in_use = MSIX_REGISTERED_SUCCESS;
                }
-               printk("MSI-X-TX %d entries enabled\n",msix_tx_cnt);
-               printk("MSI-X-RX %d entries enabled\n",msix_rx_cnt);
+               if (!err) {
+                       printk(KERN_INFO "MSI-X-TX %d entries enabled\n",
+                               msix_tx_cnt);
+                       printk(KERN_INFO "MSI-X-RX %d entries enabled\n",
+                               msix_rx_cnt);
+               }
        }
        if (sp->config.intr_type == INTA) {
                err = request_irq((int) sp->pdev->irq, s2io_isr, IRQF_SHARED,
@@ -6742,40 +6764,10 @@ static int s2io_add_isr(struct s2io_nic * sp)
 }
 static void s2io_rem_isr(struct s2io_nic * sp)
 {
-       struct net_device *dev = sp->dev;
-       struct swStat *stats = &sp->mac_control.stats_info->sw_stat;
-
-       if (sp->config.intr_type == MSI_X) {
-               int i;
-               u16 msi_control;
-
-               for (i=1; (sp->s2io_entries[i].in_use ==
-                       MSIX_REGISTERED_SUCCESS); i++) {
-                       int vector = sp->entries[i].vector;
-                       void *arg = sp->s2io_entries[i].arg;
-
-                       synchronize_irq(vector);
-                       free_irq(vector, arg);
-               }
-
-               kfree(sp->entries);
-               stats->mem_freed +=
-                       (MAX_REQUESTED_MSI_X * sizeof(struct msix_entry));
-               kfree(sp->s2io_entries);
-               stats->mem_freed +=
-                       (MAX_REQUESTED_MSI_X * sizeof(struct s2io_msix_entry));
-               sp->entries = NULL;
-               sp->s2io_entries = NULL;
-
-               pci_read_config_word(sp->pdev, 0x42, &msi_control);
-               msi_control &= 0xFFFE; /* Disable MSI */
-               pci_write_config_word(sp->pdev, 0x42, msi_control);
-
-               pci_disable_msix(sp->pdev);
-       } else {
-               synchronize_irq(sp->pdev->irq);
-               free_irq(sp->pdev->irq, dev);
-       }
+       if (sp->config.intr_type == MSI_X)
+               remove_msix_isr(sp);
+       else
+               remove_inta_isr(sp);
 }
 
 static void do_s2io_card_down(struct s2io_nic * sp, int do_io)
index b9961dc47606bb28b9528c8764e95e488ff1ca36..6d62250fba07944fab02a67dc9b93dc6fcdf36de 100644 (file)
@@ -2512,31 +2512,32 @@ static int skge_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
        return err;
 }
 
-/* Assign Ram Buffer allocation to queue */
-static void skge_ramset(struct skge_hw *hw, u16 q, u32 start, u32 space)
+static void skge_ramset(struct skge_hw *hw, u16 q, u32 start, size_t len)
 {
        u32 end;
 
-       /* convert from K bytes to qwords used for hw register */
-       start *= 1024/8;
-       space *= 1024/8;
-       end = start + space - 1;
+       start /= 8;
+       len /= 8;
+       end = start + len - 1;
 
        skge_write8(hw, RB_ADDR(q, RB_CTRL), RB_RST_CLR);
        skge_write32(hw, RB_ADDR(q, RB_START), start);
-       skge_write32(hw, RB_ADDR(q, RB_END), end);
        skge_write32(hw, RB_ADDR(q, RB_WP), start);
        skge_write32(hw, RB_ADDR(q, RB_RP), start);
+       skge_write32(hw, RB_ADDR(q, RB_END), end);
 
        if (q == Q_R1 || q == Q_R2) {
-               u32 tp = space - space/4;
-
                /* Set thresholds on receive queue's */
-               skge_write32(hw, RB_ADDR(q, RB_RX_UTPP), tp);
-               skge_write32(hw, RB_ADDR(q, RB_RX_LTPP), space/4);
-       } else if (hw->chip_id != CHIP_ID_GENESIS)
-               /* Genesis Tx Fifo is too small for normal store/forward */
+               skge_write32(hw, RB_ADDR(q, RB_RX_UTPP),
+                            start + (2*len)/3);
+               skge_write32(hw, RB_ADDR(q, RB_RX_LTPP),
+                            start + (len/3));
+       } else {
+               /* Enable store & forward on Tx queue's because
+                * Tx FIFO is only 4K on Genesis and 1K on Yukon
+                */
                skge_write8(hw, RB_ADDR(q, RB_CTRL), RB_ENA_STFWD);
+       }
 
        skge_write8(hw, RB_ADDR(q, RB_CTRL), RB_ENA_OP_MD);
 }
@@ -2564,7 +2565,7 @@ static int skge_up(struct net_device *dev)
        struct skge_port *skge = netdev_priv(dev);
        struct skge_hw *hw = skge->hw;
        int port = skge->port;
-       u32 ramaddr, ramsize, rxspace;
+       u32 chunk, ram_addr;
        size_t rx_size, tx_size;
        int err;
 
@@ -2619,15 +2620,14 @@ static int skge_up(struct net_device *dev)
        spin_unlock_bh(&hw->phy_lock);
 
        /* Configure RAMbuffers */
-       ramsize = (hw->ram_size - hw->ram_offset) / hw->ports;
-       ramaddr = hw->ram_offset + port * ramsize;
-       rxspace = 8 + (2*(ramsize - 16))/3;
-
-       skge_ramset(hw, rxqaddr[port], ramaddr, rxspace);
-       skge_ramset(hw, txqaddr[port], ramaddr + rxspace, ramsize - rxspace);
+       chunk = hw->ram_size / ((hw->ports + 1)*2);
+       ram_addr = hw->ram_offset + 2 * chunk * port;
 
+       skge_ramset(hw, rxqaddr[port], ram_addr, chunk);
        skge_qset(skge, rxqaddr[port], skge->rx_ring.to_clean);
+
        BUG_ON(skge->tx_ring.to_use != skge->tx_ring.to_clean);
+       skge_ramset(hw, txqaddr[port], ram_addr+chunk, chunk);
        skge_qset(skge, txqaddr[port], skge->tx_ring.to_use);
 
        /* Start receiver BMU */
@@ -3591,12 +3591,15 @@ static int skge_reset(struct skge_hw *hw)
        if (hw->chip_id == CHIP_ID_GENESIS) {
                if (t8 == 3) {
                        /* special case: 4 x 64k x 36, offset = 0x80000 */
-                       hw->ram_size = 1024;
-                       hw->ram_offset = 512;
+                       hw->ram_size = 0x100000;
+                       hw->ram_offset = 0x80000;
                } else
                        hw->ram_size = t8 * 512;
-       } else /* Yukon */
-               hw->ram_size = t8 ? t8 * 4 : 128;
+       }
+       else if (t8 == 0)
+               hw->ram_size = 0x20000;
+       else
+               hw->ram_size = t8 * 4096;
 
        hw->intr_mask = IS_HW_ERR;
 
index c27c7d63b6a56abc88d7ebda8d14a02795ce81ea..a2070db725c903ced2fae8079cf71fd2ae32d182 100644 (file)
@@ -52,7 +52,7 @@
 #include "sky2.h"
 
 #define DRV_NAME               "sky2"
-#define DRV_VERSION            "1.19"
+#define DRV_VERSION            "1.20"
 #define PFX                    DRV_NAME " "
 
 /*
@@ -121,6 +121,7 @@ static const struct pci_device_id sky2_id_table[] = {
        { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4353) }, /* 88E8039 */
        { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4354) }, /* 88E8040 */
        { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4356) }, /* 88EC033 */
+       { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4357) }, /* 88E8042 */
        { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x435A) }, /* 88E8048 */
        { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4360) }, /* 88E8052 */
        { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4361) }, /* 88E8050 */
@@ -134,6 +135,7 @@ static const struct pci_device_id sky2_id_table[] = {
        { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4369) }, /* 88EC042 */
        { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436A) }, /* 88E8058 */
        { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436B) }, /* 88E8071 */
+       { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436C) }, /* 88E8072 */
        { 0 }
 };
 
@@ -156,7 +158,7 @@ static const char *yukon2_name[] = {
 
 static void sky2_set_multicast(struct net_device *dev);
 
-/* Access to external PHY */
+/* Access to PHY via serial interconnect */
 static int gm_phy_write(struct sky2_hw *hw, unsigned port, u16 reg, u16 val)
 {
        int i;
@@ -166,13 +168,22 @@ static int gm_phy_write(struct sky2_hw *hw, unsigned port, u16 reg, u16 val)
                    GM_SMI_CT_PHY_AD(PHY_ADDR_MARV) | GM_SMI_CT_REG_AD(reg));
 
        for (i = 0; i < PHY_RETRIES; i++) {
-               if (!(gma_read16(hw, port, GM_SMI_CTRL) & GM_SMI_CT_BUSY))
+               u16 ctrl = gma_read16(hw, port, GM_SMI_CTRL);
+               if (ctrl == 0xffff)
+                       goto io_error;
+
+               if (!(ctrl & GM_SMI_CT_BUSY))
                        return 0;
-               udelay(1);
+
+               udelay(10);
        }
 
-       printk(KERN_WARNING PFX "%s: phy write timeout\n", hw->dev[port]->name);
+       dev_warn(&hw->pdev->dev,"%s: phy write timeout\n", hw->dev[port]->name);
        return -ETIMEDOUT;
+
+io_error:
+       dev_err(&hw->pdev->dev, "%s: phy I/O error\n", hw->dev[port]->name);
+       return -EIO;
 }
 
 static int __gm_phy_read(struct sky2_hw *hw, unsigned port, u16 reg, u16 *val)
@@ -183,23 +194,29 @@ static int __gm_phy_read(struct sky2_hw *hw, unsigned port, u16 reg, u16 *val)
                    | GM_SMI_CT_REG_AD(reg) | GM_SMI_CT_OP_RD);
 
        for (i = 0; i < PHY_RETRIES; i++) {
-               if (gma_read16(hw, port, GM_SMI_CTRL) & GM_SMI_CT_RD_VAL) {
+               u16 ctrl = gma_read16(hw, port, GM_SMI_CTRL);
+               if (ctrl == 0xffff)
+                       goto io_error;
+
+               if (ctrl & GM_SMI_CT_RD_VAL) {
                        *val = gma_read16(hw, port, GM_SMI_DATA);
                        return 0;
                }
 
-               udelay(1);
+               udelay(10);
        }
 
+       dev_warn(&hw->pdev->dev, "%s: phy read timeout\n", hw->dev[port]->name);
        return -ETIMEDOUT;
+io_error:
+       dev_err(&hw->pdev->dev, "%s: phy I/O error\n", hw->dev[port]->name);
+       return -EIO;
 }
 
-static u16 gm_phy_read(struct sky2_hw *hw, unsigned port, u16 reg)
+static inline u16 gm_phy_read(struct sky2_hw *hw, unsigned port, u16 reg)
 {
        u16 v;
-
-       if (__gm_phy_read(hw, port, reg, &v) != 0)
-               printk(KERN_WARNING PFX "%s: phy read timeout\n", hw->dev[port]->name);
+       __gm_phy_read(hw, port, reg, &v);
        return v;
 }
 
@@ -273,8 +290,6 @@ static void sky2_gmac_reset(struct sky2_hw *hw, unsigned port)
 
        /* disable all GMAC IRQ's */
        sky2_write8(hw, SK_REG(port, GMAC_IRQ_MSK), 0);
-       /* disable PHY IRQs */
-       gm_phy_write(hw, port, PHY_MARV_INT_MASK, 0);
 
        gma_write16(hw, port, GM_MC_ADDR_H1, 0);        /* clear MC hash */
        gma_write16(hw, port, GM_MC_ADDR_H2, 0);
@@ -1805,29 +1820,6 @@ static void sky2_link_up(struct sky2_port *sky2)
        sky2_write8(hw, SK_REG(port, LNK_LED_REG),
                    LINKLED_ON | LINKLED_BLINK_OFF | LINKLED_LINKSYNC_OFF);
 
-       if (hw->flags & SKY2_HW_NEWER_PHY) {
-               u16 pg = gm_phy_read(hw, port, PHY_MARV_EXT_ADR);
-               u16 led = PHY_M_LEDC_LOS_CTRL(1);       /* link active */
-
-               switch(sky2->speed) {
-               case SPEED_10:
-                       led |= PHY_M_LEDC_INIT_CTRL(7);
-                       break;
-
-               case SPEED_100:
-                       led |= PHY_M_LEDC_STA1_CTRL(7);
-                       break;
-
-               case SPEED_1000:
-                       led |= PHY_M_LEDC_STA0_CTRL(7);
-                       break;
-               }
-
-               gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 3);
-               gm_phy_write(hw, port, PHY_MARV_PHY_CTRL, led);
-               gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg);
-       }
-
        if (netif_msg_link(sky2))
                printk(KERN_INFO PFX
                       "%s: Link is up at %d Mbps, %s duplex, flow control %s\n",
@@ -2247,20 +2239,26 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx)
        do {
                struct sky2_port *sky2;
                struct sky2_status_le *le  = hw->st_le + hw->st_idx;
-               unsigned port = le->css & CSS_LINK_BIT;
+               unsigned port;
                struct net_device *dev;
                struct sk_buff *skb;
                u32 status;
                u16 length;
+               u8 opcode = le->opcode;
+
+               if (!(opcode & HW_OWNER))
+                       break;
 
                hw->st_idx = RING_NEXT(hw->st_idx, STATUS_RING_SIZE);
 
+               port = le->css & CSS_LINK_BIT;
                dev = hw->dev[port];
                sky2 = netdev_priv(dev);
                length = le16_to_cpu(le->length);
                status = le32_to_cpu(le->status);
 
-               switch (le->opcode & ~HW_OWNER) {
+               le->opcode = 0;
+               switch (opcode & ~HW_OWNER) {
                case OP_RXSTAT:
                        ++rx[port];
                        skb = sky2_receive(dev, length, status);
@@ -2353,7 +2351,7 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx)
                default:
                        if (net_ratelimit())
                                printk(KERN_WARNING PFX
-                                      "unknown status opcode 0x%x\n", le->opcode);
+                                      "unknown status opcode 0x%x\n", opcode);
                }
        } while (hw->st_idx != idx);
 
@@ -2439,13 +2437,26 @@ static void sky2_hw_intr(struct sky2_hw *hw)
 
        if (status & Y2_IS_PCI_EXP) {
                /* PCI-Express uncorrectable Error occurred */
-               int pos = pci_find_aer_capability(hw->pdev);
+               int aer = pci_find_aer_capability(hw->pdev);
                u32 err;
 
-               pci_read_config_dword(pdev, pos + PCI_ERR_UNCOR_STATUS, &err);
+               if (aer) {
+                       pci_read_config_dword(pdev, aer + PCI_ERR_UNCOR_STATUS,
+                                             &err);
+                       pci_cleanup_aer_uncorrect_error_status(pdev);
+               } else {
+                       /* Either AER not configured, or not working
+                        * because of bad MMCONFIG, so just do recover
+                        * manually.
+                        */
+                       err = sky2_read32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS);
+                       sky2_write32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS,
+                                    0xfffffffful);
+               }
+
                if (net_ratelimit())
                        dev_err(&pdev->dev, "PCI Express error (0x%x)\n", err);
-               pci_cleanup_aer_uncorrect_error_status(pdev);
+
        }
 
        if (status & Y2_HWE_L1_MASK)
@@ -2791,6 +2802,9 @@ static void sky2_reset(struct sky2_hw *hw)
        sky2_write8(hw, B0_CTST, CS_RST_SET);
        sky2_write8(hw, B0_CTST, CS_RST_CLR);
 
+       /* allow writes to PCI config */
+       sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
+
        /* clear PCI errors, if any */
        pci_read_config_word(pdev, PCI_STATUS, &status);
        status |= PCI_STATUS_ERROR_BITS;
@@ -2800,9 +2814,18 @@ static void sky2_reset(struct sky2_hw *hw)
 
        cap = pci_find_capability(pdev, PCI_CAP_ID_EXP);
        if (cap) {
-               /* Check for advanced error reporting */
-               pci_cleanup_aer_uncorrect_error_status(pdev);
-               pci_cleanup_aer_correct_error_status(pdev);
+               if (pci_find_aer_capability(pdev)) {
+                       /* Check for advanced error reporting */
+                       pci_cleanup_aer_uncorrect_error_status(pdev);
+                       pci_cleanup_aer_correct_error_status(pdev);
+               } else {
+                       dev_warn(&pdev->dev,
+                               "PCI Express Advanced Error Reporting"
+                               " not configured or MMCONFIG problem?\n");
+
+                       sky2_write32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS,
+                                    0xfffffffful);
+               }
 
                /* If error bit is stuck on ignore it */
                if (sky2_read32(hw, B0_HWE_ISRC) & Y2_IS_PCI_EXP)
@@ -3974,7 +3997,8 @@ static __devinit struct net_device *sky2_init_netdev(struct sky2_hw *hw,
        dev->tx_timeout = sky2_tx_timeout;
        dev->watchdog_timeo = TX_WATCHDOG;
 #ifdef CONFIG_NET_POLL_CONTROLLER
-       dev->poll_controller = sky2_netpoll;
+       if (port == 0)
+               dev->poll_controller = sky2_netpoll;
 #endif
 
        sky2 = netdev_priv(dev);
index 49ee264064ab85dc95ac522b93e72b8e240e7fa1..69525fd7908db70e898d51768b0c3dd6a557becb 100644 (file)
@@ -247,7 +247,8 @@ enum csr_regs {
        B3_PA_CTRL      = 0x01f0,
        B3_PA_TEST      = 0x01f2,
 
-       Y2_CFG_SPC      = 0x1c00,
+       Y2_CFG_SPC      = 0x1c00,       /* PCI config space region */
+       Y2_CFG_AER      = 0x1d00,       /* PCI Advanced Error Report region */
 };
 
 /*     B0_CTST                 16 bit  Control/Status register */
index 335b7cc80ebaf3aaf430af776f08d716dd215dbf..251a3ce376ac60828fea0389b97316c649b6adcc 100644 (file)
@@ -1218,14 +1218,8 @@ static int slip_ioctl(struct tty_struct *tty, struct file *file, unsigned int cm
                return 0;
        /* VSV changes end */
 #endif
-
-       /* Allow stty to read, but not set, the serial port */
-       case TCGETS:
-       case TCGETA:
-               return n_tty_ioctl(tty, file, cmd, arg);
-
        default:
-               return -ENOIOCTLCMD;
+               return tty_mode_ioctl(tty, file, cmd, arg);
        }
 }
 
index 729fd28c08b56f071050f30723bc2256730d7f36..db34e1eb67e98e678c08c61ae4dd19daded4b073 100644 (file)
@@ -224,6 +224,21 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg)
        }
 }
 
+#elif defined(CONFIG_MACH_ZYLONITE)
+
+#define SMC_CAN_USE_8BIT        1
+#define SMC_CAN_USE_16BIT       1
+#define SMC_CAN_USE_32BIT       0
+#define SMC_IO_SHIFT            0
+#define SMC_NOWAIT              1
+#define SMC_USE_PXA_DMA                1
+#define SMC_inb(a, r)           readb((a) + (r))
+#define SMC_inw(a, r)           readw((a) + (r))
+#define SMC_insw(a, r, p, l)    insw((a) + (r), p, l)
+#define SMC_outsw(a, r, p, l)   outsw((a) + (r), p, l)
+#define SMC_outb(v, a, r)       writeb(v, (a) + (r))
+#define SMC_outw(v, a, r)       writew(v, (a) + (r))
+
 #elif  defined(CONFIG_ARCH_OMAP)
 
 /* We can only do 16-bit reads and writes in the static memory space. */
index 53b8344a68effd0766ec73c262d0aab7bf3c4f61..f6fedcc32de17ce8bca604068d736e38fda45927 100644 (file)
@@ -2333,10 +2333,10 @@ static int gem_close(struct net_device *dev)
 {
        struct gem *gp = dev->priv;
 
-       napi_disable(&gp->napi);
-
        mutex_lock(&gp->pm_mutex);
 
+       napi_disable(&gp->napi);
+
        gp->opened = 0;
        if (!gp->asleep)
                gem_do_stop(dev, 0);
@@ -2355,8 +2355,6 @@ static int gem_suspend(struct pci_dev *pdev, pm_message_t state)
 
        mutex_lock(&gp->pm_mutex);
 
-       napi_disable(&gp->napi);
-
        printk(KERN_INFO "%s: suspending, WakeOnLan %s\n",
               dev->name,
               (gp->wake_on_lan && gp->opened) ? "enabled" : "disabled");
@@ -2370,6 +2368,8 @@ static int gem_suspend(struct pci_dev *pdev, pm_message_t state)
 
        /* If the driver is opened, we stop the MAC */
        if (gp->opened) {
+               napi_disable(&gp->napi);
+
                /* Stop traffic, mark us closed */
                netif_device_detach(dev);
 
@@ -2460,6 +2460,7 @@ static int gem_resume(struct pci_dev *pdev)
                /* Re-attach net device */
                netif_device_attach(dev);
 
+               napi_enable(&gp->napi);
        }
 
        spin_lock_irqsave(&gp->lock, flags);
@@ -2479,8 +2480,6 @@ static int gem_resume(struct pci_dev *pdev)
        spin_unlock(&gp->tx_lock);
        spin_unlock_irqrestore(&gp->lock, flags);
 
-       napi_enable(&gp->napi);
-
        mutex_unlock(&gp->pm_mutex);
 
        return 0;
index 120c8affe83dba36f29f972657fc05954af6284d..9cc13dd8a82182cd2718ebf01d9c45fc255e9610 100644 (file)
@@ -1281,7 +1281,7 @@ static void happy_meal_init_rings(struct happy_meal *hp)
                skb->dev = dev;
 
                /* Because we reserve afterwards. */
-               skb_put(skb, (ETH_FRAME_LEN + RX_OFFSET));
+               skb_put(skb, (ETH_FRAME_LEN + RX_OFFSET + 4));
                hme_write_rxd(hp, &hb->happy_meal_rxd[i],
                              (RXFLAG_OWN | ((RX_BUF_ALLOC_SIZE - RX_OFFSET) << 16)),
                              hme_dma_map(hp, skb->data, RX_BUF_ALLOC_SIZE, DMA_FROMDEVICE));
@@ -1700,6 +1700,11 @@ static int happy_meal_init(struct happy_meal *hp)
        HMD(("tx old[%08x] and rx [%08x] ON!\n",
             hme_read32(hp, bregs + BMAC_TXCFG),
             hme_read32(hp, bregs + BMAC_RXCFG)));
+
+       /* Set larger TX/RX size to allow for 802.1q */
+       hme_write32(hp, bregs + BMAC_TXMAX, ETH_FRAME_LEN + 8);
+       hme_write32(hp, bregs + BMAC_RXMAX, ETH_FRAME_LEN + 8);
+
        hme_write32(hp, bregs + BMAC_TXCFG,
                    hme_read32(hp, bregs + BMAC_TXCFG) | BIGMAC_TXCFG_ENABLE);
        hme_write32(hp, bregs + BMAC_RXCFG,
@@ -2039,7 +2044,7 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev)
                        hme_dma_unmap(hp, dma_addr, RX_BUF_ALLOC_SIZE, DMA_FROMDEVICE);
                        hp->rx_skbs[elem] = new_skb;
                        new_skb->dev = dev;
-                       skb_put(new_skb, (ETH_FRAME_LEN + RX_OFFSET));
+                       skb_put(new_skb, (ETH_FRAME_LEN + RX_OFFSET + 4));
                        hme_write_rxd(hp, this,
                                      (RXFLAG_OWN|((RX_BUF_ALLOC_SIZE-RX_OFFSET)<<16)),
                                      hme_dma_map(hp, new_skb->data, RX_BUF_ALLOC_SIZE, DMA_FROMDEVICE));
@@ -2809,8 +2814,8 @@ static int __devinit happy_meal_sbus_probe_one(struct sbus_dev *sdev, int is_qfe
        dev->watchdog_timeo = 5*HZ;
        dev->ethtool_ops = &hme_ethtool_ops;
 
-       /* Happy Meal can do it all... except VLAN. */
-       dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_VLAN_CHALLENGED;
+       /* Happy Meal can do it all... */
+       dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM;
 
        dev->irq = sdev->irqs[0];
 
index 4e1b84e6d66ab308330184a034ba7f52d82fb91a..21230c97b2a0fc7513af353faf8a42c5781602e8 100644 (file)
@@ -2168,10 +2168,10 @@ bdx_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo)
 {
        struct bdx_priv *priv = netdev->priv;
 
-       strncat(drvinfo->driver, BDX_DRV_NAME, sizeof(drvinfo->driver));
-       strncat(drvinfo->version, BDX_DRV_VERSION, sizeof(drvinfo->version));
-       strncat(drvinfo->fw_version, "N/A", sizeof(drvinfo->fw_version));
-       strncat(drvinfo->bus_info, pci_name(priv->pdev),
+       strlcat(drvinfo->driver, BDX_DRV_NAME, sizeof(drvinfo->driver));
+       strlcat(drvinfo->version, BDX_DRV_VERSION, sizeof(drvinfo->version));
+       strlcat(drvinfo->fw_version, "N/A", sizeof(drvinfo->fw_version));
+       strlcat(drvinfo->bus_info, pci_name(priv->pdev),
                sizeof(drvinfo->bus_info));
 
        drvinfo->n_stats = ((priv->stats_flag) ?
index 09440d783e65542912bac932fa727a288df1891c..4942f7d18937b9cbbe94fd37607c2d331bb11c70 100644 (file)
@@ -64,8 +64,8 @@
 
 #define DRV_MODULE_NAME                "tg3"
 #define PFX DRV_MODULE_NAME    ": "
-#define DRV_MODULE_VERSION     "3.85"
-#define DRV_MODULE_RELDATE     "October 18, 2007"
+#define DRV_MODULE_VERSION     "3.86"
+#define DRV_MODULE_RELDATE     "November 9, 2007"
 
 #define TG3_DEF_MAC_MODE       0
 #define TG3_DEF_RX_MODE                0
@@ -1106,6 +1106,24 @@ static int tg3_phy_reset(struct tg3 *tp)
        if (err)
                return err;
 
+       if (tp->tg3_flags3 & TG3_FLG3_5761_5784_AX_FIXES) {
+               u32 val;
+
+               val = tr32(TG3_CPMU_LSPD_1000MB_CLK);
+               if ((val & CPMU_LSPD_1000MB_MACCLK_MASK) ==
+                   CPMU_LSPD_1000MB_MACCLK_12_5) {
+                       val &= ~CPMU_LSPD_1000MB_MACCLK_MASK;
+                       udelay(40);
+                       tw32_f(TG3_CPMU_LSPD_1000MB_CLK, val);
+               }
+
+               /* Disable GPHY autopowerdown. */
+               tg3_writephy(tp, MII_TG3_MISC_SHDW,
+                            MII_TG3_MISC_SHDW_WREN |
+                            MII_TG3_MISC_SHDW_APD_SEL |
+                            MII_TG3_MISC_SHDW_APD_WKTM_84MS);
+       }
+
 out:
        if (tp->tg3_flags2 & TG3_FLG2_PHY_ADC_BUG) {
                tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0c00);
@@ -1297,6 +1315,8 @@ static void tg3_nvram_unlock(struct tg3 *);
 
 static void tg3_power_down_phy(struct tg3 *tp)
 {
+       u32 val;
+
        if (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES) {
                if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) {
                        u32 sg_dig_ctrl = tr32(SG_DIG_CTRL);
@@ -1311,8 +1331,6 @@ static void tg3_power_down_phy(struct tg3 *tp)
        }
 
        if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) {
-               u32 val;
-
                tg3_bmcr_reset(tp);
                val = tr32(GRC_MISC_CFG);
                tw32_f(GRC_MISC_CFG, val | GRC_MISC_CFG_EPHY_IDDQ);
@@ -1332,6 +1350,14 @@ static void tg3_power_down_phy(struct tg3 *tp)
            (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780 &&
             (tp->tg3_flags2 & TG3_FLG2_MII_SERDES)))
                return;
+
+       if (tp->tg3_flags3 & TG3_FLG3_5761_5784_AX_FIXES) {
+               val = tr32(TG3_CPMU_LSPD_1000MB_CLK);
+               val &= ~CPMU_LSPD_1000MB_MACCLK_MASK;
+               val |= CPMU_LSPD_1000MB_MACCLK_12_5;
+               tw32_f(TG3_CPMU_LSPD_1000MB_CLK, val);
+       }
+
        tg3_writephy(tp, MII_BMCR, BMCR_PDOWN);
 }
 
@@ -3126,6 +3152,23 @@ static int tg3_setup_phy(struct tg3 *tp, int force_reset)
                err = tg3_setup_copper_phy(tp, force_reset);
        }
 
+       if (tp->pci_chip_rev_id == CHIPREV_ID_5784_A0 ||
+           tp->pci_chip_rev_id == CHIPREV_ID_5784_A1) {
+               u32 val, scale;
+
+               val = tr32(TG3_CPMU_CLCK_STAT) & CPMU_CLCK_STAT_MAC_CLCK_MASK;
+               if (val == CPMU_CLCK_STAT_MAC_CLCK_62_5)
+                       scale = 65;
+               else if (val == CPMU_CLCK_STAT_MAC_CLCK_6_25)
+                       scale = 6;
+               else
+                       scale = 12;
+
+               val = tr32(GRC_MISC_CFG) & ~GRC_MISC_CFG_PRESCALAR_MASK;
+               val |= (scale << GRC_MISC_CFG_PRESCALAR_SHIFT);
+               tw32(GRC_MISC_CFG, val);
+       }
+
        if (tp->link_config.active_speed == SPEED_1000 &&
            tp->link_config.active_duplex == DUPLEX_HALF)
                tw32(MAC_TX_LENGTHS,
@@ -5054,12 +5097,15 @@ static void tg3_restore_pci_state(struct tg3 *tp)
 
        pci_write_config_word(tp->pdev, PCI_COMMAND, tp->pci_cmd);
 
-       if (!(tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS)) {
+       if (tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS)
+               pcie_set_readrq(tp->pdev, 4096);
+       else {
                pci_write_config_byte(tp->pdev, PCI_CACHE_LINE_SIZE,
                                      tp->pci_cacheline_sz);
                pci_write_config_byte(tp->pdev, PCI_LATENCY_TIMER,
                                      tp->pci_lat_timer);
        }
+
        /* Make sure PCI-X relaxed ordering bit is clear. */
        if (tp->pcix_cap) {
                u16 pcix_cmd;
@@ -6343,10 +6389,26 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
 
        tg3_write_sig_legacy(tp, RESET_KIND_INIT);
 
-       if (tp->pci_chip_rev_id == CHIPREV_ID_5784_A0) {
+       if (tp->pci_chip_rev_id == CHIPREV_ID_5784_A0 ||
+           tp->pci_chip_rev_id == CHIPREV_ID_5784_A1) {
                val = tr32(TG3_CPMU_CTRL);
                val &= ~(CPMU_CTRL_LINK_AWARE_MODE | CPMU_CTRL_LINK_IDLE_MODE);
                tw32(TG3_CPMU_CTRL, val);
+
+               val = tr32(TG3_CPMU_LSPD_10MB_CLK);
+               val &= ~CPMU_LSPD_10MB_MACCLK_MASK;
+               val |= CPMU_LSPD_10MB_MACCLK_6_25;
+               tw32(TG3_CPMU_LSPD_10MB_CLK, val);
+
+               val = tr32(TG3_CPMU_LNK_AWARE_PWRMD);
+               val &= ~CPMU_LNK_AWARE_MACCLK_MASK;
+               val |= CPMU_LNK_AWARE_MACCLK_6_25;
+               tw32(TG3_CPMU_LNK_AWARE_PWRMD, val);
+
+               val = tr32(TG3_CPMU_HST_ACC);
+               val &= ~CPMU_HST_ACC_MACCLK_MASK;
+               val |= CPMU_HST_ACC_MACCLK_6_25;
+               tw32(TG3_CPMU_HST_ACC, val);
        }
 
        /* This works around an issue with Athlon chipsets on
@@ -7365,10 +7427,6 @@ static int tg3_open(struct net_device *dev)
                } else if (pci_enable_msi(tp->pdev) == 0) {
                        u32 msi_mode;
 
-                       /* Hardware bug - MSI won't work if INTX disabled. */
-                       if (tp->tg3_flags2 & TG3_FLG2_5780_CLASS)
-                               pci_intx(tp->pdev, 1);
-
                        msi_mode = tr32(MSGINT_MODE);
                        tw32(MSGINT_MODE, msi_mode | MSGINT_MODE_ENABLE);
                        tp->tg3_flags2 |= TG3_FLG2_USING_MSI;
@@ -8271,7 +8329,7 @@ static int tg3_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
                                  SUPPORTED_100baseT_Full |
                                  SUPPORTED_10baseT_Half |
                                  SUPPORTED_10baseT_Full |
-                                 SUPPORTED_MII);
+                                 SUPPORTED_TP);
                cmd->port = PORT_TP;
        } else {
                cmd->supported |= SUPPORTED_FIBRE;
@@ -8668,7 +8726,9 @@ static void tg3_get_ethtool_stats (struct net_device *dev,
 }
 
 #define NVRAM_TEST_SIZE 0x100
-#define NVRAM_SELFBOOT_FORMAT1_SIZE 0x14
+#define NVRAM_SELFBOOT_FORMAT1_0_SIZE  0x14
+#define NVRAM_SELFBOOT_FORMAT1_2_SIZE  0x18
+#define NVRAM_SELFBOOT_FORMAT1_3_SIZE  0x1c
 #define NVRAM_SELFBOOT_HW_SIZE 0x20
 #define NVRAM_SELFBOOT_DATA_SIZE 0x1c
 
@@ -8683,9 +8743,22 @@ static int tg3_test_nvram(struct tg3 *tp)
        if (magic == TG3_EEPROM_MAGIC)
                size = NVRAM_TEST_SIZE;
        else if ((magic & TG3_EEPROM_MAGIC_FW_MSK) == TG3_EEPROM_MAGIC_FW) {
-               if ((magic & 0xe00000) == 0x200000)
-                       size = NVRAM_SELFBOOT_FORMAT1_SIZE;
-               else
+               if ((magic & TG3_EEPROM_SB_FORMAT_MASK) ==
+                   TG3_EEPROM_SB_FORMAT_1) {
+                       switch (magic & TG3_EEPROM_SB_REVISION_MASK) {
+                       case TG3_EEPROM_SB_REVISION_0:
+                               size = NVRAM_SELFBOOT_FORMAT1_0_SIZE;
+                               break;
+                       case TG3_EEPROM_SB_REVISION_2:
+                               size = NVRAM_SELFBOOT_FORMAT1_2_SIZE;
+                               break;
+                       case TG3_EEPROM_SB_REVISION_3:
+                               size = NVRAM_SELFBOOT_FORMAT1_3_SIZE;
+                               break;
+                       default:
+                               return 0;
+                       }
+               } else
                        return 0;
        } else if ((magic & TG3_EEPROM_MAGIC_HW_MSK) == TG3_EEPROM_MAGIC_HW)
                size = NVRAM_SELFBOOT_HW_SIZE;
@@ -8712,8 +8785,17 @@ static int tg3_test_nvram(struct tg3 *tp)
            TG3_EEPROM_MAGIC_FW) {
                u8 *buf8 = (u8 *) buf, csum8 = 0;
 
-               for (i = 0; i < size; i++)
-                       csum8 += buf8[i];
+               if ((cpu_to_be32(buf[0]) & TG3_EEPROM_SB_REVISION_MASK) ==
+                   TG3_EEPROM_SB_REVISION_2) {
+                       /* For rev 2, the csum doesn't include the MBA. */
+                       for (i = 0; i < TG3_EEPROM_SB_F1R2_MBA_OFF; i++)
+                               csum8 += buf8[i];
+                       for (i = TG3_EEPROM_SB_F1R2_MBA_OFF + 4; i < size; i++)
+                               csum8 += buf8[i];
+               } else {
+                       for (i = 0; i < size; i++)
+                               csum8 += buf8[i];
+               }
 
                if (csum8 == 0) {
                        err = 0;
@@ -9297,7 +9379,7 @@ static int tg3_test_loopback(struct tg3 *tp)
        if (err)
                return TG3_LOOPBACK_FAILED;
 
-       if (tp->tg3_flags & TG3_FLAG_CPMU_PRESENT) {
+       if (tp->tg3_flags3 & TG3_FLG3_5761_5784_AX_FIXES) {
                int i;
                u32 status;
 
@@ -9314,17 +9396,17 @@ static int tg3_test_loopback(struct tg3 *tp)
                if (status != CPMU_MUTEX_GNT_DRIVER)
                        return TG3_LOOPBACK_FAILED;
 
-               cpmuctrl = tr32(TG3_CPMU_CTRL);
-
                /* Turn off power management based on link speed. */
+               cpmuctrl = tr32(TG3_CPMU_CTRL);
                tw32(TG3_CPMU_CTRL,
-                    cpmuctrl & ~CPMU_CTRL_LINK_SPEED_MODE);
+                    cpmuctrl & ~(CPMU_CTRL_LINK_SPEED_MODE |
+                                 CPMU_CTRL_LINK_AWARE_MODE));
        }
 
        if (tg3_run_loopback(tp, TG3_MAC_LOOPBACK))
                err |= TG3_MAC_LOOPBACK_FAILED;
 
-       if (tp->tg3_flags & TG3_FLAG_CPMU_PRESENT) {
+       if (tp->tg3_flags3 & TG3_FLG3_5761_5784_AX_FIXES) {
                tw32(TG3_CPMU_CTRL, cpmuctrl);
 
                /* Release the mutex */
@@ -10545,6 +10627,10 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
                    tp->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL)
                        tp->led_ctrl = LED_CTRL_MODE_PHY_2;
 
+               if (tp->pci_chip_rev_id == CHIPREV_ID_5784_A0 ||
+                   tp->pci_chip_rev_id == CHIPREV_ID_5784_A1)
+                       tp->led_ctrl = LED_CTRL_MODE_MAC;
+
                if (nic_cfg & NIC_SRAM_DATA_CFG_EEPROM_WP) {
                        tp->tg3_flags |= TG3_FLAG_EEPROM_WRITE_PROT;
                        if ((tp->pdev->subsystem_vendor ==
@@ -10863,7 +10949,7 @@ static void __devinit tg3_read_fw_ver(struct tg3 *tp)
        }
 
        if (!(tp->tg3_flags & TG3_FLAG_ENABLE_ASF) ||
-            (tp->tg3_flags & TG3_FLG3_ENABLE_APE))
+            (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE))
                return;
 
        for (offset = TG3_NVM_DIR_START;
@@ -11131,6 +11217,9 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
        pcie_cap = pci_find_capability(tp->pdev, PCI_CAP_ID_EXP);
        if (pcie_cap != 0) {
                tp->tg3_flags2 |= TG3_FLG2_PCI_EXPRESS;
+
+               pcie_set_readrq(tp->pdev, 4096);
+
                if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) {
                        u16 lnkctl;
 
@@ -11311,9 +11400,16 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
        }
 
        if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 ||
-           GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761)
+           GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761) {
                tp->tg3_flags |= TG3_FLAG_CPMU_PRESENT;
 
+               if (tp->pci_chip_rev_id == CHIPREV_ID_5784_A0 ||
+                   tp->pci_chip_rev_id == CHIPREV_ID_5784_A1 ||
+                   tp->pci_chip_rev_id == CHIPREV_ID_5761_A0 ||
+                   tp->pci_chip_rev_id == CHIPREV_ID_5761_A1)
+                       tp->tg3_flags3 |= TG3_FLG3_5761_5784_AX_FIXES;
+       }
+
        /* Set up tp->grc_local_ctrl before calling tg3_set_power_state().
         * GPIO1 driven high will bring 5700's external PHY out of reset.
         * It is also used as eeprom write protect on LOMs.
@@ -12468,6 +12564,28 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
                goto err_out_iounmap;
        }
 
+       if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) {
+               if (!(pci_resource_flags(pdev, 2) & IORESOURCE_MEM)) {
+                       printk(KERN_ERR PFX "Cannot find proper PCI device "
+                              "base address for APE, aborting.\n");
+                       err = -ENODEV;
+                       goto err_out_iounmap;
+               }
+
+               tg3reg_base = pci_resource_start(pdev, 2);
+               tg3reg_len = pci_resource_len(pdev, 2);
+
+               tp->aperegs = ioremap_nocache(tg3reg_base, tg3reg_len);
+               if (tp->aperegs == 0UL) {
+                       printk(KERN_ERR PFX "Cannot map APE registers, "
+                              "aborting.\n");
+                       err = -ENOMEM;
+                       goto err_out_iounmap;
+               }
+
+               tg3_ape_lock_init(tp);
+       }
+
        /*
         * Reset chip in case UNDI or EFI driver did not shutdown
         * DMA self test will enable WDMAC and we'll see (spurious)
@@ -12482,7 +12600,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
        err = tg3_test_dma(tp);
        if (err) {
                printk(KERN_ERR PFX "DMA engine test failed, aborting.\n");
-               goto err_out_iounmap;
+               goto err_out_apeunmap;
        }
 
        /* Tigon3 can do ipv4 only... and some chips have buggy
@@ -12505,28 +12623,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
 
        tg3_init_coal(tp);
 
-       if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) {
-               if (!(pci_resource_flags(pdev, 2) & IORESOURCE_MEM)) {
-                       printk(KERN_ERR PFX "Cannot find proper PCI device "
-                              "base address for APE, aborting.\n");
-                       err = -ENODEV;
-                       goto err_out_iounmap;
-               }
-
-               tg3reg_base = pci_resource_start(pdev, 2);
-               tg3reg_len = pci_resource_len(pdev, 2);
-
-               tp->aperegs = ioremap_nocache(tg3reg_base, tg3reg_len);
-               if (tp->aperegs == 0UL) {
-                       printk(KERN_ERR PFX "Cannot map APE registers, "
-                              "aborting.\n");
-                       err = -ENOMEM;
-                       goto err_out_iounmap;
-               }
-
-               tg3_ape_lock_init(tp);
-       }
-
        pci_set_drvdata(pdev, dev);
 
        err = register_netdev(dev);
@@ -12681,11 +12777,6 @@ static int tg3_resume(struct pci_dev *pdev)
        if (err)
                return err;
 
-       /* Hardware bug - MSI won't work if INTX disabled. */
-       if ((tp->tg3_flags2 & TG3_FLG2_5780_CLASS) &&
-           (tp->tg3_flags2 & TG3_FLG2_USING_MSI))
-               pci_intx(tp->pdev, 1);
-
        netif_device_attach(dev);
 
        tg3_full_lock(tp, 0);
index 1d5b2a3dd29dff6c335f8d8174cdfe3955fd9319..da18fb2207126810a8b1f74faf1e26cb36393d55 100644 (file)
 #define  CHIPREV_ID_5714_A2             0x9002
 #define  CHIPREV_ID_5906_A1             0xc001
 #define  CHIPREV_ID_5784_A0             0x5784000
+#define  CHIPREV_ID_5784_A1             0x5784001
+#define  CHIPREV_ID_5761_A0             0x5761000
+#define  CHIPREV_ID_5761_A1             0x5761001
 #define  GET_ASIC_REV(CHIP_REV_ID)     ((CHIP_REV_ID) >> 12)
 #define   ASIC_REV_5700                         0x07
 #define   ASIC_REV_5701                         0x00
 #define  CPMU_CTRL_LINK_IDLE_MODE       0x00000200
 #define  CPMU_CTRL_LINK_AWARE_MODE      0x00000400
 #define  CPMU_CTRL_LINK_SPEED_MODE      0x00004000
-/* 0x3604 --> 0x365c unused */
+#define TG3_CPMU_LSPD_10MB_CLK         0x00003604
+#define  CPMU_LSPD_10MB_MACCLK_MASK     0x001f0000
+#define  CPMU_LSPD_10MB_MACCLK_6_25     0x00130000
+/* 0x3608 --> 0x360c unused */
+
+#define TG3_CPMU_LSPD_1000MB_CLK       0x0000360c
+#define  CPMU_LSPD_1000MB_MACCLK_62_5   0x00000000
+#define  CPMU_LSPD_1000MB_MACCLK_12_5   0x00110000
+#define  CPMU_LSPD_1000MB_MACCLK_MASK   0x001f0000
+#define TG3_CPMU_LNK_AWARE_PWRMD       0x00003610
+#define  CPMU_LNK_AWARE_MACCLK_MASK     0x001f0000
+#define  CPMU_LNK_AWARE_MACCLK_6_25     0x00130000
+/* 0x3614 --> 0x361c unused */
+
+#define TG3_CPMU_HST_ACC               0x0000361c
+#define  CPMU_HST_ACC_MACCLK_MASK       0x001f0000
+#define  CPMU_HST_ACC_MACCLK_6_25       0x00130000
+/* 0x3620 --> 0x3630 unused */
+
+#define TG3_CPMU_CLCK_STAT             0x00003630
+#define  CPMU_CLCK_STAT_MAC_CLCK_MASK   0x001f0000
+#define  CPMU_CLCK_STAT_MAC_CLCK_62_5   0x00000000
+#define  CPMU_CLCK_STAT_MAC_CLCK_12_5   0x00110000
+#define  CPMU_CLCK_STAT_MAC_CLCK_6_25   0x00130000
+/* 0x3634 --> 0x365c unused */
 
 #define TG3_CPMU_MUTEX_REQ             0x0000365c
 #define  CPMU_MUTEX_REQ_DRIVER          0x00001000
 #define TG3_EEPROM_MAGIC               0x669955aa
 #define TG3_EEPROM_MAGIC_FW            0xa5000000
 #define TG3_EEPROM_MAGIC_FW_MSK                0xff000000
+#define TG3_EEPROM_SB_FORMAT_MASK      0x00e00000
+#define TG3_EEPROM_SB_FORMAT_1         0x00200000
+#define TG3_EEPROM_SB_REVISION_MASK    0x001f0000
+#define TG3_EEPROM_SB_REVISION_0       0x00000000
+#define TG3_EEPROM_SB_REVISION_2       0x00020000
+#define TG3_EEPROM_SB_REVISION_3       0x00030000
 #define TG3_EEPROM_MAGIC_HW            0xabcd
 #define TG3_EEPROM_MAGIC_HW_MSK                0xffff
 
 #define MII_TG3_ISTAT                  0x1a /* IRQ status register */
 #define MII_TG3_IMASK                  0x1b /* IRQ mask register */
 
+#define MII_TG3_MISC_SHDW              0x1c
+#define MII_TG3_MISC_SHDW_WREN         0x8000
+#define MII_TG3_MISC_SHDW_APD_SEL      0x2800
+
+#define MII_TG3_MISC_SHDW_APD_WKTM_84MS        0x0001
+
 /* ISTAT/IMASK event bits */
 #define MII_TG3_INT_LINKCHG            0x0002
 #define MII_TG3_INT_SPEEDCHG           0x0004
 /* APE convenience enumerations. */
 #define TG3_APE_LOCK_MEM                4
 
+#define TG3_EEPROM_SB_F1R2_MBA_OFF     0x10
+
 
 /* There are two ways to manage the TX descriptors on the tigon3.
  * Either the descriptors are in host DMA'able memory, or they
@@ -2352,6 +2393,7 @@ struct tg3 {
        u32                             tg3_flags3;
 #define TG3_FLG3_NO_NVRAM_ADDR_TRANS   0x00000001
 #define TG3_FLG3_ENABLE_APE            0x00000002
+#define TG3_FLG3_5761_5784_AX_FIXES    0x00000004
 
        struct timer_list               timer;
        u16                             timer_counter;
index 49d7a290dbbcfa93bdb94eba8e147ce5d7b5d406..20ac1503021e38cec7ffb995efbff4f1cfc31c4a 100644 (file)
@@ -24,8 +24,7 @@ config DE2104X
          will say Y here.) Do read the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module will
+         To compile this driver as a module, choose M here. The module will
          be called de2104x.
 
 config TULIP
@@ -42,8 +41,7 @@ config TULIP
          will say Y here.) Do read the Ethernet-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module will
+         To compile this driver as a module, choose M here. The module will
          be called tulip.
 
 config TULIP_MWI
@@ -104,8 +102,7 @@ config DE4X5
          information is contained in
          <file:Documentation/networking/de4x5.txt>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module will
+         To compile this driver as a module, choose M here. The module will
          be called de4x5.
 
 config WINBOND_840
@@ -129,8 +126,7 @@ config DM9102
          (Ethernet) card, say Y.  Some information is contained in the file
          <file:Documentation/networking/dmfe.txt>.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module will
+         To compile this driver as a module, choose M here. The module will
          be called dmfe.
 
 config ULI526X
@@ -141,8 +137,7 @@ config ULI526X
          This driver is for ULi M5261/M5263 10/100M Ethernet Controller
          (<http://www.uli.com.tw/>).
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module will
+         To compile this driver as a module, choose M here. The module will
          be called uli526x.
          
 config PCMCIA_XIRCOM
@@ -154,8 +149,7 @@ config PCMCIA_XIRCOM
          as with work-alike chips from Lite-On (PNIC) and Macronix (MXIC) and
          ASIX.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module will
+         To compile this driver as a module, choose M here. The module will
          be called xircom_cb.  If unsure, say N.
 
 config PCMCIA_XIRTULIP
@@ -168,8 +162,7 @@ config PCMCIA_XIRTULIP
          as with work-alike chips from Lite-On (PNIC) and Macronix (MXIC) and
          ASIX.
 
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/networking/net-modules.txt>.  The module will
+         To compile this driver as a module, choose M here. The module will
          be called xircom_tulip_cb.  If unsure, say N.
 
 endif # NET_TULIP
index 9741d613ba6f4355a1a5ff791bac3007f1a60e59..a3ff270593f1e39d73681119dcfc7234f9f9b212 100644 (file)
@@ -2214,9 +2214,7 @@ static void ucc_geth_set_multi(struct net_device *dev)
        struct dev_mc_list *dmi;
        struct ucc_fast *uf_regs;
        struct ucc_geth_82xx_address_filtering_pram *p_82xx_addr_filt;
-       u8 tempaddr[6];
-       u8 *mcptr, *tdptr;
-       int i, j;
+       int i;
 
        ugeth = netdev_priv(dev);
 
@@ -2255,19 +2253,10 @@ static void ucc_geth_set_multi(struct net_device *dev)
                                if (!(dmi->dmi_addr[0] & 1))
                                        continue;
 
-                               /* The address in dmi_addr is LSB first,
-                                * and taddr is MSB first.  We have to
-                                * copy bytes MSB first from dmi_addr.
-                                */
-                               mcptr = (u8 *) dmi->dmi_addr + 5;
-                               tdptr = (u8 *) tempaddr;
-                               for (j = 0; j < 6; j++)
-                                       *tdptr++ = *mcptr--;
-
                                /* Ask CPM to run CRC and set bit in
                                 * filter mask.
                                 */
-                               hw_add_addr_in_hash(ugeth, tempaddr);
+                               hw_add_addr_in_hash(ugeth, dmi->dmi_addr);
                        }
                }
        }
index 5a96d74e4ce8b89a2d3e2c5b6276c5e2ce725030..a12c9c41b217e582b43a4a36b11d747821b5f6fe 100644 (file)
@@ -93,13 +93,9 @@ config USB_RTL8150
          To compile this driver as a module, choose M here: the
          module will be called rtl8150.
 
-config USB_USBNET_MII
-       tristate
-       default n
-
 config USB_USBNET
        tristate "Multi-purpose USB Networking Framework"
-       select MII if USB_USBNET_MII != n
+       select MII
        ---help---
          This driver supports several kinds of network links over USB,
          with "minidrivers" built around a common network driver core
@@ -135,7 +131,6 @@ config USB_NET_AX8817X
        tristate "ASIX AX88xxx Based USB 2.0 Ethernet Adapters"
        depends on USB_USBNET && NET_ETHERNET
        select CRC32
-       select USB_USBNET_MII
        default y
        help
          This option adds support for ASIX AX88xxx based USB 2.0
@@ -190,7 +185,6 @@ config USB_NET_DM9601
        tristate "Davicom DM9601 based USB 1.1 10/100 ethernet devices"
        depends on USB_USBNET
        select CRC32
-       select USB_USBNET_MII
        help
          This option adds support for Davicom DM9601 based USB 1.1
          10/100 Ethernet adapters.
@@ -225,7 +219,6 @@ config USB_NET_PLUSB
 config USB_NET_MCS7830
        tristate "MosChip MCS7830 based Ethernet adapters"
        depends on USB_USBNET
-       select USB_USBNET_MII
        help
          Choose this option if you're using a 10/100 Ethernet USB2
          adapter based on the MosChip 7830 controller. This includes
index a2de32fabc170a9a688750ce7f427f67f4e7a5e6..2c685734b7a4e36a988ad3f53553bdafda10c5ff 100644 (file)
@@ -586,6 +586,10 @@ static const struct usb_device_id products[] = {
         USB_DEVICE(0x0a46, 0x0268),    /* ShanTou ST268 USB NIC */
         .driver_info = (unsigned long)&dm9601_info,
         },
+       {
+        USB_DEVICE(0x0a46, 0x8515),    /* ADMtek ADM8515 USB NIC */
+        .driver_info = (unsigned long)&dm9601_info,
+        },
        {},                     // END
 };
 
index acd5f1c0e63a4c79eb4057d39a559ff20166b56a..8ed1fc5cbc7025127ec289b494f433e6545f7ed3 100644 (file)
@@ -683,9 +683,6 @@ done_nopm:
  * they'll probably want to use this base set.
  */
 
-#if defined(CONFIG_MII) || defined(CONFIG_MII_MODULE)
-#define HAVE_MII
-
 int usbnet_get_settings (struct net_device *net, struct ethtool_cmd *cmd)
 {
        struct usbnet *dev = netdev_priv(net);
@@ -744,8 +741,6 @@ int usbnet_nway_reset(struct net_device *net)
 }
 EXPORT_SYMBOL_GPL(usbnet_nway_reset);
 
-#endif /* HAVE_MII */
-
 void usbnet_get_drvinfo (struct net_device *net, struct ethtool_drvinfo *info)
 {
        struct usbnet *dev = netdev_priv(net);
@@ -776,12 +771,10 @@ EXPORT_SYMBOL_GPL(usbnet_set_msglevel);
 
 /* drivers may override default ethtool_ops in their bind() routine */
 static struct ethtool_ops usbnet_ethtool_ops = {
-#ifdef HAVE_MII
        .get_settings           = usbnet_get_settings,
        .set_settings           = usbnet_set_settings,
        .get_link               = usbnet_get_link,
        .nway_reset             = usbnet_nway_reset,
-#endif
        .get_drvinfo            = usbnet_get_drvinfo,
        .get_msglevel           = usbnet_get_msglevel,
        .set_msglevel           = usbnet_set_msglevel,
index 5c4a92de9a076b703fd63708a3793311d8a5cbd1..450e29d7a9f34118bc24455abcec788e596e9dff 100644 (file)
@@ -1963,6 +1963,11 @@ static int velocity_change_mtu(struct net_device *dev, int new_mtu)
                return -EINVAL;
        }
 
+       if (!netif_running(dev)) {
+               dev->mtu = new_mtu;
+               return 0;
+       }
+
        if (new_mtu != oldmtu) {
                spin_lock_irqsave(&vptr->lock, flags);
 
index e396c9d2af8d8a1aa9b9ca3d8b59a3577de7665f..5413dbf3d4ac25ab688bb1a965ccf981f230addc 100644 (file)
@@ -146,6 +146,7 @@ static void try_fill_recv(struct virtnet_info *vi)
        struct scatterlist sg[1+MAX_SKB_FRAGS];
        int num, err;
 
+       sg_init_table(sg, 1+MAX_SKB_FRAGS);
        for (;;) {
                skb = netdev_alloc_skb(vi->dev, MAX_PACKET_LEN);
                if (unlikely(!skb))
@@ -197,8 +198,8 @@ again:
        if (vi->num < vi->max / 2)
                try_fill_recv(vi);
 
-       /* All done? */
-       if (!skb) {
+       /* Out of packets? */
+       if (received < budget) {
                netif_rx_complete(vi->dev, napi);
                if (unlikely(!vi->rvq->vq_ops->restart(vi->rvq))
                    && netif_rx_reschedule(vi->dev, napi))
@@ -231,6 +232,8 @@ static int start_xmit(struct sk_buff *skb, struct net_device *dev)
        const unsigned char *dest = ((struct ethhdr *)skb->data)->h_dest;
        DECLARE_MAC_BUF(mac);
 
+       sg_init_table(sg, 1+MAX_SKB_FRAGS);
+
        pr_debug("%s: xmit %p %s\n", dev->name, skb, print_mac(mac, dest));
 
        free_old_xmit_skbs(vi);
@@ -401,8 +404,12 @@ free:
 
 static void virtnet_remove(struct virtio_device *vdev)
 {
-       unregister_netdev(vdev->priv);
-       free_netdev(vdev->priv);
+       struct virtnet_info *vi = vdev->priv;
+
+       vdev->config->del_vq(vi->svq);
+       vdev->config->del_vq(vi->rvq);
+       unregister_netdev(vi->dev);
+       free_netdev(vi->dev);
 }
 
 static struct virtio_device_id id_table[] = {
index 5ea877221f463c9dbb8c45b386a548a07464b435..37c52e1317504a5e1a7a0e87ca53a47c7daf697b 100644 (file)
@@ -142,9 +142,10 @@ int lmc_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) /*fold00*/
          * To date internally, just copy this out to the user.
          */
     case LMCIOCGINFO: /*fold01*/
-        if (copy_to_user(ifr->ifr_data, &sc->ictl, sizeof (lmc_ctl_t)))
-            return -EFAULT;
-        ret = 0;
+       if (copy_to_user(ifr->ifr_data, &sc->ictl, sizeof(lmc_ctl_t)))
+               ret = -EFAULT;
+       else
+               ret = 0;
         break;
 
     case LMCIOCSINFO: /*fold01*/
@@ -159,8 +160,10 @@ int lmc_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) /*fold00*/
             break;
         }
 
-        if (copy_from_user(&ctl, ifr->ifr_data, sizeof (lmc_ctl_t)))
-            return -EFAULT;
+       if (copy_from_user(&ctl, ifr->ifr_data, sizeof(lmc_ctl_t))) {
+               ret = -EFAULT;
+               break;
+       }
 
         sc->lmc_media->set_status (sc, &ctl);
 
@@ -190,8 +193,10 @@ int lmc_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) /*fold00*/
                break;
            }
 
-           if (copy_from_user(&new_type, ifr->ifr_data, sizeof(u_int16_t)))
-                return -EFAULT;
+           if (copy_from_user(&new_type, ifr->ifr_data, sizeof(u_int16_t))) {
+               ret = -EFAULT;
+               break;
+           }
 
             
            if (new_type == old_type)
@@ -229,9 +234,10 @@ int lmc_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) /*fold00*/
         sc->lmc_xinfo.Magic1 = 0xDEADBEEF;
 
         if (copy_to_user(ifr->ifr_data, &sc->lmc_xinfo,
-                         sizeof (struct lmc_xinfo)))
-            return -EFAULT;
-        ret = 0;
+                        sizeof(struct lmc_xinfo)))
+               ret = -EFAULT;
+       else
+               ret = 0;
 
         break;
 
@@ -262,9 +268,9 @@ int lmc_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) /*fold00*/
 
         if (copy_to_user(ifr->ifr_data, &sc->stats,
                          sizeof (struct lmc_statistics)))
-            return -EFAULT;
-
-        ret = 0;
+               ret = -EFAULT;
+       else
+               ret = 0;
         break;
 
     case LMCIOCCLEARLMCSTATS: /*fold01*/
@@ -292,8 +298,10 @@ int lmc_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) /*fold00*/
             break;
         }
 
-        if (copy_from_user(&ctl, ifr->ifr_data, sizeof (lmc_ctl_t)))
-            return -EFAULT;
+       if (copy_from_user(&ctl, ifr->ifr_data, sizeof(lmc_ctl_t))) {
+               ret = -EFAULT;
+               break;
+       }
         sc->lmc_media->set_circuit_type(sc, ctl.circuit_type);
         sc->ictl.circuit_type = ctl.circuit_type;
         ret = 0;
@@ -318,12 +326,15 @@ int lmc_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) /*fold00*/
 
 #ifdef DEBUG
     case LMCIOCDUMPEVENTLOG:
-        if (copy_to_user(ifr->ifr_data, &lmcEventLogIndex, sizeof (u32)))
-            return -EFAULT;
+       if (copy_to_user(ifr->ifr_data, &lmcEventLogIndex, sizeof(u32))) {
+               ret = -EFAULT;
+               break;
+       }
         if (copy_to_user(ifr->ifr_data + sizeof (u32), lmcEventLogBuf, sizeof (lmcEventLogBuf)))
-            return -EFAULT;
+               ret = -EFAULT;
+       else
+               ret = 0;
 
-        ret = 0;
         break;
 #endif /* end ifdef _DBG_EVENTLOG */
     case LMCIOCT1CONTROL: /*fold01*/
@@ -346,8 +357,10 @@ int lmc_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) /*fold00*/
              */
             netif_stop_queue(dev);
 
-            if (copy_from_user(&xc, ifr->ifr_data, sizeof (struct lmc_xilinx_control)))
-                return -EFAULT;
+       if (copy_from_user(&xc, ifr->ifr_data, sizeof(struct lmc_xilinx_control))) {
+               ret = -EFAULT;
+               break;
+       }
             switch(xc.command){
             case lmc_xilinx_reset: /*fold02*/
                 {
index c48b1cc63fd59d1865d290a9ee0520fb577a9d04..1e89d4de1bb7de00299dab3d4c2792b573ab87f8 100644 (file)
@@ -719,12 +719,8 @@ static int x25_asy_ioctl(struct tty_struct *tty, struct file *file,
                return 0;
        case SIOCSIFHWADDR:
                return -EINVAL;
-       /* Allow stty to read, but not set, the serial port */
-       case TCGETS:
-       case TCGETA:
-               return n_tty_ioctl(tty, file, cmd, arg);
        default:
-               return -ENOIOCTLCMD;
+               return tty_mode_ioctl(tty, file, cmd, arg);
        }
 }
 
index dae5c8d5a318d96bbd8f4be0603eec001570b5d5..2b733c5829152e37c78aee1ba069d86f0d3f22e6 100644 (file)
@@ -325,7 +325,7 @@ config HERMES
          Cabletron/EnteraSys Roamabout, ELSA AirLancer, MELCO Buffalo, Avaya,
          IBM High Rate Wireless, Farralon Syyline, Samsung MagicLAN, Netgear
          MA401, LinkSys WPC-11, D-Link DWL-650, 3Com AirConnect, Intel
-         PRO/Wireless, and Symbol Spectrum24 High Rate amongst others.
+         IPW2011, and Symbol Spectrum24 High Rate amongst others.
 
          This option includes the guts of the driver, but in order to
          actually use a card you will also need to enable support for PCMCIA
index e3c573e56b6368b72cf25751df30016b1ece3a6b..fdbc351ac333fa8fe61a2134f4e30f221084274b 100644 (file)
@@ -61,16 +61,18 @@ config B43_PCMCIA
 
          If unsure, say N.
 
-# LED support
+# This config option automatically enables b43 LEDS support,
+# if it's possible.
 config B43_LEDS
        bool
-       depends on B43 && MAC80211_LEDS
+       depends on B43 && MAC80211_LEDS && (LEDS_CLASS = y || LEDS_CLASS = B43)
        default y
 
-# RFKILL support
+# This config option automatically enables b43 RFKILL support,
+# if it's possible.
 config B43_RFKILL
        bool
-       depends on B43 && RFKILL && RFKILL_INPUT && INPUT_POLLDEV
+       depends on B43 && (RFKILL = y || RFKILL = B43) && RFKILL_INPUT && (INPUT_POLLDEV = y || INPUT_POLLDEV = B43)
        default y
 
 config B43_DEBUG
index 734e70e1a06d557411b0273d24cf3399d1c6f6be..ef0075d9f9cb81b323425baf56b18fd5523ac067 100644 (file)
@@ -128,7 +128,7 @@ static ssize_t shm_read_file(struct b43_wldev *dev,
        __le16 *le16buf = (__le16 *)buf;
 
        for (i = 0; i < 0x1000; i++) {
-               if (bufsize <= 0)
+               if (bufsize < sizeof(tmp))
                        break;
                tmp = b43_shm_read16(dev, B43_SHM_SHARED, 2 * i);
                le16buf[i] = cpu_to_le16(tmp);
index 9d9ff76a9bc664a85191610034ad2640750cca4c..2b17c1dc46f1e69e30535a74f6b69ed5053ea9a4 100644 (file)
@@ -2391,7 +2391,7 @@ out_requeue:
        if (b43_debug(dev, B43_DBG_PWORK_FAST))
                delay = msecs_to_jiffies(50);
        else
-               delay = round_jiffies(HZ * 15);
+               delay = round_jiffies_relative(HZ * 15);
        queue_delayed_work(wl->hw->workqueue, &dev->periodic_work, delay);
 out:
        mutex_unlock(&wl->mutex);
@@ -2985,6 +2985,16 @@ static void b43_wireless_core_stop(struct b43_wldev *dev)
 
        if (b43_status(dev) < B43_STAT_STARTED)
                return;
+
+       /* Disable and sync interrupts. We must do this before than
+        * setting the status to INITIALIZED, as the interrupt handler
+        * won't care about IRQs then. */
+       spin_lock_irqsave(&wl->irq_lock, flags);
+       dev->irq_savedstate = b43_interrupt_disable(dev, B43_IRQ_ALL);
+       b43_read32(dev, B43_MMIO_GEN_IRQ_MASK); /* flush */
+       spin_unlock_irqrestore(&wl->irq_lock, flags);
+       b43_synchronize_irq(dev);
+
        b43_set_status(dev, B43_STAT_INITIALIZED);
 
        mutex_unlock(&wl->mutex);
@@ -2995,13 +3005,6 @@ static void b43_wireless_core_stop(struct b43_wldev *dev)
 
        ieee80211_stop_queues(wl->hw);  //FIXME this could cause a deadlock, as mac80211 seems buggy.
 
-       /* Disable and sync interrupts. */
-       spin_lock_irqsave(&wl->irq_lock, flags);
-       dev->irq_savedstate = b43_interrupt_disable(dev, B43_IRQ_ALL);
-       b43_read32(dev, B43_MMIO_GEN_IRQ_MASK); /* flush */
-       spin_unlock_irqrestore(&wl->irq_lock, flags);
-       b43_synchronize_irq(dev);
-
        b43_mac_suspend(dev);
        free_irq(dev->dev->irq, dev);
        b43dbg(wl, "Wireless interface stopped\n");
@@ -3661,7 +3664,6 @@ static int b43_setup_modes(struct b43_wldev *dev,
 
 static void b43_wireless_core_detach(struct b43_wldev *dev)
 {
-       b43_rfkill_free(dev);
        /* We release firmware that late to not be required to re-request
         * is all the time when we reinit the core. */
        b43_release_firmware(dev);
@@ -3747,7 +3749,6 @@ static int b43_wireless_core_attach(struct b43_wldev *dev)
        if (!wl->current_dev)
                wl->current_dev = dev;
        INIT_WORK(&dev->restart_work, b43_chip_reset);
-       b43_rfkill_alloc(dev);
 
        b43_radio_turn_off(dev, 1);
        b43_switch_analog(dev, 0);
index b242a9a90dd2309d0f0f8b95de5dd64ab1c6e015..b79a6bd5396d8a050d3f69f4fe8a215e0376825c 100644 (file)
@@ -65,12 +65,12 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev)
        tuple_t tuple;
        cisparse_t parse;
        int err = -ENOMEM;
-       int res;
+       int res = 0;
        unsigned char buf[64];
 
        ssb = kzalloc(sizeof(*ssb), GFP_KERNEL);
        if (!ssb)
-               goto out;
+               goto out_error;
 
        err = -ENODEV;
        tuple.DesiredTuple = CISTPL_CONFIG;
@@ -96,10 +96,12 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev)
        dev->io.NumPorts2 = 0;
        dev->io.Attributes2 = 0;
 
-       win.Attributes = WIN_MEMORY_TYPE_CM | WIN_ENABLE | WIN_USE_WAIT;
+       win.Attributes = WIN_ADDR_SPACE_MEM | WIN_MEMORY_TYPE_CM |
+                        WIN_ENABLE | WIN_DATA_WIDTH_16 |
+                        WIN_USE_WAIT;
        win.Base = 0;
        win.Size = SSB_CORE_SIZE;
-       win.AccessSpeed = 1000;
+       win.AccessSpeed = 250;
        res = pcmcia_request_window(&dev, &win, &dev->win);
        if (res != CS_SUCCESS)
                goto err_kfree_ssb;
@@ -108,21 +110,34 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev)
        mem.Page = 0;
        res = pcmcia_map_mem_page(dev->win, &mem);
        if (res != CS_SUCCESS)
-               goto err_kfree_ssb;
+               goto err_disable;
+
+       dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_FIRST_SHARED;
+       dev->irq.IRQInfo1 = IRQ_LEVEL_ID | IRQ_SHARE_ID;
+       dev->irq.Handler = NULL; /* The handler is registered later. */
+       dev->irq.Instance = NULL;
+       res = pcmcia_request_irq(dev, &dev->irq);
+       if (res != CS_SUCCESS)
+               goto err_disable;
 
        res = pcmcia_request_configuration(dev, &dev->conf);
        if (res != CS_SUCCESS)
                goto err_disable;
 
        err = ssb_bus_pcmciabus_register(ssb, dev, win.Base);
+       if (err)
+               goto err_disable;
        dev->priv = ssb;
 
-      out:
-       return err;
-      err_disable:
+       return 0;
+
+err_disable:
        pcmcia_disable_device(dev);
-      err_kfree_ssb:
+err_kfree_ssb:
        kfree(ssb);
+out_error:
+       printk(KERN_ERR "b43-pcmcia: Initialization failed (%d, %d)\n",
+              res, err);
        return err;
 }
 
@@ -131,22 +146,21 @@ static void __devexit b43_pcmcia_remove(struct pcmcia_device *dev)
        struct ssb_bus *ssb = dev->priv;
 
        ssb_bus_unregister(ssb);
-       pcmcia_release_window(dev->win);
        pcmcia_disable_device(dev);
        kfree(ssb);
        dev->priv = NULL;
 }
 
 static struct pcmcia_driver b43_pcmcia_driver = {
-       .owner = THIS_MODULE,
-       .drv = {
-               .name = "b43-pcmcia",
-               },
-       .id_table = b43_pcmcia_tbl,
-       .probe = b43_pcmcia_probe,
-       .remove = b43_pcmcia_remove,
-       .suspend = b43_pcmcia_suspend,
-       .resume = b43_pcmcia_resume,
+       .owner          = THIS_MODULE,
+       .drv            = {
+                               .name = "b43-pcmcia",
+                       },
+       .id_table       = b43_pcmcia_tbl,
+       .probe          = b43_pcmcia_probe,
+       .remove         = __devexit_p(b43_pcmcia_remove),
+       .suspend        = b43_pcmcia_suspend,
+       .resume         = b43_pcmcia_resume,
 };
 
 int b43_pcmcia_init(void)
index 800e0a61a7f589f1f649b7f6417cf6488267f4d5..9b1f905ffbf4a7a1c61b9b5f4d2463cac78719c7 100644 (file)
@@ -47,32 +47,35 @@ static void b43_rfkill_poll(struct input_polled_dev *poll_dev)
        struct b43_wldev *dev = poll_dev->private;
        struct b43_wl *wl = dev->wl;
        bool enabled;
+       bool report_change = 0;
 
        mutex_lock(&wl->mutex);
        B43_WARN_ON(b43_status(dev) < B43_STAT_INITIALIZED);
        enabled = b43_is_hw_radio_enabled(dev);
        if (unlikely(enabled != dev->radio_hw_enable)) {
                dev->radio_hw_enable = enabled;
+               report_change = 1;
                b43info(wl, "Radio hardware status changed to %s\n",
                        enabled ? "ENABLED" : "DISABLED");
-               mutex_unlock(&wl->mutex);
+       }
+       mutex_unlock(&wl->mutex);
+
+       if (unlikely(report_change))
                input_report_key(poll_dev->input, KEY_WLAN, enabled);
-       } else
-               mutex_unlock(&wl->mutex);
 }
 
-/* Called when the RFKILL toggled in software.
- * This is called without locking. */
+/* Called when the RFKILL toggled in software. */
 static int b43_rfkill_soft_toggle(void *data, enum rfkill_state state)
 {
        struct b43_wldev *dev = data;
        struct b43_wl *wl = dev->wl;
        int err = 0;
 
-       mutex_lock(&wl->mutex);
-       if (b43_status(dev) < B43_STAT_INITIALIZED)
-               goto out_unlock;
+       if (!wl->rfkill.registered)
+               return 0;
 
+       mutex_lock(&wl->mutex);
+       B43_WARN_ON(b43_status(dev) < B43_STAT_INITIALIZED);
        switch (state) {
        case RFKILL_STATE_ON:
                if (!dev->radio_hw_enable) {
@@ -89,7 +92,6 @@ static int b43_rfkill_soft_toggle(void *data, enum rfkill_state state)
                        b43_radio_turn_off(dev, 0);
                break;
        }
-
 out_unlock:
        mutex_unlock(&wl->mutex);
 
@@ -98,11 +100,11 @@ out_unlock:
 
 char * b43_rfkill_led_name(struct b43_wldev *dev)
 {
-       struct b43_wl *wl = dev->wl;
+       struct b43_rfkill *rfk = &(dev->wl->rfkill);
 
-       if (!wl->rfkill.rfkill)
+       if (!rfk->registered)
                return NULL;
-       return rfkill_get_led_name(wl->rfkill.rfkill);
+       return rfkill_get_led_name(rfk->rfkill);
 }
 
 void b43_rfkill_init(struct b43_wldev *dev)
@@ -111,53 +113,13 @@ void b43_rfkill_init(struct b43_wldev *dev)
        struct b43_rfkill *rfk = &(wl->rfkill);
        int err;
 
-       if (rfk->rfkill) {
-               err = rfkill_register(rfk->rfkill);
-               if (err) {
-                       b43warn(wl, "Failed to register RF-kill button\n");
-                       goto err_free_rfk;
-               }
-       }
-       if (rfk->poll_dev) {
-               err = input_register_polled_device(rfk->poll_dev);
-               if (err) {
-                       b43warn(wl, "Failed to register RF-kill polldev\n");
-                       goto err_free_polldev;
-               }
-       }
-
-       return;
-err_free_rfk:
-       rfkill_free(rfk->rfkill);
-       rfk->rfkill = NULL;
-err_free_polldev:
-       input_free_polled_device(rfk->poll_dev);
-       rfk->poll_dev = NULL;
-}
-
-void b43_rfkill_exit(struct b43_wldev *dev)
-{
-       struct b43_rfkill *rfk = &(dev->wl->rfkill);
-
-       if (rfk->poll_dev)
-               input_unregister_polled_device(rfk->poll_dev);
-       if (rfk->rfkill)
-               rfkill_unregister(rfk->rfkill);
-}
-
-void b43_rfkill_alloc(struct b43_wldev *dev)
-{
-       struct b43_wl *wl = dev->wl;
-       struct b43_rfkill *rfk = &(wl->rfkill);
+       rfk->registered = 0;
 
+       rfk->rfkill = rfkill_allocate(dev->dev->dev, RFKILL_TYPE_WLAN);
+       if (!rfk->rfkill)
+               goto out_error;
        snprintf(rfk->name, sizeof(rfk->name),
                 "b43-%s", wiphy_name(wl->hw->wiphy));
-
-       rfk->rfkill = rfkill_allocate(dev->dev->dev, RFKILL_TYPE_WLAN);
-       if (!rfk->rfkill) {
-               b43warn(wl, "Failed to allocate RF-kill button\n");
-               return;
-       }
        rfk->rfkill->name = rfk->name;
        rfk->rfkill->state = RFKILL_STATE_ON;
        rfk->rfkill->data = dev;
@@ -165,18 +127,45 @@ void b43_rfkill_alloc(struct b43_wldev *dev)
        rfk->rfkill->user_claim_unsupported = 1;
 
        rfk->poll_dev = input_allocate_polled_device();
-       if (rfk->poll_dev) {
-               rfk->poll_dev->private = dev;
-               rfk->poll_dev->poll = b43_rfkill_poll;
-               rfk->poll_dev->poll_interval = 1000; /* msecs */
-       } else
-               b43warn(wl, "Failed to allocate RF-kill polldev\n");
+       if (!rfk->poll_dev)
+               goto err_free_rfk;
+       rfk->poll_dev->private = dev;
+       rfk->poll_dev->poll = b43_rfkill_poll;
+       rfk->poll_dev->poll_interval = 1000; /* msecs */
+
+       err = rfkill_register(rfk->rfkill);
+       if (err)
+               goto err_free_polldev;
+       err = input_register_polled_device(rfk->poll_dev);
+       if (err)
+               goto err_unreg_rfk;
+
+       rfk->registered = 1;
+
+       return;
+err_unreg_rfk:
+       rfkill_unregister(rfk->rfkill);
+err_free_polldev:
+       input_free_polled_device(rfk->poll_dev);
+       rfk->poll_dev = NULL;
+err_free_rfk:
+       rfkill_free(rfk->rfkill);
+       rfk->rfkill = NULL;
+out_error:
+       rfk->registered = 0;
+       b43warn(wl, "RF-kill button init failed\n");
 }
 
-void b43_rfkill_free(struct b43_wldev *dev)
+void b43_rfkill_exit(struct b43_wldev *dev)
 {
        struct b43_rfkill *rfk = &(dev->wl->rfkill);
 
+       if (!rfk->registered)
+               return;
+       rfk->registered = 0;
+
+       input_unregister_polled_device(rfk->poll_dev);
+       rfkill_unregister(rfk->rfkill);
        input_free_polled_device(rfk->poll_dev);
        rfk->poll_dev = NULL;
        rfkill_free(rfk->rfkill);
index 29544e8c9e5f41e45878fda6d80941aaa264f0dd..adacf936d815be2170b973da1cbb997fff7b974b 100644 (file)
@@ -15,14 +15,14 @@ struct b43_rfkill {
        struct rfkill *rfkill;
        /* The poll device for the RFKILL input button */
        struct input_polled_dev *poll_dev;
+       /* Did initialization succeed? Used for freeing. */
+       bool registered;
        /* The unique name of this rfkill switch */
-       char name[32];
+       char name[sizeof("b43-phy4294967295")];
 };
 
-/* All the init functions return void, because we are not interested
+/* The init function returns void, because we are not interested
  * in failing the b43 init process when rfkill init failed. */
-void b43_rfkill_alloc(struct b43_wldev *dev);
-void b43_rfkill_free(struct b43_wldev *dev);
 void b43_rfkill_init(struct b43_wldev *dev);
 void b43_rfkill_exit(struct b43_wldev *dev);
 
@@ -36,12 +36,6 @@ struct b43_rfkill {
        /* empty */
 };
 
-static inline void b43_rfkill_alloc(struct b43_wldev *dev)
-{
-}
-static inline void b43_rfkill_free(struct b43_wldev *dev)
-{
-}
 static inline void b43_rfkill_init(struct b43_wldev *dev)
 {
 }
index eefa6fb79685d3b5f2c20eb0d312cc05220f66fe..619b4534ef09b24a9c1512106c2002c83ad7354e 100644 (file)
@@ -124,7 +124,7 @@ static ssize_t shm_read_file(struct b43legacy_wldev *dev, char *buf, size_t bufs
        __le16 *le16buf = (__le16 *)buf;
 
        for (i = 0; i < 0x1000; i++) {
-               if (bufsize <= 0)
+               if (bufsize < sizeof(tmp))
                        break;
                tmp = b43legacy_shm_read16(dev, B43legacy_SHM_SHARED, 2 * i);
                le16buf[i] = cpu_to_le16(tmp);
index d09479e816cdf12b79658cc8ebce0586cfd18d74..3bde1e9ab4282e00b34353da4185923a4d0fdacc 100644 (file)
@@ -2260,7 +2260,7 @@ out_requeue:
        if (b43legacy_debug(dev, B43legacy_DBG_PWORK_FAST))
                delay = msecs_to_jiffies(50);
        else
-               delay = round_jiffies(HZ);
+               delay = round_jiffies_relative(HZ);
        queue_delayed_work(dev->wl->hw->workqueue,
                           &dev->periodic_work, delay);
 out:
@@ -2781,6 +2781,17 @@ static void b43legacy_wireless_core_stop(struct b43legacy_wldev *dev)
 
        if (b43legacy_status(dev) < B43legacy_STAT_STARTED)
                return;
+
+       /* Disable and sync interrupts. We must do this before than
+        * setting the status to INITIALIZED, as the interrupt handler
+        * won't care about IRQs then. */
+       spin_lock_irqsave(&wl->irq_lock, flags);
+       dev->irq_savedstate = b43legacy_interrupt_disable(dev,
+                                                         B43legacy_IRQ_ALL);
+       b43legacy_read32(dev, B43legacy_MMIO_GEN_IRQ_MASK); /* flush */
+       spin_unlock_irqrestore(&wl->irq_lock, flags);
+       b43legacy_synchronize_irq(dev);
+
        b43legacy_set_status(dev, B43legacy_STAT_INITIALIZED);
 
        mutex_unlock(&wl->mutex);
@@ -2791,14 +2802,6 @@ static void b43legacy_wireless_core_stop(struct b43legacy_wldev *dev)
 
        ieee80211_stop_queues(wl->hw); /* FIXME this could cause a deadlock */
 
-       /* Disable and sync interrupts. */
-       spin_lock_irqsave(&wl->irq_lock, flags);
-       dev->irq_savedstate = b43legacy_interrupt_disable(dev,
-                                                         B43legacy_IRQ_ALL);
-       b43legacy_read32(dev, B43legacy_MMIO_GEN_IRQ_MASK); /* flush */
-       spin_unlock_irqrestore(&wl->irq_lock, flags);
-       b43legacy_synchronize_irq(dev);
-
        b43legacy_mac_suspend(dev);
        free_irq(dev->dev->irq, dev);
        b43legacydbg(wl, "Wireless interface stopped\n");
@@ -3332,7 +3335,7 @@ out_mutex_unlock:
        return err;
 }
 
-void b43legacy_stop(struct ieee80211_hw *hw)
+static void b43legacy_stop(struct ieee80211_hw *hw)
 {
        struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw);
        struct b43legacy_wldev *dev = wl->current_dev;
index 7da3664b85156a2541728f2f68ce82d887267d0f..fc876ba185721533649f6fa3a31565afdd7e117c 100644 (file)
@@ -444,7 +444,7 @@ static int prism2_pci_resume(struct pci_dev *pdev)
 
 MODULE_DEVICE_TABLE(pci, prism2_pci_id_table);
 
-static struct pci_driver prism2_pci_drv_id = {
+static struct pci_driver prism2_pci_driver = {
        .name           = "hostap_pci",
        .id_table       = prism2_pci_id_table,
        .probe          = prism2_pci_probe,
@@ -458,13 +458,13 @@ static struct pci_driver prism2_pci_drv_id = {
 
 static int __init init_prism2_pci(void)
 {
-       return pci_register_driver(&prism2_pci_drv_id);
+       return pci_register_driver(&prism2_pci_driver);
 }
 
 
 static void __exit exit_prism2_pci(void)
 {
-       pci_unregister_driver(&prism2_pci_drv_id);
+       pci_unregister_driver(&prism2_pci_driver);
 }
 
 
index a6c7904de2828c48c4886624ced3df1ebb1238cc..fc6cdd8086c1b2c49da2d7857682cda1870ee3e1 100644 (file)
@@ -1267,7 +1267,7 @@ static int ipw2100_start_adapter(struct ipw2100_priv *priv)
                                       IPW2100_INTA_FATAL_ERROR |
                                       IPW2100_INTA_PARITY_ERROR);
                }
-       } while (i--);
+       } while (--i);
 
        /* Clear out any pending INTAs since we aren't supposed to have
         * interrupts enabled at this point... */
@@ -1339,7 +1339,7 @@ static int ipw2100_power_cycle_adapter(struct ipw2100_priv *priv)
 
                if (reg & IPW_AUX_HOST_RESET_REG_MASTER_DISABLED)
                        break;
-       } while (i--);
+       } while (--i);
 
        priv->status &= ~STATUS_RESET_PENDING;
 
@@ -1769,7 +1769,7 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred)
                if (priv->stop_rf_kill) {
                        priv->stop_rf_kill = 0;
                        queue_delayed_work(priv->workqueue, &priv->rf_kill,
-                                          round_jiffies(HZ));
+                                          round_jiffies_relative(HZ));
                }
 
                deferred = 1;
@@ -2086,7 +2086,8 @@ static void isr_indicate_rf_kill(struct ipw2100_priv *priv, u32 status)
        /* Make sure the RF Kill check timer is running */
        priv->stop_rf_kill = 0;
        cancel_delayed_work(&priv->rf_kill);
-       queue_delayed_work(priv->workqueue, &priv->rf_kill, round_jiffies(HZ));
+       queue_delayed_work(priv->workqueue, &priv->rf_kill,
+                          round_jiffies_relative(HZ));
 }
 
 static void send_scan_event(void *data)
@@ -2123,7 +2124,7 @@ static void isr_scan_complete(struct ipw2100_priv *priv, u32 status)
                if (!delayed_work_pending(&priv->scan_event_later))
                        queue_delayed_work(priv->workqueue,
                                        &priv->scan_event_later,
-                                       round_jiffies(msecs_to_jiffies(4000)));
+                                       round_jiffies_relative(msecs_to_jiffies(4000)));
        } else {
                priv->user_requested_scan = 0;
                cancel_delayed_work(&priv->scan_event_later);
@@ -4242,7 +4243,7 @@ static int ipw_radio_kill_sw(struct ipw2100_priv *priv, int disable_radio)
                        priv->stop_rf_kill = 0;
                        cancel_delayed_work(&priv->rf_kill);
                        queue_delayed_work(priv->workqueue, &priv->rf_kill,
-                                          round_jiffies(HZ));
+                                          round_jiffies_relative(HZ));
                } else
                        schedule_reset(priv);
        }
@@ -5981,7 +5982,7 @@ static void ipw2100_rf_kill(struct work_struct *work)
                IPW_DEBUG_RF_KILL("RF Kill active, rescheduling GPIO check\n");
                if (!priv->stop_rf_kill)
                        queue_delayed_work(priv->workqueue, &priv->rf_kill,
-                                          round_jiffies(HZ));
+                                          round_jiffies_relative(HZ));
                goto exit_unlock;
        }
 
index e3c828401b9aa5d1ec9e0d7090203530fef46f92..54f44e5473c0cf427cb276a1d67ef1f9a168b258 100644 (file)
@@ -1753,7 +1753,7 @@ static int ipw_radio_kill_sw(struct ipw_priv *priv, int disable_radio)
                        /* Make sure the RF_KILL check timer is running */
                        cancel_delayed_work(&priv->rf_kill);
                        queue_delayed_work(priv->workqueue, &priv->rf_kill,
-                                          round_jiffies(2 * HZ));
+                                          round_jiffies_relative(2 * HZ));
                } else
                        queue_work(priv->workqueue, &priv->up);
        }
@@ -4364,7 +4364,7 @@ static void handle_scan_event(struct ipw_priv *priv)
        if (!priv->user_requested_scan) {
                if (!delayed_work_pending(&priv->scan_event))
                        queue_delayed_work(priv->workqueue, &priv->scan_event,
-                                        round_jiffies(msecs_to_jiffies(4000)));
+                                        round_jiffies_relative(msecs_to_jiffies(4000)));
        } else {
                union iwreq_data wrqu;
 
@@ -4728,7 +4728,7 @@ static void ipw_rx_notification(struct ipw_priv *priv,
                                 && priv->status & STATUS_ASSOCIATED)
                                queue_delayed_work(priv->workqueue,
                                                   &priv->request_scan,
-                                                  round_jiffies(HZ));
+                                                  round_jiffies_relative(HZ));
 
                        /* Send an empty event to user space.
                         * We don't send the received data on the event because
index 25cfc6c32509f8e71544516c00d715938b3efbd2..8d52a26c248ae72ffe1a10249da91bb00338b442 100644 (file)
@@ -96,8 +96,8 @@ config IWL4965
 
          If you want to compile the driver as a module ( = code which can be
          inserted in and remvoed from the running kernel whenever you want),
-         say M here and read <file:Documentation/modules.txt>.  The module
-         will be called iwl4965.ko.
+         say M here and read <file:Documentation/kbuild/modules.txt>.  The
+         module will be called iwl4965.ko.
 
 config IWL3945
        tristate "Intel PRO/Wireless 3945ABG/BG Network Connection"
@@ -124,5 +124,5 @@ config IWL3945
 
          If you want to compile the driver as a module ( = code which can be
          inserted in and remvoed from the running kernel whenever you want),
-         say M here and read <file:Documentation/modules.txt>.  The module
-         will be called iwl3945.ko.
+         say M here and read <file:Documentation/kbuild/modules.txt>.  The
+         module will be called iwl3945.ko.
index 262ab0b55824d907048d1081db1a473ad02d4852..c48b1b537d2b412fa5ccbc8cf1f156e911d44908 100644 (file)
@@ -71,19 +71,19 @@ struct iwl_rate_scale_priv {
 };
 
 static s32 iwl_expected_tpt_g[IWL_RATE_COUNT] = {
-       0, 0, 76, 104, 130, 168, 191, 202, 7, 13, 35, 58
+       7, 13, 35, 58, 0, 0, 76, 104, 130, 168, 191, 202
 };
 
 static s32 iwl_expected_tpt_g_prot[IWL_RATE_COUNT] = {
-       0, 0, 0, 80, 93, 113, 123, 125, 7, 13, 35, 58
+       7, 13, 35, 58, 0, 0, 0, 80, 93, 113, 123, 125
 };
 
 static s32 iwl_expected_tpt_a[IWL_RATE_COUNT] = {
-       40, 57, 72, 98, 121, 154, 177, 186, 0, 0, 0, 0
+       0, 0, 0, 0, 40, 57, 72, 98, 121, 154, 177, 186
 };
 
 static s32 iwl_expected_tpt_b[IWL_RATE_COUNT] = {
-       0, 0, 0, 0, 0, 0, 0, 0, 7, 13, 35, 58
+       7, 13, 35, 58, 0, 0, 0, 0, 0, 0, 0, 0
 };
 
 struct iwl_tpt_entry {
@@ -350,6 +350,10 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,
 
        sta->last_txrate = sta->txrate;
 
+       /* For MODE_IEEE80211A mode it start at IWL_FIRST_OFDM_RATE */
+        if (local->hw.conf.phymode == MODE_IEEE80211A)
+                sta->last_txrate += IWL_FIRST_OFDM_RATE;
+
        IWL_DEBUG_RATE("leave\n");
 }
 
@@ -417,6 +421,33 @@ static void rs_free_sta(void *priv, void *priv_sta)
        IWL_DEBUG_RATE("leave\n");
 }
 
+
+/*
+ * get ieee prev rate from rate scale table.
+ * for A and B mode we need to overright prev
+ * value
+ */
+static int rs_adjust_next_rate(struct iwl_priv *priv, int rate)
+{
+       int next_rate = iwl_get_prev_ieee_rate(rate);
+
+       switch (priv->phymode) {
+       case MODE_IEEE80211A:
+               if (rate == IWL_RATE_12M_INDEX)
+                       next_rate = IWL_RATE_9M_INDEX;
+               else if (rate == IWL_RATE_6M_INDEX)
+                       next_rate = IWL_RATE_6M_INDEX;
+               break;
+       case MODE_IEEE80211B:
+               if (rate == IWL_RATE_11M_INDEX_TABLE)
+                       next_rate = IWL_RATE_5M_INDEX_TABLE;
+               break;
+       default:
+               break;
+       }
+
+       return next_rate;
+}
 /**
  * rs_tx_status - Update rate control values based on Tx results
  *
@@ -479,7 +510,8 @@ static void rs_tx_status(void *priv_rate,
                        last_index = scale_rate_index;
                } else {
                        current_count = priv->retry_rate;
-                       last_index = iwl_get_prev_ieee_rate(scale_rate_index);
+                       last_index = rs_adjust_next_rate(priv,
+                                                        scale_rate_index);
                }
 
                /* Update this rate accounting for as many retries
@@ -494,9 +526,10 @@ static void rs_tx_status(void *priv_rate,
 
                if (retries)
                        scale_rate_index =
-                           iwl_get_prev_ieee_rate(scale_rate_index);
+                           rs_adjust_next_rate(priv, scale_rate_index);
        }
 
+
        /* Update the last index window with success/failure based on ACK */
        IWL_DEBUG_RATE("Update rate %d with %s.\n",
                       last_index,
@@ -672,7 +705,10 @@ static struct ieee80211_rate *rs_get_rate(void *priv_rate,
        }
 
        rate_mask = sta->supp_rates;
-       index = min(sta->txrate & 0xffff, IWL_RATE_COUNT - 1);
+       index = min(sta->last_txrate & 0xffff, IWL_RATE_COUNT - 1);
+
+       if (priv->phymode == (u8) MODE_IEEE80211A)
+               rate_mask = rate_mask << IWL_FIRST_OFDM_RATE;
 
        rs_priv = (void *)sta->rate_ctrl_priv;
 
@@ -801,7 +837,11 @@ static struct ieee80211_rate *rs_get_rate(void *priv_rate,
  out:
 
        sta->last_txrate = index;
-       sta->txrate = sta->last_txrate;
+       if (priv->phymode == (u8) MODE_IEEE80211A)
+               sta->txrate = sta->last_txrate - IWL_FIRST_OFDM_RATE;
+       else
+               sta->txrate = sta->last_txrate;
+
        sta_info_put(sta);
 
        IWL_DEBUG_RATE("leave: %d\n", index);
index b926738e0ea1b8725356e875d4a90f4c4972d44a..bec4d3ffca1d033c36e0888108c365777821da4b 100644 (file)
@@ -36,10 +36,17 @@ struct iwl_rate_info {
        u8 next_rs;             /* next rate used in rs algo */
        u8 prev_rs_tgg;         /* previous rate used in TGG rs algo */
        u8 next_rs_tgg;         /* next rate used in TGG rs algo */
+        u8 table_rs_index;     /* index in rate scale table cmd */
+        u8 prev_table_rs;      /* prev in rate table cmd */
+
 };
 
 enum {
-       IWL_RATE_6M_INDEX = 0,
+       IWL_RATE_1M_INDEX = 0,
+       IWL_RATE_2M_INDEX,
+       IWL_RATE_5M_INDEX,
+       IWL_RATE_11M_INDEX,
+       IWL_RATE_6M_INDEX,
        IWL_RATE_9M_INDEX,
        IWL_RATE_12M_INDEX,
        IWL_RATE_18M_INDEX,
@@ -47,15 +54,27 @@ enum {
        IWL_RATE_36M_INDEX,
        IWL_RATE_48M_INDEX,
        IWL_RATE_54M_INDEX,
-       IWL_RATE_1M_INDEX,
-       IWL_RATE_2M_INDEX,
-       IWL_RATE_5M_INDEX,
-       IWL_RATE_11M_INDEX,
        IWL_RATE_COUNT,
        IWL_RATE_INVM_INDEX,
        IWL_RATE_INVALID = IWL_RATE_INVM_INDEX
 };
 
+enum {
+       IWL_RATE_6M_INDEX_TABLE = 0,
+       IWL_RATE_9M_INDEX_TABLE,
+       IWL_RATE_12M_INDEX_TABLE,
+       IWL_RATE_18M_INDEX_TABLE,
+       IWL_RATE_24M_INDEX_TABLE,
+       IWL_RATE_36M_INDEX_TABLE,
+       IWL_RATE_48M_INDEX_TABLE,
+       IWL_RATE_54M_INDEX_TABLE,
+       IWL_RATE_1M_INDEX_TABLE,
+       IWL_RATE_2M_INDEX_TABLE,
+       IWL_RATE_5M_INDEX_TABLE,
+       IWL_RATE_11M_INDEX_TABLE,
+       IWL_RATE_INVM_INDEX_TABLE = IWL_RATE_INVM_INDEX,
+};
+
 enum {
        IWL_FIRST_OFDM_RATE = IWL_RATE_6M_INDEX,
        IWL_LAST_OFDM_RATE = IWL_RATE_54M_INDEX,
index 19bcb01e278429c83053b1dbd891a4307a668c0e..3a45fe99a83e72c4a3786787e347e12f4a480103 100644 (file)
@@ -54,7 +54,9 @@
                                    IWL_RATE_##rp##M_INDEX, \
                                    IWL_RATE_##rn##M_INDEX, \
                                    IWL_RATE_##pp##M_INDEX, \
-                                   IWL_RATE_##np##M_INDEX }
+                                   IWL_RATE_##np##M_INDEX, \
+                                   IWL_RATE_##r##M_INDEX_TABLE, \
+                                   IWL_RATE_##ip##M_INDEX_TABLE }
 
 /*
  * Parameter order:
  *
  */
 const struct iwl_rate_info iwl_rates[IWL_RATE_COUNT] = {
+       IWL_DECLARE_RATE_INFO(1, INV, 2, INV, 2, INV, 2),    /*  1mbps */
+       IWL_DECLARE_RATE_INFO(2, 1, 5, 1, 5, 1, 5),          /*  2mbps */
+       IWL_DECLARE_RATE_INFO(5, 2, 6, 2, 11, 2, 11),        /*5.5mbps */
+       IWL_DECLARE_RATE_INFO(11, 9, 12, 5, 12, 5, 18),      /* 11mbps */
        IWL_DECLARE_RATE_INFO(6, 5, 9, 5, 11, 5, 11),        /*  6mbps */
        IWL_DECLARE_RATE_INFO(9, 6, 11, 5, 11, 5, 11),       /*  9mbps */
        IWL_DECLARE_RATE_INFO(12, 11, 18, 11, 18, 11, 18),   /* 12mbps */
@@ -73,10 +79,6 @@ const struct iwl_rate_info iwl_rates[IWL_RATE_COUNT] = {
        IWL_DECLARE_RATE_INFO(36, 24, 48, 24, 48, 24, 48),   /* 36mbps */
        IWL_DECLARE_RATE_INFO(48, 36, 54, 36, 54, 36, 54),   /* 48mbps */
        IWL_DECLARE_RATE_INFO(54, 48, INV, 48, INV, 48, INV),/* 54mbps */
-       IWL_DECLARE_RATE_INFO(1, INV, 2, INV, 2, INV, 2),    /*  1mbps */
-       IWL_DECLARE_RATE_INFO(2, 1, 5, 1, 5, 1, 5),          /*  2mbps */
-       IWL_DECLARE_RATE_INFO(5, 2, 6, 2, 11, 2, 11),        /*5.5mbps */
-       IWL_DECLARE_RATE_INFO(11, 9, 12, 5, 12, 5, 18),      /* 11mbps */
 };
 
 /* 1 = enable the iwl_disable_events() function */
@@ -662,10 +664,11 @@ void iwl_hw_build_tx_cmd_rate(struct iwl_priv *priv,
        cmd->cmd.tx.tx_flags = tx_flags;
 
        /* OFDM */
-       cmd->cmd.tx.supp_rates[0] = rate_mask & IWL_OFDM_RATES_MASK;
+       cmd->cmd.tx.supp_rates[0] =
+          ((rate_mask & IWL_OFDM_RATES_MASK) >> IWL_FIRST_OFDM_RATE) & 0xFF;
 
        /* CCK */
-       cmd->cmd.tx.supp_rates[1] = (rate_mask >> 8) & 0xF;
+       cmd->cmd.tx.supp_rates[1] = (rate_mask & 0xF);
 
        IWL_DEBUG_RATE("Tx sta id: %d, rate: %d (plcp), flags: 0x%4X "
                       "cck/ofdm mask: 0x%x/0x%x\n", sta_id,
@@ -1432,7 +1435,7 @@ static void iwl_hw_reg_set_scan_power(struct iwl_priv *priv, u32 scan_tbl_index,
        /* use this channel group's 6Mbit clipping/saturation pwr,
         *   but cap at regulatory scan power restriction (set during init
         *   based on eeprom channel data) for this channel.  */
-       power = min(ch_info->scan_power, clip_pwrs[IWL_RATE_6M_INDEX]);
+       power = min(ch_info->scan_power, clip_pwrs[IWL_RATE_6M_INDEX_TABLE]);
 
        /* further limit to user's max power preference.
         * FIXME:  Other spectrum management power limitations do not
@@ -1447,7 +1450,7 @@ static void iwl_hw_reg_set_scan_power(struct iwl_priv *priv, u32 scan_tbl_index,
         *   *index*. */
        power_index = ch_info->power_info[rate_index].power_table_index
            - (power - ch_info->power_info
-              [IWL_RATE_6M_INDEX].requested_power) * 2;
+              [IWL_RATE_6M_INDEX_TABLE].requested_power) * 2;
 
        /* store reference index that we use when adjusting *all* scan
         *   powers.  So we can accommodate user (all channel) or spectrum
@@ -1476,7 +1479,7 @@ static void iwl_hw_reg_set_scan_power(struct iwl_priv *priv, u32 scan_tbl_index,
  */
 int iwl_hw_reg_send_txpower(struct iwl_priv *priv)
 {
-       int rate_idx;
+       int rate_idx, i;
        const struct iwl_channel_info *ch_info = NULL;
        struct iwl_txpowertable_cmd txpower = {
                .channel = priv->active_rxon.channel,
@@ -1500,20 +1503,36 @@ int iwl_hw_reg_send_txpower(struct iwl_priv *priv)
        }
 
        /* fill cmd with power settings for all rates for current channel */
-       for (rate_idx = 0; rate_idx < IWL_RATE_COUNT; rate_idx++) {
-               txpower.power[rate_idx].tpc = ch_info->power_info[rate_idx].tpc;
-               txpower.power[rate_idx].rate = iwl_rates[rate_idx].plcp;
+       /* Fill OFDM rate */
+       for (rate_idx = IWL_FIRST_OFDM_RATE, i = 0;
+            rate_idx <= IWL_LAST_OFDM_RATE; rate_idx++, i++) {
+
+               txpower.power[i].tpc = ch_info->power_info[i].tpc;
+               txpower.power[i].rate = iwl_rates[rate_idx].plcp;
 
                IWL_DEBUG_POWER("ch %d:%d rf %d dsp %3d rate code 0x%02x\n",
                                le16_to_cpu(txpower.channel),
                                txpower.band,
-                               txpower.power[rate_idx].tpc.tx_gain,
-                               txpower.power[rate_idx].tpc.dsp_atten,
-                               txpower.power[rate_idx].rate);
+                               txpower.power[i].tpc.tx_gain,
+                               txpower.power[i].tpc.dsp_atten,
+                               txpower.power[i].rate);
+       }
+       /* Fill CCK rates */
+       for (rate_idx = IWL_FIRST_CCK_RATE;
+            rate_idx <= IWL_LAST_CCK_RATE; rate_idx++, i++) {
+               txpower.power[i].tpc = ch_info->power_info[i].tpc;
+               txpower.power[i].rate = iwl_rates[rate_idx].plcp;
+
+               IWL_DEBUG_POWER("ch %d:%d rf %d dsp %3d rate code 0x%02x\n",
+                               le16_to_cpu(txpower.channel),
+                               txpower.band,
+                               txpower.power[i].tpc.tx_gain,
+                               txpower.power[i].tpc.dsp_atten,
+                               txpower.power[i].rate);
        }
 
        return iwl_send_cmd_pdu(priv, REPLY_TX_PWR_TABLE_CMD,
-                               sizeof(struct iwl_txpowertable_cmd), &txpower);
+                       sizeof(struct iwl_txpowertable_cmd), &txpower);
 
 }
 
@@ -1549,7 +1568,7 @@ static int iwl_hw_reg_set_new_power(struct iwl_priv *priv,
        power_info = ch_info->power_info;
 
        /* update OFDM Txpower settings */
-       for (i = IWL_FIRST_OFDM_RATE; i <= IWL_LAST_OFDM_RATE;
+       for (i = IWL_RATE_6M_INDEX_TABLE; i <= IWL_RATE_54M_INDEX_TABLE;
             i++, ++power_info) {
                int delta_idx;
 
@@ -1573,14 +1592,14 @@ static int iwl_hw_reg_set_new_power(struct iwl_priv *priv,
         *    ... all CCK power settings for a given channel are the *same*. */
        if (power_changed) {
                power =
-                   ch_info->power_info[IWL_RATE_12M_INDEX].
+                   ch_info->power_info[IWL_RATE_12M_INDEX_TABLE].
                    requested_power + IWL_CCK_FROM_OFDM_POWER_DIFF;
 
                /* do all CCK rates' iwl_channel_power_info structures */
-               for (i = IWL_FIRST_CCK_RATE; i <= IWL_LAST_CCK_RATE; i++) {
+               for (i = IWL_RATE_1M_INDEX_TABLE; i <= IWL_RATE_11M_INDEX_TABLE; i++) {
                        power_info->requested_power = power;
                        power_info->base_power_index =
-                           ch_info->power_info[IWL_RATE_12M_INDEX].
+                           ch_info->power_info[IWL_RATE_12M_INDEX_TABLE].
                            base_power_index + IWL_CCK_FROM_OFDM_INDEX_DIFF;
                        ++power_info;
                }
@@ -1674,7 +1693,7 @@ static int iwl_hw_reg_comp_txpower_temp(struct iwl_priv *priv)
                for (scan_tbl_index = 0;
                     scan_tbl_index < IWL_NUM_SCAN_RATES; scan_tbl_index++) {
                        s32 actual_index = (scan_tbl_index == 0) ?
-                           IWL_RATE_1M_INDEX : IWL_RATE_6M_INDEX;
+                           IWL_RATE_1M_INDEX_TABLE : IWL_RATE_6M_INDEX_TABLE;
                        iwl_hw_reg_set_scan_power(priv, scan_tbl_index,
                                           actual_index, clip_pwrs,
                                           ch_info, a_band);
@@ -1905,19 +1924,19 @@ static void iwl_hw_reg_init_channel_groups(struct iwl_priv *priv)
                for (rate_index = 0;
                     rate_index < IWL_RATE_COUNT; rate_index++, clip_pwrs++) {
                        switch (rate_index) {
-                       case IWL_RATE_36M_INDEX:
+                       case IWL_RATE_36M_INDEX_TABLE:
                                if (i == 0)     /* B/G */
                                        *clip_pwrs = satur_pwr;
                                else    /* A */
                                        *clip_pwrs = satur_pwr - 5;
                                break;
-                       case IWL_RATE_48M_INDEX:
+                       case IWL_RATE_48M_INDEX_TABLE:
                                if (i == 0)
                                        *clip_pwrs = satur_pwr - 7;
                                else
                                        *clip_pwrs = satur_pwr - 10;
                                break;
-                       case IWL_RATE_54M_INDEX:
+                       case IWL_RATE_54M_INDEX_TABLE:
                                if (i == 0)
                                        *clip_pwrs = satur_pwr - 9;
                                else
@@ -2031,7 +2050,7 @@ int iwl3945_txpower_set_from_eeprom(struct iwl_priv *priv)
                }
 
                /* set tx power for CCK rates, based on OFDM 12 Mbit settings*/
-               pwr_info = &ch_info->power_info[IWL_RATE_12M_INDEX];
+               pwr_info = &ch_info->power_info[IWL_RATE_12M_INDEX_TABLE];
                power = pwr_info->requested_power +
                        IWL_CCK_FROM_OFDM_POWER_DIFF;
                pwr_index = pwr_info->power_table_index +
@@ -2047,9 +2066,9 @@ int iwl3945_txpower_set_from_eeprom(struct iwl_priv *priv)
                /* fill each CCK rate's iwl_channel_power_info structure
                 * NOTE:  All CCK-rate Txpwrs are the same for a given chnl!
                 * NOTE:  CCK rates start at end of OFDM rates! */
-               for (rate_index = IWL_OFDM_RATES;
-                    rate_index < IWL_RATE_COUNT; rate_index++) {
-                       pwr_info = &ch_info->power_info[rate_index];
+               for (rate_index = 0;
+                    rate_index < IWL_CCK_RATES; rate_index++) {
+                       pwr_info = &ch_info->power_info[rate_index+IWL_OFDM_RATES];
                        pwr_info->requested_power = power;
                        pwr_info->power_table_index = pwr_index;
                        pwr_info->base_power_index = base_pwr_index;
@@ -2061,7 +2080,7 @@ int iwl3945_txpower_set_from_eeprom(struct iwl_priv *priv)
                for (scan_tbl_index = 0;
                     scan_tbl_index < IWL_NUM_SCAN_RATES; scan_tbl_index++) {
                        s32 actual_index = (scan_tbl_index == 0) ?
-                               IWL_RATE_1M_INDEX : IWL_RATE_6M_INDEX;
+                               IWL_RATE_1M_INDEX_TABLE : IWL_RATE_6M_INDEX_TABLE;
                        iwl_hw_reg_set_scan_power(priv, scan_tbl_index,
                                actual_index, clip_pwrs, ch_info, a_band);
                }
@@ -2139,17 +2158,20 @@ int iwl_hw_get_rx_read(struct iwl_priv *priv)
  */
 int iwl3945_init_hw_rate_table(struct iwl_priv *priv)
 {
-       int rc, i;
+       int rc, i, index, prev_index;
        struct iwl_rate_scaling_cmd rate_cmd = {
                .reserved = {0, 0, 0},
        };
        struct iwl_rate_scaling_info *table = rate_cmd.table;
 
        for (i = 0; i < ARRAY_SIZE(iwl_rates); i++) {
-               table[i].rate_n_flags =
+               index = iwl_rates[i].table_rs_index;
+
+               table[index].rate_n_flags =
                        iwl_hw_set_rate_n_flags(iwl_rates[i].plcp, 0);
-               table[i].try_cnt = priv->retry_rate;
-               table[i].next_rate_index = iwl_get_prev_ieee_rate(i);
+               table[index].try_cnt = priv->retry_rate;
+               prev_index = iwl_get_prev_ieee_rate(i);
+               table[index].next_rate_index = iwl_rates[prev_index].table_rs_index;
        }
 
        switch (priv->phymode) {
@@ -2157,26 +2179,26 @@ int iwl3945_init_hw_rate_table(struct iwl_priv *priv)
                IWL_DEBUG_RATE("Select A mode rate scale\n");
                /* If one of the following CCK rates is used,
                 * have it fall back to the 6M OFDM rate */
-               for (i = IWL_FIRST_CCK_RATE; i <= IWL_LAST_CCK_RATE; i++)
-                       table[i].next_rate_index = IWL_FIRST_OFDM_RATE;
+               for (i = IWL_RATE_1M_INDEX_TABLE; i <= IWL_RATE_11M_INDEX_TABLE; i++)
+                       table[i].next_rate_index = iwl_rates[IWL_FIRST_OFDM_RATE].table_rs_index;
 
                /* Don't fall back to CCK rates */
-               table[IWL_RATE_12M_INDEX].next_rate_index = IWL_RATE_9M_INDEX;
+               table[IWL_RATE_12M_INDEX_TABLE].next_rate_index = IWL_RATE_9M_INDEX_TABLE;
 
                /* Don't drop out of OFDM rates */
-               table[IWL_FIRST_OFDM_RATE].next_rate_index =
-                   IWL_FIRST_OFDM_RATE;
+               table[IWL_RATE_6M_INDEX_TABLE].next_rate_index =
+                   iwl_rates[IWL_FIRST_OFDM_RATE].table_rs_index;
                break;
 
        case MODE_IEEE80211B:
                IWL_DEBUG_RATE("Select B mode rate scale\n");
                /* If an OFDM rate is used, have it fall back to the
                 * 1M CCK rates */
-               for (i = IWL_FIRST_OFDM_RATE; i <= IWL_LAST_OFDM_RATE; i++)
-                       table[i].next_rate_index = IWL_FIRST_CCK_RATE;
+               for (i = IWL_RATE_6M_INDEX_TABLE; i <= IWL_RATE_54M_INDEX_TABLE; i++)
+                       table[i].next_rate_index = iwl_rates[IWL_FIRST_CCK_RATE].table_rs_index;
 
                /* CCK shouldn't fall back to OFDM... */
-               table[IWL_RATE_11M_INDEX].next_rate_index = IWL_RATE_5M_INDEX;
+               table[IWL_RATE_11M_INDEX_TABLE].next_rate_index = IWL_RATE_5M_INDEX_TABLE;
                break;
 
        default:
@@ -2248,22 +2270,12 @@ unsigned int iwl_hw_get_beacon_cmd(struct iwl_priv *priv,
        tx_beacon_cmd->tx.tx_flags = (TX_CMD_FLG_SEQ_CTL_MSK |
                                      TX_CMD_FLG_TSF_MSK);
 
-       /* supp_rates[0] == OFDM  */
-       tx_beacon_cmd->tx.supp_rates[0] = IWL_OFDM_BASIC_RATES_MASK;
-
-       /* supp_rates[1] == CCK
-        *
-        * NOTE:  IWL_*_RATES_MASK are not in the order that supp_rates
-        * expects so we have to shift them around.
-        *
-        * supp_rates expects:
-        * CCK rates are bit0..3
-        *
-        * However IWL_*_RATES_MASK has:
-        * CCK rates are bit8..11
-        */
+       /* supp_rates[0] == OFDM start at IWL_FIRST_OFDM_RATE*/
+       tx_beacon_cmd->tx.supp_rates[0] =
+               (IWL_OFDM_BASIC_RATES_MASK >> IWL_FIRST_OFDM_RATE) & 0xFF;
+
        tx_beacon_cmd->tx.supp_rates[1] =
-               (IWL_CCK_BASIC_RATES_MASK >> 8) & 0xF;
+               (IWL_CCK_BASIC_RATES_MASK & 0xF);
 
        return (sizeof(struct iwl_tx_beacon_cmd) + frame_size);
 }
index 557deebca1b9f4a4d0cda8ec9f5488d1329bff4a..891f90d2f019d9860cf2d5e554b5ec6052b762a6 100644 (file)
@@ -3232,9 +3232,7 @@ int iwl4965_tx_cmd(struct iwl_priv *priv, struct iwl_cmd *out_cmd,
        tx->rate_n_flags = iwl_hw_set_rate_n_flags(iwl_rates[rate_index].plcp,
                                                rate_flags);
 
-       if (ieee80211_is_probe_request(fc))
-               tx->tx_flags |= TX_CMD_FLG_TSF_MSK;
-       else if (ieee80211_is_back_request(fc))
+       if (ieee80211_is_back_request(fc))
                tx->tx_flags |= TX_CMD_FLG_ACK_MSK |
                        TX_CMD_FLG_IMM_BA_RSP_MASK;
 #ifdef CONFIG_IWLWIFI_HT
@@ -3872,7 +3870,7 @@ static void iwl4965_rx_reply_rx(struct iwl_priv *priv,
                         */
                case IEEE80211_STYPE_ASSOC_RESP:
                case IEEE80211_STYPE_REASSOC_RESP:
-                       if (network_packet && iwl_is_associated(priv)) {
+                       if (network_packet) {
 #ifdef CONFIG_IWLWIFI_HT
                                u8 *pos = NULL;
                                struct ieee802_11_elems elems;
index 83019d1d7cccf1cdd5a992c8f819492dac2b5c63..465da4f67ce73d0fcfb9b1b9c7440d1b131dd2af 100644 (file)
@@ -4850,7 +4850,7 @@ static irqreturn_t iwl_isr(int irq, void *data)
        if ((inta == 0xFFFFFFFF) || ((inta & 0xFFFFFFF0) == 0xa5a5a5a0)) {
                /* Hardware disappeared */
                IWL_WARNING("HARDWARE GONE?? INTA == 0x%080x\n", inta);
-               goto none;
+               goto unplugged;
        }
 
        IWL_DEBUG_ISR("ISR inta 0x%08x, enabled 0x%08x, fh 0x%08x\n",
@@ -4858,6 +4858,7 @@ static irqreturn_t iwl_isr(int irq, void *data)
 
        /* iwl_irq_tasklet() will service interrupts and re-enable them */
        tasklet_schedule(&priv->irq_tasklet);
+unplugged:
        spin_unlock(&priv->lock);
 
        return IRQ_HANDLED;
@@ -5331,13 +5332,13 @@ static int iwl_init_geos(struct iwl_priv *priv)
        /* 5.2GHz channels start after the 2.4GHz channels */
        modes[A].mode = MODE_IEEE80211A;
        modes[A].channels = &channels[ARRAY_SIZE(iwl_eeprom_band_1)];
-       modes[A].rates = rates;
+       modes[A].rates = &rates[4];
        modes[A].num_rates = 8; /* just OFDM */
        modes[A].num_channels = 0;
 
        modes[B].mode = MODE_IEEE80211B;
        modes[B].channels = channels;
-       modes[B].rates = &rates[8];
+       modes[B].rates = rates;
        modes[B].num_rates = 4; /* just CCK */
        modes[B].num_channels = 0;
 
@@ -6478,8 +6479,9 @@ static void iwl_bg_scan_check(struct work_struct *data)
                IWL_DEBUG(IWL_DL_INFO | IWL_DL_SCAN,
                          "Scan completion watchdog resetting adapter (%dms)\n",
                          jiffies_to_msecs(IWL_SCAN_CHECK_WATCHDOG));
+
                if (!test_bit(STATUS_EXIT_PENDING, &priv->status))
-                       queue_work(priv->workqueue, &priv->restart);
+                       iwl_send_scan_abort(priv);
        }
        mutex_unlock(&priv->mutex);
 }
@@ -6575,7 +6577,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
                spin_unlock_irqrestore(&priv->lock, flags);
 
                scan->suspend_time = 0;
-               scan->max_out_time = cpu_to_le32(600 * 1024);
+               scan->max_out_time = cpu_to_le32(200 * 1024);
                if (!interval)
                        interval = suspend_time;
                /*
@@ -6605,7 +6607,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
                memcpy(scan->direct_scan[0].ssid,
                       priv->direct_ssid, priv->direct_ssid_len);
                direct_mask = 1;
-       } else if (!iwl_is_associated(priv)) {
+       } else if (!iwl_is_associated(priv) && priv->essid_len) {
                scan->direct_scan[0].id = WLAN_EID_SSID;
                scan->direct_scan[0].len = priv->essid_len;
                memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len);
@@ -6744,6 +6746,12 @@ static void iwl_bg_post_associate(struct work_struct *data)
 
        mutex_lock(&priv->mutex);
 
+       if (!priv->interface_id || !priv->is_open) {
+               mutex_unlock(&priv->mutex);
+               return;
+       }
+       iwl_scan_cancel_timeout(priv, 200);
+
        conf = ieee80211_get_hw_conf(priv->hw);
 
        priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
@@ -6882,9 +6890,19 @@ static void iwl_mac_stop(struct ieee80211_hw *hw)
        struct iwl_priv *priv = hw->priv;
 
        IWL_DEBUG_MAC80211("enter\n");
+
+
+       mutex_lock(&priv->mutex);
+       /* stop mac, cancel any scan request and clear
+        * RXON_FILTER_ASSOC_MSK BIT
+        */
        priv->is_open = 0;
-       /*netif_stop_queue(dev); */
-       flush_workqueue(priv->workqueue);
+       iwl_scan_cancel_timeout(priv, 100);
+       cancel_delayed_work(&priv->post_associate);
+       priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
+       iwl_commit_rxon(priv);
+       mutex_unlock(&priv->mutex);
+
        IWL_DEBUG_MAC80211("leave\n");
 }
 
@@ -7169,8 +7187,6 @@ static int iwl_mac_config_interface(struct ieee80211_hw *hw, int if_id,
                if (priv->iw_mode == IEEE80211_IF_TYPE_AP)
                        iwl_config_ap(priv);
                else {
-                       priv->staging_rxon.filter_flags |=
-                                               RXON_FILTER_ASSOC_MSK;
                        rc = iwl_commit_rxon(priv);
                        if ((priv->iw_mode == IEEE80211_IF_TYPE_STA) && rc)
                                iwl_add_station(priv,
@@ -7178,6 +7194,7 @@ static int iwl_mac_config_interface(struct ieee80211_hw *hw, int if_id,
                }
 
        } else {
+               iwl_scan_cancel_timeout(priv, 100);
                priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
                iwl_commit_rxon(priv);
        }
@@ -7217,6 +7234,12 @@ static void iwl_mac_remove_interface(struct ieee80211_hw *hw,
        IWL_DEBUG_MAC80211("enter\n");
 
        mutex_lock(&priv->mutex);
+
+       iwl_scan_cancel_timeout(priv, 100);
+       cancel_delayed_work(&priv->post_associate);
+       priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
+       iwl_commit_rxon(priv);
+
        if (priv->interface_id == conf->if_id) {
                priv->interface_id = 0;
                memset(priv->bssid, 0, ETH_ALEN);
@@ -7238,6 +7261,7 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
 
        IWL_DEBUG_MAC80211("enter\n");
 
+       mutex_lock(&priv->mutex);
        spin_lock_irqsave(&priv->lock, flags);
 
        if (!iwl_is_ready_rf(priv)) {
@@ -7268,7 +7292,8 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
                priv->direct_ssid_len = (u8)
                    min((u8) len, (u8) IW_ESSID_MAX_SIZE);
                memcpy(priv->direct_ssid, ssid, priv->direct_ssid_len);
-       }
+       } else
+               priv->one_direct_scan = 0;
 
        rc = iwl_scan_initiate(priv);
 
@@ -7276,6 +7301,7 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
 
 out_unlock:
        spin_unlock_irqrestore(&priv->lock, flags);
+       mutex_unlock(&priv->mutex);
 
        return rc;
 }
@@ -7310,6 +7336,8 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 
        mutex_lock(&priv->mutex);
 
+       iwl_scan_cancel_timeout(priv, 100);
+
        switch (cmd) {
        case  SET_KEY:
                rc = iwl_update_sta_key_info(priv, key, sta_id);
@@ -7479,8 +7507,18 @@ static void iwl_mac_reset_tsf(struct ieee80211_hw *hw)
 
        spin_unlock_irqrestore(&priv->lock, flags);
 
+       /* we are restarting association process
+        * clear RXON_FILTER_ASSOC_MSK bit
+       */
+       if (priv->iw_mode != IEEE80211_IF_TYPE_AP) {
+               iwl_scan_cancel_timeout(priv, 100);
+               priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
+               iwl_commit_rxon(priv);
+       }
+
        /* Per mac80211.h: This is only used in IBSS mode... */
        if (priv->iw_mode != IEEE80211_IF_TYPE_IBSS) {
+
                IWL_DEBUG_MAC80211("leave - not in IBSS\n");
                mutex_unlock(&priv->mutex);
                return;
@@ -8317,6 +8355,8 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        }
        SET_IEEE80211_DEV(hw, &pdev->dev);
 
+       hw->rate_control_algorithm = "iwl-3945-rs";
+
        IWL_DEBUG_INFO("*** LOAD DRIVER ***\n");
        priv = hw->priv;
        priv->hw = hw;
@@ -8558,6 +8598,9 @@ static void iwl_pci_remove(struct pci_dev *pdev)
                iwl_rate_control_unregister(priv->hw);
        }
 
+       /*netif_stop_queue(dev); */
+       flush_workqueue(priv->workqueue);
+
        /* ieee80211_unregister_hw calls iwl_mac_stop, which flushes
         * priv->workqueue... so we can't take down the workqueue
         * until now... */
index 5e1279263b2264e74d57e439fc4148156a632d44..9918780f5e866fe8286fb85c970b815c981b4968 100644 (file)
@@ -5156,9 +5156,10 @@ static irqreturn_t iwl_isr(int irq, void *data)
        }
 
        if ((inta == 0xFFFFFFFF) || ((inta & 0xFFFFFFF0) == 0xa5a5a5a0)) {
-               /* Hardware disappeared */
+               /* Hardware disappeared. It might have already raised
+                * an interrupt */
                IWL_WARNING("HARDWARE GONE?? INTA == 0x%080x\n", inta);
-               goto none;
+               goto unplugged;
        }
 
        IWL_DEBUG_ISR("ISR inta 0x%08x, enabled 0x%08x, fh 0x%08x\n",
@@ -5166,8 +5167,9 @@ static irqreturn_t iwl_isr(int irq, void *data)
 
        /* iwl_irq_tasklet() will service interrupts and re-enable them */
        tasklet_schedule(&priv->irq_tasklet);
-       spin_unlock(&priv->lock);
 
+ unplugged:
+       spin_unlock(&priv->lock);
        return IRQ_HANDLED;
 
  none:
@@ -6845,8 +6847,9 @@ static void iwl_bg_scan_check(struct work_struct *data)
                IWL_DEBUG(IWL_DL_INFO | IWL_DL_SCAN,
                          "Scan completion watchdog resetting adapter (%dms)\n",
                          jiffies_to_msecs(IWL_SCAN_CHECK_WATCHDOG));
+
                if (!test_bit(STATUS_EXIT_PENDING, &priv->status))
-                       queue_work(priv->workqueue, &priv->restart);
+                       iwl_send_scan_abort(priv);
        }
        mutex_unlock(&priv->mutex);
 }
@@ -6942,7 +6945,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
                spin_unlock_irqrestore(&priv->lock, flags);
 
                scan->suspend_time = 0;
-               scan->max_out_time = cpu_to_le32(600 * 1024);
+               scan->max_out_time = cpu_to_le32(200 * 1024);
                if (!interval)
                        interval = suspend_time;
 
@@ -6965,7 +6968,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
                memcpy(scan->direct_scan[0].ssid,
                       priv->direct_ssid, priv->direct_ssid_len);
                direct_mask = 1;
-       } else if (!iwl_is_associated(priv)) {
+       } else if (!iwl_is_associated(priv) && priv->essid_len) {
                scan->direct_scan[0].id = WLAN_EID_SSID;
                scan->direct_scan[0].len = priv->essid_len;
                memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len);
@@ -7118,6 +7121,12 @@ static void iwl_bg_post_associate(struct work_struct *data)
 
        mutex_lock(&priv->mutex);
 
+       if (!priv->interface_id || !priv->is_open) {
+               mutex_unlock(&priv->mutex);
+               return;
+       }
+       iwl_scan_cancel_timeout(priv, 200);
+
        conf = ieee80211_get_hw_conf(priv->hw);
 
        priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
@@ -7271,9 +7280,19 @@ static void iwl_mac_stop(struct ieee80211_hw *hw)
        struct iwl_priv *priv = hw->priv;
 
        IWL_DEBUG_MAC80211("enter\n");
+
+
+       mutex_lock(&priv->mutex);
+       /* stop mac, cancel any scan request and clear
+        * RXON_FILTER_ASSOC_MSK BIT
+        */
        priv->is_open = 0;
-       /*netif_stop_queue(dev); */
-       flush_workqueue(priv->workqueue);
+       iwl_scan_cancel_timeout(priv, 100);
+       cancel_delayed_work(&priv->post_associate);
+       priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
+       iwl_commit_rxon(priv);
+       mutex_unlock(&priv->mutex);
+
        IWL_DEBUG_MAC80211("leave\n");
 }
 
@@ -7573,8 +7592,6 @@ static int iwl_mac_config_interface(struct ieee80211_hw *hw, int if_id,
                if (priv->iw_mode == IEEE80211_IF_TYPE_AP)
                        iwl_config_ap(priv);
                else {
-                       priv->staging_rxon.filter_flags |=
-                                               RXON_FILTER_ASSOC_MSK;
                        rc = iwl_commit_rxon(priv);
                        if ((priv->iw_mode == IEEE80211_IF_TYPE_STA) && rc)
                                iwl_rxon_add_station(
@@ -7582,6 +7599,7 @@ static int iwl_mac_config_interface(struct ieee80211_hw *hw, int if_id,
                }
 
        } else {
+               iwl_scan_cancel_timeout(priv, 100);
                priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
                iwl_commit_rxon(priv);
        }
@@ -7621,6 +7639,12 @@ static void iwl_mac_remove_interface(struct ieee80211_hw *hw,
        IWL_DEBUG_MAC80211("enter\n");
 
        mutex_lock(&priv->mutex);
+
+       iwl_scan_cancel_timeout(priv, 100);
+       cancel_delayed_work(&priv->post_associate);
+       priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
+       iwl_commit_rxon(priv);
+
        if (priv->interface_id == conf->if_id) {
                priv->interface_id = 0;
                memset(priv->bssid, 0, ETH_ALEN);
@@ -7642,6 +7666,7 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
 
        IWL_DEBUG_MAC80211("enter\n");
 
+       mutex_lock(&priv->mutex);
        spin_lock_irqsave(&priv->lock, flags);
 
        if (!iwl_is_ready_rf(priv)) {
@@ -7672,7 +7697,8 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
                priv->direct_ssid_len = (u8)
                    min((u8) len, (u8) IW_ESSID_MAX_SIZE);
                memcpy(priv->direct_ssid, ssid, priv->direct_ssid_len);
-       }
+       } else
+               priv->one_direct_scan = 0;
 
        rc = iwl_scan_initiate(priv);
 
@@ -7680,6 +7706,7 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
 
 out_unlock:
        spin_unlock_irqrestore(&priv->lock, flags);
+       mutex_unlock(&priv->mutex);
 
        return rc;
 }
@@ -7713,6 +7740,8 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 
        mutex_lock(&priv->mutex);
 
+       iwl_scan_cancel_timeout(priv, 100);
+
        switch (cmd) {
        case  SET_KEY:
                rc = iwl_update_sta_key_info(priv, key, sta_id);
@@ -7903,8 +7932,18 @@ static void iwl_mac_reset_tsf(struct ieee80211_hw *hw)
 
        spin_unlock_irqrestore(&priv->lock, flags);
 
+       /* we are restarting association process
+        * clear RXON_FILTER_ASSOC_MSK bit
+        */
+       if (priv->iw_mode != IEEE80211_IF_TYPE_AP) {
+               iwl_scan_cancel_timeout(priv, 100);
+               priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
+               iwl_commit_rxon(priv);
+       }
+
        /* Per mac80211.h: This is only used in IBSS mode... */
        if (priv->iw_mode != IEEE80211_IF_TYPE_IBSS) {
+
                IWL_DEBUG_MAC80211("leave - not in IBSS\n");
                mutex_unlock(&priv->mutex);
                return;
@@ -8918,6 +8957,8 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        }
        SET_IEEE80211_DEV(hw, &pdev->dev);
 
+       hw->rate_control_algorithm = "iwl-4965-rs";
+
        IWL_DEBUG_INFO("*** LOAD DRIVER ***\n");
        priv = hw->priv;
        priv->hw = hw;
@@ -9152,6 +9193,9 @@ static void iwl_pci_remove(struct pci_dev *pdev)
                iwl_rate_control_unregister(priv->hw);
        }
 
+       /*netif_stop_queue(dev); */
+       flush_workqueue(priv->workqueue);
+
        /* ieee80211_unregister_hw calls iwl_mac_stop, which flushes
         * priv->workqueue... so we can't take down the workqueue
         * until now... */
index 1cbbd96fdbde913200fac048a1b2c62fef54fb36..be5cfd8402c7bae331e2105b08f946484d2cd729 100644 (file)
@@ -912,6 +912,10 @@ static int wlan_cmd_set_boot2_ver(wlan_private * priv,
        return 0;
 }
 
+/*
+ * Note: NEVER use libertas_queue_cmd() with addtail==0 other than for
+ * the command timer, because it does not account for queued commands.
+ */
 void libertas_queue_cmd(wlan_adapter * adapter, struct cmd_ctrl_node *cmdnode, u8 addtail)
 {
        unsigned long flags;
@@ -941,10 +945,11 @@ void libertas_queue_cmd(wlan_adapter * adapter, struct cmd_ctrl_node *cmdnode, u
 
        spin_lock_irqsave(&adapter->driver_lock, flags);
 
-       if (addtail)
+       if (addtail) {
                list_add_tail((struct list_head *)cmdnode,
                              &adapter->cmdpendingq);
-       else
+               adapter->nr_cmd_pending++;
+       } else
                list_add((struct list_head *)cmdnode, &adapter->cmdpendingq);
 
        spin_unlock_irqrestore(&adapter->driver_lock, flags);
@@ -1412,7 +1417,6 @@ int libertas_prepare_and_send_command(wlan_private * priv,
        cmdnode->cmdwaitqwoken = 0;
 
        libertas_queue_cmd(adapter, cmdnode, 1);
-       adapter->nr_cmd_pending++;
        wake_up_interruptible(&priv->waitq);
 
        if (wait_option & CMD_OPTION_WAITFORRSP) {
index 0360cad363a8dacd314be2fb57272daed142c1af..ec89dabc412c6560a290ac1f833f339e1da5445d 100644 (file)
@@ -148,11 +148,11 @@ static int if_cs_poll_while_fw_download(struct if_cs_card *card, uint addr, u8 r
 {
        int i;
 
-       for (i = 0; i < 500; i++) {
+       for (i = 0; i < 1000; i++) {
                u8 val = if_cs_read8(card, addr);
                if (val == reg)
                        return i;
-               udelay(100);
+               udelay(500);
        }
        return -ETIME;
 }
@@ -878,6 +878,9 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
                goto out3;
        }
 
+       /* Clear any interrupt cause that happend while sending
+        * firmware/initializing card */
+       if_cs_write16(card, IF_CS_C_INT_CAUSE, IF_CS_C_IC_MASK);
        if_cs_enable_ints(card);
 
        /* And finally bring the card up */
index a8e17076e7def898a6aa477deef931d9f0ac624a..b24425f748830b9767a290d3aac038cf6b64caf9 100644 (file)
@@ -182,12 +182,14 @@ static int if_sdio_handle_data(struct if_sdio_card *card,
                goto out;
        }
 
-       skb = dev_alloc_skb(MRVDRV_ETH_RX_PACKET_BUFFER_SIZE);
+       skb = dev_alloc_skb(MRVDRV_ETH_RX_PACKET_BUFFER_SIZE + NET_IP_ALIGN);
        if (!skb) {
                ret = -ENOMEM;
                goto out;
        }
 
+       skb_reserve(skb, NET_IP_ALIGN);
+
        data = skb_put(skb, size);
 
        memcpy(data, buffer, size);
index ff2d63267b19e8acb41b356e8524e3451014f291..702321c30164d6e46310b9f959c4497a27d68bb9 100644 (file)
@@ -620,7 +620,7 @@ static void rt2500pci_link_tuner(struct rt2x00_dev *rt2x00dev)
         * up to version C the link tuning should halt after 20
         * seconds.
         */
-       if (rt2x00_get_rev(&rt2x00dev->chip) < RT2560_VERSION_D &&
+       if (rt2x00_rev(&rt2x00dev->chip) < RT2560_VERSION_D &&
            rt2x00dev->link.count > 20)
                return;
 
@@ -630,7 +630,7 @@ static void rt2500pci_link_tuner(struct rt2x00_dev *rt2x00dev)
         * Chipset versions C and lower should directly continue
         * to the dynamic CCA tuning.
         */
-       if (rt2x00_get_rev(&rt2x00dev->chip) < RT2560_VERSION_D)
+       if (rt2x00_rev(&rt2x00dev->chip) < RT2560_VERSION_D)
                goto dynamic_cca_tune;
 
        /*
index 7cdc80a122bb9aaa10b9f9eb514fad6c1d0005de..50775f9234cc72fb8a2dc34bf52ff59fc1c1fb53 100644 (file)
@@ -753,7 +753,7 @@ static int rt2500usb_init_registers(struct rt2x00_dev *rt2x00dev)
        rt2x00_set_field16(&reg, MAC_CSR1_HOST_READY, 1);
        rt2500usb_register_write(rt2x00dev, MAC_CSR1, reg);
 
-       if (rt2x00_get_rev(&rt2x00dev->chip) >= RT2570_VERSION_C) {
+       if (rt2x00_rev(&rt2x00dev->chip) >= RT2570_VERSION_C) {
                rt2500usb_register_read(rt2x00dev, PHY_CSR2, &reg);
                reg &= ~0x0002;
        } else {
@@ -1032,7 +1032,7 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
 }
 
 static int rt2500usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev,
-                                    int maxpacket, struct sk_buff *skb)
+                                    struct sk_buff *skb)
 {
        int length;
 
@@ -1041,7 +1041,7 @@ static int rt2500usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev,
         * but it must _not_ be a multiple of the USB packet size.
         */
        length = roundup(skb->len, 2);
-       length += (2 * !(length % maxpacket));
+       length += (2 * !(length % rt2x00dev->usb_maxpacket));
 
        return length;
 }
@@ -1257,7 +1257,7 @@ static int rt2500usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
        rt2500usb_register_read(rt2x00dev, MAC_CSR0, &reg);
        rt2x00_set_chip(rt2x00dev, RT2570, value, reg);
 
-       if (rt2x00_rev(&rt2x00dev->chip, 0xffff0)) {
+       if (!rt2x00_check_rev(&rt2x00dev->chip, 0)) {
                ERROR(rt2x00dev, "Invalid RT chipset detected.\n");
                return -ENODEV;
        }
@@ -1643,7 +1643,6 @@ static int rt2500usb_beacon_update(struct ieee80211_hw *hw,
        struct data_entry *beacon;
        struct data_entry *guardian;
        int pipe = usb_sndbulkpipe(usb_dev, 1);
-       int max_packet = usb_maxpacket(usb_dev, pipe, 1);
        int length;
 
        /*
@@ -1672,7 +1671,7 @@ static int rt2500usb_beacon_update(struct ieee80211_hw *hw,
                                                         ring->desc_size),
                                skb->len - ring->desc_size, control);
 
-       length = rt2500usb_get_tx_data_len(rt2x00dev, max_packet, skb);
+       length = rt2500usb_get_tx_data_len(rt2x00dev, skb);
 
        usb_fill_bulk_urb(beacon->priv, usb_dev, pipe,
                          skb->data, length, rt2500usb_beacondone, beacon);
index 9845e584b731a48454ebf0ccf08ef606dffb8ea8..c8f16f161c285e5a90069f797fc980a648a465b0 100644 (file)
@@ -418,7 +418,7 @@ struct rt2x00lib_ops {
        int (*write_tx_data) (struct rt2x00_dev *rt2x00dev,
                              struct data_ring *ring, struct sk_buff *skb,
                              struct ieee80211_tx_control *control);
-       int (*get_tx_data_len) (struct rt2x00_dev *rt2x00dev, int maxpacket,
+       int (*get_tx_data_len) (struct rt2x00_dev *rt2x00dev,
                                struct sk_buff *skb);
        void (*kick_tx_queue) (struct rt2x00_dev *rt2x00dev,
                               unsigned int queue);
@@ -598,6 +598,11 @@ struct rt2x00_dev {
         */
        u32 *rf;
 
+       /*
+        * USB Max frame size (for rt2500usb & rt73usb).
+        */
+       u16 usb_maxpacket;
+
        /*
         * Current TX power value.
         */
@@ -751,14 +756,16 @@ static inline char rt2x00_rf(const struct rt2x00_chip *chipset, const u16 chip)
        return (chipset->rf == chip);
 }
 
-static inline u16 rt2x00_get_rev(const struct rt2x00_chip *chipset)
+static inline u16 rt2x00_rev(const struct rt2x00_chip *chipset)
 {
        return chipset->rev;
 }
 
-static inline u16 rt2x00_rev(const struct rt2x00_chip *chipset, const u32 mask)
+static inline u16 rt2x00_check_rev(const struct rt2x00_chip *chipset,
+                                  const u32 rev)
 {
-       return chipset->rev & mask;
+       return (((chipset->rev & 0xffff0) == rev) &&
+               !!(chipset->rev & 0x0000f));
 }
 
 /*
index 298faa9d3f61520a79565eff5194c744b835d4a9..06d9bc0015c0ed9376ddb7b7e0a65d9c3a374087 100644 (file)
@@ -30,7 +30,7 @@
  * Interval defines
  * Both the link tuner as the rfkill will be called once per second.
  */
-#define LINK_TUNE_INTERVAL     ( round_jiffies(HZ) )
+#define LINK_TUNE_INTERVAL     ( round_jiffies_relative(HZ) )
 #define RFKILL_POLL_INTERVAL   ( 1000 )
 
 /*
index 4a6a0bd01ff192ead09ab3b929f33f57f7c18882..85ea8a8e658ef52641702a614d4d75b4e2857e60 100644 (file)
@@ -196,6 +196,14 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,
        struct rt2x00_dev *rt2x00dev = hw->priv;
        struct interface *intf = &rt2x00dev->interface;
 
+       /* FIXME: Beaconing is broken in rt2x00. */
+       if (conf->type == IEEE80211_IF_TYPE_IBSS ||
+           conf->type == IEEE80211_IF_TYPE_AP) {
+               ERROR(rt2x00dev,
+                     "rt2x00 does not support Adhoc or Master mode");
+               return -EOPNOTSUPP;
+       }
+
        /*
         * Don't allow interfaces to be added while
         * either the device has disappeared or when
index 73cc726c4046724f01f6e5b9e1b88b5eaf8dc0d2..1f5675dd329f78963fbd94a77976ab57687570f2 100644 (file)
@@ -159,7 +159,6 @@ int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev,
            interface_to_usbdev(rt2x00dev_usb(rt2x00dev));
        struct data_entry *entry = rt2x00_get_data_entry(ring);
        int pipe = usb_sndbulkpipe(usb_dev, 1);
-       int max_packet = usb_maxpacket(usb_dev, pipe, 1);
        u32 length;
 
        if (rt2x00_ring_full(ring)) {
@@ -194,8 +193,7 @@ int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev,
         * length of the data to usb_fill_bulk_urb. Pass the skb
         * to the driver to determine what the length should be.
         */
-       length = rt2x00dev->ops->lib->get_tx_data_len(rt2x00dev,
-                                                     max_packet, skb);
+       length = rt2x00dev->ops->lib->get_tx_data_len(rt2x00dev, skb);
 
        /*
         * Initialize URB and send the frame to the device.
@@ -490,6 +488,11 @@ int rt2x00usb_probe(struct usb_interface *usb_intf,
        rt2x00dev->ops = ops;
        rt2x00dev->hw = hw;
 
+       rt2x00dev->usb_maxpacket =
+           usb_maxpacket(usb_dev, usb_sndbulkpipe(usb_dev, 1), 1);
+       if (!rt2x00dev->usb_maxpacket)
+               rt2x00dev->usb_maxpacket = 1;
+
        retval = rt2x00usb_alloc_reg(rt2x00dev);
        if (retval)
                goto exit_free_device;
index 46c8c0840a6531703ed85d31a0604598502f4baf..c0671c2e6e7301e93d9909c864fbda8b651a140b 100644 (file)
@@ -1251,7 +1251,7 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
 }
 
 static int rt73usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev,
-                                  int maxpacket, struct sk_buff *skb)
+                                  struct sk_buff *skb)
 {
        int length;
 
@@ -1260,7 +1260,7 @@ static int rt73usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev,
         * but it must _not_ be a multiple of the USB packet size.
         */
        length = roundup(skb->len, 4);
-       length += (4 * !(length % maxpacket));
+       length += (4 * !(length % rt2x00dev->usb_maxpacket));
 
        return length;
 }
@@ -1486,7 +1486,7 @@ static int rt73usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
        rt73usb_register_read(rt2x00dev, MAC_CSR0, &reg);
        rt2x00_set_chip(rt2x00dev, RT2571, value, reg);
 
-       if (!rt2x00_rev(&rt2x00dev->chip, 0x25730)) {
+       if (!rt2x00_check_rev(&rt2x00dev->chip, 0x25730)) {
                ERROR(rt2x00dev, "Invalid RT chipset detected.\n");
                return -ENODEV;
        }
index de61c8fe64924dd52fb2e4e37dd6aacd5d00db04..e454ae83e97a369aceaf9fdfe0c7dbe2f38df8dc 100644 (file)
@@ -433,6 +433,9 @@ static int rtl8187_start(struct ieee80211_hw *dev)
 
        rtl818x_iowrite16(priv, &priv->map->INT_MASK, 0xFFFF);
 
+       rtl818x_iowrite32(priv, &priv->map->MAR[0], ~0);
+       rtl818x_iowrite32(priv, &priv->map->MAR[1], ~0);
+
        rtl8187_init_urbs(dev);
 
        reg = RTL818X_RX_CONF_ONLYERLPKT |
@@ -582,32 +585,31 @@ static int rtl8187_config_interface(struct ieee80211_hw *dev, int if_id,
 static void rtl8187_configure_filter(struct ieee80211_hw *dev,
                                     unsigned int changed_flags,
                                     unsigned int *total_flags,
-                                    int mc_count, struct dev_addr_list *mc_list)
+                                    int mc_count, struct dev_addr_list *mclist)
 {
        struct rtl8187_priv *priv = dev->priv;
 
-       *total_flags = 0;
-
-       if (changed_flags & FIF_ALLMULTI)
-               priv->rx_conf ^= RTL818X_RX_CONF_MULTICAST;
        if (changed_flags & FIF_FCSFAIL)
                priv->rx_conf ^= RTL818X_RX_CONF_FCS;
        if (changed_flags & FIF_CONTROL)
                priv->rx_conf ^= RTL818X_RX_CONF_CTRL;
        if (changed_flags & FIF_OTHER_BSS)
                priv->rx_conf ^= RTL818X_RX_CONF_MONITOR;
-
-       if (mc_count > 0)
+       if (*total_flags & FIF_ALLMULTI || mc_count > 0)
                priv->rx_conf |= RTL818X_RX_CONF_MULTICAST;
+       else
+               priv->rx_conf &= ~RTL818X_RX_CONF_MULTICAST;
+
+       *total_flags = 0;
 
-       if (priv->rx_conf & RTL818X_RX_CONF_MULTICAST)
-               *total_flags |= FIF_ALLMULTI;
        if (priv->rx_conf & RTL818X_RX_CONF_FCS)
                *total_flags |= FIF_FCSFAIL;
        if (priv->rx_conf & RTL818X_RX_CONF_CTRL)
                *total_flags |= FIF_CONTROL;
        if (priv->rx_conf & RTL818X_RX_CONF_MONITOR)
                *total_flags |= FIF_OTHER_BSS;
+       if (priv->rx_conf & RTL818X_RX_CONF_MULTICAST)
+               *total_flags |= FIF_ALLMULTI;
 
        rtl818x_iowrite32_async(priv, &priv->map->RX_CONF, priv->rx_conf);
 }
index 4bd14b331862948f558a74955b9c191b7f4502f4..88efe1bae58f5333d933c93ec21ac0b6aa09c42b 100644 (file)
@@ -2735,16 +2735,8 @@ static int strip_ioctl(struct tty_struct *tty, struct file *file,
                        return -EFAULT;
                return set_mac_address(strip_info, &addr);
        }
-       /*
-        * Allow stty to read, but not set, the serial port
-        */
-
-       case TCGETS:
-       case TCGETA:
-               return n_tty_ioctl(tty, file, cmd, arg);
-               break;
        default:
-               return -ENOIOCTLCMD;
+               return tty_mode_ioctl(tty, file, cmd, arg);
                break;
        }
        return 0;
index a83c3db7d18fb81a1cd58347ea22ce12a8f9b29c..c93d3d2640ab884b2a4d43a4339afd2613cd149d 100644 (file)
@@ -64,6 +64,8 @@ int alloc_cpu_buffers(void)
                b->head_pos = 0;
                b->sample_received = 0;
                b->sample_lost_overflow = 0;
+               b->backtrace_aborted = 0;
+               b->sample_invalid_eip = 0;
                b->cpu = i;
                INIT_DELAYED_WORK(&b->work, wq_sync_buffer);
        }
@@ -175,6 +177,11 @@ static int log_sample(struct oprofile_cpu_buffer * cpu_buf, unsigned long pc,
 
        cpu_buf->sample_received++;
 
+       if (pc == ESCAPE_CODE) {
+               cpu_buf->sample_invalid_eip++;
+               return 0;
+       }
+
        if (nr_available_slots(cpu_buf) < 3) {
                cpu_buf->sample_lost_overflow++;
                return 0;
index 49900d9e3235e613cde4e7387a3ce0acd9a10f45..c66c025abe757804f3cea7cfc389103293762c58 100644 (file)
@@ -42,6 +42,7 @@ struct oprofile_cpu_buffer {
        unsigned long sample_received;
        unsigned long sample_lost_overflow;
        unsigned long backtrace_aborted;
+       unsigned long sample_invalid_eip;
        int cpu;
        struct delayed_work work;
 } ____cacheline_aligned;
index f0acb661c25391dc81902543210067a3e40c9248..d1f6d776e9e441ea31272d4b3b4bd58a6a927c6a 100644 (file)
@@ -26,6 +26,8 @@ void oprofile_reset_stats(void)
                cpu_buf = &cpu_buffer[i]; 
                cpu_buf->sample_received = 0;
                cpu_buf->sample_lost_overflow = 0;
+               cpu_buf->backtrace_aborted = 0;
+               cpu_buf->sample_invalid_eip = 0;
        }
  
        atomic_set(&oprofile_stats.sample_lost_no_mm, 0);
@@ -61,6 +63,8 @@ void oprofile_create_stats_files(struct super_block * sb, struct dentry * root)
                        &cpu_buf->sample_lost_overflow);
                oprofilefs_create_ro_ulong(sb, cpudir, "backtrace_aborted",
                        &cpu_buf->backtrace_aborted);
+               oprofilefs_create_ro_ulong(sb, cpudir, "sample_invalid_eip",
+                       &cpu_buf->sample_invalid_eip);
        }
  
        oprofilefs_create_ro_atomic(sb, dir, "sample_lost_no_mm",
index 7a1d6d51283747825aeb9eba5faca5f6440e5cf9..e1ca42591ac463b36e3de6fee4ff829e7040abf3 100644 (file)
@@ -21,6 +21,17 @@ config PCI_MSI
 
           If you don't know what to do here, say N.
 
+config PCI_LEGACY
+       bool "Enable deprecated pci_find_* API"
+       depends on PCI
+       default y
+       help
+         Say Y here if you want to include support for the deprecated
+         pci_find_slot() and pci_find_device() APIs.  Most drivers have
+         been converted over to using the proper hotplug APIs, so this
+         option serves to include/exclude only a few drivers that are
+         still using this API.
+
 config PCI_DEBUG
        bool "PCI Debugging"
        depends on PCI && DEBUG_KERNEL
index 63d62752fb913afd7b9de146f7437bf9622c94e3..a64449d489d635b9743ce79f2cf52c8904feb125 100644 (file)
@@ -41,7 +41,7 @@ config HOTPLUG_PCI_FAKE
 
 config HOTPLUG_PCI_COMPAQ
        tristate "Compaq PCI Hotplug driver"
-       depends on X86 && PCI_BIOS
+       depends on X86 && PCI_BIOS && PCI_LEGACY
        help
          Say Y here if you have a motherboard with a Compaq PCI Hotplug
          controller.
@@ -63,7 +63,7 @@ config HOTPLUG_PCI_COMPAQ_NVRAM
 
 config HOTPLUG_PCI_IBM
        tristate "IBM PCI Hotplug driver"
-       depends on X86_IO_APIC && X86 && PCI_BIOS
+       depends on X86_IO_APIC && X86 && PCI_BIOS && PCI_LEGACY
        help
          Say Y here if you have a motherboard with a IBM PCI Hotplug
          controller.
@@ -119,7 +119,7 @@ config HOTPLUG_PCI_CPCI_ZT5550
 
 config HOTPLUG_PCI_CPCI_GENERIC
        tristate "Generic port I/O CompactPCI Hotplug driver"
-       depends on HOTPLUG_PCI_CPCI && X86
+       depends on HOTPLUG_PCI_CPCI && X86 && PCI_LEGACY
        help
          Say Y here if you have a CompactPCI system card that exposes the #ENUM
          hotswap signal as a bit in a system register that can be read through
index 3ef0a4875a62a21ee4eff4d44e568f8632364918..856d57b4d6044539c50b4f631107c03f1df5891d 100644 (file)
@@ -1931,16 +1931,14 @@ void cpqhp_pushbutton_thread(unsigned long slot)
                        return ;
                }
 
-               if (func != NULL && ctrl != NULL) {
-                       if (cpqhp_process_SS(ctrl, func) != 0) {
-                               amber_LED_on (ctrl, hp_slot);
-                               green_LED_on (ctrl, hp_slot);
-                               
-                               set_SOGO(ctrl);
+               if (cpqhp_process_SS(ctrl, func) != 0) {
+                       amber_LED_on(ctrl, hp_slot);
+                       green_LED_on(ctrl, hp_slot);
 
-                               /* Wait for SOBS to be unset */
-                               wait_for_ctrl_irq (ctrl);
-                       }
+                       set_SOGO(ctrl);
+
+                       /* Wait for SOBS to be unset */
+                       wait_for_ctrl_irq(ctrl);
                }
 
                p_slot->state = STATIC_STATE;
index 0c4ab3b07274c466b157b9dd37b38e6e4ed8c0cd..e079a5237c9424e7064e1c0892377f2d9b78536b 100644 (file)
@@ -34,7 +34,7 @@
 #include "intel-iommu.h"
 #include <asm/proto.h> /* force_iommu in this header in x86-64*/
 #include <asm/cacheflush.h>
-#include <asm/iommu.h>
+#include <asm/gart.h>
 #include "pci.h"
 
 #define IS_GFX_DEVICE(pdev) ((pdev->class >> 16) == PCI_BASE_CLASS_DISPLAY)
@@ -745,12 +745,12 @@ static char *fault_reason_strings[] =
        "non-zero reserved fields in PTE",
        "Unknown"
 };
-#define MAX_FAULT_REASON_IDX   ARRAY_SIZE(fault_reason_strings)
+#define MAX_FAULT_REASON_IDX   ARRAY_SIZE(fault_reason_strings) - 1
 
 char *dmar_get_fault_reason(u8 fault_reason)
 {
-       if (fault_reason > MAX_FAULT_REASON_IDX)
-               return fault_reason_strings[MAX_FAULT_REASON_IDX];
+       if (fault_reason >= MAX_FAULT_REASON_IDX)
+               return fault_reason_strings[MAX_FAULT_REASON_IDX - 1];
        else
                return fault_reason_strings[fault_reason];
 }
@@ -995,7 +995,6 @@ static struct intel_iommu *alloc_iommu(struct dmar_drhd_unit *drhd)
        return iommu;
 error_unmap:
        iounmap(iommu->reg);
-       iommu->reg = 0;
 error:
        kfree(iommu);
        return NULL;
@@ -1808,7 +1807,7 @@ get_valid_domain_for_dev(struct pci_dev *pdev)
        if (!domain) {
                printk(KERN_ERR
                        "Allocating domain for %s failed", pci_name(pdev));
-               return 0;
+               return NULL;
        }
 
        /* make sure context mapping is ok */
@@ -1818,7 +1817,7 @@ get_valid_domain_for_dev(struct pci_dev *pdev)
                        printk(KERN_ERR
                                "Domain context map for %s failed",
                                pci_name(pdev));
-                       return 0;
+                       return NULL;
                }
        }
 
index ee88dd2400cb83ad13eb2ba44beea4e22704281d..459ad1f9dc549f5d84635c93429a1dafdd44a978 100644 (file)
@@ -58,7 +58,7 @@
                hi = readl(dmar + reg + 4); \
                (((u64) hi) << 32) + lo; })
 */
-static inline u64 dmar_readq(void *addr)
+static inline u64 dmar_readq(void __iomem *addr)
 {
        u32 lo, hi;
        lo = readl(addr);
index 87e01615053dc1fb228b05473e1bdac2d32b8e6c..07c9f09c856dba943a15f7e794ba8e1eaef78387 100644 (file)
@@ -224,6 +224,12 @@ static struct msi_desc* alloc_msi_entry(void)
        return entry;
 }
 
+static void pci_intx_for_msi(struct pci_dev *dev, int enable)
+{
+       if (!(dev->dev_flags & PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG))
+               pci_intx(dev, enable);
+}
+
 #ifdef CONFIG_PM
 static void __pci_restore_msi_state(struct pci_dev *dev)
 {
@@ -237,7 +243,7 @@ static void __pci_restore_msi_state(struct pci_dev *dev)
        entry = get_irq_msi(dev->irq);
        pos = entry->msi_attrib.pos;
 
-       pci_intx(dev, 0);               /* disable intx */
+       pci_intx_for_msi(dev, 0);
        msi_set_enable(dev, 0);
        write_msi_msg(dev->irq, &entry->msg);
        if (entry->msi_attrib.maskbit)
@@ -260,7 +266,7 @@ static void __pci_restore_msix_state(struct pci_dev *dev)
                return;
 
        /* route the table */
-       pci_intx(dev, 0);               /* disable intx */
+       pci_intx_for_msi(dev, 0);
        msix_set_enable(dev, 0);
 
        list_for_each_entry(entry, &dev->msi_list, list) {
@@ -343,7 +349,7 @@ static int msi_capability_init(struct pci_dev *dev)
        }
 
        /* Set MSI enabled bits  */
-       pci_intx(dev, 0);               /* disable intx */
+       pci_intx_for_msi(dev, 0);
        msi_set_enable(dev, 1);
        dev->msi_enabled = 1;
 
@@ -433,7 +439,7 @@ static int msix_capability_init(struct pci_dev *dev,
                i++;
        }
        /* Set MSI-X enabled bits */
-       pci_intx(dev, 0);               /* disable intx */
+       pci_intx_for_msi(dev, 0);
        msix_set_enable(dev, 1);
        dev->msix_enabled = 1;
 
@@ -528,7 +534,7 @@ void pci_disable_msi(struct pci_dev* dev)
                return;
 
        msi_set_enable(dev, 0);
-       pci_intx(dev, 1);               /* enable intx */
+       pci_intx_for_msi(dev, 1);
        dev->msi_enabled = 0;
 
        BUG_ON(list_empty(&dev->msi_list));
@@ -640,7 +646,7 @@ void pci_disable_msix(struct pci_dev* dev)
                return;
 
        msix_set_enable(dev, 0);
-       pci_intx(dev, 1);               /* enable intx */
+       pci_intx_for_msi(dev, 1);
        dev->msix_enabled = 0;
 
        msix_free_all_irqs(dev);
index 6e2760b6c20a4cc1d1ce08ebb4d64dd87872c2d0..6d1a21611818b92c5cd4524e61d046984cf4c476 100644 (file)
@@ -143,8 +143,8 @@ const struct pci_device_id *pci_match_id(const struct pci_device_id *ids,
  * system is in its list of supported devices.  Returns the matching
  * pci_device_id structure or %NULL if there is no match.
  */
-const struct pci_device_id *pci_match_device(struct pci_driver *drv,
-                                            struct pci_dev *dev)
+static const struct pci_device_id *pci_match_device(struct pci_driver *drv,
+                                                   struct pci_dev *dev)
 {
        struct pci_dynid *dynid;
 
@@ -559,7 +559,6 @@ static int __init pci_driver_init(void)
 postcore_initcall(pci_driver_init);
 
 EXPORT_SYMBOL(pci_match_id);
-EXPORT_SYMBOL(pci_match_device);
 EXPORT_SYMBOL(__pci_register_driver);
 EXPORT_SYMBOL(pci_unregister_driver);
 EXPORT_SYMBOL(pci_dev_driver);
index d0bb5b9d2120925605f6aab89ce25fc78d2a0133..26cc4dcf4f0e381c791c6dba3e6bb28ce3b5e236 100644 (file)
@@ -1621,12 +1621,8 @@ static void __init quirk_disable_all_msi(struct pci_dev *dev)
        printk(KERN_WARNING "PCI: MSI quirk detected. MSI deactivated.\n");
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_GCNB_LE, quirk_disable_all_msi);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT1000_PCIX, quirk_disable_all_msi);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS400_200, quirk_disable_all_msi);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS480, quirk_disable_all_msi);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RD580, quirk_disable_all_msi);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RX790, quirk_disable_all_msi);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS690, quirk_disable_all_msi);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT3351, quirk_disable_all_msi);
 
 /* Disable MSI on chipsets that are known to not support it */
@@ -1678,6 +1674,9 @@ static void __devinit quirk_msi_ht_cap(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE,
                        quirk_msi_ht_cap);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS,
+                       PCI_DEVICE_ID_SERVERWORKS_HT1000_PXB,
+                       quirk_msi_ht_cap);
 
 /* The nVidia CK804 chipset may have 2 HT MSI mappings.
  * MSI are supported if the MSI capability set in any of these mappings.
@@ -1705,4 +1704,48 @@ static void __devinit quirk_nvidia_ck804_msi_ht_cap(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_CK804_PCIE,
                        quirk_nvidia_ck804_msi_ht_cap);
+
+static void __devinit quirk_msi_intx_disable_bug(struct pci_dev *dev)
+{
+       dev->dev_flags |= PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG;
+}
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
+                       PCI_DEVICE_ID_TIGON3_5780,
+                       quirk_msi_intx_disable_bug);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
+                       PCI_DEVICE_ID_TIGON3_5780S,
+                       quirk_msi_intx_disable_bug);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
+                       PCI_DEVICE_ID_TIGON3_5714,
+                       quirk_msi_intx_disable_bug);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
+                       PCI_DEVICE_ID_TIGON3_5714S,
+                       quirk_msi_intx_disable_bug);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
+                       PCI_DEVICE_ID_TIGON3_5715,
+                       quirk_msi_intx_disable_bug);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
+                       PCI_DEVICE_ID_TIGON3_5715S,
+                       quirk_msi_intx_disable_bug);
+
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4390,
+                       quirk_msi_intx_disable_bug);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4391,
+                       quirk_msi_intx_disable_bug);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4392,
+                       quirk_msi_intx_disable_bug);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4393,
+                       quirk_msi_intx_disable_bug);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4394,
+                       quirk_msi_intx_disable_bug);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4395,
+                       quirk_msi_intx_disable_bug);
+
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4373,
+                       quirk_msi_intx_disable_bug);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4374,
+                       quirk_msi_intx_disable_bug);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4375,
+                       quirk_msi_intx_disable_bug);
+
 #endif /* CONFIG_PCI_MSI */
index b001b5922e3349088ac2e47b9ee3acb1d934a46e..8541034021f0d5eaf168d83e425bb66d1b03a2e1 100644 (file)
@@ -113,6 +113,8 @@ pci_find_next_bus(const struct pci_bus *from)
        return b;
 }
 
+#ifdef CONFIG_PCI_LEGACY
+
 /**
  * pci_find_slot - locate PCI device from a given PCI slot
  * @bus: number of PCI bus on which desired PCI device resides
@@ -137,6 +139,8 @@ pci_find_slot(unsigned int bus, unsigned int devfn)
        return NULL;
 }
 
+#endif /* CONFIG_PCI_LEGACY */
+
 /**
  * pci_get_slot - locate PCI device for a given PCI slot
  * @bus: PCI bus on which desired PCI device resides
@@ -200,6 +204,7 @@ struct pci_dev * pci_get_bus_and_slot(unsigned int bus, unsigned int devfn)
        return NULL;
 }
 
+#ifdef CONFIG_PCI_LEGACY
 /**
  * pci_find_subsys - begin or continue searching for a PCI device by vendor/subvendor/device/subdevice id
  * @vendor: PCI vendor id to match, or %PCI_ANY_ID to match all vendor ids
@@ -278,6 +283,7 @@ pci_find_device(unsigned int vendor, unsigned int device, const struct pci_dev *
 {
        return pci_find_subsys(vendor, device, PCI_ANY_ID, PCI_ANY_ID, from);
 }
+#endif /* CONFIG_PCI_LEGACY */
 
 /**
  * pci_get_subsys - begin or continue searching for a PCI device by vendor/subvendor/device/subdevice id
@@ -468,8 +474,11 @@ int pci_dev_present(const struct pci_device_id *ids)
 EXPORT_SYMBOL(pci_dev_present);
 EXPORT_SYMBOL(pci_find_present);
 
+#ifdef CONFIG_PCI_LEGACY
 EXPORT_SYMBOL(pci_find_device);
 EXPORT_SYMBOL(pci_find_slot);
+#endif /* CONFIG_PCI_LEGACY */
+
 /* For boot time work */
 EXPORT_SYMBOL(pci_find_bus);
 EXPORT_SYMBOL(pci_find_next_bus);
index cd0a204d96d14e9ffdc7d19e5597f47e89fe6b8a..11adab13f2b724e0c94e5561c6b47b5fde175e21 100644 (file)
@@ -75,6 +75,7 @@ static void pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res,
 {
        int i = 0;
        int irq;
+       int p, t;
 
        if (!valid_IRQ(gsi))
                return;
@@ -85,15 +86,22 @@ static void pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res,
        if (i >= PNP_MAX_IRQ)
                return;
 
-#ifdef CONFIG_X86
-       if (gsi < 16 && (triggering != ACPI_EDGE_SENSITIVE ||
-                               polarity != ACPI_ACTIVE_HIGH)) {
-               pnp_warn("BIOS BUG: legacy PNP IRQ %d should be edge trigger, "
-                               "active high", gsi);
-               triggering = ACPI_EDGE_SENSITIVE;
-               polarity = ACPI_ACTIVE_HIGH;
+       /*
+        * in IO-APIC mode, use overrided attribute. Two reasons:
+        * 1. BIOS bug in DSDT
+        * 2. BIOS uses IO-APIC mode Interrupt Source Override
+        */
+       if (!acpi_get_override_irq(gsi, &t, &p)) {
+               t = t ? ACPI_LEVEL_SENSITIVE : ACPI_EDGE_SENSITIVE;
+               p = p ? ACPI_ACTIVE_LOW : ACPI_ACTIVE_HIGH;
+
+               if (triggering != t || polarity != p) {
+                       pnp_warn("IRQ %d override to %s, %s",
+                               gsi, t ? "edge":"level", p ? "low":"high");
+                       triggering = t;
+                       polarity = p;
+               }
        }
-#endif
 
        res->irq_resource[i].flags = IORESOURCE_IRQ;    // Also clears _UNSET flag
        res->irq_resource[i].flags |= irq_flags(triggering, polarity);
index cbde770eb121062fcfa67f8dd562f827814cacc1..1e6715ec51efd68f13bb2aef5671c912c2b95604 100644 (file)
@@ -36,7 +36,9 @@ config RTC_HCTOSYS_DEVICE
        help
          The RTC device that will be used to (re)initialize the system
          clock, usually rtc0.  Initialization is done when the system
-         starts up, and when it resumes from a low power state.
+         starts up, and when it resumes from a low power state.  This
+         device should record time in UTC, since the kernel won't do
+         timezone correction.
 
          The driver for this RTC device must be loaded before late_initcall
          functions run, so it must usually be statically linked.
@@ -133,8 +135,8 @@ config RTC_DRV_DS1307
 
          The first seven registers on these chips hold an RTC, and other
          registers may add features such as NVRAM, a trickle charger for
-         the RTC/NVRAM backup power, and alarms.  This driver may not
-         expose all those available chip features.
+         the RTC/NVRAM backup power, and alarms.  NVRAM is visible in
+         sysfs, but other chip features may not be available.
 
          This driver can also be built as a module. If so, the module
          will be called rtc-ds1307.
@@ -445,7 +447,7 @@ config RTC_DRV_AT91RM9200
 
 config RTC_DRV_BFIN
        tristate "Blackfin On-Chip RTC"
-       depends on BFIN
+       depends on BLACKFIN
        help
          If you say yes here you will get support for the
          Blackfin On-Chip Real Time Clock.
index 178527252c6a6d04c8dbd55c1ca1ab22aa938e69..33c0e98243eef9ab397b840c1f8265c5c9e31baf 100644 (file)
@@ -47,8 +47,8 @@ static int __init rtc_hctosys(void)
                        do_settimeofday(&tv);
 
                        dev_info(rtc->dev.parent,
-                               "setting the system clock to "
-                               "%d-%02d-%02d %02d:%02d:%02d (%u)\n",
+                               "setting system clock to "
+                               "%d-%02d-%02d %02d:%02d:%02d UTC (%u)\n",
                                tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
                                tm.tm_hour, tm.tm_min, tm.tm_sec,
                                (unsigned int) tv.tv_sec);
index e3fe83a23cf720049018dadb623de3c8b28d78d1..29cf1457ca10f507104a5a54d9fedd88f0544a95 100644 (file)
@@ -120,7 +120,8 @@ static int cmos_read_alarm(struct device *dev, struct rtc_wkalrm *t)
        t->time.tm_hour = CMOS_READ(RTC_HOURS_ALARM);
 
        if (cmos->day_alrm) {
-               t->time.tm_mday = CMOS_READ(cmos->day_alrm);
+               /* ignore upper bits on readback per ACPI spec */
+               t->time.tm_mday = CMOS_READ(cmos->day_alrm) & 0x3f;
                if (!t->time.tm_mday)
                        t->time.tm_mday = -1;
 
index db6f3f0d8982e685b7e48cc78e2f2db6040c4742..bc1c7fe94ad3eceaf352e49eb2e6843de924a6e5 100644 (file)
@@ -89,6 +89,7 @@ enum ds_type {
 
 struct ds1307 {
        u8                      reg_addr;
+       bool                    has_nvram;
        u8                      regs[8];
        enum ds_type            type;
        struct i2c_msg          msg[2];
@@ -242,6 +243,87 @@ static const struct rtc_class_ops ds13xx_rtc_ops = {
        .set_time       = ds1307_set_time,
 };
 
+/*----------------------------------------------------------------------*/
+
+#define NVRAM_SIZE     56
+
+static ssize_t
+ds1307_nvram_read(struct kobject *kobj, struct bin_attribute *attr,
+               char *buf, loff_t off, size_t count)
+{
+       struct i2c_client       *client;
+       struct ds1307           *ds1307;
+       struct i2c_msg          msg[2];
+       int                     result;
+
+       client = to_i2c_client(container_of(kobj, struct device, kobj));
+       ds1307 = i2c_get_clientdata(client);
+
+       if (unlikely(off >= NVRAM_SIZE))
+               return 0;
+       if ((off + count) > NVRAM_SIZE)
+               count = NVRAM_SIZE - off;
+       if (unlikely(!count))
+               return count;
+
+       msg[0].addr = client->addr;
+       msg[0].flags = 0;
+       msg[0].len = 1;
+       msg[0].buf = buf;
+
+       buf[0] = 8 + off;
+
+       msg[1].addr = client->addr;
+       msg[1].flags = I2C_M_RD;
+       msg[1].len = count;
+       msg[1].buf = buf;
+
+       result = i2c_transfer(to_i2c_adapter(client->dev.parent), msg, 2);
+       if (result != 2) {
+               dev_err(&client->dev, "%s error %d\n", "nvram read", result);
+               return -EIO;
+       }
+       return count;
+}
+
+static ssize_t
+ds1307_nvram_write(struct kobject *kobj, struct bin_attribute *attr,
+               char *buf, loff_t off, size_t count)
+{
+       struct i2c_client       *client;
+       u8                      buffer[NVRAM_SIZE + 1];
+       int                     ret;
+
+       client = to_i2c_client(container_of(kobj, struct device, kobj));
+
+       if (unlikely(off >= NVRAM_SIZE))
+               return -EFBIG;
+       if ((off + count) > NVRAM_SIZE)
+               count = NVRAM_SIZE - off;
+       if (unlikely(!count))
+               return count;
+
+       buffer[0] = 8 + off;
+       memcpy(buffer + 1, buf, count);
+
+       ret = i2c_master_send(client, buffer, count + 1);
+       return (ret < 0) ? ret : (ret - 1);
+}
+
+static struct bin_attribute nvram = {
+       .attr = {
+               .name   = "nvram",
+               .mode   = S_IRUGO | S_IWUSR,
+               .owner  = THIS_MODULE,
+       },
+
+       .read   = ds1307_nvram_read,
+       .write  = ds1307_nvram_write,
+       .size   = NVRAM_SIZE,
+};
+
+/*----------------------------------------------------------------------*/
+
 static struct i2c_driver ds1307_driver;
 
 static int __devinit ds1307_probe(struct i2c_client *client)
@@ -413,6 +495,14 @@ read_rtc:
                goto exit_free;
        }
 
+       if (chip->nvram56) {
+               err = sysfs_create_bin_file(&client->dev.kobj, &nvram);
+               if (err == 0) {
+                       ds1307->has_nvram = true;
+                       dev_info(&client->dev, "56 bytes nvram\n");
+               }
+       }
+
        return 0;
 
 exit_bad:
@@ -432,6 +522,9 @@ static int __devexit ds1307_remove(struct i2c_client *client)
 {
        struct ds1307   *ds1307 = i2c_get_clientdata(client);
 
+       if (ds1307->has_nvram)
+               sysfs_remove_bin_file(&client->dev.kobj, &nvram);
+
        rtc_device_unregister(ds1307->rtc);
        kfree(ds1307);
        return 0;
index bb53c09bad169beb8427755a3de4e0aaf665dbf7..d9e848dcd450c520000f21a687b3a7e349240094 100644 (file)
@@ -291,7 +291,7 @@ static ssize_t ds1553_nvram_write(struct kobject *kobj,
 static struct bin_attribute ds1553_nvram_attr = {
        .attr = {
                .name = "nvram",
-               .mode = S_IRUGO | S_IWUGO,
+               .mode = S_IRUGO | S_IWUSR,
        },
        .size = RTC_OFFSET,
        .read = ds1553_nvram_read,
index c535b78698e22634377c049e3c5c91fe2c77ad89..2e73f0b183b2fd94540cc6624c0d2281cfc72950 100644 (file)
@@ -160,10 +160,13 @@ static ssize_t ds1742_nvram_write(struct kobject *kobj,
 static struct bin_attribute ds1742_nvram_attr = {
        .attr = {
                .name = "nvram",
-               .mode = S_IRUGO | S_IWUGO,
+               .mode = S_IRUGO | S_IWUSR,
        },
        .read = ds1742_nvram_read,
        .write = ds1742_nvram_write,
+       /* REVISIT: size in sysfs won't match actual size... if it's
+        * not a constant, each RTC should have its own attribute.
+        */
 };
 
 static int __devinit ds1742_rtc_probe(struct platform_device *pdev)
index bf60d35f580b55e98495af3e6c7ab8157135be78..cd0bbc0e8038c68c6b31798f30f820a5c558a66b 100644 (file)
@@ -353,11 +353,12 @@ static ssize_t m48t59_nvram_write(struct kobject *kobj,
 static struct bin_attribute m48t59_nvram_attr = {
        .attr = {
                .name = "nvram",
-               .mode = S_IRUGO | S_IWUGO,
+               .mode = S_IRUGO | S_IWUSR,
                .owner = THIS_MODULE,
        },
        .read = m48t59_nvram_read,
        .write = m48t59_nvram_write,
+       .size = M48T59_NVRAM_SIZE,
 };
 
 static int __devinit m48t59_rtc_probe(struct platform_device *pdev)
@@ -464,7 +465,7 @@ static int __devexit m48t59_rtc_remove(struct platform_device *pdev)
        return 0;
 }
 
-static struct platform_driver m48t59_rtc_platdrv = {
+static struct platform_driver m48t59_rtc_driver = {
        .driver         = {
                .name   = "rtc-m48t59",
                .owner  = THIS_MODULE,
@@ -475,12 +476,12 @@ static struct platform_driver m48t59_rtc_platdrv = {
 
 static int __init m48t59_rtc_init(void)
 {
-       return platform_driver_register(&m48t59_rtc_platdrv);
+       return platform_driver_register(&m48t59_rtc_driver);
 }
 
 static void __exit m48t59_rtc_exit(void)
 {
-       platform_driver_unregister(&m48t59_rtc_platdrv);
+       platform_driver_unregister(&m48t59_rtc_driver);
 }
 
 module_init(m48t59_rtc_init);
index 8c1012b432bb1e71b9378f25d87eac404583fb77..e2041b4d0c8569ba93791a166520145e8cdaa9cd 100644 (file)
@@ -542,8 +542,6 @@ static int s3c_rtc_probe(struct platform_device *pdev)
 
 /* RTC Power management control */
 
-static struct timespec s3c_rtc_delta;
-
 static int ticnt_save;
 
 static int s3c_rtc_suspend(struct platform_device *pdev, pm_message_t state)
index 78277a118b6773268d7813b33d3fbe19dc79d6d0..8e8c8b8e81ee8ae934a0966380de7e2de1e68cd0 100644 (file)
@@ -351,8 +351,10 @@ static int sh_rtc_read_time(struct device *dev, struct rtc_time *tm)
                tm->tm_sec, tm->tm_min, tm->tm_hour,
                tm->tm_mday, tm->tm_mon + 1, tm->tm_year, tm->tm_wday);
 
-       if (rtc_valid_tm(tm) < 0)
+       if (rtc_valid_tm(tm) < 0) {
                dev_err(dev, "invalid date\n");
+               rtc_time_to_tm(0, tm);
+       }
 
        return 0;
 }
@@ -588,7 +590,7 @@ static int __devinit sh_rtc_probe(struct platform_device *pdev)
 
        rtc->rtc_dev = rtc_device_register("sh", &pdev->dev,
                                           &sh_rtc_ops, THIS_MODULE);
-       if (IS_ERR(rtc)) {
+       if (IS_ERR(rtc->rtc_dev)) {
                ret = PTR_ERR(rtc->rtc_dev);
                goto err_badmap;
        }
index 8288b6b2bf2b2c9971efe99a74a08e579ee8c659..a265da7c6ff8db2908b0686bf376157a3017157f 100644 (file)
@@ -291,7 +291,7 @@ static ssize_t stk17ta8_nvram_write(struct kobject *kobj,
 static struct bin_attribute stk17ta8_nvram_attr = {
        .attr = {
                .name = "nvram",
-               .mode = S_IRUGO | S_IWUGO,
+               .mode = S_IRUGO | S_IWUSR,
                .owner = THIS_MODULE,
        },
        .size = RTC_OFFSET,
index 859f870552e3e019752e20274ec5144d7e556d8b..5e083d1f57e70a115dac935895d4e40bcd6a5624 100644 (file)
@@ -193,6 +193,12 @@ dcssblk_segment_warn(int rc, char* seg_name)
        }
 }
 
+static void dcssblk_unregister_callback(struct device *dev)
+{
+       device_unregister(dev);
+       put_device(dev);
+}
+
 /*
  * device attribute for switching shared/nonshared (exclusive)
  * operation (show + store)
@@ -276,8 +282,7 @@ removeseg:
        blk_cleanup_queue(dev_info->dcssblk_queue);
        dev_info->gd->queue = NULL;
        put_disk(dev_info->gd);
-       device_unregister(dev);
-       put_device(dev);
+       rc = device_schedule_callback(dev, dcssblk_unregister_callback);
 out:
        up_write(&dcssblk_devices_sem);
        return rc;
index 725b0dd142699f0f613aece0341cb67af9036867..f4c132ab39edef112c72faad0c492dd3971d0ed7 100644 (file)
@@ -343,10 +343,10 @@ static int cmf_copy_block(struct ccw_device *cdev)
 
        if (sch->schib.scsw.fctl & SCSW_FCTL_START_FUNC) {
                /* Don't copy if a start function is in progress. */
-               if ((!sch->schib.scsw.actl & SCSW_ACTL_SUSPENDED) &&
+               if ((!(sch->schib.scsw.actl & SCSW_ACTL_SUSPENDED)) &&
                    (sch->schib.scsw.actl &
                     (SCSW_ACTL_DEVACT | SCSW_ACTL_SCHACT)) &&
-                   (!sch->schib.scsw.stctl & SCSW_STCTL_SEC_STATUS))
+                   (!(sch->schib.scsw.stctl & SCSW_STCTL_SEC_STATUS)))
                        return -EBUSY;
        }
        cmb_data = cdev->private->cmb;
index 838f7ac0dc32420bc258e067c5283a8177406963..6db31089d2d7d4828caba71bc4b6c4a8da23be9e 100644 (file)
@@ -483,7 +483,7 @@ static DECLARE_WORK(css_reprobe_work, reprobe_all);
 void css_schedule_reprobe(void)
 {
        need_reprobe = 1;
-       queue_work(ccw_device_work, &css_reprobe_work);
+       queue_work(slow_path_wq, &css_reprobe_work);
 }
 
 EXPORT_SYMBOL_GPL(css_schedule_reprobe);
index 7ee57f084a89cd79c6f7afcd2caea817633f5877..74f6b539974a1d0310875e3cad4298ea3cf7ba82 100644 (file)
@@ -738,7 +738,7 @@ static int io_subchannel_initialize_dev(struct subchannel *sch,
        atomic_set(&cdev->private->onoff, 0);
        cdev->dev.parent = &sch->dev;
        cdev->dev.release = ccw_device_release;
-       INIT_LIST_HEAD(&cdev->private->kick_work.entry);
+       INIT_WORK(&cdev->private->kick_work, NULL);
        cdev->dev.groups = ccwdev_attr_groups;
        /* Do first half of device_register. */
        device_initialize(&cdev->dev);
index 8867443b806049e9b3a7ac19a076b3147fdb6b71..bfad421cda66a6bd82a253486d38450703eb6590 100644 (file)
@@ -1034,7 +1034,7 @@ device_trigger_reprobe(struct subchannel *sch)
        if (sch->schib.pmcw.dev != cdev->private->dev_id.devno) {
                PREPARE_WORK(&cdev->private->kick_work,
                             ccw_device_move_to_orphanage);
-               queue_work(ccw_device_work, &cdev->private->kick_work);
+               queue_work(slow_path_wq, &cdev->private->kick_work);
        } else
                ccw_device_start_id(cdev, 0);
 }
index f232832f2b22314e142d953c56ffc645e5dc205c..2f6bf462425e1eb8768b2fa2146be129bda1a9d6 100644 (file)
@@ -113,19 +113,10 @@ __ccw_device_sense_id_start(struct ccw_device *cdev)
 {
        struct subchannel *sch;
        struct ccw1 *ccw;
-       int ret;
 
        sch = to_subchannel(cdev->dev.parent);
        /* Setup sense channel program. */
        ccw = cdev->private->iccws;
-       if (sch->schib.pmcw.pim != 0x80) {
-               /* more than one path installed. */
-               ccw->cmd_code = CCW_CMD_SUSPEND_RECONN;
-               ccw->cda = 0;
-               ccw->count = 0;
-               ccw->flags = CCW_FLAG_SLI | CCW_FLAG_CC;
-               ccw++;
-       }
        ccw->cmd_code = CCW_CMD_SENSE_ID;
        ccw->cda = (__u32) __pa (&cdev->private->senseid);
        ccw->count = sizeof (struct senseid);
@@ -133,25 +124,9 @@ __ccw_device_sense_id_start(struct ccw_device *cdev)
 
        /* Reset device status. */
        memset(&cdev->private->irb, 0, sizeof(struct irb));
+       cdev->private->flags.intretry = 0;
 
-       /* Try on every path. */
-       ret = -ENODEV;
-       while (cdev->private->imask != 0) {
-               if ((sch->opm & cdev->private->imask) != 0 &&
-                   cdev->private->iretry > 0) {
-                       cdev->private->iretry--;
-                       /* Reset internal retry indication. */
-                       cdev->private->flags.intretry = 0;
-                       ret = cio_start (sch, cdev->private->iccws,
-                                        cdev->private->imask);
-                       /* ret is 0, -EBUSY, -EACCES or -ENODEV */
-                       if (ret != -EACCES)
-                               return ret;
-               }
-               cdev->private->imask >>= 1;
-               cdev->private->iretry = 5;
-       }
-       return ret;
+       return cio_start(sch, ccw, LPM_ANYPATH);
 }
 
 void
@@ -161,8 +136,7 @@ ccw_device_sense_id_start(struct ccw_device *cdev)
 
        memset (&cdev->private->senseid, 0, sizeof (struct senseid));
        cdev->private->senseid.cu_type = 0xFFFF;
-       cdev->private->imask = 0x80;
-       cdev->private->iretry = 5;
+       cdev->private->iretry = 3;
        ret = __ccw_device_sense_id_start(cdev);
        if (ret && ret != -EBUSY)
                ccw_device_sense_id_done(cdev, ret);
@@ -278,14 +252,13 @@ ccw_device_sense_id_irq(struct ccw_device *cdev, enum dev_event dev_event)
                ccw_device_sense_id_done(cdev, ret);
                break;
        case -EACCES:           /* channel is not operational. */
-               sch->lpm &= ~cdev->private->imask;
-               cdev->private->imask >>= 1;
-               cdev->private->iretry = 5;
-               /* fall through. */
        case -EAGAIN:           /* try again. */
-               ret = __ccw_device_sense_id_start(cdev);
-               if (ret == 0 || ret == -EBUSY)
-                       break;
+               cdev->private->iretry--;
+               if (cdev->private->iretry > 0) {
+                       ret = __ccw_device_sense_id_start(cdev);
+                       if (ret == 0 || ret == -EBUSY)
+                               break;
+               }
                /* fall through. */
        default:                /* Sense ID failed. Try asking VM. */
                if (MACHINE_IS_VM) {
index 3ccca5871fdfc002a922e17fea4c4dcb574808cb..47bb47b485814497e12201b3e4dd2f0697859504 100644 (file)
@@ -148,6 +148,10 @@ static int __init smsg_init(void)
 {
        int rc;
 
+       if (!MACHINE_IS_VM) {
+               rc = -EPROTONOSUPPORT;
+               goto out;
+       }
        rc = driver_register(&smsg_driver);
        if (rc != 0)
                goto out;
index 0754542978b68b91f92b1dcbd91ad7a8cac9e4f6..e268f79bdbd232de9f81edb5b8d6e291998051d2 100644 (file)
@@ -70,11 +70,12 @@ zfcp_sg_to_address(struct scatterlist *list)
  * zfcp_address_to_sg - set up struct scatterlist from kernel address
  * @address: kernel address
  * @list: struct scatterlist
+ * @size: buffer size
  */
 static inline void
-zfcp_address_to_sg(void *address, struct scatterlist *list)
+zfcp_address_to_sg(void *address, struct scatterlist *list, unsigned int size)
 {
-       sg_set_buf(list, address, 0);
+       sg_set_buf(list, address, size);
 }
 
 #define REQUEST_LIST_SIZE 128
index a5763c6e936232e8445be6de3e2bb048d2040c67..a6676be87843ad43d0c0fc57ff441993ac7a3985 100644 (file)
@@ -172,12 +172,12 @@ config CHR_DEV_SCH
          don't need this for those tiny 6-slot cdrom changers.  Media
          changers are listed as "Type: Medium Changer" in /proc/scsi/scsi.
          If you have such hardware and want to use it with linux, say Y
-         here.  Check <file:Documentation/scsi-changer.txt> for details.
+         here.  Check <file:Documentation/scsi/scsi-changer.txt> for details.
        
          If you want to compile this as a module ( = code which can be
          inserted in and removed from the running kernel whenever you want),
          say M here and read <file:Documentation/kbuild/modules.txt> and
-         <file:Documentation/scsi.txt>. The module will be called ch.o.
+         <file:Documentation/scsi/scsi.txt>. The module will be called ch.o.
          If unsure, say N.
        
 
@@ -725,7 +725,7 @@ config SCSI_FD_MCS
 
 config SCSI_GDTH
        tristate "Intel/ICP (former GDT SCSI Disk Array) RAID Controller support"
-       depends on (ISA || EISA || PCI) && SCSI && ISA_DMA_API
+       depends on (ISA || EISA || PCI) && SCSI && ISA_DMA_API && PCI_LEGACY
        ---help---
          Formerly called GDT SCSI Disk Array Controller Support.
 
index 72b0393b459675a0fbb9cc6c4ba0e1df07104183..1e6d7a9c75bfa28e2f62a5d45d4accd53f572925 100644 (file)
@@ -391,7 +391,7 @@ static int close_getadapter_fib(struct aac_dev * dev, void __user *arg)
                /*
                 *      Extract the fibctx from the input parameters
                 */
-               if (fibctx->unique == (u32)(ptrdiff_t)arg) /* We found a winner */
+               if (fibctx->unique == (u32)(uintptr_t)arg) /* We found a winner */
                        break;
                entry = entry->next;
                fibctx = NULL;
@@ -590,7 +590,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
                                }
                                addr = (u64)upsg->sg[i].addr[0];
                                addr += ((u64)upsg->sg[i].addr[1]) << 32;
-                               sg_user[i] = (void __user *)(ptrdiff_t)addr;
+                               sg_user[i] = (void __user *)(uintptr_t)addr;
                                sg_list[i] = p; // save so we can clean up later
                                sg_indx = i;
 
@@ -633,7 +633,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
                                        rcode = -ENOMEM;
                                        goto cleanup;
                                }
-                               sg_user[i] = (void __user *)(ptrdiff_t)usg->sg[i].addr;
+                               sg_user[i] = (void __user *)(uintptr_t)usg->sg[i].addr;
                                sg_list[i] = p; // save so we can clean up later
                                sg_indx = i;
 
@@ -664,7 +664,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
                if (actual_fibsize64 == fibsize) {
                        struct user_sgmap64* usg = (struct user_sgmap64 *)upsg;
                        for (i = 0; i < upsg->count; i++) {
-                               u64 addr;
+                               uintptr_t addr;
                                void* p;
                                /* Does this really need to be GFP_DMA? */
                                p = kmalloc(usg->sg[i].count,GFP_KERNEL|__GFP_DMA);
@@ -676,7 +676,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
                                }
                                addr = (u64)usg->sg[i].addr[0];
                                addr += ((u64)usg->sg[i].addr[1]) << 32;
-                               sg_user[i] = (void __user *)(ptrdiff_t)addr;
+                               sg_user[i] = (void __user *)addr;
                                sg_list[i] = p; // save so we can clean up later
                                sg_indx = i;
 
@@ -704,7 +704,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
                                        rcode = -ENOMEM;
                                        goto cleanup;
                                }
-                               sg_user[i] = (void __user *)(ptrdiff_t)upsg->sg[i].addr;
+                               sg_user[i] = (void __user *)(uintptr_t)upsg->sg[i].addr;
                                sg_list[i] = p; // save so we can clean up later
                                sg_indx = i;
 
index 3009ad8c407343d209e9b4d0a79639f0dbbfd4fe..8736813a029657b494d143b93f7b83f484523693 100644 (file)
@@ -110,7 +110,7 @@ static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long co
        /*
         *      Align the beginning of Headers to commalign
         */
-       align = (commalign - ((ptrdiff_t)(base) & (commalign - 1)));
+       align = (commalign - ((uintptr_t)(base) & (commalign - 1)));
        base = base + align;
        phys = phys + align;
        /*
index fcd25f7d0bc636252074d535338d3c9f9e2e81f0..e6032ffc66a693597b685c859fc994cac64eedc0 100644 (file)
@@ -254,7 +254,7 @@ unsigned int aac_intr_normal(struct aac_dev * dev, u32 Index)
                        kfree (fib);
                        return 1;
                }
-               memcpy(hw_fib, (struct hw_fib *)(((ptrdiff_t)(dev->regs.sa)) +
+               memcpy(hw_fib, (struct hw_fib *)(((uintptr_t)(dev->regs.sa)) +
                  (index & ~0x00000002L)), sizeof(struct hw_fib));
                INIT_LIST_HEAD(&fib->fiblink);
                fib->type = FSAFS_NTC_FIB_CONTEXT;
index 5b0932f6147389c5c0919a799036b75b2b69b3ed..06509bff71f7b5fa23cbd37295ba0294c4e99cee 100644 (file)
@@ -377,7 +377,7 @@ out:
 
 #define FLASH_RESET                    0xF0
 
-#define FLASH_SIZE                      0x200000
+#define ASD_FLASH_SIZE                  0x200000
 #define FLASH_DIR_COOKIE                "*** ADAPTEC FLASH DIRECTORY *** "
 #define FLASH_NEXT_ENTRY_OFFS          0x2000
 #define FLASH_MAX_DIR_ENTRIES          32
@@ -609,7 +609,7 @@ static int asd_find_flash_dir(struct asd_ha_struct *asd_ha,
                              struct asd_flash_dir *flash_dir)
 {
        u32 v;
-       for (v = 0; v < FLASH_SIZE; v += FLASH_NEXT_ENTRY_OFFS) {
+       for (v = 0; v < ASD_FLASH_SIZE; v += FLASH_NEXT_ENTRY_OFFS) {
                asd_read_flash_seg(asd_ha, flash_dir, v,
                                   sizeof(FLASH_DIR_COOKIE)-1);
                if (memcmp(flash_dir->cookie, FLASH_DIR_COOKIE,
index ace7a15b413e42ba499847b2e5912f0f2cc7b56f..a67e29f83ae5003cdcb8e65e75951d7fee3093b6 100644 (file)
@@ -141,14 +141,14 @@ struct CMD_MESSAGE_FIELD
 #define IS_SG64_ADDR                0x01000000 /* bit24 */
 struct  SG32ENTRY
 {
-       uint32_t                                        length;
-       uint32_t                                        address;
+       __le32                                  length;
+       __le32                                  address;
 };
 struct  SG64ENTRY
 {
-       uint32_t                                        length;
-       uint32_t                                        address;
-       uint32_t                                        addresshigh;
+       __le32                                  length;
+       __le32                                  address;
+       __le32                                  addresshigh;
 };
 struct SGENTRY_UNION
 {
@@ -339,23 +339,15 @@ struct MessageUnit_B
        uint32_t        done_qbuffer[ARCMSR_MAX_HBB_POSTQUEUE];
        uint32_t        postq_index;
        uint32_t        doneq_index;
-       uint32_t        *drv2iop_doorbell_reg;
-       uint32_t        *drv2iop_doorbell_mask_reg;
-       uint32_t        *iop2drv_doorbell_reg;
-       uint32_t        *iop2drv_doorbell_mask_reg;
-       uint32_t        *msgcode_rwbuffer_reg;
-       uint32_t        *ioctl_wbuffer_reg;
-       uint32_t        *ioctl_rbuffer_reg;
+       uint32_t        __iomem *drv2iop_doorbell_reg;
+       uint32_t        __iomem *drv2iop_doorbell_mask_reg;
+       uint32_t        __iomem *iop2drv_doorbell_reg;
+       uint32_t        __iomem *iop2drv_doorbell_mask_reg;
+       uint32_t        __iomem *msgcode_rwbuffer_reg;
+       uint32_t        __iomem *ioctl_wbuffer_reg;
+       uint32_t        __iomem *ioctl_rbuffer_reg;
 };
 
-struct MessageUnit
-{
-       union
-       {
-               struct MessageUnit_A    pmu_A;
-               struct MessageUnit_B    pmu_B;
-       } u;
-};
 /*
 *******************************************************************************
 **                 Adapter Control Block
@@ -374,7 +366,10 @@ struct AdapterControlBlock
        /* Offset is used in making arc cdb physical to virtual calculations */
        uint32_t                        outbound_int_enable;
 
-       struct MessageUnit *                    pmu;
+       union {
+               struct MessageUnit_A __iomem *  pmuA;
+               struct MessageUnit_B *          pmuB;
+       };
        /* message unit ATU inbound base address0 */
 
        uint32_t                        acb_flags;
@@ -558,7 +553,7 @@ struct SENSE_DATA
 
 extern void arcmsr_post_ioctldata2iop(struct AdapterControlBlock *);
 extern void arcmsr_iop_message_read(struct AdapterControlBlock *);
-extern struct QBUFFER *arcmsr_get_iop_rqbuffer(struct AdapterControlBlock *);
+extern struct QBUFFER __iomem *arcmsr_get_iop_rqbuffer(struct AdapterControlBlock *);
 extern struct class_device_attribute *arcmsr_host_attrs[];
 extern int arcmsr_alloc_sysfs_attr(struct AdapterControlBlock *);
 void arcmsr_free_sysfs_attr(struct AdapterControlBlock *acb);
index d04d1aa28fa4512c1196768ac3511be520584e71..7d7b0a5542766a23717c598d0231bb57b8612ca6 100644 (file)
@@ -85,13 +85,13 @@ static ssize_t arcmsr_sysfs_iop_message_read(struct kobject *kobj,
                allxfer_len++;
        }
        if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) {
-               struct QBUFFER *prbuffer;
-               uint8_t *iop_data;
+               struct QBUFFER __iomem *prbuffer;
+               uint8_t __iomem *iop_data;
                int32_t iop_len;
 
                acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW;
                prbuffer = arcmsr_get_iop_rqbuffer(acb);
-               iop_data = (uint8_t *)prbuffer->data;
+               iop_data = prbuffer->data;
                iop_len = readl(&prbuffer->data_len);
                while (iop_len > 0) {
                        acb->rqbuffer[acb->rqbuf_lastindex] = readb(iop_data);
index f7a252885a5c69855e3aa3595dd4d2070a365ef1..d466a2dac1dbcba2d5e28d44260408bfa6979792 100644 (file)
@@ -236,18 +236,22 @@ static int arcmsr_alloc_ccb_pool(struct AdapterControlBlock *acb)
                uint32_t intmask_org;
                int i, j;
 
-               acb->pmu = ioremap(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0));
-               if (!acb->pmu) {
+               acb->pmuA = ioremap(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0));
+               if (!acb->pmuA) {
                        printk(KERN_NOTICE "arcmsr%d: memory mapping region fail \n",
                                                        acb->host->host_no);
+                       return -ENOMEM;
                }
 
                dma_coherent = dma_alloc_coherent(&pdev->dev,
                        ARCMSR_MAX_FREECCB_NUM *
                        sizeof (struct CommandControlBlock) + 0x20,
                        &dma_coherent_handle, GFP_KERNEL);
-               if (!dma_coherent)
+
+               if (!dma_coherent) {
+                       iounmap(acb->pmuA);
                        return -ENOMEM;
+               }
 
                acb->dma_coherent = dma_coherent;
                acb->dma_coherent_handle = dma_coherent_handle;
@@ -287,7 +291,7 @@ static int arcmsr_alloc_ccb_pool(struct AdapterControlBlock *acb)
 
                struct pci_dev *pdev = acb->pdev;
                struct MessageUnit_B *reg;
-               void *mem_base0, *mem_base1;
+               void __iomem *mem_base0, *mem_base1;
                void *dma_coherent;
                dma_addr_t dma_coherent_handle, dma_addr;
                uint32_t intmask_org;
@@ -328,25 +332,28 @@ static int arcmsr_alloc_ccb_pool(struct AdapterControlBlock *acb)
 
                reg = (struct MessageUnit_B *)(dma_coherent +
                ARCMSR_MAX_FREECCB_NUM * sizeof(struct CommandControlBlock));
-               acb->pmu = (struct MessageUnit *)reg;
+               acb->pmuB = reg;
                mem_base0 = ioremap(pci_resource_start(pdev, 0),
                                        pci_resource_len(pdev, 0));
+               if (!mem_base0)
+                       goto out;
+
                mem_base1 = ioremap(pci_resource_start(pdev, 2),
                                        pci_resource_len(pdev, 2));
-               reg->drv2iop_doorbell_reg = (uint32_t *)((char *)mem_base0 +
-                                               ARCMSR_DRV2IOP_DOORBELL);
-               reg->drv2iop_doorbell_mask_reg = (uint32_t *)((char *)mem_base0 +
-                                               ARCMSR_DRV2IOP_DOORBELL_MASK);
-               reg->iop2drv_doorbell_reg = (uint32_t *)((char *)mem_base0 +
-                                                       ARCMSR_IOP2DRV_DOORBELL);
-               reg->iop2drv_doorbell_mask_reg = (uint32_t *)((char *)mem_base0 +
-                                               ARCMSR_IOP2DRV_DOORBELL_MASK);
-               reg->ioctl_wbuffer_reg = (uint32_t *)((char *)mem_base1 +
-                                                       ARCMSR_IOCTL_WBUFFER);
-               reg->ioctl_rbuffer_reg = (uint32_t *)((char *)mem_base1 +
-                                                       ARCMSR_IOCTL_RBUFFER);
-               reg->msgcode_rwbuffer_reg = (uint32_t *)((char *)mem_base1 +
-                                                       ARCMSR_MSGCODE_RWBUFFER);
+               if (!mem_base1) {
+                       iounmap(mem_base0);
+                       goto out;
+               }
+
+               reg->drv2iop_doorbell_reg = mem_base0 + ARCMSR_DRV2IOP_DOORBELL;
+               reg->drv2iop_doorbell_mask_reg = mem_base0 +
+                                               ARCMSR_DRV2IOP_DOORBELL_MASK;
+               reg->iop2drv_doorbell_reg = mem_base0 + ARCMSR_IOP2DRV_DOORBELL;
+               reg->iop2drv_doorbell_mask_reg = mem_base0 +
+                                               ARCMSR_IOP2DRV_DOORBELL_MASK;
+               reg->ioctl_wbuffer_reg = mem_base1 + ARCMSR_IOCTL_WBUFFER;
+               reg->ioctl_rbuffer_reg = mem_base1 + ARCMSR_IOCTL_RBUFFER;
+               reg->msgcode_rwbuffer_reg = mem_base1 + ARCMSR_MSGCODE_RWBUFFER;
 
                acb->vir2phy_offset = (unsigned long)ccb_tmp -(unsigned long)dma_addr;
                for (i = 0; i < ARCMSR_MAX_TARGETID; i++)
@@ -362,6 +369,12 @@ static int arcmsr_alloc_ccb_pool(struct AdapterControlBlock *acb)
                break;
        }
        return 0;
+
+out:
+       dma_free_coherent(&acb->pdev->dev,
+               ARCMSR_MAX_FREECCB_NUM * sizeof(struct CommandControlBlock) + 0x20,
+               acb->dma_coherent, acb->dma_coherent_handle);
+       return -ENOMEM;
 }
 
 static int arcmsr_probe(struct pci_dev *pdev,
@@ -454,7 +467,6 @@ static int arcmsr_probe(struct pci_dev *pdev,
        free_irq(pdev->irq, acb);
  out_free_ccb_pool:
        arcmsr_free_ccb_pool(acb);
-       iounmap(acb->pmu);
  out_release_regions:
        pci_release_regions(pdev);
  out_host_put:
@@ -467,7 +479,7 @@ static int arcmsr_probe(struct pci_dev *pdev,
 
 static uint8_t arcmsr_hba_wait_msgint_ready(struct AdapterControlBlock *acb)
 {
-       struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+       struct MessageUnit_A __iomem *reg = acb->pmuA;
        uint32_t Index;
        uint8_t Retries = 0x00;
 
@@ -488,7 +500,7 @@ static uint8_t arcmsr_hba_wait_msgint_ready(struct AdapterControlBlock *acb)
 
 static uint8_t arcmsr_hbb_wait_msgint_ready(struct AdapterControlBlock *acb)
 {
-       struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+       struct MessageUnit_B *reg = acb->pmuB;
        uint32_t Index;
        uint8_t Retries = 0x00;
 
@@ -509,7 +521,7 @@ static uint8_t arcmsr_hbb_wait_msgint_ready(struct AdapterControlBlock *acb)
 
 static void arcmsr_abort_hba_allcmd(struct AdapterControlBlock *acb)
 {
-       struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+       struct MessageUnit_A __iomem *reg = acb->pmuA;
 
        writel(ARCMSR_INBOUND_MESG0_ABORT_CMD, &reg->inbound_msgaddr0);
        if (arcmsr_hba_wait_msgint_ready(acb))
@@ -520,7 +532,7 @@ static void arcmsr_abort_hba_allcmd(struct AdapterControlBlock *acb)
 
 static void arcmsr_abort_hbb_allcmd(struct AdapterControlBlock *acb)
 {
-       struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+       struct MessageUnit_B *reg = acb->pmuB;
 
        writel(ARCMSR_MESSAGE_ABORT_CMD, reg->drv2iop_doorbell_reg);
        if (arcmsr_hbb_wait_msgint_ready(acb))
@@ -566,7 +578,7 @@ static void arcmsr_ccb_complete(struct CommandControlBlock *ccb, int stand_flag)
 
 static void arcmsr_flush_hba_cache(struct AdapterControlBlock *acb)
 {
-       struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+       struct MessageUnit_A __iomem *reg = acb->pmuA;
        int retry_count = 30;
 
        writel(ARCMSR_INBOUND_MESG0_FLUSH_CACHE, &reg->inbound_msgaddr0);
@@ -583,7 +595,7 @@ static void arcmsr_flush_hba_cache(struct AdapterControlBlock *acb)
 
 static void arcmsr_flush_hbb_cache(struct AdapterControlBlock *acb)
 {
-       struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+       struct MessageUnit_B *reg = acb->pmuB;
        int retry_count = 30;
 
        writel(ARCMSR_MESSAGE_FLUSH_CACHE, reg->drv2iop_doorbell_reg);
@@ -637,7 +649,7 @@ static u32 arcmsr_disable_outbound_ints(struct AdapterControlBlock *acb)
        switch (acb->adapter_type) {
 
        case ACB_ADAPTER_TYPE_A : {
-               struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+               struct MessageUnit_A __iomem *reg = acb->pmuA;
                orig_mask = readl(&reg->outbound_intmask)|\
                                ARCMSR_MU_OUTBOUND_MESSAGE0_INTMASKENABLE;
                writel(orig_mask|ARCMSR_MU_OUTBOUND_ALL_INTMASKENABLE, \
@@ -646,7 +658,7 @@ static u32 arcmsr_disable_outbound_ints(struct AdapterControlBlock *acb)
                break;
 
        case ACB_ADAPTER_TYPE_B : {
-               struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+               struct MessageUnit_B *reg = acb->pmuB;
                orig_mask = readl(reg->iop2drv_doorbell_mask_reg) & \
                                        (~ARCMSR_IOP2DRV_MESSAGE_CMD_DONE);
                writel(0, reg->iop2drv_doorbell_mask_reg);
@@ -748,14 +760,13 @@ static void arcmsr_done4abort_postqueue(struct AdapterControlBlock *acb)
        switch (acb->adapter_type) {
 
        case ACB_ADAPTER_TYPE_A: {
-               struct MessageUnit_A __iomem *reg = \
-                       (struct MessageUnit_A *)acb->pmu;
+               struct MessageUnit_A __iomem *reg = acb->pmuA;
                uint32_t outbound_intstatus;
-               outbound_intstatus = readl(&reg->outbound_intstatus) & \
+               outbound_intstatus = readl(&reg->outbound_intstatus) &
                                        acb->outbound_int_enable;
                /*clear and abort all outbound posted Q*/
                writel(outbound_intstatus, &reg->outbound_intstatus);/*clear interrupt*/
-               while (((flag_ccb = readl(&reg->outbound_queueport)) != 0xFFFFFFFF) \
+               while (((flag_ccb = readl(&reg->outbound_queueport)) != 0xFFFFFFFF)
                                && (i++ < ARCMSR_MAX_OUTSTANDING_CMD)) {
                        arcmsr_drain_donequeue(acb, flag_ccb);
                }
@@ -763,7 +774,7 @@ static void arcmsr_done4abort_postqueue(struct AdapterControlBlock *acb)
                break;
 
        case ACB_ADAPTER_TYPE_B: {
-               struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+               struct MessageUnit_B *reg = acb->pmuB;
                /*clear all outbound posted Q*/
                for (i = 0; i < ARCMSR_MAX_HBB_POSTQUEUE; i++) {
                        if ((flag_ccb = readl(&reg->done_qbuffer[i])) != 0) {
@@ -816,7 +827,6 @@ static void arcmsr_remove(struct pci_dev *pdev)
        }
 
        free_irq(pdev->irq, acb);
-       iounmap(acb->pmu);
        arcmsr_free_ccb_pool(acb);
        pci_release_regions(pdev);
 
@@ -859,7 +869,7 @@ static void arcmsr_enable_outbound_ints(struct AdapterControlBlock *acb, \
        switch (acb->adapter_type) {
 
        case ACB_ADAPTER_TYPE_A : {
-               struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+               struct MessageUnit_A __iomem *reg = acb->pmuA;
                mask = intmask_org & ~(ARCMSR_MU_OUTBOUND_POSTQUEUE_INTMASKENABLE |
                             ARCMSR_MU_OUTBOUND_DOORBELL_INTMASKENABLE);
                writel(mask, &reg->outbound_intmask);
@@ -868,7 +878,7 @@ static void arcmsr_enable_outbound_ints(struct AdapterControlBlock *acb, \
                break;
 
        case ACB_ADAPTER_TYPE_B : {
-               struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+               struct MessageUnit_B *reg = acb->pmuB;
                mask = intmask_org | (ARCMSR_IOP2DRV_DATA_WRITE_OK | \
                        ARCMSR_IOP2DRV_DATA_READ_OK | ARCMSR_IOP2DRV_CDB_DONE);
                writel(mask, reg->iop2drv_doorbell_mask_reg);
@@ -882,7 +892,7 @@ static void arcmsr_build_ccb(struct AdapterControlBlock *acb,
 {
        struct ARCMSR_CDB *arcmsr_cdb = (struct ARCMSR_CDB *)&ccb->arcmsr_cdb;
        int8_t *psge = (int8_t *)&arcmsr_cdb->u;
-       uint32_t address_lo, address_hi;
+       __le32 address_lo, address_hi;
        int arccdbsize = 0x30;
        int nseg;
 
@@ -900,7 +910,8 @@ static void arcmsr_build_ccb(struct AdapterControlBlock *acb,
        BUG_ON(nseg < 0);
 
        if (nseg) {
-               int length, i, cdb_sgcount = 0;
+               __le32 length;
+               int i, cdb_sgcount = 0;
                struct scatterlist *sg;
 
                /* map stor port SG list to our iop SG List. */
@@ -921,7 +932,7 @@ static void arcmsr_build_ccb(struct AdapterControlBlock *acb,
 
                                pdma_sg->addresshigh = address_hi;
                                pdma_sg->address = address_lo;
-                               pdma_sg->length = length|IS_SG64_ADDR;
+                               pdma_sg->length = length|cpu_to_le32(IS_SG64_ADDR);
                                psge += sizeof (struct SG64ENTRY);
                                arccdbsize += sizeof (struct SG64ENTRY);
                        }
@@ -947,7 +958,7 @@ static void arcmsr_post_ccb(struct AdapterControlBlock *acb, struct CommandContr
 
        switch (acb->adapter_type) {
        case ACB_ADAPTER_TYPE_A: {
-               struct MessageUnit_A *reg = (struct MessageUnit_A *)acb->pmu;
+               struct MessageUnit_A __iomem *reg = acb->pmuA;
 
                if (arcmsr_cdb->Flags & ARCMSR_CDB_FLAG_SGL_BSIZE)
                        writel(cdb_shifted_phyaddr | ARCMSR_CCBPOST_FLAG_SGL_BSIZE,
@@ -959,7 +970,7 @@ static void arcmsr_post_ccb(struct AdapterControlBlock *acb, struct CommandContr
                break;
 
        case ACB_ADAPTER_TYPE_B: {
-               struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+               struct MessageUnit_B *reg = acb->pmuB;
                uint32_t ending_index, index = reg->postq_index;
 
                ending_index = ((index + 1) % ARCMSR_MAX_HBB_POSTQUEUE);
@@ -982,7 +993,7 @@ static void arcmsr_post_ccb(struct AdapterControlBlock *acb, struct CommandContr
 
 static void arcmsr_stop_hba_bgrb(struct AdapterControlBlock *acb)
 {
-       struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+       struct MessageUnit_A __iomem *reg = acb->pmuA;
        acb->acb_flags &= ~ACB_F_MSG_START_BGRB;
        writel(ARCMSR_INBOUND_MESG0_STOP_BGRB, &reg->inbound_msgaddr0);
 
@@ -995,7 +1006,7 @@ static void arcmsr_stop_hba_bgrb(struct AdapterControlBlock *acb)
 
 static void arcmsr_stop_hbb_bgrb(struct AdapterControlBlock *acb)
 {
-       struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+       struct MessageUnit_B *reg = acb->pmuB;
        acb->acb_flags &= ~ACB_F_MSG_START_BGRB;
        writel(ARCMSR_MESSAGE_STOP_BGRB, reg->drv2iop_doorbell_reg);
 
@@ -1023,6 +1034,17 @@ static void arcmsr_stop_adapter_bgrb(struct AdapterControlBlock *acb)
 
 static void arcmsr_free_ccb_pool(struct AdapterControlBlock *acb)
 {
+       switch (acb->adapter_type) {
+       case ACB_ADAPTER_TYPE_A: {
+               iounmap(acb->pmuA);
+               break;
+       }
+       case ACB_ADAPTER_TYPE_B: {
+               struct MessageUnit_B *reg = acb->pmuB;
+               iounmap(reg->drv2iop_doorbell_reg - ARCMSR_DRV2IOP_DOORBELL);
+               iounmap(reg->ioctl_wbuffer_reg - ARCMSR_IOCTL_WBUFFER);
+       }
+       }
        dma_free_coherent(&acb->pdev->dev,
                ARCMSR_MAX_FREECCB_NUM * sizeof (struct CommandControlBlock) + 0x20,
                acb->dma_coherent,
@@ -1033,13 +1055,13 @@ void arcmsr_iop_message_read(struct AdapterControlBlock *acb)
 {
        switch (acb->adapter_type) {
        case ACB_ADAPTER_TYPE_A: {
-               struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+               struct MessageUnit_A __iomem *reg = acb->pmuA;
                writel(ARCMSR_INBOUND_DRIVER_DATA_READ_OK, &reg->inbound_doorbell);
                }
                break;
 
        case ACB_ADAPTER_TYPE_B: {
-               struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+               struct MessageUnit_B *reg = acb->pmuB;
                writel(ARCMSR_DRV2IOP_DATA_READ_OK, reg->drv2iop_doorbell_reg);
                }
                break;
@@ -1050,7 +1072,7 @@ static void arcmsr_iop_message_wrote(struct AdapterControlBlock *acb)
 {
        switch (acb->adapter_type) {
        case ACB_ADAPTER_TYPE_A: {
-               struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+               struct MessageUnit_A __iomem *reg = acb->pmuA;
                /*
                ** push inbound doorbell tell iop, driver data write ok
                ** and wait reply on next hwinterrupt for next Qbuffer post
@@ -1060,7 +1082,7 @@ static void arcmsr_iop_message_wrote(struct AdapterControlBlock *acb)
                break;
 
        case ACB_ADAPTER_TYPE_B: {
-               struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+               struct MessageUnit_B *reg = acb->pmuB;
                /*
                ** push inbound doorbell tell iop, driver data write ok
                ** and wait reply on next hwinterrupt for next Qbuffer post
@@ -1071,41 +1093,41 @@ static void arcmsr_iop_message_wrote(struct AdapterControlBlock *acb)
        }
 }
 
-struct QBUFFER *arcmsr_get_iop_rqbuffer(struct AdapterControlBlock *acb)
+struct QBUFFER __iomem *arcmsr_get_iop_rqbuffer(struct AdapterControlBlock *acb)
 {
-       static struct QBUFFER *qbuffer;
+       struct QBUFFER __iomem *qbuffer = NULL;
 
        switch (acb->adapter_type) {
 
        case ACB_ADAPTER_TYPE_A: {
-               struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
-               qbuffer = (struct QBUFFER __iomem *) &reg->message_rbuffer;
+               struct MessageUnit_A __iomem *reg = acb->pmuA;
+               qbuffer = (struct QBUFFER __iomem *)&reg->message_rbuffer;
                }
                break;
 
        case ACB_ADAPTER_TYPE_B: {
-               struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
-               qbuffer = (struct QBUFFER __iomem *) reg->ioctl_rbuffer_reg;
+               struct MessageUnit_B *reg = acb->pmuB;
+               qbuffer = (struct QBUFFER __iomem *)reg->ioctl_rbuffer_reg;
                }
                break;
        }
        return qbuffer;
 }
 
-static struct QBUFFER *arcmsr_get_iop_wqbuffer(struct AdapterControlBlock *acb)
+static struct QBUFFER __iomem *arcmsr_get_iop_wqbuffer(struct AdapterControlBlock *acb)
 {
-       static struct QBUFFER *pqbuffer;
+       struct QBUFFER __iomem *pqbuffer = NULL;
 
        switch (acb->adapter_type) {
 
        case ACB_ADAPTER_TYPE_A: {
-               struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
-               pqbuffer = (struct QBUFFER *) &reg->message_wbuffer;
+               struct MessageUnit_A __iomem *reg = acb->pmuA;
+               pqbuffer = (struct QBUFFER __iomem *) &reg->message_wbuffer;
                }
                break;
 
        case ACB_ADAPTER_TYPE_B: {
-               struct MessageUnit_B  *reg = (struct MessageUnit_B *)acb->pmu;
+               struct MessageUnit_B  *reg = acb->pmuB;
                pqbuffer = (struct QBUFFER __iomem *)reg->ioctl_wbuffer_reg;
                }
                break;
@@ -1115,15 +1137,15 @@ static struct QBUFFER *arcmsr_get_iop_wqbuffer(struct AdapterControlBlock *acb)
 
 static void arcmsr_iop2drv_data_wrote_handle(struct AdapterControlBlock *acb)
 {
-       struct QBUFFER *prbuffer;
+       struct QBUFFER __iomem *prbuffer;
        struct QBUFFER *pQbuffer;
-       uint8_t *iop_data;
+       uint8_t __iomem *iop_data;
        int32_t my_empty_len, iop_len, rqbuf_firstindex, rqbuf_lastindex;
 
        rqbuf_lastindex = acb->rqbuf_lastindex;
        rqbuf_firstindex = acb->rqbuf_firstindex;
        prbuffer = arcmsr_get_iop_rqbuffer(acb);
-       iop_data = (uint8_t *)prbuffer->data;
+       iop_data = (uint8_t __iomem *)prbuffer->data;
        iop_len = prbuffer->data_len;
        my_empty_len = (rqbuf_firstindex - rqbuf_lastindex -1)&(ARCMSR_MAX_QBUFFER -1);
 
@@ -1151,8 +1173,8 @@ static void arcmsr_iop2drv_data_read_handle(struct AdapterControlBlock *acb)
        acb->acb_flags |= ACB_F_MESSAGE_WQBUFFER_READED;
        if (acb->wqbuf_firstindex != acb->wqbuf_lastindex) {
                uint8_t *pQbuffer;
-               struct QBUFFER *pwbuffer;
-               uint8_t *iop_data;
+               struct QBUFFER __iomem *pwbuffer;
+               uint8_t __iomem *iop_data;
                int32_t allxfer_len = 0;
 
                acb->acb_flags &= (~ACB_F_MESSAGE_WQBUFFER_READED);
@@ -1181,7 +1203,7 @@ static void arcmsr_iop2drv_data_read_handle(struct AdapterControlBlock *acb)
 static void arcmsr_hba_doorbell_isr(struct AdapterControlBlock *acb)
 {
        uint32_t outbound_doorbell;
-       struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+       struct MessageUnit_A __iomem *reg = acb->pmuA;
 
        outbound_doorbell = readl(&reg->outbound_doorbell);
        writel(outbound_doorbell, &reg->outbound_doorbell);
@@ -1197,7 +1219,7 @@ static void arcmsr_hba_doorbell_isr(struct AdapterControlBlock *acb)
 static void arcmsr_hba_postqueue_isr(struct AdapterControlBlock *acb)
 {
        uint32_t flag_ccb;
-       struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+       struct MessageUnit_A __iomem *reg = acb->pmuA;
 
        while ((flag_ccb = readl(&reg->outbound_queueport)) != 0xFFFFFFFF) {
                arcmsr_drain_donequeue(acb, flag_ccb);
@@ -1208,7 +1230,7 @@ static void arcmsr_hbb_postqueue_isr(struct AdapterControlBlock *acb)
 {
        uint32_t index;
        uint32_t flag_ccb;
-       struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+       struct MessageUnit_B *reg = acb->pmuB;
 
        index = reg->doneq_index;
 
@@ -1224,7 +1246,7 @@ static void arcmsr_hbb_postqueue_isr(struct AdapterControlBlock *acb)
 static int arcmsr_handle_hba_isr(struct AdapterControlBlock *acb)
 {
        uint32_t outbound_intstatus;
-       struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+       struct MessageUnit_A __iomem *reg = acb->pmuA;
 
        outbound_intstatus = readl(&reg->outbound_intstatus) & \
                                                        acb->outbound_int_enable;
@@ -1244,7 +1266,7 @@ static int arcmsr_handle_hba_isr(struct AdapterControlBlock *acb)
 static int arcmsr_handle_hbb_isr(struct AdapterControlBlock *acb)
 {
        uint32_t outbound_doorbell;
-       struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+       struct MessageUnit_B *reg = acb->pmuB;
 
        outbound_doorbell = readl(reg->iop2drv_doorbell_reg) & \
                                                        acb->outbound_int_enable;
@@ -1305,8 +1327,8 @@ void arcmsr_post_ioctldata2iop(struct AdapterControlBlock *acb)
 {
        int32_t wqbuf_firstindex, wqbuf_lastindex;
        uint8_t *pQbuffer;
-       struct QBUFFER *pwbuffer;
-       uint8_t *iop_data;
+       struct QBUFFER __iomem *pwbuffer;
+       uint8_t __iomem *iop_data;
        int32_t allxfer_len = 0;
 
        pwbuffer = arcmsr_get_iop_wqbuffer(acb);
@@ -1380,13 +1402,13 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, \
                }
                if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) {
 
-                       struct QBUFFER *prbuffer;
-                       uint8_t *iop_data;
+                       struct QBUFFER __iomem *prbuffer;
+                       uint8_t __iomem *iop_data;
                        int32_t iop_len;
 
                        acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW;
                        prbuffer = arcmsr_get_iop_rqbuffer(acb);
-                       iop_data = (uint8_t *)prbuffer->data;
+                       iop_data = prbuffer->data;
                        iop_len = readl(&prbuffer->data_len);
                        while (iop_len > 0) {
                                acb->rqbuffer[acb->rqbuf_lastindex] = readb(iop_data);
@@ -1669,11 +1691,11 @@ static int arcmsr_queue_command(struct scsi_cmnd *cmd,
 
 static void arcmsr_get_hba_config(struct AdapterControlBlock *acb)
 {
-       struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+       struct MessageUnit_A __iomem *reg = acb->pmuA;
        char *acb_firm_model = acb->firm_model;
        char *acb_firm_version = acb->firm_version;
-       char *iop_firm_model = (char *) (&reg->message_rwbuffer[15]);
-       char *iop_firm_version = (char *) (&reg->message_rwbuffer[17]);
+       char __iomem *iop_firm_model = (char __iomem *)(&reg->message_rwbuffer[15]);
+       char __iomem *iop_firm_version = (char __iomem *)(&reg->message_rwbuffer[17]);
        int count;
 
        writel(ARCMSR_INBOUND_MESG0_GET_CONFIG, &reg->inbound_msgaddr0);
@@ -1710,13 +1732,13 @@ static void arcmsr_get_hba_config(struct AdapterControlBlock *acb)
 
 static void arcmsr_get_hbb_config(struct AdapterControlBlock *acb)
 {
-       struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
-       uint32_t *lrwbuffer = reg->msgcode_rwbuffer_reg;
+       struct MessageUnit_B *reg = acb->pmuB;
+       uint32_t __iomem *lrwbuffer = reg->msgcode_rwbuffer_reg;
        char *acb_firm_model = acb->firm_model;
        char *acb_firm_version = acb->firm_version;
-       char *iop_firm_model = (char *) (&lrwbuffer[15]);
+       char __iomem *iop_firm_model = (char __iomem *)(&lrwbuffer[15]);
        /*firm_model,15,60-67*/
-       char *iop_firm_version = (char *) (&lrwbuffer[17]);
+       char __iomem *iop_firm_version = (char __iomem *)(&lrwbuffer[17]);
        /*firm_version,17,68-83*/
        int count;
 
@@ -1777,7 +1799,7 @@ static void arcmsr_get_firmware_spec(struct AdapterControlBlock *acb)
 static void arcmsr_polling_hba_ccbdone(struct AdapterControlBlock *acb,
        struct CommandControlBlock *poll_ccb)
 {
-       struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+       struct MessageUnit_A __iomem *reg = acb->pmuA;
        struct CommandControlBlock *ccb;
        uint32_t flag_ccb, outbound_intstatus, poll_ccb_done = 0, poll_count = 0;
 
@@ -1826,7 +1848,7 @@ static void arcmsr_polling_hba_ccbdone(struct AdapterControlBlock *acb,
 static void arcmsr_polling_hbb_ccbdone(struct AdapterControlBlock *acb, \
                                        struct CommandControlBlock *poll_ccb)
 {
-               struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+               struct MessageUnit_B *reg = acb->pmuB;
                struct CommandControlBlock *ccb;
                uint32_t flag_ccb, poll_ccb_done = 0, poll_count = 0;
                int index;
@@ -1918,8 +1940,7 @@ static int arcmsr_iop_confirm(struct AdapterControlBlock *acb)
 
        case ACB_ADAPTER_TYPE_A: {
                if (ccb_phyaddr_hi32 != 0) {
-                       struct MessageUnit_A __iomem *reg = \
-                                       (struct MessageUnit_A *)acb->pmu;
+                       struct MessageUnit_A __iomem *reg = acb->pmuA;
                        uint32_t intmask_org;
                        intmask_org = arcmsr_disable_outbound_ints(acb);
                        writel(ARCMSR_SIGNATURE_SET_CONFIG, \
@@ -1940,9 +1961,9 @@ static int arcmsr_iop_confirm(struct AdapterControlBlock *acb)
 
        case ACB_ADAPTER_TYPE_B: {
                unsigned long post_queue_phyaddr;
-               uint32_t *rwbuffer;
+               uint32_t __iomem *rwbuffer;
 
-               struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+               struct MessageUnit_B *reg = acb->pmuB;
                uint32_t intmask_org;
                intmask_org = arcmsr_disable_outbound_ints(acb);
                reg->postq_index = 0;
@@ -1994,7 +2015,7 @@ static void arcmsr_wait_firmware_ready(struct AdapterControlBlock *acb)
        switch (acb->adapter_type) {
 
        case ACB_ADAPTER_TYPE_A: {
-               struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+               struct MessageUnit_A __iomem *reg = acb->pmuA;
                do {
                        firmware_state = readl(&reg->outbound_msgaddr1);
                } while ((firmware_state & ARCMSR_OUTBOUND_MESG1_FIRMWARE_OK) == 0);
@@ -2002,7 +2023,7 @@ static void arcmsr_wait_firmware_ready(struct AdapterControlBlock *acb)
                break;
 
        case ACB_ADAPTER_TYPE_B: {
-               struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+               struct MessageUnit_B *reg = acb->pmuB;
                do {
                        firmware_state = readl(reg->iop2drv_doorbell_reg);
                } while ((firmware_state & ARCMSR_MESSAGE_FIRMWARE_OK) == 0);
@@ -2013,7 +2034,7 @@ static void arcmsr_wait_firmware_ready(struct AdapterControlBlock *acb)
 
 static void arcmsr_start_hba_bgrb(struct AdapterControlBlock *acb)
 {
-       struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+       struct MessageUnit_A __iomem *reg = acb->pmuA;
        acb->acb_flags |= ACB_F_MSG_START_BGRB;
        writel(ARCMSR_INBOUND_MESG0_START_BGRB, &reg->inbound_msgaddr0);
        if (arcmsr_hba_wait_msgint_ready(acb)) {
@@ -2024,7 +2045,7 @@ static void arcmsr_start_hba_bgrb(struct AdapterControlBlock *acb)
 
 static void arcmsr_start_hbb_bgrb(struct AdapterControlBlock *acb)
 {
-       struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+       struct MessageUnit_B *reg = acb->pmuB;
        acb->acb_flags |= ACB_F_MSG_START_BGRB;
        writel(ARCMSR_MESSAGE_START_BGRB, reg->drv2iop_doorbell_reg);
        if (arcmsr_hbb_wait_msgint_ready(acb)) {
@@ -2049,7 +2070,7 @@ static void arcmsr_clear_doorbell_queue_buffer(struct AdapterControlBlock *acb)
 {
        switch (acb->adapter_type) {
        case ACB_ADAPTER_TYPE_A: {
-               struct MessageUnit_A *reg = (struct MessageUnit_A *)acb->pmu;
+               struct MessageUnit_A __iomem *reg = acb->pmuA;
                uint32_t outbound_doorbell;
                /* empty doorbell Qbuffer if door bell ringed */
                outbound_doorbell = readl(&reg->outbound_doorbell);
@@ -2060,7 +2081,7 @@ static void arcmsr_clear_doorbell_queue_buffer(struct AdapterControlBlock *acb)
                break;
 
        case ACB_ADAPTER_TYPE_B: {
-               struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+               struct MessageUnit_B *reg = acb->pmuB;
                /*clear interrupt and message state*/
                writel(ARCMSR_MESSAGE_INT_CLEAR_PATTERN, reg->iop2drv_doorbell_reg);
                writel(ARCMSR_DRV2IOP_DATA_READ_OK, reg->drv2iop_doorbell_reg);
index 21ba57155beacd1617440b4e9b0506c708f72d01..bb6550e31926d4a2752a1f7984d3d2978950fd42 100644 (file)
@@ -38,9 +38,7 @@ static inline int next_SCp(struct scsi_pointer *SCp)
        if (ret) {
                SCp->buffer++;
                SCp->buffers_residual--;
-               SCp->ptr = (char *)
-                        (page_address(SCp->buffer->page) +
-                         SCp->buffer->offset);
+               SCp->ptr = sg_virt(SCp->buffer);
                SCp->this_residual = SCp->buffer->length;
        } else {
                SCp->ptr = NULL;
@@ -76,9 +74,7 @@ static inline void init_SCp(struct scsi_cmnd *SCpnt)
 
                SCpnt->SCp.buffer = (struct scatterlist *) SCpnt->request_buffer;
                SCpnt->SCp.buffers_residual = SCpnt->use_sg - 1;
-               SCpnt->SCp.ptr = (char *)
-                        (page_address(SCpnt->SCp.buffer->page) +
-                         SCpnt->SCp.buffer->offset);
+               SCpnt->SCp.ptr = sg_virt(SCpnt->SCp.buffer);
                SCpnt->SCp.this_residual = SCpnt->SCp.buffer->length;
                SCpnt->SCp.phase = SCpnt->request_bufflen;
 
index 22d91ee173c594f1d101f6f1d97e9395aac00ccb..5f2396c03958924393864718485d1de683bda6b1 100644 (file)
@@ -556,7 +556,7 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct,
                                   unsigned long timeout)
 {
        u64 *crq_as_u64 = (u64 *) &evt_struct->crq;
-       int request_status;
+       int request_status = 0;
        int rc;
 
        /* If we have exhausted our request limit, just fail this request,
@@ -574,6 +574,13 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct,
                if (request_status < -1)
                        goto send_error;
                /* Otherwise, we may have run out of requests. */
+               /* If request limit was 0 when we started the adapter is in the
+                * process of performing a login with the server adapter, or
+                * we may have run out of requests.
+                */
+               else if (request_status == -1 &&
+                        evt_struct->iu.srp.login_req.opcode != SRP_LOGIN_REQ)
+                       goto send_busy;
                /* Abort and reset calls should make it through.
                 * Nothing except abort and reset should use the last two
                 * slots unless we had two or less to begin with.
@@ -633,7 +640,8 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct,
        unmap_cmd_data(&evt_struct->iu.srp.cmd, evt_struct, hostdata->dev);
 
        free_event_struct(&hostdata->pool, evt_struct);
-       atomic_inc(&hostdata->request_limit);
+       if (request_status != -1)
+               atomic_inc(&hostdata->request_limit);
        return SCSI_MLQUEUE_HOST_BUSY;
 
  send_error:
@@ -927,10 +935,11 @@ static int send_srp_login(struct ibmvscsi_host_data *hostdata)
        login->req_buf_fmt = SRP_BUF_FORMAT_DIRECT | SRP_BUF_FORMAT_INDIRECT;
        
        spin_lock_irqsave(hostdata->host->host_lock, flags);
-       /* Start out with a request limit of 1, since this is negotiated in
-        * the login request we are just sending
+       /* Start out with a request limit of 0, since this is negotiated in
+        * the login request we are just sending and login requests always
+        * get sent by the driver regardless of request_limit.
         */
-       atomic_set(&hostdata->request_limit, 1);
+       atomic_set(&hostdata->request_limit, 0);
 
        rc = ibmvscsi_send_srp_event(evt_struct, hostdata, init_timeout * 2);
        spin_unlock_irqrestore(hostdata->host->host_lock, flags);
index c0755565fae9da39f9173fbfcd5d92e85db5229e..4e46045dea6d4e3fe6c970ddb18cceec5e0a2ada 100644 (file)
@@ -682,6 +682,7 @@ lpfc_scsi_prep_cmnd(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
        IOCB_t *iocb_cmd = &lpfc_cmd->cur_iocbq.iocb;
        struct lpfc_iocbq *piocbq = &(lpfc_cmd->cur_iocbq);
        int datadir = scsi_cmnd->sc_data_direction;
+       char tag[2];
 
        lpfc_cmd->fcp_rsp->rspSnsLen = 0;
        /* clear task management bits */
@@ -692,8 +693,8 @@ lpfc_scsi_prep_cmnd(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
 
        memcpy(&fcp_cmnd->fcpCdb[0], scsi_cmnd->cmnd, 16);
 
-       if (scsi_cmnd->device->tagged_supported) {
-               switch (scsi_cmnd->tag) {
+       if (scsi_populate_tag_msg(scsi_cmnd, tag)) {
+               switch (tag[0]) {
                case HEAD_OF_QUEUE_TAG:
                        fcp_cmnd->fcpCntl1 = HEAD_OF_Q;
                        break;
index 4652ad22516be010f0c9c46bd1612dc9dbf833c0..abef7048f25b32dffb1586cab131c7cac1817438 100644 (file)
@@ -593,10 +593,11 @@ static int osst_verify_frame(struct osst_tape * STp, int frame_seq_number, int q
        if (aux->frame_type != OS_FRAME_TYPE_DATA &&
            aux->frame_type != OS_FRAME_TYPE_EOD &&
            aux->frame_type != OS_FRAME_TYPE_MARKER) {
-               if (!quiet)
+               if (!quiet) {
 #if DEBUG
                        printk(OSST_DEB_MSG "%s:D: Skipping frame, frame type %x\n", name, aux->frame_type);
 #endif
+               }
                goto err_out;
        }
        if (aux->frame_type == OS_FRAME_TYPE_EOD &&
@@ -606,11 +607,12 @@ static int osst_verify_frame(struct osst_tape * STp, int frame_seq_number, int q
                goto err_out;
        }
         if (frame_seq_number != -1 && ntohl(aux->frame_seq_num) != frame_seq_number) {
-               if (!quiet)
+               if (!quiet) {
 #if DEBUG
                        printk(OSST_DEB_MSG "%s:D: Skipping frame, sequence number %u (expected %d)\n", 
                                            name, ntohl(aux->frame_seq_num), frame_seq_number);
 #endif
+               }
                goto err_out;
        }
        if (aux->frame_type == OS_FRAME_TYPE_MARKER) {
index 61fdaf02f2511fb09aa6008ab5d78b354d39554b..0e81e4cf8876766a92cb43333d6883baadefdf03 100644 (file)
@@ -785,7 +785,7 @@ struct scatterlist *scsi_alloc_sgtable(struct scsi_cmnd *cmd, gfp_t gfp_mask)
                 * end-of-list
                 */
                if (!left)
-                       sg_mark_end(sgl, this);
+                       sg_mark_end(&sgl[this - 1]);
 
                /*
                 * don't allow subsequent mempool allocs to sleep, it would
@@ -2114,6 +2114,142 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state)
 }
 EXPORT_SYMBOL(scsi_device_set_state);
 
+/**
+ *     sdev_evt_emit - emit a single SCSI device uevent
+ *     @sdev: associated SCSI device
+ *     @evt: event to emit
+ *
+ *     Send a single uevent (scsi_event) to the associated scsi_device.
+ */
+static void scsi_evt_emit(struct scsi_device *sdev, struct scsi_event *evt)
+{
+       int idx = 0;
+       char *envp[3];
+
+       switch (evt->evt_type) {
+       case SDEV_EVT_MEDIA_CHANGE:
+               envp[idx++] = "SDEV_MEDIA_CHANGE=1";
+               break;
+
+       default:
+               /* do nothing */
+               break;
+       }
+
+       envp[idx++] = NULL;
+
+       kobject_uevent_env(&sdev->sdev_gendev.kobj, KOBJ_CHANGE, envp);
+}
+
+/**
+ *     sdev_evt_thread - send a uevent for each scsi event
+ *     @work: work struct for scsi_device
+ *
+ *     Dispatch queued events to their associated scsi_device kobjects
+ *     as uevents.
+ */
+void scsi_evt_thread(struct work_struct *work)
+{
+       struct scsi_device *sdev;
+       LIST_HEAD(event_list);
+
+       sdev = container_of(work, struct scsi_device, event_work);
+
+       while (1) {
+               struct scsi_event *evt;
+               struct list_head *this, *tmp;
+               unsigned long flags;
+
+               spin_lock_irqsave(&sdev->list_lock, flags);
+               list_splice_init(&sdev->event_list, &event_list);
+               spin_unlock_irqrestore(&sdev->list_lock, flags);
+
+               if (list_empty(&event_list))
+                       break;
+
+               list_for_each_safe(this, tmp, &event_list) {
+                       evt = list_entry(this, struct scsi_event, node);
+                       list_del(&evt->node);
+                       scsi_evt_emit(sdev, evt);
+                       kfree(evt);
+               }
+       }
+}
+
+/**
+ *     sdev_evt_send - send asserted event to uevent thread
+ *     @sdev: scsi_device event occurred on
+ *     @evt: event to send
+ *
+ *     Assert scsi device event asynchronously.
+ */
+void sdev_evt_send(struct scsi_device *sdev, struct scsi_event *evt)
+{
+       unsigned long flags;
+
+       if (!test_bit(evt->evt_type, sdev->supported_events)) {
+               kfree(evt);
+               return;
+       }
+
+       spin_lock_irqsave(&sdev->list_lock, flags);
+       list_add_tail(&evt->node, &sdev->event_list);
+       schedule_work(&sdev->event_work);
+       spin_unlock_irqrestore(&sdev->list_lock, flags);
+}
+EXPORT_SYMBOL_GPL(sdev_evt_send);
+
+/**
+ *     sdev_evt_alloc - allocate a new scsi event
+ *     @evt_type: type of event to allocate
+ *     @gfpflags: GFP flags for allocation
+ *
+ *     Allocates and returns a new scsi_event.
+ */
+struct scsi_event *sdev_evt_alloc(enum scsi_device_event evt_type,
+                                 gfp_t gfpflags)
+{
+       struct scsi_event *evt = kzalloc(sizeof(struct scsi_event), gfpflags);
+       if (!evt)
+               return NULL;
+
+       evt->evt_type = evt_type;
+       INIT_LIST_HEAD(&evt->node);
+
+       /* evt_type-specific initialization, if any */
+       switch (evt_type) {
+       case SDEV_EVT_MEDIA_CHANGE:
+       default:
+               /* do nothing */
+               break;
+       }
+
+       return evt;
+}
+EXPORT_SYMBOL_GPL(sdev_evt_alloc);
+
+/**
+ *     sdev_evt_send_simple - send asserted event to uevent thread
+ *     @sdev: scsi_device event occurred on
+ *     @evt_type: type of event to send
+ *     @gfpflags: GFP flags for allocation
+ *
+ *     Assert scsi device event asynchronously, given an event type.
+ */
+void sdev_evt_send_simple(struct scsi_device *sdev,
+                         enum scsi_device_event evt_type, gfp_t gfpflags)
+{
+       struct scsi_event *evt = sdev_evt_alloc(evt_type, gfpflags);
+       if (!evt) {
+               sdev_printk(KERN_ERR, sdev, "event %d eaten due to OOM\n",
+                           evt_type);
+               return;
+       }
+
+       sdev_evt_send(sdev, evt);
+}
+EXPORT_SYMBOL_GPL(sdev_evt_send_simple);
+
 /**
  *     scsi_device_quiesce - Block user issued commands.
  *     @sdev:  scsi device to quiesce.
index b53c5f67e372684cc23c81a9f0ce19a41109e1ac..40ea71cd2ca6d5b9a7accefa25de353a98fd1b6d 100644 (file)
@@ -236,6 +236,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
        struct scsi_device *sdev;
        int display_failure_msg = 1, ret;
        struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
+       extern void scsi_evt_thread(struct work_struct *work);
 
        sdev = kzalloc(sizeof(*sdev) + shost->transportt->device_size,
                       GFP_ATOMIC);
@@ -254,7 +255,9 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
        INIT_LIST_HEAD(&sdev->same_target_siblings);
        INIT_LIST_HEAD(&sdev->cmd_list);
        INIT_LIST_HEAD(&sdev->starved_entry);
+       INIT_LIST_HEAD(&sdev->event_list);
        spin_lock_init(&sdev->list_lock);
+       INIT_WORK(&sdev->event_work, scsi_evt_thread);
 
        sdev->sdev_gendev.parent = get_device(&starget->dev);
        sdev->sdev_target = starget;
index d531ceeb0d8c3925c83b6dfdafa89d2c56e993e7..f374fdcb6815981d3055f171c01e26fee89e0820 100644 (file)
@@ -268,6 +268,7 @@ static void scsi_device_dev_release_usercontext(struct work_struct *work)
        struct scsi_device *sdev;
        struct device *parent;
        struct scsi_target *starget;
+       struct list_head *this, *tmp;
        unsigned long flags;
 
        sdev = container_of(work, struct scsi_device, ew.work);
@@ -282,6 +283,16 @@ static void scsi_device_dev_release_usercontext(struct work_struct *work)
        list_del(&sdev->starved_entry);
        spin_unlock_irqrestore(sdev->host->host_lock, flags);
 
+       cancel_work_sync(&sdev->event_work);
+
+       list_for_each_safe(this, tmp, &sdev->event_list) {
+               struct scsi_event *evt;
+
+               evt = list_entry(this, struct scsi_event, node);
+               list_del(&evt->node);
+               kfree(evt);
+       }
+
        if (sdev->request_queue) {
                sdev->request_queue->queuedata = NULL;
                /* user context needed to free queue */
@@ -614,6 +625,41 @@ sdev_show_modalias(struct device *dev, struct device_attribute *attr, char *buf)
 }
 static DEVICE_ATTR(modalias, S_IRUGO, sdev_show_modalias, NULL);
 
+#define DECLARE_EVT_SHOW(name, Cap_name)                               \
+static ssize_t                                                         \
+sdev_show_evt_##name(struct device *dev, struct device_attribute *attr,        \
+                               char *buf)                              \
+{                                                                      \
+       struct scsi_device *sdev = to_scsi_device(dev);                 \
+       int val = test_bit(SDEV_EVT_##Cap_name, sdev->supported_events);\
+       return snprintf(buf, 20, "%d\n", val);                          \
+}
+
+#define DECLARE_EVT_STORE(name, Cap_name)                              \
+static ssize_t                                                         \
+sdev_store_evt_##name(struct device *dev, struct device_attribute *attr, \
+                     const char *buf, size_t count)                    \
+{                                                                      \
+       struct scsi_device *sdev = to_scsi_device(dev);                 \
+       int val = simple_strtoul(buf, NULL, 0);                         \
+       if (val == 0)                                                   \
+               clear_bit(SDEV_EVT_##Cap_name, sdev->supported_events); \
+       else if (val == 1)                                              \
+               set_bit(SDEV_EVT_##Cap_name, sdev->supported_events);   \
+       else                                                            \
+               return -EINVAL;                                         \
+       return count;                                                   \
+}
+
+#define DECLARE_EVT(name, Cap_name)                                    \
+       DECLARE_EVT_SHOW(name, Cap_name)                                \
+       DECLARE_EVT_STORE(name, Cap_name)                               \
+       static DEVICE_ATTR(evt_##name, S_IRUGO, sdev_show_evt_##name,   \
+                          sdev_store_evt_##name);
+#define REF_EVT(name) &dev_attr_evt_##name.attr
+
+DECLARE_EVT(media_change, MEDIA_CHANGE)
+
 /* Default template for device attributes.  May NOT be modified */
 static struct attribute *scsi_sdev_attrs[] = {
        &dev_attr_device_blocked.attr,
@@ -631,6 +677,7 @@ static struct attribute *scsi_sdev_attrs[] = {
        &dev_attr_iodone_cnt.attr,
        &dev_attr_ioerr_cnt.attr,
        &dev_attr_modalias.attr,
+       REF_EVT(media_change),
        NULL
 };
 
index b5fa4f091387eb83cdc9009e2050d0062fa9201f..f1871ea0404573e610ef439e8d377d0b4a7a1419 100644 (file)
@@ -1652,6 +1652,7 @@ sg_build_sgat(Sg_scatter_hold * schp, const Sg_fd * sfp, int tablesize)
        schp->buffer = kzalloc(sg_bufflen, gfp_flags);
        if (!schp->buffer)
                return -ENOMEM;
+       sg_init_table(schp->buffer, tablesize);
        schp->sglist_len = sg_bufflen;
        return tablesize;       /* number of scat_gath elements allocated */
 }
index 4d4c9f01be8da7dbde5fa1951cbfbf5ab8bfb593..1f16de719962829e181f4860040a83a6094dcfa7 100644 (file)
@@ -76,7 +76,7 @@ static void __init wait_for_xmitr(struct uart_port *port)
        }
 }
 
-static void __init putc(struct uart_port *port, int c)
+static void __init serial_putc(struct uart_port *port, int c)
 {
        wait_for_xmitr(port);
        serial_out(port, UART_TX, c);
@@ -91,7 +91,7 @@ static void __init early_serial8250_write(struct console *console, const char *s
        ier = serial_in(port, UART_IER);
        serial_out(port, UART_IER, 0);
 
-       uart_console_write(port, s, count, putc);
+       uart_console_write(port, s, count, serial_putc);
 
        /* Wait for transmitter to become empty and restore the IER */
        wait_for_xmitr(port);
index 0e357562ce9e37e080c6f5e84ed8f630e92966c7..ceb03c9e749f8f918732d88c635de618d1f04125 100644 (file)
@@ -1986,6 +1986,7 @@ static int pciserial_suspend_one(struct pci_dev *dev, pm_message_t state)
 
 static int pciserial_resume_one(struct pci_dev *dev)
 {
+       int err;
        struct serial_private *priv = pci_get_drvdata(dev);
 
        pci_set_power_state(dev, PCI_D0);
@@ -1995,7 +1996,9 @@ static int pciserial_resume_one(struct pci_dev *dev)
                /*
                 * The device may have been disabled.  Re-enable it.
                 */
-               pci_enable_device(dev);
+               err = pci_enable_device(dev);
+               if (err)
+                       return err;
 
                pciserial_resume_ports(priv);
        }
index 926f58a674a15043f64ff25095bade80efca17e9..1de098e754978810db03ea655480bb4c9e213e45 100644 (file)
@@ -69,6 +69,8 @@ static const struct pnp_device_id pnp_dev_table[] = {
        {       "CTL3001",              0       },
        /* Creative Labs Modem Blaster 28.8 DSVD PnP Voice */
        {       "CTL3011",              0       },
+       /* Davicom ISA 33.6K Modem */
+       {       "DAV0336",              0       },
        /* Creative */
        /* Creative Modem Blaster Flash56 DI5601-1 */
        {       "DMB1032",              0       },
@@ -345,6 +347,11 @@ static const struct pnp_device_id pnp_dev_table[] = {
        /* Fujitsu Wacom Tablet PC devices */
        {       "FUJ02E5",              0       },
        {       "FUJ02E6",              0       },
+       /*
+        * LG C1 EXPRESS DUAL (C1-PB11A3) touch screen (actually a FUJ02E6 in
+        * disguise)
+        */
+       {       "LTS0001",              0       },
        /* Rockwell's (PORALiNK) 33600 INT PNP */
        {       "WCI0003",              0       },
        /* Unkown PnP modems */
@@ -432,7 +439,8 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
        }
 
        memset(&port, 0, sizeof(struct uart_port));
-       port.irq = pnp_irq(dev, 0);
+       if (pnp_irq_valid(dev, 0))
+               port.irq = pnp_irq(dev, 0);
        if (pnp_port_valid(dev, 0)) {
                port.iobase = pnp_port_start(dev, 0);
                port.iotype = UPIO_PORT;
index ed438bc7e98da46549a25c8caeb3e839b1c777ad..d7e1996e2fec299fd8fc7193c67780013163f873 100644 (file)
@@ -600,7 +600,7 @@ config SERIAL_SA1100_CONSOLE
 
 config SERIAL_BFIN
        tristate "Blackfin serial port support"
-       depends on BFIN
+       depends on BLACKFIN
        select SERIAL_CORE
        select SERIAL_BFIN_UART0 if (BF531 || BF532 || BF533 || BF561)
        help
index 4d6b3c56d20e7df9ea1262ae89cae2e24d18f901..111da57f533414671f9a924456ebcf1d08b32553 100644 (file)
@@ -204,8 +204,6 @@ static u_int atmel_get_mctrl(struct uart_port *port)
  */
 static void atmel_stop_tx(struct uart_port *port)
 {
-       struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port;
-
        UART_PUT_IDR(port, ATMEL_US_TXRDY);
 }
 
@@ -214,8 +212,6 @@ static void atmel_stop_tx(struct uart_port *port)
  */
 static void atmel_start_tx(struct uart_port *port)
 {
-       struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port;
-
        UART_PUT_IER(port, ATMEL_US_TXRDY);
 }
 
@@ -224,8 +220,6 @@ static void atmel_start_tx(struct uart_port *port)
  */
 static void atmel_stop_rx(struct uart_port *port)
 {
-       struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port;
-
        UART_PUT_IDR(port, ATMEL_US_RXRDY);
 }
 
@@ -409,7 +403,6 @@ static irqreturn_t atmel_interrupt(int irq, void *dev_id)
  */
 static int atmel_startup(struct uart_port *port)
 {
-       struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port;
        int retval;
 
        /*
@@ -456,8 +449,6 @@ static int atmel_startup(struct uart_port *port)
  */
 static void atmel_shutdown(struct uart_port *port)
 {
-       struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port;
-
        /*
         * Disable all interrupts, port and break condition.
         */
index f523cdf4b02b52a3a439a0a80d8cf52af4612842..a4e23cf47906960ba53396984d6e0d3e531619b3 100644 (file)
-/* $Id: serial.c,v 1.25 2004/09/29 10:33:49 starvik Exp $
- *
+/*
  * Serial port driver for the ETRAX 100LX chip
  *
- *    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003  Axis Communications AB
+ *    Copyright (C) 1998-2007  Axis Communications AB
  *
  *    Many, many authors. Based once upon a time on serial.c for 16x50.
  *
- * $Log: serial.c,v $
- * Revision 1.25  2004/09/29 10:33:49  starvik
- * Resolved a dealock when printing debug from kernel.
- *
- * Revision 1.24  2004/08/27 23:25:59  johana
- * rs_set_termios() must call change_speed() if c_iflag has changed or
- * automatic XOFF handling will be enabled and transmitter will stop
- * if 0x13 is received.
- *
- * Revision 1.23  2004/08/24 06:57:13  starvik
- * More whitespace cleanup
- *
- * Revision 1.22  2004/08/24 06:12:20  starvik
- * Whitespace cleanup
- *
- * Revision 1.20  2004/05/24 12:00:20  starvik
- * Big merge of stuff from Linux 2.4 (e.g. manual mode for the serial port).
- *
- * Revision 1.19  2004/05/17 13:12:15  starvik
- * Kernel console hook
- * Big merge from Linux 2.4 still pending.
- *
- * Revision 1.18  2003/10/28 07:18:30  starvik
- * Compiles with debug info
- *
- * Revision 1.17  2003/07/04 08:27:37  starvik
- * Merge of Linux 2.5.74
- *
- * Revision 1.16  2003/06/13 10:05:19  johana
- * Help the user to avoid trouble by:
- * Forcing mixed mode for status/control lines if not all pins are used.
- *
- * Revision 1.15  2003/06/13 09:43:01  johana
- * Merged in the following changes from os/linux/arch/cris/drivers/serial.c
- * + some minor changes to reduce diff.
- *
- * Revision 1.49  2003/05/30 11:31:54  johana
- * Merged in change-branch--serial9bit that adds CMSPAR support for sticky
- * parity (mark/space)
- *
- * Revision 1.48  2003/05/30 11:03:57  johana
- * Implemented rs_send_xchar() by disabling the DMA and writing manually.
- * Added e100_disable_txdma_channel() and e100_enable_txdma_channel().
- * Fixed rs_throttle() and rs_unthrottle() to properly call rs_send_xchar
- * instead of setting info->x_char and check the CRTSCTS flag before
- * controlling the rts pin.
- *
- * Revision 1.14  2003/04/09 08:12:44  pkj
- * Corrected typo changes made upstream.
- *
- * Revision 1.13  2003/04/09 05:20:47  starvik
- * Merge of Linux 2.5.67
- *
- * Revision 1.11  2003/01/22 06:48:37  starvik
- * Fixed warnings issued by GCC 3.2.1
- *
- * Revision 1.9  2002/12/13 09:07:47  starvik
- * Alert user that RX_TIMEOUT_TICKS==0 doesn't work
- *
- * Revision 1.8  2002/12/11 13:13:57  starvik
- * Added arch/ to v10 specific includes
- * Added fix from Linux 2.4 in serial.c (flush_to_flip_buffer)
- *
- * Revision 1.7  2002/12/06 07:13:57  starvik
- * Corrected work queue stuff
- * Removed CONFIG_ETRAX_SERIAL_FLUSH_DMA_FAST
- *
- * Revision 1.6  2002/11/21 07:17:46  starvik
- * Change static inline to extern inline where otherwise outlined with gcc-3.2
- *
- * Revision 1.5  2002/11/14 15:59:49  starvik
- * Linux 2.5 port of the latest serial driver from 2.4. The work queue stuff
- * probably doesn't work yet.
- *
- * Revision 1.42  2002/11/05 09:08:47  johana
- * Better implementation of rs_stop() and rs_start() that uses the XOFF
- * register to start/stop transmission.
- * change_speed() also initilises XOFF register correctly so that
- * auto_xoff is enabled when IXON flag is set by user.
- * This gives fast XOFF response times.
- *
- * Revision 1.41  2002/11/04 18:40:57  johana
- * Implemented rs_stop() and rs_start().
- * Simple tests using hwtestserial indicates that this should be enough
- * to make it work.
- *
- * Revision 1.40  2002/10/14 05:33:18  starvik
- * RS-485 uses fast timers even if SERIAL_FAST_TIMER is disabled
- *
- * Revision 1.39  2002/09/30 21:00:57  johana
- * Support for CONFIG_ETRAX_SERx_DTR_RI_DSR_CD_MIXED where the status and
- * control pins can be mixed between PA and PB.
- * If no serial port uses MIXED old solution is used
- * (saves a few bytes and cycles).
- * control_pins struct uses masks instead of bit numbers.
- * Corrected dummy values and polarity in line_info() so
- * /proc/tty/driver/serial is now correct.
- * (the E100_xxx_GET() macros is really active low - perhaps not obvious)
- *
- * Revision 1.38  2002/08/23 11:01:36  starvik
- * Check that serial port is enabled in all interrupt handlers to avoid
- * restarts of DMA channels not assigned to serial ports
- *
- * Revision 1.37  2002/08/13 13:02:37  bjornw
- * Removed some warnings because of unused code
- *
- * Revision 1.36  2002/08/08 12:50:01  starvik
- * Serial interrupt is shared with synchronous serial port driver
- *
- * Revision 1.35  2002/06/03 10:40:49  starvik
- * Increased RS-485 RTS toggle timer to 2 characters
- *
- * Revision 1.34  2002/05/28 18:59:36  johana
- * Whitespace and comment fixing to be more like etrax100ser.c 1.71.
- *
- * Revision 1.33  2002/05/28 17:55:43  johana
- * RS-485 uses FAST_TIMER if enabled, and starts a short (one char time)
- * timer from tranismit_chars (interrupt context).
- * The timer toggles RTS in interrupt context when expired giving minimum
- * latencies.
- *
- * Revision 1.32  2002/05/22 13:58:00  johana
- * Renamed rs_write() to raw_write() and made it inline.
- * New rs_write() handles RS-485 if configured and enabled
- * (moved code from e100_write_rs485()).
- * RS-485 ioctl's uses copy_from_user() instead of verify_area().
- *
- * Revision 1.31  2002/04/22 11:20:03  johana
- * Updated copyright years.
- *
- * Revision 1.30  2002/04/22 09:39:12  johana
- * RS-485 support compiles.
- *
- * Revision 1.29  2002/01/14 16:10:01  pkj
- * Allocate the receive buffers dynamically. The static 4kB buffer was
- * too small for the peaks. This means that we can get rid of the extra
- * buffer and the copying to it. It also means we require less memory
- * under normal operations, but can use more when needed (there is a
- * cap at 64kB for safety reasons). If there is no memory available
- * we panic(), and die a horrible death...
- *
- * Revision 1.28  2001/12/18 15:04:53  johana
- * Cleaned up write_rs485() - now it works correctly without padding extra
- * char.
- * Added sane default initialisation of rs485.
- * Added #ifdef around dummy variables.
- *
- * Revision 1.27  2001/11/29 17:00:41  pkj
- * 2kB seems to be too small a buffer when using 921600 bps,
- * so increase it to 4kB (this was already done for the elinux
- * version of the serial driver).
- *
- * Revision 1.26  2001/11/19 14:20:41  pkj
- * Minor changes to comments and unused code.
- *
- * Revision 1.25  2001/11/12 20:03:43  pkj
- * Fixed compiler warnings.
- *
- * Revision 1.24  2001/11/12 15:10:05  pkj
- * Total redesign of the receiving part of the serial driver.
- * Uses eight chained descriptors to write to a 4kB buffer.
- * This data is then serialised into a 2kB buffer. From there it
- * is copied into the TTY's flip buffers when they become available.
- * A lot of copying, and the sizes of the buffers might need to be
- * tweaked, but all in all it should work better than the previous
- * version, without the need to modify the TTY code in any way.
- * Also note that erroneous bytes are now correctly marked in the
- * flag buffers (instead of always marking the first byte).
- *
- * Revision 1.23  2001/10/30 17:53:26  pkj
- * * Set info->uses_dma to 0 when a port is closed.
- * * Mark the timer1 interrupt as a fast one (SA_INTERRUPT).
- * * Call start_flush_timer() in start_receive() if
- *   CONFIG_ETRAX_SERIAL_FLUSH_DMA_FAST is defined.
- *
- * Revision 1.22  2001/10/30 17:44:03  pkj
- * Use %lu for received and transmitted counters in line_info().
- *
- * Revision 1.21  2001/10/30 17:40:34  pkj
- * Clean-up. The only change to functionality is that
- * CONFIG_ETRAX_SERIAL_RX_TIMEOUT_TICKS(=5) is used instead of
- * MAX_FLUSH_TIME(=8).
- *
- * Revision 1.20  2001/10/30 15:24:49  johana
- * Added char_time stuff from 2.0 driver.
- *
- * Revision 1.19  2001/10/30 15:23:03  johana
- * Merged with 1.13.2 branch + fixed indentation
- * and changed CONFIG_ETRAX100_XYS to CONFIG_ETRAX_XYZ
- *
- * Revision 1.18  2001/09/24 09:27:22  pkj
- * Completed ext_baud_table[] in cflag_to_baud() and cflag_to_etrax_baud().
- *
- * Revision 1.17  2001/08/24 11:32:49  ronny
- * More fixes for the CONFIG_ETRAX_SERIAL_PORT0 define.
- *
- * Revision 1.16  2001/08/24 07:56:22  ronny
- * Added config ifdefs around ser0 irq requests.
- *
- * Revision 1.15  2001/08/16 09:10:31  bjarne
- * serial.c - corrected the initialization of rs_table, the wrong defines
- *            where used.
- *            Corrected a test in timed_flush_handler.
- *            Changed configured to enabled.
- * serial.h - Changed configured to enabled.
- *
- * Revision 1.14  2001/08/15 07:31:23  bjarne
- * Introduced two new members to the e100_serial struct.
- * configured - Will be set to 1 if the port has been configured in .config
- * uses_dma   - Should be set to 1 if the port uses DMA. Currently it is set
- *              to 1
- *              when a port is opened. This is used to limit the DMA interrupt
- *              routines to only manipulate DMA channels actually used by the
- *              serial driver.
- *
- * Revision 1.13.2.2  2001/10/17 13:57:13  starvik
- * Receiver was broken by the break fixes
- *
- * Revision 1.13.2.1  2001/07/20 13:57:39  ronny
- * Merge with new stuff from etrax100ser.c. Works but haven't checked stuff
- * like break handling.
- *
- * Revision 1.13  2001/05/09 12:40:31  johana
- * Use DMA_NBR and IRQ_NBR defines from dma.h and irq.h
- *
- * Revision 1.12  2001/04/19 12:23:07  bjornw
- * CONFIG_RS485 -> CONFIG_ETRAX_RS485
- *
- * Revision 1.11  2001/04/05 14:29:48  markusl
- * Updated according to review remarks i.e.
- * -Use correct types in port structure to avoid compiler warnings
- * -Try to use IO_* macros whenever possible
- * -Open should never return -EBUSY
- *
- * Revision 1.10  2001/03/05 13:14:07  bjornw
- * Another spelling fix
- *
- * Revision 1.9  2001/02/23 13:46:38  bjornw
- * Spellling check
- *
- * Revision 1.8  2001/01/23 14:56:35  markusl
- * Made use of ser1 optional
- * Needed by USB
- *
- * Revision 1.7  2001/01/19 16:14:48  perf
- * Added kernel options for serial ports 234.
- * Changed option names from CONFIG_ETRAX100_XYZ to CONFIG_ETRAX_XYZ.
- *
- * Revision 1.6  2000/11/22 16:36:09  bjornw
- * Please marketing by using the correct case when spelling Etrax.
- *
- * Revision 1.5  2000/11/21 16:43:37  bjornw
- * Fixed so it compiles under CONFIG_SVINTO_SIM
- *
- * Revision 1.4  2000/11/15 17:34:12  bjornw
- * Added a timeout timer for flushing input channels. The interrupt-based
- * fast flush system should be easy to merge with this later (works the same
- * way, only with an irq instead of a system timer_list)
- *
- * Revision 1.3  2000/11/13 17:19:57  bjornw
- * * Incredibly, this almost complete rewrite of serial.c worked (at least
- *   for output) the first time.
- *
- *   Items worth noticing:
- *
- *      No Etrax100 port 1 workarounds (does only compile on 2.4 anyway now)
- *      RS485 is not ported (why can't it be done in userspace as on x86 ?)
- *      Statistics done through async_icount - if any more stats are needed,
- *      that's the place to put them or in an arch-dep version of it.
- *      timeout_interrupt and the other fast timeout stuff not ported yet
- *      There be dragons in this 3k+ line driver
- *
- * Revision 1.2  2000/11/10 16:50:28  bjornw
- * First shot at a 2.4 port, does not compile totally yet
- *
- * Revision 1.1  2000/11/10 16:47:32  bjornw
- * Added verbatim copy of rev 1.49 etrax100ser.c from elinux
- *
- * Revision 1.49  2000/10/30 15:47:14  tobiasa
- * Changed version number.
- *
- * Revision 1.48  2000/10/25 11:02:43  johana
- * Changed %ul to %lu in printf's
- *
- * Revision 1.47  2000/10/18 15:06:53  pkj
- * Compile correctly with CONFIG_ETRAX_SERIAL_FLUSH_DMA_FAST and
- * CONFIG_ETRAX_SERIAL_PROC_ENTRY together.
- * Some clean-up of the /proc/serial file.
- *
- * Revision 1.46  2000/10/16 12:59:40  johana
- * Added CONFIG_ETRAX_SERIAL_PROC_ENTRY for statistics and debug info.
- *
- * Revision 1.45  2000/10/13 17:10:59  pkj
- * Do not flush DMAs while flipping TTY buffers.
- *
- * Revision 1.44  2000/10/13 16:34:29  pkj
- * Added a delay in ser_interrupt() for 2.3ms when an error is detected.
- * We do not know why this delay is required yet, but without it the
- * irmaflash program does not work (this was the program that needed
- * the ser_interrupt() to be needed in the first place). This should not
- * affect normal use of the serial ports.
- *
- * Revision 1.43  2000/10/13 16:30:44  pkj
- * New version of the fast flush of serial buffers code. This time
- * it is localized to the serial driver and uses a fast timer to
- * do the work.
- *
- * Revision 1.42  2000/10/13 14:54:26  bennyo
- * Fix for switching RTS when using rs485
- *
- * Revision 1.41  2000/10/12 11:43:44  pkj
- * Cleaned up a number of comments.
- *
- * Revision 1.40  2000/10/10 11:58:39  johana
- * Made RS485 support generic for all ports.
- * Toggle rts in interrupt if no delay wanted.
- * WARNING: No true transmitter empty check??
- * Set d_wait bit when sending data so interrupt is delayed until
- * fifo flushed. (Fix tcdrain() problem)
- *
- * Revision 1.39  2000/10/04 16:08:02  bjornw
- * * Use virt_to_phys etc. for DMA addresses
- * * Removed CONFIG_FLUSH_DMA_FAST hacks
- * * Indentation fix
- *
- * Revision 1.38  2000/10/02 12:27:10  mattias
- * * added variable used when using fast flush on serial dma.
- *   (CONFIG_FLUSH_DMA_FAST)
- *
- * Revision 1.37  2000/09/27 09:44:24  pkj
- * Uncomment definition of SERIAL_HANDLE_EARLY_ERRORS.
- *
- * Revision 1.36  2000/09/20 13:12:52  johana
- * Support for CONFIG_ETRAX_SERIAL_RX_TIMEOUT_TICKS:
- *   Number of timer ticks between flush of receive fifo (1 tick = 10ms).
- *   Try 0-3 for low latency applications. Approx 5 for high load
- *   applications (e.g. PPP). Maybe this should be more adaptive some day...
- *
- * Revision 1.35  2000/09/20 10:36:08  johana
- * Typo in get_lsr_info()
- *
- * Revision 1.34  2000/09/20 10:29:59  johana
- * Let rs_chars_in_buffer() check fifo content as well.
- * get_lsr_info() might work now (not tested).
- * Easier to change the port to debug.
- *
- * Revision 1.33  2000/09/13 07:52:11  torbjore
- * Support RS485
- *
- * Revision 1.32  2000/08/31 14:45:37  bjornw
- * After sending a break we need to reset the transmit DMA channel
- *
- * Revision 1.31  2000/06/21 12:13:29  johana
- * Fixed wait for all chars sent when closing port.
- * (Used to always take 1 second!)
- * Added shadows for directions of status/ctrl signals.
- *
- * Revision 1.30  2000/05/29 16:27:55  bjornw
- * Simulator ifdef moved a bit
- *
- * Revision 1.29  2000/05/09 09:40:30  mattias
- * * Added description of dma registers used in timeout_interrupt
- * * Removed old code
- *
- * Revision 1.28  2000/05/08 16:38:58  mattias
- * * Bugfix for flushing fifo in timeout_interrupt
- *   Problem occurs when bluetooth stack waits for a small number of bytes
- *   containing an event acknowledging free buffers in bluetooth HW
- *   As before, data was stuck in fifo until more data came on uart and
- *   flushed it up to the stack.
- *
- * Revision 1.27  2000/05/02 09:52:28  jonasd
- * Added fix for peculiar etrax behaviour when eop is forced on an empty
- * fifo. This is used when flashing the IRMA chip. Disabled by default.
- *
- * Revision 1.26  2000/03/29 15:32:02  bjornw
- * 2.0.34 updates
- *
- * Revision 1.25  2000/02/16 16:59:36  bjornw
- * * Receive DMA directly into the flip-buffer, eliminating an intermediary
- *   receive buffer and a memcpy. Will avoid some overruns.
- * * Error message on debug port if an overrun or flip buffer overrun occurs.
- * * Just use the first byte in the flag flip buffer for errors.
- * * Check for timeout on the serial ports only each 5/100 s, not 1/100.
- *
- * Revision 1.24  2000/02/09 18:02:28  bjornw
- * * Clear serial errors (overrun, framing, parity) correctly. Before, the
- *   receiver would get stuck if an error occurred and we did not restart
- *   the input DMA.
- * * Cosmetics (indentation, some code made into inlines)
- * * Some more debug options
- * * Actually shut down the serial port (DMA irq, DMA reset, receiver stop)
- *   when the last open is closed. Corresponding fixes in startup().
- * * rs_close() "tx FIFO wait" code moved into right place, bug & -> && fixed
- *   and make a special case out of port 1 (R_DMA_CHx_STATUS is broken for that)
- * * e100_disable_rx/enable_rx just disables/enables the receiver, not RTS
- *
- * Revision 1.23  2000/01/24 17:46:19  johana
- * Wait for flush of DMA/FIFO when closing port.
- *
- * Revision 1.22  2000/01/20 18:10:23  johana
- * Added TIOCMGET ioctl to return modem status.
- * Implemented modem status/control that works with the extra signals
- * (DTR, DSR, RI,CD) as well.
- * 3 different modes supported:
- * ser0 on PB (Bundy), ser1 on PB (Lisa) and ser2 on PA (Bundy)
- * Fixed DEF_TX value that caused the serial transmitter pin (txd) to go to 0 when
- * closing the last filehandle, NASTY!.
- * Added break generation, not tested though!
- * Use IRQF_SHARED when request_irq() for ser2 and ser3 (shared with) par0 and par1.
- * You can't use them at the same time (yet..), but you can hopefully switch
- * between ser2/par0, ser3/par1 with the same kernel config.
- * Replaced some magic constants with defines
- *
- *
  */
 
 static char *serial_version = "$Revision: 1.25 $";
@@ -446,6 +30,7 @@ static char *serial_version = "$Revision: 1.25 $";
 
 #include <asm/io.h>
 #include <asm/irq.h>
+#include <asm/dma.h>
 #include <asm/system.h>
 #include <linux/delay.h>
 
@@ -454,8 +39,9 @@ static char *serial_version = "$Revision: 1.25 $";
 /* non-arch dependent serial structures are in linux/serial.h */
 #include <linux/serial.h>
 /* while we keep our own stuff (struct e100_serial) in a local .h file */
-#include "serial.h"
+#include "crisv10.h"
 #include <asm/fasttimer.h>
+#include <asm/arch/io_interface_mux.h>
 
 #ifdef CONFIG_ETRAX_SERIAL_FAST_TIMER
 #ifndef CONFIG_ETRAX_FAST_TIMER
@@ -504,18 +90,6 @@ struct tty_driver *serial_driver;
    from eLinux */
 #define SERIAL_HANDLE_EARLY_ERRORS
 
-/* Defined and used in n_tty.c, but we need it here as well */
-#define TTY_THRESHOLD_THROTTLE 128
-
-/* Due to buffersizes and threshold values, our SERIAL_DESCR_BUF_SIZE
- * must not be to high or flow control won't work if we leave it to the tty
- * layer so we have our own throttling in flush_to_flip
- * TTY_FLIPBUF_SIZE=512,
- * TTY_THRESHOLD_THROTTLE/UNTHROTTLE=128
- * BUF_SIZE can't be > 128
- */
-#define CRIS_BUF_SIZE  512
-
 /* Currently 16 descriptors x 128 bytes = 2048 bytes */
 #define SERIAL_DESCR_BUF_SIZE 256
 
@@ -588,13 +162,13 @@ unsigned long timer_data_to_ns(unsigned long timer_data);
 static void change_speed(struct e100_serial *info);
 static void rs_throttle(struct tty_struct * tty);
 static void rs_wait_until_sent(struct tty_struct *tty, int timeout);
-static int rs_write(struct tty_struct * tty, int from_user,
-                    const unsigned char *buf, int count);
+static int rs_write(struct tty_struct *tty,
+               const unsigned char *buf, int count);
 #ifdef CONFIG_ETRAX_RS485
-static int e100_write_rs485(struct tty_struct * tty, int from_user,
-                            const unsigned char *buf, int count);
+static int e100_write_rs485(struct tty_struct *tty,
+               const unsigned char *buf, int count);
 #endif
-static int get_lsr_info(struct e100_serial * info, unsigned int *value);
+static int get_lsr_info(struct e100_serial *info, unsigned int *value);
 
 
 #define DEF_BAUD 115200   /* 115.2 kbit/s */
@@ -679,20 +253,39 @@ static struct e100_serial rs_table[] = {
          .rx_ctrl     = DEF_RX,
          .tx_ctrl     = DEF_TX,
          .iseteop     = 2,
+         .dma_owner   = dma_ser0,
+         .io_if       = if_serial_0,
 #ifdef CONFIG_ETRAX_SERIAL_PORT0
           .enabled  = 1,
 #ifdef CONFIG_ETRAX_SERIAL_PORT0_DMA6_OUT
          .dma_out_enabled = 1,
+         .dma_out_nbr = SER0_TX_DMA_NBR,
+         .dma_out_irq_nbr = SER0_DMA_TX_IRQ_NBR,
+         .dma_out_irq_flags = IRQF_DISABLED,
+         .dma_out_irq_description = "serial 0 dma tr",
 #else
          .dma_out_enabled = 0,
+         .dma_out_nbr = UINT_MAX,
+         .dma_out_irq_nbr = 0,
+         .dma_out_irq_flags = 0,
+         .dma_out_irq_description = NULL,
 #endif
 #ifdef CONFIG_ETRAX_SERIAL_PORT0_DMA7_IN
          .dma_in_enabled = 1,
+         .dma_in_nbr = SER0_RX_DMA_NBR,
+         .dma_in_irq_nbr = SER0_DMA_RX_IRQ_NBR,
+         .dma_in_irq_flags = IRQF_DISABLED,
+         .dma_in_irq_description = "serial 0 dma rec",
 #else
-         .dma_in_enabled = 0
+         .dma_in_enabled = 0,
+         .dma_in_nbr = UINT_MAX,
+         .dma_in_irq_nbr = 0,
+         .dma_in_irq_flags = 0,
+         .dma_in_irq_description = NULL,
 #endif
 #else
           .enabled  = 0,
+         .io_if_description = NULL,
          .dma_out_enabled = 0,
          .dma_in_enabled = 0
 #endif
@@ -714,20 +307,42 @@ static struct e100_serial rs_table[] = {
          .rx_ctrl     = DEF_RX,
          .tx_ctrl     = DEF_TX,
          .iseteop     = 3,
+         .dma_owner   = dma_ser1,
+         .io_if       = if_serial_1,
 #ifdef CONFIG_ETRAX_SERIAL_PORT1
           .enabled  = 1,
+         .io_if_description = "ser1",
 #ifdef CONFIG_ETRAX_SERIAL_PORT1_DMA8_OUT
          .dma_out_enabled = 1,
+         .dma_out_nbr = SER1_TX_DMA_NBR,
+         .dma_out_irq_nbr = SER1_DMA_TX_IRQ_NBR,
+         .dma_out_irq_flags = IRQF_DISABLED,
+         .dma_out_irq_description = "serial 1 dma tr",
 #else
          .dma_out_enabled = 0,
+         .dma_out_nbr = UINT_MAX,
+         .dma_out_irq_nbr = 0,
+         .dma_out_irq_flags = 0,
+         .dma_out_irq_description = NULL,
 #endif
 #ifdef CONFIG_ETRAX_SERIAL_PORT1_DMA9_IN
          .dma_in_enabled = 1,
+         .dma_in_nbr = SER1_RX_DMA_NBR,
+         .dma_in_irq_nbr = SER1_DMA_RX_IRQ_NBR,
+         .dma_in_irq_flags = IRQF_DISABLED,
+         .dma_in_irq_description = "serial 1 dma rec",
 #else
-         .dma_in_enabled = 0
+         .dma_in_enabled = 0,
+         .dma_in_enabled = 0,
+         .dma_in_nbr = UINT_MAX,
+         .dma_in_irq_nbr = 0,
+         .dma_in_irq_flags = 0,
+         .dma_in_irq_description = NULL,
 #endif
 #else
           .enabled  = 0,
+         .io_if_description = NULL,
+         .dma_in_irq_nbr = 0,
          .dma_out_enabled = 0,
          .dma_in_enabled = 0
 #endif
@@ -748,20 +363,40 @@ static struct e100_serial rs_table[] = {
          .rx_ctrl     = DEF_RX,
          .tx_ctrl     = DEF_TX,
          .iseteop     = 0,
+         .dma_owner   = dma_ser2,
+         .io_if       = if_serial_2,
 #ifdef CONFIG_ETRAX_SERIAL_PORT2
           .enabled  = 1,
+         .io_if_description = "ser2",
 #ifdef CONFIG_ETRAX_SERIAL_PORT2_DMA2_OUT
          .dma_out_enabled = 1,
+         .dma_out_nbr = SER2_TX_DMA_NBR,
+         .dma_out_irq_nbr = SER2_DMA_TX_IRQ_NBR,
+         .dma_out_irq_flags = IRQF_DISABLED,
+         .dma_out_irq_description = "serial 2 dma tr",
 #else
          .dma_out_enabled = 0,
+         .dma_out_nbr = UINT_MAX,
+         .dma_out_irq_nbr = 0,
+         .dma_out_irq_flags = 0,
+         .dma_out_irq_description = NULL,
 #endif
 #ifdef CONFIG_ETRAX_SERIAL_PORT2_DMA3_IN
          .dma_in_enabled = 1,
+         .dma_in_nbr = SER2_RX_DMA_NBR,
+         .dma_in_irq_nbr = SER2_DMA_RX_IRQ_NBR,
+         .dma_in_irq_flags = IRQF_DISABLED,
+         .dma_in_irq_description = "serial 2 dma rec",
 #else
-         .dma_in_enabled = 0
+         .dma_in_enabled = 0,
+         .dma_in_nbr = UINT_MAX,
+         .dma_in_irq_nbr = 0,
+         .dma_in_irq_flags = 0,
+         .dma_in_irq_description = NULL,
 #endif
 #else
           .enabled  = 0,
+         .io_if_description = NULL,
          .dma_out_enabled = 0,
          .dma_in_enabled = 0
 #endif
@@ -782,20 +417,40 @@ static struct e100_serial rs_table[] = {
          .rx_ctrl     = DEF_RX,
          .tx_ctrl     = DEF_TX,
          .iseteop     = 1,
+         .dma_owner   = dma_ser3,
+         .io_if       = if_serial_3,
 #ifdef CONFIG_ETRAX_SERIAL_PORT3
           .enabled  = 1,
+         .io_if_description = "ser3",
 #ifdef CONFIG_ETRAX_SERIAL_PORT3_DMA4_OUT
          .dma_out_enabled = 1,
+         .dma_out_nbr = SER3_TX_DMA_NBR,
+         .dma_out_irq_nbr = SER3_DMA_TX_IRQ_NBR,
+         .dma_out_irq_flags = IRQF_DISABLED,
+         .dma_out_irq_description = "serial 3 dma tr",
 #else
          .dma_out_enabled = 0,
+         .dma_out_nbr = UINT_MAX,
+         .dma_out_irq_nbr = 0,
+         .dma_out_irq_flags = 0,
+         .dma_out_irq_description = NULL,
 #endif
 #ifdef CONFIG_ETRAX_SERIAL_PORT3_DMA5_IN
          .dma_in_enabled = 1,
+         .dma_in_nbr = SER3_RX_DMA_NBR,
+         .dma_in_irq_nbr = SER3_DMA_RX_IRQ_NBR,
+         .dma_in_irq_flags = IRQF_DISABLED,
+         .dma_in_irq_description = "serial 3 dma rec",
 #else
-         .dma_in_enabled = 0
+         .dma_in_enabled = 0,
+         .dma_in_nbr = UINT_MAX,
+         .dma_in_irq_nbr = 0,
+         .dma_in_irq_flags = 0,
+         .dma_in_irq_description = NULL
 #endif
 #else
           .enabled  = 0,
+         .io_if_description = NULL,
          .dma_out_enabled = 0,
          .dma_in_enabled = 0
 #endif
@@ -1416,12 +1071,11 @@ e100_dtr(struct e100_serial *info, int set)
        {
                unsigned long flags;
 
-               save_flags(flags);
-               cli();
+               local_irq_save(flags);
                *e100_modem_pins[info->line].dtr_shadow &= ~mask;
                *e100_modem_pins[info->line].dtr_shadow |= (set ? 0 : mask);
                *e100_modem_pins[info->line].dtr_port = *e100_modem_pins[info->line].dtr_shadow;
-               restore_flags(flags);
+               local_irq_restore(flags);
        }
 
 #ifdef SERIAL_DEBUG_IO
@@ -1440,12 +1094,11 @@ e100_rts(struct e100_serial *info, int set)
 {
 #ifndef CONFIG_SVINTO_SIM
        unsigned long flags;
-       save_flags(flags);
-       cli();
+       local_irq_save(flags);
        info->rx_ctrl &= ~E100_RTS_MASK;
        info->rx_ctrl |= (set ? 0 : E100_RTS_MASK);  /* RTS is active low */
        info->port[REG_REC_CTRL] = info->rx_ctrl;
-       restore_flags(flags);
+       local_irq_restore(flags);
 #ifdef SERIAL_DEBUG_IO
        printk("ser%i rts %i\n", info->line, set);
 #endif
@@ -1463,12 +1116,11 @@ e100_ri_out(struct e100_serial *info, int set)
                unsigned char mask = e100_modem_pins[info->line].ri_mask;
                unsigned long flags;
 
-               save_flags(flags);
-               cli();
+               local_irq_save(flags);
                *e100_modem_pins[info->line].ri_shadow &= ~mask;
                *e100_modem_pins[info->line].ri_shadow |= (set ? 0 : mask);
                *e100_modem_pins[info->line].ri_port = *e100_modem_pins[info->line].ri_shadow;
-               restore_flags(flags);
+               local_irq_restore(flags);
        }
 #endif
 }
@@ -1481,12 +1133,11 @@ e100_cd_out(struct e100_serial *info, int set)
                unsigned char mask = e100_modem_pins[info->line].cd_mask;
                unsigned long flags;
 
-               save_flags(flags);
-               cli();
+               local_irq_save(flags);
                *e100_modem_pins[info->line].cd_shadow &= ~mask;
                *e100_modem_pins[info->line].cd_shadow |= (set ? 0 : mask);
                *e100_modem_pins[info->line].cd_port = *e100_modem_pins[info->line].cd_shadow;
-               restore_flags(flags);
+               local_irq_restore(flags);
        }
 #endif
 }
@@ -1560,8 +1211,7 @@ static void e100_disable_txdma_channel(struct e100_serial *info)
        /* Disable output DMA channel for the serial port in question
         * ( set to something other then serialX)
         */
-       save_flags(flags);
-       cli();
+       local_irq_save(flags);
        DFLOW(DEBUG_LOG(info->line, "disable_txdma_channel %i\n", info->line));
        if (info->line == 0) {
                if ((genconfig_shadow & IO_MASK(R_GEN_CONFIG, dma6)) ==
@@ -1589,7 +1239,7 @@ static void e100_disable_txdma_channel(struct e100_serial *info)
                }
        }
        *R_GEN_CONFIG = genconfig_shadow;
-       restore_flags(flags);
+       local_irq_restore(flags);
 }
 
 
@@ -1597,8 +1247,7 @@ static void e100_enable_txdma_channel(struct e100_serial *info)
 {
        unsigned long flags;
 
-       save_flags(flags);
-       cli();
+       local_irq_save(flags);
        DFLOW(DEBUG_LOG(info->line, "enable_txdma_channel %i\n", info->line));
        /* Enable output DMA channel for the serial port in question */
        if (info->line == 0) {
@@ -1615,7 +1264,7 @@ static void e100_enable_txdma_channel(struct e100_serial *info)
                genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma4, serial3);
        }
        *R_GEN_CONFIG = genconfig_shadow;
-       restore_flags(flags);
+       local_irq_restore(flags);
 }
 
 static void e100_disable_rxdma_channel(struct e100_serial *info)
@@ -1625,8 +1274,7 @@ static void e100_disable_rxdma_channel(struct e100_serial *info)
        /* Disable input DMA channel for the serial port in question
         * ( set to something other then serialX)
         */
-       save_flags(flags);
-       cli();
+       local_irq_save(flags);
        if (info->line == 0) {
                if ((genconfig_shadow & IO_MASK(R_GEN_CONFIG, dma7)) ==
                    IO_STATE(R_GEN_CONFIG, dma7, serial0)) {
@@ -1653,7 +1301,7 @@ static void e100_disable_rxdma_channel(struct e100_serial *info)
                }
        }
        *R_GEN_CONFIG = genconfig_shadow;
-       restore_flags(flags);
+       local_irq_restore(flags);
 }
 
 
@@ -1661,8 +1309,7 @@ static void e100_enable_rxdma_channel(struct e100_serial *info)
 {
        unsigned long flags;
 
-       save_flags(flags);
-       cli();
+       local_irq_save(flags);
        /* Enable input DMA channel for the serial port in question */
        if (info->line == 0) {
                genconfig_shadow &=  ~IO_MASK(R_GEN_CONFIG, dma7);
@@ -1678,7 +1325,7 @@ static void e100_enable_rxdma_channel(struct e100_serial *info)
                genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma5, serial3);
        }
        *R_GEN_CONFIG = genconfig_shadow;
-       restore_flags(flags);
+       local_irq_restore(flags);
 }
 
 #ifdef SERIAL_HANDLE_EARLY_ERRORS
@@ -1785,7 +1432,7 @@ e100_enable_rs485(struct tty_struct *tty,struct rs485_control *r)
 }
 
 static int
-e100_write_rs485(struct tty_struct *tty, int from_user,
+e100_write_rs485(struct tty_struct *tty,
                  const unsigned char *buf, int count)
 {
        struct e100_serial * info = (struct e100_serial *)tty->driver_data;
@@ -1798,7 +1445,7 @@ e100_write_rs485(struct tty_struct *tty, int from_user,
         */
        info->rs485.enabled = 1;
        /* rs_write now deals with RS485 if enabled */
-       count = rs_write(tty, from_user, buf, count);
+       count = rs_write(tty, buf, count);
        info->rs485.enabled = old_enabled;
        return count;
 }
@@ -1836,7 +1483,7 @@ rs_stop(struct tty_struct *tty)
                unsigned long flags;
                unsigned long xoff;
 
-               save_flags(flags); cli();
+               local_irq_save(flags);
                DFLOW(DEBUG_LOG(info->line, "XOFF rs_stop xmit %i\n",
                                CIRC_CNT(info->xmit.head,
                                         info->xmit.tail,SERIAL_XMIT_SIZE)));
@@ -1848,7 +1495,7 @@ rs_stop(struct tty_struct *tty)
                }
 
                *((unsigned long *)&info->port[REG_XOFF]) = xoff;
-               restore_flags(flags);
+               local_irq_restore(flags);
        }
 }
 
@@ -1860,7 +1507,7 @@ rs_start(struct tty_struct *tty)
                unsigned long flags;
                unsigned long xoff;
 
-               save_flags(flags); cli();
+               local_irq_save(flags);
                DFLOW(DEBUG_LOG(info->line, "XOFF rs_start xmit %i\n",
                                CIRC_CNT(info->xmit.head,
                                         info->xmit.tail,SERIAL_XMIT_SIZE)));
@@ -1875,7 +1522,7 @@ rs_start(struct tty_struct *tty)
                    info->xmit.head != info->xmit.tail && info->xmit.buf)
                        e100_enable_serial_tx_ready_irq(info);
 
-               restore_flags(flags);
+               local_irq_restore(flags);
        }
 }
 
@@ -2055,8 +1702,7 @@ static int serial_fast_timer_expired = 0;
 static void flush_timeout_function(unsigned long data);
 #define START_FLUSH_FAST_TIMER_TIME(info, string, usec) {\
   unsigned long timer_flags; \
-  save_flags(timer_flags); \
-  cli(); \
+  local_irq_save(timer_flags); \
   if (fast_timers[info->line].function == NULL) { \
     serial_fast_timer_started++; \
     TIMERD(DEBUG_LOG(info->line, "start_timer %i ", info->line)); \
@@ -2070,7 +1716,7 @@ static void flush_timeout_function(unsigned long data);
   else { \
     TIMERD(DEBUG_LOG(info->line, "timer %i already running\n", info->line)); \
   } \
-  restore_flags(timer_flags); \
+  local_irq_restore(timer_flags); \
 }
 #define START_FLUSH_FAST_TIMER(info, string) START_FLUSH_FAST_TIMER_TIME(info, string, info->flush_time_usec)
 
@@ -2099,8 +1745,7 @@ append_recv_buffer(struct e100_serial *info, struct etrax_recv_buffer *buffer)
 {
        unsigned long flags;
 
-       save_flags(flags);
-       cli();
+       local_irq_save(flags);
 
        if (!info->first_recv_buffer)
                info->first_recv_buffer = buffer;
@@ -2113,7 +1758,7 @@ append_recv_buffer(struct e100_serial *info, struct etrax_recv_buffer *buffer)
        if (info->recv_cnt > info->max_recv_cnt)
                info->max_recv_cnt = info->recv_cnt;
 
-       restore_flags(flags);
+       local_irq_restore(flags);
 }
 
 static int
@@ -2133,11 +1778,7 @@ add_char_and_flag(struct e100_serial *info, unsigned char data, unsigned char fl
                info->icount.rx++;
        } else {
                struct tty_struct *tty = info->tty;
-               *tty->flip.char_buf_ptr = data;
-               *tty->flip.flag_buf_ptr = flag;
-               tty->flip.flag_buf_ptr++;
-               tty->flip.char_buf_ptr++;
-               tty->flip.count++;
+               tty_insert_flip_char(tty, data, flag);
                info->icount.rx++;
        }
 
@@ -2322,7 +1963,6 @@ start_receive(struct e100_serial *info)
         */
        return;
 #endif
-       info->tty->flip.count = 0;
        if (info->uses_dma_in) {
                /* reset the input dma channel to be sure it works */
 
@@ -2484,32 +2124,20 @@ static void flush_to_flip_buffer(struct e100_serial *info)
 {
        struct tty_struct *tty;
        struct etrax_recv_buffer *buffer;
-       unsigned int length;
        unsigned long flags;
-       int max_flip_size;
-
-       if (!info->first_recv_buffer)
-               return;
 
-       save_flags(flags);
-       cli();
+       local_irq_save(flags);
+       tty = info->tty;
 
-       if (!(tty = info->tty)) {
-               restore_flags(flags);
+       if (!tty) {
+               local_irq_restore(flags);
                return;
        }
 
        while ((buffer = info->first_recv_buffer) != NULL) {
                unsigned int count = buffer->length;
 
-               count = tty_buffer_request_room(tty, count);
-               if (count == 0) /* Throttle ?? */
-                       break;
-
-               if (count > 1)
-                       tty_insert_flip_strings(tty, buffer->buffer, count - 1);
-               tty_insert_flip_char(tty, buffer->buffer[count-1], buffer->error);
-
+               tty_insert_flip_string(tty, buffer->buffer, count);
                info->recv_cnt -= count;
 
                if (count == buffer->length) {
@@ -2525,18 +2153,9 @@ static void flush_to_flip_buffer(struct e100_serial *info)
        if (!info->first_recv_buffer)
                info->last_recv_buffer = NULL;
 
-       restore_flags(flags);
-
-       DFLIP(
-         if (1) {
-                 DEBUG_LOG(info->line, "*** rxtot %i\n", info->icount.rx);
-                 DEBUG_LOG(info->line, "ldisc %lu\n", tty->ldisc.chars_in_buffer(tty));
-                 DEBUG_LOG(info->line, "room  %lu\n", tty->ldisc.receive_room(tty));
-         }
+       local_irq_restore(flags);
 
-       );
-
-       /* this includes a check for low-latency */
+       /* This includes a check for low-latency */
        tty_flip_buffer_push(tty);
 }
 
@@ -2679,21 +2298,7 @@ struct e100_serial * handle_ser_rx_interrupt_no_dma(struct e100_serial *info)
                printk("!NO TTY!\n");
                return info;
        }
-       if (tty->flip.count >= CRIS_BUF_SIZE - TTY_THRESHOLD_THROTTLE) {
-               /* check TTY_THROTTLED first so it indicates our state */
-               if (!test_and_set_bit(TTY_THROTTLED, &tty->flags)) {
-                       DFLOW(DEBUG_LOG(info->line, "rs_throttle flip.count: %i\n", tty->flip.count));
-                       rs_throttle(tty);
-               }
-       }
-       if (tty->flip.count >= CRIS_BUF_SIZE) {
-               DEBUG_LOG(info->line, "force FLIP! %i\n", tty->flip.count);
-               tty->flip.work.func((void *) tty);
-               if (tty->flip.count >= CRIS_BUF_SIZE) {
-                       DEBUG_LOG(info->line, "FLIP FULL! %i\n", tty->flip.count);
-                       return info;            /* if TTY_DONT_FLIP is set */
-               }
-       }
+
        /* Read data and status at the same time */
        data_read = *((unsigned long *)&info->port[REG_DATA_STATUS32]);
 more_data:
@@ -2746,27 +2351,26 @@ more_data:
                                DEBUG_LOG(info->line, "EBRK %i\n", info->break_detected_cnt);
                                info->errorcode = ERRCODE_INSERT_BREAK;
                        } else {
+                               unsigned char data = IO_EXTRACT(R_SERIAL0_READ,
+                                       data_in, data_read);
+                               char flag = TTY_NORMAL;
                                if (info->errorcode == ERRCODE_INSERT_BREAK) {
-                                       info->icount.brk++;
-                                       *tty->flip.char_buf_ptr = 0;
-                                       *tty->flip.flag_buf_ptr = TTY_BREAK;
-                                       tty->flip.flag_buf_ptr++;
-                                       tty->flip.char_buf_ptr++;
-                                       tty->flip.count++;
+                                       struct tty_struct *tty = info->tty;
+                                       tty_insert_flip_char(tty, 0, flag);
                                        info->icount.rx++;
                                }
-                               *tty->flip.char_buf_ptr = IO_EXTRACT(R_SERIAL0_READ, data_in, data_read);
 
                                if (data_read & IO_MASK(R_SERIAL0_READ, par_err)) {
                                        info->icount.parity++;
-                                       *tty->flip.flag_buf_ptr = TTY_PARITY;
+                                       flag = TTY_PARITY;
                                } else if (data_read & IO_MASK(R_SERIAL0_READ, overrun)) {
                                        info->icount.overrun++;
-                                       *tty->flip.flag_buf_ptr = TTY_OVERRUN;
+                                       flag = TTY_OVERRUN;
                                } else if (data_read & IO_MASK(R_SERIAL0_READ, framing_err)) {
                                        info->icount.frame++;
-                                       *tty->flip.flag_buf_ptr = TTY_FRAME;
+                                       flag = TTY_FRAME;
                                }
+                               tty_insert_flip_char(tty, data, flag);
                                info->errorcode = 0;
                        }
                        info->break_detected_cnt = 0;
@@ -2782,16 +2386,14 @@ more_data:
                        log_int(rdpc(), 0, 0);
                }
                );
-               *tty->flip.char_buf_ptr = IO_EXTRACT(R_SERIAL0_READ, data_in, data_read);
-               *tty->flip.flag_buf_ptr = 0;
+               tty_insert_flip_char(tty,
+                       IO_EXTRACT(R_SERIAL0_READ, data_in, data_read),
+                       TTY_NORMAL);
        } else {
                DEBUG_LOG(info->line, "ser_rx int but no data_avail  %08lX\n", data_read);
        }
 
 
-       tty->flip.flag_buf_ptr++;
-       tty->flip.char_buf_ptr++;
-       tty->flip.count++;
        info->icount.rx++;
        data_read = *((unsigned long *)&info->port[REG_DATA_STATUS32]);
        if (data_read & IO_MASK(R_SERIAL0_READ, data_avail)) {
@@ -2929,7 +2531,7 @@ static void handle_ser_tx_interrupt(struct e100_serial *info)
        if (info->x_char) {
                unsigned char rstat;
                DFLOW(DEBUG_LOG(info->line, "tx_int: xchar 0x%02X\n", info->x_char));
-               save_flags(flags); cli();
+               local_irq_save(flags);
                rstat = info->port[REG_STATUS];
                DFLOW(DEBUG_LOG(info->line, "stat %x\n", rstat));
 
@@ -2938,7 +2540,7 @@ static void handle_ser_tx_interrupt(struct e100_serial *info)
                info->x_char = 0;
                /* We must enable since it is disabled in ser_interrupt */
                e100_enable_serial_tx_ready_irq(info);
-               restore_flags(flags);
+               local_irq_restore(flags);
                return;
        }
        if (info->uses_dma_out) {
@@ -2946,7 +2548,7 @@ static void handle_ser_tx_interrupt(struct e100_serial *info)
                int i;
                /* We only use normal tx interrupt when sending x_char */
                DFLOW(DEBUG_LOG(info->line, "tx_int: xchar sent\n", 0));
-               save_flags(flags); cli();
+               local_irq_save(flags);
                rstat = info->port[REG_STATUS];
                DFLOW(DEBUG_LOG(info->line, "stat %x\n", rstat));
                e100_disable_serial_tx_ready_irq(info);
@@ -2959,7 +2561,7 @@ static void handle_ser_tx_interrupt(struct e100_serial *info)
                        nop();
 
                *info->ocmdadr = IO_STATE(R_DMA_CH6_CMD, cmd, continue);
-               restore_flags(flags);
+               local_irq_restore(flags);
                return;
        }
        /* Normal char-by-char interrupt */
@@ -2973,7 +2575,7 @@ static void handle_ser_tx_interrupt(struct e100_serial *info)
        }
        DINTR2(DEBUG_LOG(info->line, "tx_int %c\n", info->xmit.buf[info->xmit.tail]));
        /* Send a byte, rs485 timing is critical so turn of ints */
-       save_flags(flags); cli();
+       local_irq_save(flags);
        info->port[REG_TR_DATA] = info->xmit.buf[info->xmit.tail];
        info->xmit.tail = (info->xmit.tail + 1) & (SERIAL_XMIT_SIZE-1);
        info->icount.tx++;
@@ -2997,7 +2599,7 @@ static void handle_ser_tx_interrupt(struct e100_serial *info)
                /* We must enable since it is disabled in ser_interrupt */
                e100_enable_serial_tx_ready_irq(info);
        }
-       restore_flags(flags);
+       local_irq_restore(flags);
 
        if (CIRC_CNT(info->xmit.head,
                     info->xmit.tail,
@@ -3022,7 +2624,7 @@ ser_interrupt(int irq, void *dev_id)
        int handled = 0;
        static volatile unsigned long reentered_ready_mask = 0;
 
-       save_flags(flags); cli();
+       local_irq_save(flags);
        irq_mask1_rd = *R_IRQ_MASK1_RD;
        /* First handle all rx interrupts with ints disabled */
        info = rs_table;
@@ -3067,7 +2669,7 @@ ser_interrupt(int irq, void *dev_id)
                        /* Unblock the serial interrupt */
                        *R_VECT_MASK_SET = IO_STATE(R_VECT_MASK_SET, serial, set);
 
-                       sti();
+                       local_irq_enable();
                        ready_mask = (1 << (8+1+2*0)); /* ser0 tr_ready */
                        info = rs_table;
                        for (i = 0; i < NR_PORTS; i++) {
@@ -3080,11 +2682,11 @@ ser_interrupt(int irq, void *dev_id)
                                ready_mask <<= 2;
                        }
                        /* handle_ser_tx_interrupt enables tr_ready interrupts */
-                       cli();
+                       local_irq_disable();
                        /* Handle reentered TX interrupt */
                        irq_mask1_rd = reentered_ready_mask;
                }
-               cli();
+               local_irq_disable();
                tx_started = 0;
        } else {
                unsigned long ready_mask;
@@ -3100,7 +2702,7 @@ ser_interrupt(int irq, void *dev_id)
                }
        }
 
-       restore_flags(flags);
+       local_irq_restore(flags);
        return IRQ_RETVAL(handled);
 } /* ser_interrupt */
 #endif
@@ -3121,11 +2723,13 @@ ser_interrupt(int irq, void *dev_id)
  * them using rs_sched_event(), and they get done here.
  */
 static void
-do_softint(void *private_)
+do_softint(struct work_struct *work)
 {
-       struct e100_serial      *info = (struct e100_serial *) private_;
+       struct e100_serial      *info;
        struct tty_struct       *tty;
 
+       info = container_of(work, struct e100_serial, work);
+
        tty = info->tty;
        if (!tty)
                return;
@@ -3145,13 +2749,12 @@ startup(struct e100_serial * info)
        if (!xmit_page)
                return -ENOMEM;
 
-       save_flags(flags);
-       cli();
+       local_irq_save(flags);
 
        /* if it was already initialized, skip this */
 
        if (info->flags & ASYNC_INITIALIZED) {
-               restore_flags(flags);
+               local_irq_restore(flags);
                free_page(xmit_page);
                return 0;
        }
@@ -3277,7 +2880,7 @@ startup(struct e100_serial * info)
 
        info->flags |= ASYNC_INITIALIZED;
 
-       restore_flags(flags);
+       local_irq_restore(flags);
        return 0;
 }
 
@@ -3328,8 +2931,7 @@ shutdown(struct e100_serial * info)
               info->irq);
 #endif
 
-       save_flags(flags);
-       cli(); /* Disable interrupts */
+       local_irq_save(flags);
 
        if (info->xmit.buf) {
                free_page((unsigned long)info->xmit.buf);
@@ -3353,7 +2955,7 @@ shutdown(struct e100_serial * info)
                set_bit(TTY_IO_ERROR, &info->tty->flags);
 
        info->flags &= ~ASYNC_INITIALIZED;
-       restore_flags(flags);
+       local_irq_restore(flags);
 }
 
 
@@ -3411,7 +3013,6 @@ change_speed(struct e100_serial *info)
                                DBAUD(printk("using external baudrate: %lu\n", CONFIG_ETRAX_EXTERN_PB6CLK_FREQ/8));
                                info->baud = CONFIG_ETRAX_EXTERN_PB6CLK_FREQ/8;
                        }
-               }
 #endif
                else
                {
@@ -3445,8 +3046,7 @@ change_speed(struct e100_serial *info)
 
 #ifndef CONFIG_SVINTO_SIM
        /* start with default settings and then fill in changes */
-       save_flags(flags);
-       cli();
+       local_irq_save(flags);
        /* 8 bit, no/even parity */
        info->rx_ctrl &= ~(IO_MASK(R_SERIAL0_REC_CTRL, rec_bitnr) |
                           IO_MASK(R_SERIAL0_REC_CTRL, rec_par_en) |
@@ -3510,7 +3110,7 @@ change_speed(struct e100_serial *info)
        }
 
        *((unsigned long *)&info->port[REG_XOFF]) = xoff;
-       restore_flags(flags);
+       local_irq_restore(flags);
 #endif /* !CONFIG_SVINTO_SIM */
 
        update_char_time(info);
@@ -3538,13 +3138,12 @@ rs_flush_chars(struct tty_struct *tty)
 
        /* this protection might not exactly be necessary here */
 
-       save_flags(flags);
-       cli();
+       local_irq_save(flags);
        start_transmit(info);
-       restore_flags(flags);
+       local_irq_restore(flags);
 }
 
-static int rs_raw_write(struct tty_struct * tty, int from_user,
+static int rs_raw_write(struct tty_struct *tty,
                        const unsigned char *buf, int count)
 {
        int     c, ret = 0;
@@ -3567,53 +3166,19 @@ static int rs_raw_write(struct tty_struct * tty, int from_user,
        SIMCOUT(buf, count);
        return count;
 #endif
-       save_flags(flags);
+       local_save_flags(flags);
        DFLOW(DEBUG_LOG(info->line, "write count %i ", count));
        DFLOW(DEBUG_LOG(info->line, "ldisc %i\n", tty->ldisc.chars_in_buffer(tty)));
 
 
-       /* the cli/restore_flags pairs below are needed because the
-        * DMA interrupt handler moves the info->xmit values. the memcpy
-        * needs to be in the critical region unfortunately, because we
-        * need to read xmit values, memcpy, write xmit values in one
-        * atomic operation... this could perhaps be avoided by more clever
-        * design.
+       /* The local_irq_disable/restore_flags pairs below are needed
+        * because the DMA interrupt handler moves the info->xmit values.
+        * the memcpy needs to be in the critical region unfortunately,
+        * because we need to read xmit values, memcpy, write xmit values
+        * in one atomic operation... this could perhaps be avoided by
+        * more clever design.
         */
-       if (from_user) {
-               mutex_lock(&tmp_buf_mutex);
-               while (1) {
-                       int c1;
-                       c = CIRC_SPACE_TO_END(info->xmit.head,
-                                             info->xmit.tail,
-                                             SERIAL_XMIT_SIZE);
-                       if (count < c)
-                               c = count;
-                       if (c <= 0)
-                               break;
-
-                       c -= copy_from_user(tmp_buf, buf, c);
-                       if (!c) {
-                               if (!ret)
-                                       ret = -EFAULT;
-                               break;
-                       }
-                       cli();
-                       c1 = CIRC_SPACE_TO_END(info->xmit.head,
-                                              info->xmit.tail,
-                                              SERIAL_XMIT_SIZE);
-                       if (c1 < c)
-                               c = c1;
-                       memcpy(info->xmit.buf + info->xmit.head, tmp_buf, c);
-                       info->xmit.head = ((info->xmit.head + c) &
-                                          (SERIAL_XMIT_SIZE-1));
-                       restore_flags(flags);
-                       buf += c;
-                       count -= c;
-                       ret += c;
-               }
-               mutex_unlock(&tmp_buf_mutex);
-       } else {
-               cli();
+       local_irq_disable();
                while (count) {
                        c = CIRC_SPACE_TO_END(info->xmit.head,
                                              info->xmit.tail,
@@ -3631,8 +3196,7 @@ static int rs_raw_write(struct tty_struct * tty, int from_user,
                        count -= c;
                        ret += c;
                }
-               restore_flags(flags);
-       }
+       local_irq_restore(flags);
 
        /* enable transmitter if not running, unless the tty is stopped
         * this does not need IRQ protection since if tr_running == 0
@@ -3651,7 +3215,7 @@ static int rs_raw_write(struct tty_struct * tty, int from_user,
 } /* raw_raw_write() */
 
 static int
-rs_write(struct tty_struct * tty, int from_user,
+rs_write(struct tty_struct *tty,
         const unsigned char *buf, int count)
 {
 #if defined(CONFIG_ETRAX_RS485)
@@ -3678,7 +3242,7 @@ rs_write(struct tty_struct * tty, int from_user,
        }
 #endif /* CONFIG_ETRAX_RS485 */
 
-       count = rs_raw_write(tty, from_user, buf, count);
+       count = rs_raw_write(tty, buf, count);
 
 #if defined(CONFIG_ETRAX_RS485)
        if (info->rs485.enabled)
@@ -3746,10 +3310,9 @@ rs_flush_buffer(struct tty_struct *tty)
        struct e100_serial *info = (struct e100_serial *)tty->driver_data;
        unsigned long flags;
 
-       save_flags(flags);
-       cli();
+       local_irq_save(flags);
        info->xmit.head = info->xmit.tail = 0;
-       restore_flags(flags);
+       local_irq_restore(flags);
 
        tty_wakeup(tty);
 }
@@ -3767,7 +3330,7 @@ static void rs_send_xchar(struct tty_struct *tty, char ch)
 {
        struct e100_serial *info = (struct e100_serial *)tty->driver_data;
        unsigned long flags;
-       save_flags(flags); cli();
+       local_irq_save(flags);
        if (info->uses_dma_out) {
                /* Put the DMA on hold and disable the channel */
                *info->ocmdadr = IO_STATE(R_DMA_CH6_CMD, cmd, hold);
@@ -3784,7 +3347,7 @@ static void rs_send_xchar(struct tty_struct *tty, char ch)
        DFLOW(DEBUG_LOG(info->line, "rs_send_xchar 0x%02X\n", ch));
        info->x_char = ch;
        e100_enable_serial_tx_ready_irq(info);
-       restore_flags(flags);
+       local_irq_restore(flags);
 }
 
 /*
@@ -3996,21 +3559,61 @@ char *get_control_state_str(int MLines, char *s)
 }
 #endif
 
+static void
+rs_break(struct tty_struct *tty, int break_state)
+{
+       struct e100_serial *info = (struct e100_serial *)tty->driver_data;
+       unsigned long flags;
+
+       if (!info->port)
+               return;
+
+       local_irq_save(flags);
+       if (break_state == -1) {
+               /* Go to manual mode and set the txd pin to 0 */
+               /* Clear bit 7 (txd) and 6 (tr_enable) */
+               info->tx_ctrl &= 0x3F;
+       } else {
+               /* Set bit 7 (txd) and 6 (tr_enable) */
+               info->tx_ctrl |= (0x80 | 0x40);
+       }
+       info->port[REG_TR_CTRL] = info->tx_ctrl;
+       local_irq_restore(flags);
+}
+
 static int
-get_modem_info(struct e100_serial * info, unsigned int *value)
+rs_tiocmset(struct tty_struct *tty, struct file *file,
+               unsigned int set, unsigned int clear)
 {
-       unsigned int result;
-       /* Polarity isn't verified */
-#if 0 /*def SERIAL_DEBUG_IO  */
+       struct e100_serial *info = (struct e100_serial *)tty->driver_data;
 
-       printk("get_modem_info: RTS: %i DTR: %i CD: %i RI: %i DSR: %i CTS: %i\n",
-              E100_RTS_GET(info),
-              E100_DTR_GET(info),
-              E100_CD_GET(info),
-              E100_RI_GET(info),
-              E100_DSR_GET(info),
-              E100_CTS_GET(info));
-#endif
+       if (clear & TIOCM_RTS)
+               e100_rts(info, 0);
+       if (clear & TIOCM_DTR)
+               e100_dtr(info, 0);
+       /* Handle FEMALE behaviour */
+       if (clear & TIOCM_RI)
+               e100_ri_out(info, 0);
+       if (clear & TIOCM_CD)
+               e100_cd_out(info, 0);
+
+       if (set & TIOCM_RTS)
+               e100_rts(info, 1);
+       if (set & TIOCM_DTR)
+               e100_dtr(info, 1);
+       /* Handle FEMALE behaviour */
+       if (set & TIOCM_RI)
+               e100_ri_out(info, 1);
+       if (set & TIOCM_CD)
+               e100_cd_out(info, 1);
+       return 0;
+}
+
+static int
+rs_tiocmget(struct tty_struct *tty, struct file *file)
+{
+       struct e100_serial *info = (struct e100_serial *)tty->driver_data;
+       unsigned int result;
 
        result =
                (!E100_RTS_GET(info) ? TIOCM_RTS : 0)
@@ -4021,95 +3624,20 @@ get_modem_info(struct e100_serial * info, unsigned int *value)
                | (!E100_CTS_GET(info) ? TIOCM_CTS : 0);
 
 #ifdef SERIAL_DEBUG_IO
-       printk("e100ser: modem state: %i 0x%08X\n", result, result);
+       printk(KERN_DEBUG "ser%i: modem state: %i 0x%08X\n",
+               info->line, result, result);
        {
                char s[100];
 
                get_control_state_str(result, s);
-               printk("state: %s\n", s);
+               printk(KERN_DEBUG "state: %s\n", s);
        }
 #endif
-       if (copy_to_user(value, &result, sizeof(int)))
-               return -EFAULT;
-       return 0;
-}
+       return result;
 
-
-static int
-set_modem_info(struct e100_serial * info, unsigned int cmd,
-              unsigned int *value)
-{
-       unsigned int arg;
-
-       if (copy_from_user(&arg, value, sizeof(int)))
-               return -EFAULT;
-
-       switch (cmd) {
-       case TIOCMBIS:
-               if (arg & TIOCM_RTS) {
-                       e100_rts(info, 1);
-               }
-               if (arg & TIOCM_DTR) {
-                       e100_dtr(info, 1);
-               }
-               /* Handle FEMALE behaviour */
-               if (arg & TIOCM_RI) {
-                       e100_ri_out(info, 1);
-               }
-               if (arg & TIOCM_CD) {
-                       e100_cd_out(info, 1);
-               }
-               break;
-       case TIOCMBIC:
-               if (arg & TIOCM_RTS) {
-                       e100_rts(info, 0);
-               }
-               if (arg & TIOCM_DTR) {
-                       e100_dtr(info, 0);
-               }
-               /* Handle FEMALE behaviour */
-               if (arg & TIOCM_RI) {
-                       e100_ri_out(info, 0);
-               }
-               if (arg & TIOCM_CD) {
-                       e100_cd_out(info, 0);
-               }
-               break;
-       case TIOCMSET:
-               e100_rts(info, arg & TIOCM_RTS);
-               e100_dtr(info, arg & TIOCM_DTR);
-               /* Handle FEMALE behaviour */
-               e100_ri_out(info, arg & TIOCM_RI);
-               e100_cd_out(info, arg & TIOCM_CD);
-               break;
-       default:
-               return -EINVAL;
-       }
-       return 0;
 }
 
 
-static void
-rs_break(struct tty_struct *tty, int break_state)
-{
-       struct e100_serial * info = (struct e100_serial *)tty->driver_data;
-       unsigned long flags;
-
-       if (!info->port)
-               return;
-
-       save_flags(flags);
-       cli();
-       if (break_state == -1) {
-               /* Go to manual mode and set the txd pin to 0 */
-               info->tx_ctrl &= 0x3F; /* Clear bit 7 (txd) and 6 (tr_enable) */
-       } else {
-               info->tx_ctrl |= (0x80 | 0x40); /* Set bit 7 (txd) and 6 (tr_enable) */
-       }
-       info->port[REG_TR_CTRL] = info->tx_ctrl;
-       restore_flags(flags);
-}
-
 static int
 rs_ioctl(struct tty_struct *tty, struct file * file,
         unsigned int cmd, unsigned long arg)
@@ -4124,49 +3652,45 @@ rs_ioctl(struct tty_struct *tty, struct file * file,
        }
 
        switch (cmd) {
-               case TIOCMGET:
-                       return get_modem_info(info, (unsigned int *) arg);
-               case TIOCMBIS:
-               case TIOCMBIC:
-               case TIOCMSET:
-                       return set_modem_info(info, cmd, (unsigned int *) arg);
-               case TIOCGSERIAL:
-                       return get_serial_info(info,
-                                              (struct serial_struct *) arg);
-               case TIOCSSERIAL:
-                       return set_serial_info(info,
-                                              (struct serial_struct *) arg);
-               case TIOCSERGETLSR: /* Get line status register */
-                       return get_lsr_info(info, (unsigned int *) arg);
-
-               case TIOCSERGSTRUCT:
-                       if (copy_to_user((struct e100_serial *) arg,
-                                        info, sizeof(struct e100_serial)))
-                               return -EFAULT;
-                       return 0;
+       case TIOCGSERIAL:
+               return get_serial_info(info,
+                                      (struct serial_struct *) arg);
+       case TIOCSSERIAL:
+               return set_serial_info(info,
+                                      (struct serial_struct *) arg);
+       case TIOCSERGETLSR: /* Get line status register */
+               return get_lsr_info(info, (unsigned int *) arg);
+
+       case TIOCSERGSTRUCT:
+               if (copy_to_user((struct e100_serial *) arg,
+                                info, sizeof(struct e100_serial)))
+                       return -EFAULT;
+               return 0;
 
 #if defined(CONFIG_ETRAX_RS485)
-               case TIOCSERSETRS485:
-               {
-                       struct rs485_control rs485ctrl;
-                       if (copy_from_user(&rs485ctrl, (struct rs485_control*)arg, sizeof(rs485ctrl)))
-                               return -EFAULT;
+       case TIOCSERSETRS485:
+       {
+               struct rs485_control rs485ctrl;
+               if (copy_from_user(&rs485ctrl, (struct rs485_control *)arg,
+                               sizeof(rs485ctrl)))
+                       return -EFAULT;
 
-                       return e100_enable_rs485(tty, &rs485ctrl);
-               }
+               return e100_enable_rs485(tty, &rs485ctrl);
+       }
 
-               case TIOCSERWRRS485:
-               {
-                       struct rs485_write rs485wr;
-                       if (copy_from_user(&rs485wr, (struct rs485_write*)arg, sizeof(rs485wr)))
-                               return -EFAULT;
+       case TIOCSERWRRS485:
+       {
+               struct rs485_write rs485wr;
+               if (copy_from_user(&rs485wr, (struct rs485_write *)arg,
+                               sizeof(rs485wr)))
+                       return -EFAULT;
 
-                       return e100_write_rs485(tty, 1, rs485wr.outc, rs485wr.outc_size);
-               }
+               return e100_write_rs485(tty, rs485wr.outc, rs485wr.outc_size);
+       }
 #endif
 
-               default:
-                       return -ENOIOCTLCMD;
+       default:
+               return -ENOIOCTLCMD;
        }
        return 0;
 }
@@ -4191,46 +3715,6 @@ rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
 
 }
 
-/* In debugport.c - register a console write function that uses the normal
- * serial driver
- */
-typedef int (*debugport_write_function)(int i, const char *buf, unsigned int len);
-
-extern debugport_write_function debug_write_function;
-
-static int rs_debug_write_function(int i, const char *buf, unsigned int len)
-{
-       int cnt;
-       int written = 0;
-        struct tty_struct *tty;
-        static int recurse_cnt = 0;
-
-        tty = rs_table[i].tty;
-        if (tty)  {
-               unsigned long flags;
-               if (recurse_cnt > 5) /* We skip this debug output */
-                       return 1;
-
-               local_irq_save(flags);
-               recurse_cnt++;
-               local_irq_restore(flags);
-                do {
-                        cnt = rs_write(tty, 0, buf + written, len);
-                        if (cnt >= 0) {
-                               written += cnt;
-                                buf += cnt;
-                                len -= cnt;
-                        } else
-                                len = cnt;
-                } while(len > 0);
-               local_irq_save(flags);
-               recurse_cnt--;
-               local_irq_restore(flags);
-                return 1;
-        }
-        return 0;
-}
-
 /*
  * ------------------------------------------------------------
  * rs_close()
@@ -4252,11 +3736,10 @@ rs_close(struct tty_struct *tty, struct file * filp)
 
        /* interrupts are disabled for this entire function */
 
-       save_flags(flags);
-       cli();
+       local_irq_save(flags);
 
        if (tty_hung_up_p(filp)) {
-               restore_flags(flags);
+               local_irq_restore(flags);
                return;
        }
 
@@ -4283,7 +3766,7 @@ rs_close(struct tty_struct *tty, struct file * filp)
                info->count = 0;
        }
        if (info->count) {
-               restore_flags(flags);
+               local_irq_restore(flags);
                return;
        }
        info->flags |= ASYNC_CLOSING;
@@ -4337,7 +3820,7 @@ rs_close(struct tty_struct *tty, struct file * filp)
        }
        info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
        wake_up_interruptible(&info->close_wait);
-       restore_flags(flags);
+       local_irq_restore(flags);
 
        /* port closed */
 
@@ -4359,6 +3842,28 @@ rs_close(struct tty_struct *tty, struct file * filp)
 #endif
        }
 #endif
+
+       /*
+        * Release any allocated DMA irq's.
+        */
+       if (info->dma_in_enabled) {
+               free_irq(info->dma_in_irq_nbr, info);
+               cris_free_dma(info->dma_in_nbr, info->dma_in_irq_description);
+               info->uses_dma_in = 0;
+#ifdef SERIAL_DEBUG_OPEN
+               printk(KERN_DEBUG "DMA irq '%s' freed\n",
+                       info->dma_in_irq_description);
+#endif
+       }
+       if (info->dma_out_enabled) {
+               free_irq(info->dma_out_irq_nbr, info);
+               cris_free_dma(info->dma_out_nbr, info->dma_out_irq_description);
+               info->uses_dma_out = 0;
+#ifdef SERIAL_DEBUG_OPEN
+               printk(KERN_DEBUG "DMA irq '%s' freed\n",
+                       info->dma_out_irq_description);
+#endif
+       }
 }
 
 /*
@@ -4433,8 +3938,8 @@ block_til_ready(struct tty_struct *tty, struct file * filp,
         */
        if (tty_hung_up_p(filp) ||
            (info->flags & ASYNC_CLOSING)) {
-               if (info->flags & ASYNC_CLOSING)
-                       interruptible_sleep_on(&info->close_wait);
+               wait_event_interruptible(info->close_wait,
+                       !(info->flags & ASYNC_CLOSING));
 #ifdef SERIAL_DO_RESTART
                if (info->flags & ASYNC_HUP_NOTIFY)
                        return -EAGAIN;
@@ -4472,21 +3977,19 @@ block_til_ready(struct tty_struct *tty, struct file * filp,
        printk("block_til_ready before block: ttyS%d, count = %d\n",
               info->line, info->count);
 #endif
-       save_flags(flags);
-       cli();
+       local_irq_save(flags);
        if (!tty_hung_up_p(filp)) {
                extra_count++;
                info->count--;
        }
-       restore_flags(flags);
+       local_irq_restore(flags);
        info->blocked_open++;
        while (1) {
-               save_flags(flags);
-               cli();
+               local_irq_save(flags);
                /* assert RTS and DTR */
                e100_rts(info, 1);
                e100_dtr(info, 1);
-               restore_flags(flags);
+               local_irq_restore(flags);
                set_current_state(TASK_INTERRUPTIBLE);
                if (tty_hung_up_p(filp) ||
                    !(info->flags & ASYNC_INITIALIZED)) {
@@ -4528,6 +4031,19 @@ block_til_ready(struct tty_struct *tty, struct file * filp,
        return 0;
 }
 
+static void
+deinit_port(struct e100_serial *info)
+{
+       if (info->dma_out_enabled) {
+               cris_free_dma(info->dma_out_nbr, info->dma_out_irq_description);
+               free_irq(info->dma_out_irq_nbr, info);
+       }
+       if (info->dma_in_enabled) {
+               cris_free_dma(info->dma_in_nbr, info->dma_in_irq_description);
+               free_irq(info->dma_in_irq_nbr, info);
+       }
+}
+
 /*
  * This routine is called whenever a serial port is opened.
  * It performs the serial-specific initialization for the tty structure.
@@ -4538,9 +4054,9 @@ rs_open(struct tty_struct *tty, struct file * filp)
        struct e100_serial      *info;
        int                     retval, line;
        unsigned long           page;
+       int                     allocated_resources = 0;
 
        /* find which port we want to open */
-
        line = tty->index;
 
        if (line < 0 || line >= NR_PORTS)
@@ -4580,8 +4096,8 @@ rs_open(struct tty_struct *tty, struct file * filp)
         */
        if (tty_hung_up_p(filp) ||
            (info->flags & ASYNC_CLOSING)) {
-               if (info->flags & ASYNC_CLOSING)
-                       interruptible_sleep_on(&info->close_wait);
+               wait_event_interruptible(info->close_wait,
+                       !(info->flags & ASYNC_CLOSING));
 #ifdef SERIAL_DO_RESTART
                return ((info->flags & ASYNC_HUP_NOTIFY) ?
                        -EAGAIN : -ERESTARTSYS);
@@ -4590,13 +4106,86 @@ rs_open(struct tty_struct *tty, struct file * filp)
 #endif
        }
 
+       /*
+        * If DMA is enabled try to allocate the irq's.
+        */
+       if (info->count == 1) {
+               allocated_resources = 1;
+               if (info->dma_in_enabled) {
+                       if (request_irq(info->dma_in_irq_nbr,
+                                       rec_interrupt,
+                                       info->dma_in_irq_flags,
+                                       info->dma_in_irq_description,
+                                       info)) {
+                               printk(KERN_WARNING "DMA irq '%s' busy; "
+                                       "falling back to non-DMA mode\n",
+                                       info->dma_in_irq_description);
+                               /* Make sure we never try to use DMA in */
+                               /* for the port again. */
+                               info->dma_in_enabled = 0;
+                       } else if (cris_request_dma(info->dma_in_nbr,
+                                       info->dma_in_irq_description,
+                                       DMA_VERBOSE_ON_ERROR,
+                                       info->dma_owner)) {
+                               free_irq(info->dma_in_irq_nbr, info);
+                               printk(KERN_WARNING "DMA '%s' busy; "
+                                       "falling back to non-DMA mode\n",
+                                       info->dma_in_irq_description);
+                               /* Make sure we never try to use DMA in */
+                               /* for the port again. */
+                               info->dma_in_enabled = 0;
+                       }
+#ifdef SERIAL_DEBUG_OPEN
+                       else
+                               printk(KERN_DEBUG "DMA irq '%s' allocated\n",
+                                       info->dma_in_irq_description);
+#endif
+               }
+               if (info->dma_out_enabled) {
+                       if (request_irq(info->dma_out_irq_nbr,
+                                              tr_interrupt,
+                                              info->dma_out_irq_flags,
+                                              info->dma_out_irq_description,
+                                              info)) {
+                               printk(KERN_WARNING "DMA irq '%s' busy; "
+                                       "falling back to non-DMA mode\n",
+                                       info->dma_out_irq_description);
+                               /* Make sure we never try to use DMA out */
+                               /* for the port again. */
+                               info->dma_out_enabled = 0;
+                       } else if (cris_request_dma(info->dma_out_nbr,
+                                            info->dma_out_irq_description,
+                                            DMA_VERBOSE_ON_ERROR,
+                                            info->dma_owner)) {
+                               free_irq(info->dma_out_irq_nbr, info);
+                               printk(KERN_WARNING "DMA '%s' busy; "
+                                       "falling back to non-DMA mode\n",
+                                       info->dma_out_irq_description);
+                               /* Make sure we never try to use DMA out */
+                               /* for the port again. */
+                               info->dma_out_enabled = 0;
+                       }
+#ifdef SERIAL_DEBUG_OPEN
+                       else
+                               printk(KERN_DEBUG "DMA irq '%s' allocated\n",
+                                       info->dma_out_irq_description);
+#endif
+               }
+       }
+
        /*
         * Start up the serial port
         */
 
        retval = startup(info);
-       if (retval)
+       if (retval) {
+               if (allocated_resources)
+                       deinit_port(info);
+
+               /* FIXME Decrease count info->count here too? */
                return retval;
+       }
+
 
        retval = block_til_ready(tty, filp, info);
        if (retval) {
@@ -4604,6 +4193,9 @@ rs_open(struct tty_struct *tty, struct file * filp)
                printk("rs_open returning after block_til_ready with %d\n",
                       retval);
 #endif
+               if (allocated_resources)
+                       deinit_port(info);
+
                return retval;
        }
 
@@ -4793,6 +4385,8 @@ static const struct tty_operations rs_ops = {
        .send_xchar = rs_send_xchar,
        .wait_until_sent = rs_wait_until_sent,
        .read_proc = rs_read_proc,
+       .tiocmget = rs_tiocmget,
+       .tiocmset = rs_tiocmset
 };
 
 static int __init
@@ -4810,9 +4404,27 @@ rs_init(void)
        /* Setup the timed flush handler system */
 
 #if !defined(CONFIG_ETRAX_SERIAL_FAST_TIMER)
-       init_timer(&flush_timer);
-       flush_timer.function = timed_flush_handler;
-       mod_timer(&flush_timer, jiffies + CONFIG_ETRAX_SERIAL_RX_TIMEOUT_TICKS);
+       setup_timer(&flush_timer, timed_flush_handler, 0);
+       mod_timer(&flush_timer, jiffies + 5);
+#endif
+
+#if defined(CONFIG_ETRAX_RS485)
+#if defined(CONFIG_ETRAX_RS485_ON_PA)
+       if (cris_io_interface_allocate_pins(if_ser0, 'a', rs485_pa_bit,
+                       rs485_pa_bit)) {
+               printk(KERN_CRIT "ETRAX100LX serial: Could not allocate "
+                       "RS485 pin\n");
+               return -EBUSY;
+       }
+#endif
+#if defined(CONFIG_ETRAX_RS485_ON_PORT_G)
+       if (cris_io_interface_allocate_pins(if_ser0, 'g', rs485_pa_bit,
+                       rs485_port_g_bit)) {
+               printk(KERN_CRIT "ETRAX100LX serial: Could not allocate "
+                       "RS485 pin\n");
+               return -EBUSY;
+       }
+#endif
 #endif
 
        /* Initialize the tty_driver structure */
@@ -4839,6 +4451,16 @@ rs_init(void)
        /* do some initializing for the separate ports */
 
        for (i = 0, info = rs_table; i < NR_PORTS; i++,info++) {
+               if (info->enabled) {
+                       if (cris_request_io_interface(info->io_if,
+                                       info->io_if_description)) {
+                               printk(KERN_CRIT "ETRAX100LX async serial: "
+                                       "Could not allocate IO pins for "
+                                       "%s, port %d\n",
+                                       info->io_if_description, i);
+                               info->enabled = 0;
+                       }
+               }
                info->uses_dma_in = 0;
                info->uses_dma_out = 0;
                info->line = i;
@@ -4872,7 +4494,7 @@ rs_init(void)
                info->rs485.delay_rts_before_send = 0;
                info->rs485.enabled = 0;
 #endif
-               INIT_WORK(&info->work, do_softint, info);
+               INIT_WORK(&info->work, do_softint);
 
                if (info->enabled) {
                        printk(KERN_INFO "%s%d at 0x%x is a builtin UART with DMA\n",
@@ -4890,64 +4512,17 @@ rs_init(void)
 #endif
 
 #ifndef CONFIG_SVINTO_SIM
+#ifndef CONFIG_ETRAX_KGDB
        /* Not needed in simulator.  May only complicate stuff. */
        /* hook the irq's for DMA channel 6 and 7, serial output and input, and some more... */
 
-       if (request_irq(SERIAL_IRQ_NBR, ser_interrupt, IRQF_SHARED | IRQF_DISABLED, "serial ", NULL))
-               panic("irq8");
-
-#ifdef CONFIG_ETRAX_SERIAL_PORT0
-#ifdef CONFIG_ETRAX_SERIAL_PORT0_DMA6_OUT
-       if (request_irq(SER0_DMA_TX_IRQ_NBR, tr_interrupt, IRQF_DISABLED, "serial 0 dma tr", NULL))
-               panic("irq22");
-#endif
-#ifdef CONFIG_ETRAX_SERIAL_PORT0_DMA7_IN
-       if (request_irq(SER0_DMA_RX_IRQ_NBR, rec_interrupt, IRQF_DISABLED, "serial 0 dma rec", NULL))
-               panic("irq23");
-#endif
-#endif
-
-#ifdef CONFIG_ETRAX_SERIAL_PORT1
-#ifdef CONFIG_ETRAX_SERIAL_PORT1_DMA8_OUT
-       if (request_irq(SER1_DMA_TX_IRQ_NBR, tr_interrupt, IRQF_DISABLED, "serial 1 dma tr", NULL))
-               panic("irq24");
-#endif
-#ifdef CONFIG_ETRAX_SERIAL_PORT1_DMA9_IN
-       if (request_irq(SER1_DMA_RX_IRQ_NBR, rec_interrupt, IRQF_DISABLED, "serial 1 dma rec", NULL))
-               panic("irq25");
-#endif
-#endif
-#ifdef CONFIG_ETRAX_SERIAL_PORT2
-       /* DMA Shared with par0 (and SCSI0 and ATA) */
-#ifdef CONFIG_ETRAX_SERIAL_PORT2_DMA2_OUT
-       if (request_irq(SER2_DMA_TX_IRQ_NBR, tr_interrupt, IRQF_SHARED | IRQF_DISABLED, "serial 2 dma tr", NULL))
-               panic("irq18");
-#endif
-#ifdef CONFIG_ETRAX_SERIAL_PORT2_DMA3_IN
-       if (request_irq(SER2_DMA_RX_IRQ_NBR, rec_interrupt, IRQF_SHARED | IRQF_DISABLED, "serial 2 dma rec", NULL))
-               panic("irq19");
-#endif
-#endif
-#ifdef CONFIG_ETRAX_SERIAL_PORT3
-       /* DMA Shared with par1 (and SCSI1 and Extern DMA 0) */
-#ifdef CONFIG_ETRAX_SERIAL_PORT3_DMA4_OUT
-       if (request_irq(SER3_DMA_TX_IRQ_NBR, tr_interrupt, IRQF_SHARED | IRQF_DISABLED, "serial 3 dma tr", NULL))
-               panic("irq20");
-#endif
-#ifdef CONFIG_ETRAX_SERIAL_PORT3_DMA5_IN
-       if (request_irq(SER3_DMA_RX_IRQ_NBR, rec_interrupt, IRQF_SHARED | IRQF_DISABLED, "serial 3 dma rec", NULL))
-               panic("irq21");
-#endif
-#endif
+       if (request_irq(SERIAL_IRQ_NBR, ser_interrupt,
+                       IRQF_SHARED | IRQF_DISABLED, "serial ", driver))
+               panic("%s: Failed to request irq8", __FUNCTION__);
 
-#ifdef CONFIG_ETRAX_SERIAL_FLUSH_DMA_FAST
-       if (request_irq(TIMER1_IRQ_NBR, timeout_interrupt, IRQF_SHARED | IRQF_DISABLED,
-                      "fast serial dma timeout", NULL)) {
-               printk(KERN_CRIT "err: timer1 irq\n");
-       }
 #endif
 #endif /* CONFIG_SVINTO_SIM */
-       debug_write_function = rs_debug_write_function;
+
        return 0;
 }
 
diff --git a/drivers/serial/crisv10.h b/drivers/serial/crisv10.h
new file mode 100644 (file)
index 0000000..ccd0f32
--- /dev/null
@@ -0,0 +1,146 @@
+/*
+ * serial.h: Arch-dep definitions for the Etrax100 serial driver.
+ *
+ * Copyright (C) 1998-2007 Axis Communications AB
+ */
+
+#ifndef _ETRAX_SERIAL_H
+#define _ETRAX_SERIAL_H
+
+#include <linux/circ_buf.h>
+#include <asm/termios.h>
+#include <asm/dma.h>
+#include <asm/arch/io_interface_mux.h>
+
+/* Software state per channel */
+
+#ifdef __KERNEL__
+/*
+ * This is our internal structure for each serial port's state.
+ *
+ * Many fields are paralleled by the structure used by the serial_struct
+ * structure.
+ *
+ * For definitions of the flags field, see tty.h
+ */
+
+#define SERIAL_RECV_DESCRIPTORS 8
+
+struct etrax_recv_buffer {
+       struct etrax_recv_buffer *next;
+       unsigned short length;
+       unsigned char error;
+       unsigned char pad;
+
+       unsigned char buffer[0];
+};
+
+struct e100_serial {
+       int baud;
+       volatile u8     *port;  /* R_SERIALx_CTRL */
+       u32             irq;    /* bitnr in R_IRQ_MASK2 for dmaX_descr */
+
+       /* Output registers */
+       volatile u8 *oclrintradr;       /* adr to R_DMA_CHx_CLR_INTR */
+       volatile u32 *ofirstadr;        /* adr to R_DMA_CHx_FIRST */
+       volatile u8 *ocmdadr;           /* adr to R_DMA_CHx_CMD */
+       const volatile u8 *ostatusadr;  /* adr to R_DMA_CHx_STATUS */
+
+       /* Input registers */
+       volatile u8 *iclrintradr;       /* adr to R_DMA_CHx_CLR_INTR */
+       volatile u32 *ifirstadr;        /* adr to R_DMA_CHx_FIRST */
+       volatile u8 *icmdadr;           /* adr to R_DMA_CHx_CMD */
+       volatile u32 *idescradr;        /* adr to R_DMA_CHx_DESCR */
+
+       int flags;      /* defined in tty.h */
+
+       u8 rx_ctrl;     /* shadow for R_SERIALx_REC_CTRL */
+       u8 tx_ctrl;     /* shadow for R_SERIALx_TR_CTRL */
+       u8 iseteop;     /* bit number for R_SET_EOP for the input dma */
+       int enabled;    /* Set to 1 if the port is enabled in HW config */
+
+       u8 dma_out_enabled;     /* Set to 1 if DMA should be used */
+       u8 dma_in_enabled;      /* Set to 1 if DMA should be used */
+
+       /* end of fields defined in rs_table[] in .c-file */
+       int             dma_owner;
+       unsigned int    dma_in_nbr;
+       unsigned int    dma_out_nbr;
+       unsigned int    dma_in_irq_nbr;
+       unsigned int    dma_out_irq_nbr;
+       unsigned long   dma_in_irq_flags;
+       unsigned long   dma_out_irq_flags;
+       char            *dma_in_irq_description;
+       char            *dma_out_irq_description;
+
+       enum cris_io_interface io_if;
+       char            *io_if_description;
+
+       u8              uses_dma_in;  /* Set to 1 if DMA is used */
+       u8              uses_dma_out; /* Set to 1 if DMA is used */
+       u8              forced_eop;   /* a fifo eop has been forced */
+       int                     baud_base;     /* For special baudrates */
+       int                     custom_divisor; /* For special baudrates */
+       struct etrax_dma_descr  tr_descr;
+       struct etrax_dma_descr  rec_descr[SERIAL_RECV_DESCRIPTORS];
+       int                     cur_rec_descr;
+
+       volatile int            tr_running; /* 1 if output is running */
+
+       struct tty_struct       *tty;
+       int                     read_status_mask;
+       int                     ignore_status_mask;
+       int                     x_char; /* xon/xoff character */
+       int                     close_delay;
+       unsigned short          closing_wait;
+       unsigned short          closing_wait2;
+       unsigned long           event;
+       unsigned long           last_active;
+       int                     line;
+       int                     type;  /* PORT_ETRAX */
+       int                     count;      /* # of fd on device */
+       int                     blocked_open; /* # of blocked opens */
+       struct circ_buf         xmit;
+       struct etrax_recv_buffer *first_recv_buffer;
+       struct etrax_recv_buffer *last_recv_buffer;
+       unsigned int            recv_cnt;
+       unsigned int            max_recv_cnt;
+
+       struct work_struct      work;
+       struct async_icount     icount;   /* error-statistics etc.*/
+       struct ktermios         normal_termios;
+       struct ktermios         callout_termios;
+       wait_queue_head_t       open_wait;
+       wait_queue_head_t       close_wait;
+
+       unsigned long char_time_usec;       /* The time for 1 char, in usecs */
+       unsigned long flush_time_usec;      /* How often we should flush */
+       unsigned long last_tx_active_usec;  /* Last tx usec in the jiffies */
+       unsigned long last_tx_active;       /* Last tx time in jiffies */
+       unsigned long last_rx_active_usec;  /* Last rx usec in the jiffies */
+       unsigned long last_rx_active;       /* Last rx time in jiffies */
+
+       int break_detected_cnt;
+       int errorcode;
+
+#ifdef CONFIG_ETRAX_RS485
+       struct rs485_control    rs485;  /* RS-485 support */
+#endif
+};
+
+/* this PORT is not in the standard serial.h. it's not actually used for
+ * anything since we only have one type of async serial-port anyway in this
+ * system.
+ */
+
+#define PORT_ETRAX 1
+
+/*
+ * Events are used to schedule things to happen at timer-interrupt
+ * time, instead of at rs interrupt time.
+ */
+#define RS_EVENT_WRITE_WAKEUP  0
+
+#endif /* __KERNEL__ */
+
+#endif /* !_ETRAX_SERIAL_H */
index 5afcb2fa7cd3f16117fc15b0996bda6f0607b75c..d8b660061c1339855edb1d56af7e87a71490192d 100644 (file)
@@ -345,7 +345,7 @@ static int serial_probe(struct pcmcia_device *link)
 
        link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
        link->io.NumPorts1 = 8;
-       link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
+       link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
        link->irq.IRQInfo1 = IRQ_LEVEL_ID;
        link->conf.Attributes = CONF_ENABLE_IRQ;
        if (do_sound) {
index 6846a6c38b6d5535784bafd4884a51bbbc2e5be4..7ad21925869a0550465b56bac0e5a7c771f2fb31 100644 (file)
@@ -657,7 +657,15 @@ static void
 serial_txx9_pm(struct uart_port *port, unsigned int state,
              unsigned int oldstate)
 {
-       if (state == 0)
+       /*
+        * If oldstate was -1 this is called from
+        * uart_configure_port().  In this case do not initialize the
+        * port now, because the port was already initialized (for
+        * non-console port) or should not be initialized here (for
+        * console port).  If we initialized the port here we lose
+        * serial console settings.
+        */
+       if (state == 0 && oldstate != -1)
                serial_txx9_initialize(port);
 }
 
index e89ae29645d61d554b5ff67b698a7ece50659129..d24621ce799ab30f3e3b5370db6bf70a5e305fbb 100644 (file)
@@ -77,7 +77,6 @@
 # define SCIF_ONLY
 #elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712)
 # define SCSPTR0 0xA4400000      /* 16 bit SCIF */
-# define SCI_NPORTS 2
 # define SCIF_ORER 0x0001   /* overrun error bit */
 # define PACR 0xa4050100
 # define PBCR 0xa4050102
 # define SCIF_ORER 0x0001   /* overrun error bit */
 # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
 # define SCIF_ONLY
-#elif defined(CONFIG_CPU_SUBTYPE_ST40STB1)
-# define SCSPTR1 0xffe00020 /* 16 bit SCIF */
-# define SCSPTR2 0xffe80020 /* 16 bit SCIF */
-# define SCIF_ORER 0x0001   /* overrun error bit */
-# define SCSCR_INIT(port)          0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
-# define SCIF_ONLY
 #elif defined(CONFIG_CPU_SUBTYPE_SH5_101) || defined(CONFIG_CPU_SUBTYPE_SH5_103)
 # include <asm/hardware.h>
 # define SCIF_BASE_ADDR    0x01030000
 # define SCIF_LSR2_OFFS    0x0000024
 # define SCSPTR2           ((port->mapbase)+SCIF_PTR2_OFFS) /* 16 bit SCIF */
 # define SCLSR2            ((port->mapbase)+SCIF_LSR2_OFFS) /* 16 bit SCIF */
-# define SCSCR_INIT(port)  0x38                           /* TIE=0,RIE=0,
-                                                            TE=1,RE=1,REIE=1 */
+# define SCSCR_INIT(port)  0x38                /* TIE=0,RIE=0, TE=1,RE=1,REIE=1 */
 # define SCIF_ONLY
 #elif defined(CONFIG_H83007) || defined(CONFIG_H83068)
 # define SCSCR_INIT(port)          0x30 /* TIE=0,RIE=0,TE=1,RE=1 */
@@ -577,15 +569,6 @@ static inline int sci_rxd_in(struct uart_port *port)
                return ctrl_inb(SCPDR0) & 0x0001 ? 1 : 0; /* SCIF0 */
        return 1;
 }
-#elif defined(CONFIG_CPU_SUBTYPE_ST40STB1)
-static inline int sci_rxd_in(struct uart_port *port)
-{
-       if (port->mapbase == 0xffe00000)
-               return ctrl_inw(SCSPTR1)&0x0001 ? 1 : 0; /* SCIF */
-       else
-               return ctrl_inw(SCSPTR2)&0x0001 ? 1 : 0; /* SCIF */
-
-}
 #elif defined(CONFIG_CPU_SUBTYPE_SH5_101) || defined(CONFIG_CPU_SUBTYPE_SH5_103)
 static inline int sci_rxd_in(struct uart_port *port)
 {
index dfef83f14960d58de1c9ac7eb793f4aa105dcc72..a85f2d31a686c69f4f0a076358554bb54016325b 100644 (file)
@@ -329,12 +329,14 @@ static struct uart_ops ulite_ops = {
 static void ulite_console_wait_tx(struct uart_port *port)
 {
        int i;
+       u8 val;
 
-       /* wait up to 10ms for the character(s) to be sent */
-       for (i = 0; i < 10000; i++) {
-               if (readb(port->membase + ULITE_STATUS) & ULITE_STATUS_TXEMPTY)
+       /* Spin waiting for TX fifo to have space available */
+       for (i = 0; i < 100000; i++) {
+               val = readb(port->membase + ULITE_STATUS);
+               if ((val & ULITE_STATUS_TXFULL) == 0)
                        break;
-               udelay(1);
+               cpu_relax();
        }
 }
 
index 161d1021b7ebf405676540e7516b6561f3c98ce8..e52a6296ca46eedd20b2cd99469b65704135f842 100644 (file)
@@ -601,8 +601,7 @@ static int match_maple_bus_driver(struct device *devptr,
        return 0;
 }
 
-static int maple_bus_uevent(struct device *dev, char **envp,
-                           int num_envp, char *buffer, int buffer_size)
+static int maple_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
 {
        return 0;
 }
index 7d873b3b0513c03fb8fcfaa3e52b622e4cc4760f..4d0282b821b519b3bd750cd5266ea9a02b78cd26 100644 (file)
@@ -107,16 +107,17 @@ int superhyway_add_devices(struct superhyway_bus *bus,
 static int __init superhyway_init(void)
 {
        struct superhyway_bus *bus;
-       int ret = 0;
+       int ret;
 
-       device_register(&superhyway_bus_device);
+       ret = device_register(&superhyway_bus_device);
+       if (unlikely(ret))
+               return ret;
 
        for (bus = superhyway_channels; bus->ops; bus++)
                ret |= superhyway_scan_bus(bus);
 
        return ret;
 }
-
 postcore_initcall(superhyway_init);
 
 static const struct superhyway_device_id *
index a77ede598d341bcc49581e124868eef1aef4810e..abf05048c638ee224db9b5fcf7f708a6aeccf5f5 100644 (file)
@@ -61,7 +61,7 @@ config SPI_ATMEL
 
 config SPI_BFIN
        tristate "SPI controller driver for ADI Blackfin5xx"
-       depends on SPI_MASTER && BFIN
+       depends on SPI_MASTER && BLACKFIN
        help
          This is the SPI controller master driver for Blackfin 5xx processor.
 
index 89769ce16f882058934698ce566b804aa3a13e2d..b31f4431849b25e771d301f956b3afd31b00d2bf 100644 (file)
@@ -457,10 +457,11 @@ done:
 EXPORT_SYMBOL_GPL(spi_register_master);
 
 
-static int __unregister(struct device *dev, void *unused)
+static int __unregister(struct device *dev, void *master_dev)
 {
        /* note: before about 2.6.14-rc1 this would corrupt memory: */
-       spi_unregister_device(to_spi_device(dev));
+       if (dev != master_dev)
+               spi_unregister_device(to_spi_device(dev));
        return 0;
 }
 
@@ -478,7 +479,8 @@ void spi_unregister_master(struct spi_master *master)
 {
        int dummy;
 
-       dummy = device_for_each_child(master->dev.parent, NULL, __unregister);
+       dummy = device_for_each_child(master->dev.parent, &master->dev,
+                                       __unregister);
        device_unregister(&master->dev);
 }
 EXPORT_SYMBOL_GPL(spi_unregister_master);
index cc5094f37dd3d71a791df96efa58c374d8d68137..363ac8e6882106074478ae74b48cb8383440b770 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/spi/spi.h>
 #include <linux/err.h>
 #include <linux/clk.h>
+#include <linux/io.h>
 #include <asm/gpio.h>
 
 
@@ -74,7 +75,6 @@ struct txx9spi {
        struct list_head queue;
        wait_queue_head_t waitq;
        void __iomem *membase;
-       int irq;
        int baseclk;
        struct clk *clk;
        u32 max_speed_hz, min_speed_hz;
@@ -350,12 +350,12 @@ static int __init txx9spi_probe(struct platform_device *dev)
        struct resource *res;
        int ret = -ENODEV;
        u32 mcr;
+       int irq;
 
        master = spi_alloc_master(&dev->dev, sizeof(*c));
        if (!master)
                return ret;
        c = spi_master_get_devdata(master);
-       c->irq = -1;
        platform_set_drvdata(dev, master);
 
        INIT_WORK(&c->work, txx9spi_work);
@@ -381,32 +381,36 @@ static int __init txx9spi_probe(struct platform_device *dev)
 
        res = platform_get_resource(dev, IORESOURCE_MEM, 0);
        if (!res)
-               goto exit;
-       c->membase = ioremap(res->start, res->end - res->start + 1);
+               goto exit_busy;
+       if (!devm_request_mem_region(&dev->dev,
+                                    res->start, res->end - res->start + 1,
+                                    "spi_txx9"))
+               goto exit_busy;
+       c->membase = devm_ioremap(&dev->dev,
+                                 res->start, res->end - res->start + 1);
        if (!c->membase)
-               goto exit;
+               goto exit_busy;
 
        /* enter config mode */
        mcr = txx9spi_rd(c, TXx9_SPMCR);
        mcr &= ~(TXx9_SPMCR_OPMODE | TXx9_SPMCR_SPSTP | TXx9_SPMCR_BCLR);
        txx9spi_wr(c, mcr | TXx9_SPMCR_CONFIG | TXx9_SPMCR_BCLR, TXx9_SPMCR);
 
-       c->irq = platform_get_irq(dev, 0);
-       if (c->irq < 0)
-               goto exit;
-       ret = request_irq(c->irq, txx9spi_interrupt, 0, dev->name, c);
-       if (ret) {
-               c->irq = -1;
+       irq = platform_get_irq(dev, 0);
+       if (irq < 0)
+               goto exit_busy;
+       ret = devm_request_irq(&dev->dev, irq, txx9spi_interrupt, 0,
+                              "spi_txx9", c);
+       if (ret)
                goto exit;
-       }
 
        c->workqueue = create_singlethread_workqueue(master->dev.parent->bus_id);
        if (!c->workqueue)
-               goto exit;
+               goto exit_busy;
        c->last_chipselect = -1;
 
        dev_info(&dev->dev, "at %#llx, irq %d, %dMHz\n",
-                (unsigned long long)res->start, c->irq,
+                (unsigned long long)res->start, irq,
                 (c->baseclk + 500000) / 1000000);
 
        master->bus_num = dev->id;
@@ -418,13 +422,11 @@ static int __init txx9spi_probe(struct platform_device *dev)
        if (ret)
                goto exit;
        return 0;
+exit_busy:
+       ret = -EBUSY;
 exit:
        if (c->workqueue)
                destroy_workqueue(c->workqueue);
-       if (c->irq >= 0)
-               free_irq(c->irq, c);
-       if (c->membase)
-               iounmap(c->membase);
        if (c->clk) {
                clk_disable(c->clk);
                clk_put(c->clk);
@@ -442,8 +444,6 @@ static int __exit txx9spi_remove(struct platform_device *dev)
        spi_unregister_master(master);
        platform_set_drvdata(dev, NULL);
        destroy_workqueue(c->workqueue);
-       free_irq(c->irq, c);
-       iounmap(c->membase);
        clk_disable(c->clk);
        clk_put(c->clk);
        spi_master_put(master);
index c55459c592b855f04bd2aeb180d06df04ae0a4d8..b3518ca9f04e01b0d3115908988f9e4ccd8d2aed 100644 (file)
@@ -184,14 +184,14 @@ static int spidev_message(struct spidev_data *spidev,
                if (u_tmp->rx_buf) {
                        k_tmp->rx_buf = buf;
                        if (!access_ok(VERIFY_WRITE, (u8 __user *)
-                                               (ptrdiff_t) u_tmp->rx_buf,
+                                               (uintptr_t) u_tmp->rx_buf,
                                                u_tmp->len))
                                goto done;
                }
                if (u_tmp->tx_buf) {
                        k_tmp->tx_buf = buf;
                        if (copy_from_user(buf, (const u8 __user *)
-                                               (ptrdiff_t) u_tmp->tx_buf,
+                                               (uintptr_t) u_tmp->tx_buf,
                                        u_tmp->len))
                                goto done;
                }
@@ -224,7 +224,7 @@ static int spidev_message(struct spidev_data *spidev,
        for (n = n_xfers, u_tmp = u_xfers; n; n--, u_tmp++) {
                if (u_tmp->rx_buf) {
                        if (__copy_to_user((u8 __user *)
-                                       (ptrdiff_t) u_tmp->rx_buf, buf,
+                                       (uintptr_t) u_tmp->rx_buf, buf,
                                        u_tmp->len)) {
                                status = -EFAULT;
                                goto done;
index 6da58ca48b333b60cd4d6c1cf8a7a493b7908e9c..455991fbe28f0cb300ff354d0b5106d12cd7125a 100644 (file)
@@ -107,8 +107,11 @@ static ssize_t tle62x0_status_show(struct device *dev,
 
        mutex_lock(&st->lock);
        ret = tle62x0_read(st);
-
        dev_dbg(dev, "tle62x0_read() returned %d\n", ret);
+       if (ret < 0) {
+               mutex_unlock(&st->lock);
+               return ret;
+       }
 
        for (ptr = 0; ptr < (st->nr_gpio * 2)/8; ptr += 1) {
                fault <<= 8;
index c12a741b5574d21681d5ff5f2c89014675dff010..85a20546e82777c169cecafa1d65f7a52dd921f5 100644 (file)
@@ -440,6 +440,7 @@ static int ssb_devices_register(struct ssb_bus *bus)
                        break;
                case SSB_BUSTYPE_PCMCIA:
 #ifdef CONFIG_SSB_PCMCIAHOST
+                       sdev->irq = bus->host_pcmcia->irq.AssignedIRQ;
                        dev->parent = &bus->host_pcmcia->dev;
 #endif
                        break;
@@ -1147,7 +1148,10 @@ static int __init ssb_modinit(void)
 
        return err;
 }
-subsys_initcall(ssb_modinit);
+/* ssb must be initialized after PCI but before the ssb drivers.
+ * That means we must use some initcall between subsys_initcall
+ * and device_initcall. */
+fs_initcall(ssb_modinit);
 
 static void __exit ssb_modexit(void)
 {
index b6abee846f023a81af3a4ecf3fb015ac642a5e53..bb44a76b3eb5508d605869936e34857afbfc2e18 100644 (file)
@@ -63,17 +63,17 @@ int ssb_pcmcia_switch_coreidx(struct ssb_bus *bus,
                err = pcmcia_access_configuration_register(pdev, &reg);
                if (err != CS_SUCCESS)
                        goto error;
-               read_addr |= (reg.Value & 0xF) << 12;
+               read_addr |= ((u32)(reg.Value & 0x0F)) << 12;
                reg.Offset = 0x30;
                err = pcmcia_access_configuration_register(pdev, &reg);
                if (err != CS_SUCCESS)
                        goto error;
-               read_addr |= reg.Value << 16;
+               read_addr |= ((u32)reg.Value) << 16;
                reg.Offset = 0x32;
                err = pcmcia_access_configuration_register(pdev, &reg);
                if (err != CS_SUCCESS)
                        goto error;
-               read_addr |= reg.Value << 24;
+               read_addr |= ((u32)reg.Value) << 24;
 
                cur_core = (read_addr - SSB_ENUM_BASE) / SSB_CORE_SIZE;
                if (cur_core == coreidx)
@@ -152,28 +152,29 @@ error:
        goto out_unlock;
 }
 
-/* These are the main device register access functions.
- * do_select_core is inline to have the likely hotpath inline.
- * All unlikely codepaths are out-of-line. */
-static inline int do_select_core(struct ssb_bus *bus,
-                                struct ssb_device *dev,
-                                u16 *offset)
+static int select_core_and_segment(struct ssb_device *dev,
+                                  u16 *offset)
 {
+       struct ssb_bus *bus = dev->bus;
        int err;
-       u8 need_seg = (*offset >= 0x800) ? 1 : 0;
+       u8 need_segment;
+
+       if (*offset >= 0x800) {
+               *offset -= 0x800;
+               need_segment = 1;
+       } else
+               need_segment = 0;
 
        if (unlikely(dev != bus->mapped_device)) {
                err = ssb_pcmcia_switch_core(bus, dev);
                if (unlikely(err))
                        return err;
        }
-       if (unlikely(need_seg != bus->mapped_pcmcia_seg)) {
-               err = ssb_pcmcia_switch_segment(bus, need_seg);
+       if (unlikely(need_segment != bus->mapped_pcmcia_seg)) {
+               err = ssb_pcmcia_switch_segment(bus, need_segment);
                if (unlikely(err))
                        return err;
        }
-       if (need_seg == 1)
-               *offset -= 0x800;
 
        return 0;
 }
@@ -181,32 +182,31 @@ static inline int do_select_core(struct ssb_bus *bus,
 static u16 ssb_pcmcia_read16(struct ssb_device *dev, u16 offset)
 {
        struct ssb_bus *bus = dev->bus;
-       u16 x;
 
-       if (unlikely(do_select_core(bus, dev, &offset)))
+       if (unlikely(select_core_and_segment(dev, &offset)))
                return 0xFFFF;
-       x = readw(bus->mmio + offset);
 
-       return x;
+       return readw(bus->mmio + offset);
 }
 
 static u32 ssb_pcmcia_read32(struct ssb_device *dev, u16 offset)
 {
        struct ssb_bus *bus = dev->bus;
-       u32 x;
+       u32 lo, hi;
 
-       if (unlikely(do_select_core(bus, dev, &offset)))
+       if (unlikely(select_core_and_segment(dev, &offset)))
                return 0xFFFFFFFF;
-       x = readl(bus->mmio + offset);
+       lo = readw(bus->mmio + offset);
+       hi = readw(bus->mmio + offset + 2);
 
-       return x;
+       return (lo | (hi << 16));
 }
 
 static void ssb_pcmcia_write16(struct ssb_device *dev, u16 offset, u16 value)
 {
        struct ssb_bus *bus = dev->bus;
 
-       if (unlikely(do_select_core(bus, dev, &offset)))
+       if (unlikely(select_core_and_segment(dev, &offset)))
                return;
        writew(value, bus->mmio + offset);
 }
@@ -215,12 +215,12 @@ static void ssb_pcmcia_write32(struct ssb_device *dev, u16 offset, u32 value)
 {
        struct ssb_bus *bus = dev->bus;
 
-       if (unlikely(do_select_core(bus, dev, &offset)))
+       if (unlikely(select_core_and_segment(dev, &offset)))
                return;
-       readw(bus->mmio + offset);
-       writew(value >> 16, bus->mmio + offset + 2);
-       readw(bus->mmio + offset);
-       writew(value, bus->mmio + offset);
+       writeb((value & 0xFF000000) >> 24, bus->mmio + offset + 3);
+       writeb((value & 0x00FF0000) >> 16, bus->mmio + offset + 2);
+       writeb((value & 0x0000FF00) >> 8, bus->mmio + offset + 1);
+       writeb((value & 0x000000FF) >> 0, bus->mmio + offset + 0);
 }
 
 /* Not "static", as it's used in main.c */
index 4d8c2a5b3297fdb2447f764ac8f5974277d936fd..bcea8d9b718ce782da7f1e3fdb20d4d278d9d00e 100644 (file)
@@ -120,9 +120,8 @@ int phone_register_device(struct phone_device *p, int unit)
 void phone_unregister_device(struct phone_device *pfd)
 {
        mutex_lock(&phone_lock);
-       if (phone_device[pfd->minor] != pfd)
-               panic("phone: bad unregister");
-       phone_device[pfd->minor] = NULL;
+       if (likely(phone_device[pfd->minor] == pfd))
+               phone_device[pfd->minor] = NULL;
        mutex_unlock(&phone_lock);
 }
 
index ead2475406b85ce89f57df29c56bc4d5e98f0784..28d4972f7ad5493f449dd1ae0fe07cab446bb264 100644 (file)
@@ -11,7 +11,6 @@
 #include <linux/device.h>
 #include <linux/mm.h>
 #include <asm/io.h>
-#include <asm/scatterlist.h>
 #include <linux/dma-mapping.h>
 #include <linux/dmapool.h>
 #include <linux/usb.h>
index 3dd997df8505bf3b2f64c7210f71b466b7101746..fea8256a18d6e1a99c01872a25e99ac3354f3f7c 100644 (file)
@@ -30,7 +30,6 @@
 #include <linux/utsname.h>
 #include <linux/mm.h>
 #include <asm/io.h>
-#include <asm/scatterlist.h>
 #include <linux/device.h>
 #include <linux/dma-mapping.h>
 #include <linux/mutex.h>
index eb4ac47612a59022878b19e4da34053fdd4cbb6f..316a746e0080ef8a0eface2341fbd8f3e612c60d 100644 (file)
@@ -434,7 +434,7 @@ int usb_sg_init (
                if (dma) {
                        io->urbs [i]->transfer_dma = sg_dma_address (sg + i);
                        len = sg_dma_len (sg + i);
-#if defined(CONFIG_HIGHMEM) || defined(CONFIG_IOMMU)
+#if defined(CONFIG_HIGHMEM) || defined(CONFIG_GART_IOMMU)
                        io->urbs[i]->transfer_buffer = NULL;
 #else
                        io->urbs[i]->transfer_buffer = sg_virt(&sg[i]);
index 69aa68287d3f8b5cf7884955b703760fd1897c46..c4a6f1095b8b636f89e80267713b0c35fb3018a7 100644 (file)
@@ -36,7 +36,7 @@
 #include <linux/workqueue.h>
 
 #include <asm/io.h>
-#include <asm/scatterlist.h>
+#include <linux/scatterlist.h>
 #include <linux/mm.h>
 #include <linux/dma-mapping.h>
 
index 6bfdba6a213fc48699612933dea3c70d49ffe2bf..1f7ab15df36dead8dc571ecfc7495560fcdf2259 100644 (file)
@@ -1215,20 +1215,18 @@ static int keyspan_chars_in_buffer (struct usb_serial_port *port)
 
 static int keyspan_open (struct usb_serial_port *port, struct file *filp)
 {
-       struct keyspan_port_private     *p_priv;
-       struct keyspan_serial_private   *s_priv;
-       struct usb_serial               *serial = port->serial;
+       struct keyspan_port_private     *p_priv;
+       struct keyspan_serial_private   *s_priv;
+       struct usb_serial               *serial = port->serial;
        const struct keyspan_device_details     *d_details;
        int                             i, err;
-       int                             baud_rate, device_port;
        struct urb                      *urb;
-       unsigned int                    cflag;
 
        s_priv = usb_get_serial_data(serial);
        p_priv = usb_get_serial_port_data(port);
        d_details = p_priv->device_details;
-       
-       dbg("%s - port%d.", __FUNCTION__, port->number); 
+
+       dbg("%s - port%d.", __FUNCTION__, port->number);
 
        /* Set some sane defaults */
        p_priv->rts_state = 1;
@@ -1249,7 +1247,7 @@ static int keyspan_open (struct usb_serial_port *port, struct file *filp)
                urb->dev = serial->dev;
 
                /* make sure endpoint data toggle is synchronized with the device */
-               
+
                usb_clear_halt(urb->dev, urb->pipe);
 
                if ((err = usb_submit_urb(urb, GFP_KERNEL)) != 0) {
@@ -1265,30 +1263,6 @@ static int keyspan_open (struct usb_serial_port *port, struct file *filp)
                /* usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe), usb_pipeout(urb->pipe), 0); */
        }
 
-       /* get the terminal config for the setup message now so we don't 
-        * need to send 2 of them */
-
-       cflag = port->tty->termios->c_cflag;
-       device_port = port->number - port->serial->minor;
-
-       /* Baud rate calculation takes baud rate as an integer
-          so other rates can be generated if desired. */
-       baud_rate = tty_get_baud_rate(port->tty);
-       /* If no match or invalid, leave as default */          
-       if (baud_rate >= 0
-           && d_details->calculate_baud_rate(baud_rate, d_details->baudclk,
-                               NULL, NULL, NULL, device_port) == KEYSPAN_BAUD_RATE_OK) {
-               p_priv->baud = baud_rate;
-       }
-
-       /* set CTS/RTS handshake etc. */
-       p_priv->cflag = cflag;
-       p_priv->flow_control = (cflag & CRTSCTS)? flow_cts: flow_none;
-
-       keyspan_send_setup(port, 1);
-       //mdelay(100);
-       //keyspan_set_termios(port, NULL);
-
        return (0);
 }
 
index fb9d8d0b2c0452250b85c63b9aa23b0024f8e60f..7d86e9eae915a55a05757e8f2cc1cf2839140684 100644 (file)
@@ -503,7 +503,7 @@ config FB_VALKYRIE
 
 config FB_CT65550
        bool "Chips 65550 display support"
-       depends on (FB = y) && PPC32
+       depends on (FB = y) && PPC32 && PCI
        select FB_CFB_FILLRECT
        select FB_CFB_COPYAREA
        select FB_CFB_IMAGEBLIT
@@ -1509,7 +1509,7 @@ config FB_VOODOO1
 
          WARNING: Do not use any application that uses the 3D engine
          (namely glide) while using this driver.
-         Please read the <file:Documentation/fb/README-sstfb.txt> for supported
+         Please read the <file:Documentation/fb/sstfb.txt> for supported
          options and other important info  support.
 
 config FB_VT8623
@@ -1807,7 +1807,7 @@ config FB_SM501
          This driver is also available as a module ( = code which can be
          inserted and removed from the running kernel whenever you want). The
          module will be called sm501fb. If you want to compile it as a module,
-         say M here and read <file:Documentation/modules.txt>.
+         say M here and read <file:Documentation/kbuild/modules.txt>.
 
          If unsure, say N.
 
@@ -1892,9 +1892,7 @@ config FB_VIRTUAL
 
          If unsure, say N.
 
-if ARCH_OMAP
-       source "drivers/video/omap/Kconfig"
-endif
+source "drivers/video/omap/Kconfig"
 
 source "drivers/video/backlight/Kconfig"
 source "drivers/video/display/Kconfig"
index 1e32b3d13f2e7123bc86d9be742d747111f763d2..62867cb63fefb2894dfc98096affff66c4fd5d22 100644 (file)
@@ -202,6 +202,7 @@ static struct pci_device_id radeonfb_pci_table[] = {
        CHIP_DEF(PCI_CHIP_RV380_3154,   RV380,  CHIP_HAS_CRTC2 | CHIP_IS_MOBILITY),
        CHIP_DEF(PCI_CHIP_RV370_5B60,   RV380,  CHIP_HAS_CRTC2),
        CHIP_DEF(PCI_CHIP_RV370_5B62,   RV380,  CHIP_HAS_CRTC2),
+       CHIP_DEF(PCI_CHIP_RV370_5B63,   RV380,  CHIP_HAS_CRTC2),
        CHIP_DEF(PCI_CHIP_RV370_5B64,   RV380,  CHIP_HAS_CRTC2),
        CHIP_DEF(PCI_CHIP_RV370_5B65,   RV380,  CHIP_HAS_CRTC2),
        CHIP_DEF(PCI_CHIP_RV370_5460,   RV380,  CHIP_HAS_CRTC2 | CHIP_IS_MOBILITY),
index be1d57bf9dc8f82c7c9f6b4ea62b35bdf6d43be7..83ee3e75386cf7a4d1676a60d30b3f621d580989 100644 (file)
@@ -27,8 +27,6 @@
 
 #include "ati_ids.h"
 
-static void radeon_reinitialize_M10(struct radeonfb_info *rinfo);
-
 /*
  * Workarounds for bugs in PC laptops:
  * - enable D2 sleep in some IBM Thinkpads
@@ -39,6 +37,8 @@ static void radeon_reinitialize_M10(struct radeonfb_info *rinfo);
  */
 
 #if defined(CONFIG_PM) && defined(CONFIG_X86)
+static void radeon_reinitialize_M10(struct radeonfb_info *rinfo);
+
 struct radeon_device_id {
         const char *ident;                     /* (arbitrary) Name */
         const unsigned short subsystem_vendor; /* Subsystem Vendor ID */
index f99cb77e7b42edc7804181aff250d1184c1c561b..f7e2d5add83172239d2a805c500d2e6fcb353ec0 100644 (file)
@@ -2509,8 +2509,7 @@ static int cirrusfb_zorro_register(struct zorro_dev *z,
        cinfo = info->par;
        cinfo->btype = btype;
 
-       assert(z > 0);
-       assert(z2 >= 0);
+       assert(z);
        assert(btype != BT_NONE);
 
        cinfo->zdev = z;
index 267422f66255e466a3fc56a82d7993b29fe52314..b87ed37ac0c1217c93a14638d0fd73b0d56a04bf 100644 (file)
@@ -6,7 +6,7 @@ menu "Console display driver support"
 
 config VGA_CONSOLE
        bool "VGA text console" if EMBEDDED || !X86
-       depends on !ARCH_ACORN && !ARCH_EBSA110 && !4xx && !8xx && !SPARC && !M68K && !PARISC && !FRV && !ARCH_VERSATILE && !SUPERH && !BFIN
+       depends on !ARCH_ACORN && !ARCH_EBSA110 && !4xx && !8xx && !SPARC && !M68K && !PARISC && !FRV && !ARCH_VERSATILE && !SUPERH && !BLACKFIN
        default y
        help
          Saying Y here will allow you to use Linux in text mode through a
index 5fb8675e0d6b9278a3c31b9ec732cd3c918578db..d0e4cb618269b7c44c5c920def6e3bbc49e807f6 100644 (file)
@@ -874,6 +874,8 @@ static int cyber2000fb_set_par(struct fb_info *info)
                default:
                        BUG();
                }
+               break;
+
        case 24:/* TRUECOLOUR, 16m */
                hw.co_pixfmt            = CO_PIXFMT_24BPP;
                hw.width                *= 3;
index b9b572b293d4ffd494782298fd4de7444edc1027..2e552d5bbb5d8bf4888fba36d4bc6bdace9f59f9 100644 (file)
@@ -183,8 +183,8 @@ static struct fb_videomode default_mode_LCD __initdata = {
        .vmode          = FB_VMODE_NONINTERLACED,
 };
 
-struct fb_videomode *default_mode = &default_mode_CRT;
-struct fb_var_screeninfo *default_var = &default_var_CRT;
+struct fb_videomode *default_mode __initdata = &default_mode_CRT;
+struct fb_var_screeninfo *default_var __initdata = &default_var_CRT;
 
 static int flat_panel_enabled = 0;
 
index 6c227f9592a5c4c6aeddfcb7af10dec334307bd6..ca13c48d19b068a58d2b5b9f24519df840725093 100644 (file)
@@ -33,7 +33,7 @@ void lx_set_palette_reg(struct fb_info *, unsigned int, unsigned int,
 
 #define MSR_LX_GLD_CONFIG    0x48002001
 #define MSR_LX_GLCP_DOTPLL   0x4c000015
-#define MSR_LX_DF_PADSEL     0x48000011
+#define MSR_LX_DF_PADSEL     0x48002011
 #define MSR_LX_DC_SPARE      0x80000011
 #define MSR_LX_DF_GLCONFIG   0x48002001
 
index f4fcf11b290d0ddaf3a4f8653a8c95482fb269a8..44408850e2ebc2d0047e1bae7d7a82a5d735e135 100644 (file)
@@ -1,6 +1,6 @@
 config FB_OMAP
        tristate "OMAP frame buffer support (EXPERIMENTAL)"
-       depends on FB
+       depends on FB && ARCH_OMAP
        select FB_CFB_FILLRECT
        select FB_CFB_COPYAREA
        select FB_CFB_IMAGEBLIT
index b3463ddcfd608df0a7b2ada2990f1ee1d974f4b0..75836aa8319196345d5a24123af97e509a643543 100644 (file)
@@ -727,7 +727,7 @@ static int ps3fb_blank(int blank, struct fb_info *info)
 
 static int ps3fb_get_vblank(struct fb_vblank *vblank)
 {
-       memset(vblank, 0, sizeof(&vblank));
+       memset(vblank, 0, sizeof(*vblank));
        vblank->flags = FB_VBLANK_HAVE_VSYNC;
        return 0;
 }
index a5333c1907898ef71a301eecd75d8e3e56cbb5fd..b829dc7c5edfeb4d9621599aa05d1c0dd296dfa7 100644 (file)
@@ -540,7 +540,7 @@ s1d13xxxfb_probe(struct platform_device *pdev)
        int ret = 0;
        u8 revision;
 
-       dbg("probe called: device is %p\n", dev);
+       dbg("probe called: device is %p\n", pdev);
 
        printk(KERN_INFO "Epson S1D13XXX FB Driver\n");
 
@@ -753,8 +753,11 @@ static struct platform_driver s1d13xxxfb_driver = {
 static int __init
 s1d13xxxfb_init(void)
 {
+
+#ifndef MODULE
        if (fb_get_options("s1d13xxxfb", NULL))
                return -ENODEV;
+#endif
 
        return platform_driver_register(&s1d13xxxfb_driver);
 }
index bc7d23683735732134970abe4d1aaf58141102ad..37bd24b8d83b2568d516a16cd58e196e4e2e59f7 100644 (file)
@@ -1248,7 +1248,6 @@ sisfb_do_set_var(struct fb_var_screeninfo *var, int isactive, struct fb_info *in
        if(found_mode) {
                ivideo->sisfb_mode_idx = sisfb_validate_mode(ivideo,
                                ivideo->sisfb_mode_idx, ivideo->currentvbflags);
-               ivideo->mode_no = sisbios_mode[ivideo->sisfb_mode_idx].mode_no[ivideo->mni];
        } else {
                ivideo->sisfb_mode_idx = -1;
        }
@@ -1260,6 +1259,8 @@ sisfb_do_set_var(struct fb_var_screeninfo *var, int isactive, struct fb_info *in
                return -EINVAL;
        }
 
+       ivideo->mode_no = sisbios_mode[ivideo->sisfb_mode_idx].mode_no[ivideo->mni];
+
        if(sisfb_search_refresh_rate(ivideo, ivideo->refresh_rate, ivideo->sisfb_mode_idx) == 0) {
                ivideo->rate_idx = sisbios_mode[ivideo->sisfb_mode_idx].rate_idx;
                ivideo->refresh_rate = 60;
index b983d262ab7827f7520a3164092bfddf8195e6cc..d1d6c0facd549737ef290d6325a4f4c29b7901d4 100644 (file)
@@ -926,8 +926,10 @@ static int uvesafb_setpalette(struct uvesafb_pal_entry *entries, int count,
                int start, struct fb_info *info)
 {
        struct uvesafb_ktask *task;
+#ifdef CONFIG_X86
        struct uvesafb_par *par = info->par;
        int i = par->mode_idx;
+#endif
        int err = 0;
 
        /*
@@ -1103,11 +1105,11 @@ static int uvesafb_pan_display(struct fb_var_screeninfo *var,
 
 static int uvesafb_blank(int blank, struct fb_info *info)
 {
-       struct uvesafb_par *par = info->par;
        struct uvesafb_ktask *task;
        int err = 1;
-
 #ifdef CONFIG_X86
+       struct uvesafb_par *par = info->par;
+
        if (par->vbe_ib.capabilities & VBE_CAP_VGACOMPAT) {
                int loop = 10000;
                u8 seq = 0, crtc17 = 0;
index 15d7787dea876c6548e0319789b0a8325b6a8475..69d7ea02cd489bac96c3e3051678b669547e0211 100644 (file)
@@ -96,10 +96,23 @@ static int virtio_dev_probe(struct device *_d)
        return err;
 }
 
+static int virtio_dev_remove(struct device *_d)
+{
+       struct virtio_device *dev = container_of(_d,struct virtio_device,dev);
+       struct virtio_driver *drv = container_of(dev->dev.driver,
+                                                struct virtio_driver, driver);
+
+       dev->config->set_status(dev, dev->config->get_status(dev)
+                               & ~VIRTIO_CONFIG_S_DRIVER);
+       drv->remove(dev);
+       return 0;
+}
+
 int register_virtio_driver(struct virtio_driver *driver)
 {
        driver->driver.bus = &virtio_bus;
        driver->driver.probe = virtio_dev_probe;
+       driver->driver.remove = virtio_dev_remove;
        return driver_register(&driver->driver);
 }
 EXPORT_SYMBOL_GPL(register_virtio_driver);
index 0e4baca21b8f46e02f716a07aab4605e6663f20d..1dc04b6684e6a3ce03451923d09164480932eebd 100644 (file)
@@ -53,7 +53,7 @@ struct vring_virtqueue
        unsigned int num_added;
 
        /* Last used index we've seen. */
-       unsigned int last_used_idx;
+       u16 last_used_idx;
 
        /* How to notify other side. FIXME: commonalize hcalls! */
        void (*notify)(struct virtqueue *vq);
@@ -277,11 +277,17 @@ struct virtqueue *vring_new_virtqueue(unsigned int num,
        struct vring_virtqueue *vq;
        unsigned int i;
 
+       /* We assume num is a power of 2. */
+       if (num & (num - 1)) {
+               dev_warn(&vdev->dev, "Bad virtqueue length %u\n", num);
+               return NULL;
+       }
+
        vq = kmalloc(sizeof(*vq) + sizeof(void *)*num, GFP_KERNEL);
        if (!vq)
                return NULL;
 
-       vring_init(&vq->vring, num, pages);
+       vring_init(&vq->vring, num, pages, PAGE_SIZE);
        vq->vq.callback = callback;
        vq->vq.vdev = vdev;
        vq->vq.vq_ops = &vring_vq_ops;
index 6854fd6b9714a2a03752f70becce39d4780f6147..9adbb4f904799c0d0c73a2fe80e7bc2c6da3b643 100644 (file)
@@ -17,7 +17,8 @@ config W1_CON
        bool "Userspace communication over connector"
        default y
        --- help ---
-         This allows to communicate with userspace using connector [Documentation/connector].
+         This allows to communicate with userspace using connector. For more
+         information see <file:Documentation/connector/connector.txt>.
          There are three types of messages between w1 core and userspace:
          1. Events. They are generated each time new master or slave device found
                either due to automatic or requested search.
index 299e274d241ae298748151c9f63cf30fbdd91d9d..b63b5e044a4cc7aa641c26ea1de8906f7a4656c4 100644 (file)
@@ -233,7 +233,7 @@ static int ds_recv_status_nodump(struct ds_device *dev, struct ds_status *st,
 {
        int count, err;
 
-       memset(st, 0, sizeof(st));
+       memset(st, 0, sizeof(*st));
 
        count = 0;
        err = usb_bulk_msg(dev->udev, usb_rcvbulkpipe(dev->udev, dev->ep[EP_STATUS]), buf, size, &count, 100);
index 81db48f07ca14923a380c284066d076d7cf3bcc2..2792bc1a726991b7b3dbf0046ad1e2d2dd6b313b 100644 (file)
@@ -15,8 +15,8 @@ menuconfig WATCHDOG
          implementation entirely in software (which can sometimes fail to
          reboot the machine) and a driver for hardware watchdog boards, which
          are more robust and can also keep track of the temperature inside
-         your computer. For details, read <file:Documentation/watchdog/watchdog.txt>
-         in the kernel source.
+         your computer. For details, read
+         <file:Documentation/watchdog/watchdog-api.txt> in the kernel source.
 
          The watchdog is usually used together with the watchdog daemon
          which is available from
index c404fc69e7e6134fadb1241114ba1a65e72f8e98..b481cc0e32e40e225bc95931b981e7370a150e64 100644 (file)
@@ -31,7 +31,7 @@ static unsigned long ali_is_open;
 static char ali_expect_release;
 static struct pci_dev *ali_pci;
 static u32 ali_timeout_bits;   /* stores the computed timeout */
-static spinlock_t ali_lock;    /* Guards the hardware */
+static DEFINE_SPINLOCK(ali_lock);      /* Guards the hardware */
 
 /* module parameters */
 static int timeout = WATCHDOG_TIMEOUT;
@@ -398,8 +398,6 @@ static int __init watchdog_init(void)
 {
        int ret;
 
-       spin_lock_init(&ali_lock);
-
        /* Check whether or not the hardware watchdog is there */
        if (ali_find_watchdog() != 0) {
                return -ENODEV;
index 19db5302ba6efffa7fde8b3077361d514fc9ecdd..a61cbd48dc07d4a7ba23358cafd61b078cb62fc0 100644 (file)
@@ -61,7 +61,7 @@
 
 static int heartbeat = DEFAULT_HEARTBEAT;
 
-static spinlock_t io_lock;
+static DEFINE_SPINLOCK(io_lock);
 static unsigned long wdt_status;
 #define WDT_IN_USE        0
 #define WDT_OK_TO_CLOSE   1
@@ -200,8 +200,6 @@ static int davinci_wdt_probe(struct platform_device *pdev)
        int ret = 0, size;
        struct resource *res;
 
-       spin_lock_init(&io_lock);
-
        if (heartbeat < 1 || heartbeat > MAX_HEARTBEAT)
                heartbeat = DEFAULT_HEARTBEAT;
 
@@ -262,7 +260,7 @@ static int __init davinci_wdt_init(void)
 
 static void __exit davinci_wdt_exit(void)
 {
-       return platform_driver_unregister(&platform_wdt_driver);
+       platform_driver_unregister(&platform_wdt_driver);
 }
 
 module_init(davinci_wdt_init);
index f236954d2536c0222efa600c7524527625c7e2dd..ca44fd9b19bb80860dfef6008d4734c669a39f72 100644 (file)
@@ -77,7 +77,7 @@
 
 /* internal variables */
 static void __iomem *BASEADDR;
-static spinlock_t esb_lock; /* Guards the hardware */
+static DEFINE_SPINLOCK(esb_lock); /* Guards the hardware */
 static unsigned long timer_alive;
 static struct pci_dev *esb_pci;
 static unsigned short triggered; /* The status of the watchdog upon boot */
@@ -456,8 +456,6 @@ static int __init watchdog_init (void)
 {
         int ret;
 
-        spin_lock_init(&esb_lock);
-
         /* Check whether or not the hardware watchdog is there */
         if (!esb_getdevice () || esb_pci == NULL)
                 return -ENODEV;
index cd5a565bc3a0abd3beb585e1dce0b97b98a5a18e..a0e6809e369ff997f3cdb03b92c98394c3d81d8a 100644 (file)
  *     82801GDH (ICH7DH)    : document number 307013-002, 307014-009,
  *     82801GBM (ICH7-M)    : document number 307013-002, 307014-009,
  *     82801GHM (ICH7-M DH) : document number 307013-002, 307014-009,
- *     82801HB  (ICH8)      : document number 313056-002, 313057-004,
- *     82801HR  (ICH8R)     : document number 313056-002, 313057-004,
- *     82801HH  (ICH8DH)    : document number 313056-002, 313057-004,
- *     82801HO  (ICH8DO)    : document number 313056-002, 313057-004,
+ *     82801HB  (ICH8)      : document number 313056-003, 313057-009,
+ *     82801HR  (ICH8R)     : document number 313056-003, 313057-009,
+ *     82801HBM (ICH8M)     : document number 313056-003, 313057-009,
+ *     82801HH  (ICH8DH)    : document number 313056-003, 313057-009,
+ *     82801HO  (ICH8DO)    : document number 313056-003, 313057-009,
+ *     82801HEM (ICH8M-E)   : document number 313056-003, 313057-009,
  *     82801IB  (ICH9)      : document number 316972-001, 316973-001,
  *     82801IR  (ICH9R)     : document number 316972-001, 316973-001,
  *     82801IH  (ICH9DH)    : document number 316972-001, 316973-001,
@@ -95,8 +97,10 @@ enum iTCO_chipsets {
        TCO_ICH7M,      /* ICH7-M */
        TCO_ICH7MDH,    /* ICH7-M DH */
        TCO_ICH8,       /* ICH8 & ICH8R */
+       TCO_ICH8ME,     /* ICH8M-E */
        TCO_ICH8DH,     /* ICH8DH */
        TCO_ICH8DO,     /* ICH8DO */
+       TCO_ICH8M,      /* ICH8M */
        TCO_ICH9,       /* ICH9 */
        TCO_ICH9R,      /* ICH9R */
        TCO_ICH9DH,     /* ICH9DH */
@@ -125,8 +129,10 @@ static struct {
        {"ICH7-M", 2},
        {"ICH7-M DH", 2},
        {"ICH8 or ICH8R", 2},
+       {"ICH8M-E", 2},
        {"ICH8DH", 2},
        {"ICH8DO", 2},
+       {"ICH8M", 2},
        {"ICH9", 2},
        {"ICH9R", 2},
        {"ICH9DH", 2},
@@ -134,6 +140,15 @@ static struct {
        {NULL,0}
 };
 
+#define ITCO_PCI_DEVICE(dev, data)     \
+       .vendor = PCI_VENDOR_ID_INTEL,  \
+       .device = dev,                  \
+       .subvendor = PCI_ANY_ID,        \
+       .subdevice = PCI_ANY_ID,        \
+       .class = 0,                     \
+       .class_mask = 0,                \
+       .driver_data = data
+
 /*
  * This data only exists for exporting the supported PCI ids
  * via MODULE_DEVICE_TABLE.  We do not actually register a
@@ -141,45 +156,47 @@ static struct {
  * functions that probably will be registered by other drivers.
  */
 static struct pci_device_id iTCO_wdt_pci_tbl[] = {
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_0,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH     },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AB_0,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH0    },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH2    },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_10,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH2M   },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_0,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH3    },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_12,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH3M   },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH4    },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH4M   },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801E_0,    PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_CICH    },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH5    },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_1,       PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_6300ESB },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_0,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH6    },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH6M   },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_2,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH6W   },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_0,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH7    },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_1,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH7M   },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_31,     PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH7MDH },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_0,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH8    },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_2,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH8DH  },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_3,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH8DO  },
-       { PCI_VENDOR_ID_INTEL, 0x2918,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH9    },
-       { PCI_VENDOR_ID_INTEL, 0x2916,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH9R    },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_2,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH9DH    },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB2_0,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x2671,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x2672,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x2673,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x2674,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x2675,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x2676,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x2677,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x2678,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x2679,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x267a,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x267b,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x267c,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x267d,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x267e,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x267f,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801AA_0,        TCO_ICH    )},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801AB_0,        TCO_ICH0   )},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801BA_0,        TCO_ICH2   )},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801BA_10,       TCO_ICH2M  )},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801CA_0,        TCO_ICH3   )},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801CA_12,       TCO_ICH3M  )},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801DB_0,        TCO_ICH4   )},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801DB_12,       TCO_ICH4M  )},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801E_0,         TCO_CICH   )},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801EB_0,        TCO_ICH5   )},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ESB_1,            TCO_6300ESB)},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH6_0,           TCO_ICH6   )},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH6_1,           TCO_ICH6M  )},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH6_2,           TCO_ICH6W  )},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH7_0,           TCO_ICH7   )},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH7_1,           TCO_ICH7M  )},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH7_31,          TCO_ICH7MDH)},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH8_0,           TCO_ICH8   )},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH8_1,           TCO_ICH8ME )},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH8_2,           TCO_ICH8DH )},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH8_3,           TCO_ICH8DO )},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH8_4,           TCO_ICH8M  )},
+       { ITCO_PCI_DEVICE(0x2918,                               TCO_ICH9   )},
+       { ITCO_PCI_DEVICE(0x2916,                               TCO_ICH9R  )},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH9_2,           TCO_ICH9DH )},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ESB2_0,           TCO_631XESB)},
+       { ITCO_PCI_DEVICE(0x2671,                               TCO_631XESB)},
+       { ITCO_PCI_DEVICE(0x2672,                               TCO_631XESB)},
+       { ITCO_PCI_DEVICE(0x2673,                               TCO_631XESB)},
+       { ITCO_PCI_DEVICE(0x2674,                               TCO_631XESB)},
+       { ITCO_PCI_DEVICE(0x2675,                               TCO_631XESB)},
+       { ITCO_PCI_DEVICE(0x2676,                               TCO_631XESB)},
+       { ITCO_PCI_DEVICE(0x2677,                               TCO_631XESB)},
+       { ITCO_PCI_DEVICE(0x2678,                               TCO_631XESB)},
+       { ITCO_PCI_DEVICE(0x2679,                               TCO_631XESB)},
+       { ITCO_PCI_DEVICE(0x267a,                               TCO_631XESB)},
+       { ITCO_PCI_DEVICE(0x267b,                               TCO_631XESB)},
+       { ITCO_PCI_DEVICE(0x267c,                               TCO_631XESB)},
+       { ITCO_PCI_DEVICE(0x267d,                               TCO_631XESB)},
+       { ITCO_PCI_DEVICE(0x267e,                               TCO_631XESB)},
+       { ITCO_PCI_DEVICE(0x267f,                               TCO_631XESB)},
        { 0, },                 /* End of list */
 };
 MODULE_DEVICE_TABLE (pci, iTCO_wdt_pci_tbl);
@@ -300,6 +317,7 @@ static int iTCO_wdt_start(void)
 
        /* disable chipset's NO_REBOOT bit */
        if (iTCO_wdt_unset_NO_REBOOT_bit()) {
+               spin_unlock(&iTCO_wdt_private.io_lock);
                printk(KERN_ERR PFX "failed to reset NO_REBOOT flag, reboot disabled by hardware\n");
                return -EIO;
        }
@@ -590,7 +608,7 @@ static struct miscdevice iTCO_wdt_miscdev = {
  *     Init & exit routines
  */
 
-static int iTCO_wdt_init(struct pci_dev *pdev, const struct pci_device_id *ent, struct platform_device *dev)
+static int __devinit iTCO_wdt_init(struct pci_dev *pdev, const struct pci_device_id *ent, struct platform_device *dev)
 {
        int ret;
        u32 base_address;
@@ -694,7 +712,7 @@ out:
        return ret;
 }
 
-static void iTCO_wdt_cleanup(void)
+static void __devexit iTCO_wdt_cleanup(void)
 {
        /* Stop the timer before we leave */
        if (!nowayout)
@@ -709,7 +727,7 @@ static void iTCO_wdt_cleanup(void)
        iTCO_wdt_private.ACPIBASE = 0;
 }
 
-static int iTCO_wdt_probe(struct platform_device *dev)
+static int __devinit iTCO_wdt_probe(struct platform_device *dev)
 {
        int found = 0;
        struct pci_dev *pdev = NULL;
@@ -735,7 +753,7 @@ static int iTCO_wdt_probe(struct platform_device *dev)
        return 0;
 }
 
-static int iTCO_wdt_remove(struct platform_device *dev)
+static int __devexit iTCO_wdt_remove(struct platform_device *dev)
 {
        if (iTCO_wdt_private.ACPIBASE)
                iTCO_wdt_cleanup();
@@ -753,7 +771,7 @@ static void iTCO_wdt_shutdown(struct platform_device *dev)
 
 static struct platform_driver iTCO_wdt_driver = {
        .probe          = iTCO_wdt_probe,
-       .remove         = iTCO_wdt_remove,
+       .remove         = __devexit_p(iTCO_wdt_remove),
        .shutdown       = iTCO_wdt_shutdown,
        .suspend        = iTCO_wdt_suspend,
        .resume         = iTCO_wdt_resume,
index c3a60f52ccb97d26931e66ea29384ef43a80c464..4b89f401691a6358e599c38954e9389a5c5a93c8 100644 (file)
@@ -48,7 +48,7 @@
 
 static struct platform_device *ibwdt_platform_device;
 static unsigned long ibwdt_is_open;
-static spinlock_t ibwdt_lock;
+static DEFINE_SPINLOCK(ibwdt_lock);
 static char expect_close;
 
 /* Module information */
@@ -308,8 +308,6 @@ static int __devinit ibwdt_probe(struct platform_device *dev)
 {
        int res;
 
-       spin_lock_init(&ibwdt_lock);
-
 #if WDT_START != WDT_STOP
        if (!request_region(WDT_STOP, 1, "IB700 WDT")) {
                printk (KERN_ERR PFX "STOP method I/O %X is not available.\n", WDT_STOP);
index 6d35bb112a5fc6a2507680f10153dd992fe6688e..e6e07b4575ebee7e031e64e4bc82def7a95157f6 100644 (file)
@@ -123,8 +123,8 @@ static void zf_ping(unsigned long data);
 static int zf_action = GEN_RESET;
 static unsigned long zf_is_open;
 static char zf_expect_close;
-static spinlock_t zf_lock;
-static spinlock_t zf_port_lock;
+static DEFINE_SPINLOCK(zf_lock);
+static DEFINE_SPINLOCK(zf_port_lock);
 static DEFINE_TIMER(zf_timer, zf_ping, 0, 0);
 static unsigned long next_heartbeat = 0;
 
@@ -438,9 +438,6 @@ static int __init zf_init(void)
 
        zf_show_action(action);
 
-       spin_lock_init(&zf_lock);
-       spin_lock_init(&zf_port_lock);
-
        if(!request_region(ZF_IOBASE, 3, "MachZ ZFL WDT")){
                printk(KERN_ERR "cannot reserve I/O ports at %d\n",
                                                        ZF_IOBASE);
index a0bf95fb976374099a7b1e27c0d3979f73841f74..6369f569517f1fd72fb7efdb0bd067224de60b2a 100644 (file)
@@ -56,7 +56,7 @@ static int prescale = 1;
 static unsigned int timeout_sec;
 
 static unsigned long wdt_is_open;
-static spinlock_t wdt_spinlock;
+static DEFINE_SPINLOCK(wdt_spinlock);
 
 static void mpc83xx_wdt_keepalive(void)
 {
@@ -185,9 +185,6 @@ static int __devinit mpc83xx_wdt_probe(struct platform_device *dev)
        printk(KERN_INFO "WDT driver for MPC83xx initialized. "
                "mode:%s timeout=%d (%d seconds)\n",
                reset ? "reset":"interrupt", timeout, timeout_sec);
-
-       spin_lock_init(&wdt_spinlock);
-
        return 0;
 
 err_unmap:
index 3d3deae0d64ba0668f28fb275a082531a7e62e1c..15e4f8887a9ee36b8c75afd37e0bb680f07f897e 100644 (file)
@@ -61,7 +61,7 @@ static unsigned long timer_enabled = 0;  /* is the timer enabled? */
 
 static char expect_close;                /* is the close expected? */
 
-static spinlock_t io_lock;               /* to guard the watchdog from io races */
+static DEFINE_SPINLOCK(io_lock);/* to guard the watchdog from io races */
 
 static int nowayout = WATCHDOG_NOWAYOUT;
 
@@ -561,8 +561,6 @@ static int __init pc87413_init(void)
 {
        int ret;
 
-       spin_lock_init(&io_lock);
-
        printk(KERN_INFO PFX "Version " VERSION " at io 0x%X\n", WDT_INDEX_IO_PORT);
 
        /* request_region(io, 2, "pc87413"); */
index 22f8873dd092e72f5e25140eea95146ed817f4f1..b04aa096a10a491a739d12eab9bda3e7a763c31a 100644 (file)
@@ -80,7 +80,7 @@
 static int nowayout = WATCHDOG_NOWAYOUT;
 static int heartbeat = DEFAULT_HEARTBEAT;
 
-static spinlock_t io_lock;
+static DEFINE_SPINLOCK(io_lock);
 static unsigned long wdt_status;
 #define WDT_IN_USE        0
 #define WDT_OK_TO_CLOSE   1
@@ -254,8 +254,6 @@ static int pnx4008_wdt_probe(struct platform_device *pdev)
        int ret = 0, size;
        struct resource *res;
 
-       spin_lock_init(&io_lock);
-
        if (heartbeat < 1 || heartbeat > MAX_HEARTBEAT)
                heartbeat = DEFAULT_HEARTBEAT;
 
@@ -335,7 +333,7 @@ static int __init pnx4008_wdt_init(void)
 
 static void __exit pnx4008_wdt_exit(void)
 {
-       return platform_driver_unregister(&platform_wdt_driver);
+       platform_driver_unregister(&platform_wdt_driver);
 }
 
 module_init(pnx4008_wdt_init);
index 285d85289532da3aadab9c7b0f1e73373fee1d84..2ee2677f3648168daef037c94777de02375ba4b3 100644 (file)
@@ -54,7 +54,7 @@
 #include <asm/system.h>
 
 static unsigned long sbc8360_is_open;
-static spinlock_t sbc8360_lock;
+static DEFINE_SPINLOCK(sbc8360_lock);
 static char expect_close;
 
 #define PFX "sbc8360: "
@@ -359,7 +359,6 @@ static int __init sbc8360_init(void)
                goto out_noreboot;
        }
 
-       spin_lock_init(&sbc8360_lock);
        res = misc_register(&sbc8360_miscdev);
        if (res) {
                printk(KERN_ERR PFX "failed to register misc device\n");
index 9670d47190d0875a41a23b81d0dc568ab3e0cb4e..32ccd7c89c7dae5a38e94d3533d0e3fbcce8de46 100644 (file)
@@ -74,7 +74,7 @@ static int io = -1;
 static int io_len = 2;         /* for non plug and play */
 static struct semaphore open_sem;
 static char expect_close;
-static spinlock_t sc1200wdt_lock;      /* io port access serialisation */
+static DEFINE_SPINLOCK(sc1200wdt_lock);        /* io port access serialisation */
 
 #if defined CONFIG_PNP
 static int isapnp = 1;
@@ -375,7 +375,6 @@ static int __init sc1200wdt_init(void)
 
        printk("%s\n", banner);
 
-       spin_lock_init(&sc1200wdt_lock);
        sema_init(&open_sem, 1);
 
 #if defined CONFIG_PNP
index e8594c64d1e64fd9a07606ba75878007ab523578..2847324a2be2ec22f5fab63dec124d185266d671 100644 (file)
@@ -125,7 +125,7 @@ static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0);
 static unsigned long next_heartbeat;
 static unsigned long wdt_is_open;
 static char wdt_expect_close;
-static spinlock_t wdt_spinlock;
+static DEFINE_SPINLOCK(wdt_spinlock);
 
 /*
  *     Whack the dog
@@ -383,8 +383,6 @@ static int __init sc520_wdt_init(void)
 {
        int rc = -EBUSY;
 
-       spin_lock_init(&wdt_spinlock);
-
        /* Check that the timeout value is within it's range ; if not reset to the default */
        if (wdt_set_heartbeat(timeout)) {
                wdt_set_heartbeat(WATCHDOG_TIMEOUT);
index d3cb0a76602036a679e5f242ecaffb026bc93f51..5d2b5ba61414664c452729361d159f6a7d639400 100644 (file)
@@ -83,7 +83,7 @@ static unsigned long timer_enabled = 0;   /* is the timer enabled? */
 
 static char expect_close;       /* is the close expected? */
 
-static spinlock_t io_lock;     /* to guard the watchdog from io races */
+static DEFINE_SPINLOCK(io_lock);/* to guard the watchdog from io races */
 
 static int nowayout = WATCHDOG_NOWAYOUT;
 
@@ -540,8 +540,6 @@ static int __init wb_smsc_wdt_init(void)
 {
        int ret;
 
-       spin_lock_init(&io_lock);
-
        printk("SMsC 37B787 watchdog component driver " VERSION " initialising...\n");
 
        if (!request_region(IOPORT, IOPORT_SIZE, "SMsC 37B787 watchdog")) {
index df33b3b5a53c34540509c50b3734fef54795aa3d..386492821fc20e91667bebfb98a9a81001938a1d 100644 (file)
@@ -48,7 +48,7 @@
 
 static unsigned long wdt_is_open;
 static char expect_close;
-static spinlock_t io_lock;
+static DEFINE_SPINLOCK(io_lock);
 
 /* You must set this - there is no sane way to probe for this board. */
 static int wdt_io = 0x2E;
@@ -328,8 +328,6 @@ wdt_init(void)
 {
        int ret;
 
-       spin_lock_init(&io_lock);
-
        printk(KERN_INFO "WDT driver for the Winbond(TM) W83627HF/THF/HG Super I/O chip initialising.\n");
 
        if (wdt_set_heartbeat(timeout)) {
index 51826c216d6d0c22451db409841e00864e00fd3d..c622a0e6c9aed57137b59ab0d1af4aabffefe1dc 100644 (file)
@@ -47,7 +47,7 @@
 
 static unsigned long wdt_is_open;
 static char expect_close;
-static spinlock_t io_lock;
+static DEFINE_SPINLOCK(io_lock);
 
 /* You must set this - there is no sane way to probe for this board. */
 static int wdt_io = 0x2e;
@@ -376,8 +376,6 @@ wdt_init(void)
 {
        int ret, i, found = 0;
 
-       spin_lock_init(&io_lock);
-
        printk (KERN_INFO PFX "WDT driver for W83697HF/HG initializing\n");
 
        if (wdt_io == 0) {
index 3c88fe18f4f437e01e88264e340ddea12fe0d207..bcc9d48955def46f1ad2a38a07ab53fbc99f9268 100644 (file)
@@ -94,7 +94,7 @@ static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0);
 static unsigned long next_heartbeat;
 static unsigned long wdt_is_open;
 static char wdt_expect_close;
-static spinlock_t wdt_spinlock;
+static DEFINE_SPINLOCK(wdt_spinlock);
 
 /*
  *     Whack the dog
@@ -350,8 +350,6 @@ static int __init w83877f_wdt_init(void)
 {
        int rc = -EBUSY;
 
-       spin_lock_init(&wdt_spinlock);
-
        if(timeout < 1 || timeout > 3600) /* arbitrary upper limit */
        {
                timeout = WATCHDOG_TIMEOUT;
index 15796844289121d9ed3bc2833a6cd6eecb2c9b81..b475529d2475954bee8cd8b79b1a4a8033277d0e 100644 (file)
@@ -50,7 +50,7 @@ static        int timeoutW;                   /* timeout in watchdog counter units */
 static unsigned long timer_alive;
 static int testmode;
 static char expect_close;
-static spinlock_t spinlock;
+static DEFINE_SPINLOCK(spinlock);
 
 module_param(timeout, int, 0);
 MODULE_PARM_DESC(timeout,"Watchdog timeout in seconds (15..7635), default=" __MODULE_STRING(DEFAULT_TIMEOUT) ")");
@@ -476,8 +476,6 @@ static int __init w83977f_wdt_init(void)
 
         printk(KERN_INFO PFX DRIVER_VERSION);
 
-       spin_lock_init(&spinlock);
-
        /*
         * Check that the timeout value is within it's range ; 
         * if not reset to the default
index 950905d3c39f298ae00b1094b17ddec60231d331..9e368091f7998254899bc5fb5505d597a3e96821 100644 (file)
@@ -45,7 +45,7 @@
 
 static unsigned long wafwdt_is_open;
 static char expect_close;
-static spinlock_t wafwdt_lock;
+static DEFINE_SPINLOCK(wafwdt_lock);
 
 /*
  *     You must set these - there is no sane way to probe for this board.
@@ -252,8 +252,6 @@ static int __init wafwdt_init(void)
 
        printk(KERN_INFO "WDT driver for Wafer 5823 single board computer initialising.\n");
 
-       spin_lock_init(&wafwdt_lock);
-
        if (timeout < 1 || timeout > 255) {
                timeout = WD_TIMO;
                printk (KERN_INFO PFX "timeout value must be 1<=x<=255, using %d\n",
index 0a3de6a024420b52369b00f19a55ba3844a8b12e..53d0bb410df8c6811db704e91340ddc134b775d1 100644 (file)
@@ -253,7 +253,7 @@ static irqreturn_t wdt_interrupt(int irq, void *dev_id)
                        printk(KERN_CRIT "Possible fan fault.\n");
        }
 #endif /* CONFIG_WDT_501 */
-       if (!(status & WDC_SR_WCCR))
+       if (!(status & WDC_SR_WCCR)) {
 #ifdef SOFTWARE_REBOOT
 #ifdef ONLY_TESTING
                printk(KERN_CRIT "Would Reboot.\n");
@@ -264,6 +264,7 @@ static irqreturn_t wdt_interrupt(int irq, void *dev_id)
 #else
                printk(KERN_CRIT "Reset in 5ms.\n");
 #endif
+       }
        return IRQ_HANDLED;
 }
 
index 7d300ff7ab07ed65df9ce6e8006a449c01dd4600..9b7f6b6edef6df0f75212960dac4696d9cfa68ae 100644 (file)
@@ -59,7 +59,7 @@ static        int timeoutM;                           /* timeout in minutes */
 static unsigned long timer_alive;
 static int testmode;
 static char expect_close;
-static spinlock_t spinlock;
+static DEFINE_SPINLOCK(spinlock);
 
 module_param(timeout, int, 0);
 MODULE_PARM_DESC(timeout,"Watchdog timeout in seconds (60..15300), default=" __MODULE_STRING(DEFAULT_TIMEOUT) ")");
@@ -448,8 +448,6 @@ static int __init wd977_init(void)
 
        printk(KERN_INFO PFX DRIVER_VERSION);
 
-       spin_lock_init(&spinlock);
-
        /* Check that the timeout value is within it's range ; if not reset to the default */
        if (wdt977_set_timeout(timeout))
        {
index 6baf4ae42c9d0e831cfa87e4470c72a7b2b15a4d..1355608683e40e8c124c140981d66727a0fb4300 100644 (file)
@@ -74,7 +74,7 @@
 static int dev_count;
 
 static struct semaphore open_sem;
-static spinlock_t wdtpci_lock;
+static DEFINE_SPINLOCK(wdtpci_lock);
 static char expect_close;
 
 static int io;
@@ -298,7 +298,7 @@ static irqreturn_t wdtpci_interrupt(int irq, void *dev_id)
                        printk(KERN_CRIT PFX "Possible fan fault.\n");
        }
 #endif /* CONFIG_WDT_501_PCI */
-       if (!(status&WDC_SR_WCCR))
+       if (!(status&WDC_SR_WCCR)) {
 #ifdef SOFTWARE_REBOOT
 #ifdef ONLY_TESTING
                printk(KERN_CRIT PFX "Would Reboot.\n");
@@ -309,6 +309,7 @@ static irqreturn_t wdtpci_interrupt(int irq, void *dev_id)
 #else
                printk(KERN_CRIT PFX "Reset in 5ms.\n");
 #endif
+       }
        return IRQ_HANDLED;
 }
 
@@ -606,7 +607,6 @@ static int __devinit wdtpci_init_one (struct pci_dev *dev,
        }
 
        sema_init(&open_sem, 1);
-       spin_lock_init(&wdtpci_lock);
 
        irq = dev->irq;
        io = pci_resource_start (dev, 2);
index 067c07be928ce3a27512731799b14081a8cbd272..e6c4390d8bd68ff5df14056e1decb13c2435f88d 100644 (file)
@@ -60,6 +60,20 @@ static int zorro_device_probe(struct device *dev)
 }
 
 
+static int zorro_device_remove(struct device *dev)
+{
+       struct zorro_dev *z = to_zorro_dev(dev);
+       struct zorro_driver *drv = to_zorro_driver(dev->driver);
+
+       if (drv) {
+               if (drv->remove)
+                       drv->remove(z);
+               z->driver = NULL;
+       }
+       return 0;
+}
+
+
     /**
      *  zorro_register_driver - register a new Zorro driver
      *  @drv: the driver structure to register
@@ -128,6 +142,7 @@ struct bus_type zorro_bus_type = {
        .name   = "zorro",
        .match  = zorro_bus_match,
        .probe  = zorro_device_probe,
+       .remove = zorro_device_remove,
 };
 
 
index 756f7e9beb2e0a12cc1ad527992ca9fe6537c966..fbb12dadba8389a77f7cfece24fc452d86732640 100644 (file)
@@ -82,7 +82,7 @@ static match_table_t tokens = {
 
 static void v9fs_parse_options(struct v9fs_session_info *v9ses)
 {
-       char *options = v9ses->options;
+       char *options;
        substring_t args[MAX_OPT_ARGS];
        char *p;
        int option;
@@ -96,9 +96,10 @@ static void v9fs_parse_options(struct v9fs_session_info *v9ses)
        v9ses->cache = 0;
        v9ses->trans = v9fs_default_trans();
 
-       if (!options)
+       if (!v9ses->options)
                return;
 
+       options = kstrdup(v9ses->options, GFP_KERNEL);
        while ((p = strsep(&options, ",")) != NULL) {
                int token;
                if (!*p)
@@ -169,6 +170,7 @@ static void v9fs_parse_options(struct v9fs_session_info *v9ses)
                        continue;
                }
        }
+       kfree(options);
 }
 
 /**
index bb0cef9a6b8aced66b67d583d7a907c3742045b6..678c02f1ae231306b8f2062ef6925bb69a4a6b71 100644 (file)
@@ -119,6 +119,7 @@ static int v9fs_get_sb(struct file_system_type *fs_type, int flags,
 
        P9_DPRINTK(P9_DEBUG_VFS, " \n");
 
+       st = NULL;
        v9ses = kzalloc(sizeof(struct v9fs_session_info), GFP_KERNEL);
        if (!v9ses)
                return -ENOMEM;
@@ -164,10 +165,12 @@ static int v9fs_get_sb(struct file_system_type *fs_type, int flags,
        root->d_inode->i_ino = v9fs_qid2ino(&st->qid);
        v9fs_stat2inode(st, root->d_inode, sb);
        v9fs_fid_add(root, fid);
+       kfree(st);
 
        return simple_set_mnt(mnt, sb);
 
 error:
+       kfree(st);
        if (fid)
                p9_client_clunk(fid);
 
index cc28a69246a7dc8536de2e9c85bb256ad8bbb8e7..429a002285075c7556b30f1364a3d091a3052c57 100644 (file)
@@ -504,7 +504,7 @@ config INOTIFY
          including multiple file events, one-shot support, and unmount
          notification.
 
-         For more information, see Documentation/filesystems/inotify.txt
+         For more information, see <file:Documentation/filesystems/inotify.txt>
 
          If unsure, say Y.
 
@@ -518,7 +518,7 @@ config INOTIFY_USER
          directories via a single open fd.  Events are read from the file
          descriptor, which is also select()- and poll()-able.
 
-         For more information, see Documentation/filesystems/inotify.txt
+         For more information, see <file:Documentation/filesystems/inotify.txt>
 
          If unsure, say Y.
 
@@ -1089,7 +1089,7 @@ config ECRYPT_FS
        depends on EXPERIMENTAL && KEYS && CRYPTO && NET
        help
          Encrypted filesystem that operates on the VFS layer.  See
-         <file:Documentation/ecryptfs.txt> to learn more about
+         <file:Documentation/filesystems/ecryptfs.txt> to learn more about
          eCryptfs.  Userspace components are required and can be
          obtained from <http://ecryptfs.sf.net>.
 
@@ -2007,7 +2007,7 @@ config CIFS_EXPERIMENTAL
 config CIFS_UPCALL
          bool "Kerberos/SPNEGO advanced session setup (EXPERIMENTAL)"
          depends on CIFS_EXPERIMENTAL
-         depends on CONNECTOR
+         depends on KEYS
          help
            Enables an upcall mechanism for CIFS which will be used to contact
            userspace helper utilities to provide SPNEGO packaged Kerberos
index 7b4bbe48112d547555433666ccccf5926ce79e2c..849fc3160cb5b372c2626545f926ce185c22762b 100644 (file)
@@ -382,7 +382,7 @@ struct afs_vlocation *afs_vlocation_lookup(struct afs_cell *cell,
               cell->name, key_serial(key),
               (int) namesz, (int) namesz, name, namesz);
 
-       if (namesz > sizeof(vl->vldb.name)) {
+       if (namesz >= sizeof(vl->vldb.name)) {
                _leave(" = -ENAMETOOLONG");
                return ERR_PTR(-ENAMETOOLONG);
        }
index 130f6c66c5ba09dab89de3b7865ac09a6c96ae25..ac7a8b1d6c3ab5f749305c4c38fec63289791b19 100644 (file)
@@ -14,8 +14,6 @@ struct bfs_sb_info {
        unsigned long si_blocks;
        unsigned long si_freeb;
        unsigned long si_freei;
-       unsigned long si_lf_ioff;
-       unsigned long si_lf_sblk;
        unsigned long si_lf_eblk;
        unsigned long si_lasti;
        unsigned long * si_imap;
@@ -39,7 +37,7 @@ static inline struct bfs_sb_info *BFS_SB(struct super_block *sb)
 
 static inline struct bfs_inode_info *BFS_I(struct inode *inode)
 {
-       return list_entry(inode, struct bfs_inode_info, vfs_inode);
+       return container_of(inode, struct bfs_inode_info, vfs_inode);
 }
 
 
index 097f1497f743a2063e66c9511d947e6917251996..1fd056d0fc3dc3029f36bb5a23b38ff71a320750 100644 (file)
 #define dprintf(x...)
 #endif
 
-static int bfs_add_entry(struct inode * dir, const unsigned char * name, int namelen, int ino);
-static struct buffer_head * bfs_find_entry(struct inode * dir, 
-       const unsigned char * name, int namelen, struct bfs_dirent ** res_dir);
+static int bfs_add_entry(struct inode *dir, const unsigned char *name,
+                                               int namelen, int ino);
+static struct buffer_head *bfs_find_entry(struct inode *dir,
+                               const unsigned char *name, int namelen,
+                               struct bfs_dirent **res_dir);
 
-static int bfs_readdir(struct file * f, void * dirent, filldir_t filldir)
+static int bfs_readdir(struct file *f, void *dirent, filldir_t filldir)
 {
-       struct inode * dir = f->f_path.dentry->d_inode;
-       struct buffer_head * bh;
-       struct bfs_dirent * de;
+       struct inode *dir = f->f_path.dentry->d_inode;
+       struct buffer_head *bh;
+       struct bfs_dirent *de;
        unsigned int offset;
        int block;
 
        lock_kernel();
 
-       if (f->f_pos & (BFS_DIRENT_SIZE-1)) {
-               printf("Bad f_pos=%08lx for %s:%08lx\n", (unsigned long)f->f_pos, 
-                       dir->i_sb->s_id, dir->i_ino);
+       if (f->f_pos & (BFS_DIRENT_SIZE - 1)) {
+               printf("Bad f_pos=%08lx for %s:%08lx\n",
+                                       (unsigned long)f->f_pos,
+                                       dir->i_sb->s_id, dir->i_ino);
                unlock_kernel();
                return -EBADF;
        }
 
        while (f->f_pos < dir->i_size) {
-               offset = f->f_pos & (BFS_BSIZE-1);
+               offset = f->f_pos & (BFS_BSIZE - 1);
                block = BFS_I(dir)->i_sblock + (f->f_pos >> BFS_BSIZE_BITS);
                bh = sb_bread(dir->i_sb, block);
                if (!bh) {
@@ -54,7 +57,9 @@ static int bfs_readdir(struct file * f, void * dirent, filldir_t filldir)
                        de = (struct bfs_dirent *)(bh->b_data + offset);
                        if (de->ino) {
                                int size = strnlen(de->name, BFS_NAMELEN);
-                               if (filldir(dirent, de->name, size, f->f_pos, le16_to_cpu(de->ino), DT_UNKNOWN) < 0) {
+                               if (filldir(dirent, de->name, size, f->f_pos,
+                                               le16_to_cpu(de->ino),
+                                               DT_UNKNOWN) < 0) {
                                        brelse(bh);
                                        unlock_kernel();
                                        return 0;
@@ -62,7 +67,7 @@ static int bfs_readdir(struct file * f, void * dirent, filldir_t filldir)
                        }
                        offset += BFS_DIRENT_SIZE;
                        f->f_pos += BFS_DIRENT_SIZE;
-               } while (offset < BFS_BSIZE && f->f_pos < dir->i_size);
+               } while ((offset < BFS_BSIZE) && (f->f_pos < dir->i_size));
                brelse(bh);
        }
 
@@ -78,13 +83,13 @@ const struct file_operations bfs_dir_operations = {
 
 extern void dump_imap(const char *, struct super_block *);
 
-static int bfs_create(struct inode * dir, struct dentry * dentry, int mode,
-               struct nameidata *nd)
+static int bfs_create(struct inode *dir, struct dentry *dentry, int mode,
+                                               struct nameidata *nd)
 {
        int err;
-       struct inode * inode;
-       struct super_block * s = dir->i_sb;
-       struct bfs_sb_info * info = BFS_SB(s);
+       struct inode *inode;
+       struct super_block *s = dir->i_sb;
+       struct bfs_sb_info *info = BFS_SB(s);
        unsigned long ino;
 
        inode = new_inode(s);
@@ -97,7 +102,7 @@ static int bfs_create(struct inode * dir, struct dentry * dentry, int mode,
                iput(inode);
                return -ENOSPC;
        }
-       set_bit(ino, info->si_imap);    
+       set_bit(ino, info->si_imap);
        info->si_freei--;
        inode->i_uid = current->fsuid;
        inode->i_gid = (dir->i_mode & S_ISGID) ? dir->i_gid : current->fsgid;
@@ -113,9 +118,10 @@ static int bfs_create(struct inode * dir, struct dentry * dentry, int mode,
        BFS_I(inode)->i_eblock = 0;
        insert_inode_hash(inode);
         mark_inode_dirty(inode);
-       dump_imap("create",s);
+       dump_imap("create", s);
 
-       err = bfs_add_entry(dir, dentry->d_name.name, dentry->d_name.len, inode->i_ino);
+       err = bfs_add_entry(dir, dentry->d_name.name, dentry->d_name.len,
+                                                       inode->i_ino);
        if (err) {
                inode_dec_link_count(inode);
                iput(inode);
@@ -127,11 +133,12 @@ static int bfs_create(struct inode * dir, struct dentry * dentry, int mode,
        return 0;
 }
 
-static struct dentry * bfs_lookup(struct inode * dir, struct dentry * dentry, struct nameidata *nd)
+static struct dentry *bfs_lookup(struct inode *dir, struct dentry *dentry,
+                                               struct nameidata *nd)
 {
-       struct inode * inode = NULL;
-       struct buffer_head * bh;
-       struct bfs_dirent * de;
+       struct inode *inode = NULL;
+       struct buffer_head *bh;
+       struct bfs_dirent *de;
 
        if (dentry->d_name.len > BFS_NAMELEN)
                return ERR_PTR(-ENAMETOOLONG);
@@ -152,13 +159,15 @@ static struct dentry * bfs_lookup(struct inode * dir, struct dentry * dentry, st
        return NULL;
 }
 
-static int bfs_link(struct dentry * old, struct inode * dir, struct dentry * new)
+static int bfs_link(struct dentry *old, struct inode *dir,
+                                               struct dentry *new)
 {
-       struct inode * inode = old->d_inode;
+       struct inode *inode = old->d_inode;
        int err;
 
        lock_kernel();
-       err = bfs_add_entry(dir, new->d_name.name, new->d_name.len, inode->i_ino);
+       err = bfs_add_entry(dir, new->d_name.name, new->d_name.len,
+                                                       inode->i_ino);
        if (err) {
                unlock_kernel();
                return err;
@@ -172,23 +181,23 @@ static int bfs_link(struct dentry * old, struct inode * dir, struct dentry * new
        return 0;
 }
 
-
-static int bfs_unlink(struct inode * dir, struct dentry * dentry)
+static int bfs_unlink(struct inode *dir, struct dentry *dentry)
 {
        int error = -ENOENT;
-       struct inode * inode;
-       struct buffer_head * bh;
-       struct bfs_dirent * de;
+       struct inode *inode;
+       struct buffer_head *bh;
+       struct bfs_dirent *de;
 
        inode = dentry->d_inode;
        lock_kernel();
        bh = bfs_find_entry(dir, dentry->d_name.name, dentry->d_name.len, &de);
-       if (!bh || le16_to_cpu(de->ino) != inode->i_ino)
+       if (!bh || (le16_to_cpu(de->ino) != inode->i_ino))
                goto out_brelse;
 
        if (!inode->i_nlink) {
-               printf("unlinking non-existent file %s:%lu (nlink=%d)\n", inode->i_sb->s_id, 
-                               inode->i_ino, inode->i_nlink);
+               printf("unlinking non-existent file %s:%lu (nlink=%d)\n",
+                                       inode->i_sb->s_id, inode->i_ino,
+                                       inode->i_nlink);
                inode->i_nlink = 1;
        }
        de->ino = 0;
@@ -205,12 +214,12 @@ out_brelse:
        return error;
 }
 
-static int bfs_rename(struct inode * old_dir, struct dentry * old_dentry, 
-                       struct inode * new_dir, struct dentry * new_dentry)
+static int bfs_rename(struct inode *old_dir, struct dentry *old_dentry,
+                       struct inode *new_dir, struct dentry *new_dentry)
 {
-       struct inode * old_inode, * new_inode;
-       struct buffer_head * old_bh, * new_bh;
-       struct bfs_dirent * old_de, * new_de;           
+       struct inode *old_inode, *new_inode;
+       struct buffer_head *old_bh, *new_bh;
+       struct bfs_dirent *old_de, *new_de;
        int error = -ENOENT;
 
        old_bh = new_bh = NULL;
@@ -223,7 +232,7 @@ static int bfs_rename(struct inode * old_dir, struct dentry * old_dentry,
                                old_dentry->d_name.name, 
                                old_dentry->d_name.len, &old_de);
 
-       if (!old_bh || le16_to_cpu(old_de->ino) != old_inode->i_ino)
+       if (!old_bh || (le16_to_cpu(old_de->ino) != old_inode->i_ino))
                goto end_rename;
 
        error = -EPERM;
@@ -239,7 +248,8 @@ static int bfs_rename(struct inode * old_dir, struct dentry * old_dentry,
        if (!new_bh) {
                error = bfs_add_entry(new_dir, 
                                        new_dentry->d_name.name,
-                                       new_dentry->d_name.len, old_inode->i_ino);
+                                       new_dentry->d_name.len,
+                                       old_inode->i_ino);
                if (error)
                        goto end_rename;
        }
@@ -268,11 +278,12 @@ const struct inode_operations bfs_dir_inops = {
        .rename                 = bfs_rename,
 };
 
-static int bfs_add_entry(struct inode * dir, const unsigned char * name, int namelen, int ino)
+static int bfs_add_entry(struct inode *dir, const unsigned char *name,
+                                                       int namelen, int ino)
 {
-       struct buffer_head * bh;
-       struct bfs_dirent * de;
-       int block, sblock, eblock, off, eoff;
+       struct buffer_head *bh;
+       struct bfs_dirent *de;
+       int block, sblock, eblock, off, pos;
        int i;
 
        dprintf("name=%s, namelen=%d\n", name, namelen);
@@ -284,27 +295,24 @@ static int bfs_add_entry(struct inode * dir, const unsigned char * name, int nam
 
        sblock = BFS_I(dir)->i_sblock;
        eblock = BFS_I(dir)->i_eblock;
-       eoff = dir->i_size % BFS_BSIZE;
-       for (block=sblock; block<=eblock; block++) {
+       for (block = sblock; block <= eblock; block++) {
                bh = sb_bread(dir->i_sb, block);
-               if(!bh) 
+               if (!bh)
                        return -ENOSPC;
-               for (off=0; off<BFS_BSIZE; off+=BFS_DIRENT_SIZE) {
+               for (off = 0; off < BFS_BSIZE; off += BFS_DIRENT_SIZE) {
                        de = (struct bfs_dirent *)(bh->b_data + off);
-                       if (block==eblock && off>=eoff) {
-                               /* Do not read/interpret the garbage in the end of eblock. */
-                               de->ino = 0;
-                       }
                        if (!de->ino) {
-                               if ((block-sblock)*BFS_BSIZE + off >= dir->i_size) {
+                               pos = (block - sblock) * BFS_BSIZE + off;
+                               if (pos >= dir->i_size) {
                                        dir->i_size += BFS_DIRENT_SIZE;
                                        dir->i_ctime = CURRENT_TIME_SEC;
                                }
                                dir->i_mtime = CURRENT_TIME_SEC;
                                mark_inode_dirty(dir);
                                de->ino = cpu_to_le16((u16)ino);
-                               for (i=0; i<BFS_NAMELEN; i++)
-                                       de->name[i] = (i < namelen) ? name[i] : 0;
+                               for (i = 0; i < BFS_NAMELEN; i++)
+                                       de->name[i] =
+                                               (i < namelen) ? name[i] : 0;
                                mark_buffer_dirty(bh);
                                brelse(bh);
                                return 0;
@@ -315,25 +323,26 @@ static int bfs_add_entry(struct inode * dir, const unsigned char * name, int nam
        return -ENOSPC;
 }
 
-static inline int bfs_namecmp(int len, const unsigned char * name, const char * buffer)
+static inline int bfs_namecmp(int len, const unsigned char *name,
+                                                       const char *buffer)
 {
-       if (len < BFS_NAMELEN && buffer[len])
+       if ((len < BFS_NAMELEN) && buffer[len])
                return 0;
        return !memcmp(name, buffer, len);
 }
 
-static struct buffer_head * bfs_find_entry(struct inode * dir, 
-       const unsigned char * name, int namelen, struct bfs_dirent ** res_dir)
+static struct buffer_head *bfs_find_entry(struct inode *dir,
+                       const unsigned char *name, int namelen,
+                       struct bfs_dirent **res_dir)
 {
-       unsigned long block, offset;
-       struct buffer_head * bh;
-       struct bfs_dirent * de;
+       unsigned long block = 0, offset = 0;
+       struct buffer_head *bh = NULL;
+       struct bfs_dirent *de;
 
        *res_dir = NULL;
        if (namelen > BFS_NAMELEN)
                return NULL;
-       bh = NULL;
-       block = offset = 0;
+
        while (block * BFS_BSIZE + offset < dir->i_size) {
                if (!bh) {
                        bh = sb_bread(dir->i_sb, BFS_I(dir)->i_sblock + block);
@@ -344,7 +353,8 @@ static struct buffer_head * bfs_find_entry(struct inode * dir,
                }
                de = (struct bfs_dirent *)(bh->b_data + offset);
                offset += BFS_DIRENT_SIZE;
-               if (le16_to_cpu(de->ino) && bfs_namecmp(namelen, name, de->name)) {
+               if (le16_to_cpu(de->ino) &&
+                               bfs_namecmp(namelen, name, de->name)) {
                        *res_dir = de;
                        return bh;
                }
index 911b4ccf470f4d4d0bd4bb77199f67a7f0cd3ca0..b11e63e8fbcd88389e4fb2e2a62b41465595dc04 100644 (file)
@@ -2,6 +2,11 @@
  *     fs/bfs/file.c
  *     BFS file operations.
  *     Copyright (C) 1999,2000 Tigran Aivazian <tigran@veritas.com>
+ *
+ *     Make the file block allocation algorithm understand the size
+ *     of the underlying block device.
+ *     Copyright (C) 2007 Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
+ *
  */
 
 #include <linux/fs.h>
@@ -27,7 +32,8 @@ const struct file_operations bfs_file_operations = {
        .splice_read    = generic_file_splice_read,
 };
 
-static int bfs_move_block(unsigned long from, unsigned long to, struct super_block *sb)
+static int bfs_move_block(unsigned long from, unsigned long to,
+                                       struct super_block *sb)
 {
        struct buffer_head *bh, *new;
 
@@ -43,21 +49,22 @@ static int bfs_move_block(unsigned long from, unsigned long to, struct super_blo
 }
 
 static int bfs_move_blocks(struct super_block *sb, unsigned long start,
-                           unsigned long end, unsigned long where)
+                               unsigned long end, unsigned long where)
 {
        unsigned long i;
 
        dprintf("%08lx-%08lx->%08lx\n", start, end, where);
        for (i = start; i <= end; i++)
                if(bfs_move_block(i, where + i, sb)) {
-                       dprintf("failed to move block %08lx -> %08lx\n", i, where + i);
+                       dprintf("failed to move block %08lx -> %08lx\n", i,
+                                                               where + i);
                        return -EIO;
                }
        return 0;
 }
 
-static int bfs_get_block(struct inode * inode, sector_t block, 
-       struct buffer_head * bh_result, int create)
+static int bfs_get_block(struct inode *inode, sector_t block,
+                       struct buffer_head *bh_result, int create)
 {
        unsigned long phys;
        int err;
@@ -66,9 +73,6 @@ static int bfs_get_block(struct inode * inode, sector_t block,
        struct bfs_inode_info *bi = BFS_I(inode);
        struct buffer_head *sbh = info->si_sbh;
 
-       if (block > info->si_blocks)
-               return -EIO;
-
        phys = bi->i_sblock + block;
        if (!create) {
                if (phys <= bi->i_eblock) {
@@ -79,21 +83,29 @@ static int bfs_get_block(struct inode * inode, sector_t block,
                return 0;
        }
 
-       /* if the file is not empty and the requested block is within the range
-          of blocks allocated for this file, we can grant it */
-       if (inode->i_size && phys <= bi->i_eblock) {
+       /*
+        * If the file is not empty and the requested block is within the
+        * range of blocks allocated for this file, we can grant it.
+        */
+       if (bi->i_sblock && (phys <= bi->i_eblock)) {
                dprintf("c=%d, b=%08lx, phys=%08lx (interim block granted)\n", 
                                create, (unsigned long)block, phys);
                map_bh(bh_result, sb, phys);
                return 0;
        }
 
-       /* the rest has to be protected against itself */
+       /* The file will be extended, so let's see if there is enough space. */
+       if (phys >= info->si_blocks)
+               return -ENOSPC;
+
+       /* The rest has to be protected against itself. */
        lock_kernel();
 
-       /* if the last data block for this file is the last allocated
-          block, we can extend the file trivially, without moving it
-          anywhere */
+       /*
+        * If the last data block for this file is the last allocated
+        * block, we can extend the file trivially, without moving it
+        * anywhere.
+        */
        if (bi->i_eblock == info->si_lf_eblk) {
                dprintf("c=%d, b=%08lx, phys=%08lx (simple extension)\n", 
                                create, (unsigned long)block, phys);
@@ -106,13 +118,19 @@ static int bfs_get_block(struct inode * inode, sector_t block,
                goto out;
        }
 
-       /* Ok, we have to move this entire file to the next free block */
+       /* Ok, we have to move this entire file to the next free block. */
        phys = info->si_lf_eblk + 1;
-       if (bi->i_sblock) { /* if data starts on block 0 then there is no data */
+       if (phys + block >= info->si_blocks) {
+               err = -ENOSPC;
+               goto out;
+       }
+
+       if (bi->i_sblock) {
                err = bfs_move_blocks(inode->i_sb, bi->i_sblock, 
-                               bi->i_eblock, phys);
+                                               bi->i_eblock, phys);
                if (err) {
-                       dprintf("failed to move ino=%08lx -> fs corruption\n", inode->i_ino);
+                       dprintf("failed to move ino=%08lx -> fs corruption\n",
+                                                               inode->i_ino);
                        goto out;
                }
        } else
@@ -124,8 +142,10 @@ static int bfs_get_block(struct inode * inode, sector_t block,
        phys += block;
        info->si_lf_eblk = bi->i_eblock = phys;
 
-       /* this assumes nothing can write the inode back while we are here
-        * and thus update inode->i_blocks! (XXX)*/
+       /*
+        * This assumes nothing can write the inode back while we are here
+        * and thus update inode->i_blocks! (XXX)
+        */
        info->si_freeb -= bi->i_eblock - bi->i_sblock + 1 - inode->i_blocks;
        mark_inode_dirty(inode);
        mark_buffer_dirty(sbh);
index 7bd9c2bbe6ee61e5d48485d80b9b0b3096512370..294c41baef6ed35cb65118867f965ebf522b36ec 100644 (file)
@@ -30,25 +30,26 @@ MODULE_LICENSE("GPL");
 #define dprintf(x...)
 #endif
 
-void dump_imap(const char *prefix, struct super_block * s);
+void dump_imap(const char *prefix, struct super_block *s);
 
-static void bfs_read_inode(struct inode * inode)
+static void bfs_read_inode(struct inode *inode)
 {
        unsigned long ino = inode->i_ino;
-       struct bfs_inode * di;
-       struct buffer_head * bh;
+       struct bfs_inode *di;
+       struct buffer_head *bh;
        int block, off;
 
-       if (ino < BFS_ROOT_INO || ino > BFS_SB(inode->i_sb)->si_lasti) {
+       if ((ino < BFS_ROOT_INO) || (ino > BFS_SB(inode->i_sb)->si_lasti)) {
                printf("Bad inode number %s:%08lx\n", inode->i_sb->s_id, ino);
                make_bad_inode(inode);
                return;
        }
 
-       block = (ino - BFS_ROOT_INO)/BFS_INODES_PER_BLOCK + 1;
+       block = (ino - BFS_ROOT_INO) / BFS_INODES_PER_BLOCK + 1;
        bh = sb_bread(inode->i_sb, block);
        if (!bh) {
-               printf("Unable to read inode %s:%08lx\n", inode->i_sb->s_id, ino);
+               printf("Unable to read inode %s:%08lx\n", inode->i_sb->s_id,
+                                                                       ino);
                make_bad_inode(inode);
                return;
        }
@@ -56,7 +57,7 @@ static void bfs_read_inode(struct inode * inode)
        off = (ino - BFS_ROOT_INO) % BFS_INODES_PER_BLOCK;
        di = (struct bfs_inode *)bh->b_data + off;
 
-       inode->i_mode = 0x0000FFFF &  le32_to_cpu(di->i_mode);
+       inode->i_mode = 0x0000FFFF & le32_to_cpu(di->i_mode);
        if (le32_to_cpu(di->i_vtype) == BFS_VDIR) {
                inode->i_mode |= S_IFDIR;
                inode->i_op = &bfs_dir_inops;
@@ -70,48 +71,48 @@ static void bfs_read_inode(struct inode * inode)
 
        BFS_I(inode)->i_sblock =  le32_to_cpu(di->i_sblock);
        BFS_I(inode)->i_eblock =  le32_to_cpu(di->i_eblock);
+       BFS_I(inode)->i_dsk_ino = le16_to_cpu(di->i_ino);
        inode->i_uid =  le32_to_cpu(di->i_uid);
        inode->i_gid =  le32_to_cpu(di->i_gid);
        inode->i_nlink =  le32_to_cpu(di->i_nlink);
        inode->i_size = BFS_FILESIZE(di);
        inode->i_blocks = BFS_FILEBLOCKS(di);
-        if (inode->i_size || inode->i_blocks) dprintf("Registered inode with %lld size, %ld blocks\n", inode->i_size, inode->i_blocks);
        inode->i_atime.tv_sec =  le32_to_cpu(di->i_atime);
        inode->i_mtime.tv_sec =  le32_to_cpu(di->i_mtime);
        inode->i_ctime.tv_sec =  le32_to_cpu(di->i_ctime);
        inode->i_atime.tv_nsec = 0;
        inode->i_mtime.tv_nsec = 0;
        inode->i_ctime.tv_nsec = 0;
-       BFS_I(inode)->i_dsk_ino = le16_to_cpu(di->i_ino); /* can be 0 so we store a copy */
 
        brelse(bh);
 }
 
-static int bfs_write_inode(struct inode * inode, int unused)
+static int bfs_write_inode(struct inode *inode, int unused)
 {
        unsigned int ino = (u16)inode->i_ino;
         unsigned long i_sblock;
-       struct bfs_inode * di;
-       struct buffer_head * bh;
+       struct bfs_inode *di;
+       struct buffer_head *bh;
        int block, off;
 
         dprintf("ino=%08x\n", ino);
 
-       if (ino < BFS_ROOT_INO || ino > BFS_SB(inode->i_sb)->si_lasti) {
+       if ((ino < BFS_ROOT_INO) || (ino > BFS_SB(inode->i_sb)->si_lasti)) {
                printf("Bad inode number %s:%08x\n", inode->i_sb->s_id, ino);
                return -EIO;
        }
 
        lock_kernel();
-       block = (ino - BFS_ROOT_INO)/BFS_INODES_PER_BLOCK + 1;
+       block = (ino - BFS_ROOT_INO) / BFS_INODES_PER_BLOCK + 1;
        bh = sb_bread(inode->i_sb, block);
        if (!bh) {
-               printf("Unable to read inode %s:%08x\n", inode->i_sb->s_id, ino);
+               printf("Unable to read inode %s:%08x\n",
+                               inode->i_sb->s_id, ino);
                unlock_kernel();
                return -EIO;
        }
 
-       off = (ino - BFS_ROOT_INO)%BFS_INODES_PER_BLOCK;
+       off = (ino - BFS_ROOT_INO) % BFS_INODES_PER_BLOCK;
        di = (struct bfs_inode *)bh->b_data + off;
 
        if (ino == BFS_ROOT_INO)
@@ -133,27 +134,26 @@ static int bfs_write_inode(struct inode * inode, int unused)
        di->i_eoffset = cpu_to_le32(i_sblock * BFS_BSIZE + inode->i_size - 1);
 
        mark_buffer_dirty(bh);
-        dprintf("Written ino=%d into %d:%d\n",le16_to_cpu(di->i_ino),block,off);
        brelse(bh);
        unlock_kernel();
        return 0;
 }
 
-static void bfs_delete_inode(struct inode * inode)
+static void bfs_delete_inode(struct inode *inode)
 {
        unsigned long ino = inode->i_ino;
-       struct bfs_inode * di;
-       struct buffer_head * bh;
+       struct bfs_inode *di;
+       struct buffer_head *bh;
        int block, off;
-       struct super_block * s = inode->i_sb;
-       struct bfs_sb_info * info = BFS_SB(s);
-       struct bfs_inode_info * bi = BFS_I(inode);
+       struct super_block *s = inode->i_sb;
+       struct bfs_sb_info *info = BFS_SB(s);
+       struct bfs_inode_info *bi = BFS_I(inode);
 
        dprintf("ino=%08lx\n", ino);
 
        truncate_inode_pages(&inode->i_data, 0);
 
-       if (ino < BFS_ROOT_INO || ino > info->si_lasti) {
+       if ((ino < BFS_ROOT_INO) || (ino > info->si_lasti)) {
                printf("invalid ino=%08lx\n", ino);
                return;
        }
@@ -162,31 +162,35 @@ static void bfs_delete_inode(struct inode * inode)
        inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME_SEC;
        lock_kernel();
        mark_inode_dirty(inode);
-       block = (ino - BFS_ROOT_INO)/BFS_INODES_PER_BLOCK + 1;
+
+       block = (ino - BFS_ROOT_INO) / BFS_INODES_PER_BLOCK + 1;
        bh = sb_bread(s, block);
        if (!bh) {
-               printf("Unable to read inode %s:%08lx\n", inode->i_sb->s_id, ino);
+               printf("Unable to read inode %s:%08lx\n",
+                                       inode->i_sb->s_id, ino);
                unlock_kernel();
                return;
        }
-       off = (ino - BFS_ROOT_INO)%BFS_INODES_PER_BLOCK;
-       di = (struct bfs_inode *) bh->b_data + off;
+       off = (ino - BFS_ROOT_INO) % BFS_INODES_PER_BLOCK;
+       di = (struct bfs_inode *)bh->b_data + off;
+       memset((void *)di, 0, sizeof(struct bfs_inode));
+       mark_buffer_dirty(bh);
+       brelse(bh);
+
         if (bi->i_dsk_ino) {
-               info->si_freeb += 1 + bi->i_eblock - bi->i_sblock;
+               info->si_freeb += BFS_FILEBLOCKS(bi);
                info->si_freei++;
                clear_bit(ino, info->si_imap);
                dump_imap("delete_inode", s);
         }
-       di->i_ino = 0;
-       di->i_sblock = 0;
-       mark_buffer_dirty(bh);
-       brelse(bh);
 
-       /* if this was the last file, make the previous 
-          block "last files last block" even if there is no real file there,
-          saves us 1 gap */
-       if (info->si_lf_eblk == BFS_I(inode)->i_eblock) {
-               info->si_lf_eblk = BFS_I(inode)->i_sblock - 1;
+       /*
+        * If this was the last file, make the previous block
+        * "last block of the last file" even if there is no
+        * real file there, saves us 1 gap.
+        */
+       if (info->si_lf_eblk == bi->i_eblock) {
+               info->si_lf_eblk = bi->i_sblock - 1;
                mark_buffer_dirty(info->si_sbh);
        }
        unlock_kernel();
@@ -228,7 +232,7 @@ static void bfs_write_super(struct super_block *s)
        unlock_kernel();
 }
 
-static struct kmem_cache * bfs_inode_cachep;
+static struct kmem_cache *bfs_inode_cachep;
 
 static struct inode *bfs_alloc_inode(struct super_block *sb)
 {
@@ -279,7 +283,7 @@ static const struct super_operations bfs_sops = {
        .statfs         = bfs_statfs,
 };
 
-void dump_imap(const char *prefix, struct super_block * s)
+void dump_imap(const char *prefix, struct super_block *s)
 {
 #ifdef DEBUG
        int i;
@@ -287,25 +291,26 @@ void dump_imap(const char *prefix, struct super_block * s)
 
        if (!tmpbuf)
                return;
-       for (i=BFS_SB(s)->si_lasti; i>=0; i--) {
-               if (i > PAGE_SIZE-100) break;
+       for (i = BFS_SB(s)->si_lasti; i >= 0; i--) {
+               if (i > PAGE_SIZE - 100) break;
                if (test_bit(i, BFS_SB(s)->si_imap))
                        strcat(tmpbuf, "1");
                else
                        strcat(tmpbuf, "0");
        }
-       printk(KERN_ERR "BFS-fs: %s: lasti=%08lx <%s>\n", prefix, BFS_SB(s)->si_lasti, tmpbuf);
+       printf("BFS-fs: %s: lasti=%08lx <%s>\n",
+                               prefix, BFS_SB(s)->si_lasti, tmpbuf);
        free_page((unsigned long)tmpbuf);
 #endif
 }
 
 static int bfs_fill_super(struct super_block *s, void *data, int silent)
 {
-       struct buffer_head * bh;
-       struct bfs_super_block * bfs_sb;
-       struct inode * inode;
+       struct buffer_head *bh;
+       struct bfs_super_block *bfs_sb;
+       struct inode *inode;
        unsigned i, imap_len;
-       struct bfs_sb_info * info;
+       struct bfs_sb_info *info;
 
        info = kzalloc(sizeof(*info), GFP_KERNEL);
        if (!info)
@@ -329,14 +334,14 @@ static int bfs_fill_super(struct super_block *s, void *data, int silent)
 
        s->s_magic = BFS_MAGIC;
        info->si_sbh = bh;
-       info->si_lasti = (le32_to_cpu(bfs_sb->s_start) - BFS_BSIZE)/sizeof(struct bfs_inode)
-                       + BFS_ROOT_INO - 1;
-
-       imap_len = info->si_lasti/8 + 1;
+       info->si_lasti = (le32_to_cpu(bfs_sb->s_start) - BFS_BSIZE) /
+                                       sizeof(struct bfs_inode)
+                                       + BFS_ROOT_INO - 1;
+       imap_len = (info->si_lasti / 8) + 1;
        info->si_imap = kzalloc(imap_len, GFP_KERNEL);
        if (!info->si_imap)
                goto out;
-       for (i=0; i<BFS_ROOT_INO; i++) 
+       for (i = 0; i < BFS_ROOT_INO; i++)
                set_bit(i, info->si_imap);
 
        s->s_op = &bfs_sops;
@@ -352,16 +357,15 @@ static int bfs_fill_super(struct super_block *s, void *data, int silent)
                goto out;
        }
 
-       info->si_blocks = (le32_to_cpu(bfs_sb->s_end) + 1)>>BFS_BSIZE_BITS; /* for statfs(2) */
-       info->si_freeb = (le32_to_cpu(bfs_sb->s_end) + 1 -  le32_to_cpu(bfs_sb->s_start))>>BFS_BSIZE_BITS;
+       info->si_blocks = (le32_to_cpu(bfs_sb->s_end) + 1) >> BFS_BSIZE_BITS;
+       info->si_freeb = (le32_to_cpu(bfs_sb->s_end) + 1
+                       - le32_to_cpu(bfs_sb->s_start)) >> BFS_BSIZE_BITS;
        info->si_freei = 0;
        info->si_lf_eblk = 0;
-       info->si_lf_sblk = 0;
-       info->si_lf_ioff = 0;
        bh = NULL;
-       for (i=BFS_ROOT_INO; i<=info->si_lasti; i++) {
+       for (i = BFS_ROOT_INO; i <= info->si_lasti; i++) {
                struct bfs_inode *di;
-               int block = (i - BFS_ROOT_INO)/BFS_INODES_PER_BLOCK + 1;
+               int block = (i - BFS_ROOT_INO) / BFS_INODES_PER_BLOCK + 1;
                int off = (i - BFS_ROOT_INO) % BFS_INODES_PER_BLOCK;
                unsigned long sblock, eblock;
 
@@ -384,11 +388,8 @@ static int bfs_fill_super(struct super_block *s, void *data, int silent)
 
                sblock =  le32_to_cpu(di->i_sblock);
                eblock =  le32_to_cpu(di->i_eblock);
-               if (eblock > info->si_lf_eblk) {
+               if (eblock > info->si_lf_eblk)
                        info->si_lf_eblk = eblock;
-                       info->si_lf_sblk = sblock;
-                       info->si_lf_ioff = BFS_INO2OFF(i);
-               }
        }
        brelse(bh);
        if (!(s->s_flags & MS_RDONLY)) {
index 3d419163c3d3a345f0a3bd06b230f0186038d60b..a609599287aadbeea6c7964b813a407078d93f12 100644 (file)
@@ -1,3 +1,10 @@
+Version 1.52
+------------
+Fix oops on second mount to server when null auth is used.
+Enable experimental Kerberos support.  Return writebehind errors on flush
+and sync so that events like out of disk space get reported properly on
+cached files.
+
 Version 1.51
 ------------
 Fix memory leak in statfs when mounted to very old servers (e.g.
@@ -12,7 +19,12 @@ leak that causes cifsd not to stop and rmmod to fail to cleanup
 cifs_request_buffers pool. Fix problem with POSIX Open/Mkdir on
 bigendian architectures. Fix possible memory corruption when
 EAGAIN returned on kern_recvmsg. Return better error if server
-requires packet signing but client has disabled it.
+requires packet signing but client has disabled it. When mounted
+with cifsacl mount option - mode bits are approximated based
+on the contents of the ACL of the file or directory. When cifs
+mount helper is missing convert make sure that UNC name 
+has backslash (not forward slash) between ip address of server
+and the share name.
 
 Version 1.50
 ------------
index ff6ba8d823f03a91b3ffad88202c75708d1c9eba..45e42fb97c19e9df3750ac0adc8817b2f251a425 100644 (file)
@@ -3,4 +3,9 @@
 #
 obj-$(CONFIG_CIFS) += cifs.o
 
-cifs-objs := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o link.o misc.o netmisc.o smbdes.o smbencrypt.o transport.o asn1.o md4.o md5.o cifs_unicode.o nterr.o xattr.o cifsencrypt.o fcntl.o readdir.o ioctl.o sess.o export.o cifsacl.o
+cifs-y := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o \
+         link.o misc.o netmisc.o smbdes.o smbencrypt.o transport.o asn1.o \
+         md4.o md5.o cifs_unicode.o nterr.o xattr.o cifsencrypt.o fcntl.o \
+         readdir.o ioctl.o sess.o export.o cifsacl.o
+
+cifs-$(CONFIG_CIFS_UPCALL) += cifs_spnego.o
index b806b11b5560e912f67fca11219381328744dd34..bf11329ac784a8757b31b92d19f66429c3967d27 100644 (file)
@@ -225,12 +225,9 @@ If no password is provided, mount.cifs will prompt for password entry
 
 Restrictions
 ============
-Servers must support the NTLM SMB dialect (which is the most recent, supported 
-by Samba and Windows NT version 4, 2000 and XP and many other SMB/CIFS servers) 
 Servers must support either "pure-TCP" (port 445 TCP/IP CIFS connections) or RFC 
-1001/1002 support for "Netbios-Over-TCP/IP." Neither of these is likely to be a 
-problem as most servers support this.  IPv6 support is planned for the future,
-and is almost complete.
+1001/1002 support for "Netbios-Over-TCP/IP." This is not likely to be a 
+problem as most servers support this.
 
 Valid filenames differ between Windows and Linux.  Windows typically restricts
 filenames which contain certain reserved characters (e.g.the character : 
@@ -458,6 +455,8 @@ A partial list of the supported mount options follows:
                byte range locks).
  remount        remount the share (often used to change from ro to rw mounts
                or vice versa)
+ cifsacl        Report mode bits (e.g. on stat) based on the Windows ACL for
+               the file. (EXPERIMENTAL)
  servern        Specify the server 's netbios name (RFC1001 name) to use
                when attempting to setup a session to the server.  This is
                This is needed for mounting to some older servers (such
@@ -584,8 +583,8 @@ Experimental            When set to 1 used to enable certain experimental
                        performance enhancement was disabled when
                        signing turned on in case buffer was modified
                        just before it was sent, also this flag will
-                       be used to use the new experimental sessionsetup
-                       code).
+                       be used to use the new experimental directory change 
+                       notification code).
 
 These experimental features and tracing can be enabled by changing flags in 
 /proc/fs/cifs (after the cifs module has been installed or built into the 
@@ -608,7 +607,8 @@ the start of smb requests and responses can be enabled via:
 Two other experimental features are under development. To test these
 requires enabling CONFIG_CIFS_EXPERIMENTAL
 
-       ipv6 enablement
+       cifsacl support needed to retrieve approximated mode bits based on
+               the contents on the CIFS ACL.
 
        DNOTIFY fcntl: needed for support of directory change 
                            notification and perhaps later for file leases)
@@ -625,10 +625,7 @@ that they represent all for that share, not just those for which the server
 returned success.
        
 Also note that "cat /proc/fs/cifs/DebugData" will display information about 
-the active sessions and the shares that are mounted.  Note: NTLMv2 enablement 
-will not work since its implementation is not quite complete yet. Do not alter
-the ExtendedSecurity configuration value unless you are doing specific testing.
-Enabling extended security works to Windows 2000 Workstations and XP but not to 
-Windows 2000 server or Samba since it does not usually send "raw NTLMSSP" 
-(instead it sends NTLMSSP encapsulated in SPNEGO/GSSAPI, which support is not 
-complete in the CIFS VFS yet).  
+the active sessions and the shares that are mounted.
+Enabling Kerberos (extended security) works when CONFIG_CIFS_EXPERIMENTAL is enabled
+but requires a user space helper (from the Samba project). NTLM and NTLMv2 and
+LANMAN support do not require this helpr.
index 29d4b2715254847cdf702283b96681e50ce1ed4a..a8852c20072817c6ac3198444a88644951dd99f9 100644 (file)
@@ -16,7 +16,7 @@ SecurityDescriptors
 c) Better pam/winbind integration (e.g. to handle uid mapping
 better)
 
-d) Kerberos/SPNEGO session setup support - (started)
+d) Verify that Kerberos signing works
 
 e) Cleanup now unneeded SessSetup code in
 fs/cifs/connect.c and add back in NTLMSSP code if any servers
index 2a01f3ef96a0503332da509b81e4c788f07113c2..bcda2c6b6a048db68697246a61040e41f6b35da6 100644 (file)
 
 #define SPNEGO_OID_LEN 7
 #define NTLMSSP_OID_LEN  10
+#define KRB5_OID_LEN  7
+#define MSKRB5_OID_LEN  7
 static unsigned long SPNEGO_OID[7] = { 1, 3, 6, 1, 5, 5, 2 };
 static unsigned long NTLMSSP_OID[10] = { 1, 3, 6, 1, 4, 1, 311, 2, 2, 10 };
+static unsigned long KRB5_OID[7] = { 1, 2, 840, 113554, 1, 2, 2 };
+static unsigned long MSKRB5_OID[7] = { 1, 2, 840, 48018, 1, 2, 2 };
 
 /*
  * ASN.1 context.
@@ -457,6 +461,7 @@ decode_negTokenInit(unsigned char *security_blob, int length,
        unsigned long *oid = NULL;
        unsigned int cls, con, tag, oidlen, rc;
        int use_ntlmssp = FALSE;
+       int use_kerberos = FALSE;
 
        *secType = NTLM; /* BB eventually make Kerberos or NLTMSSP the default*/
 
@@ -545,18 +550,28 @@ decode_negTokenInit(unsigned char *security_blob, int length,
                                return 0;
                        }
                        if ((tag == ASN1_OJI) && (con == ASN1_PRI)) {
-                               rc = asn1_oid_decode(&ctx, end, &oid, &oidlen);
-                               if (rc) {
+                               if (asn1_oid_decode(&ctx, end, &oid, &oidlen)) {
+
                                        cFYI(1,
                                          ("OID len = %d oid = 0x%lx 0x%lx "
                                           "0x%lx 0x%lx",
                                           oidlen, *oid, *(oid + 1),
                                           *(oid + 2), *(oid + 3)));
-                                       rc = compare_oid(oid, oidlen,
-                                                NTLMSSP_OID, NTLMSSP_OID_LEN);
-                                       kfree(oid);
-                                       if (rc)
+
+                                       if (compare_oid(oid, oidlen,
+                                                       MSKRB5_OID,
+                                                       MSKRB5_OID_LEN))
+                                               use_kerberos = TRUE;
+                                       else if (compare_oid(oid, oidlen,
+                                                            KRB5_OID,
+                                                            KRB5_OID_LEN))
+                                               use_kerberos = TRUE;
+                                       else if (compare_oid(oid, oidlen,
+                                                            NTLMSSP_OID,
+                                                            NTLMSSP_OID_LEN))
                                                use_ntlmssp = TRUE;
+
+                                       kfree(oid);
                                }
                        } else {
                                cFYI(1, ("Should be an oid what is going on?"));
@@ -609,12 +624,10 @@ decode_negTokenInit(unsigned char *security_blob, int length,
                         ctx.pointer)); /* is this UTF-8 or ASCII? */
        }
 
-       /* if (use_kerberos)
-          *secType = Kerberos
-          else */
-       if (use_ntlmssp) {
+       if (use_kerberos)
+               *secType = Kerberos;
+       else if (use_ntlmssp)
                *secType = NTLMSSP;
-       }
 
        return 1;
 }
diff --git a/fs/cifs/cifs_spnego.c b/fs/cifs/cifs_spnego.c
new file mode 100644 (file)
index 0000000..1529d2b
--- /dev/null
@@ -0,0 +1,134 @@
+/*
+ *   fs/cifs/cifs_spnego.c -- SPNEGO upcall management for CIFS
+ *
+ *   Copyright (c) 2007 Red Hat, Inc.
+ *   Author(s): Jeff Layton (jlayton@redhat.com)
+ *
+ *   This library is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU Lesser General Public License as published
+ *   by the Free Software Foundation; either version 2.1 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This library 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 Lesser General Public License for more details.
+ *
+ *   You should have received a copy of the GNU Lesser General Public License
+ *   along with this library; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <linux/list.h>
+#include <linux/string.h>
+#include <keys/user-type.h>
+#include <linux/key-type.h>
+#include "cifsglob.h"
+#include "cifs_spnego.h"
+#include "cifs_debug.h"
+
+/* create a new cifs key */
+static int
+cifs_spnego_key_instantiate(struct key *key, const void *data, size_t datalen)
+{
+       char *payload;
+       int ret;
+
+       ret = -ENOMEM;
+       payload = kmalloc(datalen, GFP_KERNEL);
+       if (!payload)
+               goto error;
+
+       /* attach the data */
+       memcpy(payload, data, datalen);
+       rcu_assign_pointer(key->payload.data, payload);
+       ret = 0;
+
+error:
+       return ret;
+}
+
+static void
+cifs_spnego_key_destroy(struct key *key)
+{
+       kfree(key->payload.data);
+}
+
+
+/*
+ * keytype for CIFS spnego keys
+ */
+struct key_type cifs_spnego_key_type = {
+       .name           = "cifs.spnego",
+       .instantiate    = cifs_spnego_key_instantiate,
+       .match          = user_match,
+       .destroy        = cifs_spnego_key_destroy,
+       .describe       = user_describe,
+};
+
+#define MAX_VER_STR_LEN   9 /* length of longest version string e.g.
+                               strlen(";ver=0xFF") */
+#define MAX_MECH_STR_LEN 13 /* length of longest security mechanism name, eg
+                              in future could have strlen(";sec=ntlmsspi") */
+#define MAX_IPV6_ADDR_LEN 42 /* eg FEDC:BA98:7654:3210:FEDC:BA98:7654:3210/60 */
+/* get a key struct with a SPNEGO security blob, suitable for session setup */
+struct key *
+cifs_get_spnego_key(struct cifsSesInfo *sesInfo)
+{
+       struct TCP_Server_Info *server = sesInfo->server;
+       char *description, *dp;
+       size_t desc_len;
+       struct key *spnego_key;
+       const char *hostname = server->hostname;
+
+       /* BB: come up with better scheme for determining length */
+       /* length of fields (with semicolons): ver=0xyz ipv4= ipaddress host=
+          hostname sec=mechanism uid=0x uid */
+       desc_len = MAX_VER_STR_LEN + 5 + MAX_IPV6_ADDR_LEN + 1 + 6 +
+                 strlen(hostname) + MAX_MECH_STR_LEN + 8 + (sizeof(uid_t) * 2);
+       spnego_key = ERR_PTR(-ENOMEM);
+       description = kzalloc(desc_len, GFP_KERNEL);
+       if (description == NULL)
+               goto out;
+
+       dp = description;
+       /* start with version and hostname portion of UNC string */
+       spnego_key = ERR_PTR(-EINVAL);
+       sprintf(dp, "ver=0x%x;host=%s;", CIFS_SPNEGO_UPCALL_VERSION,
+               hostname);
+       dp = description + strlen(description);
+
+       /* add the server address */
+       if (server->addr.sockAddr.sin_family == AF_INET)
+               sprintf(dp, "ip4=" NIPQUAD_FMT,
+                       NIPQUAD(server->addr.sockAddr.sin_addr));
+       else if (server->addr.sockAddr.sin_family == AF_INET6)
+               sprintf(dp, "ip6=" NIP6_SEQFMT,
+                       NIP6(server->addr.sockAddr6.sin6_addr));
+       else
+               goto out;
+
+       dp = description + strlen(description);
+
+       /* for now, only sec=krb5 is valid */
+       if (server->secType == Kerberos)
+               sprintf(dp, ";sec=krb5");
+       else
+               goto out;
+
+       dp = description + strlen(description);
+       sprintf(dp, ";uid=0x%x", sesInfo->linux_uid);
+
+       cFYI(1, ("key description = %s", description));
+       spnego_key = request_key(&cifs_spnego_key_type, description, "");
+
+       if (cifsFYI && !IS_ERR(spnego_key)) {
+               struct cifs_spnego_msg *msg = spnego_key->payload.data;
+               cifs_dump_mem("SPNEGO reply blob:", msg->data,
+                               msg->secblob_len + msg->sesskey_len);
+       }
+
+out:
+       kfree(description);
+       return spnego_key;
+}
diff --git a/fs/cifs/cifs_spnego.h b/fs/cifs/cifs_spnego.h
new file mode 100644 (file)
index 0000000..05a34b1
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ *   fs/cifs/cifs_spnego.h -- SPNEGO upcall management for CIFS
+ *
+ *   Copyright (c) 2007 Red Hat, Inc.
+ *   Author(s): Jeff Layton (jlayton@redhat.com)
+ *              Steve French (sfrench@us.ibm.com)
+ *
+ *   This library is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU Lesser General Public License as published
+ *   by the Free Software Foundation; either version 2.1 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This library 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 Lesser General Public License for more details.
+ *
+ *   You should have received a copy of the GNU Lesser General Public License
+ *   along with this library; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _CIFS_SPNEGO_H
+#define _CIFS_SPNEGO_H
+
+#define CIFS_SPNEGO_UPCALL_VERSION 1
+
+/*
+ * The version field should always be set to CIFS_SPNEGO_UPCALL_VERSION.
+ * The flags field is for future use. The request-key callout should set
+ * sesskey_len and secblob_len, and then concatenate the SessKey+SecBlob
+ * and stuff it in the data field.
+ */
+struct cifs_spnego_msg {
+       uint32_t        version;
+       uint32_t        flags;
+       uint32_t        sesskey_len;
+       uint32_t        secblob_len;
+       uint8_t         data[1];
+};
+
+#ifdef __KERNEL__
+extern struct key_type cifs_spnego_key_type;
+extern struct key *cifs_get_spnego_key(struct cifsSesInfo *sesInfo);
+#endif /* KERNEL */
+
+#endif /* _CIFS_SPNEGO_H */
index e8e56353f5a1c423b5e6e70f986bbb8b6a3f7a19..f02fdef463a7f24c940d69e0067a49b947927efb 100644 (file)
@@ -38,13 +38,13 @@ static struct cifs_wksid wksidarr[NUM_WK_SIDS] = {
        {{1, 1, {0, 0, 0, 0, 0, 5}, {cpu_to_le32(18), 0, 0, 0, 0} }, "sys"},
        {{1, 2, {0, 0, 0, 0, 0, 5}, {cpu_to_le32(32), cpu_to_le32(544), 0, 0, 0} }, "root"},
        {{1, 2, {0, 0, 0, 0, 0, 5}, {cpu_to_le32(32), cpu_to_le32(545), 0, 0, 0} }, "users"},
-       {{1, 2, {0, 0, 0, 0, 0, 5}, {cpu_to_le32(32), cpu_to_le32(546), 0, 0, 0} }, "guest"}
-};
+       {{1, 2, {0, 0, 0, 0, 0, 5}, {cpu_to_le32(32), cpu_to_le32(546), 0, 0, 0} }, "guest"} }
+;
 
 
 /* security id for everyone */
-static const struct cifs_sid sid_everyone =
-               {1, 1, {0, 0, 0, 0, 0, 0}, {} };
+static const struct cifs_sid sid_everyone = {
+       1, 1, {0, 0, 0, 0, 0, 1}, {0} };
 /* group users */
 static const struct cifs_sid sid_user =
                {1, 2 , {0, 0, 0, 0, 0, 5}, {} };
@@ -97,7 +97,7 @@ int match_sid(struct cifs_sid *ctsid)
 
 /* if the two SIDs (roughly equivalent to a UUID for a user or group) are
    the same returns 1, if they do not match returns 0 */
-int compare_sids(struct cifs_sid *ctsid, struct cifs_sid *cwsid)
+int compare_sids(const struct cifs_sid *ctsid, const struct cifs_sid *cwsid)
 {
        int i;
        int num_subauth, num_sat, num_saw;
@@ -129,70 +129,153 @@ int compare_sids(struct cifs_sid *ctsid, struct cifs_sid *cwsid)
        return (1); /* sids compare/match */
 }
 
+/*
+   change posix mode to reflect permissions
+   pmode is the existing mode (we only want to overwrite part of this
+   bits to set can be: S_IRWXU, S_IRWXG or S_IRWXO ie 00700 or 00070 or 00007
+*/
+static void access_flags_to_mode(__u32 ace_flags, int type, umode_t *pmode,
+                                umode_t *pbits_to_set)
+{
+       /* the order of ACEs is important.  The canonical order is to begin with
+          DENY entries followed by ALLOW, otherwise an allow entry could be
+          encountered first, making the subsequent deny entry like "dead code"
+          which would be superflous since Windows stops when a match is made
+          for the operation you are trying to perform for your user */
+
+       /* For deny ACEs we change the mask so that subsequent allow access
+          control entries do not turn on the bits we are denying */
+       if (type == ACCESS_DENIED) {
+               if (ace_flags & GENERIC_ALL) {
+                       *pbits_to_set &= ~S_IRWXUGO;
+               }
+               if ((ace_flags & GENERIC_WRITE) ||
+                       ((ace_flags & FILE_WRITE_RIGHTS) == FILE_WRITE_RIGHTS))
+                       *pbits_to_set &= ~S_IWUGO;
+               if ((ace_flags & GENERIC_READ) ||
+                       ((ace_flags & FILE_READ_RIGHTS) == FILE_READ_RIGHTS))
+                       *pbits_to_set &= ~S_IRUGO;
+               if ((ace_flags & GENERIC_EXECUTE) ||
+                       ((ace_flags & FILE_EXEC_RIGHTS) == FILE_EXEC_RIGHTS))
+                       *pbits_to_set &= ~S_IXUGO;
+               return;
+       } else if (type != ACCESS_ALLOWED) {
+               cERROR(1, ("unknown access control type %d", type));
+               return;
+       }
+       /* else ACCESS_ALLOWED type */
+
+       if (ace_flags & GENERIC_ALL) {
+               *pmode |= (S_IRWXUGO & (*pbits_to_set));
+#ifdef CONFIG_CIFS_DEBUG2
+               cFYI(1, ("all perms"));
+#endif
+               return;
+       }
+       if ((ace_flags & GENERIC_WRITE) ||
+                       ((ace_flags & FILE_WRITE_RIGHTS) == FILE_WRITE_RIGHTS))
+               *pmode |= (S_IWUGO & (*pbits_to_set));
+       if ((ace_flags & GENERIC_READ) ||
+                       ((ace_flags & FILE_READ_RIGHTS) == FILE_READ_RIGHTS))
+               *pmode |= (S_IRUGO & (*pbits_to_set));
+       if ((ace_flags & GENERIC_EXECUTE) ||
+                       ((ace_flags & FILE_EXEC_RIGHTS) == FILE_EXEC_RIGHTS))
+               *pmode |= (S_IXUGO & (*pbits_to_set));
 
-static void parse_ace(struct cifs_ace *pace, char *end_of_acl)
+#ifdef CONFIG_CIFS_DEBUG2
+       cFYI(1, ("access flags 0x%x mode now 0x%x", ace_flags, *pmode));
+#endif
+       return;
+}
+
+/*
+   Generate access flags to reflect permissions mode is the existing mode.
+   This function is called for every ACE in the DACL whose SID matches
+   with either owner or group or everyone.
+*/
+
+static void mode_to_access_flags(umode_t mode, umode_t bits_to_use,
+                               __u32 *pace_flags)
+{
+       /* reset access mask */
+       *pace_flags = 0x0;
+
+       /* bits to use are either S_IRWXU or S_IRWXG or S_IRWXO */
+       mode &= bits_to_use;
+
+       /* check for R/W/X UGO since we do not know whose flags
+          is this but we have cleared all the bits sans RWX for
+          either user or group or other as per bits_to_use */
+       if (mode & S_IRUGO)
+               *pace_flags |= SET_FILE_READ_RIGHTS;
+       if (mode & S_IWUGO)
+               *pace_flags |= SET_FILE_WRITE_RIGHTS;
+       if (mode & S_IXUGO)
+               *pace_flags |= SET_FILE_EXEC_RIGHTS;
+
+#ifdef CONFIG_CIFS_DEBUG2
+       cFYI(1, ("mode: 0x%x, access flags now 0x%x", mode, *pace_flags));
+#endif
+       return;
+}
+
+
+#ifdef CONFIG_CIFS_DEBUG2
+static void dump_ace(struct cifs_ace *pace, char *end_of_acl)
 {
        int num_subauth;
 
        /* validate that we do not go past end of acl */
 
-       /* XXX this if statement can be removed
-       if (end_of_acl < (char *)pace + sizeof(struct cifs_ace)) {
+       if (le16_to_cpu(pace->size) < 16) {
+               cERROR(1, ("ACE too small, %d", le16_to_cpu(pace->size)));
+               return;
+       }
+
+       if (end_of_acl < (char *)pace + le16_to_cpu(pace->size)) {
                cERROR(1, ("ACL too small to parse ACE"));
                return;
-       } */
+       }
 
-       num_subauth = pace->num_subauth;
+       num_subauth = pace->sid.num_subauth;
        if (num_subauth) {
-#ifdef CONFIG_CIFS_DEBUG2
                int i;
-               cFYI(1, ("ACE revision %d num_subauth %d",
-                       pace->revision, pace->num_subauth));
+               cFYI(1, ("ACE revision %d num_auth %d type %d flags %d size %d",
+                       pace->sid.revision, pace->sid.num_subauth, pace->type,
+                       pace->flags, pace->size));
                for (i = 0; i < num_subauth; ++i) {
                        cFYI(1, ("ACE sub_auth[%d]: 0x%x", i,
-                               le32_to_cpu(pace->sub_auth[i])));
+                               le32_to_cpu(pace->sid.sub_auth[i])));
                }
 
                /* BB add length check to make sure that we do not have huge
                        num auths and therefore go off the end */
-
-               cFYI(1, ("RID %d", le32_to_cpu(pace->sub_auth[num_subauth-1])));
-#endif
        }
 
        return;
 }
-
-static void parse_ntace(struct cifs_ntace *pntace, char *end_of_acl)
-{
-       /* validate that we do not go past end of acl */
-       if (end_of_acl < (char *)pntace + sizeof(struct cifs_ntace)) {
-               cERROR(1, ("ACL too small to parse NT ACE"));
-               return;
-       }
-
-#ifdef CONFIG_CIFS_DEBUG2
-       cFYI(1, ("NTACE type %d flags 0x%x size %d, access Req 0x%x",
-               pntace->type, pntace->flags, pntace->size,
-               pntace->access_req));
 #endif
-       return;
-}
-
 
 
 static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl,
-                      struct cifs_sid *pownersid, struct cifs_sid *pgrpsid)
+                      struct cifs_sid *pownersid, struct cifs_sid *pgrpsid,
+                      struct inode *inode)
 {
        int i;
        int num_aces = 0;
        int acl_size;
        char *acl_base;
-       struct cifs_ntace **ppntace;
        struct cifs_ace **ppace;
 
        /* BB need to add parm so we can store the SID BB */
 
+       if (!pdacl) {
+               /* no DACL in the security descriptor, set
+                  all the permissions for user/group/other */
+               inode->i_mode |= S_IRWXUGO;
+               return;
+       }
+
        /* validate that we do not go past end of acl */
        if (end_of_acl < (char *)pdacl + le16_to_cpu(pdacl->size)) {
                cERROR(1, ("ACL too small to parse DACL"));
@@ -205,50 +288,57 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl,
                le32_to_cpu(pdacl->num_aces)));
 #endif
 
+       /* reset rwx permissions for user/group/other.
+          Also, if num_aces is 0 i.e. DACL has no ACEs,
+          user/group/other have no permissions */
+       inode->i_mode &= ~(S_IRWXUGO);
+
        acl_base = (char *)pdacl;
        acl_size = sizeof(struct cifs_acl);
 
        num_aces = le32_to_cpu(pdacl->num_aces);
        if (num_aces  > 0) {
-               ppntace = kmalloc(num_aces * sizeof(struct cifs_ntace *),
-                               GFP_KERNEL);
+               umode_t user_mask = S_IRWXU;
+               umode_t group_mask = S_IRWXG;
+               umode_t other_mask = S_IRWXO;
+
                ppace = kmalloc(num_aces * sizeof(struct cifs_ace *),
                                GFP_KERNEL);
 
 /*             cifscred->cecount = pdacl->num_aces;
-               cifscred->ntaces = kmalloc(num_aces *
-                       sizeof(struct cifs_ntace *), GFP_KERNEL);
                cifscred->aces = kmalloc(num_aces *
                        sizeof(struct cifs_ace *), GFP_KERNEL);*/
 
                for (i = 0; i < num_aces; ++i) {
-                       ppntace[i] = (struct cifs_ntace *)
-                                       (acl_base + acl_size);
-                       ppace[i] = (struct cifs_ace *) ((char *)ppntace[i] +
-                                       sizeof(struct cifs_ntace));
-
-                       parse_ntace(ppntace[i], end_of_acl);
-                       if (end_of_acl < ((char *)ppace[i] +
-                                       (le16_to_cpu(ppntace[i]->size) -
-                                       sizeof(struct cifs_ntace)))) {
-                               cERROR(1, ("ACL too small to parse ACE"));
-                               break;
-                       } else
-                               parse_ace(ppace[i], end_of_acl);
-
-/*                     memcpy((void *)(&(cifscred->ntaces[i])),
-                               (void *)ppntace[i],
-                               sizeof(struct cifs_ntace));
-                       memcpy((void *)(&(cifscred->aces[i])),
+                       ppace[i] = (struct cifs_ace *) (acl_base + acl_size);
+#ifdef CONFIG_CIFS_DEBUG2
+                       dump_ace(ppace[i], end_of_acl);
+#endif
+                       if (compare_sids(&(ppace[i]->sid), pownersid))
+                               access_flags_to_mode(ppace[i]->access_req,
+                                                    ppace[i]->type,
+                                                    &(inode->i_mode),
+                                                    &user_mask);
+                       if (compare_sids(&(ppace[i]->sid), pgrpsid))
+                               access_flags_to_mode(ppace[i]->access_req,
+                                                    ppace[i]->type,
+                                                    &(inode->i_mode),
+                                                    &group_mask);
+                       if (compare_sids(&(ppace[i]->sid), &sid_everyone))
+                               access_flags_to_mode(ppace[i]->access_req,
+                                                    ppace[i]->type,
+                                                    &(inode->i_mode),
+                                                    &other_mask);
+
+/*                     memcpy((void *)(&(cifscred->aces[i])),
                                (void *)ppace[i],
                                sizeof(struct cifs_ace)); */
 
-                       acl_base = (char *)ppntace[i];
-                       acl_size = le16_to_cpu(ppntace[i]->size);
+                       acl_base = (char *)ppace[i];
+                       acl_size = le16_to_cpu(ppace[i]->size);
                }
 
                kfree(ppace);
-               kfree(ppntace);
        }
 
        return;
@@ -257,20 +347,20 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl,
 
 static int parse_sid(struct cifs_sid *psid, char *end_of_acl)
 {
-
        /* BB need to add parm so we can store the SID BB */
 
-       /* validate that we do not go past end of acl */
-       if (end_of_acl < (char *)psid + sizeof(struct cifs_sid)) {
-               cERROR(1, ("ACL too small to parse SID"));
+       /* validate that we do not go past end of ACL - sid must be at least 8
+          bytes long (assuming no sub-auths - e.g. the null SID */
+       if (end_of_acl < (char *)psid + 8) {
+               cERROR(1, ("ACL too small to parse SID %p", psid));
                return -EINVAL;
        }
 
        if (psid->num_subauth) {
 #ifdef CONFIG_CIFS_DEBUG2
                int i;
-               cFYI(1, ("SID revision %d num_auth %d First subauth 0x%x",
-                       psid->revision, psid->num_subauth, psid->sub_auth[0]));
+               cFYI(1, ("SID revision %d num_auth %d",
+                       psid->revision, psid->num_subauth));
 
                for (i = 0; i < psid->num_subauth; i++) {
                        cFYI(1, ("SID sub_auth[%d]: 0x%x ", i,
@@ -289,27 +379,32 @@ static int parse_sid(struct cifs_sid *psid, char *end_of_acl)
 
 
 /* Convert CIFS ACL to POSIX form */
-int parse_sec_desc(struct cifs_ntsd *pntsd, int acl_len)
+static int parse_sec_desc(struct cifs_ntsd *pntsd, int acl_len,
+                         struct inode *inode)
 {
        int rc;
        struct cifs_sid *owner_sid_ptr, *group_sid_ptr;
        struct cifs_acl *dacl_ptr; /* no need for SACL ptr */
        char *end_of_acl = ((char *)pntsd) + acl_len;
+       __u32 dacloffset;
+
+       if ((inode == NULL) || (pntsd == NULL))
+               return -EIO;
 
        owner_sid_ptr = (struct cifs_sid *)((char *)pntsd +
                                le32_to_cpu(pntsd->osidoffset));
        group_sid_ptr = (struct cifs_sid *)((char *)pntsd +
                                le32_to_cpu(pntsd->gsidoffset));
-       dacl_ptr = (struct cifs_acl *)((char *)pntsd +
-                               le32_to_cpu(pntsd->dacloffset));
+       dacloffset = le32_to_cpu(pntsd->dacloffset);
+       dacl_ptr = (struct cifs_acl *)((char *)pntsd + dacloffset);
 #ifdef CONFIG_CIFS_DEBUG2
        cFYI(1, ("revision %d type 0x%x ooffset 0x%x goffset 0x%x "
                 "sacloffset 0x%x dacloffset 0x%x",
                 pntsd->revision, pntsd->type, le32_to_cpu(pntsd->osidoffset),
                 le32_to_cpu(pntsd->gsidoffset),
-                le32_to_cpu(pntsd->sacloffset),
-                le32_to_cpu(pntsd->dacloffset)));
+                le32_to_cpu(pntsd->sacloffset), dacloffset));
 #endif
+/*     cifs_dump_mem("owner_sid: ", owner_sid_ptr, 64); */
        rc = parse_sid(owner_sid_ptr, end_of_acl);
        if (rc)
                return rc;
@@ -318,16 +413,120 @@ int parse_sec_desc(struct cifs_ntsd *pntsd, int acl_len)
        if (rc)
                return rc;
 
-       parse_dacl(dacl_ptr, end_of_acl, owner_sid_ptr, group_sid_ptr);
+       if (dacloffset)
+               parse_dacl(dacl_ptr, end_of_acl, owner_sid_ptr,
+                          group_sid_ptr, inode);
+       else
+               cFYI(1, ("no ACL")); /* BB grant all or default perms? */
 
 /*     cifscred->uid = owner_sid_ptr->rid;
        cifscred->gid = group_sid_ptr->rid;
        memcpy((void *)(&(cifscred->osid)), (void *)owner_sid_ptr,
-                       sizeof (struct cifs_sid));
+                       sizeof(struct cifs_sid));
        memcpy((void *)(&(cifscred->gsid)), (void *)group_sid_ptr,
-                       sizeof (struct cifs_sid)); */
+                       sizeof(struct cifs_sid)); */
 
 
        return (0);
 }
+
+
+/* Retrieve an ACL from the server */
+static struct cifs_ntsd *get_cifs_acl(u32 *pacllen, struct inode *inode,
+                                      const char *path)
+{
+       struct cifsFileInfo *open_file;
+       int unlock_file = FALSE;
+       int xid;
+       int rc = -EIO;
+       __u16 fid;
+       struct super_block *sb;
+       struct cifs_sb_info *cifs_sb;
+       struct cifs_ntsd *pntsd = NULL;
+
+       cFYI(1, ("get mode from ACL for %s", path));
+
+       if (inode == NULL)
+               return NULL;
+
+       xid = GetXid();
+       open_file = find_readable_file(CIFS_I(inode));
+       sb = inode->i_sb;
+       if (sb == NULL) {
+               FreeXid(xid);
+               return NULL;
+       }
+       cifs_sb = CIFS_SB(sb);
+
+       if (open_file) {
+               unlock_file = TRUE;
+               fid = open_file->netfid;
+       } else {
+               int oplock = FALSE;
+               /* open file */
+               rc = CIFSSMBOpen(xid, cifs_sb->tcon, path, FILE_OPEN,
+                               READ_CONTROL, 0, &fid, &oplock, NULL,
+                               cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
+                                       CIFS_MOUNT_MAP_SPECIAL_CHR);
+               if (rc != 0) {
+                       cERROR(1, ("Unable to open file to get ACL"));
+                       FreeXid(xid);
+                       return NULL;
+               }
+       }
+
+       rc = CIFSSMBGetCIFSACL(xid, cifs_sb->tcon, fid, &pntsd, pacllen);
+       cFYI(1, ("GetCIFSACL rc = %d ACL len %d", rc, *pacllen));
+       if (unlock_file == TRUE)
+               atomic_dec(&open_file->wrtPending);
+       else
+               CIFSSMBClose(xid, cifs_sb->tcon, fid);
+
+       FreeXid(xid);
+       return pntsd;
+}
+
+/* Translate the CIFS ACL (simlar to NTFS ACL) for a file into mode bits */
+void acl_to_uid_mode(struct inode *inode, const char *path)
+{
+       struct cifs_ntsd *pntsd = NULL;
+       u32 acllen = 0;
+       int rc = 0;
+
+#ifdef CONFIG_CIFS_DEBUG2
+       cFYI(1, ("converting ACL to mode for %s", path));
+#endif
+       pntsd = get_cifs_acl(&acllen, inode, path);
+
+       /* if we can retrieve the ACL, now parse Access Control Entries, ACEs */
+       if (pntsd)
+               rc = parse_sec_desc(pntsd, acllen, inode);
+       if (rc)
+               cFYI(1, ("parse sec desc failed rc = %d", rc));
+
+       kfree(pntsd);
+       return;
+}
+
+/* Convert mode bits to an ACL so we can update the ACL on the server */
+int mode_to_acl(struct inode *inode, const char *path)
+{
+       int rc = 0;
+       __u32 acllen = 0;
+       struct cifs_ntsd *pntsd = NULL;
+
+       cFYI(1, ("set ACL from mode for %s", path));
+
+       /* Get the security descriptor */
+       pntsd = get_cifs_acl(&acllen, inode, path);
+
+       /* Add/Modify the three ACEs for owner, group, everyone
+          while retaining the other ACEs */
+
+       /* Set the security descriptor */
+
+
+       kfree(pntsd);
+       return rc;
+}
 #endif /* CONFIG_CIFS_EXPERIMENTAL */
index 420f87813647b9b9307ce484b3813f59180247a4..93a7c3462ea27c7c3080bbc963f545ba51fe1286 100644 (file)
@@ -35,6 +35,9 @@
 #define UBITSHIFT      6
 #define GBITSHIFT      3
 
+#define ACCESS_ALLOWED 0
+#define ACCESS_DENIED  1
+
 struct cifs_ntsd {
        __le16 revision; /* revision level */
        __le16 type;
@@ -48,7 +51,7 @@ struct cifs_sid {
        __u8 revision; /* revision level */
        __u8 num_subauth;
        __u8 authority[6];
-       __le32 sub_auth[5]; /* sub_auth[num_subauth] */ /* BB FIXME endianness BB */
+       __le32 sub_auth[5]; /* sub_auth[num_subauth] */
 } __attribute__((packed));
 
 struct cifs_acl {
@@ -57,18 +60,12 @@ struct cifs_acl {
        __le32 num_aces;
 } __attribute__((packed));
 
-struct cifs_ntace { /* first part of ACE which contains perms */
+struct cifs_ace {
        __u8 type;
        __u8 flags;
        __le16 size;
        __le32 access_req;
-} __attribute__((packed));
-
-struct cifs_ace { /* last part of ACE which includes user info */
-       __u8 revision; /* revision level */
-       __u8 num_subauth;
-       __u8 authority[6];
-       __le32 sub_auth[5];
+       struct cifs_sid sid; /* ie UUID of user or group who gets these perms */
 } __attribute__((packed));
 
 struct cifs_wksid {
@@ -79,7 +76,7 @@ struct cifs_wksid {
 #ifdef CONFIG_CIFS_EXPERIMENTAL
 
 extern int match_sid(struct cifs_sid *);
-extern int compare_sids(struct cifs_sid *, struct cifs_sid *);
+extern int compare_sids(const struct cifs_sid *, const struct cifs_sid *);
 
 #endif /*  CONFIG_CIFS_EXPERIMENTAL */
 
index 632070b4275d91ba46baa1d735b578aeca555462..4ff8939c6cc7b51543170ab8c28d4a54d450f483 100644 (file)
@@ -99,15 +99,16 @@ static int cifs_calc_signature2(const struct kvec *iov, int n_vec,
        MD5Init(&context);
        MD5Update(&context, (char *)&key->data, key->len);
        for (i = 0; i < n_vec; i++) {
+               if (iov[i].iov_len == 0)
+                       continue;
                if (iov[i].iov_base == NULL) {
                        cERROR(1, ("null iovec entry"));
                        return -EIO;
-               } else if (iov[i].iov_len == 0)
-                       break; /* bail out if we are sent nothing to sign */
+               }
                /* The first entry includes a length field (which does not get
                   signed that occupies the first 4 bytes before the header */
                if (i == 0) {
-                       if (iov[0].iov_len <= 8 ) /* cmd field at offset 9 */
+                       if (iov[0].iov_len <= 8) /* cmd field at offset 9 */
                                break; /* nothing to sign or corrupt header */
                        MD5Update(&context, iov[0].iov_base+4,
                                  iov[0].iov_len-4);
@@ -122,7 +123,7 @@ static int cifs_calc_signature2(const struct kvec *iov, int n_vec,
 
 
 int cifs_sign_smb2(struct kvec *iov, int n_vec, struct TCP_Server_Info *server,
-                  __u32 * pexpected_response_sequence_number)
+                  __u32 *pexpected_response_sequence_number)
 {
        int rc = 0;
        char smb_signature[20];
index a6fbea57c4b1e6d895375ed10e8ef636995d763e..093beaa3900de3321a2062143daeb04f7e6b17b2 100644 (file)
@@ -43,6 +43,8 @@
 #include "cifs_debug.h"
 #include "cifs_fs_sb.h"
 #include <linux/mm.h>
+#include <linux/key-type.h>
+#include "cifs_spnego.h"
 #define CIFS_MAGIC_NUMBER 0xFF534D42   /* the first four bytes of SMB PDUs */
 
 #ifdef CONFIG_CIFS_QUOTA
@@ -264,6 +266,7 @@ cifs_alloc_inode(struct super_block *sb)
        cifs_inode->cifsAttrs = 0x20;   /* default */
        atomic_set(&cifs_inode->inUse, 0);
        cifs_inode->time = 0;
+       cifs_inode->write_behind_rc = 0;
        /* Until the file is open and we have gotten oplock
        info back from the server, can not assume caching of
        file data or metadata */
@@ -850,7 +853,7 @@ static int cifs_oplock_thread(void *dummyarg)
        struct cifsTconInfo *pTcon;
        struct inode *inode;
        __u16  netfid;
-       int rc;
+       int rc, waitrc = 0;
 
        set_freezable();
        do {
@@ -882,9 +885,11 @@ static int cifs_oplock_thread(void *dummyarg)
                                           filemap_fdatawrite(inode->i_mapping);
                                        if (CIFS_I(inode)->clientCanCacheRead
                                                                         == 0) {
-                                               filemap_fdatawait(inode->i_mapping);
+                                               waitrc = filemap_fdatawait(inode->i_mapping);
                                                invalidate_remote_inode(inode);
                                        }
+                                       if (rc == 0)
+                                               rc = waitrc;
                                } else
                                        rc = 0;
                                /* mutex_unlock(&inode->i_mutex);*/
@@ -1005,12 +1010,16 @@ init_cifs(void)
        rc = register_filesystem(&cifs_fs_type);
        if (rc)
                goto out_destroy_request_bufs;
-
+#ifdef CONFIG_CIFS_UPCALL
+       rc = register_key_type(&cifs_spnego_key_type);
+       if (rc)
+               goto out_unregister_filesystem;
+#endif
        oplockThread = kthread_run(cifs_oplock_thread, NULL, "cifsoplockd");
        if (IS_ERR(oplockThread)) {
                rc = PTR_ERR(oplockThread);
                cERROR(1, ("error %d create oplock thread", rc));
-               goto out_unregister_filesystem;
+               goto out_unregister_key_type;
        }
 
        dnotifyThread = kthread_run(cifs_dnotify_thread, NULL, "cifsdnotifyd");
@@ -1024,7 +1033,11 @@ init_cifs(void)
 
  out_stop_oplock_thread:
        kthread_stop(oplockThread);
+ out_unregister_key_type:
+#ifdef CONFIG_CIFS_UPCALL
+       unregister_key_type(&cifs_spnego_key_type);
  out_unregister_filesystem:
+#endif
        unregister_filesystem(&cifs_fs_type);
  out_destroy_request_bufs:
        cifs_destroy_request_bufs();
@@ -1045,6 +1058,9 @@ exit_cifs(void)
        cFYI(0, ("exit_cifs"));
 #ifdef CONFIG_PROC_FS
        cifs_proc_clean();
+#endif
+#ifdef CONFIG_CIFS_UPCALL
+       unregister_key_type(&cifs_spnego_key_type);
 #endif
        unregister_filesystem(&cifs_fs_type);
        cifs_destroy_inodecache();
index 5574ba3ab1f9c3c669b5f3e606bff729bcc2ebd6..2a21dc66f0de20be9544887d6312aa9b3394bac1 100644 (file)
@@ -106,5 +106,5 @@ extern int cifs_ioctl(struct inode *inode, struct file *filep,
 extern const struct export_operations cifs_export_ops;
 #endif /* EXPERIMENTAL */
 
-#define CIFS_VERSION   "1.51"
+#define CIFS_VERSION   "1.52"
 #endif                         /* _CIFSFS_H */
index 87f51f23276f42f23d054679042fb92b1ace313f..1fde2197ad764172622356d0e257b669ea7912cd 100644 (file)
@@ -110,6 +110,7 @@ struct mac_key {
        unsigned int len;
        union {
                char ntlm[CIFS_SESS_KEY_SIZE + 16];
+               char krb5[CIFS_SESS_KEY_SIZE + 16]; /* BB: length correct? */
                struct {
                        char key[16];
                        struct ntlmv2_resp resp;
@@ -139,6 +140,7 @@ struct TCP_Server_Info {
        /* 15 character server name + 0x20 16th byte indicating type = srv */
        char server_RFC1001_name[SERVER_NAME_LEN_WITH_NULL];
        char unicode_server_Name[SERVER_NAME_LEN_WITH_NULL * 2];
+       char *hostname; /* hostname portion of UNC string */
        struct socket *ssocket;
        union {
                struct sockaddr_in sockAddr;
@@ -471,6 +473,17 @@ struct dir_notify_req {
 #define   CIFS_LARGE_BUFFER     2
 #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_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 */
+
 /* Security Flags: indicate type of session setup needed */
 #define   CIFSSEC_MAY_SIGN     0x00001
 #define   CIFSSEC_MAY_NTLM     0x00002
index c41ff74e9128b91af914930334b241fd3c0d313f..dbe6b846f37f0f476d83d59804aefde6e4d75881 100644 (file)
                                | FILE_WRITE_EA | FILE_WRITE_ATTRIBUTES)
 #define FILE_EXEC_RIGHTS (FILE_EXECUTE)
 
+#define SET_FILE_READ_RIGHTS (FILE_READ_DATA | FILE_READ_EA | FILE_WRITE_EA \
+                               | FILE_READ_ATTRIBUTES \
+                               | FILE_WRITE_ATTRIBUTES \
+                               | DELETE | READ_CONTROL | WRITE_DAC \
+                               | WRITE_OWNER | SYNCHRONIZE)
+#define SET_FILE_WRITE_RIGHTS (FILE_WRITE_DATA | FILE_APPEND_DATA \
+                               | FILE_READ_EA | FILE_WRITE_EA \
+                               | FILE_DELETE_CHILD | FILE_READ_ATTRIBUTES \
+                               | FILE_WRITE_ATTRIBUTES \
+                               | DELETE | READ_CONTROL | WRITE_DAC \
+                               | WRITE_OWNER | SYNCHRONIZE)
+#define SET_FILE_EXEC_RIGHTS (FILE_READ_EA | FILE_WRITE_EA | FILE_EXECUTE \
+                               | FILE_READ_ATTRIBUTES \
+                               | FILE_WRITE_ATTRIBUTES \
+                               | DELETE | READ_CONTROL | WRITE_DAC \
+                               | WRITE_OWNER | SYNCHRONIZE)
+
 
 /*
  * Invalid readdir handle
@@ -1211,6 +1228,29 @@ typedef struct smb_com_transaction_qsec_req {
        __le32 AclFlags;
 } __attribute__((packed)) QUERY_SEC_DESC_REQ;
 
+
+typedef struct smb_com_transaction_ssec_req {
+       struct smb_hdr hdr;     /* wct = 19 */
+       __u8 MaxSetupCount;
+       __u16 Reserved;
+       __le32 TotalParameterCount;
+       __le32 TotalDataCount;
+       __le32 MaxParameterCount;
+       __le32 MaxDataCount;
+       __le32 ParameterCount;
+       __le32 ParameterOffset;
+       __le32 DataCount;
+       __le32 DataOffset;
+       __u8 SetupCount; /* no setup words follow subcommand */
+       /* SNIA spec incorrectly included spurious pad here */
+       __le16 SubCommand; /* 3 = SET_SECURITY_DESC */
+       __le16 ByteCount; /* bcc = 3 + 8 */
+       __u8 Pad[3];
+       __u16 Fid;
+       __u16 Reserved2;
+       __le32 AclFlags;
+} __attribute__((packed)) SET_SEC_DESC_REQ;
+
 typedef struct smb_com_transaction_change_notify_req {
        struct smb_hdr hdr;     /* wct = 23 */
        __u8 MaxSetupCount;
index 1a883663b22dfcc51eac71da6fc8930bf5b7d3e6..8350eec49663bef6f139c1af0ddd1cee5fabbbfe 100644 (file)
@@ -48,10 +48,11 @@ extern int SendReceive(const unsigned int /* xid */ , struct cifsSesInfo *,
                        struct smb_hdr * /* input */ ,
                        struct smb_hdr * /* out */ ,
                        int * /* bytes returned */ , const int long_op);
+extern int SendReceiveNoRsp(const unsigned int xid, struct cifsSesInfo *ses,
+                       struct smb_hdr *in_buf, int flags);
 extern int SendReceive2(const unsigned int /* xid */ , struct cifsSesInfo *,
                        struct kvec *, int /* nvec to send */,
-                       int * /* type of buf returned */ , const int long_op,
-                       const int logError /* whether to log status code*/ );
+                       int * /* type of buf returned */ , const int flags);
 extern int SendReceiveBlockingLock(const unsigned int /* xid */ ,
                                        struct cifsTconInfo *,
                                struct smb_hdr * /* input */ ,
@@ -61,6 +62,9 @@ extern int checkSMB(struct smb_hdr *smb, __u16 mid, unsigned int length);
 extern int is_valid_oplock_break(struct smb_hdr *smb, struct TCP_Server_Info *);
 extern int is_size_safe_to_change(struct cifsInodeInfo *, __u64 eof);
 extern struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *);
+#ifdef CONFIG_CIFS_EXPERIMENTAL
+extern struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *);
+#endif
 extern unsigned int smbCalcSize(struct smb_hdr *ptr);
 extern unsigned int smbCalcSize_LE(struct smb_hdr *ptr);
 extern int decode_negTokenInit(unsigned char *security_blob, int length,
@@ -92,6 +96,8 @@ extern int cifs_get_inode_info(struct inode **pinode,
 extern int cifs_get_inode_info_unix(struct inode **pinode,
                        const unsigned char *search_path,
                        struct super_block *sb, int xid);
+extern void acl_to_uid_mode(struct inode *inode, const char *search_path);
+extern int mode_to_acl(struct inode *inode, const char *path);
 
 extern int cifs_mount(struct super_block *, struct cifs_sb_info *, char *,
                        const char *);
@@ -241,15 +247,15 @@ extern int CIFSSMBQueryReparseLinkInfo(const int xid,
 extern int CIFSSMBOpen(const int xid, struct cifsTconInfo *tcon,
                        const char *fileName, const int disposition,
                        const int access_flags, const int omode,
-                       __u16 * netfid, int *pOplock, FILE_ALL_INFO *,
+                       __u16 *netfid, int *pOplock, FILE_ALL_INFO *,
                        const struct nls_table *nls_codepage, int remap);
 extern int SMBLegacyOpen(const int xid, struct cifsTconInfo *tcon,
                        const char *fileName, const int disposition,
                        const int access_flags, const int omode,
-                       __u16 * netfid, int *pOplock, FILE_ALL_INFO *,
+                       __u16 *netfid, int *pOplock, FILE_ALL_INFO *,
                        const struct nls_table *nls_codepage, int remap);
 extern int CIFSPOSIXCreate(const int xid, struct cifsTconInfo *tcon,
-                       u32 posix_flags, __u64 mode, __u16 * netfid,
+                       u32 posix_flags, __u64 mode, __u16 *netfid,
                        FILE_UNIX_BASIC_INFO *pRetData,
                        __u32 *pOplock, const char *name,
                        const struct nls_table *nls_codepage, int remap);
@@ -270,7 +276,7 @@ extern int CIFSSMBWrite2(const int xid, struct cifsTconInfo *tcon,
                        const __u64 offset, unsigned int *nbytes,
                        struct kvec *iov, const int nvec, const int long_op);
 extern int CIFSGetSrvInodeNumber(const int xid, struct cifsTconInfo *tcon,
-                       const unsigned char *searchName, __u64 * inode_number,
+                       const unsigned char *searchName, __u64 *inode_number,
                        const struct nls_table *nls_codepage,
                        int remap_special_chars);
 extern int cifs_convertUCSpath(char *target, const __le16 *source, int maxlen,
@@ -311,7 +317,6 @@ extern void setup_ntlmv2_rsp(struct cifsSesInfo *, char *,
 #ifdef CONFIG_CIFS_WEAK_PW_HASH
 extern void calc_lanman_hash(struct cifsSesInfo *ses, char *lnm_session_key);
 #endif /* CIFS_WEAK_PW_HASH */
-extern int parse_sec_desc(struct cifs_ntsd *, int);
 extern int CIFSSMBCopy(int xid,
                        struct cifsTconInfo *source_tcon,
                        const char *fromName,
@@ -336,8 +341,7 @@ extern int CIFSSMBSetEA(const int xid, struct cifsTconInfo *tcon,
                const void *ea_value, const __u16 ea_value_len,
                const struct nls_table *nls_codepage, int remap_special_chars);
 extern int CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon,
-                       __u16 fid, char *acl_inf, const int buflen,
-                       const int acl_type /* ACCESS vs. DEFAULT */);
+                       __u16 fid, struct cifs_ntsd **acl_inf, __u32 *buflen);
 extern int CIFSSMBGetPosixACL(const int xid, struct cifsTconInfo *tcon,
                const unsigned char *searchName,
                char *acl_inf, const int buflen, const int acl_type,
@@ -347,5 +351,5 @@ extern int CIFSSMBSetPosixACL(const int xid, struct cifsTconInfo *tcon,
                const char *local_acl, const int buflen, const int acl_type,
                const struct nls_table *nls_codepage, int remap_special_chars);
 extern int CIFSGetExtAttr(const int xid, struct cifsTconInfo *tcon,
-                       const int netfid, __u64 * pExtAttrBits, __u64 *pMask);
+                       const int netfid, __u64 *pExtAttrBits, __u64 *pMask);
 #endif                 /* _CIFSPROTO_H */
index f0d9a485d0951f29c3f140ebda33391d7471a53d..9e8a6bef029a8bdd5a607d744205200bb236866f 100644 (file)
@@ -647,8 +647,7 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
                                                 count - 16,
                                                 &server->secType);
                        if (rc == 1) {
-                       /* BB Need to fill struct for sessetup here */
-                               rc = -EOPNOTSUPP;
+                               rc = 0;
                        } else {
                                rc = -EINVAL;
                        }
@@ -699,9 +698,7 @@ int
 CIFSSMBTDis(const int xid, struct cifsTconInfo *tcon)
 {
        struct smb_hdr *smb_buffer;
-       struct smb_hdr *smb_buffer_response; /* BB removeme BB */
        int rc = 0;
-       int length;
 
        cFYI(1, ("In tree disconnect"));
        /*
@@ -738,16 +735,12 @@ CIFSSMBTDis(const int xid, struct cifsTconInfo *tcon)
        if (rc) {
                up(&tcon->tconSem);
                return rc;
-       } else {
-               smb_buffer_response = smb_buffer; /* BB removeme BB */
        }
-       rc = SendReceive(xid, tcon->ses, smb_buffer, smb_buffer_response,
-                        &length, 0);
+
+       rc = SendReceiveNoRsp(xid, tcon->ses, smb_buffer, 0);
        if (rc)
                cFYI(1, ("Tree disconnect failed %d", rc));
 
-       if (smb_buffer)
-               cifs_small_buf_release(smb_buffer);
        up(&tcon->tconSem);
 
        /* No need to return error on this operation if tid invalidated and
@@ -761,10 +754,8 @@ CIFSSMBTDis(const int xid, struct cifsTconInfo *tcon)
 int
 CIFSSMBLogoff(const int xid, struct cifsSesInfo *ses)
 {
-       struct smb_hdr *smb_buffer_response;
        LOGOFF_ANDX_REQ *pSMB;
        int rc = 0;
-       int length;
 
        cFYI(1, ("In SMBLogoff for session disconnect"));
        if (ses)
@@ -783,8 +774,6 @@ CIFSSMBLogoff(const int xid, struct cifsSesInfo *ses)
                return rc;
        }
 
-       smb_buffer_response = (struct smb_hdr *)pSMB; /* BB removeme BB */
-
        if (ses->server) {
                pSMB->hdr.Mid = GetNextMid(ses->server);
 
@@ -796,8 +785,7 @@ CIFSSMBLogoff(const int xid, struct cifsSesInfo *ses)
        pSMB->hdr.Uid = ses->Suid;
 
        pSMB->AndXCommand = 0xFF;
-       rc = SendReceive(xid, ses, (struct smb_hdr *) pSMB,
-                        smb_buffer_response, &length, 0);
+       rc = SendReceiveNoRsp(xid, ses, (struct smb_hdr *) pSMB, 0);
        if (ses->server) {
                atomic_dec(&ses->server->socketUseCount);
                if (atomic_read(&ses->server->socketUseCount) == 0) {
@@ -808,7 +796,6 @@ CIFSSMBLogoff(const int xid, struct cifsSesInfo *ses)
                }
        }
        up(&ses->sesSem);
-       cifs_small_buf_release(pSMB);
 
        /* if session dead then we do not need to do ulogoff,
                since server closed smb session, no sense reporting
@@ -1256,7 +1243,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, 1);
+                       (struct smb_hdr *)pSMBr, &bytes_returned, CIFS_LONG_OP);
        cifs_stats_inc(&tcon->num_opens);
        if (rc) {
                cFYI(1, ("Error in Open = %d", rc));
@@ -1369,7 +1356,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, 1);
+                       (struct smb_hdr *)pSMBr, &bytes_returned, CIFS_LONG_OP);
        cifs_stats_inc(&tcon->num_opens);
        if (rc) {
                cFYI(1, ("Error in Open = %d", rc));
@@ -1447,7 +1434,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, 0 /* not long op */, 1 /* log err */ );
+                        &resp_buf_type, CIFS_STD_OP | CIFS_LOG_ERROR);
        cifs_stats_inc(&tcon->num_reads);
        pSMBr = (READ_RSP *)iov[0].iov_base;
        if (rc) {
@@ -1666,7 +1653,7 @@ CIFSSMBWrite2(const int xid, struct cifsTconInfo *tcon,
 
 
        rc = SendReceive2(xid, tcon->ses, iov, n_vec + 1, &resp_buf_type,
-                         long_op, 0 /* do not log STATUS code */ );
+                         long_op);
        cifs_stats_inc(&tcon->num_writes);
        if (rc) {
                cFYI(1, ("Send error Write2 = %d", rc));
@@ -1708,7 +1695,7 @@ CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
        int timeout = 0;
        __u16 count;
 
-       cFYI(1, ("In CIFSSMBLock - timeout %d numLock %d", waitFlag, numLock));
+       cFYI(1, ("CIFSSMBLock timeout %d numLock %d", waitFlag, numLock));
        rc = small_smb_init(SMB_COM_LOCKING_ANDX, 8, tcon, (void **) &pSMB);
 
        if (rc)
@@ -1717,10 +1704,10 @@ CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
        pSMBr = (LOCK_RSP *)pSMB; /* BB removeme BB */
 
        if (lockType == LOCKING_ANDX_OPLOCK_RELEASE) {
-               timeout = -1; /* no response expected */
+               timeout = CIFS_ASYNC_OP; /* no response expected */
                pSMB->Timeout = 0;
        } else if (waitFlag == TRUE) {
-               timeout = 3;  /* blocking operation, no timeout */
+               timeout = CIFS_BLOCKING_OP; /* blocking operation, no timeout */
                pSMB->Timeout = cpu_to_le32(-1);/* blocking - do not time out */
        } else {
                pSMB->Timeout = 0;
@@ -1750,15 +1737,16 @@ CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
        if (waitFlag) {
                rc = SendReceiveBlockingLock(xid, tcon, (struct smb_hdr *) pSMB,
                        (struct smb_hdr *) pSMBr, &bytes_returned);
+               cifs_small_buf_release(pSMB);
        } else {
-               rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
-                        (struct smb_hdr *) pSMBr, &bytes_returned, timeout);
+               rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *)pSMB,
+                                     timeout);
+               /* SMB buffer freed by function above */
        }
        cifs_stats_inc(&tcon->num_locks);
        if (rc) {
                cFYI(1, ("Send error in Lock = %d", rc));
        }
-       cifs_small_buf_release(pSMB);
 
        /* Note: On -EAGAIN error only caller can retry on handle based calls
        since file handle passed in no longer valid */
@@ -1777,7 +1765,9 @@ CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon,
        int rc = 0;
        int timeout = 0;
        int bytes_returned = 0;
+       int resp_buf_type = 0;
        __u16 params, param_offset, offset, byte_count, count;
+       struct kvec iov[1];
 
        cFYI(1, ("Posix Lock"));
 
@@ -1819,7 +1809,7 @@ CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon,
 
        parm_data->lock_type = cpu_to_le16(lock_type);
        if (waitFlag) {
-               timeout = 3;  /* blocking operation, no timeout */
+               timeout = CIFS_BLOCKING_OP; /* blocking operation, no timeout */
                parm_data->lock_flags = cpu_to_le16(1);
                pSMB->Timeout = cpu_to_le32(-1);
        } else
@@ -1839,8 +1829,13 @@ CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon,
                rc = SendReceiveBlockingLock(xid, tcon, (struct smb_hdr *) pSMB,
                        (struct smb_hdr *) pSMBr, &bytes_returned);
        } else {
-               rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
-                       (struct smb_hdr *) pSMBr, &bytes_returned, timeout);
+               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, timeout);
+               pSMB = NULL; /* request buf already freed by SendReceive2. Do
+                               not try to free it twice below on exit */
+               pSMBr = (struct smb_com_transaction2_sfi_rsp *)iov[0].iov_base;
        }
 
        if (rc) {
@@ -1875,6 +1870,11 @@ plk_err_exit:
        if (pSMB)
                cifs_small_buf_release(pSMB);
 
+       if (resp_buf_type == CIFS_SMALL_BUFFER)
+               cifs_small_buf_release(iov[0].iov_base);
+       else if (resp_buf_type == CIFS_LARGE_BUFFER)
+               cifs_buf_release(iov[0].iov_base);
+
        /* Note: On -EAGAIN error only caller can retry on handle based calls
           since file handle passed in no longer valid */
 
@@ -1887,8 +1887,6 @@ CIFSSMBClose(const int xid, struct cifsTconInfo *tcon, int smb_file_id)
 {
        int rc = 0;
        CLOSE_REQ *pSMB = NULL;
-       CLOSE_RSP *pSMBr = NULL;
-       int bytes_returned;
        cFYI(1, ("In CIFSSMBClose"));
 
 /* do not retry on dead session on close */
@@ -1898,13 +1896,10 @@ CIFSSMBClose(const int xid, struct cifsTconInfo *tcon, int smb_file_id)
        if (rc)
                return rc;
 
-       pSMBr = (CLOSE_RSP *)pSMB; /* BB removeme BB */
-
        pSMB->FileID = (__u16) smb_file_id;
        pSMB->LastWriteTime = 0xFFFFFFFF;
        pSMB->ByteCount = 0;
-       rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
-                        (struct smb_hdr *) pSMBr, &bytes_returned, 0);
+       rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0);
        cifs_stats_inc(&tcon->num_closes);
        if (rc) {
                if (rc != -EINTR) {
@@ -1913,8 +1908,6 @@ CIFSSMBClose(const int xid, struct cifsTconInfo *tcon, int smb_file_id)
                }
        }
 
-       cifs_small_buf_release(pSMB);
-
        /* Since session is dead, file will be closed on server already */
        if (rc == -EAGAIN)
                rc = 0;
@@ -2486,6 +2479,7 @@ querySymLinkRetry:
        return rc;
 }
 
+#ifdef CONFIG_CIFS_EXPERIMENTAL
 /* Initialize NT TRANSACT SMB into small smb request buffer.
    This assumes that all NT TRANSACTS that we init here have
    total parm and data under about 400 bytes (to fit in small cifs
@@ -2494,7 +2488,7 @@ querySymLinkRetry:
        MaxSetupCount (size of returned setup area) and
        MaxParameterCount (returned parms size) must be set by caller */
 static int
-smb_init_ntransact(const __u16 sub_command, const int setup_count,
+smb_init_nttransact(const __u16 sub_command, const int setup_count,
                   const int parm_len, struct cifsTconInfo *tcon,
                   void **ret_buf)
 {
@@ -2525,12 +2519,15 @@ smb_init_ntransact(const __u16 sub_command, const int setup_count,
 
 static int
 validate_ntransact(char *buf, char **ppparm, char **ppdata,
-                  int *pdatalen, int *pparmlen)
+                  __u32 *pparmlen, __u32 *pdatalen)
 {
        char *end_of_smb;
        __u32 data_count, data_offset, parm_count, parm_offset;
        struct smb_com_ntransact_rsp *pSMBr;
 
+       *pdatalen = 0;
+       *pparmlen = 0;
+
        if (buf == NULL)
                return -EINVAL;
 
@@ -2567,8 +2564,11 @@ validate_ntransact(char *buf, char **ppparm, char **ppdata,
                cFYI(1, ("parm count and data count larger than SMB"));
                return -EINVAL;
        }
+       *pdatalen = data_count;
+       *pparmlen = parm_count;
        return 0;
 }
+#endif /* CIFS_EXPERIMENTAL */
 
 int
 CIFSSMBQueryReparseLinkInfo(const int xid, struct cifsTconInfo *tcon,
@@ -3067,8 +3067,7 @@ GetExtAttrOut:
 /* Get Security Descriptor (by handle) from remote server for a file or dir */
 int
 CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid,
-               /* BB fix up return info */ char *acl_inf, const int buflen,
-                 const int acl_type)
+                 struct cifs_ntsd **acl_inf, __u32 *pbuflen)
 {
        int rc = 0;
        int buf_type = 0;
@@ -3077,7 +3076,10 @@ CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid,
 
        cFYI(1, ("GetCifsACL"));
 
-       rc = smb_init_ntransact(NT_TRANSACT_QUERY_SECURITY_DESC, 0,
+       *pbuflen = 0;
+       *acl_inf = NULL;
+
+       rc = smb_init_nttransact(NT_TRANSACT_QUERY_SECURITY_DESC, 0,
                        8 /* parm len */, tcon, (void **) &pSMB);
        if (rc)
                return rc;
@@ -3094,39 +3096,57 @@ 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,
-                        0 /* not long op */, 0 /* do not log STATUS codes */ );
+                        CIFS_STD_OP);
        cifs_stats_inc(&tcon->num_acl_get);
        if (rc) {
                cFYI(1, ("Send error in QuerySecDesc = %d", rc));
        } else {                /* decode response */
-               struct cifs_ntsd *psec_desc;
                __le32 * parm;
-               int parm_len;
-               int data_len;
-               int acl_len;
+               __u32 parm_len;
+               __u32 acl_len;
                struct smb_com_ntransact_rsp *pSMBr;
+               char *pdata;
 
 /* validate_nttransact */
                rc = validate_ntransact(iov[0].iov_base, (char **)&parm,
-                                       (char **)&psec_desc,
-                                       &parm_len, &data_len);
+                                       &pdata, &parm_len, pbuflen);
                if (rc)
                        goto qsec_out;
                pSMBr = (struct smb_com_ntransact_rsp *)iov[0].iov_base;
 
-               cFYI(1, ("smb %p parm %p data %p", pSMBr, parm, psec_desc));
+               cFYI(1, ("smb %p parm %p data %p", pSMBr, parm, *acl_inf));
 
                if (le32_to_cpu(pSMBr->ParameterCount) != 4) {
                        rc = -EIO;      /* bad smb */
+                       *pbuflen = 0;
                        goto qsec_out;
                }
 
 /* BB check that data area is minimum length and as big as acl_len */
 
                acl_len = le32_to_cpu(*parm);
-               /* BB check if (acl_len > bufsize) */
+               if (acl_len != *pbuflen) {
+                       cERROR(1, ("acl length %d does not match %d",
+                                  acl_len, *pbuflen));
+                       if (*pbuflen > acl_len)
+                               *pbuflen = acl_len;
+               }
 
-               parse_sec_desc(psec_desc, acl_len);
+               /* check if buffer is big enough for the acl
+                  header followed by the smallest SID */
+               if ((*pbuflen < sizeof(struct cifs_ntsd) + 8) ||
+                   (*pbuflen >= 64 * 1024)) {
+                       cERROR(1, ("bad acl length %d", *pbuflen));
+                       rc = -EINVAL;
+                       *pbuflen = 0;
+               } else {
+                       *acl_inf = kmalloc(*pbuflen, GFP_KERNEL);
+                       if (*acl_inf == NULL) {
+                               *pbuflen = 0;
+                               rc = -ENOMEM;
+                       }
+                       memcpy(*acl_inf, pdata, *pbuflen);
+               }
        }
 qsec_out:
        if (buf_type == CIFS_SMALL_BUFFER)
@@ -3381,7 +3401,7 @@ UnixQPathInfoRetry:
                        memcpy((char *) pFindData,
                               (char *) &pSMBr->hdr.Protocol +
                               data_offset,
-                              sizeof (FILE_UNIX_BASIC_INFO));
+                              sizeof(FILE_UNIX_BASIC_INFO));
                }
        }
        cifs_buf_release(pSMB);
@@ -3649,7 +3669,7 @@ int CIFSFindNext(const int xid, struct cifsTconInfo *tcon,
        pSMB->SubCommand = cpu_to_le16(TRANS2_FIND_NEXT);
        pSMB->SearchHandle = searchHandle;      /* always kept as le */
        pSMB->SearchCount =
-               cpu_to_le16(CIFSMaxBufSize / sizeof (FILE_UNIX_INFO));
+               cpu_to_le16(CIFSMaxBufSize / sizeof(FILE_UNIX_INFO));
        pSMB->InformationLevel = cpu_to_le16(psrch_inf->info_level);
        pSMB->ResumeKey = psrch_inf->resume_key;
        pSMB->SearchFlags =
@@ -3737,8 +3757,6 @@ CIFSFindClose(const int xid, struct cifsTconInfo *tcon,
 {
        int rc = 0;
        FINDCLOSE_REQ *pSMB = NULL;
-       CLOSE_RSP *pSMBr = NULL; /* BB removeme BB */
-       int bytes_returned;
 
        cFYI(1, ("In CIFSSMBFindClose"));
        rc = small_smb_init(SMB_COM_FIND_CLOSE2, 1, tcon, (void **)&pSMB);
@@ -3750,16 +3768,13 @@ CIFSFindClose(const int xid, struct cifsTconInfo *tcon,
        if (rc)
                return rc;
 
-       pSMBr = (CLOSE_RSP *)pSMB;  /* BB removeme BB */
        pSMB->FileID = searchHandle;
        pSMB->ByteCount = 0;
-       rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
-                        (struct smb_hdr *) pSMBr, &bytes_returned, 0);
+       rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0);
        if (rc) {
                cERROR(1, ("Send error in FindClose = %d", rc));
        }
        cifs_stats_inc(&tcon->num_fclose);
-       cifs_small_buf_release(pSMB);
 
        /* Since session is dead, search handle closed on server already */
        if (rc == -EAGAIN)
@@ -4331,7 +4346,7 @@ QFSDeviceRetry:
        } else {                /* decode response */
                rc = validate_t2((struct smb_t2_rsp *)pSMBr);
 
-               if (rc || (pSMBr->ByteCount < sizeof (FILE_SYSTEM_DEVICE_INFO)))
+               if (rc || (pSMBr->ByteCount < sizeof(FILE_SYSTEM_DEVICE_INFO)))
                        rc = -EIO;      /* bad smb */
                else {
                        __u16 data_offset = le16_to_cpu(pSMBr->t2.DataOffset);
@@ -4681,11 +4696,9 @@ CIFSSMBSetFileSize(const int xid, struct cifsTconInfo *tcon, __u64 size,
                   __u16 fid, __u32 pid_of_opener, int SetAllocation)
 {
        struct smb_com_transaction2_sfi_req *pSMB  = NULL;
-       struct smb_com_transaction2_sfi_rsp *pSMBr = NULL;
        char *data_offset;
        struct file_end_of_file_info *parm_data;
        int rc = 0;
-       int bytes_returned = 0;
        __u16 params, param_offset, offset, byte_count, count;
 
        cFYI(1, ("SetFileSize (via SetFileInfo) %lld",
@@ -4695,8 +4708,6 @@ CIFSSMBSetFileSize(const int xid, struct cifsTconInfo *tcon, __u64 size,
        if (rc)
                return rc;
 
-       pSMBr = (struct smb_com_transaction2_sfi_rsp *)pSMB;
-
        pSMB->hdr.Pid = cpu_to_le16((__u16)pid_of_opener);
        pSMB->hdr.PidHigh = cpu_to_le16((__u16)(pid_of_opener >> 16));
 
@@ -4747,17 +4758,13 @@ CIFSSMBSetFileSize(const int xid, struct cifsTconInfo *tcon, __u64 size,
        pSMB->Reserved4 = 0;
        pSMB->hdr.smb_buf_length += byte_count;
        pSMB->ByteCount = cpu_to_le16(byte_count);
-       rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
-                        (struct smb_hdr *) pSMBr, &bytes_returned, 0);
+       rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0);
        if (rc) {
                cFYI(1,
                     ("Send error in SetFileInfo (SetFileSize) = %d",
                      rc));
        }
 
-       if (pSMB)
-               cifs_small_buf_release(pSMB);
-
        /* Note: On -EAGAIN error only caller can retry on handle based calls
                since file handle passed in no longer valid */
 
@@ -4775,10 +4782,8 @@ CIFSSMBSetFileTimes(const int xid, struct cifsTconInfo *tcon,
                    const FILE_BASIC_INFO *data, __u16 fid)
 {
        struct smb_com_transaction2_sfi_req *pSMB  = NULL;
-       struct smb_com_transaction2_sfi_rsp *pSMBr = NULL;
        char *data_offset;
        int rc = 0;
-       int bytes_returned = 0;
        __u16 params, param_offset, offset, byte_count, count;
 
        cFYI(1, ("Set Times (via SetFileInfo)"));
@@ -4787,8 +4792,6 @@ CIFSSMBSetFileTimes(const int xid, struct cifsTconInfo *tcon,
        if (rc)
                return rc;
 
-       pSMBr = (struct smb_com_transaction2_sfi_rsp *)pSMB;
-
        /* At this point there is no need to override the current pid
        with the pid of the opener, but that could change if we someday
        use an existing handle (rather than opening one on the fly) */
@@ -4828,14 +4831,11 @@ CIFSSMBSetFileTimes(const int xid, struct cifsTconInfo *tcon,
        pSMB->hdr.smb_buf_length += byte_count;
        pSMB->ByteCount = cpu_to_le16(byte_count);
        memcpy(data_offset, data, sizeof(FILE_BASIC_INFO));
-       rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
-                        (struct smb_hdr *) pSMBr, &bytes_returned, 0);
+       rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0);
        if (rc) {
                cFYI(1, ("Send error in Set Time (SetFileInfo) = %d", rc));
        }
 
-       cifs_small_buf_release(pSMB);
-
        /* Note: On -EAGAIN error only caller can retry on handle based calls
                since file handle passed in no longer valid */
 
@@ -5126,7 +5126,8 @@ int CIFSSMBNotify(const int xid, struct cifsTconInfo *tcon,
        pSMB->ByteCount = 0;
 
        rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
-                       (struct smb_hdr *) pSMBr, &bytes_returned, -1);
+                        (struct smb_hdr *)pSMBr, &bytes_returned,
+                        CIFS_ASYNC_OP);
        if (rc) {
                cFYI(1, ("Error in Notify = %d", rc));
        } else {
index 19ee11f7f35ad6188207d25edccb0af3b8cdad11..fd9147cdb5a98d76b8a354b3b2a8efd518aeb565 100644 (file)
@@ -160,7 +160,7 @@ cifs_reconnect(struct TCP_Server_Info *server)
        if (server->ssocket) {
                cFYI(1, ("State: 0x%x Flags: 0x%lx", server->ssocket->state,
                        server->ssocket->flags));
-               server->ssocket->ops->shutdown(server->ssocket, SEND_SHUTDOWN);
+               kernel_sock_shutdown(server->ssocket, SHUT_WR);
                cFYI(1, ("Post shutdown state: 0x%x Flags: 0x%lx",
                        server->ssocket->state,
                        server->ssocket->flags));
@@ -438,9 +438,9 @@ incomplete_rcv:
                        csocket = server->ssocket;
                        wake_up(&server->response_q);
                        continue;
-               } else if (length < 4) {
-                       cFYI(1, ("less than four bytes received (%d bytes)",
-                             length));
+               } else if (length < pdu_length) {
+                       cFYI(1, ("requested %d bytes but only got %d bytes",
+                                 pdu_length, length));
                        pdu_length -= length;
                        msleep(1);
                        goto incomplete_rcv;
@@ -752,6 +752,7 @@ multi_t2_fnd:
        }
        write_unlock(&GlobalSMBSeslock);
 
+       kfree(server->hostname);
        kfree(server);
        if (length  > 0)
                mempool_resize(cifs_req_poolp, length + cifs_min_rcv,
@@ -760,6 +761,34 @@ multi_t2_fnd:
        return 0;
 }
 
+/* extract the host portion of the UNC string */
+static char *
+extract_hostname(const char *unc)
+{
+       const char *src;
+       char *dst, *delim;
+       unsigned int len;
+
+       /* skip double chars at beginning of string */
+       /* BB: check validity of these bytes? */
+       src = unc + 2;
+
+       /* delimiter between hostname and sharename is always '\\' now */
+       delim = strchr(src, '\\');
+       if (!delim)
+               return ERR_PTR(-EINVAL);
+
+       len = delim - src;
+       dst = kmalloc((len + 1), GFP_KERNEL);
+       if (dst == NULL)
+               return ERR_PTR(-ENOMEM);
+
+       memcpy(dst, src, len);
+       dst[len] = '\0';
+
+       return dst;
+}
+
 static int
 cifs_parse_mount_options(char *options, const char *devname,
                         struct smb_vol *vol)
@@ -793,7 +822,7 @@ cifs_parse_mount_options(char *options, const char *devname,
        vol->linux_gid = current->gid;
        vol->dir_mode = S_IRWXUGO;
        /* 2767 perms indicate mandatory locking support */
-       vol->file_mode = S_IALLUGO & ~(S_ISUID | S_IXGRP);
+       vol->file_mode = (S_IRWXUGO | S_ISGID) & (~S_IXGRP);
 
        /* vol->retry default is 0 (i.e. "soft" limited retry not hard retry) */
        vol->rw = TRUE;
@@ -1781,16 +1810,13 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
 
        memset(&volume_info, 0, sizeof(struct smb_vol));
        if (cifs_parse_mount_options(mount_data, devname, &volume_info)) {
-               kfree(volume_info.UNC);
-               kfree(volume_info.password);
-               kfree(volume_info.prepath);
-               FreeXid(xid);
-               return -EINVAL;
+               rc = -EINVAL;
+               goto out;
        }
 
        if (volume_info.nullauth) {
                cFYI(1, ("null user"));
-               volume_info.username = NULL;
+               volume_info.username = "";
        } else if (volume_info.username) {
                /* BB fixme parse for domain name here */
                cFYI(1, ("Username: %s", volume_info.username));
@@ -1798,11 +1824,8 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
                cifserror("No username specified");
        /* In userspace mount helper we can get user name from alternate
           locations such as env variables and files on disk */
-               kfree(volume_info.UNC);
-               kfree(volume_info.password);
-               kfree(volume_info.prepath);
-               FreeXid(xid);
-               return -EINVAL;
+               rc = -EINVAL;
+               goto out;
        }
 
        if (volume_info.UNCip && volume_info.UNC) {
@@ -1821,11 +1844,8 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
 
                if (rc <= 0) {
                        /* we failed translating address */
-                       kfree(volume_info.UNC);
-                       kfree(volume_info.password);
-                       kfree(volume_info.prepath);
-                       FreeXid(xid);
-                       return -EINVAL;
+                       rc = -EINVAL;
+                       goto out;
                }
 
                cFYI(1, ("UNC: %s ip: %s", volume_info.UNC, volume_info.UNCip));
@@ -1835,20 +1855,14 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
                /* BB using ip addr as server name to connect to the
                   DFS root below */
                cERROR(1, ("Connecting to DFS root not implemented yet"));
-               kfree(volume_info.UNC);
-               kfree(volume_info.password);
-               kfree(volume_info.prepath);
-               FreeXid(xid);
-               return -EINVAL;
+               rc = -EINVAL;
+               goto out;
        } else /* which servers DFS root would we conect to */ {
                cERROR(1,
                       ("CIFS mount error: No UNC path (e.g. -o "
                        "unc=//192.168.1.100/public) specified"));
-               kfree(volume_info.UNC);
-               kfree(volume_info.password);
-               kfree(volume_info.prepath);
-               FreeXid(xid);
-               return -EINVAL;
+               rc = -EINVAL;
+               goto out;
        }
 
        /* this is needed for ASCII cp to Unicode converts */
@@ -1860,11 +1874,8 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
                if (cifs_sb->local_nls == NULL) {
                        cERROR(1, ("CIFS mount error: iocharset %s not found",
                                 volume_info.iocharset));
-                       kfree(volume_info.UNC);
-                       kfree(volume_info.password);
-                       kfree(volume_info.prepath);
-                       FreeXid(xid);
-                       return -ELIBACC;
+                       rc = -ELIBACC;
+                       goto out;
                }
        }
 
@@ -1878,11 +1889,8 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
                        &sin_server6.sin6_addr,
                        volume_info.username, &srvTcp);
        } else {
-               kfree(volume_info.UNC);
-               kfree(volume_info.password);
-               kfree(volume_info.prepath);
-               FreeXid(xid);
-               return -EINVAL;
+               rc = -EINVAL;
+               goto out;
        }
 
        if (srvTcp) {
@@ -1906,22 +1914,14 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
                                   "Aborting operation"));
                        if (csocket != NULL)
                                sock_release(csocket);
-                       kfree(volume_info.UNC);
-                       kfree(volume_info.password);
-                       kfree(volume_info.prepath);
-                       FreeXid(xid);
-                       return rc;
+                       goto out;
                }
 
                srvTcp = kzalloc(sizeof(struct TCP_Server_Info), GFP_KERNEL);
                if (!srvTcp) {
                        rc = -ENOMEM;
                        sock_release(csocket);
-                       kfree(volume_info.UNC);
-                       kfree(volume_info.password);
-                       kfree(volume_info.prepath);
-                       FreeXid(xid);
-                       return rc;
+                       goto out;
                } else {
                        memcpy(&srvTcp->addr.sockAddr, &sin_server,
                                sizeof(struct sockaddr_in));
@@ -1929,6 +1929,12 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
                        /* BB Add code for ipv6 case too */
                        srvTcp->ssocket = csocket;
                        srvTcp->protocolType = IPV4;
+                       srvTcp->hostname = extract_hostname(volume_info.UNC);
+                       if (IS_ERR(srvTcp->hostname)) {
+                               rc = PTR_ERR(srvTcp->hostname);
+                               sock_release(csocket);
+                               goto out;
+                       }
                        init_waitqueue_head(&srvTcp->response_q);
                        init_waitqueue_head(&srvTcp->request_q);
                        INIT_LIST_HEAD(&srvTcp->pending_mid_q);
@@ -1938,16 +1944,13 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
                        srvTcp->tcpStatus = CifsNew;
                        init_MUTEX(&srvTcp->tcpSem);
                        srvTcp->tsk = kthread_run((void *)(void *)cifs_demultiplex_thread, srvTcp, "cifsd");
-                       if ( IS_ERR(srvTcp->tsk) ) {
+                       if (IS_ERR(srvTcp->tsk)) {
                                rc = PTR_ERR(srvTcp->tsk);
                                cERROR(1, ("error %d create cifsd thread", rc));
                                srvTcp->tsk = NULL;
                                sock_release(csocket);
-                               kfree(volume_info.UNC);
-                               kfree(volume_info.password);
-                               kfree(volume_info.prepath);
-                               FreeXid(xid);
-                               return rc;
+                               kfree(srvTcp->hostname);
+                               goto out;
                        }
                        wait_for_completion(&cifsd_complete);
                        rc = 0;
@@ -1962,8 +1965,6 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
        if (existingCifsSes) {
                pSesInfo = existingCifsSes;
                cFYI(1, ("Existing smb sess found"));
-               kfree(volume_info.password);
-               /* volume_info.UNC freed at end of function */
        } else if (!rc) {
                cFYI(1, ("Existing smb sess not found"));
                pSesInfo = sesInfoAlloc();
@@ -1977,8 +1978,11 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
 
                if (!rc) {
                        /* volume_info.password freed at unmount */
-                       if (volume_info.password)
+                       if (volume_info.password) {
                                pSesInfo->password = volume_info.password;
+                               /* set to NULL to prevent freeing on exit */
+                               volume_info.password = NULL;
+                       }
                        if (volume_info.username)
                                strncpy(pSesInfo->userName,
                                        volume_info.username,
@@ -2000,8 +2004,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
                        up(&pSesInfo->sesSem);
                        if (!rc)
                                atomic_inc(&srvTcp->socketUseCount);
-               } else
-                       kfree(volume_info.password);
+               }
        }
 
        /* search for existing tcon to this server share */
@@ -2106,9 +2109,8 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
                                                "", cifs_sb->local_nls,
                                                cifs_sb->mnt_cifs_flags &
                                                  CIFS_MOUNT_MAP_SPECIAL_CHR);
-                                       kfree(volume_info.UNC);
-                                       FreeXid(xid);
-                                       return -ENODEV;
+                                       rc = -ENODEV;
+                                       goto out;
                                } else {
                                        /* BB Do we need to wrap sesSem around
                                         * this TCon call and Unix SetFS as
@@ -2231,6 +2233,12 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
        (in which case it is not needed anymore) but when new sesion is created
        the password ptr is put in the new session structure (in which case the
        password will be freed at unmount time) */
+out:
+       /* zero out password before freeing */
+       if (volume_info.password != NULL) {
+               memset(volume_info.password, 0, strlen(volume_info.password));
+               kfree(volume_info.password);
+       }
        kfree(volume_info.UNC);
        kfree(volume_info.prepath);
        FreeXid(xid);
@@ -2374,7 +2382,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses,
        pSMB->req_no_secext.ByteCount = cpu_to_le16(count);
 
        rc = SendReceive(xid, ses, smb_buffer, smb_buffer_response,
-                        &bytes_returned, 1);
+                        &bytes_returned, CIFS_LONG_OP);
        if (rc) {
 /* rc = map_smb_to_linux_error(smb_buffer_response); now done in SendReceive */
        } else if ((smb_buffer_response->WordCount == 3)
@@ -2678,7 +2686,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
        pSMB->req.ByteCount = cpu_to_le16(count);
 
        rc = SendReceive(xid, ses, smb_buffer, smb_buffer_response,
-                        &bytes_returned, 1);
+                        &bytes_returned, CIFS_LONG_OP);
 
        if (smb_buffer_response->Status.CifsError ==
            cpu_to_le32(NT_STATUS_MORE_PROCESSING_REQUIRED))
@@ -3105,7 +3113,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
        pSMB->req.ByteCount = cpu_to_le16(count);
 
        rc = SendReceive(xid, ses, smb_buffer, smb_buffer_response,
-                        &bytes_returned, 1);
+                        &bytes_returned, CIFS_LONG_OP);
        if (rc) {
 /*   rc = map_smb_to_linux_error(smb_buffer_response) done in SendReceive now */
        } else if ((smb_buffer_response->WordCount == 3) ||
@@ -3381,7 +3389,8 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
        pSMB->hdr.smb_buf_length += count;
        pSMB->ByteCount = cpu_to_le16(count);
 
-       rc = SendReceive(xid, ses, smb_buffer, smb_buffer_response, &length, 0);
+       rc = SendReceive(xid, ses, smb_buffer, smb_buffer_response, &length,
+                        CIFS_STD_OP);
 
        /* if (rc) rc = map_smb_to_linux_error(smb_buffer_response); */
        /* above now done in SendReceive */
index 793404b109252b7f589a1d5f11da8667e76379c2..37dc97af1487d2eed97fdfffa19f8f90c056830b 100644 (file)
@@ -593,7 +593,7 @@ static int cifs_ci_compare(struct dentry *dentry, struct qstr *a,
                 * case take precedence.  If a is not a negative dentry, this
                 * should have no side effects
                 */
-               memcpy((unsigned char *)a->name, b->name, a->len);
+               memcpy(a->name, b->name, a->len);
                return 0;
        }
        return 1;
index 1e7e4c06d9e3f8771f813064fcdc2bcce29596cc..dd26e2759b17780deab354d071e3555ce430d2bb 100644 (file)
@@ -130,7 +130,9 @@ static inline int cifs_open_inode_helper(struct inode *inode, struct file *file,
                if (file->f_path.dentry->d_inode->i_mapping) {
                /* BB no need to lock inode until after invalidate
                   since namei code should already have it locked? */
-                       filemap_write_and_wait(file->f_path.dentry->d_inode->i_mapping);
+                       rc = filemap_write_and_wait(file->f_path.dentry->d_inode->i_mapping);
+                       if (rc != 0)
+                               CIFS_I(file->f_path.dentry->d_inode)->write_behind_rc = rc;
                }
                cFYI(1, ("invalidating remote inode since open detected it "
                         "changed"));
@@ -425,7 +427,9 @@ reopen_error_exit:
                pCifsInode = CIFS_I(inode);
                if (pCifsInode) {
                        if (can_flush) {
-                               filemap_write_and_wait(inode->i_mapping);
+                               rc = filemap_write_and_wait(inode->i_mapping);
+                               if (rc != 0)
+                                       CIFS_I(inode)->write_behind_rc = rc;
                        /* temporarily disable caching while we
                           go to server to get inode info */
                                pCifsInode->clientCanCacheAll = FALSE;
@@ -835,9 +839,9 @@ ssize_t cifs_user_write(struct file *file, const char __user *write_data,
        xid = GetXid();
 
        if (*poffset > file->f_path.dentry->d_inode->i_size)
-               long_op = 2; /* writes past end of file can take a long time */
+               long_op = CIFS_VLONG_OP; /* writes past EOF take long time */
        else
-               long_op = 1;
+               long_op = CIFS_LONG_OP;
 
        for (total_written = 0; write_size > total_written;
             total_written += bytes_written) {
@@ -884,7 +888,7 @@ ssize_t cifs_user_write(struct file *file, const char __user *write_data,
                        }
                } else
                        *poffset += bytes_written;
-               long_op = FALSE; /* subsequent writes fast -
+               long_op = CIFS_STD_OP; /* subsequent writes fast -
                                    15 seconds is plenty */
        }
 
@@ -934,9 +938,9 @@ static ssize_t cifs_write(struct file *file, const char *write_data,
        xid = GetXid();
 
        if (*poffset > file->f_path.dentry->d_inode->i_size)
-               long_op = 2; /* writes past end of file can take a long time */
+               long_op = CIFS_VLONG_OP; /* writes past EOF can be slow */
        else
-               long_op = 1;
+               long_op = CIFS_LONG_OP;
 
        for (total_written = 0; write_size > total_written;
             total_written += bytes_written) {
@@ -1002,7 +1006,7 @@ static ssize_t cifs_write(struct file *file, const char *write_data,
                        }
                } else
                        *poffset += bytes_written;
-               long_op = FALSE; /* subsequent writes fast -
+               long_op = CIFS_STD_OP; /* subsequent writes fast -
                                    15 seconds is plenty */
        }
 
@@ -1026,6 +1030,37 @@ static ssize_t cifs_write(struct file *file, const char *write_data,
        return total_written;
 }
 
+#ifdef CONFIG_CIFS_EXPERIMENTAL
+struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode)
+{
+       struct cifsFileInfo *open_file = NULL;
+
+       read_lock(&GlobalSMBSeslock);
+       /* we could simply get the first_list_entry since write-only entries
+          are always at the end of the list but since the first entry might
+          have a close pending, we go through the whole list */
+       list_for_each_entry(open_file, &cifs_inode->openFileList, flist) {
+               if (open_file->closePend)
+                       continue;
+               if (open_file->pfile && ((open_file->pfile->f_flags & O_RDWR) ||
+                   (open_file->pfile->f_flags & O_RDONLY))) {
+                       if (!open_file->invalidHandle) {
+                               /* found a good file */
+                               /* lock it so it will not be closed on us */
+                               atomic_inc(&open_file->wrtPending);
+                               read_unlock(&GlobalSMBSeslock);
+                               return open_file;
+                       } /* else might as well continue, and look for
+                            another, or simply have the caller reopen it
+                            again rather than trying to fix this handle */
+               } else /* write only file */
+                       break; /* write only files are last so must be done */
+       }
+       read_unlock(&GlobalSMBSeslock);
+       return NULL;
+}
+#endif
+
 struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode)
 {
        struct cifsFileInfo *open_file;
@@ -1056,11 +1091,11 @@ refind_writable:
                                read_unlock(&GlobalSMBSeslock);
                                return open_file;
                        }
-       
+
                        read_unlock(&GlobalSMBSeslock);
                        /* Had to unlock since following call can block */
                        rc = cifs_reopen_file(open_file->pfile, FALSE);
-                       if (!rc) { 
+                       if (!rc) {
                                if (!open_file->closePend)
                                        return open_file;
                                else { /* start over in case this was deleted */
@@ -1083,7 +1118,7 @@ refind_writable:
                        /* can not use this handle, no write
                           pending on this one after all */
                        atomic_dec(&open_file->wrtPending);
-                       
+
                        if (open_file->closePend) /* list could have changed */
                                goto refind_writable;
                        /* else we simply continue to the next entry. Thus
@@ -1329,14 +1364,17 @@ retry:
                                                   open_file->netfid,
                                                   bytes_to_write, offset,
                                                   &bytes_written, iov, n_iov,
-                                                  1);
+                                                  CIFS_LONG_OP);
                                atomic_dec(&open_file->wrtPending);
                                if (rc || bytes_written < bytes_to_write) {
                                        cERROR(1, ("Write2 ret %d, wrote %d",
                                                  rc, bytes_written));
                                        /* BB what if continued retry is
                                           requested via mount flags? */
-                                       set_bit(AS_EIO, &mapping->flags);
+                                       if (rc == -ENOSPC)
+                                               set_bit(AS_ENOSPC, &mapping->flags);
+                                       else
+                                               set_bit(AS_EIO, &mapping->flags);
                                } else {
                                        cifs_stats_bytes_written(cifs_sb->tcon,
                                                                 bytes_written);
@@ -1468,9 +1506,11 @@ int cifs_fsync(struct file *file, struct dentry *dentry, int datasync)
        cFYI(1, ("Sync file - name: %s datasync: 0x%x",
                dentry->d_name.name, datasync));
 
-       rc = filemap_fdatawrite(inode->i_mapping);
-       if (rc == 0)
+       rc = filemap_write_and_wait(inode->i_mapping);
+       if (rc == 0) {
+               rc = CIFS_I(inode)->write_behind_rc;
                CIFS_I(inode)->write_behind_rc = 0;
+       }
        FreeXid(xid);
        return rc;
 }
@@ -1522,8 +1562,11 @@ int cifs_flush(struct file *file, fl_owner_t id)
           filemapfdatawrite appears easier for the time being */
 
        rc = filemap_fdatawrite(inode->i_mapping);
-       if (!rc) /* reset wb rc if we were able to write out dirty pages */
+       /* reset wb rc if we were able to write out dirty pages */
+       if (!rc) {
+               rc = CIFS_I(inode)->write_behind_rc;
                CIFS_I(inode)->write_behind_rc = 0;
+       }
 
        cFYI(1, ("Flush inode %p file %p rc %d", inode, file, rc));
 
index 5e8b388be3b672a7130e9e26f8bb954ed8321534..e915eb1d2e6608f659e9e49ad09d4689249fabb5 100644 (file)
@@ -289,7 +289,7 @@ static int decode_sfu_inode(struct inode *inode, __u64 size,
 
 #define SFBITS_MASK (S_ISVTX | S_ISGID | S_ISUID)  /* SETFILEBITS valid bits */
 
-static int get_sfu_uid_mode(struct inode *inode,
+static int get_sfu_mode(struct inode *inode,
                        const unsigned char *path,
                        struct cifs_sb_info *cifs_sb, int xid)
 {
@@ -527,11 +527,16 @@ int cifs_get_inode_info(struct inode **pinode,
 
                /* BB fill in uid and gid here? with help from winbind?
                   or retrieve from NTFS stream extended attribute */
+#ifdef CONFIG_CIFS_EXPERIMENTAL
+               /* fill in 0777 bits from ACL */
+               if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
+                       cFYI(1, ("Getting mode bits from ACL"));
+                       acl_to_uid_mode(inode, search_path);
+               }
+#endif
                if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) {
-                       /* fill in uid, gid, mode from server ACL */
-                       /* BB FIXME this should also take into account the
-                        * default uid specified on mount if present */
-                       get_sfu_uid_mode(inode, search_path, cifs_sb, xid);
+                       /* fill in remaining high mode bits e.g. SUID, VTX */
+                       get_sfu_mode(inode, search_path, cifs_sb, xid);
                } else if (atomic_read(&cifsInfo->inUse) == 0) {
                        inode->i_uid = cifs_sb->mnt_uid;
                        inode->i_gid = cifs_sb->mnt_gid;
@@ -1228,7 +1233,7 @@ cifs_rename_exit:
 int cifs_revalidate(struct dentry *direntry)
 {
        int xid;
-       int rc = 0;
+       int rc = 0, wbrc = 0;
        char *full_path;
        struct cifs_sb_info *cifs_sb;
        struct cifsInodeInfo *cifsInode;
@@ -1328,7 +1333,9 @@ int cifs_revalidate(struct dentry *direntry)
        if (direntry->d_inode->i_mapping) {
                /* do we need to lock inode until after invalidate completes
                   below? */
-               filemap_fdatawrite(direntry->d_inode->i_mapping);
+               wbrc = filemap_fdatawrite(direntry->d_inode->i_mapping);
+               if (wbrc)
+                       CIFS_I(direntry->d_inode)->write_behind_rc = wbrc;
        }
        if (invalidate_inode) {
        /* shrink_dcache not necessary now that cifs dentry ops
@@ -1337,7 +1344,9 @@ int cifs_revalidate(struct dentry *direntry)
                        shrink_dcache_parent(direntry); */
                if (S_ISREG(direntry->d_inode->i_mode)) {
                        if (direntry->d_inode->i_mapping)
-                               filemap_fdatawait(direntry->d_inode->i_mapping);
+                               wbrc = filemap_fdatawait(direntry->d_inode->i_mapping);
+                               if (wbrc)
+                                       CIFS_I(direntry->d_inode)->write_behind_rc = wbrc;
                        /* may eventually have to do this for open files too */
                        if (list_empty(&(cifsInode->openFileList))) {
                                /* changed on server - flush read ahead pages */
@@ -1480,10 +1489,20 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
 
        /* BB check if we need to refresh inode from server now ? BB */
 
-       /* need to flush data before changing file size on server */
-       filemap_write_and_wait(direntry->d_inode->i_mapping);
-
        if (attrs->ia_valid & ATTR_SIZE) {
+               /*
+                  Flush data before changing file size on server. If the
+                  flush returns error, store it to report later and continue.
+                  BB: This should be smarter. Why bother flushing pages that
+                  will be truncated anyway? Also, should we error out here if
+                  the flush returns error?
+                */
+               rc = filemap_write_and_wait(direntry->d_inode->i_mapping);
+               if (rc != 0) {
+                       CIFS_I(direntry->d_inode)->write_behind_rc = rc;
+                       rc = 0;
+               }
+
                /* To avoid spurious oplock breaks from server, in the case of
                   inodes that we already have open, avoid doing path based
                   setting of file size if we can do it by handle.
index e5c3e1212697a2253f4474b17b90371f462588ae..f13f96d42fcf63ebdfe4c76a1914a3d0afd03738 100644 (file)
@@ -276,8 +276,8 @@ hmac_md5_init_rfc2104(unsigned char *key, int key_len,
        }
 
        /* start out by storing key in pads */
-       memset(ctx->k_ipad, 0, sizeof (ctx->k_ipad));
-       memset(ctx->k_opad, 0, sizeof (ctx->k_opad));
+       memset(ctx->k_ipad, 0, sizeof(ctx->k_ipad));
+       memset(ctx->k_opad, 0, sizeof(ctx->k_opad));
        memcpy(ctx->k_ipad, key, key_len);
        memcpy(ctx->k_opad, key, key_len);
 
@@ -307,8 +307,8 @@ hmac_md5_init_limK_to_64(const unsigned char *key, int key_len,
        }
 
        /* start out by storing key in pads */
-       memset(ctx->k_ipad, 0, sizeof (ctx->k_ipad));
-       memset(ctx->k_opad, 0, sizeof (ctx->k_opad));
+       memset(ctx->k_ipad, 0, sizeof(ctx->k_ipad));
+       memset(ctx->k_opad, 0, sizeof(ctx->k_opad));
        memcpy(ctx->k_ipad, key, key_len);
        memcpy(ctx->k_opad, key, key_len);
 
index 51ec681fe74a2e32c19d90e2f45de591bb3ab048..15546c2354c5800b7930860304a0d043273db7fb 100644 (file)
@@ -73,7 +73,7 @@ sesInfoAlloc(void)
 {
        struct cifsSesInfo *ret_buf;
 
-       ret_buf = kzalloc(sizeof (struct cifsSesInfo), GFP_KERNEL);
+       ret_buf = kzalloc(sizeof(struct cifsSesInfo), GFP_KERNEL);
        if (ret_buf) {
                write_lock(&GlobalSMBSeslock);
                atomic_inc(&sesInfoAllocCount);
@@ -109,7 +109,7 @@ struct cifsTconInfo *
 tconInfoAlloc(void)
 {
        struct cifsTconInfo *ret_buf;
-       ret_buf = kzalloc(sizeof (struct cifsTconInfo), GFP_KERNEL);
+       ret_buf = kzalloc(sizeof(struct cifsTconInfo), GFP_KERNEL);
        if (ret_buf) {
                write_lock(&GlobalSMBSeslock);
                atomic_inc(&tconInfoAllocCount);
@@ -298,7 +298,7 @@ header_assemble(struct smb_hdr *buffer, char smb_command /* command */ ,
        memset(temp, 0, 256); /* bigger than MAX_CIFS_HDR_SIZE */
 
        buffer->smb_buf_length =
-           (2 * word_count) + sizeof (struct smb_hdr) -
+           (2 * word_count) + sizeof(struct smb_hdr) -
            4 /*  RFC 1001 length field does not count */  +
            2 /* for bcc field itself */ ;
        /* Note that this is the only network field that has to be converted
@@ -422,8 +422,8 @@ checkSMB(struct smb_hdr *smb, __u16 mid, unsigned int length)
        __u32 clc_len;  /* calculated length */
        cFYI(0, ("checkSMB Length: 0x%x, smb_buf_length: 0x%x", length, len));
 
-       if (length < 2 + sizeof (struct smb_hdr)) {
-               if ((length >= sizeof (struct smb_hdr) - 1)
+       if (length < 2 + sizeof(struct smb_hdr)) {
+               if ((length >= sizeof(struct smb_hdr) - 1)
                            && (smb->Status.CifsError != 0)) {
                        smb->WordCount = 0;
                        /* some error cases do not return wct and bcc */
index f06359cb22ee96645e7dfd7b0aa62cc0de216b2b..646e1f06941b5c8062e9c8e590c2e2790736ab7f 100644 (file)
@@ -132,6 +132,34 @@ static const struct smb_to_posix_error mapping_table_ERRHRD[] = {
        {0, 0}
 };
 
+
+/* if the mount helper is missing we need to reverse the 1st slash
+   from '/' to backslash in order to format the UNC properly for
+   ip address parsing and for tree connect (unless the user
+   remembered to put the UNC name in properly). Fortunately we do
+   not have to call this twice (we check for IPv4 addresses
+   first, so it is already converted by the time we
+   try IPv6 addresses */
+static int canonicalize_unc(char *cp)
+{
+       int i;
+
+       for (i = 0; i <= 46 /* INET6_ADDRSTRLEN */ ; i++) {
+               if (cp[i] == 0)
+                       break;
+               if (cp[i] == '\\')
+                       break;
+               if (cp[i] == '/') {
+#ifdef CONFIG_CIFS_DEBUG2
+                       cFYI(1, ("change slash to backslash in malformed UNC"));
+#endif
+                       cp[i] = '\\';
+                       return 1;
+               }
+       }
+       return 0;
+}
+
 /* Convert string containing dotted ip address to binary form */
 /* returns 0 if invalid address */
 
@@ -141,11 +169,13 @@ cifs_inet_pton(int address_family, char *cp, void *dst)
        int ret = 0;
 
        /* calculate length by finding first slash or NULL */
-       /* BB Should we convert '/' slash to '\' here since it seems already
-        * done before this */
-       if ( address_family == AF_INET ) {
-               ret = in4_pton(cp, -1 /* len */, dst , '\\', NULL);
-       } else if ( address_family == AF_INET6 ) {
+       if (address_family == AF_INET) {
+               ret = in4_pton(cp, -1 /* len */, dst, '\\', NULL);
+               if (ret == 0) {
+                       if (canonicalize_unc(cp))
+                               ret = in4_pton(cp, -1, dst, '\\', NULL);
+               }
+       } else if (address_family == AF_INET6) {
                ret = in6_pton(cp, -1 /* len */, dst , '\\', NULL);
        }
 #ifdef CONFIG_CIFS_DEBUG2
@@ -740,7 +770,7 @@ cifs_print_status(__u32 status_code)
 
 
 static void
-ntstatus_to_dos(__u32 ntstatus, __u8 * eclass, __u16 * ecode)
+ntstatus_to_dos(__u32 ntstatus, __u8 *eclass, __u16 *ecode)
 {
        int i;
        if (ntstatus == 0) {
@@ -793,8 +823,8 @@ map_smb_to_linux_error(struct smb_hdr *smb, int logErr)
        if (smberrclass == ERRDOS) {  /* 1 byte field no need to byte reverse */
                for (i = 0;
                     i <
-                    sizeof (mapping_table_ERRDOS) /
-                    sizeof (struct smb_to_posix_error); i++) {
+                    sizeof(mapping_table_ERRDOS) /
+                    sizeof(struct smb_to_posix_error); i++) {
                        if (mapping_table_ERRDOS[i].smb_err == 0)
                                break;
                        else if (mapping_table_ERRDOS[i].smb_err ==
@@ -807,8 +837,8 @@ map_smb_to_linux_error(struct smb_hdr *smb, int logErr)
        } else if (smberrclass == ERRSRV) {   /* server class of error codes */
                for (i = 0;
                     i <
-                    sizeof (mapping_table_ERRSRV) /
-                    sizeof (struct smb_to_posix_error); i++) {
+                    sizeof(mapping_table_ERRSRV) /
+                    sizeof(struct smb_to_posix_error); i++) {
                        if (mapping_table_ERRSRV[i].smb_err == 0)
                                break;
                        else if (mapping_table_ERRSRV[i].smb_err ==
@@ -837,14 +867,14 @@ map_smb_to_linux_error(struct smb_hdr *smb, int logErr)
 unsigned int
 smbCalcSize(struct smb_hdr *ptr)
 {
-       return (sizeof (struct smb_hdr) + (2 * ptr->WordCount) +
+       return (sizeof(struct smb_hdr) + (2 * ptr->WordCount) +
                2 /* size of the bcc field */ + BCC(ptr));
 }
 
 unsigned int
 smbCalcSize_LE(struct smb_hdr *ptr)
 {
-       return (sizeof (struct smb_hdr) + (2 * ptr->WordCount) +
+       return (sizeof(struct smb_hdr) + (2 * ptr->WordCount) +
                2 /* size of the bcc field */ + le16_to_cpu(BCC_LE(ptr)));
 }
 
index 3746580e97016f390a491684ecfae3a14cbd5796..0f22def4bdff47e30300dec9bcad5be12cd193d6 100644 (file)
@@ -171,7 +171,13 @@ static void fill_in_inode(struct inode *tmp_inode, int new_buf_type,
        /* Linux can not store file creation time unfortunately so ignore it */
 
        cifsInfo->cifsAttrs = attr;
-       cifsInfo->time = jiffies;
+#ifdef CONFIG_CIFS_EXPERIMENTAL
+       if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
+               /* get more accurate mode via ACL - so force inode refresh */
+               cifsInfo->time = 0;
+       } else
+#endif /* CONFIG_CIFS_EXPERIMENTAL */
+               cifsInfo->time = jiffies;
 
        /* treat dos attribute of read-only as read-only mode bit e.g. 555? */
        /* 2767 perms - indicate mandatory locking */
@@ -495,7 +501,7 @@ ffirst_retry:
 static int cifs_unicode_bytelen(char *str)
 {
        int len;
-       __le16 * ustr = (__le16 *)str;
+       __le16 *ustr = (__le16 *)str;
 
        for (len = 0; len <= PATH_MAX; len++) {
                if (ustr[len] == 0)
index 899dc6078d9ab7848b3ffda2547161c212c2e9e5..d0cb469daab7337b8285abc907e2740a5ef3abd8 100644 (file)
@@ -29,6 +29,7 @@
 #include "ntlmssp.h"
 #include "nterr.h"
 #include <linux/utsname.h>
+#include "cifs_spnego.h"
 
 extern void SMBNTencrypt(unsigned char *passwd, unsigned char *c8,
                         unsigned char *p24);
@@ -340,11 +341,12 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
        SESSION_SETUP_ANDX *pSMB;
        __u32 capabilities;
        int count;
-       int resp_buf_type = 0;
-       struct kvec iov[2];
+       int resp_buf_type;
+       struct kvec iov[3];
        enum securityEnum type;
        __u16 action;
        int bytes_remaining;
+       struct key *spnego_key = NULL;
 
        if (ses == NULL)
                return -EINVAL;
@@ -377,24 +379,32 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
 
        capabilities = cifs_ssetup_hdr(ses, pSMB);
 
-       /* we will send the SMB in two pieces,
-       a fixed length beginning part, and a
-       second part which will include the strings
-       and rest of bcc area, in order to avoid having
-       to do a large buffer 17K allocation */
+       /* we will send the SMB in three pieces:
+       a fixed length beginning part, an optional
+       SPNEGO blob (which can be zero length), and a
+       last part which will include the strings
+       and rest of bcc area. This allows us to avoid
+       a large buffer 17K allocation */
        iov[0].iov_base = (char *)pSMB;
        iov[0].iov_len = smb_buf->smb_buf_length + 4;
 
+       /* setting this here allows the code at the end of the function
+          to free the request buffer if there's an error */
+       resp_buf_type = CIFS_SMALL_BUFFER;
+
        /* 2000 big enough to fit max user, domain, NOS name etc. */
        str_area = kmalloc(2000, GFP_KERNEL);
        if (str_area == NULL) {
-               cifs_small_buf_release(smb_buf);
-               return -ENOMEM;
+               rc = -ENOMEM;
+               goto ssetup_exit;
        }
        bcc_ptr = str_area;
 
        ses->flags &= ~CIFS_SES_LANMAN;
 
+       iov[1].iov_base = NULL;
+       iov[1].iov_len = 0;
+
        if (type == LANMAN) {
 #ifdef CONFIG_CIFS_WEAK_PW_HASH
                char lnm_session_key[CIFS_SESS_KEY_SIZE];
@@ -463,8 +473,8 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
                   struct ntlmv2_resp */
 
                if (v2_sess_key == NULL) {
-                       cifs_small_buf_release(smb_buf);
-                       return -ENOMEM;
+                       rc = -ENOMEM;
+                       goto ssetup_exit;
                }
 
                pSMB->req_no_secext.Capabilities = cpu_to_le32(capabilities);
@@ -499,22 +509,67 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
                        unicode_ssetup_strings(&bcc_ptr, ses, nls_cp);
                } else
                        ascii_ssetup_strings(&bcc_ptr, ses, nls_cp);
-       } else /* NTLMSSP or SPNEGO */ {
+       } else if (type == Kerberos) {
+#ifdef CONFIG_CIFS_UPCALL
+               struct cifs_spnego_msg *msg;
+               spnego_key = cifs_get_spnego_key(ses);
+               if (IS_ERR(spnego_key)) {
+                       rc = PTR_ERR(spnego_key);
+                       spnego_key = NULL;
+                       goto ssetup_exit;
+               }
+
+               msg = spnego_key->payload.data;
+               /* bail out if key is too long */
+               if (msg->sesskey_len >
+                   sizeof(ses->server->mac_signing_key.data.krb5)) {
+                       cERROR(1, ("Kerberos signing key too long (%u bytes)",
+                               msg->sesskey_len));
+                       rc = -EOVERFLOW;
+                       goto ssetup_exit;
+               }
+               ses->server->mac_signing_key.len = msg->sesskey_len;
+               memcpy(ses->server->mac_signing_key.data.krb5, msg->data,
+                       msg->sesskey_len);
                pSMB->req.hdr.Flags2 |= SMBFLG2_EXT_SEC;
                capabilities |= CAP_EXTENDED_SECURITY;
                pSMB->req.Capabilities = cpu_to_le32(capabilities);
-               /* BB set password lengths */
+               iov[1].iov_base = msg->data + msg->sesskey_len;
+               iov[1].iov_len = msg->secblob_len;
+               pSMB->req.SecurityBlobLength = cpu_to_le16(iov[1].iov_len);
+
+               if (ses->capabilities & CAP_UNICODE) {
+                       /* unicode strings must be word aligned */
+                       if (iov[0].iov_len % 2) {
+                               *bcc_ptr = 0;
+                               bcc_ptr++;
+                       }
+                       unicode_oslm_strings(&bcc_ptr, nls_cp);
+                       unicode_domain_string(&bcc_ptr, ses, nls_cp);
+               } else
+               /* BB: is this right? */
+                       ascii_ssetup_strings(&bcc_ptr, ses, nls_cp);
+#else /* ! CONFIG_CIFS_UPCALL */
+               cERROR(1, ("Kerberos negotiated but upcall support disabled!"));
+               rc = -ENOSYS;
+               goto ssetup_exit;
+#endif /* CONFIG_CIFS_UPCALL */
+       } else {
+               cERROR(1, ("secType %d not supported!", type));
+               rc = -ENOSYS;
+               goto ssetup_exit;
        }
 
-       count = (long) bcc_ptr - (long) str_area;
+       iov[2].iov_base = str_area;
+       iov[2].iov_len = (long) bcc_ptr - (long) str_area;
+
+       count = iov[1].iov_len + iov[2].iov_len;
        smb_buf->smb_buf_length += count;
 
        BCC_LE(smb_buf) = cpu_to_le16(count);
 
-       iov[1].iov_base = str_area;
-       iov[1].iov_len = count;
-       rc = SendReceive2(xid, ses, iov, 2 /* num_iovecs */, &resp_buf_type,
-                         0 /* not long op */, 1 /* log NT STATUS if any */ );
+       rc = SendReceive2(xid, ses, iov, 3 /* num_iovecs */, &resp_buf_type,
+                         CIFS_STD_OP /* not long */ | CIFS_LOG_ERROR);
        /* SMB request buf freed in SendReceive2 */
 
        cFYI(1, ("ssetup rc from sendrecv2 is %d", rc));
@@ -560,6 +615,8 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
                                         ses, nls_cp);
 
 ssetup_exit:
+       if (spnego_key)
+               key_put(spnego_key);
        kfree(str_area);
        if (resp_buf_type == CIFS_SMALL_BUFFER) {
                cFYI(1, ("ssetup freeing small buf %p", iov[0].iov_base));
index 90542a39be1750197345b404bf23806c400c8460..58bbfd992cc0f4afe26f057752aeddfbd3da53ba 100644 (file)
@@ -80,7 +80,7 @@ SMBencrypt(unsigned char *passwd, unsigned char *c8, unsigned char *p24)
 
 /* Routines for Windows NT MD4 Hash functions. */
 static int
-_my_wcslen(__u16 * str)
+_my_wcslen(__u16 *str)
 {
        int len = 0;
        while (*str++ != 0)
@@ -96,7 +96,7 @@ _my_wcslen(__u16 * str)
  */
 
 static int
-_my_mbstowcs(__u16 * dst, const unsigned char *src, int len)
+_my_mbstowcs(__u16 *dst, const unsigned char *src, int len)
 {      /* BB not a very good conversion routine - change/fix */
        int i;
        __u16 val;
@@ -125,9 +125,9 @@ E_md4hash(const unsigned char *passwd, unsigned char *p16)
        /* Password cannot be longer than 128 characters */
        if (passwd) {
                len = strlen((char *) passwd);
-               if (len > 128) {
+               if (len > 128)
                        len = 128;
-               }
+
                /* Password must be converted to NT unicode */
                _my_mbstowcs(wpwd, passwd, len);
        } else
@@ -135,7 +135,7 @@ E_md4hash(const unsigned char *passwd, unsigned char *p16)
 
        wpwd[len] = 0;  /* Ensure string is null terminated */
        /* Calculate length in bytes */
-       len = _my_wcslen(wpwd) * sizeof (__u16);
+       len = _my_wcslen(wpwd) * sizeof(__u16);
 
        mdfour(p16, (unsigned char *) wpwd, len);
        memset(wpwd, 0, 129 * 2);
@@ -167,7 +167,7 @@ nt_lm_owf_gen(char *pwd, unsigned char nt_p16[16], unsigned char p16[16])
        E_P16((unsigned char *) passwd, (unsigned char *) p16);
 
        /* clear out local copy of user's password (just being paranoid). */
-       memset(passwd, '\0', sizeof (passwd));
+       memset(passwd, '\0', sizeof(passwd));
 }
 #endif
 
@@ -189,8 +189,10 @@ ntv2_owf_gen(const unsigned char owf[16], const char *user_n,
                return;
        dom_u = user_u + 1024;
 
-       /* push_ucs2(NULL, user_u, user_n, (user_l+1)*2, STR_UNICODE|STR_NOALIGN|STR_TERMINATE|STR_UPPER);
-          push_ucs2(NULL, dom_u, domain_n, (domain_l+1)*2, STR_UNICODE|STR_NOALIGN|STR_TERMINATE|STR_UPPER); */
+       /* push_ucs2(NULL, user_u, user_n, (user_l+1)*2,
+                       STR_UNICODE|STR_NOALIGN|STR_TERMINATE|STR_UPPER);
+          push_ucs2(NULL, dom_u, domain_n, (domain_l+1)*2,
+                       STR_UNICODE|STR_NOALIGN|STR_TERMINATE|STR_UPPER); */
 
        /* BB user and domain may need to be uppercased */
        user_l = cifs_strtoUCS(user_u, user_n, 511, nls_codepage);
index 7ed32b3cb781a0011a0560b7fe3898825f5c9e4f..50b623ad93205700822888e00c1e684186aac05e 100644 (file)
@@ -308,7 +308,7 @@ smb_send2(struct socket *ssocket, struct kvec *iov, int n_vec,
 
 static int wait_for_free_request(struct cifsSesInfo *ses, const int long_op)
 {
-       if (long_op == -1) {
+       if (long_op == CIFS_ASYNC_OP) {
                /* oplock breaks must not be held up */
                atomic_inc(&ses->server->inFlight);
        } else {
@@ -337,7 +337,7 @@ static int wait_for_free_request(struct cifsSesInfo *ses, const int long_op)
                                   as they are allowed to block on server */
 
                                /* update # of requests on the wire to server */
-                               if (long_op < 3)
+                               if (long_op != CIFS_BLOCKING_OP)
                                        atomic_inc(&ses->server->inFlight);
                                spin_unlock(&GlobalMid_Lock);
                                break;
@@ -415,17 +415,48 @@ static int wait_for_response(struct cifsSesInfo *ses,
        }
 }
 
+
+/*
+ *
+ * Send an SMB Request.  No response info (other than return code)
+ * needs to be parsed.
+ *
+ * flags indicate the type of request buffer and how long to wait
+ * and whether to log NT STATUS code (error) before mapping it to POSIX error
+ *
+ */
+int
+SendReceiveNoRsp(const unsigned int xid, struct cifsSesInfo *ses,
+               struct smb_hdr *in_buf, int flags)
+{
+       int rc;
+       struct kvec iov[1];
+       int resp_buf_type;
+
+       iov[0].iov_base = (char *)in_buf;
+       iov[0].iov_len = in_buf->smb_buf_length + 4;
+       flags |= CIFS_NO_RESP;
+       rc = SendReceive2(xid, ses, iov, 1, &resp_buf_type, flags);
+#ifdef CONFIG_CIFS_DEBUG2
+       cFYI(1, ("SendRcvNoR flags %d rc %d", flags, rc));
+#endif
+       return rc;
+}
+
 int
 SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
             struct kvec *iov, int n_vec, int *pRespBufType /* ret */,
-            const int long_op, const int logError)
+            const int flags)
 {
        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;
 
+       long_op = flags & CIFS_TIMEOUT_MASK;
+
        *pRespBufType = CIFS_NO_BUFFER;  /* no response buf yet */
 
        if ((ses == NULL) || (ses->server == NULL)) {
@@ -483,15 +514,22 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
        if (rc < 0)
                goto out;
 
-       if (long_op == -1)
-               goto out;
-       else if (long_op == 2) /* writes past end of file can take loong time */
+       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 == 1)
+       else if (long_op == CIFS_LONG_OP)
                timeout = 45 * HZ; /* should be greater than
                        servers oplock break timeout (about 43 seconds) */
-       else
-               timeout = 15 * HZ;
+       else 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 */
@@ -566,7 +604,8 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
                        }
 
                        /* BB special case reconnect tid and uid here? */
-                       rc = map_smb_to_linux_error(midQ->resp_buf, logError);
+                       rc = map_smb_to_linux_error(midQ->resp_buf,
+                                               flags & CIFS_LOG_ERROR);
 
                        /* convert ByteCount if necessary */
                        if (receive_len >= sizeof(struct smb_hdr) - 4
@@ -574,8 +613,10 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
                            (2 * midQ->resp_buf->WordCount) + 2 /* bcc */ )
                                BCC(midQ->resp_buf) =
                                        le16_to_cpu(BCC_LE(midQ->resp_buf));
-                       midQ->resp_buf = NULL;  /* mark it so will not be freed
-                                               by DeleteMidQEntry */
+                       if ((flags & CIFS_NO_RESP) == 0)
+                               midQ->resp_buf = NULL;  /* mark it so buf will
+                                                          not be freed by
+                                                          DeleteMidQEntry */
                } else {
                        rc = -EIO;
                        cFYI(1, ("Bad MID state?"));
@@ -663,17 +704,25 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
        if (rc < 0)
                goto out;
 
-       if (long_op == -1)
+       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)
                goto out;
-       else if (long_op == 2) /* writes past end of file can take loong time */
+       else if (long_op == CIFS_VLONG_OP) /* writes past EOF can be slow */
                timeout = 180 * HZ;
-       else if (long_op == 1)
+       else if (long_op == CIFS_LONG_OP)
                timeout = 45 * HZ; /* should be greater than
                        servers oplock break timeout (about 43 seconds) */
-       else
-               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_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 */
@@ -812,7 +861,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, 0);
+                       &bytes_returned, CIFS_STD_OP);
 }
 
 int
@@ -844,7 +893,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifsTconInfo *tcon,
           to the same server. We may make this configurable later or
           use ses->maxReq */
 
-       rc = wait_for_free_request(ses, 3);
+       rc = wait_for_free_request(ses, CIFS_BLOCKING_OP);
        if (rc)
                return rc;
 
index 369e838bebd3142554b72d58e7333547079b3e41..54e8ef96cb7930c07734aa9f0b808eaa2e215953 100644 (file)
@@ -265,7 +265,9 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
                else if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
                        __u16 fid;
                        int oplock = FALSE;
-                       if (experimEnabled) 
+                       struct cifs_ntsd *pacl = NULL;
+                       __u32 buflen = 0;
+                       if (experimEnabled)
                                rc = CIFSSMBOpen(xid, pTcon, full_path,
                                        FILE_OPEN, GENERIC_READ, 0, &fid,
                                        &oplock, NULL, cifs_sb->local_nls,
@@ -273,10 +275,9 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
                                        CIFS_MOUNT_MAP_SPECIAL_CHR);
                        /* else rc is EOPNOTSUPP from above */
 
-                       if(rc == 0) {
-                               rc = CIFSSMBGetCIFSACL(xid, pTcon, fid,
-                                       ea_value, buf_size,
-                                       ACL_TYPE_ACCESS);
+                       if (rc == 0) {
+                               rc = CIFSSMBGetCIFSACL(xid, pTcon, fid, &pacl,
+                                                     &buflen);
                                CIFSSMBClose(xid, pTcon, fid);
                        }
                }
index a4284ccac1f98a41becf824a638819222e1b5ae0..bd26e4cbb994f810b0ce8dc8ce3780356e0f66fa 100644 (file)
@@ -322,7 +322,7 @@ static int dev_ifname32(unsigned int fd, unsigned int cmd, unsigned long arg)
        int err;
 
        uifr = compat_alloc_user_space(sizeof(struct ifreq));
-       if (copy_in_user(uifr, compat_ptr(arg), sizeof(struct ifreq32)));
+       if (copy_in_user(uifr, compat_ptr(arg), sizeof(struct ifreq32)))
                return -EFAULT;
 
        err = sys_ioctl(fd, SIOCGIFNAME, (unsigned long)uifr);
index 58bf3f5cdbe25ac6cbd2c527be2df7c286d01ede..e9923ca9c2d9ee4c700eb6f18ea1bfb150fee52f 100644 (file)
@@ -1062,7 +1062,7 @@ static int sctp_listen_for_all(void)
        subscribe.sctp_shutdown_event = 1;
        subscribe.sctp_partial_delivery_event = 1;
 
-       result = kernel_setsockopt(sock, SOL_SOCKET, SO_RCVBUF,
+       result = kernel_setsockopt(sock, SOL_SOCKET, SO_RCVBUFFORCE,
                                 (char *)&bufsize, sizeof(bufsize));
        if (result)
                log_print("Error increasing buffer space on socket %d", result);
@@ -1454,10 +1454,6 @@ int dlm_lowcomms_start(void)
        if (!con_cache)
                goto out;
 
-       /* Set some sysctl minima */
-       if (sysctl_rmem_max < NEEDED_RMEM)
-               sysctl_rmem_max = NEEDED_RMEM;
-
        /* Start listening */
        if (dlm_config.ci_protocol == 0)
                error = tcp_listen_for_all();
index 9d70289f7df328022e050bbcb3723923524c562f..bbed2fd40fdcd59d125e269afde868880c495724 100644 (file)
@@ -115,11 +115,29 @@ static int ecryptfs_calculate_md5(char *dst,
                }
                crypt_stat->hash_tfm = desc.tfm;
        }
-       crypto_hash_init(&desc);
-       crypto_hash_update(&desc, &sg, len);
-       crypto_hash_final(&desc, dst);
-       mutex_unlock(&crypt_stat->cs_hash_tfm_mutex);
+       rc = crypto_hash_init(&desc);
+       if (rc) {
+               printk(KERN_ERR
+                      "%s: Error initializing crypto hash; rc = [%d]\n",
+                      __FUNCTION__, rc);
+               goto out;
+       }
+       rc = crypto_hash_update(&desc, &sg, len);
+       if (rc) {
+               printk(KERN_ERR
+                      "%s: Error updating crypto hash; rc = [%d]\n",
+                      __FUNCTION__, rc);
+               goto out;
+       }
+       rc = crypto_hash_final(&desc, dst);
+       if (rc) {
+               printk(KERN_ERR
+                      "%s: Error finalizing crypto hash; rc = [%d]\n",
+                      __FUNCTION__, rc);
+               goto out;
+       }
 out:
+       mutex_unlock(&crypt_stat->cs_hash_tfm_mutex);
        return rc;
 }
 
@@ -504,7 +522,6 @@ int ecryptfs_encrypt_page(struct page *page)
                                        "\n", rc);
                        goto out;
                }
-               extent_offset++;
        }
 out:
        kfree(enc_extent_virt);
@@ -640,7 +657,6 @@ int ecryptfs_decrypt_page(struct page *page)
                               "rc = [%d]\n", __FUNCTION__, rc);
                        goto out;
                }
-               extent_offset++;
        }
 out:
        kfree(enc_extent_virt);
index 2150edf9a58e6db662adcb12bb9ae279ad306c2d..6b7474a4336a5844cd004d3b8af923f19d6fc536 100644 (file)
@@ -87,7 +87,7 @@ int ecryptfs_write_lower_page_segment(struct inode *ecryptfs_inode,
        loff_t offset;
        int rc;
 
-       offset = ((((off_t)page_for_lower->index) << PAGE_CACHE_SHIFT)
+       offset = ((((loff_t)page_for_lower->index) << PAGE_CACHE_SHIFT)
                  + offset_in_page);
        virt = kmap(page_for_lower);
        rc = ecryptfs_write_lower(ecryptfs_inode, virt, offset, size);
index 2c942e2d14ea2b3ebf2fb51bcf692e3a37565ae5..4ccaaa4b13b229ec17456789ead9aad76c8078bf 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1692,7 +1692,10 @@ int do_coredump(long signr, int exit_code, struct pt_regs * regs)
        if (!binfmt || !binfmt->core_dump)
                goto fail;
        down_write(&mm->mmap_sem);
-       if (!get_dumpable(mm)) {
+       /*
+        * If another thread got here first, or we are not dumpable, bail out.
+        */
+       if (mm->core_waiters || !get_dumpable(mm)) {
                up_write(&mm->mmap_sem);
                goto fail;
        }
@@ -1706,7 +1709,6 @@ int do_coredump(long signr, int exit_code, struct pt_regs * regs)
                flag = O_EXCL;          /* Stop rewrite attacks */
                current->fsuid = 0;     /* Dump root private */
        }
-       set_dumpable(mm, 0);
 
        retval = coredump_wait(exit_code);
        if (retval < 0)
index 18a42de25b556dd2b311f06619678c4bc06c66e7..377ad172d74b1c5e8110393d875d5499f9bfe199 100644 (file)
@@ -69,14 +69,6 @@ struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb,
        return desc + offset;
 }
 
-static inline int
-block_in_use(unsigned long block, struct super_block *sb, unsigned char *map)
-{
-       return ext2_test_bit ((block -
-               le32_to_cpu(EXT2_SB(sb)->s_es->s_first_data_block)) %
-                        EXT2_BLOCKS_PER_GROUP(sb), map);
-}
-
 /*
  * Read the bitmap for a given block_group, reading into the specified 
  * slot in the superblock's bitmap cache.
@@ -86,51 +78,20 @@ block_in_use(unsigned long block, struct super_block *sb, unsigned char *map)
 static struct buffer_head *
 read_block_bitmap(struct super_block *sb, unsigned int block_group)
 {
-       int i;
        struct ext2_group_desc * desc;
        struct buffer_head * bh = NULL;
-       unsigned int bitmap_blk;
-
+       
        desc = ext2_get_group_desc (sb, block_group, NULL);
        if (!desc)
-               return NULL;
-       bitmap_blk = le32_to_cpu(desc->bg_block_bitmap);
-       bh = sb_bread(sb, bitmap_blk);
+               goto error_out;
+       bh = sb_bread(sb, le32_to_cpu(desc->bg_block_bitmap));
        if (!bh)
-               ext2_error (sb, __FUNCTION__,
+               ext2_error (sb, "read_block_bitmap",
                            "Cannot read block bitmap - "
                            "block_group = %d, block_bitmap = %u",
                            block_group, le32_to_cpu(desc->bg_block_bitmap));
-
-       /* check whether block bitmap block number is set */
-       if (!block_in_use(bitmap_blk, sb, bh->b_data)) {
-               /* bad block bitmap */
-               goto error_out;
-       }
-       /* check whether the inode bitmap block number is set */
-       bitmap_blk = le32_to_cpu(desc->bg_inode_bitmap);
-       if (!block_in_use(bitmap_blk, sb, bh->b_data)) {
-               /* bad block bitmap */
-               goto error_out;
-       }
-       /* check whether the inode table block number is set */
-       bitmap_blk = le32_to_cpu(desc->bg_inode_table);
-       for (i = 0; i < EXT2_SB(sb)->s_itb_per_group; i++, bitmap_blk++) {
-               if (!block_in_use(bitmap_blk, sb, bh->b_data)) {
-                       /* bad block bitmap */
-                       goto error_out;
-               }
-       }
-
-       return bh;
-
 error_out:
-       brelse(bh);
-       ext2_error(sb, __FUNCTION__,
-                       "Invalid block bitmap - "
-                       "block_group = %d, block = %u",
-                       block_group, bitmap_blk);
-       return NULL;
+       return bh;
 }
 
 static void release_blocks(struct super_block *sb, int count)
@@ -1461,7 +1422,6 @@ unsigned long ext2_count_free_blocks (struct super_block * sb)
 #endif
 }
 
-
 static inline int test_root(int a, int b)
 {
        int num = b;
index c2324d5fe4ac149a5672bad13134d4775c815100..320b2cb3d4d22eddf610d7a27d043eeef0437d5e 100644 (file)
@@ -47,6 +47,11 @@ int ext2_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
                        flags &= ~EXT2_DIRSYNC_FL;
 
                mutex_lock(&inode->i_mutex);
+               /* Is it quota file? Do not allow user to mess with it */
+               if (IS_NOQUOTA(inode)) {
+                       mutex_unlock(&inode->i_mutex);
+                       return -EPERM;
+               }
                oldflags = ei->i_flags;
 
                /*
index 7a87d15523be62f1d33c72c4d8a2eba359d45237..a8ba7e831278a0f53518edc101cd5517734af33e 100644 (file)
@@ -80,14 +80,6 @@ struct ext3_group_desc * ext3_get_group_desc(struct super_block * sb,
        return desc + offset;
 }
 
-static inline int
-block_in_use(ext3_fsblk_t block, struct super_block *sb, unsigned char *map)
-{
-       return ext3_test_bit ((block -
-               le32_to_cpu(EXT3_SB(sb)->s_es->s_first_data_block)) %
-                        EXT3_BLOCKS_PER_GROUP(sb), map);
-}
-
 /**
  * read_block_bitmap()
  * @sb:                        super block
@@ -101,51 +93,20 @@ block_in_use(ext3_fsblk_t block, struct super_block *sb, unsigned char *map)
 static struct buffer_head *
 read_block_bitmap(struct super_block *sb, unsigned int block_group)
 {
-       int i;
        struct ext3_group_desc * desc;
        struct buffer_head * bh = NULL;
-       ext3_fsblk_t bitmap_blk;
 
        desc = ext3_get_group_desc (sb, block_group, NULL);
        if (!desc)
-               return NULL;
-       bitmap_blk = le32_to_cpu(desc->bg_block_bitmap);
-       bh = sb_bread(sb, bitmap_blk);
+               goto error_out;
+       bh = sb_bread(sb, le32_to_cpu(desc->bg_block_bitmap));
        if (!bh)
-               ext3_error (sb, __FUNCTION__,
+               ext3_error (sb, "read_block_bitmap",
                            "Cannot read block bitmap - "
                            "block_group = %d, block_bitmap = %u",
                            block_group, le32_to_cpu(desc->bg_block_bitmap));
-
-       /* check whether block bitmap block number is set */
-       if (!block_in_use(bitmap_blk, sb, bh->b_data)) {
-               /* bad block bitmap */
-               goto error_out;
-       }
-       /* check whether the inode bitmap block number is set */
-       bitmap_blk = le32_to_cpu(desc->bg_inode_bitmap);
-       if (!block_in_use(bitmap_blk, sb, bh->b_data)) {
-               /* bad block bitmap */
-               goto error_out;
-       }
-       /* check whether the inode table block number is set */
-       bitmap_blk = le32_to_cpu(desc->bg_inode_table);
-       for (i = 0; i < EXT3_SB(sb)->s_itb_per_group; i++, bitmap_blk++) {
-               if (!block_in_use(bitmap_blk, sb, bh->b_data)) {
-                       /* bad block bitmap */
-                       goto error_out;
-               }
-       }
-
-       return bh;
-
 error_out:
-       brelse(bh);
-       ext3_error(sb, __FUNCTION__,
-                       "Invalid block bitmap - "
-                       "block_group = %d, block = %lu",
-                       block_group, bitmap_blk);
-       return NULL;
+       return bh;
 }
 /*
  * The reservation window structure operations
@@ -1772,7 +1733,6 @@ ext3_fsblk_t ext3_count_free_blocks(struct super_block *sb)
 #endif
 }
 
-
 static inline int test_root(int a, int b)
 {
        int num = b;
index c8e4ee3af1d0a7ead446bb5dcf34040db7690138..8ca3bfd7242743dba5d05f5afd06e3cdb549718d 100644 (file)
@@ -67,7 +67,7 @@ int ext3_check_dir_entry (const char * function, struct inode * dir,
                          unsigned long offset)
 {
        const char * error_msg = NULL;
-       const int rlen = le16_to_cpu(de->rec_len);
+       const int rlen = ext3_rec_len_from_disk(de->rec_len);
 
        if (rlen < EXT3_DIR_REC_LEN(1))
                error_msg = "rec_len is smaller than minimal";
@@ -173,10 +173,10 @@ revalidate:
                                 * least that it is non-zero.  A
                                 * failure will be detected in the
                                 * dirent test below. */
-                               if (le16_to_cpu(de->rec_len) <
+                               if (ext3_rec_len_from_disk(de->rec_len) <
                                                EXT3_DIR_REC_LEN(1))
                                        break;
-                               i += le16_to_cpu(de->rec_len);
+                               i += ext3_rec_len_from_disk(de->rec_len);
                        }
                        offset = i;
                        filp->f_pos = (filp->f_pos & ~(sb->s_blocksize - 1))
@@ -197,7 +197,7 @@ revalidate:
                                ret = stored;
                                goto out;
                        }
-                       offset += le16_to_cpu(de->rec_len);
+                       offset += ext3_rec_len_from_disk(de->rec_len);
                        if (le32_to_cpu(de->inode)) {
                                /* We might block in the next section
                                 * if the data destination is
@@ -219,7 +219,7 @@ revalidate:
                                        goto revalidate;
                                stored ++;
                        }
-                       filp->f_pos += le16_to_cpu(de->rec_len);
+                       filp->f_pos += ext3_rec_len_from_disk(de->rec_len);
                }
                offset = 0;
                brelse (bh);
index 4a2a02c95bf94b98fc4534d870f3546a45442c8e..023a070f55f18fac29cfddafa08557085ad6b2fa 100644 (file)
@@ -51,6 +51,11 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
                        flags &= ~EXT3_DIRSYNC_FL;
 
                mutex_lock(&inode->i_mutex);
+               /* Is it quota file? Do not allow user to mess with it */
+               if (IS_NOQUOTA(inode)) {
+                       mutex_unlock(&inode->i_mutex);
+                       return -EPERM;
+               }
                oldflags = ei->i_flags;
 
                /* The JOURNAL_DATA flag is modifiable only by root */
index ec8170adac5397de65b862fa549e27acdc9ab294..4ab6f76e63d0cda8e125672153571038f48b16c6 100644 (file)
@@ -176,6 +176,16 @@ static struct buffer_head * ext3_dx_find_entry(struct dentry *dentry,
 static int ext3_dx_add_entry(handle_t *handle, struct dentry *dentry,
                             struct inode *inode);
 
+/*
+ * p is at least 6 bytes before the end of page
+ */
+static inline struct ext3_dir_entry_2 *
+ext3_next_entry(struct ext3_dir_entry_2 *p)
+{
+       return (struct ext3_dir_entry_2 *)((char *)p +
+               ext3_rec_len_from_disk(p->rec_len));
+}
+
 /*
  * Future: use high four bits of block for coalesce-on-delete flags
  * Mask them off for now.
@@ -280,7 +290,7 @@ static struct stats dx_show_leaf(struct dx_hash_info *hinfo, struct ext3_dir_ent
                        space += EXT3_DIR_REC_LEN(de->name_len);
                        names++;
                }
-               de = (struct ext3_dir_entry_2 *) ((char *) de + le16_to_cpu(de->rec_len));
+               de = ext3_next_entry(de);
        }
        printk("(%i)\n", names);
        return (struct stats) { names, space, 1 };
@@ -546,14 +556,6 @@ static int ext3_htree_next_block(struct inode *dir, __u32 hash,
 }
 
 
-/*
- * p is at least 6 bytes before the end of page
- */
-static inline struct ext3_dir_entry_2 *ext3_next_entry(struct ext3_dir_entry_2 *p)
-{
-       return (struct ext3_dir_entry_2 *)((char*)p + le16_to_cpu(p->rec_len));
-}
-
 /*
  * This function fills a red-black tree with information from a
  * directory block.  It returns the number directory entries loaded
@@ -720,7 +722,7 @@ static int dx_make_map (struct ext3_dir_entry_2 *de, int size,
                        cond_resched();
                }
                /* XXX: do we need to check rec_len == 0 case? -Chris */
-               de = (struct ext3_dir_entry_2 *) ((char *) de + le16_to_cpu(de->rec_len));
+               de = ext3_next_entry(de);
        }
        return count;
 }
@@ -822,7 +824,7 @@ static inline int search_dirblock(struct buffer_head * bh,
                        return 1;
                }
                /* prevent looping on a bad block */
-               de_len = le16_to_cpu(de->rec_len);
+               de_len = ext3_rec_len_from_disk(de->rec_len);
                if (de_len <= 0)
                        return -1;
                offset += de_len;
@@ -1130,7 +1132,7 @@ dx_move_dirents(char *from, char *to, struct dx_map_entry *map, int count)
                rec_len = EXT3_DIR_REC_LEN(de->name_len);
                memcpy (to, de, rec_len);
                ((struct ext3_dir_entry_2 *) to)->rec_len =
-                               cpu_to_le16(rec_len);
+                               ext3_rec_len_to_disk(rec_len);
                de->inode = 0;
                map++;
                to += rec_len;
@@ -1149,13 +1151,12 @@ static struct ext3_dir_entry_2* dx_pack_dirents(char *base, int size)
 
        prev = to = de;
        while ((char*)de < base + size) {
-               next = (struct ext3_dir_entry_2 *) ((char *) de +
-                                                   le16_to_cpu(de->rec_len));
+               next = ext3_next_entry(de);
                if (de->inode && de->name_len) {
                        rec_len = EXT3_DIR_REC_LEN(de->name_len);
                        if (de > to)
                                memmove(to, de, rec_len);
-                       to->rec_len = cpu_to_le16(rec_len);
+                       to->rec_len = ext3_rec_len_to_disk(rec_len);
                        prev = to;
                        to = (struct ext3_dir_entry_2 *) (((char *) to) + rec_len);
                }
@@ -1229,8 +1230,8 @@ static struct ext3_dir_entry_2 *do_split(handle_t *handle, struct inode *dir,
        /* Fancy dance to stay within two buffers */
        de2 = dx_move_dirents(data1, data2, map + split, count - split);
        de = dx_pack_dirents(data1,blocksize);
-       de->rec_len = cpu_to_le16(data1 + blocksize - (char *) de);
-       de2->rec_len = cpu_to_le16(data2 + blocksize - (char *) de2);
+       de->rec_len = ext3_rec_len_to_disk(data1 + blocksize - (char *) de);
+       de2->rec_len = ext3_rec_len_to_disk(data2 + blocksize - (char *) de2);
        dxtrace(dx_show_leaf (hinfo, (struct ext3_dir_entry_2 *) data1, blocksize, 1));
        dxtrace(dx_show_leaf (hinfo, (struct ext3_dir_entry_2 *) data2, blocksize, 1));
 
@@ -1300,7 +1301,7 @@ static int add_dirent_to_buf(handle_t *handle, struct dentry *dentry,
                                return -EEXIST;
                        }
                        nlen = EXT3_DIR_REC_LEN(de->name_len);
-                       rlen = le16_to_cpu(de->rec_len);
+                       rlen = ext3_rec_len_from_disk(de->rec_len);
                        if ((de->inode? rlen - nlen: rlen) >= reclen)
                                break;
                        de = (struct ext3_dir_entry_2 *)((char *)de + rlen);
@@ -1319,11 +1320,11 @@ static int add_dirent_to_buf(handle_t *handle, struct dentry *dentry,
 
        /* By now the buffer is marked for journaling */
        nlen = EXT3_DIR_REC_LEN(de->name_len);
-       rlen = le16_to_cpu(de->rec_len);
+       rlen = ext3_rec_len_from_disk(de->rec_len);
        if (de->inode) {
                struct ext3_dir_entry_2 *de1 = (struct ext3_dir_entry_2 *)((char *)de + nlen);
-               de1->rec_len = cpu_to_le16(rlen - nlen);
-               de->rec_len = cpu_to_le16(nlen);
+               de1->rec_len = ext3_rec_len_to_disk(rlen - nlen);
+               de->rec_len = ext3_rec_len_to_disk(nlen);
                de = de1;
        }
        de->file_type = EXT3_FT_UNKNOWN;
@@ -1400,17 +1401,18 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
 
        /* The 0th block becomes the root, move the dirents out */
        fde = &root->dotdot;
-       de = (struct ext3_dir_entry_2 *)((char *)fde + le16_to_cpu(fde->rec_len));
+       de = (struct ext3_dir_entry_2 *)((char *)fde +
+                       ext3_rec_len_from_disk(fde->rec_len));
        len = ((char *) root) + blocksize - (char *) de;
        memcpy (data1, de, len);
        de = (struct ext3_dir_entry_2 *) data1;
        top = data1 + len;
-       while ((char *)(de2=(void*)de+le16_to_cpu(de->rec_len)) < top)
+       while ((char *)(de2 = ext3_next_entry(de)) < top)
                de = de2;
-       de->rec_len = cpu_to_le16(data1 + blocksize - (char *) de);
+       de->rec_len = ext3_rec_len_to_disk(data1 + blocksize - (char *) de);
        /* Initialize the root; the dot dirents already exist */
        de = (struct ext3_dir_entry_2 *) (&root->dotdot);
-       de->rec_len = cpu_to_le16(blocksize - EXT3_DIR_REC_LEN(2));
+       de->rec_len = ext3_rec_len_to_disk(blocksize - EXT3_DIR_REC_LEN(2));
        memset (&root->info, 0, sizeof(root->info));
        root->info.info_length = sizeof(root->info);
        root->info.hash_version = EXT3_SB(dir->i_sb)->s_def_hash_version;
@@ -1490,7 +1492,7 @@ static int ext3_add_entry (handle_t *handle, struct dentry *dentry,
                return retval;
        de = (struct ext3_dir_entry_2 *) bh->b_data;
        de->inode = 0;
-       de->rec_len = cpu_to_le16(blocksize);
+       de->rec_len = ext3_rec_len_to_disk(blocksize);
        return add_dirent_to_buf(handle, dentry, inode, de, bh);
 }
 
@@ -1553,7 +1555,7 @@ static int ext3_dx_add_entry(handle_t *handle, struct dentry *dentry,
                        goto cleanup;
                node2 = (struct dx_node *)(bh2->b_data);
                entries2 = node2->entries;
-               node2->fake.rec_len = cpu_to_le16(sb->s_blocksize);
+               node2->fake.rec_len = ext3_rec_len_to_disk(sb->s_blocksize);
                node2->fake.inode = 0;
                BUFFER_TRACE(frame->bh, "get_write_access");
                err = ext3_journal_get_write_access(handle, frame->bh);
@@ -1651,9 +1653,9 @@ static int ext3_delete_entry (handle_t *handle,
                        BUFFER_TRACE(bh, "get_write_access");
                        ext3_journal_get_write_access(handle, bh);
                        if (pde)
-                               pde->rec_len =
-                                       cpu_to_le16(le16_to_cpu(pde->rec_len) +
-                                                   le16_to_cpu(de->rec_len));
+                               pde->rec_len = ext3_rec_len_to_disk(
+                                       ext3_rec_len_from_disk(pde->rec_len) +
+                                       ext3_rec_len_from_disk(de->rec_len));
                        else
                                de->inode = 0;
                        dir->i_version++;
@@ -1661,10 +1663,9 @@ static int ext3_delete_entry (handle_t *handle,
                        ext3_journal_dirty_metadata(handle, bh);
                        return 0;
                }
-               i += le16_to_cpu(de->rec_len);
+               i += ext3_rec_len_from_disk(de->rec_len);
                pde = de;
-               de = (struct ext3_dir_entry_2 *)
-                       ((char *) de + le16_to_cpu(de->rec_len));
+               de = ext3_next_entry(de);
        }
        return -ENOENT;
 }
@@ -1798,13 +1799,13 @@ retry:
        de = (struct ext3_dir_entry_2 *) dir_block->b_data;
        de->inode = cpu_to_le32(inode->i_ino);
        de->name_len = 1;
-       de->rec_len = cpu_to_le16(EXT3_DIR_REC_LEN(de->name_len));
+       de->rec_len = ext3_rec_len_to_disk(EXT3_DIR_REC_LEN(de->name_len));
        strcpy (de->name, ".");
        ext3_set_de_type(dir->i_sb, de, S_IFDIR);
-       de = (struct ext3_dir_entry_2 *)
-                       ((char *) de + le16_to_cpu(de->rec_len));
+       de = ext3_next_entry(de);
        de->inode = cpu_to_le32(dir->i_ino);
-       de->rec_len = cpu_to_le16(inode->i_sb->s_blocksize-EXT3_DIR_REC_LEN(1));
+       de->rec_len = ext3_rec_len_to_disk(inode->i_sb->s_blocksize -
+                                       EXT3_DIR_REC_LEN(1));
        de->name_len = 2;
        strcpy (de->name, "..");
        ext3_set_de_type(dir->i_sb, de, S_IFDIR);
@@ -1856,8 +1857,7 @@ static int empty_dir (struct inode * inode)
                return 1;
        }
        de = (struct ext3_dir_entry_2 *) bh->b_data;
-       de1 = (struct ext3_dir_entry_2 *)
-                       ((char *) de + le16_to_cpu(de->rec_len));
+       de1 = ext3_next_entry(de);
        if (le32_to_cpu(de->inode) != inode->i_ino ||
                        !le32_to_cpu(de1->inode) ||
                        strcmp (".", de->name) ||
@@ -1868,9 +1868,9 @@ static int empty_dir (struct inode * inode)
                brelse (bh);
                return 1;
        }
-       offset = le16_to_cpu(de->rec_len) + le16_to_cpu(de1->rec_len);
-       de = (struct ext3_dir_entry_2 *)
-                       ((char *) de1 + le16_to_cpu(de1->rec_len));
+       offset = ext3_rec_len_from_disk(de->rec_len) +
+                       ext3_rec_len_from_disk(de1->rec_len);
+       de = ext3_next_entry(de1);
        while (offset < inode->i_size ) {
                if (!bh ||
                        (void *) de >= (void *) (bh->b_data+sb->s_blocksize)) {
@@ -1899,9 +1899,8 @@ static int empty_dir (struct inode * inode)
                        brelse (bh);
                        return 0;
                }
-               offset += le16_to_cpu(de->rec_len);
-               de = (struct ext3_dir_entry_2 *)
-                               ((char *) de + le16_to_cpu(de->rec_len));
+               offset += ext3_rec_len_from_disk(de->rec_len);
+               de = ext3_next_entry(de);
        }
        brelse (bh);
        return 1;
@@ -2255,8 +2254,7 @@ retry:
 }
 
 #define PARENT_INO(buffer) \
-       ((struct ext3_dir_entry_2 *) ((char *) buffer + \
-       le16_to_cpu(((struct ext3_dir_entry_2 *) buffer)->rec_len)))->inode
+       (ext3_next_entry((struct ext3_dir_entry_2 *)(buffer))->inode)
 
 /*
  * Anybody can rename anything with this: the permission checks are left to the
index e906b65448e2ed9da721f68056333eacf4386e98..71ee95e534fdcb6c7128aa843accea7b9a082eec 100644 (file)
@@ -189,15 +189,6 @@ struct ext4_group_desc * ext4_get_group_desc(struct super_block * sb,
        return desc;
 }
 
-static inline int
-block_in_use(ext4_fsblk_t block, struct super_block *sb, unsigned char *map)
-{
-       ext4_grpblk_t offset;
-
-       ext4_get_group_no_and_offset(sb, block, NULL, &offset);
-       return ext4_test_bit (offset, map);
-}
-
 /**
  * read_block_bitmap()
  * @sb:                        super block
@@ -211,7 +202,6 @@ block_in_use(ext4_fsblk_t block, struct super_block *sb, unsigned char *map)
 struct buffer_head *
 read_block_bitmap(struct super_block *sb, unsigned int block_group)
 {
-       int i;
        struct ext4_group_desc * desc;
        struct buffer_head * bh = NULL;
        ext4_fsblk_t bitmap_blk;
@@ -239,38 +229,7 @@ read_block_bitmap(struct super_block *sb, unsigned int block_group)
                            "Cannot read block bitmap - "
                            "block_group = %d, block_bitmap = %llu",
                            block_group, bitmap_blk);
-
-       /* check whether block bitmap block number is set */
-       if (!block_in_use(bitmap_blk, sb, bh->b_data)) {
-               /* bad block bitmap */
-               goto error_out;
-       }
-
-       /* check whether the inode bitmap block number is set */
-       bitmap_blk = ext4_inode_bitmap(sb, desc);
-       if (!block_in_use(bitmap_blk, sb, bh->b_data)) {
-               /* bad block bitmap */
-               goto error_out;
-       }
-       /* check whether the inode table block number is set */
-       bitmap_blk = ext4_inode_table(sb, desc);
-       for (i = 0; i < EXT4_SB(sb)->s_itb_per_group; i++, bitmap_blk++) {
-               if (!block_in_use(bitmap_blk, sb, bh->b_data)) {
-                       /* bad block bitmap */
-                       goto error_out;
-               }
-       }
-
        return bh;
-
-error_out:
-       brelse(bh);
-       ext4_error(sb, __FUNCTION__,
-                       "Invalid block bitmap - "
-                       "block_group = %d, block = %llu",
-                       block_group, bitmap_blk);
-       return NULL;
-
 }
 /*
  * The reservation window structure operations
index c04c7ccba9e3f140ed5243a6ccdcc58d6afcaa15..e7f894bdb4202359974088ba5c1f14585a43fc03 100644 (file)
@@ -51,6 +51,11 @@ int ext4_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
                        flags &= ~EXT4_DIRSYNC_FL;
 
                mutex_lock(&inode->i_mutex);
+               /* Is it quota file? Do not allow user to mess with it */
+               if (IS_NOQUOTA(inode)) {
+                       mutex_unlock(&inode->i_mutex);
+                       return -EPERM;
+               }
                oldflags = ei->i_flags;
 
                /* The JOURNAL_DATA flag is modifiable only by root */
index 0fcdba9d47c090ba5b6dae59abfdc41897d5b7f1..535b37399009128df2413d3b7632160390113b9c 100644 (file)
@@ -55,9 +55,10 @@ struct fuse_file *fuse_file_alloc(void)
                if (!ff->reserved_req) {
                        kfree(ff);
                        ff = NULL;
+               } else {
+                       INIT_LIST_HEAD(&ff->write_entry);
+                       atomic_set(&ff->count, 0);
                }
-               INIT_LIST_HEAD(&ff->write_entry);
-               atomic_set(&ff->count, 0);
        }
        return ff;
 }
index 12aca8ed605f1616b1f1deda3867464780fcf66d..09ee07f026630501869eb0bd53131e46b7f8d82d 100644 (file)
@@ -364,7 +364,6 @@ static void truncate_hugepages(struct inode *inode, loff_t lstart)
                        ++next;
                        truncate_huge_page(page);
                        unlock_page(page);
-                       hugetlb_put_quota(mapping);
                        freed++;
                }
                huge_pagevec_release(&pvec);
@@ -859,15 +858,15 @@ out_free:
        return -ENOMEM;
 }
 
-int hugetlb_get_quota(struct address_space *mapping)
+int hugetlb_get_quota(struct address_space *mapping, long delta)
 {
        int ret = 0;
        struct hugetlbfs_sb_info *sbinfo = HUGETLBFS_SB(mapping->host->i_sb);
 
        if (sbinfo->free_blocks > -1) {
                spin_lock(&sbinfo->stat_lock);
-               if (sbinfo->free_blocks > 0)
-                       sbinfo->free_blocks--;
+               if (sbinfo->free_blocks - delta >= 0)
+                       sbinfo->free_blocks -= delta;
                else
                        ret = -ENOMEM;
                spin_unlock(&sbinfo->stat_lock);
@@ -876,13 +875,13 @@ int hugetlb_get_quota(struct address_space *mapping)
        return ret;
 }
 
-void hugetlb_put_quota(struct address_space *mapping)
+void hugetlb_put_quota(struct address_space *mapping, long delta)
 {
        struct hugetlbfs_sb_info *sbinfo = HUGETLBFS_SB(mapping->host->i_sb);
 
        if (sbinfo->free_blocks > -1) {
                spin_lock(&sbinfo->stat_lock);
-               sbinfo->free_blocks++;
+               sbinfo->free_blocks += delta;
                spin_unlock(&sbinfo->stat_lock);
        }
 }
index d6ff77e8e7ec563b273bd94d2458ba89b1355cee..e4e01bc7f3387daf2b9282a4ec614a50b5955190 100644 (file)
@@ -78,6 +78,10 @@ asmlinkage long sys_ioprio_set(int which, int who, int ioprio)
                        if (!capable(CAP_SYS_ADMIN))
                                return -EPERM;
                        break;
+               case IOPRIO_CLASS_NONE:
+                       if (data)
+                               return -EINVAL;
+                       break;
                default:
                        return -EINVAL;
        }
index 3c8663bea98ca3bf373f3ea83260b33d67548f3a..dfda12a073e1985fb28b798df2e9088a9a996be4 100644 (file)
@@ -79,6 +79,9 @@ int jfs_ioctl(struct inode * inode, struct file * filp, unsigned int cmd,
                if (!S_ISDIR(inode->i_mode))
                        flags &= ~JFS_DIRSYNC_FL;
 
+               /* Is it quota file? Do not allow user to mess with it */
+               if (IS_NOQUOTA(inode))
+                       return -EPERM;
                jfs_get_inode_flags(jfs_inode);
                oldflags = jfs_inode->mode2;
 
index 0127a2846819148df5b9a8722118e11ed60e253b..8b8388eca05e88bde827d97bc71193247c190e86 100644 (file)
@@ -696,17 +696,28 @@ EXPORT_SYMBOL(posix_test_lock);
  * Note: the above assumption may not be true when handling lock requests
  * from a broken NFS client. But broken NFS clients have a lot more to
  * worry about than proper deadlock detection anyway... --okir
+ *
+ * However, the failure of this assumption (also possible in the case of
+ * multiple tasks sharing the same open file table) also means there's no
+ * guarantee that the loop below will terminate.  As a hack, we give up
+ * after a few iterations.
  */
+
+#define MAX_DEADLK_ITERATIONS 10
+
 static int posix_locks_deadlock(struct file_lock *caller_fl,
                                struct file_lock *block_fl)
 {
        struct file_lock *fl;
+       int i = 0;
 
 next_task:
        if (posix_same_owner(caller_fl, block_fl))
                return 1;
        list_for_each_entry(fl, &blocked_list, fl_link) {
                if (posix_same_owner(fl, block_fl)) {
+                       if (i++ > MAX_DEADLK_ITERATIONS)
+                               return 0;
                        fl = fl->fl_next;
                        block_fl = fl;
                        goto next_task;
index 35334539d9475dc0188bdb80f4a1d15ef70b56a9..f697b5c74b7c38f5627ea71c9d2ec9ac95bc3eba 100644 (file)
@@ -38,6 +38,7 @@
 #include "nfs4_fs.h"
 #include "delegation.h"
 #include "iostat.h"
+#include "internal.h"
 
 /* #define NFS_DEBUG_VERBOSE 1 */
 
index afcab007a22b519ad1542f47175c1b56fb132cf4..5e8d82f6666be9e1cd4ec1d4d645c394e115d2f1 100644 (file)
@@ -263,17 +263,19 @@ static const struct rpc_call_ops nfs_read_direct_ops = {
  * handled automatically by nfs_direct_read_result().  Otherwise, if
  * no requests have been sent, just return an error.
  */
-static ssize_t nfs_direct_read_schedule(struct nfs_direct_req *dreq, unsigned long user_addr, size_t count, loff_t pos)
+static ssize_t nfs_direct_read_schedule_segment(struct nfs_direct_req *dreq,
+                                               const struct iovec *iov,
+                                               loff_t pos)
 {
        struct nfs_open_context *ctx = dreq->ctx;
        struct inode *inode = ctx->path.dentry->d_inode;
+       unsigned long user_addr = (unsigned long)iov->iov_base;
+       size_t count = iov->iov_len;
        size_t rsize = NFS_SERVER(inode)->rsize;
        unsigned int pgbase;
        int result;
        ssize_t started = 0;
 
-       get_dreq(dreq);
-
        do {
                struct nfs_read_data *data;
                size_t bytes;
@@ -347,15 +349,46 @@ static ssize_t nfs_direct_read_schedule(struct nfs_direct_req *dreq, unsigned lo
                count -= bytes;
        } while (count != 0);
 
+       if (started)
+               return started;
+       return result < 0 ? (ssize_t) result : -EFAULT;
+}
+
+static ssize_t nfs_direct_read_schedule_iovec(struct nfs_direct_req *dreq,
+                                             const struct iovec *iov,
+                                             unsigned long nr_segs,
+                                             loff_t pos)
+{
+       ssize_t result = -EINVAL;
+       size_t requested_bytes = 0;
+       unsigned long seg;
+
+       get_dreq(dreq);
+
+       for (seg = 0; seg < nr_segs; seg++) {
+               const struct iovec *vec = &iov[seg];
+               result = nfs_direct_read_schedule_segment(dreq, vec, pos);
+               if (result < 0)
+                       break;
+               requested_bytes += result;
+               if ((size_t)result < vec->iov_len)
+                       break;
+               pos += vec->iov_len;
+       }
+
        if (put_dreq(dreq))
                nfs_direct_complete(dreq);
 
-       if (started)
+       if (requested_bytes != 0)
                return 0;
-       return result < 0 ? (ssize_t) result : -EFAULT;
+
+       if (result < 0)
+               return result;
+       return -EIO;
 }
 
-static ssize_t nfs_direct_read(struct kiocb *iocb, unsigned long user_addr, size_t count, loff_t pos)
+static ssize_t nfs_direct_read(struct kiocb *iocb, const struct iovec *iov,
+                              unsigned long nr_segs, loff_t pos)
 {
        ssize_t result = 0;
        sigset_t oldset;
@@ -372,9 +405,8 @@ static ssize_t nfs_direct_read(struct kiocb *iocb, unsigned long user_addr, size
        if (!is_sync_kiocb(iocb))
                dreq->iocb = iocb;
 
-       nfs_add_stats(inode, NFSIOS_DIRECTREADBYTES, count);
        rpc_clnt_sigmask(clnt, &oldset);
-       result = nfs_direct_read_schedule(dreq, user_addr, count, pos);
+       result = nfs_direct_read_schedule_iovec(dreq, iov, nr_segs, pos);
        if (!result)
                result = nfs_direct_wait(dreq);
        rpc_clnt_sigunmask(clnt, &oldset);
@@ -601,17 +633,19 @@ static const struct rpc_call_ops nfs_write_direct_ops = {
  * handled automatically by nfs_direct_write_result().  Otherwise, if
  * no requests have been sent, just return an error.
  */
-static ssize_t nfs_direct_write_schedule(struct nfs_direct_req *dreq, unsigned long user_addr, size_t count, loff_t pos, int sync)
+static ssize_t nfs_direct_write_schedule_segment(struct nfs_direct_req *dreq,
+                                                const struct iovec *iov,
+                                                loff_t pos, int sync)
 {
        struct nfs_open_context *ctx = dreq->ctx;
        struct inode *inode = ctx->path.dentry->d_inode;
+       unsigned long user_addr = (unsigned long)iov->iov_base;
+       size_t count = iov->iov_len;
        size_t wsize = NFS_SERVER(inode)->wsize;
        unsigned int pgbase;
        int result;
        ssize_t started = 0;
 
-       get_dreq(dreq);
-
        do {
                struct nfs_write_data *data;
                size_t bytes;
@@ -689,15 +723,48 @@ static ssize_t nfs_direct_write_schedule(struct nfs_direct_req *dreq, unsigned l
                count -= bytes;
        } while (count != 0);
 
+       if (started)
+               return started;
+       return result < 0 ? (ssize_t) result : -EFAULT;
+}
+
+static ssize_t nfs_direct_write_schedule_iovec(struct nfs_direct_req *dreq,
+                                              const struct iovec *iov,
+                                              unsigned long nr_segs,
+                                              loff_t pos, int sync)
+{
+       ssize_t result = 0;
+       size_t requested_bytes = 0;
+       unsigned long seg;
+
+       get_dreq(dreq);
+
+       for (seg = 0; seg < nr_segs; seg++) {
+               const struct iovec *vec = &iov[seg];
+               result = nfs_direct_write_schedule_segment(dreq, vec,
+                                                          pos, sync);
+               if (result < 0)
+                       break;
+               requested_bytes += result;
+               if ((size_t)result < vec->iov_len)
+                       break;
+               pos += vec->iov_len;
+       }
+
        if (put_dreq(dreq))
-               nfs_direct_write_complete(dreq, inode);
+               nfs_direct_write_complete(dreq, dreq->inode);
 
-       if (started)
+       if (requested_bytes != 0)
                return 0;
-       return result < 0 ? (ssize_t) result : -EFAULT;
+
+       if (result < 0)
+               return result;
+       return -EIO;
 }
 
-static ssize_t nfs_direct_write(struct kiocb *iocb, unsigned long user_addr, size_t count, loff_t pos)
+static ssize_t nfs_direct_write(struct kiocb *iocb, const struct iovec *iov,
+                               unsigned long nr_segs, loff_t pos,
+                               size_t count)
 {
        ssize_t result = 0;
        sigset_t oldset;
@@ -720,10 +787,8 @@ static ssize_t nfs_direct_write(struct kiocb *iocb, unsigned long user_addr, siz
        if (!is_sync_kiocb(iocb))
                dreq->iocb = iocb;
 
-       nfs_add_stats(inode, NFSIOS_DIRECTWRITTENBYTES, count);
-
        rpc_clnt_sigmask(clnt, &oldset);
-       result = nfs_direct_write_schedule(dreq, user_addr, count, pos, sync);
+       result = nfs_direct_write_schedule_iovec(dreq, iov, nr_segs, pos, sync);
        if (!result)
                result = nfs_direct_wait(dreq);
        rpc_clnt_sigunmask(clnt, &oldset);
@@ -759,21 +824,16 @@ ssize_t nfs_file_direct_read(struct kiocb *iocb, const struct iovec *iov,
        ssize_t retval = -EINVAL;
        struct file *file = iocb->ki_filp;
        struct address_space *mapping = file->f_mapping;
-       /* XXX: temporary */
-       const char __user *buf = iov[0].iov_base;
-       size_t count = iov[0].iov_len;
+       size_t count;
+
+       count = iov_length(iov, nr_segs);
+       nfs_add_stats(mapping->host, NFSIOS_DIRECTREADBYTES, count);
 
-       dprintk("nfs: direct read(%s/%s, %lu@%Ld)\n",
+       dprintk("nfs: direct read(%s/%s, %zd@%Ld)\n",
                file->f_path.dentry->d_parent->d_name.name,
                file->f_path.dentry->d_name.name,
-               (unsigned long) count, (long long) pos);
-
-       if (nr_segs != 1)
-               goto out;
+               count, (long long) pos);
 
-       retval = -EFAULT;
-       if (!access_ok(VERIFY_WRITE, buf, count))
-               goto out;
        retval = 0;
        if (!count)
                goto out;
@@ -782,7 +842,7 @@ ssize_t nfs_file_direct_read(struct kiocb *iocb, const struct iovec *iov,
        if (retval)
                goto out;
 
-       retval = nfs_direct_read(iocb, (unsigned long) buf, count, pos);
+       retval = nfs_direct_read(iocb, iov, nr_segs, pos);
        if (retval > 0)
                iocb->ki_pos = pos + retval;
 
@@ -821,21 +881,21 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, const struct iovec *iov,
        ssize_t retval = -EINVAL;
        struct file *file = iocb->ki_filp;
        struct address_space *mapping = file->f_mapping;
-       /* XXX: temporary */
-       const char __user *buf = iov[0].iov_base;
-       size_t count = iov[0].iov_len;
+       size_t count;
+
+       count = iov_length(iov, nr_segs);
+       nfs_add_stats(mapping->host, NFSIOS_DIRECTWRITTENBYTES, count);
 
-       dprintk("nfs: direct write(%s/%s, %lu@%Ld)\n",
+       dfprintk(VFS, "nfs: direct write(%s/%s, %zd@%Ld)\n",
                file->f_path.dentry->d_parent->d_name.name,
                file->f_path.dentry->d_name.name,
-               (unsigned long) count, (long long) pos);
-
-       if (nr_segs != 1)
-               goto out;
+               count, (long long) pos);
 
        retval = generic_write_checks(file, &pos, &count, 0);
        if (retval)
                goto out;
+       if (!count)
+               goto out;       /* return 0 */
 
        retval = -EINVAL;
        if ((ssize_t) count < 0)
@@ -844,15 +904,11 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, const struct iovec *iov,
        if (!count)
                goto out;
 
-       retval = -EFAULT;
-       if (!access_ok(VERIFY_READ, buf, count))
-               goto out;
-
        retval = nfs_sync_mapping(mapping);
        if (retval)
                goto out;
 
-       retval = nfs_direct_write(iocb, (unsigned long) buf, count, pos);
+       retval = nfs_direct_write(iocb, iov, nr_segs, pos, count);
 
        if (retval > 0)
                iocb->ki_pos = pos + retval;
index 522e5ad4d8ad9b3946e201926c7f799ddf0f2e36..0ee43843f4ec40c79f1516fb869a5eb720cb355c 100644 (file)
 
 #define NFSDBG_FACILITY                NFSDBG_CLIENT
 
+/*
+ * Set the superblock root dentry.
+ * Note that this function frees the inode in case of error.
+ */
+static int nfs_superblock_set_dummy_root(struct super_block *sb, struct inode *inode)
+{
+       /* The mntroot acts as the dummy root dentry for this superblock */
+       if (sb->s_root == NULL) {
+               sb->s_root = d_alloc_root(inode);
+               if (sb->s_root == NULL) {
+                       iput(inode);
+                       return -ENOMEM;
+               }
+               /* Circumvent igrab(): we know the inode is not being freed */
+               atomic_inc(&inode->i_count);
+       }
+       return 0;
+}
+
 /*
  * get an NFS2/NFS3 root dentry from the root filehandle
  */
@@ -54,33 +73,6 @@ struct dentry *nfs_get_root(struct super_block *sb, struct nfs_fh *mntfh)
        struct inode *inode;
        int error;
 
-       /* create a dummy root dentry with dummy inode for this superblock */
-       if (!sb->s_root) {
-               struct nfs_fh dummyfh;
-               struct dentry *root;
-               struct inode *iroot;
-
-               memset(&dummyfh, 0, sizeof(dummyfh));
-               memset(&fattr, 0, sizeof(fattr));
-               nfs_fattr_init(&fattr);
-               fattr.valid = NFS_ATTR_FATTR;
-               fattr.type = NFDIR;
-               fattr.mode = S_IFDIR | S_IRUSR | S_IWUSR;
-               fattr.nlink = 2;
-
-               iroot = nfs_fhget(sb, &dummyfh, &fattr);
-               if (IS_ERR(iroot))
-                       return ERR_PTR(PTR_ERR(iroot));
-
-               root = d_alloc_root(iroot);
-               if (!root) {
-                       iput(iroot);
-                       return ERR_PTR(-ENOMEM);
-               }
-
-               sb->s_root = root;
-       }
-
        /* get the actual root for this mount */
        fsinfo.fattr = &fattr;
 
@@ -96,6 +88,10 @@ struct dentry *nfs_get_root(struct super_block *sb, struct nfs_fh *mntfh)
                return ERR_PTR(PTR_ERR(inode));
        }
 
+       error = nfs_superblock_set_dummy_root(sb, inode);
+       if (error != 0)
+               return ERR_PTR(error);
+
        /* root dentries normally start off anonymous and get spliced in later
         * if the dentry tree reaches them; however if the dentry already
         * exists, we'll pick it up at this point and use it as the root
@@ -241,33 +237,6 @@ struct dentry *nfs4_get_root(struct super_block *sb, struct nfs_fh *mntfh)
 
        dprintk("--> nfs4_get_root()\n");
 
-       /* create a dummy root dentry with dummy inode for this superblock */
-       if (!sb->s_root) {
-               struct nfs_fh dummyfh;
-               struct dentry *root;
-               struct inode *iroot;
-
-               memset(&dummyfh, 0, sizeof(dummyfh));
-               memset(&fattr, 0, sizeof(fattr));
-               nfs_fattr_init(&fattr);
-               fattr.valid = NFS_ATTR_FATTR;
-               fattr.type = NFDIR;
-               fattr.mode = S_IFDIR | S_IRUSR | S_IWUSR;
-               fattr.nlink = 2;
-
-               iroot = nfs_fhget(sb, &dummyfh, &fattr);
-               if (IS_ERR(iroot))
-                       return ERR_PTR(PTR_ERR(iroot));
-
-               root = d_alloc_root(iroot);
-               if (!root) {
-                       iput(iroot);
-                       return ERR_PTR(-ENOMEM);
-               }
-
-               sb->s_root = root;
-       }
-
        /* get the info about the server and filesystem */
        error = nfs4_server_capabilities(server, mntfh);
        if (error < 0) {
@@ -289,6 +258,10 @@ struct dentry *nfs4_get_root(struct super_block *sb, struct nfs_fh *mntfh)
                return ERR_PTR(PTR_ERR(inode));
        }
 
+       error = nfs_superblock_set_dummy_root(sb, inode);
+       if (error != 0)
+               return ERR_PTR(error);
+
        /* root dentries normally start off anonymous and get spliced in later
         * if the dentry tree reaches them; however if the dentry already
         * exists, we'll pick it up at this point and use it as the root
index fa517ae9207f6d04f66fcf4c0b12ef229bc5a176..2426e713b77f19567f82824c39126acacb59721d 100644 (file)
@@ -1054,10 +1054,11 @@ static int nfs_validate_mount_data(void *options,
 {
        struct nfs_mount_data *data = (struct nfs_mount_data *)options;
 
+       memset(args, 0, sizeof(*args));
+
        if (data == NULL)
                goto out_no_data;
 
-       memset(args, 0, sizeof(*args));
        args->flags             = (NFS_MOUNT_VER3 | NFS_MOUNT_TCP);
        args->rsize             = NFS_MAX_FILE_IO_SIZE;
        args->wsize             = NFS_MAX_FILE_IO_SIZE;
@@ -1474,6 +1475,11 @@ static int nfs_xdev_get_sb(struct file_system_type *fs_type, int flags,
                error = PTR_ERR(mntroot);
                goto error_splat_super;
        }
+       if (mntroot->d_inode->i_op != &nfs_dir_inode_operations) {
+               dput(mntroot);
+               error = -ESTALE;
+               goto error_splat_super;
+       }
 
        s->s_flags |= MS_ACTIVE;
        mnt->mnt_sb = s;
@@ -1531,10 +1537,11 @@ static int nfs4_validate_mount_data(void *options,
        struct nfs4_mount_data *data = (struct nfs4_mount_data *)options;
        char *c;
 
+       memset(args, 0, sizeof(*args));
+
        if (data == NULL)
                goto out_no_data;
 
-       memset(args, 0, sizeof(*args));
        args->rsize             = NFS_MAX_FILE_IO_SIZE;
        args->wsize             = NFS_MAX_FILE_IO_SIZE;
        args->timeo             = 600;
index 89527a487ed7d5365464bd6fe537c9014cfce117..51cc1bd6a116643067b29f4cf8549207e2088c65 100644 (file)
@@ -1436,7 +1436,8 @@ out:
        return ret;
 }
 
-int nfs_wb_page_priority(struct inode *inode, struct page *page, int how)
+static int nfs_wb_page_priority(struct inode *inode, struct page *page,
+                               int how)
 {
        loff_t range_start = page_offset(page);
        loff_t range_end = range_start + (loff_t)(PAGE_CACHE_SIZE - 1);
index b6174288501112f4cef17b0d4349e88832da551a..0e5fa11e6b44c4fa114e5e48ef0408a4227a5c07 100644 (file)
@@ -41,7 +41,7 @@ static __be32 nfsacld_proc_getacl(struct svc_rqst * rqstp,
 
        fh = fh_copy(&resp->fh, &argp->fh);
        if ((nfserr = fh_verify(rqstp, &resp->fh, 0, MAY_NOP)))
-               RETURN_STATUS(nfserr_inval);
+               RETURN_STATUS(nfserr);
 
        if (argp->mask & ~(NFS_ACL|NFS_ACLCNT|NFS_DFACL|NFS_DFACLCNT))
                RETURN_STATUS(nfserr_inval);
index 3e3f2de82c36bc4586789c79ca1a30aeb5272626..b647f2f872dcf60685bd03a1c5d3022b47bfb314 100644 (file)
@@ -37,7 +37,7 @@ static __be32 nfsd3_proc_getacl(struct svc_rqst * rqstp,
 
        fh = fh_copy(&resp->fh, &argp->fh);
        if ((nfserr = fh_verify(rqstp, &resp->fh, 0, MAY_NOP)))
-               RETURN_STATUS(nfserr_inval);
+               RETURN_STATUS(nfserr);
 
        if (argp->mask & ~(NFS_ACL|NFS_ACLCNT|NFS_DFACL|NFS_DFACLCNT))
                RETURN_STATUS(nfserr_inval);
index 6f03918018a3106b0ffdedb0da170c5613a05c69..1602cd00dd455c790d309742791164e7c7045a32 100644 (file)
@@ -43,7 +43,7 @@
 #include <linux/file.h>
 #include <linux/namei.h>
 #include <asm/uaccess.h>
-#include <asm/scatterlist.h>
+#include <linux/scatterlist.h>
 #include <linux/crypto.h>
 #include <linux/sched.h>
 
index 4f712e970584939847ed8287ffa0e379cea177e4..468f17a784416e96e11081d90230a8e6df4eec90 100644 (file)
@@ -95,6 +95,22 @@ nfsd_mode_check(struct svc_rqst *rqstp, umode_t mode, int type)
        return 0;
 }
 
+static __be32 nfsd_setuser_and_check_port(struct svc_rqst *rqstp,
+                                         struct svc_export *exp)
+{
+       /* Check if the request originated from a secure port. */
+       if (!rqstp->rq_secure && EX_SECURE(exp)) {
+               char buf[RPC_MAX_ADDRBUFLEN];
+               dprintk(KERN_WARNING
+                      "nfsd: request from insecure port %s!\n",
+                      svc_print_addr(rqstp, buf, sizeof(buf)));
+               return nfserr_perm;
+       }
+
+       /* Set user creds for this exportpoint */
+       return nfserrno(nfsd_setuser(rqstp, exp));
+}
+
 /*
  * Perform sanity checks on the dentry in a client's file handle.
  *
@@ -167,18 +183,7 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
                        goto out;
                }
 
-               /* Check if the request originated from a secure port. */
-               error = nfserr_perm;
-               if (!rqstp->rq_secure && EX_SECURE(exp)) {
-                       char buf[RPC_MAX_ADDRBUFLEN];
-                       printk(KERN_WARNING
-                              "nfsd: request from insecure port %s!\n",
-                              svc_print_addr(rqstp, buf, sizeof(buf)));
-                       goto out;
-               }
-
-               /* Set user creds for this exportpoint */
-               error = nfserrno(nfsd_setuser(rqstp, exp));
+               error = nfsd_setuser_and_check_port(rqstp, exp);
                if (error)
                        goto out;
 
@@ -227,18 +232,22 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
                fhp->fh_export = exp;
                nfsd_nr_verified++;
        } else {
-               /* just rechecking permissions
-                * (e.g. nfsproc_create calls fh_verify, then nfsd_create does as well)
+               /*
+                * just rechecking permissions
+                * (e.g. nfsproc_create calls fh_verify, then nfsd_create
+                * does as well)
                 */
                dprintk("nfsd: fh_verify - just checking\n");
                dentry = fhp->fh_dentry;
                exp = fhp->fh_export;
-               /* Set user creds for this exportpoint; necessary even
+               /*
+                * Set user creds for this exportpoint; necessary even
                 * in the "just checking" case because this may be a
                 * filehandle that was created by fh_compose, and that
                 * is about to be used in another nfsv4 compound
-                * operation */
-               error = nfserrno(nfsd_setuser(rqstp, exp));
+                * operation.
+                */
+               error = nfsd_setuser_and_check_port(rqstp, exp);
                if (error)
                        goto out;
        }
index cfdc7900d2710f70bee9aa7d591d8b8fb4c85c31..ad87cb01299b6d8febb7ae670fddb36ce33cc666 100644 (file)
@@ -405,6 +405,15 @@ static int ntfs_readpage(struct file *file, struct page *page)
 
 retry_readpage:
        BUG_ON(!PageLocked(page));
+       vi = page->mapping->host;
+       i_size = i_size_read(vi);
+       /* Is the page fully outside i_size? (truncate in progress) */
+       if (unlikely(page->index >= (i_size + PAGE_CACHE_SIZE - 1) >>
+                       PAGE_CACHE_SHIFT)) {
+               zero_user_page(page, 0, PAGE_CACHE_SIZE, KM_USER0);
+               ntfs_debug("Read outside i_size - truncated?");
+               goto done;
+       }
        /*
         * This can potentially happen because we clear PageUptodate() during
         * ntfs_writepage() of MstProtected() attributes.
@@ -413,7 +422,6 @@ retry_readpage:
                unlock_page(page);
                return 0;
        }
-       vi = page->mapping->host;
        ni = NTFS_I(vi);
        /*
         * Only $DATA attributes can be encrypted and only unnamed $DATA
index 92dabdcf2b80b2c0d8f1f5832e9eb0043be391d3..50d3b0c258e37cd0413568aef6d4216086a6bb02 100644 (file)
@@ -179,10 +179,7 @@ int ntfs_map_runlist_nolock(ntfs_inode *ni, VCN vcn, ntfs_attr_search_ctx *ctx)
         * ntfs_mapping_pairs_decompress() fails.
         */
        end_vcn = sle64_to_cpu(a->data.non_resident.highest_vcn) + 1;
-       if (!a->data.non_resident.lowest_vcn && end_vcn == 1)
-               end_vcn = sle64_to_cpu(a->data.non_resident.allocated_size) >>
-                               ni->vol->cluster_size_bits;
-       if (unlikely(vcn >= end_vcn)) {
+       if (unlikely(vcn && vcn >= end_vcn)) {
                err = -ENOENT;
                goto err_out;
        }
index d98daf59e0b64ac91bf3c950594ba6685e6ca737..d1619d05eb23bce83bea2d9f005e663625fa1f2e 100644 (file)
@@ -561,6 +561,16 @@ int ntfs_read_compressed_block(struct page *page)
        read_unlock_irqrestore(&ni->size_lock, flags);
        max_page = ((i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT) -
                        offset;
+       /* Is the page fully outside i_size? (truncate in progress) */
+       if (xpage >= max_page) {
+               kfree(bhs);
+               kfree(pages);
+               zero_user_page(page, 0, PAGE_CACHE_SIZE, KM_USER0);
+               ntfs_debug("Compressed read outside i_size - truncated?");
+               SetPageUptodate(page);
+               unlock_page(page);
+               return 0;
+       }
        if (nr_pages < max_page)
                max_page = nr_pages;
        for (i = 0; i < max_page; i++, offset++) {
index 4ba7f0bdc248e0ff4656b3a5a9bd56851233636f..ce62c152823dd2df71b1d504cc598a1983409d5d 100644 (file)
@@ -3946,7 +3946,7 @@ static int __ocfs2_mark_extent_written(struct inode *inode,
        struct ocfs2_merge_ctxt ctxt;
        struct ocfs2_extent_list *rightmost_el;
 
-       if (!rec->e_flags & OCFS2_EXT_UNWRITTEN) {
+       if (!(rec->e_flags & OCFS2_EXT_UNWRITTEN)) {
                ret = -EIO;
                mlog_errno(ret);
                goto out;
index c69c1b300155d31aecce94278f52ac8e84b2b537..556e34ccb005f06fb52b611066a0c4db6e10a071 100644 (file)
@@ -728,6 +728,27 @@ static void ocfs2_clear_page_regions(struct page *page,
        kunmap_atomic(kaddr, KM_USER0);
 }
 
+/*
+ * Nonsparse file systems fully allocate before we get to the write
+ * code. This prevents ocfs2_write() from tagging the write as an
+ * allocating one, which means ocfs2_map_page_blocks() might try to
+ * read-in the blocks at the tail of our file. Avoid reading them by
+ * testing i_size against each block offset.
+ */
+static int ocfs2_should_read_blk(struct inode *inode, struct page *page,
+                                unsigned int block_start)
+{
+       u64 offset = page_offset(page) + block_start;
+
+       if (ocfs2_sparse_alloc(OCFS2_SB(inode->i_sb)))
+               return 1;
+
+       if (i_size_read(inode) > offset)
+               return 1;
+
+       return 0;
+}
+
 /*
  * Some of this taken from block_prepare_write(). We already have our
  * mapping by now though, and the entire write will be allocating or
@@ -781,6 +802,7 @@ int ocfs2_map_page_blocks(struct page *page, u64 *p_blkno,
                                set_buffer_uptodate(bh);
                } else if (!buffer_uptodate(bh) && !buffer_delay(bh) &&
                           !buffer_new(bh) &&
+                          ocfs2_should_read_blk(inode, page, block_start) &&
                           (block_start < from || block_end > to)) {
                        ll_rw_block(READ, 1, &bh);
                        *wait_bh++=bh;
index 9cc7c0418b70eb53b04d1904a197feb82b196b24..f02ccb34604d5f855851eee98dc274f09787480e 100644 (file)
@@ -267,7 +267,7 @@ static struct bio *o2hb_setup_one_bio(struct o2hb_region *reg,
                current_page = cs / spp;
                page = reg->hr_slot_data[current_page];
 
-               vec_len = min(PAGE_CACHE_SIZE,
+               vec_len = min(PAGE_CACHE_SIZE - vec_start,
                              (max_slots-cs) * (PAGE_CACHE_SIZE/spp) );
 
                mlog(ML_HB_BIO, "page %d, vec_len = %u, vec_start = %u\n",
index 685c18065c82ed3b844fca3226d61b850cb01d66..d84bd155997ba2e3546f0811658c4cfe8956dd75 100644 (file)
@@ -58,6 +58,7 @@
 #include <linux/slab.h>
 #include <linux/idr.h>
 #include <linux/kref.h>
+#include <linux/net.h>
 #include <net/tcp.h>
 
 #include <asm/uaccess.h>
@@ -616,8 +617,7 @@ static void o2net_shutdown_sc(struct work_struct *work)
                del_timer_sync(&sc->sc_idle_timeout);
                o2net_sc_cancel_delayed_work(sc, &sc->sc_keepalive_work);
                sc_put(sc);
-               sc->sc_sock->ops->shutdown(sc->sc_sock,
-                                          RCV_SHUTDOWN|SEND_SHUTDOWN);
+               kernel_sock_shutdown(sc->sc_sock, SHUT_RDWR);
        }
 
        /* not fatal so failed connects before the other guy has our
index 3094ddb7a25491b1d2db567707ce7f6a01592c27..1957a5ed219e5845e88c3ec47e1b02e0b34d6a3f 100644 (file)
@@ -318,9 +318,9 @@ out_attach:
 static void ocfs2_drop_dentry_lock(struct ocfs2_super *osb,
                                   struct ocfs2_dentry_lock *dl)
 {
+       iput(dl->dl_inode);
        ocfs2_simple_drop_lockres(osb, &dl->dl_lockres);
        ocfs2_lock_res_free(&dl->dl_lockres);
-       iput(dl->dl_inode);
        kfree(dl);
 }
 
index 6a2f143e269c338b09989595264722dcf742e4e4..63b28fdceb4a3c7b425e87290d08237b5182a790 100644 (file)
@@ -208,9 +208,9 @@ out:
        return NULL;
 }
 
-struct buffer_head *ocfs2_find_entry_el(const char *name, int namelen,
-                                       struct inode *dir,
-                                       struct ocfs2_dir_entry **res_dir)
+static struct buffer_head *ocfs2_find_entry_el(const char *name, int namelen,
+                                              struct inode *dir,
+                                              struct ocfs2_dir_entry **res_dir)
 {
        struct super_block *sb;
        struct buffer_head *bh_use[NAMEI_RA_SIZE];
index 41c76ff2fcfbc4d725be65a4498b5fd603aa6f2c..4e97dcceaf8f5354fab2b4e78563f56b5853bf35 100644 (file)
@@ -670,7 +670,7 @@ static inline void ocfs2_generic_handle_attach_action(struct ocfs2_lock_res *loc
 {
        mlog_entry_void();
 
-       BUG_ON((!lockres->l_flags & OCFS2_LOCK_BUSY));
+       BUG_ON((!(lockres->l_flags & OCFS2_LOCK_BUSY)));
        BUG_ON(lockres->l_flags & OCFS2_LOCK_ATTACHED);
 
        if (lockres->l_requested > LKM_NLMODE &&
@@ -980,18 +980,6 @@ again:
                goto unlock;
        }
 
-       if (!(lockres->l_flags & OCFS2_LOCK_ATTACHED)) {
-               /* lock has not been created yet. */
-               spin_unlock_irqrestore(&lockres->l_lock, flags);
-
-               ret = ocfs2_lock_create(osb, lockres, LKM_NLMODE, 0);
-               if (ret < 0) {
-                       mlog_errno(ret);
-                       goto out;
-               }
-               goto again;
-       }
-
        if (lockres->l_flags & OCFS2_LOCK_BLOCKED &&
            !ocfs2_may_continue_on_blocked_lock(lockres, level)) {
                /* is the lock is currently blocked on behalf of
@@ -1006,7 +994,14 @@ again:
                        mlog(ML_ERROR, "lockres %s has action %u pending\n",
                             lockres->l_name, lockres->l_action);
 
-               lockres->l_action = OCFS2_AST_CONVERT;
+               if (!(lockres->l_flags & OCFS2_LOCK_ATTACHED)) {
+                       lockres->l_action = OCFS2_AST_ATTACH;
+                       lkm_flags &= ~LKM_CONVERT;
+               } else {
+                       lockres->l_action = OCFS2_AST_CONVERT;
+                       lkm_flags |= LKM_CONVERT;
+               }
+
                lockres->l_requested = level;
                lockres_or_flags(lockres, OCFS2_LOCK_BUSY);
                spin_unlock_irqrestore(&lockres->l_lock, flags);
@@ -1021,7 +1016,7 @@ again:
                status = dlmlock(osb->dlm,
                                 level,
                                 &lockres->l_lksb,
-                                lkm_flags|LKM_CONVERT,
+                                lkm_flags,
                                 lockres->l_name,
                                 OCFS2_LOCK_ID_MAX_LEN - 1,
                                 ocfs2_locking_ast,
index f92fe91ff260bb8439a44f35240c0b36d803ca87..bbac7cd33e0b453f9db0bcfe668eaa344a10f851 100644 (file)
@@ -1891,9 +1891,11 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
        ssize_t written = 0;
        size_t ocount;          /* original count */
        size_t count;           /* after file limit checks */
-       loff_t *ppos = &iocb->ki_pos;
+       loff_t old_size, *ppos = &iocb->ki_pos;
+       u32 old_clusters;
        struct file *file = iocb->ki_filp;
        struct inode *inode = file->f_path.dentry->d_inode;
+       struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
 
        mlog_entry("(0x%p, %u, '%.*s')\n", file,
                   (unsigned int)nr_segs,
@@ -1949,6 +1951,13 @@ relock:
                goto relock;
        }
 
+       /*
+        * To later detect whether a journal commit for sync writes is
+        * necessary, we sample i_size, and cluster count here.
+        */
+       old_size = i_size_read(inode);
+       old_clusters = OCFS2_I(inode)->ip_clusters;
+
        /* communicate with ocfs2_dio_end_io */
        ocfs2_iocb_set_rw_locked(iocb, rw_level);
 
@@ -1978,6 +1987,21 @@ out_dio:
        /* buffered aio wouldn't have proper lock coverage today */
        BUG_ON(ret == -EIOCBQUEUED && !(file->f_flags & O_DIRECT));
 
+       if ((file->f_flags & O_SYNC && !direct_io) || IS_SYNC(inode)) {
+               /*
+                * The generic write paths have handled getting data
+                * to disk, but since we don't make use of the dirty
+                * inode list, a manual journal commit is necessary
+                * here.
+                */
+               if (old_size != i_size_read(inode) ||
+                   old_clusters != OCFS2_I(inode)->ip_clusters) {
+                       ret = journal_force_commit(osb->journal->j_journal);
+                       if (ret < 0)
+                               written = ret;
+               }
+       }
+
        /* 
         * deep in g_f_a_w_n()->ocfs2_direct_IO we pass in a ocfs2_dio_end_io
         * function pointer which is called when o_direct io completes so that
index 729259016c182f5a9f1e9e15da136419198dc2fd..989ac271858758065c83d6eb7681f9555ba54fd2 100644 (file)
@@ -1105,9 +1105,16 @@ static int ocfs2_rename(struct inode *old_dir,
                goto bail;
        }
 
-       if (!new_de && new_inode)
-               mlog(ML_ERROR, "inode %lu does not exist in it's parent "
-                    "directory!", new_inode->i_ino);
+       if (!new_de && new_inode) {
+               /*
+                * Target was unlinked by another node while we were
+                * waiting to get to ocfs2_rename(). There isn't
+                * anything we can do here to help the situation, so
+                * bubble up the appropriate error.
+                */
+               status = -ENOENT;
+               goto bail;
+       }
 
        /* In case we need to overwrite an existing file, we blow it
         * away first */
index 3b69c53e18379801e9bad4111e689be2cdaf1952..4932b4d1da05f72037b22ec04378edcf83fbc14f 100644 (file)
--- a/fs/open.c
+++ b/fs/open.c
@@ -1061,7 +1061,7 @@ asmlinkage long sys_open(const char __user *filename, int flags, int mode)
        prevent_tail_call(ret);
        return ret;
 }
-EXPORT_SYMBOL_GPL(sys_open);
+EXPORT_UNUSED_SYMBOL_GPL(sys_open); /* To be deleted for 2.6.25 */
 
 asmlinkage long sys_openat(int dfd, const char __user *filename, int flags,
                           int mode)
index 63c95afb561f8e8742118197b0731317ea871463..65c62e1bfd6f6cb6170c53a55c90473fe10d5e6b 100644 (file)
@@ -358,7 +358,8 @@ static cputime_t task_utime(struct task_struct *p)
        }
        utime = (clock_t)temp;
 
-       return clock_t_to_cputime(utime);
+       p->prev_utime = max(p->prev_utime, clock_t_to_cputime(utime));
+       return p->prev_utime;
 }
 
 static cputime_t task_stime(struct task_struct *p)
@@ -373,7 +374,10 @@ static cputime_t task_stime(struct task_struct *p)
        stime = nsec_to_clock_t(p->se.sum_exec_runtime) -
                        cputime_to_clock_t(task_utime(p));
 
-       return clock_t_to_cputime(stime);
+       if (stime >= 0)
+               p->prev_stime = max(p->prev_stime, clock_t_to_cputime(stime));
+
+       return p->prev_stime;
 }
 #endif
 
index aeaf0d0f2f51813bdc2f63115d855e66efe9e93c..a17c26859074e80f47088e4e5a44d900190ed66f 100644 (file)
@@ -2328,21 +2328,18 @@ out:
 
 void proc_flush_task(struct task_struct *task)
 {
-       int i, leader;
-       struct pid *pid, *tgid;
+       int i;
+       struct pid *pid, *tgid = NULL;
        struct upid *upid;
 
-       leader = thread_group_leader(task);
-       proc_flush_task_mnt(proc_mnt, task->pid, leader ? task->tgid : 0);
        pid = task_pid(task);
-       if (pid->level == 0)
-               return;
+       if (thread_group_leader(task))
+               tgid = task_tgid(task);
 
-       tgid = task_tgid(task);
-       for (i = 1; i <= pid->level; i++) {
+       for (i = 0; i <= pid->level; i++) {
                upid = &pid->numbers[i];
                proc_flush_task_mnt(upid->ns->proc_mnt, upid->nr,
-                               leader ? 0 : tgid->numbers[i].nr);
+                       tgid ? tgid->numbers[i].nr : 0);
        }
 
        upid = &pid->numbers[pid->level];
index 1bdb624357587ae23f31ec3b6f84ef42827cc6f4..a9806bc21ec3d5480b8b6695c6d3f6fb82a203ad 100644 (file)
@@ -561,28 +561,33 @@ static int proc_register(struct proc_dir_entry * dir, struct proc_dir_entry * dp
 static void proc_kill_inodes(struct proc_dir_entry *de)
 {
        struct list_head *p;
-       struct super_block *sb = proc_mnt->mnt_sb;
+       struct super_block *sb;
 
        /*
         * Actually it's a partial revoke().
         */
-       file_list_lock();
-       list_for_each(p, &sb->s_files) {
-               struct file * filp = list_entry(p, struct file, f_u.fu_list);
-               struct dentry * dentry = filp->f_path.dentry;
-               struct inode * inode;
-               const struct file_operations *fops;
-
-               if (dentry->d_op != &proc_dentry_operations)
-                       continue;
-               inode = dentry->d_inode;
-               if (PDE(inode) != de)
-                       continue;
-               fops = filp->f_op;
-               filp->f_op = NULL;
-               fops_put(fops);
+       spin_lock(&sb_lock);
+       list_for_each_entry(sb, &proc_fs_type.fs_supers, s_instances) {
+               file_list_lock();
+               list_for_each(p, &sb->s_files) {
+                       struct file *filp = list_entry(p, struct file,
+                                                       f_u.fu_list);
+                       struct dentry *dentry = filp->f_path.dentry;
+                       struct inode *inode;
+                       const struct file_operations *fops;
+
+                       if (dentry->d_op != &proc_dentry_operations)
+                               continue;
+                       inode = dentry->d_inode;
+                       if (PDE(inode) != de)
+                               continue;
+                       fops = filp->f_op;
+                       filp->f_op = NULL;
+                       fops_put(fops);
+               }
+               file_list_unlock();
        }
-       file_list_unlock();
+       spin_unlock(&sb_lock);
 }
 
 static struct proc_dir_entry *proc_create(struct proc_dir_entry **parent,
index 1820eb2ef7623a2c222e9be9b61d0e749f259187..1b2b6c6bb47557c2553736b063c79dc48a7a2721 100644 (file)
@@ -78,3 +78,5 @@ static inline int proc_fd(struct inode *inode)
 {
        return PROC_I(inode)->fd;
 }
+
+extern struct file_system_type proc_fs_type;
index 749def054a341b62ff8f542a4bfa21bf5e93821a..131f9c68be5f1d3b2fa036189f7864ca371c63ae 100644 (file)
 #include "internal.h"
 
 
-struct proc_dir_entry *proc_net_create(struct net *net,
-       const char *name, mode_t mode, get_info_t *get_info)
-{
-       return create_proc_info_entry(name,mode, net->proc_net, get_info);
-}
-EXPORT_SYMBOL_GPL(proc_net_create);
-
 struct proc_dir_entry *proc_net_fops_create(struct net *net,
        const char *name, mode_t mode, const struct file_operations *fops)
 {
@@ -185,7 +178,7 @@ static __net_exit void proc_net_ns_exit(struct net *net)
        kfree(net->proc_net_root);
 }
 
-static struct pernet_operations proc_net_ns_ops = {
+static struct pernet_operations __net_initdata proc_net_ns_ops = {
        .init = proc_net_ns_init,
        .exit = proc_net_ns_exit,
 };
index ec9cb3b6c93bf777e8c6cb8ed4a6f8405898fa87..1f86bb860e049888f96d438acf68d3ea53a25188 100644 (file)
@@ -98,7 +98,7 @@ static void proc_kill_sb(struct super_block *sb)
        put_pid_ns(ns);
 }
 
-static struct file_system_type proc_fs_type = {
+struct file_system_type proc_fs_type = {
        .name           = "proc",
        .get_sb         = proc_get_sb,
        .kill_sb        = proc_kill_sb,
index 124693e8d3fa068d60e7f6ad82670a3577ae80fb..ea1f94cc722e0c942111b9849cedf8b1aef1d86a 100644 (file)
@@ -370,7 +370,7 @@ asmlinkage ssize_t sys_read(unsigned int fd, char __user * buf, size_t count)
 
        return ret;
 }
-EXPORT_SYMBOL_GPL(sys_read);
+EXPORT_UNUSED_SYMBOL_GPL(sys_read); /* to be deleted for 2.6.25 */
 
 asmlinkage ssize_t sys_write(unsigned int fd, const char __user * buf, size_t count)
 {
index c438a8f83f26f7ad3412f5fd2f3af69e582ad02d..e0f0f098a523a8d1c3a41099ab76b411989a23a0 100644 (file)
@@ -57,6 +57,9 @@ int reiserfs_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
                        if (get_user(flags, (int __user *)arg))
                                return -EFAULT;
 
+                       /* Is it quota file? Do not allow user to mess with it. */
+                       if (IS_NOQUOTA(inode))
+                               return -EPERM;
                        if (((flags ^ REISERFS_I(inode)->
                              i_attrs) & (REISERFS_IMMUTABLE_FL |
                                          REISERFS_APPEND_FL))
index ca41567d7890b8fecbec571d59f357e66eeb171e..d2db2417b2bd68a96ad57ff4e8bf429d5aeee0d1 100644 (file)
@@ -1458,9 +1458,6 @@ static void unmap_buffers(struct page *page, loff_t pos)
                                }
                                bh = next;
                        } while (bh != head);
-                       if (PAGE_SIZE == bh->b_size) {
-                               cancel_dirty_page(page, PAGE_CACHE_SIZE);
-                       }
                }
        }
 }
index f5d14cebc75a5141a3eaf8f85a918fae9f82e913..efbe29af3d7a030bbd531786edbeb15a107eaf48 100644 (file)
@@ -234,7 +234,7 @@ smb_file_aio_read(struct kiocb *iocb, const struct iovec *iov,
 
        VERBOSE("before read, size=%ld, flags=%x, atime=%ld\n",
                (long)dentry->d_inode->i_size,
-               dentry->d_inode->i_flags, dentry->d_inode->i_atime);
+               dentry->d_inode->i_flags, dentry->d_inode->i_atime.tv_sec);
 
        status = generic_file_aio_read(iocb, iov, nr_segs, pos);
 out:
@@ -269,7 +269,7 @@ smb_file_splice_read(struct file *file, loff_t *ppos,
        struct dentry *dentry = file->f_path.dentry;
        ssize_t status;
 
-       VERBOSE("file %s/%s, pos=%Ld, count=%d\n",
+       VERBOSE("file %s/%s, pos=%Ld, count=%lu\n",
                DENTRY_PATH(dentry), *ppos, count);
 
        status = smb_revalidate_inode(dentry);
@@ -363,7 +363,8 @@ smb_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
                result = generic_file_aio_write(iocb, iov, nr_segs, pos);
                VERBOSE("pos=%ld, size=%ld, mtime=%ld, atime=%ld\n",
                        (long) file->f_pos, (long) dentry->d_inode->i_size,
-                       dentry->d_inode->i_mtime, dentry->d_inode->i_atime);
+                       dentry->d_inode->i_mtime.tv_sec,
+                       dentry->d_inode->i_atime.tv_sec);
        }
 out:
        return result;
index ab517755ece0aed5a07d46fcd16ad447e68f8d85..9416ead0c7aae67ef1c2bd8b9d3ce12e79cdd9c8 100644 (file)
@@ -536,7 +536,7 @@ static int smb_fill_super(struct super_block *sb, void *raw_data, int silent)
 
        /* Allocate the global temp buffer and some superblock helper structs */
        /* FIXME: move these to the smb_sb_info struct */
-       VERBOSE("alloc chunk = %d\n", sizeof(struct smb_ops) +
+       VERBOSE("alloc chunk = %lu\n", sizeof(struct smb_ops) +
                sizeof(struct smb_mount_data_kernel));
        mem = kmalloc(sizeof(struct smb_ops) +
                      sizeof(struct smb_mount_data_kernel), GFP_KERNEL);
index feac46050619075aa90a88f71e4a8e4a31b5cda5..d517a27b7f4b7baeefb6048aef46a20d03293b21 100644 (file)
@@ -2593,7 +2593,7 @@ smb_proc_getattr_ff(struct smb_sb_info *server, struct dentry *dentry,
        fattr->f_mtime.tv_sec = date_dos2unix(server, date, time);
        fattr->f_mtime.tv_nsec = 0;
        VERBOSE("name=%s, date=%x, time=%x, mtime=%ld\n",
-               mask, date, time, fattr->f_mtime);
+               mask, date, time, fattr->f_mtime.tv_sec);
        fattr->f_size = DVAL(req->rq_data, 12);
        /* ULONG allocation size */
        fattr->attr = WVAL(req->rq_data, 20);
index 283c5720c9de1801e6484173f86df376a49894b9..fae8e85af0ed59ae850ca66f250d3a71c36c1ff8 100644 (file)
@@ -227,7 +227,7 @@ int smbiod_retry(struct smb_sb_info *server)
                printk(KERN_ERR "smb_retry: signal failed [%d]\n", result);
                goto out;
        }
-       VERBOSE("signalled pid %d\n", pid);
+       VERBOSE("signalled pid %d\n", pid_nr(pid));
 
        /* FIXME: The retried requests should perhaps get a "time boost". */
 
index 7a8ce9e98b32d9aeb2128f177173c64c5181a941..337162935d2173964538a190b7ed6e8433823f35 100644 (file)
@@ -132,7 +132,7 @@ struct dentry *sysfs_get_dentry(struct sysfs_dirent *sd)
  *     RETURNS:
  *     Pointer to @sd on success, NULL on failure.
  */
-struct sysfs_dirent *sysfs_get_active(struct sysfs_dirent *sd)
+static struct sysfs_dirent *sysfs_get_active(struct sysfs_dirent *sd)
 {
        if (unlikely(!sd))
                return NULL;
@@ -161,7 +161,7 @@ struct sysfs_dirent *sysfs_get_active(struct sysfs_dirent *sd)
  *     Put an active reference to @sd.  This function is noop if @sd
  *     is NULL.
  */
-void sysfs_put_active(struct sysfs_dirent *sd)
+static void sysfs_put_active(struct sysfs_dirent *sd)
 {
        struct completion *cmpl;
        int v;
index f8417988f6b0d99262a3b1515104a549ee392a0c..ff17f8da9b43f5d47ec69a80021e51aa04ffed8b 100644 (file)
@@ -103,8 +103,6 @@ extern const struct file_operations sysfs_dir_operations;
 extern const struct inode_operations sysfs_dir_inode_operations;
 
 struct dentry *sysfs_get_dentry(struct sysfs_dirent *sd);
-struct sysfs_dirent *sysfs_get_active(struct sysfs_dirent *sd);
-void sysfs_put_active(struct sysfs_dirent *sd);
 struct sysfs_dirent *sysfs_get_active_two(struct sysfs_dirent *sd);
 void sysfs_put_active_two(struct sysfs_dirent *sd);
 void sysfs_addrm_start(struct sysfs_addrm_cxt *acxt,
index 584cf12cc40fb9874c2815e1585e79944cb84c83..c78c04fd993fe5fe1b95186d8f4d33ecdcf7e8ad 100644 (file)
@@ -933,20 +933,19 @@ magic_found:
                goto again;
        }
 
-       /* Set sbi->s_flags here, used by ufs_get_fs_state() below */
-       sbi->s_flags = flags;
+       sbi->s_flags = flags;/*after that line some functions use s_flags*/
        ufs_print_super_stuff(sb, usb1, usb2, usb3);
 
        /*
         * Check, if file system was correctly unmounted.
         * If not, make it read only.
         */
-       if ((((flags & UFS_ST_MASK) == UFS_ST_44BSD)    ||
-            ((flags & UFS_ST_MASK) == UFS_ST_OLD)      ||
-            ((flags & UFS_ST_MASK) == UFS_ST_SUN)      ||
-            ((flags & UFS_ST_MASK) == UFS_ST_SUNOS)    ||
-            ((flags & UFS_ST_MASK) == UFS_ST_SUNx86))  &&
-           (ufs_get_fs_state(sb, usb1, usb3) == (UFS_FSOK - fs32_to_cpu(sb, usb1->fs_time)))) {
+       if (((flags & UFS_ST_MASK) == UFS_ST_44BSD) ||
+         ((flags & UFS_ST_MASK) == UFS_ST_OLD) ||
+         (((flags & UFS_ST_MASK) == UFS_ST_SUN ||
+           (flags & UFS_ST_MASK) == UFS_ST_SUNOS ||
+         (flags & UFS_ST_MASK) == UFS_ST_SUNx86) &&
+         (ufs_get_fs_state(sb, usb1, usb3) == (UFS_FSOK - fs32_to_cpu(sb, usb1->fs_time))))) {
                switch(usb1->fs_clean) {
                case UFS_FSCLEAN:
                        UFSD("fs is clean\n");
index 7b74b60a68a47b26d3addf541b3440f23bd947ad..19c3ead2a90bb768f98e077ff91c050ae290e737 100644 (file)
@@ -168,8 +168,7 @@ struct acpi_device_flags {
        u32 power_manageable:1;
        u32 performance_manageable:1;
        u32 wake_capable:1;     /* Wakeup(_PRW) supported? */
-       u32 force_power_state:1;
-       u32 reserved:19;
+       u32 reserved:20;
 };
 
 /* File System */
index 26d79f6db8a044490c95c8752a40a9fa4c68eff5..76411b1fc4fd4778e2e35cda00da46ead7b7dd5e 100644 (file)
@@ -78,7 +78,6 @@ struct acpi_processor_cx {
 struct acpi_processor_power {
        struct cpuidle_device dev;
        struct acpi_processor_cx *state;
-       struct acpi_processor_cx *bm_state;
        unsigned long bm_check_timestamp;
        u32 default_state;
        u32 bm_activity;
index d96b10fd449ffb791e46f1f30fadfaf4e48f277a..c0d7075982c16d9dee7884c8b0c29080de97b559 100644 (file)
@@ -130,4 +130,7 @@ extern u8 at91_leds_cpu;
 extern u8 at91_leds_timer;
 extern void __init at91_init_leds(u8 cpu_led, u8 timer_led);
 
+/* FIXME: this needs a better location, but gets stuff building again */
+extern int at91_suspend_entering_slow_clock(void);
+
 #endif
index ea24a0e0bfd672137d686b57c4277d51566f7c36..ff8de30b2fb36e65405779532177ae57990f920a 100644 (file)
@@ -13,6 +13,9 @@
 #ifndef        __DAVINCI_GPIO_H
 #define        __DAVINCI_GPIO_H
 
+#include <linux/io.h>
+#include <asm/hardware.h>
+
 /*
  * basic gpio routines
  *
index 7513c7a3402dfc32aa3b7f120b9c2ac2d8189562..822a27cd7864e3e6e7b8978424ed4ce1406aa80e 100644 (file)
@@ -4,7 +4,7 @@
  * PXA300/PXA310 specific MFP configuration definitions
  *
  * Copyright (C) 2007 Marvell International Ltd.
- * 2007-08-21: eric miao <eric.y.miao@gmail.com>
+ * 2007-08-21: eric miao <eric.miao@marvell.com>
  *             initial version
  *
  *  This program is free software; you can redistribute it and/or modify
index ae8ba34194cf6f81a74541cd70f93857712440c6..488a5bbc49e994ac1d65a7db3445baa9f2696459 100644 (file)
@@ -4,7 +4,7 @@
  * PXA320 specific MFP configuration definitions
  *
  * Copyright (C) 2007 Marvell International Ltd.
- * 2007-08-21: eric miao <eric.y.miao@gmail.com>
+ * 2007-08-21: eric miao <eric.miao@marvell.com>
  *             initial version
  *
  *  This program is free software; you can redistribute it and/or modify
index 60291742ffddce7fbd2558bec9126c7404b3b840..ac4157af5a8e5878a2883358fb9c5bb5e499b21b 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Copyright (C) 2007 Marvell International Ltd.
  *
- * 2007-8-21: eric miao <eric.y.miao@gmail.com>
+ * 2007-8-21: eric miao <eric.miao@marvell.com>
  *            initial version
  *
  *  This program is free software; you can redistribute it and/or modify
index 16f5375e57b89256738b094f1d07c6a45733087a..9918aa46d9e53c03983604b6b70237516d11d183 100644 (file)
@@ -11,8 +11,9 @@
 #define        flat_argvp_envp_on_stack()              1
 #define        flat_old_ram_flag(flags)                (flags)
 #define        flat_reloc_valid(reloc, size)           ((reloc) <= (size))
-#define        flat_get_addr_from_rp(rp, relval, flags) get_unaligned(rp)
+#define        flat_get_addr_from_rp(rp, relval, flags, persistent) get_unaligned(rp)
 #define        flat_put_addr_at_rp(rp, val, relval)    put_unaligned(val,rp)
 #define        flat_get_relocate_addr(rel)             (rel)
+#define        flat_set_persistent(relval, p)          0
 
 #endif /* __ARM_FLAT_H__ */
index fb90b421f31c94d5c771255bdc429abd5aca0409..ede377ec91470e11472c1059b7dc55c790b28074 100644 (file)
@@ -231,7 +231,7 @@ extern int init_atu;
                                        IOP3XX_PCI_IO_WINDOW_SIZE - 1)
 #define IOP3XX_PCI_UPPER_IO_VA         (IOP3XX_PCI_LOWER_IO_VA +\
                                        IOP3XX_PCI_IO_WINDOW_SIZE - 1)
-#define IOP3XX_PCI_IO_PHYS_TO_VIRT(addr) (((u32) addr -\
+#define IOP3XX_PCI_IO_PHYS_TO_VIRT(addr) (((u32) (addr) -\
                                        IOP3XX_PCI_LOWER_IO_PA) +\
                                        IOP3XX_PCI_LOWER_IO_VA)
 
index d2e8171d1d4e9eb93f5f107c0cca421593aa7bca..5e0182485d8c0978872cceff729145291a328596 100644 (file)
@@ -249,7 +249,7 @@ extern struct page *empty_zero_page;
 #define set_pte_ext(ptep,pte,ext) cpu_set_pte_ext(ptep,pte,ext)
 
 #define set_pte_at(mm,addr,ptep,pteval) do { \
-       set_pte_ext(ptep, pteval, (addr) >= PAGE_OFFSET ? 0 : PTE_EXT_NG); \
+       set_pte_ext(ptep, pteval, (addr) >= TASK_SIZE ? 0 : PTE_EXT_NG); \
  } while (0)
 
 /*
index b824d371ae0b0c46ab1a90b8252a80873b1bca15..d742205ac172673f57c96f99e93d4125b945e46e 100644 (file)
@@ -35,7 +35,7 @@
 #define S3C2440_NFESTAT1 S3C2410_NFREG(0x28)
 #define S3C2440_NFMECC0  S3C2410_NFREG(0x2C)
 #define S3C2440_NFMECC1  S3C2410_NFREG(0x30)
-#define S3C2440_NFSECC   S3C24E10_NFREG(0x34)
+#define S3C2440_NFSECC   S3C2410_NFREG(0x34)
 #define S3C2440_NFSBLK   S3C2410_NFREG(0x38)
 #define S3C2440_NFEBLK   S3C2410_NFREG(0x3C)
 
diff --git a/include/asm-arm26/irq_regs.h b/include/asm-arm26/irq_regs.h
deleted file mode 100644 (file)
index 3dd9c0b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/irq_regs.h>
index c02bc8304b137cd407d88498729bd4fb53acf69e..dd21182b60e0fd11fd6c873a67e3e694229fb340 100644 (file)
 #define SYSREG_IRP_SIZE                                6
 
 /* Bitfields in PCCR */
+#define SYSREG_PCCR_E_OFFSET                   0
+#define SYSREG_PCCR_E_SIZE                     1
 #define SYSREG_PCCR_R_OFFSET                   1
 #define SYSREG_PCCR_R_SIZE                     1
 #define SYSREG_PCCR_C_OFFSET                   2
index 14cb8d35924e7c3505126057d3f9648d927435fe..39bdd86871cf1bd496262cb55dc1cc06511fbe59 100644 (file)
@@ -50,8 +50,8 @@ extern unsigned long get_sclk(void);
 extern unsigned long sclk_to_usecs(unsigned long sclk);
 extern unsigned long usecs_to_sclk(unsigned long usecs);
 
-extern void dump_thread(struct pt_regs *regs, struct user *dump);
-extern void dump_bfin_regs(struct pt_regs *fp, void *retaddr);
+extern void dump_bfin_process(struct pt_regs *regs);
+extern void dump_bfin_mem(void *retaddr);
 extern void dump_bfin_trace_buffer(void);
 
 extern int init_arch_irq(void);
@@ -63,6 +63,7 @@ extern void bfin_dcache_init(void);
 extern int read_iloc(void);
 extern int bfin_console_init(void);
 extern asmlinkage void lower_to_irq14(void);
+extern asmlinkage void bfin_return_from_exception(void);
 extern void init_exception_vectors(void);
 extern void init_dma(void);
 extern void program_IAR(void);
@@ -80,6 +81,7 @@ extern int atomic_sub32(void);
 extern int atomic_ior32(void);
 extern int atomic_and32(void);
 extern int atomic_xor32(void);
+extern void safe_user_instruction(void);
 extern void sigreturn_stub(void);
 
 extern void *l1_data_A_sram_alloc(size_t);
index bec6ecdf1bdbc5cd23a5421c28f194132fbaa9f6..c4d0596e8e9f2ec779648277c9b3fae81cded2fb 100644 (file)
@@ -27,6 +27,9 @@
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#ifndef __ASM_CPLBINIT_H__
+#define __ASM_CPLBINIT_H__
+
 #include <asm/blackfin.h>
 #include <asm/cplb.h>
 
@@ -57,8 +60,8 @@ struct cplb_tab {
        u16 size;
 };
 
-extern u_long icplb_table[MAX_CPLBS+1];
-extern u_long dcplb_table[MAX_CPLBS+1];
+extern u_long icplb_table[];
+extern u_long dcplb_table[];
 
 /* Till here we are discussing about the static memory management model.
  * However, the operating envoronments commonly define more CPLB
@@ -69,28 +72,16 @@ extern u_long dcplb_table[MAX_CPLBS+1];
  * This is how Page descriptor Table is implemented in uClinux/Blackfin.
  */
 
-#ifdef CONFIG_CPLB_SWITCH_TAB_L1
-extern u_long ipdt_table[MAX_SWITCH_I_CPLBS+1]__attribute__((l1_data));
-extern u_long dpdt_table[MAX_SWITCH_D_CPLBS+1]__attribute__((l1_data));
-
-#ifdef CONFIG_CPLB_INFO
-extern u_long ipdt_swapcount_table[MAX_SWITCH_I_CPLBS]__attribute__((l1_data));
-extern u_long dpdt_swapcount_table[MAX_SWITCH_D_CPLBS]__attribute__((l1_data));
-#endif /* CONFIG_CPLB_INFO */
-
-#else
-
-extern u_long ipdt_table[MAX_SWITCH_I_CPLBS+1];
-extern u_long dpdt_table[MAX_SWITCH_D_CPLBS+1];
-
+extern u_long ipdt_table[];
+extern u_long dpdt_table[];
 #ifdef CONFIG_CPLB_INFO
-extern u_long ipdt_swapcount_table[MAX_SWITCH_I_CPLBS];
-extern u_long dpdt_swapcount_table[MAX_SWITCH_D_CPLBS];
-#endif /* CONFIG_CPLB_INFO */
-
-#endif /*CONFIG_CPLB_SWITCH_TAB_L1*/
+extern u_long ipdt_swapcount_table[];
+extern u_long dpdt_swapcount_table[];
+#endif
 
 extern unsigned long reserved_mem_dcache_on;
 extern unsigned long reserved_mem_icache_on;
 
 extern void generate_cpl_tables(void);
+
+#endif
index 52e7a10d7ff8becd559b8548d000fac4176e21ee..473a8113277f097c6fffdf61a64c22447d7cb2e3 100644 (file)
@@ -1,29 +1,47 @@
-#ifndef _BLACKFIN_DELAY_H
-#define _BLACKFIN_DELAY_H
-
-static inline void __delay(unsigned long loops)
-{
-
-/* FIXME: Currently the assembler doesn't recognize Loop Register Clobbers,
-   uncomment this as soon those are implemented */
 /*
-      __asm__ __volatile__ (  "\t LSETUP (1f,1f) LC0= %0\n\t"
-                              "1:\t NOP;\n\t"
-                              : :"a" (loops)
-                              : "LT0","LB0","LC0");
+ * delay.h - delay functions
+ *
+ * Copyright (c) 2004-2007 Analog Devices Inc.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#ifndef __ASM_DELAY_H__
+#define __ASM_DELAY_H__
 
-*/
+#include <asm/mach/anomaly.h>
 
-       __asm__ __volatile__("[--SP] = LC0;\n\t"
-                            "[--SP] = LT0;\n\t"
-                            "[--SP] = LB0;\n\t"
-                            "LSETUP (1f,1f) LC0 = %0;\n\t"
-                            "1:\t NOP;\n\t"
-                            "LB0 = [SP++];\n\t"
-                               "LT0 = [SP++];\n\t"
-                               "LC0 = [SP++];\n"
-                               :
-                               :"a" (loops));
+static inline void __delay(unsigned long loops)
+{
+       if (ANOMALY_05000312) {
+               /* Interrupted loads to loop registers -> bad */
+               unsigned long tmp;
+               __asm__ __volatile__(
+                       "[--SP] = LC0;"
+                       "[--SP] = LT0;"
+                       "[--SP] = LB0;"
+                       "LSETUP (1f,1f) LC0 = %1;"
+                       "1: NOP;"
+                       /* We take advantage of the fact that LC0 is 0 at
+                        * the end of the loop.  Otherwise we'd need some
+                        * NOPs after the CLI here.
+                        */
+                       "CLI %0;"
+                       "LB0 = [SP++];"
+                       "LT0 = [SP++];"
+                       "LC0 = [SP++];"
+                       "STI %0;"
+                       : "=d" (tmp)
+                       : "a" (loops)
+               );
+       } else
+               __asm__ __volatile__ (
+                       "LSETUP(1f, 1f) LC0 = %0;"
+                       "1: NOP;"
+                       :
+                       : "a" (loops)
+                       : "LT0", "LB0", "LC0"
+               );
 }
 
 #include <linux/param.h>       /* needed for HZ */
@@ -41,4 +59,4 @@ static inline void udelay(unsigned long usecs)
        __delay(usecs * loops_per_jiffy / (1000000 / HZ));
 }
 
-#endif                         /* defined(_BLACKFIN_DELAY_H) */
+#endif
index e6df84ee1557893f4e930b4fb4a3f3ac556fd2f6..37db66c7030d12e91eabc205ed9ea4059195515a 100644 (file)
@@ -17,4 +17,6 @@
 
 #define ATOMIC_SEQS_END                0x480
 
-#define FIXED_CODE_END         0x480
+#define SAFE_USER_INSTRUCTION   0x480
+
+#define FIXED_CODE_END         0x490
index c97ab03e43a641273ad87e110da796fa8b7cb691..8265ea473d5bc566cd2f7acc087b74d8f511f617 100644 (file)
@@ -197,6 +197,8 @@ uint32_t get_gptimer_period    (int timer_id);
 uint32_t get_gptimer_count     (int timer_id);
 uint16_t get_gptimer_intr      (int timer_id);
 void     clear_gptimer_intr    (int timer_id);
+uint16_t get_gptimer_over      (int timer_id);
+void     clear_gptimer_over    (int timer_id);
 void     set_gptimer_config    (int timer_id, uint16_t config);
 uint16_t get_gptimer_config    (int timer_id);
 void     set_gptimer_pulse_hi  (int timer_id);
index d1d2e6be3b59328f42f02d46e91402cffd0b5ab8..1601d62f39a57785a925d6e2ca3a260a5bd9cabe 100644 (file)
@@ -122,6 +122,7 @@ extern void outsl(unsigned long port, const void *addr, unsigned long count);
 extern void insb(unsigned long port, void *addr, unsigned long count);
 extern void insw(unsigned long port, void *addr, unsigned long count);
 extern void insl(unsigned long port, void *addr, unsigned long count);
+extern void insl_16(unsigned long port, void *addr, unsigned long count);
 
 extern void dma_outsb(unsigned long port, const void *addr, unsigned short count);
 extern void dma_outsw(unsigned long port, const void *addr, unsigned short count);
index d6c24c54699d40a158ce6f35392f92964a7ee23e..fc69cf93f14951be462f843a911cc93c1416e07a 100644 (file)
 
 /* Bit masks for HOST_CONTROL */
 
-#define                   HOST_EN  0x1        /* Host Enable */
-#define                  nHOST_EN  0x0       
-#define                  HOST_END  0x2        /* Host Endianess */
-#define                 nHOST_END  0x0       
-#define                 DATA_SIZE  0x4        /* Data Size */
-#define                nDATA_SIZE  0x0       
-#define                  HOST_RST  0x8        /* Host Reset */
-#define                 nHOST_RST  0x0       
-#define                  HRDY_OVR  0x20       /* Host Ready Override */
-#define                 nHRDY_OVR  0x0       
-#define                  INT_MODE  0x40       /* Interrupt Mode */
-#define                 nINT_MODE  0x0       
-#define                     BT_EN  0x80       /* Bus Timeout Enable */
-#define                    nBT_EN  0x0       
-#define                       EHW  0x100      /* Enable Host Write */
-#define                      nEHW  0x0       
-#define                       EHR  0x200      /* Enable Host Read */
-#define                      nEHR  0x0       
-#define                       BDR  0x400      /* Burst DMA Requests */
-#define                      nBDR  0x0       
+#define                   HOST_CNTR_HOST_EN  0x1        /* Host Enable */
+#define                  HOST_CNTR_nHOST_EN  0x0
+#define                  HOST_CNTR_HOST_END  0x2        /* Host Endianess */
+#define                 HOST_CNTR_nHOST_END  0x0
+#define                 HOST_CNTR_DATA_SIZE  0x4        /* Data Size */
+#define                HOST_CNTR_nDATA_SIZE  0x0
+#define                  HOST_CNTR_HOST_RST  0x8        /* Host Reset */
+#define                 HOST_CNTR_nHOST_RST  0x0
+#define                  HOST_CNTR_HRDY_OVR  0x20       /* Host Ready Override */
+#define                 HOST_CNTR_nHRDY_OVR  0x0
+#define                  HOST_CNTR_INT_MODE  0x40       /* Interrupt Mode */
+#define                 HOST_CNTR_nINT_MODE  0x0
+#define                     HOST_CNTR_BT_EN  0x80       /* Bus Timeout Enable */
+#define                   HOST_CNTR_ nBT_EN  0x0
+#define                       HOST_CNTR_EHW  0x100      /* Enable Host Write */
+#define                      HOST_CNTR_nEHW  0x0
+#define                       HOST_CNTR_EHR  0x200      /* Enable Host Read */
+#define                      HOST_CNTR_nEHR  0x0
+#define                       HOST_CNTR_BDR  0x400      /* Burst DMA Requests */
+#define                      HOST_CNTR_nBDR  0x0
 
 /* Bit masks for HOST_STATUS */
 
-#define                     READY  0x1        /* DMA Ready */
-#define                    nREADY  0x0       
-#define                  FIFOFULL  0x2        /* FIFO Full */
-#define                 nFIFOFULL  0x0       
-#define                 FIFOEMPTY  0x4        /* FIFO Empty */
-#define                nFIFOEMPTY  0x0       
-#define                  COMPLETE  0x8        /* DMA Complete */
-#define                 nCOMPLETE  0x0       
-#define                      HSHK  0x10       /* Host Handshake */
-#define                     nHSHK  0x0       
-#define                   TIMEOUT  0x20       /* Host Timeout */
-#define                  nTIMEOUT  0x0       
-#define                      HIRQ  0x40       /* Host Interrupt Request */
-#define                     nHIRQ  0x0       
-#define                ALLOW_CNFG  0x80       /* Allow New Configuration */
-#define               nALLOW_CNFG  0x0       
-#define                   DMA_DIR  0x100      /* DMA Direction */
-#define                  nDMA_DIR  0x0       
-#define                       BTE  0x200      /* Bus Timeout Enabled */
-#define                      nBTE  0x0       
-#define               HOSTRD_DONE  0x8000     /* Host Read Completion Interrupt */
-#define              nHOSTRD_DONE  0x0
+#define                     HOST_STAT_READY  0x1        /* DMA Ready */
+#define                    HOST_STAT_nREADY  0x0
+#define                  HOST_STAT_FIFOFULL  0x2        /* FIFO Full */
+#define                 HOST_STAT_nFIFOFULL  0x0
+#define                 HOST_STAT_FIFOEMPTY  0x4        /* FIFO Empty */
+#define                HOST_STAT_nFIFOEMPTY  0x0
+#define                  HOST_STAT_COMPLETE  0x8        /* DMA Complete */
+#define                 HOST_STAT_nCOMPLETE  0x0
+#define                      HOST_STAT_HSHK  0x10       /* Host Handshake */
+#define                     HOST_STAT_nHSHK  0x0
+#define                   HOST_STAT_TIMEOUT  0x20       /* Host Timeout */
+#define                  HOST_STAT_nTIMEOUT  0x0
+#define                      HOST_STAT_HIRQ  0x40       /* Host Interrupt Request */
+#define                     HOST_STAT_nHIRQ  0x0
+#define                HOST_STAT_ALLOW_CNFG  0x80       /* Allow New Configuration */
+#define               HOST_STAT_nALLOW_CNFG  0x0
+#define                   HOST_STAT_DMA_DIR  0x100      /* DMA Direction */
+#define                  HOST_STAT_nDMA_DIR  0x0
+#define                       HOST_STAT_BTE  0x200      /* Bus Timeout Enabled */
+#define                      HOST_STAT_nBTE  0x0
+#define               HOST_STAT_HOSTRD_DONE  0x8000     /* Host Read Completion Interrupt */
+#define              HOST_STAT_nHOSTRD_DONE  0x0
 
 /* Bit masks for HOST_TIMEOUT */
 
-#define             COUNT_TIMEOUT  0x7ff      /* Host Timeout count */
+#define             HOST_COUNT_TIMEOUT  0x7ff      /* Host Timeout count */
 
 /* Bit masks for CNT_CONFIG */
 
index a41627ae9134f30e652ae4c56555c42cf15c0dc6..2dfee12864f684010e99496942cca94858ff3f42 100644 (file)
@@ -35,7 +35,6 @@
 #define MAX_BLACKFIN_DMA_CHANNEL 16
 
 #define CH_PPI                         0       /* PPI receive/transmit or NFC */
-#define CH_NFC                 0       /* PPI receive/transmit or NFC */
 #define CH_EMAC_RX             1       /* Ethernet MAC receive or HOSTDP */
 #define CH_EMAC_HOSTDP                 1       /* Ethernet MAC receive or HOSTDP */
 #define CH_EMAC_TX             2       /* Ethernet MAC transmit or NFC */
 #define CH_MEM_STREAM1_DEST    14      /* TX */
 #define CH_MEM_STREAM1_SRC     15      /* RX */
 
+#if defined(CONFIG_BF527_NAND_D_PORTF)
+#define CH_NFC                 CH_PPI  /* PPI receive/transmit or NFC */
+#elif defined(CONFIG_BF527_NAND_D_PORTH)
+#define CH_NFC                 CH_EMAC_TX /* PPI receive/transmit or NFC */
+#endif
+
 extern int channel2irq(unsigned int channel);
 extern struct dma_register *base_addr[];
 
index 304f5bcfebe4c56478f3447ccc021eb4dece1f5f..4e2b3f2020e5a4bb71c073526023fc7ef2b1f3d8 100644 (file)
 
 #define GPIO_IRQ_BASE  IRQ_PF0
 
-#ifdef CONFIG_IRQCHIP_DEMUX_GPIO
 #define NR_IRQS     (IRQ_PH15+1)
-#else
-#define NR_IRQS     (SYS_IRQS+1)
-#endif
 
 #define IVG7            7
 #define IVG8            8
index c5aa20102b24a0e89c115849138ca30aa1d84da0..193082deaa4e22214d510f88334eec59a9ecc3cb 100644 (file)
@@ -47,6 +47,7 @@
 /* Boot ROM Memory */
 
 #define BOOT_ROM_START         0xEF000000
+#define BOOT_ROM_LENGTH                0x8000
 
 /* Level 1 Memory */
 
@@ -90,9 +91,7 @@
 
 /* Scratch Pad Memory */
 
-#if defined(CONFIG_BF527) || defined(CONFIG_BF536) || defined(CONFIG_BF534)
 #define L1_SCRATCH_START       0xFFB00000
 #define L1_SCRATCH_LENGTH      0x1000
-#endif
 
 #endif                         /* _MEM_MAP_527_H_ */
index 452fb825d891122ce674eda8b169538dcfdc0f85..832e6f6122da332d91072457ffbadaf56b6e9eff 100644 (file)
@@ -130,11 +130,7 @@ Core        Emulation               **
 
 #define GPIO_IRQ_BASE          IRQ_PF0
 
-#ifdef CONFIG_IRQCHIP_DEMUX_GPIO
 #define        NR_IRQS         (IRQ_PF15+1)
-#else
-#define        NR_IRQS         SYS_IRQS
-#endif
 
 #define IVG7                   7
 #define IVG8                   8
index 94d8c4062eb7c154207131f1085d034c4080e11e..bd30b6f3be006bdab7d021866c003c1be5675666 100644 (file)
@@ -1,4 +1,3 @@
-
 /*
  * File:         include/asm-blackfin/mach-bf533/mem_map.h
  * Based on:
@@ -48,6 +47,7 @@
 /* Boot ROM Memory */
 
 #define BOOT_ROM_START         0xEF000000
+#define BOOT_ROM_LENGTH                0x400
 
 /* Level 1 Memory */
 
 
 /* Scratch Pad Memory */
 
-#if defined(CONFIG_BF533) || defined(CONFIG_BF532) || defined(CONFIG_BF531)
 #define L1_SCRATCH_START       0xFFB00000
 #define L1_SCRATCH_LENGTH      0x1000
-#endif
 
 #endif                         /* _MEM_MAP_533_H_ */
index 36c44bc1a917d8acd6a6da642f0dc033234d2e05..be6f2ff77f311a0153414c428252dadfbd65b786 100644 (file)
@@ -162,11 +162,7 @@ Core        Emulation               **
 
 #define GPIO_IRQ_BASE  IRQ_PF0
 
-#ifdef CONFIG_IRQCHIP_DEMUX_GPIO
 #define NR_IRQS     (IRQ_PH15+1)
-#else
-#define NR_IRQS     (IRQ_UART1_ERROR+1)
-#endif
 
 #define IVG7            7
 #define IVG8            8
index 18759e38eaae3dce208f13066ced2ca3ba239a42..5c6726d6f3b17c10f169049f3b0e48dcf99f315d 100644 (file)
@@ -47,6 +47,7 @@
 /* Boot ROM Memory */
 
 #define BOOT_ROM_START         0xEF000000
+#define BOOT_ROM_LENGTH                0x800
 
 /* Level 1 Memory */
 
 
 /* Scratch Pad Memory */
 
-#if defined(CONFIG_BF537) || defined(CONFIG_BF536) || defined(CONFIG_BF534)
 #define L1_SCRATCH_START       0xFFB00000
 #define L1_SCRATCH_LENGTH      0x1000
-#endif
 
 #endif                         /* _MEM_MAP_537_H_ */
index 7e6d349beb088680b41cec91cabd591c3348f1f6..e748588e8930c2976d270bc03f8e88d1ff969551 100644 (file)
 
 #define AMGCTLVAL      (V_AMBEN | V_AMCKEN)
 
-#ifdef CONFIG_BF542
-#define CPU "BF542"
-#define CPUID 0x027c8000
-#endif
-#ifdef CONFIG_BF544
-#define CPU "BF544"
-#define CPUID 0x027c8000
-#endif
-#ifdef CONFIG_BF548
-#define CPU "BF548"
-#define CPUID 0x027c6000
-#endif
-#ifdef CONFIG_BF549
-#define CPU "BF549"
-#endif
-#ifndef CPU
-#define        CPU "UNKNOWN"
-#define CPUID 0x0
+#if defined(CONFIG_BF542)
+# define CPU   "BF542"
+# define CPUID 0x027c8000
+#elif defined(CONFIG_BF544)
+# define CPU "BF544"
+# define CPUID 0x027c8000
+#elif defined(CONFIG_BF547)
+# define CPU "BF547"
+#elif defined(CONFIG_BF548)
+# define CPU "BF548"
+# define CPUID 0x027c6000
+#elif defined(CONFIG_BF549)
+# define CPU "BF549"
+#else
+# define CPU "UNKNOWN"
+# define CPUID 0x0
 #endif
 
 #endif /* __MACH_BF48_H__  */
index 760307e34b9e751f25a55c64c26f6d47c768eedc..b8b9870e26977c1f1d0c02e1a031c5a6c5c0c580 100644 (file)
 
 /* Bit masks for HOST_STATUS */
 
-#define                     READY  0x1        /* DMA Ready */
+#define                 DMA_READY  0x1        /* DMA Ready */
 #define                  FIFOFULL  0x2        /* FIFO Full */
 #define                 FIFOEMPTY  0x4        /* FIFO Empty */
 #define                  COMPLETE  0x8        /* DMA Complete */
index 70af33c963b068c89455905378ba95b171a7cf44..ecbca952985ca4836ad4a9e23ec336a31f324588 100644 (file)
 
 /* Bit masks for HOST_STATUS */
 
-#define                     READY  0x1        /* DMA Ready */
+#define                 DMA_READY  0x1        /* DMA Ready */
 #define                  FIFOFULL  0x2        /* FIFO Full */
 #define                 FIFOEMPTY  0x4        /* FIFO Empty */
 #define                  COMPLETE  0x8        /* DMA Complete */
index 4e46d657e50e8ad2c07013b101d4c6c3dd85ab2e..fcb72b41e007f607ed8d59e1f0f8ec806534623b 100644 (file)
 /* Bit masks for MXVR_DMAx_CONFIG */
 
 #define                    MDMAEN  0x1        /* DMA Channel Enable */
-#define                        DD  0x2        /* DMA Channel Direction */
+#define                     DMADD  0x2        /* DMA Channel Direction */
 #define                 BY4SWAPEN  0x20       /* DMA Channel Four Byte Swap Enable */
 #define                     LCHAN  0x3c0      /* DMA Channel Logical Channel */
 #define                 BITSWAPEN  0x400      /* DMA Channel Bit Swap Enable */
index 1d365c844ffe54889bc3f547e5b38bb3ac6bb50e..da979cb62f7dc36a88067ec436e2d4a0405b9fdd 100644 (file)
 #define                   PLL_OFF  0x2        /* Disable PLL */
 #define                        DF  0x1        /* Divide Frequency */
 
+/* SWRST Masks */
+#define              SYSTEM_RESET 0x0007       /* Initiates A System Software Reset */
+#define              DOUBLE_FAULT 0x0008       /* Core Double Fault Causes Reset */
+#define              RESET_DOUBLE 0x2000       /* SW Reset Generated By Core Double-Fault */
+#define                RESET_WDOG 0x4000       /* SW Reset Generated By Watchdog Timer */
+#define            RESET_SOFTWARE 0x8000       /* SW Reset Occurred Since Last Read Of SWRST */
+
 /* Bit masks for PLL_STAT */
 
 #define                PLL_LOCKED  0x20       /* PLL Locked Status */
index 3b08cf9bd6f36ec4bf2068a90df9648c1f2c2248..9fb7bc5399a828f851df28a5c6a14e612d085156 100644 (file)
@@ -338,11 +338,7 @@ Events         (highest priority)  EMU         0
 
 #define GPIO_IRQ_BASE  IRQ_PA0
 
-#ifdef CONFIG_IRQCHIP_DEMUX_GPIO
 #define NR_IRQS     (IRQ_PJ15+1)
-#else
-#define NR_IRQS     (SYS_IRQS+1)
-#endif
 
 /* For compatibility reasons with existing code */
 
index ec1597e318315ca40286ab3aed1f8ebc09ecc511..f99f47bc3a0796162796c75470497742a80d992c 100644 (file)
 /* Boot ROM Memory */
 
 #define BOOT_ROM_START         0xEF000000
+#define BOOT_ROM_LENGTH                0x1000
+
+/* L1 Instruction ROM */
+
+#define L1_ROM_START           0xFFA14000
+#define L1_ROM_LENGTH          0x10000
 
 /* Level 1 Memory */
 
 #define BFIN_DSUPBANKS 0
 #endif /*CONFIG_BFIN_DCACHE*/
 
+/* Level 2 Memory */
+#if !defined(CONFIG_BF542)
+# define L2_START          0xFEB00000
+# if defined(CONFIG_BF544)
+#  define L2_LENGTH        0x10000
+# else
+#  define L2_LENGTH        0x20000
+# endif
+#endif
+
 /* Scratch Pad Memory */
 
-#if defined(CONFIG_BF54x)
 #define L1_SCRATCH_START       0xFFB00000
 #define L1_SCRATCH_LENGTH      0x1000
-#endif
 
 #endif/* _MEM_MAP_548_H_ */
index b382deb501a79137d99b893ece54923ea53b2f2b..6b485120015f85a4b6243aad03f5446444a218ea 100644 (file)
 #define P_AMC_BG       (P_DEFINED | P_IDENT(GPIO_PJ12) | P_FUNCT(0))
 #define P_AMC_BGH      (P_DEFINED | P_IDENT(GPIO_PJ13) | P_FUNCT(0))
 
+
+#define P_NAND_D0      (P_DONTCARE)
+#define P_NAND_D1      (P_DONTCARE)
+#define P_NAND_D2      (P_DONTCARE)
+#define P_NAND_D3      (P_DONTCARE)
+#define P_NAND_D4      (P_DONTCARE)
+#define P_NAND_D5      (P_DONTCARE)
+#define P_NAND_D6      (P_DONTCARE)
+#define P_NAND_D7      (P_DONTCARE)
+#define P_NAND_WE      (P_DONTCARE)
+#define P_NAND_RE      (P_DONTCARE)
+#define P_NAND_CLE     (P_DONTCARE)
+#define P_NAND_ALE     (P_DONTCARE)
+
 #endif /* _MACH_PORTMUX_H_ */
index 17e1d5dcef028ba85662e000a1c0a79ff65398d8..3ef9e5f36136d09f3f385142589b8b92b7301e93 100644 (file)
 #define SUPPORTED_REVID                0x3
 
 #define OFFSET_(x) ((x) & 0x0000FFFF)
-#define L1_ISRAM               0xFFA00000
-#define L1_ISRAM_END           0xFFA04000
-#define DATA_BANKA_SRAM                0xFF800000
-#define DATA_BANKA_SRAM_END    0xFF804000
-#define DATA_BANKB_SRAM                0xFF900000
-#define DATA_BANKB_SRAM_END    0xFF904000
-#define L1_DSRAMA              0xFF800000
-#define L1_DSRAMA_END          0xFF804000
-#define L1_DSRAMB              0xFF900000
-#define L1_DSRAMB_END          0xFF904000
-#define L2_SRAM                        0xFEB00000
-#define L2_SRAM_END            0xFEB20000
-#define AMB_FLASH              0x20000000
-#define AMB_FLASH_END          0x21000000
-#define AMB_FLASH_LENGTH       0x01000000
-#define L1_ISRAM_LENGTH                0x4000
-#define L1_DSRAMA_LENGTH       0x4000
-#define L1_DSRAMB_LENGTH       0x4000
-#define L2_SRAM_LENGTH         0x20000
 
 /*some misc defines*/
 #define IMASK_IVG15            0x8000
index bf7dc4e00065d2023c2133c8f018c1a3f960e02c..c3c0eb13c819e43cd843bfdedb6bdbf039b57208 100644 (file)
 /* For MMR's that are reserved on Core B, set up defines to better integrate with other ports */
 #define SWRST                   SICA_SWRST
 #define SYSCR                   SICA_SYSCR
+#define DOUBLE_FAULT            (DOUBLE_FAULT_B|DOUBLE_FAULT_A)
+#define RESET_DOUBLE            (SWRST_DBL_FAULT_B|SWRST_DBL_FAULT_A)
+#define RESET_WDOG              (SWRST_WDT_B|SWRST_WDT_A)
+#define RESET_SOFTWARE          (SWRST_OCCURRED)
 
 /* System Reset and Interrupt Controller registers for core A (0xFFC0 0100-0xFFC0 01FF) */
 #define SICA_SWRST              0xFFC00100     /* Software Reset register */
 #define        PLL_LOCKED                      0x0020  /* PLL_LOCKCNT Has Been Reached                                 */
 
 /* SWRST Mask */
-#define SYSTEM_RESET           0x00000007      /* Initiates a system software reset */
-#define SWRST_DBL_FAULT_B      0x00000800      /* SWRST Core B Double Fault */
-#define SWRST_DBL_FAULT_A      0x00001000      /* SWRST Core A Double Fault */
-#define SWRST_WDT_B                   0x00002000       /* SWRST Watchdog B */
-#define SWRST_WDT_A                   0x00004000       /* SWRST Watchdog A */
-#define SWRST_OCCURRED         0x00008000      /* SWRST Status */
+#define SYSTEM_RESET           0x0007  /* Initiates a system software reset */
+#define DOUBLE_FAULT_A         0x0008  /* Core A Double Fault Causes Reset */
+#define DOUBLE_FAULT_B         0x0010  /* Core B Double Fault Causes Reset */
+#define SWRST_DBL_FAULT_A      0x0800  /* SWRST Core A Double Fault */
+#define SWRST_DBL_FAULT_B      0x1000  /* SWRST Core B Double Fault */
+#define SWRST_WDT_B                   0x2000   /* SWRST Watchdog B */
+#define SWRST_WDT_A                   0x4000   /* SWRST Watchdog A */
+#define SWRST_OCCURRED         0x8000  /* SWRST Status */
 
 /* *************  SYSTEM INTERRUPT CONTROLLER MASKS ***************** */
 
index 12789927db3d976ec7e807a6416d23d477841244..83f0383957d25e099f36e04c139bf4197e7d705c 100644 (file)
 
 #define GPIO_IRQ_BASE          IRQ_PF0
 
-#ifdef CONFIG_IRQCHIP_DEMUX_GPIO
 #define NR_IRQS                        (IRQ_PF47 + 1)
-#else
-#define NR_IRQS                        SYS_IRQS
-#endif
 
 #define IVG7                   7
 #define IVG8                   8
index f7ac09cf2c3d3be80a8d532f6face2d2ac64e171..c26d8486cc4b833d85ed36204f5642c2c2608dce 100644 (file)
 #define ASYNC_BANK0_BASE       0x20000000       /* Async Bank 0 */
 #define ASYNC_BANK0_SIZE       0x04000000      /* 64M */
 
+/* Boot ROM Memory */
+
+#define BOOT_ROM_START         0xEF000000
+#define BOOT_ROM_LENGTH                0x800
+
 /* Level 1 Memory */
 
 #ifdef CONFIG_BFIN_ICACHE
@@ -67,9 +72,7 @@
 
 /* Scratch Pad Memory */
 
-#if defined(CONFIG_BF561)
 #define L1_SCRATCH_START       0xFFB00000
 #define L1_SCRATCH_LENGTH      0x1000
-#endif
 
 #endif                         /* _MEM_MAP_533_H_ */
index c1d8c4a78fcfc7a4a7e8e7b840ce30e856d139bd..e8967f6124f7ea2eb0a3878ec9fbc70c142e9c9d 100644 (file)
@@ -46,7 +46,7 @@
 #endif
 
 #define bfin_read8(addr) ({ \
-       uint8_t __v; \
+       uint32_t __v; \
        __asm__ __volatile__( \
                NOP_PAD_ANOMALY_05000198 \
                "%0 = b[%1] (z);" \
@@ -56,7 +56,7 @@
        __v; })
 
 #define bfin_read16(addr) ({ \
-       uint16_t __v; \
+       uint32_t __v; \
        __asm__ __volatile__( \
                NOP_PAD_ANOMALY_05000198 \
                "%0 = w[%1] (z);" \
@@ -80,7 +80,7 @@
                NOP_PAD_ANOMALY_05000198 \
                "b[%0] = %1;" \
                : \
-               : "a" (addr), "d" (val) \
+               : "a" (addr), "d" ((uint8_t)(val)) \
                : "memory" \
        )
 
@@ -89,7 +89,7 @@
                NOP_PAD_ANOMALY_05000198 \
                "w[%0] = %1;" \
                : \
-               : "a" (addr), "d" (val) \
+               : "a" (addr), "d" ((uint16_t)(val)) \
                : "memory" \
        )
 
index 3b671d5fd70d5c6110fe05a2097d5a37fe92304f..cbaff24b4b25040dda2b82fb9d84397d299adaf9 100644 (file)
@@ -1,6 +1,6 @@
 
 /* This handles the memory map.. */
 
-#ifdef CONFIG_BFIN
+#ifdef CONFIG_BLACKFIN
 #define PAGE_OFFSET_RAW                0x00000000
 #endif
index e8ada91ab0020a09fe0fe2083cb368a01328b3fc..321f4d96e4ae481ff248eb1e6b36b64233c1bc32 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _BLACKFIN_STRING_H_
 #define _BLACKFIN_STRING_H_
 
+#include <linux/types.h>
+
 #ifdef __KERNEL__              /* only set these up for kernel code */
 
 #define __HAVE_ARCH_STRCPY
index fe365b1b7ca8085cc54acf8197618aca85aa192c..ee1cbf73a9ab2a8993eb8eec90531a7e90b70baf 100644 (file)
 
 #ifndef __ASSEMBLY__
 
-#define HWC_x2 "System MMR Error\nAn error occurred due to an invalid access to an System MMR location\nPossible reason: a 32-bit register is accessed with a 16-bit instruction,\nor a 16-bit register is accessed with a 32-bit instruction.\n"
-#define HWC_x3 "External Memory Addressing Error\n"
-#define HWC_x12 "Performance Monitor Overflow\n"
-#define HWC_x18 "RAISE 5 instruction\n Software issued a RAISE 5 instruction to invoke the Hardware\n"
-#define HWC_default "Reserved\n"
-
-#define EXC_0x03 "Application stack overflow\n - Please increase the stack size of the application using elf2flt -s option,\n and/or reduce the stack use of the application.\n"
-#define EXC_0x10 "Single step\n - When the processor is in single step mode, every instruction\n generates an exception. Primarily used for debugging.\n"
-#define EXC_0x11 "Exception caused by a trace buffer full condition\n - The processor takes this exception when the trace\n buffer overflows (only when enabled by the Trace Unit Control register).\n"
-#define EXC_0x21 "Undefined instruction\n - May be used to emulate instructions that are not defined for\n a particular processor implementation.\n"
-#define EXC_0x22 "Illegal instruction combination\n - See section for multi-issue rules in the ADSP-BF53x Blackfin\n Processor Instruction Set Reference.\n"
-#define EXC_0x23 "Data access CPLB protection violation\n - Attempted read or write to Supervisor resource,\n or illegal data memory access. \n"
-#define EXC_0x24 "Data access misaligned address violation\n - Attempted misaligned data memory or data cache access.\n"
-#define EXC_0x25 "Unrecoverable event\n - For example, an exception generated while processing a previous exception.\n"
-#define EXC_0x26 "Data access CPLB miss\n - Used by the MMU to signal a CPLB miss on a data access.\n"
-#define EXC_0x27 "Data access multiple CPLB hits\n - More than one CPLB entry matches data fetch address.\n"
-#define EXC_0x28 "Program Sequencer Exception caused by an emulation watchpoint match\n - There is a watchpoint match, and one of the EMUSW\n bits in the Watchpoint Instruction Address Control register (WPIACTL) is set.\n"
-#define EXC_0x2A "Instruction fetch misaligned address violation\n - Attempted misaligned instruction cache fetch. On a misaligned instruction fetch exception,\n the return address provided in RETX is the destination address which is misaligned, rather than the address of the offending instruction.\n"
-#define EXC_0x2B "CPLB protection violation\n - Illegal instruction fetch access (memory protection violation).\n"
-#define EXC_0x2C "Instruction fetch CPLB miss\n - CPLB miss on an instruction fetch.\n"
-#define EXC_0x2D "Instruction fetch multiple CPLB hits\n - More than one CPLB entry matches instruction fetch address.\n"
-#define EXC_0x2E "Illegal use of supervisor resource\n - Attempted to use a Supervisor register or instruction from User mode.\n Supervisor resources are registers and instructions that are reserved\n for Supervisor use: Supervisor only registers, all MMRs, and Supervisor\n only instructions.\n"
+#define HWC_x2(level) \
+       "System MMR Error\n" \
+       level " - An error occurred due to an invalid access to an System MMR location\n" \
+       level "   Possible reason: a 32-bit register is accessed with a 16-bit instruction\n" \
+       level "   or a 16-bit register is accessed with a 32-bit instruction.\n"
+#define HWC_x3(level) \
+       "External Memory Addressing Error\n"
+#define HWC_x12(level) \
+       "Performance Monitor Overflow\n"
+#define HWC_x18(level) \
+       "RAISE 5 instruction\n" \
+       level "    Software issued a RAISE 5 instruction to invoke the Hardware\n"
+#define HWC_default(level) \
+        "Reserved\n"
+#define EXC_0x03(level) \
+       "Application stack overflow\n" \
+       level " - Please increase the stack size of the application using elf2flt -s option,\n" \
+       level "   and/or reduce the stack use of the application.\n"
+#define EXC_0x10(level) \
+       "Single step\n" \
+       level " - When the processor is in single step mode, every instruction\n" \
+       level "   generates an exception. Primarily used for debugging.\n"
+#define EXC_0x11(level) \
+       "Exception caused by a trace buffer full condition\n" \
+       level " - The processor takes this exception when the trace\n" \
+       level "   buffer overflows (only when enabled by the Trace Unit Control register).\n"
+#define EXC_0x21(level) \
+       "Undefined instruction\n" \
+       level " - May be used to emulate instructions that are not defined for\n" \
+       level "   a particular processor implementation.\n"
+#define EXC_0x22(level) \
+       "Illegal instruction combination\n" \
+       level " - See section for multi-issue rules in the ADSP-BF53x Blackfin\n" \
+       level "   Processor Instruction Set Reference.\n"
+#define EXC_0x23(level) \
+       "Data access CPLB protection violation\n" \
+       level " - Attempted read or write to Supervisor resource,\n" \
+       level "   or illegal data memory access. \n"
+#define EXC_0x24(level) \
+       "Data access misaligned address violation\n" \
+       level " - Attempted misaligned data memory or data cache access.\n"
+#define EXC_0x25(level) \
+       "Unrecoverable event\n" \
+       level " - For example, an exception generated while processing a previous exception.\n"
+#define EXC_0x26(level) \
+       "Data access CPLB miss\n" \
+       level " - Used by the MMU to signal a CPLB miss on a data access.\n"
+#define EXC_0x27(level) \
+       "Data access multiple CPLB hits\n" \
+       level " - More than one CPLB entry matches data fetch address.\n"
+#define EXC_0x28(level) \
+       "Program Sequencer Exception caused by an emulation watchpoint match\n" \
+       level " - There is a watchpoint match, and one of the EMUSW\n" \
+       level "   bits in the Watchpoint Instruction Address Control register (WPIACTL) is set.\n"
+#define EXC_0x2A(level) \
+       "Instruction fetch misaligned address violation\n" \
+       level " - Attempted misaligned instruction cache fetch. On a misaligned instruction fetch\n" \
+       level "   exception, the return address provided in RETX is the destination address which is\n" \
+       level "   misaligned, rather than the address of the offending instruction.\n"
+#define EXC_0x2B(level) \
+       "CPLB protection violation\n" \
+       level " - Illegal instruction fetch access (memory protection violation).\n"
+#define EXC_0x2C(level) \
+       "Instruction fetch CPLB miss\n" \
+       level " - CPLB miss on an instruction fetch.\n"
+#define EXC_0x2D(level) \
+       "Instruction fetch multiple CPLB hits\n" \
+       level " - More than one CPLB entry matches instruction fetch address.\n"
+#define EXC_0x2E(level) \
+       "Illegal use of supervisor resource\n" \
+       level " - Attempted to use a Supervisor register or instruction from User mode.\n" \
+       level "   Supervisor resources are registers and instructions that are reserved\n" \
+       level "   for Supervisor use: Supervisor only registers, all MMRs, and Supervisor\n" \
+       level "   only instructions.\n"
 
 #endif                         /* __ASSEMBLY__ */
 #endif                         /* _BFIN_TRAPS_H */
index 0b51a87e5532e9025111b6c5177bf8c964d58f22..2949a945876a5c4685197927426809a61ee03999 100644 (file)
@@ -3,6 +3,8 @@
 #ifndef __ASM_CRIS_ATOMIC__
 #define __ASM_CRIS_ATOMIC__
 
+#include <linux/compiler.h>
+
 #include <asm/system.h>
 #include <asm/arch/atomic.h>
 
index 180dbf2757b0a87c8ec0ec2ad7a1481ee3f5a5ea..c6c5be62c6981aadf552a1d8dadf54b4a3012d1c 100644 (file)
@@ -62,7 +62,7 @@ static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
  * returns a 16-bit checksum, already complemented
  */
 
-static inline __sum16 int csum_tcpudp_magic(__be32 saddr, __be32 daddr,
+static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr,
                                                   unsigned short len,
                                                   unsigned short proto,
                                                   __wsum sum)
index 30da58a7d00d26c8a3ffca11c498b342b7b4b28b..4d58652c3a49b1f75b2b2581cabd1a7597398806 100644 (file)
@@ -15,4 +15,7 @@
 #define SET_ETH_DUPLEX_AUTO     SIOCDEVPRIVATE+3        /* Auto neg duplex */
 #define SET_ETH_DUPLEX_HALF     SIOCDEVPRIVATE+4        /* Full duplex */
 #define SET_ETH_DUPLEX_FULL     SIOCDEVPRIVATE+5        /* Half duplex */
+#define SET_ETH_ENABLE_LEDS     SIOCDEVPRIVATE+6        /* Enable net LEDs */
+#define SET_ETH_DISABLE_LEDS    SIOCDEVPRIVATE+7        /* Disable net LEDs */
+#define SET_ETH_AUTONEG         SIOCDEVPRIVATE+8
 #endif /* _CRIS_ETHERNET_H */
index a3a77132ce326023a525f743dfe07962fccc1381..8f8a8d6c9653077ea956a60cd25502190e83c2ed 100644 (file)
@@ -1,9 +1,8 @@
-/* $Id: fasttimer.h,v 1.3 2004/05/14 10:19:19 starvik Exp $
+/*
  * linux/include/asm-cris/fasttimer.h
  *
  * Fast timers for ETRAX100LX
- * This may be useful in other OS than Linux so use 2 space indentation...
- * Copyright (C) 2000, 2002 Axis Communications AB
+ * Copyright (C) 2000-2007 Axis Communications AB
  */
 #include <linux/time.h> /* struct timeval */
 #include <linux/timex.h>
 
 typedef void fast_timer_function_type(unsigned long);
 
+struct fasttime_t {
+       unsigned long tv_jiff;  /* jiffies */
+       unsigned long tv_usec;  /* microseconds */
+};
+
 struct fast_timer{ /* Close to timer_list */
   struct fast_timer *next;
   struct fast_timer *prev;
-  struct timeval tv_set;
-  struct timeval tv_expires;
+       struct fasttime_t tv_set;
+       struct fasttime_t tv_expires;
   unsigned long delay_us;
   fast_timer_function_type *function;
   unsigned long data;
@@ -38,6 +42,6 @@ int del_fast_timer(struct fast_timer * t);
 void schedule_usleep(unsigned long us);
 
 
-void fast_timer_init(void);
+int fast_timer_init(void);
 
 #endif
index 1c13dd3faac3df57e186590f538ac4195bf5a9ea..74178adeb1cd30f3a07eed6366ee36b8613ffe47 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef __ASM_HARDIRQ_H
 #define __ASM_HARDIRQ_H
 
+#include <asm/irq.h>
 #include <linux/threads.h>
 #include <linux/cache.h>
 
index 92000d0c3f9753a645fdf14dbfd875cd22e9b91b..3a5e4c43eae730c6acce90361cb83a9d7adc266d 100644 (file)
@@ -52,7 +52,6 @@ typedef struct {
 } __kernel_fsid_t;
 
 #ifdef __KERNEL__
-#include <linux/bitops.h>
 
 #undef __FD_SET
 #define __FD_SET(fd,fdsetp) set_bit(fd, (void *)(fdsetp))
index 71c1b36269b8b490915e8550183fc79aeff98ba4..66e1a7492a0c7aeeac549aaedaefb48e884e68a7 100644 (file)
@@ -171,6 +171,19 @@ struct ktermios {
 #define  B115200 0010002
 #define  B230400 0010003
 #define  B460800 0010004
+
+/* Unsupported rates, but needed to avoid compile error. */
+#define   B500000 0010005
+#define   B576000 0010006
+#define  B1000000 0010010
+#define  B1152000 0010011
+#define  B1500000 0010012
+#define  B2000000 0010013
+#define  B2500000 0010014
+#define  B3000000 0010015
+#define  B3500000 0010016
+#define  B4000000 0010017
+
 /* etrax supports these additional three baud rates */
 #define  B921600   0010005
 #define  B1843200  0010006
index fde39f6c49c7780ab96beb0b0fa4e90fe6dae40c..784668ab0fa29dfdb251302f623993c9ceb19d65 100644 (file)
@@ -32,6 +32,7 @@ struct thread_info {
        unsigned long           flags;          /* low level flags */
        __u32                   cpu;            /* current CPU */
        int                     preempt_count;  /* 0 => preemptable, <0 => BUG */
+       __u32                   tls;            /* TLS for this thread */
 
        mm_segment_t            addr_limit;     /* thread address space:
                                                   0-0xBFFFFFFF for user-thead
@@ -79,14 +80,18 @@ struct thread_info {
  * - other flags in MSW
  */
 #define TIF_SYSCALL_TRACE      0       /* syscall trace active */
-#define TIF_SIGPENDING         1       /* signal pending */
-#define TIF_NEED_RESCHED       2       /* rescheduling necessary */
+#define TIF_NOTIFY_RESUME      1       /* resumption notification requested */
+#define TIF_SIGPENDING         2       /* signal pending */
+#define TIF_NEED_RESCHED       3       /* rescheduling necessary */
+#define TIF_RESTORE_SIGMASK    9       /* restore signal mask in do_signal() */
 #define TIF_POLLING_NRFLAG     16      /* true if poll_idle() is polling TIF_NEED_RESCHED */
 #define TIF_MEMDIE             17
 
 #define _TIF_SYSCALL_TRACE     (1<<TIF_SYSCALL_TRACE)
+#define _TIF_NOTIFY_RESUME     (1<<TIF_NOTIFY_RESUME)
 #define _TIF_SIGPENDING                (1<<TIF_SIGPENDING)
 #define _TIF_NEED_RESCHED      (1<<TIF_NEED_RESCHED)
+#define _TIF_RESTORE_SIGMASK   (1<<TIF_RESTORE_SIGMASK)
 #define _TIF_POLLING_NRFLAG    (1<<TIF_POLLING_NRFLAG)
 
 #define _TIF_WORK_MASK         0x0000FFFE      /* work to do on interrupt/exception return */
index 6cc26debe40f9176698b6109b7eff83efa1c58e4..7724246a2601495d0b16b76eba516f1c8f9b8be8 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _CRIS_TLB_H
 #define _CRIS_TLB_H
 
+#include <linux/pagemap.h>
+
 #include <asm/arch/tlb.h>
 
 /*
index 7c90fa970c3842f468b88b163943770425db6dbe..6f2d924f4fd6d0f1421a46666ae81ad9c418b52f 100644 (file)
 #define __NR_io_submit         248
 #define __NR_io_cancel         249
 #define __NR_fadvise64         250
+/* 251 is available for reuse (was briefly sys_set_zone_reclaim) */
 #define __NR_exit_group                252
 #define __NR_lookup_dcookie    253
 #define __NR_epoll_create      254
 #define __NR_add_key           286
 #define __NR_request_key       287
 #define __NR_keyctl            288
+#define __NR_ioprio_set                289
+#define __NR_ioprio_get                290
+#define __NR_inotify_init      291
+#define __NR_inotify_add_watch 292
+#define __NR_inotify_rm_watch  293
+#define __NR_migrate_pages     294
+#define __NR_openat            295
+#define __NR_mkdirat           296
+#define __NR_mknodat           297
+#define __NR_fchownat          298
+#define __NR_futimesat         299
+#define __NR_fstatat64         300
+#define __NR_unlinkat          301
+#define __NR_renameat          302
+#define __NR_linkat            303
+#define __NR_symlinkat         304
+#define __NR_readlinkat                305
+#define __NR_fchmodat          306
+#define __NR_faccessat         307
+#define __NR_pselect6          308
+#define __NR_ppoll             309
+#define __NR_unshare           310
+#define __NR_set_robust_list   311
+#define __NR_get_robust_list   312
+#define __NR_splice            313
+#define __NR_sync_file_range   314
+#define __NR_tee               315
+#define __NR_vmsplice          316
+#define __NR_move_pages                317
+#define __NR_getcpu            318
+#define __NR_epoll_pwait       319
+#define __NR_utimensat         320
+#define __NR_signalfd          321
+#define __NR_timerfd           322
+#define __NR_eventfd           323
+#define __NR_fallocate         324
 
 #ifdef __KERNEL__
 
-#define NR_syscalls 289
+#define NR_syscalls 325
 
 #include <asm/arch/unistd.h>
 
index 8fefd6b827aab3dea697294d99cec7e4934a4429..3a66ebd754bd03604eca6efd4ed8b0efed7093cd 100644 (file)
@@ -12,9 +12,6 @@
 #ifndef _ASM_IRQ_H_
 #define _ASM_IRQ_H_
 
-/* this number is used when no interrupt has been assigned */
-#define NO_IRQ                         (-1)
-
 #define NR_IRQS                                48
 #define IRQ_BASE_CPU                   (0 * 16)
 #define IRQ_BASE_FPGA                  (1 * 16)
index cfe3692b23e580a01ccf0ad7a9102e854c8be792..a4a22cc358987c86999ef602301b2ca189526dfe 100644 (file)
@@ -12,7 +12,7 @@
  *   then it defines them prior including asm-generic/resource.h. )
  */
 
-#define RLIMIT_CPU             0       /* CPU time in ms */
+#define RLIMIT_CPU             0       /* CPU time in sec */
 #define RLIMIT_FSIZE           1       /* Maximum filesize */
 #define RLIMIT_DATA            2       /* max data size */
 #define RLIMIT_STACK           3       /* max stack size */
index 49730ffbbae41f25251aa4e44bb9090e48b41341..81bcd5e517898af73ac5b096c8e1eed682968f6d 100644 (file)
@@ -94,6 +94,7 @@ ia64_acpi_release_global_lock (unsigned int *lock)
 #define acpi_noirq 0   /* ACPI always enabled on IA64 */
 #define acpi_pci_disabled 0 /* ACPI PCI always enabled on IA64 */
 #define acpi_strict 1  /* no ACPI spec workarounds on IA64 */
+#define acpi_processor_cstate_check(x) (x) /* no idle limits on IA64 :) */
 static inline void disable_acpi(void) { }
 
 const char *acpi_get_sysname (void);
index abfcb3a2588fb7de4e98190fd95723d2de526e55..8a695d3407d2576a8d51a4c99d2c2201202b2a87 100644 (file)
@@ -1379,10 +1379,11 @@ struct pal_features_s;
 static inline s64
 ia64_pal_proc_get_features (u64 *features_avail,
                            u64 *features_status,
-                           u64 *features_control)
+                           u64 *features_control,
+                           u64 features_set)
 {
        struct ia64_pal_retval iprv;
-       PAL_CALL_PHYS(iprv, PAL_PROC_GET_FEATURES, 0, 0, 0);
+       PAL_CALL_PHYS(iprv, PAL_PROC_GET_FEATURES, 0, features_set, 0);
        if (iprv.status == 0) {
                *features_avail   = iprv.v0;
                *features_status  = iprv.v1;
index 43a7aac414e04e7d74a1a6b45065b1a3b3c3846e..c4f1e328a5ba845f0635e42f0669b137369a604d 100644 (file)
@@ -46,7 +46,7 @@
 #ifdef CONFIG_SMP
 
 extern unsigned long __per_cpu_offset[NR_CPUS];
-#define per_cpu_offset(x) (__per_cpu_offset(x))
+#define per_cpu_offset(x) (__per_cpu_offset[x])
 
 /* Equal to __per_cpu_offset[smp_processor_id()], but faster to access: */
 DECLARE_PER_CPU(unsigned long, local_per_cpu_offset);
index 471cc2ee9ac4c10be30a3b6d772f53912593d90e..4fa733dd417a4102ae7409661f9312a4b431ec9c 100644 (file)
@@ -60,7 +60,6 @@ extern cpumask_t cpu_online_map;
 extern cpumask_t cpu_core_map[NR_CPUS];
 DECLARE_PER_CPU(cpumask_t, cpu_sibling_map);
 extern int smp_num_siblings;
-extern int smp_num_cpucores;
 extern void __iomem *ipi_base_addr;
 extern unsigned char smp_int_redirect;
 
index eb1b566793fe140fd66b2cbae666a402c4727360..27c2f9bb4dbdd7a6528203ccd3a98e95b17486ab 100644 (file)
 #define __NR_rt_sigtimedwait   177
 #define __NR_rt_sigqueueinfo   178
 #define __NR_rt_sigsuspend     179
-#define __NR_pread             180
-#define __NR_pwrite            181
+#define __NR_pread64           180
+#define __NR_pwrite64          181
 #define __NR_lchown            182
 #define __NR_getcwd            183
 #define __NR_capget            184
diff --git a/include/asm-mips/8253pit.h b/include/asm-mips/8253pit.h
deleted file mode 100644 (file)
index 285f784..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- * 8253/8254 Programmable Interval Timer
- */
-
-#ifndef _8253PIT_H
-#define _8253PIT_H
-
-#define PIT_TICK_RATE  1193182UL
-
-#endif
index 94f1c8172360bb5712e9c5b4607ae7d1e1152d66..ed5c02c6afbbafa98420565c8f7a88c74bbe2e27 100644 (file)
@@ -54,6 +54,7 @@ struct cpuinfo_mips {
        struct cache_desc       dcache; /* Primary D or combined I/D cache */
        struct cache_desc       scache; /* Secondary cache */
        struct cache_desc       tcache; /* Tertiary/split secondary cache */
+       int                     srsets; /* Shadow register sets */
 #if defined(CONFIG_MIPS_MT_SMTC)
        /*
         * In the MIPS MT "SMTC" model, each TC is considered
index 833437d31ef1634c1286d957b8cca8971bc158f2..d6a6c21f16db507f7e8f362f63427fdfbd922d43 100644 (file)
@@ -92,6 +92,7 @@
 #define MAX_DMA_ADDRESS                (PAGE_OFFSET + 0x01000000)
 #endif
 #define MAX_DMA_PFN            PFN_DOWN(virt_to_phys((void *)MAX_DMA_ADDRESS))
+#define MAX_DMA32_PFN          (1UL << (32 - PAGE_SHIFT))
 
 /* 8237 DMA controllers */
 #define IO_DMA1_BASE   0x00    /* 8 bit slave DMA, channels 0..3 */
index 3e7e30d4f4184b5a61a95786bcb0cfefe33f84f2..17f082cfea85c055cda99f1fcd6305331daa726e 100644 (file)
@@ -35,7 +35,7 @@
                "       .set    mips0                           \n"     \
                "       .section .fixup,\"ax\"                  \n"     \
                "4:     li      %0, %6                          \n"     \
-               "       j       2b                              \n"     \
+               "       j       3b                              \n"     \
                "       .previous                               \n"     \
                "       .section __ex_table,\"a\"               \n"     \
                "       "__UA_ADDR "\t1b, 4b                    \n"     \
@@ -61,7 +61,7 @@
                "       .set    mips0                           \n"     \
                "       .section .fixup,\"ax\"                  \n"     \
                "4:     li      %0, %6                          \n"     \
-               "       j       2b                              \n"     \
+               "       j       3b                              \n"     \
                "       .previous                               \n"     \
                "       .section __ex_table,\"a\"               \n"     \
                "       "__UA_ADDR "\t1b, 4b                    \n"     \
@@ -200,4 +200,4 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
 }
 
 #endif
-#endif
+#endif /* _ASM_FUTEX_H */
index affb32ce4af980e86502e9700a34da79e73503ff..5dabc870b32295779a6d2a93bbed0d90ac6a1f90 100644 (file)
@@ -5,25 +5,16 @@
 #ifndef __ASM_I8253_H
 #define __ASM_I8253_H
 
+#include <linux/spinlock.h>
+
 /* i8253A PIT registers */
 #define PIT_MODE               0x43
 #define PIT_CH0                        0x40
 #define PIT_CH2                        0x42
 
-/* i8259A PIC registers */
-#define PIC_MASTER_CMD         0x20
-#define PIC_MASTER_IMR         0x21
-#define PIC_MASTER_ISR         PIC_MASTER_CMD
-#define PIC_MASTER_POLL                PIC_MASTER_ISR
-#define PIC_MASTER_OCW3                PIC_MASTER_ISR
-#define PIC_SLAVE_CMD          0xa0
-#define PIC_SLAVE_IMR          0xa1
+#define PIT_TICK_RATE          1193182UL
 
-/* i8259A PIC related value */
-#define PIC_CASCADE_IR         2
-#define MASTER_ICW4_DEFAULT    0x01
-#define SLAVE_ICW4_DEFAULT     0x01
-#define PIC_ICW4_AEOI          2
+extern spinlock_t i8253_lock;
 
 extern void setup_pit_timer(void);
 
index 042f821899a85c89318ea2b748e9a95ddaf6e732..85bc5302bce0142494a3a2e79599f1499e5f9780 100644 (file)
@@ -22,10 +22,12 @@ enum ip32_irq_no {
         * CPU interrupts are 0 ... 7
         */
 
+       CRIME_IRQ_BASE                  = MIPS_CPU_IRQ_BASE + 8,
+
        /*
         * MACE
         */
-       MACE_VID_IN1_IRQ                = MIPS_CPU_IRQ_BASE + 8,
+       MACE_VID_IN1_IRQ                = CRIME_IRQ_BASE,
        MACE_VID_IN2_IRQ,
        MACE_VID_OUT_IRQ,
        MACE_ETHERNET_IRQ,
index b2dc35f561818b6fe266f7ff1be6f26d1feed9c2..81602c8047eb582e7b8aa39559c1815c02a5ae42 100644 (file)
 #define JMR3927_IRQ_IRC_DMA    (JMR3927_IRQ_IRC + TX3927_IR_DMA)
 #define JMR3927_IRQ_IRC_PIO    (JMR3927_IRQ_IRC + TX3927_IR_PIO)
 #define JMR3927_IRQ_IRC_PCI    (JMR3927_IRQ_IRC + TX3927_IR_PCI)
-#define JMR3927_IRQ_IRC_TMR0   (JMR3927_IRQ_IRC + TX3927_IR_TMR0)
-#define JMR3927_IRQ_IRC_TMR1   (JMR3927_IRQ_IRC + TX3927_IR_TMR1)
-#define JMR3927_IRQ_IRC_TMR2   (JMR3927_IRQ_IRC + TX3927_IR_TMR2)
+#define JMR3927_IRQ_IRC_TMR(ch)        (JMR3927_IRQ_IRC + TX3927_IR_TMR(ch))
 #define JMR3927_IRQ_IOC_PCIA   (JMR3927_IRQ_IOC + JMR3927_IOC_INTB_PCIA)
 #define JMR3927_IRQ_IOC_PCIB   (JMR3927_IRQ_IOC + JMR3927_IOC_INTB_PCIB)
 #define JMR3927_IRQ_IOC_PCIC   (JMR3927_IRQ_IOC + JMR3927_IOC_INTB_PCIC)
 #define JMR3927_IRQ_IOCINT     JMR3927_IRQ_IRC_INT1
 /* TC35815 100M Ether (JMR-TX3912:JPW4:2-3 Short) */
 #define JMR3927_IRQ_ETHER0     JMR3927_IRQ_IRC_INT3
-/* Clock Tick (10ms) */
-#define JMR3927_IRQ_TICK       JMR3927_IRQ_IRC_TMR0
 
 /* Clocks */
 #define JMR3927_CORECLK        132710400       /* 132.7MHz */
 #define JMR3927_GBUSCLK        (JMR3927_CORECLK / 2)   /* 66.35MHz */
 #define JMR3927_IMCLK  (JMR3927_CORECLK / 4)   /* 33.17MHz */
 
-#define jmr3927_tmrptr         tx3927_tmrptr(0)        /* TMR0 */
-
-
 /*
  * TX3927 Pin Configuration:
  *
index 211bcf47fffb41e7281018c98572dbaafaf8abde..338f99882a39878f8625d1071c6a634a37450c72 100644 (file)
@@ -222,9 +222,7 @@ struct tx3927_ccfg_reg {
 #define TX3927_IR_DMA  8
 #define TX3927_IR_PIO  9
 #define TX3927_IR_PCI  10
-#define TX3927_IR_TMR0 13
-#define TX3927_IR_TMR1 14
-#define TX3927_IR_TMR2 15
+#define TX3927_IR_TMR(ch)      (13 + (ch))
 #define TX3927_NUM_IR  16
 
 /*
index 58a8ff6be815911ceab92481775a9a062a68517c..0474fe8dac3fa6a14dd87813babd08562a2bfb37 100644 (file)
 #ifndef __ASM_TXX927_H
 #define __ASM_TXX927_H
 
-struct txx927_tmr_reg {
-       volatile unsigned long tcr;
-       volatile unsigned long tisr;
-       volatile unsigned long cpra;
-       volatile unsigned long cprb;
-       volatile unsigned long itmr;
-       volatile unsigned long unused0[3];
-       volatile unsigned long ccdr;
-       volatile unsigned long unused1[3];
-       volatile unsigned long pgmr;
-       volatile unsigned long unused2[3];
-       volatile unsigned long wtmr;
-       volatile unsigned long unused3[43];
-       volatile unsigned long trr;
-};
-
 struct txx927_sio_reg {
        volatile unsigned long lcr;
        volatile unsigned long dicr;
@@ -50,27 +34,6 @@ struct txx927_pio_reg {
        volatile unsigned long maskext;
 };
 
-/*
- * TMR
- */
-/* TMTCR : Timer Control */
-#define TXx927_TMTCR_TCE       0x00000080
-#define TXx927_TMTCR_CCDE      0x00000040
-#define TXx927_TMTCR_CRE       0x00000020
-#define TXx927_TMTCR_ECES      0x00000008
-#define TXx927_TMTCR_CCS       0x00000004
-#define TXx927_TMTCR_TMODE_MASK        0x00000003
-#define TXx927_TMTCR_TMODE_ITVL        0x00000000
-
-/* TMTISR : Timer Int. Status */
-#define TXx927_TMTISR_TPIBS    0x00000004
-#define TXx927_TMTISR_TPIAS    0x00000002
-#define TXx927_TMTISR_TIIS     0x00000001
-
-/* TMTITMR : Interval Timer Mode */
-#define TXx927_TMTITMR_TIIE    0x00008000
-#define TXx927_TMTITMR_TZCE    0x00000001
-
 /*
  * SIO
  */
index 581dc45685a23a05b5129ec9c6630d89e36e42ad..e0d2458b43d06f4be912d70088dfc76105ca9442 100644 (file)
@@ -1,11 +1,6 @@
 #ifndef __ASM_LASAT_LASATINT_H
 #define __ASM_LASAT_LASATINT_H
 
-#include <linux/irq.h>
-
-#define LASATINT_BASE  MIPS_CPU_IRQ_BASE
-#define LASATINT_END   (LASATINT_BASE + 16)
-
 /* lasat 100 */
 #define LASAT_INT_STATUS_REG_100       (KSEG1ADDR(0x1c880000))
 #define LASAT_INT_MASK_REG_100         (KSEG1ADDR(0x1c890000))
diff --git a/include/asm-mips/mach-au1x00/timex.h b/include/asm-mips/mach-au1x00/timex.h
deleted file mode 100644 (file)
index e3ada66..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * 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) 2003 by Ralf Baechle
- */
-#ifndef __ASM_MACH_AU1X00_TIMEX_H
-#define __ASM_MACH_AU1X00_TIMEX_H
-
-#define CLOCK_TICK_RATE                ((HZ * 100000UL) / 2)
-
-#endif /* __ASM_MACH_AU1X00_TIMEX_H */
index 179d0e850b59a6d35b6ec1ae009649f0e40ce858..57c8c9ac585162b6a16a32d912d7d438d0a772be 100644 (file)
@@ -35,7 +35,7 @@
  *     4 - ethernet
  *     5 - 16550 UART
  *     6 - cascade i8259
- *     7 - CP0 counter (unused)
+ *     7 - CP0 counter
  */
 #define MIPS_CPU_IRQ_BASE              16
 
@@ -48,7 +48,6 @@
 #define SCSI_IRQ                       (MIPS_CPU_IRQ_BASE + 5)
 #define I8259_CASCADE_IRQ              (MIPS_CPU_IRQ_BASE + 6)
 
-
 #define GT641XX_IRQ_BASE               24
 
 #include <asm/irq_gt641xx.h>
diff --git a/include/asm-mips/mach-generic/timex.h b/include/asm-mips/mach-generic/timex.h
deleted file mode 100644 (file)
index 48b4cfa..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * 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) 2003, 2005 by Ralf Baechle
- */
-#ifndef __ASM_MACH_GENERIC_TIMEX_H
-#define __ASM_MACH_GENERIC_TIMEX_H
-
-#define CLOCK_TICK_RATE                500000
-
-#endif /* __ASM_MACH_GENERIC_TIMEX_H */
diff --git a/include/asm-mips/mach-jazz/timex.h b/include/asm-mips/mach-jazz/timex.h
deleted file mode 100644 (file)
index 93affa3..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * 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) 2003 by Ralf Baechle
- */
-#ifndef __ASM_MACH_JAZZ_TIMEX_H
-#define __ASM_MACH_JAZZ_TIMEX_H
-
-/*
- * Jazz is still using the R4030 100Hz counter
- */
-#define CLOCK_TICK_RATE                100
-
-#endif /* __ASM_MACH_JAZZ_TIMEX_H */
diff --git a/include/asm-mips/mach-lasat/irq.h b/include/asm-mips/mach-lasat/irq.h
new file mode 100644 (file)
index 0000000..da75f89
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef _ASM_MACH_LASAT_IRQ_H
+#define _ASM_MACH_LASAT_IRQ_H
+
+#define LASAT_CASCADE_IRQ      (MIPS_CPU_IRQ_BASE + 0)
+
+#define LASAT_IRQ_BASE         8
+#define LASAT_IRQ_END          23
+
+#define NR_IRQS                        24
+
+#include_next <irq.h>
+
+#endif /* _ASM_MACH_LASAT_IRQ_H */
diff --git a/include/asm-mips/mach-qemu/timex.h b/include/asm-mips/mach-qemu/timex.h
deleted file mode 100644 (file)
index cd54369..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * 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) 2005 Daniel Jacobowitz
- */
-#ifndef __ASM_MACH_QEMU_TIMEX_H
-#define __ASM_MACH_QEMU_TIMEX_H
-
-/*
- * We use a simulated i8254 PIC...
- */
-#define CLOCK_TICK_RATE                1193182
-
-#endif /* __ASM_MACH_QEMU_TIMEX_H */
diff --git a/include/asm-mips/mach-rm/timex.h b/include/asm-mips/mach-rm/timex.h
deleted file mode 100644 (file)
index 11ff6cb..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * 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) 2003, 2005 by Ralf Baechle
- */
-#ifndef __ASM_MACH_RM200_TIMEX_H
-#define __ASM_MACH_RM200_TIMEX_H
-
-#define CLOCK_TICK_RATE                1193182
-
-#endif /* __ASM_MACH_RM200_TIMEX_H */
index 90e4b403f53183b7eb5c08b3880f90a9760e3f85..1030562d6ea6472b914d172ce4442459fba44e0d 100644 (file)
@@ -68,11 +68,15 @@ do {                                                                        \
        if (cpu_has_dsp)                                                \
                __save_dsp(prev);                                       \
        (last) = resume(prev, next, task_thread_info(next));            \
+} while (0)
+
+#define finish_arch_switch(prev)                                       \
+do {                                                                   \
        if (cpu_has_dsp)                                                \
                __restore_dsp(current);                                 \
        if (cpu_has_userlocal)                                          \
-               write_c0_userlocal(task_thread_info(current)->tp_value);\
-} while(0)
+               write_c0_userlocal(current_thread_info()->tp_value);    \
+} while (0)
 
 static inline unsigned long __xchg_u32(volatile int * m, unsigned int val)
 {
index bc47af313bcd7550bca9bb532ec27152988f3dda..7717934f94c35122ba55e9a4830cbc91c1bcf216 100644 (file)
  * 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.
- *
- * Please refer to Documentation/mips/time.README.
  */
 #ifndef _ASM_TIME_H
 #define _ASM_TIME_H
 
-#include <linux/interrupt.h>
-#include <linux/linkage.h>
-#include <linux/ptrace.h>
 #include <linux/rtc.h>
 #include <linux/spinlock.h>
 #include <linux/clockchips.h>
@@ -38,27 +33,13 @@ extern int rtc_mips_set_mmss(unsigned long);
 /*
  * Timer interrupt functions.
  * mips_timer_state is needed for high precision timer calibration.
- * mips_timer_ack may be NULL if the interrupt is self-recoverable.
  */
 extern int (*mips_timer_state)(void);
 
-/*
- * High precision timer clocksource.
- * If .read is NULL, an R4k-compatible timer setup is attempted.
- */
-extern struct clocksource clocksource_mips;
-
-/*
- * profiling and process accouting is done separately in local_timer_interrupt
- */
-extern void local_timer_interrupt(int irq, void *dev_id);
-
 /*
  * board specific routines required by time_init().
  */
-struct irqaction;
 extern void plat_time_init(void);
-extern void plat_timer_setup(struct irqaction *irq);
 
 /*
  * mips_hpt_frequency - must be set if you intend to use an R4k-compatible
@@ -77,9 +58,22 @@ extern int (*perf_irq)(void);
  * Initialize the calling CPU's compare interrupt as clockevent device
  */
 #ifdef CONFIG_CEVT_R4K
-extern void mips_clockevent_init(void);
+extern int mips_clockevent_init(void);
+extern unsigned int __weak get_c0_compare_int(void);
+#else
+static inline int mips_clockevent_init(void)
+{
+       return -ENXIO;
+}
+#endif
+
+/*
+ * Initialize the count register as a clocksource
+ */
+#ifdef CONFIG_CEVT_R4K
+extern void init_mips_clocksource(void);
 #else
-static inline void mips_clockevent_init(void)
+static inline void init_mips_clocksource(void)
 {
 }
 #endif
index 87c68ae76ff8f109ada1eb6d6664542cc86e2a5b..6529704aa73ae0c3cee7789648fb5328b3948168 100644 (file)
 #include <asm/mipsregs.h>
 
 /*
- * This is the frequency of the timer used for Linux's timer interrupt.
- * The value should be defined as accurate as possible or under certain
- * circumstances Linux timekeeping might become inaccurate or fail.
- *
- * For many system the exact clockrate of the timer isn't known but due to
- * the way this value is used we can get away with a wrong value as long
- * as this value is:
- *
- *  - a multiple of HZ
- *  - a divisor of the actual rate
- *
- * 500000 is a good such cheat value.
- *
- * The obscure number 1193182 is the same as used by the original i8254
- * time in legacy PC hardware; the chip unfortunately also found in a
- * bunch of MIPS systems.  The last remaining user of the i8254 for the
- * timer interrupt is the RM200; it's a very standard system so there is
- * no reason to make this a separate architecture.
+ * This is the clock rate of the i8253 PIT.  A MIPS system may not have
+ * a PIT by the symbol is used all over the kernel including some APIs.
+ * So keeping it defined to the number for the PIT is the only sane thing
+ * for now.
  */
-
-#include <timex.h>
+#define CLOCK_TICK_RATE 1193182
 
 /*
  * Standard way to access the cycle counter.
@@ -50,7 +35,7 @@ typedef unsigned int cycles_t;
 
 static inline cycles_t get_cycles(void)
 {
-       return read_c0_count();
+       return 0;
 }
 
 #endif /* __KERNEL__ */
index f98b2bb719d566b8c8d5056a210ca0cdb66cf60f..3f1e470192e3731bad7af0e137d35a00f775ace7 100644 (file)
@@ -9,6 +9,7 @@
 #define __ASM_TX4927_TX4927_PCI_H
 
 #define TX4927_CCFG_TOE 0x00004000
+#define TX4927_CCFG_TINTDIS    0x01000000
 
 #define TX4927_PCIMEM      0x08000000
 #define TX4927_PCIMEM_SIZE 0x08000000
@@ -20,6 +21,8 @@
 #define TX4927_PCIC_REG         0xff1fd000
 #define TX4927_CCFG_REG         0xff1fe000
 #define TX4927_IRC_REG          0xff1ff600
+#define TX4927_NR_TMR  3
+#define TX4927_TMR_REG(ch)     (0xff1ff000 + (ch) * 0x100)
 #define TX4927_CE3      0x17f00000      /* 1M */
 #define TX4927_PCIRESET_ADDR    0xbc00f006
 #define TX4927_PCI_CLK_ADDR     (KSEG1 + TX4927_CE3 + 0x00040020)
index 650b010761f9109e66f9ef0a28beae30f01644cb..f7c448b90578f9dee0c36d07e68c8e97c8543df6 100644 (file)
@@ -641,7 +641,6 @@ struct tx4938_ccfg_reg {
 #define tx4938_pcicptr         ((struct tx4938_pcic_reg *)TX4938_PCIC_REG)
 #define tx4938_pcic1ptr                ((struct tx4938_pcic_reg *)TX4938_PCIC1_REG)
 #define tx4938_ccfgptr         ((struct tx4938_ccfg_reg *)TX4938_CCFG_REG)
-#define tx4938_tmrptr(ch)      ((struct tx4938_tmr_reg *)TX4938_TMR_REG(ch))
 #define tx4938_sioptr(ch)      ((struct tx4938_sio_reg *)TX4938_SIO_REG(ch))
 #define tx4938_pioptr          ((struct tx4938_pio_reg *)TX4938_PIO_REG)
 #define tx4938_aclcptr         ((struct tx4938_aclc_reg *)TX4938_ACLC_REG)
diff --git a/include/asm-mips/txx9tmr.h b/include/asm-mips/txx9tmr.h
new file mode 100644 (file)
index 0000000..67f70a8
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * include/asm-mips/txx9tmr.h
+ * TX39/TX49 timer controller definitions.
+ *
+ * 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.
+ */
+#ifndef __ASM_TXX9TMR_H
+#define __ASM_TXX9TMR_H
+
+#include <linux/types.h>
+
+struct txx9_tmr_reg {
+       u32 tcr;
+       u32 tisr;
+       u32 cpra;
+       u32 cprb;
+       u32 itmr;
+       u32 unused0[3];
+       u32 ccdr;
+       u32 unused1[3];
+       u32 pgmr;
+       u32 unused2[3];
+       u32 wtmr;
+       u32 unused3[43];
+       u32 trr;
+};
+
+/* TMTCR : Timer Control */
+#define TXx9_TMTCR_TCE         0x00000080
+#define TXx9_TMTCR_CCDE                0x00000040
+#define TXx9_TMTCR_CRE         0x00000020
+#define TXx9_TMTCR_ECES                0x00000008
+#define TXx9_TMTCR_CCS         0x00000004
+#define TXx9_TMTCR_TMODE_MASK  0x00000003
+#define TXx9_TMTCR_TMODE_ITVL  0x00000000
+#define TXx9_TMTCR_TMODE_PGEN  0x00000001
+#define TXx9_TMTCR_TMODE_WDOG  0x00000002
+
+/* TMTISR : Timer Int. Status */
+#define TXx9_TMTISR_TPIBS      0x00000004
+#define TXx9_TMTISR_TPIAS      0x00000002
+#define TXx9_TMTISR_TIIS       0x00000001
+
+/* TMITMR : Interval Timer Mode */
+#define TXx9_TMITMR_TIIE       0x00008000
+#define TXx9_TMITMR_TZCE       0x00000001
+
+/* TMWTMR : Watchdog Timer Mode */
+#define TXx9_TMWTMR_TWIE       0x00008000
+#define TXx9_TMWTMR_WDIS       0x00000080
+#define TXx9_TMWTMR_TWC                0x00000001
+
+void txx9_clocksource_init(unsigned long baseaddr,
+                          unsigned int imbusclk);
+void txx9_clockevent_init(unsigned long baseaddr, int irq,
+                         unsigned int imbusclk);
+void txx9_tmr_init(unsigned long baseaddr);
+
+#ifdef CONFIG_CPU_TX39XX
+#define TXX9_TIMER_BITS        24
+#else
+#define TXX9_TIMER_BITS        32
+#endif
+
+#endif /* __ASM_TXX9TMR_H */
index 0307c84a5c1d70d4cb64876d44ab81a54ca648d4..a2328b8addd83b927fb0d0642f623fc4112d7ba6 100644 (file)
@@ -91,7 +91,7 @@ extern uint m8xx_cpm_hostalloc(uint size);
 extern int  m8xx_cpm_hostfree(uint start);
 extern void m8xx_cpm_hostdump(void);
 
-extern void cpm_load_patch(volatile immap_t *immr);
+extern void cpm_load_patch(cpm8xx_t *cp);
 
 /* Buffer descriptors used by many of the CPM protocols.
 */
index 9d74338e3dec05bcd4ce93090fe365ba8279f1e1..4525c784dfd08d31ad7734a3b50fe4d42151683c 100644 (file)
@@ -138,6 +138,7 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
 #define CPU_FTR_FPU_UNAVAILABLE                ASM_CONST(0x0000000000800000)
 #define CPU_FTR_UNIFIED_ID_CACHE       ASM_CONST(0x0000000001000000)
 #define CPU_FTR_SPE                    ASM_CONST(0x0000000002000000)
+#define CPU_FTR_NEED_PAIRED_STWCX      ASM_CONST(0x0000000004000000)
 
 /*
  * Add the 64-bit processor unique features in the top half of the word;
@@ -261,25 +262,25 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
 #define CPU_FTRS_7450_20       (CPU_FTR_COMMON | \
            CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
            CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
-           CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
+           CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE | CPU_FTR_NEED_PAIRED_STWCX)
 #define CPU_FTRS_7450_21       (CPU_FTR_COMMON | \
            CPU_FTR_USE_TB | \
            CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
            CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
            CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | \
-           CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
+           CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE | CPU_FTR_NEED_PAIRED_STWCX)
 #define CPU_FTRS_7450_23       (CPU_FTR_COMMON | \
-           CPU_FTR_USE_TB | \
+           CPU_FTR_USE_TB | CPU_FTR_NEED_PAIRED_STWCX | \
            CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
            CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
            CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
 #define CPU_FTRS_7455_1        (CPU_FTR_COMMON | \
-           CPU_FTR_USE_TB | \
+           CPU_FTR_USE_TB | CPU_FTR_NEED_PAIRED_STWCX | \
            CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | \
            CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_HAS_HIGH_BATS | \
            CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
 #define CPU_FTRS_7455_20       (CPU_FTR_COMMON | \
-           CPU_FTR_USE_TB | \
+           CPU_FTR_USE_TB | CPU_FTR_NEED_PAIRED_STWCX | \
            CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
            CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
            CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | \
@@ -289,31 +290,32 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
            CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
            CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
            CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \
-           CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
+           CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE | CPU_FTR_NEED_PAIRED_STWCX)
 #define CPU_FTRS_7447_10       (CPU_FTR_COMMON | \
            CPU_FTR_USE_TB | \
            CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
            CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
            CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \
-           CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC | CPU_FTR_PPC_LE)
+           CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC | CPU_FTR_PPC_LE | \
+           CPU_FTR_NEED_PAIRED_STWCX)
 #define CPU_FTRS_7447  (CPU_FTR_COMMON | \
            CPU_FTR_USE_TB | \
            CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
            CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
            CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \
-           CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
+           CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE | CPU_FTR_NEED_PAIRED_STWCX)
 #define CPU_FTRS_7447A (CPU_FTR_COMMON | \
            CPU_FTR_USE_TB | \
            CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
            CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
            CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \
-           CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
+           CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE | CPU_FTR_NEED_PAIRED_STWCX)
 #define CPU_FTRS_7448  (CPU_FTR_COMMON | \
            CPU_FTR_USE_TB | \
            CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
            CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
            CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \
-           CPU_FTR_PPC_LE)
+           CPU_FTR_PPC_LE | CPU_FTR_NEED_PAIRED_STWCX)
 #define CPU_FTRS_82XX  (CPU_FTR_COMMON | \
            CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB)
 #define CPU_FTRS_G2_LE (CPU_FTR_COMMON | CPU_FTR_MAYBE_CAN_DOZE | \
index 374d0db37e1c1babf0ee08d935d5f3888e443f6c..17110aff26e708c242d9d2fd3855d5d48aea204f 100644 (file)
@@ -6,6 +6,10 @@
 
 #define PPC_MEMSTART   0
 
+#ifdef CONFIG_NOT_COHERENT_CACHE
+#define ARCH_KMALLOC_MINALIGN  L1_CACHE_BYTES
+#endif
+
 #ifndef __ASSEMBLY__
 /*
  * The basic type of a PTE - 64 bits for those CPUs with > 32 bit
index dc318458b5fe528a0642b3f5783fe92239ca2511..d8bdc79db12e2767b1dec66cf74a530975fb8f49 100644 (file)
@@ -246,7 +246,6 @@ static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus)
        return PCI_DN(busdn)->phb;
 }
 
-extern void pcibios_free_controller(struct pci_controller *phb);
 
 extern void isa_bridge_find_early(struct pci_controller *hose);
 
@@ -282,9 +281,11 @@ extern void
 pci_process_bridge_OF_ranges(struct pci_controller *hose,
                           struct device_node *dev, int primary);
 
-/* Allocate a new PCI host bridge structure */
+/* Allocate & free a PCI host bridge structure */
 extern struct pci_controller *
 pcibios_alloc_controller(struct device_node *dev);
+extern void pcibios_free_controller(struct pci_controller *phb);
+
 #ifdef CONFIG_PCI
 extern unsigned long pci_address_to_pio(phys_addr_t address);
 extern int pcibios_vaddr_is_ioport(void __iomem *address);
index 86a54a4a8a2a621beca0bdd096d5291ff0c6255e..fea2d8ff1e7330066837038fec03127c70495058 100644 (file)
 extern unsigned long va_to_phys(unsigned long address);
 extern pte_t *va_to_pte(unsigned long address);
 extern unsigned long ioremap_bot, ioremap_base;
+
+#ifdef CONFIG_44x
+extern int icache_44x_need_flush;
+#endif
+
 #endif /* __ASSEMBLY__ */
 
 /*
@@ -562,6 +567,10 @@ static inline unsigned long pte_update(pte_t *p, unsigned long clr,
        : "=&r" (old), "=&r" (tmp), "=m" (*p)
        : "r" (p), "r" (clr), "r" (set), "m" (*p)
        : "cc" );
+#ifdef CONFIG_44x
+       if ((old & _PAGE_USER) && (old & _PAGE_HWEXEC))
+               icache_44x_need_flush = 1;
+#endif
        return old;
 }
 #else
@@ -582,6 +591,10 @@ static inline unsigned long long pte_update(pte_t *p, unsigned long clr,
        : "=&r" (old), "=&r" (tmp), "=m" (*p)
        : "r" (p), "r" ((unsigned long)(p) + 4), "r" (clr), "r" (set), "m" (*p)
        : "cc" );
+#ifdef CONFIG_44x
+       if ((old & _PAGE_USER) && (old & _PAGE_HWEXEC))
+               icache_44x_need_flush = 1;
+#endif
        return old;
 }
 #endif
index 8eaa7b28d9d07d59ad6d2f0a6cb83187380ec8b3..87db8728e82d196b3ecfc2c73ce6d9a9e6318eb0 100644 (file)
@@ -164,7 +164,8 @@ extern int rtas_call(int token, int, int, int *, ...);
 extern void rtas_restart(char *cmd);
 extern void rtas_power_off(void);
 extern void rtas_halt(void);
-extern void rtas_os_term(char *str);
+extern void rtas_panic_msg(char *str);
+extern void rtas_os_term(void);
 extern int rtas_get_sensor(int sensor, int index, int *state);
 extern int rtas_get_power_level(int powerdomain, int *level);
 extern int rtas_set_power_level(int powerdomain, int level, int *setlevel);
index cc6d8722825882f33ed2cb9d85805bdcd6a7fed7..11d5383b2f09b470d6b374cfa808ef83811970fc 100644 (file)
@@ -308,8 +308,8 @@ COMPAT_SYS_SPU(move_pages)
 SYSCALL_SPU(getcpu)
 COMPAT_SYS(epoll_pwait)
 COMPAT_SYS_SPU(utimensat)
-COMPAT_SYS(fallocate)
 COMPAT_SYS_SPU(signalfd)
 COMPAT_SYS_SPU(timerfd)
 SYSCALL_SPU(eventfd)
 COMPAT_SYS_SPU(sync_file_range2)
+COMPAT_SYS(fallocate)
index f05895522f7f796e8136ea7bc231007c721a39c9..780f82642756cd4dc3e319687f944432cf297f15 100644 (file)
@@ -176,25 +176,31 @@ static inline unsigned int get_dec(void)
 #endif
 }
 
+/*
+ * Note: Book E and 4xx processors differ from other PowerPC processors
+ * in when the decrementer generates its interrupt: on the 1 to 0
+ * transition for Book E/4xx, but on the 0 to -1 transition for others.
+ */
 static inline void set_dec(int val)
 {
 #if defined(CONFIG_40x)
        mtspr(SPRN_PIT, val);
 #elif defined(CONFIG_8xx_CPU6)
-       set_dec_cpu6(val);
+       set_dec_cpu6(val - 1);
 #else
+#ifndef CONFIG_BOOKE
+       --val;
+#endif
 #ifdef CONFIG_PPC_ISERIES
-       int cur_dec;
-
        if (firmware_has_feature(FW_FEATURE_ISERIES) &&
                        get_lppaca()->shared_proc) {
                get_lppaca()->virtual_decr = val;
-               cur_dec = get_dec();
-               if (cur_dec > val)
+               if (get_dec() > val)
                        HvCall_setVirtualDecr();
-       } else
+               return;
+       }
 #endif
-               mtspr(SPRN_DEC, val);
+       mtspr(SPRN_DEC, val);
 #endif /* not 40x or 8xx_CPU6 */
 }
 
index b6b036ccee34f5fd5abbea69c712e4f273219d5a..5c91081476441277c968d0f55067442d4cd20640 100644 (file)
@@ -1,5 +1,6 @@
 #ifndef _ASM_POWERPC_TLBFLUSH_H
 #define _ASM_POWERPC_TLBFLUSH_H
+
 /*
  * TLB flushing:
  *
@@ -16,9 +17,6 @@
  */
 #ifdef __KERNEL__
 
-struct mm_struct;
-struct vm_area_struct;
-
 #if defined(CONFIG_4xx) || defined(CONFIG_8xx) || defined(CONFIG_FSL_BOOKE)
 /*
  * TLB flushing for software loaded TLB chips
@@ -28,7 +26,9 @@ struct vm_area_struct;
  * specific tlbie's
  */
 
-extern void _tlbie(unsigned long address);
+#include <linux/mm.h>
+
+extern void _tlbie(unsigned long address, unsigned int pid);
 
 #if defined(CONFIG_40x) || defined(CONFIG_8xx)
 #define _tlbia()       asm volatile ("tlbia; sync" : : : "memory")
@@ -44,13 +44,13 @@ static inline void flush_tlb_mm(struct mm_struct *mm)
 static inline void flush_tlb_page(struct vm_area_struct *vma,
                                  unsigned long vmaddr)
 {
-       _tlbie(vmaddr);
+       _tlbie(vmaddr, vma ? vma->vm_mm->context.id : 0);
 }
 
 static inline void flush_tlb_page_nohash(struct vm_area_struct *vma,
                                         unsigned long vmaddr)
 {
-       _tlbie(vmaddr);
+       _tlbie(vmaddr, vma ? vma->vm_mm->context.id : 0);
 }
 
 static inline void flush_tlb_range(struct vm_area_struct *vma,
index 8a94f0eba5e98afd1621e6ec9ec17015ceaae64b..f01393224b52dfe66ad88ef3bedad00f49a7fca4 100644 (file)
@@ -77,6 +77,10 @@ struct vdso_data {
        /* those additional ones don't have to be located anywhere
         * special as they were not part of the original systemcfg
         */
+       __u32 dcache_block_size;                /* L1 d-cache block size     */
+       __u32 icache_block_size;                /* L1 i-cache block size     */
+       __u32 dcache_log_block_size;            /* L1 d-cache log block size */
+       __u32 icache_log_block_size;            /* L1 i-cache log block size */
        __s32 wtom_clock_sec;                   /* Wall to monotonic clock */
        __s32 wtom_clock_nsec;
        __u32 syscall_map_64[SYSCALL_MAP_SIZE]; /* map of syscalls  */
@@ -99,6 +103,10 @@ struct vdso_data {
        __s32 wtom_clock_sec;                   /* Wall to monotonic clock */
        __s32 wtom_clock_nsec;
        __u32 syscall_map_32[SYSCALL_MAP_SIZE]; /* map of syscalls */
+       __u32 dcache_block_size;        /* L1 d-cache block size     */
+       __u32 icache_block_size;        /* L1 i-cache block size     */
+       __u32 dcache_log_block_size;    /* L1 d-cache log block size */
+       __u32 icache_log_block_size;    /* L1 i-cache log block size */
 };
 
 #endif /* CONFIG_PPC64 */
index d866d3385556d3f06d00e870b80d5b0e06b209bb..44bda786eef7f11bf86ffc012f661e7c4e545c52 100644 (file)
@@ -388,6 +388,11 @@ extern void (*_machine_power_off)(void);
 
 #define arch_align_stack(x) (x)
 
+#ifdef CONFIG_TRACE_IRQFLAGS
+extern psw_t sysc_restore_trace_psw;
+extern psw_t io_restore_trace_psw;
+#endif
+
 #endif /* __KERNEL__ */
 
 #endif
index 7a18649d1ccb873af58880fdd933f4f21d50469a..01e5cf51ba9b38012469e7ceb0b78ab222e42fe5 100644 (file)
@@ -18,9 +18,8 @@
 #define SH_CACHE_ASSOC         8
 
 #define L1_CACHE_BYTES         (1 << L1_CACHE_SHIFT)
-#define SMP_CACHE_BYTES                L1_CACHE_BYTES
 
-#define L1_CACHE_ALIGN(x)      (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))
+#define __read_mostly __attribute__((__section__(".data.read_mostly")))
 
 #ifndef __ASSEMBLY__
 struct cache_info {
index aa558da084715874d5169f5b3a58863db83849ee..9d528ada3c148615b6e09371aacaced7fdfcc867 100644 (file)
@@ -43,21 +43,31 @@ extern void __flush_purge_region(void *start, int size);
 extern void __flush_invalidate_region(void *start, int size);
 #endif
 
-#define flush_cache_vmap(start, end)           flush_cache_all()
-#define flush_cache_vunmap(start, end)         flush_cache_all()
+#if defined(CONFIG_CPU_SH4) && !defined(CONFIG_CACHE_OFF)
+extern void copy_to_user_page(struct vm_area_struct *vma,
+       struct page *page, unsigned long vaddr, void *dst, const void *src,
+       unsigned long len);
 
-#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
+extern void copy_from_user_page(struct vm_area_struct *vma,
+       struct page *page, unsigned long vaddr, void *dst, const void *src,
+       unsigned long len);
+#else
+#define copy_to_user_page(vma, page, vaddr, dst, src, len)     \
        do {                                                    \
                flush_cache_page(vma, vaddr, page_to_pfn(page));\
                memcpy(dst, src, len);                          \
                flush_icache_user_range(vma, page, vaddr, len); \
        } while (0)
 
-#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
+#define copy_from_user_page(vma, page, vaddr, dst, src, len)   \
        do {                                                    \
                flush_cache_page(vma, vaddr, page_to_pfn(page));\
                memcpy(dst, src, len);                          \
        } while (0)
+#endif
+
+#define flush_cache_vmap(start, end)           flush_cache_all()
+#define flush_cache_vunmap(start, end)         flush_cache_all()
 
 #define HAVE_ARCH_UNMAPPED_AREA
 
index 3880ce047fe0c1b02af1dba8cc1c049c6a99db1b..7b795ac5477cb215fd5958be2bab51f43ad49b7f 100644 (file)
@@ -23,8 +23,7 @@
  * ---------------------------------------------------------------------------
  */
 
-#if  !defined(CONFIG_CPU_SUBTYPE_SH7720) && \
-     !defined(CONFIG_CPU_SUBTYPE_SH7727)
+#if  !defined(CONFIG_CPU_SUBTYPE_SH7720)
 #define TMU_TOCR       0xfffffe90      /* Byte access */
 #endif
 
@@ -58,8 +57,7 @@
 #define TMU2_TCOR      0xfffffeac      /* Long access */
 #define TMU2_TCNT      0xfffffeb0      /* Long access */
 #define TMU2_TCR       0xfffffeb4      /* Word access */
-#if !defined(CONFIG_CPU_SUBTYPE_SH7720) && \
-    !defined(CONFIG_CPU_SUBTYPE_SH7727)
+#if !defined(CONFIG_CPU_SUBTYPE_SH7720)
 #define TMU2_TCPR2     0xfffffeb8      /* Long access */
 #endif
 #endif
index c61d902b8bff118d511d88fe62409a22e835e4ce..11850f65c92216d510f7b242e990ebe33b4a82ff 100644 (file)
@@ -41,7 +41,7 @@ static inline int generic_irq_demux(int irq)
 #define irq_canonicalize(irq)  (irq)
 #define irq_demux(irq)         sh_mv.mv_irq_demux(irq)
 
-#ifdef CONFIG_4KSTACKS
+#ifdef CONFIG_IRQSTACKS
 extern void irq_ctx_init(int cpu);
 extern void irq_ctx_exit(int cpu);
 # define __ARCH_HAS_DO_SOFTIRQ
index cb3d46c59eabe28e627a41d19d00e471ba13454f..d00a8fde7c7f82b965552342cbcef6d05b66bbae 100644 (file)
@@ -73,10 +73,13 @@ extern void copy_page_nommu(void *to, void *from);
 #if !defined(CONFIG_CACHE_OFF) && defined(CONFIG_MMU) && \
        (defined(CONFIG_CPU_SH4) || defined(CONFIG_SH7705_CACHE_32KB))
 struct page;
-extern void clear_user_page(void *to, unsigned long address, struct page *pg);
-extern void copy_user_page(void *to, void *from, unsigned long address, struct page *pg);
-extern void __clear_user_page(void *to, void *orig_to);
-extern void __copy_user_page(void *to, void *from, void *orig_to);
+struct vm_area_struct;
+extern void clear_user_page(void *to, unsigned long address, struct page *page);
+#ifdef CONFIG_CPU_SH4
+extern void copy_user_highpage(struct page *to, struct page *from,
+                              unsigned long vaddr, struct vm_area_struct *vma);
+#define __HAVE_ARCH_COPY_USER_HIGHPAGE
+#endif
 #else
 #define clear_user_page(page, vaddr, pg)       clear_page(page)
 #define copy_user_page(to, from, vaddr, pg)    copy_page(to, from)
@@ -128,7 +131,6 @@ typedef struct { unsigned long pgd; } pgd_t;
 #define __va(x)                        ((void *)((unsigned long)(x)+PAGE_OFFSET))
 #define pfn_to_kaddr(pfn)      __va((pfn) << PAGE_SHIFT)
 
-#define phys_to_page(phys)     (pfn_to_page(phys >> PAGE_SHIFT))
 #define page_to_phys(page)     (page_to_pfn(page) << PAGE_SHIFT)
 
 /* PFN start number, because of __MEMORY_START */
index cf0dd2b648c230c3d2a81e68ee2bdb2969d2d59e..8f1e8be8d15ddf7fc57f1774f6c7454fa5cc1a10 100644 (file)
@@ -322,7 +322,9 @@ extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];
 #define PAGE_KERNEL            __pgprot(0)
 #define PAGE_KERNEL_NOCACHE    __pgprot(0)
 #define PAGE_KERNEL_RO         __pgprot(0)
-#define PAGE_KERNEL_PCC                __pgprot(0)
+
+#define PAGE_KERNEL_PCC(slot, type) \
+                               __pgprot(0)
 #endif
 
 #endif /* __ASSEMBLY__ */
@@ -399,7 +401,7 @@ static inline void set_pte(pte_t *ptep, pte_t pte)
 #define        pmd_bad(x)      (pmd_val(x) & ~PAGE_MASK)
 
 #define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT))
-#define pte_page(x)    phys_to_page(pte_val(x)&PTE_PHYS_MASK)
+#define pte_page(x)    pfn_to_page(pte_pfn(x))
 
 /*
  * The following only work if pte_present() is true.
index 4f2922a1979c5fef654b9444c818123773cd4eab..fda68480f3774973cdc859341be123f4a2ed0260 100644 (file)
@@ -49,7 +49,7 @@ enum cpu_type {
 
        /* SH-4 types */
        CPU_SH7750, CPU_SH7750S, CPU_SH7750R, CPU_SH7751, CPU_SH7751R,
-       CPU_SH7760, CPU_ST40RA, CPU_ST40GX1, CPU_SH4_202, CPU_SH4_501,
+       CPU_SH7760, CPU_SH4_202, CPU_SH4_501,
 
        /* SH-4A types */
        CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785, CPU_SHX3,
@@ -71,7 +71,7 @@ struct sh_cpuinfo {
        struct cache_info scache;       /* Secondary cache */
 
        unsigned long flags;
-} __attribute__ ((aligned(SMP_CACHE_BYTES)));
+} __attribute__ ((aligned(L1_CACHE_BYTES)));
 
 extern struct sh_cpuinfo cpu_data[];
 #define boot_cpu_data cpu_data[0]
index ed358a376e6ea19ab31ef4fc14370dfe0a2003f8..b9789c8b4d15aa817d39913bfd075c265ab7efd1 100644 (file)
@@ -42,9 +42,6 @@
 #define REG_FPSCR      55
 #define REG_FPUL       56
 
-/* options set using PTRACE_SETOPTIONS */
-#define PTRACE_O_TRACESYSGOOD     0x00000001
-
 /*
  * This struct defines the way the registers are stored on the
  * kernel stack during a system call or other kernel entry.
index 586a9711a75dbec4ef86557fef94a71cc26e03ee..55a2bd328d990e24abc3e496641bddfd764eb3a7 100644 (file)
@@ -5,6 +5,20 @@
 
 #ifdef __KERNEL__
 
+/*
+ * This is set up by the setup-routine at boot-time
+ */
+#define PARAM  ((unsigned char *)empty_zero_page)
+
+#define MOUNT_ROOT_RDONLY (*(unsigned long *) (PARAM+0x000))
+#define RAMDISK_FLAGS (*(unsigned long *) (PARAM+0x004))
+#define ORIG_ROOT_DEV (*(unsigned long *) (PARAM+0x008))
+#define LOADER_TYPE (*(unsigned long *) (PARAM+0x00c))
+#define INITRD_START (*(unsigned long *) (PARAM+0x010))
+#define INITRD_SIZE (*(unsigned long *) (PARAM+0x014))
+/* ... */
+#define COMMAND_LINE ((char *) (PARAM+0x100))
+
 int setup_early_printk(char *);
 void sh_mv_setup(void);
 
diff --git a/include/asm-sh/vga.h b/include/asm-sh/vga.h
new file mode 100644 (file)
index 0000000..06a5de8
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef __ASM_SH_VGA_H
+#define __ASM_SH_VGA_H
+
+/* Stupid drivers. */
+
+#endif /* __ASM_SH_VGA_H */
index 1438b763a5ea64b2741d534415d4c5257cbaa05e..18f8dd642ac5282c263de65bf6020f545468bffa 100644 (file)
@@ -42,8 +42,9 @@ static inline void dma_free_coherent(struct device *dev, size_t size,
 static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
                                  enum dma_data_direction dir)
 {
-       unsigned long s = (unsigned long) vaddr & L1_CACHE_ALIGN_MASK;
-       unsigned long e = (vaddr + size) & L1_CACHE_ALIGN_MASK;
+       unsigned long start = (unsigned long) vaddr;
+       unsigned long s = start & L1_CACHE_ALIGN_MASK;
+       unsigned long e = (start + size) & L1_CACHE_ALIGN_MASK;
 
        for (; s <= e; s += L1_CACHE_BYTES)
                asm volatile ("ocbp     %0, 0" : : "r" (s));
index 57a67cf7a5c4e06309e25c2e70569dadb921fd23..18055dbbb4b52dcddb1b81d75fff4654e53e3cd7 100644 (file)
@@ -72,15 +72,6 @@ static inline void pcibios_penalize_isa_irq(int irq, int active)
 #define pci_unmap_len_set(PTR, LEN_NAME, VAL)  do { } while (0)
 #endif
 
-/* These macros should be used after a pci_map_sg call has been done
- * to get bus addresses of each of the SG entries and their lengths.
- * You should only work with the number of sg entries pci_map_sg
- * returns, or alternatively stop on the first sg_dma_len(sg) which
- * is 0.
- */
-#define sg_dma_address(sg)     ((sg)->dma_address)
-#define sg_dma_len(sg)         ((sg)->length)
-
 #ifdef CONFIG_PCI
 static inline void pci_dma_burst_advice(struct pci_dev *pdev,
                                        enum pci_dma_burst_strategy *strat,
index a6d4da519db6238ff250a570ed5eb6285be4b2cc..c424f80e3ae05ad4b3ecc5e2f7dabeafae2acfe7 100644 (file)
@@ -32,6 +32,4 @@ struct pt_regs {
 extern void show_regs(struct pt_regs *);
 #endif
 
-#define PTRACE_O_TRACESYSGOOD     0x00000001
-
 #endif /* __ASM_SH64_PTRACE_H */
index 5109251970e7ca96fde9b68e6cc66d74662e1f72..7f729bbfce43bdaa83f36b6cc931ab551809b8f4 100644 (file)
@@ -23,6 +23,15 @@ struct scatterlist {
     unsigned int length;
 };
 
+/* These macros should be used after a pci_map_sg call has been done
+ * to get bus addresses of each of the SG entries and their lengths.
+ * You should only work with the number of sg entries pci_map_sg
+ * returns, or alternatively stop on the first sg_dma_len(sg) which
+ * is 0.
+ */
+#define sg_dma_address(sg)     ((sg)->dma_address)
+#define sg_dma_len(sg)         ((sg)->length)
+
 #define ISA_DMA_THRESHOLD (0xffffffff)
 
 #endif /* !__ASM_SH64_SCATTERLIST_H */
index 876312fe82ccf9dbf894a100a26978a5f8267f10..df1097d6ffbe63258dc566924cedb9e393438d5f 100644 (file)
@@ -17,7 +17,8 @@
        "3:\n"                                          \
        "       .section .fixup,#alloc,#execinstr\n"    \
        "       .align  4\n"                            \
-       "4:     ba      3b\n"                           \
+       "4:     sethi   %%hi(3b), %0\n"                 \
+       "       jmpl    %0 + %%lo(3b), %%g0\n"          \
        "        mov    %5, %0\n"                       \
        "       .previous\n"                            \
        "       .section __ex_table,\"a\"\n"            \
@@ -91,7 +92,8 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
        "2:\n"
        "       .section .fixup,#alloc,#execinstr\n"
        "       .align  4\n"
-       "3:     ba      2b\n"
+       "3:     sethi   %%hi(2b), %0\n"
+       "       jmpl    %0 + %%lo(2b), %%g0\n"
        "        mov    %4, %0\n"
        "       .previous\n"
        "       .section __ex_table,\"a\"\n"
index 159e62b51d705055b7b975ab4a4f68f21c6e429a..99a669c190c776a030ddc2be595693982a1c3fe0 100644 (file)
@@ -178,7 +178,9 @@ do {        if (test_thread_flag(TIF_PERFCTR)) {                            \
        "ldx    [%%g6 + %9], %%g4\n\t"                                  \
        "brz,pt %%o7, 1f\n\t"                                           \
        " mov   %%g7, %0\n\t"                                           \
-       "b,a ret_from_syscall\n\t"                                      \
+       "sethi  %%hi(ret_from_syscall), %%g1\n\t"                       \
+       "jmpl   %%g1 + %%lo(ret_from_syscall), %%g0\n\t"                \
+       " nop\n\t"                                                      \
        "1:\n\t"                                                        \
        : "=&r" (last), "=r" (current), "=r" (current_thread_info_reg), \
          "=r" (__local_per_cpu_offset)                                 \
index afe236ba555b97527f197079ec213e0c38ee6307..93720e7b0289250267dbc461b1defb9d4160e6e5 100644 (file)
@@ -123,7 +123,8 @@ __asm__ __volatile__(                                                       \
        ".section .fixup,#alloc,#execinstr\n\t"                         \
        ".align 4\n"                                                    \
 "3:\n\t"                                                               \
-       "b      2b\n\t"                                                 \
+       "sethi  %%hi(2b), %0\n\t"                                       \
+       "jmpl   %0 + %%lo(2b), %%g0\n\t"                                \
        " mov   %3, %0\n\n\t"                                           \
        ".previous\n\t"                                                 \
        ".section __ex_table,\"a\"\n\t"                                 \
@@ -165,8 +166,9 @@ __asm__ __volatile__(                                                       \
        ".section .fixup,#alloc,#execinstr\n\t"                         \
        ".align 4\n"                                                    \
 "3:\n\t"                                                               \
+       "sethi  %%hi(2b), %0\n\t"                                       \
        "clr    %1\n\t"                                                 \
-       "b      2b\n\t"                                                 \
+       "jmpl   %0 + %%lo(2b), %%g0\n\t"                                \
        " mov   %3, %0\n\n\t"                                           \
        ".previous\n\t"                                                 \
        ".section __ex_table,\"a\"\n\t"                                 \
index f7417e91b1706bb79c438446b8b941e5ddb7c9ef..d4de32f0f8afdb849495f29aff26f3c0f004f7d3 100644 (file)
@@ -8,6 +8,7 @@
 #include <linux/spinlock.h>
 #include <linux/completion.h>
 #include <linux/list.h>
+#include <linux/log2.h>
 
 #include <asm/ldc.h>
 #include <asm/mdesc.h>
@@ -257,8 +258,7 @@ static inline void *vio_dring_entry(struct vio_dring_state *dr,
 static inline u32 vio_dring_avail(struct vio_dring_state *dr,
                                  unsigned int ring_size)
 {
-       /* Ensure build-time power-of-2.  */
-       BUILD_BUG_ON(ring_size & (ring_size - 1));
+       BUILD_BUG_ON(!is_power_of_2(ring_size));
 
        return (dr->pending -
                ((dr->prod - dr->cons) & (ring_size - 1)));
index aa82b88db805bafd93224590924a3883084e05ef..3ebafbaacb24196d82eb5521f4c17292c0a850e7 100644 (file)
@@ -71,7 +71,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
 
 static inline void pud_clear (pud_t *pud)
 {
-        set_pud(pud, __pud(0));
+       set_pud(pud, __pud(_PAGE_NEWPAGE));
 }
 
 #define pud_page(pud) phys_to_page(pud_val(pud) & PAGE_MASK)
index 732c83f04c3d29d71071b80a1061542db3023d22..38bd9d94ee4647dcddee216875f9e5b4a51907a7 100644 (file)
@@ -14,7 +14,6 @@ extern int um_execve(const char *file, char *const argv[], char *const env[]);
 
 #ifdef __KERNEL__
 /* We get __ARCH_WANT_OLD_STAT and __ARCH_WANT_STAT64 from the base arch */
-#define __ARCH_WANT_IPC_PARSE_VERSION
 #define __ARCH_WANT_OLD_READDIR
 #define __ARCH_WANT_SYS_ALARM
 #define __ARCH_WANT_SYS_GETHOSTNAME
index 0693689d4146bdb1be887638a8c6ade246843e35..f8a89793ac8cbb865dbedb2b70181236d2a4288d 100644 (file)
@@ -1,5 +1,32 @@
+#ifndef _ASM_X86_ACPI_H
+#define _ASM_X86_ACPI_H
+
 #ifdef CONFIG_X86_32
 # include "acpi_32.h"
 #else
 # include "acpi_64.h"
 #endif
+
+#include <asm/processor.h>
+
+/*
+ * Check if the CPU can handle C2 and deeper
+ */
+static inline unsigned int acpi_processor_cstate_check(unsigned int max_cstate)
+{
+       /*
+        * Early models (<=5) of AMD Opterons are not supposed to go into
+        * C2 state.
+        *
+        * Steppings 0x0A and later are good
+        */
+       if (boot_cpu_data.x86 == 0x0F &&
+           boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
+           boot_cpu_data.x86_model <= 0x05 &&
+           boot_cpu_data.x86_mask < 0x0A)
+               return 1;
+       else
+               return max_cstate;
+}
+
+#endif
index 4091b33dcb10f28cfbd1ae1013b3477e2512e742..be158b27d54b38854f8c63d713daa83fbdaa3954 100644 (file)
@@ -120,6 +120,7 @@ extern int local_apic_timer_disabled;
 
 #else /* !CONFIG_X86_LOCAL_APIC */
 static inline void lapic_shutdown(void) { }
+#define local_apic_timer_c2_ok         1
 
 #endif /* !CONFIG_X86_LOCAL_APIC */
 
diff --git a/include/asm-x86/gart.h b/include/asm-x86/gart.h
new file mode 100644 (file)
index 0000000..f704c50
--- /dev/null
@@ -0,0 +1,29 @@
+#ifndef _ASM_X8664_IOMMU_H
+#define _ASM_X8664_IOMMU_H 1
+
+extern void pci_iommu_shutdown(void);
+extern void no_iommu_init(void);
+extern int force_iommu, no_iommu;
+extern int iommu_detected;
+#ifdef CONFIG_GART_IOMMU
+extern void gart_iommu_init(void);
+extern void gart_iommu_shutdown(void);
+extern void __init gart_parse_options(char *);
+extern void gart_iommu_hole_init(void);
+extern int fallback_aper_order;
+extern int fallback_aper_force;
+extern int gart_iommu_aperture;
+extern int gart_iommu_aperture_allowed;
+extern int gart_iommu_aperture_disabled;
+extern int fix_aperture;
+#else
+#define gart_iommu_aperture 0
+#define gart_iommu_aperture_allowed 0
+
+static inline void gart_iommu_shutdown(void)
+{
+}
+
+#endif
+
+#endif
index 0217b74cc9fc0cd30456d40929e6196229680178..3a4ffba3d6bcf2c30bbad9e6cd7f87cce8a165ba 100644 (file)
@@ -203,6 +203,11 @@ static inline void save_init_fpu(struct task_struct *tsk)
  */
 static inline int restore_i387(struct _fpstate __user *buf)
 {
+       set_used_math();
+       if (!(task_thread_info(current)->status & TS_USEDFPU)) {
+               clts();
+               task_thread_info(current)->status |= TS_USEDFPU;
+       }
        return restore_fpu_checking((__force struct i387_fxsave_struct *)buf);
 }
 
index 5af471f228eeacad86659cbda4ce60c3fadf8054..07862fdd23c0e195f76cfb3753d136296c2371cd 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _ASM_X8664_IOMMU_H
-#define _ASM_X8664_IOMMU_H 1
+#ifndef _ASM_X8664_GART_H
+#define _ASM_X8664_GART_H 1
 
 extern void pci_iommu_shutdown(void);
 extern void no_iommu_init(void);
index d058b04e0083a2e1aa02f59b6ea6c42987188f8a..4c7720089cb5cd68d1d26af4171dcf6f1518226a 100644 (file)
@@ -129,6 +129,27 @@ static inline int raw_irqs_disabled(void)
 
        return raw_irqs_disabled_flags(flags);
 }
+
+/*
+ * makes the traced hardirq state match with the machine state
+ *
+ * should be a rarely used function, only in places where its
+ * otherwise impossible to know the irq state, like in traps.
+ */
+static inline void trace_hardirqs_fixup_flags(unsigned long flags)
+{
+       if (raw_irqs_disabled_flags(flags))
+               trace_hardirqs_off();
+       else
+               trace_hardirqs_on();
+}
+
+static inline void trace_hardirqs_fixup(void)
+{
+       unsigned long flags = __raw_local_save_flags();
+
+       trace_hardirqs_fixup_flags(flags);
+}
 #endif /* __ASSEMBLY__ */
 
 /*
index 5341ea1f815ac1728dd9dab6e06f068ebfa5bdea..bb9163bb29d1d914651ac672e062b5229a31be6d 100644 (file)
@@ -111,6 +111,26 @@ static inline int raw_irqs_disabled(void)
        return raw_irqs_disabled_flags(flags);
 }
 
+/*
+ * makes the traced hardirq state match with the machine state
+ *
+ * should be a rarely used function, only in places where its
+ * otherwise impossible to know the irq state, like in traps.
+ */
+static inline void trace_hardirqs_fixup_flags(unsigned long flags)
+{
+       if (raw_irqs_disabled_flags(flags))
+               trace_hardirqs_off();
+       else
+               trace_hardirqs_on();
+}
+
+static inline void trace_hardirqs_fixup(void)
+{
+       unsigned long flags = __raw_local_save_flags();
+
+       trace_hardirqs_fixup_flags(flags);
+}
 /*
  * Used in the idle loop; sti takes one instruction cycle
  * to complete:
index 9c5092b6aa9f294028cfe0e18189f91764e061e7..2091779e91fbe4f06b659235dc9e8abe2c09922c 100644 (file)
@@ -54,9 +54,6 @@ hcall(unsigned long call,
 }
 /*:*/
 
-void async_hcall(unsigned long call,
-                unsigned long arg1, unsigned long arg2, unsigned long arg3);
-
 /* Can't use our min() macro here: needs to be a constant */
 #define LGUEST_IRQS (NR_IRQS < 32 ? NR_IRQS: 32)
 
index e23fd9fbebb3a5b024a9c8c2e155ea02ae51c8a9..6adee6a97dec4f462776a59c2259842a4cfc7c71 100644 (file)
@@ -49,7 +49,7 @@ static inline void mach_reboot(void)
                udelay(50);
                kb_wait();
                udelay(50);
-               outb(cmd | 0x04, 0x60); /* set "System flag" */
+               outb(cmd | 0x14, 0x60); /* set "System flag" and "Keyboard Disabled" */
                udelay(50);
                kb_wait();
                udelay(50);
index 8aa10547b4b1e9aed60bc91223fc86ccf035a9aa..52ee75cd0fe175067d5bbe35af64d3f1801296c2 100644 (file)
@@ -29,9 +29,9 @@ extern int mps_oem_check(struct mp_config_table *mpc, char *oem,
 static inline int es7000_check_dsdt(void)
 {
        struct acpi_table_header header;
-       memcpy(&header, 0, sizeof(struct acpi_table_header));
-       acpi_get_table_header(ACPI_SIG_DSDT, 0, &header);
-       if (!strncmp(header.oem_id, "UNISYS", 6))
+
+       if (ACPI_SUCCESS(acpi_get_table_header(ACPI_SIG_DSDT, 0, &header)) &&
+           !strncmp(header.oem_id, "UNISYS", 6))
                return 1;
        return 0;
 }
index 84d01ad334593a99083ec0dcc96873b10e3c611e..71729ca05cd738308eabc7f61ba6cb94dff94554 100644 (file)
@@ -1,5 +1,7 @@
 #include <asm/voyager.h>
-#define VOYAGER_BIOS_INFO ((struct voyager_bios_info *)(PARAM+0x40))
+#include <asm/setup.h>
+#define VOYAGER_BIOS_INFO ((struct voyager_bios_info *) \
+                       (&boot_params.apm_bios_info))
 
 /* Hook to call BIOS initialisation function */
 
index 9baa46d9f594893a011b9e803566e17f2ac3f150..ef54226a9325a926a1c482ee7ce03d1410478f7b 100644 (file)
@@ -37,7 +37,7 @@ extern int iommu_setup(char *opt);
  */
 #define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys)
 
-#if defined(CONFIG_IOMMU) || defined(CONFIG_CALGARY_IOMMU)
+#if defined(CONFIG_GART_IOMMU) || defined(CONFIG_CALGARY_IOMMU)
 
 #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)      \
        dma_addr_t ADDR_NAME;
index 213c97300cb3fd90842da2e61de07ba9a22227cc..51ddb2590870f96d0e6f0b373cd7a91e22b61d49 100644 (file)
@@ -60,7 +60,7 @@ static inline int v8086_mode(struct pt_regs *regs)
 
 #define instruction_pointer(regs) ((regs)->eip)
 #define frame_pointer(regs) ((regs)->ebp)
-#define stack_pointer(regs) ((regs)->esp)
+#define stack_pointer(regs) ((unsigned long)(regs))
 #define regs_return_value(regs) ((regs)->eax)
 
 extern unsigned long profile_pc(struct pt_regs *regs);
index 7056d86845221c6d224545f7c8642a35c7cd028f..e10b7affdfe5097e496412c5bd6ea768b3c0f245 100644 (file)
@@ -94,9 +94,12 @@ static inline void smp_send_reschedule(int cpu)
 {
        smp_ops.smp_send_reschedule(cpu);
 }
-extern int smp_call_function_mask(cpumask_t mask,
-                                 void (*func) (void *info), void *info,
-                                 int wait);
+static inline int smp_call_function_mask(cpumask_t mask,
+                                        void (*func) (void *info), void *info,
+                                        int wait)
+{
+       return smp_ops.smp_call_function_mask(mask, func, info, wait);
+}
 
 void native_smp_prepare_boot_cpu(void);
 void native_smp_prepare_cpus(unsigned int max_cpus);
index 6a65231bc7855a8fc918ab22bcd3402cff3df218..37bfa19d8064857897c1144101da3b2e9b44f198 100644 (file)
@@ -149,6 +149,7 @@ header-y += ticable.h
 header-y += times.h
 header-y += tiocl.h
 header-y += tipc.h
+header-y += tipc_config.h
 header-y += toshiba.h
 header-y += ultrasound.h
 header-y += un.h
@@ -325,6 +326,7 @@ unifdef-y += sonypi.h
 unifdef-y += soundcard.h
 unifdef-y += stat.h
 unifdef-y += stddef.h
+unifdef-y += string.h
 unifdef-y += synclink.h
 unifdef-y += sysctl.h
 unifdef-y += tcp.h
index 8ccedf7a0a5af4ce4679294bfacb44f597eebb73..e3c16c981e4627beca2b3bd2240d51e67b64918a 100644 (file)
@@ -132,6 +132,11 @@ extern unsigned long acpi_realmode_flags;
 int acpi_register_gsi (u32 gsi, int triggering, int polarity);
 int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
 
+#ifdef CONFIG_X86_IO_APIC
+extern int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity);
+#else
+#define acpi_get_override_irq(bus, trigger, polarity) (-1)
+#endif
 /*
  * This function undoes the effect of one call to acpi_register_gsi().
  * If this matches the last registration, any IRQ resources for gsi
index 8263a7b74d34c63bdb88851518638ad2b65c5c54..5c4e54a2a8d65361aaf7ff9ee691baab67cb642e 100644 (file)
@@ -43,6 +43,7 @@ enum {
        ATA_MAX_SECTORS_128     = 128,
        ATA_MAX_SECTORS         = 256,
        ATA_MAX_SECTORS_LBA48   = 65535,/* TODO: 65536? */
+       ATA_MAX_SECTORS_TAPE    = 65535,
 
        ATA_ID_WORDS            = 256,
        ATA_ID_SERNO            = 10,
@@ -180,6 +181,7 @@ enum {
        ATA_CMD_VERIFY_EXT      = 0x42,
        ATA_CMD_STANDBYNOW1     = 0xE0,
        ATA_CMD_IDLEIMMEDIATE   = 0xE1,
+       ATA_CMD_SLEEP           = 0xE6,
        ATA_CMD_INIT_DEV_PARAMS = 0x91,
        ATA_CMD_READ_NATIVE_MAX = 0xF8,
        ATA_CMD_READ_NATIVE_MAX_EXT = 0x27,
@@ -235,6 +237,7 @@ enum {
 
        /* SETFEATURE Sector counts for SATA features */
        SATA_AN                 = 0x05,  /* Asynchronous Notification */
+       SATA_DIPM               = 0x03,  /* Device Initiated Power Management */
 
        /* ATAPI stuff */
        ATAPI_PKT_DMA           = (1 << 0),
@@ -377,6 +380,26 @@ struct ata_taskfile {
 
 #define ata_id_cdb_intr(id)    (((id)[0] & 0x60) == 0x20)
 
+static inline bool ata_id_has_hipm(const u16 *id)
+{
+       u16 val = id[76];
+
+       if (val == 0 || val == 0xffff)
+               return false;
+
+       return val & (1 << 9);
+}
+
+static inline bool ata_id_has_dipm(const u16 *id)
+{
+       u16 val = id[78];
+
+       if (val == 0 || val == 0xffff)
+               return false;
+
+       return val & (1 << 3);
+}
+
 static inline int ata_id_has_fua(const u16 *id)
 {
        if ((id[84] & 0xC000) != 0x4000)
@@ -402,6 +425,8 @@ static inline int ata_id_has_lba48(const u16 *id)
 {
        if ((id[83] & 0xC000) != 0x4000)
                return 0;
+       if (!ata_id_u64(id, 100))
+               return 0;
        return id[83] & (1 << 10);
 }
 
@@ -512,6 +537,15 @@ static inline int ata_drive_40wire(const u16 *dev_id)
        return 1;
 }
 
+static inline int ata_drive_40wire_relaxed(const u16 *dev_id)
+{
+       if (ata_id_is_sata(dev_id))
+               return 0;       /* SATA */
+       if ((dev_id[93] & 0x2000) == 0x2000)
+               return 0;       /* 80 wire */
+       return 1;
+}
+
 static inline int atapi_cdb_len(const u16 *dev_id)
 {
        u16 tmp = dev_id[0] & 0x3;
@@ -522,6 +556,11 @@ static inline int atapi_cdb_len(const u16 *dev_id)
        }
 }
 
+static inline int atapi_command_packet_set(const u16 *dev_id)
+{
+       return (dev_id[0] >> 8) & 0x1f;
+}
+
 static inline int is_atapi_taskfile(const struct ata_taskfile *tf)
 {
        return (tf->protocol == ATA_PROT_ATAPI) ||
index bbf906a0b419f95d536a9fae2d325ec04c2f5944..d18ee67b40f8198118e93336aee272324d9c30db 100644 (file)
@@ -341,7 +341,6 @@ enum blk_queue_state {
 struct blk_queue_tag {
        struct request **tag_index;     /* map of busy tags */
        unsigned long *tag_map;         /* bit map of free/busy tags */
-       struct list_head busy_list;     /* fifo list of busy tags */
        int busy;                       /* current depth */
        int max_depth;                  /* what we will send to device */
        int real_max_depth;             /* what the array can hold */
@@ -435,6 +434,7 @@ struct request_queue
        unsigned int            dma_alignment;
 
        struct blk_queue_tag    *queue_tags;
+       struct list_head        tag_busy_list;
 
        unsigned int            nr_sorted;
        unsigned int            in_flight;
@@ -697,6 +697,7 @@ extern int blk_execute_rq(struct request_queue *, struct gendisk *,
 extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *,
                                  struct request *, int, rq_end_io_fn *);
 extern int blk_verify_command(unsigned char *, int);
+extern void blk_unplug(struct request_queue *q);
 
 static inline struct request_queue *bdev_get_queue(struct block_device *bdev)
 {
index c83534ee1e796c46b2cc47c129ad3924cedbeb20..0365ec9fc0c9248422801fe71b232d1188a12972 100644 (file)
@@ -59,7 +59,6 @@ extern void *__alloc_bootmem_core(struct bootmem_data *bdata,
                                  unsigned long align,
                                  unsigned long goal,
                                  unsigned long limit);
-extern void *alloc_bootmem_high_node(pg_data_t *pgdat, unsigned long size);
 
 #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE
 extern void reserve_bootmem(unsigned long addr, unsigned long size);
index 0b9bfbde81686cc1ef6854ce429672ef5b85855c..d62fcee9a08aa8b620436047fadb679f84095b04 100644 (file)
@@ -13,12 +13,6 @@ SUBSYS(cpuset)
 
 /* */
 
-#ifdef CONFIG_CGROUP_CPUACCT
-SUBSYS(cpuacct)
-#endif
-
-/* */
-
 #ifdef CONFIG_CGROUP_DEBUG
 SUBSYS(debug)
 #endif
diff --git a/include/linux/cpu_acct.h b/include/linux/cpu_acct.h
deleted file mode 100644 (file)
index 6b5fd8a..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-
-#ifndef _LINUX_CPU_ACCT_H
-#define _LINUX_CPU_ACCT_H
-
-#include <linux/cgroup.h>
-#include <asm/cputime.h>
-
-#ifdef CONFIG_CGROUP_CPUACCT
-extern void cpuacct_charge(struct task_struct *, cputime_t cputime);
-#else
-static void inline cpuacct_charge(struct task_struct *p, cputime_t cputime) {}
-#endif
-
-#endif
index 16a51546db444f9cbbbc0d845b312621eec0ae44..c4e00161a247975aca754484ecb5f232d1ff4f08 100644 (file)
@@ -92,6 +92,7 @@ struct cpuidle_device {
        struct kobject          kobj;
        struct completion       kobj_unregister;
        void                    *governor_data;
+       struct cpuidle_state    *safe_state;
 };
 
 DECLARE_PER_CPU(struct cpuidle_device *, cpuidle_devices);
index 37c66d1254b5383795f3f559a7a232325dd16c13..b8b7c51389fe0ecff2608f63b928140601347a3f 100644 (file)
@@ -116,6 +116,7 @@ struct io_restrictions {
        unsigned short          hardsect_size;
        unsigned int            max_segment_size;
        unsigned long           seg_boundary_mask;
+       unsigned long           bounce_pfn;
        unsigned char           no_cluster; /* inverted so that 0 is default */
 };
 
index d2a96cbf4f0eeac7b9d01ae11a7553a3be4f0d92..cf79853967ffb25b839e7c77c3bf8ef9956d95e8 100644 (file)
  * On x86-64 make the 64bit structure have the same alignment as the
  * 32bit structure. This makes 32bit emulation easier.
  *
- * UML/x86_64 needs the same packing as x86_64 - UML + UML_X86 +
- * 64_BIT adds up to UML/x86_64.
+ * UML/x86_64 needs the same packing as x86_64
  */
 #ifdef __x86_64__
 #define EPOLL_PACKED __attribute__((packed))
 #else
-#if defined(CONFIG_UML) && defined(CONFIG_UML_X86) && defined(CONFIG_64BIT)
-#define EPOLL_PACKED __attribute__((packed))
-#else
 #define EPOLL_PACKED
 #endif
-#endif
 
 struct epoll_event {
        __u32 events;
index 64134456ed8cf33782e3d4a83757f4c46515f644..241c01cb92b24e64027c11341475c030a2a825d3 100644 (file)
@@ -656,6 +656,26 @@ struct ext3_dir_entry_2 {
 #define EXT3_DIR_ROUND                 (EXT3_DIR_PAD - 1)
 #define EXT3_DIR_REC_LEN(name_len)     (((name_len) + 8 + EXT3_DIR_ROUND) & \
                                         ~EXT3_DIR_ROUND)
+#define EXT3_MAX_REC_LEN               ((1<<16)-1)
+
+static inline unsigned ext3_rec_len_from_disk(__le16 dlen)
+{
+       unsigned len = le16_to_cpu(dlen);
+
+       if (len == EXT3_MAX_REC_LEN)
+               return 1 << 16;
+       return len;
+}
+
+static inline __le16 ext3_rec_len_to_disk(unsigned len)
+{
+       if (len == (1 << 16))
+               return cpu_to_le16(EXT3_MAX_REC_LEN);
+       else if (len > (1 << 16))
+               BUG();
+       return cpu_to_le16(len);
+}
+
 /*
  * Hash Tree Directory indexing
  * (c) Daniel Phillips, 2001
diff --git a/include/linux/f75375s.h b/include/linux/f75375s.h
new file mode 100644 (file)
index 0000000..e99e225
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * f75375s.h - platform data structure for f75375s sensor
+ *
+ * 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) 2007, Riku Voipio <riku.voipio@iki.fi>
+ */
+
+#ifndef __LINUX_F75375S_H
+#define __LINUX_F75375S_H
+
+/* We want to set fans spinning on systems where there is no
+ * BIOS to do that for us */
+struct f75375s_platform_data {
+       u8 pwm[2];
+       u8 pwm_enable[2];
+};
+
+#endif /* __LINUX_F75375S_H */
index 99650353adfaeb5f1d0b195770faaa5469548cf9..92d420fe03f8173d072b1d8d03a7c51fdcef2125 100644 (file)
@@ -149,10 +149,6 @@ union futex_key {
                int offset;
        } both;
 };
-int get_futex_key(u32 __user *uaddr, struct rw_semaphore *shared,
-                 union futex_key *key);
-void get_futex_key_refs(union futex_key *key);
-void drop_futex_key_refs(union futex_key *key);
 
 #ifdef CONFIG_FUTEX
 extern void exit_robust_list(struct task_struct *curr);
index ea0f50bfbe030dda0ff6d5b1ea22b5f346302279..24968790bc3e3c451f178a1605e9eecb01acf918 100644 (file)
@@ -19,7 +19,7 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
 int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *);
 int hugetlb_treat_movable_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *);
 int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *);
-int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int);
+int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int, int);
 void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long);
 void __unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long);
 int hugetlb_prefault(struct address_space *, struct vm_area_struct *);
@@ -106,7 +106,7 @@ static inline unsigned long hugetlb_total_pages(void)
        return 0;
 }
 
-#define follow_hugetlb_page(m,v,p,vs,a,b,i)    ({ BUG(); 0; })
+#define follow_hugetlb_page(m,v,p,vs,a,b,i,w)  ({ BUG(); 0; })
 #define follow_huge_addr(mm, addr, write)      ERR_PTR(-EINVAL)
 #define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; })
 #define hugetlb_prefault(mapping, vma)         ({ BUG(); 0; })
@@ -165,8 +165,10 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb)
 extern const struct file_operations hugetlbfs_file_operations;
 extern struct vm_operations_struct hugetlb_vm_ops;
 struct file *hugetlb_file_setup(const char *name, size_t);
-int hugetlb_get_quota(struct address_space *mapping);
-void hugetlb_put_quota(struct address_space *mapping);
+int hugetlb_get_quota(struct address_space *mapping, long delta);
+void hugetlb_put_quota(struct address_space *mapping, long delta);
+
+#define BLOCKS_PER_HUGEPAGE    (HPAGE_SIZE / 512)
 
 static inline int is_file_hugepages(struct file *file)
 {
index 8033e6b33271d0fdc07088d1c10d3bf27df1d4ae..a100c9f8eb7c7645eaf7eb5cb3681e69567d2431 100644 (file)
@@ -400,11 +400,6 @@ extern int i2c_release_client(struct i2c_client *);
 extern void i2c_clients_command(struct i2c_adapter *adap,
                                unsigned int cmd, void *arg);
 
-/* returns -EBUSY if address has been taken, 0 if not. Note that the only
-   other place at which this is called is within i2c_attach_client; so
-   you can cheat by simply not registering. Not recommended, of course! */
-extern int i2c_check_addr (struct i2c_adapter *adapter, int addr);
-
 /* Detect function. It iterates over all possible addresses itself.
  * It will only call found_proc if some client is connected at the
  * specific address (unless a 'force' matched);
index 4ed4777bba67abcd5ecba17bb3c8c2ca19e999f9..dc75ccbcf9912684094e88afa733b63eb7255259 100644 (file)
@@ -1031,14 +1031,7 @@ ide_startstop_t __ide_abort(ide_drive_t *, struct request *);
 extern ide_startstop_t ide_abort(ide_drive_t *, const char *);
 
 extern void ide_fix_driveid(struct hd_driveid *);
-/*
- * ide_fixstring() cleans up and (optionally) byte-swaps a text string,
- * removing leading/trailing blanks and compressing internal blanks.
- * It is primarily used to tidy up the model name/number fields as
- * returned by the WIN_[P]IDENTIFY commands.
- *
- * (s, bytecount, byteswap)
- */
+
 extern void ide_fixstring(u8 *, const int, const int);
 
 int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long);
index 56ae438ae5105033b55a9576cb77d3f291cd9f40..6e8cec50338000c31748bd1a8e5d4b28e26820cf 100644 (file)
@@ -173,7 +173,7 @@ static inline int ipmi_demangle_device_id(const unsigned char *data,
        id->firmware_revision_2 = data[3];
        id->ipmi_version = data[4];
        id->additional_device_support = data[5];
-       if (data_len >= 6) {
+       if (data_len >= 11) {
                id->manufacturer_id = (data[6] | (data[7] << 8) |
                                       (data[8] << 16));
                id->product_id = data[9] | (data[10] << 8);
index f73de6fb5c682a7b2f97a599b50792dbfb6c608a..82de2fb62cb71677cfbd876e34189b2b7b002779 100644 (file)
@@ -6,6 +6,7 @@
 #define _LINUX_KALLSYMS_H
 
 #include <linux/errno.h>
+#include <linux/stddef.h>
 
 #define KSYM_NAME_LEN 128
 #define KSYM_SYMBOL_LEN (sizeof("%s+%#lx/%#lx [%s]") + (KSYM_NAME_LEN - 1) + \
index 6fd24e03622ecd915a6a4160cfb400e1445c1d15..ef52a07c43d8da63eba34a0dd571dc90c8d3310e 100644 (file)
@@ -133,11 +133,14 @@ enum {
        ATA_DFLAG_ACPI_PENDING  = (1 << 5), /* ACPI resume action pending */
        ATA_DFLAG_ACPI_FAILED   = (1 << 6), /* ACPI on devcfg has failed */
        ATA_DFLAG_AN            = (1 << 7), /* AN configured */
+       ATA_DFLAG_HIPM          = (1 << 8), /* device supports HIPM */
+       ATA_DFLAG_DIPM          = (1 << 9), /* device supports DIPM */
        ATA_DFLAG_CFG_MASK      = (1 << 12) - 1,
 
        ATA_DFLAG_PIO           = (1 << 12), /* device limited to PIO mode */
        ATA_DFLAG_NCQ_OFF       = (1 << 13), /* device limited to non-NCQ mode */
        ATA_DFLAG_SPUNDOWN      = (1 << 14), /* XXX: for spindown_compat */
+       ATA_DFLAG_SLEEPING      = (1 << 15), /* device is sleeping */
        ATA_DFLAG_INIT_MASK     = (1 << 16) - 1,
 
        ATA_DFLAG_DETACH        = (1 << 16),
@@ -185,6 +188,7 @@ enum {
        ATA_FLAG_ACPI_SATA      = (1 << 17), /* need native SATA ACPI layout */
        ATA_FLAG_AN             = (1 << 18), /* controller supports AN */
        ATA_FLAG_PMP            = (1 << 19), /* controller supports PMP */
+       ATA_FLAG_IPM            = (1 << 20), /* driver can handle IPM */
 
        /* The following flag belongs to ap->pflags but is kept in
         * ap->flags because it's referenced in many LLDs and will be
@@ -217,6 +221,7 @@ enum {
        ATA_QCFLAG_IO           = (1 << 3), /* standard IO command */
        ATA_QCFLAG_RESULT_TF    = (1 << 4), /* result TF requested */
        ATA_QCFLAG_CLEAR_EXCL   = (1 << 5), /* clear excl_link on completion */
+       ATA_QCFLAG_QUIET        = (1 << 6), /* don't report device error */
 
        ATA_QCFLAG_FAILED       = (1 << 16), /* cmd failed and is owned by EH */
        ATA_QCFLAG_SENSE_VALID  = (1 << 17), /* sense data valid */
@@ -234,6 +239,13 @@ enum {
        ATA_TMOUT_INTERNAL      = 30 * HZ,
        ATA_TMOUT_INTERNAL_QUICK = 5 * HZ,
 
+       /* FIXME: GoVault needs 2s but we can't afford that without
+        * parallel probing.  800ms is enough for iVDR disk
+        * HHD424020F7SV00.  Increase to 2secs when parallel probing
+        * is in place.
+        */
+       ATA_TMOUT_FF_WAIT       = 4 * HZ / 5,
+
        /* ATA bus states */
        BUS_UNKNOWN             = 0,
        BUS_DMA                 = 1,
@@ -294,6 +306,7 @@ enum {
        ATA_EHI_RESUME_LINK     = (1 << 1),  /* resume link (reset modifier) */
        ATA_EHI_NO_AUTOPSY      = (1 << 2),  /* no autopsy */
        ATA_EHI_QUIET           = (1 << 3),  /* be quiet */
+       ATA_EHI_LPM             = (1 << 4),  /* link power management action */
 
        ATA_EHI_DID_SOFTRESET   = (1 << 16), /* already soft-reset this port */
        ATA_EHI_DID_HARDRESET   = (1 << 17), /* already soft-reset this port */
@@ -325,6 +338,9 @@ enum {
        ATA_HORKAGE_BROKEN_HPA  = (1 << 4),     /* Broken HPA */
        ATA_HORKAGE_SKIP_PM     = (1 << 5),     /* Skip PM operations */
        ATA_HORKAGE_HPA_SIZE    = (1 << 6),     /* native size off by one */
+       ATA_HORKAGE_IPM         = (1 << 7),     /* Link PM problems */
+       ATA_HORKAGE_IVB         = (1 << 8),     /* cbl det validity bit bugs */
+       ATA_HORKAGE_STUCK_ERR   = (1 << 9),     /* stuck ERR on next PACKET */
 
         /* DMA mask for user DMA control: User visible values; DO NOT
            renumber */
@@ -370,6 +386,18 @@ typedef int (*ata_reset_fn_t)(struct ata_link *link, unsigned int *classes,
                              unsigned long deadline);
 typedef void (*ata_postreset_fn_t)(struct ata_link *link, unsigned int *classes);
 
+/*
+ * host pm policy: If you alter this, you also need to alter libata-scsi.c
+ * (for the ascii descriptions)
+ */
+enum link_pm {
+       NOT_AVAILABLE,
+       MIN_POWER,
+       MAX_PERFORMANCE,
+       MEDIUM_POWER,
+};
+extern struct class_device_attribute class_device_attr_link_power_management_policy;
+
 struct ata_ioports {
        void __iomem            *cmd_addr;
        void __iomem            *data_addr;
@@ -616,6 +644,7 @@ struct ata_port {
 
        pm_message_t            pm_mesg;
        int                     *pm_result;
+       enum link_pm            pm_policy;
 
        struct timer_list       fastdrain_timer;
        unsigned long           fastdrain_cnt;
@@ -683,7 +712,8 @@ struct ata_port_operations {
 
        int (*port_suspend) (struct ata_port *ap, pm_message_t mesg);
        int (*port_resume) (struct ata_port *ap);
-
+       int (*enable_pm) (struct ata_port *ap, enum link_pm policy);
+       void (*disable_pm) (struct ata_port *ap);
        int (*port_start) (struct ata_port *ap);
        void (*port_stop) (struct ata_port *ap);
 
@@ -742,8 +772,6 @@ static inline int ata_port_is_dummy(struct ata_port *ap)
 
 extern void sata_print_link_status(struct ata_link *link);
 extern void ata_port_probe(struct ata_port *);
-extern void __sata_phy_reset(struct ata_port *ap);
-extern void sata_phy_reset(struct ata_port *ap);
 extern void ata_bus_reset(struct ata_port *ap);
 extern int sata_set_spd(struct ata_link *link);
 extern int sata_link_debounce(struct ata_link *link,
@@ -799,6 +827,7 @@ extern void ata_host_resume(struct ata_host *host);
 extern int ata_ratelimit(void);
 extern int ata_busy_sleep(struct ata_port *ap,
                          unsigned long timeout_pat, unsigned long timeout);
+extern void ata_wait_after_reset(struct ata_port *ap, unsigned long deadline);
 extern int ata_wait_ready(struct ata_port *ap, unsigned long deadline);
 extern void ata_port_queue_task(struct ata_port *ap, work_func_t fn,
                                void *data, unsigned long delay);
@@ -964,8 +993,6 @@ extern void sata_pmp_do_eh(struct ata_port *ap,
 /*
  * EH
  */
-extern void ata_eng_timeout(struct ata_port *ap);
-
 extern void ata_port_schedule_eh(struct ata_port *ap);
 extern int ata_link_abort(struct ata_link *link);
 extern int ata_port_abort(struct ata_port *ap);
index 580b3f4956ee260b551850d157f1f1b3992a5429..2f4e957af6568990944e0656546fcdba9a8faf3a 100644 (file)
@@ -109,8 +109,11 @@ struct cmos_rtc_board_info {
 #ifndef ARCH_RTC_LOCATION      /* Override by <asm/mc146818rtc.h>? */
 
 #define RTC_IO_EXTENT  0x8
+#define RTC_IO_EXTENT_USED     0x2
 #define RTC_IOMAPPED   1       /* Default to I/O mapping. */
 
+#else
+#define RTC_IO_EXTENT_USED      RTC_IO_EXTENT
 #endif /* ARCH_RTC_LOCATION */
 
 #endif /* _MC146818RTC_H */
index 7da2cee8e1328731ef3fccbcb011f2d9524be3b6..35a8277ec1bd62890966c816714913c53965c937 100644 (file)
@@ -128,6 +128,18 @@ struct igmpmsg
 #ifdef __KERNEL__
 #include <net/sock.h>
 
+#ifdef CONFIG_IP_MROUTE
+static inline int ip_mroute_opt(int opt)
+{
+       return (opt >= MRT_BASE) && (opt <= MRT_BASE + 10);
+}
+#else
+static inline int ip_mroute_opt(int opt)
+{
+       return 0;
+}
+#endif
+
 extern int ip_mroute_setsockopt(struct sock *, int, char __user *, int);
 extern int ip_mroute_getsockopt(struct sock *, int, char __user *, int __user *);
 extern int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg);
index 3f272396642bc400b6587e314b10006660eb3f66..30e11aa3c1c94cb9d2b1419326896b6462edaaea 100644 (file)
@@ -8,6 +8,9 @@
 #define MV643XX_ETH_NAME               "mv643xx_eth"
 #define MV643XX_ETH_SHARED_REGS                0x2000
 #define MV643XX_ETH_SHARED_REGS_SIZE   0x2000
+#define MV643XX_ETH_BAR_4              0x2220
+#define MV643XX_ETH_SIZE_REG_4         0x2224
+#define MV643XX_ETH_BASE_ADDR_ENABLE_REG       0x2290
 
 struct mv643xx_eth_platform_data {
        int             port_number;
index dd79cdb8c4cf76fb7a7fe794ca32083fc9fe0be3..596131ea46f40259004d1ff4c8fd38b47ee58bea 100644 (file)
@@ -95,6 +95,12 @@ enum sock_type {
 
 #endif /* ARCH_HAS_SOCKET_TYPES */
 
+enum sock_shutdown_cmd {
+       SHUT_RD         = 0,
+       SHUT_WR         = 1,
+       SHUT_RDWR       = 2,
+};
+
 /**
  *  struct socket - general BSD socket
  *  @state: socket state (%SS_CONNECTED, etc)
@@ -223,6 +229,8 @@ extern int kernel_setsockopt(struct socket *sock, int level, int optname,
 extern int kernel_sendpage(struct socket *sock, struct page *page, int offset,
                           size_t size, int flags);
 extern int kernel_sock_ioctl(struct socket *sock, int cmd, unsigned long arg);
+extern int kernel_sock_shutdown(struct socket *sock,
+                               enum sock_shutdown_cmd how);
 
 #ifndef CONFIG_SMP
 #define SOCKOPS_WRAPPED(name) name
index 9b0c8f12373e14258382c40abeca4c55ee060b65..1e6af4f174b6cd5affaf7baf75597490e6915fce 100644 (file)
@@ -739,6 +739,16 @@ static inline void *netdev_priv(const struct net_device *dev)
  */
 #define SET_NETDEV_DEV(net, pdev)      ((net)->dev.parent = (pdev))
 
+/**
+ *     netif_napi_add - initialize a napi context
+ *     @dev:  network device
+ *     @napi: napi context
+ *     @poll: polling function
+ *     @weight: default weight
+ *
+ * netif_napi_add() must be used to initialize a napi context prior to calling
+ * *any* of the other napi related functions.
+ */
 static inline void netif_napi_add(struct net_device *dev,
                                  struct napi_struct *napi,
                                  int (*poll)(struct napi_struct *, int),
index f2eaea2234ec3a16702fd0d881f4285d48300f73..b87e83a5e0707e5f9e06c18f09a25fbc42e31c62 100644 (file)
@@ -4,25 +4,28 @@ header-y += nfnetlink_conntrack.h
 header-y += nfnetlink_log.h
 header-y += nfnetlink_queue.h
 header-y += xt_CLASSIFY.h
+header-y += xt_CONNMARK.h
+header-y += xt_CONNSECMARK.h
+header-y += xt_DSCP.h
+header-y += xt_MARK.h
+header-y += xt_NFLOG.h
+header-y += xt_NFQUEUE.h
+header-y += xt_SECMARK.h
+header-y += xt_TCPMSS.h
 header-y += xt_comment.h
 header-y += xt_connbytes.h
 header-y += xt_connmark.h
-header-y += xt_CONNMARK.h
 header-y += xt_conntrack.h
 header-y += xt_dccp.h
 header-y += xt_dscp.h
-header-y += xt_DSCP.h
 header-y += xt_esp.h
-header-y += xt_helper.h
 header-y += xt_hashlimit.h
+header-y += xt_helper.h
 header-y += xt_length.h
 header-y += xt_limit.h
 header-y += xt_mac.h
 header-y += xt_mark.h
-header-y += xt_MARK.h
 header-y += xt_multiport.h
-header-y += xt_NFQUEUE.h
-header-y += xt_NFLOG.h
 header-y += xt_pkttype.h
 header-y += xt_policy.h
 header-y += xt_realm.h
@@ -32,9 +35,6 @@ header-y += xt_statistic.h
 header-y += xt_string.h
 header-y += xt_tcpmss.h
 header-y += xt_tcpudp.h
-header-y += xt_SECMARK.h
-header-y += xt_CONNSECMARK.h
-header-y += xt_TCPMSS.h
 
 unifdef-y += nf_conntrack_common.h
 unifdef-y += nf_conntrack_ftp.h
index 7185792b900fe479ff4c6d6a631001c70c789d7d..3a7105bb8f33eac65084e2cd62323f5491a02f18 100644 (file)
@@ -1,47 +1,47 @@
-header-y += ipt_addrtype.h
-header-y += ipt_ah.h
 header-y += ipt_CLASSIFY.h
 header-y += ipt_CLUSTERIP.h
+header-y += ipt_CONNMARK.h
+header-y += ipt_DSCP.h
+header-y += ipt_ECN.h
+header-y += ipt_LOG.h
+header-y += ipt_MARK.h
+header-y += ipt_NFQUEUE.h
+header-y += ipt_REJECT.h
+header-y += ipt_SAME.h
+header-y += ipt_TCPMSS.h
+header-y += ipt_TOS.h
+header-y += ipt_TTL.h
+header-y += ipt_ULOG.h
+header-y += ipt_addrtype.h
+header-y += ipt_ah.h
 header-y += ipt_comment.h
 header-y += ipt_connbytes.h
 header-y += ipt_connmark.h
-header-y += ipt_CONNMARK.h
 header-y += ipt_conntrack.h
 header-y += ipt_dccp.h
 header-y += ipt_dscp.h
-header-y += ipt_DSCP.h
 header-y += ipt_ecn.h
-header-y += ipt_ECN.h
 header-y += ipt_esp.h
 header-y += ipt_hashlimit.h
 header-y += ipt_helper.h
 header-y += ipt_iprange.h
 header-y += ipt_length.h
 header-y += ipt_limit.h
-header-y += ipt_LOG.h
 header-y += ipt_mac.h
 header-y += ipt_mark.h
-header-y += ipt_MARK.h
 header-y += ipt_multiport.h
-header-y += ipt_NFQUEUE.h
 header-y += ipt_owner.h
 header-y += ipt_physdev.h
 header-y += ipt_pkttype.h
 header-y += ipt_policy.h
 header-y += ipt_realm.h
 header-y += ipt_recent.h
-header-y += ipt_REJECT.h
-header-y += ipt_SAME.h
 header-y += ipt_sctp.h
 header-y += ipt_state.h
 header-y += ipt_string.h
 header-y += ipt_tcpmss.h
-header-y += ipt_TCPMSS.h
 header-y += ipt_tos.h
-header-y += ipt_TOS.h
 header-y += ipt_ttl.h
-header-y += ipt_TTL.h
-header-y += ipt_ULOG.h
 
 unifdef-y += ip_queue.h
 unifdef-y += ip_tables.h
index 9dd978d149ff8927e4754fb6697540d638fdc137..8887a5fcd1d0c5952dd54156352a6fac3d73d9f5 100644 (file)
@@ -14,8 +14,8 @@ header-y += ip6t_mark.h
 header-y += ip6t_multiport.h
 header-y += ip6t_opts.h
 header-y += ip6t_owner.h
-header-y += ip6t_policy.h
 header-y += ip6t_physdev.h
+header-y += ip6t_policy.h
 header-y += ip6t_rt.h
 
 unifdef-y += ip6_tables.h
index 7c1f3b1d2ee5a3e3b6c6cda0794a4847e6e044ae..d5bfaba595c79e796be9d105b0359d02ac5a88a8 100644 (file)
@@ -192,7 +192,7 @@ extern int netlink_unregister_notifier(struct notifier_block *nb);
 /* finegrained unicast helpers: */
 struct sock *netlink_getsockbyfilp(struct file *filp);
 int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock,
-               long timeo, struct sock *ssk);
+                     long *timeo, struct sock *ssk);
 void netlink_detachskb(struct sock *sk, struct sk_buff *skb);
 int netlink_sendskb(struct sock *sk, struct sk_buff *skb);
 
index e82a6ebc725d7b18a76fdccc9d58853b42a8bdba..2d15d4aac09407e94ee859c3c1a76c1dd9717041 100644 (file)
@@ -422,7 +422,6 @@ extern long nfs_sync_mapping_wait(struct address_space *, struct writeback_contr
 extern int nfs_wb_all(struct inode *inode);
 extern int nfs_wb_nocommit(struct inode *inode);
 extern int nfs_wb_page(struct inode *inode, struct page* page);
-extern int nfs_wb_page_priority(struct inode *inode, struct page* page, int how);
 extern int nfs_wb_page_cancel(struct inode *inode, struct page* page);
 #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
 extern int  nfs_commit_inode(struct inode *, int);
index 5d2281f661f77e70a13090d7508f8adcdbba9584..0dd93bb62fbe9f4af33c458f24db96ca79d8c0c2 100644 (file)
@@ -109,6 +109,14 @@ enum pcie_reset_state {
        pcie_hot_reset = (__force pcie_reset_state_t) 3
 };
 
+typedef unsigned short __bitwise pci_dev_flags_t;
+enum pci_dev_flags {
+       /* INTX_DISABLE in PCI_COMMAND register disables MSI
+        * generation too.
+        */
+       PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG = (__force pci_dev_flags_t) 1,
+};
+
 typedef unsigned short __bitwise pci_bus_flags_t;
 enum pci_bus_flags {
        PCI_BUS_FLAGS_NO_MSI   = (__force pci_bus_flags_t) 1,
@@ -185,6 +193,7 @@ struct pci_dev {
        unsigned int    msix_enabled:1;
        unsigned int    is_managed:1;
        unsigned int    is_pcie:1;
+       pci_dev_flags_t dev_flags;
        atomic_t        enable_cnt;     /* pci_enable_device has been called */
 
        u32             saved_config_space[16]; /* config space saved at suspend time */
@@ -479,8 +488,11 @@ extern void pci_sort_breadthfirst(void);
 
 /* Generic PCI functions exported to card drivers */
 
+#ifdef CONFIG_PCI_LEGACY
 struct pci_dev __deprecated *pci_find_device (unsigned int vendor, unsigned int device, const struct pci_dev *from);
 struct pci_dev __deprecated *pci_find_slot (unsigned int bus, unsigned int devfn);
+#endif /* CONFIG_PCI_LEGACY */
+
 int pci_find_capability (struct pci_dev *dev, int cap);
 int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap);
 int pci_find_ext_capability (struct pci_dev *dev, int cap);
@@ -622,7 +634,6 @@ static inline int __must_check pci_register_driver(struct pci_driver *driver)
 void pci_unregister_driver(struct pci_driver *);
 void pci_remove_behind_bridge(struct pci_dev *);
 struct pci_driver *pci_dev_driver(const struct pci_dev *);
-const struct pci_device_id *pci_match_device(struct pci_driver *drv, struct pci_dev *dev);
 const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, struct pci_dev *dev);
 int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass);
 
@@ -751,7 +762,6 @@ static inline void pci_unregister_driver(struct pci_driver *drv) { }
 static inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; }
 static inline int pci_find_next_capability (struct pci_dev *dev, u8 post, int cap) { return 0; }
 static inline int pci_find_ext_capability (struct pci_dev *dev, int cap) {return 0; }
-static inline const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev) { return NULL; }
 
 /* Power management related routines */
 static inline int pci_save_state(struct pci_dev *dev) { return 0; }
index e44aac8cf5ffb077d218d80fa5650944f6cec772..1ee009e8fec8c6a670c7a33ac7da40b0844d3b80 100644 (file)
 #define PCI_DEVICE_ID_ATI_RS400_166     0x5a32
 #define PCI_DEVICE_ID_ATI_RS400_200     0x5a33
 #define PCI_DEVICE_ID_ATI_RS480         0x5950
-#define PCI_DEVICE_ID_ATI_RD580                0x5952
-#define PCI_DEVICE_ID_ATI_RX790                0x5957
-#define PCI_DEVICE_ID_ATI_RS690                0x7910
 /* ATI IXP Chipset */
 #define PCI_DEVICE_ID_ATI_IXP200_IDE   0x4349
 #define PCI_DEVICE_ID_ATI_IXP200_SMBUS 0x4353
 #define PCI_DEVICE_ID_SERVERWORKS_HE     0x0008
 #define PCI_DEVICE_ID_SERVERWORKS_LE     0x0009
 #define PCI_DEVICE_ID_SERVERWORKS_GCNB_LE 0x0017
+#define PCI_DEVICE_ID_SERVERWORKS_HT1000_PXB   0x0036
 #define PCI_DEVICE_ID_SERVERWORKS_EPB    0x0103
-#define PCI_DEVICE_ID_SERVERWORKS_HT1000_PCIX  0x0104
 #define PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE  0x0132
 #define PCI_DEVICE_ID_SERVERWORKS_OSB4   0x0200
 #define PCI_DEVICE_ID_SERVERWORKS_CSB5   0x0201
 #define PCI_DEVICE_ID_INTEL_82915G_IG  0x2582
 #define PCI_DEVICE_ID_INTEL_82915GM_HB 0x2590
 #define PCI_DEVICE_ID_INTEL_82915GM_IG 0x2592
+#define PCI_DEVICE_ID_INTEL_5000_ERR   0x25F0
+#define PCI_DEVICE_ID_INTEL_5000_FBD0  0x25F5
+#define PCI_DEVICE_ID_INTEL_5000_FBD1  0x25F6
 #define PCI_DEVICE_ID_INTEL_82945G_HB  0x2770
 #define PCI_DEVICE_ID_INTEL_82945G_IG  0x2772
 #define PCI_DEVICE_ID_INTEL_3000_HB    0x2778
 #define PCI_DEVICE_ID_INTEL_MCH_PC1    0x359a
 #define PCI_DEVICE_ID_INTEL_E7525_MCH  0x359e
 #define PCI_DEVICE_ID_INTEL_IOAT_CNB   0x360b
+#define PCI_DEVICE_ID_INTEL_IOAT_SNB   0x402f
 #define PCI_DEVICE_ID_INTEL_IOAT_SCNB  0x65ff
 #define PCI_DEVICE_ID_INTEL_TOLAPAI_0  0x5031
 #define PCI_DEVICE_ID_INTEL_TOLAPAI_1  0x5032
index 0135c76c76c6dc8005d4cb2d42353fd3320624b1..1689e28483e49d2c2f043a55531280e783fb48d5 100644 (file)
@@ -29,6 +29,7 @@ struct pid_namespace {
 
 extern struct pid_namespace init_pid_ns;
 
+#ifdef CONFIG_PID_NS
 static inline struct pid_namespace *get_pid_ns(struct pid_namespace *ns)
 {
        if (ns != &init_pid_ns)
@@ -45,6 +46,28 @@ static inline void put_pid_ns(struct pid_namespace *ns)
                kref_put(&ns->kref, free_pid_ns);
 }
 
+#else /* !CONFIG_PID_NS */
+#include <linux/err.h>
+
+static inline struct pid_namespace *get_pid_ns(struct pid_namespace *ns)
+{
+       return ns;
+}
+
+static inline struct pid_namespace *
+copy_pid_ns(unsigned long flags, struct pid_namespace *ns)
+{
+       if (flags & CLONE_NEWPID)
+               ns = ERR_PTR(-EINVAL);
+       return ns;
+}
+
+static inline void put_pid_ns(struct pid_namespace *ns)
+{
+}
+
+#endif /* CONFIG_PID_NS */
+
 static inline struct pid_namespace *task_active_pid_ns(struct task_struct *tsk)
 {
        return tsk->nsproxy->pid_ns;
index 1ff461672060ebc52d882156e0659250944d4110..1273c6ec535c96c1f5151ca47bcc0e9d1ad8db66 100644 (file)
@@ -196,8 +196,6 @@ static inline struct proc_dir_entry *create_proc_info_entry(const char *name,
        return res;
 }
 
-extern struct proc_dir_entry *proc_net_create(struct net *net,
-       const char *name, mode_t mode, get_info_t *get_info);
 extern struct proc_dir_entry *proc_net_fops_create(struct net *net,
        const char *name, mode_t mode, const struct file_operations *fops);
 extern void proc_net_remove(struct net *net, const char *name);
@@ -208,7 +206,6 @@ extern void proc_net_remove(struct net *net, const char *name);
 #define proc_bus NULL
 
 #define proc_net_fops_create(net, name, mode, fops)  ({ (void)(mode), NULL; })
-#define proc_net_create(net, name, mode, info) ({ (void)(mode), NULL; })
 static inline void proc_net_remove(struct net *net, const char *name) {}
 
 static inline void proc_flush_task(struct task_struct *task)
index 5bf618241ab910eaf1c92a53026ccc672bf6165a..4e81836191df82ebaa5d8bf19e658ad29e92c16e 100644 (file)
@@ -491,9 +491,11 @@ struct nduseroptmsg
        unsigned char   nduseropt_family;
        unsigned char   nduseropt_pad1;
        unsigned short  nduseropt_opts_len;     /* Total length of options */
+       int             nduseropt_ifindex;
        __u8            nduseropt_icmp_type;
        __u8            nduseropt_icmp_code;
        unsigned short  nduseropt_pad2;
+       unsigned int    nduseropt_pad3;
        /* Followed by one or more ND options */
 };
 
index 45712317138973ad8147ed0567c30bb4d62da55a..25973504414823b7876d2f34256ea1f103018ddb 100644 (file)
@@ -150,7 +150,7 @@ static inline struct scatterlist *sg_last(struct scatterlist *sgl,
        struct scatterlist *ret = &sgl[nents - 1];
 #else
        struct scatterlist *sg, *ret = NULL;
-       int i;
+       unsigned int i;
 
        for_each_sg(sgl, sg, nents, i)
                ret = sg;
@@ -179,48 +179,32 @@ static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents,
 #ifndef ARCH_HAS_SG_CHAIN
        BUG();
 #endif
-       prv[prv_nents - 1].page_link = (unsigned long) sgl | 0x01;
+       /*
+        * Set lowest bit to indicate a link pointer, and make sure to clear
+        * the termination bit if it happens to be set.
+        */
+       prv[prv_nents - 1].page_link = ((unsigned long) sgl | 0x01) & ~0x02;
 }
 
 /**
  * sg_mark_end - Mark the end of the scatterlist
- * @sgl:       Scatterlist
- * @nents:     Number of entries in sgl
+ * @sg:                 SG entryScatterlist
  *
  * Description:
- *   Marks the last entry as the termination point for sg_next()
- *
- **/
-static inline void sg_mark_end(struct scatterlist *sgl, unsigned int nents)
-{
-       sgl[nents - 1].page_link = 0x02;
-}
-
-static inline void __sg_mark_end(struct scatterlist *sg)
-{
-       sg->page_link |= 0x02;
-}
-
-/**
- * sg_init_one - Initialize a single entry sg list
- * @sg:                 SG entry
- * @buf:        Virtual address for IO
- * @buflen:     IO length
- *
- * Notes:
- *   This should not be used on a single entry that is part of a larger
- *   table. Use sg_init_table() for that.
+ *   Marks the passed in sg entry as the termination point for the sg
+ *   table. A call to sg_next() on this entry will return NULL.
  *
  **/
-static inline void sg_init_one(struct scatterlist *sg, const void *buf,
-                              unsigned int buflen)
+static inline void sg_mark_end(struct scatterlist *sg)
 {
-       memset(sg, 0, sizeof(*sg));
 #ifdef CONFIG_DEBUG_SG
-       sg->sg_magic = SG_MAGIC;
+       BUG_ON(sg->sg_magic != SG_MAGIC);
 #endif
-       sg_mark_end(sg, 1);
-       sg_set_buf(sg, buf, buflen);
+       /*
+        * Set termination bit, clear potential chain bit
+        */
+       sg->page_link |= 0x02;
+       sg->page_link &= ~0x01;
 }
 
 /**
@@ -236,14 +220,32 @@ static inline void sg_init_one(struct scatterlist *sg, const void *buf,
 static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents)
 {
        memset(sgl, 0, sizeof(*sgl) * nents);
-       sg_mark_end(sgl, nents);
 #ifdef CONFIG_DEBUG_SG
        {
-               int i;
+               unsigned int i;
                for (i = 0; i < nents; i++)
                        sgl[i].sg_magic = SG_MAGIC;
        }
 #endif
+       sg_mark_end(&sgl[nents - 1]);
+}
+
+/**
+ * sg_init_one - Initialize a single entry sg list
+ * @sg:                 SG entry
+ * @buf:        Virtual address for IO
+ * @buflen:     IO length
+ *
+ * Notes:
+ *   This should not be used on a single entry that is part of a larger
+ *   table. Use sg_init_table() for that.
+ *
+ **/
+static inline void sg_init_one(struct scatterlist *sg, const void *buf,
+                              unsigned int buflen)
+{
+       sg_init_table(sg, 1);
+       sg_set_buf(sg, buf, buflen);
 }
 
 /**
index 3c07d595979fc71b4db19a65ce8e6cef7f143769..ee800e7a70de427ae9ce46e34c27ac659d04336b 100644 (file)
@@ -254,6 +254,7 @@ long io_schedule_timeout(long timeout);
 
 extern void cpu_init (void);
 extern void trap_init(void);
+extern void account_process_tick(struct task_struct *task, int user);
 extern void update_process_times(int user);
 extern void scheduler_tick(void);
 
@@ -862,7 +863,6 @@ struct sched_entity {
        struct load_weight      load;           /* for load-balancing */
        struct rb_node          run_node;
        unsigned int            on_rq;
-       int                     peer_preempt;
 
        u64                     exec_start;
        u64                     sum_exec_runtime;
@@ -1009,6 +1009,7 @@ struct task_struct {
        unsigned int rt_priority;
        cputime_t utime, stime, utimescaled, stimescaled;
        cputime_t gtime;
+       cputime_t prev_utime, prev_stime;
        unsigned long nvcsw, nivcsw; /* context switch counts */
        struct timespec start_time;             /* monotonic time */
        struct timespec real_start_time;        /* boot based time */
@@ -1459,12 +1460,17 @@ extern void sched_idle_next(void);
 
 #ifdef CONFIG_SCHED_DEBUG
 extern unsigned int sysctl_sched_latency;
-extern unsigned int sysctl_sched_nr_latency;
+extern unsigned int sysctl_sched_min_granularity;
 extern unsigned int sysctl_sched_wakeup_granularity;
 extern unsigned int sysctl_sched_batch_wakeup_granularity;
 extern unsigned int sysctl_sched_child_runs_first;
 extern unsigned int sysctl_sched_features;
 extern unsigned int sysctl_sched_migration_cost;
+extern unsigned int sysctl_sched_nr_migrate;
+
+int sched_nr_latency_handler(struct ctl_table *table, int write,
+               struct file *file, void __user *buffer, size_t *length,
+               loff_t *ppos);
 #endif
 
 extern unsigned int sysctl_sched_compat_yield;
@@ -1982,6 +1988,14 @@ static inline void inc_syscw(struct task_struct *tsk)
 }
 #endif
 
+#ifdef CONFIG_SMP
+void migration_init(void);
+#else
+static inline void migration_init(void)
+{
+}
+#endif
+
 #endif /* __KERNEL__ */
 
 #endif
index d1b7ca6c1c57af517e0b1f00b7e97f4c78c0c1d9..6080f73fc85f0b5555f973b606984ecc77ddefe2 100644 (file)
@@ -136,7 +136,7 @@ static inline int selinux_audit_rule_init(u32 field, u32 op,
                                           char *rulestr,
                                           struct selinux_audit_rule **rule)
 {
-       return -ENOTSUPP;
+       return -EOPNOTSUPP;
 }
 
 static inline void selinux_audit_rule_free(struct selinux_audit_rule *rule)
index 94e49915a8c0e1113091bd12261f349f852ef6ad..bddd50bd6878856ba20363ec2dda6101cde0f879 100644 (file)
@@ -356,7 +356,6 @@ static inline struct sk_buff *alloc_skb_fclone(unsigned int size,
        return __alloc_skb(size, priority, 1, -1);
 }
 
-extern void           kfree_skbmem(struct sk_buff *skb);
 extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src);
 extern struct sk_buff *skb_clone(struct sk_buff *skb,
                                 gfp_t priority);
@@ -387,7 +386,9 @@ extern void       skb_truesize_bug(struct sk_buff *skb);
 
 static inline void skb_truesize_check(struct sk_buff *skb)
 {
-       if (unlikely((int)skb->truesize < sizeof(struct sk_buff) + skb->len))
+       int len = sizeof(struct sk_buff) + skb->len;
+
+       if (unlikely((int)skb->truesize < len))
                skb_truesize_bug(skb);
 }
 
index 259a13c3bd98eda779379be1c5df5e37aae6c73e..c25e66bcecf335cfead012f4fd8feeff8834e5aa 100644 (file)
@@ -84,11 +84,12 @@ void smp_prepare_boot_cpu(void);
  *     These macros fold the SMP functionality into a single CPU system
  */
 #define raw_smp_processor_id()                 0
-static inline int up_smp_call_function(void)
+static inline int up_smp_call_function(void (*func)(void *), void *info)
 {
        return 0;
 }
-#define smp_call_function(func,info,retry,wait)        (up_smp_call_function())
+#define smp_call_function(func, info, retry, wait) \
+                       (up_smp_call_function(func, info))
 #define on_each_cpu(func,info,retry,wait)      \
        ({                                      \
                local_irq_disable();            \
@@ -107,6 +108,8 @@ static inline void smp_send_reschedule(int cpu) { }
        local_irq_enable();     \
        0;                      \
 })
+#define smp_call_function_mask(mask, func, info, wait) \
+                       (up_smp_call_function(func, info))
 
 #endif /* !SMP */
 
index 836062b7582a95d23878b994144f5cba85d4ce34..c5d3fcad7b57c87449d7de9085daa64cd80f984f 100644 (file)
@@ -3,16 +3,14 @@
 
 /* We don't want strings.h stuff being user by user stuff by accident */
 
-#ifdef __KERNEL__
+#ifndef __KERNEL__
+#include <string.h>
+#else
 
 #include <linux/compiler.h>    /* for inline */
 #include <linux/types.h>       /* for size_t */
 #include <linux/stddef.h>      /* for NULL */
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 extern char *strndup_user(const char __user *, long);
 
 /*
@@ -111,9 +109,5 @@ extern void *kmemdup(const void *src, size_t len, gfp_t gfp);
 extern char **argv_split(gfp_t gfp, const char *str, int *argcp);
 extern void argv_free(char **argv);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif
 #endif /* _LINUX_STRING_H_ */
index 3347c72b848abaadd0f12fd0e650dbf8323729ce..3912cf16361ee98aa9334399fe6d8289e3270364 100644 (file)
@@ -88,11 +88,6 @@ enum {
        CTL_SLOTTABLE_TCP,
        CTL_MIN_RESVPORT,
        CTL_MAX_RESVPORT,
-       CTL_SLOTTABLE_RDMA,
-       CTL_RDMA_MAXINLINEREAD,
-       CTL_RDMA_MAXINLINEWRITE,
-       CTL_RDMA_WRITEPADDING,
-       CTL_RDMA_MEMREG,
 };
 
 #endif /* _LINUX_SUNRPC_DEBUG_H_ */
index 0013a0d8dc6b5620fb7d4add4ae7d1d5ce9f2c8d..87b895d5c786eb0256eae604e9d1efa9979e3756 100644 (file)
 #define _LINUX_SUNRPC_RPC_RDMA_H
 
 struct rpcrdma_segment {
-       uint32_t rs_handle;     /* Registered memory handle */
-       uint32_t rs_length;     /* Length of the chunk in bytes */
-       uint64_t rs_offset;     /* Chunk virtual address or offset */
+       __be32 rs_handle;       /* Registered memory handle */
+       __be32 rs_length;       /* Length of the chunk in bytes */
+       __be64 rs_offset;       /* Chunk virtual address or offset */
 };
 
 /*
  * read chunk(s), encoded as a linked list.
  */
 struct rpcrdma_read_chunk {
-       uint32_t rc_discrim;    /* 1 indicates presence */
-       uint32_t rc_position;   /* Position in XDR stream */
+       __be32 rc_discrim;      /* 1 indicates presence */
+       __be32 rc_position;     /* Position in XDR stream */
        struct rpcrdma_segment rc_target;
 };
 
@@ -66,29 +66,29 @@ struct rpcrdma_write_chunk {
  * write chunk(s), encoded as a counted array.
  */
 struct rpcrdma_write_array {
-       uint32_t wc_discrim;    /* 1 indicates presence */
-       uint32_t wc_nchunks;    /* Array count */
+       __be32 wc_discrim;      /* 1 indicates presence */
+       __be32 wc_nchunks;      /* Array count */
        struct rpcrdma_write_chunk wc_array[0];
 };
 
 struct rpcrdma_msg {
-       uint32_t rm_xid;        /* Mirrors the RPC header xid */
-       uint32_t rm_vers;       /* Version of this protocol */
-       uint32_t rm_credit;     /* Buffers requested/granted */
-       uint32_t rm_type;       /* Type of message (enum rpcrdma_proc) */
+       __be32 rm_xid;  /* Mirrors the RPC header xid */
+       __be32 rm_vers; /* Version of this protocol */
+       __be32 rm_credit;       /* Buffers requested/granted */
+       __be32 rm_type; /* Type of message (enum rpcrdma_proc) */
        union {
 
                struct {                        /* no chunks */
-                       uint32_t rm_empty[3];   /* 3 empty chunk lists */
+                       __be32 rm_empty[3];     /* 3 empty chunk lists */
                } rm_nochunks;
 
                struct {                        /* no chunks and padded */
-                       uint32_t rm_align;      /* Padding alignment */
-                       uint32_t rm_thresh;     /* Padding threshold */
-                       uint32_t rm_pempty[3];  /* 3 empty chunk lists */
+                       __be32 rm_align;        /* Padding alignment */
+                       __be32 rm_thresh;       /* Padding threshold */
+                       __be32 rm_pempty[3];    /* 3 empty chunk lists */
                } rm_padded;
 
-               uint32_t rm_chunks[0];  /* read, write and reply chunks */
+               __be32 rm_chunks[0];    /* read, write and reply chunks */
 
        } rm_body;
 };
index 2c6c2c2783d8b899940280c47a70ee3bff588e18..c2a46c45c8f75a3dab16327b78651501e1bd5740 100644 (file)
@@ -9,12 +9,6 @@
 
 #ifdef __KERNEL__
 
-/*
- * Socket transport setup operations
- */
-struct rpc_xprt *xs_setup_udp(struct xprt_create *args);
-struct rpc_xprt *xs_setup_tcp(struct xprt_create *args);
-
 int            init_socket_xprt(void);
 void           cleanup_socket_xprt(void);
 
index e99171f01b4cf482c2cd8720dea2f0921c08b4e2..4f5047df8a9efbf6672c31883222f902f5ee6c8b 100644 (file)
@@ -70,7 +70,6 @@ enum
        CTL_ABI=9,              /* Binary emulation */
        CTL_CPU=10,             /* CPU stuff (speed scaling, etc) */
        CTL_ARLAN=254,          /* arlan wireless driver */
-       CTL_APPLDATA=2120,      /* s390 appldata */
        CTL_S390DBF=5677,       /* s390 debug */
        CTL_SUNRPC=7249,        /* sunrpc debug */
        CTL_PM=9899,            /* frv power management */
@@ -207,11 +206,6 @@ enum
        VM_PANIC_ON_OOM=33,     /* panic at out-of-memory */
        VM_VDSO_ENABLED=34,     /* map VDSO into new processes? */
        VM_MIN_SLAB=35,          /* Percent pages ignored by zone reclaim */
-
-       /* s390 vm cmm sysctls */
-       VM_CMM_PAGES=1111,
-       VM_CMM_TIMED_PAGES=1112,
-       VM_CMM_TIMEOUT=1113,
 };
 
 
index 37ac3ff90fafb16f7814297d247c2a3c28c59204..24c6a2b59511edbe9ba01d22ba265a202645bed7 100644 (file)
@@ -137,6 +137,7 @@ struct timex {
 #define ADJ_TIMECONST          0x0020  /* pll time constant */
 #define ADJ_TICK               0x4000  /* tick value */
 #define ADJ_OFFSET_SINGLESHOT  0x8001  /* old-fashioned adjtime */
+#define ADJ_OFFSET_SS_READ     0xa001  /* read-only adjtime */
 
 /* xntp 3.4 compatibility names */
 #define MOD_OFFSET     ADJ_OFFSET
index 56164d7ba0add0efa325214715706c611b091486..c555f5442bd7c2c99cad45fb49370bb2280a8629 100644 (file)
@@ -332,7 +332,9 @@ extern void tty_ldisc_flush(struct tty_struct *tty);
 
 extern int tty_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
                     unsigned long arg);
-
+extern int tty_mode_ioctl(struct tty_struct *tty, struct file *file,
+                       unsigned int cmd, unsigned long arg);
+extern int tty_perform_flush(struct tty_struct *tty, unsigned long arg);
 extern dev_t tty_devnum(struct tty_struct *tty);
 extern void proc_clear_tty(struct task_struct *p);
 extern struct tty_struct *get_current_tty(void);
index 4f0dad21c91702a86acdcd22ca1b556e84ed1203..f4f8d19158e4bb80d7ef39080ec1fabf4584cf7a 100644 (file)
@@ -37,6 +37,8 @@ typedef __kernel_gid32_t      gid_t;
 typedef __kernel_uid16_t        uid16_t;
 typedef __kernel_gid16_t        gid16_t;
 
+typedef unsigned long          uintptr_t;
+
 #ifdef CONFIG_UID16
 /* This is defined by include/asm-{arch}/posix_types.h */
 typedef __kernel_old_uid_t     old_uid_t;
index ac69e7bb5a14f5465df654a5d7668cb45a7669f5..1a4ed49f64780cc553a1ac3f6dcca0f2065972ff 100644 (file)
@@ -67,7 +67,7 @@ struct vring {
 };
 
 /* The standard layout for the ring is a continuous chunk of memory which looks
- * like this.  The used fields will be aligned to a "num+1" boundary.
+ * like this.  We assume num is a power of 2.
  *
  * struct vring
  * {
@@ -79,8 +79,8 @@ struct vring {
  *     __u16 avail_idx;
  *     __u16 available[num];
  *
- *     // Padding so a correctly-chosen num value will cache-align used_idx.
- *     char pad[sizeof(struct vring_desc) - sizeof(avail_flags)];
+ *     // Padding to the next page boundary.
+ *     char pad[];
  *
  *     // A ring of used descriptor heads with free-running index.
  *     __u16 used_flags;
@@ -88,18 +88,21 @@ struct vring {
  *     struct vring_used_elem used[num];
  * };
  */
-static inline void vring_init(struct vring *vr, unsigned int num, void *p)
+static inline void vring_init(struct vring *vr, unsigned int num, void *p,
+                             unsigned int pagesize)
 {
        vr->num = num;
        vr->desc = p;
-       vr->avail = p + num*sizeof(struct vring);
-       vr->used = p + (num+1)*(sizeof(struct vring) + sizeof(__u16));
+       vr->avail = p + num*sizeof(struct vring_desc);
+       vr->used = (void *)(((unsigned long)&vr->avail->ring[num] + pagesize-1)
+                           & ~(pagesize - 1));
 }
 
-static inline unsigned vring_size(unsigned int num)
+static inline unsigned vring_size(unsigned int num, unsigned int pagesize)
 {
-       return (num + 1) * (sizeof(struct vring_desc) + sizeof(__u16))
-               + sizeof(__u32) + num * sizeof(struct vring_used_elem);
+       return ((sizeof(struct vring_desc) * num + sizeof(__u16) * (2 + num)
+                + pagesize - 1) & ~(pagesize - 1))
+               + sizeof(__u16) * 2 + sizeof(struct vring_used_elem) * num;
 }
 
 #ifdef __KERNEL__
index 0864a775de24462fb962545da1c91b7b56a860ae..a1c805d7f488b7295a335c33de66f495cd5d0e37 100644 (file)
@@ -12,7 +12,7 @@ extern void unix_gc(void);
 
 #define UNIX_HASH_SIZE 256
 
-extern atomic_t unix_tot_inflight;
+extern unsigned int unix_tot_inflight;
 
 struct unix_address {
        atomic_t        refcnt;
index e9ff4a4caef992806909de300cb92421b5be90ae..2f65e894b8295f310ad20d331e56d981c94b67d0 100644 (file)
@@ -143,6 +143,13 @@ static inline void dst_hold(struct dst_entry * dst)
        atomic_inc(&dst->__refcnt);
 }
 
+static inline void dst_use(struct dst_entry *dst, unsigned long time)
+{
+       dst_hold(dst);
+       dst->__use++;
+       dst->lastuse = time;
+}
+
 static inline
 struct dst_entry * dst_clone(struct dst_entry * dst)
 {
index c1bc529809daad155865ed444049fdb1396b1b21..c05f529bff2824c9bc6f92a0a454b0f2260cc884 100644 (file)
@@ -3,7 +3,7 @@
 
 #include <linux/crypto.h>
 #include <net/xfrm.h>
-#include <asm/scatterlist.h>
+#include <linux/scatterlist.h>
 
 #define ESP_NUM_FAST_SG                4
 
index 017aebd9068317f387df8f62de160cc7bad36a08..41a301e386433006e659ae14409e1373f905d36b 100644 (file)
@@ -107,4 +107,7 @@ extern int                  fib_rules_unregister(struct fib_rules_ops *);
 extern int                     fib_rules_lookup(struct fib_rules_ops *,
                                                 struct flowi *, int flags,
                                                 struct fib_lookup_arg *);
+extern int                     fib_default_rule_add(struct fib_rules_ops *,
+                                                    u32 pref, u32 table,
+                                                    u32 flags);
 #endif
index 164d13211165422ef32ed5e206025d8daf060ed0..d8ae48439f120a27b18e7d226ba49d54a16b322e 100644 (file)
@@ -115,8 +115,16 @@ extern u32 ieee80211_debug_level;
 do { if (ieee80211_debug_level & (level)) \
   printk(KERN_DEBUG "ieee80211: %c %s " fmt, \
          in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0)
+static inline bool ieee80211_ratelimit_debug(u32 level)
+{
+       return (ieee80211_debug_level & level) && net_ratelimit();
+}
 #else
 #define IEEE80211_DEBUG(level, fmt, args...) do {} while (0)
+static inline bool ieee80211_ratelimit_debug(u32 level)
+{
+       return false;
+}
 #endif                         /* CONFIG_IEEE80211_DEBUG */
 
 /* escape_essid() is intended to be used in debug (and possibly error)
index 227adcbdfec801e313f9e4c49a029a8f4347be90..38d5a1e9980da3a09f6e6f2c96122bbedf7cc21f 100644 (file)
@@ -13,9 +13,6 @@ struct sock;
 struct sockaddr;
 struct socket;
 
-extern void                    inet_remove_sock(struct sock *sk1);
-extern void                    inet_put_sock(unsigned short num, 
-                                             struct sock *sk);
 extern int                     inet_release(struct socket *sock);
 extern int                     inet_stream_connect(struct socket *sock,
                                                    struct sockaddr * uaddr,
@@ -30,7 +27,6 @@ extern int                    inet_sendmsg(struct kiocb *iocb,
                                             struct msghdr *msg, 
                                             size_t size);
 extern int                     inet_shutdown(struct socket *sock, int how);
-extern unsigned int            inet_poll(struct file * file, struct socket *sock, struct poll_table_struct *wait);
 extern int                     inet_listen(struct socket *sock, int backlog);
 
 extern void                    inet_sock_destruct(struct sock *sk);
index 4427dcd1e53a7bf2dc49d2a9f99b913978e4b57a..37f6cb11212723f7f2094a16b6cec92bbe9ef670 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/spinlock.h>
 #include <linux/types.h>
 #include <linux/wait.h>
+#include <linux/vmalloc.h>
 
 #include <net/inet_connection_sock.h>
 #include <net/inet_sock.h>
@@ -37,7 +38,6 @@
  * I'll experiment with dynamic table growth later.
  */
 struct inet_ehash_bucket {
-       rwlock_t          lock;
        struct hlist_head chain;
        struct hlist_head twchain;
 };
@@ -100,6 +100,9 @@ struct inet_hashinfo {
         * TIME_WAIT sockets use a separate chain (twchain).
         */
        struct inet_ehash_bucket        *ehash;
+       rwlock_t                        *ehash_locks;
+       unsigned int                    ehash_size;
+       unsigned int                    ehash_locks_mask;
 
        /* Ok, let's try this, I give up, we do need a local binding
         * TCP hash as well as the others for fast bind/connect.
@@ -107,7 +110,7 @@ struct inet_hashinfo {
        struct inet_bind_hashbucket     *bhash;
 
        unsigned int                    bhash_size;
-       unsigned int                    ehash_size;
+       /* Note : 4 bytes padding on 64 bit arches */
 
        /* All sockets in TCP_LISTEN state will be in here.  This is the only
         * table where wildcard'd TCP sockets can exist.  Hash function here
@@ -134,6 +137,61 @@ static inline struct inet_ehash_bucket *inet_ehash_bucket(
        return &hashinfo->ehash[hash & (hashinfo->ehash_size - 1)];
 }
 
+static inline rwlock_t *inet_ehash_lockp(
+       struct inet_hashinfo *hashinfo,
+       unsigned int hash)
+{
+       return &hashinfo->ehash_locks[hash & hashinfo->ehash_locks_mask];
+}
+
+static inline int inet_ehash_locks_alloc(struct inet_hashinfo *hashinfo)
+{
+       unsigned int i, size = 256;
+#if defined(CONFIG_PROVE_LOCKING)
+       unsigned int nr_pcpus = 2;
+#else
+       unsigned int nr_pcpus = num_possible_cpus();
+#endif
+       if (nr_pcpus >= 4)
+               size = 512;
+       if (nr_pcpus >= 8)
+               size = 1024;
+       if (nr_pcpus >= 16)
+               size = 2048;
+       if (nr_pcpus >= 32)
+               size = 4096;
+       if (sizeof(rwlock_t) != 0) {
+#ifdef CONFIG_NUMA
+               if (size * sizeof(rwlock_t) > PAGE_SIZE)
+                       hashinfo->ehash_locks = vmalloc(size * sizeof(rwlock_t));
+               else
+#endif
+               hashinfo->ehash_locks = kmalloc(size * sizeof(rwlock_t),
+                                               GFP_KERNEL);
+               if (!hashinfo->ehash_locks)
+                       return ENOMEM;
+               for (i = 0; i < size; i++)
+                       rwlock_init(&hashinfo->ehash_locks[i]);
+       }
+       hashinfo->ehash_locks_mask = size - 1;
+       return 0;
+}
+
+static inline void inet_ehash_locks_free(struct inet_hashinfo *hashinfo)
+{
+       if (hashinfo->ehash_locks) {
+#ifdef CONFIG_NUMA
+               unsigned int size = (hashinfo->ehash_locks_mask + 1) *
+                                                       sizeof(rwlock_t);
+               if (size > PAGE_SIZE)
+                       vfree(hashinfo->ehash_locks);
+               else
+#endif
+               kfree(hashinfo->ehash_locks);
+               hashinfo->ehash_locks = NULL;
+       }
+}
+
 extern struct inet_bind_bucket *
                    inet_bind_bucket_create(struct kmem_cache *cachep,
                                            struct inet_bind_hashbucket *head,
@@ -222,7 +280,7 @@ static inline void __inet_hash(struct inet_hashinfo *hashinfo,
                sk->sk_hash = inet_sk_ehashfn(sk);
                head = inet_ehash_bucket(hashinfo, sk->sk_hash);
                list = &head->chain;
-               lock = &head->lock;
+               lock = inet_ehash_lockp(hashinfo, sk->sk_hash);
                write_lock(lock);
        }
        __sk_add_node(sk, list);
@@ -253,7 +311,7 @@ static inline void inet_unhash(struct inet_hashinfo *hashinfo, struct sock *sk)
                inet_listen_wlock(hashinfo);
                lock = &hashinfo->lhash_lock;
        } else {
-               lock = &inet_ehash_bucket(hashinfo, sk->sk_hash)->lock;
+               lock = inet_ehash_lockp(hashinfo, sk->sk_hash);
                write_lock_bh(lock);
        }
 
@@ -354,9 +412,10 @@ static inline struct sock *
         */
        unsigned int hash = inet_ehashfn(daddr, hnum, saddr, sport);
        struct inet_ehash_bucket *head = inet_ehash_bucket(hashinfo, hash);
+       rwlock_t *lock = inet_ehash_lockp(hashinfo, hash);
 
        prefetch(head->chain.first);
-       read_lock(&head->lock);
+       read_lock(lock);
        sk_for_each(sk, node, &head->chain) {
                if (INET_MATCH(sk, hash, acookie, saddr, daddr, ports, dif))
                        goto hit; /* You sunk my battleship! */
@@ -369,7 +428,7 @@ static inline struct sock *
        }
        sk = NULL;
 out:
-       read_unlock(&head->lock);
+       read_unlock(lock);
        return sk;
 hit:
        sock_hold(sk);
index aa10a8178e7011532d63e66ef0d0d08dfc583634..ad8404b5611372bbecc7b1759463bb817e8051df 100644 (file)
@@ -22,7 +22,7 @@ struct inet_peer
        __be32                  v4daddr;        /* peer's address */
        __u16                   avl_height;
        __u16                   ip_id_count;    /* IP ID for the next packet */
-       struct inet_peer        *unused_next, **unused_prevp;
+       struct list_head        unused;
        __u32                   dtime;          /* the time of last use of not
                                                 * referenced entries */
        atomic_t                refcnt;
index 8cadc77c7df4bfbd58d02c3b03ecddc01d9e85af..ed514bfb61ba066edc9c560eccdd7d468ac694c5 100644 (file)
@@ -185,6 +185,12 @@ static inline void fib_select_default(const struct flowi *flp, struct fib_result
 }
 
 #else /* CONFIG_IP_MULTIPLE_TABLES */
+extern void __init fib4_rules_init(void);
+
+#ifdef CONFIG_NET_CLS_ROUTE
+extern u32 fib_rules_tclass(struct fib_result *res);
+#endif
+
 #define ip_fib_local_table fib_get_table(RT_TABLE_LOCAL)
 #define ip_fib_main_table fib_get_table(RT_TABLE_MAIN)
 
@@ -214,15 +220,6 @@ extern __be32  __fib_res_prefsrc(struct fib_result *res);
 /* Exported by fib_hash.c */
 extern struct fib_table *fib_hash_init(u32 id);
 
-#ifdef CONFIG_IP_MULTIPLE_TABLES
-extern void __init fib4_rules_init(void);
-
-#ifdef CONFIG_NET_CLS_ROUTE
-extern u32 fib_rules_tclass(struct fib_result *res);
-#endif
-
-#endif
-
 static inline void fib_combine_itag(u32 *itag, struct fib_result *res)
 {
 #ifdef CONFIG_NET_CLS_ROUTE
index 41870564df8eb163d6eef78876c01dad8a06788b..8a7d59be8a0d0e4886d9384215b315a1f1f320a1 100644 (file)
@@ -327,40 +327,6 @@ extern int ip_vs_get_debug_level(void);
 #define FTPPORT  __constant_htons(21)
 #define FTPDATA  __constant_htons(20)
 
-/*
- *      IPVS sysctl variables under the /proc/sys/net/ipv4/vs/
- */
-#define NET_IPV4_VS              21
-
-enum {
-       NET_IPV4_VS_DEBUG_LEVEL=1,
-       NET_IPV4_VS_AMEMTHRESH=2,
-       NET_IPV4_VS_AMDROPRATE=3,
-       NET_IPV4_VS_DROP_ENTRY=4,
-       NET_IPV4_VS_DROP_PACKET=5,
-       NET_IPV4_VS_SECURE_TCP=6,
-       NET_IPV4_VS_TO_ES=7,
-       NET_IPV4_VS_TO_SS=8,
-       NET_IPV4_VS_TO_SR=9,
-       NET_IPV4_VS_TO_FW=10,
-       NET_IPV4_VS_TO_TW=11,
-       NET_IPV4_VS_TO_CL=12,
-       NET_IPV4_VS_TO_CW=13,
-       NET_IPV4_VS_TO_LA=14,
-       NET_IPV4_VS_TO_LI=15,
-       NET_IPV4_VS_TO_SA=16,
-       NET_IPV4_VS_TO_UDP=17,
-       NET_IPV4_VS_TO_ICMP=18,
-       NET_IPV4_VS_LBLC_EXPIRE=19,
-       NET_IPV4_VS_LBLCR_EXPIRE=20,
-       NET_IPV4_VS_CACHE_BYPASS=22,
-       NET_IPV4_VS_EXPIRE_NODEST_CONN=23,
-       NET_IPV4_VS_SYNC_THRESHOLD=24,
-       NET_IPV4_VS_NAT_ICMP_SEND=25,
-       NET_IPV4_VS_EXPIRE_QUIESCENT_TEMPLATE=26,
-       NET_IPV4_VS_LAST
-};
-
 /*
  *      TCP State Values
  */
@@ -520,6 +486,10 @@ struct ip_vs_conn {
        spinlock_t              lock;           /* lock for state transition */
        volatile __u16          flags;          /* status flags */
        volatile __u16          state;          /* state info */
+       volatile __u16          old_state;      /* old state, to be used for
+                                                * state transition triggerd
+                                                * synchronization
+                                                */
 
        /* Control members */
        struct ip_vs_conn       *control;       /* Master control connection */
@@ -901,6 +871,10 @@ extern int ip_vs_use_count_inc(void);
 extern void ip_vs_use_count_dec(void);
 extern int ip_vs_control_init(void);
 extern void ip_vs_control_cleanup(void);
+extern struct ip_vs_dest *
+ip_vs_find_dest(__be32 daddr, __be16 dport,
+                __be32 vaddr, __be16 vport, __u16 protocol);
+extern struct ip_vs_dest *ip_vs_try_bind_dest(struct ip_vs_conn *cp);
 
 
 /*
index 5fcc4c1043401cac93ab97a96a5fcb97da0ca031..17b60391fcd66c7ba94ff14b44c0139881412b8b 100644 (file)
@@ -706,11 +706,16 @@ enum ieee80211_hw_flags {
  *
  * @queues: number of available hardware transmit queues for
  *     data packets. WMM/QoS requires at least four.
+ *
+ * @rate_control_algorithm: rate control algorithm for this hardware.
+ *     If unset (NULL), the default algorithm will be used. Must be
+ *     set before calling ieee80211_register_hw().
  */
 struct ieee80211_hw {
        struct ieee80211_conf conf;
        struct wiphy *wiphy;
        struct workqueue_struct *workqueue;
+       const char *rate_control_algorithm;
        void *priv;
        u32 flags;
        unsigned int extra_tx_headroom;
@@ -936,27 +941,11 @@ enum ieee80211_erp_change_flags {
  *     and remove_interface calls, i.e. while the interface with the
  *     given local_address is enabled.
  *
- * @set_ieee8021x: Enable/disable IEEE 802.1X. This item requests wlan card
- *     to pass unencrypted EAPOL-Key frames even when encryption is
- *     configured. If the wlan card does not require such a configuration,
- *     this function pointer can be set to NULL.
- *
- * @set_port_auth: Set port authorization state (IEEE 802.1X PAE) to be
- *     authorized (@authorized=1) or unauthorized (=0). This function can be
- *     used if the wlan hardware or low-level driver implements PAE.
- *     mac80211 will filter frames based on authorization state in any case,
- *     so this function pointer can be NULL if low-level driver does not
- *     require event notification about port state changes.
- *
  * @hw_scan: Ask the hardware to service the scan request, no need to start
  *     the scan state machine in stack.
  *
  * @get_stats: return low-level statistics
  *
- * @set_privacy_invoked: For devices that generate their own beacons and probe
- *     response or association responses this updates the state of privacy_invoked
- *     returns 0 for success or an error number.
- *
  * @get_sequence_counter: For devices that have internal sequence counters this
  *     callback allows mac80211 to access the current value of a counter.
  *     This callback seems not well-defined, tell us if you need it.
@@ -1029,14 +1018,9 @@ struct ieee80211_ops {
        int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd,
                       const u8 *local_address, const u8 *address,
                       struct ieee80211_key_conf *key);
-       int (*set_ieee8021x)(struct ieee80211_hw *hw, int use_ieee8021x);
-       int (*set_port_auth)(struct ieee80211_hw *hw, u8 *addr,
-                            int authorized);
        int (*hw_scan)(struct ieee80211_hw *hw, u8 *ssid, size_t len);
        int (*get_stats)(struct ieee80211_hw *hw,
                         struct ieee80211_low_level_stats *stats);
-       int (*set_privacy_invoked)(struct ieee80211_hw *hw,
-                                  int privacy_invoked);
        int (*get_sequence_counter)(struct ieee80211_hw *hw,
                                    u8* addr, u8 keyidx, u8 txrx,
                                    u32* iv32, u16* iv16);
index 5279466606d2bb33625431c4d6f000ddbbbd9c29..5dd6d90b37eb778dfffde65e4998b0bdb8c8d13b 100644 (file)
@@ -51,13 +51,12 @@ static inline struct net *copy_net_ns(unsigned long flags, struct net *net_ns)
 }
 #endif
 
+#ifdef CONFIG_NET_NS
 extern void __put_net(struct net *net);
 
 static inline struct net *get_net(struct net *net)
 {
-#ifdef CONFIG_NET
        atomic_inc(&net->count);
-#endif
        return net;
 }
 
@@ -75,26 +74,44 @@ static inline struct net *maybe_get_net(struct net *net)
 
 static inline void put_net(struct net *net)
 {
-#ifdef CONFIG_NET
        if (atomic_dec_and_test(&net->count))
                __put_net(net);
-#endif
 }
 
 static inline struct net *hold_net(struct net *net)
 {
-#ifdef CONFIG_NET
        atomic_inc(&net->use_count);
-#endif
        return net;
 }
 
 static inline void release_net(struct net *net)
 {
-#ifdef CONFIG_NET
        atomic_dec(&net->use_count);
-#endif
 }
+#else
+static inline struct net *get_net(struct net *net)
+{
+       return net;
+}
+
+static inline void put_net(struct net *net)
+{
+}
+
+static inline struct net *hold_net(struct net *net)
+{
+       return net;
+}
+
+static inline void release_net(struct net *net)
+{
+}
+
+static inline struct net *maybe_get_net(struct net *net)
+{
+       return net;
+}
+#endif
 
 #define for_each_net(VAR)                              \
        list_for_each_entry(VAR, &net_namespace_list, list)
@@ -102,9 +119,11 @@ static inline void release_net(struct net *net)
 #ifdef CONFIG_NET_NS
 #define __net_init
 #define __net_exit
+#define __net_initdata
 #else
 #define __net_init     __init
 #define __net_exit     __exit_refok
+#define __net_initdata __initdata
 #endif
 
 struct pernet_operations {
index 7aed02ce2b65b502dd97f72f91417ed5c78e5ca8..cff4608179c12c2f4f19be4ee04d787af0aa9d71 100644 (file)
@@ -124,23 +124,7 @@ struct request_sock_queue {
 extern int reqsk_queue_alloc(struct request_sock_queue *queue,
                             unsigned int nr_table_entries);
 
-static inline struct listen_sock *reqsk_queue_yank_listen_sk(struct request_sock_queue *queue)
-{
-       struct listen_sock *lopt;
-
-       write_lock_bh(&queue->syn_wait_lock);
-       lopt = queue->listen_opt;
-       queue->listen_opt = NULL;
-       write_unlock_bh(&queue->syn_wait_lock);
-
-       return lopt;
-}
-
-static inline void __reqsk_queue_destroy(struct request_sock_queue *queue)
-{
-       kfree(reqsk_queue_yank_listen_sk(queue));
-}
-
+extern void __reqsk_queue_destroy(struct request_sock_queue *queue);
 extern void reqsk_queue_destroy(struct request_sock_queue *queue);
 
 static inline struct request_sock *
index 9e8f13b7da5ae148e24c585c532f8940351a9c98..5db261a1e85e671bcbf907325e68ab5b4e3aeddf 100644 (file)
@@ -103,7 +103,7 @@ struct sctp_hmac *sctp_auth_asoc_get_hmac(const struct sctp_association *asoc);
 void sctp_auth_asoc_set_default_hmac(struct sctp_association *asoc,
                                     struct sctp_hmac_algo_param *hmacs);
 int sctp_auth_asoc_verify_hmac_id(const struct sctp_association *asoc,
-                                   __u16 hmac_id);
+                                   __be16 hmac_id);
 int sctp_auth_send_cid(sctp_cid_t chunk, const struct sctp_association *asoc);
 int sctp_auth_recv_cid(sctp_cid_t chunk, const struct sctp_association *asoc);
 void sctp_auth_calculate_hmac(const struct sctp_association *asoc,
index b8733364557ff6d78403584c383a2a2e4334044c..c1f79767357196aecd1aff0235a0445605fe1edd 100644 (file)
@@ -103,6 +103,7 @@ typedef enum {
        SCTP_CMD_ASSOC_CHANGE,   /* generate and send assoc_change event */
        SCTP_CMD_ADAPTATION_IND, /* generate and send adaptation event */
        SCTP_CMD_ASSOC_SHKEY,    /* generate the association shared keys */
+       SCTP_CMD_T1_RETRAN,      /* Mark for retransmission after T1 timeout  */
        SCTP_CMD_LAST
 } sctp_verb_t;
 
index da8354e8e33c5269fa92ab4a1dd4a8f4d4971ad8..f30b537d69525168e078a2eb8a0c39a51ef6bdc1 100644 (file)
@@ -186,6 +186,8 @@ typedef enum {
        SCTP_IERROR_AUTH_BAD_HMAC,
        SCTP_IERROR_AUTH_BAD_KEYID,
        SCTP_IERROR_PROTO_VIOLATION,
+       SCTP_IERROR_ERROR,
+       SCTP_IERROR_ABORT,
 } sctp_ierror_t;
 
 
@@ -407,6 +409,7 @@ typedef enum {
        SCTP_RTXR_T3_RTX,
        SCTP_RTXR_FAST_RTX,
        SCTP_RTXR_PMTUD,
+       SCTP_RTXR_T1_RTX,
 } sctp_retransmit_reason_t;
 
 /* Reasons to lower cwnd. */
index 93eb708609e7ef588c3ee517ba80d106c481c140..34318a33a94c0471126a763439fe62ce695aa008 100644 (file)
@@ -65,7 +65,6 @@
 
 
 #ifdef TEST_FRAME
-#undef CONFIG_PROC_FS
 #undef CONFIG_SCTP_DBG_OBJCNT
 #undef CONFIG_SYSCTL
 #endif /* TEST_FRAME */
@@ -267,6 +266,7 @@ enum
        SCTP_MIB_T5_SHUTDOWN_GUARD_EXPIREDS,
        SCTP_MIB_DELAY_SACK_EXPIREDS,
        SCTP_MIB_AUTOCLOSE_EXPIREDS,
+       SCTP_MIB_T1_RETRANSMITS,
        SCTP_MIB_T3_RETRANSMITS,
        SCTP_MIB_PMTUD_RETRANSMITS,
        SCTP_MIB_FAST_RETRANSMITS,
@@ -664,6 +664,9 @@ static inline int sctp_vtag_hashfn(__u16 lport, __u16 rport, __u32 vtag)
        return (h & (sctp_assoc_hashsize-1));
 }
 
+#define sctp_for_each_hentry(epb, node, head) \
+       hlist_for_each_entry(epb, node, head, node)
+
 /* Is a socket of this style? */
 #define sctp_style(sk, style) __sctp_style((sk), (SCTP_SOCKET_##style))
 static inline int __sctp_style(const struct sock *sk, sctp_socket_type_t style)
index ef892e00c83365acdccb3810158277364b5ddae9..eb3113c38a943469c74b76163f6ee448b528d66f 100644 (file)
@@ -100,20 +100,19 @@ struct crypto_hash;
 struct sctp_bind_bucket {
        unsigned short  port;
        unsigned short  fastreuse;
-       struct sctp_bind_bucket *next;
-       struct sctp_bind_bucket **pprev;
+       struct hlist_node       node;
        struct hlist_head       owner;
 };
 
 struct sctp_bind_hashbucket {
        spinlock_t      lock;
-       struct sctp_bind_bucket *chain;
+       struct hlist_head       chain;
 };
 
 /* Used for hashing all associations.  */
 struct sctp_hashbucket {
        rwlock_t        lock;
-       struct sctp_ep_common  *chain;
+       struct hlist_head       chain;
 } __attribute__((__aligned__(8)));
 
 
@@ -212,6 +211,7 @@ extern struct sctp_globals {
        
        /* Flag to indicate if addip is enabled. */
        int addip_enable;
+       int addip_noauth_enable;
 
        /* Flag to indicate if PR-SCTP is enabled. */
        int prsctp_enable;
@@ -249,6 +249,7 @@ extern struct sctp_globals {
 #define sctp_local_addr_list           (sctp_globals.local_addr_list)
 #define sctp_local_addr_lock           (sctp_globals.addr_list_lock)
 #define sctp_addip_enable              (sctp_globals.addip_enable)
+#define sctp_addip_noauth              (sctp_globals.addip_noauth_enable)
 #define sctp_prsctp_enable             (sctp_globals.prsctp_enable)
 #define sctp_auth_enable               (sctp_globals.auth_enable)
 
@@ -873,10 +874,11 @@ struct sctp_transport {
         * address list derived from the INIT or INIT ACK chunk, a
         * number of data elements needs to be maintained including:
         */
-       __u32 rtt;              /* This is the most recent RTT.  */
-
        /* RTO         : The current retransmission timeout value.  */
        unsigned long rto;
+       unsigned long last_rto;
+
+       __u32 rtt;              /* This is the most recent RTT.  */
 
        /* RTTVAR      : The current RTT variation.  */
        __u32 rttvar;
@@ -1184,9 +1186,7 @@ int sctp_bind_addr_copy(struct sctp_bind_addr *dest,
                        int flags);
 int sctp_add_bind_addr(struct sctp_bind_addr *, union sctp_addr *,
                       __u8 use_as_src, gfp_t gfp);
-int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *,
-                       void fastcall (*rcu_call)(struct rcu_head *,
-                                         void (*func)(struct rcu_head *)));
+int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *);
 int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *,
                         struct sctp_sock *);
 union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr  *bp,
@@ -1229,8 +1229,7 @@ typedef enum {
 
 struct sctp_ep_common {
        /* Fields to help us manage our entries in the hash tables. */
-       struct sctp_ep_common *next;
-       struct sctp_ep_common **pprev;
+       struct hlist_node node;
        int hashent;
 
        /* Runtime type information.  What kind of endpoint is this? */
@@ -1541,7 +1540,6 @@ struct sctp_association {
                __u8    asconf_capable;  /* Does peer support ADDIP? */
                __u8    prsctp_capable;  /* Can peer do PR-SCTP? */
                __u8    auth_capable;    /* Is peer doing SCTP-AUTH? */
-               __u8    addip_capable;   /* Can peer do ADD-IP */
 
                __u32   adaptation_ind;  /* Adaptation Code point. */
 
index 43fc3fa50d6237227e5bec82bc0b4e8e0d4ce8b7..67e35c7e230c42a08bb718e6508d3826dbbe6cdd 100644 (file)
@@ -560,6 +560,14 @@ struct proto {
        void                    (*unhash)(struct sock *sk);
        int                     (*get_port)(struct sock *sk, unsigned short snum);
 
+#ifdef CONFIG_SMP
+       /* Keeping track of sockets in use */
+       void                    (*inuse_add)(struct proto *prot, int inc);
+       int                     (*inuse_getval)(const struct proto *prot);
+       int                     *inuse_ptr;
+#else
+       int                     inuse;
+#endif
        /* Memory pressure */
        void                    (*enter_memory_pressure)(void);
        atomic_t                *memory_allocated;      /* Current allocated memory. */
@@ -592,12 +600,38 @@ struct proto {
 #ifdef SOCK_REFCNT_DEBUG
        atomic_t                socks;
 #endif
-       struct {
-               int inuse;
-               u8  __pad[SMP_CACHE_BYTES - sizeof(int)];
-       } stats[NR_CPUS];
 };
 
+/*
+ * Special macros to let protos use a fast version of inuse{get|add}
+ * using a static percpu variable per proto instead of an allocated one,
+ * saving one dereference.
+ * This might be changed if/when dynamic percpu vars become fast.
+ */
+#ifdef CONFIG_SMP
+# define DEFINE_PROTO_INUSE(NAME)                      \
+static DEFINE_PER_CPU(int, NAME##_inuse);              \
+static void NAME##_inuse_add(struct proto *prot, int inc)      \
+{                                                      \
+       __get_cpu_var(NAME##_inuse) += inc;             \
+}                                                      \
+                                                       \
+static int NAME##_inuse_getval(const struct proto *prot)\
+{                                                      \
+       int res = 0, cpu;                               \
+                                                       \
+       for_each_possible_cpu(cpu)                      \
+               res += per_cpu(NAME##_inuse, cpu);      \
+       return res;                                     \
+}
+# define REF_PROTO_INUSE(NAME)                         \
+       .inuse_add = NAME##_inuse_add,                  \
+       .inuse_getval = NAME##_inuse_getval,
+#else
+# define DEFINE_PROTO_INUSE(NAME)
+# define REF_PROTO_INUSE(NAME)
+#endif
+
 extern int proto_register(struct proto *prot, int alloc_slab);
 extern void proto_unregister(struct proto *prot);
 
@@ -629,12 +663,29 @@ static inline void sk_refcnt_debug_release(const struct sock *sk)
 /* Called with local bh disabled */
 static __inline__ void sock_prot_inc_use(struct proto *prot)
 {
-       prot->stats[smp_processor_id()].inuse++;
+#ifdef CONFIG_SMP
+       prot->inuse_add(prot, 1);
+#else
+       prot->inuse++;
+#endif
 }
 
 static __inline__ void sock_prot_dec_use(struct proto *prot)
 {
-       prot->stats[smp_processor_id()].inuse--;
+#ifdef CONFIG_SMP
+       prot->inuse_add(prot, -1);
+#else
+       prot->inuse--;
+#endif
+}
+
+static __inline__ int sock_prot_inuse(struct proto *proto)
+{
+#ifdef CONFIG_SMP
+       return proto->inuse_getval(proto);
+#else
+       return proto->inuse;
+#endif
 }
 
 /* With per-bucket locks this operation is not-atomic, so that
@@ -779,7 +830,7 @@ extern void FASTCALL(release_sock(struct sock *sk));
 
 extern struct sock             *sk_alloc(struct net *net, int family,
                                          gfp_t priority,
-                                         struct proto *prot, int zero_it);
+                                         struct proto *prot);
 extern void                    sk_free(struct sock *sk);
 extern struct sock             *sk_clone(const struct sock *sk,
                                          const gfp_t priority);
@@ -993,20 +1044,6 @@ static inline void sock_graft(struct sock *sk, struct socket *parent)
        write_unlock_bh(&sk->sk_callback_lock);
 }
 
-static inline void sock_copy(struct sock *nsk, const struct sock *osk)
-{
-#ifdef CONFIG_SECURITY_NETWORK
-       void *sptr = nsk->sk_security;
-#endif
-
-       memcpy(nsk, osk, osk->sk_prot->obj_size);
-       get_net(nsk->sk_net);
-#ifdef CONFIG_SECURITY_NETWORK
-       nsk->sk_security = sptr;
-       security_sk_clone(osk, nsk);
-#endif
-}
-
 extern int sock_i_uid(struct sock *sk);
 extern unsigned long sock_i_ino(struct sock *sk);
 
@@ -1198,14 +1235,19 @@ static inline struct sk_buff *sk_stream_alloc_pskb(struct sock *sk,
                                                   gfp_t gfp)
 {
        struct sk_buff *skb;
-       int hdr_len;
 
-       hdr_len = SKB_DATA_ALIGN(sk->sk_prot->max_header);
-       skb = alloc_skb_fclone(size + hdr_len, gfp);
+       /* The TCP header must be at least 32-bit aligned.  */
+       size = ALIGN(size, 4);
+
+       skb = alloc_skb_fclone(size + sk->sk_prot->max_header, gfp);
        if (skb) {
                skb->truesize += mem;
                if (sk_stream_wmem_schedule(sk, skb->truesize)) {
-                       skb_reserve(skb, hdr_len);
+                       /*
+                        * Make sure that we have exactly size bytes
+                        * available to the caller, no more, no less.
+                        */
+                       skb_reserve(skb, skb_tailroom(skb) - size);
                        return skb;
                }
                __kfree_skb(skb);
index d695cea7730da4a4bd16da6c0ce7bfcf2680767f..cb5b033e0e59c205980243d2b7e494db0925f218 100644 (file)
@@ -1288,6 +1288,9 @@ static inline void tcp_insert_write_queue_before(struct sk_buff *new,
                                                  struct sock *sk)
 {
        __skb_insert(new, skb->prev, skb, &sk->sk_write_queue);
+
+       if (sk->sk_send_head == skb)
+               sk->sk_send_head = new;
 }
 
 static inline void tcp_unlink_write_queue(struct sk_buff *skb, struct sock *sk)
index c1d1629fcd272a038bc359f81d9fa700eb4d8524..5f388035687de5004d11d42fbb436abb08fb325b 100644 (file)
@@ -21,7 +21,7 @@
 #include <sys/types.h>
 #endif
 
-#if defined(__arm__) || defined(__mips__)
+#if defined(__arm__) || defined(__mips__) || defined(__avr32__)
 /* This (ioaddr_t) is exposed to userspace & hence cannot be changed. */
 typedef u_int   ioaddr_t;
 #else
index 4bea182d7116c4aa80e863ed2d5a59fed24967e0..11f39606e7d94c64c1a63c6e5772dbca944a538c 100644 (file)
@@ -48,9 +48,9 @@
 #include <linux/kref.h>
 #include <linux/list.h>
 #include <linux/rwsem.h>
+#include <linux/scatterlist.h>
 
 #include <asm/atomic.h>
-#include <asm/scatterlist.h>
 #include <asm/uaccess.h>
 
 union ib_gid {
index 8dda2d66b5b92bcb61fd03c3e5fde16ce4bdb3ff..a466c2cb8955b5f0955a7a194b44475abfce3e31 100644 (file)
@@ -36,7 +36,7 @@
 #include <scsi/scsi_device.h>
 #include <scsi/scsi_cmnd.h>
 #include <scsi/scsi_transport_sas.h>
-#include <asm/scatterlist.h>
+#include <linux/scatterlist.h>
 
 struct block_device;
 
index d5057bc338ff98dcab79748efe00d34eededf904..66e9058357e02d85d8617b9cd58edf893fff0b30 100644 (file)
@@ -46,6 +46,22 @@ enum scsi_device_state {
                                 * to the scsi lld. */
 };
 
+enum scsi_device_event {
+       SDEV_EVT_MEDIA_CHANGE   = 1,    /* media has changed */
+
+       SDEV_EVT_LAST           = SDEV_EVT_MEDIA_CHANGE,
+       SDEV_EVT_MAXBITS        = SDEV_EVT_LAST + 1
+};
+
+struct scsi_event {
+       enum scsi_device_event  evt_type;
+       struct list_head        node;
+
+       /* put union of data structures, for non-simple event types,
+        * here
+        */
+};
+
 struct scsi_device {
        struct Scsi_Host *host;
        struct request_queue *request_queue;
@@ -127,6 +143,10 @@ struct scsi_device {
        unsigned guess_capacity:1;      /* READ_CAPACITY might be too high by 1 */
        unsigned retry_hwerror:1;       /* Retry HARDWARE_ERROR */
 
+       DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */
+       struct list_head event_list;    /* asserted events */
+       struct work_struct event_work;
+
        unsigned int device_blocked;    /* Device returned QUEUE_FULL. */
 
        unsigned int max_device_blocked; /* what device_blocked counts down from  */
@@ -275,6 +295,11 @@ extern int scsi_test_unit_ready(struct scsi_device *sdev, int timeout,
                                int retries);
 extern int scsi_device_set_state(struct scsi_device *sdev,
                                 enum scsi_device_state state);
+extern struct scsi_event *sdev_evt_alloc(enum scsi_device_event evt_type,
+                                         gfp_t gfpflags);
+extern void sdev_evt_send(struct scsi_device *sdev, struct scsi_event *evt);
+extern void sdev_evt_send_simple(struct scsi_device *sdev,
+                         enum scsi_device_event evt_type, gfp_t gfpflags);
 extern int scsi_device_quiesce(struct scsi_device *sdev);
 extern void scsi_device_resume(struct scsi_device *sdev);
 extern void scsi_target_quiesce(struct scsi_target *);
index a2be8ad8894b2d7386104ac6fa3193e1ddf61abe..a9781eb0da09be35cfcb2e6068a4cf14653028e8 100644 (file)
@@ -1,3 +1,3 @@
 /* include/version.h.  Generated by alsa/ksync script.  */
 #define CONFIG_SND_VERSION "1.0.15"
-#define CONFIG_SND_DATE " (Tue Oct 23 06:09:18 2007 UTC)"
+#define CONFIG_SND_DATE " (Tue Nov 20 19:16:42 2007 UTC)"
index 8b88d0bedcbdeeb7bc08f3592bb3efdb0291c6bd..d35e44f4dd6b287342ae51a0e89bd59f127b3952 100644 (file)
@@ -215,6 +215,18 @@ config USER_NS
          vservers, to use user namespaces to provide different
          user info for different servers.  If unsure, say N.
 
+config PID_NS
+       bool "PID Namespaces (EXPERIMENTAL)"
+       default n
+       depends on EXPERIMENTAL
+       help
+         Suport process id namespaces.  This allows having multiple
+         process with the same pid as long as they are in different
+         pid namespaces.  This is a building block of containers.
+
+         Unless you want to work with an experimental feature
+         say N here.
+
 config AUDIT
        bool "Auditing support"
        depends on NET
@@ -301,13 +313,6 @@ config CGROUP_NS
           for instance virtual servers and checkpoint/restart
           jobs.
 
-config CGROUP_CPUACCT
-       bool "Simple CPU accounting cgroup subsystem"
-       depends on CGROUPS
-       help
-         Provides a simple Resource Controller for monitoring the
-         total CPU consumed by the tasks in a cgroup
-
 config CPUSETS
        bool "Cpuset support"
        depends on SMP && CGROUPS
@@ -433,7 +438,7 @@ menuconfig EMBEDDED
 
 config UID16
        bool "Enable 16-bit UID system calls" if EMBEDDED
-       depends on ARM || BFIN || CRIS || FRV || H8300 || X86_32 || M68K || (S390 && !64BIT) || SUPERH || SPARC32 || (SPARC64 && SPARC32_COMPAT) || UML || (X86_64 && IA32_EMULATION)
+       depends on ARM || BLACKFIN || CRIS || FRV || H8300 || X86_32 || M68K || (S390 && !64BIT) || SUPERH || SPARC32 || (SPARC64 && SPARC32_COMPAT) || UML || (X86_64 && IA32_EMULATION)
        default y
        help
          This enables the legacy 16-bit UID syscall wrappers.
index f605a969ea6141281891bb007edc41938c63e3f1..80b04b6c5157c85151669fdfe2864c16f876680e 100644 (file)
@@ -56,6 +56,7 @@
 #include <linux/pid_namespace.h>
 #include <linux/device.h>
 #include <linux/kthread.h>
+#include <linux/sched.h>
 
 #include <asm/io.h>
 #include <asm/bugs.h>
@@ -747,11 +748,8 @@ __setup("nosoftlockup", nosoftlockup_setup);
 static void __init do_pre_smp_initcalls(void)
 {
        extern int spawn_ksoftirqd(void);
-#ifdef CONFIG_SMP
-       extern int migration_init(void);
 
        migration_init();
-#endif
        spawn_ksoftirqd();
        if (!nosoftlockup)
                spawn_softlockup_task();
index bfa274ba9ed40267201bee1f6fc45c4d5a5f213b..1e04cd464af9b5ad961684dd358a97870bc36323 100644 (file)
@@ -1010,6 +1010,8 @@ asmlinkage long sys_mq_notify(mqd_t mqdes,
                        return -EINVAL;
                }
                if (notification.sigev_notify == SIGEV_THREAD) {
+                       long timeo;
+
                        /* create the notify skb */
                        nc = alloc_skb(NOTIFY_COOKIE_LEN, GFP_KERNEL);
                        ret = -ENOMEM;
@@ -1038,8 +1040,8 @@ retry:
                                goto out;
                        }
 
-                       ret = netlink_attachskb(sock, nc, 0,
-                                       MAX_SCHEDULE_TIMEOUT, NULL);
+                       timeo = MAX_SCHEDULE_TIMEOUT;
+                       ret = netlink_attachskb(sock, nc, 0, &timeo, NULL);
                        if (ret == 1)
                                goto retry;
                        if (ret) {
index f60afe74259912d0f5c57d41736a812bd44eef2f..dfa96956dae0869c93f287b4c7348428eacaf8f3 100644 (file)
@@ -40,7 +40,6 @@ obj-$(CONFIG_COMPAT) += compat.o
 obj-$(CONFIG_CGROUPS) += cgroup.o
 obj-$(CONFIG_CGROUP_DEBUG) += cgroup_debug.o
 obj-$(CONFIG_CPUSETS) += cpuset.o
-obj-$(CONFIG_CGROUP_CPUACCT) += cpu_acct.o
 obj-$(CONFIG_CGROUP_NS) += ns_cgroup.o
 obj-$(CONFIG_IKCONFIG) += configs.o
 obj-$(CONFIG_STOP_MACHINE) += stop_machine.o
index fce53d8df8a7ade114a002885a8cbfc1cdbedc49..cf19547cc9e42d346c49b0e51e89aa5fb19364d6 100644 (file)
@@ -413,7 +413,7 @@ static u32 encode_float(u64 value)
  *  The acct_process() call is the workhorse of the process
  *  accounting system. The struct acct is built here and then written
  *  into the accounting file. This function should only be called from
- *  do_exit().
+ *  do_exit() or when switching to a different output file.
  */
 
 /*
index 3fe21e19c96e3a51adfa6c462f188bdf6ca407b7..1a3c23936d43d99ec3d429123c95182a94de0c02 100644 (file)
@@ -1,6 +1,4 @@
 /*
- *  kernel/cgroup.c
- *
  *  Generic process-grouping system.
  *
  *  Based originally on the cpuset system, extracted by Paul Menage
@@ -2200,7 +2198,8 @@ static void cgroup_init_subsys(struct cgroup_subsys *ss)
 {
        struct cgroup_subsys_state *css;
        struct list_head *l;
-       printk(KERN_ERR "Initializing cgroup subsys %s\n", ss->name);
+
+       printk(KERN_INFO "Initializing cgroup subsys %s\n", ss->name);
 
        /* Create the top cgroup state for this subsystem */
        ss->root = &rootnode;
@@ -2273,7 +2272,7 @@ int __init cgroup_init_early(void)
                BUG_ON(!ss->create);
                BUG_ON(!ss->destroy);
                if (ss->subsys_id != i) {
-                       printk(KERN_ERR "Subsys %s id == %d\n",
+                       printk(KERN_ERR "cgroup: Subsys %s id == %d\n",
                               ss->name, ss->subsys_id);
                        BUG();
                }
@@ -2605,7 +2604,7 @@ int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *subsys)
        dentry = lookup_one_len(nodename, parent->dentry, strlen(nodename));
        if (IS_ERR(dentry)) {
                printk(KERN_INFO
-                      "Couldn't allocate dentry for %s: %ld\n", nodename,
+                      "cgroup: Couldn't allocate dentry for %s: %ld\n", nodename,
                       PTR_ERR(dentry));
                ret = PTR_ERR(dentry);
                goto out_release;
diff --git a/kernel/cpu_acct.c b/kernel/cpu_acct.c
deleted file mode 100644 (file)
index 731e47e..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * kernel/cpu_acct.c - CPU accounting cgroup subsystem
- *
- * Copyright (C) Google Inc, 2006
- *
- * Developed by Paul Menage (menage@google.com) and Balbir Singh
- * (balbir@in.ibm.com)
- *
- */
-
-/*
- * Example cgroup subsystem for reporting total CPU usage of tasks in a
- * cgroup, along with percentage load over a time interval
- */
-
-#include <linux/module.h>
-#include <linux/cgroup.h>
-#include <linux/fs.h>
-#include <linux/rcupdate.h>
-
-#include <asm/div64.h>
-
-struct cpuacct {
-       struct cgroup_subsys_state css;
-       spinlock_t lock;
-       /* total time used by this class */
-       cputime64_t time;
-
-       /* time when next load calculation occurs */
-       u64 next_interval_check;
-
-       /* time used in current period */
-       cputime64_t current_interval_time;
-
-       /* time used in last period */
-       cputime64_t last_interval_time;
-};
-
-struct cgroup_subsys cpuacct_subsys;
-
-static inline struct cpuacct *cgroup_ca(struct cgroup *cont)
-{
-       return container_of(cgroup_subsys_state(cont, cpuacct_subsys_id),
-                           struct cpuacct, css);
-}
-
-static inline struct cpuacct *task_ca(struct task_struct *task)
-{
-       return container_of(task_subsys_state(task, cpuacct_subsys_id),
-                           struct cpuacct, css);
-}
-
-#define INTERVAL (HZ * 10)
-
-static inline u64 next_interval_boundary(u64 now)
-{
-       /* calculate the next interval boundary beyond the
-        * current time */
-       do_div(now, INTERVAL);
-       return (now + 1) * INTERVAL;
-}
-
-static struct cgroup_subsys_state *cpuacct_create(
-       struct cgroup_subsys *ss, struct cgroup *cont)
-{
-       struct cpuacct *ca = kzalloc(sizeof(*ca), GFP_KERNEL);
-
-       if (!ca)
-               return ERR_PTR(-ENOMEM);
-       spin_lock_init(&ca->lock);
-       ca->next_interval_check = next_interval_boundary(get_jiffies_64());
-       return &ca->css;
-}
-
-static void cpuacct_destroy(struct cgroup_subsys *ss,
-                           struct cgroup *cont)
-{
-       kfree(cgroup_ca(cont));
-}
-
-/* Lazily update the load calculation if necessary. Called with ca locked */
-static void cpuusage_update(struct cpuacct *ca)
-{
-       u64 now = get_jiffies_64();
-
-       /* If we're not due for an update, return */
-       if (ca->next_interval_check > now)
-               return;
-
-       if (ca->next_interval_check <= (now - INTERVAL)) {
-               /* If it's been more than an interval since the last
-                * check, then catch up - the last interval must have
-                * been zero load */
-               ca->last_interval_time = 0;
-               ca->next_interval_check = next_interval_boundary(now);
-       } else {
-               /* If a steal takes the last interval time negative,
-                * then we just ignore it */
-               if ((s64)ca->current_interval_time > 0)
-                       ca->last_interval_time = ca->current_interval_time;
-               else
-                       ca->last_interval_time = 0;
-               ca->next_interval_check += INTERVAL;
-       }
-       ca->current_interval_time = 0;
-}
-
-static u64 cpuusage_read(struct cgroup *cont, struct cftype *cft)
-{
-       struct cpuacct *ca = cgroup_ca(cont);
-       u64 time;
-
-       spin_lock_irq(&ca->lock);
-       cpuusage_update(ca);
-       time = cputime64_to_jiffies64(ca->time);
-       spin_unlock_irq(&ca->lock);
-
-       /* Convert 64-bit jiffies to seconds */
-       time *= 1000;
-       do_div(time, HZ);
-       return time;
-}
-
-static u64 load_read(struct cgroup *cont, struct cftype *cft)
-{
-       struct cpuacct *ca = cgroup_ca(cont);
-       u64 time;
-
-       /* Find the time used in the previous interval */
-       spin_lock_irq(&ca->lock);
-       cpuusage_update(ca);
-       time = cputime64_to_jiffies64(ca->last_interval_time);
-       spin_unlock_irq(&ca->lock);
-
-       /* Convert time to a percentage, to give the load in the
-        * previous period */
-       time *= 100;
-       do_div(time, INTERVAL);
-
-       return time;
-}
-
-static struct cftype files[] = {
-       {
-               .name = "usage",
-               .read_uint = cpuusage_read,
-       },
-       {
-               .name = "load",
-               .read_uint = load_read,
-       }
-};
-
-static int cpuacct_populate(struct cgroup_subsys *ss, struct cgroup *cont)
-{
-       return cgroup_add_files(cont, ss, files, ARRAY_SIZE(files));
-}
-
-void cpuacct_charge(struct task_struct *task, cputime_t cputime)
-{
-
-       struct cpuacct *ca;
-       unsigned long flags;
-
-       if (!cpuacct_subsys.active)
-               return;
-       rcu_read_lock();
-       ca = task_ca(task);
-       if (ca) {
-               spin_lock_irqsave(&ca->lock, flags);
-               cpuusage_update(ca);
-               ca->time = cputime64_add(ca->time, cputime);
-               ca->current_interval_time =
-                       cputime64_add(ca->current_interval_time, cputime);
-               spin_unlock_irqrestore(&ca->lock, flags);
-       }
-       rcu_read_unlock();
-}
-
-struct cgroup_subsys cpuacct_subsys = {
-       .name = "cpuacct",
-       .create = cpuacct_create,
-       .destroy = cpuacct_destroy,
-       .populate = cpuacct_populate,
-       .subsys_id = cpuacct_subsys_id,
-};
index f1aec27f1df00eaae4cbb9c3f99dde1b4e1c8520..cd0f1d4137a734abb393a5ebc5a8534b2b8f882a 100644 (file)
@@ -1386,8 +1386,7 @@ static int wait_task_stopped(struct task_struct *p, int delayed_group_leader,
                int why = (p->ptrace & PT_PTRACED) ? CLD_TRAPPED : CLD_STOPPED;
 
                exit_code = p->exit_code;
-               if (unlikely(!exit_code) ||
-                   unlikely(p->state & TASK_TRACED))
+               if (unlikely(!exit_code) || unlikely(p->exit_state))
                        goto bail_ref;
                return wait_noreap_copyout(p, pid, uid,
                                           why, (exit_code << 8) | 0x7f,
index ddafdfac9456e151b2d8731b52475a5af4ca68e1..8ca1a14cdc8c12ee8e592f7913f07f22dcec3d9b 100644 (file)
@@ -1056,6 +1056,8 @@ static struct task_struct *copy_process(unsigned long clone_flags,
        p->gtime = cputime_zero;
        p->utimescaled = cputime_zero;
        p->stimescaled = cputime_zero;
+       p->prev_utime = cputime_zero;
+       p->prev_stime = cputime_zero;
 
 #ifdef CONFIG_TASK_XACCT
        p->rchar = 0;           /* I/O counter: bytes read */
@@ -1121,6 +1123,9 @@ static struct task_struct *copy_process(unsigned long clone_flags,
        p->blocked_on = NULL; /* not blocked yet */
 #endif
 
+       /* Perform scheduler related setup. Assign this task to a CPU. */
+       sched_fork(p, clone_flags);
+
        if ((retval = security_task_alloc(p)))
                goto bad_fork_cleanup_policy;
        if ((retval = audit_alloc(p)))
@@ -1210,9 +1215,6 @@ static struct task_struct *copy_process(unsigned long clone_flags,
        INIT_LIST_HEAD(&p->ptrace_children);
        INIT_LIST_HEAD(&p->ptrace_list);
 
-       /* Perform scheduler related setup. Assign this task to a CPU. */
-       sched_fork(p, clone_flags);
-
        /* Now that the task is set up, run cgroup callbacks if
         * necessary. We need to run them before the task is visible
         * on the tasklist. */
index 32710451dc20ea7763cc22d02f0363c9155a772f..9dc591ab681a92c87209463e922f1a06e8d9bfa7 100644 (file)
@@ -181,8 +181,8 @@ static inline int match_futex(union futex_key *key1, union futex_key *key2)
  * For other futexes, it points to &current->mm->mmap_sem and
  * caller must have taken the reader lock. but NOT any spinlocks.
  */
-int get_futex_key(u32 __user *uaddr, struct rw_semaphore *fshared,
-                 union futex_key *key)
+static int get_futex_key(u32 __user *uaddr, struct rw_semaphore *fshared,
+                        union futex_key *key)
 {
        unsigned long address = (unsigned long)uaddr;
        struct mm_struct *mm = current->mm;
@@ -268,14 +268,13 @@ int get_futex_key(u32 __user *uaddr, struct rw_semaphore *fshared,
        }
        return err;
 }
-EXPORT_SYMBOL_GPL(get_futex_key);
 
 /*
  * Take a reference to the resource addressed by a key.
  * Can be called while holding spinlocks.
  *
  */
-inline void get_futex_key_refs(union futex_key *key)
+static void get_futex_key_refs(union futex_key *key)
 {
        if (key->both.ptr == 0)
                return;
@@ -288,13 +287,12 @@ inline void get_futex_key_refs(union futex_key *key)
                        break;
        }
 }
-EXPORT_SYMBOL_GPL(get_futex_key_refs);
 
 /*
  * Drop a reference to the resource addressed by a key.
  * The hash bucket spinlock must not be held.
  */
-void drop_futex_key_refs(union futex_key *key)
+static void drop_futex_key_refs(union futex_key *key)
 {
        if (!key->both.ptr)
                return;
@@ -307,7 +305,6 @@ void drop_futex_key_refs(union futex_key *key)
                        break;
        }
 }
-EXPORT_SYMBOL_GPL(drop_futex_key_refs);
 
 static u32 cmpxchg_futex_value_locked(u32 __user *uaddr, u32 uval, u32 newval)
 {
index 00b572666cc76178d81979f512dc9e3078b08fda..0a43def6fee7de877f43bdd0d7276efc05b8a48e 100644 (file)
@@ -30,6 +30,15 @@ fetch_robust_entry(compat_uptr_t *uentry, struct robust_list __user **entry,
        return 0;
 }
 
+static void __user *futex_uaddr(struct robust_list *entry,
+                               compat_long_t futex_offset)
+{
+       compat_uptr_t base = ptr_to_compat(entry);
+       void __user *uaddr = compat_ptr(base + futex_offset);
+
+       return uaddr;
+}
+
 /*
  * Walk curr->robust_list (very carefully, it's a userspace list!)
  * and mark any locks found there dead, and notify any waiters.
@@ -76,11 +85,12 @@ void compat_exit_robust_list(struct task_struct *curr)
                 * A pending lock might already be on the list, so
                 * dont process it twice:
                 */
-               if (entry != pending)
-                       if (handle_futex_death((void __user *)entry + futex_offset,
-                                               curr, pi))
-                               return;
+               if (entry != pending) {
+                       void __user *uaddr = futex_uaddr(entry, futex_offset);
 
+                       if (handle_futex_death(uaddr, curr, pi))
+                               return;
+               }
                if (rc)
                        return;
                uentry = next_uentry;
@@ -94,9 +104,11 @@ void compat_exit_robust_list(struct task_struct *curr)
 
                cond_resched();
        }
-       if (pending)
-               handle_futex_death((void __user *)pending + futex_offset,
-                                  curr, pip);
+       if (pending) {
+               void __user *uaddr = futex_uaddr(pending, futex_offset);
+
+               handle_futex_death(uaddr, curr, pip);
+       }
 }
 
 asmlinkage long
index b6d2ff7e37ee280d266ecc98ed63cb2d8f48d0f9..22a25142e4cf923967d770ef23a7992d1b19ff42 100644 (file)
@@ -602,7 +602,7 @@ static int hrtimer_switch_to_hres(void)
        /* "Retrigger" the interrupt to get things going */
        retrigger_next_event(NULL);
        local_irq_restore(flags);
-       printk(KERN_INFO "Switched to high resolution mode on CPU %d\n",
+       printk(KERN_DEBUG "Switched to high resolution mode on CPU %d\n",
               smp_processor_id());
        return 1;
 }
index e391cbb1f56665e4f751706403d69bd3bd86c471..dc335ad27525f0019d475124322779d6c6ed5f09 100644 (file)
@@ -178,9 +178,11 @@ fastcall unsigned int __do_IRQ(unsigned int irq)
                 */
                if (desc->chip->ack)
                        desc->chip->ack(irq);
-               action_ret = handle_IRQ_event(irq, desc->action);
-               if (!noirqdebug)
-                       note_interrupt(irq, desc, action_ret);
+               if (likely(!(desc->status & IRQ_DISABLED))) {
+                       action_ret = handle_IRQ_event(irq, desc->action);
+                       if (!noirqdebug)
+                               note_interrupt(irq, desc, action_ret);
+               }
                desc->chip->end(irq);
                return 1;
        }
index 55fe0c7cd95fc6776dda4f93d85fa1541200ebb1..ed38bbfc48a3b84d4b290423d2443b2f32ff331c 100644 (file)
@@ -2424,7 +2424,7 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,
                return 0;
 
        /*
-        * Calculate the chain hash: it's the combined has of all the
+        * Calculate the chain hash: it's the combined hash of all the
         * lock keys along the dependency chain. We save the hash value
         * at every step so that we can get the current hash easily
         * after unlock. The chain hash is then used to cache dependency
index ccb48d9a365718128c380018d4c936fc32fb2ef5..5323cfaedbce52f4cfbdb7bf6338ca368a64ac0b 100644 (file)
@@ -28,7 +28,7 @@ extern struct marker __start___markers[];
 extern struct marker __stop___markers[];
 
 /*
- * module_mutex nests inside markers_mutex. Markers mutex protects the builtin
+ * markers_mutex nests inside module_mutex. Markers mutex protects the builtin
  * and module markers, the hash table and deferred_sync.
  */
 static DEFINE_MUTEX(markers_mutex);
@@ -257,7 +257,6 @@ static void disable_marker(struct marker *elem)
  * @refcount: number of references left to the given probe_module (out)
  *
  * Updates the probe callback corresponding to a range of markers.
- * Must be called with markers_mutex held.
  */
 void marker_update_probe_range(struct marker *begin,
        struct marker *end, struct module *probe_module,
@@ -266,6 +265,7 @@ void marker_update_probe_range(struct marker *begin,
        struct marker *iter;
        struct marker_entry *mark_entry;
 
+       mutex_lock(&markers_mutex);
        for (iter = begin; iter < end; iter++) {
                mark_entry = get_marker(iter->name);
                if (mark_entry && mark_entry->refcount) {
@@ -281,6 +281,7 @@ void marker_update_probe_range(struct marker *begin,
                        disable_marker(iter);
                }
        }
+       mutex_unlock(&markers_mutex);
 }
 
 /*
@@ -293,7 +294,6 @@ static void marker_update_probes(struct module *probe_module)
 {
        int refcount = 0;
 
-       mutex_lock(&markers_mutex);
        /* Core kernel markers */
        marker_update_probe_range(__start___markers,
                        __stop___markers, probe_module, &refcount);
@@ -303,7 +303,6 @@ static void marker_update_probes(struct module *probe_module)
                synchronize_sched();
                deferred_sync = 0;
        }
-       mutex_unlock(&markers_mutex);
 }
 
 /**
@@ -320,7 +319,7 @@ int marker_probe_register(const char *name, const char *format,
                        marker_probe_func *probe, void *private)
 {
        struct marker_entry *entry;
-       int ret = 0, need_update = 0;
+       int ret = 0;
 
        mutex_lock(&markers_mutex);
        entry = get_marker(name);
@@ -335,11 +334,11 @@ int marker_probe_register(const char *name, const char *format,
        ret = add_marker(name, format, probe, private);
        if (ret)
                goto end;
-       need_update = 1;
+       mutex_unlock(&markers_mutex);
+       marker_update_probes(NULL);
+       return ret;
 end:
        mutex_unlock(&markers_mutex);
-       if (need_update)
-               marker_update_probes(NULL);
        return ret;
 }
 EXPORT_SYMBOL_GPL(marker_probe_register);
@@ -355,7 +354,6 @@ void *marker_probe_unregister(const char *name)
        struct module *probe_module;
        struct marker_entry *entry;
        void *private;
-       int need_update = 0;
 
        mutex_lock(&markers_mutex);
        entry = get_marker(name);
@@ -368,11 +366,11 @@ void *marker_probe_unregister(const char *name)
        probe_module = __module_text_address((unsigned long)entry->probe);
        private = remove_marker(name);
        deferred_sync = 1;
-       need_update = 1;
+       mutex_unlock(&markers_mutex);
+       marker_update_probes(probe_module);
+       return private;
 end:
        mutex_unlock(&markers_mutex);
-       if (need_update)
-               marker_update_probes(probe_module);
        return private;
 }
 EXPORT_SYMBOL_GPL(marker_probe_unregister);
@@ -392,7 +390,6 @@ void *marker_probe_unregister_private_data(void *private)
        struct marker_entry *entry;
        int found = 0;
        unsigned int i;
-       int need_update = 0;
 
        mutex_lock(&markers_mutex);
        for (i = 0; i < MARKER_TABLE_SIZE; i++) {
@@ -414,11 +411,11 @@ iter_end:
        probe_module = __module_text_address((unsigned long)entry->probe);
        private = remove_marker(entry->name);
        deferred_sync = 1;
-       need_update = 1;
+       mutex_unlock(&markers_mutex);
+       marker_update_probes(probe_module);
+       return private;
 end:
        mutex_unlock(&markers_mutex);
-       if (need_update)
-               marker_update_probes(probe_module);
        return private;
 }
 EXPORT_SYMBOL_GPL(marker_probe_unregister_private_data);
@@ -434,7 +431,7 @@ EXPORT_SYMBOL_GPL(marker_probe_unregister_private_data);
 int marker_arm(const char *name)
 {
        struct marker_entry *entry;
-       int ret = 0, need_update = 0;
+       int ret = 0;
 
        mutex_lock(&markers_mutex);
        entry = get_marker(name);
@@ -447,11 +444,9 @@ int marker_arm(const char *name)
         */
        if (entry->refcount++)
                goto end;
-       need_update = 1;
 end:
        mutex_unlock(&markers_mutex);
-       if (need_update)
-               marker_update_probes(NULL);
+       marker_update_probes(NULL);
        return ret;
 }
 EXPORT_SYMBOL_GPL(marker_arm);
@@ -467,7 +462,7 @@ EXPORT_SYMBOL_GPL(marker_arm);
 int marker_disarm(const char *name)
 {
        struct marker_entry *entry;
-       int ret = 0, need_update = 0;
+       int ret = 0;
 
        mutex_lock(&markers_mutex);
        entry = get_marker(name);
@@ -486,11 +481,9 @@ int marker_disarm(const char *name)
                ret = -EPERM;
                goto end;
        }
-       need_update = 1;
 end:
        mutex_unlock(&markers_mutex);
-       if (need_update)
-               marker_update_probes(NULL);
+       marker_update_probes(NULL);
        return ret;
 }
 EXPORT_SYMBOL_GPL(marker_disarm);
index 3202c9950073ebc05fb232a625da27d2ec35eee8..91fe6958b6e1b253f98c2ab08518693df00a1497 100644 (file)
@@ -81,7 +81,8 @@ int unregister_module_notifier(struct notifier_block * nb)
 }
 EXPORT_SYMBOL(unregister_module_notifier);
 
-/* We require a truly strong try_module_get() */
+/* We require a truly strong try_module_get(): 0 means failure due to
+   ongoing or failed initialization etc. */
 static inline int strong_try_module_get(struct module *mod)
 {
        if (mod && mod->state == MODULE_STATE_COMING)
@@ -952,7 +953,8 @@ static unsigned long resolve_symbol(Elf_Shdr *sechdrs,
        ret = __find_symbol(name, &owner, &crc,
                        !(mod->taints & TAINT_PROPRIETARY_MODULE));
        if (ret) {
-               /* use_module can fail due to OOM, or module unloading */
+               /* use_module can fail due to OOM,
+                  or module initialization or unloading */
                if (!check_version(sechdrs, versindex, name, mod, crc) ||
                    !use_module(mod, owner))
                        ret = 0;
@@ -1369,7 +1371,7 @@ dup:
        return ret;
 }
 
-/* Change all symbols so that sh_value encodes the pointer directly. */
+/* Change all symbols so that st_value encodes the pointer directly. */
 static int simplify_symbols(Elf_Shdr *sechdrs,
                            unsigned int symindex,
                            const char *strtab,
index 16f269e9ddc9b7d4ed129f98f0deac4965b87507..2a4c51487e7257e1865ae33d805a22e3dbb7f9ae 100644 (file)
@@ -592,19 +592,16 @@ static void __init param_sysfs_builtin(void)
 
        for (i=0; i < __stop___param - __start___param; i++) {
                char *dot;
-               size_t kplen;
+               size_t max_name_len;
 
                kp = &__start___param[i];
-               kplen = strlen(kp->name);
+               max_name_len =
+                       min_t(size_t, MAX_KBUILD_MODNAME, strlen(kp->name));
 
-               /* We do not handle args without periods. */
-               if (kplen > MAX_KBUILD_MODNAME) {
-                       DEBUGP("kernel parameter name is too long: %s\n", kp->name);
-                       continue;
-               }
-               dot = memchr(kp->name, '.', kplen);
+               dot = memchr(kp->name, '.', max_name_len);
                if (!dot) {
-                       DEBUGP("couldn't find period in %s\n", kp->name);
+                       DEBUGP("couldn't find period in first %d characters "
+                              "of %s\n", MAX_KBUILD_MODNAME, kp->name);
                        continue;
                }
                name_len = dot - kp->name;
index d1db36b94674dbdc318845233b1804c659515740..f815455431bff3c95855a674086e6c1d8322a7c4 100644 (file)
@@ -537,6 +537,7 @@ err_alloc:
        return NULL;
 }
 
+#ifdef CONFIG_PID_NS
 static struct pid_namespace *create_pid_namespace(int level)
 {
        struct pid_namespace *ns;
@@ -621,6 +622,7 @@ void free_pid_ns(struct kref *kref)
        if (parent != NULL)
                put_pid_ns(parent);
 }
+#endif /* CONFIG_PID_NS */
 
 void zap_pid_ns_processes(struct pid_namespace *pid_ns)
 {
index 8b15f777010a9daefe2361adfbf5c1c0851dfb75..05b64790fe8391ed5189eee02144e5cf63f3fa2b 100644 (file)
@@ -456,7 +456,17 @@ static int software_resume(void)
        int error;
        unsigned int flags;
 
-       mutex_lock(&pm_mutex);
+       /*
+        * name_to_dev_t() below takes a sysfs buffer mutex when sysfs
+        * is configured into the kernel. Since the regular hibernate
+        * trigger path is via sysfs which takes a buffer mutex before
+        * calling hibernate functions (which take pm_mutex) this can
+        * cause lockdep to complain about a possible ABBA deadlock
+        * which cannot happen since we're in the boot code here and
+        * sysfs can't be invoked yet. Therefore, we use a subclass
+        * here to avoid lockdep complaining.
+        */
+       mutex_lock_nested(&pm_mutex, SINGLE_DEPTH_NESTING);
        if (!swsusp_resume_device) {
                if (!strlen(resume_file)) {
                        mutex_unlock(&pm_mutex);
index a358142ff48f34ca2dd0653f8bb1fc7c6f2c3fe0..2eb553d9b517153d8d938b34d60718b948b6bac0 100644 (file)
@@ -277,7 +277,7 @@ walk_memory_resource(unsigned long start_pfn, unsigned long nr_pages, void *arg,
        int ret = -1;
        res.start = (u64) start_pfn << PAGE_SHIFT;
        res.end = ((u64)(start_pfn + nr_pages) << PAGE_SHIFT) - 1;
-       res.flags = IORESOURCE_MEM;
+       res.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
        orig_end = res.end;
        while ((res.start < res.end) && (find_next_system_ram(&res) >= 0)) {
                pfn = (unsigned long)(res.start >> PAGE_SHIFT);
index b4fbbc440453c8d76c686128fad818939d70740e..38933cafea8abdf3042dde657798fbce7dc84c6e 100644 (file)
@@ -52,7 +52,6 @@
 #include <linux/cpu.h>
 #include <linux/cpuset.h>
 #include <linux/percpu.h>
-#include <linux/cpu_acct.h>
 #include <linux/kthread.h>
 #include <linux/seq_file.h>
 #include <linux/sysctl.h>
@@ -75,7 +74,7 @@
  */
 unsigned long long __attribute__((weak)) sched_clock(void)
 {
-       return (unsigned long long)jiffies * (1000000000 / HZ);
+       return (unsigned long long)jiffies * (NSEC_PER_SEC / HZ);
 }
 
 /*
@@ -99,8 +98,8 @@ unsigned long long __attribute__((weak)) sched_clock(void)
 /*
  * Some helpers for converting nanosecond timing to jiffy resolution
  */
-#define NS_TO_JIFFIES(TIME)    ((unsigned long)(TIME) / (1000000000 / HZ))
-#define JIFFIES_TO_NS(TIME)    ((TIME) * (1000000000 / HZ))
+#define NS_TO_JIFFIES(TIME)    ((unsigned long)(TIME) / (NSEC_PER_SEC / HZ))
+#define JIFFIES_TO_NS(TIME)    ((TIME) * (NSEC_PER_SEC / HZ))
 
 #define NICE_0_LOAD            SCHED_LOAD_SCALE
 #define NICE_0_SHIFT           SCHED_LOAD_SHIFT
@@ -172,6 +171,7 @@ struct task_group {
        unsigned long shares;
        /* spinlock to serialize modification to shares */
        spinlock_t lock;
+       struct rcu_head rcu;
 };
 
 /* Default task group's sched entity on each cpu */
@@ -216,15 +216,15 @@ static inline struct task_group *task_group(struct task_struct *p)
 }
 
 /* Change a task's cfs_rq and parent entity if it moves across CPUs/groups */
-static inline void set_task_cfs_rq(struct task_struct *p)
+static inline void set_task_cfs_rq(struct task_struct *p, unsigned int cpu)
 {
-       p->se.cfs_rq = task_group(p)->cfs_rq[task_cpu(p)];
-       p->se.parent = task_group(p)->se[task_cpu(p)];
+       p->se.cfs_rq = task_group(p)->cfs_rq[cpu];
+       p->se.parent = task_group(p)->se[cpu];
 }
 
 #else
 
-static inline void set_task_cfs_rq(struct task_struct *p) { }
+static inline void set_task_cfs_rq(struct task_struct *p, unsigned int cpu) { }
 
 #endif /* CONFIG_FAIR_GROUP_SCHED */
 
@@ -258,7 +258,6 @@ struct cfs_rq {
         */
        struct list_head leaf_cfs_rq_list; /* Better name : task_cfs_rq_list? */
        struct task_group *tg;    /* group that "owns" this runqueue */
-       struct rcu_head rcu;
 #endif
 };
 
@@ -456,23 +455,27 @@ static void update_rq_clock(struct rq *rq)
  */
 enum {
        SCHED_FEAT_NEW_FAIR_SLEEPERS    = 1,
-       SCHED_FEAT_START_DEBIT          = 2,
-       SCHED_FEAT_TREE_AVG             = 4,
-       SCHED_FEAT_APPROX_AVG           = 8,
-       SCHED_FEAT_WAKEUP_PREEMPT       = 16,
-       SCHED_FEAT_PREEMPT_RESTRICT     = 32,
+       SCHED_FEAT_WAKEUP_PREEMPT       = 2,
+       SCHED_FEAT_START_DEBIT          = 4,
+       SCHED_FEAT_TREE_AVG             = 8,
+       SCHED_FEAT_APPROX_AVG           = 16,
 };
 
 const_debug unsigned int sysctl_sched_features =
                SCHED_FEAT_NEW_FAIR_SLEEPERS    * 1 |
+               SCHED_FEAT_WAKEUP_PREEMPT       * 1 |
                SCHED_FEAT_START_DEBIT          * 1 |
                SCHED_FEAT_TREE_AVG             * 0 |
-               SCHED_FEAT_APPROX_AVG           * 0 |
-               SCHED_FEAT_WAKEUP_PREEMPT       * 1 |
-               SCHED_FEAT_PREEMPT_RESTRICT     * 1;
+               SCHED_FEAT_APPROX_AVG           * 0;
 
 #define sched_feat(x) (sysctl_sched_features & SCHED_FEAT_##x)
 
+/*
+ * Number of tasks to iterate in a single balance run.
+ * Limited because this is done with IRQs disabled.
+ */
+const_debug unsigned int sysctl_sched_nr_migrate = 32;
+
 /*
  * For kernel-internal use: high-speed (but slightly incorrect) per-cpu
  * clock constructed from sched_clock():
@@ -1019,10 +1022,16 @@ unsigned long weighted_cpuload(const int cpu)
 
 static inline void __set_task_cpu(struct task_struct *p, unsigned int cpu)
 {
+       set_task_cfs_rq(p, cpu);
 #ifdef CONFIG_SMP
+       /*
+        * After ->cpu is set up to a new value, task_rq_lock(p, ...) can be
+        * successfuly executed on another CPU. We must ensure that updates of
+        * per-task data have been completed by this moment.
+        */
+       smp_wmb();
        task_thread_info(p)->cpu = cpu;
 #endif
-       set_task_cfs_rq(p);
 }
 
 #ifdef CONFIG_SMP
@@ -2237,7 +2246,7 @@ balance_tasks(struct rq *this_rq, int this_cpu, struct rq *busiest,
              enum cpu_idle_type idle, int *all_pinned,
              int *this_best_prio, struct rq_iterator *iterator)
 {
-       int pulled = 0, pinned = 0, skip_for_load;
+       int loops = 0, pulled = 0, pinned = 0, skip_for_load;
        struct task_struct *p;
        long rem_load_move = max_load_move;
 
@@ -2251,10 +2260,10 @@ balance_tasks(struct rq *this_rq, int this_cpu, struct rq *busiest,
         */
        p = iterator->start(iterator->arg);
 next:
-       if (!p)
+       if (!p || loops++ > sysctl_sched_nr_migrate)
                goto out;
        /*
-        * To help distribute high priority tasks accross CPUs we don't
+        * To help distribute high priority tasks across CPUs we don't
         * skip a task if it will be the highest priority task (i.e. smallest
         * prio value) on its new queue regardless of its load weight
         */
@@ -2271,8 +2280,7 @@ next:
        rem_load_move -= p->se.load.weight;
 
        /*
-        * We only want to steal up to the prescribed number of tasks
-        * and the prescribed amount of weighted load.
+        * We only want to steal up to the prescribed amount of weighted load.
         */
        if (rem_load_move > 0) {
                if (p->prio < *this_best_prio)
@@ -3335,13 +3343,9 @@ void account_user_time(struct task_struct *p, cputime_t cputime)
 {
        struct cpu_usage_stat *cpustat = &kstat_this_cpu.cpustat;
        cputime64_t tmp;
-       struct rq *rq = this_rq();
 
        p->utime = cputime_add(p->utime, cputime);
 
-       if (p != rq->idle)
-               cpuacct_charge(p, cputime);
-
        /* Add user time to cpustat. */
        tmp = cputime_to_cputime64(cputime);
        if (TASK_NICE(p) > 0)
@@ -3355,7 +3359,7 @@ void account_user_time(struct task_struct *p, cputime_t cputime)
  * @p: the process that the cpu time gets accounted to
  * @cputime: the cpu time spent in virtual machine since the last update
  */
-void account_guest_time(struct task_struct *p, cputime_t cputime)
+static void account_guest_time(struct task_struct *p, cputime_t cputime)
 {
        cputime64_t tmp;
        struct cpu_usage_stat *cpustat = &kstat_this_cpu.cpustat;
@@ -3392,10 +3396,8 @@ void account_system_time(struct task_struct *p, int hardirq_offset,
        struct rq *rq = this_rq();
        cputime64_t tmp;
 
-       if (p->flags & PF_VCPU) {
-               account_guest_time(p, cputime);
-               return;
-       }
+       if ((p->flags & PF_VCPU) && (irq_count() - hardirq_offset == 0))
+               return account_guest_time(p, cputime);
 
        p->stime = cputime_add(p->stime, cputime);
 
@@ -3405,10 +3407,9 @@ void account_system_time(struct task_struct *p, int hardirq_offset,
                cpustat->irq = cputime64_add(cpustat->irq, tmp);
        else if (softirq_count())
                cpustat->softirq = cputime64_add(cpustat->softirq, tmp);
-       else if (p != rq->idle) {
+       else if (p != rq->idle)
                cpustat->system = cputime64_add(cpustat->system, tmp);
-               cpuacct_charge(p, cputime);
-       } else if (atomic_read(&rq->nr_iowait) > 0)
+       else if (atomic_read(&rq->nr_iowait) > 0)
                cpustat->iowait = cputime64_add(cpustat->iowait, tmp);
        else
                cpustat->idle = cputime64_add(cpustat->idle, tmp);
@@ -3444,10 +3445,8 @@ void account_steal_time(struct task_struct *p, cputime_t steal)
                        cpustat->iowait = cputime64_add(cpustat->iowait, tmp);
                else
                        cpustat->idle = cputime64_add(cpustat->idle, tmp);
-       } else {
+       } else
                cpustat->steal = cputime64_add(cpustat->steal, tmp);
-               cpuacct_charge(p, -tmp);
-       }
 }
 
 /*
@@ -4992,6 +4991,32 @@ void __cpuinit init_idle(struct task_struct *idle, int cpu)
  */
 cpumask_t nohz_cpu_mask = CPU_MASK_NONE;
 
+/*
+ * Increase the granularity value when there are more CPUs,
+ * because with more CPUs the 'effective latency' as visible
+ * to users decreases. But the relationship is not linear,
+ * so pick a second-best guess by going with the log2 of the
+ * number of CPUs.
+ *
+ * This idea comes from the SD scheduler of Con Kolivas:
+ */
+static inline void sched_init_granularity(void)
+{
+       unsigned int factor = 1 + ilog2(num_online_cpus());
+       const unsigned long limit = 200000000;
+
+       sysctl_sched_min_granularity *= factor;
+       if (sysctl_sched_min_granularity > limit)
+               sysctl_sched_min_granularity = limit;
+
+       sysctl_sched_latency *= factor;
+       if (sysctl_sched_latency > limit)
+               sysctl_sched_latency = limit;
+
+       sysctl_sched_wakeup_granularity *= factor;
+       sysctl_sched_batch_wakeup_granularity *= factor;
+}
+
 #ifdef CONFIG_SMP
 /*
  * This is how migration works:
@@ -5256,24 +5281,10 @@ static void migrate_live_tasks(int src_cpu)
        read_unlock(&tasklist_lock);
 }
 
-/*
- * activate_idle_task - move idle task to the _front_ of runqueue.
- */
-static void activate_idle_task(struct task_struct *p, struct rq *rq)
-{
-       update_rq_clock(rq);
-
-       if (p->state == TASK_UNINTERRUPTIBLE)
-               rq->nr_uninterruptible--;
-
-       enqueue_task(rq, p, 0);
-       inc_nr_running(p, rq);
-}
-
 /*
  * Schedules idle task to be the next runnable task on current CPU.
- * It does so by boosting its priority to highest possible and adding it to
- * the _front_ of the runqueue. Used by CPU offline code.
+ * It does so by boosting its priority to highest possible.
+ * Used by CPU offline code.
  */
 void sched_idle_next(void)
 {
@@ -5293,8 +5304,8 @@ void sched_idle_next(void)
 
        __setscheduler(rq, p, SCHED_FIFO, MAX_RT_PRIO-1);
 
-       /* Add idle task to the _front_ of its priority queue: */
-       activate_idle_task(p, rq);
+       update_rq_clock(rq);
+       activate_task(rq, p, 0);
 
        spin_unlock_irqrestore(&rq->lock, flags);
 }
@@ -5365,7 +5376,7 @@ static struct ctl_table sd_ctl_dir[] = {
                .procname       = "sched_domain",
                .mode           = 0555,
        },
-       {0,},
+       {0, },
 };
 
 static struct ctl_table sd_ctl_root[] = {
@@ -5375,7 +5386,7 @@ static struct ctl_table sd_ctl_root[] = {
                .mode           = 0555,
                .child          = sd_ctl_dir,
        },
-       {0,},
+       {0, },
 };
 
 static struct ctl_table *sd_alloc_ctl_entry(int n)
@@ -5621,7 +5632,7 @@ static struct notifier_block __cpuinitdata migration_notifier = {
        .priority = 10
 };
 
-int __init migration_init(void)
+void __init migration_init(void)
 {
        void *cpu = (void *)(long)smp_processor_id();
        int err;
@@ -5631,8 +5642,6 @@ int __init migration_init(void)
        BUG_ON(err == NOTIFY_BAD);
        migration_call(&migration_notifier, CPU_ONLINE, cpu);
        register_cpu_notifier(&migration_notifier);
-
-       return 0;
 }
 #endif
 
@@ -6688,10 +6697,12 @@ void __init sched_init_smp(void)
        /* Move init over to a non-isolated CPU */
        if (set_cpus_allowed(current, non_isolated_cpus) < 0)
                BUG();
+       sched_init_granularity();
 }
 #else
 void __init sched_init_smp(void)
 {
+       sched_init_granularity();
 }
 #endif /* CONFIG_SMP */
 
@@ -7019,8 +7030,8 @@ err:
 /* rcu callback to free various structures associated with a task group */
 static void free_sched_group(struct rcu_head *rhp)
 {
-       struct cfs_rq *cfs_rq = container_of(rhp, struct cfs_rq, rcu);
-       struct task_group *tg = cfs_rq->tg;
+       struct task_group *tg = container_of(rhp, struct task_group, rcu);
+       struct cfs_rq *cfs_rq;
        struct sched_entity *se;
        int i;
 
@@ -7041,7 +7052,7 @@ static void free_sched_group(struct rcu_head *rhp)
 /* Destroy runqueue etc associated with a task group */
 void sched_destroy_group(struct task_group *tg)
 {
-       struct cfs_rq *cfs_rq;
+       struct cfs_rq *cfs_rq = NULL;
        int i;
 
        for_each_possible_cpu(i) {
@@ -7049,10 +7060,10 @@ void sched_destroy_group(struct task_group *tg)
                list_del_rcu(&cfs_rq->leaf_cfs_rq_list);
        }
 
-       cfs_rq = tg->cfs_rq[0];
+       BUG_ON(!cfs_rq);
 
        /* wait for possible concurrent references to cfs_rqs complete */
-       call_rcu(&cfs_rq->rcu, free_sched_group);
+       call_rcu(&tg->rcu, free_sched_group);
 }
 
 /* change task's runqueue when it moves between groups.
@@ -7068,8 +7079,10 @@ void sched_move_task(struct task_struct *tsk)
 
        rq = task_rq_lock(tsk, &flags);
 
-       if (tsk->sched_class != &fair_sched_class)
+       if (tsk->sched_class != &fair_sched_class) {
+               set_task_cfs_rq(tsk, task_cpu(tsk));
                goto done;
+       }
 
        update_rq_clock(rq);
 
@@ -7082,7 +7095,7 @@ void sched_move_task(struct task_struct *tsk)
                        tsk->sched_class->put_prev_task(rq, tsk);
        }
 
-       set_task_cfs_rq(tsk);
+       set_task_cfs_rq(tsk, task_cpu(tsk));
 
        if (on_rq) {
                if (unlikely(running))
@@ -7211,25 +7224,53 @@ static u64 cpu_shares_read_uint(struct cgroup *cgrp, struct cftype *cft)
        return (u64) tg->shares;
 }
 
-static struct cftype cpu_shares = {
-       .name = "shares",
-       .read_uint = cpu_shares_read_uint,
-       .write_uint = cpu_shares_write_uint,
+static u64 cpu_usage_read(struct cgroup *cgrp, struct cftype *cft)
+{
+       struct task_group *tg = cgroup_tg(cgrp);
+       unsigned long flags;
+       u64 res = 0;
+       int i;
+
+       for_each_possible_cpu(i) {
+               /*
+                * Lock to prevent races with updating 64-bit counters
+                * on 32-bit arches.
+                */
+               spin_lock_irqsave(&cpu_rq(i)->lock, flags);
+               res += tg->se[i]->sum_exec_runtime;
+               spin_unlock_irqrestore(&cpu_rq(i)->lock, flags);
+       }
+       /* Convert from ns to ms */
+       do_div(res, NSEC_PER_MSEC);
+
+       return res;
+}
+
+static struct cftype cpu_files[] = {
+       {
+               .name = "shares",
+               .read_uint = cpu_shares_read_uint,
+               .write_uint = cpu_shares_write_uint,
+       },
+       {
+               .name = "usage",
+               .read_uint = cpu_usage_read,
+       },
 };
 
 static int cpu_cgroup_populate(struct cgroup_subsys *ss, struct cgroup *cont)
 {
-       return cgroup_add_file(cont, ss, &cpu_shares);
+       return cgroup_add_files(cont, ss, cpu_files, ARRAY_SIZE(cpu_files));
 }
 
 struct cgroup_subsys cpu_cgroup_subsys = {
-       .name           = "cpu",
-       .create         = cpu_cgroup_create,
-       .destroy        = cpu_cgroup_destroy,
-       .can_attach     = cpu_cgroup_can_attach,
-       .attach         = cpu_cgroup_attach,
-       .populate       = cpu_cgroup_populate,
-       .subsys_id      = cpu_cgroup_subsys_id,
+       .name           = "cpu",
+       .create         = cpu_cgroup_create,
+       .destroy        = cpu_cgroup_destroy,
+       .can_attach     = cpu_cgroup_can_attach,
+       .attach         = cpu_cgroup_attach,
+       .populate       = cpu_cgroup_populate,
+       .subsys_id      = cpu_cgroup_subsys_id,
        .early_init     = 1,
 };
 
index e6fb392e51644b24ec063681a99fed402c65a3e5..5d0d623a54650180ffb6495321f6438a8464508f 100644 (file)
@@ -80,6 +80,7 @@ print_task(struct seq_file *m, struct rq *rq, struct task_struct *p)
 static void print_rq(struct seq_file *m, struct rq *rq, int rq_cpu)
 {
        struct task_struct *g, *p;
+       unsigned long flags;
 
        SEQ_printf(m,
        "\nrunnable tasks:\n"
@@ -88,7 +89,7 @@ static void print_rq(struct seq_file *m, struct rq *rq, int rq_cpu)
        "------------------------------------------------------"
        "----------------------------------------------------\n");
 
-       read_lock_irq(&tasklist_lock);
+       read_lock_irqsave(&tasklist_lock, flags);
 
        do_each_thread(g, p) {
                if (!p->se.on_rq || task_cpu(p) != rq_cpu)
@@ -97,7 +98,7 @@ static void print_rq(struct seq_file *m, struct rq *rq, int rq_cpu)
                print_task(m, rq, p);
        } while_each_thread(g, p);
 
-       read_unlock_irq(&tasklist_lock);
+       read_unlock_irqrestore(&tasklist_lock, flags);
 }
 
 void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
@@ -198,7 +199,7 @@ static int sched_debug_show(struct seq_file *m, void *v)
        u64 now = ktime_to_ns(ktime_get());
        int cpu;
 
-       SEQ_printf(m, "Sched Debug Version: v0.06-v22, %s %.*s\n",
+       SEQ_printf(m, "Sched Debug Version: v0.07, %s %.*s\n",
                init_utsname()->release,
                (int)strcspn(init_utsname()->version, " "),
                init_utsname()->version);
@@ -210,7 +211,7 @@ static int sched_debug_show(struct seq_file *m, void *v)
 #define PN(x) \
        SEQ_printf(m, "  .%-40s: %Ld.%06ld\n", #x, SPLIT_NS(x))
        PN(sysctl_sched_latency);
-       PN(sysctl_sched_nr_latency);
+       PN(sysctl_sched_min_granularity);
        PN(sysctl_sched_wakeup_granularity);
        PN(sysctl_sched_batch_wakeup_granularity);
        PN(sysctl_sched_child_runs_first);
index 9971831b560e966281b8ba4c70a7bd8f3dffafbc..2f16e15c022ca169013c6c62b9f946a2c0111a57 100644 (file)
@@ -22,7 +22,7 @@
 
 /*
  * Targeted preemption latency for CPU-bound tasks:
- * (default: 20ms, units: nanoseconds)
+ * (default: 20ms * (1 + ilog(ncpus)), units: nanoseconds)
  *
  * NOTE: this latency value is not the same as the concept of
  * 'timeslice length' - timeslices in CFS are of variable length
  * (to see the precise effective timeslice length of your workload,
  *  run vmstat and monitor the context-switches (cs) field)
  */
-const_debug unsigned int sysctl_sched_latency = 20000000ULL;
+unsigned int sysctl_sched_latency = 20000000ULL;
 
 /*
- * After fork, child runs first. (default) If set to 0 then
- * parent will (try to) run first.
+ * Minimal preemption granularity for CPU-bound tasks:
+ * (default: 4 msec * (1 + ilog(ncpus)), units: nanoseconds)
  */
-const_debug unsigned int sysctl_sched_child_runs_first = 1;
+unsigned int sysctl_sched_min_granularity = 4000000ULL;
 
 /*
- * Minimal preemption granularity for CPU-bound tasks:
- * (default: 2 msec, units: nanoseconds)
+ * is kept at sysctl_sched_latency / sysctl_sched_min_granularity
+ */
+static unsigned int sched_nr_latency = 5;
+
+/*
+ * After fork, child runs first. (default) If set to 0 then
+ * parent will (try to) run first.
  */
-const_debug unsigned int sysctl_sched_nr_latency = 20;
+const_debug unsigned int sysctl_sched_child_runs_first = 1;
 
 /*
  * sys_sched_yield() compat mode
@@ -56,23 +61,23 @@ unsigned int __read_mostly sysctl_sched_compat_yield;
 
 /*
  * SCHED_BATCH wake-up granularity.
- * (default: 10 msec, units: nanoseconds)
+ * (default: 10 msec * (1 + ilog(ncpus)), units: nanoseconds)
  *
  * This option delays the preemption effects of decoupled workloads
  * and reduces their over-scheduling. Synchronous workloads will still
  * have immediate wakeup/sleep latencies.
  */
-const_debug unsigned int sysctl_sched_batch_wakeup_granularity = 10000000UL;
+unsigned int sysctl_sched_batch_wakeup_granularity = 10000000UL;
 
 /*
  * SCHED_OTHER wake-up granularity.
- * (default: 10 msec, units: nanoseconds)
+ * (default: 10 msec * (1 + ilog(ncpus)), units: nanoseconds)
  *
  * This option delays the preemption effects of decoupled workloads
  * and reduces their over-scheduling. Synchronous workloads will still
  * have immediate wakeup/sleep latencies.
  */
-const_debug unsigned int sysctl_sched_wakeup_granularity = 10000000UL;
+unsigned int sysctl_sched_wakeup_granularity = 10000000UL;
 
 const_debug unsigned int sysctl_sched_migration_cost = 500000UL;
 
@@ -212,6 +217,22 @@ static inline struct sched_entity *__pick_last_entity(struct cfs_rq *cfs_rq)
  * Scheduling class statistics methods:
  */
 
+#ifdef CONFIG_SCHED_DEBUG
+int sched_nr_latency_handler(struct ctl_table *table, int write,
+               struct file *filp, void __user *buffer, size_t *lenp,
+               loff_t *ppos)
+{
+       int ret = proc_dointvec_minmax(table, write, filp, buffer, lenp, ppos);
+
+       if (ret || !write)
+               return ret;
+
+       sched_nr_latency = DIV_ROUND_UP(sysctl_sched_latency,
+                                       sysctl_sched_min_granularity);
+
+       return 0;
+}
+#endif
 
 /*
  * The idea is to set a period in which each task runs once.
@@ -224,7 +245,7 @@ static inline struct sched_entity *__pick_last_entity(struct cfs_rq *cfs_rq)
 static u64 __sched_period(unsigned long nr_running)
 {
        u64 period = sysctl_sched_latency;
-       unsigned long nr_latency = sysctl_sched_nr_latency;
+       unsigned long nr_latency = sched_nr_latency;
 
        if (unlikely(nr_running > nr_latency)) {
                period *= nr_running;
@@ -259,6 +280,7 @@ static u64 __sched_vslice(unsigned long rq_weight, unsigned long nr_running)
 {
        u64 vslice = __sched_period(nr_running);
 
+       vslice *= NICE_0_LOAD;
        do_div(vslice, rq_weight);
 
        return vslice;
@@ -472,19 +494,26 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial)
        } else if (sched_feat(APPROX_AVG) && cfs_rq->nr_running)
                vruntime += sched_vslice(cfs_rq)/2;
 
+       /*
+        * The 'current' period is already promised to the current tasks,
+        * however the extra weight of the new task will slow them down a
+        * little, place the new task so that it fits in the slot that
+        * stays open at the end.
+        */
        if (initial && sched_feat(START_DEBIT))
                vruntime += sched_vslice_add(cfs_rq, se);
 
        if (!initial) {
+               /* sleeps upto a single latency don't count. */
                if (sched_feat(NEW_FAIR_SLEEPERS) && entity_is_task(se) &&
                                task_of(se)->policy != SCHED_BATCH)
                        vruntime -= sysctl_sched_latency;
 
-               vruntime = max_t(s64, vruntime, se->vruntime);
+               /* ensure we never gain time by being placed backwards. */
+               vruntime = max_vruntime(se->vruntime, vruntime);
        }
 
        se->vruntime = vruntime;
-
 }
 
 static void
@@ -517,7 +546,6 @@ dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int sleep)
 
        update_stats_dequeue(cfs_rq, se);
        if (sleep) {
-               se->peer_preempt = 0;
 #ifdef CONFIG_SCHEDSTATS
                if (entity_is_task(se)) {
                        struct task_struct *tsk = task_of(se);
@@ -545,10 +573,8 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr)
 
        ideal_runtime = sched_slice(cfs_rq, curr);
        delta_exec = curr->sum_exec_runtime - curr->prev_sum_exec_runtime;
-       if (delta_exec > ideal_runtime ||
-                       (sched_feat(PREEMPT_RESTRICT) && curr->peer_preempt))
+       if (delta_exec > ideal_runtime)
                resched_task(rq_of(cfs_rq)->curr);
-       curr->peer_preempt = 0;
 }
 
 static void
@@ -811,7 +837,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p)
        struct task_struct *curr = rq->curr;
        struct cfs_rq *cfs_rq = task_cfs_rq(curr);
        struct sched_entity *se = &curr->se, *pse = &p->se;
-       s64 delta, gran;
+       unsigned long gran;
 
        if (unlikely(rt_prio(p->prio))) {
                update_rq_clock(rq);
@@ -826,24 +852,20 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p)
        if (unlikely(p->policy == SCHED_BATCH))
                return;
 
-       if (sched_feat(WAKEUP_PREEMPT)) {
-               while (!is_same_group(se, pse)) {
-                       se = parent_entity(se);
-                       pse = parent_entity(pse);
-               }
+       if (!sched_feat(WAKEUP_PREEMPT))
+               return;
 
-               delta = se->vruntime - pse->vruntime;
-               gran = sysctl_sched_wakeup_granularity;
-               if (unlikely(se->load.weight != NICE_0_LOAD))
-                       gran = calc_delta_fair(gran, &se->load);
+       while (!is_same_group(se, pse)) {
+               se = parent_entity(se);
+               pse = parent_entity(pse);
+       }
 
-               if (delta > gran) {
-                       int now = !sched_feat(PREEMPT_RESTRICT);
+       gran = sysctl_sched_wakeup_granularity;
+       if (unlikely(se->load.weight != NICE_0_LOAD))
+               gran = calc_delta_fair(gran, &se->load);
 
-                       if (now || p->prio < curr->prio || !se->peer_preempt++)
-                               resched_task(curr);
-               }
-       }
+       if (pse->vruntime + gran < se->vruntime)
+               resched_task(curr);
 }
 
 static struct task_struct *pick_next_task_fair(struct rq *rq)
@@ -1025,7 +1047,7 @@ static void task_tick_fair(struct rq *rq, struct task_struct *curr)
        }
 }
 
-#define swap(a,b) do { typeof(a) tmp = (a); (a) = (b); (b) = tmp; } while (0)
+#define swap(a, b) do { typeof(a) tmp = (a); (a) = (b); (b) = tmp; } while (0)
 
 /*
  * Share the fairness runtime between parent and child, thus the
@@ -1045,8 +1067,9 @@ static void task_new_fair(struct rq *rq, struct task_struct *p)
        update_curr(cfs_rq);
        place_entity(cfs_rq, se, 1);
 
+       /* 'curr' will be NULL if the child belongs to a different group */
        if (sysctl_sched_child_runs_first && this_cpu == task_cpu(p) &&
-                       curr->vruntime < se->vruntime) {
+                       curr && curr->vruntime < se->vruntime) {
                /*
                 * Upon rescheduling, sched_class::put_prev_task() will place
                 * 'current' within the tree based on its new key value.
@@ -1054,7 +1077,6 @@ static void task_new_fair(struct rq *rq, struct task_struct *p)
                swap(curr->vruntime, se->vruntime);
        }
 
-       se->peer_preempt = 0;
        enqueue_task_fair(rq, p, 0);
        resched_task(rq->curr);
 }
index ef1a7df80ea21257ab141a3ef57142bad9ab47ae..630178e53bb6210d156ee94f9f9c4f3e96e473dd 100644 (file)
@@ -127,7 +127,7 @@ rq_sched_info_depart(struct rq *rq, unsigned long long delta)
 # define schedstat_set(var, val)       do { } while (0)
 #endif
 
-#ifdef CONFIG_SCHEDSTATS
+#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
 /*
  * Called when a process is dequeued from the active array and given
  * the cpu.  We should note that with the exception of interactive
@@ -155,7 +155,7 @@ static inline void sched_info_dequeued(struct task_struct *t)
  */
 static void sched_info_arrive(struct task_struct *t)
 {
-       unsigned long long now = sched_clock(), delta = 0;
+       unsigned long long now = task_rq(t)->clock, delta = 0;
 
        if (t->sched_info.last_queued)
                delta = now - t->sched_info.last_queued;
@@ -186,7 +186,7 @@ static inline void sched_info_queued(struct task_struct *t)
 {
        if (unlikely(sched_info_on()))
                if (!t->sched_info.last_queued)
-                       t->sched_info.last_queued = sched_clock();
+                       t->sched_info.last_queued = task_rq(t)->clock;
 }
 
 /*
@@ -195,7 +195,8 @@ static inline void sched_info_queued(struct task_struct *t)
  */
 static inline void sched_info_depart(struct task_struct *t)
 {
-       unsigned long long delta = sched_clock() - t->sched_info.last_arrival;
+       unsigned long long delta = task_rq(t)->clock -
+                                       t->sched_info.last_arrival;
 
        t->sched_info.cpu_time += delta;
        rq_sched_info_depart(task_rq(t), delta);
@@ -231,5 +232,5 @@ sched_info_switch(struct task_struct *prev, struct task_struct *next)
 #else
 #define sched_info_queued(t)           do { } while (0)
 #define sched_info_switch(t, next)     do { } while (0)
-#endif /* CONFIG_SCHEDSTATS */
+#endif /* CONFIG_SCHEDSTATS || CONFIG_TASK_DELAY_ACCT */
 
index 12006308c7eba5f920ba417bcff27a42312399af..afa4f781f924999086c3fe2f34530e1ee84b6496 100644 (file)
@@ -55,7 +55,7 @@ static int sig_ignored(struct task_struct *t, int sig)
         * signal handler may change by the time it is
         * unblocked.
         */
-       if (sigismember(&t->blocked, sig))
+       if (sigismember(&t->blocked, sig) || sigismember(&t->real_blocked, sig))
                return 0;
 
        /* Is it explicitly or implicitly ignored? */
@@ -124,7 +124,7 @@ void recalc_sigpending_and_wake(struct task_struct *t)
 
 void recalc_sigpending(void)
 {
-       if (!recalc_sigpending_tsk(current))
+       if (!recalc_sigpending_tsk(current) && !freezing(current))
                clear_thread_flag(TIF_SIGPENDING);
 
 }
@@ -732,7 +732,7 @@ static void print_fatal_signal(struct pt_regs *regs, int signr)
        printk("%s/%d: potentially unexpected fatal signal %d.\n",
                current->comm, task_pid_nr(current), signr);
 
-#ifdef __i386__
+#if defined(__i386__) && !defined(__arch_um__)
        printk("code at %08lx: ", regs->eip);
        {
                int i;
index 304b5410d746ec724afcb4e3ce50bfe65f1bf2ff..d1fe71eb45469bc99f23cfe9aee83a8cbecc81b1 100644 (file)
@@ -1750,7 +1750,7 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3,
 }
 
 asmlinkage long sys_getcpu(unsigned __user *cpup, unsigned __user *nodep,
-                          struct getcpu_cache __user *cache)
+                          struct getcpu_cache __user *unused)
 {
        int err = 0;
        int cpu = raw_smp_processor_id();
@@ -1758,24 +1758,6 @@ asmlinkage long sys_getcpu(unsigned __user *cpup, unsigned __user *nodep,
                err |= put_user(cpu, cpup);
        if (nodep)
                err |= put_user(cpu_to_node(cpu), nodep);
-       if (cache) {
-               /*
-                * The cache is not needed for this implementation,
-                * but make sure user programs pass something
-                * valid. vsyscall implementations can instead make
-                * good use of the cache. Only use t0 and t1 because
-                * these are available in both 32bit and 64bit ABI (no
-                * need for a compat_getcpu). 32bit has enough
-                * padding
-                */
-               unsigned long t0, t1;
-               get_user(t0, &cache->blob[0]);
-               get_user(t1, &cache->blob[1]);
-               t0++;
-               t1++;
-               put_user(t0, &cache->blob[0]);
-               put_user(t1, &cache->blob[1]);
-       }
        return err ? -EFAULT : 0;
 }
 
index 52c7a151e298fbcd2a467697e7e448720beca175..56cb009a4b3592136d6fceb645f60fb1e4028867 100644 (file)
@@ -40,10 +40,14 @@ cond_syscall(sys_recvfrom);
 cond_syscall(sys_recv);
 cond_syscall(sys_socket);
 cond_syscall(sys_setsockopt);
+cond_syscall(compat_sys_setsockopt);
 cond_syscall(sys_getsockopt);
+cond_syscall(compat_sys_getsockopt);
 cond_syscall(sys_shutdown);
 cond_syscall(sys_sendmsg);
+cond_syscall(compat_sys_sendmsg);
 cond_syscall(sys_recvmsg);
+cond_syscall(compat_sys_recvmsg);
 cond_syscall(sys_socketcall);
 cond_syscall(sys_futex);
 cond_syscall(compat_sys_futex);
index 3b4efbe2644572a32576b1a591f003e9869699f0..0deed82a61568d6660a7f4ee625c490ffecffcc5 100644 (file)
@@ -226,20 +226,23 @@ static struct ctl_table root_table[] = {
 
 #ifdef CONFIG_SCHED_DEBUG
 static unsigned long min_sched_granularity_ns = 100000;                /* 100 usecs */
-static unsigned long max_sched_granularity_ns = 1000000000;    /* 1 second */
+static unsigned long max_sched_granularity_ns = NSEC_PER_SEC;  /* 1 second */
 static unsigned long min_wakeup_granularity_ns;                        /* 0 usecs */
-static unsigned long max_wakeup_granularity_ns = 1000000000;   /* 1 second */
+static unsigned long max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */
 #endif
 
 static struct ctl_table kern_table[] = {
 #ifdef CONFIG_SCHED_DEBUG
        {
                .ctl_name       = CTL_UNNUMBERED,
-               .procname       = "sched_nr_latency",
-               .data           = &sysctl_sched_nr_latency,
+               .procname       = "sched_min_granularity_ns",
+               .data           = &sysctl_sched_min_granularity,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = &sched_nr_latency_handler,
+               .strategy       = &sysctl_intvec,
+               .extra1         = &min_sched_granularity_ns,
+               .extra2         = &max_sched_granularity_ns,
        },
        {
                .ctl_name       = CTL_UNNUMBERED,
@@ -247,7 +250,7 @@ static struct ctl_table kern_table[] = {
                .data           = &sysctl_sched_latency,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
+               .proc_handler   = &sched_nr_latency_handler,
                .strategy       = &sysctl_intvec,
                .extra1         = &min_sched_granularity_ns,
                .extra2         = &max_sched_granularity_ns,
@@ -298,6 +301,14 @@ static struct ctl_table kern_table[] = {
                .mode           = 0644,
                .proc_handler   = &proc_dointvec,
        },
+       {
+               .ctl_name       = CTL_UNNUMBERED,
+               .procname       = "sched_nr_migrate",
+               .data           = &sysctl_sched_nr_migrate,
+               .maxlen         = sizeof(unsigned int),
+               .mode           = 644,
+               .proc_handler   = &proc_dointvec,
+       },
 #endif
        {
                .ctl_name       = CTL_UNNUMBERED,
@@ -2609,6 +2620,10 @@ static int deprecated_sysctl_warning(struct __sysctl_args *args)
        int name[CTL_MAXNAME];
        int i;
 
+       /* Check args->nlen. */
+       if (args->nlen < 0 || args->nlen > CTL_MAXNAME)
+               return -ENOTDIR;
+
        /* Read in the sysctl name for better debug message logging */
        for (i = 0; i < args->nlen; i++)
                if (get_user(name[i], args->name + i))
index ed6fe51df77ab53c5960df8b53024ae75120f3b2..6972f26c65f74d7b3751836d9523f95fef245848 100644 (file)
@@ -140,9 +140,6 @@ static struct trans_ctl_table trans_vm_table[] = {
        { VM_PANIC_ON_OOM,              "panic_on_oom" },
        { VM_VDSO_ENABLED,              "vdso_enabled" },
        { VM_MIN_SLAB,                  "min_slab_ratio" },
-       { VM_CMM_PAGES,                 "cmm_pages" },
-       { VM_CMM_TIMED_PAGES,           "cmm_timed_pages" },
-       { VM_CMM_TIMEOUT,               "cmm_timeout" },
 
        {}
 };
@@ -237,36 +234,6 @@ static struct trans_ctl_table trans_net_ipv4_conf_table[] = {
        {}
 };
 
-
-static struct trans_ctl_table trans_net_ipv4_vs_table[] = {
-       { NET_IPV4_VS_AMEMTHRESH,       "amemthresh" },
-       { NET_IPV4_VS_DEBUG_LEVEL,      "debug_level" },
-       { NET_IPV4_VS_AMDROPRATE,       "am_droprate" },
-       { NET_IPV4_VS_DROP_ENTRY,       "drop_entry" },
-       { NET_IPV4_VS_DROP_PACKET,      "drop_packet" },
-       { NET_IPV4_VS_SECURE_TCP,       "secure_tcp" },
-       { NET_IPV4_VS_TO_ES,            "timeout_established" },
-       { NET_IPV4_VS_TO_SS,            "timeout_synsent" },
-       { NET_IPV4_VS_TO_SR,            "timeout_synrecv" },
-       { NET_IPV4_VS_TO_FW,            "timeout_finwait" },
-       { NET_IPV4_VS_TO_TW,            "timeout_timewait" },
-       { NET_IPV4_VS_TO_CL,            "timeout_close" },
-       { NET_IPV4_VS_TO_CW,            "timeout_closewait" },
-       { NET_IPV4_VS_TO_LA,            "timeout_lastack" },
-       { NET_IPV4_VS_TO_LI,            "timeout_listen" },
-       { NET_IPV4_VS_TO_SA,            "timeout_synack" },
-       { NET_IPV4_VS_TO_UDP,           "timeout_udp" },
-       { NET_IPV4_VS_TO_ICMP,          "timeout_icmp" },
-       { NET_IPV4_VS_CACHE_BYPASS,     "cache_bypass" },
-       { NET_IPV4_VS_EXPIRE_NODEST_CONN,       "expire_nodest_conn" },
-       { NET_IPV4_VS_EXPIRE_QUIESCENT_TEMPLATE,        "expire_quiescent_template" },
-       { NET_IPV4_VS_SYNC_THRESHOLD,           "sync_threshold" },
-       { NET_IPV4_VS_NAT_ICMP_SEND,    "nat_icmp_send" },
-       { NET_IPV4_VS_LBLC_EXPIRE,              "lblc_expiration" },
-       { NET_IPV4_VS_LBLCR_EXPIRE,             "lblcr_expiration" },
-       {}
-};
-
 static struct trans_ctl_table trans_net_neigh_vars_table[] = {
        { NET_NEIGH_MCAST_SOLICIT,      "mcast_solicit" },
        { NET_NEIGH_UCAST_SOLICIT,      "ucast_solicit" },
@@ -341,7 +308,6 @@ static struct trans_ctl_table trans_net_ipv4_table[] = {
        { NET_IPV4_ROUTE,               "route",        trans_net_ipv4_route_table },
        /* NET_IPV4_FIB_HASH unused */
        { NET_IPV4_NETFILTER,           "netfilter",    trans_net_ipv4_netfilter_table },
-       { NET_IPV4_VS,                  "vs",           trans_net_ipv4_vs_table },
 
        { NET_IPV4_TCP_TIMESTAMPS,              "tcp_timestamps" },
        { NET_IPV4_TCP_WINDOW_SCALING,          "tcp_window_scaling" },
@@ -738,7 +704,7 @@ static struct trans_ctl_table trans_net_table[] = {
        { NET_ROSE,             "rose",         trans_net_rose_table },
        { NET_IPV6,             "ipv6",         trans_net_ipv6_table },
        { NET_X25,              "x25",          trans_net_x25_table },
-       { NET_TR,               "tr",           trans_net_tr_table },
+       { NET_TR,               "token-ring",   trans_net_tr_table },
        { NET_DECNET,           "decnet",       trans_net_decnet_table },
        /*  NET_ECONET not used */
        { NET_SCTP,             "sctp",         trans_net_sctp_table },
@@ -1219,16 +1185,6 @@ static struct trans_ctl_table trans_arlan_table[] = {
        {}
 };
 
-static struct trans_ctl_table trans_appldata_table[] = {
-       { CTL_APPLDATA_TIMER,           "timer" },
-       { CTL_APPLDATA_INTERVAL,        "interval" },
-       { CTL_APPLDATA_OS,              "os" },
-       { CTL_APPLDATA_NET_SUM,         "net_sum" },
-       { CTL_APPLDATA_MEM,             "mem" },
-       {}
-
-};
-
 static struct trans_ctl_table trans_s390dbf_table[] = {
        { 5678 /* CTL_S390DBF_STOPPABLE */,     "debug_stoppable" },
        { 5679 /* CTL_S390DBF_ACTIVE */,        "debug_active" },
@@ -1273,7 +1229,6 @@ static struct trans_ctl_table trans_root_table[] = {
        { CTL_ABI,      "abi" },
        /* CTL_CPU not used */
        { CTL_ARLAN,    "arlan",        trans_arlan_table },
-       { CTL_APPLDATA, "appldata",     trans_appldata_table },
        { CTL_S390DBF,  "s390dbf",      trans_s390dbf_table },
        { CTL_SUNRPC,   "sunrpc",       trans_sunrpc_table },
        { CTL_PM,       "pm",           trans_pm_table },
@@ -1432,6 +1387,7 @@ static void set_fail(const char **fail, struct ctl_table *table, const char *str
                printk(KERN_ERR "sysctl table check failed: ");
                sysctl_print_path(table);
                printk(" %s\n", *fail);
+               dump_stack();
        }
        *fail = str;
 }
index 354e74bc17c186099b50edd9471b7f6163ce2c62..07e86a828073bc7ebffdcdb67c3ee726be9a5705 100644 (file)
@@ -398,31 +398,31 @@ static int cgroupstats_user_cmd(struct sk_buff *skb, struct genl_info *info)
 
        fd = nla_get_u32(info->attrs[CGROUPSTATS_CMD_ATTR_FD]);
        file = fget_light(fd, &fput_needed);
-       if (file) {
-               size = nla_total_size(sizeof(struct cgroupstats));
+       if (!file)
+               return 0;
 
-               rc = prepare_reply(info, CGROUPSTATS_CMD_NEW, &rep_skb,
-                                       size);
-               if (rc < 0)
-                       goto err;
+       size = nla_total_size(sizeof(struct cgroupstats));
 
-               na = nla_reserve(rep_skb, CGROUPSTATS_TYPE_CGROUP_STATS,
-                                       sizeof(struct cgroupstats));
-               stats = nla_data(na);
-               memset(stats, 0, sizeof(*stats));
+       rc = prepare_reply(info, CGROUPSTATS_CMD_NEW, &rep_skb,
+                               size);
+       if (rc < 0)
+               goto err;
 
-               rc = cgroupstats_build(stats, file->f_dentry);
-               if (rc < 0)
-                       goto err;
+       na = nla_reserve(rep_skb, CGROUPSTATS_TYPE_CGROUP_STATS,
+                               sizeof(struct cgroupstats));
+       stats = nla_data(na);
+       memset(stats, 0, sizeof(*stats));
 
-               fput_light(file, fput_needed);
-               return send_reply(rep_skb, info->snd_pid);
+       rc = cgroupstats_build(stats, file->f_dentry);
+       if (rc < 0) {
+               nlmsg_free(rep_skb);
+               goto err;
        }
 
+       rc = send_reply(rep_skb, info->snd_pid);
+
 err:
-       if (file)
-               fput_light(file, fput_needed);
-       nlmsg_free(rep_skb);
+       fput_light(file, fput_needed);
        return rc;
 }
 
index de6a2d6b3ebb69ad65f1491e9f44a846e1b86f44..e64efaf957e8485b4d233412a69fdf45a1225691 100644 (file)
@@ -205,7 +205,7 @@ static void sync_cmos_clock(unsigned long dummy)
                return;
 
        getnstimeofday(&now);
-       if (abs(xtime.tv_nsec - (NSEC_PER_SEC / 2)) <= tick_nsec / 2)
+       if (abs(now.tv_nsec - (NSEC_PER_SEC / 2)) <= tick_nsec / 2)
                fail = update_persistent_clock(now);
 
        next.tv_nsec = (NSEC_PER_SEC / 2) - now.tv_nsec;
@@ -249,10 +249,12 @@ int do_adjtimex(struct timex *txc)
 
        /* Now we validate the data before disabling interrupts */
 
-       if ((txc->modes & ADJ_OFFSET_SINGLESHOT) == ADJ_OFFSET_SINGLESHOT)
+       if ((txc->modes & ADJ_OFFSET_SINGLESHOT) == ADJ_OFFSET_SINGLESHOT) {
          /* singleshot must not be used with any other mode bits */
-               if (txc->modes != ADJ_OFFSET_SINGLESHOT)
+               if (txc->modes != ADJ_OFFSET_SINGLESHOT &&
+                                       txc->modes != ADJ_OFFSET_SS_READ)
                        return -EINVAL;
+       }
 
        if (txc->modes != ADJ_OFFSET_SINGLESHOT && (txc->modes & ADJ_OFFSET))
          /* adjustment Offset limited to +- .512 seconds */
@@ -372,7 +374,8 @@ int do_adjtimex(struct timex *txc)
 leave: if ((time_status & (STA_UNSYNC|STA_CLOCKERR)) != 0)
                result = TIME_ERROR;
 
-       if ((txc->modes & ADJ_OFFSET_SINGLESHOT) == ADJ_OFFSET_SINGLESHOT)
+       if ((txc->modes == ADJ_OFFSET_SINGLESHOT) ||
+                       (txc->modes == ADJ_OFFSET_SS_READ))
                txc->offset = save_adjust;
        else
                txc->offset = ((long)shift_right(time_offset, SHIFT_UPDATE)) *
index 8cfb8b2ce773ed4838b3bb4c699b22c4c34423c7..aa82d7bf478a7adc8eb34700b3a5b540e672b28d 100644 (file)
@@ -508,7 +508,7 @@ static void tick_broadcast_clear_oneshot(int cpu)
 }
 
 /**
- * tick_broadcast_setup_highres - setup the broadcast device for highres
+ * tick_broadcast_setup_oneshot - setup the broadcast device
  */
 void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
 {
index 10a1347597fd394fec309d1ae74663ae2d9ae05c..27a2338deb4ae32d12dd0789a63503666d8e66c1 100644 (file)
@@ -320,10 +320,8 @@ ktime_t tick_nohz_get_sleep_length(void)
        return ts->sleep_length;
 }
 
-EXPORT_SYMBOL_GPL(tick_nohz_get_sleep_length);
-
 /**
- * nohz_restart_sched_tick - restart the idle tick from the idle task
+ * tick_nohz_restart_sched_tick - restart the idle tick from the idle task
  *
  * Restart the idle tick when the CPU is woken up from idle
  */
index fdb2e03d4fe0d40943b72a11050fafefefbf81d9..12c5f4cb6b8c67bd9d04bc8784989a2be9185fc1 100644 (file)
@@ -129,7 +129,8 @@ static void print_cpu(struct seq_file *m, int cpu, u64 now)
        struct hrtimer_cpu_base *cpu_base = &per_cpu(hrtimer_bases, cpu);
        int i;
 
-       SEQ_printf(m, "\ncpu: %d\n", cpu);
+       SEQ_printf(m, "\n");
+       SEQ_printf(m, "cpu: %d\n", cpu);
        for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) {
                SEQ_printf(m, " clock %d:\n", i);
                print_base(m, cpu_base->clock_base + i, now);
@@ -184,7 +185,8 @@ print_tickdevice(struct seq_file *m, struct tick_device *td)
 {
        struct clock_event_device *dev = td->evtdev;
 
-       SEQ_printf(m, "\nTick Device: mode:     %d\n", td->mode);
+       SEQ_printf(m, "\n");
+       SEQ_printf(m, "Tick Device: mode:     %d\n", td->mode);
 
        SEQ_printf(m, "Clock Event Device: ");
        if (!dev) {
index fb4e67d5dd6032eab811202526a194aa004523ad..a05817c021d62c1f93819ee666f2fc5bdb735f6a 100644 (file)
@@ -790,7 +790,7 @@ static unsigned long cmp_next_hrtimer_event(unsigned long now,
 }
 
 /**
- * next_timer_interrupt - return the jiffy of the next pending timer
+ * get_next_timer_interrupt - return the jiffy of the next pending timer
  * @now: current time (in jiffies)
  */
 unsigned long get_next_timer_interrupt(unsigned long now)
@@ -817,6 +817,19 @@ unsigned long next_timer_interrupt(void)
 
 #endif
 
+#ifndef CONFIG_VIRT_CPU_ACCOUNTING
+void account_process_tick(struct task_struct *p, int user_tick)
+{
+       if (user_tick) {
+               account_user_time(p, jiffies_to_cputime(1));
+               account_user_time_scaled(p, jiffies_to_cputime(1));
+       } else {
+               account_system_time(p, HARDIRQ_OFFSET, jiffies_to_cputime(1));
+               account_system_time_scaled(p, jiffies_to_cputime(1));
+       }
+}
+#endif
+
 /*
  * Called from the timer interrupt handler to charge one tick to the current
  * process.  user_tick is 1 if the tick is user time, 0 for system.
@@ -827,13 +840,7 @@ void update_process_times(int user_tick)
        int cpu = smp_processor_id();
 
        /* Note: this timer irq context must be accounted for as well. */
-       if (user_tick) {
-               account_user_time(p, jiffies_to_cputime(1));
-               account_user_time_scaled(p, jiffies_to_cputime(1));
-       } else {
-               account_system_time(p, HARDIRQ_OFFSET, jiffies_to_cputime(1));
-               account_system_time_scaled(p, jiffies_to_cputime(1));
-       }
+       account_process_tick(p, user_tick);
        run_local_timers();
        if (rcu_pending(cpu))
                rcu_check_callbacks(cpu, user_tick);
index 0f3aa0234107e3742b7727565b8343539df122c9..8320a87f3e5a11f11e2159488cf2dc3f6d9371d3 100644 (file)
@@ -337,8 +337,11 @@ struct user_struct * alloc_uid(struct user_namespace *ns, uid_t uid)
                struct user_struct *new;
 
                new = kmem_cache_alloc(uid_cachep, GFP_KERNEL);
-               if (!new)
+               if (!new) {
+                       uids_mutex_unlock();
                        return NULL;
+               }
+
                new->uid = uid;
                atomic_set(&new->__count, 1);
                atomic_set(&new->processes, 0);
@@ -355,6 +358,7 @@ struct user_struct * alloc_uid(struct user_namespace *ns, uid_t uid)
 
                if (alloc_uid_keyring(new, current) < 0) {
                        kmem_cache_free(uid_cachep, new);
+                       uids_mutex_unlock();
                        return NULL;
                }
 
@@ -362,6 +366,7 @@ struct user_struct * alloc_uid(struct user_namespace *ns, uid_t uid)
                        key_put(new->uid_keyring);
                        key_put(new->session_keyring);
                        kmem_cache_free(uid_cachep, new);
+                       uids_mutex_unlock();
                        return NULL;
                }
 
index 1e5f207b90748d3a79a8f739e0efbcd9606baddc..a60109307d329dda8d0a616018a83090499fcced 100644 (file)
@@ -359,7 +359,7 @@ config DEBUG_HIGHMEM
 config DEBUG_BUGVERBOSE
        bool "Verbose BUG() reporting (adds 70K)" if DEBUG_KERNEL && EMBEDDED
        depends on BUG
-       depends on ARM || AVR32 || M32R || M68K || SPARC32 || SPARC64 || FRV || SUPERH || GENERIC_BUG || BFIN
+       depends on ARM || AVR32 || M32R || M68K || SPARC32 || SPARC64 || FRV || SUPERH || GENERIC_BUG || BLACKFIN
        default !EMBEDDED
        help
          Say Y here to make BUG() panics output the file name and line number
@@ -409,7 +409,7 @@ config DEBUG_SG
 
 config FRAME_POINTER
        bool "Compile the kernel with frame pointers"
-       depends on DEBUG_KERNEL && (X86 || CRIS || M68K || M68KNOMMU || FRV || UML || S390 || AVR32 || SUPERH || BFIN)
+       depends on DEBUG_KERNEL && (X86 || CRIS || M68K || M68KNOMMU || FRV || UML || S390 || AVR32 || SUPERH || BLACKFIN)
        default y if DEBUG_INFO && UML
        help
          If you say Y here the resulting kernel image will be slightly larger
index 3a0983b77412cdc6b0336bb0e3e1f539ddc2d0cd..b6793ed28d849031ac43f3c4ebc73df7e7b294dd 100644 (file)
@@ -4,7 +4,7 @@
 
 lib-y := ctype.o string.o vsprintf.o cmdline.o \
         rbtree.o radix-tree.o dump_stack.o \
-        idr.o int_sqrt.o bitmap.o extable.o prio_tree.o \
+        idr.o int_sqrt.o extable.o prio_tree.o \
         sha1.o irq_regs.o reciprocal_div.o argv_split.o \
         proportions.o prio_heap.o
 
@@ -14,7 +14,7 @@ lib-$(CONFIG_SMP) += cpumask.o
 lib-y  += kobject.o kref.o klist.o
 
 obj-y += div64.o sort.o parser.o halfmd4.o debug_locks.o random32.o \
-        bust_spinlocks.o hexdump.o kasprintf.o
+        bust_spinlocks.o hexdump.o kasprintf.o bitmap.o
 
 ifeq ($(CONFIG_DEBUG_KOBJECT),y)
 CFLAGS_kobject.o += -DDEBUG
index 26ebafa8c41d7e0ff602c0d2137a8ea284bb1ae5..2c9242e3fed01ca348b4171db2c0d89333fa357e 100644 (file)
@@ -469,6 +469,10 @@ int bitmap_scnlistprintf(char *buf, unsigned int buflen,
        /* current bit is 'cur', most recently seen range is [rbot, rtop] */
        int cur, rbot, rtop;
 
+       if (buflen == 0)
+               return 0;
+       buf[0] = 0;
+
        rbot = cur = find_first_bit(maskp, nmaskbits);
        while (cur < nmaskbits) {
                rtop = cur;
index 03d40360ff1be9682f4c192fec63e45b0d9e33fd..a7e3bf4d3c70317273b63003dc18f714a546ac36 100644 (file)
@@ -308,6 +308,19 @@ int kobject_rename(struct kobject * kobj, const char *new_name)
        if (!kobj->parent)
                return -EINVAL;
 
+       /* see if this name is already in use */
+       if (kobj->kset) {
+               struct kobject *temp_kobj;
+               temp_kobj = kset_find_obj(kobj->kset, new_name);
+               if (temp_kobj) {
+                       printk(KERN_WARNING "kobject '%s' can not be renamed "
+                              "to '%s' as '%s' is already in existance.\n",
+                              kobject_name(kobj), new_name, new_name);
+                       kobject_put(temp_kobj);
+                       return -EINVAL;
+               }
+       }
+
        devpath = kobject_get_path(kobj, GFP_KERNEL);
        if (!devpath) {
                error = -ENOMEM;
index 802f11f0bf5baebf99460c1e4d238921764fab93..b5c3287d8ea47567220cbafd2211dd12b5239356 100644 (file)
@@ -33,7 +33,6 @@
 #include <linux/crc32c.h>
 #include <linux/compiler.h>
 #include <linux/module.h>
-#include <asm/byteorder.h>
 
 MODULE_AUTHOR("Clay Haapala <chaapala@cisco.com>");
 MODULE_DESCRIPTION("CRC32c (Castagnoli) calculations");
@@ -161,15 +160,13 @@ static const u32 crc32c_table[256] = {
  */
 
 u32 __pure
-crc32c_le(u32 seed, unsigned char const *data, size_t length)
+crc32c_le(u32 crc, unsigned char const *data, size_t length)
 {
-       u32 crc = __cpu_to_le32(seed);
-       
        while (length--)
                crc =
                    crc32c_table[(crc ^ *data++) & 0xFFL] ^ (crc >> 8);
 
-       return __le32_to_cpu(crc);
+       return crc;
 }
 
 #endif /* CRC_LE_BITS == 8 */
index 5209e47b7fe39dba855e84ee9ca4d89283fd3d80..188cf5fd3e8d4acedec4e74c05375238526506e5 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/backing-dev.h>
 #include <linux/pagevec.h>
 #include <linux/blkdev.h>
+#include <linux/backing-dev.h>
 #include <linux/security.h>
 #include <linux/syscalls.h>
 #include <linux/cpuset.h>
@@ -1299,7 +1300,7 @@ int filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 
        size = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
        if (vmf->pgoff >= size)
-               goto outside_data_content;
+               return VM_FAULT_SIGBUS;
 
        /* If we don't want any read-ahead, don't bother */
        if (VM_RandomReadHint(vma))
@@ -1376,7 +1377,7 @@ retry_find:
        if (unlikely(vmf->pgoff >= size)) {
                unlock_page(page);
                page_cache_release(page);
-               goto outside_data_content;
+               return VM_FAULT_SIGBUS;
        }
 
        /*
@@ -1387,15 +1388,6 @@ retry_find:
        vmf->page = page;
        return ret | VM_FAULT_LOCKED;
 
-outside_data_content:
-       /*
-        * An external ptracer can access pages that normally aren't
-        * accessible..
-        */
-       if (vma->vm_mm == current->mm)
-               return VM_FAULT_SIGBUS;
-
-       /* Fall through to the non-read-ahead case */
 no_cached_page:
        /*
         * We're only likely to ever get here if MADV_RANDOM is in
@@ -2510,21 +2502,17 @@ generic_file_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
        }
 
        retval = mapping->a_ops->direct_IO(rw, iocb, iov, offset, nr_segs);
-       if (retval)
-               goto out;
 
        /*
         * Finally, try again to invalidate clean pages which might have been
-        * faulted in by get_user_pages() if the source of the write was an
-        * mmap()ed region of the file we're writing.  That's a pretty crazy
-        * thing to do, so we don't support it 100%.  If this invalidation
-        * fails and we have -EIOCBQUEUED we ignore the failure.
+        * cached by non-direct readahead, or faulted in by get_user_pages()
+        * if the source of the write was an mmap'ed region of the file
+        * we're writing.  Either one is a pretty crazy thing to do,
+        * so we don't support it 100%.  If this invalidation
+        * fails, tough, the write still worked...
         */
        if (rw == WRITE && mapping->nrpages) {
-               int err = invalidate_inode_pages2_range(mapping,
-                                             offset >> PAGE_CACHE_SHIFT, end);
-               if (err && retval >= 0)
-                       retval = err;
+               invalidate_inode_pages2_range(mapping, offset >> PAGE_CACHE_SHIFT, end);
        }
 out:
        return retval;
index 8b809ecefa39e4b54f4bfbed8830009a9e260e96..6121b57bbe966735a6c44ae1f77854f2cec7c74b 100644 (file)
@@ -116,7 +116,9 @@ static void update_and_free_page(struct page *page)
 static void free_huge_page(struct page *page)
 {
        int nid = page_to_nid(page);
+       struct address_space *mapping;
 
+       mapping = (struct address_space *) page_private(page);
        BUG_ON(page_count(page));
        INIT_LIST_HEAD(&page->lru);
 
@@ -129,6 +131,9 @@ static void free_huge_page(struct page *page)
                enqueue_huge_page(page);
        }
        spin_unlock(&hugetlb_lock);
+       if (mapping)
+               hugetlb_put_quota(mapping, 1);
+       set_page_private(page, 0);
 }
 
 /*
@@ -323,7 +328,7 @@ free:
  * allocated to satisfy the reservation must be explicitly freed if they were
  * never used.
  */
-void return_unused_surplus_pages(unsigned long unused_resv_pages)
+static void return_unused_surplus_pages(unsigned long unused_resv_pages)
 {
        static int nid = -1;
        struct page *page;
@@ -353,35 +358,50 @@ void return_unused_surplus_pages(unsigned long unused_resv_pages)
        }
 }
 
-static struct page *alloc_huge_page(struct vm_area_struct *vma,
-                                   unsigned long addr)
+
+static struct page *alloc_huge_page_shared(struct vm_area_struct *vma,
+                                               unsigned long addr)
 {
-       struct page *page = NULL;
-       int use_reserved_page = vma->vm_flags & VM_MAYSHARE;
+       struct page *page;
 
        spin_lock(&hugetlb_lock);
-       if (!use_reserved_page && (free_huge_pages <= resv_huge_pages))
-               goto fail;
-
        page = dequeue_huge_page(vma, addr);
-       if (!page)
-               goto fail;
-
        spin_unlock(&hugetlb_lock);
-       set_page_refcounted(page);
-       return page;
+       return page ? page : ERR_PTR(-VM_FAULT_OOM);
+}
 
-fail:
-       spin_unlock(&hugetlb_lock);
+static struct page *alloc_huge_page_private(struct vm_area_struct *vma,
+                                               unsigned long addr)
+{
+       struct page *page = NULL;
 
-       /*
-        * Private mappings do not use reserved huge pages so the allocation
-        * may have failed due to an undersized hugetlb pool.  Try to grab a
-        * surplus huge page from the buddy allocator.
-        */
-       if (!use_reserved_page)
+       if (hugetlb_get_quota(vma->vm_file->f_mapping, 1))
+               return ERR_PTR(-VM_FAULT_SIGBUS);
+
+       spin_lock(&hugetlb_lock);
+       if (free_huge_pages > resv_huge_pages)
+               page = dequeue_huge_page(vma, addr);
+       spin_unlock(&hugetlb_lock);
+       if (!page)
                page = alloc_buddy_huge_page(vma, addr);
+       return page ? page : ERR_PTR(-VM_FAULT_OOM);
+}
+
+static struct page *alloc_huge_page(struct vm_area_struct *vma,
+                                   unsigned long addr)
+{
+       struct page *page;
+       struct address_space *mapping = vma->vm_file->f_mapping;
 
+       if (vma->vm_flags & VM_MAYSHARE)
+               page = alloc_huge_page_shared(vma, addr);
+       else
+               page = alloc_huge_page_private(vma, addr);
+
+       if (!IS_ERR(page)) {
+               set_page_refcounted(page);
+               set_page_private(page, (unsigned long) mapping);
+       }
        return page;
 }
 
@@ -726,9 +746,9 @@ static int hugetlb_cow(struct mm_struct *mm, struct vm_area_struct *vma,
        page_cache_get(old_page);
        new_page = alloc_huge_page(vma, address);
 
-       if (!new_page) {
+       if (IS_ERR(new_page)) {
                page_cache_release(old_page);
-               return VM_FAULT_OOM;
+               return -PTR_ERR(new_page);
        }
 
        spin_unlock(&mm->page_table_lock);
@@ -772,27 +792,28 @@ retry:
                size = i_size_read(mapping->host) >> HPAGE_SHIFT;
                if (idx >= size)
                        goto out;
-               if (hugetlb_get_quota(mapping))
-                       goto out;
                page = alloc_huge_page(vma, address);
-               if (!page) {
-                       hugetlb_put_quota(mapping);
-                       ret = VM_FAULT_OOM;
+               if (IS_ERR(page)) {
+                       ret = -PTR_ERR(page);
                        goto out;
                }
                clear_huge_page(page, address);
 
                if (vma->vm_flags & VM_SHARED) {
                        int err;
+                       struct inode *inode = mapping->host;
 
                        err = add_to_page_cache(page, mapping, idx, GFP_KERNEL);
                        if (err) {
                                put_page(page);
-                               hugetlb_put_quota(mapping);
                                if (err == -EEXIST)
                                        goto retry;
                                goto out;
                        }
+
+                       spin_lock(&inode->i_lock);
+                       inode->i_blocks += BLOCKS_PER_HUGEPAGE;
+                       spin_unlock(&inode->i_lock);
                } else
                        lock_page(page);
        }
@@ -822,7 +843,6 @@ out:
 
 backout:
        spin_unlock(&mm->page_table_lock);
-       hugetlb_put_quota(mapping);
        unlock_page(page);
        put_page(page);
        goto out;
@@ -868,7 +888,8 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
 
 int follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,
                        struct page **pages, struct vm_area_struct **vmas,
-                       unsigned long *position, int *length, int i)
+                       unsigned long *position, int *length, int i,
+                       int write)
 {
        unsigned long pfn_offset;
        unsigned long vaddr = *position;
@@ -890,7 +911,7 @@ int follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,
                        int ret;
 
                        spin_unlock(&mm->page_table_lock);
-                       ret = hugetlb_fault(mm, vma, vaddr, 0);
+                       ret = hugetlb_fault(mm, vma, vaddr, write);
                        spin_lock(&mm->page_table_lock);
                        if (!(ret & VM_FAULT_ERROR))
                                continue;
@@ -1132,6 +1153,8 @@ int hugetlb_reserve_pages(struct inode *inode, long from, long to)
        if (chg < 0)
                return chg;
 
+       if (hugetlb_get_quota(inode->i_mapping, chg))
+               return -ENOSPC;
        ret = hugetlb_acct_memory(chg);
        if (ret < 0)
                return ret;
@@ -1142,5 +1165,11 @@ int hugetlb_reserve_pages(struct inode *inode, long from, long to)
 void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed)
 {
        long chg = region_truncate(&inode->i_mapping->private_list, offset);
-       hugetlb_acct_memory(freed - chg);
+
+       spin_lock(&inode->i_lock);
+       inode->i_blocks -= BLOCKS_PER_HUGEPAGE * freed;
+       spin_unlock(&inode->i_lock);
+
+       hugetlb_put_quota(inode->i_mapping, (chg - freed));
+       hugetlb_acct_memory(-(chg - freed));
 }
index eefd5b68bc42d76768e773a43ae310806c9fa17c..4bf0b6d0eb2a675bbd1083099448d54979dff304 100644 (file)
@@ -1036,7 +1036,7 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
 
                if (is_vm_hugetlb_page(vma)) {
                        i = follow_hugetlb_page(mm, vma, pages, vmas,
-                                               &start, &len, i);
+                                               &start, &len, i, write);
                        continue;
                }
 
@@ -2084,9 +2084,9 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma,
                count_vm_event(PGMAJFAULT);
        }
 
-       delayacct_clear_flag(DELAYACCT_PF_SWAPIN);
        mark_page_accessed(page);
        lock_page(page);
+       delayacct_clear_flag(DELAYACCT_PF_SWAPIN);
 
        /*
         * Back out if somebody else already faulted in this pte.
@@ -2748,4 +2748,3 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, in
 
        return buf - old_buf;
 }
-EXPORT_SYMBOL_GPL(access_process_vm);
index 3a47871a29d909c561a4371f6afca71f59689126..9512a544d0449ebcb789de665d9e8fc8ee0fdc8b 100644 (file)
@@ -39,7 +39,7 @@ static struct resource *register_memory_resource(u64 start, u64 size)
        res->name = "System RAM";
        res->start = start;
        res->end = start + size - 1;
-       res->flags = IORESOURCE_MEM;
+       res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
        if (request_resource(&iomem_resource, res) < 0) {
                printk("System RAM resource %llx - %llx cannot be added\n",
                (unsigned long long)res->start, (unsigned long long)res->end);
@@ -574,8 +574,8 @@ repeat:
        /* Ok, all of our target is islaoted.
           We cannot do rollback at this point. */
        offline_isolated_pages(start_pfn, end_pfn);
-       /* reset pagetype flags */
-       start_isolate_page_range(start_pfn, end_pfn);
+       /* reset pagetype flags and makes migrate type to be MOVABLE */
+       undo_isolate_page_range(start_pfn, end_pfn);
        /* removal success */
        zone->present_pages -= offlined_pages;
        zone->zone_pgdat->node_present_pages -= offlined_pages;
index c1592a94582f8c2950a6a4cf34711f02a35066c6..83c69f8a64c29dd0878050b3912e5f0c2b1af3ac 100644 (file)
@@ -722,12 +722,29 @@ out:
 
 }
 
+/*
+ * Allocate a new page for page migration based on vma policy.
+ * Start assuming that page is mapped by vma pointed to by @private.
+ * Search forward from there, if not.  N.B., this assumes that the
+ * list of pages handed to migrate_pages()--which is how we get here--
+ * is in virtual address order.
+ */
 static struct page *new_vma_page(struct page *page, unsigned long private, int **x)
 {
        struct vm_area_struct *vma = (struct vm_area_struct *)private;
+       unsigned long uninitialized_var(address);
 
-       return alloc_page_vma(GFP_HIGHUSER_MOVABLE, vma,
-                                       page_address_in_vma(page, vma));
+       while (vma) {
+               address = page_address_in_vma(page, vma);
+               if (address != -EFAULT)
+                       break;
+               vma = vma->vm_next;
+       }
+
+       /*
+        * if !vma, alloc_page_vma() will use task or system default policy
+        */
+       return alloc_page_vma(GFP_HIGHUSER_MOVABLE, vma, address);
 }
 #else
 
index 8f09333f78e1d63dbe1a5d24c9ba240ce683dbc6..35622c59092546b9fd91d1aa31eceb3504bae41d 100644 (file)
@@ -12,6 +12,7 @@
  *  Copyright (c) 2002      Greg Ungerer <gerg@snapgear.com>
  */
 
+#include <linux/module.h>
 #include <linux/mm.h>
 #include <linux/mman.h>
 #include <linux/swap.h>
index 838a5e31394cbbbe0e9a34b66e1570cf03b5bb86..d55cfcae2ef1fea2082d28173dd2f94e1e6666ce 100644 (file)
@@ -297,20 +297,12 @@ get_dirty_limits(long *pbackground, long *pdirty, long *pbdi_dirty,
 {
        int background_ratio;           /* Percentages */
        int dirty_ratio;
-       int unmapped_ratio;
        long background;
        long dirty;
        unsigned long available_memory = determine_dirtyable_memory();
        struct task_struct *tsk;
 
-       unmapped_ratio = 100 - ((global_page_state(NR_FILE_MAPPED) +
-                               global_page_state(NR_ANON_PAGES)) * 100) /
-                                       available_memory;
-
        dirty_ratio = vm_dirty_ratio;
-       if (dirty_ratio > unmapped_ratio / 2)
-               dirty_ratio = unmapped_ratio / 2;
-
        if (dirty_ratio < 5)
                dirty_ratio = 5;
 
@@ -355,8 +347,8 @@ get_dirty_limits(long *pbackground, long *pdirty, long *pbdi_dirty,
  */
 static void balance_dirty_pages(struct address_space *mapping)
 {
-       long bdi_nr_reclaimable;
-       long bdi_nr_writeback;
+       long nr_reclaimable, bdi_nr_reclaimable;
+       long nr_writeback, bdi_nr_writeback;
        long background_thresh;
        long dirty_thresh;
        long bdi_thresh;
@@ -376,11 +368,26 @@ static void balance_dirty_pages(struct address_space *mapping)
 
                get_dirty_limits(&background_thresh, &dirty_thresh,
                                &bdi_thresh, bdi);
+
+               nr_reclaimable = global_page_state(NR_FILE_DIRTY) +
+                                       global_page_state(NR_UNSTABLE_NFS);
+               nr_writeback = global_page_state(NR_WRITEBACK);
+
                bdi_nr_reclaimable = bdi_stat(bdi, BDI_RECLAIMABLE);
                bdi_nr_writeback = bdi_stat(bdi, BDI_WRITEBACK);
+
                if (bdi_nr_reclaimable + bdi_nr_writeback <= bdi_thresh)
                        break;
 
+               /*
+                * Throttle it only when the background writeback cannot
+                * catch-up. This avoids (excessively) small writeouts
+                * when the bdi limits are ramping up.
+                */
+               if (nr_reclaimable + nr_writeback <
+                               (background_thresh + dirty_thresh) / 2)
+                       break;
+
                if (!bdi->dirty_exceeded)
                        bdi->dirty_exceeded = 1;
 
index da69d833e0671fe6b8a04b019e47b63c7dcf0f4c..12376ae3f7334e124d488b1d7bc3d291d64e9be1 100644 (file)
@@ -749,23 +749,6 @@ int move_freepages_block(struct zone *zone, struct page *page, int migratetype)
        return move_freepages(zone, start_page, end_page, migratetype);
 }
 
-/* Return the page with the lowest PFN in the list */
-static struct page *min_page(struct list_head *list)
-{
-       unsigned long min_pfn = -1UL;
-       struct page *min_page = NULL, *page;;
-
-       list_for_each_entry(page, list, lru) {
-               unsigned long pfn = page_to_pfn(page);
-               if (pfn < min_pfn) {
-                       min_pfn = pfn;
-                       min_page = page;
-               }
-       }
-
-       return min_page;
-}
-
 /* Remove an element from the buddy allocator from the fallback list */
 static struct page *__rmqueue_fallback(struct zone *zone, int order,
                                                int start_migratetype)
@@ -789,11 +772,8 @@ static struct page *__rmqueue_fallback(struct zone *zone, int order,
                        if (list_empty(&area->free_list[migratetype]))
                                continue;
 
-                       /* Bias kernel allocations towards low pfns */
                        page = list_entry(area->free_list[migratetype].next,
                                        struct page, lru);
-                       if (unlikely(start_migratetype != MIGRATE_MOVABLE))
-                               page = min_page(&area->free_list[migratetype]);
                        area->nr_free--;
 
                        /*
index 8f92a29695cc93e82e19582c998b6702ff5e9a2f..3444b58033c87e4263c1d2f1db79f8f416580a29 100644 (file)
@@ -55,7 +55,7 @@ start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn)
        return 0;
 undo:
        for (pfn = start_pfn;
-            pfn <= undo_pfn;
+            pfn < undo_pfn;
             pfn += pageblock_nr_pages)
                unset_migratetype_isolate(pfn_to_page(pfn));
 
@@ -76,7 +76,7 @@ undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn)
             pfn < end_pfn;
             pfn += pageblock_nr_pages) {
                page = __first_valid_page(pfn, pageblock_nr_pages);
-               if (!page || get_pageblock_flags(page) != MIGRATE_ISOLATE)
+               if (!page || get_pageblock_migratetype(page) != MIGRATE_ISOLATE)
                        continue;
                unset_migratetype_isolate(page);
        }
@@ -126,7 +126,7 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn)
         */
        for (pfn = start_pfn; pfn < end_pfn; pfn += pageblock_nr_pages) {
                page = __first_valid_page(pfn, pageblock_nr_pages);
-               if (page && get_pageblock_flags(page) != MIGRATE_ISOLATE)
+               if (page && get_pageblock_migratetype(page) != MIGRATE_ISOLATE)
                        break;
        }
        if (pfn < end_pfn)
index 8990f909492f31d8a3f01df258907661db1bccf6..dbc2ca2057a54ff2c4a709de4b6e9a01694241bb 100644 (file)
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -183,7 +183,9 @@ static void page_unlock_anon_vma(struct anon_vma *anon_vma)
 }
 
 /*
- * At what user virtual address is page expected in vma?
+ * At what user virtual address is page expected in @vma?
+ * Returns virtual address or -EFAULT if page's index/offset is not
+ * within the range mapped the @vma.
  */
 static inline unsigned long
 vma_address(struct page *page, struct vm_area_struct *vma)
@@ -193,8 +195,7 @@ vma_address(struct page *page, struct vm_area_struct *vma)
 
        address = vma->vm_start + ((pgoff - vma->vm_pgoff) << PAGE_SHIFT);
        if (unlikely(address < vma->vm_start || address >= vma->vm_end)) {
-               /* page should be within any vma from prio_tree_next */
-               BUG_ON(!PageAnon(page));
+               /* page should be within @vma mapping range */
                return -EFAULT;
        }
        return address;
@@ -470,11 +471,12 @@ int page_mkclean(struct page *page)
 
        if (page_mapped(page)) {
                struct address_space *mapping = page_mapping(page);
-               if (mapping)
+               if (mapping) {
                        ret = page_mkclean_file(mapping, page);
-               if (page_test_dirty(page)) {
-                       page_clear_dirty(page);
-                       ret = 1;
+                       if (page_test_dirty(page)) {
+                               page_clear_dirty(page);
+                               ret = 1;
+                       }
                }
        }
 
index 404e53bb212764f8a6ab7f5bf688c54d4d4c9d06..253d205914bad382e48abfd49393f6fe87179646 100644 (file)
@@ -915,6 +915,21 @@ static int shmem_writepage(struct page *page, struct writeback_control *wbc)
        struct inode *inode;
 
        BUG_ON(!PageLocked(page));
+       /*
+        * shmem_backing_dev_info's capabilities prevent regular writeback or
+        * sync from ever calling shmem_writepage; but a stacking filesystem
+        * may use the ->writepage of its underlying filesystem, in which case
+        * we want to do nothing when that underlying filesystem is tmpfs
+        * (writing out to swap is useful as a response to memory pressure, but
+        * of no use to stabilize the data) - just redirty the page, unlock it
+        * and claim success in this case.  AOP_WRITEPAGE_ACTIVATE, and the
+        * page_mapped check below, must be avoided unless we're in reclaim.
+        */
+       if (!wbc->for_reclaim) {
+               set_page_dirty(page);
+               unlock_page(page);
+               return 0;
+       }
        BUG_ON(page_mapped(page));
 
        mapping = page->mapping;
index cfa6be4e378ea1c625081e3ace43c5b212f41968..c31cd3682a0b77ded3ac4e76cded3f427537a551 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1043,7 +1043,7 @@ static struct array_cache **alloc_alien_cache(int node, int limit)
                        }
                        ac_ptr[i] = alloc_arraycache(node, limit, 0xbaadf00d);
                        if (!ac_ptr[i]) {
-                               for (i--; i <= 0; i--)
+                               for (i--; i >= 0; i--)
                                        kfree(ac_ptr[i]);
                                kfree(ac_ptr);
                                return NULL;
index 5bc2ceb692ec94925340e0b65ce4cb8695e2cee1..08a9bd91a1aaf517f1b17ff688fa9f612273f873 100644 (file)
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -321,7 +321,8 @@ static void *slob_alloc(size_t size, gfp_t gfp, int align, int node)
                /* Improve fragment distribution and reduce our average
                 * search time by starting our next search here. (see
                 * Knuth vol 1, sec 2.5, pg 449) */
-               if (free_slob_pages.next != prev->next)
+               if (prev != free_slob_pages.prev &&
+                               free_slob_pages.next != prev->next)
                        list_move_tail(&free_slob_pages, prev->next);
                break;
        }
index aac1dd3c657d1de350c5e7615a31d0c8021abb55..9acb413858ac532e9a668d4d2b351f4acdbd14c3 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1080,7 +1080,6 @@ static struct page *new_slab(struct kmem_cache *s, gfp_t flags, int node)
        struct page *page;
        struct kmem_cache_node *n;
        void *start;
-       void *end;
        void *last;
        void *p;
 
@@ -1101,7 +1100,6 @@ static struct page *new_slab(struct kmem_cache *s, gfp_t flags, int node)
                SetSlabDebug(page);
 
        start = page_address(page);
-       end = start + s->objects * s->size;
 
        if (unlikely(s->flags & SLAB_POISON))
                memset(start, POISON_INUSE, PAGE_SIZE << s->order);
@@ -1511,26 +1509,8 @@ new_slab:
 
        if (new) {
                c = get_cpu_slab(s, smp_processor_id());
-               if (c->page) {
-                       /*
-                        * Someone else populated the cpu_slab while we
-                        * enabled interrupts, or we have gotten scheduled
-                        * on another cpu. The page may not be on the
-                        * requested node even if __GFP_THISNODE was
-                        * specified. So we need to recheck.
-                        */
-                       if (node_match(c, node)) {
-                               /*
-                                * Current cpuslab is acceptable and we
-                                * want the current one since its cache hot
-                                */
-                               discard_slab(s, new);
-                               slab_lock(c->page);
-                               goto load_freelist;
-                       }
-                       /* New slab does not fit our expectations */
+               if (c->page)
                        flush_slab(s, c);
-               }
                slab_lock(new);
                SetSlabFrozen(new);
                c->page = new;
@@ -2734,7 +2714,7 @@ static void slab_mem_offline_callback(void *arg)
                         * and offline_pages() function shoudn't call this
                         * callback. So, we must fail.
                         */
-                       BUG_ON(atomic_read(&n->nr_slabs));
+                       BUG_ON(atomic_long_read(&n->nr_slabs));
 
                        s->node[offline_node] = NULL;
                        kmem_cache_free(kmalloc_caches, n);
index d3b718b0c20a4dde049a6ca4e8301bcfcfdc824d..22620f6a976bd3909a92ad1d8f1720ab09e4dce4 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #include <linux/vmalloc.h>
+#include <linux/sched.h>
 #include <asm/dma.h>
 #include <asm/pgalloc.h>
 #include <asm/pgtable.h>
index 08fb14f5eea3b45f927b4dee0c0ff6ba58c1c903..e06f514fe04faa748c5e50e3f4cb25789d977238 100644 (file)
@@ -220,12 +220,6 @@ static int __meminit sparse_init_one_section(struct mem_section *ms,
        return 1;
 }
 
-__attribute__((weak)) __init
-void *alloc_bootmem_high_node(pg_data_t *pgdat, unsigned long size)
-{
-       return NULL;
-}
-
 static unsigned long usemap_size(void)
 {
        unsigned long size_bytes;
@@ -267,11 +261,6 @@ struct page __init *sparse_mem_map_populate(unsigned long pnum, int nid)
        if (map)
                return map;
 
-       map = alloc_bootmem_high_node(NODE_DATA(nid),
-                       sizeof(struct page) * PAGES_PER_SECTION);
-       if (map)
-               return map;
-
        map = alloc_bootmem_node(NODE_DATA(nid),
                        sizeof(struct page) * PAGES_PER_SECTION);
        return map;
index 5f64026cbb4d0f6c053a539ffb0d723255da85f3..8f18683825bcd0e3b95b4fe1754befb3e0b0268c 100644 (file)
--- a/mm/util.c
+++ b/mm/util.c
@@ -95,8 +95,8 @@ void *krealloc(const void *p, size_t new_size, gfp_t flags)
                return (void *)p;
 
        ret = kmalloc_track_caller(new_size, flags);
-       if (ret) {
-               memcpy(ret, p, min(new_size, ks));
+       if (ret && p) {
+               memcpy(ret, p, ks);
                kfree(p);
        }
        return ret;
index 4651bf153f355998617b9657d0d02eb966d7c3e9..e8d846f57774ee631adc5836aeaa6498b39736a0 100644 (file)
@@ -803,7 +803,7 @@ static void vmstat_update(struct work_struct *w)
                sysctl_stat_interval);
 }
 
-static void __devinit start_cpu_timer(int cpu)
+static void __cpuinit start_cpu_timer(int cpu)
 {
        struct delayed_work *vmstat_work = &per_cpu(vmstat_work, cpu);
 
index 3fe4fc86055faa4765701c3e36f88fed043cfaeb..6567213959cbac09f68a2a4973d4283361688196 100644 (file)
@@ -376,6 +376,7 @@ void vlan_setup(struct net_device *new_dev)
        new_dev->init = vlan_dev_init;
        new_dev->open = vlan_dev_open;
        new_dev->stop = vlan_dev_stop;
+       new_dev->set_mac_address = vlan_set_mac_address;
        new_dev->set_multicast_list = vlan_dev_set_multicast_list;
        new_dev->change_rx_flags = vlan_change_rx_flags;
        new_dev->destructor = free_netdev;
@@ -636,6 +637,10 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
                        if (!vlandev)
                                continue;
 
+                       flgs = vlandev->flags;
+                       if (!(flgs & IFF_UP))
+                               continue;
+
                        vlan_sync_address(dev, vlandev);
                }
                break;
@@ -747,6 +752,7 @@ static int vlan_ioctl_handler(struct net *net, void __user *arg)
                vlan_dev_set_ingress_priority(dev,
                                              args.u.skb_priority,
                                              args.vlan_qos);
+               err = 0;
                break;
 
        case SET_VLAN_EGRESS_PRIORITY_CMD:
index cf4a80d06b3526f1ca2caf4e938561ec57c4dca9..2cd1393073ec8e4e845aac4d0f14672dabbf1f37 100644 (file)
@@ -60,6 +60,7 @@ int vlan_dev_hwaccel_hard_start_xmit(struct sk_buff *skb, struct net_device *dev
 int vlan_dev_change_mtu(struct net_device *dev, int new_mtu);
 int vlan_dev_open(struct net_device* dev);
 int vlan_dev_stop(struct net_device* dev);
+int vlan_set_mac_address(struct net_device *dev, void *p);
 int vlan_dev_ioctl(struct net_device* dev, struct ifreq *ifr, int cmd);
 void vlan_dev_set_ingress_priority(const struct net_device *dev,
                                   u32 skb_prio, short vlan_prio);
index 1a1740aa9a8b52ced5b71c4b2443b2eea773c0a7..7a36878241dabf132f09fb861afca2b68f10ca77 100644 (file)
@@ -665,6 +665,32 @@ int vlan_dev_stop(struct net_device *dev)
        return 0;
 }
 
+int vlan_set_mac_address(struct net_device *dev, void *p)
+{
+       struct net_device *real_dev = VLAN_DEV_INFO(dev)->real_dev;
+       struct sockaddr *addr = p;
+       int err;
+
+       if (!is_valid_ether_addr(addr->sa_data))
+               return -EADDRNOTAVAIL;
+
+       if (!(dev->flags & IFF_UP))
+               goto out;
+
+       if (compare_ether_addr(addr->sa_data, real_dev->dev_addr)) {
+               err = dev_unicast_add(real_dev, addr->sa_data, ETH_ALEN);
+               if (err < 0)
+                       return err;
+       }
+
+       if (compare_ether_addr(dev->dev_addr, real_dev->dev_addr))
+               dev_unicast_delete(real_dev, dev->dev_addr, ETH_ALEN);
+
+out:
+       memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
+       return 0;
+}
+
 int vlan_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {
        struct net_device *real_dev = VLAN_DEV_INFO(dev)->real_dev;
index 41d70f47375ddd5d825268b76ad7629bac368ef6..8f9763a9dc1296b54a2d889a6bae9402ccf6cd37 100644 (file)
@@ -76,9 +76,9 @@ struct p9_trans_module *v9fs_match_trans(const substring_t *name)
        list_for_each(p, &v9fs_trans_list) {
                t = list_entry(p, struct p9_trans_module, list);
                if (strncmp(t->name, name->from, name->to-name->from) == 0)
-                       break;
+                       return t;
        }
-       return t;
+       return NULL;
 }
 EXPORT_SYMBOL(v9fs_match_trans);
 
index 30269a4ff22a93e781be185df453c60f88837ba8..62332ed9da4afcd7e8b06577f0e4ec47d07ed171 100644 (file)
@@ -62,13 +62,14 @@ struct p9_trans_fd {
 
 enum {
        /* Options that take integer arguments */
-       Opt_port, Opt_rfdno, Opt_wfdno,
+       Opt_port, Opt_rfdno, Opt_wfdno, Opt_err,
 };
 
 static match_table_t tokens = {
        {Opt_port, "port=%u"},
        {Opt_rfdno, "rfdno=%u"},
        {Opt_wfdno, "wfdno=%u"},
+       {Opt_err, NULL},
 };
 
 /**
index 7c0b5151d5265408614fda8c25e489aff50c5b41..e0d37d6dc1f81e6ec7455fe5d1f0c5acabc0ccd8 100644 (file)
@@ -1044,7 +1044,7 @@ static int atalk_create(struct net *net, struct socket *sock, int protocol)
        if (sock->type != SOCK_RAW && sock->type != SOCK_DGRAM)
                goto out;
        rc = -ENOMEM;
-       sk = sk_alloc(net, PF_APPLETALK, GFP_KERNEL, &ddp_proto, 1);
+       sk = sk_alloc(net, PF_APPLETALK, GFP_KERNEL, &ddp_proto);
        if (!sk)
                goto out;
        rc = 0;
index e166d9e0ffd949f0fe9246a615d7f0a7fbb54b9d..eba09a04f6bf446f7922ca6b2a36e4b976993143 100644 (file)
@@ -133,7 +133,7 @@ int vcc_create(struct net *net, struct socket *sock, int protocol, int family)
        sock->sk = NULL;
        if (sock->type == SOCK_STREAM)
                return -EINVAL;
-       sk = sk_alloc(net, family, GFP_KERNEL, &vcc_proto, 1);
+       sk = sk_alloc(net, family, GFP_KERNEL, &vcc_proto);
        if (!sk)
                return -ENOMEM;
        sock_init_data(sock, sk);
index 993e5c75e90908c22c079f02ae5646f250fbfa8f..8378afd54b3014139eadf74f1414252a088e2966 100644 (file)
@@ -836,7 +836,8 @@ static int ax25_create(struct net *net, struct socket *sock, int protocol)
                return -ESOCKTNOSUPPORT;
        }
 
-       if ((sk = sk_alloc(net, PF_AX25, GFP_ATOMIC, &ax25_proto, 1)) == NULL)
+       sk = sk_alloc(net, PF_AX25, GFP_ATOMIC, &ax25_proto);
+       if (sk == NULL)
                return -ENOMEM;
 
        ax25 = sk->sk_protinfo = ax25_create_cb();
@@ -861,7 +862,8 @@ struct sock *ax25_make_new(struct sock *osk, struct ax25_dev *ax25_dev)
        struct sock *sk;
        ax25_cb *ax25, *oax25;
 
-       if ((sk = sk_alloc(osk->sk_net, PF_AX25, GFP_ATOMIC, osk->sk_prot, 1)) == NULL)
+       sk = sk_alloc(osk->sk_net, PF_AX25, GFP_ATOMIC, osk->sk_prot);
+       if (sk == NULL)
                return NULL;
 
        if ((ax25 = ax25_create_cb()) == NULL) {
index f718965f296c7c3cdd2b46453ffff644fd62fa53..9ebd3c64474d916480506d20e2db8be6f1b30182 100644 (file)
@@ -213,7 +213,7 @@ static int bnep_sock_create(struct net *net, struct socket *sock, int protocol)
        if (sock->type != SOCK_RAW)
                return -ESOCKTNOSUPPORT;
 
-       sk = sk_alloc(net, PF_BLUETOOTH, GFP_ATOMIC, &bnep_proto, 1);
+       sk = sk_alloc(net, PF_BLUETOOTH, GFP_ATOMIC, &bnep_proto);
        if (!sk)
                return -ENOMEM;
 
index cf700c20d11eb8915d901914ce3a02e8b546d838..783edab12ce82c024610b9dd3b91b9ee9f21ca3e 100644 (file)
@@ -204,7 +204,7 @@ static int cmtp_sock_create(struct net *net, struct socket *sock, int protocol)
        if (sock->type != SOCK_RAW)
                return -ESOCKTNOSUPPORT;
 
-       sk = sk_alloc(net, PF_BLUETOOTH, GFP_ATOMIC, &cmtp_proto, 1);
+       sk = sk_alloc(net, PF_BLUETOOTH, GFP_ATOMIC, &cmtp_proto);
        if (!sk)
                return -ENOMEM;
 
index 8825102c517c48180960a5821c949f6463ce0480..14991323c273a15793823107e25d79af5403f58e 100644 (file)
@@ -645,7 +645,7 @@ static int hci_sock_create(struct net *net, struct socket *sock, int protocol)
 
        sock->ops = &hci_sock_ops;
 
-       sk = sk_alloc(net, PF_BLUETOOTH, GFP_ATOMIC, &hci_sk_proto, 1);
+       sk = sk_alloc(net, PF_BLUETOOTH, GFP_ATOMIC, &hci_sk_proto);
        if (!sk)
                return -ENOMEM;
 
index 1de2b6fbcac0d442a2d9073e145aa82e3eb9c1d4..3292b956a7c491267d023ae5406561447a639810 100644 (file)
@@ -255,7 +255,7 @@ static int hidp_sock_create(struct net *net, struct socket *sock, int protocol)
        if (sock->type != SOCK_RAW)
                return -ESOCKTNOSUPPORT;
 
-       sk = sk_alloc(net, PF_BLUETOOTH, GFP_ATOMIC, &hidp_proto, 1);
+       sk = sk_alloc(net, PF_BLUETOOTH, GFP_ATOMIC, &hidp_proto);
        if (!sk)
                return -ENOMEM;
 
index 6fbbae78b30452c8ee6e20742d011ebaba4acc11..477e052b17b5d57bdbb820f9b5b98252b13f17b9 100644 (file)
@@ -607,7 +607,7 @@ static struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, int p
 {
        struct sock *sk;
 
-       sk = sk_alloc(net, PF_BLUETOOTH, prio, &l2cap_proto, 1);
+       sk = sk_alloc(net, PF_BLUETOOTH, prio, &l2cap_proto);
        if (!sk)
                return NULL;
 
index 266b6972667d7713899a22681af5f0a8eef21f73..c46d51035e77fa9e1f4db6e95fadb3f2e17f3e60 100644 (file)
@@ -287,7 +287,7 @@ static struct sock *rfcomm_sock_alloc(struct net *net, struct socket *sock, int
        struct rfcomm_dlc *d;
        struct sock *sk;
 
-       sk = sk_alloc(net, PF_BLUETOOTH, prio, &rfcomm_proto, 1);
+       sk = sk_alloc(net, PF_BLUETOOTH, prio, &rfcomm_proto);
        if (!sk)
                return NULL;
 
index 82d0dfdfa7e268a3dc21d03fb6d3d822b6998c50..93ad1aae3f38dece58f5820002216c18942b6b75 100644 (file)
@@ -421,7 +421,7 @@ static struct sock *sco_sock_alloc(struct net *net, struct socket *sock, int pro
 {
        struct sock *sk;
 
-       sk = sk_alloc(net, PF_BLUETOOTH, prio, &sco_proto, 1);
+       sk = sk_alloc(net, PF_BLUETOOTH, prio, &sco_proto);
        if (!sk)
                return NULL;
 
index da22f900e89dca6f54b9b46990e37d6f7feb8086..c1757c79dfbb3eaf7f857441f9a71966155b24a0 100644 (file)
@@ -766,6 +766,9 @@ static unsigned int br_nf_post_routing(unsigned int hook, struct sk_buff *skb,
        if (!nf_bridge)
                return NF_ACCEPT;
 
+       if (!(nf_bridge->mask & (BRNF_BRIDGED | BRNF_BRIDGED_DNAT)))
+               return NF_ACCEPT;
+
        if (!realoutdev)
                return NF_DROP;
 
index 392d877040d31897f063d97c49b49ff7c1949532..6436d30a550eac56f42a2d2a8a44aab7295cb9fa 100644 (file)
@@ -187,7 +187,7 @@ static int ebt_among_check(const char *tablename, unsigned int hookmask,
 
        if (datalen != EBT_ALIGN(expected_length)) {
                printk(KERN_WARNING
-                      "ebtables: among: wrong size: %d"
+                      "ebtables: among: wrong size: %d "
                       "against expected %d, rounded to %Zd\n",
                       datalen, expected_length,
                       EBT_ALIGN(expected_length));
index 1a46952a56d9f197077e97e9cddf9814f24544b6..18141392a9b4eb87a45afc11902ae89249c7e7ac 100644 (file)
@@ -34,7 +34,7 @@ static int ebt_filter_arp(const struct sk_buff *skb, const struct net_device *in
           ah->ar_pro, EBT_ARP_PTYPE))
                return EBT_NOMATCH;
 
-       if (info->bitmask & (EBT_ARP_SRC_IP | EBT_ARP_DST_IP)) {
+       if (info->bitmask & (EBT_ARP_SRC_IP | EBT_ARP_DST_IP | EBT_ARP_GRAT)) {
                __be32 saddr, daddr, *sap, *dap;
 
                if (ah->ar_pln != sizeof(__be32) || ah->ar_pro != htons(ETH_P_IP))
index 853c8b575f1d51d2300433073d8e1795b85806a5..86d62611f2fcc4583f2eaf9a40d600718944ad97 100644 (file)
@@ -1171,6 +1171,8 @@ rollback:
                        nb->notifier_call(nb, NETDEV_UNREGISTER, dev);
                }
        }
+
+       raw_notifier_chain_unregister(&netdev_chain, nb);
        goto unlock;
 }
 
@@ -1751,9 +1753,6 @@ DEFINE_PER_CPU(struct netif_rx_stats, netdev_rx_stat) = { 0, };
  *
  *     return values:
  *     NET_RX_SUCCESS  (no congestion)
- *     NET_RX_CN_LOW   (low congestion)
- *     NET_RX_CN_MOD   (moderate congestion)
- *     NET_RX_CN_HIGH  (high congestion)
  *     NET_RX_DROP     (packet was dropped)
  *
  */
@@ -2001,6 +2000,21 @@ out:
 }
 #endif
 
+/**
+ *     netif_receive_skb - process receive buffer from network
+ *     @skb: buffer to process
+ *
+ *     netif_receive_skb() is the main receive data processing function.
+ *     It always succeeds. The buffer may be dropped during processing
+ *     for congestion control or by the protocol layers.
+ *
+ *     This function may only be called from softirq context and interrupts
+ *     should be enabled.
+ *
+ *     Return values (usually ignored):
+ *     NET_RX_SUCCESS: no congestion
+ *     NET_RX_DROP: packet was dropped
+ */
 int netif_receive_skb(struct sk_buff *skb)
 {
        struct packet_type *ptype, *pt_prev;
@@ -2172,7 +2186,15 @@ static void net_rx_action(struct softirq_action *h)
 
                weight = n->weight;
 
-               work = n->poll(n, weight);
+               /* This NAPI_STATE_SCHED test is for avoiding a race
+                * with netpoll's poll_napi().  Only the entity which
+                * obtains the lock and sees NAPI_STATE_SCHED set will
+                * actually make the ->poll() call.  Therefore we avoid
+                * accidently calling ->poll() when NAPI is not scheduled.
+                */
+               work = 0;
+               if (test_bit(NAPI_STATE_SCHED, &n->state))
+                       work = n->poll(n, weight);
 
                WARN_ON_ONCE(work > weight);
 
@@ -2668,7 +2690,7 @@ static void __net_exit dev_proc_net_exit(struct net *net)
        proc_net_remove(net, "dev");
 }
 
-static struct pernet_operations dev_proc_ops = {
+static struct pernet_operations __net_initdata dev_proc_ops = {
        .init = dev_proc_net_init,
        .exit = dev_proc_net_exit,
 };
@@ -3488,6 +3510,60 @@ static void net_set_todo(struct net_device *dev)
        spin_unlock(&net_todo_list_lock);
 }
 
+static void rollback_registered(struct net_device *dev)
+{
+       BUG_ON(dev_boot_phase);
+       ASSERT_RTNL();
+
+       /* Some devices call without registering for initialization unwind. */
+       if (dev->reg_state == NETREG_UNINITIALIZED) {
+               printk(KERN_DEBUG "unregister_netdevice: device %s/%p never "
+                                 "was registered\n", dev->name, dev);
+
+               WARN_ON(1);
+               return;
+       }
+
+       BUG_ON(dev->reg_state != NETREG_REGISTERED);
+
+       /* If device is running, close it first. */
+       dev_close(dev);
+
+       /* And unlink it from device chain. */
+       unlist_netdevice(dev);
+
+       dev->reg_state = NETREG_UNREGISTERING;
+
+       synchronize_net();
+
+       /* Shutdown queueing discipline. */
+       dev_shutdown(dev);
+
+
+       /* Notify protocols, that we are about to destroy
+          this device. They should clean all the things.
+       */
+       call_netdevice_notifiers(NETDEV_UNREGISTER, dev);
+
+       /*
+        *      Flush the unicast and multicast chains
+        */
+       dev_addr_discard(dev);
+
+       if (dev->uninit)
+               dev->uninit(dev);
+
+       /* Notifier chain MUST detach us from master device. */
+       BUG_TRAP(!dev->master);
+
+       /* Remove entries from kobject tree */
+       netdev_unregister_kobject(dev);
+
+       synchronize_net();
+
+       dev_put(dev);
+}
+
 /**
  *     register_netdevice      - register a network device
  *     @dev: device to register
@@ -3625,8 +3701,10 @@ int register_netdevice(struct net_device *dev)
        /* Notify protocols, that a new device appeared. */
        ret = call_netdevice_notifiers(NETDEV_REGISTER, dev);
        ret = notifier_to_errno(ret);
-       if (ret)
-               unregister_netdevice(dev);
+       if (ret) {
+               rollback_registered(dev);
+               dev->reg_state = NETREG_UNREGISTERED;
+       }
 
 out:
        return ret;
@@ -3903,59 +3981,9 @@ void synchronize_net(void)
 
 void unregister_netdevice(struct net_device *dev)
 {
-       BUG_ON(dev_boot_phase);
-       ASSERT_RTNL();
-
-       /* Some devices call without registering for initialization unwind. */
-       if (dev->reg_state == NETREG_UNINITIALIZED) {
-               printk(KERN_DEBUG "unregister_netdevice: device %s/%p never "
-                                 "was registered\n", dev->name, dev);
-
-               WARN_ON(1);
-               return;
-       }
-
-       BUG_ON(dev->reg_state != NETREG_REGISTERED);
-
-       /* If device is running, close it first. */
-       dev_close(dev);
-
-       /* And unlink it from device chain. */
-       unlist_netdevice(dev);
-
-       dev->reg_state = NETREG_UNREGISTERING;
-
-       synchronize_net();
-
-       /* Shutdown queueing discipline. */
-       dev_shutdown(dev);
-
-
-       /* Notify protocols, that we are about to destroy
-          this device. They should clean all the things.
-       */
-       call_netdevice_notifiers(NETDEV_UNREGISTER, dev);
-
-       /*
-        *      Flush the unicast and multicast chains
-        */
-       dev_addr_discard(dev);
-
-       if (dev->uninit)
-               dev->uninit(dev);
-
-       /* Notifier chain MUST detach us from master device. */
-       BUG_TRAP(!dev->master);
-
-       /* Remove entries from kobject tree */
-       netdev_unregister_kobject(dev);
-
+       rollback_registered(dev);
        /* Finish processing unregister after unlock */
        net_set_todo(dev);
-
-       synchronize_net();
-
-       dev_put(dev);
 }
 
 /**
@@ -4304,7 +4332,6 @@ static struct hlist_head *netdev_create_hash(void)
 static int __net_init netdev_init(struct net *net)
 {
        INIT_LIST_HEAD(&net->dev_base_head);
-       rwlock_init(&dev_base_lock);
 
        net->dev_name_head = netdev_create_hash();
        if (net->dev_name_head == NULL)
@@ -4328,7 +4355,7 @@ static void __net_exit netdev_exit(struct net *net)
        kfree(net->dev_index_head);
 }
 
-static struct pernet_operations  netdev_net_ops = {
+static struct pernet_operations __net_initdata netdev_net_ops = {
        .init = netdev_init,
        .exit = netdev_exit,
 };
@@ -4359,7 +4386,7 @@ static void __net_exit default_device_exit(struct net *net)
        rtnl_unlock();
 }
 
-static struct pernet_operations  default_device_ops = {
+static struct pernet_operations __net_initdata default_device_ops = {
        .exit = default_device_exit,
 };
 
index ae354057d84cf5101b89126e343ce3903eed55d2..69fff16ece10c70c3c94d2624a2d1086a23e26a8 100644 (file)
@@ -168,13 +168,13 @@ void dev_mc_unsync(struct net_device *to, struct net_device *from)
        da = from->mc_list;
        while (da != NULL) {
                next = da->next;
-               if (!da->da_synced)
-                       continue;
-               __dev_addr_delete(&to->mc_list, &to->mc_count,
-                                 da->da_addr, da->da_addrlen, 0);
-               da->da_synced = 0;
-               __dev_addr_delete(&from->mc_list, &from->mc_count,
-                                 da->da_addr, da->da_addrlen, 0);
+               if (da->da_synced) {
+                       __dev_addr_delete(&to->mc_list, &to->mc_count,
+                                         da->da_addr, da->da_addrlen, 0);
+                       da->da_synced = 0;
+                       __dev_addr_delete(&from->mc_list, &from->mc_count,
+                                         da->da_addr, da->da_addrlen, 0);
+               }
                da = next;
        }
        __dev_set_rx_mode(to);
@@ -285,7 +285,7 @@ static void __net_exit dev_mc_net_exit(struct net *net)
        proc_net_remove(net, "dev_mcast");
 }
 
-static struct pernet_operations dev_mc_net_ops = {
+static struct pernet_operations __net_initdata dev_mc_net_ops = {
        .init = dev_mc_net_init,
        .exit = dev_mc_net_exit,
 };
index 16958e64e577f8c12723f02129a5f1e9b1791fdb..03daead3592ad0ef60628e85eef11e18da28b610 100644 (file)
@@ -18,7 +18,6 @@
 #include <linux/types.h>
 #include <net/net_namespace.h>
 
-#include <net/net_namespace.h>
 #include <net/dst.h>
 
 /*
index 13de6f53f0981f19bb16e7aef2d542f2d5f8167a..848132b6cb733500663b64f4097516799d599f36 100644 (file)
 static LIST_HEAD(rules_ops);
 static DEFINE_SPINLOCK(rules_mod_lock);
 
+int fib_default_rule_add(struct fib_rules_ops *ops,
+                        u32 pref, u32 table, u32 flags)
+{
+       struct fib_rule *r;
+
+       r = kzalloc(ops->rule_size, GFP_KERNEL);
+       if (r == NULL)
+               return -ENOMEM;
+
+       atomic_set(&r->refcnt, 1);
+       r->action = FR_ACT_TO_TBL;
+       r->pref = pref;
+       r->table = table;
+       r->flags = flags;
+
+       /* The lock is not required here, the list in unreacheable
+        * at the moment this function is called */
+       list_add_tail(&r->list, &ops->rules_list);
+       return 0;
+}
+EXPORT_SYMBOL(fib_default_rule_add);
+
 static void notify_rule_change(int event, struct fib_rule *rule,
                               struct fib_rules_ops *ops, struct nlmsghdr *nlh,
                               u32 pid);
index 05979e35696320eeee0bbd5ae36d06ec50e496cc..29b8ee4e35d6dc53f32064c1c067c7287ce80924 100644 (file)
@@ -1435,6 +1435,8 @@ int neigh_table_clear(struct neigh_table *tbl)
        kfree(tbl->phash_buckets);
        tbl->phash_buckets = NULL;
 
+       remove_proc_entry(tbl->id, init_net.proc_net_stat);
+
        free_percpu(tbl->stats);
        tbl->stats = NULL;
 
index 6f71db8c4428c04a573020a2773b72a97c8e2ff7..383252b50411b89c5c18835bcbe4c9837ed16ad0 100644 (file)
@@ -17,74 +17,13 @@ static DEFINE_MUTEX(net_mutex);
 
 LIST_HEAD(net_namespace_list);
 
-static struct kmem_cache *net_cachep;
-
 struct net init_net;
 EXPORT_SYMBOL_GPL(init_net);
 
-static struct net *net_alloc(void)
-{
-       return kmem_cache_zalloc(net_cachep, GFP_KERNEL);
-}
-
-static void net_free(struct net *net)
-{
-       if (!net)
-               return;
-
-       if (unlikely(atomic_read(&net->use_count) != 0)) {
-               printk(KERN_EMERG "network namespace not free! Usage: %d\n",
-                       atomic_read(&net->use_count));
-               return;
-       }
-
-       kmem_cache_free(net_cachep, net);
-}
-
-static void cleanup_net(struct work_struct *work)
-{
-       struct pernet_operations *ops;
-       struct net *net;
-
-       net = container_of(work, struct net, work);
-
-       mutex_lock(&net_mutex);
-
-       /* Don't let anyone else find us. */
-       rtnl_lock();
-       list_del(&net->list);
-       rtnl_unlock();
-
-       /* Run all of the network namespace exit methods */
-       list_for_each_entry_reverse(ops, &pernet_list, list) {
-               if (ops->exit)
-                       ops->exit(net);
-       }
-
-       mutex_unlock(&net_mutex);
-
-       /* Ensure there are no outstanding rcu callbacks using this
-        * network namespace.
-        */
-       rcu_barrier();
-
-       /* Finally it is safe to free my network namespace structure */
-       net_free(net);
-}
-
-
-void __put_net(struct net *net)
-{
-       /* Cleanup the network namespace in process context */
-       INIT_WORK(&net->work, cleanup_net);
-       schedule_work(&net->work);
-}
-EXPORT_SYMBOL_GPL(__put_net);
-
 /*
  * setup_net runs the initializers for the network namespace object.
  */
-static int setup_net(struct net *net)
+static __net_init int setup_net(struct net *net)
 {
        /* Must be called with net_mutex held */
        struct pernet_operations *ops;
@@ -112,9 +51,33 @@ out_undo:
                if (ops->exit)
                        ops->exit(net);
        }
+
+       rcu_barrier();
        goto out;
 }
 
+#ifdef CONFIG_NET_NS
+static struct kmem_cache *net_cachep;
+
+static struct net *net_alloc(void)
+{
+       return kmem_cache_zalloc(net_cachep, GFP_KERNEL);
+}
+
+static void net_free(struct net *net)
+{
+       if (!net)
+               return;
+
+       if (unlikely(atomic_read(&net->use_count) != 0)) {
+               printk(KERN_EMERG "network namespace not free! Usage: %d\n",
+                       atomic_read(&net->use_count));
+               return;
+       }
+
+       kmem_cache_free(net_cachep, net);
+}
+
 struct net *copy_net_ns(unsigned long flags, struct net *old_net)
 {
        struct net *new_net = NULL;
@@ -125,10 +88,6 @@ struct net *copy_net_ns(unsigned long flags, struct net *old_net)
        if (!(flags & CLONE_NEWNET))
                return old_net;
 
-#ifndef CONFIG_NET_NS
-       return ERR_PTR(-EINVAL);
-#endif
-
        err = -ENOMEM;
        new_net = net_alloc();
        if (!new_net)
@@ -155,14 +114,64 @@ out:
        return new_net;
 }
 
+static void cleanup_net(struct work_struct *work)
+{
+       struct pernet_operations *ops;
+       struct net *net;
+
+       net = container_of(work, struct net, work);
+
+       mutex_lock(&net_mutex);
+
+       /* Don't let anyone else find us. */
+       rtnl_lock();
+       list_del(&net->list);
+       rtnl_unlock();
+
+       /* Run all of the network namespace exit methods */
+       list_for_each_entry_reverse(ops, &pernet_list, list) {
+               if (ops->exit)
+                       ops->exit(net);
+       }
+
+       mutex_unlock(&net_mutex);
+
+       /* Ensure there are no outstanding rcu callbacks using this
+        * network namespace.
+        */
+       rcu_barrier();
+
+       /* Finally it is safe to free my network namespace structure */
+       net_free(net);
+}
+
+void __put_net(struct net *net)
+{
+       /* Cleanup the network namespace in process context */
+       INIT_WORK(&net->work, cleanup_net);
+       schedule_work(&net->work);
+}
+EXPORT_SYMBOL_GPL(__put_net);
+
+#else
+struct net *copy_net_ns(unsigned long flags, struct net *old_net)
+{
+       if (flags & CLONE_NEWNET)
+               return ERR_PTR(-EINVAL);
+       return old_net;
+}
+#endif
+
 static int __init net_ns_init(void)
 {
        int err;
 
        printk(KERN_INFO "net_namespace: %zd bytes\n", sizeof(struct net));
+#ifdef CONFIG_NET_NS
        net_cachep = kmem_cache_create("net_namespace", sizeof(struct net),
                                        SMP_CACHE_BYTES,
                                        SLAB_PANIC, NULL);
+#endif
        mutex_lock(&net_mutex);
        err = setup_net(&init_net);
 
@@ -179,35 +188,35 @@ static int __init net_ns_init(void)
 
 pure_initcall(net_ns_init);
 
+#ifdef CONFIG_NET_NS
 static int register_pernet_operations(struct list_head *list,
                                      struct pernet_operations *ops)
 {
        struct net *net, *undo_net;
        int error;
 
-       error = 0;
        list_add_tail(&ops->list, list);
-       for_each_net(net) {
-               if (ops->init) {
+       if (ops->init) {
+               for_each_net(net) {
                        error = ops->init(net);
                        if (error)
                                goto out_undo;
                }
        }
-out:
-       return error;
+       return 0;
 
 out_undo:
        /* If I have an error cleanup all namespaces I initialized */
        list_del(&ops->list);
-       for_each_net(undo_net) {
-               if (undo_net == net)
-                       goto undone;
-               if (ops->exit)
+       if (ops->exit) {
+               for_each_net(undo_net) {
+                       if (undo_net == net)
+                               goto undone;
                        ops->exit(undo_net);
+               }
        }
 undone:
-       goto out;
+       return error;
 }
 
 static void unregister_pernet_operations(struct pernet_operations *ops)
@@ -215,11 +224,28 @@ static void unregister_pernet_operations(struct pernet_operations *ops)
        struct net *net;
 
        list_del(&ops->list);
-       for_each_net(net)
-               if (ops->exit)
+       if (ops->exit)
+               for_each_net(net)
                        ops->exit(net);
 }
 
+#else
+
+static int register_pernet_operations(struct list_head *list,
+                                     struct pernet_operations *ops)
+{
+       if (ops->init == NULL)
+               return 0;
+       return ops->init(&init_net);
+}
+
+static void unregister_pernet_operations(struct pernet_operations *ops)
+{
+       if (ops->exit)
+               ops->exit(&init_net);
+}
+#endif
+
 /**
  *      register_pernet_subsys - register a network namespace subsystem
  *     @ops:  pernet operations structure for the subsystem
index bf8d18f1b0130ffd258281eb264140ecbfe2b85d..c499b5c69bedbce96611baaec02eb9cfcb0798a6 100644 (file)
@@ -116,6 +116,29 @@ static __sum16 checksum_udp(struct sk_buff *skb, struct udphdr *uh,
  * network adapter, forcing superfluous retries and possibly timeouts.
  * Thus, we set our budget to greater than 1.
  */
+static int poll_one_napi(struct netpoll_info *npinfo,
+                        struct napi_struct *napi, int budget)
+{
+       int work;
+
+       /* net_rx_action's ->poll() invocations and our's are
+        * synchronized by this test which is only made while
+        * holding the napi->poll_lock.
+        */
+       if (!test_bit(NAPI_STATE_SCHED, &napi->state))
+               return budget;
+
+       npinfo->rx_flags |= NETPOLL_RX_DROP;
+       atomic_inc(&trapped);
+
+       work = napi->poll(napi, budget);
+
+       atomic_dec(&trapped);
+       npinfo->rx_flags &= ~NETPOLL_RX_DROP;
+
+       return budget - work;
+}
+
 static void poll_napi(struct netpoll *np)
 {
        struct netpoll_info *npinfo = np->dev->npinfo;
@@ -123,17 +146,13 @@ static void poll_napi(struct netpoll *np)
        int budget = 16;
 
        list_for_each_entry(napi, &np->dev->napi_list, dev_list) {
-               if (test_bit(NAPI_STATE_SCHED, &napi->state) &&
-                   napi->poll_owner != smp_processor_id() &&
+               if (napi->poll_owner != smp_processor_id() &&
                    spin_trylock(&napi->poll_lock)) {
-                       npinfo->rx_flags |= NETPOLL_RX_DROP;
-                       atomic_inc(&trapped);
-
-                       napi->poll(napi, budget);
-
-                       atomic_dec(&trapped);
-                       npinfo->rx_flags &= ~NETPOLL_RX_DROP;
+                       budget = poll_one_napi(npinfo, napi, budget);
                        spin_unlock(&napi->poll_lock);
+
+                       if (!budget)
+                               break;
                }
        }
 }
index de33f36947e9064294085e6f775881b98a636a8a..285ec3ed9b378179248b8d8900ad983c9ee0f210 100644 (file)
@@ -2463,8 +2463,6 @@ static int pktgen_output_ipsec(struct sk_buff *skb, struct pktgen_dev *pkt_dev)
 
        x->curlft.bytes +=skb->len;
        x->curlft.packets++;
-       spin_unlock(&x->lock);
-
 error:
        spin_unlock(&x->lock);
        return err;
index 5f0818d815e6b700408f2dcea1986b87fdc09645..45aed75cb571220da14d2924ec9674ac06f4d99b 100644 (file)
@@ -71,6 +71,41 @@ int reqsk_queue_alloc(struct request_sock_queue *queue,
 
 EXPORT_SYMBOL(reqsk_queue_alloc);
 
+void __reqsk_queue_destroy(struct request_sock_queue *queue)
+{
+       struct listen_sock *lopt;
+       size_t lopt_size;
+
+       /*
+        * this is an error recovery path only
+        * no locking needed and the lopt is not NULL
+        */
+
+       lopt = queue->listen_opt;
+       lopt_size = sizeof(struct listen_sock) +
+               lopt->nr_table_entries * sizeof(struct request_sock *);
+
+       if (lopt_size > PAGE_SIZE)
+               vfree(lopt);
+       else
+               kfree(lopt);
+}
+
+EXPORT_SYMBOL(__reqsk_queue_destroy);
+
+static inline struct listen_sock *reqsk_queue_yank_listen_sk(
+               struct request_sock_queue *queue)
+{
+       struct listen_sock *lopt;
+
+       write_lock_bh(&queue->syn_wait_lock);
+       lopt = queue->listen_opt;
+       queue->listen_opt = NULL;
+       write_unlock_bh(&queue->syn_wait_lock);
+
+       return lopt;
+}
+
 void reqsk_queue_destroy(struct request_sock_queue *queue)
 {
        /* make all the listen_opt local to us */
index 573e1724019716767a8d8872d5c290c4337e6999..5b4ce9b4dd2060c9fd5920bfad967493b7e7eea6 100644 (file)
@@ -275,12 +275,11 @@ static void skb_release_data(struct sk_buff *skb)
 /*
  *     Free an skbuff by memory without cleaning the state.
  */
-void kfree_skbmem(struct sk_buff *skb)
+static void kfree_skbmem(struct sk_buff *skb)
 {
        struct sk_buff *other;
        atomic_t *fclone_ref;
 
-       skb_release_data(skb);
        switch (skb->fclone) {
        case SKB_FCLONE_UNAVAILABLE:
                kmem_cache_free(skbuff_head_cache, skb);
@@ -307,16 +306,8 @@ void kfree_skbmem(struct sk_buff *skb)
        }
 }
 
-/**
- *     __kfree_skb - private function
- *     @skb: buffer
- *
- *     Free an sk_buff. Release anything attached to the buffer.
- *     Clean the state. This is an internal helper function. Users should
- *     always call kfree_skb
- */
-
-void __kfree_skb(struct sk_buff *skb)
+/* Free everything but the sk_buff shell. */
+static void skb_release_all(struct sk_buff *skb)
 {
        dst_release(skb->dst);
 #ifdef CONFIG_XFRM
@@ -340,7 +331,21 @@ void __kfree_skb(struct sk_buff *skb)
        skb->tc_verd = 0;
 #endif
 #endif
+       skb_release_data(skb);
+}
 
+/**
+ *     __kfree_skb - private function
+ *     @skb: buffer
+ *
+ *     Free an sk_buff. Release anything attached to the buffer.
+ *     Clean the state. This is an internal helper function. Users should
+ *     always call kfree_skb
+ */
+
+void __kfree_skb(struct sk_buff *skb)
+{
+       skb_release_all(skb);
        kfree_skbmem(skb);
 }
 
@@ -441,7 +446,7 @@ static struct sk_buff *__skb_clone(struct sk_buff *n, struct sk_buff *skb)
  */
 struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src)
 {
-       skb_release_data(dst);
+       skb_release_all(dst);
        return __skb_clone(dst, src);
 }
 EXPORT_SYMBOL_GPL(skb_morph);
@@ -2028,8 +2033,8 @@ void __init skb_init(void)
  *     Fill the specified scatter-gather list with mappings/pointers into a
  *     region of the buffer space attached to a socket buffer.
  */
-int
-skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset, int len)
+static int
+__skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset, int len)
 {
        int start = skb_headlen(skb);
        int i, copy = start - offset;
@@ -2078,7 +2083,8 @@ skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset, int len)
                        if ((copy = end - offset) > 0) {
                                if (copy > len)
                                        copy = len;
-                               elt += skb_to_sgvec(list, sg+elt, offset - start, copy);
+                               elt += __skb_to_sgvec(list, sg+elt, offset - start,
+                                                     copy);
                                if ((len -= copy) == 0)
                                        return elt;
                                offset += copy;
@@ -2090,6 +2096,15 @@ skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset, int len)
        return elt;
 }
 
+int skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset, int len)
+{
+       int nsg = __skb_to_sgvec(skb, sg, offset, len);
+
+       sg_mark_end(&sg[nsg - 1]);
+
+       return nsg;
+}
+
 /**
  *     skb_cow_data - Check that a socket buffer's data buffers are writable
  *     @skb: The socket buffer to check.
index bba9949681ff7e132f84629602814dc7d9aa17d4..c519b439b8b1927acf2e01209417747d5ebe7cb4 100644 (file)
@@ -857,46 +857,43 @@ static inline void sock_lock_init(struct sock *sk)
                        af_family_keys + sk->sk_family);
 }
 
-/**
- *     sk_alloc - All socket objects are allocated here
- *     @net: the applicable net namespace
- *     @family: protocol family
- *     @priority: for allocation (%GFP_KERNEL, %GFP_ATOMIC, etc)
- *     @prot: struct proto associated with this new sock instance
- *     @zero_it: if we should zero the newly allocated sock
- */
-struct sock *sk_alloc(struct net *net, int family, gfp_t priority,
-                     struct proto *prot, int zero_it)
+static void sock_copy(struct sock *nsk, const struct sock *osk)
+{
+#ifdef CONFIG_SECURITY_NETWORK
+       void *sptr = nsk->sk_security;
+#endif
+
+       memcpy(nsk, osk, osk->sk_prot->obj_size);
+#ifdef CONFIG_SECURITY_NETWORK
+       nsk->sk_security = sptr;
+       security_sk_clone(osk, nsk);
+#endif
+}
+
+static struct sock *sk_prot_alloc(struct proto *prot, gfp_t priority,
+               int family)
 {
-       struct sock *sk = NULL;
-       struct kmem_cache *slab = prot->slab;
+       struct sock *sk;
+       struct kmem_cache *slab;
 
+       slab = prot->slab;
        if (slab != NULL)
                sk = kmem_cache_alloc(slab, priority);
        else
                sk = kmalloc(prot->obj_size, priority);
 
-       if (sk) {
-               if (zero_it) {
-                       memset(sk, 0, prot->obj_size);
-                       sk->sk_family = family;
-                       /*
-                        * See comment in struct sock definition to understand
-                        * why we need sk_prot_creator -acme
-                        */
-                       sk->sk_prot = sk->sk_prot_creator = prot;
-                       sock_lock_init(sk);
-                       sk->sk_net = get_net(net);
-               }
-
+       if (sk != NULL) {
                if (security_sk_alloc(sk, family, priority))
                        goto out_free;
 
                if (!try_module_get(prot->owner))
-                       goto out_free;
+                       goto out_free_sec;
        }
+
        return sk;
 
+out_free_sec:
+       security_sk_free(sk);
 out_free:
        if (slab != NULL)
                kmem_cache_free(slab, sk);
@@ -905,10 +902,53 @@ out_free:
        return NULL;
 }
 
+static void sk_prot_free(struct proto *prot, struct sock *sk)
+{
+       struct kmem_cache *slab;
+       struct module *owner;
+
+       owner = prot->owner;
+       slab = prot->slab;
+
+       security_sk_free(sk);
+       if (slab != NULL)
+               kmem_cache_free(slab, sk);
+       else
+               kfree(sk);
+       module_put(owner);
+}
+
+/**
+ *     sk_alloc - All socket objects are allocated here
+ *     @net: the applicable net namespace
+ *     @family: protocol family
+ *     @priority: for allocation (%GFP_KERNEL, %GFP_ATOMIC, etc)
+ *     @prot: struct proto associated with this new sock instance
+ *     @zero_it: if we should zero the newly allocated sock
+ */
+struct sock *sk_alloc(struct net *net, int family, gfp_t priority,
+                     struct proto *prot)
+{
+       struct sock *sk;
+
+       sk = sk_prot_alloc(prot, priority | __GFP_ZERO, family);
+       if (sk) {
+               sk->sk_family = family;
+               /*
+                * See comment in struct sock definition to understand
+                * why we need sk_prot_creator -acme
+                */
+               sk->sk_prot = sk->sk_prot_creator = prot;
+               sock_lock_init(sk);
+               sk->sk_net = get_net(net);
+       }
+
+       return sk;
+}
+
 void sk_free(struct sock *sk)
 {
        struct sk_filter *filter;
-       struct module *owner = sk->sk_prot_creator->owner;
 
        if (sk->sk_destruct)
                sk->sk_destruct(sk);
@@ -925,25 +965,22 @@ void sk_free(struct sock *sk)
                printk(KERN_DEBUG "%s: optmem leakage (%d bytes) detected.\n",
                       __FUNCTION__, atomic_read(&sk->sk_omem_alloc));
 
-       security_sk_free(sk);
        put_net(sk->sk_net);
-       if (sk->sk_prot_creator->slab != NULL)
-               kmem_cache_free(sk->sk_prot_creator->slab, sk);
-       else
-               kfree(sk);
-       module_put(owner);
+       sk_prot_free(sk->sk_prot_creator, sk);
 }
 
 struct sock *sk_clone(const struct sock *sk, const gfp_t priority)
 {
-       struct sock *newsk = sk_alloc(sk->sk_net, sk->sk_family, priority, sk->sk_prot, 0);
+       struct sock *newsk;
 
+       newsk = sk_prot_alloc(sk->sk_prot, priority, sk->sk_family);
        if (newsk != NULL) {
                struct sk_filter *filter;
 
                sock_copy(newsk, sk);
 
                /* SANITY */
+               get_net(newsk->sk_net);
                sk_node_init(&newsk->sk_node);
                sock_lock_init(newsk);
                bh_lock_sock(newsk);
@@ -1764,11 +1801,65 @@ EXPORT_SYMBOL(sk_common_release);
 static DEFINE_RWLOCK(proto_list_lock);
 static LIST_HEAD(proto_list);
 
+#ifdef CONFIG_SMP
+/*
+ * Define default functions to keep track of inuse sockets per protocol
+ * Note that often used protocols use dedicated functions to get a speed increase.
+ * (see DEFINE_PROTO_INUSE/REF_PROTO_INUSE)
+ */
+static void inuse_add(struct proto *prot, int inc)
+{
+       per_cpu_ptr(prot->inuse_ptr, smp_processor_id())[0] += inc;
+}
+
+static int inuse_get(const struct proto *prot)
+{
+       int res = 0, cpu;
+       for_each_possible_cpu(cpu)
+               res += per_cpu_ptr(prot->inuse_ptr, cpu)[0];
+       return res;
+}
+
+static int inuse_init(struct proto *prot)
+{
+       if (!prot->inuse_getval || !prot->inuse_add) {
+               prot->inuse_ptr = alloc_percpu(int);
+               if (prot->inuse_ptr == NULL)
+                       return -ENOBUFS;
+
+               prot->inuse_getval = inuse_get;
+               prot->inuse_add = inuse_add;
+       }
+       return 0;
+}
+
+static void inuse_fini(struct proto *prot)
+{
+       if (prot->inuse_ptr != NULL) {
+               free_percpu(prot->inuse_ptr);
+               prot->inuse_ptr = NULL;
+               prot->inuse_getval = NULL;
+               prot->inuse_add = NULL;
+       }
+}
+#else
+static inline int inuse_init(struct proto *prot)
+{
+       return 0;
+}
+
+static inline void inuse_fini(struct proto *prot)
+{
+}
+#endif
+
 int proto_register(struct proto *prot, int alloc_slab)
 {
        char *request_sock_slab_name = NULL;
        char *timewait_sock_slab_name;
-       int rc = -ENOBUFS;
+
+       if (inuse_init(prot))
+               goto out;
 
        if (alloc_slab) {
                prot->slab = kmem_cache_create(prot->name, prot->obj_size, 0,
@@ -1777,7 +1868,7 @@ int proto_register(struct proto *prot, int alloc_slab)
                if (prot->slab == NULL) {
                        printk(KERN_CRIT "%s: Can't create sock SLAB cache!\n",
                               prot->name);
-                       goto out;
+                       goto out_free_inuse;
                }
 
                if (prot->rsk_prot != NULL) {
@@ -1821,9 +1912,8 @@ int proto_register(struct proto *prot, int alloc_slab)
        write_lock(&proto_list_lock);
        list_add(&prot->node, &proto_list);
        write_unlock(&proto_list_lock);
-       rc = 0;
-out:
-       return rc;
+       return 0;
+
 out_free_timewait_sock_slab_name:
        kfree(timewait_sock_slab_name);
 out_free_request_sock_slab:
@@ -1836,7 +1926,10 @@ out_free_request_sock_slab_name:
 out_free_sock_slab:
        kmem_cache_destroy(prot->slab);
        prot->slab = NULL;
-       goto out;
+out_free_inuse:
+       inuse_fini(prot);
+out:
+       return -ENOBUFS;
 }
 
 EXPORT_SYMBOL(proto_register);
@@ -1847,6 +1940,7 @@ void proto_unregister(struct proto *prot)
        list_del(&prot->node);
        write_unlock(&proto_list_lock);
 
+       inuse_fini(prot);
        if (prot->slab != NULL) {
                kmem_cache_destroy(prot->slab);
                prot->slab = NULL;
@@ -2003,7 +2097,3 @@ EXPORT_SYMBOL(sock_wmalloc);
 EXPORT_SYMBOL(sock_i_uid);
 EXPORT_SYMBOL(sock_i_ino);
 EXPORT_SYMBOL(sysctl_optmem_max);
-#ifdef CONFIG_SYSCTL
-EXPORT_SYMBOL(sysctl_rmem_max);
-EXPORT_SYMBOL(sysctl_wmem_max);
-#endif
index 40ad428a27f56dcf1aff0eed16b69dfa49cda4e2..d26b88dbbb45cbab0b5de86bf0151d9cfa3a6638 100644 (file)
@@ -166,7 +166,7 @@ static u32 dccp_li_calc_first_li(struct sock *sk,
        }
 
        if (unlikely(interval == 0)) {
-               DCCP_WARN("%s(%p), Could not find a win_count interval > 0."
+               DCCP_WARN("%s(%p), Could not find a win_count interval > 0. "
                          "Defaulting to 1\n", dccp_role(sk), sk);
                interval = 1;
        }
index 01a6a808bdb7ba16687b44803cd4ffa3a42fbe3e..db17b83e8d3e85b267ed1bd352338ad64119f9df 100644 (file)
@@ -922,6 +922,8 @@ static struct timewait_sock_ops dccp_timewait_sock_ops = {
        .twsk_obj_size  = sizeof(struct inet_timewait_sock),
 };
 
+DEFINE_PROTO_INUSE(dccp_v4)
+
 static struct proto dccp_v4_prot = {
        .name                   = "DCCP",
        .owner                  = THIS_MODULE,
@@ -950,6 +952,7 @@ static struct proto dccp_v4_prot = {
        .compat_setsockopt      = compat_dccp_setsockopt,
        .compat_getsockopt      = compat_dccp_getsockopt,
 #endif
+       REF_PROTO_INUSE(dccp_v4)
 };
 
 static struct net_protocol dccp_v4_protocol = {
index 62428ff137ddb4f63120246da364c3f84c4a50d2..87c98fb86fa89311fb33863102875f5d853a94cf 100644 (file)
@@ -1107,6 +1107,8 @@ static struct timewait_sock_ops dccp6_timewait_sock_ops = {
        .twsk_obj_size  = sizeof(struct dccp6_timewait_sock),
 };
 
+DEFINE_PROTO_INUSE(dccp_v6)
+
 static struct proto dccp_v6_prot = {
        .name              = "DCCPv6",
        .owner             = THIS_MODULE,
@@ -1135,6 +1137,7 @@ static struct proto dccp_v6_prot = {
        .compat_setsockopt = compat_dccp_setsockopt,
        .compat_getsockopt = compat_dccp_getsockopt,
 #endif
+       REF_PROTO_INUSE(dccp_v6)
 };
 
 static struct inet6_protocol dccp_v6_protocol = {
index d84973928033bc47fd1dbd10384737758eec1a32..7a3bea9c28c172c8768414cf0fe8f616fb5e15b3 100644 (file)
@@ -1072,11 +1072,13 @@ static int __init dccp_init(void)
        }
 
        for (i = 0; i < dccp_hashinfo.ehash_size; i++) {
-               rwlock_init(&dccp_hashinfo.ehash[i].lock);
                INIT_HLIST_HEAD(&dccp_hashinfo.ehash[i].chain);
                INIT_HLIST_HEAD(&dccp_hashinfo.ehash[i].twchain);
        }
 
+       if (inet_ehash_locks_alloc(&dccp_hashinfo))
+                       goto out_free_dccp_ehash;
+
        bhash_order = ehash_order;
 
        do {
@@ -1091,7 +1093,7 @@ static int __init dccp_init(void)
 
        if (!dccp_hashinfo.bhash) {
                DCCP_CRIT("Failed to allocate DCCP bind hash table");
-               goto out_free_dccp_ehash;
+               goto out_free_dccp_locks;
        }
 
        for (i = 0; i < dccp_hashinfo.bhash_size; i++) {
@@ -1121,6 +1123,8 @@ out_free_dccp_mib:
 out_free_dccp_bhash:
        free_pages((unsigned long)dccp_hashinfo.bhash, bhash_order);
        dccp_hashinfo.bhash = NULL;
+out_free_dccp_locks:
+       inet_ehash_locks_free(&dccp_hashinfo);
 out_free_dccp_ehash:
        free_pages((unsigned long)dccp_hashinfo.ehash, ehash_order);
        dccp_hashinfo.ehash = NULL;
@@ -1139,6 +1143,7 @@ static void __exit dccp_fini(void)
        free_pages((unsigned long)dccp_hashinfo.ehash,
                   get_order(dccp_hashinfo.ehash_size *
                             sizeof(struct inet_ehash_bucket)));
+       inet_ehash_locks_free(&dccp_hashinfo);
        kmem_cache_destroy(dccp_hashinfo.bind_bucket_cachep);
        dccp_ackvec_exit();
        dccp_sysctl_exit();
index aabe98d9402f492bac411e111da9a0cc66a011f8..57d5749518380c06cd9dc6863d649e8cfbc230fe 100644 (file)
@@ -474,7 +474,7 @@ static struct proto dn_proto = {
 static struct sock *dn_alloc_sock(struct net *net, struct socket *sock, gfp_t gfp)
 {
        struct dn_scp *scp;
-       struct sock *sk = sk_alloc(net, PF_DECnet, gfp, &dn_proto, 1);
+       struct sock *sk = sk_alloc(net, PF_DECnet, gfp, &dn_proto);
 
        if  (!sk)
                goto out;
index 26130afd80299a32692f74ab794af5d5e95f3b37..66e266fb5908b4976448da87ddc74d509c25b10f 100644 (file)
@@ -1439,7 +1439,7 @@ static const struct file_operations dn_dev_seq_fops = {
 
 #endif /* CONFIG_PROC_FS */
 
-static int __initdata addr[2];
+static int addr[2];
 module_param_array(addr, int, NULL, 0444);
 MODULE_PARM_DESC(addr, "The DECnet address of this machine: area,node");
 
index 97eee5e8fbbe35c1ec63ff45d8cb2dedd6aeba73..66663e5d7acdc8cb20349b62c86690fe82a1b770 100644 (file)
@@ -293,9 +293,7 @@ static int dn_insert_route(struct dn_route *rt, unsigned hash, struct dn_route *
                                           dn_rt_hash_table[hash].chain);
                        rcu_assign_pointer(dn_rt_hash_table[hash].chain, rth);
 
-                       rth->u.dst.__use++;
-                       dst_hold(&rth->u.dst);
-                       rth->u.dst.lastuse = now;
+                       dst_use(&rth->u.dst, now);
                        spin_unlock_bh(&dn_rt_hash_table[hash].lock);
 
                        dnrt_drop(rt);
@@ -308,9 +306,7 @@ static int dn_insert_route(struct dn_route *rt, unsigned hash, struct dn_route *
        rcu_assign_pointer(rt->u.dst.dn_next, dn_rt_hash_table[hash].chain);
        rcu_assign_pointer(dn_rt_hash_table[hash].chain, rt);
 
-       dst_hold(&rt->u.dst);
-       rt->u.dst.__use++;
-       rt->u.dst.lastuse = now;
+       dst_use(&rt->u.dst, now);
        spin_unlock_bh(&dn_rt_hash_table[hash].lock);
        *rp = rt;
        return 0;
@@ -1182,9 +1178,7 @@ static int __dn_route_output_key(struct dst_entry **pprt, const struct flowi *fl
                            (flp->mark == rt->fl.mark) &&
                            (rt->fl.iif == 0) &&
                            (rt->fl.oif == flp->oif)) {
-                               rt->u.dst.lastuse = jiffies;
-                               dst_hold(&rt->u.dst);
-                               rt->u.dst.__use++;
+                               dst_use(&rt->u.dst, jiffies);
                                rcu_read_unlock_bh();
                                *pprt = &rt->u.dst;
                                return 0;
@@ -1456,9 +1450,7 @@ int dn_route_input(struct sk_buff *skb)
                    (rt->fl.oif == 0) &&
                    (rt->fl.mark == skb->mark) &&
                    (rt->fl.iif == cb->iif)) {
-                       rt->u.dst.lastuse = jiffies;
-                       dst_hold(&rt->u.dst);
-                       rt->u.dst.__use++;
+                       dst_use(&rt->u.dst, jiffies);
                        rcu_read_unlock();
                        skb->dst = (struct dst_entry *)rt;
                        return 0;
index ddd3f04f0919ee880dba236ee1516df96d3a6bee..ffebea04cc99b9f6c5820734f057f9307ed5e333 100644 (file)
@@ -48,15 +48,6 @@ struct dn_fib_rule
        u8                      flags;
 };
 
-static struct dn_fib_rule default_rule = {
-       .common = {
-               .refcnt =               ATOMIC_INIT(2),
-               .pref =                 0x7fff,
-               .table =                RT_TABLE_MAIN,
-               .action =               FR_ACT_TO_TBL,
-       },
-};
-
 
 int dn_fib_lookup(struct flowi *flp, struct dn_fib_res *res)
 {
@@ -262,8 +253,8 @@ static struct fib_rules_ops dn_fib_rules_ops = {
 
 void __init dn_fib_rules_init(void)
 {
-       list_add_tail(&default_rule.common.list,
-                       &dn_fib_rules_ops.rules_list);
+       BUG_ON(fib_default_rule_add(&dn_fib_rules_ops, 0x7fff,
+                                   RT_TABLE_MAIN, 0));
        fib_rules_register(&dn_fib_rules_ops);
 }
 
index 9cae16b4e0b7cea737c88a763d34a8eb49d079a8..f70df073c58800552cf69a105da1b2c800e40383 100644 (file)
@@ -624,7 +624,7 @@ static int econet_create(struct net *net, struct socket *sock, int protocol)
        sock->state = SS_UNCONNECTED;
 
        err = -ENOBUFS;
-       sk = sk_alloc(net, PF_ECONET, GFP_KERNEL, &econet_proto, 1);
+       sk = sk_alloc(net, PF_ECONET, GFP_KERNEL, &econet_proto);
        if (sk == NULL)
                goto out;
 
index 0936a3e0210b4f3cf3bdb8962531adc66491bf7c..208bf35b55463d10d95222f36e38c11bedf8c18a 100644 (file)
@@ -25,7 +25,6 @@
 #include <net/ieee80211.h>
 
 #include <linux/crypto.h>
-#include <asm/scatterlist.h>
 
 MODULE_AUTHOR("Jouni Malinen");
 MODULE_DESCRIPTION("Host AP crypt: CCMP");
@@ -339,7 +338,7 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
        pos += 8;
 
        if (ccmp_replay_check(pn, key->rx_pn)) {
-               if (net_ratelimit()) {
+               if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) {
                        IEEE80211_DEBUG_DROP("CCMP: replay detected: STA=%s "
                                 "previous PN %02x%02x%02x%02x%02x%02x "
                                 "received PN %02x%02x%02x%02x%02x%02x\n",
index 4cce3534e408c5e5d495eda666ccef80fd4348c3..8e146949fc6f595eb75ca15f234060347ade8c89 100644 (file)
@@ -25,7 +25,6 @@
 #include <net/ieee80211.h>
 
 #include <linux/crypto.h>
-#include <linux/scatterlist.h>
 #include <linux/crc32.h>
 
 MODULE_AUTHOR("Jouni Malinen");
@@ -465,7 +464,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
        pos += 8;
 
        if (tkip_replay_check(iv32, iv16, tkey->rx_iv32, tkey->rx_iv16)) {
-               if (net_ratelimit()) {
+               if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) {
                        IEEE80211_DEBUG_DROP("TKIP: replay detected: STA=%s"
                               " previous TSC %08x%04x received TSC "
                               "%08x%04x\n", print_mac(mac, hdr->addr2),
@@ -505,7 +504,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
                         * it needs to be recalculated for the next packet. */
                        tkey->rx_phase1_done = 0;
                }
-               if (net_ratelimit()) {
+               if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) {
                        IEEE80211_DEBUG_DROP("TKIP: ICV error detected: STA="
                               "%s\n", print_mac(mac, hdr->addr2));
                }
index 866fc04c44f9c989d64bd543e3a10224db78c11c..3fa30c40779f6b7c8242541a6a484440409a40d3 100644 (file)
@@ -22,7 +22,6 @@
 #include <net/ieee80211.h>
 
 #include <linux/crypto.h>
-#include <linux/scatterlist.h>
 #include <linux/crc32.h>
 
 MODULE_AUTHOR("Jouni Malinen");
index ac36767b56e892c63d7eb0c0684b4d1b088f835e..e01b59aedc54612f49d4e225ff1459c37e57866d 100644 (file)
@@ -470,7 +470,7 @@ ieee80211softmac_wx_set_mlme(struct net_device *dev,
 {
        struct ieee80211softmac_device *mac = ieee80211_priv(dev);
        struct iw_mlme *mlme = (struct iw_mlme *)extra;
-       u16 reason = cpu_to_le16(mlme->reason_code);
+       u16 reason = mlme->reason_code;
        struct ieee80211softmac_network *net;
        int err = -EINVAL;
 
index 621b128897d7af80015506b4ae7abb8116ad6d23..d2f22e74b26713b2125d2e6c2a7385eb47840336 100644 (file)
@@ -323,7 +323,7 @@ lookup_protocol:
        BUG_TRAP(answer_prot->slab != NULL);
 
        err = -ENOBUFS;
-       sk = sk_alloc(net, PF_INET, GFP_KERNEL, answer_prot, 1);
+       sk = sk_alloc(net, PF_INET, GFP_KERNEL, answer_prot);
        if (sk == NULL)
                goto out;
 
index 4e8e3b079f5b606cf7c70aed28563889b2202aa7..5fc346d8b5665a344f80a8b82e6c2013b9dd549f 100644 (file)
@@ -8,7 +8,6 @@
 #include <linux/spinlock.h>
 #include <net/icmp.h>
 #include <net/protocol.h>
-#include <asm/scatterlist.h>
 
 
 /* Clear mutable options and find final destination to substitute
index 36d6798947b59026eb400c6b06882099fddd8ba0..b3f366a33a5cd4f834a512f2dfa7bad2963356f4 100644 (file)
 #include <net/tcp.h>
 #include <net/sock.h>
 #include <net/arp.h>
-#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
 #include <net/ax25.h>
-#if defined(CONFIG_NETROM) || defined(CONFIG_NETROM_MODULE)
 #include <net/netrom.h>
-#endif
-#endif
 #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE)
 #include <net/atmclip.h>
 struct neigh_table *clip_tbl_hook;
@@ -731,20 +727,10 @@ static int arp_process(struct sk_buff *skb)
                    htons(dev_type) != arp->ar_hrd)
                        goto out;
                break;
-#ifdef CONFIG_NET_ETHERNET
        case ARPHRD_ETHER:
-#endif
-#ifdef CONFIG_TR
        case ARPHRD_IEEE802_TR:
-#endif
-#ifdef CONFIG_FDDI
        case ARPHRD_FDDI:
-#endif
-#ifdef CONFIG_NET_FC
        case ARPHRD_IEEE802:
-#endif
-#if defined(CONFIG_NET_ETHERNET) || defined(CONFIG_TR) || \
-    defined(CONFIG_FDDI)        || defined(CONFIG_NET_FC)
                /*
                 * ETHERNET, Token Ring and Fibre Channel (which are IEEE 802
                 * devices, according to RFC 2625) devices will accept ARP
@@ -759,21 +745,16 @@ static int arp_process(struct sk_buff *skb)
                    arp->ar_pro != htons(ETH_P_IP))
                        goto out;
                break;
-#endif
-#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
        case ARPHRD_AX25:
                if (arp->ar_pro != htons(AX25_P_IP) ||
                    arp->ar_hrd != htons(ARPHRD_AX25))
                        goto out;
                break;
-#if defined(CONFIG_NETROM) || defined(CONFIG_NETROM_MODULE)
        case ARPHRD_NETROM:
                if (arp->ar_pro != htons(AX25_P_IP) ||
                    arp->ar_hrd != htons(ARPHRD_NETROM))
                        goto out;
                break;
-#endif
-#endif
        }
 
        /* Understand only these message types */
@@ -828,7 +809,8 @@ static int arp_process(struct sk_buff *skb)
                if (arp->ar_op == htons(ARPOP_REQUEST) &&
                    inet_addr_type(tip) == RTN_LOCAL &&
                    !arp_ignore(in_dev,dev,sip,tip))
-                       arp_send(ARPOP_REPLY,ETH_P_ARP,tip,dev,tip,sha,dev->dev_addr,dev->dev_addr);
+                       arp_send(ARPOP_REPLY, ETH_P_ARP, sip, dev, tip, sha,
+                                dev->dev_addr, sha);
                goto out;
        }
 
index cad4278025adc83b1b4430c949a3c65fa36f8f9c..c31bccb9b526c99d539c1c13a94531f23c982318 100644 (file)
@@ -111,9 +111,10 @@ static int esp_output(struct xfrm_state *x, struct sk_buff *skb)
                                goto unlock;
                }
                sg_init_table(sg, nfrags);
-               sg_mark_end(sg, skb_to_sgvec(skb, sg, esph->enc_data +
-                                                     esp->conf.ivlen -
-                                                     skb->data, clen));
+               skb_to_sgvec(skb, sg,
+                            esph->enc_data +
+                            esp->conf.ivlen -
+                            skb->data, clen);
                err = crypto_blkcipher_encrypt(&desc, sg, sg, clen);
                if (unlikely(sg != &esp->sgbuf[0]))
                        kfree(sg);
@@ -205,8 +206,9 @@ static int esp_input(struct xfrm_state *x, struct sk_buff *skb)
                        goto out;
        }
        sg_init_table(sg, nfrags);
-       sg_mark_end(sg, skb_to_sgvec(skb, sg, sizeof(*esph) + esp->conf.ivlen,
-                                    elen));
+       skb_to_sgvec(skb, sg,
+                    sizeof(*esph) + esp->conf.ivlen,
+                    elen);
        err = crypto_blkcipher_decrypt(&desc, sg, sg, elen);
        if (unlikely(sg != &esp->sgbuf[0]))
                kfree(sg);
index 60123905dbbf65d4e67a3c7adc86264091a52bfd..732d8f088b13298fdfef8eb1051477c7f6453080 100644 (file)
@@ -59,6 +59,13 @@ struct fib_table *ip_fib_main_table;
 #define FIB_TABLE_HASHSZ 1
 static struct hlist_head fib_table_hash[FIB_TABLE_HASHSZ];
 
+static void __init fib4_rules_init(void)
+{
+       ip_fib_local_table = fib_hash_init(RT_TABLE_LOCAL);
+       hlist_add_head_rcu(&ip_fib_local_table->tb_hlist, &fib_table_hash[0]);
+       ip_fib_main_table  = fib_hash_init(RT_TABLE_MAIN);
+       hlist_add_head_rcu(&ip_fib_main_table->tb_hlist, &fib_table_hash[0]);
+}
 #else
 
 #define FIB_TABLE_HASHSZ 256
@@ -905,14 +912,8 @@ void __init ip_fib_init(void)
 
        for (i = 0; i < FIB_TABLE_HASHSZ; i++)
                INIT_HLIST_HEAD(&fib_table_hash[i]);
-#ifndef CONFIG_IP_MULTIPLE_TABLES
-       ip_fib_local_table = fib_hash_init(RT_TABLE_LOCAL);
-       hlist_add_head_rcu(&ip_fib_local_table->tb_hlist, &fib_table_hash[0]);
-       ip_fib_main_table  = fib_hash_init(RT_TABLE_MAIN);
-       hlist_add_head_rcu(&ip_fib_main_table->tb_hlist, &fib_table_hash[0]);
-#else
+
        fib4_rules_init();
-#endif
 
        register_netdevice_notifier(&fib_netdev_notifier);
        register_inetaddr_notifier(&fib_inetaddr_notifier);
index f16839c6a721ab98d2402e16a9aa51087954afad..a0ada3a8d8dd8c2cfd931cc0c475c73aadf8d62b 100644 (file)
@@ -49,33 +49,6 @@ struct fib4_rule
 #endif
 };
 
-static struct fib4_rule default_rule = {
-       .common = {
-               .refcnt =       ATOMIC_INIT(2),
-               .pref =         0x7FFF,
-               .table =        RT_TABLE_DEFAULT,
-               .action =       FR_ACT_TO_TBL,
-       },
-};
-
-static struct fib4_rule main_rule = {
-       .common = {
-               .refcnt =       ATOMIC_INIT(2),
-               .pref =         0x7FFE,
-               .table =        RT_TABLE_MAIN,
-               .action =       FR_ACT_TO_TBL,
-       },
-};
-
-static struct fib4_rule local_rule = {
-       .common = {
-               .refcnt =       ATOMIC_INIT(2),
-               .table =        RT_TABLE_LOCAL,
-               .action =       FR_ACT_TO_TBL,
-               .flags =        FIB_RULE_PERMANENT,
-       },
-};
-
 #ifdef CONFIG_NET_CLS_ROUTE
 u32 fib_rules_tclass(struct fib_result *res)
 {
@@ -319,11 +292,27 @@ static struct fib_rules_ops fib4_rules_ops = {
        .owner          = THIS_MODULE,
 };
 
-void __init fib4_rules_init(void)
+static int __init fib_default_rules_init(void)
 {
-       list_add_tail(&local_rule.common.list, &fib4_rules_ops.rules_list);
-       list_add_tail(&main_rule.common.list, &fib4_rules_ops.rules_list);
-       list_add_tail(&default_rule.common.list, &fib4_rules_ops.rules_list);
+       int err;
+
+       err = fib_default_rule_add(&fib4_rules_ops, 0,
+                                  RT_TABLE_LOCAL, FIB_RULE_PERMANENT);
+       if (err < 0)
+               return err;
+       err = fib_default_rule_add(&fib4_rules_ops, 0x7FFE,
+                                  RT_TABLE_MAIN, 0);
+       if (err < 0)
+               return err;
+       err = fib_default_rule_add(&fib4_rules_ops, 0x7FFF,
+                                  RT_TABLE_DEFAULT, 0);
+       if (err < 0)
+               return err;
+       return 0;
+}
 
+void __init fib4_rules_init(void)
+{
+       BUG_ON(fib_default_rules_init());
        fib_rules_register(&fib4_rules_ops);
 }
index dc429b6b0ba62bbca65f545f6a9a8630e02eaafa..b0170732b5e9e962ed1fca65cf930c3bf4cc98f0 100644 (file)
@@ -747,13 +747,14 @@ skip_listen_ht:
 
        for (i = s_i; i < hashinfo->ehash_size; i++) {
                struct inet_ehash_bucket *head = &hashinfo->ehash[i];
+               rwlock_t *lock = inet_ehash_lockp(hashinfo, i);
                struct sock *sk;
                struct hlist_node *node;
 
                if (i > s_i)
                        s_num = 0;
 
-               read_lock_bh(&head->lock);
+               read_lock_bh(lock);
                num = 0;
                sk_for_each(sk, node, &head->chain) {
                        struct inet_sock *inet = inet_sk(sk);
@@ -769,7 +770,7 @@ skip_listen_ht:
                            r->id.idiag_dport)
                                goto next_normal;
                        if (inet_csk_diag_dump(sk, skb, cb) < 0) {
-                               read_unlock_bh(&head->lock);
+                               read_unlock_bh(lock);
                                goto done;
                        }
 next_normal:
@@ -791,14 +792,14 @@ next_normal:
                                    r->id.idiag_dport)
                                        goto next_dying;
                                if (inet_twsk_diag_dump(tw, skb, cb) < 0) {
-                                       read_unlock_bh(&head->lock);
+                                       read_unlock_bh(lock);
                                        goto done;
                                }
 next_dying:
                                ++num;
                        }
                }
-               read_unlock_bh(&head->lock);
+               read_unlock_bh(lock);
        }
 
 done:
index 16eecc7046a346d6a2a22e1c33f71055a333f4c2..67704da04fc4ca98d88eeaae7db3e53d1a6157aa 100644 (file)
@@ -204,12 +204,13 @@ static int __inet_check_established(struct inet_timewait_death_row *death_row,
        const __portpair ports = INET_COMBINED_PORTS(inet->dport, lport);
        unsigned int hash = inet_ehashfn(daddr, lport, saddr, inet->dport);
        struct inet_ehash_bucket *head = inet_ehash_bucket(hinfo, hash);
+       rwlock_t *lock = inet_ehash_lockp(hinfo, hash);
        struct sock *sk2;
        const struct hlist_node *node;
        struct inet_timewait_sock *tw;
 
        prefetch(head->chain.first);
-       write_lock(&head->lock);
+       write_lock(lock);
 
        /* Check TIME-WAIT sockets first. */
        sk_for_each(sk2, node, &head->twchain) {
@@ -239,7 +240,7 @@ unique:
        BUG_TRAP(sk_unhashed(sk));
        __sk_add_node(sk, &head->chain);
        sock_prot_inc_use(sk->sk_prot);
-       write_unlock(&head->lock);
+       write_unlock(lock);
 
        if (twp) {
                *twp = tw;
@@ -255,7 +256,7 @@ unique:
        return 0;
 
 not_unique:
-       write_unlock(&head->lock);
+       write_unlock(lock);
        return -EADDRNOTAVAIL;
 }
 
index 4e189e28f3062f45f6aeca63476423ca386e757a..a60b99e0ebdc2d1dfa838a1134e361139ceeb910 100644 (file)
@@ -20,16 +20,16 @@ static void __inet_twsk_kill(struct inet_timewait_sock *tw,
        struct inet_bind_hashbucket *bhead;
        struct inet_bind_bucket *tb;
        /* Unlink from established hashes. */
-       struct inet_ehash_bucket *ehead = inet_ehash_bucket(hashinfo, tw->tw_hash);
+       rwlock_t *lock = inet_ehash_lockp(hashinfo, tw->tw_hash);
 
-       write_lock(&ehead->lock);
+       write_lock(lock);
        if (hlist_unhashed(&tw->tw_node)) {
-               write_unlock(&ehead->lock);
+               write_unlock(lock);
                return;
        }
        __hlist_del(&tw->tw_node);
        sk_node_init(&tw->tw_node);
-       write_unlock(&ehead->lock);
+       write_unlock(lock);
 
        /* Disassociate with bind bucket. */
        bhead = &hashinfo->bhash[inet_bhashfn(tw->tw_num, hashinfo->bhash_size)];
@@ -59,6 +59,7 @@ void __inet_twsk_hashdance(struct inet_timewait_sock *tw, struct sock *sk,
        const struct inet_sock *inet = inet_sk(sk);
        const struct inet_connection_sock *icsk = inet_csk(sk);
        struct inet_ehash_bucket *ehead = inet_ehash_bucket(hashinfo, sk->sk_hash);
+       rwlock_t *lock = inet_ehash_lockp(hashinfo, sk->sk_hash);
        struct inet_bind_hashbucket *bhead;
        /* Step 1: Put TW into bind hash. Original socket stays there too.
           Note, that any socket with inet->num != 0 MUST be bound in
@@ -71,7 +72,7 @@ void __inet_twsk_hashdance(struct inet_timewait_sock *tw, struct sock *sk,
        inet_twsk_add_bind_node(tw, &tw->tw_tb->owners);
        spin_unlock(&bhead->lock);
 
-       write_lock(&ehead->lock);
+       write_lock(lock);
 
        /* Step 2: Remove SK from established hash. */
        if (__sk_del_node_init(sk))
@@ -81,7 +82,7 @@ void __inet_twsk_hashdance(struct inet_timewait_sock *tw, struct sock *sk,
        inet_twsk_add_node(tw, &ehead->twchain);
        atomic_inc(&tw->tw_refcnt);
 
-       write_unlock(&ehead->lock);
+       write_unlock(lock);
 }
 
 EXPORT_SYMBOL_GPL(__inet_twsk_hashdance);
index 771031dfbd0f875c807a0f82fd96a870d770c2e7..af995198f643bf174c20b3570dd91b6bd7ccec47 100644 (file)
@@ -61,7 +61,7 @@
  *  4.  Global variable peer_total is modified under the pool lock.
  *  5.  struct inet_peer fields modification:
  *             avl_left, avl_right, avl_parent, avl_height: pool lock
- *             unused_next, unused_prevp: unused node list lock
+ *             unused: unused node list lock
  *             refcnt: atomically against modifications on other CPU;
  *                usually under some other lock to prevent node disappearing
  *             dtime: unused node list lock
@@ -94,8 +94,7 @@ int inet_peer_maxttl __read_mostly = 10 * 60 * HZ;    /* usual time to live: 10 min
 int inet_peer_gc_mintime __read_mostly = 10 * HZ;
 int inet_peer_gc_maxtime __read_mostly = 120 * HZ;
 
-static struct inet_peer *inet_peer_unused_head;
-static struct inet_peer **inet_peer_unused_tailp = &inet_peer_unused_head;
+static LIST_HEAD(unused_peers);
 static DEFINE_SPINLOCK(inet_peer_unused_lock);
 
 static void peer_check_expire(unsigned long dummy);
@@ -138,15 +137,7 @@ void __init inet_initpeers(void)
 static void unlink_from_unused(struct inet_peer *p)
 {
        spin_lock_bh(&inet_peer_unused_lock);
-       if (p->unused_prevp != NULL) {
-               /* On unused list. */
-               *p->unused_prevp = p->unused_next;
-               if (p->unused_next != NULL)
-                       p->unused_next->unused_prevp = p->unused_prevp;
-               else
-                       inet_peer_unused_tailp = p->unused_prevp;
-               p->unused_prevp = NULL; /* mark it as removed */
-       }
+       list_del_init(&p->unused);
        spin_unlock_bh(&inet_peer_unused_lock);
 }
 
@@ -337,24 +328,24 @@ static void unlink_from_pool(struct inet_peer *p)
 /* May be called with local BH enabled. */
 static int cleanup_once(unsigned long ttl)
 {
-       struct inet_peer *p;
+       struct inet_peer *p = NULL;
 
        /* Remove the first entry from the list of unused nodes. */
        spin_lock_bh(&inet_peer_unused_lock);
-       p = inet_peer_unused_head;
-       if (p != NULL) {
-               __u32 delta = (__u32)jiffies - p->dtime;
+       if (!list_empty(&unused_peers)) {
+               __u32 delta;
+
+               p = list_first_entry(&unused_peers, struct inet_peer, unused);
+               delta = (__u32)jiffies - p->dtime;
+
                if (delta < ttl) {
                        /* Do not prune fresh entries. */
                        spin_unlock_bh(&inet_peer_unused_lock);
                        return -1;
                }
-               inet_peer_unused_head = p->unused_next;
-               if (p->unused_next != NULL)
-                       p->unused_next->unused_prevp = p->unused_prevp;
-               else
-                       inet_peer_unused_tailp = p->unused_prevp;
-               p->unused_prevp = NULL; /* mark as not on the list */
+
+               list_del_init(&p->unused);
+
                /* Grab an extra reference to prevent node disappearing
                 * before unlink_from_pool() call. */
                atomic_inc(&p->refcnt);
@@ -412,7 +403,7 @@ struct inet_peer *inet_getpeer(__be32 daddr, int create)
 
        /* Link the node. */
        link_to_pool(n);
-       n->unused_prevp = NULL; /* not on the list */
+       INIT_LIST_HEAD(&n->unused);
        peer_total++;
        write_unlock_bh(&peer_pool_lock);
 
@@ -467,10 +458,7 @@ void inet_putpeer(struct inet_peer *p)
 {
        spin_lock_bh(&inet_peer_unused_lock);
        if (atomic_dec_and_test(&p->refcnt)) {
-               p->unused_prevp = inet_peer_unused_tailp;
-               p->unused_next = NULL;
-               *inet_peer_unused_tailp = p;
-               inet_peer_unused_tailp = &p->unused_next;
+               list_add_tail(&p->unused, &unused_peers);
                p->dtime = (__u32)jiffies;
        }
        spin_unlock_bh(&inet_peer_unused_lock);
index e5f7dc2de30349c8045bdadc5e77940bcf97680d..fd99fbd685ea9512cc03aa57db5347d34dd1e2cb 100644 (file)
@@ -1183,6 +1183,17 @@ error:
        return err;
 }
 
+static void ip_cork_release(struct inet_sock *inet)
+{
+       inet->cork.flags &= ~IPCORK_OPT;
+       kfree(inet->cork.opt);
+       inet->cork.opt = NULL;
+       if (inet->cork.rt) {
+               ip_rt_put(inet->cork.rt);
+               inet->cork.rt = NULL;
+       }
+}
+
 /*
  *     Combined all pending IP fragments on the socket as one IP datagram
  *     and push them out.
@@ -1276,13 +1287,7 @@ int ip_push_pending_frames(struct sock *sk)
        }
 
 out:
-       inet->cork.flags &= ~IPCORK_OPT;
-       kfree(inet->cork.opt);
-       inet->cork.opt = NULL;
-       if (inet->cork.rt) {
-               ip_rt_put(inet->cork.rt);
-               inet->cork.rt = NULL;
-       }
+       ip_cork_release(inet);
        return err;
 
 error:
@@ -1295,19 +1300,12 @@ error:
  */
 void ip_flush_pending_frames(struct sock *sk)
 {
-       struct inet_sock *inet = inet_sk(sk);
        struct sk_buff *skb;
 
        while ((skb = __skb_dequeue_tail(&sk->sk_write_queue)) != NULL)
                kfree_skb(skb);
 
-       inet->cork.flags &= ~IPCORK_OPT;
-       kfree(inet->cork.opt);
-       inet->cork.opt = NULL;
-       if (inet->cork.rt) {
-               ip_rt_put(inet->cork.rt);
-               inet->cork.rt = NULL;
-       }
+       ip_cork_release(inet_sk(sk));
 }
 
 
index f51f20e487c8c74ec078781790d35e7302ba6cb3..82817e5543638e93299e017262693da28bf1bff8 100644 (file)
@@ -437,10 +437,8 @@ static int do_ip_setsockopt(struct sock *sk, int level,
 
        /* If optlen==0, it is equivalent to val == 0 */
 
-#ifdef CONFIG_IP_MROUTE
-       if (optname >= MRT_BASE && optname <= (MRT_BASE + 10))
+       if (ip_mroute_opt(optname))
                return ip_mroute_setsockopt(sk,optname,optval,optlen);
-#endif
 
        err = 0;
        lock_sock(sk);
@@ -909,11 +907,9 @@ int ip_setsockopt(struct sock *sk, int level,
 #ifdef CONFIG_NETFILTER
        /* we need to exclude all possible ENOPROTOOPTs except default case */
        if (err == -ENOPROTOOPT && optname != IP_HDRINCL &&
-               optname != IP_IPSEC_POLICY && optname != IP_XFRM_POLICY
-#ifdef CONFIG_IP_MROUTE
-               && (optname < MRT_BASE || optname > (MRT_BASE + 10))
-#endif
-          ) {
+                       optname != IP_IPSEC_POLICY &&
+                       optname != IP_XFRM_POLICY &&
+                       !ip_mroute_opt(optname)) {
                lock_sock(sk);
                err = nf_setsockopt(sk, PF_INET, optname, optval, optlen);
                release_sock(sk);
@@ -935,11 +931,9 @@ int compat_ip_setsockopt(struct sock *sk, int level, int optname,
 #ifdef CONFIG_NETFILTER
        /* we need to exclude all possible ENOPROTOOPTs except default case */
        if (err == -ENOPROTOOPT && optname != IP_HDRINCL &&
-           optname != IP_IPSEC_POLICY && optname != IP_XFRM_POLICY
-#ifdef CONFIG_IP_MROUTE
-           && (optname < MRT_BASE || optname > (MRT_BASE + 10))
-#endif
-          ) {
+                       optname != IP_IPSEC_POLICY &&
+                       optname != IP_XFRM_POLICY &&
+                       !ip_mroute_opt(optname)) {
                lock_sock(sk);
                err = compat_nf_setsockopt(sk, PF_INET, optname,
                                           optval, optlen);
@@ -967,11 +961,8 @@ static int do_ip_getsockopt(struct sock *sk, int level, int optname,
        if (level != SOL_IP)
                return -EOPNOTSUPP;
 
-#ifdef CONFIG_IP_MROUTE
-       if (optname >= MRT_BASE && optname <= MRT_BASE+10) {
+       if (ip_mroute_opt(optname))
                return ip_mroute_getsockopt(sk,optname,optval,optlen);
-       }
-#endif
 
        if (get_user(len,optlen))
                return -EFAULT;
@@ -1171,11 +1162,8 @@ int ip_getsockopt(struct sock *sk, int level,
        err = do_ip_getsockopt(sk, level, optname, optval, optlen);
 #ifdef CONFIG_NETFILTER
        /* we need to exclude all possible ENOPROTOOPTs except default case */
-       if (err == -ENOPROTOOPT && optname != IP_PKTOPTIONS
-#ifdef CONFIG_IP_MROUTE
-               && (optname < MRT_BASE || optname > MRT_BASE+10)
-#endif
-          ) {
+       if (err == -ENOPROTOOPT && optname != IP_PKTOPTIONS &&
+                       !ip_mroute_opt(optname)) {
                int len;
 
                if (get_user(len,optlen))
@@ -1200,11 +1188,8 @@ int compat_ip_getsockopt(struct sock *sk, int level, int optname,
        int err = do_ip_getsockopt(sk, level, optname, optval, optlen);
 #ifdef CONFIG_NETFILTER
        /* we need to exclude all possible ENOPROTOOPTs except default case */
-       if (err == -ENOPROTOOPT && optname != IP_PKTOPTIONS
-#ifdef CONFIG_IP_MROUTE
-           && (optname < MRT_BASE || optname > MRT_BASE+10)
-#endif
-          ) {
+       if (err == -ENOPROTOOPT && optname != IP_PKTOPTIONS &&
+                       !ip_mroute_opt(optname)) {
                int len;
 
                if (get_user(len, optlen))
index 0bfeb02a5f87b7f99676fd5d73d89a4f9db70ba8..2c44a94c2135d80aebb3a8708292b829f6f3bcf6 100644 (file)
@@ -14,9 +14,9 @@
  *   - Adaptive compression.
  */
 #include <linux/module.h>
-#include <asm/scatterlist.h>
 #include <asm/semaphore.h>
 #include <linux/crypto.h>
+#include <linux/err.h>
 #include <linux/pfkeyv2.h>
 #include <linux/percpu.h>
 #include <linux/smp.h>
@@ -345,7 +345,7 @@ static struct crypto_comp **ipcomp_alloc_tfms(const char *alg_name)
        for_each_possible_cpu(cpu) {
                struct crypto_comp *tfm = crypto_alloc_comp(alg_name, 0,
                                                            CRYPTO_ALG_ASYNC);
-               if (!tfm)
+               if (IS_ERR(tfm))
                        goto error;
                *per_cpu_ptr(tfms, cpu) = tfm;
        }
index 4b702f708d30637954662a1ccc7f66cd95586569..0a9f3c37e18d8caa939f22d40b7b66dc72df3753 100644 (file)
@@ -425,6 +425,24 @@ ip_vs_bind_dest(struct ip_vs_conn *cp, struct ip_vs_dest *dest)
 }
 
 
+/*
+ * Check if there is a destination for the connection, if so
+ * bind the connection to the destination.
+ */
+struct ip_vs_dest *ip_vs_try_bind_dest(struct ip_vs_conn *cp)
+{
+       struct ip_vs_dest *dest;
+
+       if ((cp) && (!cp->dest)) {
+               dest = ip_vs_find_dest(cp->daddr, cp->dport,
+                                      cp->vaddr, cp->vport, cp->protocol);
+               ip_vs_bind_dest(cp, dest);
+               return dest;
+       } else
+               return NULL;
+}
+
+
 /*
  *     Unbind a connection entry with its VS destination
  *     Called by the ip_vs_conn_expire function.
index c6ed7654e839c652ccce23a4064b104b85435eeb..8fba20256f52abeae41df323563a8c04149b1293 100644 (file)
@@ -637,7 +637,7 @@ static int ip_vs_out_icmp(struct sk_buff *skb, int *related)
        verdict = NF_DROP;
 
        if (IP_VS_FWD_METHOD(cp) != 0) {
-               IP_VS_ERR("shouldn't reach here, because the box is on the"
+               IP_VS_ERR("shouldn't reach here, because the box is on the "
                          "half connection in the tun/dr module.\n");
        }
 
@@ -979,15 +979,23 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb,
                ret = NF_ACCEPT;
        }
 
-       /* increase its packet counter and check if it is needed
-          to be synchronized */
+       /* Increase its packet counter and check if it is needed
+        * to be synchronized
+        *
+        * Sync connection if it is about to close to
+        * encorage the standby servers to update the connections timeout
+        */
        atomic_inc(&cp->in_pkts);
        if ((ip_vs_sync_state & IP_VS_STATE_MASTER) &&
-           (cp->protocol != IPPROTO_TCP ||
-            cp->state == IP_VS_TCP_S_ESTABLISHED) &&
-           (atomic_read(&cp->in_pkts) % sysctl_ip_vs_sync_threshold[1]
-            == sysctl_ip_vs_sync_threshold[0]))
+           (((cp->protocol != IPPROTO_TCP ||
+              cp->state == IP_VS_TCP_S_ESTABLISHED) &&
+             (atomic_read(&cp->in_pkts) % sysctl_ip_vs_sync_threshold[1]
+              == sysctl_ip_vs_sync_threshold[0])) ||
+            ((cp->protocol == IPPROTO_TCP) && (cp->old_state != cp->state) &&
+             ((cp->state == IP_VS_TCP_S_FIN_WAIT) ||
+              (cp->state == IP_VS_TCP_S_CLOSE)))))
                ip_vs_sync_conn(cp);
+       cp->old_state = cp->state;
 
        ip_vs_conn_put(cp);
        return ret;
index 7345fc252a2315943b77c084a05ecaa45668d3e5..693d92490c117a587db3b882d648fa179c201698 100644 (file)
@@ -579,6 +579,31 @@ ip_vs_lookup_dest(struct ip_vs_service *svc, __be32 daddr, __be16 dport)
        return NULL;
 }
 
+/*
+ * Find destination by {daddr,dport,vaddr,protocol}
+ * Cretaed to be used in ip_vs_process_message() in
+ * the backup synchronization daemon. It finds the
+ * destination to be bound to the received connection
+ * on the backup.
+ *
+ * ip_vs_lookup_real_service() looked promissing, but
+ * seems not working as expected.
+ */
+struct ip_vs_dest *ip_vs_find_dest(__be32 daddr, __be16 dport,
+                                   __be32 vaddr, __be16 vport, __u16 protocol)
+{
+       struct ip_vs_dest *dest;
+       struct ip_vs_service *svc;
+
+       svc = ip_vs_service_get(0, protocol, vaddr, vport);
+       if (!svc)
+               return NULL;
+       dest = ip_vs_lookup_dest(svc, daddr, dport);
+       if (dest)
+               atomic_inc(&dest->refcnt);
+       ip_vs_service_put(svc);
+       return dest;
+}
 
 /*
  *  Lookup dest by {svc,addr,port} in the destination trash.
@@ -1399,7 +1424,6 @@ proc_do_sync_threshold(ctl_table *table, int write, struct file *filp,
 
 static struct ctl_table vs_vars[] = {
        {
-               .ctl_name       = NET_IPV4_VS_AMEMTHRESH,
                .procname       = "amemthresh",
                .data           = &sysctl_ip_vs_amemthresh,
                .maxlen         = sizeof(int),
@@ -1408,7 +1432,6 @@ static struct ctl_table vs_vars[] = {
        },
 #ifdef CONFIG_IP_VS_DEBUG
        {
-               .ctl_name       = NET_IPV4_VS_DEBUG_LEVEL,
                .procname       = "debug_level",
                .data           = &sysctl_ip_vs_debug_level,
                .maxlen         = sizeof(int),
@@ -1417,7 +1440,6 @@ static struct ctl_table vs_vars[] = {
        },
 #endif
        {
-               .ctl_name       = NET_IPV4_VS_AMDROPRATE,
                .procname       = "am_droprate",
                .data           = &sysctl_ip_vs_am_droprate,
                .maxlen         = sizeof(int),
@@ -1425,7 +1447,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec,
        },
        {
-               .ctl_name       = NET_IPV4_VS_DROP_ENTRY,
                .procname       = "drop_entry",
                .data           = &sysctl_ip_vs_drop_entry,
                .maxlen         = sizeof(int),
@@ -1433,7 +1454,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_do_defense_mode,
        },
        {
-               .ctl_name       = NET_IPV4_VS_DROP_PACKET,
                .procname       = "drop_packet",
                .data           = &sysctl_ip_vs_drop_packet,
                .maxlen         = sizeof(int),
@@ -1441,7 +1461,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_do_defense_mode,
        },
        {
-               .ctl_name       = NET_IPV4_VS_SECURE_TCP,
                .procname       = "secure_tcp",
                .data           = &sysctl_ip_vs_secure_tcp,
                .maxlen         = sizeof(int),
@@ -1450,7 +1469,6 @@ static struct ctl_table vs_vars[] = {
        },
 #if 0
        {
-               .ctl_name       = NET_IPV4_VS_TO_ES,
                .procname       = "timeout_established",
                .data   = &vs_timeout_table_dos.timeout[IP_VS_S_ESTABLISHED],
                .maxlen         = sizeof(int),
@@ -1458,7 +1476,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_VS_TO_SS,
                .procname       = "timeout_synsent",
                .data   = &vs_timeout_table_dos.timeout[IP_VS_S_SYN_SENT],
                .maxlen         = sizeof(int),
@@ -1466,7 +1483,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_VS_TO_SR,
                .procname       = "timeout_synrecv",
                .data   = &vs_timeout_table_dos.timeout[IP_VS_S_SYN_RECV],
                .maxlen         = sizeof(int),
@@ -1474,7 +1490,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_VS_TO_FW,
                .procname       = "timeout_finwait",
                .data   = &vs_timeout_table_dos.timeout[IP_VS_S_FIN_WAIT],
                .maxlen         = sizeof(int),
@@ -1482,7 +1497,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_VS_TO_TW,
                .procname       = "timeout_timewait",
                .data   = &vs_timeout_table_dos.timeout[IP_VS_S_TIME_WAIT],
                .maxlen         = sizeof(int),
@@ -1490,7 +1504,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_VS_TO_CL,
                .procname       = "timeout_close",
                .data   = &vs_timeout_table_dos.timeout[IP_VS_S_CLOSE],
                .maxlen         = sizeof(int),
@@ -1498,7 +1511,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_VS_TO_CW,
                .procname       = "timeout_closewait",
                .data   = &vs_timeout_table_dos.timeout[IP_VS_S_CLOSE_WAIT],
                .maxlen         = sizeof(int),
@@ -1506,7 +1518,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_VS_TO_LA,
                .procname       = "timeout_lastack",
                .data   = &vs_timeout_table_dos.timeout[IP_VS_S_LAST_ACK],
                .maxlen         = sizeof(int),
@@ -1514,7 +1525,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_VS_TO_LI,
                .procname       = "timeout_listen",
                .data   = &vs_timeout_table_dos.timeout[IP_VS_S_LISTEN],
                .maxlen         = sizeof(int),
@@ -1522,7 +1532,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_VS_TO_SA,
                .procname       = "timeout_synack",
                .data   = &vs_timeout_table_dos.timeout[IP_VS_S_SYNACK],
                .maxlen         = sizeof(int),
@@ -1530,7 +1539,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_VS_TO_UDP,
                .procname       = "timeout_udp",
                .data   = &vs_timeout_table_dos.timeout[IP_VS_S_UDP],
                .maxlen         = sizeof(int),
@@ -1538,7 +1546,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_VS_TO_ICMP,
                .procname       = "timeout_icmp",
                .data   = &vs_timeout_table_dos.timeout[IP_VS_S_ICMP],
                .maxlen         = sizeof(int),
@@ -1547,7 +1554,6 @@ static struct ctl_table vs_vars[] = {
        },
 #endif
        {
-               .ctl_name       = NET_IPV4_VS_CACHE_BYPASS,
                .procname       = "cache_bypass",
                .data           = &sysctl_ip_vs_cache_bypass,
                .maxlen         = sizeof(int),
@@ -1555,7 +1561,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec,
        },
        {
-               .ctl_name       = NET_IPV4_VS_EXPIRE_NODEST_CONN,
                .procname       = "expire_nodest_conn",
                .data           = &sysctl_ip_vs_expire_nodest_conn,
                .maxlen         = sizeof(int),
@@ -1563,7 +1568,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec,
        },
        {
-               .ctl_name       = NET_IPV4_VS_EXPIRE_QUIESCENT_TEMPLATE,
                .procname       = "expire_quiescent_template",
                .data           = &sysctl_ip_vs_expire_quiescent_template,
                .maxlen         = sizeof(int),
@@ -1571,7 +1575,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec,
        },
        {
-               .ctl_name       = NET_IPV4_VS_SYNC_THRESHOLD,
                .procname       = "sync_threshold",
                .data           = &sysctl_ip_vs_sync_threshold,
                .maxlen         = sizeof(sysctl_ip_vs_sync_threshold),
@@ -1579,7 +1582,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_do_sync_threshold,
        },
        {
-               .ctl_name       = NET_IPV4_VS_NAT_ICMP_SEND,
                .procname       = "nat_icmp_send",
                .data           = &sysctl_ip_vs_nat_icmp_send,
                .maxlen         = sizeof(int),
@@ -1591,7 +1593,6 @@ static struct ctl_table vs_vars[] = {
 
 static ctl_table vs_table[] = {
        {
-               .ctl_name       = NET_IPV4_VS,
                .procname       = "vs",
                .mode           = 0555,
                .child          = vs_vars
index 052f4ed59174ac0b40012712e33e06fabe0a72cb..b843a11d7cf7c33ae187a8879841516e33927e31 100644 (file)
@@ -114,7 +114,6 @@ struct ip_vs_lblc_table {
 
 static ctl_table vs_vars_table[] = {
        {
-               .ctl_name       = NET_IPV4_VS_LBLC_EXPIRE,
                .procname       = "lblc_expiration",
                .data           = &sysctl_ip_vs_lblc_expiration,
                .maxlen         = sizeof(int),
@@ -126,7 +125,6 @@ static ctl_table vs_vars_table[] = {
 
 static ctl_table vs_table[] = {
        {
-               .ctl_name       = NET_IPV4_VS,
                .procname       = "vs",
                .mode           = 0555,
                .child          = vs_vars_table
index 6a1fec416eafc6fc0076dcb06632559238cd6da8..e5b323a6b2f784a02389f5cdc4e4fceedd508be9 100644 (file)
@@ -48,8 +48,6 @@
 /* for sysctl */
 #include <linux/fs.h>
 #include <linux/sysctl.h>
-/* for proc_net_create/proc_net_remove */
-#include <linux/proc_fs.h>
 #include <net/net_namespace.h>
 
 #include <net/ip_vs.h>
@@ -304,7 +302,6 @@ struct ip_vs_lblcr_table {
 
 static ctl_table vs_vars_table[] = {
        {
-               .ctl_name       = NET_IPV4_VS_LBLCR_EXPIRE,
                .procname       = "lblcr_expiration",
                .data           = &sysctl_ip_vs_lblcr_expiration,
                .maxlen         = sizeof(int),
@@ -316,7 +313,6 @@ static ctl_table vs_vars_table[] = {
 
 static ctl_table vs_table[] = {
        {
-               .ctl_name       = NET_IPV4_VS,
                .procname       = "vs",
                .mode           = 0555,
                .child          = vs_vars_table
@@ -547,71 +543,6 @@ static void ip_vs_lblcr_check_expire(unsigned long data)
        mod_timer(&tbl->periodic_timer, jiffies+CHECK_EXPIRE_INTERVAL);
 }
 
-
-#ifdef CONFIG_IP_VS_LBLCR_DEBUG
-static struct ip_vs_lblcr_table *lblcr_table_list;
-
-/*
- *     /proc/net/ip_vs_lblcr to display the mappings of
- *                  destination IP address <==> its serverSet
- */
-static int
-ip_vs_lblcr_getinfo(char *buffer, char **start, off_t offset, int length)
-{
-       off_t pos=0, begin;
-       int len=0, size;
-       struct ip_vs_lblcr_table *tbl;
-       unsigned long now = jiffies;
-       int i;
-       struct ip_vs_lblcr_entry *en;
-
-       tbl = lblcr_table_list;
-
-       size = sprintf(buffer, "LastTime Dest IP address  Server set\n");
-       pos += size;
-       len += size;
-
-       for (i=0; i<IP_VS_LBLCR_TAB_SIZE; i++) {
-               read_lock_bh(&tbl->lock);
-               list_for_each_entry(en, &tbl->bucket[i], list) {
-                       char tbuf[16];
-                       struct ip_vs_dest_list *d;
-
-                       sprintf(tbuf, "%u.%u.%u.%u", NIPQUAD(en->addr));
-                       size = sprintf(buffer+len, "%8lu %-16s ",
-                                      now-en->lastuse, tbuf);
-
-                       read_lock(&en->set.lock);
-                       for (d=en->set.list; d!=NULL; d=d->next) {
-                               size += sprintf(buffer+len+size,
-                                               "%u.%u.%u.%u ",
-                                               NIPQUAD(d->dest->addr));
-                       }
-                       read_unlock(&en->set.lock);
-                       size += sprintf(buffer+len+size, "\n");
-                       len += size;
-                       pos += size;
-                       if (pos <= offset)
-                               len=0;
-                       if (pos >= offset+length) {
-                               read_unlock_bh(&tbl->lock);
-                               goto done;
-                       }
-               }
-               read_unlock_bh(&tbl->lock);
-       }
-
-  done:
-       begin = len - (pos - offset);
-       *start = buffer + begin;
-       len -= begin;
-       if(len>length)
-               len = length;
-       return len;
-}
-#endif
-
-
 static int ip_vs_lblcr_init_svc(struct ip_vs_service *svc)
 {
        int i;
@@ -650,9 +581,6 @@ static int ip_vs_lblcr_init_svc(struct ip_vs_service *svc)
        tbl->periodic_timer.expires = jiffies+CHECK_EXPIRE_INTERVAL;
        add_timer(&tbl->periodic_timer);
 
-#ifdef CONFIG_IP_VS_LBLCR_DEBUG
-       lblcr_table_list = tbl;
-#endif
        return 0;
 }
 
@@ -843,18 +771,12 @@ static int __init ip_vs_lblcr_init(void)
 {
        INIT_LIST_HEAD(&ip_vs_lblcr_scheduler.n_list);
        sysctl_header = register_sysctl_table(lblcr_root_table);
-#ifdef CONFIG_IP_VS_LBLCR_DEBUG
-       proc_net_create(&init_net, "ip_vs_lblcr", 0, ip_vs_lblcr_getinfo);
-#endif
        return register_ip_vs_scheduler(&ip_vs_lblcr_scheduler);
 }
 
 
 static void __exit ip_vs_lblcr_cleanup(void)
 {
-#ifdef CONFIG_IP_VS_LBLCR_DEBUG
-       proc_net_remove(&init_net, "ip_vs_lblcr");
-#endif
        unregister_sysctl_table(sysctl_header);
        unregister_ip_vs_scheduler(&ip_vs_lblcr_scheduler);
 }
index e844ddb82b9a9e20cdedaf886111cb21e0daf23e..c0e11ec8f0f991d7096ce0e44f1535eddd7e39b2 100644 (file)
@@ -45,7 +45,7 @@ static struct ip_vs_protocol *ip_vs_proto_table[IP_VS_PROTO_TAB_SIZE];
 /*
  *     register an ipvs protocol
  */
-static int register_ip_vs_protocol(struct ip_vs_protocol *pp)
+static int __used register_ip_vs_protocol(struct ip_vs_protocol *pp)
 {
        unsigned hash = IP_VS_PROTO_HASH(pp->protocol);
 
index c99f2a33fb9e9165a3f2b7144ea609b6b151e34b..bd930efc18dabb27e0058adc97d20900b02a4ef2 100644 (file)
@@ -72,7 +72,6 @@ struct ip_vs_sync_thread_data {
        int state;
 };
 
-#define IP_VS_SYNC_CONN_TIMEOUT (3*60*HZ)
 #define SIMPLE_CONN_SIZE  (sizeof(struct ip_vs_sync_conn))
 #define FULL_CONN_SIZE  \
 (sizeof(struct ip_vs_sync_conn) + sizeof(struct ip_vs_sync_conn_options))
@@ -284,6 +283,8 @@ static void ip_vs_process_message(const char *buffer, const size_t buflen)
        struct ip_vs_sync_conn *s;
        struct ip_vs_sync_conn_options *opt;
        struct ip_vs_conn *cp;
+       struct ip_vs_protocol *pp;
+       struct ip_vs_dest *dest;
        char *p;
        int i;
 
@@ -317,20 +318,34 @@ static void ip_vs_process_message(const char *buffer, const size_t buflen)
                                               s->caddr, s->cport,
                                               s->vaddr, s->vport);
                if (!cp) {
+                       /*
+                        * Find the appropriate destination for the connection.
+                        * If it is not found the connection will remain unbound
+                        * but still handled.
+                        */
+                       dest = ip_vs_find_dest(s->daddr, s->dport,
+                                              s->vaddr, s->vport,
+                                              s->protocol);
                        cp = ip_vs_conn_new(s->protocol,
                                            s->caddr, s->cport,
                                            s->vaddr, s->vport,
                                            s->daddr, s->dport,
-                                           flags, NULL);
+                                           flags, dest);
+                       if (dest)
+                               atomic_dec(&dest->refcnt);
                        if (!cp) {
                                IP_VS_ERR("ip_vs_conn_new failed\n");
                                return;
                        }
                        cp->state = ntohs(s->state);
                } else if (!cp->dest) {
-                       /* it is an entry created by the synchronization */
-                       cp->state = ntohs(s->state);
-                       cp->flags = flags | IP_VS_CONN_F_HASHED;
+                       dest = ip_vs_try_bind_dest(cp);
+                       if (!dest) {
+                               /* it is an unbound entry created by
+                                * synchronization */
+                               cp->flags = flags | IP_VS_CONN_F_HASHED;
+                       } else
+                               atomic_dec(&dest->refcnt);
                }       /* Note that we don't touch its state and flags
                           if it is a normal entry. */
 
@@ -342,7 +357,9 @@ static void ip_vs_process_message(const char *buffer, const size_t buflen)
                        p += SIMPLE_CONN_SIZE;
 
                atomic_set(&cp->in_pkts, sysctl_ip_vs_sync_threshold[0]);
-               cp->timeout = IP_VS_SYNC_CONN_TIMEOUT;
+               cp->state = ntohs(s->state);
+               pp = ip_vs_proto_get(s->protocol);
+               cp->timeout = pp->timeout_table[cp->state];
                ip_vs_conn_put(cp);
 
                if (p > buffer+buflen) {
index fa97947c6ae1024fd1a88ae25a29dc4566977766..9aca9c55687cd6bfd6a96a63bb40d90b8d1f3ba1 100644 (file)
@@ -128,7 +128,7 @@ config IP_NF_MATCH_ADDRTYPE
          eg. UNICAST, LOCAL, BROADCAST, ...
        
          If you want to compile it as a module, say M here and read
-         <file:Documentation/modules.txt>.  If unsure, say `N'.
+         <file:Documentation/kbuild/modules.txt>.  If unsure, say `N'.
 
 # `filter', generic and specific targets
 config IP_NF_FILTER
@@ -371,7 +371,7 @@ config IP_NF_RAW
          and OUTPUT chains.
        
          If you want to compile it as a module, say M here and read
-         <file:Documentation/modules.txt>.  If unsure, say `N'.
+         <file:Documentation/kbuild/modules.txt>.  If unsure, say `N'.
 
 # ARP tables
 config IP_NF_ARPTABLES
index 409d273f6f8232f68a71e7f4240d6a106285e513..7456833d6ade438f3b5c5f478fb6062cdaf5e3a2 100644 (file)
@@ -41,27 +41,27 @@ obj-$(CONFIG_NF_NAT) += iptable_nat.o
 obj-$(CONFIG_IP_NF_RAW) += iptable_raw.o
 
 # matches
+obj-$(CONFIG_IP_NF_MATCH_ADDRTYPE) += ipt_addrtype.o
+obj-$(CONFIG_IP_NF_MATCH_AH) += ipt_ah.o
+obj-$(CONFIG_IP_NF_MATCH_ECN) += ipt_ecn.o
 obj-$(CONFIG_IP_NF_MATCH_IPRANGE) += ipt_iprange.o
 obj-$(CONFIG_IP_NF_MATCH_OWNER) += ipt_owner.o
-obj-$(CONFIG_IP_NF_MATCH_TOS) += ipt_tos.o
 obj-$(CONFIG_IP_NF_MATCH_RECENT) += ipt_recent.o
-obj-$(CONFIG_IP_NF_MATCH_ECN) += ipt_ecn.o
-obj-$(CONFIG_IP_NF_MATCH_AH) += ipt_ah.o
+obj-$(CONFIG_IP_NF_MATCH_TOS) += ipt_tos.o
 obj-$(CONFIG_IP_NF_MATCH_TTL) += ipt_ttl.o
-obj-$(CONFIG_IP_NF_MATCH_ADDRTYPE) += ipt_addrtype.o
 
 # targets
-obj-$(CONFIG_IP_NF_TARGET_REJECT) += ipt_REJECT.o
-obj-$(CONFIG_IP_NF_TARGET_TOS) += ipt_TOS.o
+obj-$(CONFIG_IP_NF_TARGET_CLUSTERIP) += ipt_CLUSTERIP.o
 obj-$(CONFIG_IP_NF_TARGET_ECN) += ipt_ECN.o
+obj-$(CONFIG_IP_NF_TARGET_LOG) += ipt_LOG.o
 obj-$(CONFIG_IP_NF_TARGET_MASQUERADE) += ipt_MASQUERADE.o
-obj-$(CONFIG_IP_NF_TARGET_REDIRECT) += ipt_REDIRECT.o
 obj-$(CONFIG_IP_NF_TARGET_NETMAP) += ipt_NETMAP.o
+obj-$(CONFIG_IP_NF_TARGET_REDIRECT) += ipt_REDIRECT.o
+obj-$(CONFIG_IP_NF_TARGET_REJECT) += ipt_REJECT.o
 obj-$(CONFIG_IP_NF_TARGET_SAME) += ipt_SAME.o
-obj-$(CONFIG_IP_NF_TARGET_LOG) += ipt_LOG.o
-obj-$(CONFIG_IP_NF_TARGET_ULOG) += ipt_ULOG.o
-obj-$(CONFIG_IP_NF_TARGET_CLUSTERIP) += ipt_CLUSTERIP.o
+obj-$(CONFIG_IP_NF_TARGET_TOS) += ipt_TOS.o
 obj-$(CONFIG_IP_NF_TARGET_TTL) += ipt_TTL.o
+obj-$(CONFIG_IP_NF_TARGET_ULOG) += ipt_ULOG.o
 
 # generic ARP tables
 obj-$(CONFIG_IP_NF_ARPTABLES) += arp_tables.o
index 10a2ce09fd8e9e88065250c2ed4f96225e15d646..14d64a383db1a7223ed321e5dedfbc1942af1095 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/spinlock.h>
 #include <linux/sysctl.h>
 #include <linux/proc_fs.h>
+#include <linux/seq_file.h>
 #include <linux/security.h>
 #include <linux/mutex.h>
 #include <net/net_namespace.h>
@@ -607,15 +608,11 @@ static ctl_table ipq_root_table[] = {
        { .ctl_name = 0 }
 };
 
-#ifdef CONFIG_PROC_FS
-static int
-ipq_get_info(char *buffer, char **start, off_t offset, int length)
+static int ip_queue_show(struct seq_file *m, void *v)
 {
-       int len;
-
        read_lock_bh(&queue_lock);
 
-       len = sprintf(buffer,
+       seq_printf(m,
                      "Peer PID          : %d\n"
                      "Copy mode         : %hu\n"
                      "Copy range        : %u\n"
@@ -632,16 +629,21 @@ ipq_get_info(char *buffer, char **start, off_t offset, int length)
                      queue_user_dropped);
 
        read_unlock_bh(&queue_lock);
+       return 0;
+}
 
-       *start = buffer + offset;
-       len -= offset;
-       if (len > length)
-               len = length;
-       else if (len < 0)
-               len = 0;
-       return len;
+static int ip_queue_open(struct inode *inode, struct file *file)
+{
+       return single_open(file, ip_queue_show, NULL);
 }
-#endif /* CONFIG_PROC_FS */
+
+static const struct file_operations ip_queue_proc_fops = {
+       .open           = ip_queue_open,
+       .read           = seq_read,
+       .llseek         = seq_lseek,
+       .release        = single_release,
+       .owner          = THIS_MODULE,
+};
 
 static struct nf_queue_handler nfqh = {
        .name   = "ip_queue",
@@ -661,10 +663,11 @@ static int __init ip_queue_init(void)
                goto cleanup_netlink_notifier;
        }
 
-       proc = proc_net_create(&init_net, IPQ_PROC_FS_NAME, 0, ipq_get_info);
-       if (proc)
+       proc = create_proc_entry(IPQ_PROC_FS_NAME, 0, init_net.proc_net);
+       if (proc) {
                proc->owner = THIS_MODULE;
-       else {
+               proc->proc_fops = &ip_queue_proc_fops;
+       } else {
                printk(KERN_ERR "ip_queue: failed to create proc entry\n");
                goto cleanup_ipqnl;
        }
index 5de6e57ac55c20ebd3f0ca8bd16310d15b52a640..f8678651250f0b349058e9243444372ab8b1d95a 100644 (file)
@@ -66,7 +66,7 @@ ipt_local_hook(unsigned int hook,
        if (skb->len < sizeof(struct iphdr) ||
            ip_hdrlen(skb) < sizeof(struct iphdr)) {
                if (net_ratelimit())
-                       printk("iptable_raw: ignoring short SOCK_RAW"
+                       printk("iptable_raw: ignoring short SOCK_RAW "
                               "packet.\n");
                return NF_ACCEPT;
        }
index 35a5aa69cd92bb9b912c326a167c3233eb20032b..c31b876682502c5d6c13523ff086103e49c5fd7f 100644 (file)
@@ -69,7 +69,7 @@ static void __exit nf_nat_amanda_fini(void)
 
 static int __init nf_nat_amanda_init(void)
 {
-       BUG_ON(rcu_dereference(nf_nat_amanda_hook));
+       BUG_ON(nf_nat_amanda_hook != NULL);
        rcu_assign_pointer(nf_nat_amanda_hook, help);
        return 0;
 }
index 56e93f692e82b363c010de0eeef16428a8ce4ba5..86b465b176baad0e0a3a504d47cb2d059894cf20 100644 (file)
@@ -607,13 +607,10 @@ static void nf_nat_move_storage(struct nf_conn *conntrack, void *old)
        struct nf_conn_nat *new_nat = nf_ct_ext_find(conntrack, NF_CT_EXT_NAT);
        struct nf_conn_nat *old_nat = (struct nf_conn_nat *)old;
        struct nf_conn *ct = old_nat->ct;
-       unsigned int srchash;
 
-       if (!(ct->status & IPS_NAT_DONE_MASK))
+       if (!ct || !(ct->status & IPS_NAT_DONE_MASK))
                return;
 
-       srchash = hash_by_src(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
-
        write_lock_bh(&nf_nat_lock);
        hlist_replace_rcu(&old_nat->bysource, &new_nat->bysource);
        new_nat->ct = ct;
@@ -681,7 +678,7 @@ static int clean_nat(struct nf_conn *i, void *data)
 
        if (!nat)
                return 0;
-       memset(nat, 0, sizeof(nat));
+       memset(nat, 0, sizeof(*nat));
        i->status &= ~(IPS_NAT_MASK | IPS_NAT_DONE_MASK | IPS_SEQ_ADJUST);
        return 0;
 }
index e1a16d3ea4cbaba6df03e47ab57f590f4a140240..a1d5d58a58bf904b25115fe8dff4397e4d541a29 100644 (file)
@@ -147,7 +147,7 @@ static void __exit nf_nat_ftp_fini(void)
 
 static int __init nf_nat_ftp_init(void)
 {
-       BUG_ON(rcu_dereference(nf_nat_ftp_hook));
+       BUG_ON(nf_nat_ftp_hook != NULL);
        rcu_assign_pointer(nf_nat_ftp_hook, nf_nat_ftp);
        return 0;
 }
index a868c8c4132860275b89c87364ac0cb840a16cc8..93e18ef114f2e1052798d1b2d2f200cafb345b6a 100644 (file)
@@ -544,15 +544,15 @@ static int nat_callforwarding(struct sk_buff *skb, struct nf_conn *ct,
 /****************************************************************************/
 static int __init init(void)
 {
-       BUG_ON(rcu_dereference(set_h245_addr_hook) != NULL);
-       BUG_ON(rcu_dereference(set_h225_addr_hook) != NULL);
-       BUG_ON(rcu_dereference(set_sig_addr_hook) != NULL);
-       BUG_ON(rcu_dereference(set_ras_addr_hook) != NULL);
-       BUG_ON(rcu_dereference(nat_rtp_rtcp_hook) != NULL);
-       BUG_ON(rcu_dereference(nat_t120_hook) != NULL);
-       BUG_ON(rcu_dereference(nat_h245_hook) != NULL);
-       BUG_ON(rcu_dereference(nat_callforwarding_hook) != NULL);
-       BUG_ON(rcu_dereference(nat_q931_hook) != NULL);
+       BUG_ON(set_h245_addr_hook != NULL);
+       BUG_ON(set_h225_addr_hook != NULL);
+       BUG_ON(set_sig_addr_hook != NULL);
+       BUG_ON(set_ras_addr_hook != NULL);
+       BUG_ON(nat_rtp_rtcp_hook != NULL);
+       BUG_ON(nat_t120_hook != NULL);
+       BUG_ON(nat_h245_hook != NULL);
+       BUG_ON(nat_callforwarding_hook != NULL);
+       BUG_ON(nat_q931_hook != NULL);
 
        rcu_assign_pointer(set_h245_addr_hook, set_h245_addr);
        rcu_assign_pointer(set_h225_addr_hook, set_h225_addr);
index 766e2c16c6b957c81eecc245ff0ff7521b7afe82..fe6f9cef6c854d4c13c9a8ecb5951a6f33f68b00 100644 (file)
@@ -74,7 +74,7 @@ static void __exit nf_nat_irc_fini(void)
 
 static int __init nf_nat_irc_init(void)
 {
-       BUG_ON(rcu_dereference(nf_nat_irc_hook));
+       BUG_ON(nf_nat_irc_hook != NULL);
        rcu_assign_pointer(nf_nat_irc_hook, help);
        return 0;
 }
index e1385a0990796f333b3ba5f903b8f3900235a1c1..6817e7995f35ca4963c1757e939e7e904f9f92f8 100644 (file)
@@ -281,16 +281,16 @@ static int __init nf_nat_helper_pptp_init(void)
 {
        nf_nat_need_gre();
 
-       BUG_ON(rcu_dereference(nf_nat_pptp_hook_outbound));
+       BUG_ON(nf_nat_pptp_hook_outbound != NULL);
        rcu_assign_pointer(nf_nat_pptp_hook_outbound, pptp_outbound_pkt);
 
-       BUG_ON(rcu_dereference(nf_nat_pptp_hook_inbound));
+       BUG_ON(nf_nat_pptp_hook_inbound != NULL);
        rcu_assign_pointer(nf_nat_pptp_hook_inbound, pptp_inbound_pkt);
 
-       BUG_ON(rcu_dereference(nf_nat_pptp_hook_exp_gre));
+       BUG_ON(nf_nat_pptp_hook_exp_gre != NULL);
        rcu_assign_pointer(nf_nat_pptp_hook_exp_gre, pptp_exp_gre);
 
-       BUG_ON(rcu_dereference(nf_nat_pptp_hook_expectfn));
+       BUG_ON(nf_nat_pptp_hook_expectfn != NULL);
        rcu_assign_pointer(nf_nat_pptp_hook_expectfn, pptp_nat_expected);
        return 0;
 }
index ce9edbcc01e387dc8ca320f28adc40520718dbae..3ca98971a1e92c3385e7398fffb87168ad900c46 100644 (file)
@@ -293,8 +293,8 @@ static void __exit nf_nat_sip_fini(void)
 
 static int __init nf_nat_sip_init(void)
 {
-       BUG_ON(rcu_dereference(nf_nat_sip_hook));
-       BUG_ON(rcu_dereference(nf_nat_sdp_hook));
+       BUG_ON(nf_nat_sip_hook != NULL);
+       BUG_ON(nf_nat_sdp_hook != NULL);
        rcu_assign_pointer(nf_nat_sip_hook, ip_nat_sip);
        rcu_assign_pointer(nf_nat_sdp_hook, ip_nat_sdp);
        return 0;
index 0ecec701cb448dc23224182aec2489ddf43f9e49..1360a94766dd6321d7f1a07d719d88adce5a44f1 100644 (file)
@@ -43,7 +43,7 @@ static void __exit nf_nat_tftp_fini(void)
 
 static int __init nf_nat_tftp_init(void)
 {
-       BUG_ON(rcu_dereference(nf_nat_tftp_hook));
+       BUG_ON(nf_nat_tftp_hook != NULL);
        rcu_assign_pointer(nf_nat_tftp_hook, help);
        return 0;
 }
index 9be0daa9c0ecc16c6a95f2c9402b9879df6fdc08..ce34b281803f479ba29196aafaad416a01441191 100644 (file)
 #include <net/sock.h>
 #include <net/raw.h>
 
-static int fold_prot_inuse(struct proto *proto)
-{
-       int res = 0;
-       int cpu;
-
-       for_each_possible_cpu(cpu)
-               res += proto->stats[cpu].inuse;
-
-       return res;
-}
-
 /*
  *     Report socket allocation statistics [mea@utu.fi]
  */
@@ -64,12 +53,12 @@ static int sockstat_seq_show(struct seq_file *seq, void *v)
 {
        socket_seq_show(seq);
        seq_printf(seq, "TCP: inuse %d orphan %d tw %d alloc %d mem %d\n",
-                  fold_prot_inuse(&tcp_prot), atomic_read(&tcp_orphan_count),
+                  sock_prot_inuse(&tcp_prot), atomic_read(&tcp_orphan_count),
                   tcp_death_row.tw_count, atomic_read(&tcp_sockets_allocated),
                   atomic_read(&tcp_memory_allocated));
-       seq_printf(seq, "UDP: inuse %d\n", fold_prot_inuse(&udp_prot));
-       seq_printf(seq, "UDPLITE: inuse %d\n", fold_prot_inuse(&udplite_prot));
-       seq_printf(seq, "RAW: inuse %d\n", fold_prot_inuse(&raw_prot));
+       seq_printf(seq, "UDP: inuse %d\n", sock_prot_inuse(&udp_prot));
+       seq_printf(seq, "UDPLITE: inuse %d\n", sock_prot_inuse(&udplite_prot));
+       seq_printf(seq, "RAW: inuse %d\n", sock_prot_inuse(&raw_prot));
        seq_printf(seq,  "FRAG: inuse %d memory %d\n",
                        ip_frag_nqueues(), ip_frag_mem());
        return 0;
@@ -304,7 +293,7 @@ static void icmp_put(struct seq_file *seq)
        for (i=0; icmpmibmap[i].name != NULL; i++)
                seq_printf(seq, " %lu",
                        snmp_fold_field((void **) icmpmsg_statistics,
-                               icmpmibmap[i].index));
+                               icmpmibmap[i].index | 0x100));
 }
 
 /*
index 3916faca3afef64fcbc8d583715b384f364c56d7..66b42f547bf9c0b21bd2462a4534e54978b2813f 100644 (file)
@@ -760,6 +760,8 @@ static int raw_ioctl(struct sock *sk, int cmd, unsigned long arg)
        }
 }
 
+DEFINE_PROTO_INUSE(raw)
+
 struct proto raw_prot = {
        .name              = "RAW",
        .owner             = THIS_MODULE,
@@ -781,6 +783,7 @@ struct proto raw_prot = {
        .compat_setsockopt = compat_raw_setsockopt,
        .compat_getsockopt = compat_raw_getsockopt,
 #endif
+       REF_PROTO_INUSE(raw)
 };
 
 #ifdef CONFIG_PROC_FS
index 21b12de9e6536663d5da2b60bd1d94b1d984acdd..c426dec6d57903467fd5cd7a233a872efa0524ce 100644 (file)
@@ -578,6 +578,9 @@ static void rt_check_expire(struct work_struct *work)
                i = (i + 1) & rt_hash_mask;
                rthp = &rt_hash_table[i].chain;
 
+               if (need_resched())
+                       cond_resched();
+
                if (*rthp == NULL)
                        continue;
                spin_lock_bh(rt_hash_lock_addr(i));
@@ -851,9 +854,7 @@ restart:
                         */
                        rcu_assign_pointer(rt_hash_table[hash].chain, rth);
 
-                       rth->u.dst.__use++;
-                       dst_hold(&rth->u.dst);
-                       rth->u.dst.lastuse = now;
+                       dst_use(&rth->u.dst, now);
                        spin_unlock_bh(rt_hash_lock_addr(hash));
 
                        rt_drop(rt);
@@ -1813,11 +1814,6 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
                goto martian_destination;
 
        err = ip_mkroute_input(skb, &res, &fl, in_dev, daddr, saddr, tos);
-       if (err == -ENOBUFS)
-               goto e_nobufs;
-       if (err == -EINVAL)
-               goto e_inval;
-
 done:
        in_dev_put(in_dev);
        if (free_res)
@@ -1935,9 +1931,7 @@ int ip_route_input(struct sk_buff *skb, __be32 daddr, __be32 saddr,
                    rth->fl.oif == 0 &&
                    rth->fl.mark == skb->mark &&
                    rth->fl.fl4_tos == tos) {
-                       rth->u.dst.lastuse = jiffies;
-                       dst_hold(&rth->u.dst);
-                       rth->u.dst.__use++;
+                       dst_use(&rth->u.dst, jiffies);
                        RT_CACHE_STAT_INC(in_hit);
                        rcu_read_unlock();
                        skb->dst = (struct dst_entry*)rth;
@@ -2331,9 +2325,7 @@ int __ip_route_output_key(struct rtable **rp, const struct flowi *flp)
                    rth->fl.mark == flp->mark &&
                    !((rth->fl.fl4_tos ^ flp->fl4_tos) &
                            (IPTOS_RT_MASK | RTO_ONLINK))) {
-                       rth->u.dst.lastuse = jiffies;
-                       dst_hold(&rth->u.dst);
-                       rth->u.dst.__use++;
+                       dst_use(&rth->u.dst, jiffies);
                        RT_CACHE_STAT_INC(out_hit);
                        rcu_read_unlock_bh();
                        *rp = rth;
@@ -2896,18 +2888,14 @@ static int ip_rt_acct_read(char *buffer, char **start, off_t offset,
        offset /= sizeof(u32);
 
        if (length > 0) {
-               u32 *src = ((u32 *) IP_RT_ACCT_CPU(0)) + offset;
                u32 *dst = (u32 *) buffer;
 
-               /* Copy first cpu. */
                *start = buffer;
-               memcpy(dst, src, length);
+               memset(dst, 0, length);
 
-               /* Add the other cpus in, one int at a time */
                for_each_possible_cpu(i) {
                        unsigned int j;
-
-                       src = ((u32 *) IP_RT_ACCT_CPU(i)) + offset;
+                       u32 *src = ((u32 *) IP_RT_ACCT_CPU(i)) + offset;
 
                        for (j = 0; j < length/4; j++)
                                dst[j] += src[j];
index ffddd2b453523c137dae115fde91aa1e91d5471a..bec6fe880657b9149228ac191ac1cb309f6bc05a 100644 (file)
@@ -191,7 +191,7 @@ static int sysctl_tcp_congestion_control(ctl_table *table, int __user *name,
 
        tcp_get_default_congestion_control(val);
        ret = sysctl_string(&tbl, name, nlen, oldval, oldlenp, newval, newlen);
-       if (ret == 0 && newval && newlen)
+       if (ret == 1 && newval && newlen)
                ret = tcp_set_default_congestion_control(val);
        return ret;
 }
index 2e6ad6dbba6c54d904d1df28d6e38dfcd7640b00..8e65182f7af1cd04f71bb4d1f5b33bf8d2c2793c 100644 (file)
@@ -2453,14 +2453,14 @@ void __init tcp_init(void)
                                        0,
                                        &tcp_hashinfo.ehash_size,
                                        NULL,
-                                       0);
+                                       thash_entries ? 0 : 512 * 1024);
        tcp_hashinfo.ehash_size = 1 << tcp_hashinfo.ehash_size;
        for (i = 0; i < tcp_hashinfo.ehash_size; i++) {
-               rwlock_init(&tcp_hashinfo.ehash[i].lock);
                INIT_HLIST_HEAD(&tcp_hashinfo.ehash[i].chain);
                INIT_HLIST_HEAD(&tcp_hashinfo.ehash[i].twchain);
        }
-
+       if (inet_ehash_locks_alloc(&tcp_hashinfo))
+               panic("TCP: failed to alloc ehash_locks");
        tcp_hashinfo.bhash =
                alloc_large_system_hash("TCP bind",
                                        sizeof(struct inet_bind_hashbucket),
index 69d8c38ccd3900aa7c9bedac6506f0b6cf34aaea..0f0c1c9829a14b41e9654b3a108d2f1aa3b5e6f1 100644 (file)
@@ -1269,6 +1269,9 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
        if (before(TCP_SKB_CB(ack_skb)->ack_seq, prior_snd_una - tp->max_window))
                return 0;
 
+       if (!tp->packets_out)
+               goto out;
+
        /* SACK fastpath:
         * if the only SACK change is the increase of the end_seq of
         * the first block then only apply that SACK block
@@ -1330,12 +1333,15 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
                cached_fack_count = 0;
        }
 
-       for (i=0; i<num_sacks; i++, sp++) {
+       for (i = 0; i < num_sacks; i++) {
                struct sk_buff *skb;
                __u32 start_seq = ntohl(sp->start_seq);
                __u32 end_seq = ntohl(sp->end_seq);
                int fack_count;
                int dup_sack = (found_dup_sack && (i == first_sack_index));
+               int next_dup = (found_dup_sack && (i+1 == first_sack_index));
+
+               sp++;
 
                if (!tcp_is_sackblock_valid(tp, dup_sack, start_seq, end_seq)) {
                        if (dup_sack) {
@@ -1361,7 +1367,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
                        flag |= FLAG_DATA_LOST;
 
                tcp_for_write_queue_from(skb, sk) {
-                       int in_sack;
+                       int in_sack = 0;
                        u8 sacked;
 
                        if (skb == tcp_send_head(sk))
@@ -1380,11 +1386,25 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
                        if (!before(TCP_SKB_CB(skb)->seq, end_seq))
                                break;
 
-                       in_sack = tcp_match_skb_to_sack(sk, skb, start_seq, end_seq);
-                       if (in_sack < 0)
-                               break;
+                       dup_sack = (found_dup_sack && (i == first_sack_index));
+
+                       /* Due to sorting DSACK may reside within this SACK block! */
+                       if (next_dup) {
+                               u32 dup_start = ntohl(sp->start_seq);
+                               u32 dup_end = ntohl(sp->end_seq);
 
-                       fack_count += tcp_skb_pcount(skb);
+                               if (before(TCP_SKB_CB(skb)->seq, dup_end)) {
+                                       in_sack = tcp_match_skb_to_sack(sk, skb, dup_start, dup_end);
+                                       if (in_sack > 0)
+                                               dup_sack = 1;
+                               }
+                       }
+
+                       /* DSACK info lost if out-of-mem, try SACK still */
+                       if (in_sack <= 0)
+                               in_sack = tcp_match_skb_to_sack(sk, skb, start_seq, end_seq);
+                       if (unlikely(in_sack < 0))
+                               break;
 
                        sacked = TCP_SKB_CB(skb)->sacked;
 
@@ -1400,19 +1420,17 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
                                        if ((dup_sack && in_sack) &&
                                            (sacked&TCPCB_SACKED_ACKED))
                                                reord = min(fack_count, reord);
-                               } else {
-                                       /* If it was in a hole, we detected reordering. */
-                                       if (fack_count < prior_fackets &&
-                                           !(sacked&TCPCB_SACKED_ACKED))
-                                               reord = min(fack_count, reord);
                                }
 
                                /* Nothing to do; acked frame is about to be dropped. */
+                               fack_count += tcp_skb_pcount(skb);
                                continue;
                        }
 
-                       if (!in_sack)
+                       if (!in_sack) {
+                               fack_count += tcp_skb_pcount(skb);
                                continue;
+                       }
 
                        if (!(sacked&TCPCB_SACKED_ACKED)) {
                                if (sacked & TCPCB_SACKED_RETRANS) {
@@ -1429,12 +1447,17 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
                                                tp->retransmit_skb_hint = NULL;
                                        }
                                } else {
-                                       /* New sack for not retransmitted frame,
-                                        * which was in hole. It is reordering.
-                                        */
-                                       if (!(sacked & TCPCB_RETRANS) &&
-                                           fack_count < prior_fackets)
-                                               reord = min(fack_count, reord);
+                                       if (!(sacked & TCPCB_RETRANS)) {
+                                               /* New sack for not retransmitted frame,
+                                                * which was in hole. It is reordering.
+                                                */
+                                               if (fack_count < prior_fackets)
+                                                       reord = min(fack_count, reord);
+
+                                               /* SACK enhanced F-RTO (RFC4138; Appendix B) */
+                                               if (!after(TCP_SKB_CB(skb)->end_seq, tp->frto_highmark))
+                                                       flag |= FLAG_ONLY_ORIG_SACKED;
+                                       }
 
                                        if (sacked & TCPCB_LOST) {
                                                TCP_SKB_CB(skb)->sacked &= ~TCPCB_LOST;
@@ -1443,24 +1466,13 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
                                                /* clear lost hint */
                                                tp->retransmit_skb_hint = NULL;
                                        }
-                                       /* SACK enhanced F-RTO detection.
-                                        * Set flag if and only if non-rexmitted
-                                        * segments below frto_highmark are
-                                        * SACKed (RFC4138; Appendix B).
-                                        * Clearing correct due to in-order walk
-                                        */
-                                       if (after(end_seq, tp->frto_highmark)) {
-                                               flag &= ~FLAG_ONLY_ORIG_SACKED;
-                                       } else {
-                                               if (!(sacked & TCPCB_RETRANS))
-                                                       flag |= FLAG_ONLY_ORIG_SACKED;
-                                       }
                                }
 
                                TCP_SKB_CB(skb)->sacked |= TCPCB_SACKED_ACKED;
                                flag |= FLAG_DATA_SACKED;
                                tp->sacked_out += tcp_skb_pcount(skb);
 
+                               fack_count += tcp_skb_pcount(skb);
                                if (fack_count > tp->fackets_out)
                                        tp->fackets_out = fack_count;
 
@@ -1471,6 +1483,8 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
                        } else {
                                if (dup_sack && (sacked&TCPCB_RETRANS))
                                        reord = min(fack_count, reord);
+
+                               fack_count += tcp_skb_pcount(skb);
                        }
 
                        /* D-SACK. We can detect redundant retransmission
@@ -1485,6 +1499,12 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
                                tp->retransmit_skb_hint = NULL;
                        }
                }
+
+               /* SACK enhanced FRTO (RFC4138, Appendix B): Clearing correct
+                * due to in-order walk
+                */
+               if (after(end_seq, tp->frto_highmark))
+                       flag &= ~FLAG_ONLY_ORIG_SACKED;
        }
 
        if (tp->retrans_out &&
@@ -1496,7 +1516,9 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
 
        if ((reord < tp->fackets_out) && icsk->icsk_ca_state != TCP_CA_Loss &&
            (!tp->frto_highmark || after(tp->snd_una, tp->frto_highmark)))
-               tcp_update_reordering(sk, ((tp->fackets_out + 1) - reord), 0);
+               tcp_update_reordering(sk, tp->fackets_out - reord, 0);
+
+out:
 
 #if FASTRETRANS_DEBUG > 0
        BUG_TRAP((int)tp->sacked_out >= 0);
@@ -1652,6 +1674,9 @@ void tcp_enter_frto(struct sock *sk)
        }
        tcp_verify_left_out(tp);
 
+       /* Too bad if TCP was application limited */
+       tp->snd_cwnd = min(tp->snd_cwnd, tcp_packets_in_flight(tp) + 1);
+
        /* Earlier loss recovery underway (see RFC4138; Appendix B).
         * The last condition is necessary at least in tp->frto_counter case.
         */
@@ -1684,6 +1709,8 @@ static void tcp_enter_frto_loss(struct sock *sk, int allowed_segments, int flag)
        tcp_for_write_queue(skb, sk) {
                if (skb == tcp_send_head(sk))
                        break;
+
+               TCP_SKB_CB(skb)->sacked &= ~TCPCB_LOST;
                /*
                 * Count the retransmission made on RTO correctly (only when
                 * waiting for the first ACK and did not get it)...
@@ -1697,7 +1724,7 @@ static void tcp_enter_frto_loss(struct sock *sk, int allowed_segments, int flag)
                } else {
                        if (TCP_SKB_CB(skb)->sacked & TCPCB_RETRANS)
                                tp->undo_marker = 0;
-                       TCP_SKB_CB(skb)->sacked &= ~(TCPCB_LOST|TCPCB_SACKED_RETRANS);
+                       TCP_SKB_CB(skb)->sacked &= ~TCPCB_SACKED_RETRANS;
                }
 
                /* Don't lost mark skbs that were fwd transmitted after RTO */
@@ -2059,7 +2086,7 @@ static void tcp_update_scoreboard(struct sock *sk)
                        if (!tcp_skb_timedout(sk, skb))
                                break;
 
-                       if (!(TCP_SKB_CB(skb)->sacked&TCPCB_TAGBITS)) {
+                       if (!(TCP_SKB_CB(skb)->sacked & (TCPCB_SACKED_ACKED|TCPCB_LOST))) {
                                TCP_SKB_CB(skb)->sacked |= TCPCB_LOST;
                                tp->lost_out += tcp_skb_pcount(skb);
                                tcp_verify_retransmit_hint(tp, skb);
@@ -2611,7 +2638,8 @@ static u32 tcp_tso_acked(struct sock *sk, struct sk_buff *skb)
  * is before the ack sequence we can discard it as it's confirmed to have
  * arrived at the other end.
  */
-static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p)
+static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p,
+                              int prior_fackets)
 {
        struct tcp_sock *tp = tcp_sk(sk);
        const struct inet_connection_sock *icsk = inet_csk(sk);
@@ -2620,6 +2648,8 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p)
        int fully_acked = 1;
        int flag = 0;
        int prior_packets = tp->packets_out;
+       u32 cnt = 0;
+       u32 reord = tp->packets_out;
        s32 seq_rtt = -1;
        ktime_t last_ackt = net_invalid_timestamp();
 
@@ -2660,10 +2690,14 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p)
                                if ((flag & FLAG_DATA_ACKED) ||
                                    (packets_acked > 1))
                                        flag |= FLAG_NONHEAD_RETRANS_ACKED;
-                       } else if (seq_rtt < 0) {
-                               seq_rtt = now - scb->when;
-                               if (fully_acked)
-                                       last_ackt = skb->tstamp;
+                       } else {
+                               if (seq_rtt < 0) {
+                                       seq_rtt = now - scb->when;
+                                       if (fully_acked)
+                                               last_ackt = skb->tstamp;
+                               }
+                               if (!(sacked & TCPCB_SACKED_ACKED))
+                                       reord = min(cnt, reord);
                        }
 
                        if (sacked & TCPCB_SACKED_ACKED)
@@ -2674,12 +2708,16 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p)
                        if ((sacked & TCPCB_URG) && tp->urg_mode &&
                            !before(end_seq, tp->snd_up))
                                tp->urg_mode = 0;
-               } else if (seq_rtt < 0) {
-                       seq_rtt = now - scb->when;
-                       if (fully_acked)
-                               last_ackt = skb->tstamp;
+               } else {
+                       if (seq_rtt < 0) {
+                               seq_rtt = now - scb->when;
+                               if (fully_acked)
+                                       last_ackt = skb->tstamp;
+                       }
+                       reord = min(cnt, reord);
                }
                tp->packets_out -= packets_acked;
+               cnt += packets_acked;
 
                /* Initial outgoing SYN's get put onto the write_queue
                 * just like anything else we transmit.  It is not
@@ -2711,13 +2749,18 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p)
                tcp_ack_update_rtt(sk, flag, seq_rtt);
                tcp_rearm_rto(sk);
 
+               if (tcp_is_reno(tp)) {
+                       tcp_remove_reno_sacks(sk, pkts_acked);
+               } else {
+                       /* Non-retransmitted hole got filled? That's reordering */
+                       if (reord < prior_fackets)
+                               tcp_update_reordering(sk, tp->fackets_out - reord, 0);
+               }
+
                tp->fackets_out -= min(pkts_acked, tp->fackets_out);
                /* hint's skb might be NULL but we don't need to care */
                tp->fastpath_cnt_hint -= min_t(u32, pkts_acked,
                                               tp->fastpath_cnt_hint);
-               if (tcp_is_reno(tp))
-                       tcp_remove_reno_sacks(sk, pkts_acked);
-
                if (ca_ops->pkts_acked) {
                        s32 rtt_us = -1;
 
@@ -3000,6 +3043,7 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag)
        u32 ack_seq = TCP_SKB_CB(skb)->seq;
        u32 ack = TCP_SKB_CB(skb)->ack_seq;
        u32 prior_in_flight;
+       u32 prior_fackets;
        s32 seq_rtt;
        int prior_packets;
        int frto_cwnd = 0;
@@ -3024,6 +3068,8 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag)
                        tp->bytes_acked += min(ack - prior_snd_una, tp->mss_cache);
        }
 
+       prior_fackets = tp->fackets_out;
+
        if (!(flag&FLAG_SLOWPATH) && after(ack, prior_snd_una)) {
                /* Window is constant, pure forward advance.
                 * No more checks are required.
@@ -3065,13 +3111,13 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag)
        prior_in_flight = tcp_packets_in_flight(tp);
 
        /* See if we can take anything off of the retransmit queue. */
-       flag |= tcp_clean_rtx_queue(sk, &seq_rtt);
+       flag |= tcp_clean_rtx_queue(sk, &seq_rtt, prior_fackets);
 
+       if (tp->frto_counter)
+               frto_cwnd = tcp_process_frto(sk, flag);
        /* Guarantee sacktag reordering detection against wrap-arounds */
        if (before(tp->frto_highmark, tp->snd_una))
                tp->frto_highmark = 0;
-       if (tp->frto_counter)
-               frto_cwnd = tcp_process_frto(sk, flag);
 
        if (tcp_ack_is_dubious(sk, flag)) {
                /* Advance CWND, if state allows this. */
index ad759f1c377734bf252a25422e136c275f132312..652c32368cccb6cb590c2c4eec96b77026288d0b 100644 (file)
@@ -858,16 +858,16 @@ int tcp_v4_md5_do_add(struct sock *sk, __be32 addr,
                      u8 *newkey, u8 newkeylen)
 {
        /* Add Key to the list */
-       struct tcp4_md5sig_key *key;
+       struct tcp_md5sig_key *key;
        struct tcp_sock *tp = tcp_sk(sk);
        struct tcp4_md5sig_key *keys;
 
-       key = (struct tcp4_md5sig_key *)tcp_v4_md5_do_lookup(sk, addr);
+       key = tcp_v4_md5_do_lookup(sk, addr);
        if (key) {
                /* Pre-existing entry - just update that one. */
-               kfree(key->base.key);
-               key->base.key = newkey;
-               key->base.keylen = newkeylen;
+               kfree(key->key);
+               key->key = newkey;
+               key->keylen = newkeylen;
        } else {
                struct tcp_md5sig_info *md5sig;
 
@@ -900,8 +900,7 @@ int tcp_v4_md5_do_add(struct sock *sk, __be32 addr,
                                       sizeof(*keys) * md5sig->entries4);
 
                        /* Free old key list, and reference new one */
-                       if (md5sig->keys4)
-                               kfree(md5sig->keys4);
+                       kfree(md5sig->keys4);
                        md5sig->keys4 = keys;
                        md5sig->alloced4++;
                }
@@ -939,10 +938,10 @@ int tcp_v4_md5_do_del(struct sock *sk, __be32 addr)
                                tp->md5sig_info->alloced4 = 0;
                        } else if (tp->md5sig_info->entries4 != i) {
                                /* Need to do some manipulation */
-                               memcpy(&tp->md5sig_info->keys4[i],
-                                      &tp->md5sig_info->keys4[i+1],
-                                      (tp->md5sig_info->entries4 - i) *
-                                       sizeof(struct tcp4_md5sig_key));
+                               memmove(&tp->md5sig_info->keys4[i],
+                                       &tp->md5sig_info->keys4[i+1],
+                                       (tp->md5sig_info->entries4 - i) *
+                                        sizeof(struct tcp4_md5sig_key));
                        }
                        tcp_free_md5sig_pool();
                        return 0;
@@ -1083,7 +1082,7 @@ static int tcp_v4_do_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key,
        sg_set_buf(&sg[block++], key->key, key->keylen);
        nbytes += key->keylen;
 
-       sg_mark_end(sg, block);
+       sg_mark_end(&sg[block - 1]);
 
        /* Now store the Hash into the packet */
        err = crypto_hash_init(desc);
@@ -2049,8 +2048,9 @@ static void *established_get_first(struct seq_file *seq)
                struct sock *sk;
                struct hlist_node *node;
                struct inet_timewait_sock *tw;
+               rwlock_t *lock = inet_ehash_lockp(&tcp_hashinfo, st->bucket);
 
-               read_lock_bh(&tcp_hashinfo.ehash[st->bucket].lock);
+               read_lock_bh(lock);
                sk_for_each(sk, node, &tcp_hashinfo.ehash[st->bucket].chain) {
                        if (sk->sk_family != st->family) {
                                continue;
@@ -2067,7 +2067,7 @@ static void *established_get_first(struct seq_file *seq)
                        rc = tw;
                        goto out;
                }
-               read_unlock_bh(&tcp_hashinfo.ehash[st->bucket].lock);
+               read_unlock_bh(lock);
                st->state = TCP_SEQ_STATE_ESTABLISHED;
        }
 out:
@@ -2094,11 +2094,11 @@ get_tw:
                        cur = tw;
                        goto out;
                }
-               read_unlock_bh(&tcp_hashinfo.ehash[st->bucket].lock);
+               read_unlock_bh(inet_ehash_lockp(&tcp_hashinfo, st->bucket));
                st->state = TCP_SEQ_STATE_ESTABLISHED;
 
                if (++st->bucket < tcp_hashinfo.ehash_size) {
-                       read_lock_bh(&tcp_hashinfo.ehash[st->bucket].lock);
+                       read_lock_bh(inet_ehash_lockp(&tcp_hashinfo, st->bucket));
                        sk = sk_head(&tcp_hashinfo.ehash[st->bucket].chain);
                } else {
                        cur = NULL;
@@ -2206,7 +2206,7 @@ static void tcp_seq_stop(struct seq_file *seq, void *v)
        case TCP_SEQ_STATE_TIME_WAIT:
        case TCP_SEQ_STATE_ESTABLISHED:
                if (v)
-                       read_unlock_bh(&tcp_hashinfo.ehash[st->bucket].lock);
+                       read_unlock_bh(inet_ehash_lockp(&tcp_hashinfo, st->bucket));
                break;
        }
 }
@@ -2417,6 +2417,8 @@ void tcp4_proc_exit(void)
 }
 #endif /* CONFIG_PROC_FS */
 
+DEFINE_PROTO_INUSE(tcp)
+
 struct proto tcp_prot = {
        .name                   = "TCP",
        .owner                  = THIS_MODULE,
@@ -2451,6 +2453,7 @@ struct proto tcp_prot = {
        .compat_setsockopt      = compat_tcp_setsockopt,
        .compat_getsockopt      = compat_tcp_getsockopt,
 #endif
+       REF_PROTO_INUSE(tcp)
 };
 
 void __init tcp_v4_init(struct net_proto_family *ops)
index 324b4207254ae411728dd8a3cc1740f5ac0ce267..e5130a7fe181865f70476f402007d941b37af707 100644 (file)
@@ -1295,6 +1295,7 @@ static int tcp_mtu_probe(struct sock *sk)
        struct sk_buff *skb, *nskb, *next;
        int len;
        int probe_size;
+       int size_needed;
        unsigned int pif;
        int copy;
        int mss_now;
@@ -1313,27 +1314,20 @@ static int tcp_mtu_probe(struct sock *sk)
        /* Very simple search strategy: just double the MSS. */
        mss_now = tcp_current_mss(sk, 0);
        probe_size = 2*tp->mss_cache;
+       size_needed = probe_size + (tp->reordering + 1) * tp->mss_cache;
        if (probe_size > tcp_mtu_to_mss(sk, icsk->icsk_mtup.search_high)) {
                /* TODO: set timer for probe_converge_event */
                return -1;
        }
 
        /* Have enough data in the send queue to probe? */
-       len = 0;
-       if ((skb = tcp_send_head(sk)) == NULL)
-               return -1;
-       while ((len += skb->len) < probe_size && !tcp_skb_is_last(sk, skb))
-               skb = tcp_write_queue_next(sk, skb);
-       if (len < probe_size)
+       if (tp->write_seq - tp->snd_nxt < size_needed)
                return -1;
 
-       /* Receive window check. */
-       if (after(TCP_SKB_CB(skb)->seq + probe_size, tp->snd_una + tp->snd_wnd)) {
-               if (tp->snd_wnd < probe_size)
-                       return -1;
-               else
-                       return 0;
-       }
+       if (tp->snd_wnd < size_needed)
+               return -1;
+       if (after(tp->snd_nxt + size_needed, tp->snd_una + tp->snd_wnd))
+               return 0;
 
        /* Do we need to wait to drain cwnd? */
        pif = tcp_packets_in_flight(tp);
@@ -1352,7 +1346,6 @@ static int tcp_mtu_probe(struct sock *sk)
 
        skb = tcp_send_head(sk);
        tcp_insert_write_queue_before(nskb, skb, sk);
-       tcp_advance_send_head(sk, skb);
 
        TCP_SKB_CB(nskb)->seq = TCP_SKB_CB(skb)->seq;
        TCP_SKB_CB(nskb)->end_seq = TCP_SKB_CB(skb)->seq + probe_size;
index b49dedcda52df949c159db5b12635c9414a1538a..007304e99842f700da8d4ff7ffab7ac37fddd28c 100644 (file)
@@ -266,26 +266,25 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack,
                         */
                        diff = (old_wnd << V_PARAM_SHIFT) - target_cwnd;
 
-                       if (tp->snd_cwnd <= tp->snd_ssthresh) {
-                               /* Slow start.  */
-                               if (diff > gamma) {
-                                       /* Going too fast. Time to slow down
-                                        * and switch to congestion avoidance.
-                                        */
-                                       tp->snd_ssthresh = 2;
-
-                                       /* Set cwnd to match the actual rate
-                                        * exactly:
-                                        *   cwnd = (actual rate) * baseRTT
-                                        * Then we add 1 because the integer
-                                        * truncation robs us of full link
-                                        * utilization.
-                                        */
-                                       tp->snd_cwnd = min(tp->snd_cwnd,
-                                                          (target_cwnd >>
-                                                           V_PARAM_SHIFT)+1);
+                       if (diff > gamma && tp->snd_ssthresh > 2 ) {
+                               /* Going too fast. Time to slow down
+                                * and switch to congestion avoidance.
+                                */
+                               tp->snd_ssthresh = 2;
+
+                               /* Set cwnd to match the actual rate
+                                * exactly:
+                                *   cwnd = (actual rate) * baseRTT
+                                * Then we add 1 because the integer
+                                * truncation robs us of full link
+                                * utilization.
+                                */
+                               tp->snd_cwnd = min(tp->snd_cwnd,
+                                                  (target_cwnd >>
+                                                   V_PARAM_SHIFT)+1);
 
-                               }
+                       } else if (tp->snd_cwnd <= tp->snd_ssthresh) {
+                               /* Slow start.  */
                                tcp_slow_start(tp);
                        } else {
                                /* Congestion avoidance. */
index a794a8ca8b4fd86e1b501448eab60a2a5a99e1bb..978b3fd61e65533f3cf01f26521fc6f406288fac 100644 (file)
@@ -17,6 +17,11 @@ static struct xfrm_tunnel *tunnel4_handlers;
 static struct xfrm_tunnel *tunnel64_handlers;
 static DEFINE_MUTEX(tunnel4_mutex);
 
+static inline struct xfrm_tunnel **fam_handlers(unsigned short family)
+{
+       return (family == AF_INET) ? &tunnel4_handlers : &tunnel64_handlers;
+}
+
 int xfrm4_tunnel_register(struct xfrm_tunnel *handler, unsigned short family)
 {
        struct xfrm_tunnel **pprev;
@@ -25,8 +30,7 @@ int xfrm4_tunnel_register(struct xfrm_tunnel *handler, unsigned short family)
 
        mutex_lock(&tunnel4_mutex);
 
-       for (pprev = (family == AF_INET) ? &tunnel4_handlers : &tunnel64_handlers;
-            *pprev; pprev = &(*pprev)->next) {
+       for (pprev = fam_handlers(family); *pprev; pprev = &(*pprev)->next) {
                if ((*pprev)->priority > priority)
                        break;
                if ((*pprev)->priority == priority)
@@ -53,8 +57,7 @@ int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler, unsigned short family)
 
        mutex_lock(&tunnel4_mutex);
 
-       for (pprev = (family == AF_INET) ? &tunnel4_handlers : &tunnel64_handlers;
-            *pprev; pprev = &(*pprev)->next) {
+       for (pprev = fam_handlers(family); *pprev; pprev = &(*pprev)->next) {
                if (*pprev == handler) {
                        *pprev = handler->next;
                        ret = 0;
@@ -118,6 +121,17 @@ static void tunnel4_err(struct sk_buff *skb, u32 info)
                        break;
 }
 
+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
+static void tunnel64_err(struct sk_buff *skb, u32 info)
+{
+       struct xfrm_tunnel *handler;
+
+       for (handler = tunnel64_handlers; handler; handler = handler->next)
+               if (!handler->err_handler(skb, info))
+                       break;
+}
+#endif
+
 static struct net_protocol tunnel4_protocol = {
        .handler        =       tunnel4_rcv,
        .err_handler    =       tunnel4_err,
@@ -127,7 +141,7 @@ static struct net_protocol tunnel4_protocol = {
 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
 static struct net_protocol tunnel64_protocol = {
        .handler        =       tunnel64_rcv,
-       .err_handler    =       tunnel4_err,
+       .err_handler    =       tunnel64_err,
        .no_policy      =       1,
 };
 #endif
index 4bc25b46f33ff9138512e5da915d01007048e9d0..03c400ca14c5af07db1ab22686d95621b5cc8813 100644 (file)
@@ -1430,6 +1430,8 @@ unsigned int udp_poll(struct file *file, struct socket *sock, poll_table *wait)
 
 }
 
+DEFINE_PROTO_INUSE(udp)
+
 struct proto udp_prot = {
        .name              = "UDP",
        .owner             = THIS_MODULE,
@@ -1452,6 +1454,7 @@ struct proto udp_prot = {
        .compat_setsockopt = compat_udp_setsockopt,
        .compat_getsockopt = compat_udp_getsockopt,
 #endif
+       REF_PROTO_INUSE(udp)
 };
 
 /* ------------------------------------------------------------------------ */
index 94977205abb47581686bfd46bc1f5232100f005a..f5baeb3e8b85d368e075cd57ca7cd8c48b68702b 100644 (file)
@@ -44,6 +44,8 @@ static        struct net_protocol udplite_protocol = {
        .no_policy      = 1,
 };
 
+DEFINE_PROTO_INUSE(udplite)
+
 struct proto   udplite_prot = {
        .name              = "UDP-Lite",
        .owner             = THIS_MODULE,
@@ -67,6 +69,7 @@ struct proto  udplite_prot = {
        .compat_setsockopt = compat_udp_setsockopt,
        .compat_getsockopt = compat_udp_getsockopt,
 #endif
+       REF_PROTO_INUSE(udplite)
 };
 
 static struct inet_protosw udplite4_protosw = {
index 348bd8d061125f61932c74d683e6a3f8d69c28e6..567664eac463633643ddd63735b304d3e5efa3f6 100644 (file)
@@ -967,7 +967,7 @@ int ipv6_dev_get_saddr(struct net_device *daddr_dev,
                        if (unlikely(score.addr_type == IPV6_ADDR_ANY ||
                                     score.addr_type & IPV6_ADDR_MULTICAST)) {
                                LIMIT_NETDEBUG(KERN_DEBUG
-                                              "ADDRCONF: unspecified / multicast address"
+                                              "ADDRCONF: unspecified / multicast address "
                                               "assigned as unicast address on %s",
                                               dev->name);
                                continue;
@@ -4288,8 +4288,4 @@ void __exit addrconf_cleanup(void)
        del_timer(&addr_chk_timer);
 
        rtnl_unlock();
-
-#ifdef CONFIG_PROC_FS
-       proc_net_remove(&init_net, "if_inet6");
-#endif
 }
index 1b1caf3aa1c189d7ce57bf38d4276afa5d4c35c9..ecbd38894fdd1b2f971c1aeb25e36d1b74e961de 100644 (file)
@@ -162,7 +162,7 @@ lookup_protocol:
        BUG_TRAP(answer_prot->slab != NULL);
 
        err = -ENOBUFS;
-       sk = sk_alloc(net, PF_INET6, GFP_KERNEL, answer_prot, 1);
+       sk = sk_alloc(net, PF_INET6, GFP_KERNEL, answer_prot);
        if (sk == NULL)
                goto out;
 
index 66a9139d46e97fe30a843c08c356e69d990abfac..4eaf55072b1b05ff7c52537acb01eead7bd761f4 100644 (file)
@@ -35,7 +35,6 @@
 #include <net/ipv6.h>
 #include <net/protocol.h>
 #include <net/xfrm.h>
-#include <asm/scatterlist.h>
 
 static int zero_out_mutable_opts(struct ipv6_opt_hdr *opthdr)
 {
index ab17b5e62355f144770d005ede345912f04c186c..7db66f10e00d18f80d705fd83459ac5aec43f327 100644 (file)
@@ -110,9 +110,10 @@ static int esp6_output(struct xfrm_state *x, struct sk_buff *skb)
                                goto unlock;
                }
                sg_init_table(sg, nfrags);
-               sg_mark_end(sg, skb_to_sgvec(skb, sg, esph->enc_data +
-                                                     esp->conf.ivlen -
-                                                     skb->data, clen));
+               skb_to_sgvec(skb, sg,
+                            esph->enc_data +
+                            esp->conf.ivlen -
+                            skb->data, clen);
                err = crypto_blkcipher_encrypt(&desc, sg, sg, clen);
                if (unlikely(sg != &esp->sgbuf[0]))
                        kfree(sg);
@@ -209,9 +210,9 @@ static int esp6_input(struct xfrm_state *x, struct sk_buff *skb)
                        }
                }
                sg_init_table(sg, nfrags);
-               sg_mark_end(sg, skb_to_sgvec(skb, sg,
-                                            sizeof(*esph) + esp->conf.ivlen,
-                                            elen));
+               skb_to_sgvec(skb, sg,
+                            sizeof(*esph) + esp->conf.ivlen,
+                            elen);
                ret = crypto_blkcipher_decrypt(&desc, sg, sg, elen);
                if (unlikely(sg != &esp->sgbuf[0]))
                        kfree(sg);
index 706622af206f1f7f5a04479223a1c4aa84334238..428c6b0e26d8e7238530e6b3d1c886f5c398af98 100644 (file)
@@ -31,25 +31,6 @@ struct fib6_rule
 
 static struct fib_rules_ops fib6_rules_ops;
 
-static struct fib6_rule main_rule = {
-       .common = {
-               .refcnt =       ATOMIC_INIT(2),
-               .pref =         0x7FFE,
-               .action =       FR_ACT_TO_TBL,
-               .table =        RT6_TABLE_MAIN,
-       },
-};
-
-static struct fib6_rule local_rule = {
-       .common = {
-               .refcnt =       ATOMIC_INIT(2),
-               .pref =         0,
-               .action =       FR_ACT_TO_TBL,
-               .table =        RT6_TABLE_LOCAL,
-               .flags =        FIB_RULE_PERMANENT,
-       },
-};
-
 struct dst_entry *fib6_rule_lookup(struct flowi *fl, int flags,
                                   pol_lookup_t lookup)
 {
@@ -270,11 +251,23 @@ static struct fib_rules_ops fib6_rules_ops = {
        .owner                  = THIS_MODULE,
 };
 
-void __init fib6_rules_init(void)
+static int __init fib6_default_rules_init(void)
 {
-       list_add_tail(&local_rule.common.list, &fib6_rules_ops.rules_list);
-       list_add_tail(&main_rule.common.list, &fib6_rules_ops.rules_list);
+       int err;
+
+       err = fib_default_rule_add(&fib6_rules_ops, 0,
+                                  RT6_TABLE_LOCAL, FIB_RULE_PERMANENT);
+       if (err < 0)
+               return err;
+       err = fib_default_rule_add(&fib6_rules_ops, 0x7FFE, RT6_TABLE_MAIN, 0);
+       if (err < 0)
+               return err;
+       return 0;
+}
 
+void __init fib6_rules_init(void)
+{
+       BUG_ON(fib6_default_rules_init());
        fib_rules_register(&fib6_rules_ops);
 }
 
index d6f1026f19438114bfef264b1f669cf03f0fd131..adc73adadfae47a892da6527309396e57a530590 100644 (file)
@@ -37,9 +37,8 @@ void __inet6_hash(struct inet_hashinfo *hashinfo,
        } else {
                unsigned int hash;
                sk->sk_hash = hash = inet6_sk_ehashfn(sk);
-               hash &= (hashinfo->ehash_size - 1);
-               list = &hashinfo->ehash[hash].chain;
-               lock = &hashinfo->ehash[hash].lock;
+               list = &inet_ehash_bucket(hashinfo, hash)->chain;
+               lock = inet_ehash_lockp(hashinfo, hash);
                write_lock(lock);
        }
 
@@ -70,9 +69,10 @@ struct sock *__inet6_lookup_established(struct inet_hashinfo *hashinfo,
         */
        unsigned int hash = inet6_ehashfn(daddr, hnum, saddr, sport);
        struct inet_ehash_bucket *head = inet_ehash_bucket(hashinfo, hash);
+       rwlock_t *lock = inet_ehash_lockp(hashinfo, hash);
 
        prefetch(head->chain.first);
-       read_lock(&head->lock);
+       read_lock(lock);
        sk_for_each(sk, node, &head->chain) {
                /* For IPV6 do the cheaper port and family tests first. */
                if (INET6_MATCH(sk, hash, saddr, daddr, ports, dif))
@@ -92,12 +92,12 @@ struct sock *__inet6_lookup_established(struct inet_hashinfo *hashinfo,
                                goto hit;
                }
        }
-       read_unlock(&head->lock);
+       read_unlock(lock);
        return NULL;
 
 hit:
        sock_hold(sk);
-       read_unlock(&head->lock);
+       read_unlock(lock);
        return sk;
 }
 EXPORT_SYMBOL(__inet6_lookup_established);
@@ -175,12 +175,13 @@ static int __inet6_check_established(struct inet_timewait_death_row *death_row,
        const unsigned int hash = inet6_ehashfn(daddr, lport, saddr,
                                                inet->dport);
        struct inet_ehash_bucket *head = inet_ehash_bucket(hinfo, hash);
+       rwlock_t *lock = inet_ehash_lockp(hinfo, hash);
        struct sock *sk2;
        const struct hlist_node *node;
        struct inet_timewait_sock *tw;
 
        prefetch(head->chain.first);
-       write_lock(&head->lock);
+       write_lock(lock);
 
        /* Check TIME-WAIT sockets first. */
        sk_for_each(sk2, node, &head->twchain) {
@@ -216,7 +217,7 @@ unique:
        __sk_add_node(sk, &head->chain);
        sk->sk_hash = hash;
        sock_prot_inc_use(sk->sk_prot);
-       write_unlock(&head->lock);
+       write_unlock(lock);
 
        if (twp != NULL) {
                *twp = tw;
@@ -231,7 +232,7 @@ unique:
        return 0;
 
 not_unique:
-       write_unlock(&head->lock);
+       write_unlock(lock);
        return -EADDRNOTAVAIL;
 }
 
index 653fc0a8235b636e6e03921b77163a8ee8817b5c..86e1835ce4e4bcd71a25a9443f656872ab10c0a8 100644 (file)
@@ -1339,6 +1339,19 @@ error:
        return err;
 }
 
+static void ip6_cork_release(struct inet_sock *inet, struct ipv6_pinfo *np)
+{
+       inet->cork.flags &= ~IPCORK_OPT;
+       kfree(np->cork.opt);
+       np->cork.opt = NULL;
+       if (np->cork.rt) {
+               dst_release(&np->cork.rt->u.dst);
+               np->cork.rt = NULL;
+               inet->cork.flags &= ~IPCORK_ALLFRAG;
+       }
+       memset(&inet->cork.fl, 0, sizeof(inet->cork.fl));
+}
+
 int ip6_push_pending_frames(struct sock *sk)
 {
        struct sk_buff *skb, *tmp_skb;
@@ -1415,15 +1428,7 @@ int ip6_push_pending_frames(struct sock *sk)
        }
 
 out:
-       inet->cork.flags &= ~IPCORK_OPT;
-       kfree(np->cork.opt);
-       np->cork.opt = NULL;
-       if (np->cork.rt) {
-               dst_release(&np->cork.rt->u.dst);
-               np->cork.rt = NULL;
-               inet->cork.flags &= ~IPCORK_ALLFRAG;
-       }
-       memset(&inet->cork.fl, 0, sizeof(inet->cork.fl));
+       ip6_cork_release(inet, np);
        return err;
 error:
        goto out;
@@ -1431,8 +1436,6 @@ error:
 
 void ip6_flush_pending_frames(struct sock *sk)
 {
-       struct inet_sock *inet = inet_sk(sk);
-       struct ipv6_pinfo *np = inet6_sk(sk);
        struct sk_buff *skb;
 
        while ((skb = __skb_dequeue_tail(&sk->sk_write_queue)) != NULL) {
@@ -1442,14 +1445,5 @@ void ip6_flush_pending_frames(struct sock *sk)
                kfree_skb(skb);
        }
 
-       inet->cork.flags &= ~IPCORK_OPT;
-
-       kfree(np->cork.opt);
-       np->cork.opt = NULL;
-       if (np->cork.rt) {
-               dst_release(&np->cork.rt->u.dst);
-               np->cork.rt = NULL;
-               inet->cork.flags &= ~IPCORK_ALLFRAG;
-       }
-       memset(&inet->cork.fl, 0, sizeof(inet->cork.fl));
+       ip6_cork_release(inet_sk(sk), inet6_sk(sk));
 }
index 80ef2a1d39fd56704fef43e47a8c80456ce0a587..0cd4056f9127e3434cbb63ed27ebcaddb404f54c 100644 (file)
@@ -34,9 +34,9 @@
 #include <net/ip.h>
 #include <net/xfrm.h>
 #include <net/ipcomp.h>
-#include <asm/scatterlist.h>
 #include <asm/semaphore.h>
 #include <linux/crypto.h>
+#include <linux/err.h>
 #include <linux/pfkeyv2.h>
 #include <linux/random.h>
 #include <linux/percpu.h>
@@ -359,7 +359,7 @@ static struct crypto_comp **ipcomp6_alloc_tfms(const char *alg_name)
        for_each_possible_cpu(cpu) {
                struct crypto_comp *tfm = crypto_alloc_comp(alg_name, 0,
                                                            CRYPTO_ALG_ASYNC);
-               if (!tfm)
+               if (IS_ERR(tfm))
                        goto error;
                *per_cpu_ptr(tfms, cpu) = tfm;
        }
index 20cfc90d5597dc266d398beb8de1eaeb0a77107f..67997a74ddce15d85e43c8146a9ed62f91085f77 100644 (file)
@@ -1037,6 +1037,7 @@ static void ndisc_ra_useropt(struct sk_buff *ra, struct nd_opt_hdr *opt)
 
        ndmsg = nlmsg_data(nlh);
        ndmsg->nduseropt_family = AF_INET6;
+       ndmsg->nduseropt_ifindex = ra->dev->ifindex;
        ndmsg->nduseropt_icmp_type = icmp6h->icmp6_type;
        ndmsg->nduseropt_icmp_code = icmp6h->icmp6_code;
        ndmsg->nduseropt_opts_len = opt->nd_opt_len << 3;
@@ -1670,7 +1671,7 @@ int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, struct file * f
                                            filp, buffer, lenp, ppos);
 
        else if ((strcmp(ctl->procname, "retrans_time_ms") == 0) ||
-                (strcmp(ctl->procname, "base_reacable_time_ms") == 0))
+                (strcmp(ctl->procname, "base_reachable_time_ms") == 0))
                ret = proc_dointvec_ms_jiffies(ctl, write,
                                               filp, buffer, lenp, ppos);
        else
index 4513eab773973e3db0722394b550b7a961125d24..e789ec44d23b2e5cacdf154bf4709372d4e00d88 100644 (file)
@@ -4,25 +4,29 @@
 
 # Link order matters here.
 obj-$(CONFIG_IP6_NF_IPTABLES) += ip6_tables.o
-obj-$(CONFIG_IP6_NF_MATCH_RT) += ip6t_rt.o
-obj-$(CONFIG_IP6_NF_MATCH_OPTS) += ip6t_hbh.o
-obj-$(CONFIG_IP6_NF_MATCH_IPV6HEADER) += ip6t_ipv6header.o
-obj-$(CONFIG_IP6_NF_MATCH_FRAG) += ip6t_frag.o
-obj-$(CONFIG_IP6_NF_MATCH_AH) += ip6t_ah.o
-obj-$(CONFIG_IP6_NF_MATCH_EUI64) += ip6t_eui64.o
-obj-$(CONFIG_IP6_NF_MATCH_OWNER) += ip6t_owner.o
 obj-$(CONFIG_IP6_NF_FILTER) += ip6table_filter.o
 obj-$(CONFIG_IP6_NF_MANGLE) += ip6table_mangle.o
-obj-$(CONFIG_IP6_NF_TARGET_HL) += ip6t_HL.o
 obj-$(CONFIG_IP6_NF_QUEUE) += ip6_queue.o
-obj-$(CONFIG_IP6_NF_TARGET_LOG) += ip6t_LOG.o
 obj-$(CONFIG_IP6_NF_RAW) += ip6table_raw.o
-obj-$(CONFIG_IP6_NF_MATCH_HL) += ip6t_hl.o
-obj-$(CONFIG_IP6_NF_TARGET_REJECT) += ip6t_REJECT.o
-obj-$(CONFIG_IP6_NF_MATCH_MH) += ip6t_mh.o
 
 # objects for l3 independent conntrack
 nf_conntrack_ipv6-objs  :=  nf_conntrack_l3proto_ipv6.o nf_conntrack_proto_icmpv6.o nf_conntrack_reasm.o
 
 # l3 independent conntrack
 obj-$(CONFIG_NF_CONNTRACK_IPV6) += nf_conntrack_ipv6.o
+
+# matches
+obj-$(CONFIG_IP6_NF_MATCH_AH) += ip6t_ah.o
+obj-$(CONFIG_IP6_NF_MATCH_EUI64) += ip6t_eui64.o
+obj-$(CONFIG_IP6_NF_MATCH_FRAG) += ip6t_frag.o
+obj-$(CONFIG_IP6_NF_MATCH_HL) += ip6t_hl.o
+obj-$(CONFIG_IP6_NF_MATCH_IPV6HEADER) += ip6t_ipv6header.o
+obj-$(CONFIG_IP6_NF_MATCH_MH) += ip6t_mh.o
+obj-$(CONFIG_IP6_NF_MATCH_OPTS) += ip6t_hbh.o
+obj-$(CONFIG_IP6_NF_MATCH_OWNER) += ip6t_owner.o
+obj-$(CONFIG_IP6_NF_MATCH_RT) += ip6t_rt.o
+
+# targets
+obj-$(CONFIG_IP6_NF_TARGET_HL) += ip6t_HL.o
+obj-$(CONFIG_IP6_NF_TARGET_LOG) += ip6t_LOG.o
+obj-$(CONFIG_IP6_NF_TARGET_REJECT) += ip6t_REJECT.o
index 6413a30d9f68858cea06a0f6bac64233bdfd8aa0..e273605eef855469794849f9cdfd800d659e87e7 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/spinlock.h>
 #include <linux/sysctl.h>
 #include <linux/proc_fs.h>
+#include <linux/seq_file.h>
 #include <linux/mutex.h>
 #include <net/net_namespace.h>
 #include <net/sock.h>
@@ -596,15 +597,11 @@ static ctl_table ipq_root_table[] = {
        { .ctl_name = 0 }
 };
 
-#ifdef CONFIG_PROC_FS
-static int
-ipq_get_info(char *buffer, char **start, off_t offset, int length)
+static int ip6_queue_show(struct seq_file *m, void *v)
 {
-       int len;
-
        read_lock_bh(&queue_lock);
 
-       len = sprintf(buffer,
+       seq_printf(m,
                      "Peer PID          : %d\n"
                      "Copy mode         : %hu\n"
                      "Copy range        : %u\n"
@@ -621,16 +618,21 @@ ipq_get_info(char *buffer, char **start, off_t offset, int length)
                      queue_user_dropped);
 
        read_unlock_bh(&queue_lock);
+       return 0;
+}
 
-       *start = buffer + offset;
-       len -= offset;
-       if (len > length)
-               len = length;
-       else if (len < 0)
-               len = 0;
-       return len;
+static int ip6_queue_open(struct inode *inode, struct file *file)
+{
+       return single_open(file, ip6_queue_show, NULL);
 }
-#endif /* CONFIG_PROC_FS */
+
+static const struct file_operations ip6_queue_proc_fops = {
+       .open           = ip6_queue_open,
+       .read           = seq_read,
+       .llseek         = seq_lseek,
+       .release        = single_release,
+       .owner          = THIS_MODULE,
+};
 
 static struct nf_queue_handler nfqh = {
        .name   = "ip6_queue",
@@ -650,10 +652,11 @@ static int __init ip6_queue_init(void)
                goto cleanup_netlink_notifier;
        }
 
-       proc = proc_net_create(&init_net, IPQ_PROC_FS_NAME, 0, ipq_get_info);
-       if (proc)
+       proc = create_proc_entry(IPQ_PROC_FS_NAME, 0, init_net.proc_net);
+       if (proc) {
                proc->owner = THIS_MODULE;
-       else {
+               proc->proc_fops = &ip6_queue_proc_fops;
+       } else {
                printk(KERN_ERR "ip6_queue: failed to create proc entry\n");
                goto cleanup_ipqnl;
        }
index be526ad925431b96040e26683ae63f8d2426b203..8631ed7fe8a9a84b65b398c9557e1f45ad20e220 100644 (file)
 
 static struct proc_dir_entry *proc_net_devsnmp6;
 
-static int fold_prot_inuse(struct proto *proto)
-{
-       int res = 0;
-       int cpu;
-
-       for_each_possible_cpu(cpu)
-               res += proto->stats[cpu].inuse;
-
-       return res;
-}
-
 static int sockstat6_seq_show(struct seq_file *seq, void *v)
 {
        seq_printf(seq, "TCP6: inuse %d\n",
-                      fold_prot_inuse(&tcpv6_prot));
+                      sock_prot_inuse(&tcpv6_prot));
        seq_printf(seq, "UDP6: inuse %d\n",
-                      fold_prot_inuse(&udpv6_prot));
+                      sock_prot_inuse(&udpv6_prot));
        seq_printf(seq, "UDPLITE6: inuse %d\n",
-                       fold_prot_inuse(&udplitev6_prot));
+                       sock_prot_inuse(&udplitev6_prot));
        seq_printf(seq, "RAW6: inuse %d\n",
-                      fold_prot_inuse(&rawv6_prot));
+                      sock_prot_inuse(&rawv6_prot));
        seq_printf(seq, "FRAG6: inuse %d memory %d\n",
                       ip6_frag_nqueues(), ip6_frag_mem());
        return 0;
index ca24ef19cd8f294c35d7d285751a5bb55c5d1838..807260d03586dd596314dc29614e33b3162861f0 100644 (file)
@@ -1144,6 +1144,8 @@ static int rawv6_init_sk(struct sock *sk)
        return(0);
 }
 
+DEFINE_PROTO_INUSE(rawv6)
+
 struct proto rawv6_prot = {
        .name              = "RAWv6",
        .owner             = THIS_MODULE,
@@ -1166,6 +1168,7 @@ struct proto rawv6_prot = {
        .compat_setsockopt = compat_rawv6_setsockopt,
        .compat_getsockopt = compat_rawv6_getsockopt,
 #endif
+       REF_PROTO_INUSE(rawv6)
 };
 
 #ifdef CONFIG_PROC_FS
index 95f8e4a62f68f6048f01e964ae1b619d9e90a947..6ecb5e6fae2eb9feff63496bd0749d02237af156 100644 (file)
 #include <linux/in6.h>
 #include <linux/init.h>
 #include <linux/if_arp.h>
-
-#ifdef         CONFIG_PROC_FS
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
-#endif
-
 #include <net/net_namespace.h>
 #include <net/snmp.h>
 #include <net/ipv6.h>
@@ -548,12 +544,8 @@ restart:
        rt = rt6_device_match(rt, fl->oif, flags);
        BACKTRACK(&fl->fl6_src);
 out:
-       dst_hold(&rt->u.dst);
+       dst_use(&rt->u.dst, jiffies);
        read_unlock_bh(&table->tb6_lock);
-
-       rt->u.dst.lastuse = jiffies;
-       rt->u.dst.__use++;
-
        return rt;
 
 }
@@ -2288,71 +2280,50 @@ struct rt6_proc_arg
 
 static int rt6_info_route(struct rt6_info *rt, void *p_arg)
 {
-       struct rt6_proc_arg *arg = (struct rt6_proc_arg *) p_arg;
-
-       if (arg->skip < arg->offset / RT6_INFO_LEN) {
-               arg->skip++;
-               return 0;
-       }
-
-       if (arg->len >= arg->length)
-               return 0;
+       struct seq_file *m = p_arg;
 
-       arg->len += sprintf(arg->buffer + arg->len,
-                           NIP6_SEQFMT " %02x ",
-                           NIP6(rt->rt6i_dst.addr),
-                           rt->rt6i_dst.plen);
+       seq_printf(m, NIP6_SEQFMT " %02x ", NIP6(rt->rt6i_dst.addr),
+                  rt->rt6i_dst.plen);
 
 #ifdef CONFIG_IPV6_SUBTREES
-       arg->len += sprintf(arg->buffer + arg->len,
-                           NIP6_SEQFMT " %02x ",
-                           NIP6(rt->rt6i_src.addr),
-                           rt->rt6i_src.plen);
+       seq_printf(m, NIP6_SEQFMT " %02x ", NIP6(rt->rt6i_src.addr),
+                  rt->rt6i_src.plen);
 #else
-       arg->len += sprintf(arg->buffer + arg->len,
-                           "00000000000000000000000000000000 00 ");
+       seq_puts(m, "00000000000000000000000000000000 00 ");
 #endif
 
        if (rt->rt6i_nexthop) {
-               arg->len += sprintf(arg->buffer + arg->len,
-                                   NIP6_SEQFMT,
-                                   NIP6(*((struct in6_addr *)rt->rt6i_nexthop->primary_key)));
+               seq_printf(m, NIP6_SEQFMT,
+                          NIP6(*((struct in6_addr *)rt->rt6i_nexthop->primary_key)));
        } else {
-               arg->len += sprintf(arg->buffer + arg->len,
-                                   "00000000000000000000000000000000");
+               seq_puts(m, "00000000000000000000000000000000");
        }
-       arg->len += sprintf(arg->buffer + arg->len,
-                           " %08x %08x %08x %08x %8s\n",
-                           rt->rt6i_metric, atomic_read(&rt->u.dst.__refcnt),
-                           rt->u.dst.__use, rt->rt6i_flags,
-                           rt->rt6i_dev ? rt->rt6i_dev->name : "");
+       seq_printf(m, " %08x %08x %08x %08x %8s\n",
+                  rt->rt6i_metric, atomic_read(&rt->u.dst.__refcnt),
+                  rt->u.dst.__use, rt->rt6i_flags,
+                  rt->rt6i_dev ? rt->rt6i_dev->name : "");
        return 0;
 }
 
-static int rt6_proc_info(char *buffer, char **start, off_t offset, int length)
+static int ipv6_route_show(struct seq_file *m, void *v)
 {
-       struct rt6_proc_arg arg = {
-               .buffer = buffer,
-               .offset = offset,
-               .length = length,
-       };
-
-       fib6_clean_all(rt6_info_route, 0, &arg);
-
-       *start = buffer;
-       if (offset)
-               *start += offset % RT6_INFO_LEN;
-
-       arg.len -= offset % RT6_INFO_LEN;
-
-       if (arg.len > length)
-               arg.len = length;
-       if (arg.len < 0)
-               arg.len = 0;
+       fib6_clean_all(rt6_info_route, 0, m);
+       return 0;
+}
 
-       return arg.len;
+static int ipv6_route_open(struct inode *inode, struct file *file)
+{
+       return single_open(file, ipv6_route_show, NULL);
 }
 
+static const struct file_operations ipv6_route_proc_fops = {
+       .owner          = THIS_MODULE,
+       .open           = ipv6_route_open,
+       .read           = seq_read,
+       .llseek         = seq_lseek,
+       .release        = single_release,
+};
+
 static int rt6_stats_seq_show(struct seq_file *seq, void *v)
 {
        seq_printf(seq, "%04x %04x %04x %04x %04x %04x %04x\n",
@@ -2489,22 +2460,14 @@ ctl_table ipv6_route_table[] = {
 
 void __init ip6_route_init(void)
 {
-#ifdef         CONFIG_PROC_FS
-       struct proc_dir_entry *p;
-#endif
        ip6_dst_ops.kmem_cachep =
                kmem_cache_create("ip6_dst_cache", sizeof(struct rt6_info), 0,
                                  SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL);
        ip6_dst_blackhole_ops.kmem_cachep = ip6_dst_ops.kmem_cachep;
 
        fib6_init();
-#ifdef         CONFIG_PROC_FS
-       p = proc_net_create(&init_net, "ipv6_route", 0, rt6_proc_info);
-       if (p)
-               p->owner = THIS_MODULE;
-
+       proc_net_fops_create(&init_net, "ipv6_route", 0, &ipv6_route_proc_fops);
        proc_net_fops_create(&init_net, "rt6_stats", S_IRUGO, &rt6_stats_seq_fops);
-#endif
 #ifdef CONFIG_XFRM
        xfrm6_init();
 #endif
index 85208026278b5a217123656a8c90e2ed25c93d46..93980c3b83e694460fe42ab4ed74e91f47649d2f 100644 (file)
@@ -561,16 +561,16 @@ static int tcp_v6_md5_do_add(struct sock *sk, struct in6_addr *peer,
                             char *newkey, u8 newkeylen)
 {
        /* Add key to the list */
-       struct tcp6_md5sig_key *key;
+       struct tcp_md5sig_key *key;
        struct tcp_sock *tp = tcp_sk(sk);
        struct tcp6_md5sig_key *keys;
 
-       key = (struct tcp6_md5sig_key*) tcp_v6_md5_do_lookup(sk, peer);
+       key = tcp_v6_md5_do_lookup(sk, peer);
        if (key) {
                /* modify existing entry - just update that one */
-               kfree(key->base.key);
-               key->base.key = newkey;
-               key->base.keylen = newkeylen;
+               kfree(key->key);
+               key->key = newkey;
+               key->keylen = newkeylen;
        } else {
                /* reallocate new list if current one is full. */
                if (!tp->md5sig_info) {
@@ -581,7 +581,10 @@ static int tcp_v6_md5_do_add(struct sock *sk, struct in6_addr *peer,
                        }
                        sk->sk_route_caps &= ~NETIF_F_GSO_MASK;
                }
-               tcp_alloc_md5sig_pool();
+               if (tcp_alloc_md5sig_pool() == NULL) {
+                       kfree(newkey);
+                       return -ENOMEM;
+               }
                if (tp->md5sig_info->alloced6 == tp->md5sig_info->entries6) {
                        keys = kmalloc((sizeof (tp->md5sig_info->keys6[0]) *
                                       (tp->md5sig_info->entries6 + 1)), GFP_ATOMIC);
@@ -634,10 +637,6 @@ static int tcp_v6_md5_do_del(struct sock *sk, struct in6_addr *peer)
                                kfree(tp->md5sig_info->keys6);
                                tp->md5sig_info->keys6 = NULL;
                                tp->md5sig_info->alloced6 = 0;
-
-                               tcp_free_md5sig_pool();
-
-                               return 0;
                        } else {
                                /* shrink the database */
                                if (tp->md5sig_info->entries6 != i)
@@ -646,6 +645,8 @@ static int tcp_v6_md5_do_del(struct sock *sk, struct in6_addr *peer)
                                                (tp->md5sig_info->entries6 - i)
                                                * sizeof (tp->md5sig_info->keys6[0]));
                        }
+                       tcp_free_md5sig_pool();
+                       return 0;
                }
        }
        return -ENOENT;
@@ -781,7 +782,7 @@ static int tcp_v6_do_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key,
        sg_set_buf(&sg[block++], key->key, key->keylen);
        nbytes += key->keylen;
 
-       sg_mark_end(sg, block);
+       sg_mark_end(&sg[block - 1]);
 
        /* Now store the hash into the packet */
        err = crypto_hash_init(desc);
@@ -2107,6 +2108,8 @@ void tcp6_proc_exit(void)
 }
 #endif
 
+DEFINE_PROTO_INUSE(tcpv6)
+
 struct proto tcpv6_prot = {
        .name                   = "TCPv6",
        .owner                  = THIS_MODULE,
@@ -2141,6 +2144,7 @@ struct proto tcpv6_prot = {
        .compat_setsockopt      = compat_tcp_setsockopt,
        .compat_getsockopt      = compat_tcp_getsockopt,
 #endif
+       REF_PROTO_INUSE(tcpv6)
 };
 
 static struct inet6_protocol tcpv6_protocol = {
index caebad6ee510d8927db4b0df4dd0d8c2dfb5ab42..ee1cc3f8599fd110bca8e77e38e2e9f50b607402 100644 (file)
@@ -205,12 +205,11 @@ out:
        return err;
 
 csum_copy_err:
+       UDP6_INC_STATS_USER(UDP_MIB_INERRORS, is_udplite);
        skb_kill_datagram(sk, skb, flags);
 
-       if (flags & MSG_DONTWAIT) {
-               UDP6_INC_STATS_USER(UDP_MIB_INERRORS, is_udplite);
+       if (flags & MSG_DONTWAIT)
                return -EAGAIN;
-       }
        goto try_again;
 }
 
@@ -971,6 +970,8 @@ void udp6_proc_exit(void) {
 
 /* ------------------------------------------------------------------------ */
 
+DEFINE_PROTO_INUSE(udpv6)
+
 struct proto udpv6_prot = {
        .name              = "UDPv6",
        .owner             = THIS_MODULE,
@@ -992,6 +993,7 @@ struct proto udpv6_prot = {
        .compat_setsockopt = compat_udpv6_setsockopt,
        .compat_getsockopt = compat_udpv6_getsockopt,
 #endif
+       REF_PROTO_INUSE(udpv6)
 };
 
 static struct inet_protosw udpv6_protosw = {
index 766566f7de47dc6734db6f2fb769b012723c0947..5a0379f7141515f2ddc1841959ecde05f8a3ee66 100644 (file)
@@ -40,6 +40,8 @@ static int udplite_v6_get_port(struct sock *sk, unsigned short snum)
        return udplite_get_port(sk, snum, ipv6_rcv_saddr_equal);
 }
 
+DEFINE_PROTO_INUSE(udplitev6)
+
 struct proto udplitev6_prot = {
        .name              = "UDPLITEv6",
        .owner             = THIS_MODULE,
@@ -62,6 +64,7 @@ struct proto udplitev6_prot = {
        .compat_setsockopt = compat_udpv6_setsockopt,
        .compat_getsockopt = compat_udpv6_getsockopt,
 #endif
+       REF_PROTO_INUSE(udplitev6)
 };
 
 static struct inet_protosw udplite6_protosw = {
index 29b063d4312052cefd1a9bbdfd02b62d8b212211..c76a9523091b2747f6b9c01dee54d478bd3b4ec7 100644 (file)
@@ -92,11 +92,6 @@ extern int ipxrtr_route_skb(struct sk_buff *skb);
 extern struct ipx_route *ipxrtr_lookup(__be32 net);
 extern int ipxrtr_ioctl(unsigned int cmd, void __user *arg);
 
-#undef IPX_REFCNT_DEBUG
-#ifdef IPX_REFCNT_DEBUG
-atomic_t ipx_sock_nr;
-#endif
-
 struct ipx_interface *ipx_interfaces_head(void)
 {
        struct ipx_interface *rc = NULL;
@@ -151,14 +146,7 @@ static void ipx_destroy_socket(struct sock *sk)
 {
        ipx_remove_socket(sk);
        skb_queue_purge(&sk->sk_receive_queue);
-#ifdef IPX_REFCNT_DEBUG
-       atomic_dec(&ipx_sock_nr);
-       printk(KERN_DEBUG "IPX socket %p released, %d are still alive\n", sk,
-                       atomic_read(&ipx_sock_nr));
-       if (atomic_read(&sk->sk_refcnt) != 1)
-               printk(KERN_DEBUG "Destruction sock ipx %p delayed, cnt=%d\n",
-                               sk, atomic_read(&sk->sk_refcnt));
-#endif
+       sk_refcnt_debug_dec(sk);
        sock_put(sk);
 }
 
@@ -1381,14 +1369,11 @@ static int ipx_create(struct net *net, struct socket *sock, int protocol)
                goto out;
 
        rc = -ENOMEM;
-       sk = sk_alloc(net, PF_IPX, GFP_KERNEL, &ipx_proto, 1);
+       sk = sk_alloc(net, PF_IPX, GFP_KERNEL, &ipx_proto);
        if (!sk)
                goto out;
-#ifdef IPX_REFCNT_DEBUG
-       atomic_inc(&ipx_sock_nr);
-       printk(KERN_DEBUG "IPX socket %p created, now we have %d alive\n", sk,
-                       atomic_read(&ipx_sock_nr));
-#endif
+
+       sk_refcnt_debug_inc(sk);
        sock_init_data(sock, sk);
        sk->sk_no_check = 1;            /* Checksum off by default */
        sock->ops = &ipx_dgram_ops;
@@ -1409,6 +1394,7 @@ static int ipx_release(struct socket *sock)
 
        sock_set_flag(sk, SOCK_DEAD);
        sock->sk = NULL;
+       sk_refcnt_debug_release(sk);
        ipx_destroy_socket(sk);
 out:
        return 0;
index 0328ae2654f43333fc09980368dec290641d24fb..48ce59a6e0265bf6bef19fa79b2e056e85aa9bdd 100644 (file)
@@ -1078,7 +1078,7 @@ static int irda_create(struct net *net, struct socket *sock, int protocol)
        }
 
        /* Allocate networking socket */
-       sk = sk_alloc(net, PF_IRDA, GFP_ATOMIC, &irda_proto, 1);
+       sk = sk_alloc(net, PF_IRDA, GFP_ATOMIC, &irda_proto);
        if (sk == NULL)
                return -ENOMEM;
 
index dc5e34a01620b8225d8f4081c03e84ef4288b706..a86a5d83786b349bb92e773ad8d70c0d6340fe49 100644 (file)
@@ -928,7 +928,7 @@ void iriap_call_indication(struct iriap_cb *self, struct sk_buff *skb)
 
        opcode = fp[0];
        if (~opcode & 0x80) {
-               IRDA_WARNING("%s: IrIAS multiframe commands or results"
+               IRDA_WARNING("%s: IrIAS multiframe commands or results "
                             "is not implemented yet!\n", __FUNCTION__);
                return;
        }
index 7f9c8542e5fc0deabdb0ff86a7fd654a1fc962c0..c68220773d28ee2d62dd8af780dc72adc9a80794 100644 (file)
@@ -296,6 +296,7 @@ void irlan_eth_flow_indication(void *instance, void *sap, LOCAL_FLOW flow)
  */
 void irlan_eth_send_gratuitous_arp(struct net_device *dev)
 {
+#ifdef CONFIG_INET
        struct in_device *in_dev;
 
        /*
@@ -303,7 +304,6 @@ void irlan_eth_send_gratuitous_arp(struct net_device *dev)
         * is useful if we have changed access points on the same
         * subnet.
         */
-#ifdef CONFIG_INET
        IRDA_DEBUG(4, "IrLAN: Sending gratuitous ARP\n");
        rcu_read_lock();
        in_dev = __in_dev_get_rcu(dev);
index 2f9f8dce5a6946b1f72772b05f30eeaf550b4691..e0eab5927c4f434d6210711525ac9b14ba34599e 100644 (file)
@@ -731,15 +731,25 @@ dev_irnet_ioctl(struct inode *    inode,
       /* Get termios */
     case TCGETS:
       DEBUG(FS_INFO, "Get termios.\n");
+#ifndef TCGETS2
       if(kernel_termios_to_user_termios((struct termios __user *)argp, &ap->termios))
        break;
+#else
+      if(kernel_termios_to_user_termios_1((struct termios __user *)argp, &ap->termios))
+       break;
+#endif
       err = 0;
       break;
       /* Set termios */
     case TCSETSF:
       DEBUG(FS_INFO, "Set termios.\n");
+#ifndef TCGETS2
       if(user_termios_to_kernel_termios(&ap->termios, (struct termios __user *)argp))
        break;
+#else
+      if(user_termios_to_kernel_termios_1(&ap->termios, (struct termios __user *)argp))
+       break;
+#endif
       err = 0;
       break;
 
index 43e01c8d382b5ab09f8d1c94f7b2572b3c89902b..aef6645803559c0e0695574a731dad158fa8a091 100644 (file)
@@ -216,7 +216,7 @@ static struct sock *iucv_sock_alloc(struct socket *sock, int proto, gfp_t prio)
 {
        struct sock *sk;
 
-       sk = sk_alloc(&init_net, PF_IUCV, prio, &iucv_proto, 1);
+       sk = sk_alloc(&init_net, PF_IUCV, prio, &iucv_proto);
        if (!sk)
                return NULL;
 
index a2f5a6ea389520832c86c8b5e1f9c907de518796..7698f6c459d6006f2ed587ec00c54c84a1901777 100644 (file)
@@ -97,7 +97,7 @@ struct iucv_irq_list {
        struct iucv_irq_data data;
 };
 
-static struct iucv_irq_data *iucv_irq_data;
+static struct iucv_irq_data *iucv_irq_data[NR_CPUS];
 static cpumask_t iucv_buffer_cpumask = CPU_MASK_NONE;
 static cpumask_t iucv_irq_cpumask = CPU_MASK_NONE;
 
@@ -277,7 +277,7 @@ union iucv_param {
 /*
  * Anchor for per-cpu IUCV command parameter block.
  */
-static union iucv_param *iucv_param;
+static union iucv_param *iucv_param[NR_CPUS];
 
 /**
  * iucv_call_b2f0
@@ -356,7 +356,7 @@ static void iucv_allow_cpu(void *data)
         *      0x10 - Flag to allow priority message completion interrupts
         *      0x08 - Flag to allow IUCV control interrupts
         */
-       parm = percpu_ptr(iucv_param, smp_processor_id());
+       parm = iucv_param[cpu];
        memset(parm, 0, sizeof(union iucv_param));
        parm->set_mask.ipmask = 0xf8;
        iucv_call_b2f0(IUCV_SETMASK, parm);
@@ -377,7 +377,7 @@ static void iucv_block_cpu(void *data)
        union iucv_param *parm;
 
        /* Disable all iucv interrupts. */
-       parm = percpu_ptr(iucv_param, smp_processor_id());
+       parm = iucv_param[cpu];
        memset(parm, 0, sizeof(union iucv_param));
        iucv_call_b2f0(IUCV_SETMASK, parm);
 
@@ -401,9 +401,9 @@ static void iucv_declare_cpu(void *data)
                return;
 
        /* Declare interrupt buffer. */
-       parm = percpu_ptr(iucv_param, cpu);
+       parm = iucv_param[cpu];
        memset(parm, 0, sizeof(union iucv_param));
-       parm->db.ipbfadr1 = virt_to_phys(percpu_ptr(iucv_irq_data, cpu));
+       parm->db.ipbfadr1 = virt_to_phys(iucv_irq_data[cpu]);
        rc = iucv_call_b2f0(IUCV_DECLARE_BUFFER, parm);
        if (rc) {
                char *err = "Unknown";
@@ -458,7 +458,7 @@ static void iucv_retrieve_cpu(void *data)
        iucv_block_cpu(NULL);
 
        /* Retrieve interrupt buffer. */
-       parm = percpu_ptr(iucv_param, cpu);
+       parm = iucv_param[cpu];
        iucv_call_b2f0(IUCV_RETRIEVE_BUFFER, parm);
 
        /* Clear indication that an iucv buffer exists for this cpu. */
@@ -558,22 +558,23 @@ static int __cpuinit iucv_cpu_notify(struct notifier_block *self,
        switch (action) {
        case CPU_UP_PREPARE:
        case CPU_UP_PREPARE_FROZEN:
-               if (!percpu_populate(iucv_irq_data,
-                                    sizeof(struct iucv_irq_data),
-                                    GFP_KERNEL|GFP_DMA, cpu))
+               iucv_irq_data[cpu] = kmalloc_node(sizeof(struct iucv_irq_data),
+                                       GFP_KERNEL|GFP_DMA, cpu_to_node(cpu));
+               if (!iucv_irq_data[cpu])
                        return NOTIFY_BAD;
-               if (!percpu_populate(iucv_param, sizeof(union iucv_param),
-                                    GFP_KERNEL|GFP_DMA, cpu)) {
-                       percpu_depopulate(iucv_irq_data, cpu);
+               iucv_param[cpu] = kmalloc_node(sizeof(union iucv_param),
+                                    GFP_KERNEL|GFP_DMA, cpu_to_node(cpu));
+               if (!iucv_param[cpu])
                        return NOTIFY_BAD;
-               }
                break;
        case CPU_UP_CANCELED:
        case CPU_UP_CANCELED_FROZEN:
        case CPU_DEAD:
        case CPU_DEAD_FROZEN:
-               percpu_depopulate(iucv_param, cpu);
-               percpu_depopulate(iucv_irq_data, cpu);
+               kfree(iucv_param[cpu]);
+               iucv_param[cpu] = NULL;
+               kfree(iucv_irq_data[cpu]);
+               iucv_irq_data[cpu] = NULL;
                break;
        case CPU_ONLINE:
        case CPU_ONLINE_FROZEN:
@@ -612,7 +613,7 @@ static int iucv_sever_pathid(u16 pathid, u8 userdata[16])
 {
        union iucv_param *parm;
 
-       parm = percpu_ptr(iucv_param, smp_processor_id());
+       parm = iucv_param[smp_processor_id()];
        memset(parm, 0, sizeof(union iucv_param));
        if (userdata)
                memcpy(parm->ctrl.ipuser, userdata, sizeof(parm->ctrl.ipuser));
@@ -755,7 +756,7 @@ int iucv_path_accept(struct iucv_path *path, struct iucv_handler *handler,
 
        local_bh_disable();
        /* Prepare parameter block. */
-       parm = percpu_ptr(iucv_param, smp_processor_id());
+       parm = iucv_param[smp_processor_id()];
        memset(parm, 0, sizeof(union iucv_param));
        parm->ctrl.ippathid = path->pathid;
        parm->ctrl.ipmsglim = path->msglim;
@@ -799,7 +800,7 @@ int iucv_path_connect(struct iucv_path *path, struct iucv_handler *handler,
        BUG_ON(in_atomic());
        spin_lock_bh(&iucv_table_lock);
        iucv_cleanup_queue();
-       parm = percpu_ptr(iucv_param, smp_processor_id());
+       parm = iucv_param[smp_processor_id()];
        memset(parm, 0, sizeof(union iucv_param));
        parm->ctrl.ipmsglim = path->msglim;
        parm->ctrl.ipflags1 = path->flags;
@@ -854,7 +855,7 @@ int iucv_path_quiesce(struct iucv_path *path, u8 userdata[16])
        int rc;
 
        local_bh_disable();
-       parm = percpu_ptr(iucv_param, smp_processor_id());
+       parm = iucv_param[smp_processor_id()];
        memset(parm, 0, sizeof(union iucv_param));
        if (userdata)
                memcpy(parm->ctrl.ipuser, userdata, sizeof(parm->ctrl.ipuser));
@@ -881,7 +882,7 @@ int iucv_path_resume(struct iucv_path *path, u8 userdata[16])
        int rc;
 
        local_bh_disable();
-       parm = percpu_ptr(iucv_param, smp_processor_id());
+       parm = iucv_param[smp_processor_id()];
        memset(parm, 0, sizeof(union iucv_param));
        if (userdata)
                memcpy(parm->ctrl.ipuser, userdata, sizeof(parm->ctrl.ipuser));
@@ -936,7 +937,7 @@ int iucv_message_purge(struct iucv_path *path, struct iucv_message *msg,
        int rc;
 
        local_bh_disable();
-       parm = percpu_ptr(iucv_param, smp_processor_id());
+       parm = iucv_param[smp_processor_id()];
        memset(parm, 0, sizeof(union iucv_param));
        parm->purge.ippathid = path->pathid;
        parm->purge.ipmsgid = msg->id;
@@ -1003,7 +1004,7 @@ int iucv_message_receive(struct iucv_path *path, struct iucv_message *msg,
        }
 
        local_bh_disable();
-       parm = percpu_ptr(iucv_param, smp_processor_id());
+       parm = iucv_param[smp_processor_id()];
        memset(parm, 0, sizeof(union iucv_param));
        parm->db.ipbfadr1 = (u32)(addr_t) buffer;
        parm->db.ipbfln1f = (u32) size;
@@ -1040,7 +1041,7 @@ int iucv_message_reject(struct iucv_path *path, struct iucv_message *msg)
        int rc;
 
        local_bh_disable();
-       parm = percpu_ptr(iucv_param, smp_processor_id());
+       parm = iucv_param[smp_processor_id()];
        memset(parm, 0, sizeof(union iucv_param));
        parm->db.ippathid = path->pathid;
        parm->db.ipmsgid = msg->id;
@@ -1074,7 +1075,7 @@ int iucv_message_reply(struct iucv_path *path, struct iucv_message *msg,
        int rc;
 
        local_bh_disable();
-       parm = percpu_ptr(iucv_param, smp_processor_id());
+       parm = iucv_param[smp_processor_id()];
        memset(parm, 0, sizeof(union iucv_param));
        if (flags & IUCV_IPRMDATA) {
                parm->dpl.ippathid = path->pathid;
@@ -1118,7 +1119,7 @@ int iucv_message_send(struct iucv_path *path, struct iucv_message *msg,
        int rc;
 
        local_bh_disable();
-       parm = percpu_ptr(iucv_param, smp_processor_id());
+       parm = iucv_param[smp_processor_id()];
        memset(parm, 0, sizeof(union iucv_param));
        if (flags & IUCV_IPRMDATA) {
                /* Message of 8 bytes can be placed into the parameter list. */
@@ -1172,7 +1173,7 @@ int iucv_message_send2way(struct iucv_path *path, struct iucv_message *msg,
        int rc;
 
        local_bh_disable();
-       parm = percpu_ptr(iucv_param, smp_processor_id());
+       parm = iucv_param[smp_processor_id()];
        memset(parm, 0, sizeof(union iucv_param));
        if (flags & IUCV_IPRMDATA) {
                parm->dpl.ippathid = path->pathid;
@@ -1559,7 +1560,7 @@ static void iucv_external_interrupt(u16 code)
        struct iucv_irq_data *p;
        struct iucv_irq_list *work;
 
-       p = percpu_ptr(iucv_irq_data, smp_processor_id());
+       p = iucv_irq_data[smp_processor_id()];
        if (p->ippathid >= iucv_max_pathid) {
                printk(KERN_WARNING "iucv_do_int: Got interrupt with "
                       "pathid %d > max_connections (%ld)\n",
@@ -1598,6 +1599,7 @@ static void iucv_external_interrupt(u16 code)
 static int __init iucv_init(void)
 {
        int rc;
+       int cpu;
 
        if (!MACHINE_IS_VM) {
                rc = -EPROTONOSUPPORT;
@@ -1617,19 +1619,23 @@ static int __init iucv_init(void)
                rc = PTR_ERR(iucv_root);
                goto out_bus;
        }
-       /* Note: GFP_DMA used to get memory below 2G */
-       iucv_irq_data = percpu_alloc(sizeof(struct iucv_irq_data),
-                                    GFP_KERNEL|GFP_DMA);
-       if (!iucv_irq_data) {
-               rc = -ENOMEM;
-               goto out_root;
-       }
-       /* Allocate parameter blocks. */
-       iucv_param = percpu_alloc(sizeof(union iucv_param),
-                                 GFP_KERNEL|GFP_DMA);
-       if (!iucv_param) {
-               rc = -ENOMEM;
-               goto out_extint;
+
+       for_each_online_cpu(cpu) {
+               /* Note: GFP_DMA used to get memory below 2G */
+               iucv_irq_data[cpu] = kmalloc_node(sizeof(struct iucv_irq_data),
+                                    GFP_KERNEL|GFP_DMA, cpu_to_node(cpu));
+               if (!iucv_irq_data[cpu]) {
+                       rc = -ENOMEM;
+                       goto out_free;
+               }
+
+               /* Allocate parameter blocks. */
+               iucv_param[cpu] = kmalloc_node(sizeof(union iucv_param),
+                                 GFP_KERNEL|GFP_DMA, cpu_to_node(cpu));
+               if (!iucv_param[cpu]) {
+                       rc = -ENOMEM;
+                       goto out_free;
+               }
        }
        register_hotcpu_notifier(&iucv_cpu_notifier);
        ASCEBC(iucv_error_no_listener, 16);
@@ -1638,9 +1644,13 @@ static int __init iucv_init(void)
        iucv_available = 1;
        return 0;
 
-out_extint:
-       percpu_free(iucv_irq_data);
-out_root:
+out_free:
+       for_each_possible_cpu(cpu) {
+               kfree(iucv_param[cpu]);
+               iucv_param[cpu] = NULL;
+               kfree(iucv_irq_data[cpu]);
+               iucv_irq_data[cpu] = NULL;
+       }
        s390_root_dev_unregister(iucv_root);
 out_bus:
        bus_unregister(&iucv_bus);
@@ -1658,6 +1668,7 @@ out:
 static void __exit iucv_exit(void)
 {
        struct iucv_irq_list *p, *n;
+       int cpu;
 
        spin_lock_irq(&iucv_queue_lock);
        list_for_each_entry_safe(p, n, &iucv_task_queue, list)
@@ -1666,8 +1677,12 @@ static void __exit iucv_exit(void)
                kfree(p);
        spin_unlock_irq(&iucv_queue_lock);
        unregister_hotcpu_notifier(&iucv_cpu_notifier);
-       percpu_free(iucv_param);
-       percpu_free(iucv_irq_data);
+       for_each_possible_cpu(cpu) {
+               kfree(iucv_param[cpu]);
+               iucv_param[cpu] = NULL;
+               kfree(iucv_irq_data[cpu]);
+               iucv_irq_data[cpu] = NULL;
+       }
        s390_root_dev_unregister(iucv_root);
        bus_unregister(&iucv_bus);
        unregister_external_interrupt(0x4000, iucv_external_interrupt);
index 7969f8a716df6063dbaaeebad90630b6cd6472cd..878039b9557dddae70eddd32a342fed056261581 100644 (file)
@@ -152,7 +152,7 @@ static int pfkey_create(struct net *net, struct socket *sock, int protocol)
                return -EPROTONOSUPPORT;
 
        err = -ENOMEM;
-       sk = sk_alloc(net, PF_KEY, GFP_KERNEL, &key_proto, 1);
+       sk = sk_alloc(net, PF_KEY, GFP_KERNEL, &key_proto);
        if (sk == NULL)
                goto out;
 
@@ -395,9 +395,9 @@ static inline int pfkey_sec_ctx_len(struct sadb_x_sec_ctx *sec_ctx)
 static inline int verify_sec_ctx_len(void *p)
 {
        struct sadb_x_sec_ctx *sec_ctx = (struct sadb_x_sec_ctx *)p;
-       int len;
+       int len = sec_ctx->sadb_x_ctx_len;
 
-       if (sec_ctx->sadb_x_ctx_len > PAGE_SIZE)
+       if (len > PAGE_SIZE)
                return -EINVAL;
 
        len = pfkey_sec_ctx_len(sec_ctx);
@@ -1015,9 +1015,7 @@ static inline struct sk_buff *pfkey_xfrm_state2msg(struct xfrm_state *x)
 {
        struct sk_buff *skb;
 
-       spin_lock_bh(&x->lock);
        skb = __pfkey_xfrm_state2msg(x, 1, 3);
-       spin_unlock_bh(&x->lock);
 
        return skb;
 }
@@ -1552,7 +1550,7 @@ static int pfkey_get(struct sock *sk, struct sk_buff *skb, struct sadb_msg *hdr,
 
        out_hdr = (struct sadb_msg *) out_skb->data;
        out_hdr->sadb_msg_version = hdr->sadb_msg_version;
-       out_hdr->sadb_msg_type = SADB_DUMP;
+       out_hdr->sadb_msg_type = SADB_GET;
        out_hdr->sadb_msg_satype = pfkey_proto2satype(proto);
        out_hdr->sadb_msg_errno = 0;
        out_hdr->sadb_msg_reserved = 0;
index 8ebc2769dfdabc88c288468002148d5c974fd68f..5c0b484237c81b0b370369f48d9449b796c3d9ac 100644 (file)
@@ -869,7 +869,7 @@ static void llc_sk_init(struct sock* sk)
  */
 struct sock *llc_sk_alloc(struct net *net, int family, gfp_t priority, struct proto *prot)
 {
-       struct sock *sk = sk_alloc(net, family, priority, prot, 1);
+       struct sock *sk = sk_alloc(net, family, priority, prot);
 
        if (!sk)
                goto out;
index 6fffb3845ab6c76b341819376def9f1c77e68424..ce176e691afec86281ffb1130f848c53ff641f9e 100644 (file)
@@ -13,6 +13,18 @@ config MAC80211
        This option enables the hardware independent IEEE 802.11
        networking stack.
 
+config MAC80211_RCSIMPLE
+       bool "'simple' rate control algorithm" if EMBEDDED
+       default y
+       depends on MAC80211
+       help
+         This option allows you to turn off the 'simple' rate
+         control algorithm in mac80211. If you do turn it off,
+         you absolutely need another rate control algorithm.
+
+         Say Y unless you know you will have another algorithm
+         available.
+
 config MAC80211_LEDS
        bool "Enable LED triggers"
        depends on MAC80211 && LEDS_TRIGGERS
index 219cd9f9341fe099bc0ce5ba69c2da7442339ab8..1e6237b3484662ffe65a207a3a35a5bbd202f7d2 100644 (file)
@@ -1,8 +1,9 @@
-obj-$(CONFIG_MAC80211) += mac80211.o rc80211_simple.o
+obj-$(CONFIG_MAC80211) += mac80211.o
 
 mac80211-objs-$(CONFIG_MAC80211_LEDS) += ieee80211_led.o
 mac80211-objs-$(CONFIG_MAC80211_DEBUGFS) += debugfs.o debugfs_sta.o debugfs_netdev.o debugfs_key.o
 mac80211-objs-$(CONFIG_NET_SCHED) += wme.o
+mac80211-objs-$(CONFIG_MAC80211_RCSIMPLE) += rc80211_simple.o
 
 mac80211-objs := \
        ieee80211.o \
index bf7ba128b963a49c949b9e240209978dd691d2ac..e62fe55944b88774233059b247038be252d5844a 100644 (file)
@@ -11,7 +11,6 @@
 #include <linux/types.h>
 #include <linux/crypto.h>
 #include <linux/err.h>
-#include <asm/scatterlist.h>
 
 #include <net/mac80211.h>
 #include "ieee80211_key.h"
index f484ca7ade9ce9ff718015cef06517e7b52d13a4..59350b8727ecdcb97230f5e8e3530d886021fdaa 100644 (file)
@@ -267,6 +267,17 @@ static int ieee80211_open(struct net_device *dev)
                tasklet_enable(&local->tasklet);
        }
 
+       /*
+        * set_multicast_list will be invoked by the networking core
+        * which will check whether any increments here were done in
+        * error and sync them down to the hardware as filter flags.
+        */
+       if (sdata->flags & IEEE80211_SDATA_ALLMULTI)
+               atomic_inc(&local->iff_allmultis);
+
+       if (sdata->flags & IEEE80211_SDATA_PROMISC)
+               atomic_inc(&local->iff_promiscs);
+
        local->open_count++;
 
        netif_start_queue(dev);
@@ -284,6 +295,18 @@ static int ieee80211_stop(struct net_device *dev)
 
        netif_stop_queue(dev);
 
+       /*
+        * Don't count this interface for promisc/allmulti while it
+        * is down. dev_mc_unsync() will invoke set_multicast_list
+        * on the master interface which will sync these down to the
+        * hardware as filter flags.
+        */
+       if (sdata->flags & IEEE80211_SDATA_ALLMULTI)
+               atomic_dec(&local->iff_allmultis);
+
+       if (sdata->flags & IEEE80211_SDATA_PROMISC)
+               atomic_dec(&local->iff_promiscs);
+
        dev_mc_unsync(local->mdev, dev);
 
        /* down all dependent devices, that is VLANs */
@@ -366,8 +389,8 @@ static void ieee80211_set_multicast_list(struct net_device *dev)
 
        allmulti = !!(dev->flags & IFF_ALLMULTI);
        promisc = !!(dev->flags & IFF_PROMISC);
-       sdata_allmulti = sdata->flags & IEEE80211_SDATA_ALLMULTI;
-       sdata_promisc = sdata->flags & IEEE80211_SDATA_PROMISC;
+       sdata_allmulti = !!(sdata->flags & IEEE80211_SDATA_ALLMULTI);
+       sdata_promisc = !!(sdata->flags & IEEE80211_SDATA_PROMISC);
 
        if (allmulti != sdata_allmulti) {
                if (dev->flags & IFF_ALLMULTI)
@@ -1072,7 +1095,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
        ieee80211_debugfs_add_netdev(IEEE80211_DEV_TO_SUB_IF(local->mdev));
        ieee80211_if_set_type(local->mdev, IEEE80211_IF_TYPE_AP);
 
-       result = ieee80211_init_rate_ctrl_alg(local, NULL);
+       result = ieee80211_init_rate_ctrl_alg(local,
+                                             hw->rate_control_algorithm);
        if (result < 0) {
                printk(KERN_DEBUG "%s: Failed to initialize rate control "
                       "algorithm\n", wiphy_name(local->hw.wiphy));
@@ -1233,8 +1257,17 @@ static int __init ieee80211_init(void)
 
        BUILD_BUG_ON(sizeof(struct ieee80211_tx_packet_data) > sizeof(skb->cb));
 
+#ifdef CONFIG_MAC80211_RCSIMPLE
+       ret = ieee80211_rate_control_register(&mac80211_rcsimple);
+       if (ret)
+               return ret;
+#endif
+
        ret = ieee80211_wme_register();
        if (ret) {
+#ifdef CONFIG_MAC80211_RCSIMPLE
+               ieee80211_rate_control_unregister(&mac80211_rcsimple);
+#endif
                printk(KERN_DEBUG "ieee80211_init: failed to "
                       "initialize WME (err=%d)\n", ret);
                return ret;
@@ -1248,6 +1281,10 @@ static int __init ieee80211_init(void)
 
 static void __exit ieee80211_exit(void)
 {
+#ifdef CONFIG_MAC80211_RCSIMPLE
+       ieee80211_rate_control_unregister(&mac80211_rcsimple);
+#endif
+
        ieee80211_wme_unregister();
        ieee80211_debugfs_netdev_exit();
 }
diff --git a/net/mac80211/ieee80211_common.h b/net/mac80211/ieee80211_common.h
deleted file mode 100644 (file)
index c15295d..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * IEEE 802.11 driver (80211.o) -- hostapd interface
- * Copyright 2002-2004, Instant802 Networks, Inc.
- *
- * 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 IEEE80211_COMMON_H
-#define IEEE80211_COMMON_H
-
-#include <linux/types.h>
-
-/*
- * This is common header information with user space. It is used on all
- * frames sent to wlan#ap interface.
- */
-
-#define IEEE80211_FI_VERSION 0x80211001
-
-struct ieee80211_frame_info {
-       __be32 version;
-       __be32 length;
-       __be64 mactime;
-       __be64 hosttime;
-       __be32 phytype;
-       __be32 channel;
-       __be32 datarate;
-       __be32 antenna;
-       __be32 priority;
-       __be32 ssi_type;
-       __be32 ssi_signal;
-       __be32 ssi_noise;
-       __be32 preamble;
-       __be32 encoding;
-
-       /* Note: this structure is otherwise identical to capture format used
-        * in linux-wlan-ng, but this additional field is used to provide meta
-        * data about the frame to hostapd. This was the easiest method for
-        * providing this information, but this might change in the future. */
-       __be32 msg_type;
-} __attribute__ ((packed));
-
-
-enum ieee80211_msg_type {
-       ieee80211_msg_normal = 0,
-       ieee80211_msg_tx_callback_ack = 1,
-       ieee80211_msg_tx_callback_fail = 2,
-       /* hole at 3, was ieee80211_msg_passive_scan but unused */
-       /* hole at 4, was ieee80211_msg_wep_frame_unknown_key but now unused */
-       ieee80211_msg_michael_mic_failure = 5,
-       /* hole at 6, was monitor but never sent to userspace */
-       ieee80211_msg_sta_not_assoc = 7,
-       /* 8 was ieee80211_msg_set_aid_for_sta */
-       /* 9 was ieee80211_msg_key_threshold_notification */
-       /* 11 was ieee80211_msg_radar */
-};
-
-struct ieee80211_msg_key_notification {
-       int tx_rx_count;
-       char ifname[IFNAMSIZ];
-       u8 addr[ETH_ALEN]; /* ff:ff:ff:ff:ff:ff for broadcast keys */
-};
-
-
-enum ieee80211_phytype {
-       ieee80211_phytype_fhss_dot11_97  = 1,
-       ieee80211_phytype_dsss_dot11_97  = 2,
-       ieee80211_phytype_irbaseband     = 3,
-       ieee80211_phytype_dsss_dot11_b   = 4,
-       ieee80211_phytype_pbcc_dot11_b   = 5,
-       ieee80211_phytype_ofdm_dot11_g   = 6,
-       ieee80211_phytype_pbcc_dot11_g   = 7,
-       ieee80211_phytype_ofdm_dot11_a   = 8,
-};
-
-enum ieee80211_ssi_type {
-       ieee80211_ssi_none = 0,
-       ieee80211_ssi_norm = 1, /* normalized, 0-1000 */
-       ieee80211_ssi_dbm = 2,
-       ieee80211_ssi_raw = 3, /* raw SSI */
-};
-
-struct ieee80211_radar_info {
-               int channel;
-               int radar;
-               int radar_type;
-};
-
-#endif /* IEEE80211_COMMON_H */
index 4b4ed2a5803c46f8e86ae550f9431fb4044e2a34..72e1c93dd87e4f2bfe520c57d753bb2354a1be44 100644 (file)
@@ -230,6 +230,7 @@ struct ieee80211_if_vlan {
 #define IEEE80211_STA_AUTO_SSID_SEL    BIT(10)
 #define IEEE80211_STA_AUTO_BSSID_SEL   BIT(11)
 #define IEEE80211_STA_AUTO_CHANNEL_SEL BIT(12)
+#define IEEE80211_STA_PRIVACY_INVOKED  BIT(13)
 struct ieee80211_if_sta {
        enum {
                IEEE80211_DISABLED, IEEE80211_AUTHENTICATE,
@@ -241,6 +242,8 @@ struct ieee80211_if_sta {
        u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN];
        u8 ssid[IEEE80211_MAX_SSID_LEN];
        size_t ssid_len;
+       u8 scan_ssid[IEEE80211_MAX_SSID_LEN];
+       size_t scan_ssid_len;
        u16 aid;
        u16 ap_capab, capab;
        u8 *extra_ie; /* to be added to the end of AssocReq */
@@ -259,7 +262,6 @@ struct ieee80211_if_sta {
        unsigned long request;
        struct sk_buff_head skb_queue;
 
-       int key_management_enabled;
        unsigned long last_probe;
 
 #define IEEE80211_AUTH_ALG_OPEN BIT(0)
index 6caa3ec2cff7798ef13e1f604fc8bdfff50a0c4c..7027eed4d4ae3a374fff7439110e80d44069a8fb 100644 (file)
@@ -917,7 +917,6 @@ static int ieee80211_ioctl_siwauth(struct net_device *dev,
                                   struct iw_request_info *info,
                                   struct iw_param *data, char *extra)
 {
-       struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
        struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
        int ret = 0;
 
@@ -927,18 +926,21 @@ static int ieee80211_ioctl_siwauth(struct net_device *dev,
        case IW_AUTH_CIPHER_GROUP:
        case IW_AUTH_WPA_ENABLED:
        case IW_AUTH_RX_UNENCRYPTED_EAPOL:
-               break;
        case IW_AUTH_KEY_MGMT:
+               break;
+       case IW_AUTH_PRIVACY_INVOKED:
                if (sdata->type != IEEE80211_IF_TYPE_STA)
                        ret = -EINVAL;
                else {
+                       sdata->u.sta.flags &= ~IEEE80211_STA_PRIVACY_INVOKED;
                        /*
-                        * Key management was set by wpa_supplicant,
-                        * we only need this to associate to a network
-                        * that has privacy enabled regardless of not
-                        * having a key.
+                        * Privacy invoked by wpa_supplicant, store the
+                        * value and allow associating to a protected
+                        * network without having a key up front.
                         */
-                       sdata->u.sta.key_management_enabled = !!data->value;
+                       if (data->value)
+                               sdata->u.sta.flags |=
+                                       IEEE80211_STA_PRIVACY_INVOKED;
                }
                break;
        case IW_AUTH_80211_AUTH_ALG:
@@ -948,11 +950,6 @@ static int ieee80211_ioctl_siwauth(struct net_device *dev,
                else
                        ret = -EOPNOTSUPP;
                break;
-       case IW_AUTH_PRIVACY_INVOKED:
-               if (local->ops->set_privacy_invoked)
-                       ret = local->ops->set_privacy_invoked(
-                                       local_to_hw(local), data->value);
-               break;
        default:
                ret = -EOPNOTSUPP;
                break;
index 93abb8fff1410f254c9fb6adf04ad34823bc80a5..7254bd6098398e0f408afe8f6eff40922dfe3c71 100644 (file)
@@ -25,13 +25,25 @@ int ieee80211_rate_control_register(struct rate_control_ops *ops)
 {
        struct rate_control_alg *alg;
 
+       if (!ops->name)
+               return -EINVAL;
+
+       mutex_lock(&rate_ctrl_mutex);
+       list_for_each_entry(alg, &rate_ctrl_algs, list) {
+               if (!strcmp(alg->ops->name, ops->name)) {
+                       /* don't register an algorithm twice */
+                       WARN_ON(1);
+                       return -EALREADY;
+               }
+       }
+
        alg = kzalloc(sizeof(*alg), GFP_KERNEL);
        if (alg == NULL) {
+               mutex_unlock(&rate_ctrl_mutex);
                return -ENOMEM;
        }
        alg->ops = ops;
 
-       mutex_lock(&rate_ctrl_mutex);
        list_add_tail(&alg->list, &rate_ctrl_algs);
        mutex_unlock(&rate_ctrl_mutex);
 
@@ -61,9 +73,12 @@ ieee80211_try_rate_control_ops_get(const char *name)
        struct rate_control_alg *alg;
        struct rate_control_ops *ops = NULL;
 
+       if (!name)
+               return NULL;
+
        mutex_lock(&rate_ctrl_mutex);
        list_for_each_entry(alg, &rate_ctrl_algs, list) {
-               if (!name || !strcmp(alg->ops->name, name))
+               if (!strcmp(alg->ops->name, name))
                        if (try_module_get(alg->ops->module)) {
                                ops = alg->ops;
                                break;
@@ -80,9 +95,12 @@ ieee80211_rate_control_ops_get(const char *name)
 {
        struct rate_control_ops *ops;
 
+       if (!name)
+               name = "simple";
+
        ops = ieee80211_try_rate_control_ops_get(name);
        if (!ops) {
-               request_module("rc80211_%s", name ? name : "default");
+               request_module("rc80211_%s", name);
                ops = ieee80211_try_rate_control_ops_get(name);
        }
        return ops;
index 7cd1ebab4f8345f4cdf008b17ecc134254c45c39..23688139ffb3ea399292ce2b6842f55c91371d34 100644 (file)
@@ -65,6 +65,9 @@ struct rate_control_ref {
        struct kref kref;
 };
 
+/* default 'simple' algorithm */
+extern struct rate_control_ops mac80211_rcsimple;
+
 int ieee80211_rate_control_register(struct rate_control_ops *ops);
 void ieee80211_rate_control_unregister(struct rate_control_ops *ops);
 
index fda0e06453e85bc5f8d00867170dd41d17e9e65c..16afd24d4f6b2bb392914e9fac06434ed205b54f 100644 (file)
@@ -704,10 +704,11 @@ static int ieee80211_privacy_mismatch(struct net_device *dev,
 {
        struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
        struct ieee80211_sta_bss *bss;
-       int res = 0;
+       int bss_privacy;
+       int wep_privacy;
+       int privacy_invoked;
 
-       if (!ifsta || (ifsta->flags & IEEE80211_STA_MIXED_CELL) ||
-           ifsta->key_management_enabled)
+       if (!ifsta || (ifsta->flags & IEEE80211_STA_MIXED_CELL))
                return 0;
 
        bss = ieee80211_rx_bss_get(dev, ifsta->bssid, local->hw.conf.channel,
@@ -715,13 +716,16 @@ static int ieee80211_privacy_mismatch(struct net_device *dev,
        if (!bss)
                return 0;
 
-       if (ieee80211_sta_wep_configured(dev) !=
-           !!(bss->capability & WLAN_CAPABILITY_PRIVACY))
-               res = 1;
+       bss_privacy = !!(bss->capability & WLAN_CAPABILITY_PRIVACY);
+       wep_privacy = !!ieee80211_sta_wep_configured(dev);
+       privacy_invoked = !!(ifsta->flags & IEEE80211_STA_PRIVACY_INVOKED);
 
        ieee80211_rx_bss_put(dev, bss);
 
-       return res;
+       if ((bss_privacy == wep_privacy) || (bss_privacy == privacy_invoked))
+               return 0;
+
+       return 1;
 }
 
 
@@ -1998,7 +2002,10 @@ void ieee80211_sta_work(struct work_struct *work)
        if (ifsta->state != IEEE80211_AUTHENTICATE &&
            ifsta->state != IEEE80211_ASSOCIATE &&
            test_and_clear_bit(IEEE80211_STA_REQ_SCAN, &ifsta->request)) {
-               ieee80211_sta_start_scan(dev, NULL, 0);
+               if (ifsta->scan_ssid_len)
+                       ieee80211_sta_start_scan(dev, ifsta->scan_ssid, ifsta->scan_ssid_len);
+               else
+                       ieee80211_sta_start_scan(dev, NULL, 0);
                return;
        }
 
@@ -2640,7 +2647,7 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw)
        local->sta_scanning = 0;
 
        if (ieee80211_hw_config(local))
-               printk(KERN_DEBUG "%s: failed to restore operational"
+               printk(KERN_DEBUG "%s: failed to restore operational "
                       "channel after scan\n", dev->name);
 
 
@@ -2868,6 +2875,9 @@ int ieee80211_sta_req_scan(struct net_device *dev, u8 *ssid, size_t ssid_len)
                return -EBUSY;
        }
 
+       ifsta->scan_ssid_len = ssid_len;
+       if (ssid_len)
+               memcpy(ifsta->scan_ssid, ssid, ssid_len);
        set_bit(IEEE80211_STA_REQ_SCAN, &ifsta->request);
        queue_work(local->hw.workqueue, &ifsta->work);
        return 0;
index 314b8de888625c576a02fbd50caa01fc7787d84d..da72737364e42bb5d8fc68255603befad39bd535 100644 (file)
@@ -7,7 +7,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/module.h>
 #include <linux/init.h>
 #include <linux/netdevice.h>
 #include <linux/types.h>
@@ -29,8 +28,6 @@
 #define RATE_CONTROL_INTERVAL (HZ / 20)
 #define RATE_CONTROL_MIN_TX 10
 
-MODULE_ALIAS("rc80211_default");
-
 static void rate_control_rate_inc(struct ieee80211_local *local,
                                  struct sta_info *sta)
 {
@@ -394,8 +391,7 @@ static void rate_control_simple_remove_sta_debugfs(void *priv, void *priv_sta)
 }
 #endif
 
-static struct rate_control_ops rate_control_simple = {
-       .module = THIS_MODULE,
+struct rate_control_ops mac80211_rcsimple = {
        .name = "simple",
        .tx_status = rate_control_simple_tx_status,
        .get_rate = rate_control_simple_get_rate,
@@ -410,22 +406,3 @@ static struct rate_control_ops rate_control_simple = {
        .remove_sta_debugfs = rate_control_simple_remove_sta_debugfs,
 #endif
 };
-
-
-static int __init rate_control_simple_init(void)
-{
-       return ieee80211_rate_control_register(&rate_control_simple);
-}
-
-
-static void __exit rate_control_simple_exit(void)
-{
-       ieee80211_rate_control_unregister(&rate_control_simple);
-}
-
-
-subsys_initcall(rate_control_simple_init);
-module_exit(rate_control_simple_exit);
-
-MODULE_DESCRIPTION("Simple rate control algorithm for ieee80211");
-MODULE_LICENSE("GPL");
index ece77766ea2bd798552152b67313e8c86ae0aa1c..428a9fcf57d62c90c6537490fd193d6342b47ee7 100644 (file)
@@ -509,9 +509,11 @@ ieee80211_rx_h_decrypt(struct ieee80211_txrx_data *rx)
                rx->key->tx_rx_count++;
                /* TODO: add threshold stuff again */
        } else {
+#ifdef CONFIG_MAC80211_DEBUG
                if (net_ratelimit())
                        printk(KERN_DEBUG "%s: RX protected frame,"
                               " but have no key\n", rx->dev->name);
+#endif /* CONFIG_MAC80211_DEBUG */
                return TXRX_DROP;
        }
 
index a84a23310ff4576116cab6dcb625f6e27bcb6ae4..9bf0e1cc530ad5e9c8975d50cbca6cefddd673e3 100644 (file)
@@ -314,9 +314,11 @@ ieee80211_crypto_wep_decrypt(struct ieee80211_txrx_data *rx)
 
        if (!(rx->u.rx.status->flag & RX_FLAG_DECRYPTED)) {
                if (ieee80211_wep_decrypt(rx->local, rx->skb, rx->key)) {
+#ifdef CONFIG_MAC80211_DEBUG
                        if (net_ratelimit())
                                printk(KERN_DEBUG "%s: RX WEP frame, decrypt "
                                       "failed\n", rx->dev->name);
+#endif /* CONFIG_MAC80211_DEBUG */
                        return TXRX_DROP;
                }
        } else if (!(rx->u.rx.status->flag & RX_FLAG_IV_STRIPPED)) {
index 6695efba57ec12c52329c203da57d97d45f7946b..20cec1cb956fb38d6506139d757d8a983cf126d7 100644 (file)
@@ -323,9 +323,12 @@ ieee80211_crypto_tkip_decrypt(struct ieee80211_txrx_data *rx)
                                          &rx->u.rx.tkip_iv32,
                                          &rx->u.rx.tkip_iv16);
        if (res != TKIP_DECRYPT_OK || wpa_test) {
-               printk(KERN_DEBUG "%s: TKIP decrypt failed for RX frame from "
-                      "%s (res=%d)\n",
-                      rx->dev->name, print_mac(mac, rx->sta->addr), res);
+#ifdef CONFIG_MAC80211_DEBUG
+               if (net_ratelimit())
+                       printk(KERN_DEBUG "%s: TKIP decrypt failed for RX "
+                              "frame from %s (res=%d)\n", rx->dev->name,
+                              print_mac(mac, rx->sta->addr), res);
+#endif /* CONFIG_MAC80211_DEBUG */
                return TXRX_DROP;
        }
 
@@ -594,9 +597,12 @@ ieee80211_crypto_ccmp_decrypt(struct ieee80211_txrx_data *rx)
                            skb->data + hdrlen + CCMP_HDR_LEN, data_len,
                            skb->data + skb->len - CCMP_MIC_LEN,
                            skb->data + hdrlen + CCMP_HDR_LEN)) {
-                       printk(KERN_DEBUG "%s: CCMP decrypt failed for RX "
-                              "frame from %s\n", rx->dev->name,
-                              print_mac(mac, rx->sta->addr));
+#ifdef CONFIG_MAC80211_DEBUG
+                       if (net_ratelimit())
+                               printk(KERN_DEBUG "%s: CCMP decrypt failed "
+                                      "for RX frame from %s\n", rx->dev->name,
+                                      print_mac(mac, rx->sta->addr));
+#endif /* CONFIG_MAC80211_DEBUG */
                        return TXRX_DROP;
                }
        }
index d7a600a5720acaf306c83a67d18210ee39b495c9..21a9fcc0379671a251a34c9d312c1cfdd874bf08 100644 (file)
@@ -363,7 +363,7 @@ config NETFILTER_XT_TARGET_TRACE
          the tables, chains, rules.
 
          If you want to compile it as a module, say M here and read
-         <file:Documentation/modules.txt>.  If unsure, say `N'.
+         <file:Documentation/kbuild/modules.txt>.  If unsure, say `N'.
 
 config NETFILTER_XT_TARGET_SECMARK
        tristate '"SECMARK" target support'
index 93c58f973831f5dd268bf9e114c009faa755350a..ad0e36ebea3d3f17a18bc973175d1d8358284bef 100644 (file)
@@ -40,15 +40,15 @@ obj-$(CONFIG_NETFILTER_XTABLES) += x_tables.o xt_tcpudp.o
 # targets
 obj-$(CONFIG_NETFILTER_XT_TARGET_CLASSIFY) += xt_CLASSIFY.o
 obj-$(CONFIG_NETFILTER_XT_TARGET_CONNMARK) += xt_CONNMARK.o
+obj-$(CONFIG_NETFILTER_XT_TARGET_CONNSECMARK) += xt_CONNSECMARK.o
 obj-$(CONFIG_NETFILTER_XT_TARGET_DSCP) += xt_DSCP.o
 obj-$(CONFIG_NETFILTER_XT_TARGET_MARK) += xt_MARK.o
-obj-$(CONFIG_NETFILTER_XT_TARGET_NFQUEUE) += xt_NFQUEUE.o
 obj-$(CONFIG_NETFILTER_XT_TARGET_NFLOG) += xt_NFLOG.o
+obj-$(CONFIG_NETFILTER_XT_TARGET_NFQUEUE) += xt_NFQUEUE.o
 obj-$(CONFIG_NETFILTER_XT_TARGET_NOTRACK) += xt_NOTRACK.o
-obj-$(CONFIG_NETFILTER_XT_TARGET_TRACE) += xt_TRACE.o
 obj-$(CONFIG_NETFILTER_XT_TARGET_SECMARK) += xt_SECMARK.o
 obj-$(CONFIG_NETFILTER_XT_TARGET_TCPMSS) += xt_TCPMSS.o
-obj-$(CONFIG_NETFILTER_XT_TARGET_CONNSECMARK) += xt_CONNSECMARK.o
+obj-$(CONFIG_NETFILTER_XT_TARGET_TRACE) += xt_TRACE.o
 
 # matches
 obj-$(CONFIG_NETFILTER_XT_MATCH_COMMENT) += xt_comment.o
@@ -59,22 +59,22 @@ obj-$(CONFIG_NETFILTER_XT_MATCH_CONNTRACK) += xt_conntrack.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_DCCP) += xt_dccp.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_DSCP) += xt_dscp.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_ESP) += xt_esp.o
+obj-$(CONFIG_NETFILTER_XT_MATCH_HASHLIMIT) += xt_hashlimit.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_HELPER) += xt_helper.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_LENGTH) += xt_length.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_LIMIT) += xt_limit.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_MAC) += xt_mac.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_MARK) += xt_mark.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_MULTIPORT) += xt_multiport.o
-obj-$(CONFIG_NETFILTER_XT_MATCH_POLICY) += xt_policy.o
+obj-$(CONFIG_NETFILTER_XT_MATCH_PHYSDEV) += xt_physdev.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_PKTTYPE) += xt_pkttype.o
+obj-$(CONFIG_NETFILTER_XT_MATCH_POLICY) += xt_policy.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_QUOTA) += xt_quota.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_REALM) += xt_realm.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_SCTP) += xt_sctp.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_STATE) += xt_state.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_STATISTIC) += xt_statistic.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_STRING) += xt_string.o
-obj-$(CONFIG_NETFILTER_XT_MATCH_TIME) += xt_time.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_TCPMSS) += xt_tcpmss.o
-obj-$(CONFIG_NETFILTER_XT_MATCH_PHYSDEV) += xt_physdev.o
+obj-$(CONFIG_NETFILTER_XT_MATCH_TIME) += xt_time.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_U32) += xt_u32.o
-obj-$(CONFIG_NETFILTER_XT_MATCH_HASHLIMIT) += xt_hashlimit.o
index 4d6171bc0829cd1e9283718054b86b5af7195cc2..000c2fb462d07996106270e33eadc72fb07718e6 100644 (file)
@@ -999,7 +999,7 @@ struct hlist_head *nf_ct_alloc_hashtable(int *sizep, int *vmalloced)
        *vmalloced = 0;
 
        size = *sizep = roundup(*sizep, PAGE_SIZE / sizeof(struct hlist_head));
-       hash = (void*)__get_free_pages(GFP_KERNEL,
+       hash = (void*)__get_free_pages(GFP_KERNEL|__GFP_NOWARN,
                                       get_order(sizeof(struct hlist_head)
                                                 * size));
        if (!hash) {
index a1a65a1313b3ecb7e0f16254ae2514cf0d3f7ef3..cf6ba6659a8080938b3aaaa44c6ef46d0a47ad72 100644 (file)
@@ -109,7 +109,7 @@ void *__nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp)
                        rcu_read_lock();
                        t = rcu_dereference(nf_ct_ext_types[i]);
                        if (t && t->move)
-                               t->move(ct, ct->ext + ct->ext->offset[id]);
+                               t->move(ct, ct->ext + ct->ext->offset[i]);
                        rcu_read_unlock();
                }
                kfree(ct->ext);
index aa2831587b821d1c3afb65d59f96d0eb739a9377..3dd4b3c76d811a6545a0a26140f59ac237020ea4 100644 (file)
@@ -23,14 +23,13 @@ static inline int overlap(int min1, int max1, int min2, int max2)
 /* Functions to register sockopt ranges (exclusive). */
 int nf_register_sockopt(struct nf_sockopt_ops *reg)
 {
-       struct list_head *i;
+       struct nf_sockopt_ops *ops;
        int ret = 0;
 
        if (mutex_lock_interruptible(&nf_sockopt_mutex) != 0)
                return -EINTR;
 
-       list_for_each(i, &nf_sockopts) {
-               struct nf_sockopt_ops *ops = (struct nf_sockopt_ops *)i;
+       list_for_each_entry(ops, &nf_sockopts, list) {
                if (ops->pf == reg->pf
                    && (overlap(ops->set_optmin, ops->set_optmax,
                                reg->set_optmin, reg->set_optmax)
@@ -61,48 +60,57 @@ void nf_unregister_sockopt(struct nf_sockopt_ops *reg)
 }
 EXPORT_SYMBOL(nf_unregister_sockopt);
 
-/* Call get/setsockopt() */
-static int nf_sockopt(struct sock *sk, int pf, int val,
-                     char __user *opt, int *len, int get)
+static struct nf_sockopt_ops *nf_sockopt_find(struct sock *sk, int pf,
+               int val, int get)
 {
-       struct list_head *i;
        struct nf_sockopt_ops *ops;
-       int ret;
 
        if (sk->sk_net != &init_net)
-               return -ENOPROTOOPT;
+               return ERR_PTR(-ENOPROTOOPT);
 
        if (mutex_lock_interruptible(&nf_sockopt_mutex) != 0)
-               return -EINTR;
+               return ERR_PTR(-EINTR);
 
-       list_for_each(i, &nf_sockopts) {
-               ops = (struct nf_sockopt_ops *)i;
+       list_for_each_entry(ops, &nf_sockopts, list) {
                if (ops->pf == pf) {
                        if (!try_module_get(ops->owner))
                                goto out_nosup;
+
                        if (get) {
-                               if (val >= ops->get_optmin
-                                   && val < ops->get_optmax) {
-                                       mutex_unlock(&nf_sockopt_mutex);
-                                       ret = ops->get(sk, val, opt, len);
+                               if (val >= ops->get_optmin &&
+                                               val < ops->get_optmax)
                                        goto out;
-                               }
                        } else {
-                               if (val >= ops->set_optmin
-                                   && val < ops->set_optmax) {
-                                       mutex_unlock(&nf_sockopt_mutex);
-                                       ret = ops->set(sk, val, opt, *len);
+                               if (val >= ops->set_optmin &&
+                                               val < ops->set_optmax)
                                        goto out;
-                               }
                        }
                        module_put(ops->owner);
                }
        }
- out_nosup:
+out_nosup:
+       ops = ERR_PTR(-ENOPROTOOPT);
+out:
        mutex_unlock(&nf_sockopt_mutex);
-       return -ENOPROTOOPT;
+       return ops;
+}
+
+/* Call get/setsockopt() */
+static int nf_sockopt(struct sock *sk, int pf, int val,
+                     char __user *opt, int *len, int get)
+{
+       struct nf_sockopt_ops *ops;
+       int ret;
+
+       ops = nf_sockopt_find(sk, pf, val, get);
+       if (IS_ERR(ops))
+               return PTR_ERR(ops);
+
+       if (get)
+               ret = ops->get(sk, val, opt, len);
+       else
+               ret = ops->set(sk, val, opt, *len);
 
- out:
        module_put(ops->owner);
        return ret;
 }
@@ -124,56 +132,25 @@ EXPORT_SYMBOL(nf_getsockopt);
 static int compat_nf_sockopt(struct sock *sk, int pf, int val,
                             char __user *opt, int *len, int get)
 {
-       struct list_head *i;
        struct nf_sockopt_ops *ops;
        int ret;
 
-       if (sk->sk_net != &init_net)
-               return -ENOPROTOOPT;
-
-
-       if (mutex_lock_interruptible(&nf_sockopt_mutex) != 0)
-               return -EINTR;
-
-       list_for_each(i, &nf_sockopts) {
-               ops = (struct nf_sockopt_ops *)i;
-               if (ops->pf == pf) {
-                       if (!try_module_get(ops->owner))
-                               goto out_nosup;
-
-                       if (get) {
-                               if (val >= ops->get_optmin
-                                   && val < ops->get_optmax) {
-                                       mutex_unlock(&nf_sockopt_mutex);
-                                       if (ops->compat_get)
-                                               ret = ops->compat_get(sk,
-                                                       val, opt, len);
-                                       else
-                                               ret = ops->get(sk,
-                                                       val, opt, len);
-                                       goto out;
-                               }
-                       } else {
-                               if (val >= ops->set_optmin
-                                   && val < ops->set_optmax) {
-                                       mutex_unlock(&nf_sockopt_mutex);
-                                       if (ops->compat_set)
-                                               ret = ops->compat_set(sk,
-                                                       val, opt, *len);
-                                       else
-                                               ret = ops->set(sk,
-                                                       val, opt, *len);
-                                       goto out;
-                               }
-                       }
-                       module_put(ops->owner);
-               }
+       ops = nf_sockopt_find(sk, pf, val, get);
+       if (IS_ERR(ops))
+               return PTR_ERR(ops);
+
+       if (get) {
+               if (ops->compat_get)
+                       ret = ops->compat_get(sk, val, opt, len);
+               else
+                       ret = ops->get(sk, val, opt, len);
+       } else {
+               if (ops->compat_set)
+                       ret = ops->compat_set(sk, val, opt, *len);
+               else
+                       ret = ops->set(sk, val, opt, *len);
        }
- out_nosup:
-       mutex_unlock(&nf_sockopt_mutex);
-       return -ENOPROTOOPT;
 
- out:
        module_put(ops->owner);
        return ret;
 }
index 06cff1d13690909860a89275fc30dd4a861dbc54..d7becf08a93a3481fe587842f47f60d871f882d3 100644 (file)
@@ -4,7 +4,8 @@
  *   (c) 2000 Gerd Knorr <kraxel@bytesex.org>
  *   Nov 2002: Martin Bene <martin.bene@icomedias.com>:
  *             only ignore TIME_WAIT or gone connections
- *   Copyright © Jan Engelhardt <jengelh@gmx.de>, 2007
+ *   (C) CC Computer Consultants GmbH, 2007
+ *   Contact: <jengelh@computergmbh.de>
  *
  * based on ...
  *
@@ -306,7 +307,7 @@ static void __exit xt_connlimit_exit(void)
 
 module_init(xt_connlimit_init);
 module_exit(xt_connlimit_exit);
-MODULE_AUTHOR("Jan Engelhardt <jengelh@gmx.de>");
+MODULE_AUTHOR("Jan Engelhardt <jengelh@computergmbh.de>");
 MODULE_DESCRIPTION("netfilter xt_connlimit match module");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("ipt_connlimit");
index ef48bbd93573080b3489f378a4cb3755d8c20e36..f9c55dcd894b70e9cef74203a27f2d747d4f2d8e 100644 (file)
@@ -1,6 +1,7 @@
 /*
  *     xt_time
- *     Copyright © Jan Engelhardt <jengelh@computergmbh.de>, 2007
+ *     Copyright © CC Computer Consultants GmbH, 2007
+ *     Contact: <jengelh@computergmbh.de>
  *
  *     based on ipt_time by Fabrice MARIE <fabrice@netfilter.org>
  *     This is a module which is used for time matching
@@ -169,7 +170,7 @@ static bool xt_time_match(const struct sk_buff *skb,
        if (skb->tstamp.tv64 == 0)
                __net_timestamp((struct sk_buff *)skb);
 
-       stamp = skb->tstamp.tv64;
+       stamp = ktime_to_ns(skb->tstamp);
        do_div(stamp, NSEC_PER_SEC);
 
        if (info->flags & XT_TIME_LOCAL_TZ)
index bec427915b302fa2d9731de6045a9a6e8bd14ee4..af75b8c3f20b988af0df06b74382cee68e07c4cf 100644 (file)
@@ -2,7 +2,8 @@
  *     xt_u32 - kernel module to match u32 packet content
  *
  *     Original author: Don Cohen <don@isis.cs3-inc.com>
- *     © Jan Engelhardt <jengelh@gmx.de>, 2007
+ *     (C) CC Computer Consultants GmbH, 2007
+ *     Contact: <jengelh@computergmbh.de>
  */
 
 #include <linux/module.h>
@@ -129,7 +130,7 @@ static void __exit xt_u32_exit(void)
 
 module_init(xt_u32_init);
 module_exit(xt_u32_exit);
-MODULE_AUTHOR("Jan Engelhardt <jengelh@gmx.de>");
+MODULE_AUTHOR("Jan Engelhardt <jengelh@computergmbh.de>");
 MODULE_DESCRIPTION("netfilter u32 match module");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("ipt_u32");
index 4f994c0fb3f80dcc4542a4e7a17475637601b690..de3988ba1f46c45dd0831caeb71b4de0dedb0a63 100644 (file)
@@ -396,7 +396,7 @@ static int __netlink_create(struct net *net, struct socket *sock,
 
        sock->ops = &netlink_ops;
 
-       sk = sk_alloc(net, PF_NETLINK, GFP_KERNEL, &netlink_proto, 1);
+       sk = sk_alloc(net, PF_NETLINK, GFP_KERNEL, &netlink_proto);
        if (!sk)
                return -ENOMEM;
 
@@ -752,7 +752,7 @@ struct sock *netlink_getsockbyfilp(struct file *filp)
  * 1: repeat lookup - reference dropped while waiting for socket memory.
  */
 int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock,
-               long timeo, struct sock *ssk)
+                     long *timeo, struct sock *ssk)
 {
        struct netlink_sock *nlk;
 
@@ -761,7 +761,7 @@ int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock,
        if (atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf ||
            test_bit(0, &nlk->state)) {
                DECLARE_WAITQUEUE(wait, current);
-               if (!timeo) {
+               if (!*timeo) {
                        if (!ssk || netlink_is_kernel(ssk))
                                netlink_overrun(sk);
                        sock_put(sk);
@@ -775,7 +775,7 @@ int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock,
                if ((atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf ||
                     test_bit(0, &nlk->state)) &&
                    !sock_flag(sk, SOCK_DEAD))
-                       timeo = schedule_timeout(timeo);
+                       *timeo = schedule_timeout(*timeo);
 
                __set_current_state(TASK_RUNNING);
                remove_wait_queue(&nlk->wait, &wait);
@@ -783,7 +783,7 @@ int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock,
 
                if (signal_pending(current)) {
                        kfree_skb(skb);
-                       return sock_intr_errno(timeo);
+                       return sock_intr_errno(*timeo);
                }
                return 1;
        }
@@ -877,7 +877,7 @@ retry:
        if (netlink_is_kernel(sk))
                return netlink_unicast_kernel(sk, skb);
 
-       err = netlink_attachskb(sk, skb, nonblock, timeo, ssk);
+       err = netlink_attachskb(sk, skb, nonblock, &timeo, ssk);
        if (err == 1)
                goto retry;
        if (err)
@@ -1888,7 +1888,7 @@ static void __net_exit netlink_net_exit(struct net *net)
 #endif
 }
 
-static struct pernet_operations netlink_net_ops = {
+static struct pernet_operations __net_initdata netlink_net_ops = {
        .init = netlink_net_init,
        .exit = netlink_net_exit,
 };
index 3a4d479ea64e493c342f9fde022f28adbbeb29c1..972250c974f1ceaf053eb92712018d4be781ed78 100644 (file)
@@ -423,7 +423,8 @@ static int nr_create(struct net *net, struct socket *sock, int protocol)
        if (sock->type != SOCK_SEQPACKET || protocol != 0)
                return -ESOCKTNOSUPPORT;
 
-       if ((sk = sk_alloc(net, PF_NETROM, GFP_ATOMIC, &nr_proto, 1)) == NULL)
+       sk = sk_alloc(net, PF_NETROM, GFP_ATOMIC, &nr_proto);
+       if (sk  == NULL)
                return -ENOMEM;
 
        nr = nr_sk(sk);
@@ -465,7 +466,8 @@ static struct sock *nr_make_new(struct sock *osk)
        if (osk->sk_type != SOCK_SEQPACKET)
                return NULL;
 
-       if ((sk = sk_alloc(osk->sk_net, PF_NETROM, GFP_ATOMIC, osk->sk_prot, 1)) == NULL)
+       sk = sk_alloc(osk->sk_net, PF_NETROM, GFP_ATOMIC, osk->sk_prot);
+       if (sk == NULL)
                return NULL;
 
        nr = nr_sk(sk);
index d0936506b731abf62d5fabffe289a44789c52768..8a7807dbba012bdc03b0b49a8a1f35a02e9ee288 100644 (file)
@@ -139,9 +139,6 @@ dev->hard_header == NULL (ll header is added by device, we cannot control it)
 static HLIST_HEAD(packet_sklist);
 static DEFINE_RWLOCK(packet_sklist_lock);
 
-static atomic_t packet_socks_nr;
-
-
 /* Private packet socket structures. */
 
 struct packet_mclist
@@ -236,10 +233,7 @@ static void packet_sock_destruct(struct sock *sk)
                return;
        }
 
-       atomic_dec(&packet_socks_nr);
-#ifdef PACKET_REFCNT_DEBUG
-       printk(KERN_DEBUG "PACKET socket %p is free, %d are alive\n", sk, atomic_read(&packet_socks_nr));
-#endif
+       sk_refcnt_debug_dec(sk);
 }
 
 
@@ -515,7 +509,7 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev, struct packet
        sll->sll_hatype = dev->type;
        sll->sll_protocol = skb->protocol;
        sll->sll_pkttype = skb->pkt_type;
-       if (unlikely(po->origdev) && skb->pkt_type == PACKET_HOST)
+       if (unlikely(po->origdev))
                sll->sll_ifindex = orig_dev->ifindex;
        else
                sll->sll_ifindex = dev->ifindex;
@@ -661,7 +655,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, struct packe
        sll->sll_hatype = dev->type;
        sll->sll_protocol = skb->protocol;
        sll->sll_pkttype = skb->pkt_type;
-       if (unlikely(po->origdev) && skb->pkt_type == PACKET_HOST)
+       if (unlikely(po->origdev))
                sll->sll_ifindex = orig_dev->ifindex;
        else
                sll->sll_ifindex = dev->ifindex;
@@ -849,6 +843,7 @@ static int packet_release(struct socket *sock)
        /* Purge queues */
 
        skb_queue_purge(&sk->sk_receive_queue);
+       sk_refcnt_debug_release(sk);
 
        sock_put(sk);
        return 0;
@@ -886,20 +881,14 @@ static int packet_do_bind(struct sock *sk, struct net_device *dev, __be16 protoc
        if (protocol == 0)
                goto out_unlock;
 
-       if (dev) {
-               if (dev->flags&IFF_UP) {
-                       dev_add_pack(&po->prot_hook);
-                       sock_hold(sk);
-                       po->running = 1;
-               } else {
-                       sk->sk_err = ENETDOWN;
-                       if (!sock_flag(sk, SOCK_DEAD))
-                               sk->sk_error_report(sk);
-               }
-       } else {
+       if (!dev || (dev->flags & IFF_UP)) {
                dev_add_pack(&po->prot_hook);
                sock_hold(sk);
                po->running = 1;
+       } else {
+               sk->sk_err = ENETDOWN;
+               if (!sock_flag(sk, SOCK_DEAD))
+                       sk->sk_error_report(sk);
        }
 
 out_unlock:
@@ -995,7 +984,7 @@ static int packet_create(struct net *net, struct socket *sock, int protocol)
        sock->state = SS_UNCONNECTED;
 
        err = -ENOBUFS;
-       sk = sk_alloc(net, PF_PACKET, GFP_KERNEL, &packet_proto, 1);
+       sk = sk_alloc(net, PF_PACKET, GFP_KERNEL, &packet_proto);
        if (sk == NULL)
                goto out;
 
@@ -1010,7 +999,7 @@ static int packet_create(struct net *net, struct socket *sock, int protocol)
        po->num = proto;
 
        sk->sk_destruct = packet_sock_destruct;
-       atomic_inc(&packet_socks_nr);
+       sk_refcnt_debug_inc(sk);
 
        /*
         *      Attach a protocol block
index 51d151c0e9621169730881d3867fa70e50e20042..73d60a307129110de0aec93b57c6fdacd76d1b88 100644 (file)
 #include <linux/mutex.h>
 #include <linux/rfkill.h>
 
+/* Get declaration of rfkill_switch_all() to shut up sparse. */
+#include "rfkill-input.h"
+
+
 MODULE_AUTHOR("Ivo van Doorn <IvDoorn@gmail.com>");
 MODULE_VERSION("1.0");
 MODULE_DESCRIPTION("RF switch support");
@@ -276,21 +280,17 @@ static struct class rfkill_class = {
 
 static int rfkill_add_switch(struct rfkill *rfkill)
 {
-       int retval;
-
-       retval = mutex_lock_interruptible(&rfkill_mutex);
-       if (retval)
-               return retval;
+       int error;
 
-       retval = rfkill_toggle_radio(rfkill, rfkill_states[rfkill->type]);
-       if (retval)
-               goto out;
+       mutex_lock(&rfkill_mutex);
 
-       list_add_tail(&rfkill->node, &rfkill_list);
+       error = rfkill_toggle_radio(rfkill, rfkill_states[rfkill->type]);
+       if (!error)
+               list_add_tail(&rfkill->node, &rfkill_list);
 
- out:
        mutex_unlock(&rfkill_mutex);
-       return retval;
+
+       return error;
 }
 
 static void rfkill_remove_switch(struct rfkill *rfkill)
@@ -387,20 +387,23 @@ int rfkill_register(struct rfkill *rfkill)
 
        if (!rfkill->toggle_radio)
                return -EINVAL;
+       if (rfkill->type >= RFKILL_TYPE_MAX)
+               return -EINVAL;
+
+       snprintf(dev->bus_id, sizeof(dev->bus_id),
+                "rfkill%ld", (long)atomic_inc_return(&rfkill_no) - 1);
+
+       rfkill_led_trigger_register(rfkill);
 
        error = rfkill_add_switch(rfkill);
        if (error)
                return error;
 
-       snprintf(dev->bus_id, sizeof(dev->bus_id),
-                "rfkill%ld", (long)atomic_inc_return(&rfkill_no) - 1);
-
        error = device_add(dev);
        if (error) {
                rfkill_remove_switch(rfkill);
                return error;
        }
-       rfkill_led_trigger_register(rfkill);
 
        return 0;
 }
@@ -416,9 +419,9 @@ EXPORT_SYMBOL(rfkill_register);
  */
 void rfkill_unregister(struct rfkill *rfkill)
 {
-       rfkill_led_trigger_unregister(rfkill);
        device_del(&rfkill->dev);
        rfkill_remove_switch(rfkill);
+       rfkill_led_trigger_unregister(rfkill);
        put_device(&rfkill->dev);
 }
 EXPORT_SYMBOL(rfkill_unregister);
@@ -448,5 +451,5 @@ static void __exit rfkill_exit(void)
        class_unregister(&rfkill_class);
 }
 
-module_init(rfkill_init);
+subsys_initcall(rfkill_init);
 module_exit(rfkill_exit);
index 509defe53ee53fb5b49f37c0b2372edfa83cc68b..ed2d65cd80106db4510bb708c8514ce4aa17fea6 100644 (file)
@@ -513,7 +513,8 @@ static int rose_create(struct net *net, struct socket *sock, int protocol)
        if (sock->type != SOCK_SEQPACKET || protocol != 0)
                return -ESOCKTNOSUPPORT;
 
-       if ((sk = sk_alloc(net, PF_ROSE, GFP_ATOMIC, &rose_proto, 1)) == NULL)
+       sk = sk_alloc(net, PF_ROSE, GFP_ATOMIC, &rose_proto);
+       if (sk == NULL)
                return -ENOMEM;
 
        rose = rose_sk(sk);
@@ -551,7 +552,8 @@ static struct sock *rose_make_new(struct sock *osk)
        if (osk->sk_type != SOCK_SEQPACKET)
                return NULL;
 
-       if ((sk = sk_alloc(osk->sk_net, PF_ROSE, GFP_ATOMIC, &rose_proto, 1)) == NULL)
+       sk = sk_alloc(osk->sk_net, PF_ROSE, GFP_ATOMIC, &rose_proto);
+       if (sk == NULL)
                return NULL;
 
        rose = rose_sk(sk);
index c680017f5c8e923f7b59a7d0fc146ed3d4351c8b..d6389450c4bffee0da440bccfbc49857fa258417 100644 (file)
@@ -627,7 +627,7 @@ static int rxrpc_create(struct net *net, struct socket *sock, int protocol)
        sock->ops = &rxrpc_rpc_ops;
        sock->state = SS_UNCONNECTED;
 
-       sk = sk_alloc(net, PF_RXRPC, GFP_KERNEL, &rxrpc_proto, 1);
+       sk = sk_alloc(net, PF_RXRPC, GFP_KERNEL, &rxrpc_proto);
        if (!sk)
                return -ENOMEM;
 
index fe03f71f17da8e440c99780150c509bcd411b14b..f3a2bd747a8f6f09aa4e3006d3ddd66e24a5d370 100644 (file)
@@ -114,7 +114,7 @@ static int rxrpc_create_local(struct rxrpc_local *local)
        return 0;
 
 error:
-       local->socket->ops->shutdown(local->socket, 2);
+       kernel_sock_shutdown(local->socket, SHUT_RDWR);
        local->socket->sk->sk_user_data = NULL;
        sock_release(local->socket);
        local->socket = NULL;
@@ -267,7 +267,7 @@ static void rxrpc_destroy_local(struct work_struct *work)
        /* finish cleaning up the local descriptor */
        rxrpc_purge_queue(&local->accept_queue);
        rxrpc_purge_queue(&local->reject_queue);
-       local->socket->ops->shutdown(local->socket, 2);
+       kernel_sock_shutdown(local->socket, SHUT_RDWR);
        sock_release(local->socket);
 
        up_read(&rxrpc_local_sem);
index eebefb6ef1392fef2c9b47007d141c299ee82b38..e09a95aa68ff7acf6cd98cf41947419a51c9f2d4 100644 (file)
@@ -237,7 +237,8 @@ static int rxkad_secure_packet_encrypt(const struct rxrpc_call *call,
        len = data_size + call->conn->size_align - 1;
        len &= ~(call->conn->size_align - 1);
 
-       sg_init_table(sg, skb_to_sgvec(skb, sg, 0, len));
+       sg_init_table(sg, nsg);
+       skb_to_sgvec(skb, sg, 0, len);
        crypto_blkcipher_encrypt_iv(&desc, sg, sg, len);
 
        _leave(" = 0");
@@ -344,7 +345,7 @@ static int rxkad_verify_packet_auth(const struct rxrpc_call *call,
                goto nomem;
 
        sg_init_table(sg, nsg);
-       sg_mark_end(sg, skb_to_sgvec(skb, sg, 0, 8));
+       skb_to_sgvec(skb, sg, 0, 8);
 
        /* start the decryption afresh */
        memset(&iv, 0, sizeof(iv));
@@ -426,7 +427,7 @@ static int rxkad_verify_packet_encrypt(const struct rxrpc_call *call,
        }
 
        sg_init_table(sg, nsg);
-       sg_mark_end(sg, skb_to_sgvec(skb, sg, 0, skb->len));
+       skb_to_sgvec(skb, sg, 0, skb->len);
 
        /* decrypt from the session key */
        payload = call->conn->key->payload.data;
@@ -701,7 +702,7 @@ static void rxkad_sg_set_buf2(struct scatterlist sg[2],
                nsg++;
        }
 
-       sg_mark_end(sg, nsg);
+       sg_mark_end(&sg[nsg - 1]);
 
        ASSERTCMP(sg[0].length + sg[1].length, ==, buflen);
 }
index 9e98c6e567dde518ba28b29ed7211cb6baac19de..c3900820916425f23fbbcc93db63151a9b81305b 100644 (file)
@@ -91,7 +91,7 @@ static struct tc_u_common *u32_list;
 
 static __inline__ unsigned u32_hash_fold(u32 key, struct tc_u32_sel *sel, u8 fshift)
 {
-       unsigned h = (key & sel->hmask)>>fshift;
+       unsigned h = ntohl(key & sel->hmask)>>fshift;
 
        return h;
 }
@@ -613,17 +613,7 @@ static int u32_change(struct tcf_proto *tp, unsigned long base, u32 handle,
        memcpy(&n->sel, s, sizeof(*s) + s->nkeys*sizeof(struct tc_u32_key));
        n->ht_up = ht;
        n->handle = handle;
-{
-       u8 i = 0;
-       u32 mask = s->hmask;
-       if (mask) {
-               while (!(mask & 1)) {
-                       i++;
-                       mask>>=1;
-               }
-       }
-       n->fshift = i;
-}
+       n->fshift = s->hmask ? ffs(ntohl(s->hmask)) - 1 : 0;
 
 #ifdef CONFIG_CLS_U32_MARK
        if (tb[TCA_U32_MARK-1]) {
index fa1a6f45dc416173f8b6d853f9ce0c5fa3565bc7..e595e6570ce054245c6f8e355b7612a01521526b 100644 (file)
@@ -134,7 +134,7 @@ static inline int qdisc_restart(struct net_device *dev)
 {
        struct Qdisc *q = dev->qdisc;
        struct sk_buff *skb;
-       int ret;
+       int ret = NETDEV_TX_BUSY;
 
        /* Dequeue packet */
        if (unlikely((skb = dev_dequeue_skb(dev, q)) == NULL))
@@ -145,7 +145,8 @@ static inline int qdisc_restart(struct net_device *dev)
        spin_unlock(&dev->queue_lock);
 
        HARD_TX_LOCK(dev, smp_processor_id());
-       ret = dev_hard_start_xmit(skb, dev);
+       if (!netif_subqueue_stopped(dev, skb))
+               ret = dev_hard_start_xmit(skb, dev);
        HARD_TX_UNLOCK(dev);
 
        spin_lock(&dev->queue_lock);
index 421281d9dd1d3f9103b17c71b68b0d927d3807da..c0ed06d4a5046516c1e67d2b8f15df2aca07ae8b 100644 (file)
@@ -252,6 +252,9 @@ __teql_resolve(struct sk_buff *skb, struct sk_buff *skb_res, struct net_device *
 static inline int teql_resolve(struct sk_buff *skb,
                               struct sk_buff *skb_res, struct net_device *dev)
 {
+       if (dev->qdisc == &noop_qdisc)
+               return -ENODEV;
+
        if (dev->header_ops == NULL ||
            skb->dst == NULL ||
            skb->dst->neighbour == NULL)
index 03158e3665da0b34786843104d4ab5f4b5fa4736..013e3d3ab0f1a6217868785c5d160b0acb0eacb8 100644 (file)
@@ -262,10 +262,14 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a
         */
        asoc->peer.sack_needed = 1;
 
-       /* Assume that the peer recongizes ASCONF until reported otherwise
-        * via an ERROR chunk.
+       /* Assume that the peer will tell us if he recognizes ASCONF
+        * as part of INIT exchange.
+        * The sctp_addip_noauth option is there for backward compatibilty
+        * and will revert old behavior.
         */
-       asoc->peer.asconf_capable = 1;
+       asoc->peer.asconf_capable = 0;
+       if (sctp_addip_noauth)
+               asoc->peer.asconf_capable = 1;
 
        /* Create an input queue.  */
        sctp_inq_init(&asoc->base.inqueue);
index 8af1004abefeb885a6ee10f4a12c2c939551e468..6d5fa6bb371b0ce2d85a77093092ac440d93684a 100644 (file)
@@ -556,7 +556,7 @@ struct sctp_hmac *sctp_auth_asoc_get_hmac(const struct sctp_association *asoc)
        return &sctp_hmac_list[id];
 }
 
-static int __sctp_auth_find_hmacid(__u16 *hmacs, int n_elts, __u16 hmac_id)
+static int __sctp_auth_find_hmacid(__be16 *hmacs, int n_elts, __be16 hmac_id)
 {
        int  found = 0;
        int  i;
@@ -573,7 +573,7 @@ static int __sctp_auth_find_hmacid(__u16 *hmacs, int n_elts, __u16 hmac_id)
 
 /* See if the HMAC_ID is one that we claim as supported */
 int sctp_auth_asoc_verify_hmac_id(const struct sctp_association *asoc,
-                                   __u16 hmac_id)
+                                   __be16 hmac_id)
 {
        struct sctp_hmac_algo_param *hmacs;
        __u16 n_elt;
index dfffa94fb9f636366616ca3e349ffcfee746f5cb..cae95af9a8cc147f2652c7b2a3c6c80880fd0f7a 100644 (file)
@@ -180,9 +180,7 @@ int sctp_add_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *new,
 /* Delete an address from the bind address list in the SCTP_bind_addr
  * structure.
  */
-int sctp_del_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *del_addr,
-                       void fastcall (*rcu_call)(struct rcu_head *head,
-                                        void (*func)(struct rcu_head *head)))
+int sctp_del_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *del_addr)
 {
        struct sctp_sockaddr_entry *addr, *temp;
 
@@ -198,15 +196,10 @@ int sctp_del_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *del_addr,
                }
        }
 
-       /* Call the rcu callback provided in the args.  This function is
-        * called by both BH packet processing and user side socket option
-        * processing, but it works on different lists in those 2 contexts.
-        * Each context provides it's own callback, whether call_rcu_bh()
-        * or call_rcu(), to make sure that we wait for an appropriate time.
-        */
        if (addr && !addr->valid) {
-               rcu_call(&addr->rcu, sctp_local_addr_free);
+               call_rcu(&addr->rcu, sctp_local_addr_free);
                SCTP_DBG_OBJCNT_DEC(addr);
+               return 0;
        }
 
        return -EINVAL;
index 2d2d81ef4a69011d89e3dcc9ecdc15ce35dc806b..de6f505d6ff8250291972d4e53c391dcf1548e57 100644 (file)
@@ -328,24 +328,35 @@ static struct sctp_association *__sctp_endpoint_lookup_assoc(
        const union sctp_addr *paddr,
        struct sctp_transport **transport)
 {
+       struct sctp_association *asoc = NULL;
+       struct sctp_transport *t = NULL;
+       struct sctp_hashbucket *head;
+       struct sctp_ep_common *epb;
+       struct hlist_node *node;
+       int hash;
        int rport;
-       struct sctp_association *asoc;
-       struct list_head *pos;
 
+       *transport = NULL;
        rport = ntohs(paddr->v4.sin_port);
 
-       list_for_each(pos, &ep->asocs) {
-               asoc = list_entry(pos, struct sctp_association, asocs);
-               if (rport == asoc->peer.port) {
-                       *transport = sctp_assoc_lookup_paddr(asoc, paddr);
-
-                       if (*transport)
-                               return asoc;
+       hash = sctp_assoc_hashfn(ep->base.bind_addr.port, rport);
+       head = &sctp_assoc_hashtable[hash];
+       read_lock(&head->lock);
+       sctp_for_each_hentry(epb, node, &head->chain) {
+               asoc = sctp_assoc(epb);
+               if (asoc->ep != ep || rport != asoc->peer.port)
+                       goto next;
+
+               t = sctp_assoc_lookup_paddr(asoc, paddr);
+               if (t) {
+                       *transport = t;
+                       break;
                }
+next:
+               asoc = NULL;
        }
-
-       *transport = NULL;
-       return NULL;
+       read_unlock(&head->lock);
+       return asoc;
 }
 
 /* Lookup association on an endpoint based on a peer address.  BH-safe.  */
index 86503e7fa21e7fa55bcb54f1762dc5840c11cdfe..91ae463b079b13bf62c89fa7d8e7529e7af85685 100644 (file)
@@ -656,7 +656,6 @@ discard:
 /* Insert endpoint into the hash table.  */
 static void __sctp_hash_endpoint(struct sctp_endpoint *ep)
 {
-       struct sctp_ep_common **epp;
        struct sctp_ep_common *epb;
        struct sctp_hashbucket *head;
 
@@ -666,12 +665,7 @@ static void __sctp_hash_endpoint(struct sctp_endpoint *ep)
        head = &sctp_ep_hashtable[epb->hashent];
 
        sctp_write_lock(&head->lock);
-       epp = &head->chain;
-       epb->next = *epp;
-       if (epb->next)
-               (*epp)->pprev = &epb->next;
-       *epp = epb;
-       epb->pprev = epp;
+       hlist_add_head(&epb->node, &head->chain);
        sctp_write_unlock(&head->lock);
 }
 
@@ -691,19 +685,15 @@ static void __sctp_unhash_endpoint(struct sctp_endpoint *ep)
 
        epb = &ep->base;
 
+       if (hlist_unhashed(&epb->node))
+               return;
+
        epb->hashent = sctp_ep_hashfn(epb->bind_addr.port);
 
        head = &sctp_ep_hashtable[epb->hashent];
 
        sctp_write_lock(&head->lock);
-
-       if (epb->pprev) {
-               if (epb->next)
-                       epb->next->pprev = epb->pprev;
-               *epb->pprev = epb->next;
-               epb->pprev = NULL;
-       }
-
+       __hlist_del(&epb->node);
        sctp_write_unlock(&head->lock);
 }
 
@@ -721,12 +711,13 @@ static struct sctp_endpoint *__sctp_rcv_lookup_endpoint(const union sctp_addr *l
        struct sctp_hashbucket *head;
        struct sctp_ep_common *epb;
        struct sctp_endpoint *ep;
+       struct hlist_node *node;
        int hash;
 
        hash = sctp_ep_hashfn(ntohs(laddr->v4.sin_port));
        head = &sctp_ep_hashtable[hash];
        read_lock(&head->lock);
-       for (epb = head->chain; epb; epb = epb->next) {
+       sctp_for_each_hentry(epb, node, &head->chain) {
                ep = sctp_ep(epb);
                if (sctp_endpoint_is_match(ep, laddr))
                        goto hit;
@@ -744,7 +735,6 @@ hit:
 /* Insert association into the hash table.  */
 static void __sctp_hash_established(struct sctp_association *asoc)
 {
-       struct sctp_ep_common **epp;
        struct sctp_ep_common *epb;
        struct sctp_hashbucket *head;
 
@@ -756,12 +746,7 @@ static void __sctp_hash_established(struct sctp_association *asoc)
        head = &sctp_assoc_hashtable[epb->hashent];
 
        sctp_write_lock(&head->lock);
-       epp = &head->chain;
-       epb->next = *epp;
-       if (epb->next)
-               (*epp)->pprev = &epb->next;
-       *epp = epb;
-       epb->pprev = epp;
+       hlist_add_head(&epb->node, &head->chain);
        sctp_write_unlock(&head->lock);
 }
 
@@ -790,14 +775,7 @@ static void __sctp_unhash_established(struct sctp_association *asoc)
        head = &sctp_assoc_hashtable[epb->hashent];
 
        sctp_write_lock(&head->lock);
-
-       if (epb->pprev) {
-               if (epb->next)
-                       epb->next->pprev = epb->pprev;
-               *epb->pprev = epb->next;
-               epb->pprev = NULL;
-       }
-
+       __hlist_del(&epb->node);
        sctp_write_unlock(&head->lock);
 }
 
@@ -822,6 +800,7 @@ static struct sctp_association *__sctp_lookup_association(
        struct sctp_ep_common *epb;
        struct sctp_association *asoc;
        struct sctp_transport *transport;
+       struct hlist_node *node;
        int hash;
 
        /* Optimize here for direct hit, only listening connections can
@@ -830,7 +809,7 @@ static struct sctp_association *__sctp_lookup_association(
        hash = sctp_assoc_hashfn(ntohs(local->v4.sin_port), ntohs(peer->v4.sin_port));
        head = &sctp_assoc_hashtable[hash];
        read_lock(&head->lock);
-       for (epb = head->chain; epb; epb = epb->next) {
+       sctp_for_each_hentry(epb, node, &head->chain) {
                asoc = sctp_assoc(epb);
                transport = sctp_assoc_is_match(asoc, local, peer);
                if (transport)
index f10fe7fbf24c425ca9609e46ed837d505a39552b..cf4b7eb023b3ba0819ce6d960128099c662360af 100644 (file)
@@ -90,6 +90,10 @@ void sctp_inq_free(struct sctp_inq *queue)
 void sctp_inq_push(struct sctp_inq *q, struct sctp_chunk *chunk)
 {
        /* Directly call the packet handling routine. */
+       if (chunk->rcvr->dead) {
+               sctp_chunk_free(chunk);
+               return;
+       }
 
        /* We are now calling this either from the soft interrupt
         * or from the backlog processing.
index eb4deaf589148dbf7a8797449f34439779da4a63..7f31ff638bc63fd521bd84ec4ca901451e832fe5 100644 (file)
@@ -631,7 +631,7 @@ static struct sock *sctp_v6_create_accept_sk(struct sock *sk,
        struct ipv6_pinfo *newnp, *np = inet6_sk(sk);
        struct sctp6_sock *newsctp6sk;
 
-       newsk = sk_alloc(sk->sk_net, PF_INET6, GFP_KERNEL, sk->sk_prot, 1);
+       newsk = sk_alloc(sk->sk_net, PF_INET6, GFP_KERNEL, sk->sk_prot);
        if (!newsk)
                goto out;
 
index 28f4fe77ceee2e44e9b2e29eefd2be632464c331..fa76f235169bfac3cedcb8517d4c62b0cd8daa5c 100644 (file)
@@ -382,7 +382,7 @@ static void sctp_insert_list(struct list_head *head, struct list_head *new)
 /* Mark all the eligible packets on a transport for retransmission.  */
 void sctp_retransmit_mark(struct sctp_outq *q,
                          struct sctp_transport *transport,
-                         __u8 fast_retransmit)
+                         __u8 reason)
 {
        struct list_head *lchunk, *ltemp;
        struct sctp_chunk *chunk;
@@ -412,20 +412,20 @@ void sctp_retransmit_mark(struct sctp_outq *q,
                        continue;
                }
 
-               /* If we are doing retransmission due to a fast retransmit,
-                * only the chunk's that are marked for fast retransmit
-                * should be added to the retransmit queue.  If we are doing
-                * retransmission due to a timeout or pmtu discovery, only the
-                * chunks that are not yet acked should be added to the
-                * retransmit queue.
+               /* If we are doing  retransmission due to a timeout or pmtu
+                * discovery, only the  chunks that are not yet acked should
+                * be added to the retransmit queue.
                 */
-               if ((fast_retransmit && (chunk->fast_retransmit > 0)) ||
-                  (!fast_retransmit && !chunk->tsn_gap_acked)) {
+               if ((reason == SCTP_RTXR_FAST_RTX  &&
+                           (chunk->fast_retransmit > 0)) ||
+                   (reason != SCTP_RTXR_FAST_RTX  && !chunk->tsn_gap_acked)) {
                        /* If this chunk was sent less then 1 rto ago, do not
                         * retransmit this chunk, but give the peer time
-                        * to acknowlege it.
+                        * to acknowlege it.  Do this only when
+                        * retransmitting due to T3 timeout.
                         */
-                       if ((jiffies - chunk->sent_at) < transport->rto)
+                       if (reason == SCTP_RTXR_T3_RTX &&
+                           (jiffies - chunk->sent_at) < transport->last_rto)
                                continue;
 
                        /* RFC 2960 6.2.1 Processing a Received SACK
@@ -467,10 +467,10 @@ void sctp_retransmit_mark(struct sctp_outq *q,
                }
        }
 
-       SCTP_DEBUG_PRINTK("%s: transport: %p, fast_retransmit: %d, "
+       SCTP_DEBUG_PRINTK("%s: transport: %p, reason: %d, "
                          "cwnd: %d, ssthresh: %d, flight_size: %d, "
                          "pba: %d\n", __FUNCTION__,
-                         transport, fast_retransmit,
+                         transport, reason,
                          transport->cwnd, transport->ssthresh,
                          transport->flight_size,
                          transport->partial_bytes_acked);
@@ -484,7 +484,6 @@ void sctp_retransmit(struct sctp_outq *q, struct sctp_transport *transport,
                     sctp_retransmit_reason_t reason)
 {
        int error = 0;
-       __u8 fast_retransmit = 0;
 
        switch(reason) {
        case SCTP_RTXR_T3_RTX:
@@ -499,16 +498,18 @@ void sctp_retransmit(struct sctp_outq *q, struct sctp_transport *transport,
        case SCTP_RTXR_FAST_RTX:
                SCTP_INC_STATS(SCTP_MIB_FAST_RETRANSMITS);
                sctp_transport_lower_cwnd(transport, SCTP_LOWER_CWND_FAST_RTX);
-               fast_retransmit = 1;
                break;
        case SCTP_RTXR_PMTUD:
                SCTP_INC_STATS(SCTP_MIB_PMTUD_RETRANSMITS);
                break;
+       case SCTP_RTXR_T1_RTX:
+               SCTP_INC_STATS(SCTP_MIB_T1_RETRANSMITS);
+               break;
        default:
                BUG();
        }
 
-       sctp_retransmit_mark(q, transport, fast_retransmit);
+       sctp_retransmit_mark(q, transport, reason);
 
        /* PR-SCTP A5) Any time the T3-rtx timer expires, on any destination,
         * the sender SHOULD try to advance the "Advanced.Peer.Ack.Point" by
@@ -641,7 +642,8 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt,
 
                /* If we are here due to a retransmit timeout or a fast
                 * retransmit and if there are any chunks left in the retransmit
-                * queue that could not fit in the PMTU sized packet, they need                  * to be marked as ineligible for a subsequent fast retransmit.
+                * queue that could not fit in the PMTU sized packet, they need
+                * to be marked as ineligible for a subsequent fast retransmit.
                 */
                if (rtx_timeout && !lchunk) {
                        list_for_each(lchunk1, lqueue) {
@@ -660,10 +662,9 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt,
 int sctp_outq_uncork(struct sctp_outq *q)
 {
        int error = 0;
-       if (q->cork) {
+       if (q->cork)
                q->cork = 0;
-               error = sctp_outq_flush(q, 0);
-       }
+       error = sctp_outq_flush(q, 0);
        return error;
 }
 
index e4cd841a22e478793e85e2701dc4da30b60db4b7..249973204070bfb811085b3b2ce988b7dc093128 100644 (file)
@@ -225,6 +225,7 @@ static int sctp_eps_seq_show(struct seq_file *seq, void *v)
        struct sctp_ep_common *epb;
        struct sctp_endpoint *ep;
        struct sock *sk;
+       struct hlist_node *node;
        int    hash = *(loff_t *)v;
 
        if (hash >= sctp_ep_hashsize)
@@ -233,7 +234,7 @@ static int sctp_eps_seq_show(struct seq_file *seq, void *v)
        head = &sctp_ep_hashtable[hash];
        sctp_local_bh_disable();
        read_lock(&head->lock);
-       for (epb = head->chain; epb; epb = epb->next) {
+       sctp_for_each_hentry(epb, node, &head->chain) {
                ep = sctp_ep(epb);
                sk = epb->sk;
                seq_printf(seq, "%8p %8p %-3d %-3d %-4d %-5d %5d %5lu ", ep, sk,
@@ -328,6 +329,7 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v)
        struct sctp_ep_common *epb;
        struct sctp_association *assoc;
        struct sock *sk;
+       struct hlist_node *node;
        int    hash = *(loff_t *)v;
 
        if (hash >= sctp_assoc_hashsize)
@@ -336,7 +338,7 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v)
        head = &sctp_assoc_hashtable[hash];
        sctp_local_bh_disable();
        read_lock(&head->lock);
-       for (epb = head->chain; epb; epb = epb->next) {
+       sctp_for_each_hentry(epb, node, &head->chain) {
                assoc = sctp_assoc(epb);
                sk = epb->sk;
                seq_printf(seq,
index f5cd96f5fe7421fbee8afcb33e0f558e99877e2a..d50f610d1b02a4b44ffde9dee0d651f5d01fa49e 100644 (file)
@@ -552,7 +552,8 @@ static struct sock *sctp_v4_create_accept_sk(struct sock *sk,
 {
        struct inet_sock *inet = inet_sk(sk);
        struct inet_sock *newinet;
-       struct sock *newsk = sk_alloc(sk->sk_net, PF_INET, GFP_KERNEL, sk->sk_prot, 1);
+       struct sock *newsk = sk_alloc(sk->sk_net, PF_INET, GFP_KERNEL,
+                       sk->sk_prot);
 
        if (!newsk)
                goto out;
@@ -1136,7 +1137,7 @@ SCTP_STATIC __init int sctp_init(void)
        }
        for (i = 0; i < sctp_assoc_hashsize; i++) {
                rwlock_init(&sctp_assoc_hashtable[i].lock);
-               sctp_assoc_hashtable[i].chain = NULL;
+               INIT_HLIST_HEAD(&sctp_assoc_hashtable[i].chain);
        }
 
        /* Allocate and initialize the endpoint hash table.  */
@@ -1150,7 +1151,7 @@ SCTP_STATIC __init int sctp_init(void)
        }
        for (i = 0; i < sctp_ep_hashsize; i++) {
                rwlock_init(&sctp_ep_hashtable[i].lock);
-               sctp_ep_hashtable[i].chain = NULL;
+               INIT_HLIST_HEAD(&sctp_ep_hashtable[i].chain);
        }
 
        /* Allocate and initialize the SCTP port hash table.  */
@@ -1169,7 +1170,7 @@ SCTP_STATIC __init int sctp_init(void)
        }
        for (i = 0; i < sctp_port_hashsize; i++) {
                spin_lock_init(&sctp_port_hashtable[i].lock);
-               sctp_port_hashtable[i].chain = NULL;
+               INIT_HLIST_HEAD(&sctp_port_hashtable[i].chain);
        }
 
        printk(KERN_INFO "SCTP: Hash tables configured "
@@ -1178,6 +1179,7 @@ SCTP_STATIC __init int sctp_init(void)
 
        /* Disable ADDIP by default. */
        sctp_addip_enable = 0;
+       sctp_addip_noauth = 0;
 
        /* Enable PR-SCTP by default. */
        sctp_prsctp_enable = 1;
index c377e4e8f6533486ece6de765d0303b7bfa7f6fa..5a9783c38de160c40d66894dbefab7b6e4c76f1c 100644 (file)
@@ -1788,9 +1788,14 @@ static int sctp_process_inv_paramlength(const struct sctp_association *asoc,
                                                sizeof(sctp_paramhdr_t);
 
 
+       /* This is a fatal error.  Any accumulated non-fatal errors are
+        * not reported.
+        */
+       if (*errp)
+               sctp_chunk_free(*errp);
+
        /* Create an error chunk and fill it in with our payload. */
-       if (!*errp)
-               *errp = sctp_make_op_error_space(asoc, chunk, payload_len);
+       *errp = sctp_make_op_error_space(asoc, chunk, payload_len);
 
        if (*errp) {
                sctp_init_cause(*errp, SCTP_ERROR_PROTO_VIOLATION,
@@ -1813,9 +1818,15 @@ static int sctp_process_hn_param(const struct sctp_association *asoc,
 {
        __u16 len = ntohs(param.p->length);
 
-       /* Make an ERROR chunk. */
-       if (!*errp)
-               *errp = sctp_make_op_error_space(asoc, chunk, len);
+       /* Processing of the HOST_NAME parameter will generate an
+        * ABORT.  If we've accumulated any non-fatal errors, they
+        * would be unrecognized parameters and we should not include
+        * them in the ABORT.
+        */
+       if (*errp)
+               sctp_chunk_free(*errp);
+
+       *errp = sctp_make_op_error_space(asoc, chunk, len);
 
        if (*errp) {
                sctp_init_cause(*errp, SCTP_ERROR_DNS_FAILED, len);
@@ -1847,7 +1858,7 @@ static void sctp_process_ext_param(struct sctp_association *asoc,
                            break;
                    case SCTP_CID_ASCONF:
                    case SCTP_CID_ASCONF_ACK:
-                           asoc->peer.addip_capable = 1;
+                           asoc->peer.asconf_capable = 1;
                            break;
                    default:
                            break;
@@ -1862,56 +1873,40 @@ static void sctp_process_ext_param(struct sctp_association *asoc,
  * taken if the processing endpoint does not recognize the
  * Parameter Type.
  *
- * 00 - Stop processing this SCTP chunk and discard it,
- *     do not process any further chunks within it.
+ * 00 - Stop processing this parameter; do not process any further
+ *     parameters within this chunk
  *
- * 01 - Stop processing this SCTP chunk and discard it,
- *     do not process any further chunks within it, and report
- *     the unrecognized parameter in an 'Unrecognized
- *     Parameter Type' (in either an ERROR or in the INIT ACK).
+ * 01 - Stop processing this parameter, do not process any further
+ *     parameters within this chunk, and report the unrecognized
+ *     parameter in an 'Unrecognized Parameter' ERROR chunk.
  *
  * 10 - Skip this parameter and continue processing.
  *
  * 11 - Skip this parameter and continue processing but
  *     report the unrecognized parameter in an
- *     'Unrecognized Parameter Type' (in either an ERROR or in
- *     the INIT ACK).
+ *     'Unrecognized Parameter' ERROR chunk.
  *
  * Return value:
- *     0 - discard the chunk
- *     1 - continue with the chunk
+ *     SCTP_IERROR_NO_ERROR - continue with the chunk
+ *     SCTP_IERROR_ERROR    - stop and report an error.
+ *     SCTP_IERROR_NOMEME   - out of memory.
  */
-static int sctp_process_unk_param(const struct sctp_association *asoc,
-                                 union sctp_params param,
-                                 struct sctp_chunk *chunk,
-                                 struct sctp_chunk **errp)
+static sctp_ierror_t sctp_process_unk_param(const struct sctp_association *asoc,
+                                           union sctp_params param,
+                                           struct sctp_chunk *chunk,
+                                           struct sctp_chunk **errp)
 {
-       int retval = 1;
+       int retval = SCTP_IERROR_NO_ERROR;
 
        switch (param.p->type & SCTP_PARAM_ACTION_MASK) {
        case SCTP_PARAM_ACTION_DISCARD:
-               retval =  0;
-               break;
-       case SCTP_PARAM_ACTION_DISCARD_ERR:
-               retval =  0;
-               /* Make an ERROR chunk, preparing enough room for
-                * returning multiple unknown parameters.
-                */
-               if (NULL == *errp)
-                       *errp = sctp_make_op_error_space(asoc, chunk,
-                                       ntohs(chunk->chunk_hdr->length));
-
-               if (*errp) {
-                       sctp_init_cause(*errp, SCTP_ERROR_UNKNOWN_PARAM,
-                                       WORD_ROUND(ntohs(param.p->length)));
-                       sctp_addto_chunk(*errp,
-                                       WORD_ROUND(ntohs(param.p->length)),
-                                       param.v);
-               }
-
+               retval =  SCTP_IERROR_ERROR;
                break;
        case SCTP_PARAM_ACTION_SKIP:
                break;
+       case SCTP_PARAM_ACTION_DISCARD_ERR:
+               retval =  SCTP_IERROR_ERROR;
+               /* Fall through */
        case SCTP_PARAM_ACTION_SKIP_ERR:
                /* Make an ERROR chunk, preparing enough room for
                 * returning multiple unknown parameters.
@@ -1932,9 +1927,8 @@ static int sctp_process_unk_param(const struct sctp_association *asoc,
                         * to the peer and the association won't be
                         * established.
                         */
-                       retval = 0;
+                       retval = SCTP_IERROR_NOMEM;
                }
-
                break;
        default:
                break;
@@ -1943,18 +1937,20 @@ static int sctp_process_unk_param(const struct sctp_association *asoc,
        return retval;
 }
 
-/* Find unrecognized parameters in the chunk.
+/* Verify variable length parameters
  * Return values:
- *     0 - discard the chunk
- *     1 - continue with the chunk
+ *     SCTP_IERROR_ABORT - trigger an ABORT
+ *     SCTP_IERROR_NOMEM - out of memory (abort)
+ *     SCTP_IERROR_ERROR - stop processing, trigger an ERROR
+ *     SCTP_IERROR_NO_ERROR - continue with the chunk
  */
-static int sctp_verify_param(const struct sctp_association *asoc,
-                            union sctp_params param,
-                            sctp_cid_t cid,
-                            struct sctp_chunk *chunk,
-                            struct sctp_chunk **err_chunk)
+static sctp_ierror_t sctp_verify_param(const struct sctp_association *asoc,
+                                       union sctp_params param,
+                                       sctp_cid_t cid,
+                                       struct sctp_chunk *chunk,
+                                       struct sctp_chunk **err_chunk)
 {
-       int retval = 1;
+       int retval = SCTP_IERROR_NO_ERROR;
 
        /* FIXME - This routine is not looking at each parameter per the
         * chunk type, i.e., unrecognized parameters should be further
@@ -1976,7 +1972,9 @@ static int sctp_verify_param(const struct sctp_association *asoc,
 
        case SCTP_PARAM_HOST_NAME_ADDRESS:
                /* Tell the peer, we won't support this param.  */
-               return sctp_process_hn_param(asoc, param, chunk, err_chunk);
+               sctp_process_hn_param(asoc, param, chunk, err_chunk);
+               retval = SCTP_IERROR_ABORT;
+               break;
 
        case SCTP_PARAM_FWD_TSN_SUPPORT:
                if (sctp_prsctp_enable)
@@ -1993,9 +1991,11 @@ static int sctp_verify_param(const struct sctp_association *asoc,
                 * cause 'Protocol Violation'.
                 */
                if (SCTP_AUTH_RANDOM_LENGTH !=
-                       ntohs(param.p->length) - sizeof(sctp_paramhdr_t))
-                       return sctp_process_inv_paramlength(asoc, param.p,
+                       ntohs(param.p->length) - sizeof(sctp_paramhdr_t)) {
+                       sctp_process_inv_paramlength(asoc, param.p,
                                                        chunk, err_chunk);
+                       retval = SCTP_IERROR_ABORT;
+               }
                break;
 
        case SCTP_PARAM_CHUNKS:
@@ -2007,9 +2007,11 @@ static int sctp_verify_param(const struct sctp_association *asoc,
                 *  INIT-ACK chunk if the sender wants to receive authenticated
                 *  chunks.  Its maximum length is 260 bytes.
                 */
-               if (260 < ntohs(param.p->length))
-                       return sctp_process_inv_paramlength(asoc, param.p,
-                                                       chunk, err_chunk);
+               if (260 < ntohs(param.p->length)) {
+                       sctp_process_inv_paramlength(asoc, param.p,
+                                                    chunk, err_chunk);
+                       retval = SCTP_IERROR_ABORT;
+               }
                break;
 
        case SCTP_PARAM_HMAC_ALGO:
@@ -2020,8 +2022,7 @@ fallthrough:
        default:
                SCTP_DEBUG_PRINTK("Unrecognized param: %d for chunk %d.\n",
                                ntohs(param.p->type), cid);
-               return sctp_process_unk_param(asoc, param, chunk, err_chunk);
-
+               retval = sctp_process_unk_param(asoc, param, chunk, err_chunk);
                break;
        }
        return retval;
@@ -2036,6 +2037,7 @@ int sctp_verify_init(const struct sctp_association *asoc,
 {
        union sctp_params param;
        int has_cookie = 0;
+       int result;
 
        /* Verify stream values are non-zero. */
        if ((0 == peer_init->init_hdr.num_outbound_streams) ||
@@ -2043,8 +2045,7 @@ int sctp_verify_init(const struct sctp_association *asoc,
            (0 == peer_init->init_hdr.init_tag) ||
            (SCTP_DEFAULT_MINWINDOW > ntohl(peer_init->init_hdr.a_rwnd))) {
 
-               sctp_process_inv_mandatory(asoc, chunk, errp);
-               return 0;
+               return sctp_process_inv_mandatory(asoc, chunk, errp);
        }
 
        /* Check for missing mandatory parameters.  */
@@ -2062,29 +2063,29 @@ int sctp_verify_init(const struct sctp_association *asoc,
         * VIOLATION error.  We build the ERROR chunk here and let the normal
         * error handling code build and send the packet.
         */
-       if (param.v != (void*)chunk->chunk_end) {
-               sctp_process_inv_paramlength(asoc, param.p, chunk, errp);
-               return 0;
-       }
+       if (param.v != (void*)chunk->chunk_end)
+               return sctp_process_inv_paramlength(asoc, param.p, chunk, errp);
 
        /* The only missing mandatory param possible today is
         * the state cookie for an INIT-ACK chunk.
         */
-       if ((SCTP_CID_INIT_ACK == cid) && !has_cookie) {
-               sctp_process_missing_param(asoc, SCTP_PARAM_STATE_COOKIE,
-                                          chunk, errp);
-               return 0;
-       }
-
-       /* Find unrecognized parameters. */
+       if ((SCTP_CID_INIT_ACK == cid) && !has_cookie)
+               return sctp_process_missing_param(asoc, SCTP_PARAM_STATE_COOKIE,
+                                                 chunk, errp);
 
+       /* Verify all the variable length parameters */
        sctp_walk_params(param, peer_init, init_hdr.params) {
 
-               if (!sctp_verify_param(asoc, param, cid, chunk, errp)) {
-                       if (SCTP_PARAM_HOST_NAME_ADDRESS == param.p->type)
+               result = sctp_verify_param(asoc, param, cid, chunk, errp);
+               switch (result) {
+                   case SCTP_IERROR_ABORT:
+                   case SCTP_IERROR_NOMEM:
                                return 0;
-                       else
+                   case SCTP_IERROR_ERROR:
                                return 1;
+                   case SCTP_IERROR_NO_ERROR:
+                   default:
+                               break;
                }
 
        } /* for (loop through all parameters) */
@@ -2137,11 +2138,14 @@ int sctp_process_init(struct sctp_association *asoc, sctp_cid_t cid,
 
        /* If the peer claims support for ADD-IP without support
         * for AUTH, disable support for ADD-IP.
+        * Do this only if backward compatible mode is turned off.
         */
-       if (asoc->peer.addip_capable && !asoc->peer.auth_capable) {
+       if (!sctp_addip_noauth &&
+            (asoc->peer.asconf_capable && !asoc->peer.auth_capable)) {
                asoc->peer.addip_disabled_mask |= (SCTP_PARAM_ADD_IP |
                                                  SCTP_PARAM_DEL_IP |
                                                  SCTP_PARAM_SET_PRIMARY);
+               asoc->peer.asconf_capable = 0;
        }
 
        /* Walk list of transports, removing transports in the UNKNOWN state. */
@@ -2848,10 +2852,11 @@ struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc,
 
        __be16  err_code;
        int     length = 0;
-       int     chunk_len = asconf->skb->len;
+       int     chunk_len;
        __u32   serial;
        int     all_param_pass = 1;
 
+       chunk_len = ntohs(asconf->chunk_hdr->length) - sizeof(sctp_chunkhdr_t);
        hdr = (sctp_addiphdr_t *)asconf->skb->data;
        serial = ntohl(hdr->serial);
 
@@ -2952,13 +2957,17 @@ static int sctp_asconf_param_success(struct sctp_association *asoc,
                /* This is always done in BH context with a socket lock
                 * held, so the list can not change.
                 */
+               local_bh_disable();
                list_for_each_entry(saddr, &bp->address_list, list) {
                        if (sctp_cmp_addr_exact(&saddr->a, &addr))
                                saddr->use_as_src = 1;
                }
+               local_bh_enable();
                break;
        case SCTP_PARAM_DEL_IP:
-               retval = sctp_del_bind_addr(bp, &addr, call_rcu_bh);
+               local_bh_disable();
+               retval = sctp_del_bind_addr(bp, &addr);
+               local_bh_enable();
                list_for_each(pos, &asoc->peer.transport_addr_list) {
                        transport = list_entry(pos, struct sctp_transport,
                                                 transports);
@@ -2990,7 +2999,7 @@ static __be16 sctp_get_asconf_response(struct sctp_chunk *asconf_ack,
        sctp_addip_param_t      *asconf_ack_param;
        sctp_errhdr_t           *err_param;
        int                     length;
-       int                     asconf_ack_len = asconf_ack->skb->len;
+       int                     asconf_ack_len;
        __be16                  err_code;
 
        if (no_err)
@@ -2998,6 +3007,9 @@ static __be16 sctp_get_asconf_response(struct sctp_chunk *asconf_ack,
        else
                err_code = SCTP_ERROR_REQ_REFUSED;
 
+       asconf_ack_len = ntohs(asconf_ack->chunk_hdr->length) -
+                            sizeof(sctp_chunkhdr_t);
+
        /* Skip the addiphdr from the asconf_ack chunk and store a pointer to
         * the first asconf_ack parameter.
         */
index bbdc938da86fa37166866b27cd37fe2aa25efd05..78d1a8a49bd05bf53f4f58426d6ad4c7b0d498a0 100644 (file)
@@ -453,6 +453,7 @@ static void sctp_do_8_2_transport_strike(struct sctp_association *asoc,
         * maximum value discussed in rule C7 above (RTO.max) may be
         * used to provide an upper bound to this doubling operation.
         */
+       transport->last_rto = transport->rto;
        transport->rto = min((transport->rto * 2), transport->asoc->rto_max);
 }
 
@@ -1267,6 +1268,12 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
                        sctp_ootb_pkt_free(packet);
                        break;
 
+               case SCTP_CMD_T1_RETRAN:
+                       /* Mark a transport for retransmission.  */
+                       sctp_retransmit(&asoc->outqueue, cmd->obj.transport,
+                                       SCTP_RTXR_T1_RTX);
+                       break;
+
                case SCTP_CMD_RETRAN:
                        /* Mark a transport for retransmission.  */
                        sctp_retransmit(&asoc->outqueue, cmd->obj.transport,
@@ -1393,7 +1400,8 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
                        list_for_each(pos, &asoc->peer.transport_addr_list) {
                                t = list_entry(pos, struct sctp_transport,
                                               transports);
-                               sctp_retransmit_mark(&asoc->outqueue, t, 0);
+                               sctp_retransmit_mark(&asoc->outqueue, t,
+                                           SCTP_RTXR_T1_RTX);
                        }
 
                        sctp_add_cmd_sf(commands,
index f01b408508ff6144b94851f1a67ae09c7a7953d4..b8bbb960723cd98ee09cad4c798e0f286f3f646a 100644 (file)
@@ -1146,7 +1146,7 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep,
        /* Check if the timestamp looks valid.  */
        if (time_after(hbinfo->sent_at, jiffies) ||
            time_after(jiffies, hbinfo->sent_at + max_interval)) {
-               SCTP_DEBUG_PRINTK("%s: HEARTBEAT ACK with invalid timestamp"
+               SCTP_DEBUG_PRINTK("%s: HEARTBEAT ACK with invalid timestamp "
                                  "received for transport: %p\n",
                                   __FUNCTION__, link);
                return SCTP_DISPOSITION_DISCARD;
@@ -2305,7 +2305,7 @@ static sctp_disposition_t sctp_sf_do_5_2_6_stale(const struct sctp_endpoint *ep,
        /* If we've sent any data bundled with COOKIE-ECHO we will need to
         * resend
         */
-       sctp_add_cmd_sf(commands, SCTP_CMD_RETRAN,
+       sctp_add_cmd_sf(commands, SCTP_CMD_T1_RETRAN,
                        SCTP_TRANSPORT(asoc->peer.primary_path));
 
        /* Cast away the const modifier, as we want to just
@@ -4064,11 +4064,6 @@ static sctp_disposition_t sctp_sf_abort_violation(
        struct sctp_chunk *chunk =  arg;
        struct sctp_chunk *abort = NULL;
 
-       /* Make the abort chunk. */
-       abort = sctp_make_abort_violation(asoc, chunk, payload, paylen);
-       if (!abort)
-               goto nomem;
-
        /* SCTP-AUTH, Section 6.3:
         *    It should be noted that if the receiver wants to tear
         *    down an association in an authenticated way only, the
@@ -4083,6 +4078,11 @@ static sctp_disposition_t sctp_sf_abort_violation(
        if (sctp_auth_recv_cid(SCTP_CID_ABORT, asoc))
                goto discard;
 
+       /* Make the abort chunk. */
+       abort = sctp_make_abort_violation(asoc, chunk, payload, paylen);
+       if (!abort)
+               goto nomem;
+
        if (asoc) {
                sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(abort));
                SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS);
index bd6f42a15a4b9d85336396ef680d7bec78912986..ff8bc95670edbfa6af9ece6d74d2dc656a9c3cba 100644 (file)
@@ -660,7 +660,7 @@ static int sctp_bindx_rem(struct sock *sk, struct sockaddr *addrs, int addrcnt)
                 * socket routing and failover schemes. Refer to comments in
                 * sctp_do_bind(). -daisy
                 */
-               retval = sctp_del_bind_addr(bp, sa_addr, call_rcu);
+               retval = sctp_del_bind_addr(bp, sa_addr);
 
                addr_buf += af->sockaddr_len;
 err_bindx_rem:
@@ -5307,6 +5307,7 @@ static long sctp_get_port_local(struct sock *sk, union sctp_addr *addr)
 {
        struct sctp_bind_hashbucket *head; /* hash list */
        struct sctp_bind_bucket *pp; /* hash list port iterator */
+       struct hlist_node *node;
        unsigned short snum;
        int ret;
 
@@ -5331,7 +5332,7 @@ static long sctp_get_port_local(struct sock *sk, union sctp_addr *addr)
                        index = sctp_phashfn(rover);
                        head = &sctp_port_hashtable[index];
                        sctp_spin_lock(&head->lock);
-                       for (pp = head->chain; pp; pp = pp->next)
+                       sctp_for_each_hentry(pp, node, &head->chain)
                                if (pp->port == rover)
                                        goto next;
                        break;
@@ -5358,7 +5359,7 @@ static long sctp_get_port_local(struct sock *sk, union sctp_addr *addr)
                 */
                head = &sctp_port_hashtable[sctp_phashfn(snum)];
                sctp_spin_lock(&head->lock);
-               for (pp = head->chain; pp; pp = pp->next) {
+               sctp_for_each_hentry(pp, node, &head->chain) {
                        if (pp->port == snum)
                                goto pp_found;
                }
@@ -5702,10 +5703,7 @@ static struct sctp_bind_bucket *sctp_bucket_create(
                pp->port = snum;
                pp->fastreuse = 0;
                INIT_HLIST_HEAD(&pp->owner);
-               if ((pp->next = head->chain) != NULL)
-                       pp->next->pprev = &pp->next;
-               head->chain = pp;
-               pp->pprev = &head->chain;
+               hlist_add_head(&pp->node, &head->chain);
        }
        return pp;
 }
@@ -5714,9 +5712,7 @@ static struct sctp_bind_bucket *sctp_bucket_create(
 static void sctp_bucket_destroy(struct sctp_bind_bucket *pp)
 {
        if (pp && hlist_empty(&pp->owner)) {
-               if (pp->next)
-                       pp->next->pprev = pp->pprev;
-               *(pp->pprev) = pp->next;
+               __hlist_del(&pp->node);
                kmem_cache_free(sctp_bucket_cachep, pp);
                SCTP_DBG_OBJCNT_DEC(bind_bucket);
        }
@@ -6455,6 +6451,8 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk,
 }
 
 
+DEFINE_PROTO_INUSE(sctp)
+
 /* This proto struct describes the ULP interface for SCTP.  */
 struct proto sctp_prot = {
        .name        =  "SCTP",
@@ -6483,9 +6481,12 @@ struct proto sctp_prot = {
        .memory_pressure = &sctp_memory_pressure,
        .enter_memory_pressure = sctp_enter_memory_pressure,
        .memory_allocated = &sctp_memory_allocated,
+       REF_PROTO_INUSE(sctp)
 };
 
 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
+DEFINE_PROTO_INUSE(sctpv6)
+
 struct proto sctpv6_prot = {
        .name           = "SCTPv6",
        .owner          = THIS_MODULE,
@@ -6513,5 +6514,6 @@ struct proto sctpv6_prot = {
        .memory_pressure = &sctp_memory_pressure,
        .enter_memory_pressure = sctp_enter_memory_pressure,
        .memory_allocated = &sctp_memory_allocated,
+       REF_PROTO_INUSE(sctpv6)
 };
 #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */
index 0669778e4335aeb22911315882084b6189612ff5..da4f15734fb11f4e739059d5d0be49300ca3bbe8 100644 (file)
@@ -263,6 +263,15 @@ static ctl_table sctp_table[] = {
                .proc_handler   = &proc_dointvec,
                .strategy       = &sysctl_intvec
        },
+       {
+               .ctl_name       = CTL_UNNUMBERED,
+               .procname       = "addip_noauth_enable",
+               .data           = &sctp_addip_noauth,
+               .maxlen         = sizeof(int),
+               .mode           = 0644,
+               .proc_handler   = &proc_dointvec,
+               .strategy       = &sysctl_intvec
+       },
        { .ctl_name = 0 }
 };
 
index 5f467c914f8025fe595cf2a87bc355308abb587f..d55ce83a020b7a32059b92758afa790e4d912e4e 100644 (file)
@@ -74,8 +74,8 @@ static struct sctp_transport *sctp_transport_init(struct sctp_transport *peer,
         * given destination transport address, set RTO to the protocol
         * parameter 'RTO.Initial'.
         */
+       peer->last_rto = peer->rto = msecs_to_jiffies(sctp_rto_initial);
        peer->rtt = 0;
-       peer->rto = msecs_to_jiffies(sctp_rto_initial);
        peer->rttvar = 0;
        peer->srtt = 0;
        peer->rto_pending = 0;
@@ -385,6 +385,7 @@ void sctp_transport_update_rto(struct sctp_transport *tp, __u32 rtt)
                tp->rto = tp->asoc->rto_max;
 
        tp->rtt = rtt;
+       tp->last_rto = tp->rto;
 
        /* Reset rto_pending so that a new RTT measurement is started when a
         * new data chunk is sent.
@@ -578,7 +579,7 @@ void sctp_transport_reset(struct sctp_transport *t)
         */
        t->cwnd = min(4*asoc->pathmtu, max_t(__u32, 2*asoc->pathmtu, 4380));
        t->ssthresh = asoc->peer.i.a_rwnd;
-       t->rto = asoc->rto_initial;
+       t->last_rto = t->rto = asoc->rto_initial;
        t->rtt = 0;
        t->srtt = 0;
        t->rttvar = 0;
index 4be92d0a2cab51b3c9821c55b29092792bc4c59c..4908041ffb319c57d8ef1925f01d358c54f489aa 100644 (file)
@@ -862,7 +862,7 @@ static inline void sctp_ulpq_reap_ordered(struct sctp_ulpq *ulpq, __u16 sid)
                        continue;
 
                /* see if this ssn has been marked by skipping */
-               if (!SSN_lt(cssn, sctp_ssn_peek(in, csid)))
+               if (!SSN_lte(cssn, sctp_ssn_peek(in, csid)))
                        break;
 
                __skb_unlink(pos, &ulpq->lobby);
index 540013ea86206e0aeb40d567fc6f1482f6238ba0..74784dfe8e5b2b6d304c68e34e9ba4c8194123e3 100644 (file)
@@ -1250,11 +1250,14 @@ asmlinkage long sys_socketpair(int family, int type, int protocol,
                goto out_release_both;
 
        fd1 = sock_alloc_fd(&newfile1);
-       if (unlikely(fd1 < 0))
+       if (unlikely(fd1 < 0)) {
+               err = fd1;
                goto out_release_both;
+       }
 
        fd2 = sock_alloc_fd(&newfile2);
        if (unlikely(fd2 < 0)) {
+               err = fd2;
                put_filp(newfile1);
                put_unused_fd(fd1);
                goto out_release_both;
@@ -2316,6 +2319,11 @@ int kernel_sock_ioctl(struct socket *sock, int cmd, unsigned long arg)
        return err;
 }
 
+int kernel_sock_shutdown(struct socket *sock, enum sock_shutdown_cmd how)
+{
+       return sock->ops->shutdown(sock, how);
+}
+
 /* ABI emulation layers need these two */
 EXPORT_SYMBOL(move_addr_to_kernel);
 EXPORT_SYMBOL(move_addr_to_user);
@@ -2342,3 +2350,4 @@ EXPORT_SYMBOL(kernel_getsockopt);
 EXPORT_SYMBOL(kernel_setsockopt);
 EXPORT_SYMBOL(kernel_sendpage);
 EXPORT_SYMBOL(kernel_sock_ioctl);
+EXPORT_SYMBOL(kernel_sock_shutdown);
index 53995af9ca4b0f3b64708f59025528172ee80d4b..a6e57d1c2eb6210c86b174ac3b5eb2a132f23cbe 100644 (file)
@@ -540,7 +540,7 @@ gss_pipe_downcall(struct file *filp, const char __user *src, size_t mlen)
        p = gss_fill_context(p, end, ctx, gss_msg->auth->mech);
        if (IS_ERR(p)) {
                err = PTR_ERR(p);
-               gss_msg->msg.errno = (err == -EACCES) ? -EACCES : -EAGAIN;
+               gss_msg->msg.errno = (err == -EAGAIN) ? -EAGAIN : -EACCES;
                goto err_release_msg;
        }
        gss_msg->ctx = gss_get_ctx(ctx);
@@ -967,7 +967,7 @@ gss_validate(struct rpc_task *task, __be32 *p)
        if (maj_stat == GSS_S_CONTEXT_EXPIRED)
                clear_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags);
        if (maj_stat) {
-               dprintk("RPC: %5u gss_validate: gss_verify_mic returned"
+               dprintk("RPC: %5u gss_validate: gss_verify_mic returned "
                                "error 0x%08x\n", task->tk_pid, maj_stat);
                goto out_bad;
        }
index 91cd8f0d1e10772c477d6de98b8268e58e775a51..0dd792338fa96298bb523812e10ff81ebf4a7480 100644 (file)
@@ -211,8 +211,8 @@ encryptor(struct scatterlist *sg, void *data)
        if (thislen == 0)
                return 0;
 
-       sg_mark_end(desc->infrags, desc->fragno);
-       sg_mark_end(desc->outfrags, desc->fragno);
+       sg_mark_end(&desc->infrags[desc->fragno - 1]);
+       sg_mark_end(&desc->outfrags[desc->fragno - 1]);
 
        ret = crypto_blkcipher_encrypt_iv(&desc->desc, desc->outfrags,
                                          desc->infrags, thislen);
@@ -293,7 +293,7 @@ decryptor(struct scatterlist *sg, void *data)
        if (thislen == 0)
                return 0;
 
-       sg_mark_end(desc->frags, desc->fragno);
+       sg_mark_end(&desc->frags[desc->fragno - 1]);
 
        ret = crypto_blkcipher_decrypt_iv(&desc->desc, desc->frags,
                                          desc->frags, thislen);
index 9843eacef11dc47bd8fdf11b6bf1a492ac70cd16..60c3dba545d7c8287cc17a00251e7fe43dad9e27 100644 (file)
@@ -147,13 +147,17 @@ gss_import_sec_context_kerberos(const void *p,
        p = simple_get_bytes(p, end, &tmp, sizeof(tmp));
        if (IS_ERR(p))
                goto out_err_free_ctx;
-       if (tmp != SGN_ALG_DES_MAC_MD5)
+       if (tmp != SGN_ALG_DES_MAC_MD5) {
+               p = ERR_PTR(-ENOSYS);
                goto out_err_free_ctx;
+       }
        p = simple_get_bytes(p, end, &tmp, sizeof(tmp));
        if (IS_ERR(p))
                goto out_err_free_ctx;
-       if (tmp != SEAL_ALG_DES)
+       if (tmp != SEAL_ALG_DES) {
+               p = ERR_PTR(-ENOSYS);
                goto out_err_free_ctx;
+       }
        p = simple_get_bytes(p, end, &ctx->endtime, sizeof(ctx->endtime));
        if (IS_ERR(p))
                goto out_err_free_ctx;
index a0d9faa59cb55d6bc6720d5159301fbc0fa712f2..dedcbd6108f4272e76c3cf2f7fac4c82d85e856f 100644 (file)
@@ -63,7 +63,6 @@
 #include <linux/jiffies.h>
 #include <linux/sunrpc/gss_krb5.h>
 #include <linux/random.h>
-#include <asm/scatterlist.h>
 #include <linux/crypto.h>
 
 #ifdef RPC_DEBUG
@@ -84,6 +83,7 @@ gss_get_mic_kerberos(struct gss_ctx *gss_ctx, struct xdr_buf *text,
        u32                     seq_send;
 
        dprintk("RPC:       gss_krb5_seal\n");
+       BUG_ON(ctx == NULL);
 
        now = get_seconds();
 
index 8bd074df27d36ece4d015dea8b4c5c9144fe95b2..3bdc527ee64a131e7b1dd705af5aa9e30e28952a 100644 (file)
@@ -4,7 +4,6 @@
 #include <linux/sunrpc/gss_krb5.h>
 #include <linux/random.h>
 #include <linux/pagemap.h>
-#include <asm/scatterlist.h>
 #include <linux/crypto.h>
 
 #ifdef RPC_DEBUG
index 18f0a8dcc095d9506699f553c7630aaac363cd54..c59f3ca2b41b02627a017354f35e319366571633 100644 (file)
@@ -280,7 +280,7 @@ rpc_pipe_poll(struct file *filp, struct poll_table_struct *wait)
        mask = POLLOUT | POLLWRNORM;
        if (rpci->ops == NULL)
                mask |= POLLERR | POLLHUP;
-       if (!list_empty(&rpci->pipe))
+       if (filp->private_data || !list_empty(&rpci->pipe))
                mask |= POLLIN | POLLRDNORM;
        return mask;
 }
index 864b541bbf5171eb1a4b3338583af6dc2fe41c19..2be714e9b382742be19d7c628f292500d65f77ce 100644 (file)
@@ -87,9 +87,8 @@ proc_dodebug(ctl_table *table, int write, struct file *file,
                        left--, s++;
                *(unsigned int *) table->data = value;
                /* Display the RPC tasks on writing to rpc_debug */
-               if (table->ctl_name == CTL_RPCDEBUG) {
+               if (strcmp(table->procname, "rpc_debug") == 0)
                        rpc_show_tasks();
-               }
        } else {
                if (!access_ok(VERIFY_WRITE, buffer, left))
                        return -EFAULT;
index 282a9a2ec90c6e5f6c78b1c8b0e6cfe95e04461c..cd641c8634f044c6bb580c2d725bdb908e97849d 100644 (file)
@@ -62,7 +62,7 @@ static inline void    do_xprt_reserve(struct rpc_task *);
 static void    xprt_connect_status(struct rpc_task *task);
 static int      __xprt_get_cong(struct rpc_xprt *, struct rpc_task *);
 
-static spinlock_t xprt_list_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(xprt_list_lock);
 static LIST_HEAD(xprt_list);
 
 /*
index 12db63580427805fb68856b7f310dfa17ffc91f9..9e11ce7159583e092627e863d44a9907f862c061 100644 (file)
@@ -181,7 +181,7 @@ rpcrdma_create_chunks(struct rpc_rqst *rqst, struct xdr_buf *target,
        struct rpcrdma_read_chunk *cur_rchunk = NULL;
        struct rpcrdma_write_array *warray = NULL;
        struct rpcrdma_write_chunk *cur_wchunk = NULL;
-       u32 *iptr = headerp->rm_body.rm_chunks;
+       __be32 *iptr = headerp->rm_body.rm_chunks;
 
        if (type == rpcrdma_readch || type == rpcrdma_areadch) {
                /* a read chunk - server will RDMA Read our memory */
@@ -217,25 +217,25 @@ rpcrdma_create_chunks(struct rpc_rqst *rqst, struct xdr_buf *target,
                        cur_rchunk->rc_target.rs_handle = htonl(seg->mr_rkey);
                        cur_rchunk->rc_target.rs_length = htonl(seg->mr_len);
                        xdr_encode_hyper(
-                                       (u32 *)&cur_rchunk->rc_target.rs_offset,
+                                       (__be32 *)&cur_rchunk->rc_target.rs_offset,
                                        seg->mr_base);
                        dprintk("RPC:       %s: read chunk "
                                "elem %d@0x%llx:0x%x pos %d (%s)\n", __func__,
-                               seg->mr_len, seg->mr_base, seg->mr_rkey, pos,
-                               n < nsegs ? "more" : "last");
+                               seg->mr_len, (unsigned long long)seg->mr_base,
+                               seg->mr_rkey, pos, n < nsegs ? "more" : "last");
                        cur_rchunk++;
                        r_xprt->rx_stats.read_chunk_count++;
                } else {                /* write/reply */
                        cur_wchunk->wc_target.rs_handle = htonl(seg->mr_rkey);
                        cur_wchunk->wc_target.rs_length = htonl(seg->mr_len);
                        xdr_encode_hyper(
-                                       (u32 *)&cur_wchunk->wc_target.rs_offset,
+                                       (__be32 *)&cur_wchunk->wc_target.rs_offset,
                                        seg->mr_base);
                        dprintk("RPC:       %s: %s chunk "
                                "elem %d@0x%llx:0x%x (%s)\n", __func__,
                                (type == rpcrdma_replych) ? "reply" : "write",
-                               seg->mr_len, seg->mr_base, seg->mr_rkey,
-                               n < nsegs ? "more" : "last");
+                               seg->mr_len, (unsigned long long)seg->mr_base,
+                               seg->mr_rkey, n < nsegs ? "more" : "last");
                        cur_wchunk++;
                        if (type == rpcrdma_replych)
                                r_xprt->rx_stats.reply_chunk_count++;
@@ -257,14 +257,14 @@ rpcrdma_create_chunks(struct rpc_rqst *rqst, struct xdr_buf *target,
         * finish off header. If write, marshal discrim and nchunks.
         */
        if (cur_rchunk) {
-               iptr = (u32 *) cur_rchunk;
+               iptr = (__be32 *) cur_rchunk;
                *iptr++ = xdr_zero;     /* finish the read chunk list */
                *iptr++ = xdr_zero;     /* encode a NULL write chunk list */
                *iptr++ = xdr_zero;     /* encode a NULL reply chunk */
        } else {
                warray->wc_discrim = xdr_one;
                warray->wc_nchunks = htonl(nchunks);
-               iptr = (u32 *) cur_wchunk;
+               iptr = (__be32 *) cur_wchunk;
                if (type == rpcrdma_writech) {
                        *iptr++ = xdr_zero; /* finish the write chunk list */
                        *iptr++ = xdr_zero; /* encode a NULL reply chunk */
@@ -559,7 +559,7 @@ rpcrdma_marshal_req(struct rpc_rqst *rqst)
  * RDMA'd by server. See map at rpcrdma_create_chunks()! :-)
  */
 static int
-rpcrdma_count_chunks(struct rpcrdma_rep *rep, int max, int wrchunk, u32 **iptrp)
+rpcrdma_count_chunks(struct rpcrdma_rep *rep, int max, int wrchunk, __be32 **iptrp)
 {
        unsigned int i, total_len;
        struct rpcrdma_write_chunk *cur_wchunk;
@@ -573,11 +573,11 @@ rpcrdma_count_chunks(struct rpcrdma_rep *rep, int max, int wrchunk, u32 **iptrp)
                struct rpcrdma_segment *seg = &cur_wchunk->wc_target;
                ifdebug(FACILITY) {
                        u64 off;
-                       xdr_decode_hyper((u32 *)&seg->rs_offset, &off);
+                       xdr_decode_hyper((__be32 *)&seg->rs_offset, &off);
                        dprintk("RPC:       %s: chunk %d@0x%llx:0x%x\n",
                                __func__,
                                ntohl(seg->rs_length),
-                               off,
+                               (unsigned long long)off,
                                ntohl(seg->rs_handle));
                }
                total_len += ntohl(seg->rs_length);
@@ -585,7 +585,7 @@ rpcrdma_count_chunks(struct rpcrdma_rep *rep, int max, int wrchunk, u32 **iptrp)
        }
        /* check and adjust for properly terminated write chunk */
        if (wrchunk) {
-               u32 *w = (u32 *) cur_wchunk;
+               __be32 *w = (__be32 *) cur_wchunk;
                if (*w++ != xdr_zero)
                        return -1;
                cur_wchunk = (struct rpcrdma_write_chunk *) w;
@@ -593,7 +593,7 @@ rpcrdma_count_chunks(struct rpcrdma_rep *rep, int max, int wrchunk, u32 **iptrp)
        if ((char *) cur_wchunk > rep->rr_base + rep->rr_len)
                return -1;
 
-       *iptrp = (u32 *) cur_wchunk;
+       *iptrp = (__be32 *) cur_wchunk;
        return total_len;
 }
 
@@ -721,7 +721,7 @@ rpcrdma_reply_handler(struct rpcrdma_rep *rep)
        struct rpc_rqst *rqst;
        struct rpc_xprt *xprt = rep->rr_xprt;
        struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt);
-       u32 *iptr;
+       __be32 *iptr;
        int i, rdmalen, status;
 
        /* Check status. If bad, signal disconnect and return rep to pool */
@@ -801,7 +801,7 @@ repost:
                        r_xprt->rx_stats.total_rdma_reply += rdmalen;
                } else {
                        /* else ordinary inline */
-                       iptr = (u32 *)((unsigned char *)headerp + 28);
+                       iptr = (__be32 *)((unsigned char *)headerp + 28);
                        rep->rr_len -= 28; /*sizeof *headerp;*/
                        status = rep->rr_len;
                }
@@ -816,7 +816,7 @@ repost:
                    headerp->rm_body.rm_chunks[2] != xdr_one ||
                    req->rl_nchunks == 0)
                        goto badheader;
-               iptr = (u32 *)((unsigned char *)headerp + 28);
+               iptr = (__be32 *)((unsigned char *)headerp + 28);
                rdmalen = rpcrdma_count_chunks(rep, req->rl_nchunks, 0, &iptr);
                if (rdmalen < 0)
                        goto badheader;
index dc55cc974c906e78d974aa664bde940fe058637c..6f2112dd9f786953c24eadc707fb208a946da4f0 100644 (file)
@@ -89,7 +89,7 @@ static struct ctl_table_header *sunrpc_table_header;
 
 static ctl_table xr_tunables_table[] = {
        {
-               .ctl_name       = CTL_SLOTTABLE_RDMA,
+               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "rdma_slot_table_entries",
                .data           = &xprt_rdma_slot_table_entries,
                .maxlen         = sizeof(unsigned int),
@@ -100,7 +100,7 @@ static ctl_table xr_tunables_table[] = {
                .extra2         = &max_slot_table_size
        },
        {
-               .ctl_name       = CTL_RDMA_MAXINLINEREAD,
+               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "rdma_max_inline_read",
                .data           = &xprt_rdma_max_inline_read,
                .maxlen         = sizeof(unsigned int),
@@ -109,7 +109,7 @@ static ctl_table xr_tunables_table[] = {
                .strategy       = &sysctl_intvec,
        },
        {
-               .ctl_name       = CTL_RDMA_MAXINLINEWRITE,
+               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "rdma_max_inline_write",
                .data           = &xprt_rdma_max_inline_write,
                .maxlen         = sizeof(unsigned int),
@@ -118,7 +118,7 @@ static ctl_table xr_tunables_table[] = {
                .strategy       = &sysctl_intvec,
        },
        {
-               .ctl_name       = CTL_RDMA_WRITEPADDING,
+               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "rdma_inline_write_padding",
                .data           = &xprt_rdma_inline_write_padding,
                .maxlen         = sizeof(unsigned int),
@@ -129,7 +129,7 @@ static ctl_table xr_tunables_table[] = {
                .extra2         = &max_padding,
        },
        {
-               .ctl_name       = CTL_RDMA_MEMREG,
+               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "rdma_memreg_strategy",
                .data           = &xprt_rdma_memreg_strategy,
                .maxlen         = sizeof(unsigned int),
@@ -320,9 +320,9 @@ xprt_setup_rdma(struct xprt_create *args)
        xprt->slot = kcalloc(xprt->max_reqs,
                                sizeof(struct rpc_rqst), GFP_KERNEL);
        if (xprt->slot == NULL) {
-               kfree(xprt);
                dprintk("RPC:       %s: couldn't allocate %d slots\n",
                        __func__, xprt->max_reqs);
+               kfree(xprt);
                return ERR_PTR(-ENOMEM);
        }
 
index 02298f529dad3f4a068ed86d4cf00cbe8e352eaf..2f630a512ab753f7e2df18a42a2abb02f04893ba 100644 (file)
@@ -1828,7 +1828,7 @@ static struct rpc_xprt *xs_setup_xprt(struct xprt_create *args,
  * @args: rpc transport creation arguments
  *
  */
-struct rpc_xprt *xs_setup_udp(struct xprt_create *args)
+static struct rpc_xprt *xs_setup_udp(struct xprt_create *args)
 {
        struct sockaddr *addr = args->dstaddr;
        struct rpc_xprt *xprt;
@@ -1894,7 +1894,7 @@ struct rpc_xprt *xs_setup_udp(struct xprt_create *args)
  * @args: rpc transport creation arguments
  *
  */
-struct rpc_xprt *xs_setup_tcp(struct xprt_create *args)
+static struct rpc_xprt *xs_setup_tcp(struct xprt_create *args)
 {
        struct sockaddr *addr = args->dstaddr;
        struct rpc_xprt *xprt;
index e36b4b5a5222320644fd1d7fe35c06bfe982e7f0..6b792265dc06e5b08085095178bd4fba3e427ff7 100644 (file)
@@ -201,7 +201,7 @@ static int tipc_create(struct net *net, struct socket *sock, int protocol)
                return -EPROTOTYPE;
        }
 
-       sk = sk_alloc(net, AF_TIPC, GFP_KERNEL, &tipc_proto, 1);
+       sk = sk_alloc(net, AF_TIPC, GFP_KERNEL, &tipc_proto);
        if (!sk) {
                tipc_deleteport(ref);
                return -ENOMEM;
index 9163ec526c2a0e66ed2fdf20f232173f6aed8d90..e835da8fc09184f8e2dddcba9c471922af1b1165 100644 (file)
@@ -457,7 +457,7 @@ static int unix_release_sock (struct sock *sk, int embrion)
         *        What the above comment does talk about? --ANK(980817)
         */
 
-       if (atomic_read(&unix_tot_inflight))
+       if (unix_tot_inflight)
                unix_gc();              /* Garbage collect fds */
 
        return 0;
@@ -599,15 +599,14 @@ static struct sock * unix_create1(struct net *net, struct socket *sock)
        struct sock *sk = NULL;
        struct unix_sock *u;
 
-       if (atomic_read(&unix_nr_socks) >= 2*get_max_files())
+       atomic_inc(&unix_nr_socks);
+       if (atomic_read(&unix_nr_socks) > 2 * get_max_files())
                goto out;
 
-       sk = sk_alloc(net, PF_UNIX, GFP_KERNEL, &unix_proto, 1);
+       sk = sk_alloc(net, PF_UNIX, GFP_KERNEL, &unix_proto);
        if (!sk)
                goto out;
 
-       atomic_inc(&unix_nr_socks);
-
        sock_init_data(sock,sk);
        lockdep_set_class(&sk->sk_receive_queue.lock,
                                &af_unix_sk_receive_queue_lock_key);
@@ -625,6 +624,8 @@ static struct sock * unix_create1(struct net *net, struct socket *sock)
        init_waitqueue_head(&u->peer_wait);
        unix_insert_socket(unix_sockets_unbound, sk);
 out:
+       if (sk == NULL)
+               atomic_dec(&unix_nr_socks);
        return sk;
 }
 
index 406b6433e467b4b4cbe697d24ec03f4cfa33e22e..ebdff3d877a1e3201f69af1ae60e92d58df7177a 100644 (file)
@@ -92,7 +92,7 @@ static LIST_HEAD(gc_inflight_list);
 static LIST_HEAD(gc_candidates);
 static DEFINE_SPINLOCK(unix_gc_lock);
 
-atomic_t unix_tot_inflight = ATOMIC_INIT(0);
+unsigned int unix_tot_inflight;
 
 
 static struct sock *unix_get_socket(struct file *filp)
@@ -133,7 +133,7 @@ void unix_inflight(struct file *fp)
                } else {
                        BUG_ON(list_empty(&u->link));
                }
-               atomic_inc(&unix_tot_inflight);
+               unix_tot_inflight++;
                spin_unlock(&unix_gc_lock);
        }
 }
@@ -147,7 +147,7 @@ void unix_notinflight(struct file *fp)
                BUG_ON(list_empty(&u->link));
                if (atomic_dec_and_test(&u->inflight))
                        list_del_init(&u->link);
-               atomic_dec(&unix_tot_inflight);
+               unix_tot_inflight--;
                spin_unlock(&unix_gc_lock);
        }
 }
@@ -161,7 +161,7 @@ static inline struct sk_buff *sock_queue_head(struct sock *sk)
        for (skb = sock_queue_head(sk)->next, next = skb->next; \
             skb != sock_queue_head(sk); skb = next, next = skb->next)
 
-static void scan_inflight(struct sock *x, void (*func)(struct sock *),
+static void scan_inflight(struct sock *x, void (*func)(struct unix_sock *),
                          struct sk_buff_head *hitlist)
 {
        struct sk_buff *skb;
@@ -185,9 +185,9 @@ static void scan_inflight(struct sock *x, void (*func)(struct sock *),
                                 *      if it indeed does so
                                 */
                                struct sock *sk = unix_get_socket(*fp++);
-                               if(sk) {
+                               if (sk) {
                                        hit = true;
-                                       func(sk);
+                                       func(unix_sk(sk));
                                }
                        }
                        if (hit && hitlist != NULL) {
@@ -199,7 +199,7 @@ static void scan_inflight(struct sock *x, void (*func)(struct sock *),
        spin_unlock(&x->sk_receive_queue.lock);
 }
 
-static void scan_children(struct sock *x, void (*func)(struct sock *),
+static void scan_children(struct sock *x, void (*func)(struct unix_sock *),
                          struct sk_buff_head *hitlist)
 {
        if (x->sk_state != TCP_LISTEN)
@@ -235,20 +235,18 @@ static void scan_children(struct sock *x, void (*func)(struct sock *),
        }
 }
 
-static void dec_inflight(struct sock *sk)
+static void dec_inflight(struct unix_sock *usk)
 {
-       atomic_dec(&unix_sk(sk)->inflight);
+       atomic_dec(&usk->inflight);
 }
 
-static void inc_inflight(struct sock *sk)
+static void inc_inflight(struct unix_sock *usk)
 {
-       atomic_inc(&unix_sk(sk)->inflight);
+       atomic_inc(&usk->inflight);
 }
 
-static void inc_inflight_move_tail(struct sock *sk)
+static void inc_inflight_move_tail(struct unix_sock *u)
 {
-       struct unix_sock *u = unix_sk(sk);
-
        atomic_inc(&u->inflight);
        /*
         * If this is still a candidate, move it to the end of the
index 85e5f9dd0d8e757f03e69ac08966addff50bd163..47e80cc2077c23fd207ce01478f8761f4c0baa05 100644 (file)
@@ -1094,7 +1094,7 @@ int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd,
        rtnl_lock();
        ret = wireless_process_ioctl(net, ifr, cmd);
        rtnl_unlock();
-       if (IW_IS_GET(cmd) && copy_to_user(arg, ifr, sizeof(struct ifreq)))
+       if (IW_IS_GET(cmd) && copy_to_user(arg, ifr, sizeof(struct iwreq)))
                return -EFAULT;
        return ret;
 }
index fc416f9606a9e259e22f2e641c602107e06b9200..92cfe8e3e0b8d24133b6e5e07cafa6d5d27328e2 100644 (file)
@@ -472,7 +472,7 @@ static struct proto x25_proto = {
 static struct sock *x25_alloc_socket(struct net *net)
 {
        struct x25_sock *x25;
-       struct sock *sk = sk_alloc(net, AF_X25, GFP_ATOMIC, &x25_proto, 1);
+       struct sock *sk = sk_alloc(net, AF_X25, GFP_ATOMIC, &x25_proto);
 
        if (!sk)
                goto out;
index 0426388d351de58bf116ae526b791c8e42c22764..1686f64c4352c2ee19d565d54017608474a98b83 100644 (file)
@@ -21,7 +21,6 @@
 #if defined(CONFIG_INET_ESP) || defined(CONFIG_INET_ESP_MODULE) || defined(CONFIG_INET6_ESP) || defined(CONFIG_INET6_ESP_MODULE)
 #include <net/esp.h>
 #endif
-#include <asm/scatterlist.h>
 
 /*
  * Algorithms supported by IPsec.  These entries contain properties which
index 224b44e31a07b934091f79e42b85888ab143925f..cf43c49eab37f3c2abfee6c707fc1c24934662f0 100644 (file)
@@ -552,7 +552,7 @@ int __xfrm_state_delete(struct xfrm_state *x)
                 * The xfrm_state_alloc call gives a reference, and that
                 * is what we are dropping here.
                 */
-               __xfrm_state_put(x);
+               xfrm_state_put(x);
                err = 0;
        }
 
index d41588d101d01db756f5db3a1cd40d6e783883a9..e75dbdcb08a49674b846f2ce14b02598b2ba6b3e 100644 (file)
@@ -507,7 +507,6 @@ static int copy_to_user_state_extra(struct xfrm_state *x,
                                    struct xfrm_usersa_info *p,
                                    struct sk_buff *skb)
 {
-       spin_lock_bh(&x->lock);
        copy_to_user_state(x, p);
 
        if (x->coaddr)
@@ -515,7 +514,6 @@ static int copy_to_user_state_extra(struct xfrm_state *x,
 
        if (x->lastused)
                NLA_PUT_U64(skb, XFRMA_LASTUSED, x->lastused);
-       spin_unlock_bh(&x->lock);
 
        if (x->aalg)
                NLA_PUT(skb, XFRMA_ALG_AUTH, alg_len(x->aalg), x->aalg);
index e787c6d16dd77ace5f998a3f8a17e50f57b38fe3..05e438f8b4e2d8511e69a4961cf8e35b0dbbeebd 100644 (file)
@@ -19,7 +19,8 @@ static int my_open(struct inode *inode, struct file *file)
 {
        int i;
 
-       trace_mark(subsystem_event, "%d %s", 123, "example string");
+       trace_mark(subsystem_event, "integer %d string %s", 123,
+               "example string");
        for (i = 0; i < 10; i++)
                trace_mark(subsystem_eventb, MARK_NOARGS);
        return -EPERM;
index 238b2e384fc84187e7c7d63143c02a5cb42992ce..a36797535615dc77647260f12d2496d850bd4177 100644 (file)
@@ -53,7 +53,7 @@ void probe_subsystem_eventb(const struct marker *mdata, void *private,
 static struct probe_data probe_array[] =
 {
        {       .name = "subsystem_event",
-               .format = "%d %s",
+               .format = "integer %d string %s",
                .probe_func = probe_subsystem_event },
        {       .name = "subsystem_eventb",
                .format = MARK_NOARGS,
index 59594126e8b67d002de4624c2704178415de5c7b..1ad6f7fc490a1233b46bcb20fd8ea7e0562f02ba 100644 (file)
@@ -4,12 +4,7 @@
 
 PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config
 
-# If a arch/$(SRCARCH)/Kconfig.$(ARCH) file exist use it
-ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/Kconfig.$(ARCH)),)
-        Kconfig := arch/$(SRCARCH)/Kconfig.$(ARCH)
-else
-        Kconfig := arch/$(SRCARCH)/Kconfig
-endif
+Kconfig := arch/$(SRCARCH)/Kconfig
 
 xconfig: $(obj)/qconf
        $< $(Kconfig)
index b2913e9da495bf921b9d004012adef18996f4efa..e0f402f3b75d94d765875a6299f1f154e23a1c32 100644 (file)
@@ -83,6 +83,68 @@ char *conf_get_default_confname(void)
        return name;
 }
 
+static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
+{
+       char *p2;
+
+       switch (sym->type) {
+       case S_TRISTATE:
+               if (p[0] == 'm') {
+                       sym->def[def].tri = mod;
+                       sym->flags |= def_flags;
+                       break;
+               }
+       case S_BOOLEAN:
+               if (p[0] == 'y') {
+                       sym->def[def].tri = yes;
+                       sym->flags |= def_flags;
+                       break;
+               }
+               if (p[0] == 'n') {
+                       sym->def[def].tri = no;
+                       sym->flags |= def_flags;
+                       break;
+               }
+               conf_warning("symbol value '%s' invalid for %s", p, sym->name);
+               break;
+       case S_OTHER:
+               if (*p != '"') {
+                       for (p2 = p; *p2 && !isspace(*p2); p2++)
+                               ;
+                       sym->type = S_STRING;
+                       goto done;
+               }
+       case S_STRING:
+               if (*p++ != '"')
+                       break;
+               for (p2 = p; (p2 = strpbrk(p2, "\"\\")); p2++) {
+                       if (*p2 == '"') {
+                               *p2 = 0;
+                               break;
+                       }
+                       memmove(p2, p2 + 1, strlen(p2));
+               }
+               if (!p2) {
+                       conf_warning("invalid string found");
+                       return 1;
+               }
+       case S_INT:
+       case S_HEX:
+       done:
+               if (sym_string_valid(sym, p)) {
+                       sym->def[def].val = strdup(p);
+                       sym->flags |= def_flags;
+               } else {
+                       conf_warning("symbol value '%s' invalid for %s", p, sym->name);
+                       return 1;
+               }
+               break;
+       default:
+               ;
+       }
+       return 0;
+}
+
 int conf_read_simple(const char *name, int def)
 {
        FILE *in = NULL;
@@ -213,61 +275,8 @@ load:
                                conf_warning("trying to reassign symbol %s", sym->name);
                                break;
                        }
-                       switch (sym->type) {
-                       case S_TRISTATE:
-                               if (p[0] == 'm') {
-                                       sym->def[def].tri = mod;
-                                       sym->flags |= def_flags;
-                                       break;
-                               }
-                       case S_BOOLEAN:
-                               if (p[0] == 'y') {
-                                       sym->def[def].tri = yes;
-                                       sym->flags |= def_flags;
-                                       break;
-                               }
-                               if (p[0] == 'n') {
-                                       sym->def[def].tri = no;
-                                       sym->flags |= def_flags;
-                                       break;
-                               }
-                               conf_warning("symbol value '%s' invalid for %s", p, sym->name);
-                               break;
-                       case S_OTHER:
-                               if (*p != '"') {
-                                       for (p2 = p; *p2 && !isspace(*p2); p2++)
-                                               ;
-                                       sym->type = S_STRING;
-                                       goto done;
-                               }
-                       case S_STRING:
-                               if (*p++ != '"')
-                                       break;
-                               for (p2 = p; (p2 = strpbrk(p2, "\"\\")); p2++) {
-                                       if (*p2 == '"') {
-                                               *p2 = 0;
-                                               break;
-                                       }
-                                       memmove(p2, p2 + 1, strlen(p2));
-                               }
-                               if (!p2) {
-                                       conf_warning("invalid string found");
-                                       continue;
-                               }
-                       case S_INT:
-                       case S_HEX:
-                       done:
-                               if (sym_string_valid(sym, p)) {
-                                       sym->def[def].val = strdup(p);
-                                       sym->flags |= def_flags;
-                               } else {
-                                       conf_warning("symbol value '%s' invalid for %s", p, sym->name);
-                                       continue;
-                               }
-                               break;
-                       default:
-                               ;
-                       }
+                       if (conf_set_sym_val(sym, def, def_flags, p))
+                               continue;
                        break;
                case '\r':
                case '\n':
index bf67871173efbabbe2ad47a04ba1f24cbc6d3eeb..302e8d0839a9c7afaacff955e4a67874192117be 100644 (file)
@@ -526,6 +526,10 @@ int cap_task_kill(struct task_struct *p, struct siginfo *info,
        if (info != SEND_SIG_NOINFO && (is_si_special(info) || SI_FROMKERNEL(info)))
                return 0;
 
+       /* sigcont is permitted within same session */
+       if (sig == SIGCONT && (task_session_nr(current) == task_session_nr(p)))
+               return 0;
+
        if (secid)
                /*
                 * Signal sent as a particular user.
index 7551af1f78994aea7203a3aa76bf2df8521c9706..9e70a160d7da4e5f90d9c57ad816b4e2ec4d5b16 100644 (file)
@@ -325,7 +325,7 @@ static uint16_t spec_order[] = {
        AVTAB_MEMBER
 };
 
-int avtab_read_item(void *fp, u32 vers, struct avtab *a,
+int avtab_read_item(struct avtab *a, void *fp, struct policydb *pol,
                    int (*insertf)(struct avtab *a, struct avtab_key *k,
                                   struct avtab_datum *d, void *p),
                    void *p)
@@ -333,10 +333,11 @@ int avtab_read_item(void *fp, u32 vers, struct avtab *a,
        __le16 buf16[4];
        u16 enabled;
        __le32 buf32[7];
-       u32 items, items2, val;
+       u32 items, items2, val, vers = pol->policyvers;
        struct avtab_key key;
        struct avtab_datum datum;
        int i, rc;
+       unsigned set;
 
        memset(&key, 0, sizeof(struct avtab_key));
        memset(&datum, 0, sizeof(struct avtab_datum));
@@ -420,12 +421,35 @@ int avtab_read_item(void *fp, u32 vers, struct avtab *a,
        key.target_class = le16_to_cpu(buf16[items++]);
        key.specified = le16_to_cpu(buf16[items++]);
 
+       if (!policydb_type_isvalid(pol, key.source_type) ||
+           !policydb_type_isvalid(pol, key.target_type) ||
+           !policydb_class_isvalid(pol, key.target_class)) {
+               printk(KERN_WARNING "security: avtab: invalid type or class\n");
+               return -1;
+       }
+
+       set = 0;
+       for (i = 0; i < ARRAY_SIZE(spec_order); i++) {
+               if (key.specified & spec_order[i])
+                       set++;
+       }
+       if (!set || set > 1) {
+               printk(KERN_WARNING
+                       "security:  avtab:  more than one specifier\n");
+               return -1;
+       }
+
        rc = next_entry(buf32, fp, sizeof(u32));
        if (rc < 0) {
                printk("security: avtab: truncated entry\n");
                return -1;
        }
        datum.data = le32_to_cpu(*buf32);
+       if ((key.specified & AVTAB_TYPE) &&
+           !policydb_type_isvalid(pol, datum.data)) {
+               printk(KERN_WARNING "security: avtab: invalid type\n");
+               return -1;
+       }
        return insertf(a, &key, &datum, p);
 }
 
@@ -435,7 +459,7 @@ static int avtab_insertf(struct avtab *a, struct avtab_key *k,
        return avtab_insert(a, k, d);
 }
 
-int avtab_read(struct avtab *a, void *fp, u32 vers)
+int avtab_read(struct avtab *a, void *fp, struct policydb *pol)
 {
        int rc;
        __le32 buf[1];
@@ -459,7 +483,7 @@ int avtab_read(struct avtab *a, void *fp, u32 vers)
                goto bad;
 
        for (i = 0; i < nel; i++) {
-               rc = avtab_read_item(fp,vers, a, avtab_insertf, NULL);
+               rc = avtab_read_item(a, fp, pol, avtab_insertf, NULL);
                if (rc) {
                        if (rc == -ENOMEM)
                                printk(KERN_ERR "security: avtab: out of memory\n");
index d8edf8ca56d12de1eea45c374678b64896fb75ad..8da6a842808623f2ffe6f0244aaba80d9d4df111 100644 (file)
@@ -64,12 +64,13 @@ struct avtab_datum *avtab_search(struct avtab *h, struct avtab_key *k);
 void avtab_destroy(struct avtab *h);
 void avtab_hash_eval(struct avtab *h, char *tag);
 
-int avtab_read_item(void *fp, uint32_t vers, struct avtab *a,
+struct policydb;
+int avtab_read_item(struct avtab *a, void *fp, struct policydb *pol,
                    int (*insert)(struct avtab *a, struct avtab_key *k,
                                  struct avtab_datum *d, void *p),
                    void *p);
 
-int avtab_read(struct avtab *a, void *fp, u32 vers);
+int avtab_read(struct avtab *a, void *fp, struct policydb *pol);
 
 struct avtab_node *avtab_insert_nonunique(struct avtab *h, struct avtab_key *key,
                                          struct avtab_datum *datum);
index 45b93a827c802f2b03dce5fef0c4a2551cbb9d28..50ad85d4b77c88c3ab61828ba2161bce8ad8315f 100644 (file)
@@ -362,7 +362,8 @@ static int cond_read_av_list(struct policydb *p, void *fp, struct cond_av_list *
        data.head = NULL;
        data.tail = NULL;
        for (i = 0; i < len; i++) {
-               rc = avtab_read_item(fp, p->policyvers, &p->te_cond_avtab, cond_insertf, &data);
+               rc = avtab_read_item(&p->te_cond_avtab, fp, p, cond_insertf,
+                                    &data);
                if (rc)
                        return rc;
 
index c1a6b22d48d9aa14195673c3f27f9d638ea05ee7..920b5e36a1af97c00ea6294370a4717651a738aa 100644 (file)
@@ -129,8 +129,8 @@ int ebitmap_netlbl_export(struct ebitmap *ebmap,
                        cmap_sft = delta % NETLBL_CATMAP_MAPSIZE;
                        c_iter->bitmap[cmap_idx]
                                |= e_iter->maps[cmap_idx] << cmap_sft;
-                       e_iter = e_iter->next;
                }
+               e_iter = e_iter->next;
        }
 
        return 0;
index 9a11deaaa9e71963f610829a908f9cf2bcf613ea..fb5d70a6628dfe79a31a5209f20e38eccdc00bbc 100644 (file)
@@ -157,49 +157,55 @@ void mls_sid_to_context(struct context *context,
        return;
 }
 
+int mls_level_isvalid(struct policydb *p, struct mls_level *l)
+{
+       struct level_datum *levdatum;
+       struct ebitmap_node *node;
+       int i;
+
+       if (!l->sens || l->sens > p->p_levels.nprim)
+               return 0;
+       levdatum = hashtab_search(p->p_levels.table,
+                                 p->p_sens_val_to_name[l->sens - 1]);
+       if (!levdatum)
+               return 0;
+
+       ebitmap_for_each_positive_bit(&l->cat, node, i) {
+               if (i > p->p_cats.nprim)
+                       return 0;
+               if (!ebitmap_get_bit(&levdatum->level->cat, i)) {
+                       /*
+                        * Category may not be associated with
+                        * sensitivity.
+                        */
+                       return 0;
+               }
+       }
+
+       return 1;
+}
+
+int mls_range_isvalid(struct policydb *p, struct mls_range *r)
+{
+       return (mls_level_isvalid(p, &r->level[0]) &&
+               mls_level_isvalid(p, &r->level[1]) &&
+               mls_level_dom(&r->level[1], &r->level[0]));
+}
+
 /*
  * Return 1 if the MLS fields in the security context
  * structure `c' are valid.  Return 0 otherwise.
  */
 int mls_context_isvalid(struct policydb *p, struct context *c)
 {
-       struct level_datum *levdatum;
        struct user_datum *usrdatum;
-       struct ebitmap_node *node;
-       int i, l;
 
        if (!selinux_mls_enabled)
                return 1;
 
-       /*
-        * MLS range validity checks: high must dominate low, low level must
-        * be valid (category set <-> sensitivity check), and high level must
-        * be valid (category set <-> sensitivity check)
-        */
-       if (!mls_level_dom(&c->range.level[1], &c->range.level[0]))
-               /* High does not dominate low. */
+       if (!mls_range_isvalid(p, &c->range))
                return 0;
 
-       for (l = 0; l < 2; l++) {
-               if (!c->range.level[l].sens || c->range.level[l].sens > p->p_levels.nprim)
-                       return 0;
-               levdatum = hashtab_search(p->p_levels.table,
-                       p->p_sens_val_to_name[c->range.level[l].sens - 1]);
-               if (!levdatum)
-                       return 0;
-
-               ebitmap_for_each_positive_bit(&c->range.level[l].cat, node, i) {
-                       if (i > p->p_cats.nprim)
-                               return 0;
-                       if (!ebitmap_get_bit(&levdatum->level->cat, i))
-                               /*
-                                * Category may not be associated with
-                                * sensitivity in low level.
-                                */
-                               return 0;
-               }
-       }
-
        if (c->role == OBJECT_R_VAL)
                return 1;
 
index 096d1b4ef7fbb7cd7759cd9148840df3e0e2af5c..ab53663d9f5f96691915d568954712260e92f2ae 100644 (file)
@@ -27,6 +27,8 @@
 int mls_compute_context_len(struct context *context);
 void mls_sid_to_context(struct context *context, char **scontext);
 int mls_context_isvalid(struct policydb *p, struct context *c);
+int mls_range_isvalid(struct policydb *p, struct mls_range *r);
+int mls_level_isvalid(struct policydb *p, struct mls_level *l);
 
 int mls_context_to_sid(char oldc,
                       char **scontext,
index 539828b229b2e27f39ba6b9904f37308b38d6baa..b582aae3c62c339f320a11d067a14f53fdea3038 100644 (file)
@@ -713,6 +713,27 @@ out:
        return rc;
 }
 
+int policydb_class_isvalid(struct policydb *p, unsigned int class)
+{
+       if (!class || class > p->p_classes.nprim)
+               return 0;
+       return 1;
+}
+
+int policydb_role_isvalid(struct policydb *p, unsigned int role)
+{
+       if (!role || role > p->p_roles.nprim)
+               return 0;
+       return 1;
+}
+
+int policydb_type_isvalid(struct policydb *p, unsigned int type)
+{
+       if (!type || type > p->p_types.nprim)
+               return 0;
+       return 1;
+}
+
 /*
  * Return 1 if the fields in the security context
  * structure `c' are valid.  Return 0 otherwise.
@@ -1260,6 +1281,7 @@ static int mls_read_level(struct mls_level *lp, void *fp)
                       "categories\n");
                goto bad;
        }
+
        return 0;
 
 bad:
@@ -1563,7 +1585,7 @@ int policydb_read(struct policydb *p, void *fp)
                p->symtab[i].nprim = nprim;
        }
 
-       rc = avtab_read(&p->te_avtab, fp, p->policyvers);
+       rc = avtab_read(&p->te_avtab, fp, p);
        if (rc)
                goto bad;
 
@@ -1595,6 +1617,12 @@ int policydb_read(struct policydb *p, void *fp)
                tr->role = le32_to_cpu(buf[0]);
                tr->type = le32_to_cpu(buf[1]);
                tr->new_role = le32_to_cpu(buf[2]);
+               if (!policydb_role_isvalid(p, tr->role) ||
+                   !policydb_type_isvalid(p, tr->type) ||
+                   !policydb_role_isvalid(p, tr->new_role)) {
+                       rc = -EINVAL;
+                       goto bad;
+               }
                ltr = tr;
        }
 
@@ -1619,6 +1647,11 @@ int policydb_read(struct policydb *p, void *fp)
                        goto bad;
                ra->role = le32_to_cpu(buf[0]);
                ra->new_role = le32_to_cpu(buf[1]);
+               if (!policydb_role_isvalid(p, ra->role) ||
+                   !policydb_role_isvalid(p, ra->new_role)) {
+                       rc = -EINVAL;
+                       goto bad;
+               }
                lra = ra;
        }
 
@@ -1872,9 +1905,19 @@ int policydb_read(struct policydb *p, void *fp)
                                rt->target_class = le32_to_cpu(buf[0]);
                        } else
                                rt->target_class = SECCLASS_PROCESS;
+                       if (!policydb_type_isvalid(p, rt->source_type) ||
+                           !policydb_type_isvalid(p, rt->target_type) ||
+                           !policydb_class_isvalid(p, rt->target_class)) {
+                               rc = -EINVAL;
+                               goto bad;
+                       }
                        rc = mls_read_range_helper(&rt->target_range, fp);
                        if (rc)
                                goto bad;
+                       if (!mls_range_isvalid(p, &rt->target_range)) {
+                               printk(KERN_WARNING "security:  rangetrans:  invalid range\n");
+                               goto bad;
+                       }
                        lrt = rt;
                }
        }
index 844d310f4f1b54a49fce96f2cf2aa9bf60281737..ed6fc687c66fd44107afe0e475ab233399e2d0d2 100644 (file)
@@ -251,6 +251,9 @@ struct policydb {
 extern void policydb_destroy(struct policydb *p);
 extern int policydb_load_isids(struct policydb *p, struct sidtab *s);
 extern int policydb_context_isvalid(struct policydb *p, struct context *c);
+extern int policydb_class_isvalid(struct policydb *p, unsigned int class);
+extern int policydb_type_isvalid(struct policydb *p, unsigned int type);
+extern int policydb_role_isvalid(struct policydb *p, unsigned int role);
 extern int policydb_read(struct policydb *p, void *fp);
 
 #define PERM_SYMTAB_SIZE 32
index 36a191e7004e957fb38de4e9c5507f8941a33062..e076039690330675f6679edd39b18f02ab8e852d 100644 (file)
@@ -211,26 +211,27 @@ static int selinux_xfrm_sec_ctx_alloc(struct xfrm_sec_ctx **ctxp,
        if (uctx->ctx_doi != XFRM_SC_ALG_SELINUX)
                return -EINVAL;
 
-       if (uctx->ctx_len >= PAGE_SIZE)
+       str_len = uctx->ctx_len;
+       if (str_len >= PAGE_SIZE)
                return -ENOMEM;
 
        *ctxp = ctx = kmalloc(sizeof(*ctx) +
-                             uctx->ctx_len + 1,
+                             str_len + 1,
                              GFP_KERNEL);
 
        if (!ctx)
                return -ENOMEM;
 
        ctx->ctx_doi = uctx->ctx_doi;
-       ctx->ctx_len = uctx->ctx_len;
+       ctx->ctx_len = str_len;
        ctx->ctx_alg = uctx->ctx_alg;
 
        memcpy(ctx->ctx_str,
               uctx+1,
-              ctx->ctx_len);
-       ctx->ctx_str[ctx->ctx_len] = 0;
+              str_len);
+       ctx->ctx_str[str_len] = 0;
        rc = security_context_to_sid(ctx->ctx_str,
-                                    ctx->ctx_len,
+                                    str_len,
                                     &ctx->ctx_sid);
 
        if (rc)
index 3306ecd49243a00bbdcded86407d4f6a08775bd0..b57f2d5a1c9dff920e17c2ada69d009e090bbd21 100644 (file)
@@ -97,23 +97,27 @@ static void snd_mpu401_uart_clear_rx(struct snd_mpu401 *mpu)
 
 static void uart_interrupt_tx(struct snd_mpu401 *mpu)
 {
+       unsigned long flags;
+
        if (test_bit(MPU401_MODE_BIT_OUTPUT, &mpu->mode) &&
            test_bit(MPU401_MODE_BIT_OUTPUT_TRIGGER, &mpu->mode)) {
-               spin_lock(&mpu->output_lock);
+               spin_lock_irqsave(&mpu->output_lock, flags);
                snd_mpu401_uart_output_write(mpu);
-               spin_unlock(&mpu->output_lock);
+               spin_unlock_irqrestore(&mpu->output_lock, flags);
        }
 }
 
 static void _snd_mpu401_uart_interrupt(struct snd_mpu401 *mpu)
 {
+       unsigned long flags;
+
        if (mpu->info_flags & MPU401_INFO_INPUT) {
-               spin_lock(&mpu->input_lock);
+               spin_lock_irqsave(&mpu->input_lock, flags);
                if (test_bit(MPU401_MODE_BIT_INPUT, &mpu->mode))
                        snd_mpu401_uart_input_read(mpu);
                else
                        snd_mpu401_uart_clear_rx(mpu);
-               spin_unlock(&mpu->input_lock);
+               spin_unlock_irqrestore(&mpu->input_lock, flags);
        }
        if (! (mpu->info_flags & MPU401_INFO_TX_IRQ))
                /* ok. for better Tx performance try do some output
index e065b2a6444aeefeb122c659aebae4abc152b2f7..1b832870cc84aabdfc19669b7d23378ce4a22c8f 100644 (file)
@@ -668,7 +668,7 @@ static int __devinit snd_portman_probe_port(struct parport *p)
        parport_release(pardev);
        parport_unregister_device(pardev);
 
-       return res;
+       return res ? -EIO : 0;
 }
 
 static void __devinit snd_portman_attach(struct parport *p)
index be519a17dfa513eb22eb610f98c2c0fbfaaf6d87..3f9b5c5600369b5700b4b5ceb48e4fcf8b8f88e8 100644 (file)
@@ -86,7 +86,7 @@ static int snd_ca0106_shared_spdif_get(struct snd_kcontrol *kcontrol,
 {
        struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol);
 
-       ucontrol->value.enumerated.item[0] = emu->spdif_enable;
+       ucontrol->value.integer.value[0] = emu->spdif_enable;
        return 0;
 }
 
@@ -98,11 +98,11 @@ static int snd_ca0106_shared_spdif_put(struct snd_kcontrol *kcontrol,
        int change = 0;
        u32 mask;
 
-       val = ucontrol->value.enumerated.item[0] ;
+       val = !!ucontrol->value.integer.value[0];
        change = (emu->spdif_enable != val);
        if (change) {
                emu->spdif_enable = val;
-               if (val == 1) {
+               if (val) {
                        /* Digital */
                        snd_ca0106_ptr_write(emu, SPDIF_SELECT1, 0, 0xf);
                        snd_ca0106_ptr_write(emu, SPDIF_SELECT2, 0, 0x0b000000);
@@ -159,6 +159,8 @@ static int snd_ca0106_capture_source_put(struct snd_kcontrol *kcontrol,
        u32 source;
 
        val = ucontrol->value.enumerated.item[0] ;
+       if (val >= 6)
+               return -EINVAL;
        change = (emu->capture_source != val);
        if (change) {
                emu->capture_source = val;
@@ -207,6 +209,8 @@ static int snd_ca0106_i2c_capture_source_put(struct snd_kcontrol *kcontrol,
         * for the particular source.
         */
        source_id = ucontrol->value.enumerated.item[0] ;
+       if (source_id >= 4)
+               return -EINVAL;
        change = (emu->i2c_capture_source != source_id);
        if (change) {
                snd_ca0106_i2c_write(emu, ADC_MUX, 0); /* Mute input */
@@ -271,6 +275,8 @@ static int snd_ca0106_capture_mic_line_in_put(struct snd_kcontrol *kcontrol,
        u32 tmp;
 
        val = ucontrol->value.enumerated.item[0] ;
+       if (val > 1)
+               return -EINVAL;
        change = (emu->capture_mic_line_in != val);
        if (change) {
                emu->capture_mic_line_in = val;
@@ -443,7 +449,7 @@ static int snd_ca0106_i2c_volume_put(struct snd_kcontrol *kcontrol,
        ogain = emu->i2c_capture_volume[source_id][0]; /* Left */
        ngain = ucontrol->value.integer.value[0];
        if (ngain > 0xff)
-               return 0;
+               return -EINVAL;
        if (ogain != ngain) {
                if (emu->i2c_capture_source == source_id)
                        snd_ca0106_i2c_write(emu, ADC_ATTEN_ADCL, ((ngain) & 0xff) );
@@ -453,7 +459,7 @@ static int snd_ca0106_i2c_volume_put(struct snd_kcontrol *kcontrol,
        ogain = emu->i2c_capture_volume[source_id][1]; /* Right */
        ngain = ucontrol->value.integer.value[1];
        if (ngain > 0xff)
-               return 0;
+               return -EINVAL;
        if (ogain != ngain) {
                if (emu->i2c_capture_source == source_id)
                        snd_ca0106_i2c_write(emu, ADC_ATTEN_ADCR, ((ngain) & 0xff));
@@ -497,7 +503,7 @@ static int spi_mute_put(struct snd_kcontrol *kcontrol,
        }
 
        ret = snd_ca0106_spi_write(emu, emu->spi_dac_reg[reg]);
-       return ret ? -1 : 1;
+       return ret ? -EINVAL : 1;
 }
 
 #define CA_VOLUME(xname,chid,reg) \
index ae80f51d8c4f357ce267be3ce9131412c76f480f..61f2718ae3598a9c4b109198df404bbb19fabe6f 100644 (file)
@@ -445,13 +445,11 @@ int __devinit snd_ca0106_proc_init(struct snd_ca0106 * emu)
                snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read1);
                entry->c.text.write = snd_ca0106_proc_reg_write;
                entry->mode |= S_IWUSR;
-//             entry->private_data = emu;
        }
        if(! snd_card_proc_new(emu->card, "ca0106_i2c", &entry)) {
-               snd_info_set_text_ops(entry, emu, snd_ca0106_proc_i2c_write);
                entry->c.text.write = snd_ca0106_proc_i2c_write;
+               entry->private_data = emu;
                entry->mode |= S_IWUSR;
-//             entry->private_data = emu;
        }
        if(! snd_card_proc_new(emu->card, "ca0106_regs2", &entry)) 
                snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read2);
index 6832649879cedf4bf1f4c2d4144f448c8d49d6dc..1fa5f004e858fd8d0e0994aa20642e5eb974bede 100644 (file)
@@ -246,10 +246,9 @@ MODULE_PARM_DESC(joystick_port, "Joystick port address.");
 #define CM_MMODE_MASK          0x00000E00      /* model DAA interface mode */
 #define CM_SPDIF_SELECT2       0x00000100      /* for model > 039 ? */
 #define CM_ENCENTER            0x00000080
-#define CM_FLINKON             0x00000080      /* force modem link detection on, model 037 */
+#define CM_FLINKON             0x00000040      /* force modem link detection on, model 037 */
 #define CM_MUTECH1             0x00000040      /* mute PCI ch1 to DAC */
-#define CM_FLINKOFF            0x00000040      /* force modem link detection off, model 037 */
-#define CM_UNKNOWN_18_5                0x00000020      /* ? */
+#define CM_FLINKOFF            0x00000020      /* force modem link detection off, model 037 */
 #define CM_MIDSMP              0x00000010      /* 1/2 interpolation at front end DAC */
 #define CM_UPDDMA_MASK         0x0000000C      /* TDMA position update notification */
 #define CM_UPDDMA_2048         0x00000000
index 54a2034d8edd43e3e3c0fde46cefde33575d0b12..ccacd7b890e82cb5f3293e622496b3deaf5b813d 100644 (file)
@@ -58,6 +58,9 @@ static int snd_emu10k1_spdif_get(struct snd_kcontrol *kcontrol,
        unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
        unsigned long flags;
 
+       /* Limit: emu->spdif_bits */
+       if (idx >= 3)
+               return -EINVAL;
        spin_lock_irqsave(&emu->reg_lock, flags);
        ucontrol->value.iec958.status[0] = (emu->spdif_bits[idx] >> 0) & 0xff;
        ucontrol->value.iec958.status[1] = (emu->spdif_bits[idx] >> 8) & 0xff;
@@ -272,9 +275,12 @@ static int snd_emu1010_output_source_get(struct snd_kcontrol *kcontrol,
                                  struct snd_ctl_elem_value *ucontrol)
 {
        struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
-       int channel;
+       unsigned int channel;
 
        channel = (kcontrol->private_value) & 0xff;
+       /* Limit: emu1010_output_dst, emu->emu1010.output_source */
+       if (channel >= 24)
+               return -EINVAL;
        ucontrol->value.enumerated.item[0] = emu->emu1010.output_source[channel];
        return 0;
 }
@@ -285,11 +291,17 @@ static int snd_emu1010_output_source_put(struct snd_kcontrol *kcontrol,
        struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
        int change = 0;
        unsigned int val;
-       int channel;
+       unsigned int channel;
 
+       val = ucontrol->value.enumerated.item[0];
+       if (val >= 53)
+               return -EINVAL;
        channel = (kcontrol->private_value) & 0xff;
-       if (emu->emu1010.output_source[channel] != ucontrol->value.enumerated.item[0]) {
-               val = emu->emu1010.output_source[channel] = ucontrol->value.enumerated.item[0];
+       /* Limit: emu1010_output_dst, emu->emu1010.output_source */
+       if (channel >= 24)
+               return -EINVAL;
+       if (emu->emu1010.output_source[channel] != val) {
+               emu->emu1010.output_source[channel] = val;
                change = 1;
                snd_emu1010_fpga_link_dst_src_write(emu,
                        emu1010_output_dst[channel], emu1010_src_regs[val]);
@@ -301,9 +313,12 @@ static int snd_emu1010_input_source_get(struct snd_kcontrol *kcontrol,
                                  struct snd_ctl_elem_value *ucontrol)
 {
        struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
-       int channel;
+       unsigned int channel;
 
        channel = (kcontrol->private_value) & 0xff;
+       /* Limit: emu1010_input_dst, emu->emu1010.input_source */
+       if (channel >= 22)
+               return -EINVAL;
        ucontrol->value.enumerated.item[0] = emu->emu1010.input_source[channel];
        return 0;
 }
@@ -314,11 +329,17 @@ static int snd_emu1010_input_source_put(struct snd_kcontrol *kcontrol,
        struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
        int change = 0;
        unsigned int val;
-       int channel;
+       unsigned int channel;
 
+       val = ucontrol->value.enumerated.item[0];
+       if (val >= 53)
+               return -EINVAL;
        channel = (kcontrol->private_value) & 0xff;
-       if (emu->emu1010.input_source[channel] != ucontrol->value.enumerated.item[0]) {
-               val = emu->emu1010.input_source[channel] = ucontrol->value.enumerated.item[0];
+       /* Limit: emu1010_input_dst, emu->emu1010.input_source */
+       if (channel >= 22)
+               return -EINVAL;
+       if (emu->emu1010.input_source[channel] != val) {
+               emu->emu1010.input_source[channel] = val;
                change = 1;
                snd_emu1010_fpga_link_dst_src_write(emu,
                        emu1010_input_dst[channel], emu1010_src_regs[val]);
@@ -533,6 +554,9 @@ static int snd_emu1010_internal_clock_put(struct snd_kcontrol *kcontrol,
        int change = 0;
 
        val = ucontrol->value.enumerated.item[0] ;
+       /* Limit: uinfo->value.enumerated.items = 4; */
+       if (val >= 4)
+               return -EINVAL;
        change = (emu->emu1010.internal_clock != val);
        if (change) {
                emu->emu1010.internal_clock = val;
@@ -669,7 +693,11 @@ static int snd_audigy_i2c_capture_source_put(struct snd_kcontrol *kcontrol,
         * update the capture volume from the cached value
         * for the particular source.
         */
-       source_id = ucontrol->value.enumerated.item[0]; /* Use 2 and 3 */
+       source_id = ucontrol->value.enumerated.item[0];
+       /* Limit: uinfo->value.enumerated.items = 2; */
+       /*        emu->i2c_capture_volume */
+       if (source_id >= 2)
+               return -EINVAL;
        change = (emu->i2c_capture_source != source_id);
        if (change) {
                snd_emu10k1_i2c_write(emu, ADC_MUX, 0); /* Mute input */
@@ -720,9 +748,13 @@ static int snd_audigy_i2c_volume_get(struct snd_kcontrol *kcontrol,
                                 struct snd_ctl_elem_value *ucontrol)
 {
        struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
-       int source_id;
+       unsigned int source_id;
 
        source_id = kcontrol->private_value;
+       /* Limit: emu->i2c_capture_volume */
+        /*        capture_source: uinfo->value.enumerated.items = 2 */
+       if (source_id >= 2)
+               return -EINVAL;
 
        ucontrol->value.integer.value[0] = emu->i2c_capture_volume[source_id][0];
        ucontrol->value.integer.value[1] = emu->i2c_capture_volume[source_id][1];
@@ -735,10 +767,14 @@ static int snd_audigy_i2c_volume_put(struct snd_kcontrol *kcontrol,
        struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
        unsigned int ogain;
        unsigned int ngain;
-       int source_id;
+       unsigned int source_id;
        int change = 0;
 
        source_id = kcontrol->private_value;
+       /* Limit: emu->i2c_capture_volume */
+        /*        capture_source: uinfo->value.enumerated.items = 2 */
+       if (source_id >= 2)
+               return -EINVAL;
        ogain = emu->i2c_capture_volume[source_id][0]; /* Left */
        ngain = ucontrol->value.integer.value[0];
        if (ngain > 0xff)
@@ -746,7 +782,7 @@ static int snd_audigy_i2c_volume_put(struct snd_kcontrol *kcontrol,
        if (ogain != ngain) {
                if (emu->i2c_capture_source == source_id)
                        snd_emu10k1_i2c_write(emu, ADC_ATTEN_ADCL, ((ngain) & 0xff) );
-               emu->i2c_capture_volume[source_id][0] = ucontrol->value.integer.value[0];
+               emu->i2c_capture_volume[source_id][0] = ngain;
                change = 1;
        }
        ogain = emu->i2c_capture_volume[source_id][1]; /* Right */
@@ -756,7 +792,7 @@ static int snd_audigy_i2c_volume_put(struct snd_kcontrol *kcontrol,
        if (ogain != ngain) {
                if (emu->i2c_capture_source == source_id)
                        snd_emu10k1_i2c_write(emu, ADC_ATTEN_ADCR, ((ngain) & 0xff));
-               emu->i2c_capture_volume[source_id][1] = ucontrol->value.integer.value[1];
+               emu->i2c_capture_volume[source_id][1] = ngain;
                change = 1;
        }
 
@@ -877,6 +913,9 @@ static int snd_emu10k1_spdif_put(struct snd_kcontrol *kcontrol,
        unsigned int val;
        unsigned long flags;
 
+       /* Limit: emu->spdif_bits */
+       if (idx >= 3)
+               return -EINVAL;
        val = (ucontrol->value.iec958.status[0] << 0) |
              (ucontrol->value.iec958.status[1] << 8) |
              (ucontrol->value.iec958.status[2] << 16) |
index d619a3842cddb20c2492a6e79d17f4dcf7624947..9fd3135f3118daf4631dfeb546aa1b873ce3dab6 100644 (file)
@@ -742,6 +742,8 @@ static int snd_p16v_capture_source_put(struct snd_kcontrol *kcontrol,
        u32 source;
 
        val = ucontrol->value.enumerated.item[0] ;
+       if (val > 7)
+               return -EINVAL;
        change = (emu->p16v_capture_source != val);
        if (change) {
                emu->p16v_capture_source = val;
@@ -784,6 +786,8 @@ static int snd_p16v_capture_channel_put(struct snd_kcontrol *kcontrol,
        u32 tmp;
 
        val = ucontrol->value.enumerated.item[0] ;
+       if (val > 3)
+               return -EINVAL;
        change = (emu->p16v_capture_channel != val);
        if (change) {
                emu->p16v_capture_channel = val;
index ad4cb38109fcc2de06f0891ea737adc91769f2eb..8cbe3bf1e3170afb798fad92beb5579378877459 100644 (file)
@@ -1625,19 +1625,26 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg,
 
        nid = codec->start_nid;
        for (i = 0; i < codec->num_nodes; i++, nid++) {
-               if (get_wcaps(codec, nid) & AC_WCAP_POWER) {
-                       unsigned int pincap;
-                       /*
-                        * don't power down the widget if it controls eapd
-                        * and EAPD_BTLENABLE is set.
-                        */
-                       pincap = snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP);
-                       if (pincap & AC_PINCAP_EAPD) {
-                               int eapd = snd_hda_codec_read(codec, nid,
-                                       0, AC_VERB_GET_EAPD_BTLENABLE, 0);
-                               eapd &= 0x02;
-                               if (power_state == AC_PWRST_D3 && eapd)
-                                       continue;
+               unsigned int wcaps = get_wcaps(codec, nid);
+               if (wcaps & AC_WCAP_POWER) {
+                       unsigned int wid_type = (wcaps & AC_WCAP_TYPE) >>
+                               AC_WCAP_TYPE_SHIFT;
+                       if (wid_type == AC_WID_PIN) {
+                               unsigned int pincap;
+                               /*
+                                * don't power down the widget if it controls
+                                * eapd and EAPD_BTLENABLE is set.
+                                */
+                               pincap = snd_hda_param_read(codec, nid,
+                                                           AC_PAR_PIN_CAP);
+                               if (pincap & AC_PINCAP_EAPD) {
+                                       int eapd = snd_hda_codec_read(codec,
+                                               nid, 0,
+                                               AC_VERB_GET_EAPD_BTLENABLE, 0);
+                                       eapd &= 0x02;
+                                       if (power_state == AC_PWRST_D3 && eapd)
+                                               continue;
+                               }
                        }
                        snd_hda_codec_write(codec, nid, 0,
                                            AC_VERB_SET_POWER_STATE,
@@ -2485,13 +2492,14 @@ int snd_hda_multi_out_analog_prepare(struct hda_codec *codec,
        /* front */
        snd_hda_codec_setup_stream(codec, nids[HDA_FRONT], stream_tag,
                                   0, format);
-       if (mout->hp_nid && mout->hp_nid != nids[HDA_FRONT])
+       if (!mout->no_share_stream &&
+           mout->hp_nid && mout->hp_nid != nids[HDA_FRONT])
                /* headphone out will just decode front left/right (stereo) */
                snd_hda_codec_setup_stream(codec, mout->hp_nid, stream_tag,
                                           0, format);
        /* extra outputs copied from front */
        for (i = 0; i < ARRAY_SIZE(mout->extra_out_nid); i++)
-               if (mout->extra_out_nid[i])
+               if (!mout->no_share_stream && mout->extra_out_nid[i])
                        snd_hda_codec_setup_stream(codec,
                                                   mout->extra_out_nid[i],
                                                   stream_tag, 0, format);
@@ -2501,7 +2509,7 @@ int snd_hda_multi_out_analog_prepare(struct hda_codec *codec,
                if (chs >= (i + 1) * 2) /* independent out */
                        snd_hda_codec_setup_stream(codec, nids[i], stream_tag,
                                                   i * 2, format);
-               else /* copy front */
+               else if (!mout->no_share_stream) /* copy front */
                        snd_hda_codec_setup_stream(codec, nids[i], stream_tag,
                                                   0, format);
        }
index 20c5e6250374b5d1a61d96e01d0789035b140bf5..8c56c9cb0d09523b7cb9eca6adbd24a0025c2bb9 100644 (file)
@@ -220,6 +220,7 @@ struct hda_multi_out {
        hda_nid_t dig_out_nid;  /* digital out audio widget */
        int max_channels;       /* currently supported analog channels */
        int dig_out_used;       /* current usage of digital out (HDA_DIG_XXX) */
+       int no_share_stream;    /* don't share a stream with multiple pins */
 };
 
 int snd_hda_multi_out_dig_open(struct hda_codec *codec,
index 0ee8ae4d4410b89c7405ac3c5c25ba111fc8703d..196ad3c9405d9b35e65f418ff97a6fd2a87faf28 100644 (file)
@@ -957,6 +957,14 @@ static int patch_ad1986a(struct hda_codec *codec)
                break;
        }
 
+       /* AD1986A has a hardware problem that it can't share a stream
+        * with multiple output pins.  The copy of front to surrounds
+        * causes noisy or silent outputs at a certain timing, e.g.
+        * changing the volume.
+        * So, let's disable the shared stream.
+        */
+       spec->multiout.no_share_stream = 1;
+
        return 0;
 }
 
index d9f78c809ee977e8a79ff926be121d5d93d7cc0c..1c502789cc1ed001a7360e50425694f3635260ce 100644 (file)
@@ -9299,7 +9299,6 @@ static struct alc_config_preset alc268_presets[] = {
                .num_channel_mode = ARRAY_SIZE(alc268_modes),
                .channel_mode = alc268_modes,
                .input_mux = &alc268_capture_source,
-               .input_mux = &alc268_capture_source,
                .unsol_event = alc268_toshiba_unsol_event,
                .init_hook = alc268_toshiba_automute,
        },
index f9b2c435a1303ec767193b6d7dcb7197dd60497d..04012237096c18fbba12da7be7ee251691dca160 100644 (file)
@@ -111,7 +111,6 @@ struct sigmatel_spec {
        unsigned int alt_switch: 1;
        unsigned int hp_detect: 1;
        unsigned int gpio_mute: 1;
-       unsigned int no_vol_knob :1;
 
        unsigned int gpio_mask, gpio_data;
 
@@ -342,42 +341,6 @@ static int stac92xx_aloopback_put(struct snd_kcontrol *kcontrol,
        return 1;
 }
 
-static int stac92xx_volknob_info(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_info *uinfo)
-{
-       uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
-       uinfo->count = 1;
-       uinfo->value.integer.min = 0;
-       uinfo->value.integer.max = 127;
-       return 0;
-}
-
-static int stac92xx_volknob_get(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_value *ucontrol)
-{
-       ucontrol->value.integer.value[0] = kcontrol->private_value & 0xff;
-       return 0;
-}
-
-static int stac92xx_volknob_put(struct snd_kcontrol *kcontrol,
-               struct snd_ctl_elem_value *ucontrol)
-{
-       struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
-       unsigned int val = kcontrol->private_value & 0xff;
-
-       if (val == ucontrol->value.integer.value[0])
-               return 0;
-
-       val = ucontrol->value.integer.value[0];
-       kcontrol->private_value &= ~0xff;
-       kcontrol->private_value |= val;
-
-       snd_hda_codec_write_cache(codec, kcontrol->private_value >> 16, 0,
-               AC_VERB_SET_VOLUME_KNOB_CONTROL, val | 0x80);
-       return 1;
-}
-
-
 static struct hda_verb stac9200_core_init[] = {
        /* set dac0mux for dac converter */
        { 0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
@@ -446,18 +409,6 @@ static struct hda_verb stac9205_core_init[] = {
                .private_value = verb_read | (verb_write << 16), \
        }
 
-#define STAC_VOLKNOB(knob_nid) \
-       { \
-               .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
-               .name  = "Master Playback Volume", \
-               .count = 1, \
-               .info  = stac92xx_volknob_info, \
-               .get   = stac92xx_volknob_get, \
-               .put   = stac92xx_volknob_put, \
-                       .private_value = 127 | (knob_nid << 16), \
-       }
-
-
 static struct snd_kcontrol_new stac9200_mixer[] = {
        HDA_CODEC_VOLUME("Master Playback Volume", 0xb, 0, HDA_OUTPUT),
        HDA_CODEC_MUTE("Master Playback Switch", 0xb, 0, HDA_OUTPUT),
@@ -487,7 +438,6 @@ static struct snd_kcontrol_new stac9205_mixer[] = {
        },
        STAC_INPUT_SOURCE(2),
        STAC_ANALOG_LOOPBACK(0xFE0, 0x7E0),
-       STAC_VOLKNOB(0x24),
 
        HDA_CODEC_VOLUME_IDX("Capture Volume", 0x0, 0x1b, 0x0, HDA_INPUT),
        HDA_CODEC_MUTE_IDX("Capture Switch", 0x0, 0x1d, 0x0, HDA_OUTPUT),
@@ -503,7 +453,6 @@ static struct snd_kcontrol_new stac9205_mixer[] = {
 /* This needs to be generated dynamically based on sequence */
 static struct snd_kcontrol_new stac922x_mixer[] = {
        STAC_INPUT_SOURCE(2),
-       STAC_VOLKNOB(0x16),
        HDA_CODEC_VOLUME_IDX("Capture Volume", 0x0, 0x17, 0x0, HDA_INPUT),
        HDA_CODEC_MUTE_IDX("Capture Switch", 0x0, 0x17, 0x0, HDA_INPUT),
        HDA_CODEC_VOLUME_IDX("Mux Capture Volume", 0x0, 0x12, 0x0, HDA_OUTPUT),
@@ -517,7 +466,6 @@ static struct snd_kcontrol_new stac922x_mixer[] = {
 
 static struct snd_kcontrol_new stac927x_mixer[] = {
        STAC_INPUT_SOURCE(3),
-       STAC_VOLKNOB(0x24),
        STAC_ANALOG_LOOPBACK(0xFEB, 0x7EB),
 
        HDA_CODEC_VOLUME_IDX("Capture Volume", 0x0, 0x18, 0x0, HDA_INPUT),
@@ -1931,8 +1879,7 @@ static int stac92xx_auto_create_hp_ctls(struct hda_codec *codec,
        }
        if (spec->multiout.hp_nid) {
                const char *pfx;
-               if (old_num_dacs == spec->multiout.num_dacs &&
-                   spec->no_vol_knob)
+               if (old_num_dacs == spec->multiout.num_dacs)
                        pfx = "Master";
                else
                        pfx = "Headphone";
@@ -2489,7 +2436,6 @@ static int patch_stac9200(struct hda_codec *codec)
        codec->spec = spec;
        spec->num_pins = ARRAY_SIZE(stac9200_pin_nids);
        spec->pin_nids = stac9200_pin_nids;
-       spec->no_vol_knob = 1;
        spec->board_config = snd_hda_check_board_config(codec, STAC_9200_MODELS,
                                                        stac9200_models,
                                                        stac9200_cfg_tbl);
@@ -2544,7 +2490,6 @@ static int patch_stac925x(struct hda_codec *codec)
        codec->spec = spec;
        spec->num_pins = ARRAY_SIZE(stac925x_pin_nids);
        spec->pin_nids = stac925x_pin_nids;
-       spec->no_vol_knob = 1;
        spec->board_config = snd_hda_check_board_config(codec, STAC_925x_MODELS,
                                                        stac925x_models,
                                                        stac925x_cfg_tbl);
index 5d601ad6da705d51700d3e4a67e9ebb9df4c990f..abac62866da80e2db722d6ddb7937119a7124caa 100644 (file)
@@ -725,7 +725,8 @@ static int cs4270_probe(struct platform_device *pdev)
        codec->owner = THIS_MODULE;
        codec->dai = &cs4270_dai;
        codec->num_dai = 1;
-       codec->private_data = codec + ALIGN(sizeof(struct snd_soc_codec), 4);
+       codec->private_data = (void *) codec +
+               ALIGN(sizeof(struct snd_soc_codec), 4);
 
        socdev->codec = codec;
 
index 75acf7ef552809a12ae71e566b5b5525d276602e..758a2637e7ac408d7eb46ba4bf16f051e9ea9e00 100644 (file)
@@ -32,7 +32,7 @@
 
 #include <asm/hardware.h>
 #include <asm/io.h>
-#include <asm/arch/regs-ac97.h>
+#include <asm/plat-s3c/regs-ac97.h>
 #include <asm/arch/regs-gpio.h>
 #include <asm/arch/regs-clock.h>
 #include <asm/arch/audio.h>