Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq
authorLinus Torvalds <torvalds@g5.osdl.org>
Tue, 4 Jul 2006 21:00:26 +0000 (14:00 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 4 Jul 2006 21:00:26 +0000 (14:00 -0700)
* master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq:
  Move workqueue exports to where the functions are defined.
  [CPUFREQ] Misc cleanups in ondemand.
  [CPUFREQ] Make ondemand sampling per CPU and remove the mutex usage in sampling path.
  [CPUFREQ] Add queue_delayed_work_on() interface for workqueues.
  [CPUFREQ] Remove slowdown from ondemand sampling path.

4263 files changed:
Documentation/DocBook/mtdnand.tmpl
Documentation/DocBook/videobook.tmpl
Documentation/IPMI.txt
Documentation/arm/IXP4xx
Documentation/digiepca.txt
Documentation/feature-removal-schedule.txt
Documentation/irqflags-tracing.txt [new file with mode: 0644]
Documentation/kernel-parameters.txt
Documentation/lockdep-design.txt [new file with mode: 0644]
Documentation/memory-barriers.txt
Documentation/networking/ipvs-sysctl.txt [new file with mode: 0644]
Documentation/networking/pktgen.txt
Documentation/pci.txt
Documentation/pcmcia/crc32hash.c [new file with mode: 0644]
Documentation/pcmcia/devicetable.txt
Documentation/powerpc/booting-without-of.txt
Documentation/scsi/ChangeLog.megaraid_sas
Documentation/scsi/tmscsim.txt
Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
Documentation/sysctl/vm.txt
Documentation/video4linux/CARDLIST.cx88
MAINTAINERS
Makefile
arch/alpha/boot/bootp.c
arch/alpha/boot/bootpz.c
arch/alpha/boot/main.c
arch/alpha/kernel/alpha_ksyms.c
arch/alpha/kernel/console.c
arch/alpha/kernel/entry.S
arch/alpha/kernel/gct.c
arch/alpha/kernel/head.S
arch/alpha/kernel/irq.c
arch/alpha/kernel/irq_alpha.c
arch/alpha/kernel/irq_i8259.c
arch/alpha/kernel/machvec_impl.h
arch/alpha/kernel/pci.c
arch/alpha/kernel/process.c
arch/alpha/kernel/proto.h
arch/alpha/kernel/smc37c93x.c
arch/alpha/kernel/srm_env.c
arch/alpha/kernel/srmcons.c
arch/alpha/kernel/sys_alcor.c
arch/alpha/kernel/sys_cabriolet.c
arch/alpha/kernel/sys_dp264.c
arch/alpha/kernel/sys_eb64p.c
arch/alpha/kernel/sys_jensen.c
arch/alpha/kernel/sys_mikasa.c
arch/alpha/kernel/sys_noritake.c
arch/alpha/kernel/sys_sable.c
arch/alpha/kernel/sys_sio.c
arch/alpha/kernel/sys_titan.c
arch/alpha/kernel/time.c
arch/alpha/kernel/traps.c
arch/alpha/kernel/vmlinux.lds.S
arch/alpha/lib/callback_srm.S
arch/alpha/lib/udelay.c
arch/alpha/mm/extable.c
arch/alpha/mm/fault.c
arch/alpha/mm/init.c
arch/alpha/mm/numa.c
arch/arm/Kconfig
arch/arm/Makefile
arch/arm/boot/compressed/head-clps7500.S
arch/arm/boot/compressed/head-l7200.S
arch/arm/boot/compressed/head-sa1100.S
arch/arm/boot/compressed/head-sharpsl.S
arch/arm/boot/compressed/head-xscale.S
arch/arm/boot/compressed/head.S
arch/arm/common/gic.c
arch/arm/common/locomo.c
arch/arm/common/sa1111.c
arch/arm/common/time-acorn.c
arch/arm/common/uengine.c
arch/arm/common/via82c505.c
arch/arm/configs/at91rm9200dk_defconfig
arch/arm/configs/at91rm9200ek_defconfig
arch/arm/configs/ateb9200_defconfig
arch/arm/configs/carmeva_defconfig
arch/arm/configs/csb337_defconfig
arch/arm/configs/csb637_defconfig
arch/arm/configs/kafa_defconfig
arch/arm/configs/kb9202_defconfig
arch/arm/configs/omap_h2_1610_defconfig
arch/arm/configs/onearm_defconfig
arch/arm/configs/trizeps4_defconfig [new file with mode: 0644]
arch/arm/kernel/Makefile
arch/arm/kernel/apm.c
arch/arm/kernel/asm-offsets.c
arch/arm/kernel/bios32.c
arch/arm/kernel/compat.c
arch/arm/kernel/debug.S
arch/arm/kernel/ecard.c
arch/arm/kernel/entry-armv.S
arch/arm/kernel/entry-common.S
arch/arm/kernel/entry-header.S
arch/arm/kernel/fiq.c
arch/arm/kernel/head-nommu.S
arch/arm/kernel/head.S
arch/arm/kernel/irq.c
arch/arm/kernel/iwmmxt-notifier.c [new file with mode: 0644]
arch/arm/kernel/iwmmxt.S
arch/arm/kernel/module.c
arch/arm/kernel/process.c
arch/arm/kernel/ptrace.c
arch/arm/kernel/setup.c
arch/arm/kernel/signal.c
arch/arm/kernel/smp.c
arch/arm/kernel/time.c
arch/arm/kernel/traps.c
arch/arm/kernel/vmlinux.lds.S
arch/arm/lib/backtrace.S
arch/arm/lib/bitops.h
arch/arm/lib/ucmpdi2.S
arch/arm/mach-aaec2000/core.c
arch/arm/mach-at91rm9200/Kconfig
arch/arm/mach-at91rm9200/Makefile
arch/arm/mach-at91rm9200/at91rm9200.c [new file with mode: 0644]
arch/arm/mach-at91rm9200/at91rm9200_time.c [new file with mode: 0644]
arch/arm/mach-at91rm9200/board-csb337.c
arch/arm/mach-at91rm9200/board-csb637.c
arch/arm/mach-at91rm9200/board-dk.c
arch/arm/mach-at91rm9200/board-ek.c
arch/arm/mach-at91rm9200/common.c [deleted file]
arch/arm/mach-at91rm9200/devices.c
arch/arm/mach-at91rm9200/gpio.c
arch/arm/mach-at91rm9200/irq.c
arch/arm/mach-at91rm9200/leds.c
arch/arm/mach-at91rm9200/time.c [deleted file]
arch/arm/mach-clps711x/fortunet.c
arch/arm/mach-clps711x/p720t.c
arch/arm/mach-clps711x/time.c
arch/arm/mach-clps7500/core.c
arch/arm/mach-ebsa110/core.c
arch/arm/mach-ep93xx/Kconfig
arch/arm/mach-ep93xx/Makefile
arch/arm/mach-ep93xx/core.c
arch/arm/mach-ep93xx/edb9302.c [new file with mode: 0644]
arch/arm/mach-ep93xx/edb9315a.c [new file with mode: 0644]
arch/arm/mach-ep93xx/gesbc9312.c
arch/arm/mach-ep93xx/ts72xx.c
arch/arm/mach-footbridge/common.c
arch/arm/mach-footbridge/dc21285-timer.c
arch/arm/mach-footbridge/dc21285.c
arch/arm/mach-footbridge/dma.c
arch/arm/mach-footbridge/ebsa285-leds.c
arch/arm/mach-footbridge/isa-irq.c
arch/arm/mach-footbridge/isa-timer.c
arch/arm/mach-footbridge/netwinder-hw.c
arch/arm/mach-footbridge/netwinder-leds.c
arch/arm/mach-h720x/cpu-h7201.c
arch/arm/mach-h720x/cpu-h7202.c
arch/arm/mach-h720x/h7201-eval.c
arch/arm/mach-h720x/h7202-eval.c
arch/arm/mach-imx/time.c
arch/arm/mach-integrator/core.c
arch/arm/mach-integrator/pci_v3.c
arch/arm/mach-integrator/time.c
arch/arm/mach-iop3xx/Kconfig
arch/arm/mach-iop3xx/common.c
arch/arm/mach-iop3xx/iop321-setup.c
arch/arm/mach-iop3xx/iop321-time.c
arch/arm/mach-iop3xx/iop331-setup.c
arch/arm/mach-iop3xx/iop331-time.c
arch/arm/mach-ixp2000/core.c
arch/arm/mach-ixp2000/enp2611.c
arch/arm/mach-ixp2000/ixdp2400.c
arch/arm/mach-ixp2000/ixdp2800.c
arch/arm/mach-ixp2000/ixdp2x00.c
arch/arm/mach-ixp2000/ixdp2x01.c
arch/arm/mach-ixp23xx/core.c
arch/arm/mach-ixp23xx/espresso.c
arch/arm/mach-ixp23xx/ixdp2351.c
arch/arm/mach-ixp23xx/pci.c
arch/arm/mach-ixp23xx/roadrunner.c
arch/arm/mach-ixp4xx/common.c
arch/arm/mach-ixp4xx/coyote-pci.c
arch/arm/mach-ixp4xx/ixdp425-pci.c
arch/arm/mach-ixp4xx/ixdpg425-pci.c
arch/arm/mach-ixp4xx/nas100d-pci.c
arch/arm/mach-ixp4xx/nas100d-power.c
arch/arm/mach-ixp4xx/nslu2-pci.c
arch/arm/mach-ixp4xx/nslu2-power.c
arch/arm/mach-l7200/core.c
arch/arm/mach-lh7a40x/arch-lpd7a40x.c
arch/arm/mach-lh7a40x/time.c
arch/arm/mach-netx/time.c
arch/arm/mach-omap1/Kconfig
arch/arm/mach-omap1/Makefile
arch/arm/mach-omap1/board-ams-delta.c
arch/arm/mach-omap1/board-fsample.c [new file with mode: 0644]
arch/arm/mach-omap1/board-h3.c
arch/arm/mach-omap1/board-innovator.c
arch/arm/mach-omap1/board-osk.c
arch/arm/mach-omap1/clock.c
arch/arm/mach-omap1/devices.c
arch/arm/mach-omap1/fpga.c
arch/arm/mach-omap1/id.c
arch/arm/mach-omap1/io.c
arch/arm/mach-omap1/irq.c
arch/arm/mach-omap1/leds-h2p2-debug.c
arch/arm/mach-omap1/leds-innovator.c
arch/arm/mach-omap1/leds-osk.c
arch/arm/mach-omap1/mux.c
arch/arm/mach-omap1/pm.c
arch/arm/mach-omap1/serial.c
arch/arm/mach-omap1/sleep.S
arch/arm/mach-omap1/time.c
arch/arm/mach-omap2/Kconfig
arch/arm/mach-omap2/Makefile
arch/arm/mach-omap2/board-apollon.c
arch/arm/mach-omap2/clock.c
arch/arm/mach-omap2/clock.h
arch/arm/mach-omap2/devices.c
arch/arm/mach-omap2/gpmc.c [new file with mode: 0644]
arch/arm/mach-omap2/id.c
arch/arm/mach-omap2/io.c
arch/arm/mach-omap2/irq.c
arch/arm/mach-omap2/memory.c
arch/arm/mach-omap2/mux.c
arch/arm/mach-omap2/pm-domain.c [new file with mode: 0644]
arch/arm/mach-omap2/pm.c
arch/arm/mach-omap2/prcm.c
arch/arm/mach-omap2/sleep.S
arch/arm/mach-omap2/sram-fn.S
arch/arm/mach-omap2/timer-gp.c
arch/arm/mach-pnx4008/time.c
arch/arm/mach-pxa/Kconfig
arch/arm/mach-pxa/Makefile
arch/arm/mach-pxa/corgi.c
arch/arm/mach-pxa/idp.c
arch/arm/mach-pxa/leds-idp.c
arch/arm/mach-pxa/leds-lubbock.c
arch/arm/mach-pxa/leds-mainstone.c
arch/arm/mach-pxa/leds-trizeps4.c [new file with mode: 0644]
arch/arm/mach-pxa/leds.c
arch/arm/mach-pxa/leds.h
arch/arm/mach-pxa/lpd270.c
arch/arm/mach-pxa/lubbock.c
arch/arm/mach-pxa/mainstone.c
arch/arm/mach-pxa/pm.c
arch/arm/mach-pxa/poodle.c
arch/arm/mach-pxa/pxa25x.c
arch/arm/mach-pxa/pxa27x.c
arch/arm/mach-pxa/sharpsl_pm.c
arch/arm/mach-pxa/sleep.S
arch/arm/mach-pxa/spitz.c
arch/arm/mach-pxa/standby.S
arch/arm/mach-pxa/time.c
arch/arm/mach-pxa/tosa.c
arch/arm/mach-pxa/trizeps4.c [new file with mode: 0644]
arch/arm/mach-realview/core.c
arch/arm/mach-realview/realview_eb.c
arch/arm/mach-rpc/dma.c
arch/arm/mach-s3c2410/bast-irq.c
arch/arm/mach-s3c2410/devs.h
arch/arm/mach-s3c2410/dma.c
arch/arm/mach-s3c2410/pm.c
arch/arm/mach-s3c2410/sleep.S
arch/arm/mach-s3c2410/time.c
arch/arm/mach-s3c2410/usb-simtec.c
arch/arm/mach-sa1100/assabet.c
arch/arm/mach-sa1100/cerf.c
arch/arm/mach-sa1100/collie.c
arch/arm/mach-sa1100/collie_pm.c
arch/arm/mach-sa1100/cpu-sa1110.c
arch/arm/mach-sa1100/dma.c
arch/arm/mach-sa1100/generic.c
arch/arm/mach-sa1100/h3600.c
arch/arm/mach-sa1100/irq.c
arch/arm/mach-sa1100/leds-assabet.c
arch/arm/mach-sa1100/leds-badge4.c
arch/arm/mach-sa1100/leds-cerf.c
arch/arm/mach-sa1100/leds-hackkit.c
arch/arm/mach-sa1100/leds-lart.c
arch/arm/mach-sa1100/leds-simpad.c
arch/arm/mach-sa1100/pleb.c
arch/arm/mach-sa1100/shannon.c
arch/arm/mach-sa1100/simpad.c
arch/arm/mach-sa1100/time.c
arch/arm/mach-shark/core.c
arch/arm/mach-shark/dma.c
arch/arm/mach-shark/leds.c
arch/arm/mach-versatile/core.c
arch/arm/mach-versatile/pci.c
arch/arm/mach-versatile/versatile_ab.c
arch/arm/mach-versatile/versatile_pb.c
arch/arm/mm/Kconfig
arch/arm/mm/alignment.c
arch/arm/mm/cache-v4wb.S
arch/arm/mm/fault.c
arch/arm/mm/init.c
arch/arm/mm/ioremap.c
arch/arm/mm/mm-armv.c
arch/arm/mm/mmap.c
arch/arm/mm/proc-arm1020.S
arch/arm/mm/proc-arm1020e.S
arch/arm/mm/proc-arm1022.S
arch/arm/mm/proc-arm1026.S
arch/arm/mm/proc-arm6_7.S
arch/arm/mm/proc-arm720.S
arch/arm/mm/proc-arm920.S
arch/arm/mm/proc-arm922.S
arch/arm/mm/proc-arm925.S
arch/arm/mm/proc-arm926.S
arch/arm/mm/proc-macros.S
arch/arm/mm/proc-sa110.S
arch/arm/mm/proc-sa1100.S
arch/arm/mm/proc-v6.S
arch/arm/mm/proc-xsc3.S
arch/arm/mm/proc-xscale.S
arch/arm/nwfpe/fpa11.c
arch/arm/nwfpe/fpa11.h
arch/arm/nwfpe/fpa11_cpdo.c
arch/arm/nwfpe/fpa11_cpdt.c
arch/arm/nwfpe/fpa11_cprt.c
arch/arm/nwfpe/fpmodule.c
arch/arm/nwfpe/fpopcode.c
arch/arm/nwfpe/fpopcode.h
arch/arm/nwfpe/softfloat.h
arch/arm/oprofile/op_model_xscale.c
arch/arm/plat-omap/Kconfig
arch/arm/plat-omap/clock.c
arch/arm/plat-omap/common.c
arch/arm/plat-omap/cpu-omap.c
arch/arm/plat-omap/devices.c
arch/arm/plat-omap/dma.c
arch/arm/plat-omap/dmtimer.c
arch/arm/plat-omap/fb.c
arch/arm/plat-omap/gpio.c
arch/arm/plat-omap/mux.c
arch/arm/plat-omap/ocpi.c
arch/arm/plat-omap/pm.c
arch/arm/plat-omap/sram-fn.S
arch/arm/plat-omap/sram.c
arch/arm/plat-omap/timer32k.c
arch/arm/plat-omap/usb.c
arch/arm/vfp/vfpmodule.c
arch/arm26/Kconfig
arch/arm26/boot/compressed/head.S
arch/arm26/kernel/armksyms.c
arch/arm26/kernel/asm-offsets.c
arch/arm26/kernel/compat.c
arch/arm26/kernel/ecard.c
arch/arm26/kernel/fiq.c
arch/arm26/kernel/head.S
arch/arm26/kernel/irq.c
arch/arm26/kernel/process.c
arch/arm26/kernel/ptrace.c
arch/arm26/kernel/semaphore.c
arch/arm26/kernel/setup.c
arch/arm26/kernel/signal.c
arch/arm26/kernel/time.c
arch/arm26/kernel/traps.c
arch/arm26/kernel/vmlinux.lds.S
arch/arm26/lib/backtrace.S
arch/arm26/lib/csumpartialcopyuser.S
arch/arm26/lib/kbd.c
arch/arm26/lib/lib1funcs.S
arch/arm26/machine/dma.c
arch/arm26/machine/irq.c
arch/arm26/mm/extable.c
arch/arm26/mm/fault.c
arch/arm26/mm/init.c
arch/arm26/nwfpe/fpmodule.c
arch/arm26/nwfpe/fpmodule.h
arch/cris/arch-v10/boot/compressed/head.S
arch/cris/arch-v10/boot/compressed/misc.c
arch/cris/arch-v10/boot/rescue/head.S
arch/cris/arch-v10/boot/rescue/kimagerescue.S
arch/cris/arch-v10/drivers/axisflashmap.c
arch/cris/arch-v10/drivers/ds1302.c
arch/cris/arch-v10/drivers/eeprom.c
arch/cris/arch-v10/drivers/gpio.c
arch/cris/arch-v10/drivers/i2c.c
arch/cris/arch-v10/drivers/pcf8563.c
arch/cris/arch-v10/kernel/crisksyms.c
arch/cris/arch-v10/kernel/debugport.c
arch/cris/arch-v10/kernel/entry.S
arch/cris/arch-v10/kernel/fasttimer.c
arch/cris/arch-v10/kernel/head.S
arch/cris/arch-v10/kernel/irq.c
arch/cris/arch-v10/kernel/process.c
arch/cris/arch-v10/kernel/setup.c
arch/cris/arch-v10/kernel/time.c
arch/cris/arch-v10/kernel/traps.c
arch/cris/arch-v10/lib/dram_init.S
arch/cris/arch-v10/mm/init.c
arch/cris/arch-v10/vmlinux.lds.S
arch/cris/arch-v32/boot/compressed/head.S
arch/cris/arch-v32/boot/compressed/misc.c
arch/cris/arch-v32/boot/rescue/head.S
arch/cris/arch-v32/drivers/axisflashmap.c
arch/cris/arch-v32/drivers/gpio.c
arch/cris/arch-v32/drivers/i2c.c
arch/cris/arch-v32/drivers/pcf8563.c
arch/cris/arch-v32/drivers/sync_serial.c
arch/cris/arch-v32/kernel/arbiter.c
arch/cris/arch-v32/kernel/crisksyms.c
arch/cris/arch-v32/kernel/debugport.c
arch/cris/arch-v32/kernel/dma.c
arch/cris/arch-v32/kernel/entry.S
arch/cris/arch-v32/kernel/fasttimer.c
arch/cris/arch-v32/kernel/head.S
arch/cris/arch-v32/kernel/io.c
arch/cris/arch-v32/kernel/irq.c
arch/cris/arch-v32/kernel/kgdb_asm.S
arch/cris/arch-v32/kernel/process.c
arch/cris/arch-v32/kernel/setup.c
arch/cris/arch-v32/kernel/smp.c
arch/cris/arch-v32/kernel/time.c
arch/cris/arch-v32/kernel/traps.c
arch/cris/arch-v32/lib/dram_init.S
arch/cris/arch-v32/lib/hw_settings.S
arch/cris/arch-v32/lib/nand_init.S
arch/cris/arch-v32/mm/init.c
arch/cris/arch-v32/vmlinux.lds.S
arch/cris/kernel/crisksyms.c
arch/cris/kernel/irq.c
arch/cris/kernel/setup.c
arch/frv/kernel/break.S
arch/frv/kernel/cmode.S
arch/frv/kernel/entry-table.S
arch/frv/kernel/entry.S
arch/frv/kernel/frv_ksyms.c
arch/frv/kernel/head-mmu-fr451.S
arch/frv/kernel/head-uc-fr401.S
arch/frv/kernel/head-uc-fr451.S
arch/frv/kernel/head-uc-fr555.S
arch/frv/kernel/head.S
arch/frv/kernel/irq-mb93091.c
arch/frv/kernel/irq-mb93093.c
arch/frv/kernel/irq-mb93493.c
arch/frv/kernel/irq-routing.c
arch/frv/kernel/irq.c
arch/frv/kernel/pm-mb93093.c
arch/frv/kernel/pm.c
arch/frv/kernel/process.c
arch/frv/kernel/ptrace.c
arch/frv/kernel/semaphore.c
arch/frv/kernel/setup.c
arch/frv/kernel/sleep.S
arch/frv/kernel/switch_to.S
arch/frv/kernel/sysctl.c
arch/frv/kernel/time.c
arch/frv/kernel/traps.c
arch/frv/mb93090-mb00/pci-irq.c
arch/frv/mb93090-mb00/pci-vdk.c
arch/frv/mm/dma-alloc.c
arch/frv/mm/extable.c
arch/frv/mm/init.c
arch/frv/mm/kmap.c
arch/frv/mm/tlb-flush.S
arch/frv/mm/tlb-miss.S
arch/frv/mm/unaligned.c
arch/h8300/kernel/gpio.c
arch/h8300/kernel/h8300_ksyms.c
arch/h8300/kernel/ints.c
arch/h8300/kernel/process.c
arch/h8300/kernel/ptrace.c
arch/h8300/kernel/semaphore.c
arch/h8300/kernel/setup.c
arch/h8300/kernel/syscalls.S
arch/h8300/kernel/vmlinux.lds.S
arch/h8300/lib/romfs.S
arch/h8300/mm/init.c
arch/h8300/mm/kmap.c
arch/h8300/mm/memory.c
arch/h8300/platform/h8300h/aki3068net/crt0_ram.S
arch/h8300/platform/h8300h/aki3068net/timer.c
arch/h8300/platform/h8300h/entry.S
arch/h8300/platform/h8300h/generic/crt0_ram.S
arch/h8300/platform/h8300h/generic/crt0_rom.S
arch/h8300/platform/h8300h/generic/timer.c
arch/h8300/platform/h8300h/h8max/crt0_ram.S
arch/h8300/platform/h8300h/h8max/timer.c
arch/h8300/platform/h8300h/ints_h8300h.c
arch/h8300/platform/h8s/edosk2674/crt0_ram.S
arch/h8300/platform/h8s/edosk2674/crt0_rom.S
arch/h8300/platform/h8s/edosk2674/timer.c
arch/h8300/platform/h8s/entry.S
arch/h8300/platform/h8s/generic/crt0_ram.S
arch/h8300/platform/h8s/generic/crt0_rom.S
arch/h8300/platform/h8s/generic/timer.c
arch/h8300/platform/h8s/ints.c
arch/h8300/platform/h8s/ints_h8s.c
arch/i386/Kconfig
arch/i386/Kconfig.debug
arch/i386/boot/setup.S
arch/i386/kernel/Makefile
arch/i386/kernel/acpi/boot.c
arch/i386/kernel/alternative.c
arch/i386/kernel/apic.c
arch/i386/kernel/apm.c
arch/i386/kernel/audit.c [new file with mode: 0644]
arch/i386/kernel/bootflag.c
arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
arch/i386/kernel/cpu/cpufreq/p4-clockmod.c
arch/i386/kernel/cpu/cpufreq/powernow-k7.c
arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
arch/i386/kernel/cpu/intel.c
arch/i386/kernel/cpu/mcheck/k7.c
arch/i386/kernel/cpu/mcheck/mce.c
arch/i386/kernel/cpu/mcheck/non-fatal.c
arch/i386/kernel/cpu/mcheck/p4.c
arch/i386/kernel/cpuid.c
arch/i386/kernel/efi.c
arch/i386/kernel/efi_stub.S
arch/i386/kernel/entry.S
arch/i386/kernel/head.S
arch/i386/kernel/i386_ksyms.c
arch/i386/kernel/i387.c
arch/i386/kernel/i8259.c
arch/i386/kernel/io_apic.c
arch/i386/kernel/irq.c
arch/i386/kernel/kprobes.c
arch/i386/kernel/mca.c
arch/i386/kernel/mpparse.c
arch/i386/kernel/msr.c
arch/i386/kernel/nmi.c
arch/i386/kernel/numaq.c
arch/i386/kernel/process.c
arch/i386/kernel/quirks.c
arch/i386/kernel/reboot.c
arch/i386/kernel/scx200.c
arch/i386/kernel/semaphore.c
arch/i386/kernel/setup.c
arch/i386/kernel/smpboot.c
arch/i386/kernel/srat.c
arch/i386/kernel/stacktrace.c [new file with mode: 0644]
arch/i386/kernel/time.c
arch/i386/kernel/time_hpet.c
arch/i386/kernel/traps.c
arch/i386/kernel/vm86.c
arch/i386/lib/checksum.S
arch/i386/lib/memcpy.c
arch/i386/lib/mmx.c
arch/i386/lib/usercopy.c
arch/i386/mach-default/setup.c
arch/i386/mach-generic/bigsmp.c
arch/i386/mach-generic/default.c
arch/i386/mach-generic/es7000.c
arch/i386/mach-generic/probe.c
arch/i386/mach-generic/summit.c
arch/i386/mach-visws/mpparse.c
arch/i386/mach-visws/setup.c
arch/i386/mach-visws/traps.c
arch/i386/mach-visws/visws_apic.c
arch/i386/mach-voyager/setup.c
arch/i386/mach-voyager/voyager_basic.c
arch/i386/mach-voyager/voyager_cat.c
arch/i386/mach-voyager/voyager_smp.c
arch/i386/mach-voyager/voyager_thread.c
arch/i386/mm/boot_ioremap.c
arch/i386/mm/discontig.c
arch/i386/mm/extable.c
arch/i386/mm/fault.c
arch/i386/mm/hugetlbpage.c
arch/i386/mm/init.c
arch/i386/mm/pageattr.c
arch/i386/mm/pgtable.c
arch/i386/pci/init.c
arch/i386/pci/irq.c
arch/i386/pci/visws.c
arch/i386/power/cpu.c
arch/ia64/Kconfig
arch/ia64/dig/setup.c
arch/ia64/hp/common/sba_iommu.c
arch/ia64/hp/sim/boot/bootloader.c
arch/ia64/hp/sim/boot/fw-emu.c
arch/ia64/hp/sim/hpsim_console.c
arch/ia64/hp/sim/hpsim_setup.c
arch/ia64/hp/sim/simeth.c
arch/ia64/hp/sim/simserial.c
arch/ia64/ia32/Makefile
arch/ia64/ia32/audit.c [new file with mode: 0644]
arch/ia64/ia32/binfmt_elf32.c
arch/ia64/ia32/ia32priv.h
arch/ia64/ia32/sys_ia32.c
arch/ia64/kernel/Makefile
arch/ia64/kernel/acpi-ext.c
arch/ia64/kernel/acpi.c
arch/ia64/kernel/asm-offsets.c
arch/ia64/kernel/audit.c [new file with mode: 0644]
arch/ia64/kernel/cpufreq/acpi-cpufreq.c
arch/ia64/kernel/efi.c
arch/ia64/kernel/entry.S
arch/ia64/kernel/entry.h
arch/ia64/kernel/gate.S
arch/ia64/kernel/gate.lds.S
arch/ia64/kernel/head.S
arch/ia64/kernel/ia64_ksyms.c
arch/ia64/kernel/iosapic.c
arch/ia64/kernel/irq_ia64.c
arch/ia64/kernel/ivt.S
arch/ia64/kernel/kprobes.c
arch/ia64/kernel/machvec.c
arch/ia64/kernel/mca.c
arch/ia64/kernel/mca_asm.S
arch/ia64/kernel/mca_drv.c
arch/ia64/kernel/mca_drv_asm.S
arch/ia64/kernel/minstate.h
arch/ia64/kernel/module.c
arch/ia64/kernel/numa.c
arch/ia64/kernel/palinfo.c
arch/ia64/kernel/perfmon.c
arch/ia64/kernel/perfmon_default_smpl.c
arch/ia64/kernel/process.c
arch/ia64/kernel/ptrace.c
arch/ia64/kernel/sal.c
arch/ia64/kernel/setup.c
arch/ia64/kernel/signal.c
arch/ia64/kernel/smpboot.c
arch/ia64/kernel/sys_ia64.c
arch/ia64/kernel/time.c
arch/ia64/kernel/topology.c
arch/ia64/kernel/traps.c
arch/ia64/kernel/vmlinux.lds.S
arch/ia64/lib/clear_page.S
arch/ia64/lib/io.c
arch/ia64/lib/memcpy_mck.S
arch/ia64/mm/contig.c
arch/ia64/mm/discontig.c
arch/ia64/mm/extable.c
arch/ia64/mm/hugetlbpage.c
arch/ia64/mm/init.c
arch/ia64/mm/numa.c
arch/ia64/mm/tlb.c
arch/ia64/oprofile/perfmon.c
arch/ia64/pci/pci.c
arch/ia64/sn/kernel/bte.c
arch/ia64/sn/kernel/huberror.c
arch/ia64/sn/kernel/setup.c
arch/ia64/sn/kernel/sn2/prominfo_proc.c
arch/ia64/sn/kernel/sn2/sn_proc_fs.c
arch/ia64/sn/kernel/xpc_channel.c
arch/ia64/sn/kernel/xpnet.c
arch/ia64/sn/pci/pcibr/pcibr_provider.c
arch/ia64/sn/pci/tioca_provider.c
arch/ia64/sn/pci/tioce_provider.c
arch/m32r/boot/compressed/head.S
arch/m32r/boot/compressed/m32r_sio.c
arch/m32r/boot/compressed/misc.c
arch/m32r/boot/compressed/vmlinux.lds.S
arch/m32r/boot/setup.S
arch/m32r/kernel/align.c
arch/m32r/kernel/entry.S
arch/m32r/kernel/head.S
arch/m32r/kernel/io_m32104ut.c
arch/m32r/kernel/io_m32700ut.c
arch/m32r/kernel/io_mappi.c
arch/m32r/kernel/io_mappi2.c
arch/m32r/kernel/io_mappi3.c
arch/m32r/kernel/io_oaks32r.c
arch/m32r/kernel/io_opsput.c
arch/m32r/kernel/io_usrv.c
arch/m32r/kernel/m32r_ksyms.c
arch/m32r/kernel/module.c
arch/m32r/kernel/process.c
arch/m32r/kernel/ptrace.c
arch/m32r/kernel/semaphore.c
arch/m32r/kernel/setup.c
arch/m32r/kernel/setup_m32104ut.c
arch/m32r/kernel/setup_m32700ut.c
arch/m32r/kernel/setup_mappi.c
arch/m32r/kernel/setup_mappi2.c
arch/m32r/kernel/setup_mappi3.c
arch/m32r/kernel/setup_oaks32r.c
arch/m32r/kernel/setup_opsput.c
arch/m32r/kernel/setup_usrv.c
arch/m32r/kernel/signal.c
arch/m32r/kernel/smpboot.c
arch/m32r/kernel/sys_m32r.c
arch/m32r/kernel/time.c
arch/m32r/kernel/traps.c
arch/m32r/kernel/vmlinux.lds.S
arch/m32r/lib/ashxdi3.S
arch/m32r/lib/checksum.S
arch/m32r/lib/delay.c
arch/m32r/lib/memcpy.S
arch/m32r/lib/memset.S
arch/m32r/lib/strlen.S
arch/m32r/lib/usercopy.c
arch/m32r/mm/cache.c
arch/m32r/mm/discontig.c
arch/m32r/mm/fault-nommu.c
arch/m32r/mm/fault.c
arch/m68k/amiga/amiga_ksyms.c
arch/m68k/amiga/amiints.c
arch/m68k/amiga/amisound.c
arch/m68k/amiga/chipram.c
arch/m68k/amiga/cia.c
arch/m68k/amiga/config.c
arch/m68k/apollo/config.c
arch/m68k/atari/config.c
arch/m68k/atari/debug.c
arch/m68k/atari/hades-pci.c
arch/m68k/atari/stram.c
arch/m68k/hp300/config.c
arch/m68k/kernel/bios32.c
arch/m68k/kernel/entry.S
arch/m68k/kernel/head.S
arch/m68k/kernel/ints.c
arch/m68k/kernel/m68k_ksyms.c
arch/m68k/kernel/process.c
arch/m68k/kernel/ptrace.c
arch/m68k/kernel/semaphore.c
arch/m68k/kernel/setup.c
arch/m68k/kernel/traps.c
arch/m68k/kernel/vmlinux.lds.S
arch/m68k/mac/config.c
arch/m68k/mac/debug.c
arch/m68k/mac/iop.c
arch/m68k/mac/misc.c
arch/m68k/math-emu/fp_entry.S
arch/m68k/math-emu/fp_util.S
arch/m68k/mm/init.c
arch/m68k/mm/kmap.c
arch/m68k/mm/memory.c
arch/m68k/mm/motorola.c
arch/m68k/q40/config.c
arch/m68k/sun3/config.c
arch/m68k/sun3/prom/init.c
arch/m68k/sun3/prom/printf.c
arch/m68k/sun3/sun3dvma.c
arch/m68k/sun3/sun3ints.c
arch/m68k/sun3x/config.c
arch/m68knommu/kernel/comempci.c
arch/m68knommu/kernel/entry.S
arch/m68knommu/kernel/m68k_ksyms.c
arch/m68knommu/kernel/process.c
arch/m68knommu/kernel/ptrace.c
arch/m68knommu/kernel/semaphore.c
arch/m68knommu/kernel/setup.c
arch/m68knommu/kernel/syscalltable.S
arch/m68knommu/kernel/time.c
arch/m68knommu/kernel/traps.c
arch/m68knommu/kernel/vmlinux.lds.S
arch/m68knommu/lib/semaphore.S
arch/m68knommu/mm/init.c
arch/m68knommu/mm/kmap.c
arch/m68knommu/mm/memory.c
arch/m68knommu/platform/5206/config.c
arch/m68knommu/platform/5206e/config.c
arch/m68knommu/platform/520x/config.c
arch/m68knommu/platform/523x/config.c
arch/m68knommu/platform/5249/config.c
arch/m68knommu/platform/5272/config.c
arch/m68knommu/platform/527x/config.c
arch/m68knommu/platform/528x/config.c
arch/m68knommu/platform/5307/config.c
arch/m68knommu/platform/5307/entry.S
arch/m68knommu/platform/5307/head.S
arch/m68knommu/platform/5307/ints.c
arch/m68knommu/platform/5307/pit.c
arch/m68knommu/platform/5307/timers.c
arch/m68knommu/platform/5307/vectors.c
arch/m68knommu/platform/5407/config.c
arch/m68knommu/platform/68328/config.c
arch/m68knommu/platform/68328/entry.S
arch/m68knommu/platform/68328/head-de2.S
arch/m68knommu/platform/68328/head-pilot.S
arch/m68knommu/platform/68328/head-ram.S
arch/m68knommu/platform/68328/head-rom.S
arch/m68knommu/platform/68328/timers.c
arch/m68knommu/platform/68360/config.c
arch/m68knommu/platform/68360/entry.S
arch/m68knommu/platform/68360/head-ram.S
arch/m68knommu/platform/68360/head-rom.S
arch/m68knommu/platform/68360/ints.c
arch/m68knommu/platform/68EZ328/config.c
arch/m68knommu/platform/68VZ328/config.c
arch/mips/arc/identify.c
arch/mips/au1000/common/au1xxx_irqmap.c
arch/mips/au1000/common/dbdma.c
arch/mips/au1000/common/dbg_io.c
arch/mips/au1000/common/dma.c
arch/mips/au1000/common/gpio.c
arch/mips/au1000/common/irq.c
arch/mips/au1000/common/pci.c
arch/mips/au1000/common/platform.c
arch/mips/au1000/common/power.c
arch/mips/au1000/common/reset.c
arch/mips/au1000/common/setup.c
arch/mips/au1000/common/time.c
arch/mips/au1000/common/usbdev.c
arch/mips/au1000/csb250/board_setup.c
arch/mips/au1000/db1x00/board_setup.c
arch/mips/au1000/db1x00/init.c
arch/mips/au1000/db1x00/irqmap.c
arch/mips/au1000/db1x00/mirage_ts.c
arch/mips/au1000/hydrogen3/board_setup.c
arch/mips/au1000/hydrogen3/init.c
arch/mips/au1000/mtx-1/board_setup.c
arch/mips/au1000/pb1000/board_setup.c
arch/mips/au1000/pb1100/board_setup.c
arch/mips/au1000/pb1200/board_setup.c
arch/mips/au1000/pb1200/irqmap.c
arch/mips/au1000/pb1500/board_setup.c
arch/mips/au1000/xxs1500/board_setup.c
arch/mips/basler/excite/excite_iodev.c
arch/mips/cobalt/console.c
arch/mips/cobalt/setup.c
arch/mips/ddb5xxx/common/prom.c
arch/mips/ddb5xxx/ddb5477/irq.c
arch/mips/ddb5xxx/ddb5477/setup.c
arch/mips/dec/int-handler.S
arch/mips/dec/prom/init.c
arch/mips/dec/prom/memory.c
arch/mips/dec/setup.c
arch/mips/galileo-boards/ev96100/setup.c
arch/mips/galileo-boards/ev96100/time.c
arch/mips/gt64120/common/time.c
arch/mips/gt64120/momenco_ocelot/dbg_io.c
arch/mips/ite-boards/generic/dbg_io.c
arch/mips/ite-boards/generic/it8172_cir.c
arch/mips/ite-boards/generic/it8172_setup.c
arch/mips/ite-boards/generic/pmon_prom.c
arch/mips/jazz/setup.c
arch/mips/jmr3927/rbhma3100/init.c
arch/mips/jmr3927/rbhma3100/irq.c
arch/mips/jmr3927/rbhma3100/setup.c
arch/mips/kernel/asm-offsets.c
arch/mips/kernel/cpu-bugs64.c
arch/mips/kernel/cpu-probe.c
arch/mips/kernel/entry.S
arch/mips/kernel/gdb-low.S
arch/mips/kernel/gdb-stub.c
arch/mips/kernel/genex.S
arch/mips/kernel/head.S
arch/mips/kernel/irq.c
arch/mips/kernel/linux32.c
arch/mips/kernel/mips-mt.c
arch/mips/kernel/mips_ksyms.c
arch/mips/kernel/proc.c
arch/mips/kernel/process.c
arch/mips/kernel/ptrace.c
arch/mips/kernel/r2300_switch.S
arch/mips/kernel/r4k_fpu.S
arch/mips/kernel/r4k_switch.S
arch/mips/kernel/rtlx.c
arch/mips/kernel/scall32-o32.S
arch/mips/kernel/scall64-64.S
arch/mips/kernel/scall64-n32.S
arch/mips/kernel/scall64-o32.S
arch/mips/kernel/setup.c
arch/mips/kernel/signal-common.h
arch/mips/kernel/signal.c
arch/mips/kernel/smp-mt.c
arch/mips/kernel/smtc.c
arch/mips/kernel/syscall.c
arch/mips/kernel/time.c
arch/mips/kernel/traps.c
arch/mips/kernel/unaligned.c
arch/mips/kernel/vmlinux.lds.S
arch/mips/lasat/lasat_board.c
arch/mips/lasat/reset.c
arch/mips/lasat/setup.c
arch/mips/lasat/sysctl.c
arch/mips/lib-32/dump_tlb.c
arch/mips/lib-64/dump_tlb.c
arch/mips/lib/memcpy.S
arch/mips/math-emu/kernel_linkage.c
arch/mips/mips-boards/atlas/atlas_setup.c
arch/mips/mips-boards/generic/init.c
arch/mips/mips-boards/generic/memory.c
arch/mips/mips-boards/generic/printf.c
arch/mips/mips-boards/generic/reset.c
arch/mips/mips-boards/generic/time.c
arch/mips/mips-boards/malta/malta_setup.c
arch/mips/mips-boards/sead/sead_setup.c
arch/mips/mips-boards/sim/sim_IRQ.c
arch/mips/mips-boards/sim/sim_irq.S
arch/mips/mips-boards/sim/sim_setup.c
arch/mips/mips-boards/sim/sim_smp.c
arch/mips/mips-boards/sim/sim_time.c
arch/mips/mm/c-r4k.c
arch/mips/mm/c-sb1.c
arch/mips/mm/cache.c
arch/mips/mm/cerr-sb1.c
arch/mips/mm/dma-coherent.c
arch/mips/mm/dma-noncoherent.c
arch/mips/mm/highmem.c
arch/mips/mm/init.c
arch/mips/mm/pg-sb1.c
arch/mips/mm/pgtable-32.c
arch/mips/mm/pgtable.c
arch/mips/mm/tlb-r4k.c
arch/mips/mm/tlb-r8k.c
arch/mips/mm/tlbex.c
arch/mips/momentum/jaguar_atx/dbg_io.c
arch/mips/momentum/jaguar_atx/irq.c
arch/mips/momentum/jaguar_atx/prom.c
arch/mips/momentum/jaguar_atx/reset.c
arch/mips/momentum/jaguar_atx/setup.c
arch/mips/momentum/ocelot_3/irq.c
arch/mips/momentum/ocelot_3/prom.c
arch/mips/momentum/ocelot_c/dbg_io.c
arch/mips/momentum/ocelot_c/irq.c
arch/mips/momentum/ocelot_c/ocelot_c_fpga.h
arch/mips/momentum/ocelot_c/prom.c
arch/mips/momentum/ocelot_c/reset.c
arch/mips/momentum/ocelot_c/setup.c
arch/mips/momentum/ocelot_g/dbg_io.c
arch/mips/momentum/ocelot_g/gt-irq.c
arch/mips/momentum/ocelot_g/prom.c
arch/mips/momentum/ocelot_g/setup.c
arch/mips/pci/fixup-atlas.c
arch/mips/pci/fixup-vr4133.c
arch/mips/pci/ops-au1000.c
arch/mips/pci/pci-bcm1480.c
arch/mips/pci/pci-bcm1480ht.c
arch/mips/pci/pci-ip32.c
arch/mips/pci/pci-sb1250.c
arch/mips/pci/pci.c
arch/mips/philips/pnx8550/common/int.c
arch/mips/philips/pnx8550/common/setup.c
arch/mips/pmc-sierra/yosemite/ht.c
arch/mips/pmc-sierra/yosemite/irq.c
arch/mips/pmc-sierra/yosemite/prom.c
arch/mips/sgi-ip22/ip22-eisa.c
arch/mips/sgi-ip22/ip22-int.c
arch/mips/sgi-ip22/ip22-setup.c
arch/mips/sgi-ip27/ip27-init.c
arch/mips/sgi-ip27/ip27-irq.c
arch/mips/sgi-ip27/ip27-klnuma.c
arch/mips/sgi-ip27/ip27-memory.c
arch/mips/sgi-ip27/ip27-reset.c
arch/mips/sgi-ip27/ip27-timer.c
arch/mips/sgi-ip32/ip32-irq.c
arch/mips/sgi-ip32/ip32-setup.c
arch/mips/sibyte/bcm1480/irq.c
arch/mips/sibyte/bcm1480/setup.c
arch/mips/sibyte/bcm1480/time.c
arch/mips/sibyte/cfe/console.c
arch/mips/sibyte/cfe/setup.c
arch/mips/sibyte/sb1250/bus_watcher.c
arch/mips/sibyte/sb1250/irq.c
arch/mips/sibyte/sb1250/prom.c
arch/mips/sibyte/sb1250/setup.c
arch/mips/sibyte/sb1250/time.c
arch/mips/sibyte/swarm/setup.c
arch/mips/sni/setup.c
arch/mips/tx4927/common/tx4927_irq.c
arch/mips/tx4927/common/tx4927_setup.c
arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c
arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c
arch/mips/tx4938/toshiba_rbtx4938/prom.c
arch/mips/tx4938/toshiba_rbtx4938/setup.c
arch/mips/tx4938/toshiba_rbtx4938/spi_eeprom.c
arch/mips/vr41xx/nec-cmbvr4133/init.c
arch/mips/vr41xx/nec-cmbvr4133/m1535plus.c
arch/mips/vr41xx/nec-cmbvr4133/setup.c
arch/parisc/kernel/entry.S
arch/parisc/kernel/irq.c
arch/parisc/kernel/pacache.S
arch/parisc/kernel/parisc_ksyms.c
arch/parisc/kernel/pci.c
arch/parisc/kernel/pdc_cons.c
arch/parisc/kernel/perf_asm.S
arch/parisc/kernel/processor.c
arch/parisc/kernel/real2.S
arch/parisc/kernel/setup.c
arch/parisc/kernel/smp.c
arch/parisc/kernel/sys_parisc32.c
arch/parisc/kernel/time.c
arch/parisc/kernel/traps.c
arch/parisc/kernel/unaligned.c
arch/parisc/kernel/unwind.c
arch/parisc/kernel/vmlinux.lds.S
arch/parisc/lib/bitops.c
arch/parisc/lib/fixup.S
arch/parisc/lib/memcpy.c
arch/parisc/mm/init.c
arch/powerpc/configs/chrp32_defconfig [new file with mode: 0644]
arch/powerpc/configs/mpc834x_itx_defconfig [new file with mode: 0644]
arch/powerpc/kernel/asm-offsets.c
arch/powerpc/kernel/binfmt_elf32.c
arch/powerpc/kernel/btext.c
arch/powerpc/kernel/cpu_setup_6xx.S
arch/powerpc/kernel/cpu_setup_power4.S
arch/powerpc/kernel/cputable.c
arch/powerpc/kernel/entry_32.S
arch/powerpc/kernel/entry_64.S
arch/powerpc/kernel/firmware.c
arch/powerpc/kernel/fpu.S
arch/powerpc/kernel/head_32.S
arch/powerpc/kernel/head_44x.S
arch/powerpc/kernel/head_4xx.S
arch/powerpc/kernel/head_64.S
arch/powerpc/kernel/head_8xx.S
arch/powerpc/kernel/head_fsl_booke.S
arch/powerpc/kernel/ibmebus.c
arch/powerpc/kernel/idle.c
arch/powerpc/kernel/idle_6xx.S
arch/powerpc/kernel/idle_power4.S
arch/powerpc/kernel/iommu.c
arch/powerpc/kernel/irq.c
arch/powerpc/kernel/kprobes.c
arch/powerpc/kernel/l2cr_6xx.S
arch/powerpc/kernel/legacy_serial.c
arch/powerpc/kernel/lparcfg.c
arch/powerpc/kernel/misc_32.S
arch/powerpc/kernel/misc_64.S
arch/powerpc/kernel/of_device.c
arch/powerpc/kernel/paca.c
arch/powerpc/kernel/pci_32.c
arch/powerpc/kernel/pci_64.c
arch/powerpc/kernel/perfmon_fsl_booke.c
arch/powerpc/kernel/pmc.c
arch/powerpc/kernel/ppc_ksyms.c
arch/powerpc/kernel/proc_ppc64.c
arch/powerpc/kernel/process.c
arch/powerpc/kernel/prom.c
arch/powerpc/kernel/prom_init.c
arch/powerpc/kernel/prom_parse.c
arch/powerpc/kernel/ptrace-common.h
arch/powerpc/kernel/ptrace.c
arch/powerpc/kernel/ptrace32.c
arch/powerpc/kernel/rtas_pci.c
arch/powerpc/kernel/setup-common.c
arch/powerpc/kernel/setup_32.c
arch/powerpc/kernel/setup_64.c
arch/powerpc/kernel/signal_32.c
arch/powerpc/kernel/signal_64.c
arch/powerpc/kernel/smp-tbsync.c
arch/powerpc/kernel/smp.c
arch/powerpc/kernel/swsusp_32.S
arch/powerpc/kernel/sys_ppc32.c
arch/powerpc/kernel/sysfs.c
arch/powerpc/kernel/systbl.S
arch/powerpc/kernel/tau_6xx.c
arch/powerpc/kernel/time.c
arch/powerpc/kernel/traps.c
arch/powerpc/kernel/udbg.c
arch/powerpc/kernel/udbg_16550.c
arch/powerpc/kernel/vdso.c
arch/powerpc/kernel/vdso32/cacheflush.S
arch/powerpc/kernel/vdso32/datapage.S
arch/powerpc/kernel/vdso32/gettimeofday.S
arch/powerpc/kernel/vdso32/sigtramp.S
arch/powerpc/kernel/vdso64/cacheflush.S
arch/powerpc/kernel/vdso64/datapage.S
arch/powerpc/kernel/vdso64/gettimeofday.S
arch/powerpc/kernel/vdso64/sigtramp.S
arch/powerpc/kernel/vector.S
arch/powerpc/kernel/vio.c
arch/powerpc/kernel/vmlinux.lds.S
arch/powerpc/lib/copy_32.S
arch/powerpc/lib/locks.c
arch/powerpc/lib/sstep.c
arch/powerpc/lib/string.S
arch/powerpc/math-emu/math.c
arch/powerpc/mm/44x_mmu.c
arch/powerpc/mm/4xx_mmu.c
arch/powerpc/mm/fault.c
arch/powerpc/mm/fsl_booke_mmu.c
arch/powerpc/mm/hash_low_32.S
arch/powerpc/mm/hash_low_64.S
arch/powerpc/mm/hash_utils_64.c
arch/powerpc/mm/init_32.c
arch/powerpc/mm/init_64.c
arch/powerpc/mm/lmb.c
arch/powerpc/mm/mem.c
arch/powerpc/mm/mmu_context_32.c
arch/powerpc/mm/mmu_context_64.c
arch/powerpc/mm/pgtable_32.c
arch/powerpc/mm/pgtable_64.c
arch/powerpc/mm/ppc_mmu_32.c
arch/powerpc/mm/slb.c
arch/powerpc/mm/slb_low.S
arch/powerpc/mm/stab.c
arch/powerpc/mm/tlb_32.c
arch/powerpc/mm/tlb_64.c
arch/powerpc/platforms/83xx/Kconfig
arch/powerpc/platforms/83xx/Makefile
arch/powerpc/platforms/83xx/misc.c
arch/powerpc/platforms/83xx/mpc834x_itx.c [new file with mode: 0644]
arch/powerpc/platforms/83xx/mpc834x_itx.h [new file with mode: 0644]
arch/powerpc/platforms/83xx/mpc834x_sys.c
arch/powerpc/platforms/83xx/pci.c
arch/powerpc/platforms/85xx/mpc8540_ads.h
arch/powerpc/platforms/85xx/mpc85xx_ads.c
arch/powerpc/platforms/85xx/pci.c
arch/powerpc/platforms/cell/interrupt.c
arch/powerpc/platforms/cell/interrupt.h
arch/powerpc/platforms/cell/pervasive.c
arch/powerpc/platforms/cell/setup.c
arch/powerpc/platforms/cell/smp.c
arch/powerpc/platforms/cell/spider-pic.c
arch/powerpc/platforms/cell/spu_base.c
arch/powerpc/platforms/cell/spufs/backing_ops.c
arch/powerpc/platforms/cell/spufs/hw_ops.c
arch/powerpc/platforms/cell/spufs/sched.c
arch/powerpc/platforms/cell/spufs/switch.c
arch/powerpc/platforms/chrp/pci.c
arch/powerpc/platforms/chrp/setup.c
arch/powerpc/platforms/chrp/smp.c
arch/powerpc/platforms/iseries/irq.c
arch/powerpc/platforms/iseries/irq.h
arch/powerpc/platforms/iseries/lpardata.c
arch/powerpc/platforms/iseries/setup.c
arch/powerpc/platforms/iseries/smp.c
arch/powerpc/platforms/maple/pci.c
arch/powerpc/platforms/maple/setup.c
arch/powerpc/platforms/maple/time.c
arch/powerpc/platforms/powermac/backlight.c
arch/powerpc/platforms/powermac/bootx_init.c
arch/powerpc/platforms/powermac/cache.S
arch/powerpc/platforms/powermac/cpufreq_32.c
arch/powerpc/platforms/powermac/cpufreq_64.c
arch/powerpc/platforms/powermac/feature.c
arch/powerpc/platforms/powermac/low_i2c.c
arch/powerpc/platforms/powermac/nvram.c
arch/powerpc/platforms/powermac/pci.c
arch/powerpc/platforms/powermac/pfunc_base.c
arch/powerpc/platforms/powermac/pfunc_core.c
arch/powerpc/platforms/powermac/pic.c
arch/powerpc/platforms/powermac/pmac.h
arch/powerpc/platforms/powermac/setup.c
arch/powerpc/platforms/powermac/sleep.S
arch/powerpc/platforms/powermac/smp.c
arch/powerpc/platforms/powermac/time.c
arch/powerpc/platforms/powermac/udbg_adb.c
arch/powerpc/platforms/powermac/udbg_scc.c
arch/powerpc/platforms/pseries/eeh_driver.c
arch/powerpc/platforms/pseries/iommu.c
arch/powerpc/platforms/pseries/lpar.c
arch/powerpc/platforms/pseries/ras.c
arch/powerpc/platforms/pseries/setup.c
arch/powerpc/platforms/pseries/smp.c
arch/powerpc/platforms/pseries/xics.c
arch/powerpc/platforms/pseries/xics.h
arch/powerpc/sysdev/Makefile
arch/powerpc/sysdev/dart_iommu.c
arch/powerpc/sysdev/fsl_soc.c
arch/powerpc/sysdev/i8259.c
arch/powerpc/sysdev/mpic.c
arch/powerpc/xmon/xmon.c
arch/ppc/4xx_io/serial_sicc.c
arch/ppc/8260_io/fcc_enet.c
arch/ppc/8xx_io/cs4218.h
arch/ppc/8xx_io/cs4218_tdm.c
arch/ppc/8xx_io/enet.c
arch/ppc/8xx_io/fec.c
arch/ppc/8xx_io/micropatch.c
arch/ppc/amiga/amiints.c
arch/ppc/amiga/config.c
arch/ppc/boot/common/crt0.S
arch/ppc/boot/common/misc-common.c
arch/ppc/boot/common/ns16550.c
arch/ppc/boot/simple/embed_config.c
arch/ppc/boot/simple/head.S
arch/ppc/boot/simple/m8xx_tty.c
arch/ppc/boot/simple/misc-chestnut.c
arch/ppc/boot/simple/misc-embedded.c
arch/ppc/boot/simple/misc-ev64260.c
arch/ppc/boot/simple/misc-ev64360.c
arch/ppc/boot/simple/misc-katana.c
arch/ppc/boot/simple/misc-mv64x60.c
arch/ppc/boot/simple/misc-prep.c
arch/ppc/boot/simple/misc-spruce.c
arch/ppc/boot/simple/misc.c
arch/ppc/boot/simple/mpc52xx_tty.c
arch/ppc/boot/simple/mv64x60_tty.c
arch/ppc/boot/simple/openbios.c
arch/ppc/boot/simple/pibs.c
arch/ppc/boot/simple/relocate.S
arch/ppc/kernel/asm-offsets.c
arch/ppc/kernel/cpu_setup_power4.S
arch/ppc/kernel/dma-mapping.c
arch/ppc/kernel/entry.S
arch/ppc/kernel/head.S
arch/ppc/kernel/head_44x.S
arch/ppc/kernel/head_4xx.S
arch/ppc/kernel/head_8xx.S
arch/ppc/kernel/head_fsl_booke.S
arch/ppc/kernel/misc.S
arch/ppc/kernel/pci.c
arch/ppc/kernel/ppc-stub.c
arch/ppc/kernel/ppc_htab.c
arch/ppc/kernel/ppc_ksyms.c
arch/ppc/kernel/setup.c
arch/ppc/kernel/smp-tbsync.c
arch/ppc/kernel/smp.c
arch/ppc/kernel/time.c
arch/ppc/kernel/traps.c
arch/ppc/lib/locks.c
arch/ppc/lib/string.S
arch/ppc/mm/44x_mmu.c
arch/ppc/mm/4xx_mmu.c
arch/ppc/mm/fault.c
arch/ppc/mm/fsl_booke_mmu.c
arch/ppc/mm/hashtable.S
arch/ppc/mm/init.c
arch/ppc/mm/mem_pieces.c
arch/ppc/mm/mmu_context.c
arch/ppc/mm/pgtable.c
arch/ppc/mm/ppc_mmu.c
arch/ppc/mm/tlb.c
arch/ppc/platforms/4xx/bamboo.c
arch/ppc/platforms/4xx/bamboo.h
arch/ppc/platforms/4xx/bubinga.c
arch/ppc/platforms/4xx/bubinga.h
arch/ppc/platforms/4xx/cpci405.c
arch/ppc/platforms/4xx/ebony.c
arch/ppc/platforms/4xx/ebony.h
arch/ppc/platforms/4xx/ep405.c
arch/ppc/platforms/4xx/ibm405ep.c
arch/ppc/platforms/4xx/ibm405ep.h
arch/ppc/platforms/4xx/ibm405gp.c
arch/ppc/platforms/4xx/ibm405gp.h
arch/ppc/platforms/4xx/ibm405gpr.c
arch/ppc/platforms/4xx/ibm405gpr.h
arch/ppc/platforms/4xx/ibm440ep.h
arch/ppc/platforms/4xx/ibm440gp.h
arch/ppc/platforms/4xx/ibm440gx.h
arch/ppc/platforms/4xx/ibm440sp.h
arch/ppc/platforms/4xx/ibmnp405h.c
arch/ppc/platforms/4xx/ibmnp405h.h
arch/ppc/platforms/4xx/ibmstb4.h
arch/ppc/platforms/4xx/ibmstbx25.h
arch/ppc/platforms/4xx/luan.c
arch/ppc/platforms/4xx/luan.h
arch/ppc/platforms/4xx/ocotea.c
arch/ppc/platforms/4xx/ocotea.h
arch/ppc/platforms/4xx/ppc440spe.h
arch/ppc/platforms/4xx/redwood5.c
arch/ppc/platforms/4xx/redwood6.c
arch/ppc/platforms/4xx/sycamore.c
arch/ppc/platforms/4xx/sycamore.h
arch/ppc/platforms/4xx/walnut.c
arch/ppc/platforms/4xx/walnut.h
arch/ppc/platforms/4xx/xilinx_ml300.c
arch/ppc/platforms/4xx/xilinx_ml403.c
arch/ppc/platforms/4xx/xparameters/xparameters.h
arch/ppc/platforms/4xx/yucca.c
arch/ppc/platforms/4xx/yucca.h
arch/ppc/platforms/83xx/mpc834x_sys.c
arch/ppc/platforms/83xx/mpc834x_sys.h
arch/ppc/platforms/85xx/mpc8540_ads.c
arch/ppc/platforms/85xx/mpc8540_ads.h
arch/ppc/platforms/85xx/mpc8555_cds.h
arch/ppc/platforms/85xx/mpc8560_ads.c
arch/ppc/platforms/85xx/mpc8560_ads.h
arch/ppc/platforms/85xx/mpc85xx_ads_common.c
arch/ppc/platforms/85xx/mpc85xx_ads_common.h
arch/ppc/platforms/85xx/mpc85xx_cds_common.c
arch/ppc/platforms/85xx/mpc85xx_cds_common.h
arch/ppc/platforms/85xx/sbc8560.c
arch/ppc/platforms/85xx/sbc8560.h
arch/ppc/platforms/85xx/sbc85xx.c
arch/ppc/platforms/85xx/sbc85xx.h
arch/ppc/platforms/85xx/stx_gp3.c
arch/ppc/platforms/85xx/stx_gp3.h
arch/ppc/platforms/85xx/tqm85xx.c
arch/ppc/platforms/85xx/tqm85xx.h
arch/ppc/platforms/apus_pci.c
arch/ppc/platforms/apus_setup.c
arch/ppc/platforms/ccm.h
arch/ppc/platforms/chestnut.c
arch/ppc/platforms/cpci690.c
arch/ppc/platforms/ev64260.c
arch/ppc/platforms/ev64360.c
arch/ppc/platforms/fads.h
arch/ppc/platforms/gemini_prom.S
arch/ppc/platforms/gemini_serial.h
arch/ppc/platforms/gemini_setup.c
arch/ppc/platforms/hdpu.c
arch/ppc/platforms/hermes.h
arch/ppc/platforms/ip860.h
arch/ppc/platforms/ivms8.h
arch/ppc/platforms/katana.c
arch/ppc/platforms/lantec.h
arch/ppc/platforms/lite5200.c
arch/ppc/platforms/lopec.c
arch/ppc/platforms/lwmon.h
arch/ppc/platforms/mpc866ads_setup.c
arch/ppc/platforms/mpc885ads.h
arch/ppc/platforms/mpc885ads_setup.c
arch/ppc/platforms/mvme5100.c
arch/ppc/platforms/pal4_setup.c
arch/ppc/platforms/pcu_e.h
arch/ppc/platforms/powerpmc250.c
arch/ppc/platforms/pplus.c
arch/ppc/platforms/pq2ads.h
arch/ppc/platforms/prep_pci.c
arch/ppc/platforms/prep_setup.c
arch/ppc/platforms/prpmc750.c
arch/ppc/platforms/prpmc800.c
arch/ppc/platforms/radstone_ppc7d.c
arch/ppc/platforms/rpxclassic.h
arch/ppc/platforms/rpxlite.h
arch/ppc/platforms/sandpoint.c
arch/ppc/platforms/sbc82xx.c
arch/ppc/platforms/spruce.c
arch/ppc/platforms/tqm8260.h
arch/ppc/platforms/tqm8xx.h
arch/ppc/syslib/Makefile
arch/ppc/syslib/btext.c
arch/ppc/syslib/gen550_dbg.c
arch/ppc/syslib/gen550_kgdb.c
arch/ppc/syslib/gt64260_pic.c
arch/ppc/syslib/i8259.c [new file with mode: 0644]
arch/ppc/syslib/ibm440gp_common.c
arch/ppc/syslib/ibm440gp_common.h
arch/ppc/syslib/ibm440gx_common.c
arch/ppc/syslib/ibm440gx_common.h
arch/ppc/syslib/ibm440sp_common.c
arch/ppc/syslib/ibm44x_common.c
arch/ppc/syslib/m8260_pci_erratum9.c
arch/ppc/syslib/m8260_setup.c
arch/ppc/syslib/m82xx_pci.c
arch/ppc/syslib/m8xx_setup.c
arch/ppc/syslib/mpc52xx_pci.c
arch/ppc/syslib/mpc52xx_setup.c
arch/ppc/syslib/mv64360_pic.c
arch/ppc/syslib/mv64x60_dbg.c
arch/ppc/syslib/ocp.c
arch/ppc/syslib/open_pic.c
arch/ppc/syslib/open_pic2.c
arch/ppc/syslib/ppc440spe_pcie.c
arch/ppc/syslib/ppc4xx_dma.c
arch/ppc/syslib/ppc4xx_pic.c
arch/ppc/syslib/ppc4xx_setup.c
arch/ppc/syslib/ppc4xx_sgdma.c
arch/ppc/syslib/ppc83xx_setup.c
arch/ppc/syslib/ppc83xx_setup.h
arch/ppc/syslib/ppc85xx_common.c
arch/ppc/syslib/ppc85xx_common.h
arch/ppc/syslib/ppc85xx_rio.c
arch/ppc/syslib/ppc85xx_rio.h
arch/ppc/syslib/ppc85xx_setup.c
arch/ppc/syslib/ppc85xx_setup.h
arch/ppc/syslib/ppc8xx_pic.c
arch/ppc/syslib/ppc8xx_pic.h
arch/ppc/syslib/qspan_pci.c
arch/ppc/xmon/privinst.h
arch/ppc/xmon/start.c
arch/ppc/xmon/xmon.c
arch/s390/Kconfig
arch/s390/Kconfig.debug
arch/s390/Makefile
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/Makefile
arch/s390/kernel/asm-offsets.c
arch/s390/kernel/binfmt_elf32.c
arch/s390/kernel/compat_linux.c
arch/s390/kernel/compat_linux.h
arch/s390/kernel/compat_signal.c
arch/s390/kernel/debug.c
arch/s390/kernel/entry.S
arch/s390/kernel/entry64.S
arch/s390/kernel/head.S
arch/s390/kernel/irq.c
arch/s390/kernel/process.c
arch/s390/kernel/s390_ksyms.c
arch/s390/kernel/setup.c
arch/s390/kernel/signal.c
arch/s390/kernel/stacktrace.c [new file with mode: 0644]
arch/s390/kernel/time.c
arch/s390/kernel/traps.c
arch/s390/kernel/vmlinux.lds.S
arch/s390/kernel/vtime.c
arch/s390/lib/delay.c
arch/s390/math-emu/math.c
arch/s390/mm/cmm.c
arch/s390/mm/fault.c
arch/s390/mm/init.c
arch/sh/boards/adx/irq_maskreg.c
arch/sh/boards/bigsur/io.c
arch/sh/boards/bigsur/irq.c
arch/sh/boards/bigsur/led.c
arch/sh/boards/bigsur/setup.c
arch/sh/boards/cat68701/setup.c
arch/sh/boards/cqreek/setup.c
arch/sh/boards/harp/irq.c
arch/sh/boards/harp/led.c
arch/sh/boards/harp/setup.c
arch/sh/boards/hp6xx/setup.c
arch/sh/boards/mpc1211/led.c
arch/sh/boards/mpc1211/pci.c
arch/sh/boards/mpc1211/setup.c
arch/sh/boards/overdrive/fpga.c
arch/sh/boards/overdrive/galileo.c
arch/sh/boards/overdrive/io.c
arch/sh/boards/overdrive/irq.c
arch/sh/boards/overdrive/led.c
arch/sh/boards/overdrive/setup.c
arch/sh/boards/renesas/edosk7705/setup.c
arch/sh/boards/renesas/hs7751rvoip/io.c
arch/sh/boards/renesas/hs7751rvoip/irq.c
arch/sh/boards/renesas/hs7751rvoip/led.c
arch/sh/boards/renesas/hs7751rvoip/mach.c
arch/sh/boards/renesas/hs7751rvoip/pci.c
arch/sh/boards/renesas/hs7751rvoip/setup.c
arch/sh/boards/renesas/rts7751r2d/irq.c
arch/sh/boards/renesas/rts7751r2d/led.c
arch/sh/boards/renesas/rts7751r2d/mach.c
arch/sh/boards/renesas/systemh/irq.c
arch/sh/boards/se/7300/io.c
arch/sh/boards/se/7300/irq.c
arch/sh/boards/se/7300/led.c
arch/sh/boards/se/7300/setup.c
arch/sh/boards/se/73180/io.c
arch/sh/boards/se/73180/irq.c
arch/sh/boards/se/73180/led.c
arch/sh/boards/se/73180/setup.c
arch/sh/boards/se/770x/irq.c
arch/sh/boards/se/770x/led.c
arch/sh/boards/se/770x/mach.c
arch/sh/boards/se/770x/setup.c
arch/sh/boards/se/7751/irq.c
arch/sh/boards/se/7751/led.c
arch/sh/boards/se/7751/mach.c
arch/sh/boards/se/7751/pci.c
arch/sh/boards/se/7751/setup.c
arch/sh/boards/sh03/led.c
arch/sh/boards/sh03/setup.c
arch/sh/boards/sh2000/setup.c
arch/sh/boards/snapgear/setup.c
arch/sh/boards/superh/microdev/io.c
arch/sh/boards/superh/microdev/irq.c
arch/sh/boards/superh/microdev/led.c
arch/sh/boards/superh/microdev/setup.c
arch/sh/boards/unknown/setup.c
arch/sh/boot/compressed/head.S
arch/sh/boot/compressed/misc.c
arch/sh/cchips/hd6446x/hd64461/io.c
arch/sh/cchips/hd6446x/hd64461/setup.c
arch/sh/cchips/hd6446x/hd64465/gpio.c
arch/sh/cchips/hd6446x/hd64465/io.c
arch/sh/cchips/hd6446x/hd64465/setup.c
arch/sh/cchips/voyagergx/irq.c
arch/sh/drivers/dma/dma-g2.c
arch/sh/drivers/dma/dma-pvr2.c
arch/sh/drivers/dma/dma-sh.c
arch/sh/drivers/pci/dma-dreamcast.c
arch/sh/drivers/pci/fixups-dreamcast.c
arch/sh/drivers/pci/ops-bigsur.c
arch/sh/drivers/pci/ops-dreamcast.c
arch/sh/drivers/pci/ops-rts7751r2d.c
arch/sh/drivers/pci/ops-sh03.c
arch/sh/drivers/pci/ops-snapgear.c
arch/sh/drivers/pci/pci-sh7751.c
arch/sh/drivers/pci/pci-st40.c
arch/sh/kernel/cf-enabler.c
arch/sh/kernel/cpu/irq/ipr.c
arch/sh/kernel/cpu/irq/pint.c
arch/sh/kernel/cpu/sh3/ex.S
arch/sh/kernel/cpu/sh4/ex.S
arch/sh/kernel/cpu/sh4/sq.c
arch/sh/kernel/entry.S
arch/sh/kernel/ptrace.c
arch/sh/kernel/relocate_kernel.S
arch/sh/kernel/sh_ksyms.c
arch/sh/kernel/smp.c
arch/sh/kernel/time.c
arch/sh/kernel/timers/timer-tmu.c
arch/sh/kernel/traps.c
arch/sh/kernel/vmlinux.lds.S
arch/sh/lib/memcpy-sh4.S
arch/sh/mm/cache-sh4.c
arch/sh/mm/clear_page.S
arch/sh/mm/extable.c
arch/sh/mm/hugetlbpage.c
arch/sh/mm/init.c
arch/sh/mm/pg-sh4.c
arch/sh64/boot/compressed/misc.c
arch/sh64/boot/compressed/vmlinux.lds.S
arch/sh64/kernel/alphanum.c
arch/sh64/kernel/dma.c
arch/sh64/kernel/entry.S
arch/sh64/kernel/head.S
arch/sh64/kernel/irq.c
arch/sh64/kernel/irq_intc.c
arch/sh64/kernel/led.c
arch/sh64/kernel/pci_sh5.c
arch/sh64/kernel/process.c
arch/sh64/kernel/ptrace.c
arch/sh64/kernel/setup.c
arch/sh64/kernel/sh_ksyms.c
arch/sh64/kernel/time.c
arch/sh64/kernel/vmlinux.lds.S
arch/sh64/lib/c-checksum.c
arch/sh64/lib/dbg.c
arch/sh64/lib/io.c
arch/sh64/lib/iomap.c
arch/sh64/lib/memcpy.c
arch/sh64/lib/udelay.c
arch/sh64/mach-cayman/iomap.c
arch/sh64/mach-cayman/irq.c
arch/sh64/mach-cayman/setup.c
arch/sh64/mach-harp/setup.c
arch/sh64/mach-romram/setup.c
arch/sh64/mach-sim/setup.c
arch/sh64/mm/cache.c
arch/sh64/mm/extable.c
arch/sh64/mm/hugetlbpage.c
arch/sparc/kernel/asm-offsets.c
arch/sparc/kernel/auxio.c
arch/sparc/kernel/cpu.c
arch/sparc/kernel/devices.c
arch/sparc/kernel/ebus.c
arch/sparc/kernel/entry.S
arch/sparc/kernel/head.S
arch/sparc/kernel/idprom.c
arch/sparc/kernel/irq.c
arch/sparc/kernel/pcic.c
arch/sparc/kernel/process.c
arch/sparc/kernel/setup.c
arch/sparc/kernel/signal.c
arch/sparc/kernel/sparc_ksyms.c
arch/sparc/kernel/sun4c_irq.c
arch/sparc/kernel/sun4d_irq.c
arch/sparc/kernel/sun4m_irq.c
arch/sparc/kernel/sys_solaris.c
arch/sparc/kernel/sys_sunos.c
arch/sparc/kernel/systbls.S
arch/sparc/kernel/tick14.c
arch/sparc/kernel/time.c
arch/sparc/kernel/traps.c
arch/sparc/lib/atomic.S
arch/sparc/lib/bitops.S
arch/sparc/lib/rwsem.S
arch/sparc/mm/btfixup.c
arch/sparc/mm/extable.c
arch/sparc/mm/hypersparc.S
arch/sparc/mm/init.c
arch/sparc/mm/io-unit.c
arch/sparc/mm/iommu.c
arch/sparc/mm/srmmu.c
arch/sparc/mm/sun4c.c
arch/sparc/mm/swift.S
arch/sparc/mm/tsunami.S
arch/sparc/mm/viking.S
arch/sparc/prom/init.c
arch/sparc/prom/memory.c
arch/sparc/prom/misc.c
arch/sparc64/kernel/binfmt_elf32.c
arch/sparc64/kernel/cpu.c
arch/sparc64/kernel/devices.c
arch/sparc64/kernel/ebus.c
arch/sparc64/kernel/entry.S
arch/sparc64/kernel/etrap.S
arch/sparc64/kernel/head.S
arch/sparc64/kernel/irq.c
arch/sparc64/kernel/kprobes.c
arch/sparc64/kernel/ktlb.S
arch/sparc64/kernel/of_device.c
arch/sparc64/kernel/pci.c
arch/sparc64/kernel/pci_psycho.c
arch/sparc64/kernel/pci_sabre.c
arch/sparc64/kernel/pci_schizo.c
arch/sparc64/kernel/power.c
arch/sparc64/kernel/process.c
arch/sparc64/kernel/prom.c
arch/sparc64/kernel/rtrap.S
arch/sparc64/kernel/sbus.c
arch/sparc64/kernel/setup.c
arch/sparc64/kernel/signal.c
arch/sparc64/kernel/sparc64_ksyms.c
arch/sparc64/kernel/sys32.S
arch/sparc64/kernel/sys_sparc.c
arch/sparc64/kernel/sys_sparc32.c
arch/sparc64/kernel/sys_sunos32.c
arch/sparc64/kernel/systbls.S
arch/sparc64/kernel/time.c
arch/sparc64/kernel/traps.c
arch/sparc64/kernel/tsb.S
arch/sparc64/kernel/ttable.S
arch/sparc64/lib/atomic.S
arch/sparc64/lib/bitops.S
arch/sparc64/lib/mcount.S
arch/sparc64/mm/hugetlbpage.c
arch/sparc64/mm/init.c
arch/sparc64/mm/ultra.S
arch/sparc64/prom/misc.c
arch/sparc64/solaris/misc.c
arch/um/Makefile-x86_64
arch/um/drivers/harddog_kern.c
arch/um/drivers/line.c
arch/um/drivers/mconsole_kern.c
arch/um/drivers/net_kern.c
arch/um/drivers/port_kern.c
arch/um/drivers/stderr_console.c
arch/um/drivers/ubd_kern.c
arch/um/drivers/xterm_kern.c
arch/um/include/sysdep-x86_64/kernel-offsets.h
arch/um/kernel/irq.c
arch/um/kernel/sigio_kern.c
arch/um/kernel/skas/mmu.c
arch/um/kernel/skas/uaccess.c
arch/um/kernel/time.c [deleted file]
arch/um/kernel/time_kern.c
arch/um/kernel/tt/process_kern.c
arch/um/kernel/um_arch.c
arch/um/kernel/vmlinux.lds.S
arch/um/os-Linux/mem.c
arch/um/os-Linux/umid.c
arch/um/scripts/Makefile.rules
arch/um/sys-i386/checksum.S
arch/um/sys-i386/ptrace.c
arch/um/sys-i386/sys_call_table.S
arch/um/sys-ppc/misc.S
arch/um/sys-x86_64/syscall_table.c
arch/v850/kernel/anna.c
arch/v850/kernel/as85ep1.c
arch/v850/kernel/fpga85e2c.c
arch/v850/kernel/gbus_int.c
arch/v850/kernel/ma.c
arch/v850/kernel/me2.c
arch/v850/kernel/process.c
arch/v850/kernel/rte_cb.c
arch/v850/kernel/rte_cb_leds.c
arch/v850/kernel/rte_ma1_cb.c
arch/v850/kernel/rte_mb_a_pci.c
arch/v850/kernel/rte_me2_cb.c
arch/v850/kernel/rte_nb85e_cb.c
arch/v850/kernel/sim.c
arch/v850/kernel/sim85e2.c
arch/v850/kernel/syscalls.c
arch/v850/kernel/teg.c
arch/v850/kernel/time.c
arch/v850/kernel/v850_ksyms.c
arch/v850/kernel/vmlinux.lds.S
arch/x86_64/Kconfig
arch/x86_64/Kconfig.debug
arch/x86_64/boot/setup.S
arch/x86_64/ia32/Makefile
arch/x86_64/ia32/audit.c [new file with mode: 0644]
arch/x86_64/ia32/ia32entry.S
arch/x86_64/ia32/sys_ia32.c
arch/x86_64/kernel/Makefile
arch/x86_64/kernel/acpi/sleep.c
arch/x86_64/kernel/aperture.c
arch/x86_64/kernel/apic.c
arch/x86_64/kernel/audit.c [new file with mode: 0644]
arch/x86_64/kernel/e820.c
arch/x86_64/kernel/entry.S
arch/x86_64/kernel/genapic.c
arch/x86_64/kernel/genapic_cluster.c
arch/x86_64/kernel/genapic_flat.c
arch/x86_64/kernel/head64.c
arch/x86_64/kernel/i387.c
arch/x86_64/kernel/i8259.c
arch/x86_64/kernel/io_apic.c
arch/x86_64/kernel/irq.c
arch/x86_64/kernel/kprobes.c
arch/x86_64/kernel/mpparse.c
arch/x86_64/kernel/nmi.c
arch/x86_64/kernel/pci-gart.c
arch/x86_64/kernel/process.c
arch/x86_64/kernel/setup.c
arch/x86_64/kernel/setup64.c
arch/x86_64/kernel/smpboot.c
arch/x86_64/kernel/stacktrace.c [new file with mode: 0644]
arch/x86_64/kernel/suspend.c
arch/x86_64/kernel/syscall.c
arch/x86_64/kernel/time.c
arch/x86_64/kernel/traps.c
arch/x86_64/kernel/vmlinux.lds.S
arch/x86_64/lib/thunk.S
arch/x86_64/mm/extable.c
arch/x86_64/mm/fault.c
arch/x86_64/mm/init.c
arch/x86_64/mm/mmap.c
arch/x86_64/mm/pageattr.c
arch/xtensa/boot/boot-elf/bootstrap.S
arch/xtensa/kernel/coprocessor.S
arch/xtensa/kernel/head.S
arch/xtensa/kernel/pci.c
arch/xtensa/kernel/platform.c
arch/xtensa/kernel/process.c
arch/xtensa/kernel/ptrace.c
arch/xtensa/kernel/setup.c
arch/xtensa/kernel/syscalls.c
arch/xtensa/kernel/time.c
arch/xtensa/kernel/vmlinux.lds.S
arch/xtensa/kernel/xtensa_ksyms.c
arch/xtensa/mm/init.c
arch/xtensa/platform-iss/console.c
arch/xtensa/platform-iss/network.c
arch/xtensa/platform-iss/setup.c
block/as-iosched.c
block/blktrace.c
block/cfq-iosched.c
block/deadline-iosched.c
block/elevator.c
block/genhd.c
block/ll_rw_blk.c
drivers/acorn/block/Kconfig
drivers/acorn/block/mfmhd.c
drivers/acpi/Kconfig
drivers/acpi/Makefile
drivers/acpi/ac.c
drivers/acpi/acpi_memhotplug.c
drivers/acpi/asus_acpi.c
drivers/acpi/battery.c
drivers/acpi/bus.c
drivers/acpi/button.c
drivers/acpi/cm_sbs.c [new file with mode: 0644]
drivers/acpi/container.c
drivers/acpi/debug.c
drivers/acpi/dispatcher/dsinit.c
drivers/acpi/dispatcher/dsmethod.c
drivers/acpi/dispatcher/dswexec.c
drivers/acpi/dispatcher/dswload.c
drivers/acpi/dock.c [new file with mode: 0644]
drivers/acpi/ec.c
drivers/acpi/event.c
drivers/acpi/events/evgpe.c
drivers/acpi/events/evxface.c
drivers/acpi/executer/exconfig.c
drivers/acpi/executer/excreate.c
drivers/acpi/executer/exdump.c
drivers/acpi/executer/exfldio.c
drivers/acpi/executer/exmutex.c
drivers/acpi/executer/exsystem.c
drivers/acpi/fan.c
drivers/acpi/glue.c
drivers/acpi/hardware/hwregs.c
drivers/acpi/hotkey.c
drivers/acpi/i2c_ec.c [new file with mode: 0644]
drivers/acpi/i2c_ec.h [new file with mode: 0644]
drivers/acpi/motherboard.c
drivers/acpi/namespace/nsaccess.c
drivers/acpi/namespace/nsxfeval.c
drivers/acpi/numa.c
drivers/acpi/osl.c
drivers/acpi/parser/psparse.c
drivers/acpi/pci_bind.c
drivers/acpi/pci_irq.c
drivers/acpi/pci_link.c
drivers/acpi/pci_root.c
drivers/acpi/power.c
drivers/acpi/processor_core.c
drivers/acpi/processor_idle.c
drivers/acpi/processor_perflib.c
drivers/acpi/processor_thermal.c
drivers/acpi/processor_throttling.c
drivers/acpi/sbs.c [new file with mode: 0644]
drivers/acpi/scan.c
drivers/acpi/system.c
drivers/acpi/tables.c
drivers/acpi/thermal.c
drivers/acpi/utilities/utalloc.c
drivers/acpi/utilities/utcache.c
drivers/acpi/utilities/utdelete.c
drivers/acpi/utilities/utglobal.c
drivers/acpi/utilities/utmisc.c
drivers/acpi/utilities/utmutex.c
drivers/acpi/utils.c
drivers/acpi/video.c
drivers/atm/adummy.c
drivers/atm/ambassador.c
drivers/atm/ambassador.h
drivers/atm/eni.c
drivers/atm/firestream.c
drivers/atm/fore200e.c
drivers/atm/fore200e.h
drivers/atm/he.c
drivers/atm/horizon.c
drivers/atm/horizon.h
drivers/atm/idt77252.c
drivers/atm/iphase.c
drivers/atm/iphase.h
drivers/atm/lanai.c
drivers/atm/nicstar.c
drivers/atm/zatm.c
drivers/atm/zatm.h
drivers/base/bus.c
drivers/base/class.c
drivers/base/core.c
drivers/base/driver.c
drivers/base/node.c
drivers/base/power/main.c
drivers/base/power/shutdown.c
drivers/base/sys.c
drivers/block/DAC960.c
drivers/block/acsi.c
drivers/block/cciss.c
drivers/block/cpqarray.c
drivers/block/floppy.c
drivers/block/loop.c
drivers/block/nbd.c
drivers/block/paride/paride.c
drivers/block/pktcdvd.c
drivers/block/ps2esdi.c
drivers/block/rd.c
drivers/block/swim3.c
drivers/block/sx8.c
drivers/block/umem.c
drivers/bluetooth/bcm203x.c
drivers/bluetooth/bfusb.c
drivers/bluetooth/bluecard_cs.c
drivers/bluetooth/bpa10x.c
drivers/bluetooth/bt3c_cs.c
drivers/bluetooth/btuart_cs.c
drivers/bluetooth/dtl1_cs.c
drivers/bluetooth/hci_bcsp.c
drivers/bluetooth/hci_h4.c
drivers/bluetooth/hci_ldisc.c
drivers/bluetooth/hci_usb.c
drivers/bluetooth/hci_usb.h
drivers/bluetooth/hci_vhci.c
drivers/cdrom/cdrom.c
drivers/cdrom/cdu31a.c
drivers/cdrom/cm206.c
drivers/cdrom/mcdx.c
drivers/cdrom/sbpcd.c
drivers/cdrom/sonycd535.c
drivers/char/agp/amd64-agp.c
drivers/char/agp/frontend.c
drivers/char/agp/generic.c
drivers/char/amiserial.c
drivers/char/applicom.c
drivers/char/consolemap.c
drivers/char/cs5535_gpio.c
drivers/char/cyclades.c
drivers/char/decserial.c
drivers/char/drm/drm.h
drivers/char/drm/drmP.h
drivers/char/drm/drm_irq.c
drivers/char/drm/drm_memory.c
drivers/char/drm/drm_memory.h
drivers/char/drm/drm_memory_debug.h
drivers/char/drm/drm_scatter.c
drivers/char/drm/drm_sysfs.c
drivers/char/drm/ffb_drv.c
drivers/char/drm/i810_drv.c
drivers/char/drm/i830_drv.c
drivers/char/drm/mga_drv.c
drivers/char/drm/r128_drv.c
drivers/char/drm/radeon_drv.c
drivers/char/drm/savage_drv.c
drivers/char/drm/sis_drv.c
drivers/char/drm/tdfx_drv.c
drivers/char/drm/via_drv.c
drivers/char/ds1286.c
drivers/char/ds1302.c
drivers/char/ds1620.c
drivers/char/dsp56k.c
drivers/char/dtlk.c
drivers/char/ec3104_keyb.c
drivers/char/efirtc.c
drivers/char/epca.c
drivers/char/esp.c
drivers/char/ftape/lowlevel/fdc-io.c
drivers/char/ftape/lowlevel/ftape-calibr.c
drivers/char/ftape/lowlevel/ftape-ctl.c
drivers/char/ftape/lowlevel/ftape-init.c
drivers/char/ftape/lowlevel/ftape-proc.c
drivers/char/ftape/lowlevel/ftape-setup.c
drivers/char/ftape/lowlevel/ftape-tracing.h
drivers/char/ftape/lowlevel/ftape_syms.c
drivers/char/ftape/zftape/zftape-ctl.c
drivers/char/ftape/zftape/zftape-ctl.h
drivers/char/ftape/zftape/zftape-init.c
drivers/char/genrtc.c
drivers/char/hpet.c
drivers/char/hvc_console.c
drivers/char/hvcs.c
drivers/char/hvsi.c
drivers/char/hw_random/core.c
drivers/char/i8k.c
drivers/char/ip2/i2ellis.h
drivers/char/ip2/ip2main.c
drivers/char/ip27-rtc.c
drivers/char/ipmi/ipmi_devintf.c
drivers/char/ipmi/ipmi_msghandler.c
drivers/char/ipmi/ipmi_poweroff.c
drivers/char/ipmi/ipmi_si_intf.c
drivers/char/ipmi/ipmi_watchdog.c
drivers/char/isicom.c
drivers/char/istallion.c
drivers/char/ite_gpio.c
drivers/char/keyboard.c
drivers/char/lcd.c
drivers/char/lp.c
drivers/char/mbcs.c
drivers/char/mem.c
drivers/char/misc.c
drivers/char/mmtimer.c
drivers/char/moxa.c
drivers/char/mwave/3780i.c
drivers/char/mwave/mwavedd.c
drivers/char/mxser.c
drivers/char/n_hdlc.c
drivers/char/nvram.c
drivers/char/nwbutton.c
drivers/char/nwflash.c
drivers/char/pc8736x_gpio.c
drivers/char/pcmcia/cm4000_cs.c
drivers/char/pcmcia/cm4040_cs.c
drivers/char/ppdev.c
drivers/char/pty.c
drivers/char/qtronix.c
drivers/char/random.c
drivers/char/raw.c
drivers/char/rio/rio_linux.c
drivers/char/rio/rio_linux.h
drivers/char/rio/rioinit.c
drivers/char/riscom8.c
drivers/char/rtc.c
drivers/char/s3c2410-rtc.c
drivers/char/scx200_gpio.c
drivers/char/serial167.c
drivers/char/snsc.c
drivers/char/snsc_event.c
drivers/char/sonypi.c
drivers/char/specialix.c
drivers/char/stallion.c
drivers/char/sx.c
drivers/char/synclink.c
drivers/char/synclink_gt.c
drivers/char/synclinkmp.c
drivers/char/sysrq.c
drivers/char/tb0219.c
drivers/char/tipar.c
drivers/char/tlclk.c
drivers/char/toshiba.c
drivers/char/tpm/tpm_atmel.c
drivers/char/tpm/tpm_infineon.c
drivers/char/tpm/tpm_nsc.c
drivers/char/tpm/tpm_tis.c
drivers/char/tty_io.c
drivers/char/vc_screen.c
drivers/char/viocons.c
drivers/char/viotape.c
drivers/char/vme_scc.c
drivers/char/vr41xx_giu.c
drivers/char/vt.c
drivers/char/vt_ioctl.c
drivers/char/watchdog/acquirewdt.c
drivers/char/watchdog/advantechwdt.c
drivers/char/watchdog/alim1535_wdt.c
drivers/char/watchdog/alim7101_wdt.c
drivers/char/watchdog/at91_wdt.c
drivers/char/watchdog/booke_wdt.c
drivers/char/watchdog/cpu5wdt.c
drivers/char/watchdog/ep93xx_wdt.c
drivers/char/watchdog/eurotechwdt.c
drivers/char/watchdog/i6300esb.c
drivers/char/watchdog/i8xx_tco.c
drivers/char/watchdog/ib700wdt.c
drivers/char/watchdog/ibmasr.c
drivers/char/watchdog/indydog.c
drivers/char/watchdog/ixp2000_wdt.c
drivers/char/watchdog/ixp4xx_wdt.c
drivers/char/watchdog/machzwd.c
drivers/char/watchdog/mixcomwd.c
drivers/char/watchdog/mpc83xx_wdt.c
drivers/char/watchdog/mpc8xx_wdt.c
drivers/char/watchdog/mpcore_wdt.c
drivers/char/watchdog/mv64x60_wdt.c
drivers/char/watchdog/pcwd.c
drivers/char/watchdog/pcwd_pci.c
drivers/char/watchdog/pcwd_usb.c
drivers/char/watchdog/s3c2410_wdt.c
drivers/char/watchdog/sa1100_wdt.c
drivers/char/watchdog/sbc60xxwdt.c
drivers/char/watchdog/sbc8360.c
drivers/char/watchdog/sbc_epx_c3.c
drivers/char/watchdog/sc1200wdt.c
drivers/char/watchdog/sc520_wdt.c
drivers/char/watchdog/scx200_wdt.c
drivers/char/watchdog/shwdt.c
drivers/char/watchdog/softdog.c
drivers/char/watchdog/w83627hf_wdt.c
drivers/char/watchdog/w83877f_wdt.c
drivers/char/watchdog/w83977f_wdt.c
drivers/char/watchdog/wafer5823wdt.c
drivers/char/watchdog/wd501p.h
drivers/char/watchdog/wdrtas.c
drivers/char/watchdog/wdt.c
drivers/char/watchdog/wdt285.c
drivers/char/watchdog/wdt977.c
drivers/char/watchdog/wdt_pci.c
drivers/cpufreq/cpufreq.c
drivers/cpufreq/cpufreq_stats.c
drivers/cpufreq/cpufreq_userspace.c
drivers/dma/dmaengine.c
drivers/dma/ioatdma.c
drivers/dma/ioatdma_registers.h
drivers/dma/iovlock.c
drivers/edac/amd76x_edac.c
drivers/edac/e752x_edac.c
drivers/edac/e7xxx_edac.c
drivers/edac/edac_mc.c
drivers/edac/edac_mc.h
drivers/edac/i82860_edac.c
drivers/edac/i82875p_edac.c
drivers/edac/r82600_edac.c
drivers/eisa/virtual_root.c
drivers/fc4/fc_syms.c
drivers/fc4/soc.c
drivers/fc4/socal.c
drivers/firmware/dell_rbu.c
drivers/firmware/efivars.c
drivers/firmware/pcdp.c
drivers/hwmon/hwmon-vid.c
drivers/hwmon/w83792d.c
drivers/i2c/busses/i2c-i801.c
drivers/i2c/busses/i2c-ibm_iic.c
drivers/i2c/busses/i2c-iop3xx.c
drivers/i2c/busses/i2c-mpc.c
drivers/i2c/busses/i2c-powermac.c
drivers/i2c/busses/i2c-pxa.c
drivers/i2c/busses/i2c-s3c2410.c
drivers/i2c/busses/scx200_i2c.c
drivers/i2c/chips/isp1301_omap.c
drivers/i2c/chips/tps65010.c
drivers/ide/arm/icside.c
drivers/ide/cris/ide-cris.c
drivers/ide/h8300/ide-h8300.c
drivers/ide/ide-cd.c
drivers/ide/ide-disk.c
drivers/ide/ide-dma.c
drivers/ide/ide-floppy.c
drivers/ide/ide-io.c
drivers/ide/ide-iops.c
drivers/ide/ide-lib.c
drivers/ide/ide-probe.c
drivers/ide/ide-proc.c
drivers/ide/ide-tape.c
drivers/ide/ide-taskfile.c
drivers/ide/ide.c
drivers/ide/legacy/ali14xx.c
drivers/ide/legacy/dtc2278.c
drivers/ide/legacy/gayle.c
drivers/ide/legacy/hd.c
drivers/ide/legacy/ht6560b.c
drivers/ide/legacy/ide-cs.c
drivers/ide/legacy/macide.c
drivers/ide/legacy/qd65xx.c
drivers/ide/legacy/umc8672.c
drivers/ide/pci/aec62xx.c
drivers/ide/pci/alim15x3.c
drivers/ide/pci/amd74xx.c
drivers/ide/pci/atiixp.c
drivers/ide/pci/cmd640.c
drivers/ide/pci/cmd64x.c
drivers/ide/pci/cs5520.c
drivers/ide/pci/cs5530.c
drivers/ide/pci/cs5535.c
drivers/ide/pci/cy82c693.c
drivers/ide/pci/hpt34x.c
drivers/ide/pci/hpt366.c
drivers/ide/pci/it8172.c
drivers/ide/pci/it821x.c
drivers/ide/pci/ns87415.c
drivers/ide/pci/pdc202xx_new.c
drivers/ide/pci/pdc202xx_old.c
drivers/ide/pci/piix.c
drivers/ide/pci/sc1200.c
drivers/ide/pci/serverworks.c
drivers/ide/pci/siimage.c
drivers/ide/pci/sis5513.c
drivers/ide/pci/sl82c105.c
drivers/ide/pci/slc90e66.c
drivers/ide/pci/triflex.c
drivers/ide/pci/trm290.c
drivers/ide/pci/via82cxxx.c
drivers/ide/ppc/mpc8xx.c
drivers/ide/ppc/pmac.c
drivers/ide/setup-pci.c
drivers/ieee1394/config_roms.c
drivers/ieee1394/dv1394.c
drivers/ieee1394/highlevel.c
drivers/ieee1394/hosts.c
drivers/ieee1394/ieee1394_core.c
drivers/ieee1394/nodemgr.c
drivers/ieee1394/ohci1394.c
drivers/ieee1394/oui2c.sh
drivers/ieee1394/pcilynx.c
drivers/ieee1394/pcilynx.h
drivers/ieee1394/sbp2.c
drivers/ieee1394/video1394.c
drivers/infiniband/core/cm.c
drivers/infiniband/core/uverbs_cmd.c
drivers/infiniband/hw/ipath/Kconfig
drivers/infiniband/hw/ipath/Makefile
drivers/infiniband/hw/ipath/ipath_common.h
drivers/infiniband/hw/ipath/ipath_cq.c
drivers/infiniband/hw/ipath/ipath_debug.h
drivers/infiniband/hw/ipath/ipath_diag.c
drivers/infiniband/hw/ipath/ipath_driver.c
drivers/infiniband/hw/ipath/ipath_eeprom.c
drivers/infiniband/hw/ipath/ipath_file_ops.c
drivers/infiniband/hw/ipath/ipath_fs.c
drivers/infiniband/hw/ipath/ipath_ht400.c
drivers/infiniband/hw/ipath/ipath_init_chip.c
drivers/infiniband/hw/ipath/ipath_intr.c
drivers/infiniband/hw/ipath/ipath_kernel.h
drivers/infiniband/hw/ipath/ipath_keys.c
drivers/infiniband/hw/ipath/ipath_layer.c
drivers/infiniband/hw/ipath/ipath_layer.h
drivers/infiniband/hw/ipath/ipath_mad.c
drivers/infiniband/hw/ipath/ipath_mr.c
drivers/infiniband/hw/ipath/ipath_pe800.c
drivers/infiniband/hw/ipath/ipath_qp.c
drivers/infiniband/hw/ipath/ipath_rc.c
drivers/infiniband/hw/ipath/ipath_registers.h
drivers/infiniband/hw/ipath/ipath_ruc.c
drivers/infiniband/hw/ipath/ipath_srq.c
drivers/infiniband/hw/ipath/ipath_stats.c
drivers/infiniband/hw/ipath/ipath_sysfs.c
drivers/infiniband/hw/ipath/ipath_uc.c
drivers/infiniband/hw/ipath/ipath_ud.c
drivers/infiniband/hw/ipath/ipath_user_pages.c
drivers/infiniband/hw/ipath/ipath_verbs.c
drivers/infiniband/hw/ipath/ipath_verbs.h
drivers/infiniband/hw/ipath/ipath_verbs_mcast.c
drivers/infiniband/hw/ipath/ipath_wc_x86_64.c
drivers/infiniband/hw/ipath/ips_common.h [deleted file]
drivers/infiniband/hw/ipath/verbs_debug.h
drivers/infiniband/hw/mthca/mthca_eq.c
drivers/infiniband/hw/mthca/mthca_main.c
drivers/infiniband/hw/mthca/mthca_qp.c
drivers/infiniband/hw/mthca/mthca_reset.c
drivers/infiniband/ulp/ipoib/ipoib.h
drivers/infiniband/ulp/iser/iscsi_iser.c
drivers/input/gameport/emu10k1-gp.c
drivers/input/gameport/ns558.c
drivers/input/joystick/analog.c
drivers/input/joystick/iforce/iforce.h
drivers/input/keyboard/corgikbd.c
drivers/input/keyboard/hilkbd.c
drivers/input/keyboard/locomokbd.c
drivers/input/keyboard/spitzkbd.c
drivers/input/misc/ixp4xx-beeper.c
drivers/input/misc/sparcspkr.c
drivers/input/mouse/inport.c
drivers/input/mouse/rpcmouse.c
drivers/input/mouse/sermouse.c
drivers/input/mouse/vsxxxaa.c
drivers/input/mousedev.c
drivers/input/power.c
drivers/input/serio/ct82c710.c
drivers/input/serio/gscps2.c
drivers/input/serio/i8042-sparcio.h
drivers/input/serio/i8042.c
drivers/input/serio/i8042.h
drivers/input/serio/libps2.c
drivers/input/serio/pcips2.c
drivers/input/touchscreen/ads7846.c
drivers/input/touchscreen/corgi_ts.c
drivers/input/touchscreen/h3600_ts_input.c
drivers/input/touchscreen/hp680_ts_input.c
drivers/input/tsdev.c
drivers/isdn/capi/capi.c
drivers/isdn/capi/capiutil.c
drivers/isdn/divert/divert_procfs.c
drivers/isdn/gigaset/gigaset.h
drivers/isdn/hardware/avm/b1dma.c
drivers/isdn/hardware/avm/b1pci.c
drivers/isdn/hardware/avm/b1pcmcia.c
drivers/isdn/hardware/avm/c4.c
drivers/isdn/hardware/avm/t1pci.c
drivers/isdn/hardware/eicon/capimain.c
drivers/isdn/hardware/eicon/diva_didd.c
drivers/isdn/hardware/eicon/divamnt.c
drivers/isdn/hardware/eicon/divasi.c
drivers/isdn/hardware/eicon/divasmain.c
drivers/isdn/hardware/eicon/divasproc.c
drivers/isdn/hardware/eicon/platform.h
drivers/isdn/hisax/avm_a1p.c
drivers/isdn/hisax/avm_pci.c
drivers/isdn/hisax/bkm_a4t.c
drivers/isdn/hisax/bkm_a8.c
drivers/isdn/hisax/config.c
drivers/isdn/hisax/diva.c
drivers/isdn/hisax/elsa.c
drivers/isdn/hisax/elsa_ser.c
drivers/isdn/hisax/enternow_pci.c
drivers/isdn/hisax/gazel.c
drivers/isdn/hisax/hfc4s8s_l1.c
drivers/isdn/hisax/hfc_pci.c
drivers/isdn/hisax/hfc_usb.c
drivers/isdn/hisax/hisax.h
drivers/isdn/hisax/hisax_debug.h
drivers/isdn/hisax/hisax_fcpcipnp.c
drivers/isdn/hisax/ipacx.c
drivers/isdn/hisax/isdnl3.c
drivers/isdn/hisax/l3dss1.c
drivers/isdn/hisax/niccy.c
drivers/isdn/hisax/nj_s.c
drivers/isdn/hisax/nj_u.c
drivers/isdn/hisax/sedlbauer.c
drivers/isdn/hisax/st5481.h
drivers/isdn/hisax/st5481_init.c
drivers/isdn/hisax/teles3.c
drivers/isdn/hisax/telespci.c
drivers/isdn/hisax/w6692.c
drivers/isdn/hysdn/boardergo.c
drivers/isdn/hysdn/hysdn_defs.h
drivers/isdn/hysdn/hysdn_init.c
drivers/isdn/hysdn/hysdn_sched.c
drivers/isdn/i4l/isdn_common.c
drivers/isdn/i4l/isdn_net.c
drivers/isdn/i4l/isdn_ppp.c
drivers/isdn/i4l/isdn_tty.c
drivers/isdn/i4l/isdn_tty.h
drivers/isdn/isdnloop/isdnloop.c
drivers/isdn/sc/init.c
drivers/leds/led-class.c
drivers/leds/led-triggers.c
drivers/leds/leds-corgi.c
drivers/leds/leds-ixp4xx-gpio.c
drivers/leds/leds-locomo.c
drivers/leds/leds-s3c24xx.c
drivers/leds/leds-spitz.c
drivers/leds/leds-tosa.c
drivers/leds/ledtrig-timer.c
drivers/macintosh/adb.c
drivers/macintosh/adbhid.c
drivers/macintosh/apm_emu.c
drivers/macintosh/mac_hid.c
drivers/macintosh/macio-adb.c
drivers/macintosh/macio_asic.c
drivers/macintosh/macio_sysfs.c
drivers/macintosh/mediabay.c
drivers/macintosh/smu.c
drivers/macintosh/therm_adt746x.c
drivers/macintosh/therm_pm72.c
drivers/macintosh/therm_pm72.h
drivers/macintosh/therm_windtunnel.c
drivers/macintosh/via-cuda.c
drivers/macintosh/via-pmu.c
drivers/macintosh/windfarm_cpufreq_clamp.c
drivers/md/bitmap.c
drivers/md/dm-snap.c
drivers/md/kcopyd.c
drivers/md/md.c
drivers/md/raid5.c
drivers/media/common/saa7146_core.c
drivers/media/common/saa7146_hlp.c
drivers/media/dvb/b2c2/flexcop-common.h
drivers/media/dvb/b2c2/flexcop-pci.c
drivers/media/dvb/bt8xx/bt878.c
drivers/media/dvb/cinergyT2/cinergyT2.c
drivers/media/dvb/dvb-core/dvb_frontend.c
drivers/media/dvb/dvb-usb/dvb-usb.h
drivers/media/dvb/frontends/cx22700.c
drivers/media/dvb/frontends/cx24123.c
drivers/media/dvb/frontends/dib3000mb.c
drivers/media/dvb/frontends/dib3000mc.c
drivers/media/dvb/frontends/lgdt330x.c
drivers/media/dvb/frontends/tda10021.c
drivers/media/dvb/frontends/ves1820.c
drivers/media/dvb/pluto2/pluto2.c
drivers/media/dvb/ttpci/av7110.c
drivers/media/dvb/ttpci/budget-av.c
drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
drivers/media/radio/radio-gemtek-pci.c
drivers/media/video/arv.c
drivers/media/video/bt8xx/bttv-cards.c
drivers/media/video/bt8xx/bttv-driver.c
drivers/media/video/bt8xx/bttvp.h
drivers/media/video/compat_ioctl32.c
drivers/media/video/cpia.c
drivers/media/video/cpia2/cpia2_v4l.c
drivers/media/video/cpia_pp.c
drivers/media/video/cx88/cx88-alsa.c
drivers/media/video/cx88/cx88-blackbird.c
drivers/media/video/cx88/cx88-cards.c
drivers/media/video/cx88/cx88-dvb.c
drivers/media/video/cx88/cx88-mpeg.c
drivers/media/video/cx88/cx88-video.c
drivers/media/video/cx88/cx88.h
drivers/media/video/em28xx/em28xx-video.c
drivers/media/video/meye.c
drivers/media/video/meye.h
drivers/media/video/msp3400-driver.h
drivers/media/video/ov511.c
drivers/media/video/pvrusb2/Makefile
drivers/media/video/pvrusb2/pvrusb2-audio.c
drivers/media/video/pvrusb2/pvrusb2-context.c
drivers/media/video/pvrusb2/pvrusb2-ctrl.c
drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c
drivers/media/video/pvrusb2/pvrusb2-debugifc.c
drivers/media/video/pvrusb2/pvrusb2-demod.c [deleted file]
drivers/media/video/pvrusb2/pvrusb2-demod.h [deleted file]
drivers/media/video/pvrusb2/pvrusb2-eeprom.c
drivers/media/video/pvrusb2/pvrusb2-encoder.c
drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h
drivers/media/video/pvrusb2/pvrusb2-hdw.c
drivers/media/video/pvrusb2/pvrusb2-hdw.h
drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c
drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
drivers/media/video/pvrusb2/pvrusb2-i2c-core.c
drivers/media/video/pvrusb2/pvrusb2-i2c-core.h
drivers/media/video/pvrusb2/pvrusb2-io.c
drivers/media/video/pvrusb2/pvrusb2-io.h
drivers/media/video/pvrusb2/pvrusb2-ioread.c
drivers/media/video/pvrusb2/pvrusb2-ioread.h
drivers/media/video/pvrusb2/pvrusb2-main.c
drivers/media/video/pvrusb2/pvrusb2-std.c
drivers/media/video/pvrusb2/pvrusb2-sysfs.c
drivers/media/video/pvrusb2/pvrusb2-tuner.c
drivers/media/video/pvrusb2/pvrusb2-v4l2.c
drivers/media/video/pvrusb2/pvrusb2-video-v4l.c
drivers/media/video/pvrusb2/pvrusb2-wm8775.c
drivers/media/video/pwc/pwc-uncompress.h
drivers/media/video/pwc/pwc.h
drivers/media/video/saa7134/saa7134-alsa.c
drivers/media/video/saa7134/saa7134-core.c
drivers/media/video/saa7134/saa7134-oss.c
drivers/media/video/se401.c
drivers/media/video/stradis.c
drivers/media/video/stv680.c
drivers/media/video/tda9887.c
drivers/media/video/tuner-core.c
drivers/media/video/tuner-simple.c
drivers/media/video/tuner-types.c
drivers/media/video/tvaudio.c
drivers/media/video/tveeprom.c
drivers/media/video/usbvideo/usbvideo.h
drivers/media/video/v4l1-compat.c
drivers/media/video/v4l2-common.c
drivers/media/video/videocodec.c
drivers/media/video/videocodec.h
drivers/media/video/w9968cf.h
drivers/media/video/zoran_card.c
drivers/media/video/zoran_device.c
drivers/media/video/zoran_driver.c
drivers/media/video/zoran_procfs.c
drivers/media/video/zr36120.c
drivers/media/video/zr36120_mem.c
drivers/message/fusion/Makefile
drivers/message/fusion/lsi/fc_log.h [deleted file]
drivers/message/fusion/lsi/mpi.h
drivers/message/fusion/lsi/mpi_cnfg.h
drivers/message/fusion/lsi/mpi_history.txt
drivers/message/fusion/lsi/mpi_init.h
drivers/message/fusion/lsi/mpi_ioc.h
drivers/message/fusion/lsi/mpi_log_sas.h
drivers/message/fusion/lsi/mpi_sas.h
drivers/message/fusion/lsi/mpi_targ.h
drivers/message/fusion/mptbase.c
drivers/message/fusion/mptbase.h
drivers/message/fusion/mptfc.c
drivers/message/fusion/mptsas.c
drivers/message/fusion/mptspi.c
drivers/message/i2o/debug.c
drivers/message/i2o/pci.c
drivers/mfd/ucb1x00-core.c
drivers/mfd/ucb1x00-ts.c
drivers/misc/ibmasm/ibmasm.h
drivers/misc/ibmasm/module.c
drivers/mmc/at91_mci.c
drivers/mmc/au1xmmc.c
drivers/mmc/imxmmc.c
drivers/mmc/mmc.c
drivers/mmc/mmci.c
drivers/mmc/omap.c
drivers/mmc/pxamci.c
drivers/mmc/sdhci.c
drivers/mmc/sdhci.h
drivers/mmc/wbsd.c
drivers/mtd/chips/cfi_cmdset_0002.c
drivers/mtd/chips/cfi_probe.c
drivers/mtd/chips/chipreg.c
drivers/mtd/chips/jedec_probe.c
drivers/mtd/devices/block2mtd.c
drivers/mtd/devices/doc2000.c
drivers/mtd/devices/doc2001.c
drivers/mtd/devices/doc2001plus.c
drivers/mtd/devices/docprobe.c
drivers/mtd/devices/mtd_dataflash.c
drivers/mtd/devices/mtdram.c
drivers/mtd/devices/pmc551.c
drivers/mtd/inftlcore.c
drivers/mtd/maps/alchemy-flash.c
drivers/mtd/maps/amd76xrom.c
drivers/mtd/maps/ceiva.c
drivers/mtd/maps/cstm_mips_ixx.c
drivers/mtd/maps/dbox2-flash.c
drivers/mtd/maps/dc21285.c
drivers/mtd/maps/dilnetpc.c
drivers/mtd/maps/dmv182.c
drivers/mtd/maps/ebony.c
drivers/mtd/maps/edb7312.c
drivers/mtd/maps/h720x-flash.c
drivers/mtd/maps/ichxrom.c
drivers/mtd/maps/impa7.c
drivers/mtd/maps/integrator-flash.c
drivers/mtd/maps/ipaq-flash.c
drivers/mtd/maps/l440gx.c
drivers/mtd/maps/lasat.c
drivers/mtd/maps/mpc1211.c
drivers/mtd/maps/mtx-1_flash.c
drivers/mtd/maps/ocotea.c
drivers/mtd/maps/omap-toto-flash.c
drivers/mtd/maps/physmap.c
drivers/mtd/maps/redwood.c
drivers/mtd/maps/sa1100-flash.c
drivers/mtd/maps/sbc8240.c
drivers/mtd/maps/sc520cdp.c
drivers/mtd/maps/scb2_flash.c
drivers/mtd/maps/scx200_docflash.c
drivers/mtd/maps/solutionengine.c
drivers/mtd/maps/tqm834x.c
drivers/mtd/maps/tqm8xxl.c
drivers/mtd/maps/ts5500_flash.c
drivers/mtd/maps/uclinux.c
drivers/mtd/maps/walnut.c
drivers/mtd/maps/wr_sbc82xx_flash.c
drivers/mtd/mtdblock.c
drivers/mtd/mtdchar.c
drivers/mtd/mtdcore.c
drivers/mtd/mtdpart.c
drivers/mtd/nand/nand_base.c
drivers/mtd/nand/nand_ecc.c
drivers/mtd/nand/nandsim.c
drivers/mtd/nand/sharpsl.c
drivers/mtd/nftlcore.c
drivers/net/3c509.c
drivers/net/3c515.c
drivers/net/3c523.c
drivers/net/3c527.c
drivers/net/3c59x.c
drivers/net/8139cp.c
drivers/net/8139too.c
drivers/net/82596.c
drivers/net/8390.c
drivers/net/8390.h
drivers/net/Space.c
drivers/net/a2065.c
drivers/net/acenic.c
drivers/net/acenic.h
drivers/net/acenic_firmware.h
drivers/net/amd8111e.c
drivers/net/apne.c
drivers/net/appletalk/cops.c
drivers/net/appletalk/cops_ffdrv.h
drivers/net/appletalk/cops_ltdrv.h
drivers/net/appletalk/ipddp.c
drivers/net/arcnet/arcnet.c
drivers/net/arcnet/com20020-pci.c
drivers/net/ariadne.c
drivers/net/arm/at91_ether.c
drivers/net/at1700.c
drivers/net/au1000_eth.c
drivers/net/b44.c
drivers/net/bmac.c
drivers/net/bnx2.c
drivers/net/bonding/bond_main.c
drivers/net/bonding/bond_sysfs.c
drivers/net/cassini.c
drivers/net/chelsio/common.h
drivers/net/chelsio/cxgb2.c
drivers/net/chelsio/sge.c
drivers/net/cris/eth_v10.c
drivers/net/cs89x0.c
drivers/net/cs89x0.h
drivers/net/declance.c
drivers/net/defxx.c
drivers/net/depca.c
drivers/net/dgrs.c
drivers/net/dl2k.c
drivers/net/dm9000.c
drivers/net/dummy.c
drivers/net/e100.c
drivers/net/e1000/e1000.h
drivers/net/e1000/e1000_ethtool.c
drivers/net/e1000/e1000_main.c
drivers/net/eepro.c
drivers/net/eepro100.c
drivers/net/eexpress.c
drivers/net/epic100.c
drivers/net/fealnx.c
drivers/net/fec.c
drivers/net/fec_8xx/fec_8xx-netta.c
drivers/net/fec_8xx/fec_main.c
drivers/net/fec_8xx/fec_mii.c
drivers/net/forcedeth.c
drivers/net/fs_enet/fs_enet-main.c
drivers/net/fs_enet/fs_enet-mii.c
drivers/net/fs_enet/mac-fcc.c
drivers/net/fs_enet/mac-fec.c
drivers/net/fs_enet/mac-scc.c
drivers/net/fs_enet/mii-bitbang.c
drivers/net/fs_enet/mii-fixed.c
drivers/net/gianfar.c
drivers/net/gianfar.h
drivers/net/gianfar_ethtool.c
drivers/net/gianfar_mii.c
drivers/net/gianfar_sysfs.c
drivers/net/gt96100eth.c
drivers/net/gt96100eth.h
drivers/net/hamachi.c
drivers/net/hamradio/6pack.c
drivers/net/hamradio/baycom_ser_fdx.c
drivers/net/hamradio/baycom_ser_hdx.c
drivers/net/hamradio/bpqether.c
drivers/net/hamradio/mkiss.c
drivers/net/hamradio/scc.c
drivers/net/hamradio/yam.c
drivers/net/hp100.c
drivers/net/hydra.c
drivers/net/ibm_emac/ibm_emac.h
drivers/net/ibm_emac/ibm_emac_core.c
drivers/net/ibm_emac/ibm_emac_core.h
drivers/net/ibm_emac/ibm_emac_debug.c
drivers/net/ibm_emac/ibm_emac_debug.h
drivers/net/ibm_emac/ibm_emac_mal.c
drivers/net/ibm_emac/ibm_emac_mal.h
drivers/net/ibm_emac/ibm_emac_phy.c
drivers/net/ibm_emac/ibm_emac_rgmii.c
drivers/net/ibm_emac/ibm_emac_rgmii.h
drivers/net/ibm_emac/ibm_emac_tah.c
drivers/net/ibm_emac/ibm_emac_tah.h
drivers/net/ibm_emac/ibm_emac_zmii.c
drivers/net/ibm_emac/ibm_emac_zmii.h
drivers/net/ibmlana.c
drivers/net/ibmveth.c
drivers/net/ifb.c
drivers/net/ioc3-eth.c
drivers/net/irda/au1k_ir.c
drivers/net/irda/donauboe.c
drivers/net/irda/pxaficp_ir.c
drivers/net/irda/sa1100_ir.c
drivers/net/irda/vlsi_ir.c
drivers/net/iseries_veth.c
drivers/net/ixgb/ixgb.h
drivers/net/ixgb/ixgb_main.c
drivers/net/ixp2000/caleb.c
drivers/net/ixp2000/enp2611.c
drivers/net/ixp2000/ixp2400-msf.c
drivers/net/ixp2000/ixpdev.c
drivers/net/ixp2000/pm3386.c
drivers/net/jazzsonic.c
drivers/net/lp486e.c
drivers/net/mace.c
drivers/net/mipsnet.c
drivers/net/mv643xx_eth.c
drivers/net/mv643xx_eth.h
drivers/net/myri10ge/myri10ge.c
drivers/net/myri_sbus.c
drivers/net/natsemi.c
drivers/net/ne2k-pci.c
drivers/net/netx-eth.c
drivers/net/ns83820.c
drivers/net/pci-skeleton.c
drivers/net/pcmcia/axnet_cs.c
drivers/net/pcmcia/com20020_cs.c
drivers/net/pcmcia/pcnet_cs.c
drivers/net/pcnet32.c
drivers/net/phy/cicada.c
drivers/net/phy/davicom.c
drivers/net/phy/lxt.c
drivers/net/phy/marvell.c
drivers/net/phy/mdio_bus.c
drivers/net/phy/phy.c
drivers/net/phy/phy_device.c
drivers/net/phy/qsemi.c
drivers/net/ppp_generic.c
drivers/net/ppp_mppe.c
drivers/net/r8169.c
drivers/net/rrunner.c
drivers/net/rrunner.h
drivers/net/s2io.c
drivers/net/s2io.h
drivers/net/sb1250-mac.c
drivers/net/shaper.c
drivers/net/sis190.c
drivers/net/sis900.c
drivers/net/sk98lin/skge.c
drivers/net/sk98lin/skvpd.c
drivers/net/sk_mca.c
drivers/net/skfp/h/sba.h
drivers/net/skfp/skfddi.c
drivers/net/skge.c
drivers/net/sky2.c
drivers/net/slhc.c
drivers/net/slip.c
drivers/net/slip.h
drivers/net/smc-ultra.c
drivers/net/smc-ultra32.c
drivers/net/smc911x.c
drivers/net/smc91x.c
drivers/net/smc91x.h
drivers/net/sonic.h
drivers/net/spider_net.c
drivers/net/starfire.c
drivers/net/stnic.c
drivers/net/sun3lance.c
drivers/net/sunbmac.c
drivers/net/sundance.c
drivers/net/sungem.c
drivers/net/sungem_phy.c
drivers/net/sunhme.c
drivers/net/sunhme.h
drivers/net/sunlance.c
drivers/net/sunqe.c
drivers/net/tc35815.c
drivers/net/tg3.c
drivers/net/tg3.h
drivers/net/tlan.c
drivers/net/tokenring/3c359.c
drivers/net/tokenring/abyss.c
drivers/net/tokenring/lanstreamer.c
drivers/net/tokenring/madgemc.c
drivers/net/tokenring/olympic.c
drivers/net/tokenring/smctr.c
drivers/net/tokenring/smctr_firmware.h
drivers/net/tokenring/tmspci.c
drivers/net/tulip/de2104x.c
drivers/net/tulip/de4x5.c
drivers/net/tulip/dmfe.c
drivers/net/tulip/interrupt.c
drivers/net/tulip/tulip.h
drivers/net/tulip/tulip_core.c
drivers/net/tulip/uli526x.c
drivers/net/tulip/winbond-840.c
drivers/net/tulip/xircom_cb.c
drivers/net/tulip/xircom_tulip_cb.c
drivers/net/tun.c
drivers/net/typhoon.c
drivers/net/via-rhine.c
drivers/net/via-velocity.c
drivers/net/wan/cosa.c
drivers/net/wan/dscc4.c
drivers/net/wan/farsync.c
drivers/net/wan/hdlc_generic.c
drivers/net/wan/hostess_sv11.c
drivers/net/wan/lmc/lmc_main.c
drivers/net/wan/lmc/lmc_media.c
drivers/net/wan/pc300_drv.c
drivers/net/wan/pci200syn.c
drivers/net/wan/sbni.c
drivers/net/wan/sealevel.c
drivers/net/wan/syncppp.c
drivers/net/wan/wanxl.c
drivers/net/wireless/airo.c
drivers/net/wireless/airo_cs.c
drivers/net/wireless/airport.c
drivers/net/wireless/arlan-main.c
drivers/net/wireless/arlan-proc.c
drivers/net/wireless/arlan.h
drivers/net/wireless/atmel.c
drivers/net/wireless/atmel_cs.c
drivers/net/wireless/atmel_pci.c
drivers/net/wireless/bcm43xx/bcm43xx_ethtool.c
drivers/net/wireless/bcm43xx/bcm43xx_main.c
drivers/net/wireless/hermes.c
drivers/net/wireless/hostap/hostap_cs.c
drivers/net/wireless/hostap/hostap_hw.c
drivers/net/wireless/hostap/hostap_main.c
drivers/net/wireless/hostap/hostap_pci.c
drivers/net/wireless/hostap/hostap_plx.c
drivers/net/wireless/ipw2100.c
drivers/net/wireless/ipw2200.c
drivers/net/wireless/ipw2200.h
drivers/net/wireless/netwave_cs.c
drivers/net/wireless/orinoco.c
drivers/net/wireless/orinoco_cs.c
drivers/net/wireless/orinoco_nortel.c
drivers/net/wireless/orinoco_pci.c
drivers/net/wireless/orinoco_pci.h
drivers/net/wireless/orinoco_plx.c
drivers/net/wireless/orinoco_tmd.c
drivers/net/wireless/prism54/islpci_hotplug.c
drivers/net/wireless/prism54/islpci_mgt.c
drivers/net/wireless/prism54/prismcompat.h
drivers/net/wireless/ray_cs.c
drivers/net/wireless/spectrum_cs.c
drivers/net/wireless/strip.c
drivers/net/wireless/wavelan_cs.p.h
drivers/net/wireless/wl3501_cs.c
drivers/net/yellowfin.c
drivers/net/znet.c
drivers/net/zorro8390.c
drivers/nubus/nubus.c
drivers/nubus/nubus_syms.c
drivers/parisc/ccio-dma.c
drivers/parisc/dino.c
drivers/parisc/eisa.c
drivers/parisc/gsc.c
drivers/parisc/led.c
drivers/parisc/power.c
drivers/parisc/sba_iommu.c
drivers/parisc/superio.c
drivers/parport/ieee1284.c
drivers/parport/ieee1284_ops.c
drivers/parport/parport_ax88796.c
drivers/parport/parport_mfc3.c
drivers/parport/parport_pc.c
drivers/parport/parport_sunbpp.c
drivers/parport/procfs.c
drivers/parport/share.c
drivers/pci/hotplug/Makefile
drivers/pci/hotplug/acpiphp.h
drivers/pci/hotplug/acpiphp_core.c
drivers/pci/hotplug/acpiphp_dock.c [deleted file]
drivers/pci/hotplug/acpiphp_glue.c
drivers/pci/hotplug/cpci_hotplug_core.c
drivers/pci/hotplug/cpci_hotplug_pci.c
drivers/pci/hotplug/cpcihp_generic.c
drivers/pci/hotplug/cpcihp_zt5550.c
drivers/pci/hotplug/cpqphp_core.c
drivers/pci/hotplug/cpqphp_ctrl.c
drivers/pci/hotplug/cpqphp_nvram.c
drivers/pci/hotplug/cpqphp_pci.c
drivers/pci/hotplug/cpqphp_sysfs.c
drivers/pci/hotplug/fakephp.c
drivers/pci/hotplug/pci_hotplug_core.c
drivers/pci/hotplug/pciehp_hpc.c
drivers/pci/hotplug/pcihp_skeleton.c
drivers/pci/hotplug/rpaphp_core.c
drivers/pci/hotplug/shpchp_hpc.c
drivers/pci/msi.c
drivers/pci/pci-sysfs.c
drivers/pci/quirks.c
drivers/pci/rom.c
drivers/pcmcia/at91_cf.c
drivers/pcmcia/au1000_db1x00.c
drivers/pcmcia/au1000_generic.c
drivers/pcmcia/au1000_generic.h
drivers/pcmcia/au1000_pb1x00.c
drivers/pcmcia/cs.c
drivers/pcmcia/hd64465_ss.c
drivers/pcmcia/i82092.c
drivers/pcmcia/i82365.c
drivers/pcmcia/m32r_cfc.c
drivers/pcmcia/m32r_pcc.c
drivers/pcmcia/omap_cf.c
drivers/pcmcia/pcmcia_resource.c
drivers/pcmcia/pd6729.c
drivers/pcmcia/pxa2xx_base.c
drivers/pcmcia/sa1100_generic.c
drivers/pcmcia/sa1111_generic.c
drivers/pcmcia/sa11xx_base.c
drivers/pcmcia/soc_common.c
drivers/pcmcia/ti113x.h
drivers/pcmcia/vrc4171_card.c
drivers/pcmcia/vrc4173_cardu.c
drivers/pcmcia/yenta_socket.c
drivers/pnp/card.c
drivers/pnp/driver.c
drivers/pnp/isapnp/compat.c
drivers/pnp/isapnp/core.c
drivers/pnp/isapnp/proc.c
drivers/pnp/manager.c
drivers/pnp/pnpacpi/core.c
drivers/pnp/pnpacpi/rsparser.c
drivers/pnp/pnpbios/rsparser.c
drivers/pnp/quirks.c
drivers/pnp/resource.c
drivers/pnp/support.c
drivers/rapidio/rio-scan.c
drivers/rapidio/rio-sysfs.c
drivers/rapidio/rio.c
drivers/rtc/Kconfig
drivers/rtc/Makefile
drivers/rtc/rtc-at91.c
drivers/rtc/rtc-ds1553.c
drivers/rtc/rtc-pl031.c
drivers/rtc/rtc-s3c.c [new file with mode: 0644]
drivers/rtc/rtc-sa1100.c
drivers/rtc/rtc-vr41xx.c
drivers/s390/block/dasd.c
drivers/s390/block/dasd_devmap.c
drivers/s390/block/dasd_diag.c
drivers/s390/block/dasd_eckd.c
drivers/s390/block/dasd_erp.c
drivers/s390/block/dasd_fba.c
drivers/s390/block/dasd_genhd.c
drivers/s390/block/dasd_ioctl.c
drivers/s390/block/dasd_proc.c
drivers/s390/char/con3215.c
drivers/s390/char/con3270.c
drivers/s390/char/ctrlchar.c
drivers/s390/char/fs3270.c
drivers/s390/char/keyboard.c
drivers/s390/char/raw3270.c
drivers/s390/char/sclp.c
drivers/s390/char/sclp_con.c
drivers/s390/char/sclp_cpi.c
drivers/s390/char/sclp_quiesce.c
drivers/s390/char/sclp_rw.c
drivers/s390/char/sclp_tty.c
drivers/s390/char/sclp_vt220.c
drivers/s390/char/tape.h
drivers/s390/char/tape_34xx.c
drivers/s390/char/tape_3590.c
drivers/s390/char/tape_block.c
drivers/s390/char/tape_char.c
drivers/s390/char/tape_core.c
drivers/s390/char/tape_proc.c
drivers/s390/char/tape_std.c
drivers/s390/char/tty3270.c
drivers/s390/cio/blacklist.c
drivers/s390/cio/chsc.c
drivers/s390/cio/cio.c
drivers/s390/cio/device.c
drivers/s390/cio/device_fsm.c
drivers/s390/cio/device_id.c
drivers/s390/cio/device_ops.c
drivers/s390/cio/device_pgid.c
drivers/s390/cio/device_status.c
drivers/s390/cio/qdio.c
drivers/s390/net/fsm.c
drivers/s390/net/iucv.c
drivers/s390/net/qeth_eddp.c
drivers/s390/net/qeth_main.c
drivers/s390/s390mach.c
drivers/s390/scsi/zfcp_erp.c
drivers/s390/scsi/zfcp_qdio.c
drivers/s390/sysinfo.c
drivers/sbus/char/aurora.c
drivers/sbus/char/bbc_i2c.c
drivers/sbus/char/cpwatchdog.c
drivers/sbus/char/envctrl.c
drivers/sbus/char/flash.c
drivers/sbus/char/openprom.c
drivers/sbus/dvma.c
drivers/sbus/sbus.c
drivers/scsi/3w-9xxx.c
drivers/scsi/3w-xxxx.c
drivers/scsi/53c700.c
drivers/scsi/53c700.h
drivers/scsi/53c7xx.c
drivers/scsi/BusLogic.c
drivers/scsi/BusLogic.h
drivers/scsi/FlashPoint.c
drivers/scsi/NCR5380.c
drivers/scsi/NCR53C9x.c
drivers/scsi/NCR53C9x.h
drivers/scsi/NCR_D700.c
drivers/scsi/NCR_Q720.c
drivers/scsi/a100u2w.c
drivers/scsi/a2091.c
drivers/scsi/a3000.c
drivers/scsi/aacraid/comminit.c
drivers/scsi/aacraid/rkt.c
drivers/scsi/aacraid/rx.c
drivers/scsi/aacraid/sa.c
drivers/scsi/advansys.c
drivers/scsi/aha152x.c
drivers/scsi/aha1542.c
drivers/scsi/aha1740.c
drivers/scsi/ahci.c
drivers/scsi/aic7xxx/aic7770_osm.c
drivers/scsi/aic7xxx/aic79xx.h
drivers/scsi/aic7xxx/aic79xx_core.c
drivers/scsi/aic7xxx/aic79xx_osm.c
drivers/scsi/aic7xxx/aic79xx_osm.h
drivers/scsi/aic7xxx/aic79xx_osm_pci.c
drivers/scsi/aic7xxx/aic79xx_proc.c
drivers/scsi/aic7xxx/aic7xxx_osm.h
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
drivers/scsi/aic7xxx_old.c
drivers/scsi/aic7xxx_old/aic7xxx_proc.c
drivers/scsi/amiga7xx.c
drivers/scsi/arm/acornscsi.c
drivers/scsi/arm/cumana_1.c
drivers/scsi/arm/cumana_2.c
drivers/scsi/arm/powertec.c
drivers/scsi/atari_NCR5380.c
drivers/scsi/atari_scsi.c
drivers/scsi/atp870u.c
drivers/scsi/blz1230.c
drivers/scsi/blz2060.c
drivers/scsi/ch.c
drivers/scsi/constants.c
drivers/scsi/cyberstorm.c
drivers/scsi/cyberstormII.c
drivers/scsi/dc395x.c
drivers/scsi/dec_esp.c
drivers/scsi/dmx3191d.c
drivers/scsi/dpt/dpti_i2o.h
drivers/scsi/dpt_i2o.c
drivers/scsi/dtc.c
drivers/scsi/eata.c
drivers/scsi/eata_pio.c
drivers/scsi/esp.c
drivers/scsi/fastlane.c
drivers/scsi/fcal.c
drivers/scsi/fd_mcs.c
drivers/scsi/fdomain.c
drivers/scsi/g_NCR5380.c
drivers/scsi/g_NCR5380.h
drivers/scsi/gdth.c
drivers/scsi/gvp11.c
drivers/scsi/hptiop.c
drivers/scsi/ibmmca.c
drivers/scsi/ibmvscsi/ibmvscsi.c
drivers/scsi/ibmvscsi/rpa_vscsi.c
drivers/scsi/ide-scsi.c
drivers/scsi/imm.c
drivers/scsi/in2000.c
drivers/scsi/initio.c
drivers/scsi/initio.h
drivers/scsi/ipr.c
drivers/scsi/ips.c
drivers/scsi/iscsi_tcp.c
drivers/scsi/jazz_esp.c
drivers/scsi/lasi700.c
drivers/scsi/libata-bmdma.c
drivers/scsi/libata-core.c
drivers/scsi/libiscsi.c
drivers/scsi/lpfc/lpfc.h
drivers/scsi/lpfc/lpfc_els.c
drivers/scsi/lpfc/lpfc_init.c
drivers/scsi/lpfc/lpfc_scsi.c
drivers/scsi/megaraid.c
drivers/scsi/megaraid/megaraid_mbox.c
drivers/scsi/megaraid/megaraid_sas.c
drivers/scsi/megaraid/megaraid_sas.h
drivers/scsi/mesh.c
drivers/scsi/ncr53c8xx.h
drivers/scsi/nsp32.c
drivers/scsi/oktagon_esp.c
drivers/scsi/oktagon_io.S
drivers/scsi/osst.h
drivers/scsi/pas16.c
drivers/scsi/pcmcia/nsp_cs.c
drivers/scsi/pcmcia/sym53c500_cs.c
drivers/scsi/pdc_adma.c
drivers/scsi/pluto.c
drivers/scsi/ppa.c
drivers/scsi/qla1280.c
drivers/scsi/qla2xxx/qla_attr.c
drivers/scsi/qla2xxx/qla_dbg.c
drivers/scsi/qla2xxx/qla_dbg.h
drivers/scsi/qla2xxx/qla_def.h
drivers/scsi/qla2xxx/qla_devtbl.h
drivers/scsi/qla2xxx/qla_fw.h
drivers/scsi/qla2xxx/qla_gbl.h
drivers/scsi/qla2xxx/qla_init.c
drivers/scsi/qla2xxx/qla_iocb.c
drivers/scsi/qla2xxx/qla_isr.c
drivers/scsi/qla2xxx/qla_mbx.c
drivers/scsi/qla2xxx/qla_os.c
drivers/scsi/qla2xxx/qla_version.h
drivers/scsi/qlogicpti.c
drivers/scsi/sata_mv.c
drivers/scsi/sata_nv.c
drivers/scsi/sata_promise.c
drivers/scsi/sata_qstor.c
drivers/scsi/sata_sil.c
drivers/scsi/sata_sil24.c
drivers/scsi/sata_sis.c
drivers/scsi/sata_svw.c
drivers/scsi/sata_sx4.c
drivers/scsi/sata_uli.c
drivers/scsi/sata_via.c
drivers/scsi/sata_vsc.c
drivers/scsi/scsi_debug.c
drivers/scsi/scsi_devinfo.c
drivers/scsi/scsi_error.c
drivers/scsi/scsi_lib.c
drivers/scsi/scsi_logging.h
drivers/scsi/scsi_priv.h
drivers/scsi/scsi_sas_internal.h
drivers/scsi/scsi_scan.c
drivers/scsi/scsi_sysfs.c
drivers/scsi/scsi_transport_fc.c
drivers/scsi/scsi_transport_iscsi.c
drivers/scsi/scsi_transport_sas.c
drivers/scsi/scsi_transport_spi.c
drivers/scsi/scsicam.c
drivers/scsi/sd.c
drivers/scsi/seagate.c
drivers/scsi/sg.c
drivers/scsi/sim710.c
drivers/scsi/sr.c
drivers/scsi/sr_vendor.c
drivers/scsi/st.c
drivers/scsi/st.h
drivers/scsi/sun3_NCR5380.c
drivers/scsi/sun3x_esp.c
drivers/scsi/sym53c8xx_2/sym53c8xx.h
drivers/scsi/sym53c8xx_2/sym_glue.c
drivers/scsi/sym53c8xx_2/sym_glue.h
drivers/scsi/t128.c
drivers/scsi/tmscsim.c
drivers/scsi/tmscsim.h
drivers/scsi/u14-34f.c
drivers/scsi/wd33c93.c
drivers/scsi/wd33c93.h
drivers/scsi/wd7000.c
drivers/scsi/zalon.c
drivers/serial/21285.c
drivers/serial/68328serial.c
drivers/serial/68328serial.h
drivers/serial/68360serial.c
drivers/serial/8250.c
drivers/serial/8250.h
drivers/serial/8250_mca.c
drivers/serial/8250_pci.c
drivers/serial/8250_pnp.c
drivers/serial/amba-pl010.c
drivers/serial/amba-pl011.c
drivers/serial/at91_serial.c
drivers/serial/clps711x.c
drivers/serial/cpm_uart/cpm_uart_core.c
drivers/serial/cpm_uart/cpm_uart_cpm1.c
drivers/serial/cpm_uart/cpm_uart_cpm2.c
drivers/serial/crisv10.c
drivers/serial/crisv10.h
drivers/serial/dz.c
drivers/serial/icom.c
drivers/serial/imx.c
drivers/serial/ioc4_serial.c
drivers/serial/ip22zilog.c
drivers/serial/jsm/jsm_driver.c
drivers/serial/m32r_sio.c
drivers/serial/m32r_sio.h
drivers/serial/m32r_sio_reg.h
drivers/serial/mcfserial.c
drivers/serial/mcfserial.h
drivers/serial/mpc52xx_uart.c
drivers/serial/mpsc.c
drivers/serial/mux.c
drivers/serial/pmac_zilog.c
drivers/serial/pxa.c
drivers/serial/s3c2410.c
drivers/serial/sa1100.c
drivers/serial/serial_core.c
drivers/serial/serial_cs.c
drivers/serial/serial_lh7a40x.c
drivers/serial/serial_txx9.c
drivers/serial/sh-sci.c
drivers/serial/sh-sci.h
drivers/serial/sn_console.c
drivers/serial/suncore.c
drivers/serial/sunhv.c
drivers/serial/sunsab.c
drivers/serial/sunsu.c
drivers/serial/sunzilog.c
drivers/serial/v850e_uart.c
drivers/serial/vr41xx_siu.c
drivers/sn/ioc3.c
drivers/spi/spi.c
drivers/spi/spi_bitbang.c
drivers/spi/spi_butterfly.c
drivers/tc/lk201.c
drivers/tc/zs.c
drivers/usb/core/buffer.c
drivers/usb/core/config.c
drivers/usb/core/devio.c
drivers/usb/core/driver.c
drivers/usb/core/file.c
drivers/usb/core/hcd-pci.c
drivers/usb/core/hcd.c
drivers/usb/core/hub.c
drivers/usb/core/inode.c
drivers/usb/core/message.c
drivers/usb/core/notify.c
drivers/usb/core/sysfs.c
drivers/usb/core/urb.c
drivers/usb/core/usb.c
drivers/usb/core/usb.h
drivers/usb/gadget/at91_udc.c
drivers/usb/gadget/dummy_hcd.c
drivers/usb/gadget/ether.c
drivers/usb/gadget/file_storage.c
drivers/usb/gadget/goku_udc.c
drivers/usb/gadget/lh7a40x_udc.c
drivers/usb/gadget/lh7a40x_udc.h
drivers/usb/gadget/net2280.c
drivers/usb/gadget/omap_udc.c
drivers/usb/gadget/pxa2xx_udc.c
drivers/usb/gadget/rndis.c
drivers/usb/gadget/serial.c
drivers/usb/gadget/zero.c
drivers/usb/host/ehci-au1xxx.c
drivers/usb/host/ehci-fsl.c
drivers/usb/host/ehci-hcd.c
drivers/usb/host/hc_crisv10.c
drivers/usb/host/isp116x-hcd.c
drivers/usb/host/ohci-at91.c
drivers/usb/host/ohci-au1xxx.c
drivers/usb/host/ohci-hcd.c
drivers/usb/host/ohci-lh7a404.c
drivers/usb/host/ohci-omap.c
drivers/usb/host/ohci-ppc-soc.c
drivers/usb/host/ohci-pxa27x.c
drivers/usb/host/ohci-s3c2410.c
drivers/usb/host/ohci-sa1111.c
drivers/usb/host/pci-quirks.c
drivers/usb/host/sl811-hcd.c
drivers/usb/host/uhci-debug.c
drivers/usb/host/uhci-hcd.c
drivers/usb/input/appletouch.c
drivers/usb/input/ati_remote.c
drivers/usb/input/hiddev.c
drivers/usb/input/itmtouch.c
drivers/usb/input/keyspan_remote.c
drivers/usb/input/mtouchusb.c
drivers/usb/input/touchkitusb.c
drivers/usb/input/xpad.c
drivers/usb/input/yealink.c
drivers/usb/misc/cytherm.c
drivers/usb/misc/idmouse.c
drivers/usb/misc/ldusb.c
drivers/usb/misc/legousbtower.c
drivers/usb/misc/phidgetkit.c
drivers/usb/misc/phidgetservo.c
drivers/usb/misc/sisusbvga/sisusb_init.c
drivers/usb/misc/usbled.c
drivers/usb/misc/usbtest.c
drivers/usb/net/asix.c
drivers/usb/net/cdc_ether.c
drivers/usb/net/cdc_subset.c
drivers/usb/net/gl620a.c
drivers/usb/net/net1080.c
drivers/usb/net/plusb.c
drivers/usb/net/rndis_host.c
drivers/usb/net/rtl8150.c
drivers/usb/net/usbnet.c
drivers/usb/net/zaurus.c
drivers/usb/serial/belkin_sa.c
drivers/usb/serial/bus.c
drivers/usb/serial/console.c
drivers/usb/serial/cp2101.c
drivers/usb/serial/cyberjack.c
drivers/usb/serial/cypress_m8.c
drivers/usb/serial/digi_acceleport.c
drivers/usb/serial/empeg.c
drivers/usb/serial/ezusb.c
drivers/usb/serial/ftdi_sio.c
drivers/usb/serial/garmin_gps.c
drivers/usb/serial/generic.c
drivers/usb/serial/hp4x.c
drivers/usb/serial/io_edgeport.c
drivers/usb/serial/io_ti.c
drivers/usb/serial/ipaq.c
drivers/usb/serial/ir-usb.c
drivers/usb/serial/keyspan.c
drivers/usb/serial/keyspan_pda.c
drivers/usb/serial/kl5kusb105.c
drivers/usb/serial/kobil_sct.c
drivers/usb/serial/mct_u232.c
drivers/usb/serial/omninet.c
drivers/usb/serial/option.c
drivers/usb/serial/pl2303.c
drivers/usb/serial/safe_serial.c
drivers/usb/serial/ti_usb_3410_5052.c
drivers/usb/serial/usb-serial.c
drivers/usb/serial/usb-serial.h
drivers/usb/serial/visor.c
drivers/usb/serial/whiteheat.c
drivers/usb/storage/debug.h
drivers/usb/storage/dpcm.c
drivers/usb/storage/freecom.c
drivers/usb/storage/initializers.h
drivers/usb/storage/onetouch.c
drivers/usb/storage/transport.c
drivers/usb/storage/unusual_devs.h
drivers/usb/storage/usb.c
drivers/usb/usb-skeleton.c
drivers/video/Kconfig
drivers/video/Makefile
drivers/video/S3triofb.c
drivers/video/acornfb.c
drivers/video/amifb.c
drivers/video/arcfb.c
drivers/video/asiliantfb.c
drivers/video/aty/aty128fb.c
drivers/video/aty/atyfb.h
drivers/video/aty/atyfb_base.c
drivers/video/aty/radeon_base.c
drivers/video/aty/radeon_i2c.c
drivers/video/aty/radeonfb.h
drivers/video/au1100fb.c
drivers/video/au1200fb.c
drivers/video/backlight/locomolcd.c
drivers/video/cfbcopyarea.c
drivers/video/cfbfillrect.c
drivers/video/cfbimgblt.c
drivers/video/chipsfb.c
drivers/video/cirrusfb.c
drivers/video/console/bitblit.c
drivers/video/console/dummycon.c
drivers/video/console/fbcon.c
drivers/video/console/fbcon.h
drivers/video/console/fbcon_ccw.c
drivers/video/console/fbcon_cw.c
drivers/video/console/fbcon_rotate.c
drivers/video/console/fbcon_ud.c
drivers/video/console/font_acorn_8x8.c
drivers/video/console/fonts.c
drivers/video/console/promcon.c
drivers/video/console/sticore.c
drivers/video/console/tileblit.c
drivers/video/console/vgacon.c
drivers/video/controlfb.c
drivers/video/cyber2000fb.c
drivers/video/cyber2000fb.h
drivers/video/cyblafb.c
drivers/video/fbmem.c
drivers/video/gbefb.c
drivers/video/hitfb.c
drivers/video/i810/i810-i2c.c
drivers/video/i810/i810_main.c
drivers/video/imacfb.c
drivers/video/imsttfb.c
drivers/video/imxfb.c
drivers/video/intelfb/intelfbdrv.c
drivers/video/intelfb/intelfbhw.c
drivers/video/kyro/fbdev.c
drivers/video/logo/logo.c
drivers/video/macmodes.c
drivers/video/matrox/matroxfb_DAC1064.c
drivers/video/matrox/matroxfb_DAC1064.h
drivers/video/matrox/matroxfb_Ti3026.c
drivers/video/matrox/matroxfb_Ti3026.h
drivers/video/matrox/matroxfb_base.c
drivers/video/matrox/matroxfb_base.h
drivers/video/matrox/matroxfb_misc.c
drivers/video/neofb.c
drivers/video/nvidia/nv_i2c.c
drivers/video/nvidia/nv_of.c
drivers/video/nvidia/nvidia.c
drivers/video/offb.c
drivers/video/platinumfb.c
drivers/video/pm2fb.c
drivers/video/pm3fb.c
drivers/video/pnx4008/Makefile [new file with mode: 0644]
drivers/video/pnx4008/dum.h [new file with mode: 0644]
drivers/video/pnx4008/fbcommon.h [new file with mode: 0644]
drivers/video/pnx4008/pnxrgbfb.c [new file with mode: 0644]
drivers/video/pnx4008/sdum.c [new file with mode: 0644]
drivers/video/pnx4008/sdum.h [new file with mode: 0644]
drivers/video/pvr2fb.c
drivers/video/pxafb.c
drivers/video/riva/fbdev.c
drivers/video/riva/rivafb-i2c.c
drivers/video/riva/rivafb.h
drivers/video/s1d13xxxfb.c
drivers/video/s3c2410fb.c
drivers/video/sa1100fb.c
drivers/video/savage/savagefb-i2c.c
drivers/video/savage/savagefb_driver.c
drivers/video/sgivwfb.c
drivers/video/sis/init.h
drivers/video/sis/init301.c
drivers/video/sis/init301.h
drivers/video/sis/initextlfb.c
drivers/video/sis/osdef.h
drivers/video/sis/sis.h
drivers/video/sis/sis_accel.c
drivers/video/sis/sis_main.c
drivers/video/sstfb.c
drivers/video/stifb.c
drivers/video/sun3fb.c
drivers/video/tdfxfb.c
drivers/video/tridentfb.c
drivers/video/valkyriefb.c
drivers/video/vgastate.c
drivers/zorro/names.c
fs/9p/conv.c
fs/9p/error.c
fs/9p/fcall.c
fs/9p/fcprint.c
fs/9p/fid.c
fs/9p/mux.c
fs/9p/trans_fd.c
fs/9p/v9fs.c
fs/9p/vfs_addr.c
fs/9p/vfs_file.c
fs/9p/vfs_super.c
fs/adfs/dir.c
fs/befs/linuxvfs.c
fs/binfmt_elf.c
fs/binfmt_flat.c
fs/binfmt_som.c
fs/block_dev.c
fs/buffer.c
fs/char_dev.c
fs/cifs/asn1.c
fs/cifs/file.c
fs/coda/sysctl.c
fs/compat_ioctl.c
fs/dcache.c
fs/dcookies.c
fs/debugfs/file.c
fs/debugfs/inode.c
fs/direct-io.c
fs/eventpoll.c
fs/exec.c
fs/ext2/balloc.c
fs/ext2/ialloc.c
fs/ext2/super.c
fs/ext2/xattr.h
fs/ext3/balloc.c
fs/ext3/resize.c
fs/ext3/super.c
fs/ext3/xattr.h
fs/file_table.c
fs/fs-writeback.c
fs/hfs/super.c
fs/hfsplus/super.c
fs/inode.c
fs/ioctl.c
fs/ioprio.c
fs/isofs/compress.c
fs/isofs/dir.c
fs/isofs/inode.c
fs/jffs/intrep.c
fs/jffs/jffs_fm.h
fs/jffs2/acl.c
fs/jffs2/acl.h
fs/jffs2/compr_zlib.c
fs/jffs2/debug.h
fs/jffs2/fs.c
fs/jffs2/malloc.c
fs/jffs2/nodelist.h
fs/jffs2/readinode.c
fs/jffs2/scan.c
fs/jffs2/super.c
fs/jffs2/xattr.c
fs/jfs/jfs_txnmgr.c
fs/jfs/super.c
fs/lockd/clntproc.c
fs/lockd/svc.c
fs/lockd/svclock.c
fs/lockd/svcproc.c
fs/lockd/svcsubs.c
fs/lockd/xdr.c
fs/namei.c
fs/namespace.c
fs/ncpfs/dir.c
fs/ncpfs/inode.c
fs/ncpfs/ioctl.c
fs/ncpfs/mmap.c
fs/ncpfs/ncplib_kernel.c
fs/ncpfs/ncplib_kernel.h
fs/ncpfs/ncpsign_kernel.c
fs/ncpfs/sock.c
fs/ncpfs/symlink.c
fs/nfs/callback.c
fs/nfs/callback_proc.c
fs/nfs/callback_xdr.c
fs/nfs/delegation.c
fs/nfs/direct.c
fs/nfs/inode.c
fs/nfs/internal.h
fs/nfs/nfs4state.c
fs/nfs/pagelist.c
fs/nfs/read.c
fs/nfs/sysctl.c
fs/nfs/write.c
fs/nfsctl.c
fs/nfsd/export.c
fs/nfsd/nfs4callback.c
fs/nfsd/nfs4idmap.c
fs/nfsd/nfs4state.c
fs/nfsd/nfsctl.c
fs/nfsd/nfsfh.c
fs/nfsd/nfssvc.c
fs/nfsd/vfs.c
fs/nls/nls_base.c
fs/ntfs/inode.c
fs/ntfs/super.c
fs/ntfs/sysctl.h
fs/partitions/acorn.c
fs/partitions/efi.c
fs/partitions/efi.h
fs/partitions/ibm.c
fs/partitions/mac.c
fs/partitions/msdos.c
fs/proc/array.c
fs/proc/base.c
fs/proc/kcore.c
fs/proc/proc_misc.c
fs/proc/root.c
fs/proc/task_nommu.c
fs/proc/vmcore.c
fs/qnx4/bitmap.c
fs/qnx4/dir.c
fs/qnx4/fsync.c
fs/qnx4/inode.c
fs/qnx4/namei.c
fs/qnx4/truncate.c
fs/reiserfs/bitmap.c
fs/reiserfs/dir.c
fs/reiserfs/do_balan.c
fs/reiserfs/fix_node.c
fs/reiserfs/ibalance.c
fs/reiserfs/inode.c
fs/reiserfs/journal.c
fs/reiserfs/lbalance.c
fs/reiserfs/namei.c
fs/reiserfs/objectid.c
fs/reiserfs/prints.c
fs/reiserfs/procfs.c
fs/reiserfs/stree.c
fs/reiserfs/super.c
fs/reiserfs/tail_conversion.c
fs/smbfs/inode.c
fs/smbfs/smbiod.c
fs/stat.c
fs/super.c
fs/udf/super.c
fs/udf/udfdecl.h
fs/ufs/balloc.c
fs/ufs/file.c
fs/ufs/inode.c
fs/ufs/super.c
fs/ufs/truncate.c
fs/ufs/util.c
fs/ufs/util.h
fs/xfs/linux-2.6/xfs_buf.h
fs/xfs/linux-2.6/xfs_ioctl32.c
fs/xfs/linux-2.6/xfs_linux.h
include/Kbuild [new file with mode: 0644]
include/acpi/acconfig.h
include/acpi/acdispat.h
include/acpi/acglobal.h
include/acpi/acinterp.h
include/acpi/aclocal.h
include/acpi/acmacros.h
include/acpi/acobject.h
include/acpi/acpi_bus.h
include/acpi/acpi_drivers.h
include/acpi/acpiosxf.h
include/acpi/actypes.h
include/acpi/platform/aclinux.h
include/acpi/processor.h
include/asm-alpha/Kbuild [new file with mode: 0644]
include/asm-alpha/floppy.h
include/asm-alpha/rwsem.h
include/asm-alpha/signal.h
include/asm-arm/Kbuild [new file with mode: 0644]
include/asm-arm/arch-at91rm9200/board.h
include/asm-arm/arch-ixp4xx/io.h
include/asm-arm/arch-omap/board-fsample.h [new file with mode: 0644]
include/asm-arm/arch-omap/board.h
include/asm-arm/arch-omap/dma.h
include/asm-arm/arch-omap/dmtimer.h
include/asm-arm/arch-omap/gpmc.h [new file with mode: 0644]
include/asm-arm/arch-omap/hardware.h
include/asm-arm/arch-omap/irqs.h
include/asm-arm/arch-omap/mux.h
include/asm-arm/arch-omap/pm.h
include/asm-arm/arch-pxa/pxa-regs.h
include/asm-arm/arch-pxa/trizeps4.h [new file with mode: 0644]
include/asm-arm/bug.h
include/asm-arm/dyntick.h [new file with mode: 0644]
include/asm-arm/floppy.h
include/asm-arm/hw_irq.h [new file with mode: 0644]
include/asm-arm/irq.h
include/asm-arm/mach/irq.h
include/asm-arm/mach/time.h
include/asm-arm/memory.h
include/asm-arm/mmu.h
include/asm-arm/mmu_context.h
include/asm-arm/pgtable-hwdef.h
include/asm-arm/procinfo.h
include/asm-arm/signal.h
include/asm-arm/thread_info.h
include/asm-arm26/Kbuild [new file with mode: 0644]
include/asm-arm26/floppy.h
include/asm-arm26/signal.h
include/asm-cris/Kbuild [new file with mode: 0644]
include/asm-cris/arch-v10/irq.h
include/asm-cris/arch-v32/arbiter.h
include/asm-cris/arch-v32/irq.h
include/asm-cris/signal.h
include/asm-frv/Kbuild [new file with mode: 0644]
include/asm-frv/irq-routing.h
include/asm-frv/signal.h
include/asm-generic/Kbuild [new file with mode: 0644]
include/asm-generic/Kbuild.asm [new file with mode: 0644]
include/asm-generic/audit_change_attr.h [new file with mode: 0644]
include/asm-generic/audit_dir_write.h [new file with mode: 0644]
include/asm-generic/mutex-null.h
include/asm-generic/percpu.h
include/asm-generic/sections.h
include/asm-h8300/Kbuild [new file with mode: 0644]
include/asm-h8300/signal.h
include/asm-i386/Kbuild [new file with mode: 0644]
include/asm-i386/alternative.h
include/asm-i386/floppy.h
include/asm-i386/irqflags.h [new file with mode: 0644]
include/asm-i386/rwsem.h
include/asm-i386/signal.h
include/asm-i386/spinlock.h
include/asm-i386/system.h
include/asm-ia64/Kbuild [new file with mode: 0644]
include/asm-ia64/percpu.h
include/asm-ia64/rwsem.h
include/asm-ia64/signal.h
include/asm-ia64/sn/tioca_provider.h
include/asm-ia64/thread_info.h
include/asm-m32r/Kbuild [new file with mode: 0644]
include/asm-m32r/signal.h
include/asm-m32r/system.h
include/asm-m68k/Kbuild [new file with mode: 0644]
include/asm-m68k/floppy.h
include/asm-m68k/irq.h
include/asm-m68k/signal.h
include/asm-m68k/sun3xflop.h
include/asm-m68knommu/Kbuild [new file with mode: 0644]
include/asm-m68knommu/irq.h
include/asm-m68knommu/signal.h
include/asm-mips/Kbuild [new file with mode: 0644]
include/asm-mips/mach-generic/floppy.h
include/asm-mips/mach-jazz/floppy.h
include/asm-mips/signal.h
include/asm-parisc/Kbuild [new file with mode: 0644]
include/asm-parisc/floppy.h
include/asm-parisc/signal.h
include/asm-powerpc/Kbuild [new file with mode: 0644]
include/asm-powerpc/floppy.h
include/asm-powerpc/i8259.h
include/asm-powerpc/irq.h
include/asm-powerpc/irqflags.h [new file with mode: 0644]
include/asm-powerpc/machdep.h
include/asm-powerpc/mpic.h
include/asm-powerpc/of_device.h
include/asm-powerpc/percpu.h
include/asm-powerpc/pmac_pfunc.h
include/asm-powerpc/prom.h
include/asm-powerpc/rwsem.h
include/asm-powerpc/signal.h
include/asm-powerpc/spu.h
include/asm-ppc/floppy.h
include/asm-ppc/page.h
include/asm-s390/Kbuild [new file with mode: 0644]
include/asm-s390/irqflags.h [new file with mode: 0644]
include/asm-s390/percpu.h
include/asm-s390/pgtable.h
include/asm-s390/rwsem.h
include/asm-s390/semaphore.h
include/asm-s390/signal.h
include/asm-s390/system.h
include/asm-sh/Kbuild [new file with mode: 0644]
include/asm-sh/floppy.h
include/asm-sh/mpc1211/keyboard.h
include/asm-sh/rwsem.h
include/asm-sh/signal.h
include/asm-sh/system.h
include/asm-sh64/Kbuild [new file with mode: 0644]
include/asm-sh64/keyboard.h
include/asm-sh64/signal.h
include/asm-sparc/Kbuild [new file with mode: 0644]
include/asm-sparc/floppy.h
include/asm-sparc/signal.h
include/asm-sparc64/Kbuild [new file with mode: 0644]
include/asm-sparc64/floppy.h
include/asm-sparc64/percpu.h
include/asm-sparc64/signal.h
include/asm-sparc64/vdev.h [deleted file]
include/asm-um/Kbuild [new file with mode: 0644]
include/asm-um/io.h
include/asm-um/kmap_types.h
include/asm-v850/Kbuild [new file with mode: 0644]
include/asm-v850/signal.h
include/asm-x86_64/Kbuild [new file with mode: 0644]
include/asm-x86_64/alternative.h
include/asm-x86_64/floppy.h
include/asm-x86_64/irqflags.h [new file with mode: 0644]
include/asm-x86_64/kdebug.h
include/asm-x86_64/percpu.h
include/asm-x86_64/signal.h
include/asm-x86_64/system.h
include/asm-xtensa/Kbuild [new file with mode: 0644]
include/asm-xtensa/rwsem.h
include/asm-xtensa/signal.h
include/linux/Kbuild [new file with mode: 0644]
include/linux/audit.h
include/linux/byteorder/Kbuild [new file with mode: 0644]
include/linux/completion.h
include/linux/cpu.h
include/linux/cpufreq.h
include/linux/dcache.h
include/linux/debug_locks.h [new file with mode: 0644]
include/linux/dmaengine.h
include/linux/dqblk_xfs.h
include/linux/dvb/Kbuild [new file with mode: 0644]
include/linux/err.h
include/linux/fb.h
include/linux/fs.h
include/linux/hardirq.h
include/linux/hdlc/Kbuild [new file with mode: 0644]
include/linux/hrtimer.h
include/linux/ide.h
include/linux/idr.h
include/linux/init_task.h
include/linux/interrupt.h
include/linux/ioport.h
include/linux/irq.h
include/linux/irqflags.h [new file with mode: 0644]
include/linux/isdn/Kbuild [new file with mode: 0644]
include/linux/kallsyms.h
include/linux/kobject.h
include/linux/lockdep.h [new file with mode: 0644]
include/linux/mm.h
include/linux/mmzone.h
include/linux/module.h
include/linux/mtd/bbm.h
include/linux/mtd/mtd.h
include/linux/mtd/nand.h
include/linux/mtd/onenand.h
include/linux/mutex-debug.h
include/linux/mutex.h
include/linux/netdevice.h
include/linux/netfilter/Kbuild [new file with mode: 0644]
include/linux/netfilter_arp/Kbuild [new file with mode: 0644]
include/linux/netfilter_bridge/Kbuild [new file with mode: 0644]
include/linux/netfilter_ipv4/Kbuild [new file with mode: 0644]
include/linux/netfilter_ipv6/Kbuild [new file with mode: 0644]
include/linux/nfs_fs.h
include/linux/nfsd/Kbuild [new file with mode: 0644]
include/linux/notifier.h
include/linux/page-flags.h
include/linux/pagemap.h
include/linux/pci_ids.h
include/linux/poison.h
include/linux/raid/Kbuild [new file with mode: 0644]
include/linux/rcupdate.h
include/linux/rtc.h
include/linux/rtmutex.h
include/linux/rwsem-spinlock.h
include/linux/rwsem.h
include/linux/sched.h
include/linux/security.h
include/linux/seqlock.h
include/linux/serial_core.h
include/linux/signal.h
include/linux/skbuff.h
include/linux/smp.h
include/linux/spinlock.h
include/linux/spinlock_api_smp.h
include/linux/spinlock_api_up.h
include/linux/spinlock_types.h
include/linux/spinlock_types_up.h
include/linux/spinlock_up.h
include/linux/stacktrace.h [new file with mode: 0644]
include/linux/sunrpc/Kbuild [new file with mode: 0644]
include/linux/sunrpc/svc.h
include/linux/swap.h
include/linux/sysctl.h
include/linux/tc_act/Kbuild [new file with mode: 0644]
include/linux/tc_ematch/Kbuild [new file with mode: 0644]
include/linux/udp.h
include/linux/ufs_fs.h
include/linux/vermagic.h
include/linux/vmstat.h [new file with mode: 0644]
include/linux/wait.h
include/media/tuner-types.h
include/mtd/Kbuild [new file with mode: 0644]
include/mtd/mtd-abi.h
include/net/af_unix.h
include/net/ax25.h
include/net/bluetooth/bluetooth.h
include/net/bluetooth/hci.h
include/net/bluetooth/hci_core.h
include/net/ip6_route.h
include/net/irda/irda_device.h
include/net/protocol.h
include/net/sock.h
include/net/tcp.h
include/net/tcp_ecn.h
include/rdma/Kbuild [new file with mode: 0644]
include/scsi/Kbuild [new file with mode: 0644]
include/scsi/iscsi_if.h
include/scsi/libiscsi.h
include/scsi/scsi_cmnd.h
include/scsi/scsi_host.h
include/scsi/scsi_transport_iscsi.h
include/scsi/scsi_transport_sas.h
include/sound/Kbuild [new file with mode: 0644]
include/sound/initval.h
include/video/Kbuild [new file with mode: 0644]
init/Kconfig
init/main.c
init/version.c
ipc/compat.c
ipc/msg.c
ipc/sem.c
ipc/shm.c
ipc/util.c
kernel/Makefile
kernel/acct.c
kernel/audit.h
kernel/auditfilter.c
kernel/auditsc.c
kernel/capability.c
kernel/configs.c
kernel/cpuset.c
kernel/exec_domain.c
kernel/exit.c
kernel/fork.c
kernel/futex.c
kernel/hrtimer.c
kernel/irq/chip.c
kernel/irq/handle.c
kernel/irq/manage.c
kernel/irq/spurious.c
kernel/kmod.c
kernel/ksysfs.c
kernel/lockdep.c [new file with mode: 0644]
kernel/lockdep_internals.h [new file with mode: 0644]
kernel/lockdep_proc.c [new file with mode: 0644]
kernel/module.c
kernel/mutex-debug.c
kernel/mutex-debug.h
kernel/mutex.c
kernel/mutex.h
kernel/panic.c
kernel/params.c
kernel/pid.c
kernel/power/Kconfig
kernel/printk.c
kernel/profile.c
kernel/ptrace.c
kernel/rcupdate.c
kernel/resource.c
kernel/rtmutex-debug.c
kernel/rtmutex-debug.h
kernel/rtmutex-tester.c
kernel/rtmutex.c
kernel/rtmutex.h
kernel/rwsem.c [new file with mode: 0644]
kernel/sched.c
kernel/signal.c
kernel/softirq.c
kernel/spinlock.c
kernel/stacktrace.c [new file with mode: 0644]
kernel/stop_machine.c
kernel/sys.c
kernel/sysctl.c
kernel/timer.c
kernel/wait.c
kernel/workqueue.c
lib/Kconfig.debug
lib/Makefile
lib/bust_spinlocks.c
lib/debug_locks.c [new file with mode: 0644]
lib/extable.c
lib/kernel_lock.c
lib/kobject_uevent.c
lib/locking-selftest-hardirq.h [new file with mode: 0644]
lib/locking-selftest-mutex.h [new file with mode: 0644]
lib/locking-selftest-rlock-hardirq.h [new file with mode: 0644]
lib/locking-selftest-rlock-softirq.h [new file with mode: 0644]
lib/locking-selftest-rlock.h [new file with mode: 0644]
lib/locking-selftest-rsem.h [new file with mode: 0644]
lib/locking-selftest-softirq.h [new file with mode: 0644]
lib/locking-selftest-spin-hardirq.h [new file with mode: 0644]
lib/locking-selftest-spin-softirq.h [new file with mode: 0644]
lib/locking-selftest-spin.h [new file with mode: 0644]
lib/locking-selftest-wlock-hardirq.h [new file with mode: 0644]
lib/locking-selftest-wlock-softirq.h [new file with mode: 0644]
lib/locking-selftest-wlock.h [new file with mode: 0644]
lib/locking-selftest-wsem.h [new file with mode: 0644]
lib/locking-selftest.c [new file with mode: 0644]
lib/rwsem-spinlock.c
lib/rwsem.c
lib/semaphore-sleepers.c
lib/spinlock_debug.c
lib/textsearch.c
lib/ts_bm.c
lib/ts_fsm.c
lib/ts_kmp.c
mm/Makefile
mm/filemap.c
mm/highmem.c
mm/memory.c
mm/memory_hotplug.c
mm/mempolicy.c
mm/mmap.c
mm/mmzone.c
mm/mremap.c
mm/nommu.c
mm/oom_kill.c
mm/page-writeback.c
mm/page_alloc.c
mm/page_io.c
mm/rmap.c
mm/shmem.c
mm/slab.c
mm/slob.c
mm/sparse.c
mm/swap.c
mm/swap_state.c
mm/swapfile.c
mm/vmalloc.c
mm/vmscan.c
mm/vmstat.c [new file with mode: 0644]
net/802/fc.c
net/802/fddi.c
net/802/sysctl_net_802.c
net/802/tr.c
net/8021q/vlan.c
net/8021q/vlanproc.c
net/appletalk/aarp.c
net/appletalk/atalk_proc.c
net/appletalk/ddp.c
net/appletalk/sysctl_net_atalk.c
net/atm/br2684.c
net/atm/clip.c
net/atm/common.c
net/atm/ioctl.c
net/atm/lec.c
net/atm/lec.h
net/atm/mpc.c
net/atm/mpoa_proc.c
net/atm/pppoatm.c
net/atm/proc.c
net/atm/pvc.c
net/atm/resources.c
net/atm/resources.h
net/ax25/af_ax25.c
net/ax25/ax25_dev.c
net/ax25/ax25_iface.c
net/ax25/ax25_ip.c
net/ax25/ax25_out.c
net/ax25/ax25_route.c
net/ax25/ax25_timer.c
net/ax25/sysctl_net_ax25.c
net/bluetooth/af_bluetooth.c
net/bluetooth/bnep/core.c
net/bluetooth/bnep/netdev.c
net/bluetooth/bnep/sock.c
net/bluetooth/cmtp/capi.c
net/bluetooth/cmtp/core.c
net/bluetooth/cmtp/sock.c
net/bluetooth/hci_conn.c
net/bluetooth/hci_core.c
net/bluetooth/hci_event.c
net/bluetooth/hci_sock.c
net/bluetooth/hci_sysfs.c
net/bluetooth/hidp/core.c
net/bluetooth/hidp/sock.c
net/bluetooth/l2cap.c
net/bluetooth/lib.c
net/bluetooth/rfcomm/core.c
net/bluetooth/rfcomm/sock.c
net/bluetooth/rfcomm/tty.c
net/bluetooth/sco.c
net/bridge/br.c
net/bridge/br_netlink.c
net/bridge/netfilter/ebt_ulog.c
net/core/dev.c
net/core/link_watch.c
net/core/neighbour.c
net/core/net-sysfs.c
net/core/rtnetlink.c
net/core/skbuff.c
net/core/sock.c
net/core/sysctl_net_core.c
net/dccp/ackvec.h
net/dccp/ccids/ccid2.c
net/dccp/ccids/ccid3.c
net/dccp/ccids/ccid3.h
net/dccp/ccids/lib/loss_interval.c
net/dccp/ccids/lib/loss_interval.h
net/dccp/ccids/lib/packet_history.c
net/dccp/ccids/lib/packet_history.h
net/dccp/ccids/lib/tfrc_equation.c
net/dccp/dccp.h
net/dccp/diag.c
net/dccp/feat.c
net/dccp/input.c
net/dccp/ipv4.c
net/dccp/ipv6.c
net/dccp/ipv6.h
net/dccp/minisocks.c
net/dccp/options.c
net/dccp/output.c
net/dccp/proto.c
net/dccp/sysctl.c
net/dccp/timer.c
net/decnet/af_decnet.c
net/decnet/dn_dev.c
net/decnet/dn_fib.c
net/decnet/dn_neigh.c
net/decnet/dn_nsp_in.c
net/decnet/dn_route.c
net/decnet/dn_rules.c
net/decnet/dn_table.c
net/decnet/sysctl_net_decnet.c
net/econet/af_econet.c
net/ethernet/eth.c
net/ieee80211/ieee80211_crypt_ccmp.c
net/ieee80211/ieee80211_crypt_tkip.c
net/ieee80211/ieee80211_crypt_wep.c
net/ieee80211/ieee80211_geo.c
net/ieee80211/ieee80211_module.c
net/ieee80211/ieee80211_rx.c
net/ieee80211/ieee80211_tx.c
net/ipv4/af_inet.c
net/ipv4/ah4.c
net/ipv4/arp.c
net/ipv4/datagram.c
net/ipv4/devinet.c
net/ipv4/esp4.c
net/ipv4/fib_frontend.c
net/ipv4/fib_hash.c
net/ipv4/fib_rules.c
net/ipv4/fib_semantics.c
net/ipv4/fib_trie.c
net/ipv4/icmp.c
net/ipv4/igmp.c
net/ipv4/inet_connection_sock.c
net/ipv4/inet_diag.c
net/ipv4/inet_hashtables.c
net/ipv4/inet_timewait_sock.c
net/ipv4/ip_forward.c
net/ipv4/ip_fragment.c
net/ipv4/ip_gre.c
net/ipv4/ip_input.c
net/ipv4/ip_output.c
net/ipv4/ip_sockglue.c
net/ipv4/ipcomp.c
net/ipv4/ipip.c
net/ipv4/ipmr.c
net/ipv4/ipvs/ip_vs_est.c
net/ipv4/multipath_drr.c
net/ipv4/multipath_random.c
net/ipv4/multipath_rr.c
net/ipv4/multipath_wrandom.c
net/ipv4/netfilter/arp_tables.c
net/ipv4/netfilter/ip_conntrack_core.c
net/ipv4/netfilter/ip_conntrack_ftp.c
net/ipv4/netfilter/ip_conntrack_helper_h323.c
net/ipv4/netfilter/ip_conntrack_helper_pptp.c
net/ipv4/netfilter/ip_conntrack_irc.c
net/ipv4/netfilter/ip_conntrack_proto_gre.c
net/ipv4/netfilter/ip_conntrack_proto_sctp.c
net/ipv4/netfilter/ip_conntrack_proto_tcp.c
net/ipv4/netfilter/ip_conntrack_standalone.c
net/ipv4/netfilter/ip_nat_helper.c
net/ipv4/netfilter/ip_nat_helper_pptp.c
net/ipv4/netfilter/ip_nat_proto_gre.c
net/ipv4/netfilter/ip_nat_snmp_basic.c
net/ipv4/netfilter/ip_nat_standalone.c
net/ipv4/netfilter/ip_tables.c
net/ipv4/netfilter/ipt_CLUSTERIP.c
net/ipv4/netfilter/ipt_MASQUERADE.c
net/ipv4/netfilter/ipt_NETMAP.c
net/ipv4/netfilter/ipt_REJECT.c
net/ipv4/netfilter/ipt_ULOG.c
net/ipv4/netfilter/iptable_mangle.c
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
net/ipv4/protocol.c
net/ipv4/route.c
net/ipv4/sysctl_net_ipv4.c
net/ipv4/tcp.c
net/ipv4/tcp_bic.c
net/ipv4/tcp_cong.c
net/ipv4/tcp_cubic.c
net/ipv4/tcp_diag.c
net/ipv4/tcp_highspeed.c
net/ipv4/tcp_htcp.c
net/ipv4/tcp_hybla.c
net/ipv4/tcp_input.c
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_minisocks.c
net/ipv4/tcp_output.c
net/ipv4/tcp_scalable.c
net/ipv4/tcp_vegas.c
net/ipv4/tcp_westwood.c
net/ipv4/udp.c
net/ipv4/xfrm4_policy.c
net/ipv6/addrconf.c
net/ipv6/af_inet6.c
net/ipv6/ah6.c
net/ipv6/anycast.c
net/ipv6/esp6.c
net/ipv6/exthdrs.c
net/ipv6/inet6_connection_sock.c
net/ipv6/inet6_hashtables.c
net/ipv6/ip6_fib.c
net/ipv6/ip6_flowlabel.c
net/ipv6/ip6_input.c
net/ipv6/ip6_output.c
net/ipv6/ip6_tunnel.c
net/ipv6/ipcomp6.c
net/ipv6/ipv6_sockglue.c
net/ipv6/ipv6_syms.c
net/ipv6/mcast.c
net/ipv6/ndisc.c
net/ipv6/netfilter/ip6_tables.c
net/ipv6/netfilter/ip6t_REJECT.c
net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
net/ipv6/netfilter/nf_conntrack_reasm.c
net/ipv6/proc.c
net/ipv6/reassembly.c
net/ipv6/route.c
net/ipv6/sit.c
net/ipv6/sysctl_net_ipv6.c
net/ipv6/tcp_ipv6.c
net/ipv6/udp.c
net/ipv6/xfrm6_policy.c
net/ipv6/xfrm6_tunnel.c
net/ipx/af_ipx.c
net/ipx/ipx_proc.c
net/ipx/ipx_route.c
net/ipx/sysctl_net_ipx.c
net/irda/af_irda.c
net/irda/ircomm/ircomm_core.c
net/irda/ircomm/ircomm_tty.c
net/irda/irda_device.c
net/irda/iriap.c
net/irda/irlan/irlan_common.c
net/irda/irlan/irlan_eth.c
net/irda/irlap.c
net/irda/irlap_event.c
net/irda/irlmp.c
net/irda/irlmp_event.c
net/irda/irlmp_frame.c
net/irda/irmod.c
net/irda/irnet/irnet.h
net/irda/irsysctl.c
net/irda/irttp.c
net/irda/qos.c
net/irda/timer.c
net/key/af_key.c
net/llc/af_llc.c
net/llc/llc_if.c
net/llc/llc_proc.c
net/llc/llc_station.c
net/llc/sysctl_net_llc.c
net/netfilter/core.c
net/netfilter/nf_conntrack_core.c
net/netfilter/nf_conntrack_ftp.c
net/netfilter/nf_conntrack_l3proto_generic.c
net/netfilter/nf_conntrack_proto_sctp.c
net/netfilter/nf_conntrack_proto_tcp.c
net/netfilter/nf_conntrack_standalone.c
net/netfilter/nf_internals.h
net/netfilter/nf_log.c
net/netfilter/nf_queue.c
net/netfilter/nf_sockopt.c
net/netfilter/nfnetlink.c
net/netfilter/x_tables.c
net/netfilter/xt_policy.c
net/netlink/af_netlink.c
net/netlink/attr.c
net/netlink/genetlink.c
net/netrom/af_netrom.c
net/netrom/nr_dev.c
net/packet/af_packet.c
net/rose/af_rose.c
net/rose/rose_dev.c
net/rxrpc/rxrpc_syms.c
net/rxrpc/sysctl.c
net/sched/Kconfig
net/sched/act_api.c
net/sched/act_gact.c
net/sched/act_ipt.c
net/sched/act_mirred.c
net/sched/act_pedit.c
net/sched/act_police.c
net/sched/act_simple.c
net/sched/cls_api.c
net/sched/cls_basic.c
net/sched/cls_fw.c
net/sched/cls_route.c
net/sched/cls_rsvp.h
net/sched/cls_tcindex.c
net/sched/cls_u32.c
net/sched/em_cmp.c
net/sched/em_meta.c
net/sched/em_nbyte.c
net/sched/em_text.c
net/sched/em_u32.c
net/sched/ematch.c
net/sched/sch_api.c
net/sched/sch_atm.c
net/sched/sch_blackhole.c
net/sched/sch_cbq.c
net/sched/sch_dsmark.c
net/sched/sch_fifo.c
net/sched/sch_generic.c
net/sched/sch_gred.c
net/sched/sch_hfsc.c
net/sched/sch_htb.c
net/sched/sch_ingress.c
net/sched/sch_netem.c
net/sched/sch_prio.c
net/sched/sch_red.c
net/sched/sch_sfq.c
net/sched/sch_tbf.c
net/sctp/socket.c
net/socket.c
net/sunrpc/auth_gss/gss_mech_switch.c
net/sunrpc/auth_gss/svcauth_gss.c
net/sunrpc/pmap_clnt.c
net/sunrpc/rpc_pipe.c
net/sunrpc/sunrpc_syms.c
net/sunrpc/svc.c
net/sunrpc/sysctl.c
net/sysctl_net.c
net/tipc/core.h
net/tipc/link.c
net/unix/af_unix.c
net/wanrouter/af_wanpipe.c
net/wanrouter/wanmain.c
net/wanrouter/wanproc.c
net/x25/af_x25.c
net/x25/x25_dev.c
net/x25/x25_proc.c
net/x25/x25_route.c
net/xfrm/xfrm_algo.c
net/xfrm/xfrm_policy.c
scripts/Kbuild.include
scripts/Makefile.build
scripts/Makefile.headersinst [new file with mode: 0644]
scripts/Makefile.host
scripts/Makefile.lib
scripts/Makefile.modpost
scripts/checkversion.pl
scripts/hdrcheck.sh [new file with mode: 0755]
scripts/kconfig/lxdialog/checklist.c
scripts/kernel-doc
scripts/mod/modpost.c
scripts/mod/modpost.h
security/capability.c
security/commoncap.c
security/dummy.c
security/inode.c
security/root_plug.c
security/seclvl.c
security/security.c
security/selinux/hooks.c
security/selinux/selinuxfs.c
security/selinux/ss/services.c
security/selinux/xfrm.c
sound/aoa/core/snd-aoa-gpio-feature.c
sound/aoa/soundbus/i2sbus/i2sbus-core.c
sound/arm/aaci.c
sound/arm/sa11xx-uda1341.c
sound/core/memalloc.c
sound/core/seq/seq_device.c
sound/core/seq/seq_ports.c
sound/core/sgbuf.c
sound/drivers/mpu401/mpu401.c
sound/drivers/mtpav.c
sound/drivers/serial-u16550.c
sound/isa/ad1816a/ad1816a.c
sound/isa/ad1816a/ad1816a_lib.c
sound/isa/ad1848/ad1848_lib.c
sound/isa/als100.c
sound/isa/azt2320.c
sound/isa/cs423x/cs4231.c
sound/isa/cs423x/cs4231_lib.c
sound/isa/cs423x/cs4236.c
sound/isa/dt019x.c
sound/isa/es1688/es1688.c
sound/isa/es1688/es1688_lib.c
sound/isa/es18xx.c
sound/isa/gus/gus_main.c
sound/isa/gus/gusextreme.c
sound/isa/gus/gusmax.c
sound/isa/gus/interwave.c
sound/isa/opl3sa2.c
sound/isa/opti9xx/miro.c
sound/isa/opti9xx/opti92x-ad1848.c
sound/isa/sb/sb_common.c
sound/isa/sgalaxy.c
sound/isa/sscape.c
sound/isa/wavefront/wavefront.c
sound/mips/au1x00.c
sound/oss/ad1816.c
sound/oss/ad1848.c
sound/oss/ad1889.c
sound/oss/aedsp16.c
sound/oss/ali5455.c
sound/oss/au1000.c
sound/oss/btaudio.c
sound/oss/cmpci.c
sound/oss/cs4232.c
sound/oss/cs4281/cs4281m.c
sound/oss/cs46xx.c
sound/oss/dmabuf.c
sound/oss/dmasound/dmasound.h
sound/oss/dmasound/dmasound_awacs.c
sound/oss/dmasound/dmasound_paula.c
sound/oss/emu10k1/main.c
sound/oss/es1370.c
sound/oss/es1371.c
sound/oss/esssolo1.c
sound/oss/forte.c
sound/oss/hal2.c
sound/oss/i810_audio.c
sound/oss/ite8172.c
sound/oss/kahlua.c
sound/oss/maestro.c
sound/oss/maestro3.c
sound/oss/msnd_classic.h
sound/oss/msnd_pinnacle.c
sound/oss/msnd_pinnacle.h
sound/oss/nec_vrc5477.c
sound/oss/nm256_audio.c
sound/oss/opl3sa2.c
sound/oss/pas2_card.c
sound/oss/pss.c
sound/oss/rme96xx.c
sound/oss/sb_card.c
sound/oss/sb_common.c
sound/oss/sh_dac_audio.c
sound/oss/sonicvibes.c
sound/oss/sound_config.h
sound/oss/soundcard.c
sound/oss/trident.c
sound/oss/via82cxxx_audio.c
sound/oss/vidc.c
sound/oss/waveartist.c
sound/oss/wavfront.c
sound/oss/wf_midi.c
sound/oss/ymfpci.c
sound/pci/ad1889.c
sound/pci/ali5451/ali5451.c
sound/pci/als300.c
sound/pci/atiixp.c
sound/pci/atiixp_modem.c
sound/pci/au88x0/au88x0.c
sound/pci/azt3328.c
sound/pci/bt87x.c
sound/pci/ca0106/ca0106_main.c
sound/pci/cmipci.c
sound/pci/cs4281.c
sound/pci/cs46xx/cs46xx_lib.c
sound/pci/cs46xx/dsp_spos_scb_lib.c
sound/pci/cs5535audio/cs5535audio.c
sound/pci/echoaudio/echoaudio.c
sound/pci/emu10k1/emu10k1_main.c
sound/pci/emu10k1/emu10k1x.c
sound/pci/ens1370.c
sound/pci/es1938.c
sound/pci/es1968.c
sound/pci/fm801.c
sound/pci/hda/hda_intel.c
sound/pci/ice1712/ice1712.c
sound/pci/ice1712/ice1724.c
sound/pci/intel8x0.c
sound/pci/intel8x0m.c
sound/pci/korg1212/korg1212.c
sound/pci/maestro3.c
sound/pci/mixart/mixart.c
sound/pci/nm256/nm256.c
sound/pci/pcxhr/pcxhr.c
sound/pci/riptide/riptide.c
sound/pci/rme32.c
sound/pci/rme96.c
sound/pci/rme9652/hdsp.c
sound/pci/rme9652/hdspm.c
sound/pci/rme9652/rme9652.c
sound/pci/sonicvibes.c
sound/pci/trident/trident_main.c
sound/pci/via82xx.c
sound/pci/via82xx_modem.c
sound/pci/vx222/vx222.c
sound/pci/ymfpci/ymfpci_main.c
sound/ppc/pmac.c
sound/ppc/tumbler.c
sound/sound_core.c
sound/sparc/amd7930.c
sound/sparc/cs4231.c
sound/sparc/dbri.c

index 6e463d0db266ba46a4c1c4fd759d4b93cbd3523b..a8c8cce506332a2037833d8cc8f7dc54c0791748 100644 (file)
                for most of the implementations. These functions can be replaced by the
                board driver if neccecary. Those functions are called via pointers in the
                NAND chip description structure. The board driver can set the functions which
-               should be replaced by board dependend functions before calling nand_scan().
+               should be replaced by board dependent functions before calling nand_scan().
                If the function pointer is NULL on entry to nand_scan() then the pointer
                is set to the default function which is suitable for the detected chip type.
                </para></listitem>
                [REPLACEABLE]</para><para>
                Replaceable members hold hardware related functions which can be 
                provided by the board driver. The board driver can set the functions which
-               should be replaced by board dependend functions before calling nand_scan().
+               should be replaced by board dependent functions before calling nand_scan().
                If the function pointer is NULL on entry to nand_scan() then the pointer
                is set to the default function which is suitable for the detected chip type.
                </para></listitem>
        <title>Basic board driver</title>
        <para>
                For most boards it will be sufficient to provide just the
-               basic functions and fill out some really board dependend
+               basic functions and fill out some really board dependent
                members in the nand chip description structure.
-               See drivers/mtd/nand/skeleton for reference.
        </para>
        <sect1>
                <title>Basic defines</title>
@@ -189,9 +188,9 @@ static unsigned long baseaddr;
        <sect1>
                <title>Partition defines</title>
                <para>
-                       If you want to divide your device into parititions, then
-                       enable the configuration switch CONFIG_MTD_PARITIONS and define
-                       a paritioning scheme suitable to your board.
+                       If you want to divide your device into partitions, then
+                       enable the configuration switch CONFIG_MTD_PARTITIONS and define
+                       a partitioning scheme suitable to your board.
                </para>
                <programlisting>
 #define NUM_PARTITIONS 2
@@ -1295,7 +1294,9 @@ in this page</entry>
      </para>
 !Idrivers/mtd/nand/nand_base.c
 !Idrivers/mtd/nand/nand_bbt.c
-!Idrivers/mtd/nand/nand_ecc.c
+<!-- No internal functions for kernel-doc:
+X!Idrivers/mtd/nand/nand_ecc.c
+-->
   </chapter>
 
   <chapter id="credits">
index fdff984a516188266df0845e3e3e1b181d9972e1..b629da33951d3945f619bf900862c163c43e849e 100644 (file)
@@ -976,7 +976,7 @@ static int camera_close(struct video_device *dev)
   <title>Interrupt Handling</title>
   <para>
         Our example handler is for an ISA bus device. If it was PCI you would be
-        able to share the interrupt and would have set SA_SHIRQ to indicate a 
+        able to share the interrupt and would have set IRQF_SHARED to indicate a
         shared IRQ. We pass the device pointer as the interrupt routine argument. We
         don't need to since we only support one card but doing this will make it
         easier to upgrade the driver for multiple devices in the future.
index bf1cf98d2a275b878d9e32378028b52d01ae8048..0256805b548f8c43906c07b4e05ab1f76ae1f972 100644 (file)
@@ -10,7 +10,7 @@ standard for controlling intelligent devices that monitor a system.
 It provides for dynamic discovery of sensors in the system and the
 ability to monitor the sensors and be informed when the sensor's
 values change or go outside certain boundaries.  It also has a
-standardized database for field-replacable units (FRUs) and a watchdog
+standardized database for field-replaceable units (FRUs) and a watchdog
 timer.
 
 To use this, you need an interface to an IPMI controller in your
@@ -64,7 +64,7 @@ situation, you need to read the section below named 'The SI Driver' or
 IPMI defines a standard watchdog timer.  You can enable this with the
 'IPMI Watchdog Timer' config option.  If you compile the driver into
 the kernel, then via a kernel command-line option you can have the
-watchdog timer start as soon as it intitializes.  It also have a lot
+watchdog timer start as soon as it initializes.  It also have a lot
 of other options, see the 'Watchdog' section below for more details.
 Note that you can also have the watchdog continue to run if it is
 closed (by default it is disabled on close).  Go into the 'Watchdog
index d4c6d3aa0c25e034493544d7ca734538f365b4c3..43edb4ecf27dbdd7138ea3c969f4c45cbcd720c7 100644 (file)
@@ -85,7 +85,7 @@ IXP4xx provides two methods of accessing PCI memory space:
 2) If > 64MB of memory space is required, the IXP4xx can be 
    configured to use indirect registers to access PCI This allows 
    for up to 128MB (0x48000000 to 0x4fffffff) of memory on the bus. 
-   The disadvantadge of this is that every PCI access requires 
+   The disadvantage of this is that every PCI access requires 
    three local register accesses plus a spinlock, but in some 
    cases the performance hit is acceptable. In addition, you cannot 
    mmap() PCI devices in this case due to the indirect nature
index 88820fe38dadc17bc76a355d386ac4472662f070..f2560e22f2c9765af3501cb4ece56105b167dc36 100644 (file)
@@ -2,7 +2,7 @@ NOTE:  This driver is obsolete.  Digi provides a 2.6 driver (dgdm) at
 http://www.digi.com for PCI cards.  They no longer maintain this driver,
 and have no 2.6 driver for ISA cards.
 
-This driver requires a number of user-space tools.  They can be aquired from
+This driver requires a number of user-space tools.  They can be acquired from
 http://www.digi.com, but only works with 2.4 kernels.
 
 
index 1cbbb8e28999fc0cc8d980700b2bc3e772790d5e..99f219a01e0e1f179021d370039ed46d1ba9404c 100644 (file)
@@ -257,3 +257,12 @@ Why:       Code does no longer build since at least 2.6.0,  apparently there is
 Who:   Ralf Baechle <ralf@linux-mips.org>
 
 ---------------------------
+
+What:  Interrupt only SA_* flags
+When:  Januar 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>
+
+---------------------------
diff --git a/Documentation/irqflags-tracing.txt b/Documentation/irqflags-tracing.txt
new file mode 100644 (file)
index 0000000..6a44487
--- /dev/null
@@ -0,0 +1,57 @@
+IRQ-flags state tracing
+
+started by Ingo Molnar <mingo@redhat.com>
+
+the "irq-flags tracing" feature "traces" hardirq and softirq state, in
+that it gives interested subsystems an opportunity to be notified of
+every hardirqs-off/hardirqs-on, softirqs-off/softirqs-on event that
+happens in the kernel.
+
+CONFIG_TRACE_IRQFLAGS_SUPPORT is needed for CONFIG_PROVE_SPIN_LOCKING
+and CONFIG_PROVE_RW_LOCKING to be offered by the generic lock debugging
+code. Otherwise only CONFIG_PROVE_MUTEX_LOCKING and
+CONFIG_PROVE_RWSEM_LOCKING will be offered on an architecture - these
+are locking APIs that are not used in IRQ context. (the one exception
+for rwsems is worked around)
+
+architecture support for this is certainly not in the "trivial"
+category, because lots of lowlevel assembly code deal with irq-flags
+state changes. But an architecture can be irq-flags-tracing enabled in a
+rather straightforward and risk-free manner.
+
+Architectures that want to support this need to do a couple of
+code-organizational changes first:
+
+- move their irq-flags manipulation code from their asm/system.h header
+  to asm/irqflags.h
+
+- rename local_irq_disable()/etc to raw_local_irq_disable()/etc. so that
+  the linux/irqflags.h code can inject callbacks and can construct the
+  real local_irq_disable()/etc APIs.
+
+- add and enable TRACE_IRQFLAGS_SUPPORT in their arch level Kconfig file
+
+and then a couple of functional changes are needed as well to implement
+irq-flags-tracing support:
+
+- in lowlevel entry code add (build-conditional) calls to the
+  trace_hardirqs_off()/trace_hardirqs_on() functions. The lock validator
+  closely guards whether the 'real' irq-flags matches the 'virtual'
+  irq-flags state, and complains loudly (and turns itself off) if the
+  two do not match. Usually most of the time for arch support for
+  irq-flags-tracing is spent in this state: look at the lockdep
+  complaint, try to figure out the assembly code we did not cover yet,
+  fix and repeat. Once the system has booted up and works without a
+  lockdep complaint in the irq-flags-tracing functions arch support is
+  complete.
+- if the architecture has non-maskable interrupts then those need to be
+  excluded from the irq-tracing [and lock validation] mechanism via
+  lockdep_off()/lockdep_on().
+
+in general there is no risk from having an incomplete irq-flags-tracing
+implementation in an architecture: lockdep will detect that and will
+turn itself off. I.e. the lock validator will still be reliable. There
+should be no crashes due to irq-tracing bugs. (except if the assembly
+changes break other code by modifying conditions or registers that
+shouldnt be)
+
index 86e9282d1c20053058ef1525b259d2645dd99ad3..149f62ba14a5023a59a1cbaa53550b053950edb2 100644 (file)
@@ -435,6 +435,15 @@ running once the system is up.
 
        debug           [KNL] Enable kernel debugging (events log level).
 
+       debug_locks_verbose=
+                       [KNL] verbose self-tests
+                       Format=<0|1>
+                       Print debugging info while doing the locking API
+                       self-tests.
+                       We default to 0 (no extra messages), setting it to
+                       1 will print _a lot_ more information - normally
+                       only useful to kernel developers.
+
        decnet=         [HW,NET]
                        Format: <area>[,<node>]
                        See also Documentation/networking/decnet.txt.
diff --git a/Documentation/lockdep-design.txt b/Documentation/lockdep-design.txt
new file mode 100644 (file)
index 0000000..00d9360
--- /dev/null
@@ -0,0 +1,197 @@
+Runtime locking correctness validator
+=====================================
+
+started by Ingo Molnar <mingo@redhat.com>
+additions by Arjan van de Ven <arjan@linux.intel.com>
+
+Lock-class
+----------
+
+The basic object the validator operates upon is a 'class' of locks.
+
+A class of locks is a group of locks that are logically the same with
+respect to locking rules, even if the locks may have multiple (possibly
+tens of thousands of) instantiations. For example a lock in the inode
+struct is one class, while each inode has its own instantiation of that
+lock class.
+
+The validator tracks the 'state' of lock-classes, and it tracks
+dependencies between different lock-classes. The validator maintains a
+rolling proof that the state and the dependencies are correct.
+
+Unlike an lock instantiation, the lock-class itself never goes away: when
+a lock-class is used for the first time after bootup it gets registered,
+and all subsequent uses of that lock-class will be attached to this
+lock-class.
+
+State
+-----
+
+The validator tracks lock-class usage history into 5 separate state bits:
+
+- 'ever held in hardirq context'                    [ == hardirq-safe   ]
+- 'ever held in softirq context'                    [ == softirq-safe   ]
+- 'ever held with hardirqs enabled'                 [ == hardirq-unsafe ]
+- 'ever held with softirqs and hardirqs enabled'    [ == softirq-unsafe ]
+
+- 'ever used'                                       [ == !unused        ]
+
+Single-lock state rules:
+------------------------
+
+A softirq-unsafe lock-class is automatically hardirq-unsafe as well. The
+following states are exclusive, and only one of them is allowed to be
+set for any lock-class:
+
+ <hardirq-safe> and <hardirq-unsafe>
+ <softirq-safe> and <softirq-unsafe>
+
+The validator detects and reports lock usage that violate these
+single-lock state rules.
+
+Multi-lock dependency rules:
+----------------------------
+
+The same lock-class must not be acquired twice, because this could lead
+to lock recursion deadlocks.
+
+Furthermore, two locks may not be taken in different order:
+
+ <L1> -> <L2>
+ <L2> -> <L1>
+
+because this could lead to lock inversion deadlocks. (The validator
+finds such dependencies in arbitrary complexity, i.e. there can be any
+other locking sequence between the acquire-lock operations, the
+validator will still track all dependencies between locks.)
+
+Furthermore, the following usage based lock dependencies are not allowed
+between any two lock-classes:
+
+   <hardirq-safe>   ->  <hardirq-unsafe>
+   <softirq-safe>   ->  <softirq-unsafe>
+
+The first rule comes from the fact the a hardirq-safe lock could be
+taken by a hardirq context, interrupting a hardirq-unsafe lock - and
+thus could result in a lock inversion deadlock. Likewise, a softirq-safe
+lock could be taken by an softirq context, interrupting a softirq-unsafe
+lock.
+
+The above rules are enforced for any locking sequence that occurs in the
+kernel: when acquiring a new lock, the validator checks whether there is
+any rule violation between the new lock and any of the held locks.
+
+When a lock-class changes its state, the following aspects of the above
+dependency rules are enforced:
+
+- if a new hardirq-safe lock is discovered, we check whether it
+  took any hardirq-unsafe lock in the past.
+
+- if a new softirq-safe lock is discovered, we check whether it took
+  any softirq-unsafe lock in the past.
+
+- if a new hardirq-unsafe lock is discovered, we check whether any
+  hardirq-safe lock took it in the past.
+
+- if a new softirq-unsafe lock is discovered, we check whether any
+  softirq-safe lock took it in the past.
+
+(Again, we do these checks too on the basis that an interrupt context
+could interrupt _any_ of the irq-unsafe or hardirq-unsafe locks, which
+could lead to a lock inversion deadlock - even if that lock scenario did
+not trigger in practice yet.)
+
+Exception: Nested data dependencies leading to nested locking
+-------------------------------------------------------------
+
+There are a few cases where the Linux kernel acquires more than one
+instance of the same lock-class. Such cases typically happen when there
+is some sort of hierarchy within objects of the same type. In these
+cases there is an inherent "natural" ordering between the two objects
+(defined by the properties of the hierarchy), and the kernel grabs the
+locks in this fixed order on each of the objects.
+
+An example of such an object hieararchy that results in "nested locking"
+is that of a "whole disk" block-dev object and a "partition" block-dev
+object; the partition is "part of" the whole device and as long as one
+always takes the whole disk lock as a higher lock than the partition
+lock, the lock ordering is fully correct. The validator does not
+automatically detect this natural ordering, as the locking rule behind
+the ordering is not static.
+
+In order to teach the validator about this correct usage model, new
+versions of the various locking primitives were added that allow you to
+specify a "nesting level". An example call, for the block device mutex,
+looks like this:
+
+enum bdev_bd_mutex_lock_class
+{
+       BD_MUTEX_NORMAL,
+       BD_MUTEX_WHOLE,
+       BD_MUTEX_PARTITION
+};
+
+ mutex_lock_nested(&bdev->bd_contains->bd_mutex, BD_MUTEX_PARTITION);
+
+In this case the locking is done on a bdev object that is known to be a
+partition.
+
+The validator treats a lock that is taken in such a nested fasion as a
+separate (sub)class for the purposes of validation.
+
+Note: When changing code to use the _nested() primitives, be careful and
+check really thoroughly that the hiearchy is correctly mapped; otherwise
+you can get false positives or false negatives.
+
+Proof of 100% correctness:
+--------------------------
+
+The validator achieves perfect, mathematical 'closure' (proof of locking
+correctness) in the sense that for every simple, standalone single-task
+locking sequence that occured at least once during the lifetime of the
+kernel, the validator proves it with a 100% certainty that no
+combination and timing of these locking sequences can cause any class of
+lock related deadlock. [*]
+
+I.e. complex multi-CPU and multi-task locking scenarios do not have to
+occur in practice to prove a deadlock: only the simple 'component'
+locking chains have to occur at least once (anytime, in any
+task/context) for the validator to be able to prove correctness. (For
+example, complex deadlocks that would normally need more than 3 CPUs and
+a very unlikely constellation of tasks, irq-contexts and timings to
+occur, can be detected on a plain, lightly loaded single-CPU system as
+well!)
+
+This radically decreases the complexity of locking related QA of the
+kernel: what has to be done during QA is to trigger as many "simple"
+single-task locking dependencies in the kernel as possible, at least
+once, to prove locking correctness - instead of having to trigger every
+possible combination of locking interaction between CPUs, combined with
+every possible hardirq and softirq nesting scenario (which is impossible
+to do in practice).
+
+[*] assuming that the validator itself is 100% correct, and no other
+    part of the system corrupts the state of the validator in any way.
+    We also assume that all NMI/SMM paths [which could interrupt
+    even hardirq-disabled codepaths] are correct and do not interfere
+    with the validator. We also assume that the 64-bit 'chain hash'
+    value is unique for every lock-chain in the system. Also, lock
+    recursion must not be higher than 20.
+
+Performance:
+------------
+
+The above rules require _massive_ amounts of runtime checking. If we did
+that for every lock taken and for every irqs-enable event, it would
+render the system practically unusably slow. The complexity of checking
+is O(N^2), so even with just a few hundred lock-classes we'd have to do
+tens of thousands of checks for every event.
+
+This problem is solved by checking any given 'locking scenario' (unique
+sequence of locks taken after each other) only once. A simple stack of
+held locks is maintained, and a lightweight 64-bit hash value is
+calculated, which hash is unique for every lock chain. The hash value,
+when the chain is validated for the first time, is then put into a hash
+table, which hash-table can be checked in a lockfree manner. If the
+locking chain occurs again later on, the hash table tells us that we
+dont have to validate the chain again.
index cf0d5416a4c39271aa572188647a7d30de93806a..28d1bc3edb1c9b98f357ff1f0442aa18a79a60f9 100644 (file)
@@ -602,7 +602,7 @@ Consider the following sequence of events:
 
 This sequence of events is committed to the memory coherence system in an order
 that the rest of the system might perceive as the unordered set of { STORE A,
-STORE B, STORE C } all occuring before the unordered set of { STORE D, STORE E
+STORE B, STORE C } all occurring before the unordered set of { STORE D, STORE E
 }:
 
        +-------+       :      :
diff --git a/Documentation/networking/ipvs-sysctl.txt b/Documentation/networking/ipvs-sysctl.txt
new file mode 100644 (file)
index 0000000..4ccdbca
--- /dev/null
@@ -0,0 +1,143 @@
+/proc/sys/net/ipv4/vs/* Variables:
+
+am_droprate - INTEGER
+        default 10
+
+        It sets the always mode drop rate, which is used in the mode 3
+        of the drop_rate defense.
+
+amemthresh - INTEGER
+        default 1024
+
+        It sets the available memory threshold (in pages), which is
+        used in the automatic modes of defense. When there is no
+        enough available memory, the respective strategy will be
+        enabled and the variable is automatically set to 2, otherwise
+        the strategy is disabled and the variable is  set  to 1.
+
+cache_bypass - BOOLEAN
+        0 - disabled (default)
+        not 0 - enabled
+
+        If it is enabled, forward packets to the original destination
+        directly when no cache server is available and destination
+        address is not local (iph->daddr is RTN_UNICAST). It is mostly
+        used in transparent web cache cluster.
+
+debug_level - INTEGER
+       0          - transmission error messages (default)
+       1          - non-fatal error messages
+       2          - configuration
+       3          - destination trash
+       4          - drop entry
+       5          - service lookup
+       6          - scheduling
+       7          - connection new/expire, lookup and synchronization
+       8          - state transition
+       9          - binding destination, template checks and applications
+       10         - IPVS packet transmission
+       11         - IPVS packet handling (ip_vs_in/ip_vs_out)
+       12 or more - packet traversal
+
+       Only available when IPVS is compiled with the CONFIG_IPVS_DEBUG
+
+       Higher debugging levels include the messages for lower debugging
+       levels, so setting debug level 2, includes level 0, 1 and 2
+       messages. Thus, logging becomes more and more verbose the higher
+       the level.
+
+drop_entry - INTEGER
+        0  - disabled (default)
+
+        The drop_entry defense is to randomly drop entries in the
+        connection hash table, just in order to collect back some
+        memory for new connections. In the current code, the
+        drop_entry procedure can be activated every second, then it
+        randomly scans 1/32 of the whole and drops entries that are in
+        the SYN-RECV/SYNACK state, which should be effective against
+        syn-flooding attack.
+
+        The valid values of drop_entry are from 0 to 3, where 0 means
+        that this strategy is always disabled, 1 and 2 mean automatic
+        modes (when there is no enough available memory, the strategy
+        is enabled and the variable is automatically set to 2,
+        otherwise the strategy is disabled and the variable is set to
+        1), and 3 means that that the strategy is always enabled.
+
+drop_packet - INTEGER
+        0  - disabled (default)
+
+        The drop_packet defense is designed to drop 1/rate packets
+        before forwarding them to real servers. If the rate is 1, then
+        drop all the incoming packets.
+
+        The value definition is the same as that of the drop_entry. In
+        the automatic mode, the rate is determined by the follow
+        formula: rate = amemthresh / (amemthresh - available_memory)
+        when available memory is less than the available memory
+        threshold. When the mode 3 is set, the always mode drop rate
+        is controlled by the /proc/sys/net/ipv4/vs/am_droprate.
+
+expire_nodest_conn - BOOLEAN
+        0 - disabled (default)
+        not 0 - enabled
+
+        The default value is 0, the load balancer will silently drop
+        packets when its destination server is not available. It may
+        be useful, when user-space monitoring program deletes the
+        destination server (because of server overload or wrong
+        detection) and add back the server later, and the connections
+        to the server can continue.
+
+        If this feature is enabled, the load balancer will expire the
+        connection immediately when a packet arrives and its
+        destination server is not available, then the client program
+        will be notified that the connection is closed. This is
+        equivalent to the feature some people requires to flush
+        connections when its destination is not available.
+
+expire_quiescent_template - BOOLEAN
+       0 - disabled (default)
+       not 0 - enabled
+
+       When set to a non-zero value, the load balancer will expire
+       persistent templates when the destination server is quiescent.
+       This may be useful, when a user makes a destination server
+       quiescent by setting its weight to 0 and it is desired that
+       subsequent otherwise persistent connections are sent to a
+       different destination server.  By default new persistent
+       connections are allowed to quiescent destination servers.
+
+       If this feature is enabled, the load balancer will expire the
+       persistence template if it is to be used to schedule a new
+       connection and the destination server is quiescent.
+
+nat_icmp_send - BOOLEAN
+        0 - disabled (default)
+        not 0 - enabled
+
+        It controls sending icmp error messages (ICMP_DEST_UNREACH)
+        for VS/NAT when the load balancer receives packets from real
+        servers but the connection entries don't exist.
+
+secure_tcp - INTEGER
+        0  - disabled (default)
+
+        The secure_tcp defense is to use a more complicated state
+        transition table and some possible short timeouts of each
+        state. In the VS/NAT, it delays the entering the ESTABLISHED
+        until the real server starts to send data and ACK packet
+        (after 3-way handshake).
+
+        The value definition is the same as that of drop_entry or
+        drop_packet.
+
+sync_threshold - INTEGER
+        default 3
+
+        It sets synchronization threshold, which is the minimum number
+        of incoming packets that a connection needs to receive before
+        the connection will be synchronized. A connection will be
+        synchronized, every time the number of its incoming packets
+        modulus 50 equals the threshold. The range of the threshold is
+        from 0 to 49.
index 278771c9ad99eda54420ca1d9d3c8a88e778d807..44f2f769e8659dd2565c82a9ece8771150091a5f 100644 (file)
@@ -74,7 +74,7 @@ Examples:
  pgset "pkt_size 9014"   sets packet size to 9014
  pgset "frags 5"         packet will consist of 5 fragments
  pgset "count 200000"    sets number of packets to send, set to zero
-                         for continious sends untill explicitl stopped.
+                         for continuous sends until explicitly stopped.
 
  pgset "delay 5000"      adds delay to hard_start_xmit(). nanoseconds
 
index 3242e5c1ee9cc27330a03494a1f1d48e50cb7300..2b395e478961ca6606a97dfce813c0da91346317 100644 (file)
@@ -225,7 +225,7 @@ Generic flavors of pci_request_region() are request_mem_region()
 Use these for address resources that are not described by "normal" PCI
 interfaces (e.g. BAR).
 
-   All interrupt handlers should be registered with SA_SHIRQ and use the devid
+   All interrupt handlers should be registered with IRQF_SHARED and use the devid
 to map IRQs to devices (remember that all PCI interrupts are shared).
 
 
diff --git a/Documentation/pcmcia/crc32hash.c b/Documentation/pcmcia/crc32hash.c
new file mode 100644 (file)
index 0000000..cbc36d2
--- /dev/null
@@ -0,0 +1,32 @@
+/* crc32hash.c - derived from linux/lib/crc32.c, GNU GPL v2 */
+/* Usage example:
+$ ./crc32hash "Dual Speed"
+*/
+
+#include <string.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <stdlib.h>
+
+unsigned int crc32(unsigned char const *p, unsigned int len)
+{
+       int i;
+       unsigned int crc = 0;
+       while (len--) {
+               crc ^= *p++;
+               for (i = 0; i < 8; i++)
+                       crc = (crc >> 1) ^ ((crc & 1) ? 0xedb88320 : 0);
+       }
+       return crc;
+}
+
+int main(int argc, char **argv) {
+       unsigned int result;
+       if (argc != 2) {
+               printf("no string passed as argument\n");
+               return -1;
+       }
+       result = crc32(argv[1], strlen(argv[1]));
+       printf("0x%x\n", result);
+       return 0;
+}
index 3351c0355143d8be4e00d89798e20108d7650375..199afd100cf27026bf1d918caaeb4d10636262c0 100644 (file)
@@ -27,37 +27,7 @@ pcmcia:m0149cC1ABf06pfn00fn00pa725B842DpbF1EFEE84pc0877B627pd00000000
 The hex value after "pa" is the hash of product ID string 1, after "pb" for
 string 2 and so on.
 
-Alternatively, you can use this small tool to determine the crc32 hash.
-simply pass the string you want to evaluate as argument to this program,
-e.g.
+Alternatively, you can use crc32hash (see Documentation/pcmcia/crc32hash.c)
+to determine the crc32 hash.  Simply pass the string you want to evaluate
+as argument to this program, e.g.:
 $ ./crc32hash "Dual Speed"
-
--------------------------------------------------------------------------
-/* crc32hash.c - derived from linux/lib/crc32.c, GNU GPL v2 */
-#include <string.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <stdlib.h>
-
-unsigned int crc32(unsigned char const *p, unsigned int len)
-{
-       int i;
-       unsigned int crc = 0;
-       while (len--) {
-               crc ^= *p++;
-               for (i = 0; i < 8; i++)
-                       crc = (crc >> 1) ^ ((crc & 1) ? 0xedb88320 : 0);
-       }
-       return crc;
-}
-
-int main(int argc, char **argv) {
-       unsigned int result;
-       if (argc != 2) {
-               printf("no string passed as argument\n");
-               return -1;
-       }
-       result = crc32(argv[1], strlen(argv[1]));
-       printf("0x%x\n", result);
-       return 0;
-}
index 217e51768b871b6e909984e6826066f2ddf1e26b..3c62e66e1fcc01999d939c8be8837285d6b18add 100644 (file)
@@ -1436,9 +1436,9 @@ platforms are moved over to use the flattened-device-tree model.
                interrupts = <1d 3>;
                interrupt-parent = <40000>;
                num-channels = <4>;
-               channel-fifo-len = <24>;
+               channel-fifo-len = <18>;
                exec-units-mask = <000000fe>;
-               descriptor-types-mask = <073f1127>;
+               descriptor-types-mask = <012b0ebf>;
        };
 
 
index 0a85a7e8120e5a7cbadc895fc038b58ea96d7815..d9e5960dafd5b2fee860552edac5f92b4e3bec42 100644 (file)
@@ -1,4 +1,20 @@
 
+1 Release Date    : Sun May 14 22:49:52 PDT 2006 - Sumant Patro <Sumant.Patro@lsil.com>
+2 Current Version : 00.00.03.01
+3 Older Version   : 00.00.02.04
+
+i.     Added support for ZCR controller.
+
+               New device id 0x413 added.
+
+ii.    Bug fix : Disable controller interrupt before firing INIT cmd to FW.
+
+               Interrupt is enabled after required initialization is over.
+               This is done to ensure that driver is ready to handle interrupts when
+               it is generated by the controller.
+
+               -Sumant Patro <Sumant.Patro@lsil.com>
+
 1 Release Date    : Wed Feb 03 14:31:44 PST 2006 - Sumant Patro <Sumant.Patro@lsil.com>
 2 Current Version : 00.00.02.04
 3 Older Version   : 00.00.02.04 
index e165229adf50be5eb73ff407ee4c3cd890b49152..df7a02bfb5bf66366289707c75d3a6cb2f0ebd57 100644 (file)
@@ -109,7 +109,7 @@ than the 33.33 MHz being in the PCI spec.
 
 If you want to share the IRQ with another device and the driver refuses to
 do so, you might succeed with changing the DC390_IRQ type in tmscsim.c to 
-SA_SHIRQ | SA_INTERRUPT.
+IRQF_SHARED | IRQF_DISABLED.
 
 
 3.Features
index 635cbb94357cd575bc46ae3328179dc4cac5ced1..69866d5997a45ab472e1da5a0e15394f0e2e8a6c 100644 (file)
           }
           chip->port = pci_resource_start(pci, 0);
           if (request_irq(pci->irq, snd_mychip_interrupt,
-                          SA_INTERRUPT|SA_SHIRQ, "My Chip", chip)) {
+                          IRQF_DISABLED|IRQF_SHARED, "My Chip", chip)) {
                   printk(KERN_ERR "cannot grab irq %d\n", pci->irq);
                   snd_mychip_free(chip);
                   return -EBUSY;
           <programlisting>
 <![CDATA[
   if (request_irq(pci->irq, snd_mychip_interrupt,
-                  SA_INTERRUPT|SA_SHIRQ, "My Chip", chip)) {
+                  IRQF_DISABLED|IRQF_SHARED, "My Chip", chip)) {
           printk(KERN_ERR "cannot grab irq %d\n", pci->irq);
           snd_mychip_free(chip);
           return -EBUSY;
 
       <para>
       On the PCI bus, the interrupts can be shared. Thus,
-      <constant>SA_SHIRQ</constant> is given as the interrupt flag of
+      <constant>IRQF_SHARED</constant> is given as the interrupt flag of
       <function>request_irq()</function>. 
       </para>
 
@@ -3048,7 +3048,7 @@ struct _snd_pcm_runtime {
         </para>
 
         <para>
-          If you aquire a spinlock in the interrupt handler, and the
+          If you acquire a spinlock in the interrupt handler, and the
         lock is used in other pcm callbacks, too, then you have to
         release the lock before calling
         <function>snd_pcm_period_elapsed()</function>, because
index 2dc246af4885caf69b05d4010a14ee8b685244ab..7cee90223d3a0624296b42d983d786b25462dc56 100644 (file)
@@ -28,7 +28,7 @@ Currently, these files are in /proc/sys/vm:
 - block_dump
 - drop-caches
 - zone_reclaim_mode
-- zone_reclaim_interval
+- min_unmapped_ratio
 - panic_on_oom
 
 ==============================================================
@@ -167,17 +167,18 @@ use of files and builds up large slab caches. However, the slab
 shrink operation is global, may take a long time and free slabs
 in all nodes of the system.
 
-================================================================
+=============================================================
 
-zone_reclaim_interval:
+min_unmapped_ratio:
 
-The time allowed for off node allocations after zone reclaim
-has failed to reclaim enough pages to allow a local allocation.
+This is available only on NUMA kernels.
 
-Time is set in seconds and set by default to 30 seconds.
+A percentage of the file backed pages in each zone.  Zone reclaim will only
+occur if more than this percentage of pages are file backed and unmapped.
+This is to insure that a minimal amount of local pages is still available for
+file I/O even if the node is overallocated.
 
-Reduce the interval if undesired off node allocations occur. However, too
-frequent scans will have a negative impact onoff node allocation performance.
+The default is 1 percent.
 
 =============================================================
 
index 6cb63ddf6163d7768ab4dfbc99f9318dc6df08a1..00d9a1f2a54c05dc01d1ab0b16b3b90f7aad6bf1 100644 (file)
@@ -50,3 +50,4 @@
  49 -> PixelView PlayTV P7000                              [1554:4813]
  50 -> NPG Tech Real TV FM Top 10                          [14f1:0842]
  51 -> WinFast DTV2000 H                                   [107d:665e]
+ 52 -> Geniatech DVB-S                                     [14f1:0084]
index 31a13720f23c068a5de4a6e9118f23ce80a4adc7..5f76a4f5cd4b721286a10ba99caad240ae2bec3f 100644 (file)
@@ -861,6 +861,8 @@ S:  Maintained
 DOCBOOK FOR DOCUMENTATION
 P:     Martin Waitz
 M:     tali@admingilde.org
+P:     Randy Dunlap
+M:     rdunlap@xenotime.net
 T:     git http://tali.admingilde.org/git/linux-docbook.git
 S:     Maintained
 
@@ -925,23 +927,21 @@ S:        Maintained
 
 EDAC-CORE
 P:     Doug Thompson
-M:     norsk5@xmission.com, dthompson@linuxnetworx.com
-P:     Dave Peterson
-M:     dsp@llnl.gov, dave_peterson@pobox.com
+M:     norsk5@xmission.com
 L:     bluesmoke-devel@lists.sourceforge.net
 W:     bluesmoke.sourceforge.net
-S:     Maintained
+S:     Supported
 
 EDAC-E752X
-P:     Dave Peterson
-M:     dsp@llnl.gov, dave_peterson@pobox.com
+P:     Mark Gross
+M:     mark.gross@intel.com
 L:     bluesmoke-devel@lists.sourceforge.net
 W:     bluesmoke.sourceforge.net
 S:     Maintained
 
 EDAC-E7XXX
-P:     Dave Peterson
-M:     dsp@llnl.gov, dave_peterson@pobox.com
+P:     Doug Thompson
+M:     norsk5@xmission.com
 L:     bluesmoke-devel@lists.sourceforge.net
 W:     bluesmoke.sourceforge.net
 S:     Maintained
@@ -2300,6 +2300,14 @@ M:       promise@pnd-pc.demon.co.uk
 W:     http://www.pnd-pc.demon.co.uk/promise/
 S:     Maintained
 
+PVRUSB2 VIDEO4LINUX DRIVER
+P:     Mike Isely
+M:     isely@pobox.com
+L:     pvrusb2@isely.net
+L:     video4linux-list@redhat.com
+W:     http://www.isely.net/pvrusb2/
+S:     Maintained
+
 PXA2xx SUPPORT
 P:     Nicolas Pitre
 M:     nico@cam.org
@@ -2557,13 +2565,6 @@ M:       thomas@winischhofer.net
 W:     http://www.winischhofer.at/linuxsisusbvga.shtml
 S:     Maintained
 
-SMB FILESYSTEM
-P:     Urban Widmark
-M:     urban@teststation.com
-W:     http://samba.org/
-L:     samba@samba.org
-S:     Maintained
-
 SMC91x ETHERNET DRIVER
 P:     Nicolas Pitre
 M:     nico@cam.org
index e9560c6f8156983cb15328c767b594028354da8e..11a850cffd3d95868ba73a8dbcd4dc0de94e7c1d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -41,8 +41,9 @@ ifndef KBUILD_VERBOSE
   KBUILD_VERBOSE = 0
 endif
 
-# Call sparse as part of compilation of C files
-# Use 'make C=1' to enable sparse checking
+# Call checker as part of compilation of C files
+# Use 'make C=1' to enable checking (sparse, by default)
+# Override with 'make C=1 CHECK=checker_executable CHECKFLAGS=....'
 
 ifdef C
   ifeq ("$(origin C)", "command line")
@@ -308,6 +309,9 @@ CPPFLAGS        := -D__KERNEL__ $(LINUXINCLUDE)
 
 CFLAGS          := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
                    -fno-strict-aliasing -fno-common
+# Force gcc to behave correct even for buggy distributions
+CFLAGS          += $(call cc-option, -fno-stack-protector-all \
+                                     -fno-stack-protector)
 AFLAGS          := -D__ASSEMBLY__
 
 # Read KERNELRELEASE from include/config/kernel.release (if it exists)
@@ -808,8 +812,8 @@ endif
 # prepare2 creates a makefile if using a separate output directory
 prepare2: prepare3 outputmakefile
 
-prepare1: prepare2 include/linux/version.h include/asm \
-                   include/config/auto.conf
+prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \
+                   include/asm include/config/auto.conf
 ifneq ($(KBUILD_MODULES),)
        $(Q)mkdir -p $(MODVERDIR)
        $(Q)rm -f $(MODVERDIR)/*
@@ -844,27 +848,47 @@ include/asm:
 # needs to be updated, so this check is forced on all builds
 
 uts_len := 64
+define filechk_utsrelease.h
+       if [ `echo -n "$(KERNELRELEASE)" | wc -c ` -gt $(uts_len) ]; then \
+         echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2;    \
+         exit 1;                                                         \
+       fi;                                                               \
+       (echo \#define UTS_RELEASE \"$(KERNELRELEASE)\";)
+endef
 
 define filechk_version.h
-       if [ `echo -n "$(KERNELRELEASE)" | wc -c ` -gt $(uts_len) ]; then \
-         echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \
-         exit 1; \
-       fi; \
-       (echo \#define UTS_RELEASE \"$(KERNELRELEASE)\"; \
-         echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)`; \
-        echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'; \
-       )
+       (echo \#define LINUX_VERSION_CODE $(shell                             \
+       expr $(VERSION) \* 65536 + $(PATCHLEVEL) \* 256 + $(SUBLEVEL));     \
+       echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
 endef
 
-include/linux/version.h: $(srctree)/Makefile include/config/kernel.release FORCE
+include/linux/version.h: $(srctree)/Makefile FORCE
        $(call filechk,version.h)
 
+include/linux/utsrelease.h: include/config/kernel.release FORCE
+       $(call filechk,utsrelease.h)
+
 # ---------------------------------------------------------------------------
 
 PHONY += depend dep
 depend dep:
        @echo '*** Warning: make $@ is unnecessary now.'
 
+# ---------------------------------------------------------------------------
+# Kernel headers
+INSTALL_HDR_PATH=$(MODLIB)/abi
+export INSTALL_HDR_PATH
+
+PHONY += headers_install
+headers_install: include/linux/version.h
+       $(Q)unifdef -Ux /dev/null
+       $(Q)rm -rf $(INSTALL_HDR_PATH)/include
+       $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.headersinst obj=include
+
+PHONY += headers_check
+headers_check: headers_install
+       $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.headersinst obj=include HDRCHECK=1
+
 # ---------------------------------------------------------------------------
 # Modules
 
@@ -951,7 +975,8 @@ CLEAN_FILES +=      vmlinux System.map \
 # Directories & files removed with 'make mrproper'
 MRPROPER_DIRS  += include/config include2
 MRPROPER_FILES += .config .config.old include/asm .version .old_version \
-                  include/linux/autoconf.h include/linux/version.h \
+                  include/linux/autoconf.h include/linux/version.h      \
+                  include/linux/utsrelease.h                            \
                  Module.symvers tags TAGS cscope*
 
 # clean - Delete most, but leave enough to build external modules
@@ -1038,6 +1063,8 @@ help:
        @echo  '  cscope          - Generate cscope index'
        @echo  '  kernelrelease   - Output the release version string'
        @echo  '  kernelversion   - Output the version stored in Makefile'
+       @echo  '  headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'
+       @echo  '                    (default: /lib/modules/$$VERSION/abi)'
        @echo  ''
        @echo  'Static analysers'
        @echo  '  checkstack      - Generate a list of stack hogs'
@@ -1060,8 +1087,8 @@ help:
 
        @echo  '  make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'
        @echo  '  make O=dir [targets] Locate all output files in "dir", including .config'
-       @echo  '  make C=1   [targets] Check all c source with $$CHECK (sparse)'
-       @echo  '  make C=2   [targets] Force check of all c source with $$CHECK (sparse)'
+       @echo  '  make C=1   [targets] Check all c source with $$CHECK (sparse by default)'
+       @echo  '  make C=2   [targets] Force check of all c source with $$CHECK'
        @echo  ''
        @echo  'Execute "make" or "make all" to build all targets marked with [*] '
        @echo  'For further info see the ./README file'
@@ -1352,7 +1379,7 @@ quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN   $(wildcard $(rm-files))
 
 a_flags = -Wp,-MD,$(depfile) $(AFLAGS) $(AFLAGS_KERNEL) \
          $(NOSTDINC_FLAGS) $(CPPFLAGS) \
-         $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o)
+         $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o)
 
 quiet_cmd_as_o_S = AS      $@
 cmd_as_o_S       = $(CC) $(a_flags) -c -o $@ $<
index ec53c28e33defeba74ff5140cc663856e5820628..3af21c78933943df7e3750b3d61d3fd391581b87 100644 (file)
@@ -9,7 +9,7 @@
  */
 #include <linux/kernel.h>
 #include <linux/string.h>
-#include <linux/version.h>
+#include <linux/utsrelease.h>
 #include <linux/mm.h>
 
 #include <asm/system.h>
index a6657f2cf9bd81bec24548d31d24699bf71967ae..4307bde80a3527dc454f9c8fe58e9b4994f72ccb 100644 (file)
@@ -11,7 +11,7 @@
  */
 #include <linux/kernel.h>
 #include <linux/string.h>
-#include <linux/version.h>
+#include <linux/utsrelease.h>
 #include <linux/mm.h>
 
 #include <asm/system.h>
index 78c9b0b6eea7cdb7e1758ccbcd4e97cfef76fae4..90ed55b662a85e32d91f1d8fb8dc5c0f9896232f 100644 (file)
@@ -7,7 +7,7 @@
  */
 #include <linux/kernel.h>
 #include <linux/string.h>
-#include <linux/version.h>
+#include <linux/utsrelease.h>
 #include <linux/mm.h>
 
 #include <asm/system.h>
index d3848c5b0d2bfc855e68c6c7a128f90c902553b2..425643762bf5889ca9a083f7973770155eba3961 100644 (file)
@@ -5,7 +5,6 @@
  * modules.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/user.h>
index cb3e739fbad8e3f9c097d93e73bbc9dd31037e96..f313b34939bbc5516894e64e2d047322bfa69bae 100644 (file)
@@ -5,7 +5,6 @@
  * non-0 I/O hose
  */
 
-#include <linux/config.h>
 #include <linux/pci.h>
 #include <linux/init.h>
 #include <linux/tty.h>
index 7af15bf7e5ab64e9e4ad5e0abc2d1ef4be962f34..01ecd09d4a64c42be3a6872d6f068e0492db03d9 100644 (file)
@@ -4,7 +4,6 @@
  * Kernel entry-points.
  */
 
-#include <linux/config.h>
 #include <asm/asm-offsets.h>
 #include <asm/thread_info.h>
 #include <asm/pal.h>
index 8827687b9f892b269125cc1540e42e35a375f6a7..c0c7155448e08805c44ead133e2c19e5e9c4ece8 100644 (file)
@@ -2,7 +2,6 @@
  *     linux/arch/alpha/kernel/gct.c
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/errno.h>
index 0905721fcbcaba4f89425b8d22d0281426e78b81..1e2a62a1f75fbd3172b3b74d5fe42826c7804981 100644 (file)
@@ -7,7 +7,6 @@
  * the kernel global pointer and jump to the kernel entry-point.
  */
 
-#include <linux/config.h>
 #include <asm/system.h>
 #include <asm/asm-offsets.h>
 
index 63af36cf7f6e356fc917b1ac86f6e879be5bc0fd..729c475d2269a3f1f302e746168949d3aee89966 100644 (file)
@@ -10,7 +10,6 @@
  * should be easier.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/errno.h>
@@ -95,12 +94,12 @@ show_interrupts(struct seq_file *p, void *v)
 #endif
                seq_printf(p, " %14s", irq_desc[irq].chip->typename);
                seq_printf(p, "  %c%s",
-                       (action->flags & SA_INTERRUPT)?'+':' ',
+                       (action->flags & IRQF_DISABLED)?'+':' ',
                        action->name);
 
                for (action=action->next; action; action = action->next) {
                        seq_printf(p, ", %c%s",
-                                 (action->flags & SA_INTERRUPT)?'+':' ',
+                                 (action->flags & IRQF_DISABLED)?'+':' ',
                                   action->name);
                }
 
index f20f2dff9c438599c6e182eaf9222bf34450b45a..ddf5cf8dcb0bcefe44994ad9c10751f8caa5b09e 100644 (file)
@@ -2,7 +2,6 @@
  * Alpha specific irq code.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/irq.h>
@@ -215,7 +214,7 @@ static unsigned int rtc_startup(unsigned int irq) { return 0; }
 
 struct irqaction timer_irqaction = {
        .handler        = timer_interrupt,
-       .flags          = SA_INTERRUPT,
+       .flags          = IRQF_DISABLED,
        .name           = "timer",
 };
 
index ac893bd48036cf6cf613d82a042eb6860b690830..ebbadbc0c36a3fd98769db496983c76cb58f146f 100644 (file)
@@ -7,7 +7,6 @@
  * Started hacking from linux-2.3.30pre6/arch/i386/kernel/i8259.c.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/cache.h>
 #include <linux/sched.h>
index 11f996f24fde5aa48a9775223b2d183a49886128..08b8302e64ca0f9630ffddfb2585d5a4915adfda 100644 (file)
@@ -6,7 +6,6 @@
  * This file has goodies to help simplify instantiation of machine vectors.
  */
 
-#include <linux/config.h>
 #include <asm/pgalloc.h>
 
 /* Whee.  These systems don't have an HAE:
index 4ea6711e55aa5263812ba401a84dbae7ff5d4dbf..ffb7d5423cc00210fc99e1bf5d6b98cd8d68f1fb 100644 (file)
@@ -12,7 +12,6 @@
  * Nov 2000, Ivan Kokshaysky <ink@jurassic.park.msu.ru>
  *          PCI-PCI bridges cleanup
  */
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/pci.h>
 #include <linux/init.h>
index c760a831fd1a250d45bdc2e6e70f6f5c243fd3c1..41ebf51a107a2439ebcc7bf408f446f1e0949ca4 100644 (file)
@@ -8,7 +8,6 @@
  * This file handles the architecture-dependent parts of process handling.
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/module.h>
 #include <linux/sched.h>
@@ -475,7 +474,7 @@ out:
  */
 
 unsigned long
-thread_saved_pc(task_t *t)
+thread_saved_pc(struct task_struct *t)
 {
        unsigned long base = (unsigned long)task_stack_page(t);
        unsigned long fp, sp = task_thread_info(t)->pcb.ksp;
index e1560fb156104d2434c9a851afb403e86ed7bbcf..2a6e3da8144f01440733135289cb8760c872804c 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/interrupt.h>
 
 
index 421e51ea6bb76f986de541ab7e94da3ff5052d8c..2636cc028d06af7d120282eda93c8ea32a6e41af 100644 (file)
@@ -2,7 +2,6 @@
  * SMC 37C93X initialization code
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 
 #include <linux/slab.h>
index 5c98fc83e2382d67c2f3fa24222672ba7dabb6e0..990ac61028f860971fe12547662f0c9e47816518 100644 (file)
@@ -57,7 +57,6 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/proc_fs.h>
index 3b30d4f1fc42d5d438082b82f20a3dee5acad56e..9d7dff27f81562e986064ff55d68d045cd8ca5fb 100644 (file)
@@ -5,7 +5,6 @@
  * (TTY driver and console driver)
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/console.h>
index 1a1a2c7a3d944190c8699339c5f38086b434ee83..d6926b7b1e994b3dde36c9f7c77991ea55102227 100644 (file)
@@ -8,7 +8,6 @@
  * Code supporting the ALCOR and XLT (XL-300/366/433).
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/mm.h>
index 8c9e443d93ad6298b312e424ee48db22fd23ebe6..25a215067da8a55111a55ca8ec83e8eaa8e5f9a6 100644 (file)
@@ -9,7 +9,6 @@
  * PC164 and LX164.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/mm.h>
index b28c8f1c6e10b078fb0b1173ce64ad538bc23dda..dd6103b867e778e062e932fb8a26cbf5f527be67 100644 (file)
@@ -12,7 +12,6 @@
  * Code supporting the DP264 (EV6+TSUNAMI).
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/mm.h>
index aeb8e0277905660275943dd0b0678c3ba08a19b6..ed108b66ec09842b0ab9af2aeb7bbc23c0812305 100644 (file)
@@ -8,7 +8,6 @@
  * Code supporting the EB64+ and EB66.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/mm.h>
index 0148e095638f8c6d40183ca098f49746f2f5d9f8..4ac2b328b8de32e8cd60294d0bb2925a327f1327 100644 (file)
@@ -74,7 +74,7 @@ jensen_local_startup(unsigned int irq)
                 * the IPL from being dropped during handler processing.
                 */
                if (irq_desc[irq].action)
-                       irq_desc[irq].action->flags |= SA_INTERRUPT;
+                       irq_desc[irq].action->flags |= IRQF_DISABLED;
        return 0;
 }
 
index b741600e3761a794450d07b278b6ffd2afe2b0ff..cc4c58111366b54fccd67789262e92a681ca75b9 100644 (file)
@@ -8,7 +8,6 @@
  * Code supporting the MIKASA (AlphaServer 1000).
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/mm.h>
index 55db02d318d74172804f5ee67ae1ebd25e046b7d..2d3cff7e8c5f83723576d8b0d54ca004d80af53e 100644 (file)
@@ -9,7 +9,6 @@
  * CORELLE (AlphaServer 800), and ALCOR Primo (AlphaStation 600A).
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/mm.h>
index 24dea40c9bfe823feea687efcea7677bb42bae12..a7a14647b50e01cf2f7725192b76e0d5c7b270a3 100644 (file)
@@ -8,7 +8,6 @@
  * Code supporting the Sable, Sable-Gamma, and Lynx systems.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/mm.h>
index 131a2d9f79d3077cf3069c902ec038c08511bd8a..cd85ef725e0e426446cfbb0957b6819f44bef64e 100644 (file)
@@ -10,7 +10,6 @@
  * Kenetics's Platform 2000, Avanti (AlphaStation), XL, and AlphaBook1.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/mm.h>
index 13f3ed8ed7ac2f1c166d6d9392a0785bccbb71fd..302aab38d95f6ce902bce1c5737506fc9a58f05c 100644 (file)
@@ -12,7 +12,6 @@
  *     Granite
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/mm.h>
@@ -280,15 +279,15 @@ titan_late_init(void)
         * all reported to the kernel as machine checks, so the handler
         * is a nop so it can be called to count the individual events.
         */
-       request_irq(63+16, titan_intr_nop, SA_INTERRUPT, 
+       request_irq(63+16, titan_intr_nop, IRQF_DISABLED,
                    "CChip Error", NULL);
-       request_irq(62+16, titan_intr_nop, SA_INTERRUPT, 
+       request_irq(62+16, titan_intr_nop, IRQF_DISABLED,
                    "PChip 0 H_Error", NULL);
-       request_irq(61+16, titan_intr_nop, SA_INTERRUPT, 
+       request_irq(61+16, titan_intr_nop, IRQF_DISABLED,
                    "PChip 1 H_Error", NULL);
-       request_irq(60+16, titan_intr_nop, SA_INTERRUPT, 
+       request_irq(60+16, titan_intr_nop, IRQF_DISABLED,
                    "PChip 0 C_Error", NULL);
-       request_irq(59+16, titan_intr_nop, SA_INTERRUPT, 
+       request_irq(59+16, titan_intr_nop, IRQF_DISABLED,
                    "PChip 1 C_Error", NULL);
 
        /* 
@@ -349,9 +348,9 @@ privateer_init_pci(void)
         * Hook a couple of extra err interrupts that the
         * common titan code won't.
         */
-       request_irq(53+16, titan_intr_nop, SA_INTERRUPT, 
+       request_irq(53+16, titan_intr_nop, IRQF_DISABLED,
                    "NMI", NULL);
-       request_irq(50+16, titan_intr_nop, SA_INTERRUPT, 
+       request_irq(50+16, titan_intr_nop, IRQF_DISABLED,
                    "Temperature Warning", NULL);
 
        /*
index 3859749810b41fd27cd74608d6678f57723f0f3d..50eccde2dcd8dc0ac9a00f495a454171be7faa4b 100644 (file)
@@ -27,7 +27,6 @@
  * 2003-06-03  R. Scott Bailey <scott.bailey@eds.com>
  *     Tighten sanity in time_init from 1% (10,000 PPM) to 250 PPM
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/module.h>
 #include <linux/sched.h>
index f9d12319e0fbba45ec9dc97cfd9e31e5581fadea..d6e665d567bdc57758d10fe5c72a3b27fd758db2 100644 (file)
@@ -8,7 +8,6 @@
  * This file initializes the trap entry points
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/sched.h>
 #include <linux/tty.h>
index 0922e0785ddb93eac641c6b0ffce874d4b869108..71470e9d93ba2e1c1071730093800817e194f08d 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <asm-generic/vmlinux.lds.h>
 
 OUTPUT_FORMAT("elf64-alpha")
index 0528acd0d9ad64a05729077cda3ee2741f732efe..8804bec2c6448e15e5f34be99b25e9bef8518a15 100644 (file)
@@ -2,7 +2,6 @@
  *     arch/alpha/lib/callback_srm.S
  */
 
-#include <linux/config.h>
 #include <asm/console.h>
 
 .text
index 1c879bbce419309eed5865a9882a1baa7dd7b380..69d52aa37bae2c27ddf568b10b28e43d14af4084 100644 (file)
@@ -4,7 +4,6 @@
  * Delay routines, using a pre-computed "loops_per_jiffy" value.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h> /* for udelay's use of smp_processor_id */
 #include <asm/param.h>
index c3849baebd575e06683e706c2710dbf13f596480..dc7aeda157734737f71d8a0b7dd3a7bfc7fbbcab 100644 (file)
@@ -2,7 +2,6 @@
  * linux/arch/alpha/mm/extable.c
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <asm/uaccess.h>
 
index 64ace5a9cd3d1383159992d0bdff9363fbf13238..622dabd846800b14fb13c623eff5c61da0ac9cf7 100644 (file)
@@ -4,7 +4,6 @@
  *  Copyright (C) 1995  Linus Torvalds
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
index 544ac5dc09eb60e2b00eb5ea58e6da483a266030..917dad1b74c8f9f2947eb79eb389af4aa909133b 100644 (file)
@@ -6,7 +6,6 @@
 
 /* 2.3.x zone allocator, 1999 Andrea Arcangeli <andrea@suse.de> */
 
-#include <linux/config.h>
 #include <linux/pagemap.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
index bf6b65c81befda0c62b2364104dd1681cd7afcac..b826f58c6e7247e5f73a45039a1493c9b7c90f60 100644 (file)
@@ -6,7 +6,6 @@
  *  Copyright (C) 2001 Andrea Arcangeli <andrea@suse.de> SuSE
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
index f123c7c9fc989d507a5c834b2208fc94a5f02c54..f81a62380addefde7db4f0cde3902cb872c1c061 100644 (file)
@@ -47,6 +47,18 @@ config MCA
          <file:Documentation/mca.txt> (and especially the web page given
          there) before attempting to build an MCA bus kernel.
 
+config GENERIC_HARDIRQS
+       bool
+       default y
+
+config HARDIRQS_SW_RESEND
+       bool
+       default y
+
+config GENERIC_IRQ_PROBE
+       bool
+       default y
+
 config RWSEM_GENERIC_SPINLOCK
        bool
        default y
@@ -121,11 +133,11 @@ config ARCH_VERSATILE
        help
          This enables support for ARM Ltd Versatile board.
 
-config ARCH_AT91RM9200
-       bool "Atmel AT91RM9200"
+config ARCH_AT91
+       bool "Atmel AT91"
        help
-         Say Y here if you intend to run this kernel on an Atmel
-         AT91RM9200-based board.
+         This enables support for systems based on the Atmel AT91RM9200
+         and AT91SAM9xxx processors.
 
 config ARCH_CLPS7500
        bool "Cirrus CL-PS7500FE"
@@ -547,7 +559,7 @@ config LEDS
                   ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_NETWINDER || \
                   ARCH_OMAP || ARCH_P720T || ARCH_PXA_IDP || \
                   ARCH_SA1100 || ARCH_SHARK || ARCH_VERSATILE || \
-                  ARCH_AT91RM9200
+                  ARCH_AT91RM9200 || MACH_TRIZEPS4
        help
          If you say Y here, the LEDs on your machine will be used
          to provide useful information about your current system status.
@@ -678,7 +690,7 @@ config XIP_PHYS_ADDR
 
 endmenu
 
-if (ARCH_SA1100 || ARCH_INTEGRATOR || ARCH_OMAP1)
+if (ARCH_SA1100 || ARCH_INTEGRATOR || ARCH_OMAP)
 
 menu "CPU Frequency scaling"
 
index a3bbaaf480b93fbafdd5e106cbe589326e2a5a86..3345c6d0fd1ee35602b40acd82eea4bd2cb329e3 100644 (file)
@@ -114,7 +114,7 @@ endif
  machine-$(CONFIG_ARCH_H720X)     := h720x
  machine-$(CONFIG_ARCH_AAEC2000)   := aaec2000
  machine-$(CONFIG_ARCH_REALVIEW)   := realview
- machine-$(CONFIG_ARCH_AT91RM9200) := at91rm9200
+ machine-$(CONFIG_ARCH_AT91)       := at91rm9200
  machine-$(CONFIG_ARCH_EP93XX)     := ep93xx
  machine-$(CONFIG_ARCH_PNX4008)    := pnx4008
  machine-$(CONFIG_ARCH_NETX)       := netx
index 4a8a689d15e61c7a33719daacf4b994e6b46abb5..941c5f5cbacf9a2492edbc96a95d348be7b718f2 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 1999, 2000, 2001 Nexus Electronics Ltd
  */
 
-#include <linux/config.h>
 
                /* There are three different ways the kernel can be
                   booted on a 7500 system: from Angel (loaded in RAM), from
index b08bd23f8d1639ab291658b71290ea8cf27369a5..d0e3b20856cd4657170b13f85d6111dee1ec5d65 100644 (file)
@@ -7,7 +7,6 @@
  * is merged with head.S by the linker.
  */
 
-#include <linux/config.h>
 #include <asm/mach-types.h>
 
 #ifndef CONFIG_ARCH_L7200
index 5aefffd46048d2d9841235b5858185b8db56a8d7..4c8c0e46027d224458e104d4ceab0d4e607b9c3c 100644 (file)
@@ -7,7 +7,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/mach-types.h>
 
index 59ad69640d6bde4e26cb8b41279ca32aa1b47c65..eb0084ea1ec49e15760be80ff818d6172291fdb8 100644 (file)
@@ -12,7 +12,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/mach-types.h>
 
index d3fe2533907ec1af9c812362eb91802a8af713f4..73c5d9e0201c47fd48b6a79194e3cb0413d5147f 100644 (file)
@@ -5,7 +5,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/mach-types.h>
 
index 23016f6aa645f405dcb9108240f1fad80f4ac4b9..14a9ff9c68df4bfcdbca3fe97dcea28f702588a0 100644 (file)
@@ -8,7 +8,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <linux/config.h>
 #include <linux/linkage.h>
 
 /*
@@ -448,8 +447,11 @@ __common_mmu_cache_on:
                mov     r1, #-1
                mcr     p15, 0, r3, c2, c0, 0   @ load page table pointer
                mcr     p15, 0, r1, c3, c0, 0   @ load domain access control
-               mcr     p15, 0, r0, c1, c0, 0   @ load control register
-               mov     pc, lr
+               b       1f
+               .align  5                       @ cache line aligned
+1:             mcr     p15, 0, r0, c1, c0, 0   @ load control register
+               mrc     p15, 0, r0, c1, c0, 0   @ and read it back to
+               sub     pc, lr, r0, lsr #32     @ properly flush pipeline
 
 /*
  * All code following this line is relocatable.  It is relocated by
index c02dc8116a18ef5facc08dbf61655c0144cfdaec..f3c1ebfdd0aabaa8ec8cc87d089f9fe74ce1899f 100644 (file)
@@ -33,6 +33,7 @@
 
 static void __iomem *gic_dist_base;
 static void __iomem *gic_cpu_base;
+static DEFINE_SPINLOCK(irq_controller_lock);
 
 /*
  * Routines to acknowledge, disable and enable interrupts
@@ -52,32 +53,45 @@ static void __iomem *gic_cpu_base;
 static void gic_ack_irq(unsigned int irq)
 {
        u32 mask = 1 << (irq % 32);
+
+       spin_lock(&irq_controller_lock);
        writel(mask, gic_dist_base + GIC_DIST_ENABLE_CLEAR + (irq / 32) * 4);
        writel(irq, gic_cpu_base + GIC_CPU_EOI);
+       spin_unlock(&irq_controller_lock);
 }
 
 static void gic_mask_irq(unsigned int irq)
 {
        u32 mask = 1 << (irq % 32);
+
+       spin_lock(&irq_controller_lock);
        writel(mask, gic_dist_base + GIC_DIST_ENABLE_CLEAR + (irq / 32) * 4);
+       spin_unlock(&irq_controller_lock);
 }
 
 static void gic_unmask_irq(unsigned int irq)
 {
        u32 mask = 1 << (irq % 32);
+
+       spin_lock(&irq_controller_lock);
        writel(mask, gic_dist_base + GIC_DIST_ENABLE_SET + (irq / 32) * 4);
+       spin_unlock(&irq_controller_lock);
 }
 
 #ifdef CONFIG_SMP
-static void gic_set_cpu(struct irqdesc *desc, unsigned int irq, unsigned int cpu)
+static void gic_set_cpu(unsigned int irq, cpumask_t mask_val)
 {
        void __iomem *reg = gic_dist_base + GIC_DIST_TARGET + (irq & ~3);
        unsigned int shift = (irq % 4) * 8;
+       unsigned int cpu = first_cpu(mask_val);
        u32 val;
 
+       spin_lock(&irq_controller_lock);
+       irq_desc[irq].cpu = cpu;
        val = readl(reg) & ~(0xff << shift);
        val |= 1 << (cpu + shift);
        writel(val, reg);
+       spin_unlock(&irq_controller_lock);
 }
 #endif
 
@@ -86,7 +100,7 @@ static struct irqchip gic_chip = {
        .mask           = gic_mask_irq,
        .unmask         = gic_unmask_irq,
 #ifdef CONFIG_SMP
-       .set_cpu        = gic_set_cpu,
+       .set_affinity   = gic_set_cpu,
 #endif
 };
 
index 0dafba3a701d605d80ad34e3c87bf1fb8da5627b..fbc3ab0e10117160bde63ed323663c607a02e00a 100644 (file)
@@ -15,7 +15,6 @@
  * Based on sa1111.c
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
index 3f68db84e5e6c488920258f0911c4378cb35ccc2..1cdb26a47e1f3170596b373fb401714d7d574772 100644 (file)
@@ -14,7 +14,6 @@
  * All initialization functions provided here are intended to be called
  * from machine specific code with proper arguments when required.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
@@ -151,7 +150,7 @@ static void
 sa1111_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
 {
        unsigned int stat0, stat1, i;
-       void __iomem *base = desc->data;
+       void __iomem *base = get_irq_data(irq);
 
        stat0 = sa1111_readl(base + SA1111_INTSTATCLR0);
        stat1 = sa1111_readl(base + SA1111_INTSTATCLR1);
@@ -169,11 +168,11 @@ sa1111_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
 
        for (i = IRQ_SA1111_START; stat0; i++, stat0 >>= 1)
                if (stat0 & 1)
-                       do_edge_IRQ(i, irq_desc + i, regs);
+                       handle_edge_irq(i, irq_desc + i, regs);
 
        for (i = IRQ_SA1111_START + 32; stat1; i++, stat1 >>= 1)
                if (stat1 & 1)
-                       do_edge_IRQ(i, irq_desc + i, regs);
+                       handle_edge_irq(i, irq_desc + i, regs);
 
        /* For level-based interrupts */
        desc->chip->unmask(irq);
index 486add853fb88fcaf515afd2e7fc6cb1efbaac13..3f60dd9aca80bfb7961329d8dfc39004d5ef7be1 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/timex.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 
 #include <asm/hardware.h>
 #include <asm/io.h>
@@ -76,7 +77,7 @@ ioc_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 static struct irqaction ioc_timer_irq = {
        .name           = "timer",
-       .flags          = SA_INTERRUPT,
+       .flags          = IRQF_DISABLED,
        .handler        = ioc_timer_interrupt
 };
 
index dfca596a9a276b90a76b6e02a6528c80fd8acdb5..95c8508c29b7125a1ac93bc0a6fd4e4f00d39f9e 100644 (file)
@@ -11,7 +11,6 @@
  * License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/slab.h>
index ef716a5b07ace7d6d640eede475c61eff24ea826..ba2e62986a578da898a1ec131270e0e1353f8b8c 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/ptrace.h>
index 9e1c1cceb735cf458898bdf277e134f7e7b2a9bf..4f3d8d37741e0c13156886c04b471ccbfbd4086f 100644 (file)
@@ -103,6 +103,7 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
 # CONFIG_ARCH_IMX is not set
 # CONFIG_ARCH_H720X is not set
 # CONFIG_ARCH_AAEC2000 is not set
+CONFIG_ARCH_AT91=y
 CONFIG_ARCH_AT91RM9200=y
 
 #
index 6e0805a971d78b39f500306a9e1049e46e13b8a1..08b5dc38876f2eafb6218b71a64fe85910484ea8 100644 (file)
@@ -103,6 +103,7 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
 # CONFIG_ARCH_IMX is not set
 # CONFIG_ARCH_H720X is not set
 # CONFIG_ARCH_AAEC2000 is not set
+CONFIG_ARCH_AT91=y
 CONFIG_ARCH_AT91RM9200=y
 
 #
index 69c39e098743b2cd7f6fb4defefc589ae3446b02..bee7813d040e8c7360deb5c4a496cc1da299ed82 100644 (file)
@@ -105,6 +105,7 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
 # CONFIG_ARCH_IMX is not set
 # CONFIG_ARCH_H720X is not set
 # CONFIG_ARCH_AAEC2000 is not set
+CONFIG_ARCH_AT91=y
 CONFIG_ARCH_AT91RM9200=y
 
 #
index 5ccd29a7c1fbd4b9f5861eb601e1239f54703e50..8a075c8ecc63d38a1839af27621dd357cca378ff 100644 (file)
@@ -82,6 +82,7 @@ CONFIG_OBSOLETE_MODPARM=y
 # CONFIG_ARCH_VERSATILE is not set
 # CONFIG_ARCH_IMX is not set
 # CONFIG_ARCH_H720X is not set
+CONFIG_ARCH_AT91=y
 CONFIG_ARCH_AT91RM9200=y
 
 #
index 94bd9932a4027eb465dc5262d68f7f226c761f84..3594155a81375eb0396352c1da17a72a5573fcf5 100644 (file)
@@ -103,6 +103,7 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
 # CONFIG_ARCH_IMX is not set
 # CONFIG_ARCH_H720X is not set
 # CONFIG_ARCH_AAEC2000 is not set
+CONFIG_ARCH_AT91=y
 CONFIG_ARCH_AT91RM9200=y
 
 #
index 1519124c550106c282dedb8ac12024e097a030bb..640d70c1f066e35922eec29c7ffd1a545ca4be99 100644 (file)
@@ -103,6 +103,7 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
 # CONFIG_ARCH_IMX is not set
 # CONFIG_ARCH_H720X is not set
 # CONFIG_ARCH_AAEC2000 is not set
+CONFIG_ARCH_AT91=y
 CONFIG_ARCH_AT91RM9200=y
 
 #
index 51ded20e3f64b7305606dda268d709d11ad1e61f..1db633e2c94073b158e485638585e9e3c54c3bd9 100644 (file)
@@ -105,6 +105,7 @@ CONFIG_DEFAULT_IOSCHED="deadline"
 # CONFIG_ARCH_IMX is not set
 # CONFIG_ARCH_H720X is not set
 # CONFIG_ARCH_AAEC2000 is not set
+CONFIG_ARCH_AT91=y
 CONFIG_ARCH_AT91RM9200=y
 
 #
index fee4f566452e74766363a4f69eb7697a5ea3f363..45396e08719689f8b87bb2a673b5f6dd4a830b83 100644 (file)
@@ -80,6 +80,7 @@ CONFIG_KMOD=y
 # CONFIG_ARCH_IMX is not set
 # CONFIG_ARCH_H720X is not set
 # CONFIG_ARCH_AAEC2000 is not set
+CONFIG_ARCH_AT91=y
 CONFIG_ARCH_AT91RM9200=y
 
 #
index ee3ecbd9002d0c9e890bdced3087da122b047902..05adb0b34e729a31fd1054553984b51fd11e0b5c 100644 (file)
@@ -1,19 +1,20 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.14
-# Wed Nov  9 18:53:40 2005
+# Linux kernel version: 2.6.17
+# Thu Jun 29 15:25:18 2006
 #
 CONFIG_ARM=y
 CONFIG_MMU=y
-CONFIG_UID16=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
 # Code maturity level options
 #
 CONFIG_EXPERIMENTAL=y
-CONFIG_CLEAN_COMPILE=y
 CONFIG_BROKEN_ON_SMP=y
 CONFIG_LOCK_KERNEL=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
@@ -29,26 +30,26 @@ CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
-# CONFIG_HOTPLUG is not set
-CONFIG_KOBJECT_UEVENT=y
 # CONFIG_IKCONFIG is not set
+# CONFIG_RELAY is not set
 CONFIG_INITRAMFS_SOURCE=""
+CONFIG_UID16=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 # CONFIG_EMBEDDED is not set
 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_EPOLL=y
-CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SHMEM=y
-CONFIG_CC_ALIGN_FUNCTIONS=0
-CONFIG_CC_ALIGN_LABELS=0
-CONFIG_CC_ALIGN_LOOPS=0
-CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_SLAB=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
 
 #
 # Loadable module support
@@ -56,7 +57,6 @@ CONFIG_BASE_SMALL=0
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_FORCE_UNLOAD is not set
-CONFIG_OBSOLETE_MODPARM=y
 # CONFIG_MODVERSIONS is not set
 # CONFIG_MODULE_SRCVERSION_ALL is not set
 # CONFIG_KMOD is not set
@@ -64,6 +64,7 @@ CONFIG_OBSOLETE_MODPARM=y
 #
 # Block layer
 #
+# CONFIG_BLK_DEV_IO_TRACE is not set
 
 #
 # IO Schedulers
@@ -81,16 +82,26 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
 #
 # 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_AT91RM9200 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_INTEGRATOR is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_IMX is not set
 # CONFIG_ARCH_IOP3XX is not set
 # CONFIG_ARCH_IXP4XX is not set
 # CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP23XX is not set
 # CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_PNX4008 is not set
 # CONFIG_ARCH_PXA is not set
 # CONFIG_ARCH_RPC is not set
 # CONFIG_ARCH_SA1100 is not set
@@ -98,11 +109,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
 # CONFIG_ARCH_SHARK is not set
 # CONFIG_ARCH_LH7A40X is not set
 CONFIG_ARCH_OMAP=y
-# CONFIG_ARCH_VERSATILE is not set
-# CONFIG_ARCH_REALVIEW is not set
-# CONFIG_ARCH_IMX is not set
-# CONFIG_ARCH_H720X is not set
-# CONFIG_ARCH_AAEC2000 is not set
 
 #
 # TI OMAP Implementations
@@ -141,6 +147,7 @@ CONFIG_ARCH_OMAP16XX=y
 CONFIG_MACH_OMAP_H2=y
 # CONFIG_MACH_OMAP_H3 is not set
 # CONFIG_MACH_OMAP_OSK is not set
+# CONFIG_MACH_NOKIA770 is not set
 # CONFIG_MACH_OMAP_GENERIC is not set
 
 #
@@ -177,7 +184,6 @@ CONFIG_ARM_THUMB=y
 #
 # Bus support
 #
-CONFIG_ISA_DMA_API=y
 
 #
 # PCCARD (PCMCIA/CardBus) support
@@ -189,6 +195,8 @@ CONFIG_ISA_DMA_API=y
 #
 CONFIG_PREEMPT=y
 CONFIG_NO_IDLE_HZ=y
+CONFIG_HZ=128
+# CONFIG_AEABI is not set
 # CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
 CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_FLATMEM_MANUAL=y
@@ -249,6 +257,8 @@ CONFIG_BINFMT_AOUT=y
 # Power management options
 #
 CONFIG_PM=y
+CONFIG_PM_LEGACY=y
+# CONFIG_PM_DEBUG is not set
 # CONFIG_APM is not set
 
 #
@@ -259,9 +269,12 @@ CONFIG_NET=y
 #
 # Networking options
 #
+# CONFIG_NETDEBUG is not set
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
+CONFIG_XFRM=y
+# CONFIG_XFRM_USER is not set
 # CONFIG_NET_KEY is not set
 CONFIG_INET=y
 # CONFIG_IP_MULTICAST is not set
@@ -278,12 +291,18 @@ CONFIG_IP_PNP_BOOTP=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_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
 CONFIG_TCP_CONG_BIC=y
 # 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
 
 #
@@ -295,6 +314,11 @@ CONFIG_TCP_CONG_BIC=y
 # SCTP Configuration (EXPERIMENTAL)
 #
 # CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+# CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
@@ -312,7 +336,6 @@ CONFIG_TCP_CONG_BIC=y
 # QoS and/or fair queueing
 #
 # CONFIG_NET_SCHED is not set
-# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -333,6 +356,12 @@ CONFIG_TCP_CONG_BIC=y
 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
 
 #
 # Memory Technology Devices (MTD)
@@ -526,6 +555,7 @@ CONFIG_SERIO_SERPORT=y
 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
 
 #
@@ -534,6 +564,7 @@ CONFIG_HW_CONSOLE=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
 # CONFIG_SERIAL_8250_EXTENDED is not set
 
 #
@@ -559,8 +590,8 @@ CONFIG_WATCHDOG_NOWAYOUT=y
 # Watchdog Device Drivers
 #
 # CONFIG_SOFT_WATCHDOG is not set
+# CONFIG_HW_RANDOM is not set
 # CONFIG_NVRAM is not set
-# CONFIG_RTC is not set
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 
@@ -572,6 +603,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y
 #
 # TPM devices
 #
+# CONFIG_TCG_TPM is not set
 # CONFIG_TELCLOCK is not set
 
 #
@@ -579,11 +611,23 @@ CONFIG_WATCHDOG_NOWAYOUT=y
 #
 # CONFIG_I2C is not set
 
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+
+#
+# Dallas's 1-wire bus
+#
+
 #
 # Hardware Monitoring support
 #
 CONFIG_HWMON=y
 # CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_ABITUGURU is not set
+# CONFIG_SENSORS_F71805F is not set
 # CONFIG_HWMON_DEBUG_CHIP is not set
 
 #
@@ -591,13 +635,23 @@ CONFIG_HWMON=y
 #
 
 #
-# Multimedia Capabilities Port drivers
+# LED devices
+#
+# CONFIG_NEW_LEDS is not set
+
+#
+# LED drivers
+#
+
+#
+# LED Triggers
 #
 
 #
 # Multimedia devices
 #
 # CONFIG_VIDEO_DEV is not set
+CONFIG_VIDEO_V4L2=y
 
 #
 # Digital Video Broadcasting Devices
@@ -607,11 +661,13 @@ CONFIG_HWMON=y
 #
 # Graphics support
 #
+CONFIG_FIRMWARE_EDID=y
 CONFIG_FB=y
 # CONFIG_FB_CFB_FILLRECT is not set
 # CONFIG_FB_CFB_COPYAREA is not set
 # CONFIG_FB_CFB_IMAGEBLIT is not set
 # CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
 CONFIG_FB_MODE_HELPERS=y
 # CONFIG_FB_TILEBLITTING is not set
 # CONFIG_FB_S1D13XXX is not set
@@ -635,7 +691,6 @@ CONFIG_FONT_8x16=y
 # CONFIG_FONT_SUN8x16 is not set
 # CONFIG_FONT_SUN12x22 is not set
 # CONFIG_FONT_10x18 is not set
-# CONFIG_FONT_RL is not set
 
 #
 # Logo configuration
@@ -660,16 +715,15 @@ CONFIG_SOUND=y
 # Open Sound System
 #
 CONFIG_SOUND_PRIME=y
-# CONFIG_OBSOLETE_OSS_DRIVER is not set
 # CONFIG_SOUND_MSNDCLAS is not set
 # CONFIG_SOUND_MSNDPIN is not set
-# CONFIG_SOUND_OSS is not set
 
 #
 # USB support
 #
 CONFIG_USB_ARCH_HAS_HCD=y
 CONFIG_USB_ARCH_HAS_OHCI=y
+# CONFIG_USB_ARCH_HAS_EHCI is not set
 # CONFIG_USB is not set
 
 #
@@ -680,23 +734,18 @@ CONFIG_USB_ARCH_HAS_OHCI=y
 # USB Gadget Support
 #
 # CONFIG_USB_GADGET is not set
-# CONFIG_USB_GADGET_NET2280 is not set
-# CONFIG_USB_GADGET_PXA2XX is not set
-# CONFIG_USB_GADGET_GOKU is not set
-# CONFIG_USB_GADGET_LH7A40X is not set
-# CONFIG_USB_GADGET_OMAP is not set
-# CONFIG_USB_GADGET_DUMMY_HCD is not set
-# CONFIG_USB_ZERO is not set
-# CONFIG_USB_ETH is not set
-# CONFIG_USB_GADGETFS is not set
-# CONFIG_USB_FILE_STORAGE is not set
-# CONFIG_USB_G_SERIAL is not set
 
 #
 # MMC/SD Card support
 #
 # CONFIG_MMC is not set
 
+#
+# Real Time Clock
+#
+CONFIG_RTC_LIB=y
+# CONFIG_RTC_CLASS is not set
+
 #
 # File systems
 #
@@ -704,14 +753,15 @@ CONFIG_EXT2_FS=y
 # CONFIG_EXT2_FS_XATTR is not set
 # CONFIG_EXT2_FS_XIP is not set
 # CONFIG_EXT3_FS is not set
-# CONFIG_JBD is not set
 # 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_OCFS2_FS is not set
 # CONFIG_MINIX_FS is not set
 CONFIG_ROMFS_FS=y
 CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
 # CONFIG_QUOTA is not set
 CONFIG_DNOTIFY=y
 # CONFIG_AUTOFS_FS is not set
@@ -741,7 +791,7 @@ CONFIG_SYSFS=y
 # CONFIG_TMPFS is not set
 # CONFIG_HUGETLB_PAGE is not set
 CONFIG_RAMFS=y
-# CONFIG_RELAYFS_FS is not set
+# CONFIG_CONFIGFS_FS is not set
 
 #
 # Miscellaneous filesystems
@@ -843,10 +893,13 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 # Kernel hacking
 #
 # CONFIG_PRINTK_TIME is not set
+# CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_DEBUG_KERNEL is not set
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_DEBUG_BUGVERBOSE=y
+# CONFIG_DEBUG_FS is not set
 CONFIG_FRAME_POINTER=y
+# CONFIG_UNWIND_INFO is not set
 # CONFIG_DEBUG_USER is not set
 
 #
index 5401c01caefe20df757f87683d52eafdc5919a3f..2b4a63be03f71543b63bb03ad2900532d2bd41f5 100644 (file)
@@ -85,6 +85,7 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
 # CONFIG_ARCH_INTEGRATOR is not set
 # CONFIG_ARCH_REALVIEW is not set
 # CONFIG_ARCH_VERSATILE is not set
+CONFIG_ARCH_AT91=y
 CONFIG_ARCH_AT91RM9200=y
 # CONFIG_ARCH_CLPS7500 is not set
 # CONFIG_ARCH_CLPS711X is not set
diff --git a/arch/arm/configs/trizeps4_defconfig b/arch/arm/configs/trizeps4_defconfig
new file mode 100644 (file)
index 0000000..a6698dc
--- /dev/null
@@ -0,0 +1,1579 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.17
+# Sat Jun 24 22:45:14 2006
+#
+CONFIG_ARM=y
+CONFIG_MMU=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_ARCH_MTD_XIP=y
+CONFIG_VECTORS_BASE=0xffff0000
+
+#
+# Code maturity level options
+#
+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_POSIX_MQUEUE=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_BSD_PROCESS_ACCT_V3=y
+CONFIG_SYSCTL=y
+CONFIG_AUDIT=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+# CONFIG_RELAY is not set
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_UID16=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_EMBEDDED=y
+CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_EXTRA_PASS=y
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SHMEM=y
+CONFIG_SLAB=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+CONFIG_OBSOLETE_INTERMODULE=y
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+# CONFIG_MODVERSIONS is not set
+CONFIG_MODULE_SRCVERSION_ALL=y
+CONFIG_KMOD=y
+
+#
+# Block layer
+#
+# CONFIG_BLK_DEV_IO_TRACE is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+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"
+
+#
+# System Type
+#
+# 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_INTEGRATOR is not set
+# CONFIG_ARCH_IOP3XX is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_L7200 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_OMAP is not set
+# CONFIG_ARCH_VERSATILE is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_AAEC2000 is not set
+# CONFIG_ARCH_AT91RM9200 is not set
+
+#
+# Intel PXA2xx Implementations
+#
+# 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=y
+CONFIG_MACH_TRIZEPS4_CONXS=y
+# CONFIG_MACH_TRIZEPS4_ANY is not set
+CONFIG_PXA27x=y
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_XSCALE=y
+CONFIG_CPU_32v5=y
+CONFIG_CPU_ABRT_EV5T=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_TLB_V4WBI=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+CONFIG_XSCALE_PMU=y
+
+#
+# Bus support
+#
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+CONFIG_PCCARD=m
+# CONFIG_PCMCIA_DEBUG is not set
+CONFIG_PCMCIA=m
+CONFIG_PCMCIA_LOAD_CIS=y
+CONFIG_PCMCIA_IOCTL=y
+
+#
+# PC-card bridges
+#
+CONFIG_PCMCIA_PXA2XX=m
+
+#
+# Kernel Features
+#
+CONFIG_PREEMPT=y
+# CONFIG_NO_IDLE_HZ is not set
+CONFIG_HZ=100
+# CONFIG_AEABI is not set
+# 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_SPLIT_PTLOCK_CPUS=4096
+CONFIG_LEDS=y
+CONFIG_LEDS_TIMER=y
+CONFIG_LEDS_CPU=y
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0
+CONFIG_ZBOOT_ROM_BSS=0
+CONFIG_CMDLINE="root=/dev/nfs ip=bootp console=ttyS0,115200n8"
+# CONFIG_XIP_KERNEL is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_FPE_NWFPE=y
+CONFIG_FPE_NWFPE_XP=y
+# CONFIG_FPE_FASTFPE is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_MISC=m
+# CONFIG_ARTHUR is not set
+
+#
+# Power management options
+#
+CONFIG_PM=y
+CONFIG_PM_LEGACY=y
+# CONFIG_PM_DEBUG is not set
+CONFIG_APM=y
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+# CONFIG_NETDEBUG is not set
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=m
+CONFIG_NET_KEY=y
+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 is not set
+# 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_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_BIC=y
+
+#
+# IP: Virtual Server Configuration
+#
+# CONFIG_IP_VS is not set
+CONFIG_IPV6=m
+# CONFIG_IPV6_PRIVACY is not set
+# CONFIG_IPV6_ROUTER_PREF is not set
+# CONFIG_INET6_AH is not set
+# CONFIG_INET6_ESP is not set
+# CONFIG_INET6_IPCOMP is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+# CONFIG_IPV6_TUNNEL is not set
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+
+#
+# Core Netfilter Configuration
+#
+# CONFIG_NETFILTER_NETLINK is not set
+# CONFIG_NETFILTER_XTABLES is not set
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_IP_NF_CONNTRACK=m
+CONFIG_IP_NF_CT_ACCT=y
+CONFIG_IP_NF_CONNTRACK_MARK=y
+# CONFIG_IP_NF_CONNTRACK_EVENTS is not set
+# CONFIG_IP_NF_CT_PROTO_SCTP is not set
+CONFIG_IP_NF_FTP=m
+CONFIG_IP_NF_IRC=m
+# CONFIG_IP_NF_NETBIOS_NS is not set
+CONFIG_IP_NF_TFTP=m
+CONFIG_IP_NF_AMANDA=m
+# CONFIG_IP_NF_PPTP is not set
+# CONFIG_IP_NF_H323 is not set
+CONFIG_IP_NF_QUEUE=m
+
+#
+# IPv6: Netfilter Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP6_NF_QUEUE is not set
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_DCCP is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+CONFIG_VLAN_8021Q=m
+# 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_NET_DIVERT 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_IRNET=m
+CONFIG_IRCOMM=m
+CONFIG_IRDA_ULTRA=y
+
+#
+# IrDA options
+#
+CONFIG_IRDA_CACHE_LAST_LSAP=y
+CONFIG_IRDA_FAST_RR=y
+# 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_USB_IRDA is not set
+# CONFIG_SIGMATEL_FIR is not set
+# CONFIG_PXA_FICP is not set
+CONFIG_BT=m
+CONFIG_BT_L2CAP=m
+CONFIG_BT_SCO=m
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=m
+
+#
+# Bluetooth device drivers
+#
+# CONFIG_BT_HCIUSB 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_HCIDTL1 is not set
+# CONFIG_BT_HCIBT3C is not set
+# CONFIG_BT_HCIBLUECARD is not set
+# CONFIG_BT_HCIBTUART is not set
+# CONFIG_BT_HCIVHCI is not set
+CONFIG_IEEE80211=m
+# CONFIG_IEEE80211_DEBUG is not set
+CONFIG_IEEE80211_CRYPT_WEP=m
+CONFIG_IEEE80211_CRYPT_CCMP=m
+CONFIG_IEEE80211_CRYPT_TKIP=m
+CONFIG_IEEE80211_SOFTMAC=m
+# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
+CONFIG_WIRELESS_EXT=y
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+CONFIG_CONNECTOR=y
+CONFIG_PROC_EVENTS=y
+
+#
+# Memory Technology Devices (MTD)
+#
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=y
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_REDBOOT_PARTS=y
+CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
+CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
+CONFIG_MTD_REDBOOT_PARTS_READONLY=y
+# CONFIG_MTD_CMDLINE_PARTS is not set
+# CONFIG_MTD_AFS_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+CONFIG_NFTL=y
+CONFIG_NFTL_RW=y
+CONFIG_INFTL=y
+# CONFIG_RFD_FTL is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+CONFIG_MTD_JEDECPROBE=y
+CONFIG_MTD_GEN_PROBE=y
+CONFIG_MTD_CFI_ADV_OPTIONS=y
+# CONFIG_MTD_CFI_NOSWAP is not set
+# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
+CONFIG_MTD_CFI_LE_BYTE_SWAP=y
+CONFIG_MTD_CFI_GEOMETRY=y
+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_OTP is not set
+CONFIG_MTD_CFI_INTELEXT=y
+CONFIG_MTD_CFI_AMDSTD=y
+# CONFIG_MTD_CFI_STAA is not set
+CONFIG_MTD_CFI_UTIL=y
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+# CONFIG_MTD_OBSOLETE_CHIPS is not set
+# CONFIG_MTD_XIP is not set
+
+#
+# Mapping drivers for chip access
+#
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_PHYSMAP_START=0x0
+CONFIG_MTD_PHYSMAP_LEN=0x4000000
+CONFIG_MTD_PHYSMAP_BANKWIDTH=2
+# CONFIG_MTD_TRIZEPS4 is not set
+# CONFIG_MTD_ARM_INTEGRATOR is not set
+# CONFIG_MTD_IMPA7 is not set
+# CONFIG_MTD_SHARP_SL is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_DATAFLASH is not set
+# CONFIG_MTD_M25P80 is not set
+# 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=y
+CONFIG_MTD_DOCPROBE=y
+CONFIG_MTD_DOCECC=y
+# CONFIG_MTD_DOCPROBE_ADVANCED is not set
+CONFIG_MTD_DOCPROBE_ADDRESS=0
+
+#
+# NAND Flash Device Drivers
+#
+CONFIG_MTD_NAND=y
+# CONFIG_MTD_NAND_VERIFY_WRITE is not set
+# CONFIG_MTD_NAND_H1900 is not set
+CONFIG_MTD_NAND_IDS=y
+CONFIG_MTD_NAND_DISKONCHIP=y
+# CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set
+CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0
+# CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE is not set
+# CONFIG_MTD_NAND_SHARPSL is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+
+#
+# OneNAND Flash Device Drivers
+#
+# CONFIG_MTD_ONENAND is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Plug and Play support
+#
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+CONFIG_BLK_DEV_NBD=y
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=4
+CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+CONFIG_IDE=y
+CONFIG_BLK_DEV_IDE=y
+
+#
+# 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=y
+CONFIG_BLK_DEV_IDECS=m
+# CONFIG_BLK_DEV_IDECD is not set
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDEFLOPPY is not set
+# CONFIG_BLK_DEV_IDESCSI is not set
+# CONFIG_IDE_TASK_IOCTL is not set
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=y
+CONFIG_IDE_PXA_CF=y
+CONFIG_IDE_ARM=y
+# CONFIG_BLK_DEV_IDEDMA is not set
+# CONFIG_IDEDMA_AUTO is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=m
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=m
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+CONFIG_CHR_DEV_SG=m
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+CONFIG_SCSI_MULTI_LUN=y
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+
+#
+# SCSI Transport Attributes
+#
+# 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
+
+#
+# SCSI low-level drivers
+#
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_SCSI_SATA is not set
+# CONFIG_SCSI_DEBUG is not set
+
+#
+# PCMCIA SCSI adapter support
+#
+# CONFIG_PCMCIA_AHA152X is not set
+# CONFIG_PCMCIA_FDOMAIN is not set
+# CONFIG_PCMCIA_NINJA_SCSI is not set
+# CONFIG_PCMCIA_QLOGIC is not set
+# CONFIG_PCMCIA_SYM53C500 is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+
+#
+# I2O device support
+#
+
+#
+# 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
+
+#
+# PHY device support
+#
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+CONFIG_DAVICOM_PHY=y
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_SMC91X is not set
+CONFIG_DM9000=y
+
+#
+# Ethernet (1000 Mbit)
+#
+
+#
+# Ethernet (10000 Mbit)
+#
+
+#
+# Token Ring devices
+#
+
+#
+# Wireless LAN (non-hamradio)
+#
+CONFIG_NET_RADIO=y
+# CONFIG_NET_WIRELESS_RTNETLINK is not set
+
+#
+# Obsolete Wireless cards support (pre-802.11)
+#
+# CONFIG_STRIP is not set
+# CONFIG_PCMCIA_WAVELAN is not set
+# CONFIG_PCMCIA_NETWAVE is not set
+
+#
+# Wireless 802.11 Frequency Hopping cards support
+#
+# CONFIG_PCMCIA_RAYCS is not set
+
+#
+# Wireless 802.11b ISA/PCI cards support
+#
+CONFIG_HERMES=m
+# CONFIG_ATMEL is not set
+
+#
+# Wireless 802.11b Pcmcia/Cardbus cards support
+#
+CONFIG_PCMCIA_HERMES=m
+# CONFIG_PCMCIA_SPECTRUM is not set
+CONFIG_AIRO_CS=m
+# CONFIG_PCMCIA_WL3501 is not set
+CONFIG_HOSTAP=m
+CONFIG_HOSTAP_FIRMWARE=y
+CONFIG_HOSTAP_FIRMWARE_NVRAM=y
+CONFIG_HOSTAP_CS=m
+CONFIG_NET_WIRELESS=y
+
+#
+# PCMCIA network device support
+#
+# CONFIG_NET_PCMCIA is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_MPPE=m
+# CONFIG_PPPOE 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
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=640
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=480
+# CONFIG_INPUT_JOYDEV is not set
+CONFIG_INPUT_TSDEV=y
+CONFIG_INPUT_TSDEV_SCREEN_X=640
+CONFIG_INPUT_TSDEV_SCREEN_Y=480
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# 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_INPUT_MOUSE=y
+# CONFIG_MOUSE_PS2 is not set
+CONFIG_MOUSE_SERIAL=y
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_INPUT_JOYSTICK is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+# CONFIG_TOUCHSCREEN_ADS7846 is not set
+# 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_INPUT_MISC=y
+CONFIG_INPUT_UINPUT=m
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_SERPORT=y
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# 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=y
+CONFIG_LEGACY_PTY_COUNT=256
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_SA1100_WATCHDOG=y
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+# CONFIG_NVRAM is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+
+#
+# PCMCIA character devices
+#
+# CONFIG_SYNCLINK_CS is not set
+# CONFIG_CARDMAN_4000 is not set
+# CONFIG_CARDMAN_4040 is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+
+#
+# I2C support
+#
+CONFIG_I2C=y
+CONFIG_I2C_CHARDEV=y
+
+#
+# I2C Algorithms
+#
+# CONFIG_I2C_ALGOBIT is not set
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+
+#
+# I2C Hardware Bus support
+#
+CONFIG_I2C_PXA=y
+CONFIG_I2C_PXA_SLAVE=y
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_PCA_ISA is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_SENSORS_DS1337 is not set
+# CONFIG_SENSORS_DS1374 is not set
+CONFIG_SENSORS_EEPROM=m
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+# CONFIG_SPI_BITBANG is not set
+CONFIG_SPI_PXA2XX=m
+
+#
+# SPI Protocol Masters
+#
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Hardware Monitoring support
+#
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_ADM1026 is not set
+# CONFIG_SENSORS_ADM1031 is not set
+# CONFIG_SENSORS_ADM9240 is not set
+# CONFIG_SENSORS_ASB100 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_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_LM63 is not set
+# CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM77 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM87 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_LM92 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83792D is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
+# Misc devices
+#
+
+#
+# Multimedia Capabilities Port drivers
+#
+CONFIG_UCB1400=y
+CONFIG_UCB1400_TS=y
+
+#
+# LED devices
+#
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+
+#
+# LED drivers
+#
+
+#
+# LED Triggers
+#
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_IDE_DISK=y
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+CONFIG_VIDEO_V4L2=y
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+# CONFIG_USB_DABUSB is not set
+
+#
+# Graphics support
+#
+CONFIG_FB=y
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_MACMODES is not set
+CONFIG_FB_FIRMWARE_EDID=y
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+# CONFIG_FB_S1D13XXX is not set
+CONFIG_FB_PXA=y
+# CONFIG_FB_PXA_PARAMETERS is not set
+# CONFIG_FB_VIRTUAL is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
+CONFIG_FONTS=y
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+# CONFIG_FONT_6x11 is not set
+# 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
+
+#
+# Logo configuration
+#
+CONFIG_LOGO=y
+CONFIG_LOGO_LINUX_MONO=y
+CONFIG_LOGO_LINUX_VGA16=y
+CONFIG_LOGO_LINUX_CLUT224=y
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+CONFIG_BACKLIGHT_DEVICE=y
+CONFIG_LCD_CLASS_DEVICE=y
+CONFIG_LCD_DEVICE=y
+
+#
+# Sound
+#
+CONFIG_SOUND=y
+
+#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=y
+CONFIG_SND_TIMER=y
+CONFIG_SND_PCM=y
+CONFIG_SND_HWDEP=m
+CONFIG_SND_RAWMIDI=m
+CONFIG_SND_SEQUENCER=m
+# CONFIG_SND_SEQ_DUMMY 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_SEQUENCER_OSS is not set
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+CONFIG_SND_VERBOSE_PROCFS=y
+CONFIG_SND_VERBOSE_PRINTK=y
+# CONFIG_SND_DEBUG is not set
+
+#
+# Generic devices
+#
+CONFIG_SND_AC97_CODEC=y
+CONFIG_SND_AC97_BUS=y
+# 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
+
+#
+# ALSA ARM devices
+#
+CONFIG_SND_PXA2XX_PCM=y
+CONFIG_SND_PXA2XX_AC97=y
+
+#
+# USB devices
+#
+CONFIG_SND_USB_AUDIO=m
+
+#
+# PCMCIA devices
+#
+# CONFIG_SND_VXPOCKET is not set
+# CONFIG_SND_PDAUDIOCF is not set
+
+#
+# Open Sound System
+#
+# CONFIG_SOUND_PRIME is not set
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+# CONFIG_USB_ARCH_HAS_EHCI is not set
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_BANDWIDTH is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_SUSPEND is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_ISP116X_HCD is not set
+CONFIG_USB_OHCI_HCD=y
+# CONFIG_USB_OHCI_BIG_ENDIAN is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+# CONFIG_USB_SL811_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=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 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_LIBUSUAL is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=m
+CONFIG_USB_HIDINPUT=y
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
+# CONFIG_HID_FF is not set
+# CONFIG_USB_HIDDEV is not set
+
+#
+# USB HID Boot Protocol drivers
+#
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+# CONFIG_USB_AIPTEK is not set
+# CONFIG_USB_WACOM is not set
+# CONFIG_USB_ACECAD is not set
+# CONFIG_USB_KBTAB is not set
+# CONFIG_USB_POWERMATE is not set
+CONFIG_USB_TOUCHSCREEN=m
+# CONFIG_USB_TOUCHSCREEN_EGALAX is not set
+# CONFIG_USB_TOUCHSCREEN_PANJIT is not set
+# CONFIG_USB_TOUCHSCREEN_3M is not set
+# CONFIG_USB_TOUCHSCREEN_ITM is not set
+# CONFIG_USB_YEALINK is not set
+# CONFIG_USB_XPAD is not set
+# CONFIG_USB_ATI_REMOTE is not set
+# CONFIG_USB_ATI_REMOTE2 is not set
+# CONFIG_USB_KEYSPAN_REMOTE is not set
+# CONFIG_USB_APPLETOUCH is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
+# CONFIG_USB_ZD1201 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_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGETKIT is not set
+# CONFIG_USB_PHIDGETSERVO is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TEST is not set
+
+#
+# USB DSL modem support
+#
+
+#
+# USB Gadget Support
+#
+CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_NET2280 is not set
+# CONFIG_USB_GADGET_PXA2XX is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_AT91 is not set
+CONFIG_USB_GADGET_DUMMY_HCD=y
+CONFIG_USB_DUMMY_HCD=y
+CONFIG_USB_GADGET_DUALSPEED=y
+# CONFIG_USB_ZERO is not set
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_RNDIS=y
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_FILE_STORAGE=m
+# CONFIG_USB_FILE_STORAGE_TEST is not set
+CONFIG_USB_G_SERIAL=m
+
+#
+# MMC/SD Card support
+#
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_PXA=y
+
+#
+# Real Time Clock
+#
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+
+#
+# RTC drivers
+#
+# CONFIG_RTC_DRV_X1205 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_PCF8563 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+CONFIG_RTC_DRV_SA1100=y
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+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
+CONFIG_FS_POSIX_ACL=y
+# CONFIG_XFS_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_QUOTA is not set
+CONFIG_DNOTIFY=y
+# CONFIG_AUTOFS_FS is not set
+CONFIG_AUTOFS4_FS=y
+# 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_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-15"
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# 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_JFFS_FS=y
+CONFIG_JFFS_FS_VERBOSE=0
+CONFIG_JFFS_PROC_FS=y
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_SUMMARY is not set
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+# CONFIG_JFFS2_CMODE_NONE is not set
+CONFIG_JFFS2_CMODE_PRIORITY=y
+# CONFIG_JFFS2_CMODE_SIZE 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=y
+CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+# CONFIG_NFS_DIRECTIO is not set
+CONFIG_NFSD=y
+CONFIG_NFSD_V2_ACL=y
+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=y
+CONFIG_NFS_ACL_SUPPORT=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+CONFIG_SMB_FS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_XATTR 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
+# CONFIG_9P_FS is not set
+
+#
+# Partition Types
+#
+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=y
+# CONFIG_LDM_DEBUG 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
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-15"
+CONFIG_NLS_CODEPAGE_437=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+CONFIG_NLS_CODEPAGE_850=y
+# 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=y
+CONFIG_NLS_ISO8859_1=m
+# 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=m
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+CONFIG_NLS_UTF8=m
+
+#
+# Profiling support
+#
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=y
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_DEBUG_KERNEL is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_FS is not set
+CONFIG_FRAME_POINTER=y
+# CONFIG_UNWIND_INFO is not set
+CONFIG_DEBUG_USER=y
+
+#
+# Security options
+#
+CONFIG_KEYS=y
+CONFIG_KEYS_DEBUG_PROC_KEYS=y
+CONFIG_SECURITY=y
+# CONFIG_SECURITY_NETWORK is not set
+CONFIG_SECURITY_CAPABILITIES=y
+# CONFIG_SECURITY_ROOTPLUG is not set
+# CONFIG_SECURITY_SECLVL is not set
+
+#
+# Cryptographic options
+#
+CONFIG_CRYPTO=y
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_NULL is not set
+CONFIG_CRYPTO_MD4=y
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+# CONFIG_CRYPTO_WP512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+# CONFIG_CRYPTO_SERPENT is not set
+CONFIG_CRYPTO_AES=m
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_TEA is not set
+CONFIG_CRYPTO_ARC4=m
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+CONFIG_CRYPTO_DEFLATE=m
+CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_CRC32C=y
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Hardware crypto devices
+#
+
+#
+# Library routines
+#
+CONFIG_CRC_CCITT=y
+CONFIG_CRC16=y
+CONFIG_CRC32=y
+CONFIG_LIBCRC32C=y
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_REED_SOLOMON=y
+CONFIG_REED_SOLOMON_DEC16=y
index 7cffbaef064ba60afcec20ca02638ebf70b89a9a..f0c0cdb1c183ff57f0202c36b8d7b3035052fee1 100644 (file)
@@ -25,7 +25,7 @@ obj-$(CONFIG_OABI_COMPAT)     += sys_oabi-compat.o
 obj-$(CONFIG_CRUNCH)           += crunch.o crunch-bits.o
 AFLAGS_crunch-bits.o           := -Wa,-mcpu=ep9312
 
-obj-$(CONFIG_IWMMXT)           += iwmmxt.o
+obj-$(CONFIG_IWMMXT)           += iwmmxt.o iwmmxt-notifier.o
 AFLAGS_iwmmxt.o                        := -Wa,-mcpu=iwmmxt
 
 ifneq ($(CONFIG_ARCH_EBSA110),y)
index 2bed290fec76b4522bee0befb6812f141f82aaab..33c55689f999ea3f7bcd6f4955d339b4d08fd343 100644 (file)
@@ -10,7 +10,6 @@
  * [This document is available from Microsoft at:
  *    http://www.microsoft.com/hwdev/busbios/amp_12.htm]
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/poll.h>
 #include <linux/timer.h>
index 447ede5143a8f7bf16f3b0ea48d0ebd500d5a3ca..cc2d58d028e17b10b1decb656315f71f27267cc9 100644 (file)
@@ -105,6 +105,7 @@ int main(void)
   BLANK();
   DEFINE(PROC_INFO_SZ,         sizeof(struct proc_info_list));
   DEFINE(PROCINFO_INITFUNC,    offsetof(struct proc_info_list, __cpu_flush));
-  DEFINE(PROCINFO_MMUFLAGS,    offsetof(struct proc_info_list, __cpu_mmu_flags));
+  DEFINE(PROCINFO_MM_MMUFLAGS, offsetof(struct proc_info_list, __cpu_mm_mmu_flags));
+  DEFINE(PROCINFO_IO_MMUFLAGS, offsetof(struct proc_info_list, __cpu_io_mmu_flags));
   return 0; 
 }
index 45da06fc1ba1a1481f66e102e0fc582aaa2096f5..964faac104fb05a51b96e2de0be2137d30df6594 100644 (file)
@@ -5,7 +5,6 @@
  *
  *  Bits taken from various places.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
index 60cfa7f3226cec9e81f1735807bc3a4a364e4850..0a1385442f4344548bf20c5c0b28090f743e12b3 100644 (file)
@@ -15,7 +15,6 @@
  *  the kernel for 5 years from now (2001). This will allow boot loaders
  *  to convert to the new struct tag way.
  */
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
index da280bae3d0797f4071dccaff162db2304e8c6e4..a5747e58a9dc66d37e0b7182b7f06be2795257a0 100644 (file)
@@ -9,7 +9,6 @@
  *
  *  32-bit debugging code
  */
-#include <linux/config.h>
 #include <linux/linkage.h>
 
                .text
index 00aa225e8d95ede70807e0f901bdb89d6da757a8..b9a74a741d005db9e02243e396b8a4403d4939b1 100644 (file)
@@ -27,7 +27,6 @@
  */
 #define ECARD_C
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
@@ -620,7 +619,7 @@ ecard_irqexp_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *reg
                ecard_t *ec = slot_to_ecard(slot);
 
                if (ec->claimed) {
-                       struct irqdesc *d = irqdesc + ec->irq;
+                       struct irq_desc *d = irq_desc + ec->irq;
                        /*
                         * this ugly code is so that we can operate a
                         * prioritorising system:
@@ -884,7 +883,7 @@ static ssize_t ecard_show_resources(struct device *dev, struct device_attribute
        int i;
 
        for (i = 0; i < ECARD_NUM_RESOURCES; i++)
-               str += sprintf(str, "%08lx %08lx %08lx\n",
+               str += sprintf(str, "%08x %08x %08lx\n",
                                ec->resource[i].start,
                                ec->resource[i].end,
                                ec->resource[i].flags);
index 6423a38839b8b4e86f6105399e209e00ce8f607c..7ea5f01dfc7bebfb1417834ce1be2c74330b86f4 100644 (file)
@@ -14,7 +14,6 @@
  *  Note:  there is a StrongARM bug in the STMIA rn, {regs}^ instruction that causes
  *  it to save wrong values...  Be aware!
  */
-#include <linux/config.h>
 
 #include <asm/memory.h>
 #include <asm/glue.h>
@@ -590,9 +589,7 @@ ENTRY(__switch_to)
 #ifdef CONFIG_MMU
        mcr     p15, 0, r6, c3, c0, 0           @ Set domain register
 #endif
-#if defined(CONFIG_IWMMXT)
-       bl      iwmmxt_task_switch
-#elif defined(CONFIG_CPU_XSCALE)
+#if defined(CONFIG_CPU_XSCALE) && !defined(CONFIG_IWMMXT)
        add     r4, r2, #TI_CPU_DOMAIN + 40     @ cpu_context_save->extra
        ldmib   r4, {r4, r5}
        mar     acc0, r4, r5
index 75af6d6e2f28df15e50847f76c59786a949ff7a3..6f5e7c50d42ff2d78bd9b29d050f9902904f1af7 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.
  */
-#include <linux/config.h>
 
 #include <asm/unistd.h>
 
index f1c2fd5b63e40beb0e990148a2cd2be5fde2c139..87ab4e157997f9f335d461c501964750a52296d2 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/linkage.h>
 
index 1ec3f7faa259eedba5ccf3973ca827fb869cdfcd..e8e90346f11c10702857a04adeb4fd2f935e1336 100644 (file)
@@ -38,6 +38,7 @@
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
+#include <linux/interrupt.h>
 #include <linux/seq_file.h>
 
 #include <asm/cacheflush.h>
index 2af7e44218af77d3f5f4864710818f45f89bcec3..ac9eb3d30518ade76e1b01965fb969d90f856950 100644 (file)
@@ -12,7 +12,6 @@
  *    for 32-bit CPUs which has a process ID register(CP15).
  *
  */
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <linux/init.h>
 
index 330b9476c398d63856c7daa8ab5aaf2378f0d667..2242f5f7cb7ddf5f8dc02c3c78e02617e5ad3b5e 100644 (file)
@@ -11,7 +11,6 @@
  *
  *  Kernel startup code for all 32-bit CPUs
  */
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <linux/init.h>
 
@@ -221,7 +220,7 @@ __create_page_tables:
        teq     r0, r6
        bne     1b
 
-       ldr     r7, [r10, #PROCINFO_MMUFLAGS]   @ mmuflags
+       ldr     r7, [r10, #PROCINFO_MM_MMUFLAGS] @ mm_mmuflags
 
        /*
         * Create identity mapping for first MB of kernel to
@@ -272,8 +271,7 @@ __create_page_tables:
 #endif
 
 #ifdef CONFIG_DEBUG_LL
-       bic     r7, r7, #0x0c                   @ turn off cacheable
-                                               @ and bufferable bits
+       ldr     r7, [r10, #PROCINFO_IO_MMUFLAGS] @ io_mmuflags
        /*
         * Map in IO space for serial debugging.
         * This allows debug messages to be output
index ec20f8935e8bec809649bafc5fd0d80f212d9861..c3d4e94ef5bf1c41f36f199dbe806ebb50e068c5 100644 (file)
  *  IRQ's are in fact implemented a bit like signal handlers for the kernel.
  *  Naturally it's not a 1:1 relation, but there are similarities.
  */
-#include <linux/config.h>
 #include <linux/kernel_stat.h>
 #include <linux/module.h>
 #include <linux/signal.h>
 #include <linux/ioport.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/ptrace.h>
 #include <linux/slab.h>
 #include <linux/random.h>
 #include <linux/kallsyms.h>
 #include <linux/proc_fs.h>
 
-#include <asm/irq.h>
 #include <asm/system.h>
-#include <asm/mach/irq.h>
 #include <asm/mach/time.h>
 
-/*
- * Maximum IRQ count.  Currently, this is arbitary.  However, it should
- * not be set too low to prevent false triggering.  Conversely, if it
- * is set too high, then you could miss a stuck IRQ.
- *
- * Maybe we ought to set a timer and re-enable the IRQ at a later time?
- */
-#define MAX_IRQ_CNT    100000
-
-static int noirqdebug __read_mostly;
-static volatile unsigned long irq_err_count;
-static DEFINE_SPINLOCK(irq_controller_lock);
-static LIST_HEAD(irq_pending);
-
-struct irqdesc irq_desc[NR_IRQS];
-void (*init_arch_irq)(void) __initdata = NULL;
-
 /*
  * No architecture-specific irq_finish function defined in arm/arch/irqs.h.
  */
@@ -67,163 +48,8 @@ void (*init_arch_irq)(void) __initdata = NULL;
 #define irq_finish(irq) do { } while (0)
 #endif
 
-/*
- * Dummy mask/unmask handler
- */
-void dummy_mask_unmask_irq(unsigned int irq)
-{
-}
-
-irqreturn_t no_action(int irq, void *dev_id, struct pt_regs *regs)
-{
-       return IRQ_NONE;
-}
-
-void do_bad_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
-{
-       irq_err_count++;
-       printk(KERN_ERR "IRQ: spurious interrupt %d\n", irq);
-}
-
-static struct irqchip bad_chip = {
-       .ack    = dummy_mask_unmask_irq,
-       .mask   = dummy_mask_unmask_irq,
-       .unmask = dummy_mask_unmask_irq,
-};
-
-static struct irqdesc bad_irq_desc = {
-       .chip           = &bad_chip,
-       .handle         = do_bad_IRQ,
-       .pend           = LIST_HEAD_INIT(bad_irq_desc.pend),
-       .disable_depth  = 1,
-};
-
-#ifdef CONFIG_SMP
-void synchronize_irq(unsigned int irq)
-{
-       struct irqdesc *desc = irq_desc + irq;
-
-       while (desc->running)
-               barrier();
-}
-EXPORT_SYMBOL(synchronize_irq);
-
-#define smp_set_running(desc)  do { desc->running = 1; } while (0)
-#define smp_clear_running(desc)        do { desc->running = 0; } while (0)
-#else
-#define smp_set_running(desc)  do { } while (0)
-#define smp_clear_running(desc)        do { } while (0)
-#endif
-
-/**
- *     disable_irq_nosync - disable an irq without waiting
- *     @irq: Interrupt to disable
- *
- *     Disable the selected interrupt line.  Enables and disables
- *     are nested.  We do this lazily.
- *
- *     This function may be called from IRQ context.
- */
-void disable_irq_nosync(unsigned int irq)
-{
-       struct irqdesc *desc = irq_desc + irq;
-       unsigned long flags;
-
-       spin_lock_irqsave(&irq_controller_lock, flags);
-       desc->disable_depth++;
-       list_del_init(&desc->pend);
-       spin_unlock_irqrestore(&irq_controller_lock, flags);
-}
-EXPORT_SYMBOL(disable_irq_nosync);
-
-/**
- *     disable_irq - disable an irq and wait for completion
- *     @irq: Interrupt to disable
- *
- *     Disable the selected interrupt line.  Enables and disables
- *     are nested.  This functions waits for any pending IRQ
- *     handlers for this interrupt to complete before returning.
- *     If you use this function while holding a resource the IRQ
- *     handler may need you will deadlock.
- *
- *     This function may be called - with care - from IRQ context.
- */
-void disable_irq(unsigned int irq)
-{
-       struct irqdesc *desc = irq_desc + irq;
-
-       disable_irq_nosync(irq);
-       if (desc->action)
-               synchronize_irq(irq);
-}
-EXPORT_SYMBOL(disable_irq);
-
-/**
- *     enable_irq - enable interrupt handling on an irq
- *     @irq: Interrupt to enable
- *
- *     Re-enables the processing of interrupts on this IRQ line.
- *     Note that this may call the interrupt handler, so you may
- *     get unexpected results if you hold IRQs disabled.
- *
- *     This function may be called from IRQ context.
- */
-void enable_irq(unsigned int irq)
-{
-       struct irqdesc *desc = irq_desc + irq;
-       unsigned long flags;
-
-       spin_lock_irqsave(&irq_controller_lock, flags);
-       if (unlikely(!desc->disable_depth)) {
-               printk("enable_irq(%u) unbalanced from %p\n", irq,
-                       __builtin_return_address(0));
-       } else if (!--desc->disable_depth) {
-               desc->probing = 0;
-               desc->chip->unmask(irq);
-
-               /*
-                * If the interrupt is waiting to be processed,
-                * try to re-run it.  We can't directly run it
-                * from here since the caller might be in an
-                * interrupt-protected region.
-                */
-               if (desc->pending && list_empty(&desc->pend)) {
-                       desc->pending = 0;
-                       if (!desc->chip->retrigger ||
-                           desc->chip->retrigger(irq))
-                               list_add(&desc->pend, &irq_pending);
-               }
-       }
-       spin_unlock_irqrestore(&irq_controller_lock, flags);
-}
-EXPORT_SYMBOL(enable_irq);
-
-/*
- * Enable wake on selected irq
- */
-void enable_irq_wake(unsigned int irq)
-{
-       struct irqdesc *desc = irq_desc + irq;
-       unsigned long flags;
-
-       spin_lock_irqsave(&irq_controller_lock, flags);
-       if (desc->chip->set_wake)
-               desc->chip->set_wake(irq, 1);
-       spin_unlock_irqrestore(&irq_controller_lock, flags);
-}
-EXPORT_SYMBOL(enable_irq_wake);
-
-void disable_irq_wake(unsigned int irq)
-{
-       struct irqdesc *desc = irq_desc + irq;
-       unsigned long flags;
-
-       spin_lock_irqsave(&irq_controller_lock, flags);
-       if (desc->chip->set_wake)
-               desc->chip->set_wake(irq, 0);
-       spin_unlock_irqrestore(&irq_controller_lock, flags);
-}
-EXPORT_SYMBOL(disable_irq_wake);
+void (*init_arch_irq)(void) __initdata = NULL;
+unsigned long irq_err_count;
 
 int show_interrupts(struct seq_file *p, void *v)
 {
@@ -243,8 +69,8 @@ int show_interrupts(struct seq_file *p, void *v)
        }
 
        if (i < NR_IRQS) {
-               spin_lock_irqsave(&irq_controller_lock, flags);
-               action = irq_desc[i].action;
+               spin_lock_irqsave(&irq_desc[i].lock, flags);
+               action = irq_desc[i].action;
                if (!action)
                        goto unlock;
 
@@ -257,7 +83,7 @@ int show_interrupts(struct seq_file *p, void *v)
 
                seq_putc(p, '\n');
 unlock:
-               spin_unlock_irqrestore(&irq_controller_lock, flags);
+               spin_unlock_irqrestore(&irq_desc[i].lock, flags);
        } else if (i == NR_IRQS) {
 #ifdef CONFIG_ARCH_ACORN
                show_fiq_list(p, v);
@@ -271,267 +97,11 @@ unlock:
        return 0;
 }
 
-/*
- * IRQ lock detection.
- *
- * Hopefully, this should get us out of a few locked situations.
- * However, it may take a while for this to happen, since we need
- * a large number if IRQs to appear in the same jiffie with the
- * same instruction pointer (or within 2 instructions).
- */
-static int check_irq_lock(struct irqdesc *desc, int irq, struct pt_regs *regs)
-{
-       unsigned long instr_ptr = instruction_pointer(regs);
-
-       if (desc->lck_jif == jiffies &&
-           desc->lck_pc >= instr_ptr && desc->lck_pc < instr_ptr + 8) {
-               desc->lck_cnt += 1;
-
-               if (desc->lck_cnt > MAX_IRQ_CNT) {
-                       printk(KERN_ERR "IRQ LOCK: IRQ%d is locking the system, disabled\n", irq);
-                       return 1;
-               }
-       } else {
-               desc->lck_cnt = 0;
-               desc->lck_pc  = instruction_pointer(regs);
-               desc->lck_jif = jiffies;
-       }
-       return 0;
-}
-
-static void
-report_bad_irq(unsigned int irq, struct pt_regs *regs, struct irqdesc *desc, int ret)
-{
-       static int count = 100;
-       struct irqaction *action;
-
-       if (noirqdebug)
-               return;
-
-       if (ret != IRQ_HANDLED && ret != IRQ_NONE) {
-               if (!count)
-                       return;
-               count--;
-               printk("irq%u: bogus retval mask %x\n", irq, ret);
-       } else {
-               desc->irqs_unhandled++;
-               if (desc->irqs_unhandled <= 99900)
-                       return;
-               desc->irqs_unhandled = 0;
-               printk("irq%u: nobody cared\n", irq);
-       }
-       show_regs(regs);
-       dump_stack();
-       printk(KERN_ERR "handlers:");
-       action = desc->action;
-       do {
-               printk("\n" KERN_ERR "[<%p>]", action->handler);
-               print_symbol(" (%s)", (unsigned long)action->handler);
-               action = action->next;
-       } while (action);
-       printk("\n");
-}
-
-static int
-__do_irq(unsigned int irq, struct irqaction *action, struct pt_regs *regs)
-{
-       unsigned int status;
-       int ret, retval = 0;
-
-       spin_unlock(&irq_controller_lock);
-
-#ifdef CONFIG_NO_IDLE_HZ
-       if (!(action->flags & SA_TIMER) && system_timer->dyn_tick != NULL) {
-               spin_lock(&system_timer->dyn_tick->lock);
-               if (system_timer->dyn_tick->state & DYN_TICK_ENABLED)
-                       system_timer->dyn_tick->handler(irq, 0, regs);
-               spin_unlock(&system_timer->dyn_tick->lock);
-       }
-#endif
-
-       if (!(action->flags & SA_INTERRUPT))
-               local_irq_enable();
-
-       status = 0;
-       do {
-               ret = action->handler(irq, action->dev_id, regs);
-               if (ret == IRQ_HANDLED)
-                       status |= action->flags;
-               retval |= ret;
-               action = action->next;
-       } while (action);
-
-       if (status & SA_SAMPLE_RANDOM)
-               add_interrupt_randomness(irq);
-
-       spin_lock_irq(&irq_controller_lock);
-
-       return retval;
-}
-
-/*
- * This is for software-decoded IRQs.  The caller is expected to
- * handle the ack, clear, mask and unmask issues.
- */
-void
-do_simple_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
-{
-       struct irqaction *action;
-       const unsigned int cpu = smp_processor_id();
-
-       desc->triggered = 1;
-
-       kstat_cpu(cpu).irqs[irq]++;
-
-       smp_set_running(desc);
-
-       action = desc->action;
-       if (action) {
-               int ret = __do_irq(irq, action, regs);
-               if (ret != IRQ_HANDLED)
-                       report_bad_irq(irq, regs, desc, ret);
-       }
-
-       smp_clear_running(desc);
-}
-
-/*
- * Most edge-triggered IRQ implementations seem to take a broken
- * approach to this.  Hence the complexity.
- */
-void
-do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
-{
-       const unsigned int cpu = smp_processor_id();
-
-       desc->triggered = 1;
-
-       /*
-        * If we're currently running this IRQ, or its disabled,
-        * we shouldn't process the IRQ.  Instead, turn on the
-        * hardware masks.
-        */
-       if (unlikely(desc->running || desc->disable_depth))
-               goto running;
-
-       /*
-        * Acknowledge and clear the IRQ, but don't mask it.
-        */
-       desc->chip->ack(irq);
-
-       /*
-        * Mark the IRQ currently in progress.
-        */
-       desc->running = 1;
-
-       kstat_cpu(cpu).irqs[irq]++;
-
-       do {
-               struct irqaction *action;
-
-               action = desc->action;
-               if (!action)
-                       break;
-
-               if (desc->pending && !desc->disable_depth) {
-                       desc->pending = 0;
-                       desc->chip->unmask(irq);
-               }
-
-               __do_irq(irq, action, regs);
-       } while (desc->pending && !desc->disable_depth);
-
-       desc->running = 0;
-
-       /*
-        * If we were disabled or freed, shut down the handler.
-        */
-       if (likely(desc->action && !check_irq_lock(desc, irq, regs)))
-               return;
-
- running:
-       /*
-        * We got another IRQ while this one was masked or
-        * currently running.  Delay it.
-        */
-       desc->pending = 1;
-       desc->chip->mask(irq);
-       desc->chip->ack(irq);
-}
-
-/*
- * Level-based IRQ handler.  Nice and simple.
- */
-void
-do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
-{
-       struct irqaction *action;
-       const unsigned int cpu = smp_processor_id();
-
-       desc->triggered = 1;
-
-       /*
-        * Acknowledge, clear _AND_ disable the interrupt.
-        */
-       desc->chip->ack(irq);
-
-       if (likely(!desc->disable_depth)) {
-               kstat_cpu(cpu).irqs[irq]++;
-
-               smp_set_running(desc);
-
-               /*
-                * Return with this interrupt masked if no action
-                */
-               action = desc->action;
-               if (action) {
-                       int ret = __do_irq(irq, desc->action, regs);
-
-                       if (ret != IRQ_HANDLED)
-                               report_bad_irq(irq, regs, desc, ret);
-
-                       if (likely(!desc->disable_depth &&
-                                  !check_irq_lock(desc, irq, regs)))
-                               desc->chip->unmask(irq);
-               }
-
-               smp_clear_running(desc);
-       }
-}
-
-static void do_pending_irqs(struct pt_regs *regs)
-{
-       struct list_head head, *l, *n;
-
-       do {
-               struct irqdesc *desc;
-
-               /*
-                * First, take the pending interrupts off the list.
-                * The act of calling the handlers may add some IRQs
-                * back onto the list.
-                */
-               head = irq_pending;
-               INIT_LIST_HEAD(&irq_pending);
-               head.next->prev = &head;
-               head.prev->next = &head;
-
-               /*
-                * Now run each entry.  We must delete it from our
-                * list before calling the handler.
-                */
-               list_for_each_safe(l, n, &head) {
-                       desc = list_entry(l, struct irqdesc, pend);
-                       list_del_init(&desc->pend);
-                       desc_handle_irq(desc - irq_desc, desc, regs);
-               }
-
-               /*
-                * The list must be empty.
-                */
-               BUG_ON(!list_empty(&head));
-       } while (!list_empty(&irq_pending));
-}
+/* Handle bad interrupts */
+static struct irq_desc bad_irq_desc = {
+       .handle_irq = handle_bad_irq,
+       .lock = SPIN_LOCK_UNLOCKED
+};
 
 /*
  * do_IRQ handles all hardware IRQ's.  Decoded IRQs should not
@@ -550,96 +120,15 @@ asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
                desc = &bad_irq_desc;
 
        irq_enter();
-       spin_lock(&irq_controller_lock);
-       desc_handle_irq(irq, desc, regs);
 
-       /*
-        * Now re-run any pending interrupts.
-        */
-       if (!list_empty(&irq_pending))
-               do_pending_irqs(regs);
+       desc_handle_irq(irq, desc, regs);
 
+       /* AT91 specific workaround */
        irq_finish(irq);
 
-       spin_unlock(&irq_controller_lock);
        irq_exit();
 }
 
-void __set_irq_handler(unsigned int irq, irq_handler_t handle, int is_chained)
-{
-       struct irqdesc *desc;
-       unsigned long flags;
-
-       if (irq >= NR_IRQS) {
-               printk(KERN_ERR "Trying to install handler for IRQ%d\n", irq);
-               return;
-       }
-
-       if (handle == NULL)
-               handle = do_bad_IRQ;
-
-       desc = irq_desc + irq;
-
-       if (is_chained && desc->chip == &bad_chip)
-               printk(KERN_WARNING "Trying to install chained handler for IRQ%d\n", irq);
-
-       spin_lock_irqsave(&irq_controller_lock, flags);
-       if (handle == do_bad_IRQ) {
-               desc->chip->mask(irq);
-               desc->chip->ack(irq);
-               desc->disable_depth = 1;
-       }
-       desc->handle = handle;
-       if (handle != do_bad_IRQ && is_chained) {
-               desc->valid = 0;
-               desc->probe_ok = 0;
-               desc->disable_depth = 0;
-               desc->chip->unmask(irq);
-       }
-       spin_unlock_irqrestore(&irq_controller_lock, flags);
-}
-
-void set_irq_chip(unsigned int irq, struct irqchip *chip)
-{
-       struct irqdesc *desc;
-       unsigned long flags;
-
-       if (irq >= NR_IRQS) {
-               printk(KERN_ERR "Trying to install chip for IRQ%d\n", irq);
-               return;
-       }
-
-       if (chip == NULL)
-               chip = &bad_chip;
-
-       desc = irq_desc + irq;
-       spin_lock_irqsave(&irq_controller_lock, flags);
-       desc->chip = chip;
-       spin_unlock_irqrestore(&irq_controller_lock, flags);
-}
-
-int set_irq_type(unsigned int irq, unsigned int type)
-{
-       struct irqdesc *desc;
-       unsigned long flags;
-       int ret = -ENXIO;
-
-       if (irq >= NR_IRQS) {
-               printk(KERN_ERR "Trying to set irq type for IRQ%d\n", irq);
-               return -ENODEV;
-       }
-
-       desc = irq_desc + irq;
-       if (desc->chip->set_type) {
-               spin_lock_irqsave(&irq_controller_lock, flags);
-               ret = desc->chip->set_type(irq, type);
-               spin_unlock_irqrestore(&irq_controller_lock, flags);
-       }
-
-       return ret;
-}
-EXPORT_SYMBOL(set_irq_type);
-
 void set_irq_flags(unsigned int irq, unsigned int iflags)
 {
        struct irqdesc *desc;
@@ -651,421 +140,32 @@ void set_irq_flags(unsigned int irq, unsigned int iflags)
        }
 
        desc = irq_desc + irq;
-       spin_lock_irqsave(&irq_controller_lock, flags);
-       desc->valid = (iflags & IRQF_VALID) != 0;
-       desc->probe_ok = (iflags & IRQF_PROBE) != 0;
-       desc->noautoenable = (iflags & IRQF_NOAUTOEN) != 0;
-       spin_unlock_irqrestore(&irq_controller_lock, flags);
-}
-
-int setup_irq(unsigned int irq, struct irqaction *new)
-{
-       int shared = 0;
-       struct irqaction *old, **p;
-       unsigned long flags;
-       struct irqdesc *desc;
-
-       /*
-        * Some drivers like serial.c use request_irq() heavily,
-        * so we have to be careful not to interfere with a
-        * running system.
-        */
-       if (new->flags & SA_SAMPLE_RANDOM) {
-               /*
-                * This function might sleep, we want to call it first,
-                * outside of the atomic block.
-                * Yes, this might clear the entropy pool if the wrong
-                * driver is attempted to be loaded, without actually
-                * installing a new handler, but is this really a problem,
-                * only the sysadmin is able to do this.
-                */
-               rand_initialize_irq(irq);
-       }
-
-       /*
-        * The following block of code has to be executed atomically
-        */
-       desc = irq_desc + irq;
-       spin_lock_irqsave(&irq_controller_lock, flags);
-       p = &desc->action;
-       if ((old = *p) != NULL) {
-               /*
-                * Can't share interrupts unless both agree to and are
-                * the same type.
-                */
-               if (!(old->flags & new->flags & SA_SHIRQ) ||
-                   (~old->flags & new->flags) & SA_TRIGGER_MASK) {
-                       spin_unlock_irqrestore(&irq_controller_lock, flags);
-                       return -EBUSY;
-               }
-
-               /* add new interrupt at end of irq queue */
-               do {
-                       p = &old->next;
-                       old = *p;
-               } while (old);
-               shared = 1;
-       }
-
-       *p = new;
-
-       if (!shared) {
-               desc->probing = 0;
-               desc->running = 0;
-               desc->pending = 0;
-               desc->disable_depth = 1;
-
-               if (new->flags & SA_TRIGGER_MASK &&
-                   desc->chip->set_type) {
-                       unsigned int type = new->flags & SA_TRIGGER_MASK;
-                       desc->chip->set_type(irq, type);
-               }
-
-               if (!desc->noautoenable) {
-                       desc->disable_depth = 0;
-                       desc->chip->unmask(irq);
-               }
-       }
-
-       spin_unlock_irqrestore(&irq_controller_lock, flags);
-       return 0;
-}
-
-/**
- *     request_irq - allocate an interrupt line
- *     @irq: Interrupt line to allocate
- *     @handler: Function to be called when the IRQ occurs
- *     @irqflags: Interrupt type flags
- *     @devname: An ascii name for the claiming device
- *     @dev_id: A cookie passed back to the handler function
- *
- *     This call allocates interrupt resources and enables the
- *     interrupt line and IRQ handling. From the point this
- *     call is made your handler function may be invoked. Since
- *     your handler function must clear any interrupt the board
- *     raises, you must take care both to initialise your hardware
- *     and to set up the interrupt handler in the right order.
- *
- *     Dev_id must be globally unique. Normally the address of the
- *     device data structure is used as the cookie. Since the handler
- *     receives this value it makes sense to use it.
- *
- *     If your interrupt is shared you must pass a non NULL dev_id
- *     as this is required when freeing the interrupt.
- *
- *     Flags:
- *
- *     SA_SHIRQ                Interrupt is shared
- *
- *     SA_INTERRUPT            Disable local interrupts while processing
- *
- *     SA_SAMPLE_RANDOM        The interrupt can be used for entropy
- *
- */
-int request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *),
-                unsigned long irq_flags, const char * devname, void *dev_id)
-{
-       unsigned long retval;
-       struct irqaction *action;
-
-       if (irq >= NR_IRQS || !irq_desc[irq].valid || !handler ||
-           (irq_flags & SA_SHIRQ && !dev_id))
-               return -EINVAL;
-
-       action = (struct irqaction *)kmalloc(sizeof(struct irqaction), GFP_KERNEL);
-       if (!action)
-               return -ENOMEM;
-
-       action->handler = handler;
-       action->flags = irq_flags;
-       cpus_clear(action->mask);
-       action->name = devname;
-       action->next = NULL;
-       action->dev_id = dev_id;
-
-       retval = setup_irq(irq, action);
-
-       if (retval)
-               kfree(action);
-       return retval;
-}
-
-EXPORT_SYMBOL(request_irq);
-
-/**
- *     free_irq - free an interrupt
- *     @irq: Interrupt line to free
- *     @dev_id: Device identity to free
- *
- *     Remove an interrupt handler. The handler is removed and if the
- *     interrupt line is no longer in use by any driver it is disabled.
- *     On a shared IRQ the caller must ensure the interrupt is disabled
- *     on the card it drives before calling this function.
- *
- *     This function must not be called from interrupt context.
- */
-void free_irq(unsigned int irq, void *dev_id)
-{
-       struct irqaction * action, **p;
-       unsigned long flags;
-
-       if (irq >= NR_IRQS || !irq_desc[irq].valid) {
-               printk(KERN_ERR "Trying to free IRQ%d\n",irq);
-               dump_stack();
-               return;
-       }
-
-       spin_lock_irqsave(&irq_controller_lock, flags);
-       for (p = &irq_desc[irq].action; (action = *p) != NULL; p = &action->next) {
-               if (action->dev_id != dev_id)
-                       continue;
-
-               /* Found it - now free it */
-               *p = action->next;
-               break;
-       }
-       spin_unlock_irqrestore(&irq_controller_lock, flags);
-
-       if (!action) {
-               printk(KERN_ERR "Trying to free free IRQ%d\n",irq);
-               dump_stack();
-       } else {
-               synchronize_irq(irq);
-               kfree(action);
-       }
-}
-
-EXPORT_SYMBOL(free_irq);
-
-static DECLARE_MUTEX(probe_sem);
-
-/* Start the interrupt probing.  Unlike other architectures,
- * we don't return a mask of interrupts from probe_irq_on,
- * but return the number of interrupts enabled for the probe.
- * The interrupts which have been enabled for probing is
- * instead recorded in the irq_desc structure.
- */
-unsigned long probe_irq_on(void)
-{
-       unsigned int i, irqs = 0;
-       unsigned long delay;
-
-       down(&probe_sem);
-
-       /*
-        * first snaffle up any unassigned but
-        * probe-able interrupts
-        */
-       spin_lock_irq(&irq_controller_lock);
-       for (i = 0; i < NR_IRQS; i++) {
-               if (!irq_desc[i].probe_ok || irq_desc[i].action)
-                       continue;
-
-               irq_desc[i].probing = 1;
-               irq_desc[i].triggered = 0;
-               if (irq_desc[i].chip->set_type)
-                       irq_desc[i].chip->set_type(i, IRQT_PROBE);
-               irq_desc[i].chip->unmask(i);
-               irqs += 1;
-       }
-       spin_unlock_irq(&irq_controller_lock);
-
-       /*
-        * wait for spurious interrupts to mask themselves out again
-        */
-       for (delay = jiffies + HZ/10; time_before(jiffies, delay); )
-               /* min 100ms delay */;
-
-       /*
-        * now filter out any obviously spurious interrupts
-        */
-       spin_lock_irq(&irq_controller_lock);
-       for (i = 0; i < NR_IRQS; i++) {
-               if (irq_desc[i].probing && irq_desc[i].triggered) {
-                       irq_desc[i].probing = 0;
-                       irqs -= 1;
-               }
-       }
-       spin_unlock_irq(&irq_controller_lock);
-
-       return irqs;
-}
-
-EXPORT_SYMBOL(probe_irq_on);
-
-unsigned int probe_irq_mask(unsigned long irqs)
-{
-       unsigned int mask = 0, i;
-
-       spin_lock_irq(&irq_controller_lock);
-       for (i = 0; i < 16 && i < NR_IRQS; i++)
-               if (irq_desc[i].probing && irq_desc[i].triggered)
-                       mask |= 1 << i;
-       spin_unlock_irq(&irq_controller_lock);
-
-       up(&probe_sem);
-
-       return mask;
-}
-EXPORT_SYMBOL(probe_irq_mask);
-
-/*
- * Possible return values:
- *  >= 0 - interrupt number
- *    -1 - no interrupt/many interrupts
- */
-int probe_irq_off(unsigned long irqs)
-{
-       unsigned int i;
-       int irq_found = NO_IRQ;
-
-       /*
-        * look at the interrupts, and find exactly one
-        * that we were probing has been triggered
-        */
-       spin_lock_irq(&irq_controller_lock);
-       for (i = 0; i < NR_IRQS; i++) {
-               if (irq_desc[i].probing &&
-                   irq_desc[i].triggered) {
-                       if (irq_found != NO_IRQ) {
-                               irq_found = NO_IRQ;
-                               goto out;
-                       }
-                       irq_found = i;
-               }
-       }
-
-       if (irq_found == -1)
-               irq_found = NO_IRQ;
-out:
-       spin_unlock_irq(&irq_controller_lock);
-
-       up(&probe_sem);
-
-       return irq_found;
-}
-
-EXPORT_SYMBOL(probe_irq_off);
-
-#ifdef CONFIG_SMP
-static void route_irq(struct irqdesc *desc, unsigned int irq, unsigned int cpu)
-{
-       pr_debug("IRQ%u: moving from cpu%u to cpu%u\n", irq, desc->cpu, cpu);
-
-       spin_lock_irq(&irq_controller_lock);
-       desc->cpu = cpu;
-       desc->chip->set_cpu(desc, irq, cpu);
-       spin_unlock_irq(&irq_controller_lock);
-}
-
-#ifdef CONFIG_PROC_FS
-static int
-irq_affinity_read_proc(char *page, char **start, off_t off, int count,
-                      int *eof, void *data)
-{
-       struct irqdesc *desc = irq_desc + ((int)data);
-       int len = cpumask_scnprintf(page, count, desc->affinity);
-
-       if (count - len < 2)
-               return -EINVAL;
-       page[len++] = '\n';
-       page[len] = '\0';
-
-       return len;
-}
-
-static int
-irq_affinity_write_proc(struct file *file, const char __user *buffer,
-                       unsigned long count, void *data)
-{
-       unsigned int irq = (unsigned int)data;
-       struct irqdesc *desc = irq_desc + irq;
-       cpumask_t affinity, tmp;
-       int ret = -EIO;
-
-       if (!desc->chip->set_cpu)
-               goto out;
-
-       ret = cpumask_parse(buffer, count, affinity);
-       if (ret)
-               goto out;
-
-       cpus_and(tmp, affinity, cpu_online_map);
-       if (cpus_empty(tmp)) {
-               ret = -EINVAL;
-               goto out;
-       }
-
-       desc->affinity = affinity;
-       route_irq(desc, irq, first_cpu(tmp));
-       ret = count;
-
- out:
-       return ret;
-}
-#endif
-#endif
-
-void __init init_irq_proc(void)
-{
-#if defined(CONFIG_SMP) && defined(CONFIG_PROC_FS)
-       struct proc_dir_entry *dir;
-       int irq;
-
-       dir = proc_mkdir("irq", NULL);
-       if (!dir)
-               return;
-
-       for (irq = 0; irq < NR_IRQS; irq++) {
-               struct proc_dir_entry *entry;
-               struct irqdesc *desc;
-               char name[16];
-
-               desc = irq_desc + irq;
-               memset(name, 0, sizeof(name));
-               snprintf(name, sizeof(name) - 1, "%u", irq);
-
-               desc->procdir = proc_mkdir(name, dir);
-               if (!desc->procdir)
-                       continue;
-
-               entry = create_proc_entry("smp_affinity", 0600, desc->procdir);
-               if (entry) {
-                       entry->nlink = 1;
-                       entry->data = (void *)irq;
-                       entry->read_proc = irq_affinity_read_proc;
-                       entry->write_proc = irq_affinity_write_proc;
-               }
-       }
-#endif
+       spin_lock_irqsave(&desc->lock, flags);
+       desc->status |= IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
+       if (iflags & IRQF_VALID)
+               desc->status &= ~IRQ_NOREQUEST;
+       if (iflags & IRQF_PROBE)
+               desc->status &= ~IRQ_NOPROBE;
+       if (!(iflags & IRQF_NOAUTOEN))
+               desc->status &= ~IRQ_NOAUTOEN;
+       spin_unlock_irqrestore(&desc->lock, flags);
 }
 
 void __init init_IRQ(void)
 {
-       struct irqdesc *desc;
        int irq;
 
+       for (irq = 0; irq < NR_IRQS; irq++)
+               irq_desc[irq].status |= IRQ_NOREQUEST | IRQ_DELAYED_DISABLE |
+                       IRQ_NOPROBE;
+
 #ifdef CONFIG_SMP
        bad_irq_desc.affinity = CPU_MASK_ALL;
        bad_irq_desc.cpu = smp_processor_id();
 #endif
-
-       for (irq = 0, desc = irq_desc; irq < NR_IRQS; irq++, desc++) {
-               *desc = bad_irq_desc;
-               INIT_LIST_HEAD(&desc->pend);
-       }
-
        init_arch_irq();
 }
 
-static int __init noirqdebug_setup(char *str)
-{
-       noirqdebug = 1;
-       return 1;
-}
-
-__setup("noirqdebug", noirqdebug_setup);
-
 #ifdef CONFIG_HOTPLUG_CPU
 /*
  * The CPU has been marked offline.  Migrate IRQs off this CPU.  If
diff --git a/arch/arm/kernel/iwmmxt-notifier.c b/arch/arm/kernel/iwmmxt-notifier.c
new file mode 100644 (file)
index 0000000..44a86c3
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ *  linux/arch/arm/kernel/iwmmxt-notifier.c
+ *
+ *  XScale iWMMXt (Concan) context switching and handling
+ *
+ *  Initial code:
+ *  Copyright (c) 2003, Intel Corporation
+ *
+ *  Full lazy switching support, optimizations and more, by Nicolas Pitre
+ *  Copyright (c) 2003-2004, MontaVista Software, 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.
+ */
+
+#include <linux/module.h>
+#include <linux/config.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/signal.h>
+#include <linux/sched.h>
+#include <linux/init.h>
+#include <asm/thread_notify.h>
+#include <asm/io.h>
+
+static int iwmmxt_do(struct notifier_block *self, unsigned long cmd, void *t)
+{
+       struct thread_info *thread = t;
+
+       switch (cmd) {
+       case THREAD_NOTIFY_FLUSH:
+               /*
+                * flush_thread() zeroes thread->fpstate, so no need
+                * to do anything here.
+                *
+                * FALLTHROUGH: Ensure we don't try to overwrite our newly
+                * initialised state information on the first fault.
+                */
+
+       case THREAD_NOTIFY_RELEASE:
+               iwmmxt_task_release(thread);
+               break;
+
+       case THREAD_NOTIFY_SWITCH:
+               iwmmxt_task_switch(thread);
+               break;
+       }
+
+       return NOTIFY_DONE;
+}
+
+static struct notifier_block iwmmxt_notifier_block = {
+       .notifier_call  = iwmmxt_do,
+};
+
+static int __init iwmmxt_init(void)
+{
+       thread_register_notifier(&iwmmxt_notifier_block);
+
+       return 0;
+}
+
+late_initcall(iwmmxt_init);
index a3bae95e536c0ddd4071847c2d3b220fe72f5bae..b63b528f22a693d4059680a98eb0d1a23182b1f2 100644 (file)
@@ -271,30 +271,27 @@ ENTRY(iwmmxt_task_restore)
 /*
  * Concan handling on task switch
  *
- * r0 = previous task_struct pointer (must be preserved)
- * r1 = previous thread_info pointer
- * r2 = next thread_info pointer (must be preserved)
+ * r0 = next thread_info pointer
  *
- * Called only from __switch_to with task preemption disabled.
- * No need to care about preserving r4 and above.
+ * Called only from the iwmmxt notifier with task preemption disabled.
  */
 ENTRY(iwmmxt_task_switch)
 
-       mrc     p15, 0, r4, c15, c1, 0
-       tst     r4, #0x3                        @ CP0 and CP1 accessible?
+       mrc     p15, 0, r1, c15, c1, 0
+       tst     r1, #0x3                        @ CP0 and CP1 accessible?
        bne     1f                              @ yes: block them for next task
 
-       ldr     r5, =concan_owner
-       add     r6, r2, #TI_IWMMXT_STATE        @ get next task Concan save area
-       ldr     r5, [r5]                        @ get current Concan owner
-       teq     r5, r6                          @ next task owns it?
+       ldr     r2, =concan_owner
+       add     r3, r0, #TI_IWMMXT_STATE        @ get next task Concan save area
+       ldr     r2, [r2]                        @ get current Concan owner
+       teq     r2, r3                          @ next task owns it?
        movne   pc, lr                          @ no: leave Concan disabled
 
-1:     eor     r4, r4, #3                      @ flip Concan access
-       mcr     p15, 0, r4, c15, c1, 0
+1:     eor     r1, r1, #3                      @ flip Concan access
+       mcr     p15, 0, r1, c15, c1, 0
 
-       mrc     p15, 0, r4, c2, c0, 0
-       sub     pc, lr, r4, lsr #32             @ cpwait and return
+       mrc     p15, 0, r1, c2, c0, 0
+       sub     pc, lr, r1, lsr #32             @ cpwait and return
 
 /*
  * Remove Concan ownership of given task
index 055bf5d28894097849b9014cdafe65389cf77370..298363d97047755c3ac969baef5a95217a69bea8 100644 (file)
@@ -9,7 +9,6 @@
  *
  * Module allocation method suggested by Andi Kleen.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleloader.h>
 #include <linux/kernel.h>
index e1c77ee885a7f98eaaa9ac213991874561d2b34d..3079535afccd4be9daf1219c101ac8bc0959e7c7 100644 (file)
@@ -10,7 +10,6 @@
  */
 #include <stdarg.h>
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
@@ -353,9 +352,6 @@ void flush_thread(void)
        memset(&thread->fpstate, 0, sizeof(union fp_state));
 
        thread_notify(THREAD_NOTIFY_FLUSH, thread);
-#if defined(CONFIG_IWMMXT)
-       iwmmxt_task_release(thread);
-#endif
 }
 
 void release_thread(struct task_struct *dead_task)
@@ -363,9 +359,6 @@ void release_thread(struct task_struct *dead_task)
        struct thread_info *thread = task_thread_info(dead_task);
 
        thread_notify(THREAD_NOTIFY_RELEASE, thread);
-#if defined(CONFIG_IWMMXT)
-       iwmmxt_task_release(thread);
-#endif
 }
 
 asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
index c40bdc770054c19b8a79e1f660211ec790b39274..9254ba2f46fc147b756407d6d21fdff16a117f84 100644 (file)
@@ -9,7 +9,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
index 6bdf70def01f0c22390aeeba31db56cbd05be7e8..ed1c4d62d999e4170df1de47d017da5968b1d76e 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.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/stddef.h>
@@ -345,9 +344,9 @@ static void __init setup_processor(void)
        cpu_cache = *list->cache;
 #endif
 
-       printk("CPU: %s [%08x] revision %d (ARMv%s)\n",
+       printk("CPU: %s [%08x] revision %d (ARMv%s), cr=%08lx\n",
               cpu_name, processor_id, (int)processor_id & 15,
-              proc_arch[cpu_architecture()]);
+              proc_arch[cpu_architecture()], cr_alignment);
 
        sprintf(system_utsname.machine, "%s%c", list->arch_name, ENDIANNESS);
        sprintf(elf_platform, "%s%c", list->elf_name, ENDIANNESS);
index 83a8d3c95eb3ff458631412a96bf5ed6e4f1c742..48cf7fffddf2add8d663fc4db96b019ed3eaea04 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.
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
 #include <linux/ptrace.h>
index 1370d726dc105909bd0a0d72ca6291ed8f939240..68e9634d260a74c8a1d21d93db7a2421fa376859 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.
  */
-#include <linux/config.h>
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
index 9c12d4fefbd30c9aa969f1c189cbf9a3f4f1f8bd..09a67d77185775937a6f70c9541172bbee416d67 100644 (file)
@@ -16,7 +16,6 @@
  *  1998-12-20  Updated NTP code according to technical memorandum Jan '96
  *              "A Kernel Model for Precision Timekeeping" by Dave Mills
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
index 35230a06010813b0131808acb2fb01ca2bc8c636..35a052fc177aeaefbebd2ceb294805d472ac7d45 100644 (file)
@@ -12,7 +12,6 @@
  *  'linux/arch/arm/lib/traps.S'.  Mostly a debugging aid, but will probably
  *  kill the offending process.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/signal.h>
 #include <linux/spinlock.h>
index 2df9688a70282fca86ac0fb854a64da305961111..3ca574ee277271e04b05c79ed956337b3e7dfb7a 100644 (file)
@@ -4,7 +4,6 @@
  */
 
 #include <asm-generic/vmlinux.lds.h>
-#include <linux/config.h>
 #include <asm/thread_info.h>
 #include <asm/memory.h>
        
index 91f993f2e9dbdfd5786733dcaaec3e36ae26cf31..74230083cbf416a2d073ceba27ab9c2a38927873 100644 (file)
@@ -10,7 +10,6 @@
  * 27/03/03 Ian Molton Clean up CONFIG_CPU
  *
  */
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/assembler.h>
                .text
index b8c14e93669711d2c52f20ca06c41980eaf791b0..542251021744694a54124103f8e07a31c61fb02b 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 
 #if __LINUX_ARM_ARCH__ >= 6 && defined(CONFIG_CPU_32v6K)
        .macro  bitop, instr
index d847a62834cb134492b058b85760e032b0b665b1..f76de07ac1825f77ec045ff6c01c1179bd3c2378 100644 (file)
@@ -10,7 +10,6 @@
  *  published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/linkage.h>
 
 #ifdef __ARMEB__
index 65be5efd633c7b618c71f1a2e478ea8501b3c110..baa997c857dc938afd3353cd1616a57fdc622451 100644 (file)
@@ -9,7 +9,6 @@
  *  it under the terms of the GNU General Public License version 2 as
  *  published by the Free Software Foundation.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -143,7 +142,7 @@ aaec2000_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 static struct irqaction aaec2000_timer_irq = {
        .name           = "AAEC-2000 Timer Tick",
-       .flags          = SA_INTERRUPT | SA_TIMER,
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
        .handler        = aaec2000_timer_interrupt,
 };
 
index 70d402f76ce5f985fcc568c7e49615ea84991a6a..2f85e8693b1ba1e3984f93fa4e83b53fdb38a468 100644 (file)
@@ -1,6 +1,21 @@
-if ARCH_AT91RM9200
+if ARCH_AT91
+
+menu "Atmel AT91 System-on-Chip"
+
+comment "Atmel AT91 Processors"
+
+config ARCH_AT91RM9200
+       bool "AT91RM9200"
 
-menu "AT91RM9200 Implementations"
+config ARCH_AT91SAM9260
+       bool "AT91SAM9260"
+
+config ARCH_AT91SAM9261
+       bool "AT91SAM9261"
+
+# ----------------------------------------------------------
+
+if ARCH_AT91RM9200
 
 comment "AT91RM9200 Board Type"
 
@@ -8,58 +23,87 @@ config MACH_ONEARM
        bool "Ajeco 1ARM Single Board Computer"
        depends on ARCH_AT91RM9200
        help
-         Select this if you are using Ajeco's 1ARM Single Board Computer
+         Select this if you are using Ajeco's 1ARM Single Board Computer.
+         <http://www.ajeco.fi/products.htm>
 
 config ARCH_AT91RM9200DK
        bool "Atmel AT91RM9200-DK Development board"
        depends on ARCH_AT91RM9200
        help
-         Select this if you are using Atmel's AT91RM9200-DK Development board
+         Select this if you are using Atmel's AT91RM9200-DK Development board.
+         (Discontinued)
+
 
 config MACH_AT91RM9200EK
        bool "Atmel AT91RM9200-EK Evaluation Kit"
        depends on ARCH_AT91RM9200
        help
-         Select this if you are using Atmel's AT91RM9200-EK Evaluation Kit
+         Select this if you are using Atmel's AT91RM9200-EK Evaluation Kit.
+         <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3507>
 
 config MACH_CSB337
-       bool "Cogent CSB337 board"
+       bool "Cogent CSB337"
        depends on ARCH_AT91RM9200
        help
-         Select this if you are using Cogent's CSB337 board
+         Select this if you are using Cogent's CSB337 board.
+         <http://www.cogcomp.com/csb_csb337.htm>
 
 config MACH_CSB637
-       bool "Cogent CSB637 board"
+       bool "Cogent CSB637"
        depends on ARCH_AT91RM9200
        help
-         Select this if you are using Cogent's CSB637 board
+         Select this if you are using Cogent's CSB637 board.
+         <http://www.cogcomp.com/csb_csb637.htm>
 
 config MACH_CARMEVA
-       bool "Conitec's ARM&EVA"
+       bool "Conitec ARM&EVA"
        depends on ARCH_AT91RM9200
        help
-         Select this if you are using Conitec's AT91RM9200-MCU-Module
+         Select this if you are using Conitec's AT91RM9200-MCU-Module.
+         <http://www.conitec.net/english/linuxboard.htm>
 
-config MACH_KB9200
-       bool "KwikByte's KB920x"
+config MACH_ATEB9200
+       bool "Embest ATEB9200"
        depends on ARCH_AT91RM9200
        help
-         Select this if you are using KwikByte's KB920x board
+         Select this if you are using Embest's ATEB9200 board.
+         <http://www.embedinfo.com/english/product/ATEB9200.asp>
 
-config MACH_ATEB9200
-       bool "Embest's ATEB9200"
+config MACH_KB9200
+       bool "KwikByte KB920x"
        depends on ARCH_AT91RM9200
        help
-         Select this if you are using Embest's ATEB9200 board
+         Select this if you are using KwikByte's KB920x board.
+         <http://kwikbyte.com/KB9202_description_new.htm>
 
 config MACH_KAFA
        bool "Sperry-Sun KAFA board"
        depends on ARCH_AT91RM9200
        help
-         Select this if you are using Sperry-Sun's KAFA board
+         Select this if you are using Sperry-Sun's KAFA board.
+
+endif
+
+# ----------------------------------------------------------
+
+if ARCH_AT91SAM9260
+
+comment "AT91SAM9260 Board Type"
+
+endif
+
+# ----------------------------------------------------------
+
+if ARCH_AT91SAM9261
+
+comment "AT91SAM9261 Board Type"
+
+endif
+
 
+# ----------------------------------------------------------
 
-comment "AT91RM9200 Feature Selections"
+comment "AT91 Feature Selections"
 
 config AT91_PROGRAMMABLE_CLOCKS
        bool "Programmable Clocks"
index 82db957322dfc4d79f0efed4bb697fc10c15a34c..c174805c24e538305fd433051dcbae0b346a5ef0 100644 (file)
@@ -2,14 +2,19 @@
 # Makefile for the linux kernel.
 #
 
-obj-y          := clock.o irq.o time.o gpio.o common.o devices.o
+obj-y          := clock.o irq.o gpio.o devices.o
 obj-m          :=
 obj-n          :=
 obj-           :=
 
 obj-$(CONFIG_PM)               += pm.o
 
-# Board-specific support
+# CPU-specific support
+obj-$(CONFIG_ARCH_AT91RM9200)  += at91rm9200.o at91rm9200_time.o
+obj-$(CONFIG_ARCH_AT91SAM9260) +=
+obj-$(CONFIG_ARCH_AT91SAM9261) +=
+
+# AT91RM9200 Board-specific support
 obj-$(CONFIG_MACH_ONEARM)      += board-1arm.o
 obj-$(CONFIG_ARCH_AT91RM9200DK)        += board-dk.o
 obj-$(CONFIG_MACH_AT91RM9200EK)        += board-ek.o
@@ -20,6 +25,10 @@ obj-$(CONFIG_MACH_KB9200)    += board-kb9202.o
 obj-$(CONFIG_MACH_ATEB9200)    += board-eb9200.o
 obj-$(CONFIG_MACH_KAFA)                += board-kafa.o
 
+# AT91SAM9260 board-specific support
+
+# AT91SAM9261 board-specific support
+
 # LEDs support
 led-$(CONFIG_ARCH_AT91RM9200DK)        += leds.o
 led-$(CONFIG_MACH_AT91RM9200EK)        += leds.o
diff --git a/arch/arm/mach-at91rm9200/at91rm9200.c b/arch/arm/mach-at91rm9200/at91rm9200.c
new file mode 100644 (file)
index 0000000..7e1d072
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+ * arch/arm/mach-at91rm9200/at91rm9200.c
+ *
+ *  Copyright (C) 2005 SAN People
+ *
+ * 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/module.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+
+#include <asm/hardware.h>
+#include "generic.h"
+
+static struct map_desc at91rm9200_io_desc[] __initdata = {
+       {
+               .virtual        = AT91_VA_BASE_SYS,
+               .pfn            = __phys_to_pfn(AT91_BASE_SYS),
+               .length         = SZ_4K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = AT91_VA_BASE_SPI,
+               .pfn            = __phys_to_pfn(AT91_BASE_SPI),
+               .length         = SZ_16K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = AT91_VA_BASE_SSC2,
+               .pfn            = __phys_to_pfn(AT91_BASE_SSC2),
+               .length         = SZ_16K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = AT91_VA_BASE_SSC1,
+               .pfn            = __phys_to_pfn(AT91_BASE_SSC1),
+               .length         = SZ_16K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = AT91_VA_BASE_SSC0,
+               .pfn            = __phys_to_pfn(AT91_BASE_SSC0),
+               .length         = SZ_16K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = AT91_VA_BASE_US3,
+               .pfn            = __phys_to_pfn(AT91_BASE_US3),
+               .length         = SZ_16K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = AT91_VA_BASE_US2,
+               .pfn            = __phys_to_pfn(AT91_BASE_US2),
+               .length         = SZ_16K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = AT91_VA_BASE_US1,
+               .pfn            = __phys_to_pfn(AT91_BASE_US1),
+               .length         = SZ_16K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = AT91_VA_BASE_US0,
+               .pfn            = __phys_to_pfn(AT91_BASE_US0),
+               .length         = SZ_16K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = AT91_VA_BASE_EMAC,
+               .pfn            = __phys_to_pfn(AT91_BASE_EMAC),
+               .length         = SZ_16K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = AT91_VA_BASE_TWI,
+               .pfn            = __phys_to_pfn(AT91_BASE_TWI),
+               .length         = SZ_16K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = AT91_VA_BASE_MCI,
+               .pfn            = __phys_to_pfn(AT91_BASE_MCI),
+               .length         = SZ_16K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = AT91_VA_BASE_UDP,
+               .pfn            = __phys_to_pfn(AT91_BASE_UDP),
+               .length         = SZ_16K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = AT91_VA_BASE_TCB1,
+               .pfn            = __phys_to_pfn(AT91_BASE_TCB1),
+               .length         = SZ_16K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = AT91_VA_BASE_TCB0,
+               .pfn            = __phys_to_pfn(AT91_BASE_TCB0),
+               .length         = SZ_16K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = AT91_SRAM_VIRT_BASE,
+               .pfn            = __phys_to_pfn(AT91_SRAM_BASE),
+               .length         = AT91_SRAM_SIZE,
+               .type           = MT_DEVICE,
+       },
+};
+
+void __init at91rm9200_map_io(void)
+{
+       iotable_init(at91rm9200_io_desc, ARRAY_SIZE(at91rm9200_io_desc));
+}
+
diff --git a/arch/arm/mach-at91rm9200/at91rm9200_time.c b/arch/arm/mach-at91rm9200/at91rm9200_time.c
new file mode 100644 (file)
index 0000000..a92a862
--- /dev/null
@@ -0,0 +1,141 @@
+/*
+ * linux/arch/arm/mach-at91rm9200/at91rm9200_time.c
+ *
+ *  Copyright (C) 2003 SAN People
+ *  Copyright (C) 2003 ATMEL
+ *
+ * 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/init.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/time.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/mach/time.h>
+
+static unsigned long last_crtr;
+
+/*
+ * The ST_CRTR is updated asynchronously to the master clock.  It is therefore
+ *  necessary to read it twice (with the same value) to ensure accuracy.
+ */
+static inline unsigned long read_CRTR(void) {
+       unsigned long x1, x2;
+
+       do {
+               x1 = at91_sys_read(AT91_ST_CRTR);
+               x2 = at91_sys_read(AT91_ST_CRTR);
+       } while (x1 != x2);
+
+       return x1;
+}
+
+/*
+ * Returns number of microseconds since last timer interrupt.  Note that interrupts
+ * will have been disabled by do_gettimeofday()
+ *  'LATCH' is hwclock ticks (see CLOCK_TICK_RATE in timex.h) per jiffy.
+ *  'tick' is usecs per jiffy (linux/timex.h).
+ */
+static unsigned long at91rm9200_gettimeoffset(void)
+{
+       unsigned long elapsed;
+
+       elapsed = (read_CRTR() - last_crtr) & AT91_ST_ALMV;
+
+       return (unsigned long)(elapsed * (tick_nsec / 1000)) / LATCH;
+}
+
+/*
+ * IRQ handler for the timer.
+ */
+static irqreturn_t at91rm9200_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+       if (at91_sys_read(AT91_ST_SR) & AT91_ST_PITS) { /* This is a shared interrupt */
+               write_seqlock(&xtime_lock);
+
+               while (((read_CRTR() - last_crtr) & AT91_ST_ALMV) >= LATCH) {
+                       timer_tick(regs);
+                       last_crtr = (last_crtr + LATCH) & AT91_ST_ALMV;
+               }
+
+               write_sequnlock(&xtime_lock);
+
+               return IRQ_HANDLED;
+       }
+       else
+               return IRQ_NONE;                /* not handled */
+}
+
+static struct irqaction at91rm9200_timer_irq = {
+       .name           = "at91_tick",
+       .flags          = IRQF_SHARED | IRQF_DISABLED | IRQF_TIMER,
+       .handler        = at91rm9200_timer_interrupt
+};
+
+void at91rm9200_timer_reset(void)
+{
+       last_crtr = 0;
+
+       /* Real time counter incremented every 30.51758 microseconds */
+       at91_sys_write(AT91_ST_RTMR, 1);
+
+       /* Set Period Interval timer */
+       at91_sys_write(AT91_ST_PIMR, LATCH);
+
+       /* Enable Period Interval Timer interrupt */
+       at91_sys_write(AT91_ST_IER, AT91_ST_PITS);
+}
+
+/*
+ * Set up timer interrupt.
+ */
+void __init at91rm9200_timer_init(void)
+{
+       /* Disable all timer interrupts */
+       at91_sys_write(AT91_ST_IDR, AT91_ST_PITS | AT91_ST_WDOVF | AT91_ST_RTTINC | AT91_ST_ALMS);
+       (void) at91_sys_read(AT91_ST_SR);       /* Clear any pending interrupts */
+
+       /* Make IRQs happen for the system timer */
+       setup_irq(AT91_ID_SYS, &at91rm9200_timer_irq);
+
+       /* Change the kernel's 'tick' value to 10009 usec. (the default is 10000) */
+       tick_usec = (LATCH * 1000000) / CLOCK_TICK_RATE;
+
+       /* Initialize and enable the timer interrupt */
+       at91rm9200_timer_reset();
+}
+
+#ifdef CONFIG_PM
+static void at91rm9200_timer_suspend(void)
+{
+       /* disable Period Interval Timer interrupt */
+       at91_sys_write(AT91_ST_IDR, AT91_ST_PITS);
+}
+#else
+#define at91rm9200_timer_suspend       NULL
+#endif
+
+struct sys_timer at91rm9200_timer = {
+       .init           = at91rm9200_timer_init,
+       .offset         = at91rm9200_gettimeoffset,
+       .suspend        = at91rm9200_timer_suspend,
+       .resume         = at91rm9200_timer_reset,
+};
+
index e94645d77f7aec6c30df613fe775cfb9fe127de1..794d3fbb449ba0b3d6efe1f4985cb9a6a6fb0275 100644 (file)
@@ -18,7 +18,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/mm.h>
index 67d5f7786cdbbdc992f99e0573996fd4f2679647..c8b6f334246a9b41470e52ff3658854d760e16c2 100644 (file)
@@ -18,7 +18,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/mm.h>
index 48d7390fa584760879652a1744791d172e7b0d12..65873037e02ad94572290e4848fb330b16b01491 100644 (file)
@@ -21,7 +21,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/mm.h>
index 72202ed830addcf152cd3ec50e7460b511c47c54..868192351ddaf8dcde4af7d35100e6e1e42a9543 100644 (file)
@@ -21,7 +21,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/mm.h>
diff --git a/arch/arm/mach-at91rm9200/common.c b/arch/arm/mach-at91rm9200/common.c
deleted file mode 100644 (file)
index e836f85..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * arch/arm/mach-at91rm9200/common.c
- *
- *  Copyright (C) 2005 SAN People
- *
- * 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/config.h>
-#include <linux/module.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-
-#include <asm/hardware.h>
-#include "generic.h"
-
-static struct map_desc at91rm9200_io_desc[] __initdata = {
-       {
-               .virtual        = AT91_VA_BASE_SYS,
-               .pfn            = __phys_to_pfn(AT91_BASE_SYS),
-               .length         = SZ_4K,
-               .type           = MT_DEVICE,
-       }, {
-               .virtual        = AT91_VA_BASE_SPI,
-               .pfn            = __phys_to_pfn(AT91_BASE_SPI),
-               .length         = SZ_16K,
-               .type           = MT_DEVICE,
-       }, {
-               .virtual        = AT91_VA_BASE_SSC2,
-               .pfn            = __phys_to_pfn(AT91_BASE_SSC2),
-               .length         = SZ_16K,
-               .type           = MT_DEVICE,
-       }, {
-               .virtual        = AT91_VA_BASE_SSC1,
-               .pfn            = __phys_to_pfn(AT91_BASE_SSC1),
-               .length         = SZ_16K,
-               .type           = MT_DEVICE,
-       }, {
-               .virtual        = AT91_VA_BASE_SSC0,
-               .pfn            = __phys_to_pfn(AT91_BASE_SSC0),
-               .length         = SZ_16K,
-               .type           = MT_DEVICE,
-       }, {
-               .virtual        = AT91_VA_BASE_US3,
-               .pfn            = __phys_to_pfn(AT91_BASE_US3),
-               .length         = SZ_16K,
-               .type           = MT_DEVICE,
-       }, {
-               .virtual        = AT91_VA_BASE_US2,
-               .pfn            = __phys_to_pfn(AT91_BASE_US2),
-               .length         = SZ_16K,
-               .type           = MT_DEVICE,
-       }, {
-               .virtual        = AT91_VA_BASE_US1,
-               .pfn            = __phys_to_pfn(AT91_BASE_US1),
-               .length         = SZ_16K,
-               .type           = MT_DEVICE,
-       }, {
-               .virtual        = AT91_VA_BASE_US0,
-               .pfn            = __phys_to_pfn(AT91_BASE_US0),
-               .length         = SZ_16K,
-               .type           = MT_DEVICE,
-       }, {
-               .virtual        = AT91_VA_BASE_EMAC,
-               .pfn            = __phys_to_pfn(AT91_BASE_EMAC),
-               .length         = SZ_16K,
-               .type           = MT_DEVICE,
-       }, {
-               .virtual        = AT91_VA_BASE_TWI,
-               .pfn            = __phys_to_pfn(AT91_BASE_TWI),
-               .length         = SZ_16K,
-               .type           = MT_DEVICE,
-       }, {
-               .virtual        = AT91_VA_BASE_MCI,
-               .pfn            = __phys_to_pfn(AT91_BASE_MCI),
-               .length         = SZ_16K,
-               .type           = MT_DEVICE,
-       }, {
-               .virtual        = AT91_VA_BASE_UDP,
-               .pfn            = __phys_to_pfn(AT91_BASE_UDP),
-               .length         = SZ_16K,
-               .type           = MT_DEVICE,
-       }, {
-               .virtual        = AT91_VA_BASE_TCB1,
-               .pfn            = __phys_to_pfn(AT91_BASE_TCB1),
-               .length         = SZ_16K,
-               .type           = MT_DEVICE,
-       }, {
-               .virtual        = AT91_VA_BASE_TCB0,
-               .pfn            = __phys_to_pfn(AT91_BASE_TCB0),
-               .length         = SZ_16K,
-               .type           = MT_DEVICE,
-       }, {
-               .virtual        = AT91_SRAM_VIRT_BASE,
-               .pfn            = __phys_to_pfn(AT91_SRAM_BASE),
-               .length         = AT91_SRAM_SIZE,
-               .type           = MT_DEVICE,
-       },
-};
-
-void __init at91rm9200_map_io(void)
-{
-       iotable_init(at91rm9200_io_desc, ARRAY_SIZE(at91rm9200_io_desc));
-}
-
index 1cf85d231baa92afd6951b1d64d0f0ed34df01dc..4352acb88178a6930c1a0a39c6f76cda1f0c355d 100644 (file)
@@ -13,7 +13,6 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
-#include <linux/config.h>
 #include <linux/platform_device.h>
 
 #include <asm/hardware.h>
index 83c34747087bde8ed0a328ddaaa2db4032bbb049..5783c282ae7b3e3288160a1cab22bf4db71d8172 100644 (file)
  */
 
 #include <linux/errno.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/kernel.h>
 #include <linux/list.h>
 #include <linux/module.h>
 
 #include <asm/io.h>
-#include <asm/mach/irq.h>
 #include <asm/hardware.h>
 #include <asm/arch/gpio.h>
 
@@ -340,7 +341,7 @@ static void gpio_irq_handler(unsigned irq, struct irqdesc *desc, struct pt_regs
        void __iomem    *pio;
        u32             isr;
 
-       pio = desc->base;
+       pio = get_irq_chip_data(irq);
 
        /* temporarily mask (level sensitive) parent IRQ */
        desc->chip->ack(irq);
@@ -350,12 +351,12 @@ static void gpio_irq_handler(unsigned irq, struct irqdesc *desc, struct pt_regs
                if (!isr)
                        break;
 
-               pin = (unsigned) desc->data;
+               pin = (unsigned) get_irq_data(irq);
                gpio = &irq_desc[pin];
 
                while (isr) {
                        if (isr & 1) {
-                               if (unlikely(gpio->disable_depth)) {
+                               if (unlikely(gpio->depth)) {
                                        /*
                                         * The core ARM interrupt handler lazily disables IRQs so
                                         * another IRQ must be generated before it actually gets
@@ -364,7 +365,7 @@ static void gpio_irq_handler(unsigned irq, struct irqdesc *desc, struct pt_regs
                                        gpio_irq_mask(pin);
                                }
                                else
-                                       gpio->handle(pin, gpio, regs);
+                                       desc_handle_irq(pin, gpio, regs);
                        }
                        pin++;
                        gpio++;
index 70f4d7ac1533cfca40206fc396d7886f186429fe..dcd560dbcfb7ea9bb933a0b93165eeed1472f781 100644 (file)
@@ -20,7 +20,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/mm.h>
index 28150e8905ba411674409960f275b2f631818e39..1a333730466ef2d052d9dee907bce838a870bf60 100644 (file)
@@ -9,7 +9,6 @@
  * 2 of the License, or (at your option) any later version.
 */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
diff --git a/arch/arm/mach-at91rm9200/time.c b/arch/arm/mach-at91rm9200/time.c
deleted file mode 100644 (file)
index fc2d7d5..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * linux/arch/arm/mach-at91rm9200/time.c
- *
- *  Copyright (C) 2003 SAN People
- *  Copyright (C) 2003 ATMEL
- *
- * 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/config.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/time.h>
-
-#include <asm/hardware.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/mach/time.h>
-
-static unsigned long last_crtr;
-
-/*
- * The ST_CRTR is updated asynchronously to the master clock.  It is therefore
- *  necessary to read it twice (with the same value) to ensure accuracy.
- */
-static inline unsigned long read_CRTR(void) {
-       unsigned long x1, x2;
-
-       do {
-               x1 = at91_sys_read(AT91_ST_CRTR);
-               x2 = at91_sys_read(AT91_ST_CRTR);
-       } while (x1 != x2);
-
-       return x1;
-}
-
-/*
- * Returns number of microseconds since last timer interrupt.  Note that interrupts
- * will have been disabled by do_gettimeofday()
- *  'LATCH' is hwclock ticks (see CLOCK_TICK_RATE in timex.h) per jiffy.
- *  'tick' is usecs per jiffy (linux/timex.h).
- */
-static unsigned long at91rm9200_gettimeoffset(void)
-{
-       unsigned long elapsed;
-
-       elapsed = (read_CRTR() - last_crtr) & AT91_ST_ALMV;
-
-       return (unsigned long)(elapsed * (tick_nsec / 1000)) / LATCH;
-}
-
-/*
- * IRQ handler for the timer.
- */
-static irqreturn_t at91rm9200_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
-{
-       if (at91_sys_read(AT91_ST_SR) & AT91_ST_PITS) { /* This is a shared interrupt */
-               write_seqlock(&xtime_lock);
-
-               while (((read_CRTR() - last_crtr) & AT91_ST_ALMV) >= LATCH) {
-                       timer_tick(regs);
-                       last_crtr = (last_crtr + LATCH) & AT91_ST_ALMV;
-               }
-
-               write_sequnlock(&xtime_lock);
-
-               return IRQ_HANDLED;
-       }
-       else
-               return IRQ_NONE;                /* not handled */
-}
-
-static struct irqaction at91rm9200_timer_irq = {
-       .name           = "at91_tick",
-       .flags          = SA_SHIRQ | SA_INTERRUPT | SA_TIMER,
-       .handler        = at91rm9200_timer_interrupt
-};
-
-void at91rm9200_timer_reset(void)
-{
-       last_crtr = 0;
-
-       /* Real time counter incremented every 30.51758 microseconds */
-       at91_sys_write(AT91_ST_RTMR, 1);
-
-       /* Set Period Interval timer */
-       at91_sys_write(AT91_ST_PIMR, LATCH);
-
-       /* Enable Period Interval Timer interrupt */
-       at91_sys_write(AT91_ST_IER, AT91_ST_PITS);
-}
-
-/*
- * Set up timer interrupt.
- */
-void __init at91rm9200_timer_init(void)
-{
-       /* Disable all timer interrupts */
-       at91_sys_write(AT91_ST_IDR, AT91_ST_PITS | AT91_ST_WDOVF | AT91_ST_RTTINC | AT91_ST_ALMS);
-       (void) at91_sys_read(AT91_ST_SR);       /* Clear any pending interrupts */
-
-       /* Make IRQs happen for the system timer */
-       setup_irq(AT91_ID_SYS, &at91rm9200_timer_irq);
-
-       /* Change the kernel's 'tick' value to 10009 usec. (the default is 10000) */
-       tick_usec = (LATCH * 1000000) / CLOCK_TICK_RATE;
-
-       /* Initialize and enable the timer interrupt */
-       at91rm9200_timer_reset();
-}
-
-#ifdef CONFIG_PM
-static void at91rm9200_timer_suspend(void)
-{
-       /* disable Period Interval Timer interrupt */
-       at91_sys_write(AT91_ST_IDR, AT91_ST_PITS);
-}
-#else
-#define at91rm9200_timer_suspend       NULL
-#endif
-
-struct sys_timer at91rm9200_timer = {
-       .init           = at91rm9200_timer_init,
-       .offset         = at91rm9200_gettimeoffset,
-       .suspend        = at91rm9200_timer_suspend,
-       .resume         = at91rm9200_timer_reset,
-};
-
index ff26a85aa4bac24b1442d757b81693e0d627a4a1..3792ab4f09967c5bdd04cf537768003943167a22 100644 (file)
@@ -19,7 +19,6 @@
  * 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/config.h>
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/initrd.h>
index 9ba45f4d5a7e1c5dab8f59e0db1fa01709c336d1..c8ecd2480c276e00d27f6c6e40b64ff0961bf037 100644 (file)
@@ -17,7 +17,6 @@
  * 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/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/types.h>
index 1a23f0dcd4b89cee7e8b6b3afedbaeb80aab9ed3..a071eac4a30a3cd5617b914a34b87bae00b54b09 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/timex.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/sched.h>
 
 #include <asm/hardware.h>
@@ -57,7 +58,7 @@ p720t_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 static struct irqaction clps711x_timer_irq = {
        .name           = "CLPS711x Timer Tick",
-       .flags          = SA_INTERRUPT | SA_TIMER,
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
        .handler        = p720t_timer_interrupt,
 };
 
index 5b12cab0e6917b750500ac6ae72796768a8c31ff..92eaebdd56061455fdfbb812e6b5cc3f4d861f57 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/list.h>
 #include <linux/sched.h>
 #include <linux/init.h>
@@ -315,7 +316,7 @@ clps7500_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 static struct irqaction clps7500_timer_irq = {
        .name           = "CLPS7500 Timer Tick",
-       .flags          = SA_INTERRUPT | SA_TIMER,
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
        .handler        = clps7500_timer_interrupt,
 };
 
index 6d620d8268cc1b84846d1cb93d3b94e659185ee8..70dd12ef3c40da46521d35a8bc527e8c546716b8 100644 (file)
@@ -199,7 +199,7 @@ ebsa110_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 static struct irqaction ebsa110_timer_irq = {
        .name           = "EBSA110 Timer Tick",
-       .flags          = SA_INTERRUPT | SA_TIMER,
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
        .handler        = ebsa110_timer_interrupt,
 };
 
index e15e4c54a2538a53b50c238766d2ba3ac6598e44..f1b740083aee5dfc30967a09540614ddfeb714f9 100644 (file)
@@ -9,12 +9,24 @@ config CRUNCH
 
 comment "EP93xx Platforms"
 
+config MACH_EDB9302
+       bool "Support Cirrus Logic EDB9302"
+       help
+         Say 'Y' here if you want your kernel to support the Cirrus
+         Logic EDB9302 Evaluation Board.
+
 config MACH_EDB9315
        bool "Support Cirrus Logic EDB9315"
        help
          Say 'Y' here if you want your kernel to support the Cirrus
          Logic EDB9315 Evaluation Board.
 
+config MACH_EDB9315A
+       bool "Support Cirrus Logic EDB9315A"
+       help
+         Say 'Y' here if you want your kernel to support the Cirrus
+         Logic EDB9315A Evaluation Board.
+
 config MACH_GESBC9312
        bool "Support Glomation GESBC-9312-sx"
        help
index dfa7e2e8a18b65621d87eeab94c689d1990c14f2..1f5a6b0487ee542e43dd5e4498f0422fcd68712e 100644 (file)
@@ -6,6 +6,8 @@ obj-m                   :=
 obj-n                  :=
 obj-                   :=
 
+obj-$(CONFIG_MACH_EDB9302)     += edb9302.o
 obj-$(CONFIG_MACH_EDB9315)     += edb9315.o
+obj-$(CONFIG_MACH_EDB9315A)    += edb9315a.o
 obj-$(CONFIG_MACH_GESBC9312)   += gesbc9312.o
 obj-$(CONFIG_MACH_TS72XX)      += ts72xx.o
index 1fe73c0a9d01ea81d37c9670d999268fbd557664..a87a784b9201519db7e5138b68aa34b305c08f0b 100644 (file)
@@ -13,7 +13,6 @@
  * your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
@@ -117,7 +116,7 @@ static int ep93xx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 static struct irqaction ep93xx_timer_irq = {
        .name           = "ep93xx timer",
-       .flags          = SA_INTERRUPT | SA_TIMER,
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
        .handler        = ep93xx_timer_interrupt,
 };
 
diff --git a/arch/arm/mach-ep93xx/edb9302.c b/arch/arm/mach-ep93xx/edb9302.c
new file mode 100644 (file)
index 0000000..62a8efd
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * arch/arm/mach-ep93xx/edb9302.c
+ * Cirrus Logic EDB9302 support.
+ *
+ * Copyright (C) 2006 George Kashperko <george@chas.com.ua>
+ *
+ * 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/config.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/sched.h>
+#include <linux/interrupt.h>
+#include <linux/ioport.h>
+#include <linux/mtd/physmap.h>
+#include <linux/platform_device.h>
+#include <asm/io.h>
+#include <asm/hardware.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+
+static struct physmap_flash_data edb9302_flash_data = {
+       .width          = 2,
+};
+
+static struct resource edb9302_flash_resource = {
+       .start          = 0x60000000,
+       .end            = 0x60ffffff,
+       .flags          = IORESOURCE_MEM,
+};
+
+static struct platform_device edb9302_flash = {
+       .name           = "physmap-flash",
+       .id             = 0,
+       .dev            = {
+               .platform_data  = &edb9302_flash_data,
+       },
+       .num_resources  = 1,
+       .resource       = &edb9302_flash_resource,
+};
+
+static void __init edb9302_init_machine(void)
+{
+       ep93xx_init_devices();
+       platform_device_register(&edb9302_flash);
+}
+
+MACHINE_START(EDB9302, "Cirrus Logic EDB9302 Evaluation Board")
+       /* Maintainer: George Kashperko <george@chas.com.ua> */
+       .phys_io        = EP93XX_APB_PHYS_BASE,
+       .io_pg_offst    = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
+       .boot_params    = 0x00000100,
+       .map_io         = ep93xx_map_io,
+       .init_irq       = ep93xx_init_irq,
+       .timer          = &ep93xx_timer,
+       .init_machine   = edb9302_init_machine,
+MACHINE_END
diff --git a/arch/arm/mach-ep93xx/edb9315a.c b/arch/arm/mach-ep93xx/edb9315a.c
new file mode 100644 (file)
index 0000000..bfefdaa
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * arch/arm/mach-ep93xx/edb9315a.c
+ * Cirrus Logic EDB9315A support.
+ *
+ * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.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.
+ */
+
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/sched.h>
+#include <linux/interrupt.h>
+#include <linux/ioport.h>
+#include <linux/mtd/physmap.h>
+#include <linux/platform_device.h>
+#include <asm/io.h>
+#include <asm/hardware.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+
+static struct physmap_flash_data edb9315a_flash_data = {
+       .width          = 2,
+};
+
+static struct resource edb9315a_flash_resource = {
+       .start          = 0x60000000,
+       .end            = 0x60ffffff,
+       .flags          = IORESOURCE_MEM,
+};
+
+static struct platform_device edb9315a_flash = {
+       .name           = "physmap-flash",
+       .id             = 0,
+       .dev            = {
+               .platform_data  = &edb9315a_flash_data,
+       },
+       .num_resources  = 1,
+       .resource       = &edb9315a_flash_resource,
+};
+
+static void __init edb9315a_init_machine(void)
+{
+       ep93xx_init_devices();
+       platform_device_register(&edb9315a_flash);
+}
+
+MACHINE_START(EDB9315A, "Cirrus Logic EDB9315A Evaluation Board")
+       /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
+       .phys_io        = EP93XX_APB_PHYS_BASE,
+       .io_pg_offst    = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
+       .boot_params    = 0xc0000100,
+       .map_io         = ep93xx_map_io,
+       .init_irq       = ep93xx_init_irq,
+       .timer          = &ep93xx_timer,
+       .init_machine   = edb9315a_init_machine,
+MACHINE_END
index 2c28d66d260ec7d1a7660278d3a77e99630ff51f..e760fd4f36559e3e26418c03ecb3c1b9774604cf 100644 (file)
@@ -10,7 +10,6 @@
  * your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/mm.h>
index 0b3b875b1875221dd0695abd3150f4eacd401097..df315f2e9bebe9219474f6845fd4794c7466abe2 100644 (file)
@@ -10,7 +10,6 @@
  * your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/mm.h>
index bbe6e4a0bf6ab0457defaa8e990466ca3af282cd..af900f4755a44fabe0afff71d06334d06dc50349 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.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/mm.h>
index 14a62d6008fe2f6165001d34ebc5c0d894f2084b..2af610811ca4247bda63c9a885163ba4891911e4 100644 (file)
@@ -6,6 +6,7 @@
  */
 #include <linux/init.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 
 #include <asm/irq.h>
 
@@ -43,7 +44,7 @@ timer1_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 static struct irqaction footbridge_timer_irq = {
        .name           = "Timer1 timer tick",
        .handler        = timer1_interrupt,
-       .flags          = SA_INTERRUPT | SA_TIMER,
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
 };
 
 /*
index 5dace2597838478b57dd4f577e61e37814565fa4..607ed1f5b3f8fce10525e83d1075c224c7d8ee72 100644 (file)
@@ -332,15 +332,15 @@ void __init dc21285_preinit(void)
        /*
         * We don't care if these fail.
         */
-       request_irq(IRQ_PCI_SERR, dc21285_serr_irq, SA_INTERRUPT,
+       request_irq(IRQ_PCI_SERR, dc21285_serr_irq, IRQF_DISABLED,
                    "PCI system error", &serr_timer);
-       request_irq(IRQ_PCI_PERR, dc21285_parity_irq, SA_INTERRUPT,
+       request_irq(IRQ_PCI_PERR, dc21285_parity_irq, IRQF_DISABLED,
                    "PCI parity error", &perr_timer);
-       request_irq(IRQ_PCI_ABORT, dc21285_abort_irq, SA_INTERRUPT,
+       request_irq(IRQ_PCI_ABORT, dc21285_abort_irq, IRQF_DISABLED,
                    "PCI abort", NULL);
-       request_irq(IRQ_DISCARD_TIMER, dc21285_discard_irq, SA_INTERRUPT,
+       request_irq(IRQ_DISCARD_TIMER, dc21285_discard_irq, IRQF_DISABLED,
                    "Discard timer", NULL);
-       request_irq(IRQ_PCI_DPERR, dc21285_dparity_irq, SA_INTERRUPT,
+       request_irq(IRQ_PCI_DPERR, dc21285_dparity_irq, IRQF_DISABLED,
                    "PCI data parity", NULL);
 
        if (cfn_mode) {
index 7a54578b51af5666025cdb679496f3c5492c6a6b..1f9b09b8ed88478746155d2291981e49a4f481d3 100644 (file)
@@ -10,7 +10,6 @@
  *   17-Mar-1999 RMK   Allow any EBSA285-like architecture to have
  *                     ISA DMA controllers.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 
 #include <asm/dma.h>
index 2c7c3630401bd2968544653331380dd719ab29a0..a64e22226515ba88ec289e00648c448b017f5fe8 100644 (file)
@@ -16,7 +16,6 @@
  * Changelog:
  *   02-05-1999        RMK     Various cleanups
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index e1c43b331d64d357ece5282be3929cd136bfe026..87448c2d6baa192fb621047ee47d1b0e3e1133d4 100644 (file)
@@ -98,9 +98,22 @@ isa_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
        desc_handle_irq(isa_irq, desc, regs);
 }
 
-static struct irqaction irq_cascade = { .handler = no_action, .name = "cascade", };
-static struct resource pic1_resource = { "pic1", 0x20, 0x3f };
-static struct resource pic2_resource = { "pic2", 0xa0, 0xbf };
+static struct irqaction irq_cascade = {
+       .handler = no_action,
+       .name = "cascade",
+};
+
+static struct resource pic1_resource = {
+       .name   = "pic1",
+       .start  = 0x20,
+       .end    = 0x3f,
+};
+
+static struct resource pic2_resource = {
+       .name   = "pic2",
+       .start  = 0xa0,
+       .end    = 0xbf,
+};
 
 void __init isa_init_irq(unsigned int host_irq)
 {
index c1d74f7ab669f76948663796e6de753131fa64aa..c4810a40c8e1275e9d63e1670d4db71d7876beb2 100644 (file)
@@ -6,6 +6,7 @@
  */
 #include <linux/init.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
@@ -72,7 +73,7 @@ isa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 static struct irqaction isa_timer_irq = {
        .name           = "ISA timer tick",
        .handler        = isa_timer_interrupt,
-       .flags          = SA_INTERRUPT | SA_TIMER,
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
 };
 
 static void __init isa_timer_init(void)
index 229bf0585e40a8c7d0d35669d51d5c714f251a96..a1f381c64a30e108d1077a843ad4afb90c1b371d 100644 (file)
@@ -5,7 +5,6 @@
  *
  * Copyright (C) 1998, 1999 Russell King, Phil Blundell
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/ioport.h>
 #include <linux/kernel.h>
index 7451fc07b85aa48199603f8603796d1be7af334f..8e9cac5a213bb7d35648ba0b32d69f441a2d8dc4 100644 (file)
@@ -16,7 +16,6 @@
  * Changelog:
  *   02-05-1999        RMK     Various cleanups
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index af9e4a5d5ea7fcd97c9fe5e714b516391426ba36..a9a8255a3a0397deaf698d46e5f4587ea0931db8 100644 (file)
@@ -41,7 +41,7 @@ h7201_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 static struct irqaction h7201_timer_irq = {
        .name           = "h7201 Timer Tick",
-       .flags          = SA_INTERRUPT | SA_TIMER,
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
        .handler        = h7201_timer_interrupt,
 };
 
index a4a7c0125d030ea3e5482a4f716d05d08f4f5700..da678d163fd992487ba97ef48a1c6bb3247ac4dd 100644 (file)
@@ -171,7 +171,7 @@ static struct irqchip h7202_timerx_chip = {
 
 static struct irqaction h7202_timer_irq = {
        .name           = "h7202 Timer Tick",
-       .flags          = SA_INTERRUPT | SA_TIMER,
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
        .handler        = h7202_timer_interrupt,
 };
 
index 193f968edac3a0a16c09a0d1266ef71b92806925..407cd4c0aa8add05c59eeeef2ff113a60ab85095 100644 (file)
@@ -13,7 +13,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
index 36266896979c04920e1cae80dfe829618646bb68..bf2acdce62e5cc6dfec0b36fddaf6acef247782d 100644 (file)
@@ -13,7 +13,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
index ea805bfa5e5401f01455f47d586fde14ecfb5b2d..6ed7523c65bb6f8bf51bb1de03afb398395ffa16 100644 (file)
@@ -8,11 +8,11 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/time.h>
 
 #include <asm/hardware.h>
@@ -72,7 +72,7 @@ imx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 static struct irqaction imx_timer_irq = {
        .name           = "i.MX Timer Tick",
-       .flags          = SA_INTERRUPT | SA_TIMER,
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
        .handler        = imx_timer_interrupt,
 };
 
index 576a5e979c0003b6ed8112ce15d1b2d2dacea8c2..42021fdfa0c67790634c22eac3df24a47c1b5b13 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/device.h>
 #include <linux/spinlock.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/sched.h>
 #include <linux/smp.h>
 #include <linux/termios.h>
@@ -281,7 +282,7 @@ integrator_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 static struct irqaction integrator_timer_irq = {
        .name           = "Integrator Timer Tick",
-       .flags          = SA_INTERRUPT | SA_TIMER,
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
        .handler        = integrator_timer_interrupt,
 };
 
index 229a63a525cdd353bea66351f3bbbe9f70b492d4..f9043592e29936f14f38a7682e57c6b7db6f8fb0 100644 (file)
@@ -20,7 +20,6 @@
  * 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/config.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/ptrace.h>
index bc07f52a6fd797e2a51be9190ee4e773772fe20b..ee49cf790dab5f2570366fa7b4cf789ffb770628 100644 (file)
@@ -125,7 +125,7 @@ static int rtc_probe(struct amba_device *dev, void *id)
 
        xtime.tv_sec = __raw_readl(rtc_base + RTC_DR);
 
-       ret = request_irq(dev->irq[0], arm_rtc_interrupt, SA_INTERRUPT,
+       ret = request_irq(dev->irq[0], arm_rtc_interrupt, IRQF_DISABLED,
                          "rtc-pl030", dev);
        if (ret)
                goto map_out;
index 2bfe8c729f9f3c0a179b5af3c4fb6311853aaa3f..4422f2388607dc102249a53d610c4b2320516152 100644 (file)
@@ -30,12 +30,15 @@ config MACH_IQ80332
        select ARCH_IOP331
        help
          Say Y here if you want to run your kernel on the Intel IQ80332
-         evaluation kit for the IOP332 chipset
+         evaluation kit for the IOP332 chipset.
 
 config ARCH_EP80219
-    bool "Enable support for EP80219"
-    select ARCH_IOP321
-    select ARCH_IQ31244
+       bool "Enable support for EP80219"
+       select ARCH_IOP321
+       select ARCH_IQ31244
+       help
+         Say Y here if you want to run your kernel on the Intel EP80219
+         evaluation kit for the Intel 80219 chipset (a IOP321 variant).
 
 # Which IOP variant are we running?
 config ARCH_IOP321
@@ -56,8 +59,8 @@ config IOP331_STEPD
        bool "Chip stepping D of the IOP80331 processor or IOP80333"
        depends on (ARCH_IOP331)
        help
-                 Say Y here if you have StepD of the IOP80331 or IOP8033
-                 based platforms.
+         Say Y here if you have StepD of the IOP80331 or IOP8033
+         based platforms.
 
 endmenu
 endif
index fdeeef489a73592039c605ed55a2156ac277801f..d7f50e57e753e6ab10654f62ca57d87dafd0d0b5 100644 (file)
@@ -12,7 +12,6 @@
  * warranty of any kind, whether express or implied.
  */
 
-#include <linux/config.h>
 #include <linux/delay.h>
 #include <asm/hardware.h>
 
index 0ebbcb20c6ae2ab3a43177a019c51ec254d16400..b6d096903c4ae65c92eb6826d6c9f8ac3639b28c 100644 (file)
@@ -12,7 +12,6 @@
  */
 #include <linux/mm.h>
 #include <linux/init.h>
-#include <linux/config.h>
 #include <linux/major.h>
 #include <linux/fs.h>
 #include <linux/platform_device.h>
index d67ac0e5d4381ef06bba8dca5a3848d9b4d9a4f4..04b1a6f7ebae9ae6868dea1b36b26c1ec1df3602 100644 (file)
@@ -85,7 +85,7 @@ iop321_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 static struct irqaction iop321_timer_irq = {
        .name           = "IOP321 Timer Tick",
        .handler        = iop321_timer_interrupt,
-       .flags          = SA_INTERRUPT | SA_TIMER,
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
 };
 
 static void __init iop321_timer_init(void)
index 7b7b6eea38469198b7de3454877d4f49f248fb9f..3cc98d892ad48ca349a03504bfaa9b2eda130695 100644 (file)
@@ -11,7 +11,6 @@
  */
 #include <linux/mm.h>
 #include <linux/init.h>
-#include <linux/config.h>
 #include <linux/major.h>
 #include <linux/fs.h>
 #include <linux/platform_device.h>
index 3c1f0ebbd636e42e8160fddae779bf81d90c9e9c..0c09e74c574042240a5d1af81fc57502eaf0ec5d 100644 (file)
@@ -82,7 +82,7 @@ iop331_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 static struct irqaction iop331_timer_irq = {
        .name           = "IOP331 Timer Tick",
        .handler        = iop331_timer_interrupt,
-       .flags          = SA_INTERRUPT | SA_TIMER,
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
 };
 
 static void __init iop331_timer_init(void)
index ebe4391dd7f96ed8d5c6048123dcedaca0d321e5..7f91f689a04106c47cac822756d50dc946c5f185 100644 (file)
  * warranty of any kind, whether express or implied.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
 #include <linux/sched.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/serial.h>
 #include <linux/tty.h>
 #include <linux/bitops.h>
@@ -224,7 +224,7 @@ static int ixp2000_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 static struct irqaction ixp2000_timer_irq = {
        .name           = "IXP2000 Timer Tick",
-       .flags          = SA_INTERRUPT | SA_TIMER,
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
        .handler        = ixp2000_timer_interrupt,
 };
 
@@ -409,7 +409,7 @@ static void ixp2000_err_irq_handler(unsigned int irq, struct irqdesc *desc,  str
        for(i = 31; i >= 0; i--) {
                if(status & (1 << i)) {
                        desc = irq_desc + IRQ_IXP2000_DRAM0_MIN_ERR + i;
-                       desc->handle(IRQ_IXP2000_DRAM0_MIN_ERR + i, desc, regs);
+                       desc_handle_irq(IRQ_IXP2000_DRAM0_MIN_ERR + i, desc, regs);
                }
        }
 }
index 52fac89e95b59c28701cfdbedfee0519820cf1af..ac29298c5d3f237f24d1691c6d8cf2928616ab00 100644 (file)
@@ -18,7 +18,6 @@
  *  option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/mm.h>
index 09101271298e0fa54ee93956555db25983da33d1..a6f14801872d3aa73f75b26dd2d4bb31d45f4f7b 100644 (file)
@@ -14,7 +14,6 @@
  *  Free Software Foundation;  either version 2 of the  License, or (at your
  *  option) any later version.
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/mm.h>
index 076e3f8acc961f8f6d8268539cb2254d5a64b74c..91d36d91dac03f501a4a3c4377a9802ac13d7082 100644 (file)
@@ -14,7 +14,6 @@
  *  Free Software Foundation;  either version 2 of the  License, or (at your
  *  option) any later version.
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/mm.h>
index d628da56b4bcf6d4ee5db0cfdc236f137880e8d4..40eef8b367407dd0a6ab61cb46d0484d8c54db60 100644 (file)
@@ -14,7 +14,6 @@
  *  Free Software Foundation;  either version 2 of the  License, or (at your
  *  option) any later version.
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/mm.h>
@@ -168,7 +167,7 @@ void ixdp2x00_init_irq(volatile unsigned long *stat_reg, volatile unsigned long
        }
 
        /* Hook into PCI interrupt */
-       set_irq_chained_handler(IRQ_IXP2000_PCIB, &ixdp2x00_irq_handler);
+       set_irq_chained_handler(IRQ_IXP2000_PCIB, ixdp2x00_irq_handler);
 }
 
 /*************************************************************************
index 66915282a463562025c79285273628631e75c887..7f42366f60d165d11666666bf8593b8efa4f49ca 100644 (file)
@@ -15,7 +15,6 @@
  *  option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/mm.h>
@@ -128,7 +127,7 @@ void __init ixdp2x01_init_irq(void)
        }
 
        /* Hook into PCI interrupts */
-       set_irq_chained_handler(IRQ_IXP2000_PCIB, &ixdp2x01_irq_handler);
+       set_irq_chained_handler(IRQ_IXP2000_PCIB, ixdp2x01_irq_handler);
 }
 
 
index 051e3d70026e7b1eb96763c9e3704e2cf19e84f0..566a07821c77a939ea638677971c5f9a471e1bb5 100644 (file)
@@ -14,7 +14,6 @@
  * warranty of any kind, whether express or implied.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
@@ -272,7 +271,7 @@ static void pci_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *
        }
 
        int_desc = irq_desc + irqno;
-       int_desc->handle(irqno, int_desc, regs);
+       desc_handle_irq(irqno, int_desc, regs);
 
        desc->chip->unmask(irq);
 }
@@ -364,7 +363,7 @@ ixp23xx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 static struct irqaction ixp23xx_timer_irq = {
        .name           = "IXP23xx Timer Tick",
        .handler        = ixp23xx_timer_interrupt,
-       .flags          = SA_INTERRUPT | SA_TIMER,
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
 };
 
 void __init ixp23xx_init_timer(void)
index 357351fbb1e217fba6d6b833194b48a499cf3e4e..7a85ced567184c06487742bad59c9db0a5cce56f 100644 (file)
@@ -10,7 +10,6 @@
  * warranty of any kind, whether express or implied.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
index e0886871cc773d34effab66e4ca9e5be199b43cb..37a32e6bcca2d1e52cb88128f091cd5858efdc57 100644 (file)
  * warranty of any kind, whether express or implied.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
 #include <linux/sched.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/serial.h>
 #include <linux/tty.h>
 #include <linux/bitops.h>
@@ -37,7 +37,6 @@
 #include <asm/memory.h>
 #include <asm/hardware.h>
 #include <asm/mach-types.h>
-#include <asm/irq.h>
 #include <asm/system.h>
 #include <asm/tlbflush.h>
 #include <asm/pgtable.h>
@@ -75,7 +74,7 @@ static void ixdp2351_inta_handler(unsigned int irq, struct irqdesc *desc, struct
                        int cpld_irq =
                                IXP23XX_MACH_IRQ(IXDP2351_INTA_IRQ_BASE + i);
                        cpld_desc = irq_desc + cpld_irq;
-                       cpld_desc->handle(cpld_irq, cpld_desc, regs);
+                       desc_handle_irq(cpld_irq, cpld_desc, regs);
                }
        }
 
@@ -112,7 +111,7 @@ static void ixdp2351_intb_handler(unsigned int irq, struct irqdesc *desc, struct
                        int cpld_irq =
                                IXP23XX_MACH_IRQ(IXDP2351_INTB_IRQ_BASE + i);
                        cpld_desc = irq_desc + cpld_irq;
-                       cpld_desc->handle(cpld_irq, cpld_desc, regs);
+                       desc_handle_irq(cpld_irq, cpld_desc, regs);
                }
        }
 
@@ -159,8 +158,8 @@ void ixdp2351_init_irq(void)
                }
        }
 
-       set_irq_chained_handler(IRQ_IXP23XX_INTA, &ixdp2351_inta_handler);
-       set_irq_chained_handler(IRQ_IXP23XX_INTB, &ixdp2351_intb_handler);
+       set_irq_chained_handler(IRQ_IXP23XX_INTA, ixdp2351_inta_handler);
+       set_irq_chained_handler(IRQ_IXP23XX_INTB, ixdp2351_intb_handler);
 }
 
 /*
index ac72f94c5b4d58dd15972abe63f997a865792513..3b34fa35e36bbcde0f1dacc892aac432c0617398 100644 (file)
@@ -16,7 +16,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
index 92ad18f4125167f45e562922771c81fba3c7a168..d06e21b70de57e4e9c627489a762fd0bf3a543cb 100644 (file)
@@ -14,7 +14,6 @@
  * warranty of any kind, whether express or implied.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
index bf25a76e9bdffcd78fdf314301e983d118eae0c8..7c25dbd5a181cb78723a5f969b55aebc94ba0029 100644 (file)
@@ -13,7 +13,6 @@
  * warranty of any kind, whether express or implied.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/init.h>
@@ -288,7 +287,7 @@ static irqreturn_t ixp4xx_timer_interrupt(int irq, void *dev_id, struct pt_regs
 
 static struct irqaction ixp4xx_timer_irq = {
        .name           = "IXP4xx Timer Tick",
-       .flags          = SA_INTERRUPT | SA_TIMER,
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
        .handler        = ixp4xx_timer_interrupt,
 };
 
index e6b7fcd923faaf46fdb9a02887acf0566e21eb79..2cebb2878895bdb0afc2a0707caf3bfde91bba57 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/init.h>
+#include <linux/irq.h>
 
 #include <asm/mach-types.h>
 #include <asm/hardware.h>
index da415d5d7f3719a9d70f688080db570011e55518..d5156c043f0b09094ba5279c651afd52162f9466 100644 (file)
@@ -15,9 +15,9 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/config.h>
 #include <linux/pci.h>
 #include <linux/init.h>
+#include <linux/irq.h>
 #include <linux/delay.h>
 
 #include <asm/mach/pci.h>
index 526fb6175bc312538ec835d52ab254949d595167..ed52708002174e222f635ef3c701fc1b8dbabbf7 100644 (file)
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/init.h>
+#include <linux/irq.h>
 
 #include <asm/mach-types.h>
 #include <asm/hardware.h>
-#include <asm/irq.h>
 
 #include <asm/mach/pci.h>
 
index 26b7c001ff64d6c5a5336377459443e4e1f10961..b8ebaf4a9c8e5db0dfba464bc70803aa7d04952c 100644 (file)
@@ -15,9 +15,9 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/pci.h>
 #include <linux/init.h>
+#include <linux/irq.h>
 
 #include <asm/mach/pci.h>
 #include <asm/mach-types.h>
index a3745ed37f9fc5c81e75bf491cc00c8d83e46835..81ffcae1f56ea4cdcff61191e367ed51f01c745a 100644 (file)
@@ -17,9 +17,9 @@
  *
  */
 
-#include <linux/module.h>
-#include <linux/reboot.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/module.h>
 #include <linux/reboot.h>
 
 #include <asm/mach-types.h>
@@ -42,7 +42,7 @@ static int __init nas100d_power_init(void)
        set_irq_type(NAS100D_RB_IRQ, IRQT_LOW);
 
        if (request_irq(NAS100D_RB_IRQ, &nas100d_reset_handler,
-               SA_INTERRUPT, "NAS100D reset button", NULL) < 0) {
+               IRQF_DISABLED, "NAS100D reset button", NULL) < 0) {
 
                printk(KERN_DEBUG "Reset Button IRQ %d not available\n",
                        NAS100D_RB_IRQ);
index ece860444d5b91ef57fb68f0f20ddf6791f103e4..0de639d6e60a5a4f418b05d3d1ee48940fff3d78 100644 (file)
@@ -15,7 +15,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/pci.h>
 #include <linux/init.h>
 
index 6d38e97142cc0df151cd8c6380b894915e2b2423..e2a2230b69f0d71e214f02adfe2289a74b3116ee 100644 (file)
@@ -54,7 +54,7 @@ static int __init nslu2_power_init(void)
        set_irq_type(NSLU2_PB_IRQ, IRQT_HIGH);
 
        if (request_irq(NSLU2_RB_IRQ, &nslu2_reset_handler,
-               SA_INTERRUPT, "NSLU2 reset button", NULL) < 0) {
+               IRQF_DISABLED, "NSLU2 reset button", NULL) < 0) {
 
                printk(KERN_DEBUG "Reset Button IRQ %d not available\n",
                        NSLU2_RB_IRQ);
@@ -63,7 +63,7 @@ static int __init nslu2_power_init(void)
        }
 
        if (request_irq(NSLU2_PB_IRQ, &nslu2_power_handler,
-               SA_INTERRUPT, "NSLU2 power button", NULL) < 0) {
+               IRQF_DISABLED, "NSLU2 power button", NULL) < 0) {
 
                printk(KERN_DEBUG "Power Button IRQ %d not available\n",
                        NSLU2_PB_IRQ);
index ac626436e96f09881cfd25e8c2c6827397a000da..b7af5640ea7bde758e804c119ad2be41bdf02102 100644 (file)
@@ -7,6 +7,7 @@
  */
 #include <linux/kernel.h>
 #include <linux/init.h>
+#include <linux/irq.h>
 #include <linux/device.h>
 
 #include <asm/types.h>
index c0e6854289f14ae7554ebd3815a78386bfd9e1a6..35c3606a20795f89be0567402ecf613187e5f878 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 
 #include <asm/hardware.h>
 #include <asm/setup.h>
index ef9af375fcc469e2b0773940d43e89020ae67541..ad5652e0150719e7776a81c1b90afbdea5e6142f 100644 (file)
@@ -8,10 +8,10 @@
  *  version 2 as published by the Free Software Foundation.
  *
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/time.h>
 
 #include <asm/hardware.h>
@@ -53,7 +53,7 @@ lh7a40x_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 static struct irqaction lh7a40x_timer_irq = {
        .name           = "LHA740x Timer Tick",
-       .flags          = SA_INTERRUPT | SA_TIMER,
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
        .handler        = lh7a40x_timer_interrupt,
 };
 
index edfbdf40c6000a72a864c5b6c728d39760a73e95..6d72c81b7d9f3c67ea9a696559fa683b0a5e78f9 100644 (file)
@@ -54,7 +54,7 @@ netx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 static struct irqaction netx_timer_irq = {
        .name           = "NetX Timer Tick",
-       .flags          = SA_INTERRUPT | SA_TIMER,
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
        .handler        = netx_timer_interrupt,
 };
 
index f8d716ccc1dfbdb278b82b88adfca95275dde60c..d135568dc9e7698e3c7ca99db7d9a083be50ef83 100644 (file)
@@ -62,6 +62,13 @@ config MACH_OMAP_PERSEUS2
          Support for TI OMAP 730 Perseus2 board. Say Y here if you have such
          a board.
 
+config MACH_OMAP_FSAMPLE
+       bool "TI F-Sample"
+       depends on ARCH_OMAP1 && ARCH_OMAP730
+       help
+         Support for TI OMAP 850 F-Sample board. Say Y here if you have such
+         a board.
+
 config MACH_VOICEBLUE
        bool "Voiceblue"
        depends on ARCH_OMAP1 && ARCH_OMAP15XX
index 9ea719550ad37f699478c1b271ed94651be246e7..7165f74f78dac18f4c5c4f7fc08272ee683a8dd1 100644 (file)
@@ -17,6 +17,7 @@ obj-$(CONFIG_MACH_OMAP_H2)            += board-h2.o
 obj-$(CONFIG_MACH_OMAP_INNOVATOR)      += board-innovator.o
 obj-$(CONFIG_MACH_OMAP_GENERIC)                += board-generic.o
 obj-$(CONFIG_MACH_OMAP_PERSEUS2)       += board-perseus2.o
+obj-$(CONFIG_MACH_OMAP_FSAMPLE)                += board-fsample.o
 obj-$(CONFIG_MACH_OMAP_OSK)            += board-osk.o
 obj-$(CONFIG_MACH_OMAP_H3)             += board-h3.o
 obj-$(CONFIG_MACH_VOICEBLUE)           += board-voiceblue.o
index 73df32aac4c4f7260ba98d187fafae7ed104e10f..8437d065ada50530b8d686e9dd42c2486384889e 100644 (file)
@@ -80,8 +80,15 @@ static struct omap_uart_config ams_delta_uart_config __initdata = {
        .enabled_uarts = 1,
 };
 
+static struct omap_usb_config ams_delta_usb_config __initdata = {
+       .register_host  = 1,
+       .hmc_mode       = 16,
+       .pins[0]        = 2,
+};
+
 static struct omap_board_config_kernel ams_delta_config[] = {
        { OMAP_TAG_UART,        &ams_delta_uart_config },
+       { OMAP_TAG_USB,         &ams_delta_usb_config },
 };
 
 static struct platform_device ams_delta_led_device = {
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c
new file mode 100644 (file)
index 0000000..c753a3c
--- /dev/null
@@ -0,0 +1,319 @@
+/*
+ * linux/arch/arm/mach-omap1/board-fsample.c
+ *
+ * Modified from board-perseus2.c
+ *
+ * Original OMAP730 support by Jean Pihet <j-pihet@ti.com>
+ * Updated for 2.6 by Kevin Hilman <kjh@hilman.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/delay.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/nand.h>
+#include <linux/mtd/partitions.h>
+#include <linux/input.h>
+
+#include <asm/hardware.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+#include <asm/mach/map.h>
+
+#include <asm/arch/tc.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/mux.h>
+#include <asm/arch/fpga.h>
+#include <asm/arch/keypad.h>
+#include <asm/arch/common.h>
+#include <asm/arch/board.h>
+#include <asm/arch/board-fsample.h>
+
+static int fsample_keymap[] = {
+       KEY(0,0,KEY_UP),
+       KEY(0,1,KEY_RIGHT),
+       KEY(0,2,KEY_LEFT),
+       KEY(0,3,KEY_DOWN),
+       KEY(0,4,KEY_CENTER),
+       KEY(0,5,KEY_0_5),
+       KEY(1,0,KEY_SOFT2),
+       KEY(1,1,KEY_SEND),
+       KEY(1,2,KEY_END),
+       KEY(1,3,KEY_VOLUMEDOWN),
+       KEY(1,4,KEY_VOLUMEUP),
+       KEY(1,5,KEY_RECORD),
+       KEY(2,0,KEY_SOFT1),
+       KEY(2,1,KEY_3),
+       KEY(2,2,KEY_6),
+       KEY(2,3,KEY_9),
+       KEY(2,4,KEY_SHARP),
+       KEY(2,5,KEY_2_5),
+       KEY(3,0,KEY_BACK),
+       KEY(3,1,KEY_2),
+       KEY(3,2,KEY_5),
+       KEY(3,3,KEY_8),
+       KEY(3,4,KEY_0),
+       KEY(3,5,KEY_HEADSETHOOK),
+       KEY(4,0,KEY_HOME),
+       KEY(4,1,KEY_1),
+       KEY(4,2,KEY_4),
+       KEY(4,3,KEY_7),
+       KEY(4,4,KEY_STAR),
+       KEY(4,5,KEY_POWER),
+       0
+};
+
+static struct resource smc91x_resources[] = {
+       [0] = {
+               .start  = H2P2_DBG_FPGA_ETHR_START,     /* Physical */
+               .end    = H2P2_DBG_FPGA_ETHR_START + 0xf,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = INT_730_MPU_EXT_NIRQ,
+               .end    = 0,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct mtd_partition nor_partitions[] = {
+       /* bootloader (U-Boot, etc) in first sector */
+       {
+             .name             = "bootloader",
+             .offset           = 0,
+             .size             = SZ_128K,
+             .mask_flags       = MTD_WRITEABLE, /* force read-only */
+       },
+       /* bootloader params in the next sector */
+       {
+             .name             = "params",
+             .offset           = MTDPART_OFS_APPEND,
+             .size             = SZ_128K,
+             .mask_flags       = 0,
+       },
+       /* kernel */
+       {
+             .name             = "kernel",
+             .offset           = MTDPART_OFS_APPEND,
+             .size             = SZ_2M,
+             .mask_flags       = 0
+       },
+       /* rest of flash is a file system */
+       {
+             .name             = "rootfs",
+             .offset           = MTDPART_OFS_APPEND,
+             .size             = MTDPART_SIZ_FULL,
+             .mask_flags       = 0
+       },
+};
+
+static struct flash_platform_data nor_data = {
+       .map_name       = "cfi_probe",
+       .width          = 2,
+       .parts          = nor_partitions,
+       .nr_parts       = ARRAY_SIZE(nor_partitions),
+};
+
+static struct resource nor_resource = {
+       .start          = OMAP_CS0_PHYS,
+       .end            = OMAP_CS0_PHYS + SZ_32M - 1,
+       .flags          = IORESOURCE_MEM,
+};
+
+static struct platform_device nor_device = {
+       .name           = "omapflash",
+       .id             = 0,
+       .dev            = {
+               .platform_data  = &nor_data,
+       },
+       .num_resources  = 1,
+       .resource       = &nor_resource,
+};
+
+static struct nand_platform_data nand_data = {
+       .options        = NAND_SAMSUNG_LP_OPTIONS,
+};
+
+static struct resource nand_resource = {
+       .start          = OMAP_CS3_PHYS,
+       .end            = OMAP_CS3_PHYS + SZ_4K - 1,
+       .flags          = IORESOURCE_MEM,
+};
+
+static struct platform_device nand_device = {
+       .name           = "omapnand",
+       .id             = 0,
+       .dev            = {
+               .platform_data  = &nand_data,
+       },
+       .num_resources  = 1,
+       .resource       = &nand_resource,
+};
+
+static struct platform_device smc91x_device = {
+       .name           = "smc91x",
+       .id             = 0,
+       .num_resources  = ARRAY_SIZE(smc91x_resources),
+       .resource       = smc91x_resources,
+};
+
+static struct resource kp_resources[] = {
+       [0] = {
+               .start  = INT_730_MPUIO_KEYPAD,
+               .end    = INT_730_MPUIO_KEYPAD,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct omap_kp_platform_data kp_data = {
+       .rows   = 8,
+       .cols   = 8,
+       .keymap = fsample_keymap,
+};
+
+static struct platform_device kp_device = {
+       .name           = "omap-keypad",
+       .id             = -1,
+       .dev            = {
+               .platform_data = &kp_data,
+       },
+       .num_resources  = ARRAY_SIZE(kp_resources),
+       .resource       = kp_resources,
+};
+
+static struct platform_device lcd_device = {
+       .name           = "lcd_p2",
+       .id             = -1,
+};
+
+static struct platform_device *devices[] __initdata = {
+       &nor_device,
+       &nand_device,
+       &smc91x_device,
+       &kp_device,
+       &lcd_device,
+};
+
+#define P2_NAND_RB_GPIO_PIN    62
+
+static int nand_dev_ready(struct nand_platform_data *data)
+{
+       return omap_get_gpio_datain(P2_NAND_RB_GPIO_PIN);
+}
+
+static struct omap_uart_config fsample_uart_config __initdata = {
+       .enabled_uarts = ((1 << 0) | (1 << 1)),
+};
+
+static struct omap_lcd_config fsample_lcd_config __initdata = {
+       .ctrl_name      = "internal",
+};
+
+static struct omap_board_config_kernel fsample_config[] = {
+       { OMAP_TAG_UART,        &fsample_uart_config },
+       { OMAP_TAG_LCD,         &fsample_lcd_config },
+};
+
+static void __init omap_fsample_init(void)
+{
+       if (!(omap_request_gpio(P2_NAND_RB_GPIO_PIN)))
+               nand_data.dev_ready = nand_dev_ready;
+
+       omap_cfg_reg(L3_1610_FLASH_CS2B_OE);
+       omap_cfg_reg(M8_1610_FLASH_CS2B_WE);
+
+       platform_add_devices(devices, ARRAY_SIZE(devices));
+
+       omap_board_config = fsample_config;
+       omap_board_config_size = ARRAY_SIZE(fsample_config);
+       omap_serial_init();
+}
+
+static void __init fsample_init_smc91x(void)
+{
+       fpga_write(1, H2P2_DBG_FPGA_LAN_RESET);
+       mdelay(50);
+       fpga_write(fpga_read(H2P2_DBG_FPGA_LAN_RESET) & ~1,
+                  H2P2_DBG_FPGA_LAN_RESET);
+       mdelay(50);
+}
+
+void omap_fsample_init_irq(void)
+{
+       omap1_init_common_hw();
+       omap_init_irq();
+       omap_gpio_init();
+       fsample_init_smc91x();
+}
+
+/* Only FPGA needs to be mapped here. All others are done with ioremap */
+static struct map_desc omap_fsample_io_desc[] __initdata = {
+       {
+               .virtual        = H2P2_DBG_FPGA_BASE,
+               .pfn            = __phys_to_pfn(H2P2_DBG_FPGA_START),
+               .length         = H2P2_DBG_FPGA_SIZE,
+               .type           = MT_DEVICE
+       },
+       {
+               .virtual        = FSAMPLE_CPLD_BASE,
+               .pfn            = __phys_to_pfn(FSAMPLE_CPLD_START),
+               .length         = FSAMPLE_CPLD_SIZE,
+               .type           = MT_DEVICE
+       }
+};
+
+static void __init omap_fsample_map_io(void)
+{
+       omap1_map_common_io();
+       iotable_init(omap_fsample_io_desc,
+                    ARRAY_SIZE(omap_fsample_io_desc));
+
+       /* Early, board-dependent init */
+
+       /*
+        * Hold GSM Reset until needed
+        */
+       omap_writew(omap_readw(OMAP730_DSP_M_CTL) & ~1, OMAP730_DSP_M_CTL);
+
+       /*
+        * UARTs -> done automagically by 8250 driver
+        */
+
+       /*
+        * CSx timings, GPIO Mux ... setup
+        */
+
+       /* Flash: CS0 timings setup */
+       omap_writel(0x0000fff3, OMAP730_FLASH_CFG_0);
+       omap_writel(0x00000088, OMAP730_FLASH_ACFG_0);
+
+       /*
+        * Ethernet support through the debug board
+        * CS1 timings setup
+        */
+       omap_writel(0x0000fff3, OMAP730_FLASH_CFG_1);
+       omap_writel(0x00000000, OMAP730_FLASH_ACFG_1);
+
+       /*
+        * Configure MPU_EXT_NIRQ IO in IO_CONF9 register,
+        * It is used as the Ethernet controller interrupt
+        */
+       omap_writel(omap_readl(OMAP730_IO_CONF_9) & 0x1FFFFFFF, OMAP730_IO_CONF_9);
+}
+
+MACHINE_START(OMAP_FSAMPLE, "OMAP730 F-Sample")
+/* Maintainer: Brian Swetland <swetland@google.com> */
+       .phys_io        = 0xfff00000,
+       .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
+       .boot_params    = 0x10000100,
+       .map_io         = omap_fsample_map_io,
+       .init_irq       = omap_fsample_init_irq,
+       .init_machine   = omap_fsample_init,
+       .timer          = &omap_timer,
+MACHINE_END
index 4b8d0ec73cb76621f55add6719fc999c02a19b8e..7b206116cd0391882f6d093325150bf9577acd80 100644 (file)
@@ -14,7 +14,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/major.h>
index e90c137a4cf315cbf70ec3959d74090d4554643e..4cbc62db5b5dd5cd6a72da1c4efbdf2ec56b8aa2 100644 (file)
@@ -37,6 +37,8 @@
 #include <asm/arch/usb.h>
 #include <asm/arch/keypad.h>
 #include <asm/arch/common.h>
+#include <asm/arch/mcbsp.h>
+#include <asm/arch/omap-alsa.h>
 
 static int innovator_keymap[] = {
        KEY(0, 0, KEY_F1),
@@ -112,6 +114,42 @@ static struct platform_device innovator_flash_device = {
        .resource       = &innovator_flash_resource,
 };
 
+#define DEFAULT_BITPERSAMPLE 16
+
+static struct omap_mcbsp_reg_cfg mcbsp_regs = {
+       .spcr2 = FREE | FRST | GRST | XRST | XINTM(3),
+       .spcr1 = RINTM(3) | RRST,
+       .rcr2 = RPHASE | RFRLEN2(OMAP_MCBSP_WORD_8) |
+           RWDLEN2(OMAP_MCBSP_WORD_16) | RDATDLY(0),
+       .rcr1 = RFRLEN1(OMAP_MCBSP_WORD_8) | RWDLEN1(OMAP_MCBSP_WORD_16),
+       .xcr2 = XPHASE | XFRLEN2(OMAP_MCBSP_WORD_8) |
+           XWDLEN2(OMAP_MCBSP_WORD_16) | XDATDLY(0) | XFIG,
+       .xcr1 = XFRLEN1(OMAP_MCBSP_WORD_8) | XWDLEN1(OMAP_MCBSP_WORD_16),
+       .srgr1 = FWID(DEFAULT_BITPERSAMPLE - 1),
+       .srgr2 = GSYNC | CLKSP | FSGM | FPER(DEFAULT_BITPERSAMPLE * 2 - 1),
+       /*.pcr0 = FSXM | FSRM | CLKXM | CLKRM | CLKXP | CLKRP,*/ /* mcbsp: master */
+       .pcr0 = CLKXP | CLKRP,  /* mcbsp: slave */
+};
+
+static struct omap_alsa_codec_config alsa_config = {
+       .name                   = "OMAP Innovator AIC23",
+       .mcbsp_regs_alsa        = &mcbsp_regs,
+       .codec_configure_dev    = NULL, // aic23_configure,
+       .codec_set_samplerate   = NULL, // aic23_set_samplerate,
+       .codec_clock_setup      = NULL, // aic23_clock_setup,
+       .codec_clock_on         = NULL, // aic23_clock_on,
+       .codec_clock_off        = NULL, // aic23_clock_off,
+       .get_default_samplerate = NULL, // aic23_get_default_samplerate,
+};
+
+static struct platform_device innovator_mcbsp1_device = {
+       .name   = "omap_alsa_mcbsp",
+       .id     = 1,
+       .dev = {
+               .platform_data  = &alsa_config,
+       },
+};
+
 static struct resource innovator_kp_resources[] = {
        [0] = {
                .start  = INT_KEYBOARD,
@@ -139,6 +177,10 @@ static struct platform_device innovator_kp_device = {
 
 #ifdef CONFIG_ARCH_OMAP15XX
 
+#include <linux/spi/spi.h>
+#include <linux/spi/ads7846.h>
+
+
 /* Only FPGA needs to be mapped here. All others are done with ioremap */
 static struct map_desc innovator1510_io_desc[] __initdata = {
        {
@@ -174,13 +216,44 @@ static struct platform_device innovator1510_lcd_device = {
        .id             = -1,
 };
 
+static struct platform_device innovator1510_spi_device = {
+       .name           = "spi_inn1510",
+       .id             = -1,
+};
+
 static struct platform_device *innovator1510_devices[] __initdata = {
        &innovator_flash_device,
        &innovator1510_smc91x_device,
+       &innovator_mcbsp1_device,
        &innovator_kp_device,
        &innovator1510_lcd_device,
+       &innovator1510_spi_device,
 };
 
+static int innovator_get_pendown_state(void)
+{
+       return !(fpga_read(OMAP1510_FPGA_TOUCHSCREEN) & (1 << 5));
+}
+
+static const struct ads7846_platform_data innovator1510_ts_info = {
+       .model                  = 7846,
+       .vref_delay_usecs       = 100,  /* internal, no capacitor */
+       .x_plate_ohms           = 419,
+       .y_plate_ohms           = 486,
+       .get_pendown_state      = innovator_get_pendown_state,
+};
+
+static struct spi_board_info __initdata innovator1510_boardinfo[] = { {
+       /* FPGA (bus "10") CS0 has an ads7846e */
+       .modalias               = "ads7846",
+       .platform_data          = &innovator1510_ts_info,
+       .irq                    = OMAP1510_INT_FPGA_TS,
+       .max_speed_hz           = 120000 /* max sample rate at 3V */
+                                       * 26 /* command + data + overhead */,
+       .bus_num                = 10,
+       .chip_select            = 0,
+} };
+
 #endif /* CONFIG_ARCH_OMAP15XX */
 
 #ifdef CONFIG_ARCH_OMAP16XX
@@ -311,6 +384,8 @@ static void __init innovator_init(void)
 #ifdef CONFIG_ARCH_OMAP15XX
        if (cpu_is_omap1510()) {
                platform_add_devices(innovator1510_devices, ARRAY_SIZE(innovator1510_devices));
+               spi_register_board_info(innovator1510_boardinfo,
+                               ARRAY_SIZE(innovator1510_boardinfo));
        }
 #endif
 #ifdef CONFIG_ARCH_OMAP16XX
index 1160093e8ef6720dfd58d6c531ed0a447f101c36..b742261c97ade63be4e744070d374ab66407bd4e 100644 (file)
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
-#include <linux/interrupt.h>
+#include <linux/irq.h>
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
-#include <linux/input.h>
 
 #include <asm/hardware.h>
 #include <asm/mach-types.h>
 #include <asm/arch/usb.h>
 #include <asm/arch/mux.h>
 #include <asm/arch/tc.h>
-#include <asm/arch/keypad.h>
 #include <asm/arch/common.h>
 #include <asm/arch/mcbsp.h>
 #include <asm/arch/omap-alsa.h>
 
-static int osk_keymap[] = {
-       KEY(0, 0, KEY_F1),
-       KEY(0, 3, KEY_UP),
-       KEY(1, 1, KEY_LEFTCTRL),
-       KEY(1, 2, KEY_LEFT),
-       KEY(2, 0, KEY_SPACE),
-       KEY(2, 1, KEY_ESC),
-       KEY(2, 2, KEY_DOWN),
-       KEY(3, 2, KEY_ENTER),
-       KEY(3, 3, KEY_RIGHT),
-       0
-};
-
-
 static struct mtd_partition osk_partitions[] = {
        /* bootloader (U-Boot, etc) in first sector */
        {
@@ -181,48 +165,17 @@ static struct omap_alsa_codec_config alsa_config = {
 
 static struct platform_device osk5912_mcbsp1_device = {
        .name   = "omap_alsa_mcbsp",
-       .id     = 1,
+       .id     = 1,
        .dev = {
                .platform_data  = &alsa_config,
        },
 };
 
-static struct resource osk5912_kp_resources[] = {
-       [0] = {
-               .start  = INT_KEYBOARD,
-               .end    = INT_KEYBOARD,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct omap_kp_platform_data osk_kp_data = {
-       .rows   = 8,
-       .cols   = 8,
-       .keymap = osk_keymap,
-};
-
-static struct platform_device osk5912_kp_device = {
-       .name           = "omap-keypad",
-       .id             = -1,
-       .dev            = {
-               .platform_data = &osk_kp_data,
-       },
-       .num_resources  = ARRAY_SIZE(osk5912_kp_resources),
-       .resource       = osk5912_kp_resources,
-};
-
-static struct platform_device osk5912_lcd_device = {
-       .name           = "lcd_osk",
-       .id             = -1,
-};
-
 static struct platform_device *osk5912_devices[] __initdata = {
        &osk5912_flash_device,
        &osk5912_smc91x_device,
        &osk5912_cf_device,
        &osk5912_mcbsp1_device,
-       &osk5912_kp_device,
-       &osk5912_lcd_device,
 };
 
 static void __init osk_init_smc91x(void)
@@ -276,18 +229,100 @@ static struct omap_uart_config osk_uart_config __initdata = {
        .enabled_uarts = (1 << 0),
 };
 
+#ifdef CONFIG_OMAP_OSK_MISTRAL
 static struct omap_lcd_config osk_lcd_config __initdata = {
        .ctrl_name      = "internal",
 };
+#endif
 
 static struct omap_board_config_kernel osk_config[] = {
        { OMAP_TAG_USB,           &osk_usb_config },
        { OMAP_TAG_UART,                &osk_uart_config },
+#ifdef CONFIG_OMAP_OSK_MISTRAL
        { OMAP_TAG_LCD,                 &osk_lcd_config },
+#endif
 };
 
 #ifdef CONFIG_OMAP_OSK_MISTRAL
 
+#include <linux/input.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/ads7846.h>
+
+#include <asm/arch/keypad.h>
+
+static const int osk_keymap[] = {
+       /* KEY(col, row, code) */
+       KEY(0, 0, KEY_F1),              /* SW4 */
+       KEY(0, 3, KEY_UP),              /* (sw2/up) */
+       KEY(1, 1, KEY_LEFTCTRL),        /* SW5 */
+       KEY(1, 2, KEY_LEFT),            /* (sw2/left) */
+       KEY(2, 0, KEY_SPACE),           /* SW3 */
+       KEY(2, 1, KEY_ESC),             /* SW6 */
+       KEY(2, 2, KEY_DOWN),            /* (sw2/down) */
+       KEY(3, 2, KEY_ENTER),           /* (sw2/select) */
+       KEY(3, 3, KEY_RIGHT),           /* (sw2/right) */
+       0
+};
+
+static struct omap_kp_platform_data osk_kp_data = {
+       .rows   = 8,
+       .cols   = 8,
+       .keymap = (int *) osk_keymap,
+};
+
+static struct resource osk5912_kp_resources[] = {
+       [0] = {
+               .start  = INT_KEYBOARD,
+               .end    = INT_KEYBOARD,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device osk5912_kp_device = {
+       .name           = "omap-keypad",
+       .id             = -1,
+       .dev            = {
+               .platform_data = &osk_kp_data,
+       },
+       .num_resources  = ARRAY_SIZE(osk5912_kp_resources),
+       .resource       = osk5912_kp_resources,
+};
+
+static struct platform_device osk5912_lcd_device = {
+       .name           = "lcd_osk",
+       .id             = -1,
+};
+
+static struct platform_device *mistral_devices[] __initdata = {
+       &osk5912_kp_device,
+       &osk5912_lcd_device,
+};
+
+static int mistral_get_pendown_state(void)
+{
+       return !omap_get_gpio_datain(4);
+}
+
+static const struct ads7846_platform_data mistral_ts_info = {
+       .model                  = 7846,
+       .vref_delay_usecs       = 100,  /* internal, no capacitor */
+       .x_plate_ohms           = 419,
+       .y_plate_ohms           = 486,
+       .get_pendown_state      = mistral_get_pendown_state,
+};
+
+static struct spi_board_info __initdata mistral_boardinfo[] = { {
+       /* MicroWire (bus 2) CS0 has an ads7846e */
+       .modalias               = "ads7846",
+       .platform_data          = &mistral_ts_info,
+       .irq                    = OMAP_GPIO_IRQ(4),
+       .max_speed_hz           = 120000 /* max sample rate at 3V */
+                                       * 26 /* command + data + overhead */,
+       .bus_num                = 2,
+       .chip_select            = 0,
+} };
+
 #ifdef CONFIG_PM
 static irqreturn_t
 osk_mistral_wake_interrupt(int irq, void *ignored, struct pt_regs *regs)
@@ -298,14 +333,18 @@ osk_mistral_wake_interrupt(int irq, void *ignored, struct pt_regs *regs)
 
 static void __init osk_mistral_init(void)
 {
-       /* FIXME here's where to feed in framebuffer, touchpad, and
-        * keyboard setup ...  not in the drivers for those devices!
-        *
-        * NOTE:  we could actually tell if there's a Mistral board
+       /* NOTE:  we could actually tell if there's a Mistral board
         * attached, e.g. by trying to read something from the ads7846.
-        * But this is too early for that...
+        * But this arch_init() code is too early for that, since we
+        * can't talk to the ads or even the i2c eeprom.
         */
 
+       // omap_cfg_reg(P19_1610_GPIO6);        // BUSY
+       omap_cfg_reg(P20_1610_GPIO4);   // PENIRQ
+       set_irq_type(OMAP_GPIO_IRQ(4), IRQT_FALLING);
+       spi_register_board_info(mistral_boardinfo,
+                       ARRAY_SIZE(mistral_boardinfo));
+
        /* the sideways button (SW1) is for use as a "wakeup" button */
        omap_cfg_reg(N15_1610_MPUIO2);
        if (omap_request_gpio(OMAP_MPUIO(2)) == 0) {
@@ -318,7 +357,7 @@ static void __init osk_mistral_init(void)
                 */
                ret = request_irq(OMAP_GPIO_IRQ(OMAP_MPUIO(2)),
                                &osk_mistral_wake_interrupt,
-                               SA_SHIRQ, "mistral_wakeup",
+                               IRQF_SHARED, "mistral_wakeup",
                                &osk_mistral_wake_interrupt);
                if (ret != 0) {
                        omap_free_gpio(OMAP_MPUIO(2));
@@ -329,6 +368,8 @@ static void __init osk_mistral_init(void)
 #endif
        } else
                printk(KERN_ERR "OSK+Mistral: wakeup button is awol\n");
+
+       platform_add_devices(mistral_devices, ARRAY_SIZE(mistral_devices));
 }
 #else
 static void __init osk_mistral_init(void) { }
index 619db18144ead16b6ecc74d5f8d4aec56090c30e..f1958e882e8694e3bd480dd46b62af3f351c6d28 100644 (file)
@@ -1,3 +1,4 @@
+//kernel/linux-omap-fsample/arch/arm/mach-omap1/clock.c#2 - edit change 3808 (text)
 /*
  *  linux/arch/arm/mach-omap1/clock.c
  *
@@ -20,6 +21,7 @@
 
 #include <asm/io.h>
 
+#include <asm/arch/cpu.h>
 #include <asm/arch/usb.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/sram.h>
@@ -270,8 +272,12 @@ static int omap1_select_table_rate(struct clk * clk, unsigned long rate)
        /*
         * In most cases we should not need to reprogram DPLL.
         * Reprogramming the DPLL is tricky, it must be done from SRAM.
+        * (on 730, bit 13 must always be 1)
         */
-       omap_sram_reprogram_clock(ptr->dpllctl_val, ptr->ckctl_val);
+       if (cpu_is_omap730())
+               omap_sram_reprogram_clock(ptr->dpllctl_val, ptr->ckctl_val | 0x2000);
+       else
+               omap_sram_reprogram_clock(ptr->dpllctl_val, ptr->ckctl_val);
 
        ck_dpll1.rate = ptr->pll_rate;
        propagate_rate(&ck_dpll1);
@@ -748,7 +754,7 @@ int __init omap1_clk_init(void)
                printk(KERN_ERR "System frequencies not set. Check your config.\n");
                /* Guess sane values (60MHz) */
                omap_writew(0x2290, DPLL_CTL);
-               omap_writew(0x1005, ARM_CKCTL);
+               omap_writew(cpu_is_omap730() ? 0x3005 : 0x1005, ARM_CKCTL);
                ck_dpll1.rate = 60000000;
                propagate_rate(&ck_dpll1);
        }
@@ -761,13 +767,17 @@ int __init omap1_clk_init(void)
               ck_dpll1.rate / 1000000, (ck_dpll1.rate / 100000) % 10,
               arm_ck.rate / 1000000, (arm_ck.rate / 100000) % 10);
 
-#ifdef CONFIG_MACH_OMAP_PERSEUS2
+#if defined(CONFIG_MACH_OMAP_PERSEUS2) || defined(CONFIG_MACH_OMAP_FSAMPLE)
        /* Select slicer output as OMAP input clock */
        omap_writew(omap_readw(OMAP730_PCC_UPLD_CTRL) & ~0x1, OMAP730_PCC_UPLD_CTRL);
 #endif
 
        /* Turn off DSP and ARM_TIMXO. Make sure ARM_INTHCK is not divided */
-       omap_writew(omap_readw(ARM_CKCTL) & 0x0fff, ARM_CKCTL);
+       /* (on 730, bit 13 must not be cleared) */
+       if (cpu_is_omap730())
+               omap_writew(omap_readw(ARM_CKCTL) & 0x2fff, ARM_CKCTL);
+       else
+               omap_writew(omap_readw(ARM_CKCTL) & 0x0fff, ARM_CKCTL);
 
        /* Put DSP/MPUI into reset until needed */
        omap_writew(0, ARM_RSTCT1);
index 847329cafc5c060dc94f208a177652e8e9f047e2..a611c3b6395491e250cd50be7005b67c5171e307 100644 (file)
@@ -9,7 +9,6 @@
  * (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index aca2a120813ae9f95456749a36939d447019a292..34eb79ee6e6182f480e5da181f41972b134ad3c6 100644 (file)
@@ -16,7 +16,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
@@ -134,7 +133,7 @@ static struct irqchip omap_fpga_irq = {
  * mask_ack routine for all of the FPGA interrupts has been changed from
  * fpga_mask_ack_irq() to fpga_ack_irq() so that the specific FPGA interrupt
  * being serviced is left unmasked.  We can do this because the FPGA cascade
- * interrupt is installed with the SA_INTERRUPT flag, which leaves all
+ * interrupt is installed with the IRQF_DISABLED flag, which leaves all
  * interrupts masked at the CPU while an FPGA interrupt handler executes.
  *
  * Limited testing indicates that this workaround appears to be effective
index 5c637c0483688d9ef1a6172ad6a5fd437ba3cad2..da13c3e82850e46e274a78acc4e0d3aed803ddc1 100644 (file)
@@ -11,7 +11,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index be3a2a4ee2b8c6d304b9e34187cb40ac25a11a91..fab8b0b27cfbca4dd4c0a809dca6637369a0bcbc 100644 (file)
@@ -8,7 +8,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index a0431c00fa813353a98d2e818e3ff6d102b0d8b8..9e039845b50e53abc25712f113b5351ee7070197 100644 (file)
@@ -36,7 +36,6 @@
  * 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/sched.h>
index 6506508159157129e85ccc8400119849f448fc6e..8976fbb21f7cb1059b45a88ed986b7e7a6ac9824 100644 (file)
@@ -9,7 +9,6 @@
  * The "surfer" expansion board and H2 sample board also have two-color
  * green+red LEDs (in parallel), used here for timer and idle indicators.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel_stat.h>
 #include <linux/sched.h>
index c8ffd1ddcdedff180bfc682560419236a16568bf..a0cd001ac39af1eabc29dfa1bb4158c55ef49715 100644 (file)
@@ -1,7 +1,6 @@
 /*
  * linux/arch/arm/mach-omap1/leds-innovator.c
  */
-#include <linux/config.h>
 #include <linux/init.h>
 
 #include <asm/hardware.h>
index 2c8bda847c186e3a47ecf8518000bc1d8406dd91..3b29e59b0e6f47d3da318ae426483ab304a42518 100644 (file)
@@ -3,7 +3,6 @@
  *
  * LED driver for OSK, and optionally Mistral QVGA, boards
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/workqueue.h>
 
index 10fe0b3efcace593b613aa8e0c036082e83296d1..fa74ef7af15f730d8af3da0a150982c0b50ae675 100644 (file)
@@ -22,7 +22,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  *
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <asm/system.h>
index ddf6b07dc9c78bbeb7480b28167621f903b210be..cd76185bab7478a03eeb08a572a64fc006adbb38 100644 (file)
@@ -1,3 +1,4 @@
+//kernel/linux-omap-fsample/arch/arm/mach-omap1/pm.c#3 - integrate change 4545 (text)
 /*
  * linux/arch/arm/mach-omap1/pm.c
  *
@@ -50,6 +51,7 @@
 #include <asm/mach/irq.h>
 #include <asm/mach-types.h>
 
+#include <asm/arch/cpu.h>
 #include <asm/arch/irqs.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/sram.h>
@@ -326,8 +328,9 @@ void omap_pm_suspend(void)
        /* stop DSP */
        omap_writew(omap_readw(ARM_RSTCT1) & ~(1 << DSP_EN), ARM_RSTCT1);
 
-       /* shut down dsp_ck */
-       omap_writew(omap_readw(ARM_CKCTL) & ~(1 << EN_DSPCK), ARM_CKCTL);
+               /* shut down dsp_ck */
+       if (!cpu_is_omap730())
+               omap_writew(omap_readw(ARM_CKCTL) & ~(1 << EN_DSPCK), ARM_CKCTL);
 
        /* temporarily enabling api_ck to access DSP registers */
        omap_writew(omap_readw(ARM_IDLECT2) | 1 << EN_APICK, ARM_IDLECT2);
@@ -687,7 +690,7 @@ static irqreturn_t  omap_wakeup_interrupt(int  irq, void *  dev,
 
 static struct irqaction omap_wakeup_irq = {
        .name           = "peripheral wakeup",
-       .flags          = SA_INTERRUPT,
+       .flags          = IRQF_DISABLED,
        .handler        = omap_wakeup_interrupt
 };
 
index 9b4cd698bec85d9d05b06371313066579b9d3c41..976edfb882e2a9f6a46d7f26dded21c75e4ff1f4 100644 (file)
@@ -8,10 +8,10 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
+#include <linux/irq.h>
 #include <linux/delay.h>
 #include <linux/serial.h>
 #include <linux/tty.h>
@@ -253,7 +253,7 @@ static void __init omap_serial_set_port_wakeup(int gpio_nr)
        }
        omap_set_gpio_direction(gpio_nr, 1);
        ret = request_irq(OMAP_GPIO_IRQ(gpio_nr), &omap_serial_wake_interrupt,
-                         SA_TRIGGER_RISING, "serial wakeup", NULL);
+                         IRQF_TRIGGER_RISING, "serial wakeup", NULL);
        if (ret) {
                omap_free_gpio(gpio_nr);
                printk(KERN_ERR "No interrupt for UART wake GPIO: %i\n",
index e58295e2d3b244e7410d7dbec5d666afa66d400e..abef33d10f016815a0c67205a8c99f83fa08f91d 100644 (file)
@@ -32,7 +32,6 @@
  * 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/assembler.h>
 #include <asm/arch/io.h>
index a85fe6066bc47d9a3e6168ff1686b6356dcec200..4d91b9f510843fa1ce45b441d30387637075df10 100644 (file)
@@ -33,7 +33,6 @@
  * 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/delay.h>
@@ -94,7 +93,7 @@ static inline unsigned long long cycles_2_ns(unsigned long long cyc)
  * will break. On P2, the timer count rate is 6.5 MHz after programming PTV
  * with 0. This divides the 13MHz input by 2, and is undocumented.
  */
-#ifdef CONFIG_MACH_OMAP_PERSEUS2
+#if defined(CONFIG_MACH_OMAP_PERSEUS2) || defined(CONFIG_MACH_OMAP_FSAMPLE)
 /* REVISIT: This ifdef construct should be replaced by a query to clock
  * framework to see if timer base frequency is 12.0, 13.0 or 19.2 MHz.
  */
@@ -178,7 +177,7 @@ static irqreturn_t omap_mpu_timer_interrupt(int irq, void *dev_id,
 
 static struct irqaction omap_mpu_timer_irq = {
        .name           = "mpu timer",
-       .flags          = SA_INTERRUPT | SA_TIMER,
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
        .handler        = omap_mpu_timer_interrupt,
 };
 
@@ -192,7 +191,7 @@ static irqreturn_t omap_mpu_timer1_interrupt(int irq, void *dev_id,
 
 static struct irqaction omap_mpu_timer1_irq = {
        .name           = "mpu timer1 overflow",
-       .flags          = SA_INTERRUPT,
+       .flags          = IRQF_DISABLED,
        .handler        = omap_mpu_timer1_interrupt,
 };
 
index 537dd2e6d3801a3767468db8235daf62615f4e99..aab97ccf1e63648889ddb515abd9c35ff85fd826 100644 (file)
@@ -8,6 +8,7 @@ config ARCH_OMAP24XX
 config ARCH_OMAP2420
        bool "OMAP2420 support"
        depends on ARCH_OMAP24XX
+       select OMAP_DM_TIMER
 
 comment "OMAP Board Type"
        depends on ARCH_OMAP2
index 111eaa64258f2cbcec96bbf56875bebd957cb871..266d88e77bdc7b29da1c2c7db6b6240dddd50c08 100644 (file)
@@ -3,12 +3,13 @@
 #
 
 # Common support
-obj-y := irq.o id.o io.o sram-fn.o memory.o prcm.o clock.o mux.o devices.o serial.o
+obj-y := irq.o id.o io.o sram-fn.o memory.o prcm.o clock.o mux.o devices.o \
+        serial.o gpmc.o
 
 obj-$(CONFIG_OMAP_MPU_TIMER)           += timer-gp.o
 
 # Power Management
-obj-$(CONFIG_PM) += pm.o sleep.o
+obj-$(CONFIG_PM) += pm.o pm-domain.o sleep.o
 
 # Specific board support
 obj-$(CONFIG_MACH_OMAP_GENERIC)                += board-generic.o
index 6c6ba172cdf6d7592da3fe42a2b73d0f0e12b514..7993b7bae2bdaaae807305b54527bec43a40abae 100644 (file)
@@ -234,17 +234,17 @@ static void __init apollon_sw_init(void)
 
        set_irq_type(OMAP_GPIO_IRQ(SW_ENTER_GPIO16), IRQT_RISING);
        if (request_irq(OMAP_GPIO_IRQ(SW_ENTER_GPIO16), &apollon_sw_interrupt,
-                               SA_SHIRQ, "enter sw",
+                               IRQF_SHARED, "enter sw",
                                &apollon_sw_interrupt))
                return;
        set_irq_type(OMAP_GPIO_IRQ(SW_UP_GPIO17), IRQT_RISING);
        if (request_irq(OMAP_GPIO_IRQ(SW_UP_GPIO17), &apollon_sw_interrupt,
-                               SA_SHIRQ, "up sw",
+                               IRQF_SHARED, "up sw",
                                &apollon_sw_interrupt))
                return;
        set_irq_type(OMAP_GPIO_IRQ(SW_DOWN_GPIO58), IRQT_RISING);
        if (request_irq(OMAP_GPIO_IRQ(SW_DOWN_GPIO58), &apollon_sw_interrupt,
-                               SA_SHIRQ, "down sw",
+                               IRQF_SHARED, "down sw",
                                &apollon_sw_interrupt))
                return;
 }
index 72eb4bf571acf11abb6cafe89e65fcfa2274c2e2..d1b648a4efbfde4ad325e1f136fab6d226fb2789 100644 (file)
@@ -15,7 +15,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/device.h>
@@ -660,26 +659,35 @@ static int omap2_clk_set_rate(struct clk *clk, unsigned long rate)
 
                /* Isolate control register */
                div_sel = (SRC_RATE_SEL_MASK & clk->flags);
-               div_off = clk->src_offset;
+               div_off = clk->rate_offset;
 
                validrate = omap2_clksel_round_rate(clk, rate, &new_div);
-               if(validrate != rate)
+               if (validrate != rate)
                        return(ret);
 
                field_val = omap2_get_clksel(&div_sel, &field_mask, clk);
                if (div_sel == 0)
                        return ret;
 
-               if(clk->flags & CM_SYSCLKOUT_SEL1){
-                       switch(new_div){
-                       case 16: field_val = 4; break;
-                       case 8:  field_val = 3; break;
-                       case 4:  field_val = 2; break;
-                       case 2:  field_val = 1; break;
-                       case 1:  field_val = 0; break;
+               if (clk->flags & CM_SYSCLKOUT_SEL1) {
+                       switch (new_div) {
+                       case 16:
+                               field_val = 4;
+                               break;
+                       case 8:
+                               field_val = 3;
+                               break;
+                       case 4:
+                               field_val = 2;
+                               break;
+                       case 2:
+                               field_val = 1;
+                               break;
+                       case 1:
+                               field_val = 0;
+                               break;
                        }
-               }
-               else
+               } else
                        field_val = new_div;
 
                reg = (void __iomem *)div_sel;
@@ -744,7 +752,7 @@ static u32 omap2_get_src_field(u32 *type_to_addr, u32 reg_offset,
                        val = 0x2;
                break;
        case CM_WKUP_SEL1:
-               src_reg_addr = (u32)&CM_CLKSEL2_CORE;
+               src_reg_addr = (u32)&CM_CLKSEL_WKUP;
                mask = 0x3;
                if (src_clk == &func_32k_ck)
                        val = 0x0;
@@ -784,9 +792,9 @@ static u32 omap2_get_src_field(u32 *type_to_addr, u32 reg_offset,
                        val = 0;
                if (src_clk == &sys_ck)
                        val = 1;
-               if (src_clk == &func_54m_ck)
-                       val = 2;
                if (src_clk == &func_96m_ck)
+                       val = 2;
+               if (src_clk == &func_54m_ck)
                        val = 3;
                break;
        }
index 6c78d471fab70b8ebe50c50f49401c6fb42f5747..2781dfbc51644815f778e84b047fc3d02eac0525 100644 (file)
@@ -1062,7 +1062,7 @@ static struct clk gpt2_ick = {
        .parent         = &l4_ck,
        .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
        .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,     /* Bit4 */
-       .enable_bit     = 0,
+       .enable_bit     = 4,
        .recalc         = &omap2_followparent_recalc,
 };
 
index fb7f91da1aad12d8f8682eff0dcb558d6f314916..aa4322451e8b5dbe10cfd76cf58fff09b9384abf 100644 (file)
@@ -9,7 +9,6 @@
  * (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -105,6 +104,51 @@ static inline void omap_init_sti(void)
 static inline void omap_init_sti(void) {}
 #endif
 
+#if defined(CONFIG_SPI_OMAP24XX)
+
+#include <asm/arch/mcspi.h>
+
+#define OMAP2_MCSPI1_BASE              0x48098000
+#define OMAP2_MCSPI2_BASE              0x4809a000
+
+/* FIXME: use resources instead */
+
+static struct omap2_mcspi_platform_config omap2_mcspi1_config = {
+       .base           = io_p2v(OMAP2_MCSPI1_BASE),
+       .num_cs         = 4,
+};
+
+struct platform_device omap2_mcspi1 = {
+       .name           = "omap2_mcspi",
+       .id             = 1,
+       .dev            = {
+               .platform_data = &omap2_mcspi1_config,
+       },
+};
+
+static struct omap2_mcspi_platform_config omap2_mcspi2_config = {
+       .base           = io_p2v(OMAP2_MCSPI2_BASE),
+       .num_cs         = 2,
+};
+
+struct platform_device omap2_mcspi2 = {
+       .name           = "omap2_mcspi",
+       .id             = 2,
+       .dev            = {
+               .platform_data = &omap2_mcspi2_config,
+       },
+};
+
+static void omap_init_mcspi(void)
+{
+       platform_device_register(&omap2_mcspi1);
+       platform_device_register(&omap2_mcspi2);
+}
+
+#else
+static inline void omap_init_mcspi(void) {}
+#endif
+
 /*-------------------------------------------------------------------------*/
 
 static int __init omap2_init_devices(void)
@@ -113,6 +157,7 @@ static int __init omap2_init_devices(void)
         * in alphabetical order so they're easier to sort through.
         */
        omap_init_i2c();
+       omap_init_mcspi();
        omap_init_sti();
 
        return 0;
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
new file mode 100644 (file)
index 0000000..c7a48f9
--- /dev/null
@@ -0,0 +1,209 @@
+/*
+ * GPMC support functions
+ *
+ * Copyright (C) 2005-2006 Nokia Corporation
+ *
+ * Author: Juha Yrjola
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/err.h>
+#include <linux/clk.h>
+
+#include <asm/io.h>
+#include <asm/arch/gpmc.h>
+
+#undef DEBUG
+
+#define GPMC_BASE              0x6800a000
+#define GPMC_REVISION          0x00
+#define GPMC_SYSCONFIG         0x10
+#define GPMC_SYSSTATUS         0x14
+#define GPMC_IRQSTATUS         0x18
+#define GPMC_IRQENABLE         0x1c
+#define GPMC_TIMEOUT_CONTROL   0x40
+#define GPMC_ERR_ADDRESS       0x44
+#define GPMC_ERR_TYPE          0x48
+#define GPMC_CONFIG            0x50
+#define GPMC_STATUS            0x54
+#define GPMC_PREFETCH_CONFIG1  0x1e0
+#define GPMC_PREFETCH_CONFIG2  0x1e4
+#define GPMC_PREFETCH_CONTROL  0x1e8
+#define GPMC_PREFETCH_STATUS   0x1f0
+#define GPMC_ECC_CONFIG                0x1f4
+#define GPMC_ECC_CONTROL       0x1f8
+#define GPMC_ECC_SIZE_CONFIG   0x1fc
+
+#define GPMC_CS0               0x60
+#define GPMC_CS_SIZE           0x30
+
+static void __iomem *gpmc_base =
+       (void __iomem *) IO_ADDRESS(GPMC_BASE);
+static void __iomem *gpmc_cs_base =
+       (void __iomem *) IO_ADDRESS(GPMC_BASE) + GPMC_CS0;
+
+static struct clk *gpmc_l3_clk;
+
+static void gpmc_write_reg(int idx, u32 val)
+{
+       __raw_writel(val, gpmc_base + idx);
+}
+
+static u32 gpmc_read_reg(int idx)
+{
+       return __raw_readl(gpmc_base + idx);
+}
+
+void gpmc_cs_write_reg(int cs, int idx, u32 val)
+{
+       void __iomem *reg_addr;
+
+       reg_addr = gpmc_cs_base + (cs * GPMC_CS_SIZE) + idx;
+       __raw_writel(val, reg_addr);
+}
+
+u32 gpmc_cs_read_reg(int cs, int idx)
+{
+       return __raw_readl(gpmc_cs_base + (cs * GPMC_CS_SIZE) + idx);
+}
+
+/* TODO: Add support for gpmc_fck to clock framework and use it */
+static unsigned long gpmc_get_fclk_period(void)
+{
+       /* In picoseconds */
+       return 1000000000 / ((clk_get_rate(gpmc_l3_clk)) / 1000);
+}
+
+unsigned int gpmc_ns_to_ticks(unsigned int time_ns)
+{
+       unsigned long tick_ps;
+
+       /* Calculate in picosecs to yield more exact results */
+       tick_ps = gpmc_get_fclk_period();
+
+       return (time_ns * 1000 + tick_ps - 1) / tick_ps;
+}
+
+#ifdef DEBUG
+static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit,
+                              int time, const char *name)
+#else
+static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit,
+                              int time)
+#endif
+{
+       u32 l;
+       int ticks, mask, nr_bits;
+
+       if (time == 0)
+               ticks = 0;
+       else
+               ticks = gpmc_ns_to_ticks(time);
+       nr_bits = end_bit - st_bit + 1;
+       if (ticks >= 1 << nr_bits)
+               return -1;
+
+       mask = (1 << nr_bits) - 1;
+       l = gpmc_cs_read_reg(cs, reg);
+#ifdef DEBUG
+       printk(KERN_INFO "GPMC CS%d: %-10s: %d ticks, %3lu ns (was %i ticks)\n",
+              cs, name, ticks, gpmc_get_fclk_period() * ticks / 1000,
+              (l >> st_bit) & mask);
+#endif
+       l &= ~(mask << st_bit);
+       l |= ticks << st_bit;
+       gpmc_cs_write_reg(cs, reg, l);
+
+       return 0;
+}
+
+#ifdef DEBUG
+#define GPMC_SET_ONE(reg, st, end, field) \
+       if (set_gpmc_timing_reg(cs, (reg), (st), (end),         \
+                       t->field, #field) < 0)                  \
+               return -1
+#else
+#define GPMC_SET_ONE(reg, st, end, field) \
+       if (set_gpmc_timing_reg(cs, (reg), (st), (end), t->field) < 0) \
+               return -1
+#endif
+
+int gpmc_cs_calc_divider(int cs, unsigned int sync_clk)
+{
+       int div;
+       u32 l;
+
+       l = sync_clk * 1000 + (gpmc_get_fclk_period() - 1);
+       div = l / gpmc_get_fclk_period();
+       if (div > 4)
+               return -1;
+       if (div < 0)
+               div = 1;
+
+       return div;
+}
+
+int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t)
+{
+       int div;
+       u32 l;
+
+       div = gpmc_cs_calc_divider(cs, t->sync_clk);
+       if (div < 0)
+               return -1;
+
+       GPMC_SET_ONE(GPMC_CS_CONFIG2,  0,  3, cs_on);
+       GPMC_SET_ONE(GPMC_CS_CONFIG2,  8, 12, cs_rd_off);
+       GPMC_SET_ONE(GPMC_CS_CONFIG2, 16, 20, cs_wr_off);
+
+       GPMC_SET_ONE(GPMC_CS_CONFIG3,  0,  3, adv_on);
+       GPMC_SET_ONE(GPMC_CS_CONFIG3,  8, 12, adv_rd_off);
+       GPMC_SET_ONE(GPMC_CS_CONFIG3, 16, 20, adv_wr_off);
+
+       GPMC_SET_ONE(GPMC_CS_CONFIG4,  0,  3, oe_on);
+       GPMC_SET_ONE(GPMC_CS_CONFIG4,  8, 12, oe_off);
+       GPMC_SET_ONE(GPMC_CS_CONFIG4, 16, 19, we_on);
+       GPMC_SET_ONE(GPMC_CS_CONFIG4, 24, 28, we_off);
+
+       GPMC_SET_ONE(GPMC_CS_CONFIG5,  0,  4, rd_cycle);
+       GPMC_SET_ONE(GPMC_CS_CONFIG5,  8, 12, wr_cycle);
+       GPMC_SET_ONE(GPMC_CS_CONFIG5, 16, 20, access);
+
+       GPMC_SET_ONE(GPMC_CS_CONFIG5, 24, 27, page_burst_access);
+
+#ifdef DEBUG
+       printk(KERN_INFO "GPMC CS%d CLK period is %lu (div %d)\n",
+              cs, gpmc_get_fclk_period(), div);
+#endif
+
+       l = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
+       l &= ~0x03;
+       l |= (div - 1);
+
+       return 0;
+}
+
+unsigned long gpmc_cs_get_base_addr(int cs)
+{
+       return (gpmc_cs_read_reg(cs, GPMC_CS_CONFIG7) & 0x1f) << 24;
+}
+
+void __init gpmc_init(void)
+{
+       u32 l;
+
+       gpmc_l3_clk = clk_get(NULL, "core_l3_ck");
+       BUG_ON(IS_ERR(gpmc_l3_clk));
+
+       l = gpmc_read_reg(GPMC_REVISION);
+       printk(KERN_INFO "GPMC revision %d.%d\n", (l >> 4) & 0x0f, l & 0x0f);
+       /* Set smart idle mode and automatic L3 clock gating */
+       l = gpmc_read_reg(GPMC_SYSCONFIG);
+       l &= 0x03 << 3;
+       l |= (0x02 << 3) | (1 << 0);
+       gpmc_write_reg(GPMC_SYSCONFIG, l);
+}
index 76187300f2b684b72804b2de42e0b960a2c51605..871ace4fccb879a186cf135f87a0dcbfaafa4343 100644 (file)
@@ -11,7 +11,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 7d5711611f2f413cae141ec31fe9ccea382d234d..a0728c33e5d9e60de43b6f867b1efcfd61c1561f 100644 (file)
@@ -11,7 +11,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -27,6 +26,7 @@
 extern void omap_sram_init(void);
 extern int omap2_clk_init(void);
 extern void omap2_check_revision(void);
+extern void gpmc_init(void);
 
 /*
  * The machine specific code may provide the extra mapping besides the
@@ -67,4 +67,5 @@ void __init omap2_init_common_hw(void)
 {
        omap2_mux_init();
        omap2_clk_init();
+       gpmc_init();
 }
index d7baff675cfe04f6a9478473a998b979983eb0fe..3eed6a737bf8144e69edb096c1710bae2ad8ca23 100644 (file)
@@ -12,7 +12,6 @@
  */
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/config.h>
 #include <linux/interrupt.h>
 #include <asm/hardware.h>
 #include <asm/mach/irq.h>
index 1d925d69fc3581505629578cc202549c8eb7c321..85cbc2a2e6639bf573ff399203a62df5c616085f 100644 (file)
@@ -14,7 +14,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/device.h>
index 1197dc38c20afcd4b87b1f7dff7f98999402e267..60ef084faffd04e8102ac9c3dbbc94d58b0cef2c 100644 (file)
@@ -22,7 +22,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  *
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <asm/system.h>
@@ -53,6 +52,12 @@ MUX_CFG_24XX("W19_24XX_SYS_NIRQ",    0x12c,  0,      1,      1,      1)
 /* 24xx clocks */
 MUX_CFG_24XX("W14_24XX_SYS_CLKOUT",    0x137,  0,      1,      1,      1)
 
+/* 24xx GPMC wait pin monitoring */
+MUX_CFG_24XX("L3_GPMC_WAIT0",          0x09a,  0,      1,      1,      1)
+MUX_CFG_24XX("N7_GPMC_WAIT1",          0x09b,  0,      1,      1,      1)
+MUX_CFG_24XX("M1_GPMC_WAIT2",          0x09c,  0,      1,      1,      1)
+MUX_CFG_24XX("P1_GPMC_WAIT3",          0x09d,  0,      1,      1,      1)
+
 /* 24xx McBSP */
 MUX_CFG_24XX("Y15_24XX_MCBSP2_CLKX",   0x124,  1,      1,      0,      1)
 MUX_CFG_24XX("R14_24XX_MCBSP2_FSX",    0x125,  1,      1,      0,      1)
@@ -60,18 +65,38 @@ MUX_CFG_24XX("W15_24XX_MCBSP2_DR",  0x126,  1,      1,      0,      1)
 MUX_CFG_24XX("V15_24XX_MCBSP2_DX",     0x127,  1,      1,      0,      1)
 
 /* 24xx GPIO */
-MUX_CFG_24XX("M21_242X_GPIO11",         0x0c9,  3,      1,      1,      1)
+MUX_CFG_24XX("M21_242X_GPIO11",                0x0c9,  3,      1,      1,      1)
 MUX_CFG_24XX("AA10_242X_GPIO13",       0x0e5,  3,      0,      0,      1)
-MUX_CFG_24XX("AA6_242X_GPIO14",         0x0e6,  3,      0,      0,      1)
-MUX_CFG_24XX("AA4_242X_GPIO15",         0x0e7,  3,      0,      0,      1)
-MUX_CFG_24XX("Y11_242X_GPIO16",         0x0e8,  3,      0,      0,      1)
+MUX_CFG_24XX("AA6_242X_GPIO14",                0x0e6,  3,      0,      0,      1)
+MUX_CFG_24XX("AA4_242X_GPIO15",                0x0e7,  3,      0,      0,      1)
+MUX_CFG_24XX("Y11_242X_GPIO16",                0x0e8,  3,      0,      0,      1)
 MUX_CFG_24XX("AA12_242X_GPIO17",       0x0e9,  3,      0,      0,      1)
-MUX_CFG_24XX("AA8_242X_GPIO58",         0x0ea,  3,      0,      0,      1)
+MUX_CFG_24XX("AA8_242X_GPIO58",                0x0ea,  3,      0,      0,      1)
 MUX_CFG_24XX("Y20_24XX_GPIO60",                0x12c,  3,      0,      0,      1)
-MUX_CFG_24XX("W4__24XX_GPIO74",         0x0f2,  3,      0,      0,      1)
+MUX_CFG_24XX("W4__24XX_GPIO74",                0x0f2,  3,      0,      0,      1)
 MUX_CFG_24XX("M15_24XX_GPIO92",                0x10a,  3,      0,      0,      1)
 MUX_CFG_24XX("V14_24XX_GPIO117",       0x128,  3,      1,      0,      1)
 
+/* 242x DBG GPIO */
+MUX_CFG_24XX("V4_242X_GPIO49",         0xd3,   3,      0,      0,      1)
+MUX_CFG_24XX("W2_242X_GPIO50",         0xd4,   3,      0,      0,      1)
+MUX_CFG_24XX("U4_242X_GPIO51",         0xd5,   3,      0,      0,      1)
+MUX_CFG_24XX("V3_242X_GPIO52",         0xd6,   3,      0,      0,      1)
+MUX_CFG_24XX("V2_242X_GPIO53",         0xd7,   3,      0,      0,      1)
+MUX_CFG_24XX("V6_242X_GPIO53",         0xcf,   3,      0,      0,      1)
+MUX_CFG_24XX("T4_242X_GPIO54",         0xd8,   3,      0,      0,      1)
+MUX_CFG_24XX("Y4_242X_GPIO54",         0xd0,   3,      0,      0,      1)
+MUX_CFG_24XX("T3_242X_GPIO55",         0xd9,   3,      0,      0,      1)
+MUX_CFG_24XX("U2_242X_GPIO56",         0xda,   3,      0,      0,      1)
+
+/* 24xx external DMA requests */
+MUX_CFG_24XX("AA10_242X_DMAREQ0",      0x0e5,  2,      0,      0,      1)
+MUX_CFG_24XX("AA6_242X_DMAREQ1",       0x0e6,  2,      0,      0,      1)
+MUX_CFG_24XX("E4_242X_DMAREQ2",                0x074,  2,      0,      0,      1)
+MUX_CFG_24XX("G4_242X_DMAREQ3",                0x073,  2,      0,      0,      1)
+MUX_CFG_24XX("D3_242X_DMAREQ4",                0x072,  2,      0,      0,      1)
+MUX_CFG_24XX("E3_242X_DMAREQ5",                0x071,  2,      0,      0,      1)
+
 /* TSC IRQ */
 MUX_CFG_24XX("P20_24XX_TSC_IRQ",       0x108,  0,      0,      0,      1)
 
diff --git a/arch/arm/mach-omap2/pm-domain.c b/arch/arm/mach-omap2/pm-domain.c
new file mode 100644 (file)
index 0000000..5e20e74
--- /dev/null
@@ -0,0 +1,300 @@
+/*
+ * linux/arch/arm/mach-omap2/pm-domain.c
+ *
+ * Power domain functions for OMAP2
+ *
+ * Copyright (C) 2006 Nokia Corporation
+ * Tony Lindgren <tony@atomide.com>
+ *
+ * Some code based on earlier OMAP2 sample PM code
+ * Copyright (C) 2005 Texas Instruments, Inc.
+ * Richard Woodruff <r-woodruff2@ti.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/clk.h>
+
+#include <asm/io.h>
+
+#include "prcm-regs.h"
+
+/* Power domain offsets */
+#define PM_MPU_OFFSET                  0x100
+#define PM_CORE_OFFSET                 0x200
+#define PM_GFX_OFFSET                  0x300
+#define PM_WKUP_OFFSET                 0x400           /* Autoidle only */
+#define PM_PLL_OFFSET                  0x500           /* Autoidle only */
+#define PM_DSP_OFFSET                  0x800
+#define PM_MDM_OFFSET                  0xc00
+
+/* Power domain wake-up dependency control register */
+#define PM_WKDEP_OFFSET                        0xc8
+#define                EN_MDM                  (1 << 5)
+#define                EN_WKUP                 (1 << 4)
+#define                EN_GFX                  (1 << 3)
+#define                EN_DSP                  (1 << 2)
+#define                EN_MPU                  (1 << 1)
+#define                EN_CORE                 (1 << 0)
+
+/* Core power domain state transition control register */
+#define PM_PWSTCTRL_OFFSET             0xe0
+#define                FORCESTATE              (1 << 18)       /* Only for DSP & GFX */
+#define                MEM4RETSTATE            (1 << 6)
+#define                MEM3RETSTATE            (1 << 5)
+#define                MEM2RETSTATE            (1 << 4)
+#define                MEM1RETSTATE            (1 << 3)
+#define                LOGICRETSTATE           (1 << 2)        /* Logic is retained */
+#define                POWERSTATE_OFF          0x3
+#define                POWERSTATE_RETENTION    0x1
+#define                POWERSTATE_ON           0x0
+
+/* Power domain state register */
+#define PM_PWSTST_OFFSET               0xe4
+
+/* Hardware supervised state transition control register */
+#define CM_CLKSTCTRL_OFFSET            0x48
+#define                AUTOSTAT_MPU            (1 << 0)        /* MPU */
+#define                AUTOSTAT_DSS            (1 << 2)        /* Core */
+#define                AUTOSTAT_L4             (1 << 1)        /* Core */
+#define                AUTOSTAT_L3             (1 << 0)        /* Core */
+#define                AUTOSTAT_GFX            (1 << 0)        /* GFX */
+#define                AUTOSTAT_IVA            (1 << 8)        /* 2420 IVA in DSP domain */
+#define                AUTOSTAT_DSP            (1 << 0)        /* DSP */
+#define                AUTOSTAT_MDM            (1 << 0)        /* MDM */
+
+/* Automatic control of interface clock idling */
+#define CM_AUTOIDLE1_OFFSET            0x30
+#define CM_AUTOIDLE2_OFFSET            0x34            /* Core only */
+#define CM_AUTOIDLE3_OFFSET            0x38            /* Core only */
+#define CM_AUTOIDLE4_OFFSET            0x3c            /* Core only */
+#define                AUTO_54M(x)             (((x) & 0x3) << 6)
+#define                AUTO_96M(x)             (((x) & 0x3) << 2)
+#define                AUTO_DPLL(x)            (((x) & 0x3) << 0)
+#define                AUTO_STOPPED            0x3
+#define                AUTO_BYPASS_FAST        0x2             /* DPLL only */
+#define                AUTO_BYPASS_LOW_POWER   0x1             /* DPLL only */
+#define                AUTO_DISABLED           0x0
+
+/* Voltage control PRCM_VOLTCTRL bits */
+#define                AUTO_EXTVOLT            (1 << 15)
+#define                FORCE_EXTVOLT           (1 << 14)
+#define                SETOFF_LEVEL(x)         (((x) & 0x3) << 12)
+#define                MEMRETCTRL              (1 << 8)
+#define                SETRET_LEVEL(x)         (((x) & 0x3) << 6)
+#define                VOLT_LEVEL(x)           (((x) & 0x3) << 0)
+
+#define OMAP24XX_PRCM_VBASE    IO_ADDRESS(OMAP24XX_PRCM_BASE)
+#define prcm_readl(r)          __raw_readl(OMAP24XX_PRCM_VBASE + (r))
+#define prcm_writel(v, r)      __raw_writel((v), OMAP24XX_PRCM_VBASE + (r))
+
+static u32 pmdomain_get_wakeup_dependencies(int domain_offset)
+{
+       return prcm_readl(domain_offset + PM_WKDEP_OFFSET);
+}
+
+static void pmdomain_set_wakeup_dependencies(u32 state, int domain_offset)
+{
+       prcm_writel(state, domain_offset + PM_WKDEP_OFFSET);
+}
+
+static u32 pmdomain_get_powerstate(int domain_offset)
+{
+       return prcm_readl(domain_offset + PM_PWSTCTRL_OFFSET);
+}
+
+static void pmdomain_set_powerstate(u32 state, int domain_offset)
+{
+       prcm_writel(state, domain_offset + PM_PWSTCTRL_OFFSET);
+}
+
+static u32 pmdomain_get_clock_autocontrol(int domain_offset)
+{
+       return prcm_readl(domain_offset + CM_CLKSTCTRL_OFFSET);
+}
+
+static void pmdomain_set_clock_autocontrol(u32 state, int domain_offset)
+{
+       prcm_writel(state, domain_offset + CM_CLKSTCTRL_OFFSET);
+}
+
+static u32 pmdomain_get_clock_autoidle1(int domain_offset)
+{
+       return prcm_readl(domain_offset + CM_AUTOIDLE1_OFFSET);
+}
+
+/* Core domain only */
+static u32 pmdomain_get_clock_autoidle2(int domain_offset)
+{
+       return prcm_readl(domain_offset + CM_AUTOIDLE2_OFFSET);
+}
+
+/* Core domain only */
+static u32 pmdomain_get_clock_autoidle3(int domain_offset)
+{
+       return prcm_readl(domain_offset + CM_AUTOIDLE3_OFFSET);
+}
+
+/* Core domain only */
+static u32 pmdomain_get_clock_autoidle4(int domain_offset)
+{
+       return prcm_readl(domain_offset + CM_AUTOIDLE4_OFFSET);
+}
+
+static void pmdomain_set_clock_autoidle1(u32 state, int domain_offset)
+{
+       prcm_writel(state, CM_AUTOIDLE1_OFFSET + domain_offset);
+}
+
+/* Core domain only */
+static void pmdomain_set_clock_autoidle2(u32 state, int domain_offset)
+{
+       prcm_writel(state, CM_AUTOIDLE2_OFFSET + domain_offset);
+}
+
+/* Core domain only */
+static void pmdomain_set_clock_autoidle3(u32 state, int domain_offset)
+{
+       prcm_writel(state, CM_AUTOIDLE3_OFFSET + domain_offset);
+}
+
+/* Core domain only */
+static void pmdomain_set_clock_autoidle4(u32 state, int domain_offset)
+{
+       prcm_writel(state, CM_AUTOIDLE4_OFFSET + domain_offset);
+}
+
+/*
+ * Configures power management domains to idle clocks automatically.
+ */
+void pmdomain_set_autoidle(void)
+{
+       u32 val;
+
+       /* Set PLL auto stop for 54M, 96M & DPLL */
+       pmdomain_set_clock_autoidle1(AUTO_54M(AUTO_STOPPED) |
+                                    AUTO_96M(AUTO_STOPPED) |
+                                    AUTO_DPLL(AUTO_STOPPED), PM_PLL_OFFSET);
+
+       /* External clock input control
+        * REVISIT: Should this be in clock framework?
+        */
+       PRCM_CLKSRC_CTRL |= (0x3 << 3);
+
+       /* Configure number of 32KHz clock cycles for sys_clk */
+       PRCM_CLKSSETUP = 0x00ff;
+
+       /* Configure automatic voltage transition */
+       PRCM_VOLTSETUP = 0;
+       val = PRCM_VOLTCTRL;
+       val &= ~(SETOFF_LEVEL(0x3) | VOLT_LEVEL(0x3));
+       val |= SETOFF_LEVEL(1) | VOLT_LEVEL(1) | AUTO_EXTVOLT;
+       PRCM_VOLTCTRL = val;
+
+       /* Disable emulation tools functional clock */
+       PRCM_CLKEMUL_CTRL = 0x0;
+
+       /* Set core memory retention state */
+       val = pmdomain_get_powerstate(PM_CORE_OFFSET);
+       if (cpu_is_omap2420()) {
+               val &= ~(0x7 << 3);
+               val |= (MEM3RETSTATE | MEM2RETSTATE | MEM1RETSTATE);
+       } else {
+               val &= ~(0xf << 3);
+               val |= (MEM4RETSTATE | MEM3RETSTATE | MEM2RETSTATE |
+                       MEM1RETSTATE);
+       }
+       pmdomain_set_powerstate(val, PM_CORE_OFFSET);
+
+       /* OCP interface smart idle. REVISIT: Enable autoidle bit0 ? */
+       val = SMS_SYSCONFIG;
+       val &= ~(0x3 << 3);
+       val |= (0x2 << 3) | (1 << 0);
+       SMS_SYSCONFIG |= val;
+
+       val = SDRC_SYSCONFIG;
+       val &= ~(0x3 << 3);
+       val |= (0x2 << 3);
+       SDRC_SYSCONFIG = val;
+
+       /* Configure L3 interface for smart idle.
+        * REVISIT: Enable autoidle bit0 ?
+        */
+       val = GPMC_SYSCONFIG;
+       val &= ~(0x3 << 3);
+       val |= (0x2 << 3) | (1 << 0);
+       GPMC_SYSCONFIG = val;
+
+       pmdomain_set_powerstate(LOGICRETSTATE | POWERSTATE_RETENTION,
+                               PM_MPU_OFFSET);
+       pmdomain_set_powerstate(POWERSTATE_RETENTION, PM_CORE_OFFSET);
+       if (!cpu_is_omap2420())
+               pmdomain_set_powerstate(POWERSTATE_RETENTION, PM_MDM_OFFSET);
+
+       /* Assume suspend function has saved the state for DSP and GFX */
+       pmdomain_set_powerstate(FORCESTATE | POWERSTATE_OFF, PM_DSP_OFFSET);
+       pmdomain_set_powerstate(FORCESTATE | POWERSTATE_OFF, PM_GFX_OFFSET);
+
+#if 0
+       /* REVISIT: Internal USB needs special handling */
+       force_standby_usb();
+       if (cpu_is_omap2430())
+               force_hsmmc();
+       sdram_self_refresh_on_idle_req(1);
+#endif
+
+       /* Enable clock auto control for all domains.
+        * Note that CORE domain includes also DSS, L4 & L3.
+        */
+       pmdomain_set_clock_autocontrol(AUTOSTAT_MPU, PM_MPU_OFFSET);
+       pmdomain_set_clock_autocontrol(AUTOSTAT_GFX, PM_GFX_OFFSET);
+       pmdomain_set_clock_autocontrol(AUTOSTAT_DSS | AUTOSTAT_L4 | AUTOSTAT_L3,
+                                      PM_CORE_OFFSET);
+       if (cpu_is_omap2420())
+               pmdomain_set_clock_autocontrol(AUTOSTAT_IVA | AUTOSTAT_DSP,
+                                              PM_DSP_OFFSET);
+       else {
+               pmdomain_set_clock_autocontrol(AUTOSTAT_DSP, PM_DSP_OFFSET);
+               pmdomain_set_clock_autocontrol(AUTOSTAT_MDM, PM_MDM_OFFSET);
+       }
+
+       /* Enable clock autoidle for all domains */
+       pmdomain_set_clock_autoidle1(0x2, PM_DSP_OFFSET);
+       if (cpu_is_omap2420()) {
+               pmdomain_set_clock_autoidle1(0xfffffff9, PM_CORE_OFFSET);
+               pmdomain_set_clock_autoidle2(0x7, PM_CORE_OFFSET);
+               pmdomain_set_clock_autoidle1(0x3f, PM_WKUP_OFFSET);
+       } else {
+               pmdomain_set_clock_autoidle1(0xeafffff1, PM_CORE_OFFSET);
+               pmdomain_set_clock_autoidle2(0xfff, PM_CORE_OFFSET);
+               pmdomain_set_clock_autoidle1(0x7f, PM_WKUP_OFFSET);
+               pmdomain_set_clock_autoidle1(0x3, PM_MDM_OFFSET);
+       }
+       pmdomain_set_clock_autoidle3(0x7, PM_CORE_OFFSET);
+       pmdomain_set_clock_autoidle4(0x1f, PM_CORE_OFFSET);
+}
+
+/*
+ * Initializes power domains by removing wake-up dependencies and powering
+ * down DSP and GFX. Gets called from PM init. Note that DSP and IVA code
+ * must re-enable DSP and GFX when used.
+ */
+void __init pmdomain_init(void)
+{
+       /* Remove all domain wakeup dependencies */
+       pmdomain_set_wakeup_dependencies(EN_WKUP | EN_CORE, PM_MPU_OFFSET);
+       pmdomain_set_wakeup_dependencies(0, PM_DSP_OFFSET);
+       pmdomain_set_wakeup_dependencies(0, PM_GFX_OFFSET);
+       pmdomain_set_wakeup_dependencies(EN_WKUP | EN_MPU, PM_CORE_OFFSET);
+       if (cpu_is_omap2430())
+               pmdomain_set_wakeup_dependencies(0, PM_MDM_OFFSET);
+
+       /* Power down DSP and GFX */
+       pmdomain_set_powerstate(POWERSTATE_OFF | FORCESTATE, PM_DSP_OFFSET);
+       pmdomain_set_powerstate(POWERSTATE_OFF | FORCESTATE, PM_GFX_OFFSET);
+}
index 562168fa2b163a277dcb60c7fa730994b831d7d3..d7eee99b7e3fef12029d700f9550e6e0a96a3df7 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/interrupt.h>
 #include <linux/sysfs.h>
 #include <linux/module.h>
+#include <linux/delay.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/arch/sram.h>
 #include <asm/arch/pm.h>
 
+#include "prcm-regs.h"
+
 static struct clk *vclk;
 static void (*omap2_sram_idle)(void);
 static void (*omap2_sram_suspend)(int dllctrl, int cpu_rev);
 static void (*saved_idle)(void);
 
+extern void __init pmdomain_init(void);
+extern void pmdomain_set_autoidle(void);
+
+static unsigned int omap24xx_sleep_save[OMAP24XX_SLEEP_SAVE_SIZE];
+
 void omap2_pm_idle(void)
 {
        local_irq_disable();
@@ -87,23 +95,272 @@ static int omap2_pm_prepare(suspend_state_t state)
        return error;
 }
 
+#define INT0_WAKE_MASK (OMAP_IRQ_BIT(INT_24XX_GPIO_BANK1) |    \
+                       OMAP_IRQ_BIT(INT_24XX_GPIO_BANK2) |     \
+                       OMAP_IRQ_BIT(INT_24XX_GPIO_BANK3))
+
+#define INT1_WAKE_MASK (OMAP_IRQ_BIT(INT_24XX_GPIO_BANK4))
+
+#define INT2_WAKE_MASK (OMAP_IRQ_BIT(INT_24XX_UART1_IRQ) |     \
+                       OMAP_IRQ_BIT(INT_24XX_UART2_IRQ) |      \
+                       OMAP_IRQ_BIT(INT_24XX_UART3_IRQ))
+
+#define preg(reg)      printk("%s\t(0x%p):\t0x%08x\n", #reg, &reg, reg);
+
+static void omap2_pm_debug(char * desc)
+{
+       printk("%s:\n", desc);
+
+       preg(CM_CLKSTCTRL_MPU);
+       preg(CM_CLKSTCTRL_CORE);
+       preg(CM_CLKSTCTRL_GFX);
+       preg(CM_CLKSTCTRL_DSP);
+       preg(CM_CLKSTCTRL_MDM);
+
+       preg(PM_PWSTCTRL_MPU);
+       preg(PM_PWSTCTRL_CORE);
+       preg(PM_PWSTCTRL_GFX);
+       preg(PM_PWSTCTRL_DSP);
+       preg(PM_PWSTCTRL_MDM);
+
+       preg(PM_PWSTST_MPU);
+       preg(PM_PWSTST_CORE);
+       preg(PM_PWSTST_GFX);
+       preg(PM_PWSTST_DSP);
+       preg(PM_PWSTST_MDM);
+
+       preg(CM_AUTOIDLE1_CORE);
+       preg(CM_AUTOIDLE2_CORE);
+       preg(CM_AUTOIDLE3_CORE);
+       preg(CM_AUTOIDLE4_CORE);
+       preg(CM_AUTOIDLE_WKUP);
+       preg(CM_AUTOIDLE_PLL);
+       preg(CM_AUTOIDLE_DSP);
+       preg(CM_AUTOIDLE_MDM);
+
+       preg(CM_ICLKEN1_CORE);
+       preg(CM_ICLKEN2_CORE);
+       preg(CM_ICLKEN3_CORE);
+       preg(CM_ICLKEN4_CORE);
+       preg(CM_ICLKEN_GFX);
+       preg(CM_ICLKEN_WKUP);
+       preg(CM_ICLKEN_DSP);
+       preg(CM_ICLKEN_MDM);
+
+       preg(CM_IDLEST1_CORE);
+       preg(CM_IDLEST2_CORE);
+       preg(CM_IDLEST3_CORE);
+       preg(CM_IDLEST4_CORE);
+       preg(CM_IDLEST_GFX);
+       preg(CM_IDLEST_WKUP);
+       preg(CM_IDLEST_CKGEN);
+       preg(CM_IDLEST_DSP);
+       preg(CM_IDLEST_MDM);
+
+       preg(RM_RSTST_MPU);
+       preg(RM_RSTST_GFX);
+       preg(RM_RSTST_WKUP);
+       preg(RM_RSTST_DSP);
+       preg(RM_RSTST_MDM);
+
+       preg(PM_WKDEP_MPU);
+       preg(PM_WKDEP_CORE);
+       preg(PM_WKDEP_GFX);
+       preg(PM_WKDEP_DSP);
+       preg(PM_WKDEP_MDM);
+
+       preg(CM_FCLKEN_WKUP);
+       preg(CM_ICLKEN_WKUP);
+       preg(CM_IDLEST_WKUP);
+       preg(CM_AUTOIDLE_WKUP);
+       preg(CM_CLKSEL_WKUP);
+
+       preg(PM_WKEN_WKUP);
+       preg(PM_WKST_WKUP);
+}
+
+static inline void omap2_pm_save_registers(void)
+{
+       /* Save interrupt registers */
+       OMAP24XX_SAVE(INTC_MIR0);
+       OMAP24XX_SAVE(INTC_MIR1);
+       OMAP24XX_SAVE(INTC_MIR2);
+
+       /* Save power control registers */
+       OMAP24XX_SAVE(CM_CLKSTCTRL_MPU);
+       OMAP24XX_SAVE(CM_CLKSTCTRL_CORE);
+       OMAP24XX_SAVE(CM_CLKSTCTRL_GFX);
+       OMAP24XX_SAVE(CM_CLKSTCTRL_DSP);
+       OMAP24XX_SAVE(CM_CLKSTCTRL_MDM);
+
+       /* Save power state registers */
+       OMAP24XX_SAVE(PM_PWSTCTRL_MPU);
+       OMAP24XX_SAVE(PM_PWSTCTRL_CORE);
+       OMAP24XX_SAVE(PM_PWSTCTRL_GFX);
+       OMAP24XX_SAVE(PM_PWSTCTRL_DSP);
+       OMAP24XX_SAVE(PM_PWSTCTRL_MDM);
+
+       /* Save autoidle registers */
+       OMAP24XX_SAVE(CM_AUTOIDLE1_CORE);
+       OMAP24XX_SAVE(CM_AUTOIDLE2_CORE);
+       OMAP24XX_SAVE(CM_AUTOIDLE3_CORE);
+       OMAP24XX_SAVE(CM_AUTOIDLE4_CORE);
+       OMAP24XX_SAVE(CM_AUTOIDLE_WKUP);
+       OMAP24XX_SAVE(CM_AUTOIDLE_PLL);
+       OMAP24XX_SAVE(CM_AUTOIDLE_DSP);
+       OMAP24XX_SAVE(CM_AUTOIDLE_MDM);
+
+       /* Save idle state registers */
+       OMAP24XX_SAVE(CM_IDLEST1_CORE);
+       OMAP24XX_SAVE(CM_IDLEST2_CORE);
+       OMAP24XX_SAVE(CM_IDLEST3_CORE);
+       OMAP24XX_SAVE(CM_IDLEST4_CORE);
+       OMAP24XX_SAVE(CM_IDLEST_GFX);
+       OMAP24XX_SAVE(CM_IDLEST_WKUP);
+       OMAP24XX_SAVE(CM_IDLEST_CKGEN);
+       OMAP24XX_SAVE(CM_IDLEST_DSP);
+       OMAP24XX_SAVE(CM_IDLEST_MDM);
+
+       /* Save clock registers */
+       OMAP24XX_SAVE(CM_FCLKEN1_CORE);
+       OMAP24XX_SAVE(CM_FCLKEN2_CORE);
+       OMAP24XX_SAVE(CM_ICLKEN1_CORE);
+       OMAP24XX_SAVE(CM_ICLKEN2_CORE);
+       OMAP24XX_SAVE(CM_ICLKEN3_CORE);
+       OMAP24XX_SAVE(CM_ICLKEN4_CORE);
+}
+
+static inline void omap2_pm_restore_registers(void)
+{
+       /* Restore clock state registers */
+       OMAP24XX_RESTORE(CM_CLKSTCTRL_MPU);
+       OMAP24XX_RESTORE(CM_CLKSTCTRL_CORE);
+       OMAP24XX_RESTORE(CM_CLKSTCTRL_GFX);
+       OMAP24XX_RESTORE(CM_CLKSTCTRL_DSP);
+       OMAP24XX_RESTORE(CM_CLKSTCTRL_MDM);
+
+       /* Restore power state registers */
+       OMAP24XX_RESTORE(PM_PWSTCTRL_MPU);
+       OMAP24XX_RESTORE(PM_PWSTCTRL_CORE);
+       OMAP24XX_RESTORE(PM_PWSTCTRL_GFX);
+       OMAP24XX_RESTORE(PM_PWSTCTRL_DSP);
+       OMAP24XX_RESTORE(PM_PWSTCTRL_MDM);
+
+       /* Restore idle state registers */
+       OMAP24XX_RESTORE(CM_IDLEST1_CORE);
+       OMAP24XX_RESTORE(CM_IDLEST2_CORE);
+       OMAP24XX_RESTORE(CM_IDLEST3_CORE);
+       OMAP24XX_RESTORE(CM_IDLEST4_CORE);
+       OMAP24XX_RESTORE(CM_IDLEST_GFX);
+       OMAP24XX_RESTORE(CM_IDLEST_WKUP);
+       OMAP24XX_RESTORE(CM_IDLEST_CKGEN);
+       OMAP24XX_RESTORE(CM_IDLEST_DSP);
+       OMAP24XX_RESTORE(CM_IDLEST_MDM);
+
+       /* Restore autoidle registers */
+       OMAP24XX_RESTORE(CM_AUTOIDLE1_CORE);
+       OMAP24XX_RESTORE(CM_AUTOIDLE2_CORE);
+       OMAP24XX_RESTORE(CM_AUTOIDLE3_CORE);
+       OMAP24XX_RESTORE(CM_AUTOIDLE4_CORE);
+       OMAP24XX_RESTORE(CM_AUTOIDLE_WKUP);
+       OMAP24XX_RESTORE(CM_AUTOIDLE_PLL);
+       OMAP24XX_RESTORE(CM_AUTOIDLE_DSP);
+       OMAP24XX_RESTORE(CM_AUTOIDLE_MDM);
+
+       /* Restore clock registers */
+       OMAP24XX_RESTORE(CM_FCLKEN1_CORE);
+       OMAP24XX_RESTORE(CM_FCLKEN2_CORE);
+       OMAP24XX_RESTORE(CM_ICLKEN1_CORE);
+       OMAP24XX_RESTORE(CM_ICLKEN2_CORE);
+       OMAP24XX_RESTORE(CM_ICLKEN3_CORE);
+       OMAP24XX_RESTORE(CM_ICLKEN4_CORE);
+
+       /* REVISIT: Clear interrupts here */
+
+       /* Restore interrupt registers */
+       OMAP24XX_RESTORE(INTC_MIR0);
+       OMAP24XX_RESTORE(INTC_MIR1);
+       OMAP24XX_RESTORE(INTC_MIR2);
+}
+
+static int omap2_pm_suspend(void)
+{
+       int processor_type = 0;
+
+       /* REVISIT: 0x21 or 0x26? */
+       if (cpu_is_omap2420())
+               processor_type = 0x21;
+
+       if (!processor_type)
+               return -ENOTSUPP;
+
+       local_irq_disable();
+       local_fiq_disable();
+
+       omap2_pm_save_registers();
+
+       /* Disable interrupts except for the wake events */
+       INTC_MIR_SET0 = 0xffffffff & ~INT0_WAKE_MASK;
+       INTC_MIR_SET1 = 0xffffffff & ~INT1_WAKE_MASK;
+       INTC_MIR_SET2 = 0xffffffff & ~INT2_WAKE_MASK;
+
+       pmdomain_set_autoidle();
+
+       /* Clear old wake-up events */
+       PM_WKST1_CORE = 0;
+       PM_WKST2_CORE = 0;
+       PM_WKST_WKUP = 0;
+
+       /* Enable wake-up events */
+       PM_WKEN1_CORE = (1 << 22) | (1 << 21);  /* UART1 & 2 */
+       PM_WKEN2_CORE = (1 << 2);               /* UART3 */
+       PM_WKEN_WKUP = (1 << 2) | (1 << 0);     /* GPIO & GPT1 */
+
+       /* Disable clocks except for CM_ICLKEN2_CORE. It gets disabled
+        * in the SRAM suspend code */
+       CM_FCLKEN1_CORE = 0;
+       CM_FCLKEN2_CORE = 0;
+       CM_ICLKEN1_CORE = 0;
+       CM_ICLKEN3_CORE = 0;
+       CM_ICLKEN4_CORE = 0;
+
+       omap2_pm_debug("Status before suspend");
+
+       /* Must wait for serial buffers to clear */
+       mdelay(200);
+
+       /* Jump to SRAM suspend code
+        * REVISIT: When is this SDRC_DLLB_CTRL?
+        */
+       omap2_sram_suspend(SDRC_DLLA_CTRL, processor_type);
+
+       /* Back from sleep */
+       omap2_pm_restore_registers();
+
+       local_fiq_enable();
+       local_irq_enable();
+
+       return 0;
+}
+
 static int omap2_pm_enter(suspend_state_t state)
 {
+       int ret = 0;
+
        switch (state)
        {
        case PM_SUSPEND_STANDBY:
        case PM_SUSPEND_MEM:
-               /* FIXME: Add suspend */
+               ret = omap2_pm_suspend();
                break;
-
        case PM_SUSPEND_DISK:
-               return -ENOTSUPP;
-
+               ret = -ENOTSUPP;
+               break;
        default:
-               return -EINVAL;
+               ret = -EINVAL;
        }
 
-       return 0;
+       return ret;
 }
 
 static int omap2_pm_finish(suspend_state_t state)
@@ -143,6 +400,8 @@ int __init omap2_pm_init(void)
        pm_set_ops(&omap_pm_ops);
        pm_idle = omap2_pm_idle;
 
+       pmdomain_init();
+
        return 0;
 }
 
index 8893479dc7e0262777e7fa612eef298a2958839b..c2bf57ef68255309ab46096f6de08202af433a1b 100644 (file)
@@ -13,7 +13,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/clk.h>
index 00299cbeb9111b7e8ad33c42f2ec9976054fa710..16247d557853fbb146a4319c1b60442f2a59b744 100644 (file)
@@ -21,7 +21,6 @@
  * MA 02111-1307 USA
  */
 
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/assembler.h>
 #include <asm/arch/io.h>
index d261e4ff4d9b33c2b664d2b07f914e69f1c78cc9..a5ef7f611da95e27296648112cb335dec50aa6b0 100644 (file)
@@ -22,7 +22,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  * MA 02111-1307 USA
  */
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/assembler.h>
 #include <asm/arch/io.h>
index 1d2f5ac2f69b8ec6d59f1bcaf41aeb53757e7816..fe5fd6d42dea8def5e4c8a8a0e93919830263e26 100644 (file)
@@ -6,6 +6,7 @@
  * Copyright (C) 2005 Nokia Corporation
  * Author: Paul Mundt <paul.mundt@nokia.com>
  *         Juha Yrjölä <juha.yrjola@nokia.com>
+ * OMAP Dual-mode timer framework support by Timo Teras
  *
  * Some parts based off of TI's 24xx code:
  *
 #include <linux/interrupt.h>
 #include <linux/err.h>
 #include <linux/clk.h>
+#include <linux/delay.h>
 
 #include <asm/mach/time.h>
-#include <asm/delay.h>
-#include <asm/io.h>
+#include <asm/arch/dmtimer.h>
 
-#define OMAP2_GP_TIMER1_BASE   0x48028000
-#define OMAP2_GP_TIMER2_BASE   0x4802a000
-#define OMAP2_GP_TIMER3_BASE   0x48078000
-#define OMAP2_GP_TIMER4_BASE   0x4807a000
+static struct omap_dm_timer *gptimer;
 
-#define GP_TIMER_TIDR          0x00
-#define GP_TIMER_TISR          0x18
-#define GP_TIMER_TIER          0x1c
-#define GP_TIMER_TCLR          0x24
-#define GP_TIMER_TCRR          0x28
-#define GP_TIMER_TLDR          0x2c
-#define GP_TIMER_TSICR         0x40
-
-#define OS_TIMER_NR            1  /* GP timer 2 */
-
-static unsigned long timer_base[] = {
-       IO_ADDRESS(OMAP2_GP_TIMER1_BASE),
-       IO_ADDRESS(OMAP2_GP_TIMER2_BASE),
-       IO_ADDRESS(OMAP2_GP_TIMER3_BASE),
-       IO_ADDRESS(OMAP2_GP_TIMER4_BASE),
-};
-
-static inline unsigned int timer_read_reg(int nr, unsigned int reg)
-{
-       return __raw_readl(timer_base[nr] + reg);
-}
-
-static inline void timer_write_reg(int nr, unsigned int reg, unsigned int val)
-{
-       __raw_writel(val, timer_base[nr] + reg);
-}
-
-/* Note that we always enable the clock prescale divider bit */
-static inline void omap2_gp_timer_start(int nr, unsigned long load_val)
+static inline void omap2_gp_timer_start(unsigned long load_val)
 {
-       unsigned int tmp;
-
-       tmp = 0xffffffff - load_val;
-
-       timer_write_reg(nr, GP_TIMER_TLDR, tmp);
-       timer_write_reg(nr, GP_TIMER_TCRR, tmp);
-       timer_write_reg(nr, GP_TIMER_TIER, 1 << 1);
-       timer_write_reg(nr, GP_TIMER_TCLR, (1 << 5) | (1 << 1) | 1);
+       omap_dm_timer_set_load(gptimer, 1, 0xffffffff - load_val);
+       omap_dm_timer_set_int_enable(gptimer, OMAP_TIMER_INT_OVERFLOW);
+       omap_dm_timer_start(gptimer);
 }
 
 static irqreturn_t omap2_gp_timer_interrupt(int irq, void *dev_id,
@@ -77,7 +42,7 @@ static irqreturn_t omap2_gp_timer_interrupt(int irq, void *dev_id,
 {
        write_seqlock(&xtime_lock);
 
-       timer_write_reg(OS_TIMER_NR, GP_TIMER_TISR, 1 << 1);
+       omap_dm_timer_write_status(gptimer, OMAP_TIMER_INT_OVERFLOW);
        timer_tick(regs);
 
        write_sequnlock(&xtime_lock);
@@ -87,41 +52,26 @@ static irqreturn_t omap2_gp_timer_interrupt(int irq, void *dev_id,
 
 static struct irqaction omap2_gp_timer_irq = {
        .name           = "gp timer",
-       .flags          = SA_INTERRUPT,
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
        .handler        = omap2_gp_timer_interrupt,
 };
 
 static void __init omap2_gp_timer_init(void)
 {
-       struct clk * sys_ck;
-       u32 tick_period = 120000;
-       u32 l;
+       u32 tick_period;
 
-       /* Reset clock and prescale value */
-       timer_write_reg(OS_TIMER_NR, GP_TIMER_TCLR, 0);
+       omap_dm_timer_init();
+       gptimer = omap_dm_timer_request_specific(1);
+       BUG_ON(gptimer == NULL);
 
-       sys_ck = clk_get(NULL, "sys_ck");
-       if (IS_ERR(sys_ck))
-               printk(KERN_ERR "Could not get sys_ck\n");
-       else {
-               clk_enable(sys_ck);
-               tick_period = clk_get_rate(sys_ck) / 100;
-               clk_put(sys_ck);
-       }
-
-       tick_period /= 2;       /* Minimum prescale divider is 2 */
+       omap_dm_timer_set_source(gptimer, OMAP_TIMER_SRC_SYS_CLK);
+       tick_period = clk_get_rate(omap_dm_timer_get_fclk(gptimer)) / 100;
        tick_period -= 1;
 
-       l = timer_read_reg(OS_TIMER_NR, GP_TIMER_TIDR);
-       printk(KERN_INFO "OMAP2 GP timer (HW version %d.%d)\n",
-              (l >> 4) & 0x0f, l & 0x0f);
-
-       setup_irq(38, &omap2_gp_timer_irq);
-
-       omap2_gp_timer_start(OS_TIMER_NR, tick_period);
+       setup_irq(omap_dm_timer_get_irq(gptimer), &omap2_gp_timer_irq);
+       omap2_gp_timer_start(tick_period);
 }
 
 struct sys_timer omap_timer = {
        .init   = omap2_gp_timer_init,
 };
-
index 4ce68069852951b109df9cebcb61e7db0504909c..888bf6cfba8a7b15370aee9a2448e39b1cb4dc36 100644 (file)
@@ -86,7 +86,7 @@ static irqreturn_t pnx4008_timer_interrupt(int irq, void *dev_id,
 
 static struct irqaction pnx4008_timer_irq = {
        .name = "PNX4008 Tick Timer",
-       .flags = SA_INTERRUPT | SA_TIMER,
+       .flags = IRQF_DISABLED | IRQF_TIMER,
        .handler = pnx4008_timer_interrupt
 };
 
index ea5137f319c4087df66ee8ac8478c9d5ea1be088..03d07cae26c827285f9407e47c9b46504d6a08b1 100644 (file)
@@ -35,6 +35,10 @@ config PXA_SHARPSL
          SL-C3000 (Spitz), SL-C3100 (Borzoi) or SL-C6000x (Tosa)
          handheld computer.
 
+config MACH_TRIZEPS4
+       bool "Keith und Koep Trizeps4 DIMM-Module"
+       select PXA27x
+
 endchoice
 
 if PXA_SHARPSL
@@ -55,6 +59,21 @@ endchoice
 
 endif
 
+if MACH_TRIZEPS4
+
+choice
+       prompt "Select base board for Trizeps 4 module"
+
+config MACH_TRIZEPS4_CONXS
+       bool "ConXS Eval Board"
+
+config MACH_TRIZEPS4_ANY
+       bool "another Board"
+
+endchoice
+
+endif
+
 endmenu
 
 config MACH_POODLE
index 1610690be419de00f2f1e19a8c332dfd4649212a..9093eb1c94ebdfae3a94611a1d586c493ad01d9a 100644 (file)
@@ -12,6 +12,7 @@ obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o
 obj-$(CONFIG_MACH_LOGICPD_PXA270) += lpd270.o
 obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o
 obj-$(CONFIG_ARCH_PXA_IDP) += idp.o
+obj-$(CONFIG_MACH_TRIZEPS4)    += trizeps4.o
 obj-$(CONFIG_PXA_SHARP_C7xx)   += corgi.o corgi_ssp.o corgi_lcd.o sharpsl_pm.o corgi_pm.o
 obj-$(CONFIG_PXA_SHARP_Cxx00)  += spitz.o corgi_ssp.o corgi_lcd.o sharpsl_pm.o spitz_pm.o
 obj-$(CONFIG_MACH_AKITA)       += akita-ioexp.o
@@ -23,6 +24,7 @@ led-y := leds.o
 led-$(CONFIG_ARCH_LUBBOCK) += leds-lubbock.o
 led-$(CONFIG_MACH_MAINSTONE) += leds-mainstone.o
 led-$(CONFIG_ARCH_PXA_IDP) += leds-idp.o
+led-$(CONFIG_MACH_TRIZEPS4) += leds-trizeps4.o
 
 obj-$(CONFIG_LEDS) += $(led-y)
 
index bf6648a839012b73397071560f321c6463b33b9a..cce26576999ea8333a89a132f622edbe01185928 100644 (file)
@@ -225,7 +225,7 @@ static int corgi_mci_init(struct device *dev, irqreturn_t (*corgi_detect_int)(in
        corgi_mci_platform_data.detect_delay = msecs_to_jiffies(250);
 
        err = request_irq(CORGI_IRQ_GPIO_nSD_DETECT, corgi_detect_int,
-                         SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING,
+                         IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
                          "MMC card detect", data);
        if (err) {
                printk(KERN_ERR "corgi_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
index 347b9dea24c6ea67889d49052c6c003c7c58137c..6914d22bc20fbfb0b19c8eba67f48e0e85ef83ad 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <linux/init.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/platform_device.h>
 #include <linux/fb.h>
 
index 5eba6ea0b0f79ee1119f20170bec271e7dc73348..38aa9270540eebfd5487f3e49a9286079b5f582c 100644 (file)
@@ -12,7 +12,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/init.h>
 
 #include <asm/hardware.h>
index 05cf56059a0f11273f045a6757fe36cddb21b540..afbc6698e27cfce4107bee4f097f2db98cf79065 100644 (file)
@@ -11,7 +11,6 @@
  * namespace collision.  Mostly adapted the Mainstone version.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 
 #include <asm/hardware.h>
index c06d3d7a8dd4923da3f3989b25de5b0bf13676d8..065293eb0d82a4ce0e605838b2e953b8453c832f 100644 (file)
@@ -10,7 +10,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 
 #include <asm/hardware.h>
diff --git a/arch/arm/mach-pxa/leds-trizeps4.c b/arch/arm/mach-pxa/leds-trizeps4.c
new file mode 100644 (file)
index 0000000..14cfc85
--- /dev/null
@@ -0,0 +1,134 @@
+/*
+ * linux/arch/arm/mach-pxa/leds-trizeps4.c
+ *
+ *  Author:    Jürgen Schindele
+ *  Created:   20 02, 2006
+ *  Copyright: Jürgen Schindele
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/config.h>
+#include <linux/init.h>
+
+#include <asm/hardware.h>
+#include <asm/system.h>
+#include <asm/types.h>
+#include <asm/leds.h>
+
+#include <asm/arch/pxa-regs.h>
+#include <asm/arch/trizeps4.h>
+
+#include "leds.h"
+
+#define LED_STATE_ENABLED      1
+#define LED_STATE_CLAIMED      2
+
+#define SYS_BUSY               0x01
+#define HEARTBEAT              0x02
+#define BLINK                  0x04
+
+static unsigned int led_state;
+static unsigned int hw_led_state;
+
+void trizeps4_leds_event(led_event_t evt)
+{
+       unsigned long flags;
+
+       local_irq_save(flags);
+
+       switch (evt) {
+       case led_start:
+               hw_led_state = 0;
+               pxa_gpio_mode( GPIO_SYS_BUSY_LED  | GPIO_OUT);          /* LED1 */
+               pxa_gpio_mode( GPIO_HEARTBEAT_LED | GPIO_OUT);          /* LED2 */
+               led_state = LED_STATE_ENABLED;
+               break;
+
+       case led_stop:
+               led_state &= ~LED_STATE_ENABLED;
+               break;
+
+       case led_claim:
+               led_state |= LED_STATE_CLAIMED;
+               hw_led_state = 0;
+               break;
+
+       case led_release:
+               led_state &= ~LED_STATE_CLAIMED;
+               hw_led_state = 0;
+               break;
+
+#ifdef CONFIG_LEDS_TIMER
+       case led_timer:
+               hw_led_state ^= HEARTBEAT;
+               break;
+#endif
+
+#ifdef CONFIG_LEDS_CPU
+       case led_idle_start:
+               hw_led_state &= ~SYS_BUSY;
+               break;
+
+       case led_idle_end:
+               hw_led_state |= SYS_BUSY;
+               break;
+#endif
+
+       case led_halted:
+               break;
+
+       case led_green_on:
+               hw_led_state |= BLINK;
+               break;
+
+       case led_green_off:
+               hw_led_state &= ~BLINK;
+               break;
+
+       case led_amber_on:
+               break;
+
+       case led_amber_off:
+               break;
+
+       case led_red_on:
+               break;
+
+       case led_red_off:
+               break;
+
+       default:
+               break;
+       }
+
+       if  (led_state & LED_STATE_ENABLED) {
+               switch (hw_led_state) {
+                       case 0:
+                               GPSR(GPIO_SYS_BUSY_LED)  |= GPIO_bit(GPIO_SYS_BUSY_LED);
+                               GPSR(GPIO_HEARTBEAT_LED) |= GPIO_bit(GPIO_HEARTBEAT_LED);
+                               break;
+                       case 1:
+                               GPCR(GPIO_SYS_BUSY_LED)  |= GPIO_bit(GPIO_SYS_BUSY_LED);
+                               GPSR(GPIO_HEARTBEAT_LED) |= GPIO_bit(GPIO_HEARTBEAT_LED);
+                               break;
+                       case 2:
+                               GPSR(GPIO_SYS_BUSY_LED)  |= GPIO_bit(GPIO_SYS_BUSY_LED);
+                               GPCR(GPIO_HEARTBEAT_LED) |= GPIO_bit(GPIO_HEARTBEAT_LED);
+                               break;
+                       case 3:
+                               GPCR(GPIO_SYS_BUSY_LED)  |= GPIO_bit(GPIO_SYS_BUSY_LED);
+                               GPCR(GPIO_HEARTBEAT_LED) |= GPIO_bit(GPIO_HEARTBEAT_LED);
+                               break;
+               }
+       }
+       else {
+               /* turn all off */
+               GPSR(GPIO_SYS_BUSY_LED)  |= GPIO_bit(GPIO_SYS_BUSY_LED);
+               GPSR(GPIO_HEARTBEAT_LED) |= GPIO_bit(GPIO_HEARTBEAT_LED);
+       }
+
+       local_irq_restore(flags);
+}
index bbe4d5f6afaa6f697075bf0422044d9b4915a504..e13eb841e48d3b04f0981f3d0ad80be92558d494 100644 (file)
@@ -24,6 +24,8 @@ pxa_leds_init(void)
                leds_event = mainstone_leds_event;
        if (machine_is_pxa_idp())
                leds_event = idp_leds_event;
+       if (machine_is_trizeps4())
+               leds_event = trizeps4_leds_event;
 
        leds_event(led_start);
        return 0;
index d98f6e93c12b6fda44d715971641ff1f25e584d2..4f829b8c39dd0a30d93a2d04de4d0d920fb3a2ee 100644 (file)
@@ -10,3 +10,4 @@
 extern void idp_leds_event(led_event_t evt);
 extern void lubbock_leds_event(led_event_t evt);
 extern void mainstone_leds_event(led_event_t evt);
+extern void trizeps4_leds_event(led_event_t evt);
index ec0f43a102c7da4874eb052f83d488c8cd7be3a8..1a5f5c21481e671015702edd072c595d1be3a016 100644 (file)
@@ -248,58 +248,137 @@ static void lpd270_backlight_power(int on)
 
 /* 5.7" TFT QVGA (LoLo display number 1) */
 static struct pxafb_mach_info sharp_lq057q3dc02 __initdata = {
-       .pixclock               = 100000,
-       .xres                   = 240,
-       .yres                   = 320,
+       .pixclock               = 150000,
+       .xres                   = 320,
+       .yres                   = 240,
        .bpp                    = 16,
-       .hsync_len              = 64,
-       .left_margin            = 0x27,
-       .right_margin           = 0x09,
-       .vsync_len              = 0x04,
+       .hsync_len              = 0x14,
+       .left_margin            = 0x28,
+       .right_margin           = 0x0a,
+       .vsync_len              = 0x02,
        .upper_margin           = 0x08,
        .lower_margin           = 0x14,
-       .sync                   = 0,
+       .sync                   = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
        .lccr0                  = 0x07800080,
-       .lccr3                  = 0x04400007,
+       .lccr3                  = 0x00400000,
+       .pxafb_backlight_power  = lpd270_backlight_power,
+};
+
+/* 12.1" TFT SVGA (LoLo display number 2) */
+static struct pxafb_mach_info sharp_lq121s1dg31 __initdata = {
+       .pixclock               = 50000,
+       .xres                   = 800,
+       .yres                   = 600,
+       .bpp                    = 16,
+       .hsync_len              = 0x05,
+       .left_margin            = 0x52,
+       .right_margin           = 0x05,
+       .vsync_len              = 0x04,
+       .upper_margin           = 0x14,
+       .lower_margin           = 0x0a,
+       .sync                   = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+       .lccr0                  = 0x07800080,
+       .lccr3                  = 0x00400000,
+       .pxafb_backlight_power  = lpd270_backlight_power,
+};
+
+/* 3.6" TFT QVGA (LoLo display number 3) */
+static struct pxafb_mach_info sharp_lq036q1da01 __initdata = {
+       .pixclock               = 150000,
+       .xres                   = 320,
+       .yres                   = 240,
+       .bpp                    = 16,
+       .hsync_len              = 0x0e,
+       .left_margin            = 0x04,
+       .right_margin           = 0x0a,
+       .vsync_len              = 0x03,
+       .upper_margin           = 0x03,
+       .lower_margin           = 0x03,
+       .sync                   = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+       .lccr0                  = 0x07800080,
+       .lccr3                  = 0x00400000,
        .pxafb_backlight_power  = lpd270_backlight_power,
 };
 
 /* 6.4" TFT VGA (LoLo display number 5) */
 static struct pxafb_mach_info sharp_lq64d343 __initdata = {
-       .pixclock               = 20000,
+       .pixclock               = 25000,
        .xres                   = 640,
        .yres                   = 480,
        .bpp                    = 16,
-       .hsync_len              = 49,
+       .hsync_len              = 0x31,
        .left_margin            = 0x89,
        .right_margin           = 0x19,
-       .vsync_len              = 18,
+       .vsync_len              = 0x12,
        .upper_margin           = 0x22,
-       .lower_margin           = 0,
+       .lower_margin           = 0x00,
        .sync                   = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
        .lccr0                  = 0x07800080,
-       .lccr3                  = 0x04400001,
+       .lccr3                  = 0x00400000,
+       .pxafb_backlight_power  = lpd270_backlight_power,
+};
+
+/* 10.4" TFT VGA (LoLo display number 7) */
+static struct pxafb_mach_info sharp_lq10d368 __initdata = {
+       .pixclock               = 25000,
+       .xres                   = 640,
+       .yres                   = 480,
+       .bpp                    = 16,
+       .hsync_len              = 0x31,
+       .left_margin            = 0x89,
+       .right_margin           = 0x19,
+       .vsync_len              = 0x12,
+       .upper_margin           = 0x22,
+       .lower_margin           = 0x00,
+       .sync                   = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+       .lccr0                  = 0x07800080,
+       .lccr3                  = 0x00400000,
        .pxafb_backlight_power  = lpd270_backlight_power,
 };
 
 /* 3.5" TFT QVGA (LoLo display number 8) */
 static struct pxafb_mach_info sharp_lq035q7db02_20 __initdata = {
-       .pixclock               = 100000,
+       .pixclock               = 150000,
        .xres                   = 240,
        .yres                   = 320,
        .bpp                    = 16,
-       .hsync_len              = 0x34,
-       .left_margin            = 0x09,
-       .right_margin           = 0x09,
-       .vsync_len              = 0x08,
+       .hsync_len              = 0x0e,
+       .left_margin            = 0x0a,
+       .right_margin           = 0x0a,
+       .vsync_len              = 0x03,
        .upper_margin           = 0x05,
        .lower_margin           = 0x14,
-       .sync                   = 0,
+       .sync                   = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
        .lccr0                  = 0x07800080,
-       .lccr3                  = 0x04400007,
+       .lccr3                  = 0x00400000,
        .pxafb_backlight_power  = lpd270_backlight_power,
 };
 
+static struct pxafb_mach_info *lpd270_lcd_to_use;
+
+static int __init lpd270_set_lcd(char *str)
+{
+       if (!strnicmp(str, "lq057q3dc02", 11)) {
+               lpd270_lcd_to_use = &sharp_lq057q3dc02;
+       } else if (!strnicmp(str, "lq121s1dg31", 11)) {
+               lpd270_lcd_to_use = &sharp_lq121s1dg31;
+       } else if (!strnicmp(str, "lq036q1da01", 11)) {
+               lpd270_lcd_to_use = &sharp_lq036q1da01;
+       } else if (!strnicmp(str, "lq64d343", 8)) {
+               lpd270_lcd_to_use = &sharp_lq64d343;
+       } else if (!strnicmp(str, "lq10d368", 8)) {
+               lpd270_lcd_to_use = &sharp_lq10d368;
+       } else if (!strnicmp(str, "lq035q7db02-20", 14)) {
+               lpd270_lcd_to_use = &sharp_lq035q7db02_20;
+       } else {
+               printk(KERN_INFO "lpd270: unknown lcd panel [%s]\n", str);
+       }
+
+       return 1;
+}
+
+__setup("lcd=", lpd270_set_lcd);
+
 static struct platform_device *platform_devices[] __initdata = {
        &smc91x_device,
        &lpd270_audio_device,
@@ -345,9 +424,8 @@ static void __init lpd270_init(void)
 
        platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
 
-       // set_pxa_fb_info(&sharp_lq057q3dc02);
-       set_pxa_fb_info(&sharp_lq64d343);
-       // set_pxa_fb_info(&sharp_lq035q7db02_20);
+       if (lpd270_lcd_to_use != NULL)
+               set_pxa_fb_info(lpd270_lcd_to_use);
 
        pxa_set_ohci_info(&lpd270_ohci_platform_data);
 }
index 1ab26c6914f25f2f13fe91ce55b2bb5eb4d33c3a..6a9a669d60de5e90b233eadb50cccd3808f82d08 100644 (file)
@@ -419,7 +419,7 @@ static int lubbock_mci_init(struct device *dev,
        init_timer(&mmc_timer);
        mmc_timer.data = (unsigned long) data;
        return request_irq(LUBBOCK_SD_IRQ, lubbock_detect_int,
-                       SA_SAMPLE_RANDOM, "lubbock-sd-detect", data);
+                       IRQF_SAMPLE_RANDOM, "lubbock-sd-detect", data);
 }
 
 static int lubbock_mci_get_ro(struct device *dev)
index b307f11951dfa9d7d14e8b206c4d2abe02f60fea..21ddf3de2f6e18e2b830bbb240b2b5ab43912097 100644 (file)
@@ -331,7 +331,7 @@ static int mainstone_mci_init(struct device *dev, irqreturn_t (*mstone_detect_in
         */
        MST_MSCWR1 &= ~MST_MSCWR1_MS_SEL;
 
-       err = request_irq(MAINSTONE_MMC_IRQ, mstone_detect_int, SA_INTERRUPT,
+       err = request_irq(MAINSTONE_MMC_IRQ, mstone_detect_int, IRQF_DISABLED,
                             "MMC card detect", data);
        if (err) {
                printk(KERN_ERR "mainstone_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
index 852ea72d8c80bfbc87a2b9741a1a53c371f60a04..2112c414f0e212588742c1be02c2a312772856a8 100644 (file)
@@ -10,7 +10,6 @@
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/suspend.h>
index 9a9fa87cea9fbcd6b839aa41313e78b0d65e4794..6dbff6d9480172fe0f9209f32587e03a7f56cc26 100644 (file)
@@ -212,7 +212,7 @@ static int poodle_mci_init(struct device *dev, irqreturn_t (*poodle_detect_int)(
        poodle_mci_platform_data.detect_delay = msecs_to_jiffies(250);
 
        err = request_irq(POODLE_IRQ_GPIO_nSD_DETECT, poodle_detect_int,
-                         SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING,
+                         IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
                          "MMC card detect", data);
        if (err) {
                printk(KERN_ERR "poodle_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
index 573a5758e781c366138de117529b92c04a71acce..c1f21739bf714a435dc7b3df21c3fc2c488e152b 100644 (file)
@@ -16,7 +16,6 @@
  * initialization stuff for PXA machines which can be overridden later if
  * need be.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 3baa70819f24fb20d6a0024e035946c5e8c49534..74eeada1e2fc6fe98f55fe7521e3a59547eeb27b 100644 (file)
@@ -11,7 +11,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 0f1648780c41b36016cd7a5cb3359fd667ee6a78..db6e8f56a75f59690cb83cc41659a19654a6ba70 100644 (file)
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/platform_device.h>
 
 #include <asm/hardware.h>
 #include <asm/mach-types.h>
-#include <asm/irq.h>
 #include <asm/apm.h>
 #include <asm/arch/pm.h>
 #include <asm/arch/pxa-regs.h>
@@ -142,18 +142,18 @@ void sharpsl_pm_pxa_init(void)
        pxa_gpio_mode(sharpsl_pm.machinfo->gpio_batlock | GPIO_IN);
 
        /* Register interrupt handlers */
-       if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr, SA_INTERRUPT, "AC Input Detect", sharpsl_ac_isr)) {
+       if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr, IRQF_DISABLED, "AC Input Detect", sharpsl_ac_isr)) {
                dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin));
        }
        else set_irq_type(IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin),IRQT_BOTHEDGE);
 
-       if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr, SA_INTERRUPT, "Battery Cover", sharpsl_fatal_isr)) {
+       if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr, IRQF_DISABLED, "Battery Cover", sharpsl_fatal_isr)) {
                dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock));
        }
        else set_irq_type(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock),IRQT_FALLING);
 
        if (sharpsl_pm.machinfo->gpio_fatal) {
-               if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr, SA_INTERRUPT, "Fatal Battery", sharpsl_fatal_isr)) {
+               if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr, IRQF_DISABLED, "Fatal Battery", sharpsl_fatal_isr)) {
                        dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal));
                }
                else set_irq_type(IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal),IRQT_FALLING);
@@ -162,7 +162,7 @@ void sharpsl_pm_pxa_init(void)
        if (sharpsl_pm.machinfo->batfull_irq)
        {
                /* Register interrupt handler. */
-               if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr, SA_INTERRUPT, "CO", sharpsl_chrg_full_isr)) {
+               if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr, IRQF_DISABLED, "CO", sharpsl_chrg_full_isr)) {
                        dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull));
                }
                else set_irq_type(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull),IRQT_RISING);
index 0650bed3b96ea3536e5a68ddaec7667d8b33a611..15874b360e519dd93c3e1f674b464fadb91210e3 100644 (file)
@@ -11,7 +11,6 @@
  * modify it under the terms of the GNU General Public License.
  */
 
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/assembler.h>
 #include <asm/hardware.h>
index eb9937f6f5cd5e1d7cc1cd18e144341b5ef4b938..1c32a9310dc27abe5aa43d54d24a7bfdc2a50b62 100644 (file)
@@ -308,7 +308,7 @@ static int spitz_mci_init(struct device *dev, irqreturn_t (*spitz_detect_int)(in
        spitz_mci_platform_data.detect_delay = msecs_to_jiffies(250);
 
        err = request_irq(SPITZ_IRQ_GPIO_nSD_DETECT, spitz_detect_int,
-                         SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING,
+                         IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
                          "MMC card detect", data);
        if (err) {
                printk(KERN_ERR "spitz_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
index 6f6dbbd0802137f9d9cbe6d811226e54a2b3b238..d774430d02c0c058a038a584723863e1779678dd 100644 (file)
@@ -9,7 +9,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/assembler.h>
 #include <asm/hardware.h>
index b9b2057349ebe9a1738fd327ab668bd11decb4e7..5dbd191c57c4e6980073ea58099282000b06d616 100644 (file)
@@ -10,7 +10,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/delay.h>
@@ -118,7 +117,7 @@ pxa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 static struct irqaction pxa_timer_irq = {
        .name           = "PXA Timer Tick",
-       .flags          = SA_INTERRUPT | SA_TIMER,
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
        .handler        = pxa_timer_interrupt,
 };
 
index 7152bc13680fc14ec43072edf1883d1e4b6853e0..249353616aba519ecefbc3868c27aaab58f5d14d 100644 (file)
@@ -185,7 +185,7 @@ static int tosa_mci_init(struct device *dev, irqreturn_t (*tosa_detect_int)(int,
 
        tosa_mci_platform_data.detect_delay = msecs_to_jiffies(250);
 
-       err = request_irq(TOSA_IRQ_GPIO_nSD_DETECT, tosa_detect_int, SA_INTERRUPT,
+       err = request_irq(TOSA_IRQ_GPIO_nSD_DETECT, tosa_detect_int, IRQF_DISABLED,
                                "MMC/SD card detect", data);
        if (err) {
                printk(KERN_ERR "tosa_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c
new file mode 100644 (file)
index 0000000..7c3007d
--- /dev/null
@@ -0,0 +1,473 @@
+/*
+ *  linux/arch/arm/mach-pxa/trizeps4.c
+ *
+ *  Support for the Keith und Koep Trizeps4 Module Platform.
+ *
+ *  Author:    Jürgen Schindele
+ *  Created:   20 02, 2006
+ *  Copyright: Jürgen Schindele
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ */
+
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/sysdev.h>
+#include <linux/interrupt.h>
+#include <linux/sched.h>
+#include <linux/bitops.h>
+#include <linux/fb.h>
+#include <linux/ioport.h>
+#include <linux/delay.h>
+#include <linux/serial_8250.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
+
+#include <asm/types.h>
+#include <asm/setup.h>
+#include <asm/memory.h>
+#include <asm/mach-types.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/sizes.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+#include <asm/mach/flash.h>
+
+#include <asm/arch/pxa-regs.h>
+#include <asm/arch/trizeps4.h>
+#include <asm/arch/audio.h>
+#include <asm/arch/pxafb.h>
+#include <asm/arch/mmc.h>
+#include <asm/arch/irda.h>
+#include <asm/arch/ohci.h>
+
+#include "generic.h"
+
+/********************************************************************************************
+ * ONBOARD FLASH
+ ********************************************************************************************/
+static struct mtd_partition trizeps4_partitions[] = {
+       {
+               .name =         "Bootloader",
+               .size =         0x00040000,
+               .offset =       0,
+               .mask_flags =   MTD_WRITEABLE  /* force read-only */
+       },{
+               .name =         "Kernel",
+               .size =         0x00400000,
+               .offset =       0x00040000
+       },{
+               .name =         "Filesystem",
+               .size =         MTDPART_SIZ_FULL,
+               .offset =       0x00440000
+       }
+};
+
+static struct flash_platform_data trizeps4_flash_data[] = {
+       {
+               .map_name       = "cfi_probe",
+               .parts          = trizeps4_partitions,
+               .nr_parts       = ARRAY_SIZE(trizeps4_partitions)
+       }
+};
+
+static struct resource flash_resource = {
+       .start  = PXA_CS0_PHYS,
+       .end    = PXA_CS0_PHYS + SZ_64M - 1,
+       .flags  = IORESOURCE_MEM,
+};
+
+static struct platform_device flash_device = {
+       .name           = "pxa2xx-flash",
+       .id             = 0,
+       .dev = {
+               .platform_data = &trizeps4_flash_data,
+       },
+       .resource = &flash_resource,
+       .num_resources = 1,
+};
+
+/********************************************************************************************
+ * DAVICOM DM9000 Ethernet
+ ********************************************************************************************/
+static struct resource dm9000_resources[] = {
+       [0] = {
+               .start  = TRIZEPS4_ETH_PHYS+0x300,
+               .end    = TRIZEPS4_ETH_PHYS+0x400-1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = TRIZEPS4_ETH_PHYS+0x8300,
+               .end    = TRIZEPS4_ETH_PHYS+0x8400-1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [2] = {
+               .start  = TRIZEPS4_ETH_IRQ,
+               .end    = TRIZEPS4_ETH_IRQ,
+               .flags  = (IORESOURCE_IRQ | IRQT_RISING),
+       },
+};
+
+static struct platform_device dm9000_device = {
+       .name           = "dm9000",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(dm9000_resources),
+       .resource       = dm9000_resources,
+};
+
+/********************************************************************************************
+ * PXA270 serial ports
+ ********************************************************************************************/
+static struct plat_serial8250_port tri_serial_ports[] = {
+#ifdef CONFIG_SERIAL_PXA
+       /* this uses the own PXA driver */
+       {
+               0,
+       },
+#else
+       /* this uses the generic 8520 driver */
+       [0] = {
+               .membase        = (void *)&FFUART,
+               .irq            = IRQ_FFUART,
+               .flags          = UPF_BOOT_AUTOCONF,
+               .iotype         = UPIO_MEM32,
+               .regshift       = 2,
+               .uartclk        = (921600*16),
+       },
+       [1] = {
+               .membase        = (void *)&BTUART,
+               .irq            = IRQ_BTUART,
+               .flags          = UPF_BOOT_AUTOCONF,
+               .iotype         = UPIO_MEM32,
+               .regshift       = 2,
+               .uartclk        = (921600*16),
+       },
+       {
+               0,
+       },
+#endif
+};
+
+static struct platform_device uart_devices = {
+       .name           = "serial8250",
+       .id             = 0,
+       .dev            = {
+               .platform_data  = tri_serial_ports,
+       },
+       .num_resources  = 0,
+       .resource       = NULL,
+};
+
+/********************************************************************************************
+ * PXA270 ac97 sound codec
+ ********************************************************************************************/
+static struct platform_device ac97_audio_device = {
+       .name           = "pxa2xx-ac97",
+       .id             = -1,
+};
+
+static struct platform_device * trizeps4_devices[] __initdata = {
+       &flash_device,
+       &uart_devices,
+       &dm9000_device,
+       &ac97_audio_device,
+};
+
+#ifdef CONFIG_MACH_TRIZEPS4_CONXS
+static short trizeps_conxs_bcr;
+
+/* PCCARD power switching supports only 3,3V */
+void board_pcmcia_power(int power)
+{
+       if (power) {
+               /* switch power on, put in reset and enable buffers */
+               trizeps_conxs_bcr |= power;
+               trizeps_conxs_bcr |= ConXS_BCR_CF_RESET;
+               trizeps_conxs_bcr &= ~(ConXS_BCR_CF_BUF_EN);
+               ConXS_BCR = trizeps_conxs_bcr;
+               /* wait a little */
+               udelay(2000);
+               /* take reset away */
+               trizeps_conxs_bcr &= ~(ConXS_BCR_CF_RESET);
+               ConXS_BCR = trizeps_conxs_bcr;
+               udelay(2000);
+       } else {
+               /* put in reset */
+               trizeps_conxs_bcr |= ConXS_BCR_CF_RESET;
+               ConXS_BCR = trizeps_conxs_bcr;
+               udelay(1000);
+               /* switch power off */
+               trizeps_conxs_bcr &= ~(0xf);
+               ConXS_BCR = trizeps_conxs_bcr;
+
+       }
+       pr_debug("%s: o%s 0x%x\n", __FUNCTION__, power ? "n": "ff", trizeps_conxs_bcr);
+}
+
+/* backlight power switching for LCD panel */
+static void board_backlight_power(int on)
+{
+       if (on) {
+               trizeps_conxs_bcr |= ConXS_BCR_L_DISP;
+       } else {
+               trizeps_conxs_bcr &= ~ConXS_BCR_L_DISP;
+       }
+       pr_debug("%s: o%s 0x%x\n", __FUNCTION__, on ? "n" : "ff", trizeps_conxs_bcr);
+       ConXS_BCR = trizeps_conxs_bcr;
+}
+
+/* Powersupply for MMC/SD cardslot */
+static void board_mci_power(struct device *dev, unsigned int vdd)
+{
+       struct pxamci_platform_data* p_d = dev->platform_data;
+
+       if (( 1 << vdd) & p_d->ocr_mask) {
+               pr_debug("%s: on\n", __FUNCTION__);
+               /* FIXME fill in values here */
+       } else {
+               pr_debug("%s: off\n", __FUNCTION__);
+               /* FIXME fill in values here */
+       }
+}
+
+static short trizeps_conxs_ircr;
+
+/* Switch modes and Power for IRDA receiver */
+static void board_irda_mode(struct device *dev, int mode)
+{
+       unsigned long flags;
+
+       local_irq_save(flags);
+       if (mode & IR_SIRMODE) {
+               /* Slow mode */
+               trizeps_conxs_ircr &= ~ConXS_IRCR_MODE;
+       } else if (mode & IR_FIRMODE) {
+               /* Fast mode */
+               trizeps_conxs_ircr |= ConXS_IRCR_MODE;
+       }
+       if (mode & IR_OFF) {
+               trizeps_conxs_ircr |= ConXS_IRCR_SD;
+       } else {
+               trizeps_conxs_ircr &= ~ConXS_IRCR_SD;
+       }
+       /* FIXME write values to register */
+       local_irq_restore(flags);
+}
+
+#else
+/* for other baseboards define dummies */
+void board_pcmcia_power(int power)     {;}
+#define board_backlight_power          NULL
+#define board_mci_power                        NULL
+#define board_irda_mode                        NULL
+
+#endif         /* CONFIG_MACH_TRIZEPS4_CONXS */
+EXPORT_SYMBOL(board_pcmcia_power);
+
+static int trizeps4_mci_init(struct device *dev, irqreturn_t (*mci_detect_int)(int, void *, struct pt_regs *), void *data)
+{
+       int err;
+       /* setup GPIO for PXA27x MMC controller */
+       pxa_gpio_mode(GPIO32_MMCCLK_MD);
+       pxa_gpio_mode(GPIO112_MMCCMD_MD);
+       pxa_gpio_mode(GPIO92_MMCDAT0_MD);
+       pxa_gpio_mode(GPIO109_MMCDAT1_MD);
+       pxa_gpio_mode(GPIO110_MMCDAT2_MD);
+       pxa_gpio_mode(GPIO111_MMCDAT3_MD);
+
+       pxa_gpio_mode(GPIO_MMC_DET | GPIO_IN);
+
+       err = request_irq(TRIZEPS4_MMC_IRQ, mci_detect_int,
+                         IRQF_DISABLED | IRQF_TRIGGER_RISING,
+                         "MMC card detect", data);
+       if (err) {
+               printk(KERN_ERR "trizeps4_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
+               return -1;
+       }
+       return 0;
+}
+
+static void trizeps4_mci_exit(struct device *dev, void *data)
+{
+       free_irq(TRIZEPS4_MMC_IRQ, data);
+}
+
+static struct pxamci_platform_data trizeps4_mci_platform_data = {
+       .ocr_mask       = MMC_VDD_32_33|MMC_VDD_33_34,
+       .init           = trizeps4_mci_init,
+       .exit           = trizeps4_mci_exit,
+       .setpower       = board_mci_power,
+};
+
+static struct pxaficp_platform_data trizeps4_ficp_platform_data = {
+       .transceiver_cap  = IR_SIRMODE | IR_FIRMODE | IR_OFF,
+       .transceiver_mode = board_irda_mode,
+};
+
+static int trizeps4_ohci_init(struct device *dev)
+{
+       /* setup Port1 GPIO pin. */
+       pxa_gpio_mode( 88 | GPIO_ALT_FN_1_IN);  /* USBHPWR1 */
+       pxa_gpio_mode( 89 | GPIO_ALT_FN_2_OUT); /* USBHPEN1 */
+
+       /* Set the Power Control Polarity Low and Power Sense
+          Polarity Low to active low. */
+       UHCHR = (UHCHR | UHCHR_PCPL | UHCHR_PSPL) &
+               ~(UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSEP3 | UHCHR_SSE);
+
+       return 0;
+}
+
+static void trizeps4_ohci_exit(struct device *dev)
+{
+       ;
+}
+
+static struct pxaohci_platform_data trizeps4_ohci_platform_data = {
+       .port_mode      = PMM_PERPORT_MODE,
+       .init           = trizeps4_ohci_init,
+       .exit           = trizeps4_ohci_exit,
+};
+
+static struct map_desc trizeps4_io_desc[] __initdata = {
+       {       /* ConXS CFSR */
+               .virtual        = TRIZEPS4_CFSR_VIRT,
+               .pfn            = __phys_to_pfn(TRIZEPS4_CFSR_PHYS),
+               .length         = 0x00001000,
+               .type           = MT_DEVICE
+       },
+       {       /* ConXS BCR */
+               .virtual        = TRIZEPS4_BOCR_VIRT,
+               .pfn            = __phys_to_pfn(TRIZEPS4_BOCR_PHYS),
+               .length         = 0x00001000,
+               .type           = MT_DEVICE
+       },
+       {       /* ConXS IRCR */
+               .virtual        = TRIZEPS4_IRCR_VIRT,
+               .pfn            = __phys_to_pfn(TRIZEPS4_IRCR_PHYS),
+               .length         = 0x00001000,
+               .type           = MT_DEVICE
+       },
+       {       /* ConXS DCR */
+               .virtual        = TRIZEPS4_DICR_VIRT,
+               .pfn            = __phys_to_pfn(TRIZEPS4_DICR_PHYS),
+               .length         = 0x00001000,
+               .type           = MT_DEVICE
+       },
+       {       /* ConXS UPSR */
+               .virtual        = TRIZEPS4_UPSR_VIRT,
+               .pfn            = __phys_to_pfn(TRIZEPS4_UPSR_PHYS),
+               .length         = 0x00001000,
+               .type           = MT_DEVICE
+       }
+};
+
+static struct pxafb_mach_info sharp_lcd __initdata = {
+    .pixclock          = 78000,
+    .xres              = 640,
+    .yres              = 480,
+    .bpp               = 8,
+    .hsync_len         = 4,
+    .left_margin       = 4,
+    .right_margin      = 4,
+    .vsync_len         = 2,
+    .upper_margin      = 0,
+    .lower_margin      = 0,
+    .sync              = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+    .cmap_greyscale    = 0,
+    .cmap_inverse      = 0,
+    .cmap_static       = 0,
+    .lccr0             = LCCR0_Color | LCCR0_Pas | LCCR0_Dual,
+    .lccr3             = 0x0340ff02,
+    .pxafb_backlight_power = board_backlight_power,
+};
+
+static void __init trizeps4_fixup(struct machine_desc *desc, struct tag *tags, char **cmdline, struct meminfo *mi)
+{
+}
+
+static void __init trizeps4_init(void)
+{
+       platform_add_devices(trizeps4_devices, ARRAY_SIZE(trizeps4_devices));
+
+       set_pxa_fb_info(&sharp_lcd);
+
+       pxa_set_mci_info(&trizeps4_mci_platform_data);
+       pxa_set_ficp_info(&trizeps4_ficp_platform_data);
+       pxa_set_ohci_info(&trizeps4_ohci_platform_data);
+}
+
+static void __init trizeps4_map_io(void)
+{
+       pxa_map_io();
+       iotable_init(trizeps4_io_desc, ARRAY_SIZE(trizeps4_io_desc));
+
+       /* for DiskOnChip */
+       pxa_gpio_mode(GPIO15_nCS_1_MD);
+
+       /* for off-module PIC on ConXS board */
+       pxa_gpio_mode(GPIO_PIC | GPIO_IN);
+
+       /* UCB1400 irq */
+       pxa_gpio_mode(GPIO_UCB1400 | GPIO_IN);
+
+       /* for DM9000 LAN */
+       pxa_gpio_mode(GPIO78_nCS_2_MD);
+       pxa_gpio_mode(GPIO_DM9000 | GPIO_IN);
+
+       /* for PCMCIA device */
+       pxa_gpio_mode(GPIO_PCD | GPIO_IN);
+       pxa_gpio_mode(GPIO_PRDY | GPIO_IN);
+
+       /* for I2C adapter */
+       pxa_gpio_mode(GPIO117_I2CSCL_MD);
+       pxa_gpio_mode(GPIO118_I2CSDA_MD);
+
+       /* MMC_DET s.o. */
+       pxa_gpio_mode(GPIO_MMC_DET | GPIO_IN);
+
+       /* whats that for ??? */
+       pxa_gpio_mode(GPIO79_nCS_3_MD);
+
+       pxa_gpio_mode( GPIO_SYS_BUSY_LED  | GPIO_OUT);          /* LED1 */
+       pxa_gpio_mode( GPIO_HEARTBEAT_LED | GPIO_OUT);          /* LED2 */
+
+#ifdef CONFIG_MACH_TRIZEPS4_CONXS
+#ifdef CONFIG_IDE_PXA_CF
+       /* if boot direct from compact flash dont disable power */
+       trizeps_conxs_bcr = 0x0009;
+#else
+       /* this is the reset value */
+       trizeps_conxs_bcr = 0x00A0;
+#endif
+       ConXS_BCR = trizeps_conxs_bcr;
+#endif
+
+       PWER  = 0x00000002;
+       PFER  = 0x00000000;
+       PRER  = 0x00000002;
+       PGSR0 = 0x0158C000;
+       PGSR1 = 0x00FF0080;
+       PGSR2 = 0x0001C004;
+       /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */
+       PCFR |= PCFR_OPDE;
+}
+
+MACHINE_START(TRIZEPS4, "Keith und Koep Trizeps IV module")
+       /* MAINTAINER("Jürgen Schindele") */
+       .phys_io        = 0x40000000,
+       .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
+       .boot_params    = TRIZEPS4_SDRAM_BASE + 0x100,
+       .fixup          = trizeps4_fixup,
+       .init_machine   = trizeps4_init,
+       .map_io         = trizeps4_map_io,
+       .init_irq       = pxa_init_irq,
+       .timer          = &pxa_timer,
+MACHINE_END
+
index d13270c5d7cdef5d41ee39287eadda3c7f1def36..da0286973823a0be4f7431a38adfdd4294ed186f 100644 (file)
@@ -18,7 +18,6 @@
  * 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/config.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
@@ -537,7 +536,7 @@ static irqreturn_t realview_timer_interrupt(int irq, void *dev_id, struct pt_reg
 
 static struct irqaction realview_timer_irq = {
        .name           = "RealView Timer Tick",
-       .flags          = SA_INTERRUPT | SA_TIMER,
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
        .handler        = realview_timer_interrupt,
 };
 
index 693fb1e396e033e95ecd6afdce8552dec4ef4591..84a959530fb6a280af8e0a9409d9f1848af13b52 100644 (file)
@@ -19,7 +19,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/sysdev.h>
index bd86ffba8810e9b3b1716df97d60cacb1dfd2857..ac511d41d4d75d5a0f078a4c53caac9654e20185 100644 (file)
@@ -128,7 +128,7 @@ static irqreturn_t iomd_dma_handle(int irq, void *dev_id, struct pt_regs *regs)
 static int iomd_request_dma(dmach_t channel, dma_t *dma)
 {
        return request_irq(dma->dma_irq, iomd_dma_handle,
-                          SA_INTERRUPT, dma->device_id, dma);
+                          IRQF_DISABLED, dma->device_id, dma);
 }
 
 static void iomd_free_dma(dmach_t channel, dma_t *dma)
index fbbeb05530061eaf24089f3e62acea6d078edad7..def4441d24420e260278672a6fac06160ec46c53 100644 (file)
@@ -136,8 +136,8 @@ bast_irq_pc104_demux(unsigned int irq,
                for (i = 0; stat != 0; i++, stat >>= 1) {
                        if (stat & 1) {
                                irqno = bast_pc104_irqs[i];
-
-                               desc_handle_irq(irqno, irq_desc + irqno, regs);
+                               desc = irq_desc + irqno;
+                               desc_handle_irq(irqno, desc, regs);
                        }
                }
        }
@@ -156,7 +156,7 @@ static __init int bast_irq_init(void)
 
                set_irq_chained_handler(IRQ_ISA, bast_irq_pc104_demux);
 
-               /* reigster our IRQs */
+               /* register our IRQs */
 
                for (i = 0; i < 4; i++) {
                        unsigned int irqno = bast_pc104_irqs[i];
index fa124ed920e0dca9474941a422a3f16066fb97e0..726e2eaf8797c58cd4c6016c34f2ba84d316256e 100644 (file)
@@ -14,7 +14,6 @@
  *     27-Aug-2004 BJD  Added timers 0 through 3
  *     10-Feb-2005 BJD  Added camera from guillaume.gourat@nexvision.tv
 */
-#include <linux/config.h>
 #include <linux/platform_device.h>
 
 struct s3c24xx_uart_resources {
index 4dbd8e758ea6f9691f73e5c06439fa4d2efec2fc..094cc52745c52e0adaa85a5d87bc947486f480c5 100644 (file)
@@ -31,7 +31,6 @@
  * possible DMA function
  */
 
-#include <linux/config.h>
 
 #ifdef CONFIG_S3C2410_DMA_DEBUG
 #define DEBUG
@@ -719,7 +718,7 @@ int s3c2410_dma_request(unsigned int channel, s3c2410_dma_client_t *client,
                pr_debug("dma%d: %s : requesting irq %d\n",
                         channel, __FUNCTION__, chan->irq);
 
-               err = request_irq(chan->irq, s3c2410_dma_irq, SA_INTERRUPT,
+               err = request_irq(chan->irq, s3c2410_dma_irq, IRQF_DISABLED,
                                  client->name, (void *)chan);
 
                if (err) {
index 43e9a550a203d762e4f2f0dbcf013ad5b9d70787..a589fe76d9158d1eedac0ff04ae657ed38f22e53 100644 (file)
@@ -29,7 +29,6 @@
  *     10-Mar-2005 LCVR  Changed S3C2410_VA_UART to S3C24XX_VA_UART
 */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/suspend.h>
 #include <linux/errno.h>
index dc27167f4d595eb53d271afec92c4fc5a56c0303..a7561a79fc825dac89b97188554d5ff326411791 100644 (file)
@@ -24,7 +24,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/assembler.h>
 #include <asm/hardware.h>
index 9d7b799ea4a4c8b2df094c39487f688679a6e865..00d1cfca971287f175bc27ed60ff76a121fe6153 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/err.h>
 #include <linux/clk.h>
 
@@ -138,7 +138,7 @@ s3c2410_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 static struct irqaction s3c2410_timer_irq = {
        .name           = "S3C2410 Timer Tick",
-       .flags          = SA_INTERRUPT | SA_TIMER,
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
        .handler        = s3c2410_timer_interrupt,
 };
 
index 495f8c6ffcb6e6d39c51bbb67d95e63688c86c5c..6b22d8f0a00df5de142bed58ee9adbce2f0a2612 100644 (file)
@@ -85,8 +85,8 @@ static void usb_simtec_enableoc(struct s3c2410_hcd_info *info, int on)
 
        if (on) {
                ret = request_irq(IRQ_USBOC, usb_simtec_ocirq,
-                                 SA_INTERRUPT | SA_TRIGGER_RISING |
-                                  SA_TRIGGER_FALLING,
+                                 IRQF_DISABLED | IRQF_TRIGGER_RISING |
+                                  IRQF_TRIGGER_FALLING,
                                  "USB Over-current", info);
                if (ret != 0) {
                        printk(KERN_ERR "failed to request usb oc irq\n");
index c58f12ba7a939d9a618f5bce32d800dc1cc9cac0..be06d668a3c93ab25d0407df68eb849467e6b3dd 100644 (file)
@@ -9,7 +9,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
index 8269a9ef9afe4adda328d83fbe38ebb2ea55f9ab..31afe50d7cd59746360d0dbbb642c7f87197bdcb 100644 (file)
  * Jan-2004 : Removed io map for flash [FB]
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/tty.h>
 #include <linux/platform_device.h>
+#include <linux/irq.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 
index 676b5c5b75bb2b537a4a689565902aa29e898a67..a6bab50dab6118714ad6922aceb0877a4f6a8cfa 100644 (file)
@@ -17,7 +17,6 @@
  *  04-16-2001 Lineo Japan,Inc. ...
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/tty.h>
index 696d7d29c8a5bf7496bc35f9703cb25d0bd17501..45b1e71f111d462472573f1c2057242aa564a56b 100644 (file)
@@ -45,12 +45,12 @@ static void collie_charger_init(void)
        }
 
        /* Register interrupt handler. */
-       if ((err = request_irq(COLLIE_IRQ_GPIO_AC_IN, sharpsl_ac_isr, SA_INTERRUPT,
+       if ((err = request_irq(COLLIE_IRQ_GPIO_AC_IN, sharpsl_ac_isr, IRQF_DISABLED,
                               "ACIN", sharpsl_ac_isr))) {
                printk("Could not get irq %d.\n", COLLIE_IRQ_GPIO_AC_IN);
                return;
        }
-       if ((err = request_irq(COLLIE_IRQ_GPIO_CO, sharpsl_chrg_full_isr, SA_INTERRUPT,
+       if ((err = request_irq(COLLIE_IRQ_GPIO_CO, sharpsl_chrg_full_isr, IRQF_DISABLED,
                               "CO", sharpsl_chrg_full_isr))) {
                free_irq(COLLIE_IRQ_GPIO_AC_IN, sharpsl_ac_isr);
                printk("Could not get irq %d.\n", COLLIE_IRQ_GPIO_CO);
index 04c94ab6c18b19f7eac1ffc47a5e11bfe11bed38..639597729932e5ce821569f03fcd19184b4515fc 100644 (file)
  *      SDRAM reads (rev A0, B0, B1)
  *
  * We ignore rev. A0 and B0 devices; I don't think they're worth supporting.
+ *
+ * The SDRAM type can be passed on the command line as cpu_sa1110.sdram=type
  */
+#include <linux/moduleparam.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -35,6 +38,7 @@
 static struct cpufreq_driver sa1110_driver;
 
 struct sdram_params {
+       const char name[16];
        u_char  rows;           /* bits                          */
        u_char  cas_latency;    /* cycles                        */
        u_char  tck;            /* clock cycle time (ns)         */
@@ -50,54 +54,53 @@ struct sdram_info {
        u_int   mdcas[3];
 };
 
-static struct sdram_params tc59sm716_cl2_params __initdata = {
-       .rows                   = 12,
-       .tck                    = 10,
-       .trcd                   = 20,
-       .trp                    = 20,
-       .twr                    = 10,
-       .refresh                = 64000,
-       .cas_latency            = 2,
-};
-
-static struct sdram_params tc59sm716_cl3_params __initdata = {
-       .rows                   = 12,
-       .tck                    = 8,
-       .trcd                   = 20,
-       .trp                    = 20,
-       .twr                    = 8,
-       .refresh                = 64000,
-       .cas_latency            = 3,
-};
-
-static struct sdram_params samsung_k4s641632d_tc75 __initdata = {
-       .rows                   = 14,
-       .tck                    = 9,
-       .trcd                   = 27,
-       .trp                    = 20,
-       .twr                    = 9,
-       .refresh                = 64000,
-       .cas_latency            = 3,
-};
-
-static struct sdram_params samsung_km416s4030ct __initdata = {
-       .rows                   = 13,
-       .tck                    = 8,
-       .trcd                   = 24,   /* 3 CLKs */
-       .trp                    = 24,   /* 3 CLKs */
-       .twr                    = 16,   /* Trdl: 2 CLKs */
-       .refresh                = 64000,
-       .cas_latency            = 3,
-};
-
-static struct sdram_params wbond_w982516ah75l_cl3_params __initdata = {
-       .rows                   = 16,
-       .tck                    = 8,
-       .trcd                   = 20,
-       .trp                    = 20,
-       .twr                    = 8,
-       .refresh                = 64000,
-       .cas_latency            = 3,
+static struct sdram_params sdram_tbl[] __initdata = {
+       {       /* Toshiba TC59SM716 CL2 */
+               .name           = "TC59SM716-CL2",
+               .rows           = 12,
+               .tck            = 10,
+               .trcd           = 20,
+               .trp            = 20,
+               .twr            = 10,
+               .refresh        = 64000,
+               .cas_latency    = 2,
+       }, {    /* Toshiba TC59SM716 CL3 */
+               .name           = "TC59SM716-CL3",
+               .rows           = 12,
+               .tck            = 8,
+               .trcd           = 20,
+               .trp            = 20,
+               .twr            = 8,
+               .refresh        = 64000,
+               .cas_latency    = 3,
+       }, {    /* Samsung K4S641632D TC75 */
+               .name           = "K4S641632D",
+               .rows           = 14,
+               .tck            = 9,
+               .trcd           = 27,
+               .trp            = 20,
+               .twr            = 9,
+               .refresh        = 64000,
+               .cas_latency    = 3,
+       }, {    /* Samsung KM416S4030CT */
+               .name           = "KM416S4030CT",
+               .rows           = 13,
+               .tck            = 8,
+               .trcd           = 24,   /* 3 CLKs */
+               .trp            = 24,   /* 3 CLKs */
+               .twr            = 16,   /* Trdl: 2 CLKs */
+               .refresh        = 64000,
+               .cas_latency    = 3,
+       }, {    /* Winbond W982516AH75L CL3 */
+               .name           = "W982516AH75L",
+               .rows           = 16,
+               .tck            = 8,
+               .trcd           = 20,
+               .trp            = 20,
+               .twr            = 8,
+               .refresh        = 64000,
+               .cas_latency    = 3,
+       },
 };
 
 static struct sdram_params sdram_params;
@@ -336,19 +339,36 @@ static struct cpufreq_driver sa1110_driver = {
        .name           = "sa1110",
 };
 
+static struct sdram_params *sa1110_find_sdram(const char *name)
+{
+       struct sdram_params *sdram;
+
+       for (sdram = sdram_tbl; sdram < sdram_tbl + ARRAY_SIZE(sdram_tbl); sdram++)
+               if (strcmp(name, sdram->name) == 0)
+                       return sdram;
+
+       return NULL;
+}
+
+static char sdram_name[16];
+
 static int __init sa1110_clk_init(void)
 {
-       struct sdram_params *sdram = NULL;
+       struct sdram_params *sdram;
+       const char *name = sdram_name;
 
-       if (machine_is_assabet())
-               sdram = &tc59sm716_cl3_params;
+       if (!name[0]) {
+               if (machine_is_assabet())
+                       name = "TC59SM716-CL3";
 
-       if (machine_is_pt_system3())
-               sdram = &samsung_k4s641632d_tc75;
+               if (machine_is_pt_system3())
+                       name = "K4S641632D";
 
-       if (machine_is_h3100())
-               sdram = &samsung_km416s4030ct;
+               if (machine_is_h3100())
+                       name = "KM416S4030CT";
+       }
 
+       sdram = sa1110_find_sdram(name);
        if (sdram) {
                printk(KERN_DEBUG "SDRAM: tck: %d trcd: %d trp: %d"
                        " twr: %d refresh: %d cas_latency: %d\n",
@@ -363,4 +383,5 @@ static int __init sa1110_clk_init(void)
        return 0;
 }
 
+module_param_string(sdram, sdram_name, sizeof(sdram_name), 0);
 arch_initcall(sa1110_clk_init);
index be0e4427bec7ee896e6d669bacc3dd249fa6401d..3c6441d4bc598421323556c804aee770f6cb6d60 100644 (file)
@@ -124,7 +124,7 @@ int sa1100_request_dma (dma_device_t device, const char *device_id,
 
        i = dma - dma_chan;
        regs = (dma_regs_t *)&DDAR(i);
-       err = request_irq(IRQ_DMA0 + i, dma_irq_handler, SA_INTERRUPT,
+       err = request_irq(IRQ_DMA0 + i, dma_irq_handler, IRQF_DISABLED,
                          device_id, regs);
        if (err) {
                printk(KERN_ERR
index 9ea71551fc04b58bdd95226656f40242c3601116..4575f316e141a80179d341eee2a19eb27118c22f 100644 (file)
@@ -9,7 +9,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index b04d92271020ef1fd980bbf3b81a15d91ca65b5b..7364478cec12167425d5b9a1953b7b44232446bc 100644 (file)
@@ -19,7 +19,6 @@
  *                                and abstracted EGPIO interface.
  *
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
@@ -741,7 +740,7 @@ static void h3800_IRQ_demux(unsigned int irq, struct irqdesc *desc, struct pt_re
 static struct irqaction h3800_irq = {
        .name           = "h3800_asic",
        .handler        = h3800_IRQ_demux,
-       .flags          = SA_INTERRUPT | SA_TIMER,
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
 };
 
 u32 kpio_int_shadow = 0;
@@ -836,7 +835,7 @@ static void __init h3800_init_irq(void)
        }
 #endif
        set_irq_type(IRQ_GPIO_H3800_ASIC, IRQT_RISING);
-       set_irq_chained_handler(IRQ_GPIO_H3800_ASIC, &h3800_IRQ_demux);
+       set_irq_chained_handler(IRQ_GPIO_H3800_ASIC, h3800_IRQ_demux);
 }
 
 
index b3a56024182ee6ac15cc3e679e815661ee7095f4..2891b8ca86dd40d58b570c3c6a91272859ece838 100644 (file)
  */
 #include <linux/init.h>
 #include <linux/module.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/ioport.h>
 #include <linux/ptrace.h>
 #include <linux/sysdev.h>
 
 #include <asm/hardware.h>
-#include <asm/irq.h>
 #include <asm/mach/irq.h>
 
 #include "generic.h"
index e9aa9dff211a5f273a4b1d067d837cd63e68c39f..ee9788989875be2ecdbab9a4cccd71f318ddbae4 100644 (file)
@@ -9,7 +9,6 @@
  *   - Green - toggles state every 50 timer interrupts
  *   - Red   - on if system is not idle
  */
-#include <linux/config.h>
 #include <linux/init.h>
 
 #include <asm/hardware.h>
index 0a8f87bb6c4f8201bf2974ef9bb9e11cf14314e3..280929be972d55ef63c8604a15191ed02a622b6d 100644 (file)
@@ -10,7 +10,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 
 #include <asm/hardware.h>
index f6635a2d0e8303de319e169e6bbf5b88ccb7362a..f38eeddbef10634a4b9ab5fcfd82f46e894a875e 100644 (file)
@@ -3,7 +3,6 @@
  *
  * Author: ???
  */
-#include <linux/config.h>
 #include <linux/init.h>
 
 #include <asm/hardware.h>
index 2e5fa14aa4ebb67bc9e9696145a8e08398c9a650..7e91cc90b5ae443b2bd72081967fb514c6441a05 100644 (file)
@@ -9,7 +9,6 @@
  * The HackKit has two leds (GPIO 22/23). The red led (gpio 22) is used
  * as cpu led, the green one is used as timer led.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 
 #include <asm/hardware.h>
index 18750149071306a08bf6d62194764f85332228a6..2d27d76cfc6b7694a9e859bf0a043f38817a56ce 100644 (file)
@@ -9,7 +9,6 @@
  *  time, but in that case the timer events will still dictate the
  *  pace of the LED.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 
 #include <asm/hardware.h>
index 6a27a2d32206101dd549684ccbc744de258c4fae..def090a87385c7915ea5ecd83658d5fd70d53f00 100644 (file)
@@ -3,7 +3,6 @@
  *
  * Author: Juergen Messerer <juergen.messerer@siemens.ch>
  */
-#include <linux/config.h>
 #include <linux/init.h>
 
 #include <asm/hardware.h>
index 0709ebab531c2cc976b05bb244090e96e5a2092f..c7bf7e0038f07922bb294860ed75c284fbb1a811 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/tty.h>
 #include <linux/ioport.h>
 #include <linux/platform_device.h>
+#include <linux/irq.h>
 
 #include <linux/mtd/partitions.h>
 
index 5aafe0b5699270ad7166ab127239357f0a067f64..8acab7b1e4c268ea30143d7f41c56e3b709fe6fa 100644 (file)
@@ -2,7 +2,6 @@
  * linux/arch/arm/mach-sa1100/shannon.c
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/kernel.h>
index d2c23b2c34d12f3270982c0fc6bee645a1c32f0b..a9ae1b581aa673903c6f71d894327a37608544a6 100644 (file)
@@ -2,7 +2,6 @@
  * linux/arch/arm/mach-sa1100/simpad.c
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
index e4b435e634e41a657321360a5c6d22173ad98fc6..49ae716e16c2ad1a12fd7e0336e5f2826519442f 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/init.h>
 #include <linux/errno.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/timex.h>
 #include <linux/signal.h>
 
@@ -110,7 +111,7 @@ sa1100_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 static struct irqaction sa1100_timer_irq = {
        .name           = "SA11xx Timer Tick",
-       .flags          = SA_INTERRUPT | SA_TIMER,
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
        .handler        = sa1100_timer_interrupt,
 };
 
index 877600e212dd6cb36c47513fc9be4a3c381bfeb7..1095df34fec072cfd76ab5ba77841e71f96174c3 100644 (file)
@@ -6,6 +6,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/sched.h>
 #include <linux/serial_8250.h>
 
@@ -89,7 +90,7 @@ shark_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 static struct irqaction shark_timer_irq = {
        .name           = "Shark Timer Tick",
-       .flags          = SA_INTERRUPT | SA_TIMER,
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
        .handler        = shark_timer_interrupt,
 };
 
index 835989a0291843ee4ace248b1de46ccc2f1b2785..6774b8d5d13d696cbda2548198cd1834106c9dcd 100644 (file)
@@ -8,7 +8,6 @@
  *  Copyright (C) 1998 Phil Blundell
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 
 #include <asm/dma.h>
index 7bdeb70a0c10dbfb437423eac1ff31d0653891c9..7cd86d357a3c1901a9e3df08a90e62771164d3db 100644 (file)
@@ -15,7 +15,6 @@
  *
  * Changelog:
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
index cebd48a3dae4b757f7a44c95030e6dafe2945a95..a432539cc1bd2dd9506181355b09135382df928f 100644 (file)
@@ -18,7 +18,6 @@
  * 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/config.h>
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/dma-mapping.h>
@@ -870,7 +869,7 @@ static irqreturn_t versatile_timer_interrupt(int irq, void *dev_id, struct pt_re
 
 static struct irqaction versatile_timer_irq = {
        .name           = "Versatile Timer Tick",
-       .flags          = SA_INTERRUPT | SA_TIMER,
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
        .handler        = versatile_timer_interrupt,
 };
 
index 722fbabc9cfb21b1a9bcf563412bd9bdf8a47009..41b370090b60e2903ea8a3d1919fd19991332197 100644 (file)
@@ -14,7 +14,6 @@
  * 14/04/2005 Initial version, colin.king@philips.com
  *
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/ptrace.h>
index 1eb59678207810a539ee1bdcd01eb706c46ca4a5..b257ef78ef457c7249339723e3c9219cf0b5f7d3 100644 (file)
@@ -19,7 +19,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/sysdev.h>
index f17ab4fb548aa5e26f100242828c997dc7b324bc..503725b166fc9c473649f737c65a42072f9fc0e7 100644 (file)
@@ -19,7 +19,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/sysdev.h>
index c4bca753165bd2eec732ebe9515cbdc3fba1715a..5f80f184cd325b08bb0328748f5f7955cb58a1c6 100644 (file)
@@ -121,8 +121,8 @@ config CPU_ARM925T
 # ARM926T
 config CPU_ARM926T
        bool "Support ARM926T processor"
-       depends on ARCH_INTEGRATOR || ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX || MACH_REALVIEW_EB || ARCH_PNX4008 || ARCH_NETX || CPU_S3C2412
-       default y if ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX || ARCH_PNX4008 || ARCH_NETX || CPU_S3C2412
+       depends on ARCH_INTEGRATOR || ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX || MACH_REALVIEW_EB || ARCH_PNX4008 || ARCH_NETX || CPU_S3C2412 || ARCH_AT91SAM9260 || ARCH_AT91SAM9261
+       default y if ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX || ARCH_PNX4008 || ARCH_NETX || CPU_S3C2412 || ARCH_AT91SAM9260 || ARCH_AT91SAM9261
        select CPU_32v5
        select CPU_ABRT_EV5TJ
        select CPU_CACHE_VIVT
index 705c98921c372e034af6b21ecf569872393cbe43..e0d21bbbe7d788e55854dfd3b2c5eb62cc96050a 100644 (file)
@@ -11,7 +11,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <linux/config.h>
 #include <linux/compiler.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index 54e3c5bb5186a88203ed83441e58926347cb55a5..2ebc1b3bf856ff454f5a0c114ef0dea9e9fbcaed 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.
  */
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <linux/init.h>
 #include <asm/memory.h>
index 4a884baf3b9c731c0f31e428c1595321f08dee4e..c5e0622c77650480f4dc148254d77f3545606d5d 100644 (file)
@@ -8,7 +8,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/signal.h>
 #include <linux/ptrace.h>
index 989fd681c822de5be93e6d66fe1676423e87b6a6..fe3f7f6250085c5c279306ba979cde87407d19d8 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.
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/ptrace.h>
index 7691cfdba56778d7f97768b66c243e66eb735dc2..dba7dddfe57d365a53959c74b84a7e136781c775 100644 (file)
 
 #include <asm/cacheflush.h>
 #include <asm/io.h>
+#include <asm/mmu_context.h>
+#include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
+#include <asm/sizes.h>
+
+/*
+ * Used by ioremap() and iounmap() code to mark (super)section-mapped
+ * I/O regions in vm_struct->flags field.
+ */
+#define VM_ARM_SECTION_MAPPING 0x80000000
 
 static inline void
 remap_area_pte(pte_t * pte, unsigned long address, unsigned long size,
@@ -113,10 +122,168 @@ remap_area_pages(unsigned long start, unsigned long pfn,
                dir++;
        } while (address && (address < end));
 
-       flush_cache_vmap(start, end);
        return err;
 }
 
+
+void __check_kvm_seq(struct mm_struct *mm)
+{
+       unsigned int seq;
+
+       do {
+               seq = init_mm.context.kvm_seq;
+               memcpy(pgd_offset(mm, VMALLOC_START),
+                      pgd_offset_k(VMALLOC_START),
+                      sizeof(pgd_t) * (pgd_index(VMALLOC_END) -
+                                       pgd_index(VMALLOC_START)));
+               mm->context.kvm_seq = seq;
+       } while (seq != init_mm.context.kvm_seq);
+}
+
+#ifndef CONFIG_SMP
+/*
+ * Section support is unsafe on SMP - If you iounmap and ioremap a region,
+ * the other CPUs will not see this change until their next context switch.
+ * Meanwhile, (eg) if an interrupt comes in on one of those other CPUs
+ * which requires the new ioremap'd region to be referenced, the CPU will
+ * reference the _old_ region.
+ *
+ * Note that get_vm_area() allocates a guard 4K page, so we need to mask
+ * the size back to 1MB aligned or we will overflow in the loop below.
+ */
+static void unmap_area_sections(unsigned long virt, unsigned long size)
+{
+       unsigned long addr = virt, end = virt + (size & ~SZ_1M);
+       pgd_t *pgd;
+
+       flush_cache_vunmap(addr, end);
+       pgd = pgd_offset_k(addr);
+       do {
+               pmd_t pmd, *pmdp = pmd_offset(pgd, addr);
+
+               pmd = *pmdp;
+               if (!pmd_none(pmd)) {
+                       /*
+                        * Clear the PMD from the page table, and
+                        * increment the kvm sequence so others
+                        * notice this change.
+                        *
+                        * Note: this is still racy on SMP machines.
+                        */
+                       pmd_clear(pmdp);
+                       init_mm.context.kvm_seq++;
+
+                       /*
+                        * Free the page table, if there was one.
+                        */
+                       if ((pmd_val(pmd) & PMD_TYPE_MASK) == PMD_TYPE_TABLE)
+                               pte_free_kernel(pmd_page_kernel(pmd));
+               }
+
+               addr += PGDIR_SIZE;
+               pgd++;
+       } while (addr < end);
+
+       /*
+        * Ensure that the active_mm is up to date - we want to
+        * catch any use-after-iounmap cases.
+        */
+       if (current->active_mm->context.kvm_seq != init_mm.context.kvm_seq)
+               __check_kvm_seq(current->active_mm);
+
+       flush_tlb_kernel_range(virt, end);
+}
+
+static int
+remap_area_sections(unsigned long virt, unsigned long pfn,
+                   unsigned long size, unsigned long flags)
+{
+       unsigned long prot, addr = virt, end = virt + size;
+       pgd_t *pgd;
+
+       /*
+        * Remove and free any PTE-based mapping, and
+        * sync the current kernel mapping.
+        */
+       unmap_area_sections(virt, size);
+
+       prot = PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_DOMAIN(DOMAIN_IO) |
+              (flags & (L_PTE_CACHEABLE | L_PTE_BUFFERABLE));
+
+       /*
+        * ARMv6 and above need XN set to prevent speculative prefetches
+        * hitting IO.
+        */
+       if (cpu_architecture() >= CPU_ARCH_ARMv6)
+               prot |= PMD_SECT_XN;
+
+       pgd = pgd_offset_k(addr);
+       do {
+               pmd_t *pmd = pmd_offset(pgd, addr);
+
+               pmd[0] = __pmd(__pfn_to_phys(pfn) | prot);
+               pfn += SZ_1M >> PAGE_SHIFT;
+               pmd[1] = __pmd(__pfn_to_phys(pfn) | prot);
+               pfn += SZ_1M >> PAGE_SHIFT;
+               flush_pmd_entry(pmd);
+
+               addr += PGDIR_SIZE;
+               pgd++;
+       } while (addr < end);
+
+       return 0;
+}
+
+static int
+remap_area_supersections(unsigned long virt, unsigned long pfn,
+                        unsigned long size, unsigned long flags)
+{
+       unsigned long prot, addr = virt, end = virt + size;
+       pgd_t *pgd;
+
+       /*
+        * Remove and free any PTE-based mapping, and
+        * sync the current kernel mapping.
+        */
+       unmap_area_sections(virt, size);
+
+       prot = PMD_TYPE_SECT | PMD_SECT_SUPER | PMD_SECT_AP_WRITE |
+                       PMD_DOMAIN(DOMAIN_IO) |
+                       (flags & (L_PTE_CACHEABLE | L_PTE_BUFFERABLE));
+
+       /*
+        * ARMv6 and above need XN set to prevent speculative prefetches
+        * hitting IO.
+        */
+       if (cpu_architecture() >= CPU_ARCH_ARMv6)
+               prot |= PMD_SECT_XN;
+
+       pgd = pgd_offset_k(virt);
+       do {
+               unsigned long super_pmd_val, i;
+
+               super_pmd_val = __pfn_to_phys(pfn) | prot;
+               super_pmd_val |= ((pfn >> (32 - PAGE_SHIFT)) & 0xf) << 20;
+
+               for (i = 0; i < 8; i++) {
+                       pmd_t *pmd = pmd_offset(pgd, addr);
+
+                       pmd[0] = __pmd(super_pmd_val);
+                       pmd[1] = __pmd(super_pmd_val);
+                       flush_pmd_entry(pmd);
+
+                       addr += PGDIR_SIZE;
+                       pgd++;
+               }
+
+               pfn += SUPERSECTION_SIZE >> PAGE_SHIFT;
+       } while (addr < end);
+
+       return 0;
+}
+#endif
+
+
 /*
  * Remap an arbitrary physical address space into the kernel virtual
  * address space. Needed when the kernel wants to access high addresses
@@ -133,18 +300,41 @@ void __iomem *
 __ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size,
              unsigned long flags)
 {
+       int err;
        unsigned long addr;
        struct vm_struct * area;
 
+       /*
+        * High mappings must be supersection aligned
+        */
+       if (pfn >= 0x100000 && (__pfn_to_phys(pfn) & ~SUPERSECTION_MASK))
+               return NULL;
+
        area = get_vm_area(size, VM_IOREMAP);
        if (!area)
                return NULL;
        addr = (unsigned long)area->addr;
-       if (remap_area_pages(addr, pfn, size, flags)) {
+
+#ifndef CONFIG_SMP
+       if ((((cpu_architecture() >= CPU_ARCH_ARMv6) && (get_cr() & CR_XP)) ||
+              cpu_is_xsc3()) &&
+              !((__pfn_to_phys(pfn) | size | addr) & ~SUPERSECTION_MASK)) {
+               area->flags |= VM_ARM_SECTION_MAPPING;
+               err = remap_area_supersections(addr, pfn, size, flags);
+       } else if (!((__pfn_to_phys(pfn) | size | addr) & ~PMD_MASK)) {
+               area->flags |= VM_ARM_SECTION_MAPPING;
+               err = remap_area_sections(addr, pfn, size, flags);
+       } else
+#endif
+               err = remap_area_pages(addr, pfn, size, flags);
+
+       if (err) {
                vunmap((void *)addr);
                return NULL;
        }
-       return (void __iomem *) (offset + (char *)addr);
+
+       flush_cache_vmap(addr, addr + size);
+       return (void __iomem *) (offset + addr);
 }
 EXPORT_SYMBOL(__ioremap_pfn);
 
@@ -173,6 +363,36 @@ EXPORT_SYMBOL(__ioremap);
 
 void __iounmap(void __iomem *addr)
 {
-       vunmap((void *)(PAGE_MASK & (unsigned long)addr));
+       struct vm_struct **p, *tmp;
+       unsigned int section_mapping = 0;
+
+       addr = (void __iomem *)(PAGE_MASK & (unsigned long)addr);
+
+#ifndef CONFIG_SMP
+       /*
+        * If this is a section based mapping we need to handle it
+        * specially as the VM subysystem does not know how to handle
+        * such a beast. We need the lock here b/c we need to clear
+        * all the mappings before the area can be reclaimed
+        * by someone else.
+        */
+       write_lock(&vmlist_lock);
+       for (p = &vmlist ; (tmp = *p) ; p = &tmp->next) {
+               if((tmp->flags & VM_IOREMAP) && (tmp->addr == addr)) {
+                       if (tmp->flags & VM_ARM_SECTION_MAPPING) {
+                               *p = tmp->next;
+                               unmap_area_sections((unsigned long)tmp->addr,
+                                                   tmp->size);
+                               kfree(tmp);
+                               section_mapping = 1;
+                       }
+                       break;
+               }
+       }
+       write_unlock(&vmlist_lock);
+#endif
+
+       if (!section_mapping)
+               vunmap(addr);
 }
 EXPORT_SYMBOL(__iounmap);
index 95273de4f772515780e2eac97ed2ae892ac52a0d..38769f5862bc4f0d414287bfdec754fdd431d2c7 100644 (file)
@@ -9,7 +9,6 @@
  *
  *  Page table sludge for ARM v3 and v4 processor architectures.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/mm.h>
 #include <linux/init.h>
@@ -227,7 +226,7 @@ void free_pgd_slow(pgd_t *pgd)
 
        pte = pmd_page(*pmd);
        pmd_clear(pmd);
-       dec_page_state(nr_page_table_pages);
+       dec_zone_page_state(virt_to_page((unsigned long *)pgd), NR_PAGETABLE);
        pte_lock_deinit(pte);
        pte_free(pte);
        pmd_free(pmd);
@@ -303,16 +302,16 @@ static struct mem_types mem_types[] __initdata = {
                .prot_pte  = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
                                L_PTE_WRITE,
                .prot_l1   = PMD_TYPE_TABLE,
-               .prot_sect = PMD_TYPE_SECT | PMD_SECT_UNCACHED |
+               .prot_sect = PMD_TYPE_SECT | PMD_BIT4 | PMD_SECT_UNCACHED |
                                PMD_SECT_AP_WRITE,
                .domain    = DOMAIN_IO,
        },
        [MT_CACHECLEAN] = {
-               .prot_sect = PMD_TYPE_SECT,
+               .prot_sect = PMD_TYPE_SECT | PMD_BIT4,
                .domain    = DOMAIN_KERNEL,
        },
        [MT_MINICLEAN] = {
-               .prot_sect = PMD_TYPE_SECT | PMD_SECT_MINICACHE,
+               .prot_sect = PMD_TYPE_SECT | PMD_BIT4 | PMD_SECT_MINICACHE,
                .domain    = DOMAIN_KERNEL,
        },
        [MT_LOW_VECTORS] = {
@@ -328,25 +327,25 @@ static struct mem_types mem_types[] __initdata = {
                .domain    = DOMAIN_USER,
        },
        [MT_MEMORY] = {
-               .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE,
+               .prot_sect = PMD_TYPE_SECT | PMD_BIT4 | PMD_SECT_AP_WRITE,
                .domain    = DOMAIN_KERNEL,
        },
        [MT_ROM] = {
-               .prot_sect = PMD_TYPE_SECT,
+               .prot_sect = PMD_TYPE_SECT | PMD_BIT4,
                .domain    = DOMAIN_KERNEL,
        },
        [MT_IXP2000_DEVICE] = { /* IXP2400 requires XCB=101 for on-chip I/O */
                .prot_pte  = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
                                L_PTE_WRITE,
                .prot_l1   = PMD_TYPE_TABLE,
-               .prot_sect = PMD_TYPE_SECT | PMD_SECT_UNCACHED |
+               .prot_sect = PMD_TYPE_SECT | PMD_BIT4 | PMD_SECT_UNCACHED |
                                PMD_SECT_AP_WRITE | PMD_SECT_BUFFERABLE |
                                PMD_SECT_TEX(1),
                .domain    = DOMAIN_IO,
        },
        [MT_NONSHARED_DEVICE] = {
                .prot_l1   = PMD_TYPE_TABLE,
-               .prot_sect = PMD_TYPE_SECT | PMD_SECT_NONSHARED_DEV |
+               .prot_sect = PMD_TYPE_SECT | PMD_BIT4 | PMD_SECT_NONSHARED_DEV |
                                PMD_SECT_AP_WRITE,
                .domain    = DOMAIN_IO,
        }
@@ -376,14 +375,21 @@ void __init build_mem_type_table(void)
                ecc_mask = 0;
        }
 
-       if (cpu_arch <= CPU_ARCH_ARMv5TEJ && !cpu_is_xscale()) {
-               for (i = 0; i < ARRAY_SIZE(mem_types); i++) {
+       /*
+        * Xscale must not have PMD bit 4 set for section mappings.
+        */
+       if (cpu_is_xscale())
+               for (i = 0; i < ARRAY_SIZE(mem_types); i++)
+                       mem_types[i].prot_sect &= ~PMD_BIT4;
+
+       /*
+        * ARMv5 and lower, excluding Xscale, bit 4 must be set for
+        * page tables.
+        */
+       if (cpu_arch < CPU_ARCH_ARMv6 && !cpu_is_xscale())
+               for (i = 0; i < ARRAY_SIZE(mem_types); i++)
                        if (mem_types[i].prot_l1)
                                mem_types[i].prot_l1 |= PMD_BIT4;
-                       if (mem_types[i].prot_sect)
-                               mem_types[i].prot_sect |= PMD_BIT4;
-               }
-       }
 
        cp = &cache_policies[cachepolicy];
        kern_pgprot = user_pgprot = cp->pte;
@@ -407,8 +413,8 @@ void __init build_mem_type_table(void)
                 * bit 4 becomes XN which we must clear for the
                 * kernel memory mapping.
                 */
-               mem_types[MT_MEMORY].prot_sect &= ~PMD_BIT4;
-               mem_types[MT_ROM].prot_sect &= ~PMD_BIT4;
+               mem_types[MT_MEMORY].prot_sect &= ~PMD_SECT_XN;
+               mem_types[MT_ROM].prot_sect &= ~PMD_SECT_XN;
 
                /*
                 * Mark cache clean areas and XIP ROM read only
index 3de7f84b53c25e3cdd5f8d44da252336fb55645a..29e54807c5bc6a1a0e010495aad34b9fd60346f2 100644 (file)
@@ -1,7 +1,6 @@
 /*
  *  linux/arch/arm/mm/mmap.c
  */
-#include <linux/config.h>
 #include <linux/fs.h>
 #include <linux/mm.h>
 #include <linux/mman.h>
index b9abbafca81225c5c6295438d49147c89b5f7860..1d8316f3cecfbe124fa6fe1ed6cdc4fa78b3206e 100644 (file)
@@ -26,7 +26,6 @@
  *  CONFIG_CPU_ARM1020_CPU_IDLE -> nohlt
  */
 #include <linux/linkage.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <asm/assembler.h>
 #include <asm/asm-offsets.h>
@@ -35,6 +34,8 @@
 #include <asm/procinfo.h>
 #include <asm/ptrace.h>
 
+#include "proc-macros.S"
+
 /*
  * This is the maximum size of an area which will be invalidated
  * using the single invalidate entry instructions.  Anything larger
@@ -440,11 +441,12 @@ __arm1020_setup:
 #ifdef CONFIG_MMU
        mcr     p15, 0, r0, c8, c7              @ invalidate I,D TLBs on v4
 #endif
+
+       adr     r5, arm1020_crval
+       ldmia   r5, {r5, r6}
        mrc     p15, 0, r0, c1, c0              @ get control register v4
-       ldr     r5, arm1020_cr1_clear
        bic     r0, r0, r5
-       ldr     r5, arm1020_cr1_set
-       orr     r0, r0, r5
+       orr     r0, r0, r6
 #ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
        orr     r0, r0, #0x4000                 @ .R.. .... .... ....
 #endif
@@ -456,12 +458,9 @@ __arm1020_setup:
         * .RVI ZFRS BLDP WCAM
         * .011 1001 ..11 0101
         */
-       .type   arm1020_cr1_clear, #object
-       .type   arm1020_cr1_set, #object
-arm1020_cr1_clear:
-       .word   0x593f
-arm1020_cr1_set:
-       .word   0x3935
+       .type   arm1020_crval, #object
+arm1020_crval:
+       crval   clear=0x0000593f, mmuset=0x00003935, ucset=0x00001930
 
        __INITDATA
 
@@ -524,6 +523,9 @@ cpu_arm1020_name:
 __arm1020_proc_info:
        .long   0x4104a200                      @ ARM 1020T (Architecture v5T)
        .long   0xff0ffff0
+       .long   PMD_TYPE_SECT | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
        .long   PMD_TYPE_SECT | \
                PMD_SECT_AP_WRITE | \
                PMD_SECT_AP_READ
index bcd5ee022e00ae36bde2c50362fdd81114ee3107..89b1d6d3d7c0fc572be129aa38361da0b2736669 100644 (file)
@@ -26,7 +26,6 @@
  *  CONFIG_CPU_ARM1020_CPU_IDLE -> nohlt
  */
 #include <linux/linkage.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <asm/assembler.h>
 #include <asm/asm-offsets.h>
@@ -35,6 +34,8 @@
 #include <asm/procinfo.h>
 #include <asm/ptrace.h>
 
+#include "proc-macros.S"
+
 /*
  * This is the maximum size of an area which will be invalidated
  * using the single invalidate entry instructions.  Anything larger
@@ -422,11 +423,11 @@ __arm1020e_setup:
 #ifdef CONFIG_MMU
        mcr     p15, 0, r0, c8, c7              @ invalidate I,D TLBs on v4
 #endif
+       adr     r5, arm1020e_crval
+       ldmia   r5, {r5, r6}
        mrc     p15, 0, r0, c1, c0              @ get control register v4
-       ldr     r5, arm1020e_cr1_clear
        bic     r0, r0, r5
-       ldr     r5, arm1020e_cr1_set
-       orr     r0, r0, r5
+       orr     r0, r0, r6
 #ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
        orr     r0, r0, #0x4000                 @ .R.. .... .... ....
 #endif
@@ -438,12 +439,9 @@ __arm1020e_setup:
         * .RVI ZFRS BLDP WCAM
         * .011 1001 ..11 0101
         */
-       .type   arm1020e_cr1_clear, #object
-       .type   arm1020e_cr1_set, #object
-arm1020e_cr1_clear:
-       .word   0x5f3f
-arm1020e_cr1_set:
-       .word   0x3935
+       .type   arm1020e_crval, #object
+arm1020e_crval:
+       crval   clear=0x00007f3f, mmuset=0x00003935, ucset=0x00001930
 
        __INITDATA
 
@@ -477,25 +475,7 @@ cpu_elf_name:
 
        .type   cpu_arm1020e_name, #object
 cpu_arm1020e_name:
-       .ascii  "ARM1020E"
-#ifndef CONFIG_CPU_ICACHE_DISABLE
-       .ascii  "i"
-#endif
-#ifndef CONFIG_CPU_DCACHE_DISABLE
-       .ascii  "d"
-#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
-       .ascii  "(wt)"
-#else
-       .ascii  "(wb)"
-#endif
-#endif
-#ifndef CONFIG_CPU_BPREDICT_DISABLE
-       .ascii  "B"
-#endif
-#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
-       .ascii  "RR"
-#endif
-       .ascii  "\0"
+       .asciz  "ARM1020E"
        .size   cpu_arm1020e_name, . - cpu_arm1020e_name
 
        .align
@@ -506,6 +486,10 @@ cpu_arm1020e_name:
 __arm1020e_proc_info:
        .long   0x4105a200                      @ ARM 1020TE (Architecture v5TE)
        .long   0xff0ffff0
+       .long   PMD_TYPE_SECT | \
+               PMD_BIT4 | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
        .long   PMD_TYPE_SECT | \
                PMD_BIT4 | \
                PMD_SECT_AP_WRITE | \
index b0ccff4fadd2559912e5edf50483369726f7fd3a..a089528e6bce24e793db1a3b09f35ebdb21b131f 100644 (file)
@@ -15,7 +15,6 @@
  * functions on the ARM1022E.
  */
 #include <linux/linkage.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <asm/assembler.h>
 #include <asm/asm-offsets.h>
@@ -24,6 +23,8 @@
 #include <asm/procinfo.h>
 #include <asm/ptrace.h>
 
+#include "proc-macros.S"
+
 /*
  * This is the maximum size of an area which will be invalidated
  * using the single invalidate entry instructions.  Anything larger
@@ -404,11 +405,11 @@ __arm1022_setup:
 #ifdef CONFIG_MMU
        mcr     p15, 0, r0, c8, c7              @ invalidate I,D TLBs on v4
 #endif
+       adr     r5, arm1022_crval
+       ldmia   r5, {r5, r6}
        mrc     p15, 0, r0, c1, c0              @ get control register v4
-       ldr     r5, arm1022_cr1_clear
        bic     r0, r0, r5
-       ldr     r5, arm1022_cr1_set
-       orr     r0, r0, r5
+       orr     r0, r0, r6
 #ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
        orr     r0, r0, #0x4000                 @ .R..............
 #endif
@@ -421,12 +422,9 @@ __arm1022_setup:
         * .011 1001 ..11 0101
         * 
         */
-       .type   arm1022_cr1_clear, #object
-       .type   arm1022_cr1_set, #object
-arm1022_cr1_clear:
-       .word   0x7f3f
-arm1022_cr1_set:
-       .word   0x3935
+       .type   arm1022_crval, #object
+arm1022_crval:
+       crval   clear=0x00007f3f, mmuset=0x00003935, ucset=0x00001930
 
        __INITDATA
 
@@ -460,25 +458,7 @@ cpu_elf_name:
 
        .type   cpu_arm1022_name, #object
 cpu_arm1022_name:
-       .ascii  "arm1022"
-#ifndef CONFIG_CPU_ICACHE_DISABLE
-       .ascii  "i"
-#endif
-#ifndef CONFIG_CPU_DCACHE_DISABLE
-       .ascii  "d"
-#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
-       .ascii  "(wt)"
-#else
-       .ascii  "(wb)"
-#endif
-#endif
-#ifndef CONFIG_CPU_BPREDICT_DISABLE
-       .ascii  "B"
-#endif
-#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
-       .ascii  "RR"
-#endif
-       .ascii  "\0"
+       .asciz  "ARM1022"
        .size   cpu_arm1022_name, . - cpu_arm1022_name
 
        .align
@@ -489,6 +469,10 @@ cpu_arm1022_name:
 __arm1022_proc_info:
        .long   0x4105a220                      @ ARM 1022E (v5TE)
        .long   0xff0ffff0
+       .long   PMD_TYPE_SECT | \
+               PMD_BIT4 | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
        .long   PMD_TYPE_SECT | \
                PMD_BIT4 | \
                PMD_SECT_AP_WRITE | \
index abe850c9a641ef0ef6074eaaabeb8484852a2929..d6d84d92c7c7208e832b6c6ea0673077603b9bd1 100644 (file)
@@ -15,7 +15,6 @@
  * functions on the ARM1026EJ-S.
  */
 #include <linux/linkage.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <asm/assembler.h>
 #include <asm/asm-offsets.h>
@@ -24,6 +23,8 @@
 #include <asm/procinfo.h>
 #include <asm/ptrace.h>
 
+#include "proc-macros.S"
+
 /*
  * This is the maximum size of an area which will be invalidated
  * using the single invalidate entry instructions.  Anything larger
@@ -399,11 +400,11 @@ __arm1026_setup:
        mov     r0, #4                          @ explicitly disable writeback
        mcr     p15, 7, r0, c15, c0, 0
 #endif
+       adr     r5, arm1026_crval
+       ldmia   r5, {r5, r6}
        mrc     p15, 0, r0, c1, c0              @ get control register v4
-       ldr     r5, arm1026_cr1_clear
        bic     r0, r0, r5
-       ldr     r5, arm1026_cr1_set
-       orr     r0, r0, r5
+       orr     r0, r0, r6
 #ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
        orr     r0, r0, #0x4000                 @ .R.. .... .... ....
 #endif
@@ -416,12 +417,9 @@ __arm1026_setup:
         * .011 1001 ..11 0101
         * 
         */
-       .type   arm1026_cr1_clear, #object
-       .type   arm1026_cr1_set, #object
-arm1026_cr1_clear:
-       .word   0x7f3f
-arm1026_cr1_set:
-       .word   0x3935
+       .type   arm1026_crval, #object
+arm1026_crval:
+       crval   clear=0x00007f3f, mmuset=0x00003935, ucset=0x00001934
 
        __INITDATA
 
@@ -456,25 +454,7 @@ cpu_elf_name:
 
        .type   cpu_arm1026_name, #object
 cpu_arm1026_name:
-       .ascii  "ARM1026EJ-S"
-#ifndef CONFIG_CPU_ICACHE_DISABLE
-       .ascii  "i"
-#endif
-#ifndef CONFIG_CPU_DCACHE_DISABLE
-       .ascii  "d"
-#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
-       .ascii  "(wt)"
-#else
-       .ascii  "(wb)"
-#endif
-#endif
-#ifndef CONFIG_CPU_BPREDICT_DISABLE
-       .ascii  "B"
-#endif
-#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
-       .ascii  "RR"
-#endif
-       .ascii  "\0"
+       .asciz  "ARM1026EJ-S"
        .size   cpu_arm1026_name, . - cpu_arm1026_name
 
        .align
@@ -485,6 +465,10 @@ cpu_arm1026_name:
 __arm1026_proc_info:
        .long   0x4106a260                      @ ARM 1026EJ-S (v5TEJ)
        .long   0xff0ffff0
+       .long   PMD_TYPE_SECT | \
+               PMD_BIT4 | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
        .long   PMD_TYPE_SECT | \
                PMD_BIT4 | \
                PMD_SECT_AP_WRITE | \
index 7a705edfa4b22461e68106dca194c7d831d5eb70..0432e4806888aa51e1c39a843d63fa4f633a5d8b 100644 (file)
@@ -355,6 +355,10 @@ __arm6_proc_info:
                .long   0x41560600
                .long   0xfffffff0
                .long   0x00000c1e
+               .long   PMD_TYPE_SECT | \
+                       PMD_BIT4 | \
+                       PMD_SECT_AP_WRITE | \
+                       PMD_SECT_AP_READ
                b       __arm6_setup
                .long   cpu_arch_name
                .long   cpu_elf_name
@@ -371,6 +375,10 @@ __arm610_proc_info:
                .long   0x41560610
                .long   0xfffffff0
                .long   0x00000c1e
+               .long   PMD_TYPE_SECT | \
+                       PMD_BIT4 | \
+                       PMD_SECT_AP_WRITE | \
+                       PMD_SECT_AP_READ
                b       __arm6_setup
                .long   cpu_arch_name
                .long   cpu_elf_name
@@ -387,6 +395,10 @@ __arm7_proc_info:
                .long   0x41007000
                .long   0xffffff00
                .long   0x00000c1e
+               .long   PMD_TYPE_SECT | \
+                       PMD_BIT4 | \
+                       PMD_SECT_AP_WRITE | \
+                       PMD_SECT_AP_READ
                b       __arm7_setup
                .long   cpu_arch_name
                .long   cpu_elf_name
@@ -408,6 +420,10 @@ __arm710_proc_info:
                        PMD_BIT4 | \
                        PMD_SECT_AP_WRITE | \
                        PMD_SECT_AP_READ
+               .long   PMD_TYPE_SECT | \
+                       PMD_BIT4 | \
+                       PMD_SECT_AP_WRITE | \
+                       PMD_SECT_AP_READ
                b       __arm7_setup
                .long   cpu_arch_name
                .long   cpu_elf_name
index 86102467d37f98fedf2ff9e75a83f2e3430dd795..c2f0705bfd49ed6f9f7f4eebdb251b1d7a3c34e5 100644 (file)
@@ -41,6 +41,8 @@
 #include <asm/procinfo.h>
 #include <asm/ptrace.h>
 
+#include "proc-macros.S"
+
 /*
  * Function: arm720_proc_init (void)
  *        : arm720_proc_fin (void)
@@ -169,11 +171,11 @@ __arm720_setup:
 #ifdef CONFIG_MMU
        mcr     p15, 0, r0, c8, c7, 0           @ flush TLB (v4)
 #endif
+       adr     r5, arm720_crval
+       ldmia   r5, {r5, r6}
        mrc     p15, 0, r0, c1, c0              @ get control register
-       ldr     r5, arm720_cr1_clear
        bic     r0, r0, r5
-       ldr     r5, arm720_cr1_set
-       orr     r0, r0, r5
+       orr     r0, r0, r6
        mov     pc, lr                          @ __ret (head.S)
        .size   __arm720_setup, . - __arm720_setup
 
@@ -183,12 +185,9 @@ __arm720_setup:
         * ..1. 1001 ..11 1101
         * 
         */
-       .type   arm720_cr1_clear, #object
-       .type   arm720_cr1_set, #object
-arm720_cr1_clear:
-       .word   0x2f3f
-arm720_cr1_set:
-       .word   0x213d
+       .type   arm720_crval, #object
+arm720_crval:
+       crval   clear=0x00002f3f, mmuset=0x0000213d, ucset=0x00000130
 
                __INITDATA
 
@@ -246,6 +245,10 @@ __arm710_proc_info:
                        PMD_BIT4 | \
                        PMD_SECT_AP_WRITE | \
                        PMD_SECT_AP_READ
+               .long   PMD_TYPE_SECT | \
+                       PMD_BIT4 | \
+                       PMD_SECT_AP_WRITE | \
+                       PMD_SECT_AP_READ
                b       __arm710_setup                          @ cpu_flush
                .long   cpu_arch_name                           @ arch_name
                .long   cpu_elf_name                            @ elf_name
@@ -267,6 +270,10 @@ __arm720_proc_info:
                        PMD_BIT4 | \
                        PMD_SECT_AP_WRITE | \
                        PMD_SECT_AP_READ
+               .long   PMD_TYPE_SECT | \
+                       PMD_BIT4 | \
+                       PMD_SECT_AP_WRITE | \
+                       PMD_SECT_AP_READ
                b       __arm720_setup                          @ cpu_flush
                .long   cpu_arch_name                           @ arch_name
                .long   cpu_elf_name                            @ elf_name
index 31dc839ba07c9557ff0dae53de0827b345e870cd..4adb46b3a4e0d4f68b33c4c1f6979e4e59ae0d51 100644 (file)
@@ -26,7 +26,6 @@
  *  CONFIG_CPU_ARM920_CPU_IDLE -> nohlt
  */
 #include <linux/linkage.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <asm/assembler.h>
 #include <asm/pgtable-hwdef.h>
@@ -391,11 +390,11 @@ __arm920_setup:
 #ifdef CONFIG_MMU
        mcr     p15, 0, r0, c8, c7              @ invalidate I,D TLBs on v4
 #endif
+       adr     r5, arm920_crval
+       ldmia   r5, {r5, r6}
        mrc     p15, 0, r0, c1, c0              @ get control register v4
-       ldr     r5, arm920_cr1_clear
        bic     r0, r0, r5
-       ldr     r5, arm920_cr1_set
-       orr     r0, r0, r5
+       orr     r0, r0, r6
        mov     pc, lr
        .size   __arm920_setup, . - __arm920_setup
 
@@ -405,12 +404,9 @@ __arm920_setup:
         * ..11 0001 ..11 0101
         * 
         */
-       .type   arm920_cr1_clear, #object
-       .type   arm920_cr1_set, #object
-arm920_cr1_clear:
-       .word   0x3f3f
-arm920_cr1_set:
-       .word   0x3135
+       .type   arm920_crval, #object
+arm920_crval:
+       crval   clear=0x00003f3f, mmuset=0x00003135, ucset=0x00001130
 
        __INITDATA
 
@@ -444,19 +440,7 @@ cpu_elf_name:
 
        .type   cpu_arm920_name, #object
 cpu_arm920_name:
-       .ascii  "ARM920T"
-#ifndef CONFIG_CPU_ICACHE_DISABLE
-       .ascii  "i"
-#endif
-#ifndef CONFIG_CPU_DCACHE_DISABLE
-       .ascii  "d"
-#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
-       .ascii  "(wt)"
-#else
-       .ascii  "(wb)"
-#endif
-#endif
-       .ascii  "\0"
+       .asciz  "ARM920T"
        .size   cpu_arm920_name, . - cpu_arm920_name
 
        .align
@@ -473,6 +457,10 @@ __arm920_proc_info:
                PMD_BIT4 | \
                PMD_SECT_AP_WRITE | \
                PMD_SECT_AP_READ
+       .long   PMD_TYPE_SECT | \
+               PMD_BIT4 | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
        b       __arm920_setup
        .long   cpu_arch_name
        .long   cpu_elf_name
index 9e57c34f5c098532c044aa2b1f1c02faa6aa3610..571f082f0247e5c14b1201a695fdffe63ba8b7ba 100644 (file)
@@ -27,7 +27,6 @@
  *  CONFIG_CPU_ARM922_CPU_IDLE -> nohlt
  */
 #include <linux/linkage.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <asm/assembler.h>
 #include <asm/pgtable-hwdef.h>
@@ -395,11 +394,11 @@ __arm922_setup:
 #ifdef CONFIG_MMU
        mcr     p15, 0, r0, c8, c7              @ invalidate I,D TLBs on v4
 #endif
+       adr     r5, arm922_crval
+       ldmia   r5, {r5, r6}
        mrc     p15, 0, r0, c1, c0              @ get control register v4
-       ldr     r5, arm922_cr1_clear
        bic     r0, r0, r5
-       ldr     r5, arm922_cr1_set
-       orr     r0, r0, r5
+       orr     r0, r0, r6
        mov     pc, lr
        .size   __arm922_setup, . - __arm922_setup
 
@@ -409,12 +408,9 @@ __arm922_setup:
         * ..11 0001 ..11 0101
         * 
         */
-       .type   arm922_cr1_clear, #object
-       .type   arm922_cr1_set, #object
-arm922_cr1_clear:
-       .word   0x3f3f
-arm922_cr1_set:
-       .word   0x3135
+       .type   arm922_crval, #object
+arm922_crval:
+       crval   clear=0x00003f3f, mmuset=0x00003135, ucset=0x00001130
 
        __INITDATA
 
@@ -448,19 +444,7 @@ cpu_elf_name:
 
        .type   cpu_arm922_name, #object
 cpu_arm922_name:
-       .ascii  "ARM922T"
-#ifndef CONFIG_CPU_ICACHE_DISABLE
-       .ascii  "i"
-#endif
-#ifndef CONFIG_CPU_DCACHE_DISABLE
-       .ascii  "d"
-#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
-       .ascii  "(wt)"
-#else
-       .ascii  "(wb)"
-#endif
-#endif
-       .ascii  "\0"
+       .asciz  "ARM922T"
        .size   cpu_arm922_name, . - cpu_arm922_name
 
        .align
@@ -477,6 +461,10 @@ __arm922_proc_info:
                PMD_BIT4 | \
                PMD_SECT_AP_WRITE | \
                PMD_SECT_AP_READ
+       .long   PMD_TYPE_SECT | \
+               PMD_BIT4 | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
        b       __arm922_setup
        .long   cpu_arch_name
        .long   cpu_elf_name
index 8d47c9f3f931b1aaa1381d5ad15347899fddfeb7..8d9a9f93b011cc914d407b1b5646289d9eb31483 100644 (file)
@@ -50,7 +50,6 @@
  */
 
 #include <linux/linkage.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <asm/assembler.h>
 #include <asm/pgtable-hwdef.h>
@@ -455,11 +454,11 @@ __arm925_setup:
        mcr     p15, 7, r0, c15, c0, 0
 #endif
 
+       adr     r5, arm925_crval
+       ldmia   r5, {r5, r6}
        mrc     p15, 0, r0, c1, c0              @ get control register v4
-       ldr     r5, arm925_cr1_clear
        bic     r0, r0, r5
-       ldr     r5, arm925_cr1_set
-       orr     r0, r0, r5
+       orr     r0, r0, r6
 #ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
        orr     r0, r0, #0x4000                 @ .1.. .... .... ....
 #endif
@@ -472,12 +471,9 @@ __arm925_setup:
         * .011 0001 ..11 1101
         * 
         */
-       .type   arm925_cr1_clear, #object
-       .type   arm925_cr1_set, #object
-arm925_cr1_clear:
-       .word   0x7f3f
-arm925_cr1_set:
-       .word   0x313d
+       .type   arm925_crval, #object
+arm925_crval:
+       crval   clear=0x00007f3f, mmuset=0x0000313d, ucset=0x00001130
 
        __INITDATA
 
@@ -511,22 +507,7 @@ cpu_elf_name:
 
        .type   cpu_arm925_name, #object
 cpu_arm925_name:
-       .ascii  "ARM925T"
-#ifndef CONFIG_CPU_ICACHE_DISABLE
-       .ascii  "i"
-#endif
-#ifndef CONFIG_CPU_DCACHE_DISABLE
-       .ascii  "d"
-#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
-       .ascii  "(wt)"
-#else
-       .ascii  "(wb)"
-#endif
-#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
-       .ascii  "RR"
-#endif
-#endif
-       .ascii  "\0"
+       .asciz  "ARM925T"
        .size   cpu_arm925_name, . - cpu_arm925_name
 
        .align
@@ -537,6 +518,10 @@ cpu_arm925_name:
 __arm925_proc_info:
        .long   0x54029250
        .long   0xfffffff0
+       .long   PMD_TYPE_SECT | \
+               PMD_BIT4 | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
        .long   PMD_TYPE_SECT | \
                PMD_BIT4 | \
                PMD_SECT_AP_WRITE | \
@@ -556,6 +541,10 @@ __arm925_proc_info:
 __arm915_proc_info:
        .long   0x54029150
        .long   0xfffffff0
+       .long   PMD_TYPE_SECT | \
+               PMD_BIT4 | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
        .long   PMD_TYPE_SECT | \
                PMD_BIT4 | \
                PMD_SECT_AP_WRITE | \
index cb4d8f33d2a3ff4b02146e2475ab8e22e9affbf8..1e89d40804743d16ca41a3788ad99bc242e6d20b 100644 (file)
@@ -26,7 +26,6 @@
  *  CONFIG_CPU_ARM926_CPU_IDLE -> nohlt
  */
 #include <linux/linkage.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <asm/assembler.h>
 #include <asm/pgtable-hwdef.h>
@@ -404,11 +403,11 @@ __arm926_setup:
        mcr     p15, 7, r0, c15, c0, 0
 #endif 
 
+       adr     r5, arm926_crval
+       ldmia   r5, {r5, r6}
        mrc     p15, 0, r0, c1, c0              @ get control register v4
-       ldr     r5, arm926_cr1_clear
        bic     r0, r0, r5
-       ldr     r5, arm926_cr1_set
-       orr     r0, r0, r5
+       orr     r0, r0, r6
 #ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
        orr     r0, r0, #0x4000                 @ .1.. .... .... ....
 #endif
@@ -421,12 +420,9 @@ __arm926_setup:
         * .011 0001 ..11 0101
         * 
         */
-       .type   arm926_cr1_clear, #object
-       .type   arm926_cr1_set, #object
-arm926_cr1_clear:
-       .word   0x7f3f
-arm926_cr1_set:
-       .word   0x3135
+       .type   arm926_crval, #object
+arm926_crval:
+       crval   clear=0x00007f3f, mmuset=0x00003135, ucset=0x00001134
 
        __INITDATA
 
@@ -460,22 +456,7 @@ cpu_elf_name:
 
        .type   cpu_arm926_name, #object
 cpu_arm926_name:
-       .ascii  "ARM926EJ-S"
-#ifndef CONFIG_CPU_ICACHE_DISABLE
-       .ascii  "i"
-#endif
-#ifndef CONFIG_CPU_DCACHE_DISABLE
-       .ascii  "d"
-#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
-       .ascii  "(wt)"
-#else
-       .ascii  "(wb)"
-#endif
-#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
-       .ascii  "RR"
-#endif
-#endif
-       .ascii  "\0"
+       .asciz  "ARM926EJ-S"
        .size   cpu_arm926_name, . - cpu_arm926_name
 
        .align
@@ -492,6 +473,10 @@ __arm926_proc_info:
                PMD_BIT4 | \
                PMD_SECT_AP_WRITE | \
                PMD_SECT_AP_READ
+       .long   PMD_TYPE_SECT | \
+               PMD_BIT4 | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
        b       __arm926_setup
        .long   cpu_arch_name
        .long   cpu_elf_name
index 7cfc2604a1ee9b29211babfa3bc8348e16d7d7a0..9e2c89eb2115bd644fc09d854d48ac7637fc3cad 100644 (file)
        .macro  asid, rd, rn
        and     \rd, \rn, #255
        .endm
+
+       .macro  crval, clear, mmuset, ucset
+#ifdef CONFIG_MMU
+       .word   \clear
+       .word   \mmuset
+#else
+       .word   \clear
+       .word   \ucset
+#endif
+       .endm
index 5a760a2c629c11681d072e2d547e791ab1ebb7f1..c878064e9b887b271af7b75749d37f05ed77b646 100644 (file)
@@ -23,6 +23,8 @@
 #include <asm/pgtable.h>
 #include <asm/ptrace.h>
 
+#include "proc-macros.S"
+
 /*
  * the cache line size of the I and D cache
  */
@@ -185,11 +187,12 @@ __sa110_setup:
 #ifdef CONFIG_MMU
        mcr     p15, 0, r10, c8, c7             @ invalidate I,D TLBs on v4
 #endif
+
+       adr     r5, sa110_crval
+       ldmia   r5, {r5, r6}
        mrc     p15, 0, r0, c1, c0              @ get control register v4
-       ldr     r5, sa110_cr1_clear
        bic     r0, r0, r5
-       ldr     r5, sa110_cr1_set
-       orr     r0, r0, r5
+       orr     r0, r0, r6
        mov     pc, lr
        .size   __sa110_setup, . - __sa110_setup
 
@@ -199,12 +202,9 @@ __sa110_setup:
         * ..01 0001 ..11 1101
         * 
         */
-       .type   sa110_cr1_clear, #object
-       .type   sa110_cr1_set, #object
-sa110_cr1_clear:
-       .word   0x3f3f
-sa110_cr1_set:
-       .word   0x113d
+       .type   sa110_crval, #object
+sa110_crval:
+       crval   clear=0x00003f3f, mmuset=0x0000113d, ucset=0x00001130
 
        __INITDATA
 
@@ -255,6 +255,9 @@ __sa110_proc_info:
                PMD_SECT_CACHEABLE | \
                PMD_SECT_AP_WRITE | \
                PMD_SECT_AP_READ
+       .long   PMD_TYPE_SECT | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
        b       __sa110_setup
        .long   cpu_arch_name
        .long   cpu_elf_name
index 0a2107ad4c32f8750b52cf9424e3c69bb34f685f..b23b66a6155aa314304dc1dcf659e7e9fbe4ac89 100644 (file)
@@ -27,6 +27,8 @@
 #include <asm/pgtable-hwdef.h>
 #include <asm/pgtable.h>
 
+#include "proc-macros.S"
+
 /*
  * the cache line size of the I and D cache
  */
@@ -198,11 +200,11 @@ __sa1100_setup:
 #ifdef CONFIG_MMU
        mcr     p15, 0, r0, c8, c7              @ invalidate I,D TLBs on v4
 #endif
+       adr     r5, sa1100_crval
+       ldmia   r5, {r5, r6}
        mrc     p15, 0, r0, c1, c0              @ get control register v4
-       ldr     r5, sa1100_cr1_clear
        bic     r0, r0, r5
-       ldr     r5, sa1100_cr1_set
-       orr     r0, r0, r5
+       orr     r0, r0, r6
        mov     pc, lr
        .size   __sa1100_setup, . - __sa1100_setup
 
@@ -212,12 +214,9 @@ __sa1100_setup:
         * ..11 0001 ..11 1101
         * 
         */
-       .type   sa1100_cr1_clear, #object
-       .type   sa1100_cr1_set, #object
-sa1100_cr1_clear:
-       .word   0x3f3f
-sa1100_cr1_set:
-       .word   0x313d
+       .type   sa1100_crval, #object
+sa1100_crval:
+       crval   clear=0x00003f3f, mmuset=0x0000313d, ucset=0x00001130
 
        __INITDATA
 
@@ -276,6 +275,9 @@ __sa1100_proc_info:
                PMD_SECT_CACHEABLE | \
                PMD_SECT_AP_WRITE | \
                PMD_SECT_AP_READ
+       .long   PMD_TYPE_SECT | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
        b       __sa1100_setup
        .long   cpu_arch_name
        .long   cpu_elf_name
@@ -296,6 +298,9 @@ __sa1110_proc_info:
                PMD_SECT_CACHEABLE | \
                PMD_SECT_AP_WRITE | \
                PMD_SECT_AP_READ
+       .long   PMD_TYPE_SECT | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
        b       __sa1100_setup
        .long   cpu_arch_name
        .long   cpu_elf_name
index ca13d4d05f6551e13fae4d9148fa7c7664e3da08..6f72549f8843b78043d082382a4599cbce597cde 100644 (file)
@@ -212,11 +212,11 @@ __v6_setup:
        orr     r0, r0, #(0xf << 20)
        mcr     p15, 0, r0, c1, c0, 2           @ Enable full access to VFP
 #endif
+       adr     r5, v6_crval
+       ldmia   r5, {r5, r6}
        mrc     p15, 0, r0, c1, c0, 0           @ read control register
-       ldr     r5, v6_cr1_clear                @ get mask for bits to clear
        bic     r0, r0, r5                      @ clear bits them
-       ldr     r5, v6_cr1_set                  @ get mask for bits to set
-       orr     r0, r0, r5                      @ set them
+       orr     r0, r0, r6                      @ set them
        mov     pc, lr                          @ return to head.S:__ret
 
        /*
@@ -225,12 +225,9 @@ __v6_setup:
         * rrrr rrrx xxx0 0101 xxxx xxxx x111 xxxx < forced
         *         0 110       0011 1.00 .111 1101 < we want
         */
-       .type   v6_cr1_clear, #object
-       .type   v6_cr1_set, #object
-v6_cr1_clear:
-       .word   0x01e0fb7f
-v6_cr1_set:
-       .word   0x00c0387d
+       .type   v6_crval, #object
+v6_crval:
+       crval   clear=0x01e0fb7f, mmuset=0x00c0387d, ucset=0x00c0187c
 
        .type   v6_processor_functions, #object
 ENTRY(v6_processor_functions)
@@ -269,6 +266,10 @@ __v6_proc_info:
                PMD_SECT_CACHEABLE | \
                PMD_SECT_AP_WRITE | \
                PMD_SECT_AP_READ
+       .long   PMD_TYPE_SECT | \
+               PMD_SECT_XN | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
        b       __v6_setup
        .long   cpu_arch_name
        .long   cpu_elf_name
index 8d32e21fe151a919630dc866205974888b624e3a..4ace2d8090c7dd83bccd8787ef7fcc2cc67a6233 100644 (file)
@@ -426,23 +426,26 @@ __xsc3_setup:
        orr     r0, r0, #(1 << 10)              @ enable L2 for LLR cache
 #endif
        mcr     p15, 0, r0, c1, c0, 1           @ set auxiliary control reg
+
+       adr     r5, xsc3_crval
+       ldmia   r5, {r5, r6}
        mrc     p15, 0, r0, c1, c0, 0           @ get control register
-       bic     r0, r0, #0x0002                 @ .... .... .... ..A.
-       orr     r0, r0, #0x0005                 @ .... .... .... .C.M
+       bic     r0, r0, r5                      @ .... .... .... ..A.
+       orr     r0, r0, r6                      @ .... .... .... .C.M
 #if BTB_ENABLE
-       bic     r0, r0, #0x0200                 @ .... ..R. .... ....
-       orr     r0, r0, #0x3900                 @ ..VI Z..S .... ....
-#else
-       bic     r0, r0, #0x0a00                 @ .... Z.R. .... ....
-       orr     r0, r0, #0x3100                 @ ..VI ...S .... ....
+       orr     r0, r0, #0x00000800             @ ..VI Z..S .... ....
 #endif
 #if L2_CACHE_ENABLE
-       orr     r0, r0, #0x4000000              @ L2 enable
+       orr     r0, r0, #0x04000000             @ L2 enable
 #endif
        mov     pc, lr
 
        .size   __xsc3_setup, . - __xsc3_setup
 
+       .type   xsc3_crval, #object
+xsc3_crval:
+       crval   clear=0x04003b02, mmuset=0x00003105, ucset=0x00001100
+
        __INITDATA
 
 /*
@@ -487,7 +490,14 @@ cpu_xsc3_name:
 __xsc3_proc_info:
        .long   0x69056000
        .long   0xffffe000
-       .long   0x00000c0e
+       .long   PMD_TYPE_SECT | \
+               PMD_SECT_BUFFERABLE | \
+               PMD_SECT_CACHEABLE | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
+       .long   PMD_TYPE_SECT | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
        b       __xsc3_setup
        .long   cpu_arch_name
        .long   cpu_elf_name
index 29bcc4dd65178a99cd640e4fc4fd715b97453e00..521538671f4ce6efcaac8b645d9431c21f127467 100644 (file)
@@ -138,17 +138,23 @@ ENTRY(cpu_xscale_proc_fin)
  * to what would be the reset vector.
  *
  * loc: location to jump to for soft reset
+ *
+ * Beware PXA270 erratum E7.
  */
        .align  5
 ENTRY(cpu_xscale_reset)
        mov     r1, #PSR_F_BIT|PSR_I_BIT|SVC_MODE
        msr     cpsr_c, r1                      @ reset CPSR
+       mcr     p15, 0, r1, c10, c4, 1          @ unlock I-TLB
+       mcr     p15, 0, r1, c8, c5, 0           @ invalidate I-TLB
        mrc     p15, 0, r1, c1, c0, 0           @ ctrl register
        bic     r1, r1, #0x0086                 @ ........B....CA.
        bic     r1, r1, #0x3900                 @ ..VIZ..S........
+       sub     pc, pc, #4                      @ flush pipeline
+       @ *** cache line aligned ***
        mcr     p15, 0, r1, c1, c0, 0           @ ctrl register
-       mcr     p15, 0, ip, c7, c7, 0           @ invalidate I,D caches & BTB
        bic     r1, r1, #0x0001                 @ ...............M
+       mcr     p15, 0, ip, c7, c7, 0           @ invalidate I,D caches & BTB
        mcr     p15, 0, r1, c1, c0, 0           @ ctrl register
        @ CAUTION: MMU turned off from this point. We count on the pipeline
        @ already containing those two last instructions to survive.
@@ -475,11 +481,12 @@ __xscale_setup:
        orr     r0, r0, #1 << 6                 @ cp6 for IOP3xx and Bulverde
        orr     r0, r0, #1 << 13                @ Its undefined whether this
        mcr     p15, 0, r0, c15, c1, 0          @ affects USR or SVC modes
+
+       adr     r5, xscale_crval
+       ldmia   r5, {r5, r6}
        mrc     p15, 0, r0, c1, c0, 0           @ get control register
-       ldr     r5, xscale_cr1_clear
        bic     r0, r0, r5
-       ldr     r5, xscale_cr1_set
-       orr     r0, r0, r5
+       orr     r0, r0, r6
        mov     pc, lr
        .size   __xscale_setup, . - __xscale_setup
 
@@ -489,12 +496,9 @@ __xscale_setup:
         * ..11 1.01 .... .101
         * 
         */
-       .type   xscale_cr1_clear, #object
-       .type   xscale_cr1_set, #object
-xscale_cr1_clear:
-       .word   0x3b07
-xscale_cr1_set:
-       .word   0x3905
+       .type   xscale_crval, #object
+xscale_crval:
+       crval   clear=0x00003b07, mmuset=0x00003905, ucset=0x00001900
 
        __INITDATA
 
@@ -595,6 +599,9 @@ __80200_proc_info:
                PMD_SECT_CACHEABLE | \
                PMD_SECT_AP_WRITE | \
                PMD_SECT_AP_READ
+       .long   PMD_TYPE_SECT | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
        b       __xscale_setup
        .long   cpu_arch_name
        .long   cpu_elf_name
@@ -615,6 +622,9 @@ __8032x_proc_info:
                PMD_SECT_CACHEABLE | \
                PMD_SECT_AP_WRITE | \
                PMD_SECT_AP_READ
+       .long   PMD_TYPE_SECT | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
        b       __xscale_setup
        .long   cpu_arch_name
        .long   cpu_elf_name
@@ -635,6 +645,9 @@ __8033x_proc_info:
                PMD_SECT_CACHEABLE | \
                PMD_SECT_AP_WRITE | \
                PMD_SECT_AP_READ
+       .long   PMD_TYPE_SECT | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
        b       __xscale_setup
        .long   cpu_arch_name
        .long   cpu_elf_name
@@ -655,6 +668,9 @@ __pxa250_proc_info:
                PMD_SECT_CACHEABLE | \
                PMD_SECT_AP_WRITE | \
                PMD_SECT_AP_READ
+       .long   PMD_TYPE_SECT | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
        b       __xscale_setup
        .long   cpu_arch_name
        .long   cpu_elf_name
@@ -675,6 +691,9 @@ __pxa210_proc_info:
                PMD_SECT_CACHEABLE | \
                PMD_SECT_AP_WRITE | \
                PMD_SECT_AP_READ
+       .long   PMD_TYPE_SECT | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
        b       __xscale_setup
        .long   cpu_arch_name
        .long   cpu_elf_name
@@ -695,6 +714,9 @@ __ixp2400_proc_info:
                PMD_SECT_CACHEABLE | \
                PMD_SECT_AP_WRITE | \
                PMD_SECT_AP_READ
+       .long   PMD_TYPE_SECT | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
        b       __xscale_setup
        .long   cpu_arch_name
        .long   cpu_elf_name
@@ -715,6 +737,9 @@ __ixp2800_proc_info:
                PMD_SECT_CACHEABLE | \
                PMD_SECT_AP_WRITE | \
                PMD_SECT_AP_READ
+       .long   PMD_TYPE_SECT | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
        b       __xscale_setup
        .long   cpu_arch_name
        .long   cpu_elf_name
@@ -735,6 +760,9 @@ __ixp42x_proc_info:
                PMD_SECT_CACHEABLE | \
                PMD_SECT_AP_WRITE | \
                PMD_SECT_AP_READ
+       .long   PMD_TYPE_SECT | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
        b       __xscale_setup
        .long   cpu_arch_name
        .long   cpu_elf_name
@@ -750,7 +778,14 @@ __ixp42x_proc_info:
 __ixp46x_proc_info:
        .long   0x69054200
        .long   0xffffff00
-       .long   0x00000c0e
+       .long   PMD_TYPE_SECT | \
+               PMD_SECT_BUFFERABLE | \
+               PMD_SECT_CACHEABLE | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
+       .long   PMD_TYPE_SECT | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
        b       __xscale_setup
        .long   cpu_arch_name
        .long   cpu_elf_name
@@ -771,6 +806,9 @@ __pxa255_proc_info:
                PMD_SECT_CACHEABLE | \
                PMD_SECT_AP_WRITE | \
                PMD_SECT_AP_READ
+       .long   PMD_TYPE_SECT | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
        b       __xscale_setup
        .long   cpu_arch_name
        .long   cpu_elf_name
@@ -791,6 +829,9 @@ __pxa270_proc_info:
                PMD_SECT_CACHEABLE | \
                PMD_SECT_AP_WRITE | \
                PMD_SECT_AP_READ
+       .long   PMD_TYPE_SECT | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
        b       __xscale_setup
        .long   cpu_arch_name
        .long   cpu_elf_name
index 7b3d74d73c809c7c8d1855dcca4794ede2cc9316..cc60acde84d9272697d5b3ed70656966f4b086c5 100644 (file)
@@ -26,7 +26,6 @@
 #include "fpmodule.h"
 #include "fpmodule.inl"
 
-#include <linux/config.h>
 #include <linux/compiler.h>
 #include <linux/string.h>
 #include <asm/system.h>
index 28cd79a451d3abaf2e1471f98833fdea35a8ddfa..4a4d02c09112f06861ba95aef761c31b9e429444 100644 (file)
@@ -31,7 +31,6 @@
  */
 #define GET_USERREG() ((struct pt_regs *)(THREAD_START_SP + (unsigned long)current_thread_info()) - 1)
 
-#include <linux/config.h>
 #include <linux/thread_info.h>
 
 /* includes */
index 4a31dfd9406884a90a242e7173bae04cd7f77bf2..2cebb1529607438c99fd81f3ecf18aea5431bc97 100644 (file)
@@ -20,7 +20,6 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include <linux/config.h>
 #include "fpa11.h"
 #include "fpopcode.h"
 
index 32859fa8dcfcf5c5d85c200c65b588c4e73831c2..79f8e67cc6c18a42a51ee7aff19695a6e1fc6bf2 100644 (file)
@@ -20,7 +20,6 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include <linux/config.h>
 #include "fpa11.h"
 #include "softfloat.h"
 #include "fpopcode.h"
index 7c67023655e41c6543fb1b31a246f91fbd91499f..9843dc533047d7912ed913d549d714356523cd40 100644 (file)
@@ -20,7 +20,6 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include <linux/config.h>
 #include "fpa11.h"
 #include "fpopcode.h"
 #include "fpa11.inl"
index 7d977d23f026701601a460f90123296bcbf32051..4c0ab50f399a5385adcedee14a434f281a3c5cd1 100644 (file)
@@ -24,7 +24,6 @@
 #include "fpa11.h"
 
 #include <linux/module.h>
-#include <linux/config.h>
 
 /* XXX */
 #include <linux/errno.h>
index 67ff2ab08ea0162783dbee678e2f7885d578c84d..922b81107585f324ccf7e5878643232729ad5d79 100644 (file)
@@ -19,7 +19,6 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include <linux/config.h>
 #include "fpa11.h"
 #include "softfloat.h"
 #include "fpopcode.h"
index 6528e081c83f59f527139d5c48d1a7556513fd30..ec78e3517fc9fccb55a560e26b389b9c9b95f4a4 100644 (file)
@@ -23,7 +23,6 @@
 #ifndef __FPOPCODE_H__
 #define __FPOPCODE_H__
 
-#include <linux/config.h>
 
 /*
 ARM Floating Point Instruction Classes
index 978c699673c69e65ccb2957d09957597ac32942f..e1125bc39ee49ba57eea514cd79d1078385bbd8f 100644 (file)
@@ -32,7 +32,6 @@ this code that are retained.
 #ifndef __SOFTFLOAT_H__
 #define __SOFTFLOAT_H__
 
-#include <linux/config.h>
 
 /*
 -------------------------------------------------------------------------------
index e0f0b320d76cda9129bb7fcd675b9f08b2f080f9..34fdc733743b9ec3a5c626c18541f24a4a46be87 100644 (file)
@@ -384,7 +384,7 @@ static int xscale_pmu_start(void)
        int ret;
        u32 pmnc = read_pmnc();
 
-       ret = request_irq(XSCALE_PMU_IRQ, xscale_pmu_interrupt, SA_INTERRUPT,
+       ret = request_irq(XSCALE_PMU_IRQ, xscale_pmu_interrupt, IRQF_DISABLED,
                        "XScale PMU", (void *)results);
 
        if (ret < 0) {
index ec49495e651eb4beb70d62bc7a777fd8c8071cee..ec752e16d618d1241c75c094b0262adbf2315b6a 100644 (file)
@@ -91,7 +91,7 @@ config OMAP_32K_TIMER_HZ
 
 config OMAP_DM_TIMER
        bool "Use dual-mode timer"
-       depends on ARCH_OMAP16XX
+       depends on ARCH_OMAP16XX || ARCH_OMAP24XX
        help
         Select this option if you want to use OMAP Dual-Mode timers.
 
index 32ec04c58bcd4fb66e4647d63c5cab6fbbb1e758..7f45c7c3e673d1898902fbac743de5e7cb655fd8 100644 (file)
@@ -11,7 +11,6 @@
  * published by the Free Software Foundation.
  */
 #include <linux/version.h>
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/module.h>
@@ -28,9 +27,9 @@
 
 #include <asm/arch/clock.h>
 
-LIST_HEAD(clocks);
+static LIST_HEAD(clocks);
 static DEFINE_MUTEX(clocks_mutex);
-DEFINE_SPINLOCK(clockfw_lock);
+static DEFINE_SPINLOCK(clockfw_lock);
 
 static struct clk_functions *arch_clock;
 
index adffc5a859ee7760c592785c8001842c54e99016..57b7b93674a486218bb4e35ca9840bd1b90d7c6f 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.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 98edc9fdd6d10df39ee8d360b5108397f78112fe..a0c71dca237330aac55e15bf24221b39e1962128 100644 (file)
 #include <asm/io.h>
 #include <asm/system.h>
 
+#define VERY_HI_RATE   900000000
+
+#ifdef CONFIG_ARCH_OMAP1
+#define MPU_CLK                "mpu"
+#else
+#define MPU_CLK                "virt_prcm_set"
+#endif
+
 /* TODO: Add support for SDRAM timing changes */
 
 int omap_verify_speed(struct cpufreq_policy *policy)
@@ -36,7 +44,7 @@ int omap_verify_speed(struct cpufreq_policy *policy)
 
        cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
                                     policy->cpuinfo.max_freq);
-       mpu_clk = clk_get(NULL, "mpu");
+       mpu_clk = clk_get(NULL, MPU_CLK);
        if (IS_ERR(mpu_clk))
                return PTR_ERR(mpu_clk);
        policy->min = clk_round_rate(mpu_clk, policy->min * 1000) / 1000;
@@ -56,7 +64,7 @@ unsigned int omap_getspeed(unsigned int cpu)
        if (cpu)
                return 0;
 
-       mpu_clk = clk_get(NULL, "mpu");
+       mpu_clk = clk_get(NULL, MPU_CLK);
        if (IS_ERR(mpu_clk))
                return 0;
        rate = clk_get_rate(mpu_clk) / 1000;
@@ -73,7 +81,7 @@ static int omap_target(struct cpufreq_policy *policy,
        struct cpufreq_freqs freqs;
        int ret = 0;
 
-       mpu_clk = clk_get(NULL, "mpu");
+       mpu_clk = clk_get(NULL, MPU_CLK);
        if (IS_ERR(mpu_clk))
                return PTR_ERR(mpu_clk);
 
@@ -93,7 +101,7 @@ static int __init omap_cpu_init(struct cpufreq_policy *policy)
 {
        struct clk * mpu_clk;
 
-       mpu_clk = clk_get(NULL, "mpu");
+       mpu_clk = clk_get(NULL, MPU_CLK);
        if (IS_ERR(mpu_clk))
                return PTR_ERR(mpu_clk);
 
@@ -102,7 +110,7 @@ static int __init omap_cpu_init(struct cpufreq_policy *policy)
        policy->cur = policy->min = policy->max = omap_getspeed(0);
        policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
        policy->cpuinfo.min_freq = clk_round_rate(mpu_clk, 0) / 1000;
-       policy->cpuinfo.max_freq = clk_round_rate(mpu_clk, 216000000) / 1000;
+       policy->cpuinfo.max_freq = clk_round_rate(mpu_clk, VERY_HI_RATE) / 1000;
        policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
        clk_put(mpu_clk);
 
index 5d5d6eb222dd739e9b3d8be070ed4030bfa897ff..1812f237d12f9f0327531d73db6b302356847339 100644 (file)
@@ -9,7 +9,6 @@
  * (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -105,7 +104,7 @@ static void omap_init_kp(void)
                omap_cfg_reg(E20_1610_KBR3);
                omap_cfg_reg(E19_1610_KBR4);
                omap_cfg_reg(N19_1610_KBR5);
-       } else if (machine_is_omap_perseus2()) {
+       } else if (machine_is_omap_perseus2() || machine_is_omap_fsample()) {
                omap_cfg_reg(E2_730_KBR0);
                omap_cfg_reg(J7_730_KBR1);
                omap_cfg_reg(E1_730_KBR2);
@@ -162,8 +161,8 @@ static u64 mmc1_dmamask = 0xffffffff;
 
 static struct resource mmc1_resources[] = {
        {
-               .start          = IO_ADDRESS(OMAP_MMC1_BASE),
-               .end            = IO_ADDRESS(OMAP_MMC1_BASE) + 0x7f,
+               .start          = OMAP_MMC1_BASE,
+               .end            = OMAP_MMC1_BASE + 0x7f,
                .flags          = IORESOURCE_MEM,
        },
        {
@@ -191,8 +190,8 @@ static u64 mmc2_dmamask = 0xffffffff;
 
 static struct resource mmc2_resources[] = {
        {
-               .start          = IO_ADDRESS(OMAP_MMC2_BASE),
-               .end            = IO_ADDRESS(OMAP_MMC2_BASE) + 0x7f,
+               .start          = OMAP_MMC2_BASE,
+               .end            = OMAP_MMC2_BASE + 0x7f,
                .flags          = IORESOURCE_MEM,
        },
        {
index 5dac4230360d845daf2c02d2c1a4e6e16c16ffae..9eddc9507147121a892291563dd4902eda322810 100644 (file)
@@ -24,9 +24,9 @@
 #include <linux/spinlock.h>
 #include <linux/errno.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 
 #include <asm/system.h>
-#include <asm/irq.h>
 #include <asm/hardware.h>
 #include <asm/dma.h>
 #include <asm/io.h>
@@ -43,6 +43,7 @@
 
 #define OMAP_DMA_ACTIVE                0x01
 #define OMAP_DMA_CCR_EN                (1 << 7)
+#define OMAP2_DMA_CSR_CLEAR_MASK       0xffe
 
 #define OMAP_FUNC_MUX_ARM_BASE (0xfffe1000 + 0xec)
 
@@ -166,18 +167,24 @@ void omap_set_dma_transfer_params(int lch, int data_type, int elem_count,
        if (cpu_is_omap24xx() && dma_trigger) {
                u32 val = OMAP_DMA_CCR_REG(lch);
 
+               val &= ~(3 << 19);
                if (dma_trigger > 63)
                        val |= 1 << 20;
                if (dma_trigger > 31)
                        val |= 1 << 19;
 
+               val &= ~(0x1f);
                val |= (dma_trigger & 0x1f);
 
                if (sync_mode & OMAP_DMA_SYNC_FRAME)
                        val |= 1 << 5;
+               else
+                       val &= ~(1 << 5);
 
                if (sync_mode & OMAP_DMA_SYNC_BLOCK)
                        val |= 1 << 18;
+               else
+                       val &= ~(1 << 18);
 
                if (src_or_dst_synch)
                        val |= 1 << 24;         /* source synch */
@@ -286,22 +293,39 @@ void omap_set_dma_src_data_pack(int lch, int enable)
 
 void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
 {
+       unsigned int burst = 0;
        OMAP_DMA_CSDP_REG(lch) &= ~(0x03 << 7);
 
        switch (burst_mode) {
        case OMAP_DMA_DATA_BURST_DIS:
                break;
        case OMAP_DMA_DATA_BURST_4:
-               OMAP_DMA_CSDP_REG(lch) |= (0x02 << 7);
+               if (cpu_is_omap24xx())
+                       burst = 0x1;
+               else
+                       burst = 0x2;
                break;
        case OMAP_DMA_DATA_BURST_8:
-               /* not supported by current hardware
+               if (cpu_is_omap24xx()) {
+                       burst = 0x2;
+                       break;
+               }
+               /* not supported by current hardware on OMAP1
                 * w |= (0x03 << 7);
                 * fall through
                 */
+       case OMAP_DMA_DATA_BURST_16:
+               if (cpu_is_omap24xx()) {
+                       burst = 0x3;
+                       break;
+               }
+               /* OMAP1 don't support burst 16
+                * fall through
+                */
        default:
                BUG();
        }
+       OMAP_DMA_CSDP_REG(lch) |= (burst << 7);
 }
 
 /* Note that dest_port is only for OMAP1 */
@@ -348,30 +372,49 @@ void omap_set_dma_dest_data_pack(int lch, int enable)
 
 void omap_set_dma_dest_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
 {
+       unsigned int burst = 0;
        OMAP_DMA_CSDP_REG(lch) &= ~(0x03 << 14);
 
        switch (burst_mode) {
        case OMAP_DMA_DATA_BURST_DIS:
                break;
        case OMAP_DMA_DATA_BURST_4:
-               OMAP_DMA_CSDP_REG(lch) |= (0x02 << 14);
+               if (cpu_is_omap24xx())
+                       burst = 0x1;
+               else
+                       burst = 0x2;
                break;
        case OMAP_DMA_DATA_BURST_8:
-               OMAP_DMA_CSDP_REG(lch) |= (0x03 << 14);
+               if (cpu_is_omap24xx())
+                       burst = 0x2;
+               else
+                       burst = 0x3;
                break;
+       case OMAP_DMA_DATA_BURST_16:
+               if (cpu_is_omap24xx()) {
+                       burst = 0x3;
+                       break;
+               }
+               /* OMAP1 don't support burst 16
+                * fall through
+                */
        default:
                printk(KERN_ERR "Invalid DMA burst mode\n");
                BUG();
                return;
        }
+       OMAP_DMA_CSDP_REG(lch) |= (burst << 14);
 }
 
 static inline void omap_enable_channel_irq(int lch)
 {
        u32 status;
 
-       /* Read CSR to make sure it's cleared. */
-       status = OMAP_DMA_CSR_REG(lch);
+       /* Clear CSR */
+       if (cpu_class_is_omap1())
+               status = OMAP_DMA_CSR_REG(lch);
+       else if (cpu_is_omap24xx())
+               OMAP_DMA_CSR_REG(lch) = OMAP2_DMA_CSR_CLEAR_MASK;
 
        /* Enable some nice interrupts. */
        OMAP_DMA_CICR_REG(lch) = dma_chan[lch].enabled_irqs;
@@ -470,11 +513,13 @@ int omap_request_dma(int dev_id, const char *dev_name,
        chan->dev_name = dev_name;
        chan->callback = callback;
        chan->data = data;
-       chan->enabled_irqs = OMAP_DMA_TOUT_IRQ | OMAP_DMA_DROP_IRQ |
-                               OMAP_DMA_BLOCK_IRQ;
+       chan->enabled_irqs = OMAP_DMA_DROP_IRQ | OMAP_DMA_BLOCK_IRQ;
 
-       if (cpu_is_omap24xx())
-               chan->enabled_irqs |= OMAP2_DMA_TRANS_ERR_IRQ;
+       if (cpu_class_is_omap1())
+               chan->enabled_irqs |= OMAP1_DMA_TOUT_IRQ;
+       else if (cpu_is_omap24xx())
+               chan->enabled_irqs |= OMAP2_DMA_MISALIGNED_ERR_IRQ |
+                       OMAP2_DMA_TRANS_ERR_IRQ;
 
        if (cpu_is_omap16xx()) {
                /* If the sync device is set, configure it dynamically. */
@@ -494,7 +539,7 @@ int omap_request_dma(int dev_id, const char *dev_name,
 
                omap_enable_channel_irq(free_ch);
                /* Clear the CSR register and IRQ status register */
-               OMAP_DMA_CSR_REG(free_ch) = 0x0;
+               OMAP_DMA_CSR_REG(free_ch) = OMAP2_DMA_CSR_CLEAR_MASK;
                omap_writel(~0x0, OMAP_DMA4_IRQSTATUS_L0);
        }
 
@@ -534,7 +579,7 @@ void omap_free_dma(int lch)
                omap_writel(val, OMAP_DMA4_IRQENABLE_L0);
 
                /* Clear the CSR register and IRQ status register */
-               OMAP_DMA_CSR_REG(lch) = 0x0;
+               OMAP_DMA_CSR_REG(lch) = OMAP2_DMA_CSR_CLEAR_MASK;
 
                val = omap_readl(OMAP_DMA4_IRQSTATUS_L0);
                val |= 1 << lch;
@@ -798,7 +843,7 @@ static int omap1_dma_handle_ch(int ch)
                       "%d (CSR %04x)\n", ch, csr);
                return 0;
        }
-       if (unlikely(csr & OMAP_DMA_TOUT_IRQ))
+       if (unlikely(csr & OMAP1_DMA_TOUT_IRQ))
                printk(KERN_WARNING "DMA timeout with device %d\n",
                       dma_chan[ch].dev_id);
        if (unlikely(csr & OMAP_DMA_DROP_IRQ))
@@ -846,20 +891,21 @@ static int omap2_dma_handle_ch(int ch)
                return 0;
        if (unlikely(dma_chan[ch].dev_id == -1))
                return 0;
-       /* REVISIT: According to 24xx TRM, there's no TOUT_IE */
-       if (unlikely(status & OMAP_DMA_TOUT_IRQ))
-               printk(KERN_INFO "DMA timeout with device %d\n",
-                      dma_chan[ch].dev_id);
        if (unlikely(status & OMAP_DMA_DROP_IRQ))
                printk(KERN_INFO
                       "DMA synchronization event drop occurred with device "
                       "%d\n", dma_chan[ch].dev_id);
-
        if (unlikely(status & OMAP2_DMA_TRANS_ERR_IRQ))
                printk(KERN_INFO "DMA transaction error with device %d\n",
                       dma_chan[ch].dev_id);
+       if (unlikely(status & OMAP2_DMA_SECURE_ERR_IRQ))
+               printk(KERN_INFO "DMA secure error with device %d\n",
+                      dma_chan[ch].dev_id);
+       if (unlikely(status & OMAP2_DMA_MISALIGNED_ERR_IRQ))
+               printk(KERN_INFO "DMA misaligned error with device %d\n",
+                      dma_chan[ch].dev_id);
 
-       OMAP_DMA_CSR_REG(ch) = 0x20;
+       OMAP_DMA_CSR_REG(ch) = OMAP2_DMA_CSR_CLEAR_MASK;
 
        val = omap_readl(OMAP_DMA4_IRQSTATUS_L0);
        /* ch in this function is from 0-31 while in register it is 1-32 */
@@ -893,7 +939,7 @@ static irqreturn_t omap2_dma_irq_handler(int irq, void *dev_id,
 static struct irqaction omap24xx_dma_irq = {
        .name = "DMA",
        .handler = omap2_dma_irq_handler,
-       .flags = SA_INTERRUPT
+       .flags = IRQF_DISABLED
 };
 
 #else
index eba3cb52ad878567b39c0d87750e84d2a5e44180..50524436de63e8896764048ca813d510f5e9bebc 100644 (file)
@@ -4,7 +4,8 @@
  * OMAP Dual-Mode Timers
  *
  * Copyright (C) 2005 Nokia Corporation
- * Author: Lauri Leukkunen <lauri.leukkunen@nokia.com>
+ * OMAP2 support by Juha Yrjola
+ * API improvements and OMAP2 clock framework support by Timo Teras
  *
  * 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
  */
 
 #include <linux/init.h>
+#include <linux/spinlock.h>
+#include <linux/errno.h>
+#include <linux/list.h>
+#include <linux/clk.h>
+#include <linux/delay.h>
 #include <asm/hardware.h>
 #include <asm/arch/dmtimer.h>
 #include <asm/io.h>
 #include <asm/arch/irqs.h>
-#include <linux/spinlock.h>
-#include <linux/list.h>
-
-#define OMAP_TIMER_COUNT               8
 
+/* register offsets */
 #define OMAP_TIMER_ID_REG              0x00
 #define OMAP_TIMER_OCP_CFG_REG         0x10
 #define OMAP_TIMER_SYS_STAT_REG                0x14
 #define OMAP_TIMER_CAPTURE_REG         0x3c
 #define OMAP_TIMER_IF_CTRL_REG         0x40
 
+/* timer control reg bits */
+#define OMAP_TIMER_CTRL_GPOCFG         (1 << 14)
+#define OMAP_TIMER_CTRL_CAPTMODE       (1 << 13)
+#define OMAP_TIMER_CTRL_PT             (1 << 12)
+#define OMAP_TIMER_CTRL_TCM_LOWTOHIGH  (0x1 << 8)
+#define OMAP_TIMER_CTRL_TCM_HIGHTOLOW  (0x2 << 8)
+#define OMAP_TIMER_CTRL_TCM_BOTHEDGES  (0x3 << 8)
+#define OMAP_TIMER_CTRL_SCPWM          (1 << 7)
+#define OMAP_TIMER_CTRL_CE             (1 << 6)        /* compare enable */
+#define OMAP_TIMER_CTRL_PRE            (1 << 5)        /* prescaler enable */
+#define OMAP_TIMER_CTRL_PTV_SHIFT      2               /* how much to shift the prescaler value */
+#define OMAP_TIMER_CTRL_AR             (1 << 1)        /* auto-reload enable */
+#define OMAP_TIMER_CTRL_ST             (1 << 0)        /* start timer */
+
+struct omap_dm_timer {
+       unsigned long phys_base;
+       int irq;
+#ifdef CONFIG_ARCH_OMAP2
+       struct clk *iclk, *fclk;
+#endif
+       void __iomem *io_base;
+       unsigned reserved:1;
+};
 
-static struct dmtimer_info_struct {
-       struct list_head        unused_timers;
-       struct list_head        reserved_timers;
-} dm_timer_info;
+#ifdef CONFIG_ARCH_OMAP1
 
 static struct omap_dm_timer dm_timers[] = {
-       { .base=0xfffb1400, .irq=INT_1610_GPTIMER1 },
-       { .base=0xfffb1c00, .irq=INT_1610_GPTIMER2 },
-       { .base=0xfffb2400, .irq=INT_1610_GPTIMER3 },
-       { .base=0xfffb2c00, .irq=INT_1610_GPTIMER4 },
-       { .base=0xfffb3400, .irq=INT_1610_GPTIMER5 },
-       { .base=0xfffb3c00, .irq=INT_1610_GPTIMER6 },
-       { .base=0xfffb4400, .irq=INT_1610_GPTIMER7 },
-       { .base=0xfffb4c00, .irq=INT_1610_GPTIMER8 },
-       { .base=0x0 },
+       { .phys_base = 0xfffb1400, .irq = INT_1610_GPTIMER1 },
+       { .phys_base = 0xfffb1c00, .irq = INT_1610_GPTIMER2 },
+       { .phys_base = 0xfffb2400, .irq = INT_1610_GPTIMER3 },
+       { .phys_base = 0xfffb2c00, .irq = INT_1610_GPTIMER4 },
+       { .phys_base = 0xfffb3400, .irq = INT_1610_GPTIMER5 },
+       { .phys_base = 0xfffb3c00, .irq = INT_1610_GPTIMER6 },
+       { .phys_base = 0xfffb4400, .irq = INT_1610_GPTIMER7 },
+       { .phys_base = 0xfffb4c00, .irq = INT_1610_GPTIMER8 },
 };
 
+#elif defined(CONFIG_ARCH_OMAP2)
+
+static struct omap_dm_timer dm_timers[] = {
+       { .phys_base = 0x48028000, .irq = INT_24XX_GPTIMER1 },
+       { .phys_base = 0x4802a000, .irq = INT_24XX_GPTIMER2 },
+       { .phys_base = 0x48078000, .irq = INT_24XX_GPTIMER3 },
+       { .phys_base = 0x4807a000, .irq = INT_24XX_GPTIMER4 },
+       { .phys_base = 0x4807c000, .irq = INT_24XX_GPTIMER5 },
+       { .phys_base = 0x4807e000, .irq = INT_24XX_GPTIMER6 },
+       { .phys_base = 0x48080000, .irq = INT_24XX_GPTIMER7 },
+       { .phys_base = 0x48082000, .irq = INT_24XX_GPTIMER8 },
+       { .phys_base = 0x48084000, .irq = INT_24XX_GPTIMER9 },
+       { .phys_base = 0x48086000, .irq = INT_24XX_GPTIMER10 },
+       { .phys_base = 0x48088000, .irq = INT_24XX_GPTIMER11 },
+       { .phys_base = 0x4808a000, .irq = INT_24XX_GPTIMER12 },
+};
+
+static const char *dm_source_names[] = {
+       "sys_ck",
+       "func_32k_ck",
+       "alt_ck"
+};
 
+static struct clk *dm_source_clocks[3];
+
+#else
+
+#error OMAP architecture not supported!
+
+#endif
+
+static const int dm_timer_count = ARRAY_SIZE(dm_timers);
 static spinlock_t dm_timer_lock;
 
+static inline u32 omap_dm_timer_read_reg(struct omap_dm_timer *timer, int reg)
+{
+       return readl(timer->io_base + reg);
+}
 
-inline void omap_dm_timer_write_reg(struct omap_dm_timer *timer, int reg, u32 value)
+static void omap_dm_timer_write_reg(struct omap_dm_timer *timer, int reg, u32 value)
 {
-       omap_writel(value, timer->base + reg);
+       writel(value, timer->io_base + reg);
        while (omap_dm_timer_read_reg(timer, OMAP_TIMER_WRITE_PEND_REG))
                ;
 }
 
-u32 omap_dm_timer_read_reg(struct omap_dm_timer *timer, int reg)
+static void omap_dm_timer_wait_for_reset(struct omap_dm_timer *timer)
 {
-       return omap_readl(timer->base + reg);
+       int c;
+
+       c = 0;
+       while (!(omap_dm_timer_read_reg(timer, OMAP_TIMER_SYS_STAT_REG) & 1)) {
+               c++;
+               if (c > 100000) {
+                       printk(KERN_ERR "Timer failed to reset\n");
+                       return;
+               }
+       }
 }
 
-int omap_dm_timers_active(void)
+static void omap_dm_timer_reset(struct omap_dm_timer *timer)
+{
+       u32 l;
+
+       if (timer != &dm_timers[0]) {
+               omap_dm_timer_write_reg(timer, OMAP_TIMER_IF_CTRL_REG, 0x06);
+               omap_dm_timer_wait_for_reset(timer);
+       }
+       omap_dm_timer_set_source(timer, OMAP_TIMER_SRC_SYS_CLK);
+
+       /* Set to smart-idle mode */
+       l = omap_dm_timer_read_reg(timer, OMAP_TIMER_OCP_CFG_REG);
+       l |= 0x02 << 3;
+       omap_dm_timer_write_reg(timer, OMAP_TIMER_OCP_CFG_REG, l);
+}
+
+static void omap_dm_timer_prepare(struct omap_dm_timer *timer)
+{
+#ifdef CONFIG_ARCH_OMAP2
+       clk_enable(timer->iclk);
+       clk_enable(timer->fclk);
+#endif
+       omap_dm_timer_reset(timer);
+}
+
+struct omap_dm_timer *omap_dm_timer_request(void)
+{
+       struct omap_dm_timer *timer = NULL;
+       unsigned long flags;
+       int i;
+
+       spin_lock_irqsave(&dm_timer_lock, flags);
+       for (i = 0; i < dm_timer_count; i++) {
+               if (dm_timers[i].reserved)
+                       continue;
+
+               timer = &dm_timers[i];
+               timer->reserved = 1;
+               break;
+       }
+       spin_unlock_irqrestore(&dm_timer_lock, flags);
+
+       if (timer != NULL)
+               omap_dm_timer_prepare(timer);
+
+       return timer;
+}
+
+struct omap_dm_timer *omap_dm_timer_request_specific(int id)
 {
        struct omap_dm_timer *timer;
+       unsigned long flags;
 
-       for (timer = &dm_timers[0]; timer->base; ++timer)
-               if (omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG) &
-                   OMAP_TIMER_CTRL_ST)
-                       return 1;
+       spin_lock_irqsave(&dm_timer_lock, flags);
+       if (id <= 0 || id > dm_timer_count || dm_timers[id-1].reserved) {
+               spin_unlock_irqrestore(&dm_timer_lock, flags);
+               printk("BUG: warning at %s:%d/%s(): unable to get timer %d\n",
+                      __FILE__, __LINE__, __FUNCTION__, id);
+               dump_stack();
+               return NULL;
+       }
 
-       return 0;
+       timer = &dm_timers[id-1];
+       timer->reserved = 1;
+       spin_unlock_irqrestore(&dm_timer_lock, flags);
+
+       omap_dm_timer_prepare(timer);
+
+       return timer;
 }
 
+void omap_dm_timer_free(struct omap_dm_timer *timer)
+{
+       omap_dm_timer_reset(timer);
+#ifdef CONFIG_ARCH_OMAP2
+       clk_disable(timer->iclk);
+       clk_disable(timer->fclk);
+#endif
+       WARN_ON(!timer->reserved);
+       timer->reserved = 0;
+}
+
+int omap_dm_timer_get_irq(struct omap_dm_timer *timer)
+{
+       return timer->irq;
+}
+
+#if defined(CONFIG_ARCH_OMAP1)
+
+struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer)
+{
+       BUG();
+}
 
 /**
  * omap_dm_timer_modify_idlect_mask - Check if any running timers use ARMXOR
@@ -103,184 +250,229 @@ int omap_dm_timers_active(void)
  */
 __u32 omap_dm_timer_modify_idlect_mask(__u32 inputmask)
 {
-       int n;
+       int i;
 
        /* If ARMXOR cannot be idled this function call is unnecessary */
        if (!(inputmask & (1 << 1)))
                return inputmask;
 
        /* If any active timer is using ARMXOR return modified mask */
-       for (n = 0; dm_timers[n].base; ++n)
-               if (omap_dm_timer_read_reg(&dm_timers[n], OMAP_TIMER_CTRL_REG)&
-                   OMAP_TIMER_CTRL_ST) {
-                       if (((omap_readl(MOD_CONF_CTRL_1)>>(n*2)) & 0x03) == 0)
+       for (i = 0; i < dm_timer_count; i++) {
+               u32 l;
+
+               l = omap_dm_timer_read_reg(&dm_timers[i], OMAP_TIMER_CTRL_REG);
+               if (l & OMAP_TIMER_CTRL_ST) {
+                       if (((omap_readl(MOD_CONF_CTRL_1) >> (i * 2)) & 0x03) == 0)
                                inputmask &= ~(1 << 1);
                        else
                                inputmask &= ~(1 << 2);
                }
+       }
 
        return inputmask;
 }
 
+#elif defined(CONFIG_ARCH_OMAP2)
 
-void omap_dm_timer_set_source(struct omap_dm_timer *timer, int source)
+struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer)
 {
-       int n = (timer - dm_timers) << 1;
-       u32 l;
+        return timer->fclk;
+}
 
-       l = omap_readl(MOD_CONF_CTRL_1) & ~(0x03 << n);
-       l |= source << n;
-       omap_writel(l, MOD_CONF_CTRL_1);
+__u32 omap_dm_timer_modify_idlect_mask(__u32 inputmask)
+{
+       BUG();
 }
 
+#endif
 
-static void omap_dm_timer_reset(struct omap_dm_timer *timer)
+void omap_dm_timer_trigger(struct omap_dm_timer *timer)
 {
-       /* Reset and set posted mode */
-       omap_dm_timer_write_reg(timer, OMAP_TIMER_IF_CTRL_REG, 0x06);
-       omap_dm_timer_write_reg(timer, OMAP_TIMER_OCP_CFG_REG, 0x02);
-
-       omap_dm_timer_set_source(timer, OMAP_TIMER_SRC_ARMXOR);
+       omap_dm_timer_write_reg(timer, OMAP_TIMER_TRIGGER_REG, 0);
 }
 
+void omap_dm_timer_start(struct omap_dm_timer *timer)
+{
+       u32 l;
 
+       l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
+       if (!(l & OMAP_TIMER_CTRL_ST)) {
+               l |= OMAP_TIMER_CTRL_ST;
+               omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l);
+       }
+}
 
-struct omap_dm_timer * omap_dm_timer_request(void)
+void omap_dm_timer_stop(struct omap_dm_timer *timer)
 {
-       struct omap_dm_timer *timer = NULL;
-       unsigned long flags;
+       u32 l;
 
-       spin_lock_irqsave(&dm_timer_lock, flags);
-       if (!list_empty(&dm_timer_info.unused_timers)) {
-               timer = (struct omap_dm_timer *)
-                               dm_timer_info.unused_timers.next;
-               list_move_tail((struct list_head *)timer,
-                               &dm_timer_info.reserved_timers);
+       l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
+       if (l & OMAP_TIMER_CTRL_ST) {
+               l &= ~0x1;
+               omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l);
        }
-       spin_unlock_irqrestore(&dm_timer_lock, flags);
-
-       return timer;
 }
 
+#ifdef CONFIG_ARCH_OMAP1
 
-void omap_dm_timer_free(struct omap_dm_timer *timer)
+void omap_dm_timer_set_source(struct omap_dm_timer *timer, int source)
 {
-       unsigned long flags;
-
-       omap_dm_timer_reset(timer);
+       int n = (timer - dm_timers) << 1;
+       u32 l;
 
-       spin_lock_irqsave(&dm_timer_lock, flags);
-       list_move_tail((struct list_head *)timer, &dm_timer_info.unused_timers);
-       spin_unlock_irqrestore(&dm_timer_lock, flags);
+       l = omap_readl(MOD_CONF_CTRL_1) & ~(0x03 << n);
+       l |= source << n;
+       omap_writel(l, MOD_CONF_CTRL_1);
 }
 
-void omap_dm_timer_set_int_enable(struct omap_dm_timer *timer,
-                               unsigned int value)
-{
-       omap_dm_timer_write_reg(timer, OMAP_TIMER_INT_EN_REG, value);
-}
+#else
 
-unsigned int omap_dm_timer_read_status(struct omap_dm_timer *timer)
+void omap_dm_timer_set_source(struct omap_dm_timer *timer, int source)
 {
-       return omap_dm_timer_read_reg(timer, OMAP_TIMER_STAT_REG);
-}
+       if (source < 0 || source >= 3)
+               return;
 
-void omap_dm_timer_write_status(struct omap_dm_timer *timer, unsigned int value)
-{
-       omap_dm_timer_write_reg(timer, OMAP_TIMER_STAT_REG, value);
+       clk_disable(timer->fclk);
+       clk_set_parent(timer->fclk, dm_source_clocks[source]);
+       clk_enable(timer->fclk);
+
+       /* When the functional clock disappears, too quick writes seem to
+        * cause an abort. */
+       __delay(15000);
 }
 
-void omap_dm_timer_enable_autoreload(struct omap_dm_timer *timer)
+#endif
+
+void omap_dm_timer_set_load(struct omap_dm_timer *timer, int autoreload,
+                           unsigned int load)
 {
        u32 l;
+
        l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
-       l |= OMAP_TIMER_CTRL_AR;
+       if (autoreload)
+               l |= OMAP_TIMER_CTRL_AR;
+       else
+               l &= ~OMAP_TIMER_CTRL_AR;
        omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l);
+       omap_dm_timer_write_reg(timer, OMAP_TIMER_LOAD_REG, load);
+       omap_dm_timer_write_reg(timer, OMAP_TIMER_TRIGGER_REG, 0);
 }
 
-void omap_dm_timer_trigger(struct omap_dm_timer *timer)
-{
-       omap_dm_timer_write_reg(timer, OMAP_TIMER_TRIGGER_REG, 1);
-}
-
-void omap_dm_timer_set_trigger(struct omap_dm_timer *timer, unsigned int value)
+void omap_dm_timer_set_match(struct omap_dm_timer *timer, int enable,
+                            unsigned int match)
 {
        u32 l;
 
        l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
-       l |= value & 0x3;
+       if (enable)
+               l |= OMAP_TIMER_CTRL_CE;
+       else
+               l &= ~OMAP_TIMER_CTRL_CE;
        omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l);
+       omap_dm_timer_write_reg(timer, OMAP_TIMER_MATCH_REG, match);
 }
 
-void omap_dm_timer_start(struct omap_dm_timer *timer)
+
+void omap_dm_timer_set_pwm(struct omap_dm_timer *timer, int def_on,
+                          int toggle, int trigger)
 {
        u32 l;
 
        l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
-       l |= OMAP_TIMER_CTRL_ST;
+       l &= ~(OMAP_TIMER_CTRL_GPOCFG | OMAP_TIMER_CTRL_SCPWM |
+              OMAP_TIMER_CTRL_PT | (0x03 << 10));
+       if (def_on)
+               l |= OMAP_TIMER_CTRL_SCPWM;
+       if (toggle)
+               l |= OMAP_TIMER_CTRL_PT;
+       l |= trigger << 10;
        omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l);
 }
 
-void omap_dm_timer_stop(struct omap_dm_timer *timer)
+void omap_dm_timer_set_prescaler(struct omap_dm_timer *timer, int prescaler)
 {
        u32 l;
 
        l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
-       l &= ~0x1;
+       l &= ~(OMAP_TIMER_CTRL_PRE | (0x07 << 2));
+       if (prescaler >= 0x00 && prescaler <= 0x07) {
+               l |= OMAP_TIMER_CTRL_PRE;
+               l |= prescaler << 2;
+       }
        omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l);
 }
 
-unsigned int omap_dm_timer_read_counter(struct omap_dm_timer *timer)
+void omap_dm_timer_set_int_enable(struct omap_dm_timer *timer,
+                                 unsigned int value)
 {
-       return omap_dm_timer_read_reg(timer, OMAP_TIMER_COUNTER_REG);
+       omap_dm_timer_write_reg(timer, OMAP_TIMER_INT_EN_REG, value);
 }
 
-void omap_dm_timer_reset_counter(struct omap_dm_timer *timer)
+unsigned int omap_dm_timer_read_status(struct omap_dm_timer *timer)
 {
-       omap_dm_timer_write_reg(timer, OMAP_TIMER_COUNTER_REG, 0);
+       return omap_dm_timer_read_reg(timer, OMAP_TIMER_STAT_REG);
 }
 
-void omap_dm_timer_set_load(struct omap_dm_timer *timer, unsigned int load)
+void omap_dm_timer_write_status(struct omap_dm_timer *timer, unsigned int value)
 {
-       omap_dm_timer_write_reg(timer, OMAP_TIMER_LOAD_REG, load);
+       omap_dm_timer_write_reg(timer, OMAP_TIMER_STAT_REG, value);
 }
 
-void omap_dm_timer_set_match(struct omap_dm_timer *timer, unsigned int match)
+unsigned int omap_dm_timer_read_counter(struct omap_dm_timer *timer)
 {
-       omap_dm_timer_write_reg(timer, OMAP_TIMER_MATCH_REG, match);
+       return omap_dm_timer_read_reg(timer, OMAP_TIMER_COUNTER_REG);
 }
 
-void omap_dm_timer_enable_compare(struct omap_dm_timer *timer)
+void omap_dm_timer_write_counter(struct omap_dm_timer *timer, unsigned int value)
 {
-       u32 l;
-
-       l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
-       l |= OMAP_TIMER_CTRL_CE;
-       omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l);
+       return omap_dm_timer_write_reg(timer, OMAP_TIMER_COUNTER_REG, value);
 }
 
+int omap_dm_timers_active(void)
+{
+       int i;
+
+       for (i = 0; i < dm_timer_count; i++) {
+               struct omap_dm_timer *timer;
+
+               timer = &dm_timers[i];
+               if (omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG) &
+                   OMAP_TIMER_CTRL_ST)
+                       return 1;
+       }
+       return 0;
+}
 
-static inline void __dm_timer_init(void)
+int omap_dm_timer_init(void)
 {
        struct omap_dm_timer *timer;
+       int i;
+
+       if (!(cpu_is_omap16xx() || cpu_is_omap24xx()))
+               return -ENODEV;
 
        spin_lock_init(&dm_timer_lock);
-       INIT_LIST_HEAD(&dm_timer_info.unused_timers);
-       INIT_LIST_HEAD(&dm_timer_info.reserved_timers);
-
-       timer = &dm_timers[0];
-       while (timer->base) {
-               list_add_tail((struct list_head *)timer, &dm_timer_info.unused_timers);
-               omap_dm_timer_reset(timer);
-               timer++;
+#ifdef CONFIG_ARCH_OMAP2
+       for (i = 0; i < ARRAY_SIZE(dm_source_names); i++) {
+               dm_source_clocks[i] = clk_get(NULL, dm_source_names[i]);
+               BUG_ON(dm_source_clocks[i] == NULL);
+       }
+#endif
+
+       for (i = 0; i < dm_timer_count; i++) {
+#ifdef CONFIG_ARCH_OMAP2
+               char clk_name[16];
+#endif
+
+               timer = &dm_timers[i];
+               timer->io_base = (void __iomem *) io_p2v(timer->phys_base);
+#ifdef CONFIG_ARCH_OMAP2
+               sprintf(clk_name, "gpt%d_ick", i + 1);
+               timer->iclk = clk_get(NULL, clk_name);
+               sprintf(clk_name, "gpt%d_fck", i + 1);
+               timer->fclk = clk_get(NULL, clk_name);
+#endif
        }
-}
 
-static int __init omap_dm_timer_init(void)
-{
-       if (cpu_is_omap16xx())
-               __dm_timer_init();
        return 0;
 }
-
-arch_initcall(omap_dm_timer_init);
index 305e9b990b7106666956f82be945a71bf97bb93d..56acb8720f789ad7047daef09ba4ec6717e70d5b 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index d3c8ea7eecfd216846d5b2f94161d721e17b2d20..fec7970e564d443be786d21635ce464213f1d51e 100644 (file)
@@ -11,7 +11,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/sched.h>
@@ -537,6 +536,49 @@ static inline void _clear_gpio_irqstatus(struct gpio_bank *bank, int gpio)
        _clear_gpio_irqbank(bank, 1 << get_gpio_index(gpio));
 }
 
+static u32 _get_gpio_irqbank_mask(struct gpio_bank *bank)
+{
+       void __iomem *reg = bank->base;
+       int inv = 0;
+       u32 l;
+       u32 mask;
+
+       switch (bank->method) {
+       case METHOD_MPUIO:
+               reg += OMAP_MPUIO_GPIO_MASKIT;
+               mask = 0xffff;
+               inv = 1;
+               break;
+       case METHOD_GPIO_1510:
+               reg += OMAP1510_GPIO_INT_MASK;
+               mask = 0xffff;
+               inv = 1;
+               break;
+       case METHOD_GPIO_1610:
+               reg += OMAP1610_GPIO_IRQENABLE1;
+               mask = 0xffff;
+               break;
+       case METHOD_GPIO_730:
+               reg += OMAP730_GPIO_INT_MASK;
+               mask = 0xffffffff;
+               inv = 1;
+               break;
+       case METHOD_GPIO_24XX:
+               reg += OMAP24XX_GPIO_IRQENABLE1;
+               mask = 0xffffffff;
+               break;
+       default:
+               BUG();
+               return 0;
+       }
+
+       l = __raw_readl(reg);
+       if (inv)
+               l = ~l;
+       l &= mask;
+       return l;
+}
+
 static void _enable_gpio_irqbank(struct gpio_bank *bank, int gpio_mask, int enable)
 {
        void __iomem *reg = bank->base;
@@ -736,10 +778,12 @@ static void gpio_irq_handler(unsigned int irq, struct irqdesc *desc,
        u32 isr;
        unsigned int gpio_irq;
        struct gpio_bank *bank;
+       u32 retrigger = 0;
+       int unmasked = 0;
 
        desc->chip->ack(irq);
 
-       bank = (struct gpio_bank *) desc->data;
+       bank = get_irq_data(irq);
        if (bank->method == METHOD_MPUIO)
                isr_reg = bank->base + OMAP_MPUIO_GPIO_INT;
 #ifdef CONFIG_ARCH_OMAP15XX
@@ -760,18 +804,22 @@ static void gpio_irq_handler(unsigned int irq, struct irqdesc *desc,
 #endif
        while(1) {
                u32 isr_saved, level_mask = 0;
+               u32 enabled;
 
-               isr_saved = isr = __raw_readl(isr_reg);
+               enabled = _get_gpio_irqbank_mask(bank);
+               isr_saved = isr = __raw_readl(isr_reg) & enabled;
 
                if (cpu_is_omap15xx() && (bank->method == METHOD_MPUIO))
                        isr &= 0x0000ffff;
 
-               if (cpu_is_omap24xx())
+               if (cpu_is_omap24xx()) {
                        level_mask =
                                __raw_readl(bank->base +
                                        OMAP24XX_GPIO_LEVELDETECT0) |
                                __raw_readl(bank->base +
                                        OMAP24XX_GPIO_LEVELDETECT1);
+                       level_mask &= enabled;
+               }
 
                /* clear edge sensitive interrupts before handler(s) are
                called so that we don't miss any interrupt occurred while
@@ -782,19 +830,55 @@ static void gpio_irq_handler(unsigned int irq, struct irqdesc *desc,
 
                /* if there is only edge sensitive GPIO pin interrupts
                configured, we could unmask GPIO bank interrupt immediately */
-               if (!level_mask)
+               if (!level_mask && !unmasked) {
+                       unmasked = 1;
                        desc->chip->unmask(irq);
+               }
 
+               isr |= retrigger;
+               retrigger = 0;
                if (!isr)
                        break;
 
                gpio_irq = bank->virtual_irq_start;
                for (; isr != 0; isr >>= 1, gpio_irq++) {
                        struct irqdesc *d;
+                       int irq_mask;
                        if (!(isr & 1))
                                continue;
                        d = irq_desc + gpio_irq;
+                       /* Don't run the handler if it's already running
+                        * or was disabled lazely.
+                        */
+                       if (unlikely((d->depth ||
+                                     (d->status & IRQ_INPROGRESS)))) {
+                               irq_mask = 1 <<
+                                       (gpio_irq - bank->virtual_irq_start);
+                               /* The unmasking will be done by
+                                * enable_irq in case it is disabled or
+                                * after returning from the handler if
+                                * it's already running.
+                                */
+                               _enable_gpio_irqbank(bank, irq_mask, 0);
+                               if (!d->depth) {
+                                       /* Level triggered interrupts
+                                        * won't ever be reentered
+                                        */
+                                       BUG_ON(level_mask & irq_mask);
+                                       d->status |= IRQ_PENDING;
+                               }
+                               continue;
+                       }
+
                        desc_handle_irq(gpio_irq, d, regs);
+
+                       if (unlikely((d->status & IRQ_PENDING) && !d->depth)) {
+                               irq_mask = 1 <<
+                                       (gpio_irq - bank->virtual_irq_start);
+                               d->status &= ~IRQ_PENDING;
+                               _enable_gpio_irqbank(bank, irq_mask, 1);
+                               retrigger |= irq_mask;
+                       }
                }
 
                if (cpu_is_omap24xx()) {
@@ -804,13 +888,14 @@ static void gpio_irq_handler(unsigned int irq, struct irqdesc *desc,
                        _enable_gpio_irqbank(bank, isr_saved & level_mask, 1);
                }
 
-               /* if bank has any level sensitive GPIO pin interrupt
-               configured, we must unmask the bank interrupt only after
-               handler(s) are executed in order to avoid spurious bank
-               interrupt */
-               if (level_mask)
-                       desc->chip->unmask(irq);
        }
+       /* if bank has any level sensitive GPIO pin interrupt
+       configured, we must unmask the bank interrupt only after
+       handler(s) are executed in order to avoid spurious bank
+       interrupt */
+       if (!unmasked)
+               desc->chip->unmask(irq);
+
 }
 
 static void gpio_ack_irq(unsigned int irq)
index 8c1c016aa68980db04bdcb1704d9df58308cf63c..042105ac30b8ea5058861343058d62112e44b288 100644 (file)
@@ -22,7 +22,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  *
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
index 37792d43738b1981d78541f05a56a390ec5f726b..b5d307026c82da0d3005184aad1bc696b019f1dd 100644 (file)
@@ -23,7 +23,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/errno.h>
index 1a24e2c10714e498942cdaae1d3386af6f9f7b37..04b4102727a8f6921604c8a1355de270faa0fc40 100644 (file)
@@ -580,7 +580,7 @@ static irqreturn_t  omap_wakeup_interrupt(int  irq, void *  dev,
 
 static struct irqaction omap_wakeup_irq = {
        .name           = "peripheral wakeup",
-       .flags          = SA_INTERRUPT,
+       .flags          = IRQF_DISABLED,
        .handler        = omap_wakeup_interrupt
 };
 
index 66414cc8e6e38650da20a9447eaa34fd09b28b21..85cffe2c6266366d65a4ca8a963f729123879785 100644 (file)
@@ -8,7 +8,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/assembler.h>
 #include <asm/arch/io.h>
index b7bf09b1b412c4b6e34a095b163713ba14bd4720..e75718301b0f460bc59ea9912905a5c0a34c6dc8 100644 (file)
@@ -11,7 +11,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -158,14 +157,12 @@ static struct map_desc omap_sram_io_desc[] __initdata = {
        {       /* .length gets filled in at runtime */
                .virtual        = OMAP1_SRAM_VA,
                .pfn            = __phys_to_pfn(OMAP1_SRAM_PA),
-               .type           = MT_DEVICE
+               .type           = MT_MEMORY
        }
 };
 
 /*
- * In order to use last 2kB of SRAM on 1611b, we must round the size
- * up to multiple of PAGE_SIZE. We cannot use ioremap for SRAM, as
- * clock init needs SRAM early.
+ * Note that we cannot use ioremap for SRAM, as clock init needs SRAM early.
  */
 void __init omap_map_sram(void)
 {
@@ -185,8 +182,7 @@ void __init omap_map_sram(void)
                omap_sram_io_desc[0].pfn = __phys_to_pfn(base);
        }
 
-       omap_sram_io_desc[0].length = (omap_sram_size + PAGE_SIZE-1)/PAGE_SIZE;
-       omap_sram_io_desc[0].length *= PAGE_SIZE;
+       omap_sram_io_desc[0].length = 1024 * 1024;      /* Use section desc */
        iotable_init(omap_sram_io_desc, ARRAY_SIZE(omap_sram_io_desc));
 
        printk(KERN_INFO "SRAM: Mapped pa 0x%08lx to va 0x%08lx size: 0x%lx\n",
index 3461a6c9665ccd47ec7f6aec82133d0443f276c4..281ecc7fcdfcc995e90fe94f3e9c1b2b345ed2e1 100644 (file)
@@ -7,6 +7,7 @@
  * Partial timer rewrite and additional dynamic tick timer support by
  * Tony Lindgen <tony@atomide.com> and
  * Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
+ * OMAP Dual-mode timer framework support by Timo Teras
  *
  * MPU timer code based on the older MPU timer code for OMAP
  * Copyright (C) 2000 RidgeRun, Inc.
@@ -33,7 +34,6 @@
  * 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/delay.h>
@@ -50,6 +50,7 @@
 #include <asm/irq.h>
 #include <asm/mach/irq.h>
 #include <asm/mach/time.h>
+#include <asm/arch/dmtimer.h>
 
 struct sys_timer omap_timer;
 
@@ -79,18 +80,6 @@ struct sys_timer omap_timer;
 #define OMAP1_32K_TIMER_TVR            0x00
 #define OMAP1_32K_TIMER_TCR            0x04
 
-/* 24xx specific defines */
-#define OMAP2_GP_TIMER_BASE            0x48028000
-#define CM_CLKSEL_WKUP                 0x48008440
-#define GP_TIMER_TIDR                  0x00
-#define GP_TIMER_TISR                  0x18
-#define GP_TIMER_TIER                  0x1c
-#define GP_TIMER_TCLR                  0x24
-#define GP_TIMER_TCRR                  0x28
-#define GP_TIMER_TLDR                  0x2c
-#define GP_TIMER_TTGR                  0x30
-#define GP_TIMER_TSICR                 0x40
-
 #define OMAP_32K_TICKS_PER_HZ          (32768 / HZ)
 
 /*
@@ -102,54 +91,62 @@ struct sys_timer omap_timer;
 #define JIFFIES_TO_HW_TICKS(nr_jiffies, clock_rate)                    \
                                (((nr_jiffies) * (clock_rate)) / HZ)
 
+#if defined(CONFIG_ARCH_OMAP1)
+
 static inline void omap_32k_timer_write(int val, int reg)
 {
-       if (cpu_class_is_omap1())
-               omap_writew(val, OMAP1_32K_TIMER_BASE + reg);
-
-       if (cpu_is_omap24xx())
-               omap_writel(val, OMAP2_GP_TIMER_BASE + reg);
+       omap_writew(val, OMAP1_32K_TIMER_BASE + reg);
 }
 
 static inline unsigned long omap_32k_timer_read(int reg)
 {
-       if (cpu_class_is_omap1())
-               return omap_readl(OMAP1_32K_TIMER_BASE + reg) & 0xffffff;
+       return omap_readl(OMAP1_32K_TIMER_BASE + reg) & 0xffffff;
+}
 
-       if (cpu_is_omap24xx())
-               return omap_readl(OMAP2_GP_TIMER_BASE + reg);
+static inline void omap_32k_timer_start(unsigned long load_val)
+{
+       omap_32k_timer_write(load_val, OMAP1_32K_TIMER_TVR);
+       omap_32k_timer_write(0x0f, OMAP1_32K_TIMER_CR);
 }
 
-/*
- * The 32KHz synchronized timer is an additional timer on 16xx.
- * It is always running.
- */
-static inline unsigned long omap_32k_sync_timer_read(void)
+static inline void omap_32k_timer_stop(void)
 {
-       return omap_readl(TIMER_32K_SYNCHRONIZED);
+       omap_32k_timer_write(0x0, OMAP1_32K_TIMER_CR);
 }
 
+#define omap_32k_timer_ack_irq()
+
+#elif defined(CONFIG_ARCH_OMAP2)
+
+static struct omap_dm_timer *gptimer;
+
 static inline void omap_32k_timer_start(unsigned long load_val)
 {
-       if (cpu_class_is_omap1()) {
-               omap_32k_timer_write(load_val, OMAP1_32K_TIMER_TVR);
-               omap_32k_timer_write(0x0f, OMAP1_32K_TIMER_CR);
-       }
-
-       if (cpu_is_omap24xx()) {
-               omap_32k_timer_write(0xffffffff - load_val, GP_TIMER_TCRR);
-               omap_32k_timer_write((1 << 1), GP_TIMER_TIER);
-               omap_32k_timer_write((1 << 1) | 1, GP_TIMER_TCLR);
-       }
+       omap_dm_timer_set_load(gptimer, 1, 0xffffffff - load_val);
+       omap_dm_timer_set_int_enable(gptimer, OMAP_TIMER_INT_OVERFLOW);
+       omap_dm_timer_start(gptimer);
 }
 
 static inline void omap_32k_timer_stop(void)
 {
-       if (cpu_class_is_omap1())
-               omap_32k_timer_write(0x0, OMAP1_32K_TIMER_CR);
+       omap_dm_timer_stop(gptimer);
+}
 
-       if (cpu_is_omap24xx())
-               omap_32k_timer_write(0x0, GP_TIMER_TCLR);
+static inline void omap_32k_timer_ack_irq(void)
+{
+       u32 status = omap_dm_timer_read_status(gptimer);
+       omap_dm_timer_write_status(gptimer, status);
+}
+
+#endif
+
+/*
+ * The 32KHz synchronized timer is an additional timer on 16xx.
+ * It is always running.
+ */
+static inline unsigned long omap_32k_sync_timer_read(void)
+{
+       return omap_readl(TIMER_32K_SYNCHRONIZED);
 }
 
 /*
@@ -203,11 +200,7 @@ static irqreturn_t omap_32k_timer_interrupt(int irq, void *dev_id,
 
        write_seqlock_irqsave(&xtime_lock, flags);
 
-       if (cpu_is_omap24xx()) {
-               u32 status = omap_32k_timer_read(GP_TIMER_TISR);
-               omap_32k_timer_write(status, GP_TIMER_TISR);
-       }
-
+       omap_32k_timer_ack_irq();
        now = omap_32k_sync_timer_read();
 
        while ((signed long)(now - omap_32k_last_tick)
@@ -265,13 +258,10 @@ static struct dyn_tick_timer omap_dyn_tick_timer = {
 
 static struct irqaction omap_32k_timer_irq = {
        .name           = "32KHz timer",
-       .flags          = SA_INTERRUPT | SA_TIMER,
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
        .handler        = omap_32k_timer_interrupt,
 };
 
-static struct clk * gpt1_ick;
-static struct clk * gpt1_fck;
-
 static __init void omap_init_32k_timer(void)
 {
 #ifdef CONFIG_NO_IDLE_HZ
@@ -280,32 +270,22 @@ static __init void omap_init_32k_timer(void)
 
        if (cpu_class_is_omap1())
                setup_irq(INT_OS_TIMER, &omap_32k_timer_irq);
-       if (cpu_is_omap24xx())
-               setup_irq(37, &omap_32k_timer_irq);
        omap_timer.offset  = omap_32k_timer_gettimeoffset;
        omap_32k_last_tick = omap_32k_sync_timer_read();
 
+#ifdef CONFIG_ARCH_OMAP2
        /* REVISIT: Check 24xx TIOCP_CFG settings after idle works */
        if (cpu_is_omap24xx()) {
-               omap_32k_timer_write(0, GP_TIMER_TCLR);
-               omap_writel(0, CM_CLKSEL_WKUP);         /* 32KHz clock source */
-
-               gpt1_ick = clk_get(NULL, "gpt1_ick");
-               if (IS_ERR(gpt1_ick))
-                       printk(KERN_ERR "Could not get gpt1_ick\n");
-               else
-                       clk_enable(gpt1_ick);
-
-               gpt1_fck = clk_get(NULL, "gpt1_fck");
-               if (IS_ERR(gpt1_fck))
-                       printk(KERN_ERR "Could not get gpt1_fck\n");
-               else
-                       clk_enable(gpt1_fck);
-
-               mdelay(100);            /* Wait for clocks to stabilize */
-
-               omap_32k_timer_write(0x7, GP_TIMER_TISR);
+               gptimer = omap_dm_timer_request_specific(1);
+               BUG_ON(gptimer == NULL);
+
+               omap_dm_timer_set_source(gptimer, OMAP_TIMER_SRC_32_KHZ);
+               setup_irq(omap_dm_timer_get_irq(gptimer), &omap_32k_timer_irq);
+               omap_dm_timer_set_int_enable(gptimer,
+                       OMAP_TIMER_INT_CAPTURE | OMAP_TIMER_INT_OVERFLOW |
+                       OMAP_TIMER_INT_MATCH);
        }
+#endif
 
        omap_32k_timer_start(OMAP_32K_TIMER_TICK_PERIOD);
 }
@@ -317,6 +297,9 @@ static __init void omap_init_32k_timer(void)
  */
 static void __init omap_timer_init(void)
 {
+#ifdef CONFIG_OMAP_DM_TIMER
+       omap_dm_timer_init();
+#endif
        omap_init_32k_timer();
 }
 
index 00afc7a8c2ab036634392214358073235a4f4548..9b815327b6a58f2c23db3100a909fab29884ac5b 100644 (file)
@@ -20,7 +20,6 @@
 
 #undef DEBUG
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
index 2476f4c2e760c0e9e6236305bcd728d161952557..9d265d5e748cc8b7b77715fda22220f1912c4f4d 100644 (file)
@@ -9,7 +9,6 @@
  * published by the Free Software Foundation.
  */
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
index cf4ebf4c274d792882ddfd7159982ac51528cae6..c14fe918bc4cf5e0cfb8aec5871c95be1c761cb3 100644 (file)
@@ -79,7 +79,7 @@ config ARCH_A5K
         bool "A5000"
        select ARCH_MAY_HAVE_PC_FDC
         help
-          Say Y here to to support the Acorn A5000.
+          Say Y here to support the Acorn A5000.
 
          Linux can support the
           internal IDE disk and CD-ROM interface, serial and parallel port,
@@ -129,7 +129,7 @@ config ZBOOT_ROM_BSS
 config XIP_KERNEL
        bool "Execute In Place (XIP) kernel image"
        help
-         Select this option to create a kernel that can be programed into
+         Select this option to create a kernel that can be programmed into
          the OS ROMs.
 
 comment "At least one math emulation must be selected"
@@ -140,7 +140,7 @@ config FPE_NWFPE
          Say Y to include the NWFPE floating point emulator in the kernel.
          This is necessary to run most binaries. Linux does not currently
          support floating point hardware so you need to say Y here even if
-         your machine has an FPA or floating point co-processor podule.
+         your machine has an FPA or floating point co-processor module.
 
          It is also possible to say M to build the emulator as a module
          (nwfpe) or indeed to leave it out altogether. However, unless you
index 0307804a607082b1284cab0ac9a6bdadc6ff78de..2a2cda36d83b9f103c912681d6502c646d662c65 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.
  */
-#include <linux/config.h>
 #include <linux/linkage.h>
 
 /*
index 9d66c27f272415a47ae11ccbda61e2c462b4c552..07907b6ecb634126b116236e3a92fcba632d4ec1 100644 (file)
@@ -8,7 +8,6 @@
  * published by the Free Software Foundation.
  */
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/user.h>
 #include <linux/string.h>
index ac682d5fd0398cd67a96ac3b22410a40d74c959a..76d9d7d489a81cf8f32c535e711487bc40f81a09 100644 (file)
@@ -12,7 +12,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
 
index db0310db8998b66212ff3dd36ad70aafa55b0398..21e966ff0aa7ddc147ec88b2182b99e29614f369 100644 (file)
@@ -16,7 +16,6 @@
  *  the kernel for 5 years from now (2001). This will allow boot loaders
  *  to convert to the new struct tag way.
  */
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
index f2278aadac8a28638312039ff3f6cd05cd4db640..047d0a408b9deb25c10a9db2d32c144353ccf193 100644 (file)
@@ -24,7 +24,6 @@
  */
 #define ECARD_C
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
index a24272b61f302c5aefc96b7c868b0ae297d9cb4f..c4776c96be6b7dcd3d402670c6b412b8571a62b0 100644 (file)
@@ -36,7 +36,6 @@
  *      - enables FIQ.
  *  6. Goto 3
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/mm.h>
 #include <linux/mman.h>
index 8bfc62539ba676cc6676baa75a5c1b73b38ad220..93575e0e58fe0c7340be0d307f6e3186bad44096 100644 (file)
@@ -10,7 +10,6 @@
  *
  *  26-bit kernel startup code
  */
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/mach-types.h>
 
index 0934e6fba6062e2579f7bdbe836fff83cb2b87f7..d87d68b77d6678d97cbf2df175cca889b5e09123 100644 (file)
@@ -18,7 +18,6 @@
  *  IRQ's are in fact implemented a bit like signal handlers for the kernel.
  *  Naturally it's not a 1:1 relation, but there are similarities.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/ptrace.h>
 #include <linux/kernel_stat.h>
@@ -191,7 +190,7 @@ __do_irq(unsigned int irq, struct irqaction *action, struct pt_regs *regs)
        int ret;
 
        spin_unlock(&irq_controller_lock);
-       if (!(action->flags & SA_INTERRUPT))
+       if (!(action->flags & IRQF_DISABLED))
                local_irq_enable();
 
        status = 0;
@@ -202,7 +201,7 @@ __do_irq(unsigned int irq, struct irqaction *action, struct pt_regs *regs)
                action = action->next;
        } while (action);
 
-       if (status & SA_SAMPLE_RANDOM)
+       if (status & IRQF_SAMPLE_RANDOM)
                add_interrupt_randomness(irq);
 
        spin_lock_irq(&irq_controller_lock);
@@ -452,7 +451,7 @@ int setup_irq(unsigned int irq, struct irqaction *new)
         * so we have to be careful not to interfere with a
         * running system.
         */
-       if (new->flags & SA_SAMPLE_RANDOM) {
+       if (new->flags & IRQF_SAMPLE_RANDOM) {
                /*
                 * This function might sleep, we want to call it first,
                 * outside of the atomic block.
@@ -472,7 +471,7 @@ int setup_irq(unsigned int irq, struct irqaction *new)
        p = &desc->action;
        if ((old = *p) != NULL) {
                /* Can't share interrupts unless both agree to */
-               if (!(old->flags & new->flags & SA_SHIRQ)) {
+               if (!(old->flags & new->flags & IRQF_SHARED)) {
                        spin_unlock_irqrestore(&irq_controller_lock, flags);
                        return -EBUSY;
                }
@@ -527,11 +526,11 @@ int setup_irq(unsigned int irq, struct irqaction *new)
  *
  *     Flags:
  *
- *     SA_SHIRQ                Interrupt is shared
+ *     IRQF_SHARED             Interrupt is shared
  *
- *     SA_INTERRUPT            Disable local interrupts while processing
+ *     IRQF_DISABLED   Disable local interrupts while processing
  *
- *     SA_SAMPLE_RANDOM        The interrupt can be used for entropy
+ *     IRQF_SAMPLE_RANDOM      The interrupt can be used for entropy
  *
  */
 
@@ -543,7 +542,7 @@ int request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_
        struct irqaction *action;
 
        if (irq >= NR_IRQS || !irq_desc[irq].valid || !handler ||
-           (irq_flags & SA_SHIRQ && !dev_id))
+           (irq_flags & IRQF_SHARED && !dev_id))
                return -EINVAL;
 
        action = (struct irqaction *)kmalloc(sizeof(struct irqaction), GFP_KERNEL);
index 38630565917142c4b4bb2c5017141e71ecfb06cc..dcd81e62ff4e83f3c11b2a7c0f1b45d8da57c3fe 100644 (file)
@@ -11,7 +11,6 @@
  */
 #include <stdarg.h>
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index 282e24d793282324a4e4da8969d6cc2c5f2c11a9..9343889b27fe897cc647533287f9989f5ab65ce4 100644 (file)
@@ -9,7 +9,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
index 3023a53431ff240e09d66e8d024bef0fe922301f..5447a06db3facf3084473e3dde1f64adb9af000b 100644 (file)
@@ -13,7 +13,6 @@
  * published by the Free Software Foundation.
  */
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index 4eb329e3828a635bfc13789bd46ecf5754b68752..843c29fe9af5d1aaf6f78fb55dfcec35e33c97a4 100644 (file)
@@ -8,7 +8,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/stddef.h>
 #include <linux/ioport.h>
index 2a48c12100c0144039a00b3182c06c057ebc8c3a..6a8ef8da6dab07000467c98fbd7ea95a2617dd10 100644 (file)
@@ -10,7 +10,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
index 335525339ad6f4e107689ca26d047eb7b4a89330..db63d75d0715927bda8d6379a63dcdb8dd224822 100644 (file)
@@ -18,7 +18,6 @@
  *              "A Kernel Model for Precision Timekeeping" by Dave Mills
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
@@ -206,7 +205,7 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 static struct irqaction timer_irq = {
        .name   = "timer",
-       .flags  = SA_INTERRUPT,
+       .flags  = IRQF_DISABLED,
        .handler = timer_interrupt,
 };
 
index a79de041b50e5c9795b33fa02563eee185ff26cb..d594fb59e945514f63ab217b6f1ea1ac7dbefda3 100644 (file)
@@ -15,7 +15,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
index 811a6904801087f1f32d99f230c0e789d6f73c98..1fa39f02e07c765f1764ad3e271d9a46879634b8 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 
 #ifdef CONFIG_XIP_KERNEL
 
index d793fe4339fc75141a0003bddf7d494989aaee87..e27feb1e891d6abcb4dbaa69f182cdca01a73cf5 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.
  */
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/assembler.h>
                .text
index 261dd154c1a46aed180a54c551708c6d2e0198aa..a98eea74305ae23ee13059c5b48adb41baf9c5da 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.
  */
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/assembler.h>
 #include <asm/errno.h>
index 22d2c93aaf1a7d34f930e7f9a9034ecfb6a37cb0..cb56e943e006469cb99b38638e89e9b9276c6f66 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/kd.h>
 //#include <linux/kbd_ll.h>
 #include <linux/kbd_kern.h>
index b8f9518db8717cfd84343cfb8294b95e4c8bc775..0e29970b0e8a3603d616f504a6ba9683501acb2d 100644 (file)
@@ -39,7 +39,6 @@ Boston, MA 02111-1307, USA.  */
 #include <linux/linkage.h>
 #include <asm/assembler.h>
 #include <asm/hardware.h>
-#include <linux/config.h>
 
 #define RET    movs
 #define RETc(x)        mov##x##s
index cbc7c61d5b3208b152920b9d96d13b2de30d17c0..4402a5a1b78fbe2d9efc8fb294f5915a8269c130 100644 (file)
@@ -10,7 +10,6 @@
  *
  *  DMA functions specific to Archimedes and A5000 architecture
  */
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/init.h>
 
index 4361863f7ed2b2354c1d69efc0d608c8d218d5e7..a60d543edecc4f2b3d060f9089593fe5044752cd 100644 (file)
@@ -16,7 +16,6 @@
  *   08-09-2002 IM     Brought up to date for 2.5
  *   01-06-2003 JMA     Removed arc_fiq_chip
  */
-#include <linux/config.h>
 #include <linux/init.h>
 
 #include <asm/irq.h>
index 2d9f5b5a78d6b3c88981de9c506656293f445544..38e1958d9538ed778ea43f595a545c6893ef1fd1 100644 (file)
@@ -2,7 +2,6 @@
  *  linux/arch/arm26/mm/extable.c
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <asm/uaccess.h>
 
index bd6f2db608b76ecde7dce3e02c26d70c386e7cc6..761938b56679453d350adb663187b4d9b52399ac 100644 (file)
@@ -8,7 +8,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index 7da8a520567874d13f8f6ee619e56ac52d7e9317..562fac12eb95762dc3e7ed0f5b089a49e42b1690 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.
  */
-#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index 5258c6096fb9b5551da66d1fe5f3b43b07636e12..a8fad92eb44fa740e90492eda1b81c38f3e3cc35 100644 (file)
@@ -25,7 +25,6 @@
 
 #include <linux/module.h>
 #include <linux/version.h>
-#include <linux/config.h>
 
 /* XXX */
 #include <linux/errno.h>
index ef71aab46a32f9f6394d670edff2a89c5cceed3a..f971ddd60cc15c5a29ce3cf34bef9e4b6ae3ff6d 100644 (file)
@@ -22,7 +22,6 @@
 #ifndef __FPMODULE_H__
 #define __FPMODULE_H__
 
-#include <linux/config.h>
 
 #define REG_ORIG_R0    16
 #define REG_CPSR       15
index e73f44c998d92db7735fde9c8e827d282750bded..610bdb2375530265e3f8b9770f3e2265d9d52d32 100644 (file)
@@ -8,7 +8,6 @@
  *
  */
 
-#include <linux/config.h>
 #define ASSEMBLER_MACROS_ONLY
 #include <asm/arch/sv_addr_ag.h>
 
index 1b5e83f1f8461bce4f5211feee1cc83d862b7739..ffb8d21b2f83f16c8020aabc5c90177b8083fb6e 100644 (file)
@@ -20,7 +20,6 @@
 
 #define KERNEL_LOAD_ADR 0x40004000
 
-#include <linux/config.h>
 
 #include <linux/types.h>
 #include <asm/arch/svinto.h>
index addb2194de0f9a8c5ec00139d9b879c826b9c424..f223cc0c00bb0c8a277ce359d78a5ebf7c92db1e 100644 (file)
@@ -63,7 +63,6 @@
  * Copyright (C) 1999, 2000, 2001, 2002, 2003 Axis Communications AB
  */
 
-#include <linux/config.h>
 #define ASSEMBLER_MACROS_ONLY
 #include <asm/arch/sv_addr_ag.h>
 
index 264bf7afc9add4e3152f5ce1e964bd3e6d84e1a3..cbccd6316d3908ab12179b52be0bdf6fbd0cc74c 100644 (file)
@@ -6,7 +6,6 @@
  * 4004000 and after a timeout jump to it.
  */
 
-#include <linux/config.h>
 #define ASSEMBLER_MACROS_ONLY
 #include <asm/sv_addr_ag.h>
 
index 56b038c8d48202f916b1eb06fc217a8ecb66afd6..4fa81abab0c762f62c1a92f9884f9769ff6c4780 100644 (file)
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/slab.h>
 
index b100f26497c4e4b430d1cf8699d52ce43faffae5..3cf4f23de1d083b82007abfb5808928e0c77b2ee 100644 (file)
 *!
 *!***************************************************************************/
 
-#include <linux/config.h>
 
 #include <linux/fs.h>
 #include <linux/init.h>
index 512f16dec060be14328badcfb38a91d4852bd0a2..037582028560657a53c23cfca1d6801b220ff6d7 100644 (file)
@@ -93,7 +93,6 @@
 *!        (c) 1999 Axis Communications AB, Lund, Sweden
 *!*****************************************************************************/
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/fs.h>
index 09963fe299a7d4ea364c757144c72b5a1db01c2c..48fd801792d1dc2b79b7da8a7d9fd4744cf294d9 100644 (file)
  *
  */
 
-#include <linux/config.h>
 
 #include <linux/module.h>
 #include <linux/sched.h>
@@ -938,11 +937,11 @@ gpio_init(void)
         * in some tests.
         */  
        if (request_irq(TIMER0_IRQ_NBR, gpio_poll_timer_interrupt,
-                       SA_SHIRQ | SA_INTERRUPT,"gpio poll", NULL)) {
+                       IRQF_SHARED | IRQF_DISABLED,"gpio poll", NULL)) {
                printk(KERN_CRIT "err: timer0 irq for gpio\n");
        }
        if (request_irq(PA_IRQ_NBR, gpio_pa_interrupt,
-                       SA_SHIRQ | SA_INTERRUPT,"gpio PA", NULL)) {
+                       IRQF_SHARED | IRQF_DISABLED,"gpio PA", NULL)) {
                printk(KERN_CRIT "err: PA irq for gpio\n");
        }
        
index b38267d60d30fe948d9de2d14c114ebf5da51d36..6114596c3b3369298546cc355d8b8c52bc8a6517 100644 (file)
@@ -96,7 +96,6 @@
 #include <linux/fs.h>
 #include <linux/string.h>
 #include <linux/init.h>
-#include <linux/config.h>
 
 #include <asm/etraxi2c.h>
 
index af517c210383478c14c0a09e607e6d26a06a8a6b..8c830eefc89c4e9a07e480b78d32747475f35ffa 100644 (file)
@@ -18,7 +18,6 @@
  * $Id: pcf8563.c,v 1.11 2005/03/07 13:13:07 starvik Exp $
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
index b332bf9b312b5e7cce4ec0f9be1c7f51c802d92a..e6b80135502ff74531f9dbd883c9af7f4a9b88e4 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/module.h>
 #include <asm/io.h>
 #include <asm/arch/svinto.h>
index dde813e16294ddedf7b1a25264a3f2001c0c8834..2b536ca6f4446f6fb1ecc64df9305d8eaa303104 100644 (file)
  *
  */
 
-#include <linux/config.h>
 #include <linux/console.h>
 #include <linux/init.h>
 #include <linux/major.h>
index c808005e8457862e144a2e34b8be90d25c5a5410..ae45d4522e6551982c9c57ffbc318dce71918fc3 100644 (file)
  *
  */
 
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <linux/sys.h>
 #include <asm/unistd.h>
index cac05a5e514cf19817d3a28b49b6ca3d0c92c07d..8cbdf594b36955373629baa9bf6cd7b4fe6a6493 100644 (file)
 #include <asm/delay.h>
 #include <asm/rtc.h>
 
-#include <linux/config.h>
 
 #include <asm/arch/svinto.h>
 #include <asm/fasttimer.h>
index f00c145b43f164e221c97b8593abefac3eb8d61e..d946d8b8d2773eb44c8b7f530f0d74a63482863e 100644 (file)
  *
  */
        
-#include <linux/config.h>
 #define ASSEMBLER_MACROS_ONLY
 /* The IO_* macros use the ## token concatenation operator, so
    -traditional must not be used when assembling this file.  */
index 2d5be93b5197c202d37d41d0a4d6334fa0a271a0..96094cbf12552ff0d5115f8a643d014550971ad2 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/irq.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/config.h>
 
 #define mask_irq(irq_nr) (*R_VECT_MASK_CLR = 1 << (irq_nr));
 #define unmask_irq(irq_nr) (*R_VECT_MASK_SET = 1 << (irq_nr));
index 0a675ce9e0992895f809b3898084efbd8b973ea6..b6831ceb6a62ee35bfa4108c8a88c654909824a6 100644 (file)
@@ -11,7 +11,6 @@
  * This file handles the architecture-dependent parts of process handling..
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/err.h>
 #include <linux/fs.h>
index b668d7fb68eeabc0c480ec06c443afc48519b920..682ef955aec4b526bff04756a09d959333fc321c 100644 (file)
@@ -10,7 +10,6 @@
  * This file handles the architecture-dependent parts of initialization
  */
 
-#include <linux/config.h>
 #include <linux/seq_file.h>
 #include <linux/proc_fs.h>
 #include <linux/delay.h>
index dc3dfe9b4a1aa64f09a8b35a3947d8b32e1346ec..9c22b76e129a32a18e49da042a675d23f8756ed2 100644 (file)
@@ -7,7 +7,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/timex.h>
 #include <linux/time.h>
 #include <linux/jiffies.h>
@@ -252,11 +251,11 @@ timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
         return IRQ_HANDLED;
 }
 
-/* timer is SA_SHIRQ so drivers can add stuff to the timer irq chain
- * it needs to be SA_INTERRUPT to make the jiffies update work properly
+/* timer is IRQF_SHARED so drivers can add stuff to the timer irq chain
+ * it needs to be IRQF_DISABLED to make the jiffies update work properly
  */
 
-static struct irqaction irq2  = { timer_interrupt, SA_SHIRQ | SA_INTERRUPT,
+static struct irqaction irq2  = { timer_interrupt, IRQF_SHARED | IRQF_DISABLED,
                                  CPU_MASK_NONE, "timer", NULL, NULL};
 
 void __init
index 34a27ea2052d10d28c73028fdce564822193a122..4becc1bcced98712a9799c42383ce14f78d98768 100644 (file)
@@ -11,7 +11,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/ptrace.h>
 #include <asm/uaccess.h>
 #include <asm/arch/sv_addr_ag.h>
index 2ef4ad5706ef23a8386db8a36686ce2202a4e187..9cf83932cd5dd60d5b4352be0241307966f3b1a4 100644 (file)
@@ -70,7 +70,6 @@
  * uses this code.
  */
 
-#include <linux/config.h>
 
        ;; WARNING! The registers r8 and r9 are used as parameters carrying
        ;; information from the decompressor (if the kernel was compressed). 
index ff3481e76dd47c368566267660033f4de19726d9..e0fcd1a9bfd5f766ecbd952b1170c6e6c2da1e75 100644 (file)
@@ -2,7 +2,6 @@
  *  linux/arch/cris/arch-v10/mm/init.c
  *
  */
-#include <linux/config.h>
 #include <linux/mmzone.h>
 #include <linux/init.h>
 #include <linux/bootmem.h>
index 71ba736be8f0839b9cb5bd14712f21ff16780118..689729a7e66e6b217d8649a3f8ae6235f1b2798d 100644 (file)
@@ -8,7 +8,6 @@
  * the kernel has booted. 
  */    
 
-#include <linux/config.h>
 #include <asm-generic/vmlinux.lds.h>
                
 jiffies = jiffies_64;
index 0c55b83b8287bece783d11386c4701a7db0732de..34cea10a8998d2eb65b3c0562c20e6b9e56bac7f 100644 (file)
@@ -5,7 +5,6 @@
  *  Copyright (C) 1999 - 2003, Axis Communications AB
  */
 
-#include <linux/config.h>
 #define ASSEMBLER_MACROS_ONLY
 #include <asm/arch/hwregs/asm/reg_map_asm.h>
 #include <asm/arch/hwregs/asm/gio_defs_asm.h>
index 54644238ed59405f986020ef94a2e9d937f2cc4e..11902697196d3f19027905d8cde5d4b25ab696bf 100644 (file)
@@ -20,7 +20,6 @@
 
 #define KERNEL_LOAD_ADR 0x40004000
 
-#include <linux/config.h>
 
 #include <linux/types.h>
 #include <asm/arch/hwregs/reg_rdwr.h>
index 61ede5f30f99451243156d66c25a653788c92b39..8cdb4011bc1683830868167b46bd34d9f0f91453 100644 (file)
@@ -4,7 +4,6 @@
  * RedBoot based RFL instead. Nothing to see here, move along.
  */
 
-#include <linux/config.h>
 #include <asm/arch/hwregs/reg_map_asm.h>
 #include <asm/arch/hwregs/config_defs_asm.h>
 
index b679f983b90a6edd5c05e5a2602fdace3d4b83f0..41952320e00ab67f911cc82b3faa5a629218e6ba 100644 (file)
@@ -18,7 +18,6 @@
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/slab.h>
 
index a551237dcb5e7c66f704038d54c811f89b88a0df..00e9167de530911e5492afe6cdcc01e4f57792ad 100644 (file)
@@ -62,7 +62,6 @@
  *
  */
 
-#include <linux/config.h>
 
 #include <linux/module.h>
 #include <linux/sched.h>
@@ -745,11 +744,11 @@ gpio_init(void)
         * in some tests.
         */
        if (request_irq(TIMER_INTR_VECT, gpio_poll_timer_interrupt,
-                       SA_SHIRQ | SA_INTERRUPT,"gpio poll", &alarmlist)) {
+                       IRQF_SHARED | IRQF_DISABLED,"gpio poll", &alarmlist)) {
                printk("err: timer0 irq for gpio\n");
        }
        if (request_irq(GEN_IO_INTR_VECT, gpio_pa_interrupt,
-                       SA_SHIRQ | SA_INTERRUPT,"gpio PA", &alarmlist)) {
+                       IRQF_SHARED | IRQF_DISABLED,"gpio PA", &alarmlist)) {
                printk("err: PA irq for gpio\n");
        }
        /* enable the gio and timer irq in global config */
index 440c20a9496345253d6a290e08bf321f233feb66..95f00188c6283fdaede4a43e518656da3c668b07 100644 (file)
@@ -33,7 +33,6 @@
 #include <linux/fs.h>
 #include <linux/string.h>
 #include <linux/init.h>
-#include <linux/config.h>
 
 #include <asm/etraxi2c.h>
 
index d788bda3578cd609e8325d9cb5dd035fcf9c5f2e..ffc6d2572f2b87d609eae01fb72a91d2084b0662 100644 (file)
@@ -17,7 +17,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
index c85a6df8558fe4943325e35dd95816c2e4510627..7c29957f5f02c77c40a2d44df824b5183e4771df 100644 (file)
@@ -9,7 +9,6 @@
 
 #include <linux/module.h>
 #include <linux/kernel.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/major.h>
index 3870d2fd516066ca3354ef129240a955942148b3..420a5312ed039ff451e73939a7dc25ddaf5a5859 100644 (file)
@@ -1,15 +1,14 @@
 /*
- * Memory arbiter functions. Allocates bandwith through the
+ * Memory arbiter functions. Allocates bandwidth through the
  * arbiter and sets up arbiter breakpoints.
  *
  * The algorithm first assigns slots to the clients that has specified
- * bandwith (e.g. ethernet) and then the remaining slots are divided
+ * bandwidth (e.g. ethernet) and then the remaining slots are divided
  * on all the active clients.
  *
  * Copyright (c) 2004, 2005 Axis Communications AB.
  */
 
-#include <linux/config.h>
 #include <asm/arch/hwregs/reg_map.h>
 #include <asm/arch/hwregs/reg_rdwr.h>
 #include <asm/arch/hwregs/marb_defs.h>
@@ -120,7 +119,7 @@ static void crisv32_arbiter_init(void)
         crisv32_arbiter_config(EXT_REGION);
         crisv32_arbiter_config(INT_REGION);
 
-       if (request_irq(MEMARB_INTR_VECT, crisv32_arbiter_irq, SA_INTERRUPT,
+       if (request_irq(MEMARB_INTR_VECT, crisv32_arbiter_irq, IRQF_DISABLED,
                         "arbiter", NULL))
                printk(KERN_ERR "Couldn't allocate arbiter IRQ\n");
 
@@ -133,8 +132,8 @@ static void crisv32_arbiter_init(void)
 
 
 
-int crisv32_arbiter_allocate_bandwith(int client, int region,
-                                     unsigned long bandwidth)
+int crisv32_arbiter_allocate_bandwidth(int client, int region,
+                                      unsigned long bandwidth)
 {
        int i;
        int total_assigned = 0;
index 2c3bb9a0afe2202b70d007decf252589696fdd51..e513da711245fef556ec84bab7694b1ed093f03c 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/irq.h>
 #include <asm/arch/dma.h>
index 3dc587e6201aee865c762fa71a1807f5dffcd3d3..d1272ad921531e6aefa04c9886fa2c4598f3fa6f 100644 (file)
@@ -2,7 +2,6 @@
  * Copyright (C) 2003, Axis Communications AB.
  */
 
-#include <linux/config.h>
 #include <linux/console.h>
 #include <linux/init.h>
 #include <linux/major.h>
index b92e85799b449d2955cfeedefb856f25234cc68c..570e19128ffd99736d88658fbc076ffeabde4a5c 100644 (file)
@@ -25,8 +25,8 @@ int crisv32_request_dma(unsigned int dmanr, const char * device_id,
        reg_config_rw_clk_ctrl clk_ctrl;
        reg_strmux_rw_cfg strmux_cfg;
 
-        if (crisv32_arbiter_allocate_bandwith(dmanr,
-                                              options & DMA_INT_MEM ? INT_REGION : EXT_REGION,
+        if (crisv32_arbiter_allocate_bandwidth(dmanr,
+                                              options & DMA_INT_MEM ? INT_REGION : EXT_REGION,
                                               bandwidth))
           return -ENOMEM;
 
index 3bd8503fec6842420ed7cf01d105fcd7b9f87e97..f9d27807b914b2c27d53a7b4298962cbf3664a25 100644 (file)
@@ -17,7 +17,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <linux/sys.h>
 #include <asm/unistd.h>
index ea2b4a97c8c7b61052784d67e4c9ab472feb84db..5daeb6f7f3b7be5cc44fe2abe9c27ad71c171439 100644 (file)
 #include <asm/irq.h>
 #include <asm/system.h>
 
-#include <linux/config.h>
 #include <linux/version.h>
 
 #include <asm/arch/hwregs/reg_map.h>
@@ -982,7 +981,7 @@ void fast_timer_init(void)
     proc_register_dynamic(&proc_root, &fasttimer_proc_entry);
 #endif
 #endif /* PROC_FS */
-    if(request_irq(TIMER_INTR_VECT, timer_trig_interrupt, SA_INTERRUPT,
+    if(request_irq(TIMER_INTR_VECT, timer_trig_interrupt, IRQF_DISABLED,
                    "fast timer int", NULL))
     {
       printk("err: timer1 irq\n");
index 3cfe57dc391d6ae31736bc543e00ba06d82509fb..20bd80a84e4842acc61183cd8881415f4e6aeefa 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 2003, Axis Communications AB
  */
 
-#include <linux/config.h>
 
 #define ASSEMBLER_MACROS_ONLY
 
index 6bc9f263c3d6639518d38e5285ec98f3d1725bc4..dfbfcb8d2585b664fe7a0ef362aae1b14d8f682c 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (c) 2004 Axis Communications AB.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index 06260874f018f4ff7d5a9d1f8d07cf8ba2e6ca11..cc361bf578aef8ae4907491b87ec265f9b5c3c30 100644 (file)
@@ -6,7 +6,6 @@
 #include <linux/irq.h>
 #include <linux/interrupt.h>
 #include <linux/smp.h>
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
@@ -269,7 +268,7 @@ void
 crisv32_do_IRQ(int irq, int block, struct pt_regs* regs)
 {
        /* Interrupts that may not be moved to another CPU and
-         * are SA_INTERRUPT may skip blocking. This is currently
+         * are IRQF_DISABLED may skip blocking. This is currently
          * only valid for the timer IRQ and the IPI and is used
          * for the timer interrupt to avoid watchdog starvation.
          */
index b350dd279ed21f914caf7c417d6cc7f9a092e33e..3e7fa9ef8510ce43b704147aeee728995f1b0136 100644 (file)
@@ -5,7 +5,6 @@
  * port exceptions for kernel debugging purposes.
  */
 
-#include <linux/config.h>
 #include <asm/arch/hwregs/intr_vect.h>
 
        ;; Exported functions.
index 843513102d3cfcbb94404b0a56edd08daa6b9178..6326351af2528300ec01f287ed3bff40d4019ac8 100644 (file)
@@ -8,7 +8,6 @@
  * This file handles the architecture-dependent parts of process handling..
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/err.h>
 #include <linux/fs.h>
index b17a39a2e164d4f567c7222fef70b27766017183..4662f363df638371dc4336d0b4233bcd9aed242a 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 2003, Axis Communications AB.
  */
 
-#include <linux/config.h>
 #include <linux/seq_file.h>
 #include <linux/proc_fs.h>
 #include <linux/delay.h>
index da40d19a151e28a76b7814a8e1d9ac6805a35c4c..464ecaec3bc08d8ef21878fac55bbbdf05cc6d74 100644 (file)
@@ -62,7 +62,7 @@ static unsigned long irq_regs[NR_CPUS] =
 
 static irqreturn_t crisv32_ipi_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 static int send_ipi(int vector, int wait, cpumask_t cpu_mask);
-static struct irqaction irq_ipi  = { crisv32_ipi_interrupt, SA_INTERRUPT,
+static struct irqaction irq_ipi  = { crisv32_ipi_interrupt, IRQF_DISABLED,
                                      CPU_MASK_NONE, "ipi", NULL, NULL};
 
 extern void cris_mmu_init(void);
index d48e397f5fa4d515e2abd8f374f929057548835c..50f3f93293d64d33c8b1183a6971faf68eca0912 100644 (file)
@@ -6,7 +6,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/timex.h>
 #include <linux/time.h>
 #include <linux/jiffies.h>
@@ -242,12 +241,16 @@ timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
         return IRQ_HANDLED;
 }
 
-/* timer is SA_SHIRQ so drivers can add stuff to the timer irq chain
- * it needs to be SA_INTERRUPT to make the jiffies update work properly
+/* timer is IRQF_SHARED so drivers can add stuff to the timer irq chain
+ * it needs to be IRQF_DISABLED to make the jiffies update work properly
  */
 
-static struct irqaction irq_timer  = { timer_interrupt, SA_SHIRQ | SA_INTERRUPT,
-                                 CPU_MASK_NONE, "timer", NULL, NULL};
+static struct irqaction irq_timer  = {
+       .mask = timer_interrupt,
+       .flags = IRQF_SHARED | IRQF_DISABLED,
+       .mask = CPU_MASK_NONE,
+       .name = "timer"
+};
 
 void __init
 cris_timer_init(void)
index 6e3787045560fa5209ec361e5959cb0b157d34a6..2462b1ef1fbba56fe13e559bf09caa03424f4821 100644 (file)
@@ -2,7 +2,6 @@
  * Copyright (C) 2003, Axis Communications AB.
  */
 
-#include <linux/config.h>
 #include <linux/ptrace.h>
 #include <asm/uaccess.h>
 
index 47b6cf5f4afd6d1fa94b693b358e60a1bbe3c583..158b3dbb4d9d91a67b499afb057db5206d88585d 100644 (file)
@@ -16,7 +16,6 @@
  * uses this code.
  */
 
-#include <linux/config.h>
 #include <asm/arch/hwregs/asm/reg_map_asm.h>
 #include <asm/arch/hwregs/asm/bif_core_defs_asm.h>
 
index 5182e8c2cff27fb14b77c0664ec7ce437fc93f2b..fff9443513d1884cb9618debe2e39ba9dbd50531 100644 (file)
@@ -10,7 +10,6 @@
  * Authors:  Mikael Starvik (starvik@axis.com)
  */
 
-#include <linux/config.h>
 #include <asm/arch/hwregs/asm/reg_map_asm.h>
 #include <asm/arch/hwregs/asm/bif_core_defs_asm.h>
 #include <asm/arch/hwregs/asm/gio_defs_asm.h>
index aba5c751c2820ddc5b49f83a7e05d0139e1151d7..e019816facd700be144752fd3d9ea928395f4aea 100644 (file)
@@ -27,7 +27,6 @@
 #include <asm/arch/hwregs/asm/pinmux_defs_asm.h>
 #include <asm/arch/hwregs/asm/bif_core_defs_asm.h>
 #include <asm/arch/hwregs/asm/config_defs_asm.h>
-#include <linux/config.h>
 
 ;; There are 8-bit NAND flashes and 16-bit NAND flashes.
 ;; We need to treat them slightly different.
index f2fba27d822cbd7a5130d20437122ccedb22e2ef..a84ba7ff22d269e40780d6225927022884497d8a 100644 (file)
@@ -6,12 +6,10 @@
  * Authors:   Bjorn Wesen <bjornw@axis.com>
  *            Tobias Anderberg <tobiasa@axis.com>, CRISv32 port.
  */
-#include <linux/config.h>
 #include <linux/mmzone.h>
 #include <linux/init.h>
 #include <linux/bootmem.h>
 #include <linux/mm.h>
-#include <linux/config.h>
 #include <asm/pgtable.h>
 #include <asm/page.h>
 #include <asm/types.h>
index adb94605d92a2b20c82880eae569ece6621eeef6..472d4b3c4cf4b1d595d36a7b43dabd063d7c5a2d 100644 (file)
@@ -8,7 +8,6 @@
  * the kernel has booted.
  */
 
-#include <linux/config.h>
 #include <asm-generic/vmlinux.lds.h>
 
 jiffies = jiffies_64;
index d57859053ce7a5ec7d64a70fb2cb02ab0dba10c0..1f20c16ac2a48fd193eec7410b1c4fb4cad2681d 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/user.h>
 #include <linux/elfcore.h>
index 6547bb64636419de268dadcccea8d7b89c84c425..903ea62c6e21b6ac5fa6ed899cba5c5c261b6015 100644 (file)
@@ -19,7 +19,6 @@
  * Naturally it's not a 1:1 relation, but there are similarities.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/ptrace.h>
 #include <linux/irq.h>
@@ -86,7 +85,7 @@ skip:
 /* called by the assembler IRQ entry functions defined in irq.h
  * to dispatch the interrupts to registred handlers
  * interrupts are disabled upon entry - depending on if the
- * interrupt was registred with SA_INTERRUPT or not, interrupts
+ * interrupt was registred with IRQF_DISABLED or not, interrupts
  * are re-enabled or not.
  */
 
index 619a6eefd893d6762f6dd068d73634a6c8113989..6d941fb9f37969b73ea9470f74ec371c701c20ca 100644 (file)
@@ -10,7 +10,6 @@
  * This file handles the architecture-dependent parts of initialization
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <linux/bootmem.h>
index 687c48d62dde73b8d67a8a6bc2cd76dfcb61d773..ea161f0ca427da1705c0d4e24275e9e7ba3ed701 100644 (file)
@@ -10,7 +10,6 @@
  */
 
 #include <linux/sys.h>
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/setup.h>
 #include <asm/segment.h>
index 6591e6a37ae9b696cd03ccca52041720d4311094..81ba28ad2207158f080914a1e4e91fa5b7efd6aa 100644 (file)
@@ -11,7 +11,6 @@
  */
 
 #include <linux/sys.h>
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/setup.h>
 #include <asm/segment.h>
index 81568acea9cdb0fe1b31a4b39ac5a094e587fbbb..d3b9253d862ae395721a6c129343e8a4e85e7765 100644 (file)
@@ -11,7 +11,6 @@
  */
 
 #include <linux/sys.h>
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/spr-regs.h>
 
index 81d94e41a189b8edcd295e90ec42308a3ba72272..2a1ff1ff86926f4342e8629969e305c2f455cff8 100644 (file)
@@ -28,7 +28,6 @@
  */
 
 #include <linux/sys.h>
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/thread_info.h>
 #include <asm/setup.h>
index dee637fffda53bd5f6d1d14916791cfc9ce3e632..f772704b3d28f6db52c93e6bda8029961036e0d7 100644 (file)
@@ -7,7 +7,6 @@
 #include <linux/elfcore.h>
 #include <linux/in6.h>
 #include <linux/interrupt.h>
-#include <linux/config.h>
 
 #include <asm/setup.h>
 #include <asm/pgalloc.h>
index a143c2f66ee5e4c25471ca2cab1b1a71796f19a9..c8f210d84ff52b7b351ccd917a1377c2a79b8642 100644 (file)
@@ -9,7 +9,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/threads.h>
 #include <linux/linkage.h>
 #include <asm/ptrace.h>
index 4ccf8414ae446f6b63f450ee82e13e69980e0ff8..ee282be20fffdafc1350cee6b9f5ed3b8fd336d6 100644 (file)
@@ -9,7 +9,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/threads.h>
 #include <linux/linkage.h>
 #include <asm/ptrace.h>
index 31cb54a6f0806416e3eba65b97b7689b4b436e83..b10d9c8295d21fd854aa91ab0fedc8ff2d71ede8 100644 (file)
@@ -9,7 +9,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/threads.h>
 #include <linux/linkage.h>
 #include <asm/ptrace.h>
index d088db2699bfaf14f5d892bc5a6a689e4a636b23..39937c19b4602d815c8a986333d8e3f1b6c81181 100644 (file)
@@ -9,7 +9,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/threads.h>
 #include <linux/linkage.h>
 #include <asm/ptrace.h>
index 29a5265489b7ec2333bc7ede45332c18ccb0b971..47c990af2e06a0b9c2d28e227d02becc3a8f7614 100644 (file)
@@ -9,7 +9,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/threads.h>
 #include <linux/linkage.h>
 #include <asm/ptrace.h>
index 9778e0ff7c1c7765f060e103b79ae93400c91767..1381abcd5cc95e7082d77b3b1760ce5ca808761b 100644 (file)
@@ -9,7 +9,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/ptrace.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
index 21ca2b298247084fd348b0a52c43bfcfc9c97cba..48b2a6420888c12cc83d52aa46e31c8f84e0119f 100644 (file)
@@ -9,7 +9,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/ptrace.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
index c003ae5e2b30f532852cb20470326d4d6fb1312f..988d035640e19f6d479c6cdca17827fcc9c0c75e 100644 (file)
@@ -9,7 +9,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/ptrace.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
index b90b70a761d151ba82527afd05f0de2ab910e169..53886adf47de8afd361c1db698e8f0883f24ca0a 100644 (file)
@@ -81,7 +81,7 @@ void distribute_irqs(struct irq_group *group, unsigned long irqmask)
                if (action) {
                        int status = 0;
 
-//                     if (!(action->flags & SA_INTERRUPT))
+//                     if (!(action->flags & IRQF_DISABLED))
 //                             local_irq_enable();
 
                        do {
@@ -90,7 +90,7 @@ void distribute_irqs(struct irq_group *group, unsigned long irqmask)
                                action = action->next;
                        } while (action);
 
-                       if (status & SA_SAMPLE_RANDOM)
+                       if (status & IRQF_SAMPLE_RANDOM)
                                add_interrupt_randomness(irq);
                        local_irq_disable();
                }
index 8b112b3619140059d66cd155b6e02e2dd791380c..08967010be04a5c702ad1d42e9e96e6df47534a3 100644 (file)
@@ -16,7 +16,6 @@
  * Naturally it's not a 1:1 relation, but there are similarities.
  */
 
-#include <linux/config.h>
 #include <linux/ptrace.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
@@ -342,11 +341,11 @@ asmlinkage void do_NMI(void)
  *
  *     Flags:
  *
- *     SA_SHIRQ                Interrupt is shared
+ *     IRQF_SHARED             Interrupt is shared
  *
- *     SA_INTERRUPT            Disable local interrupts while processing
+ *     IRQF_DISABLED   Disable local interrupts while processing
  *
- *     SA_SAMPLE_RANDOM        The interrupt can be used for entropy
+ *     IRQF_SAMPLE_RANDOM      The interrupt can be used for entropy
  *
  */
 
@@ -366,7 +365,7 @@ int request_irq(unsigned int irq,
         * to figure out which interrupt is which (messes up the
         * interrupt freeing logic etc).
         */
-       if (irqflags & SA_SHIRQ) {
+       if (irqflags & IRQF_SHARED) {
                if (!dev_id)
                        printk("Bad boy: %s (at 0x%x) called us without a dev_id!\n",
                               devname, (&irq)[-1]);
@@ -577,7 +576,7 @@ int setup_irq(unsigned int irq, struct irqaction *new)
         * so we have to be careful not to interfere with a
         * running system.
         */
-       if (new->flags & SA_SAMPLE_RANDOM) {
+       if (new->flags & IRQF_SAMPLE_RANDOM) {
                /*
                 * This function might sleep, we want to call it first,
                 * outside of the atomic block.
@@ -593,7 +592,7 @@ int setup_irq(unsigned int irq, struct irqaction *new)
        spin_lock_irqsave(&level->lock, flags);
 
        /* can't share interrupts unless all parties agree to */
-       if (level->usage != 0 && !(level->flags & new->flags & SA_SHIRQ)) {
+       if (level->usage != 0 && !(level->flags & new->flags & IRQF_SHARED)) {
                spin_unlock_irqrestore(&level->lock,flags);
                return -EBUSY;
        }
index 34d01d7dcc3bbbb390338ec3e869750932e6b9af..eaa7b582ef52f17f017195c6946aa68fbafcef6c 100644 (file)
@@ -10,7 +10,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/pm.h>
 #include <linux/sched.h>
index 43ce28a13a5d8f3cf904f7331809af2cc6763409..e65a9f1c0c26d56f4e5a35a2f258419d2149e6d4 100644 (file)
@@ -11,7 +11,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/pm.h>
index 489e6c489cbed4aadfb894862ac307b1b1a70dc9..eeeb1e2641d5b49e14a1f760ea90001d75273a45 100644 (file)
@@ -10,7 +10,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index f953484e7d596eced5666356750f6ef72f2239f6..fcff819b4340669003e1e0966f174a4677f004ed 100644 (file)
@@ -18,7 +18,6 @@
 #include <linux/errno.h>
 #include <linux/ptrace.h>
 #include <linux/user.h>
-#include <linux/config.h>
 #include <linux/security.h>
 #include <linux/signal.h>
 
index 7971d680ae298bbe6ef5cacf09de735527633109..f278cdf3a72fa76e9ade9150dbca8d2b08775f73 100644 (file)
@@ -10,7 +10,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/module.h>
 #include <asm/semaphore.h>
index 1f7d65f29e78cc0963211acf42215dd57943fa0b..af08ccd4ed6e44bdaf085faf1007404c447557eb 100644 (file)
@@ -10,8 +10,7 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
-#include <linux/version.h>
+#include <linux/utsrelease.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/delay.h>
index e6079b8cac606e5a2c4ce12e233c6355ed9c10a2..c9b2d51ab9ad9ea85ebde27c5f1f0ccaf903ddbb 100644 (file)
@@ -11,7 +11,6 @@
  */
 
 #include <linux/sys.h>
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/setup.h>
 #include <asm/segment.h>
index 1703dc20174edc2ca7fc00a2c867e22c1f0221be..9e5a583991a3ace7e1dcf74ada8ece2f1ef1264f 100644 (file)
@@ -11,7 +11,6 @@
 # 2 of the License, or (at your option) any later version.
 #
 ###############################################################################
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/thread_info.h>
 #include <asm/processor.h>
index b908863d6593fa87b9c2cafade9847f4a93ab61e..ce676803eb6f59a03e8ee36780ac009fac4cc63b 100644 (file)
@@ -9,7 +9,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/slab.h>
 #include <linux/sysctl.h>
 #include <linux/proc_fs.h>
index 24cf85f89e400f675e8820c94438e8f5e38431ad..d5b64e193d9263b83ca0e8ed536f9cd909468dc9 100644 (file)
@@ -47,7 +47,7 @@ unsigned long __delay_loops_MHz;
 static irqreturn_t timer_interrupt(int irq, void *dummy, struct pt_regs *regs);
 
 static struct irqaction timer_irq  = {
-       timer_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "timer", NULL, NULL
+       timer_interrupt, IRQF_DISABLED, CPU_MASK_NONE, "timer", NULL, NULL
 };
 
 static inline int set_rtc_mmss(unsigned long nowtime)
index 9eb84b2e6abc498362f57762a1e5e8e3c0c24b58..98ce3628ebde54a9c9aae2fa46cd49671ac9c848 100644 (file)
@@ -9,7 +9,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/signal.h>
 #include <linux/kernel.h>
index 45ae39d84b69a7da6d82d2c0828c64f54859498d..2278c80bd88c277a2d109938b2bda035d5f1f8be 100644 (file)
@@ -5,7 +5,6 @@
  * derived from: arch/i386/kernel/pci-irq.c: (c) 1999--2000 Martin Mares <mj@suse.cz>
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
index c8817f7b8605d40b4a8d819d6c9a5f697903e9f0..fb98e90c57941a4ff9141489c5d2f396ff4814d0 100644 (file)
@@ -9,7 +9,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index 636b2f8b5d981934e2b1a99635ae397d0779d7de..dc6522c464d4719d3f72558127cd654840ae035d 100644 (file)
@@ -21,7 +21,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
index caacf030ac753f438026d8c642458bba7c07518e..6aea124f574db5a19d6dac8ec3aafff8d4df7246 100644 (file)
@@ -2,7 +2,6 @@
  * linux/arch/frv/mm/extable.c
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
index 8899aa1a4f06f6e0d32a8d125b4a3b247ca53025..b5b4286f9dd4637e87ebcfc82da8280282a09f8d 100644 (file)
@@ -16,7 +16,6 @@
  *    - Copyright (C) 1995  Hamish Macdonald
  */
 
-#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/pagemap.h>
index 40b62c5c2951ada0ff8e342adfc7b19eeae6e493..fb78be38ea02633825f1ef904e9b1b5d6012a0b9 100644 (file)
@@ -10,7 +10,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
index 6f43c74c5d9597350c0aee4de4f59c18e2040412..79b3c70910aca3a3ebe6c1a7add46a37ab1f40e6 100644 (file)
@@ -10,7 +10,6 @@
  */
 
 #include <linux/sys.h>
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/page.h>
 #include <asm/ptrace.h>
index 8729f7d7c6e07b6582d01b69ac13204ea1335e7f..04da674683783ebce980973413f3903016d568da 100644 (file)
@@ -10,7 +10,6 @@
  */
 
 #include <linux/sys.h>
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/page.h>
 #include <asm/pgtable.h>
index 09b361443fc2c990faae75372bf58a350cfccae2..8f0375fc15a81e70ab2d8fd1751b4bb55b0a0ec6 100644 (file)
@@ -9,7 +9,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/signal.h>
 #include <linux/kernel.h>
index d195568ca8a27ed1a44ed3897d47eb53cafe97a8..6a25dd5530e70cd48477f18b7487415b818648f3 100644 (file)
@@ -9,7 +9,6 @@
  * Internal I/O Port Management
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/proc_fs.h>
 #include <linux/kernel.h>
index f8d6dee8478112e92b1dc44e2c8d95c5a5afc740..9b4be053de3c36c58cea9abffa783fd3e9a4785b 100644 (file)
@@ -7,7 +7,6 @@
 #include <linux/elfcore.h>
 #include <linux/in6.h>
 #include <linux/interrupt.h>
-#include <linux/config.h>
 
 #include <asm/setup.h>
 #include <asm/pgalloc.h>
index edb3c4170013c417d53fa8258bf9f736eaf45bff..1488b6ace18c3220ea22cd7cffe428e511b73520 100644 (file)
@@ -158,7 +158,7 @@ int request_irq(unsigned int irq,
        irq_handle->devname = devname;
        irq_list[irq] = irq_handle;
 
-       if (irq_handle->flags & SA_SAMPLE_RANDOM)
+       if (irq_handle->flags & IRQF_SAMPLE_RANDOM)
                rand_initialize_irq(irq);
 
        enable_irq(irq);
@@ -222,7 +222,7 @@ asmlinkage void process_int(int irq, struct pt_regs *fp)
                if (irq_list[irq]) {
                        irq_list[irq]->handler(irq, irq_list[irq]->dev_id, fp);
                        irq_list[irq]->count++;
-                       if (irq_list[irq]->flags & SA_SAMPLE_RANDOM)
+                       if (irq_list[irq]->flags & IRQF_SAMPLE_RANDOM)
                                add_interrupt_randomness(irq);
                }
        } else {
index 16ccddc69c2bbb579e97784b0e66913395a67bf9..e061b63a00386f51531fb1439cae57c37bbcfde9 100644 (file)
@@ -22,7 +22,6 @@
  * This file handles the architecture-dependent parts of process handling..
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/module.h>
 #include <linux/sched.h>
index 0ff6f79b0fedcf240fc56af0e1f8c679fb9db716..f6031373dc21f894b8653804c0fd94e8edb46669 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/errno.h>
 #include <linux/ptrace.h>
 #include <linux/user.h>
-#include <linux/config.h>
 #include <linux/signal.h>
 
 #include <asm/uaccess.h>
index 1ebb79baaa8c32f839f87de5c3fbc2a834f5749d..d12cbbfe6ebd92b57c9a592b2f441d80f927765a 100644 (file)
@@ -3,7 +3,6 @@
  * specific changes in <asm/semaphore-helper.h>
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/init.h>
 #include <asm/semaphore-helper.h>
index f469d9160730291c73d5374fb06b187c7cfe1d6a..1077b71d52264c4f653d41f0889f6a4e22a0ffb6 100644 (file)
@@ -16,7 +16,6 @@
  * This file handles the architecture-dependent parts of system setup
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/delay.h>
index 79b3bda5c6e33dac01672cbc5382b41e737ebec4..dab98fd99e63efa3ee58504a40c4a10ae930583f 100644 (file)
@@ -1,5 +1,4 @@
 /* Systemcall Entry Table */
-#include <linux/config.h>
 #include <linux/sys.h>
 #include <asm/linkage.h>
 #include <asm/unistd.h>
index 17fa11da1e4abe6269afe07f99f60775178bbae8..6406c388f88aec3a1471ac2428544ac8cd52b57b 100644 (file)
@@ -1,6 +1,5 @@
 #define VMLINUX_SYMBOL(_sym_) _##_sym_
 #include <asm-generic/vmlinux.lds.h>
-#include <linux/config.h>
 
 /* target memory map */
 #ifdef CONFIG_H8300H_GENERIC
index b72f93a47e310aafb2bc186e5c325a77884f4ad6..68910d8e1ff4aa381312c36f8b0cdb29d24a66a1 100644 (file)
@@ -1,7 +1,6 @@
 /* romfs move to __ebss */
 
 #include <asm/linkage.h>
-#include <linux/config.h>
 
 #if defined(__H8300H__) 
        .h8300h
index 09efc4b1f038f5b66ba444bd904660bdac44c319..d3d40bdc2d6a16889aee21e1899c0052b2ed900b 100644 (file)
@@ -16,7 +16,6 @@
  *  DEC/2000 -- linux 2.4 support <davidm@snapgear.com>
  */
 
-#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index 4101ab54fc17753744dd2cc1e6785db9225dd840..26ab17286a536a5700d86e8733e2984266999b3f 100644 (file)
@@ -8,7 +8,6 @@
  *  Copyright (C) 2000-2002 David McCullough <davidm@snapgear.com>
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
index 81eace93f8679be6e5a26bb11e9e6d6464ecee43..ccd6ade816dd027cc86653f7050cc7d132602cd2 100644 (file)
@@ -17,7 +17,6 @@
  *  Copyright (C) 1995  Hamish Macdonald
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
index 31c3703d8d6074bcf297c776f597b83859b6238f..ecaeb31ae9a44060a7c64c5ddc5d4c270688afac 100644 (file)
@@ -10,7 +10,6 @@
 
 #define ASSEMBLY
 
-#include <linux/config.h>
 #include <asm/linkage.h>
        
 #if !defined(CONFIG_BLKDEV_RESERVE)
index 086efb1fd283e41fdd9bc1db4b19b6f14382f750..27cd85d56128b5fe29e2b7fab4eaa761c98ae187 100644 (file)
@@ -7,7 +7,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index 2052dbb9483f393e61c1eb642f2399001acd5b03..d2dea2432fb21c0c9c62cd68d147a485709905ba 100644 (file)
@@ -14,7 +14,6 @@
  */
 
 #include <linux/sys.h>
-#include <linux/config.h>
 #include <asm/unistd.h>
 #include <asm/setup.h>
 #include <asm/segment.h>
index b735042a7c3f4ae8b9b379c6863a6fc671be2edb..80d0e16a44995b3671dd7df5d6f1374d7febf7da 100644 (file)
@@ -10,7 +10,6 @@
 
 #define ASSEMBLY
 
-#include <linux/config.h>
 #include <asm/linkage.h>
        
 #if !defined(CONFIG_BLKDEV_RESERVE)
index 2e32d8179db301ee8e9259523928e5a8e4b0889c..120add7ca83216f7d3b0091ba8bc9f5321d13a7d 100644 (file)
@@ -10,7 +10,6 @@
 
 #define ASSEMBLY
 
-#include <linux/config.h>
 #include <asm/linkage.h>
        
        .global SYMBOL_NAME(_start)
index 6590f89e521a8239be3e6b6665b0bbf46f1d32de..6f5cefe0cceb2a36643a6fe35a82bb35235c7edd 100644 (file)
@@ -7,7 +7,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index a5c5a9156e04ce47e4a5abade421b90ff8c6d6da..efcbefb91b6713961b83575643d44d7f7a8c8b7b 100644 (file)
@@ -10,7 +10,6 @@
 
 #define ASSEMBLY
 
-#include <linux/config.h>
 #include <asm/linkage.h>
        
 #if !defined(CONFIG_BLKDEV_RESERVE)
index 9ac9fa6691c01484c3ac1f130ea18f86fa3151b9..85a574afe9d0c2a98341bc856229bc923f97a42a 100644 (file)
@@ -7,7 +7,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index 86a155479167c904ba6950c75262d2ea209c31d0..f1777119b8719ec8e10c2849b6d9e722a6b2a025 100644 (file)
@@ -6,7 +6,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/errno.h>
 
index 8105dc17d7356a61043d129dc6edad2a70d02f60..d12b0debe478808f149906469d83b7c0a062da1c 100644 (file)
@@ -10,7 +10,6 @@
 
 #define ASSEMBLY
 
-#include <linux/config.h>
 #include <asm/linkage.h>
 #include <asm/regs267x.h>
                        
index 65748bf18556f521bb359bf1108f64f12f8e496f..c03d23c6fe12631f2ec2fae475fe9fbdc4e43c5f 100644 (file)
@@ -10,7 +10,6 @@
 
 #define ASSEMBLY
 
-#include <linux/config.h>
 #include <asm/linkage.h>
 #include <asm/regs267x.h>
                
index 9441a4f1631f9a5bd30313df7b34adc780146420..bfb1424482f47869af70594ec391f0491590e2b6 100644 (file)
@@ -7,7 +7,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index a7a53c84c801542c86e40d361e8956667819abee..aeb2e9faa9b268fd3870025d5ee69d1251fafdfc 100644 (file)
@@ -15,7 +15,6 @@
  */
 
 #include <linux/sys.h>
-#include <linux/config.h>
 #include <asm/unistd.h>
 #include <asm/setup.h>
 #include <asm/segment.h>
index 86f45017846608d2d903691064387e33a12318ba..b04541069976cbdc8ca82ea045344a72cc81f6f9 100644 (file)
@@ -10,7 +10,6 @@
 
 #define ASSEMBLY
 
-#include <linux/config.h>
 #include <asm/linkage.h>
 #include <asm/regs267x.h>
                        
index e18e412022827514755464c231664a590cb19bb7..95b6f2898f52c753be7ef2c511e1861936f8fe60 100644 (file)
@@ -10,7 +10,6 @@
 
 #define ASSEMBLY
 
-#include <linux/config.h>
 #include <asm/linkage.h>
 #include <asm/regs267x.h>
        
index 633cd8e1c21d3d85627aa309a3c0157f0ed3246b..c2211c6e79da9dd616be4e815b076737539a324a 100644 (file)
@@ -7,7 +7,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index f6ed663bdde0ed184874e72c02cfc435e7a86d0b..270440de4610c3eb7187e93d304328a05aa405bc 100644 (file)
@@ -192,7 +192,7 @@ int request_irq(unsigned int irq,
        irq_handle->dev_id  = dev_id;
        irq_handle->devname = devname;
        irq_list[irq] = irq_handle;
-       if (irq_handle->flags & SA_SAMPLE_RANDOM)
+       if (irq_handle->flags & IRQF_SAMPLE_RANDOM)
                rand_initialize_irq(irq);
        
        /* enable interrupt */
@@ -270,7 +270,7 @@ asmlinkage void process_int(unsigned long vec, struct pt_regs *fp)
                if (irq_list[vec]) {
                        irq_list[vec]->handler(vec, irq_list[vec]->dev_id, fp);
                        irq_list[vec]->count++;
-                       if (irq_list[vec]->flags & SA_SAMPLE_RANDOM)
+                       if (irq_list[vec]->flags & IRQF_SAMPLE_RANDOM)
                                add_interrupt_randomness(vec);
                }
        } else {
index 8268dfd12f1f3c1a54ae9d943a6ed03fda099057..93395d2a8a0795808f54d3e4d90e9630079921b7 100644 (file)
@@ -6,7 +6,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
index 1718429286d4f78ab234eabae56d6bb367f67de1..daa75ce4b7773d374b2015edb6cc533cb1c8afa8 100644 (file)
@@ -18,6 +18,14 @@ config GENERIC_TIME
        bool
        default y
 
+config LOCKDEP_SUPPORT
+       bool
+       default y
+
+config STACKTRACE_SUPPORT
+       bool
+       default y
+
 config SEMAPHORE_SLEEPERS
        bool
        default y
@@ -176,7 +184,7 @@ endchoice
 config ACPI_SRAT
        bool
        default y
-       depends on NUMA && (X86_SUMMIT || X86_GENERICARCH)
+       depends on ACPI && NUMA && (X86_SUMMIT || X86_GENERICARCH)
        select ACPI_NUMA
 
 config HAVE_ARCH_PARSE_SRAT
index c92191b1fb672935527bccbadfdd129065306edb..b31c0802e1ccf53f1e5a677e802c5e34166ebc54 100644 (file)
@@ -1,5 +1,9 @@
 menu "Kernel hacking"
 
+config TRACE_IRQFLAGS_SUPPORT
+       bool
+       default y
+
 source "lib/Kconfig.debug"
 
 config EARLY_PRINTK
@@ -31,15 +35,6 @@ config DEBUG_STACK_USAGE
 
          This option will slow down process creation somewhat.
 
-config STACK_BACKTRACE_COLS
-       int "Stack backtraces per line" if DEBUG_KERNEL
-       range 1 3
-       default 2
-       help
-         Selects how many stack backtrace entries per line to display.
-
-         This can save screen space when displaying traces.
-
 comment "Page alloc debug is incompatible with Software Suspend on i386"
        depends on DEBUG_KERNEL && SOFTWARE_SUSPEND
 
index ca668d9df16411c29d2928d230c32b99a129104f..d2b684cd620ae63888bbb54c06721d0b4fe8e5e5 100644 (file)
@@ -46,9 +46,8 @@
  * by Robert Schwebel, December 2001 <robert@schwebel.de>
  */
 
-#include <linux/config.h>
 #include <asm/segment.h>
-#include <linux/version.h>
+#include <linux/utsrelease.h>
 #include <linux/compile.h>
 #include <asm/boot.h>
 #include <asm/e820.h>
index 5e70c2fb273ae0a814f7148f61522a6f9040e02f..1b452a1665c4ffe92a05f3a5fa80704b4e1738ec 100644 (file)
@@ -9,6 +9,7 @@ obj-y   := process.o semaphore.o signal.o entry.o traps.o irq.o \
                pci-dma.o i386_ksyms.o i387.o bootflag.o \
                quirks.o i8237.o topology.o alternative.o i8253.o tsc.o
 
+obj-$(CONFIG_STACKTRACE)       += stacktrace.o
 obj-y                          += cpu/
 obj-y                          += acpi/
 obj-$(CONFIG_X86_BIOS_REBOOT)  += reboot.o
@@ -38,6 +39,7 @@ obj-$(CONFIG_VM86)            += vm86.o
 obj-$(CONFIG_EARLY_PRINTK)     += early_printk.o
 obj-$(CONFIG_HPET_TIMER)       += hpet.o
 obj-$(CONFIG_K8_NB)            += k8.o
+obj-$(CONFIG_AUDIT)            += audit.o
 
 EXTRA_AFLAGS   := -traditional
 
index 97ca17189af58bf66090a73770903e16e679460f..0db6387025ca77cb9ce81258f0ed5fdf89861512 100644 (file)
@@ -24,7 +24,6 @@
  */
 
 #include <linux/init.h>
-#include <linux/config.h>
 #include <linux/acpi.h>
 #include <linux/efi.h>
 #include <linux/module.h>
index 50eb0e03777e4b1a7f0fe564f507b6ccfe358f18..28ab8064976421ffab42ed3ba07b3063f8fee86b 100644 (file)
@@ -168,6 +168,8 @@ void apply_alternatives(struct alt_instr *start, struct alt_instr *end)
        }
 }
 
+#ifdef CONFIG_SMP
+
 static void alternatives_smp_save(struct alt_instr *start, struct alt_instr *end)
 {
        struct alt_instr *a;
@@ -301,6 +303,16 @@ void alternatives_smp_switch(int smp)
        struct smp_alt_module *mod;
        unsigned long flags;
 
+#ifdef CONFIG_LOCKDEP
+       /*
+        * A not yet fixed binutils section handling bug prevents
+        * alternatives-replacement from working reliably, so turn
+        * it off:
+        */
+       printk("lockdep: not fixing up alternatives.\n");
+       return;
+#endif
+
        if (no_replacement || smp_alt_once)
                return;
        BUG_ON(!smp && (num_online_cpus() > 1));
@@ -328,6 +340,8 @@ void alternatives_smp_switch(int smp)
        spin_unlock_irqrestore(&smp_alt, flags);
 }
 
+#endif
+
 void __init alternative_instructions(void)
 {
        if (no_replacement) {
@@ -349,6 +363,7 @@ void __init alternative_instructions(void)
        smp_alt_once = 1;
 #endif
 
+#ifdef CONFIG_SMP
        if (smp_alt_once) {
                if (1 == num_possible_cpus()) {
                        printk(KERN_INFO "SMP alternatives: switching to UP code\n");
@@ -370,4 +385,5 @@ void __init alternative_instructions(void)
                                            _text, _etext);
                alternatives_smp_switch(0);
        }
+#endif
 }
index 7ce09492fc0ca0bee5fdac224a38d4e509df6c20..8c844d07862f6f9eb9103842f783a0cdf495cda3 100644 (file)
@@ -14,7 +14,6 @@
  *     Mikael Pettersson       :       PM converted to driver model.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 
 #include <linux/mm.h>
index 7c5729d1fd06ebb00a92685a296686cc615dc489..8591f2fa920cdb77223e5cd53456f9b1e3e0ccb4 100644 (file)
  *    http://www.microsoft.com/hwdev/busbios/amp_12.htm]
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/poll.h>
diff --git a/arch/i386/kernel/audit.c b/arch/i386/kernel/audit.c
new file mode 100644 (file)
index 0000000..5a53c6f
--- /dev/null
@@ -0,0 +1,23 @@
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/audit.h>
+#include <asm/unistd.h>
+
+static unsigned dir_class[] = {
+#include <asm-generic/audit_dir_write.h>
+~0U
+};
+
+static unsigned chattr_class[] = {
+#include <asm-generic/audit_change_attr.h>
+~0U
+};
+
+static int __init audit_classes_init(void)
+{
+       audit_register_class(AUDIT_CLASS_DIR_WRITE, dir_class);
+       audit_register_class(AUDIT_CLASS_CHATTR, chattr_class);
+       return 0;
+}
+
+__initcall(audit_classes_init);
index 4c30ed01f4e18992bfbf121079754fbd03aed898..0b9860530a6ba760385510569b2388f3409c9d12 100644 (file)
@@ -3,7 +3,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 5fd65325b81afd2467efb5e5602edc4e4dc3ebee..567b39bea07e4fbbe091b265b010905e3d30ff5a 100644 (file)
@@ -24,7 +24,6 @@
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
@@ -418,8 +417,14 @@ acpi_cpufreq_cpu_init (
                goto err_free;
 
        perf = data->acpi_data;
-       policy->cpus = perf->shared_cpu_map;
        policy->shared_type = perf->shared_type;
+       /*
+        * Will let policy->cpus know about dependency only when software 
+        * coordination is required.
+        */
+       if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL ||
+           policy->shared_type == CPUFREQ_SHARED_TYPE_ANY)
+               policy->cpus = perf->shared_cpu_map;
 
        if (cpu_has(c, X86_FEATURE_CONSTANT_TSC)) {
                acpi_cpufreq_driver.flags |= CPUFREQ_CONST_LOOPS;
index ab6504efd801cb5a530f170c8d1716a3f31e50f8..304d2eaa4a1b87aeb074d7aceb181a62ba659464 100644 (file)
@@ -20,7 +20,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
index 694d4793bf6ae5f1aaf1bddae150e958f572fecf..54382760983a11312c4eb8c9bc897636eb97631d 100644 (file)
@@ -12,7 +12,6 @@
  * - We disable half multipliers if ACPI is used on A0 stepping CPUs.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
index f7e4356f68202f472d4a94aa0684d05244792e1a..b77f1358bd79e341bd3d2a9a8606819bb1a1f01a 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/cpufreq.h>
-#include <linux/config.h>
 #include <linux/sched.h>       /* current */
 #include <linux/delay.h>
 #include <linux/compiler.h>
@@ -399,8 +398,14 @@ static int centrino_cpu_init_acpi(struct cpufreq_policy *policy)
                dprintk(PFX "obtaining ACPI data failed\n");
                return -EIO;
        }
-       policy->cpus = p->shared_cpu_map;
        policy->shared_type = p->shared_type;
+       /*
+        * Will let policy->cpus know about dependency only when software 
+        * coordination is required.
+        */
+       if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL ||
+           policy->shared_type == CPUFREQ_SHARED_TYPE_ANY)
+               policy->cpus = p->shared_cpu_map;
 
        /* verify the acpi_data */
        if (p->state_count <= 1) {
index 10afc645c540c844576493370ce64d7fd8a8d1c8..5a2e270924b13727f1411eb11dea7a0f114e7cce 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 
index fc5d5215e23deb24fd871c07c26494abfbfad42d..b0862af595aa5f502f043f93a305fcd9eb35cc08 100644 (file)
@@ -6,7 +6,6 @@
 #include <linux/init.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
-#include <linux/config.h>
 #include <linux/interrupt.h>
 #include <linux/smp.h>
 
index afa0888f9a1e8f12cfd185d8874b93f8099ecae1..d555bec0db99d0c0cfa1f3d910a3a17403e7709d 100644 (file)
@@ -6,7 +6,6 @@
 #include <linux/init.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/smp.h>
 #include <linux/thread_info.h>
index 82dffe0d4954b8db6cc8b8cf2dcf50eaf8417370..1f9153ae5b03729c799e792f7bef3a508d49cccd 100644 (file)
@@ -11,7 +11,6 @@
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/jiffies.h>
-#include <linux/config.h>
 #include <linux/workqueue.h>
 #include <linux/interrupt.h>
 #include <linux/smp.h>
index fd2c459a31ef7f70a6433ba04378059b1db29f8c..b95f1b3d53aa1c20761491f280abe819dbe3eb17 100644 (file)
@@ -5,7 +5,6 @@
 #include <linux/init.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
-#include <linux/config.h>
 #include <linux/interrupt.h>
 #include <linux/smp.h>
 
index f6dfa9fb675c1bfc5eba75ba74317ba2815b6da1..fde8bea85cee82b26ca31a34db989aab39e0a723 100644 (file)
@@ -24,7 +24,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 
 #include <linux/types.h>
 #include <linux/errno.h>
@@ -168,6 +167,7 @@ static int cpuid_class_device_create(int i)
        return err;
 }
 
+#ifdef CONFIG_HOTPLUG_CPU
 static int cpuid_class_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
 {
        unsigned int cpu = (unsigned long)hcpu;
@@ -187,6 +187,7 @@ static struct notifier_block __cpuinitdata cpuid_class_cpu_notifier =
 {
        .notifier_call = cpuid_class_cpu_callback,
 };
+#endif /* !CONFIG_HOTPLUG_CPU */
 
 static int __init cpuid_init(void)
 {
@@ -209,7 +210,7 @@ static int __init cpuid_init(void)
                if (err != 0) 
                        goto out_class;
        }
-       register_cpu_notifier(&cpuid_class_cpu_notifier);
+       register_hotcpu_notifier(&cpuid_class_cpu_notifier);
 
        err = 0;
        goto out;
@@ -234,7 +235,7 @@ static void __exit cpuid_exit(void)
                class_device_destroy(cpuid_class, MKDEV(CPUID_MAJOR, cpu));
        class_destroy(cpuid_class);
        unregister_chrdev(CPUID_MAJOR, "cpu/cpuid");
-       unregister_cpu_notifier(&cpuid_class_cpu_notifier);
+       unregister_hotcpu_notifier(&cpuid_class_cpu_notifier);
 }
 
 module_init(cpuid_init);
index 8beb0f07d99966b00206880fb3113db77333edd5..fe158042110bea08fd7774234dfdb3c7275712a0 100644 (file)
@@ -19,7 +19,6 @@
  *     Skip non-WB memory and ignore empty memory ranges.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/mm.h>
index 08c0312d9b6cfa1f1141ca997fd1ff072dc73e05..d3ee73a3eee352456484754fcf926899e92b11f9 100644 (file)
@@ -5,7 +5,6 @@
  * turned off.
  */
 
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/page.h>
 #include <asm/pgtable.h>
index fbdb933251b643b8e726feefe8e350205dbd7396..d9a260f2efb4d24086bf7ee4c1e8e1ab7eaf8c5e 100644 (file)
@@ -40,9 +40,9 @@
  * "current" is in register %ebx during any slow entries.
  */
 
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/thread_info.h>
+#include <asm/irqflags.h>
 #include <asm/errno.h>
 #include <asm/segment.h>
 #include <asm/smp.h>
@@ -77,12 +77,21 @@ NT_MASK             = 0x00004000
 VM_MASK                = 0x00020000
 
 #ifdef CONFIG_PREEMPT
-#define preempt_stop           cli
+#define preempt_stop           cli; TRACE_IRQS_OFF
 #else
 #define preempt_stop
 #define resume_kernel          restore_nocheck
 #endif
 
+.macro TRACE_IRQS_IRET
+#ifdef CONFIG_TRACE_IRQFLAGS
+       testl $IF_MASK,EFLAGS(%esp)     # interrupts off?
+       jz 1f
+       TRACE_IRQS_ON
+1:
+#endif
+.endm
+
 #ifdef CONFIG_VM86
 #define resume_userspace_sig   check_userspace
 #else
@@ -258,6 +267,10 @@ ENTRY(sysenter_entry)
        CFI_REGISTER esp, ebp
        movl TSS_sysenter_esp0(%esp),%esp
 sysenter_past_esp:
+       /*
+        * No need to follow this irqs on/off section: the syscall
+        * disabled irqs and here we enable it straight after entry:
+        */
        sti
        pushl $(__USER_DS)
        CFI_ADJUST_CFA_OFFSET 4
@@ -304,6 +317,7 @@ sysenter_past_esp:
        call *sys_call_table(,%eax,4)
        movl %eax,EAX(%esp)
        cli
+       TRACE_IRQS_OFF
        movl TI_flags(%ebp), %ecx
        testw $_TIF_ALLWORK_MASK, %cx
        jne syscall_exit_work
@@ -311,6 +325,7 @@ sysenter_past_esp:
        movl EIP(%esp), %edx
        movl OLDESP(%esp), %ecx
        xorl %ebp,%ebp
+       TRACE_IRQS_ON
        sti
        sysexit
        CFI_ENDPROC
@@ -340,6 +355,7 @@ syscall_exit:
        cli                             # make sure we don't miss an interrupt
                                        # setting need_resched or sigpending
                                        # between sampling and the iret
+       TRACE_IRQS_OFF
        movl TI_flags(%ebp), %ecx
        testw $_TIF_ALLWORK_MASK, %cx   # current->work
        jne syscall_exit_work
@@ -356,12 +372,15 @@ restore_all:
        CFI_REMEMBER_STATE
        je ldt_ss                       # returning to user-space with LDT SS
 restore_nocheck:
+       TRACE_IRQS_IRET
+restore_nocheck_notrace:
        RESTORE_REGS
        addl $4, %esp
        CFI_ADJUST_CFA_OFFSET -4
 1:     iret
 .section .fixup,"ax"
 iret_exc:
+       TRACE_IRQS_ON
        sti
        pushl $0                        # no error code
        pushl $do_iret_error
@@ -387,11 +406,13 @@ ldt_ss:
        subl $8, %esp           # reserve space for switch16 pointer
        CFI_ADJUST_CFA_OFFSET 8
        cli
+       TRACE_IRQS_OFF
        movl %esp, %eax
        /* Set up the 16bit stack frame with switch32 pointer on top,
         * and a switch16 pointer on top of the current frame. */
        call setup_x86_bogus_stack
        CFI_ADJUST_CFA_OFFSET -8        # frame has moved
+       TRACE_IRQS_IRET
        RESTORE_REGS
        lss 20+4(%esp), %esp    # switch to 16bit stack
 1:     iret
@@ -412,6 +433,7 @@ work_resched:
        cli                             # make sure we don't miss an interrupt
                                        # setting need_resched or sigpending
                                        # between sampling and the iret
+       TRACE_IRQS_OFF
        movl TI_flags(%ebp), %ecx
        andl $_TIF_WORK_MASK, %ecx      # is there any work to be done other
                                        # than syscall tracing?
@@ -463,6 +485,7 @@ syscall_trace_entry:
 syscall_exit_work:
        testb $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP), %cl
        jz work_pending
+       TRACE_IRQS_ON
        sti                             # could let do_syscall_trace() call
                                        # schedule() instead
        movl %esp, %eax
@@ -536,9 +559,14 @@ ENTRY(irq_entries_start)
 vector=vector+1
 .endr
 
+/*
+ * the CPU automatically disables interrupts when executing an IRQ vector,
+ * so IRQ-flags tracing has to follow that:
+ */
        ALIGN
 common_interrupt:
        SAVE_ALL
+       TRACE_IRQS_OFF
        movl %esp,%eax
        call do_IRQ
        jmp ret_from_intr
@@ -550,9 +578,10 @@ ENTRY(name)                                \
        pushl $~(nr);                   \
        CFI_ADJUST_CFA_OFFSET 4;        \
        SAVE_ALL;                       \
+       TRACE_IRQS_OFF                  \
        movl %esp,%eax;                 \
        call smp_/**/name;              \
-       jmp ret_from_intr;      \
+       jmp ret_from_intr;              \
        CFI_ENDPROC
 
 /* The include is where all of the SMP etc. interrupts come from */
@@ -727,7 +756,7 @@ nmi_stack_correct:
        xorl %edx,%edx          # zero error code
        movl %esp,%eax          # pt_regs pointer
        call do_nmi
-       jmp restore_all
+       jmp restore_nocheck_notrace
        CFI_ENDPROC
 
 nmi_stack_fixup:
index 3debc2e26542f36f58b3b7834d3a4fbc294d42c2..eb79aa2fa8bb3ed0b794cddd2e7c499456295b67 100644 (file)
@@ -8,7 +8,6 @@
  */
 
 .text
-#include <linux/config.h>
 #include <linux/threads.h>
 #include <linux/linkage.h>
 #include <asm/segment.h>
index 036a9857936fa26816ca97b3a74021399909a0e8..e3d4b73bfdb0334e6cfb0ccc54a7615acd337ace 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/module.h>
 #include <asm/checksum.h>
 #include <asm/desc.h>
index c4351972d9afc7b5c4b2e39b5222f8f52b930eba..665847281ed25fe963e51a250c1e933eaea217b6 100644 (file)
@@ -8,7 +8,6 @@
  *     Gareth Hughes <gareth@valinux.com>, May 2000
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/module.h>
 #include <asm/processor.h>
index 3c6063671a9f94b4beabb137539880acdc105054..d4756d154f47b4d10447dba20378fca19d957193 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
index ec9ea0269d367fb8c346b883f809ba40d7621b0d..4fb32c551fe0b9bb62df93acab0cb80dd657d359 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/sched.h>
-#include <linux/config.h>
 #include <linux/smp_lock.h>
 #include <linux/mc146818rtc.h>
 #include <linux/compiler.h>
index 16b4917039672bb3200e82c0325ef2f85134fbd9..6cb529f60dcc67c9232d1267112db5f5d09f91e3 100644 (file)
@@ -166,7 +166,7 @@ void irq_ctx_init(int cpu)
        irqctx->tinfo.task              = NULL;
        irqctx->tinfo.exec_domain       = NULL;
        irqctx->tinfo.cpu               = cpu;
-       irqctx->tinfo.preempt_count     = SOFTIRQ_OFFSET;
+       irqctx->tinfo.preempt_count     = 0;
        irqctx->tinfo.addr_limit        = MAKE_MM_SEG(0);
 
        softirq_ctx[cpu] = irqctx;
@@ -211,6 +211,10 @@ asmlinkage void do_softirq(void)
                        : "0"(isp)
                        : "memory", "cc", "edx", "ecx", "eax"
                );
+               /*
+                * Shouldnt happen, we returned above if in_interrupt():
+                */
+               WARN_ON_ONCE(softirq_count());
        }
 
        local_irq_restore(flags);
index 727e419ad78ac496588ea692acad30766bbad37c..de2e16e561c06796d62efe9191b0c388e4d93a83 100644 (file)
@@ -28,7 +28,6 @@
  *             <prasanna@in.ibm.com> added function-return probes.
  */
 
-#include <linux/config.h>
 #include <linux/kprobes.h>
 #include <linux/ptrace.h>
 #include <linux/preempt.h>
index 558bb207720f1ecf13f2fe624037e9bf6b307a56..cd5456f14af4bb16eb83adb53bf22592ed47eb38 100644 (file)
@@ -46,7 +46,6 @@
 #include <asm/io.h>
 #include <linux/proc_fs.h>
 #include <linux/mman.h>
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/pagemap.h>
 #include <linux/ioport.h>
index 6b1392d33ed51d6fcb424b9c839d7768cc840a09..a70b5fa0ef06fd3cf165349959d52f25fe151fed 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/init.h>
 #include <linux/acpi.h>
 #include <linux/delay.h>
-#include <linux/config.h>
 #include <linux/bootmem.h>
 #include <linux/smp_lock.h>
 #include <linux/kernel_stat.h>
index d022cb8fd7251ccc79e3eeb89a8210e5f92b85d1..d535cdbbfd256f5087480f7a75eebc640e9cebc3 100644 (file)
@@ -24,7 +24,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 
 #include <linux/types.h>
 #include <linux/errno.h>
@@ -251,7 +250,9 @@ static int msr_class_device_create(int i)
        return err;
 }
 
-static int msr_class_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
+#ifdef CONFIG_HOTPLUG_CPU
+static int msr_class_cpu_callback(struct notifier_block *nfb,
+                               unsigned long action, void *hcpu)
 {
        unsigned int cpu = (unsigned long)hcpu;
 
@@ -270,6 +271,7 @@ static struct notifier_block __cpuinitdata msr_class_cpu_notifier =
 {
        .notifier_call = msr_class_cpu_callback,
 };
+#endif
 
 static int __init msr_init(void)
 {
@@ -292,7 +294,7 @@ static int __init msr_init(void)
                if (err != 0)
                        goto out_class;
        }
-       register_cpu_notifier(&msr_class_cpu_notifier);
+       register_hotcpu_notifier(&msr_class_cpu_notifier);
 
        err = 0;
        goto out;
@@ -315,7 +317,7 @@ static void __exit msr_exit(void)
                class_device_destroy(msr_class, MKDEV(MSR_MAJOR, cpu));
        class_destroy(msr_class);
        unregister_chrdev(MSR_MAJOR, "cpu/msr");
-       unregister_cpu_notifier(&msr_class_cpu_notifier);
+       unregister_hotcpu_notifier(&msr_class_cpu_notifier);
 }
 
 module_init(msr_init);
index a76e931465858657ac10ffecca2834ff75707cb6..2dd928a84645c53f34c69391c1966cb5ff8e9614 100644 (file)
@@ -107,7 +107,7 @@ int nmi_active;
 static __init void nmi_cpu_busy(void *data)
 {
        volatile int *endflag = data;
-       local_irq_enable();
+       local_irq_enable_in_hardirq();
        /* Intentionally don't use cpu_relax here. This is
           to make sure that the performance counter really ticks,
           even if there is a simulator or similar that catches the
index 0caf14652badfca7856a3b7d13e54cbc0f461918..9000d82c6dc0a784de020d1723ae75522bee9082 100644 (file)
@@ -23,7 +23,6 @@
  * Send feedback to <gone@us.ibm.com>
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/bootmem.h>
 #include <linux/mmzone.h>
index 6946b06e278495cbbfa15383047e026ce7224120..94e2c87edeaa31c76475e48f92e3212ac62119e2 100644 (file)
@@ -28,7 +28,6 @@
 #include <linux/user.h>
 #include <linux/a.out.h>
 #include <linux/interrupt.h>
-#include <linux/config.h>
 #include <linux/utsname.h>
 #include <linux/delay.h>
 #include <linux/reboot.h>
index 87ccdac84928db35706409477a86edc49ac8c736..9f6ab1789bb05fc81593c47211b16bc45be894e1 100644 (file)
@@ -1,7 +1,6 @@
 /*
  * This file contains work-arounds for x86 and x86_64 platform bugs.
  */
-#include <linux/config.h>
 #include <linux/pci.h>
 #include <linux/irq.h>
 
index d207242976d31f8be7127f8db18aede33041867e..54cfeabbc5e4558f7b2435f0f7df51f5ba89315a 100644 (file)
@@ -2,7 +2,6 @@
  *  linux/arch/i386/kernel/reboot.c
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/delay.h>
index 9bf590cefc7d4d55d89fde0561ec6a5fb70d5192..c7d3df23f589422b9753266f9de8617415650531 100644 (file)
@@ -4,7 +4,6 @@
 
    National Semiconductor SCx200 support. */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
index 967dc74df9eeb69750077eaf783bc5af587788a4..98352c374c761c9d2440246b58d0fa36db25bd58 100644 (file)
@@ -12,7 +12,6 @@
  *
  * rw semaphores implemented November 1999 by Benjamin LaHaise <bcrl@kvack.org>
  */
-#include <linux/config.h>
 #include <asm/semaphore.h>
 
 /*
index 6712f0d2eb37372aa040ce352ef68a9ebd8c09d7..08c00d20f1623c738d93117747aa9a7e016f9bfd 100644 (file)
@@ -23,7 +23,6 @@
  * This file handles the architecture-dependent parts of initialization
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/mmzone.h>
index 89e7315e539c49a5f8f19a3479ae21774075a374..6f5fea05f1d7fc92a80e66819962cf4ee269086f 100644 (file)
@@ -34,7 +34,6 @@
 *              Rusty Russell   :       Hacked into shape for new "hotplug" boot process. */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 
index 989c85255dbe53a5ca33fd41cc6aae8423b7a8a2..b1809c9a0899fcade490c50ed6733a2946623d25 100644 (file)
@@ -23,7 +23,6 @@
  *
  * Send feedback to Pat Gaughen <gone@us.ibm.com>
  */
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/bootmem.h>
 #include <linux/mmzone.h>
diff --git a/arch/i386/kernel/stacktrace.c b/arch/i386/kernel/stacktrace.c
new file mode 100644 (file)
index 0000000..e62a037
--- /dev/null
@@ -0,0 +1,98 @@
+/*
+ * arch/i386/kernel/stacktrace.c
+ *
+ * Stack trace management functions
+ *
+ *  Copyright (C) 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
+ */
+#include <linux/sched.h>
+#include <linux/stacktrace.h>
+
+static inline int valid_stack_ptr(struct thread_info *tinfo, void *p)
+{
+       return  p > (void *)tinfo &&
+               p < (void *)tinfo + THREAD_SIZE - 3;
+}
+
+/*
+ * Save stack-backtrace addresses into a stack_trace buffer:
+ */
+static inline unsigned long
+save_context_stack(struct stack_trace *trace, unsigned int skip,
+                  struct thread_info *tinfo, unsigned long *stack,
+                  unsigned long ebp)
+{
+       unsigned long addr;
+
+#ifdef CONFIG_FRAME_POINTER
+       while (valid_stack_ptr(tinfo, (void *)ebp)) {
+               addr = *(unsigned long *)(ebp + 4);
+               if (!skip)
+                       trace->entries[trace->nr_entries++] = addr;
+               else
+                       skip--;
+               if (trace->nr_entries >= trace->max_entries)
+                       break;
+               /*
+                * break out of recursive entries (such as
+                * end_of_stack_stop_unwind_function):
+                */
+               if (ebp == *(unsigned long *)ebp)
+                       break;
+
+               ebp = *(unsigned long *)ebp;
+       }
+#else
+       while (valid_stack_ptr(tinfo, stack)) {
+               addr = *stack++;
+               if (__kernel_text_address(addr)) {
+                       if (!skip)
+                               trace->entries[trace->nr_entries++] = addr;
+                       else
+                               skip--;
+                       if (trace->nr_entries >= trace->max_entries)
+                               break;
+               }
+       }
+#endif
+
+       return ebp;
+}
+
+/*
+ * Save stack-backtrace addresses into a stack_trace buffer.
+ * If all_contexts is set, all contexts (hardirq, softirq and process)
+ * are saved. If not set then only the current context is saved.
+ */
+void save_stack_trace(struct stack_trace *trace,
+                     struct task_struct *task, int all_contexts,
+                     unsigned int skip)
+{
+       unsigned long ebp;
+       unsigned long *stack = &ebp;
+
+       WARN_ON(trace->nr_entries || !trace->max_entries);
+
+       if (!task || task == current) {
+               /* Grab ebp right from our regs: */
+               asm ("movl %%ebp, %0" : "=r" (ebp));
+       } else {
+               /* ebp is the last reg pushed by switch_to(): */
+               ebp = *(unsigned long *) task->thread.esp;
+       }
+
+       while (1) {
+               struct thread_info *context = (struct thread_info *)
+                               ((unsigned long)stack & (~(THREAD_SIZE - 1)));
+
+               ebp = save_context_stack(trace, skip, context, stack, ebp);
+               stack = (unsigned long *)context->previous_esp;
+               if (!all_contexts || !stack ||
+                               trace->nr_entries >= trace->max_entries)
+                       break;
+               trace->entries[trace->nr_entries++] = ULONG_MAX;
+               if (trace->nr_entries >= trace->max_entries)
+                       break;
+       }
+}
+
index 5f43d0410122764fc8dd752b90878cc9fed26841..316421a7f56f6f6a1b5bfafb6a29fb27322dda14 100644 (file)
@@ -60,7 +60,6 @@
 #include "mach_time.h"
 
 #include <linux/timex.h>
-#include <linux/config.h>
 
 #include <asm/hpet.h>
 
index a529f0cdce17018dcc6849340954e84731006598..14a1376fedd1423710f64893ec5e6894a26507ff 100644 (file)
@@ -18,7 +18,6 @@
 #include <asm/apic.h>
 
 #include <linux/timex.h>
-#include <linux/config.h>
 
 #include <asm/hpet.h>
 #include <linux/hpet.h>
index 78464097470a282a8064e8b873b1edcdfa5a1da0..2bf8b55b91f83795e3951a3ec04d3de75ec9f9fb 100644 (file)
@@ -11,7 +11,6 @@
  * 'Traps.c' handles hardware traps and faults after we have saved some
  * state in 'asm.s'.
  */
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
@@ -116,28 +115,13 @@ static inline int valid_stack_ptr(struct thread_info *tinfo, void *p)
 }
 
 /*
- * Print CONFIG_STACK_BACKTRACE_COLS address/symbol entries per line.
+ * Print one address/symbol entries per line.
  */
-static inline int print_addr_and_symbol(unsigned long addr, char *log_lvl,
-                                       int printed)
+static inline void print_addr_and_symbol(unsigned long addr, char *log_lvl)
 {
-       if (!printed)
-               printk(log_lvl);
-
-#if CONFIG_STACK_BACKTRACE_COLS == 1
        printk(" [<%08lx>] ", addr);
-#else
-       printk(" <%08lx> ", addr);
-#endif
-       print_symbol("%s", addr);
 
-       printed = (printed + 1) % CONFIG_STACK_BACKTRACE_COLS;
-       if (printed)
-               printk(" ");
-       else
-               printk("\n");
-
-       return printed;
+       print_symbol("%s\n", addr);
 }
 
 static inline unsigned long print_context_stack(struct thread_info *tinfo,
@@ -145,12 +129,11 @@ static inline unsigned long print_context_stack(struct thread_info *tinfo,
                                char *log_lvl)
 {
        unsigned long addr;
-       int printed = 0; /* nr of entries already printed on current line */
 
 #ifdef CONFIG_FRAME_POINTER
        while (valid_stack_ptr(tinfo, (void *)ebp)) {
                addr = *(unsigned long *)(ebp + 4);
-               printed = print_addr_and_symbol(addr, log_lvl, printed);
+               print_addr_and_symbol(addr, log_lvl);
                /*
                 * break out of recursive entries (such as
                 * end_of_stack_stop_unwind_function):
@@ -163,28 +146,23 @@ static inline unsigned long print_context_stack(struct thread_info *tinfo,
        while (valid_stack_ptr(tinfo, stack)) {
                addr = *stack++;
                if (__kernel_text_address(addr))
-                       printed = print_addr_and_symbol(addr, log_lvl, printed);
+                       print_addr_and_symbol(addr, log_lvl);
        }
 #endif
-       if (printed)
-               printk("\n");
-
        return ebp;
 }
 
-static asmlinkage int show_trace_unwind(struct unwind_frame_info *info, void *log_lvl)
+static asmlinkage int
+show_trace_unwind(struct unwind_frame_info *info, void *log_lvl)
 {
        int n = 0;
-       int printed = 0; /* nr of entries already printed on current line */
 
        while (unwind(info) == 0 && UNW_PC(info)) {
-               ++n;
-               printed = print_addr_and_symbol(UNW_PC(info), log_lvl, printed);
+               n++;
+               print_addr_and_symbol(UNW_PC(info), log_lvl);
                if (arch_unw_user_mode(info))
                        break;
        }
-       if (printed)
-               printk("\n");
        return n;
 }
 
index 00e0118e717c3568a960021be276e9c4f7e37835..8355d8d87d183d8b81f78e04c053508fa46c7553 100644 (file)
@@ -31,7 +31,6 @@
  */
 
 #include <linux/capability.h>
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/interrupt.h>
 #include <linux/sched.h>
index 94c7867ddc33035e6fc39dbd6f0cf351daf712b8..75ffd02654fc57b89f8a4912946cb6ea6a4d95bb 100644 (file)
@@ -25,7 +25,6 @@
  *             2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <asm/errno.h>
                                
 /*
index 891b2359d18a815eaaa45aca0fa8cbe2eaae2947..8ac51b82a632ca61a4e112a66301816cb0daf2d5 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/module.h>
 
index 2afda94dffd340b4097b3819b7770c1bdfb263e5..28084d2e8dd4d96f8371a629f206406b05031203 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/string.h>
 #include <linux/sched.h>
index c5aa65f7c02a68d096e966286f0dfdfcc879bed9..4b75212ab6dd877786057eef6b2192cfadd4d6ed 100644 (file)
@@ -5,7 +5,6 @@
  * Copyright 1997 Andi Kleen <ak@muc.de>
  * Copyright 1997 Linus Torvalds
  */
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/highmem.h>
 #include <linux/blkdev.h>
index 004837c587939f89e1dc0aad2136ac26529e58ac..c511705c386cc6b251b6c3707864b356155a04bd 100644 (file)
@@ -2,7 +2,6 @@
  *     Machine specific setup for generic
  */
 
-#include <linux/config.h>
 #include <linux/smp.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
@@ -80,7 +79,7 @@ void __init trap_init_hook(void)
 {
 }
 
-static struct irqaction irq0  = { timer_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "timer", NULL, NULL};
+static struct irqaction irq0  = { timer_interrupt, IRQF_DISABLED, CPU_MASK_NONE, "timer", NULL, NULL};
 
 /**
  * time_init_hook - do any specific initialisations for the system timer.
index 037b2af1a1f4972a0940f723d1fa39310b4e1dfd..ef7a6e6fcb9f0a834e67a9d4608707f98cd5e027 100644 (file)
@@ -3,7 +3,6 @@
  * Drives the local APIC in "clustered mode".
  */
 #define APIC_DEFINITION 1
-#include <linux/config.h>
 #include <linux/threads.h>
 #include <linux/cpumask.h>
 #include <asm/mpspec.h>
index 7da14e9a79c31db5d115a04c2578a4abc98f501f..96c19821e47d6546c288e28edd8ec1120ab095ee 100644 (file)
@@ -2,7 +2,6 @@
  * Default generic APIC driver. This handles upto 8 CPUs.
  */
 #define APIC_DEFINITION 1
-#include <linux/config.h>
 #include <linux/threads.h>
 #include <linux/cpumask.h>
 #include <asm/mpspec.h>
index 48d3ec37241bef87dbc7ef8c27ae1189cf02adba..845cdd0b359350f4c6e860f9287999038c7358f7 100644 (file)
@@ -2,7 +2,6 @@
  * APIC driver for the Unisys ES7000 chipset.
  */
 #define APIC_DEFINITION 1
-#include <linux/config.h>
 #include <linux/threads.h>
 #include <linux/cpumask.h>
 #include <asm/mpspec.h>
index d55fa7b187ab656f9c581b11c5dfc12f7186f82e..bcd1bcfaa7238e9ad546c7191d506e0329e8f578 100644 (file)
@@ -3,7 +3,6 @@
  * 
  * Generic x86 APIC driver probe layer.
  */  
-#include <linux/config.h>
 #include <linux/threads.h>
 #include <linux/cpumask.h>
 #include <linux/string.h>
index 65ddf74d7f25c9428d66356819a3e7ec9d512782..b73501ddd653a9fed0be28c112a1a1c351707de2 100644 (file)
@@ -2,7 +2,6 @@
  * APIC driver for the IBM "Summit" chipset.
  */
 #define APIC_DEFINITION 1
-#include <linux/config.h>
 #include <linux/threads.h>
 #include <linux/cpumask.h>
 #include <asm/mpspec.h>
index 5f3d7e6de37b9cc4440cc9f7e7ba6a52271477cc..f3c74fab8b95d18b32878fe966dbbaef20e77481 100644 (file)
@@ -1,5 +1,4 @@
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/smp.h>
 
index 1f84cdb24779179b77da4b80d711ae6f276f5d5f..885c7cbfd4785b69edca7789b620299988a6e4d0 100644 (file)
@@ -115,7 +115,7 @@ void __init pre_setup_arch_hook()
 
 static struct irqaction irq0 = {
        .handler =      timer_interrupt,
-       .flags =        SA_INTERRUPT,
+       .flags =        IRQF_DISABLED,
        .name =         "timer",
 };
 
index 964353992031d6f73472d8162fa6bdf6bb310f13..5199bd03254a58b0359f6efc6968db0daa369154 100644 (file)
@@ -1,6 +1,5 @@
 /* VISWS traps */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index c418521dd5547073cf78bfbf0e9bb710366cb3b0..828522541a88429e43b6d4ed0aa5bcae0e01af0f 100644 (file)
@@ -16,7 +16,6 @@
  *  25/11/2002 - Updated for 2.5 by Andrey Panin <pazke@orbita1.ru>
  */
 
-#include <linux/config.h>
 #include <linux/kernel_stat.h>
 #include <linux/interrupt.h>
 #include <linux/smp_lock.h>
index defc6ebbd56517ac054deeeafbf17239de36cc5d..cfa16c151c8f96a298f318106424b84a0194c678 100644 (file)
@@ -2,7 +2,6 @@
  *     Machine specific setup for generic
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <asm/arch_hooks.h>
@@ -41,7 +40,7 @@ void __init trap_init_hook(void)
 {
 }
 
-static struct irqaction irq0  = { timer_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "timer", NULL, NULL};
+static struct irqaction irq0  = { timer_interrupt, IRQF_DISABLED, CPU_MASK_NONE, "timer", NULL, NULL};
 
 void __init time_init_hook(void)
 {
index b584060ec004da766c024771b8af916e8d3dc702..80b7f2fc4f46ac9038128f852ad11d3e67ad3b03 100644 (file)
@@ -12,7 +12,6 @@
  *     voyager_smp.c - Voyager SMP hal (emulates linux smp.c)
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/sched.h>
index 10d21df1453143c5c8d6c33c629a6267985f2385..f50c6c6ad680e8eb7c2092757d18291fa3e68ab6 100644 (file)
@@ -16,7 +16,6 @@
  * of bit shift manipulations to send and receive packets on the
  * serial bus */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/completion.h>
 #include <linux/sched.h>
index 5b8b579a079fa8a7afdc52e4871aef91b3a94665..6c86575ffdcb250a7168d3922d4b977a61bbed32 100644 (file)
@@ -9,7 +9,6 @@
  * This file provides all the same external entries as smp.c but uses
  * the voyager hal to provide the functionality
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/mm.h>
 #include <linux/kernel_stat.h>
@@ -1938,3 +1937,9 @@ smp_cpus_done(unsigned int max_cpus)
 {
        zap_low_mappings();
 }
+
+void __init
+smp_setup_processor_id(void)
+{
+       current_thread_info()->cpu = hard_smp_processor_id();
+}
index 2b03884fdb2a968a904ca08f29c9f8c017e22788..50f6de6ff64dadd20988cf1de715ffb9c76eb863 100644 (file)
@@ -14,7 +14,6 @@
  * */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/kernel_stat.h>
 #include <linux/delay.h>
index 523b30634e0a87c76a32ca57f0977593b3364108..5d44f4f5ff592a479d965449f1962dbe39daaee9 100644 (file)
@@ -15,7 +15,6 @@
  * boot_pte_t is defined only if this all works correctly
  */
 
-#include <linux/config.h>
 #undef CONFIG_X86_PAE
 #include <asm/page.h>
 #include <asm/pgtable.h>
index fe6eb901326e6610171a927dddd5e01280d7a71b..7c392dc553b89659ce6041f09d5aae62d95ab50a 100644 (file)
@@ -22,7 +22,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/bootmem.h>
 #include <linux/mmzone.h>
@@ -43,7 +42,7 @@ EXPORT_SYMBOL(node_data);
 bootmem_data_t node0_bdata;
 
 /*
- * numa interface - we expect the numa architecture specfic code to have
+ * numa interface - we expect the numa architecture specific code to have
  *                  populated the following initialisation.
  *
  * 1) node_online_map  - the map of all nodes configured (online) in the system
index f706449319c4577e5d944561b295d199449bcc02..de03c5430abc86a03b96d0326bd6ab3317d624b5 100644 (file)
@@ -2,7 +2,6 @@
  * linux/arch/i386/mm/extable.c
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
index 6ee7faaf2c1bc4e19411ad825687fa7ce6921082..f7279468323a62cef22984f3e81707eaa6a93b4b 100644 (file)
@@ -389,7 +389,7 @@ fastcall void __kprobes do_page_fault(struct pt_regs *regs,
        /* When running in the kernel we expect faults to occur only to
         * addresses in user space.  All other faults represent errors in the
         * kernel and should generate an OOPS.  Unfortunatly, in the case of an
-        * erroneous fault occuring in a code path which already holds mmap_sem
+        * erroneous fault occurring in a code path which already holds mmap_sem
         * we will deadlock attempting to validate the fault against the
         * address space.  Luckily the kernel only validly references user
         * space from well defined areas of code, which are listed in the
index a7d8915854116264048f62c84d63dc495fc212b7..1719a8141f81aee9f480087be3e54a68eef4adef 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 2002, Rohit Seth <rohit.seth@intel.com>
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/fs.h>
 #include <linux/mm.h>
index f84b16e007ff86fb73185482efcbca7be8eb4ebd..89e8486aac3499f3f39b35f5268df100b95285ad 100644 (file)
@@ -6,7 +6,6 @@
  *  Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
@@ -726,16 +725,15 @@ static int noinline do_test_wp_bit(void)
 
 #ifdef CONFIG_DEBUG_RODATA
 
-extern char __start_rodata, __end_rodata;
 void mark_rodata_ro(void)
 {
-       unsigned long addr = (unsigned long)&__start_rodata;
+       unsigned long addr = (unsigned long)__start_rodata;
 
-       for (; addr < (unsigned long)&__end_rodata; addr += PAGE_SIZE)
+       for (; addr < (unsigned long)__end_rodata; addr += PAGE_SIZE)
                change_page_attr(virt_to_page(addr), 1, PAGE_KERNEL_RO);
 
-       printk ("Write protecting the kernel read-only data: %luk\n",
-                       (unsigned long)(&__end_rodata - &__start_rodata) >> 10);
+       printk("Write protecting the kernel read-only data: %uk\n",
+                       (__end_rodata - __start_rodata) >> 10);
 
        /*
         * change_page_attr() requires a global_flush_tlb() call after it.
index 353a836ed63c03f363acbcba49e4c54d9258f855..8564b6ae17e330aa7ca48489a3f71bbf458415ba 100644 (file)
@@ -3,7 +3,6 @@
  * Thanks to Ben LaHaise for precious feedback.
  */ 
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/sched.h>
 #include <linux/highmem.h>
index 2889567e21a12f09fe74f14496d5452c1ae72450..bd98768d8764f52b0693a4413d32003bd911daed 100644 (file)
@@ -2,7 +2,6 @@
  *  linux/arch/i386/mm/pgtable.c
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -30,7 +29,6 @@ void show_mem(void)
        struct page *page;
        pg_data_t *pgdat;
        unsigned long i;
-       struct page_state ps;
        unsigned long flags;
 
        printk(KERN_INFO "Mem-info:\n");
@@ -58,12 +56,13 @@ void show_mem(void)
        printk(KERN_INFO "%d pages shared\n", shared);
        printk(KERN_INFO "%d pages swap cached\n", cached);
 
-       get_page_state(&ps);
-       printk(KERN_INFO "%lu pages dirty\n", ps.nr_dirty);
-       printk(KERN_INFO "%lu pages writeback\n", ps.nr_writeback);
-       printk(KERN_INFO "%lu pages mapped\n", ps.nr_mapped);
-       printk(KERN_INFO "%lu pages slab\n", ps.nr_slab);
-       printk(KERN_INFO "%lu pages pagetables\n", ps.nr_page_table_pages);
+       printk(KERN_INFO "%lu pages dirty\n", global_page_state(NR_FILE_DIRTY));
+       printk(KERN_INFO "%lu pages writeback\n",
+                                       global_page_state(NR_WRITEBACK));
+       printk(KERN_INFO "%lu pages mapped\n", global_page_state(NR_FILE_MAPPED));
+       printk(KERN_INFO "%lu pages slab\n", global_page_state(NR_SLAB));
+       printk(KERN_INFO "%lu pages pagetables\n",
+                                       global_page_state(NR_PAGETABLE));
 }
 
 /*
index f9156d3ac7231c731703070cb8c2e49f33864de8..c7650a7e0b077b0c482d9a7f759982c40abb4a72 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/pci.h>
 #include <linux/init.h>
 #include "pci.h"
index 8ce69508f3c78f20e2ddd62f5c45f79dd5d84c2f..4a8995c9c76204a1d52636884c758dc9e75bebd1 100644 (file)
@@ -4,7 +4,6 @@
  *     (c) 1999--2000 Martin Mares <mj@ucw.cz>
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
@@ -865,7 +864,7 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign)
                for (i = 0; i < 16; i++) {
                        if (!(mask & (1 << i)))
                                continue;
-                       if (pirq_penalty[i] < pirq_penalty[newirq] && can_request_irq(i, SA_SHIRQ))
+                       if (pirq_penalty[i] < pirq_penalty[newirq] && can_request_irq(i, IRQF_SHARED))
                                newirq = i;
                }
        }
index 6c17433fdf7ddb8b9d5d8dfa3d40626136933bb5..f1b486d4190b0c38411eac8c76d95dbaf3d67721 100644 (file)
@@ -4,7 +4,6 @@
  *     (c) 1999--2000 Martin Mares <mj@ucw.cz>
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/init.h>
index e6517915fe3e19ebc1a74cc7c34ac6be9eb616b9..5a1abeff033ba7ed33ecb97151aba3186aa62446 100644 (file)
@@ -7,7 +7,6 @@
  * Copyright (c) 2001 Patrick Mochel <mochel@osdl.org>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/suspend.h>
 #include <asm/mtrr.h>
index b487e227a1f7a3e6b17dd48d57a81d1319e0e376..47de9ee6bcd66b03ca431b06b13681f84f0da446 100644 (file)
@@ -70,6 +70,11 @@ config DMA_IS_DMA32
        bool
        default y
 
+config DMA_IS_NORMAL
+       bool
+       depends on IA64_SGI_SN2
+       default y
+
 choice
        prompt "System type"
        default IA64_GENERIC
index 38aa9c108857824b674636dbcdf577dbdd623447..5ab12b8351d020458a4da260c364cc893effd675 100644 (file)
@@ -8,7 +8,6 @@
  * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
  * Copyright (C) 1999 Vijay Chander <vijay@engr.sgi.com>
  */
-#include <linux/config.h>
 
 #include <linux/init.h>
 #include <linux/delay.h>
index 5825ddee58d608becf27492ff186f2aa02d629fb..db8e1fcfa047d7e53a5f2f1961adad1ecef4327d 100644 (file)
@@ -19,7 +19,6 @@
 **
 */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
index 51a7b7b4dd0e7c5720683a40637cdb79a31ec4c4..c5e9baafafe046e8c56ebb0d27b15ad03bda821a 100644 (file)
@@ -11,7 +11,6 @@
  */
 struct task_struct;    /* forward declaration for elf.h */
 
-#include <linux/config.h>
 #include <linux/elf.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
index 30fdfb1d0a53e3d08c9f817eaf34a0bd7b9a78f3..5a0a7afcfc3a0ad010ceb29ff18a8618fdc81b4d 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 1998-2001 Hewlett-Packard Co
  *     David Mosberger-Tang <davidm@hpl.hp.com>
  */
-#include <linux/config.h>
 
 #ifdef CONFIG_PCI
 # include <linux/pci.h>
index 5deff21e5877fda029f7d0a170d3fe95c71da5de..6e149c8ab83514af175ea8d03563b43893acc5d8 100644 (file)
@@ -5,7 +5,6 @@
  *     David Mosberger-Tang <davidm@hpl.hp.com>
  * Copyright (C) 1999 Vijay Chander <vijay@engr.sgi.com>
  */
-#include <linux/config.h>
 
 #include <linux/init.h>
 #include <linux/kernel.h>
index 694fc86bfbd5d85a1808ea0ad8fb4f11074904a0..f2297192a5825ab39ffe20e4b1b0c3cb15d08966 100644 (file)
@@ -5,7 +5,6 @@
  *     David Mosberger-Tang <davidm@hpl.hp.com>
  * Copyright (C) 1999 Vijay Chander <vijay@engr.sgi.com>
  */
-#include <linux/config.h>
 #include <linux/console.h>
 #include <linux/init.h>
 #include <linux/kdev_t.h>
index 0639ec0ed015cb57d66c6b5526203c2ee47cf699..b5195be6281895d3ea6fb42eca4cb4fb5b41308d 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 1999-2001, 2003 Hewlett-Packard Co
  *     Stephane Eranian <eranian@hpl.hp.com>
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/types.h>
index 0e5c6ae502288f97d0dcf9e55671aa269ce94511..0daacc20ed36e26c8600176b5332a5ce4a65b10f 100644 (file)
@@ -16,7 +16,6 @@
  * 07/30/02 D. Mosberger       Replace sti()/cli() with explicit spinlocks & local irq masking
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
@@ -47,7 +46,7 @@
 
 #define NR_PORTS       1       /* only one port for now */
 
-#define IRQ_T(info) ((info->flags & ASYNC_SHARE_IRQ) ? SA_SHIRQ : SA_INTERRUPT)
+#define IRQ_T(info) ((info->flags & ASYNC_SHARE_IRQ) ? IRQF_SHARED : IRQF_DISABLED)
 
 #define SSC_GETCHAR    21
 
index 61cb60affd95aec8c828a92a7540bffa6bc7bfba..baad8c7699c09db3fa93ea39d4aa4178670bddfd 100644 (file)
@@ -4,6 +4,7 @@
 
 obj-y := ia32_entry.o sys_ia32.o ia32_signal.o \
         ia32_support.o ia32_traps.o binfmt_elf32.o ia32_ldt.o
+obj-$(CONFIG_AUDIT) += audit.o
 
 # Don't let GCC uses f16-f31 so that save_ia32_fpstate_live() and
 # restore_ia32_fpstate_live() can be sure the live register contain user-level state.
diff --git a/arch/ia64/ia32/audit.c b/arch/ia64/ia32/audit.c
new file mode 100644 (file)
index 0000000..ab94f2e
--- /dev/null
@@ -0,0 +1,11 @@
+#include <asm-i386/unistd.h>
+
+unsigned ia32_dir_class[] = {
+#include <asm-generic/audit_dir_write.h>
+~0U
+};
+
+unsigned ia32_chattr_class[] = {
+#include <asm-generic/audit_change_attr.h>
+~0U
+};
index da03c06744f1bf5206cfaee62662fb8b08144877..daa6b91bc921907435c47151303cc8ef81d6ff59 100644 (file)
@@ -9,7 +9,6 @@
  * 04/13/01    D. Mosberger    dropped saving tssd in ar.k1---it's not needed
  * 09/14/01    D. Mosberger    fixed memory management for gdt/tss page
  */
-#include <linux/config.h>
 
 #include <linux/types.h>
 #include <linux/mm.h>
index ccb98ed48e58d27467e53f8e38830cab3b52b7c4..703a67c934f84c6619bfa7693c247eb9fca6e143 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _ASM_IA64_IA32_PRIV_H
 #define _ASM_IA64_IA32_PRIV_H
 
-#include <linux/config.h>
 
 #include <asm/ia32.h>
 
index 5366b3b23d0909dda2eee5ed2858d02d4f6234e1..6aa3c51619ca77bcb1b88410a21c43e7184aea8a 100644 (file)
@@ -14,7 +14,6 @@
  * environment.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/syscalls.h>
 #include <linux/sysctl.h>
index 09a0dbc17fb687bfc6e79ba6377e012246846180..0e4553f320bffd4a812401f0cae3836f63d88c7d 100644 (file)
@@ -29,6 +29,7 @@ obj-$(CONFIG_CPU_FREQ)                += cpufreq/
 obj-$(CONFIG_IA64_MCA_RECOVERY)        += mca_recovery.o
 obj-$(CONFIG_KPROBES)          += kprobes.o jprobes.o
 obj-$(CONFIG_IA64_UNCACHED_ALLOCATOR)  += uncached.o
+obj-$(CONFIG_AUDIT)            += audit.o
 mca_recovery-y                 += mca_drv.o mca_drv_asm.o
 
 # The gate DSO image is built using a special linker script.
index fff82929d225a7436618be9493d6bc38565fd5f6..b7515bc808a8d815708c45124661e94cc4d63286 100644 (file)
@@ -8,7 +8,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/acpi.h>
@@ -51,7 +50,7 @@ static acpi_status hp_ccsr_locate(acpi_handle obj, u64 *base, u64 *length)
        memcpy(length, vendor->byte_data + 8, sizeof(*length));
 
   exit:
-       acpi_os_free(buffer.pointer);
+       kfree(buffer.pointer);
        return status;
 }
 
index ca16d9556bdefa0a96ed5d60992955b407b42cb9..99761b81db4496a78c0ea1eb0cb1076c438c8c3c 100644 (file)
@@ -32,7 +32,6 @@
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
@@ -857,7 +856,7 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
        obj = buffer.pointer;
        if (obj->type != ACPI_TYPE_BUFFER ||
            obj->buffer.length < sizeof(*lsapic)) {
-               acpi_os_free(buffer.pointer);
+               kfree(buffer.pointer);
                return -EINVAL;
        }
 
@@ -865,13 +864,13 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
 
        if ((lsapic->header.type != ACPI_MADT_LSAPIC) ||
            (!lsapic->flags.enabled)) {
-               acpi_os_free(buffer.pointer);
+               kfree(buffer.pointer);
                return -EINVAL;
        }
 
        physid = ((lsapic->id << 8) | (lsapic->eid));
 
-       acpi_os_free(buffer.pointer);
+       kfree(buffer.pointer);
        buffer.length = ACPI_ALLOCATE_BUFFER;
        buffer.pointer = NULL;
 
@@ -935,20 +934,20 @@ acpi_map_iosapic(acpi_handle handle, u32 depth, void *context, void **ret)
        obj = buffer.pointer;
        if (obj->type != ACPI_TYPE_BUFFER ||
            obj->buffer.length < sizeof(*iosapic)) {
-               acpi_os_free(buffer.pointer);
+               kfree(buffer.pointer);
                return AE_OK;
        }
 
        iosapic = (struct acpi_table_iosapic *)obj->buffer.pointer;
 
        if (iosapic->header.type != ACPI_MADT_IOSAPIC) {
-               acpi_os_free(buffer.pointer);
+               kfree(buffer.pointer);
                return AE_OK;
        }
 
        gsi_base = iosapic->global_irq_base;
 
-       acpi_os_free(buffer.pointer);
+       kfree(buffer.pointer);
 
        /*
         * OK, it's an IOSAPIC MADT entry, look for a _PXM value to tell
index 16e7b6600ae67005e3afbf5655647bd5c894e8c5..75a2a2c12258179b53fb1b76b0243ef3d9cf602d 100644 (file)
@@ -5,7 +5,6 @@
  */
 
 #define ASM_OFFSETS_C 1
-#include <linux/config.h>
 
 #include <linux/sched.h>
 
diff --git a/arch/ia64/kernel/audit.c b/arch/ia64/kernel/audit.c
new file mode 100644 (file)
index 0000000..f251293
--- /dev/null
@@ -0,0 +1,29 @@
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/audit.h>
+#include <asm/unistd.h>
+
+static unsigned dir_class[] = {
+#include <asm-generic/audit_dir_write.h>
+~0U
+};
+
+static unsigned chattr_class[] = {
+#include <asm-generic/audit_change_attr.h>
+~0U
+};
+
+static int __init audit_classes_init(void)
+{
+#ifdef CONFIG_IA32_SUPPORT
+       extern __u32 ia32_dir_class[];
+       extern __u32 ia32_chattr_class[];
+       audit_register_class(AUDIT_CLASS_DIR_WRITE_32, ia32_dir_class);
+       audit_register_class(AUDIT_CLASS_CHATTR_32, ia32_chattr_class);
+#endif
+       audit_register_class(AUDIT_CLASS_DIR_WRITE, dir_class);
+       audit_register_class(AUDIT_CLASS_CHATTR, chattr_class);
+       return 0;
+}
+
+__initcall(audit_classes_init);
index 5a1bf815282d71fda393b82e6941710afbda0c27..86faf221a070e59f48d1a11cf308d5ca2899f750 100644 (file)
@@ -9,7 +9,6 @@
  *      Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
index c33d0ba7e300097f569a826642a6189fa9a3ac90..b13c0555c3ba4a57989178de6f8b7633fcd85dc7 100644 (file)
@@ -20,7 +20,6 @@
  * Goutham Rao: <goutham.rao@intel.com>
  *     Skip non-WB memory and ignore empty memory ranges.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 32c999f58d129486d638299a0dce3d06715f4538..12701cf32d9944de96a3fa609788d50fc79b8518 100644 (file)
@@ -31,7 +31,6 @@
  *     pNonSys:        !pSys
  */
 
-#include <linux/config.h>
 
 #include <asm/asmmacro.h>
 #include <asm/cache.h>
index ebc3dfb88826dd0bc934a78536432803b3bd05c7..b83edac029659f3824ce63915a8d8592806042e0 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 
 /*
  * Preserved registers that are shared between code in ivt.S and
index 86064ca98952fce580151aa75a41f302ef64b4da..3274850cf2722f07726582c3d133f5c14229d475 100644 (file)
@@ -6,7 +6,6 @@
  *     David Mosberger-Tang <davidm@hpl.hp.com>
  */
 
-#include <linux/config.h>
 
 #include <asm/asmmacro.h>
 #include <asm/errno.h>
index 7c99e6ec3dafc6d05176c55f6c0a7d1cb230ab60..cc35cddfd4cfdd8e047ed30b06ef6e87f7f5c7e2 100644 (file)
@@ -4,7 +4,6 @@
  * in one page).  This script controls its layout.
  */
 
-#include <linux/config.h>
 
 #include <asm/system.h>
 
index f1778a84ea61b95487ba5ee3f0fe01161cfe1c00..561b8f1d3bc7dbb62c05f41494f856b199afe2ab 100644 (file)
@@ -19,7 +19,6 @@
  *   Support for CPU Hotplug
  */
 
-#include <linux/config.h>
 
 #include <asm/asmmacro.h>
 #include <asm/fpu.h>
index bbcfd08378a6c37d1389433f6d92c5d54a33e893..b7cf651ceb14538eb5c1d7e424f8de41746fd533 100644 (file)
@@ -5,7 +5,6 @@
  * All other exports should be put directly after the definition.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/string.h>
index efc7df4b0fd251a126b29a263546bb4ef2181f07..9bf15fefa7e4e00517f2203cdde817b9299d9a14 100644 (file)
@@ -79,7 +79,6 @@
  * describeinterrupts.  Now we use "IRQ" only for Linux IRQ's.  ISA IRQ
  * (isa_irq) is the only exception in this source code.
  */
-#include <linux/config.h>
 
 #include <linux/acpi.h>
 #include <linux/init.h>
index f5035304594e5af977d6b432a3f82e45b9320d93..a041367f043bb8324ea854adcb9d0c801cd41597 100644 (file)
@@ -14,7 +14,6 @@
  *                                             Added CPU Hotplug handling for IPF.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/jiffies.h>
@@ -236,7 +235,7 @@ extern irqreturn_t handle_IPI (int irq, void *dev_id, struct pt_regs *regs);
 
 static struct irqaction ipi_irqaction = {
        .handler =      handle_IPI,
-       .flags =        SA_INTERRUPT,
+       .flags =        IRQF_DISABLED,
        .name =         "IPI"
 };
 #endif
index 829a43cab79705e998e7aff8f6d577b2e7cede50..6b7fcbd3f6f1a9789ccdc755ee0a59122578fe78 100644 (file)
@@ -38,7 +38,6 @@
  * Table is based upon EAS2.6 (Oct 1999)
  */
 
-#include <linux/config.h>
 
 #include <asm/asmmacro.h>
 #include <asm/break.h>
index f9039f88d01dfbcefb9174c0f59bb968fa92f5bd..00d9c83b80205dd43669b6e5d87f4a882cf3bbce 100644 (file)
@@ -23,7 +23,6 @@
  *              <anil.s.keshavamurthy@intel.com> adapted from i386
  */
 
-#include <linux/config.h>
 #include <linux/kprobes.h>
 #include <linux/ptrace.h>
 #include <linux/string.h>
index 4b0b71d5aef4520700c259258eddd801378e0fb9..d4a546aa5048fc4777ac592b15571e676fd0b28f 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <asm/machvec.h>
index d7dc5e63de63c2bc29b9a1fc19b98c663517de5f..2fbe4536fe181b5574d99a77add70e5330a5f490 100644 (file)
@@ -55,7 +55,6 @@
  * 2005-10-07 Keith Owens <kaos@sgi.com>
  *           Add notify_die() hooks.
  */
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/sched.h>
@@ -679,7 +678,7 @@ copy_reg(const u64 *fr, u64 fnat, u64 *tr, u64 *tnat)
  */
 
 static void
-ia64_mca_modify_comm(const task_t *previous_current)
+ia64_mca_modify_comm(const struct task_struct *previous_current)
 {
        char *p, comm[sizeof(current->comm)];
        if (previous_current->pid)
@@ -710,7 +709,7 @@ ia64_mca_modify_comm(const task_t *previous_current)
  * that we can do backtrace on the MCA/INIT handler code itself.
  */
 
-static task_t *
+static struct task_struct *
 ia64_mca_modify_original_stack(struct pt_regs *regs,
                const struct switch_stack *sw,
                struct ia64_sal_os_state *sos,
@@ -720,7 +719,7 @@ ia64_mca_modify_original_stack(struct pt_regs *regs,
        ia64_va va;
        extern char ia64_leave_kernel[];        /* Need asm address, not function descriptor */
        const pal_min_state_area_t *ms = sos->pal_min_state;
-       task_t *previous_current;
+       struct task_struct *previous_current;
        struct pt_regs *old_regs;
        struct switch_stack *old_sw;
        unsigned size = sizeof(struct pt_regs) +
@@ -1024,7 +1023,7 @@ ia64_mca_handler(struct pt_regs *regs, struct switch_stack *sw,
        pal_processor_state_info_t *psp = (pal_processor_state_info_t *)
                &sos->proc_state_param;
        int recover, cpu = smp_processor_id();
-       task_t *previous_current;
+       struct task_struct *previous_current;
        struct ia64_mca_notify_die nd =
                { .sos = sos, .monarch_cpu = &monarch_cpu };
 
@@ -1353,7 +1352,7 @@ ia64_init_handler(struct pt_regs *regs, struct switch_stack *sw,
 {
        static atomic_t slaves;
        static atomic_t monarchs;
-       task_t *previous_current;
+       struct task_struct *previous_current;
        int cpu = smp_processor_id();
        struct ia64_mca_notify_die nd =
                { .sos = sos, .monarch_cpu = &monarch_cpu };
@@ -1458,38 +1457,38 @@ __setup("disable_cpe_poll", ia64_mca_disable_cpe_polling);
 
 static struct irqaction cmci_irqaction = {
        .handler =      ia64_mca_cmc_int_handler,
-       .flags =        SA_INTERRUPT,
+       .flags =        IRQF_DISABLED,
        .name =         "cmc_hndlr"
 };
 
 static struct irqaction cmcp_irqaction = {
        .handler =      ia64_mca_cmc_int_caller,
-       .flags =        SA_INTERRUPT,
+       .flags =        IRQF_DISABLED,
        .name =         "cmc_poll"
 };
 
 static struct irqaction mca_rdzv_irqaction = {
        .handler =      ia64_mca_rendez_int_handler,
-       .flags =        SA_INTERRUPT,
+       .flags =        IRQF_DISABLED,
        .name =         "mca_rdzv"
 };
 
 static struct irqaction mca_wkup_irqaction = {
        .handler =      ia64_mca_wakeup_int_handler,
-       .flags =        SA_INTERRUPT,
+       .flags =        IRQF_DISABLED,
        .name =         "mca_wkup"
 };
 
 #ifdef CONFIG_ACPI
 static struct irqaction mca_cpe_irqaction = {
        .handler =      ia64_mca_cpe_int_handler,
-       .flags =        SA_INTERRUPT,
+       .flags =        IRQF_DISABLED,
        .name =         "cpe_hndlr"
 };
 
 static struct irqaction mca_cpep_irqaction = {
        .handler =      ia64_mca_cpe_int_caller,
-       .flags =        SA_INTERRUPT,
+       .flags =        IRQF_DISABLED,
        .name =         "cpe_poll"
 };
 #endif /* CONFIG_ACPI */
index c1bd1feffab09dca071d32900f66524cac5aacc3..96047491d1b9241fd06e196672443e1d5f16d7f1 100644 (file)
@@ -19,7 +19,6 @@
 // 12/08/05 Keith Owens <kaos@sgi.com>
 //                Use per cpu MCA/INIT stacks for all data.
 //
-#include <linux/config.h>
 #include <linux/threads.h>
 
 #include <asm/asmmacro.h>
index ca6666b51ccb6d2a9f79cf8244b5f172a91a92e0..8db6e0cedadcbc3d660bd6f5621cbc496e75b466 100644 (file)
@@ -8,7 +8,6 @@
  * Copyright (C) 2005 Keith Owens <kaos@sgi.com>
  * Copyright (C) 2006 Russ Anderson <rja@sgi.com>
  */
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/sched.h>
index e6a580d354b9e001bc9c2f9f2006ff8dc281e04c..f2d4900751ba9375dc8a7afa5cec7c1f2573f5d4 100644 (file)
@@ -5,7 +5,6 @@
  * Copyright (C) 2004 FUJITSU LIMITED
  * Copyright (C) Hidetoshi Seto (seto.hidetoshi@jp.fujitsu.com)
  */
-#include <linux/config.h>
 #include <linux/threads.h>
 
 #include <asm/asmmacro.h>
index 85ed54179afa52585f74cbbd783764c0218a97eb..c9ac8bada786f19888bab6b93536054da44f599f 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 
 #include <asm/cache.h>
 
index 3a30cfc9574fd499cc5fa839ee34731aecf25e04..158e3c51bb771fb5efb5d3424c7efda4c68905bf 100644 (file)
@@ -25,7 +25,6 @@
    SEGREL64LSB
  */
 
-#include <linux/config.h>
 
 #include <linux/kernel.h>
 #include <linux/sched.h>
index 0766493d4d0061ff99a48de4a2359d2852e24904..1cc360c83e7af01b1ddfc632d3a7f5f071764363 100644 (file)
@@ -19,7 +19,6 @@
  * Copyright (C) 2004 Silicon Graphics, Inc.
  *   Jesse Barnes <jbarnes@sgi.com>
  */
-#include <linux/config.h>
 #include <linux/topology.h>
 #include <linux/module.h>
 #include <asm/processor.h>
index 8a12084191384ee55f02ed5848a95ef708206732..3f5bac59209a501fa7b9278f5ed4681567f417ee 100644 (file)
@@ -17,7 +17,6 @@
  * 10/23/2001  S.Eranian       updated pal_perf_mon_info bug fixes
  * 03/24/2004  Ashok Raj       updated to work with CPU Hotplug
  */
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index a0055d3d695c81d2ba042dcbe54d831ffd82a42b..c7ccd6ee1ddfe57d7668794098e716bc77192189 100644 (file)
@@ -19,7 +19,6 @@
  *     http://www.hpl.hp.com/research/linux/perfmon
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -6440,7 +6439,7 @@ pfm_flush_pmds(struct task_struct *task, pfm_context_t *ctx)
 
 static struct irqaction perfmon_irqaction = {
        .handler = pfm_interrupt_handler,
-       .flags   = SA_INTERRUPT,
+       .flags   = IRQF_DISABLED,
        .name    = "perfmon"
 };
 
index 344941db0a9edcd48b0e2c6099ec221b0cce7dd9..ff80eab83b38668b5d3a573f064e97b1d13f5715 100644 (file)
@@ -8,7 +8,6 @@
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <asm/delay.h>
 #include <linux/smp.h>
index b045c279136c281bde5a67a1e7eef13dd58e846d..ea914cc6812a0a327cd73802f4b0e2b6beacd42b 100644 (file)
@@ -9,7 +9,6 @@
  *           Add notify_die() hooks.
  */
 #define __KERNEL_SYSCALLS__    /* see <asm/unistd.h> */
-#include <linux/config.h>
 
 #include <linux/cpu.h>
 #include <linux/pm.h>
index e61e15e28d8b61cebff7eb2facfcf0692c6cf35f..aa705e46b974d4d47aa4b9066bd2a017ec9b8c1b 100644 (file)
@@ -6,7 +6,6 @@
  *
  * Derived from the x86 and Alpha versions.
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
index 77fa65903d94d20a334bfced9cb8a4353dab827c..642fdc7b969d5c4f6450f588e82e0f2a29064063 100644 (file)
@@ -6,7 +6,6 @@
  * Copyright (C) 1999 VA Linux Systems
  * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
  */
-#include <linux/config.h>
 
 #include <linux/kernel.h>
 #include <linux/init.h>
index 6dba2d63f24d60dbbad443f8fda9c2f166722867..6a33f414de5862835fc09c19fc9d7918118ea11d 100644 (file)
@@ -22,7 +22,6 @@
  * 06/24/99 W.Drummond added boot_cpu_data.
  * 05/28/05 Z. Menyhart        Dynamic stride size for "flush_icache_range()"
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 
index 1d7903ee2126ec08183aa569bb4d8d8ef8f472dc..77f8b49c788258021819ccaab628e9b92e734f17 100644 (file)
@@ -7,7 +7,6 @@
  * Derived from i386 and Alpha versions.
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
index 5203df78f150cd1d9cf35c5b888a958f4dd10cdd..6203ed4ec8cfadbab3a6d77f055633ad055cc8c8 100644 (file)
@@ -21,7 +21,6 @@
  * 05/01/30 Suresh Siddha <suresh.b.siddha@intel.com>
  *                                             Setup cpu_sibling_map and cpu_core_map
  */
-#include <linux/config.h>
 
 #include <linux/module.h>
 #include <linux/acpi.h>
@@ -125,7 +124,7 @@ extern void __devinit calibrate_delay (void);
 extern void start_ap (void);
 extern unsigned long ia64_iobase;
 
-task_t *task_for_booting_cpu;
+struct task_struct *task_for_booting_cpu;
 
 /*
  * State for each CPU
index c7b943f1019981d4c5c16b2a93d7e623b516f263..40722d88607adf57de79dc158b08d769f767757b 100644 (file)
@@ -5,7 +5,6 @@
  * Copyright (C) 1999-2000, 2002-2003, 2005 Hewlett-Packard Co
  *     David Mosberger-Tang <davidm@hpl.hp.com>
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/mm.h>
index 49958904045b2f68773f4b0b788b9ca15b84cb0e..6928ef0d64d852abc4a41b7ff5cfc2e1f14d5249 100644 (file)
@@ -8,7 +8,6 @@
  * Copyright (C) 1999-2000 VA Linux Systems
  * Copyright (C) 1999-2000 Walt Drummond <drummond@valinux.com>
  */
-#include <linux/config.h>
 
 #include <linux/cpu.h>
 #include <linux/init.h>
@@ -232,7 +231,7 @@ ia64_init_itm (void)
 
 static struct irqaction timer_irqaction = {
        .handler =      timer_interrupt,
-       .flags =        SA_INTERRUPT,
+       .flags =        IRQF_DISABLED,
        .name =         "timer"
 };
 
index 5511d9c6c70152fe67b1025c1fe8ea8044926760..b146f1cfad3141e240fac9297de3bfc67f75286a 100644 (file)
@@ -13,7 +13,6 @@
  *     Populate cpu cache entries in sysfs for cpu cache info
  */
 
-#include <linux/config.h>
 #include <linux/cpu.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
index 7c1ddc8ac44325d7600ced23ed9457ea68ac6a78..e7bbb0f40aa20eacb9b07431f360fbd456cc91e1 100644 (file)
@@ -7,7 +7,6 @@
  * 05/12/00 grao <goutham.rao@intel.com> : added isr in siginfo for SIGFPE
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/sched.h>
index 783600fe52b2d4bf772b3c9b6968c58581b36073..5b0d5f64a9b11d7fff31532595f5fbb00a8c036a 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 
 #include <asm/cache.h>
 #include <asm/ptrace.h>
index d4987061dda76a5ecfc19dc619504aa17ebb00b9..2d814e7ed191c60c50ba85de3b8382a6bfc4abc0 100644 (file)
@@ -8,7 +8,6 @@
  * 2/12/02 kchen       Tuned for both Itanium and McKinley
  * 3/08/02 davidm      Some more tweaking
  */
-#include <linux/config.h>
 
 #include <asm/asmmacro.h>
 #include <asm/page.h>
index 8949e44091acbec9bdc063237759047bdec0a93d..bcd16f8ad9d958ef9981c6504f3028cd48ba1a81 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 
index 9e534d52b1d52289a90f49417db3edb5874fd2de..ab0f8763972954117b0ac6a7dc3ac120d6e042c5 100644 (file)
@@ -13,7 +13,6 @@
  * Copyright (C) 2002 Intel Corp.
  * Copyright (C) 2002 Ken Chen <kenneth.w.chen@intel.com>
  */
-#include <linux/config.h>
 #include <asm/asmmacro.h>
 #include <asm/page.h>
 
index 84fd1c14c8a9d5c39a168e17dce7386491642aa6..2a88cdd6d92493e5e8af300e62daa4e162879491 100644 (file)
@@ -14,7 +14,6 @@
  * Routines used by ia64 machines with contiguous (or virtually contiguous)
  * memory.
  */
-#include <linux/config.h>
 #include <linux/bootmem.h>
 #include <linux/efi.h>
 #include <linux/mm.h>
index 525b082eb6619821fed5224fccadabaf79002cf4..99bd9e30db9694979522b86c0b768cbf7cc6839a 100644 (file)
@@ -313,9 +313,19 @@ static void __meminit scatter_node_data(void)
        pg_data_t **dst;
        int node;
 
-       for_each_online_node(node) {
-               dst = LOCAL_DATA_ADDR(pgdat_list[node])->pg_data_ptrs;
-               memcpy(dst, pgdat_list, sizeof(pgdat_list));
+       /*
+        * for_each_online_node() can't be used at here.
+        * node_online_map is not set for hot-added nodes at this time,
+        * because we are halfway through initialization of the new node's
+        * structures.  If for_each_online_node() is used, a new node's
+        * pg_data_ptrs will be not initialized. Insted of using it,
+        * pgdat_list[] is checked.
+        */
+       for_each_node(node) {
+               if (pgdat_list[node]) {
+                       dst = LOCAL_DATA_ADDR(pgdat_list[node])->pg_data_ptrs;
+                       memcpy(dst, pgdat_list, sizeof(pgdat_list));
+               }
        }
 }
 
index 6d259e34f3596cb6804274efe6d3e9411846169e..71c50dd8f8706da65a0362dc2ee8e15888c42060 100644 (file)
@@ -5,7 +5,6 @@
  *     David Mosberger-Tang <davidm@hpl.hp.com>
  */
 
-#include <linux/config.h>
 #include <linux/sort.h>
 
 #include <asm/uaccess.h>
index 8d506710fdbd721f82c88aac5f9f5a20bae13b59..eee5c1cfbe3223c1376c4d0a9239d4def44be824 100644 (file)
@@ -8,7 +8,6 @@
  * Feb, 2004: dynamic hugetlb page size via boot parameter
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/fs.h>
 #include <linux/mm.h>
index 38306e98f04b2877a076ae7ac4912dee3cebfbab..2f50c064513c248f1a739d8891dd21509f7a474a 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 1998-2003 Hewlett-Packard Co
  *     David Mosberger-Tang <davidm@hpl.hp.com>
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 
index 4e5c8b36ad93ea91fa72674c3fe0fec44c593871..64e4c21f311cdc7f328165b18ae189e07476f885 100644 (file)
@@ -10,7 +10,6 @@
  *                         2002/08/07 Erich Focht <efocht@ess.nec.de>
  */
 
-#include <linux/config.h>
 #include <linux/cpu.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
index 4dbbca0b5e9c5698286c34462d98a246fd3d6cf7..ffad7624436c84e02e62b7e38b72066bc689492f 100644 (file)
@@ -11,7 +11,6 @@
  * Rohit Seth <rohit.seth@intel.com>
  * Ken Chen <kenneth.w.chen@intel.com>
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
index b7975a469fb82e857c9eacca7bfd73086cfc4fa4..bc41dd32fec674c418bff10ce2979179a4ee359e 100644 (file)
@@ -8,7 +8,6 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/config.h>
 #include <linux/oprofile.h>
 #include <linux/sched.h>
 #include <asm/perfmon.h>
index 5bef0e3603f2a44e19169a5957bb6a0bf201150a..276512fd8922d33ef23c3429ce23631607dd86bb 100644 (file)
@@ -10,7 +10,6 @@
  *
  * Note: Above list of copyright holders is incomplete...
  */
-#include <linux/config.h>
 
 #include <linux/acpi.h>
 #include <linux/types.h>
index e952ef4f6d912dd361b7360d5a87df78f0f00f09..27dee4584061ffc918f1d9450262e7124ab8fee6 100644 (file)
@@ -6,7 +6,6 @@
  * Copyright (c) 2000-2006 Silicon Graphics, Inc.  All Rights Reserved.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <asm/sn/nodepda.h>
 #include <asm/sn/addrs.h>
index 56ab6bae00ee2184c0faecdde66956879e5d66e9..96fb81e6321f6a5b33512d908bad33741e28ac99 100644 (file)
@@ -178,7 +178,7 @@ void hubiio_crb_error_handler(struct hubdev_info *hubdev_info)
  */
 void hub_error_init(struct hubdev_info *hubdev_info)
 {
-       if (request_irq(SGI_II_ERROR, (void *)hub_eint_handler, SA_SHIRQ,
+       if (request_irq(SGI_II_ERROR, (void *)hub_eint_handler, IRQF_SHARED,
                        "SN_hub_error", (void *)hubdev_info))
                printk("hub_error_init: Failed to request_irq for 0x%p\n",
                    hubdev_info);
@@ -196,7 +196,7 @@ void hub_error_init(struct hubdev_info *hubdev_info)
 void ice_error_init(struct hubdev_info *hubdev_info)
 {
         if (request_irq
-            (SGI_TIO_ERROR, (void *)hub_eint_handler, SA_SHIRQ, "SN_TIO_error",
+            (SGI_TIO_ERROR, (void *)hub_eint_handler, IRQF_SHARED, "SN_TIO_error",
              (void *)hubdev_info))
                 printk("ice_error_init: request_irq() error hubdev_info 0x%p\n",
                        hubdev_info);
index 3bfccf354343740e3fd811b3ff13d5c1a43a2376..dd6bcf4d58bf86b2c84836246aa285b32b3647f1 100644 (file)
@@ -6,7 +6,6 @@
  * Copyright (C) 1999,2001-2006 Silicon Graphics, Inc. All rights reserved.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/delay.h>
index 6ae276d5d50c858d213c25513d4c0748599151b8..4dcce3d0e04ca1c9bc0e10d10cf4d7fcab6f7723 100644 (file)
@@ -8,7 +8,6 @@
  * Module to export the system's Firmware Interface Tables, including
  * PROM revision numbers and banners, in /proc
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/proc_fs.h>
index 5100261310f76465a10925aa397e4c4228e25253..43ddc2eccb965bd3c71d372e1afc6c53505babc4 100644 (file)
@@ -5,7 +5,6 @@
  *
  * Copyright (C) 2000-2005 Silicon Graphics, Inc. All rights reserved.
  */
-#include <linux/config.h>
 
 #ifdef CONFIG_PROC_FS
 #include <linux/proc_fs.h>
index 8255a9be4632adbc325bc96643208ea1a04b8fa6..c2f69f7942af06b3b83da10d03a92d7e482e805d 100644 (file)
@@ -202,7 +202,7 @@ xpc_setup_infrastructure(struct xpc_partition *part)
        init_waitqueue_head(&part->channel_mgr_wq);
 
        sprintf(part->IPI_owner, "xpc%02d", partid);
-       ret = request_irq(SGI_XPC_NOTIFY, xpc_notify_IRQ_handler, SA_SHIRQ,
+       ret = request_irq(SGI_XPC_NOTIFY, xpc_notify_IRQ_handler, IRQF_SHARED,
                                part->IPI_owner, (void *) (u64) partid);
        if (ret != 0) {
                dev_err(xpc_chan, "can't register NOTIFY IRQ handler, "
index e5c6d3c0a8e9a852ac37ae43e620ffa820bc0b05..007703c494a439b47bd82ba3898891585f38530c 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
index ab1211ef01766248898c1fcb1a47f204a2ef93f8..838c93c9a16a05843e4b1f262f0339e995d509a0 100644 (file)
@@ -139,7 +139,7 @@ pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
         * register the bridge's error interrupt handler
         */
        if (request_irq(SGI_PCIASIC_ERROR, (void *)pcibr_error_intr_handler,
-                       SA_SHIRQ, "PCIBR error", (void *)(soft))) {
+                       IRQF_SHARED, "PCIBR error", (void *)(soft))) {
                printk(KERN_WARNING
                       "pcibr cannot allocate interrupt for error handler\n");
        }
index e4aa839d0189f57eaa99d673793b0de1ca3a621e..c36b0f5affb3aa2a5d837a4e36f1aa5e427aceea 100644 (file)
@@ -646,7 +646,7 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
 
        if (request_irq(SGI_TIOCA_ERROR,
                        tioca_error_intr_handler,
-                       SA_SHIRQ, "TIOCA error", (void *)tioca_common))
+                       IRQF_SHARED, "TIOCA error", (void *)tioca_common))
                printk(KERN_WARNING
                       "%s:  Unable to get irq %d.  "
                       "Error interrupts won't be routed for TIOCA bus %d\n",
index 2d7948567ebc175d2966a1a07e7d95bf0843d3b1..17cd342848868866583ceec4725b2aa5f13045c9 100644 (file)
@@ -1027,7 +1027,7 @@ tioce_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
 
        if (request_irq(SGI_PCIASIC_ERROR,
                        tioce_error_intr_handler,
-                       SA_SHIRQ, "TIOCE error", (void *)tioce_common))
+                       IRQF_SHARED, "TIOCE error", (void *)tioce_common))
                printk(KERN_WARNING
                       "%s:  Unable to get irq %d.  "
                       "Error interrupts won't be routed for "
index 234d8b1e0ac1670a94fde74ebd4efdc5b60aa7f5..95a0563ff076e9665f553416a4b3ef1d1816829a 100644 (file)
@@ -7,7 +7,6 @@
  */
 
        .text
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/addrspace.h>
 #include <asm/page.h>
index 8f9a57271f8345cfd61e43ec5968bdd086f6600a..bce8af5e3bb2ab6f542b198770cdb8b0e1e72ab1 100644 (file)
@@ -5,7 +5,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <asm/processor.h>
 
 static void putc(char c);
index 70fa799005c387a032619a08217ec64145685340..600d40e33495dcb4b8419d70ebbac051407d189c 100644 (file)
@@ -12,7 +12,6 @@
  *             This is based on arch/sh/boot/compressed/misc.c.
  */
 
-#include <linux/config.h>
 #include <linux/string.h>
 
 /*
index a18431759633bbbfb77a757a4b8ea80d03742d3b..dd11963f6939251bd91185eca8ff637893201301 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 
 OUTPUT_ARCH(m32r)
 ENTRY(startup)
index 398542507d84aead8075127c07c625fb81f49d54..ef843d63083d3a522bc51288e439b81db2f702c1 100644 (file)
@@ -11,7 +11,6 @@
 #include <asm/page.h>
 #include <asm/pgtable.h>
 
-#include <linux/config.h>
 #include <asm/assembler.h>
 #include <asm/mmu_context.h>
 #include <asm/m32r.h>
index 48ec29714238d8a87eee3204b68e2df13b0a9fc9..ab871ccd33f82f5318d0218669cce79e101c7adc 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (c) 2003 Hitoshi Yamamoto
  */
 
-#include <linux/config.h>
 #include <asm/ptrace.h>
 #include <asm/uaccess.h>
 
index 920bb742b7a2a90394c133998809917f0bb33f56..ac6d840b382b3ccea8205da499f87bedb0e890c7 100644 (file)
@@ -54,7 +54,6 @@
  *       @(0x6c,sp) - orig_r0          ditto
  */
 
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/irq.h>
 #include <asm/unistd.h>
index 3e83173995cd81992766212a33a5efee63931038..0d3c8ee0e03d9fc21de2fd05f160d7d612d993a2 100644 (file)
@@ -14,7 +14,6 @@ __INIT
 __INITDATA
 
        .text
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/segment.h>
 #include <asm/page.h>
index d26adab9586c65094f0f2beb8672d08dbf32570d..2189eca30b565abb97dab099d42d714cc3a5ef0c 100644 (file)
@@ -8,7 +8,6 @@
  *                           Naoto Sugai, Hayato Fujiwara
  */
 
-#include <linux/config.h>
 #include <asm/m32r.h>
 #include <asm/page.h>
 #include <asm/io.h>
index 939932d6cc00609358352e9b62fcecd9e3e9782f..5898f4031a0cf53376e316437bff3deb1ed57d6d 100644 (file)
@@ -11,7 +11,6 @@
  *  archive for more details.
  */
 
-#include <linux/config.h>
 #include <asm/m32r.h>
 #include <asm/page.h>
 #include <asm/io.h>
index a662b537c5ba4bb9729cb7435fb84509473fbc31..31396789ab1baad24a23a4aeec84efa913a8a4d8 100644 (file)
@@ -7,7 +7,6 @@
  *                           Hitoshi Yamamoto
  */
 
-#include <linux/config.h>
 #include <asm/m32r.h>
 #include <asm/page.h>
 #include <asm/io.h>
index e72d725606afc83a8b0273431f8e8d08c1369e8f..ecc6aa88f9acaf3d9ec2587d384baef585c8ca6f 100644 (file)
@@ -7,7 +7,6 @@
  *                           Hitoshi Yamamoto, Mamoru Sakugawa
  */
 
-#include <linux/config.h>
 #include <asm/m32r.h>
 #include <asm/page.h>
 #include <asm/io.h>
index ed6da930bc64ab5e321c2e0e6fbcb2e3e807b0bd..a13b5f6b07e936fef783f93f88476f70d2a08579 100644 (file)
@@ -7,7 +7,6 @@
  *                           Hitoshi Yamamoto, Mamoru Sakugawa
  */
 
-#include <linux/config.h>
 #include <asm/m32r.h>
 #include <asm/page.h>
 #include <asm/io.h>
index 910dd131c22751b202d9ad5b0981808567c00266..068bf47060f8150ad13363515c85889801a7ce63 100644 (file)
@@ -7,7 +7,6 @@
  *                           Hitoshi Yamamoto, Mamoru Sakugawa
  */
 
-#include <linux/config.h>
 #include <asm/m32r.h>
 #include <asm/page.h>
 #include <asm/io.h>
index bec69297db3c6f31c0cfc4aa03d5ad98cc98943f..da6c5f5c1f82b5fe2aa2c4f1a63664609d685e89 100644 (file)
@@ -11,7 +11,6 @@
  *  archive for more details.
  */
 
-#include <linux/config.h>
 #include <asm/m32r.h>
 #include <asm/page.h>
 #include <asm/io.h>
index 39a379af40bca621472910c097ba76310800b80d..a8c0e2eceb4ddfa87b1f2a9574dffa9604672841 100644 (file)
@@ -12,7 +12,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <asm/m32r.h>
 #include <asm/page.h>
 #include <asm/io.h>
index c50330fa83b98a33ef58e40f6751671835ed3aee..8cbbb0b11e0c9c66b1a8280ed95dd65b3c6fe9ee 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/smp.h>
 #include <linux/user.h>
index f6a79a016ce013e618903fabf478bc5c975cf7e5..8d4205794380f93612f9dc62974e8895427f5912 100644 (file)
@@ -15,7 +15,6 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
-#include <linux/config.h>
 #include <linux/moduleloader.h>
 #include <linux/elf.h>
 #include <linux/vmalloc.h>
index 065f5e7190587cf4e6a8122a34c64617523ab1cc..44cbe0ce0f8fb21681590509e76af47ac9696727 100644 (file)
@@ -21,7 +21,6 @@
  */
 
 #include <linux/fs.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/ptrace.h>
 #include <linux/unistd.h>
index 340a3bf59b88d6935fc004ea95669ee1f59cdc61..5f02b31448752e514b290c2c5023f72a89ab9059 100644 (file)
@@ -14,7 +14,6 @@
  *   Copyright (C) 2000 Russell King
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
index 9a6e6d754ddcf54b3ef31937fda4dc7c69ab5b83..940c2d37cfd1caa7041097e7301c195424759675 100644 (file)
@@ -21,7 +21,6 @@
  *
  * rw semaphores implemented November 1999 by Benjamin LaHaise <bcrl@kvack.org>
  */
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/err.h>
 #include <linux/init.h>
index 1ff483c8a4c9749c99d8f70b052ee9d805cc3aa6..0a6c6e677afe285105bacd0c38672c1f2b4f0d0b 100644 (file)
@@ -7,7 +7,6 @@
  *                            Hitoshi Yamamoto
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/stddef.h>
index f9f56c2701951c10f0c44883c57a8f89fa3ddf2b..1692b321f47622aedf70719ac2f7c672af2bb58f 100644 (file)
@@ -8,7 +8,6 @@
  *                           Naoto Sugai, Hayato Fujiwara
  */
 
-#include <linux/config.h>
 #include <linux/irq.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index b6ab00eff58057db820edf51c06cfdc08a4b5017..7efc145c74c28adffa51a8f02b23ddd8d1bdd503 100644 (file)
@@ -11,7 +11,6 @@
  *  archive for more details.
  */
 
-#include <linux/config.h>
 #include <linux/irq.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index c268044185f543ed4ffd936996fb29e01c6f1e29..67dbbdc9d111bdc89e0b621adf2d9ef438030915 100644 (file)
@@ -7,7 +7,6 @@
  *                           Hitoshi Yamamoto
  */
 
-#include <linux/config.h>
 #include <linux/irq.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index bd2327d5cca28a1528a8f0ae1fec9b83231a7fec..55abb21027504f1bb5d8e5dd4eb78beb1803d766 100644 (file)
@@ -7,7 +7,6 @@
  *                           Hitoshi Yamamoto, Mamoru Sakugawa
  */
 
-#include <linux/config.h>
 #include <linux/irq.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 014b51d17505a3e9fd047f79b82f20508d813d9d..93dc010c7fc341b59d20e14c56d120534db412d4 100644 (file)
@@ -7,7 +7,6 @@
  *                           Hitoshi Yamamoto, Mamoru Sakugawa
  */
 
-#include <linux/config.h>
 #include <linux/irq.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index ea64831aef7ad536869cfdd9dccb63c6ca47b3f6..cd62598e3cea6b879062293ced0fcd7ec24726bd 100644 (file)
@@ -7,7 +7,6 @@
  *                           Hitoshi Yamamoto, Mamoru Sakugawa
  */
 
-#include <linux/config.h>
 #include <linux/irq.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 55e8972d455aedd27a132766a3c89ad42f388474..61d3b01cbe072e76957bef61704172b32427d427 100644 (file)
@@ -12,7 +12,6 @@
  *  archive for more details.
  */
 
-#include <linux/config.h>
 #include <linux/irq.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 7fa12d8f66b47d63d8695422d429cc515a7a1f10..f5b4b5ac31e7c0bbf4dc5bf7c38a185698974065 100644 (file)
@@ -7,7 +7,6 @@
  *                                  Hitoshi Yamamoto
  */
 
-#include <linux/config.h>
 #include <linux/irq.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 6498ee70bb738d4c6aedf927b2b45d7de17215fe..a9174efe80cbf95379d3891de21f0c3b660eeb92 100644 (file)
@@ -10,7 +10,6 @@
  *  2000-06-20  Pentium III FXSR, SSE support by Gareth Hughes
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
index 840b4348bf0ceb1eeefc3f767b63ba9b350b30db..fa786560949588233fb1403c9d76d6091e2ca93c 100644 (file)
@@ -40,7 +40,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
index 670cb49210af483af5b94592e8e39298802183ff..a9cea32eb8246286924667bbef46291547297696 100644 (file)
@@ -7,7 +7,6 @@
  * Taken from i386 version.
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
index b8e68b54230210f208ebadc809e4e57d19e638ea..ded0be07a476f62aca9f42ed17ea3f757f0453f0 100644 (file)
@@ -17,7 +17,6 @@
 
 #undef  DEBUG_TIMER
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/module.h>
@@ -238,7 +237,7 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
        return IRQ_HANDLED;
 }
 
-struct irqaction irq0 = { timer_interrupt, SA_INTERRUPT, CPU_MASK_NONE,
+struct irqaction irq0 = { timer_interrupt, IRQF_DISABLED, CPU_MASK_NONE,
                          "MFT2", NULL, NULL };
 
 void __init time_init(void)
index 5fe8ed6d62dcd18718841515ebb60103de467e1e..c1daf2c40c7c4fb05af0f61b503fe9bf20a92bc1 100644 (file)
@@ -9,7 +9,6 @@
  * 'traps.c' handles hardware traps and faults after we have saved some
  * state in 'entry.S'.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/kallsyms.h>
index 729a2645a03f5aac8d30426e2f57301c3e26b547..13c7bb698e376ac10164753093d83db15dfd6228 100644 (file)
@@ -1,7 +1,6 @@
 /* ld script to make M32R Linux kernel
  */
 
-#include <linux/config.h>
 #include <asm-generic/vmlinux.lds.h>
 #include <asm/addrspace.h>
 #include <asm/page.h>
index 78effca9d97adc010d8194169a4529d34b07ba12..107594b65d58315059fd86f0cfe02c284cb6fc95 100644 (file)
@@ -6,7 +6,6 @@
  */
 /* $Id$ */
 
-#include <linux/config.h>
 
 ;
 ;      input   (r0,r1)  src
index f6fc1bdb87e4b4ac3ea2f6efb48d7fbd68510059..cfbe00e5184a7dcbfb189cfde256942060e9f95f 100644 (file)
@@ -28,7 +28,6 @@
 /* $Id$ */
 
 
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/assembler.h>
 #include <asm/errno.h>
index fb29632c7eaa2cf72e1065f5aaacfacfc167eb54..06382a38c3185f79242b2dbec8a3f12850bccced 100644 (file)
@@ -7,7 +7,6 @@
 
 /* $Id$ */
 
-#include <linux/config.h>
 #include <linux/param.h>
 #ifdef CONFIG_SMP
 #include <linux/sched.h>
index 800898a2d2e326e3e4ea503adb3d5cd60d78eb93..2089a215314eb5aff9c18f032182bc0693696584 100644 (file)
@@ -14,7 +14,6 @@
 
 
        .text
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/assembler.h>
 
index 6e26df120acb0d3aede214cec29c161d208d2636..b47fa3537aa4f16067473a9b7085beea3f79d6de 100644 (file)
@@ -14,7 +14,6 @@
  */
 /* $Id$ */
 
-#include <linux/config.h>
 
        .text
        .global memset
index 8d23cfbd600c1c2d51620ebb5307351d7e68a2a9..5f41aacd7b3e43f71ab10ed5fba0e07acd76b84a 100644 (file)
@@ -9,7 +9,6 @@
 /* $Id$ */
 
 
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/assembler.h>
 
index 2d1dd2106c4dddac42d01732e2e20d863eb0c550..896cef1aca5f43b8da34b8d9d45b2858f3ce84e5 100644 (file)
@@ -6,7 +6,6 @@
  * Copyright 1997 Linus Torvalds
  * Copyright 2001, 2002, 2004 Hirokazu Takata
  */
-#include <linux/config.h>
 #include <linux/prefetch.h>
 #include <linux/string.h>
 #include <linux/thread_info.h>
index 9f54dd9370132452517c853162462e6005d781f8..fac759584875a63e6b3209af10749469a2fd4408 100644 (file)
@@ -4,7 +4,6 @@
  *  Copyright (C) 2002-2005  Hirokazu Takata, Hayato Fujiwara
  */
 
-#include <linux/config.h>
 #include <asm/pgtable.h>
 
 #undef MCCR
index cf610a7c5ff0541f8dc051e99fa4825f69a73e31..abb34ccd59862453a6c20265a8268fc58789d1ce 100644 (file)
@@ -6,7 +6,6 @@
  *  Copyright (c) 2003  Hitoshi Yamamoto
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/bootmem.h>
 #include <linux/mmzone.h>
index d9d488d782e8a7e0c4bac21d1bb8a9bcddcf6b8f..03fc4c858e0e01d521fac4a1aa2c55322b88bbdf 100644 (file)
@@ -9,7 +9,6 @@
 
 /* $Id: fault-nommu.c,v 1.1 2004/03/30 06:40:59 sakugawa Exp $ */
 
-#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index bf7fb58ef02c49925236a9a7f6c445e89cb5687d..dc18a33eefef36ccd10790525b2537e4cae89255 100644 (file)
@@ -8,7 +8,6 @@
  *    Copyright (C) 1995  Linus Torvalds
  */
 
-#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
@@ -148,7 +147,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code,
        /* When running in the kernel we expect faults to occur only to
         * addresses in user space.  All other faults represent errors in the
         * kernel and should generate an OOPS.  Unfortunatly, in the case of an
-        * erroneous fault occuring in a code path which already holds mmap_sem
+        * erroneous fault occurring in a code path which already holds mmap_sem
         * we will deadlock attempting to validate the fault against the
         * address space.  Luckily the kernel only validly references user
         * space from well defined areas of code, which are listed in the
index 8f2e0587ae2f4981b92c997ca5beb4e0d40ae0a2..7fdcf6bf3ada9cef9ce44bd6299d4e462172921d 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <asm/ptrace.h>
index f9403f4640a11bd4468f8efd8daf86c88914a82c..96c79d840cff3cac8c04e96fd050e5d8e39e9e88 100644 (file)
@@ -22,7 +22,7 @@
  *
  * 07/08/99: rewamp of the interrupt handling - we now have two types of
  *           interrupts, normal and fast handlers, fast handlers being
- *           marked with SA_INTERRUPT and runs with all other interrupts
+ *           marked with IRQF_DISABLED and runs with all other interrupts
  *           disabled. Normal interrupts disable their own source but
  *           run with all other interrupt sources enabled.
  *           PORTS and EXTER interrupts are always shared even if the
index ae94db5d93b2208942218a89dba61d354fb7e2ae..1f5bfb58429783be182e8aad94d2a5f94eb28d7d 100644 (file)
@@ -8,7 +8,6 @@
  * for more details.
  */
 
-#include <linux/config.h>
 #include <linux/jiffies.h>
 #include <linux/timer.h>
 #include <linux/init.h>
index 558d5fd2d2ba932a07b7f772afabd11dce098be7..de1304c91112e1a42bd56ebe4de4bf40ef528584 100644 (file)
@@ -7,7 +7,6 @@
 **     Rewritten 15/9/2000 by Geert to use resource management
 */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 0956e45399e5cefcc0a12a4a7bdfea0842962068..dbad30054721cf5a1a892f8f23c9c4e3f941c9e3 100644 (file)
@@ -176,5 +176,5 @@ void __init cia_init_IRQ(struct ciabase *base)
        /* override auto int and install CIA handler */
        m68k_setup_irq_controller(&auto_irq_controller, base->handler_irq, 1);
        m68k_irq_startup(base->handler_irq);
-       request_irq(base->handler_irq, cia_handler, SA_SHIRQ, base->name, base);
+       request_irq(base->handler_irq, cia_handler, IRQF_SHARED, base->name, base);
 }
index b5b8a416a07a1384919b2f60ff78adfee5668117..092e50d2cb137781d1378f43fdb006f8ae73e720 100644 (file)
@@ -12,7 +12,6 @@
  * Miscellaneous Amiga stuff
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
index 99c70978aafa8149cc425dcd1cd39f54cf23000e..6f4581575fb4ca72bd2782746c64b8c2965c25f3 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
index 727289acad7e67336573d53d1c21c7fe7a105a2f..b2079252a954b708a43441fd3f850626193b90ff 100644 (file)
@@ -24,7 +24,6 @@
  * Miscellaneous atari stuff
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/mm.h>
 #include <linux/console.h>
index ace05f79d968e778289672551aac8696dba08160..4ae01004d8dd57e4308f15a185d30aef8a8e44d0 100644 (file)
@@ -10,7 +10,6 @@
  * for more details.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/tty.h>
 #include <linux/console.h>
index 8888debf71ecc739d595f69315fe3ffd3d1e426c..6ca57b6564da1ab138f318cd8247f885acd3180d 100644 (file)
@@ -4,7 +4,6 @@
  * Written by Wout Klaren.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <asm/io.h>
index 22e0481a5f7b484b46fae64c638c4ec15efa569a..bf4588cbe3711bca7125a1d1167541ec76fe0531 100644 (file)
@@ -8,7 +8,6 @@
  * for more details.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
index 2ef271cd818b8cc44a1aeb3ea15f0458322e5f69..1c05a6260546482ea365e9f6ef9c2e68f065c9bd 100644 (file)
@@ -7,7 +7,6 @@
  *  called by setup.c.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/string.h>
index a901685eb6a94b1e47a9d056f18e19e4e2327c78..af170c2be73550e100df3a0da78d137e3c0f8ab2 100644 (file)
@@ -6,7 +6,6 @@
  * Based on the DEC Alpha bios32.c by Dave Rusling and David Mosberger.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 
index 449b62b30f450747f1e1ded406a880c6768d6c8a..9083c8b7659f9be4354bfaaf61243e8fd719ab1f 100644 (file)
@@ -33,7 +33,6 @@
  *              for 68040
  */
 
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/entry.h>
 #include <asm/errno.h>
index 70002c146eed19c0c5dd76c73092d6a56f11df25..6739e87fe8255c308de8c1f293e3d67ed0f85185 100644 (file)
  * MAC_USE_SCC_B:      Use the SCC port B (printer) for serial debug (default).
  */
 
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <linux/init.h>
 #include <asm/bootinfo.h>
index 5a8344b935474a645b4ebe0e7612169df9ded3c2..b33e37fb7b0e4eb88a78bfdfb282be42c1c9e61c 100644 (file)
@@ -25,7 +25,6 @@
  *           which must be served                               /Roman Zippel
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/sched.h>
@@ -193,7 +192,7 @@ int setup_irq(unsigned int irq, struct irq_node *node)
        prev = irq_list + irq;
        if (*prev) {
                /* Can't share interrupts unless both agree to */
-               if (!((*prev)->flags & node->flags & SA_SHIRQ)) {
+               if (!((*prev)->flags & node->flags & IRQF_SHARED)) {
                        spin_unlock_irqrestore(&contr->lock, flags);
                        return -EBUSY;
                }
index 1f5e1b5aeda4e63f78c0cf3c5a285e62bbd60e5b..aff26a52167c4c418ba9bac6f273c0e202012838 100644 (file)
@@ -7,7 +7,6 @@
 #include <linux/elfcore.h>
 #include <linux/in6.h>
 #include <linux/interrupt.h>
-#include <linux/config.h>
 
 #include <asm/setup.h>
 #include <asm/machdep.h>
index 33648efb772eadde09a4f517353c85660ea1b895..45a46646c1b353eec5b565e835d99d16d8df5edc 100644 (file)
@@ -10,7 +10,6 @@
  * This file handles the architecture-dependent parts of process handling..
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/module.h>
 #include <linux/sched.h>
index 540638ca81f9832fe390b1f0b381d54ea7b2b20e..ef89060ea328374d25fe9d03a8a449cf9126d52f 100644 (file)
@@ -18,7 +18,6 @@
 #include <linux/errno.h>
 #include <linux/ptrace.h>
 #include <linux/user.h>
-#include <linux/config.h>
 #include <linux/signal.h>
 
 #include <asm/uaccess.h>
index 1ebb79baaa8c32f839f87de5c3fbc2a834f5749d..d12cbbfe6ebd92b57c9a592b2f441d80f927765a 100644 (file)
@@ -3,7 +3,6 @@
  * specific changes in <asm/semaphore-helper.h>
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/init.h>
 #include <asm/semaphore-helper.h>
index 214a95f9f3acfb3f566f35070a82d94120796758..f2d7ee0ee18cde7139051b2a5dc1868536721077 100644 (file)
@@ -8,7 +8,6 @@
  * This file handles the architecture-dependent parts of system setup
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/sched.h>
index e86de7b061cd546768cc56cbfeca467164e4222d..4569406a2e1f8d8855e8d9ae57ebd698c7ad9b1f 100644 (file)
@@ -18,7 +18,6 @@
  * Sets up all exception vectors
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/signal.h>
 #include <linux/kernel.h>
index 497b924f3c86c3df14b9b25bb2253c36ec5bb72c..99ba315bd0a857a884dd017fc7a3c42027b78879 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 PHDRS
 {
   text PT_LOAD FILEHDR PHDRS FLAGS (7);
index 5a9990e436bb00899ea2b8b61ed17b50753057fb..85dda1095b1fbc42f3e301ccee3e2e45a7a56e82 100644 (file)
@@ -10,7 +10,6 @@
  * Miscellaneous linux stuff
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/mm.h>
index cc62ed61cda27d7e6182d09c5bc11110a96b6597..4eeb09dc0e8fc43576cff99ae9a3023cc782f465 100644 (file)
@@ -14,7 +14,6 @@
  * for more details.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/sched.h>
 #include <linux/tty.h>
index 4c8ece7e64a36a4808ff4838a89eacb67572c229..bc657b1057a7cc30d560c80912102e57c1e2a50c 100644 (file)
  * should execute quickly.)
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
index bbb0c3b95e9c141614b0a0d3989e952620b8787d..56d1f5676ade43628f578c8786dd1e3bf7d1f818 100644 (file)
@@ -2,7 +2,6 @@
  * Miscellaneous Mac68K-specific stuff
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/miscdevice.h>
index 5ec2d9101ea3e0e9151d969cf44dfc987a96e827..954b4f304a7d41786dcff301f4ac83796502e6d2 100644 (file)
@@ -35,7 +35,6 @@
  * OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/entry.h>
 
index a9f7f01290672feded67ad7b4bd6f662668355c8..b093b85fcdd2b1c46dde2c205b6dfe6415929baa 100644 (file)
@@ -35,7 +35,6 @@
  * OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <linux/config.h>
 #include "fp_emu.h"
 
 /*
index a190e39c907ad747fc3a2ab336a9da2745e79e3c..ab90213e5c54030bb1872b68e3342c31c0fb40b7 100644 (file)
@@ -7,7 +7,6 @@
  *  to motorola.c and sun3mmu.c
  */
 
-#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
index 43ffab0487242140e070f267d35ea7f14dd83d59..f46f049d29ff34542acf24257a64809f728f9c26 100644 (file)
@@ -7,7 +7,6 @@
  *          used by other architectures                /Roman Zippel
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
index a226668f20c329413a70cd3a207707d012838ee3..a0c095e17222df5c48c56279d7181d11b4e4e000 100644 (file)
@@ -4,7 +4,6 @@
  *  Copyright (C) 1995  Hamish Macdonald
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
index bdb11103694b31a36af51eaf43b78e5a9e0d01b2..49015e32d8fcbf29dd400bcc7337c7a8dc278e0e 100644 (file)
@@ -8,7 +8,6 @@
  * Moved 8/20/1999 Sam Creasey
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
index efa52d302d674aceaeb1d09b1a5a62671c7d4a9a..9a1827876408eac1f0c8f369e6890f3066855c33 100644 (file)
@@ -12,7 +12,6 @@
  * for more details.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
index 553c304aa2c5238261fdaecf7361f16ea6ca1919..d09d03b3d956ec75560fa733dfaa4e0733e7ac2c 100644 (file)
@@ -8,7 +8,6 @@
  * for more details.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
index 2e6ae56aec12e232acbefe46e7ac4111ad39f4cb..202adfcc316eee252982d5056b98971cef7c973b 100644 (file)
@@ -5,7 +5,6 @@
  * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 
index e6ee1006344ef7733c1de0050d2f1309948f1ad2..e7bfde377b5e848c4e50e2fbfa3e6b028f42a6be 100644 (file)
@@ -8,7 +8,6 @@
  * about or use it!  It's simple and smelly anyway....
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 
 #include <asm/openprom.h>
index 97c7bfde8ae8e991e4876c77a4bd36e145707b6f..6c265222cbcdcac80cdc3cc139c6029ce594ab14 100644 (file)
@@ -6,7 +6,6 @@
  * Contains common routines for sun3/sun3x DVMA management.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/list.h>
index 0912435e9e9090cee3bdf6b25a80faf06dff6df3..f18b9d3ef16df601915abadca0d7f9d1df2b2726 100644 (file)
@@ -6,7 +6,6 @@
  * for more details.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index 52fb174088698388e486514fc6a4d3093ed1f32a..987891783a472f64662ba93b2093639aebcd0960 100644 (file)
@@ -6,7 +6,6 @@
  * based on code from Oliver Jowett <oliver@jowett.manawatu.gen.nz>
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/mm.h>
 #include <linux/console.h>
index db7a0c1cebae8dfe88ad393fa47eefc711790fdc..6ee00effbad28e4549383ff4ebb27afe440f37ee 100644 (file)
@@ -9,7 +9,6 @@
 
 /*****************************************************************************/
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/pci.h>
index 8b1f47239b9a1f5e84c6d02da4222dfb8803b9fc..1e7ea6a3e1a146c9a092c33eba6073751f3c0d38 100644 (file)
@@ -24,7 +24,6 @@
  * linux 2.4 support David McCullough <davidm@snapgear.com>
  */
 
-#include <linux/config.h>
 #include <linux/sys.h>
 #include <linux/linkage.h>
 #include <asm/thread_info.h>
index 4320d5dcc9cb9b7e632bd98d8bf74d49b4ab3652..1e62150f3588d5d8f4da0e298b1e203f8d484420 100644 (file)
@@ -7,7 +7,6 @@
 #include <linux/elfcore.h>
 #include <linux/in6.h>
 #include <linux/interrupt.h>
-#include <linux/config.h>
 
 #include <asm/setup.h>
 #include <asm/machdep.h>
index f861755ec88bab000fff2f55547c733a7806b246..c18a83306953c663079faaac5d573ffbfffc78ca 100644 (file)
@@ -13,7 +13,6 @@
  * This file handles the architecture-dependent parts of process handling..
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
index 382ca5797b97804d28e7a2fcae60d43cd0d9b3d6..9130119537b9ffdbe082e9857f0ea9c657ae159b 100644 (file)
@@ -18,7 +18,6 @@
 #include <linux/errno.h>
 #include <linux/ptrace.h>
 #include <linux/user.h>
-#include <linux/config.h>
 #include <linux/signal.h>
 
 #include <asm/uaccess.h>
index c083f4772add4d61a5ba41ad04cb8dcd8c5635fb..bce2bc7d87c69540f82e5df17c3ccc417882a7a2 100644 (file)
@@ -3,7 +3,6 @@
  * specific changes in <asm/semaphore-helper.h>
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/err.h>
 #include <linux/init.h>
index 99d038e9ab31919d55588e28575488d2bd469ffc..bde9811cf98c927dcb4bb787bacbdb81a2e6122c 100644 (file)
@@ -16,7 +16,6 @@
  * This file handles the architecture-dependent parts of system setup
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/delay.h>
index 897deaa06b016976b160342f0e01d6a7b40277dc..617e43ec95ae48eb6e89dd44f64df34392dcabe3 100644 (file)
@@ -11,7 +11,6 @@
  *  Copyright (C) 1991, 1992  Linus Torvalds
  */
 
-#include <linux/config.h>
 #include <linux/sys.h>
 #include <linux/linkage.h>
 #include <asm/unistd.h>
index b9d8abb454301cb0a5b4081e67f49dfb4fb96ad2..1db9872722200b91fc56dde75be3781dca13b567 100644 (file)
@@ -10,7 +10,6 @@
  *             "A Kernel Model for Precision Timekeeping" by Dave Mills
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/module.h>
 #include <linux/sched.h>
index 44ff74e643b1ecac7d6378f45c7ae146af627381..17649d2543efa211423c5228d872ceaeb985fa5e 100644 (file)
@@ -16,7 +16,6 @@
 /*
  * Sets up all exception vectors
  */
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/signal.h>
 #include <linux/kernel.h>
index 59ced831b79214358ef5a5bec9d6bb9def55df4d..ccd2ceb05cfbc60fce2018bc0167e2cafcfa143c 100644 (file)
@@ -7,7 +7,6 @@
  *     run kernels.
  */
 
-#include <linux/config.h>
 #include <asm-generic/vmlinux.lds.h>
 
 #if defined(CONFIG_RAMKERNEL)
index 76765362fea604425f8a3f708ab5fb0c4411e6f3..87c7460343763d34d7ed336c07f1947ac932a2df 100644 (file)
@@ -9,7 +9,6 @@
  */
 
 #include <linux/linkage.h>
-#include <linux/config.h>
 #include <asm/semaphore.h>
 
 /*
index 70d1653be3da4fc4ab9bb835693863646d261b70..e4c233eef195a37bdbf6672b53c848d2d6bf0191 100644 (file)
@@ -15,7 +15,6 @@
  *  DEC/2000 -- linux 2.4 support <davidm@snapgear.com>
  */
 
-#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index 04213e1c1e57e70f7ee6ad23abd6e8fe775af6d7..bc32f38843f0a1cf1ca5c138129a825cfefdb1d2 100644 (file)
@@ -5,7 +5,6 @@
  *  Copyright (C) 2000-2002 David McCullough <davidm@snapgear.com>
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
index 0eef72915e618c0e2dca2a8f42963aff6b42c289..411e45248e5caf9f164e53300bc346a90883a1fc 100644 (file)
@@ -11,7 +11,6 @@
  *  Copyright (C) 1995  Hamish Macdonald
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
index 987c91a9a20648ef7716d6a57a7cf53abcadb683..34657f85e7024d40fc724ccaee67305de6834ab0 100644 (file)
@@ -9,7 +9,6 @@
 
 /***************************************************************************/
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/param.h>
index f35b8606c1ee5fb976939bd8e77def6945fb289d..48e4d62665077b583a502df29d592b4c7baf22f0 100644 (file)
@@ -8,7 +8,6 @@
 
 /***************************************************************************/
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/param.h>
index 71dea2e0f45294e19cb0aed3c14d163e4ea37469..823f561f35b0c7d9dce2e9e0cbaba27bde83a3ef 100644 (file)
@@ -11,7 +11,6 @@
 
 /***************************************************************************/
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/param.h>
 #include <asm/machdep.h>
index 22767ce506e0e872fb49cb5829ec9e642fc34b7b..85de817e9ec581d02f1927f3bab5d4e0bba6afde 100644 (file)
@@ -12,7 +12,6 @@
 
 /***************************************************************************/
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/param.h>
index 289c1821b841ba0fda917c34ec3dc4c915bd4466..9d19d5bdb8afd3cc5598465965a921761dc92a80 100644 (file)
@@ -8,7 +8,6 @@
 
 /***************************************************************************/
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/param.h>
index cf36e7d007b9eab480c48b9544532a55323e3569..d500e27eda57cd4f8cf4eb3469b3a322b63aa8a8 100644 (file)
@@ -9,7 +9,6 @@
 
 /***************************************************************************/
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/param.h>
index 804de33cd6b74c9f538903c36a15931c02719f4e..bbae515974579b5b0f6fb94a2aee4aed26a99a3e 100644 (file)
@@ -12,7 +12,6 @@
 
 /***************************************************************************/
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/param.h>
index a5d2aa38a27a5664df90c99b0813f18f21e72e7a..18dad90461445b2298fbdda3c23328897515a8dc 100644 (file)
@@ -12,7 +12,6 @@
 
 /***************************************************************************/
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/param.h>
index 7ed5782e923680ceea463077fe89fe1faf412e94..8074ac56f479b26eab53801f9816564eaabbef68 100644 (file)
@@ -9,7 +9,6 @@
 
 /***************************************************************************/
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/param.h>
index 9ddf5476ef8f0eb49970f74dcf93de3f24bc5eca..f0dba84d91019cb6798a985d1d27ab63ad4ad415 100644 (file)
@@ -26,7 +26,6 @@
  * Bug, speed and maintainability fixes by Philippe De Muyter <phdm@macqel.be>
  */
 
-#include <linux/config.h>
 #include <linux/sys.h>
 #include <linux/linkage.h>
 #include <asm/unistd.h>
index 1d9eb301d7ac4bc9b6f0de107c6e7022b21413ee..f2edb6498cd981cef3f57a733185918b8afb1553 100644 (file)
@@ -8,7 +8,6 @@
 
 /*****************************************************************************/
 
-#include <linux/config.h>
 #include <linux/sys.h>
 #include <linux/linkage.h>
 #include <asm/asm-offsets.h>
index a134fb2f056672bc144898ace95f787d3be2a754..b4b55093ae7e867a23093883a620e16fc52af909 100644 (file)
@@ -21,7 +21,6 @@
 #include <linux/sched.h>
 #include <linux/kernel_stat.h>
 #include <linux/errno.h>
-#include <linux/config.h>
 #include <linux/seq_file.h>
 
 #include <asm/system.h>
index ef174748825f3288f58b8d89d0a041b28a109a14..9dc5688f71b54040ce80daf6ea95357773b874bd 100644 (file)
@@ -12,7 +12,6 @@
 
 /***************************************************************************/
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/param.h>
@@ -49,7 +48,7 @@ void coldfire_pit_init(irqreturn_t (*handler)(int, void *, struct pt_regs *))
        volatile unsigned char *icrp;
        volatile unsigned long *imrp;
 
-       request_irq(MCFINT_VECBASE + MCFINT_PIT1, handler, SA_INTERRUPT,
+       request_irq(MCFINT_VECBASE + MCFINT_PIT1, handler, IRQF_DISABLED,
                "ColdFire Timer", NULL);
 
        icrp = (volatile unsigned char *) (MCF_IPSBAR + MCFICM_INTC0 +
index 83b8b89dfa09e7041ad3fcfb364d7f9eae13e178..24781f009337ae69a4b7e33e10b1697daf2edd50 100644 (file)
@@ -8,7 +8,6 @@
 
 /***************************************************************************/
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/param.h>
@@ -62,7 +61,7 @@ void coldfire_timer_init(irqreturn_t (*handler)(int, void *, struct pt_regs *))
        __raw_writew(MCFTIMER_TMR_ENORI | MCFTIMER_TMR_CLK16 |
                MCFTIMER_TMR_RESTART | MCFTIMER_TMR_ENABLE, TA(MCFTIMER_TMR));
 
-       request_irq(mcf_timervector, handler, SA_INTERRUPT, "timer", NULL);
+       request_irq(mcf_timervector, handler, IRQF_DISABLED, "timer", NULL);
        mcf_settimericr(1, mcf_timerlevel);
 
 #ifdef CONFIG_HIGHPROFILE
@@ -126,7 +125,7 @@ void coldfire_profile_init(void)
                MCFTIMER_TMR_RESTART | MCFTIMER_TMR_ENABLE, PA(MCFTIMER_TMR));
 
        request_irq(mcf_profilevector, coldfire_profile_tick,
-               (SA_INTERRUPT | IRQ_FLG_FAST), "profile timer", NULL);
+               (IRQF_DISABLED | IRQ_FLG_FAST), "profile timer", NULL);
        mcf_settimericr(2, 7);
 }
 
index ac313a160d8dd948f625a42ffa38277ae3cbd530..2a8b0d044ce50a356fba376f0c5bcb2b8b393bc4 100644 (file)
@@ -8,7 +8,6 @@
 
 /***************************************************************************/
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/param.h>
index f7c9018b85a75ca7bf100a7b135148e8effe5dc1..5aad2645f0f1e1d476b5832548e2f6d12508ce28 100644 (file)
@@ -9,7 +9,6 @@
 
 /***************************************************************************/
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/param.h>
index bcfa5d7fe1e25d147c0f910846dff8a419a32974..26ffeba286424a0b41c4e9089fed15945692107a 100644 (file)
@@ -17,7 +17,6 @@
 
 #include <asm/dbg.h>
 #include <stdarg.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
index 7d8990d784a2bf8f54ee63f39a2da0c9c6d752e5..f978627154502d74ca748a9e24a797885c67adfb 100644 (file)
@@ -10,7 +10,6 @@
  * Linux/m68k support by Hamish Macdonald
  */
 
-#include <linux/config.h>
 #include <linux/sys.h>
 #include <linux/linkage.h>
 #include <asm/thread_info.h>
index 94c5a1609a753f6fbfe92aaffdbd90cfb8f01b71..92d96456d3635c9118d8041fb04d948e57839227 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 
 #if defined(CONFIG_RAM32MB)
 #define        MEM_END 0x02000000      /* Memory size 32Mb */
index 46b3604f999caf61dbf17a91a4d478a4c24cc1de..9e07faa3e81d5384059d6f31c0267eb31ac18cc5 100644 (file)
@@ -15,7 +15,6 @@
 #define IMMED #
 #define        DBG_PUTC(x)     moveb IMMED x, 0xfffff907
 
-#include <linux/config.h>
 
 .global _stext
 .global _start
index e8dc9241ff96f5fb29cbf33afdf3b99edc73f5b0..252b80b020380b422e1fdec6afdcb56e31dea6a5 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 
        .global __main
        .global __rom_start
index 234430b9551c96fef3e32ff370b69a1500c0fda2..6ec77d3ea0b384d981cc7012b90ee3fe6fb71a0a 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
        
        .global _start
        .global _stext
index 68c2cd6b003054204379d3733c2e3e7bd0ea60c2..438ef6ee9720bdd7883cae83d3d73195bd8a319c 100644 (file)
@@ -14,7 +14,6 @@
 
 /***************************************************************************/
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
index 69c670dfd62bb99b77c607b85fb2e0ce61a8f024..c5482e3622eb158b76804c8d5e5a45a47df16b68 100644 (file)
@@ -11,7 +11,6 @@
  */
 
 #include <stdarg.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
index 8ff48adf24abec4dbec33f1e8c395ff96ceaed1b..f1af8977f294d20d3c7a386bb70062f6d3351cb4 100644 (file)
@@ -12,7 +12,6 @@
  * M68360 Port by SED Systems, and Lineo.
  */
 
-#include <linux/config.h>
 #include <linux/sys.h>
 #include <linux/linkage.h>
 #include <asm/thread_info.h>
index f497713a4ec7ea72dfbc2a1fc4736c66000d233a..2ea51479f13a4b23d14c44bacbec4791e7bfc294 100644 (file)
@@ -12,7 +12,6 @@
  *
  */
 #define ASSEMBLY
-#include <linux/config.h>
 
 .global _stext
 .global _start
index 2d28c3e19a881894d2f2389f0691db2364b06f29..62ecf4144b3ba3ad2df0ebecbb13adca1feff5b6 100644 (file)
@@ -11,7 +11,6 @@
  * Copyright (C) 1998  D. Jeff Dionne <jeff@uclinux.org>,
  *
  */
-#include <linux/config.h>
 
 .global _stext
 .global _sbss
index 0245fc4a478127223578387c346ff05970e42571..4df3c146eb74a62a405b3a88fb375c71c91500b9 100644 (file)
@@ -10,7 +10,6 @@
  * Copyright (c) 1999 D. Jeff Dionne <jeff@uclinux.org>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 15a14a67c2bf016ffe2569a9a6505a8b37580d82..659b80aca118c2734664b0972f5d9016aefc4ef7 100644 (file)
@@ -14,7 +14,6 @@
 /***************************************************************************/
 
 #include <stdarg.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
index 4058de5c8fa2f665cdcd658fcf452c29a98216a4..fcd100b7594d580ed4d484cbe959af21b4b8deb5 100644 (file)
@@ -14,7 +14,6 @@
 
 /***************************************************************************/
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
index 1bd6199e174a218e668b308ed5b838af062f442c..3ba7c47f9f23b1b9c4da4efcd31937ee0fcb39a7 100644 (file)
@@ -11,7 +11,6 @@
  *
  * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
index 5a1e3687cafa92ffd11237f67b4a3df6905330b8..7acfe9bf5fc3b8369ea7b49f4a128a8f212c3b52 100644 (file)
@@ -25,7 +25,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/irq.h>
index a547e47dd5fd4211c09df5029adde7795be4dafd..98244d51c15453c2f60ea5b0e450b2f087272450 100644 (file)
@@ -30,7 +30,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
@@ -893,7 +892,7 @@ static void au1xxx_dbdma_init(void)
        #error Unknown Au1x00 SOC
 #endif
 
-       if (request_irq(irq_nr, dbdma_interrupt, SA_INTERRUPT,
+       if (request_irq(irq_nr, dbdma_interrupt, IRQF_DISABLED,
                        "Au1xxx dbdma", (void *)dbdma_gptr))
                printk("Can't get 1550 dbdma irq");
 }
index 7bc768e558dbec0bb14dd2c1311d7a67963ed701..0a50af7f34b8ca940ac09f83cb497ef3f5b49577 100644 (file)
@@ -1,5 +1,4 @@
 
-#include <linux/config.h>
 #include <asm/io.h>
 #include <asm/mach-au1x00/au1000.h>
 
index 1d82f2277517e23511c48659c2ca649cd1c4cfa3..fb7c47c1585d22da6f25b08186205323374a0f38 100644 (file)
@@ -30,7 +30,6 @@
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  *
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index 5f5915b8314214ebe95aa2b83ab9e73e535fa592..ce55297dcb8c57e261cb6e7320e5c4d911f82b2c 100644 (file)
@@ -19,7 +19,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <au1000.h>
 #include <au1xxx_gpio.h>
index 12d6edee895eff9e6a38012ffad36449710a734c..29d6f8178badd55c4fc745cd37d2702f487ddc75 100644 (file)
@@ -26,7 +26,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/irq.h>
@@ -310,7 +309,7 @@ void startup_match20_interrupt(irqreturn_t (*handler)(int, void *, struct pt_reg
         * can avoid it.  --cgray
        */
        action.dev_id = handler;
-       action.flags = SA_INTERRUPT;
+       action.flags = IRQF_DISABLED;
        cpus_clear(action.mask);
        action.name = "Au1xxx TOY";
        action.handler = handler;
index b1392abac809b7da4ed9a572e5ad44db585afedd..da591f674893c110efb3a635e92bf807ddf4946f 100644 (file)
@@ -30,7 +30,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
index 32702e5fbf6761600bc09ec3cf4e392425c8d3fd..8fd203d4a339bd2a9f2626e9375432b6432793ae 100644 (file)
@@ -7,7 +7,6 @@
  * License version 2.  This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  */
-#include <linux/config.h>
 #include <linux/device.h>
 #include <linux/platform_device.h>
 #include <linux/kernel.h>
index b035513fe30a782bd172d4b494fd69ad1213dc77..7504a63646161f81ec3d9176be903d8955c5da57 100644 (file)
@@ -29,7 +29,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/pm.h>
 #include <linux/pm_legacy.h>
index c93af224c1b389f1296c12951caf9ef5b0686992..de5447e8384920e1fec8a58a56758b60215239dd 100644 (file)
@@ -27,7 +27,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <asm/io.h>
index 97165b6b3894a07908e16379fe4b639ebe4cd163..cc5138ce9c955f6903628e3ad2cf088ea7970571 100644 (file)
@@ -25,7 +25,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/ioport.h>
index 842e1b5ac4a1a3a6454e448dc5a136584d3f5409..7e988b0b013021880fe0a4d4433d415bcc4a0df5 100644 (file)
@@ -33,7 +33,6 @@
  */
 
 #include <linux/types.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel_stat.h>
 #include <linux/sched.h>
index 2cab7629702c3f6b6066250c8c9bc8db2dd36241..63bcb3a95dc73fa89b959fd3ff830621b5a98761 100644 (file)
@@ -1465,14 +1465,14 @@ usbdev_init(struct usb_device_descriptor* dev_desc,
         */
 
        /* request the USB device transfer complete interrupt */
-       if (request_irq(AU1000_USB_DEV_REQ_INT, req_sus_intr, SA_INTERRUPT,
+       if (request_irq(AU1000_USB_DEV_REQ_INT, req_sus_intr, IRQF_DISABLED,
                        "USBdev req", &usbdev)) {
                err("Can't get device request intr");
                ret = -ENXIO;
                goto out;
        }
        /* request the USB device suspend interrupt */
-       if (request_irq(AU1000_USB_DEV_SUS_INT, req_sus_intr, SA_INTERRUPT,
+       if (request_irq(AU1000_USB_DEV_SUS_INT, req_sus_intr, IRQF_DISABLED,
                        "USBdev sus", &usbdev)) {
                err("Can't get device suspend intr");
                ret = -ENXIO;
@@ -1483,7 +1483,7 @@ usbdev_init(struct usb_device_descriptor* dev_desc,
        if ((ep0->indma = request_au1000_dma(ep_dma_id[0].id,
                                             ep_dma_id[0].str,
                                             dma_done_ep0_intr,
-                                            SA_INTERRUPT,
+                                            IRQF_DISABLED,
                                             &usbdev)) < 0) {
                err("Can't get %s DMA", ep_dma_id[0].str);
                ret = -ENXIO;
@@ -1516,7 +1516,7 @@ usbdev_init(struct usb_device_descriptor* dev_desc,
                                request_au1000_dma(ep_dma_id[ep->address].id,
                                                   ep_dma_id[ep->address].str,
                                                   dma_done_ep_intr,
-                                                  SA_INTERRUPT,
+                                                  IRQF_DISABLED,
                                                   &usbdev);
                        if (ep->indma < 0) {
                                err("Can't get %s DMA",
index 1c55c5f59d759ba5704b2fee60c18bb36c73eb5a..348c3024d3d114b4f8c382327656aff2d65f8821 100644 (file)
@@ -26,7 +26,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/ioport.h>
index f00ec3b175d8e46fcebb0e81eabb1afec75daa58..7a79293f852730e403309786bf4644d5b5cc7103 100644 (file)
@@ -27,7 +27,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/ioport.h>
index 41e0522f3cf1583b2eabf89da16bca3ff06db0f2..0a3f025eb02350d1efada78f91ef1ebadd385afa 100644 (file)
@@ -33,7 +33,6 @@
 #include <linux/bootmem.h>
 #include <asm/addrspace.h>
 #include <asm/bootinfo.h>
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
 
index 0138c5b7c86010516dce394fc0757d8299586324..3e5729145c2b5d498f54e6bfc2acca498d3c853a 100644 (file)
@@ -25,7 +25,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/irq.h>
index c29852c24b4f98aa13581f9ee346c88cf72eb0e8..0942dcf69518806312e4aa702abd774956de6da4 100644 (file)
@@ -31,7 +31,6 @@
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/sched.h>
index 2efae106464772a649e85bcfc6221506b4cd9075..d081640e2e00980079f2c0f2a0b3b14d3d41773c 100644 (file)
@@ -27,7 +27,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/ioport.h>
index 01ab284839596a8b931157dc3e66d4e648ec8aa3..8f02bb80a55a5c80ca8c13f1f8967040e6635498 100644 (file)
@@ -34,7 +34,6 @@
 #include <linux/bootmem.h>
 #include <asm/addrspace.h>
 #include <asm/bootinfo.h>
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
 
index 638de7bb43f04d9ac1166f6d03ccbe12b7d82ceb..e917e54fc68359d7b7fd49db5b6f548f4f92d2ce 100644 (file)
@@ -28,7 +28,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/ioport.h>
index 0b4807dc9f44e3d93289f6091f495d750cef4051..1cf18e16ab54d7f02711356c073445771ebf992c 100644 (file)
@@ -23,7 +23,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/ioport.h>
index 13c2f6ca7e335a4bb5d8d21e3f8f731b51f23e2b..db27b9331ff3025be933d452f93851dd89f510ff 100644 (file)
@@ -23,7 +23,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/ioport.h>
index a45b17538ac988aecfb2f3e017520c6fa3718245..8b953b9fc25c7bd28116a562aee18f3e104d06fa 100644 (file)
@@ -23,7 +23,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/ioport.h>
index 5dd164fc1889290e243d0855ba1978aecf932dc7..2d49f32f46223a51196acd61c41fe2c60ef07a4f 100644 (file)
@@ -22,7 +22,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/irq.h>
index 30bb87282b1f6d913da0fd2b5e48276550f3f20e..1a9a293de6aba685833689b5ca2e4b5d3ea5111a 100644 (file)
@@ -23,7 +23,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/ioport.h>
index 1e59433dfd66a3ace22f153268be5fa2d8a9084b..ae3d6b19e94d48d5835a9d313d9d43ccb9c6ff37 100644 (file)
@@ -23,7 +23,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/ioport.h>
index 91121e523043912a3d9183ad190cd7ae5737519f..b288151b532e7ea3fba8a2affa5f654a60701017 100644 (file)
@@ -113,7 +113,7 @@ static int __exit iodev_remove(struct device *dev)
 
 static int iodev_open(struct inode *i, struct file *f)
 {
-       return request_irq(iodev_irq, iodev_irqhdl, SA_INTERRUPT,
+       return request_irq(iodev_irq, iodev_irqhdl, IRQF_DISABLED,
                           iodev_name, &miscdev);
 }
 
index 300797d5f558178fec6cdd2af5174b4b30971e58..46c23b66bc171883d2d9ae2e58dc8d750ffd7bab 100644 (file)
@@ -2,7 +2,6 @@
  * (C) P. Horton 2006
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/console.h>
index ca719d6398bd81b06689288b233f13873d210e04..c99714587ce8788031ee6f77db00a22347f89bf7 100644 (file)
@@ -9,7 +9,6 @@
  * Copyright (C) 2001, 2002, 2003 by Liam Davies (ldavies@agile.tv)
  *
  */
-#include <linux/config.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/init.h>
index 20c845c84d4b4902ab7415e579855de7880dd24a..efef0f57ce1e56d789c03ec986f72db966b2fb7f 100644 (file)
@@ -7,7 +7,6 @@
  * Free Software Foundation;  either version 2 of the  License, or (at your
  * option) any later version.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <linux/sched.h>
index de433cf9fb5013b7c934e0b0bafef9038842e21e..22fb94b7c4409bef1cd197602183c2b00c33de3f 100644 (file)
@@ -10,7 +10,6 @@
  * Free Software Foundation;  either version 2 of the  License, or (at your
  * option) any later version.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
index 93167ecdb424cc0799ecbce7eef14f1e1972ae73..47ba0b6f210f70961c60bf350bd64dc8f6fd52d8 100644 (file)
@@ -13,7 +13,6 @@
  * Free Software Foundation;  either version 2 of the  License, or (at your
  * option) any later version.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
index e8ec93e33fe60cc05eb0c7503992cbca38581d7b..455a65b91cb0b707e3656cc450238ae5f45a73cd 100644 (file)
@@ -13,7 +13,6 @@
  * Rewritten extensively for controller-driven IRQ support
  * by Maciej W. Rozycki.
  */
-#include <linux/config.h>
 
 #include <asm/addrspace.h>
 #include <asm/asm.h>
index 32a7cc7e4c658af62d269ebce4c51f0f7c6e0cdf..bf2858071f1fc79969b3e7d25e0d4b9a1fb61073 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 1998 Harald Koerfgen
  * Copyright (C) 2002, 2004  Maciej W. Rozycki
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/linkage.h>
index 1edaf3074ee93f9bed2c287b21619b6c6fda7419..3027ce782797541fba21b43e6b8ded4ce6bcbe7a 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 1998 Harald Koerfgen, Frieder Streffer and Paul M. Antoine
  * Copyright (C) 2000, 2002  Maciej W. Rozycki
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
index 9c707b9ceb65fdac4871408901f7abc5fa5b9062..2684f121784b7239957baf95c0c65408853a4a11 100644 (file)
@@ -105,7 +105,7 @@ static struct irqaction fpuirq = {
 };
 
 static struct irqaction busirq = {
-       .flags = SA_INTERRUPT,
+       .flags = IRQF_DISABLED,
        .name = "bus error",
 };
 
@@ -124,7 +124,7 @@ static void __init dec_be_init(void)
        case MACH_DS23100:      /* DS2100/DS3100 Pmin/Pmax */
                board_be_handler = dec_kn01_be_handler;
                busirq.handler = dec_kn01_be_interrupt;
-               busirq.flags |= SA_SHIRQ;
+               busirq.flags |= IRQF_SHARED;
                dec_kn01_be_init();
                break;
        case MACH_DS5000_1XX:   /* DS5000/1xx 3min */
index a04aea6123daf5ab3bd461f9138e927777864ed0..639ad5562c6314cc39dc35e6264561ad1d8f6e29 100644 (file)
@@ -32,7 +32,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/ioport.h>
index bff5b1c174e4cff4a676b4df3fbde69472416527..8cbe8426491a44a9383b03dbd8b994e836863e2d 100644 (file)
@@ -32,7 +32,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel_stat.h>
 #include <linux/module.h>
index 2287b59536e5e68ee104cebe11e3c47cb928f97c..d837b26fbe517e5602be5aec2ae5cb4d3b4ff244 100644 (file)
@@ -8,7 +8,6 @@
  */
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/kernel_stat.h>
 #include <asm/ptrace.h>
@@ -78,7 +77,7 @@ void gt64120_time_init(void)
         * the values to the correct interrupt line.
         */
        timer.handler = gt64120_irq;
-       timer.flags = SA_SHIRQ | SA_INTERRUPT;
+       timer.flags = IRQF_SHARED | IRQF_DISABLED;
        timer.name = "timer";
        timer.dev_id = NULL;
        timer.next = NULL;
index f0a6a38fcf4d9fae50fc20da3b7c1505ebc451ef..2128684584f533a08b358793f5d45375b8f5e364 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 
 #ifdef CONFIG_KGDB
 
index 6a7ccaf9350247d1fea9a44d427151ee2e71b918..8e9cd8a9670a66d81ad8f8ca23407cf1b7b1119d 100644 (file)
@@ -1,5 +1,4 @@
 
-#include <linux/config.h>
 
 #ifdef CONFIG_KGDB
 
index 19deb153d00550e167d8c649881fad7ea6cc6210..bfc25adcfec6aabd47524fd28e0c11f9f3adc594 100644 (file)
@@ -28,7 +28,6 @@
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 
 #ifdef CONFIG_IT8172_CIR
 
index da6ae0991199a4214bb6e2ad227864fb49351aa3..a4615a5904aa043bb4964751213b27f0f50b7fc2 100644 (file)
@@ -26,7 +26,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/ioport.h>
index 6e505af0cc08f6077d8f9b720350de6e856b7dd6..7d0a79be34d816ac885d7c4947d2360de1eb3b91 100644 (file)
@@ -35,7 +35,6 @@
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/string.h>
index c8d0df7d0c36ceed402bb68913183e3518152556..385413e30fddfe32ad81927d680d8f02c64ac1bd 100644 (file)
@@ -8,7 +8,6 @@
  * Copyright (C) 1996, 1997, 1998, 2001 by Ralf Baechle
  * Copyright (C) 2001 MIPS Technologies, Inc.
  */
-#include <linux/config.h>
 #include <linux/eisa.h>
 #include <linux/hdreg.h>
 #include <linux/init.h>
index a0674d73962ff950092546cab9aae3827a1c748d..a55cb4572dedee12bf1147a7bde0b1cd1ce3dd98 100644 (file)
@@ -27,7 +27,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <linux/sched.h>
index 380046ea1db55103f5ddbcc2c23e459b951c04ac..9c43702e7a93828d42afd218353ff240e4e6dfa9 100644 (file)
@@ -29,7 +29,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 
 #include <linux/errno.h>
index 308e6cdcd24523edba00e8b7d97d3d13cac603d1..6d4635d89d94893c075fa2a42a03daba4c085dd3 100644 (file)
@@ -33,7 +33,6 @@
  ***********************************************************************
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/kdev_t.h>
index f1bb6a2dc5fcdc6c898ba6921b84314e4f2815b1..ec28077d5ee2a165fe15929638c1c3bec83b5d19 100644 (file)
@@ -8,7 +8,6 @@
  * Kevin Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
  * Copyright (C) 2000 MIPS Technologies, Inc.
  */
-#include <linux/config.h>
 #include <linux/compat.h>
 #include <linux/types.h>
 #include <linux/sched.h>
index d268827c62bdd167459e8e43d2467781ff9f879a..c09337b947b98e9947c01e3dd067a14fd0e6e356 100644 (file)
@@ -6,7 +6,6 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/ptrace.h>
index e045aba4ebda2268f464eb382ca03dcd40bd24b5..ba08f055feb2ed1b7ad2c14b8cb772e546c8353a 100644 (file)
@@ -11,7 +11,6 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/ptrace.h>
index 457565162dd56fc85583ea8d9d13315d93c6d430..01e7fa86aa43d588b7ed8d8e70af403067d2c9e2 100644 (file)
@@ -7,7 +7,6 @@
  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  * Copyright (C) 2001 MIPS Technologies, Inc.
  */
-#include <linux/config.h>
 
 #include <asm/asm.h>
 #include <asm/asmmacro.h>
@@ -66,7 +65,7 @@ need_resched:
 #endif
 
 FEXPORT(ret_from_fork)
-       jal     schedule_tail           # a0 = task_t *prev
+       jal     schedule_tail           # a0 = struct task_struct *prev
 
 FEXPORT(syscall_exit)
        local_irq_disable               # make sure need_resched and
index 8760131f89d9c57f572bd138ceb42258248a3914..666bc9014cbd94f35cf5772f537b854098a5f9a0 100644 (file)
@@ -3,7 +3,6 @@
  *
  * Copyright (C) 1995 Andreas Busse
  */
-#include <linux/config.h>
 #include <linux/sys.h>
 
 #include <asm/asm.h>
index 6ecbdc1fefd13acdd930998a07c19e633aaab354..719d26968cb236675ef6a32bfd33cb836e3238f0 100644 (file)
  *       breakpoints, single stepping,
  *       printing variables, etc.
  */
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
index 6888cde560afc1b277c3d5844a3fcdca55c1b1b9..5254a2222d2bc5ba5f343b3c1c141b6935876bae 100644 (file)
@@ -8,7 +8,6 @@
  * Copyright (C) 2001 MIPS Technologies, Inc.
  * Copyright (C) 2002 Maciej W. Rozycki
  */
-#include <linux/config.h>
 #include <linux/init.h>
 
 #include <asm/asm.h>
index c018098c9a5600ce721ae000f92ef567e92949ed..476c1eb33c945b9cf7e494c7ee7d72d968afc5f0 100644 (file)
@@ -13,7 +13,6 @@
  * Kevin Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
  * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/threads.h>
 
index 5c9dcd5eed59e7cf3459381990e873346d329d5a..cde5e5afa179173ef74377cf2a0e0add6f01992e 100644 (file)
@@ -8,7 +8,6 @@
  * Copyright (C) 1992 Linus Torvalds
  * Copyright (C) 1994 - 2000 Ralf Baechle
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
 #include <linux/init.h>
index a7d2bb3cf835fb7299a014540c585d86e9ce723d..450ac592da576c8314a1cec7d0851d891e4cc1d7 100644 (file)
@@ -5,7 +5,6 @@
  * Written by Ulf Carlsson (ulfc@engr.sgi.com)
  * sys32_execve from ia64/ia32 code, Feb 2000, Kanoj Sarcar (kanoj@sgi.com)
  */
-#include <linux/config.h>
 #include <linux/compiler.h>
 #include <linux/mm.h>
 #include <linux/errno.h>
index 02237a685ec7f3b67aa8296b82fc00e83250c692..4dcc39f42951184651940c5d5d201212f0c9f2f6 100644 (file)
@@ -47,7 +47,7 @@ unsigned long mt_fpemul_threshold = 0;
  * used in sys_sched_set/getaffinity() in kernel/sched.c, so
  * cloned here.
  */
-static inline task_t *find_process_by_pid(pid_t pid)
+static inline struct task_struct *find_process_by_pid(pid_t pid)
 {
        return pid ? find_task_by_pid(pid) : current;
 }
@@ -62,7 +62,7 @@ asmlinkage long mipsmt_sys_sched_setaffinity(pid_t pid, unsigned int len,
        cpumask_t new_mask;
        cpumask_t effective_mask;
        int retval;
-       task_t *p;
+       struct task_struct *p;
 
        if (len < sizeof(new_mask))
                return -EINVAL;
@@ -127,7 +127,7 @@ asmlinkage long mipsmt_sys_sched_getaffinity(pid_t pid, unsigned int len,
        unsigned int real_len;
        cpumask_t mask;
        int retval;
-       task_t *p;
+       struct task_struct *p;
 
        real_len = sizeof(mask);
        if (len < real_len)
index 0a71a4c337161c5304e86730769c82fffcb1e2cf..f44a01357adae3fcc1f560d747a3d5d74ba232ec 100644 (file)
@@ -8,7 +8,6 @@
  * Copyright (C) 1996, 97, 98, 99, 2000, 01, 03, 04, 05 by Ralf Baechle
  * Copyright (C) 1999, 2000, 01 Silicon Graphics, Inc.
  */
-#include <linux/config.h>
 #include <linux/interrupt.h>
 #include <linux/module.h>
 #include <asm/checksum.h>
index 9def554f335b8f430dd0483dcca482b83c083d07..d8beef1079020da34071e338ec3f08ab386a882b 100644 (file)
@@ -5,7 +5,6 @@
  *  Copyright (C) 2001, 2004  MIPS Technologies, Inc.
  *  Copyright (C) 2004  Maciej W. Rozycki
  */
-#include <linux/config.h>
 #include <linux/delay.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index 199a06e873c6ab2e06166234a82d42fa1d3747e7..7ab67f786bfe277327f55517364855f4fc728b2f 100644 (file)
@@ -8,7 +8,6 @@
  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  * Copyright (C) 2004 Thiemo Seufer
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/module.h>
 #include <linux/sched.h>
index 1d44025188d8328b08a519f81ecb6e113cf4cf20..362d1728e5317d7b99f014a045f2c821c341056f 100644 (file)
@@ -14,7 +14,6 @@
  * At this time Linux/MIPS64 only supports syscall tracing, even for 32-bit
  * binaries.
  */
-#include <linux/config.h>
 #include <linux/compiler.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index 0d9c4a32a9c2dbc617fb727dd67f9d00bc509718..656bde2e11b14d37186b5d3ec850b5397a78167d 100644 (file)
@@ -10,7 +10,6 @@
  * Further modifications to make this work:
  * Copyright (c) 1998-2000 Harald Koerfgen
  */
-#include <linux/config.h>
 #include <asm/asm.h>
 #include <asm/cachectl.h>
 #include <asm/fpregdef.h>
index 283a98508fc801d81869eedd349a02f6251e6274..880fa6e841ee95f678993fb5dd17138f62f5af22 100644 (file)
@@ -12,7 +12,6 @@
  * Copyright (C) 2000 MIPS Technologies, Inc.
  * Copyright (C) 1999, 2001 Silicon Graphics, Inc.
  */
-#include <linux/config.h>
 #include <asm/asm.h>
 #include <asm/errno.h>
 #include <asm/fpregdef.h>
index e1b85e6c486a1cd392ba351e6f423325b3593636..d5c8b82fed7298c75b69a11623ff635106513b98 100644 (file)
@@ -10,7 +10,6 @@
  * Copyright (C) 2000 MIPS Technologies, Inc.
  *    written by Carsten Langgaard, carstenl@mips.com
  */
-#include <linux/config.h>
 #include <asm/asm.h>
 #include <asm/cachectl.h>
 #include <asm/fpregdef.h>
index caf777f832893f43efcf2676ffc6374da615046e..cdab1b2cd1343c0185ed4d5161059222076a6e0a 100644 (file)
@@ -487,7 +487,7 @@ static struct file_operations rtlx_fops = {
 
 static struct irqaction rtlx_irq = {
        .handler        = rtlx_interrupt,
-       .flags          = SA_INTERRUPT,
+       .flags          = IRQF_DISABLED,
        .name           = "RTLX",
 };
 
index 6344be46ca8c297494526c2c6e8fe9d60013388e..8f8101f878ca6e4920550b02c48526279165b758 100644 (file)
@@ -7,7 +7,6 @@
  * Copyright (C) 2001 MIPS Technologies, Inc.
  * Copyright (C) 2004 Thiemo Seufer
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <asm/asm.h>
 #include <asm/asmmacro.h>
index 12d96c7d0bb22bc4b334fcf0004f87c3163a08d7..b4a34a625a2e5cc08f006b52776ba935cebf9598 100644 (file)
@@ -7,7 +7,6 @@
  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  * Copyright (C) 2001 MIPS Technologies, Inc.
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <asm/asm.h>
 #include <asm/asmmacro.h>
index 685698554a8acf275e3b368d69b75177684a3a9e..df8c4f8ccd61039a78b5eb429566b52d73e430f8 100644 (file)
@@ -7,7 +7,6 @@
  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  * Copyright (C) 2001 MIPS Technologies, Inc.
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <asm/asm.h>
 #include <asm/asmmacro.h>
index 0e632934cb7679a02806ba13c45c877371b2a0be..f04fe4f085c3461ff1a31e5dbaa6c8472ca2ab71 100644 (file)
@@ -13,7 +13,6 @@
  * to ABI64 calling convention.  64-bit syscalls are also processed
  * here for now.
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <asm/asm.h>
 #include <asm/asmmacro.h>
index d3e087115023ad0ef6867b5bd12c504ac3b070c5..5edd8d4bb665c988f4cde96495b8643ecb7840e9 100644 (file)
@@ -10,7 +10,6 @@
  * Copyright (C) 1999 Silicon Graphics, Inc.
  * Copyright (C) 2000 2001, 2002  Maciej W. Rozycki
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/ioport.h>
index ce6cb915c0a7a703ab6c49a2e269d4de1256db38..b1f09d54ebe64396ba88f33ceabf0ed21b1c6419 100644 (file)
@@ -8,7 +8,6 @@
  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  */
 
-#include <linux/config.h>
 
 static inline int
 setup_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
index 402efd27c79e87bfc7ed2c0e8a1cbc284313be7e..6b4d9be31615b3325d50d6fb48c6627c7f748850 100644 (file)
@@ -7,7 +7,6 @@
  * Copyright (C) 1994 - 2000  Ralf Baechle
  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  */
-#include <linux/config.h>
 #include <linux/cache.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
index 57770902b9aeaa15542281c98611cb0e439882ca..93429a4d301296d2b550ce34d8f254ea93aaa8aa 100644 (file)
@@ -130,13 +130,13 @@ irqreturn_t ipi_call_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 static struct irqaction irq_resched = {
        .handler        = ipi_resched_interrupt,
-       .flags          = SA_INTERRUPT,
+       .flags          = IRQF_DISABLED,
        .name           = "IPI_resched"
 };
 
 static struct irqaction irq_call = {
        .handler        = ipi_call_interrupt,
-       .flags          = SA_INTERRUPT,
+       .flags          = IRQF_DISABLED,
        .name           = "IPI_call"
 };
 
index 70cf09afdf565c573d5750f70723deed249d98bd..a48d9e553083288943fede939624473d330b43c7 100644 (file)
@@ -1002,7 +1002,7 @@ void setup_cross_vpe_interrupts(void)
        set_vi_handler(MIPS_CPU_IPI_IRQ, ipi_irq_dispatch);
 
        irq_ipi.handler = ipi_interrupt;
-       irq_ipi.flags = SA_INTERRUPT;
+       irq_ipi.flags = IRQF_DISABLED;
        irq_ipi.name = "SMTC_IPI";
 
        setup_irq_smtc(cpu_ipi_irq, &irq_ipi, (0x100 << MIPS_CPU_IPI_IRQ));
index 6da8c68e89db23660868563359fe45a6b3e91d10..0721314db6573b4c0efcd2d35dc458ee99d09474 100644 (file)
@@ -7,7 +7,6 @@
  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  * Copyright (C) 2001 MIPS Technologies, Inc.
  */
-#include <linux/config.h>
 #include <linux/a.out.h>
 #include <linux/capability.h>
 #include <linux/errno.h>
index 13ff4da598cdfbcff3b2d34677c0e89cd3b55e28..2393c11d5a207fe530446024cce4ae17944a728c 100644 (file)
@@ -11,7 +11,6 @@
  * Free Software Foundation;  either version 2 of the  License, or (at your
  * option) any later version.
  */
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -580,7 +579,7 @@ unsigned int mips_hpt_frequency;
 
 static struct irqaction timer_irqaction = {
        .handler = timer_interrupt,
-       .flags = SA_INTERRUPT,
+       .flags = IRQF_DISABLED,
        .name = "timer",
 };
 
index 67971938a2cb4f575321a550ff5aee5deacd315f..8b95eca9ac74f85c37e9501c78f7186ce3328e17 100644 (file)
@@ -11,7 +11,6 @@
  * Copyright (C) 2000, 01 MIPS Technologies, Inc.
  * Copyright (C) 2002, 2003, 2004, 2005  Maciej W. Rozycki
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <linux/module.h>
index 5b5a3736cbbcb002eaf0b61c4dd9507343df094f..7e7d54823486f0acc367451a527a2a481925b829 100644 (file)
@@ -72,7 +72,6 @@
  *       A store crossing a page boundary might be executed only partially.
  *       Undo the partial store in this case.
  */
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/signal.h>
index b84d1f9ce28ef169e0fbb633ba184c5341e03e40..0bb9cd8894567d80697e52f51ec0f2228ca18824 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <asm/asm-offsets.h>
 #include <asm-generic/vmlinux.lds.h>
 
index fc9b0e2a6be10d8bee0f2e8ce2fca3dc9c2bc854..d425120b0282f28e54c96f6c15444dcb20c689a6 100644 (file)
@@ -17,7 +17,6 @@
  *
  * Routines specific to the LASAT boards
  */
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/crc32.h>
 #include <asm/lasat/lasat.h>
index 181bf68175fccf18255c81079928e56d6b8df83f..9e22acf03083217b7687a9997b0e21290797fff3 100644 (file)
@@ -17,7 +17,6 @@
  *
  * Reset the LASAT board.
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/pm.h>
 
index 3f64277429e43860483c2adbc7dd62f17537940c..2187e63c6d88e97b8c77806a6dfa6066a97240a1 100644 (file)
@@ -22,7 +22,6 @@
  *
  * Lasat specific setup.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/pci.h>
index e3d5aaa90f0db260ee78026df04ff603f4690c8c..6dd7ae1b7c25401a7c1cfda8817d6c28b4d10eb1 100644 (file)
@@ -20,7 +20,6 @@
 #include <linux/types.h>
 #include <asm/lasat/lasat.h>
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sysctl.h>
 #include <linux/stddef.h>
index c49a925d01690e38c8a16e6fefdbb020799391a4..6a68deb51aae96ce8d34fa6a3bf843c775fad5cb 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 1994, 1995 by Waldorf Electronics, written by Ralf Baechle.
  * Copyright (C) 1999 by Silicon Graphics, Inc.
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/sched.h>
index 11a5f015f04005eaf1ddbe9f70c3c649f6c4e0ed..be8261be679b2d769d67e5b7a3be8340752563e8 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 1994, 1995 by Waldorf Electronics, written by Ralf Baechle.
  * Copyright (C) 1999 by Silicon Graphics, Inc.
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/sched.h>
index 7f9aafa4d80e56eed12497964c2118072a86bc1a..a526c62cb76a90626d6461b31be1000f2858af38 100644 (file)
@@ -12,7 +12,6 @@
  *
  * Mnemonic names for arguments to memcpy/__copy_user
  */
-#include <linux/config.h>
 
 /*
  * Hack to resolve longstanding prefetch issue
index 56ca0c6a7178f935f30b6e730718b86e4d47425a..5b3390f64917fda0b53bc0d90be90c201048ae4a 100644 (file)
@@ -19,7 +19,6 @@
  * manipulation primitives for the Algorithmics MIPS
  * FPU Emulator
  */
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <asm/processor.h>
 #include <asm/signal.h>
index 8cc9effcb832d5a6eccd161d632af28b92b82295..3a7c3d28aa0d4d5671af23b0ac417a6396a78a35 100644 (file)
@@ -15,7 +15,6 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/sched.h>
index df4e9473560441bb1b9fcec9038155c4edf61173..58a0fe883591467333c2624640ab5840e850b0ea 100644 (file)
@@ -19,7 +19,6 @@
  *
  * PROM library initialisation code.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
index fd492562584aabea44489f7ad622d49ebdacc90e..c89fcf9e9c22f51fd88c74e3a0f941a441edc168 100644 (file)
@@ -18,7 +18,6 @@
  * PROM library functions for acquiring/using memory descriptors given to
  * us from the YAMON.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <linux/bootmem.h>
index 2c1ab1f19fdcdad3d7b813ed056b72dbdfc869d5..1a711bd79b51520e900271cccc981cbd350779f3 100644 (file)
@@ -17,7 +17,6 @@
  *
  * Putting things on the screen/serial line using YAMONs facilities.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/serial_reg.h>
index 7213c395fb6bc4752af4bbfb2cb3a4ab023c7b8f..0996ba368b2a26f32ad53f921e430798978ba4ad 100644 (file)
@@ -22,7 +22,6 @@
  * Reset the MIPS boards.
  *
  */
-#include <linux/config.h>
 #include <linux/pm.h>
 
 #include <asm/io.h>
index a9f6124b3a227ee722288a5b239ddbfff3f821dc..5e207760826bd92bd2e3d6732200a07fceadfc80 100644 (file)
@@ -19,7 +19,6 @@
  */
 
 #include <linux/types.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel_stat.h>
 #include <linux/sched.h>
index 0766e434b6bde10283c6dc627eca4e330bafa5de..bc4ac6f018778251c687703992bc6a988b8adbcd 100644 (file)
@@ -15,7 +15,6 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/ioport.h>
index 6430f11f3a9596532b4c1b21bcbb3e69337d2bf3..a856bd6648798d4310c30517d2848c68287dbaca 100644 (file)
@@ -17,7 +17,6 @@
  *
  * SEAD specific setup.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/ioport.h>
index 5b84c7fe1022f6a70c8cf5a288c891a0ed799e46..ec549f3e2011fda818a0d69548c973285b78269b 100644 (file)
@@ -17,7 +17,6 @@
  *
  * Interrupt exception dispatch code.
  */
-#include <linux/config.h>
 
 #include <asm/asm.h>
 #include <asm/mipsregs.h>
index d16cf38220763f34f7ef1a52da91cc4be21076b7..b7444e74a6a1cdfa766a702d5776f819d56c6eeb 100644 (file)
@@ -17,7 +17,6 @@
  * Interrupt exception dispatch code.
  *
  */
-#include <linux/config.h>
 
 #include <asm/asm.h>
 #include <asm/mipsregs.h>
index 15a5dac4ae19ad1122b99e06c2f4abc1813e959b..3d4a785b565a4e17d65044c0b29df4c7521863ed 100644 (file)
@@ -16,7 +16,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
index 004070956cca6862da7115aaf955174ae67f152a..cb47863ecf10bd915be6aa517064d1ae7a0739ac 100644 (file)
@@ -18,7 +18,6 @@
 /*
  * Simulator Platform-specific hooks for SMP operation
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/cpumask.h>
index 18b968c696d1543c6601de6ef285eec2d16c8e78..e7f6003357f7f24cf9391ff10f8f9cfdc22ee638 100644 (file)
@@ -1,5 +1,4 @@
 #include <linux/types.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel_stat.h>
 #include <linux/sched.h>
index 75d887e89739e2a86f086a8ac33ac26537751a05..857b726f4d412874c12fe069fa8920ea8162e19d 100644 (file)
@@ -7,7 +7,6 @@
  * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Ralf Baechle (ralf@gnu.org)
  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index f9b129491b1e4e038019d715e0d4d63ae4b34629..2d71efb82ac568be0771e52be3702cbc02a39c5d 100644 (file)
@@ -18,7 +18,6 @@
  * 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/config.h>
 #include <linux/init.h>
 
 #include <asm/asm.h>
index 83a56296be86d063c08296b6e39bb1df9ccaef85..ddd3a2de1d73ea8513ace939f4c40d0fd81e2205 100644 (file)
@@ -5,7 +5,6 @@
  *
  * Copyright (C) 1994 - 2003 by Ralf Baechle
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
index 1cf3c6006ccd38f2ecaea4247489cdcdea413087..e19fbb9ee47f240e9785cef121e819aacc6f8436 100644 (file)
@@ -15,7 +15,6 @@
  * 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/config.h>
 #include <linux/sched.h>
 #include <asm/mipsregs.h>
 #include <asm/sibyte/sb1250.h>
index f6b3c722230c216c3d03d21ecc3be73d5ca0bef5..7fa5fd16e46bfe846b5c47063d7d85e5dab54f57 100644 (file)
@@ -7,7 +7,6 @@
  * Copyright (C) 2000, 2001  Ralf Baechle <ralf@gnu.org>
  * swiped from i386, and cloned for MIPS by Geert, polished by Ralf.
  */
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/dma-mapping.h>
 #include <linux/mm.h>
index cd4ea8474f89377fd3c7fef67e5ba85563d02178..2eeffe5c2a3a40315c69cd0a6defc907cb4eb292 100644 (file)
@@ -7,7 +7,6 @@
  * Copyright (C) 2000, 2001  Ralf Baechle <ralf@gnu.org>
  * swiped from i386, and cloned for MIPS by Geert, polished by Ralf.
  */
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/mm.h>
 #include <linux/module.h>
index 0c544375b856be81235c121c0fca81f0290deeb0..99ebf3ccc222b78ef8743b9f0bb5b6cba15d894c 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/highmem.h>
 #include <asm/tlbflush.h>
index 33f6e1cdfd5b409341488e4e2f15424f82451c3b..802bdd32aa2b17a5bda17f664d487fe92e8e9816 100644 (file)
@@ -8,7 +8,6 @@
  * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
  * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/signal.h>
index 148c65b9cd8bfb9df1ba633a926f84e707d33cd3..fc3c7878fb459eba0d8e45b15751313435d8a16d 100644 (file)
@@ -22,7 +22,6 @@
  * 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/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/smp.h>
index 4a3c4919e31489143c6a5b6c25e4334184ac89fd..4bdaa05f485b446e0d66587015cbd8378abf4a69 100644 (file)
@@ -5,7 +5,6 @@
  *
  * Copyright (C) 2003 by Ralf Baechle
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <linux/bootmem.h>
index 3fe94202da8ca7c21f1d8d973537aeb18b663711..792c6eb442326790b72759d7ca5e8cd433f838af 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/swap.h>
index 965cb4c4359db6b03c8f737b0a609e6d134ad9b6..2cde1b77244304fdd530885c0f21e567e5fb2b56 100644 (file)
@@ -8,7 +8,6 @@
  * Carsten Langgaard, carstenl@mips.com
  * Copyright (C) 2002 MIPS Technologies, Inc.  All rights reserved.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
index 1bfb09198ce378ce4a45bc300fad743ed0cfe4bf..266a47d65eed06d29ee57745c12fac5959e8afd0 100644 (file)
@@ -8,7 +8,6 @@
  * Carsten Langgaard, carstenl@mips.com
  * Copyright (C) 2002 MIPS Technologies, Inc.  All rights reserved.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
index 54507be2ab5bb07f967f23e9c8305ab5f2ddf48a..e1a8139fc8fb2cdb3225114163bf7e4c8e70850b 100644 (file)
@@ -21,7 +21,6 @@
 
 #include <stdarg.h>
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
index d7dea0a136aabedd95a98f0646e756ffce77c8ab..b85a6521f72d12e3fd133e17b06f80a434d6be3a 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 
 #if defined(CONFIG_REMOTE_DEBUG)
 
index ec4032b38f19230e26c169f57dceee4867bbf54f..f9067469a65618dafb3786069819d878f1d506b8 100644 (file)
@@ -71,7 +71,7 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
 }
 
 static struct irqaction cascade_mv64340 = {
-       no_action, SA_INTERRUPT, CPU_MASK_NONE, "MV64340-Cascade", NULL, NULL
+       no_action, IRQF_DISABLED, CPU_MASK_NONE, "MV64340-Cascade", NULL, NULL
 };
 
 void __init arch_init_irq(void)
index 1cadaa92946afcf2fa4204aaa6488d290caf9665..3d2712929293e4de845fd36979eacaf0cf53df80 100644 (file)
@@ -16,7 +16,6 @@
  *
  * Added changes for SMP - Manish Lachwani (lachwani@pmc-sierra.com)
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <linux/sched.h>
index ce9fb2e3d952194945b51e6eef25363b2f7a8c1e..c73b0897dc52c25e77ed414ed3f1aa9bf0e9931a 100644 (file)
@@ -14,7 +14,6 @@
  * Louis Hamilton, Red Hat, Inc.
  * hamilton@redhat.com  [MIPS64 modifications]
  */
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <asm/io.h>
index d0419480b097571fc857166cfd7d5d21d8e21d7a..b08e6a0456c1e182d1382a0bd68704c471b7d408 100644 (file)
@@ -39,7 +39,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/bcd.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
index 87c63c340ae3f4124f50887a07aa644b07efa414..793782a9c195cb56c8ad8013f57ae01e67ad000b 100644 (file)
@@ -54,7 +54,7 @@
 #include <asm/system.h>
 
 static struct irqaction cascade_mv64340 = {
-       no_action, SA_INTERRUPT, CPU_MASK_NONE, "MV64340-Cascade", NULL, NULL
+       no_action, IRQF_DISABLED, CPU_MASK_NONE, "MV64340-Cascade", NULL, NULL
 };
 
 void __init arch_init_irq(void)
index 9803daa2a792fb54701a9f5c1a9530deec7a4f43..296d945bc248e5d9a7f529d21fa6ba549e64c328 100644 (file)
@@ -21,7 +21,6 @@
  * Author: Manish Lachwani, mlachwani@mvista.com
  *
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/bootmem.h>
 #include <linux/mv643xx.h>
index f0a6a38fcf4d9fae50fc20da3b7c1505ebc451ef..2128684584f533a08b358793f5d45375b8f5e364 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 
 #ifdef CONFIG_KGDB
 
index 86f61ce59e53b33d205040f14a903e6e44f37882..9d44ae1e156b65b698afa0c6a284e9b19491fd33 100644 (file)
@@ -52,11 +52,11 @@ extern void uart_irq_init(void);
 extern void cpci_irq_init(void);
 
 static struct irqaction cascade_fpga = {
-       no_action, SA_INTERRUPT, CPU_MASK_NONE, "cascade via FPGA", NULL, NULL
+       no_action, IRQF_DISABLED, CPU_MASK_NONE, "cascade via FPGA", NULL, NULL
 };
 
 static struct irqaction cascade_mv64340 = {
-       no_action, SA_INTERRUPT, CPU_MASK_NONE, "cascade via MV64340", NULL, NULL
+       no_action, IRQF_DISABLED, CPU_MASK_NONE, "cascade via MV64340", NULL, NULL
 };
 
 extern void ll_uart_irq(struct pt_regs *regs);
index 97fb77dad7235b58d9d873f1adceee69fd62a35a..7228cd19e5ea828822574e4562562531153c52b5 100644 (file)
@@ -30,7 +30,6 @@
 #ifndef __OCELOT_C_FPGA_H__
 #define __OCELOT_C_FPGA_H__
 
-#include <linux/config.h>
 
 #ifdef CONFIG_64BIT
 #define OCELOT_C_CS0_ADDR       (0xfffffffffc000000)
index e92364482c7b09b65a276275ef4b649428b82268..4c50a147f42977a7c0be810a3fff6166c0bb71a0 100644 (file)
@@ -14,7 +14,6 @@
  * Free Software Foundation;  either version 2 of the  License, or (at your
  * option) any later version.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <linux/sched.h>
index 9dcd154c77672b7856cbf67843a3c51bd64a921b..3fdcb64ff1e69bd8324d4499778122b26cb3d535 100644 (file)
@@ -14,7 +14,6 @@
  * Louis Hamilton, Red Hat, Inc.
  * hamilton@redhat.com  [MIPS64 modifications]
  */
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <asm/io.h>
index a0ee006d75cfbb3e09acbbcf88341e2493ef1a9b..6a4519936ee97d1e2c0d6075134435ff28d55726 100644 (file)
@@ -40,7 +40,6 @@
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  *
  */
-#include <linux/config.h>
 #include <linux/bcd.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
index f0a6a38fcf4d9fae50fc20da3b7c1505ebc451ef..2128684584f533a08b358793f5d45375b8f5e364 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 
 #ifdef CONFIG_KGDB
 
index 8bd9b844fa9e8fa0580ea8405fd5239d4a76edcc..9fb2493fff02494c0bb8789d4e273f5ac786c4c4 100644 (file)
@@ -11,7 +11,6 @@
  * Free Software Foundation;  either version 2 of the  License, or (at your
  * option) any later version.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
@@ -174,7 +173,7 @@ void gt64240_time_init(void)
         * the values to the correct interrupt line.
         */
        timer.handler = &gt64240_p0int_irq;
-       timer.flags = SA_SHIRQ | SA_INTERRUPT;
+       timer.flags = IRQF_SHARED | IRQF_DISABLED;
        timer.name = "timer";
        timer.dev_id = NULL;
        timer.next = NULL;
index 6b4f577c275734790e92a65c3ecab89f97e1a93a..6509a9c9863c6d49fab630a840aeac2c67074abc 100644 (file)
@@ -11,7 +11,6 @@
  * Free Software Foundation;  either version 2 of the  License, or (at your
  * option) any later version.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <linux/sched.h>
index 39da02b4e0761983a3ceeac332a7f6963492ec46..c580b1de33bc68e385f86c8cf22dc5680cfcaef2 100644 (file)
@@ -37,7 +37,6 @@
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  *
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
index 87920b245931bc1571f54a1021955e2dd19668f5..439510af30372152656f3242a6599aa603ba3679 100644 (file)
@@ -16,7 +16,6 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/pci.h>
 
index a8a47b494b23be496a008eec42947bbbf3965a63..8e01d0c1b76b5714dd1441298e94e4ce9a9905c2 100644 (file)
@@ -15,7 +15,6 @@
  * Author: Manish Lachwani (mlachwani@mvista.com)
  *
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/pci.h>
 
index be1420126c42329e24c01c011784457c4a796c15..0c0c1e6519f9e4a35cb6a98b04b669ad4384c82a 100644 (file)
@@ -28,7 +28,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
index f4ef1a35ca18bc6e4ad9bbb25cca9a5b6143463d..f6774f54cd3c61f5aa42e9c184d2d390780652e3 100644 (file)
@@ -32,7 +32,6 @@
  *
  * XXX: AT THIS TIME, ONLY the NATIVE PCI-X INTERFACE IS SUPPORTED.
  */
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
index a3eebe5890a76db08e87fe305d6bc65dd76c1a6c..ba2e34b09231dccdb6bf8e587363ac9e90d648ba 100644 (file)
@@ -31,7 +31,6 @@
  * problem.
  *
  */
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
index 180af89bcb1ed133c2a296017c4d118b7d5f1493..17c7932cf0ae1775b89ab24584abfc4430d542c8 100644 (file)
@@ -6,7 +6,6 @@
  * Copyright (C) 2000, 2001 Keith M Wesolowski
  * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org)
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
index 7cca3bde59b24d09c01d48dd816345c9e5fe89e7..80f5e8c4bcd47e203822d9dc3df74c7ceb3b00a1 100644 (file)
@@ -30,7 +30,6 @@
  * kernel mapped memory.  Hopefully neither of these should be a huge
  * problem.
  */
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
index ba66f8c9bd4eec824b21882d8129d284289cf6dc..5ace368657ad691a352ca4dfa237a3bde96d8c00 100644 (file)
@@ -6,7 +6,6 @@
  *
  * Copyright (C) 2003, 04 Ralf Baechle (ralf@linux-mips.org)
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/bootmem.h>
index 8f18764a235956c6dbb14825b8cabba6daf8dd91..8aca317d462423e69bc38f890b98f1acacdd2f2b 100644 (file)
@@ -23,7 +23,6 @@
  *  59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  *
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/sched.h>
@@ -220,13 +219,13 @@ static struct hw_interrupt_type level_irq_type = {
 
 static struct irqaction gic_action = {
        .handler =      no_action,
-       .flags =        SA_INTERRUPT,
+       .flags =        IRQF_DISABLED,
        .name =         "GIC",
 };
 
 static struct irqaction timer_action = {
        .handler =      no_action,
-       .flags =        SA_INTERRUPT,
+       .flags =        IRQF_DISABLED,
        .name =         "Timer",
 };
 
index 0e791f4f6ea3bf41b384346c082737c30046ae8d..8ac81a9dc29327e743c7a9498090550b538065f0 100644 (file)
@@ -17,7 +17,6 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/ioport.h>
index fb523ebcafa8e8a5e6c8ee753cdbaa8c6a347e57..1f7c999eb7c63d69f6cea6aa08f28926d37eee41 100644 (file)
@@ -23,7 +23,6 @@
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
index a1f524fc4c107feb18ba11024c35fa0f7b49b963..b91d0aa3b7ed3667374d0873cc56782d07e570dd 100644 (file)
@@ -26,7 +26,6 @@
  *
  * Second level Interrupt handlers for the PMC-Sierra Titan/Yosemite board
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/kernel_stat.h>
index 165275c00cbb9c8fb42ebf9cbf64807725f67c95..9fe4973377c315ad0dd829946c4521e8d7a1c3ac 100644 (file)
@@ -8,7 +8,6 @@
  * Author: Manish Lachwani (lachwani@pmc-sierra.com)
  * Copyright (C) 2004 Ralf Baechle
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
index 989167b49ce92e70611940937a10c3a7efff5e28..ce8e4a7869b04276477b32d26b5a8d0bdbad30dc 100644 (file)
@@ -19,7 +19,6 @@
  * - Fix more bugs.
  */
 
-#include <linux/config.h>
 #include <linux/eisa.h>
 #include <linux/types.h>
 #include <linux/init.h>
index 18906af6969100e7c51f9b0c9a62a60ad1c3ad3e..2d8762818d95f33a50b4073685fe77e6e6d01b9b 100644 (file)
@@ -9,7 +9,6 @@
  *                    - Interrupt handling fixes
  * Copyright (C) 2001, 2003 Ladislav Michl (ladis@linux-mips.org)
  */
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/kernel_stat.h>
@@ -273,32 +272,32 @@ static void indy_buserror_irq(struct pt_regs *regs)
 
 static struct irqaction local0_cascade = {
        .handler        = no_action,
-       .flags          = SA_INTERRUPT,
+       .flags          = IRQF_DISABLED,
        .name           = "local0 cascade",
 };
 
 static struct irqaction local1_cascade = {
        .handler        = no_action,
-       .flags          = SA_INTERRUPT,
+       .flags          = IRQF_DISABLED,
        .name           = "local1 cascade",
 };
 
 static struct irqaction buserr = {
        .handler        = no_action,
-       .flags          = SA_INTERRUPT,
+       .flags          = IRQF_DISABLED,
        .name           = "Bus Error",
 };
 
 static struct irqaction map0_cascade = {
        .handler        = no_action,
-       .flags          = SA_INTERRUPT,
+       .flags          = IRQF_DISABLED,
        .name           = "mapable0 cascade",
 };
 
 #ifdef USE_LIO3_IRQ
 static struct irqaction map1_cascade = {
        .handler        = no_action,
-       .flags          = SA_INTERRUPT,
+       .flags          = IRQF_DISABLED,
        .name           = "mapable1 cascade",
 };
 #define SGI_INTERRUPTS SGINT_END
index d7138906eb10e13fca53702ddf1464db66a1f57b..25097ecc9baa4b5eab82f45f914705ef8db985a2 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
  * Copyright (C) 1997, 1998 Ralf Baechle (ralf@gnu.org)
  */
-#include <linux/config.h>
 #include <linux/ds1286.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
index a6b490e99709f49c064224d31fd7816a48cb474e..9094baf31d0e8c8d7b4c6d40ccc3ce1fbea4a96c 100644 (file)
@@ -6,7 +6,6 @@
  * Copyright (C) 2000 - 2001 by Kanoj Sarcar (kanoj@sgi.com)
  * Copyright (C) 2000 - 2001 by Silicon Graphics, Inc.
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/sched.h>
index 869566c360ae9b5fe5a4e7b2d848498d39dda975..597ec73359b70ebda688f6f36517827fc3d334dc 100644 (file)
@@ -8,7 +8,6 @@
 
 #undef DEBUG
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/errno.h>
@@ -119,7 +118,7 @@ static int ms1bit(unsigned long x)
 }
 
 /*
- * This code is unnecessarily complex, because we do SA_INTERRUPT
+ * This code is unnecessarily complex, because we do IRQF_DISABLED
  * intr enabling. Basically, once we grab the set of intrs we need
  * to service, we must mask _all_ these interrupts; firstly, to make
  * sure the same intr does not intr again, causing recursion that
index 41c3f405e00c99c7ad98ed51d5db716fbd05f1c9..d777b7d1a9fec6c30e3058208887cc12ffbf1ff7 100644 (file)
@@ -3,7 +3,6 @@
  * Copyright 2000 - 2001 Silicon Graphics, Inc.
  * Copyright 2000 - 2001 Kanoj Sarcar (kanoj@sgi.com)
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/mmzone.h>
 #include <linux/kernel.h>
index 6c00dce9f73fbd386e3366700c69c71c5a46f5c8..efe6971fc800f7ebdb6fedce429a3345b5aaf881 100644 (file)
@@ -10,7 +10,6 @@
  * On SGI IP27 the ARC memory configuration data is completly bogus but
  * alternate easier to use mechanisms are available.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
index 4322db57d3c15e9eb53f91fbe741ecb7f5577b1c..c17076108d47974f21fd9a89d40b461d9389806c 100644 (file)
@@ -8,7 +8,6 @@
  * Copyright (C) 1997, 1998, 1999, 2000, 06 by Ralf Baechle
  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/timer.h>
index 1fb860c7ac6dd60f96204ae67142a1231d99c4f5..3ca614a851e5ab65b1921f559d3d72dc19d3e684 100644 (file)
@@ -217,7 +217,7 @@ static struct hw_interrupt_type rt_irq_type = {
 
 static struct irqaction rt_irqaction = {
        .handler        = ip27_rt_timer_interrupt,
-       .flags          = SA_INTERRUPT,
+       .flags          = IRQF_DISABLED,
        .mask           = CPU_MASK_NONE,
        .name           = "timer"
 };
index 00b94aaf6371834134736b909979397c9c7c52f9..3b7e74b6222e1803d114e73400102f8af28c2ca2 100644 (file)
@@ -125,9 +125,9 @@ extern irqreturn_t crime_memerr_intr (int irq, void *dev_id,
 extern irqreturn_t crime_cpuerr_intr (int irq, void *dev_id,
                                      struct pt_regs *regs);
 
-struct irqaction memerr_irq = { crime_memerr_intr, SA_INTERRUPT,
+struct irqaction memerr_irq = { crime_memerr_intr, IRQF_DISABLED,
                        CPU_MASK_NONE, "CRIME memory error", NULL, NULL };
-struct irqaction cpuerr_irq = { crime_cpuerr_intr, SA_INTERRUPT,
+struct irqaction cpuerr_irq = { crime_cpuerr_intr, IRQF_DISABLED,
                        CPU_MASK_NONE, "CRIME CPU error", NULL, NULL };
 
 /*
@@ -316,9 +316,9 @@ static struct hw_interrupt_type ip32_macepci_interrupt = {
                                 MACEISA_KEYB_POLL_INT |        \
                                 MACEISA_MOUSE_INT |            \
                                 MACEISA_MOUSE_POLL_INT |       \
-                                MACEISA_TIMER0_INT |           \
-                                MACEISA_TIMER1_INT |           \
-                                MACEISA_TIMER2_INT)
+                                MACEIIRQF_TIMER0_INT |         \
+                                MACEIIRQF_TIMER1_INT |         \
+                                MACEIIRQF_TIMER2_INT)
 #define MACEISA_SUPERIO_INT    (MACEISA_PARALLEL_INT |         \
                                 MACEISA_PAR_CTXA_INT |         \
                                 MACEISA_PAR_CTXB_INT |         \
@@ -349,7 +349,7 @@ static void enable_maceisa_irq (unsigned int irq)
        case MACEISA_AUDIO_SW_IRQ ... MACEISA_AUDIO3_MERR_IRQ:
                crime_int = MACE_AUDIO_INT;
                break;
-       case MACEISA_RTC_IRQ ... MACEISA_TIMER2_IRQ:
+       case MACEISA_RTC_IRQ ... MACEIIRQF_TIMER2_IRQ:
                crime_int = MACE_MISC_INT;
                break;
        case MACEISA_PARALLEL_IRQ ... MACEISA_SERIAL2_RDMAOR_IRQ:
index acbdad06fac18f157c6c2fbc7b929d809bf071ad..240a2f981d08e4f125eb5ee1daf9134b3c5ba1fc 100644 (file)
@@ -8,7 +8,6 @@
  * Copyright (C) 2000 Harald Koerfgen
  * Copyright (C) 2002, 2003, 2005 Ilya A. Volynets
  */
-#include <linux/config.h>
 #include <linux/console.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
index 610df40cb82088241ed6fdcb52e98ed30cef455d..29d3bbb5847daf7061f7b2403fb152bafdc26173 100644 (file)
@@ -15,7 +15,6 @@
  * 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/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/linkage.h>
index d90a0b87874cb77bb7cc07fb1a1055adfa09c589..8236d0c48542cc7dbaedd672588e13f46e513283 100644 (file)
@@ -15,7 +15,6 @@
  * 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/config.h>
 #include <linux/kernel.h>
 #include <linux/reboot.h>
 #include <linux/string.h>
index efaf83efd2e4b271a8e09c71e2f6704c0d4b2258..7e088f6c4a8664dc9abc947d06c210fe3eb73629 100644 (file)
@@ -25,7 +25,6 @@
  * code to do general bookkeeping (e.g. update jiffies, run
  * bottom halves, etc.)
  */
-#include <linux/config.h>
 #include <linux/interrupt.h>
 #include <linux/sched.h>
 #include <linux/spinlock.h>
index 7721100d0275dd566c9aa67d1b5b1489beb00eed..c6ec748175b0eebfba871caefef83faa031f1e16 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/errno.h>
 #include <linux/console.h>
index ea308029450e581ef65978af5d58056f7f2af0f0..6e8952da6e2acf811541ea21873c83df229e9f4f 100644 (file)
@@ -16,7 +16,6 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/linkage.h>
index 482dee054e685d86bbd3652e6f7b4968939b9b77..bb90649fbc485b79ea3a04c17f6dc9a72d9f985e 100644 (file)
@@ -25,7 +25,6 @@
  * /proc/bus_watcher if PROC_FS is on.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
index fcc61940f1ff6444e8e03fed4cdf105a9cac555e..1d280aabcf6a74fcb90ae2f945fdd237ed8e40b4 100644 (file)
@@ -15,7 +15,6 @@
  * 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/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/linkage.h>
index 742043f8d755626f7f42afc3b5c5d864ac983f2c..3c33a4517bc3ac72aba110fe3766f3b116c5b373 100644 (file)
@@ -16,7 +16,6 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
index fde4751c84fe6335108eb4eda4fab5566f6d1834..d0ee1d5b822388bfaf32496da80d9b8238903fdf 100644 (file)
@@ -15,7 +15,6 @@
  * 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/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/reboot.h>
index 1588f6debd90698522d9c278bedbab47d6696808..4b669dc86ef4de85e2de49ea9a6b50e414c6510f 100644 (file)
@@ -25,7 +25,6 @@
  * code to do general bookkeeping (e.g. update jiffies, run
  * bottom halves, etc.)
  */
-#include <linux/config.h>
 #include <linux/interrupt.h>
 #include <linux/sched.h>
 #include <linux/spinlock.h>
index f9e694988cdf18733682531f0f304321a6cf3635..a9a6dbc068495aadb870275dcf0907a380cc3534 100644 (file)
@@ -21,7 +21,6 @@
  * Setup code for the SWARM board
  */
 
-#include <linux/config.h>
 #include <linux/spinlock.h>
 #include <linux/mm.h>
 #include <linux/bootmem.h>
index a050bb6ae7044939c7b129305f5ba8eb5a1dab07..870486d6cd75e3611ea73c02ed52bedc45df4ce8 100644 (file)
@@ -7,7 +7,6 @@
  *
  * Copyright (C) 1996, 97, 98, 2000, 03, 04, 06 Ralf Baechle (ralf@linux-mips.org)
  */
-#include <linux/config.h>
 #include <linux/eisa.h>
 #include <linux/hdreg.h>
 #include <linux/ioport.h>
index a42be00483e6d57f07bcdbe10b1267570939a974..ae9d5653a863e89a9d83f983e628bc0e873ca548 100644 (file)
@@ -23,7 +23,6 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/kernel_stat.h>
index 81a5acfe8c4279c8845c072b1ea724c7c8023385..64a1b394b2520f10ca649b3062fd54a507b94fae 100644 (file)
@@ -24,7 +24,6 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/kernel_stat.h>
index c67978b6dae494b5ec08f6b175f759be3c941faf..ec0a0de3083d0c2ed7e3f9e858de07e6d87ac4f2 100644 (file)
@@ -111,7 +111,6 @@ SuperIO/PS2/Mouse, using INTR via ISA IRQ12 (mouse not currently supported)
 JP7 is not bus master -- do NOT use -- only 4 pci bus master's allowed -- SouthBridge, JP4, JP5, JP6
 */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
@@ -338,7 +337,7 @@ int toshiba_rbtx4927_irq_nested(int sw_irq)
 }
 
 //#define TOSHIBA_RBTX4927_PIC_ACTION(s) { no_action, 0, CPU_MASK_NONE, s, NULL, NULL }
-#define TOSHIBA_RBTX4927_PIC_ACTION(s) { no_action, SA_SHIRQ, CPU_MASK_NONE, s, NULL, NULL }
+#define TOSHIBA_RBTX4927_PIC_ACTION(s) { no_action, IRQF_SHARED, CPU_MASK_NONE, s, NULL, NULL }
 static struct irqaction toshiba_rbtx4927_irq_ioc_action =
 TOSHIBA_RBTX4927_PIC_ACTION(TOSHIBA_RBTX4927_IOC_NAME);
 #ifdef CONFIG_TOSHIBA_FPCIB0
index 6dcf077f61a0af526d625d6b683cec7e1502aeae..f0d70c47600528a7e3c7601d9608d8955c817c24 100644 (file)
@@ -42,7 +42,6 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
index 7df8b32ba2656863c45c8c069292906e566841aa..e44daf30a7c1a84c0da46a0cb4bb083cddbc09a5 100644 (file)
@@ -12,7 +12,6 @@
  * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <linux/sched.h>
index 96e833cd4c14260e6ea40a77ebef990ceae6433d..66163ba452c809b31a25338271a1bbed15cd4f30 100644 (file)
@@ -11,7 +11,6 @@
  *
  * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/types.h>
 #include <linux/ioport.h>
index 951a208ee9b34effe43a823c4225a9ca595d987a..89596e62f9096cf5f9313c6d87e121bc58afaa5c 100644 (file)
@@ -9,7 +9,6 @@
  *
  * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/proc_fs.h>
index be590edb0b83944b2c8dd7d083a83ec9dc2b6da6..ae1af6b21c45f7f629988913b4c3ee4b484f1d92 100644 (file)
@@ -15,7 +15,6 @@
  * Support for NEC-CMBVR4133 in 2.6
  * Manish Lachwani (mlachwani@mvista.com)
  */
-#include <linux/config.h>
 
 #ifdef CONFIG_ROCKHOPPER
 #include <asm/io.h>
index 1f6b24ef869535fc455518e1d6db4e45cf605d26..f45caccedc07176d3348b8f8e5b62c1d3e1ccf79 100644 (file)
@@ -14,7 +14,6 @@
  * Support for NEC-CMBVR4133 in 2.6
  * Author: Manish Lachwani (mlachwani@mvista.com)
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/types.h>
 #include <linux/serial.h>
index 53272a5c3cbe06efc02fa8272674d27aa4420c43..b20b93b2b95eac16e729c992bddccc001fc05eac 100644 (file)
@@ -14,7 +14,6 @@
  * Support for CMBVR4133 board in 2.6
  * Author: Manish Lachwani (mlachwani@mvista.com)
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/ide.h>
 #include <linux/ioport.h>
index 630730c32a5a1e9d794f82ac5c9c7c15c3ab4831..95c1b8ec428966f4e42491ae89ebef6202819db0 100644 (file)
@@ -22,7 +22,6 @@
  *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <asm/asm-offsets.h>
 
 /* we have the following possibilities to act on an interruption:
index 82fe6ba29727a6824bd4a83e5fef44322239f08f..5b8803cc3d69498c1bc916cee4bfd4467d14b61f 100644 (file)
@@ -22,7 +22,6 @@
  *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 #include <linux/bitops.h>
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
@@ -367,14 +366,14 @@ void do_cpu_irq_mask(struct pt_regs *regs)
 static struct irqaction timer_action = {
        .handler = timer_interrupt,
        .name = "timer",
-       .flags = SA_INTERRUPT,
+       .flags = IRQF_DISABLED,
 };
 
 #ifdef CONFIG_SMP
 static struct irqaction ipi_action = {
        .handler = ipi_interrupt,
        .name = "IPI",
-       .flags = SA_INTERRUPT,
+       .flags = IRQF_DISABLED,
 };
 #endif
 
index f600556414d1a3afb0e7ae5d96f95832e3da5e1a..e81c9937d10a30a31917fc9c2a5311c51865f41e 100644 (file)
@@ -40,7 +40,6 @@
        .level  2.0
 #endif
 
-#include <linux/config.h>
 
 #include <asm/psw.h>
 #include <asm/assembly.h>
index fc107add627cce2608d2699c2e608e8f72205c67..6d57553d8ef886890dc358247f85adc7fdb52e2d 100644 (file)
@@ -24,7 +24,6 @@
  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/syscalls.h>
index 7d6967ee367c7f8ef5784281d0eb082af7a9a9b2..d3b8fc52dfc1e130a2c9a6e621116c62ed8a74f7 100644 (file)
@@ -9,7 +9,6 @@
  * Copyright (C) 1999-2001 Hewlett-Packard Company
  * Copyright (C) 1999-2001 Grant Grundler
  */
-#include <linux/config.h>
 #include <linux/eisa.h>
 #include <linux/init.h>
 #include <linux/module.h>
index 215d78c87bc515d2e5142de76430dbd9bc468b9f..ce78f412ff2ebff0bf95ea2a4d691903253fb179 100644 (file)
@@ -44,7 +44,6 @@
 #define EARLY_BOOTUP_DEBUG
 
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/console.h>
 #include <linux/string.h>
index adb3c64449102636616f95f7d091c1a499f738ef..5e7bb90e7e08e968e765179bcd9631e55b20cc78 100644 (file)
@@ -19,7 +19,6 @@
  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <linux/config.h>
 #include <asm/assembly.h>
 
 #ifdef CONFIG_64BIT
index 6df9f62cecb59cd94177331ca32914909ec70b5c..99d7fca9310475c51e89520b64cffa1e63fecf58 100644 (file)
@@ -26,7 +26,6 @@
  *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
  */
-#include <linux/config.h>
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/mm.h>
index 453d01a9f97149ce44ea848667c1b3661e072e6f..789061f6ceb4827b6b28c1c8fb4fa8355220d1bf 100644 (file)
@@ -7,7 +7,6 @@
  * Copyright (C) 2000 Hewlett Packard (Paul Bame bame@puffin.external.hp.com)
  *
  */
-#include <linux/config.h>
 
 #include <asm/psw.h>
 #include <asm/assembly.h>
index 278f4b9f6a3878806c7199c8dedec4e48d41d8be..3c7a3faf78edcc657443772e5fe785472df4ef8c 100644 (file)
@@ -27,7 +27,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/initrd.h>
 #include <linux/init.h>
index d6ac1c60a4713bf2f0266f99ca84c416016558e7..98e40959a564815df35e2d57272c3deb0e2d2d8c 100644 (file)
@@ -18,7 +18,6 @@
 */
 #undef ENTRY_SYS_CPUS  /* syscall support for iCOD-like functionality */
 
-#include <linux/config.h>
 
 #include <linux/types.h>
 #include <linux/spinlock.h>
index d286f68a3d3a6a6257dce190054b5db570e80fce..b74869803081900be006855604f941664a46d157 100644 (file)
@@ -9,7 +9,6 @@
  * environment. Based heavily on sys_ia32.c and sys_sparc32.c.
  */
 
-#include <linux/config.h>
 #include <linux/compat.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index eb35e1c0bb532b679b660351fc5e28db1e6ee8b8..5facc9bff4ef68b584aa32fb263b99461e90eb77 100644 (file)
@@ -10,7 +10,6 @@
  * 1998-12-20  Updated NTP code according to technical memorandum Jan '96
  *             "A Kernel Model for Precision Timekeeping" by Dave Mills
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/module.h>
 #include <linux/sched.h>
index 348344a84bf7615fa4a31cbf2cb81cc3ca378ff9..77b28cb8aca6f1cecab831f219308c787869e729 100644 (file)
@@ -10,7 +10,6 @@
  * state in 'asm.s'.
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
index 92328fbddb3e8becf3ffa346a02d7d9988624e38..bd2230d6a2a69645352eb4b1c8c71b7a4115b5a5 100644 (file)
@@ -20,7 +20,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <asm/uaccess.h>
index cc1c1afc31878cb2845677b64a21e58a497f99d3..920bdbf8404fa3c50768c7d628c4cb9d0cf174f1 100644 (file)
@@ -8,7 +8,6 @@
  * understand what is happening here
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/slab.h>
index 94dcc03a28edb024cfdf04c459a3485436d8290e..9989495a51dd64e8c026c88c20fec99fc9dc2ae0 100644 (file)
@@ -23,7 +23,6 @@
  *    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/config.h>
 #include <asm-generic/vmlinux.lds.h>
 /* needed for the processor specific cache alignment size */   
 #include <asm/cache.h>
index 90f400b10282276b12eb5fba16ea14c6c61ff449..f352666b5b2f401d096c8c53e876d5ac1c4188e6 100644 (file)
@@ -6,7 +6,6 @@
  * Copyright 2000 Grant Grundler (grundler@cup.hp.com)
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/spinlock.h>
 #include <asm/system.h>
index e0661c2978ed697fe8f916f4d732c57a74f92b45..ecce3d35401ff87c5f0e35103fd47e3f73799c6f 100644 (file)
@@ -19,7 +19,6 @@
  * 
  * Fixup routines for kernel exception handling.
  */
-#include <linux/config.h>
 #include <asm/asm-offsets.h>
 #include <asm/assembly.h>
 #include <asm/errno.h>
index b7098035321f76a530adbe070ff6fa8d3f891e8d..5575e41f9d605b0687d681934f14b763a9218061 100644 (file)
@@ -53,7 +53,6 @@
  */
 
 #ifdef __KERNEL__
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/compiler.h>
 #include <asm/uaccess.h>
index 6317125626569ec713b5471adf07fb9b50b260ad..f2b96f1e0da75f731e9ae628b1db605cb755cd43 100644 (file)
@@ -10,7 +10,6 @@
  *
  */
 
-#include <linux/config.h>
 
 #include <linux/module.h>
 #include <linux/mm.h>
@@ -28,6 +27,7 @@
 #include <asm/tlb.h>
 #include <asm/pdc_chassis.h>
 #include <asm/mmzone.h>
+#include <asm/sections.h>
 
 DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
 
@@ -418,11 +418,10 @@ void free_initmem(void)
 #ifdef CONFIG_DEBUG_RODATA
 void mark_rodata_ro(void)
 {
-       extern char __start_rodata, __end_rodata;
        /* rodata memory was already mapped with KERNEL_RO access rights by
            pagetable_init() and map_pages(). No need to do additional stuff here */
        printk (KERN_INFO "Write protecting the kernel read-only data: %luk\n",
-               (unsigned long)(&__end_rodata - &__start_rodata) >> 10);
+               (unsigned long)(__end_rodata - __start_rodata) >> 10);
 }
 #endif
 
diff --git a/arch/powerpc/configs/chrp32_defconfig b/arch/powerpc/configs/chrp32_defconfig
new file mode 100644 (file)
index 0000000..0fa010a
--- /dev/null
@@ -0,0 +1,1378 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.17
+# Mon Jul  3 12:08:41 2006
+#
+# CONFIG_PPC64 is not set
+CONFIG_PPC32=y
+CONFIG_PPC_MERGE=y
+CONFIG_MMU=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_PPC=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_PPC_OF=y
+CONFIG_PPC_UDBG_16550=y
+CONFIG_GENERIC_TBSYNC=y
+# CONFIG_DEFAULT_UIMAGE is not set
+
+#
+# Processor support
+#
+CONFIG_CLASSIC32=y
+# CONFIG_PPC_52xx is not set
+# CONFIG_PPC_82xx is not set
+# CONFIG_PPC_83xx is not set
+# CONFIG_PPC_85xx is not set
+# CONFIG_PPC_86xx is not set
+# CONFIG_40x is not set
+# CONFIG_44x is not set
+# CONFIG_8xx is not set
+# CONFIG_E200 is not set
+CONFIG_6xx=y
+CONFIG_PPC_FPU=y
+# CONFIG_ALTIVEC is not set
+CONFIG_PPC_STD_MMU=y
+CONFIG_PPC_STD_MMU_32=y
+CONFIG_SMP=y
+CONFIG_NR_CPUS=4
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_LOCK_KERNEL=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+# CONFIG_CPUSETS is not set
+# CONFIG_RELAY is not set
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+# CONFIG_EMBEDDED is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# 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_EPOLL=y
+CONFIG_SHMEM=y
+CONFIG_SLAB=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+CONFIG_STOP_MACHINE=y
+
+#
+# Block layer
+#
+CONFIG_LBD=y
+# 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=y
+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"
+
+#
+# Platform support
+#
+CONFIG_PPC_MULTIPLATFORM=y
+# CONFIG_PPC_ISERIES is not set
+# CONFIG_EMBEDDED6xx is not set
+# CONFIG_APUS is not set
+CONFIG_PPC_CHRP=y
+# CONFIG_PPC_PMAC is not set
+# CONFIG_PPC_CELL is not set
+# CONFIG_PPC_CELL_NATIVE is not set
+CONFIG_MPIC=y
+CONFIG_PPC_RTAS=y
+# CONFIG_RTAS_ERROR_LOGGING is not set
+CONFIG_RTAS_PROC=y
+# CONFIG_MMIO_NVRAM is not set
+CONFIG_PPC_MPC106=y
+# CONFIG_PPC_970_NAP is not set
+# CONFIG_CPU_FREQ is not set
+# CONFIG_TAU is not set
+# CONFIG_WANT_EARLY_SERIAL is not set
+
+#
+# Kernel options
+#
+CONFIG_HIGHMEM=y
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_PREEMPT_BKL=y
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=y
+# CONFIG_KEXEC is not set
+CONFIG_IRQ_ALL_CPUS=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+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_PROC_DEVICETREE=y
+# CONFIG_CMDLINE_BOOL is not set
+# CONFIG_PM is not set
+CONFIG_SECCOMP=y
+CONFIG_ISA_DMA_API=y
+
+#
+# Bus options
+#
+CONFIG_ISA=y
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_PPC_I8259=y
+CONFIG_PPC_INDIRECT_PCI=y
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+# CONFIG_PCIEPORTBUS is not set
+# CONFIG_PCI_DEBUG is not set
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# PCI Hotplug Support
+#
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Advanced setup
+#
+# CONFIG_ADVANCED_OPTIONS is not set
+
+#
+# Default settings for advanced configuration options are used
+#
+CONFIG_HIGHMEM_START=0xfe000000
+CONFIG_LOWMEM_SIZE=0x30000000
+CONFIG_KERNEL_START=0xc0000000
+CONFIG_TASK_SIZE=0x80000000
+CONFIG_BOOT_LOAD=0x00800000
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+# CONFIG_NETDEBUG is not set
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+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_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE 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 is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_BIC=y
+
+#
+# IP: Virtual Server Configuration
+#
+# CONFIG_IP_VS 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=y
+# CONFIG_NETFILTER_DEBUG is not set
+
+#
+# Core Netfilter Configuration
+#
+# CONFIG_NETFILTER_NETLINK is not set
+# CONFIG_NETFILTER_XTABLES is not set
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_IP_NF_CONNTRACK=m
+# CONFIG_IP_NF_CT_ACCT is not set
+# CONFIG_IP_NF_CONNTRACK_MARK is not set
+# CONFIG_IP_NF_CONNTRACK_EVENTS is not set
+# CONFIG_IP_NF_CT_PROTO_SCTP is not set
+CONFIG_IP_NF_FTP=m
+CONFIG_IP_NF_IRC=m
+# CONFIG_IP_NF_NETBIOS_NS is not set
+CONFIG_IP_NF_TFTP=m
+CONFIG_IP_NF_AMANDA=m
+# CONFIG_IP_NF_PPTP is not set
+# CONFIG_IP_NF_H323 is not set
+# CONFIG_IP_NF_SIP is not set
+# CONFIG_IP_NF_QUEUE is not set
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_DCCP is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+# 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_NET_DIVERT 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 is not set
+# CONFIG_BT is not set
+# CONFIG_IEEE80211 is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+# CONFIG_STANDALONE is not set
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_FW_LOADER is not set
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_SYS_HYPERVISOR is not set
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+# CONFIG_CONNECTOR is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Plug and Play support
+#
+# CONFIG_PNP is not set
+
+#
+# Block devices
+#
+CONFIG_BLK_DEV_FD=y
+# CONFIG_BLK_DEV_XD is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_SX8 is not set
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+CONFIG_IDE=y
+CONFIG_BLK_DEV_IDE=y
+
+#
+# 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=y
+CONFIG_BLK_DEV_IDECD=y
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDEFLOPPY is not set
+# CONFIG_BLK_DEV_IDESCSI is not set
+# CONFIG_IDE_TASK_IOCTL is not set
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=y
+CONFIG_BLK_DEV_IDEPCI=y
+CONFIG_IDEPCI_SHARE_IRQ=y
+# CONFIG_BLK_DEV_OFFBOARD is not set
+CONFIG_BLK_DEV_GENERIC=y
+# CONFIG_BLK_DEV_OPTI621 is not set
+CONFIG_BLK_DEV_SL82C105=y
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+CONFIG_IDEDMA_PCI_AUTO=y
+# 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
+# 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_SC1200 is not set
+# CONFIG_BLK_DEV_PIIX 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_SLC90E66 is not set
+# CONFIG_BLK_DEV_TRM290 is not set
+CONFIG_BLK_DEV_VIA82CXXX=y
+# CONFIG_IDE_ARM is not set
+# CONFIG_IDE_CHIPSETS is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+CONFIG_IDEDMA_AUTO=y
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+CONFIG_CHR_DEV_ST=y
+# CONFIG_CHR_DEV_OSST is not set
+CONFIG_BLK_DEV_SR=y
+CONFIG_BLK_DEV_SR_VENDOR=y
+CONFIG_CHR_DEV_SG=y
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+CONFIG_SCSI_CONSTANTS=y
+# CONFIG_SCSI_LOGGING is not set
+
+#
+# SCSI Transport Attributes
+#
+CONFIG_SCSI_SPI_ATTRS=y
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_ATTRS is not set
+
+#
+# SCSI low-level drivers
+#
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_3W_9XXX is not set
+# CONFIG_SCSI_7000FASST is not set
+# CONFIG_SCSI_ACARD is not set
+# CONFIG_SCSI_AHA152X is not set
+# CONFIG_SCSI_AHA1542 is not set
+# CONFIG_SCSI_AACRAID is not set
+# CONFIG_SCSI_AIC7XXX is not set
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_AIC79XX is not set
+# CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_SCSI_IN2000 is not set
+# CONFIG_MEGARAID_NEWGEN is not set
+# CONFIG_MEGARAID_LEGACY is not set
+# CONFIG_MEGARAID_SAS is not set
+# CONFIG_SCSI_SATA is not set
+# CONFIG_SCSI_HPTIOP is not set
+# CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_DTC3280 is not set
+# CONFIG_SCSI_EATA is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_GDTH is not set
+# CONFIG_SCSI_GENERIC_NCR5380 is not set
+# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
+# CONFIG_SCSI_IPS is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_NCR53C406A is not set
+CONFIG_SCSI_SYM53C8XX_2=y
+CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
+CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
+CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
+CONFIG_SCSI_SYM53C8XX_MMIO=y
+# CONFIG_SCSI_IPR is not set
+# CONFIG_SCSI_PAS16 is not set
+# CONFIG_SCSI_PSI240I is not set
+# CONFIG_SCSI_QLOGIC_FAS is not set
+# CONFIG_SCSI_QLOGIC_1280 is not set
+# CONFIG_SCSI_QLA_FC is not set
+# CONFIG_SCSI_LPFC is not set
+# CONFIG_SCSI_SYM53C416 is not set
+# CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_SCSI_T128 is not set
+# CONFIG_SCSI_U14_34F is not set
+# CONFIG_SCSI_NSP32 is not set
+# CONFIG_SCSI_DEBUG is not set
+
+#
+# Old CD-ROM drivers (not SCSI, not IDE)
+#
+# CONFIG_CD_NO_IDESCSI is not set
+
+#
+# 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_IEEE1394 is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+
+#
+# Macintosh device drivers
+#
+# CONFIG_WINDFARM 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
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# PHY device support
+#
+# CONFIG_PHYLIB is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_LANCE is not set
+# CONFIG_NET_VENDOR_SMC is not set
+# CONFIG_NET_VENDOR_RACAL is not set
+
+#
+# Tulip family network device support
+#
+CONFIG_NET_TULIP=y
+# CONFIG_DE2104X is not set
+# CONFIG_TULIP is not set
+CONFIG_DE4X5=y
+# CONFIG_WINBOND_840 is not set
+# CONFIG_DM9102 is not set
+# CONFIG_ULI526X is not set
+# CONFIG_AT1700 is not set
+# CONFIG_DEPCA is not set
+# CONFIG_HP100 is not set
+# CONFIG_NET_ISA is not set
+CONFIG_NET_PCI=y
+CONFIG_PCNET32=y
+# CONFIG_AMD8111_ETH is not set
+# CONFIG_ADAPTEC_STARFIRE is not set
+# CONFIG_AC3200 is not set
+# CONFIG_APRICOT is not set
+# CONFIG_B44 is not set
+# CONFIG_FORCEDETH is not set
+# CONFIG_CS89x0 is not set
+# CONFIG_DGRS is not set
+# CONFIG_EEPRO100 is not set
+# CONFIG_E100 is not set
+# CONFIG_FEALNX is not set
+# CONFIG_NATSEMI is not set
+# CONFIG_NE2K_PCI is not set
+CONFIG_8139CP=y
+CONFIG_8139TOO=y
+# CONFIG_8139TOO_PIO is not set
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+# CONFIG_8139TOO_8129 is not set
+# CONFIG_8139_OLD_RX_RESET is not set
+# CONFIG_SIS900 is not set
+# CONFIG_EPIC100 is not set
+# CONFIG_SUNDANCE is not set
+# CONFIG_TLAN is not set
+CONFIG_VIA_RHINE=y
+# CONFIG_VIA_RHINE_MMIO is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# 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 is not set
+# CONFIG_BNX2 is not set
+CONFIG_MV643XX_ETH=y
+# CONFIG_MV643XX_ETH_0 is not set
+# CONFIG_MV643XX_ETH_1 is not set
+# CONFIG_MV643XX_ETH_2 is not set
+
+#
+# Ethernet (10000 Mbit)
+#
+# CONFIG_CHELSIO_T1 is not set
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+# CONFIG_MYRI10GE is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_MPPE=m
+CONFIG_PPPOE=m
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC 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
+
+#
+# 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=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# 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_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_INPORT is not set
+# CONFIG_MOUSE_LOGIBM is not set
+# CONFIG_MOUSE_PC110PAD is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+CONFIG_INPUT_MISC=y
+# CONFIG_INPUT_PCSPKR is not set
+CONFIG_INPUT_UINPUT=y
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_PCIPS2 is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_PCI=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_HVC_RTAS is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+CONFIG_NVRAM=y
+CONFIG_GEN_RTC=y
+# CONFIG_GEN_RTC_X is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+
+#
+# I2C support
+#
+CONFIG_I2C=y
+# CONFIG_I2C_CHARDEV is not set
+
+#
+# I2C Algorithms
+#
+CONFIG_I2C_ALGOBIT=y
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+
+#
+# I2C Hardware Bus support
+#
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
+# CONFIG_I2C_ALI15X3 is not set
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_HYDRA is not set
+# CONFIG_I2C_I801 is not set
+# CONFIG_I2C_I810 is not set
+# CONFIG_I2C_PIIX4 is not set
+# CONFIG_I2C_MPC is not set
+# CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_SAVAGE4 is not set
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_I2C_SIS630 is not set
+# CONFIG_I2C_SIS96X is not set
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_VIA is not set
+# CONFIG_I2C_VIAPRO is not set
+# CONFIG_I2C_VOODOO3 is not set
+# CONFIG_I2C_PCA_ISA is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_SENSORS_DS1337 is not set
+# CONFIG_SENSORS_DS1374 is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_SENSORS_M41T00 is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+
+#
+# Dallas's 1-wire bus
+#
+
+#
+# Hardware Monitoring support
+#
+# CONFIG_HWMON is not set
+# CONFIG_HWMON_VID is not set
+
+#
+# Misc devices
+#
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+CONFIG_VIDEO_V4L2=y
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+# CONFIG_USB_DABUSB is not set
+
+#
+# Graphics support
+#
+CONFIG_FB=y
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+CONFIG_FB_MACMODES=y
+CONFIG_FB_FIRMWARE_EDID=y
+# CONFIG_FB_BACKLIGHT is not set
+CONFIG_FB_MODE_HELPERS=y
+CONFIG_FB_TILEBLITTING=y
+# CONFIG_FB_CIRRUS is not set
+# CONFIG_FB_PM2 is not set
+# CONFIG_FB_CYBER2000 is not set
+CONFIG_FB_OF=y
+# CONFIG_FB_CT65550 is not set
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
+# CONFIG_FB_VGA16 is not set
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_NVIDIA is not set
+# CONFIG_FB_RIVA is not set
+CONFIG_FB_MATROX=y
+CONFIG_FB_MATROX_MILLENIUM=y
+CONFIG_FB_MATROX_MYSTIQUE=y
+CONFIG_FB_MATROX_G=y
+# CONFIG_FB_MATROX_I2C is not set
+# CONFIG_FB_MATROX_MULTIHEAD is not set
+CONFIG_FB_RADEON=y
+CONFIG_FB_RADEON_I2C=y
+# CONFIG_FB_RADEON_DEBUG is not set
+# CONFIG_FB_ATY128 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_SAVAGE is not set
+# CONFIG_FB_SIS is not set
+# CONFIG_FB_NEOMAGIC is not set
+# CONFIG_FB_KYRO is not set
+CONFIG_FB_3DFX=y
+# CONFIG_FB_3DFX_ACCEL is not set
+# CONFIG_FB_VOODOO1 is not set
+# CONFIG_FB_TRIDENT is not set
+# CONFIG_FB_VIRTUAL is not set
+
+#
+# Console display driver support
+#
+CONFIG_VGA_CONSOLE=y
+# CONFIG_VGACON_SOFT_SCROLLBACK is not set
+# CONFIG_MDA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+
+#
+# Logo configuration
+#
+CONFIG_LOGO=y
+CONFIG_LOGO_LINUX_MONO=y
+CONFIG_LOGO_LINUX_VGA16=y
+CONFIG_LOGO_LINUX_CLUT224=y
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_BANDWIDTH is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_EHCI_HCD=m
+# CONFIG_USB_EHCI_SPLIT_ISO is not set
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+# CONFIG_USB_EHCI_TT_NEWSCHED is not set
+# CONFIG_USB_ISP116X_HCD is not set
+CONFIG_USB_OHCI_HCD=y
+# CONFIG_USB_OHCI_BIG_ENDIAN is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_USB_UHCI_HCD=y
+# CONFIG_USB_SL811_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=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 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_ONETOUCH is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=y
+CONFIG_USB_HIDINPUT=y
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
+# CONFIG_HID_FF is not set
+# CONFIG_USB_HIDDEV is not set
+# CONFIG_USB_AIPTEK is not set
+# CONFIG_USB_WACOM is not set
+# CONFIG_USB_ACECAD is not set
+# CONFIG_USB_KBTAB is not set
+# CONFIG_USB_POWERMATE is not set
+# CONFIG_USB_TOUCHSCREEN is not set
+# CONFIG_USB_YEALINK is not set
+# CONFIG_USB_XPAD is not set
+# CONFIG_USB_ATI_REMOTE is not set
+# CONFIG_USB_ATI_REMOTE2 is not set
+# CONFIG_USB_KEYSPAN_REMOTE is not set
+# CONFIG_USB_APPLETOUCH is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET 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_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGETKIT is not set
+# CONFIG_USB_PHIDGETSERVO is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_SISUSBVGA is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TEST is not set
+
+#
+# USB DSL modem support
+#
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# MMC/SD Card support
+#
+# 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_CLASS is not set
+
+#
+# DMA Engine support
+#
+# CONFIG_DMA_ENGINE is not set
+
+#
+# DMA Clients
+#
+
+#
+# DMA Devices
+#
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP 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_JBD=y
+# CONFIG_JBD_DEBUG 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_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=y
+# CONFIG_JOLIET is not set
+# CONFIG_ZISOFS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+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 is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# 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_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 is not set
+# CONFIG_NFSD 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=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=y
+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
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+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=y
+CONFIG_NLS_ISO8859_1=m
+# 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
+
+#
+# Library routines
+#
+CONFIG_CRC_CCITT=m
+# CONFIG_CRC16 is not set
+CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=m
+CONFIG_ZLIB_DEFLATE=m
+CONFIG_TEXTSEARCH=y
+CONFIG_TEXTSEARCH_KMP=m
+
+#
+# Instrumentation Support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_KERNEL=y
+CONFIG_LOG_BUF_SHIFT=15
+CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_DEBUG_SLAB is not set
+CONFIG_DEBUG_MUTEXES=y
+# CONFIG_DEBUG_SPINLOCK is not set
+CONFIG_DEBUG_SPINLOCK_SLEEP=y
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_HIGHMEM is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_DEBUG_VM is not set
+CONFIG_FORCED_INLINING=y
+# CONFIG_RCU_TORTURE_TEST is not set
+CONFIG_DEBUGGER=y
+CONFIG_XMON=y
+CONFIG_XMON_DEFAULT=y
+# CONFIG_BDI_SWITCH is not set
+# CONFIG_BOOTX_TEXT is not set
+# CONFIG_PPC_EARLY_DEBUG is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+
+#
+# Cryptographic options
+#
+CONFIG_CRYPTO=y
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_MD4 is not set
+# CONFIG_CRYPTO_MD5 is not set
+CONFIG_CRYPTO_SHA1=m
+# 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_DES 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=m
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Hardware crypto devices
+#
diff --git a/arch/powerpc/configs/mpc834x_itx_defconfig b/arch/powerpc/configs/mpc834x_itx_defconfig
new file mode 100644 (file)
index 0000000..fc2d978
--- /dev/null
@@ -0,0 +1,1336 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.17
+# Fri Jun 30 17:53:25 2006
+#
+# CONFIG_PPC64 is not set
+CONFIG_PPC32=y
+CONFIG_PPC_MERGE=y
+CONFIG_MMU=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_IRQ_PER_CPU=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_PPC=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_PPC_OF=y
+CONFIG_PPC_UDBG_16550=y
+# CONFIG_GENERIC_TBSYNC is not set
+CONFIG_DEFAULT_UIMAGE=y
+
+#
+# Processor support
+#
+# CONFIG_CLASSIC32 is not set
+# CONFIG_PPC_52xx is not set
+# CONFIG_PPC_82xx is not set
+CONFIG_PPC_83xx=y
+# CONFIG_PPC_85xx is not set
+# CONFIG_PPC_86xx is not set
+# CONFIG_40x is not set
+# CONFIG_44x is not set
+# CONFIG_8xx is not set
+# CONFIG_E200 is not set
+CONFIG_6xx=y
+CONFIG_83xx=y
+CONFIG_PPC_FPU=y
+CONFIG_PPC_STD_MMU=y
+CONFIG_PPC_STD_MMU_32=y
+# CONFIG_SMP is not set
+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_SWAP=y
+CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+# CONFIG_RELAY is not set
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_EMBEDDED=y
+# CONFIG_KALLSYMS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_RT_MUTEXES=y
+CONFIG_FUTEX=y
+# CONFIG_EPOLL is not set
+CONFIG_SHMEM=y
+CONFIG_SLAB=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+
+#
+# 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 is not set
+
+#
+# Block layer
+#
+# 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=y
+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_PPC_GEN550=y
+# CONFIG_WANT_EARLY_SERIAL is not set
+
+#
+# Platform support
+#
+# CONFIG_MPC834x_SYS is not set
+CONFIG_MPC834x_ITX=y
+CONFIG_MPC834x=y
+
+#
+# Kernel options
+#
+# CONFIG_HIGHMEM is not set
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+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_PROC_DEVICETREE=y
+# CONFIG_CMDLINE_BOOL is not set
+# CONFIG_PM is not set
+# CONFIG_SOFTWARE_SUSPEND is not set
+CONFIG_SECCOMP=y
+CONFIG_ISA_DMA_API=y
+
+#
+# Bus options
+#
+CONFIG_GENERIC_ISA_DMA=y
+# CONFIG_PPC_I8259 is not set
+CONFIG_PPC_INDIRECT_PCI=y
+CONFIG_FSL_SOC=y
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+# CONFIG_PCIEPORTBUS is not set
+# CONFIG_PCI_DEBUG is not set
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# PCI Hotplug Support
+#
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Advanced setup
+#
+# CONFIG_ADVANCED_OPTIONS is not set
+
+#
+# Default settings for advanced configuration options are used
+#
+CONFIG_HIGHMEM_START=0xfe000000
+CONFIG_LOWMEM_SIZE=0x30000000
+CONFIG_KERNEL_START=0xc0000000
+CONFIG_TASK_SIZE=0x80000000
+CONFIG_BOOT_LOAD=0x00800000
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+# CONFIG_NETDEBUG is not set
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+# CONFIG_XFRM_USER is not set
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# 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 is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE 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_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_BIC=y
+# 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
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_DCCP is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+# 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_NET_DIVERT 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 is not set
+# CONFIG_BT is not set
+# CONFIG_IEEE80211 is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_FW_LOADER is not set
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_SYS_HYPERVISOR is not set
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+# CONFIG_CONNECTOR is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_CONCAT is not set
+# CONFIG_MTD_PARTITIONS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+# CONFIG_MTD_BLOCK is not set
+# CONFIG_MTD_BLOCK_RO is not set
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_GEN_PROBE=y
+# CONFIG_MTD_CFI_ADV_OPTIONS 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_CFI_INTELEXT is not set
+CONFIG_MTD_CFI_AMDSTD=y
+# CONFIG_MTD_CFI_STAA is not set
+CONFIG_MTD_CFI_UTIL=y
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+# CONFIG_MTD_OBSOLETE_CHIPS is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_PHYSMAP_START=0xfe000000
+CONFIG_MTD_PHYSMAP_LEN=0x1000000
+CONFIG_MTD_PHYSMAP_BANKWIDTH=2
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_PMC551 is not set
+# CONFIG_MTD_DATAFLASH is not set
+# CONFIG_MTD_M25P80 is not set
+# 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
+
+#
+# NAND Flash Device Drivers
+#
+# CONFIG_MTD_NAND is not set
+
+#
+# OneNAND Flash Device Drivers
+#
+# CONFIG_MTD_ONENAND is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Plug and Play support
+#
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_SX8 is not set
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=32768
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+CONFIG_IDE=y
+# CONFIG_BLK_DEV_IDE is not set
+# CONFIG_BLK_DEV_HD_ONLY is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+CONFIG_CHR_DEV_SG=y
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+
+#
+# SCSI Transport Attributes
+#
+CONFIG_SCSI_SPI_ATTRS=y
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_ATTRS is not set
+
+#
+# SCSI low-level drivers
+#
+# 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
+# CONFIG_SCSI_AACRAID is not set
+# CONFIG_SCSI_AIC7XXX is not set
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_AIC79XX is not set
+# CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_MEGARAID_NEWGEN is not set
+# CONFIG_MEGARAID_LEGACY is not set
+# CONFIG_MEGARAID_SAS is not set
+CONFIG_SCSI_SATA=y
+# CONFIG_SCSI_SATA_AHCI is not set
+# CONFIG_SCSI_SATA_SVW is not set
+# CONFIG_SCSI_ATA_PIIX is not set
+# CONFIG_SCSI_SATA_MV is not set
+# CONFIG_SCSI_SATA_NV is not set
+# CONFIG_SCSI_PDC_ADMA is not set
+# CONFIG_SCSI_HPTIOP is not set
+# CONFIG_SCSI_SATA_QSTOR is not set
+# CONFIG_SCSI_SATA_PROMISE is not set
+# CONFIG_SCSI_SATA_SX4 is not set
+CONFIG_SCSI_SATA_SIL=y
+# CONFIG_SCSI_SATA_SIL24 is not set
+# CONFIG_SCSI_SATA_SIS is not set
+# CONFIG_SCSI_SATA_ULI is not set
+# CONFIG_SCSI_SATA_VIA is not set
+# CONFIG_SCSI_SATA_VITESSE is not set
+# CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_EATA is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_GDTH is not set
+# CONFIG_SCSI_IPS is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_SYM53C8XX_2 is not set
+# CONFIG_SCSI_IPR is not set
+# CONFIG_SCSI_QLOGIC_1280 is not set
+# CONFIG_SCSI_QLA_FC is not set
+# CONFIG_SCSI_LPFC is not set
+# CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_SCSI_NSP32 is not set
+# CONFIG_SCSI_DEBUG is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=y
+CONFIG_MD_LINEAR=y
+CONFIG_MD_RAID0=y
+CONFIG_MD_RAID1=y
+# CONFIG_MD_RAID10 is not set
+# CONFIG_MD_RAID456 is not set
+# CONFIG_MD_MULTIPATH is not set
+# CONFIG_MD_FAULTY is not set
+# CONFIG_BLK_DEV_DM 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_IEEE1394 is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+
+#
+# Macintosh device drivers
+#
+# CONFIG_WINDFARM 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
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# PHY device support
+#
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+CONFIG_CICADA_PHY=y
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_SMSC_PHY is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
+
+#
+# Tulip family network device support
+#
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 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=y
+# CONFIG_FEALNX is not set
+# CONFIG_NATSEMI is not set
+# CONFIG_NE2K_PCI is not set
+# CONFIG_8139CP is not set
+# CONFIG_8139TOO is not set
+# CONFIG_SIS900 is not set
+# CONFIG_EPIC100 is not set
+# CONFIG_SUNDANCE is not set
+# CONFIG_TLAN is not set
+# CONFIG_VIA_RHINE is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# 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 is not set
+# CONFIG_BNX2 is not set
+CONFIG_GIANFAR=y
+CONFIG_GFAR_NAPI=y
+
+#
+# Ethernet (10000 Mbit)
+#
+# CONFIG_CHELSIO_T1 is not set
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+# CONFIG_MYRI10GE is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC 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
+
+#
+# Userland interfaces
+#
+# 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
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK 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 is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_PCI=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_83xx_WDT=y
+
+#
+# PCI-based Watchdog Cards
+#
+# CONFIG_PCIPCWATCHDOG is not set
+# CONFIG_WDTPCI is not set
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+CONFIG_HW_RANDOM=y
+# CONFIG_NVRAM is not set
+# CONFIG_GEN_RTC is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+
+#
+# I2C support
+#
+CONFIG_I2C=y
+CONFIG_I2C_CHARDEV=y
+
+#
+# I2C Algorithms
+#
+# CONFIG_I2C_ALGOBIT is not set
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+
+#
+# I2C Hardware Bus support
+#
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
+# CONFIG_I2C_ALI15X3 is not set
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_I801 is not set
+# CONFIG_I2C_I810 is not set
+# CONFIG_I2C_PIIX4 is not set
+CONFIG_I2C_MPC=y
+# CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_SAVAGE4 is not set
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_I2C_SIS630 is not set
+# CONFIG_I2C_SIS96X is not set
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_VIA is not set
+# CONFIG_I2C_VIAPRO is not set
+# CONFIG_I2C_VOODOO3 is not set
+# CONFIG_I2C_PCA_ISA is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_SENSORS_DS1337 is not set
+# CONFIG_SENSORS_DS1374 is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_SENSORS_M41T00 is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+CONFIG_SPI=y
+# CONFIG_SPI_DEBUG is not set
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_BITBANG=y
+CONFIG_SPI_MPC83xx=y
+
+#
+# SPI Protocol Masters
+#
+
+#
+# Dallas's 1-wire bus
+#
+
+#
+# Hardware Monitoring support
+#
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_ABITUGURU is not set
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_ADM1026 is not set
+# CONFIG_SENSORS_ADM1031 is not set
+# CONFIG_SENSORS_ADM9240 is not set
+# CONFIG_SENSORS_ASB100 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_GL518SM is not set
+# 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
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM87 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_LM92 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_SIS5595 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47M192 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_VIA686A is not set
+# CONFIG_SENSORS_VT8231 is not set
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83791D is not set
+# CONFIG_SENSORS_W83792D is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
+# Misc devices
+#
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+CONFIG_VIDEO_V4L2=y
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+# CONFIG_USB_DABUSB is not set
+
+#
+# Graphics support
+#
+CONFIG_FIRMWARE_EDID=y
+# CONFIG_FB is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_BANDWIDTH is not set
+# 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 is not set
+# CONFIG_USB_EHCI_TT_NEWSCHED is not set
+# CONFIG_USB_ISP116X_HCD is not set
+CONFIG_USB_OHCI_HCD=y
+# CONFIG_USB_OHCI_BIG_ENDIAN is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_USB_UHCI_HCD=y
+# CONFIG_USB_SL811_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_LIBUSUAL is not set
+
+#
+# USB Input Devices
+#
+# CONFIG_USB_HID is not set
+
+#
+# USB HID Boot Protocol drivers
+#
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+# CONFIG_USB_AIPTEK is not set
+# CONFIG_USB_WACOM is not set
+# CONFIG_USB_ACECAD is not set
+# CONFIG_USB_KBTAB is not set
+# CONFIG_USB_POWERMATE is not set
+# CONFIG_USB_TOUCHSCREEN is not set
+# CONFIG_USB_YEALINK is not set
+# CONFIG_USB_XPAD is not set
+# CONFIG_USB_ATI_REMOTE is not set
+# CONFIG_USB_ATI_REMOTE2 is not set
+# CONFIG_USB_KEYSPAN_REMOTE is not set
+# CONFIG_USB_APPLETOUCH is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET 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_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGETKIT is not set
+# CONFIG_USB_PHIDGETSERVO is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_SISUSBVGA is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TEST is not set
+
+#
+# USB DSL modem support
+#
+
+#
+# USB Gadget Support
+#
+CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_SELECTED=y
+CONFIG_USB_GADGET_NET2280=y
+CONFIG_USB_NET2280=y
+# CONFIG_USB_GADGET_PXA2XX is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_AT91 is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+# CONFIG_USB_ZERO is not set
+CONFIG_USB_ETH=y
+CONFIG_USB_ETH_RNDIS=y
+# CONFIG_USB_GADGETFS is not set
+# CONFIG_USB_FILE_STORAGE is not set
+# CONFIG_USB_G_SERIAL is not set
+
+#
+# MMC/SD Card support
+#
+# 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
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+CONFIG_RTC_INTF_DEV_UIE_EMUL=y
+
+#
+# RTC drivers
+#
+# CONFIG_RTC_DRV_X1205 is not set
+CONFIG_RTC_DRV_DS1307=y
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_PCF8563 is not set
+# CONFIG_RTC_DRV_PCF8583 is not set
+# CONFIG_RTC_DRV_RS5C348 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_TEST is not set
+# CONFIG_RTC_DRV_MAX6902 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# DMA Engine support
+#
+CONFIG_DMA_ENGINE=y
+
+#
+# DMA Clients
+#
+CONFIG_NET_DMA=y
+
+#
+# DMA Devices
+#
+CONFIG_INTEL_IOATDMA=y
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP 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_JBD=y
+# CONFIG_JBD_DEBUG 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_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_KCORE=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# 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_JFFS_FS is not set
+# CONFIG_JFFS2_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
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+CONFIG_NFS_V4=y
+# CONFIG_NFS_DIRECTIO is not set
+# CONFIG_NFSD is not set
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_CIFS_DEBUG2 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=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 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
+
+#
+# Native Language Support
+#
+# CONFIG_NLS is not set
+
+#
+# Library routines
+#
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
+CONFIG_PLIST=y
+
+#
+# Instrumentation Support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+CONFIG_PRINTK_TIME=y
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+CONFIG_DEBUG_KERNEL=y
+CONFIG_LOG_BUF_SHIFT=17
+CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_KOBJECT is not set
+CONFIG_DEBUG_INFO=y
+# CONFIG_DEBUG_FS is not set
+# CONFIG_DEBUG_VM is not set
+CONFIG_FORCED_INLINING=y
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_DEBUGGER is not set
+# CONFIG_BDI_SWITCH is not set
+CONFIG_BOOTX_TEXT=y
+CONFIG_SERIAL_TEXT_DEBUG=y
+# CONFIG_PPC_EARLY_DEBUG is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+
+#
+# Cryptographic options
+#
+CONFIG_CRYPTO=y
+# CONFIG_CRYPTO_HMAC 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_DES=y
+# 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_DEFLATE is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Hardware crypto devices
+#
index ff2940548929b9084473052107140e569d737ad5..7ee84968087b3db9323045b67278423064da6b32 100644 (file)
@@ -13,7 +13,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index 8ad6b0f33651406bc9bf0500190bad8099a3d525..5cb58757e1b1badcf32744c28a62abc87542941e 100644 (file)
@@ -19,7 +19,6 @@
 
 #include <asm/processor.h>
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/elfcore.h>
 #include <linux/compat.h>
 
index 6223d39177cb7c7bd9ee408be588e9cfa3d06014..f4e5e14ee2b6bc806ce42a7ffcaf535b2bc9ab6c 100644 (file)
@@ -3,7 +3,6 @@
  *
  * Benjamin Herrenschmidt <benh@kernel.crashing.org>
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/init.h>
@@ -112,7 +111,7 @@ void __init btext_setup_display(int width, int height, int depth, int pitch,
        logicalDisplayBase = (unsigned char *)address;
        dispDeviceBase = (unsigned char *)address;
        dispDeviceRowBytes = pitch;
-       dispDeviceDepth = depth;
+       dispDeviceDepth = depth == 15 ? 16 : depth;
        dispDeviceRect[0] = dispDeviceRect[1] = 0;
        dispDeviceRect[2] = width;
        dispDeviceRect[3] = height;
@@ -161,20 +160,28 @@ int btext_initialize(struct device_node *np)
        unsigned long address = 0;
        u32 *prop;
 
-       prop = (u32 *)get_property(np, "width", NULL);
+       prop = (u32 *)get_property(np, "linux,bootx-width", NULL);
+       if (prop == NULL)
+               prop = (u32 *)get_property(np, "width", NULL);
        if (prop == NULL)
                return -EINVAL;
        width = *prop;
-       prop = (u32 *)get_property(np, "height", NULL);
+       prop = (u32 *)get_property(np, "linux,bootx-height", NULL);
+       if (prop == NULL)
+               prop = (u32 *)get_property(np, "height", NULL);
        if (prop == NULL)
                return -EINVAL;
        height = *prop;
-       prop = (u32 *)get_property(np, "depth", NULL);
+       prop = (u32 *)get_property(np, "linux,bootx-depth", NULL);
+       if (prop == NULL)
+               prop = (u32 *)get_property(np, "depth", NULL);
        if (prop == NULL)
                return -EINVAL;
        depth = *prop;
        pitch = width * ((depth + 7) / 8);
-       prop = (u32 *)get_property(np, "linebytes", NULL);
+       prop = (u32 *)get_property(np, "linux,bootx-linebytes", NULL);
+       if (prop == NULL)
+               prop = (u32 *)get_property(np, "linebytes", NULL);
        if (prop)
                pitch = *prop;
        if (pitch == 1)
@@ -195,7 +202,7 @@ int btext_initialize(struct device_node *np)
        g_max_loc_Y = height / 16;
        dispDeviceBase = (unsigned char *)address;
        dispDeviceRowBytes = pitch;
-       dispDeviceDepth = depth;
+       dispDeviceDepth = depth == 15 ? 16 : depth;
        dispDeviceRect[0] = dispDeviceRect[1] = 0;
        dispDeviceRect[2] = width;
        dispDeviceRect[3] = height;
index 365381fcb27c378db1ad9c219624a09518572b2a..8b4a4ee85eca24b8b229bf1c46b42c26bba82e6d 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/cputable.h>
index 1fc8632610030c7da76bd33933ecfda1b5373c35..f69af2c5d7b30faaead1c3f9473e6c8b91182674 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/cputable.h>
index abf7d42a8b07f6bee788f8ced65656188ef59aae..272e43622fd634218e89ca6ed0838a2d3d92055c 100644 (file)
@@ -10,7 +10,6 @@
  *  2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/sched.h>
 #include <linux/threads.h>
index 8866fd26c6b97048dfb3c8142c95dcf4c43c3bcc..c03e829fee3c17a2f3d29cc2fe51e93167fbc3b9 100644 (file)
@@ -19,7 +19,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sys.h>
 #include <linux/threads.h>
index 221062c960c99ae23578e8942ee668e9214d27f0..54d9f5cdaab49eb7c1943aadbb026ba680bf6bf9 100644 (file)
@@ -18,7 +18,6 @@
  *  2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <asm/unistd.h>
 #include <asm/processor.h>
index 0bfe9061720a55d80d350cee414a4a401bf90f86..1679a70bbcad7e6bfe2370c142c2bd9b33688db5 100644 (file)
@@ -13,7 +13,6 @@
  *  2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <asm/firmware.h>
index 01f71200c60356077015d4da8c90bc5692e6784a..7e2c9fe44ac17046d1fca345526449c620f0d5f8 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <asm/reg.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
index b25b25902d15cffe6543bc115c879bb6eb067cdc..d88e182e40b3849ba085ec3f83265adac690e538 100644 (file)
@@ -22,7 +22,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <asm/reg.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
index 47c7fa148c9a999dfbe38f8a1c62eb12e2236b5c..accb39d49911bee35bbaa7ed5277017661e0a0bf 100644 (file)
@@ -28,7 +28,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
index 2590e97f553901d666f27091ac79d220fa10708c..adc7f8097cd4f49c0df89a9df04847f21a676828 100644 (file)
@@ -31,7 +31,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
index 8cfd040d1f50c07211eca77ce4694d1cabf0f12e..e16eb2a33173142c828cfba102d248b8e982c7e8 100644 (file)
@@ -21,7 +21,6 @@
  *  2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/threads.h>
 #include <asm/reg.h>
 #include <asm/page.h>
index 28941f5ce6732cf91e28d2b40ba52133f34d0dc5..901be47a02a98c65350038049c3cf7ddeec4870f 100644 (file)
@@ -19,7 +19,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
index dd86bbed76271120c4f64ea39912e1e07d65a9e8..66877bdfe0b7b8c5a20d2d0bdc7df02b4594152c 100644 (file)
@@ -30,7 +30,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/threads.h>
 #include <asm/processor.h>
 #include <asm/page.h>
index e47d40ac6f39d0efeca18d8baf3339b3907d7a92..97ddc02a3d42e320c672fe6ed41c53f323d1de18 100644 (file)
@@ -323,13 +323,11 @@ int ibmebus_request_irq(struct ibmebus_dev *dev,
                        unsigned long irq_flags, const char * devname,
                        void *dev_id)
 {
-       unsigned int irq = virt_irq_create_mapping(ist);
+       unsigned int irq = irq_create_mapping(NULL, ist, 0);
        
        if (irq == NO_IRQ)
                return -EINVAL;
        
-       irq = irq_offset_up(irq);
-       
        return request_irq(irq, handler,
                           irq_flags, devname, dev_id);
 }
@@ -337,12 +335,9 @@ EXPORT_SYMBOL(ibmebus_request_irq);
 
 void ibmebus_free_irq(struct ibmebus_dev *dev, u32 ist, void *dev_id)
 {
-       unsigned int irq = virt_irq_create_mapping(ist);
+       unsigned int irq = irq_find_mapping(NULL, ist);
        
-       irq = irq_offset_up(irq);
        free_irq(irq, dev_id);
-       
-       return;
 }
 EXPORT_SYMBOL(ibmebus_free_irq);
 
index d491052c8e0c5d3ab8c5ee1cfb70d7c1a93d45c5..4180c3998b398f47a1fd5cc3bcc779446901b8fb 100644 (file)
@@ -19,7 +19,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/smp.h>
index b45fa0e37212526614c88f5e384a5f5d7a59e1c6..01bcd52bbf8e11f8594987f41a69a795a848071b 100644 (file)
@@ -13,7 +13,6 @@
  *  2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/threads.h>
 #include <asm/reg.h>
 #include <asm/page.h>
index d85c7c938eed37f075c4eca9c95c0510b739d1aa..30de81da7b40fe163693ca4400edd643c36e3943 100644 (file)
@@ -7,7 +7,6 @@
  *  2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/threads.h>
 #include <asm/processor.h>
 #include <asm/page.h>
index 3d677ac996592d1cb4c15462499c41b6e0e1ecf0..ba0694071728f0fcd2a7af1ce0f27a03b4a68de1 100644 (file)
@@ -23,7 +23,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/types.h>
 #include <linux/slab.h>
index 24f6050aa4abb2d13a873659e737ae13442409bc..8cf987809c669d0c49743b163696bfffb67cb244 100644 (file)
@@ -29,6 +29,8 @@
  * to reduce code space and undefined function references.
  */
 
+#undef DEBUG
+
 #include <linux/module.h>
 #include <linux/threads.h>
 #include <linux/kernel_stat.h>
@@ -38,7 +40,6 @@
 #include <linux/ioport.h>
 #include <linux/interrupt.h>
 #include <linux/timex.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/cpumask.h>
 #include <linux/profile.h>
 #include <linux/bitops.h>
-#include <linux/pci.h>
+#include <linux/list.h>
+#include <linux/radix-tree.h>
+#include <linux/mutex.h>
+#include <linux/bootmem.h>
 
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <asm/prom.h>
 #include <asm/ptrace.h>
 #include <asm/machdep.h>
+#include <asm/udbg.h>
 #ifdef CONFIG_PPC_ISERIES
 #include <asm/paca.h>
 #endif
 
 int __irq_offset_value;
-#ifdef CONFIG_PPC32
-EXPORT_SYMBOL(__irq_offset_value);
-#endif
-
 static int ppc_spurious_interrupts;
 
 #ifdef CONFIG_PPC32
-#define NR_MASK_WORDS  ((NR_IRQS + 31) / 32)
+EXPORT_SYMBOL(__irq_offset_value);
+atomic_t ppc_n_lost_interrupts;
 
+#ifndef CONFIG_PPC_MERGE
+#define NR_MASK_WORDS  ((NR_IRQS + 31) / 32)
 unsigned long ppc_cached_irq_mask[NR_MASK_WORDS];
-atomic_t ppc_n_lost_interrupts;
+#endif
 
 #ifdef CONFIG_TAU_INT
 extern int tau_initialized;
 extern int tau_interrupts(int);
 #endif
+#endif /* CONFIG_PPC32 */
 
 #if defined(CONFIG_SMP) && !defined(CONFIG_PPC_MERGE)
 extern atomic_t ipi_recv;
 extern atomic_t ipi_sent;
 #endif
-#endif /* CONFIG_PPC32 */
 
 #ifdef CONFIG_PPC64
 EXPORT_SYMBOL(irq_desc);
 
 int distribute_irqs = 1;
-u64 ppc64_interrupt_controller;
 #endif /* CONFIG_PPC64 */
 
 int show_interrupts(struct seq_file *p, void *v)
@@ -183,7 +186,7 @@ void fixup_irqs(cpumask_t map)
 
 void do_IRQ(struct pt_regs *regs)
 {
-       int irq;
+       unsigned int irq;
 #ifdef CONFIG_IRQSTACKS
        struct thread_info *curtp, *irqtp;
 #endif
@@ -214,22 +217,26 @@ void do_IRQ(struct pt_regs *regs)
         */
        irq = ppc_md.get_irq(regs);
 
-       if (irq >= 0) {
+       if (irq != NO_IRQ && irq != NO_IRQ_IGNORE) {
 #ifdef CONFIG_IRQSTACKS
                /* Switch to the irq stack to handle this */
                curtp = current_thread_info();
                irqtp = hardirq_ctx[smp_processor_id()];
                if (curtp != irqtp) {
+                       struct irq_desc *desc = irq_desc + irq;
+                       void *handler = desc->handle_irq;
+                       if (handler == NULL)
+                               handler = &__do_IRQ;
                        irqtp->task = curtp->task;
                        irqtp->flags = 0;
-                       call___do_IRQ(irq, regs, irqtp);
+                       call_handle_irq(irq, desc, regs, irqtp, handler);
                        irqtp->task = NULL;
                        if (irqtp->flags)
                                set_bits(irqtp->flags, &curtp->flags);
                } else
 #endif
-                       __do_IRQ(irq, regs);
-       } else if (irq != -2)
+                       generic_handle_irq(irq, regs);
+       } else if (irq != NO_IRQ_IGNORE)
                /* That's not SMP safe ... but who cares ? */
                ppc_spurious_interrupts++;
 
@@ -246,196 +253,562 @@ void do_IRQ(struct pt_regs *regs)
 
 void __init init_IRQ(void)
 {
+       ppc_md.init_IRQ();
 #ifdef CONFIG_PPC64
-       static int once = 0;
+       irq_ctx_init();
+#endif
+}
+
+
+#ifdef CONFIG_IRQSTACKS
+struct thread_info *softirq_ctx[NR_CPUS] __read_mostly;
+struct thread_info *hardirq_ctx[NR_CPUS] __read_mostly;
+
+void irq_ctx_init(void)
+{
+       struct thread_info *tp;
+       int i;
+
+       for_each_possible_cpu(i) {
+               memset((void *)softirq_ctx[i], 0, THREAD_SIZE);
+               tp = softirq_ctx[i];
+               tp->cpu = i;
+               tp->preempt_count = SOFTIRQ_OFFSET;
+
+               memset((void *)hardirq_ctx[i], 0, THREAD_SIZE);
+               tp = hardirq_ctx[i];
+               tp->cpu = i;
+               tp->preempt_count = HARDIRQ_OFFSET;
+       }
+}
+
+static inline void do_softirq_onstack(void)
+{
+       struct thread_info *curtp, *irqtp;
+
+       curtp = current_thread_info();
+       irqtp = softirq_ctx[smp_processor_id()];
+       irqtp->task = curtp->task;
+       call_do_softirq(irqtp);
+       irqtp->task = NULL;
+}
 
-       if (once)
+#else
+#define do_softirq_onstack()   __do_softirq()
+#endif /* CONFIG_IRQSTACKS */
+
+void do_softirq(void)
+{
+       unsigned long flags;
+
+       if (in_interrupt())
                return;
 
-       once++;
+       local_irq_save(flags);
 
-#endif
-       ppc_md.init_IRQ();
-#ifdef CONFIG_PPC64
-       irq_ctx_init();
-#endif
+       if (local_softirq_pending())
+               do_softirq_onstack();
+
+       local_irq_restore(flags);
 }
+EXPORT_SYMBOL(do_softirq);
+
 
-#ifdef CONFIG_PPC64
 /*
- * Virtual IRQ mapping code, used on systems with XICS interrupt controllers.
+ * IRQ controller and virtual interrupts
  */
 
-#define UNDEFINED_IRQ 0xffffffff
-unsigned int virt_irq_to_real_map[NR_IRQS];
+#ifdef CONFIG_PPC_MERGE
 
-/*
- * Don't use virtual irqs 0, 1, 2 for devices.
- * The pcnet32 driver considers interrupt numbers < 2 to be invalid,
- * and 2 is the XICS IPI interrupt.
- * We limit virtual irqs to __irq_offet_value less than virt_irq_max so
- * that when we offset them we don't end up with an interrupt
- * number >= virt_irq_max.
- */
-#define MIN_VIRT_IRQ   3
+static LIST_HEAD(irq_hosts);
+static spinlock_t irq_big_lock = SPIN_LOCK_UNLOCKED;
 
-unsigned int virt_irq_max;
-static unsigned int max_virt_irq;
-static unsigned int nr_virt_irqs;
+struct irq_map_entry irq_map[NR_IRQS];
+static unsigned int irq_virq_count = NR_IRQS;
+static struct irq_host *irq_default_host;
 
-void
-virt_irq_init(void)
+struct irq_host *irq_alloc_host(unsigned int revmap_type,
+                               unsigned int revmap_arg,
+                               struct irq_host_ops *ops,
+                               irq_hw_number_t inval_irq)
 {
-       int i;
+       struct irq_host *host;
+       unsigned int size = sizeof(struct irq_host);
+       unsigned int i;
+       unsigned int *rmap;
+       unsigned long flags;
 
-       if ((virt_irq_max == 0) || (virt_irq_max > (NR_IRQS - 1)))
-               virt_irq_max = NR_IRQS - 1;
-       max_virt_irq = virt_irq_max - __irq_offset_value;
-       nr_virt_irqs = max_virt_irq - MIN_VIRT_IRQ + 1;
+       /* Allocate structure and revmap table if using linear mapping */
+       if (revmap_type == IRQ_HOST_MAP_LINEAR)
+               size += revmap_arg * sizeof(unsigned int);
+       if (mem_init_done)
+               host = kzalloc(size, GFP_KERNEL);
+       else {
+               host = alloc_bootmem(size);
+               if (host)
+                       memset(host, 0, size);
+       }
+       if (host == NULL)
+               return NULL;
 
-       for (i = 0; i < NR_IRQS; i++)
-               virt_irq_to_real_map[i] = UNDEFINED_IRQ;
+       /* Fill structure */
+       host->revmap_type = revmap_type;
+       host->inval_irq = inval_irq;
+       host->ops = ops;
+
+       spin_lock_irqsave(&irq_big_lock, flags);
+
+       /* If it's a legacy controller, check for duplicates and
+        * mark it as allocated (we use irq 0 host pointer for that
+        */
+       if (revmap_type == IRQ_HOST_MAP_LEGACY) {
+               if (irq_map[0].host != NULL) {
+                       spin_unlock_irqrestore(&irq_big_lock, flags);
+                       /* If we are early boot, we can't free the structure,
+                        * too bad...
+                        * this will be fixed once slab is made available early
+                        * instead of the current cruft
+                        */
+                       if (mem_init_done)
+                               kfree(host);
+                       return NULL;
+               }
+               irq_map[0].host = host;
+       }
+
+       list_add(&host->link, &irq_hosts);
+       spin_unlock_irqrestore(&irq_big_lock, flags);
+
+       /* Additional setups per revmap type */
+       switch(revmap_type) {
+       case IRQ_HOST_MAP_LEGACY:
+               /* 0 is always the invalid number for legacy */
+               host->inval_irq = 0;
+               /* setup us as the host for all legacy interrupts */
+               for (i = 1; i < NUM_ISA_INTERRUPTS; i++) {
+                       irq_map[i].hwirq = 0;
+                       smp_wmb();
+                       irq_map[i].host = host;
+                       smp_wmb();
+
+                       /* Clear some flags */
+                       get_irq_desc(i)->status
+                               &= ~(IRQ_NOREQUEST | IRQ_LEVEL);
+
+                       /* Legacy flags are left to default at this point,
+                        * one can then use irq_create_mapping() to
+                        * explicitely change them
+                        */
+                       ops->map(host, i, i, 0);
+               }
+               break;
+       case IRQ_HOST_MAP_LINEAR:
+               rmap = (unsigned int *)(host + 1);
+               for (i = 0; i < revmap_arg; i++)
+                       rmap[i] = IRQ_NONE;
+               host->revmap_data.linear.size = revmap_arg;
+               smp_wmb();
+               host->revmap_data.linear.revmap = rmap;
+               break;
+       default:
+               break;
+       }
+
+       pr_debug("irq: Allocated host of type %d @0x%p\n", revmap_type, host);
+
+       return host;
 }
 
-/* Create a mapping for a real_irq if it doesn't already exist.
- * Return the virtual irq as a convenience.
- */
-int virt_irq_create_mapping(unsigned int real_irq)
+struct irq_host *irq_find_host(struct device_node *node)
 {
-       unsigned int virq, first_virq;
-       static int warned;
+       struct irq_host *h, *found = NULL;
+       unsigned long flags;
+
+       /* We might want to match the legacy controller last since
+        * it might potentially be set to match all interrupts in
+        * the absence of a device node. This isn't a problem so far
+        * yet though...
+        */
+       spin_lock_irqsave(&irq_big_lock, flags);
+       list_for_each_entry(h, &irq_hosts, link)
+               if (h->ops->match == NULL || h->ops->match(h, node)) {
+                       found = h;
+                       break;
+               }
+       spin_unlock_irqrestore(&irq_big_lock, flags);
+       return found;
+}
+EXPORT_SYMBOL_GPL(irq_find_host);
+
+void irq_set_default_host(struct irq_host *host)
+{
+       pr_debug("irq: Default host set to @0x%p\n", host);
+
+       irq_default_host = host;
+}
 
-       if (ppc64_interrupt_controller == IC_OPEN_PIC)
-               return real_irq;        /* no mapping for openpic (for now) */
+void irq_set_virq_count(unsigned int count)
+{
+       pr_debug("irq: Trying to set virq count to %d\n", count);
 
-       if (ppc64_interrupt_controller == IC_CELL_PIC)
-               return real_irq;        /* no mapping for iic either */
+       BUG_ON(count < NUM_ISA_INTERRUPTS);
+       if (count < NR_IRQS)
+               irq_virq_count = count;
+}
 
-       /* don't map interrupts < MIN_VIRT_IRQ */
-       if (real_irq < MIN_VIRT_IRQ) {
-               virt_irq_to_real_map[real_irq] = real_irq;
-               return real_irq;
+unsigned int irq_create_mapping(struct irq_host *host,
+                               irq_hw_number_t hwirq,
+                               unsigned int flags)
+{
+       unsigned int virq, hint;
+
+       pr_debug("irq: irq_create_mapping(0x%p, 0x%lx, 0x%x)\n",
+                host, hwirq, flags);
+
+       /* Look for default host if nececssary */
+       if (host == NULL)
+               host = irq_default_host;
+       if (host == NULL) {
+               printk(KERN_WARNING "irq_create_mapping called for"
+                      " NULL host, hwirq=%lx\n", hwirq);
+               WARN_ON(1);
+               return NO_IRQ;
        }
+       pr_debug("irq: -> using host @%p\n", host);
 
-       /* map to a number between MIN_VIRT_IRQ and max_virt_irq */
-       virq = real_irq;
-       if (virq > max_virt_irq)
-               virq = (virq % nr_virt_irqs) + MIN_VIRT_IRQ;
-
-       /* search for this number or a free slot */
-       first_virq = virq;
-       while (virt_irq_to_real_map[virq] != UNDEFINED_IRQ) {
-               if (virt_irq_to_real_map[virq] == real_irq)
-                       return virq;
-               if (++virq > max_virt_irq)
-                       virq = MIN_VIRT_IRQ;
-               if (virq == first_virq)
-                       goto nospace;   /* oops, no free slots */
+       /* Check if mapping already exist, if it does, call
+        * host->ops->map() to update the flags
+        */
+       virq = irq_find_mapping(host, hwirq);
+       if (virq != IRQ_NONE) {
+               pr_debug("irq: -> existing mapping on virq %d\n", virq);
+               host->ops->map(host, virq, hwirq, flags);
+               return virq;
+       }
+
+       /* Get a virtual interrupt number */
+       if (host->revmap_type == IRQ_HOST_MAP_LEGACY) {
+               /* Handle legacy */
+               virq = (unsigned int)hwirq;
+               if (virq == 0 || virq >= NUM_ISA_INTERRUPTS)
+                       return NO_IRQ;
+               return virq;
+       } else {
+               /* Allocate a virtual interrupt number */
+               hint = hwirq % irq_virq_count;
+               virq = irq_alloc_virt(host, 1, hint);
+               if (virq == NO_IRQ) {
+                       pr_debug("irq: -> virq allocation failed\n");
+                       return NO_IRQ;
+               }
        }
+       pr_debug("irq: -> obtained virq %d\n", virq);
 
-       virt_irq_to_real_map[virq] = real_irq;
+       /* Clear some flags */
+       get_irq_desc(virq)->status &= ~(IRQ_NOREQUEST | IRQ_LEVEL);
+
+       /* map it */
+       if (host->ops->map(host, virq, hwirq, flags)) {
+               pr_debug("irq: -> mapping failed, freeing\n");
+               irq_free_virt(virq, 1);
+               return NO_IRQ;
+       }
+       smp_wmb();
+       irq_map[virq].hwirq = hwirq;
+       smp_mb();
        return virq;
+}
+EXPORT_SYMBOL_GPL(irq_create_mapping);
 
- nospace:
-       if (!warned) {
-               printk(KERN_CRIT "Interrupt table is full\n");
-               printk(KERN_CRIT "Increase virt_irq_max (currently %d) "
-                      "in your kernel sources and rebuild.\n", virt_irq_max);
-               warned = 1;
+extern unsigned int irq_create_of_mapping(struct device_node *controller,
+                                         u32 *intspec, unsigned int intsize)
+{
+       struct irq_host *host;
+       irq_hw_number_t hwirq;
+       unsigned int flags = IRQ_TYPE_NONE;
+
+       if (controller == NULL)
+               host = irq_default_host;
+       else
+               host = irq_find_host(controller);
+       if (host == NULL)
+               return NO_IRQ;
+
+       /* If host has no translation, then we assume interrupt line */
+       if (host->ops->xlate == NULL)
+               hwirq = intspec[0];
+       else {
+               if (host->ops->xlate(host, controller, intspec, intsize,
+                                    &hwirq, &flags))
+                       return NO_IRQ;
        }
-       return NO_IRQ;
+
+       return irq_create_mapping(host, hwirq, flags);
 }
+EXPORT_SYMBOL_GPL(irq_create_of_mapping);
 
-/*
- * In most cases will get a hit on the very first slot checked in the
- * virt_irq_to_real_map.  Only when there are a large number of
- * IRQs will this be expensive.
- */
-unsigned int real_irq_to_virt_slowpath(unsigned int real_irq)
+unsigned int irq_of_parse_and_map(struct device_node *dev, int index)
 {
-       unsigned int virq;
-       unsigned int first_virq;
+       struct of_irq oirq;
 
-       virq = real_irq;
+       if (of_irq_map_one(dev, index, &oirq))
+               return NO_IRQ;
 
-       if (virq > max_virt_irq)
-               virq = (virq % nr_virt_irqs) + MIN_VIRT_IRQ;
+       return irq_create_of_mapping(oirq.controller, oirq.specifier,
+                                    oirq.size);
+}
+EXPORT_SYMBOL_GPL(irq_of_parse_and_map);
 
-       first_virq = virq;
+void irq_dispose_mapping(unsigned int virq)
+{
+       struct irq_host *host = irq_map[virq].host;
+       irq_hw_number_t hwirq;
+       unsigned long flags;
 
-       do {
-               if (virt_irq_to_real_map[virq] == real_irq)
-                       return virq;
+       WARN_ON (host == NULL);
+       if (host == NULL)
+               return;
 
-               virq++;
+       /* Never unmap legacy interrupts */
+       if (host->revmap_type == IRQ_HOST_MAP_LEGACY)
+               return;
 
-               if (virq >= max_virt_irq)
-                       virq = 0;
+       /* remove chip and handler */
+       set_irq_chip_and_handler(virq, NULL, NULL);
+
+       /* Make sure it's completed */
+       synchronize_irq(virq);
+
+       /* Tell the PIC about it */
+       if (host->ops->unmap)
+               host->ops->unmap(host, virq);
+       smp_mb();
+
+       /* Clear reverse map */
+       hwirq = irq_map[virq].hwirq;
+       switch(host->revmap_type) {
+       case IRQ_HOST_MAP_LINEAR:
+               if (hwirq < host->revmap_data.linear.size)
+                       host->revmap_data.linear.revmap[hwirq] = IRQ_NONE;
+               break;
+       case IRQ_HOST_MAP_TREE:
+               /* Check if radix tree allocated yet */
+               if (host->revmap_data.tree.gfp_mask == 0)
+                       break;
+               /* XXX radix tree not safe ! remove lock whem it becomes safe
+                * and use some RCU sync to make sure everything is ok before we
+                * can re-use that map entry
+                */
+               spin_lock_irqsave(&irq_big_lock, flags);
+               radix_tree_delete(&host->revmap_data.tree, hwirq);
+               spin_unlock_irqrestore(&irq_big_lock, flags);
+               break;
+       }
 
-       } while (first_virq != virq);
+       /* Destroy map */
+       smp_mb();
+       irq_map[virq].hwirq = host->inval_irq;
 
-       return NO_IRQ;
+       /* Set some flags */
+       get_irq_desc(virq)->status |= IRQ_NOREQUEST;
 
+       /* Free it */
+       irq_free_virt(virq, 1);
 }
-#endif /* CONFIG_PPC64 */
+EXPORT_SYMBOL_GPL(irq_dispose_mapping);
 
-#ifdef CONFIG_IRQSTACKS
-struct thread_info *softirq_ctx[NR_CPUS] __read_mostly;
-struct thread_info *hardirq_ctx[NR_CPUS] __read_mostly;
+unsigned int irq_find_mapping(struct irq_host *host,
+                             irq_hw_number_t hwirq)
+{
+       unsigned int i;
+       unsigned int hint = hwirq % irq_virq_count;
+
+       /* Look for default host if nececssary */
+       if (host == NULL)
+               host = irq_default_host;
+       if (host == NULL)
+               return NO_IRQ;
+
+       /* legacy -> bail early */
+       if (host->revmap_type == IRQ_HOST_MAP_LEGACY)
+               return hwirq;
+
+       /* Slow path does a linear search of the map */
+       if (hint < NUM_ISA_INTERRUPTS)
+               hint = NUM_ISA_INTERRUPTS;
+       i = hint;
+       do  {
+               if (irq_map[i].host == host &&
+                   irq_map[i].hwirq == hwirq)
+                       return i;
+               i++;
+               if (i >= irq_virq_count)
+                       i = NUM_ISA_INTERRUPTS;
+       } while(i != hint);
+       return NO_IRQ;
+}
+EXPORT_SYMBOL_GPL(irq_find_mapping);
 
-void irq_ctx_init(void)
+
+unsigned int irq_radix_revmap(struct irq_host *host,
+                             irq_hw_number_t hwirq)
 {
-       struct thread_info *tp;
-       int i;
+       struct radix_tree_root *tree;
+       struct irq_map_entry *ptr;
+       unsigned int virq;
+       unsigned long flags;
 
-       for_each_possible_cpu(i) {
-               memset((void *)softirq_ctx[i], 0, THREAD_SIZE);
-               tp = softirq_ctx[i];
-               tp->cpu = i;
-               tp->preempt_count = SOFTIRQ_OFFSET;
+       WARN_ON(host->revmap_type != IRQ_HOST_MAP_TREE);
 
-               memset((void *)hardirq_ctx[i], 0, THREAD_SIZE);
-               tp = hardirq_ctx[i];
-               tp->cpu = i;
-               tp->preempt_count = HARDIRQ_OFFSET;
+       /* Check if the radix tree exist yet. We test the value of
+        * the gfp_mask for that. Sneaky but saves another int in the
+        * structure. If not, we fallback to slow mode
+        */
+       tree = &host->revmap_data.tree;
+       if (tree->gfp_mask == 0)
+               return irq_find_mapping(host, hwirq);
+
+       /* XXX Current radix trees are NOT SMP safe !!! Remove that lock
+        * when that is fixed (when Nick's patch gets in
+        */
+       spin_lock_irqsave(&irq_big_lock, flags);
+
+       /* Now try to resolve */
+       ptr = radix_tree_lookup(tree, hwirq);
+       /* Found it, return */
+       if (ptr) {
+               virq = ptr - irq_map;
+               goto bail;
        }
+
+       /* If not there, try to insert it */
+       virq = irq_find_mapping(host, hwirq);
+       if (virq != NO_IRQ)
+               radix_tree_insert(tree, virq, &irq_map[virq]);
+ bail:
+       spin_unlock_irqrestore(&irq_big_lock, flags);
+       return virq;
 }
 
-static inline void do_softirq_onstack(void)
+unsigned int irq_linear_revmap(struct irq_host *host,
+                              irq_hw_number_t hwirq)
 {
-       struct thread_info *curtp, *irqtp;
+       unsigned int *revmap;
 
-       curtp = current_thread_info();
-       irqtp = softirq_ctx[smp_processor_id()];
-       irqtp->task = curtp->task;
-       call_do_softirq(irqtp);
-       irqtp->task = NULL;
+       WARN_ON(host->revmap_type != IRQ_HOST_MAP_LINEAR);
+
+       /* Check revmap bounds */
+       if (unlikely(hwirq >= host->revmap_data.linear.size))
+               return irq_find_mapping(host, hwirq);
+
+       /* Check if revmap was allocated */
+       revmap = host->revmap_data.linear.revmap;
+       if (unlikely(revmap == NULL))
+               return irq_find_mapping(host, hwirq);
+
+       /* Fill up revmap with slow path if no mapping found */
+       if (unlikely(revmap[hwirq] == NO_IRQ))
+               revmap[hwirq] = irq_find_mapping(host, hwirq);
+
+       return revmap[hwirq];
 }
 
-#else
-#define do_softirq_onstack()   __do_softirq()
-#endif /* CONFIG_IRQSTACKS */
+unsigned int irq_alloc_virt(struct irq_host *host,
+                           unsigned int count,
+                           unsigned int hint)
+{
+       unsigned long flags;
+       unsigned int i, j, found = NO_IRQ;
+       unsigned int limit = irq_virq_count - count;
 
-void do_softirq(void)
+       if (count == 0 || count > (irq_virq_count - NUM_ISA_INTERRUPTS))
+               return NO_IRQ;
+
+       spin_lock_irqsave(&irq_big_lock, flags);
+
+       /* Use hint for 1 interrupt if any */
+       if (count == 1 && hint >= NUM_ISA_INTERRUPTS &&
+           hint < irq_virq_count && irq_map[hint].host == NULL) {
+               found = hint;
+               goto hint_found;
+       }
+
+       /* Look for count consecutive numbers in the allocatable
+        * (non-legacy) space
+        */
+       for (i = NUM_ISA_INTERRUPTS; i <= limit; ) {
+               for (j = i; j < (i + count); j++)
+                       if (irq_map[j].host != NULL) {
+                               i = j + 1;
+                               continue;
+                       }
+               found = i;
+               break;
+       }
+       if (found == NO_IRQ) {
+               spin_unlock_irqrestore(&irq_big_lock, flags);
+               return NO_IRQ;
+       }
+ hint_found:
+       for (i = found; i < (found + count); i++) {
+               irq_map[i].hwirq = host->inval_irq;
+               smp_wmb();
+               irq_map[i].host = host;
+       }
+       spin_unlock_irqrestore(&irq_big_lock, flags);
+       return found;
+}
+
+void irq_free_virt(unsigned int virq, unsigned int count)
 {
        unsigned long flags;
+       unsigned int i;
 
-       if (in_interrupt())
-               return;
+       WARN_ON (virq < NUM_ISA_INTERRUPTS);
+       WARN_ON (count == 0 || (virq + count) > irq_virq_count);
 
-       local_irq_save(flags);
+       spin_lock_irqsave(&irq_big_lock, flags);
+       for (i = virq; i < (virq + count); i++) {
+               struct irq_host *host;
 
-       if (local_softirq_pending()) {
-               account_system_vtime(current);
-               local_bh_disable();
-               do_softirq_onstack();
-               account_system_vtime(current);
-               __local_bh_enable();
+               if (i < NUM_ISA_INTERRUPTS ||
+                   (virq + count) > irq_virq_count)
+                       continue;
+
+               host = irq_map[i].host;
+               irq_map[i].hwirq = host->inval_irq;
+               smp_wmb();
+               irq_map[i].host = NULL;
        }
+       spin_unlock_irqrestore(&irq_big_lock, flags);
+}
 
-       local_irq_restore(flags);
+void irq_early_init(void)
+{
+       unsigned int i;
+
+       for (i = 0; i < NR_IRQS; i++)
+               get_irq_desc(i)->status |= IRQ_NOREQUEST;
 }
-EXPORT_SYMBOL(do_softirq);
+
+/* We need to create the radix trees late */
+static int irq_late_init(void)
+{
+       struct irq_host *h;
+       unsigned long flags;
+
+       spin_lock_irqsave(&irq_big_lock, flags);
+       list_for_each_entry(h, &irq_hosts, link) {
+               if (h->revmap_type == IRQ_HOST_MAP_TREE)
+                       INIT_RADIX_TREE(&h->revmap_data.tree, GFP_ATOMIC);
+       }
+       spin_unlock_irqrestore(&irq_big_lock, flags);
+
+       return 0;
+}
+arch_initcall(irq_late_init);
+
+#endif /* CONFIG_PPC_MERGE */
 
 #ifdef CONFIG_PCI_MSI
 int pci_enable_msi(struct pci_dev * pdev)
index f78866367b70b2abbee2f0ba1e746b775daca6b4..9f0898c897592d41760817b396adeff3b15b3784 100644 (file)
@@ -26,7 +26,6 @@
  *             for PPC64
  */
 
-#include <linux/config.h>
 #include <linux/kprobes.h>
 #include <linux/ptrace.h>
 #include <linux/preempt.h>
index d7f4e982b53924b61d11e1df357e73487cdc0eac..858f28ac8a06e4cee41e3b4696144dccb1724bc6 100644 (file)
@@ -40,7 +40,6 @@
        Author: Terry Greeniaus (tgree@phys.ualberta.ca)
        Please e-mail updates to this file to me, thanks!
 */
-#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/cputable.h>
 #include <asm/ppc_asm.h>
index 3a9b78d0354205d27a92bc1fab94235ea12f46ee..7e98e778b52ff66bbfa313ea58add73807a1cb33 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/serial.h>
 #include <linux/serial_8250.h>
@@ -29,6 +28,7 @@ static struct legacy_serial_info {
        struct device_node              *np;
        unsigned int                    speed;
        unsigned int                    clock;
+       int                             irq_check_parent;
        phys_addr_t                     taddr;
 } legacy_serial_infos[MAX_LEGACY_SERIAL_PORTS];
 static unsigned int legacy_serial_count;
@@ -37,7 +37,7 @@ static int legacy_serial_console = -1;
 static int __init add_legacy_port(struct device_node *np, int want_index,
                                  int iotype, phys_addr_t base,
                                  phys_addr_t taddr, unsigned long irq,
-                                 upf_t flags)
+                                 upf_t flags, int irq_check_parent)
 {
        u32 *clk, *spd, clock = BASE_BAUD * 16;
        int index;
@@ -69,7 +69,7 @@ static int __init add_legacy_port(struct device_node *np, int want_index,
        if (legacy_serial_infos[index].np != 0) {
                /* if we still have some room, move it, else override */
                if (legacy_serial_count < MAX_LEGACY_SERIAL_PORTS) {
-                       printk(KERN_INFO "Moved legacy port %d -> %d\n",
+                       printk(KERN_DEBUG "Moved legacy port %d -> %d\n",
                               index, legacy_serial_count);
                        legacy_serial_ports[legacy_serial_count] =
                                legacy_serial_ports[index];
@@ -77,7 +77,7 @@ static int __init add_legacy_port(struct device_node *np, int want_index,
                                legacy_serial_infos[index];
                        legacy_serial_count++;
                } else {
-                       printk(KERN_INFO "Replacing legacy port %d\n", index);
+                       printk(KERN_DEBUG "Replacing legacy port %d\n", index);
                }
        }
 
@@ -96,10 +96,11 @@ static int __init add_legacy_port(struct device_node *np, int want_index,
        legacy_serial_infos[index].np = of_node_get(np);
        legacy_serial_infos[index].clock = clock;
        legacy_serial_infos[index].speed = spd ? *spd : 0;
+       legacy_serial_infos[index].irq_check_parent = irq_check_parent;
 
-       printk(KERN_INFO "Found legacy serial port %d for %s\n",
+       printk(KERN_DEBUG "Found legacy serial port %d for %s\n",
               index, np->full_name);
-       printk(KERN_INFO "  %s=%llx, taddr=%llx, irq=%lx, clk=%d, speed=%d\n",
+       printk(KERN_DEBUG "  %s=%llx, taddr=%llx, irq=%lx, clk=%d, speed=%d\n",
               (iotype == UPIO_PORT) ? "port" : "mem",
               (unsigned long long)base, (unsigned long long)taddr, irq,
               legacy_serial_ports[index].uartclk,
@@ -127,11 +128,13 @@ static int __init add_legacy_soc_port(struct device_node *np,
                return -1;
 
        addr = of_translate_address(soc_dev, addrp);
+       if (addr == OF_BAD_ADDR)
+               return -1;
 
        /* Add port, irq will be dealt with later. We passed a translated
         * IO port value. It will be fixed up later along with the irq
         */
-       return add_legacy_port(np, -1, UPIO_MEM, addr, addr, NO_IRQ, flags);
+       return add_legacy_port(np, -1, UPIO_MEM, addr, addr, NO_IRQ, flags, 0);
 }
 
 static int __init add_legacy_isa_port(struct device_node *np,
@@ -142,6 +145,8 @@ static int __init add_legacy_isa_port(struct device_node *np,
        int index = -1;
        phys_addr_t taddr;
 
+       DBG(" -> add_legacy_isa_port(%s)\n", np->full_name);
+
        /* Get the ISA port number */
        reg = (u32 *)get_property(np, "reg", NULL);
        if (reg == NULL)
@@ -162,9 +167,12 @@ static int __init add_legacy_isa_port(struct device_node *np,
 
        /* Translate ISA address */
        taddr = of_translate_address(np, reg);
+       if (taddr == OF_BAD_ADDR)
+               return -1;
 
        /* Add port, irq will be dealt with later */
-       return add_legacy_port(np, index, UPIO_PORT, reg[1], taddr, NO_IRQ, UPF_BOOT_AUTOCONF);
+       return add_legacy_port(np, index, UPIO_PORT, reg[1], taddr,
+                              NO_IRQ, UPF_BOOT_AUTOCONF, 0);
 
 }
 
@@ -177,6 +185,8 @@ static int __init add_legacy_pci_port(struct device_node *np,
        unsigned int flags;
        int iotype, index = -1, lindex = 0;
 
+       DBG(" -> add_legacy_pci_port(%s)\n", np->full_name);
+
        /* We only support ports that have a clock frequency properly
         * encoded in the device-tree (that is have an fcode). Anything
         * else can't be used that early and will be normally probed by
@@ -195,6 +205,8 @@ static int __init add_legacy_pci_port(struct device_node *np,
        /* We only support BAR 0 for now */
        iotype = (flags & IORESOURCE_MEM) ? UPIO_MEM : UPIO_PORT;
        addr = of_translate_address(pci_dev, addrp);
+       if (addr == OF_BAD_ADDR)
+               return -1;
 
        /* Set the IO base to the same as the translated address for MMIO,
         * or to the domain local IO base for PIO (it will be fixed up later)
@@ -232,7 +244,8 @@ static int __init add_legacy_pci_port(struct device_node *np,
        /* Add port, irq will be dealt with later. We passed a translated
         * IO port value. It will be fixed up later along with the irq
         */
-       return add_legacy_port(np, index, iotype, base, addr, NO_IRQ, UPF_BOOT_AUTOCONF);
+       return add_legacy_port(np, index, iotype, base, addr, NO_IRQ,
+                              UPF_BOOT_AUTOCONF, np != pci_dev);
 }
 #endif
 
@@ -363,27 +376,22 @@ static void __init fixup_port_irq(int index,
                                  struct device_node *np,
                                  struct plat_serial8250_port *port)
 {
+       unsigned int virq;
+
        DBG("fixup_port_irq(%d)\n", index);
 
-       /* Check for interrupts in that node */
-       if (np->n_intrs > 0) {
-               port->irq = np->intrs[0].line;
-               DBG(" port %d (%s), irq=%d\n",
-                   index, np->full_name, port->irq);
-               return;
+       virq = irq_of_parse_and_map(np, 0);
+       if (virq == NO_IRQ && legacy_serial_infos[index].irq_check_parent) {
+               np = of_get_parent(np);
+               if (np == NULL)
+                       return;
+               virq = irq_of_parse_and_map(np, 0);
+               of_node_put(np);
        }
-
-       /* Check for interrupts in the parent */
-       np = of_get_parent(np);
-       if (np == NULL)
+       if (virq == NO_IRQ)
                return;
 
-       if (np->n_intrs > 0) {
-               port->irq = np->intrs[0].line;
-               DBG(" port %d (%s), irq=%d\n",
-                   index, np->full_name, port->irq);
-       }
-       of_node_put(np);
+       port->irq = virq;
 }
 
 static void __init fixup_port_pio(int index,
index 73edc3c16137f532a84754536da5509575d3b927..23f34daa044a0e7ad9cc6d2b6686c94c2c6611b7 100644 (file)
@@ -18,7 +18,6 @@
  * keyword - value pairs that specify the configuration of the partition.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/errno.h>
index c74774e2175d9075a8a60a9b0636f18bf5fddc66..58758d8833619f011e10801e0647a2c08b1e8ff1 100644 (file)
@@ -16,7 +16,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/sys.h>
 #include <asm/unistd.h>
 #include <asm/errno.h>
index 580891cb8ccb68766e4f5a28534eb29d81edea36..bfb407fc1aa1f5ed747e789289a5daa53260dd81 100644 (file)
@@ -14,7 +14,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/sys.h>
 #include <asm/unistd.h>
 #include <asm/errno.h>
@@ -52,12 +51,14 @@ _GLOBAL(call_do_softirq)
        mtlr    r0
        blr
 
-_GLOBAL(call___do_IRQ)
+_GLOBAL(call_handle_irq)
+       ld      r8,0(r7)
        mflr    r0
        std     r0,16(r1)
-       stdu    r1,THREAD_SIZE-112(r5)
-       mr      r1,r5
-       bl      .__do_IRQ
+       mtctr   r8
+       stdu    r1,THREAD_SIZE-112(r6)
+       mr      r1,r6
+       bctrl
        ld      r1,0(r1)
        ld      r0,16(r1)
        mtlr    r0
index 9feeeef5a87535a298b90e95f145b4664862277f..3262b73a3a6898e926e33b5f3d97e97c3943e684 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index a0bb354c1c08154e070ea032b290b0e5a07d35d8..c68741fed14bbb356ac02aaf5cf86a064a3c6ef1 100644 (file)
@@ -7,7 +7,6 @@
  *      2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/threads.h>
 #include <linux/module.h>
index 8474355a1a4f46d8a9e1df29a2ad403fc847713a..898dae8ab6d91684daae3bd6d1795b27bacc958e 100644 (file)
@@ -2,7 +2,6 @@
  * Common pmac/prep/chrp pci routines. -- Cort
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
@@ -1405,6 +1404,43 @@ pcibios_update_irq(struct pci_dev *dev, int irq)
        /* XXX FIXME - update OF device tree node interrupt property */
 }
 
+#ifdef CONFIG_PPC_MERGE
+/* XXX This is a copy of the ppc64 version. This is temporary until we start
+ * merging the 2 PCI layers
+ */
+/*
+ * Reads the interrupt pin to determine if interrupt is use by card.
+ * If the interrupt is used, then gets the interrupt line from the
+ * openfirmware and sets it in the pci_dev and pci_config line.
+ */
+int pci_read_irq_line(struct pci_dev *pci_dev)
+{
+       struct of_irq oirq;
+       unsigned int virq;
+
+       DBG("Try to map irq for %s...\n", pci_name(pci_dev));
+
+       if (of_irq_map_pci(pci_dev, &oirq)) {
+               DBG(" -> failed !\n");
+               return -1;
+       }
+
+       DBG(" -> got one, spec %d cells (0x%08x...) on %s\n",
+           oirq.size, oirq.specifier[0], oirq.controller->full_name);
+
+       virq = irq_create_of_mapping(oirq.controller, oirq.specifier, oirq.size);
+       if(virq == NO_IRQ) {
+               DBG(" -> failed to map !\n");
+               return -1;
+       }
+       pci_dev->irq = virq;
+       pci_write_config_byte(pci_dev, PCI_INTERRUPT_LINE, virq);
+
+       return 0;
+}
+EXPORT_SYMBOL(pci_read_irq_line);
+#endif /* CONFIG_PPC_MERGE */
+
 int pcibios_enable_device(struct pci_dev *dev, int mask)
 {
        u16 cmd, old_cmd;
index 286aa52aae334db643c5769d5816ee7b6a8ba3f9..efc0b5559ee0e79eb1874fec310eb9cdf676b880 100644 (file)
@@ -13,7 +13,6 @@
 
 #undef DEBUG
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/string.h>
@@ -399,12 +398,8 @@ struct pci_dev *of_create_pci_dev(struct device_node *node,
        } else {
                dev->hdr_type = PCI_HEADER_TYPE_NORMAL;
                dev->rom_base_reg = PCI_ROM_ADDRESS;
+               /* Maybe do a default OF mapping here */
                dev->irq = NO_IRQ;
-               if (node->n_intrs > 0) {
-                       dev->irq = node->intrs[0].line;
-                       pci_write_config_byte(dev, PCI_INTERRUPT_LINE,
-                                             dev->irq);
-               }
        }
 
        pci_parse_of_addrs(node, dev);
@@ -1289,23 +1284,26 @@ EXPORT_SYMBOL(pcibios_fixup_bus);
  */
 int pci_read_irq_line(struct pci_dev *pci_dev)
 {
-       u8 intpin;
-       struct device_node *node;
-
-       pci_read_config_byte(pci_dev, PCI_INTERRUPT_PIN, &intpin);
-       if (intpin == 0)
-               return 0;
+       struct of_irq oirq;
+       unsigned int virq;
 
-       node = pci_device_to_OF_node(pci_dev);
-       if (node == NULL)
-               return -1;
+       DBG("Try to map irq for %s...\n", pci_name(pci_dev));
 
-       if (node->n_intrs == 0)
+       if (of_irq_map_pci(pci_dev, &oirq)) {
+               DBG(" -> failed !\n");
                return -1;
+       }
 
-       pci_dev->irq = node->intrs[0].line;
+       DBG(" -> got one, spec %d cells (0x%08x...) on %s\n",
+           oirq.size, oirq.specifier[0], oirq.controller->full_name);
 
-       pci_write_config_byte(pci_dev, PCI_INTERRUPT_LINE, pci_dev->irq);
+       virq = irq_create_of_mapping(oirq.controller, oirq.specifier, oirq.size);
+       if(virq == NO_IRQ) {
+               DBG(" -> failed to map !\n");
+               return -1;
+       }
+       pci_dev->irq = virq;
+       pci_write_config_byte(pci_dev, PCI_INTERRUPT_LINE, virq);
 
        return 0;
 }
index 32455dfcc36bb2a55d9728e7af15c48500668710..bdc3977a7b062c647fb788bda68f56ecab924df7 100644 (file)
@@ -21,7 +21,6 @@
 #include <linux/user.h>
 #include <linux/a.out.h>
 #include <linux/interrupt.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/prctl.h>
index e6fb194fe537dfb941261641f8d33b1eb92e5c4f..a0a2efadeabf8fbbed432e506360d14f85c1770f 100644 (file)
@@ -12,7 +12,6 @@
  *  2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/spinlock.h>
 #include <linux/module.h>
index 4b052ae5dc344a39eb93b0ab4e5018558ee0bc65..e3b80f71748e96fd2cc064031d2241a25a83ee51 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/threads.h>
 #include <linux/smp.h>
index 2ab8f2be911e055c2d38b726816f9d7fc6b0f3ef..f598cb5195395d3ee3c53b584f8fdf71de0d4302 100644 (file)
@@ -16,7 +16,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <linux/proc_fs.h>
index e4732459c48571c6508631b81c6ed46917dae082..a127a1e3c0976aea0134de07ce2c6d3d1f4d0ba6 100644 (file)
@@ -14,7 +14,6 @@
  *  2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index 320c913435cd149a40cd2f8e4f16385184d7bde0..a1787ffb6319bfcc59004df9d1faba5f6d0209d9 100644 (file)
@@ -16,7 +16,6 @@
 #undef DEBUG
 
 #include <stdarg.h>
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/init.h>
@@ -31,6 +30,7 @@
 #include <linux/module.h>
 #include <linux/kexec.h>
 #include <linux/debugfs.h>
+#include <linux/irq.h>
 
 #include <asm/prom.h>
 #include <asm/rtas.h>
@@ -87,424 +87,6 @@ static DEFINE_RWLOCK(devtree_lock);
 /* export that to outside world */
 struct device_node *of_chosen;
 
-struct device_node *dflt_interrupt_controller;
-int num_interrupt_controllers;
-
-/*
- * Wrapper for allocating memory for various data that needs to be
- * attached to device nodes as they are processed at boot or when
- * added to the device tree later (e.g. DLPAR).  At boot there is
- * already a region reserved so we just increment *mem_start by size;
- * otherwise we call kmalloc.
- */
-static void * prom_alloc(unsigned long size, unsigned long *mem_start)
-{
-       unsigned long tmp;
-
-       if (!mem_start)
-               return kmalloc(size, GFP_KERNEL);
-
-       tmp = *mem_start;
-       *mem_start += size;
-       return (void *)tmp;
-}
-
-/*
- * Find the device_node with a given phandle.
- */
-static struct device_node * find_phandle(phandle ph)
-{
-       struct device_node *np;
-
-       for (np = allnodes; np != 0; np = np->allnext)
-               if (np->linux_phandle == ph)
-                       return np;
-       return NULL;
-}
-
-/*
- * Find the interrupt parent of a node.
- */
-static struct device_node * __devinit intr_parent(struct device_node *p)
-{
-       phandle *parp;
-
-       parp = (phandle *) get_property(p, "interrupt-parent", NULL);
-       if (parp == NULL)
-               return p->parent;
-       p = find_phandle(*parp);
-       if (p != NULL)
-               return p;
-       /*
-        * On a powermac booted with BootX, we don't get to know the
-        * phandles for any nodes, so find_phandle will return NULL.
-        * Fortunately these machines only have one interrupt controller
-        * so there isn't in fact any ambiguity.  -- paulus
-        */
-       if (num_interrupt_controllers == 1)
-               p = dflt_interrupt_controller;
-       return p;
-}
-
-/*
- * Find out the size of each entry of the interrupts property
- * for a node.
- */
-int __devinit prom_n_intr_cells(struct device_node *np)
-{
-       struct device_node *p;
-       unsigned int *icp;
-
-       for (p = np; (p = intr_parent(p)) != NULL; ) {
-               icp = (unsigned int *)
-                       get_property(p, "#interrupt-cells", NULL);
-               if (icp != NULL)
-                       return *icp;
-               if (get_property(p, "interrupt-controller", NULL) != NULL
-                   || get_property(p, "interrupt-map", NULL) != NULL) {
-                       printk("oops, node %s doesn't have #interrupt-cells\n",
-                              p->full_name);
-                       return 1;
-               }
-       }
-#ifdef DEBUG_IRQ
-       printk("prom_n_intr_cells failed for %s\n", np->full_name);
-#endif
-       return 1;
-}
-
-/*
- * Map an interrupt from a device up to the platform interrupt
- * descriptor.
- */
-static int __devinit map_interrupt(unsigned int **irq, struct device_node **ictrler,
-                                  struct device_node *np, unsigned int *ints,
-                                  int nintrc)
-{
-       struct device_node *p, *ipar;
-       unsigned int *imap, *imask, *ip;
-       int i, imaplen, match;
-       int newintrc = 0, newaddrc = 0;
-       unsigned int *reg;
-       int naddrc;
-
-       reg = (unsigned int *) get_property(np, "reg", NULL);
-       naddrc = prom_n_addr_cells(np);
-       p = intr_parent(np);
-       while (p != NULL) {
-               if (get_property(p, "interrupt-controller", NULL) != NULL)
-                       /* this node is an interrupt controller, stop here */
-                       break;
-               imap = (unsigned int *)
-                       get_property(p, "interrupt-map", &imaplen);
-               if (imap == NULL) {
-                       p = intr_parent(p);
-                       continue;
-               }
-               imask = (unsigned int *)
-                       get_property(p, "interrupt-map-mask", NULL);
-               if (imask == NULL) {
-                       printk("oops, %s has interrupt-map but no mask\n",
-                              p->full_name);
-                       return 0;
-               }
-               imaplen /= sizeof(unsigned int);
-               match = 0;
-               ipar = NULL;
-               while (imaplen > 0 && !match) {
-                       /* check the child-interrupt field */
-                       match = 1;
-                       for (i = 0; i < naddrc && match; ++i)
-                               match = ((reg[i] ^ imap[i]) & imask[i]) == 0;
-                       for (; i < naddrc + nintrc && match; ++i)
-                               match = ((ints[i-naddrc] ^ imap[i]) & imask[i]) == 0;
-                       imap += naddrc + nintrc;
-                       imaplen -= naddrc + nintrc;
-                       /* grab the interrupt parent */
-                       ipar = find_phandle((phandle) *imap++);
-                       --imaplen;
-                       if (ipar == NULL && num_interrupt_controllers == 1)
-                               /* cope with BootX not giving us phandles */
-                               ipar = dflt_interrupt_controller;
-                       if (ipar == NULL) {
-                               printk("oops, no int parent %x in map of %s\n",
-                                      imap[-1], p->full_name);
-                               return 0;
-                       }
-                       /* find the parent's # addr and intr cells */
-                       ip = (unsigned int *)
-                               get_property(ipar, "#interrupt-cells", NULL);
-                       if (ip == NULL) {
-                               printk("oops, no #interrupt-cells on %s\n",
-                                      ipar->full_name);
-                               return 0;
-                       }
-                       newintrc = *ip;
-                       ip = (unsigned int *)
-                               get_property(ipar, "#address-cells", NULL);
-                       newaddrc = (ip == NULL)? 0: *ip;
-                       imap += newaddrc + newintrc;
-                       imaplen -= newaddrc + newintrc;
-               }
-               if (imaplen < 0) {
-                       printk("oops, error decoding int-map on %s, len=%d\n",
-                              p->full_name, imaplen);
-                       return 0;
-               }
-               if (!match) {
-#ifdef DEBUG_IRQ
-                       printk("oops, no match in %s int-map for %s\n",
-                              p->full_name, np->full_name);
-#endif
-                       return 0;
-               }
-               p = ipar;
-               naddrc = newaddrc;
-               nintrc = newintrc;
-               ints = imap - nintrc;
-               reg = ints - naddrc;
-       }
-       if (p == NULL) {
-#ifdef DEBUG_IRQ
-               printk("hmmm, int tree for %s doesn't have ctrler\n",
-                      np->full_name);
-#endif
-               return 0;
-       }
-       *irq = ints;
-       *ictrler = p;
-       return nintrc;
-}
-
-static unsigned char map_isa_senses[4] = {
-       IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE,
-       IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE,
-       IRQ_SENSE_EDGE  | IRQ_POLARITY_NEGATIVE,
-       IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE
-};
-
-static unsigned char map_mpic_senses[4] = {
-       IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE,
-       IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE,
-       /* 2 seems to be used for the 8259 cascade... */
-       IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE,
-       IRQ_SENSE_EDGE  | IRQ_POLARITY_NEGATIVE,
-};
-
-static int __devinit finish_node_interrupts(struct device_node *np,
-                                           unsigned long *mem_start,
-                                           int measure_only)
-{
-       unsigned int *ints;
-       int intlen, intrcells, intrcount;
-       int i, j, n, sense;
-       unsigned int *irq, virq;
-       struct device_node *ic;
-       int trace = 0;
-
-       //#define TRACE(fmt...) do { if (trace) { printk(fmt); mdelay(1000); } } while(0)
-#define TRACE(fmt...)
-
-       if (!strcmp(np->name, "smu-doorbell"))
-               trace = 1;
-
-       TRACE("Finishing SMU doorbell ! num_interrupt_controllers = %d\n",
-             num_interrupt_controllers);
-
-       if (num_interrupt_controllers == 0) {
-               /*
-                * Old machines just have a list of interrupt numbers
-                * and no interrupt-controller nodes.
-                */
-               ints = (unsigned int *) get_property(np, "AAPL,interrupts",
-                                                    &intlen);
-               /* XXX old interpret_pci_props looked in parent too */
-               /* XXX old interpret_macio_props looked for interrupts
-                  before AAPL,interrupts */
-               if (ints == NULL)
-                       ints = (unsigned int *) get_property(np, "interrupts",
-                                                            &intlen);
-               if (ints == NULL)
-                       return 0;
-
-               np->n_intrs = intlen / sizeof(unsigned int);
-               np->intrs = prom_alloc(np->n_intrs * sizeof(np->intrs[0]),
-                                      mem_start);
-               if (!np->intrs)
-                       return -ENOMEM;
-               if (measure_only)
-                       return 0;
-
-               for (i = 0; i < np->n_intrs; ++i) {
-                       np->intrs[i].line = *ints++;
-                       np->intrs[i].sense = IRQ_SENSE_LEVEL
-                               | IRQ_POLARITY_NEGATIVE;
-               }
-               return 0;
-       }
-
-       ints = (unsigned int *) get_property(np, "interrupts", &intlen);
-       TRACE("ints=%p, intlen=%d\n", ints, intlen);
-       if (ints == NULL)
-               return 0;
-       intrcells = prom_n_intr_cells(np);
-       intlen /= intrcells * sizeof(unsigned int);
-       TRACE("intrcells=%d, new intlen=%d\n", intrcells, intlen);
-       np->intrs = prom_alloc(intlen * sizeof(*(np->intrs)), mem_start);
-       if (!np->intrs)
-               return -ENOMEM;
-
-       if (measure_only)
-               return 0;
-
-       intrcount = 0;
-       for (i = 0; i < intlen; ++i, ints += intrcells) {
-               n = map_interrupt(&irq, &ic, np, ints, intrcells);
-               TRACE("map, irq=%d, ic=%p, n=%d\n", irq, ic, n);
-               if (n <= 0)
-                       continue;
-
-               /* don't map IRQ numbers under a cascaded 8259 controller */
-               if (ic && device_is_compatible(ic, "chrp,iic")) {
-                       np->intrs[intrcount].line = irq[0];
-                       sense = (n > 1)? (irq[1] & 3): 3;
-                       np->intrs[intrcount].sense = map_isa_senses[sense];
-               } else {
-                       virq = virt_irq_create_mapping(irq[0]);
-                       TRACE("virq=%d\n", virq);
-#ifdef CONFIG_PPC64
-                       if (virq == NO_IRQ) {
-                               printk(KERN_CRIT "Could not allocate interrupt"
-                                      " number for %s\n", np->full_name);
-                               continue;
-                       }
-#endif
-                       np->intrs[intrcount].line = irq_offset_up(virq);
-                       sense = (n > 1)? (irq[1] & 3): 1;
-
-                       /* Apple uses bits in there in a different way, let's
-                        * only keep the real sense bit on macs
-                        */
-                       if (machine_is(powermac))
-                               sense &= 0x1;
-                       np->intrs[intrcount].sense = map_mpic_senses[sense];
-               }
-
-#ifdef CONFIG_PPC64
-               /* We offset irq numbers for the u3 MPIC by 128 in PowerMac */
-               if (machine_is(powermac) && ic && ic->parent) {
-                       char *name = get_property(ic->parent, "name", NULL);
-                       if (name && !strcmp(name, "u3"))
-                               np->intrs[intrcount].line += 128;
-                       else if (!(name && (!strcmp(name, "mac-io") ||
-                                           !strcmp(name, "u4"))))
-                               /* ignore other cascaded controllers, such as
-                                  the k2-sata-root */
-                               break;
-               }
-#endif /* CONFIG_PPC64 */
-               if (n > 2) {
-                       printk("hmmm, got %d intr cells for %s:", n,
-                              np->full_name);
-                       for (j = 0; j < n; ++j)
-                               printk(" %d", irq[j]);
-                       printk("\n");
-               }
-               ++intrcount;
-       }
-       np->n_intrs = intrcount;
-
-       return 0;
-}
-
-static int __devinit finish_node(struct device_node *np,
-                                unsigned long *mem_start,
-                                int measure_only)
-{
-       struct device_node *child;
-       int rc = 0;
-
-       rc = finish_node_interrupts(np, mem_start, measure_only);
-       if (rc)
-               goto out;
-
-       for (child = np->child; child != NULL; child = child->sibling) {
-               rc = finish_node(child, mem_start, measure_only);
-               if (rc)
-                       goto out;
-       }
-out:
-       return rc;
-}
-
-static void __init scan_interrupt_controllers(void)
-{
-       struct device_node *np;
-       int n = 0;
-       char *name, *ic;
-       int iclen;
-
-       for (np = allnodes; np != NULL; np = np->allnext) {
-               ic = get_property(np, "interrupt-controller", &iclen);
-               name = get_property(np, "name", NULL);
-               /* checking iclen makes sure we don't get a false
-                  match on /chosen.interrupt_controller */
-               if ((name != NULL
-                    && strcmp(name, "interrupt-controller") == 0)
-                   || (ic != NULL && iclen == 0
-                       && strcmp(name, "AppleKiwi"))) {
-                       if (n == 0)
-                               dflt_interrupt_controller = np;
-                       ++n;
-               }
-       }
-       num_interrupt_controllers = n;
-}
-
-/**
- * finish_device_tree is called once things are running normally
- * (i.e. with text and data mapped to the address they were linked at).
- * It traverses the device tree and fills in some of the additional,
- * fields in each node like {n_}addrs and {n_}intrs, the virt interrupt
- * mapping is also initialized at this point.
- */
-void __init finish_device_tree(void)
-{
-       unsigned long start, end, size = 0;
-
-       DBG(" -> finish_device_tree\n");
-
-#ifdef CONFIG_PPC64
-       /* Initialize virtual IRQ map */
-       virt_irq_init();
-#endif
-       scan_interrupt_controllers();
-
-       /*
-        * Finish device-tree (pre-parsing some properties etc...)
-        * We do this in 2 passes. One with "measure_only" set, which
-        * will only measure the amount of memory needed, then we can
-        * allocate that memory, and call finish_node again. However,
-        * we must be careful as most routines will fail nowadays when
-        * prom_alloc() returns 0, so we must make sure our first pass
-        * doesn't start at 0. We pre-initialize size to 16 for that
-        * reason and then remove those additional 16 bytes
-        */
-       size = 16;
-       finish_node(allnodes, &size, 1);
-       size -= 16;
-
-       if (0 == size)
-               end = start = 0;
-       else
-               end = start = (unsigned long)__va(lmb_alloc(size, 128));
-
-       finish_node(allnodes, &end, 0);
-       BUG_ON(end != start + size);
-
-       DBG(" <- finish_device_tree\n");
-}
-
 static inline char *find_flat_dt_string(u32 offset)
 {
        return ((char *)initial_boot_params) +
@@ -1389,27 +971,6 @@ prom_n_size_cells(struct device_node* np)
 }
 EXPORT_SYMBOL(prom_n_size_cells);
 
-/**
- * Work out the sense (active-low level / active-high edge)
- * of each interrupt from the device tree.
- */
-void __init prom_get_irq_senses(unsigned char *senses, int off, int max)
-{
-       struct device_node *np;
-       int i, j;
-
-       /* default to level-triggered */
-       memset(senses, IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE, max - off);
-
-       for (np = allnodes; np != 0; np = np->allnext) {
-               for (j = 0; j < np->n_intrs; j++) {
-                       i = np->intrs[j].line;
-                       if (i >= off && i < max)
-                               senses[i-off] = np->intrs[j].sense;
-               }
-       }
-}
-
 /**
  * Construct and return a list of the device_nodes with a given name.
  */
@@ -1809,7 +1370,6 @@ static void of_node_release(struct kref *kref)
                        node->deadprops = NULL;
                }
        }
-       kfree(node->intrs);
        kfree(node->full_name);
        kfree(node->data);
        kfree(node);
@@ -1882,13 +1442,7 @@ void of_detach_node(const struct device_node *np)
 #ifdef CONFIG_PPC_PSERIES
 /*
  * Fix up the uninitialized fields in a new device node:
- * name, type, n_addrs, addrs, n_intrs, intrs, and pci-specific fields
- *
- * A lot of boot-time code is duplicated here, because functions such
- * as finish_node_interrupts, interpret_pci_props, etc. cannot use the
- * slab allocator.
- *
- * This should probably be split up into smaller chunks.
+ * name, type and pci-specific fields
  */
 
 static int of_finish_dynamic_node(struct device_node *node)
@@ -1929,8 +1483,6 @@ static int prom_reconfig_notifier(struct notifier_block *nb,
        switch (action) {
        case PSERIES_RECONFIG_ADD:
                err = of_finish_dynamic_node(node);
-               if (!err)
-                       finish_node(node, NULL, 0);
                if (err < 0) {
                        printk(KERN_ERR "finish_node returned %d\n", err);
                        err = NOTIFY_BAD;
@@ -1976,8 +1528,7 @@ struct property *of_find_property(struct device_node *np, const char *name,
  * Find a property with a given name for a given node
  * and return the value.
  */
-unsigned char *get_property(struct device_node *np, const char *name,
-                           int *lenp)
+void *get_property(struct device_node *np, const char *name, int *lenp)
 {
        struct property *pp = of_find_property(np,name,lenp);
        return pp ? pp->value : NULL;
index 8c28eb0cbdac7392c3ed9d895e67aa81545b7613..ebd501a59abdaf3e800d94985b81fa6f58feb080 100644 (file)
@@ -16,7 +16,6 @@
 #undef DEBUG_PROM
 
 #include <stdarg.h>
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/init.h>
@@ -988,7 +987,7 @@ static void reserve_mem(u64 base, u64 size)
 }
 
 /*
- * Initialize memory allocation mecanism, parse "memory" nodes and
+ * Initialize memory allocation mechanism, parse "memory" nodes and
  * obtain that way the top of memory and RMO to setup out local allocator
  */
 static void __init prom_init_mem(void)
@@ -1991,12 +1990,22 @@ static void __init flatten_device_tree(void)
 static void __init fixup_device_tree_maple(void)
 {
        phandle isa;
+       u32 rloc = 0x01002000; /* IO space; PCI device = 4 */
        u32 isa_ranges[6];
-
-       isa = call_prom("finddevice", 1, 1, ADDR("/ht@0/isa@4"));
+       char *name;
+
+       name = "/ht@0/isa@4";
+       isa = call_prom("finddevice", 1, 1, ADDR(name));
+       if (!PHANDLE_VALID(isa)) {
+               name = "/ht@0/isa@6";
+               isa = call_prom("finddevice", 1, 1, ADDR(name));
+               rloc = 0x01003000; /* IO space; PCI device = 6 */
+       }
        if (!PHANDLE_VALID(isa))
                return;
 
+       if (prom_getproplen(isa, "ranges") != 12)
+               return;
        if (prom_getprop(isa, "ranges", isa_ranges, sizeof(isa_ranges))
                == PROM_ERROR)
                return;
@@ -2006,15 +2015,15 @@ static void __init fixup_device_tree_maple(void)
                isa_ranges[2] != 0x00010000)
                return;
 
-       prom_printf("fixing up bogus ISA range on Maple...\n");
+       prom_printf("Fixing up bogus ISA range on Maple/Apache...\n");
 
        isa_ranges[0] = 0x1;
        isa_ranges[1] = 0x0;
-       isa_ranges[2] = 0x01002000; /* IO space; PCI device = 4 */
+       isa_ranges[2] = rloc;
        isa_ranges[3] = 0x0;
        isa_ranges[4] = 0x0;
        isa_ranges[5] = 0x00010000;
-       prom_setprop(isa, "/ht@0/isa@4", "ranges",
+       prom_setprop(isa, name, "ranges",
                        isa_ranges, sizeof(isa_ranges));
 }
 #else
index 45df420383cc6d7d8f0a0ef81807b475a2e5c89f..21009b1f7869808ef3f6d1befb63416a3d2452bf 100644 (file)
@@ -38,14 +38,6 @@ static void of_dump_addr(const char *s, u32 *addr, int na)
 static void of_dump_addr(const char *s, u32 *addr, int na) { }
 #endif
 
-/* Read a big address */
-static inline u64 of_read_addr(u32 *cell, int size)
-{
-       u64 r = 0;
-       while (size--)
-               r = (r << 32) | *(cell++);
-       return r;
-}
 
 /* Callbacks for bus specific translators */
 struct of_bus {
@@ -77,9 +69,9 @@ static u64 of_bus_default_map(u32 *addr, u32 *range, int na, int ns, int pna)
 {
        u64 cp, s, da;
 
-       cp = of_read_addr(range, na);
-       s  = of_read_addr(range + na + pna, ns);
-       da = of_read_addr(addr, na);
+       cp = of_read_number(range, na);
+       s  = of_read_number(range + na + pna, ns);
+       da = of_read_number(addr, na);
 
        DBG("OF: default map, cp="PRu64", s="PRu64", da="PRu64"\n",
            cp, s, da);
@@ -91,7 +83,7 @@ static u64 of_bus_default_map(u32 *addr, u32 *range, int na, int ns, int pna)
 
 static int of_bus_default_translate(u32 *addr, u64 offset, int na)
 {
-       u64 a = of_read_addr(addr, na);
+       u64 a = of_read_number(addr, na);
        memset(addr, 0, na * 4);
        a += offset;
        if (na > 1)
@@ -135,9 +127,9 @@ static u64 of_bus_pci_map(u32 *addr, u32 *range, int na, int ns, int pna)
                return OF_BAD_ADDR;
 
        /* Read address values, skipping high cell */
-       cp = of_read_addr(range + 1, na - 1);
-       s  = of_read_addr(range + na + pna, ns);
-       da = of_read_addr(addr + 1, na - 1);
+       cp = of_read_number(range + 1, na - 1);
+       s  = of_read_number(range + na + pna, ns);
+       da = of_read_number(addr + 1, na - 1);
 
        DBG("OF: PCI map, cp="PRu64", s="PRu64", da="PRu64"\n", cp, s, da);
 
@@ -195,9 +187,9 @@ static u64 of_bus_isa_map(u32 *addr, u32 *range, int na, int ns, int pna)
                return OF_BAD_ADDR;
 
        /* Read address values, skipping high cell */
-       cp = of_read_addr(range + 1, na - 1);
-       s  = of_read_addr(range + na + pna, ns);
-       da = of_read_addr(addr + 1, na - 1);
+       cp = of_read_number(range + 1, na - 1);
+       s  = of_read_number(range + na + pna, ns);
+       da = of_read_number(addr + 1, na - 1);
 
        DBG("OF: ISA map, cp="PRu64", s="PRu64", da="PRu64"\n", cp, s, da);
 
@@ -295,7 +287,7 @@ static int of_translate_one(struct device_node *parent, struct of_bus *bus,
         */
        ranges = (u32 *)get_property(parent, "ranges", &rlen);
        if (ranges == NULL || rlen == 0) {
-               offset = of_read_addr(addr, na);
+               offset = of_read_number(addr, na);
                memset(addr, 0, pna * 4);
                DBG("OF: no ranges, 1:1 translation\n");
                goto finish;
@@ -378,7 +370,7 @@ u64 of_translate_address(struct device_node *dev, u32 *in_addr)
                /* If root, we have finished */
                if (parent == NULL) {
                        DBG("OF: reached root node\n");
-                       result = of_read_addr(addr, na);
+                       result = of_read_number(addr, na);
                        break;
                }
 
@@ -442,7 +434,7 @@ u32 *of_get_address(struct device_node *dev, int index, u64 *size,
        for (i = 0; psize >= onesize; psize -= onesize, prop += onesize, i++)
                if (i == index) {
                        if (size)
-                               *size = of_read_addr(prop + na, ns);
+                               *size = of_read_number(prop + na, ns);
                        if (flags)
                                *flags = bus->get_flags(prop);
                        return prop;
@@ -484,7 +476,7 @@ u32 *of_get_pci_address(struct device_node *dev, int bar_no, u64 *size,
        for (i = 0; psize >= onesize; psize -= onesize, prop += onesize, i++)
                if ((prop[0] & 0xff) == ((bar_no * 4) + PCI_BASE_ADDRESS_0)) {
                        if (size)
-                               *size = of_read_addr(prop + na, ns);
+                               *size = of_read_number(prop + na, ns);
                        if (flags)
                                *flags = bus->get_flags(prop);
                        return prop;
@@ -565,11 +557,414 @@ void of_parse_dma_window(struct device_node *dn, unsigned char *dma_window_prop,
                prop = get_property(dn, "#address-cells", NULL);
 
        cells = prop ? *(u32 *)prop : prom_n_addr_cells(dn);
-       *phys = of_read_addr(dma_window, cells);
+       *phys = of_read_number(dma_window, cells);
 
        dma_window += cells;
 
        prop = get_property(dn, "ibm,#dma-size-cells", NULL);
        cells = prop ? *(u32 *)prop : prom_n_size_cells(dn);
-       *size = of_read_addr(dma_window, cells);
+       *size = of_read_number(dma_window, cells);
+}
+
+/*
+ * Interrupt remapper
+ */
+
+static unsigned int of_irq_workarounds;
+static struct device_node *of_irq_dflt_pic;
+
+static struct device_node *of_irq_find_parent(struct device_node *child)
+{
+       struct device_node *p;
+       phandle *parp;
+
+       if (!of_node_get(child))
+               return NULL;
+
+       do {
+               parp = (phandle *)get_property(child, "interrupt-parent", NULL);
+               if (parp == NULL)
+                       p = of_get_parent(child);
+               else {
+                       if (of_irq_workarounds & OF_IMAP_NO_PHANDLE)
+                               p = of_node_get(of_irq_dflt_pic);
+                       else
+                               p = of_find_node_by_phandle(*parp);
+               }
+               of_node_put(child);
+               child = p;
+       } while (p && get_property(p, "#interrupt-cells", NULL) == NULL);
+
+       return p;
+}
+
+static u8 of_irq_pci_swizzle(u8 slot, u8 pin)
+{
+       return (((pin - 1) + slot) % 4) + 1;
 }
+
+/* This doesn't need to be called if you don't have any special workaround
+ * flags to pass
+ */
+void of_irq_map_init(unsigned int flags)
+{
+       of_irq_workarounds = flags;
+
+       /* OldWorld, don't bother looking at other things */
+       if (flags & OF_IMAP_OLDWORLD_MAC)
+               return;
+
+       /* If we don't have phandles, let's try to locate a default interrupt
+        * controller (happens when booting with BootX). We do a first match
+        * here, hopefully, that only ever happens on machines with one
+        * controller.
+        */
+       if (flags & OF_IMAP_NO_PHANDLE) {
+               struct device_node *np;
+
+               for(np = NULL; (np = of_find_all_nodes(np)) != NULL;) {
+                       if (get_property(np, "interrupt-controller", NULL)
+                           == NULL)
+                               continue;
+                       /* Skip /chosen/interrupt-controller */
+                       if (strcmp(np->name, "chosen") == 0)
+                               continue;
+                       /* It seems like at least one person on this planet wants
+                        * to use BootX on a machine with an AppleKiwi controller
+                        * which happens to pretend to be an interrupt
+                        * controller too.
+                        */
+                       if (strcmp(np->name, "AppleKiwi") == 0)
+                               continue;
+                       /* I think we found one ! */
+                       of_irq_dflt_pic = np;
+                       break;
+               }
+       }
+
+}
+
+int of_irq_map_raw(struct device_node *parent, u32 *intspec, u32 *addr,
+                  struct of_irq *out_irq)
+{
+       struct device_node *ipar, *tnode, *old = NULL, *newpar = NULL;
+       u32 *tmp, *imap, *imask;
+       u32 intsize = 1, addrsize, newintsize = 0, newaddrsize = 0;
+       int imaplen, match, i;
+
+       ipar = of_node_get(parent);
+
+       /* First get the #interrupt-cells property of the current cursor
+        * that tells us how to interpret the passed-in intspec. If there
+        * is none, we are nice and just walk up the tree
+        */
+       do {
+               tmp = (u32 *)get_property(ipar, "#interrupt-cells", NULL);
+               if (tmp != NULL) {
+                       intsize = *tmp;
+                       break;
+               }
+               tnode = ipar;
+               ipar = of_irq_find_parent(ipar);
+               of_node_put(tnode);
+       } while (ipar);
+       if (ipar == NULL) {
+               DBG(" -> no parent found !\n");
+               goto fail;
+       }
+
+       DBG("of_irq_map_raw: ipar=%s, size=%d\n", ipar->full_name, intsize);
+
+       /* Look for this #address-cells. We have to implement the old linux
+        * trick of looking for the parent here as some device-trees rely on it
+        */
+       old = of_node_get(ipar);
+       do {
+               tmp = (u32 *)get_property(old, "#address-cells", NULL);
+               tnode = of_get_parent(old);
+               of_node_put(old);
+               old = tnode;
+       } while(old && tmp == NULL);
+       of_node_put(old);
+       old = NULL;
+       addrsize = (tmp == NULL) ? 2 : *tmp;
+
+       DBG(" -> addrsize=%d\n", addrsize);
+
+       /* Now start the actual "proper" walk of the interrupt tree */
+       while (ipar != NULL) {
+               /* Now check if cursor is an interrupt-controller and if it is
+                * then we are done
+                */
+               if (get_property(ipar, "interrupt-controller", NULL) != NULL) {
+                       DBG(" -> got it !\n");
+                       memcpy(out_irq->specifier, intspec,
+                              intsize * sizeof(u32));
+                       out_irq->size = intsize;
+                       out_irq->controller = ipar;
+                       of_node_put(old);
+                       return 0;
+               }
+
+               /* Now look for an interrupt-map */
+               imap = (u32 *)get_property(ipar, "interrupt-map", &imaplen);
+               /* No interrupt map, check for an interrupt parent */
+               if (imap == NULL) {
+                       DBG(" -> no map, getting parent\n");
+                       newpar = of_irq_find_parent(ipar);
+                       goto skiplevel;
+               }
+               imaplen /= sizeof(u32);
+
+               /* Look for a mask */
+               imask = (u32 *)get_property(ipar, "interrupt-map-mask", NULL);
+
+               /* If we were passed no "reg" property and we attempt to parse
+                * an interrupt-map, then #address-cells must be 0.
+                * Fail if it's not.
+                */
+               if (addr == NULL && addrsize != 0) {
+                       DBG(" -> no reg passed in when needed !\n");
+                       goto fail;
+               }
+
+               /* Parse interrupt-map */
+               match = 0;
+               while (imaplen > (addrsize + intsize + 1) && !match) {
+                       /* Compare specifiers */
+                       match = 1;
+                       for (i = 0; i < addrsize && match; ++i) {
+                               u32 mask = imask ? imask[i] : 0xffffffffu;
+                               match = ((addr[i] ^ imap[i]) & mask) == 0;
+                       }
+                       for (; i < (addrsize + intsize) && match; ++i) {
+                               u32 mask = imask ? imask[i] : 0xffffffffu;
+                               match =
+                                  ((intspec[i-addrsize] ^ imap[i]) & mask) == 0;
+                       }
+                       imap += addrsize + intsize;
+                       imaplen -= addrsize + intsize;
+
+                       DBG(" -> match=%d (imaplen=%d)\n", match, imaplen);
+
+                       /* Get the interrupt parent */
+                       if (of_irq_workarounds & OF_IMAP_NO_PHANDLE)
+                               newpar = of_node_get(of_irq_dflt_pic);
+                       else
+                               newpar = of_find_node_by_phandle((phandle)*imap);
+                       imap++;
+                       --imaplen;
+
+                       /* Check if not found */
+                       if (newpar == NULL) {
+                               DBG(" -> imap parent not found !\n");
+                               goto fail;
+                       }
+
+                       /* Get #interrupt-cells and #address-cells of new
+                        * parent
+                        */
+                       tmp = (u32 *)get_property(newpar, "#interrupt-cells",
+                                                 NULL);
+                       if (tmp == NULL) {
+                               DBG(" -> parent lacks #interrupt-cells !\n");
+                               goto fail;
+                       }
+                       newintsize = *tmp;
+                       tmp = (u32 *)get_property(newpar, "#address-cells",
+                                                 NULL);
+                       newaddrsize = (tmp == NULL) ? 0 : *tmp;
+
+                       DBG(" -> newintsize=%d, newaddrsize=%d\n",
+                           newintsize, newaddrsize);
+
+                       /* Check for malformed properties */
+                       if (imaplen < (newaddrsize + newintsize))
+                               goto fail;
+
+                       imap += newaddrsize + newintsize;
+                       imaplen -= newaddrsize + newintsize;
+
+                       DBG(" -> imaplen=%d\n", imaplen);
+               }
+               if (!match)
+                       goto fail;
+
+               of_node_put(old);
+               old = of_node_get(newpar);
+               addrsize = newaddrsize;
+               intsize = newintsize;
+               intspec = imap - intsize;
+               addr = intspec - addrsize;
+
+       skiplevel:
+               /* Iterate again with new parent */
+               DBG(" -> new parent: %s\n", newpar ? newpar->full_name : "<>");
+               of_node_put(ipar);
+               ipar = newpar;
+               newpar = NULL;
+       }
+ fail:
+       of_node_put(ipar);
+       of_node_put(old);
+       of_node_put(newpar);
+
+       return -EINVAL;
+}
+EXPORT_SYMBOL_GPL(of_irq_map_raw);
+
+#if defined(CONFIG_PPC_PMAC) && defined(CONFIG_PPC32)
+static int of_irq_map_oldworld(struct device_node *device, int index,
+                              struct of_irq *out_irq)
+{
+       u32 *ints;
+       int intlen;
+
+       /*
+        * Old machines just have a list of interrupt numbers
+        * and no interrupt-controller nodes.
+        */
+       ints = (u32 *) get_property(device, "AAPL,interrupts", &intlen);
+       if (ints == NULL)
+               return -EINVAL;
+       intlen /= sizeof(u32);
+
+       if (index >= intlen)
+               return -EINVAL;
+
+       out_irq->controller = NULL;
+       out_irq->specifier[0] = ints[index];
+       out_irq->size = 1;
+
+       return 0;
+}
+#else /* defined(CONFIG_PPC_PMAC) && defined(CONFIG_PPC32) */
+static int of_irq_map_oldworld(struct device_node *device, int index,
+                              struct of_irq *out_irq)
+{
+       return -EINVAL;
+}
+#endif /* !(defined(CONFIG_PPC_PMAC) && defined(CONFIG_PPC32)) */
+
+int of_irq_map_one(struct device_node *device, int index, struct of_irq *out_irq)
+{
+       struct device_node *p;
+       u32 *intspec, *tmp, intsize, intlen, *addr;
+       int res;
+
+       DBG("of_irq_map_one: dev=%s, index=%d\n", device->full_name, index);
+
+       /* OldWorld mac stuff is "special", handle out of line */
+       if (of_irq_workarounds & OF_IMAP_OLDWORLD_MAC)
+               return of_irq_map_oldworld(device, index, out_irq);
+
+       /* Get the interrupts property */
+       intspec = (u32 *)get_property(device, "interrupts", &intlen);
+       if (intspec == NULL)
+               return -EINVAL;
+       intlen /= sizeof(u32);
+
+       /* Get the reg property (if any) */
+       addr = (u32 *)get_property(device, "reg", NULL);
+
+       /* Look for the interrupt parent. */
+       p = of_irq_find_parent(device);
+       if (p == NULL)
+               return -EINVAL;
+
+       /* Get size of interrupt specifier */
+       tmp = (u32 *)get_property(p, "#interrupt-cells", NULL);
+       if (tmp == NULL) {
+               of_node_put(p);
+               return -EINVAL;
+       }
+       intsize = *tmp;
+
+       /* Check index */
+       if (index * intsize >= intlen)
+               return -EINVAL;
+
+       /* Get new specifier and map it */
+       res = of_irq_map_raw(p, intspec + index * intsize, addr, out_irq);
+       of_node_put(p);
+       return res;
+}
+EXPORT_SYMBOL_GPL(of_irq_map_one);
+
+int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq)
+{
+       struct device_node *dn, *ppnode;
+       struct pci_dev *ppdev;
+       u32 lspec;
+       u32 laddr[3];
+       u8 pin;
+       int rc;
+
+       /* Check if we have a device node, if yes, fallback to standard OF
+        * parsing
+        */
+       dn = pci_device_to_OF_node(pdev);
+       if (dn)
+               return of_irq_map_one(dn, 0, out_irq);
+
+       /* Ok, we don't, time to have fun. Let's start by building up an
+        * interrupt spec.  we assume #interrupt-cells is 1, which is standard
+        * for PCI. If you do different, then don't use that routine.
+        */
+       rc = pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &pin);
+       if (rc != 0)
+               return rc;
+       /* No pin, exit */
+       if (pin == 0)
+               return -ENODEV;
+
+       /* Now we walk up the PCI tree */
+       lspec = pin;
+       for (;;) {
+               /* Get the pci_dev of our parent */
+               ppdev = pdev->bus->self;
+
+               /* Ouch, it's a host bridge... */
+               if (ppdev == NULL) {
+#ifdef CONFIG_PPC64
+                       ppnode = pci_bus_to_OF_node(pdev->bus);
+#else
+                       struct pci_controller *host;
+                       host = pci_bus_to_host(pdev->bus);
+                       ppnode = host ? host->arch_data : NULL;
+#endif
+                       /* No node for host bridge ? give up */
+                       if (ppnode == NULL)
+                               return -EINVAL;
+               } else
+                       /* We found a P2P bridge, check if it has a node */
+                       ppnode = pci_device_to_OF_node(ppdev);
+
+               /* Ok, we have found a parent with a device-node, hand over to
+                * the OF parsing code.
+                * We build a unit address from the linux device to be used for
+                * resolution. Note that we use the linux bus number which may
+                * not match your firmware bus numbering.
+                * Fortunately, in most cases, interrupt-map-mask doesn't include
+                * the bus number as part of the matching.
+                * You should still be careful about that though if you intend
+                * to rely on this function (you ship  a firmware that doesn't
+                * create device nodes for all PCI devices).
+                */
+               if (ppnode)
+                       break;
+
+               /* We can only get here if we hit a P2P bridge with no node,
+                * let's do standard swizzling and try again
+                */
+               lspec = of_irq_pci_swizzle(PCI_SLOT(pdev->devfn), lspec);
+               pdev = ppdev;
+       }
+
+       laddr[0] = (pdev->bus->number << 16)
+               | (pdev->devfn << 8);
+       laddr[1]  = laddr[2] = 0;
+       return of_irq_map_raw(ppnode, &lspec, laddr, out_irq);
+}
+EXPORT_SYMBOL_GPL(of_irq_map_pci);
+
index c42a860c8d25fd9fda90122b8aa1dd32655136b7..8797ae737a7bc55eee4b4d4397cdbde8e363c0ab 100644 (file)
@@ -10,7 +10,6 @@
 #ifndef _PPC64_PTRACE_COMMON_H
 #define _PPC64_PTRACE_COMMON_H
 
-#include <linux/config.h>
 #include <asm/system.h>
 
 /*
index 5563e2e7d89c8ca934d51ce11599579c7d0baad5..dea75d73f9831eb8c5d0a539374212dfb2b6472f 100644 (file)
@@ -15,7 +15,6 @@
  * this archive for more details.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
index 826ee3d056de09c8618b8671e8684a5e1b1c3edd..9b9a230349bc8fea17ae9b247641158efd6617e1 100644 (file)
@@ -17,7 +17,6 @@
  * this archive for more details.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
index 6eb7e49b394ae7e0302456cfc18486d95a656bf0..cda0226573243d12c141473f3f09f681905be197 100644 (file)
@@ -297,19 +297,9 @@ unsigned long __init find_and_init_phbs(void)
        struct device_node *node;
        struct pci_controller *phb;
        unsigned int index;
-       unsigned int root_size_cells = 0;
-       unsigned int *opprop = NULL;
        struct device_node *root = of_find_node_by_path("/");
 
-       if (ppc64_interrupt_controller == IC_OPEN_PIC) {
-               opprop = (unsigned int *)get_property(root,
-                               "platform-open-pic", NULL);
-       }
-
-       root_size_cells = prom_n_size_cells(root);
-
        index = 0;
-
        for (node = of_get_next_child(root, NULL);
             node != NULL;
             node = of_get_next_child(root, node)) {
@@ -324,13 +314,6 @@ unsigned long __init find_and_init_phbs(void)
                setup_phb(node, phb);
                pci_process_bridge_OF_ranges(phb, node, 0);
                pci_setup_phb_io(phb, index == 0);
-#ifdef CONFIG_PPC_PSERIES
-               /* XXX This code need serious fixing ... --BenH */
-               if (ppc64_interrupt_controller == IC_OPEN_PIC && pSeries_mpic) {
-                       int addr = root_size_cells * (index + 2) - 1;
-                       mpic_assign_isu(pSeries_mpic, index, opprop[addr]);
-               }
-#endif
                index++;
        }
 
index bd328123af7550ab032a0fe1f48d11cce0262624..c6d7b98af7d5b41f94cc7ccb16c8b0a85c22e3f5 100644 (file)
@@ -12,7 +12,6 @@
 
 #undef DEBUG
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/sched.h>
index 0932a62a1c9637d6834c4872f7f5bca7e2b5d11d..e0df2ba1ab9f936f397aa547e44e3a3af2a02cc5 100644 (file)
@@ -2,7 +2,6 @@
  * Common prep/pmac/chrp boot and setup code.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/sched.h>
@@ -52,7 +51,6 @@
 
 extern void bootx_init(unsigned long r4, unsigned long phys);
 
-boot_infos_t *boot_infos;
 struct ide_machdep_calls ppc_ide_md;
 
 int boot_cpuid;
@@ -241,7 +239,6 @@ void __init setup_arch(char **cmdline_p)
                ppc_md.init_early();
 
        find_legacy_serial_ports();
-       finish_device_tree();
 
        smp_setup_cpu_maps();
 
index 175539c9afa066c9b3d2b3596423b0cda5e63a0c..fd1785e4c9bbeec4607af81a10e88a95bc7ee722 100644 (file)
@@ -12,7 +12,6 @@
 
 #undef DEBUG
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/sched.h>
@@ -362,12 +361,15 @@ void __init setup_system(void)
 
        /*
         * Fill the ppc64_caches & systemcfg structures with informations
-        * retrieved from the device-tree. Need to be called before
-        * finish_device_tree() since the later requires some of the
-        * informations filled up here to properly parse the interrupt tree.
+        * retrieved from the device-tree.
         */
        initialize_cache_info();
 
+       /*
+        * Initialize irq remapping subsystem
+        */
+       irq_early_init();
+
 #ifdef CONFIG_PPC_RTAS
        /*
         * Initialize RTAS if available
@@ -394,12 +396,6 @@ void __init setup_system(void)
         */
        find_legacy_serial_ports();
 
-       /*
-        * "Finish" the device-tree, that is do the actual parsing of
-        * some of the properties like the interrupt map
-        */
-       finish_device_tree();
-
        /*
         * Initialize xmon
         */
@@ -428,8 +424,6 @@ void __init setup_system(void)
 
        printk("-----------------------------------------------------\n");
        printk("ppc64_pft_size                = 0x%lx\n", ppc64_pft_size);
-       printk("ppc64_interrupt_controller    = 0x%ld\n",
-              ppc64_interrupt_controller);
        printk("physicalMemorySize            = 0x%lx\n", lmb_phys_mem_size());
        printk("ppc64_caches.dcache_line_size = 0x%x\n",
               ppc64_caches.dline_size);
index d73b25e22fca892fd7b2f2dce8db2d94ddc0efda..320353f0926f99334aa3821d30cca981f28b4ff5 100644 (file)
@@ -17,7 +17,6 @@
  *  2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
index 6e75d7ab6d4d4757271c9bde664f4ead13724716..f72e8e823d7818458210a025538b606450e81f9e 100644 (file)
@@ -12,7 +12,6 @@
  *  2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
index 9adef3bddad41b335beb6b1188770941cd6353fd..f19e2e0e61e7b6635e69efc1b91458cf4805ebac 100644 (file)
@@ -5,7 +5,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/smp.h>
index c5d179d4f8189a5008000e6fb4e8b065be1e6213..46c56cfd1b2f9685aa69a2b4cbc879009b48c6e2 100644 (file)
@@ -17,7 +17,6 @@
 
 #undef DEBUG
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/sched.h>
index 69773cc1a85f35a39b9914d17765e5ae513a6adf..7369f9a6ad25c2c4c70132c116e18b34b7ecb9cd 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/threads.h>
 #include <asm/processor.h>
 #include <asm/page.h>
index ec274e688816d399bb16a349f1eb96a6164b48c8..2e292863e982acac45b743248300d2820d73cbb7 100644 (file)
@@ -14,7 +14,6 @@
  *      2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/fs.h> 
index 4662b580efa1648939eb9e03ec932dd6b63680e2..0104350955501942833470f5a7c578d6125530cd 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/sysdev.h>
 #include <linux/cpu.h>
 #include <linux/smp.h>
index ee75ccf1a802b75831244071c828f3d7d0f6e825..579de70e0b4dc3d32f473576ee8cc125b0406a57 100644 (file)
@@ -14,7 +14,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <asm/ppc_asm.h>
 
 #ifdef CONFIG_PPC64
index 26bd8ea35a4e915e10264202cc12a6937f8c4cbf..368a4934f7eec026eb1779e17443e0a9039cf92e 100644 (file)
@@ -11,7 +11,6 @@
  * life in portables, and add a 'performance/watt' metric somewhere in /proc
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/jiffies.h>
 #include <linux/kernel.h>
index 7dd5dab789a15fadcc707d3cfdb16a924c619820..774c0a3c50191a8effd7e05d9b2b5072c3a94eba 100644 (file)
@@ -32,7 +32,6 @@
  *      2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/module.h>
 #include <linux/sched.h>
index fa6bd97b6b9d59c30fd4897dd241c53064d28339..3c668078e524fefb03c628dd1fd986d8745f092d 100644 (file)
@@ -14,7 +14,6 @@
  * This file handles the architecture-dependent parts of hardware exceptions
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index 759afd5e0d8a3c8a567c7609facb75264930a4aa..5730906b23d53e8e8ab4857e84760f8777bd2240 100644 (file)
@@ -10,7 +10,6 @@
  */
 
 #include <stdarg.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/sched.h>
 #include <linux/console.h>
index 5d29dcca523c113e62e9a6332552c145fbe01270..0835b4841dea41d8157fde5a7faa37f68a7aab12 100644 (file)
@@ -8,7 +8,6 @@
  *      as published by the Free Software Foundation; either version
  *      2 of the License, or (at your option) any later version.
  */
-#include <linux/config.h>
 #include <linux/types.h>
 #include <asm/udbg.h>
 #include <asm/io.h>
index bc3e15be308759c4026379dde0a16551c75630e6..1a7e19cdab39c37a9f0e759a6b2177744ef3a967 100644 (file)
@@ -8,7 +8,6 @@
  *  2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
index 09629aea3e4738d812280343756920edd55b0b74..9cb319992c3888dab15552977dab9dd4e0c4ec6e 100644 (file)
@@ -9,7 +9,6 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
  */
-#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/ppc_asm.h>
 #include <asm/vdso.h>
index 4709f1d9542cde4aca0bfbc1e1bffc2ceefcb3ab..dc21e891d2e71b12ebc1dfb709357689dc089fd2 100644 (file)
@@ -9,7 +9,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/ppc_asm.h>
 #include <asm/asm-offsets.h>
index 7eebff03a0415c97d831c117d1269be34988e7a3..05909f75430707677ace1f5237245f1fb27442a8 100644 (file)
@@ -10,7 +10,6 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
  */
-#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/ppc_asm.h>
 #include <asm/vdso.h>
index 0c6a37b29dde0eab7eecb80ef0a3ebf6aac3440b..68d49dd71dccfb8b2f1813b6576d7df60736479b 100644 (file)
@@ -10,7 +10,6 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
  */
-#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/ppc_asm.h>
 #include <asm/unistd.h>
index cb4ae0a5edd098491fdc2a0145a15b35f7896c22..66a36d3cc6ad13ae02173f6b41a52fba3e043086 100644 (file)
@@ -9,7 +9,6 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
  */
-#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/ppc_asm.h>
 #include <asm/vdso.h>
index 3b2dd7d0c1ebf88453cc80b8b7ae658216a20d2e..79796de1173743d20d34806609680c4967d94839 100644 (file)
@@ -9,7 +9,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/ppc_asm.h>
 #include <asm/asm-offsets.h>
index 4ee871f1cadbc776f6c5a512f74a86b27220b2d6..56e76ff5498f49fd2a5b590a8c599c1e606f41cc 100644 (file)
@@ -11,7 +11,6 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
  */
-#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/ppc_asm.h>
 #include <asm/vdso.h>
index 7479edb101b8c704452af982349b44da49bbf164..17a83fa6dc52a969f1deab043e5e45e57132ab3e 100644 (file)
@@ -10,7 +10,6 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
  */
-#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/ppc_asm.h>
 #include <asm/unistd.h>
index 9416b4ab92ec26e0328b29122bceaa6707efbae6..49ac3d6e1399a646309d3d4cdc049caedf02a721 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <asm/ppc_asm.h>
 #include <asm/reg.h>
 
index cdf5867838a6b6da14d54e173d88cc8de4390855..fad8580f9081cef38f6e6612d4de18e09047d763 100644 (file)
@@ -218,7 +218,6 @@ struct vio_dev * __devinit vio_register_device_node(struct device_node *of_node)
 {
        struct vio_dev *viodev;
        unsigned int *unit_address;
-       unsigned int *irq_p;
 
        /* we need the 'device_type' property, in order to match with drivers */
        if (of_node->type == NULL) {
@@ -243,16 +242,7 @@ struct vio_dev * __devinit vio_register_device_node(struct device_node *of_node)
 
        viodev->dev.platform_data = of_node_get(of_node);
 
-       viodev->irq = NO_IRQ;
-       irq_p = (unsigned int *)get_property(of_node, "interrupts", NULL);
-       if (irq_p) {
-               int virq = virt_irq_create_mapping(*irq_p);
-               if (virq == NO_IRQ) {
-                       printk(KERN_ERR "Unable to allocate interrupt "
-                              "number for %s\n", of_node->full_name);
-               } else
-                       viodev->irq = irq_offset_up(virq);
-       }
+       viodev->irq = irq_of_parse_and_map(of_node, 0);
 
        snprintf(viodev->dev.bus_id, BUS_ID_SIZE, "%x", *unit_address);
        viodev->name = of_node->name;
index 8b25953dc4f02022d8c939579ca7bb3bdef66777..02665a02130d1730a918f2a3f43e1f170a4bca4c 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #ifdef CONFIG_PPC64
 #include <asm/page.h>
 #define PROVIDE32(x)   PROVIDE(__unused__##x)
index bee51414812ebda0241f99983a454709e3326e8d..c657de59abca8c8dfd48417e12ecb49c3fd75c53 100644 (file)
@@ -8,7 +8,6 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
  */
-#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/cache.h>
 #include <asm/errno.h>
index 8362fa272ca58e9699c88c155c535a2e59fb4aeb..077bed7dc52b3726ae4ebd7ecb227832fd52de95 100644 (file)
@@ -12,7 +12,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/spinlock.h>
 #include <linux/module.h>
index c251d9936612916eb9f0329ebd4998d2be4ef1db..9590ba780b987c64afbe47da426b77c5964342e0 100644 (file)
@@ -10,7 +10,6 @@
  */
 #include <linux/kernel.h>
 #include <linux/ptrace.h>
-#include <linux/config.h>
 #include <asm/sstep.h>
 #include <asm/processor.h>
 
index b9ca84ed89278403058a055c37ebd0d4a3061b9e..c4c622d8e6ac253cbda0dffe6098401e7fa3fab5 100644 (file)
@@ -8,7 +8,6 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
  */
-#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/errno.h>
 #include <asm/ppc_asm.h>
index 5891534727617836c6ebfffdb958f95edf12c107..69058b2873de8d6dfd76cb9b46736cd289d2c701 100644 (file)
@@ -2,7 +2,6 @@
  * Copyright (C) 1999  Eddie C. Dost  (ecd@atecom.com)
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/sched.h>
 
index 3d79ce281b677f52eb359f6067e945706cf963c4..376829ed22110170238fc4dd9c8bf1aa028550b3 100644 (file)
@@ -24,7 +24,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index 4d006aa1a0d19c69ae7f129cb39192552e8aa705..838e09db71d97f56ca3721917dd2fd0ada843042 100644 (file)
@@ -21,7 +21,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index a0a9e1e0061e83de3ff6436faae4081ba77832c1..78a0d59903ee69d2b8ac96de20e18c17fd5f9206 100644 (file)
@@ -15,7 +15,6 @@
  *  2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index 5d581bb3aa1249fa8826fe16a648f818c3f33cae..123da03ab1186df9bb977d21e238e15c858331f5 100644 (file)
@@ -26,7 +26,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index 94255beeecd371bec3df12f5212b9fe85c9e47ec..bd68df5fa78ac083bc0479946b1085c44934f5b7 100644 (file)
@@ -21,7 +21,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <asm/reg.h>
 #include <asm/page.h>
 #include <asm/pgtable.h>
index 52e9142389598afd48061b026716b96c61a8c544..9bc0a9c2b9bcee59e6ca39fa5b9e7207dc7425b0 100644 (file)
@@ -10,7 +10,6 @@
  * described in the kernel's COPYING file.
  */
 
-#include <linux/config.h>
 #include <asm/reg.h>
 #include <asm/pgtable.h>
 #include <asm/mmu.h>
index 3cc6d68f71171f3d8953d753a7bd671c3b8fb474..1915661c2c817b65944877d4943b688cc273cc1d 100644 (file)
@@ -21,7 +21,6 @@
 #undef DEBUG
 #undef DEBUG_LOW
 
-#include <linux/config.h>
 #include <linux/spinlock.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
index b57fb3a2b7bb25767d10596f978a5ed4df985c47..0e53ca8f02fb88a4f14de9d40cf97dfc6d6d2722 100644 (file)
@@ -18,7 +18,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index d454caada265d599addca7877ced6e5f7a318e04..3ff374697e34945f15276ede561035b5aafccb3e 100644 (file)
@@ -22,7 +22,6 @@
 
 #undef DEBUG
 
-#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index 8b6f522655a62c56542629c2b7da3455ebd4b867..4b17a7359924ef5e339753194a25ab5a2b59254f 100644 (file)
@@ -10,7 +10,6 @@
  *      2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/bitops.h>
index 089d939a0b3e9829b037cc95d38e27e2180746f9..eebd8b83a6b05243f3633bbe4578b2a0e6db0355 100644 (file)
@@ -18,7 +18,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index e326e4249e1a24eb393d7c3628af9a046e43bf16..792086b01000e2ed12db55a3f48607cd4426dc17 100644 (file)
@@ -23,7 +23,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/init.h>
 
index e2051efa09c58d413d95814615c94f2d683b8b22..90a06ac02d5e5f35f44adf4366cc016b473463ee 100644 (file)
@@ -10,7 +10,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index 90628601fac73ad59a0b4c92b15b008b96a4ddd8..8fcacb0239da8a9caedd78196159cc88307628b2 100644 (file)
@@ -20,7 +20,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/types.h>
index 7b278d83739ee64614ab0651ecfbc959749a1204..b1da0316549601745d6c21e49f6fd78098e766e0 100644 (file)
@@ -22,7 +22,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index 2ed43a493b310bfcd8a31ff25654d4b02ffd8af3..7cceb2c44cb911936c40dc96ea57f0ba0accf9c7 100644 (file)
@@ -23,7 +23,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/init.h>
index 6a8bf6c6000e29428d8d69f2b559363d8f8b146a..de0c8842415cb98232b3569dc78ba8f7e4b8765e 100644 (file)
@@ -16,7 +16,6 @@
 
 #undef DEBUG
 
-#include <linux/config.h>
 #include <asm/pgtable.h>
 #include <asm/mmu.h>
 #include <asm/mmu_context.h>
index 8548dcf8ef8b35b1089c421785079a6116f932b3..dbc1abbde0381f6a821a2d87fc1b55ab0b00deda 100644 (file)
@@ -14,7 +14,6 @@
  *  2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/ppc_asm.h>
 #include <asm/asm-offsets.h>
index 691320c90b780d105da66db8fa6fbeb706e3d13b..eeeacab548e655f79f2f0ea90c86d16dd2b47ffd 100644 (file)
@@ -12,7 +12,6 @@
  *      2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <asm/pgtable.h>
 #include <asm/mmu.h>
 #include <asm/mmu_context.h>
index 02eb23e036d593eb9589313de023cdaafe31b4ef..925ff70be8ba93ed9133a1f123067ff8527e9c9f 100644 (file)
@@ -23,7 +23,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/init.h>
index e7449b068c8259cb2105522bf5f56fa0cd0da103..f6eef78efd293212dbb55966650c9a62d2a4ad89 100644 (file)
@@ -22,7 +22,6 @@
  *  2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/init.h>
index 7675e675dce1dab1e76d34bc8acf42dfd3357b64..5fe7b7faf45f1f8197148ea2533879d6474887d0 100644 (file)
@@ -16,12 +16,21 @@ config MPC834x_SYS
          3 PCI slots.  The PIBs PCI initialization is the bootloader's
          responsiblilty.
 
+config MPC834x_ITX
+       bool "Freescale MPC834x ITX"
+       select DEFAULT_UIMAGE
+       help
+         This option enables support for the MPC 834x ITX evaluation board.
+
+         Be aware that PCI initialization is the bootloader's
+         responsiblilty.
+
 endchoice
 
 config MPC834x
        bool
        select PPC_UDBG_16550
        select PPC_INDIRECT_PCI
-       default y if MPC834x_SYS
+       default y if MPC834x_SYS || MPC834x_ITX
 
 endmenu
index 5c72367441a83dbc2c2e753bc204bdcb0f30484e..9387a110d28aa4f410b9f226648c9277e0ca9b07 100644 (file)
@@ -4,3 +4,4 @@
 obj-y                          := misc.o
 obj-$(CONFIG_PCI)              += pci.o
 obj-$(CONFIG_MPC834x_SYS)      += mpc834x_sys.o
+obj-$(CONFIG_MPC834x_ITX)      += mpc834x_itx.o
index 1455bcef489258a811bf9d4b961437d35b7f13f1..f0c6df61faa9e0a025243507d68553948e78ad92 100644 (file)
@@ -9,7 +9,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c
new file mode 100644 (file)
index 0000000..b463056
--- /dev/null
@@ -0,0 +1,156 @@
+/*
+ * arch/powerpc/platforms/83xx/mpc834x_itx.c
+ *
+ * MPC834x ITX board specific routines
+ *
+ * Maintainer: Kumar Gala <galak@kernel.crashing.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.
+ */
+
+#include <linux/config.h>
+#include <linux/stddef.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/errno.h>
+#include <linux/reboot.h>
+#include <linux/pci.h>
+#include <linux/kdev_t.h>
+#include <linux/major.h>
+#include <linux/console.h>
+#include <linux/delay.h>
+#include <linux/seq_file.h>
+#include <linux/root_dev.h>
+
+#include <asm/system.h>
+#include <asm/atomic.h>
+#include <asm/time.h>
+#include <asm/io.h>
+#include <asm/machdep.h>
+#include <asm/ipic.h>
+#include <asm/bootinfo.h>
+#include <asm/irq.h>
+#include <asm/prom.h>
+#include <asm/udbg.h>
+#include <sysdev/fsl_soc.h>
+
+#include "mpc83xx.h"
+
+#include <platforms/83xx/mpc834x_sys.h>
+
+#ifndef CONFIG_PCI
+unsigned long isa_io_base = 0;
+unsigned long isa_mem_base = 0;
+#endif
+
+#ifdef CONFIG_PCI
+static int
+mpc83xx_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
+{
+       static char pci_irq_table[][4] =
+           /*
+            *      PCI IDSEL/INTPIN->INTLINE
+            *       A      B      C      D
+            */
+       {
+               {PIRQB, PIRQC, PIRQD, PIRQA},   /* idsel 0x0e */
+               {PIRQA, PIRQB, PIRQC, PIRQD},   /* idsel 0x0f */
+               {PIRQC, PIRQD, PIRQA, PIRQB},   /* idsel 0x10 */
+       };
+
+       const long min_idsel = 0x0e, max_idsel = 0x10, irqs_per_slot = 4;
+       return PCI_IRQ_TABLE_LOOKUP;
+}
+#endif                         /* CONFIG_PCI */
+
+/* ************************************************************************
+ *
+ * Setup the architecture
+ *
+ */
+static void __init mpc834x_itx_setup_arch(void)
+{
+       struct device_node *np;
+
+       if (ppc_md.progress)
+               ppc_md.progress("mpc834x_itx_setup_arch()", 0);
+
+       np = of_find_node_by_type(NULL, "cpu");
+       if (np != 0) {
+               unsigned int *fp =
+                   (int *)get_property(np, "clock-frequency", NULL);
+               if (fp != 0)
+                       loops_per_jiffy = *fp / HZ;
+               else
+                       loops_per_jiffy = 50000000 / HZ;
+               of_node_put(np);
+       }
+#ifdef CONFIG_PCI
+       for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
+               add_bridge(np);
+
+       ppc_md.pci_swizzle = common_swizzle;
+       ppc_md.pci_map_irq = mpc83xx_map_irq;
+       ppc_md.pci_exclude_device = mpc83xx_exclude_device;
+#endif
+
+#ifdef  CONFIG_ROOT_NFS
+       ROOT_DEV = Root_NFS;
+#else
+       ROOT_DEV = Root_HDA1;
+#endif
+}
+
+void __init mpc834x_itx_init_IRQ(void)
+{
+       u8 senses[8] = {
+               0,                      /* EXT 0 */
+               IRQ_SENSE_LEVEL,        /* EXT 1 */
+               IRQ_SENSE_LEVEL,        /* EXT 2 */
+               0,                      /* EXT 3 */
+#ifdef CONFIG_PCI
+               IRQ_SENSE_LEVEL,        /* EXT 4 */
+               IRQ_SENSE_LEVEL,        /* EXT 5 */
+               IRQ_SENSE_LEVEL,        /* EXT 6 */
+               IRQ_SENSE_LEVEL,        /* EXT 7 */
+#else
+               0,                      /* EXT 4 */
+               0,                      /* EXT 5 */
+               0,                      /* EXT 6 */
+               0,                      /* EXT 7 */
+#endif
+       };
+
+       ipic_init(get_immrbase() + 0x00700, 0, 0, senses, 8);
+
+       /* Initialize the default interrupt mapping priorities,
+        * in case the boot rom changed something on us.
+        */
+       ipic_set_default_priority();
+}
+
+/*
+ * Called very early, MMU is off, device-tree isn't unflattened
+ */
+static int __init mpc834x_itx_probe(void)
+{
+       /* We always match for now, eventually we should look at the flat
+          dev tree to ensure this is the board we are suppose to run on
+       */
+       return 1;
+}
+
+define_machine(mpc834x_itx) {
+       .name                   = "MPC834x ITX",
+       .probe                  = mpc834x_itx_probe,
+       .setup_arch             = mpc834x_itx_setup_arch,
+       .init_IRQ               = mpc834x_itx_init_IRQ,
+       .get_irq                = ipic_get_irq,
+       .restart                = mpc83xx_restart,
+       .time_init              = mpc83xx_time_init,
+       .calibrate_decr         = generic_calibrate_decr,
+       .progress               = udbg_progress,
+};
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.h b/arch/powerpc/platforms/83xx/mpc834x_itx.h
new file mode 100644 (file)
index 0000000..174ca4e
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * arch/powerpc/platforms/83xx/mpc834x_itx.h
+ *
+ * MPC834X ITX common board definitions
+ *
+ * Maintainer: Kumar Gala <galak@kernel.crashing.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.
+ *
+ */
+
+#ifndef __MACH_MPC83XX_ITX_H__
+#define __MACH_MPC83XX_ITX_H__
+
+#define PIRQA  MPC83xx_IRQ_EXT4
+#define PIRQB  MPC83xx_IRQ_EXT5
+#define PIRQC  MPC83xx_IRQ_EXT6
+#define PIRQD  MPC83xx_IRQ_EXT7
+
+#endif                         /* __MACH_MPC83XX_ITX_H__ */
index 7e789d2420ba41730c97916b690ee4ded43285af..3e1c16eb4a639bf8d03f63614b674500d34e087b 100644 (file)
@@ -11,7 +11,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 3baceb00fefaacde0f2929e8572e17c8b3282960..3b5e563c279f97c32544da364a64670ea10789fb 100644 (file)
@@ -9,7 +9,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index f770cadb2080ab67c197143f21fdb648064fdcb2..c0d56d2bb5a5688ef63d05daa4c2d5357955b92b 100644 (file)
@@ -17,7 +17,6 @@
 #ifndef __MACH_MPC8540ADS_H__
 #define __MACH_MPC8540ADS_H__
 
-#include <linux/config.h>
 #include <linux/initrd.h>
 
 #define BOARD_CCSRBAR          ((uint)0xe0000000)
index 5eeff370f5fcaa7084f758110c2a1f710822a5c3..06a497676c992f5a7f2ab59af3309b0c24f72f61 100644 (file)
@@ -11,7 +11,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
index 48c8849c07ca39614caf78ae02206fa1a23dfdc1..1d51f3242ab1be40b768c7505610109139e0aec8 100644 (file)
@@ -9,7 +9,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 7bff3cbc5723b1615b28a46c1e62fe91cdebaccd..9d5da7896892701baa4fd85ea2b0a27b8be26c0c 100644 (file)
@@ -1,6 +1,9 @@
 /*
  * Cell Internal Interrupt Controller
  *
+ * Copyright (C) 2006 Benjamin Herrenschmidt (benh@kernel.crashing.org)
+ *                    IBM, Corp.
+ *
  * (C) Copyright IBM Deutschland Entwicklung GmbH 2005
  *
  * Author: Arnd Bergmann <arndb@de.ibm.com>
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/module.h>
 #include <linux/percpu.h>
 #include <linux/types.h>
+#include <linux/ioport.h>
 
 #include <asm/io.h>
 #include <asm/pgtable.h>
 #include <asm/prom.h>
 #include <asm/ptrace.h>
+#include <asm/machdep.h>
 
 #include "interrupt.h"
 #include "cbe_regs.h"
 struct iic {
        struct cbe_iic_thread_regs __iomem *regs;
        u8 target_id;
+       u8 eoi_stack[16];
+       int eoi_ptr;
+       struct irq_host *host;
 };
 
 static DEFINE_PER_CPU(struct iic, iic);
+#define IIC_NODE_COUNT 2
+static struct irq_host *iic_hosts[IIC_NODE_COUNT];
 
-void iic_local_enable(void)
+/* Convert between "pending" bits and hw irq number */
+static irq_hw_number_t iic_pending_to_hwnum(struct cbe_iic_pending_bits bits)
 {
-       struct iic *iic = &__get_cpu_var(iic);
-       u64 tmp;
-
-       /*
-        * There seems to be a bug that is present in DD2.x CPUs
-        * and still only partially fixed in DD3.1.
-        * This bug causes a value written to the priority register
-        * not to make it there, resulting in a system hang unless we
-        * write it again.
-        * Masking with 0xf0 is done because the Cell BE does not
-        * implement the lower four bits of the interrupt priority,
-        * they always read back as zeroes, although future CPUs
-        * might implement different bits.
-        */
-       do {
-               out_be64(&iic->regs->prio, 0xff);
-               tmp = in_be64(&iic->regs->prio);
-       } while ((tmp & 0xf0) != 0xf0);
-}
-
-void iic_local_disable(void)
-{
-       out_be64(&__get_cpu_var(iic).regs->prio, 0x0);
-}
+       unsigned char unit = bits.source & 0xf;
 
-static unsigned int iic_startup(unsigned int irq)
-{
-       return 0;
+       if (bits.flags & CBE_IIC_IRQ_IPI)
+               return IIC_IRQ_IPI0 | (bits.prio >> 4);
+       else if (bits.class <= 3)
+               return (bits.class << 4) | unit;
+       else
+               return IIC_IRQ_INVALID;
 }
 
-static void iic_enable(unsigned int irq)
+static void iic_mask(unsigned int irq)
 {
-       iic_local_enable();
 }
 
-static void iic_disable(unsigned int irq)
+static void iic_unmask(unsigned int irq)
 {
 }
 
-static void iic_end(unsigned int irq)
+static void iic_eoi(unsigned int irq)
 {
-       iic_local_enable();
+       struct iic *iic = &__get_cpu_var(iic);
+       out_be64(&iic->regs->prio, iic->eoi_stack[--iic->eoi_ptr]);
+       BUG_ON(iic->eoi_ptr < 0);
 }
 
-static struct hw_interrupt_type iic_pic = {
+static struct irq_chip iic_chip = {
        .typename = " CELL-IIC ",
-       .startup = iic_startup,
-       .enable = iic_enable,
-       .disable = iic_disable,
-       .end = iic_end,
+       .mask = iic_mask,
+       .unmask = iic_unmask,
+       .eoi = iic_eoi,
 };
 
-static int iic_external_get_irq(struct cbe_iic_pending_bits pending)
-{
-       int irq;
-       unsigned char node, unit;
-
-       node = pending.source >> 4;
-       unit = pending.source & 0xf;
-       irq = -1;
-
-       /*
-        * This mapping is specific to the Cell Broadband
-        * Engine. We might need to get the numbers
-        * from the device tree to support future CPUs.
-        */
-       switch (unit) {
-       case 0x00:
-       case 0x0b:
-               /*
-                * One of these units can be connected
-                * to an external interrupt controller.
-                */
-               if (pending.class != 2)
-                       break;
-               irq = IIC_EXT_OFFSET
-                       + spider_get_irq(node)
-                       + node * IIC_NODE_STRIDE;
-               break;
-       case 0x01 ... 0x04:
-       case 0x07 ... 0x0a:
-               /*
-                * These units are connected to the SPEs
-                */
-               if (pending.class > 2)
-                       break;
-               irq = IIC_SPE_OFFSET
-                       + pending.class * IIC_CLASS_STRIDE
-                       + node * IIC_NODE_STRIDE
-                       + unit;
-               break;
-       }
-       if (irq == -1)
-               printk(KERN_WARNING "Unexpected interrupt class %02x, "
-                       "source %02x, prio %02x, cpu %02x\n", pending.class,
-                       pending.source, pending.prio, smp_processor_id());
-       return irq;
-}
-
 /* Get an IRQ number from the pending state register of the IIC */
-int iic_get_irq(struct pt_regs *regs)
+static unsigned int iic_get_irq(struct pt_regs *regs)
 {
-       struct iic *iic;
-       int irq;
-       struct cbe_iic_pending_bits pending;
-
-       iic = &__get_cpu_var(iic);
-       *(unsigned long *) &pending = 
-               in_be64((unsigned long __iomem *) &iic->regs->pending_destr);
-
-       irq = -1;
-       if (pending.flags & CBE_IIC_IRQ_VALID) {
-               if (pending.flags & CBE_IIC_IRQ_IPI) {
-                       irq = IIC_IPI_OFFSET + (pending.prio >> 4);
-/*
-                       if (irq > 0x80)
-                               printk(KERN_WARNING "Unexpected IPI prio %02x"
-                                       "on CPU %02x\n", pending.prio,
-                                                       smp_processor_id());
-*/
-               } else {
-                       irq = iic_external_get_irq(pending);
-               }
-       }
-       return irq;
-}
-
-/* hardcoded part to be compatible with older firmware */
-
-static int setup_iic_hardcoded(void)
-{
-       struct device_node *np;
-       int nodeid, cpu;
-       unsigned long regs;
-       struct iic *iic;
-
-       for_each_possible_cpu(cpu) {
-               iic = &per_cpu(iic, cpu);
-               nodeid = cpu/2;
-
-               for (np = of_find_node_by_type(NULL, "cpu");
-                    np;
-                    np = of_find_node_by_type(np, "cpu")) {
-                       if (nodeid == *(int *)get_property(np, "node-id", NULL))
-                               break;
-                       }
-
-               if (!np) {
-                       printk(KERN_WARNING "IIC: CPU %d not found\n", cpu);
-                       iic->regs = NULL;
-                       iic->target_id = 0xff;
-                       return -ENODEV;
-                       }
-
-               regs = *(long *)get_property(np, "iic", NULL);
-
-               /* hack until we have decided on the devtree info */
-               regs += 0x400;
-               if (cpu & 1)
-                       regs += 0x20;
-
-               printk(KERN_INFO "IIC for CPU %d at %lx\n", cpu, regs);
-               iic->regs = ioremap(regs, sizeof(struct cbe_iic_thread_regs));
-               iic->target_id = (nodeid << 4) + ((cpu & 1) ? 0xf : 0xe);
-       }
-
-       return 0;
-}
-
-static int setup_iic(void)
-{
-       struct device_node *dn;
-       unsigned long *regs;
-       char *compatible;
-       unsigned *np, found = 0;
-       struct iic *iic = NULL;
-
-       for (dn = NULL; (dn = of_find_node_by_name(dn, "interrupt-controller"));) {
-               compatible = (char *)get_property(dn, "compatible", NULL);
-
-               if (!compatible) {
-                       printk(KERN_WARNING "no compatible property found !\n");
-                       continue;
-               }
-
-               if (strstr(compatible, "IBM,CBEA-Internal-Interrupt-Controller"))
-                       regs = (unsigned long *)get_property(dn,"reg", NULL);
-               else
-                       continue;
-
-               if (!regs)
-                       printk(KERN_WARNING "IIC: no reg property\n");
-
-               np = (unsigned int *)get_property(dn, "ibm,interrupt-server-ranges", NULL);
-
-               if (!np) {
-                       printk(KERN_WARNING "IIC: CPU association not found\n");
-                       iic->regs = NULL;
-                       iic->target_id = 0xff;
-                       return -ENODEV;
-               }
-
-               iic = &per_cpu(iic, np[0]);
-               iic->regs = ioremap(regs[0], sizeof(struct cbe_iic_thread_regs));
-               iic->target_id = ((np[0] & 2) << 3) + ((np[0] & 1) ? 0xf : 0xe);
-               printk("IIC for CPU %d at %lx mapped to %p\n", np[0], regs[0], iic->regs);
-
-               iic = &per_cpu(iic, np[1]);
-               iic->regs = ioremap(regs[2], sizeof(struct cbe_iic_thread_regs));
-               iic->target_id = ((np[1] & 2) << 3) + ((np[1] & 1) ? 0xf : 0xe);
-               printk("IIC for CPU %d at %lx mapped to %p\n", np[1], regs[2], iic->regs);
-
-               found++;
-       }
-
-       if (found)
-               return 0;
-       else
-               return -ENODEV;
+       struct cbe_iic_pending_bits pending;
+       struct iic *iic;
+
+       iic = &__get_cpu_var(iic);
+       *(unsigned long *) &pending =
+               in_be64((unsigned long __iomem *) &iic->regs->pending_destr);
+       iic->eoi_stack[++iic->eoi_ptr] = pending.prio;
+       BUG_ON(iic->eoi_ptr > 15);
+       if (pending.flags & CBE_IIC_IRQ_VALID)
+               return irq_linear_revmap(iic->host,
+                                        iic_pending_to_hwnum(pending));
+       return NO_IRQ;
 }
 
 #ifdef CONFIG_SMP
@@ -270,12 +108,12 @@ static int setup_iic(void)
 /* Use the highest interrupt priorities for IPI */
 static inline int iic_ipi_to_irq(int ipi)
 {
-       return IIC_IPI_OFFSET + IIC_NUM_IPIS - 1 - ipi;
+       return IIC_IRQ_IPI0 + IIC_NUM_IPIS - 1 - ipi;
 }
 
 static inline int iic_irq_to_ipi(int irq)
 {
-       return IIC_NUM_IPIS - 1 - (irq - IIC_IPI_OFFSET);
+       return IIC_NUM_IPIS - 1 - (irq - IIC_IRQ_IPI0);
 }
 
 void iic_setup_cpu(void)
@@ -294,22 +132,51 @@ u8 iic_get_target_id(int cpu)
 }
 EXPORT_SYMBOL_GPL(iic_get_target_id);
 
+struct irq_host *iic_get_irq_host(int node)
+{
+       if (node < 0 || node >= IIC_NODE_COUNT)
+               return NULL;
+       return iic_hosts[node];
+}
+EXPORT_SYMBOL_GPL(iic_get_irq_host);
+
+
 static irqreturn_t iic_ipi_action(int irq, void *dev_id, struct pt_regs *regs)
 {
-       smp_message_recv(iic_irq_to_ipi(irq), regs);
+       int ipi = (int)(long)dev_id;
+
+       smp_message_recv(ipi, regs);
+
        return IRQ_HANDLED;
 }
 
 static void iic_request_ipi(int ipi, const char *name)
 {
-       int irq;
-
-       irq = iic_ipi_to_irq(ipi);
-       /* IPIs are marked SA_INTERRUPT as they must run with irqs
-        * disabled */
-       get_irq_desc(irq)->chip = &iic_pic;
-       get_irq_desc(irq)->status |= IRQ_PER_CPU;
-       request_irq(irq, iic_ipi_action, SA_INTERRUPT, name, NULL);
+       int node, virq;
+
+       for (node = 0; node < IIC_NODE_COUNT; node++) {
+               char *rname;
+               if (iic_hosts[node] == NULL)
+                       continue;
+               virq = irq_create_mapping(iic_hosts[node],
+                                         iic_ipi_to_irq(ipi), 0);
+               if (virq == NO_IRQ) {
+                       printk(KERN_ERR
+                              "iic: failed to map IPI %s on node %d\n",
+                              name, node);
+                       continue;
+               }
+               rname = kzalloc(strlen(name) + 16, GFP_KERNEL);
+               if (rname)
+                       sprintf(rname, "%s node %d", name, node);
+               else
+                       rname = (char *)name;
+               if (request_irq(virq, iic_ipi_action, IRQF_DISABLED,
+                               rname, (void *)(long)ipi))
+                       printk(KERN_ERR
+                              "iic: failed to request IPI %s on node %d\n",
+                              name, node);
+       }
 }
 
 void iic_request_IPIs(void)
@@ -320,34 +187,119 @@ void iic_request_IPIs(void)
        iic_request_ipi(PPC_MSG_DEBUGGER_BREAK, "IPI-debug");
 #endif /* CONFIG_DEBUGGER */
 }
+
 #endif /* CONFIG_SMP */
 
-static void iic_setup_spe_handlers(void)
+
+static int iic_host_match(struct irq_host *h, struct device_node *node)
+{
+       return h->host_data != NULL && node == h->host_data;
+}
+
+static int iic_host_map(struct irq_host *h, unsigned int virq,
+                       irq_hw_number_t hw, unsigned int flags)
+{
+       if (hw < IIC_IRQ_IPI0)
+               set_irq_chip_and_handler(virq, &iic_chip, handle_fasteoi_irq);
+       else
+               set_irq_chip_and_handler(virq, &iic_chip, handle_percpu_irq);
+       return 0;
+}
+
+static int iic_host_xlate(struct irq_host *h, struct device_node *ct,
+                          u32 *intspec, unsigned int intsize,
+                          irq_hw_number_t *out_hwirq, unsigned int *out_flags)
+
+{
+       /* Currently, we don't translate anything. That needs to be fixed as
+        * we get better defined device-trees. iic interrupts have to be
+        * explicitely mapped by whoever needs them
+        */
+       return -ENODEV;
+}
+
+static struct irq_host_ops iic_host_ops = {
+       .match = iic_host_match,
+       .map = iic_host_map,
+       .xlate = iic_host_xlate,
+};
+
+static void __init init_one_iic(unsigned int hw_cpu, unsigned long addr,
+                               struct irq_host *host)
 {
-       int be, isrc;
+       /* XXX FIXME: should locate the linux CPU number from the HW cpu
+        * number properly. We are lucky for now
+        */
+       struct iic *iic = &per_cpu(iic, hw_cpu);
+
+       iic->regs = ioremap(addr, sizeof(struct cbe_iic_thread_regs));
+       BUG_ON(iic->regs == NULL);
 
-       /* Assume two threads per BE are present */
-       for (be=0; be < num_present_cpus() / 2; be++) {
-               for (isrc = 0; isrc < IIC_CLASS_STRIDE * 3; isrc++) {
-                       int irq = IIC_NODE_STRIDE * be + IIC_SPE_OFFSET + isrc;
-                       get_irq_desc(irq)->chip = &iic_pic;
+       iic->target_id = ((hw_cpu & 2) << 3) | ((hw_cpu & 1) ? 0xf : 0xe);
+       iic->eoi_stack[0] = 0xff;
+       iic->host = host;
+       out_be64(&iic->regs->prio, 0);
+
+       printk(KERN_INFO "IIC for CPU %d at %lx mapped to %p, target id 0x%x\n",
+              hw_cpu, addr, iic->regs, iic->target_id);
+}
+
+static int __init setup_iic(void)
+{
+       struct device_node *dn;
+       struct resource r0, r1;
+       struct irq_host *host;
+       int found = 0;
+       u32 *np;
+
+       for (dn = NULL;
+            (dn = of_find_node_by_name(dn,"interrupt-controller")) != NULL;) {
+               if (!device_is_compatible(dn,
+                                    "IBM,CBEA-Internal-Interrupt-Controller"))
+                       continue;
+               np = (u32 *)get_property(dn, "ibm,interrupt-server-ranges",
+                                        NULL);
+               if (np == NULL) {
+                       printk(KERN_WARNING "IIC: CPU association not found\n");
+                       of_node_put(dn);
+                       return -ENODEV;
+               }
+               if (of_address_to_resource(dn, 0, &r0) ||
+                   of_address_to_resource(dn, 1, &r1)) {
+                       printk(KERN_WARNING "IIC: Can't resolve addresses\n");
+                       of_node_put(dn);
+                       return -ENODEV;
                }
+               host = NULL;
+               if (found < IIC_NODE_COUNT) {
+                       host = irq_alloc_host(IRQ_HOST_MAP_LINEAR,
+                                             IIC_SOURCE_COUNT,
+                                             &iic_host_ops,
+                                             IIC_IRQ_INVALID);
+                       iic_hosts[found] = host;
+                       BUG_ON(iic_hosts[found] == NULL);
+                       iic_hosts[found]->host_data = of_node_get(dn);
+                       found++;
+               }
+               init_one_iic(np[0], r0.start, host);
+               init_one_iic(np[1], r1.start, host);
        }
+
+       if (found)
+               return 0;
+       else
+               return -ENODEV;
 }
 
-void iic_init_IRQ(void)
+void __init iic_init_IRQ(void)
 {
-       int cpu, irq_offset;
-       struct iic *iic;
-
+       /* Discover and initialize iics */
        if (setup_iic() < 0)
-               setup_iic_hardcoded();
+               panic("IIC: Failed to initialize !\n");
 
-       irq_offset = 0;
-       for_each_possible_cpu(cpu) {
-               iic = &per_cpu(iic, cpu);
-               if (iic->regs)
-                       out_be64(&iic->regs->prio, 0xff);
-       }
-       iic_setup_spe_handlers();
+       /* Set master interrupt handling function */
+       ppc_md.get_irq = iic_get_irq;
+
+       /* Enable on current CPU */
+       iic_setup_cpu();
 }
index 799f77d98f962199358584022b63e30699b7c118..5560a92ec3abf2779cfe7265317fa72f5939c915 100644 (file)
  */
 
 enum {
-       IIC_EXT_OFFSET   = 0x00, /* Start of south bridge IRQs */
-       IIC_NUM_EXT      = 0x40, /* Number of south bridge IRQs */
-       IIC_SPE_OFFSET   = 0x40, /* Start of SPE interrupts */
-       IIC_CLASS_STRIDE = 0x10, /* SPE IRQs per class    */
-       IIC_IPI_OFFSET   = 0x70, /* Start of IPI IRQs */
-       IIC_NUM_IPIS     = 0x10, /* IRQs reserved for IPI */
-       IIC_NODE_STRIDE  = 0x80, /* Total IRQs per node   */
+       IIC_IRQ_INVALID         = 0xff,
+       IIC_IRQ_MAX             = 0x3f,
+       IIC_IRQ_EXT_IOIF0       = 0x20,
+       IIC_IRQ_EXT_IOIF1       = 0x2b,
+       IIC_IRQ_IPI0            = 0x40,
+       IIC_NUM_IPIS            = 0x10, /* IRQs reserved for IPI */
+       IIC_SOURCE_COUNT        = 0x50,
 };
 
 extern void iic_init_IRQ(void);
-extern int  iic_get_irq(struct pt_regs *regs);
 extern void iic_cause_IPI(int cpu, int mesg);
 extern void iic_request_IPIs(void);
 extern void iic_setup_cpu(void);
-extern void iic_local_enable(void);
-extern void iic_local_disable(void);
 
 extern u8 iic_get_target_id(int cpu);
+extern struct irq_host *iic_get_irq_host(int node);
 
 extern void spider_init_IRQ(void);
-extern int spider_get_irq(int node);
 
 #endif
 #endif /* ASM_CELL_PIC_H */
index 695ac4e1617e26ad1b336fe22c89d9c83eda56f7..9f2e4ed20a57d8af2af6cc76ca4586ce7e793681 100644 (file)
@@ -23,7 +23,6 @@
 
 #undef DEBUG
 
-#include <linux/config.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/percpu.h>
index 00d112f92272fcda65c20adece8499b68e6bb318..282987d6d4a2165272e3eef5ad68d15fd411a8e9 100644 (file)
@@ -14,7 +14,6 @@
  */
 #undef DEBUG
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
@@ -50,6 +49,7 @@
 #include <asm/irq.h>
 #include <asm/spu.h>
 #include <asm/spu_priv1.h>
+#include <asm/udbg.h>
 
 #include "interrupt.h"
 #include "iommu.h"
@@ -80,10 +80,22 @@ static void cell_progress(char *s, unsigned short hex)
        printk("*** %04x : %s\n", hex, s ? s : "");
 }
 
+static void __init cell_pcibios_fixup(void)
+{
+       struct pci_dev *dev = NULL;
+
+       for_each_pci_dev(dev)
+               pci_read_irq_line(dev);
+}
+
+static void __init cell_init_irq(void)
+{
+       iic_init_IRQ();
+       spider_init_IRQ();
+}
+
 static void __init cell_setup_arch(void)
 {
-       ppc_md.init_IRQ       = iic_init_IRQ;
-       ppc_md.get_irq        = iic_get_irq;
 #ifdef CONFIG_SPU_BASE
        spu_priv1_ops         = &spu_priv1_mmio_ops;
 #endif
@@ -109,7 +121,6 @@ static void __init cell_setup_arch(void)
        /* Find and initialize PCI host bridges */
        init_pci_config_tokens();
        find_and_init_phbs();
-       spider_init_IRQ();
        cbe_pervasive_init();
 #ifdef CONFIG_DUMMY_CONSOLE
        conswitchp = &dummy_con;
@@ -127,8 +138,6 @@ static void __init cell_init_early(void)
 
        cell_init_iommu();
 
-       ppc64_interrupt_controller = IC_CELL_PIC;
-
        DBG(" <- cell_init_early()\n");
 }
 
@@ -174,6 +183,8 @@ define_machine(cell) {
        .calibrate_decr         = generic_calibrate_decr,
        .check_legacy_ioport    = cell_check_legacy_ioport,
        .progress               = cell_progress,
+       .init_IRQ               = cell_init_irq,
+       .pcibios_fixup          = cell_pcibios_fixup,
 #ifdef CONFIG_KEXEC
        .machine_kexec          = default_machine_kexec,
        .machine_kexec_prepare  = default_machine_kexec_prepare,
index bdf6c5fe58c02e9346c3334041a668f646687e81..46aef064074267c7229a821c4738182808e70588 100644 (file)
@@ -14,7 +14,6 @@
 
 #undef DEBUG
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/sched.h>
index 7c3a0b6d34fdffb443ebaab6771575423a50f241..ae7ef88f1a372fce0dcdf5c730de4ab1d5aa24e3 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <linux/interrupt.h>
 #include <linux/irq.h>
+#include <linux/ioport.h>
 
 #include <asm/pgtable.h>
 #include <asm/prom.h>
@@ -56,184 +57,313 @@ enum {
        REISWAITEN      = 0x508, /* Reissue Wait Control*/
 };
 
-static void __iomem *spider_pics[4];
+#define SPIDER_CHIP_COUNT      4
+#define SPIDER_SRC_COUNT       64
+#define SPIDER_IRQ_INVALID     63
 
-static void __iomem *spider_get_pic(int irq)
-{
-       int node = irq / IIC_NODE_STRIDE;
-       irq %= IIC_NODE_STRIDE;
-
-       if (irq >= IIC_EXT_OFFSET &&
-           irq < IIC_EXT_OFFSET + IIC_NUM_EXT &&
-           spider_pics)
-               return spider_pics[node];
-       return NULL;
-}
+struct spider_pic {
+       struct irq_host         *host;
+       struct device_node      *of_node;
+       void __iomem            *regs;
+       unsigned int            node_id;
+};
+static struct spider_pic spider_pics[SPIDER_CHIP_COUNT];
 
-static int spider_get_nr(unsigned int irq)
+static struct spider_pic *spider_virq_to_pic(unsigned int virq)
 {
-       return (irq % IIC_NODE_STRIDE) - IIC_EXT_OFFSET;
+       return irq_map[virq].host->host_data;
 }
 
-static void __iomem *spider_get_irq_config(int irq)
+static void __iomem *spider_get_irq_config(struct spider_pic *pic,
+                                          unsigned int src)
 {
-       void __iomem *pic;
-       pic = spider_get_pic(irq);
-       return pic + TIR_CFGA + 8 * spider_get_nr(irq);
+       return pic->regs + TIR_CFGA + 8 * src;
 }
 
-static void spider_enable_irq(unsigned int irq)
+static void spider_unmask_irq(unsigned int virq)
 {
-       int nodeid = (irq / IIC_NODE_STRIDE) * 0x10;
-       void __iomem *cfg = spider_get_irq_config(irq);
-       irq = spider_get_nr(irq);
+       struct spider_pic *pic = spider_virq_to_pic(virq);
+       void __iomem *cfg = spider_get_irq_config(pic, irq_map[virq].hwirq);
 
-       out_be32(cfg, (in_be32(cfg) & ~0xf0)| 0x3107000eu | nodeid);
-       out_be32(cfg + 4, in_be32(cfg + 4) | 0x00020000u | irq);
+       /* We use no locking as we should be covered by the descriptor lock
+        * for access to invidual source configuration registers
+        */
+       out_be32(cfg, in_be32(cfg) | 0x30000000u);
 }
 
-static void spider_disable_irq(unsigned int irq)
+static void spider_mask_irq(unsigned int virq)
 {
-       void __iomem *cfg = spider_get_irq_config(irq);
-       irq = spider_get_nr(irq);
+       struct spider_pic *pic = spider_virq_to_pic(virq);
+       void __iomem *cfg = spider_get_irq_config(pic, irq_map[virq].hwirq);
 
+       /* We use no locking as we should be covered by the descriptor lock
+        * for access to invidual source configuration registers
+        */
        out_be32(cfg, in_be32(cfg) & ~0x30000000u);
 }
 
-static unsigned int spider_startup_irq(unsigned int irq)
+static void spider_ack_irq(unsigned int virq)
 {
-       spider_enable_irq(irq);
-       return 0;
-}
+       struct spider_pic *pic = spider_virq_to_pic(virq);
+       unsigned int src = irq_map[virq].hwirq;
 
-static void spider_shutdown_irq(unsigned int irq)
-{
-       spider_disable_irq(irq);
-}
+       /* Reset edge detection logic if necessary
+        */
+       if (get_irq_desc(virq)->status & IRQ_LEVEL)
+               return;
 
-static void spider_end_irq(unsigned int irq)
-{
-       spider_enable_irq(irq);
-}
+       /* Only interrupts 47 to 50 can be set to edge */
+       if (src < 47 || src > 50)
+               return;
 
-static void spider_ack_irq(unsigned int irq)
-{
-       spider_disable_irq(irq);
-       iic_local_enable();
+       /* Perform the clear of the edge logic */
+       out_be32(pic->regs + TIR_EDC, 0x100 | (src & 0xf));
 }
 
-static struct hw_interrupt_type spider_pic = {
+static struct irq_chip spider_pic = {
        .typename = " SPIDER   ",
-       .startup = spider_startup_irq,
-       .shutdown = spider_shutdown_irq,
-       .enable = spider_enable_irq,
-       .disable = spider_disable_irq,
+       .unmask = spider_unmask_irq,
+       .mask = spider_mask_irq,
        .ack = spider_ack_irq,
-       .end = spider_end_irq,
 };
 
-int spider_get_irq(int node)
+static int spider_host_match(struct irq_host *h, struct device_node *node)
 {
-       unsigned long cs;
-       void __iomem *regs = spider_pics[node];
-
-       cs = in_be32(regs + TIR_CS) >> 24;
-
-       if (cs == 63)
-               return -1;
-       else
-               return cs;
+       struct spider_pic *pic = h->host_data;
+       return node == pic->of_node;
 }
 
-/* hardcoded part to be compatible with older firmware */
-
-void spider_init_IRQ_hardcoded(void)
+static int spider_host_map(struct irq_host *h, unsigned int virq,
+                       irq_hw_number_t hw, unsigned int flags)
 {
-       int node;
-       long spiderpic;
-       long pics[] = { 0x24000008000, 0x34000008000 };
-       int n;
-
-       pr_debug("%s(%d): Using hardcoded defaults\n", __FUNCTION__, __LINE__);
-
-       for (node = 0; node < num_present_cpus()/2; node++) {
-               spiderpic = pics[node];
-               printk(KERN_DEBUG "SPIDER addr: %lx\n", spiderpic);
-               spider_pics[node] = ioremap(spiderpic, 0x800);
-               for (n = 0; n < IIC_NUM_EXT; n++) {
-                       int irq = n + IIC_EXT_OFFSET + node * IIC_NODE_STRIDE;
-                       get_irq_desc(irq)->chip = &spider_pic;
-               }
-
-               /* do not mask any interrupts because of level */
-               out_be32(spider_pics[node] + TIR_MSK, 0x0);
-
-               /* disable edge detection clear */
-               /* out_be32(spider_pics[node] + TIR_EDC, 0x0); */
-
-               /* enable interrupt packets to be output */
-               out_be32(spider_pics[node] + TIR_PIEN,
-                       in_be32(spider_pics[node] + TIR_PIEN) | 0x1);
-
-               /* Enable the interrupt detection enable bit. Do this last! */
-               out_be32(spider_pics[node] + TIR_DEN,
-                       in_be32(spider_pics[node] + TIR_DEN) | 0x1);
+       unsigned int sense = flags & IRQ_TYPE_SENSE_MASK;
+       struct spider_pic *pic = h->host_data;
+       void __iomem *cfg = spider_get_irq_config(pic, hw);
+       int level = 0;
+       u32 ic;
+
+       /* Note that only level high is supported for most interrupts */
+       if (sense != IRQ_TYPE_NONE && sense != IRQ_TYPE_LEVEL_HIGH &&
+           (hw < 47 || hw > 50))
+               return -EINVAL;
+
+       /* Decode sense type */
+       switch(sense) {
+       case IRQ_TYPE_EDGE_RISING:
+               ic = 0x3;
+               break;
+       case IRQ_TYPE_EDGE_FALLING:
+               ic = 0x2;
+               break;
+       case IRQ_TYPE_LEVEL_LOW:
+               ic = 0x0;
+               level = 1;
+               break;
+       case IRQ_TYPE_LEVEL_HIGH:
+       case IRQ_TYPE_NONE:
+               ic = 0x1;
+               level = 1;
+               break;
+       default:
+               return -EINVAL;
        }
-}
 
-void spider_init_IRQ(void)
-{
-       long spider_reg;
-       struct device_node *dn;
-       char *compatible;
-       int n, node = 0;
+       /* Configure the source. One gross hack that was there before and
+        * that I've kept around is the priority to the BE which I set to
+        * be the same as the interrupt source number. I don't know wether
+        * that's supposed to make any kind of sense however, we'll have to
+        * decide that, but for now, I'm not changing the behaviour.
+        */
+       out_be32(cfg, (ic << 24) | (0x7 << 16) | (pic->node_id << 4) | 0xe);
+       out_be32(cfg + 4, (0x2 << 16) | (hw & 0xff));
+
+       if (level)
+               get_irq_desc(virq)->status |= IRQ_LEVEL;
+       set_irq_chip_and_handler(virq, &spider_pic, handle_level_irq);
+       return 0;
+}
 
-       for (dn = NULL; (dn = of_find_node_by_name(dn, "interrupt-controller"));) {
-               compatible = (char *)get_property(dn, "compatible", NULL);
+static int spider_host_xlate(struct irq_host *h, struct device_node *ct,
+                          u32 *intspec, unsigned int intsize,
+                          irq_hw_number_t *out_hwirq, unsigned int *out_flags)
 
-               if (!compatible)
-                       continue;
+{
+       /* Spider interrupts have 2 cells, first is the interrupt source,
+        * second, well, I don't know for sure yet ... We mask the top bits
+        * because old device-trees encode a node number in there
+        */
+       *out_hwirq = intspec[0] & 0x3f;
+       *out_flags = IRQ_TYPE_LEVEL_HIGH;
+       return 0;
+}
 
-               if (strstr(compatible, "CBEA,platform-spider-pic"))
-                       spider_reg = *(long *)get_property(dn,"reg", NULL);
-               else if (strstr(compatible, "sti,platform-spider-pic")) {
-                       spider_init_IRQ_hardcoded();
-                       return;
-               } else
-                       continue;
+static struct irq_host_ops spider_host_ops = {
+       .match = spider_host_match,
+       .map = spider_host_map,
+       .xlate = spider_host_xlate,
+};
 
-               if (!spider_reg)
-                       printk("interrupt controller does not have reg property !\n");
+static void spider_irq_cascade(unsigned int irq, struct irq_desc *desc,
+                              struct pt_regs *regs)
+{
+       struct spider_pic *pic = desc->handler_data;
+       unsigned int cs, virq;
 
-               n = prom_n_addr_cells(dn);
+       cs = in_be32(pic->regs + TIR_CS) >> 24;
+       if (cs == SPIDER_IRQ_INVALID)
+               virq = NO_IRQ;
+       else
+               virq = irq_linear_revmap(pic->host, cs);
+       if (virq != NO_IRQ)
+               generic_handle_irq(virq, regs);
+       desc->chip->eoi(irq);
+}
 
-               if ( n != 2)
-                       printk("reg property with invalid number of elements \n");
+/* For hooking up the cascace we have a problem. Our device-tree is
+ * crap and we don't know on which BE iic interrupt we are hooked on at
+ * least not the "standard" way. We can reconstitute it based on two
+ * informations though: which BE node we are connected to and wether
+ * we are connected to IOIF0 or IOIF1. Right now, we really only care
+ * about the IBM cell blade and we know that its firmware gives us an
+ * interrupt-map property which is pretty strange.
+ */
+static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic)
+{
+       unsigned int virq;
+       u32 *imap, *tmp;
+       int imaplen, intsize, unit;
+       struct device_node *iic;
+       struct irq_host *iic_host;
+
+#if 0 /* Enable that when we have a way to retreive the node as well */
+       /* First, we check wether we have a real "interrupts" in the device
+        * tree in case the device-tree is ever fixed
+        */
+       struct of_irq oirq;
+       if (of_irq_map_one(pic->of_node, 0, &oirq) == 0) {
+               virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
+                                            oirq.size);
+               goto bail;
+       }
+#endif
+
+       /* Now do the horrible hacks */
+       tmp = (u32 *)get_property(pic->of_node, "#interrupt-cells", NULL);
+       if (tmp == NULL)
+               return NO_IRQ;
+       intsize = *tmp;
+       imap = (u32 *)get_property(pic->of_node, "interrupt-map", &imaplen);
+       if (imap == NULL || imaplen < (intsize + 1))
+               return NO_IRQ;
+       iic = of_find_node_by_phandle(imap[intsize]);
+       if (iic == NULL)
+               return NO_IRQ;
+       imap += intsize + 1;
+       tmp = (u32 *)get_property(iic, "#interrupt-cells", NULL);
+       if (tmp == NULL)
+               return NO_IRQ;
+       intsize = *tmp;
+       /* Assume unit is last entry of interrupt specifier */
+       unit = imap[intsize - 1];
+       /* Ok, we have a unit, now let's try to get the node */
+       tmp = (u32 *)get_property(iic, "ibm,interrupt-server-ranges", NULL);
+       if (tmp == NULL) {
+               of_node_put(iic);
+               return NO_IRQ;
+       }
+       /* ugly as hell but works for now */
+       pic->node_id = (*tmp) >> 1;
+       of_node_put(iic);
+
+       /* Ok, now let's get cracking. You may ask me why I just didn't match
+        * the iic host from the iic OF node, but that way I'm still compatible
+        * with really really old old firmwares for which we don't have a node
+        */
+       iic_host = iic_get_irq_host(pic->node_id);
+       if (iic_host == NULL)
+               return NO_IRQ;
+       /* Manufacture an IIC interrupt number of class 2 */
+       virq = irq_create_mapping(iic_host, 0x20 | unit, 0);
+       if (virq == NO_IRQ)
+               printk(KERN_ERR "spider_pic: failed to map cascade !");
+       return virq;
+}
 
-               spider_pics[node] = ioremap(spider_reg, 0x800);
 
-               printk("SPIDER addr: %lx with %i addr_cells mapped to %p\n",
-                      spider_reg, n, spider_pics[node]);
+static void __init spider_init_one(struct device_node *of_node, int chip,
+                                  unsigned long addr)
+{
+       struct spider_pic *pic = &spider_pics[chip];
+       int i, virq;
+
+       /* Map registers */
+       pic->regs = ioremap(addr, 0x1000);
+       if (pic->regs == NULL)
+               panic("spider_pic: can't map registers !");
+
+       /* Allocate a host */
+       pic->host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, SPIDER_SRC_COUNT,
+                                  &spider_host_ops, SPIDER_IRQ_INVALID);
+       if (pic->host == NULL)
+               panic("spider_pic: can't allocate irq host !");
+       pic->host->host_data = pic;
+
+       /* Fill out other bits */
+       pic->of_node = of_node_get(of_node);
+
+       /* Go through all sources and disable them */
+       for (i = 0; i < SPIDER_SRC_COUNT; i++) {
+               void __iomem *cfg = pic->regs + TIR_CFGA + 8 * i;
+               out_be32(cfg, in_be32(cfg) & ~0x30000000u);
+       }
 
-               for (n = 0; n < IIC_NUM_EXT; n++) {
-                       int irq = n + IIC_EXT_OFFSET + node * IIC_NODE_STRIDE;
-                       get_irq_desc(irq)->chip = &spider_pic;
-               }
+       /* do not mask any interrupts because of level */
+       out_be32(pic->regs + TIR_MSK, 0x0);
 
-               /* do not mask any interrupts because of level */
-               out_be32(spider_pics[node] + TIR_MSK, 0x0);
+       /* enable interrupt packets to be output */
+       out_be32(pic->regs + TIR_PIEN, in_be32(pic->regs + TIR_PIEN) | 0x1);
 
-               /* disable edge detection clear */
-               /* out_be32(spider_pics[node] + TIR_EDC, 0x0); */
+       /* Hook up the cascade interrupt to the iic and nodeid */
+       virq = spider_find_cascade_and_node(pic);
+       if (virq == NO_IRQ)
+               return;
+       set_irq_data(virq, pic);
+       set_irq_chained_handler(virq, spider_irq_cascade);
 
-               /* enable interrupt packets to be output */
-               out_be32(spider_pics[node] + TIR_PIEN,
-                       in_be32(spider_pics[node] + TIR_PIEN) | 0x1);
+       printk(KERN_INFO "spider_pic: node %d, addr: 0x%lx %s\n",
+              pic->node_id, addr, of_node->full_name);
 
-               /* Enable the interrupt detection enable bit. Do this last! */
-               out_be32(spider_pics[node] + TIR_DEN,
-                       in_be32(spider_pics[node] + TIR_DEN) | 0x1);
+       /* Enable the interrupt detection enable bit. Do this last! */
+       out_be32(pic->regs + TIR_DEN, in_be32(pic->regs + TIR_DEN) | 0x1);
+}
 
-               node++;
+void __init spider_init_IRQ(void)
+{
+       struct resource r;
+       struct device_node *dn;
+       int chip = 0;
+
+       /* XXX node numbers are totally bogus. We _hope_ we get the device
+        * nodes in the right order here but that's definitely not guaranteed,
+        * we need to get the node from the device tree instead.
+        * There is currently no proper property for it (but our whole
+        * device-tree is bogus anyway) so all we can do is pray or maybe test
+        * the address and deduce the node-id
+        */
+       for (dn = NULL;
+            (dn = of_find_node_by_name(dn, "interrupt-controller"));) {
+               if (device_is_compatible(dn, "CBEA,platform-spider-pic")) {
+                       if (of_address_to_resource(dn, 0, &r)) {
+                               printk(KERN_WARNING "spider-pic: Failed\n");
+                               continue;
+                       }
+               } else if (device_is_compatible(dn, "sti,platform-spider-pic")
+                          && (chip < 2)) {
+                       static long hard_coded_pics[] =
+                               { 0x24000008000, 0x34000008000 };
+                       r.start = hard_coded_pics[chip];
+               } else
+                       continue;
+               spider_init_one(dn, chip++, r.start);
        }
 }
index b306723abb87ba2f07f3169cfed713e54dc9e152..5d2313a6c82bfafd89c22c6b0ea653aa5442919d 100644 (file)
@@ -264,51 +264,57 @@ spu_irq_class_2(int irq, void *data, struct pt_regs *regs)
        return stat ? IRQ_HANDLED : IRQ_NONE;
 }
 
-static int
-spu_request_irqs(struct spu *spu)
+static int spu_request_irqs(struct spu *spu)
 {
-       int ret;
-       int irq_base;
-
-       irq_base = IIC_NODE_STRIDE * spu->node + IIC_SPE_OFFSET;
-
-       snprintf(spu->irq_c0, sizeof (spu->irq_c0), "spe%02d.0", spu->number);
-       ret = request_irq(irq_base + spu->isrc,
-                spu_irq_class_0, SA_INTERRUPT, spu->irq_c0, spu);
-       if (ret)
-               goto out;
-
-       snprintf(spu->irq_c1, sizeof (spu->irq_c1), "spe%02d.1", spu->number);
-       ret = request_irq(irq_base + IIC_CLASS_STRIDE + spu->isrc,
-                spu_irq_class_1, SA_INTERRUPT, spu->irq_c1, spu);
-       if (ret)
-               goto out1;
+       int ret = 0;
 
-       snprintf(spu->irq_c2, sizeof (spu->irq_c2), "spe%02d.2", spu->number);
-       ret = request_irq(irq_base + 2*IIC_CLASS_STRIDE + spu->isrc,
-                spu_irq_class_2, SA_INTERRUPT, spu->irq_c2, spu);
-       if (ret)
-               goto out2;
-       goto out;
+       if (spu->irqs[0] != NO_IRQ) {
+               snprintf(spu->irq_c0, sizeof (spu->irq_c0), "spe%02d.0",
+                        spu->number);
+               ret = request_irq(spu->irqs[0], spu_irq_class_0,
+                                 IRQF_DISABLED,
+                                 spu->irq_c0, spu);
+               if (ret)
+                       goto bail0;
+       }
+       if (spu->irqs[1] != NO_IRQ) {
+               snprintf(spu->irq_c1, sizeof (spu->irq_c1), "spe%02d.1",
+                        spu->number);
+               ret = request_irq(spu->irqs[1], spu_irq_class_1,
+                                 IRQF_DISABLED,
+                                 spu->irq_c1, spu);
+               if (ret)
+                       goto bail1;
+       }
+       if (spu->irqs[2] != NO_IRQ) {
+               snprintf(spu->irq_c2, sizeof (spu->irq_c2), "spe%02d.2",
+                        spu->number);
+               ret = request_irq(spu->irqs[2], spu_irq_class_2,
+                                 IRQF_DISABLED,
+                                 spu->irq_c2, spu);
+               if (ret)
+                       goto bail2;
+       }
+       return 0;
 
-out2:
-       free_irq(irq_base + IIC_CLASS_STRIDE + spu->isrc, spu);
-out1:
-       free_irq(irq_base + spu->isrc, spu);
-out:
+bail2:
+       if (spu->irqs[1] != NO_IRQ)
+               free_irq(spu->irqs[1], spu);
+bail1:
+       if (spu->irqs[0] != NO_IRQ)
+               free_irq(spu->irqs[0], spu);
+bail0:
        return ret;
 }
 
-static void
-spu_free_irqs(struct spu *spu)
+static void spu_free_irqs(struct spu *spu)
 {
-       int irq_base;
-
-       irq_base = IIC_NODE_STRIDE * spu->node + IIC_SPE_OFFSET;
-
-       free_irq(irq_base + spu->isrc, spu);
-       free_irq(irq_base + IIC_CLASS_STRIDE + spu->isrc, spu);
-       free_irq(irq_base + 2*IIC_CLASS_STRIDE + spu->isrc, spu);
+       if (spu->irqs[0] != NO_IRQ)
+               free_irq(spu->irqs[0], spu);
+       if (spu->irqs[1] != NO_IRQ)
+               free_irq(spu->irqs[1], spu);
+       if (spu->irqs[2] != NO_IRQ)
+               free_irq(spu->irqs[2], spu);
 }
 
 static LIST_HEAD(spu_list);
@@ -559,17 +565,38 @@ static void spu_unmap(struct spu *spu)
        iounmap((u8 __iomem *)spu->local_store);
 }
 
+/* This function shall be abstracted for HV platforms */
+static int __init spu_map_interrupts(struct spu *spu, struct device_node *np)
+{
+       struct irq_host *host;
+       unsigned int isrc;
+       u32 *tmp;
+
+       host = iic_get_irq_host(spu->node);
+       if (host == NULL)
+               return -ENODEV;
+
+       /* Get the interrupt source from the device-tree */
+       tmp = (u32 *)get_property(np, "isrc", NULL);
+       if (!tmp)
+               return -ENODEV;
+       spu->isrc = isrc = tmp[0];
+
+       /* Now map interrupts of all 3 classes */
+       spu->irqs[0] = irq_create_mapping(host, 0x00 | isrc, 0);
+       spu->irqs[1] = irq_create_mapping(host, 0x10 | isrc, 0);
+       spu->irqs[2] = irq_create_mapping(host, 0x20 | isrc, 0);
+
+       /* Right now, we only fail if class 2 failed */
+       return spu->irqs[2] == NO_IRQ ? -EINVAL : 0;
+}
+
 static int __init spu_map_device(struct spu *spu, struct device_node *node)
 {
        char *prop;
        int ret;
 
        ret = -ENODEV;
-       prop = get_property(node, "isrc", NULL);
-       if (!prop)
-               goto out;
-       spu->isrc = *(unsigned int *)prop;
-
        spu->name = get_property(node, "name", NULL);
        if (!spu->name)
                goto out;
@@ -636,7 +663,8 @@ static int spu_create_sysdev(struct spu *spu)
                return ret;
        }
 
-       sysdev_create_file(&spu->sysdev, &attr_isrc);
+       if (spu->isrc != 0)
+               sysdev_create_file(&spu->sysdev, &attr_isrc);
        sysfs_add_device_to_node(&spu->sysdev, spu->nid);
 
        return 0;
@@ -668,6 +696,9 @@ static int __init create_spu(struct device_node *spe)
        spu->nid = of_node_to_nid(spe);
        if (spu->nid == -1)
                spu->nid = 0;
+       ret = spu_map_interrupts(spu, spe);
+       if (ret)
+               goto out_unmap;
        spin_lock_init(&spu->register_lock);
        spu_mfc_sdr_set(spu, mfspr(SPRN_SDR1));
        spu_mfc_sr1_set(spu, 0x33);
index f1d35ddc9df3b49a37563de6978c3f79ffd8d416..2d22cd59d6fc40ae0a617b3e4d72538aa91139b3 100644 (file)
@@ -21,7 +21,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
index ede2cac46b6d0899b76b6cd426fb9cceb764df8b..c8670f519734aab795e40d4fc8b10e247b9dccbb 100644 (file)
@@ -18,7 +18,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
index 3dcc5d8d66b96f8abd49183030837c19d13fe9da..1350294484b62e191a131daa99dbd6f8de51aab2 100644 (file)
@@ -26,7 +26,6 @@
 
 #undef DEBUG
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
index c7fea2cca5346fbbd675233bc2506fd1adc9576b..9d9d82dd32ba8d466f5794e6dfaad2685ffb2f3c 100644 (file)
@@ -32,7 +32,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
index 53515daf01b18196ab671f56b485330247833807..6802cdc3168a153bdb36a8686dc3ae64f65a587b 100644 (file)
@@ -2,7 +2,6 @@
  * CHRP pci routines.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
@@ -19,7 +18,6 @@
 #include <asm/machdep.h>
 #include <asm/sections.h>
 #include <asm/pci-bridge.h>
-#include <asm/open_pic.h>
 #include <asm/grackle.h>
 #include <asm/rtas.h>
 
@@ -162,15 +160,9 @@ void __init
 chrp_pcibios_fixup(void)
 {
        struct pci_dev *dev = NULL;
-       struct device_node *np;
 
-       /* PCI interrupts are controlled by the OpenPIC */
-       for_each_pci_dev(dev) {
-               np = pci_device_to_OF_node(dev);
-               if ((np != 0) && (np->n_intrs > 0) && (np->intrs[0].line != 0))
-                       dev->irq = np->intrs[0].line;
-               pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
-       }
+       for_each_pci_dev(dev)
+               pci_read_irq_line(dev);
 }
 
 #define PRG_CL_RESET_VALID 0x00010000
index 18d89f38796b458d9953b93672893c528b537acf..538e337d63e244ec423212c09a3eaa53a7481c3f 100644 (file)
@@ -8,7 +8,6 @@
  * bootup setup stuff..
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
@@ -25,7 +24,7 @@
 #include <linux/reboot.h>
 #include <linux/init.h>
 #include <linux/pci.h>
-#include <linux/version.h>
+#include <linux/utsrelease.h>
 #include <linux/adb.h>
 #include <linux/module.h>
 #include <linux/delay.h>
@@ -60,7 +59,7 @@ void rtas_indicator_progress(char *, unsigned short);
 int _chrp_type;
 EXPORT_SYMBOL(_chrp_type);
 
-struct mpic *chrp_mpic;
+static struct mpic *chrp_mpic;
 
 /* Used for doing CHRP event-scans */
 DEFINE_PER_CPU(struct timer_list, heartbeat_timer);
@@ -316,24 +315,32 @@ chrp_event_scan(unsigned long unused)
                  jiffies + event_scan_interval);
 }
 
+static void chrp_8259_cascade(unsigned int irq, struct irq_desc *desc,
+                             struct pt_regs *regs)
+{
+       unsigned int cascade_irq = i8259_irq(regs);
+       if (cascade_irq != NO_IRQ)
+               generic_handle_irq(cascade_irq, regs);
+       desc->chip->eoi(irq);
+}
+
 /*
  * Finds the open-pic node and sets up the mpic driver.
  */
 static void __init chrp_find_openpic(void)
 {
        struct device_node *np, *root;
-       int len, i, j, irq_count;
+       int len, i, j;
        int isu_size, idu_size;
        unsigned int *iranges, *opprop = NULL;
        int oplen = 0;
        unsigned long opaddr;
        int na = 1;
-       unsigned char init_senses[NR_IRQS - NUM_8259_INTERRUPTS];
 
-       np = find_type_devices("open-pic");
+       np = of_find_node_by_type(NULL, "open-pic");
        if (np == NULL)
                return;
-       root = find_path_device("/");
+       root = of_find_node_by_path("/");
        if (root) {
                opprop = (unsigned int *) get_property
                        (root, "platform-open-pic", &oplen);
@@ -344,19 +351,15 @@ static void __init chrp_find_openpic(void)
                oplen /= na * sizeof(unsigned int);
        } else {
                struct resource r;
-               if (of_address_to_resource(np, 0, &r))
-                       return;
+               if (of_address_to_resource(np, 0, &r)) {
+                       goto bail;
+               }
                opaddr = r.start;
                oplen = 0;
        }
 
        printk(KERN_INFO "OpenPIC at %lx\n", opaddr);
 
-       irq_count = NR_IRQS - NUM_ISA_INTERRUPTS - 4; /* leave room for IPIs */
-       prom_get_irq_senses(init_senses, NUM_ISA_INTERRUPTS, NR_IRQS - 4);
-       /* i8259 cascade is always positive level */
-       init_senses[0] = IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE;
-
        iranges = (unsigned int *) get_property(np, "interrupt-ranges", &len);
        if (iranges == NULL)
                len = 0;        /* non-distributed mpic */
@@ -383,15 +386,12 @@ static void __init chrp_find_openpic(void)
        if (len > 1)
                isu_size = iranges[3];
 
-       chrp_mpic = mpic_alloc(opaddr, MPIC_PRIMARY,
-                              isu_size, NUM_ISA_INTERRUPTS, irq_count,
-                              NR_IRQS - 4, init_senses, irq_count,
-                              " MPIC    ");
+       chrp_mpic = mpic_alloc(np, opaddr, MPIC_PRIMARY,
+                              isu_size, 0, " MPIC    ");
        if (chrp_mpic == NULL) {
                printk(KERN_ERR "Failed to allocate MPIC structure\n");
-               return;
+               goto bail;
        }
-
        j = na - 1;
        for (i = 1; i < len; ++i) {
                iranges += 2;
@@ -403,7 +403,10 @@ static void __init chrp_find_openpic(void)
        }
 
        mpic_init(chrp_mpic);
-       mpic_setup_cascade(NUM_ISA_INTERRUPTS, i8259_irq_cascade, NULL);
+       ppc_md.get_irq = mpic_get_irq;
+ bail:
+       of_node_put(root);
+       of_node_put(np);
 }
 
 #if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(XMON)
@@ -414,14 +417,34 @@ static struct irqaction xmon_irqaction = {
 };
 #endif
 
-void __init chrp_init_IRQ(void)
+static void __init chrp_find_8259(void)
 {
-       struct device_node *np;
+       struct device_node *np, *pic = NULL;
        unsigned long chrp_int_ack = 0;
-#if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(XMON)
-       struct device_node *kbd;
-#endif
+       unsigned int cascade_irq;
+
+       /* Look for cascade */
+       for_each_node_by_type(np, "interrupt-controller")
+               if (device_is_compatible(np, "chrp,iic")) {
+                       pic = np;
+                       break;
+               }
+       /* Ok, 8259 wasn't found. We need to handle the case where
+        * we have a pegasos that claims to be chrp but doesn't have
+        * a proper interrupt tree
+        */
+       if (pic == NULL && chrp_mpic != NULL) {
+               printk(KERN_ERR "i8259: Not found in device-tree"
+                      " assuming no legacy interrupts\n");
+               return;
+       }
 
+       /* Look for intack. In a perfect world, we would look for it on
+        * the ISA bus that holds the 8259 but heh... Works that way. If
+        * we ever see a problem, we can try to re-use the pSeries code here.
+        * Also, Pegasos-type platforms don't have a proper node to start
+        * from anyway
+        */
        for (np = find_devices("pci"); np != NULL; np = np->next) {
                unsigned int *addrp = (unsigned int *)
                        get_property(np, "8259-interrupt-acknowledge", NULL);
@@ -432,11 +455,29 @@ void __init chrp_init_IRQ(void)
                break;
        }
        if (np == NULL)
-               printk(KERN_ERR "Cannot find PCI interrupt acknowledge address\n");
+               printk(KERN_WARNING "Cannot find PCI interrupt acknowledge"
+                      " address, polling\n");
+
+       i8259_init(pic, chrp_int_ack);
+       if (ppc_md.get_irq == NULL)
+               ppc_md.get_irq = i8259_irq;
+       if (chrp_mpic != NULL) {
+               cascade_irq = irq_of_parse_and_map(pic, 0);
+               if (cascade_irq == NO_IRQ)
+                       printk(KERN_ERR "i8259: failed to map cascade irq\n");
+               else
+                       set_irq_chained_handler(cascade_irq,
+                                               chrp_8259_cascade);
+       }
+}
 
+void __init chrp_init_IRQ(void)
+{
+#if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(XMON)
+       struct device_node *kbd;
+#endif
        chrp_find_openpic();
-
-       i8259_init(chrp_int_ack, 0);
+       chrp_find_8259();
 
        if (_chrp_type == _CHRP_Pegasos)
                ppc_md.get_irq        = i8259_irq;
@@ -521,10 +562,6 @@ static int __init chrp_probe(void)
        DMA_MODE_READ = 0x44;
        DMA_MODE_WRITE = 0x48;
        isa_io_base = CHRP_ISA_IO_BASE;         /* default value */
-       ppc_do_canonicalize_irqs = 1;
-
-       /* Assume we have an 8259... */
-       __irq_offset_value = NUM_ISA_INTERRUPTS;
 
        return 1;
 }
@@ -536,7 +573,6 @@ define_machine(chrp) {
        .init                   = chrp_init2,
        .show_cpuinfo           = chrp_show_cpuinfo,
        .init_IRQ               = chrp_init_IRQ,
-       .get_irq                = mpic_get_irq,
        .pcibios_fixup          = chrp_pcibios_fixup,
        .restart                = rtas_restart,
        .power_off              = rtas_power_off,
index b616053bc33119d5a3b6e3523824483f7fe3aea1..1d2307e87c305b4636e8c46bab2ddaef76359cc7 100644 (file)
@@ -8,7 +8,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/smp.h>
@@ -30,7 +29,6 @@
 #include <asm/smp.h>
 #include <asm/residual.h>
 #include <asm/time.h>
-#include <asm/open_pic.h>
 #include <asm/machdep.h>
 #include <asm/smp.h>
 #include <asm/mpic.h>
index 33bb4aa0e1e819df8464376de3064b48622f76b1..2275e64f3152cc53b91c5c6b5fca9d832db4ea69 100644 (file)
@@ -23,7 +23,6 @@
  *   Created, December 13, 2000 by Wayne Holm
  * End Change Activity
  */
-#include <linux/config.h>
 #include <linux/pci.h>
 #include <linux/init.h>
 #include <linux/threads.h>
@@ -163,27 +162,6 @@ static void pci_event_handler(struct HvLpEvent *event, struct pt_regs *regs)
                printk(KERN_ERR "pci_event_handler: NULL event received\n");
 }
 
-/*
- * This is called by init_IRQ.  set in ppc_md.init_IRQ by iSeries_setup.c
- * It must be called before the bus walk.
- */
-void __init iSeries_init_IRQ(void)
-{
-       /* Register PCI event handler and open an event path */
-       int ret;
-
-       ret = HvLpEvent_registerHandler(HvLpEvent_Type_PciIo,
-                       &pci_event_handler);
-       if (ret == 0) {
-               ret = HvLpEvent_openPath(HvLpEvent_Type_PciIo, 0);
-               if (ret != 0)
-                       printk(KERN_ERR "iseries_init_IRQ: open event path "
-                                       "failed with rc 0x%x\n", ret);
-       } else
-               printk(KERN_ERR "iseries_init_IRQ: register handler "
-                               "failed with rc 0x%x\n", ret);
-}
-
 #define REAL_IRQ_TO_SUBBUS(irq)        (((irq) >> 14) & 0xff)
 #define REAL_IRQ_TO_BUS(irq)   ((((irq) >> 6) & 0xff) + 1)
 #define REAL_IRQ_TO_IDSEL(irq) ((((irq) >> 3) & 7) + 1)
@@ -197,7 +175,7 @@ static void iseries_enable_IRQ(unsigned int irq)
 {
        u32 bus, dev_id, function, mask;
        const u32 sub_bus = 0;
-       unsigned int rirq = virt_irq_to_real_map[irq];
+       unsigned int rirq = (unsigned int)irq_map[irq].hwirq;
 
        /* The IRQ has already been locked by the caller */
        bus = REAL_IRQ_TO_BUS(rirq);
@@ -214,7 +192,7 @@ static unsigned int iseries_startup_IRQ(unsigned int irq)
 {
        u32 bus, dev_id, function, mask;
        const u32 sub_bus = 0;
-       unsigned int rirq = virt_irq_to_real_map[irq];
+       unsigned int rirq = (unsigned int)irq_map[irq].hwirq;
 
        bus = REAL_IRQ_TO_BUS(rirq);
        function = REAL_IRQ_TO_FUNC(rirq);
@@ -255,7 +233,7 @@ static void iseries_shutdown_IRQ(unsigned int irq)
 {
        u32 bus, dev_id, function, mask;
        const u32 sub_bus = 0;
-       unsigned int rirq = virt_irq_to_real_map[irq];
+       unsigned int rirq = (unsigned int)irq_map[irq].hwirq;
 
        /* irq should be locked by the caller */
        bus = REAL_IRQ_TO_BUS(rirq);
@@ -278,7 +256,7 @@ static void iseries_disable_IRQ(unsigned int irq)
 {
        u32 bus, dev_id, function, mask;
        const u32 sub_bus = 0;
-       unsigned int rirq = virt_irq_to_real_map[irq];
+       unsigned int rirq = (unsigned int)irq_map[irq].hwirq;
 
        /* The IRQ has already been locked by the caller */
        bus = REAL_IRQ_TO_BUS(rirq);
@@ -292,19 +270,19 @@ static void iseries_disable_IRQ(unsigned int irq)
 
 static void iseries_end_IRQ(unsigned int irq)
 {
-       unsigned int rirq = virt_irq_to_real_map[irq];
+       unsigned int rirq = (unsigned int)irq_map[irq].hwirq;
 
        HvCallPci_eoi(REAL_IRQ_TO_BUS(rirq), REAL_IRQ_TO_SUBBUS(rirq),
                (REAL_IRQ_TO_IDSEL(rirq) << 4) + REAL_IRQ_TO_FUNC(rirq));
 }
 
-static hw_irq_controller iSeries_IRQ_handler = {
-       .typename = "iSeries irq controller",
-       .startup = iseries_startup_IRQ,
-       .shutdown = iseries_shutdown_IRQ,
-       .enable = iseries_enable_IRQ,
-       .disable = iseries_disable_IRQ,
-       .end = iseries_end_IRQ
+static struct irq_chip iseries_pic = {
+       .typename       = "iSeries irq controller",
+       .startup        = iseries_startup_IRQ,
+       .shutdown       = iseries_shutdown_IRQ,
+       .unmask         = iseries_enable_IRQ,
+       .mask           = iseries_disable_IRQ,
+       .eoi            = iseries_end_IRQ
 };
 
 /*
@@ -315,17 +293,14 @@ static hw_irq_controller iSeries_IRQ_handler = {
 int __init iSeries_allocate_IRQ(HvBusNumber bus,
                HvSubBusNumber sub_bus, u32 bsubbus)
 {
-       int virtirq;
        unsigned int realirq;
        u8 idsel = ISERIES_GET_DEVICE_FROM_SUBBUS(bsubbus);
        u8 function = ISERIES_GET_FUNCTION_FROM_SUBBUS(bsubbus);
 
        realirq = (((((sub_bus << 8) + (bus - 1)) << 3) + (idsel - 1)) << 3)
                + function;
-       virtirq = virt_irq_create_mapping(realirq);
 
-       irq_desc[virtirq].chip = &iSeries_IRQ_handler;
-       return virtirq;
+       return irq_create_mapping(NULL, realirq, IRQ_TYPE_NONE);
 }
 
 #endif /* CONFIG_PCI */
@@ -333,10 +308,9 @@ int __init iSeries_allocate_IRQ(HvBusNumber bus,
 /*
  * Get the next pending IRQ.
  */
-int iSeries_get_irq(struct pt_regs *regs)
+unsigned int iSeries_get_irq(struct pt_regs *regs)
 {
-       /* -2 means ignore this interrupt */
-       int irq = -2;
+       int irq = NO_IRQ_IGNORE;
 
 #ifdef CONFIG_SMP
        if (get_lppaca()->int_dword.fields.ipi_cnt) {
@@ -359,9 +333,57 @@ int iSeries_get_irq(struct pt_regs *regs)
                }
                spin_unlock(&pending_irqs_lock);
                if (irq >= NR_IRQS)
-                       irq = -2;
+                       irq = NO_IRQ_IGNORE;
        }
 #endif
 
        return irq;
 }
+
+static int iseries_irq_host_map(struct irq_host *h, unsigned int virq,
+                               irq_hw_number_t hw, unsigned int flags)
+{
+       set_irq_chip_and_handler(virq, &iseries_pic, handle_fasteoi_irq);
+
+       return 0;
+}
+
+static struct irq_host_ops iseries_irq_host_ops = {
+       .map = iseries_irq_host_map,
+};
+
+/*
+ * This is called by init_IRQ.  set in ppc_md.init_IRQ by iSeries_setup.c
+ * It must be called before the bus walk.
+ */
+void __init iSeries_init_IRQ(void)
+{
+       /* Register PCI event handler and open an event path */
+       struct irq_host *host;
+       int ret;
+
+       /*
+        * The Hypervisor only allows us up to 256 interrupt
+        * sources (the irq number is passed in a u8).
+        */
+       irq_set_virq_count(256);
+
+       /* Create irq host. No need for a revmap since HV will give us
+        * back our virtual irq number
+        */
+       host = irq_alloc_host(IRQ_HOST_MAP_NOMAP, 0, &iseries_irq_host_ops, 0);
+       BUG_ON(host == NULL);
+       irq_set_default_host(host);
+
+       ret = HvLpEvent_registerHandler(HvLpEvent_Type_PciIo,
+                       &pci_event_handler);
+       if (ret == 0) {
+               ret = HvLpEvent_openPath(HvLpEvent_Type_PciIo, 0);
+               if (ret != 0)
+                       printk(KERN_ERR "iseries_init_IRQ: open event path "
+                                       "failed with rc 0x%x\n", ret);
+       } else
+               printk(KERN_ERR "iseries_init_IRQ: register handler "
+                               "failed with rc 0x%x\n", ret);
+}
+
index 188aa808abd7c8941c2712f365bbf1240a96b4b2..1ee8985140e565d336f0f7d2969952502c9b92ea 100644 (file)
@@ -4,6 +4,6 @@
 extern void iSeries_init_IRQ(void);
 extern int  iSeries_allocate_IRQ(HvBusNumber, HvSubBusNumber, u32);
 extern void iSeries_activate_IRQs(void);
-extern int iSeries_get_irq(struct pt_regs *);
+extern unsigned int iSeries_get_irq(struct pt_regs *);
 
 #endif /* _ISERIES_IRQ_H */
index 438e2dba63b59526f8e0356e6be776b86c850b64..a7769445d6c701c2ec25fc386b091e1d852df89f 100644 (file)
@@ -6,7 +6,6 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
  */
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/threads.h>
 #include <linux/module.h>
index 66c77e4f8ec2441c932d30f26db8a5d1e3e209ce..c9605d773a7750f9476d8481d713959e63925f6a 100644 (file)
@@ -16,7 +16,6 @@
 
 #undef DEBUG
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/threads.h>
 #include <linux/smp.h>
@@ -295,8 +294,6 @@ static void __init iSeries_init_early(void)
 {
        DBG(" -> iSeries_init_early()\n");
 
-       ppc64_interrupt_controller = IC_ISERIES;
-
 #if defined(CONFIG_BLK_DEV_INITRD)
        /*
         * If the init RAM disk has been configured and there is
@@ -660,12 +657,6 @@ static int __init iseries_probe(void)
        powerpc_firmware_features |= FW_FEATURE_ISERIES;
        powerpc_firmware_features |= FW_FEATURE_LPAR;
 
-       /*
-        * The Hypervisor only allows us up to 256 interrupt
-        * sources (the irq number is passed in a u8).
-        */
-       virt_irq_max = 255;
-
        hpte_init_iSeries();
 
        return 1;
index 6f9d407a709f21334f1fd3be58cf2685174a2787..2eb095edb472c213f0cf8a2589a5424913572952 100644 (file)
@@ -14,7 +14,6 @@
 
 #undef DEBUG
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/sched.h>
index f7170ff86dab2d04cc1c0e7ec0b235c1684b1cee..63a1670d3bfd3bc32ef37aff7439d8dcf1572384 100644 (file)
@@ -443,18 +443,23 @@ void __init maple_pci_init(void)
 int maple_pci_get_legacy_ide_irq(struct pci_dev *pdev, int channel)
 {
        struct device_node *np;
-       int irq = channel ? 15 : 14;
+       unsigned int defirq = channel ? 15 : 14;
+       unsigned int irq;
 
        if (pdev->vendor != PCI_VENDOR_ID_AMD ||
            pdev->device != PCI_DEVICE_ID_AMD_8111_IDE)
-               return irq;
+               return defirq;
 
        np = pci_device_to_OF_node(pdev);
        if (np == NULL)
-               return irq;
-       if (np->n_intrs < 2)
-               return irq;
-       return np->intrs[channel & 0x1].line;
+               return defirq;
+       irq = irq_of_parse_and_map(np, channel & 0x1);
+       if (irq == NO_IRQ) {
+               printk("Failed to map onboard IDE interrupt for channel %d\n",
+                      channel);
+               return defirq;
+       }
+       return irq;
 }
 
 /* XXX: To remove once all firmwares are ok */
index 4e32a5417fd14897e17cf1bf69ae3fa6b5c43ed0..cb528c9de4c36fbec879871f5e1c52524eff274c 100644 (file)
@@ -11,9 +11,8 @@
  *
  */
 
-#define DEBUG
+#undef DEBUG
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
@@ -199,50 +198,81 @@ static void __init maple_init_early(void)
 {
        DBG(" -> maple_init_early\n");
 
-       /* Setup interrupt mapping options */
-       ppc64_interrupt_controller = IC_OPEN_PIC;
-
        iommu_init_early_dart();
 
        DBG(" <- maple_init_early\n");
 }
 
-
-static __init void maple_init_IRQ(void)
+/*
+ * This is almost identical to pSeries and CHRP. We need to make that
+ * code generic at one point, with appropriate bits in the device-tree to
+ * identify the presence of an HT APIC
+ */
+static void __init maple_init_IRQ(void)
 {
-       struct device_node *root;
+       struct device_node *root, *np, *mpic_node = NULL;
        unsigned int *opprop;
-       unsigned long opic_addr;
+       unsigned long openpic_addr = 0;
+       int naddr, n, i, opplen, has_isus = 0;
        struct mpic *mpic;
-       unsigned char senses[128];
-       int n;
+       unsigned int flags = MPIC_PRIMARY;
 
-       DBG(" -> maple_init_IRQ\n");
+       /* Locate MPIC in the device-tree. Note that there is a bug
+        * in Maple device-tree where the type of the controller is
+        * open-pic and not interrupt-controller
+        */
+       for_each_node_by_type(np, "open-pic") {
+               mpic_node = np;
+               break;
+       }
+       if (mpic_node == NULL) {
+               printk(KERN_ERR
+                      "Failed to locate the MPIC interrupt controller\n");
+               return;
+       }
 
-       /* XXX: Non standard, replace that with a proper openpic/mpic node
-        * in the device-tree. Find the Open PIC if present */
+       /* Find address list in /platform-open-pic */
        root = of_find_node_by_path("/");
-       opprop = (unsigned int *) get_property(root,
-                               "platform-open-pic", NULL);
-       if (opprop == 0)
-               panic("OpenPIC not found !\n");
-
-       n = prom_n_addr_cells(root);
-       for (opic_addr = 0; n > 0; --n)
-               opic_addr = (opic_addr << 32) + *opprop++;
+       naddr = prom_n_addr_cells(root);
+       opprop = (unsigned int *) get_property(root, "platform-open-pic",
+                                              &opplen);
+       if (opprop != 0) {
+               openpic_addr = of_read_number(opprop, naddr);
+               has_isus = (opplen > naddr);
+               printk(KERN_DEBUG "OpenPIC addr: %lx, has ISUs: %d\n",
+                      openpic_addr, has_isus);
+       }
        of_node_put(root);
 
-       /* Obtain sense values from device-tree */
-       prom_get_irq_senses(senses, 0, 128);
+       BUG_ON(openpic_addr == 0);
+
+       /* Check for a big endian MPIC */
+       if (get_property(np, "big-endian", NULL) != NULL)
+               flags |= MPIC_BIG_ENDIAN;
 
-       mpic = mpic_alloc(opic_addr,
-                         MPIC_PRIMARY | MPIC_BIG_ENDIAN |
-                         MPIC_BROKEN_U3 | MPIC_WANTS_RESET,
-                         0, 0, 128, 128, senses, 128, "U3-MPIC");
+       /* XXX Maple specific bits */
+       flags |= MPIC_BROKEN_U3 | MPIC_WANTS_RESET;
+
+       /* Setup the openpic driver. More device-tree junks, we hard code no
+        * ISUs for now. I'll have to revisit some stuffs with the folks doing
+        * the firmware for those
+        */
+       mpic = mpic_alloc(mpic_node, openpic_addr, flags,
+                         /*has_isus ? 16 :*/ 0, 0, " MPIC     ");
        BUG_ON(mpic == NULL);
-       mpic_init(mpic);
 
-       DBG(" <- maple_init_IRQ\n");
+       /* Add ISUs */
+       opplen /= sizeof(u32);
+       for (n = 0, i = naddr; i < opplen; i += naddr, n++) {
+               unsigned long isuaddr = of_read_number(opprop + i, naddr);
+               mpic_assign_isu(mpic, n, isuaddr);
+       }
+
+       /* All ISUs are setup, complete initialization */
+       mpic_init(mpic);
+       ppc_md.get_irq = mpic_get_irq;
+       of_node_put(mpic_node);
+       of_node_put(root);
 }
 
 static void __init maple_progress(char *s, unsigned short hex)
@@ -257,7 +287,9 @@ static void __init maple_progress(char *s, unsigned short hex)
 static int __init maple_probe(void)
 {
        unsigned long root = of_get_flat_dt_root();
-       if (!of_flat_dt_is_compatible(root, "Momentum,Maple"))
+
+       if (!of_flat_dt_is_compatible(root, "Momentum,Maple") &&
+           !of_flat_dt_is_compatible(root, "Momentum,Apache"))
                return 0;
        /*
         * On U3, the DART (iommu) must be allocated now since it
@@ -278,7 +310,6 @@ define_machine(maple_md) {
        .setup_arch             = maple_setup_arch,
        .init_early             = maple_init_early,
        .init_IRQ               = maple_init_IRQ,
-       .get_irq                = mpic_get_irq,
        .pcibios_fixup          = maple_pcibios_fixup,
        .pci_get_legacy_ide_irq = maple_pci_get_legacy_ide_irq,
        .restart                = maple_restart,
index b9a2b3d4bf3323d6a04bf7f91f6f158d01b10030..9f7579b38c72db2f5df5d80af6a493bbba80371e 100644 (file)
@@ -11,7 +11,6 @@
 
 #undef DEBUG
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index c7a27eddca6d4b96f002f2c5b5a3725933849089..69f65e215a5c8baa9fe7895542f1c84b9cf83780 100644 (file)
@@ -7,7 +7,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/fb.h>
 #include <linux/backlight.h>
index eacbfd9beabcd8c47f27ee81158f44bbc3519d85..871b002c9f90dd111963c1f2d465988647f7379a 100644 (file)
@@ -9,11 +9,10 @@
  *  2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/init.h>
-#include <linux/version.h>
+#include <linux/utsrelease.h>
 #include <asm/sections.h>
 #include <asm/prom.h>
 #include <asm/page.h>
@@ -163,6 +162,8 @@ static void __init bootx_add_chosen_props(unsigned long base,
 {
        u32 val;
 
+       bootx_dt_add_prop("linux,bootx", NULL, 0, mem_end);
+
        if (bootx_info->kernelParamsOffset) {
                char *args = (char *)((unsigned long)bootx_info) +
                        bootx_info->kernelParamsOffset;
@@ -182,8 +183,25 @@ static void __init bootx_add_chosen_props(unsigned long base,
 static void __init bootx_add_display_props(unsigned long base,
                                           unsigned long *mem_end)
 {
+       boot_infos_t *bi = bootx_info;
+       u32 tmp;
+
        bootx_dt_add_prop("linux,boot-display", NULL, 0, mem_end);
        bootx_dt_add_prop("linux,opened", NULL, 0, mem_end);
+       tmp = bi->dispDeviceDepth;
+       bootx_dt_add_prop("linux,bootx-depth", &tmp, 4, mem_end);
+       tmp = bi->dispDeviceRect[2] - bi->dispDeviceRect[0];
+       bootx_dt_add_prop("linux,bootx-width", &tmp, 4, mem_end);
+       tmp = bi->dispDeviceRect[3] - bi->dispDeviceRect[1];
+       bootx_dt_add_prop("linux,bootx-height", &tmp, 4, mem_end);
+       tmp = bi->dispDeviceRowBytes;
+       bootx_dt_add_prop("linux,bootx-linebytes", &tmp, 4, mem_end);
+       tmp = (u32)bi->dispDeviceBase;
+       if (tmp == 0)
+               tmp = (u32)bi->logicalDisplayBase;
+       tmp += bi->dispDeviceRect[1] * bi->dispDeviceRowBytes;
+       tmp += bi->dispDeviceRect[0] * ((bi->dispDeviceDepth + 7) / 8);
+       bootx_dt_add_prop("linux,bootx-addr", &tmp, 4, mem_end);
 }
 
 static void __init bootx_dt_add_string(char *s, unsigned long *mem_end)
@@ -212,7 +230,7 @@ static void __init bootx_scan_dt_build_strings(unsigned long base,
 
        if (!strcmp(namep, "/chosen")) {
                DBG(" detected /chosen ! adding properties names !\n");
-               bootx_dt_add_string("linux,platform", mem_end);
+               bootx_dt_add_string("linux,bootx", mem_end);
                bootx_dt_add_string("linux,stdout-path", mem_end);
                bootx_dt_add_string("linux,initrd-start", mem_end);
                bootx_dt_add_string("linux,initrd-end", mem_end);
@@ -223,6 +241,11 @@ static void __init bootx_scan_dt_build_strings(unsigned long base,
                DBG(" detected display ! adding properties names !\n");
                bootx_dt_add_string("linux,boot-display", mem_end);
                bootx_dt_add_string("linux,opened", mem_end);
+               bootx_dt_add_string("linux,bootx-depth", mem_end);
+               bootx_dt_add_string("linux,bootx-width", mem_end);
+               bootx_dt_add_string("linux,bootx-height", mem_end);
+               bootx_dt_add_string("linux,bootx-linebytes", mem_end);
+               bootx_dt_add_string("linux,bootx-addr", mem_end);
                strncpy(bootx_disp_path, namep, 255);
        }
 
@@ -444,7 +467,14 @@ void __init bootx_init(unsigned long r3, unsigned long r4)
        if (!BOOT_INFO_IS_V2_COMPATIBLE(bi))
                bi->logicalDisplayBase = bi->dispDeviceBase;
 
+       /* Fixup depth 16 -> 15 as that's what MacOS calls 16bpp */
+       if (bi->dispDeviceDepth == 16)
+               bi->dispDeviceDepth = 15;
+
 #ifdef CONFIG_BOOTX_TEXT
+       ptr = (unsigned long)bi->logicalDisplayBase;
+       ptr += bi->dispDeviceRect[1] * bi->dispDeviceRowBytes;
+       ptr += bi->dispDeviceRect[0] * ((bi->dispDeviceDepth + 7) / 8);
        btext_setup_display(bi->dispDeviceRect[2] - bi->dispDeviceRect[0],
                            bi->dispDeviceRect[3] - bi->dispDeviceRect[1],
                            bi->dispDeviceDepth, bi->dispDeviceRowBytes,
index fb977de6b704a88a4a27c3567bb68bc5334a84a8..6be1a4af335973cc057cec26bdb9bc6080e93cae 100644 (file)
@@ -14,7 +14,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/ppc_asm.h>
 #include <asm/cputable.h>
index af2a8f9f122214328d7733ddbe6ef80179a645ef..62926248bdb8342b665ee94f87ca3f972b57282c 100644 (file)
@@ -13,7 +13,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/errno.h>
@@ -68,7 +67,7 @@ static unsigned int cur_freq;
 static unsigned int sleep_freq;
 
 /*
- * Different models uses different mecanisms to switch the frequency
+ * Different models uses different mechanisms to switch the frequency
  */
 static int (*set_speed_proc)(int low_speed);
 static unsigned int (*get_speed_proc)(void);
@@ -268,7 +267,7 @@ static int pmu_set_cpu_speed(int low_speed)
 
        /* Make sure the decrementer won't interrupt us */
        asm volatile("mtdec %0" : : "r" (0x7fffffff));
-       /* Make sure any pending DEC interrupt occuring while we did
+       /* Make sure any pending DEC interrupt occurring while we did
         * the above didn't re-enable the DEC */
        mb();
        asm volatile("mtdec %0" : : "r" (0x7fffffff));
index b57e465a1b71d3ceb3409f6efd84a233c0c871e5..f08a14516139f5f5c042c4d4a6a1b1f8ff910a57 100644 (file)
@@ -10,7 +10,6 @@
  * that is iMac G5 and latest single CPU desktop.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/errno.h>
index 85e00cb0006ea47c400b28141dcc33b37625e529..f8313bf9a9f75aabe7d78f2215f41970756f0bc2 100644 (file)
@@ -16,7 +16,6 @@
  *   - Split split split...
  *
  */
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/delay.h>
index c896ce83d412917da2820292c32c9b6e4c32dcd1..8677f50c2586097587ade689682914ac22dfa5e5 100644 (file)
@@ -30,7 +30,6 @@
 #undef DEBUG
 #undef DEBUG_LOW
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/sched.h>
 #include <linux/init.h>
@@ -523,10 +522,11 @@ static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np)
                host->speed = KW_I2C_MODE_25KHZ;
                break;
        }       
-       if (np->n_intrs > 0)
-               host->irq = np->intrs[0].line;
-       else
-               host->irq = NO_IRQ;
+       host->irq = irq_of_parse_and_map(np, 0);
+       if (host->irq == NO_IRQ)
+               printk(KERN_WARNING
+                      "low_i2c: Failed to map interrupt for %s\n",
+                      np->full_name);
 
        host->base = ioremap((*addrp), 0x1000);
        if (host->base == NULL) {
index 262f967b880a151ca132df5d6933b01637974cec..6a36ea9bf67339d8f5e066419db811feed612dc7 100644 (file)
@@ -8,7 +8,6 @@
  *
  *  Todo: - add support for the OF persistent properties
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/stddef.h>
@@ -30,6 +29,8 @@
 #include <asm/machdep.h>
 #include <asm/nvram.h>
 
+#include "pmac.h"
+
 #define DEBUG
 
 #ifdef DEBUG
@@ -81,9 +82,6 @@ static int nvram_partitions[3];
 // XXX Turn that into a sem
 static DEFINE_SPINLOCK(nv_lock);
 
-extern int pmac_newworld;
-extern int system_running;
-
 static int (*core99_write_bank)(int bank, u8* datas);
 static int (*core99_erase_bank)(int bank);
 
index d524a915aa8646e19080d32d90b8c6292ddcefd0..556b349797e850020d1b70146c14e2cdd4921929 100644 (file)
@@ -46,6 +46,9 @@ static int has_uninorth;
 static struct pci_controller *u3_agp;
 static struct pci_controller *u4_pcie;
 static struct pci_controller *u3_ht;
+#define has_second_ohare 0
+#else
+static int has_second_ohare;
 #endif /* CONFIG_PPC64 */
 
 extern u8 pci_cache_line_size;
@@ -647,6 +650,33 @@ static void __init init_p2pbridge(void)
        early_write_config_word(hose, bus, devfn, PCI_BRIDGE_CONTROL, val);
 }
 
+static void __init init_second_ohare(void)
+{
+       struct device_node *np = of_find_node_by_name(NULL, "pci106b,7");
+       unsigned char bus, devfn;
+       unsigned short cmd;
+
+       if (np == NULL)
+               return;
+
+       /* This must run before we initialize the PICs since the second
+        * ohare hosts a PIC that will be accessed there.
+        */
+       if (pci_device_from_OF_node(np, &bus, &devfn) == 0) {
+               struct pci_controller* hose =
+                       pci_find_hose_for_OF_device(np);
+               if (!hose) {
+                       printk(KERN_ERR "Can't find PCI hose for OHare2 !\n");
+                       return;
+               }
+               early_read_config_word(hose, bus, devfn, PCI_COMMAND, &cmd);
+               cmd |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER;
+               cmd &= ~PCI_COMMAND_IO;
+               early_write_config_word(hose, bus, devfn, PCI_COMMAND, cmd);
+       }
+       has_second_ohare = 1;
+}
+
 /*
  * Some Apple desktop machines have a NEC PD720100A USB2 controller
  * on the motherboard. Open Firmware, on these, will disable the
@@ -688,9 +718,6 @@ static void __init fixup_nec_usb2(void)
                               " EHCI, fixing up...\n");
                        data &= ~1UL;
                        early_write_config_dword(hose, bus, devfn, 0xe4, data);
-                       early_write_config_byte(hose, bus,
-                                               devfn | 2, PCI_INTERRUPT_LINE,
-                               nec->intrs[0].line);
                }
        }
 }
@@ -958,32 +985,28 @@ static int __init add_bridge(struct device_node *dev)
        return 0;
 }
 
-static void __init pcibios_fixup_OF_interrupts(void)
+void __init pmac_pcibios_fixup(void)
 {
        struct pci_dev* dev = NULL;
 
-       /*
-        * Open Firmware often doesn't initialize the
-        * PCI_INTERRUPT_LINE config register properly, so we
-        * should find the device node and apply the interrupt
-        * obtained from the OF device-tree
-        */
        for_each_pci_dev(dev) {
-               struct device_node *node;
-               node = pci_device_to_OF_node(dev);
-               /* this is the node, see if it has interrupts */
-               if (node && node->n_intrs > 0)
-                       dev->irq = node->intrs[0].line;
-               pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
+               /* Read interrupt from the device-tree */
+               pci_read_irq_line(dev);
+
+               /* Fixup interrupt for the modem/ethernet combo controller.
+                * on machines with a second ohare chip.
+                * The number in the device tree (27) is bogus (correct for
+                * the ethernet-only board but not the combo ethernet/modem
+                * board). The real interrupt is 28 on the second controller
+                * -> 28+32 = 60.
+                */
+               if (has_second_ohare &&
+                   dev->vendor == PCI_VENDOR_ID_DEC &&
+                   dev->device == PCI_DEVICE_ID_DEC_TULIP_PLUS)
+                       dev->irq = irq_create_mapping(NULL, 60, 0);
        }
 }
 
-void __init pmac_pcibios_fixup(void)
-{
-       /* Fixup interrupts according to OF tree */
-       pcibios_fixup_OF_interrupts();
-}
-
 #ifdef CONFIG_PPC64
 static void __init pmac_fixup_phb_resources(void)
 {
@@ -1071,6 +1094,7 @@ void __init pmac_pci_init(void)
 
 #else /* CONFIG_PPC64 */
        init_p2pbridge();
+       init_second_ohare();
        fixup_nec_usb2();
 
        /* We are still having some issues with the Xserve G4, enabling
index a3bd3e728fa3bfa587a1cb00834d654a4afe557d..6d66359ec8c897d10e47debbed9162ab66470a7f 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/delay.h>
@@ -25,19 +24,18 @@ static irqreturn_t macio_gpio_irq(int irq, void *data, struct pt_regs *regs)
 
 static int macio_do_gpio_irq_enable(struct pmf_function *func)
 {
-       if (func->node->n_intrs < 1)
+       unsigned int irq = irq_of_parse_and_map(func->node, 0);
+       if (irq == NO_IRQ)
                return -EINVAL;
-
-       return request_irq(func->node->intrs[0].line, macio_gpio_irq, 0,
-                          func->node->name, func);
+       return request_irq(irq, macio_gpio_irq, 0, func->node->name, func);
 }
 
 static int macio_do_gpio_irq_disable(struct pmf_function *func)
 {
-       if (func->node->n_intrs < 1)
+       unsigned int irq = irq_of_parse_and_map(func->node, 0);
+       if (irq == NO_IRQ)
                return -EINVAL;
-
-       free_irq(func->node->intrs[0].line, func);
+       free_irq(irq, func);
        return 0;
 }
 
index 93e7505debc59813fb30dc82afadf96b963ef0bc..b117adbf957182251da8c1a5b4701ddc844879e8 100644 (file)
@@ -5,7 +5,6 @@
  * FIXME: LOCKING !!!
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/kernel.h>
index 9f6189af6dd6b2c5daab9fb1d5d70a3e574ee233..3d328bc1f7e019e107bc9f7522042254d1e6201d 100644 (file)
@@ -15,7 +15,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/init.h>
 #include <linux/sched.h>
@@ -66,39 +65,36 @@ static u32 level_mask[4];
 
 static DEFINE_SPINLOCK(pmac_pic_lock);
 
-#define GATWICK_IRQ_POOL_SIZE        10
-static struct interrupt_info gatwick_int_pool[GATWICK_IRQ_POOL_SIZE];
-
 #define NR_MASK_WORDS  ((NR_IRQS + 31) / 32)
 static unsigned long ppc_lost_interrupts[NR_MASK_WORDS];
+static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS];
+static int pmac_irq_cascade = -1;
+static struct irq_host *pmac_pic_host;
 
-/*
- * Mark an irq as "lost".  This is only used on the pmac
- * since it can lose interrupts (see pmac_set_irq_mask).
- * -- Cort
- */
-void __set_lost(unsigned long irq_nr, int nokick)
+static void __pmac_retrigger(unsigned int irq_nr)
 {
-       if (!test_and_set_bit(irq_nr, ppc_lost_interrupts)) {
+       if (irq_nr >= max_real_irqs && pmac_irq_cascade > 0) {
+               __set_bit(irq_nr, ppc_lost_interrupts);
+               irq_nr = pmac_irq_cascade;
+               mb();
+       }
+       if (!__test_and_set_bit(irq_nr, ppc_lost_interrupts)) {
                atomic_inc(&ppc_n_lost_interrupts);
-               if (!nokick)
-                       set_dec(1);
+               set_dec(1);
        }
 }
 
-static void pmac_mask_and_ack_irq(unsigned int irq_nr)
+static void pmac_mask_and_ack_irq(unsigned int virq)
 {
-        unsigned long bit = 1UL << (irq_nr & 0x1f);
-        int i = irq_nr >> 5;
+       unsigned int src = irq_map[virq].hwirq;
+        unsigned long bit = 1UL << (virq & 0x1f);
+        int i = virq >> 5;
         unsigned long flags;
 
-        if ((unsigned)irq_nr >= max_irqs)
-                return;
-
-        clear_bit(irq_nr, ppc_cached_irq_mask);
-        if (test_and_clear_bit(irq_nr, ppc_lost_interrupts))
-                atomic_dec(&ppc_n_lost_interrupts);
        spin_lock_irqsave(&pmac_pic_lock, flags);
+        __clear_bit(src, ppc_cached_irq_mask);
+        if (__test_and_clear_bit(src, ppc_lost_interrupts))
+                atomic_dec(&ppc_n_lost_interrupts);
         out_le32(&pmac_irq_hw[i]->enable, ppc_cached_irq_mask[i]);
         out_le32(&pmac_irq_hw[i]->ack, bit);
         do {
@@ -110,16 +106,29 @@ static void pmac_mask_and_ack_irq(unsigned int irq_nr)
        spin_unlock_irqrestore(&pmac_pic_lock, flags);
 }
 
-static void pmac_set_irq_mask(unsigned int irq_nr, int nokicklost)
+static void pmac_ack_irq(unsigned int virq)
+{
+       unsigned int src = irq_map[virq].hwirq;
+        unsigned long bit = 1UL << (src & 0x1f);
+        int i = src >> 5;
+        unsigned long flags;
+
+       spin_lock_irqsave(&pmac_pic_lock, flags);
+       if (__test_and_clear_bit(src, ppc_lost_interrupts))
+                atomic_dec(&ppc_n_lost_interrupts);
+        out_le32(&pmac_irq_hw[i]->ack, bit);
+        (void)in_le32(&pmac_irq_hw[i]->ack);
+       spin_unlock_irqrestore(&pmac_pic_lock, flags);
+}
+
+static void __pmac_set_irq_mask(unsigned int irq_nr, int nokicklost)
 {
         unsigned long bit = 1UL << (irq_nr & 0x1f);
         int i = irq_nr >> 5;
-        unsigned long flags;
 
         if ((unsigned)irq_nr >= max_irqs)
                 return;
 
-       spin_lock_irqsave(&pmac_pic_lock, flags);
         /* enable unmasked interrupts */
         out_le32(&pmac_irq_hw[i]->enable, ppc_cached_irq_mask[i]);
 
@@ -136,71 +145,78 @@ static void pmac_set_irq_mask(unsigned int irq_nr, int nokicklost)
          * the bit in the flag register or request another interrupt.
          */
         if (bit & ppc_cached_irq_mask[i] & in_le32(&pmac_irq_hw[i]->level))
-               __set_lost((ulong)irq_nr, nokicklost);
-       spin_unlock_irqrestore(&pmac_pic_lock, flags);
+               __pmac_retrigger(irq_nr);
 }
 
 /* When an irq gets requested for the first client, if it's an
  * edge interrupt, we clear any previous one on the controller
  */
-static unsigned int pmac_startup_irq(unsigned int irq_nr)
+static unsigned int pmac_startup_irq(unsigned int virq)
 {
-        unsigned long bit = 1UL << (irq_nr & 0x1f);
-        int i = irq_nr >> 5;
+       unsigned long flags;
+       unsigned int src = irq_map[virq].hwirq;
+        unsigned long bit = 1UL << (src & 0x1f);
+        int i = src >> 5;
 
-       if ((irq_desc[irq_nr].status & IRQ_LEVEL) == 0)
+       spin_lock_irqsave(&pmac_pic_lock, flags);
+       if ((irq_desc[virq].status & IRQ_LEVEL) == 0)
                out_le32(&pmac_irq_hw[i]->ack, bit);
-        set_bit(irq_nr, ppc_cached_irq_mask);
-        pmac_set_irq_mask(irq_nr, 0);
+        __set_bit(src, ppc_cached_irq_mask);
+        __pmac_set_irq_mask(src, 0);
+       spin_unlock_irqrestore(&pmac_pic_lock, flags);
 
        return 0;
 }
 
-static void pmac_mask_irq(unsigned int irq_nr)
+static void pmac_mask_irq(unsigned int virq)
 {
-        clear_bit(irq_nr, ppc_cached_irq_mask);
-        pmac_set_irq_mask(irq_nr, 0);
-        mb();
+       unsigned long flags;
+       unsigned int src = irq_map[virq].hwirq;
+
+       spin_lock_irqsave(&pmac_pic_lock, flags);
+        __clear_bit(src, ppc_cached_irq_mask);
+        __pmac_set_irq_mask(src, 0);
+       spin_unlock_irqrestore(&pmac_pic_lock, flags);
 }
 
-static void pmac_unmask_irq(unsigned int irq_nr)
+static void pmac_unmask_irq(unsigned int virq)
 {
-        set_bit(irq_nr, ppc_cached_irq_mask);
-        pmac_set_irq_mask(irq_nr, 0);
+       unsigned long flags;
+       unsigned int src = irq_map[virq].hwirq;
+
+       spin_lock_irqsave(&pmac_pic_lock, flags);
+       __set_bit(src, ppc_cached_irq_mask);
+        __pmac_set_irq_mask(src, 0);
+       spin_unlock_irqrestore(&pmac_pic_lock, flags);
 }
 
-static void pmac_end_irq(unsigned int irq_nr)
+static int pmac_retrigger(unsigned int virq)
 {
-       if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS))
-           && irq_desc[irq_nr].action) {
-               set_bit(irq_nr, ppc_cached_irq_mask);
-               pmac_set_irq_mask(irq_nr, 1);
-       }
-}
+       unsigned long flags;
 
+       spin_lock_irqsave(&pmac_pic_lock, flags);
+       __pmac_retrigger(irq_map[virq].hwirq);
+       spin_unlock_irqrestore(&pmac_pic_lock, flags);
+       return 1;
+}
 
-struct hw_interrupt_type pmac_pic = {
+static struct irq_chip pmac_pic = {
        .typename       = " PMAC-PIC ",
        .startup        = pmac_startup_irq,
-       .enable         = pmac_unmask_irq,
-       .disable        = pmac_mask_irq,
-       .ack            = pmac_mask_and_ack_irq,
-       .end            = pmac_end_irq,
-};
-
-struct hw_interrupt_type gatwick_pic = {
-       .typename       = " GATWICK  ",
-       .startup        = pmac_startup_irq,
-       .enable         = pmac_unmask_irq,
-       .disable        = pmac_mask_irq,
-       .ack            = pmac_mask_and_ack_irq,
-       .end            = pmac_end_irq,
+       .mask           = pmac_mask_irq,
+       .ack            = pmac_ack_irq,
+       .mask_ack       = pmac_mask_and_ack_irq,
+       .unmask         = pmac_unmask_irq,
+       .retrigger      = pmac_retrigger,
 };
 
 static irqreturn_t gatwick_action(int cpl, void *dev_id, struct pt_regs *regs)
 {
+       unsigned long flags;
        int irq, bits;
+       int rc = IRQ_NONE;
 
+       spin_lock_irqsave(&pmac_pic_lock, flags);
        for (irq = max_irqs; (irq -= 32) >= max_real_irqs; ) {
                int i = irq >> 5;
                bits = in_le32(&pmac_irq_hw[i]->event) | ppc_lost_interrupts[i];
@@ -210,17 +226,20 @@ static irqreturn_t gatwick_action(int cpl, void *dev_id, struct pt_regs *regs)
                if (bits == 0)
                        continue;
                irq += __ilog2(bits);
+               spin_unlock_irqrestore(&pmac_pic_lock, flags);
                __do_IRQ(irq, regs);
-               return IRQ_HANDLED;
+               spin_lock_irqsave(&pmac_pic_lock, flags);
+               rc = IRQ_HANDLED;
        }
-       printk("gatwick irq not from gatwick pic\n");
-       return IRQ_NONE;
+       spin_unlock_irqrestore(&pmac_pic_lock, flags);
+       return rc;
 }
 
-static int pmac_get_irq(struct pt_regs *regs)
+static unsigned int pmac_pic_get_irq(struct pt_regs *regs)
 {
        int irq;
        unsigned long bits = 0;
+       unsigned long flags;
 
 #ifdef CONFIG_SMP
        void psurge_smp_message_recv(struct pt_regs *);
@@ -228,9 +247,10 @@ static int pmac_get_irq(struct pt_regs *regs)
                /* IPI's are a hack on the powersurge -- Cort */
                if ( smp_processor_id() != 0 ) {
                psurge_smp_message_recv(regs);
-               return -2;      /* ignore, already handled */
+               return NO_IRQ_IGNORE;   /* ignore, already handled */
         }
 #endif /* CONFIG_SMP */
+       spin_lock_irqsave(&pmac_pic_lock, flags);
        for (irq = max_real_irqs; (irq -= 32) >= 0; ) {
                int i = irq >> 5;
                bits = in_le32(&pmac_irq_hw[i]->event) | ppc_lost_interrupts[i];
@@ -242,133 +262,10 @@ static int pmac_get_irq(struct pt_regs *regs)
                irq += __ilog2(bits);
                break;
        }
-
-       return irq;
-}
-
-/* This routine will fix some missing interrupt values in the device tree
- * on the gatwick mac-io controller used by some PowerBooks
- *
- * Walking of OF nodes could use a bit more fixing up here, but it's not
- * very important as this is all boot time code on static portions of the
- * device-tree.
- *
- * However, the modifications done to "intrs" will have to be removed and
- * replaced with proper updates of the "interrupts" properties or
- * AAPL,interrupts, yet to be decided, once the dynamic parsing is there.
- */
-static void __init pmac_fix_gatwick_interrupts(struct device_node *gw,
-                                              int irq_base)
-{
-       struct device_node *node;
-       int count;
-
-       memset(gatwick_int_pool, 0, sizeof(gatwick_int_pool));
-       count = 0;
-       for (node = NULL; (node = of_get_next_child(gw, node)) != NULL;) {
-               /* Fix SCC */
-               if ((strcasecmp(node->name, "escc") == 0) && node->child) {
-                       if (node->child->n_intrs < 3) {
-                               node->child->intrs = &gatwick_int_pool[count];
-                               count += 3;
-                       }
-                       node->child->n_intrs = 3;
-                       node->child->intrs[0].line = 15+irq_base;
-                       node->child->intrs[1].line =  4+irq_base;
-                       node->child->intrs[2].line =  5+irq_base;
-                       printk(KERN_INFO "irq: fixed SCC on gatwick"
-                              " (%d,%d,%d)\n",
-                              node->child->intrs[0].line,
-                              node->child->intrs[1].line,
-                              node->child->intrs[2].line);
-               }
-               /* Fix media-bay & left SWIM */
-               if (strcasecmp(node->name, "media-bay") == 0) {
-                       struct device_node* ya_node;
-
-                       if (node->n_intrs == 0)
-                               node->intrs = &gatwick_int_pool[count++];
-                       node->n_intrs = 1;
-                       node->intrs[0].line = 29+irq_base;
-                       printk(KERN_INFO "irq: fixed media-bay on gatwick"
-                              " (%d)\n", node->intrs[0].line);
-
-                       ya_node = node->child;
-                       while(ya_node) {
-                               if (strcasecmp(ya_node->name, "floppy") == 0) {
-                                       if (ya_node->n_intrs < 2) {
-                                               ya_node->intrs = &gatwick_int_pool[count];
-                                               count += 2;
-                                       }
-                                       ya_node->n_intrs = 2;
-                                       ya_node->intrs[0].line = 19+irq_base;
-                                       ya_node->intrs[1].line =  1+irq_base;
-                                       printk(KERN_INFO "irq: fixed floppy on second controller (%d,%d)\n",
-                                               ya_node->intrs[0].line, ya_node->intrs[1].line);
-                               }
-                               if (strcasecmp(ya_node->name, "ata4") == 0) {
-                                       if (ya_node->n_intrs < 2) {
-                                               ya_node->intrs = &gatwick_int_pool[count];
-                                               count += 2;
-                                       }
-                                       ya_node->n_intrs = 2;
-                                       ya_node->intrs[0].line = 14+irq_base;
-                                       ya_node->intrs[1].line =  3+irq_base;
-                                       printk(KERN_INFO "irq: fixed ide on second controller (%d,%d)\n",
-                                               ya_node->intrs[0].line, ya_node->intrs[1].line);
-                               }
-                               ya_node = ya_node->sibling;
-                       }
-               }
-       }
-       if (count > 10) {
-               printk("WARNING !! Gatwick interrupt pool overflow\n");
-               printk("  GATWICK_IRQ_POOL_SIZE = %d\n", GATWICK_IRQ_POOL_SIZE);
-               printk("              requested = %d\n", count);
-       }
-}
-
-/*
- * The PowerBook 3400/2400/3500 can have a combo ethernet/modem
- * card which includes an ohare chip that acts as a second interrupt
- * controller.  If we find this second ohare, set it up and fix the
- * interrupt value in the device tree for the ethernet chip.
- */
-static void __init enable_second_ohare(struct device_node *np)
-{
-       unsigned char bus, devfn;
-       unsigned short cmd;
-       struct device_node *ether;
-
-       /* This code doesn't strictly belong here, it could be part of
-        * either the PCI initialisation or the feature code. It's kept
-        * here for historical reasons.
-        */
-       if (pci_device_from_OF_node(np, &bus, &devfn) == 0) {
-               struct pci_controller* hose =
-                       pci_find_hose_for_OF_device(np);
-               if (!hose) {
-                       printk(KERN_ERR "Can't find PCI hose for OHare2 !\n");
-                       return;
-               }
-               early_read_config_word(hose, bus, devfn, PCI_COMMAND, &cmd);
-               cmd |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER;
-               cmd &= ~PCI_COMMAND_IO;
-               early_write_config_word(hose, bus, devfn, PCI_COMMAND, cmd);
-       }
-
-       /* Fix interrupt for the modem/ethernet combo controller. The number
-        * in the device tree (27) is bogus (correct for the ethernet-only
-        * board but not the combo ethernet/modem board).
-        * The real interrupt is 28 on the second controller -> 28+32 = 60.
-        */
-       ether = of_find_node_by_name(NULL, "pci1011,14");
-       if (ether && ether->n_intrs > 0) {
-               ether->intrs[0].line = 60;
-               printk(KERN_INFO "irq: Fixed ethernet IRQ to %d\n",
-                      ether->intrs[0].line);
-       }
-       of_node_put(ether);
+       spin_unlock_irqrestore(&pmac_pic_lock, flags);
+       if (unlikely(irq < 0))
+               return NO_IRQ;
+       return irq_linear_revmap(pmac_pic_host, irq);
 }
 
 #ifdef CONFIG_XMON
@@ -382,22 +279,65 @@ static struct irqaction xmon_action = {
 
 static struct irqaction gatwick_cascade_action = {
        .handler        = gatwick_action,
-       .flags          = SA_INTERRUPT,
+       .flags          = IRQF_DISABLED,
        .mask           = CPU_MASK_NONE,
        .name           = "cascade",
 };
 
+static int pmac_pic_host_match(struct irq_host *h, struct device_node *node)
+{
+       /* We match all, we don't always have a node anyway */
+       return 1;
+}
+
+static int pmac_pic_host_map(struct irq_host *h, unsigned int virq,
+                            irq_hw_number_t hw, unsigned int flags)
+{
+       struct irq_desc *desc = get_irq_desc(virq);
+       int level;
+
+       if (hw >= max_irqs)
+               return -EINVAL;
+
+       /* Mark level interrupts, set delayed disable for edge ones and set
+        * handlers
+        */
+       level = !!(level_mask[hw >> 5] & (1UL << (hw & 0x1f)));
+       if (level)
+               desc->status |= IRQ_LEVEL;
+       else
+               desc->status |= IRQ_DELAYED_DISABLE;
+       set_irq_chip_and_handler(virq, &pmac_pic, level ?
+                                handle_level_irq : handle_edge_irq);
+       return 0;
+}
+
+static int pmac_pic_host_xlate(struct irq_host *h, struct device_node *ct,
+                              u32 *intspec, unsigned int intsize,
+                              irq_hw_number_t *out_hwirq,
+                              unsigned int *out_flags)
+
+{
+       *out_hwirq = *intspec;
+       return 0;
+}
+
+static struct irq_host_ops pmac_pic_host_ops = {
+       .match = pmac_pic_host_match,
+       .map = pmac_pic_host_map,
+       .xlate = pmac_pic_host_xlate,
+};
+
 static void __init pmac_pic_probe_oldstyle(void)
 {
         int i;
-       int irq_cascade = -1;
         struct device_node *master = NULL;
        struct device_node *slave = NULL;
        u8 __iomem *addr;
        struct resource r;
 
        /* Set our get_irq function */
-       ppc_md.get_irq = pmac_get_irq;
+       ppc_md.get_irq = pmac_pic_get_irq;
 
        /*
         * Find the interrupt controller type & node
@@ -415,7 +355,6 @@ static void __init pmac_pic_probe_oldstyle(void)
                if (slave) {
                        max_irqs = 64;
                        level_mask[1] = OHARE_LEVEL_MASK;
-                       enable_second_ohare(slave);
                }
        } else if ((master = of_find_node_by_name(NULL, "mac-io")) != NULL) {
                max_irqs = max_real_irqs = 64;
@@ -439,14 +378,18 @@ static void __init pmac_pic_probe_oldstyle(void)
                        max_irqs = 128;
                        level_mask[2] = HEATHROW_LEVEL_MASK;
                        level_mask[3] = 0;
-                       pmac_fix_gatwick_interrupts(slave, max_real_irqs);
                }
        }
        BUG_ON(master == NULL);
 
-       /* Set the handler for the main PIC */
-       for ( i = 0; i < max_real_irqs ; i++ )
-               irq_desc[i].chip = &pmac_pic;
+       /*
+        * Allocate an irq host
+        */
+       pmac_pic_host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, max_irqs,
+                                      &pmac_pic_host_ops,
+                                      max_irqs);
+       BUG_ON(pmac_pic_host == NULL);
+       irq_set_default_host(pmac_pic_host);
 
        /* Get addresses of first controller if we have a node for it */
        BUG_ON(of_address_to_resource(master, 0, &r));
@@ -473,39 +416,38 @@ static void __init pmac_pic_probe_oldstyle(void)
                        pmac_irq_hw[i++] =
                                (volatile struct pmac_irq_hw __iomem *)
                                (addr + 0x10);
-               irq_cascade = slave->intrs[0].line;
+               pmac_irq_cascade = irq_of_parse_and_map(slave, 0);
 
                printk(KERN_INFO "irq: Found slave Apple PIC %s for %d irqs"
                       " cascade: %d\n", slave->full_name,
-                      max_irqs - max_real_irqs, irq_cascade);
+                      max_irqs - max_real_irqs, pmac_irq_cascade);
        }
        of_node_put(slave);
 
-       /* disable all interrupts in all controllers */
+       /* Disable all interrupts in all controllers */
        for (i = 0; i * 32 < max_irqs; ++i)
                out_le32(&pmac_irq_hw[i]->enable, 0);
 
-       /* mark level interrupts */
-       for (i = 0; i < max_irqs; i++)
-               if (level_mask[i >> 5] & (1UL << (i & 0x1f)))
-                       irq_desc[i].status = IRQ_LEVEL;
+       /* Hookup cascade irq */
+       if (slave && pmac_irq_cascade != NO_IRQ)
+               setup_irq(pmac_irq_cascade, &gatwick_cascade_action);
 
-       /* Setup handlers for secondary controller and hook cascade irq*/
-       if (slave) {
-               for ( i = max_real_irqs ; i < max_irqs ; i++ )
-                       irq_desc[i].chip = &gatwick_pic;
-               setup_irq(irq_cascade, &gatwick_cascade_action);
-       }
        printk(KERN_INFO "irq: System has %d possible interrupts\n", max_irqs);
 #ifdef CONFIG_XMON
-       setup_irq(20, &xmon_action);
+       setup_irq(irq_create_mapping(NULL, 20, 0), &xmon_action);
 #endif
 }
 #endif /* CONFIG_PPC32 */
 
-static int pmac_u3_cascade(struct pt_regs *regs, void *data)
+static void pmac_u3_cascade(unsigned int irq, struct irq_desc *desc,
+                           struct pt_regs *regs)
 {
-       return mpic_get_one_irq((struct mpic *)data, regs);
+       struct mpic *mpic = desc->handler_data;
+
+       unsigned int cascade_irq = mpic_get_one_irq(mpic, regs);
+       if (cascade_irq != NO_IRQ)
+               generic_handle_irq(cascade_irq, regs);
+       desc->chip->eoi(irq);
 }
 
 static void __init pmac_pic_setup_mpic_nmi(struct mpic *mpic)
@@ -515,21 +457,20 @@ static void __init pmac_pic_setup_mpic_nmi(struct mpic *mpic)
        int nmi_irq;
 
        pswitch = of_find_node_by_name(NULL, "programmer-switch");
-       if (pswitch && pswitch->n_intrs) {
-               nmi_irq = pswitch->intrs[0].line;
-               mpic_irq_set_priority(nmi_irq, 9);
-               setup_irq(nmi_irq, &xmon_action);
+       if (pswitch) {
+               nmi_irq = irq_of_parse_and_map(pswitch, 0);
+               if (nmi_irq != NO_IRQ) {
+                       mpic_irq_set_priority(nmi_irq, 9);
+                       setup_irq(nmi_irq, &xmon_action);
+               }
+               of_node_put(pswitch);
        }
-       of_node_put(pswitch);
 #endif /* defined(CONFIG_XMON) && defined(CONFIG_PPC32) */
 }
 
 static struct mpic * __init pmac_setup_one_mpic(struct device_node *np,
                                                int master)
 {
-       unsigned char senses[128];
-       int offset = master ? 0 : 128;
-       int count = master ? 128 : 124;
        const char *name = master ? " MPIC 1   " : " MPIC 2   ";
        struct resource r;
        struct mpic *mpic;
@@ -542,8 +483,6 @@ static struct mpic * __init pmac_setup_one_mpic(struct device_node *np,
 
        pmac_call_feature(PMAC_FTR_ENABLE_MPIC, np, 0, 0);
 
-       prom_get_irq_senses(senses, offset, offset + count);
-
        flags |= MPIC_WANTS_RESET;
        if (get_property(np, "big-endian", NULL))
                flags |= MPIC_BIG_ENDIAN;
@@ -554,8 +493,7 @@ static struct mpic * __init pmac_setup_one_mpic(struct device_node *np,
        if (master && (flags & MPIC_BIG_ENDIAN))
                flags |= MPIC_BROKEN_U3;
 
-       mpic = mpic_alloc(r.start, flags, 0, offset, count, master ? 252 : 0,
-                         senses, count, name);
+       mpic = mpic_alloc(np, r.start, flags, 0, 0, name);
        if (mpic == NULL)
                return NULL;
 
@@ -568,6 +506,7 @@ static int __init pmac_pic_probe_mpic(void)
 {
        struct mpic *mpic1, *mpic2;
        struct device_node *np, *master = NULL, *slave = NULL;
+       unsigned int cascade;
 
        /* We can have up to 2 MPICs cascaded */
        for (np = NULL; (np = of_find_node_by_type(np, "open-pic"))
@@ -604,8 +543,15 @@ static int __init pmac_pic_probe_mpic(void)
        of_node_put(master);
 
        /* No slave, let's go out */
-       if (slave == NULL || slave->n_intrs < 1)
+       if (slave == NULL)
+               return 0;
+
+       /* Get/Map slave interrupt */
+       cascade = irq_of_parse_and_map(slave, 0);
+       if (cascade == NO_IRQ) {
+               printk(KERN_ERR "Failed to map cascade IRQ\n");
                return 0;
+       }
 
        mpic2 = pmac_setup_one_mpic(slave, 0);
        if (mpic2 == NULL) {
@@ -613,7 +559,8 @@ static int __init pmac_pic_probe_mpic(void)
                of_node_put(slave);
                return 0;
        }
-       mpic_setup_cascade(slave->intrs[0].line, pmac_u3_cascade, mpic2);
+       set_irq_data(cascade, mpic2);
+       set_irq_chained_handler(cascade, pmac_u3_cascade);
 
        of_node_put(slave);
        return 0;
@@ -622,6 +569,19 @@ static int __init pmac_pic_probe_mpic(void)
 
 void __init pmac_pic_init(void)
 {
+       unsigned int flags = 0;
+
+       /* We configure the OF parsing based on our oldworld vs. newworld
+        * platform type and wether we were booted by BootX.
+        */
+#ifdef CONFIG_PPC32
+       if (!pmac_newworld)
+               flags |= OF_IMAP_OLDWORLD_MAC;
+       if (get_property(of_chosen, "linux,bootx", NULL) != NULL)
+               flags |= OF_IMAP_NO_PHANDLE;
+       of_irq_map_init(flags);
+#endif /* CONFIG_PPC_32 */
+
        /* We first try to detect Apple's new Core99 chipset, since mac-io
         * is quite different on those machines and contains an IBM MPIC2.
         */
@@ -644,6 +604,7 @@ unsigned long sleep_save_mask[2];
 
 /* This used to be passed by the PMU driver but that link got
  * broken with the new driver model. We use this tweak for now...
+ * We really want to do things differently though...
  */
 static int pmacpic_find_viaint(void)
 {
@@ -657,7 +618,7 @@ static int pmacpic_find_viaint(void)
        np = of_find_node_by_name(NULL, "via-pmu");
        if (np == NULL)
                goto not_found;
-       viaint = np->intrs[0].line;
+       viaint = irq_of_parse_and_map(np, 0);;
 #endif /* CONFIG_ADB_PMU */
 
 not_found:
index 21c7b0f8f32996ce7038911f28608d15169887a8..94e7b24b840b82df1cbc32d8f173e3f856bfca7d 100644 (file)
@@ -12,6 +12,8 @@
 
 struct rtc_time;
 
+extern int pmac_newworld;
+
 extern long pmac_time_init(void);
 extern unsigned long pmac_get_boot_time(void);
 extern void pmac_get_rtc_time(struct rtc_time *);
index 89c5775f83beffb4947fb5c466bb6478096e84e4..31a9da769fa237e03dd0f302a155d5b6fc07fb03 100644 (file)
@@ -23,7 +23,6 @@
  * bootup setup stuff..
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
@@ -614,9 +613,6 @@ static void __init pmac_init_early(void)
        udbg_adb_init(!!strstr(cmd_line, "btextdbg"));
 
 #ifdef CONFIG_PPC64
-       /* Setup interrupt mapping options */
-       ppc64_interrupt_controller = IC_OPEN_PIC;
-
        iommu_init_early_dart();
 #endif
 }
index 22b113d19b2442089726f7901a5e2e07a3a3b491..1174ca128efa4aa160b13790937ad418366e280a 100644 (file)
@@ -10,7 +10,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/ppc_asm.h>
index 1065d87fc27904f63b182f696f7f8fd8f8e9059b..827b7121ffb84a8d0f038f98a7fe7245b0e841e7 100644 (file)
@@ -21,7 +21,6 @@
  *  as published by the Free Software Foundation; either version
  *  2 of the License, or (at your option) any later version.
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/smp.h>
@@ -378,7 +377,7 @@ static void __init psurge_dual_sync_tb(int cpu_nr)
 
 static struct irqaction psurge_irqaction = {
        .handler = psurge_primary_intr,
-       .flags = SA_INTERRUPT,
+       .flags = IRQF_DISABLED,
        .mask = CPU_MASK_NONE,
        .name = "primary IPI",
 };
index 890758aa9667e61fac3208c0600ad8fb39998f23..a4173906e94525a56184ece0d3d1db89e4d66bf3 100644 (file)
@@ -9,7 +9,6 @@
  * Copyright (C) 2003-2005 Benjamin Herrenschmidt.
  *
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index 06c8265c2baff77bdc7aa06d8f0f951b57e675d7..6124e59e1038153e66ba3b4c5fe770c095dd3acf 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index b4fa9f03b46142d28508af24219d69b2cb2e3d72..37e5b1eff911faeaaa1a9d4c7f36b142284dad10 100644 (file)
@@ -8,7 +8,6 @@
  *      as published by the Free Software Foundation; either version
  *      2 of the License, or (at your option) any later version.
  */
-#include <linux/config.h>
 #include <linux/types.h>
 #include <asm/udbg.h>
 #include <asm/processor.h>
index 0ec9a5445b95e177f2853d235037acb14508df06..aaad2c0afcbf93868c581bf9d1f971bcbdc41794 100644 (file)
@@ -175,7 +175,7 @@ static void eeh_report_failure(struct pci_dev *dev, void *userdata)
  *
  * pSeries systems will isolate a PCI slot if the PCI-Host
  * bridge detects address or data parity errors, DMA's
- * occuring to wild addresses (which usually happen due to
+ * occurring to wild addresses (which usually happen due to
  * bugs in device drivers or in PCI adapter firmware).
  * Slot isolations also occur if #SERR, #PERR or other misc
  * PCI-related errors are detected.
index 8cfb5706790ecd395bd7039463a435a6a0574405..d67af2c657544ef5b0a6386a9c45a31de2fb4681 100644 (file)
@@ -24,7 +24,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/types.h>
 #include <linux/slab.h>
index 27480705996f988ae6335925930bb08911afa173..3aeb4069904203e8e2c7d6e4f71bdc70a7d2da01 100644 (file)
@@ -21,7 +21,6 @@
 
 #undef DEBUG_LOW
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/dma-mapping.h>
 #include <linux/console.h>
index 9639c66b453d3542d2adb62ad2a67f044b8ea7f4..9df783088b618347471e2afd7e446bd387b6f4c9 100644 (file)
@@ -72,32 +72,62 @@ static irqreturn_t ras_error_interrupt(int irq, void *dev_id,
 
 /* #define DEBUG */
 
-static void request_ras_irqs(struct device_node *np, char *propname,
+
+static void request_ras_irqs(struct device_node *np,
                        irqreturn_t (*handler)(int, void *, struct pt_regs *),
                        const char *name)
 {
-       unsigned int *ireg, len, i;
-       int virq, n_intr;
-
-       ireg = (unsigned int *)get_property(np, propname, &len);
-       if (ireg == NULL)
-               return;
-       n_intr = prom_n_intr_cells(np);
-       len /= n_intr * sizeof(*ireg);
-
-       for (i = 0; i < len; i++) {
-               virq = virt_irq_create_mapping(*ireg);
-               if (virq == NO_IRQ) {
-                       printk(KERN_ERR "Unable to allocate interrupt "
-                              "number for %s\n", np->full_name);
-                       return;
+       int i, index, count = 0;
+       struct of_irq oirq;
+       u32 *opicprop;
+       unsigned int opicplen;
+       unsigned int virqs[16];
+
+       /* Check for obsolete "open-pic-interrupt" property. If present, then
+        * map those interrupts using the default interrupt host and default
+        * trigger
+        */
+       opicprop = (u32 *)get_property(np, "open-pic-interrupt", &opicplen);
+       if (opicprop) {
+               opicplen /= sizeof(u32);
+               for (i = 0; i < opicplen; i++) {
+                       if (count > 15)
+                               break;
+                       virqs[count] = irq_create_mapping(NULL, *(opicprop++),
+                                                        IRQ_TYPE_NONE);
+                       if (virqs[count] == NO_IRQ)
+                               printk(KERN_ERR "Unable to allocate interrupt "
+                                      "number for %s\n", np->full_name);
+                       else
+                               count++;
+
                }
-               if (request_irq(irq_offset_up(virq), handler, 0, name, NULL)) {
+       }
+       /* Else use normal interrupt tree parsing */
+       else {
+               /* First try to do a proper OF tree parsing */
+               for (index = 0; of_irq_map_one(np, index, &oirq) == 0;
+                    index++) {
+                       if (count > 15)
+                               break;
+                       virqs[count] = irq_create_of_mapping(oirq.controller,
+                                                           oirq.specifier,
+                                                           oirq.size);
+                       if (virqs[count] == NO_IRQ)
+                               printk(KERN_ERR "Unable to allocate interrupt "
+                                      "number for %s\n", np->full_name);
+                       else
+                               count++;
+               }
+       }
+
+       /* Now request them */
+       for (i = 0; i < count; i++) {
+               if (request_irq(virqs[i], handler, 0, name, NULL)) {
                        printk(KERN_ERR "Unable to request interrupt %d for "
-                              "%s\n", irq_offset_up(virq), np->full_name);
+                              "%s\n", virqs[i], np->full_name);
                        return;
                }
-               ireg += n_intr;
        }
 }
 
@@ -115,20 +145,14 @@ static int __init init_ras_IRQ(void)
        /* Internal Errors */
        np = of_find_node_by_path("/event-sources/internal-errors");
        if (np != NULL) {
-               request_ras_irqs(np, "open-pic-interrupt", ras_error_interrupt,
-                                "RAS_ERROR");
-               request_ras_irqs(np, "interrupts", ras_error_interrupt,
-                                "RAS_ERROR");
+               request_ras_irqs(np, ras_error_interrupt, "RAS_ERROR");
                of_node_put(np);
        }
 
        /* EPOW Events */
        np = of_find_node_by_path("/event-sources/epow-events");
        if (np != NULL) {
-               request_ras_irqs(np, "open-pic-interrupt", ras_epow_interrupt,
-                                "RAS_EPOW");
-               request_ras_irqs(np, "interrupts", ras_epow_interrupt,
-                                "RAS_EPOW");
+               request_ras_irqs(np, ras_epow_interrupt, "RAS_EPOW");
                of_node_put(np);
        }
 
@@ -162,7 +186,7 @@ ras_epow_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 
        status = rtas_call(ras_check_exception_token, 6, 1, NULL,
                           RAS_VECTOR_OFFSET,
-                          virt_irq_to_real(irq_offset_down(irq)),
+                          irq_map[irq].hwirq,
                           RTAS_EPOW_WARNING | RTAS_POWERMGM_EVENTS,
                           critical, __pa(&ras_log_buf),
                                rtas_get_error_log_max());
@@ -198,7 +222,7 @@ ras_error_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 
        status = rtas_call(ras_check_exception_token, 6, 1, NULL,
                           RAS_VECTOR_OFFSET,
-                          virt_irq_to_real(irq_offset_down(irq)),
+                          irq_map[irq].hwirq,
                           RTAS_INTERNAL_ERROR, 1 /*Time Critical */,
                           __pa(&ras_log_buf),
                                rtas_get_error_log_max());
index b3197ff156c6ab277b46abe710eb8fbc0a6c18e4..54a52437265c50ecb5d0038a3c070c67d1945a9c 100644 (file)
@@ -18,7 +18,6 @@
 
 #undef DEBUG
 
-#include <linux/config.h>
 #include <linux/cpu.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
@@ -77,6 +76,9 @@
 #define DBG(fmt...)
 #endif
 
+/* move those away to a .h */
+extern void smp_init_pseries_mpic(void);
+extern void smp_init_pseries_xics(void);
 extern void find_udbg_vterm(void);
 
 int fwnmi_active;  /* TRUE if an FWNMI handler is present */
@@ -84,7 +86,7 @@ int fwnmi_active;  /* TRUE if an FWNMI handler is present */
 static void pseries_shared_idle_sleep(void);
 static void pseries_dedicated_idle_sleep(void);
 
-struct mpic *pSeries_mpic;
+static struct device_node *pSeries_mpic_node;
 
 static void pSeries_show_cpuinfo(struct seq_file *m)
 {
@@ -119,63 +121,92 @@ static void __init fwnmi_init(void)
                fwnmi_active = 1;
 }
 
-static void __init pSeries_init_mpic(void)
+void pseries_8259_cascade(unsigned int irq, struct irq_desc *desc,
+                         struct pt_regs *regs)
 {
-        unsigned int *addrp;
-       struct device_node *np;
-       unsigned long intack = 0;
-
-       /* All ISUs are setup, complete initialization */
-       mpic_init(pSeries_mpic);
-
-       /* Check what kind of cascade ACK we have */
-        if (!(np = of_find_node_by_name(NULL, "pci"))
-            || !(addrp = (unsigned int *)
-                 get_property(np, "8259-interrupt-acknowledge", NULL)))
-                printk(KERN_ERR "Cannot find pci to get ack address\n");
-        else
-               intack = addrp[prom_n_addr_cells(np)-1];
-       of_node_put(np);
-
-       /* Setup the legacy interrupts & controller */
-       i8259_init(intack, 0);
-
-       /* Hook cascade to mpic */
-       mpic_setup_cascade(NUM_ISA_INTERRUPTS, i8259_irq_cascade, NULL);
+       unsigned int cascade_irq = i8259_irq(regs);
+       if (cascade_irq != NO_IRQ)
+               generic_handle_irq(cascade_irq, regs);
+       desc->chip->eoi(irq);
 }
 
-static void __init pSeries_setup_mpic(void)
+static void __init pseries_mpic_init_IRQ(void)
 {
+       struct device_node *np, *old, *cascade = NULL;
+        unsigned int *addrp;
+       unsigned long intack = 0;
        unsigned int *opprop;
        unsigned long openpic_addr = 0;
-        unsigned char senses[NR_IRQS - NUM_ISA_INTERRUPTS];
-        struct device_node *root;
-       int irq_count;
+       unsigned int cascade_irq;
+       int naddr, n, i, opplen;
+       struct mpic *mpic;
 
-       /* Find the Open PIC if present */
-       root = of_find_node_by_path("/");
-       opprop = (unsigned int *) get_property(root, "platform-open-pic", NULL);
+       np = of_find_node_by_path("/");
+       naddr = prom_n_addr_cells(np);
+       opprop = (unsigned int *) get_property(np, "platform-open-pic", &opplen);
        if (opprop != 0) {
-               int n = prom_n_addr_cells(root);
-
-               for (openpic_addr = 0; n > 0; --n)
-                       openpic_addr = (openpic_addr << 32) + *opprop++;
+               openpic_addr = of_read_number(opprop, naddr);
                printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr);
        }
-       of_node_put(root);
+       of_node_put(np);
 
        BUG_ON(openpic_addr == 0);
 
-       /* Get the sense values from OF */
-       prom_get_irq_senses(senses, NUM_ISA_INTERRUPTS, NR_IRQS);
-       
        /* Setup the openpic driver */
-       irq_count = NR_IRQS - NUM_ISA_INTERRUPTS - 4; /* leave room for IPIs */
-       pSeries_mpic = mpic_alloc(openpic_addr, MPIC_PRIMARY,
-                                 16, 16, irq_count, /* isu size, irq offset, irq count */ 
-                                 NR_IRQS - 4, /* ipi offset */
-                                 senses, irq_count, /* sense & sense size */
-                                 " MPIC     ");
+       mpic = mpic_alloc(pSeries_mpic_node, openpic_addr,
+                         MPIC_PRIMARY,
+                         16, 250, /* isu size, irq count */
+                         " MPIC     ");
+       BUG_ON(mpic == NULL);
+
+       /* Add ISUs */
+       opplen /= sizeof(u32);
+       for (n = 0, i = naddr; i < opplen; i += naddr, n++) {
+               unsigned long isuaddr = of_read_number(opprop + i, naddr);
+               mpic_assign_isu(mpic, n, isuaddr);
+       }
+
+       /* All ISUs are setup, complete initialization */
+       mpic_init(mpic);
+
+       /* Look for cascade */
+       for_each_node_by_type(np, "interrupt-controller")
+               if (device_is_compatible(np, "chrp,iic")) {
+                       cascade = np;
+                       break;
+               }
+       if (cascade == NULL)
+               return;
+
+       cascade_irq = irq_of_parse_and_map(cascade, 0);
+       if (cascade == NO_IRQ) {
+               printk(KERN_ERR "xics: failed to map cascade interrupt");
+               return;
+       }
+
+       /* Check ACK type */
+       for (old = of_node_get(cascade); old != NULL ; old = np) {
+               np = of_get_parent(old);
+               of_node_put(old);
+               if (np == NULL)
+                       break;
+               if (strcmp(np->name, "pci") != 0)
+                       continue;
+               addrp = (u32 *)get_property(np, "8259-interrupt-acknowledge",
+                                           NULL);
+               if (addrp == NULL)
+                       continue;
+               naddr = prom_n_addr_cells(np);
+               intack = addrp[naddr-1];
+               if (naddr > 1)
+                       intack |= ((unsigned long)addrp[naddr-2]) << 32;
+       }
+       if (intack)
+               printk(KERN_DEBUG "mpic: PCI 8259 intack at 0x%016lx\n",
+                      intack);
+       i8259_init(cascade, intack);
+       of_node_put(cascade);
+       set_irq_chained_handler(cascade_irq, pseries_8259_cascade);
 }
 
 static void pseries_lpar_enable_pmcs(void)
@@ -193,23 +224,67 @@ static void pseries_lpar_enable_pmcs(void)
                get_lppaca()->pmcregs_in_use = 1;
 }
 
-static void __init pSeries_setup_arch(void)
+#ifdef CONFIG_KEXEC
+static void pseries_kexec_cpu_down_mpic(int crash_shutdown, int secondary)
 {
-       /* Fixup ppc_md depending on the type of interrupt controller */
-       if (ppc64_interrupt_controller == IC_OPEN_PIC) {
-               ppc_md.init_IRQ       = pSeries_init_mpic;
-               ppc_md.get_irq        = mpic_get_irq;
-               /* Allocate the mpic now, so that find_and_init_phbs() can
-                * fill the ISUs */
-               pSeries_setup_mpic();
-       } else {
-               ppc_md.init_IRQ       = xics_init_IRQ;
-               ppc_md.get_irq        = xics_get_irq;
+       mpic_teardown_this_cpu(secondary);
+}
+
+static void pseries_kexec_cpu_down_xics(int crash_shutdown, int secondary)
+{
+       /* Don't risk a hypervisor call if we're crashing */
+       if (firmware_has_feature(FW_FEATURE_SPLPAR) && !crash_shutdown) {
+               unsigned long vpa = __pa(get_lppaca());
+
+               if (unregister_vpa(hard_smp_processor_id(), vpa)) {
+                       printk("VPA deregistration of cpu %u (hw_cpu_id %d) "
+                                       "failed\n", smp_processor_id(),
+                                       hard_smp_processor_id());
+               }
        }
+       xics_teardown_cpu(secondary);
+}
+#endif /* CONFIG_KEXEC */
 
+static void __init pseries_discover_pic(void)
+{
+       struct device_node *np;
+       char *typep;
+
+       for (np = NULL; (np = of_find_node_by_name(np,
+                                                  "interrupt-controller"));) {
+               typep = (char *)get_property(np, "compatible", NULL);
+               if (strstr(typep, "open-pic")) {
+                       pSeries_mpic_node = of_node_get(np);
+                       ppc_md.init_IRQ       = pseries_mpic_init_IRQ;
+                       ppc_md.get_irq        = mpic_get_irq;
+#ifdef CONFIG_KEXEC
+                       ppc_md.kexec_cpu_down = pseries_kexec_cpu_down_mpic;
+#endif
+#ifdef CONFIG_SMP
+                       smp_init_pseries_mpic();
+#endif
+                       return;
+               } else if (strstr(typep, "ppc-xicp")) {
+                       ppc_md.init_IRQ       = xics_init_IRQ;
+#ifdef CONFIG_KEXEC
+                       ppc_md.kexec_cpu_down = pseries_kexec_cpu_down_xics;
+#endif
 #ifdef CONFIG_SMP
-       smp_init_pSeries();
+                       smp_init_pseries_xics();
 #endif
+                       return;
+               }
+       }
+       printk(KERN_ERR "pSeries_discover_pic: failed to recognize"
+              " interrupt-controller\n");
+}
+
+static void __init pSeries_setup_arch(void)
+{
+       /* Discover PIC type and setup ppc_md accordingly */
+       pseries_discover_pic();
+
        /* openpic global configuration register (64-bit format). */
        /* openpic Interrupt Source Unit pointer (64-bit format). */
        /* python0 facility area (mmio) (64-bit format) REAL address. */
@@ -261,41 +336,11 @@ static int __init pSeries_init_panel(void)
 }
 arch_initcall(pSeries_init_panel);
 
-static  void __init pSeries_discover_pic(void)
-{
-       struct device_node *np;
-       char *typep;
-
-       /*
-        * Setup interrupt mapping options that are needed for finish_device_tree
-        * to properly parse the OF interrupt tree & do the virtual irq mapping
-        */
-       __irq_offset_value = NUM_ISA_INTERRUPTS;
-       ppc64_interrupt_controller = IC_INVALID;
-       for (np = NULL; (np = of_find_node_by_name(np, "interrupt-controller"));) {
-               typep = (char *)get_property(np, "compatible", NULL);
-               if (strstr(typep, "open-pic")) {
-                       ppc64_interrupt_controller = IC_OPEN_PIC;
-                       break;
-               } else if (strstr(typep, "ppc-xicp")) {
-                       ppc64_interrupt_controller = IC_PPC_XIC;
-                       break;
-               }
-       }
-       if (ppc64_interrupt_controller == IC_INVALID)
-               printk("pSeries_discover_pic: failed to recognize"
-                       " interrupt-controller\n");
-
-}
-
 static void pSeries_mach_cpu_die(void)
 {
        local_irq_disable();
        idle_task_exit();
-       /* Some hardware requires clearing the CPPR, while other hardware does not
-        * it is safe either way
-        */
-       pSeriesLP_cppr_info(0, 0);
+       xics_teardown_cpu(0);
        rtas_stop_self();
        /* Should never get here... */
        BUG();
@@ -333,8 +378,6 @@ static void __init pSeries_init_early(void)
 
        iommu_init_early_pSeries();
 
-       pSeries_discover_pic();
-
        DBG(" <- pSeries_init_early()\n");
 }
 
@@ -506,27 +549,6 @@ static int pSeries_pci_probe_mode(struct pci_bus *bus)
        return PCI_PROBE_NORMAL;
 }
 
-#ifdef CONFIG_KEXEC
-static void pseries_kexec_cpu_down(int crash_shutdown, int secondary)
-{
-       /* Don't risk a hypervisor call if we're crashing */
-       if (firmware_has_feature(FW_FEATURE_SPLPAR) && !crash_shutdown) {
-               unsigned long vpa = __pa(get_lppaca());
-
-               if (unregister_vpa(hard_smp_processor_id(), vpa)) {
-                       printk("VPA deregistration of cpu %u (hw_cpu_id %d) "
-                                       "failed\n", smp_processor_id(),
-                                       hard_smp_processor_id());
-               }
-       }
-
-       if (ppc64_interrupt_controller == IC_OPEN_PIC)
-               mpic_teardown_this_cpu(secondary);
-       else
-               xics_teardown_cpu(secondary);
-}
-#endif
-
 define_machine(pseries) {
        .name                   = "pSeries",
        .probe                  = pSeries_probe,
@@ -551,7 +573,6 @@ define_machine(pseries) {
        .system_reset_exception = pSeries_system_reset_exception,
        .machine_check_exception = pSeries_machine_check_exception,
 #ifdef CONFIG_KEXEC
-       .kexec_cpu_down         = pseries_kexec_cpu_down,
        .machine_kexec          = default_machine_kexec,
        .machine_kexec_prepare  = default_machine_kexec_prepare,
        .machine_crash_shutdown = default_machine_crash_shutdown,
index 3cf78a6cd27c32d55659cec05350ed28f8835a86..ac61098ff401ca90c586243cb7f3b17eacdf5a1a 100644 (file)
@@ -14,7 +14,6 @@
 
 #undef DEBUG
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/sched.h>
@@ -417,27 +416,12 @@ static struct smp_ops_t pSeries_xics_smp_ops = {
 #endif
 
 /* This is called very early */
-void __init smp_init_pSeries(void)
+static void __init smp_init_pseries(void)
 {
        int i;
 
        DBG(" -> smp_init_pSeries()\n");
 
-       switch (ppc64_interrupt_controller) {
-#ifdef CONFIG_MPIC
-       case IC_OPEN_PIC:
-               smp_ops = &pSeries_mpic_smp_ops;
-               break;
-#endif
-#ifdef CONFIG_XICS
-       case IC_PPC_XIC:
-               smp_ops = &pSeries_xics_smp_ops;
-               break;
-#endif
-       default:
-               panic("Invalid interrupt controller");
-       }
-
 #ifdef CONFIG_HOTPLUG_CPU
        smp_ops->cpu_disable = pSeries_cpu_disable;
        smp_ops->cpu_die = pSeries_cpu_die;
@@ -472,3 +456,18 @@ void __init smp_init_pSeries(void)
        DBG(" <- smp_init_pSeries()\n");
 }
 
+#ifdef CONFIG_MPIC
+void __init smp_init_pseries_mpic(void)
+{
+       smp_ops = &pSeries_mpic_smp_ops;
+
+       smp_init_pseries();
+}
+#endif
+
+void __init smp_init_pseries_xics(void)
+{
+       smp_ops = &pSeries_xics_smp_ops;
+
+       smp_init_pseries();
+}
index 19c03dd43000fdd46c31413da79e7a11d7e5397c..716972aa9777298fd308ff2c1d01c27b6ea290ef 100644 (file)
@@ -8,7 +8,9 @@
  *  as published by the Free Software Foundation; either version
  *  2 of the License, or (at your option) any later version.
  */
-#include <linux/config.h>
+
+#undef DEBUG
+
 #include <linux/types.h>
 #include <linux/threads.h>
 #include <linux/kernel.h>
@@ -20,6 +22,7 @@
 #include <linux/gfp.h>
 #include <linux/radix-tree.h>
 #include <linux/cpu.h>
+
 #include <asm/firmware.h>
 #include <asm/prom.h>
 #include <asm/io.h>
 
 #include "xics.h"
 
-static unsigned int xics_startup(unsigned int irq);
-static void xics_enable_irq(unsigned int irq);
-static void xics_disable_irq(unsigned int irq);
-static void xics_mask_and_ack_irq(unsigned int irq);
-static void xics_end_irq(unsigned int irq);
-static void xics_set_affinity(unsigned int irq_nr, cpumask_t cpumask);
-
-static struct hw_interrupt_type xics_pic = {
-       .typename = " XICS     ",
-       .startup = xics_startup,
-       .enable = xics_enable_irq,
-       .disable = xics_disable_irq,
-       .ack = xics_mask_and_ack_irq,
-       .end = xics_end_irq,
-       .set_affinity = xics_set_affinity
-};
-
-/* This is used to map real irq numbers to virtual */
-static struct radix_tree_root irq_map = RADIX_TREE_INIT(GFP_ATOMIC);
-
 #define XICS_IPI               2
 #define XICS_IRQ_SPURIOUS      0
 
@@ -60,7 +43,7 @@ static struct radix_tree_root irq_map = RADIX_TREE_INIT(GFP_ATOMIC);
 
 /*
  * Mark IPIs as higher priority so we can take them inside interrupts that
- * arent marked SA_INTERRUPT
+ * arent marked IRQF_DISABLED
  */
 #define IPI_PRIORITY           4
 
@@ -82,12 +65,12 @@ struct xics_ipl {
 
 static struct xics_ipl __iomem *xics_per_cpu[NR_CPUS];
 
-static int xics_irq_8259_cascade = 0;
-static int xics_irq_8259_cascade_real = 0;
 static unsigned int default_server = 0xFF;
 static unsigned int default_distrib_server = 0;
 static unsigned int interrupt_server_size = 8;
 
+static struct irq_host *xics_host;
+
 /*
  * XICS only has a single IPI, so encode the messages per CPU
  */
@@ -99,48 +82,34 @@ static int ibm_set_xive;
 static int ibm_int_on;
 static int ibm_int_off;
 
-typedef struct {
-       int (*xirr_info_get)(int cpu);
-       void (*xirr_info_set)(int cpu, int val);
-       void (*cppr_info)(int cpu, u8 val);
-       void (*qirr_info)(int cpu, u8 val);
-} xics_ops;
 
+/* Direct HW low level accessors */
 
-/* SMP */
 
-static int pSeries_xirr_info_get(int n_cpu)
+static inline unsigned int direct_xirr_info_get(int n_cpu)
 {
        return in_be32(&xics_per_cpu[n_cpu]->xirr.word);
 }
 
-static void pSeries_xirr_info_set(int n_cpu, int value)
+static inline void direct_xirr_info_set(int n_cpu, int value)
 {
        out_be32(&xics_per_cpu[n_cpu]->xirr.word, value);
 }
 
-static void pSeries_cppr_info(int n_cpu, u8 value)
+static inline void direct_cppr_info(int n_cpu, u8 value)
 {
        out_8(&xics_per_cpu[n_cpu]->xirr.bytes[0], value);
 }
 
-static void pSeries_qirr_info(int n_cpu, u8 value)
+static inline void direct_qirr_info(int n_cpu, u8 value)
 {
        out_8(&xics_per_cpu[n_cpu]->qirr.bytes[0], value);
 }
 
-static xics_ops pSeries_ops = {
-       pSeries_xirr_info_get,
-       pSeries_xirr_info_set,
-       pSeries_cppr_info,
-       pSeries_qirr_info
-};
 
-static xics_ops *ops = &pSeries_ops;
+/* LPAR low level accessors */
 
 
-/* LPAR */
-
 static inline long plpar_eoi(unsigned long xirr)
 {
        return plpar_hcall_norets(H_EOI, xirr);
@@ -162,7 +131,7 @@ static inline long plpar_xirr(unsigned long *xirr_ret)
        return plpar_hcall(H_XIRR, 0, 0, 0, 0, xirr_ret, &dummy, &dummy);
 }
 
-static int pSeriesLP_xirr_info_get(int n_cpu)
+static inline unsigned int lpar_xirr_info_get(int n_cpu)
 {
        unsigned long lpar_rc;
        unsigned long return_value;
@@ -170,10 +139,10 @@ static int pSeriesLP_xirr_info_get(int n_cpu)
        lpar_rc = plpar_xirr(&return_value);
        if (lpar_rc != H_SUCCESS)
                panic(" bad return code xirr - rc = %lx \n", lpar_rc);
-       return (int)return_value;
+       return (unsigned int)return_value;
 }
 
-static void pSeriesLP_xirr_info_set(int n_cpu, int value)
+static inline void lpar_xirr_info_set(int n_cpu, int value)
 {
        unsigned long lpar_rc;
        unsigned long val64 = value & 0xffffffff;
@@ -184,7 +153,7 @@ static void pSeriesLP_xirr_info_set(int n_cpu, int value)
                      val64);
 }
 
-void pSeriesLP_cppr_info(int n_cpu, u8 value)
+static inline void lpar_cppr_info(int n_cpu, u8 value)
 {
        unsigned long lpar_rc;
 
@@ -193,7 +162,7 @@ void pSeriesLP_cppr_info(int n_cpu, u8 value)
                panic("bad return code cppr - rc = %lx\n", lpar_rc);
 }
 
-static void pSeriesLP_qirr_info(int n_cpu , u8 value)
+static inline void lpar_qirr_info(int n_cpu , u8 value)
 {
        unsigned long lpar_rc;
 
@@ -202,43 +171,16 @@ static void pSeriesLP_qirr_info(int n_cpu , u8 value)
                panic("bad return code qirr - rc = %lx\n", lpar_rc);
 }
 
-xics_ops pSeriesLP_ops = {
-       pSeriesLP_xirr_info_get,
-       pSeriesLP_xirr_info_set,
-       pSeriesLP_cppr_info,
-       pSeriesLP_qirr_info
-};
-
-static unsigned int xics_startup(unsigned int virq)
-{
-       unsigned int irq;
-
-       irq = irq_offset_down(virq);
-       if (radix_tree_insert(&irq_map, virt_irq_to_real(irq),
-                             &virt_irq_to_real_map[irq]) == -ENOMEM)
-               printk(KERN_CRIT "Out of memory creating real -> virtual"
-                      " IRQ mapping for irq %u (real 0x%x)\n",
-                      virq, virt_irq_to_real(irq));
-       xics_enable_irq(virq);
-       return 0;       /* return value is ignored */
-}
 
-static unsigned int real_irq_to_virt(unsigned int real_irq)
-{
-       unsigned int *ptr;
+/* High level handlers and init code */
 
-       ptr = radix_tree_lookup(&irq_map, real_irq);
-       if (ptr == NULL)
-               return NO_IRQ;
-       return ptr - virt_irq_to_real_map;
-}
 
 #ifdef CONFIG_SMP
-static int get_irq_server(unsigned int irq)
+static int get_irq_server(unsigned int virq)
 {
        unsigned int server;
        /* For the moment only implement delivery to all cpus or one cpu */
-       cpumask_t cpumask = irq_desc[irq].affinity;
+       cpumask_t cpumask = irq_desc[virq].affinity;
        cpumask_t tmp = CPU_MASK_NONE;
 
        if (!distribute_irqs)
@@ -259,23 +201,28 @@ static int get_irq_server(unsigned int irq)
 
 }
 #else
-static int get_irq_server(unsigned int irq)
+static int get_irq_server(unsigned int virq)
 {
        return default_server;
 }
 #endif
 
-static void xics_enable_irq(unsigned int virq)
+
+static void xics_unmask_irq(unsigned int virq)
 {
        unsigned int irq;
        int call_status;
        unsigned int server;
 
-       irq = virt_irq_to_real(irq_offset_down(virq));
-       if (irq == XICS_IPI)
+       pr_debug("xics: unmask virq %d\n", virq);
+
+       irq = (unsigned int)irq_map[virq].hwirq;
+       pr_debug(" -> map to hwirq 0x%x\n", irq);
+       if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS)
                return;
 
        server = get_irq_server(virq);
+
        call_status = rtas_call(ibm_set_xive, 3, 1, NULL, irq, server,
                                DEFAULT_PRIORITY);
        if (call_status != 0) {
@@ -294,7 +241,7 @@ static void xics_enable_irq(unsigned int virq)
        }
 }
 
-static void xics_disable_real_irq(unsigned int irq)
+static void xics_mask_real_irq(unsigned int irq)
 {
        int call_status;
        unsigned int server;
@@ -319,75 +266,86 @@ static void xics_disable_real_irq(unsigned int irq)
        }
 }
 
-static void xics_disable_irq(unsigned int virq)
+static void xics_mask_irq(unsigned int virq)
 {
        unsigned int irq;
 
-       irq = virt_irq_to_real(irq_offset_down(virq));
-       xics_disable_real_irq(irq);
+       pr_debug("xics: mask virq %d\n", virq);
+
+       irq = (unsigned int)irq_map[virq].hwirq;
+       if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS)
+               return;
+       xics_mask_real_irq(irq);
+}
+
+static unsigned int xics_startup(unsigned int virq)
+{
+       unsigned int irq;
+
+       /* force a reverse mapping of the interrupt so it gets in the cache */
+       irq = (unsigned int)irq_map[virq].hwirq;
+       irq_radix_revmap(xics_host, irq);
+
+       /* unmask it */
+       xics_unmask_irq(virq);
+       return 0;
 }
 
-static void xics_end_irq(unsigned int irq)
+static void xics_eoi_direct(unsigned int virq)
 {
        int cpu = smp_processor_id();
+       unsigned int irq = (unsigned int)irq_map[virq].hwirq;
 
        iosync();
-       ops->xirr_info_set(cpu, ((0xff << 24) |
-                                (virt_irq_to_real(irq_offset_down(irq)))));
-
+       direct_xirr_info_set(cpu, (0xff << 24) | irq);
 }
 
-static void xics_mask_and_ack_irq(unsigned int irq)
+
+static void xics_eoi_lpar(unsigned int virq)
 {
        int cpu = smp_processor_id();
+       unsigned int irq = (unsigned int)irq_map[virq].hwirq;
 
-       if (irq < irq_offset_value()) {
-               i8259_pic.ack(irq);
-               iosync();
-               ops->xirr_info_set(cpu, ((0xff<<24) |
-                                        xics_irq_8259_cascade_real));
-               iosync();
-       }
+       iosync();
+       lpar_xirr_info_set(cpu, (0xff << 24) | irq);
 }
 
-int xics_get_irq(struct pt_regs *regs)
+static inline unsigned int xics_remap_irq(unsigned int vec)
 {
-       unsigned int cpu = smp_processor_id();
-       unsigned int vec;
-       int irq;
+       unsigned int irq;
 
-       vec = ops->xirr_info_get(cpu);
-       /*  (vec >> 24) == old priority */
        vec &= 0x00ffffff;
 
-       /* for sanity, this had better be < NR_IRQS - 16 */
-       if (vec == xics_irq_8259_cascade_real) {
-               irq = i8259_irq(regs);
-               xics_end_irq(irq_offset_up(xics_irq_8259_cascade));
-       } else if (vec == XICS_IRQ_SPURIOUS) {
-               irq = -1;
-       } else {
-               irq = real_irq_to_virt(vec);
-               if (irq == NO_IRQ)
-                       irq = real_irq_to_virt_slowpath(vec);
-               if (irq == NO_IRQ) {
-                       printk(KERN_ERR "Interrupt %u (real) is invalid,"
-                              " disabling it.\n", vec);
-                       xics_disable_real_irq(vec);
-               } else
-                       irq = irq_offset_up(irq);
-       }
-       return irq;
+       if (vec == XICS_IRQ_SPURIOUS)
+               return NO_IRQ;
+       irq = irq_radix_revmap(xics_host, vec);
+       if (likely(irq != NO_IRQ))
+               return irq;
+
+       printk(KERN_ERR "Interrupt %u (real) is invalid,"
+              " disabling it.\n", vec);
+       xics_mask_real_irq(vec);
+       return NO_IRQ;
 }
 
-#ifdef CONFIG_SMP
+static unsigned int xics_get_irq_direct(struct pt_regs *regs)
+{
+       unsigned int cpu = smp_processor_id();
 
-static irqreturn_t xics_ipi_action(int irq, void *dev_id, struct pt_regs *regs)
+       return xics_remap_irq(direct_xirr_info_get(cpu));
+}
+
+static unsigned int xics_get_irq_lpar(struct pt_regs *regs)
 {
-       int cpu = smp_processor_id();
+       unsigned int cpu = smp_processor_id();
+
+       return xics_remap_irq(lpar_xirr_info_get(cpu));
+}
 
-       ops->qirr_info(cpu, 0xff);
+#ifdef CONFIG_SMP
 
+static irqreturn_t xics_ipi_dispatch(int cpu, struct pt_regs *regs)
+{
        WARN_ON(cpu_is_offline(cpu));
 
        while (xics_ipi_message[cpu].value) {
@@ -419,18 +377,88 @@ static irqreturn_t xics_ipi_action(int irq, void *dev_id, struct pt_regs *regs)
        return IRQ_HANDLED;
 }
 
+static irqreturn_t xics_ipi_action_direct(int irq, void *dev_id, struct pt_regs *regs)
+{
+       int cpu = smp_processor_id();
+
+       direct_qirr_info(cpu, 0xff);
+
+       return xics_ipi_dispatch(cpu, regs);
+}
+
+static irqreturn_t xics_ipi_action_lpar(int irq, void *dev_id, struct pt_regs *regs)
+{
+       int cpu = smp_processor_id();
+
+       lpar_qirr_info(cpu, 0xff);
+
+       return xics_ipi_dispatch(cpu, regs);
+}
+
 void xics_cause_IPI(int cpu)
 {
-       ops->qirr_info(cpu, IPI_PRIORITY);
+       if (firmware_has_feature(FW_FEATURE_LPAR))
+               lpar_qirr_info(cpu, IPI_PRIORITY);
+       else
+               direct_qirr_info(cpu, IPI_PRIORITY);
 }
+
 #endif /* CONFIG_SMP */
 
+static void xics_set_cpu_priority(int cpu, unsigned char cppr)
+{
+       if (firmware_has_feature(FW_FEATURE_LPAR))
+               lpar_cppr_info(cpu, cppr);
+       else
+               direct_cppr_info(cpu, cppr);
+       iosync();
+}
+
+static void xics_set_affinity(unsigned int virq, cpumask_t cpumask)
+{
+       unsigned int irq;
+       int status;
+       int xics_status[2];
+       unsigned long newmask;
+       cpumask_t tmp = CPU_MASK_NONE;
+
+       irq = (unsigned int)irq_map[virq].hwirq;
+       if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS)
+               return;
+
+       status = rtas_call(ibm_get_xive, 1, 3, xics_status, irq);
+
+       if (status) {
+               printk(KERN_ERR "xics_set_affinity: irq=%u ibm,get-xive "
+                      "returns %d\n", irq, status);
+               return;
+       }
+
+       /* For the moment only implement delivery to all cpus or one cpu */
+       if (cpus_equal(cpumask, CPU_MASK_ALL)) {
+               newmask = default_distrib_server;
+       } else {
+               cpus_and(tmp, cpu_online_map, cpumask);
+               if (cpus_empty(tmp))
+                       return;
+               newmask = get_hard_smp_processor_id(first_cpu(tmp));
+       }
+
+       status = rtas_call(ibm_set_xive, 3, 1, NULL,
+                               irq, newmask, xics_status[1]);
+
+       if (status) {
+               printk(KERN_ERR "xics_set_affinity: irq=%u ibm,set-xive "
+                      "returns %d\n", irq, status);
+               return;
+       }
+}
+
 void xics_setup_cpu(void)
 {
        int cpu = smp_processor_id();
 
-       ops->cppr_info(cpu, 0xff);
-       iosync();
+       xics_set_cpu_priority(cpu, 0xff);
 
        /*
         * Put the calling processor into the GIQ.  This is really only
@@ -443,72 +471,266 @@ void xics_setup_cpu(void)
                (1UL << interrupt_server_size) - 1 - default_distrib_server, 1);
 }
 
-void xics_init_IRQ(void)
+
+static struct irq_chip xics_pic_direct = {
+       .typename = " XICS     ",
+       .startup = xics_startup,
+       .mask = xics_mask_irq,
+       .unmask = xics_unmask_irq,
+       .eoi = xics_eoi_direct,
+       .set_affinity = xics_set_affinity
+};
+
+
+static struct irq_chip xics_pic_lpar = {
+       .typename = " XICS     ",
+       .startup = xics_startup,
+       .mask = xics_mask_irq,
+       .unmask = xics_unmask_irq,
+       .eoi = xics_eoi_lpar,
+       .set_affinity = xics_set_affinity
+};
+
+
+static int xics_host_match(struct irq_host *h, struct device_node *node)
+{
+       /* IBM machines have interrupt parents of various funky types for things
+        * like vdevices, events, etc... The trick we use here is to match
+        * everything here except the legacy 8259 which is compatible "chrp,iic"
+        */
+       return !device_is_compatible(node, "chrp,iic");
+}
+
+static int xics_host_map_direct(struct irq_host *h, unsigned int virq,
+                               irq_hw_number_t hw, unsigned int flags)
+{
+       unsigned int sense = flags & IRQ_TYPE_SENSE_MASK;
+
+       pr_debug("xics: map_direct virq %d, hwirq 0x%lx, flags: 0x%x\n",
+                virq, hw, flags);
+
+       if (sense && sense != IRQ_TYPE_LEVEL_LOW)
+               printk(KERN_WARNING "xics: using unsupported sense 0x%x"
+                      " for irq %d (h: 0x%lx)\n", flags, virq, hw);
+
+       get_irq_desc(virq)->status |= IRQ_LEVEL;
+       set_irq_chip_and_handler(virq, &xics_pic_direct, handle_fasteoi_irq);
+       return 0;
+}
+
+static int xics_host_map_lpar(struct irq_host *h, unsigned int virq,
+                             irq_hw_number_t hw, unsigned int flags)
+{
+       unsigned int sense = flags & IRQ_TYPE_SENSE_MASK;
+
+       pr_debug("xics: map_lpar virq %d, hwirq 0x%lx, flags: 0x%x\n",
+                virq, hw, flags);
+
+       if (sense && sense != IRQ_TYPE_LEVEL_LOW)
+               printk(KERN_WARNING "xics: using unsupported sense 0x%x"
+                      " for irq %d (h: 0x%lx)\n", flags, virq, hw);
+
+       get_irq_desc(virq)->status |= IRQ_LEVEL;
+       set_irq_chip_and_handler(virq, &xics_pic_lpar, handle_fasteoi_irq);
+       return 0;
+}
+
+static int xics_host_xlate(struct irq_host *h, struct device_node *ct,
+                          u32 *intspec, unsigned int intsize,
+                          irq_hw_number_t *out_hwirq, unsigned int *out_flags)
+
+{
+       /* Current xics implementation translates everything
+        * to level. It is not technically right for MSIs but this
+        * is irrelevant at this point. We might get smarter in the future
+        */
+       *out_hwirq = intspec[0];
+       *out_flags = IRQ_TYPE_LEVEL_LOW;
+
+       return 0;
+}
+
+static struct irq_host_ops xics_host_direct_ops = {
+       .match = xics_host_match,
+       .map = xics_host_map_direct,
+       .xlate = xics_host_xlate,
+};
+
+static struct irq_host_ops xics_host_lpar_ops = {
+       .match = xics_host_match,
+       .map = xics_host_map_lpar,
+       .xlate = xics_host_xlate,
+};
+
+static void __init xics_init_host(void)
+{
+       struct irq_host_ops *ops;
+
+       if (firmware_has_feature(FW_FEATURE_LPAR))
+               ops = &xics_host_lpar_ops;
+       else
+               ops = &xics_host_direct_ops;
+       xics_host = irq_alloc_host(IRQ_HOST_MAP_TREE, 0, ops,
+                                  XICS_IRQ_SPURIOUS);
+       BUG_ON(xics_host == NULL);
+       irq_set_default_host(xics_host);
+}
+
+static void __init xics_map_one_cpu(int hw_id, unsigned long addr,
+                                    unsigned long size)
 {
+#ifdef CONFIG_SMP
        int i;
-       unsigned long intr_size = 0;
-       struct device_node *np;
-       uint *ireg, ilen, indx = 0;
-       unsigned long intr_base = 0;
-       struct xics_interrupt_node {
-               unsigned long addr;
-               unsigned long size;
-       } intnodes[NR_CPUS];
 
-       ppc64_boot_msg(0x20, "XICS Init");
+       /* This may look gross but it's good enough for now, we don't quite
+        * have a hard -> linux processor id matching.
+        */
+       for_each_possible_cpu(i) {
+               if (!cpu_present(i))
+                       continue;
+               if (hw_id == get_hard_smp_processor_id(i)) {
+                       xics_per_cpu[i] = ioremap(addr, size);
+                       return;
+               }
+       }
+#else
+       if (hw_id != 0)
+               return;
+       xics_per_cpu[0] = ioremap(addr, size);
+#endif /* CONFIG_SMP */
+}
 
-       ibm_get_xive = rtas_token("ibm,get-xive");
-       ibm_set_xive = rtas_token("ibm,set-xive");
-       ibm_int_on  = rtas_token("ibm,int-on");
-       ibm_int_off = rtas_token("ibm,int-off");
+static void __init xics_init_one_node(struct device_node *np,
+                                     unsigned int *indx)
+{
+       unsigned int ilen;
+       u32 *ireg;
 
-       np = of_find_node_by_type(NULL, "PowerPC-External-Interrupt-Presentation");
-       if (!np)
-               panic("xics_init_IRQ: can't find interrupt presentation");
+       /* This code does the theorically broken assumption that the interrupt
+        * server numbers are the same as the hard CPU numbers.
+        * This happens to be the case so far but we are playing with fire...
+        * should be fixed one of these days. -BenH.
+        */
+       ireg = (u32 *)get_property(np, "ibm,interrupt-server-ranges", NULL);
 
-nextnode:
-       ireg = (uint *)get_property(np, "ibm,interrupt-server-ranges", NULL);
+       /* Do that ever happen ? we'll know soon enough... but even good'old
+        * f80 does have that property ..
+        */
+       WARN_ON(ireg == NULL);
        if (ireg) {
                /*
                 * set node starting index for this node
                 */
-               indx = *ireg;
+               *indx = *ireg;
        }
-
-       ireg = (uint *)get_property(np, "reg", &ilen);
+       ireg = (u32 *)get_property(np, "reg", &ilen);
        if (!ireg)
                panic("xics_init_IRQ: can't find interrupt reg property");
 
-       while (ilen) {
-               intnodes[indx].addr = (unsigned long)*ireg++ << 32;
-               ilen -= sizeof(uint);
-               intnodes[indx].addr |= *ireg++;
-               ilen -= sizeof(uint);
-               intnodes[indx].size = (unsigned long)*ireg++ << 32;
-               ilen -= sizeof(uint);
-               intnodes[indx].size |= *ireg++;
-               ilen -= sizeof(uint);
-               indx++;
-               if (indx >= NR_CPUS) break;
+       while (ilen >= (4 * sizeof(u32))) {
+               unsigned long addr, size;
+
+               /* XXX Use proper OF parsing code here !!! */
+               addr = (unsigned long)*ireg++ << 32;
+               ilen -= sizeof(u32);
+               addr |= *ireg++;
+               ilen -= sizeof(u32);
+               size = (unsigned long)*ireg++ << 32;
+               ilen -= sizeof(u32);
+               size |= *ireg++;
+               ilen -= sizeof(u32);
+               xics_map_one_cpu(*indx, addr, size);
+               (*indx)++;
+       }
+}
+
+
+static void __init xics_setup_8259_cascade(void)
+{
+       struct device_node *np, *old, *found = NULL;
+       int cascade, naddr;
+       u32 *addrp;
+       unsigned long intack = 0;
+
+       for_each_node_by_type(np, "interrupt-controller")
+               if (device_is_compatible(np, "chrp,iic")) {
+                       found = np;
+                       break;
+               }
+       if (found == NULL) {
+               printk(KERN_DEBUG "xics: no ISA interrupt controller\n");
+               return;
+       }
+       cascade = irq_of_parse_and_map(found, 0);
+       if (cascade == NO_IRQ) {
+               printk(KERN_ERR "xics: failed to map cascade interrupt");
+               return;
+       }
+       pr_debug("xics: cascade mapped to irq %d\n", cascade);
+
+       for (old = of_node_get(found); old != NULL ; old = np) {
+               np = of_get_parent(old);
+               of_node_put(old);
+               if (np == NULL)
+                       break;
+               if (strcmp(np->name, "pci") != 0)
+                       continue;
+               addrp = (u32 *)get_property(np, "8259-interrupt-acknowledge", NULL);
+               if (addrp == NULL)
+                       continue;
+               naddr = prom_n_addr_cells(np);
+               intack = addrp[naddr-1];
+               if (naddr > 1)
+                       intack |= ((unsigned long)addrp[naddr-2]) << 32;
+       }
+       if (intack)
+               printk(KERN_DEBUG "xics: PCI 8259 intack at 0x%016lx\n", intack);
+       i8259_init(found, intack);
+       of_node_put(found);
+       set_irq_chained_handler(cascade, pseries_8259_cascade);
+}
+
+void __init xics_init_IRQ(void)
+{
+       int i;
+       struct device_node *np;
+       u32 *ireg, ilen, indx = 0;
+       int found = 0;
+
+       ppc64_boot_msg(0x20, "XICS Init");
+
+       ibm_get_xive = rtas_token("ibm,get-xive");
+       ibm_set_xive = rtas_token("ibm,set-xive");
+       ibm_int_on  = rtas_token("ibm,int-on");
+       ibm_int_off = rtas_token("ibm,int-off");
+
+       for_each_node_by_type(np, "PowerPC-External-Interrupt-Presentation") {
+               found = 1;
+               if (firmware_has_feature(FW_FEATURE_LPAR))
+                       break;
+               xics_init_one_node(np, &indx);
        }
+       if (found == 0)
+               return;
 
-       np = of_find_node_by_type(np, "PowerPC-External-Interrupt-Presentation");
-       if ((indx < NR_CPUS) && np) goto nextnode;
+       xics_init_host();
 
        /* Find the server numbers for the boot cpu. */
        for (np = of_find_node_by_type(NULL, "cpu");
             np;
             np = of_find_node_by_type(np, "cpu")) {
-               ireg = (uint *)get_property(np, "reg", &ilen);
+               ireg = (u32 *)get_property(np, "reg", &ilen);
                if (ireg && ireg[0] == get_hard_smp_processor_id(boot_cpuid)) {
-                       ireg = (uint *)get_property(np, "ibm,ppc-interrupt-gserver#s",
-                                                   &ilen);
+                       ireg = (u32 *)get_property(np,
+                                                 "ibm,ppc-interrupt-gserver#s",
+                                                  &ilen);
                        i = ilen / sizeof(int);
                        if (ireg && i > 0) {
                                default_server = ireg[0];
-                               default_distrib_server = ireg[i-1]; /* take last element */
+                               /* take last element */
+                               default_distrib_server = ireg[i-1];
                        }
-                       ireg = (uint *)get_property(np,
+                       ireg = (u32 *)get_property(np,
                                        "ibm,interrupt-server#-size", NULL);
                        if (ireg)
                                interrupt_server_size = *ireg;
@@ -517,132 +739,48 @@ nextnode:
        }
        of_node_put(np);
 
-       intr_base = intnodes[0].addr;
-       intr_size = intnodes[0].size;
-
-       np = of_find_node_by_type(NULL, "interrupt-controller");
-       if (!np) {
-               printk(KERN_DEBUG "xics: no ISA interrupt controller\n");
-               xics_irq_8259_cascade_real = -1;
-               xics_irq_8259_cascade = -1;
-       } else {
-               ireg = (uint *) get_property(np, "interrupts", NULL);
-               if (!ireg)
-                       panic("xics_init_IRQ: can't find ISA interrupts property");
-
-               xics_irq_8259_cascade_real = *ireg;
-               xics_irq_8259_cascade
-                       = virt_irq_create_mapping(xics_irq_8259_cascade_real);
-               i8259_init(0, 0);
-               of_node_put(np);
-       }
-
        if (firmware_has_feature(FW_FEATURE_LPAR))
-               ops = &pSeriesLP_ops;
-       else {
-#ifdef CONFIG_SMP
-               for_each_possible_cpu(i) {
-                       int hard_id;
-
-                       /* FIXME: Do this dynamically! --RR */
-                       if (!cpu_present(i))
-                               continue;
-
-                       hard_id = get_hard_smp_processor_id(i);
-                       xics_per_cpu[i] = ioremap(intnodes[hard_id].addr,
-                                                 intnodes[hard_id].size);
-               }
-#else
-               xics_per_cpu[0] = ioremap(intr_base, intr_size);
-#endif /* CONFIG_SMP */
-       }
-
-       for (i = irq_offset_value(); i < NR_IRQS; ++i)
-               get_irq_desc(i)->chip = &xics_pic;
+               ppc_md.get_irq = xics_get_irq_lpar;
+       else
+               ppc_md.get_irq = xics_get_irq_direct;
 
        xics_setup_cpu();
 
+       xics_setup_8259_cascade();
+
        ppc64_boot_msg(0x21, "XICS Done");
 }
 
-/*
- * We cant do this in init_IRQ because we need the memory subsystem up for
- * request_irq()
- */
-static int __init xics_setup_i8259(void)
-{
-       if (ppc64_interrupt_controller == IC_PPC_XIC &&
-           xics_irq_8259_cascade != -1) {
-               if (request_irq(irq_offset_up(xics_irq_8259_cascade),
-                               no_action, 0, "8259 cascade", NULL))
-                       printk(KERN_ERR "xics_setup_i8259: couldn't get 8259 "
-                                       "cascade\n");
-       }
-       return 0;
-}
-arch_initcall(xics_setup_i8259);
 
 #ifdef CONFIG_SMP
 void xics_request_IPIs(void)
 {
-       virt_irq_to_real_map[XICS_IPI] = XICS_IPI;
+       unsigned int ipi;
 
-       /* IPIs are marked SA_INTERRUPT as they must run with irqs disabled */
-       request_irq(irq_offset_up(XICS_IPI), xics_ipi_action, SA_INTERRUPT,
-                   "IPI", NULL);
-       get_irq_desc(irq_offset_up(XICS_IPI))->status |= IRQ_PER_CPU;
-}
-#endif
-
-static void xics_set_affinity(unsigned int virq, cpumask_t cpumask)
-{
-       unsigned int irq;
-       int status;
-       int xics_status[2];
-       unsigned long newmask;
-       cpumask_t tmp = CPU_MASK_NONE;
-
-       irq = virt_irq_to_real(irq_offset_down(virq));
-       if (irq == XICS_IPI || irq == NO_IRQ)
-               return;
-
-       status = rtas_call(ibm_get_xive, 1, 3, xics_status, irq);
+       ipi = irq_create_mapping(xics_host, XICS_IPI, 0);
+       BUG_ON(ipi == NO_IRQ);
 
-       if (status) {
-               printk(KERN_ERR "xics_set_affinity: irq=%u ibm,get-xive "
-                      "returns %d\n", irq, status);
-               return;
-       }
-
-       /* For the moment only implement delivery to all cpus or one cpu */
-       if (cpus_equal(cpumask, CPU_MASK_ALL)) {
-               newmask = default_distrib_server;
-       } else {
-               cpus_and(tmp, cpu_online_map, cpumask);
-               if (cpus_empty(tmp))
-                       return;
-               newmask = get_hard_smp_processor_id(first_cpu(tmp));
-       }
-
-       status = rtas_call(ibm_set_xive, 3, 1, NULL,
-                               irq, newmask, xics_status[1]);
-
-       if (status) {
-               printk(KERN_ERR "xics_set_affinity: irq=%u ibm,set-xive "
-                      "returns %d\n", irq, status);
-               return;
-       }
+       /*
+        * IPIs are marked IRQF_DISABLED as they must run with irqs
+        * disabled
+        */
+       set_irq_handler(ipi, handle_percpu_irq);
+       if (firmware_has_feature(FW_FEATURE_LPAR))
+               request_irq(ipi, xics_ipi_action_lpar, IRQF_DISABLED,
+                           "IPI", NULL);
+       else
+               request_irq(ipi, xics_ipi_action_direct, IRQF_DISABLED,
+                           "IPI", NULL);
 }
+#endif /* CONFIG_SMP */
 
 void xics_teardown_cpu(int secondary)
 {
        int cpu = smp_processor_id();
+       unsigned int ipi;
+       struct irq_desc *desc;
 
-       ops->cppr_info(cpu, 0x00);
-       iosync();
-
-       /* Clear IPI */
-       ops->qirr_info(cpu, 0xff);
+       xics_set_cpu_priority(cpu, 0);
 
        /*
         * we need to EOI the IPI if we got here from kexec down IPI
@@ -651,7 +789,13 @@ void xics_teardown_cpu(int secondary)
         * should we be flagging idle loop instead?
         * or creating some task to be scheduled?
         */
-       ops->xirr_info_set(cpu, XICS_IPI);
+
+       ipi = irq_find_mapping(xics_host, XICS_IPI);
+       if (ipi == XICS_IRQ_SPURIOUS)
+               return;
+       desc = get_irq_desc(ipi);
+       if (desc->chip && desc->chip->eoi)
+               desc->chip->eoi(XICS_IPI);
 
        /*
         * Some machines need to have at least one cpu in the GIQ,
@@ -659,8 +803,8 @@ void xics_teardown_cpu(int secondary)
         */
        if (secondary)
                rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE,
-                       (1UL << interrupt_server_size) - 1 -
-                       default_distrib_server, 0);
+                                  (1UL << interrupt_server_size) - 1 -
+                                  default_distrib_server, 0);
 }
 
 #ifdef CONFIG_HOTPLUG_CPU
@@ -672,8 +816,7 @@ void xics_migrate_irqs_away(void)
        unsigned int irq, virq, cpu = smp_processor_id();
 
        /* Reject any interrupt that was queued to us... */
-       ops->cppr_info(cpu, 0);
-       iosync();
+       xics_set_cpu_priority(cpu, 0);
 
        /* remove ourselves from the global interrupt queue */
        status = rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE,
@@ -681,24 +824,23 @@ void xics_migrate_irqs_away(void)
        WARN_ON(status < 0);
 
        /* Allow IPIs again... */
-       ops->cppr_info(cpu, DEFAULT_PRIORITY);
-       iosync();
+       xics_set_cpu_priority(cpu, DEFAULT_PRIORITY);
 
        for_each_irq(virq) {
-               irq_desc_t *desc;
+               struct irq_desc *desc;
                int xics_status[2];
                unsigned long flags;
 
                /* We cant set affinity on ISA interrupts */
-               if (virq < irq_offset_value())
+               if (virq < NUM_ISA_INTERRUPTS)
                        continue;
-
-               desc = get_irq_desc(virq);
-               irq = virt_irq_to_real(irq_offset_down(virq));
-
+               if (irq_map[virq].host != xics_host)
+                       continue;
+               irq = (unsigned int)irq_map[virq].hwirq;
                /* We need to get IPIs still. */
-               if (irq == XICS_IPI || irq == NO_IRQ)
+               if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS)
                        continue;
+               desc = get_irq_desc(virq);
 
                /* We only need to migrate enabled IRQS */
                if (desc == NULL || desc->chip == NULL
index e14c70868f1d6d90928b71797747f76365648da9..6ee1055b0ffb60ba3e8afd858442aad8b79d7110 100644 (file)
 
 #include <linux/cache.h>
 
-void xics_init_IRQ(void);
-int xics_get_irq(struct pt_regs *);
-void xics_setup_cpu(void);
-void xics_teardown_cpu(int secondary);
-void xics_cause_IPI(int cpu);
-void xics_request_IPIs(void);
-void xics_migrate_irqs_away(void);
+extern void xics_init_IRQ(void);
+extern void xics_setup_cpu(void);
+extern void xics_teardown_cpu(int secondary);
+extern void xics_cause_IPI(int cpu);
+extern  void xics_request_IPIs(void);
+extern void xics_migrate_irqs_away(void);
 
 /* first argument is ignored for now*/
 void pSeriesLP_cppr_info(int n_cpu, u8 value);
@@ -31,4 +30,8 @@ struct xics_ipi_struct {
 
 extern struct xics_ipi_struct xics_ipi_message[NR_CPUS] __cacheline_aligned;
 
+struct irq_desc;
+extern void pseries_8259_cascade(unsigned int irq, struct irq_desc *desc,
+                                struct pt_regs *regs);
+
 #endif /* _POWERPC_KERNEL_XICS_H */
index 054bd8b41ef51d5851c37c47ae0bb6a5513bf056..cebfae2426022d46ac740a64c551e01ded6ad251 100644 (file)
@@ -4,7 +4,6 @@ endif
 
 obj-$(CONFIG_MPIC)             += mpic.o
 obj-$(CONFIG_PPC_INDIRECT_PCI) += indirect_pci.o
-obj-$(CONFIG_PPC_I8259)                += i8259.o
 obj-$(CONFIG_PPC_MPC106)       += grackle.o
 obj-$(CONFIG_BOOKE)            += dcr.o
 obj-$(CONFIG_40x)              += dcr.o
@@ -14,3 +13,7 @@ obj-$(CONFIG_PPC_83xx)                += ipic.o
 obj-$(CONFIG_FSL_SOC)          += fsl_soc.o
 obj-$(CONFIG_PPC_TODC)         += todc.o
 obj-$(CONFIG_TSI108_BRIDGE)    += tsi108_pci.o tsi108_dev.o
+
+ifeq ($(CONFIG_PPC_MERGE),y)
+obj-$(CONFIG_PPC_I8259)                += i8259.o
+ endif
index 7c7f34ce4986621808f0d5d731f55f9fe19e6711..e32fadde1f7746c92c1231a6161fa949de3a534f 100644 (file)
@@ -27,7 +27,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/types.h>
 #include <linux/slab.h>
index 71a3275935eca1cc76ec0d3f75ccddb62b5461a1..e983972132d8cf2f37d3cbd1fecf5ac19bb8eed3 100644 (file)
@@ -9,7 +9,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 2bff30f6d6357aa4b44a8bba2ae7ec17d2d17fcd..72c73a6105cd1b66c7019ea5875c4ccf87a1dc4b 100644 (file)
@@ -6,11 +6,16 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
  */
+#undef DEBUG
+
 #include <linux/init.h>
 #include <linux/ioport.h>
 #include <linux/interrupt.h>
+#include <linux/kernel.h>
+#include <linux/delay.h>
 #include <asm/io.h>
 #include <asm/i8259.h>
+#include <asm/prom.h>
 
 static volatile void __iomem *pci_intack; /* RO, gives us the irq vector */
 
@@ -20,7 +25,8 @@ static unsigned char cached_8259[2] = { 0xff, 0xff };
 
 static DEFINE_SPINLOCK(i8259_lock);
 
-static int i8259_pic_irq_offset;
+static struct device_node *i8259_node;
+static struct irq_host *i8259_host;
 
 /*
  * Acknowledge the IRQ using either the PCI host bridge's interrupt
@@ -28,16 +34,18 @@ static int i8259_pic_irq_offset;
  * which is called.  It should be noted that polling is broken on some
  * IBM and Motorola PReP boxes so we must use the int-ack feature on them.
  */
-int i8259_irq(struct pt_regs *regs)
+unsigned int i8259_irq(struct pt_regs *regs)
 {
        int irq;
-
-       spin_lock(&i8259_lock);
+       int lock = 0;
 
        /* Either int-ack or poll for the IRQ */
        if (pci_intack)
                irq = readb(pci_intack);
        else {
+               spin_lock(&i8259_lock);
+               lock = 1;
+
                /* Perform an interrupt acknowledge cycle on controller 1. */
                outb(0x0C, 0x20);               /* prepare for poll */
                irq = inb(0x20) & 7;
@@ -62,16 +70,13 @@ int i8259_irq(struct pt_regs *regs)
                if (!pci_intack)
                        outb(0x0B, 0x20);       /* ISR register */
                if(~inb(0x20) & 0x80)
-                       irq = -1;
-       }
+                       irq = NO_IRQ;
+       } else if (irq == 0xff)
+               irq = NO_IRQ;
 
-       spin_unlock(&i8259_lock);
-       return irq + i8259_pic_irq_offset;
-}
-
-int i8259_irq_cascade(struct pt_regs *regs, void *unused)
-{
-       return i8259_irq(regs);
+       if (lock)
+               spin_unlock(&i8259_lock);
+       return irq;
 }
 
 static void i8259_mask_and_ack_irq(unsigned int irq_nr)
@@ -79,7 +84,6 @@ static void i8259_mask_and_ack_irq(unsigned int irq_nr)
        unsigned long flags;
 
        spin_lock_irqsave(&i8259_lock, flags);
-       irq_nr -= i8259_pic_irq_offset;
        if (irq_nr > 7) {
                cached_A1 |= 1 << (irq_nr-8);
                inb(0xA1);      /* DUMMY */
@@ -105,8 +109,9 @@ static void i8259_mask_irq(unsigned int irq_nr)
 {
        unsigned long flags;
 
+       pr_debug("i8259_mask_irq(%d)\n", irq_nr);
+
        spin_lock_irqsave(&i8259_lock, flags);
-       irq_nr -= i8259_pic_irq_offset;
        if (irq_nr < 8)
                cached_21 |= 1 << irq_nr;
        else
@@ -119,8 +124,9 @@ static void i8259_unmask_irq(unsigned int irq_nr)
 {
        unsigned long flags;
 
+       pr_debug("i8259_unmask_irq(%d)\n", irq_nr);
+
        spin_lock_irqsave(&i8259_lock, flags);
-       irq_nr -= i8259_pic_irq_offset;
        if (irq_nr < 8)
                cached_21 &= ~(1 << irq_nr);
        else
@@ -129,19 +135,11 @@ static void i8259_unmask_irq(unsigned int irq_nr)
        spin_unlock_irqrestore(&i8259_lock, flags);
 }
 
-static void i8259_end_irq(unsigned int irq)
-{
-       if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))
-           && irq_desc[irq].action)
-               i8259_unmask_irq(irq);
-}
-
-struct hw_interrupt_type i8259_pic = {
-       .typename = " i8259    ",
-       .enable = i8259_unmask_irq,
-       .disable = i8259_mask_irq,
-       .ack = i8259_mask_and_ack_irq,
-       .end = i8259_end_irq,
+static struct irq_chip i8259_pic = {
+       .typename       = " i8259    ",
+       .mask           = i8259_mask_irq,
+       .unmask         = i8259_unmask_irq,
+       .mask_ack       = i8259_mask_and_ack_irq,
 };
 
 static struct resource pic1_iores = {
@@ -165,25 +163,84 @@ static struct resource pic_edgectrl_iores = {
        .flags = IORESOURCE_BUSY,
 };
 
-static struct irqaction i8259_irqaction = {
-       .handler = no_action,
-       .flags = SA_INTERRUPT,
-       .mask = CPU_MASK_NONE,
-       .name = "82c59 secondary cascade",
+static int i8259_host_match(struct irq_host *h, struct device_node *node)
+{
+       return i8259_node == NULL || i8259_node == node;
+}
+
+static int i8259_host_map(struct irq_host *h, unsigned int virq,
+                         irq_hw_number_t hw, unsigned int flags)
+{
+       pr_debug("i8259_host_map(%d, 0x%lx)\n", virq, hw);
+
+       /* We block the internal cascade */
+       if (hw == 2)
+               get_irq_desc(virq)->status |= IRQ_NOREQUEST;
+
+       /* We use the level stuff only for now, we might want to
+        * be more cautious here but that works for now
+        */
+       get_irq_desc(virq)->status |= IRQ_LEVEL;
+       set_irq_chip_and_handler(virq, &i8259_pic, handle_level_irq);
+       return 0;
+}
+
+static void i8259_host_unmap(struct irq_host *h, unsigned int virq)
+{
+       /* Make sure irq is masked in hardware */
+       i8259_mask_irq(virq);
+
+       /* remove chip and handler */
+       set_irq_chip_and_handler(virq, NULL, NULL);
+
+       /* Make sure it's completed */
+       synchronize_irq(virq);
+}
+
+static int i8259_host_xlate(struct irq_host *h, struct device_node *ct,
+                           u32 *intspec, unsigned int intsize,
+                           irq_hw_number_t *out_hwirq, unsigned int *out_flags)
+{
+       static unsigned char map_isa_senses[4] = {
+               IRQ_TYPE_LEVEL_LOW,
+               IRQ_TYPE_LEVEL_HIGH,
+               IRQ_TYPE_EDGE_FALLING,
+               IRQ_TYPE_EDGE_RISING,
+       };
+
+       *out_hwirq = intspec[0];
+       if (intsize > 1 && intspec[1] < 4)
+               *out_flags = map_isa_senses[intspec[1]];
+       else
+               *out_flags = IRQ_TYPE_NONE;
+
+       return 0;
+}
+
+static struct irq_host_ops i8259_host_ops = {
+       .match = i8259_host_match,
+       .map = i8259_host_map,
+       .unmap = i8259_host_unmap,
+       .xlate = i8259_host_xlate,
 };
 
-/*
- * i8259_init()
- * intack_addr - PCI interrupt acknowledge (real) address which will return
- *               the active irq from the 8259
+/****
+ * i8259_init - Initialize the legacy controller
+ * @node: device node of the legacy PIC (can be NULL, but then, it will match
+ *        all interrupts, so beware)
+ * @intack_addr: PCI interrupt acknowledge (real) address which will return
+ *                      the active irq from the 8259
  */
-void __init i8259_init(unsigned long intack_addr, int offset)
+void i8259_init(struct device_node *node, unsigned long intack_addr)
 {
        unsigned long flags;
-       int i;
 
+       /* initialize the controller */
        spin_lock_irqsave(&i8259_lock, flags);
-       i8259_pic_irq_offset = offset;
+
+       /* Mask all first */
+       outb(0xff, 0xA1);
+       outb(0xff, 0x21);
 
        /* init master interrupt controller */
        outb(0x11, 0x20); /* Start init sequence */
@@ -197,21 +254,36 @@ void __init i8259_init(unsigned long intack_addr, int offset)
        outb(0x02, 0xA1); /* edge triggered, Cascade (slave) on IRQ2 */
        outb(0x01, 0xA1); /* Select 8086 mode */
 
+       /* That thing is slow */
+       udelay(100);
+
        /* always read ISR */
        outb(0x0B, 0x20);
        outb(0x0B, 0xA0);
 
-       /* Mask all interrupts */
+       /* Unmask the internal cascade */
+       cached_21 &= ~(1 << 2);
+
+       /* Set interrupt masks */
        outb(cached_A1, 0xA1);
        outb(cached_21, 0x21);
 
        spin_unlock_irqrestore(&i8259_lock, flags);
 
-       for (i = 0; i < NUM_ISA_INTERRUPTS; ++i)
-               irq_desc[offset + i].chip = &i8259_pic;
+       /* create a legacy host */
+       if (node)
+               i8259_node = of_node_get(node);
+       i8259_host = irq_alloc_host(IRQ_HOST_MAP_LEGACY, 0, &i8259_host_ops, 0);
+       if (i8259_host == NULL) {
+               printk(KERN_ERR "i8259: failed to allocate irq host !\n");
+               return;
+       }
 
        /* reserve our resources */
-       setup_irq(offset + 2, &i8259_irqaction);
+       /* XXX should we continue doing that ? it seems to cause problems
+        * with further requesting of PCI IO resources for that range...
+        * need to look into it.
+        */
        request_resource(&ioport_resource, &pic1_iores);
        request_resource(&ioport_resource, &pic2_iores);
        request_resource(&ioport_resource, &pic_edgectrl_iores);
@@ -219,4 +291,5 @@ void __init i8259_init(unsigned long intack_addr, int offset)
        if (intack_addr != 0)
                pci_intack = ioremap(intack_addr, 1);
 
+       printk(KERN_INFO "i8259 legacy interrupt controller initialized\n");
 }
index 28df9c827ca66b409d0b0427f09c22944dad2079..7d31d7cc392dac2fe902cab2e8fdbd7b8c1ca58c 100644 (file)
@@ -17,7 +17,6 @@
 #undef DEBUG_IRQ
 #undef DEBUG_LOW
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -101,8 +100,8 @@ static inline u32 _mpic_cpu_read(struct mpic *mpic, unsigned int reg)
 
        if (mpic->flags & MPIC_PRIMARY)
                cpu = hard_smp_processor_id();
-
-       return _mpic_read(mpic->flags & MPIC_BIG_ENDIAN, mpic->cpuregs[cpu], reg);
+       return _mpic_read(mpic->flags & MPIC_BIG_ENDIAN,
+                         mpic->cpuregs[cpu], reg);
 }
 
 static inline void _mpic_cpu_write(struct mpic *mpic, unsigned int reg, u32 value)
@@ -341,27 +340,19 @@ static void __init mpic_scan_ht_pics(struct mpic *mpic)
 #endif /* CONFIG_MPIC_BROKEN_U3 */
 
 
+#define mpic_irq_to_hw(virq)   ((unsigned int)irq_map[virq].hwirq)
+
 /* Find an mpic associated with a given linux interrupt */
 static struct mpic *mpic_find(unsigned int irq, unsigned int *is_ipi)
 {
-       struct mpic *mpic = mpics;
-
-       while(mpic) {
-               /* search IPIs first since they may override the main interrupts */
-               if (irq >= mpic->ipi_offset && irq < (mpic->ipi_offset + 4)) {
-                       if (is_ipi)
-                               *is_ipi = 1;
-                       return mpic;
-               }
-               if (irq >= mpic->irq_offset &&
-                   irq < (mpic->irq_offset + mpic->irq_count)) {
-                       if (is_ipi)
-                               *is_ipi = 0;
-                       return mpic;
-               }
-               mpic = mpic -> next;
-       }
-       return NULL;
+       unsigned int src = mpic_irq_to_hw(irq);
+
+       if (irq < NUM_ISA_INTERRUPTS)
+               return NULL;
+       if (is_ipi)
+               *is_ipi = (src >= MPIC_VEC_IPI_0 && src <= MPIC_VEC_IPI_3);
+
+       return irq_desc[irq].chip_data;
 }
 
 /* Convert a cpu mask from logical to physical cpu numbers. */
@@ -379,14 +370,14 @@ static inline u32 mpic_physmask(u32 cpumask)
 /* Get the mpic structure from the IPI number */
 static inline struct mpic * mpic_from_ipi(unsigned int ipi)
 {
-       return container_of(irq_desc[ipi].chip, struct mpic, hc_ipi);
+       return irq_desc[ipi].chip_data;
 }
 #endif
 
 /* Get the mpic structure from the irq number */
 static inline struct mpic * mpic_from_irq(unsigned int irq)
 {
-       return container_of(irq_desc[irq].chip, struct mpic, hc_irq);
+       return irq_desc[irq].chip_data;
 }
 
 /* Send an EOI */
@@ -399,9 +390,7 @@ static inline void mpic_eoi(struct mpic *mpic)
 #ifdef CONFIG_SMP
 static irqreturn_t mpic_ipi_action(int irq, void *dev_id, struct pt_regs *regs)
 {
-       struct mpic *mpic = dev_id;
-
-       smp_message_recv(irq - mpic->ipi_offset, regs);
+       smp_message_recv(mpic_irq_to_hw(irq) - MPIC_VEC_IPI_0, regs);
        return IRQ_HANDLED;
 }
 #endif /* CONFIG_SMP */
@@ -411,11 +400,11 @@ static irqreturn_t mpic_ipi_action(int irq, void *dev_id, struct pt_regs *regs)
  */
 
 
-static void mpic_enable_irq(unsigned int irq)
+static void mpic_unmask_irq(unsigned int irq)
 {
        unsigned int loops = 100000;
        struct mpic *mpic = mpic_from_irq(irq);
-       unsigned int src = irq - mpic->irq_offset;
+       unsigned int src = mpic_irq_to_hw(irq);
 
        DBG("%p: %s: enable_irq: %d (src %d)\n", mpic, mpic->name, irq, src);
 
@@ -430,39 +419,13 @@ static void mpic_enable_irq(unsigned int irq)
                        break;
                }
        } while(mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) & MPIC_VECPRI_MASK);    
-
-#ifdef CONFIG_MPIC_BROKEN_U3
-       if (mpic->flags & MPIC_BROKEN_U3) {
-               unsigned int src = irq - mpic->irq_offset;
-               if (mpic_is_ht_interrupt(mpic, src) &&
-                   (irq_desc[irq].status & IRQ_LEVEL))
-                       mpic_ht_end_irq(mpic, src);
-       }
-#endif /* CONFIG_MPIC_BROKEN_U3 */
-}
-
-static unsigned int mpic_startup_irq(unsigned int irq)
-{
-#ifdef CONFIG_MPIC_BROKEN_U3
-       struct mpic *mpic = mpic_from_irq(irq);
-       unsigned int src = irq - mpic->irq_offset;
-#endif /* CONFIG_MPIC_BROKEN_U3 */
-
-       mpic_enable_irq(irq);
-
-#ifdef CONFIG_MPIC_BROKEN_U3
-       if (mpic_is_ht_interrupt(mpic, src))
-               mpic_startup_ht_interrupt(mpic, src, irq_desc[irq].status);
-#endif /* CONFIG_MPIC_BROKEN_U3 */
-
-       return 0;
 }
 
-static void mpic_disable_irq(unsigned int irq)
+static void mpic_mask_irq(unsigned int irq)
 {
        unsigned int loops = 100000;
        struct mpic *mpic = mpic_from_irq(irq);
-       unsigned int src = irq - mpic->irq_offset;
+       unsigned int src = mpic_irq_to_hw(irq);
 
        DBG("%s: disable_irq: %d (src %d)\n", mpic->name, irq, src);
 
@@ -479,23 +442,58 @@ static void mpic_disable_irq(unsigned int irq)
        } while(!(mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) & MPIC_VECPRI_MASK));
 }
 
-static void mpic_shutdown_irq(unsigned int irq)
+static void mpic_end_irq(unsigned int irq)
 {
+       struct mpic *mpic = mpic_from_irq(irq);
+
+#ifdef DEBUG_IRQ
+       DBG("%s: end_irq: %d\n", mpic->name, irq);
+#endif
+       /* We always EOI on end_irq() even for edge interrupts since that
+        * should only lower the priority, the MPIC should have properly
+        * latched another edge interrupt coming in anyway
+        */
+
+       mpic_eoi(mpic);
+}
+
 #ifdef CONFIG_MPIC_BROKEN_U3
+
+static void mpic_unmask_ht_irq(unsigned int irq)
+{
        struct mpic *mpic = mpic_from_irq(irq);
-       unsigned int src = irq - mpic->irq_offset;
+       unsigned int src = mpic_irq_to_hw(irq);
 
-       if (mpic_is_ht_interrupt(mpic, src))
-               mpic_shutdown_ht_interrupt(mpic, src, irq_desc[irq].status);
+       mpic_unmask_irq(irq);
 
-#endif /* CONFIG_MPIC_BROKEN_U3 */
+       if (irq_desc[irq].status & IRQ_LEVEL)
+               mpic_ht_end_irq(mpic, src);
+}
+
+static unsigned int mpic_startup_ht_irq(unsigned int irq)
+{
+       struct mpic *mpic = mpic_from_irq(irq);
+       unsigned int src = mpic_irq_to_hw(irq);
+
+       mpic_unmask_irq(irq);
+       mpic_startup_ht_interrupt(mpic, src, irq_desc[irq].status);
 
-       mpic_disable_irq(irq);
+       return 0;
 }
 
-static void mpic_end_irq(unsigned int irq)
+static void mpic_shutdown_ht_irq(unsigned int irq)
 {
        struct mpic *mpic = mpic_from_irq(irq);
+       unsigned int src = mpic_irq_to_hw(irq);
+
+       mpic_shutdown_ht_interrupt(mpic, src, irq_desc[irq].status);
+       mpic_mask_irq(irq);
+}
+
+static void mpic_end_ht_irq(unsigned int irq)
+{
+       struct mpic *mpic = mpic_from_irq(irq);
+       unsigned int src = mpic_irq_to_hw(irq);
 
 #ifdef DEBUG_IRQ
        DBG("%s: end_irq: %d\n", mpic->name, irq);
@@ -505,30 +503,25 @@ static void mpic_end_irq(unsigned int irq)
         * latched another edge interrupt coming in anyway
         */
 
-#ifdef CONFIG_MPIC_BROKEN_U3
-       if (mpic->flags & MPIC_BROKEN_U3) {
-               unsigned int src = irq - mpic->irq_offset;
-               if (mpic_is_ht_interrupt(mpic, src) &&
-                   (irq_desc[irq].status & IRQ_LEVEL))
-                       mpic_ht_end_irq(mpic, src);
-       }
-#endif /* CONFIG_MPIC_BROKEN_U3 */
-
+       if (irq_desc[irq].status & IRQ_LEVEL)
+               mpic_ht_end_irq(mpic, src);
        mpic_eoi(mpic);
 }
 
+#endif /* CONFIG_MPIC_BROKEN_U3 */
+
 #ifdef CONFIG_SMP
 
-static void mpic_enable_ipi(unsigned int irq)
+static void mpic_unmask_ipi(unsigned int irq)
 {
        struct mpic *mpic = mpic_from_ipi(irq);
-       unsigned int src = irq - mpic->ipi_offset;
+       unsigned int src = mpic_irq_to_hw(irq) - MPIC_VEC_IPI_0;
 
        DBG("%s: enable_ipi: %d (ipi %d)\n", mpic->name, irq, src);
        mpic_ipi_write(src, mpic_ipi_read(src) & ~MPIC_VECPRI_MASK);
 }
 
-static void mpic_disable_ipi(unsigned int irq)
+static void mpic_mask_ipi(unsigned int irq)
 {
        /* NEVER disable an IPI... that's just plain wrong! */
 }
@@ -541,7 +534,7 @@ static void mpic_end_ipi(unsigned int irq)
         * IPIs are marked IRQ_PER_CPU. This has the side effect of
         * preventing the IRQ_PENDING/IRQ_INPROGRESS logic from
         * applying to them. We EOI them late to avoid re-entering.
-        * We mark IPI's with SA_INTERRUPT as they must run with
+        * We mark IPI's with IRQF_DISABLED as they must run with
         * irqs disabled.
         */
        mpic_eoi(mpic);
@@ -552,29 +545,176 @@ static void mpic_end_ipi(unsigned int irq)
 static void mpic_set_affinity(unsigned int irq, cpumask_t cpumask)
 {
        struct mpic *mpic = mpic_from_irq(irq);
+       unsigned int src = mpic_irq_to_hw(irq);
 
        cpumask_t tmp;
 
        cpus_and(tmp, cpumask, cpu_online_map);
 
-       mpic_irq_write(irq - mpic->irq_offset, MPIC_IRQ_DESTINATION,
+       mpic_irq_write(src, MPIC_IRQ_DESTINATION,
                       mpic_physmask(cpus_addr(tmp)[0]));       
 }
 
+static unsigned int mpic_flags_to_vecpri(unsigned int flags, int *level)
+{
+       unsigned int vecpri;
+
+       /* Now convert sense value */
+       switch(flags & IRQ_TYPE_SENSE_MASK) {
+       case IRQ_TYPE_EDGE_RISING:
+               vecpri = MPIC_VECPRI_SENSE_EDGE |
+                       MPIC_VECPRI_POLARITY_POSITIVE;
+               *level = 0;
+               break;
+       case IRQ_TYPE_EDGE_FALLING:
+               vecpri = MPIC_VECPRI_SENSE_EDGE |
+                       MPIC_VECPRI_POLARITY_NEGATIVE;
+               *level = 0;
+               break;
+       case IRQ_TYPE_LEVEL_HIGH:
+               vecpri = MPIC_VECPRI_SENSE_LEVEL |
+                       MPIC_VECPRI_POLARITY_POSITIVE;
+               *level = 1;
+               break;
+       case IRQ_TYPE_LEVEL_LOW:
+       default:
+               vecpri = MPIC_VECPRI_SENSE_LEVEL |
+                       MPIC_VECPRI_POLARITY_NEGATIVE;
+               *level = 1;
+       }
+       return vecpri;
+}
+
+static struct irq_chip mpic_irq_chip = {
+       .mask   = mpic_mask_irq,
+       .unmask = mpic_unmask_irq,
+       .eoi    = mpic_end_irq,
+};
+
+#ifdef CONFIG_SMP
+static struct irq_chip mpic_ipi_chip = {
+       .mask   = mpic_mask_ipi,
+       .unmask = mpic_unmask_ipi,
+       .eoi    = mpic_end_ipi,
+};
+#endif /* CONFIG_SMP */
+
+#ifdef CONFIG_MPIC_BROKEN_U3
+static struct irq_chip mpic_irq_ht_chip = {
+       .startup        = mpic_startup_ht_irq,
+       .shutdown       = mpic_shutdown_ht_irq,
+       .mask           = mpic_mask_irq,
+       .unmask         = mpic_unmask_ht_irq,
+       .eoi            = mpic_end_ht_irq,
+};
+#endif /* CONFIG_MPIC_BROKEN_U3 */
+
+
+static int mpic_host_match(struct irq_host *h, struct device_node *node)
+{
+       struct mpic *mpic = h->host_data;
+
+       /* Exact match, unless mpic node is NULL */
+       return mpic->of_node == NULL || mpic->of_node == node;
+}
+
+static int mpic_host_map(struct irq_host *h, unsigned int virq,
+                        irq_hw_number_t hw, unsigned int flags)
+{
+       struct irq_desc *desc = get_irq_desc(virq);
+       struct irq_chip *chip;
+       struct mpic *mpic = h->host_data;
+       unsigned int vecpri = MPIC_VECPRI_SENSE_LEVEL |
+               MPIC_VECPRI_POLARITY_NEGATIVE;
+       int level;
+
+       pr_debug("mpic: map virq %d, hwirq 0x%lx, flags: 0x%x\n",
+                virq, hw, flags);
+
+       if (hw == MPIC_VEC_SPURRIOUS)
+               return -EINVAL;
+#ifdef CONFIG_SMP
+       else if (hw >= MPIC_VEC_IPI_0) {
+               WARN_ON(!(mpic->flags & MPIC_PRIMARY));
+
+               pr_debug("mpic: mapping as IPI\n");
+               set_irq_chip_data(virq, mpic);
+               set_irq_chip_and_handler(virq, &mpic->hc_ipi,
+                                        handle_percpu_irq);
+               return 0;
+       }
+#endif /* CONFIG_SMP */
+
+       if (hw >= mpic->irq_count)
+               return -EINVAL;
+
+       /* If no sense provided, check default sense array */
+       if (((flags & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_NONE) &&
+           mpic->senses && hw < mpic->senses_count)
+               flags |= mpic->senses[hw];
+
+       vecpri = mpic_flags_to_vecpri(flags, &level);
+       if (level)
+               desc->status |= IRQ_LEVEL;
+       chip = &mpic->hc_irq;
+
+#ifdef CONFIG_MPIC_BROKEN_U3
+       /* Check for HT interrupts, override vecpri */
+       if (mpic_is_ht_interrupt(mpic, hw)) {
+               vecpri &= ~(MPIC_VECPRI_SENSE_MASK |
+                           MPIC_VECPRI_POLARITY_MASK);
+               vecpri |= MPIC_VECPRI_POLARITY_POSITIVE;
+               chip = &mpic->hc_ht_irq;
+       }
+#endif
+
+       /* Reconfigure irq */
+       vecpri |= MPIC_VECPRI_MASK | hw | (8 << MPIC_VECPRI_PRIORITY_SHIFT);
+       mpic_irq_write(hw, MPIC_IRQ_VECTOR_PRI, vecpri);
+
+       pr_debug("mpic: mapping as IRQ\n");
+
+       set_irq_chip_data(virq, mpic);
+       set_irq_chip_and_handler(virq, chip, handle_fasteoi_irq);
+       return 0;
+}
+
+static int mpic_host_xlate(struct irq_host *h, struct device_node *ct,
+                          u32 *intspec, unsigned int intsize,
+                          irq_hw_number_t *out_hwirq, unsigned int *out_flags)
+
+{
+       static unsigned char map_mpic_senses[4] = {
+               IRQ_TYPE_EDGE_RISING,
+               IRQ_TYPE_LEVEL_LOW,
+               IRQ_TYPE_LEVEL_HIGH,
+               IRQ_TYPE_EDGE_FALLING,
+       };
+
+       *out_hwirq = intspec[0];
+       if (intsize > 1 && intspec[1] < 4)
+               *out_flags = map_mpic_senses[intspec[1]];
+       else
+               *out_flags = IRQ_TYPE_NONE;
+
+       return 0;
+}
+
+static struct irq_host_ops mpic_host_ops = {
+       .match = mpic_host_match,
+       .map = mpic_host_map,
+       .xlate = mpic_host_xlate,
+};
 
 /*
  * Exported functions
  */
 
-
-struct mpic * __init mpic_alloc(unsigned long phys_addr,
+struct mpic * __init mpic_alloc(struct device_node *node,
+                               unsigned long phys_addr,
                                unsigned int flags,
                                unsigned int isu_size,
-                               unsigned int irq_offset,
                                unsigned int irq_count,
-                               unsigned int ipi_offset,
-                               unsigned char *senses,
-                               unsigned int senses_count,
                                const char *name)
 {
        struct mpic     *mpic;
@@ -586,33 +726,38 @@ struct mpic * __init mpic_alloc(unsigned long phys_addr,
        if (mpic == NULL)
                return NULL;
        
-
        memset(mpic, 0, sizeof(struct mpic));
        mpic->name = name;
+       mpic->of_node = node ? of_node_get(node) : NULL;
 
+       mpic->irqhost = irq_alloc_host(IRQ_HOST_MAP_LINEAR, 256,
+                                      &mpic_host_ops,
+                                      MPIC_VEC_SPURRIOUS);
+       if (mpic->irqhost == NULL) {
+               of_node_put(node);
+               return NULL;
+       }
+
+       mpic->irqhost->host_data = mpic;
+       mpic->hc_irq = mpic_irq_chip;
        mpic->hc_irq.typename = name;
-       mpic->hc_irq.startup = mpic_startup_irq;
-       mpic->hc_irq.shutdown = mpic_shutdown_irq;
-       mpic->hc_irq.enable = mpic_enable_irq;
-       mpic->hc_irq.disable = mpic_disable_irq;
-       mpic->hc_irq.end = mpic_end_irq;
        if (flags & MPIC_PRIMARY)
                mpic->hc_irq.set_affinity = mpic_set_affinity;
+#ifdef CONFIG_MPIC_BROKEN_U3
+       mpic->hc_ht_irq = mpic_irq_ht_chip;
+       mpic->hc_ht_irq.typename = name;
+       if (flags & MPIC_PRIMARY)
+               mpic->hc_ht_irq.set_affinity = mpic_set_affinity;
+#endif /* CONFIG_MPIC_BROKEN_U3 */
 #ifdef CONFIG_SMP
+       mpic->hc_ipi = mpic_ipi_chip;
        mpic->hc_ipi.typename = name;
-       mpic->hc_ipi.enable = mpic_enable_ipi;
-       mpic->hc_ipi.disable = mpic_disable_ipi;
-       mpic->hc_ipi.end = mpic_end_ipi;
 #endif /* CONFIG_SMP */
 
        mpic->flags = flags;
        mpic->isu_size = isu_size;
-       mpic->irq_offset = irq_offset;
        mpic->irq_count = irq_count;
-       mpic->ipi_offset = ipi_offset;
        mpic->num_sources = 0; /* so far */
-       mpic->senses = senses;
-       mpic->senses_count = senses_count;
 
        /* Map the global registers */
        mpic->gregs = ioremap(phys_addr + MPIC_GREG_BASE, 0x1000);
@@ -680,8 +825,10 @@ struct mpic * __init mpic_alloc(unsigned long phys_addr,
        mpic->next = mpics;
        mpics = mpic;
 
-       if (flags & MPIC_PRIMARY)
+       if (flags & MPIC_PRIMARY) {
                mpic_primary = mpic;
+               irq_set_default_host(mpic->irqhost);
+       }
 
        return mpic;
 }
@@ -698,26 +845,10 @@ void __init mpic_assign_isu(struct mpic *mpic, unsigned int isu_num,
                mpic->num_sources = isu_first + mpic->isu_size;
 }
 
-void __init mpic_setup_cascade(unsigned int irq, mpic_cascade_t handler,
-                              void *data)
+void __init mpic_set_default_senses(struct mpic *mpic, u8 *senses, int count)
 {
-       struct mpic *mpic = mpic_find(irq, NULL);
-       unsigned long flags;
-
-       /* Synchronization here is a bit dodgy, so don't try to replace cascade
-        * interrupts on the fly too often ... but normally it's set up at boot.
-        */
-       spin_lock_irqsave(&mpic_lock, flags);
-       if (mpic->cascade)             
-               mpic_disable_irq(mpic->cascade_vec + mpic->irq_offset);
-       mpic->cascade = NULL;
-       wmb();
-       mpic->cascade_vec = irq - mpic->irq_offset;
-       mpic->cascade_data = data;
-       wmb();
-       mpic->cascade = handler;
-       mpic_enable_irq(irq);
-       spin_unlock_irqrestore(&mpic_lock, flags);
+       mpic->senses = senses;
+       mpic->senses_count = count;
 }
 
 void __init mpic_init(struct mpic *mpic)
@@ -725,6 +856,11 @@ void __init mpic_init(struct mpic *mpic)
        int i;
 
        BUG_ON(mpic->num_sources == 0);
+       WARN_ON(mpic->num_sources > MPIC_VEC_IPI_0);
+
+       /* Sanitize source count */
+       if (mpic->num_sources > MPIC_VEC_IPI_0)
+               mpic->num_sources = MPIC_VEC_IPI_0;
 
        printk(KERN_INFO "mpic: Initializing for %d sources\n", mpic->num_sources);
 
@@ -748,12 +884,6 @@ void __init mpic_init(struct mpic *mpic)
                               MPIC_VECPRI_MASK |
                               (10 << MPIC_VECPRI_PRIORITY_SHIFT) |
                               (MPIC_VEC_IPI_0 + i));
-#ifdef CONFIG_SMP
-               if (!(mpic->flags & MPIC_PRIMARY))
-                       continue;
-               irq_desc[mpic->ipi_offset+i].status |= IRQ_PER_CPU;
-               irq_desc[mpic->ipi_offset+i].chip = &mpic->hc_ipi;
-#endif /* CONFIG_SMP */
        }
 
        /* Initialize interrupt sources */
@@ -764,31 +894,21 @@ void __init mpic_init(struct mpic *mpic)
        /* Do the HT PIC fixups on U3 broken mpic */
        DBG("MPIC flags: %x\n", mpic->flags);
        if ((mpic->flags & MPIC_BROKEN_U3) && (mpic->flags & MPIC_PRIMARY))
-               mpic_scan_ht_pics(mpic);
+               mpic_scan_ht_pics(mpic);
 #endif /* CONFIG_MPIC_BROKEN_U3 */
 
        for (i = 0; i < mpic->num_sources; i++) {
                /* start with vector = source number, and masked */
                u32 vecpri = MPIC_VECPRI_MASK | i | (8 << MPIC_VECPRI_PRIORITY_SHIFT);
-               int level = 0;
+               int level = 1;
                
-               /* if it's an IPI, we skip it */
-               if ((mpic->irq_offset + i) >= (mpic->ipi_offset + i) &&
-                   (mpic->irq_offset + i) <  (mpic->ipi_offset + i + 4))
-                       continue;
-
                /* do senses munging */
-               if (mpic->senses && i < mpic->senses_count) {
-                       if (mpic->senses[i] & IRQ_SENSE_LEVEL)
-                               vecpri |= MPIC_VECPRI_SENSE_LEVEL;
-                       if (mpic->senses[i] & IRQ_POLARITY_POSITIVE)
-                               vecpri |= MPIC_VECPRI_POLARITY_POSITIVE;
-               } else
+               if (mpic->senses && i < mpic->senses_count)
+                       vecpri = mpic_flags_to_vecpri(mpic->senses[i],
+                                                     &level);
+               else
                        vecpri |= MPIC_VECPRI_SENSE_LEVEL;
 
-               /* remember if it was a level interrupts */
-               level = (vecpri & MPIC_VECPRI_SENSE_LEVEL);
-
                /* deal with broken U3 */
                if (mpic->flags & MPIC_BROKEN_U3) {
 #ifdef CONFIG_MPIC_BROKEN_U3
@@ -809,12 +929,6 @@ void __init mpic_init(struct mpic *mpic)
                mpic_irq_write(i, MPIC_IRQ_VECTOR_PRI, vecpri);
                mpic_irq_write(i, MPIC_IRQ_DESTINATION,
                               1 << hard_smp_processor_id());
-
-               /* init linux descriptors */
-               if (i < mpic->irq_count) {
-                       irq_desc[mpic->irq_offset+i].status = level ? IRQ_LEVEL : 0;
-                       irq_desc[mpic->irq_offset+i].chip = &mpic->hc_irq;
-               }
        }
        
        /* Init spurrious vector */
@@ -855,19 +969,20 @@ void mpic_irq_set_priority(unsigned int irq, unsigned int pri)
 {
        int is_ipi;
        struct mpic *mpic = mpic_find(irq, &is_ipi);
+       unsigned int src = mpic_irq_to_hw(irq);
        unsigned long flags;
        u32 reg;
 
        spin_lock_irqsave(&mpic_lock, flags);
        if (is_ipi) {
-               reg = mpic_ipi_read(irq - mpic->ipi_offset) &
+               reg = mpic_ipi_read(src - MPIC_VEC_IPI_0) &
                        ~MPIC_VECPRI_PRIORITY_MASK;
-               mpic_ipi_write(irq - mpic->ipi_offset,
+               mpic_ipi_write(src - MPIC_VEC_IPI_0,
                               reg | (pri << MPIC_VECPRI_PRIORITY_SHIFT));
        } else {
-               reg = mpic_irq_read(irq - mpic->irq_offset,MPIC_IRQ_VECTOR_PRI)
+               reg = mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI)
                        & ~MPIC_VECPRI_PRIORITY_MASK;
-               mpic_irq_write(irq - mpic->irq_offset, MPIC_IRQ_VECTOR_PRI,
+               mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI,
                               reg | (pri << MPIC_VECPRI_PRIORITY_SHIFT));
        }
        spin_unlock_irqrestore(&mpic_lock, flags);
@@ -877,14 +992,15 @@ unsigned int mpic_irq_get_priority(unsigned int irq)
 {
        int is_ipi;
        struct mpic *mpic = mpic_find(irq, &is_ipi);
+       unsigned int src = mpic_irq_to_hw(irq);
        unsigned long flags;
        u32 reg;
 
        spin_lock_irqsave(&mpic_lock, flags);
        if (is_ipi)
-               reg = mpic_ipi_read(irq - mpic->ipi_offset);
+               reg = mpic_ipi_read(src = MPIC_VEC_IPI_0);
        else
-               reg = mpic_irq_read(irq - mpic->irq_offset, MPIC_IRQ_VECTOR_PRI);
+               reg = mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI);
        spin_unlock_irqrestore(&mpic_lock, flags);
        return (reg & MPIC_VECPRI_PRIORITY_MASK) >> MPIC_VECPRI_PRIORITY_SHIFT;
 }
@@ -979,37 +1095,20 @@ void mpic_send_ipi(unsigned int ipi_no, unsigned int cpu_mask)
                       mpic_physmask(cpu_mask & cpus_addr(cpu_online_map)[0]));
 }
 
-int mpic_get_one_irq(struct mpic *mpic, struct pt_regs *regs)
+unsigned int mpic_get_one_irq(struct mpic *mpic, struct pt_regs *regs)
 {
-       u32 irq;
+       u32 src;
 
-       irq = mpic_cpu_read(MPIC_CPU_INTACK) & MPIC_VECPRI_VECTOR_MASK;
-#ifdef DEBUG_LOW
-       DBG("%s: get_one_irq(): %d\n", mpic->name, irq);
-#endif
-       if (mpic->cascade && irq == mpic->cascade_vec) {
+       src = mpic_cpu_read(MPIC_CPU_INTACK) & MPIC_VECPRI_VECTOR_MASK;
 #ifdef DEBUG_LOW
-               DBG("%s: cascading ...\n", mpic->name);
-#endif
-               irq = mpic->cascade(regs, mpic->cascade_data);
-               mpic_eoi(mpic);
-               return irq;
-       }
-       if (unlikely(irq == MPIC_VEC_SPURRIOUS))
-               return -1;
-       if (irq < MPIC_VEC_IPI_0) {
-#ifdef DEBUG_IRQ
-               DBG("%s: irq %d\n", mpic->name, irq + mpic->irq_offset);
-#endif
-               return irq + mpic->irq_offset;
-       }
-#ifdef DEBUG_IPI
-               DBG("%s: ipi %d !\n", mpic->name, irq - MPIC_VEC_IPI_0);
+       DBG("%s: get_one_irq(): %d\n", mpic->name, src);
 #endif
-       return irq - MPIC_VEC_IPI_0 + mpic->ipi_offset;
+       if (unlikely(src == MPIC_VEC_SPURRIOUS))
+               return NO_IRQ;
+       return irq_linear_revmap(mpic->irqhost, src);
 }
 
-int mpic_get_irq(struct pt_regs *regs)
+unsigned int mpic_get_irq(struct pt_regs *regs)
 {
        struct mpic *mpic = mpic_primary;
 
@@ -1023,22 +1122,27 @@ int mpic_get_irq(struct pt_regs *regs)
 void mpic_request_ipis(void)
 {
        struct mpic *mpic = mpic_primary;
-
+       int i;
+       static char *ipi_names[] = {
+               "IPI0 (call function)",
+               "IPI1 (reschedule)",
+               "IPI2 (unused)",
+               "IPI3 (debugger break)",
+       };
        BUG_ON(mpic == NULL);
-       
-       printk("requesting IPIs ... \n");
-
-       /* IPIs are marked SA_INTERRUPT as they must run with irqs disabled */
-       request_irq(mpic->ipi_offset+0, mpic_ipi_action, SA_INTERRUPT,
-                   "IPI0 (call function)", mpic);
-       request_irq(mpic->ipi_offset+1, mpic_ipi_action, SA_INTERRUPT,
-                  "IPI1 (reschedule)", mpic);
-       request_irq(mpic->ipi_offset+2, mpic_ipi_action, SA_INTERRUPT,
-                  "IPI2 (unused)", mpic);
-       request_irq(mpic->ipi_offset+3, mpic_ipi_action, SA_INTERRUPT,
-                  "IPI3 (debugger break)", mpic);
-
-       printk("IPIs requested... \n");
+
+       printk(KERN_INFO "mpic: requesting IPIs ... \n");
+
+       for (i = 0; i < 4; i++) {
+               unsigned int vipi = irq_create_mapping(mpic->irqhost,
+                                                      MPIC_VEC_IPI_0 + i, 0);
+               if (vipi == NO_IRQ) {
+                       printk(KERN_ERR "Failed to map IPI %d\n", i);
+                       break;
+               }
+               request_irq(vipi, mpic_ipi_action, IRQF_DISABLED,
+                           ipi_names[i], mpic);
+       }
 }
 
 void smp_mpic_message_pass(int target, int msg)
index 0741df8c41b7c3c60cf42eb2170d48e7b36b4af9..179b10ced8c773ee75d6c5dfb290dd35b84d25f0 100644 (file)
@@ -8,7 +8,6 @@
  *      as published by the Free Software Foundation; either version
  *      2 of the License, or (at your option) any later version.
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/smp.h>
index 1e113d0f59b8e3cbfa760f1aec1734c4b530c313..b81a367dc2780bb15e49545e1d8ac92fe73a4d24 100644 (file)
@@ -28,7 +28,6 @@
  * is compatible with normal ttyS* devices.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index 4edeede9ccfdbc4c2636cf5b83b672ee182629e0..e347fe88316d4b375fd67a8bf4505da0ec8dda7d 100644 (file)
@@ -21,7 +21,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/string.h>
@@ -2117,7 +2116,7 @@ init_fcc_startup(fcc_info_t *fip, struct net_device *dev)
 
 #ifdef PHY_INTERRUPT
 #ifdef CONFIG_ADS8272
-       if (request_irq(PHY_INTERRUPT, mii_link_interrupt, SA_SHIRQ,
+       if (request_irq(PHY_INTERRUPT, mii_link_interrupt, IRQF_SHARED,
                                "mii", dev) < 0)
                printk(KERN_CRIT "Can't get MII IRQ %d\n", PHY_INTERRUPT);
 #else
index f1c7392255f869693740a9a2cd5ff4ab353f0759..e5f943045afa50acb2182f2cd86b125133c85a64 100644 (file)
@@ -13,7 +13,6 @@
 #define _cs4218_h_
 
 #include <linux/types.h>
-#include <linux/config.h>
 
 #define SND_NDEVS      256     /* Number of supported devices */
 #define SND_DEV_CTL    0       /* Control port /dev/mixer */
index a892356d5c3b66cf6bbd34dffd2657058ef9ee96..f5f300fc213de91631e135e1289d3887e38ef864 100644 (file)
@@ -14,7 +14,6 @@
 #include <linux/sched.h>
 #include <linux/timer.h>
 #include <linux/major.h>
-#include <linux/config.h>
 #include <linux/fcntl.h>
 #include <linux/errno.h>
 #include <linux/mm.h>
index ece6a9fbe09bf1d8fda9c45552bbef95ff43d750..a695375c3e4c58f37906657914aafc66c37d2f33 100644 (file)
@@ -22,7 +22,6 @@
  * small packets.
  *
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/string.h>
index 62f68d6181c652b3bd8be030463b78e260f89db0..8b6295bbb564626ff5fab4466b0536bc94ec618a 100644 (file)
@@ -28,7 +28,6 @@
  * Thomas Lange, thomas@corelatus.com
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/string.h>
index 312af0776c315bc6f702df608c3264201f2db26f..cfad46ba17e38040ef7f51922edfb7c1ae282cae 100644 (file)
@@ -4,7 +4,6 @@
  * also relocates SMC2, but this would require additional changes
  * to uart.c, so I am holding off on that for a moment.
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index b2bba052ab934af82bda92dc5650d46ab6fbf6a3..265fcd3c6ab296bbadacf9986ed6a724df2b3161 100644 (file)
@@ -35,7 +35,6 @@
  *           /Jes
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index bbe47c9bd707cf25f0cbc36b8f83360ebc09582e..bc50ed11957d8406ea4947300cc89fccadedb15b 100644 (file)
@@ -12,7 +12,6 @@
  * Miscellaneous Amiga stuff
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
index 4d31b824bbd175c999211eafa96c10b3675cdf04..8f0ef04b8de509b8ccf86caded71640ee912e0f6 100644 (file)
@@ -18,7 +18,6 @@
  *    2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <asm/ppc_asm.h>
 
        .text
index 073830a8559ac5c7d2f3f7857bda20f3d767d2d9..8e1fccd96fc029a252f58c67c181bca0012abc10 100644 (file)
@@ -13,7 +13,6 @@
  */
 
 #include <stdarg.h>    /* for va_ bits */
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/zlib.h>
 #include "nonstdio.h"
index 4f00c93ac870240cac5807aadb8c29c15120198c..fc5b7204194802db616c2271208eaadc79fc219f 100644 (file)
@@ -2,7 +2,6 @@
  * COM1 NS16550 support
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/serial.h>
 #include <linux/serial_reg.h>
index 3a51b1062940f5d2cf8ca26fcf460ce632201c5f..840bff2a45fb8bcaf2c06eb252bb0dbe769ae303 100644 (file)
@@ -8,7 +8,6 @@
  */
 
 #include <linux/types.h>
-#include <linux/config.h>
 #include <linux/string.h>
 #include <asm/reg.h>
 #ifdef CONFIG_8xx
index 160da1006ff8f5bca910a1b9d779b1a3aab79f54..1b4d7b1d4ec173740cdc275cd6702853df064240 100644 (file)
@@ -11,7 +11,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <asm/reg.h>
 #include <asm/cache.h>
 #include <asm/ppc_asm.h>
index 1d2778e248c6ad5439979266e887f9eab6df6b57..cacc40fdbcfac140a9461541bd2f75cc65c37ac1 100644 (file)
@@ -8,7 +8,6 @@
  * use COM1 instead of SMC1 as the console port.  This kinda sucks
  * for the rest of the kernel, so here we force the use of SMC1 again.
  */
-#include <linux/config.h>
 #include <linux/types.h>
 #include <asm/uaccess.h>
 #include <asm/mpc8xx.h>
index b94e142ad8922023056b8add13fd8236ee6cd380..14a4b56d4f8493343ae76108aacce2da66f5eb5f 100644 (file)
@@ -9,7 +9,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <asm/io.h>
 #include <asm/mv64x60_defs.h>
index 3865f3f8dcd1f7c1e8896f3f58148afb4f994dc2..10219eeca054c22f24b1693c14de80f035ec8349 100644 (file)
@@ -6,7 +6,6 @@
  * Currently maintained by: Tom Rini <trini@kernel.crashing.org>
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/string.h>
 #include <asm/bootinfo.h>
index 2678c224af2237cadc79ff0fc27546a00816bd82..0b3978632acaed1ea89558dd542b58794cba68c1 100644 (file)
@@ -10,7 +10,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <asm/reg.h>
 #include <asm/io.h>
index a212b5b988cb0e9143581f266c714bf066e7e7e3..96eaebb78df58498cd9934bc23dd9e19cef06c83 100644 (file)
@@ -19,7 +19,6 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <asm/io.h>
 #include <asm/mv64x60_defs.h>
index d97f2ee6f04ec4a80324c254446f645a65196762..79a1bbcbc6c5f30da0d39a68924e2f9f8ddf548e 100644 (file)
@@ -9,7 +9,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <asm/io.h>
 #include <asm/mv64x60_defs.h>
index 71ff20fd494a6d3c38dc3aac631c3d9f06a07561..28b3108083edd691c65aa24efc5b3304198c4881 100644 (file)
@@ -9,7 +9,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <asm/io.h>
 #include <asm/mv64x60_defs.h>
index 63def9d13d701347f0513c9bac3dc2efb55a447a..0086e1cfb48cbb1f66442e2c31a77d9de94b3668 100644 (file)
@@ -4,7 +4,6 @@
  * In the past: Gary Thomas, Cort Dougan <cort@cs.nmt.edu>
  */
 
-#include <linux/config.h>
 #include <linux/pci_ids.h>
 #include <linux/types.h>
 #include <asm/residual.h>
index 0cad2f557a1e814962c6cb1f85c6e844cb0e2835..5b3a6c6f113b28953487abd02008421da9729996 100644 (file)
@@ -13,7 +13,6 @@
  */
 
 #include <linux/types.h>
-#include <linux/config.h>
 #include <linux/pci.h>
 
 #include <asm/bootinfo.h>
index 3d78571ad94529b292cce24bdb9c01fd6d920558..a5df089636955cc3ee327801ae86cfbb6db89ca0 100644 (file)
@@ -15,7 +15,6 @@
  */
 
 #include <linux/types.h>
-#include <linux/config.h>
 #include <linux/string.h>
 
 #include <asm/page.h>
index 1964493cf3bdc0337342202b06b0f0c18b75ad6c..7b5924cc3c026eaed2f4d8d91289d58e2c44d29c 100644 (file)
@@ -9,7 +9,6 @@
  * "as is" without any warranty of any kind, whether express or implied.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <asm/uaccess.h>
 #include <asm/mpc52xx.h>
index 0c52f5c784a2eee9e2a91e6a70007e14a23789b0..781e040a97d1443cb6fcf9e8916cb0e2d0579c61 100644 (file)
@@ -12,7 +12,6 @@
 
 /* This code assumes that the data cache has been disabled (L1, L2, L3). */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/serial_reg.h>
 #include <asm/serial.h>
index 3f2ed53f793ae880578ac23f3179c253e6013154..6ff2701598f24c804415886a2a0e97daae886c99 100644 (file)
@@ -12,7 +12,6 @@
  */
 
 #include <linux/types.h>
-#include <linux/config.h>
 #include <linux/string.h>
 #include <asm/ppcboot.h>
 #include <asm/ibm4xx.h>
index 67222d57c3456476f797538f3d90fb968a81fd53..f39d01e0619de89080c704086c85047b6c84e466 100644 (file)
@@ -6,7 +6,6 @@
  */
 
 #include <linux/types.h>
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/ctype.h>
 #include <asm/ppcboot.h>
index 2533113c1cc50d94cc8c604f672c8a536efdab69..0c021556d78e25a822e573aea1d521fd06c0d8e5 100644 (file)
@@ -13,7 +13,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <asm/cache.h>
 #include <asm/ppc_asm.h>
 
index 2f5c5e1576175ffb5bc4e3a7e9868dda7bc1caf7..1f91eca2f3d70125f7e408a44d9e28feb16e4ec7 100644 (file)
@@ -8,7 +8,6 @@
  * #defines from the assembly-language output.
  */
 
-#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index d7bfd60e21fc2e0cc8660bd44e5e7cb4f75706c0..6a674e834eebbf65eccbaf25ff698cceccec81a4 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/ppc_asm.h>
index 61465ec88bc7268b0325001bac308c28d1db8588..10fec7363962ed15b6eedcb9b825644f1c2263c0 100644 (file)
@@ -22,7 +22,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
index 1adc9145516f9eaf88a14047031038821ee67940..a9d455369dc6b5a6ddb9455747c695dbe4079d04 100644 (file)
@@ -19,7 +19,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sys.h>
 #include <linux/threads.h>
index 01303efeddadb5a7a268da24363d43730068348f..100052aaea9aa9831a3bc0ed8ff1aa37dd74fbd5 100644 (file)
@@ -22,7 +22,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
index 0d8b88219d3880ac2e8d966a77850cfe99e8853a..7e44de5a26db447689bf1424ce750758893fa4f0 100644 (file)
@@ -28,7 +28,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
index 10c261c6702199384dd8aa52444c1d81136f9081..51da157a629e436e2b88c6df17c2c44f1637f3dd 100644 (file)
@@ -31,7 +31,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
index 7a2f20583be406beb0f42cb16f64e3a514fd1a04..944c35c242785b94b66474dd7549fd6284e9635e 100644 (file)
@@ -19,7 +19,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
index dd86bbed76271120c4f64ea39912e1e07d65a9e8..66877bdfe0b7b8c5a20d2d0bdc7df02b4594152c 100644 (file)
@@ -30,7 +30,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/threads.h>
 #include <asm/processor.h>
 #include <asm/page.h>
index 5a936566fd6155bdf1b4ba71ba26164e7d2eef63..2fa0075f2b5f832f122d1ac196b011da9918dfde 100644 (file)
@@ -12,7 +12,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/sys.h>
 #include <asm/unistd.h>
 #include <asm/errno.h>
index 242bb052be679f66bca5345fdeda0f226ef90046..63808e01cb0b7cc51ea75c20885c630d8ef63ea4 100644 (file)
@@ -2,7 +2,6 @@
  * Common prep/chrp pci routines. -- Cort
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
index d61889c24046c9ce181f70808e8aa1833d2f8030..5f9ee7bb67ec32b7bca5557bde3dd0119a9b54d2 100644 (file)
@@ -99,7 +99,6 @@
  *
  ****************************************************************************/
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/mm.h>
index 75c64504374660d3191169417379458d0ae4cb19..bd129d3c2cc13af95228168f53d6cf76df5d2666 100644 (file)
@@ -10,7 +10,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/proc_fs.h>
index b250b1b539b681f9be079e0bb7bf60dd87bba9ea..50c1b4739ca7021e5b43d28f119edf39f45faf51 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/threads.h>
 #include <linux/smp.h>
index 4b4607d89bfa6e1c105a01d85c0a674748c5fa8f..faf2940300b0b79becf8bafecacb51161f5effa9 100644 (file)
@@ -2,7 +2,6 @@
  * Common prep boot and setup code.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/sched.h>
index 6a5694fcc711efefdc063e9b53d905b82a091dab..1576758debaf1cdee7b9f3b091dc1cbf983dd34c 100644 (file)
@@ -5,7 +5,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/smp.h>
index f77795a64daed9628c50b5885831377954c8006e..ca57e896a36c339196a9e23b1e15f3e918670760 100644 (file)
@@ -8,7 +8,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/sched.h>
index 53ea723af60aa5fff91a1ff057986584098f7285..6ab8cc7226ab232b220d9d555f0ed66358c0f6c0 100644 (file)
@@ -42,7 +42,6 @@
  *             "A Kernel Model for Precision Timekeeping" by Dave Mills
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index 1c0d68026abd0b9e03381220a1339a9d681ae5b3..d7a433049b4857b3acf2caa59e6f7c981d1c5f21 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/user.h>
 #include <linux/a.out.h>
 #include <linux/interrupt.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/prctl.h>
index c450dc4b766e23b5588dccf0f57e42ea6e1ea22d..ea4aee6b20e6e6a8074b96c46aa8c52cc25c7e40 100644 (file)
@@ -4,7 +4,6 @@
  * Written by Cort Dougan (cort@cs.nmt.edu)
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/spinlock.h>
 #include <linux/module.h>
index 2e258c49e8bea826a05b377289e95c1ccb3fc744..84ed33ab4c2de8038a0891eb06ddda06e2484a31 100644 (file)
@@ -8,7 +8,6 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
  */
-#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/cache.h>
 #include <asm/errno.h>
index e0152a9b26e68590950db9f96c9286d3e128fb75..0a0a0487b33435f350713fc730a8b370b5e43b17 100644 (file)
@@ -24,7 +24,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index 4d006aa1a0d19c69ae7f129cb39192552e8aa705..838e09db71d97f56ca3721917dd2fd0ada843042 100644 (file)
@@ -21,7 +21,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index 8e08ca32531a878d4b450910ab437c4125cdf6dc..5cdfb71fcb078ca50f56059a907e0104ab452194 100644 (file)
@@ -13,7 +13,6 @@
  *  2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index 5d581bb3aa1249fa8826fe16a648f818c3f33cae..123da03ab1186df9bb977d21e238e15c858331f5 100644 (file)
@@ -26,7 +26,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index 31d0a924317c7d94a6f7c87a6d23225e5b79205f..e756942e65c40fe482f3f223321938ffc9103f65 100644 (file)
@@ -21,7 +21,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/pgtable.h>
index c9bd184a295adad73d58108c19d76be395e2f18e..523392d460fa129aecceb4a0c8f5e0f541f0c970 100644 (file)
@@ -18,7 +18,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index 3d639052017ee3b05606c7d1572827c80819680c..6030a0ddfbb43b7b80dcaae73b3c43544fbe8bdd 100644 (file)
@@ -14,7 +14,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/stddef.h>
 #include <linux/init.h>
index 8784f3715032d8008c2f37cafd1ceb3005fb8bae..85afa7f8aa78ef80708a1a7995961929d4ac564a 100644 (file)
@@ -23,7 +23,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/init.h>
 
index 706bca8eb1448f826ff5ddab5874e8858966870e..354a9408f02436b83ac8204d8a854686c675e264 100644 (file)
@@ -20,7 +20,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/types.h>
index 25bb6f3347c1b43ea3cff8ec25ef994ffdbbbe25..973f1e6afa53f5240b3ab4c4a9700a7418891e3a 100644 (file)
@@ -23,7 +23,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/init.h>
index 606b023196a29d2fa42b74cae93ae3616bb36a9b..fa29740a28f57dade5052629de5f625cdbc8a56c 100644 (file)
@@ -23,7 +23,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/init.h>
index b940cfd646c2af5783d3c87924454ab7393ba5d2..349660b84a02a88ee3f33da44f65d5dde772eade 100644 (file)
@@ -10,7 +10,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 31c0dd6a26cb735b15f405a869bac732bdd91d61..dcd3d09a0a7159f2a0e45d401980d6b2668d41f2 100644 (file)
@@ -15,7 +15,6 @@
 #ifndef __ASM_BAMBOO_H__
 #define __ASM_BAMBOO_H__
 
-#include <linux/config.h>
 #include <platforms/4xx/ibm440ep.h>
 
 /* F/W TLB mapping used in bootloader glue to reset EMAC */
index ce48a4f08cbbc62966ebeb68fea7a4b369b0e852..4009f4983ca60aa07e7e4c83af38b63ffc0d309f 100644 (file)
@@ -10,7 +10,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/smp.h>
 #include <linux/threads.h>
index 606aa9fa5caa80547db202cae8bf3ace2440e778..5c408060eb35cb97abfb178a6b596cb1216d5766 100644 (file)
@@ -19,7 +19,6 @@
 #ifndef __BUBINGA_H__
 #define __BUBINGA_H__
 
-#include <linux/config.h>
 #include <platforms/4xx/ibm405ep.h>
 #include <asm/ppcboot.h>
 
index 970b69831e6fc15777c0b4b080896c94572fb3cd..367430998fc5a8864254b39635d24b044089f69c 100644 (file)
@@ -15,7 +15,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <asm/system.h>
index b4ecb9c798541e4cea57accaff4a3c1736f1c035..f0f9cc8480ca94d1e788e321112a700dcf94eaa0 100644 (file)
@@ -13,7 +13,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 27b2e77c7c8375417261ccfc5ddbb4a34813fd4d..f40e33d39d76045f95d5784def584147b6a00786 100644 (file)
@@ -15,7 +15,6 @@
 #ifndef __ASM_EBONY_H__
 #define __ASM_EBONY_H__
 
-#include <linux/config.h>
 #include <platforms/4xx/ibm440gp.h>
 
 /* F/W TLB mapping used in bootloader glue to reset EMAC */
index 6efa91ff9c073efd0dd3b8ca2ce3242641fb1431..ae5c82081c95608e0543f9c1eff8c9fa0086155c 100644 (file)
@@ -9,7 +9,6 @@
  * is licensed "as is" without any warranty of any kind, whether express
  * or implied.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <asm/system.h>
index 55af769a6e70854e5000017973a75b4f35924a53..fb3630a1608d49c9c9c13ac6744c7a9f2d79c3f8 100644 (file)
@@ -10,7 +10,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/smp.h>
 #include <linux/threads.h>
index fe46640de15209244f7512d6eee8857e093ed1cb..3ef20a547080ed1ddfaacff66afa9407045a5a45 100644 (file)
@@ -14,7 +14,6 @@
 #ifndef __ASM_IBM405EP_H__
 #define __ASM_IBM405EP_H__
 
-#include <linux/config.h>
 
 /* ibm405.h at bottom of this file */
 
index e5700469a6829092e643a840c7a8b99cb09c9849..2ac67a2f0ba64b251c56a78af4c33fcb6758fb03 100644 (file)
@@ -13,7 +13,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/smp.h>
 #include <linux/threads.h>
index eaf0ef57028d2066cf828f65811028bd5c5c44f0..9f15e5518719c63a2fcdde911bb64394fe612b7e 100644 (file)
@@ -11,7 +11,6 @@
 #ifndef __ASM_IBM405GP_H__
 #define __ASM_IBM405GP_H__
 
-#include <linux/config.h>
 
 /* ibm405.h at bottom of this file */
 
index 49da61f6854a08e95c3c111b4db92fcaf11c16ac..9f4dacffdbb3d82e70f0be8bb394dc4cff90f0d0 100644 (file)
@@ -7,7 +7,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/smp.h>
 #include <linux/threads.h>
index e90c5dde01d35d0a2faaa7e9023f4ac5ef408338..9e01f1515de3b770a9c6b240c518350a1a65d266 100644 (file)
@@ -11,7 +11,6 @@
 #ifndef __ASM_IBM405GPR_H__
 #define __ASM_IBM405GPR_H__
 
-#include <linux/config.h>
 
 /* ibm405.h at bottom of this file */
 
index 61717e8a799e968ee67aee04bf408608faf96b2c..d92572727d20af759dcc1b353ae0de6fe835ee0a 100644 (file)
@@ -17,7 +17,6 @@
 #ifndef __PPC_PLATFORMS_IBM440EP_H
 #define __PPC_PLATFORMS_IBM440EP_H
 
-#include <linux/config.h>
 #include <asm/ibm44x.h>
 
 /* UART */
index 7b2763b6024f761d4db9381c7d6d15246e6bd752..391c90e1f5ea53a4e7f8a4f385086912635d76a4 100644 (file)
@@ -18,7 +18,6 @@
 #ifndef __PPC_PLATFORMS_IBM440GP_H
 #define __PPC_PLATFORMS_IBM440GP_H
 
-#include <linux/config.h>
 
 /* UART */
 #define PPC440GP_UART0_ADDR    0x0000000140000200ULL
index 070a34efe1c7c56aeee65e1c217b5c0688649564..599c4289b9c2e556d9e804c00cc337ff96dfa021 100644 (file)
@@ -17,7 +17,6 @@
 #ifndef __PPC_PLATFORMS_IBM440GX_H
 #define __PPC_PLATFORMS_IBM440GX_H
 
-#include <linux/config.h>
 
 #include <asm/ibm44x.h>
 
index 77e8bb22c527f64640162a89169066a60c84be7a..2978682f172026e3882c23cb4711654c2e05dc35 100644 (file)
@@ -15,7 +15,6 @@
 #ifndef __PPC_PLATFORMS_IBM440SP_H
 #define __PPC_PLATFORMS_IBM440SP_H
 
-#include <linux/config.h>
 
 #include <asm/ibm44x.h>
 
index f1dcb0ac15b79463453156b69447a7d47b378eca..1afc3642e5b1ddad76e092e69cadc0e65d1b911c 100644 (file)
@@ -7,7 +7,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <asm/ocp.h>
 #include <platforms/4xx/ibmnp405h.h>
index 2c683f6aaa6699ab81d9113db55f9b7a685b94bf..4aa8821b478bb3e70439a43680bdc20d3d5a8b98 100644 (file)
@@ -11,7 +11,6 @@
 #ifndef __ASM_IBMNP405H_H__
 #define __ASM_IBMNP405H_H__
 
-#include <linux/config.h>
 
 /* ibm405.h at bottom of this file */
 
index 9de4265973510a7fdd655b1ac844ad7190c794ac..31a08abaa4a210b131288074a5d45ebd204f373e 100644 (file)
@@ -11,7 +11,6 @@
 #ifndef __ASM_IBMSTB4_H__
 #define __ASM_IBMSTB4_H__
 
-#include <linux/config.h>
 
 /* serial port defines */
 #define STB04xxx_IO_BASE       ((uint)0xe0000000)
index 6884a49d3482203fea9c27fd9e3ad75cac73459b..31b63343e6416308a6ed017fe6ff585454a49728 100644 (file)
@@ -11,7 +11,6 @@
 #ifndef __ASM_IBMSTBX25_H__
 #define __ASM_IBMSTBX25_H__
 
-#include <linux/config.h>
 
 /* serial port defines */
 #define STBx25xx_IO_BASE       ((uint)0xe0000000)
index 5c37de28e13520160ce60a9adb7d0db320116eed..61706ef37112046cc2538e53ababb57c1a76d817 100644 (file)
@@ -11,7 +11,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index e0db6a810febb4bc6d3fea98848ecdf147cfe24a..68dd46b0a5c43d257de0ab3cd46fbf16f44a4748 100644 (file)
@@ -16,7 +16,6 @@
 #ifndef __ASM_LUAN_H__
 #define __ASM_LUAN_H__
 
-#include <linux/config.h>
 #include <platforms/4xx/ibm440sp.h>
 
 /* F/W TLB mapping used in bootloader glue to reset EMAC */
index 554776d4b8ac79f573183e93b31e22c7c331ee18..84e999d9a7bb950494675f6f09dd49c25ed6ffff 100644 (file)
@@ -11,7 +11,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 7c799a9ff82b409675157fc59f0fafff0d84dbe5..89730ce2322cec1b0ca933fcf6340e96e4cb8155 100644 (file)
@@ -16,7 +16,6 @@
 #ifndef __ASM_OCOTEA_H__
 #define __ASM_OCOTEA_H__
 
-#include <linux/config.h>
 #include <platforms/4xx/ibm440gx.h>
 
 /* F/W TLB mapping used in bootloader glue to reset EMAC */
index d3a620ddcdee3d91cfaa4f8be5287d8d8b7ccad1..f1e867c4c9fc0d565b276f5a2261180dc9175bfe 100644 (file)
@@ -17,7 +17,6 @@
 #ifndef __PPC_PLATFORMS_PPC440SPE_H
 #define __PPC_PLATFORMS_PPC440SPE_H
 
-#include <linux/config.h>
 
 #include <asm/ibm44x.h>
 
index 53da2b4f7c24acfc01b57b656220ac467c2d57ce..edf4d37d1a5251f5f650aec7cbf7776b45580cc4 100644 (file)
@@ -9,7 +9,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/pagemap.h>
 #include <linux/platform_device.h>
index 41b27d106fa3b6304b8ab850b197d92aec99b849..006e29f83a1a31613f32517ac5e0c734d01caafb 100644 (file)
@@ -7,7 +7,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/pagemap.h>
 #include <linux/platform_device.h>
index bab31eb306874f54df052a2cde74b8b902e4f0b1..c47493e344c2d860bfc6de4f1112549365ee9805 100644 (file)
@@ -9,7 +9,6 @@
  * is licensed "as is" without any warranty of any kind, whether express
  * or implied.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/smp.h>
 #include <linux/threads.h>
index dae01620227ddfb300976c0a81dee66438f08ee3..69b169eac053025e4efb68c72f4c547fec83b96c 100644 (file)
@@ -19,7 +19,6 @@
 #ifndef __ASM_SYCAMORE_H__
 #define __ASM_SYCAMORE_H__
 
-#include <linux/config.h>
 #include <platforms/4xx/ibm405gpr.h>
 #include <asm/ppcboot.h>
 
index 6bd77902b9a417ec4d100e3f74337096bc60a54f..f414d2d4c58e6c8598f3996dee5324b0966eb3b9 100644 (file)
@@ -11,7 +11,6 @@
  * is licensed "as is" without any warranty of any kind, whether express
  * or implied.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/smp.h>
 #include <linux/threads.h>
index f13a577f0a4192a13b74937a84d7602814089fc4..d9c4eb788940fd1e256a5ee554d3f70bee54df63 100644 (file)
@@ -21,7 +21,6 @@
 #ifndef __ASM_WALNUT_H__
 #define __ASM_WALNUT_H__
 
-#include <linux/config.h>
 #include <platforms/4xx/ibm405gp.h>
 #include <asm/ppcboot.h>
 
index d97a7f269f978065fc69834b9522aa791fafd277..fb5f0b5e13d1e5461abc98872140ed0799e76d24 100644 (file)
@@ -9,7 +9,6 @@
  * "as is" without any warranty of any kind, whether express or implied.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/tty.h>
index 4c0c7e4c11144af67759a3f57c475a860d9414c5..cb3bf7a2bcbed6295ea7c8d9fca72acc1beb955d 100644 (file)
@@ -13,7 +13,6 @@
  * kind, whether express or implied.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/tty.h>
index 4cf21f25635690f20f2fa2dc7043630f03b93988..cd7d0e7d986360d63eb6f1cad031c00bb9116927 100644 (file)
@@ -12,7 +12,6 @@
  * "as is" without any warranty of any kind, whether express or implied.
  */
 
-#include <linux/config.h>
 
 #if defined(CONFIG_XILINX_ML300)
   #include "xparameters_ml300.h"
index f287dcdbffceecaa4df11c9116b25c4df766844d..346787df0ddb14f3211b295532042596a1d6d897 100644 (file)
@@ -12,7 +12,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 7ae23012237af8aa46741ae843c144261c2c2f03..bc9684e66a84f0cb83366acb7ebef430109d5770 100644 (file)
@@ -17,7 +17,6 @@
 #ifndef __ASM_YUCCA_H__
 #define __ASM_YUCCA_H__
 
-#include <linux/config.h>
 #include <platforms/4xx/ppc440spe.h>
 
 /* F/W TLB mapping used in bootloader glue to reset EMAC */
index 11626dd9090f6a497bd534fb81a57706ecf637b9..3397f0de1592da081f70bda02826cb9665816e16 100644 (file)
@@ -11,7 +11,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 6727bbdc36ec317566816aae0317b0070ac010e3..d2e06c95b0832022c112b7147a0e0c964e13280a 100644 (file)
@@ -15,7 +15,6 @@
 #ifndef __MACH_MPC83XX_SYS_H__
 #define __MACH_MPC83XX_SYS_H__
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <syslib/ppc83xx_setup.h>
 #include <asm/ppcboot.h>
index 9b014df516b903d818783963695d12c280c77dca..4f839da6782fb0d5ad40299b19ba969850c5302e 100644 (file)
@@ -11,7 +11,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 0b5e7ff856f5e32c0b37bfc714db4feb1ff62d8c..7559f9e6fc28b2e18c474dba7501558bf4f972f8 100644 (file)
@@ -15,7 +15,6 @@
 #ifndef __MACH_MPC8540ADS_H__
 #define __MACH_MPC8540ADS_H__
 
-#include <linux/config.h>
 #include <linux/initrd.h>
 #include <syslib/ppc85xx_setup.h>
 #include <platforms/85xx/mpc85xx_ads_common.h>
index 9754dbd5d18c72e49d8579883fc4451398aa16fa..4f79c372c4e72654a71260e72f77176171919315 100644 (file)
@@ -15,7 +15,6 @@
 #ifndef __MACH_MPC8555CDS_H__
 #define __MACH_MPC8555CDS_H__
 
-#include <linux/config.h>
 #include <syslib/ppc85xx_setup.h>
 #include <platforms/85xx/mpc85xx_cds_common.h>
 
index 0cb2e86470e2a34d7a7cc8501b736116611facd1..d90cd24d018e4e70f0f7df7a526cbdcd83f22d29 100644 (file)
@@ -11,7 +11,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -132,7 +131,7 @@ static irqreturn_t cpm2_cascade(int irq, void *dev_id, struct pt_regs *regs)
 
 static struct irqaction cpm2_irqaction = {
        .handler = cpm2_cascade,
-       .flags = SA_INTERRUPT,
+       .flags = IRQF_DISABLED,
        .mask = CPU_MASK_NONE,
        .name = "cpm2_cascade",
 };
index c2247c21fc53aaa7cd9d8b927e6daf842062742c..9f185ab2e019194e697fe15e8f21b090b64984d8 100644 (file)
@@ -15,7 +15,6 @@
 #ifndef __MACH_MPC8560ADS_H
 #define __MACH_MPC8560ADS_H
 
-#include <linux/config.h>
 #include <syslib/ppc85xx_setup.h>
 #include <platforms/85xx/mpc85xx_ads_common.h>
 
index 8fd9d763f58dc5d4349b45e6a930e2b197c833c1..674806e001f6a1aa0e67b44e8b3dbb2588460a2e 100644 (file)
@@ -11,7 +11,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index de8d41aafe1160b07c8fe04837d2f1836ce394ab..abf32281655d77c557024f60fadfc51b43275d22 100644 (file)
@@ -15,7 +15,6 @@
 #ifndef __MACH_MPC85XX_ADS_H__
 #define __MACH_MPC85XX_ADS_H__
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <asm/ppcboot.h>
 
index 4368dc3f3c30baae6a61a06197510200220355d2..75204588a3e75f6935ba4c622d39fdba383e82e2 100644 (file)
@@ -11,7 +11,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -137,7 +136,7 @@ static irqreturn_t cpm2_cascade(int irq, void *dev_id, struct pt_regs *regs)
 
 static struct irqaction cpm2_irqaction = {
        .handler = cpm2_cascade,
-       .flags = SA_INTERRUPT,
+       .flags = IRQF_DISABLED,
        .mask = CPU_MASK_NONE,
        .name = "cpm2_cascade",
 };
index 62df54f61ae3aa95923879fff209da91da8bd622..32c5455c8b82fa5e7393b91005db252a08e5213b 100644 (file)
@@ -15,7 +15,6 @@
 #ifndef __MACH_MPC85XX_CDS_H__
 #define __MACH_MPC85XX_CDS_H__
 
-#include <linux/config.h>
 #include <linux/serial.h>
 #include <asm/ppcboot.h>
 #include <linux/initrd.h>
index b73778ecf8278727f15c8eabb26a29b164df581b..764d580ff5356c0cbf39a4e6e0627fe4e764be4d 100644 (file)
@@ -11,7 +11,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 44ffaa2d2c87ff0ad6a5cb8ff07c7bd457fc0581..c7d61cf3a449b0cecf077e42afa4a5b9a5c78838 100644 (file)
@@ -13,7 +13,6 @@
 #ifndef __MACH_SBC8560_H__
 #define __MACH_SBC8560_H__
  
-#include <linux/config.h>
 #include <platforms/85xx/sbc85xx.h>
 
 #define CPM_MAP_ADDR    (CCSRBAR + MPC85xx_CPM_OFFSET)
index d3ff280510ffea144fd664e3e1e2b5c4492cf53e..2c587ca97bceb9f3d73ba52732891fdf1cd64221 100644 (file)
@@ -10,7 +10,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 5dd8b6a98c9ba5bbd416d0ae1236cd75e5afed3d..21ea7a55639bab49592a4689aaa3f55b195974c5 100644 (file)
@@ -14,7 +14,6 @@
 #ifndef __PLATFORMS_85XX_SBC85XX_H__
 #define __PLATFORMS_85XX_SBC85XX_H__
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/seq_file.h>
 #include <asm/ppcboot.h>
index 8d7baa9a397ad19d81059d4b12e586564f026be9..495aa79bb3a1d90a0061c9eb9719a24eafea805d 100644 (file)
@@ -16,7 +16,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -167,7 +166,7 @@ static irqreturn_t cpm2_cascade(int irq, void *dev_id, struct pt_regs *regs)
 
 static struct irqaction cpm2_irqaction = {
        .handler        = cpm2_cascade,
-       .flags          = SA_INTERRUPT,
+       .flags          = IRQF_DISABLED,
        .mask           = CPU_MASK_NONE,
        .name           = "cpm2_cascade",
 };
index 3f71f8f59370679975ab131d98856ff43c59eb56..c6e34c09e9795b59300f45fbb0e9e8c15f4fac33 100644 (file)
@@ -17,7 +17,6 @@
 #ifndef __MACH_STX_GP3_H
 #define __MACH_STX_GP3_H
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <asm/ppcboot.h>
 
index 00af132262b30bf2ff0001a749e1afd2deb5aff9..189ed4175f9fb2dbb5bededc6e880fe9c0f2b71a 100644 (file)
@@ -14,7 +14,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -191,7 +190,7 @@ static irqreturn_t cpm2_cascade(int irq, void *dev_id, struct pt_regs *regs)
 
 static struct irqaction cpm2_irqaction = {
        .handler = cpm2_cascade,
-       .flags = SA_INTERRUPT,
+       .flags = IRQF_DISABLED,
        .mask = CPU_MASK_NONE,
        .name = "cpm2_cascade",
 };
index 612d80504f9b5f3bd67aa3d582f1bed1324bbec7..57284e68f67620c742fc831bdbe1c4042811fd0d 100644 (file)
@@ -14,7 +14,6 @@
 #ifndef __MACH_TQM85XX_H
 #define __MACH_TQM85XX_H
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <asm/ppcboot.h>
 
index 33dad6db824390e4ea09d9cefec7893c49de2833..dc165f0c89084da37c714f427b5572619473fe65 100644 (file)
@@ -10,7 +10,6 @@
  *
  */
 
-#include <linux/config.h>
 #ifdef CONFIG_AMIGA
 
 #include <linux/kernel.h>
index 5c4118a459f3eb1b6822b5817ee16248f9c9da48..1d034ead2c9a645eb99181eecb124cf2b910fe83 100644 (file)
@@ -11,7 +11,6 @@
  *  Amiga specific stuff into mach/amiga.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/init.h>
index edb87b57383134c6f13da3c5170a7c34a5427191..69000b1c7a4c8f2c6a423f508b0b0bba372a4c3b 100644 (file)
@@ -7,7 +7,6 @@
 #ifndef __MACH_CCM_H
 #define __MACH_CCM_H
 
-#include <linux/config.h>
 
 #include <asm/ppcboot.h>
 
index f324f757cae16fe3dda87278f91f31bd5ee22a3d..a764ae71cbcbb7248f9f13b4322061d203c35db1 100644 (file)
@@ -9,7 +9,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 790475c22fd7405d896f4d5e12390d0f273eadc1..e78bccf96c9d98c2bbe29e6c04779934b39d5c15 100644 (file)
@@ -8,7 +8,6 @@
  * is licensed "as is" without any warranty of any kind, whether express
  * or implied.
  */
-#include <linux/config.h>
 #include <linux/delay.h>
 #include <linux/pci.h>
 #include <linux/ide.h>
index 31e8e21e1d5cf93cf1c1aeb8d79ba4e7fd586af2..4957a7bcde2296ce5c9b04bf51076233ca1b9e1f 100644 (file)
@@ -20,7 +20,6 @@
  * Note: The 750CXe and 7450 are not stable with a 125MHz or 133MHz TCLK/SYSCLK.
  *     At 100MHz, they are solid.
  */
-#include <linux/config.h>
 
 #include <linux/delay.h>
 #include <linux/pci.h>
index 104ac9b16e8b2ee33039b2f564ef7a2d53ba9061..90ed375c9b903771cecb6c5cebf946efcb0f94d6 100644 (file)
@@ -11,7 +11,6 @@
  * Free Software Foundation; either version 2 of the License, or (at your
  * option) any later version.
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/kdev_t.h>
index e1c0b1b6dcb383bbe39dd0dd16479d581c35248e..2f9f0f60e3f76139f80a5ca43246679e091a3db8 100644 (file)
@@ -19,7 +19,6 @@
 #ifndef __ASM_FADS_H__
 #define __ASM_FADS_H__
 
-#include <linux/config.h>
 
 #include <asm/ppcboot.h>
 
index b181f210800121bd2d8bb9ca257cd88bff887b6d..e8c84d24f01fb7d569795383ba0698c3680effad 100644 (file)
@@ -6,7 +6,6 @@
  *    ---Dan
  */
 
-#include <linux/config.h>
 #include <asm/reg.h>
 #include <asm/page.h>
 #include <platforms/gemini.h>
index 69855aeec88861cc363cb1ab0f015a9072e7db00..b915eff79fdbe4d8b5e64d5d664bd1d3fb907814 100644 (file)
@@ -2,7 +2,6 @@
 #ifndef __ASMPPC_GEMINI_SERIAL_H
 #define __ASMPPC_GEMINI_SERIAL_H
 
-#include <linux/config.h>
 #include <platforms/gemini.h>
 
 #ifdef CONFIG_SERIAL_MANY_PORTS
index 0090ff154608c39473b2d51366eaed607dd86eff..f48048f362a8e9c219ee23f363bfe1956e22ef86 100644 (file)
@@ -6,7 +6,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 75dc2ee87d2fb9c6a7bc1bda30410dc2e76d03f6..e0f112a1fd0b4926675cfc1d4eae7421e341dba4 100644 (file)
@@ -12,7 +12,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 
 #include <linux/pci.h>
 #include <linux/delay.h>
@@ -838,7 +837,7 @@ static void smp_hdpu_setup_cpu(int cpu_nr)
                mv64x60_write(&bh, MV64360_CPU0_DOORBELL_CLR, 0xff);
                mv64x60_write(&bh, MV64360_CPU0_DOORBELL_MASK, 0xff);
                request_irq(60, hdpu_smp_cpu0_int_handler,
-                           SA_INTERRUPT, hdpu_smp0, 0);
+                           IRQF_DISABLED, hdpu_smp0, 0);
        }
 
        if (cpu_nr == 1) {
@@ -858,7 +857,7 @@ static void smp_hdpu_setup_cpu(int cpu_nr)
                mv64x60_write(&bh, MV64360_CPU1_DOORBELL_CLR, 0x0);
                mv64x60_write(&bh, MV64360_CPU1_DOORBELL_MASK, 0xff);
                request_irq(28, hdpu_smp_cpu1_int_handler,
-                           SA_INTERRUPT, hdpu_smp1, 0);
+                           IRQF_DISABLED, hdpu_smp1, 0);
        }
 
 }
index 198fc590b9f58fa4e51fa46961cdb06ce03f918c..de91afff8ca13ec645abc6f9096f0b415f9175bf 100644 (file)
@@ -7,7 +7,6 @@
 #ifndef __MACH_HERMES_H
 #define __MACH_HERMES_H
 
-#include <linux/config.h>
 
 #include <asm/ppcboot.h>
 
index 8c3836c5f054a11d9f851d3a8296b59dac8135df..2f1f86ce1447db9bec48743ae9a00f4add1a34a4 100644 (file)
@@ -7,7 +7,6 @@
 #ifndef __MACH_IP860_H
 #define __MACH_IP860_H
 
-#include <linux/config.h>
 
 #include <asm/ppcboot.h>
 
index d4be310f8084b87c99c3f31c5eee626477318604..9109e684ad9b8b9daa466f34730eae174f5225d3 100644 (file)
@@ -13,7 +13,6 @@
 #ifndef __ASM_IVMS8_H__
 #define __ASM_IVMS8_H__
 
-#include <linux/config.h>
 
 #include <asm/ppcboot.h>
 
index ad21280e892095abd5fa6759b86bcf5cc4c03a4a..720f8b3e2fbc508b9aa42cc321c32a9b9397d504 100644 (file)
@@ -16,7 +16,6 @@
  * Supports the Artesyn 750i, 752i, and 3750.  The 752i is virtually identical
  * to the 750i except that it has an mv64460 bridge.
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/kdev_t.h>
index 8c87642c510fd14f8325dd2fd5a3ee29cb192e44..5e5eb6d0f6aaf665d92c479136dd3c416b15e4e9 100644 (file)
@@ -7,7 +7,6 @@
 #ifndef __MACH_LANTEC_H
 #define __MACH_LANTEC_H
 
-#include <linux/config.h>
 
 #include <asm/ppcboot.h>
 
index fecbe9adc9e0c2c78894f8546aa6306a4dd69c6e..b9e9db63f65b81bc43f0f99de8b45b4330da27da 100644 (file)
@@ -21,7 +21,6 @@
  * kind, whether express or implied.
  */
 
-#include <linux/config.h>
 #include <linux/initrd.h>
 #include <linux/seq_file.h>
 #include <linux/kdev_t.h>
index c6445a727ca3a8c0804cd24bfdcc7552bfa360fa..18dc6e8dd4f40d9712de5a88fb4e125de83434f7 100644 (file)
@@ -10,7 +10,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/delay.h>
 #include <linux/pci_ids.h>
index 995bf5112df05abda856aeeb7e53e62c10df7fd8..e63f3b07a5dbc93adebeab122a0e56eeb35ec0de 100644 (file)
@@ -7,7 +7,6 @@
 #ifndef __MACH_LWMON_H
 #define __MACH_LWMON_H
 
-#include <linux/config.h>
 
 #include <asm/ppcboot.h>
 
index d919dab6134768ae67249071c7ba2577ccb5cf73..f19b6167c7700da2bc265cdc5979b1a242a8bd49 100644 (file)
@@ -11,7 +11,6 @@
  * kind, whether express or implied.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/param.h>
index a80b7d116b4938905d007efdeea0509e2263eedb..d3bbbb3c9a1f125d1c7b0cb45f4cc1a2a5f21b3c 100644 (file)
@@ -15,7 +15,6 @@
 #ifndef __ASM_MPC885ADS_H__
 #define __ASM_MPC885ADS_H__
 
-#include <linux/config.h>
 
 #include <asm/ppcboot.h>
 
index 4b88679cd31c38e3ba3fd3160b8cb4db8540a08f..c1fc4a16fea9d7f9aa95a1c1b124155d48ceee18 100644 (file)
@@ -11,7 +11,6 @@
  * kind, whether express or implied.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/param.h>
index c717cd92c028e5e563c6c5b2c88bb12eedccb23d..bb8d4a45437ae02caf982b0226036735fcf9a01c 100644 (file)
@@ -9,7 +9,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 3c3d881df00d52de50b804e5c54e152d9968ede4..3da47d9ec7a2d8fce1df6a4dbed0324383195aae 100644 (file)
@@ -9,7 +9,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/types.h>
index 91a820a6fbc43590d0370e3ff40209453cf07c2b..a2c03a22875ef91c677d3597e0b104b05a53f3e2 100644 (file)
@@ -7,7 +7,6 @@
 #ifndef __MACH_PCU_E_H
 #define __MACH_PCU_E_H
 
-#include <linux/config.h>
 
 #include <asm/ppcboot.h>
 
index c3a86be11fb79960ee6e28d8d170269fa2ac2b66..4d46650e07fd56c628a945b8a58ea1cdd5de49bd 100644 (file)
@@ -11,7 +11,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index de2761ebe0d927a62350e67b9d07cb7cbb873ef0..9778105d4dfeaaca72ab5f67718cb55e9e0c0631 100644 (file)
@@ -13,7 +13,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
index 6b26dd36c64071bca77ab912b7aced5a8ecc4cd1..2b287f4e0ca3c9166efd689375bc484f144b831a 100644 (file)
@@ -9,7 +9,6 @@
 #ifndef __MACH_ADS8260_DEFS
 #define __MACH_ADS8260_DEFS
 
-#include <linux/config.h>
 
 #include <asm/ppcboot.h>
 
index e50b9996848c4ace0b6bc907040f2c321711eab6..c627ba41335fb994b1a8967cd1bbc02a36b21bf7 100644 (file)
@@ -6,7 +6,6 @@
  * The motherboard routes/maps will disappear shortly. -- Cort
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
index e86f6156d5895cee4f099e91b9319aa7cd3337cb..6436beffdc9688d6cd56855180957e10008963e5 100644 (file)
@@ -11,7 +11,6 @@
  * bootup setup stuff..
  */
 
-#include <linux/config.h>
 #include <linux/delay.h>
 #include <linux/module.h>
 #include <linux/errno.h>
index cdd9cfb13ee991a56157341cee1c399ebab888f3..fcab513e206dd7fc95336c8225ca185e291efb92 100644 (file)
@@ -9,7 +9,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index e459a199fb1d5593e29e01f05c7b98cda8139aa9..f4ade5cd7a88d241347d0e036b998990fae83908 100644 (file)
@@ -7,7 +7,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index bc26b6d71c1d1cf988d02dd4e0024a978835d9fc..3bb530af029774b865849e24d5fee27c8fe83a11 100644 (file)
@@ -18,7 +18,6 @@
  * SCSI / VGA.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -1311,7 +1310,7 @@ static void ppc7d_init2(void)
 
        /* Hook up i8259 interrupt which is connected to GPP28 */
        request_irq(mv64360_irq_base + MV64x60_IRQ_GPP28, ppc7d_i8259_intr,
-                   SA_INTERRUPT, "I8259 (GPP28) interrupt", (void *)0);
+                   IRQF_DISABLED, "I8259 (GPP28) interrupt", (void *)0);
 
        /* Configure MPP16 as watchdog NMI, MPP17 as watchdog WDE */
        spin_lock_irqsave(&mv64x60_lock, flags);
index 6daa109491c4f1d4946839041b6451fec8f2f75a..57a2a55dab8c57a7fc26d89a3a967ebbbfe34064 100644 (file)
@@ -8,7 +8,6 @@
 #ifndef __MACH_RPX_DEFS
 #define __MACH_RPX_DEFS
 
-#include <linux/config.h>
 
 #ifndef __ASSEMBLY__
 /* A Board Information structure that is given to a program when
index deee5bd36aa8506173869d279c40c6b9e94b6759..71978064627062bde4541f1728eab037cc5bfdab 100644 (file)
@@ -8,7 +8,6 @@
 #ifndef __MACH_RPX_DEFS
 #define __MACH_RPX_DEFS
 
-#include <linux/config.h>
 
 #ifndef __ASSEMBLY__
 /* A Board Information structure that is given to a program when
index 6dc459decb2d105d3d3cfb366f99205f8932b6a7..a76002af686ff9416f35a1d7964fb7bf5b9b2d8f 100644 (file)
@@ -60,7 +60,6 @@
  * found, we can hopefully stop hardcoding 32MB of RAM.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 41006d2b4b3823a3438f2d79e43caf67b77ee5ab..60b769c7f3fc97eb6ec62c6b3ca670e16ae82e0f 100644 (file)
@@ -13,7 +13,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
@@ -146,7 +145,7 @@ static irqreturn_t sbc82xx_i8259_demux(int irq, void *dev_id, struct pt_regs *re
 
 static struct irqaction sbc82xx_i8259_irqaction = {
        .handler = sbc82xx_i8259_demux,
-       .flags = SA_INTERRUPT,
+       .flags = IRQF_DISABLED,
        .mask = CPU_MASK_NONE,
        .name = "i8259 demux",
 };
index 3783deccd9b28d1aa21396be566b3449d2fd629e..3c784278487647416ca75c73860fc5371cc14e73 100644 (file)
@@ -9,7 +9,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index c7a78a646c6677acc95770114beecdf76fb63be9..7f8c9a6928f89607b8753f10487339bbedbdcbe3 100644 (file)
@@ -7,7 +7,6 @@
 #ifndef __TQM8260_PLATFORM
 #define __TQM8260_PLATFORM
 
-#include <linux/config.h>
 
 #include <asm/ppcboot.h>
 
index 43ac064ebe5afca4099081157daa241d0b17b64c..662131d0eb39d7e34171761e75d5fbeaf057e902 100644 (file)
@@ -8,7 +8,6 @@
 #ifndef __MACH_TQM8xx_H
 #define __MACH_TQM8xx_H
 
-#include <linux/config.h>
 
 #include <asm/ppcboot.h>
 
index 490749ca88f9aaf47d489e9d0f05e3611694e56e..2497bbc07e764a76f582c1c05a4ba3efd78f0317 100644 (file)
@@ -104,3 +104,5 @@ obj-$(CONFIG_PPC_MPC52xx)   += mpc52xx_setup.o mpc52xx_pic.o \
 ifeq ($(CONFIG_PPC_MPC52xx),y)
 obj-$(CONFIG_PCI)              += mpc52xx_pci.o
 endif
+
+obj-$(CONFIG_PPC_I8259)                += i8259.o
index 12fa83e6774a13080c0dd82242179b0128c4fd5d..d11667046f21c732ee49b86ccad3d608f24af8d4 100644 (file)
@@ -3,11 +3,10 @@
  *
  * Benjamin Herrenschmidt <benh@kernel.crashing.org>
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/init.h>
-#include <linux/version.h>
+#include <linux/utsrelease.h>
 
 #include <asm/sections.h>
 #include <asm/bootx.h>
index 9fcff74bfdd0893ef1515ac3e00d382ca11bf6dc..9293f5c59099154a745b7d833134ab08dfb08a05 100644 (file)
@@ -14,7 +14,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/serial.h>
 #include <linux/tty.h>         /* For linux/serial_core.h */
index 874078a7664dc66ccdc3f1137ea5b3382cd7e093..987cc0414e6e880172318a53525bea57cf28648a 100644 (file)
@@ -15,7 +15,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 
index 91096b38ae70297b77fcd8820e3e51a5d6ecf030..7fd550a7d586752ea456eba3a0110ee824cb15cc 100644 (file)
@@ -297,7 +297,7 @@ gt64260_register_hdlrs(void)
 
        /* Register CPU interface error interrupt handler */
        if ((rc = request_irq(MV64x60_IRQ_CPU_ERR,
-               gt64260_cpu_error_int_handler, SA_INTERRUPT, CPU_INTR_STR, 0)))
+               gt64260_cpu_error_int_handler, IRQF_DISABLED, CPU_INTR_STR, 0)))
                printk(KERN_WARNING "Can't register cpu error handler: %d", rc);
 
        mv64x60_write(&bh, MV64x60_CPU_ERR_MASK, 0);
@@ -305,7 +305,7 @@ gt64260_register_hdlrs(void)
 
        /* Register PCI 0 error interrupt handler */
        if ((rc = request_irq(MV64360_IRQ_PCI0, gt64260_pci_error_int_handler,
-                   SA_INTERRUPT, PCI0_INTR_STR, (void *)0)))
+                   IRQF_DISABLED, PCI0_INTR_STR, (void *)0)))
                printk(KERN_WARNING "Can't register pci 0 error handler: %d",
                        rc);
 
@@ -314,7 +314,7 @@ gt64260_register_hdlrs(void)
 
        /* Register PCI 1 error interrupt handler */
        if ((rc = request_irq(MV64360_IRQ_PCI1, gt64260_pci_error_int_handler,
-                   SA_INTERRUPT, PCI1_INTR_STR, (void *)1)))
+                   IRQF_DISABLED, PCI1_INTR_STR, (void *)1)))
                printk(KERN_WARNING "Can't register pci 1 error handler: %d",
                        rc);
 
diff --git a/arch/ppc/syslib/i8259.c b/arch/ppc/syslib/i8259.c
new file mode 100644 (file)
index 0000000..eb35353
--- /dev/null
@@ -0,0 +1,212 @@
+/*
+ * i8259 interrupt controller driver.
+ *
+ * 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/init.h>
+#include <linux/ioport.h>
+#include <linux/interrupt.h>
+#include <asm/io.h>
+#include <asm/i8259.h>
+
+static volatile void __iomem *pci_intack; /* RO, gives us the irq vector */
+
+static unsigned char cached_8259[2] = { 0xff, 0xff };
+#define cached_A1 (cached_8259[0])
+#define cached_21 (cached_8259[1])
+
+static DEFINE_SPINLOCK(i8259_lock);
+
+static int i8259_pic_irq_offset;
+
+/*
+ * Acknowledge the IRQ using either the PCI host bridge's interrupt
+ * acknowledge feature or poll.  How i8259_init() is called determines
+ * which is called.  It should be noted that polling is broken on some
+ * IBM and Motorola PReP boxes so we must use the int-ack feature on them.
+ */
+int i8259_irq(struct pt_regs *regs)
+{
+       int irq;
+
+       spin_lock(&i8259_lock);
+
+       /* Either int-ack or poll for the IRQ */
+       if (pci_intack)
+               irq = readb(pci_intack);
+       else {
+               /* Perform an interrupt acknowledge cycle on controller 1. */
+               outb(0x0C, 0x20);               /* prepare for poll */
+               irq = inb(0x20) & 7;
+               if (irq == 2 ) {
+                       /*
+                        * Interrupt is cascaded so perform interrupt
+                        * acknowledge on controller 2.
+                        */
+                       outb(0x0C, 0xA0);       /* prepare for poll */
+                       irq = (inb(0xA0) & 7) + 8;
+               }
+       }
+
+       if (irq == 7) {
+               /*
+                * This may be a spurious interrupt.
+                *
+                * Read the interrupt status register (ISR). If the most
+                * significant bit is not set then there is no valid
+                * interrupt.
+                */
+               if (!pci_intack)
+                       outb(0x0B, 0x20);       /* ISR register */
+               if(~inb(0x20) & 0x80)
+                       irq = -1;
+       }
+
+       spin_unlock(&i8259_lock);
+       return irq + i8259_pic_irq_offset;
+}
+
+static void i8259_mask_and_ack_irq(unsigned int irq_nr)
+{
+       unsigned long flags;
+
+       spin_lock_irqsave(&i8259_lock, flags);
+       irq_nr -= i8259_pic_irq_offset;
+       if (irq_nr > 7) {
+               cached_A1 |= 1 << (irq_nr-8);
+               inb(0xA1);      /* DUMMY */
+               outb(cached_A1, 0xA1);
+               outb(0x20, 0xA0);       /* Non-specific EOI */
+               outb(0x20, 0x20);       /* Non-specific EOI to cascade */
+       } else {
+               cached_21 |= 1 << irq_nr;
+               inb(0x21);      /* DUMMY */
+               outb(cached_21, 0x21);
+               outb(0x20, 0x20);       /* Non-specific EOI */
+       }
+       spin_unlock_irqrestore(&i8259_lock, flags);
+}
+
+static void i8259_set_irq_mask(int irq_nr)
+{
+       outb(cached_A1,0xA1);
+       outb(cached_21,0x21);
+}
+
+static void i8259_mask_irq(unsigned int irq_nr)
+{
+       unsigned long flags;
+
+       spin_lock_irqsave(&i8259_lock, flags);
+       irq_nr -= i8259_pic_irq_offset;
+       if (irq_nr < 8)
+               cached_21 |= 1 << irq_nr;
+       else
+               cached_A1 |= 1 << (irq_nr-8);
+       i8259_set_irq_mask(irq_nr);
+       spin_unlock_irqrestore(&i8259_lock, flags);
+}
+
+static void i8259_unmask_irq(unsigned int irq_nr)
+{
+       unsigned long flags;
+
+       spin_lock_irqsave(&i8259_lock, flags);
+       irq_nr -= i8259_pic_irq_offset;
+       if (irq_nr < 8)
+               cached_21 &= ~(1 << irq_nr);
+       else
+               cached_A1 &= ~(1 << (irq_nr-8));
+       i8259_set_irq_mask(irq_nr);
+       spin_unlock_irqrestore(&i8259_lock, flags);
+}
+
+static struct irq_chip i8259_pic = {
+       .typename       = " i8259    ",
+       .mask           = i8259_mask_irq,
+       .unmask         = i8259_unmask_irq,
+       .mask_ack       = i8259_mask_and_ack_irq,
+};
+
+static struct resource pic1_iores = {
+       .name = "8259 (master)",
+       .start = 0x20,
+       .end = 0x21,
+       .flags = IORESOURCE_BUSY,
+};
+
+static struct resource pic2_iores = {
+       .name = "8259 (slave)",
+       .start = 0xa0,
+       .end = 0xa1,
+       .flags = IORESOURCE_BUSY,
+};
+
+static struct resource pic_edgectrl_iores = {
+       .name = "8259 edge control",
+       .start = 0x4d0,
+       .end = 0x4d1,
+       .flags = IORESOURCE_BUSY,
+};
+
+static struct irqaction i8259_irqaction = {
+       .handler = no_action,
+       .flags = SA_INTERRUPT,
+       .mask = CPU_MASK_NONE,
+       .name = "82c59 secondary cascade",
+};
+
+/*
+ * i8259_init()
+ * intack_addr - PCI interrupt acknowledge (real) address which will return
+ *               the active irq from the 8259
+ */
+void __init i8259_init(unsigned long intack_addr, int offset)
+{
+       unsigned long flags;
+       int i;
+
+       spin_lock_irqsave(&i8259_lock, flags);
+       i8259_pic_irq_offset = offset;
+
+       /* init master interrupt controller */
+       outb(0x11, 0x20); /* Start init sequence */
+       outb(0x00, 0x21); /* Vector base */
+       outb(0x04, 0x21); /* edge tiggered, Cascade (slave) on IRQ2 */
+       outb(0x01, 0x21); /* Select 8086 mode */
+
+       /* init slave interrupt controller */
+       outb(0x11, 0xA0); /* Start init sequence */
+       outb(0x08, 0xA1); /* Vector base */
+       outb(0x02, 0xA1); /* edge triggered, Cascade (slave) on IRQ2 */
+       outb(0x01, 0xA1); /* Select 8086 mode */
+
+       /* always read ISR */
+       outb(0x0B, 0x20);
+       outb(0x0B, 0xA0);
+
+       /* Mask all interrupts */
+       outb(cached_A1, 0xA1);
+       outb(cached_21, 0x21);
+
+       spin_unlock_irqrestore(&i8259_lock, flags);
+
+       for (i = 0; i < NUM_ISA_INTERRUPTS; ++i) {
+               set_irq_chip_and_handler(offset + i, &i8259_pic,
+                                        handle_level_irq);
+               irq_desc[offset + i].status |= IRQ_LEVEL;
+       }
+
+       /* reserve our resources */
+       setup_irq(offset + 2, &i8259_irqaction);
+       request_resource(&ioport_resource, &pic1_iores);
+       request_resource(&ioport_resource, &pic2_iores);
+       request_resource(&ioport_resource, &pic_edgectrl_iores);
+
+       if (intack_addr != 0)
+               pci_intack = ioremap(intack_addr, 1);
+
+}
index fbaae5f6d8344e9f072ec7b773d75ccb02c57239..a3927ec9b5d7e46429ed13c538edf0a2b71a04a0 100644 (file)
@@ -13,7 +13,6 @@
  * option) any later version.
  *
  */
-#include <linux/config.h>
 #include <linux/types.h>
 #include <asm/reg.h>
 #include <asm/ibm44x.h>
index f48529f3c23d7207316e67aff33dfb56720b3f1c..94d7835038adab254d9fc41f603eaf169b7d3ed3 100644 (file)
@@ -16,7 +16,6 @@
 
 #ifndef __ASSEMBLY__
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <syslib/ibm44x_common.h>
 
index f6cc16888527fd159e017a76f524253ab8c441ff..4b77e6c8c87f9430cf0bb7775d9911de97fa0784 100644 (file)
@@ -10,7 +10,6 @@
  * option) any later version.
  *
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
 #include <asm/ibm44x.h>
@@ -150,7 +149,7 @@ void __init ibm440gx_l2c_enable(void){
        unsigned long flags;
 
        /* Install error handler */
-       if (request_irq(87, l2c_error_handler, SA_INTERRUPT, "L2C", 0) < 0){
+       if (request_irq(87, l2c_error_handler, IRQF_DISABLED, "L2C", 0) < 0){
                printk(KERN_ERR "Cannot install L2C error handler, cache is not enabled\n");
                return;
        }
index a03ec6022e8f3ddfdcfa1e2bde18f22cf5462d07..8d6f203e7a1d8bffea13b65bf8a7e7842a7274a5 100644 (file)
@@ -16,7 +16,6 @@
 
 #ifndef __ASSEMBLY__
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/seq_file.h>
 #include <syslib/ibm44x_common.h>
index 293e4138d172e12b1d70054e97c87abfc27bd452..571f8bcf78e6e1ddf34b2fba1cbb16fcea9845a1 100644 (file)
@@ -13,7 +13,6 @@
  * option) any later version.
  *
  */
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/serial.h>
 
index 14a981a5cea72413ae496d41cdaf8b429cc8791d..01f99b4a6649cea79d5486847678a1bc5633f153 100644 (file)
@@ -13,7 +13,6 @@
  * option) any later version.
  *
  */
-#include <linux/config.h>
 #include <linux/time.h>
 #include <linux/types.h>
 #include <linux/serial.h>
index 99e4bc0e42af00b0c7b99b440ccb9f44ac425766..974581ea48493186c5ae1fb87b5732e5d4925393 100644 (file)
@@ -15,7 +15,6 @@
  * or implied.
  */
 #include <linux/kernel.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/types.h>
index b7a6cb2d8d526b7f6273c4653009fea99e40827e..15f0d7323535f400b81603dd21f1bc00f2ecc50e 100644 (file)
@@ -6,7 +6,6 @@
  *  Further modified for generic 8xx and 8260 by Dan.
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
index 63fa5b313396b42fba12d24cc801b34921b49f96..d3fa264e179e345d1b0107606ec01b6adbfd107b 100644 (file)
@@ -139,7 +139,7 @@ pq2pci_irq_demux(int irq, void *dev_id, struct pt_regs *regs)
 
 static struct irqaction pq2pci_irqaction = {
        .handler = pq2pci_irq_demux,
-       .flags   = SA_INTERRUPT,
+       .flags   = IRQF_DISABLED,
        .mask    = CPU_MASK_NONE,
        .name    = "PQ2 PCI cascade",
 };
index 0c4c0de7c59f0b10990969215b0bca76d37a8c55..54303a7b4e6990d1662f9fe257fb35da2dc81648 100644 (file)
@@ -10,7 +10,6 @@
  * bootup setup stuff..
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index 5a5a7a9cd248620528e34bbee408203d57e2480c..20a0eac0dc3a3fbd8ca4a6f3bbd59e6a64295dc3 100644 (file)
@@ -11,7 +11,6 @@
  * kind, whether express or implied.
  */
 
-#include <linux/config.h>
 
 #include <asm/pci.h>
 
index ee6379bb415e6e6ac54df6a29d410dcf040a8bf5..80c609019bdac01b7492d5d4e72a4d6d65df8bf2 100644 (file)
@@ -15,7 +15,6 @@
  * kind, whether express or implied.
  */
 
-#include <linux/config.h>
 
 #include <asm/io.h>
 #include <asm/time.h>
index a4244d46838197d0b6b20126ba7a454f2b7659f8..3f6d162f87cfa635b54263757f401127ee99b454 100644 (file)
@@ -380,7 +380,7 @@ mv64360_register_hdlrs(void)
        /* Clear old errors and register CPU interface error intr handler */
        mv64x60_write(&bh, MV64x60_CPU_ERR_CAUSE, 0);
        if ((rc = request_irq(MV64x60_IRQ_CPU_ERR + mv64360_irq_base,
-               mv64360_cpu_error_int_handler, SA_INTERRUPT, CPU_INTR_STR, 0)))
+               mv64360_cpu_error_int_handler, IRQF_DISABLED, CPU_INTR_STR, 0)))
                printk(KERN_WARNING "Can't register cpu error handler: %d", rc);
 
        mv64x60_write(&bh, MV64x60_CPU_ERR_MASK, 0);
@@ -389,14 +389,14 @@ mv64360_register_hdlrs(void)
        /* Clear old errors and register internal SRAM error intr handler */
        mv64x60_write(&bh, MV64360_SRAM_ERR_CAUSE, 0);
        if ((rc = request_irq(MV64360_IRQ_SRAM_PAR_ERR + mv64360_irq_base,
-               mv64360_sram_error_int_handler,SA_INTERRUPT,SRAM_INTR_STR, 0)))
+               mv64360_sram_error_int_handler,IRQF_DISABLED,SRAM_INTR_STR, 0)))
                printk(KERN_WARNING "Can't register SRAM error handler: %d",rc);
 
        /* Clear old errors and register PCI 0 error intr handler */
        mv64x60_write(&bh, MV64x60_PCI0_ERR_CAUSE, 0);
        if ((rc = request_irq(MV64360_IRQ_PCI0 + mv64360_irq_base,
                        mv64360_pci_error_int_handler,
-                       SA_INTERRUPT, PCI0_INTR_STR, (void *)0)))
+                       IRQF_DISABLED, PCI0_INTR_STR, (void *)0)))
                printk(KERN_WARNING "Can't register pci 0 error handler: %d",
                        rc);
 
@@ -411,7 +411,7 @@ mv64360_register_hdlrs(void)
        mv64x60_write(&bh, MV64x60_PCI1_ERR_CAUSE, 0);
        if ((rc = request_irq(MV64360_IRQ_PCI1 + mv64360_irq_base,
                        mv64360_pci_error_int_handler,
-                       SA_INTERRUPT, PCI1_INTR_STR, (void *)1)))
+                       IRQF_DISABLED, PCI1_INTR_STR, (void *)1)))
                printk(KERN_WARNING "Can't register pci 1 error handler: %d",
                        rc);
 
index 9cf18764a1a145d33584181a2f37cd0c6998d938..e1876261e5dcc359f53ac12062f900d598d5a241 100644 (file)
@@ -18,7 +18,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/irq.h>
 #include <asm/delay.h>
 #include <asm/mv64x60.h>
index a4ecc2ee579ff781f567ef961aa6004b30b585da..50c55622ece9b7d29719877e98e573357431a0b3 100644 (file)
@@ -36,7 +36,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/list.h>
 #include <linux/miscdevice.h>
 #include <linux/slab.h>
index 767a0bc9581765fb21c70920a0fc93e7b3697735..aa0b957887056a90a701cc192290c55f21f5dc1d 100644 (file)
@@ -6,7 +6,6 @@
  *  for more details.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -576,18 +575,21 @@ void openpic_request_IPIs(void)
        if (OpenPIC == NULL)
                return;
 
-       /* IPIs are marked SA_INTERRUPT as they must run with irqs disabled */
+       /*
+        * IPIs are marked IRQF_DISABLED as they must run with irqs
+        * disabled
+        */
        request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset,
-                   openpic_ipi_action, SA_INTERRUPT,
+                   openpic_ipi_action, IRQF_DISABLED,
                    "IPI0 (call function)", NULL);
        request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+1,
-                   openpic_ipi_action, SA_INTERRUPT,
+                   openpic_ipi_action, IRQF_DISABLED,
                    "IPI1 (reschedule)", NULL);
        request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+2,
-                   openpic_ipi_action, SA_INTERRUPT,
+                   openpic_ipi_action, IRQF_DISABLED,
                    "IPI2 (invalidate tlb)", NULL);
        request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+3,
-                   openpic_ipi_action, SA_INTERRUPT,
+                   openpic_ipi_action, IRQF_DISABLED,
                    "IPI3 (xmon break)", NULL);
 
        for ( i = 0; i < OPENPIC_NUM_IPI ; i++ )
@@ -692,7 +694,7 @@ openpic_init_nmi_irq(u_int irq)
 
 static struct irqaction openpic_cascade_irqaction = {
        .handler = no_action,
-       .flags = SA_INTERRUPT,
+       .flags = IRQF_DISABLED,
        .mask = CPU_MASK_NONE,
 };
 
index b8154efff6ede2c7a14224a920542b4650488dac..e1ff971539ea9f5f10a7fcc6a84701754c4c3c66 100644 (file)
@@ -10,7 +10,6 @@
  *  register accesses
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index 1509fc1ddfb647558106799f8861d7a998cc2be4..dd5d4b958c31e465320ba3a16f75f2d141cdf9b2 100644 (file)
@@ -8,7 +8,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
 #include <linux/pci.h>
index b40b96a8c609ad341fa1e720aaa0ce161b45819b..1eef4ffed4fb6dc44a8fc487a7e597dd8638bd0f 100644 (file)
@@ -19,7 +19,6 @@
  * 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/miscdevice.h>
index e669c1335d47e93bf46a603e2e9ce1dd098420a3..745685df59849f96d2f902b8cf883ac3c338d06b 100644 (file)
@@ -13,7 +13,6 @@
  * Free Software Foundation;  either version 2 of the  License, or (at your
  * option) any later version.
 */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/signal.h>
index e83a83fd95e1dd93293dce60c59561e39e81aa17..debe14c083a12834b76477b03b2f9c6ace7cae32 100644 (file)
@@ -13,7 +13,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/smp.h>
 #include <linux/threads.h>
index 280ea010a9c8e735714b1541b5c1a646078ea3de..2f83e162971f67be9800f2302ad90b76bf6b255b 100644 (file)
@@ -19,7 +19,6 @@
  * 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/init.h>
index 26afd637dc81806b1147be07e54b2cf9b87a808f..ec466db52114202800a97ba462ad1e75f44bf79e 100644 (file)
@@ -22,7 +22,6 @@
  * Added PCI support -- Tony Li <tony.li@freescale.com>
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/init.h>
index 478b011cd963305bfe85700716e479bfd5133f86..b918a2d245ea0098612834aff5d739fc900dbfcf 100644 (file)
@@ -23,7 +23,6 @@
 #ifndef __PPC_SYSLIB_PPC83XX_SETUP_H
 #define __PPC_SYSLIB_PPC83XX_SETUP_H
 
-#include <linux/config.h>
 #include <linux/init.h>
 
 extern unsigned long mpc83xx_find_end_of_memory(void) __init;
index 0145c968f9adf70777b464b6290cd944af89679b..e5ac699e7316ad1456a38a5be27a10db61a452ea 100644 (file)
@@ -11,7 +11,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/init.h>
index 182744a1321c3d85d80fe00a5f9b942c398a6709..4fc405425113677858b85bbe73ed9025251ffe79 100644 (file)
@@ -14,7 +14,6 @@
 #ifndef __PPC_SYSLIB_PPC85XX_COMMON_H
 #define __PPC_SYSLIB_PPC85XX_COMMON_H
 
-#include <linux/config.h>
 #include <linux/init.h>
 
 /* Provide access to ccsrbar for any modules, etc */
index 297f3b549177096d8f421ab836394fb324968f72..d9b471b4d6954b175b4ff4a6e0b9342b1a014fd3 100644 (file)
@@ -10,7 +10,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/types.h>
index c0827a2c3eeca4d9680d424a99936c771c08dc15..6d3ff30b15790858f02292d03cdc71c2dcb29b55 100644 (file)
@@ -13,7 +13,6 @@
 #ifndef __PPC_SYSLIB_PPC85XX_RIO_H
 #define __PPC_SYSLIB_PPC85XX_RIO_H
 
-#include <linux/config.h>
 #include <linux/init.h>
 
 extern void mpc85xx_rio_setup(int law_start, int law_size);
index 79b7089d7500a5127af9173ab72e6f50b5b76057..2475ec6600fe71a88caa204e724b2e437882846f 100644 (file)
@@ -11,7 +11,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/init.h>
index f55b8032d3d946c117f9f8d3a9684a350e903fc1..6ff79995210bce6fb384e67160c890b14cfdaee5 100644 (file)
@@ -15,7 +15,6 @@
 #ifndef __PPC_SYSLIB_PPC85XX_SETUP_H
 #define __PPC_SYSLIB_PPC85XX_SETUP_H
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <asm/ppcboot.h>
 
index 3e6f51a61d468c79e18f6046f93d6bd7ca4b6f50..d6c25fe25011c7f52f4ce70c2191d20fe8349a1f 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/stddef.h>
 #include <linux/init.h>
index 784935eac36597cfac07efa69643a04ec2736934..d7d9f651a91b8c7c2a3b69dec187b7fa82f178ed 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _PPC_KERNEL_PPC8xx_H
 #define _PPC_KERNEL_PPC8xx_H
 
-#include <linux/config.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
 
index 0970b5d30391553877a031eab1f5e3ec8e790d9d..85053b2816a9dd9a40a394ca5cc7299118f13953 100644 (file)
@@ -15,7 +15,6 @@
  * we have switched the chip select.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
index 93978c027ca05d94870f88b3e9522b5afb630dc8..c492a35687bda0ff9edb5757b2668f187ba24f06 100644 (file)
@@ -1,7 +1,6 @@
 /*
  * Copyright (C) 1996 Paul Mackerras.
  */
-#include <linux/config.h>
 
 #define GETREG(reg)            \
     static inline int get_ ## reg (void)       \
index cfc2d6ad464ddcbdd31a59a59fb024a5a19cd83c..f7e92986952a2e669ae2fff8e5f45d1caf325041 100644 (file)
@@ -1,7 +1,6 @@
 /*
  * Copyright (C) 1996 Paul Mackerras.
  */
-#include <linux/config.h>
 #include <linux/string.h>
 #include <asm/machdep.h>
 #include <asm/io.h>
index 06fa44b5c647130e7beb65514d2573e15016cb02..37d234f93394a3a16bfed9ebeb03d6523b5868a9 100644 (file)
@@ -3,7 +3,6 @@
  *
  * Copyright (C) 1996 Paul Mackerras.
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/smp.h>
index 821a141889deea1f2d8f791591994881eaed68b5..224fbff7996970730bf449ad1d157158deadad54 100644 (file)
@@ -7,6 +7,14 @@ config MMU
        bool
        default y
 
+config LOCKDEP_SUPPORT
+       bool
+       default y
+
+config STACKTRACE_SUPPORT
+       bool
+       default y
+
 config RWSEM_GENERIC_SPINLOCK
        bool
 
index f53b6d5300e579f49fc20942b89f4385712ea3d4..2283933a9a93eef48b2de37aefe944540af03ff4 100644 (file)
@@ -1,5 +1,9 @@
 menu "Kernel hacking"
 
+config TRACE_IRQFLAGS_SUPPORT
+       bool
+       default y
+
 source "lib/Kconfig.debug"
 
 endmenu
index b3791fb094a82e88354d59b571dd9134ca1964a4..74ef57dcfa60b5bb9527d6651440995851aa9ebd 100644 (file)
@@ -34,6 +34,11 @@ cflags-$(CONFIG_MARCH_G5)   += $(call cc-option,-march=g5)
 cflags-$(CONFIG_MARCH_Z900) += $(call cc-option,-march=z900)
 cflags-$(CONFIG_MARCH_Z990) += $(call cc-option,-march=z990)
 
+#
+# Prevent tail-call optimizations, to get clearer backtraces:
+#
+cflags-$(CONFIG_FRAME_POINTER) += -fno-optimize-sibling-calls
+
 # old style option for packed stacks
 ifeq ($(call cc-option-yn,-mkernel-backchain),y)
 cflags-$(CONFIG_PACK_STACK)  += -mkernel-backchain -D__PACK_STACK
index 61bc44626c043ec2bb41c0e61399b2e1127680ae..d0f82c995af680a3c678d68c60094ae91b056348 100644 (file)
@@ -10,7 +10,6 @@
  * Author: Gerald Schaefer <gerald.schaefer@de.ibm.com>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
@@ -766,7 +765,6 @@ unsigned long nr_iowait(void)
 #endif /* MODULE */
 EXPORT_SYMBOL_GPL(si_swapinfo);
 EXPORT_SYMBOL_GPL(nr_threads);
-EXPORT_SYMBOL_GPL(get_full_page_state);
 EXPORT_SYMBOL_GPL(nr_running);
 EXPORT_SYMBOL_GPL(nr_iowait);
 //EXPORT_SYMBOL_GPL(nr_context_switches);
index 7915a197d96d227bb2175ada9125be89399fafa5..ab3b0765a64e7f5d212d835b5e60f4e0ab0e28bb 100644 (file)
@@ -9,7 +9,6 @@
  * Author: Gerald Schaefer <gerald.schaefer@de.ibm.com>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
@@ -107,21 +106,21 @@ static void appldata_get_mem_data(void *data)
         * serialized through the appldata_ops_lock and can use static
         */
        static struct sysinfo val;
-       static struct page_state ps;
+       unsigned long ev[NR_VM_EVENT_ITEMS];
        struct appldata_mem_data *mem_data;
 
        mem_data = data;
        mem_data->sync_count_1++;
 
-       get_full_page_state(&ps);
-       mem_data->pgpgin     = ps.pgpgin >> 1;
-       mem_data->pgpgout    = ps.pgpgout >> 1;
-       mem_data->pswpin     = ps.pswpin;
-       mem_data->pswpout    = ps.pswpout;
-       mem_data->pgalloc    = ps.pgalloc_high + ps.pgalloc_normal +
-                              ps.pgalloc_dma;
-       mem_data->pgfault    = ps.pgfault;
-       mem_data->pgmajfault = ps.pgmajfault;
+       all_vm_events(ev);
+       mem_data->pgpgin     = ev[PGPGIN] >> 1;
+       mem_data->pgpgout    = ev[PGPGOUT] >> 1;
+       mem_data->pswpin     = ev[PSWPIN];
+       mem_data->pswpout    = ev[PSWPOUT];
+       mem_data->pgalloc    = ev[PGALLOC_HIGH] + ev[PGALLOC_NORMAL] +
+                              ev[PGALLOC_DMA];
+       mem_data->pgfault    = ev[PGFAULT];
+       mem_data->pgmajfault = ev[PGMAJFAULT];
 
        si_meminfo(&val);
        mem_data->sharedram = val.sharedram;
@@ -130,7 +129,8 @@ static void appldata_get_mem_data(void *data)
        mem_data->totalhigh = P2K(val.totalhigh);
        mem_data->freehigh  = P2K(val.freehigh);
        mem_data->bufferram = P2K(val.bufferram);
-       mem_data->cached    = P2K(atomic_read(&nr_pagecache) - val.bufferram);
+       mem_data->cached    = P2K(global_page_state(NR_FILE_PAGES)
+                               - val.bufferram);
 
        si_swapinfo(&val);
        mem_data->totalswap = P2K(val.totalswap);
index 39b7bdecbf0563f38046245af32d0258c2054c05..075e619bf37dcdbbadb5bc9048a810c82924dc2d 100644 (file)
@@ -10,7 +10,6 @@
  * Author: Gerald Schaefer <gerald.schaefer@de.ibm.com>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
index f2b44a2f1deca958c9f1840d47407b149a730041..161acc5c8a1b875a05d2ab0d2e97fe38e1dfb1e2 100644 (file)
@@ -9,7 +9,6 @@
  * Author: Gerald Schaefer <gerald.schaefer@de.ibm.com>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
index 9269b5788facaf1ce05d7d5dcdc52b55b83d62c9..eabf00a6f7701a5cab6db9daead73a68c1b567ad 100644 (file)
@@ -21,6 +21,7 @@ obj-$(CONFIG_COMPAT)          += compat_linux.o compat_signal.o \
 obj-$(CONFIG_BINFMT_ELF32)     += binfmt_elf32.o
 
 obj-$(CONFIG_VIRT_TIMER)       += vtime.o
+obj-$(CONFIG_STACKTRACE)       += stacktrace.o
 
 # Kexec part
 S390_KEXEC_OBJS := machine_kexec.o crash.o
index 3f7018e9dbe43e97c0027ea728bc0455791bd79d..ec514fe5ccd02bb3f652ef5c962e4eb5d3ba7ed6 100644 (file)
@@ -4,7 +4,6 @@
  * and format the required data.
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 
 /* Use marker if you need to separate the values later */
index 12a6311e9838901ed2ca106a9e34f778bd33be27..9565a2dcfadcda474a4d5820a2a642d517c56be5 100644 (file)
@@ -135,7 +135,6 @@ static inline int dump_task_fpu(struct task_struct *tsk, elf_fpregset_t *fpregs)
 
 #include <asm/processor.h>
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/elfcore.h>
 #include <linux/binfmts.h>
 #include <linux/compat.h>
index 5e14de37c17b0c26fa2b6ef7d0127a7890c3ea2b..cabb4ff54cd7d85abeba0984167a4514b623bb16 100644 (file)
@@ -16,7 +16,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/fs.h> 
index 3898f66d0b2fb26eb905745acadc9c155a1706b4..1a18e29668ef1758739ae8c799929d8ef8c981d5 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _ASM_S390X_S390_H
 #define _ASM_S390X_S390_H
 
-#include <linux/config.h>
 #include <linux/compat.h>
 #include <linux/socket.h>
 #include <linux/syscalls.h>
index b4c815d8ef75f0e00dc2cf94a599440709f9e584..d49b876a83bf5af6995aae9f0237185f19f42eee 100644 (file)
@@ -10,7 +10,6 @@
  *  1997-11-28  Modified for POSIX.1b signals by Richard Henderson
  */
 
-#include <linux/config.h>
 #include <linux/compat.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
index 06a3fbc12536d8a3dc49386e579db46b1ae1c592..7ba20922a535d848a1de8316676d57cb5a9eb469 100644 (file)
@@ -10,7 +10,6 @@
  *    Bugreports to: <Linux390@de.ibm.com>
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index aa8b52c2140f1e672bed5c4be2715d10140e01f4..5b5799ac8f8397012b81512821419213129e57b5 100644 (file)
@@ -11,7 +11,6 @@
 
 #include <linux/sys.h>
 #include <linux/linkage.h>
-#include <linux/config.h>
 #include <asm/cache.h>
 #include <asm/lowcore.h>
 #include <asm/errno.h>
@@ -59,6 +58,21 @@ STACK_SIZE  = 1 << STACK_SHIFT
 
 #define BASED(name) name-system_call(%r13)
 
+#ifdef CONFIG_TRACE_IRQFLAGS
+       .macro  TRACE_IRQS_ON
+       l       %r1,BASED(.Ltrace_irq_on)
+       basr    %r14,%r1
+       .endm
+
+       .macro  TRACE_IRQS_OFF
+       l       %r1,BASED(.Ltrace_irq_off)
+       basr    %r14,%r1
+       .endm
+#else
+#define TRACE_IRQS_ON
+#define TRACE_IRQS_OFF
+#endif
+
 /*
  * Register usage in interrupt handlers:
  *    R9  - pointer to current task structure
@@ -229,8 +243,9 @@ sysc_do_svc:
 sysc_nr_ok:
        mvc     SP_ARGS(4,%r15),SP_R7(%r15)
 sysc_do_restart:
+       l       %r8,BASED(.Lsysc_table)
        tm      __TI_flags+3(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)
-        l       %r8,sys_call_table-system_call(%r7,%r13) # get system call addr.
+       l       %r8,0(%r7,%r8)    # get system call addr.
         bnz     BASED(sysc_tracesys)
         basr    %r14,%r8          # call sys_xxxx
         st      %r2,SP_R2(%r15)   # store return value (change R2 on stack)
@@ -331,9 +346,10 @@ sysc_tracesys:
        basr    %r14,%r1
        clc     SP_R2(4,%r15),BASED(.Lnr_syscalls)
        bnl     BASED(sysc_tracenogo)
+       l       %r8,BASED(.Lsysc_table)
        l       %r7,SP_R2(%r15)        # strace might have changed the 
        sll     %r7,2                  #  system call
-       l       %r8,sys_call_table-system_call(%r7,%r13)
+       l       %r8,0(%r7,%r8)
 sysc_tracego:
        lm      %r3,%r6,SP_R3(%r15)
        l       %r2,SP_ORIG_R2(%r15)
@@ -360,6 +376,7 @@ ret_from_fork:
        st      %r15,SP_R15(%r15)       # store stack pointer for new kthread
 0:     l       %r1,BASED(.Lschedtail)
        basr    %r14,%r1
+       TRACE_IRQS_ON
         stosm   __SF_EMPTY(%r15),0x03     # reenable interrupts
        b       BASED(sysc_return)
 
@@ -515,6 +532,7 @@ pgm_no_vtime3:
        mvc     __THREAD_per+__PER_address(4,%r1),__LC_PER_ADDRESS
        mvc     __THREAD_per+__PER_access_id(1,%r1),__LC_PER_ACCESS_ID
        oi      __TI_flags+3(%r9),_TIF_SINGLE_STEP # set TIF_SINGLE_STEP
+       TRACE_IRQS_ON
        stosm   __SF_EMPTY(%r15),0x03   # reenable interrupts
        b       BASED(sysc_do_svc)
 
@@ -538,9 +556,11 @@ io_int_handler:
 io_no_vtime:
 #endif
        l       %r9,__LC_THREAD_INFO    # load pointer to thread_info struct
+       TRACE_IRQS_OFF
         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 ?
@@ -650,10 +670,12 @@ ext_int_handler:
 ext_no_vtime:
 #endif
        l       %r9,__LC_THREAD_INFO    # load pointer to thread_info struct
+       TRACE_IRQS_OFF
        la      %r2,SP_PTREGS(%r15)    # address of register-save area
        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:
@@ -730,8 +752,10 @@ mcck_no_vtime:
        stosm   __SF_EMPTY(%r15),0x04   # turn dat on
        tm      __TI_flags+3(%r9),_TIF_MCCK_PENDING
        bno     BASED(mcck_return)
+       TRACE_IRQS_OFF
        l       %r1,BASED(.Ls390_handle_mcck)
        basr    %r14,%r1                # call machine check handler
+       TRACE_IRQS_ON
 mcck_return:
        mvc     __LC_RETURN_MCCK_PSW(8),SP_PSW(%r15) # move return PSW
        ni      __LC_RETURN_MCCK_PSW+1,0xfd # clear wait state bit
@@ -1010,7 +1034,12 @@ cleanup_io_leave_insn:
 .Ltrace:       .long  syscall_trace
 .Lvfork:       .long  sys_vfork
 .Lschedtail:   .long  schedule_tail
-
+.Lsysc_table:  .long  sys_call_table
+#ifdef CONFIG_TRACE_IRQFLAGS
+.Ltrace_irq_on:.long  trace_hardirqs_on
+.Ltrace_irq_off:
+              .long  trace_hardirqs_off
+#endif
 .Lcritical_start:
                .long  __critical_start + 0x80000000
 .Lcritical_end:
@@ -1018,8 +1047,8 @@ cleanup_io_leave_insn:
 .Lcleanup_critical:
                .long  cleanup_critical
 
+              .section .rodata, "a"
 #define SYSCALL(esa,esame,emu) .long esa
 sys_call_table:
 #include "syscalls.S"
 #undef SYSCALL
-
index f3222a1b286174b97ed2141f0007a98b8a5af780..56f5f613b868f6da5d07bb294e2435c2c6c6f3fc 100644 (file)
@@ -11,7 +11,6 @@
 
 #include <linux/sys.h>
 #include <linux/linkage.h>
-#include <linux/config.h>
 #include <asm/cache.h>
 #include <asm/lowcore.h>
 #include <asm/errno.h>
@@ -59,6 +58,19 @@ _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK | _TIF_NEED_RESCHED | \
 
 #define BASED(name) name-system_call(%r13)
 
+#ifdef CONFIG_TRACE_IRQFLAGS
+       .macro  TRACE_IRQS_ON
+        brasl  %r14,trace_hardirqs_on
+       .endm
+
+       .macro  TRACE_IRQS_OFF
+        brasl  %r14,trace_hardirqs_off
+       .endm
+#else
+#define TRACE_IRQS_ON
+#define TRACE_IRQS_OFF
+#endif
+
        .macro  STORE_TIMER lc_offset
 #ifdef CONFIG_VIRT_CPU_ACCOUNTING
        stpt    \lc_offset
@@ -355,6 +367,7 @@ ret_from_fork:
        jo      0f
        stg     %r15,SP_R15(%r15)       # store stack pointer for new kthread
 0:     brasl   %r14,schedule_tail
+       TRACE_IRQS_ON
         stosm   24(%r15),0x03     # reenable interrupts
        j       sysc_return
 
@@ -536,6 +549,7 @@ pgm_no_vtime3:
        mvc     __THREAD_per+__PER_address(8,%r1),__LC_PER_ADDRESS
        mvc     __THREAD_per+__PER_access_id(1,%r1),__LC_PER_ACCESS_ID
        oi      __TI_flags+7(%r9),_TIF_SINGLE_STEP # set TIF_SINGLE_STEP
+       TRACE_IRQS_ON
        stosm   __SF_EMPTY(%r15),0x03   # reenable interrupts
        j       sysc_do_svc
 
@@ -558,8 +572,10 @@ io_int_handler:
 io_no_vtime:
 #endif
        lg      %r9,__LC_THREAD_INFO    # load pointer to thread_info struct
+       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 ?
@@ -666,9 +682,11 @@ ext_int_handler:
 ext_no_vtime:
 #endif
        lg      %r9,__LC_THREAD_INFO    # load pointer to thread_info struct
+       TRACE_IRQS_OFF
        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:
@@ -744,7 +762,9 @@ mcck_no_vtime:
        stosm   __SF_EMPTY(%r15),0x04   # turn dat on
        tm      __TI_flags+7(%r9),_TIF_MCCK_PENDING
        jno     mcck_return
+       TRACE_IRQS_OFF
        brasl   %r14,s390_handle_mcck
+       TRACE_IRQS_ON
 mcck_return:
        mvc     __LC_RETURN_MCCK_PSW(16),SP_PSW(%r15) # move return PSW
        ni      __LC_RETURN_MCCK_PSW+1,0xfd # clear wait state bit
@@ -992,6 +1012,7 @@ cleanup_io_leave_insn:
 .Lcritical_end:
                .quad  __critical_end
 
+              .section .rodata, "a"
 #define SYSCALL(esa,esame,emu) .long esame
 sys_call_table:
 #include "syscalls.S"
index 538c82da49b1b2d614f8aaa1e57b2d864fac2975..adad8863ee2f80f6336add25553ac5166695f48a 100644 (file)
@@ -23,7 +23,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <asm/setup.h>
 #include <asm/lowcore.h>
 #include <asm/asm-offsets.h>
index 480b6a5fef3abbfe52fef7ff787af59539c396df..1eef509186156d060dc48bf6931ae2505b688a21 100644 (file)
@@ -69,10 +69,6 @@ asmlinkage void do_softirq(void)
 
        local_irq_save(flags);
 
-       account_system_vtime(current);
-
-       local_bh_disable();
-
        if (local_softirq_pending()) {
                /* Get current stack pointer. */
                asm volatile("la %0,0(15)" : "=a" (old));
@@ -95,10 +91,6 @@ asmlinkage void do_softirq(void)
                        __do_softirq();
        }
 
-       account_system_vtime(current);
-
-       __local_bh_enable();
-
        local_irq_restore(flags);
 }
 
index 4a0f5a1551eadcf021d6ecf317a1e61e0ef07dea..78c8e5548caf8f4117c99460d3bb8adac27ff91d 100644 (file)
@@ -15,7 +15,6 @@
  * This file handles the architecture-dependent parts of process handling..
  */
 
-#include <linux/config.h>
 #include <linux/compiler.h>
 #include <linux/cpu.h>
 #include <linux/errno.h>
@@ -143,6 +142,7 @@ static void default_idle(void)
                return;
        }
 
+       trace_hardirqs_on();
        /* Wait for external, I/O or machine check interrupt. */
        __load_psw_mask(PSW_KERNEL_BITS | PSW_MASK_WAIT |
                        PSW_MASK_IO | PSW_MASK_EXT);
index 0886e739d12269a121b3a0cdf85f02e4b3c0c7fe..c73a45467fa45f0164a537f2dbb2282660e2570b 100644 (file)
@@ -3,7 +3,6 @@
  *
  *  S390 version
  */
-#include <linux/config.h>
 #include <linux/highuid.h>
 #include <linux/module.h>
 #include <linux/mm.h>
index 2b2551e3510b196c30fe5834b2a18a9d151e52a5..1ca34f54ea8a2419e278825072ba66596efc1618 100644 (file)
@@ -28,7 +28,6 @@
 #include <linux/tty.h>
 #include <linux/ioport.h>
 #include <linux/delay.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/initrd.h>
 #include <linux/bootmem.h>
index d48cfc726b68d9e2fbe3b7968c2283dd476e71de..a887b686f27927bb6119d5cff813388e3c74ac62 100644 (file)
@@ -11,7 +11,6 @@
  *  1997-11-28  Modified for POSIX.1b signals by Richard Henderson
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
diff --git a/arch/s390/kernel/stacktrace.c b/arch/s390/kernel/stacktrace.c
new file mode 100644 (file)
index 0000000..de83f38
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * arch/s390/kernel/stacktrace.c
+ *
+ * Stack trace management functions
+ *
+ *  Copyright (C) IBM Corp. 2006
+ *  Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>
+ */
+
+#include <linux/sched.h>
+#include <linux/stacktrace.h>
+#include <linux/kallsyms.h>
+
+static inline unsigned long save_context_stack(struct stack_trace *trace,
+                                              unsigned int *skip,
+                                              unsigned long sp,
+                                              unsigned long low,
+                                              unsigned long high)
+{
+       struct stack_frame *sf;
+       struct pt_regs *regs;
+       unsigned long addr;
+
+       while(1) {
+               sp &= PSW_ADDR_INSN;
+               if (sp < low || sp > high)
+                       return sp;
+               sf = (struct stack_frame *)sp;
+               while(1) {
+                       addr = sf->gprs[8] & PSW_ADDR_INSN;
+                       if (!(*skip))
+                               trace->entries[trace->nr_entries++] = addr;
+                       else
+                               (*skip)--;
+                       if (trace->nr_entries >= trace->max_entries)
+                               return sp;
+                       low = sp;
+                       sp = sf->back_chain & PSW_ADDR_INSN;
+                       if (!sp)
+                               break;
+                       if (sp <= low || sp > high - sizeof(*sf))
+                               return sp;
+                       sf = (struct stack_frame *)sp;
+               }
+               /* Zero backchain detected, check for interrupt frame. */
+               sp = (unsigned long)(sf + 1);
+               if (sp <= low || sp > high - sizeof(*regs))
+                       return sp;
+               regs = (struct pt_regs *)sp;
+               addr = regs->psw.addr & PSW_ADDR_INSN;
+               if (!(*skip))
+                       trace->entries[trace->nr_entries++] = addr;
+               else
+                       (*skip)--;
+               if (trace->nr_entries >= trace->max_entries)
+                       return sp;
+               low = sp;
+               sp = regs->gprs[15];
+       }
+}
+
+void save_stack_trace(struct stack_trace *trace,
+                     struct task_struct *task, int all_contexts,
+                     unsigned int skip)
+{
+       register unsigned long sp asm ("15");
+       unsigned long orig_sp;
+
+       sp &= PSW_ADDR_INSN;
+       orig_sp = sp;
+
+       sp = save_context_stack(trace, &skip, sp,
+                               S390_lowcore.panic_stack - PAGE_SIZE,
+                               S390_lowcore.panic_stack);
+       if ((sp != orig_sp) && !all_contexts)
+               return;
+       sp = save_context_stack(trace, &skip, sp,
+                               S390_lowcore.async_stack - ASYNC_SIZE,
+                               S390_lowcore.async_stack);
+       if ((sp != orig_sp) && !all_contexts)
+               return;
+       if (task)
+               save_context_stack(trace, &skip, sp,
+                                  (unsigned long) task_stack_page(task),
+                                  (unsigned long) task_stack_page(task) + THREAD_SIZE);
+       else
+               save_context_stack(trace, &skip, sp, S390_lowcore.thread_info,
+                                  S390_lowcore.thread_info + THREAD_SIZE);
+       return;
+}
index 2a6c6efb68653db8880853d09648d86f21af60b9..f7fe9bc43397414f58767132a96c261405f92b16 100644 (file)
@@ -12,7 +12,6 @@
  *    Copyright (C) 1991, 1992, 1995  Linus Torvalds
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/module.h>
 #include <linux/sched.h>
index b7630436f693cda60aa7976b8c3a9b43212ab327..12240c03a6dd5122583ae1ff8d2acfcb176e15ab 100644 (file)
@@ -14,7 +14,6 @@
  * 'Traps.c' handles hardware traps and faults after we have saved some
  * state in 'asm.s'.
  */
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
index 9f34bb54c05129c83327dbd04211ffc83c75b531..ff5f7bb34f75bc68f26a7f54c60167e9bcf3cf9a 100644 (file)
@@ -3,7 +3,6 @@
  */
 
 #include <asm-generic/vmlinux.lds.h>
-#include <linux/config.h>
 
 #ifndef CONFIG_64BIT
 OUTPUT_FORMAT("elf32-s390", "elf32-s390", "elf32-s390")
index 1f0439dc245a9969aad280444e8f6f09137f1922..2306cd83fca125f2f995a482f51ac54297bd6e81 100644 (file)
@@ -7,7 +7,6 @@
  *    Author(s): Jan Glauber <jan.glauber@de.ibm.com>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/time.h>
index 71f0a2fb30786674b601391b3d4ffca1d604256b..468f4ea33f99efdf1f83802ed4433146ac485b57 100644 (file)
@@ -11,7 +11,6 @@
  *    Copyright (C) 1997 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/delay.h>
 
index 648df71403353a50c35afc8fc387a1f01cc6653f..b4957c84e4d66395a7633752079742ae5db77316 100644 (file)
@@ -9,7 +9,6 @@
  *          that does not have the IEEE fpu (all processors before G5).
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
index 51596f429235ba1252008fd9bd0f270305d2a225..81be2fec7dc565b8f3e87518a73fa3e9eddda807 100644 (file)
@@ -8,7 +8,6 @@
  *  Collaborative memory management interface.
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/init.h>
index 81ade401b073bfe62627c9a946de3ac3b04e0483..833d5941746a12fa78f1a83357b1c21c4ff6f24c 100644 (file)
@@ -10,7 +10,6 @@
  *    Copyright (C) 1995  Linus Torvalds
  */
 
-#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index a055894f3bd89a59f4e843c1c113ef5ce80547aa..eb6ebfef134ae8b710def114b33533507e62a673 100644 (file)
@@ -9,7 +9,6 @@
  *    Copyright (C) 1995  Linus Torvalds
  */
 
-#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
@@ -24,6 +23,7 @@
 #include <linux/init.h>
 #include <linux/pagemap.h>
 #include <linux/bootmem.h>
+#include <linux/pfn.h>
 
 #include <asm/processor.h>
 #include <asm/system.h>
@@ -34,6 +34,7 @@
 #include <asm/lowcore.h>
 #include <asm/tlb.h>
 #include <asm/tlbflush.h>
+#include <asm/sections.h>
 
 DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
 
@@ -90,17 +91,6 @@ void show_mem(void)
         printk("%d pages swap cached\n",cached);
 }
 
-/* References to section boundaries */
-
-extern unsigned long _text;
-extern unsigned long _etext;
-extern unsigned long _edata;
-extern unsigned long __bss_start;
-extern unsigned long _end;
-
-extern unsigned long __init_begin;
-extern unsigned long __init_end;
-
 extern unsigned long __initdata zholes_size[];
 /*
  * paging_init() sets up the page tables
@@ -117,6 +107,10 @@ void __init paging_init(void)
         unsigned long pfn = 0;
         unsigned long pgdir_k = (__pa(swapper_pg_dir) & PAGE_MASK) | _KERNSEG_TABLE;
         static const int ssm_mask = 0x04000000L;
+       unsigned long ro_start_pfn, ro_end_pfn;
+
+       ro_start_pfn = PFN_DOWN((unsigned long)&__start_rodata);
+       ro_end_pfn = PFN_UP((unsigned long)&__end_rodata);
 
        /* unmap whole virtual address space */
        
@@ -144,7 +138,10 @@ void __init paging_init(void)
                 pg_dir++;
 
                 for (tmp = 0 ; tmp < PTRS_PER_PTE ; tmp++,pg_table++) {
-                        pte = pfn_pte(pfn, PAGE_KERNEL);
+                       if (pfn >= ro_start_pfn && pfn < ro_end_pfn)
+                               pte = pfn_pte(pfn, __pgprot(_PAGE_RO));
+                       else
+                               pte = pfn_pte(pfn, PAGE_KERNEL);
                         if (pfn >= max_low_pfn)
                                 pte_clear(&init_mm, 0, &pte);
                         set_pte(pg_table, pte);
@@ -176,6 +173,7 @@ void __init paging_init(void)
 }
 
 #else /* CONFIG_64BIT */
+
 void __init paging_init(void)
 {
         pgd_t * pg_dir;
@@ -187,13 +185,15 @@ void __init paging_init(void)
         unsigned long pgdir_k = (__pa(swapper_pg_dir) & PAGE_MASK) |
           _KERN_REGION_TABLE;
        static const int ssm_mask = 0x04000000L;
-
        unsigned long zones_size[MAX_NR_ZONES];
        unsigned long dma_pfn, high_pfn;
+       unsigned long ro_start_pfn, ro_end_pfn;
 
        memset(zones_size, 0, sizeof(zones_size));
        dma_pfn = MAX_DMA_ADDRESS >> PAGE_SHIFT;
        high_pfn = max_low_pfn;
+       ro_start_pfn = PFN_DOWN((unsigned long)&__start_rodata);
+       ro_end_pfn = PFN_UP((unsigned long)&__end_rodata);
 
        if (dma_pfn > high_pfn)
                zones_size[ZONE_DMA] = high_pfn;
@@ -232,7 +232,10 @@ void __init paging_init(void)
                         pmd_populate_kernel(&init_mm, pm_dir, pt_dir);
        
                         for (k = 0 ; k < PTRS_PER_PTE ; k++,pt_dir++) {
-                                pte = pfn_pte(pfn, PAGE_KERNEL);
+                               if (pfn >= ro_start_pfn && pfn < ro_end_pfn)
+                                       pte = pfn_pte(pfn, __pgprot(_PAGE_RO));
+                               else
+                                       pte = pfn_pte(pfn, PAGE_KERNEL);
                                 if (pfn >= max_low_pfn) {
                                         pte_clear(&init_mm, 0, &pte); 
                                         continue;
@@ -283,6 +286,9 @@ void __init mem_init(void)
                 reservedpages << (PAGE_SHIFT-10),
                 datasize >>10,
                 initsize >> 10);
+       printk("Write protected kernel read-only data: %#lx - %#lx\n",
+              (unsigned long)&__start_rodata,
+              PFN_ALIGN((unsigned long)&__end_rodata) - 1);
 }
 
 void free_initmem(void)
index 357fab1bac2ba518eebfc968260b2cd259ec8798..4b2abe5eb165e53664bb290c37b0e5aca2b2a70a 100644 (file)
@@ -13,7 +13,6 @@
  * Each bit of the register is for masking each interrupt.  
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/irq.h>
index a9fde781b21acb8f5c185a5bd1fd881b9fc90efb..6835381da5fd84bb1eccd75bc85c5efa6a16cfa7 100644 (file)
@@ -14,7 +14,6 @@
  * IO functions for a Hitachi Big Sur Evaluation Board.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <asm/machvec.h>
index 1d32425782c00cec5fb8ee72875202d2cd667268..ac946a2201c7077d2e7af1f4e9c9d47da25dc59a 100644 (file)
@@ -20,7 +20,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
index 0a2339c69440ed7bbca3723d4deb9bbf43cf6eee..6b08c0e1c453878d56a0d81704259dcd82ac039a 100644 (file)
@@ -11,7 +11,6 @@
  * This file contains Big Sur specific LED code.
  */
 
-#include <linux/config.h>
 #include <asm/io.h>
 #include <asm/bigsur/bigsur.h>
 
index e69be05195f5a7c765c8a9794f9e2fb663ba0025..dfeede9da50f5129d570b61ee7a1d46d04448160 100644 (file)
@@ -20,7 +20,6 @@
  * 
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
index ae8a350ade53e94ca8e26b442edc47aaca06f815..90e5175df227a81654a2a8bc3ffa244f96eedc8f 100644 (file)
@@ -15,7 +15,6 @@
 #include <asm/io.h>
 #include <asm/machvec.h>
 #include <asm/mach/io.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/sched.h>
index 29b537cd65464c48c19a371f993c278b7fef09bf..eff4ed93599fd726bf76b75fcecbe0ca5763aa22 100644 (file)
@@ -8,7 +8,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/irq.h>
index 701fa55d52978b25cc0f0067700e9fe49e1bdce8..96bb41c9fc55251567f3f3673972384bc7ef92be 100644 (file)
@@ -9,7 +9,6 @@
  * Bases on the IPR irq system
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 
index 76ca4ccac703c8698a3c3f5900b51b7066844a7f..aeb7b392b190bfe3c8371eace07b0a7eb7af65d3 100644 (file)
@@ -9,7 +9,6 @@
  * This file contains ST40STB1 HARP and compatible code.
  */
 
-#include <linux/config.h>
 #include <asm/io.h>
 #include <asm/harp/harp.h>
 
index 05b01b8f40aa39068cf8a9df5865d5d17be793a5..886e450ab63eef99b7cfdbaadae88115dd0bc124 100644 (file)
@@ -9,7 +9,6 @@
  * STMicroelectronics ST40STB1 HARP and compatible support.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <asm/io.h>
index 6d94a8e2e67a0563a228b1d2ba66a73c97674dd5..71f315663cc964fb3c51f4b40963ea015b522b8c 100644 (file)
@@ -9,7 +9,6 @@
  * Setup code for an HP680  (internal peripherials only)
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <asm/io.h>
 #include <asm/hd64461.h>
index 0a31beec3465f5633f42a88bb43806d607be77ce..1fe36927f6919face11deac45acb2f7a6f8e68af 100644 (file)
@@ -6,7 +6,6 @@
  * This file contains Interface MPC-1211 specific LED code.
  */
 
-#include <linux/config.h>
 
 static void mach_led(int position, int value)
 {
index 9f7ccd33ffb603d76e8262af032ca93e87b03911..4ed1a95c6d560d81d09c8b4ff195c2fc84b86b82 100644 (file)
@@ -11,7 +11,6 @@
  *  License.  See linux/COPYING for more information.
  *
  */
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index b72f009c52c26cee58fe5317adb246e83b1ac23d..2bfb221cc35cbfd75890d0ceaae3f9e0a3a7409d 100644 (file)
@@ -5,7 +5,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/hdreg.h>
index 3a1ec9403441eb41b871d8ba8a0c8d322b913016..956c23901228685c6b25191256b410b59326e64e 100644 (file)
@@ -10,7 +10,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
index b055809d2ac1a4459befa360b5d20d4e632db8f1..29e48971bba0316db1dc82c17d9e7202a72fda48 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
index 65f3fd0563d3c01d7639d35130f65566456e6276..4671b6b047bb26b00663b7355fd6cacb7e725bd7 100644 (file)
@@ -8,7 +8,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/delay.h>
 #include <asm/processor.h>
index 2c13a7de6b22ada84a822b199b84cad8af6a4b7b..5d730c70389eab6a26813486cfa0d1055adcf2b3 100644 (file)
@@ -9,7 +9,6 @@
  * Bases on the IPR irq system
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 
index 734742e92279e4c7cee51dd1ae857ba2e84b2e80..860d7f204a4e7b8377cde80a3d7b85f4901c58a7 100644 (file)
@@ -9,7 +9,6 @@
  * This file contains an Overdrive specific LED feature.
  */
 
-#include <linux/config.h>
 #include <asm/system.h>
 #include <asm/io.h>
 #include <asm/overdrive/overdrive.h>
index 94f6165d33b8f64802bbaf4a4e56b4cb3e3c8b98..a3a7744c204796a785eb59f002ccdedd3195f398 100644 (file)
@@ -9,7 +9,6 @@
  * STMicroelectronics Overdrive Support.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <asm/io.h>
index 8b6f0c2af092c504edf84b76d713f76c7032ea34..ba143fa4afaafd99f23ae0120c992778b45c00c3 100644 (file)
@@ -9,7 +9,6 @@
  * board by S. Dunn, 2003.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <asm/machvec.h>
 #include <asm/machvec_init.h>
index 456753d2649ca82db2f90c8cbf5a6b2856f4bd6c..3a1abfa2fefb99917b4df26e990b44acab14b899 100644 (file)
@@ -11,7 +11,6 @@
  * expectation of later SuperIO and PCMCIA access.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <asm/io.h>
index 52a98b524e1fe6263522db00488974dd079046a2..705b7ddcb0d28a4f17dd9197fbd9124238063d2d 100644 (file)
@@ -10,7 +10,6 @@
  * Lineo uSolutions, Inc. 2003.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <asm/io.h>
index 18a13c8da8a4fc039d485be8ba6f0e928d2eb8f6..b6608fff9f384e87f51d1b8f3d36cd6101f2f5cb 100644 (file)
@@ -10,7 +10,6 @@
  * Lineo uSolutions, Inc. 2003.
  */
 
-#include <linux/config.h>
 #include <asm/io.h>
 #include <asm/hs7751rvoip/hs7751rvoip.h>
 
index 8bbed60220ca41ba8f579db0848e4990e4e23cbb..caf967f77c6154fdec086e482e8cf94b7195d53f 100644 (file)
@@ -9,7 +9,6 @@
  * Machine vector for the Renesas Technology sales HS7751RVoIP
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 
 #include <asm/machvec.h>
index 7a442d1eca46861e891a0e832942756b4760c06e..7e5786b581109d38a7e7dfa9c92adb6b8742f123 100644 (file)
@@ -11,7 +11,6 @@
  * PCI initialization for the Renesas SH7751R HS7751RVoIP board
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/init.h>
index f1a78b6c714c6e863531842e8b09530a5b244f07..29fb5ff70fb54fc9f7b19f2ac3612820c7deb925 100644 (file)
@@ -10,7 +10,6 @@
  * Lineo uSolutions, Inc. 2003.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 
index e16915d9cda440a3b6e754c6f90e0075eb608cf1..154535440bbf7a626c76272e6b9c9ed36545c45b 100644 (file)
@@ -9,7 +9,6 @@
  * Atom Create Engineering Co., Ltd. 2002.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <asm/io.h>
index 9993259a894f568291dc2b142adfe931745b148d..4d16de71fac10df3484af2c33cf330f4448c0fa0 100644 (file)
@@ -9,7 +9,6 @@
  * This file contains Renesas Technology Sales RTS7751R2D specific LED code.
  */
 
-#include <linux/config.h>
 #include <asm/io.h>
 #include <asm/rts7751r2d/rts7751r2d.h>
 
index 610740512d56aeb9c967ba24dea4273ae807288c..5ed9e97ea19775c16afc15d591f2832778859815 100644 (file)
@@ -9,7 +9,6 @@
  * Machine vector for the Renesas Technology sales RTS7751R2D
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/types.h>
 
index 845979181059e708cf68d9d902e9b626a1bc1a27..8372d967f60120f249e71c0135578ca36459da04 100644 (file)
@@ -9,7 +9,6 @@
  * Jonathan Short.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 
index 3c89def46480332a3d9990450cea1c09488738f2..f449a94ddffde4822cc037ba5677c78627b106d0 100644 (file)
@@ -8,7 +8,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <asm/mach/se7300.h>
 #include <asm/io.h>
index 96c8c23d6c93390b56177507eb7b2422265fc474..216a78d1a108c26c3ff4ab1cc0b74e7cfd958a00 100644 (file)
@@ -7,7 +7,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <asm/irq.h>
index 02c7f846c84c089c2767b7426bedba38461f7e72..ad51f0a9c1e31999041ac59b5e408679bee4dcba 100644 (file)
@@ -11,7 +11,6 @@
  * This file contains Solution Engine specific LED code.
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <asm/mach/se7300.h>
 
index 08536bc224dc14651f4c3c2e9a23f9dfdd7cc906..ebcd98d4c0818601535bfb52e051004d7579a9e7 100644 (file)
@@ -7,7 +7,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <asm/machvec.h>
 #include <asm/machvec_init.h>
index 73648cbe3678a147ed2cb66cb5ecf53ca2a719ab..755df5ac4a4e81c1d6c12341a60b79ec51a58ead 100644 (file)
@@ -8,7 +8,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <asm/mach/se73180.h>
 #include <asm/io.h>
index 402735c7c89831cec484953cac01a8d3d5f8bb12..4344d0ef24aa05ea8845632e8996bb3d15f570c7 100644 (file)
@@ -10,7 +10,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <asm/irq.h>
index 1e8f1cf3e10f59a87e6c9cbaa24167df9144ce99..610439fde6ee5f3fc6ef7ece6e3be5455a41301f 100644 (file)
@@ -11,7 +11,6 @@
  * This file contains Solution Engine specific LED code.
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <asm/mach/se73180.h>
 
index 07fa90c38a06d04910a2244568ee2a965aac1681..cdb7b5f8d942f7cf1520aa16c7661d95b6a4b142 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <asm/machvec.h>
 #include <asm/machvec_init.h>
index 210897b315f4fa8fe6bbccca72a265e3d14151d6..3e558716ce100fac939c084ecb8285cf382094a4 100644 (file)
@@ -7,7 +7,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <asm/irq.h>
index 5c64e8ab2cfb9b56b981d28285559eb24e62869c..3cddbda025fc28d1cd8b7ee431a49042b30199fd 100644 (file)
@@ -9,7 +9,6 @@
  * This file contains Solution Engine specific LED code.
  */
 
-#include <linux/config.h>
 #include <asm/se/se.h>
 
 static void mach_led(int position, int value)
index f9b4c56cc47ea994377cf514479d887777cc090f..6ec07bd3dcf1f436a7808e59d776345f2f6c5aa4 100644 (file)
@@ -9,7 +9,6 @@
  * Machine vector for the Hitachi SolutionEngine
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 
 #include <asm/machvec.h>
index 2bed46fb607ddff63a1e9a5c250682ea915e54d0..7d1a071727cc57da4ed3bf18c7fc52f4e99c1217 100644 (file)
@@ -8,7 +8,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 
index ad71f3e66c112d89f1c7e5c2b1144661b5ddb166..bf6c023615df87306125654263eca40d0421ff7e 100644 (file)
@@ -9,7 +9,6 @@
  * Ian da Silva and Jeremy Siegel, 2001.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <asm/irq.h>
index 0c788230cf8f3c21ca9036bfae1bb0cef5d8c626..a878726d3c7c8d5019be1d96bbc94cb0d496a20c 100644 (file)
@@ -9,7 +9,6 @@
  * This file contains Solution Engine specific LED code.
  */
 
-#include <linux/config.h>
 #include <asm/se7751/se7751.h>
 
 static void mach_led(int position, int value)
index 16d386b7e3bf9891e14f5f8d5ba927171d906e78..62d8d3e62590567b527fe9f0110123fc95b86b37 100644 (file)
@@ -9,7 +9,6 @@
  * Machine vector for the Hitachi 7751 SolutionEngine
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 
 #include <asm/machvec.h>
index 1f273efd2cf519bdf809f70c876a9d3c9a9999df..3ee03014dea32d9466ad0caf57e19d782524523f 100644 (file)
@@ -11,7 +11,6 @@
  * PCI initialization for the Hitachi SH7751 Solution Engine board (MS7751SE01)
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/init.h>
index 9d111bb884f9566b7ae904e969661f46da76ffdf..48dc5aee67d4d6c6cd4edc3225cd3749cfe29af3 100644 (file)
@@ -9,7 +9,6 @@
  * Ian da Silva and Jeremy Siegel, 2001.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 
index c851b0bec80f1244e4a415b58dede3b18334e73c..d38562ad6be818c876a1dcf40e91c0c1da1a690f 100644 (file)
@@ -6,7 +6,6 @@
  * This file contains Interface CTP/PCI-SH03 specific LED code.
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 
 /* Cycle the LED's in the clasic Knightrider/Sun pattern */
index d2a08ca5eb85a0066b454ebf3951971c7769f766..60290f8f289c49fda70b3f6ee6912b6f6b63ea8a 100644 (file)
@@ -5,7 +5,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/hdreg.h>
index a290b1d09fb29dec319eeaa577d6582f131a91b5..2fe6a11765e9c4eb8a3d188c5b75935de69a27d7 100644 (file)
@@ -7,7 +7,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 
index 08fc98342a0b35550e9ff13b933f6ce7f32514a9..f1f7c70c9402d61384776b0c3ba7927729771d45 100644 (file)
@@ -14,7 +14,6 @@
  */
 /****************************************************************************/
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
@@ -51,7 +50,7 @@ static int __init eraseconfig_init(void)
 {
        printk("SnapGear: EraseConfig init\n");
        /* Setup "EraseConfig" switch on external IRQ 0 */
-       if (request_irq(IRL0_IRQ, eraseconfig_interrupt, SA_INTERRUPT,
+       if (request_irq(IRL0_IRQ, eraseconfig_interrupt, IRQF_DISABLED,
                                "Erase Config", NULL))
                printk("SnapGear: failed to register IRQ%d for Reset witch\n",
                                IRL0_IRQ);
index 1ed7f880b8c722142deb87cbdbb7be501c0caf94..4836b9422e2795c1fd4196661db3f24d6237426c 100644 (file)
@@ -11,7 +11,6 @@
  * License.  See linux/COPYING for more information.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/wait.h>
index cb5999425d163641619ce4b403d10675c40e1b9a..236398fbc0834c00f94021bc7738f8dbacd27b30 100644 (file)
@@ -9,7 +9,6 @@
  * License.  See linux/COPYING for more information.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 
index 52a98e69d3f0a18664649b8b1d392365db19d6a3..a38f5351bd1670a4192e85f27f704357c0da64b2 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <asm/io.h>
 
 #define LED_REGISTER 0xa6104d20
index 892b14d31405f10809f0d8d734b1c09e8923bea6..61b402a3f5d734ac689ea9ac7f68f7bfb2fafc2e 100644 (file)
@@ -11,7 +11,6 @@
  * License.  See linux/COPYING for more information.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/ioport.h>
index 02e84f03f45c09bae860c94ff73b96485be5dc97..c5e4ed10876befa7665a83e0ba5f84bc24b792fa 100644 (file)
@@ -12,7 +12,6 @@
  * method to start debugging a new board during bring-up until proper board
  * setup code is written.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <asm/machvec.h>
 #include <asm/irq.h>
index 88db04d325fb288c9da6ab012908a363a7dfe616..4c26a192277d5b4135a68fc542a4c1499b9669a7 100644 (file)
@@ -7,7 +7,6 @@
 
 .text
 
-#include <linux/config.h>
 #include <linux/linkage.h>
 
        .global startup
index 211e9110074f9cc2d4e15753c52a05d10f3860d6..f2fed5ce5cc315b0dac14a1ffa6f568a77d6b950 100644 (file)
@@ -11,7 +11,6 @@
  * Modified to use standard LinuxSH BIOS by Greg Banks 7Jul2000
  */
 
-#include <linux/config.h>
 #include <asm/uaccess.h>
 #ifdef CONFIG_SH_STANDARD_BIOS
 #include <asm/sh_bios.h>
index 4c062d6b7a9737ffa35be5740976a42a4e777690..ac3062671db7ae122001c862e6d5b94f7469a666 100644 (file)
@@ -4,7 +4,6 @@
  *     Typical I/O routines for HD64461 system.
  */
 
-#include <linux/config.h>
 #include <asm/io.h>
 #include <asm/hd64461/hd64461.h>
 
index 724db04cb3929acf6c53ae8ff343a5964045c10c..ad126016720ff227438c356b0a2398a2564756fe 100644 (file)
@@ -4,7 +4,6 @@
  *     Hitachi HD64461 companion chip support
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -134,7 +133,7 @@ int hd64461_irq_demux(int irq)
        return __irq_demux(irq);
 }
 
-static struct irqaction irq0 = { hd64461_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "HD64461", NULL, NULL };
+static struct irqaction irq0 = { hd64461_interrupt, IRQF_DISABLED, CPU_MASK_NONE, "HD64461", NULL, NULL };
 
 int __init setup_hd64461(void)
 {
index 9785fdef868ec87acb80d6f7d12eaa201dec803d..72320d02d69af015a7996997945ebc93918960d5 100644 (file)
@@ -170,7 +170,7 @@ static int __init hd64465_gpio_init(void)
        if (!request_region(HD64465_REG_GPACR, 0x1000, MODNAME))
                return -EBUSY;
        if (request_irq(HD64465_IRQ_GPIO, hd64465_gpio_interrupt,
-                       SA_INTERRUPT, MODNAME, 0))
+                       IRQF_DISABLED, MODNAME, 0))
                goto out_irqfailed;
 
        printk("HD64465 GPIO layer on irq %d\n", HD64465_IRQ_GPIO);
index 84cb142def0b150f7a463c9dc8f3ac79224b45d1..58704d066ae2d0931049b749aadfe49aed6a748f 100644 (file)
@@ -9,7 +9,6 @@
  * Typical I/O routines for HD64465 system.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <asm/io.h>
index cf9142c620b7fbc7b30916dab36e02482fc2b10a..d2b2851bc44bcf702ba21c35ca282841401b2b02 100644 (file)
@@ -9,7 +9,6 @@
  * Copyright (C) 2000 YAEGASHI Takeshi
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -154,7 +153,7 @@ int hd64465_irq_demux(int irq)
        return irq;
 }
 
-static struct irqaction irq0  = { hd64465_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "HD64465", NULL, NULL};
+static struct irqaction irq0  = { hd64465_interrupt, IRQF_DISABLED, CPU_MASK_NONE, "HD64465", NULL, NULL};
 
 
 static int __init setup_hd64465(void)
index 892214bade194edf67e0387b435ef04b3c792e50..0dc1fb8f9687626a71d6e1905bd52dc049c9e1a3 100644 (file)
@@ -21,7 +21,6 @@
 
 #undef DEBUG
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -166,7 +165,7 @@ int voyagergx_irq_demux(int irq)
 static struct irqaction irq0  = {
        .name           = "voyagergx",
        .handler        = voyagergx_interrupt,
-       .flags          = SA_INTERRUPT,
+       .flags          = IRQF_DISABLED,
        .mask           = CPU_MASK_NONE,
 };
 
index 5afab6f56ec306dbff1491e2c6ac775d5ea2103b..0f866f8789f0de6e4338fab51cb40490290ed055 100644 (file)
@@ -56,7 +56,7 @@ static irqreturn_t g2_dma_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 static struct irqaction g2_dma_irq = {
        .name           = "g2 DMA handler",
        .handler        = g2_dma_interrupt,
-       .flags          = SA_INTERRUPT,
+       .flags          = IRQF_DISABLED,
 };
 
 static int g2_enable_dma(struct dma_channel *chan)
index df604975ccc8967b70621c9e821af19e0fded3a6..30a580aa7cbd04d81f7396616415c1bee24ac91e 100644 (file)
@@ -70,7 +70,7 @@ static int pvr2_xfer_dma(struct dma_channel *chan)
 static struct irqaction pvr2_dma_irq = {
        .name           = "pvr2 DMA handler",
        .handler        = pvr2_dma_interrupt,
-       .flags          = SA_INTERRUPT,
+       .flags          = IRQF_DISABLED,
 };
 
 static struct dma_ops pvr2_dma_ops = {
index cca26c4c9d1b9e42f7052559df07bb1fb5fb9f81..e028a2d2a4eac949d362f1fa7bfec19dc722896d 100644 (file)
@@ -12,7 +12,6 @@
  * for more details.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
@@ -91,7 +90,7 @@ static int sh_dmac_request_dma(struct dma_channel *chan)
                 chan->chan);
 
        return request_irq(get_dmte_irq(chan->chan), dma_tei,
-                          SA_INTERRUPT, name, chan);
+                          IRQF_DISABLED, name, chan);
 }
 
 static void sh_dmac_free_dma(struct dma_channel *chan)
@@ -259,7 +258,7 @@ static int __init sh_dmac_init(void)
 
 #ifdef CONFIG_CPU_SH4
        make_ipr_irq(DMAE_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY);
-       i = request_irq(DMAE_IRQ, dma_err, SA_INTERRUPT, "DMAC Address Error", 0);
+       i = request_irq(DMAE_IRQ, dma_err, IRQF_DISABLED, "DMAC Address Error", 0);
        if (i < 0)
                return i;
 #endif
index e12418bb1fa5ee3f753ee284a3a8cd6410ca4039..6acf02b9375b8622f18e80ea0c53ed613dec4e43 100644 (file)
@@ -15,7 +15,6 @@
  * for more details.
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/param.h>
index cf30e2fa51be0af89c87c56113a4dd90d205a262..63b1c6f4b8d255e71fd787b3cc0a1759bb3f6c98 100644 (file)
@@ -15,7 +15,6 @@
  * for more details.
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/param.h>
index 9b43da67804b1da041abc2ad06fa0dc830b886e4..ae82c6ca05e593932f10d2b5a2ec7dd9a1c81c0c 100644 (file)
@@ -11,7 +11,6 @@
  * PCI initialization for the Hitachi Big Sur Evaluation Board
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/init.h>
index 69af80b93e3f1ca09ba157d112b124951c074fbd..23d52791917e8abc7cc83106eab9ee394806dc22 100644 (file)
@@ -15,7 +15,6 @@
  * for more details.
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/param.h>
index beafa11f4d0c6a92fbced647be625096f0bddf03..83171d10141ac5223d1f991ef2fc3c5091695415 100644 (file)
@@ -11,7 +11,6 @@
  * PCI initialization for the Renesas SH7751R RTS7751R2D board
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/init.h>
index df2199732348e976988638c601e5ad26c6c6e317..e58d556e5f94b0cde1523815f6dacbdff9fdf7d6 100644 (file)
@@ -4,7 +4,6 @@
  * PCI initialization for the Interface CTP/PCI-SH03 board
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/init.h>
index 6fdb9765c99a5faca41c9694dc2b98026d9a0b60..3cbd14dd28fe709a71e0fc7d5655d72cde034147 100644 (file)
@@ -13,7 +13,6 @@
  * PCI initialization for the SnapGear boards
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/init.h>
index 30b14ac7ae5a99a9cfeea525a20f2951f1ce16d1..682f3dae305db3a0aa15c1a1b7804ae67e7c7152 100644 (file)
@@ -15,7 +15,6 @@
 
 #undef DEBUG
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index cb67521311566d867c0a74745da8542078f9e086..7c81b8b65bb505cbcaf58fad69364ee148cbc434 100644 (file)
@@ -7,7 +7,6 @@
  * Support functions for the ST40 PCI hardware.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
@@ -448,7 +447,7 @@ static int __init pcibios_init(void)
                     PHYSADDR(memory_end) - PHYSADDR(memory_start));
 
        if (request_irq(ST40PCI_ERR_IRQ, st40_pci_irq, 
-                        SA_INTERRUPT, "st40pci", NULL)) {
+                        IRQF_DISABLED, "st40pci", NULL)) {
                printk(KERN_ERR "st40pci: Cannot hook interrupt\n");
                return -EIO;
        }
index 7a3b18faa277696ba5a4e3ae7bac22246317ccb0..f1f9ab87f0b0fb3025bd7fe71690a7f0a809c0dd 100644 (file)
@@ -9,7 +9,6 @@
  *  Enable the CF configuration.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 
 #include <asm/io.h>
index 0373b65c77f9c452b9f9d60cb5ad9bf0cf2862be..0f545941fb4fdbcd2444f1a085c36da650108db1 100644 (file)
@@ -15,7 +15,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/module.h>
index 714963a25bbaaa7767ff86ad66adc6791724dcd4..80cd8108d36aca86a86e45da2decc7418b620135 100644 (file)
@@ -10,7 +10,6 @@
  * for more details.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/module.h>
index 966c0858b71494b21f0bc4ddddc44f8d46037d70..cc04e9e239ffb13e7c0b4cea5b362d71a5541829 100644 (file)
@@ -12,7 +12,6 @@
  *
  */
 #include <linux/linkage.h>
-#include <linux/config.h>
 
        .align 2
        .data
index 8221e9d1551574c14a5552036e1a25830ec5356a..26a27df0650509c127f3339cd90a821365ca2b62 100644 (file)
@@ -12,7 +12,6 @@
  *
  */
 #include <linux/linkage.h>
-#include <linux/config.h>
 
        .align 2
        .data
index 83a4f91bce5aefab58cfdbd06e6c27f438ac2161..781dbb11c03894b56e04668a0311a63c99fbb47b 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/slab.h>
 #include <linux/list.h>
 #include <linux/proc_fs.h>
index a440d36ee6187e3557edc577eea2f0c6bc59f60a..7dfd2ba75f7fb9d96fa1dcdfff8c2ce9475ff7ae 100644 (file)
@@ -13,7 +13,6 @@
 
 #include <linux/sys.h>
 #include <linux/linkage.h>
-#include <linux/config.h>
 #include <asm/asm-offsets.h>
 #include <asm/thread_info.h>
 #include <asm/cpu/mmu_context.h>
index 3887b4f6feb26778cb7bc9fc1962993835356ea5..f7eebbde329184808d7a4dfe955fb6756128f582 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
index b0695cffec6ebf96d98c9f77d5d22bb8f49a1938..8221b37c97733872529afec598aea9046940df1d 100644 (file)
@@ -8,7 +8,6 @@
  * Version 2.  See the file COPYING for more details.
  */
 
-#include <linux/config.h>
 #include <linux/linkage.h>
 
 #define PAGE_SIZE      4096 /* must be same value as in <asm/page.h> */
index d5d032533a8b3b1445f70ab6430b5e4deb6e7fa5..245ed8f945e8e705b72b1db956f9a5e40ada2e36 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/smp.h>
 #include <linux/user.h>
index 62c7d1c0ad7bd2a0f1070c731e5f63a4156e8384..6c0fb7c4af1190f40f1fcca3f93b2e15a82fedc9 100644 (file)
@@ -10,7 +10,6 @@
  * Free Software Foundation; either version 2 of the License, or (at your
  * option) any later version.
  */
-#include <linux/config.h>
 #include <linux/cache.h>
 #include <linux/cpumask.h>
 #include <linux/delay.h>
index 314a275c04e0729fc1261441fdcded41962de0c2..a1589f85499dc58323f5785d7848178f18c3b3ea 100644 (file)
@@ -10,7 +10,6 @@
  *    Copyright (C) 1991, 1992, 1995  Linus Torvalds
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
index 96a64cb1310610ed13771570af3e7d95cbe8d0c7..d4212add53b264094c0261d12011bc610bd6d978 100644 (file)
@@ -107,7 +107,7 @@ static irqreturn_t tmu_timer_interrupt(int irq, void *dev_id,
 static struct irqaction tmu_irq = {
        .name           = "timer",
        .handler        = tmu_timer_interrupt,
-       .flags          = SA_INTERRUPT,
+       .flags          = IRQF_DISABLED,
        .mask           = CPU_MASK_NONE,
 };
 
index 7eb06719d844deed72de1c33f3b459cda1286181..d9db1180f770faa264b561a3f20c14e32d1b671b 100644 (file)
@@ -12,7 +12,6 @@
  * 'Traps.c' handles hardware traps and faults after we have saved some
  * state in 'entry.S'.
  */
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
index 51bdc1cf7838326278a97feac819cb17a3dc396b..95fdd9135fcfa54f2f1cb8034ace006a78009036 100644 (file)
@@ -2,7 +2,6 @@
  * ld script to make SuperH Linux kernel
  * Written by Niibe Yutaka
  */
-#include <linux/config.h>
 #include <asm-generic/vmlinux.lds.h>
 
 #ifdef CONFIG_CPU_LITTLE_ENDIAN
index 55f227441f9ed9febb46a8204e6ce986af508966..db6b736537adf9ff7e46f7aa7d69bd8260a83a19 100644 (file)
@@ -8,7 +8,6 @@
  *
  */
 #include <linux/linkage.h>
-#include <linux/config.h>
 
 /*
  * void *memcpy(void *dst, const void *src, size_t n);
index ab833adf28c309f367e245119123ebeceb2f1dc1..524cea5b47f9ca7c93685a1d7bfa2746d49efc07 100644 (file)
@@ -10,7 +10,6 @@
  * for more details.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/mman.h>
 #include <linux/mm.h>
index ae58a61f0e660263014356c524baae0769dd98d3..08acead7b2a1b51070b1f2bf93259bfbd4b55523 100644 (file)
@@ -6,7 +6,6 @@
  * Copyright (C) 2001, 2002  Niibe Yutaka
  *
  */
-#include <linux/config.h>
 #include <linux/linkage.h>
 
 /*
index 505ede7c21bf416f7c4e3cb335ac4f156840ddc1..c1cf4463d09db8f1237a03fb5d614a08ae603621 100644 (file)
@@ -4,7 +4,6 @@
  *   linux/arch/i386/mm/extable.c
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <asm/uaccess.h>
 
index a3568fd51508e4435dfb217f4c6d42089dc7ea0c..2a85bc15a41238ce2d84e5bf891b63b589bd67ae 100644 (file)
@@ -8,7 +8,6 @@
  * Copyright (C) 2002, 2003 David S. Miller (davem@redhat.com)
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/fs.h>
 #include <linux/mm.h>
index 77b4a838fe10f494e9c0896c06479f9abb699721..8ea27ca4b700c1c080cfa3de90d9617f7a0b34a8 100644 (file)
@@ -9,7 +9,6 @@
  *   Copyright (C) 1995  Linus Torvalds
  */
 
-#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index e5907c7330e5c44a85946e4a642cb67f2ddfebd3..c776b60fc25018ebfb0cf75e9976c603b65fdecd 100644 (file)
@@ -6,7 +6,6 @@
  *
  * Released under the terms of the GNU GPL v2.0.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/mman.h>
 #include <linux/mm.h>
index 89dbf45df3c862908c9aa9c16d68236585d0e310..ee7a1b6acb83dbfdaea6a31028de1753c989cca9 100644 (file)
@@ -9,7 +9,6 @@
  * Adapted for SHmedia from sh by Stuart Menefy, May 2002
  */
 
-#include <linux/config.h>
 #include <asm/uaccess.h>
 
 /* cache.c */
index 15a737d9bba8327a76a0779222b6e9e8960b290a..59c2ef4aeda5b96b96f159e2106dd767634f2956 100644 (file)
@@ -4,7 +4,6 @@
  * Modified by Stuart Menefy from arch/sh/vmlinux.lds.S written by Niibe Yutaka
  */
 
-#include <linux/config.h>
 
 #ifdef CONFIG_LITTLE_ENDIAN
 /* OUTPUT_FORMAT("elf32-sh64l-linux", "elf32-sh64l-linux", "elf32-sh64l-linux") */
index 56d6f9f715243c3a3bb0c66374cd5b38666dbf00..9079d1e94f2b53353fdf57566f47ec16865f79b1 100644 (file)
@@ -9,7 +9,6 @@
  * Machine-independent functions for handling 8-digit alphanumeric display
  * (e.g. Agilent HDSP-253x)
  */
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/sched.h>
 
index 09cd9f4670b5b37a2acca4de03f08e0360386a9f..32c6f0549bf1f1523a749d1036e9929526fbef63 100644 (file)
@@ -115,7 +115,7 @@ static irqreturn_t dma_mte(int irq, void *dev_id, struct pt_regs *regs)
 
 static struct irqaction irq_dmte = {
        .handler        = dma_mte,
-       .flags          = SA_INTERRUPT,
+       .flags          = IRQF_DISABLED,
        .name           = "DMA MTE",
 };
 
@@ -152,7 +152,7 @@ static irqreturn_t dma_err(int irq, void *dev_id, struct pt_regs *regs)
 
 static struct irqaction irq_derr = {
        .handler        = dma_err,
-       .flags          = SA_INTERRUPT,
+       .flags          = IRQF_DISABLED,
        .name           = "DMA Error",
 };
 
index 2e2cfe20b4261bf4cbaa2c32f1982e5a5c24b930..40d45346248d6cb651e81928935f5353b907df6b 100644 (file)
@@ -11,7 +11,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sys.h>
 
index cc0b628a9ea7a170e961c9a6bf960d5cd423bff7..f3740ddbc47190fc99ec05c7cfda8a75c25cebca 100644 (file)
@@ -20,7 +20,6 @@
  *    Add early SCIF console DTLB mapping.
  */
 
-#include <linux/config.h>
 
 #include <asm/page.h>
 #include <asm/mmu_context.h>
index 675776a5477e04d5e72dfcda1c02f42d61878d00..e7e07f8749c9907567ff8a83053b45f2577eea61 100644 (file)
@@ -15,7 +15,6 @@
  * Naturally it's not a 1:1 relation, but there are similarities.
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/kernel_stat.h>
 #include <linux/signal.h>
index fa730f5fe2e6e6729ab1b9a2b19ae4c7556ecfc9..42c07d2e71d932cce95538fb1edae1cd30e8b035 100644 (file)
@@ -15,7 +15,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/kernel.h>
index cf993c4a9fdc0f3241af701481e4a2fc031c9bec..e35d3f667fb4e62192676e8cdd3bb0c3685034d7 100644 (file)
@@ -8,7 +8,6 @@
  *
  * Flash the LEDs
  */
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/sched.h>
 
index 6197879e8578e30e7968945e448fec81faf2f66e..9dae689b6a9b0da641a9283c3a7ad749dc9a28d3 100644 (file)
@@ -9,7 +9,6 @@
  * Support functions for the SH5 PCI hardware.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/rwsem.h>
 #include <linux/smp.h>
@@ -474,13 +473,13 @@ static void __init pcibios_size_bridges(void)
 static int __init pcibios_init(void)
 {
         if (request_irq(IRQ_ERR, pcish5_err_irq,
-                        SA_INTERRUPT, "PCI Error",NULL) < 0) {
+                        IRQF_DISABLED, "PCI Error",NULL) < 0) {
                 printk(KERN_ERR "PCISH5: Cannot hook PCI_PERR interrupt\n");
                 return -EINVAL;
         }
 
         if (request_irq(IRQ_SERR, pcish5_serr_irq,
-                        SA_INTERRUPT, "PCI SERR interrupt", NULL) < 0) {
+                        IRQF_DISABLED, "PCI SERR interrupt", NULL) < 0) {
                 printk(KERN_ERR "PCISH5: Cannot hook PCI_SERR interrupt\n");
                 return -EINVAL;
         }
index 1da9c61d6823558b6d63c0cf82340102dc540a23..dba8e14013b6b9c2bc3166a4fcef97511cb78804 100644 (file)
@@ -35,7 +35,6 @@
 #define __KERNEL_SYSCALLS__
 #include <stdarg.h>
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/rwsem.h>
 #include <linux/mm.h>
index cd22e94713165ce9e9335936a78852d68d522658..4e95e18b46d90308fa01093bb27f5aa2c80c9f15 100644 (file)
@@ -17,7 +17,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/rwsem.h>
 #include <linux/sched.h>
index da98d8dbcf95324284de3d601e2364cc1923c896..0359fa647bbcdc988fb793e0638108a4e7f2b00e 100644 (file)
@@ -39,7 +39,6 @@
 #include <linux/tty.h>
 #include <linux/ioport.h>
 #include <linux/delay.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/seq_file.h>
 #include <linux/blkdev.h>
index 6f3a1c946339442301f66de7e5ce78dc19ed5f69..6efdfa2c3994b5f8d7228eb9c4298b7f2a145eab 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/rwsem.h>
 #include <linux/module.h>
 #include <linux/smp.h>
index 6b8f4d22abc69a2b2d49118281cb7f04cdb63e85..b8162e59030e447c6fcc1d12cdb0c59e15ce34e6 100644 (file)
@@ -15,7 +15,6 @@
  *      Copyright (C) 1991, 1992, 1995  Linus Torvalds
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/rwsem.h>
 #include <linux/sched.h>
@@ -485,8 +484,8 @@ static irqreturn_t sh64_rtc_interrupt(int irq, void *dev_id,
        return IRQ_HANDLED;
 }
 
-static struct irqaction irq0  = { timer_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "timer", NULL, NULL};
-static struct irqaction irq1  = { sh64_rtc_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "rtc", NULL, NULL};
+static struct irqaction irq0  = { timer_interrupt, IRQF_DISABLED, CPU_MASK_NONE, "timer", NULL, NULL};
+static struct irqaction irq1  = { sh64_rtc_interrupt, IRQF_DISABLED, CPU_MASK_NONE, "rtc", NULL, NULL};
 
 void __init time_init(void)
 {
index 7d9f7a6339a0716a50f5450151b1576f0121664f..a8fcc3a71585da3dbe4dd2ebc7b111c86f69d742 100644 (file)
@@ -22,7 +22,6 @@
  *    Remove support for ancient toolchains.
  */
 
-#include <linux/config.h>
 #include <asm/page.h>
 #include <asm/cache.h>
 #include <asm/processor.h>
index a82d8f1a7a64562df53bf5512352ac44daf62cf6..53c1cabb3428c1f2487fed18eaafaccbb9a903d1 100644 (file)
@@ -7,7 +7,6 @@
 
 #undef DEBUG
 
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
index 58087331b8a6acd3da88e41f8cb7912635258d64..1326f45f31ebf6ce3300c1c438f5ff85b6112f95 100644 (file)
@@ -8,7 +8,6 @@
 -- Copyright 2004 Richard Curnow (evt_debug etc)
 --
 --------------------------------------------------------------------------*/
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index 277e11b10c2b89dfe0107f7381d04bb68faed8d7..587baa3dffb90c848911e8271161895fe99331e0 100644 (file)
@@ -8,7 +8,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/delay.h>
index 83c5f0c04958c06e84f7fee02452e6c354249552..5cd3d5e9c762196123b0729ae53fab8194974655 100644 (file)
@@ -9,7 +9,6 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  */
-#include <linux/config.h>
 #include <linux/pci.h>
 #include <asm/io.h>
 
index c785d0aa194dbc731f5189541cc156d4cb071106..fba436a92bfa2e7c5e047cd32164f03142743e8a 100644 (file)
@@ -6,7 +6,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <asm/string.h>
 
index dad2f254efeec811ca13da849c65bd4a5e2df964..327653914007b808e1f753b12aa0598a2441aba0 100644 (file)
@@ -10,7 +10,6 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  */
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <asm/param.h>
 
index d6a538c707094c37a137b76048d56c49be305399..2d06e9a551378f60bd5027c51223e228b9597c59 100644 (file)
@@ -9,7 +9,6 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  */
-#include <linux/config.h>
 #include <linux/pci.h>
 #include <asm/io.h>
 #include <asm/cayman.h>
index 05eb7cdc26f0557921231486893d869338974eef..228ce61c3515caf94191fc4542ec9c02e41f6fcf 100644 (file)
@@ -12,7 +12,6 @@
  * Copyright (C) 2002 Stuart Menefy
  */
 
-#include <linux/config.h>
 #include <asm/irq.h>
 #include <asm/page.h>
 #include <asm/io.h>
@@ -45,13 +44,13 @@ static irqreturn_t cayman_interrupt_pci2(int irq, void *dev_id, struct pt_regs *
 static struct irqaction cayman_action_smsc = {
        .name           = "Cayman SMSC Mux",
        .handler        = cayman_interrupt_smsc,
-       .flags          = SA_INTERRUPT,
+       .flags          = IRQF_DISABLED,
 };
 
 static struct irqaction cayman_action_pci2 = {
        .name           = "Cayman PCI2 Mux",
        .handler        = cayman_interrupt_pci2,
-       .flags          = SA_INTERRUPT,
+       .flags          = IRQF_DISABLED,
 };
 
 static void enable_cayman_irq(unsigned int irq)
index c793245629ad722b30323dab8ec8f84a5eec0231..d84895dda3cdddb445bb50e806045c38414c7a3a 100644 (file)
@@ -21,7 +21,6 @@
 
 #include <linux/stddef.h>
 #include <linux/init.h>
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/bootmem.h>
 #include <linux/delay.h>
index 3938a65c4b2532aa46e82b1a35924e4020845406..fcd90afac2975373e98006729766b93eb3c0a6e0 100644 (file)
@@ -20,7 +20,6 @@
 
 #include <linux/stddef.h>
 #include <linux/init.h>
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/bootmem.h>
 #include <linux/delay.h>
index a9ba03fc5beddde6fa49b68c8ae83301b4d38def..eb98a1640cc1f0669518045519e02c994fd78e94 100644 (file)
@@ -23,7 +23,6 @@
 
 #include <linux/stddef.h>
 #include <linux/init.h>
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/bootmem.h>
 #include <linux/delay.h>
index a68639cb4e5a105964dbf70c7d95b64fbaa3afee..f09400c1ad1b4e8b19af701915955162097ccbd3 100644 (file)
@@ -17,7 +17,6 @@
 
 #include <linux/stddef.h>
 #include <linux/init.h>
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/bootmem.h>
 #include <linux/delay.h>
index c0c1b21350d86d4001c4fed500e40a91363e9c02..421487cfff4cb77a30ca570b142f281ac6e51218 100644 (file)
@@ -13,7 +13,6 @@
 
 /****************************************************************************/
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/mman.h>
 #include <linux/mm.h>
index 9da50e28b3fa65971a3398f80fabb0ce8621334a..a2e6e05637729298d7ed2b04d16d6cca135a38b8 100644 (file)
@@ -10,7 +10,6 @@
  *
  * Cloned from the 2.5 SH version..
  */
-#include <linux/config.h>
 #include <linux/rwsem.h>
 #include <linux/module.h>
 #include <asm/uaccess.h>
index 3d89f2a6c785cf70582cac9d231fb4e729e8eb01..187cf01750b80fe43ce2f8f32375b360a16a819f 100644 (file)
@@ -8,7 +8,6 @@
  * Copyright (C) 2002, 2003 David S. Miller (davem@redhat.com)
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/fs.h>
 #include <linux/mm.h>
index 1f55231f07de966b4f88cee63f12e46b5502ca5a..29d7cfd1c970b162adf4a13738c444e7048bd305 100644 (file)
@@ -10,7 +10,6 @@
  * On sparc, thread_info data is static and TI_XXX offsets are computed by hand.
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 // #include <linux/mm.h>
 
index d3b3648362c09c33aee079aa799f5f78921793d1..118f3eca373ea4bb70505a6a29cdb32c39375f26 100644 (file)
@@ -5,7 +5,6 @@
 
 #include <linux/stddef.h>
 #include <linux/init.h>
-#include <linux/config.h>
 #include <linux/spinlock.h>
 #include <asm/oplib.h>
 #include <asm/io.h>
index d7bfc61d28799ed5ae82cee567e71cfee5a9fda7..259a559d4cea120fb2beb13ad808ef1f152056f8 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/smp.h>
index fcb0c049c3feb7e4d4c4be6ae0701d6c16ac760f..adba9dfee35e0954326829c3a9c7f7a3318a2268 100644 (file)
@@ -7,7 +7,6 @@
  * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/threads.h>
 #include <linux/string.h>
index a7a4892956c894f76d136f42bb6709693493dc4a..81c0cbd96ff01f271f888892aa79543ffa417661 100644 (file)
@@ -7,7 +7,6 @@
  * Fixes for different platforms by Pete Zaitcev.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/init.h>
index 887f6a160c589a31c066055965c970922372d62b..a4edff4c3be3a9a661a5e80d9d50ee477db8bd23 100644 (file)
@@ -8,7 +8,6 @@
  * Copyright (C) 1997 Anton Blanchard (anton@progsoc.uts.edu.au)
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 
 #include <asm/head.h>
index 42d3de59d19bfe931566d43dac181c71abb68632..9a219e8b5ddb3edb8f6726764b7cff7cf43a8f86 100644 (file)
@@ -11,7 +11,6 @@
  */
 
 #include <linux/version.h>
-#include <linux/config.h>
 #include <linux/init.h>
 
 #include <asm/head.h>
index 2e1b0f6e99d478f2f20628a9eabdeabc7f5a8b20..3a5bad525394a6ea67df5e59de37f9c2b4976a2c 100644 (file)
@@ -5,7 +5,6 @@
  * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/init.h>
index aac8af5aae51ddcea1a954ee7876b104c2d40576..cde73327ca962b906cee82d0b40c6d1c09f63ecb 100644 (file)
@@ -11,7 +11,6 @@
  *  Copyright (C) 1998-2000 Anton Blanchard (anton@samba.org)
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/ptrace.h>
@@ -192,11 +191,11 @@ int show_interrupts(struct seq_file *p, void *v)
                }
 #endif
                seq_printf(p, " %c %s",
-                       (action->flags & SA_INTERRUPT) ? '+' : ' ',
+                       (action->flags & IRQF_DISABLED) ? '+' : ' ',
                        action->name);
                for (action=action->next; action; action = action->next) {
                        seq_printf(p, ",%s %s",
-                               (action->flags & SA_INTERRUPT) ? " +" : "",
+                               (action->flags & IRQF_DISABLED) ? " +" : "",
                                action->name);
                }
                seq_putc(p, '\n');
@@ -244,7 +243,7 @@ void free_irq(unsigned int irq, void *dev_id)
                        printk("Trying to free free shared IRQ%d\n",irq);
                        goto out_unlock;
                }
-       } else if (action->flags & SA_SHIRQ) {
+       } else if (action->flags & IRQF_SHARED) {
                printk("Trying to free shared IRQ%d with NULL device ID\n", irq);
                goto out_unlock;
        }
@@ -396,9 +395,9 @@ int request_fast_irq(unsigned int irq,
 
        action = sparc_irq[cpu_irq].action;
        if(action) {
-               if(action->flags & SA_SHIRQ)
+               if(action->flags & IRQF_SHARED)
                        panic("Trying to register fast irq when already shared.\n");
-               if(irqflags & SA_SHIRQ)
+               if(irqflags & IRQF_SHARED)
                        panic("Trying to register fast irq as shared.\n");
 
                /* Anyway, someone already owns it so cannot be made fast. */
@@ -498,11 +497,11 @@ int request_irq(unsigned int irq,
        actionp = &sparc_irq[cpu_irq].action;
        action = *actionp;
        if (action) {
-               if (!(action->flags & SA_SHIRQ) || !(irqflags & SA_SHIRQ)) {
+               if (!(action->flags & IRQF_SHARED) || !(irqflags & IRQF_SHARED)) {
                        ret = -EBUSY;
                        goto out_unlock;
                }
-               if ((action->flags & SA_INTERRUPT) != (irqflags & SA_INTERRUPT)) {
+               if ((action->flags & IRQF_DISABLED) != (irqflags & IRQF_DISABLED)) {
                        printk("Attempt to mix fast and slow interrupts on IRQ%d denied\n", irq);
                        ret = -EBUSY;
                        goto out_unlock;
index 5df3ebdc0ab180b3cbffdfa5a3d9cdbebf33439b..bfd31aac2df3b2c7992f082fd08b9f5ba78da4c2 100644 (file)
@@ -10,7 +10,6 @@
  * CP-1200 by Eric Brower.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/init.h>
@@ -746,7 +745,7 @@ void __init pci_time_init(void)
        writel (PCI_COUNTER_IRQ_SET(timer_irq, 0),
                pcic->pcic_regs+PCI_COUNTER_IRQ);
        irq = request_irq(timer_irq, pcic_timer_handler,
-                         (SA_INTERRUPT | SA_STATIC_ALLOC), "timer", NULL);
+                         (IRQF_DISABLED | SA_STATIC_ALLOC), "timer", NULL);
        if (irq) {
                prom_printf("time_init: unable to attach IRQ%d\n", timer_irq);
                prom_halt();
index 118cac84a0f5445ab9a57a831321706946e004c4..89a28cc018c9b0340fc8ec6efda5acf08f1efff4 100644 (file)
@@ -22,7 +22,6 @@
 #include <linux/slab.h>
 #include <linux/user.h>
 #include <linux/a.out.h>
-#include <linux/config.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
 #include <linux/reboot.h>
index 2e5d08ce217b28104dc9e8ce9d49bec867ed5d9d..8606ef4e52e9185d8e943cfb3fd6975011e0fa6b 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/a.out.h>
 #include <linux/tty.h>
 #include <linux/delay.h>
-#include <linux/config.h>
 #include <linux/fs.h>
 #include <linux/seq_file.h>
 #include <linux/syscalls.h>
index 0748d8147bbf670f2ff1bb7f027eb9034091f5f7..c9301b9143cab90d2bd577393b539694be09e4e1 100644 (file)
@@ -7,7 +7,6 @@
  *  Copyright (C) 1997 Eddie C. Dost   (ecd@skynet.be)
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
index fd7deabf998265b49bc662f4545411977445025e..5fb987fc3d63ac4e4aad336ac562ae78fd9e7b32 100644 (file)
@@ -9,7 +9,6 @@
 #define EXPORT_SYMTAB_STROPS
 #define PROMLIB_INTERNAL
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/smp.h>
index 0f2d8d9cbdbaf3d8998b92aeb771ae218fef6d66..4be2c86ea540a5918bc71460f1c49331c2bfb586 100644 (file)
@@ -9,7 +9,6 @@
  *  Copyright (C) 1996 Dave Redman (djhr@tadpole.co.uk)
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/linkage.h>
 #include <linux/kernel_stat.h>
@@ -180,7 +179,7 @@ static void __init sun4c_init_timers(irqreturn_t (*counter_fn)(int, void *, stru
 
        irq = request_irq(TIMER_IRQ,
                          counter_fn,
-                         (SA_INTERRUPT | SA_STATIC_ALLOC),
+                         (IRQF_DISABLED | SA_STATIC_ALLOC),
                          "timer", NULL);
        if (irq) {
                prom_printf("time_init: unable to attach IRQ%d\n",TIMER_IRQ);
index 9c30e35c88f7669bd93a86942243ece4784cd831..74eed9775ac04f32a1d7fba2c387638a5485bacb 100644 (file)
@@ -6,7 +6,6 @@
  *  Heavily based on arch/sparc/kernel/irq.c.
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/linkage.h>
 #include <linux/kernel_stat.h>
@@ -108,13 +107,13 @@ found_it: seq_printf(p, "%3d: ", i);
                               kstat_cpu(cpu_logical_map(x)).irqs[i]);
 #endif
                seq_printf(p, "%c %s",
-                       (action->flags & SA_INTERRUPT) ? '+' : ' ',
+                       (action->flags & IRQF_DISABLED) ? '+' : ' ',
                        action->name);
                action = action->next;
                for (;;) {
                        for (; action; action = action->next) {
                                seq_printf(p, ",%s %s",
-                                       (action->flags & SA_INTERRUPT) ? " +" : "",
+                                       (action->flags & IRQF_DISABLED) ? " +" : "",
                                        action->name);
                        }
                        if (!sbusl) break;
@@ -161,7 +160,7 @@ void sun4d_free_irq(unsigned int irq, void *dev_id)
                        printk("Trying to free free shared IRQ%d\n",irq);
                        goto out_unlock;
                }
-       } else if (action->flags & SA_SHIRQ) {
+       } else if (action->flags & IRQF_SHARED) {
                printk("Trying to free shared IRQ%d with NULL device ID\n", irq);
                goto out_unlock;
        }
@@ -299,13 +298,13 @@ int sun4d_request_irq(unsigned int irq,
        action = *actionp;
        
        if (action) {
-               if ((action->flags & SA_SHIRQ) && (irqflags & SA_SHIRQ)) {
+               if ((action->flags & IRQF_SHARED) && (irqflags & IRQF_SHARED)) {
                        for (tmp = action; tmp->next; tmp = tmp->next);
                } else {
                        ret = -EBUSY;
                        goto out_unlock;
                }
-               if ((action->flags & SA_INTERRUPT) ^ (irqflags & SA_INTERRUPT)) {
+               if ((action->flags & IRQF_DISABLED) ^ (irqflags & IRQF_DISABLED)) {
                        printk("Attempt to mix fast and slow interrupts on IRQ%d denied\n", irq);
                        ret = -EBUSY;
                        goto out_unlock;
@@ -491,7 +490,7 @@ static void __init sun4d_init_timers(irqreturn_t (*counter_fn)(int, void *, stru
 
        irq = request_irq(TIMER_IRQ,
                          counter_fn,
-                         (SA_INTERRUPT | SA_STATIC_ALLOC),
+                         (IRQF_DISABLED | SA_STATIC_ALLOC),
                          "timer", NULL);
        if (irq) {
                prom_printf("time_init: unable to attach IRQ%d\n",TIMER_IRQ);
index a296c13ac18f689fee6e65faa6ad97c2b289c5dd..7cefa301efea61f3f0a84f5d12d074b2fc526a50 100644 (file)
@@ -9,7 +9,6 @@
  *  Copyright (C) 1996 Dave Redman (djhr@tadpole.co.uk)
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/linkage.h>
 #include <linux/kernel_stat.h>
@@ -279,7 +278,7 @@ static void __init sun4m_init_timers(irqreturn_t (*counter_fn)(int, void *, stru
 
        irq = request_irq(TIMER_IRQ,
                          counter_fn,
-                         (SA_INTERRUPT | SA_STATIC_ALLOC),
+                         (IRQF_DISABLED | SA_STATIC_ALLOC),
                          "timer", NULL);
        if (irq) {
                prom_printf("time_init: unable to attach IRQ%d\n",TIMER_IRQ);
index fb7578554c78346a2d49703a9577743f90d878cb..c09afd96dd9c8f95d6fc8771a904e061ee716da2 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx)
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
index 288de276d9ffd49c7e54bb511c7106a3414fc4c8..aa0fb2efb6154241032343e30a748cea59dc5739 100644 (file)
@@ -196,7 +196,7 @@ asmlinkage int sunos_brk(unsigned long brk)
         * simple, it hopefully works in most obvious cases.. Easy to
         * fool it, but this should catch most mistakes.
         */
-       freepages = get_page_cache_size();
+       freepages = global_page_state(NR_FILE_PAGES);
        freepages >>= 1;
        freepages += nr_free_pages();
        freepages += nr_swap_pages;
index 2856551bddf1b7451aab44512f84cd4aae0f7eab..10df38eeae085096535a5e31ed9cbbda9dfa35be 100644 (file)
@@ -9,7 +9,6 @@
  * Copyright (C) 1995 Adrian M. Rodriguez (adrian@remus.rutgers.edu)
  */
 
-#include <linux/config.h>
 
        .data
        .align 4
index 591547af4c656d801cff84635e8e8bb48e372566..d3b4daac705f078420a63343617c1e6c98408d5f 100644 (file)
@@ -74,7 +74,7 @@ void claim_ticker14(irqreturn_t (*handler)(int, void *, struct pt_regs *),
 
        if (!request_irq(irq_nr,
                         handler,
-                        (SA_INTERRUPT | SA_STATIC_ALLOC),
+                        (IRQF_DISABLED | SA_STATIC_ALLOC),
                         "counter14",
                         NULL)) {
                install_linux_ticker();
index 9631e8f4ae60cc669e47b21451dfbf195259ec13..04eb1eab6e3e17f2777045c86a31650900cb999e 100644 (file)
@@ -15,7 +15,6 @@
  * 1997-09-10  Updated NTP code according to technical memorandum Jan '96
  *             "A Kernel Model for Precision Timekeeping" by Dave Mills
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/module.h>
 #include <linux/sched.h>
index 41d45c298fb2426d64a5b293857a4706d880a461..6a70d215fd0432c4e6783505a44370c75bc48e2d 100644 (file)
@@ -9,7 +9,6 @@
  * I hate traps on the sparc, grrr...
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>  /* for jiffies */
 #include <linux/kernel.h>
 #include <linux/kallsyms.h>
index f48ad0c4dadbf368af78ee1fa9e8b4a162535102..178cbb8ae1b9ea9ff1da7598a3dbff4b28efdb54 100644 (file)
@@ -3,7 +3,6 @@
  * Copyright (C) 1996 David S. Miller (davem@caipfs.rutgers.edu)
  */
 
-#include <linux/config.h>
 #include <asm/ptrace.h>
 #include <asm/psr.h>
 
index 3e9399769075f5dd3373f3de02be415fb890b226..cb7fb66a40c82e80aeaff6cedb19d39f5013ab2a 100644 (file)
@@ -3,7 +3,6 @@
  * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
  */
 
-#include <linux/config.h>
 #include <asm/ptrace.h>
 #include <asm/psr.h>
 
index e7578dc600b8c27ffc285bd87c92c81702dab068..20657744c86444904958afde1576161636bfb067 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 1999 Jakub Jelinek (jakub@redhat.com)
  */
 
-#include <linux/config.h>
 #include <asm/ptrace.h>
 #include <asm/psr.h>
 
index f147a44c97808b294ea1b77c7fd6a5c4379b44c6..ec4231c2855a57de8edcfa197f86262754ee968b 100644 (file)
@@ -6,7 +6,6 @@
  * Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <asm/btfixup.h>
index c9845c71f42666c98f91eb630083ff3d01b19b55..16cc28935e398ede97a7e86fff652656bd042d21 100644 (file)
@@ -2,7 +2,6 @@
  * linux/arch/sparc/mm/extable.c
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <asm/uaccess.h>
 
index a231cca37216a84344e9d90bf67f372a53aa6443..d29cc24c5bbab5a7f6a89d61540b7295079e0cc9 100644 (file)
@@ -10,7 +10,6 @@
 #include <asm/asi.h>
 #include <asm/page.h>
 #include <asm/pgtsrmmu.h>
-#include <linux/config.h>
 #include <linux/init.h>
 
        .text
index cfa7d3456634d34b1bda95a706c8c9c60d9bb3b1..c85ddf31274790e6392e9d18ed6ef6c157ab71ef 100644 (file)
@@ -7,7 +7,6 @@
  *  Copyright (C) 2000 Anton Blanchard (anton@samba.org)
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
index eefffa1dc5de137c4fe6da103c419633ca4b0252..42c1c700c0a70b3c7ca86a13c90b22bf0e84fb5f 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 1997,1998 Jakub Jelinek    (jj@sunsite.mff.cuni.cz)
  */
  
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/slab.h>
index 7215849db392e507552ed2c4a499e7c78ef8809b..be042efd1ba4311b6060a92f565f492e6fe04c6d 100644 (file)
@@ -7,7 +7,6 @@
  * Copyright (C) 1997,1998 Jakub Jelinek    (jj@sunsite.mff.cuni.cz)
  */
  
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/mm.h>
index 58c65cc8d0d34545b0c587a19ffcff9ed04ba80d..16e13f663ab08165c4bb27f1aaa71aae21fa9f2c 100644 (file)
@@ -8,7 +8,6 @@
  * Copyright (C) 1999,2000 Anton Blanchard (anton@samba.org)
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/slab.h>
index 49f28c1bdc6d52318d7c4fc0c77c5aa450907907..7fdddf3c7e16308654e761408bd4d4bf3862aa35 100644 (file)
@@ -10,7 +10,6 @@
 
 #define NR_TASK_BUCKETS 512
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/init.h>
index cd90f3fdc4e7a3e1f1bcd7b5bf5b027862ca5d7a..9f4cd396a0faade08dd2f9a7197d11617fcd3fb6 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 1999 David S. Miller (davem@redhat.com)
  */
 
-#include <linux/config.h>
 #include <asm/psr.h>
 #include <asm/asi.h>
 #include <asm/page.h>
index 697af617594ae24851a7a98336afb3240589f938..4988e6a310bbffe0833fd3825246b1e73e8e9695 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
  */
 
-#include <linux/config.h>
 #include <asm/ptrace.h>
 #include <asm/asm-offsets.h>
 #include <asm/psr.h>
index 3cbd6de18dde0bfc3891f4c8303edae287700922..754c622548a5922ff81ffd932fcfe7c7ed43afed 100644 (file)
@@ -6,7 +6,6 @@
  * Copyright (C) 1999  Pavel Semerad  (semerad@ss1000.ms.mff.cuni.cz)
  */
 
-#include <linux/config.h>
 #include <asm/ptrace.h>
 #include <asm/psr.h>
 #include <asm/asm-offsets.h>
index b83409c81916126480999b8352641755df940080..50abfb1b880eba9b29d891a018625f070faa055a 100644 (file)
@@ -6,7 +6,6 @@
  * Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 
index c20e5309f8aa6dd1726f1f6835cb461e7d968be6..b0c0f9c4fc14bc36f4bd67090d2a576a2f5f5bd4 100644 (file)
@@ -6,7 +6,6 @@
  * Copyright (C) 1997 Michael A. Griffith (grif@acm.org)
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 
index c840c206234225baf802f2e4e2a9e2aaeebb5f3f..1942c7c05cb18d350005ea19bcf043136a9f5755 100644 (file)
@@ -5,7 +5,6 @@
  * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index 8a2abcce2737f3aa9a142091329d6fdfc7845faf..a98f3ae175a343e48c88977e83fc2c3f96e04865 100644 (file)
@@ -84,7 +84,6 @@ typedef struct {
 
 #include <asm/processor.h>
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/elfcore.h>
 #include <linux/compat.h>
 
index 11cc0caef592aeccccf0b5fde33decd2a12c5ba8..7eb81d3954d9a96f4cccb078efcd23f38174aacf 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/sched.h>
index 389301c95cb28408269de423d066249acaa7b38d..f8ef2f2b9b375a62375b0237a366a3193c4d2ba2 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/threads.h>
 #include <linux/init.h>
@@ -21,8 +20,6 @@
 #include <asm/spitfire.h>
 #include <asm/timer.h>
 #include <asm/cpudata.h>
-#include <asm/vdev.h>
-#include <asm/irq.h>
 
 /* Used to synchronize acceses to NatSemi SUPER I/O chip configure
  * operations in asm/ns87303.h
@@ -32,100 +29,6 @@ DEFINE_SPINLOCK(ns87303_lock);
 extern void cpu_probe(void);
 extern void central_probe(void);
 
-u32 sun4v_vdev_devhandle;
-struct device_node *sun4v_vdev_root;
-
-struct vdev_intmap {
-       unsigned int phys;
-       unsigned int irq;
-       unsigned int cnode;
-       unsigned int cinterrupt;
-};
-
-struct vdev_intmask {
-       unsigned int phys;
-       unsigned int interrupt;
-       unsigned int __unused;
-};
-
-static struct vdev_intmap *vdev_intmap;
-static int vdev_num_intmap;
-static struct vdev_intmask *vdev_intmask;
-
-static void __init sun4v_virtual_device_probe(void)
-{
-       struct linux_prom64_registers *regs;
-       struct property *prop;
-       struct device_node *dp;
-       int sz;
-
-       if (tlb_type != hypervisor)
-               return;
-
-       dp = of_find_node_by_name(NULL, "virtual-devices");
-       if (!dp) {
-               prom_printf("SUN4V: Fatal error, no virtual-devices node.\n");
-               prom_halt();
-       }
-
-       sun4v_vdev_root = dp;
-
-       prop = of_find_property(dp, "reg", NULL);
-       regs = prop->value;
-       sun4v_vdev_devhandle = (regs[0].phys_addr >> 32UL) & 0x0fffffff;
-
-       prop = of_find_property(dp, "interrupt-map", &sz);
-       vdev_intmap = prop->value;
-       vdev_num_intmap = sz / sizeof(struct vdev_intmap);
-
-       prop = of_find_property(dp, "interrupt-map-mask", NULL);
-       vdev_intmask = prop->value;
-
-       printk("%s: Virtual Device Bus devhandle[%x]\n",
-              dp->full_name, sun4v_vdev_devhandle);
-}
-
-unsigned int sun4v_vdev_device_interrupt(struct device_node *dev_node)
-{
-       struct property *prop;
-       unsigned int irq, reg;
-       int i;
-
-       prop = of_find_property(dev_node, "interrupts", NULL);
-       if (!prop) {
-               printk("VDEV: Cannot get \"interrupts\" "
-                      "property for OBP node %s\n",
-                      dev_node->full_name);
-               return 0;
-       }
-       irq = *(unsigned int *) prop->value;
-
-       prop = of_find_property(dev_node, "reg", NULL);
-       if (!prop) {
-               printk("VDEV: Cannot get \"reg\" "
-                      "property for OBP node %s\n",
-                      dev_node->full_name);
-               return 0;
-       }
-       reg = *(unsigned int *) prop->value;
-
-       for (i = 0; i < vdev_num_intmap; i++) {
-               if (vdev_intmap[i].phys == (reg & vdev_intmask->phys) &&
-                   vdev_intmap[i].irq == (irq & vdev_intmask->interrupt)) {
-                       irq = vdev_intmap[i].cinterrupt;
-                       break;
-               }
-       }
-
-       if (i == vdev_num_intmap) {
-               printk("VDEV: No matching interrupt map entry "
-                      "for OBP node %s\n", dev_node->full_name);
-               return 0;
-       }
-
-       return sun4v_build_irq(sun4v_vdev_devhandle, irq);
-}
-
 static const char *cpu_mid_prop(void)
 {
        if (tlb_type == spitfire)
@@ -290,7 +193,6 @@ void __init device_scan(void)
        }
 #endif
 
-       sun4v_virtual_device_probe();
        central_probe();
 
        cpu_probe();
index aac014d15ad3e6e9030c8050ee63363d38e3767f..8a9b470e1b651883ca6023313295a94775d78566 100644 (file)
@@ -5,7 +5,6 @@
  * Copyright (C) 1999  David S. Miller (davem@redhat.com)
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
@@ -141,7 +140,7 @@ int ebus_dma_irq_enable(struct ebus_dma_info *p, int on)
 
        if (on) {
                if (p->flags & EBUS_DMA_FLAG_USE_EBDMA_HANDLER) {
-                       if (request_irq(p->irq, ebus_dma_irq, SA_SHIRQ, p->name, p))
+                       if (request_irq(p->irq, ebus_dma_irq, IRQF_SHARED, p->name, p))
                                return -EBUSY;
                }
 
index be85ce2a4ad9ebadaf2102bdf961f3a6ba9357f1..0aaa35fc5a9c762f343dc35b4be35f92237d0956 100644 (file)
@@ -7,7 +7,6 @@
  * Copyright (C) 1996,98,99 Jakub Jelinek  (jj@sunsite.mff.cuni.cz)
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 
 #include <asm/head.h>
index 149383835c25381ff082fa47e98fb5d013d23964..4b2bf9eb447a1f5eaa7c93b27627c0c217a9937b 100644 (file)
@@ -5,7 +5,6 @@
  * Copyright (C) 1997, 1998, 1999 Jakub Jelinek (jj@ultra.linux.cz)
  */
 
-#include <linux/config.h>
 
 #include <asm/asi.h>
 #include <asm/pstate.h>
index 31c5892f5acc49669c4326bf5162a42ebceb36ea..75684b56767e099a48556ed95645a1cf35df7942 100644 (file)
@@ -7,7 +7,6 @@
  * Copyright (C) 1997 Miguel de Icaza (miguel@nuclecu.unam.mx)
  */
 
-#include <linux/config.h>
 #include <linux/version.h>
 #include <linux/errno.h>
 #include <linux/threads.h>
index eebe02f3f4cb30a672bb8079ad3fd2dcf86f5aa6..4e64724cb9ae119f2c583bd716d07eee0c5f19ce 100644 (file)
@@ -6,7 +6,6 @@
  * Copyright (C) 1998  Jakub Jelinek    (jj@ultra.linux.cz)
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/ptrace.h>
index 2e1c824c1cc9512356460ea3a09f2fd74c11dfe2..8e75ed762fd80a8555d831c6b324b78282553b6c 100644 (file)
@@ -3,7 +3,6 @@
  * Copyright (C) 2004 David S. Miller <davem@davemloft.net>
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/kprobes.h>
 #include <linux/module.h>
index 31da1e564c95e2ecdbabf13a55a5fda55391d9a4..e492db845ea34c07ee49e1d4dea1011e5fd95886 100644 (file)
@@ -6,7 +6,6 @@
  * Copyright (C) 1996,98,99 Jakub Jelinek  (jj@sunsite.mff.cuni.cz)
  */
 
-#include <linux/config.h>
 #include <asm/head.h>
 #include <asm/asi.h>
 #include <asm/page.h>
index 3670dc8a7d5f2eace36735f87c1a6e181b62207a..169b017eec0b6c393f17096206db914dbff21ac2 100644 (file)
@@ -602,6 +602,9 @@ static void __init build_device_resources(struct of_device *op,
        build_res:
                memset(r, 0, sizeof(*r));
                if (result != OF_BAD_ADDR) {
+                       if (tlb_type == hypervisor)
+                               result &= 0x0fffffffffffffffUL;
+
                        r->start = result;
                        r->end = result + size - 1;
                        r->flags = flags;
index 04ea6c2eb7a13cbaac5dd2c060cdcc5dabffc8c7..e02f01b644af738ae1d19a7c1680fcbef1747964 100644 (file)
@@ -6,7 +6,6 @@
  * Copyright (C) 1999 Jakub Jelinek   (jj@ultra.linux.cz)
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
index bf7b32b3670564f1834c08ec5918454969471c5c..197a7ffd57ee32dc8635644be48e5c71fe02317b 100644 (file)
@@ -863,11 +863,11 @@ static void psycho_register_error_handlers(struct pci_controller_info *p)
        if (op->num_irqs < 6)
                return;
 
-       request_irq(op->irqs[1], psycho_ue_intr, SA_SHIRQ, "PSYCHO UE", p);
-       request_irq(op->irqs[2], psycho_ce_intr, SA_SHIRQ, "PSYCHO CE", p);
-       request_irq(op->irqs[5], psycho_pcierr_intr, SA_SHIRQ,
+       request_irq(op->irqs[1], psycho_ue_intr, IRQF_SHARED, "PSYCHO UE", p);
+       request_irq(op->irqs[2], psycho_ce_intr, IRQF_SHARED, "PSYCHO CE", p);
+       request_irq(op->irqs[5], psycho_pcierr_intr, IRQF_SHARED,
                    "PSYCHO PCIERR-A", &p->pbm_A);
-       request_irq(op->irqs[0], psycho_pcierr_intr, SA_SHIRQ,
+       request_irq(op->irqs[0], psycho_pcierr_intr, IRQF_SHARED,
                    "PSYCHO PCIERR-B", &p->pbm_B);
 
        /* Enable UE and CE interrupts for controller. */
index 5e087b0fb4c90b9db6d9b3d5fdfed67122cd8eda..45891850b90d2def5de925dd801e75724753f80b 100644 (file)
@@ -854,14 +854,14 @@ static void sabre_register_error_handlers(struct pci_controller_info *p)
                     SABRE_UEAFSR_SDRD | SABRE_UEAFSR_SDWR |
                     SABRE_UEAFSR_SDTE | SABRE_UEAFSR_PDTE));
 
-       request_irq(op->irqs[1], sabre_ue_intr, SA_SHIRQ, "SABRE UE", p);
+       request_irq(op->irqs[1], sabre_ue_intr, IRQF_SHARED, "SABRE UE", p);
 
        sabre_write(base + SABRE_CE_AFSR,
                    (SABRE_CEAFSR_PDRD | SABRE_CEAFSR_PDWR |
                     SABRE_CEAFSR_SDRD | SABRE_CEAFSR_SDWR));
 
-       request_irq(op->irqs[2], sabre_ce_intr, SA_SHIRQ, "SABRE CE", p);
-       request_irq(op->irqs[0], sabre_pcierr_intr, SA_SHIRQ,
+       request_irq(op->irqs[2], sabre_ce_intr, IRQF_SHARED, "SABRE CE", p);
+       request_irq(op->irqs[0], sabre_pcierr_intr, IRQF_SHARED,
                    "SABRE PCIERR", p);
 
        tmp = sabre_read(base + SABRE_PCICTRL);
index 5c6e2a9b91f8000e88587e5b29a6bfdbbe030ffc..75ade83ecc651b2cff9222e278ac0986b3e69cac 100644 (file)
@@ -998,32 +998,32 @@ static void tomatillo_register_error_handlers(struct pci_controller_info *p)
        pbm = pbm_for_ino(p, SCHIZO_UE_INO);
        op = of_find_device_by_node(pbm->prom_node);
        if (op)
-               request_irq(op->irqs[1], schizo_ue_intr, SA_SHIRQ,
+               request_irq(op->irqs[1], schizo_ue_intr, IRQF_SHARED,
                            "TOMATILLO_UE", p);
 
        pbm = pbm_for_ino(p, SCHIZO_CE_INO);
        op = of_find_device_by_node(pbm->prom_node);
        if (op)
-               request_irq(op->irqs[2], schizo_ce_intr, SA_SHIRQ,
+               request_irq(op->irqs[2], schizo_ce_intr, IRQF_SHARED,
                            "TOMATILLO CE", p);
 
        pbm = pbm_for_ino(p, SCHIZO_PCIERR_A_INO);
        op = of_find_device_by_node(pbm->prom_node);
        if (op)
-               request_irq(op->irqs[0], schizo_pcierr_intr, SA_SHIRQ,
+               request_irq(op->irqs[0], schizo_pcierr_intr, IRQF_SHARED,
                            "TOMATILLO PCIERR-A", pbm);
 
 
        pbm = pbm_for_ino(p, SCHIZO_PCIERR_B_INO);
        op = of_find_device_by_node(pbm->prom_node);
        if (op)
-               request_irq(op->irqs[0], schizo_pcierr_intr, SA_SHIRQ,
+               request_irq(op->irqs[0], schizo_pcierr_intr, IRQF_SHARED,
                            "TOMATILLO PCIERR-B", pbm);
 
        pbm = pbm_for_ino(p, SCHIZO_SERR_INO);
        op = of_find_device_by_node(pbm->prom_node);
        if (op)
-               request_irq(op->irqs[3], schizo_safarierr_intr, SA_SHIRQ,
+               request_irq(op->irqs[3], schizo_safarierr_intr, IRQF_SHARED,
                            "TOMATILLO SERR", p);
 
        /* Enable UE and CE interrupts for controller. */
@@ -1106,32 +1106,32 @@ static void schizo_register_error_handlers(struct pci_controller_info *p)
        pbm = pbm_for_ino(p, SCHIZO_UE_INO);
        op = of_find_device_by_node(pbm->prom_node);
        if (op)
-               request_irq(op->irqs[1], schizo_ue_intr, SA_SHIRQ,
+               request_irq(op->irqs[1], schizo_ue_intr, IRQF_SHARED,
                            "SCHIZO_UE", p);
 
        pbm = pbm_for_ino(p, SCHIZO_CE_INO);
        op = of_find_device_by_node(pbm->prom_node);
        if (op)
-               request_irq(op->irqs[2], schizo_ce_intr, SA_SHIRQ,
+               request_irq(op->irqs[2], schizo_ce_intr, IRQF_SHARED,
                            "SCHIZO CE", p);
 
        pbm = pbm_for_ino(p, SCHIZO_PCIERR_A_INO);
        op = of_find_device_by_node(pbm->prom_node);
        if (op)
-               request_irq(op->irqs[0], schizo_pcierr_intr, SA_SHIRQ,
+               request_irq(op->irqs[0], schizo_pcierr_intr, IRQF_SHARED,
                            "SCHIZO PCIERR-A", pbm);
 
 
        pbm = pbm_for_ino(p, SCHIZO_PCIERR_B_INO);
        op = of_find_device_by_node(pbm->prom_node);
        if (op)
-               request_irq(op->irqs[0], schizo_pcierr_intr, SA_SHIRQ,
+               request_irq(op->irqs[0], schizo_pcierr_intr, IRQF_SHARED,
                            "SCHIZO PCIERR-B", pbm);
 
        pbm = pbm_for_ino(p, SCHIZO_SERR_INO);
        op = of_find_device_by_node(pbm->prom_node);
        if (op)
-               request_irq(op->irqs[3], schizo_safarierr_intr, SA_SHIRQ,
+               request_irq(op->irqs[3], schizo_safarierr_intr, IRQF_SHARED,
                            "SCHIZO SERR", p);
 
        /* Enable UE and CE interrupts for controller. */
index 4febeda958a3fee5585683b4bb1eddbf7e7a06cb..e55466c77b61efaf0a8c13172e0dc100bcf3a2a1 100644 (file)
@@ -6,7 +6,6 @@
 
 #define __KERNEL_SYSCALLS__
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
index 1c7ca2f712d99004106ba087aa021cd202cae2f7..7d75cd4eb297bb08e016455fdfae71c89385e81e 100644 (file)
@@ -12,7 +12,6 @@
 
 #include <stdarg.h>
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/module.h>
 #include <linux/sched.h>
@@ -26,7 +25,6 @@
 #include <linux/slab.h>
 #include <linux/user.h>
 #include <linux/a.out.h>
-#include <linux/config.h>
 #include <linux/reboot.h>
 #include <linux/delay.h>
 #include <linux/compat.h>
index 8a70c52c0447a92d593e9f6f832db36635e3217e..fa484d4f241e57d6eed4fa8407327efad4ca2b99 100644 (file)
@@ -1008,6 +1008,27 @@ static struct irq_trans pci_irq_trans_table[] = {
 };
 #endif
 
+static unsigned int sun4v_vdev_irq_build(struct device_node *dp,
+                                        unsigned int devino,
+                                        void *_data)
+{
+       u32 devhandle = (u32) (unsigned long) _data;
+
+       return sun4v_build_irq(devhandle, devino);
+}
+
+static void sun4v_vdev_irq_trans_init(struct device_node *dp)
+{
+       struct linux_prom64_registers *regs;
+
+       dp->irq_trans = prom_early_alloc(sizeof(struct of_irq_controller));
+       dp->irq_trans->irq_build = sun4v_vdev_irq_build;
+
+       regs = of_get_property(dp, "reg", NULL);
+       dp->irq_trans->data = (void *) (unsigned long)
+               ((regs->phys_addr >> 32UL) & 0x0fffffff);
+}
+
 static void irq_trans_init(struct device_node *dp)
 {
        const char *model;
@@ -1034,6 +1055,8 @@ static void irq_trans_init(struct device_node *dp)
 #endif
        if (!strcmp(dp->name, "central"))
                return central_irq_trans_init(dp->child);
+       if (!strcmp(dp->name, "virtual-devices"))
+               return sun4v_vdev_irq_trans_init(dp);
 }
 
 static int is_root_node(const struct device_node *dp)
index 7130e866f935849a61cbdc2ac2f74c84f2f7bb58..3522cd66f3bb36e0e1250b4ac7cd9dadebcfb52d 100644 (file)
@@ -5,7 +5,6 @@
  * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
  */
 
-#include <linux/config.h>
 
 #include <asm/asi.h>
 #include <asm/pstate.h>
index ef68aa4fec6524259a525bdca10458fc3c094a6b..c49a57795743bcf3616b07663c2b593532f85d21 100644 (file)
@@ -1065,7 +1065,7 @@ static void __init sysio_register_error_handlers(struct sbus_bus *sbus)
 
        irq = sbus_build_irq(sbus, SYSIO_UE_INO);
        if (request_irq(irq, sysio_ue_handler,
-                       SA_SHIRQ, "SYSIO UE", sbus) < 0) {
+                       IRQF_SHARED, "SYSIO UE", sbus) < 0) {
                prom_printf("SYSIO[%x]: Cannot register UE interrupt.\n",
                            sbus->portid);
                prom_halt();
@@ -1073,7 +1073,7 @@ static void __init sysio_register_error_handlers(struct sbus_bus *sbus)
 
        irq = sbus_build_irq(sbus, SYSIO_CE_INO);
        if (request_irq(irq, sysio_ce_handler,
-                       SA_SHIRQ, "SYSIO CE", sbus) < 0) {
+                       IRQF_SHARED, "SYSIO CE", sbus) < 0) {
                prom_printf("SYSIO[%x]: Cannot register CE interrupt.\n",
                            sbus->portid);
                prom_halt();
@@ -1081,7 +1081,7 @@ static void __init sysio_register_error_handlers(struct sbus_bus *sbus)
 
        irq = sbus_build_irq(sbus, SYSIO_SBUSERR_INO);
        if (request_irq(irq, sysio_sbus_error_handler,
-                       SA_SHIRQ, "SYSIO SBUS Error", sbus) < 0) {
+                       IRQF_SHARED, "SYSIO SBUS Error", sbus) < 0) {
                prom_printf("SYSIO[%x]: Cannot register SBUS Error interrupt.\n",
                            sbus->portid);
                prom_halt();
index 116d9632002defd035dfdae91f0d80767d75d3b6..a73140466e01347acd4cdd10c79a06f09840f284 100644 (file)
@@ -18,7 +18,6 @@
 #include <linux/a.out.h>
 #include <linux/tty.h>
 #include <linux/delay.h>
-#include <linux/config.h>
 #include <linux/fs.h>
 #include <linux/seq_file.h>
 #include <linux/syscalls.h>
index ca11a4c457d4244d0279770ffe08343693cf726d..96d56a8410ad23d9ac85389a63783e65aedbffa8 100644 (file)
@@ -8,7 +8,6 @@
  *  Copyright (C) 1997,1998 Jakub Jelinek   (jj@sunsite.mff.cuni.cz)
  */
 
-#include <linux/config.h>
 #ifdef CONFIG_SPARC32_COMPAT
 #include <linux/compat.h>      /* for compat_old_sigset_t */
 #endif
index 4ac35dd2088bcb05d93b0ea2717adf11c7456064..4173de425f098ff5cefbd25b7cec8b11bd4385d5 100644 (file)
@@ -10,7 +10,6 @@
 #define EXPORT_SYMTAB_STROPS
 #define PROMLIB_INTERNAL
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/string.h>
index bdf1f4d02e3f41844ec4334383cb05f0fe62ac67..c09ab4b9431ddf4c2e1552f2e31b90b1d4302b28 100644 (file)
@@ -6,7 +6,6 @@
  * Copyright (C) 1998 Jakub Jelinek   (jj@ultra.linux.cz)
  */
 
-#include <linux/config.h>
 #include <asm/errno.h>
 
 /* NOTE: call as jump breaks return stack, we have to avoid that */
index 7a869138c37fac9cf34f07418764b5a3c21d0463..51c056df528eb2f1f7a1687bfc8a4e172fa2952a 100644 (file)
@@ -6,7 +6,6 @@
  * platform.
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/sched.h>
index 31030bf00f1a7a5a42fabb8ac1ff31c5292fa1a1..c88ae23ce81230709d491888bdfb6542d7c24705 100644 (file)
@@ -8,7 +8,6 @@
  * environment.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/capability.h>
index ae5b32f817f0e33948ab8a25bb0aa687d77ab1ed..87ebdf858a3a478c1140185e784f5f03964cfe16 100644 (file)
@@ -155,7 +155,7 @@ asmlinkage int sunos_brk(u32 baddr)
         * simple, it hopefully works in most obvious cases.. Easy to
         * fool it, but this should catch most mistakes.
         */
-       freepages = get_page_cache_size();
+       freepages = global_page_state(NR_FILE_PAGES);
        freepages >>= 1;
        freepages += nr_free_pages();
        freepages += nr_swap_pages;
index 1136fc465e37555431f2ebebd927aa32f61e41e3..419a63fca1721d784642465767a1510c0559c98c 100644 (file)
@@ -10,7 +10,6 @@
  * Copyright (C) 1995 Adrian M. Rodriguez (adrian@remus.rutgers.edu)
  */
 
-#include <linux/config.h>
 
        .text
        .align  4
index 5f3dd4d800cd49d7cb87782571af052ff0bb7a3e..8dcbfbffacc9a181321609656098e7435f7165b8 100644 (file)
@@ -9,7 +9,6 @@
  * Copyright (C) 1996 Thomas K. Dyas (tdyas@eden.rutgers.edu)
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/module.h>
 #include <linux/sched.h>
index 1ff34b019f3f0bb8478150aeb60186d1e55be03a..68420e2dad0eb2c28857ce854563165fe62570fc 100644 (file)
@@ -9,7 +9,6 @@
  * I like traps on v9, :))))
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>  /* for jiffies */
 #include <linux/kernel.h>
index a0c8ba58920bdcc09ae502848bb515ed691b2191..eedf94fa5664075b3443bf8b990094294de9bee8 100644 (file)
@@ -3,7 +3,6 @@
  * Copyright (C) 2006 David S. Miller <davem@davemloft.net>
  */
 
-#include <linux/config.h>
 
 #include <asm/tsb.h>
 #include <asm/hypervisor.h>
index ee45ca2d7a04da5b8fb6a4cd21c1c0413f4e4a46..d7d2a8bdc66ef8750cce0e85f5e386a386f3d7df 100644 (file)
@@ -3,7 +3,6 @@
  * Copyright (C) 1996, 2001, 2006 David S. Miller (davem@davemloft.net)
  */
 
-#include <linux/config.h>
 
        .globl  sparc64_ttable_tl0, sparc64_ttable_tl1
        .globl  tl0_icpe, tl1_icpe
index faf87c31598bc30f44a42d5a76079db4322096a7..9633750167d06b3e9f4d285e105656d01a8ce32f 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 1999 David S. Miller (davem@redhat.com)
  */
 
-#include <linux/config.h>
 #include <asm/asi.h>
 
        .text
index 31afbfe6c1e86864242f7e5bc75f5902a4da4387..892431a821311f639e9a18aec4a70c702bd4c726 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 2000 David S. Miller (davem@redhat.com)
  */
 
-#include <linux/config.h>
 #include <asm/asi.h>
 
        .text
index 2ef2e268bdcfdf5ee9dfadca2f677a7aa44df758..9e4534b485c7a578af04517adff245a413f7bfb9 100644 (file)
@@ -5,7 +5,6 @@
  * This can also be tweaked for kernel stack overflow detection.
  */
 
-#include <linux/config.h>
 #include <linux/linkage.h>
 
 #include <asm/ptrace.h>
index fbbbebbad8a49219674c119551f07a85b594bd9e..53b9b1f528e54ae75d9caeb90e3fa7bd90b67c8a 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 2002, 2003, 2006 David S. Miller (davem@davemloft.net)
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/fs.h>
index cb75a27adb517bba8b2d43289b0cb8e1a64ef81d..dcba4e6ab5702d675365c5ec56a77866ddad4dde 100644 (file)
@@ -5,7 +5,6 @@
  *  Copyright (C) 1997-1999 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
  */
  
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index f8479fad4047de364454bf26ceb85bd18c9e6f78..d70b60a3bbccb5340cf517dcf64657eba1927456 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 1997, 2000 David S. Miller (davem@redhat.com)
  */
 
-#include <linux/config.h>
 #include <asm/asi.h>
 #include <asm/pgtable.h>
 #include <asm/page.h>
index 577bde8b664766703bd7fab1ff7f93a4a645d169..0b4213720d439167e3ba7f59ab5b78849df072d3 100644 (file)
@@ -6,7 +6,6 @@
  * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index 719c90905a1e80030605f15481d2b5536be84966..8135ec322c9c02dc71f071ba6db6c97900d35c05 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
  */
 
-#include <linux/config.h>
 #include <linux/module.h> 
 #include <linux/types.h>
 #include <linux/smp_lock.h>
index dfd88b652fbe5ee638e81ffee241de18e4a6a90e..dffd1184c956cca4314eb4c1127f30cbaf373185 100644 (file)
@@ -6,9 +6,11 @@ START := 0x60000000
 
 #We #undef __x86_64__ for kernelspace, not for userspace where
 #it's needed for headers to work!
-CFLAGS += -U__$(SUBARCH)__ -fno-builtin
-USER_CFLAGS += -fno-builtin
+CFLAGS += -U__$(SUBARCH)__ -fno-builtin -m64
+USER_CFLAGS += -fno-builtin -m64
 CHECKFLAGS  += -m64
+AFLAGS += -m64
+LDFLAGS += -m elf_x86_64
 
 ELF_ARCH := i386:x86-64
 ELF_FORMAT := elf64-x86-64
@@ -16,3 +18,4 @@ ELF_FORMAT := elf64-x86-64
 # Not on all 64-bit distros /lib is a symlink to /lib64. PLD is an example.
 
 LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib64
+LINK-y += -m64
index d18a974735e649ed25f95159ef19ce274d59d408..64ff22aa077bdb3686fe33e655914630af45dd44 100644 (file)
@@ -35,7 +35,6 @@
  */
  
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/fs.h>
index 5ca57ca337136034799e3dad4df7d733802dc4bc..ebebaabb78ad75150ff818cd092f7c918b3fe7dd 100644 (file)
@@ -373,7 +373,7 @@ static irqreturn_t line_write_interrupt(int irq, void *data,
        int err;
 
        /* Interrupts are enabled here because we registered the interrupt with
-        * SA_INTERRUPT (see line_setup_irq).*/
+        * IRQF_DISABLED (see line_setup_irq).*/
 
        spin_lock_irq(&line->lock);
        err = flush_buffer(line);
@@ -406,7 +406,7 @@ static irqreturn_t line_write_interrupt(int irq, void *data,
 int line_setup_irq(int fd, int input, int output, struct line *line, void *data)
 {
        struct line_driver *driver = line->driver;
-       int err = 0, flags = SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM;
+       int err = 0, flags = IRQF_DISABLED | IRQF_SHARED | IRQF_SAMPLE_RANDOM;
 
        if (input)
                err = um_request_irq(driver->read_irq, fd, IRQ_READ,
@@ -767,7 +767,7 @@ void register_winch_irq(int fd, int tty_fd, int pid, struct tty_struct *tty)
        spin_unlock(&winch_handler_lock);
 
        if(um_request_irq(WINCH_IRQ, fd, IRQ_READ, winch_interrupt,
-                         SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM,
+                         IRQF_DISABLED | IRQF_SHARED | IRQF_SAMPLE_RANDOM,
                          "winch", winch) < 0)
                printk("register_winch_irq - failed to register IRQ\n");
 }
index 79149314ed04f9f11418a631dc4628a5f77e95fd..b414522f7686cadff6f4f0752c100bed57d8144a 100644 (file)
@@ -777,7 +777,7 @@ static int mconsole_init(void)
        register_reboot_notifier(&reboot_notifier);
 
        err = um_request_irq(MCONSOLE_IRQ, sock, IRQ_READ, mconsole_interrupt,
-                            SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM,
+                            IRQF_DISABLED | IRQF_SHARED | IRQF_SAMPLE_RANDOM,
                             "mconsole", (void *)sock);
        if (err){
                printk("Failed to get IRQ for management console\n");
index 8c7279bb353bc52848b4e930000af5cd98376b7e..501f95675d890ed268b52d335dd09e4ea7fda1c4 100644 (file)
@@ -128,7 +128,7 @@ static int uml_net_open(struct net_device *dev)
        }
 
        err = um_request_irq(dev->irq, lp->fd, IRQ_READ, uml_net_interrupt,
-                            SA_INTERRUPT | SA_SHIRQ, dev->name, dev);
+                            IRQF_DISABLED | IRQF_SHARED, dev->name, dev);
        if(err != 0){
                printk(KERN_ERR "uml_net_open: failed to get irq(%d)\n", err);
                err = -ENETUNREACH;
index 189839e4f1d4eae532241945c8bbe70b2d9aa989..73755f37a8a8409df2c43f0825ababd61a15c08d 100644 (file)
@@ -105,7 +105,7 @@ static int port_accept(struct port_list *port)
                  .port         = port });
 
        if(um_request_irq(TELNETD_IRQ, socket[0], IRQ_READ, pipe_interrupt, 
-                         SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM, 
+                         IRQF_DISABLED | IRQF_SHARED | IRQF_SAMPLE_RANDOM,
                          "telnetd", conn)){
                printk(KERN_ERR "port_accept : failed to get IRQ for "
                       "telnetd\n");
@@ -186,7 +186,7 @@ void *port_data(int port_num)
                goto out_free;
        }
        if(um_request_irq(ACCEPT_IRQ, fd, IRQ_READ, port_interrupt, 
-                         SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM, "port",
+                         IRQF_DISABLED | IRQF_SHARED | IRQF_SAMPLE_RANDOM, "port",
                          port)){
                printk(KERN_ERR "Failed to get IRQ for port %d\n", port_num);
                goto out_close;
index 429ae8e6c7e514f67fac718d9912828dec7e7768..6d2cf32a9e8f880eeaf7439e874ef4640f3ec7dc 100644 (file)
@@ -8,10 +8,7 @@
 
 /*
  * Don't register by default -- as this registeres very early in the
- * boot process it becomes the default console.  And as this isn't a
- * real tty driver init isn't able to open /dev/console then.
- *
- * In most cases this isn't what you want ...
+ * boot process it becomes the default console.
  */
 static int use_stderr_console = 0;
 
@@ -43,3 +40,20 @@ static int stderr_setup(char *str)
        return 1;
 }
 __setup("stderr=", stderr_setup);
+
+/* The previous behavior of not unregistering led to /dev/console being
+ * impossible to open.  My FC5 filesystem started having init die, and the
+ * system panicing because of this.  Unregistering causes the real
+ * console to become the default console, and /dev/console can then be
+ * opened.  Making this an initcall makes this happen late enough that
+ * there is no added value in dumping everything to stderr, and the
+ * normal console is good enough to show you all available output.
+ */
+static int __init unregister_stderr(void)
+{
+       unregister_console(&stderr_console);
+
+       return 0;
+}
+
+__initcall(unregister_stderr);
index 0345e255124798d3f26965a327b6e44ce701fa0a..602d7286b9e0e90c997d6b7065f96f41e754cfcc 100644 (file)
@@ -874,7 +874,7 @@ int ubd_driver_init(void){
                return(0);
        }
        err = um_request_irq(UBD_IRQ, thread_fd, IRQ_READ, ubd_intr,
-                            SA_INTERRUPT, "ubd", ubd_dev);
+                            IRQF_DISABLED, "ubd", ubd_dev);
        if(err != 0)
                printk(KERN_ERR "um_request_irq failed - errno = %d\n", -err);
        return 0;
index d269a80f4b0c665b70ef6f32422a53474efcb7af..6036ec85895aef434ca1bb615945aa268f528405 100644 (file)
@@ -54,7 +54,7 @@ int xterm_fd(int socket, int *pid_out)
        init_completion(&data->ready);
 
        err = um_request_irq(XTERM_IRQ, socket, IRQ_READ, xterm_interrupt, 
-                            SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM, 
+                            IRQF_DISABLED | IRQF_SHARED | IRQF_SAMPLE_RANDOM,
                             "xterm", data);
        if (err){
                printk(KERN_ERR "xterm_fd : failed to get IRQ for xterm, "
index 939cc475757a583e7b38977f02c6f095de004465..91d129fb39308cc57771ca71d2465ecc1a07553d 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/sched.h>
 #include <linux/time.h>
index fae43a3054a0bec3c00782e70e66926186a28e8c..bfd0bdc8cd407e2b7502425cfb73072130f63ad7 100644 (file)
@@ -474,7 +474,7 @@ int init_aio_irq(int irq, char *name, irqreturn_t (*handler)(int, void *,
        }
 
        err = um_request_irq(irq, fds[0], IRQ_READ, handler,
-                            SA_INTERRUPT | SA_SAMPLE_RANDOM, name,
+                            IRQF_DISABLED | IRQF_SAMPLE_RANDOM, name,
                             (void *) (long) fds[0]);
        if (err) {
                printk("init_aio_irq - : um_request_irq failed, err = %d\n",
index 1c1300fb1e959b5dd44192740e52c34e31e99bd6..51b67708394850c5da94b29c0df6fe1802fa1d91 100644 (file)
@@ -31,7 +31,7 @@ int write_sigio_irq(int fd)
        int err;
 
        err = um_request_irq(SIGIO_WRITE_IRQ, fd, IRQ_READ, sigio_interrupt,
-                            SA_INTERRUPT | SA_SAMPLE_RANDOM, "write sigio",
+                            IRQF_DISABLED | IRQF_SAMPLE_RANDOM, "write sigio",
                             NULL);
        if(err){
                printk("write_sigio_irq : um_request_irq failed, err = %d\n",
index c5c9885a82979f70c2a66a1753ef683a0114b932..624ca238d1fd3d753f261c0bb368128570976a96 100644 (file)
@@ -152,7 +152,7 @@ void destroy_context_skas(struct mm_struct *mm)
                free_page(mmu->id.stack);
                pte_lock_deinit(virt_to_page(mmu->last_page_table));
                pte_free_kernel((pte_t *) mmu->last_page_table);
-                dec_page_state(nr_page_table_pages);
+               dec_zone_page_state(virt_to_page(mmu->last_page_table), NR_PAGETABLE);
 #ifdef CONFIG_3_LEVEL_PGTABLES
                pmd_free((pmd_t *) mmu->last_pmd);
 #endif
index 5992c3257167443a0ec57d2be3093a02d9af412e..8912cec0fe43380cb6761e088099c04dccd1bfaf 100644 (file)
@@ -8,6 +8,7 @@
 #include "linux/kernel.h"
 #include "linux/string.h"
 #include "linux/fs.h"
+#include "linux/hardirq.h"
 #include "linux/highmem.h"
 #include "asm/page.h"
 #include "asm/pgtable.h"
@@ -38,7 +39,7 @@ static unsigned long maybe_map(unsigned long virt, int is_write)
        return((unsigned long) phys);
 }
 
-static int do_op(unsigned long addr, int len, int is_write,
+static int do_op_one_page(unsigned long addr, int len, int is_write,
                 int (*op)(unsigned long addr, int len, void *arg), void *arg)
 {
        struct page *page;
@@ -49,9 +50,11 @@ static int do_op(unsigned long addr, int len, int is_write,
                return(-1);
 
        page = phys_to_page(addr);
-       addr = (unsigned long) kmap(page) + (addr & ~PAGE_MASK);
+       addr = (unsigned long) kmap_atomic(page, KM_UML_USERCOPY) + (addr & ~PAGE_MASK);
+
        n = (*op)(addr, len, arg);
-       kunmap(page);
+
+       kunmap_atomic(page, KM_UML_USERCOPY);
 
        return(n);
 }
@@ -77,7 +80,7 @@ static void do_buffer_op(void *jmpbuf, void *arg_ptr)
        remain = len;
 
        current->thread.fault_catcher = jmpbuf;
-       n = do_op(addr, size, is_write, op, arg);
+       n = do_op_one_page(addr, size, is_write, op, arg);
        if(n != 0){
                *res = (n < 0 ? remain : 0);
                goto out;
@@ -91,7 +94,7 @@ static void do_buffer_op(void *jmpbuf, void *arg_ptr)
        }
 
        while(addr < ((addr + remain) & PAGE_MASK)){
-               n = do_op(addr, PAGE_SIZE, is_write, op, arg);
+               n = do_op_one_page(addr, PAGE_SIZE, is_write, op, arg);
                if(n != 0){
                        *res = (n < 0 ? remain : 0);
                        goto out;
@@ -105,7 +108,7 @@ static void do_buffer_op(void *jmpbuf, void *arg_ptr)
                goto out;
        }
 
-       n = do_op(addr, remain, is_write, op, arg);
+       n = do_op_one_page(addr, remain, is_write, op, arg);
        if(n != 0)
                *res = (n < 0 ? remain : 0);
        else *res = 0;
diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c
deleted file mode 100644 (file)
index 8fa2ae7..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
-/* 
- * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com)
- * Licensed under the GPL
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <time.h>
-#include <sys/time.h>
-#include <signal.h>
-#include <errno.h>
-#include "user_util.h"
-#include "kern_util.h"
-#include "user.h"
-#include "process.h"
-#include "time_user.h"
-#include "kern_constants.h"
-#include "os.h"
-
-/* XXX This really needs to be declared and initialized in a kernel file since
- * it's in <linux/time.h>
- */
-extern struct timespec wall_to_monotonic;
-
-extern struct timeval xtime;
-
-struct timeval local_offset = { 0, 0 };
-
-void timer(void)
-{
-       gettimeofday(&xtime, NULL);
-       timeradd(&xtime, &local_offset, &xtime);
-}
-
-static void set_interval(int timer_type)
-{
-       int usec = 1000000/hz();
-       struct itimerval interval = ((struct itimerval) { { 0, usec },
-                                                         { 0, usec } });
-
-       if(setitimer(timer_type, &interval, NULL) == -1)
-               panic("setitimer failed - errno = %d\n", errno);
-}
-
-void enable_timer(void)
-{
-       set_interval(ITIMER_VIRTUAL);
-}
-
-void prepare_timer(void * ptr)
-{
-       int usec = 1000000/hz();
-       *(struct itimerval *)ptr = ((struct itimerval) { { 0, usec },
-                                                        { 0, usec }});
-}
-
-void disable_timer(void)
-{
-       struct itimerval disable = ((struct itimerval) { { 0, 0 }, { 0, 0 }});
-       if((setitimer(ITIMER_VIRTUAL, &disable, NULL) < 0) ||
-          (setitimer(ITIMER_REAL, &disable, NULL) < 0))
-               printk("disnable_timer - setitimer failed, errno = %d\n",
-                      errno);
-       /* If there are signals already queued, after unblocking ignore them */
-       set_handler(SIGALRM, SIG_IGN, 0, -1);
-       set_handler(SIGVTALRM, SIG_IGN, 0, -1);
-}
-
-void switch_timers(int to_real)
-{
-       struct itimerval disable = ((struct itimerval) { { 0, 0 }, { 0, 0 }});
-       struct itimerval enable = ((struct itimerval) { { 0, 1000000/hz() },
-                                                       { 0, 1000000/hz() }});
-       int old, new;
-
-       if(to_real){
-               old = ITIMER_VIRTUAL;
-               new = ITIMER_REAL;
-       }
-       else {
-               old = ITIMER_REAL;
-               new = ITIMER_VIRTUAL;
-       }
-
-       if((setitimer(old, &disable, NULL) < 0) ||
-          (setitimer(new, &enable, NULL)))
-               printk("switch_timers - setitimer failed, errno = %d\n",
-                      errno);
-}
-
-void uml_idle_timer(void)
-{
-       if(signal(SIGVTALRM, SIG_IGN) == SIG_ERR)
-               panic("Couldn't unset SIGVTALRM handler");
-       
-       set_handler(SIGALRM, (__sighandler_t) alarm_handler, 
-                   SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, SIGVTALRM, -1);
-       set_interval(ITIMER_REAL);
-}
-
-extern void ktime_get_ts(struct timespec *ts);
-#define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts)
-
-void time_init(void)
-{
-       struct timespec now;
-
-       if(signal(SIGVTALRM, boot_timer_handler) == SIG_ERR)
-               panic("Couldn't set SIGVTALRM handler");
-       set_interval(ITIMER_VIRTUAL);
-
-       do_posix_clock_monotonic_gettime(&now);
-       wall_to_monotonic.tv_sec = -now.tv_sec;
-       wall_to_monotonic.tv_nsec = -now.tv_nsec;
-}
-
-/* Defined in linux/ktimer.h, which can't be included here */
-#define clock_was_set()                do { } while (0)
-
-void do_gettimeofday(struct timeval *tv)
-{
-       unsigned long flags;
-
-       flags = time_lock();
-       gettimeofday(tv, NULL);
-       timeradd(tv, &local_offset, tv);
-       time_unlock(flags);
-       clock_was_set();
-}
-
-int do_settimeofday(struct timespec *tv)
-{
-       struct timeval now;
-       unsigned long flags;
-       struct timeval tv_in;
-
-       if ((unsigned long) tv->tv_nsec >= UM_NSEC_PER_SEC)
-               return -EINVAL;
-
-       tv_in.tv_sec = tv->tv_sec;
-       tv_in.tv_usec = tv->tv_nsec / 1000;
-
-       flags = time_lock();
-       gettimeofday(&now, NULL);
-       timersub(&tv_in, &now, &local_offset);
-       time_unlock(flags);
-
-       return(0);
-}
-
-void idle_sleep(int secs)
-{
-       struct timespec ts;
-
-       ts.tv_sec = secs;
-       ts.tv_nsec = 0;
-       nanosleep(&ts, NULL);
-}
-
-/* XXX This partly duplicates init_irq_signals */
-
-void user_time_init(void)
-{
-       set_handler(SIGVTALRM, (__sighandler_t) alarm_handler,
-                   SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH,
-                   SIGALRM, SIGUSR2, -1);
-       set_handler(SIGALRM, (__sighandler_t) alarm_handler,
-                   SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH,
-                   SIGVTALRM, SIGUSR2, -1);
-       set_interval(ITIMER_VIRTUAL);
-}
index 87cdbc560d360a3c62c4c144645e096225765d67..d7e044b5e5eec9d6f6e6c64f1b670102b80331e7 100644 (file)
@@ -96,11 +96,15 @@ void time_init_kern(void)
 
 void do_boot_timer_handler(struct sigcontext * sc)
 {
+       unsigned long flags;
        struct pt_regs regs;
 
        CHOOSE_MODE((void) (UPT_SC(&regs.regs) = sc),
                    (void) (regs.regs.skas.is_user = 0));
+
+       write_seqlock_irqsave(&xtime_lock, flags);
        do_timer(&regs);
+       write_sequnlock_irqrestore(&xtime_lock, flags);
 }
 
 static DEFINE_SPINLOCK(timer_spinlock);
@@ -125,25 +129,17 @@ irqreturn_t um_timer(int irq, void *dev, struct pt_regs *regs)
        unsigned long long nsecs;
        unsigned long flags;
 
+       write_seqlock_irqsave(&xtime_lock, flags);
+
        do_timer(regs);
 
-       write_seqlock_irqsave(&xtime_lock, flags);
        nsecs = get_time() + local_offset;
        xtime.tv_sec = nsecs / NSEC_PER_SEC;
        xtime.tv_nsec = nsecs - xtime.tv_sec * NSEC_PER_SEC;
-       write_sequnlock_irqrestore(&xtime_lock, flags);
-
-       return(IRQ_HANDLED);
-}
 
-long um_time(int __user *tloc)
-{
-       long ret = get_time() / NSEC_PER_SEC;
-
-       if((tloc != NULL) && put_user(ret, tloc))
-               return -EFAULT;
+       write_sequnlock_irqrestore(&xtime_lock, flags);
 
-       return ret;
+       return IRQ_HANDLED;
 }
 
 void do_gettimeofday(struct timeval *tv)
@@ -174,18 +170,6 @@ static inline void set_time(unsigned long long nsecs)
        clock_was_set();
 }
 
-long um_stime(int __user *tptr)
-{
-       int value;
-
-       if (get_user(value, tptr))
-                return -EFAULT;
-
-       set_time((unsigned long long) value * NSEC_PER_SEC);
-
-       return 0;
-}
-
 int do_settimeofday(struct timespec *tv)
 {
        set_time((unsigned long long) tv->tv_sec * NSEC_PER_SEC + tv->tv_nsec);
@@ -211,7 +195,7 @@ int __init timer_init(void)
        int err;
 
        user_time_init();
-       err = request_irq(TIMER_IRQ, um_timer, SA_INTERRUPT, "timer", NULL);
+       err = request_irq(TIMER_IRQ, um_timer, IRQF_DISABLED, "timer", NULL);
        if(err != 0)
                printk(KERN_ERR "timer_init : request_irq failed - "
                       "errno = %d\n", -err);
index a9c1443fc5481fedf27813f203721690c8996590..8368c2dbe635c7727fe4578a8c804d5057541121 100644 (file)
@@ -119,7 +119,7 @@ void suspend_new_thread(int fd)
                panic("read failed in suspend_new_thread, err = %d", -err);
 }
 
-void schedule_tail(task_t *prev);
+void schedule_tail(struct task_struct *prev);
 
 static void new_thread_handler(int sig)
 {
index 7d51dd7201c372b1ab7f59de2388c19f62bbca68..37cfe7701f063a96c60d86126c96c07dec306fa8 100644 (file)
@@ -495,6 +495,7 @@ void apply_alternatives(struct alt_instr *start, struct alt_instr *end)
 {
 }
 
+#ifdef CONFIG_SMP
 void alternatives_smp_module_add(struct module *mod, char *name,
                                 void *locks, void *locks_end,
                                 void *text,  void *text_end)
@@ -504,3 +505,4 @@ void alternatives_smp_module_add(struct module *mod, char *name,
 void alternatives_smp_module_del(struct module *mod)
 {
 }
+#endif
index 1660a769674b8c24b7f1c88266565028f4b17fa5..72acdce205e0a3eff5d6ae6cdbdd73a20c22a952 100644 (file)
@@ -1,4 +1,5 @@
-#include <linux/config.h>
+/* in case the preprocessor is a 32bit one */
+#undef i386
 #ifdef CONFIG_LD_SCRIPT_STATIC
 #include "uml.lds.S"
 #else
index c6432e7292411de1ea2006aabf97a13c3a7fa4eb..560c8063c77cb80fa54b196fbd078cf8bc19895d 100644 (file)
@@ -55,7 +55,7 @@ static void __init find_tempdir(void)
  */
 static int next(int fd, char *buf, int size, char c)
 {
-       int n;
+       int n, len;
        char *ptr;
 
        while((ptr = strchr(buf, c)) == NULL){
@@ -69,7 +69,17 @@ static int next(int fd, char *buf, int size, char c)
        }
 
        ptr++;
-       memmove(buf, ptr, strlen(ptr) + 1);
+       len = strlen(ptr);
+       memmove(buf, ptr, len + 1);
+
+       /* Refill the buffer so that if there's a partial string that we care
+        * about, it will be completed, and we can recognize it.
+        */
+       n = read(fd, &buf[len], size - len - 1);
+       if(n < 0)
+               return -errno;
+
+       buf[len + n] = '\0';
        return 1;
 }
 
@@ -200,8 +210,11 @@ int create_tmp_file(unsigned long long len)
                exit(1);
        }
 
-        if (lseek64(fd, len, SEEK_SET) < 0) {
-               perror("os_seek_file");
+       /* Seek to len - 1 because writing a character there will
+        * increase the file size by one byte, to the desired length.
+        */
+       if (lseek64(fd, len - 1, SEEK_SET) < 0) {
+               perror("os_seek_file");
                exit(1);
        }
 
index 362db059fe305d4a7276fb7c40705cb18d1a704b..48092b95c8ab997b4914a072afcd17f0e1aa7eda 100644 (file)
@@ -67,32 +67,53 @@ err:
        return err;
 }
 
-static int actually_do_remove(char *dir)
+/*
+ * Unlinks the files contained in @dir and then removes @dir.
+ * Doesn't handle directory trees, so it's not like rm -rf, but almost such. We
+ * ignore ENOENT errors for anything (they happen, strangely enough - possibly due
+ * to races between multiple dying UML threads).
+ */
+static int remove_files_and_dir(char *dir)
 {
        DIR *directory;
        struct dirent *ent;
        int len;
        char file[256];
+       int ret;
 
        directory = opendir(dir);
-       if(directory == NULL)
-               return -errno;
+       if (directory == NULL) {
+               if (errno != ENOENT)
+                       return -errno;
+               else
+                       return 0;
+       }
 
-       while((ent = readdir(directory)) != NULL){
-               if(!strcmp(ent->d_name, ".") || !strcmp(ent->d_name, ".."))
+       while ((ent = readdir(directory)) != NULL) {
+               if (!strcmp(ent->d_name, ".") || !strcmp(ent->d_name, ".."))
                        continue;
                len = strlen(dir) + sizeof("/") + strlen(ent->d_name) + 1;
-               if(len > sizeof(file))
-                       return -E2BIG;
+               if (len > sizeof(file)) {
+                       ret = -E2BIG;
+                       goto out;
+               }
 
                sprintf(file, "%s/%s", dir, ent->d_name);
-               if(unlink(file) < 0)
-                       return -errno;
+               if (unlink(file) < 0 && errno != ENOENT) {
+                       ret = -errno;
+                       goto out;
+               }
        }
-       if(rmdir(dir) < 0)
-               return -errno;
 
-       return 0;
+       if (rmdir(dir) < 0 && errno != ENOENT) {
+               ret = -errno;
+               goto out;
+       }
+
+       ret = 0;
+out:
+       closedir(directory);
+       return ret;
 }
 
 /* This says that there isn't already a user of the specified directory even if
@@ -103,9 +124,10 @@ static int actually_do_remove(char *dir)
  *     something other than UML sticking stuff in the directory
  *     this boot racing with a shutdown of the other UML
  * In any of these cases, the directory isn't useful for anything else.
+ *
+ * Boolean return: 1 if in use, 0 otherwise.
  */
-
-static int not_dead_yet(char *dir)
+static inline int is_umdir_used(char *dir)
 {
        char file[strlen(uml_dir) + UMID_LEN + sizeof("/pid\0")];
        char pid[sizeof("nnnnn\0")], *end;
@@ -113,7 +135,7 @@ static int not_dead_yet(char *dir)
 
        n = snprintf(file, sizeof(file), "%s/pid", dir);
        if(n >= sizeof(file)){
-               printk("not_dead_yet - pid filename too long\n");
+               printk("is_umdir_used - pid filename too long\n");
                err = -E2BIG;
                goto out;
        }
@@ -123,7 +145,7 @@ static int not_dead_yet(char *dir)
        if(fd < 0) {
                fd = -errno;
                if(fd != -ENOENT){
-                       printk("not_dead_yet : couldn't open pid file '%s', "
+                       printk("is_umdir_used : couldn't open pid file '%s', "
                               "err = %d\n", file, -fd);
                }
                goto out;
@@ -132,18 +154,18 @@ static int not_dead_yet(char *dir)
        err = 0;
        n = read(fd, pid, sizeof(pid));
        if(n < 0){
-               printk("not_dead_yet : couldn't read pid file '%s', "
+               printk("is_umdir_used : couldn't read pid file '%s', "
                       "err = %d\n", file, errno);
                goto out_close;
        } else if(n == 0){
-               printk("not_dead_yet : couldn't read pid file '%s', "
+               printk("is_umdir_used : couldn't read pid file '%s', "
                       "0-byte read\n", file);
                goto out_close;
        }
 
        p = strtoul(pid, &end, 0);
        if(end == pid){
-               printk("not_dead_yet : couldn't parse pid file '%s', "
+               printk("is_umdir_used : couldn't parse pid file '%s', "
                       "errno = %d\n", file, errno);
                goto out_close;
        }
@@ -153,19 +175,32 @@ static int not_dead_yet(char *dir)
                return 1;
        }
 
-       err = actually_do_remove(dir);
-       if(err)
-               printk("not_dead_yet - actually_do_remove failed with "
-                      "err = %d\n", err);
-
-       return err;
-
 out_close:
        close(fd);
 out:
        return 0;
 }
 
+/*
+ * Try to remove the directory @dir unless it's in use.
+ * Precondition: @dir exists.
+ * Returns 0 for success, < 0 for failure in removal or if the directory is in
+ * use.
+ */
+static int umdir_take_if_dead(char *dir)
+{
+       int ret;
+       if (is_umdir_used(dir))
+               return -EEXIST;
+
+       ret = remove_files_and_dir(dir);
+       if (ret) {
+               printk("is_umdir_used - remove_files_and_dir failed with "
+                      "err = %d\n", ret);
+       }
+       return ret;
+}
+
 static void __init create_pid_file(void)
 {
        char file[strlen(uml_dir) + UMID_LEN + sizeof("/pid\0")];
@@ -244,11 +279,7 @@ int __init make_umid(void)
                if(err != -EEXIST)
                        goto err;
 
-               /* 1   -> this umid is already in use
-                * < 0 -> we couldn't remove the umid directory
-                * In either case, we can't use this umid, so return -EEXIST.
-                */
-               if(not_dead_yet(tmp) != 0)
+               if (umdir_take_if_dead(tmp) < 0)
                        goto err;
 
                err = mkdir(tmp, 0777);
@@ -344,9 +375,9 @@ static void remove_umid_dir(void)
        char dir[strlen(uml_dir) + UMID_LEN + 1], err;
 
        sprintf(dir, "%s%s", uml_dir, umid);
-       err = actually_do_remove(dir);
+       err = remove_files_and_dir(dir);
        if(err)
-               printf("remove_umid_dir - actually_do_remove failed with "
+               printf("remove_umid_dir - remove_files_and_dir failed with "
                       "err = %d\n", err);
 }
 
index 1347dc6d521828508f525a1b9f7660e133c8f879..813077fb1e5bf5bf69a16fb4355342dc622ecfe3 100644 (file)
@@ -8,7 +8,7 @@ USER_OBJS += $(filter %_user.o,$(obj-y) $(obj-m)  $(USER_SINGLE_OBJS))
 USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
 
 $(USER_OBJS:.o=.%): \
-       c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) $(CFLAGS_$(*F).o)
+       c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) $(CFLAGS_$(basetarget).o)
 $(USER_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \
        -Dunix -D__unix__ -D__$(SUBARCH)__
 
@@ -17,7 +17,7 @@ $(USER_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \
 UNPROFILE_OBJS := $(foreach file,$(UNPROFILE_OBJS),$(obj)/$(file))
 
 $(UNPROFILE_OBJS:.o=.%): \
-       c_flags = -Wp,-MD,$(depfile) $(call unprofile,$(USER_CFLAGS)) $(CFLAGS_$(*F).o)
+       c_flags = -Wp,-MD,$(depfile) $(call unprofile,$(USER_CFLAGS)) $(CFLAGS_$(basetarget).o)
 $(UNPROFILE_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \
        -Dunix -D__unix__ -D__$(SUBARCH)__
 
index d98b2fff3d086416d10d6bdd5d56002211d0aa9f..62c7e564f22eb4719b8b10c54c290849be55f5f9 100644 (file)
@@ -25,7 +25,6 @@
  *             2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <asm/errno.h>
                                
 /*
index 6028bc7cc01bdfae7b8143c95c61261a5cd23893..28bf01150323143d376ed6fdf607c6fab7933af1 100644 (file)
@@ -3,7 +3,6 @@
  * Licensed under the GPL
  */
 
-#include <linux/config.h>
 #include <linux/compiler.h>
 #include "linux/sched.h"
 #include "linux/mm.h"
index 1ff61474b25c69fe45f401225f08b82df98ce4c1..2497554b7b9547a7d176d658ae0f490d517d7144 100644 (file)
@@ -7,8 +7,6 @@
 #define sys_vm86old sys_ni_syscall
 #define sys_vm86 sys_ni_syscall
 
-#define sys_stime um_stime
-#define sys_time um_time
 #define old_mmap old_mmap_i386
 
 #include "../../i386/kernel/syscall_table.S"
index f0c971db47e42b94dc4b7d43fecc751c65fedaeb..1364b7da578c000f937a3253c2265a9dbf6494f5 100644 (file)
@@ -15,7 +15,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <asm/processor.h>
 #include "ppc_asm.h"
 
index 34b2e842864fb5cc5092a530aec127accf90ad42..9e9ad72c2ba4fad3f836ff6f294cfa045f6d9622 100644 (file)
@@ -4,7 +4,6 @@
 #include <linux/linkage.h>
 #include <linux/sys.h>
 #include <linux/cache.h>
-#include <linux/config.h>
 
 #define __NO_STUBS
 
 /*#define sys_set_thread_area sys_ni_syscall
 #define sys_get_thread_area sys_ni_syscall*/
 
-/* For __NR_time. The x86-64 name hopefully will change from sys_time64 to
- * sys_time (since the current situation is bogus). I've sent a patch to cleanup
- * this. Remove below the obsoleted line. */
-#define sys_time64 um_time
-#define sys_time um_time
-
 /* On UML we call it this way ("old" means it's not mmap2) */
 #define sys_mmap old_mmap
 /* On x86-64 sys_uname is actually sys_newuname plus a compatibility trick.
index d0502e14243707489d895fd73a1b225dc16d696c..40892d3e3c247ea2dbada930d4f65b5675f05993 100644 (file)
@@ -11,7 +11,6 @@
  * Written by Miles Bader <miles@gnu.org>
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
index d78c5e4ea9bca4014e1d08dcd567634ac32f2d7b..5352f8a5aa070191f9d0d027a0ac7bc420b10cb9 100644 (file)
@@ -11,7 +11,6 @@
  * Written by Miles Bader <miles@gnu.org>
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
index d8094519ad85efac9a4a6ef9e51177362988c340..cb04a6954ccbc5d99b639d119bc36a50fa6f96ca 100644 (file)
@@ -12,7 +12,6 @@
  * Written by Miles Bader <miles@gnu.org>
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
index 92918b8d89ef61d87cc86eccddd57aed68a8e3c1..25d636e79e6acfe59be1fc933632ad894e880a21 100644 (file)
@@ -154,7 +154,7 @@ static unsigned gbus_int_startup_irq (unsigned irq)
                /* First enable the CPU interrupt.  */
                int rval =
                        request_irq (IRQ_GINT(gint), gbus_int_handle_irq,
-                                    SA_INTERRUPT,
+                                    IRQF_DISABLED,
                                     "gbus_int_handler",
                                     &gint_num_active_irqs[gint]);
                if (rval != 0)
index b3dfbc5d2f4074b2f420070351fd77c2ae9cd259..2aa8ab0f7edcb4f1198ae67205b9f815fdb6beaa 100644 (file)
@@ -11,7 +11,6 @@
  * Written by Miles Bader <miles@gnu.org>
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/mm.h>
index 6527c218f91d1b2ff0be2875218e6acde976bb41..14b0c8858aa46a8445dc44ee8f566316b0b04fbb 100644 (file)
@@ -11,7 +11,6 @@
  * Written by Miles Bader <miles@gnu.org>
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/mm.h>
index 57218c76925ceda29277c7d8573283c169aa8850..c4f844c86e50eb3ed97fc72f8210d4639bd540f0 100644 (file)
@@ -11,7 +11,6 @@
  * Written by Miles Bader <miles@gnu.org>
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index 0c794b9e0f9b8c1187eed1d2b9e43a3f8f4e2066..0f7f6cd705a2d1eae01fa817054e462a577ef917 100644 (file)
@@ -11,7 +11,6 @@
  * Written by Miles Bader <miles@gnu.org>
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/fs.h>
index b662ad838940940eb39585e0443c922de54d5212..f654088b27600098d89cab8afe0714f5a10aa645 100644 (file)
@@ -11,7 +11,6 @@
  * Written by Miles Bader <miles@gnu.org>
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
 #include <linux/fs.h>
index 3873e276392f5e25e6ea29e4c4684fcf0b51ef90..9a716f9464218ba269495cd33638930de0d29174 100644 (file)
@@ -11,7 +11,6 @@
  * Written by Miles Bader <miles@gnu.org>
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/bootmem.h>
index 3a7c5c9c3ac66f5fd248c81d823e582dadcce1e9..f36b778f14320e96e6dca7f748b2ed7cf98ae76c 100644 (file)
@@ -11,7 +11,6 @@
  * Written by Miles Bader <miles@gnu.org>
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
index faaf3d95e6cf3105b0c64c3bea14c19a3b44c44d..3be355a029e27766c21f823661b435a524d06277 100644 (file)
@@ -11,7 +11,6 @@
  * Written by Miles Bader <miles@gnu.org>
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/bootmem.h>
@@ -264,7 +263,7 @@ static unsigned cb_pic_startup_irq (unsigned irq)
 
        if (cb_pic_active_irqs == 0) {
                rval = request_irq (IRQ_CB_PIC, cb_pic_handle_irq,
-                                   SA_INTERRUPT, "cb_pic_handler", 0);
+                                   IRQF_DISABLED, "cb_pic_handler", 0);
                if (rval != 0)
                        return rval;
        }
index 990b20bffe473e27933a93d72d60cb974ac98bef..b4a045da5d70801c004afda74289cd3443aeaab1 100644 (file)
@@ -11,7 +11,6 @@
  * Written by Miles Bader <miles@gnu.org>
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/mm.h>
index 17049aaa8f11832cf4a431e9a9e4a09282dd2208..467b4aa0acdd30e557613c6fed1c0dfb73508d8b 100644 (file)
@@ -11,7 +11,6 @@
  * Written by Miles Bader <miles@gnu.org>
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
index 9111613fb53a332dd1605f0921c64e4b529fdf76..566dde5e6070f0a3cf16ecae73618ce2211e2dc9 100644 (file)
@@ -12,7 +12,6 @@
  * Written by Miles Bader <miles@gnu.org>
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
index 9224cb65f6ec8e93e2ccfe084af2144e2d421c26..2ec0700fc46bc75cc0ab9c312c0be75cdba674b9 100644 (file)
@@ -15,7 +15,6 @@
  *     and Paul Mackerras (paulus@cs.anu.edu.au).
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
index 495cf8f37bcb52906047f1597f854f94b8ec7352..290d506650166633a691aecd1c953cfeff75cd16 100644 (file)
@@ -11,7 +11,6 @@
  * Written by Miles Bader <miles@gnu.org>
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/mm.h>
index c1e85c2aef65093f0ae70c90d8f1efc893e1e1b3..a0b46695f186f03921a7a09b66cde5af0bf5bfa8 100644 (file)
@@ -177,7 +177,7 @@ EXPORT_SYMBOL(do_settimeofday);
 static int timer_dev_id;
 static struct irqaction timer_irqaction = {
        timer_interrupt,
-       SA_INTERRUPT,
+       IRQF_DISABLED,
        CPU_MASK_NONE,
        "timer",
        &timer_dev_id,
index 6bcfcfe88384b7d0a573f496d1f2afedd5e2f99e..c03ad6ed61cca6f10139895a4f4ba4dcb89deef7 100644 (file)
@@ -7,7 +7,6 @@
 #include <linux/elfcore.h>
 #include <linux/in6.h>
 #include <linux/interrupt.h>
-#include <linux/config.h>
 
 #include <asm/pgalloc.h>
 #include <asm/irq.h>
index 5b2ffcc6e2b2f50db26ead76ba384118065b79e1..63399219cd9fca731fe4c7b473ce2288a1914ad4 100644 (file)
@@ -11,7 +11,6 @@
  * Written by Miles Bader <miles@gnu.org>
  */
 
-#include <linux/config.h>
 
 #define VMLINUX_SYMBOL(_sym_) _##_sym_
 #include <asm-generic/vmlinux.lds.h>
index e856804c447f4496c4c490b67a3e40b39baee5e3..28df7d88ce2c3cf6e4399df3ef99ed5b26625c3d 100644 (file)
@@ -24,6 +24,14 @@ config X86
        bool
        default y
 
+config LOCKDEP_SUPPORT
+       bool
+       default y
+
+config STACKTRACE_SUPPORT
+       bool
+       default y
+
 config SEMAPHORE_SLEEPERS
        bool
        default y
index 1d92ab56c0f93fa06c4bf2b8f72bdbabb99ef782..775d211a5cf93983ca1fd97c64f56fc18c3f8213 100644 (file)
@@ -1,5 +1,9 @@
 menu "Kernel hacking"
 
+config TRACE_IRQFLAGS_SUPPORT
+       bool
+       default y
+
 source "lib/Kconfig.debug"
 
 config DEBUG_RODATA
index 12ea0b6c52e2a8b48cea525ec530d49b8c1d97a5..a50b631f4d2b017fbb5433726aaf727f4a10883b 100644 (file)
@@ -45,9 +45,8 @@
  * Added long mode checking and SSE force. March 2003, Andi Kleen.             
  */
 
-#include <linux/config.h>
 #include <asm/segment.h>
-#include <linux/version.h>
+#include <linux/utsrelease.h>
 #include <linux/compile.h>
 #include <asm/boot.h>
 #include <asm/e820.h>
index e9263b4975e0c4fec437c134ae45bebac2d501af..62bc5f56da9e7cf8def1e9749297c6e2b1234cf1 100644 (file)
@@ -11,6 +11,9 @@ obj-$(CONFIG_IA32_EMULATION) += $(sysv-y)
 
 obj-$(CONFIG_IA32_AOUT) += ia32_aout.o
 
+audit-class-$(CONFIG_AUDIT) := audit.o
+obj-$(CONFIG_IA32_EMULATION) += $(audit-class-y)
+
 $(obj)/syscall32_syscall.o: \
        $(foreach F,sysenter syscall,$(obj)/vsyscall-$F.so)
 
diff --git a/arch/x86_64/ia32/audit.c b/arch/x86_64/ia32/audit.c
new file mode 100644 (file)
index 0000000..ab94f2e
--- /dev/null
@@ -0,0 +1,11 @@
+#include <asm-i386/unistd.h>
+
+unsigned ia32_dir_class[] = {
+#include <asm-generic/audit_dir_write.h>
+~0U
+};
+
+unsigned ia32_chattr_class[] = {
+#include <asm-generic/audit_change_attr.h>
+~0U
+};
index c536fa98ea37769c450bbc8b84e4807d25a9834f..9b5bb413a6e938ea1efe0c41327563e07547774d 100644 (file)
@@ -13,6 +13,7 @@
 #include <asm/thread_info.h>   
 #include <asm/segment.h>
 #include <asm/vsyscall32.h>
+#include <asm/irqflags.h>
 #include <linux/linkage.h>
 
 #define IA32_NR_syscalls ((ia32_syscall_end - ia32_sys_call_table)/8)
@@ -75,6 +76,10 @@ ENTRY(ia32_sysenter_target)
        swapgs
        movq    %gs:pda_kernelstack, %rsp
        addq    $(PDA_STACKOFFSET),%rsp 
+       /*
+        * No need to follow this irqs on/off section: the syscall
+        * disabled irqs, here we enable it straight after entry:
+        */
        sti     
        movl    %ebp,%ebp               /* zero extension */
        pushq   $__USER32_DS
@@ -118,6 +123,7 @@ sysenter_do_call:
        movq    %rax,RAX-ARGOFFSET(%rsp)
        GET_THREAD_INFO(%r10)
        cli
+       TRACE_IRQS_OFF
        testl   $_TIF_ALLWORK_MASK,threadinfo_flags(%r10)
        jnz     int_ret_from_sys_call
        andl    $~TS_COMPAT,threadinfo_status(%r10)
@@ -132,6 +138,7 @@ sysenter_do_call:
        CFI_REGISTER rsp,rcx
        movl    $VSYSCALL32_SYSEXIT,%edx        /* User %eip */
        CFI_REGISTER rip,rdx
+       TRACE_IRQS_ON
        swapgs
        sti             /* sti only takes effect after the next instruction */
        /* sysexit */
@@ -186,6 +193,10 @@ ENTRY(ia32_cstar_target)
        movl    %esp,%r8d
        CFI_REGISTER    rsp,r8
        movq    %gs:pda_kernelstack,%rsp
+       /*
+        * No need to follow this irqs on/off section: the syscall
+        * disabled irqs and here we enable it straight after entry:
+        */
        sti
        SAVE_ARGS 8,1,1
        movl    %eax,%eax       /* zero extension */
@@ -220,6 +231,7 @@ cstar_do_call:
        movq %rax,RAX-ARGOFFSET(%rsp)
        GET_THREAD_INFO(%r10)
        cli
+       TRACE_IRQS_OFF
        testl $_TIF_ALLWORK_MASK,threadinfo_flags(%r10)
        jnz  int_ret_from_sys_call
        andl $~TS_COMPAT,threadinfo_status(%r10)
@@ -228,6 +240,7 @@ cstar_do_call:
        CFI_REGISTER rip,rcx
        movl EFLAGS-ARGOFFSET(%rsp),%r11d       
        /*CFI_REGISTER rflags,r11*/
+       TRACE_IRQS_ON
        movl RSP-ARGOFFSET(%rsp),%esp
        CFI_RESTORE rsp
        swapgs
@@ -286,7 +299,11 @@ ENTRY(ia32_syscall)
        /*CFI_REL_OFFSET        rflags,EFLAGS-RIP*/
        /*CFI_REL_OFFSET        cs,CS-RIP*/
        CFI_REL_OFFSET  rip,RIP-RIP
-       swapgs  
+       swapgs
+       /*
+        * No need to follow this irqs on/off section: the syscall
+        * disabled irqs and here we enable it straight after entry:
+        */
        sti
        movl %eax,%eax
        pushq %rax
index dc88154c412b34ee654b801b0828edcbcb35ef4b..9c130993380d8b3a27da7437da33be064f713052 100644 (file)
@@ -20,7 +20,6 @@
  * This should be fixed.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/fs.h> 
index aeb9c560be88aef2fd7141c792221ed85f92266e..b5aaeafc1cd3cf5542fb7b4acab68b7b943fe157 100644 (file)
@@ -10,6 +10,7 @@ obj-y := process.o signal.o entry.o traps.o irq.o \
                setup64.o bootflag.o e820.o reboot.o quirks.o i8237.o \
                pci-dma.o pci-nommu.o alternative.o
 
+obj-$(CONFIG_STACKTRACE)       += stacktrace.o
 obj-$(CONFIG_X86_MCE)         += mce.o
 obj-$(CONFIG_X86_MCE_INTEL)    += mce_intel.o
 obj-$(CONFIG_X86_MCE_AMD)      += mce_amd.o
@@ -35,6 +36,7 @@ obj-$(CONFIG_KPROBES)         += kprobes.o
 obj-$(CONFIG_X86_PM_TIMER)     += pmtimer.o
 obj-$(CONFIG_X86_VSMP)         += vsmp.o
 obj-$(CONFIG_K8_NB)            += k8.o
+obj-$(CONFIG_AUDIT)            += audit.o
 
 obj-$(CONFIG_MODULES)          += module.o
 
index 091bc79c888f6dac8873c1f420d42f17c390351f..5ebf62c7a3d2ba936c2e22dfcd0b0ae02b9bdde5 100644 (file)
@@ -26,7 +26,6 @@
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/types.h>
index a195ef06ec5553e7c9f3fa7eb12fbb4078bd826c..58af8e73738bd5cf51dc9b0a7884bb0fbb66d154 100644 (file)
@@ -9,7 +9,6 @@
  * 
  * Copyright 2002 Andi Kleen, SuSE Labs.
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/init.h>
index b2ead91df218b0e68e9d1cb056981eb0e491896b..2b8cef037a6544046fc71000fea9c8e9874a7df9 100644 (file)
@@ -14,7 +14,6 @@
  *     Mikael Pettersson       :       PM converted to driver model.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 
 #include <linux/mm.h>
diff --git a/arch/x86_64/kernel/audit.c b/arch/x86_64/kernel/audit.c
new file mode 100644 (file)
index 0000000..a067aa4
--- /dev/null
@@ -0,0 +1,29 @@
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/audit.h>
+#include <asm/unistd.h>
+
+static unsigned dir_class[] = {
+#include <asm-generic/audit_dir_write.h>
+~0U
+};
+
+static unsigned chattr_class[] = {
+#include <asm-generic/audit_change_attr.h>
+~0U
+};
+
+static int __init audit_classes_init(void)
+{
+#ifdef CONFIG_IA32_EMULATION
+       extern __u32 ia32_dir_class[];
+       extern __u32 ia32_chattr_class[];
+       audit_register_class(AUDIT_CLASS_DIR_WRITE_32, ia32_dir_class);
+       audit_register_class(AUDIT_CLASS_CHATTR_32, ia32_chattr_class);
+#endif
+       audit_register_class(AUDIT_CLASS_DIR_WRITE, dir_class);
+       audit_register_class(AUDIT_CLASS_CHATTR, chattr_class);
+       return 0;
+}
+
+__initcall(audit_classes_init);
index 9e94d834624bbc9a0960ba9975ef6b62c389a501..b8eee4c7888b596753660ef56e7cdb39c29391cc 100644 (file)
@@ -8,7 +8,6 @@
  *  Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
  *
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/init.h>
index 22cac4487b57fd1e9aef98769071a8e4f02f0d81..d464dded68c0eb363e1ca848cb5563d34a74b724 100644 (file)
@@ -28,7 +28,6 @@
  */
 
 #define ASSEMBLY 1
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/segment.h>
 #include <asm/smp.h>
 #include <asm/thread_info.h>
 #include <asm/hw_irq.h>
 #include <asm/page.h>
+#include <asm/irqflags.h>
 
        .code64
 
 #ifndef CONFIG_PREEMPT
 #define retint_kernel retint_restore_args
 #endif 
-       
+
+
+.macro TRACE_IRQS_IRETQ offset=ARGOFFSET
+#ifdef CONFIG_TRACE_IRQFLAGS
+       bt   $9,EFLAGS-\offset(%rsp)    /* interrupts off? */
+       jnc  1f
+       TRACE_IRQS_ON
+1:
+#endif
+.endm
+
 /*
  * C code is not supposed to know about undefined top of stack. Every time 
  * a C function with an pt_regs argument is called from the SYSCALL based 
@@ -195,6 +205,10 @@ ENTRY(system_call)
        swapgs
        movq    %rsp,%gs:pda_oldrsp 
        movq    %gs:pda_kernelstack,%rsp
+       /*
+        * No need to follow this irqs off/on section - it's straight
+        * and short:
+        */
        sti                                     
        SAVE_ARGS 8,1
        movq  %rax,ORIG_RAX-ARGOFFSET(%rsp) 
@@ -220,10 +234,15 @@ ret_from_sys_call:
 sysret_check:          
        GET_THREAD_INFO(%rcx)
        cli
+       TRACE_IRQS_OFF
        movl threadinfo_flags(%rcx),%edx
        andl %edi,%edx
        CFI_REMEMBER_STATE
        jnz  sysret_careful 
+       /*
+        * sysretq will re-enable interrupts:
+        */
+       TRACE_IRQS_ON
        movq RIP-ARGOFFSET(%rsp),%rcx
        CFI_REGISTER    rip,rcx
        RESTORE_ARGS 0,-ARG_SKIP,1
@@ -238,6 +257,7 @@ sysret_careful:
        CFI_RESTORE_STATE
        bt $TIF_NEED_RESCHED,%edx
        jnc sysret_signal
+       TRACE_IRQS_ON
        sti
        pushq %rdi
        CFI_ADJUST_CFA_OFFSET 8
@@ -248,6 +268,7 @@ sysret_careful:
 
        /* Handle a signal */ 
 sysret_signal:
+       TRACE_IRQS_ON
        sti
        testl $(_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SINGLESTEP),%edx
        jz    1f
@@ -262,6 +283,7 @@ sysret_signal:
        /* Use IRET because user could have changed frame. This
           works because ptregscall_common has called FIXUP_TOP_OF_STACK. */
        cli
+       TRACE_IRQS_OFF
        jmp int_with_check
        
 badsys:
@@ -310,6 +332,7 @@ ENTRY(int_ret_from_sys_call)
        CFI_REL_OFFSET  r10,R10-ARGOFFSET
        CFI_REL_OFFSET  r11,R11-ARGOFFSET
        cli
+       TRACE_IRQS_OFF
        testl $3,CS-ARGOFFSET(%rsp)
        je retint_restore_args
        movl $_TIF_ALLWORK_MASK,%edi
@@ -328,6 +351,7 @@ int_with_check:
 int_careful:
        bt $TIF_NEED_RESCHED,%edx
        jnc  int_very_careful
+       TRACE_IRQS_ON
        sti
        pushq %rdi
        CFI_ADJUST_CFA_OFFSET 8
@@ -335,10 +359,12 @@ int_careful:
        popq %rdi
        CFI_ADJUST_CFA_OFFSET -8
        cli
+       TRACE_IRQS_OFF
        jmp int_with_check
 
        /* handle signals and tracing -- both require a full stack frame */
 int_very_careful:
+       TRACE_IRQS_ON
        sti
        SAVE_REST
        /* Check for syscall exit trace */      
@@ -352,6 +378,7 @@ int_very_careful:
        CFI_ADJUST_CFA_OFFSET -8
        andl $~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP),%edi
        cli
+       TRACE_IRQS_OFF
        jmp int_restore_rest
        
 int_signal:
@@ -364,6 +391,7 @@ int_signal:
 int_restore_rest:
        RESTORE_REST
        cli
+       TRACE_IRQS_OFF
        jmp int_with_check
        CFI_ENDPROC
 END(int_ret_from_sys_call)
@@ -485,6 +513,10 @@ END(stub_rt_sigreturn)
        swapgs  
 1:     incl    %gs:pda_irqcount        # RED-PEN should check preempt count
        cmoveq %gs:pda_irqstackptr,%rsp
+       /*
+        * We entered an interrupt context - irqs are off:
+        */
+       TRACE_IRQS_OFF
        call \func
        .endm
 
@@ -494,6 +526,7 @@ ENTRY(common_interrupt)
        /* 0(%rsp): oldrsp-ARGOFFSET */
 ret_from_intr:
        cli     
+       TRACE_IRQS_OFF
        decl %gs:pda_irqcount
        leaveq
        CFI_DEF_CFA_REGISTER    rsp
@@ -516,9 +549,21 @@ retint_check:
        CFI_REMEMBER_STATE
        jnz  retint_careful
 retint_swapgs:         
+       /*
+        * The iretq could re-enable interrupts:
+        */
+       cli
+       TRACE_IRQS_IRETQ
        swapgs 
+       jmp restore_args
+
 retint_restore_args:                           
        cli
+       /*
+        * The iretq could re-enable interrupts:
+        */
+       TRACE_IRQS_IRETQ
+restore_args:
        RESTORE_ARGS 0,8,0                                              
 iret_label:    
        iretq
@@ -531,6 +576,7 @@ iret_label:
        /* running with kernel gs */
 bad_iret:
        movq $11,%rdi   /* SIGSEGV */
+       TRACE_IRQS_ON
        sti
        jmp do_exit                     
        .previous       
@@ -540,6 +586,7 @@ retint_careful:
        CFI_RESTORE_STATE
        bt    $TIF_NEED_RESCHED,%edx
        jnc   retint_signal
+       TRACE_IRQS_ON
        sti
        pushq %rdi
        CFI_ADJUST_CFA_OFFSET   8
@@ -548,11 +595,13 @@ retint_careful:
        CFI_ADJUST_CFA_OFFSET   -8
        GET_THREAD_INFO(%rcx)
        cli
+       TRACE_IRQS_OFF
        jmp retint_check
        
 retint_signal:
        testl $(_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SINGLESTEP),%edx
        jz    retint_swapgs
+       TRACE_IRQS_ON
        sti
        SAVE_REST
        movq $-1,ORIG_RAX(%rsp)                         
@@ -561,6 +610,7 @@ retint_signal:
        call do_notify_resume
        RESTORE_REST
        cli
+       TRACE_IRQS_OFF
        movl $_TIF_NEED_RESCHED,%edi
        GET_THREAD_INFO(%rcx)
        jmp retint_check
@@ -667,7 +717,7 @@ END(spurious_interrupt)
 
        /* error code is on the stack already */
        /* handle NMI like exceptions that can happen everywhere */
-       .macro paranoidentry sym, ist=0
+       .macro paranoidentry sym, ist=0, irqtrace=1
        SAVE_ALL
        cld
        movl $1,%ebx
@@ -692,8 +742,73 @@ END(spurious_interrupt)
        addq    $EXCEPTION_STKSZ, per_cpu__init_tss + TSS_ist + (\ist - 1) * 8(%rbp)
        .endif
        cli
+       .if \irqtrace
+       TRACE_IRQS_OFF
+       .endif
        .endm
-       
+
+       /*
+        * "Paranoid" exit path from exception stack.
+        * Paranoid because this is used by NMIs and cannot take
+        * any kernel state for granted.
+        * We don't do kernel preemption checks here, because only
+        * NMI should be common and it does not enable IRQs and
+        * cannot get reschedule ticks.
+        *
+        * "trace" is 0 for the NMI handler only, because irq-tracing
+        * is fundamentally NMI-unsafe. (we cannot change the soft and
+        * hard flags at once, atomically)
+        */
+       .macro paranoidexit trace=1
+       /* ebx: no swapgs flag */
+paranoid_exit\trace:
+       testl %ebx,%ebx                         /* swapgs needed? */
+       jnz paranoid_restore\trace
+       testl $3,CS(%rsp)
+       jnz   paranoid_userspace\trace
+paranoid_swapgs\trace:
+       TRACE_IRQS_IRETQ 0
+       swapgs
+paranoid_restore\trace:
+       RESTORE_ALL 8
+       iretq
+paranoid_userspace\trace:
+       GET_THREAD_INFO(%rcx)
+       movl threadinfo_flags(%rcx),%ebx
+       andl $_TIF_WORK_MASK,%ebx
+       jz paranoid_swapgs\trace
+       movq %rsp,%rdi                  /* &pt_regs */
+       call sync_regs
+       movq %rax,%rsp                  /* switch stack for scheduling */
+       testl $_TIF_NEED_RESCHED,%ebx
+       jnz paranoid_schedule\trace
+       movl %ebx,%edx                  /* arg3: thread flags */
+       .if \trace
+       TRACE_IRQS_ON
+       .endif
+       sti
+       xorl %esi,%esi                  /* arg2: oldset */
+       movq %rsp,%rdi                  /* arg1: &pt_regs */
+       call do_notify_resume
+       cli
+       .if \trace
+       TRACE_IRQS_OFF
+       .endif
+       jmp paranoid_userspace\trace
+paranoid_schedule\trace:
+       .if \trace
+       TRACE_IRQS_ON
+       .endif
+       sti
+       call schedule
+       cli
+       .if \trace
+       TRACE_IRQS_OFF
+       .endif
+       jmp paranoid_userspace\trace
+       CFI_ENDPROC
+       .endm
+
 /*
  * Exception entry point. This expects an error code/orig_rax on the stack
  * and the exception handler in %rax.  
@@ -749,6 +864,7 @@ error_exit:
        movl %ebx,%eax          
        RESTORE_REST
        cli
+       TRACE_IRQS_OFF
        GET_THREAD_INFO(%rcx)   
        testl %eax,%eax
        jne  retint_kernel
@@ -756,6 +872,10 @@ error_exit:
        movl  $_TIF_WORK_MASK,%edi
        andl  %edi,%edx
        jnz  retint_careful
+       /*
+        * The iret might restore flags:
+        */
+       TRACE_IRQS_IRETQ
        swapgs 
        RESTORE_ARGS 0,8,0                                              
        jmp iret_label
@@ -917,8 +1037,7 @@ KPROBE_ENTRY(debug)
        pushq $0
        CFI_ADJUST_CFA_OFFSET 8         
        paranoidentry do_debug, DEBUG_STACK
-       jmp paranoid_exit
-       CFI_ENDPROC
+       paranoidexit
 END(debug)
        .previous .text
 
@@ -927,49 +1046,13 @@ KPROBE_ENTRY(nmi)
        INTR_FRAME
        pushq $-1
        CFI_ADJUST_CFA_OFFSET 8
-       paranoidentry do_nmi
-       /*
-        * "Paranoid" exit path from exception stack.
-        * Paranoid because this is used by NMIs and cannot take
-        * any kernel state for granted.
-        * We don't do kernel preemption checks here, because only
-        * NMI should be common and it does not enable IRQs and
-        * cannot get reschedule ticks.
-        */
-       /* ebx: no swapgs flag */
-paranoid_exit:
-       testl %ebx,%ebx                         /* swapgs needed? */
-       jnz paranoid_restore
-       testl $3,CS(%rsp)
-       jnz   paranoid_userspace
-paranoid_swapgs:       
-       swapgs
-paranoid_restore:      
-       RESTORE_ALL 8
-       iretq
-paranoid_userspace:    
-       GET_THREAD_INFO(%rcx)
-       movl threadinfo_flags(%rcx),%ebx
-       andl $_TIF_WORK_MASK,%ebx
-       jz paranoid_swapgs
-       movq %rsp,%rdi                  /* &pt_regs */
-       call sync_regs
-       movq %rax,%rsp                  /* switch stack for scheduling */
-       testl $_TIF_NEED_RESCHED,%ebx
-       jnz paranoid_schedule
-       movl %ebx,%edx                  /* arg3: thread flags */
-       sti
-       xorl %esi,%esi                  /* arg2: oldset */
-       movq %rsp,%rdi                  /* arg1: &pt_regs */
-       call do_notify_resume
-       cli
-       jmp paranoid_userspace
-paranoid_schedule:
-       sti
-       call schedule
-       cli
-       jmp paranoid_userspace
-       CFI_ENDPROC
+       paranoidentry do_nmi, 0, 0
+#ifdef CONFIG_TRACE_IRQFLAGS
+       paranoidexit 0
+#else
+       jmp paranoid_exit1
+       CFI_ENDPROC
+#endif
 END(nmi)
        .previous .text
 
@@ -978,7 +1061,7 @@ KPROBE_ENTRY(int3)
        pushq $0
        CFI_ADJUST_CFA_OFFSET 8
        paranoidentry do_int3, DEBUG_STACK
-       jmp paranoid_exit
+       jmp paranoid_exit1
        CFI_ENDPROC
 END(int3)
        .previous .text
@@ -1007,7 +1090,7 @@ END(reserved)
 ENTRY(double_fault)
        XCPT_FRAME
        paranoidentry do_double_fault
-       jmp paranoid_exit
+       jmp paranoid_exit1
        CFI_ENDPROC
 END(double_fault)
 
@@ -1023,7 +1106,7 @@ END(segment_not_present)
 ENTRY(stack_segment)
        XCPT_FRAME
        paranoidentry do_stack_segment
-       jmp paranoid_exit
+       jmp paranoid_exit1
        CFI_ENDPROC
 END(stack_segment)
 
@@ -1051,7 +1134,7 @@ ENTRY(machine_check)
        pushq $0
        CFI_ADJUST_CFA_OFFSET 8 
        paranoidentry do_machine_check
-       jmp paranoid_exit
+       jmp paranoid_exit1
        CFI_ENDPROC
 END(machine_check)
 #endif
index 7a64ea181788c62e3c6a8e9e07a378ffa0a23ac0..8e78a75d1866ffc433cb2eb4d28dc7047a0e9a64 100644 (file)
@@ -8,7 +8,6 @@
  * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
  * James Cleverdon.
  */
-#include <linux/config.h>
 #include <linux/threads.h>
 #include <linux/cpumask.h>
 #include <linux/string.h>
index 43fcf62fef0f5aa0931930b1881cc88f7b50605c..3020917546de09ccd9b2432a0a06b8f6f2e1feaf 100644 (file)
@@ -9,7 +9,6 @@
  * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
  * James Cleverdon.
  */
-#include <linux/config.h>
 #include <linux/threads.h>
 #include <linux/cpumask.h>
 #include <linux/string.h>
index 21c7066e236aa0a0e83ea78505037e51c37d37a8..eb86d374813a3038c0b5299f6dae861b2bd4b33d 100644 (file)
@@ -8,7 +8,6 @@
  * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
  * James Cleverdon.
  */
-#include <linux/config.h>
 #include <linux/threads.h>
 #include <linux/cpumask.h>
 #include <linux/string.h>
index e6a71c9556d9561fe8d83a9473fddc63da6367ef..36647ce6aecbd696c97265b9e0d3862a723cc65a 100644 (file)
@@ -84,6 +84,11 @@ void __init x86_64_start_kernel(char * real_mode_data)
        asm volatile("lidt %0" :: "m" (idt_descr));
        clear_bss();
 
+       /*
+        * This must be called really, really early:
+        */
+       lockdep_init();
+
        /*
         * switch to init_level4_pgt from boot_level4_pgt
         */
index 44ddb1ec808d29123a32249e3e0588602404d159..3aa1e9bb781df686854f34816b0fff661ccb9847 100644 (file)
@@ -14,7 +14,6 @@
  *  the 64bit user space sees a FXSAVE frame directly. 
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/init.h>
 #include <asm/processor.h>
index 3dd1659427dc3a78f6c09c3e2827d36278f2b1e7..0434b1f8e3dd47bbea3514aaee35c8a6cd56da40 100644 (file)
@@ -1,5 +1,4 @@
 #include <linux/linkage.h>
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
index 401b687fef21b2f4736c6a79d3f51b1fa1ac99b8..924a4a332954349e56dd990efb82e037d18d0154 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/sched.h>
-#include <linux/config.h>
 #include <linux/smp_lock.h>
 #include <linux/mc146818rtc.h>
 #include <linux/acpi.h>
index a1f1df5f7bfc2d5a40d6269e5a37f69d6dc746af..5221a53e90c1e0b7d68d126c6a31fef19abff6db 100644 (file)
@@ -177,8 +177,10 @@ asmlinkage void do_softirq(void)
        local_irq_save(flags);
        pending = local_softirq_pending();
        /* Switch to interrupt stack */
-       if (pending)
+       if (pending) {
                call_softirq();
+               WARN_ON_ONCE(softirq_count());
+       }
        local_irq_restore(flags);
 }
 EXPORT_SYMBOL(do_softirq);
index fa1d19ca700ae82a23df77f068bee660e47f80f2..ffc73ac72485f666befc9e7b13c730930fd6681b 100644 (file)
@@ -31,7 +31,6 @@
  *              Added function return probes functionality
  */
 
-#include <linux/config.h>
 #include <linux/kprobes.h>
 #include <linux/ptrace.h>
 #include <linux/string.h>
index 083da7e606b1e6a88ca89f997276dbd9556a76d4..a1ab4197f8a11594e59c57b20c67d5a6511c6cfa 100644 (file)
@@ -16,7 +16,6 @@
 #include <linux/mm.h>
 #include <linux/init.h>
 #include <linux/delay.h>
-#include <linux/config.h>
 #include <linux/bootmem.h>
 #include <linux/smp_lock.h>
 #include <linux/kernel_stat.h>
index 0ef9cf2bc45e4ea809e3a76fb2c4f61dc4a3c7b4..5baa0c726e97c60aeea2badd1e552b8166f290d6 100644 (file)
@@ -12,7 +12,6 @@
  *  Mikael Pettersson  : PM converted to driver model. Disable/enable API.
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
@@ -128,7 +127,7 @@ void __cpuinit nmi_watchdog_default(void)
 static __init void nmi_cpu_busy(void *data)
 {
        volatile int *endflag = data;
-       local_irq_enable();
+       local_irq_enable_in_hardirq();
        /* Intentionally don't use cpu_relax here. This is
           to make sure that the performance counter really ticks,
           even if there is a simulator or similar that catches the
index 4ca674d16b09c62b10afc56674e06126cdbce481..6d3e61baf7a0159c015f4b439d88fe404dcb129a 100644 (file)
@@ -10,7 +10,6 @@
  * Copyright 2002 Andi Kleen, SuSE Labs.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/ctype.h>
 #include <linux/agp_backend.h>
index ca56e19b8b6e25ec64ca2325d07f3040ab0029f3..bb6745d13b8ff5f3bb1b59d32e50716d910c7c39 100644 (file)
@@ -296,7 +296,7 @@ void __show_regs(struct pt_regs * regs)
                system_utsname.version);
        printk("RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->rip);
        printk_address(regs->rip); 
-       printk("\nRSP: %04lx:%016lx  EFLAGS: %08lx\n", regs->ss, regs->rsp,
+       printk("RSP: %04lx:%016lx  EFLAGS: %08lx\n", regs->ss, regs->rsp,
                regs->eflags);
        printk("RAX: %016lx RBX: %016lx RCX: %016lx\n",
               regs->rax, regs->rbx, regs->rcx);
index 1129918ede826d7319cdb45f85344d520abbd7ca..0925518b58d06c436e794e576a35ef474d5df5aa 100644 (file)
@@ -24,7 +24,6 @@
 #include <linux/tty.h>
 #include <linux/ioport.h>
 #include <linux/delay.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/initrd.h>
 #include <linux/highmem.h>
index f5934cb4a2b60457e71f3ba1a109dc0b67cc66f0..6fe58a634b5f308df87021fe6bcdeca25925ce91 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright 2001, 2002, 2003 SuSE Labs / Andi Kleen.
  * See setup.c for older changelog.
  */ 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index 540c0ccbcccc8953c95ee6b6c2baf5ad11e44aaf..b7c70596979143f5ec70af8b38a2de656b424dcd 100644 (file)
@@ -38,7 +38,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/init.h>
 
 #include <linux/mm.h>
@@ -776,6 +775,8 @@ static int __cpuinit do_boot_cpu(int cpu, int apicid)
        };
        DECLARE_WORK(work, do_fork_idle, &c_idle);
 
+       lockdep_set_class(&c_idle.done.wait.lock, &waitqueue_lock_key);
+
        /* allocate memory for gdts of secondary cpus. Hotplug is considered */
        if (!cpu_gdt_descr[cpu].address &&
                !(cpu_gdt_descr[cpu].address = get_zeroed_page(GFP_KERNEL))) {
diff --git a/arch/x86_64/kernel/stacktrace.c b/arch/x86_64/kernel/stacktrace.c
new file mode 100644 (file)
index 0000000..32cf55e
--- /dev/null
@@ -0,0 +1,221 @@
+/*
+ * arch/x86_64/kernel/stacktrace.c
+ *
+ * Stack trace management functions
+ *
+ *  Copyright (C) 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
+ */
+#include <linux/sched.h>
+#include <linux/stacktrace.h>
+
+#include <asm/smp.h>
+
+static inline int
+in_range(unsigned long start, unsigned long addr, unsigned long end)
+{
+       return addr >= start && addr <= end;
+}
+
+static unsigned long
+get_stack_end(struct task_struct *task, unsigned long stack)
+{
+       unsigned long stack_start, stack_end, flags;
+       int i, cpu;
+
+       /*
+        * The most common case is that we are in the task stack:
+        */
+       stack_start = (unsigned long)task->thread_info;
+       stack_end = stack_start + THREAD_SIZE;
+
+       if (in_range(stack_start, stack, stack_end))
+               return stack_end;
+
+       /*
+        * We are in an interrupt if irqstackptr is set:
+        */
+       raw_local_irq_save(flags);
+       cpu = safe_smp_processor_id();
+       stack_end = (unsigned long)cpu_pda(cpu)->irqstackptr;
+
+       if (stack_end) {
+               stack_start = stack_end & ~(IRQSTACKSIZE-1);
+               if (in_range(stack_start, stack, stack_end))
+                       goto out_restore;
+               /*
+                * We get here if we are in an IRQ context but we
+                * are also in an exception stack.
+                */
+       }
+
+       /*
+        * Iterate over all exception stacks, and figure out whether
+        * 'stack' is in one of them:
+        */
+       for (i = 0; i < N_EXCEPTION_STACKS; i++) {
+               /*
+                * set 'end' to the end of the exception stack.
+                */
+               stack_end = per_cpu(init_tss, cpu).ist[i];
+               stack_start = stack_end - EXCEPTION_STKSZ;
+
+               /*
+                * Is 'stack' above this exception frame's end?
+                * If yes then skip to the next frame.
+                */
+               if (stack >= stack_end)
+                       continue;
+               /*
+                * Is 'stack' above this exception frame's start address?
+                * If yes then we found the right frame.
+                */
+               if (stack >= stack_start)
+                       goto out_restore;
+
+               /*
+                * If this is a debug stack, and if it has a larger size than
+                * the usual exception stacks, then 'stack' might still
+                * be within the lower portion of the debug stack:
+                */
+#if DEBUG_STKSZ > EXCEPTION_STKSZ
+               if (i == DEBUG_STACK - 1 && stack >= stack_end - DEBUG_STKSZ) {
+                       /*
+                        * Black magic. A large debug stack is composed of
+                        * multiple exception stack entries, which we
+                        * iterate through now. Dont look:
+                        */
+                       do {
+                               stack_end -= EXCEPTION_STKSZ;
+                               stack_start -= EXCEPTION_STKSZ;
+                       } while (stack < stack_start);
+
+                       goto out_restore;
+               }
+#endif
+       }
+       /*
+        * Ok, 'stack' is not pointing to any of the system stacks.
+        */
+       stack_end = 0;
+
+out_restore:
+       raw_local_irq_restore(flags);
+
+       return stack_end;
+}
+
+
+/*
+ * Save stack-backtrace addresses into a stack_trace buffer:
+ */
+static inline unsigned long
+save_context_stack(struct stack_trace *trace, unsigned int skip,
+                  unsigned long stack, unsigned long stack_end)
+{
+       unsigned long addr;
+
+#ifdef CONFIG_FRAME_POINTER
+       unsigned long prev_stack = 0;
+
+       while (in_range(prev_stack, stack, stack_end)) {
+               pr_debug("stack:          %p\n", (void *)stack);
+               addr = (unsigned long)(((unsigned long *)stack)[1]);
+               pr_debug("addr:           %p\n", (void *)addr);
+               if (!skip)
+                       trace->entries[trace->nr_entries++] = addr-1;
+               else
+                       skip--;
+               if (trace->nr_entries >= trace->max_entries)
+                       break;
+               if (!addr)
+                       return 0;
+               /*
+                * Stack frames must go forwards (otherwise a loop could
+                * happen if the stackframe is corrupted), so we move
+                * prev_stack forwards:
+                */
+               prev_stack = stack;
+               stack = (unsigned long)(((unsigned long *)stack)[0]);
+       }
+       pr_debug("invalid:        %p\n", (void *)stack);
+#else
+       while (stack < stack_end) {
+               addr = ((unsigned long *)stack)[0];
+               stack += sizeof(long);
+               if (__kernel_text_address(addr)) {
+                       if (!skip)
+                               trace->entries[trace->nr_entries++] = addr-1;
+                       else
+                               skip--;
+                       if (trace->nr_entries >= trace->max_entries)
+                               break;
+               }
+       }
+#endif
+       return stack;
+}
+
+#define MAX_STACKS 10
+
+/*
+ * Save stack-backtrace addresses into a stack_trace buffer.
+ * If all_contexts is set, all contexts (hardirq, softirq and process)
+ * are saved. If not set then only the current context is saved.
+ */
+void save_stack_trace(struct stack_trace *trace,
+                     struct task_struct *task, int all_contexts,
+                     unsigned int skip)
+{
+       unsigned long stack = (unsigned long)&stack;
+       int i, nr_stacks = 0, stacks_done[MAX_STACKS];
+
+       WARN_ON(trace->nr_entries || !trace->max_entries);
+
+       if (!task)
+               task = current;
+
+       pr_debug("task: %p, ti: %p\n", task, task->thread_info);
+
+       if (!task || task == current) {
+               /* Grab rbp right from our regs: */
+               asm ("mov %%rbp, %0" : "=r" (stack));
+               pr_debug("rbp:            %p\n", (void *)stack);
+       } else {
+               /* rbp is the last reg pushed by switch_to(): */
+               stack = task->thread.rsp;
+               pr_debug("other task rsp: %p\n", (void *)stack);
+               stack = (unsigned long)(((unsigned long *)stack)[0]);
+               pr_debug("other task rbp: %p\n", (void *)stack);
+       }
+
+       while (1) {
+               unsigned long stack_end = get_stack_end(task, stack);
+
+               pr_debug("stack:          %p\n", (void *)stack);
+               pr_debug("stack end:      %p\n", (void *)stack_end);
+
+               /*
+                * Invalid stack addres?
+                */
+               if (!stack_end)
+                       return;
+               /*
+                * Were we in this stack already? (recursion)
+                */
+               for (i = 0; i < nr_stacks; i++)
+                       if (stacks_done[i] == stack_end)
+                               return;
+               stacks_done[nr_stacks] = stack_end;
+
+               stack = save_context_stack(trace, skip, stack, stack_end);
+               if (!all_contexts || !stack ||
+                               trace->nr_entries >= trace->max_entries)
+                       return;
+               trace->entries[trace->nr_entries++] = ULONG_MAX;
+               if (trace->nr_entries >= trace->max_entries)
+                       return;
+               if (++nr_stacks >= MAX_STACKS)
+                       return;
+       }
+}
+
index ecbd34c1093d0a03109a9c99fe7c9c1c61cf646a..91f7e678bae72e7f5e951919633ff15d6f12451a 100644 (file)
@@ -7,7 +7,6 @@
  * Copyright (c) 2001 Patrick Mochel <mochel@osdl.org>
  */
 
-#include <linux/config.h>
 #include <linux/smp.h>
 #include <linux/suspend.h>
 #include <asm/proto.h>
index 7c176b3edde00daab10dfaed6d954d7412d9541d..213fd6ab789d5954f5bbf3bc738745df36f8c6eb 100644 (file)
@@ -3,7 +3,6 @@
 #include <linux/linkage.h>
 #include <linux/sys.h>
 #include <linux/cache.h>
-#include <linux/config.h>
 
 #define __NO_STUBS
 
index ebbee6f59ff5f5c390b13085f9cf2f8b8fad6fc2..b9ff75992c16d85b8fd1c7b7a2118c7d6847087b 100644 (file)
@@ -889,7 +889,7 @@ int __init time_setup(char *str)
 }
 
 static struct irqaction irq0 = {
-       timer_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "timer", NULL, NULL
+       timer_interrupt, IRQF_DISABLED, CPU_MASK_NONE, "timer", NULL, NULL
 };
 
 void __init time_init(void)
index 3d11a2fe45b7e0308986e2fdf144ef8fdef977c5..79d05c4820720f492578c8cb0f1b6ef1feb8f21d 100644 (file)
@@ -12,7 +12,6 @@
  * 'Traps.c' handles hardware traps and faults after we have saved some
  * state in 'entry.S'.
  */
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
@@ -111,28 +110,31 @@ static int kstack_depth_to_print = 12;
 static int call_trace = 1;
 
 #ifdef CONFIG_KALLSYMS
-#include <linux/kallsyms.h> 
-int printk_address(unsigned long address)
-{ 
+# include <linux/kallsyms.h>
+void printk_address(unsigned long address)
+{
        unsigned long offset = 0, symsize;
        const char *symname;
        char *modname;
-       char *delim = ":"; 
+       char *delim = ":";
        char namebuf[128];
 
-       symname = kallsyms_lookup(address, &symsize, &offset, &modname, namebuf); 
-       if (!symname) 
-               return printk("[<%016lx>]", address);
-       if (!modname) 
+       symname = kallsyms_lookup(address, &symsize, &offset,
+                                       &modname, namebuf);
+       if (!symname) {
+               printk(" [<%016lx>]\n", address);
+               return;
+       }
+       if (!modname)
                modname = delim = "";           
-        return printk("<%016lx>{%s%s%s%s%+ld}",
-                     address, delim, modname, delim, symname, offset); 
-} 
+       printk(" [<%016lx>] %s%s%s%s+0x%lx/0x%lx\n",
+               address, delim, modname, delim, symname, offset, symsize);
+}
 #else
-int printk_address(unsigned long address)
-{ 
-       return printk("[<%016lx>]", address);
-} 
+void printk_address(unsigned long address)
+{
+       printk(" [<%016lx>]\n", address);
+}
 #endif
 
 static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
@@ -150,10 +152,22 @@ static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
        };
        unsigned k;
 
+       /*
+        * Iterate over all exception stacks, and figure out whether
+        * 'stack' is in one of them:
+        */
        for (k = 0; k < N_EXCEPTION_STACKS; k++) {
                unsigned long end;
 
+               /*
+                * set 'end' to the end of the exception stack.
+                */
                switch (k + 1) {
+               /*
+                * TODO: this block is not needed i think, because
+                * setup64.c:cpu_init() sets up t->ist[DEBUG_STACK]
+                * properly too.
+                */
 #if DEBUG_STKSZ > EXCEPTION_STKSZ
                case DEBUG_STACK:
                        end = cpu_pda(cpu)->debugstack + DEBUG_STKSZ;
@@ -163,19 +177,43 @@ static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
                        end = per_cpu(init_tss, cpu).ist[k];
                        break;
                }
+               /*
+                * Is 'stack' above this exception frame's end?
+                * If yes then skip to the next frame.
+                */
                if (stack >= end)
                        continue;
+               /*
+                * Is 'stack' above this exception frame's start address?
+                * If yes then we found the right frame.
+                */
                if (stack >= end - EXCEPTION_STKSZ) {
+                       /*
+                        * Make sure we only iterate through an exception
+                        * stack once. If it comes up for the second time
+                        * then there's something wrong going on - just
+                        * break out and return NULL:
+                        */
                        if (*usedp & (1U << k))
                                break;
                        *usedp |= 1U << k;
                        *idp = ids[k];
                        return (unsigned long *)end;
                }
+               /*
+                * If this is a debug stack, and if it has a larger size than
+                * the usual exception stacks, then 'stack' might still
+                * be within the lower portion of the debug stack:
+                */
 #if DEBUG_STKSZ > EXCEPTION_STKSZ
                if (k == DEBUG_STACK - 1 && stack >= end - DEBUG_STKSZ) {
                        unsigned j = N_EXCEPTION_STACKS - 1;
 
+                       /*
+                        * Black magic. A large debug stack is composed of
+                        * multiple exception stack entries, which we
+                        * iterate through now. Dont look:
+                        */
                        do {
                                ++j;
                                end -= EXCEPTION_STKSZ;
@@ -194,20 +232,14 @@ static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
 
 static int show_trace_unwind(struct unwind_frame_info *info, void *context)
 {
-       int i = 11, n = 0;
+       int n = 0;
 
        while (unwind(info) == 0 && UNW_PC(info)) {
-               ++n;
-               if (i > 50) {
-                       printk("\n       ");
-                       i = 7;
-               } else
-                       i += printk(" ");
-               i += printk_address(UNW_PC(info));
+               n++;
+               printk_address(UNW_PC(info));
                if (arch_unw_user_mode(info))
                        break;
        }
-       printk("\n");
        return n;
 }
 
@@ -225,7 +257,7 @@ void show_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long * s
        int i = 11;
        unsigned used = 0;
 
-       printk("\nCall Trace:");
+       printk("\nCall Trace:\n");
 
        if (!tsk)
                tsk = current;
@@ -251,16 +283,15 @@ void show_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long * s
                }
        }
 
+       /*
+        * Print function call entries within a stack. 'cond' is the
+        * "end of stackframe" condition, that the 'stack++'
+        * iteration will eventually trigger.
+        */
 #define HANDLE_STACK(cond) \
        do while (cond) { \
                unsigned long addr = *stack++; \
                if (kernel_text_address(addr)) { \
-                       if (i > 50) { \
-                               printk("\n       "); \
-                               i = 0; \
-                       } \
-                       else \
-                               i += printk(" "); \
                        /* \
                         * If the address is either in the text segment of the \
                         * kernel, or in the region which contains vmalloc'ed \
@@ -269,20 +300,30 @@ void show_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long * s
                         * down the cause of the crash will be able to figure \
                         * out the call path that was taken. \
                         */ \
-                       i += printk_address(addr); \
+                       printk_address(addr); \
                } \
        } while (0)
 
-       for(; ; ) {
+       /*
+        * Print function call entries in all stacks, starting at the
+        * current stack address. If the stacks consist of nested
+        * exceptions
+        */
+       for ( ; ; ) {
                const char *id;
                unsigned long *estack_end;
                estack_end = in_exception_stack(cpu, (unsigned long)stack,
                                                &used, &id);
 
                if (estack_end) {
-                       i += printk(" <%s>", id);
+                       printk(" <%s>", id);
                        HANDLE_STACK (stack < estack_end);
-                       i += printk(" <EOE>");
+                       printk(" <EOE>");
+                       /*
+                        * We link to the next stack via the
+                        * second-to-last pointer (index -2 to end) in the
+                        * exception stack:
+                        */
                        stack = (unsigned long *) estack_end[-2];
                        continue;
                }
@@ -292,19 +333,28 @@ void show_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long * s
                                (IRQSTACKSIZE - 64) / sizeof(*irqstack);
 
                        if (stack >= irqstack && stack < irqstack_end) {
-                               i += printk(" <IRQ>");
+                               printk(" <IRQ>");
                                HANDLE_STACK (stack < irqstack_end);
+                               /*
+                                * We link to the next stack (which would be
+                                * the process stack normally) the last
+                                * pointer (index -1 to end) in the IRQ stack:
+                                */
                                stack = (unsigned long *) (irqstack_end[-1]);
                                irqstack_end = NULL;
-                               i += printk(" <EOI>");
+                               printk(" <EOI>");
                                continue;
                        }
                }
                break;
        }
 
+       /*
+        * This prints the process stack:
+        */
        HANDLE_STACK (((long) stack & (THREAD_SIZE-1)) != 0);
 #undef HANDLE_STACK
+
        printk("\n");
 }
 
@@ -338,8 +388,8 @@ static void _show_stack(struct task_struct *tsk, struct pt_regs *regs, unsigned
                        break;
                }
                if (i && ((i % 4) == 0))
-                       printk("\n       ");
-               printk("%016lx ", *stack++);
+                       printk("\n");
+               printk(" %016lx", *stack++);
                touch_nmi_watchdog();
        }
        show_trace(tsk, regs, rsp);
index 1c6a5f32291920d33954a81cc0c3089a28a56bdd..7c4de31471d40ab2bd09ac04b79b83cb9ad6bead 100644 (file)
@@ -6,7 +6,6 @@
 
 #include <asm-generic/vmlinux.lds.h>
 #include <asm/page.h>
-#include <linux/config.h>
 
 #undef i386    /* in case the preprocessor is a 32bit one */
 
index e49af0032e9401c1cfa997772cf2b4726beb5d7e..332ea5dff9169627475dbc90f54b4ced9c36d179 100644 (file)
        thunk_retrax __down_failed_interruptible,__down_interruptible
        thunk_retrax __down_failed_trylock,__down_trylock
        thunk __up_wakeup,__up
+
+#ifdef CONFIG_TRACE_IRQFLAGS
+       thunk trace_hardirqs_on_thunk,trace_hardirqs_on
+       thunk trace_hardirqs_off_thunk,trace_hardirqs_off
+#endif
        
        /* SAVE_ARGS below is used only for the .cfi directives it contains. */
        CFI_STARTPROC
index 2d78f9fb403542b72771075502c4c662cc06ca35..79ac6e7100af32675ee00c1177a622e9af583548 100644 (file)
@@ -2,7 +2,6 @@
  * linux/arch/x86_64/mm/extable.c
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #include <linux/init.h>
index 08dc696f54ee4543fe4aff4cf551f1f7253e2da3..ac8ea66ccb94365e4f1b2e03d18e3bdf3ae5f5e0 100644 (file)
@@ -5,7 +5,6 @@
  *  Copyright (C) 2001,2002 Andi Kleen, SuSE Labs.
  */
 
-#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
@@ -418,7 +417,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
        /* When running in the kernel we expect faults to occur only to
         * addresses in user space.  All other faults represent errors in the
         * kernel and should generate an OOPS.  Unfortunatly, in the case of an
-        * erroneous fault occuring in a code path which already holds mmap_sem
+        * erroneous fault occurring in a code path which already holds mmap_sem
         * we will deadlock attempting to validate the fault against the
         * address space.  Luckily the kernel only validly references user
         * space from well defined areas of code, which are listed in the
@@ -571,7 +570,6 @@ no_context:
                printk(KERN_ALERT "Unable to handle kernel paging request");
        printk(" at %016lx RIP: \n" KERN_ALERT,address);
        printk_address(regs->rip);
-       printk("\n");
        dump_pagetable(address);
        tsk->thread.cr2 = address;
        tsk->thread.trap_no = 14;
index 95bd232ff0cf3d37fc3b5838e0b477666115aebb..d14fb2dfbfc4a742b399882482a877b9c2db9428 100644 (file)
@@ -6,7 +6,6 @@
  *  Copyright (C) 2002,2003 Andi Kleen <ak@suse.de>
  */
 
-#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
@@ -679,16 +678,15 @@ void free_initmem(void)
 
 #ifdef CONFIG_DEBUG_RODATA
 
-extern char __start_rodata, __end_rodata;
 void mark_rodata_ro(void)
 {
-       unsigned long addr = (unsigned long)&__start_rodata;
+       unsigned long addr = (unsigned long)__start_rodata;
 
-       for (; addr < (unsigned long)&__end_rodata; addr += PAGE_SIZE)
+       for (; addr < (unsigned long)__end_rodata; addr += PAGE_SIZE)
                change_page_attr_addr(addr, 1, PAGE_KERNEL_RO);
 
        printk ("Write protecting the kernel read-only data: %luk\n",
-                       (&__end_rodata - &__start_rodata) >> 10);
+                       (__end_rodata - __start_rodata) >> 10);
 
        /*
         * change_page_attr_addr() requires a global_flush_tlb() call after it.
index 43e9b99bdf25d6419afce6e81bab3c361e5f174d..80bba0dc000e8e8fc6a09a72b43043e156cf4bcc 100644 (file)
@@ -1,7 +1,6 @@
 /* Copyright 2005 Andi Kleen, SuSE Labs.
  * Licensed under GPL, v.2
  */
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/sched.h>
 #include <linux/random.h>
index 531ad21447b1c95e4e5a9d9bc020f13784b01d7f..2685b1f3671c4f9fea8acdd8c1fcf42507b8d8e4 100644 (file)
@@ -3,7 +3,6 @@
  * Thanks to Ben LaHaise for precious feedback.
  */ 
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/sched.h>
 #include <linux/highmem.h>
index 7cba94abdab82a4274bee2e7fe74f2327fc48e9d..f857fc760aa87003102d54b50606a30395e2b7e9 100644 (file)
@@ -2,7 +2,6 @@
 #include <xtensa/config/specreg.h>
 #include <xtensa/config/core.h>
 
-#include <linux/config.h>
 #include <asm/bootparam.h>
 
 
index 356192a4d39d07c42966188a73c299cbb32e7ebc..cf5a93fb6a2e5ddc37071985f0dec68651c508f6 100644 (file)
@@ -24,7 +24,6 @@
  * assigned when the Xtensa processor is generated.
  */
 
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/processor.h>
 
index 6e9b5225b8f665da51a394c7dffb2d0784a0b6b9..c07cb25229931b1198895c291947c59c8ce3e4e9 100644 (file)
@@ -16,7 +16,6 @@
  */
 
 #include <xtensa/cacheasm.h>
-#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/page.h>
 
index eda029fc897218a53d38a4f82a66db0a42272963..8709f8249d028d1109dcccfb10cfdecd89225f51 100644 (file)
@@ -17,7 +17,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
index a17930747f204046e7d0456d6382b485fa2c2dc6..69675f216062b5d00d343050e4fd1c5a22eea84c 100644 (file)
@@ -12,7 +12,6 @@
  * Chris Zankel <chris@zankel.net>
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/pci.h>
 #include <linux/time.h>
index 64a649eb883f2d4261ade0f4465549bad64d00fc..a7c4178c2a8c2a126bc689a0408df9a5f92d3edf 100644 (file)
@@ -16,7 +16,6 @@
  * Kevin Chea
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index 4cc85285a70ac7324bb232f4d42274a944ebcaa7..5064d9383963282433ab4109fcc89eba2c6ccfad 100644 (file)
@@ -13,7 +13,6 @@
  * Marc Gauthier<marc@tensilica.com> <marc@alumni.uwaterloo.ca>
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
index 513ed8d67766932305ca6cdef97f59fc8724f034..edb29410d9530b791816ef129337c9b0f510cf54 100644 (file)
@@ -14,7 +14,6 @@
  * Marc Gauthier<marc@tensilica.com> <marc@alumni.uwaterloo.ca>
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/proc_fs.h>
index f20c6494c5180c09d333b1ca1f9ddf903b8bfb06..4688ba2db84d5c46c8ae060bec50fe891454bf4b 100644 (file)
@@ -18,7 +18,6 @@
 
 #define DEBUG  0
 
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
index fe14909f45e057983c1100c5dab33359d718d7c6..412ab32de391788de830fe5786adffe2ac3ca854 100644 (file)
@@ -12,7 +12,6 @@
  * Chris Zankel <chris@zankel.net>
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/time.h>
 #include <linux/timex.h>
@@ -53,7 +52,7 @@ unsigned long long sched_clock(void)
 static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 static struct irqaction timer_irqaction = {
        .handler =      timer_interrupt,
-       .flags =        SA_INTERRUPT,
+       .flags =        IRQF_DISABLED,
        .name =         "timer",
 };
 
index 5ed71dfc81105c5ecf2836db2e34b8884dcf4a1c..ab6cdbd5eb684ab9eb0f78b2bda2fff08c6a7a2b 100644 (file)
@@ -16,7 +16,6 @@
 
 #include <asm-generic/vmlinux.lds.h>
 
-#include <linux/config.h>
 #define _NOCLANGUAGE
 #include <xtensa/config/core.h>
 #include <xtensa/config/system.h>
index a15b6e3e72c86d2d097baf57cd664b23d0303a84..0b4cb93db5a3b070ca022990bd3a6dce9b31fc1b 100644 (file)
@@ -12,7 +12,6 @@
  * Joe Taylor <joe@tensilica.com>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/mm.h>
index e1be4235f3671a256ba89be01b45c9c4ff8c6a0a..660ef058c14944d133abff3ac49e663445367b42 100644 (file)
@@ -15,7 +15,6 @@
  * Kevin Chea
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
index 2a580efb58ecab0425827934802c01565dfeacb4..22d3c571a7bc70c8927b19cd17ec19990185a3e3 100644 (file)
@@ -10,7 +10,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/console.h>
index 0dc55cc8691bf1cd3917daa10ec38d1f38109a56..d96164e602fea496c7b33b35d4e685261eef7647 100644 (file)
@@ -16,7 +16,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/list.h>
 #include <linux/irq.h>
 #include <linux/spinlock.h>
index 23790a5610e2ac2b0bd436bc299a69d9b18c46d3..c8a42b60c57af50f5838c8ae09969b2fd76e77c5 100644 (file)
@@ -15,7 +15,6 @@
  * option) any later version.
  *
  */
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 3af31ed49a9c250518e73a5f95818d725c22c409..5da56d48fbd36473ba92fb346a91d06dbea148a1 100644 (file)
@@ -10,7 +10,6 @@
 #include <linux/blkdev.h>
 #include <linux/elevator.h>
 #include <linux/bio.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/init.h>
index 36f3a172275f89fbd1dca4692164cdca0127eced..92925e7d9e6cb98af23ac11f6b1dfc1d3f4244f9 100644 (file)
@@ -15,7 +15,6 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  *
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/blkdev.h>
 #include <linux/blktrace_api.h>
index e25223e147a2a5e336a1a430dde49b3e43f00283..102ebc2c5c34c73f8e7f76c589559ddfde0d9885 100644 (file)
@@ -6,7 +6,6 @@
  *
  *  Copyright (C) 2003 Jens Axboe <axboe@suse.de>
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/blkdev.h>
 #include <linux/elevator.h>
index 4469dd84623cc645b641dce21caaa3fddd270227..c7ca9f0b64989cdda8a16a56593fd52f2a251470 100644 (file)
@@ -8,7 +8,6 @@
 #include <linux/blkdev.h>
 #include <linux/elevator.h>
 #include <linux/bio.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/init.h>
index d00b283f31d21fdb5256754b75336e1005fb7eed..bc7baeec0d102014c07ec7308d54dbc2161e4ba9 100644 (file)
@@ -27,7 +27,6 @@
 #include <linux/blkdev.h>
 #include <linux/elevator.h>
 #include <linux/bio.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/init.h>
index 8d7339511e5e962dfccca43298a06e24a48df846..25d1f42568cc19714a2f8a5469ecd2842e9ea7e5 100644 (file)
@@ -2,7 +2,6 @@
  *  gendisk handling
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/genhd.h>
index eee03a3876a3f2f875260b64c1c0bc51267219a3..ab17c7224bb67677325196c2dd2724aa55508619 100644 (file)
@@ -10,7 +10,6 @@
 /*
  * This handles all read/write requests to block devices
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/backing-dev.h>
@@ -2517,7 +2516,7 @@ EXPORT_SYMBOL_GPL(blk_execute_rq_nowait);
 int blk_execute_rq(request_queue_t *q, struct gendisk *bd_disk,
                   struct request *rq, int at_head)
 {
-       DECLARE_COMPLETION(wait);
+       DECLARE_COMPLETION_ONSTACK(wait);
        char sense[SCSI_SENSE_BUFFERSIZE];
        int err = 0;
 
@@ -3117,9 +3116,9 @@ void submit_bio(int rw, struct bio *bio)
        BIO_BUG_ON(!bio->bi_io_vec);
        bio->bi_rw |= rw;
        if (rw & WRITE)
-               mod_page_state(pgpgout, count);
+               count_vm_events(PGPGOUT, count);
        else
-               mod_page_state(pgpgin, count);
+               count_vm_events(PGPGIN, count);
 
        if (unlikely(block_dump)) {
                char b[BDEVNAME_SIZE];
index 073add35e66f3c5208a1f5989bf9fc3633888077..a0ff25ea439f2c630033ad48d8b7f5ef1918c5c1 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 menu "Acorn-specific block devices"
-       depends on ARCH_ACORN
+       depends on ARCH_ARC || ARCH_A5K
 
 config BLK_DEV_FD1772
        tristate "Old Archimedes floppy (1772) support"
index ce074f6f3369c338e16828fde64f0864cc8a00d2..3dd6b7bb5d35937e1cfa3082e3e612c9c95ca9e4 100644 (file)
@@ -99,7 +99,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/fs.h>
 #include <linux/interrupt.h>
@@ -1279,7 +1278,7 @@ static int mfm_do_init(unsigned char irqmask)
 
        printk("mfm: detected %d hard drive%s\n", mfm_drives,
                                mfm_drives == 1 ? "" : "s");
-       ret = request_irq(mfm_irq, mfm_interrupt_handler, SA_INTERRUPT, "MFM harddisk", NULL);
+       ret = request_irq(mfm_irq, mfm_interrupt_handler, IRQF_DISABLED, "MFM harddisk", NULL);
        if (ret) {
                printk("mfm: unable to get IRQ%d\n", mfm_irq);
                goto out4;
index 610d2cc02cf8f500e8eed0158df3f3967cb520cf..fef7bab122447c5d18d437716eee3a61ce1f233e 100644 (file)
@@ -133,6 +133,13 @@ config ACPI_FAN
          This driver adds support for ACPI fan devices, allowing user-mode 
          applications to perform basic fan control (on, off, status).
 
+config ACPI_DOCK
+       tristate "Dock"
+       depends on !ACPI_IBM_DOCK
+       default y
+       help
+         This driver adds support for ACPI controlled docking stations
+
 config ACPI_PROCESSOR
        tristate "Processor"
        default y
@@ -345,6 +352,18 @@ config ACPI_HOTPLUG_MEMORY
          If one selects "m," this driver can be loaded using the following
          command: 
                $>modprobe acpi_memhotplug 
+
+config ACPI_SBS
+       tristate "Smart Battery System (EXPERIMENTAL)"
+       depends on X86 && I2C
+       depends on EXPERIMENTAL
+       default y
+       help
+         This driver adds support for the Smart Battery System.
+         Depends on I2C (Device Drivers ---> I2C support)
+         A "Smart Battery" is quite old and quite rare compared
+         to today's ACPI "Control Method" battery.
+
 endif  # ACPI
 
 endmenu
index 5984b4f6715a95064e72d53938a4f8681bbb5714..bce7ca27b429e2874eb4e78a229dd65871070d6c 100644 (file)
@@ -42,6 +42,7 @@ obj-$(CONFIG_ACPI_BATTERY)    += battery.o
 obj-$(CONFIG_ACPI_BUTTON)      += button.o
 obj-$(CONFIG_ACPI_EC)          += ec.o
 obj-$(CONFIG_ACPI_FAN)         += fan.o
+obj-$(CONFIG_ACPI_DOCK)                += dock.o
 obj-$(CONFIG_ACPI_VIDEO)       += video.o 
 obj-$(CONFIG_ACPI_HOTKEY)      += hotkey.o
 obj-y                          += pci_root.o pci_link.o pci_irq.o pci_bind.o
@@ -57,3 +58,5 @@ obj-$(CONFIG_ACPI_IBM)                += ibm_acpi.o
 obj-$(CONFIG_ACPI_TOSHIBA)     += toshiba_acpi.o
 obj-y                          += scan.o motherboard.o
 obj-$(CONFIG_ACPI_HOTPLUG_MEMORY)      += acpi_memhotplug.o
+obj-y                          += cm_sbs.o
+obj-$(CONFIG_ACPI_SBS)         += i2c_ec.o sbs.o
index 7839b831df94eea57c14a25fc17a310be29982b3..24ccf81d135f9d1ccf440b426277b7d7a36ec71c 100644 (file)
@@ -50,6 +50,9 @@ ACPI_MODULE_NAME("acpi_ac")
 MODULE_DESCRIPTION(ACPI_AC_DRIVER_NAME);
 MODULE_LICENSE("GPL");
 
+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_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);
@@ -65,7 +68,7 @@ static struct acpi_driver acpi_ac_driver = {
 };
 
 struct acpi_ac {
-       acpi_handle handle;
+       struct acpi_device * device;
        unsigned long state;
 };
 
@@ -84,20 +87,18 @@ static int acpi_ac_get_state(struct acpi_ac *ac)
 {
        acpi_status status = AE_OK;
 
-       ACPI_FUNCTION_TRACE("acpi_ac_get_state");
 
        if (!ac)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
-       status = acpi_evaluate_integer(ac->handle, "_PSR", NULL, &ac->state);
+       status = acpi_evaluate_integer(ac->device->handle, "_PSR", NULL, &ac->state);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Error reading AC Adapter state\n"));
+               ACPI_EXCEPTION((AE_INFO, status, "Error reading AC Adapter state"));
                ac->state = ACPI_AC_STATUS_UNKNOWN;
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 /* --------------------------------------------------------------------------
@@ -110,14 +111,13 @@ static int acpi_ac_seq_show(struct seq_file *seq, void *offset)
 {
        struct acpi_ac *ac = (struct acpi_ac *)seq->private;
 
-       ACPI_FUNCTION_TRACE("acpi_ac_seq_show");
 
        if (!ac)
-               return_VALUE(0);
+               return 0;
 
        if (acpi_ac_get_state(ac)) {
                seq_puts(seq, "ERROR: Unable to read AC Adapter state\n");
-               return_VALUE(0);
+               return 0;
        }
 
        seq_puts(seq, "state:                   ");
@@ -133,7 +133,7 @@ static int acpi_ac_seq_show(struct seq_file *seq, void *offset)
                break;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_ac_open_fs(struct inode *inode, struct file *file)
@@ -145,13 +145,12 @@ static int acpi_ac_add_fs(struct acpi_device *device)
 {
        struct proc_dir_entry *entry = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_ac_add_fs");
 
        if (!acpi_device_dir(device)) {
                acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
                                                     acpi_ac_dir);
                if (!acpi_device_dir(device))
-                       return_VALUE(-ENODEV);
+                       return -ENODEV;
                acpi_device_dir(device)->owner = THIS_MODULE;
        }
 
@@ -159,21 +158,18 @@ static int acpi_ac_add_fs(struct acpi_device *device)
        entry = create_proc_entry(ACPI_AC_FILE_STATE,
                                  S_IRUGO, acpi_device_dir(device));
        if (!entry)
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to create '%s' fs entry\n",
-                                 ACPI_AC_FILE_STATE));
+               return -ENODEV;
        else {
                entry->proc_fops = &acpi_ac_fops;
                entry->data = acpi_driver_data(device);
                entry->owner = THIS_MODULE;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_ac_remove_fs(struct acpi_device *device)
 {
-       ACPI_FUNCTION_TRACE("acpi_ac_remove_fs");
 
        if (acpi_device_dir(device)) {
                remove_proc_entry(ACPI_AC_FILE_STATE, acpi_device_dir(device));
@@ -182,7 +178,7 @@ static int acpi_ac_remove_fs(struct acpi_device *device)
                acpi_device_dir(device) = NULL;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 /* --------------------------------------------------------------------------
@@ -194,16 +190,15 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
        struct acpi_ac *ac = (struct acpi_ac *)data;
        struct acpi_device *device = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_ac_notify");
 
        if (!ac)
-               return_VOID;
-
-       if (acpi_bus_get_device(ac->handle, &device))
-               return_VOID;
+               return;
 
+       device = ac->device;
        switch (event) {
        case ACPI_AC_NOTIFY_STATUS:
+       case ACPI_NOTIFY_BUS_CHECK:
+       case ACPI_NOTIFY_DEVICE_CHECK:
                acpi_ac_get_state(ac);
                acpi_bus_generate_event(device, event, (u32) ac->state);
                break;
@@ -213,7 +208,7 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
                break;
        }
 
-       return_VOID;
+       return;
 }
 
 static int acpi_ac_add(struct acpi_device *device)
@@ -222,17 +217,16 @@ static int acpi_ac_add(struct acpi_device *device)
        acpi_status status = AE_OK;
        struct acpi_ac *ac = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_ac_add");
 
        if (!device)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        ac = kmalloc(sizeof(struct acpi_ac), GFP_KERNEL);
        if (!ac)
-               return_VALUE(-ENOMEM);
+               return -ENOMEM;
        memset(ac, 0, sizeof(struct acpi_ac));
 
-       ac->handle = device->handle;
+       ac->device = device;
        strcpy(acpi_device_name(device), ACPI_AC_DEVICE_NAME);
        strcpy(acpi_device_class(device), ACPI_AC_CLASS);
        acpi_driver_data(device) = ac;
@@ -245,12 +239,10 @@ static int acpi_ac_add(struct acpi_device *device)
        if (result)
                goto end;
 
-       status = acpi_install_notify_handler(ac->handle,
-                                            ACPI_DEVICE_NOTIFY, acpi_ac_notify,
+       status = acpi_install_notify_handler(device->handle,
+                                            ACPI_ALL_NOTIFY, acpi_ac_notify,
                                             ac);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Error installing notify handler\n"));
                result = -ENODEV;
                goto end;
        }
@@ -265,7 +257,7 @@ static int acpi_ac_add(struct acpi_device *device)
                kfree(ac);
        }
 
-       return_VALUE(result);
+       return result;
 }
 
 static int acpi_ac_remove(struct acpi_device *device, int type)
@@ -273,55 +265,48 @@ static int acpi_ac_remove(struct acpi_device *device, int type)
        acpi_status status = AE_OK;
        struct acpi_ac *ac = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_ac_remove");
 
        if (!device || !acpi_driver_data(device))
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        ac = (struct acpi_ac *)acpi_driver_data(device);
 
-       status = acpi_remove_notify_handler(ac->handle,
-                                           ACPI_DEVICE_NOTIFY, acpi_ac_notify);
-       if (ACPI_FAILURE(status))
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Error removing notify handler\n"));
+       status = acpi_remove_notify_handler(device->handle,
+                                           ACPI_ALL_NOTIFY, acpi_ac_notify);
 
        acpi_ac_remove_fs(device);
 
        kfree(ac);
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int __init acpi_ac_init(void)
 {
-       int result = 0;
+       int result;
 
-       ACPI_FUNCTION_TRACE("acpi_ac_init");
 
-       acpi_ac_dir = proc_mkdir(ACPI_AC_CLASS, acpi_root_dir);
+       acpi_ac_dir = acpi_lock_ac_dir();
        if (!acpi_ac_dir)
-               return_VALUE(-ENODEV);
-       acpi_ac_dir->owner = THIS_MODULE;
+               return -ENODEV;
 
        result = acpi_bus_register_driver(&acpi_ac_driver);
        if (result < 0) {
-               remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir);
-               return_VALUE(-ENODEV);
+               acpi_unlock_ac_dir(acpi_ac_dir);
+               return -ENODEV;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 static void __exit acpi_ac_exit(void)
 {
-       ACPI_FUNCTION_TRACE("acpi_ac_exit");
 
        acpi_bus_unregister_driver(&acpi_ac_driver);
 
-       remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir);
+       acpi_unlock_ac_dir(acpi_ac_dir);
 
-       return_VOID;
+       return;
 }
 
 module_init(acpi_ac_init);
index 1012284ff4f7eb4fc55d0ed1a3e200e7ef84b3a0..81e970adeab3b3cc6d5e47d32e69381693240943 100644 (file)
@@ -80,7 +80,7 @@ struct acpi_memory_info {
 };
 
 struct acpi_memory_device {
-       acpi_handle handle;
+       struct acpi_device * device;
        unsigned int state;     /* State of the memory device */
        struct list_head res_list;
 };
@@ -128,9 +128,8 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
        acpi_status status;
        struct acpi_memory_info *info, *n;
 
-       ACPI_FUNCTION_TRACE("acpi_memory_get_device_resources");
 
-       status = acpi_walk_resources(mem_device->handle, METHOD_NAME__CRS,
+       status = acpi_walk_resources(mem_device->device->handle, METHOD_NAME__CRS,
                                     acpi_memory_get_resource, mem_device);
        if (ACPI_FAILURE(status)) {
                list_for_each_entry_safe(info, n, &mem_device->res_list, list)
@@ -150,23 +149,21 @@ acpi_memory_get_device(acpi_handle handle,
        struct acpi_device *device = NULL;
        struct acpi_device *pdevice = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_memory_get_device");
 
        if (!acpi_bus_get_device(handle, &device) && device)
                goto end;
 
        status = acpi_get_parent(handle, &phandle);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error in acpi_get_parent\n"));
-               return_VALUE(-EINVAL);
+               ACPI_EXCEPTION((AE_INFO, status, "Cannot find acpi parent"));
+               return -EINVAL;
        }
 
        /* Get the parent device */
        status = acpi_bus_get_device(phandle, &pdevice);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Error in acpi_bus_get_device\n"));
-               return_VALUE(-EINVAL);
+               ACPI_EXCEPTION((AE_INFO, status, "Cannot get acpi bus device"));
+               return -EINVAL;
        }
 
        /*
@@ -175,30 +172,29 @@ acpi_memory_get_device(acpi_handle handle,
         */
        status = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error in acpi_bus_add\n"));
-               return_VALUE(-EINVAL);
+               ACPI_EXCEPTION((AE_INFO, status, "Cannot add acpi bus"));
+               return -EINVAL;
        }
 
       end:
        *mem_device = acpi_driver_data(device);
        if (!(*mem_device)) {
                printk(KERN_ERR "\n driver data not found");
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_memory_check_device(struct acpi_memory_device *mem_device)
 {
        unsigned long current_status;
 
-       ACPI_FUNCTION_TRACE("acpi_memory_check_device");
 
        /* Get device present/absent information from the _STA */
-       if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->handle, "_STA",
+       if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->device->handle, "_STA",
                                               NULL, &current_status)))
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        /*
         * Check for device status. Device should be
         * present/enabled/functioning.
@@ -206,9 +202,9 @@ static int acpi_memory_check_device(struct acpi_memory_device *mem_device)
        if (!((current_status & ACPI_MEMORY_STA_PRESENT)
              && (current_status & ACPI_MEMORY_STA_ENABLED)
              && (current_status & ACPI_MEMORY_STA_FUNCTIONAL)))
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
@@ -217,18 +213,16 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
        struct acpi_memory_info *info;
        int node;
 
-       ACPI_FUNCTION_TRACE("acpi_memory_enable_device");
 
        /* Get the range from the _CRS */
        result = acpi_memory_get_device_resources(mem_device);
        if (result) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "\nget_device_resources failed\n"));
+               printk(KERN_ERR PREFIX "get_device_resources failed\n");
                mem_device->state = MEMORY_INVALID_STATE;
                return result;
        }
 
-       node = acpi_get_node(mem_device->handle);
+       node = acpi_get_node(mem_device->device->handle);
        /*
         * Tell the VM there is more memory here...
         * Note: Assume that this function returns zero on success
@@ -254,7 +248,7 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
                num_enabled++;
        }
        if (!num_enabled) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "\nadd_memory failed\n"));
+               printk(KERN_ERR PREFIX "add_memory failed\n");
                mem_device->state = MEMORY_INVALID_STATE;
                return -EINVAL;
        }
@@ -269,32 +263,31 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
        union acpi_object arg;
        unsigned long current_status;
 
-       ACPI_FUNCTION_TRACE("acpi_memory_powerdown_device");
 
        /* Issue the _EJ0 command */
        arg_list.count = 1;
        arg_list.pointer = &arg;
        arg.type = ACPI_TYPE_INTEGER;
        arg.integer.value = 1;
-       status = acpi_evaluate_object(mem_device->handle,
+       status = acpi_evaluate_object(mem_device->device->handle,
                                      "_EJ0", &arg_list, NULL);
        /* Return on _EJ0 failure */
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "_EJ0 failed.\n"));
-               return_VALUE(-ENODEV);
+               ACPI_EXCEPTION((AE_INFO, status, "_EJ0 failed"));
+               return -ENODEV;
        }
 
        /* Evalute _STA to check if the device is disabled */
-       status = acpi_evaluate_integer(mem_device->handle, "_STA",
+       status = acpi_evaluate_integer(mem_device->device->handle, "_STA",
                                       NULL, &current_status);
        if (ACPI_FAILURE(status))
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        /* Check for device status.  Device should be disabled */
        if (current_status & ACPI_MEMORY_STA_ENABLED)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_memory_disable_device(struct acpi_memory_device *mem_device)
@@ -302,7 +295,6 @@ static int acpi_memory_disable_device(struct acpi_memory_device *mem_device)
        int result;
        struct acpi_memory_info *info, *n;
 
-       ACPI_FUNCTION_TRACE("acpi_memory_disable_device");
 
        /*
         * Ask the VM to offline this memory range.
@@ -320,8 +312,6 @@ static int acpi_memory_disable_device(struct acpi_memory_device *mem_device)
        /* Power-off and eject the device */
        result = acpi_memory_powerdown_device(mem_device);
        if (result) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Device Power Down failed.\n"));
                /* Set the status of the device to invalid */
                mem_device->state = MEMORY_INVALID_STATE;
                return result;
@@ -336,7 +326,6 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
        struct acpi_memory_device *mem_device;
        struct acpi_device *device;
 
-       ACPI_FUNCTION_TRACE("acpi_memory_device_notify");
 
        switch (event) {
        case ACPI_NOTIFY_BUS_CHECK:
@@ -348,15 +337,14 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
                        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                          "\nReceived DEVICE CHECK notification for device\n"));
                if (acpi_memory_get_device(handle, &mem_device)) {
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                         "Error in finding driver data\n"));
-                       return_VOID;
+                       printk(KERN_ERR PREFIX "Cannot find driver data\n");
+                       return;
                }
 
                if (!acpi_memory_check_device(mem_device)) {
                        if (acpi_memory_enable_device(mem_device))
-                               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                                 "Error in acpi_memory_enable_device\n"));
+                               printk(KERN_ERR PREFIX
+                                           "Cannot enable memory device\n");
                }
                break;
        case ACPI_NOTIFY_EJECT_REQUEST:
@@ -364,14 +352,12 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
                                  "\nReceived EJECT REQUEST notification for device\n"));
 
                if (acpi_bus_get_device(handle, &device)) {
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                         "Device doesn't exist\n"));
+                       printk(KERN_ERR PREFIX "Device doesn't exist\n");
                        break;
                }
                mem_device = acpi_driver_data(device);
                if (!mem_device) {
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                         "Driver Data is NULL\n"));
+                       printk(KERN_ERR PREFIX "Driver Data is NULL\n");
                        break;
                }
 
@@ -382,8 +368,8 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
                 *      with generic sysfs driver
                 */
                if (acpi_memory_disable_device(mem_device))
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                         "Error in acpi_memory_disable_device\n"));
+                       printk(KERN_ERR PREFIX
+                                   "Disable memory device\n");
                /*
                 * TBD: Invoke acpi_bus_remove to cleanup data structures
                 */
@@ -394,7 +380,7 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
                break;
        }
 
-       return_VOID;
+       return;
 }
 
 static int acpi_memory_device_add(struct acpi_device *device)
@@ -402,18 +388,17 @@ static int acpi_memory_device_add(struct acpi_device *device)
        int result;
        struct acpi_memory_device *mem_device = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_memory_device_add");
 
        if (!device)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        mem_device = kmalloc(sizeof(struct acpi_memory_device), GFP_KERNEL);
        if (!mem_device)
-               return_VALUE(-ENOMEM);
+               return -ENOMEM;
        memset(mem_device, 0, sizeof(struct acpi_memory_device));
 
        INIT_LIST_HEAD(&mem_device->res_list);
-       mem_device->handle = device->handle;
+       mem_device->device = device;
        sprintf(acpi_device_name(device), "%s", ACPI_MEMORY_DEVICE_NAME);
        sprintf(acpi_device_class(device), "%s", ACPI_MEMORY_DEVICE_CLASS);
        acpi_driver_data(device) = mem_device;
@@ -422,7 +407,7 @@ static int acpi_memory_device_add(struct acpi_device *device)
        result = acpi_memory_get_device_resources(mem_device);
        if (result) {
                kfree(mem_device);
-               return_VALUE(result);
+               return result;
        }
 
        /* Set the device state */
@@ -430,22 +415,21 @@ static int acpi_memory_device_add(struct acpi_device *device)
 
        printk(KERN_INFO "%s \n", acpi_device_name(device));
 
-       return_VALUE(result);
+       return result;
 }
 
 static int acpi_memory_device_remove(struct acpi_device *device, int type)
 {
        struct acpi_memory_device *mem_device = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_memory_device_remove");
 
        if (!device || !acpi_driver_data(device))
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        mem_device = (struct acpi_memory_device *)acpi_driver_data(device);
        kfree(mem_device);
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_memory_device_start (struct acpi_device *device)
@@ -453,8 +437,6 @@ static int acpi_memory_device_start (struct acpi_device *device)
        struct acpi_memory_device *mem_device;
        int result = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_memory_device_start");
-
        mem_device = acpi_driver_data(device);
 
        if (!acpi_memory_check_device(mem_device)) {
@@ -464,7 +446,7 @@ static int acpi_memory_device_start (struct acpi_device *device)
                        ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
                                "Error in acpi_memory_enable_device\n"));
        }
-       return_VALUE(result);
+       return result;
 }
 
 /*
@@ -477,16 +459,15 @@ static acpi_status is_memory_device(acpi_handle handle)
        struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
        struct acpi_device_info *info;
 
-       ACPI_FUNCTION_TRACE("is_memory_device");
 
        status = acpi_get_object_info(handle, &buffer);
        if (ACPI_FAILURE(status))
-               return_ACPI_STATUS(AE_ERROR);
+               return status;
 
        info = buffer.pointer;
        if (!(info->valid & ACPI_VALID_HID)) {
-               acpi_os_free(buffer.pointer);
-               return_ACPI_STATUS(AE_ERROR);
+               kfree(buffer.pointer);
+               return AE_ERROR;
        }
 
        hardware_id = info->hardware_id.value;
@@ -494,8 +475,8 @@ static acpi_status is_memory_device(acpi_handle handle)
            (strcmp(hardware_id, ACPI_MEMORY_DEVICE_HID)))
                status = AE_ERROR;
 
-       acpi_os_free(buffer.pointer);
-       return_ACPI_STATUS(status);
+       kfree(buffer.pointer);
+       return status;
 }
 
 static acpi_status
@@ -504,21 +485,17 @@ acpi_memory_register_notify_handler(acpi_handle handle,
 {
        acpi_status status;
 
-       ACPI_FUNCTION_TRACE("acpi_memory_register_notify_handler");
 
        status = is_memory_device(handle);
-       if (ACPI_FAILURE(status))
-               return_ACPI_STATUS(AE_OK);      /* continue */
+       if (ACPI_FAILURE(status)){
+               ACPI_EXCEPTION((AE_INFO, status, "handle is no memory device"));
+               return AE_OK;   /* continue */
+       }
 
        status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
                                             acpi_memory_device_notify, NULL);
-       if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Error installing notify handler\n"));
-               return_ACPI_STATUS(AE_OK);      /* continue */
-       }
-
-       return_ACPI_STATUS(status);
+       /* continue */
+       return AE_OK;
 }
 
 static acpi_status
@@ -527,22 +504,18 @@ acpi_memory_deregister_notify_handler(acpi_handle handle,
 {
        acpi_status status;
 
-       ACPI_FUNCTION_TRACE("acpi_memory_deregister_notify_handler");
 
        status = is_memory_device(handle);
-       if (ACPI_FAILURE(status))
-               return_ACPI_STATUS(AE_OK);      /* continue */
+       if (ACPI_FAILURE(status)){
+               ACPI_EXCEPTION((AE_INFO, status, "handle is no memory device"));
+               return AE_OK;   /* continue */
+       }
 
        status = acpi_remove_notify_handler(handle,
                                            ACPI_SYSTEM_NOTIFY,
                                            acpi_memory_device_notify);
-       if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Error removing notify handler\n"));
-               return_ACPI_STATUS(AE_OK);      /* continue */
-       }
 
-       return_ACPI_STATUS(status);
+       return AE_OK;   /* continue */
 }
 
 static int __init acpi_memory_device_init(void)
@@ -550,12 +523,11 @@ static int __init acpi_memory_device_init(void)
        int result;
        acpi_status status;
 
-       ACPI_FUNCTION_TRACE("acpi_memory_device_init");
 
        result = acpi_bus_register_driver(&acpi_memory_device_driver);
 
        if (result < 0)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        status = acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
                                     ACPI_UINT32_MAX,
@@ -563,19 +535,18 @@ static int __init acpi_memory_device_init(void)
                                     NULL, NULL);
 
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "walk_namespace failed\n"));
+               ACPI_EXCEPTION((AE_INFO, status, "walk_namespace failed"));
                acpi_bus_unregister_driver(&acpi_memory_device_driver);
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 static void __exit acpi_memory_device_exit(void)
 {
        acpi_status status;
 
-       ACPI_FUNCTION_TRACE("acpi_memory_device_exit");
 
        /*
         * Adding this to un-install notification handlers for all the device
@@ -587,11 +558,11 @@ static void __exit acpi_memory_device_exit(void)
                                     NULL, NULL);
 
        if (ACPI_FAILURE(status))
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "walk_namespace failed\n"));
+               ACPI_EXCEPTION((AE_INFO, status, "walk_namespace failed"));
 
        acpi_bus_unregister_driver(&acpi_memory_device_driver);
 
-       return_VOID;
+       return;
 }
 
 module_init(acpi_memory_device_init);
index 839f423d738d8618f8bc444b5707c672f833a5ac..e9ee4c52a5f6266a7edc5df20d80aad2647338ea 100644 (file)
@@ -2,7 +2,7 @@
  *  asus_acpi.c - Asus Laptop ACPI Extras
  *
  *
- *  Copyright (C) 2002, 2003, 2004 Julien Lerouge, Karol Kozimor
+ *  Copyright (C) 2002-2005 Julien Lerouge, 2003-2006 Karol Kozimor
  *
  *  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
  *  Pontus Fuchs   - Helper functions, cleanup
  *  Johann Wiesner - Small compile fixes
  *  John Belmonte  - ACPI code for Toshiba laptop was a good starting point.
+ *  Ã‰ric Burghard  - LED display support for W1N
  *
- *  TODO:
- *  add Fn key status
- *  Add mode selection on module loading (parameter) -> still necessary?
- *  Complete display switching -- may require dirty hacks or calling _DOS?
  */
 
 #include <linux/kernel.h>
 #include <acpi/acpi_bus.h>
 #include <asm/uaccess.h>
 
-#define ASUS_ACPI_VERSION "0.29"
+#define ASUS_ACPI_VERSION "0.30"
 
 #define PROC_ASUS       "asus" //the directory
 #define PROC_MLED       "mled"
 #define PROC_WLED       "wled"
 #define PROC_TLED       "tled"
+#define PROC_BT         "bluetooth"
+#define PROC_LEDD       "ledd"
 #define PROC_INFO       "info"
 #define PROC_LCD        "lcd"
 #define PROC_BRN        "brn"
 /*
  * Flags for hotk status
  */
-#define MLED_ON     0x01       //is MLED ON ?
-#define WLED_ON     0x02
-#define TLED_ON     0x04
+#define MLED_ON     0x01       //mail LED
+#define WLED_ON     0x02       //wireless LED
+#define TLED_ON     0x04       //touchpad LED
+#define BT_ON       0x08       //internal Bluetooth
 
 MODULE_AUTHOR("Julien Lerouge, Karol Kozimor");
 MODULE_DESCRIPTION(ACPI_HOTK_NAME);
@@ -92,7 +92,10 @@ struct model_data {
        char *wled_status;      //node to handle wled reading_______A
        char *mt_tled;          //method to handle tled_____________R
        char *tled_status;      //node to handle tled reading_______A
-       char *mt_lcd_switch;    //method to turn LCD ON/OFF_________A
+       char *mt_ledd;          //method to handle LED display______R
+       char *mt_bt_switch;     //method to switch Bluetooth on/off_R
+       char *bt_status;        //no model currently supports this__?
+       char *mt_lcd_switch;    //method to turn LCD on/off_________A
        char *lcd_status;       //node to read LCD panel state______A
        char *brightness_up;    //method to set brightness up_______A
        char *brightness_down;  //guess what ?______________________A
@@ -111,27 +114,31 @@ struct asus_hotk {
        struct acpi_device *device;     //the device we are in
        acpi_handle handle;     //the handle of the hotk device
        char status;            //status of the hotk, for LEDs, ...
+       u32 ledd_status;        //status of the LED display
        struct model_data *methods;     //methods available on the laptop
        u8 brightness;          //brightness level
        enum {
                A1x = 0,        //A1340D, A1300F
                A2x,            //A2500H
+               A4G,            //A4700G
                D1x,            //D1
                L2D,            //L2000D
                L3C,            //L3800C
                L3D,            //L3400D
-               L3H,            //L3H, but also L2000E
+               L3H,            //L3H, L2000E, L5D
                L4R,            //L4500R
                L5x,            //L5800C 
                L8L,            //L8400L
                M1A,            //M1300A
                M2E,            //M2400E, L4400L
-               M6N,            //M6800N
-               M6R,            //M6700R
+               M6N,            //M6800N, W3400N
+               M6R,            //M6700R, A3000G
                P30,            //Samsung P30
                S1x,            //S1300A, but also L1400B and M2400A (L84F)
                S2x,            //S200 (J1 reported), Victor MP-XP7210
-               xxN,            //M2400N, M3700N, M5200N, S1300N, S5200N, W1OOON
+               W1N,            //W1000N
+               W5A,            //W5A
+               xxN,            //M2400N, M3700N, M5200N, M6800N, S1300N, S5200N
                //(Centrino)
                END_MODEL
        } model;                //Models currently supported
@@ -149,17 +156,8 @@ struct asus_hotk {
 
 static struct model_data model_conf[END_MODEL] = {
        /*
-        * Those pathnames are relative to the HOTK / ATKD device :
-        *       - mt_mled
-        *       - mt_wled
-        *       - brightness_set
-        *       - brightness_get
-        *       - display_set
-        *       - display_get
-        *
         * TODO I have seen a SWBX and AIBX method on some models, like L1400B,
         * it seems to be a kind of switch, but what for ?
-        *
         */
 
        {
@@ -183,6 +181,16 @@ static struct model_data model_conf[END_MODEL] = {
         .display_set = "SDSP",
         .display_get = "\\INFB"},
 
+       {
+        .name = "A4G",
+        .mt_mled = "MLED",
+/* WLED present, but not controlled by ACPI */
+        .mt_lcd_switch = xxN_PREFIX "_Q10",
+        .brightness_set = "SPLV",
+        .brightness_get = "GPLV",
+        .display_set = "SDSP",
+        .display_get = "\\ADVG"},
+
        {
         .name = "D1x",
         .mt_mled = "MLED",
@@ -302,7 +310,8 @@ static struct model_data model_conf[END_MODEL] = {
         .brightness_set = "SPLV",
         .brightness_get = "GPLV",
         .display_set = "SDSP",
-        .display_get = "\\_SB.PCI0.P0P1.VGA.GETD"},
+        .display_get = "\\SSTE"},
+
        {
         .name = "M6R",
         .mt_mled = "MLED",
@@ -312,7 +321,7 @@ static struct model_data model_conf[END_MODEL] = {
         .brightness_set = "SPLV",
         .brightness_get = "GPLV",
         .display_set = "SDSP",
-        .display_get = "\\SSTE"},
+        .display_get = "\\_SB.PCI0.P0P1.VGA.GETD"},
 
        {
         .name = "P30",
@@ -344,6 +353,28 @@ static struct model_data model_conf[END_MODEL] = {
         .brightness_up = S2x_PREFIX "_Q0B",
         .brightness_down = S2x_PREFIX "_Q0A"},
 
+       {
+        .name = "W1N",
+        .mt_mled = "MLED",
+        .mt_wled = "WLED",
+        .mt_ledd = "SLCM",
+        .mt_lcd_switch = xxN_PREFIX "_Q10",
+        .lcd_status = "\\BKLT",
+        .brightness_set = "SPLV",
+        .brightness_get = "GPLV",
+        .display_set = "SDSP",
+        .display_get = "\\ADVG"},
+
+       {
+        .name = "W5A",
+        .mt_bt_switch = "BLED",
+        .mt_wled = "WLED",
+        .mt_lcd_switch = xxN_PREFIX "_Q10",
+        .brightness_set = "SPLV",
+        .brightness_get = "GPLV",
+        .display_set = "SDSP",
+        .display_get = "\\ADVG"},
+
        {
         .name = "xxN",
         .mt_mled = "MLED",
@@ -562,6 +593,36 @@ proc_write_mled(struct file *file, const char __user * buffer,
        return write_led(buffer, count, hotk->methods->mt_mled, MLED_ON, 1);
 }
 
+/*
+ * Proc handlers for LED display
+ */
+static int
+proc_read_ledd(char *page, char **start, off_t off, int count, int *eof,
+              void *data)
+{
+       return sprintf(page, "0x%08x\n", hotk->ledd_status);
+}
+
+static int
+proc_write_ledd(struct file *file, const char __user * buffer,
+               unsigned long count, void *data)
+{
+       int value;
+
+       count = parse_arg(buffer, count, &value);
+       if (count > 0) {
+               if (!write_acpi_int
+                   (hotk->handle, hotk->methods->mt_ledd, value, NULL))
+                       printk(KERN_WARNING
+                              "Asus ACPI: LED display write failed\n");
+               else
+                       hotk->ledd_status = (u32) value;
+       } else if (count < 0)
+               printk(KERN_WARNING "Asus ACPI: Error reading user input\n");
+
+       return count;
+}
+
 /*
  * Proc handlers for WLED
  */
@@ -580,6 +641,25 @@ proc_write_wled(struct file *file, const char __user * buffer,
        return write_led(buffer, count, hotk->methods->mt_wled, WLED_ON, 0);
 }
 
+/*
+ * Proc handlers for Bluetooth
+ */
+static int
+proc_read_bluetooth(char *page, char **start, off_t off, int count, int *eof,
+                   void *data)
+{
+       return sprintf(page, "%d\n", read_led(hotk->methods->bt_status, BT_ON));
+}
+
+static int
+proc_write_bluetooth(struct file *file, const char __user * buffer,
+                    unsigned long count, void *data)
+{
+       /* Note: mt_bt_switch controls both internal Bluetooth adapter's 
+          presence and its LED */
+       return write_led(buffer, count, hotk->methods->mt_bt_switch, BT_ON, 0);
+}
+
 /*
  * Proc handlers for TLED
  */
@@ -876,6 +956,11 @@ static int asus_hotk_add_fs(struct acpi_device *device)
                              mode, device);
        }
 
+       if (hotk->methods->mt_ledd) {
+               asus_proc_add(PROC_LEDD, &proc_write_ledd, &proc_read_ledd,
+                             mode, device);
+       }
+
        if (hotk->methods->mt_mled) {
                asus_proc_add(PROC_MLED, &proc_write_mled, &proc_read_mled,
                              mode, device);
@@ -886,6 +971,11 @@ static int asus_hotk_add_fs(struct acpi_device *device)
                              mode, device);
        }
 
+       if (hotk->methods->mt_bt_switch) {
+               asus_proc_add(PROC_BT, &proc_write_bluetooth,
+                             &proc_read_bluetooth, mode, device);
+       }
+
        /* 
         * We need both read node and write method as LCD switch is also accessible
         * from keyboard 
@@ -919,6 +1009,10 @@ static int asus_hotk_remove_fs(struct acpi_device *device)
                        remove_proc_entry(PROC_MLED, acpi_device_dir(device));
                if (hotk->methods->mt_tled)
                        remove_proc_entry(PROC_TLED, acpi_device_dir(device));
+               if (hotk->methods->mt_ledd)
+                       remove_proc_entry(PROC_LEDD, acpi_device_dir(device));
+               if (hotk->methods->mt_bt_switch)
+                       remove_proc_entry(PROC_BT, acpi_device_dir(device));
                if (hotk->methods->mt_lcd_switch && hotk->methods->lcd_status)
                        remove_proc_entry(PROC_LCD, acpi_device_dir(device));
                if ((hotk->methods->brightness_up
@@ -950,6 +1044,65 @@ static void asus_hotk_notify(acpi_handle handle, u32 event, void *data)
        return;
 }
 
+/*
+ * Match the model string to the list of supported models. Return END_MODEL if
+ * no match or model is NULL.
+ */
+static int asus_model_match(char *model)
+{
+       if (model == NULL)
+               return END_MODEL;
+
+       if (strncmp(model, "L3D", 3) == 0)
+               return L3D;
+       else if (strncmp(model, "L2E", 3) == 0 ||
+                strncmp(model, "L3H", 3) == 0 || strncmp(model, "L5D", 3) == 0)
+               return L3H;
+       else if (strncmp(model, "L3", 2) == 0 || strncmp(model, "L2B", 3) == 0)
+               return L3C;
+       else if (strncmp(model, "L8L", 3) == 0)
+               return L8L;
+       else if (strncmp(model, "L4R", 3) == 0)
+               return L4R;
+       else if (strncmp(model, "M6N", 3) == 0 || strncmp(model, "W3N", 3) == 0)
+               return M6N;
+       else if (strncmp(model, "M6R", 3) == 0 || strncmp(model, "A3G", 3) == 0)
+               return M6R;
+       else if (strncmp(model, "M2N", 3) == 0 ||
+                strncmp(model, "M3N", 3) == 0 ||
+                strncmp(model, "M5N", 3) == 0 ||
+                strncmp(model, "M6N", 3) == 0 ||
+                strncmp(model, "S1N", 3) == 0 ||
+                strncmp(model, "S5N", 3) == 0 || strncmp(model, "W1N", 3) == 0)
+               return xxN;
+       else if (strncmp(model, "M1", 2) == 0)
+               return M1A;
+       else if (strncmp(model, "M2", 2) == 0 || strncmp(model, "L4E", 3) == 0)
+               return M2E;
+       else if (strncmp(model, "L2", 2) == 0)
+               return L2D;
+       else if (strncmp(model, "L8", 2) == 0)
+               return S1x;
+       else if (strncmp(model, "D1", 2) == 0)
+               return D1x;
+       else if (strncmp(model, "A1", 2) == 0)
+               return A1x;
+       else if (strncmp(model, "A2", 2) == 0)
+               return A2x;
+       else if (strncmp(model, "J1", 2) == 0)
+               return S2x;
+       else if (strncmp(model, "L5", 2) == 0)
+               return L5x;
+       else if (strncmp(model, "A4G", 3) == 0)
+               return A4G;
+       else if (strncmp(model, "W1N", 3) == 0)
+               return W1N;
+       else if (strncmp(model, "W5A", 3) == 0)
+               return W5A;
+       else
+               return END_MODEL;
+}
+
 /*
  * This function is used to initialize the hotk with right values. In this
  * method, we can make all the detection we want, and modify the hotk struct
@@ -960,6 +1113,7 @@ static int asus_hotk_get_info(void)
        struct acpi_buffer dsdt = { ACPI_ALLOCATE_BUFFER, NULL };
        union acpi_object *model = NULL;
        int bsts_result;
+       char *string = NULL;
        acpi_status status;
 
        /*
@@ -989,114 +1143,73 @@ static int asus_hotk_get_info(void)
                printk(KERN_NOTICE "  BSTS called, 0x%02x returned\n",
                       bsts_result);
 
-       /* This is unlikely with implicit return */
-       if (buffer.pointer == NULL)
-               return -EINVAL;
-
-       model = (union acpi_object *) buffer.pointer;
        /*
-        * Samsung P30 has a device with a valid _HID whose INIT does not 
-        * return anything. It used to be possible to catch this exception,
-        * but the implicit return code will now happily confuse the 
-        * driver. We assume that every ACPI_TYPE_STRING is a valid model
-        * identifier but it's still possible to get completely bogus data.
+        * Try to match the object returned by INIT to the specific model.
+        * Handle every possible object (or the lack of thereof) the DSDT 
+        * writers might throw at us. When in trouble, we pass NULL to 
+        * asus_model_match() and try something completely different.
         */
-       if (model->type == ACPI_TYPE_STRING) {
-               printk(KERN_NOTICE "  %s model detected, ", model->string.pointer);
-       } else {
-               if (asus_info &&        /* Samsung P30 */
+       if (buffer.pointer) {
+               model = (union acpi_object *)buffer.pointer;
+               switch (model->type) {
+               case ACPI_TYPE_STRING:
+                       string = model->string.pointer;
+                       break;
+               case ACPI_TYPE_BUFFER:
+                       string = model->buffer.pointer;
+                       break;
+               default:
+                       kfree(model);
+                       break;
+               }
+       }
+       hotk->model = asus_model_match(string);
+       if (hotk->model == END_MODEL) { /* match failed */
+               if (asus_info &&
                    strncmp(asus_info->oem_table_id, "ODEM", 4) == 0) {
                        hotk->model = P30;
                        printk(KERN_NOTICE
                               "  Samsung P30 detected, supported\n");
                } else {
                        hotk->model = M2E;
-                       printk(KERN_WARNING "  no string returned by INIT\n");
-                       printk(KERN_WARNING "  trying default values, supply "
-                              "the developers with your DSDT\n");
+                       printk(KERN_NOTICE "  unsupported model %s, trying "
+                              "default values\n", string);
+                       printk(KERN_NOTICE
+                              "  send /proc/acpi/dsdt to the developers\n");
                }
                hotk->methods = &model_conf[hotk->model];
-               
-               acpi_os_free(model);
-
                return AE_OK;
        }
-
-       hotk->model = END_MODEL;
-       if (strncmp(model->string.pointer, "L3D", 3) == 0)
-               hotk->model = L3D;
-       else if (strncmp(model->string.pointer, "L3H", 3) == 0 ||
-                strncmp(model->string.pointer, "L2E", 3) == 0)
-               hotk->model = L3H;
-       else if (strncmp(model->string.pointer, "L3", 2) == 0 ||
-                strncmp(model->string.pointer, "L2B", 3) == 0)
-               hotk->model = L3C;
-       else if (strncmp(model->string.pointer, "L8L", 3) == 0)
-               hotk->model = L8L;
-       else if (strncmp(model->string.pointer, "L4R", 3) == 0)
-               hotk->model = L4R;
-       else if (strncmp(model->string.pointer, "M6N", 3) == 0)
-               hotk->model = M6N;
-       else if (strncmp(model->string.pointer, "M6R", 3) == 0)
-               hotk->model = M6R;
-       else if (strncmp(model->string.pointer, "M2N", 3) == 0 ||
-                strncmp(model->string.pointer, "M3N", 3) == 0 ||
-                strncmp(model->string.pointer, "M5N", 3) == 0 ||
-                strncmp(model->string.pointer, "M6N", 3) == 0 ||
-                strncmp(model->string.pointer, "S1N", 3) == 0 ||
-                strncmp(model->string.pointer, "S5N", 3) == 0 ||
-                strncmp(model->string.pointer, "W1N", 3) == 0)
-               hotk->model = xxN;
-       else if (strncmp(model->string.pointer, "M1", 2) == 0)
-               hotk->model = M1A;
-       else if (strncmp(model->string.pointer, "M2", 2) == 0 ||
-                strncmp(model->string.pointer, "L4E", 3) == 0)
-               hotk->model = M2E;
-       else if (strncmp(model->string.pointer, "L2", 2) == 0)
-               hotk->model = L2D;
-       else if (strncmp(model->string.pointer, "L8", 2) == 0)
-               hotk->model = S1x;
-       else if (strncmp(model->string.pointer, "D1", 2) == 0)
-               hotk->model = D1x;
-       else if (strncmp(model->string.pointer, "A1", 2) == 0)
-               hotk->model = A1x;
-       else if (strncmp(model->string.pointer, "A2", 2) == 0)
-               hotk->model = A2x;
-       else if (strncmp(model->string.pointer, "J1", 2) == 0)
-               hotk->model = S2x;
-       else if (strncmp(model->string.pointer, "L5", 2) == 0)
-               hotk->model = L5x;
-
-       if (hotk->model == END_MODEL) {
-               printk("unsupported, trying default values, supply the "
-                      "developers with your DSDT\n");
-               hotk->model = M2E;
-       } else {
-               printk("supported\n");
-       }
-
        hotk->methods = &model_conf[hotk->model];
+       printk(KERN_NOTICE "  %s model detected, supported\n", string);
 
        /* Sort of per-model blacklist */
-       if (strncmp(model->string.pointer, "L2B", 3) == 0)
+       if (strncmp(string, "L2B", 3) == 0)
                hotk->methods->lcd_status = NULL;
        /* L2B is similar enough to L3C to use its settings, with this only 
           exception */
-       else if (strncmp(model->string.pointer, "S5N", 3) == 0 ||
-                strncmp(model->string.pointer, "M5N", 3) == 0)
+       else if (strncmp(string, "A3G", 3) == 0)
+               hotk->methods->lcd_status = "\\BLFG";
+       /* A3G is like M6R */
+       else if (strncmp(string, "S5N", 3) == 0 ||
+                strncmp(string, "M5N", 3) == 0 ||
+                strncmp(string, "W3N", 3) == 0)
                hotk->methods->mt_mled = NULL;
-       /* S5N and M5N have no MLED */
-       else if (strncmp(model->string.pointer, "M2N", 3) == 0 ||
-                strncmp(model->string.pointer, "W1N", 3) == 0)
+       /* S5N, M5N and W3N have no MLED */
+       else if (strncmp(string, "L5D", 3) == 0)
+               hotk->methods->mt_wled = NULL;
+       /* L5D's WLED is not controlled by ACPI */
+       else if (strncmp(string, "M2N", 3) == 0 ||
+                strncmp(string, "S1N", 3) == 0)
                hotk->methods->mt_wled = "WLED";
-       /* M2N and W1N have a usable WLED */
+       /* M2N and S1N have a usable WLED */
        else if (asus_info) {
                if (strncmp(asus_info->oem_table_id, "L1", 2) == 0)
                        hotk->methods->mled_status = NULL;
                /* S1300A reports L84F, but L1400B too, account for that */
        }
 
-       acpi_os_free(model);
+       kfree(model);
 
        return AE_OK;
 }
@@ -1164,8 +1277,7 @@ static int asus_hotk_add(struct acpi_device *device)
        /* For laptops without GPLV: init the hotk->brightness value */
        if ((!hotk->methods->brightness_get)
            && (!hotk->methods->brightness_status)
-           && (hotk->methods->brightness_up
-               && hotk->methods->brightness_down)) {
+           && (hotk->methods->brightness_up && hotk->methods->brightness_down)) {
                status =
                    acpi_evaluate_object(NULL, hotk->methods->brightness_down,
                                         NULL, NULL);
@@ -1184,6 +1296,9 @@ static int asus_hotk_add(struct acpi_device *device)
 
        asus_hotk_found = 1;
 
+       /* LED display is off by default */
+       hotk->ledd_status = 0xFFF;
+
       end:
        if (result) {
                kfree(hotk);
@@ -1232,7 +1347,7 @@ static int __init asus_acpi_init(void)
        result = acpi_bus_register_driver(&asus_hotk_driver);
        if (result < 0) {
                remove_proc_entry(PROC_ASUS, acpi_root_dir);
-               return -ENODEV;
+               return result;
        }
 
        /*
@@ -1256,7 +1371,7 @@ static void __exit asus_acpi_exit(void)
        acpi_bus_unregister_driver(&asus_hotk_driver);
        remove_proc_entry(PROC_ASUS, acpi_root_dir);
 
-       acpi_os_free(asus_info);
+       kfree(asus_info);
 
        return;
 }
index 702e857e98c53f843fa31970d4b78f1c98eaf5bd..24bf4dca88cc75936e275f2585a375eeec8b4722 100644 (file)
@@ -59,6 +59,9 @@ ACPI_MODULE_NAME("acpi_battery")
 MODULE_DESCRIPTION(ACPI_BATTERY_DRIVER_NAME);
 MODULE_LICENSE("GPL");
 
+extern struct proc_dir_entry *acpi_lock_battery_dir(void);
+extern void *acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir);
+
 static int acpi_battery_add(struct acpi_device *device);
 static int acpi_battery_remove(struct acpi_device *device, int type);
 
@@ -108,7 +111,7 @@ struct acpi_battery_trips {
 };
 
 struct acpi_battery {
-       acpi_handle handle;
+       struct acpi_device * device;
        struct acpi_battery_flags flags;
        struct acpi_battery_trips trips;
        unsigned long alarm;
@@ -132,17 +135,16 @@ acpi_battery_get_info(struct acpi_battery *battery,
        struct acpi_buffer data = { 0, NULL };
        union acpi_object *package = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_battery_get_info");
 
        if (!battery || !bif)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        /* Evalute _BIF */
 
-       status = acpi_evaluate_object(battery->handle, "_BIF", NULL, &buffer);
+       status = acpi_evaluate_object(battery->device->handle, "_BIF", NULL, &buffer);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _BIF\n"));
-               return_VALUE(-ENODEV);
+               ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BIF"));
+               return -ENODEV;
        }
 
        package = (union acpi_object *)buffer.pointer;
@@ -151,7 +153,7 @@ acpi_battery_get_info(struct acpi_battery *battery,
 
        status = acpi_extract_package(package, &format, &data);
        if (status != AE_BUFFER_OVERFLOW) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BIF\n"));
+               ACPI_EXCEPTION((AE_INFO, status, "Extracting _BIF"));
                result = -ENODEV;
                goto end;
        }
@@ -165,19 +167,19 @@ acpi_battery_get_info(struct acpi_battery *battery,
 
        status = acpi_extract_package(package, &format, &data);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BIF\n"));
+               ACPI_EXCEPTION((AE_INFO, status, "Extracting _BIF"));
                kfree(data.pointer);
                result = -ENODEV;
                goto end;
        }
 
       end:
-       acpi_os_free(buffer.pointer);
+       kfree(buffer.pointer);
 
        if (!result)
                (*bif) = (struct acpi_battery_info *)data.pointer;
 
-       return_VALUE(result);
+       return result;
 }
 
 static int
@@ -193,17 +195,16 @@ acpi_battery_get_status(struct acpi_battery *battery,
        struct acpi_buffer data = { 0, NULL };
        union acpi_object *package = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_battery_get_status");
 
        if (!battery || !bst)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        /* Evalute _BST */
 
-       status = acpi_evaluate_object(battery->handle, "_BST", NULL, &buffer);
+       status = acpi_evaluate_object(battery->device->handle, "_BST", NULL, &buffer);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _BST\n"));
-               return_VALUE(-ENODEV);
+               ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BST"));
+               return -ENODEV;
        }
 
        package = (union acpi_object *)buffer.pointer;
@@ -212,7 +213,7 @@ acpi_battery_get_status(struct acpi_battery *battery,
 
        status = acpi_extract_package(package, &format, &data);
        if (status != AE_BUFFER_OVERFLOW) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BST\n"));
+               ACPI_EXCEPTION((AE_INFO, status, "Extracting _BST"));
                result = -ENODEV;
                goto end;
        }
@@ -226,19 +227,19 @@ acpi_battery_get_status(struct acpi_battery *battery,
 
        status = acpi_extract_package(package, &format, &data);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BST\n"));
+               ACPI_EXCEPTION((AE_INFO, status, "Extracting _BST"));
                kfree(data.pointer);
                result = -ENODEV;
                goto end;
        }
 
       end:
-       acpi_os_free(buffer.pointer);
+       kfree(buffer.pointer);
 
        if (!result)
                (*bst) = (struct acpi_battery_status *)data.pointer;
 
-       return_VALUE(result);
+       return result;
 }
 
 static int
@@ -248,25 +249,24 @@ acpi_battery_set_alarm(struct acpi_battery *battery, unsigned long alarm)
        union acpi_object arg0 = { ACPI_TYPE_INTEGER };
        struct acpi_object_list arg_list = { 1, &arg0 };
 
-       ACPI_FUNCTION_TRACE("acpi_battery_set_alarm");
 
        if (!battery)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (!battery->flags.alarm)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        arg0.integer.value = alarm;
 
-       status = acpi_evaluate_object(battery->handle, "_BTP", &arg_list, NULL);
+       status = acpi_evaluate_object(battery->device->handle, "_BTP", &arg_list, NULL);
        if (ACPI_FAILURE(status))
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Alarm set to %d\n", (u32) alarm));
 
        battery->alarm = alarm;
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_battery_check(struct acpi_battery *battery)
@@ -277,18 +277,15 @@ static int acpi_battery_check(struct acpi_battery *battery)
        struct acpi_device *device = NULL;
        struct acpi_battery_info *bif = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_battery_check");
 
        if (!battery)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
-       result = acpi_bus_get_device(battery->handle, &device);
-       if (result)
-               return_VALUE(result);
+       device = battery->device;
 
        result = acpi_bus_get_status(device);
        if (result)
-               return_VALUE(result);
+               return result;
 
        /* Insertion? */
 
@@ -300,7 +297,7 @@ static int acpi_battery_check(struct acpi_battery *battery)
 
                result = acpi_battery_get_info(battery, &bif);
                if (result)
-                       return_VALUE(result);
+                       return result;
 
                battery->flags.power_unit = bif->power_unit;
                battery->trips.warning = bif->design_capacity_warning;
@@ -309,7 +306,7 @@ static int acpi_battery_check(struct acpi_battery *battery)
 
                /* See if alarms are supported, and if so, set default */
 
-               status = acpi_get_handle(battery->handle, "_BTP", &handle);
+               status = acpi_get_handle(battery->device->handle, "_BTP", &handle);
                if (ACPI_SUCCESS(status)) {
                        battery->flags.alarm = 1;
                        acpi_battery_set_alarm(battery, battery->trips.warning);
@@ -324,7 +321,7 @@ static int acpi_battery_check(struct acpi_battery *battery)
 
        battery->flags.present = device->status.battery_present;
 
-       return_VALUE(result);
+       return result;
 }
 
 /* --------------------------------------------------------------------------
@@ -339,7 +336,6 @@ static int acpi_battery_read_info(struct seq_file *seq, void *offset)
        struct acpi_battery_info *bif = NULL;
        char *units = "?";
 
-       ACPI_FUNCTION_TRACE("acpi_battery_read_info");
 
        if (!battery)
                goto end;
@@ -409,7 +405,7 @@ static int acpi_battery_read_info(struct seq_file *seq, void *offset)
       end:
        kfree(bif);
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_battery_info_open_fs(struct inode *inode, struct file *file)
@@ -424,7 +420,6 @@ static int acpi_battery_read_state(struct seq_file *seq, void *offset)
        struct acpi_battery_status *bst = NULL;
        char *units = "?";
 
-       ACPI_FUNCTION_TRACE("acpi_battery_read_state");
 
        if (!battery)
                goto end;
@@ -458,8 +453,6 @@ static int acpi_battery_read_state(struct seq_file *seq, void *offset)
        if ((bst->state & 0x01) && (bst->state & 0x02)) {
                seq_printf(seq,
                           "charging state:          charging/discharging\n");
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Battery Charging and Discharging?\n"));
        } else if (bst->state & 0x01)
                seq_printf(seq, "charging state:          discharging\n");
        else if (bst->state & 0x02)
@@ -489,7 +482,7 @@ static int acpi_battery_read_state(struct seq_file *seq, void *offset)
       end:
        kfree(bst);
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_battery_state_open_fs(struct inode *inode, struct file *file)
@@ -502,7 +495,6 @@ static int acpi_battery_read_alarm(struct seq_file *seq, void *offset)
        struct acpi_battery *battery = (struct acpi_battery *)seq->private;
        char *units = "?";
 
-       ACPI_FUNCTION_TRACE("acpi_battery_read_alarm");
 
        if (!battery)
                goto end;
@@ -527,7 +519,7 @@ static int acpi_battery_read_alarm(struct seq_file *seq, void *offset)
                seq_printf(seq, "%d %sh\n", (u32) battery->alarm, units);
 
       end:
-       return_VALUE(0);
+       return 0;
 }
 
 static ssize_t
@@ -540,25 +532,24 @@ acpi_battery_write_alarm(struct file *file,
        struct seq_file *m = (struct seq_file *)file->private_data;
        struct acpi_battery *battery = (struct acpi_battery *)m->private;
 
-       ACPI_FUNCTION_TRACE("acpi_battery_write_alarm");
 
        if (!battery || (count > sizeof(alarm_string) - 1))
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (!battery->flags.present)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        if (copy_from_user(alarm_string, buffer, count))
-               return_VALUE(-EFAULT);
+               return -EFAULT;
 
        alarm_string[count] = '\0';
 
        result = acpi_battery_set_alarm(battery,
                                        simple_strtoul(alarm_string, NULL, 0));
        if (result)
-               return_VALUE(result);
+               return result;
 
-       return_VALUE(count);
+       return count;
 }
 
 static int acpi_battery_alarm_open_fs(struct inode *inode, struct file *file)
@@ -595,13 +586,12 @@ static int acpi_battery_add_fs(struct acpi_device *device)
 {
        struct proc_dir_entry *entry = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_battery_add_fs");
 
        if (!acpi_device_dir(device)) {
                acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
                                                     acpi_battery_dir);
                if (!acpi_device_dir(device))
-                       return_VALUE(-ENODEV);
+                       return -ENODEV;
                acpi_device_dir(device)->owner = THIS_MODULE;
        }
 
@@ -609,9 +599,7 @@ static int acpi_battery_add_fs(struct acpi_device *device)
        entry = create_proc_entry(ACPI_BATTERY_FILE_INFO,
                                  S_IRUGO, acpi_device_dir(device));
        if (!entry)
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to create '%s' fs entry\n",
-                                 ACPI_BATTERY_FILE_INFO));
+               return -ENODEV;
        else {
                entry->proc_fops = &acpi_battery_info_ops;
                entry->data = acpi_driver_data(device);
@@ -622,9 +610,7 @@ static int acpi_battery_add_fs(struct acpi_device *device)
        entry = create_proc_entry(ACPI_BATTERY_FILE_STATUS,
                                  S_IRUGO, acpi_device_dir(device));
        if (!entry)
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to create '%s' fs entry\n",
-                                 ACPI_BATTERY_FILE_STATUS));
+               return -ENODEV;
        else {
                entry->proc_fops = &acpi_battery_state_ops;
                entry->data = acpi_driver_data(device);
@@ -636,21 +622,18 @@ static int acpi_battery_add_fs(struct acpi_device *device)
                                  S_IFREG | S_IRUGO | S_IWUSR,
                                  acpi_device_dir(device));
        if (!entry)
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to create '%s' fs entry\n",
-                                 ACPI_BATTERY_FILE_ALARM));
+               return -ENODEV;
        else {
                entry->proc_fops = &acpi_battery_alarm_ops;
                entry->data = acpi_driver_data(device);
                entry->owner = THIS_MODULE;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_battery_remove_fs(struct acpi_device *device)
 {
-       ACPI_FUNCTION_TRACE("acpi_battery_remove_fs");
 
        if (acpi_device_dir(device)) {
                remove_proc_entry(ACPI_BATTERY_FILE_ALARM,
@@ -664,7 +647,7 @@ static int acpi_battery_remove_fs(struct acpi_device *device)
                acpi_device_dir(device) = NULL;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 /* --------------------------------------------------------------------------
@@ -676,17 +659,17 @@ static void acpi_battery_notify(acpi_handle handle, u32 event, void *data)
        struct acpi_battery *battery = (struct acpi_battery *)data;
        struct acpi_device *device = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_battery_notify");
 
        if (!battery)
-               return_VOID;
+               return;
 
-       if (acpi_bus_get_device(handle, &device))
-               return_VOID;
+       device = battery->device;
 
        switch (event) {
        case ACPI_BATTERY_NOTIFY_STATUS:
        case ACPI_BATTERY_NOTIFY_INFO:
+       case ACPI_NOTIFY_BUS_CHECK:
+       case ACPI_NOTIFY_DEVICE_CHECK:
                acpi_battery_check(battery);
                acpi_bus_generate_event(device, event, battery->flags.present);
                break;
@@ -696,7 +679,7 @@ static void acpi_battery_notify(acpi_handle handle, u32 event, void *data)
                break;
        }
 
-       return_VOID;
+       return;
 }
 
 static int acpi_battery_add(struct acpi_device *device)
@@ -705,17 +688,16 @@ static int acpi_battery_add(struct acpi_device *device)
        acpi_status status = 0;
        struct acpi_battery *battery = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_battery_add");
 
        if (!device)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        battery = kmalloc(sizeof(struct acpi_battery), GFP_KERNEL);
        if (!battery)
-               return_VALUE(-ENOMEM);
+               return -ENOMEM;
        memset(battery, 0, sizeof(struct acpi_battery));
 
-       battery->handle = device->handle;
+       battery->device = device;
        strcpy(acpi_device_name(device), ACPI_BATTERY_DEVICE_NAME);
        strcpy(acpi_device_class(device), ACPI_BATTERY_CLASS);
        acpi_driver_data(device) = battery;
@@ -728,12 +710,10 @@ static int acpi_battery_add(struct acpi_device *device)
        if (result)
                goto end;
 
-       status = acpi_install_notify_handler(battery->handle,
-                                            ACPI_DEVICE_NOTIFY,
+       status = acpi_install_notify_handler(device->handle,
+                                            ACPI_ALL_NOTIFY,
                                             acpi_battery_notify, battery);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Error installing notify handler\n"));
                result = -ENODEV;
                goto end;
        }
@@ -748,7 +728,7 @@ static int acpi_battery_add(struct acpi_device *device)
                kfree(battery);
        }
 
-       return_VALUE(result);
+       return result;
 }
 
 static int acpi_battery_remove(struct acpi_device *device, int type)
@@ -756,56 +736,48 @@ static int acpi_battery_remove(struct acpi_device *device, int type)
        acpi_status status = 0;
        struct acpi_battery *battery = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_battery_remove");
 
        if (!device || !acpi_driver_data(device))
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        battery = (struct acpi_battery *)acpi_driver_data(device);
 
-       status = acpi_remove_notify_handler(battery->handle,
-                                           ACPI_DEVICE_NOTIFY,
+       status = acpi_remove_notify_handler(device->handle,
+                                           ACPI_ALL_NOTIFY,
                                            acpi_battery_notify);
-       if (ACPI_FAILURE(status))
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Error removing notify handler\n"));
 
        acpi_battery_remove_fs(device);
 
        kfree(battery);
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int __init acpi_battery_init(void)
 {
-       int result = 0;
-
-       ACPI_FUNCTION_TRACE("acpi_battery_init");
+       int result;
 
-       acpi_battery_dir = proc_mkdir(ACPI_BATTERY_CLASS, acpi_root_dir);
+       acpi_battery_dir = acpi_lock_battery_dir();
        if (!acpi_battery_dir)
-               return_VALUE(-ENODEV);
-       acpi_battery_dir->owner = THIS_MODULE;
+               return -ENODEV;
 
        result = acpi_bus_register_driver(&acpi_battery_driver);
        if (result < 0) {
-               remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir);
-               return_VALUE(-ENODEV);
+               acpi_unlock_battery_dir(acpi_battery_dir);
+               return -ENODEV;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 static void __exit acpi_battery_exit(void)
 {
-       ACPI_FUNCTION_TRACE("acpi_battery_exit");
 
        acpi_bus_unregister_driver(&acpi_battery_driver);
 
-       remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir);
+       acpi_unlock_battery_dir(acpi_battery_dir);
 
-       return_VOID;
+       return;
 }
 
 module_init(acpi_battery_init);
index dd3983cece92d7b590c6e2fce965d7fab2bbb9cc..ea5a0496a4fd9a63531dd1665975b44d810b0dbb 100644 (file)
@@ -60,21 +60,19 @@ int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device)
 {
        acpi_status status = AE_OK;
 
-       ACPI_FUNCTION_TRACE("acpi_bus_get_device");
 
        if (!device)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        /* TBD: Support fixed-feature devices */
 
        status = acpi_get_data(handle, acpi_bus_data_handler, (void **)device);
        if (ACPI_FAILURE(status) || !*device) {
-               ACPI_DEBUG_PRINT((ACPI_DB_WARN, "No context for object [%p]\n",
-                                 handle));
-               return_VALUE(-ENODEV);
+               ACPI_EXCEPTION((AE_INFO, status, "No context for object [%p]", handle));
+               return -ENODEV;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 EXPORT_SYMBOL(acpi_bus_get_device);
@@ -84,10 +82,9 @@ int acpi_bus_get_status(struct acpi_device *device)
        acpi_status status = AE_OK;
        unsigned long sta = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_bus_get_status");
 
        if (!device)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        /*
         * Evaluate _STA if present.
@@ -96,7 +93,7 @@ int acpi_bus_get_status(struct acpi_device *device)
                status =
                    acpi_evaluate_integer(device->handle, "_STA", NULL, &sta);
                if (ACPI_FAILURE(status))
-                       return_VALUE(-ENODEV);
+                       return -ENODEV;
                STRUCT_TO_INT(device->status) = (int)sta;
        }
 
@@ -120,7 +117,7 @@ int acpi_bus_get_status(struct acpi_device *device)
                          device->pnp.bus_id,
                          (u32) STRUCT_TO_INT(device->status)));
 
-       return_VALUE(0);
+       return 0;
 }
 
 EXPORT_SYMBOL(acpi_bus_get_status);
@@ -136,11 +133,10 @@ int acpi_bus_get_power(acpi_handle handle, int *state)
        struct acpi_device *device = NULL;
        unsigned long psc = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_bus_get_power");
 
        result = acpi_bus_get_device(handle, &device);
        if (result)
-               return_VALUE(result);
+               return result;
 
        *state = ACPI_STATE_UNKNOWN;
 
@@ -159,12 +155,12 @@ int acpi_bus_get_power(acpi_handle handle, int *state)
                        status = acpi_evaluate_integer(device->handle, "_PSC",
                                                       NULL, &psc);
                        if (ACPI_FAILURE(status))
-                               return_VALUE(-ENODEV);
+                               return -ENODEV;
                        device->power.state = (int)psc;
                } else if (device->power.flags.power_resources) {
                        result = acpi_power_get_inferred_state(device);
                        if (result)
-                               return_VALUE(result);
+                               return result;
                }
 
                *state = device->power.state;
@@ -173,7 +169,7 @@ int acpi_bus_get_power(acpi_handle handle, int *state)
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] power state is D%d\n",
                          device->pnp.bus_id, device->power.state));
 
-       return_VALUE(0);
+       return 0;
 }
 
 EXPORT_SYMBOL(acpi_bus_get_power);
@@ -185,21 +181,20 @@ int acpi_bus_set_power(acpi_handle handle, int state)
        struct acpi_device *device = NULL;
        char object_name[5] = { '_', 'P', 'S', '0' + state, '\0' };
 
-       ACPI_FUNCTION_TRACE("acpi_bus_set_power");
 
        result = acpi_bus_get_device(handle, &device);
        if (result)
-               return_VALUE(result);
+               return result;
 
        if ((state < ACPI_STATE_D0) || (state > ACPI_STATE_D3))
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        /* Make sure this is a valid target state */
 
        if (!device->flags.power_manageable) {
-               ACPI_DEBUG_PRINT((ACPI_DB_WARN,
-                                 "Device is not power manageable\n"));
-               return_VALUE(-ENODEV);
+               printk(KERN_DEBUG "Device `[%s]' is not power manageable",
+                               device->kobj.name);
+               return -ENODEV;
        }
        /*
         * Get device's current power state if it's unknown
@@ -211,18 +206,18 @@ int acpi_bus_set_power(acpi_handle handle, int state)
                if (state == device->power.state) {
                        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at D%d\n",
                                          state));
-                       return_VALUE(0);
+                       return 0;
                }
        }
        if (!device->power.states[state].flags.valid) {
-               ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Device does not support D%d\n",
-                                 state));
-               return_VALUE(-ENODEV);
+               printk(KERN_WARNING PREFIX "Device does not support D%d\n", state);
+               return -ENODEV;
        }
        if (device->parent && (state < device->parent->power.state)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_WARN,
-                                 "Cannot set device to a higher-powered state than parent\n"));
-               return_VALUE(-ENODEV);
+               printk(KERN_WARNING PREFIX
+                             "Cannot set device to a higher-powered"
+                             " state than parent\n");
+               return -ENODEV;
        }
 
        /*
@@ -264,15 +259,15 @@ int acpi_bus_set_power(acpi_handle handle, int state)
 
       end:
        if (result)
-               ACPI_DEBUG_PRINT((ACPI_DB_WARN,
-                                 "Error transitioning device [%s] to D%d\n",
-                                 device->pnp.bus_id, state));
+               printk(KERN_WARNING PREFIX
+                             "Transitioning device [%s] to D%d\n",
+                             device->pnp.bus_id, state);
        else
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                  "Device [%s] transitioned to D%d\n",
                                  device->pnp.bus_id, state));
 
-       return_VALUE(result);
+       return result;
 }
 
 EXPORT_SYMBOL(acpi_bus_set_power);
@@ -293,18 +288,17 @@ int acpi_bus_generate_event(struct acpi_device *device, u8 type, int data)
        struct acpi_bus_event *event = NULL;
        unsigned long flags = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_bus_generate_event");
 
        if (!device)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        /* drop event on the floor if no one's listening */
        if (!event_is_open)
-               return_VALUE(0);
+               return 0;
 
        event = kmalloc(sizeof(struct acpi_bus_event), GFP_ATOMIC);
        if (!event)
-               return_VALUE(-ENOMEM);
+               return -ENOMEM;
 
        strcpy(event->device_class, device->pnp.device_class);
        strcpy(event->bus_id, device->pnp.bus_id);
@@ -317,7 +311,7 @@ int acpi_bus_generate_event(struct acpi_device *device, u8 type, int data)
 
        wake_up_interruptible(&acpi_bus_event_queue);
 
-       return_VALUE(0);
+       return 0;
 }
 
 EXPORT_SYMBOL(acpi_bus_generate_event);
@@ -329,10 +323,9 @@ int acpi_bus_receive_event(struct acpi_bus_event *event)
 
        DECLARE_WAITQUEUE(wait, current);
 
-       ACPI_FUNCTION_TRACE("acpi_bus_receive_event");
 
        if (!event)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (list_empty(&acpi_bus_event_list)) {
 
@@ -346,7 +339,7 @@ int acpi_bus_receive_event(struct acpi_bus_event *event)
                set_current_state(TASK_RUNNING);
 
                if (signal_pending(current))
-                       return_VALUE(-ERESTARTSYS);
+                       return -ERESTARTSYS;
        }
 
        spin_lock_irqsave(&acpi_bus_event_lock, flags);
@@ -357,13 +350,13 @@ int acpi_bus_receive_event(struct acpi_bus_event *event)
        spin_unlock_irqrestore(&acpi_bus_event_lock, flags);
 
        if (!entry)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        memcpy(event, entry, sizeof(struct acpi_bus_event));
 
        kfree(entry);
 
-       return_VALUE(0);
+       return 0;
 }
 
 EXPORT_SYMBOL(acpi_bus_receive_event);
@@ -378,10 +371,9 @@ acpi_bus_check_device(struct acpi_device *device, int *status_changed)
        acpi_status status = 0;
        struct acpi_device_status old_status;
 
-       ACPI_FUNCTION_TRACE("acpi_bus_check_device");
 
        if (!device)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (status_changed)
                *status_changed = 0;
@@ -398,15 +390,15 @@ acpi_bus_check_device(struct acpi_device *device, int *status_changed)
                        if (status_changed)
                                *status_changed = 1;
                }
-               return_VALUE(0);
+               return 0;
        }
 
        status = acpi_bus_get_status(device);
        if (ACPI_FAILURE(status))
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        if (STRUCT_TO_INT(old_status) == STRUCT_TO_INT(device->status))
-               return_VALUE(0);
+               return 0;
 
        if (status_changed)
                *status_changed = 1;
@@ -422,7 +414,7 @@ acpi_bus_check_device(struct acpi_device *device, int *status_changed)
                /* TBD: Handle device removal */
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_bus_check_scope(struct acpi_device *device)
@@ -430,25 +422,24 @@ static int acpi_bus_check_scope(struct acpi_device *device)
        int result = 0;
        int status_changed = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_bus_check_scope");
 
        if (!device)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        /* Status Change? */
        result = acpi_bus_check_device(device, &status_changed);
        if (result)
-               return_VALUE(result);
+               return result;
 
        if (!status_changed)
-               return_VALUE(0);
+               return 0;
 
        /*
         * TBD: Enumerate child devices within this device's scope and
         *       run acpi_bus_check_device()'s on them.
         */
 
-       return_VALUE(0);
+       return 0;
 }
 
 /**
@@ -461,10 +452,9 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data)
        int result = 0;
        struct acpi_device *device = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_bus_notify");
 
        if (acpi_bus_get_device(handle, &device))
-               return_VOID;
+               return;
 
        switch (type) {
 
@@ -539,7 +529,7 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data)
                break;
        }
 
-       return_VOID;
+       return;
 }
 
 /* --------------------------------------------------------------------------
@@ -553,7 +543,6 @@ static int __init acpi_bus_init_irq(void)
        struct acpi_object_list arg_list = { 1, &arg };
        char *message = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_bus_init_irq");
 
        /* 
         * Let the system know what interrupt model we are using by
@@ -572,7 +561,7 @@ static int __init acpi_bus_init_irq(void)
                break;
        default:
                printk(KERN_WARNING PREFIX "Unknown interrupt routing model\n");
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        }
 
        printk(KERN_INFO PREFIX "Using %s for interrupt routing\n", message);
@@ -581,11 +570,11 @@ static int __init acpi_bus_init_irq(void)
 
        status = acpi_evaluate_object(NULL, "\\_PIC", &arg_list, NULL);
        if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PIC\n"));
-               return_VALUE(-ENODEV);
+               ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PIC"));
+               return -ENODEV;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 void __init acpi_early_init(void)
@@ -593,10 +582,9 @@ void __init acpi_early_init(void)
        acpi_status status = AE_OK;
        struct acpi_buffer buffer = { sizeof(acpi_fadt), &acpi_fadt };
 
-       ACPI_FUNCTION_TRACE("acpi_early_init");
 
        if (acpi_disabled)
-               return_VOID;
+               return;
 
        printk(KERN_INFO PREFIX "Core revision %08x\n", ACPI_CA_VERSION);
 
@@ -656,11 +644,11 @@ void __init acpi_early_init(void)
                goto error0;
        }
 
-       return_VOID;
+       return;
 
       error0:
        disable_acpi();
-       return_VOID;
+       return;
 }
 
 static int __init acpi_bus_init(void)
@@ -669,7 +657,6 @@ static int __init acpi_bus_init(void)
        acpi_status status = AE_OK;
        extern acpi_status acpi_os_initialize1(void);
 
-       ACPI_FUNCTION_TRACE("acpi_bus_init");
 
        status = acpi_os_initialize1();
 
@@ -731,12 +718,12 @@ static int __init acpi_bus_init(void)
         */
        acpi_root_dir = proc_mkdir(ACPI_BUS_FILE_ROOT, NULL);
 
-       return_VALUE(0);
+       return 0;
 
        /* Mimic structured exception handling */
       error1:
        acpi_terminate();
-       return_VALUE(-ENODEV);
+       return -ENODEV;
 }
 
 decl_subsys(acpi, NULL, NULL);
@@ -745,11 +732,10 @@ static int __init acpi_init(void)
 {
        int result = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_init");
 
        if (acpi_disabled) {
                printk(KERN_INFO PREFIX "Interpreter disabled.\n");
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        }
 
        firmware_register(&acpi_subsys);
@@ -770,7 +756,7 @@ static int __init acpi_init(void)
        } else
                disable_acpi();
 
-       return_VALUE(result);
+       return result;
 }
 
 subsys_initcall(acpi_init);
index 4b6d9f0096a10cb8cdf1409f8558cff7674b1e9b..fd1ba05eab688fb409d259d97848b88cec6c325c 100644 (file)
@@ -82,7 +82,6 @@ static struct acpi_driver acpi_button_driver = {
 };
 
 struct acpi_button {
-       acpi_handle handle;
        struct acpi_device *device;     /* Fixed button kludge */
        u8 type;
        unsigned long pushed;
@@ -112,15 +111,14 @@ static int acpi_button_info_seq_show(struct seq_file *seq, void *offset)
 {
        struct acpi_button *button = (struct acpi_button *)seq->private;
 
-       ACPI_FUNCTION_TRACE("acpi_button_info_seq_show");
 
        if (!button || !button->device)
-               return_VALUE(0);
+               return 0;
 
        seq_printf(seq, "type:                    %s\n",
                   acpi_device_name(button->device));
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_button_info_open_fs(struct inode *inode, struct file *file)
@@ -134,12 +132,11 @@ static int acpi_button_state_seq_show(struct seq_file *seq, void *offset)
        acpi_status status;
        unsigned long state;
 
-       ACPI_FUNCTION_TRACE("acpi_button_state_seq_show");
 
        if (!button || !button->device)
-               return_VALUE(0);
+               return 0;
 
-       status = acpi_evaluate_integer(button->handle, "_LID", NULL, &state);
+       status = acpi_evaluate_integer(button->device->handle, "_LID", NULL, &state);
        if (ACPI_FAILURE(status)) {
                seq_printf(seq, "state:      unsupported\n");
        } else {
@@ -147,7 +144,7 @@ static int acpi_button_state_seq_show(struct seq_file *seq, void *offset)
                           (state ? "open" : "closed"));
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_button_state_open_fs(struct inode *inode, struct file *file)
@@ -164,10 +161,9 @@ static int acpi_button_add_fs(struct acpi_device *device)
        struct proc_dir_entry *entry = NULL;
        struct acpi_button *button = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_button_add_fs");
 
        if (!device || !acpi_driver_data(device))
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        button = acpi_driver_data(device);
 
@@ -195,21 +191,19 @@ static int acpi_button_add_fs(struct acpi_device *device)
        }
 
        if (!entry)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        entry->owner = THIS_MODULE;
 
        acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), entry);
        if (!acpi_device_dir(device))
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        acpi_device_dir(device)->owner = THIS_MODULE;
 
        /* 'info' [R] */
        entry = create_proc_entry(ACPI_BUTTON_FILE_INFO,
                                  S_IRUGO, acpi_device_dir(device));
        if (!entry)
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to create '%s' fs entry\n",
-                                 ACPI_BUTTON_FILE_INFO));
+               return -ENODEV;
        else {
                entry->proc_fops = &acpi_button_info_fops;
                entry->data = acpi_driver_data(device);
@@ -221,9 +215,7 @@ static int acpi_button_add_fs(struct acpi_device *device)
                entry = create_proc_entry(ACPI_BUTTON_FILE_STATE,
                                          S_IRUGO, acpi_device_dir(device));
                if (!entry)
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                         "Unable to create '%s' fs entry\n",
-                                         ACPI_BUTTON_FILE_INFO));
+                       return -ENODEV;
                else {
                        entry->proc_fops = &acpi_button_state_fops;
                        entry->data = acpi_driver_data(device);
@@ -231,14 +223,13 @@ static int acpi_button_add_fs(struct acpi_device *device)
                }
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_button_remove_fs(struct acpi_device *device)
 {
        struct acpi_button *button = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_button_remove_fs");
 
        button = acpi_driver_data(device);
        if (acpi_device_dir(device)) {
@@ -253,7 +244,7 @@ static int acpi_button_remove_fs(struct acpi_device *device)
                acpi_device_dir(device) = NULL;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 /* --------------------------------------------------------------------------
@@ -264,10 +255,9 @@ static void acpi_button_notify(acpi_handle handle, u32 event, void *data)
 {
        struct acpi_button *button = (struct acpi_button *)data;
 
-       ACPI_FUNCTION_TRACE("acpi_button_notify");
 
        if (!button || !button->device)
-               return_VOID;
+               return;
 
        switch (event) {
        case ACPI_BUTTON_NOTIFY_STATUS:
@@ -280,21 +270,20 @@ static void acpi_button_notify(acpi_handle handle, u32 event, void *data)
                break;
        }
 
-       return_VOID;
+       return;
 }
 
 static acpi_status acpi_button_notify_fixed(void *data)
 {
        struct acpi_button *button = (struct acpi_button *)data;
 
-       ACPI_FUNCTION_TRACE("acpi_button_notify_fixed");
 
        if (!button)
-               return_ACPI_STATUS(AE_BAD_PARAMETER);
+               return AE_BAD_PARAMETER;
 
-       acpi_button_notify(button->handle, ACPI_BUTTON_NOTIFY_STATUS, button);
+       acpi_button_notify(button->device->handle, ACPI_BUTTON_NOTIFY_STATUS, button);
 
-       return_ACPI_STATUS(AE_OK);
+       return AE_OK;
 }
 
 static int acpi_button_add(struct acpi_device *device)
@@ -303,18 +292,16 @@ static int acpi_button_add(struct acpi_device *device)
        acpi_status status = AE_OK;
        struct acpi_button *button = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_button_add");
 
        if (!device)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        button = kmalloc(sizeof(struct acpi_button), GFP_KERNEL);
        if (!button)
-               return_VALUE(-ENOMEM);
+               return -ENOMEM;
        memset(button, 0, sizeof(struct acpi_button));
 
        button->device = device;
-       button->handle = device->handle;
        acpi_driver_data(device) = button;
 
        /*
@@ -349,8 +336,8 @@ static int acpi_button_add(struct acpi_device *device)
                sprintf(acpi_device_class(device), "%s/%s",
                        ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_LID);
        } else {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unsupported hid [%s]\n",
-                                 acpi_device_hid(device)));
+               printk(KERN_ERR PREFIX "Unsupported hid [%s]\n",
+                           acpi_device_hid(device));
                result = -ENODEV;
                goto end;
        }
@@ -373,7 +360,7 @@ static int acpi_button_add(struct acpi_device *device)
                                                     button);
                break;
        default:
-               status = acpi_install_notify_handler(button->handle,
+               status = acpi_install_notify_handler(device->handle,
                                                     ACPI_DEVICE_NOTIFY,
                                                     acpi_button_notify,
                                                     button);
@@ -381,8 +368,6 @@ static int acpi_button_add(struct acpi_device *device)
        }
 
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Error installing notify handler\n"));
                result = -ENODEV;
                goto end;
        }
@@ -406,7 +391,7 @@ static int acpi_button_add(struct acpi_device *device)
                kfree(button);
        }
 
-       return_VALUE(result);
+       return result;
 }
 
 static int acpi_button_remove(struct acpi_device *device, int type)
@@ -414,10 +399,9 @@ static int acpi_button_remove(struct acpi_device *device, int type)
        acpi_status status = 0;
        struct acpi_button *button = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_button_remove");
 
        if (!device || !acpi_driver_data(device))
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        button = acpi_driver_data(device);
 
@@ -434,45 +418,39 @@ static int acpi_button_remove(struct acpi_device *device, int type)
                                                    acpi_button_notify_fixed);
                break;
        default:
-               status = acpi_remove_notify_handler(button->handle,
+               status = acpi_remove_notify_handler(device->handle,
                                                    ACPI_DEVICE_NOTIFY,
                                                    acpi_button_notify);
                break;
        }
 
-       if (ACPI_FAILURE(status))
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Error removing notify handler\n"));
-
        acpi_button_remove_fs(device);
 
        kfree(button);
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int __init acpi_button_init(void)
 {
        int result = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_button_init");
 
        acpi_button_dir = proc_mkdir(ACPI_BUTTON_CLASS, acpi_root_dir);
        if (!acpi_button_dir)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        acpi_button_dir->owner = THIS_MODULE;
        result = acpi_bus_register_driver(&acpi_button_driver);
        if (result < 0) {
                remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir);
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 static void __exit acpi_button_exit(void)
 {
-       ACPI_FUNCTION_TRACE("acpi_button_exit");
 
        acpi_bus_unregister_driver(&acpi_button_driver);
 
@@ -484,7 +462,7 @@ static void __exit acpi_button_exit(void)
                remove_proc_entry(ACPI_BUTTON_SUBCLASS_LID, acpi_button_dir);
        remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir);
 
-       return_VOID;
+       return;
 }
 
 module_init(acpi_button_init);
diff --git a/drivers/acpi/cm_sbs.c b/drivers/acpi/cm_sbs.c
new file mode 100644 (file)
index 0000000..574a75a
--- /dev/null
@@ -0,0 +1,131 @@
+/*
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ *  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/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/acpi.h>
+#include <linux/types.h>
+#include <linux/proc_fs.h>
+#include <linux/seq_file.h>
+#include <acpi/acpi_bus.h>
+#include <acpi/acpi_drivers.h>
+#include <acpi/acmacros.h>
+#include <acpi/actypes.h>
+#include <acpi/acutils.h>
+
+ACPI_MODULE_NAME("cm_sbs")
+#define ACPI_AC_CLASS          "ac_adapter"
+#define ACPI_BATTERY_CLASS     "battery"
+#define ACPI_SBS_COMPONENT     0x00080000
+#define _COMPONENT             ACPI_SBS_COMPONENT
+static struct proc_dir_entry *acpi_ac_dir;
+static struct proc_dir_entry *acpi_battery_dir;
+
+static struct semaphore cm_sbs_sem;
+
+static int lock_ac_dir_cnt = 0;
+static int lock_battery_dir_cnt = 0;
+
+struct proc_dir_entry *acpi_lock_ac_dir(void)
+{
+
+       down(&cm_sbs_sem);
+       if (!acpi_ac_dir) {
+               acpi_ac_dir = proc_mkdir(ACPI_AC_CLASS, acpi_root_dir);
+       }
+       if (acpi_ac_dir) {
+               lock_ac_dir_cnt++;
+       } else {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "Cannot create %s\n", ACPI_AC_CLASS));
+       }
+       up(&cm_sbs_sem);
+       return acpi_ac_dir;
+}
+
+EXPORT_SYMBOL(acpi_lock_ac_dir);
+
+void acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir_param)
+{
+
+       down(&cm_sbs_sem);
+       if (acpi_ac_dir_param) {
+               lock_ac_dir_cnt--;
+       }
+       if (lock_ac_dir_cnt == 0 && acpi_ac_dir_param && acpi_ac_dir) {
+               remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir);
+               acpi_ac_dir = 0;
+       }
+       up(&cm_sbs_sem);
+}
+
+EXPORT_SYMBOL(acpi_unlock_ac_dir);
+
+struct proc_dir_entry *acpi_lock_battery_dir(void)
+{
+
+       down(&cm_sbs_sem);
+       if (!acpi_battery_dir) {
+               acpi_battery_dir =
+                   proc_mkdir(ACPI_BATTERY_CLASS, acpi_root_dir);
+       }
+       if (acpi_battery_dir) {
+               lock_battery_dir_cnt++;
+       } else {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "Cannot create %s\n", ACPI_BATTERY_CLASS));
+       }
+       up(&cm_sbs_sem);
+       return acpi_battery_dir;
+}
+
+EXPORT_SYMBOL(acpi_lock_battery_dir);
+
+void acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir_param)
+{
+
+       down(&cm_sbs_sem);
+       if (acpi_battery_dir_param) {
+               lock_battery_dir_cnt--;
+       }
+       if (lock_battery_dir_cnt == 0 && acpi_battery_dir_param
+           && acpi_battery_dir) {
+               remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir);
+               acpi_battery_dir = 0;
+       }
+       up(&cm_sbs_sem);
+       return;
+}
+
+EXPORT_SYMBOL(acpi_unlock_battery_dir);
+
+static int __init acpi_cm_sbs_init(void)
+{
+
+       if (acpi_disabled)
+               return 0;
+
+       init_MUTEX(&cm_sbs_sem);
+
+       return 0;
+}
+
+subsys_initcall(acpi_cm_sbs_init);
index b69a8cad82b7ca424f3915c1e0eca54e702be08a..871aa520ece78aaa50d94bbb90a29c3c9f4ef83b 100644 (file)
@@ -73,17 +73,16 @@ static int is_device_present(acpi_handle handle)
        acpi_status status;
        unsigned long sta;
 
-       ACPI_FUNCTION_TRACE("is_device_present");
 
        status = acpi_get_handle(handle, "_STA", &temp);
        if (ACPI_FAILURE(status))
-               return_VALUE(1);        /* _STA not found, assmue device present */
+               return 1;       /* _STA not found, assmue device present */
 
        status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
        if (ACPI_FAILURE(status))
-               return_VALUE(0);        /* Firmware error */
+               return 0;       /* Firmware error */
 
-       return_VALUE((sta & ACPI_STA_PRESENT) == ACPI_STA_PRESENT);
+       return ((sta & ACPI_STA_PRESENT) == ACPI_STA_PRESENT);
 }
 
 /*******************************************************************/
@@ -91,16 +90,15 @@ static int acpi_container_add(struct acpi_device *device)
 {
        struct acpi_container *container;
 
-       ACPI_FUNCTION_TRACE("acpi_container_add");
 
        if (!device) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "device is NULL\n"));
-               return_VALUE(-EINVAL);
+               printk(KERN_ERR PREFIX "device is NULL\n");
+               return -EINVAL;
        }
 
        container = kmalloc(sizeof(struct acpi_container), GFP_KERNEL);
        if (!container)
-               return_VALUE(-ENOMEM);
+               return -ENOMEM;
 
        memset(container, 0, sizeof(struct acpi_container));
        container->handle = device->handle;
@@ -111,7 +109,7 @@ static int acpi_container_add(struct acpi_device *device)
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device <%s> bid <%s>\n",
                          acpi_device_name(device), acpi_device_bid(device)));
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_container_remove(struct acpi_device *device, int type)
@@ -130,23 +128,22 @@ static int container_device_add(struct acpi_device **device, acpi_handle handle)
        struct acpi_device *pdev;
        int result;
 
-       ACPI_FUNCTION_TRACE("container_device_add");
 
        if (acpi_get_parent(handle, &phandle)) {
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        }
 
        if (acpi_bus_get_device(phandle, &pdev)) {
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        }
 
        if (acpi_bus_add(device, pdev, handle, ACPI_BUS_TYPE_DEVICE)) {
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        }
 
        result = acpi_bus_start(*device);
 
-       return_VALUE(result);
+       return result;
 }
 
 static void container_notify_cb(acpi_handle handle, u32 type, void *context)
@@ -156,7 +153,6 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context)
        int present;
        acpi_status status;
 
-       ACPI_FUNCTION_TRACE("container_notify_cb");
 
        present = is_device_present(handle);
 
@@ -192,7 +188,7 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context)
        default:
                break;
        }
-       return_VOID;
+       return;
 }
 
 static acpi_status
@@ -205,11 +201,10 @@ container_walk_namespace_cb(acpi_handle handle,
        acpi_status status;
        int *action = context;
 
-       ACPI_FUNCTION_TRACE("container_walk_namespace_cb");
 
        status = acpi_get_object_info(handle, &buffer);
        if (ACPI_FAILURE(status) || !buffer.pointer) {
-               return_ACPI_STATUS(AE_OK);
+               return AE_OK;
        }
 
        info = buffer.pointer;
@@ -241,9 +236,9 @@ container_walk_namespace_cb(acpi_handle handle,
        }
 
       end:
-       acpi_os_free(buffer.pointer);
+       kfree(buffer.pointer);
 
-       return_ACPI_STATUS(AE_OK);
+       return AE_OK;
 }
 
 static int __init acpi_container_init(void)
@@ -269,7 +264,6 @@ static void __exit acpi_container_exit(void)
 {
        int action = UNINSTALL_NOTIFY_HANDLER;
 
-       ACPI_FUNCTION_TRACE("acpi_container_exit");
 
        acpi_walk_namespace(ACPI_TYPE_DEVICE,
                            ACPI_ROOT_OBJECT,
@@ -278,7 +272,7 @@ static void __exit acpi_container_exit(void)
 
        acpi_bus_unregister_driver(&acpi_container_driver);
 
-       return_VOID;
+       return;
 }
 
 module_init(acpi_container_init);
index 263322b7d113d743caa9200ce7b9b8c592cd284b..35c6af8a83cdd23c5d0d1082eb0465f7858ee290 100644 (file)
@@ -155,13 +155,12 @@ acpi_system_write_debug(struct file *file,
 {
        char debug_string[12] = { '\0' };
 
-       ACPI_FUNCTION_TRACE("acpi_system_write_debug");
 
        if (count > sizeof(debug_string) - 1)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (copy_from_user(debug_string, buffer, count))
-               return_VALUE(-EFAULT);
+               return -EFAULT;
 
        debug_string[count] = '\0';
 
@@ -173,10 +172,10 @@ acpi_system_write_debug(struct file *file,
                acpi_dbg_level = simple_strtoul(debug_string, NULL, 0);
                break;
        default:
-               return_VALUE(-EINVAL);
+               return -EINVAL;
        }
 
-       return_VALUE(count);
+       return count;
 }
 
 static int __init acpi_debug_init(void)
@@ -185,10 +184,9 @@ static int __init acpi_debug_init(void)
        int error = 0;
        char *name;
 
-       ACPI_FUNCTION_TRACE("acpi_debug_init");
 
        if (acpi_disabled)
-               return_VALUE(0);
+               return 0;
 
        /* 'debug_layer' [R/W] */
        name = ACPI_SYSTEM_FILE_DEBUG_LAYER;
@@ -213,15 +211,12 @@ static int __init acpi_debug_init(void)
                goto Error;
 
       Done:
-       return_VALUE(error);
+       return error;
 
       Error:
-       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                         "Unable to create '%s' proc fs entry\n", name));
-
        remove_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LEVEL, acpi_root_dir);
        remove_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LAYER, acpi_root_dir);
-       error = -EFAULT;
+       error = -ENODEV;
        goto Done;
 }
 
index bbdf990e9f658c3ed9e08af3646e96244a0de844..daf51b5b5875fd4978b8926d80931a19134c9806 100644 (file)
@@ -125,37 +125,7 @@ acpi_ds_init_one_object(acpi_handle obj_handle,
                if (info->table_desc->pointer->revision == 1) {
                        node->flags |= ANOBJ_DATA_WIDTH_32;
                }
-#ifdef ACPI_INIT_PARSE_METHODS
-               /*
-                * Note 11/2005: Removed this code to parse all methods during table
-                * load because it causes problems if there are any errors during the
-                * parse. Also, it seems like overkill and we probably don't want to
-                * abort a table load because of an issue with a single method.
-                */
-
-               /*
-                * Print a dot for each method unless we are going to print
-                * the entire pathname
-                */
-               if (!(acpi_dbg_level & ACPI_LV_INIT_NAMES)) {
-                       ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, "."));
-               }
 
-               /*
-                * Always parse methods to detect errors, we will delete
-                * the parse tree below
-                */
-               status = acpi_ds_parse_method(obj_handle);
-               if (ACPI_FAILURE(status)) {
-                       ACPI_ERROR((AE_INFO,
-                                   "Method %p [%4.4s] - parse failure, %s",
-                                   obj_handle,
-                                   acpi_ut_get_node_name(obj_handle),
-                                   acpi_format_exception(status)));
-
-                       /* This parse failed, but we will continue parsing more methods */
-               }
-#endif
                info->method_count++;
                break;
 
index bc9aca4e74019ea34a43077904fe1809de789a6a..a39a33f4847aac07ff519dc5f89f6e2afebe7994 100644 (file)
 #define _COMPONENT          ACPI_DISPATCHER
 ACPI_MODULE_NAME("dsmethod")
 
+/* Local prototypes */
+static acpi_status
+acpi_ds_create_method_mutex(union acpi_operand_object *method_desc);
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ds_method_error
@@ -67,6 +71,7 @@ ACPI_MODULE_NAME("dsmethod")
  *              Note: Allows the exception handler to change the status code
  *
  ******************************************************************************/
+
 acpi_status
 acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state)
 {
@@ -111,13 +116,53 @@ acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state)
        return (status);
 }
 
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ds_create_method_mutex
+ *
+ * PARAMETERS:  obj_desc            - The method object
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Create a mutex object for a serialized control method
+ *
+ ******************************************************************************/
+
+static acpi_status
+acpi_ds_create_method_mutex(union acpi_operand_object *method_desc)
+{
+       union acpi_operand_object *mutex_desc;
+       acpi_status status;
+
+       ACPI_FUNCTION_NAME(ds_create_method_mutex);
+
+       /* Create the new mutex object */
+
+       mutex_desc = acpi_ut_create_internal_object(ACPI_TYPE_MUTEX);
+       if (!mutex_desc) {
+               return_ACPI_STATUS(AE_NO_MEMORY);
+       }
+
+       /* Create the actual OS Mutex */
+
+       status = acpi_os_create_mutex(&mutex_desc->mutex.os_mutex);
+       if (ACPI_FAILURE(status)) {
+               return_ACPI_STATUS(status);
+       }
+
+       mutex_desc->mutex.sync_level = method_desc->method.sync_level;
+       method_desc->method.mutex = mutex_desc;
+       return_ACPI_STATUS(AE_OK);
+}
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ds_begin_method_execution
  *
  * PARAMETERS:  method_node         - Node of the method
  *              obj_desc            - The method object
- *              calling_method_node - Caller of this method (if non-null)
+ *              walk_state          - current state, NULL if not yet executing
+ *                                    a method.
  *
  * RETURN:      Status
  *
@@ -128,9 +173,9 @@ acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state)
  ******************************************************************************/
 
 acpi_status
-acpi_ds_begin_method_execution(struct acpi_namespace_node * method_node,
-                              union acpi_operand_object * obj_desc,
-                              struct acpi_namespace_node * calling_method_node)
+acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
+                              union acpi_operand_object *obj_desc,
+                              struct acpi_walk_state *walk_state)
 {
        acpi_status status = AE_OK;
 
@@ -149,35 +194,80 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node * method_node,
        }
 
        /*
-        * If there is a concurrency limit on this method, we need to
-        * obtain a unit from the method semaphore.
+        * If this method is serialized, we need to acquire the method mutex.
         */
-       if (obj_desc->method.semaphore) {
+       if (obj_desc->method.method_flags & AML_METHOD_SERIALIZED) {
                /*
-                * Allow recursive method calls, up to the reentrancy/concurrency
-                * limit imposed by the SERIALIZED rule and the sync_level method
-                * parameter.
-                *
-                * The point of this code is to avoid permanently blocking a
-                * thread that is making recursive method calls.
+                * Create a mutex for the method if it is defined to be Serialized
+                * and a mutex has not already been created. We defer the mutex creation
+                * until a method is actually executed, to minimize the object count
                 */
-               if (method_node == calling_method_node) {
-                       if (obj_desc->method.thread_count >=
-                           obj_desc->method.concurrency) {
-                               return_ACPI_STATUS(AE_AML_METHOD_LIMIT);
+               if (!obj_desc->method.mutex) {
+                       status = acpi_ds_create_method_mutex(obj_desc);
+                       if (ACPI_FAILURE(status)) {
+                               return_ACPI_STATUS(status);
                        }
                }
 
                /*
-                * Get a unit from the method semaphore. This releases the
-                * interpreter if we block (then reacquires it)
+                * The current_sync_level (per-thread) must be less than or equal to
+                * the sync level of the method. This mechanism provides some
+                * deadlock prevention
+                *
+                * Top-level method invocation has no walk state at this point
                 */
-               status =
-                   acpi_ex_system_wait_semaphore(obj_desc->method.semaphore,
-                                                 ACPI_WAIT_FOREVER);
-               if (ACPI_FAILURE(status)) {
-                       return_ACPI_STATUS(status);
+               if (walk_state &&
+                   (walk_state->thread->current_sync_level >
+                    obj_desc->method.mutex->mutex.sync_level)) {
+                       ACPI_ERROR((AE_INFO,
+                                   "Cannot acquire Mutex for method [%4.4s], current SyncLevel is too large (%d)",
+                                   acpi_ut_get_node_name(method_node),
+                                   walk_state->thread->current_sync_level));
+
+                       return_ACPI_STATUS(AE_AML_MUTEX_ORDER);
                }
+
+               /*
+                * Obtain the method mutex if necessary. Do not acquire mutex for a
+                * recursive call.
+                */
+               if (!walk_state ||
+                   !obj_desc->method.mutex->mutex.owner_thread ||
+                   (walk_state->thread !=
+                    obj_desc->method.mutex->mutex.owner_thread)) {
+                       /*
+                        * Acquire the method mutex. This releases the interpreter if we
+                        * block (and reacquires it before it returns)
+                        */
+                       status =
+                           acpi_ex_system_wait_mutex(obj_desc->method.mutex->
+                                                     mutex.os_mutex,
+                                                     ACPI_WAIT_FOREVER);
+                       if (ACPI_FAILURE(status)) {
+                               return_ACPI_STATUS(status);
+                       }
+
+                       /* Update the mutex and walk info and save the original sync_level */
+
+                       if (walk_state) {
+                               obj_desc->method.mutex->mutex.
+                                   original_sync_level =
+                                   walk_state->thread->current_sync_level;
+
+                               obj_desc->method.mutex->mutex.owner_thread =
+                                   walk_state->thread;
+                               walk_state->thread->current_sync_level =
+                                   obj_desc->method.sync_level;
+                       } else {
+                               obj_desc->method.mutex->mutex.
+                                   original_sync_level =
+                                   obj_desc->method.mutex->mutex.sync_level;
+                       }
+               }
+
+               /* Always increase acquisition depth */
+
+               obj_desc->method.mutex->mutex.acquisition_depth++;
        }
 
        /*
@@ -200,10 +290,10 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node * method_node,
        return_ACPI_STATUS(status);
 
       cleanup:
-       /* On error, must signal the method semaphore if present */
+       /* On error, must release the method mutex (if present) */
 
-       if (obj_desc->method.semaphore) {
-               (void)acpi_os_signal_semaphore(obj_desc->method.semaphore, 1);
+       if (obj_desc->method.mutex) {
+               acpi_os_release_mutex(obj_desc->method.mutex->mutex.os_mutex);
        }
        return_ACPI_STATUS(status);
 }
@@ -253,10 +343,10 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
                return_ACPI_STATUS(AE_NULL_OBJECT);
        }
 
-       /* Init for new method, possibly wait on concurrency semaphore */
+       /* Init for new method, possibly wait on method mutex */
 
        status = acpi_ds_begin_method_execution(method_node, obj_desc,
-                                               this_walk_state->method_node);
+                                               this_walk_state);
        if (ACPI_FAILURE(status)) {
                return_ACPI_STATUS(status);
        }
@@ -478,6 +568,8 @@ acpi_ds_restart_control_method(struct acpi_walk_state *walk_state,
  *              created, delete all locals and arguments, and delete the parse
  *              tree if requested.
  *
+ * MUTEX:       Interpreter is locked
+ *
  ******************************************************************************/
 
 void
@@ -503,26 +595,21 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
        }
 
        /*
-        * Lock the parser while we terminate this method.
-        * If this is the last thread executing the method,
-        * we have additional cleanup to perform
+        * If method is serialized, release the mutex and restore the
+        * current sync level for this thread
         */
-       status = acpi_ut_acquire_mutex(ACPI_MTX_CONTROL_METHOD);
-       if (ACPI_FAILURE(status)) {
-               return_VOID;
-       }
+       if (method_desc->method.mutex) {
 
-       /* Signal completion of the execution of this method if necessary */
+               /* Acquisition Depth handles recursive calls */
 
-       if (method_desc->method.semaphore) {
-               status =
-                   acpi_os_signal_semaphore(method_desc->method.semaphore, 1);
-               if (ACPI_FAILURE(status)) {
-
-                       /* Ignore error and continue */
+               method_desc->method.mutex->mutex.acquisition_depth--;
+               if (!method_desc->method.mutex->mutex.acquisition_depth) {
+                       walk_state->thread->current_sync_level =
+                           method_desc->method.mutex->mutex.
+                           original_sync_level;
 
-                       ACPI_EXCEPTION((AE_INFO, status,
-                                       "Could not signal method semaphore"));
+                       acpi_os_release_mutex(method_desc->method.mutex->mutex.
+                                             os_mutex);
                }
        }
 
@@ -537,7 +624,7 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
 
                status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
                if (ACPI_FAILURE(status)) {
-                       goto exit;
+                       return_VOID;
                }
 
                /*
@@ -580,18 +667,16 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
                /*
                 * Support to dynamically change a method from not_serialized to
                 * Serialized if it appears that the method is incorrectly written and
-                * does not support multiple thread execution.  The best example of this
-                * is if such a method creates namespace objects and blocks.  A second
+                * does not support multiple thread execution. The best example of this
+                * is if such a method creates namespace objects and blocks. A second
                 * thread will fail with an AE_ALREADY_EXISTS exception
                 *
                 * This code is here because we must wait until the last thread exits
                 * before creating the synchronization semaphore.
                 */
-               if ((method_desc->method.concurrency == 1) &&
-                   (!method_desc->method.semaphore)) {
-                       status = acpi_os_create_semaphore(1, 1,
-                                                         &method_desc->method.
-                                                         semaphore);
+               if ((method_desc->method.method_flags & AML_METHOD_SERIALIZED)
+                   && (!method_desc->method.mutex)) {
+                       status = acpi_ds_create_method_mutex(method_desc);
                }
 
                /* No more threads, we can free the owner_id */
@@ -599,144 +684,5 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
                acpi_ut_release_owner_id(&method_desc->method.owner_id);
        }
 
-      exit:
-       (void)acpi_ut_release_mutex(ACPI_MTX_CONTROL_METHOD);
        return_VOID;
 }
-
-#ifdef ACPI_INIT_PARSE_METHODS
-       /*
-        * Note 11/2005: Removed this code to parse all methods during table
-        * load because it causes problems if there are any errors during the
-        * parse. Also, it seems like overkill and we probably don't want to
-        * abort a table load because of an issue with a single method.
-        */
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_ds_parse_method
- *
- * PARAMETERS:  Node        - Method node
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Parse the AML that is associated with the method.
- *
- * MUTEX:       Assumes parser is locked
- *
- ******************************************************************************/
-
-acpi_status acpi_ds_parse_method(struct acpi_namespace_node *node)
-{
-       acpi_status status;
-       union acpi_operand_object *obj_desc;
-       union acpi_parse_object *op;
-       struct acpi_walk_state *walk_state;
-
-       ACPI_FUNCTION_TRACE_PTR(ds_parse_method, node);
-
-       /* Parameter Validation */
-
-       if (!node) {
-               return_ACPI_STATUS(AE_NULL_ENTRY);
-       }
-
-       ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
-                         "**** Parsing [%4.4s] **** NamedObj=%p\n",
-                         acpi_ut_get_node_name(node), node));
-
-       /* Extract the method object from the method Node */
-
-       obj_desc = acpi_ns_get_attached_object(node);
-       if (!obj_desc) {
-               return_ACPI_STATUS(AE_NULL_OBJECT);
-       }
-
-       /* Create a mutex for the method if there is a concurrency limit */
-
-       if ((obj_desc->method.concurrency != ACPI_INFINITE_CONCURRENCY) &&
-           (!obj_desc->method.semaphore)) {
-               status = acpi_os_create_semaphore(obj_desc->method.concurrency,
-                                                 obj_desc->method.concurrency,
-                                                 &obj_desc->method.semaphore);
-               if (ACPI_FAILURE(status)) {
-                       return_ACPI_STATUS(status);
-               }
-       }
-
-       /*
-        * Allocate a new parser op to be the root of the parsed
-        * method tree
-        */
-       op = acpi_ps_alloc_op(AML_METHOD_OP);
-       if (!op) {
-               return_ACPI_STATUS(AE_NO_MEMORY);
-       }
-
-       /* Init new op with the method name and pointer back to the Node */
-
-       acpi_ps_set_name(op, node->name.integer);
-       op->common.node = node;
-
-       /*
-        * Get a new owner_id for objects created by this method. Namespace
-        * objects (such as Operation Regions) can be created during the
-        * first pass parse.
-        */
-       status = acpi_ut_allocate_owner_id(&obj_desc->method.owner_id);
-       if (ACPI_FAILURE(status)) {
-               goto cleanup;
-       }
-
-       /* Create and initialize a new walk state */
-
-       walk_state =
-           acpi_ds_create_walk_state(obj_desc->method.owner_id, NULL, NULL,
-                                     NULL);
-       if (!walk_state) {
-               status = AE_NO_MEMORY;
-               goto cleanup2;
-       }
-
-       status = acpi_ds_init_aml_walk(walk_state, op, node,
-                                      obj_desc->method.aml_start,
-                                      obj_desc->method.aml_length, NULL, 1);
-       if (ACPI_FAILURE(status)) {
-               acpi_ds_delete_walk_state(walk_state);
-               goto cleanup2;
-       }
-
-       /*
-        * Parse the method, first pass
-        *
-        * The first pass load is where newly declared named objects are added into
-        * the namespace.  Actual evaluation of the named objects (what would be
-        * called a "second pass") happens during the actual execution of the
-        * method so that operands to the named objects can take on dynamic
-        * run-time values.
-        */
-       status = acpi_ps_parse_aml(walk_state);
-       if (ACPI_FAILURE(status)) {
-               goto cleanup2;
-       }
-
-       ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
-                         "**** [%4.4s] Parsed **** NamedObj=%p Op=%p\n",
-                         acpi_ut_get_node_name(node), node, op));
-
-       /*
-        * Delete the parse tree. We simply re-parse the method for every
-        * execution since there isn't much overhead (compared to keeping lots
-        * of parse trees around)
-        */
-       acpi_ns_delete_namespace_subtree(node);
-       acpi_ns_delete_namespace_by_owner(obj_desc->method.owner_id);
-
-      cleanup2:
-       acpi_ut_release_owner_id(&obj_desc->method.owner_id);
-
-      cleanup:
-       acpi_ps_delete_parse_tree(op);
-       return_ACPI_STATUS(status);
-}
-#endif
index 3acbd9145d72f5309ed67964ebd4dd5bdf68d067..b1ded62d0df1d343ffb1f3da6422fc66d712d8d1 100644 (file)
@@ -472,7 +472,6 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
                            acpi_ds_result_push(walk_state->result_obj,
                                                walk_state);
                }
-
                break;
 
        default:
@@ -510,6 +509,7 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
                                ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
                                                  "Method Reference in a Package, Op=%p\n",
                                                  op));
+
                                op->common.node =
                                    (struct acpi_namespace_node *)op->asl.value.
                                    arg->asl.node->object;
@@ -670,7 +670,6 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
 
                                status = acpi_ds_result_stack_pop(walk_state);
                        }
-
                        break;
 
                case AML_TYPE_UNDEFINED:
@@ -708,7 +707,6 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
         * Check if we just completed the evaluation of a
         * conditional predicate
         */
-
        if ((ACPI_SUCCESS(status)) &&
            (walk_state->control_state) &&
            (walk_state->control_state->common.state ==
index 35074399c6179d83fecd8d81c4a95213a55c43f0..e3ca7f6539c1318a4a5012ba28481ed6508e58e6 100644 (file)
@@ -175,7 +175,7 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
                if (status == AE_NOT_FOUND) {
                        /*
                         * Table disassembly:
-                        * Target of Scope() not found.  Generate an External for it, and
+                        * Target of Scope() not found. Generate an External for it, and
                         * insert the name into the namespace.
                         */
                        acpi_dm_add_to_external_list(path, ACPI_TYPE_DEVICE, 0);
@@ -210,16 +210,15 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
                case ACPI_TYPE_BUFFER:
 
                        /*
-                        * These types we will allow, but we will change the type.  This
+                        * These types we will allow, but we will change the type. This
                         * enables some existing code of the form:
                         *
                         *  Name (DEB, 0)
                         *  Scope (DEB) { ... }
                         *
-                        * Note: silently change the type here.  On the second pass, we will report
+                        * Note: silently change the type here. On the second pass, we will report
                         * a warning
                         */
-
                        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                          "Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)\n",
                                          path,
@@ -242,7 +241,6 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
                break;
 
        default:
-
                /*
                 * For all other named opcodes, we will enter the name into
                 * the namespace.
@@ -259,7 +257,6 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
                 *       buffer_field, or Package), the name of the object is already
                 *       in the namespace.
                 */
-
                if (walk_state->deferred_node) {
 
                        /* This name is already in the namespace, get the node */
@@ -293,8 +290,8 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
                }
 
                /*
-                * Enter the named type into the internal namespace.  We enter the name
-                * as we go downward in the parse tree.  Any necessary subobjects that
+                * Enter the named type into the internal namespace. We enter the name
+                * as we go downward in the parse tree. Any necessary subobjects that
                 * involve arguments to the opcode must be created as we go back up the
                 * parse tree later.
                 */
@@ -327,12 +324,12 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
                                                            (status);
                                                }
                                        }
+
                                        status = AE_OK;
                                }
                        }
 
                        if (ACPI_FAILURE(status)) {
-
                                ACPI_ERROR_NAMESPACE(path, status);
                                return_ACPI_STATUS(status);
                        }
@@ -434,9 +431,13 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state)
                        status =
                            acpi_ex_create_region(op->named.data,
                                                  op->named.length,
-                                                 (acpi_adr_space_type)
-                                                 ((op->common.value.arg)->
-                                                  common.value.integer),
+                                                 (acpi_adr_space_type) ((op->
+                                                                         common.
+                                                                         value.
+                                                                         arg)->
+                                                                        common.
+                                                                        value.
+                                                                        integer),
                                                  walk_state);
                        if (ACPI_FAILURE(status)) {
                                return_ACPI_STATUS(status);
@@ -474,7 +475,7 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state)
                         * method_op pkg_length name_string method_flags term_list
                         *
                         * Note: We must create the method node/object pair as soon as we
-                        * see the method declaration.  This allows later pass1 parsing
+                        * see the method declaration. This allows later pass1 parsing
                         * of invocations of the method (need to know the number of
                         * arguments.)
                         */
@@ -499,6 +500,7 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state)
                                                                  length,
                                                                  walk_state);
                                }
+
                                walk_state->operands[0] = NULL;
                                walk_state->num_operands = 0;
 
@@ -570,7 +572,6 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
 #ifdef ACPI_ENABLE_MODULE_LEVEL_CODE
                        if ((walk_state->op_info->class == AML_CLASS_EXECUTE) ||
                            (walk_state->op_info->class == AML_CLASS_CONTROL)) {
-
                                ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
                                                  "Begin/EXEC: %s (fl %8.8X)\n",
                                                  walk_state->op_info->name,
@@ -602,7 +603,7 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
                } else {
                        /* Get name from the op */
 
-                       buffer_ptr = (char *)&op->named.name;
+                       buffer_ptr = ACPI_CAST_PTR(char, &op->named.name);
                }
        } else {
                /* Get the namestring from the raw AML */
@@ -629,7 +630,6 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
                break;
 
        case AML_INT_NAMEPATH_OP:
-
                /*
                 * The name_path is an object reference to an existing object.
                 * Don't enter the name into the namespace, but look it up
@@ -642,7 +642,6 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
                break;
 
        case AML_SCOPE_OP:
-
                /*
                 * The Path is an object reference to an existing object.
                 * Don't enter the name into the namespace, but look it up
@@ -664,6 +663,7 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
 #endif
                        return_ACPI_STATUS(status);
                }
+
                /*
                 * We must check to make sure that the target is
                 * one of the opcodes that actually opens a scope
@@ -683,13 +683,12 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
                case ACPI_TYPE_BUFFER:
 
                        /*
-                        * These types we will allow, but we will change the type.  This
+                        * These types we will allow, but we will change the type. This
                         * enables some existing code of the form:
                         *
                         *  Name (DEB, 0)
                         *  Scope (DEB) { ... }
                         */
-
                        ACPI_WARNING((AE_INFO,
                                      "Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)",
                                      buffer_ptr,
@@ -729,14 +728,14 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
                                if (ACPI_FAILURE(status)) {
                                        return_ACPI_STATUS(status);
                                }
-
                        }
+
                        return_ACPI_STATUS(AE_OK);
                }
 
                /*
-                * Enter the named type into the internal namespace.  We enter the name
-                * as we go downward in the parse tree.  Any necessary subobjects that
+                * Enter the named type into the internal namespace. We enter the name
+                * as we go downward in the parse tree. Any necessary subobjects that
                 * involve arguments to the opcode must be created as we go back up the
                 * parse tree later.
                 *
@@ -787,7 +786,6 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
         * can get it again quickly when this scope is closed
         */
        op->common.node = node;
-
        return_ACPI_STATUS(status);
 }
 
@@ -922,7 +920,6 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
 #ifndef ACPI_NO_METHOD_EXECUTION
 
        case AML_TYPE_CREATE_FIELD:
-
                /*
                 * Create the field object, but the field buffer and index must
                 * be evaluated later during the execution phase
@@ -931,7 +928,6 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
                break;
 
        case AML_TYPE_NAMED_FIELD:
-
                /*
                 * If we are executing a method, initialize the field
                 */
@@ -1051,6 +1047,7 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
                         * argument is the space_id. (We must save the address of the
                         * AML of the address and length operands)
                         */
+
                        /*
                         * If we have a valid region, initialize it
                         * Namespace is NOT locked at this point.
@@ -1080,7 +1077,7 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
                         * method_op pkg_length name_string method_flags term_list
                         *
                         * Note: We must create the method node/object pair as soon as we
-                        * see the method declaration.  This allows later pass1 parsing
+                        * see the method declaration. This allows later pass1 parsing
                         * of invocations of the method (need to know the number of
                         * arguments.)
                         */
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
new file mode 100644 (file)
index 0000000..510a945
--- /dev/null
@@ -0,0 +1,739 @@
+/*
+ *  dock.c - ACPI dock station driver
+ *
+ *  Copyright (C) 2006 Kristen Carlson Accardi <kristen.c.accardi@intel.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/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/notifier.h>
+#include <acpi/acpi_bus.h>
+#include <acpi/acpi_drivers.h>
+
+#define ACPI_DOCK_DRIVER_NAME "ACPI Dock Station Driver"
+
+ACPI_MODULE_NAME("dock")
+MODULE_AUTHOR("Kristen Carlson Accardi");
+MODULE_DESCRIPTION(ACPI_DOCK_DRIVER_NAME);
+MODULE_LICENSE("GPL");
+
+static struct atomic_notifier_head dock_notifier_list;
+
+struct dock_station {
+       acpi_handle handle;
+       unsigned long last_dock_time;
+       u32 flags;
+       spinlock_t dd_lock;
+       spinlock_t hp_lock;
+       struct list_head dependent_devices;
+       struct list_head hotplug_devices;
+};
+
+struct dock_dependent_device {
+       struct list_head list;
+       struct list_head hotplug_list;
+       acpi_handle handle;
+       acpi_notify_handler handler;
+       void *context;
+};
+
+#define DOCK_DOCKING   0x00000001
+#define DOCK_EVENT     KOBJ_DOCK
+#define UNDOCK_EVENT   KOBJ_UNDOCK
+
+static struct dock_station *dock_station;
+
+/*****************************************************************************
+ *                         Dock Dependent device functions                   *
+ *****************************************************************************/
+/**
+ *  alloc_dock_dependent_device - allocate and init a dependent device
+ *  @handle: the acpi_handle of the dependent device
+ *
+ *  Allocate memory for a dependent device structure for a device referenced
+ *  by the acpi handle
+ */
+static struct dock_dependent_device *
+alloc_dock_dependent_device(acpi_handle handle)
+{
+       struct dock_dependent_device *dd;
+
+       dd = kzalloc(sizeof(*dd), GFP_KERNEL);
+       if (dd) {
+               dd->handle = handle;
+               INIT_LIST_HEAD(&dd->list);
+               INIT_LIST_HEAD(&dd->hotplug_list);
+       }
+       return dd;
+}
+
+/**
+ * add_dock_dependent_device - associate a device with the dock station
+ * @ds: The dock station
+ * @dd: The dependent device
+ *
+ * Add the dependent device to the dock's dependent device list.
+ */
+static void
+add_dock_dependent_device(struct dock_station *ds,
+                         struct dock_dependent_device *dd)
+{
+       spin_lock(&ds->dd_lock);
+       list_add_tail(&dd->list, &ds->dependent_devices);
+       spin_unlock(&ds->dd_lock);
+}
+
+/**
+ * dock_add_hotplug_device - associate a hotplug handler with the dock station
+ * @ds: The dock station
+ * @dd: The dependent device struct
+ *
+ * Add the dependent device to the dock's hotplug device list
+ */
+static void
+dock_add_hotplug_device(struct dock_station *ds,
+                       struct dock_dependent_device *dd)
+{
+       spin_lock(&ds->hp_lock);
+       list_add_tail(&dd->hotplug_list, &ds->hotplug_devices);
+       spin_unlock(&ds->hp_lock);
+}
+
+/**
+ * dock_del_hotplug_device - remove a hotplug handler from the dock station
+ * @ds: The dock station
+ * @dd: the dependent device struct
+ *
+ * Delete the dependent device from the dock's hotplug device list
+ */
+static void
+dock_del_hotplug_device(struct dock_station *ds,
+                       struct dock_dependent_device *dd)
+{
+       spin_lock(&ds->hp_lock);
+       list_del(&dd->hotplug_list);
+       spin_unlock(&ds->hp_lock);
+}
+
+/**
+ * find_dock_dependent_device - get a device dependent on this dock
+ * @ds: the dock station
+ * @handle: the acpi_handle of the device we want
+ *
+ * iterate over the dependent device list for this dock.  If the
+ * dependent device matches the handle, return.
+ */
+static struct dock_dependent_device *
+find_dock_dependent_device(struct dock_station *ds, acpi_handle handle)
+{
+       struct dock_dependent_device *dd;
+
+       spin_lock(&ds->dd_lock);
+       list_for_each_entry(dd, &ds->dependent_devices, list) {
+               if (handle == dd->handle) {
+                       spin_unlock(&ds->dd_lock);
+                       return dd;
+               }
+       }
+       spin_unlock(&ds->dd_lock);
+       return NULL;
+}
+
+/*****************************************************************************
+ *                         Dock functions                                    *
+ *****************************************************************************/
+/**
+ * is_dock - see if a device is a dock station
+ * @handle: acpi handle of the device
+ *
+ * If an acpi object has a _DCK method, then it is by definition a dock
+ * station, so return true.
+ */
+static int is_dock(acpi_handle handle)
+{
+       acpi_status status;
+       acpi_handle tmp;
+
+       status = acpi_get_handle(handle, "_DCK", &tmp);
+       if (ACPI_FAILURE(status))
+               return 0;
+       return 1;
+}
+
+/**
+ * is_dock_device - see if a device is on a dock station
+ * @handle: acpi handle of the device
+ *
+ * If this device is either the dock station itself,
+ * or is a device dependent on the dock station, then it
+ * is a dock device
+ */
+int is_dock_device(acpi_handle handle)
+{
+       if (!dock_station)
+               return 0;
+
+       if (is_dock(handle) || find_dock_dependent_device(dock_station, handle))
+               return 1;
+
+       return 0;
+}
+
+EXPORT_SYMBOL_GPL(is_dock_device);
+
+/**
+ * dock_present - see if the dock station is present.
+ * @ds: the dock station
+ *
+ * execute the _STA method.  note that present does not
+ * imply that we are docked.
+ */
+static int dock_present(struct dock_station *ds)
+{
+       unsigned long sta;
+       acpi_status status;
+
+       if (ds) {
+               status = acpi_evaluate_integer(ds->handle, "_STA", NULL, &sta);
+               if (ACPI_SUCCESS(status) && sta)
+                       return 1;
+       }
+       return 0;
+}
+
+
+
+/**
+ * dock_create_acpi_device - add new devices to acpi
+ * @handle - handle of the device to add
+ *
+ *  This function will create a new acpi_device for the given
+ *  handle if one does not exist already.  This should cause
+ *  acpi to scan for drivers for the given devices, and call
+ *  matching driver's add routine.
+ *
+ *  Returns a pointer to the acpi_device corresponding to the handle.
+ */
+static struct acpi_device * dock_create_acpi_device(acpi_handle handle)
+{
+       struct acpi_device *device = NULL;
+       struct acpi_device *parent_device;
+       acpi_handle parent;
+       int ret;
+
+       if (acpi_bus_get_device(handle, &device)) {
+               /*
+                * no device created for this object,
+                * so we should create one.
+                */
+               acpi_get_parent(handle, &parent);
+               if (acpi_bus_get_device(parent, &parent_device))
+                       parent_device = NULL;
+
+               ret = acpi_bus_add(&device, parent_device, handle,
+                       ACPI_BUS_TYPE_DEVICE);
+               if (ret) {
+                       pr_debug("error adding bus, %x\n",
+                               -ret);
+                       return NULL;
+               }
+       }
+       return device;
+}
+
+/**
+ * dock_remove_acpi_device - remove the acpi_device struct from acpi
+ * @handle - the handle of the device to remove
+ *
+ *  Tell acpi to remove the acpi_device.  This should cause any loaded
+ *  driver to have it's remove routine called.
+ */
+static void dock_remove_acpi_device(acpi_handle handle)
+{
+       struct acpi_device *device;
+       int ret;
+
+       if (!acpi_bus_get_device(handle, &device)) {
+               ret = acpi_bus_trim(device, 1);
+               if (ret)
+                       pr_debug("error removing bus, %x\n", -ret);
+       }
+}
+
+
+/**
+ * hotplug_dock_devices - insert or remove devices on the dock station
+ * @ds: the dock station
+ * @event: either bus check or eject request
+ *
+ * Some devices on the dock station need to have drivers called
+ * to perform hotplug operations after a dock event has occurred.
+ * Traverse the list of dock devices that have registered a
+ * hotplug handler, and call the handler.
+ */
+static void hotplug_dock_devices(struct dock_station *ds, u32 event)
+{
+       struct dock_dependent_device *dd;
+
+       spin_lock(&ds->hp_lock);
+
+       /*
+        * First call driver specific hotplug functions
+        */
+       list_for_each_entry(dd, &ds->hotplug_devices, hotplug_list) {
+               if (dd->handler)
+                       dd->handler(dd->handle, event, dd->context);
+       }
+
+       /*
+        * Now make sure that an acpi_device is created for each
+        * dependent device, or removed if this is an eject request.
+        * This will cause acpi_drivers to be stopped/started if they
+        * exist
+        */
+       list_for_each_entry(dd, &ds->dependent_devices, list) {
+               if (event == ACPI_NOTIFY_EJECT_REQUEST)
+                       dock_remove_acpi_device(dd->handle);
+               else
+                       dock_create_acpi_device(dd->handle);
+       }
+       spin_unlock(&ds->hp_lock);
+}
+
+static void dock_event(struct dock_station *ds, u32 event, int num)
+{
+       struct acpi_device *device;
+
+       device = dock_create_acpi_device(ds->handle);
+       if (device)
+               kobject_uevent(&device->kobj, num);
+}
+
+/**
+ * eject_dock - respond to a dock eject request
+ * @ds: the dock station
+ *
+ * This is called after _DCK is called, to execute the dock station's
+ * _EJ0 method.
+ */
+static void eject_dock(struct dock_station *ds)
+{
+       struct acpi_object_list arg_list;
+       union acpi_object arg;
+       acpi_status status;
+       acpi_handle tmp;
+
+       /* all dock devices should have _EJ0, but check anyway */
+       status = acpi_get_handle(ds->handle, "_EJ0", &tmp);
+       if (ACPI_FAILURE(status)) {
+               pr_debug("No _EJ0 support for dock device\n");
+               return;
+       }
+
+       arg_list.count = 1;
+       arg_list.pointer = &arg;
+       arg.type = ACPI_TYPE_INTEGER;
+       arg.integer.value = 1;
+
+       if (ACPI_FAILURE(acpi_evaluate_object(ds->handle, "_EJ0",
+                                             &arg_list, NULL)))
+               pr_debug("Failed to evaluate _EJ0!\n");
+}
+
+/**
+ * handle_dock - handle a dock event
+ * @ds: the dock station
+ * @dock: to dock, or undock - that is the question
+ *
+ * Execute the _DCK method in response to an acpi event
+ */
+static void handle_dock(struct dock_station *ds, int dock)
+{
+       acpi_status status;
+       struct acpi_object_list arg_list;
+       union acpi_object arg;
+       struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
+       struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
+       union acpi_object *obj;
+
+       acpi_get_name(ds->handle, ACPI_FULL_PATHNAME, &name_buffer);
+       obj = name_buffer.pointer;
+
+       printk(KERN_INFO PREFIX "%s\n", dock ? "docking" : "undocking");
+
+       /* _DCK method has one argument */
+       arg_list.count = 1;
+       arg_list.pointer = &arg;
+       arg.type = ACPI_TYPE_INTEGER;
+       arg.integer.value = dock;
+       status = acpi_evaluate_object(ds->handle, "_DCK", &arg_list, &buffer);
+       if (ACPI_FAILURE(status))
+               pr_debug("%s: failed to execute _DCK\n", obj->string.pointer);
+       kfree(buffer.pointer);
+       kfree(name_buffer.pointer);
+}
+
+static inline void dock(struct dock_station *ds)
+{
+       handle_dock(ds, 1);
+}
+
+static inline void undock(struct dock_station *ds)
+{
+       handle_dock(ds, 0);
+}
+
+static inline void begin_dock(struct dock_station *ds)
+{
+       ds->flags |= DOCK_DOCKING;
+}
+
+static inline void complete_dock(struct dock_station *ds)
+{
+       ds->flags &= ~(DOCK_DOCKING);
+       ds->last_dock_time = jiffies;
+}
+
+/**
+ * dock_in_progress - see if we are in the middle of handling a dock event
+ * @ds: the dock station
+ *
+ * Sometimes while docking, false dock events can be sent to the driver
+ * because good connections aren't made or some other reason.  Ignore these
+ * if we are in the middle of doing something.
+ */
+static int dock_in_progress(struct dock_station *ds)
+{
+       if ((ds->flags & DOCK_DOCKING) ||
+           time_before(jiffies, (ds->last_dock_time + HZ)))
+               return 1;
+       return 0;
+}
+
+/**
+ * register_dock_notifier - add yourself to the dock notifier list
+ * @nb: the callers notifier block
+ *
+ * If a driver wishes to be notified about dock events, they can
+ * use this function to put a notifier block on the dock notifier list.
+ * this notifier call chain will be called after a dock event, but
+ * before hotplugging any new devices.
+ */
+int register_dock_notifier(struct notifier_block *nb)
+{
+       return atomic_notifier_chain_register(&dock_notifier_list, nb);
+}
+
+EXPORT_SYMBOL_GPL(register_dock_notifier);
+
+/**
+ * unregister_dock_notifier - remove yourself from the dock notifier list
+ * @nb: the callers notifier block
+ */
+void unregister_dock_notifier(struct notifier_block *nb)
+{
+       atomic_notifier_chain_unregister(&dock_notifier_list, nb);
+}
+
+EXPORT_SYMBOL_GPL(unregister_dock_notifier);
+
+/**
+ * register_hotplug_dock_device - register a hotplug function
+ * @handle: the handle of the device
+ * @handler: the acpi_notifier_handler to call after docking
+ * @context: device specific data
+ *
+ * If a driver would like to perform a hotplug operation after a dock
+ * event, they can register an acpi_notifiy_handler to be called by
+ * the dock driver after _DCK is executed.
+ */
+int
+register_hotplug_dock_device(acpi_handle handle, acpi_notify_handler handler,
+                            void *context)
+{
+       struct dock_dependent_device *dd;
+
+       if (!dock_station)
+               return -ENODEV;
+
+       /*
+        * make sure this handle is for a device dependent on the dock,
+        * this would include the dock station itself
+        */
+       dd = find_dock_dependent_device(dock_station, handle);
+       if (dd) {
+               dd->handler = handler;
+               dd->context = context;
+               dock_add_hotplug_device(dock_station, dd);
+               return 0;
+       }
+
+       return -EINVAL;
+}
+
+EXPORT_SYMBOL_GPL(register_hotplug_dock_device);
+
+/**
+ * unregister_hotplug_dock_device - remove yourself from the hotplug list
+ * @handle: the acpi handle of the device
+ */
+void unregister_hotplug_dock_device(acpi_handle handle)
+{
+       struct dock_dependent_device *dd;
+
+       if (!dock_station)
+               return;
+
+       dd = find_dock_dependent_device(dock_station, handle);
+       if (dd)
+               dock_del_hotplug_device(dock_station, dd);
+}
+
+EXPORT_SYMBOL_GPL(unregister_hotplug_dock_device);
+
+/**
+ * dock_notify - act upon an acpi dock notification
+ * @handle: the dock station handle
+ * @event: the acpi event
+ * @data: our driver data struct
+ *
+ * If we are notified to dock, then check to see if the dock is
+ * present and then dock.  Notify all drivers of the dock event,
+ * and then hotplug and devices that may need hotplugging.  For undock
+ * check to make sure the dock device is still present, then undock
+ * and hotremove all the devices that may need removing.
+ */
+static void dock_notify(acpi_handle handle, u32 event, void *data)
+{
+       struct dock_station *ds = (struct dock_station *)data;
+
+       switch (event) {
+       case ACPI_NOTIFY_BUS_CHECK:
+               if (!dock_in_progress(ds) && dock_present(ds)) {
+                       begin_dock(ds);
+                       dock(ds);
+                       if (!dock_present(ds)) {
+                               printk(KERN_ERR PREFIX "Unable to dock!\n");
+                               break;
+                       }
+                       atomic_notifier_call_chain(&dock_notifier_list,
+                                                  event, NULL);
+                       hotplug_dock_devices(ds, event);
+                       complete_dock(ds);
+                       dock_event(ds, event, DOCK_EVENT);
+               }
+               break;
+       case ACPI_NOTIFY_DEVICE_CHECK:
+       /*
+         * According to acpi spec 3.0a, if a DEVICE_CHECK notification
+         * is sent and _DCK is present, it is assumed to mean an
+         * undock request.  This notify routine will only be called
+         * for objects defining _DCK, so we will fall through to eject
+         * request here.  However, we will pass an eject request through
+        * to the driver who wish to hotplug.
+         */
+       case ACPI_NOTIFY_EJECT_REQUEST:
+               if (!dock_in_progress(ds) && dock_present(ds)) {
+                       /*
+                        * here we need to generate the undock
+                        * event prior to actually doing the undock
+                        * so that the device struct still exists.
+                        */
+                       dock_event(ds, event, UNDOCK_EVENT);
+                       hotplug_dock_devices(ds, ACPI_NOTIFY_EJECT_REQUEST);
+                       undock(ds);
+                       eject_dock(ds);
+                       if (dock_present(ds))
+                               printk(KERN_ERR PREFIX "Unable to undock!\n");
+               }
+               break;
+       default:
+               printk(KERN_ERR PREFIX "Unknown dock event %d\n", event);
+       }
+}
+
+/**
+ * find_dock_devices - find devices on the dock station
+ * @handle: the handle of the device we are examining
+ * @lvl: unused
+ * @context: the dock station private data
+ * @rv: unused
+ *
+ * This function is called by acpi_walk_namespace.  It will
+ * check to see if an object has an _EJD method.  If it does, then it
+ * will see if it is dependent on the dock station.
+ */
+static acpi_status
+find_dock_devices(acpi_handle handle, u32 lvl, void *context, void **rv)
+{
+       acpi_status status;
+       acpi_handle tmp;
+       struct dock_station *ds = (struct dock_station *)context;
+       struct dock_dependent_device *dd;
+
+       status = acpi_bus_get_ejd(handle, &tmp);
+       if (ACPI_FAILURE(status))
+               return AE_OK;
+
+       if (tmp == ds->handle) {
+               dd = alloc_dock_dependent_device(handle);
+               if (dd)
+                       add_dock_dependent_device(ds, dd);
+       }
+
+       return AE_OK;
+}
+
+/**
+ * dock_add - add a new dock station
+ * @handle: the dock station handle
+ *
+ * allocated and initialize a new dock station device.  Find all devices
+ * that are on the dock station, and register for dock event notifications.
+ */
+static int dock_add(acpi_handle handle)
+{
+       int ret;
+       acpi_status status;
+       struct dock_dependent_device *dd;
+
+       /* allocate & initialize the dock_station private data */
+       dock_station = kzalloc(sizeof(*dock_station), GFP_KERNEL);
+       if (!dock_station)
+               return -ENOMEM;
+       dock_station->handle = handle;
+       dock_station->last_dock_time = jiffies - HZ;
+       INIT_LIST_HEAD(&dock_station->dependent_devices);
+       INIT_LIST_HEAD(&dock_station->hotplug_devices);
+       spin_lock_init(&dock_station->dd_lock);
+       spin_lock_init(&dock_station->hp_lock);
+
+       /* Find dependent devices */
+       acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
+                           ACPI_UINT32_MAX, find_dock_devices, dock_station,
+                           NULL);
+
+       /* add the dock station as a device dependent on itself */
+       dd = alloc_dock_dependent_device(handle);
+       if (!dd) {
+               kfree(dock_station);
+               return -ENOMEM;
+       }
+       add_dock_dependent_device(dock_station, dd);
+
+       /* register for dock events */
+       status = acpi_install_notify_handler(dock_station->handle,
+                                            ACPI_SYSTEM_NOTIFY,
+                                            dock_notify, dock_station);
+
+       if (ACPI_FAILURE(status)) {
+               printk(KERN_ERR PREFIX "Error installing notify handler\n");
+               ret = -ENODEV;
+               goto dock_add_err;
+       }
+
+       printk(KERN_INFO PREFIX "%s \n", ACPI_DOCK_DRIVER_NAME);
+
+       return 0;
+
+dock_add_err:
+       kfree(dock_station);
+       kfree(dd);
+       return ret;
+}
+
+/**
+ * dock_remove - free up resources related to the dock station
+ */
+static int dock_remove(void)
+{
+       struct dock_dependent_device *dd, *tmp;
+       acpi_status status;
+
+       if (!dock_station)
+               return 0;
+
+       /* remove dependent devices */
+       list_for_each_entry_safe(dd, tmp, &dock_station->dependent_devices,
+                                list)
+           kfree(dd);
+
+       /* remove dock notify handler */
+       status = acpi_remove_notify_handler(dock_station->handle,
+                                           ACPI_SYSTEM_NOTIFY,
+                                           dock_notify);
+       if (ACPI_FAILURE(status))
+               printk(KERN_ERR "Error removing notify handler\n");
+
+       /* free dock station memory */
+       kfree(dock_station);
+       return 0;
+}
+
+/**
+ * find_dock - look for a dock station
+ * @handle: acpi handle of a device
+ * @lvl: unused
+ * @context: counter of dock stations found
+ * @rv: unused
+ *
+ * This is called by acpi_walk_namespace to look for dock stations.
+ */
+static acpi_status
+find_dock(acpi_handle handle, u32 lvl, void *context, void **rv)
+{
+       int *count = (int *)context;
+       acpi_status status = AE_OK;
+
+       if (is_dock(handle)) {
+               if (dock_add(handle) >= 0) {
+                       (*count)++;
+                       status = AE_CTRL_TERMINATE;
+               }
+       }
+       return status;
+}
+
+static int __init dock_init(void)
+{
+       int num = 0;
+
+       dock_station = NULL;
+
+       /* look for a dock station */
+       acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
+                           ACPI_UINT32_MAX, find_dock, &num, NULL);
+
+       if (!num)
+               return -ENODEV;
+
+       return 0;
+}
+
+static void __exit dock_exit(void)
+{
+       dock_remove();
+}
+
+postcore_initcall(dock_init);
+module_exit(dock_exit);
index 18b3ea9dace26c1a56500b7664cf13c86a4f0952..8c5d7df7d34310aacf61fb7632392de376fb61c0 100644 (file)
@@ -207,16 +207,15 @@ static int acpi_ec_intr_wait(union acpi_ec *ec, unsigned int event)
 {
        int result = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_ec_wait");
 
        ec->intr.expect_event = event;
        smp_mb();
 
        switch (event) {
        case ACPI_EC_EVENT_IBE:
-               if (~acpi_ec_read_status(ec) & event) {
+               if (~acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF) {
                        ec->intr.expect_event = 0;
-                       return_VALUE(0);
+                       return 0;
                }
                break;
        default:
@@ -238,16 +237,16 @@ static int acpi_ec_intr_wait(union acpi_ec *ec, unsigned int event)
        switch (event) {
        case ACPI_EC_EVENT_OBF:
                if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_OBF)
-                       return_VALUE(0);
+                       return 0;
                break;
 
        case ACPI_EC_EVENT_IBE:
                if (~acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF)
-                       return_VALUE(0);
+                       return 0;
                break;
        }
 
-       return_VALUE(-ETIME);
+       return -ETIME;
 }
 
 #ifdef ACPI_FUTURE_USAGE
@@ -260,7 +259,6 @@ int acpi_ec_enter_burst_mode(union acpi_ec *ec)
        u32 tmp = 0;
        int status = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_ec_enter_burst_mode");
 
        status = acpi_ec_read_status(ec);
        if (status != -EINVAL && !(status & ACPI_EC_FLAG_BURST)) {
@@ -272,22 +270,21 @@ int acpi_ec_enter_burst_mode(union acpi_ec *ec)
                status = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF);
                acpi_hw_low_level_read(8, &tmp, &ec->common.data_addr);
                if (tmp != 0x90) {      /* Burst ACK byte */
-                       return_VALUE(-EINVAL);
+                       return -EINVAL;
                }
        }
 
        atomic_set(&ec->intr.leaving_burst, 0);
-       return_VALUE(0);
+       return 0;
       end:
-       printk(KERN_WARNING PREFIX "Error in acpi_ec_wait\n");
-       return_VALUE(-1);
+       ACPI_EXCEPTION ((AE_INFO, status, "EC wait, burst mode");
+       return -1;
 }
 
 int acpi_ec_leave_burst_mode(union acpi_ec *ec)
 {
        int status = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_ec_leave_burst_mode");
 
        status = acpi_ec_read_status(ec);
        if (status != -EINVAL && (status & ACPI_EC_FLAG_BURST)){
@@ -298,10 +295,10 @@ int acpi_ec_leave_burst_mode(union acpi_ec *ec)
                acpi_ec_wait(ec, ACPI_EC_FLAG_IBF);
        } 
        atomic_set(&ec->intr.leaving_burst, 1);
-       return_VALUE(0);
+       return 0;
 end:
-       printk(KERN_WARNING PREFIX "leave burst_mode:error\n");
-       return_VALUE(-1);
+       ACPI_EXCEPTION((AE_INFO, status, "EC leave burst mode");
+       return -1;
 }
 #endif /* ACPI_FUTURE_USAGE */
 
@@ -325,17 +322,16 @@ static int acpi_ec_poll_read(union acpi_ec *ec, u8 address, u32 * data)
        int result = 0;
        u32 glk = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_ec_read");
 
        if (!ec || !data)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        *data = 0;
 
        if (ec->common.global_lock) {
                status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
                if (ACPI_FAILURE(status))
-                       return_VALUE(-ENODEV);
+                       return -ENODEV;
        }
 
        if (down_interruptible(&ec->poll.sem)) {
@@ -365,7 +361,7 @@ end_nosem:
        if (ec->common.global_lock)
                acpi_release_global_lock(glk);
 
-       return_VALUE(result);
+       return result;
 }
 
 static int acpi_ec_poll_write(union acpi_ec *ec, u8 address, u8 data)
@@ -374,15 +370,14 @@ static int acpi_ec_poll_write(union acpi_ec *ec, u8 address, u8 data)
        acpi_status status = AE_OK;
        u32 glk = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_ec_write");
 
        if (!ec)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (ec->common.global_lock) {
                status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
                if (ACPI_FAILURE(status))
-                       return_VALUE(-ENODEV);
+                       return -ENODEV;
        }
 
        if (down_interruptible(&ec->poll.sem)) {
@@ -415,7 +410,7 @@ end_nosem:
        if (ec->common.global_lock)
                acpi_release_global_lock(glk);
 
-       return_VALUE(result);
+       return result;
 }
 
 static int acpi_ec_intr_read(union acpi_ec *ec, u8 address, u32 * data)
@@ -423,17 +418,16 @@ static int acpi_ec_intr_read(union acpi_ec *ec, u8 address, u32 * data)
        int status = 0;
        u32 glk;
 
-       ACPI_FUNCTION_TRACE("acpi_ec_read");
 
        if (!ec || !data)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        *data = 0;
 
        if (ec->common.global_lock) {
                status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
                if (ACPI_FAILURE(status))
-                       return_VALUE(-ENODEV);
+                       return -ENODEV;
        }
 
        WARN_ON(in_interrupt());
@@ -467,7 +461,7 @@ static int acpi_ec_intr_read(union acpi_ec *ec, u8 address, u32 * data)
        if (ec->common.global_lock)
                acpi_release_global_lock(glk);
 
-       return_VALUE(status);
+       return status;
 }
 
 static int acpi_ec_intr_write(union acpi_ec *ec, u8 address, u8 data)
@@ -475,15 +469,14 @@ static int acpi_ec_intr_write(union acpi_ec *ec, u8 address, u8 data)
        int status = 0;
        u32 glk;
 
-       ACPI_FUNCTION_TRACE("acpi_ec_write");
 
        if (!ec)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (ec->common.global_lock) {
                status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
                if (ACPI_FAILURE(status))
-                       return_VALUE(-ENODEV);
+                       return -ENODEV;
        }
 
        WARN_ON(in_interrupt());
@@ -516,7 +509,7 @@ static int acpi_ec_intr_write(union acpi_ec *ec, u8 address, u8 data)
        if (ec->common.global_lock)
                acpi_release_global_lock(glk);
 
-       return_VALUE(status);
+       return status;
 }
 
 /*
@@ -574,17 +567,16 @@ static int acpi_ec_poll_query(union acpi_ec *ec, u32 * data)
        acpi_status status = AE_OK;
        u32 glk = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_ec_query");
 
        if (!ec || !data)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        *data = 0;
 
        if (ec->common.global_lock) {
                status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
                if (ACPI_FAILURE(status))
-                       return_VALUE(-ENODEV);
+                       return -ENODEV;
        }
 
        /*
@@ -613,23 +605,22 @@ end_nosem:
        if (ec->common.global_lock)
                acpi_release_global_lock(glk);
 
-       return_VALUE(result);
+       return result;
 }
 static int acpi_ec_intr_query(union acpi_ec *ec, u32 * data)
 {
        int status = 0;
        u32 glk;
 
-       ACPI_FUNCTION_TRACE("acpi_ec_query");
 
        if (!ec || !data)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
        *data = 0;
 
        if (ec->common.global_lock) {
                status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
                if (ACPI_FAILURE(status))
-                       return_VALUE(-ENODEV);
+                       return -ENODEV;
        }
 
        down(&ec->intr.sem);
@@ -662,7 +653,7 @@ static int acpi_ec_intr_query(union acpi_ec *ec, u32 * data)
        if (ec->common.global_lock)
                acpi_release_global_lock(glk);
 
-       return_VALUE(status);
+       return status;
 }
 
 /* --------------------------------------------------------------------------
@@ -691,13 +682,12 @@ static void acpi_ec_gpe_poll_query(void *ec_cxt)
                '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
        };
 
-       ACPI_FUNCTION_TRACE("acpi_ec_gpe_query");
 
        if (!ec_cxt)
                goto end;
 
        if (down_interruptible (&ec->poll.sem)) {
-               return_VOID;
+               return;
        }
        acpi_hw_low_level_read(8, &value, &ec->common.command_addr);
        up(&ec->poll.sem);
@@ -734,7 +724,6 @@ static void acpi_ec_gpe_intr_query(void *ec_cxt)
                '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
        };
 
-       ACPI_FUNCTION_TRACE("acpi_ec_gpe_query");
 
        if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_SCI)
                result = acpi_ec_query(ec, &value);
@@ -793,12 +782,15 @@ static u32 acpi_ec_gpe_intr_handler(void *data)
        case ACPI_EC_EVENT_OBF:
                if (!(value & ACPI_EC_FLAG_OBF))
                        break;
+               ec->intr.expect_event = 0;
+               wake_up(&ec->intr.wait);
+               break;
        case ACPI_EC_EVENT_IBE:
                if ((value & ACPI_EC_FLAG_IBF))
                        break;
                ec->intr.expect_event = 0;
                wake_up(&ec->intr.wait);
-               return ACPI_INTERRUPT_HANDLED;
+               break;
        default:
                break;
        }
@@ -846,15 +838,14 @@ acpi_ec_space_handler(u32 function,
        acpi_integer f_v = 0;
        int i = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_ec_space_handler");
 
        if ((address > 0xFF) || !value || !handler_context)
-               return_VALUE(AE_BAD_PARAMETER);
+               return AE_BAD_PARAMETER;
 
        if (bit_width != 8 && acpi_strict) {
                printk(KERN_WARNING PREFIX
                       "acpi_ec_space_handler: bit_width should be 8\n");
-               return_VALUE(AE_BAD_PARAMETER);
+               return AE_BAD_PARAMETER;
        }
 
        ec = (union acpi_ec *)handler_context;
@@ -893,16 +884,16 @@ acpi_ec_space_handler(u32 function,
       out:
        switch (result) {
        case -EINVAL:
-               return_VALUE(AE_BAD_PARAMETER);
+               return AE_BAD_PARAMETER;
                break;
        case -ENODEV:
-               return_VALUE(AE_NOT_FOUND);
+               return AE_NOT_FOUND;
                break;
        case -ETIME:
-               return_VALUE(AE_TIME);
+               return AE_TIME;
                break;
        default:
-               return_VALUE(AE_OK);
+               return AE_OK;
        }
 }
 
@@ -916,7 +907,6 @@ static int acpi_ec_read_info(struct seq_file *seq, void *offset)
 {
        union acpi_ec *ec = (union acpi_ec *)seq->private;
 
-       ACPI_FUNCTION_TRACE("acpi_ec_read_info");
 
        if (!ec)
                goto end;
@@ -931,7 +921,7 @@ static int acpi_ec_read_info(struct seq_file *seq, void *offset)
        acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR);
 
       end:
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_ec_info_open_fs(struct inode *inode, struct file *file)
@@ -951,33 +941,29 @@ static int acpi_ec_add_fs(struct acpi_device *device)
 {
        struct proc_dir_entry *entry = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_ec_add_fs");
 
        if (!acpi_device_dir(device)) {
                acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
                                                     acpi_ec_dir);
                if (!acpi_device_dir(device))
-                       return_VALUE(-ENODEV);
+                       return -ENODEV;
        }
 
        entry = create_proc_entry(ACPI_EC_FILE_INFO, S_IRUGO,
                                  acpi_device_dir(device));
        if (!entry)
-               ACPI_DEBUG_PRINT((ACPI_DB_WARN,
-                                 "Unable to create '%s' fs entry\n",
-                                 ACPI_EC_FILE_INFO));
+               return -ENODEV;
        else {
                entry->proc_fops = &acpi_ec_info_ops;
                entry->data = acpi_driver_data(device);
                entry->owner = THIS_MODULE;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_ec_remove_fs(struct acpi_device *device)
 {
-       ACPI_FUNCTION_TRACE("acpi_ec_remove_fs");
 
        if (acpi_device_dir(device)) {
                remove_proc_entry(ACPI_EC_FILE_INFO, acpi_device_dir(device));
@@ -985,7 +971,7 @@ static int acpi_ec_remove_fs(struct acpi_device *device)
                acpi_device_dir(device) = NULL;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 /* --------------------------------------------------------------------------
@@ -998,14 +984,13 @@ static int acpi_ec_poll_add(struct acpi_device *device)
        acpi_status status = AE_OK;
        union acpi_ec *ec = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_ec_add");
 
        if (!device)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        ec = kmalloc(sizeof(union acpi_ec), GFP_KERNEL);
        if (!ec)
-               return_VALUE(-ENOMEM);
+               return -ENOMEM;
        memset(ec, 0, sizeof(union acpi_ec));
 
        ec->common.handle = device->handle;
@@ -1038,8 +1023,7 @@ static int acpi_ec_poll_add(struct acpi_device *device)
            acpi_evaluate_integer(ec->common.handle, "_GPE", NULL,
                                  &ec->common.gpe_bit);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Error obtaining GPE bit assignment\n"));
+               ACPI_EXCEPTION((AE_INFO, status, "Obtaining GPE bit"));
                result = -ENODEV;
                goto end;
        }
@@ -1059,7 +1043,7 @@ static int acpi_ec_poll_add(struct acpi_device *device)
        if (result)
                kfree(ec);
 
-       return_VALUE(result);
+       return result;
 }
 static int acpi_ec_intr_add(struct acpi_device *device)
 {
@@ -1067,14 +1051,13 @@ static int acpi_ec_intr_add(struct acpi_device *device)
        acpi_status status = AE_OK;
        union acpi_ec *ec = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_ec_add");
 
        if (!device)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        ec = kmalloc(sizeof(union acpi_ec), GFP_KERNEL);
        if (!ec)
-               return_VALUE(-ENOMEM);
+               return -ENOMEM;
        memset(ec, 0, sizeof(union acpi_ec));
 
        ec->common.handle = device->handle;
@@ -1110,8 +1093,7 @@ static int acpi_ec_intr_add(struct acpi_device *device)
            acpi_evaluate_integer(ec->common.handle, "_GPE", NULL,
                                  &ec->common.gpe_bit);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Error obtaining GPE bit assignment\n"));
+               printk(KERN_ERR PREFIX "Obtaining GPE bit assignment\n");
                result = -ENODEV;
                goto end;
        }
@@ -1131,17 +1113,16 @@ static int acpi_ec_intr_add(struct acpi_device *device)
        if (result)
                kfree(ec);
 
-       return_VALUE(result);
+       return result;
 }
 
 static int acpi_ec_remove(struct acpi_device *device, int type)
 {
        union acpi_ec *ec = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_ec_remove");
 
        if (!device)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        ec = acpi_driver_data(device);
 
@@ -1149,7 +1130,7 @@ static int acpi_ec_remove(struct acpi_device *device, int type)
 
        kfree(ec);
 
-       return_VALUE(0);
+       return 0;
 }
 
 static acpi_status
@@ -1188,15 +1169,14 @@ static int acpi_ec_start(struct acpi_device *device)
        acpi_status status = AE_OK;
        union acpi_ec *ec = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_ec_start");
 
        if (!device)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        ec = acpi_driver_data(device);
 
        if (!ec)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        /*
         * Get I/O port addresses. Convert to GAS format.
@@ -1205,9 +1185,8 @@ static int acpi_ec_start(struct acpi_device *device)
                                     acpi_ec_io_ports, ec);
        if (ACPI_FAILURE(status)
            || ec->common.command_addr.register_bit_width == 0) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Error getting I/O port addresses"));
-               return_VALUE(-ENODEV);
+               printk(KERN_ERR PREFIX "Error getting I/O port addresses\n");
+               return -ENODEV;
        }
 
        ec->common.status_addr = ec->common.command_addr;
@@ -1224,7 +1203,7 @@ static int acpi_ec_start(struct acpi_device *device)
                                          ACPI_GPE_EDGE_TRIGGERED,
                                          &acpi_ec_gpe_handler, ec);
        if (ACPI_FAILURE(status)) {
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        }
        acpi_set_gpe_type(NULL, ec->common.gpe_bit, ACPI_GPE_TYPE_RUNTIME);
        acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR);
@@ -1236,10 +1215,10 @@ static int acpi_ec_start(struct acpi_device *device)
        if (ACPI_FAILURE(status)) {
                acpi_remove_gpe_handler(NULL, ec->common.gpe_bit,
                                        &acpi_ec_gpe_handler);
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        }
 
-       return_VALUE(AE_OK);
+       return AE_OK;
 }
 
 static int acpi_ec_stop(struct acpi_device *device, int type)
@@ -1247,10 +1226,9 @@ static int acpi_ec_stop(struct acpi_device *device, int type)
        acpi_status status = AE_OK;
        union acpi_ec *ec = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_ec_stop");
 
        if (!device)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        ec = acpi_driver_data(device);
 
@@ -1258,15 +1236,15 @@ static int acpi_ec_stop(struct acpi_device *device, int type)
                                                   ACPI_ADR_SPACE_EC,
                                                   &acpi_ec_space_handler);
        if (ACPI_FAILURE(status))
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        status =
            acpi_remove_gpe_handler(NULL, ec->common.gpe_bit,
                                    &acpi_ec_gpe_handler);
        if (ACPI_FAILURE(status))
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
-       return_VALUE(0);
+       return 0;
 }
 
 static acpi_status __init
@@ -1536,23 +1514,22 @@ static int __init acpi_ec_init(void)
 {
        int result = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_ec_init");
 
        if (acpi_disabled)
-               return_VALUE(0);
+               return 0;
 
        acpi_ec_dir = proc_mkdir(ACPI_EC_CLASS, acpi_root_dir);
        if (!acpi_ec_dir)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        /* Now register the driver for the EC */
        result = acpi_bus_register_driver(&acpi_ec_driver);
        if (result < 0) {
                remove_proc_entry(ACPI_EC_CLASS, acpi_root_dir);
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        }
 
-       return_VALUE(result);
+       return result;
 }
 
 subsys_initcall(acpi_ec_init);
@@ -1561,13 +1538,12 @@ subsys_initcall(acpi_ec_init);
 #if 0
 static void __exit acpi_ec_exit(void)
 {
-       ACPI_FUNCTION_TRACE("acpi_ec_exit");
 
        acpi_bus_unregister_driver(&acpi_ec_driver);
 
        remove_proc_entry(ACPI_EC_CLASS, acpi_root_dir);
 
-       return_VOID;
+       return;
 }
 #endif                         /* 0 */
 
index 2dbb1b0f11d51bb16a227e794729ba0936ce3d3a..a901b23e95e7b38e53378e5af4140182ab6cd86f 100644 (file)
@@ -48,18 +48,17 @@ acpi_system_read_event(struct file *file, char __user * buffer, size_t count,
        static int chars_remaining = 0;
        static char *ptr;
 
-       ACPI_FUNCTION_TRACE("acpi_system_read_event");
 
        if (!chars_remaining) {
                memset(&event, 0, sizeof(struct acpi_bus_event));
 
                if ((file->f_flags & O_NONBLOCK)
                    && (list_empty(&acpi_bus_event_list)))
-                       return_VALUE(-EAGAIN);
+                       return -EAGAIN;
 
                result = acpi_bus_receive_event(&event);
                if (result)
-                       return_VALUE(result);
+                       return result;
 
                chars_remaining = sprintf(str, "%s %s %08x %08x\n",
                                          event.device_class ? event.
@@ -75,13 +74,13 @@ acpi_system_read_event(struct file *file, char __user * buffer, size_t count,
        }
 
        if (copy_to_user(buffer, ptr, count))
-               return_VALUE(-EFAULT);
+               return -EFAULT;
 
        *ppos += count;
        chars_remaining -= count;
        ptr += count;
 
-       return_VALUE(count);
+       return count;
 }
 
 static int acpi_system_close_event(struct inode *inode, struct file *file)
@@ -112,22 +111,18 @@ static int __init acpi_event_init(void)
        struct proc_dir_entry *entry;
        int error = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_event_init");
 
        if (acpi_disabled)
-               return_VALUE(0);
+               return 0;
 
        /* 'event' [R] */
        entry = create_proc_entry("event", S_IRUSR, acpi_root_dir);
        if (entry)
                entry->proc_fops = &acpi_system_event_ops;
        else {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to create '%s' proc fs entry\n",
-                                 "event"));
-               error = -EFAULT;
+               error = -ENODEV;
        }
-       return_VALUE(error);
+       return error;
 }
 
 subsys_initcall(acpi_event_init);
index f01d339407f8cc3c42e35b81f0a083ae32e5daf0..c76c0583ca6a2a02aa860a28d980d5d940af52bf 100644 (file)
@@ -382,7 +382,6 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
        u32 status_reg;
        u32 enable_reg;
        acpi_cpu_flags flags;
-       acpi_cpu_flags hw_flags;
        acpi_native_uint i;
        acpi_native_uint j;
 
@@ -394,8 +393,11 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
                return (int_status);
        }
 
-       /* We need to hold the GPE lock now, hardware lock in the loop */
-
+       /*
+        * We need to obtain the GPE lock for both the data structs and registers
+        * Note: Not necessary to obtain the hardware lock, since the GPE registers
+        * are owned by the gpe_lock.
+        */
        flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
 
        /* Examine all GPE blocks attached to this interrupt level */
@@ -413,8 +415,6 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
 
                        gpe_register_info = &gpe_block->register_info[i];
 
-                       hw_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock);
-
                        /* Read the Status Register */
 
                        status =
@@ -423,8 +423,6 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
                                                   &gpe_register_info->
                                                   status_address);
                        if (ACPI_FAILURE(status)) {
-                               acpi_os_release_lock(acpi_gbl_hardware_lock,
-                                                    hw_flags);
                                goto unlock_and_exit;
                        }
 
@@ -435,8 +433,6 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
                                                   &enable_reg,
                                                   &gpe_register_info->
                                                   enable_address);
-                       acpi_os_release_lock(acpi_gbl_hardware_lock, hw_flags);
-
                        if (ACPI_FAILURE(status)) {
                                goto unlock_and_exit;
                        }
index 76c34a66e0e0cddc19db672150d8295183004e7e..4f948df17ab975f15cc6a5d22c842a10332d55e1 100644 (file)
@@ -414,12 +414,13 @@ acpi_remove_notify_handler(acpi_handle device,
 
        if ((!device) ||
            (!handler) || (handler_type > ACPI_MAX_NOTIFY_HANDLER_TYPE)) {
-               return_ACPI_STATUS(AE_BAD_PARAMETER);
+               status = AE_BAD_PARAMETER;
+               goto exit;
        }
 
        status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
        if (ACPI_FAILURE(status)) {
-               return_ACPI_STATUS(status);
+               goto exit;
        }
 
        /* Convert and validate the device handle */
@@ -427,7 +428,7 @@ acpi_remove_notify_handler(acpi_handle device,
        node = acpi_ns_map_handle_to_node(device);
        if (!node) {
                status = AE_BAD_PARAMETER;
-               goto unlock_and_exit;
+               goto unlock;
        }
 
        /* Root Object */
@@ -441,7 +442,7 @@ acpi_remove_notify_handler(acpi_handle device,
                    ((handler_type & ACPI_DEVICE_NOTIFY) &&
                     !acpi_gbl_device_notify.handler)) {
                        status = AE_NOT_EXIST;
-                       goto unlock_and_exit;
+                       goto unlock;
                }
 
                /* Make sure all deferred tasks are completed */
@@ -450,7 +451,7 @@ acpi_remove_notify_handler(acpi_handle device,
                acpi_os_wait_events_complete(NULL);
                status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
                if (ACPI_FAILURE(status)) {
-                       return_ACPI_STATUS(status);
+                       goto exit;
                }
 
                if (handler_type & ACPI_SYSTEM_NOTIFY) {
@@ -473,7 +474,7 @@ acpi_remove_notify_handler(acpi_handle device,
 
                if (!acpi_ev_is_notify_object(node)) {
                        status = AE_TYPE;
-                       goto unlock_and_exit;
+                       goto unlock;
                }
 
                /* Check for an existing internal object */
@@ -481,7 +482,7 @@ acpi_remove_notify_handler(acpi_handle device,
                obj_desc = acpi_ns_get_attached_object(node);
                if (!obj_desc) {
                        status = AE_NOT_EXIST;
-                       goto unlock_and_exit;
+                       goto unlock;
                }
 
                /* Object exists - make sure there's an existing handler */
@@ -491,7 +492,7 @@ acpi_remove_notify_handler(acpi_handle device,
                        if ((!notify_obj) ||
                            (notify_obj->notify.handler != handler)) {
                                status = AE_BAD_PARAMETER;
-                               goto unlock_and_exit;
+                               goto unlock;
                        }
                        /* Make sure all deferred tasks are completed */
 
@@ -499,7 +500,7 @@ acpi_remove_notify_handler(acpi_handle device,
                        acpi_os_wait_events_complete(NULL);
                        status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
                        if (ACPI_FAILURE(status)) {
-                               return_ACPI_STATUS(status);
+                               goto exit;
                        }
 
                        /* Remove the handler */
@@ -512,7 +513,7 @@ acpi_remove_notify_handler(acpi_handle device,
                        if ((!notify_obj) ||
                            (notify_obj->notify.handler != handler)) {
                                status = AE_BAD_PARAMETER;
-                               goto unlock_and_exit;
+                               goto unlock;
                        }
                        /* Make sure all deferred tasks are completed */
 
@@ -520,7 +521,7 @@ acpi_remove_notify_handler(acpi_handle device,
                        acpi_os_wait_events_complete(NULL);
                        status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
                        if (ACPI_FAILURE(status)) {
-                               return_ACPI_STATUS(status);
+                               goto exit;
                        }
 
                        /* Remove the handler */
@@ -529,8 +530,11 @@ acpi_remove_notify_handler(acpi_handle device,
                }
        }
 
-      unlock_and_exit:
+unlock:
        (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
+exit:
+       if (ACPI_FAILURE(status))
+               ACPI_EXCEPTION((AE_INFO, status, "Removing notify handler"));
        return_ACPI_STATUS(status);
 }
 
@@ -568,12 +572,13 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
        /* Parameter validation */
 
        if ((!address) || (type > ACPI_GPE_XRUPT_TYPE_MASK)) {
-               return_ACPI_STATUS(AE_BAD_PARAMETER);
+               status = AE_BAD_PARAMETER;
+               goto exit;
        }
 
        status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
        if (ACPI_FAILURE(status)) {
-               return_ACPI_STATUS(status);
+               goto exit;
        }
 
        /* Ensure that we have a valid GPE number */
@@ -581,7 +586,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
        gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number);
        if (!gpe_event_info) {
                status = AE_BAD_PARAMETER;
-               goto unlock_and_exit;
+               goto unlock;
        }
 
        /* Make sure that there isn't a handler there already */
@@ -589,7 +594,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
        if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) ==
            ACPI_GPE_DISPATCH_HANDLER) {
                status = AE_ALREADY_EXISTS;
-               goto unlock_and_exit;
+               goto unlock;
        }
 
        /* Allocate and init handler object */
@@ -597,7 +602,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
        handler = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_handler_info));
        if (!handler) {
                status = AE_NO_MEMORY;
-               goto unlock_and_exit;
+               goto unlock;
        }
 
        handler->address = address;
@@ -608,7 +613,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
 
        status = acpi_ev_disable_gpe(gpe_event_info);
        if (ACPI_FAILURE(status)) {
-               goto unlock_and_exit;
+               goto unlock;
        }
 
        /* Install the handler */
@@ -623,8 +628,12 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
 
        acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
 
-      unlock_and_exit:
+unlock:
        (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
+exit:
+       if (ACPI_FAILURE(status))
+               ACPI_EXCEPTION((AE_INFO, status,
+                               "Installing notify handler failed"));
        return_ACPI_STATUS(status);
 }
 
index 823352435e08ab676cdf26e4489b009ae371cd28..83fed079a276d02051fbb53751da2f98621e9bc2 100644 (file)
@@ -266,6 +266,10 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state,
                }
        }
 
+       ACPI_INFO((AE_INFO,
+                  "Dynamic OEM Table Load - [%4.4s] OemId [%6.6s] OemTableId [%8.8s]",
+                  table->signature, table->oem_id, table->oem_table_id));
+
        *return_desc = ddb_handle;
        return_ACPI_STATUS(status);
 }
@@ -446,6 +450,10 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
                return_ACPI_STATUS(status);
        }
 
+       ACPI_INFO((AE_INFO,
+                  "Dynamic SSDT Load - OemId [%6.6s] OemTableId [%8.8s]",
+                  table_ptr->oem_id, table_ptr->oem_table_id));
+
       cleanup:
        if (ACPI_FAILURE(status)) {
                ACPI_FREE(table_ptr);
index 106dc7219df713a70495e915655a3d6b7f362c97..34eec82c1b1e8902cce4eea96f193214771cbc64 100644 (file)
@@ -177,7 +177,7 @@ acpi_status acpi_ex_create_event(struct acpi_walk_state *walk_state)
         * that the event is created in an unsignalled state
         */
        status = acpi_os_create_semaphore(ACPI_NO_UNIT_LIMIT, 0,
-                                         &obj_desc->event.semaphore);
+                                         &obj_desc->event.os_semaphore);
        if (ACPI_FAILURE(status)) {
                goto cleanup;
        }
@@ -226,12 +226,9 @@ acpi_status acpi_ex_create_mutex(struct acpi_walk_state *walk_state)
                goto cleanup;
        }
 
-       /*
-        * Create the actual OS semaphore.
-        * One unit max to make it a mutex, with one initial unit to allow
-        * the mutex to be acquired.
-        */
-       status = acpi_os_create_semaphore(1, 1, &obj_desc->mutex.semaphore);
+       /* Create the actual OS Mutex */
+
+       status = acpi_os_create_mutex(&obj_desc->mutex.os_mutex);
        if (ACPI_FAILURE(status)) {
                goto cleanup;
        }
@@ -565,7 +562,7 @@ acpi_ex_create_method(u8 * aml_start,
        obj_desc->method.aml_length = aml_length;
 
        /*
-        * Disassemble the method flags.  Split off the Arg Count
+        * Disassemble the method flags. Split off the Arg Count
         * for efficiency
         */
        method_flags = (u8) operand[1]->integer.value;
@@ -576,21 +573,19 @@ acpi_ex_create_method(u8 * aml_start,
            (u8) (method_flags & AML_METHOD_ARG_COUNT);
 
        /*
-        * Get the concurrency count.  If required, a semaphore will be
+        * Get the sync_level. If method is serialized, a mutex will be
         * created for this method when it is parsed.
         */
        if (acpi_gbl_all_methods_serialized) {
-               obj_desc->method.concurrency = 1;
+               obj_desc->method.sync_level = 0;
                obj_desc->method.method_flags |= AML_METHOD_SERIALIZED;
        } else if (method_flags & AML_METHOD_SERIALIZED) {
                /*
-                * ACPI 1.0: Concurrency = 1
-                * ACPI 2.0: Concurrency = (sync_level (in method declaration) + 1)
+                * ACPI 1.0: sync_level = 0
+                * ACPI 2.0: sync_level = sync_level in method declaration
                 */
-               obj_desc->method.concurrency = (u8)
-                   (((method_flags & AML_METHOD_SYNCH_LEVEL) >> 4) + 1);
-       } else {
-               obj_desc->method.concurrency = ACPI_INFINITE_CONCURRENCY;
+               obj_desc->method.sync_level = (u8)
+                   ((method_flags & AML_METHOD_SYNCH_LEVEL) >> 4);
        }
 
        /* Attach the new object to the method Node */
index 7b9718e976bf44f5e0575750f2be6eec5d5df427..2450943add3334cdc7be48cf3067b6b64c309ff5 100644 (file)
@@ -118,14 +118,14 @@ static struct acpi_exdump_info acpi_ex_dump_device[4] = {
 
 static struct acpi_exdump_info acpi_ex_dump_event[2] = {
        {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_event), NULL},
-       {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(event.semaphore), "Semaphore"}
+       {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(event.os_semaphore), "OsSemaphore"}
 };
 
 static struct acpi_exdump_info acpi_ex_dump_method[8] = {
        {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_method), NULL},
        {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.param_count), "ParamCount"},
-       {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.concurrency), "Concurrency"},
-       {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(method.semaphore), "Semaphore"},
+       {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.sync_level), "Sync Level"},
+       {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(method.mutex), "Mutex"},
        {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.owner_id), "Owner Id"},
        {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.thread_count), "Thread Count"},
        {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(method.aml_length), "Aml Length"},
@@ -138,7 +138,7 @@ static struct acpi_exdump_info acpi_ex_dump_mutex[5] = {
        {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.owner_thread), "Owner Thread"},
        {ACPI_EXD_UINT16, ACPI_EXD_OFFSET(mutex.acquisition_depth),
         "Acquire Depth"},
-       {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.semaphore), "Semaphore"}
+       {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.os_mutex), "OsMutex"}
 };
 
 static struct acpi_exdump_info acpi_ex_dump_region[7] = {
index 051053f7cccb40c58931508c7347802cce084dfd..40f0bee6faa57a25989e28573d1e2ca6b953013a 100644 (file)
@@ -727,11 +727,23 @@ acpi_ex_extract_from_field(union acpi_operand_object *obj_desc,
                        return_ACPI_STATUS(status);
                }
 
-               /* Merge with previous datum if necessary */
-
-               merged_datum |= raw_datum <<
-                   (obj_desc->common_field.access_bit_width -
-                    obj_desc->common_field.start_field_bit_offset);
+               /*
+                * Merge with previous datum if necessary.
+                *
+                * Note: Before the shift, check if the shift value will be larger than
+                * the integer size. If so, there is no need to perform the operation.
+                * This avoids the differences in behavior between different compilers
+                * concerning shift values larger than the target data width.
+                */
+               if ((obj_desc->common_field.access_bit_width -
+                    obj_desc->common_field.start_field_bit_offset) <
+                   ACPI_INTEGER_BIT_SIZE) {
+                       merged_datum |=
+                           raw_datum << (obj_desc->common_field.
+                                         access_bit_width -
+                                         obj_desc->common_field.
+                                         start_field_bit_offset);
+               }
 
                if (i == datum_count) {
                        break;
@@ -808,13 +820,23 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc,
                return_ACPI_STATUS(AE_BUFFER_OVERFLOW);
        }
 
-       /* Compute the number of datums (access width data items) */
+       /*
+        * Create the bitmasks used for bit insertion.
+        * Note: This if/else is used to bypass compiler differences with the
+        * shift operator
+        */
+       if (obj_desc->common_field.access_bit_width == ACPI_INTEGER_BIT_SIZE) {
+               width_mask = ACPI_INTEGER_MAX;
+       } else {
+               width_mask =
+                   ACPI_MASK_BITS_ABOVE(obj_desc->common_field.
+                                        access_bit_width);
+       }
 
-       width_mask =
-           ACPI_MASK_BITS_ABOVE(obj_desc->common_field.access_bit_width);
-       mask =
-           width_mask & ACPI_MASK_BITS_BELOW(obj_desc->common_field.
-                                             start_field_bit_offset);
+       mask = width_mask &
+           ACPI_MASK_BITS_BELOW(obj_desc->common_field.start_field_bit_offset);
+
+       /* Compute the number of datums (access width data items) */
 
        datum_count = ACPI_ROUND_UP_TO(obj_desc->common_field.bit_length,
                                       obj_desc->common_field.access_bit_width);
@@ -848,12 +870,29 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc,
                        return_ACPI_STATUS(status);
                }
 
-               /* Start new output datum by merging with previous input datum */
-
                field_offset += obj_desc->common_field.access_byte_width;
-               merged_datum = raw_datum >>
-                   (obj_desc->common_field.access_bit_width -
-                    obj_desc->common_field.start_field_bit_offset);
+
+               /*
+                * Start new output datum by merging with previous input datum
+                * if necessary.
+                *
+                * Note: Before the shift, check if the shift value will be larger than
+                * the integer size. If so, there is no need to perform the operation.
+                * This avoids the differences in behavior between different compilers
+                * concerning shift values larger than the target data width.
+                */
+               if ((obj_desc->common_field.access_bit_width -
+                    obj_desc->common_field.start_field_bit_offset) <
+                   ACPI_INTEGER_BIT_SIZE) {
+                       merged_datum =
+                           raw_datum >> (obj_desc->common_field.
+                                         access_bit_width -
+                                         obj_desc->common_field.
+                                         start_field_bit_offset);
+               } else {
+                       merged_datum = 0;
+               }
+
                mask = width_mask;
 
                if (i == datum_count) {
index 93098d68cadfdd784f45b62c72673df967799fa8..d8ac2877cf05039574019ca20fd39cedec4ffc04 100644 (file)
@@ -161,12 +161,13 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc,
 
        /*
         * Current Sync must be less than or equal to the sync level of the
-        * mutex.  This mechanism provides some deadlock prevention
+        * mutex. This mechanism provides some deadlock prevention
         */
        if (walk_state->thread->current_sync_level > obj_desc->mutex.sync_level) {
                ACPI_ERROR((AE_INFO,
-                           "Cannot acquire Mutex [%4.4s], incorrect SyncLevel",
-                           acpi_ut_get_node_name(obj_desc->mutex.node)));
+                           "Cannot acquire Mutex [%4.4s], current SyncLevel is too large (%d)",
+                           acpi_ut_get_node_name(obj_desc->mutex.node),
+                           walk_state->thread->current_sync_level));
                return_ACPI_STATUS(AE_AML_MUTEX_ORDER);
        }
 
@@ -178,8 +179,7 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc,
 
                if ((obj_desc->mutex.owner_thread->thread_id ==
                     walk_state->thread->thread_id) ||
-                   (obj_desc->mutex.semaphore ==
-                    acpi_gbl_global_lock_semaphore)) {
+                   (obj_desc->mutex.os_mutex == ACPI_GLOBAL_LOCK)) {
                        /*
                         * The mutex is already owned by this thread,
                         * just increment the acquisition depth
@@ -264,7 +264,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
         */
        if ((obj_desc->mutex.owner_thread->thread_id !=
             walk_state->thread->thread_id)
-           && (obj_desc->mutex.semaphore != acpi_gbl_global_lock_semaphore)) {
+           && (obj_desc->mutex.os_mutex != ACPI_GLOBAL_LOCK)) {
                ACPI_ERROR((AE_INFO,
                            "Thread %X cannot release Mutex [%4.4s] acquired by thread %X",
                            walk_state->thread->thread_id,
index 52beee3674a0c66d68f1eec0e63b99fc0cb9c3a5..6b5d1e6ce94b1b823d9ff3634608254293d884bb 100644 (file)
@@ -63,14 +63,14 @@ ACPI_MODULE_NAME("exsystem")
  *              interpreter is released.
  *
  ******************************************************************************/
-acpi_status acpi_ex_system_wait_semaphore(acpi_handle semaphore, u16 timeout)
+acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
 {
        acpi_status status;
        acpi_status status2;
 
        ACPI_FUNCTION_TRACE(ex_system_wait_semaphore);
 
-       status = acpi_os_wait_semaphore(semaphore, 1, 0);
+       status = acpi_os_wait_semaphore(semaphore, 1, ACPI_DO_NOT_WAIT);
        if (ACPI_SUCCESS(status)) {
                return_ACPI_STATUS(status);
        }
@@ -101,6 +101,59 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_handle semaphore, u16 timeout)
        return_ACPI_STATUS(status);
 }
 
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ex_system_wait_mutex
+ *
+ * PARAMETERS:  Mutex           - Mutex to wait on
+ *              Timeout         - Max time to wait
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Implements a semaphore wait with a check to see if the
+ *              semaphore is available immediately.  If it is not, the
+ *              interpreter is released.
+ *
+ ******************************************************************************/
+
+acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout)
+{
+       acpi_status status;
+       acpi_status status2;
+
+       ACPI_FUNCTION_TRACE(ex_system_wait_mutex);
+
+       status = acpi_os_acquire_mutex(mutex, ACPI_DO_NOT_WAIT);
+       if (ACPI_SUCCESS(status)) {
+               return_ACPI_STATUS(status);
+       }
+
+       if (status == AE_TIME) {
+
+               /* We must wait, so unlock the interpreter */
+
+               acpi_ex_exit_interpreter();
+
+               status = acpi_os_acquire_mutex(mutex, timeout);
+
+               ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
+                                 "*** Thread awake after blocking, %s\n",
+                                 acpi_format_exception(status)));
+
+               /* Reacquire the interpreter */
+
+               status2 = acpi_ex_enter_interpreter();
+               if (ACPI_FAILURE(status2)) {
+
+                       /* Report fatal error, could not acquire interpreter */
+
+                       return_ACPI_STATUS(status2);
+               }
+       }
+
+       return_ACPI_STATUS(status);
+}
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ex_system_do_stall
@@ -176,7 +229,7 @@ acpi_status acpi_ex_system_do_suspend(acpi_integer how_long)
  *
  * FUNCTION:    acpi_ex_system_acquire_mutex
  *
- * PARAMETERS:  time_desc       - The 'time to delay' object descriptor
+ * PARAMETERS:  time_desc       - Maximum time to wait for the mutex
  *              obj_desc        - The object descriptor for this op
  *
  * RETURN:      Status
@@ -201,14 +254,14 @@ acpi_ex_system_acquire_mutex(union acpi_operand_object * time_desc,
 
        /* Support for the _GL_ Mutex object -- go get the global lock */
 
-       if (obj_desc->mutex.semaphore == acpi_gbl_global_lock_semaphore) {
+       if (obj_desc->mutex.os_mutex == ACPI_GLOBAL_LOCK) {
                status =
                    acpi_ev_acquire_global_lock((u16) time_desc->integer.value);
                return_ACPI_STATUS(status);
        }
 
-       status = acpi_ex_system_wait_semaphore(obj_desc->mutex.semaphore,
-                                              (u16) time_desc->integer.value);
+       status = acpi_ex_system_wait_mutex(obj_desc->mutex.os_mutex,
+                                          (u16) time_desc->integer.value);
        return_ACPI_STATUS(status);
 }
 
@@ -239,13 +292,13 @@ acpi_status acpi_ex_system_release_mutex(union acpi_operand_object *obj_desc)
 
        /* Support for the _GL_ Mutex object -- release the global lock */
 
-       if (obj_desc->mutex.semaphore == acpi_gbl_global_lock_semaphore) {
+       if (obj_desc->mutex.os_mutex == ACPI_GLOBAL_LOCK) {
                status = acpi_ev_release_global_lock();
                return_ACPI_STATUS(status);
        }
 
-       status = acpi_os_signal_semaphore(obj_desc->mutex.semaphore, 1);
-       return_ACPI_STATUS(status);
+       acpi_os_release_mutex(obj_desc->mutex.os_mutex);
+       return_ACPI_STATUS(AE_OK);
 }
 
 /*******************************************************************************
@@ -268,7 +321,8 @@ acpi_status acpi_ex_system_signal_event(union acpi_operand_object *obj_desc)
        ACPI_FUNCTION_TRACE(ex_system_signal_event);
 
        if (obj_desc) {
-               status = acpi_os_signal_semaphore(obj_desc->event.semaphore, 1);
+               status =
+                   acpi_os_signal_semaphore(obj_desc->event.os_semaphore, 1);
        }
 
        return_ACPI_STATUS(status);
@@ -299,7 +353,7 @@ acpi_ex_system_wait_event(union acpi_operand_object *time_desc,
 
        if (obj_desc) {
                status =
-                   acpi_ex_system_wait_semaphore(obj_desc->event.semaphore,
+                   acpi_ex_system_wait_semaphore(obj_desc->event.os_semaphore,
                                                  (u16) time_desc->integer.
                                                  value);
        }
@@ -322,7 +376,7 @@ acpi_ex_system_wait_event(union acpi_operand_object *time_desc,
 acpi_status acpi_ex_system_reset_event(union acpi_operand_object *obj_desc)
 {
        acpi_status status = AE_OK;
-       void *temp_semaphore;
+       acpi_semaphore temp_semaphore;
 
        ACPI_FUNCTION_ENTRY();
 
@@ -333,8 +387,8 @@ acpi_status acpi_ex_system_reset_event(union acpi_operand_object *obj_desc)
        status =
            acpi_os_create_semaphore(ACPI_NO_UNIT_LIMIT, 0, &temp_semaphore);
        if (ACPI_SUCCESS(status)) {
-               (void)acpi_os_delete_semaphore(obj_desc->event.semaphore);
-               obj_desc->event.semaphore = temp_semaphore;
+               (void)acpi_os_delete_semaphore(obj_desc->event.os_semaphore);
+               obj_desc->event.os_semaphore = temp_semaphore;
        }
 
        return (status);
index 1cd25784b7a48bee9620aadadf3d1a72e9abcdbd..daed2460924d8235552df6fc00882fa9c240af2a 100644 (file)
@@ -64,7 +64,7 @@ static struct acpi_driver acpi_fan_driver = {
 };
 
 struct acpi_fan {
-       acpi_handle handle;
+       struct acpi_device * device;
 };
 
 /* --------------------------------------------------------------------------
@@ -78,16 +78,15 @@ static int acpi_fan_read_state(struct seq_file *seq, void *offset)
        struct acpi_fan *fan = seq->private;
        int state = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_fan_read_state");
 
        if (fan) {
-               if (acpi_bus_get_power(fan->handle, &state))
+               if (acpi_bus_get_power(fan->device->handle, &state))
                        seq_printf(seq, "status:                  ERROR\n");
                else
                        seq_printf(seq, "status:                  %s\n",
                                   !state ? "on" : "off");
        }
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_fan_state_open_fs(struct inode *inode, struct file *file)
@@ -104,22 +103,21 @@ acpi_fan_write_state(struct file *file, const char __user * buffer,
        struct acpi_fan *fan = (struct acpi_fan *)m->private;
        char state_string[12] = { '\0' };
 
-       ACPI_FUNCTION_TRACE("acpi_fan_write_state");
 
        if (!fan || (count > sizeof(state_string) - 1))
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (copy_from_user(state_string, buffer, count))
-               return_VALUE(-EFAULT);
+               return -EFAULT;
 
        state_string[count] = '\0';
 
-       result = acpi_bus_set_power(fan->handle,
+       result = acpi_bus_set_power(fan->device->handle,
                                    simple_strtoul(state_string, NULL, 0));
        if (result)
-               return_VALUE(result);
+               return result;
 
-       return_VALUE(count);
+       return count;
 }
 
 static struct file_operations acpi_fan_state_ops = {
@@ -135,16 +133,15 @@ static int acpi_fan_add_fs(struct acpi_device *device)
 {
        struct proc_dir_entry *entry = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_fan_add_fs");
 
        if (!device)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (!acpi_device_dir(device)) {
                acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
                                                     acpi_fan_dir);
                if (!acpi_device_dir(device))
-                       return_VALUE(-ENODEV);
+                       return -ENODEV;
                acpi_device_dir(device)->owner = THIS_MODULE;
        }
 
@@ -153,21 +150,18 @@ static int acpi_fan_add_fs(struct acpi_device *device)
                                  S_IFREG | S_IRUGO | S_IWUSR,
                                  acpi_device_dir(device));
        if (!entry)
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to create '%s' fs entry\n",
-                                 ACPI_FAN_FILE_STATE));
+               return -ENODEV;
        else {
                entry->proc_fops = &acpi_fan_state_ops;
                entry->data = acpi_driver_data(device);
                entry->owner = THIS_MODULE;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_fan_remove_fs(struct acpi_device *device)
 {
-       ACPI_FUNCTION_TRACE("acpi_fan_remove_fs");
 
        if (acpi_device_dir(device)) {
                remove_proc_entry(ACPI_FAN_FILE_STATE, acpi_device_dir(device));
@@ -175,7 +169,7 @@ static int acpi_fan_remove_fs(struct acpi_device *device)
                acpi_device_dir(device) = NULL;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 /* --------------------------------------------------------------------------
@@ -188,25 +182,23 @@ static int acpi_fan_add(struct acpi_device *device)
        struct acpi_fan *fan = NULL;
        int state = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_fan_add");
 
        if (!device)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        fan = kmalloc(sizeof(struct acpi_fan), GFP_KERNEL);
        if (!fan)
-               return_VALUE(-ENOMEM);
+               return -ENOMEM;
        memset(fan, 0, sizeof(struct acpi_fan));
 
-       fan->handle = device->handle;
+       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(fan->handle, &state);
+       result = acpi_bus_get_power(device->handle, &state);
        if (result) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Error reading power state\n"));
+               printk(KERN_ERR PREFIX "Reading power state\n");
                goto end;
        }
 
@@ -226,17 +218,16 @@ static int acpi_fan_add(struct acpi_device *device)
        if (result)
                kfree(fan);
 
-       return_VALUE(result);
+       return result;
 }
 
 static int acpi_fan_remove(struct acpi_device *device, int type)
 {
        struct acpi_fan *fan = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_fan_remove");
 
        if (!device || !acpi_driver_data(device))
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        fan = (struct acpi_fan *)acpi_driver_data(device);
 
@@ -244,7 +235,7 @@ static int acpi_fan_remove(struct acpi_device *device, int type)
 
        kfree(fan);
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_fan_suspend(struct acpi_device *device, int state)
@@ -283,31 +274,29 @@ static int __init acpi_fan_init(void)
 {
        int result = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_fan_init");
 
        acpi_fan_dir = proc_mkdir(ACPI_FAN_CLASS, acpi_root_dir);
        if (!acpi_fan_dir)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        acpi_fan_dir->owner = THIS_MODULE;
 
        result = acpi_bus_register_driver(&acpi_fan_driver);
        if (result < 0) {
                remove_proc_entry(ACPI_FAN_CLASS, acpi_root_dir);
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 static void __exit acpi_fan_exit(void)
 {
-       ACPI_FUNCTION_TRACE("acpi_fan_exit");
 
        acpi_bus_unregister_driver(&acpi_fan_driver);
 
        remove_proc_entry(ACPI_FAN_CLASS, acpi_root_dir);
 
-       return_VOID;
+       return;
 }
 
 module_init(acpi_fan_init);
index 8daef57b994c4b264db47d4a050243812f5a0b8b..10f160dc75b1cb5370063bcf96a6c738745d028c 100644 (file)
@@ -152,7 +152,7 @@ static int get_root_bridge_busnr(acpi_handle handle)
                bbn = bus;
        }
       exit:
-       acpi_os_free(buffer.pointer);
+       kfree(buffer.pointer);
        return (int)bbn;
 }
 
@@ -192,7 +192,7 @@ find_pci_rootbridge(acpi_handle handle, u32 lvl, void *context, void **rv)
                find->handle = handle;
        status = AE_OK;
       exit:
-       acpi_os_free(buffer.pointer);
+       kfree(buffer.pointer);
        return status;
 }
 
@@ -224,7 +224,7 @@ do_acpi_find_child(acpi_handle handle, u32 lvl, void *context, void **rv)
                info = buffer.pointer;
                if (info->address == find->address)
                        find->handle = handle;
-               acpi_os_free(buffer.pointer);
+               kfree(buffer.pointer);
        }
        return AE_OK;
 }
@@ -330,7 +330,7 @@ static int acpi_platform_notify(struct device *dev)
 
                acpi_get_name(dev->firmware_data, ACPI_FULL_PATHNAME, &buffer);
                DBG("Device %s -> %s\n", dev->bus_id, (char *)buffer.pointer);
-               acpi_os_free(buffer.pointer);
+               kfree(buffer.pointer);
        } else
                DBG("Device %s -> No ACPI support\n", dev->bus_id);
 #endif
index ae142de19507059639b49b3f2471f664c98d31a6..3143f36fcec9f50caa5b3320191a5c1086a5ab18 100644 (file)
@@ -172,9 +172,9 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 * sleep_type_a, u8 * sleep_type_b)
        }
 
        /*
-        * The package must have at least two elements.  NOTE (March 2005): This
+        * The package must have at least two elements. NOTE (March 2005): This
         * goes against the current ACPI spec which defines this object as a
-        * package with one encoded DWORD element.  However, existing practice
+        * package with one encoded DWORD element. However, existing practice
         * by BIOS vendors seems to be to have 2 or more elements, at least
         * one per sleep type (A/B).
         */
@@ -255,7 +255,7 @@ struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id)
  *              return_value    - Value that was read from the register
  *              Flags           - Lock the hardware or not
  *
- * RETURN:      Status and the value read from specified Register.  Value
+ * RETURN:      Status and the value read from specified Register. Value
  *              returned is normalized to bit0 (is shifted all the way right)
  *
  * DESCRIPTION: ACPI bit_register read function.
@@ -361,8 +361,8 @@ acpi_status acpi_set_register(u32 register_id, u32 value, u32 flags)
        case ACPI_REGISTER_PM1_STATUS:
 
                /*
-                * Status Registers are different from the rest.  Clear by
-                * writing 1, and writing 0 has no effect.  So, the only relevant
+                * Status Registers are different from the rest. Clear by
+                * writing 1, and writing 0 has no effect. So, the only relevant
                 * information is the single bit we're interested in, all others should
                 * be written as 0 so they will be left unchanged.
                 */
@@ -467,14 +467,13 @@ ACPI_EXPORT_SYMBOL(acpi_set_register)
  *
  * FUNCTION:    acpi_hw_register_read
  *
- * PARAMETERS:  use_lock            - Mutex hw access
- *              register_id         - register_iD + Offset
+ * PARAMETERS:  use_lock            - Lock hardware? True/False
+ *              register_id         - ACPI Register ID
  *              return_value        - Where the register value is returned
  *
  * RETURN:      Status and the value read.
  *
- * DESCRIPTION: Acpi register read function.  Registers are read at the
- *              given offset.
+ * DESCRIPTION: Read from the specified ACPI register
  *
  ******************************************************************************/
 acpi_status
@@ -580,14 +579,26 @@ acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value)
  *
  * FUNCTION:    acpi_hw_register_write
  *
- * PARAMETERS:  use_lock            - Mutex hw access
- *              register_id         - register_iD + Offset
+ * PARAMETERS:  use_lock            - Lock hardware? True/False
+ *              register_id         - ACPI Register ID
  *              Value               - The value to write
  *
  * RETURN:      Status
  *
- * DESCRIPTION: Acpi register Write function.  Registers are written at the
- *              given offset.
+ * DESCRIPTION: Write to the specified ACPI register
+ *
+ * NOTE: In accordance with the ACPI specification, this function automatically
+ * preserves the value of the following bits, meaning that these bits cannot be
+ * changed via this interface:
+ *
+ * PM1_CONTROL[0] = SCI_EN
+ * PM1_CONTROL[9]
+ * PM1_STATUS[11]
+ *
+ * ACPI References:
+ * 1) Hardware Ignored Bits: When software writes to a register with ignored
+ *      bit fields, it preserves the ignored bit fields
+ * 2) SCI_EN: OSPM always preserves this bit position
  *
  ******************************************************************************/
 
@@ -595,6 +606,7 @@ acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value)
 {
        acpi_status status;
        acpi_cpu_flags lock_flags = 0;
+       u32 read_value;
 
        ACPI_FUNCTION_TRACE(hw_register_write);
 
@@ -605,6 +617,22 @@ acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value)
        switch (register_id) {
        case ACPI_REGISTER_PM1_STATUS:  /* 16-bit access */
 
+               /* Perform a read first to preserve certain bits (per ACPI spec) */
+
+               status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK,
+                                              ACPI_REGISTER_PM1_STATUS,
+                                              &read_value);
+               if (ACPI_FAILURE(status)) {
+                       goto unlock_and_exit;
+               }
+
+               /* Insert the bits to be preserved */
+
+               ACPI_INSERT_BITS(value, ACPI_PM1_STATUS_PRESERVED_BITS,
+                                read_value);
+
+               /* Now we can write the data */
+
                status =
                    acpi_hw_low_level_write(16, value,
                                            &acpi_gbl_FADT->xpm1a_evt_blk);
@@ -635,6 +663,25 @@ acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value)
 
        case ACPI_REGISTER_PM1_CONTROL: /* 16-bit access */
 
+               /*
+                * Perform a read first to preserve certain bits (per ACPI spec)
+                *
+                * Note: This includes SCI_EN, we never want to change this bit
+                */
+               status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK,
+                                              ACPI_REGISTER_PM1_CONTROL,
+                                              &read_value);
+               if (ACPI_FAILURE(status)) {
+                       goto unlock_and_exit;
+               }
+
+               /* Insert the bits to be preserved */
+
+               ACPI_INSERT_BITS(value, ACPI_PM1_CONTROL_PRESERVED_BITS,
+                                read_value);
+
+               /* Now we can write the data */
+
                status =
                    acpi_hw_low_level_write(16, value,
                                            &acpi_gbl_FADT->xpm1a_cnt_blk);
@@ -726,7 +773,7 @@ acpi_hw_low_level_read(u32 width, u32 * value, struct acpi_generic_address *reg)
                return (AE_OK);
        }
 
-       /* Get a local copy of the address.  Handles possible alignment issues */
+       /* Get a local copy of the address. Handles possible alignment issues */
 
        ACPI_MOVE_64_TO_64(&address, &reg->address);
        if (!address) {
@@ -798,7 +845,7 @@ acpi_hw_low_level_write(u32 width, u32 value, struct acpi_generic_address * reg)
                return (AE_OK);
        }
 
-       /* Get a local copy of the address.  Handles possible alignment issues */
+       /* Get a local copy of the address. Handles possible alignment issues */
 
        ACPI_MOVE_64_TO_64(&address, &reg->address);
        if (!address) {
index c25b2b92edcf1e8a0281d12568301d360213fb6b..fd81a0f5222f3c3f7f3173c66539a8b15111eca0 100644 (file)
@@ -231,11 +231,10 @@ struct list_head hotkey_entries;  /* head of the list of hotkey_list */
 
 static int hotkey_info_seq_show(struct seq_file *seq, void *offset)
 {
-       ACPI_FUNCTION_TRACE("hotkey_info_seq_show");
 
        seq_printf(seq, "Hotkey generic driver ver: %s\n", HOTKEY_ACPI_VERSION);
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int hotkey_info_open_fs(struct inode *inode, struct file *file)
@@ -266,7 +265,6 @@ static int hotkey_polling_seq_show(struct seq_file *seq, void *offset)
            (struct acpi_polling_hotkey *)seq->private;
        char *buf;
 
-       ACPI_FUNCTION_TRACE("hotkey_polling_seq_show");
 
        if (poll_hotkey->poll_result) {
                buf = format_result(poll_hotkey->poll_result);
@@ -274,7 +272,7 @@ static int hotkey_polling_seq_show(struct seq_file *seq, void *offset)
                        seq_printf(seq, "%s", buf);
                kfree(buf);
        }
-       return_VALUE(0);
+       return 0;
 }
 
 static int hotkey_polling_open_fs(struct inode *inode, struct file *file)
@@ -293,7 +291,6 @@ static int hotkey_get_internal_event(int event, struct acpi_hotkey_list *list)
        struct list_head *entries;
        int val = -1;
 
-       ACPI_FUNCTION_TRACE("hotkey_get_internal_event");
 
        list_for_each(entries, list->entries) {
                union acpi_hotkey *key =
@@ -305,7 +302,7 @@ static int hotkey_get_internal_event(int event, struct acpi_hotkey_list *list)
                }
        }
 
-       return_VALUE(val);
+       return val;
 }
 
 static void
@@ -314,15 +311,14 @@ acpi_hotkey_notify_handler(acpi_handle handle, u32 event, void *data)
        struct acpi_device *device = NULL;
        u32 internal_event;
 
-       ACPI_FUNCTION_TRACE("acpi_hotkey_notify_handler");
 
        if (acpi_bus_get_device(handle, &device))
-               return_VOID;
+               return;
 
        internal_event = hotkey_get_internal_event(event, &global_hotkey_list);
        acpi_bus_generate_event(device, internal_event, 0);
 
-       return_VOID;
+       return;
 }
 
 /* Need to invent automatically hotkey add method */
@@ -346,7 +342,6 @@ static int create_polling_proc(union acpi_hotkey *device)
        char proc_name[80];
        mode_t mode;
 
-       ACPI_FUNCTION_TRACE("create_polling_proc");
        mode = S_IFREG | S_IRUGO | S_IWUGO;
 
        sprintf(proc_name, "%d", device->link.hotkey_standard_num);
@@ -356,10 +351,7 @@ static int create_polling_proc(union acpi_hotkey *device)
        proc = create_proc_entry(proc_name, mode, hotkey_proc_dir);
 
        if (!proc) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Hotkey: Unable to create %s entry\n",
-                                 device->poll_hotkey.poll_method));
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        } else {
                proc->proc_fops = &hotkey_polling_fops;
                proc->owner = THIS_MODULE;
@@ -368,7 +360,7 @@ static int create_polling_proc(union acpi_hotkey *device)
                proc->gid = 0;
                device->poll_hotkey.proc = proc;
        }
-       return_VALUE(0);
+       return 0;
 }
 
 static int hotkey_add(union acpi_hotkey *device)
@@ -376,7 +368,6 @@ static int hotkey_add(union acpi_hotkey *device)
        int status = 0;
        struct acpi_device *dev = NULL;
 
-       ACPI_FUNCTION_TRACE("hotkey_add");
 
        if (device->link.hotkey_type == ACPI_HOTKEY_EVENT) {
                acpi_bus_get_device(device->event_hotkey.bus_handle, &dev);
@@ -391,14 +382,13 @@ static int hotkey_add(union acpi_hotkey *device)
 
        list_add_tail(&device->link.entries, global_hotkey_list.entries);
 
-       return_VALUE(status);
+       return status;
 }
 
 static int hotkey_remove(union acpi_hotkey *device)
 {
        struct list_head *entries, *next;
 
-       ACPI_FUNCTION_TRACE("hotkey_remove");
 
        list_for_each_safe(entries, next, global_hotkey_list.entries) {
                union acpi_hotkey *key =
@@ -412,14 +402,13 @@ static int hotkey_remove(union acpi_hotkey *device)
                }
        }
        kfree(device);
-       return_VALUE(0);
+       return 0;
 }
 
 static int hotkey_update(union acpi_hotkey *key)
 {
        struct list_head *entries;
 
-       ACPI_FUNCTION_TRACE("hotkey_update");
 
        list_for_each(entries, global_hotkey_list.entries) {
                union acpi_hotkey *tmp =
@@ -461,19 +450,18 @@ static int hotkey_update(union acpi_hotkey *key)
                                 */
                                kfree(key);
                        }
-                       return_VALUE(0);
+                       return 0;
                        break;
                }
        }
 
-       return_VALUE(-ENODEV);
+       return -ENODEV;
 }
 
 static void free_hotkey_device(union acpi_hotkey *key)
 {
        struct acpi_device *dev;
 
-       ACPI_FUNCTION_TRACE("free_hotkey_device");
 
        if (key->link.hotkey_type == ACPI_HOTKEY_EVENT) {
                acpi_bus_get_device(key->event_hotkey.bus_handle, &dev);
@@ -493,7 +481,7 @@ static void free_hotkey_device(union acpi_hotkey *key)
                free_poll_hotkey_buffer(key);
        }
        kfree(key);
-       return_VOID;
+       return;
 }
 
 static void free_hotkey_buffer(union acpi_hotkey *key)
@@ -514,7 +502,6 @@ init_hotkey_device(union acpi_hotkey *key, char *bus_str, char *action_str,
        acpi_handle tmp_handle;
        acpi_status status = AE_OK;
 
-       ACPI_FUNCTION_TRACE("init_hotkey_device");
 
        if (std_num < 0 || IS_POLL(std_num) || !key)
                goto do_fail;
@@ -541,9 +528,9 @@ init_hotkey_device(union acpi_hotkey *key, char *bus_str, char *action_str,
                                 method, &tmp_handle);
        if (ACPI_FAILURE(status))
                goto do_fail;
-       return_VALUE(AE_OK);
+       return AE_OK;
       do_fail:
-       return_VALUE(-ENODEV);
+       return -ENODEV;
 }
 
 static int
@@ -555,7 +542,6 @@ init_poll_hotkey_device(union acpi_hotkey *key,
        acpi_status status = AE_OK;
        acpi_handle tmp_handle;
 
-       ACPI_FUNCTION_TRACE("init_poll_hotkey_device");
 
        if (std_num < 0 || IS_EVENT(std_num) || !key)
                goto do_fail;
@@ -590,22 +576,20 @@ init_poll_hotkey_device(union acpi_hotkey *key,
            (union acpi_object *)kmalloc(sizeof(union acpi_object), GFP_KERNEL);
        if (!key->poll_hotkey.poll_result)
                goto do_fail;
-       return_VALUE(AE_OK);
+       return AE_OK;
       do_fail:
-       return_VALUE(-ENODEV);
+       return -ENODEV;
 }
 
 static int hotkey_open_config(struct inode *inode, struct file *file)
 {
-       ACPI_FUNCTION_TRACE("hotkey_open_config");
-       return_VALUE(single_open
+       return (single_open
                     (file, hotkey_config_seq_show, PDE(inode)->data));
 }
 
 static int hotkey_poll_open_config(struct inode *inode, struct file *file)
 {
-       ACPI_FUNCTION_TRACE("hotkey_poll_open_config");
-       return_VALUE(single_open
+       return (single_open
                     (file, hotkey_poll_config_seq_show, PDE(inode)->data));
 }
 
@@ -618,7 +602,6 @@ static int hotkey_config_seq_show(struct seq_file *seq, void *offset)
        struct acpi_buffer bus = { ACPI_PATHNAME_MAX, bus_name };
        struct acpi_buffer act = { ACPI_PATHNAME_MAX, action_name };
 
-       ACPI_FUNCTION_TRACE(("hotkey_config_seq_show"));
 
        list_for_each(entries, hotkey_list->entries) {
                union acpi_hotkey *key =
@@ -636,7 +619,7 @@ static int hotkey_config_seq_show(struct seq_file *seq, void *offset)
                }
        }
        seq_puts(seq, "\n");
-       return_VALUE(0);
+       return 0;
 }
 
 static int hotkey_poll_config_seq_show(struct seq_file *seq, void *offset)
@@ -648,7 +631,6 @@ static int hotkey_poll_config_seq_show(struct seq_file *seq, void *offset)
        struct acpi_buffer bus = { ACPI_PATHNAME_MAX, bus_name };
        struct acpi_buffer act = { ACPI_PATHNAME_MAX, action_name };
 
-       ACPI_FUNCTION_TRACE(("hotkey_config_seq_show"));
 
        list_for_each(entries, hotkey_list->entries) {
                union acpi_hotkey *key =
@@ -666,7 +648,7 @@ static int hotkey_poll_config_seq_show(struct seq_file *seq, void *offset)
                }
        }
        seq_puts(seq, "\n");
-       return_VALUE(0);
+       return 0;
 }
 
 static int
@@ -678,7 +660,6 @@ get_parms(char *config_record,
          char **method, int *internal_event_num, int *external_event_num)
 {
        char *tmp, *tmp1, count;
-       ACPI_FUNCTION_TRACE(("get_parms"));
 
        sscanf(config_record, "%d", cmd);
 
@@ -744,9 +725,9 @@ get_parms(char *config_record,
            0)
                goto do_fail;
 
-       return_VALUE(6);
+       return 6;
       do_fail:
-       return_VALUE(-1);
+       return -1;
 }
 
 /*  count is length for one input record */
@@ -763,16 +744,15 @@ static ssize_t hotkey_write_config(struct file *file,
        int ret = 0;
        union acpi_hotkey *key = NULL;
 
-       ACPI_FUNCTION_TRACE(("hotkey_write_config"));
 
        config_record = (char *)kmalloc(count + 1, GFP_KERNEL);
        if (!config_record)
-               return_VALUE(-ENOMEM);
+               return -ENOMEM;
 
        if (copy_from_user(config_record, buffer, count)) {
                kfree(config_record);
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data \n"));
-               return_VALUE(-EINVAL);
+               printk(KERN_ERR PREFIX "Invalid data\n");
+               return -EINVAL;
        }
        config_record[count] = 0;
 
@@ -792,9 +772,8 @@ static ssize_t hotkey_write_config(struct file *file,
                kfree(bus_method);
                kfree(action_handle);
                kfree(method);
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Invalid data format ret=%d\n", ret));
-               return_VALUE(-EINVAL);
+               printk(KERN_ERR PREFIX "Invalid data format ret=%d\n", ret);
+               return -EINVAL;
        }
 
        key = kmalloc(sizeof(union acpi_hotkey), GFP_KERNEL);
@@ -806,7 +785,7 @@ static ssize_t hotkey_write_config(struct file *file,
                tmp = get_hotkey_by_event(&global_hotkey_list,
                                          internal_event_num);
                if (!tmp)
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid key"));
+                       printk(KERN_ERR PREFIX "Invalid key\n");
                else
                        memcpy(key, tmp, sizeof(union acpi_hotkey));
                goto cont_cmd;
@@ -828,8 +807,8 @@ static ssize_t hotkey_write_config(struct file *file,
                else
                        free_poll_hotkey_buffer(key);
                kfree(key);
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid hotkey \n"));
-               return_VALUE(-EINVAL);
+               printk(KERN_ERR PREFIX "Invalid hotkey\n");
+               return -EINVAL;
        }
 
       cont_cmd:
@@ -855,15 +834,15 @@ static ssize_t hotkey_write_config(struct file *file,
                goto fail_out;
                break;
        }
-       return_VALUE(count);
+       return count;
       fail_out:
        if (IS_EVENT(internal_event_num))
                free_hotkey_buffer(key);
        else
                free_poll_hotkey_buffer(key);
        kfree(key);
-       ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "invalid key\n"));
-       return_VALUE(-EINVAL);
+       printk(KERN_ERR PREFIX "invalid key\n");
+       return -EINVAL;
 }
 
 /*
@@ -880,7 +859,6 @@ static int write_acpi_int(acpi_handle handle, const char *method, int val,
        union acpi_object in_obj;       /* the only param we use */
        acpi_status status;
 
-       ACPI_FUNCTION_TRACE("write_acpi_int");
        params.count = 1;
        params.pointer = &in_obj;
        in_obj.type = ACPI_TYPE_INTEGER;
@@ -888,7 +866,7 @@ static int write_acpi_int(acpi_handle handle, const char *method, int val,
 
        status = acpi_evaluate_object(handle, (char *)method, &params, output);
 
-       return_VALUE(status == AE_OK);
+       return (status == AE_OK);
 }
 
 static int read_acpi_int(acpi_handle handle, const char *method,
@@ -898,7 +876,6 @@ static int read_acpi_int(acpi_handle handle, const char *method,
        union acpi_object out_obj;
        acpi_status status;
 
-       ACPI_FUNCTION_TRACE("read_acpi_int");
        output.length = sizeof(out_obj);
        output.pointer = &out_obj;
 
@@ -907,8 +884,8 @@ static int read_acpi_int(acpi_handle handle, const char *method,
                val->integer.value = out_obj.integer.value;
                val->type = out_obj.type;
        } else
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "null val pointer"));
-       return_VALUE((status == AE_OK)
+               printk(KERN_ERR PREFIX "null val pointer\n");
+       return ((status == AE_OK)
                     && (out_obj.type == ACPI_TYPE_INTEGER));
 }
 
@@ -945,24 +922,23 @@ static ssize_t hotkey_execute_aml_method(struct file *file,
        int event, method_type, type, value;
        union acpi_hotkey *key;
 
-       ACPI_FUNCTION_TRACE("hotkey_execte_aml_method");
 
        arg = (char *)kmalloc(count + 1, GFP_KERNEL);
        if (!arg)
-               return_VALUE(-ENOMEM);
+               return -ENOMEM;
        arg[count] = 0;
 
        if (copy_from_user(arg, buffer, count)) {
                kfree(arg);
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument 2"));
-               return_VALUE(-EINVAL);
+               printk(KERN_ERR PREFIX "Invalid argument 2\n");
+               return -EINVAL;
        }
 
        if (sscanf(arg, "%d:%d:%d:%d", &event, &method_type, &type, &value) !=
            4) {
                kfree(arg);
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument 3"));
-               return_VALUE(-EINVAL);
+               printk(KERN_ERR PREFIX "Invalid argument 3\n");
+               return -EINVAL;
        }
        kfree(arg);
        if (type == ACPI_TYPE_INTEGER) {
@@ -987,12 +963,12 @@ static ssize_t hotkey_execute_aml_method(struct file *file,
 
                }
        } else {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Not supported"));
-               return_VALUE(-EINVAL);
+               printk(KERN_WARNING "Not supported\n");
+               return -EINVAL;
        }
-       return_VALUE(count);
+       return count;
       do_fail:
-       return_VALUE(-EINVAL);
+       return -EINVAL;
 
 }
 
@@ -1001,7 +977,6 @@ static int __init hotkey_init(void)
        int result;
        mode_t mode = S_IFREG | S_IRUGO | S_IWUGO;
 
-       ACPI_FUNCTION_TRACE("hotkey_init");
 
        if (acpi_disabled)
                return -ENODEV;
@@ -1013,9 +988,6 @@ static int __init hotkey_init(void)
 
        hotkey_proc_dir = proc_mkdir(HOTKEY_PROC, acpi_root_dir);
        if (!hotkey_proc_dir) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Hotkey: Unable to create %s entry\n",
-                                 HOTKEY_PROC));
                return (-ENODEV);
        }
        hotkey_proc_dir->owner = THIS_MODULE;
@@ -1023,9 +995,6 @@ static int __init hotkey_init(void)
        hotkey_config =
            create_proc_entry(HOTKEY_EV_CONFIG, mode, hotkey_proc_dir);
        if (!hotkey_config) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Hotkey: Unable to create %s entry\n",
-                                 HOTKEY_EV_CONFIG));
                goto do_fail1;
        } else {
                hotkey_config->proc_fops = &hotkey_config_fops;
@@ -1038,10 +1007,6 @@ static int __init hotkey_init(void)
        hotkey_poll_config =
            create_proc_entry(HOTKEY_PL_CONFIG, mode, hotkey_proc_dir);
        if (!hotkey_poll_config) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Hotkey: Unable to create %s entry\n",
-                                 HOTKEY_EV_CONFIG));
-
                goto do_fail2;
        } else {
                hotkey_poll_config->proc_fops = &hotkey_poll_config_fops;
@@ -1053,9 +1018,6 @@ static int __init hotkey_init(void)
 
        hotkey_action = create_proc_entry(HOTKEY_ACTION, mode, hotkey_proc_dir);
        if (!hotkey_action) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Hotkey: Unable to create %s entry\n",
-                                 HOTKEY_ACTION));
                goto do_fail3;
        } else {
                hotkey_action->proc_fops = &hotkey_action_fops;
@@ -1066,9 +1028,6 @@ static int __init hotkey_init(void)
 
        hotkey_info = create_proc_entry(HOTKEY_INFO, mode, hotkey_proc_dir);
        if (!hotkey_info) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Hotkey: Unable to create %s entry\n",
-                                 HOTKEY_INFO));
                goto do_fail4;
        } else {
                hotkey_info->proc_fops = &hotkey_info_fops;
@@ -1104,7 +1063,6 @@ static void __exit hotkey_exit(void)
 {
        struct list_head *entries, *next;
 
-       ACPI_FUNCTION_TRACE("hotkey_exit");
 
        list_for_each_safe(entries, next, global_hotkey_list.entries) {
                union acpi_hotkey *key =
diff --git a/drivers/acpi/i2c_ec.c b/drivers/acpi/i2c_ec.c
new file mode 100644 (file)
index 0000000..84239d5
--- /dev/null
@@ -0,0 +1,406 @@
+/*
+ * SMBus driver for ACPI Embedded Controller ($Revision: 1.3 $)
+ *
+ * Copyright (c) 2002, 2005 Ducrot Bruno
+ * Copyright (c) 2005 Rich Townsend (tiny hacks & tweaks)
+ *
+ * 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 version 2.
+ */
+
+#include <linux/version.h>
+#include <linux/module.h>
+#include <linux/slab.h>
+#include <linux/kernel.h>
+#include <linux/stddef.h>
+#include <linux/sched.h>
+#include <linux/init.h>
+#include <linux/i2c.h>
+#include <linux/acpi.h>
+#include <linux/delay.h>
+
+#include "i2c_ec.h"
+
+#define        xudelay(t)      udelay(t)
+#define        xmsleep(t)      msleep(t)
+
+#define ACPI_EC_HC_COMPONENT   0x00080000
+#define ACPI_EC_HC_CLASS       "ec_hc_smbus"
+#define ACPI_EC_HC_HID         "ACPI0001"
+#define ACPI_EC_HC_DRIVER_NAME "ACPI EC HC smbus driver"
+#define ACPI_EC_HC_DEVICE_NAME "EC HC smbus"
+
+#define _COMPONENT             ACPI_EC_HC_COMPONENT
+
+ACPI_MODULE_NAME("acpi_smbus")
+
+static int acpi_ec_hc_add(struct acpi_device *device);
+static int acpi_ec_hc_remove(struct acpi_device *device, int type);
+
+static struct acpi_driver acpi_ec_hc_driver = {
+       .name = ACPI_EC_HC_DRIVER_NAME,
+       .class = ACPI_EC_HC_CLASS,
+       .ids = ACPI_EC_HC_HID,
+       .ops = {
+               .add = acpi_ec_hc_add,
+               .remove = acpi_ec_hc_remove,
+               },
+};
+
+/* Various bit mask for EC_SC (R) */
+#define OBF            0x01
+#define IBF            0x02
+#define CMD            0x08
+#define BURST          0x10
+#define SCI_EVT                0x20
+#define SMI_EVT                0x40
+
+/* Commands for EC_SC (W) */
+#define RD_EC          0x80
+#define WR_EC          0x81
+#define BE_EC          0x82
+#define BD_EC          0x83
+#define QR_EC          0x84
+
+/*
+ * ACPI 2.0 chapter 13 SMBus 2.0 EC register model
+ */
+
+#define ACPI_EC_SMB_PRTCL      0x00    /* protocol, PEC */
+#define ACPI_EC_SMB_STS                0x01    /* status */
+#define ACPI_EC_SMB_ADDR       0x02    /* address */
+#define ACPI_EC_SMB_CMD                0x03    /* command */
+#define ACPI_EC_SMB_DATA       0x04    /* 32 data registers */
+#define ACPI_EC_SMB_BCNT       0x24    /* number of data bytes */
+#define ACPI_EC_SMB_ALRM_A     0x25    /* alarm address */
+#define ACPI_EC_SMB_ALRM_D     0x26    /* 2 bytes alarm data */
+
+#define ACPI_EC_SMB_STS_DONE   0x80
+#define ACPI_EC_SMB_STS_ALRM   0x40
+#define ACPI_EC_SMB_STS_RES    0x20
+#define ACPI_EC_SMB_STS_STATUS 0x1f
+
+#define ACPI_EC_SMB_STATUS_OK          0x00
+#define ACPI_EC_SMB_STATUS_FAIL                0x07
+#define ACPI_EC_SMB_STATUS_DNAK                0x10
+#define ACPI_EC_SMB_STATUS_DERR                0x11
+#define ACPI_EC_SMB_STATUS_CMD_DENY    0x12
+#define ACPI_EC_SMB_STATUS_UNKNOWN     0x13
+#define ACPI_EC_SMB_STATUS_ACC_DENY    0x17
+#define ACPI_EC_SMB_STATUS_TIMEOUT     0x18
+#define ACPI_EC_SMB_STATUS_NOTSUP      0x19
+#define ACPI_EC_SMB_STATUS_BUSY                0x1A
+#define ACPI_EC_SMB_STATUS_PEC         0x1F
+
+#define ACPI_EC_SMB_PRTCL_WRITE                        0x00
+#define ACPI_EC_SMB_PRTCL_READ                 0x01
+#define ACPI_EC_SMB_PRTCL_QUICK                        0x02
+#define ACPI_EC_SMB_PRTCL_BYTE                 0x04
+#define ACPI_EC_SMB_PRTCL_BYTE_DATA            0x06
+#define ACPI_EC_SMB_PRTCL_WORD_DATA            0x08
+#define ACPI_EC_SMB_PRTCL_BLOCK_DATA           0x0a
+#define ACPI_EC_SMB_PRTCL_PROC_CALL            0x0c
+#define ACPI_EC_SMB_PRTCL_BLOCK_PROC_CALL      0x0d
+#define ACPI_EC_SMB_PRTCL_I2C_BLOCK_DATA       0x4a
+#define ACPI_EC_SMB_PRTCL_PEC                  0x80
+
+/* Length of pre/post transaction sleep (msec) */
+#define ACPI_EC_SMB_TRANSACTION_SLEEP          1
+#define ACPI_EC_SMB_ACCESS_SLEEP1              1
+#define ACPI_EC_SMB_ACCESS_SLEEP2              10
+
+static int acpi_ec_smb_read(struct acpi_ec_smbus *smbus, u8 address, u8 * data)
+{
+       u8 val;
+       int err;
+
+       err = ec_read(smbus->base + address, &val);
+       if (!err) {
+               *data = val;
+       }
+       xmsleep(ACPI_EC_SMB_TRANSACTION_SLEEP);
+       return (err);
+}
+
+static int acpi_ec_smb_write(struct acpi_ec_smbus *smbus, u8 address, u8 data)
+{
+       int err;
+
+       err = ec_write(smbus->base + address, data);
+       return (err);
+}
+
+static int
+acpi_ec_smb_access(struct i2c_adapter *adap, u16 addr, unsigned short flags,
+                  char read_write, u8 command, int size,
+                  union i2c_smbus_data *data)
+{
+       struct acpi_ec_smbus *smbus = adap->algo_data;
+       unsigned char protocol, len = 0, pec, temp[2] = { 0, 0 };
+       int i;
+
+       if (read_write == I2C_SMBUS_READ) {
+               protocol = ACPI_EC_SMB_PRTCL_READ;
+       } else {
+               protocol = ACPI_EC_SMB_PRTCL_WRITE;
+       }
+       pec = (flags & I2C_CLIENT_PEC) ? ACPI_EC_SMB_PRTCL_PEC : 0;
+
+       switch (size) {
+
+       case I2C_SMBUS_QUICK:
+               protocol |= ACPI_EC_SMB_PRTCL_QUICK;
+               read_write = I2C_SMBUS_WRITE;
+               break;
+
+       case I2C_SMBUS_BYTE:
+               if (read_write == I2C_SMBUS_WRITE) {
+                       acpi_ec_smb_write(smbus, ACPI_EC_SMB_DATA, data->byte);
+               }
+               protocol |= ACPI_EC_SMB_PRTCL_BYTE;
+               break;
+
+       case I2C_SMBUS_BYTE_DATA:
+               acpi_ec_smb_write(smbus, ACPI_EC_SMB_CMD, command);
+               if (read_write == I2C_SMBUS_WRITE) {
+                       acpi_ec_smb_write(smbus, ACPI_EC_SMB_DATA, data->byte);
+               }
+               protocol |= ACPI_EC_SMB_PRTCL_BYTE_DATA;
+               break;
+
+       case I2C_SMBUS_WORD_DATA:
+               acpi_ec_smb_write(smbus, ACPI_EC_SMB_CMD, command);
+               if (read_write == I2C_SMBUS_WRITE) {
+                       acpi_ec_smb_write(smbus, ACPI_EC_SMB_DATA, data->word);
+                       acpi_ec_smb_write(smbus, ACPI_EC_SMB_DATA + 1,
+                                         data->word >> 8);
+               }
+               protocol |= ACPI_EC_SMB_PRTCL_WORD_DATA | pec;
+               break;
+
+       case I2C_SMBUS_BLOCK_DATA:
+               acpi_ec_smb_write(smbus, ACPI_EC_SMB_CMD, command);
+               if (read_write == I2C_SMBUS_WRITE) {
+                       len = min_t(u8, data->block[0], 32);
+                       acpi_ec_smb_write(smbus, ACPI_EC_SMB_BCNT, len);
+                       for (i = 0; i < len; i++)
+                               acpi_ec_smb_write(smbus, ACPI_EC_SMB_DATA + i,
+                                                 data->block[i + 1]);
+               }
+               protocol |= ACPI_EC_SMB_PRTCL_BLOCK_DATA | pec;
+               break;
+
+       case I2C_SMBUS_I2C_BLOCK_DATA:
+               len = min_t(u8, data->block[0], 32);
+               acpi_ec_smb_write(smbus, ACPI_EC_SMB_CMD, command);
+               acpi_ec_smb_write(smbus, ACPI_EC_SMB_BCNT, len);
+               if (read_write == I2C_SMBUS_WRITE) {
+                       for (i = 0; i < len; i++) {
+                               acpi_ec_smb_write(smbus, ACPI_EC_SMB_DATA + i,
+                                                 data->block[i + 1]);
+                       }
+               }
+               protocol |= ACPI_EC_SMB_PRTCL_I2C_BLOCK_DATA;
+               break;
+
+       case I2C_SMBUS_PROC_CALL:
+               acpi_ec_smb_write(smbus, ACPI_EC_SMB_CMD, command);
+               acpi_ec_smb_write(smbus, ACPI_EC_SMB_DATA, data->word);
+               acpi_ec_smb_write(smbus, ACPI_EC_SMB_DATA + 1, data->word >> 8);
+               protocol = ACPI_EC_SMB_PRTCL_PROC_CALL | pec;
+               read_write = I2C_SMBUS_READ;
+               break;
+
+       case I2C_SMBUS_BLOCK_PROC_CALL:
+               protocol |= pec;
+               len = min_t(u8, data->block[0], 31);
+               acpi_ec_smb_write(smbus, ACPI_EC_SMB_CMD, command);
+               acpi_ec_smb_write(smbus, ACPI_EC_SMB_BCNT, len);
+               for (i = 0; i < len; i++)
+                       acpi_ec_smb_write(smbus, ACPI_EC_SMB_DATA + i,
+                                         data->block[i + 1]);
+               protocol = ACPI_EC_SMB_PRTCL_BLOCK_PROC_CALL | pec;
+               read_write = I2C_SMBUS_READ;
+               break;
+
+       default:
+               ACPI_DEBUG_PRINT((ACPI_DB_WARN, "EC SMBus adapter: "
+                                 "Unsupported transaction %d\n", size));
+               return (-1);
+       }
+
+       acpi_ec_smb_write(smbus, ACPI_EC_SMB_ADDR, addr << 1);
+       acpi_ec_smb_write(smbus, ACPI_EC_SMB_PRTCL, protocol);
+
+       acpi_ec_smb_read(smbus, ACPI_EC_SMB_STS, temp + 0);
+
+       if (~temp[0] & ACPI_EC_SMB_STS_DONE) {
+               xudelay(500);
+               acpi_ec_smb_read(smbus, ACPI_EC_SMB_STS, temp + 0);
+       }
+       if (~temp[0] & ACPI_EC_SMB_STS_DONE) {
+               xmsleep(ACPI_EC_SMB_ACCESS_SLEEP2);
+               acpi_ec_smb_read(smbus, ACPI_EC_SMB_STS, temp + 0);
+       }
+       if ((~temp[0] & ACPI_EC_SMB_STS_DONE)
+           || (temp[0] & ACPI_EC_SMB_STS_STATUS)) {
+               return (-1);
+       }
+
+       if (read_write == I2C_SMBUS_WRITE) {
+               return (0);
+       }
+
+       switch (size) {
+
+       case I2C_SMBUS_BYTE:
+       case I2C_SMBUS_BYTE_DATA:
+               acpi_ec_smb_read(smbus, ACPI_EC_SMB_DATA, &data->byte);
+               break;
+
+       case I2C_SMBUS_WORD_DATA:
+       case I2C_SMBUS_PROC_CALL:
+               acpi_ec_smb_read(smbus, ACPI_EC_SMB_DATA, temp + 0);
+               acpi_ec_smb_read(smbus, ACPI_EC_SMB_DATA + 1, temp + 1);
+               data->word = (temp[1] << 8) | temp[0];
+               break;
+
+       case I2C_SMBUS_BLOCK_DATA:
+       case I2C_SMBUS_BLOCK_PROC_CALL:
+               len = 0;
+               acpi_ec_smb_read(smbus, ACPI_EC_SMB_BCNT, &len);
+               len = min_t(u8, len, 32);
+       case I2C_SMBUS_I2C_BLOCK_DATA:
+               for (i = 0; i < len; i++)
+                       acpi_ec_smb_read(smbus, ACPI_EC_SMB_DATA + i,
+                                        data->block + i + 1);
+               data->block[0] = len;
+               break;
+       }
+
+       return (0);
+}
+
+static u32 acpi_ec_smb_func(struct i2c_adapter *adapter)
+{
+
+       return (I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
+               I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
+               I2C_FUNC_SMBUS_BLOCK_DATA |
+               I2C_FUNC_SMBUS_PROC_CALL |
+               I2C_FUNC_SMBUS_BLOCK_PROC_CALL |
+               I2C_FUNC_SMBUS_I2C_BLOCK | I2C_FUNC_SMBUS_HWPEC_CALC);
+}
+
+static struct i2c_algorithm acpi_ec_smbus_algorithm = {
+       .smbus_xfer = acpi_ec_smb_access,
+       .functionality = acpi_ec_smb_func,
+};
+
+static int acpi_ec_hc_add(struct acpi_device *device)
+{
+       int status;
+       unsigned long val;
+       struct acpi_ec_hc *ec_hc;
+       struct acpi_ec_smbus *smbus;
+
+       if (!device) {
+               return -EINVAL;
+       }
+
+       ec_hc = kmalloc(sizeof(struct acpi_ec_hc), GFP_KERNEL);
+       if (!ec_hc) {
+               return -ENOMEM;
+       }
+       memset(ec_hc, 0, sizeof(struct acpi_ec_hc));
+
+       smbus = kmalloc(sizeof(struct acpi_ec_smbus), GFP_KERNEL);
+       if (!smbus) {
+               kfree(ec_hc);
+               return -ENOMEM;
+       }
+       memset(smbus, 0, sizeof(struct acpi_ec_smbus));
+
+       ec_hc->handle = device->handle;
+       strcpy(acpi_device_name(device), ACPI_EC_HC_DEVICE_NAME);
+       strcpy(acpi_device_class(device), ACPI_EC_HC_CLASS);
+       acpi_driver_data(device) = ec_hc;
+
+       status = acpi_evaluate_integer(ec_hc->handle, "_EC", NULL, &val);
+       if (ACPI_FAILURE(status)) {
+               ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Error obtaining _EC\n"));
+               kfree(ec_hc->smbus);
+               kfree(smbus);
+               return -EIO;
+       }
+
+       smbus->ec = acpi_driver_data(device->parent);
+       smbus->base = (val & 0xff00ull) >> 8;
+       smbus->alert = val & 0xffull;
+
+       smbus->adapter.owner = THIS_MODULE;
+       smbus->adapter.algo = &acpi_ec_smbus_algorithm;
+       smbus->adapter.algo_data = smbus;
+
+       if (i2c_add_adapter(&smbus->adapter)) {
+               ACPI_DEBUG_PRINT((ACPI_DB_WARN,
+                                 "EC SMBus adapter: Failed to register adapter\n"));
+               kfree(smbus);
+               kfree(ec_hc);
+               return -EIO;
+       }
+
+       ec_hc->smbus = smbus;
+
+       printk(KERN_INFO PREFIX "%s [%s]\n",
+              acpi_device_name(device), acpi_device_bid(device));
+
+       return AE_OK;
+}
+
+static int acpi_ec_hc_remove(struct acpi_device *device, int type)
+{
+       struct acpi_ec_hc *ec_hc;
+
+       if (!device) {
+               return -EINVAL;
+       }
+       ec_hc = acpi_driver_data(device);
+
+       i2c_del_adapter(&ec_hc->smbus->adapter);
+       kfree(ec_hc->smbus);
+       kfree(ec_hc);
+
+       return AE_OK;
+}
+
+static int __init acpi_ec_hc_init(void)
+{
+       int result;
+
+       result = acpi_bus_register_driver(&acpi_ec_hc_driver);
+       if (result < 0) {
+               return -ENODEV;
+       }
+       return 0;
+}
+
+static void __exit acpi_ec_hc_exit(void)
+{
+       acpi_bus_unregister_driver(&acpi_ec_hc_driver);
+}
+
+struct acpi_ec_hc *acpi_get_ec_hc(struct acpi_device *device)
+{
+       return ((struct acpi_ec_hc *)acpi_driver_data(device->parent));
+}
+
+EXPORT_SYMBOL(acpi_get_ec_hc);
+
+module_init(acpi_ec_hc_init);
+module_exit(acpi_ec_hc_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Ducrot Bruno");
+MODULE_DESCRIPTION("ACPI EC SMBus driver");
diff --git a/drivers/acpi/i2c_ec.h b/drivers/acpi/i2c_ec.h
new file mode 100644 (file)
index 0000000..7c53fb7
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * SMBus driver for ACPI Embedded Controller ($Revision: 1.2 $)
+ *
+ * Copyright (c) 2002, 2005 Ducrot Bruno
+ *
+ * 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 version 2.
+ */
+
+struct acpi_ec_smbus {
+       struct i2c_adapter adapter;
+       union acpi_ec *ec;
+       int base;
+       int alert;
+};
+
+struct acpi_ec_hc {
+       acpi_handle handle;
+       struct acpi_ec_smbus *smbus;
+};
+
+struct acpi_ec_hc *acpi_get_ec_hc(struct acpi_device *device);
index d51d68f5dd8ddd66ab21e2ef5d082adaf5d7fff0..ec6b7f9ede34d911818075d75eb11f7d95f02b87 100644 (file)
@@ -52,13 +52,12 @@ static acpi_status acpi_reserve_io_ranges(struct acpi_resource *res, void *data)
 {
        struct resource *requested_res = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_reserve_io_ranges");
 
        if (res->type == ACPI_RESOURCE_TYPE_IO) {
                struct acpi_resource_io *io_res = &res->data.io;
 
                if (io_res->minimum != io_res->maximum)
-                       return_VALUE(AE_OK);
+                       return AE_OK;
                if (IS_RESERVED_ADDR
                    (io_res->minimum, io_res->address_length)) {
                        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
@@ -92,7 +91,7 @@ static acpi_status acpi_reserve_io_ranges(struct acpi_resource *res, void *data)
 
        if (requested_res)
                requested_res->flags &= ~IORESOURCE_BUSY;
-       return_VALUE(AE_OK);
+       return AE_OK;
 }
 
 static int acpi_motherboard_add(struct acpi_device *device)
index 48fadade52e2b17bbd55777fd30204bb2168548d..c1c6c236df9affedc4ba07f0bbd161684b4053a6 100644 (file)
@@ -196,33 +196,30 @@ acpi_status acpi_ns_root_initialize(void)
                                    (u8) (ACPI_TO_INTEGER(val) - 1);
 
                                if (ACPI_STRCMP(init_val->name, "_GL_") == 0) {
-                                       /*
-                                        * Create a counting semaphore for the
-                                        * global lock
-                                        */
+
+                                       /* Create a counting semaphore for the global lock */
+
                                        status =
                                            acpi_os_create_semaphore
                                            (ACPI_NO_UNIT_LIMIT, 1,
-                                            &obj_desc->mutex.semaphore);
+                                            &acpi_gbl_global_lock_semaphore);
                                        if (ACPI_FAILURE(status)) {
                                                acpi_ut_remove_reference
                                                    (obj_desc);
                                                goto unlock_and_exit;
                                        }
 
-                                       /*
-                                        * We just created the mutex for the
-                                        * global lock, save it
-                                        */
-                                       acpi_gbl_global_lock_semaphore =
-                                           obj_desc->mutex.semaphore;
+                                       /* Mark this mutex as very special */
+
+                                       obj_desc->mutex.os_mutex =
+                                           ACPI_GLOBAL_LOCK;
                                } else {
                                        /* Create a mutex */
 
-                                       status = acpi_os_create_semaphore(1, 1,
-                                                                         &obj_desc->
-                                                                         mutex.
-                                                                         semaphore);
+                                       status =
+                                           acpi_os_create_mutex(&obj_desc->
+                                                                mutex.
+                                                                os_mutex);
                                        if (ACPI_FAILURE(status)) {
                                                acpi_ut_remove_reference
                                                    (obj_desc);
index 6d9bd45af30a6c95b997978d6d6d02e68b0fcc3c..dca6799ac678a978df124150cee591c832f5c5c4 100644 (file)
@@ -133,7 +133,7 @@ acpi_evaluate_object_typed(acpi_handle handle,
 
                /* Caller used ACPI_ALLOCATE_BUFFER, free the return buffer */
 
-               acpi_os_free(return_buffer->pointer);
+               ACPI_FREE(return_buffer->pointer);
                return_buffer->pointer = NULL;
        }
 
index 13d6d5bdea264f16dbe6239d2cde0a5b5d5daa20..e5e448edca41e14e5c2f9ce3265a8ffb1960c23f 100644 (file)
@@ -23,7 +23,6 @@
  *
  */
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
@@ -260,12 +259,10 @@ int acpi_get_node(acpi_handle *handle)
 {
        int pxm, node = -1;
 
-       ACPI_FUNCTION_TRACE("acpi_get_node");
-
        pxm = acpi_get_pxm(handle);
        if (pxm >= 0)
                node = acpi_map_pxm_to_node(pxm);
 
-       return_VALUE(node);
+       return node;
 }
 EXPORT_SYMBOL(acpi_get_node);
index 1bb558adee66cbf90fa930ce93165d6a1d99ba6f..eedb05c6dc7b6d14e901f0c68abb021c4426b097 100644 (file)
@@ -25,7 +25,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
@@ -137,6 +136,7 @@ void acpi_os_vprintf(const char *fmt, va_list args)
 #endif
 }
 
+
 extern int acpi_in_resume;
 void *acpi_os_allocate(acpi_size size)
 {
@@ -146,13 +146,6 @@ void *acpi_os_allocate(acpi_size size)
                return kmalloc(size, GFP_KERNEL);
 }
 
-void acpi_os_free(void *ptr)
-{
-       kfree(ptr);
-}
-
-EXPORT_SYMBOL(acpi_os_free);
-
 acpi_status acpi_os_get_root_pointer(u32 flags, struct acpi_pointer *addr)
 {
        if (efi_enabled) {
@@ -280,7 +273,7 @@ acpi_os_install_interrupt_handler(u32 gsi, acpi_osd_handler handler,
 
        acpi_irq_handler = handler;
        acpi_irq_context = context;
-       if (request_irq(irq, acpi_irq, SA_SHIRQ, "acpi", acpi_irq)) {
+       if (request_irq(irq, acpi_irq, IRQF_SHARED, "acpi", acpi_irq)) {
                printk(KERN_ERR PREFIX "SCI (IRQ%d) allocation failed\n", irq);
                return AE_NOT_ACQUIRED;
        }
@@ -586,19 +579,18 @@ static void acpi_os_execute_deferred(void *context)
 {
        struct acpi_os_dpc *dpc = NULL;
 
-       ACPI_FUNCTION_TRACE("os_execute_deferred");
 
        dpc = (struct acpi_os_dpc *)context;
        if (!dpc) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid (NULL) context.\n"));
-               return_VOID;
+               printk(KERN_ERR PREFIX "Invalid (NULL) context\n");
+               return;
        }
 
        dpc->function(dpc->context);
 
        kfree(dpc);
 
-       return_VOID;
+       return;
 }
 
 static int acpi_os_execute_thread(void *context)
@@ -688,35 +680,19 @@ EXPORT_SYMBOL(acpi_os_wait_events_complete);
 /*
  * Allocate the memory for a spinlock and initialize it.
  */
-acpi_status acpi_os_create_lock(acpi_handle * out_handle)
+acpi_status acpi_os_create_lock(acpi_spinlock * handle)
 {
-       spinlock_t *lock_ptr;
-
-       ACPI_FUNCTION_TRACE("os_create_lock");
+       spin_lock_init(*handle);
 
-       lock_ptr = acpi_os_allocate(sizeof(spinlock_t));
-
-       spin_lock_init(lock_ptr);
-
-       ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Creating spinlock[%p].\n", lock_ptr));
-
-       *out_handle = lock_ptr;
-
-       return_ACPI_STATUS(AE_OK);
+       return AE_OK;
 }
 
 /*
  * Deallocate the memory for a spinlock.
  */
-void acpi_os_delete_lock(acpi_handle handle)
+void acpi_os_delete_lock(acpi_spinlock handle)
 {
-       ACPI_FUNCTION_TRACE("os_create_lock");
-
-       ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Deleting spinlock[%p].\n", handle));
-
-       acpi_os_free(handle);
-
-       return_VOID;
+       return;
 }
 
 acpi_status
@@ -724,11 +700,10 @@ acpi_os_create_semaphore(u32 max_units, u32 initial_units, acpi_handle * handle)
 {
        struct semaphore *sem = NULL;
 
-       ACPI_FUNCTION_TRACE("os_create_semaphore");
 
        sem = acpi_os_allocate(sizeof(struct semaphore));
        if (!sem)
-               return_ACPI_STATUS(AE_NO_MEMORY);
+               return AE_NO_MEMORY;
        memset(sem, 0, sizeof(struct semaphore));
 
        sema_init(sem, initial_units);
@@ -738,7 +713,7 @@ acpi_os_create_semaphore(u32 max_units, u32 initial_units, acpi_handle * handle)
        ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Creating semaphore[%p|%d].\n",
                          *handle, initial_units));
 
-       return_ACPI_STATUS(AE_OK);
+       return AE_OK;
 }
 
 EXPORT_SYMBOL(acpi_os_create_semaphore);
@@ -754,17 +729,16 @@ acpi_status acpi_os_delete_semaphore(acpi_handle handle)
 {
        struct semaphore *sem = (struct semaphore *)handle;
 
-       ACPI_FUNCTION_TRACE("os_delete_semaphore");
 
        if (!sem)
-               return_ACPI_STATUS(AE_BAD_PARAMETER);
+               return AE_BAD_PARAMETER;
 
        ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Deleting semaphore[%p].\n", handle));
 
-       acpi_os_free(sem);
+       kfree(sem);
        sem = NULL;
 
-       return_ACPI_STATUS(AE_OK);
+       return AE_OK;
 }
 
 EXPORT_SYMBOL(acpi_os_delete_semaphore);
@@ -784,13 +758,12 @@ acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 timeout)
        struct semaphore *sem = (struct semaphore *)handle;
        int ret = 0;
 
-       ACPI_FUNCTION_TRACE("os_wait_semaphore");
 
        if (!sem || (units < 1))
-               return_ACPI_STATUS(AE_BAD_PARAMETER);
+               return AE_BAD_PARAMETER;
 
        if (units > 1)
-               return_ACPI_STATUS(AE_SUPPORT);
+               return AE_SUPPORT;
 
        ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Waiting for semaphore[%p|%d|%d]\n",
                          handle, units, timeout));
@@ -839,17 +812,17 @@ acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 timeout)
        }
 
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Failed to acquire semaphore[%p|%d|%d], %s\n",
+               ACPI_DEBUG_PRINT((ACPI_DB_MUTEX,
+                                 "Failed to acquire semaphore[%p|%d|%d], %s",
                                  handle, units, timeout,
                                  acpi_format_exception(status)));
        } else {
                ACPI_DEBUG_PRINT((ACPI_DB_MUTEX,
-                                 "Acquired semaphore[%p|%d|%d]\n", handle,
+                                 "Acquired semaphore[%p|%d|%d]", handle,
                                  units, timeout));
        }
 
-       return_ACPI_STATUS(status);
+       return status;
 }
 
 EXPORT_SYMBOL(acpi_os_wait_semaphore);
@@ -861,20 +834,19 @@ acpi_status acpi_os_signal_semaphore(acpi_handle handle, u32 units)
 {
        struct semaphore *sem = (struct semaphore *)handle;
 
-       ACPI_FUNCTION_TRACE("os_signal_semaphore");
 
        if (!sem || (units < 1))
-               return_ACPI_STATUS(AE_BAD_PARAMETER);
+               return AE_BAD_PARAMETER;
 
        if (units > 1)
-               return_ACPI_STATUS(AE_SUPPORT);
+               return AE_SUPPORT;
 
        ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Signaling semaphore[%p|%d]\n", handle,
                          units));
 
        up(sem);
 
-       return_ACPI_STATUS(AE_OK);
+       return AE_OK;
 }
 
 EXPORT_SYMBOL(acpi_os_signal_semaphore);
@@ -1043,10 +1015,10 @@ EXPORT_SYMBOL(max_cstate);
  * handle is a pointer to the spinlock_t.
  */
 
-acpi_cpu_flags acpi_os_acquire_lock(acpi_handle handle)
+acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock lockp)
 {
        acpi_cpu_flags flags;
-       spin_lock_irqsave((spinlock_t *) handle, flags);
+       spin_lock_irqsave(lockp, flags);
        return flags;
 }
 
@@ -1054,9 +1026,9 @@ acpi_cpu_flags acpi_os_acquire_lock(acpi_handle handle)
  * Release a spinlock. See above.
  */
 
-void acpi_os_release_lock(acpi_handle handle, acpi_cpu_flags flags)
+void acpi_os_release_lock(acpi_spinlock lockp, acpi_cpu_flags flags)
 {
-       spin_unlock_irqrestore((spinlock_t *) handle, flags);
+       spin_unlock_irqrestore(lockp, flags);
 }
 
 #ifndef ACPI_USE_LOCAL_CACHE
index 7ee2f2e7752515154e6c7bf2339af7bacc6c71ae..a02aa62fe1e5324f417e47d6c41bb8d67204311c 100644 (file)
@@ -469,6 +469,16 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
        }
 
        walk_state->thread = thread;
+
+       /*
+        * If executing a method, the starting sync_level is this method's
+        * sync_level
+        */
+       if (walk_state->method_desc) {
+               walk_state->thread->current_sync_level =
+                   walk_state->method_desc->method.sync_level;
+       }
+
        acpi_ds_push_walk_state(walk_state, thread);
 
        /*
@@ -505,6 +515,10 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
                        status =
                            acpi_ds_call_control_method(thread, walk_state,
                                                        NULL);
+                       if (ACPI_FAILURE(status)) {
+                               status =
+                                   acpi_ds_method_error(status, walk_state);
+                       }
 
                        /*
                         * If the transfer to the new method method call worked, a new walk
@@ -525,7 +539,7 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
                        /* Check for possible multi-thread reentrancy problem */
 
                        if ((status == AE_ALREADY_EXISTS) &&
-                           (!walk_state->method_desc->method.semaphore)) {
+                           (!walk_state->method_desc->method.mutex)) {
                                /*
                                 * Method tried to create an object twice. The probable cause is
                                 * that the method cannot handle reentrancy.
@@ -537,7 +551,7 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
                                 */
                                walk_state->method_desc->method.method_flags |=
                                    AML_METHOD_SERIALIZED;
-                               walk_state->method_desc->method.concurrency = 1;
+                               walk_state->method_desc->method.sync_level = 0;
                        }
                }
 
index 2a718df769b546ee533e55dc96fa5e8cdd510625..1e2ae6e7a7e47d4e24e1e9af051d447d32178e39 100644 (file)
@@ -47,11 +47,10 @@ struct acpi_pci_data {
 static void acpi_pci_data_handler(acpi_handle handle, u32 function,
                                  void *context)
 {
-       ACPI_FUNCTION_TRACE("acpi_pci_data_handler");
 
        /* TBD: Anything we need to do here? */
 
-       return_VOID;
+       return;
 }
 
 /**
@@ -68,25 +67,24 @@ acpi_status acpi_get_pci_id(acpi_handle handle, struct acpi_pci_id *id)
        struct acpi_device *device = NULL;
        struct acpi_pci_data *data = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_get_pci_id");
 
        if (!id)
-               return_ACPI_STATUS(AE_BAD_PARAMETER);
+               return AE_BAD_PARAMETER;
 
        result = acpi_bus_get_device(handle, &device);
        if (result) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Invalid ACPI Bus context for device %s\n",
-                                 acpi_device_bid(device)));
-               return_ACPI_STATUS(AE_NOT_EXIST);
+               printk(KERN_ERR PREFIX
+                           "Invalid ACPI Bus context for device %s\n",
+                           acpi_device_bid(device));
+               return AE_NOT_EXIST;
        }
 
        status = acpi_get_data(handle, acpi_pci_data_handler, (void **)&data);
        if (ACPI_FAILURE(status) || !data) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Invalid ACPI-PCI context for device %s\n",
-                                 acpi_device_bid(device)));
-               return_ACPI_STATUS(status);
+               ACPI_EXCEPTION((AE_INFO, status,
+                               "Invalid ACPI-PCI context for device %s",
+                               acpi_device_bid(device)));
+               return status;
        }
 
        *id = data->id;
@@ -103,7 +101,7 @@ acpi_status acpi_get_pci_id(acpi_handle handle, struct acpi_pci_id *id)
                          acpi_device_bid(device), id->segment, id->bus,
                          id->device, id->function));
 
-       return_ACPI_STATUS(AE_OK);
+       return AE_OK;
 }
 
 EXPORT_SYMBOL(acpi_get_pci_id);
@@ -120,14 +118,13 @@ int acpi_pci_bind(struct acpi_device *device)
        struct pci_dev *dev;
        struct pci_bus *bus;
 
-       ACPI_FUNCTION_TRACE("acpi_pci_bind");
 
        if (!device || !device->parent)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        pathname = kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
        if (!pathname)
-               return_VALUE(-ENOMEM);
+               return -ENOMEM;
        memset(pathname, 0, ACPI_PATHNAME_MAX);
        buffer.length = ACPI_PATHNAME_MAX;
        buffer.pointer = pathname;
@@ -135,7 +132,7 @@ int acpi_pci_bind(struct acpi_device *device)
        data = kmalloc(sizeof(struct acpi_pci_data), GFP_KERNEL);
        if (!data) {
                kfree(pathname);
-               return_VALUE(-ENOMEM);
+               return -ENOMEM;
        }
        memset(data, 0, sizeof(struct acpi_pci_data));
 
@@ -151,9 +148,9 @@ int acpi_pci_bind(struct acpi_device *device)
        status = acpi_get_data(device->parent->handle, acpi_pci_data_handler,
                               (void **)&pdata);
        if (ACPI_FAILURE(status) || !pdata || !pdata->bus) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Invalid ACPI-PCI context for parent device %s\n",
-                                 acpi_device_bid(device->parent)));
+               ACPI_EXCEPTION((AE_INFO, status,
+                               "Invalid ACPI-PCI context for parent device %s",
+                               acpi_device_bid(device->parent)));
                result = -ENODEV;
                goto end;
        }
@@ -206,10 +203,10 @@ int acpi_pci_bind(struct acpi_device *device)
                goto end;
        }
        if (!data->dev->bus) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Device %02x:%02x:%02x.%02x has invalid 'bus' field\n",
-                                 data->id.segment, data->id.bus,
-                                 data->id.device, data->id.function));
+               printk(KERN_ERR PREFIX
+                           "Device %02x:%02x:%02x.%02x has invalid 'bus' field\n",
+                           data->id.segment, data->id.bus,
+                           data->id.device, data->id.function);
                result = -ENODEV;
                goto end;
        }
@@ -237,9 +234,9 @@ int acpi_pci_bind(struct acpi_device *device)
         */
        status = acpi_attach_data(device->handle, acpi_pci_data_handler, data);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to attach ACPI-PCI context to device %s\n",
-                                 acpi_device_bid(device)));
+               ACPI_EXCEPTION((AE_INFO, status,
+                               "Unable to attach ACPI-PCI context to device %s",
+                               acpi_device_bid(device)));
                result = -ENODEV;
                goto end;
        }
@@ -269,7 +266,7 @@ int acpi_pci_bind(struct acpi_device *device)
        if (result)
                kfree(data);
 
-       return_VALUE(result);
+       return result;
 }
 
 int acpi_pci_unbind(struct acpi_device *device)
@@ -280,14 +277,13 @@ int acpi_pci_unbind(struct acpi_device *device)
        char *pathname = NULL;
        struct acpi_buffer buffer = { 0, NULL };
 
-       ACPI_FUNCTION_TRACE("acpi_pci_unbind");
 
        if (!device || !device->parent)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        pathname = (char *)kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
        if (!pathname)
-               return_VALUE(-ENOMEM);
+               return -ENOMEM;
        memset(pathname, 0, ACPI_PATHNAME_MAX);
 
        buffer.length = ACPI_PATHNAME_MAX;
@@ -301,18 +297,18 @@ int acpi_pci_unbind(struct acpi_device *device)
            acpi_get_data(device->handle, acpi_pci_data_handler,
                          (void **)&data);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to get data from device %s\n",
-                                 acpi_device_bid(device)));
+               ACPI_EXCEPTION((AE_INFO, status,
+                               "Unable to get data from device %s",
+                               acpi_device_bid(device)));
                result = -ENODEV;
                goto end;
        }
 
        status = acpi_detach_data(device->handle, acpi_pci_data_handler);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to detach data from device %s\n",
-                                 acpi_device_bid(device)));
+               ACPI_EXCEPTION((AE_INFO, status,
+                               "Unable to detach data from device %s",
+                               acpi_device_bid(device)));
                result = -ENODEV;
                goto end;
        }
@@ -322,7 +318,7 @@ int acpi_pci_unbind(struct acpi_device *device)
        kfree(data);
 
       end:
-       return_VALUE(result);
+       return result;
 }
 
 int
@@ -335,11 +331,10 @@ acpi_pci_bind_root(struct acpi_device *device,
        char *pathname = NULL;
        struct acpi_buffer buffer = { 0, NULL };
 
-       ACPI_FUNCTION_TRACE("acpi_pci_bind_root");
 
        pathname = (char *)kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
        if (!pathname)
-               return_VALUE(-ENOMEM);
+               return -ENOMEM;
        memset(pathname, 0, ACPI_PATHNAME_MAX);
 
        buffer.length = ACPI_PATHNAME_MAX;
@@ -347,13 +342,13 @@ acpi_pci_bind_root(struct acpi_device *device,
 
        if (!device || !id || !bus) {
                kfree(pathname);
-               return_VALUE(-EINVAL);
+               return -EINVAL;
        }
 
        data = kmalloc(sizeof(struct acpi_pci_data), GFP_KERNEL);
        if (!data) {
                kfree(pathname);
-               return_VALUE(-ENOMEM);
+               return -ENOMEM;
        }
        memset(data, 0, sizeof(struct acpi_pci_data));
 
@@ -369,9 +364,9 @@ acpi_pci_bind_root(struct acpi_device *device,
 
        status = acpi_attach_data(device->handle, acpi_pci_data_handler, data);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to attach ACPI-PCI context to device %s\n",
-                                 pathname));
+               ACPI_EXCEPTION((AE_INFO, status,
+                               "Unable to attach ACPI-PCI context to device %s",
+                               pathname));
                result = -ENODEV;
                goto end;
        }
@@ -381,5 +376,5 @@ acpi_pci_bind_root(struct acpi_device *device,
        if (result != 0)
                kfree(data);
 
-       return_VALUE(result);
+       return result;
 }
index 65aee79b3971fc02f25b8faa53528ece37b0fd64..feda0341f5a73b5a921c6d858de94bf9babfbc4b 100644 (file)
@@ -24,7 +24,6 @@
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  */
 
-#include <linux/config.h>
 
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -55,10 +54,9 @@ static struct acpi_prt_entry *acpi_pci_irq_find_prt_entry(int segment,
        struct list_head *node = NULL;
        struct acpi_prt_entry *entry = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_pci_irq_find_prt_entry");
 
        if (!acpi_prt.count)
-               return_PTR(NULL);
+               return NULL;
 
        /*
         * Parse through all PRT entries looking for a match on the specified
@@ -73,12 +71,12 @@ static struct acpi_prt_entry *acpi_pci_irq_find_prt_entry(int segment,
                    && (device == entry->id.device)
                    && (pin == entry->pin)) {
                        spin_unlock(&acpi_prt_lock);
-                       return_PTR(entry);
+                       return entry;
                }
        }
 
        spin_unlock(&acpi_prt_lock);
-       return_PTR(NULL);
+       return NULL;
 }
 
 static int
@@ -87,14 +85,13 @@ acpi_pci_irq_add_entry(acpi_handle handle,
 {
        struct acpi_prt_entry *entry = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_pci_irq_add_entry");
 
        if (!prt)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        entry = kmalloc(sizeof(struct acpi_prt_entry), GFP_KERNEL);
        if (!entry)
-               return_VALUE(-ENOMEM);
+               return -ENOMEM;
        memset(entry, 0, sizeof(struct acpi_prt_entry));
 
        entry->id.segment = segment;
@@ -141,7 +138,7 @@ acpi_pci_irq_add_entry(acpi_handle handle,
        acpi_prt.count++;
        spin_unlock(&acpi_prt_lock);
 
-       return_VALUE(0);
+       return 0;
 }
 
 static void
@@ -163,11 +160,10 @@ int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus)
        struct acpi_pci_routing_table *entry = NULL;
        static int first_time = 1;
 
-       ACPI_FUNCTION_TRACE("acpi_pci_irq_add_prt");
 
        pathname = (char *)kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
        if (!pathname)
-               return_VALUE(-ENOMEM);
+               return -ENOMEM;
        memset(pathname, 0, ACPI_PATHNAME_MAX);
 
        if (first_time) {
@@ -197,24 +193,24 @@ int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus)
        kfree(pathname);
        status = acpi_get_irq_routing_table(handle, &buffer);
        if (status != AE_BUFFER_OVERFLOW) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PRT [%s]\n",
-                                 acpi_format_exception(status)));
-               return_VALUE(-ENODEV);
+               ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRT [%s]",
+                               acpi_format_exception(status)));
+               return -ENODEV;
        }
 
        prt = kmalloc(buffer.length, GFP_KERNEL);
        if (!prt) {
-               return_VALUE(-ENOMEM);
+               return -ENOMEM;
        }
        memset(prt, 0, buffer.length);
        buffer.pointer = prt;
 
        status = acpi_get_irq_routing_table(handle, &buffer);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PRT [%s]\n",
-                                 acpi_format_exception(status)));
+               ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRT [%s]",
+                               acpi_format_exception(status)));
                kfree(buffer.pointer);
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        }
 
        entry = prt;
@@ -227,7 +223,7 @@ int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus)
 
        kfree(prt);
 
-       return_VALUE(0);
+       return 0;
 }
 
 void acpi_pci_irq_del_prt(int segment, int bus)
@@ -262,16 +258,15 @@ acpi_pci_allocate_irq(struct acpi_prt_entry *entry,
 {
        int irq;
 
-       ACPI_FUNCTION_TRACE("acpi_pci_allocate_irq");
 
        if (entry->link.handle) {
                irq = acpi_pci_link_allocate_irq(entry->link.handle,
                                                 entry->link.index, triggering,
                                                 polarity, link);
                if (irq < 0) {
-                       ACPI_DEBUG_PRINT((ACPI_DB_WARN,
-                                         "Invalid IRQ link routing entry\n"));
-                       return_VALUE(-1);
+                       printk(KERN_WARNING PREFIX
+                                     "Invalid IRQ link routing entry\n");
+                       return -1;
                }
        } else {
                irq = entry->link.index;
@@ -280,7 +275,7 @@ acpi_pci_allocate_irq(struct acpi_prt_entry *entry,
        }
 
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found IRQ %d\n", irq));
-       return_VALUE(irq);
+       return irq;
 }
 
 static int
@@ -289,13 +284,12 @@ acpi_pci_free_irq(struct acpi_prt_entry *entry,
 {
        int irq;
 
-       ACPI_FUNCTION_TRACE("acpi_pci_free_irq");
        if (entry->link.handle) {
                irq = acpi_pci_link_free_irq(entry->link.handle);
        } else {
                irq = entry->link.index;
        }
-       return_VALUE(irq);
+       return irq;
 }
 
 /*
@@ -315,7 +309,6 @@ acpi_pci_irq_lookup(struct pci_bus *bus,
        int bus_nr = bus->number;
        int ret;
 
-       ACPI_FUNCTION_TRACE("acpi_pci_irq_lookup");
 
        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                          "Searching for PRT entry for %02x:%02x:%02x[%c]\n",
@@ -324,11 +317,11 @@ acpi_pci_irq_lookup(struct pci_bus *bus,
        entry = acpi_pci_irq_find_prt_entry(segment, bus_nr, device, pin);
        if (!entry) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO, "PRT entry not found\n"));
-               return_VALUE(-1);
+               return -1;
        }
 
        ret = func(entry, triggering, polarity, link);
-       return_VALUE(ret);
+       return ret;
 }
 
 /*
@@ -346,10 +339,9 @@ acpi_pci_irq_derive(struct pci_dev *dev,
        int irq = -1;
        u8 bridge_pin = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_pci_irq_derive");
 
        if (!dev)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        /* 
         * Attempt to derive an IRQ for this device from a parent bridge's
@@ -366,7 +358,7 @@ acpi_pci_irq_derive(struct pci_dev *dev,
                                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                                  "No interrupt pin configured for device %s\n",
                                                  pci_name(bridge)));
-                               return_VALUE(-1);
+                               return -1;
                        }
                        /* Pin is from 0 to 3 */
                        bridge_pin--;
@@ -379,16 +371,15 @@ acpi_pci_irq_derive(struct pci_dev *dev,
        }
 
        if (irq < 0) {
-               ACPI_DEBUG_PRINT((ACPI_DB_WARN,
-                                 "Unable to derive IRQ for device %s\n",
-                                 pci_name(dev)));
-               return_VALUE(-1);
+               printk(KERN_WARNING PREFIX "Unable to derive IRQ for device %s\n",
+                             pci_name(dev));
+               return -1;
        }
 
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Derive IRQ %d for device %s from %s\n",
                          irq, pci_name(dev), pci_name(bridge)));
 
-       return_VALUE(irq);
+       return irq;
 }
 
 /*
@@ -406,24 +397,22 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
        char *link = NULL;
        int rc;
 
-       ACPI_FUNCTION_TRACE("acpi_pci_irq_enable");
 
        if (!dev)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        pin = dev->pin;
        if (!pin) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                  "No interrupt pin configured for device %s\n",
                                  pci_name(dev)));
-               return_VALUE(0);
+               return 0;
        }
        pin--;
 
        if (!dev->bus) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Invalid (NULL) 'bus' field\n"));
-               return_VALUE(-ENODEV);
+               printk(KERN_ERR PREFIX "Invalid (NULL) 'bus' field\n");
+               return -ENODEV;
        }
 
        /* 
@@ -455,10 +444,10 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
                        printk(" - using IRQ %d\n", dev->irq);
                        acpi_register_gsi(dev->irq, ACPI_LEVEL_SENSITIVE,
                                          ACPI_ACTIVE_LOW);
-                       return_VALUE(0);
+                       return 0;
                } else {
                        printk("\n");
-                       return_VALUE(0);
+                       return 0;
                }
        }
 
@@ -466,7 +455,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
        if (rc < 0) {
                printk(KERN_WARNING PREFIX "PCI Interrupt %s[%c]: failed "
                       "to register GSI\n", pci_name(dev), ('A' + pin));
-               return_VALUE(rc);
+               return rc;
        }
        dev->irq = rc;
 
@@ -480,7 +469,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
               (triggering == ACPI_LEVEL_SENSITIVE) ? "level" : "edge",
               (polarity == ACPI_ACTIVE_LOW) ? "low" : "high", dev->irq);
 
-       return_VALUE(0);
+       return 0;
 }
 
 EXPORT_SYMBOL(acpi_pci_irq_enable);
@@ -497,14 +486,13 @@ void acpi_pci_irq_disable(struct pci_dev *dev)
        int triggering = ACPI_LEVEL_SENSITIVE;
        int polarity = ACPI_ACTIVE_LOW;
 
-       ACPI_FUNCTION_TRACE("acpi_pci_irq_disable");
 
        if (!dev || !dev->bus)
-               return_VOID;
+               return;
 
        pin = dev->pin;
        if (!pin)
-               return_VOID;
+               return;
        pin--;
 
        /*
@@ -522,7 +510,7 @@ void acpi_pci_irq_disable(struct pci_dev *dev)
                                          &triggering, &polarity, NULL,
                                          acpi_pci_free_irq);
        if (gsi < 0)
-               return_VOID;
+               return;
 
        /*
         * TBD: It might be worth clearing dev->irq by magic constant
@@ -534,5 +522,5 @@ void acpi_pci_irq_disable(struct pci_dev *dev)
 
        acpi_unregister_gsi(gsi);
 
-       return_VOID;
+       return;
 }
index 228bdb626502a4d1e45872d6269da3b2aa009adb..8197c0e40769f68785559c58ce0002058ed6aa25 100644 (file)
@@ -83,7 +83,6 @@ struct acpi_pci_link_irq {
 struct acpi_pci_link {
        struct list_head node;
        struct acpi_device *device;
-       acpi_handle handle;
        struct acpi_pci_link_irq irq;
        int refcnt;
 };
@@ -107,26 +106,23 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context)
        struct acpi_pci_link *link = (struct acpi_pci_link *)context;
        u32 i = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_pci_link_check_possible");
 
        switch (resource->type) {
        case ACPI_RESOURCE_TYPE_START_DEPENDENT:
-               return_ACPI_STATUS(AE_OK);
+               return AE_OK;
        case ACPI_RESOURCE_TYPE_IRQ:
                {
                        struct acpi_resource_irq *p = &resource->data.irq;
                        if (!p || !p->interrupt_count) {
-                               ACPI_DEBUG_PRINT((ACPI_DB_WARN,
-                                                 "Blank IRQ resource\n"));
-                               return_ACPI_STATUS(AE_OK);
+                               printk(KERN_WARNING PREFIX "Blank IRQ resource\n");
+                               return AE_OK;
                        }
                        for (i = 0;
                             (i < p->interrupt_count
                              && i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) {
                                if (!p->interrupts[i]) {
-                                       ACPI_DEBUG_PRINT((ACPI_DB_WARN,
-                                                         "Invalid IRQ %d\n",
-                                                         p->interrupts[i]));
+                                       printk(KERN_WARNING PREFIX "Invalid IRQ %d\n",
+                                                     p->interrupts[i]);
                                        continue;
                                }
                                link->irq.possible[i] = p->interrupts[i];
@@ -142,17 +138,16 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context)
                        struct acpi_resource_extended_irq *p =
                            &resource->data.extended_irq;
                        if (!p || !p->interrupt_count) {
-                               ACPI_DEBUG_PRINT((ACPI_DB_WARN,
-                                                 "Blank EXT IRQ resource\n"));
-                               return_ACPI_STATUS(AE_OK);
+                               printk(KERN_WARNING PREFIX
+                                             "Blank EXT IRQ resource\n");
+                               return AE_OK;
                        }
                        for (i = 0;
                             (i < p->interrupt_count
                              && i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) {
                                if (!p->interrupts[i]) {
-                                       ACPI_DEBUG_PRINT((ACPI_DB_WARN,
-                                                         "Invalid IRQ %d\n",
-                                                         p->interrupts[i]));
+                                       printk(KERN_WARNING PREFIX "Invalid IRQ %d\n",
+                                                     p->interrupts[i]);
                                        continue;
                                }
                                link->irq.possible[i] = p->interrupts[i];
@@ -164,35 +159,33 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context)
                        break;
                }
        default:
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Resource is not an IRQ entry\n"));
-               return_ACPI_STATUS(AE_OK);
+               printk(KERN_ERR PREFIX "Resource is not an IRQ entry\n");
+               return AE_OK;
        }
 
-       return_ACPI_STATUS(AE_CTRL_TERMINATE);
+       return AE_CTRL_TERMINATE;
 }
 
 static int acpi_pci_link_get_possible(struct acpi_pci_link *link)
 {
        acpi_status status;
 
-       ACPI_FUNCTION_TRACE("acpi_pci_link_get_possible");
 
        if (!link)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
-       status = acpi_walk_resources(link->handle, METHOD_NAME__PRS,
+       status = acpi_walk_resources(link->device->handle, METHOD_NAME__PRS,
                                     acpi_pci_link_check_possible, link);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PRS\n"));
-               return_VALUE(-ENODEV);
+               ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRS"));
+               return -ENODEV;
        }
 
        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                          "Found %d possible IRQs\n",
                          link->irq.possible_count));
 
-       return_VALUE(0);
+       return 0;
 }
 
 static acpi_status
@@ -200,7 +193,6 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context)
 {
        int *irq = (int *)context;
 
-       ACPI_FUNCTION_TRACE("acpi_pci_link_check_current");
 
        switch (resource->type) {
        case ACPI_RESOURCE_TYPE_IRQ:
@@ -213,7 +205,7 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context)
                                 */
                                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                                  "Blank IRQ resource\n"));
-                               return_ACPI_STATUS(AE_OK);
+                               return AE_OK;
                        }
                        *irq = p->interrupts[0];
                        break;
@@ -227,20 +219,20 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context)
                                 * extended IRQ descriptors must
                                 * return at least 1 IRQ
                                 */
-                               ACPI_DEBUG_PRINT((ACPI_DB_WARN,
-                                                 "Blank EXT IRQ resource\n"));
-                               return_ACPI_STATUS(AE_OK);
+                               printk(KERN_WARNING PREFIX
+                                             "Blank EXT IRQ resource\n");
+                               return AE_OK;
                        }
                        *irq = p->interrupts[0];
                        break;
                }
                break;
        default:
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Resource %d isn't an IRQ\n", resource->type));
+               printk(KERN_ERR PREFIX "Resource %d isn't an IRQ\n", resource->type);
        case ACPI_RESOURCE_TYPE_END_TAG:
-               return_ACPI_STATUS(AE_OK);
+               return AE_OK;
        }
-       return_ACPI_STATUS(AE_CTRL_TERMINATE);
+       return AE_CTRL_TERMINATE;
 }
 
 /*
@@ -256,10 +248,8 @@ static int acpi_pci_link_get_current(struct acpi_pci_link *link)
        acpi_status status = AE_OK;
        int irq = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_pci_link_get_current");
-
-       if (!link || !link->handle)
-               return_VALUE(-EINVAL);
+       if (!link)
+               return -EINVAL;
 
        link->irq.active = 0;
 
@@ -268,14 +258,13 @@ static int acpi_pci_link_get_current(struct acpi_pci_link *link)
                /* Query _STA, set link->device->status */
                result = acpi_bus_get_status(link->device);
                if (result) {
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                         "Unable to read status\n"));
+                       printk(KERN_ERR PREFIX "Unable to read status\n");
                        goto end;
                }
 
                if (!link->device->status.enabled) {
                        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link disabled\n"));
-                       return_VALUE(0);
+                       return 0;
                }
        }
 
@@ -283,16 +272,16 @@ static int acpi_pci_link_get_current(struct acpi_pci_link *link)
         * Query and parse _CRS to get the current IRQ assignment. 
         */
 
-       status = acpi_walk_resources(link->handle, METHOD_NAME__CRS,
+       status = acpi_walk_resources(link->device->handle, METHOD_NAME__CRS,
                                     acpi_pci_link_check_current, &irq);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _CRS\n"));
+               ACPI_EXCEPTION((AE_INFO, status, "Evaluating _CRS"));
                result = -ENODEV;
                goto end;
        }
 
        if (acpi_strict && !irq) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "_CRS returned 0\n"));
+               printk(KERN_ERR PREFIX "_CRS returned 0\n");
                result = -ENODEV;
        }
 
@@ -301,7 +290,7 @@ static int acpi_pci_link_get_current(struct acpi_pci_link *link)
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link at IRQ %d \n", link->irq.active));
 
       end:
-       return_VALUE(result);
+       return result;
 }
 
 static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
@@ -314,14 +303,13 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
        } *resource;
        struct acpi_buffer buffer = { 0, NULL };
 
-       ACPI_FUNCTION_TRACE("acpi_pci_link_set");
 
        if (!link || !irq)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        resource = kmalloc(sizeof(*resource) + 1, GFP_ATOMIC);
        if (!resource)
-               return_VALUE(-ENOMEM);
+               return -ENOMEM;
 
        memset(resource, 0, sizeof(*resource) + 1);
        buffer.length = sizeof(*resource) + 1;
@@ -362,7 +350,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
                /* ignore resource_source, it's optional */
                break;
        default:
-               printk("ACPI BUG: resource_type %d\n", link->irq.resource_type);
+               printk(KERN_ERR PREFIX "Invalid Resource_type %d\n", link->irq.resource_type);
                result = -EINVAL;
                goto end;
 
@@ -370,11 +358,11 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
        resource->end.type = ACPI_RESOURCE_TYPE_END_TAG;
 
        /* Attempt to set the resource */
-       status = acpi_set_current_resources(link->handle, &buffer);
+       status = acpi_set_current_resources(link->device->handle, &buffer);
 
        /* check for total failure */
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _SRS\n"));
+               ACPI_EXCEPTION((AE_INFO, status, "Evaluating _SRS"));
                result = -ENODEV;
                goto end;
        }
@@ -382,14 +370,14 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
        /* Query _STA, set device->status */
        result = acpi_bus_get_status(link->device);
        if (result) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unable to read status\n"));
+               printk(KERN_ERR PREFIX "Unable to read status\n");
                goto end;
        }
        if (!link->device->status.enabled) {
                printk(KERN_WARNING PREFIX
-                      "%s [%s] disabled and referenced, BIOS bug.\n",
-                      acpi_device_name(link->device),
-                      acpi_device_bid(link->device));
+                             "%s [%s] disabled and referenced, BIOS bug\n",
+                             acpi_device_name(link->device),
+                             acpi_device_bid(link->device));
        }
 
        /* Query _CRS, set link->irq.active */
@@ -408,9 +396,9 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
                 * assume _SRS worked and override _CRS value.
                 */
                printk(KERN_WARNING PREFIX
-                      "%s [%s] BIOS reported IRQ %d, using IRQ %d\n",
-                      acpi_device_name(link->device),
-                      acpi_device_bid(link->device), link->irq.active, irq);
+                             "%s [%s] BIOS reported IRQ %d, using IRQ %d\n",
+                             acpi_device_name(link->device),
+                             acpi_device_bid(link->device), link->irq.active, irq);
                link->irq.active = irq;
        }
 
@@ -418,7 +406,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
 
       end:
        kfree(resource);
-       return_VALUE(result);
+       return result;
 }
 
 /* --------------------------------------------------------------------------
@@ -492,7 +480,6 @@ int __init acpi_irq_penalty_init(void)
        struct acpi_pci_link *link = NULL;
        int i = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_irq_penalty_init");
 
        /*
         * Update penalties to facilitate IRQ balancing.
@@ -501,8 +488,7 @@ int __init acpi_irq_penalty_init(void)
 
                link = list_entry(node, struct acpi_pci_link, node);
                if (!link) {
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                         "Invalid link context\n"));
+                       printk(KERN_ERR PREFIX "Invalid link context\n");
                        continue;
                }
 
@@ -530,7 +516,7 @@ int __init acpi_irq_penalty_init(void)
        /* Add a penalty for the SCI */
        acpi_irq_penalty[acpi_fadt.sci_int] += PIRQ_PENALTY_PCI_USING;
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_irq_balance;   /* 0: static, 1: balance */
@@ -540,13 +526,12 @@ static int acpi_pci_link_allocate(struct acpi_pci_link *link)
        int irq;
        int i;
 
-       ACPI_FUNCTION_TRACE("acpi_pci_link_allocate");
 
        if (link->irq.initialized) {
                if (link->refcnt == 0)
                        /* This means the link is disabled but initialized */
                        acpi_pci_link_set(link, link->irq.active);
-               return_VALUE(0);
+               return 0;
        }
 
        /*
@@ -562,7 +547,7 @@ static int acpi_pci_link_allocate(struct acpi_pci_link *link)
        if (i == link->irq.possible_count) {
                if (acpi_strict)
                        printk(KERN_WARNING PREFIX "_CRS %d not found"
-                              " in _PRS\n", link->irq.active);
+                                     " in _PRS\n", link->irq.active);
                link->irq.active = 0;
        }
 
@@ -589,12 +574,11 @@ static int acpi_pci_link_allocate(struct acpi_pci_link *link)
 
        /* Attempt to enable the link device at this IRQ. */
        if (acpi_pci_link_set(link, irq)) {
-               printk(PREFIX
-                      "Unable to set IRQ for %s [%s] (likely buggy ACPI BIOS).\n"
-                      "Try pci=noacpi or acpi=off\n",
-                      acpi_device_name(link->device),
-                      acpi_device_bid(link->device));
-               return_VALUE(-ENODEV);
+               printk(KERN_ERR PREFIX "Unable to set IRQ for %s [%s]. "
+                           "Try pci=noacpi or acpi=off\n",
+                           acpi_device_name(link->device),
+                           acpi_device_bid(link->device));
+               return -ENODEV;
        } else {
                acpi_irq_penalty[link->irq.active] += PIRQ_PENALTY_PCI_USING;
                printk(PREFIX "%s [%s] enabled at IRQ %d\n",
@@ -604,7 +588,7 @@ static int acpi_pci_link_allocate(struct acpi_pci_link *link)
 
        link->irq.initialized = 1;
 
-       return_VALUE(0);
+       return 0;
 }
 
 /*
@@ -622,36 +606,35 @@ acpi_pci_link_allocate_irq(acpi_handle handle,
        struct acpi_device *device = NULL;
        struct acpi_pci_link *link = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_pci_link_allocate_irq");
 
        result = acpi_bus_get_device(handle, &device);
        if (result) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link device\n"));
-               return_VALUE(-1);
+               printk(KERN_ERR PREFIX "Invalid link device\n");
+               return -1;
        }
 
        link = (struct acpi_pci_link *)acpi_driver_data(device);
        if (!link) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link context\n"));
-               return_VALUE(-1);
+               printk(KERN_ERR PREFIX "Invalid link context\n");
+               return -1;
        }
 
        /* TBD: Support multiple index (IRQ) entries per Link Device */
        if (index) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid index %d\n", index));
-               return_VALUE(-1);
+               printk(KERN_ERR PREFIX "Invalid index %d\n", index);
+               return -1;
        }
 
        mutex_lock(&acpi_link_lock);
        if (acpi_pci_link_allocate(link)) {
                mutex_unlock(&acpi_link_lock);
-               return_VALUE(-1);
+               return -1;
        }
 
        if (!link->irq.active) {
                mutex_unlock(&acpi_link_lock);
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link active IRQ is 0!\n"));
-               return_VALUE(-1);
+               printk(KERN_ERR PREFIX "Link active IRQ is 0!\n");
+               return -1;
        }
        link->refcnt++;
        mutex_unlock(&acpi_link_lock);
@@ -665,7 +648,7 @@ acpi_pci_link_allocate_irq(acpi_handle handle,
        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                          "Link %s is referenced\n",
                          acpi_device_bid(link->device)));
-       return_VALUE(link->irq.active);
+       return (link->irq.active);
 }
 
 /*
@@ -678,25 +661,24 @@ int acpi_pci_link_free_irq(acpi_handle handle)
        struct acpi_pci_link *link = NULL;
        acpi_status result;
 
-       ACPI_FUNCTION_TRACE("acpi_pci_link_free_irq");
 
        result = acpi_bus_get_device(handle, &device);
        if (result) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link device\n"));
-               return_VALUE(-1);
+               printk(KERN_ERR PREFIX "Invalid link device\n");
+               return -1;
        }
 
        link = (struct acpi_pci_link *)acpi_driver_data(device);
        if (!link) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link context\n"));
-               return_VALUE(-1);
+               printk(KERN_ERR PREFIX "Invalid link context\n");
+               return -1;
        }
 
        mutex_lock(&acpi_link_lock);
        if (!link->irq.initialized) {
                mutex_unlock(&acpi_link_lock);
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link isn't initialized\n"));
-               return_VALUE(-1);
+               printk(KERN_ERR PREFIX "Link isn't initialized\n");
+               return -1;
        }
 #ifdef FUTURE_USE
        /*
@@ -715,10 +697,10 @@ int acpi_pci_link_free_irq(acpi_handle handle)
                          acpi_device_bid(link->device)));
 
        if (link->refcnt == 0) {
-               acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL);
+               acpi_ut_evaluate_object(link->device->handle, "_DIS", 0, NULL);
        }
        mutex_unlock(&acpi_link_lock);
-       return_VALUE(link->irq.active);
+       return (link->irq.active);
 }
 
 /* --------------------------------------------------------------------------
@@ -732,18 +714,16 @@ static int acpi_pci_link_add(struct acpi_device *device)
        int i = 0;
        int found = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_pci_link_add");
 
        if (!device)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        link = kmalloc(sizeof(struct acpi_pci_link), GFP_KERNEL);
        if (!link)
-               return_VALUE(-ENOMEM);
+               return -ENOMEM;
        memset(link, 0, sizeof(struct acpi_pci_link));
 
        link->device = device;
-       link->handle = device->handle;
        strcpy(acpi_device_name(device), ACPI_PCI_LINK_DEVICE_NAME);
        strcpy(acpi_device_class(device), ACPI_PCI_LINK_CLASS);
        acpi_driver_data(device) = link;
@@ -782,23 +762,22 @@ static int acpi_pci_link_add(struct acpi_device *device)
 
       end:
        /* disable all links -- to be activated on use */
-       acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL);
+       acpi_ut_evaluate_object(device->handle, "_DIS", 0, NULL);
        mutex_unlock(&acpi_link_lock);
 
        if (result)
                kfree(link);
 
-       return_VALUE(result);
+       return result;
 }
 
 static int acpi_pci_link_resume(struct acpi_pci_link *link)
 {
-       ACPI_FUNCTION_TRACE("acpi_pci_link_resume");
 
        if (link->refcnt && link->irq.active && link->irq.initialized)
-               return_VALUE(acpi_pci_link_set(link, link->irq.active));
+               return (acpi_pci_link_set(link, link->irq.active));
        else
-               return_VALUE(0);
+               return 0;
 }
 
 /*
@@ -811,7 +790,6 @@ static int irqrouter_resume(struct sys_device *dev)
        struct list_head *node = NULL;
        struct acpi_pci_link *link = NULL;
 
-       ACPI_FUNCTION_TRACE("irqrouter_resume");
 
        /* Make sure SCI is enabled again (Apple firmware bug?) */
        acpi_set_register(ACPI_BITREG_SCI_ENABLE, 1, ACPI_MTX_DO_NOT_LOCK);
@@ -820,24 +798,22 @@ static int irqrouter_resume(struct sys_device *dev)
        list_for_each(node, &acpi_link.entries) {
                link = list_entry(node, struct acpi_pci_link, node);
                if (!link) {
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                         "Invalid link context\n"));
+                       printk(KERN_ERR PREFIX "Invalid link context\n");
                        continue;
                }
                acpi_pci_link_resume(link);
        }
        acpi_in_resume = 0;
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_pci_link_remove(struct acpi_device *device, int type)
 {
        struct acpi_pci_link *link = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_pci_link_remove");
 
        if (!device || !acpi_driver_data(device))
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        link = (struct acpi_pci_link *)acpi_driver_data(device);
 
@@ -847,7 +823,7 @@ static int acpi_pci_link_remove(struct acpi_device *device, int type)
 
        kfree(link);
 
-       return_VALUE(0);
+       return 0;
 }
 
 /*
@@ -953,34 +929,32 @@ static int __init irqrouter_init_sysfs(void)
 {
        int error;
 
-       ACPI_FUNCTION_TRACE("irqrouter_init_sysfs");
 
        if (acpi_disabled || acpi_noirq)
-               return_VALUE(0);
+               return 0;
 
        error = sysdev_class_register(&irqrouter_sysdev_class);
        if (!error)
                error = sysdev_register(&device_irqrouter);
 
-       return_VALUE(error);
+       return error;
 }
 
 device_initcall(irqrouter_init_sysfs);
 
 static int __init acpi_pci_link_init(void)
 {
-       ACPI_FUNCTION_TRACE("acpi_pci_link_init");
 
        if (acpi_noirq)
-               return_VALUE(0);
+               return 0;
 
        acpi_link.count = 0;
        INIT_LIST_HEAD(&acpi_link.entries);
 
        if (acpi_bus_register_driver(&acpi_pci_link_driver) < 0)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
-       return_VALUE(0);
+       return 0;
 }
 
 subsys_initcall(acpi_pci_link_init);
index 4c313eab6313d94ff6e345555fa1eb53e24bedd0..0984a1ee24edceecbd9593b8da72b139f1fc4201 100644 (file)
@@ -58,7 +58,7 @@ static struct acpi_driver acpi_pci_root_driver = {
 
 struct acpi_pci_root {
        struct list_head node;
-       acpi_handle handle;
+       struct acpi_device * device;
        struct acpi_pci_id id;
        struct pci_bus *bus;
 };
@@ -83,7 +83,7 @@ int acpi_pci_register_driver(struct acpi_pci_driver *driver)
        list_for_each(entry, &acpi_pci_roots) {
                struct acpi_pci_root *root;
                root = list_entry(entry, struct acpi_pci_root, node);
-               driver->add(root->handle);
+               driver->add(root->device->handle);
                n++;
        }
 
@@ -110,7 +110,7 @@ void acpi_pci_unregister_driver(struct acpi_pci_driver *driver)
        list_for_each(entry, &acpi_pci_roots) {
                struct acpi_pci_root *root;
                root = list_entry(entry, struct acpi_pci_root, node);
-               driver->remove(root->handle);
+               driver->remove(root->device->handle);
        }
 }
 
@@ -160,18 +160,17 @@ static int acpi_pci_root_add(struct acpi_device *device)
        unsigned long value = 0;
        acpi_handle handle = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_pci_root_add");
 
        if (!device)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        root = kmalloc(sizeof(struct acpi_pci_root), GFP_KERNEL);
        if (!root)
-               return_VALUE(-ENOMEM);
+               return -ENOMEM;
        memset(root, 0, sizeof(struct acpi_pci_root));
        INIT_LIST_HEAD(&root->node);
 
-       root->handle = device->handle;
+       root->device = device;
        strcpy(acpi_device_name(device), ACPI_PCI_ROOT_DEVICE_NAME);
        strcpy(acpi_device_class(device), ACPI_PCI_ROOT_CLASS);
        acpi_driver_data(device) = root;
@@ -186,7 +185,7 @@ static int acpi_pci_root_add(struct acpi_device *device)
         * -------
         * Obtained via _SEG, if exists, otherwise assumed to be zero (0).
         */
-       status = acpi_evaluate_integer(root->handle, METHOD_NAME__SEG, NULL,
+       status = acpi_evaluate_integer(device->handle, METHOD_NAME__SEG, NULL,
                                       &value);
        switch (status) {
        case AE_OK:
@@ -198,7 +197,7 @@ static int acpi_pci_root_add(struct acpi_device *device)
                root->id.segment = 0;
                break;
        default:
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _SEG\n"));
+               ACPI_EXCEPTION((AE_INFO, status, "Evaluating _SEG"));
                result = -ENODEV;
                goto end;
        }
@@ -208,7 +207,7 @@ static int acpi_pci_root_add(struct acpi_device *device)
         * ---
         * Obtained via _BBN, if exists, otherwise assumed to be zero (0).
         */
-       status = acpi_evaluate_integer(root->handle, METHOD_NAME__BBN, NULL,
+       status = acpi_evaluate_integer(device->handle, METHOD_NAME__BBN, NULL,
                                       &value);
        switch (status) {
        case AE_OK:
@@ -219,7 +218,7 @@ static int acpi_pci_root_add(struct acpi_device *device)
                root->id.bus = 0;
                break;
        default:
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _BBN\n"));
+               ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BBN"));
                result = -ENODEV;
                goto end;
        }
@@ -231,10 +230,11 @@ static int acpi_pci_root_add(struct acpi_device *device)
                        int bus = 0;
                        acpi_status status;
 
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                         "Wrong _BBN value, please reboot and using option 'pci=noacpi'\n"));
+                       printk(KERN_ERR PREFIX
+                                   "Wrong _BBN value, reboot"
+                                   " and use option 'pci=noacpi'\n");
 
-                       status = try_get_root_bridge_busnr(root->handle, &bus);
+                       status = try_get_root_bridge_busnr(device->handle, &bus);
                        if (ACPI_FAILURE(status))
                                break;
                        if (bus != root->id.bus) {
@@ -273,9 +273,9 @@ static int acpi_pci_root_add(struct acpi_device *device)
         */
        root->bus = pci_acpi_scan_root(device, root->id.segment, root->id.bus);
        if (!root->bus) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Bus %04x:%02x not present in PCI namespace\n",
-                                 root->id.segment, root->id.bus));
+               printk(KERN_ERR PREFIX
+                           "Bus %04x:%02x not present in PCI namespace\n",
+                           root->id.segment, root->id.bus);
                result = -ENODEV;
                goto end;
        }
@@ -294,9 +294,9 @@ static int acpi_pci_root_add(struct acpi_device *device)
         * -----------------
         * Evaluate and parse _PRT, if exists.
         */
-       status = acpi_get_handle(root->handle, METHOD_NAME__PRT, &handle);
+       status = acpi_get_handle(device->handle, METHOD_NAME__PRT, &handle);
        if (ACPI_SUCCESS(status))
-               result = acpi_pci_irq_add_prt(root->handle, root->id.segment,
+               result = acpi_pci_irq_add_prt(device->handle, root->id.segment,
                                              root->id.bus);
 
       end:
@@ -306,46 +306,43 @@ static int acpi_pci_root_add(struct acpi_device *device)
                kfree(root);
        }
 
-       return_VALUE(result);
+       return result;
 }
 
 static int acpi_pci_root_start(struct acpi_device *device)
 {
        struct acpi_pci_root *root;
 
-       ACPI_FUNCTION_TRACE("acpi_pci_root_start");
 
        list_for_each_entry(root, &acpi_pci_roots, node) {
-               if (root->handle == device->handle) {
+               if (root->device == device) {
                        pci_bus_add_devices(root->bus);
-                       return_VALUE(0);
+                       return 0;
                }
        }
-       return_VALUE(-ENODEV);
+       return -ENODEV;
 }
 
 static int acpi_pci_root_remove(struct acpi_device *device, int type)
 {
        struct acpi_pci_root *root = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_pci_root_remove");
 
        if (!device || !acpi_driver_data(device))
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        root = (struct acpi_pci_root *)acpi_driver_data(device);
 
        kfree(root);
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int __init acpi_pci_root_init(void)
 {
-       ACPI_FUNCTION_TRACE("acpi_pci_root_init");
 
        if (acpi_pci_disabled)
-               return_VALUE(0);
+               return 0;
 
        /* DEBUG:
           acpi_dbg_layer = ACPI_PCI_COMPONENT;
@@ -353,9 +350,9 @@ static int __init acpi_pci_root_init(void)
         */
 
        if (acpi_bus_register_driver(&acpi_pci_root_driver) < 0)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
-       return_VALUE(0);
+       return 0;
 }
 
 subsys_initcall(acpi_pci_root_init);
index 62a5595ed8bc7551e7951b12dabb283662633b7f..5d3447f4582ce797b2439b5a347e1ede7041066c 100644 (file)
@@ -70,7 +70,7 @@ static struct acpi_driver acpi_power_driver = {
 };
 
 struct acpi_power_resource {
-       acpi_handle handle;
+       struct acpi_device * device;
        acpi_bus_id name;
        u32 system_level;
        u32 order;
@@ -98,23 +98,21 @@ acpi_power_get_context(acpi_handle handle,
        int result = 0;
        struct acpi_device *device = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_power_get_context");
 
        if (!resource)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        result = acpi_bus_get_device(handle, &device);
        if (result) {
-               ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Error getting context [%p]\n",
-                                 handle));
-               return_VALUE(result);
+               printk(KERN_WARNING PREFIX "Getting context [%p]\n", handle);
+               return result;
        }
 
        *resource = (struct acpi_power_resource *)acpi_driver_data(device);
        if (!resource)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_power_get_state(struct acpi_power_resource *resource)
@@ -122,14 +120,13 @@ static int acpi_power_get_state(struct acpi_power_resource *resource)
        acpi_status status = AE_OK;
        unsigned long sta = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_power_get_state");
 
        if (!resource)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
-       status = acpi_evaluate_integer(resource->handle, "_STA", NULL, &sta);
+       status = acpi_evaluate_integer(resource->device->handle, "_STA", NULL, &sta);
        if (ACPI_FAILURE(status))
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        if (sta & 0x01)
                resource->state = ACPI_POWER_RESOURCE_STATE_ON;
@@ -139,7 +136,7 @@ static int acpi_power_get_state(struct acpi_power_resource *resource)
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] is %s\n",
                          resource->name, resource->state ? "on" : "off"));
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_power_get_list_state(struct acpi_handle_list *list, int *state)
@@ -148,20 +145,19 @@ static int acpi_power_get_list_state(struct acpi_handle_list *list, int *state)
        struct acpi_power_resource *resource = NULL;
        u32 i = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_power_get_list_state");
 
        if (!list || !state)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        /* The state of the list is 'on' IFF all resources are 'on'. */
 
        for (i = 0; i < list->count; i++) {
                result = acpi_power_get_context(list->handles[i], &resource);
                if (result)
-                       return_VALUE(result);
+                       return result;
                result = acpi_power_get_state(resource);
                if (result)
-                       return_VALUE(result);
+                       return result;
 
                *state = resource->state;
 
@@ -172,7 +168,7 @@ static int acpi_power_get_list_state(struct acpi_handle_list *list, int *state)
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource list is %s\n",
                          *state ? "on" : "off"));
 
-       return_VALUE(result);
+       return result;
 }
 
 static int acpi_power_on(acpi_handle handle)
@@ -182,11 +178,10 @@ static int acpi_power_on(acpi_handle handle)
        struct acpi_device *device = NULL;
        struct acpi_power_resource *resource = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_power_on");
 
        result = acpi_power_get_context(handle, &resource);
        if (result)
-               return_VALUE(result);
+               return result;
 
        resource->references++;
 
@@ -194,29 +189,27 @@ static int acpi_power_on(acpi_handle handle)
            || (resource->state == ACPI_POWER_RESOURCE_STATE_ON)) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] already on\n",
                                  resource->name));
-               return_VALUE(0);
+               return 0;
        }
 
-       status = acpi_evaluate_object(resource->handle, "_ON", NULL, NULL);
+       status = acpi_evaluate_object(resource->device->handle, "_ON", NULL, NULL);
        if (ACPI_FAILURE(status))
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        result = acpi_power_get_state(resource);
        if (result)
-               return_VALUE(result);
+               return result;
        if (resource->state != ACPI_POWER_RESOURCE_STATE_ON)
-               return_VALUE(-ENOEXEC);
+               return -ENOEXEC;
 
        /* Update the power resource's _device_ power state */
-       result = acpi_bus_get_device(resource->handle, &device);
-       if (result)
-               return_VALUE(result);
-       device->power.state = ACPI_STATE_D0;
+       device = resource->device;
+       resource->device->power.state = ACPI_STATE_D0;
 
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] turned on\n",
                          resource->name));
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_power_off_device(acpi_handle handle)
@@ -226,11 +219,10 @@ static int acpi_power_off_device(acpi_handle handle)
        struct acpi_device *device = NULL;
        struct acpi_power_resource *resource = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_power_off_device");
 
        result = acpi_power_get_context(handle, &resource);
        if (result)
-               return_VALUE(result);
+               return result;
 
        if (resource->references)
                resource->references--;
@@ -239,35 +231,33 @@ static int acpi_power_off_device(acpi_handle handle)
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                  "Resource [%s] is still in use, dereferencing\n",
                                  device->pnp.bus_id));
-               return_VALUE(0);
+               return 0;
        }
 
        if (resource->state == ACPI_POWER_RESOURCE_STATE_OFF) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] already off\n",
                                  device->pnp.bus_id));
-               return_VALUE(0);
+               return 0;
        }
 
-       status = acpi_evaluate_object(resource->handle, "_OFF", NULL, NULL);
+       status = acpi_evaluate_object(resource->device->handle, "_OFF", NULL, NULL);
        if (ACPI_FAILURE(status))
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        result = acpi_power_get_state(resource);
        if (result)
-               return_VALUE(result);
+               return result;
        if (resource->state != ACPI_POWER_RESOURCE_STATE_OFF)
-               return_VALUE(-ENOEXEC);
+               return -ENOEXEC;
 
        /* Update the power resource's _device_ power state */
-       result = acpi_bus_get_device(resource->handle, &device);
-       if (result)
-               return_VALUE(result);
+       device = resource->device;
        device->power.state = ACPI_STATE_D3;
 
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] turned off\n",
                          resource->name));
 
-       return_VALUE(0);
+       return 0;
 }
 
 /*
@@ -283,31 +273,29 @@ int acpi_enable_wakeup_device_power(struct acpi_device *dev)
        int i;
        int ret = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_enable_wakeup_device_power");
        if (!dev || !dev->wakeup.flags.valid)
-               return_VALUE(-1);
+               return -1;
 
        arg.integer.value = 1;
        /* Open power resource */
        for (i = 0; i < dev->wakeup.resources.count; i++) {
                ret = acpi_power_on(dev->wakeup.resources.handles[i]);
                if (ret) {
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                         "Error transition power state\n"));
+                       printk(KERN_ERR PREFIX "Transition power state\n");
                        dev->wakeup.flags.valid = 0;
-                       return_VALUE(-1);
+                       return -1;
                }
        }
 
        /* Execute PSW */
        status = acpi_evaluate_object(dev->handle, "_PSW", &arg_list, NULL);
        if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluate _PSW\n"));
+               printk(KERN_ERR PREFIX "Evaluate _PSW\n");
                dev->wakeup.flags.valid = 0;
                ret = -1;
        }
 
-       return_VALUE(ret);
+       return ret;
 }
 
 /*
@@ -323,32 +311,30 @@ int acpi_disable_wakeup_device_power(struct acpi_device *dev)
        int i;
        int ret = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_disable_wakeup_device_power");
 
        if (!dev || !dev->wakeup.flags.valid)
-               return_VALUE(-1);
+               return -1;
 
        arg.integer.value = 0;
        /* Execute PSW */
        status = acpi_evaluate_object(dev->handle, "_PSW", &arg_list, NULL);
        if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluate _PSW\n"));
+               printk(KERN_ERR PREFIX "Evaluate _PSW\n");
                dev->wakeup.flags.valid = 0;
-               return_VALUE(-1);
+               return -1;
        }
 
        /* Close power resource */
        for (i = 0; i < dev->wakeup.resources.count; i++) {
                ret = acpi_power_off_device(dev->wakeup.resources.handles[i]);
                if (ret) {
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                         "Error transition power state\n"));
+                       printk(KERN_ERR PREFIX "Transition power state\n");
                        dev->wakeup.flags.valid = 0;
-                       return_VALUE(-1);
+                       return -1;
                }
        }
 
-       return_VALUE(ret);
+       return ret;
 }
 
 /* --------------------------------------------------------------------------
@@ -362,10 +348,9 @@ int acpi_power_get_inferred_state(struct acpi_device *device)
        int list_state = 0;
        int i = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_power_get_inferred_state");
 
        if (!device)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        device->power.state = ACPI_STATE_UNKNOWN;
 
@@ -380,17 +365,17 @@ int acpi_power_get_inferred_state(struct acpi_device *device)
 
                result = acpi_power_get_list_state(list, &list_state);
                if (result)
-                       return_VALUE(result);
+                       return result;
 
                if (list_state == ACPI_POWER_RESOURCE_STATE_ON) {
                        device->power.state = i;
-                       return_VALUE(0);
+                       return 0;
                }
        }
 
        device->power.state = ACPI_STATE_D3;
 
-       return_VALUE(0);
+       return 0;
 }
 
 int acpi_power_transition(struct acpi_device *device, int state)
@@ -400,14 +385,13 @@ int acpi_power_transition(struct acpi_device *device, int state)
        struct acpi_handle_list *tl = NULL;     /* Target Resources */
        int i = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_power_transition");
 
        if (!device || (state < ACPI_STATE_D0) || (state > ACPI_STATE_D3))
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if ((device->power.state < ACPI_STATE_D0)
            || (device->power.state > ACPI_STATE_D3))
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        cl = &device->power.states[device->power.state].resources;
        tl = &device->power.states[state].resources;
@@ -444,11 +428,10 @@ int acpi_power_transition(struct acpi_device *device, int state)
        device->power.state = state;
       end:
        if (result)
-               ACPI_DEBUG_PRINT((ACPI_DB_WARN,
-                                 "Error transitioning device [%s] to D%d\n",
-                                 device->pnp.bus_id, state));
+               printk(KERN_WARNING PREFIX "Transitioning device [%s] to D%d\n",
+                             device->pnp.bus_id, state);
 
-       return_VALUE(result);
+       return result;
 }
 
 /* --------------------------------------------------------------------------
@@ -461,7 +444,6 @@ static int acpi_power_seq_show(struct seq_file *seq, void *offset)
 {
        struct acpi_power_resource *resource = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_power_seq_show");
 
        resource = (struct acpi_power_resource *)seq->private;
 
@@ -488,7 +470,7 @@ static int acpi_power_seq_show(struct seq_file *seq, void *offset)
                   resource->order, resource->references);
 
       end:
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_power_open_fs(struct inode *inode, struct file *file)
@@ -500,36 +482,32 @@ static int acpi_power_add_fs(struct acpi_device *device)
 {
        struct proc_dir_entry *entry = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_power_add_fs");
 
        if (!device)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (!acpi_device_dir(device)) {
                acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
                                                     acpi_power_dir);
                if (!acpi_device_dir(device))
-                       return_VALUE(-ENODEV);
+                       return -ENODEV;
        }
 
        /* 'status' [R] */
        entry = create_proc_entry(ACPI_POWER_FILE_STATUS,
                                  S_IRUGO, acpi_device_dir(device));
        if (!entry)
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to create '%s' fs entry\n",
-                                 ACPI_POWER_FILE_STATUS));
+               return -EIO;
        else {
                entry->proc_fops = &acpi_power_fops;
                entry->data = acpi_driver_data(device);
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_power_remove_fs(struct acpi_device *device)
 {
-       ACPI_FUNCTION_TRACE("acpi_power_remove_fs");
 
        if (acpi_device_dir(device)) {
                remove_proc_entry(ACPI_POWER_FILE_STATUS,
@@ -538,7 +516,7 @@ static int acpi_power_remove_fs(struct acpi_device *device)
                acpi_device_dir(device) = NULL;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 /* --------------------------------------------------------------------------
@@ -553,24 +531,23 @@ static int acpi_power_add(struct acpi_device *device)
        union acpi_object acpi_object;
        struct acpi_buffer buffer = { sizeof(acpi_object), &acpi_object };
 
-       ACPI_FUNCTION_TRACE("acpi_power_add");
 
        if (!device)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        resource = kmalloc(sizeof(struct acpi_power_resource), GFP_KERNEL);
        if (!resource)
-               return_VALUE(-ENOMEM);
+               return -ENOMEM;
        memset(resource, 0, sizeof(struct acpi_power_resource));
 
-       resource->handle = device->handle;
+       resource->device = device;
        strcpy(resource->name, device->pnp.bus_id);
        strcpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME);
        strcpy(acpi_device_class(device), ACPI_POWER_CLASS);
        acpi_driver_data(device) = resource;
 
        /* Evalute the object to get the system level and resource order. */
-       status = acpi_evaluate_object(resource->handle, NULL, NULL, &buffer);
+       status = acpi_evaluate_object(device->handle, NULL, NULL, &buffer);
        if (ACPI_FAILURE(status)) {
                result = -ENODEV;
                goto end;
@@ -605,17 +582,16 @@ static int acpi_power_add(struct acpi_device *device)
        if (result)
                kfree(resource);
 
-       return_VALUE(result);
+       return result;
 }
 
 static int acpi_power_remove(struct acpi_device *device, int type)
 {
        struct acpi_power_resource *resource = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_power_remove");
 
        if (!device || !acpi_driver_data(device))
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        resource = (struct acpi_power_resource *)acpi_driver_data(device);
 
@@ -623,31 +599,30 @@ static int acpi_power_remove(struct acpi_device *device, int type)
 
        kfree(resource);
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int __init acpi_power_init(void)
 {
        int result = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_power_init");
 
        if (acpi_disabled)
-               return_VALUE(0);
+               return 0;
 
        INIT_LIST_HEAD(&acpi_power_resource_list);
 
        acpi_power_dir = proc_mkdir(ACPI_POWER_CLASS, acpi_root_dir);
        if (!acpi_power_dir)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        result = acpi_bus_register_driver(&acpi_power_driver);
        if (result < 0) {
                remove_proc_entry(ACPI_POWER_CLASS, acpi_root_dir);
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 subsys_initcall(acpi_power_init);
index decaebb4cbe90649e8943bc848fb45105cc43c76..52674323b14da5724bfdc4ffee830609f116d248 100644 (file)
@@ -122,10 +122,9 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev)
        u8 value1 = 0;
        u8 value2 = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_errata_piix4");
 
        if (!dev)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        /*
         * Note that 'dev' references the PIIX4 ACPI Controller.
@@ -218,7 +217,7 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev)
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                  "Type-F DMA livelock erratum (C3 disabled)\n"));
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_processor_errata(struct acpi_processor *pr)
@@ -226,10 +225,9 @@ static int acpi_processor_errata(struct acpi_processor *pr)
        int result = 0;
        struct pci_dev *dev = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_errata");
 
        if (!pr)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        /*
         * PIIX4
@@ -242,7 +240,7 @@ static int acpi_processor_errata(struct acpi_processor *pr)
                pci_dev_put(dev);
        }
 
-       return_VALUE(result);
+       return result;
 }
 
 /* --------------------------------------------------------------------------
@@ -258,10 +256,9 @@ static int acpi_processor_set_pdc(struct acpi_processor *pr)
        struct acpi_object_list *pdc_in = pr->pdc;
        acpi_status status = AE_OK;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_set_pdc");
 
        if (!pdc_in)
-               return_VALUE(status);
+               return status;
 
        status = acpi_evaluate_object(pr->handle, "_PDC", pdc_in, NULL);
 
@@ -269,7 +266,7 @@ static int acpi_processor_set_pdc(struct acpi_processor *pr)
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                    "Could not evaluate _PDC, using legacy perf. control...\n"));
 
-       return_VALUE(status);
+       return status;
 }
 
 /* --------------------------------------------------------------------------
@@ -282,7 +279,6 @@ static int acpi_processor_info_seq_show(struct seq_file *seq, void *offset)
 {
        struct acpi_processor *pr = (struct acpi_processor *)seq->private;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_info_seq_show");
 
        if (!pr)
                goto end;
@@ -301,7 +297,7 @@ static int acpi_processor_info_seq_show(struct seq_file *seq, void *offset)
                   pr->flags.limit ? "yes" : "no");
 
       end:
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_processor_info_open_fs(struct inode *inode, struct file *file)
@@ -314,13 +310,12 @@ static int acpi_processor_add_fs(struct acpi_device *device)
 {
        struct proc_dir_entry *entry = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_add_fs");
 
        if (!acpi_device_dir(device)) {
                acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
                                                     acpi_processor_dir);
                if (!acpi_device_dir(device))
-                       return_VALUE(-ENODEV);
+                       return -ENODEV;
        }
        acpi_device_dir(device)->owner = THIS_MODULE;
 
@@ -328,9 +323,7 @@ static int acpi_processor_add_fs(struct acpi_device *device)
        entry = create_proc_entry(ACPI_PROCESSOR_FILE_INFO,
                                  S_IRUGO, acpi_device_dir(device));
        if (!entry)
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to create '%s' fs entry\n",
-                                 ACPI_PROCESSOR_FILE_INFO));
+               return -EIO;
        else {
                entry->proc_fops = &acpi_processor_info_fops;
                entry->data = acpi_driver_data(device);
@@ -342,9 +335,7 @@ static int acpi_processor_add_fs(struct acpi_device *device)
                                  S_IFREG | S_IRUGO | S_IWUSR,
                                  acpi_device_dir(device));
        if (!entry)
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to create '%s' fs entry\n",
-                                 ACPI_PROCESSOR_FILE_THROTTLING));
+               return -EIO;
        else {
                entry->proc_fops = &acpi_processor_throttling_fops;
                entry->data = acpi_driver_data(device);
@@ -356,21 +347,18 @@ static int acpi_processor_add_fs(struct acpi_device *device)
                                  S_IFREG | S_IRUGO | S_IWUSR,
                                  acpi_device_dir(device));
        if (!entry)
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to create '%s' fs entry\n",
-                                 ACPI_PROCESSOR_FILE_LIMIT));
+               return -EIO;
        else {
                entry->proc_fops = &acpi_processor_limit_fops;
                entry->data = acpi_driver_data(device);
                entry->owner = THIS_MODULE;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_processor_remove_fs(struct acpi_device *device)
 {
-       ACPI_FUNCTION_TRACE("acpi_processor_remove_fs");
 
        if (acpi_device_dir(device)) {
                remove_proc_entry(ACPI_PROCESSOR_FILE_INFO,
@@ -383,7 +371,7 @@ static int acpi_processor_remove_fs(struct acpi_device *device)
                acpi_device_dir(device) = NULL;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 /* Use the acpiid in MADT to map cpus in case of SMP */
@@ -430,10 +418,9 @@ static int acpi_processor_get_info(struct acpi_processor *pr)
        int cpu_index;
        static int cpu0_initialized;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_get_info");
 
        if (!pr)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (num_online_cpus() > 1)
                errata.smp = TRUE;
@@ -459,9 +446,8 @@ static int acpi_processor_get_info(struct acpi_processor *pr)
         */
        status = acpi_evaluate_object(pr->handle, NULL, NULL, &buffer);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Error evaluating processor object\n"));
-               return_VALUE(-ENODEV);
+               printk(KERN_ERR PREFIX "Evaluating processor object\n");
+               return -ENODEV;
        }
 
        /*
@@ -490,10 +476,10 @@ static int acpi_processor_get_info(struct acpi_processor *pr)
        if (cpu_index == -1) {
                if (ACPI_FAILURE
                    (acpi_processor_hotadd_init(pr->handle, &pr->id))) {
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                         "Error getting cpuindex for acpiid 0x%x\n",
-                                         pr->acpi_id));
-                       return_VALUE(-ENODEV);
+                       printk(KERN_ERR PREFIX
+                                   "Getting cpuindex for acpiid 0x%x\n",
+                                   pr->acpi_id);
+                       return -ENODEV;
                }
        }
 
@@ -503,8 +489,8 @@ static int acpi_processor_get_info(struct acpi_processor *pr)
        if (!object.processor.pblk_address)
                ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No PBLK (NULL address)\n"));
        else if (object.processor.pblk_length != 6)
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid PBLK length [%d]\n",
-                                 object.processor.pblk_length));
+               printk(KERN_ERR PREFIX "Invalid PBLK length [%d]\n",
+                           object.processor.pblk_length);
        else {
                pr->throttling.address = object.processor.pblk_address;
                pr->throttling.duty_offset = acpi_fadt.duty_offset;
@@ -528,7 +514,7 @@ static int acpi_processor_get_info(struct acpi_processor *pr)
        acpi_processor_get_throttling_info(pr);
        acpi_processor_get_limit_info(pr);
 
-       return_VALUE(0);
+       return 0;
 }
 
 static void *processor_device_array[NR_CPUS];
@@ -539,14 +525,13 @@ static int acpi_processor_start(struct acpi_device *device)
        acpi_status status = AE_OK;
        struct acpi_processor *pr;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_start");
 
        pr = acpi_driver_data(device);
 
        result = acpi_processor_get_info(pr);
        if (result) {
                /* Processor is physically not present */
-               return_VALUE(0);
+               return 0;
        }
 
        BUG_ON((pr->id >= NR_CPUS) || (pr->id < 0));
@@ -560,7 +545,7 @@ static int acpi_processor_start(struct acpi_device *device)
            processor_device_array[pr->id] != (void *)device) {
                printk(KERN_WARNING "BIOS reported wrong ACPI id"
                        "for the processor\n");
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        }
        processor_device_array[pr->id] = (void *)device;
 
@@ -572,10 +557,6 @@ static int acpi_processor_start(struct acpi_device *device)
 
        status = acpi_install_notify_handler(pr->handle, ACPI_DEVICE_NOTIFY,
                                             acpi_processor_notify, pr);
-       if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Error installing device notify handler\n"));
-       }
 
        /* _PDC call should be done before doing anything else (if reqd.). */
        arch_acpi_processor_init_pdc(pr);
@@ -592,7 +573,7 @@ static int acpi_processor_start(struct acpi_device *device)
 
       end:
 
-       return_VALUE(result);
+       return result;
 }
 
 static void acpi_processor_notify(acpi_handle handle, u32 event, void *data)
@@ -600,13 +581,12 @@ static void acpi_processor_notify(acpi_handle handle, u32 event, void *data)
        struct acpi_processor *pr = (struct acpi_processor *)data;
        struct acpi_device *device = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_notify");
 
        if (!pr)
-               return_VOID;
+               return;
 
        if (acpi_bus_get_device(pr->handle, &device))
-               return_VOID;
+               return;
 
        switch (event) {
        case ACPI_PROCESSOR_NOTIFY_PERFORMANCE:
@@ -624,21 +604,20 @@ static void acpi_processor_notify(acpi_handle handle, u32 event, void *data)
                break;
        }
 
-       return_VOID;
+       return;
 }
 
 static int acpi_processor_add(struct acpi_device *device)
 {
        struct acpi_processor *pr = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_add");
 
        if (!device)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        pr = kmalloc(sizeof(struct acpi_processor), GFP_KERNEL);
        if (!pr)
-               return_VALUE(-ENOMEM);
+               return -ENOMEM;
        memset(pr, 0, sizeof(struct acpi_processor));
 
        pr->handle = device->handle;
@@ -646,7 +625,7 @@ static int acpi_processor_add(struct acpi_device *device)
        strcpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS);
        acpi_driver_data(device) = pr;
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_processor_remove(struct acpi_device *device, int type)
@@ -654,31 +633,26 @@ static int acpi_processor_remove(struct acpi_device *device, int type)
        acpi_status status = AE_OK;
        struct acpi_processor *pr = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_remove");
 
        if (!device || !acpi_driver_data(device))
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        pr = (struct acpi_processor *)acpi_driver_data(device);
 
        if (pr->id >= NR_CPUS) {
                kfree(pr);
-               return_VALUE(0);
+               return 0;
        }
 
        if (type == ACPI_BUS_REMOVAL_EJECT) {
                if (acpi_processor_handle_eject(pr))
-                       return_VALUE(-EINVAL);
+                       return -EINVAL;
        }
 
        acpi_processor_power_exit(pr, device);
 
        status = acpi_remove_notify_handler(pr->handle, ACPI_DEVICE_NOTIFY,
                                            acpi_processor_notify);
-       if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Error removing notify handler\n"));
-       }
 
        acpi_processor_remove_fs(device);
 
@@ -686,7 +660,7 @@ static int acpi_processor_remove(struct acpi_device *device, int type)
 
        kfree(pr);
 
-       return_VALUE(0);
+       return 0;
 }
 
 #ifdef CONFIG_ACPI_HOTPLUG_CPU
@@ -701,15 +675,13 @@ static int is_processor_present(acpi_handle handle)
        acpi_status status;
        unsigned long sta = 0;
 
-       ACPI_FUNCTION_TRACE("is_processor_present");
 
        status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
        if (ACPI_FAILURE(status) || !(sta & ACPI_STA_PRESENT)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Processor Device is not present\n"));
-               return_VALUE(0);
+               ACPI_EXCEPTION((AE_INFO, status, "Processor Device is not present"));
+               return 0;
        }
-       return_VALUE(1);
+       return 1;
 }
 
 static
@@ -719,30 +691,29 @@ int acpi_processor_device_add(acpi_handle handle, struct acpi_device **device)
        struct acpi_device *pdev;
        struct acpi_processor *pr;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_device_add");
 
        if (acpi_get_parent(handle, &phandle)) {
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        }
 
        if (acpi_bus_get_device(phandle, &pdev)) {
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        }
 
        if (acpi_bus_add(device, pdev, handle, ACPI_BUS_TYPE_PROCESSOR)) {
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        }
 
        acpi_bus_start(*device);
 
        pr = acpi_driver_data(*device);
        if (!pr)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        if ((pr->id >= 0) && (pr->id < NR_CPUS)) {
                kobject_uevent(&(*device)->kobj, KOBJ_ONLINE);
        }
-       return_VALUE(0);
+       return 0;
 }
 
 static void
@@ -752,7 +723,6 @@ acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data)
        struct acpi_device *device = NULL;
        int result;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_hotplug_notify");
 
        switch (event) {
        case ACPI_NOTIFY_BUS_CHECK:
@@ -767,15 +737,14 @@ acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data)
                if (acpi_bus_get_device(handle, &device)) {
                        result = acpi_processor_device_add(handle, &device);
                        if (result)
-                               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                                 "Unable to add the device\n"));
+                               printk(KERN_ERR PREFIX
+                                           "Unable to add the device\n");
                        break;
                }
 
                pr = acpi_driver_data(device);
                if (!pr) {
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                         "Driver data is NULL\n"));
+                       printk(KERN_ERR PREFIX "Driver data is NULL\n");
                        break;
                }
 
@@ -788,9 +757,8 @@ acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data)
                if ((!result) && ((pr->id >= 0) && (pr->id < NR_CPUS))) {
                        kobject_uevent(&device->kobj, KOBJ_ONLINE);
                } else {
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                         "Device [%s] failed to start\n",
-                                         acpi_device_bid(device)));
+                       printk(KERN_ERR PREFIX "Device [%s] failed to start\n",
+                                   acpi_device_bid(device));
                }
                break;
        case ACPI_NOTIFY_EJECT_REQUEST:
@@ -798,15 +766,15 @@ acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data)
                                  "received ACPI_NOTIFY_EJECT_REQUEST\n"));
 
                if (acpi_bus_get_device(handle, &device)) {
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                         "Device don't exist, dropping EJECT\n"));
+                       printk(KERN_ERR PREFIX
+                                   "Device don't exist, dropping EJECT\n");
                        break;
                }
                pr = acpi_driver_data(device);
                if (!pr) {
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                         "Driver data is NULL, dropping EJECT\n"));
-                       return_VOID;
+                       printk(KERN_ERR PREFIX
+                                   "Driver data is NULL, dropping EJECT\n");
+                       return;
                }
 
                if ((pr->id < NR_CPUS) && (cpu_present(pr->id)))
@@ -818,7 +786,7 @@ acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data)
                break;
        }
 
-       return_VOID;
+       return;
 }
 
 static acpi_status
@@ -857,21 +825,20 @@ processor_walk_namespace_cb(acpi_handle handle,
 
 static acpi_status acpi_processor_hotadd_init(acpi_handle handle, int *p_cpu)
 {
-       ACPI_FUNCTION_TRACE("acpi_processor_hotadd_init");
 
        if (!is_processor_present(handle)) {
-               return_VALUE(AE_ERROR);
+               return AE_ERROR;
        }
 
        if (acpi_map_lsapic(handle, p_cpu))
-               return_VALUE(AE_ERROR);
+               return AE_ERROR;
 
        if (arch_register_cpu(*p_cpu)) {
                acpi_unmap_lsapic(*p_cpu);
-               return_VALUE(AE_ERROR);
+               return AE_ERROR;
        }
 
-       return_VALUE(AE_OK);
+       return AE_OK;
 }
 
 static int acpi_processor_handle_eject(struct acpi_processor *pr)
@@ -928,20 +895,19 @@ static int __init acpi_processor_init(void)
 {
        int result = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_init");
 
        memset(&processors, 0, sizeof(processors));
        memset(&errata, 0, sizeof(errata));
 
        acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir);
        if (!acpi_processor_dir)
-               return_VALUE(0);
+               return 0;
        acpi_processor_dir->owner = THIS_MODULE;
 
        result = acpi_bus_register_driver(&acpi_processor_driver);
        if (result < 0) {
                remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir);
-               return_VALUE(0);
+               return 0;
        }
 
        acpi_processor_install_hotplug_notify();
@@ -950,12 +916,11 @@ static int __init acpi_processor_init(void)
 
        acpi_processor_ppc_init();
 
-       return_VALUE(0);
+       return 0;
 }
 
 static void __exit acpi_processor_exit(void)
 {
-       ACPI_FUNCTION_TRACE("acpi_processor_exit");
 
        acpi_processor_ppc_exit();
 
@@ -967,7 +932,7 @@ static void __exit acpi_processor_exit(void)
 
        remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir);
 
-       return_VOID;
+       return;
 }
 
 module_init(acpi_processor_init);
index 8a74bf3efd8eec821e3487fcbb835f3121fecf2d..8e9c26aae8fed13b69875c211612c7d2cb01b820 100644 (file)
@@ -3,7 +3,7 @@
  *
  *  Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
  *  Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
- *  Copyright (C) 2004       Dominik Brodowski <linux@brodo.de>
+ *  Copyright (C) 2004, 2005 Dominik Brodowski <linux@brodo.de>
  *  Copyright (C) 2004  Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
  *                     - Added processor hotplug support
  *  Copyright (C) 2005  Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
@@ -97,6 +97,9 @@ static int set_max_cstate(struct dmi_system_id *id)
 /* Actually this shouldn't be __cpuinitdata, would be better to fix the
    callers to only run once -AK */
 static struct dmi_system_id __cpuinitdata processor_power_dmi_table[] = {
+       { set_max_cstate, "IBM ThinkPad R40e", {
+         DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
+         DMI_MATCH(DMI_BIOS_VERSION,"1SET70WW")}, (void *)1},
        { set_max_cstate, "IBM ThinkPad R40e", {
          DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
          DMI_MATCH(DMI_BIOS_VERSION,"1SET60WW")}, (void *)1},
@@ -261,21 +264,15 @@ static void acpi_processor_idle(void)
                u32 bm_status = 0;
                unsigned long diff = jiffies - pr->power.bm_check_timestamp;
 
-               if (diff > 32)
-                       diff = 32;
+               if (diff > 31)
+                       diff = 31;
 
-               while (diff) {
-                       /* if we didn't get called, assume there was busmaster activity */
-                       diff--;
-                       if (diff)
-                               pr->power.bm_activity |= 0x1;
-                       pr->power.bm_activity <<= 1;
-               }
+               pr->power.bm_activity <<= diff;
 
                acpi_get_register(ACPI_BITREG_BUS_MASTER_STATUS,
                                  &bm_status, ACPI_MTX_DO_NOT_LOCK);
                if (bm_status) {
-                       pr->power.bm_activity++;
+                       pr->power.bm_activity |= 0x1;
                        acpi_set_register(ACPI_BITREG_BUS_MASTER_STATUS,
                                          1, ACPI_MTX_DO_NOT_LOCK);
                }
@@ -287,16 +284,16 @@ static void acpi_processor_idle(void)
                else if (errata.piix4.bmisx) {
                        if ((inb_p(errata.piix4.bmisx + 0x02) & 0x01)
                            || (inb_p(errata.piix4.bmisx + 0x0A) & 0x01))
-                               pr->power.bm_activity++;
+                               pr->power.bm_activity |= 0x1;
                }
 
                pr->power.bm_check_timestamp = jiffies;
 
                /*
-                * Apply bus mastering demotion policy.  Automatically demote
+                * If bus mastering is or was active this jiffy, demote
                 * to avoid a faulty transition.  Note that the processor
                 * won't enter a low-power state during this call (to this
-                * funciton) but should upon the next.
+                * function) but should upon the next.
                 *
                 * TBD: A better policy might be to fallback to the demotion
                 *      state (use it for this quantum only) istead of
@@ -304,7 +301,8 @@ static void acpi_processor_idle(void)
                 *      qualification.  This may, however, introduce DMA
                 *      issues (e.g. floppy DMA transfer overrun/underrun).
                 */
-               if (pr->power.bm_activity & cx->demotion.threshold.bm) {
+               if ((pr->power.bm_activity & 0x1) &&
+                   cx->demotion.threshold.bm) {
                        local_irq_enable();
                        next_state = cx->demotion.state;
                        goto end;
@@ -322,8 +320,6 @@ static void acpi_processor_idle(void)
                cx = &pr->power.states[ACPI_STATE_C1];
 #endif
 
-       cx->usage++;
-
        /*
         * Sleep:
         * ------
@@ -365,7 +361,9 @@ static void acpi_processor_idle(void)
                t1 = inl(acpi_fadt.xpm_tmr_blk.address);
                /* Invoke C2 */
                inb(cx->address);
-               /* Dummy op - must do something useless after P_LVL2 read */
+               /* Dummy wait op - must do something useless after P_LVL2 read
+                  because chipsets cannot guarantee that STPCLK# signal
+                  gets asserted in time to freeze execution properly. */
                t2 = inl(acpi_fadt.xpm_tmr_blk.address);
                /* Get end time (ticks) */
                t2 = inl(acpi_fadt.xpm_tmr_blk.address);
@@ -403,7 +401,7 @@ static void acpi_processor_idle(void)
                t1 = inl(acpi_fadt.xpm_tmr_blk.address);
                /* Invoke C3 */
                inb(cx->address);
-               /* Dummy op - must do something useless after P_LVL3 read */
+               /* Dummy wait op (see above) */
                t2 = inl(acpi_fadt.xpm_tmr_blk.address);
                /* Get end time (ticks) */
                t2 = inl(acpi_fadt.xpm_tmr_blk.address);
@@ -430,6 +428,9 @@ static void acpi_processor_idle(void)
                local_irq_enable();
                return;
        }
+       cx->usage++;
+       if ((cx->type != ACPI_STATE_C1) && (sleep_ticks > 0))
+               cx->time += sleep_ticks;
 
        next_state = pr->power.state;
 
@@ -517,10 +518,9 @@ static int acpi_processor_set_power_policy(struct acpi_processor *pr)
        struct acpi_processor_cx *higher = NULL;
        struct acpi_processor_cx *cx;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_set_power_policy");
 
        if (!pr)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        /*
         * This function sets the default Cx state policy (OS idle handler).
@@ -544,7 +544,7 @@ static int acpi_processor_set_power_policy(struct acpi_processor *pr)
        }
 
        if (!state_is_set)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        /* demotion */
        for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) {
@@ -583,18 +583,17 @@ static int acpi_processor_set_power_policy(struct acpi_processor *pr)
                higher = cx;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
 {
-       ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_fadt");
 
        if (!pr)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (!pr->pblk)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        /* if info is obtained from pblk/fadt, type equals state */
        pr->power.states[ACPI_STATE_C2].type = ACPI_STATE_C2;
@@ -606,7 +605,7 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
         * an SMP system. 
         */
        if ((num_online_cpus() > 1) && !acpi_fadt.plvl2_up)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 #endif
 
        /* determine C2 and C3 address from pblk */
@@ -622,12 +621,11 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
                          pr->power.states[ACPI_STATE_C2].address,
                          pr->power.states[ACPI_STATE_C3].address));
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_processor_get_power_info_default_c1(struct acpi_processor *pr)
 {
-       ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_default_c1");
 
        /* Zero initialize all the C-states info. */
        memset(pr->power.states, 0, sizeof(pr->power.states));
@@ -640,7 +638,7 @@ static int acpi_processor_get_power_info_default_c1(struct acpi_processor *pr)
        pr->power.states[ACPI_STATE_C0].valid = 1;
        pr->power.states[ACPI_STATE_C1].valid = 1;
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
@@ -652,10 +650,9 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
        struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
        union acpi_object *cst;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_cst");
 
        if (nocst)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        current_count = 1;
 
@@ -667,15 +664,14 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
        status = acpi_evaluate_object(pr->handle, "_CST", NULL, &buffer);
        if (ACPI_FAILURE(status)) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No _CST, giving up\n"));
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        }
 
        cst = (union acpi_object *)buffer.pointer;
 
        /* There must be at least 2 elements */
        if (!cst || (cst->type != ACPI_TYPE_PACKAGE) || cst->package.count < 2) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "not enough elements in _CST\n"));
+               printk(KERN_ERR PREFIX "not enough elements in _CST\n");
                status = -EFAULT;
                goto end;
        }
@@ -684,8 +680,7 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
 
        /* Validate number of power states. */
        if (count < 1 || count != cst->package.count - 1) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "count given by _CST is not valid\n"));
+               printk(KERN_ERR PREFIX "count given by _CST is not valid\n");
                status = -EFAULT;
                goto end;
        }
@@ -773,17 +768,16 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
                status = -EFAULT;
 
       end:
-       acpi_os_free(buffer.pointer);
+       kfree(buffer.pointer);
 
-       return_VALUE(status);
+       return status;
 }
 
 static void acpi_processor_power_verify_c2(struct acpi_processor_cx *cx)
 {
-       ACPI_FUNCTION_TRACE("acpi_processor_get_power_verify_c2");
 
        if (!cx->address)
-               return_VOID;
+               return;
 
        /*
         * C2 latency must be less than or equal to 100
@@ -792,7 +786,7 @@ static void acpi_processor_power_verify_c2(struct acpi_processor_cx *cx)
        else if (cx->latency > ACPI_PROCESSOR_MAX_C2_LATENCY) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                  "latency too large [%d]\n", cx->latency));
-               return_VOID;
+               return;
        }
 
        /*
@@ -802,7 +796,7 @@ static void acpi_processor_power_verify_c2(struct acpi_processor_cx *cx)
        cx->valid = 1;
        cx->latency_ticks = US_TO_PM_TIMER_TICKS(cx->latency);
 
-       return_VOID;
+       return;
 }
 
 static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
@@ -810,10 +804,9 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
 {
        static int bm_check_flag;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_get_power_verify_c3");
 
        if (!cx->address)
-               return_VOID;
+               return;
 
        /*
         * C3 latency must be less than or equal to 1000
@@ -822,7 +815,7 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
        else if (cx->latency > ACPI_PROCESSOR_MAX_C3_LATENCY) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                  "latency too large [%d]\n", cx->latency));
-               return_VOID;
+               return;
        }
 
        /*
@@ -835,7 +828,7 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
        else if (errata.piix4.fdma) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                  "C3 not supported on PIIX4 with Type-F DMA\n"));
-               return_VOID;
+               return;
        }
 
        /* All the logic here assumes flags.bm_check is same across all CPUs */
@@ -852,7 +845,7 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
                if (!pr->flags.bm_control) {
                        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                          "C3 support requires bus mastering control\n"));
-                       return_VOID;
+                       return;
                }
        } else {
                /*
@@ -863,7 +856,7 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
                        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                          "Cache invalidation should work properly"
                                          " for C3 to be enabled on SMP systems\n"));
-                       return_VOID;
+                       return;
                }
                acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD,
                                  0, ACPI_MTX_DO_NOT_LOCK);
@@ -878,7 +871,7 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
        cx->valid = 1;
        cx->latency_ticks = US_TO_PM_TIMER_TICKS(cx->latency);
 
-       return_VOID;
+       return;
 }
 
 static int acpi_processor_power_verify(struct acpi_processor *pr)
@@ -937,7 +930,6 @@ static int acpi_processor_get_power_info(struct acpi_processor *pr)
        unsigned int i;
        int result;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_get_power_info");
 
        /* NOTE: the idle thread may not be running while calling
         * this function */
@@ -960,7 +952,7 @@ static int acpi_processor_get_power_info(struct acpi_processor *pr)
         */
        result = acpi_processor_set_power_policy(pr);
        if (result)
-               return_VALUE(result);
+               return result;
 
        /*
         * if one state of type C2 or C3 is available, mark this
@@ -974,24 +966,23 @@ static int acpi_processor_get_power_info(struct acpi_processor *pr)
                }
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 int acpi_processor_cst_has_changed(struct acpi_processor *pr)
 {
        int result = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_cst_has_changed");
 
        if (!pr)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (nocst) {
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        }
 
        if (!pr->flags.power_setup_done)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        /* Fall back to the default idle loop */
        pm_idle = pm_idle_save;
@@ -1002,7 +993,7 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr)
        if ((pr->flags.power == 1) && (pr->flags.power_setup_done))
                pm_idle = acpi_processor_idle;
 
-       return_VALUE(result);
+       return result;
 }
 
 /* proc interface */
@@ -1012,7 +1003,6 @@ static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset)
        struct acpi_processor *pr = (struct acpi_processor *)seq->private;
        unsigned int i;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_power_seq_show");
 
        if (!pr)
                goto end;
@@ -1064,13 +1054,14 @@ static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset)
                else
                        seq_puts(seq, "demotion[--] ");
 
-               seq_printf(seq, "latency[%03d] usage[%08d]\n",
+               seq_printf(seq, "latency[%03d] usage[%08d] duration[%020llu]\n",
                           pr->power.states[i].latency,
-                          pr->power.states[i].usage);
+                          pr->power.states[i].usage,
+                          pr->power.states[i].time);
        }
 
       end:
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_processor_power_open_fs(struct inode *inode, struct file *file)
@@ -1094,7 +1085,6 @@ int acpi_processor_power_init(struct acpi_processor *pr,
        struct proc_dir_entry *entry = NULL;
        unsigned int i;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_power_init");
 
        if (!first_run) {
                dmi_check_system(processor_power_dmi_table);
@@ -1106,14 +1096,14 @@ int acpi_processor_power_init(struct acpi_processor *pr,
        }
 
        if (!pr)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (acpi_fadt.cst_cnt && !nocst) {
                status =
                    acpi_os_write_port(acpi_fadt.smi_cmd, acpi_fadt.cst_cnt, 8);
                if (ACPI_FAILURE(status)) {
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                         "Notifying BIOS of _CST ability failed\n"));
+                       ACPI_EXCEPTION((AE_INFO, status,
+                                       "Notifying BIOS of _CST ability failed"));
                }
        }
 
@@ -1142,9 +1132,7 @@ int acpi_processor_power_init(struct acpi_processor *pr,
        entry = create_proc_entry(ACPI_PROCESSOR_FILE_POWER,
                                  S_IRUGO, acpi_device_dir(device));
        if (!entry)
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to create '%s' fs entry\n",
-                                 ACPI_PROCESSOR_FILE_POWER));
+               return -EIO;
        else {
                entry->proc_fops = &acpi_processor_power_fops;
                entry->data = acpi_driver_data(device);
@@ -1153,13 +1141,12 @@ int acpi_processor_power_init(struct acpi_processor *pr,
 
        pr->flags.power_setup_done = 1;
 
-       return_VALUE(0);
+       return 0;
 }
 
 int acpi_processor_power_exit(struct acpi_processor *pr,
                              struct acpi_device *device)
 {
-       ACPI_FUNCTION_TRACE("acpi_processor_power_exit");
 
        pr->flags.power_setup_done = 0;
 
@@ -1179,5 +1166,5 @@ int acpi_processor_power_exit(struct acpi_processor *pr,
                cpu_idle_wait();
        }
 
-       return_VALUE(0);
+       return 0;
 }
index 41aaaba74b194e1169748afa5d18fd10060dce3a..7ba5e49ab302c523848930773d474c351fed30a1 100644 (file)
@@ -108,10 +108,9 @@ static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
        acpi_status status = 0;
        unsigned long ppc = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_get_platform_limit");
 
        if (!pr)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        /*
         * _PPC indicates the maximum state currently supported by the platform
@@ -123,13 +122,13 @@ static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
                acpi_processor_ppc_status |= PPC_IN_USE;
 
        if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PPC\n"));
-               return_VALUE(-ENODEV);
+               ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PPC"));
+               return -ENODEV;
        }
 
        pr->performance_platform_limit = (int)ppc;
 
-       return_VALUE(0);
+       return 0;
 }
 
 int acpi_processor_ppc_has_changed(struct acpi_processor *pr)
@@ -168,18 +167,17 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr)
        union acpi_object *pct = NULL;
        union acpi_object obj = { 0 };
 
-       ACPI_FUNCTION_TRACE("acpi_processor_get_performance_control");
 
        status = acpi_evaluate_object(pr->handle, "_PCT", NULL, &buffer);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PCT\n"));
-               return_VALUE(-ENODEV);
+               ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PCT"));
+               return -ENODEV;
        }
 
        pct = (union acpi_object *)buffer.pointer;
        if (!pct || (pct->type != ACPI_TYPE_PACKAGE)
            || (pct->package.count != 2)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PCT data\n"));
+               printk(KERN_ERR PREFIX "Invalid _PCT data\n");
                result = -EFAULT;
                goto end;
        }
@@ -193,8 +191,7 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr)
        if ((obj.type != ACPI_TYPE_BUFFER)
            || (obj.buffer.length < sizeof(struct acpi_pct_register))
            || (obj.buffer.pointer == NULL)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Invalid _PCT data (control_register)\n"));
+               printk(KERN_ERR PREFIX "Invalid _PCT data (control_register)\n");
                result = -EFAULT;
                goto end;
        }
@@ -210,8 +207,7 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr)
        if ((obj.type != ACPI_TYPE_BUFFER)
            || (obj.buffer.length < sizeof(struct acpi_pct_register))
            || (obj.buffer.pointer == NULL)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Invalid _PCT data (status_register)\n"));
+               printk(KERN_ERR PREFIX "Invalid _PCT data (status_register)\n");
                result = -EFAULT;
                goto end;
        }
@@ -220,9 +216,9 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr)
               sizeof(struct acpi_pct_register));
 
       end:
-       acpi_os_free(buffer.pointer);
+       kfree(buffer.pointer);
 
-       return_VALUE(result);
+       return result;
 }
 
 static int acpi_processor_get_performance_states(struct acpi_processor *pr)
@@ -235,17 +231,16 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
        union acpi_object *pss = NULL;
        int i;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_get_performance_states");
 
        status = acpi_evaluate_object(pr->handle, "_PSS", NULL, &buffer);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PSS\n"));
-               return_VALUE(-ENODEV);
+               ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PSS"));
+               return -ENODEV;
        }
 
        pss = (union acpi_object *)buffer.pointer;
        if (!pss || (pss->type != ACPI_TYPE_PACKAGE)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PSS data\n"));
+               printk(KERN_ERR PREFIX "Invalid _PSS data\n");
                result = -EFAULT;
                goto end;
        }
@@ -274,8 +269,7 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
                status = acpi_extract_package(&(pss->package.elements[i]),
                                              &format, &state);
                if (ACPI_FAILURE(status)) {
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                         "Invalid _PSS data\n"));
+                       ACPI_EXCEPTION((AE_INFO, status, "Invalid _PSS data"));
                        result = -EFAULT;
                        kfree(pr->performance->states);
                        goto end;
@@ -291,8 +285,8 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
                                  (u32) px->control, (u32) px->status));
 
                if (!px->core_frequency) {
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                         "Invalid _PSS data: freq is zero\n"));
+                       printk(KERN_ERR PREFIX
+                                   "Invalid _PSS data: freq is zero\n");
                        result = -EFAULT;
                        kfree(pr->performance->states);
                        goto end;
@@ -300,9 +294,9 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
        }
 
       end:
-       acpi_os_free(buffer.pointer);
+       kfree(buffer.pointer);
 
-       return_VALUE(result);
+       return result;
 }
 
 static int acpi_processor_get_performance_info(struct acpi_processor *pr)
@@ -311,31 +305,30 @@ static int acpi_processor_get_performance_info(struct acpi_processor *pr)
        acpi_status status = AE_OK;
        acpi_handle handle = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_get_performance_info");
 
        if (!pr || !pr->performance || !pr->handle)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        status = acpi_get_handle(pr->handle, "_PCT", &handle);
        if (ACPI_FAILURE(status)) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                  "ACPI-based processor performance control unavailable\n"));
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        }
 
        result = acpi_processor_get_performance_control(pr);
        if (result)
-               return_VALUE(result);
+               return result;
 
        result = acpi_processor_get_performance_states(pr);
        if (result)
-               return_VALUE(result);
+               return result;
 
        result = acpi_processor_get_platform_limit(pr);
        if (result)
-               return_VALUE(result);
+               return result;
 
-       return_VALUE(0);
+       return 0;
 }
 
 int acpi_processor_notify_smm(struct module *calling_module)
@@ -343,13 +336,12 @@ int acpi_processor_notify_smm(struct module *calling_module)
        acpi_status status;
        static int is_done = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_notify_smm");
 
        if (!(acpi_processor_ppc_status & PPC_REGISTERED))
-               return_VALUE(-EBUSY);
+               return -EBUSY;
 
        if (!try_module_get(calling_module))
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        /* is_done is set to negative if an error occured,
         * and to postitive if _no_ error occured, but SMM
@@ -358,10 +350,10 @@ int acpi_processor_notify_smm(struct module *calling_module)
         */
        if (is_done > 0) {
                module_put(calling_module);
-               return_VALUE(0);
+               return 0;
        } else if (is_done < 0) {
                module_put(calling_module);
-               return_VALUE(is_done);
+               return is_done;
        }
 
        is_done = -EIO;
@@ -370,7 +362,7 @@ int acpi_processor_notify_smm(struct module *calling_module)
        if ((!acpi_fadt.smi_cmd) || (!acpi_fadt.pstate_cnt)) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No SMI port or pstate_cnt\n"));
                module_put(calling_module);
-               return_VALUE(0);
+               return 0;
        }
 
        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
@@ -387,12 +379,12 @@ int acpi_processor_notify_smm(struct module *calling_module)
        status = acpi_os_write_port(acpi_fadt.smi_cmd,
                                    (u32) acpi_fadt.pstate_cnt, 8);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Failed to write pstate_cnt [0x%x] to "
-                                 "smi_cmd [0x%x]\n", acpi_fadt.pstate_cnt,
-                                 acpi_fadt.smi_cmd));
+               ACPI_EXCEPTION((AE_INFO, status,
+                               "Failed to write pstate_cnt [0x%x] to "
+                               "smi_cmd [0x%x]", acpi_fadt.pstate_cnt,
+                               acpi_fadt.smi_cmd));
                module_put(calling_module);
-               return_VALUE(status);
+               return status;
        }
 
        /* Success. If there's no _PPC, we need to fear nothing, so
@@ -402,7 +394,7 @@ int acpi_processor_notify_smm(struct module *calling_module)
        if (!(acpi_processor_ppc_status & PPC_IN_USE))
                module_put(calling_module);
 
-       return_VALUE(0);
+       return 0;
 }
 
 EXPORT_SYMBOL(acpi_processor_notify_smm);
@@ -423,7 +415,6 @@ static int acpi_processor_perf_seq_show(struct seq_file *seq, void *offset)
        struct acpi_processor *pr = (struct acpi_processor *)seq->private;
        int i;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_perf_seq_show");
 
        if (!pr)
                goto end;
@@ -447,7 +438,7 @@ static int acpi_processor_perf_seq_show(struct seq_file *seq, void *offset)
                           (u32) pr->performance->states[i].transition_latency);
 
       end:
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_processor_perf_open_fs(struct inode *inode, struct file *file)
@@ -469,23 +460,22 @@ acpi_processor_write_performance(struct file *file,
        unsigned int new_state = 0;
        struct cpufreq_policy policy;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_write_performance");
 
        if (!pr || (count > sizeof(state_string) - 1))
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        perf = pr->performance;
        if (!perf)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (copy_from_user(state_string, buffer, count))
-               return_VALUE(-EFAULT);
+               return -EFAULT;
 
        state_string[count] = '\0';
        new_state = simple_strtoul(state_string, NULL, 0);
 
        if (new_state >= perf->state_count)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        cpufreq_get_policy(&policy, pr->id);
 
@@ -495,9 +485,9 @@ acpi_processor_write_performance(struct file *file,
 
        result = cpufreq_set_policy(&policy);
        if (result)
-               return_VALUE(result);
+               return result;
 
-       return_VALUE(count);
+       return count;
 }
 
 static void acpi_cpufreq_add_file(struct acpi_processor *pr)
@@ -505,42 +495,36 @@ static void acpi_cpufreq_add_file(struct acpi_processor *pr)
        struct proc_dir_entry *entry = NULL;
        struct acpi_device *device = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_cpufreq_addfile");
 
        if (acpi_bus_get_device(pr->handle, &device))
-               return_VOID;
+               return;
 
        /* add file 'performance' [R/W] */
        entry = create_proc_entry(ACPI_PROCESSOR_FILE_PERFORMANCE,
                                  S_IFREG | S_IRUGO | S_IWUSR,
                                  acpi_device_dir(device));
-       if (!entry)
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to create '%s' fs entry\n",
-                                 ACPI_PROCESSOR_FILE_PERFORMANCE));
-       else {
+       if (entry){
                acpi_processor_perf_fops.write = acpi_processor_write_performance;
                entry->proc_fops = &acpi_processor_perf_fops;
                entry->data = acpi_driver_data(device);
                entry->owner = THIS_MODULE;
        }
-       return_VOID;
+       return;
 }
 
 static void acpi_cpufreq_remove_file(struct acpi_processor *pr)
 {
        struct acpi_device *device = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_cpufreq_addfile");
 
        if (acpi_bus_get_device(pr->handle, &device))
-               return_VOID;
+               return;
 
        /* remove file 'performance' */
        remove_proc_entry(ACPI_PROCESSOR_FILE_PERFORMANCE,
                          acpi_device_dir(device));
 
-       return_VOID;
+       return;
 }
 
 #else
@@ -608,7 +592,7 @@ static int acpi_processor_get_psd(struct acpi_processor     *pr)
        }
 
 end:
-       acpi_os_free(buffer.pointer);
+       kfree(buffer.pointer);
        return result;
 }
 
@@ -698,12 +682,12 @@ int acpi_processor_preregister_performance(
                /* Validate the Domain info */
                count_target = pdomain->num_processors;
                count = 1;
-               if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ALL ||
-                   pdomain->coord_type == DOMAIN_COORD_TYPE_HW_ALL) {
+               if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ALL)
                        pr->performance->shared_type = CPUFREQ_SHARED_TYPE_ALL;
-               } else if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ANY) {
+               else if (pdomain->coord_type == DOMAIN_COORD_TYPE_HW_ALL)
+                       pr->performance->shared_type = CPUFREQ_SHARED_TYPE_HW;
+               else if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ANY)
                        pr->performance->shared_type = CPUFREQ_SHARED_TYPE_ANY;
-               }
 
                for_each_possible_cpu(j) {
                        if (i == j)
@@ -784,22 +768,21 @@ acpi_processor_register_performance(struct acpi_processor_performance
 {
        struct acpi_processor *pr;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_register_performance");
 
        if (!(acpi_processor_ppc_status & PPC_REGISTERED))
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        mutex_lock(&performance_mutex);
 
        pr = processors[cpu];
        if (!pr) {
                mutex_unlock(&performance_mutex);
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        }
 
        if (pr->performance) {
                mutex_unlock(&performance_mutex);
-               return_VALUE(-EBUSY);
+               return -EBUSY;
        }
 
        WARN_ON(!performance);
@@ -809,13 +792,13 @@ acpi_processor_register_performance(struct acpi_processor_performance
        if (acpi_processor_get_performance_info(pr)) {
                pr->performance = NULL;
                mutex_unlock(&performance_mutex);
-               return_VALUE(-EIO);
+               return -EIO;
        }
 
        acpi_cpufreq_add_file(pr);
 
        mutex_unlock(&performance_mutex);
-       return_VALUE(0);
+       return 0;
 }
 
 EXPORT_SYMBOL(acpi_processor_register_performance);
@@ -826,14 +809,13 @@ acpi_processor_unregister_performance(struct acpi_processor_performance
 {
        struct acpi_processor *pr;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_unregister_performance");
 
        mutex_lock(&performance_mutex);
 
        pr = processors[cpu];
        if (!pr) {
                mutex_unlock(&performance_mutex);
-               return_VOID;
+               return;
        }
 
        if (pr->performance)
@@ -844,7 +826,7 @@ acpi_processor_unregister_performance(struct acpi_processor_performance
 
        mutex_unlock(&performance_mutex);
 
-       return_VOID;
+       return;
 }
 
 EXPORT_SYMBOL(acpi_processor_unregister_performance);
index f99ad05cd6a2b9575f51d5bf2f9fdbe81f3cc675..ef5e0f6efdba80922feb73ad7befc79f4f23cd61 100644 (file)
@@ -54,13 +54,12 @@ static int acpi_processor_apply_limit(struct acpi_processor *pr)
        u16 px = 0;
        u16 tx = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_apply_limit");
 
        if (!pr)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (!pr->flags.limit)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        if (pr->flags.throttling) {
                if (pr->limit.user.tx > tx)
@@ -82,9 +81,9 @@ static int acpi_processor_apply_limit(struct acpi_processor *pr)
 
       end:
        if (result)
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unable to set limit\n"));
+               printk(KERN_ERR PREFIX "Unable to set limit\n");
 
-       return_VALUE(result);
+       return result;
 }
 
 #ifdef CONFIG_CPU_FREQ
@@ -200,19 +199,18 @@ int acpi_processor_set_thermal_limit(acpi_handle handle, int type)
        struct acpi_device *device = NULL;
        int tx = 0, max_tx_px = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_set_thermal_limit");
 
        if ((type < ACPI_PROCESSOR_LIMIT_NONE)
            || (type > ACPI_PROCESSOR_LIMIT_DECREMENT))
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        result = acpi_bus_get_device(handle, &device);
        if (result)
-               return_VALUE(result);
+               return result;
 
        pr = (struct acpi_processor *)acpi_driver_data(device);
        if (!pr)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        /* Thermal limits are always relative to the current Px/Tx state. */
        if (pr->flags.throttling)
@@ -289,30 +287,28 @@ int acpi_processor_set_thermal_limit(acpi_handle handle, int type)
 
                result = acpi_processor_apply_limit(pr);
                if (result)
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                         "Unable to set thermal limit\n"));
+                       printk(KERN_ERR PREFIX "Unable to set thermal limit\n");
 
                ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Thermal limit now (P%d:T%d)\n",
                                  pr->limit.thermal.px, pr->limit.thermal.tx));
        } else
                result = 0;
        if (max_tx_px)
-               return_VALUE(1);
+               return 1;
        else
-               return_VALUE(result);
+               return result;
 }
 
 int acpi_processor_get_limit_info(struct acpi_processor *pr)
 {
-       ACPI_FUNCTION_TRACE("acpi_processor_get_limit_info");
 
        if (!pr)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (pr->flags.throttling)
                pr->flags.limit = 1;
 
-       return_VALUE(0);
+       return 0;
 }
 
 /* /proc interface */
@@ -321,7 +317,6 @@ static int acpi_processor_limit_seq_show(struct seq_file *seq, void *offset)
 {
        struct acpi_processor *pr = (struct acpi_processor *)seq->private;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_limit_seq_show");
 
        if (!pr)
                goto end;
@@ -339,7 +334,7 @@ static int acpi_processor_limit_seq_show(struct seq_file *seq, void *offset)
                   pr->limit.thermal.px, pr->limit.thermal.tx);
 
       end:
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_processor_limit_open_fs(struct inode *inode, struct file *file)
@@ -359,36 +354,33 @@ static ssize_t acpi_processor_write_limit(struct file * file,
        int px = 0;
        int tx = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_write_limit");
 
        if (!pr || (count > sizeof(limit_string) - 1)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument\n"));
-               return_VALUE(-EINVAL);
+               return -EINVAL;
        }
 
        if (copy_from_user(limit_string, buffer, count)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data\n"));
-               return_VALUE(-EFAULT);
+               return -EFAULT;
        }
 
        limit_string[count] = '\0';
 
        if (sscanf(limit_string, "%d:%d", &px, &tx) != 2) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data format\n"));
-               return_VALUE(-EINVAL);
+               printk(KERN_ERR PREFIX "Invalid data format\n");
+               return -EINVAL;
        }
 
        if (pr->flags.throttling) {
                if ((tx < 0) || (tx > (pr->throttling.state_count - 1))) {
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid tx\n"));
-                       return_VALUE(-EINVAL);
+                       printk(KERN_ERR PREFIX "Invalid tx\n");
+                       return -EINVAL;
                }
                pr->limit.user.tx = tx;
        }
 
        result = acpi_processor_apply_limit(pr);
 
-       return_VALUE(count);
+       return count;
 }
 
 struct file_operations acpi_processor_limit_fops = {
index b966549ec000487eecce9f3e1edc53a72cd51964..d044ec519db0a226404653da9a20cbb079a2f293 100644 (file)
@@ -55,13 +55,12 @@ static int acpi_processor_get_throttling(struct acpi_processor *pr)
        u32 duty_mask = 0;
        u32 duty_value = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_get_throttling");
 
        if (!pr)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (!pr->flags.throttling)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        pr->throttling.state = 0;
 
@@ -93,7 +92,7 @@ static int acpi_processor_get_throttling(struct acpi_processor *pr)
                          "Throttling state is T%d (%d%% throttling applied)\n",
                          state, pr->throttling.states[state].performance));
 
-       return_VALUE(0);
+       return 0;
 }
 
 int acpi_processor_set_throttling(struct acpi_processor *pr, int state)
@@ -102,19 +101,18 @@ int acpi_processor_set_throttling(struct acpi_processor *pr, int state)
        u32 duty_mask = 0;
        u32 duty_value = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_set_throttling");
 
        if (!pr)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if ((state < 0) || (state > (pr->throttling.state_count - 1)))
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (!pr->flags.throttling)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        if (state == pr->throttling.state)
-               return_VALUE(0);
+               return 0;
 
        /*
         * Calculate the duty_value and duty_mask.
@@ -165,7 +163,7 @@ int acpi_processor_set_throttling(struct acpi_processor *pr, int state)
                          (pr->throttling.states[state].performance ? pr->
                           throttling.states[state].performance / 10 : 0)));
 
-       return_VALUE(0);
+       return 0;
 }
 
 int acpi_processor_get_throttling_info(struct acpi_processor *pr)
@@ -174,7 +172,6 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
        int step = 0;
        int i = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_get_throttling_info");
 
        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                          "pblk_address[0x%08x] duty_offset[%d] duty_width[%d]\n",
@@ -183,21 +180,21 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
                          pr->throttling.duty_width));
 
        if (!pr)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        /* TBD: Support ACPI 2.0 objects */
 
        if (!pr->throttling.address) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling register\n"));
-               return_VALUE(0);
+               return 0;
        } else if (!pr->throttling.duty_width) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling states\n"));
-               return_VALUE(0);
+               return 0;
        }
        /* TBD: Support duty_cycle values that span bit 4. */
        else if ((pr->throttling.duty_offset + pr->throttling.duty_width) > 4) {
-               ACPI_DEBUG_PRINT((ACPI_DB_WARN, "duty_cycle spans bit 4\n"));
-               return_VALUE(0);
+               printk(KERN_WARNING PREFIX "duty_cycle spans bit 4\n");
+               return 0;
        }
 
        /*
@@ -208,7 +205,7 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
        if (errata.piix4.throttle) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                  "Throttling not supported on PIIX4 A- or B-step\n"));
-               return_VALUE(0);
+               return 0;
        }
 
        pr->throttling.state_count = 1 << acpi_fadt.duty_width;
@@ -254,7 +251,7 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
        if (result)
                pr->flags.throttling = 0;
 
-       return_VALUE(result);
+       return result;
 }
 
 /* proc interface */
@@ -266,7 +263,6 @@ static int acpi_processor_throttling_seq_show(struct seq_file *seq,
        int i = 0;
        int result = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_processor_throttling_seq_show");
 
        if (!pr)
                goto end;
@@ -296,7 +292,7 @@ static int acpi_processor_throttling_seq_show(struct seq_file *seq,
                            throttling.states[i].performance / 10 : 0));
 
       end:
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_processor_throttling_open_fs(struct inode *inode,
@@ -315,13 +311,12 @@ static ssize_t acpi_processor_write_throttling(struct file * file,
        struct acpi_processor *pr = (struct acpi_processor *)m->private;
        char state_string[12] = { '\0' };
 
-       ACPI_FUNCTION_TRACE("acpi_processor_write_throttling");
 
        if (!pr || (count > sizeof(state_string) - 1))
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (copy_from_user(state_string, buffer, count))
-               return_VALUE(-EFAULT);
+               return -EFAULT;
 
        state_string[count] = '\0';
 
@@ -329,9 +324,9 @@ static ssize_t acpi_processor_write_throttling(struct file * file,
                                               simple_strtoul(state_string,
                                                              NULL, 0));
        if (result)
-               return_VALUE(result);
+               return result;
 
-       return_VALUE(count);
+       return count;
 }
 
 struct file_operations acpi_processor_throttling_fops = {
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
new file mode 100644 (file)
index 0000000..db7b350
--- /dev/null
@@ -0,0 +1,1766 @@
+/*
+ *  acpi_sbs.c - ACPI Smart Battery System Driver ($Revision: 1.16 $)
+ *
+ *  Copyright (c) 2005 Rich Townsend <rhdt@bartol.udel.edu>
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ *  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/init.h>
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/kernel.h>
+#include <linux/proc_fs.h>
+#include <linux/seq_file.h>
+#include <asm/uaccess.h>
+#include <linux/acpi.h>
+#include <linux/i2c.h>
+#include <linux/delay.h>
+
+#include "i2c_ec.h"
+
+#define        DEF_CAPACITY_UNIT       3
+#define        MAH_CAPACITY_UNIT       1
+#define        MWH_CAPACITY_UNIT       2
+#define        CAPACITY_UNIT           DEF_CAPACITY_UNIT
+
+#define        REQUEST_UPDATE_MODE     1
+#define        QUEUE_UPDATE_MODE       2
+
+#define        DATA_TYPE_COMMON        0
+#define        DATA_TYPE_INFO          1
+#define        DATA_TYPE_STATE         2
+#define        DATA_TYPE_ALARM         3
+#define        DATA_TYPE_AC_STATE      4
+
+extern struct proc_dir_entry *acpi_lock_ac_dir(void);
+extern struct proc_dir_entry *acpi_lock_battery_dir(void);
+extern void acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir);
+extern void acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir);
+
+#define ACPI_SBS_COMPONENT             0x00080000
+#define ACPI_SBS_CLASS                 "sbs"
+#define ACPI_AC_CLASS                  "ac_adapter"
+#define ACPI_BATTERY_CLASS             "battery"
+#define ACPI_SBS_HID                   "ACPI0002"
+#define ACPI_SBS_DRIVER_NAME           "ACPI Smart Battery System Driver"
+#define ACPI_SBS_DEVICE_NAME           "Smart Battery System"
+#define ACPI_SBS_FILE_INFO             "info"
+#define ACPI_SBS_FILE_STATE            "state"
+#define ACPI_SBS_FILE_ALARM            "alarm"
+#define ACPI_BATTERY_DIR_NAME          "BAT%i"
+#define ACPI_AC_DIR_NAME               "AC0"
+#define ACPI_SBC_SMBUS_ADDR            0x9
+#define ACPI_SBSM_SMBUS_ADDR           0xa
+#define ACPI_SB_SMBUS_ADDR             0xb
+#define ACPI_SBS_AC_NOTIFY_STATUS      0x80
+#define ACPI_SBS_BATTERY_NOTIFY_STATUS 0x80
+#define ACPI_SBS_BATTERY_NOTIFY_INFO   0x81
+
+#define _COMPONENT                     ACPI_SBS_COMPONENT
+
+#define        MAX_SBS_BAT                     4
+#define        MAX_SMBUS_ERR                   1
+
+ACPI_MODULE_NAME("acpi_sbs");
+
+MODULE_AUTHOR("Rich Townsend");
+MODULE_DESCRIPTION("Smart Battery System ACPI interface driver");
+MODULE_LICENSE("GPL");
+
+static struct semaphore sbs_sem;
+
+#define        UPDATE_MODE             QUEUE_UPDATE_MODE
+/* REQUEST_UPDATE_MODE  QUEUE_UPDATE_MODE */
+#define        UPDATE_INFO_MODE        0
+#define        UPDATE_TIME             60
+#define        UPDATE_TIME2            0
+
+static int capacity_mode = CAPACITY_UNIT;
+static int update_mode = UPDATE_MODE;
+static int update_info_mode = UPDATE_INFO_MODE;
+static int update_time = UPDATE_TIME;
+static int update_time2 = UPDATE_TIME2;
+
+module_param(capacity_mode, int, CAPACITY_UNIT);
+module_param(update_mode, int, UPDATE_MODE);
+module_param(update_info_mode, int, UPDATE_INFO_MODE);
+module_param(update_time, int, UPDATE_TIME);
+module_param(update_time2, int, UPDATE_TIME2);
+
+static int acpi_sbs_add(struct acpi_device *device);
+static int acpi_sbs_remove(struct acpi_device *device, int type);
+static void acpi_battery_smbus_err_handler(struct acpi_ec_smbus *smbus);
+static void acpi_sbs_update_queue(void *data);
+
+static struct acpi_driver acpi_sbs_driver = {
+       .name = ACPI_SBS_DRIVER_NAME,
+       .class = ACPI_SBS_CLASS,
+       .ids = ACPI_SBS_HID,
+       .ops = {
+               .add = acpi_sbs_add,
+               .remove = acpi_sbs_remove,
+               },
+};
+
+struct acpi_battery_info {
+       int capacity_mode;
+       s16 full_charge_capacity;
+       s16 design_capacity;
+       s16 design_voltage;
+       int vscale;
+       int ipscale;
+       s16 serial_number;
+       char manufacturer_name[I2C_SMBUS_BLOCK_MAX + 3];
+       char device_name[I2C_SMBUS_BLOCK_MAX + 3];
+       char device_chemistry[I2C_SMBUS_BLOCK_MAX + 3];
+};
+
+struct acpi_battery_state {
+       s16 voltage;
+       s16 amperage;
+       s16 remaining_capacity;
+       s16 average_time_to_empty;
+       s16 average_time_to_full;
+       s16 battery_status;
+};
+
+struct acpi_battery_alarm {
+       s16 remaining_capacity;
+};
+
+struct acpi_battery {
+       int alive;
+       int battery_present;
+       int id;
+       int init_state;
+       struct acpi_sbs *sbs;
+       struct acpi_battery_info info;
+       struct acpi_battery_state state;
+       struct acpi_battery_alarm alarm;
+       struct proc_dir_entry *battery_entry;
+};
+
+struct acpi_sbs {
+       acpi_handle handle;
+       struct acpi_device *device;
+       struct acpi_ec_smbus *smbus;
+       int sbsm_present;
+       int sbsm_batteries_supported;
+       int ac_present;
+       struct proc_dir_entry *ac_entry;
+       struct acpi_battery battery[MAX_SBS_BAT];
+       int update_info_mode;
+       int zombie;
+       int update_time;
+       int update_time2;
+       struct timer_list update_timer;
+};
+
+static void acpi_update_delay(struct acpi_sbs *sbs);
+static int acpi_sbs_update_run(struct acpi_sbs *sbs, int data_type);
+
+/* --------------------------------------------------------------------------
+                               SMBus Communication
+   -------------------------------------------------------------------------- */
+
+static void acpi_battery_smbus_err_handler(struct acpi_ec_smbus *smbus)
+{
+       union i2c_smbus_data data;
+       int result = 0;
+       char *err_str;
+       int err_number;
+
+       data.word = 0;
+
+       result = smbus->adapter.algo->
+           smbus_xfer(&smbus->adapter,
+                      ACPI_SB_SMBUS_ADDR,
+                      0, I2C_SMBUS_READ, 0x16, I2C_SMBUS_BLOCK_DATA, &data);
+
+       err_number = (data.word & 0x000f);
+
+       switch (data.word & 0x000f) {
+       case 0x0000:
+               err_str = "unexpected bus error";
+               break;
+       case 0x0001:
+               err_str = "busy";
+               break;
+       case 0x0002:
+               err_str = "reserved command";
+               break;
+       case 0x0003:
+               err_str = "unsupported command";
+               break;
+       case 0x0004:
+               err_str = "access denied";
+               break;
+       case 0x0005:
+               err_str = "overflow/underflow";
+               break;
+       case 0x0006:
+               err_str = "bad size";
+               break;
+       case 0x0007:
+               err_str = "unknown error";
+               break;
+       default:
+               err_str = "unrecognized error";
+       }
+       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                         "%s: ret %i, err %i\n", err_str, result, err_number));
+}
+
+static int
+acpi_sbs_smbus_read_word(struct acpi_ec_smbus *smbus, int addr, int func,
+                        u16 * word,
+                        void (*err_handler) (struct acpi_ec_smbus * smbus))
+{
+       union i2c_smbus_data data;
+       int result = 0;
+       int i;
+
+       if (err_handler == NULL) {
+               err_handler = acpi_battery_smbus_err_handler;
+       }
+
+       for (i = 0; i < MAX_SMBUS_ERR; i++) {
+               result =
+                   smbus->adapter.algo->smbus_xfer(&smbus->adapter, addr, 0,
+                                                   I2C_SMBUS_READ, func,
+                                                   I2C_SMBUS_WORD_DATA, &data);
+               if (result) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                         "try %i: smbus->adapter.algo->smbus_xfer() failed\n",
+                                         i));
+                       if (err_handler) {
+                               err_handler(smbus);
+                       }
+               } else {
+                       *word = data.word;
+                       break;
+               }
+       }
+
+       return result;
+}
+
+static int
+acpi_sbs_smbus_read_str(struct acpi_ec_smbus *smbus, int addr, int func,
+                       char *str,
+                       void (*err_handler) (struct acpi_ec_smbus * smbus))
+{
+       union i2c_smbus_data data;
+       int result = 0;
+       int i;
+
+       if (err_handler == NULL) {
+               err_handler = acpi_battery_smbus_err_handler;
+       }
+
+       for (i = 0; i < MAX_SMBUS_ERR; i++) {
+               result =
+                   smbus->adapter.algo->smbus_xfer(&smbus->adapter, addr, 0,
+                                                   I2C_SMBUS_READ, func,
+                                                   I2C_SMBUS_BLOCK_DATA,
+                                                   &data);
+               if (result) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                         "try %i: smbus->adapter.algo->smbus_xfer() failed\n",
+                                         i));
+                       if (err_handler) {
+                               err_handler(smbus);
+                       }
+               } else {
+                       strncpy(str, (const char *)data.block + 1,
+                               data.block[0]);
+                       str[data.block[0]] = 0;
+                       break;
+               }
+       }
+
+       return result;
+}
+
+static int
+acpi_sbs_smbus_write_word(struct acpi_ec_smbus *smbus, int addr, int func,
+                         int word,
+                         void (*err_handler) (struct acpi_ec_smbus * smbus))
+{
+       union i2c_smbus_data data;
+       int result = 0;
+       int i;
+
+       if (err_handler == NULL) {
+               err_handler = acpi_battery_smbus_err_handler;
+       }
+
+       data.word = word;
+
+       for (i = 0; i < MAX_SMBUS_ERR; i++) {
+               result =
+                   smbus->adapter.algo->smbus_xfer(&smbus->adapter, addr, 0,
+                                                   I2C_SMBUS_WRITE, func,
+                                                   I2C_SMBUS_WORD_DATA, &data);
+               if (result) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                         "try %i: smbus->adapter.algo"
+                                         "->smbus_xfer() failed\n", i));
+                       if (err_handler) {
+                               err_handler(smbus);
+                       }
+               } else {
+                       break;
+               }
+       }
+
+       return result;
+}
+
+/* --------------------------------------------------------------------------
+                            Smart Battery System Management
+   -------------------------------------------------------------------------- */
+
+/* Smart Battery */
+
+static int acpi_sbs_generate_event(struct acpi_device *device,
+                                  int event, int state, char *bid, char *class)
+{
+       char bid_saved[5];
+       char class_saved[20];
+       int result = 0;
+
+       strcpy(bid_saved, acpi_device_bid(device));
+       strcpy(class_saved, acpi_device_class(device));
+
+       strcpy(acpi_device_bid(device), bid);
+       strcpy(acpi_device_class(device), class);
+
+       result = acpi_bus_generate_event(device, event, state);
+
+       strcpy(acpi_device_bid(device), bid_saved);
+       strcpy(acpi_device_class(device), class_saved);
+
+       return result;
+}
+
+static int acpi_battery_get_present(struct acpi_battery *battery)
+{
+       s16 state;
+       int result = 0;
+       int is_present = 0;
+
+       result = acpi_sbs_smbus_read_word(battery->sbs->smbus,
+                                         ACPI_SBSM_SMBUS_ADDR, 0x01,
+                                         &state, NULL);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_sbs_smbus_read_word() failed"));
+       }
+       if (!result) {
+               is_present = (state & 0x000f) & (1 << battery->id);
+       }
+       battery->battery_present = is_present;
+
+       return result;
+}
+
+static int acpi_battery_is_present(struct acpi_battery *battery)
+{
+       return (battery->battery_present);
+}
+
+static int acpi_ac_is_present(struct acpi_sbs *sbs)
+{
+       return (sbs->ac_present);
+}
+
+static int acpi_battery_select(struct acpi_battery *battery)
+{
+       struct acpi_ec_smbus *smbus = battery->sbs->smbus;
+       int result = 0;
+       s16 state;
+       int foo;
+
+       if (battery->sbs->sbsm_present) {
+
+               /* Take special care not to knobble other nibbles of
+                * state (aka selector_state), since
+                * it causes charging to halt on SBSELs */
+
+               result =
+                   acpi_sbs_smbus_read_word(smbus, ACPI_SBSM_SMBUS_ADDR, 0x01,
+                                            &state, NULL);
+               if (result) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                         "acpi_sbs_smbus_read_word() failed\n"));
+                       goto end;
+               }
+
+               foo = (state & 0x0fff) | (1 << (battery->id + 12));
+               result =
+                   acpi_sbs_smbus_write_word(smbus, ACPI_SBSM_SMBUS_ADDR, 0x01,
+                                             foo, NULL);
+               if (result) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                         "acpi_sbs_smbus_write_word() failed\n"));
+                       goto end;
+               }
+       }
+
+      end:
+       return result;
+}
+
+static int acpi_sbsm_get_info(struct acpi_sbs *sbs)
+{
+       struct acpi_ec_smbus *smbus = sbs->smbus;
+       int result = 0;
+       s16 battery_system_info;
+
+       result = acpi_sbs_smbus_read_word(smbus, ACPI_SBSM_SMBUS_ADDR, 0x04,
+                                         &battery_system_info, NULL);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_sbs_smbus_read_word() failed\n"));
+               goto end;
+       }
+
+       sbs->sbsm_batteries_supported = battery_system_info & 0x000f;
+
+      end:
+
+       return result;
+}
+
+static int acpi_battery_get_info(struct acpi_battery *battery)
+{
+       struct acpi_ec_smbus *smbus = battery->sbs->smbus;
+       int result = 0;
+       s16 battery_mode;
+       s16 specification_info;
+
+       result = acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x03,
+                                         &battery_mode,
+                                         &acpi_battery_smbus_err_handler);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_sbs_smbus_read_word() failed\n"));
+               goto end;
+       }
+       battery->info.capacity_mode = (battery_mode & 0x8000) >> 15;
+
+       result = acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x10,
+                                         &battery->info.full_charge_capacity,
+                                         &acpi_battery_smbus_err_handler);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_sbs_smbus_read_word() failed\n"));
+               goto end;
+       }
+
+       result = acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x18,
+                                         &battery->info.design_capacity,
+                                         &acpi_battery_smbus_err_handler);
+
+       if (result) {
+               goto end;
+       }
+
+       result = acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x19,
+                                         &battery->info.design_voltage,
+                                         &acpi_battery_smbus_err_handler);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_sbs_smbus_read_word() failed\n"));
+               goto end;
+       }
+
+       result = acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x1a,
+                                         &specification_info,
+                                         &acpi_battery_smbus_err_handler);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_sbs_smbus_read_word() failed\n"));
+               goto end;
+       }
+
+       switch ((specification_info & 0x0f00) >> 8) {
+       case 1:
+               battery->info.vscale = 10;
+               break;
+       case 2:
+               battery->info.vscale = 100;
+               break;
+       case 3:
+               battery->info.vscale = 1000;
+               break;
+       default:
+               battery->info.vscale = 1;
+       }
+
+       switch ((specification_info & 0xf000) >> 12) {
+       case 1:
+               battery->info.ipscale = 10;
+               break;
+       case 2:
+               battery->info.ipscale = 100;
+               break;
+       case 3:
+               battery->info.ipscale = 1000;
+               break;
+       default:
+               battery->info.ipscale = 1;
+       }
+
+       result = acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x1c,
+                                         &battery->info.serial_number,
+                                         &acpi_battery_smbus_err_handler);
+       if (result) {
+               goto end;
+       }
+
+       result = acpi_sbs_smbus_read_str(smbus, ACPI_SB_SMBUS_ADDR, 0x20,
+                                        battery->info.manufacturer_name,
+                                        &acpi_battery_smbus_err_handler);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_sbs_smbus_read_str() failed\n"));
+               goto end;
+       }
+
+       result = acpi_sbs_smbus_read_str(smbus, ACPI_SB_SMBUS_ADDR, 0x21,
+                                        battery->info.device_name,
+                                        &acpi_battery_smbus_err_handler);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_sbs_smbus_read_str() failed\n"));
+               goto end;
+       }
+
+       result = acpi_sbs_smbus_read_str(smbus, ACPI_SB_SMBUS_ADDR, 0x22,
+                                        battery->info.device_chemistry,
+                                        &acpi_battery_smbus_err_handler);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_sbs_smbus_read_str() failed\n"));
+               goto end;
+       }
+
+      end:
+       return result;
+}
+
+static void acpi_update_delay(struct acpi_sbs *sbs)
+{
+       if (sbs->zombie) {
+               return;
+       }
+       if (sbs->update_time2 > 0) {
+               msleep(sbs->update_time2 * 1000);
+       }
+}
+
+static int acpi_battery_get_state(struct acpi_battery *battery)
+{
+       struct acpi_ec_smbus *smbus = battery->sbs->smbus;
+       int result = 0;
+
+       acpi_update_delay(battery->sbs);
+       result = acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x09,
+                                         &battery->state.voltage,
+                                         &acpi_battery_smbus_err_handler);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_sbs_smbus_read_word() failed\n"));
+               goto end;
+       }
+
+       acpi_update_delay(battery->sbs);
+       result = acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x0a,
+                                         &battery->state.amperage,
+                                         &acpi_battery_smbus_err_handler);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_sbs_smbus_read_word() failed\n"));
+               goto end;
+       }
+
+       acpi_update_delay(battery->sbs);
+       result = acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x0f,
+                                         &battery->state.remaining_capacity,
+                                         &acpi_battery_smbus_err_handler);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_sbs_smbus_read_word() failed\n"));
+               goto end;
+       }
+
+       acpi_update_delay(battery->sbs);
+       result = acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x12,
+                                         &battery->state.average_time_to_empty,
+                                         &acpi_battery_smbus_err_handler);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_sbs_smbus_read_word() failed\n"));
+               goto end;
+       }
+
+       acpi_update_delay(battery->sbs);
+       result = acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x13,
+                                         &battery->state.average_time_to_full,
+                                         &acpi_battery_smbus_err_handler);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_sbs_smbus_read_word() failed\n"));
+               goto end;
+       }
+
+       acpi_update_delay(battery->sbs);
+       result = acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x16,
+                                         &battery->state.battery_status,
+                                         &acpi_battery_smbus_err_handler);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_sbs_smbus_read_word() failed\n"));
+               goto end;
+       }
+
+       acpi_update_delay(battery->sbs);
+
+      end:
+       return result;
+}
+
+static int acpi_battery_get_alarm(struct acpi_battery *battery)
+{
+       struct acpi_ec_smbus *smbus = battery->sbs->smbus;
+       int result = 0;
+
+       result = acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x01,
+                                         &battery->alarm.remaining_capacity,
+                                         &acpi_battery_smbus_err_handler);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_sbs_smbus_read_word() failed\n"));
+               goto end;
+       }
+
+       acpi_update_delay(battery->sbs);
+
+      end:
+
+       return result;
+}
+
+static int acpi_battery_set_alarm(struct acpi_battery *battery,
+                                 unsigned long alarm)
+{
+       struct acpi_ec_smbus *smbus = battery->sbs->smbus;
+       int result = 0;
+       s16 battery_mode;
+       int foo;
+
+       result = acpi_battery_select(battery);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_battery_select() failed\n"));
+               goto end;
+       }
+
+       /* If necessary, enable the alarm */
+
+       if (alarm > 0) {
+               result =
+                   acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x03,
+                                            &battery_mode,
+                                            &acpi_battery_smbus_err_handler);
+               if (result) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                         "acpi_sbs_smbus_read_word() failed\n"));
+                       goto end;
+               }
+
+               result =
+                   acpi_sbs_smbus_write_word(smbus, ACPI_SB_SMBUS_ADDR, 0x01,
+                                             battery_mode & 0xbfff,
+                                             &acpi_battery_smbus_err_handler);
+               if (result) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                         "acpi_sbs_smbus_write_word() failed\n"));
+                       goto end;
+               }
+       }
+
+       foo = alarm / (battery->info.capacity_mode ? 10 : 1);
+       result = acpi_sbs_smbus_write_word(smbus, ACPI_SB_SMBUS_ADDR, 0x01,
+                                          foo,
+                                          &acpi_battery_smbus_err_handler);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_sbs_smbus_write_word() failed\n"));
+               goto end;
+       }
+
+      end:
+
+       return result;
+}
+
+static int acpi_battery_set_mode(struct acpi_battery *battery)
+{
+       int result = 0;
+       s16 battery_mode;
+
+       if (capacity_mode == DEF_CAPACITY_UNIT) {
+               goto end;
+       }
+
+       result = acpi_sbs_smbus_read_word(battery->sbs->smbus,
+                                         ACPI_SB_SMBUS_ADDR, 0x03,
+                                         &battery_mode, NULL);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_sbs_smbus_read_word() failed\n"));
+               goto end;
+       }
+
+       if (capacity_mode == MAH_CAPACITY_UNIT) {
+               battery_mode &= 0x7fff;
+       } else {
+               battery_mode |= 0x8000;
+       }
+       result = acpi_sbs_smbus_write_word(battery->sbs->smbus,
+                                          ACPI_SB_SMBUS_ADDR, 0x03,
+                                          battery_mode, NULL);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_sbs_smbus_write_word() failed\n"));
+               goto end;
+       }
+
+       result = acpi_sbs_smbus_read_word(battery->sbs->smbus,
+                                         ACPI_SB_SMBUS_ADDR, 0x03,
+                                         &battery_mode, NULL);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_sbs_smbus_read_word() failed\n"));
+               goto end;
+       }
+
+      end:
+       return result;
+}
+
+static int acpi_battery_init(struct acpi_battery *battery)
+{
+       int result = 0;
+
+       result = acpi_battery_select(battery);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_battery_init() failed\n"));
+               goto end;
+       }
+
+       result = acpi_battery_set_mode(battery);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_battery_set_mode() failed\n"));
+               goto end;
+       }
+
+       result = acpi_battery_get_info(battery);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_battery_get_info() failed\n"));
+               goto end;
+       }
+
+       result = acpi_battery_get_state(battery);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_battery_get_state() failed\n"));
+               goto end;
+       }
+
+       result = acpi_battery_get_alarm(battery);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_battery_get_alarm() failed\n"));
+               goto end;
+       }
+
+      end:
+       return result;
+}
+
+static int acpi_ac_get_present(struct acpi_sbs *sbs)
+{
+       struct acpi_ec_smbus *smbus = sbs->smbus;
+       int result = 0;
+       s16 charger_status;
+
+       result = acpi_sbs_smbus_read_word(smbus, ACPI_SBC_SMBUS_ADDR, 0x13,
+                                         &charger_status, NULL);
+
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_sbs_smbus_read_word() failed\n"));
+               goto end;
+       }
+
+       sbs->ac_present = (charger_status & 0x8000) >> 15;
+
+      end:
+
+       return result;
+}
+
+/* --------------------------------------------------------------------------
+                              FS Interface (/proc/acpi)
+   -------------------------------------------------------------------------- */
+
+/* Generic Routines */
+
+static int
+acpi_sbs_generic_add_fs(struct proc_dir_entry **dir,
+                       struct proc_dir_entry *parent_dir,
+                       char *dir_name,
+                       struct file_operations *info_fops,
+                       struct file_operations *state_fops,
+                       struct file_operations *alarm_fops, void *data)
+{
+       struct proc_dir_entry *entry = NULL;
+
+       if (!*dir) {
+               *dir = proc_mkdir(dir_name, parent_dir);
+               if (!*dir) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                         "proc_mkdir() failed\n"));
+                       return -ENODEV;
+               }
+               (*dir)->owner = THIS_MODULE;
+       }
+
+       /* 'info' [R] */
+       if (info_fops) {
+               entry = create_proc_entry(ACPI_SBS_FILE_INFO, S_IRUGO, *dir);
+               if (!entry) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                         "create_proc_entry() failed\n"));
+               } else {
+                       entry->proc_fops = info_fops;
+                       entry->data = data;
+                       entry->owner = THIS_MODULE;
+               }
+       }
+
+       /* 'state' [R] */
+       if (state_fops) {
+               entry = create_proc_entry(ACPI_SBS_FILE_STATE, S_IRUGO, *dir);
+               if (!entry) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                         "create_proc_entry() failed\n"));
+               } else {
+                       entry->proc_fops = state_fops;
+                       entry->data = data;
+                       entry->owner = THIS_MODULE;
+               }
+       }
+
+       /* 'alarm' [R/W] */
+       if (alarm_fops) {
+               entry = create_proc_entry(ACPI_SBS_FILE_ALARM, S_IRUGO, *dir);
+               if (!entry) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                         "create_proc_entry() failed\n"));
+               } else {
+                       entry->proc_fops = alarm_fops;
+                       entry->data = data;
+                       entry->owner = THIS_MODULE;
+               }
+       }
+
+       return 0;
+}
+
+static void
+acpi_sbs_generic_remove_fs(struct proc_dir_entry **dir,
+                          struct proc_dir_entry *parent_dir)
+{
+
+       if (*dir) {
+               remove_proc_entry(ACPI_SBS_FILE_INFO, *dir);
+               remove_proc_entry(ACPI_SBS_FILE_STATE, *dir);
+               remove_proc_entry(ACPI_SBS_FILE_ALARM, *dir);
+               remove_proc_entry((*dir)->name, parent_dir);
+               *dir = NULL;
+       }
+
+}
+
+/* Smart Battery Interface */
+
+static struct proc_dir_entry *acpi_battery_dir = NULL;
+
+static int acpi_battery_read_info(struct seq_file *seq, void *offset)
+{
+       struct acpi_battery *battery = (struct acpi_battery *)seq->private;
+       int cscale;
+       int result = 0;
+
+       if (battery->sbs->zombie) {
+               return -ENODEV;
+       }
+
+       down(&sbs_sem);
+
+       if (update_mode == REQUEST_UPDATE_MODE) {
+               result = acpi_sbs_update_run(battery->sbs, DATA_TYPE_INFO);
+               if (result) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                         "acpi_sbs_update_run() failed\n"));
+               }
+       }
+
+       if (acpi_battery_is_present(battery)) {
+               seq_printf(seq, "present:                 yes\n");
+       } else {
+               seq_printf(seq, "present:                 no\n");
+               goto end;
+       }
+
+       if (battery->info.capacity_mode) {
+               cscale = battery->info.vscale * battery->info.ipscale;
+       } else {
+               cscale = battery->info.ipscale;
+       }
+       seq_printf(seq, "design capacity:         %i%s",
+                  battery->info.design_capacity * cscale,
+                  battery->info.capacity_mode ? "0 mWh\n" : " mAh\n");
+
+       seq_printf(seq, "last full capacity:      %i%s",
+                  battery->info.full_charge_capacity * cscale,
+                  battery->info.capacity_mode ? "0 mWh\n" : " mAh\n");
+
+       seq_printf(seq, "battery technology:      rechargeable\n");
+
+       seq_printf(seq, "design voltage:          %i mV\n",
+                  battery->info.design_voltage * battery->info.vscale);
+
+       seq_printf(seq, "design capacity warning: unknown\n");
+       seq_printf(seq, "design capacity low:     unknown\n");
+       seq_printf(seq, "capacity granularity 1:  unknown\n");
+       seq_printf(seq, "capacity granularity 2:  unknown\n");
+
+       seq_printf(seq, "model number:            %s\n",
+                  battery->info.device_name);
+
+       seq_printf(seq, "serial number:           %i\n",
+                  battery->info.serial_number);
+
+       seq_printf(seq, "battery type:            %s\n",
+                  battery->info.device_chemistry);
+
+       seq_printf(seq, "OEM info:                %s\n",
+                  battery->info.manufacturer_name);
+
+      end:
+
+       up(&sbs_sem);
+
+       return result;
+}
+
+static int acpi_battery_info_open_fs(struct inode *inode, struct file *file)
+{
+       return single_open(file, acpi_battery_read_info, PDE(inode)->data);
+}
+
+static int acpi_battery_read_state(struct seq_file *seq, void *offset)
+{
+       struct acpi_battery *battery = (struct acpi_battery *)seq->private;
+       int result = 0;
+       int cscale;
+       int foo;
+
+       if (battery->sbs->zombie) {
+               return -ENODEV;
+       }
+
+       down(&sbs_sem);
+
+       if (update_mode == REQUEST_UPDATE_MODE) {
+               result = acpi_sbs_update_run(battery->sbs, DATA_TYPE_STATE);
+               if (result) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                         "acpi_sbs_update_run() failed\n"));
+               }
+       }
+
+       if (acpi_battery_is_present(battery)) {
+               seq_printf(seq, "present:                 yes\n");
+       } else {
+               seq_printf(seq, "present:                 no\n");
+               goto end;
+       }
+
+       if (battery->info.capacity_mode) {
+               cscale = battery->info.vscale * battery->info.ipscale;
+       } else {
+               cscale = battery->info.ipscale;
+       }
+
+       if (battery->state.battery_status & 0x0010) {
+               seq_printf(seq, "capacity state:          critical\n");
+       } else {
+               seq_printf(seq, "capacity state:          ok\n");
+       }
+       if (battery->state.amperage < 0) {
+               seq_printf(seq, "charging state:          discharging\n");
+               foo = battery->state.remaining_capacity * cscale * 60 /
+                   (battery->state.average_time_to_empty == 0 ? 1 :
+                    battery->state.average_time_to_empty);
+               seq_printf(seq, "present rate:            %i%s\n",
+                          foo, battery->info.capacity_mode ? "0 mW" : " mA");
+       } else if (battery->state.amperage > 0) {
+               seq_printf(seq, "charging state:          charging\n");
+               foo = (battery->info.full_charge_capacity -
+                      battery->state.remaining_capacity) * cscale * 60 /
+                   (battery->state.average_time_to_full == 0 ? 1 :
+                    battery->state.average_time_to_full);
+               seq_printf(seq, "present rate:            %i%s\n",
+                          foo, battery->info.capacity_mode ? "0 mW" : " mA");
+       } else {
+               seq_printf(seq, "charging state:          charged\n");
+               seq_printf(seq, "present rate:            0 %s\n",
+                          battery->info.capacity_mode ? "mW" : "mA");
+       }
+
+       seq_printf(seq, "remaining capacity:      %i%s",
+                  battery->state.remaining_capacity * cscale,
+                  battery->info.capacity_mode ? "0 mWh\n" : " mAh\n");
+
+       seq_printf(seq, "present voltage:         %i mV\n",
+                  battery->state.voltage * battery->info.vscale);
+
+      end:
+
+       up(&sbs_sem);
+
+       return result;
+}
+
+static int acpi_battery_state_open_fs(struct inode *inode, struct file *file)
+{
+       return single_open(file, acpi_battery_read_state, PDE(inode)->data);
+}
+
+static int acpi_battery_read_alarm(struct seq_file *seq, void *offset)
+{
+       struct acpi_battery *battery = (struct acpi_battery *)seq->private;
+       int result = 0;
+       int cscale;
+
+       if (battery->sbs->zombie) {
+               return -ENODEV;
+       }
+
+       down(&sbs_sem);
+
+       if (update_mode == REQUEST_UPDATE_MODE) {
+               result = acpi_sbs_update_run(battery->sbs, DATA_TYPE_ALARM);
+               if (result) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                         "acpi_sbs_update_run() failed\n"));
+               }
+       }
+
+       if (!acpi_battery_is_present(battery)) {
+               seq_printf(seq, "present:                 no\n");
+               goto end;
+       }
+
+       if (battery->info.capacity_mode) {
+               cscale = battery->info.vscale * battery->info.ipscale;
+       } else {
+               cscale = battery->info.ipscale;
+       }
+
+       seq_printf(seq, "alarm:                   ");
+       if (battery->alarm.remaining_capacity) {
+               seq_printf(seq, "%i%s",
+                          battery->alarm.remaining_capacity * cscale,
+                          battery->info.capacity_mode ? "0 mWh\n" : " mAh\n");
+       } else {
+               seq_printf(seq, "disabled\n");
+       }
+
+      end:
+
+       up(&sbs_sem);
+
+       return result;
+}
+
+static ssize_t
+acpi_battery_write_alarm(struct file *file, const char __user * buffer,
+                        size_t count, loff_t * ppos)
+{
+       struct seq_file *seq = (struct seq_file *)file->private_data;
+       struct acpi_battery *battery = (struct acpi_battery *)seq->private;
+       char alarm_string[12] = { '\0' };
+       int result, old_alarm, new_alarm;
+
+       if (battery->sbs->zombie) {
+               return -ENODEV;
+       }
+
+       down(&sbs_sem);
+
+       if (!acpi_battery_is_present(battery)) {
+               result = -ENODEV;
+               goto end;
+       }
+
+       if (count > sizeof(alarm_string) - 1) {
+               result = -EINVAL;
+               goto end;
+       }
+
+       if (copy_from_user(alarm_string, buffer, count)) {
+               result = -EFAULT;
+               goto end;
+       }
+
+       alarm_string[count] = 0;
+
+       old_alarm = battery->alarm.remaining_capacity;
+       new_alarm = simple_strtoul(alarm_string, NULL, 0);
+
+       result = acpi_battery_set_alarm(battery, new_alarm);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_battery_set_alarm() failed\n"));
+               (void)acpi_battery_set_alarm(battery, old_alarm);
+               goto end;
+       }
+       result = acpi_battery_get_alarm(battery);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_battery_get_alarm() failed\n"));
+               (void)acpi_battery_set_alarm(battery, old_alarm);
+               goto end;
+       }
+
+      end:
+       up(&sbs_sem);
+
+       if (result) {
+               return result;
+       } else {
+               return count;
+       }
+}
+
+static int acpi_battery_alarm_open_fs(struct inode *inode, struct file *file)
+{
+       return single_open(file, acpi_battery_read_alarm, PDE(inode)->data);
+}
+
+static struct file_operations acpi_battery_info_fops = {
+       .open = acpi_battery_info_open_fs,
+       .read = seq_read,
+       .llseek = seq_lseek,
+       .release = single_release,
+       .owner = THIS_MODULE,
+};
+
+static struct file_operations acpi_battery_state_fops = {
+       .open = acpi_battery_state_open_fs,
+       .read = seq_read,
+       .llseek = seq_lseek,
+       .release = single_release,
+       .owner = THIS_MODULE,
+};
+
+static struct file_operations acpi_battery_alarm_fops = {
+       .open = acpi_battery_alarm_open_fs,
+       .read = seq_read,
+       .write = acpi_battery_write_alarm,
+       .llseek = seq_lseek,
+       .release = single_release,
+       .owner = THIS_MODULE,
+};
+
+/* Legacy AC Adapter Interface */
+
+static struct proc_dir_entry *acpi_ac_dir = NULL;
+
+static int acpi_ac_read_state(struct seq_file *seq, void *offset)
+{
+       struct acpi_sbs *sbs = (struct acpi_sbs *)seq->private;
+       int result;
+
+       if (sbs->zombie) {
+               return -ENODEV;
+       }
+
+       down(&sbs_sem);
+
+       if (update_mode == REQUEST_UPDATE_MODE) {
+               result = acpi_sbs_update_run(sbs, DATA_TYPE_AC_STATE);
+               if (result) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                         "acpi_sbs_update_run() failed\n"));
+               }
+       }
+
+       seq_printf(seq, "state:                   %s\n",
+                  sbs->ac_present ? "on-line" : "off-line");
+
+       up(&sbs_sem);
+
+       return 0;
+}
+
+static int acpi_ac_state_open_fs(struct inode *inode, struct file *file)
+{
+       return single_open(file, acpi_ac_read_state, PDE(inode)->data);
+}
+
+static struct file_operations acpi_ac_state_fops = {
+       .open = acpi_ac_state_open_fs,
+       .read = seq_read,
+       .llseek = seq_lseek,
+       .release = single_release,
+       .owner = THIS_MODULE,
+};
+
+/* --------------------------------------------------------------------------
+                                 Driver Interface
+   -------------------------------------------------------------------------- */
+
+/* Smart Battery */
+
+static int acpi_battery_add(struct acpi_sbs *sbs, int id)
+{
+       int is_present;
+       int result;
+       char dir_name[32];
+       struct acpi_battery *battery;
+
+       battery = &sbs->battery[id];
+
+       battery->alive = 0;
+
+       battery->init_state = 0;
+       battery->id = id;
+       battery->sbs = sbs;
+
+       result = acpi_battery_select(battery);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_battery_select() failed\n"));
+               goto end;
+       }
+
+       result = acpi_battery_get_present(battery);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_battery_get_present() failed\n"));
+               goto end;
+       }
+
+       is_present = acpi_battery_is_present(battery);
+
+       if (is_present) {
+               result = acpi_battery_init(battery);
+               if (result) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                         "acpi_battery_init() failed\n"));
+                       goto end;
+               }
+               battery->init_state = 1;
+       }
+
+       (void)sprintf(dir_name, ACPI_BATTERY_DIR_NAME, id);
+
+       result = acpi_sbs_generic_add_fs(&battery->battery_entry,
+                                        acpi_battery_dir,
+                                        dir_name,
+                                        &acpi_battery_info_fops,
+                                        &acpi_battery_state_fops,
+                                        &acpi_battery_alarm_fops, battery);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_sbs_generic_add_fs() failed\n"));
+               goto end;
+       }
+       battery->alive = 1;
+
+      end:
+       return result;
+}
+
+static void acpi_battery_remove(struct acpi_sbs *sbs, int id)
+{
+
+       if (sbs->battery[id].battery_entry) {
+               acpi_sbs_generic_remove_fs(&(sbs->battery[id].battery_entry),
+                                          acpi_battery_dir);
+       }
+}
+
+static int acpi_ac_add(struct acpi_sbs *sbs)
+{
+       int result;
+
+       result = acpi_ac_get_present(sbs);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_ac_get_present() failed\n"));
+               goto end;
+       }
+
+       result = acpi_sbs_generic_add_fs(&sbs->ac_entry,
+                                        acpi_ac_dir,
+                                        ACPI_AC_DIR_NAME,
+                                        NULL, &acpi_ac_state_fops, NULL, sbs);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_sbs_generic_add_fs() failed\n"));
+               goto end;
+       }
+
+      end:
+
+       return result;
+}
+
+static void acpi_ac_remove(struct acpi_sbs *sbs)
+{
+
+       if (sbs->ac_entry) {
+               acpi_sbs_generic_remove_fs(&sbs->ac_entry, acpi_ac_dir);
+       }
+}
+
+static void acpi_sbs_update_queue_run(unsigned long data)
+{
+       acpi_os_execute(OSL_GPE_HANDLER, acpi_sbs_update_queue, (void *)data);
+}
+
+static int acpi_sbs_update_run(struct acpi_sbs *sbs, int data_type)
+{
+       struct acpi_battery *battery;
+       int result = 0;
+       int old_ac_present;
+       int old_battery_present;
+       int new_ac_present;
+       int new_battery_present;
+       int id;
+       char dir_name[32];
+       int do_battery_init, do_ac_init;
+       s16 old_remaining_capacity;
+
+       if (sbs->zombie) {
+               goto end;
+       }
+
+       old_ac_present = acpi_ac_is_present(sbs);
+
+       result = acpi_ac_get_present(sbs);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_ac_get_present() failed\n"));
+       }
+
+       new_ac_present = acpi_ac_is_present(sbs);
+
+       do_ac_init = (old_ac_present != new_ac_present);
+
+       if (data_type == DATA_TYPE_AC_STATE) {
+               goto end;
+       }
+
+       for (id = 0; id < MAX_SBS_BAT; id++) {
+               battery = &sbs->battery[id];
+               if (battery->alive == 0) {
+                       continue;
+               }
+
+               old_remaining_capacity = battery->state.remaining_capacity;
+
+               old_battery_present = acpi_battery_is_present(battery);
+
+               result = acpi_battery_select(battery);
+               if (result) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                         "acpi_battery_select() failed\n"));
+               }
+               if (sbs->zombie) {
+                       goto end;
+               }
+
+               result = acpi_battery_get_present(battery);
+               if (result) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                         "acpi_battery_get_present() failed\n"));
+               }
+               if (sbs->zombie) {
+                       goto end;
+               }
+
+               new_battery_present = acpi_battery_is_present(battery);
+
+               do_battery_init = ((old_battery_present != new_battery_present)
+                                  && new_battery_present);
+
+               if (sbs->zombie) {
+                       goto end;
+               }
+               if (do_ac_init || do_battery_init ||
+                   update_info_mode || sbs->update_info_mode) {
+                       if (sbs->update_info_mode) {
+                               sbs->update_info_mode = 0;
+                       } else {
+                               sbs->update_info_mode = 1;
+                       }
+                       result = acpi_battery_init(battery);
+                       if (result) {
+                               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                                 "acpi_battery_init() "
+                                                 "failed\n"));
+                       }
+               }
+               if (data_type == DATA_TYPE_INFO) {
+                       continue;
+               }
+
+               if (sbs->zombie) {
+                       goto end;
+               }
+               if (new_battery_present) {
+                       result = acpi_battery_get_alarm(battery);
+                       if (result) {
+                               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                                 "acpi_battery_get_alarm() "
+                                                 "failed\n"));
+                       }
+                       if (data_type == DATA_TYPE_ALARM) {
+                               continue;
+                       }
+
+                       result = acpi_battery_get_state(battery);
+                       if (result) {
+                               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                                 "acpi_battery_get_state() "
+                                                 "failed\n"));
+                       }
+               }
+               if (sbs->zombie) {
+                       goto end;
+               }
+               if (data_type != DATA_TYPE_COMMON) {
+                       continue;
+               }
+
+               if (old_battery_present != new_battery_present) {
+                       (void)sprintf(dir_name, ACPI_BATTERY_DIR_NAME, id);
+                       result = acpi_sbs_generate_event(sbs->device,
+                                                        ACPI_SBS_BATTERY_NOTIFY_STATUS,
+                                                        new_battery_present,
+                                                        dir_name,
+                                                        ACPI_BATTERY_CLASS);
+                       if (result) {
+                               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                                 "acpi_sbs_generate_event() "
+                                                 "failed\n"));
+                       }
+               }
+               if (old_remaining_capacity != battery->state.remaining_capacity) {
+                       (void)sprintf(dir_name, ACPI_BATTERY_DIR_NAME, id);
+                       result = acpi_sbs_generate_event(sbs->device,
+                                                        ACPI_SBS_BATTERY_NOTIFY_STATUS,
+                                                        new_battery_present,
+                                                        dir_name,
+                                                        ACPI_BATTERY_CLASS);
+                       if (result) {
+                               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                                 "acpi_sbs_generate_event() failed\n"));
+                       }
+               }
+
+       }
+       if (sbs->zombie) {
+               goto end;
+       }
+       if (data_type != DATA_TYPE_COMMON) {
+               goto end;
+       }
+
+       if (old_ac_present != new_ac_present) {
+               result = acpi_sbs_generate_event(sbs->device,
+                                                ACPI_SBS_AC_NOTIFY_STATUS,
+                                                new_ac_present,
+                                                ACPI_AC_DIR_NAME,
+                                                ACPI_AC_CLASS);
+               if (result) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                         "acpi_sbs_generate_event() failed\n"));
+               }
+       }
+
+      end:
+       return result;
+}
+
+static void acpi_sbs_update_queue(void *data)
+{
+       struct acpi_sbs *sbs = data;
+       unsigned long delay = -1;
+       int result;
+
+       if (sbs->zombie) {
+               goto end;
+       }
+
+       result = acpi_sbs_update_run(sbs, DATA_TYPE_COMMON);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_sbs_update_run() failed\n"));
+       }
+
+       if (sbs->zombie) {
+               goto end;
+       }
+
+       if (update_mode == REQUEST_UPDATE_MODE) {
+               goto end;
+       }
+
+       delay = jiffies + HZ * update_time;
+       sbs->update_timer.data = (unsigned long)data;
+       sbs->update_timer.function = acpi_sbs_update_queue_run;
+       sbs->update_timer.expires = delay;
+       add_timer(&sbs->update_timer);
+      end:
+       ;
+}
+
+static int acpi_sbs_add(struct acpi_device *device)
+{
+       struct acpi_sbs *sbs = NULL;
+       struct acpi_ec_hc *ec_hc = NULL;
+       int result, remove_result = 0;
+       unsigned long sbs_obj;
+       int id, cnt;
+       acpi_status status = AE_OK;
+
+       sbs = kmalloc(sizeof(struct acpi_sbs), GFP_KERNEL);
+       if (!sbs) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "kmalloc() failed\n"));
+               return -ENOMEM;
+       }
+       memset(sbs, 0, sizeof(struct acpi_sbs));
+
+       cnt = 0;
+       while (cnt < 10) {
+               cnt++;
+               ec_hc = acpi_get_ec_hc(device);
+               if (ec_hc) {
+                       break;
+               }
+               msleep(1000);
+       }
+
+       if (!ec_hc) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_get_ec_hc() failed: "
+                                 "NO driver found for EC HC SMBus\n"));
+               result = -ENODEV;
+               goto end;
+       }
+
+       sbs->device = device;
+       sbs->smbus = ec_hc->smbus;
+
+       strcpy(acpi_device_name(device), ACPI_SBS_DEVICE_NAME);
+       strcpy(acpi_device_class(device), ACPI_SBS_CLASS);
+       acpi_driver_data(device) = sbs;
+
+       sbs->update_time = 0;
+       sbs->update_time2 = 0;
+
+       result = acpi_ac_add(sbs);
+       if (result) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "acpi_ac_add() failed\n"));
+               goto end;
+       }
+       result = acpi_evaluate_integer(device->handle, "_SBS", NULL, &sbs_obj);
+       if (ACPI_FAILURE(result)) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_evaluate_integer() failed\n"));
+               result = -EIO;
+               goto end;
+       }
+
+       if (sbs_obj > 0) {
+               result = acpi_sbsm_get_info(sbs);
+               if (result) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                         "acpi_sbsm_get_info() failed\n"));
+                       goto end;
+               }
+               sbs->sbsm_present = 1;
+       }
+       if (sbs->sbsm_present == 0) {
+               result = acpi_battery_add(sbs, 0);
+               if (result) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                         "acpi_battery_add() failed\n"));
+                       goto end;
+               }
+       } else {
+               for (id = 0; id < MAX_SBS_BAT; id++) {
+                       if ((sbs->sbsm_batteries_supported & (1 << id))) {
+                               result = acpi_battery_add(sbs, id);
+                               if (result) {
+                                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                                         "acpi_battery_add() "
+                                                         "failed\n"));
+                                       goto end;
+                               }
+                       }
+               }
+       }
+
+       sbs->handle = device->handle;
+
+       init_timer(&sbs->update_timer);
+       if (update_mode == QUEUE_UPDATE_MODE) {
+               status = acpi_os_execute(OSL_GPE_HANDLER,
+                                        acpi_sbs_update_queue, (void *)sbs);
+               if (status != AE_OK) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                         "acpi_os_execute() failed\n"));
+               }
+       }
+       sbs->update_time = update_time;
+       sbs->update_time2 = update_time2;
+
+       printk(KERN_INFO PREFIX "%s [%s]\n",
+              acpi_device_name(device), acpi_device_bid(device));
+
+      end:
+       if (result) {
+               remove_result = acpi_sbs_remove(device, 0);
+               if (remove_result) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                         "acpi_sbs_remove() failed\n"));
+               }
+       }
+
+       return result;
+}
+
+int acpi_sbs_remove(struct acpi_device *device, int type)
+{
+       struct acpi_sbs *sbs = (struct acpi_sbs *)acpi_driver_data(device);
+       int id;
+
+       if (!device || !sbs) {
+               return -EINVAL;
+       }
+
+       sbs->zombie = 1;
+       sbs->update_time = 0;
+       sbs->update_time2 = 0;
+       del_timer_sync(&sbs->update_timer);
+       acpi_os_wait_events_complete(NULL);
+       del_timer_sync(&sbs->update_timer);
+
+       for (id = 0; id < MAX_SBS_BAT; id++) {
+               acpi_battery_remove(sbs, id);
+       }
+
+       acpi_ac_remove(sbs);
+
+       kfree(sbs);
+
+       return 0;
+}
+
+static int __init acpi_sbs_init(void)
+{
+       int result = 0;
+
+       init_MUTEX(&sbs_sem);
+
+       if (capacity_mode != DEF_CAPACITY_UNIT
+           && capacity_mode != MAH_CAPACITY_UNIT
+           && capacity_mode != MWH_CAPACITY_UNIT) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "acpi_sbs_init: "
+                                 "invalid capacity_mode = %d\n",
+                                 capacity_mode));
+               return -EINVAL;
+       }
+
+       acpi_ac_dir = acpi_lock_ac_dir();
+       if (!acpi_ac_dir) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_lock_ac_dir() failed\n"));
+               return -ENODEV;
+       }
+
+       acpi_battery_dir = acpi_lock_battery_dir();
+       if (!acpi_battery_dir) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_lock_battery_dir() failed\n"));
+               return -ENODEV;
+       }
+
+       result = acpi_bus_register_driver(&acpi_sbs_driver);
+       if (result < 0) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "acpi_bus_register_driver() failed\n"));
+               return -ENODEV;
+       }
+
+       return 0;
+}
+
+static void __exit acpi_sbs_exit(void)
+{
+
+       acpi_bus_unregister_driver(&acpi_sbs_driver);
+
+       acpi_unlock_ac_dir(acpi_ac_dir);
+       acpi_ac_dir = NULL;
+       acpi_unlock_battery_dir(acpi_battery_dir);
+       acpi_battery_dir = NULL;
+
+       return;
+}
+
+module_init(acpi_sbs_init);
+module_exit(acpi_sbs_exit);
index f8316a05ede72fe459a66341343f5cd40fa6ae09..5fcb50c7b77802d135cbbe1368f96e8fabd6877e 100644 (file)
@@ -162,11 +162,10 @@ static void acpi_device_unregister(struct acpi_device *device, int type)
 
 void acpi_bus_data_handler(acpi_handle handle, u32 function, void *context)
 {
-       ACPI_FUNCTION_TRACE("acpi_bus_data_handler");
 
        /* TBD */
 
-       return_VOID;
+       return;
 }
 
 static int acpi_bus_get_power_flags(struct acpi_device *device)
@@ -175,7 +174,6 @@ static int acpi_bus_get_power_flags(struct acpi_device *device)
        acpi_handle handle = NULL;
        u32 i = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_bus_get_power_flags");
 
        /*
         * Power Management Flags
@@ -228,7 +226,7 @@ static int acpi_bus_get_power_flags(struct acpi_device *device)
 
        device->power.state = ACPI_STATE_UNKNOWN;
 
-       return_VALUE(0);
+       return 0;
 }
 
 int acpi_match_ids(struct acpi_device *device, char *ids)
@@ -306,24 +304,22 @@ static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device)
        struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
        union acpi_object *package = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_bus_get_wakeup_flags");
 
        /* _PRW */
        status = acpi_evaluate_object(device->handle, "_PRW", NULL, &buffer);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PRW\n"));
+               ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRW"));
                goto end;
        }
 
        package = (union acpi_object *)buffer.pointer;
        status = acpi_bus_extract_wakeup_device_power_package(device, package);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Error extracting _PRW package\n"));
+               ACPI_EXCEPTION((AE_INFO, status, "Extracting _PRW package"));
                goto end;
        }
 
-       acpi_os_free(buffer.pointer);
+       kfree(buffer.pointer);
 
        device->wakeup.flags.valid = 1;
        /* Power button, Lid switch always enable wakeup */
@@ -333,7 +329,7 @@ static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device)
       end:
        if (ACPI_FAILURE(status))
                device->flags.wake_capable = 0;
-       return_VALUE(0);
+       return 0;
 }
 
 /* --------------------------------------------------------------------------
@@ -489,19 +485,18 @@ acpi_bus_driver_init(struct acpi_device *device, struct acpi_driver *driver)
 {
        int result = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_bus_driver_init");
 
        if (!device || !driver)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (!driver->ops.add)
-               return_VALUE(-ENOSYS);
+               return -ENOSYS;
 
        result = driver->ops.add(device);
        if (result) {
                device->driver = NULL;
                acpi_driver_data(device) = NULL;
-               return_VALUE(result);
+               return result;
        }
 
        device->driver = driver;
@@ -513,7 +508,7 @@ acpi_bus_driver_init(struct acpi_device *device, struct acpi_driver *driver)
 
        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                          "Driver successfully bound to device\n"));
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_start_single_object(struct acpi_device *device)
@@ -521,10 +516,9 @@ static int acpi_start_single_object(struct acpi_device *device)
        int result = 0;
        struct acpi_driver *driver;
 
-       ACPI_FUNCTION_TRACE("acpi_start_single_object");
 
        if (!(driver = device->driver))
-               return_VALUE(0);
+               return 0;
 
        if (driver->ops.start) {
                result = driver->ops.start(device);
@@ -532,14 +526,13 @@ static int acpi_start_single_object(struct acpi_device *device)
                        driver->ops.remove(device, ACPI_BUS_REMOVAL_NORMAL);
        }
 
-       return_VALUE(result);
+       return result;
 }
 
 static void acpi_driver_attach(struct acpi_driver *drv)
 {
        struct list_head *node, *next;
 
-       ACPI_FUNCTION_TRACE("acpi_driver_attach");
 
        spin_lock(&acpi_device_lock);
        list_for_each_safe(node, next, &acpi_device_list) {
@@ -568,7 +561,6 @@ static void acpi_driver_detach(struct acpi_driver *drv)
 {
        struct list_head *node, *next;
 
-       ACPI_FUNCTION_TRACE("acpi_driver_detach");
 
        spin_lock(&acpi_device_lock);
        list_for_each_safe(node, next, &acpi_device_list) {
@@ -598,17 +590,16 @@ static void acpi_driver_detach(struct acpi_driver *drv)
  */
 int acpi_bus_register_driver(struct acpi_driver *driver)
 {
-       ACPI_FUNCTION_TRACE("acpi_bus_register_driver");
 
        if (acpi_disabled)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        spin_lock(&acpi_device_lock);
        list_add_tail(&driver->node, &acpi_bus_drivers);
        spin_unlock(&acpi_device_lock);
        acpi_driver_attach(driver);
 
-       return_VALUE(0);
+       return 0;
 }
 
 EXPORT_SYMBOL(acpi_bus_register_driver);
@@ -646,7 +637,6 @@ static int acpi_bus_find_driver(struct acpi_device *device)
        int result = 0;
        struct list_head *node, *next;
 
-       ACPI_FUNCTION_TRACE("acpi_bus_find_driver");
 
        spin_lock(&acpi_device_lock);
        list_for_each_safe(node, next, &acpi_bus_drivers) {
@@ -666,19 +656,41 @@ static int acpi_bus_find_driver(struct acpi_device *device)
        spin_unlock(&acpi_device_lock);
 
       Done:
-       return_VALUE(result);
+       return result;
 }
 
 /* --------------------------------------------------------------------------
                                  Device Enumeration
    -------------------------------------------------------------------------- */
 
+acpi_status
+acpi_bus_get_ejd(acpi_handle handle, acpi_handle *ejd)
+{
+       acpi_status status;
+       acpi_handle tmp;
+       struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
+       union acpi_object *obj;
+
+       status = acpi_get_handle(handle, "_EJD", &tmp);
+       if (ACPI_FAILURE(status))
+               return status;
+
+       status = acpi_evaluate_object(handle, "_EJD", NULL, &buffer);
+       if (ACPI_SUCCESS(status)) {
+               obj = buffer.pointer;
+               status = acpi_get_handle(NULL, obj->string.pointer, ejd);
+               kfree(buffer.pointer);
+       }
+       return status;
+}
+EXPORT_SYMBOL_GPL(acpi_bus_get_ejd);
+
+
 static int acpi_bus_get_flags(struct acpi_device *device)
 {
        acpi_status status = AE_OK;
        acpi_handle temp = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_bus_get_flags");
 
        /* Presence of _STA indicates 'dynamic_status' */
        status = acpi_get_handle(device->handle, "_STA", &temp);
@@ -724,7 +736,7 @@ static int acpi_bus_get_flags(struct acpi_device *device)
 
        /* TBD: Peformance management */
 
-       return_VALUE(0);
+       return 0;
 }
 
 static void acpi_device_get_busid(struct acpi_device *device,
@@ -842,7 +854,7 @@ static void acpi_device_set_id(struct acpi_device *device,
                        printk(KERN_ERR "Memory allocation error\n");
        }
 
-       acpi_os_free(buffer.pointer);
+       kfree(buffer.pointer);
 }
 
 static int acpi_device_set_context(struct acpi_device *device, int type)
@@ -918,10 +930,9 @@ static int acpi_bus_remove(struct acpi_device *dev, int rmdevice)
        int result = 0;
        struct acpi_driver *driver;
 
-       ACPI_FUNCTION_TRACE("acpi_bus_remove");
 
        if (!dev)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        driver = dev->driver;
 
@@ -930,12 +941,12 @@ static int acpi_bus_remove(struct acpi_device *dev, int rmdevice)
                if (driver->ops.stop) {
                        result = driver->ops.stop(dev, ACPI_BUS_REMOVAL_EJECT);
                        if (result)
-                               return_VALUE(result);
+                               return result;
                }
 
                result = dev->driver->ops.remove(dev, ACPI_BUS_REMOVAL_EJECT);
                if (result) {
-                       return_VALUE(result);
+                       return result;
                }
 
                atomic_dec(&dev->driver->references);
@@ -944,7 +955,7 @@ static int acpi_bus_remove(struct acpi_device *dev, int rmdevice)
        }
 
        if (!rmdevice)
-               return_VALUE(0);
+               return 0;
 
        if (dev->flags.bus_address) {
                if ((dev->parent) && (dev->parent->ops.unbind))
@@ -953,7 +964,7 @@ static int acpi_bus_remove(struct acpi_device *dev, int rmdevice)
 
        acpi_device_unregister(dev, ACPI_BUS_REMOVAL_EJECT);
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int
@@ -963,15 +974,14 @@ acpi_add_single_object(struct acpi_device **child,
        int result = 0;
        struct acpi_device *device = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_add_single_object");
 
        if (!child)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        device = kmalloc(sizeof(struct acpi_device), GFP_KERNEL);
        if (!device) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Memory allocation error\n"));
-               return_VALUE(-ENOMEM);
+               printk(KERN_ERR PREFIX "Memory allocation error\n");
+               return -ENOMEM;
        }
        memset(device, 0, sizeof(struct acpi_device));
 
@@ -1096,7 +1106,7 @@ acpi_add_single_object(struct acpi_device **child,
                kfree(device);
        }
 
-       return_VALUE(result);
+       return result;
 }
 
 static int acpi_bus_scan(struct acpi_device *start, struct acpi_bus_ops *ops)
@@ -1109,10 +1119,9 @@ static int acpi_bus_scan(struct acpi_device *start, struct acpi_bus_ops *ops)
        acpi_object_type type = 0;
        u32 level = 1;
 
-       ACPI_FUNCTION_TRACE("acpi_bus_scan");
 
        if (!start)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        parent = start;
        phandle = start->handle;
@@ -1209,7 +1218,7 @@ static int acpi_bus_scan(struct acpi_device *start, struct acpi_bus_ops *ops)
                }
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 int
@@ -1219,7 +1228,6 @@ acpi_bus_add(struct acpi_device **child,
        int result;
        struct acpi_bus_ops ops;
 
-       ACPI_FUNCTION_TRACE("acpi_bus_add");
 
        result = acpi_add_single_object(child, parent, handle, type);
        if (!result) {
@@ -1227,7 +1235,7 @@ acpi_bus_add(struct acpi_device **child,
                ops.acpi_op_add = 1;
                result = acpi_bus_scan(*child, &ops);
        }
-       return_VALUE(result);
+       return result;
 }
 
 EXPORT_SYMBOL(acpi_bus_add);
@@ -1237,10 +1245,9 @@ int acpi_bus_start(struct acpi_device *device)
        int result;
        struct acpi_bus_ops ops;
 
-       ACPI_FUNCTION_TRACE("acpi_bus_start");
 
        if (!device)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        result = acpi_start_single_object(device);
        if (!result) {
@@ -1248,7 +1255,7 @@ int acpi_bus_start(struct acpi_device *device)
                ops.acpi_op_start = 1;
                result = acpi_bus_scan(device, &ops);
        }
-       return_VALUE(result);
+       return result;
 }
 
 EXPORT_SYMBOL(acpi_bus_start);
@@ -1314,10 +1321,9 @@ static int acpi_bus_scan_fixed(struct acpi_device *root)
        int result = 0;
        struct acpi_device *device = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_bus_scan_fixed");
 
        if (!root)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        /*
         * Enumerate all fixed-feature devices.
@@ -1338,7 +1344,7 @@ static int acpi_bus_scan_fixed(struct acpi_device *root)
                        result = acpi_start_single_object(device);
        }
 
-       return_VALUE(result);
+       return result;
 }
 
 
@@ -1427,7 +1433,7 @@ static int acpi_device_resume(struct device * dev)
 }
 
 
-struct bus_type acpi_bus_type = {
+static struct bus_type acpi_bus_type = {
        .name           = "acpi",
        .suspend        = acpi_device_suspend,
        .resume         = acpi_device_resume,
@@ -1440,10 +1446,9 @@ static int __init acpi_scan_init(void)
        int result;
        struct acpi_bus_ops ops;
 
-       ACPI_FUNCTION_TRACE("acpi_scan_init");
 
        if (acpi_disabled)
-               return_VALUE(0);
+               return 0;
 
        kset_register(&acpi_namespace_kset);
 
@@ -1488,7 +1493,7 @@ static int __init acpi_scan_init(void)
                acpi_device_unregister(acpi_root, ACPI_BUS_REMOVAL_NORMAL);
 
       Done:
-       return_VALUE(result);
+       return result;
 }
 
 subsys_initcall(acpi_scan_init);
index a934ac42178d44d39e8891733b655c4648c92335..c3bb7faad75ee59e613c2d93bf2280051c64b344 100644 (file)
@@ -47,10 +47,9 @@ extern struct fadt_descriptor acpi_fadt;
 
 static int acpi_system_read_info(struct seq_file *seq, void *offset)
 {
-       ACPI_FUNCTION_TRACE("acpi_system_read_info");
 
        seq_printf(seq, "version:                 %x\n", ACPI_CA_VERSION);
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_system_info_open_fs(struct inode *inode, struct file *file)
@@ -80,17 +79,16 @@ acpi_system_read_dsdt(struct file *file,
        struct acpi_buffer dsdt = { ACPI_ALLOCATE_BUFFER, NULL };
        ssize_t res;
 
-       ACPI_FUNCTION_TRACE("acpi_system_read_dsdt");
 
        status = acpi_get_table(ACPI_TABLE_ID_DSDT, 1, &dsdt);
        if (ACPI_FAILURE(status))
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        res = simple_read_from_buffer(buffer, count, ppos,
                                      dsdt.pointer, dsdt.length);
-       acpi_os_free(dsdt.pointer);
+       kfree(dsdt.pointer);
 
-       return_VALUE(res);
+       return res;
 }
 
 static ssize_t acpi_system_read_fadt(struct file *, char __user *, size_t,
@@ -108,17 +106,16 @@ acpi_system_read_fadt(struct file *file,
        struct acpi_buffer fadt = { ACPI_ALLOCATE_BUFFER, NULL };
        ssize_t res;
 
-       ACPI_FUNCTION_TRACE("acpi_system_read_fadt");
 
        status = acpi_get_table(ACPI_TABLE_ID_FADT, 1, &fadt);
        if (ACPI_FAILURE(status))
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        res = simple_read_from_buffer(buffer, count, ppos,
                                      fadt.pointer, fadt.length);
-       acpi_os_free(fadt.pointer);
+       kfree(fadt.pointer);
 
-       return_VALUE(res);
+       return res;
 }
 
 static int __init acpi_system_init(void)
@@ -127,10 +124,9 @@ static int __init acpi_system_init(void)
        int error = 0;
        char *name;
 
-       ACPI_FUNCTION_TRACE("acpi_system_init");
 
        if (acpi_disabled)
-               return_VALUE(0);
+               return 0;
 
        /* 'info' [R] */
        name = ACPI_SYSTEM_FILE_INFO;
@@ -158,12 +154,9 @@ static int __init acpi_system_init(void)
                goto Error;
 
       Done:
-       return_VALUE(error);
+       return error;
 
       Error:
-       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                         "Unable to create '%s' proc fs entry\n", name));
-
        remove_proc_entry(ACPI_SYSTEM_FILE_FADT, acpi_root_dir);
        remove_proc_entry(ACPI_SYSTEM_FILE_DSDT, acpi_root_dir);
        remove_proc_entry(ACPI_SYSTEM_FILE_INFO, acpi_root_dir);
index ed5e8816d83d4c5e9fe03ce20cd754dc1de97739..bfb3bfcf9e91017a4d35ec51b073076c7f724829 100644 (file)
@@ -23,7 +23,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index e7fe3a14fdafd46e88851f348657835555e7e484..503c0b99db122814e9c30767e5358ab226d9cdac 100644 (file)
@@ -162,7 +162,7 @@ struct acpi_thermal_flags {
 };
 
 struct acpi_thermal {
-       acpi_handle handle;
+       struct acpi_device * device;
        acpi_bus_id name;
        unsigned long temperature;
        unsigned long last_temperature;
@@ -222,51 +222,48 @@ static int acpi_thermal_get_temperature(struct acpi_thermal *tz)
 {
        acpi_status status = AE_OK;
 
-       ACPI_FUNCTION_TRACE("acpi_thermal_get_temperature");
 
        if (!tz)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        tz->last_temperature = tz->temperature;
 
        status =
-           acpi_evaluate_integer(tz->handle, "_TMP", NULL, &tz->temperature);
+           acpi_evaluate_integer(tz->device->handle, "_TMP", NULL, &tz->temperature);
        if (ACPI_FAILURE(status))
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Temperature is %lu dK\n",
                          tz->temperature));
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_thermal_get_polling_frequency(struct acpi_thermal *tz)
 {
        acpi_status status = AE_OK;
 
-       ACPI_FUNCTION_TRACE("acpi_thermal_get_polling_frequency");
 
        if (!tz)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        status =
-           acpi_evaluate_integer(tz->handle, "_TZP", NULL,
+           acpi_evaluate_integer(tz->device->handle, "_TZP", NULL,
                                  &tz->polling_frequency);
        if (ACPI_FAILURE(status))
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Polling frequency is %lu dS\n",
                          tz->polling_frequency));
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_thermal_set_polling(struct acpi_thermal *tz, int seconds)
 {
-       ACPI_FUNCTION_TRACE("acpi_thermal_set_polling");
 
        if (!tz)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        tz->polling_frequency = seconds * 10;   /* Convert value to deci-seconds */
 
@@ -274,7 +271,7 @@ static int acpi_thermal_set_polling(struct acpi_thermal *tz, int seconds)
                          "Polling frequency set to %lu seconds\n",
                          tz->polling_frequency));
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_thermal_set_cooling_mode(struct acpi_thermal *tz, int mode)
@@ -284,29 +281,28 @@ static int acpi_thermal_set_cooling_mode(struct acpi_thermal *tz, int mode)
        struct acpi_object_list arg_list = { 1, &arg0 };
        acpi_handle handle = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_thermal_set_cooling_mode");
 
        if (!tz)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
-       status = acpi_get_handle(tz->handle, "_SCP", &handle);
+       status = acpi_get_handle(tz->device->handle, "_SCP", &handle);
        if (ACPI_FAILURE(status)) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO, "_SCP not present\n"));
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        }
 
        arg0.integer.value = mode;
 
        status = acpi_evaluate_object(handle, NULL, &arg_list, NULL);
        if (ACPI_FAILURE(status))
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        tz->cooling_mode = mode;
 
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Cooling mode [%s]\n",
                          mode ? "passive" : "active"));
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
@@ -314,19 +310,18 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
        acpi_status status = AE_OK;
        int i = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_thermal_get_trip_points");
 
        if (!tz)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        /* Critical Shutdown (required) */
 
-       status = acpi_evaluate_integer(tz->handle, "_CRT", NULL,
+       status = acpi_evaluate_integer(tz->device->handle, "_CRT", NULL,
                                       &tz->trips.critical.temperature);
        if (ACPI_FAILURE(status)) {
                tz->trips.critical.flags.valid = 0;
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "No critical threshold\n"));
-               return_VALUE(-ENODEV);
+               ACPI_EXCEPTION((AE_INFO, status, "No critical threshold"));
+               return -ENODEV;
        } else {
                tz->trips.critical.flags.valid = 1;
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
@@ -337,7 +332,7 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
        /* Critical Sleep (optional) */
 
        status =
-           acpi_evaluate_integer(tz->handle, "_HOT", NULL,
+           acpi_evaluate_integer(tz->device->handle, "_HOT", NULL,
                                  &tz->trips.hot.temperature);
        if (ACPI_FAILURE(status)) {
                tz->trips.hot.flags.valid = 0;
@@ -351,7 +346,7 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
        /* Passive: Processors (optional) */
 
        status =
-           acpi_evaluate_integer(tz->handle, "_PSV", NULL,
+           acpi_evaluate_integer(tz->device->handle, "_PSV", NULL,
                                  &tz->trips.passive.temperature);
        if (ACPI_FAILURE(status)) {
                tz->trips.passive.flags.valid = 0;
@@ -360,32 +355,31 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
                tz->trips.passive.flags.valid = 1;
 
                status =
-                   acpi_evaluate_integer(tz->handle, "_TC1", NULL,
+                   acpi_evaluate_integer(tz->device->handle, "_TC1", NULL,
                                          &tz->trips.passive.tc1);
                if (ACPI_FAILURE(status))
                        tz->trips.passive.flags.valid = 0;
 
                status =
-                   acpi_evaluate_integer(tz->handle, "_TC2", NULL,
+                   acpi_evaluate_integer(tz->device->handle, "_TC2", NULL,
                                          &tz->trips.passive.tc2);
                if (ACPI_FAILURE(status))
                        tz->trips.passive.flags.valid = 0;
 
                status =
-                   acpi_evaluate_integer(tz->handle, "_TSP", NULL,
+                   acpi_evaluate_integer(tz->device->handle, "_TSP", NULL,
                                          &tz->trips.passive.tsp);
                if (ACPI_FAILURE(status))
                        tz->trips.passive.flags.valid = 0;
 
                status =
-                   acpi_evaluate_reference(tz->handle, "_PSL", NULL,
+                   acpi_evaluate_reference(tz->device->handle, "_PSL", NULL,
                                            &tz->trips.passive.devices);
                if (ACPI_FAILURE(status))
                        tz->trips.passive.flags.valid = 0;
 
                if (!tz->trips.passive.flags.valid)
-                       ACPI_DEBUG_PRINT((ACPI_DB_WARN,
-                                         "Invalid passive threshold\n"));
+                       printk(KERN_WARNING PREFIX "Invalid passive threshold\n");
                else
                        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                          "Found passive threshold [%lu]\n",
@@ -399,14 +393,14 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
                char name[5] = { '_', 'A', 'C', ('0' + i), '\0' };
 
                status =
-                   acpi_evaluate_integer(tz->handle, name, NULL,
+                   acpi_evaluate_integer(tz->device->handle, name, NULL,
                                          &tz->trips.active[i].temperature);
                if (ACPI_FAILURE(status))
                        break;
 
                name[2] = 'L';
                status =
-                   acpi_evaluate_reference(tz->handle, name, NULL,
+                   acpi_evaluate_reference(tz->device->handle, name, NULL,
                                            &tz->trips.active[i].devices);
                if (ACPI_SUCCESS(status)) {
                        tz->trips.active[i].flags.valid = 1;
@@ -414,29 +408,27 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
                                          "Found active threshold [%d]:[%lu]\n",
                                          i, tz->trips.active[i].temperature));
                } else
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                         "Invalid active threshold [%d]\n",
-                                         i));
+                       ACPI_EXCEPTION((AE_INFO, status,
+                                       "Invalid active threshold [%d]", i));
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_thermal_get_devices(struct acpi_thermal *tz)
 {
        acpi_status status = AE_OK;
 
-       ACPI_FUNCTION_TRACE("acpi_thermal_get_devices");
 
        if (!tz)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        status =
-           acpi_evaluate_reference(tz->handle, "_TZD", NULL, &tz->devices);
+           acpi_evaluate_reference(tz->device->handle, "_TZD", NULL, &tz->devices);
        if (ACPI_FAILURE(status))
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_thermal_call_usermode(char *path)
@@ -444,10 +436,9 @@ static int acpi_thermal_call_usermode(char *path)
        char *argv[2] = { NULL, NULL };
        char *envp[3] = { NULL, NULL, NULL };
 
-       ACPI_FUNCTION_TRACE("acpi_thermal_call_usermode");
 
        if (!path)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        argv[0] = path;
 
@@ -457,66 +448,48 @@ static int acpi_thermal_call_usermode(char *path)
 
        call_usermodehelper(argv[0], argv, envp, 0);
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_thermal_critical(struct acpi_thermal *tz)
 {
-       int result = 0;
-       struct acpi_device *device = NULL;
-
-       ACPI_FUNCTION_TRACE("acpi_thermal_critical");
-
        if (!tz || !tz->trips.critical.flags.valid)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (tz->temperature >= tz->trips.critical.temperature) {
-               ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Critical trip point\n"));
+               printk(KERN_WARNING PREFIX "Critical trip point\n");
                tz->trips.critical.flags.enabled = 1;
        } else if (tz->trips.critical.flags.enabled)
                tz->trips.critical.flags.enabled = 0;
 
-       result = acpi_bus_get_device(tz->handle, &device);
-       if (result)
-               return_VALUE(result);
-
        printk(KERN_EMERG
               "Critical temperature reached (%ld C), shutting down.\n",
               KELVIN_TO_CELSIUS(tz->temperature));
-       acpi_bus_generate_event(device, ACPI_THERMAL_NOTIFY_CRITICAL,
+       acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL,
                                tz->trips.critical.flags.enabled);
 
        acpi_thermal_call_usermode(ACPI_THERMAL_PATH_POWEROFF);
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_thermal_hot(struct acpi_thermal *tz)
 {
-       int result = 0;
-       struct acpi_device *device = NULL;
-
-       ACPI_FUNCTION_TRACE("acpi_thermal_hot");
-
        if (!tz || !tz->trips.hot.flags.valid)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (tz->temperature >= tz->trips.hot.temperature) {
-               ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Hot trip point\n"));
+               printk(KERN_WARNING PREFIX "Hot trip point\n");
                tz->trips.hot.flags.enabled = 1;
        } else if (tz->trips.hot.flags.enabled)
                tz->trips.hot.flags.enabled = 0;
 
-       result = acpi_bus_get_device(tz->handle, &device);
-       if (result)
-               return_VALUE(result);
-
-       acpi_bus_generate_event(device, ACPI_THERMAL_NOTIFY_HOT,
+       acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_HOT,
                                tz->trips.hot.flags.enabled);
 
        /* TBD: Call user-mode "sleep(S4)" function */
 
-       return_VALUE(0);
+       return 0;
 }
 
 static void acpi_thermal_passive(struct acpi_thermal *tz)
@@ -526,7 +499,6 @@ static void acpi_thermal_passive(struct acpi_thermal *tz)
        int trend = 0;
        int i = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_thermal_passive");
 
        if (!tz || !tz->trips.passive.flags.valid)
                return;
@@ -615,7 +587,6 @@ static void acpi_thermal_active(struct acpi_thermal *tz)
        int j = 0;
        unsigned long maxtemp = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_thermal_active");
 
        if (!tz)
                return;
@@ -642,10 +613,10 @@ static void acpi_thermal_active(struct acpi_thermal *tz)
                                                       handles[j],
                                                       ACPI_STATE_D0);
                                if (result) {
-                                       ACPI_DEBUG_PRINT((ACPI_DB_WARN,
-                                                         "Unable to turn cooling device [%p] 'on'\n",
-                                                         active->devices.
-                                                         handles[j]));
+                                       printk(KERN_WARNING PREFIX
+                                                     "Unable to turn cooling device [%p] 'on'\n",
+                                                     active->devices.
+                                                     handles[j]);
                                        continue;
                                }
                                active->flags.enabled = 1;
@@ -667,9 +638,9 @@ static void acpi_thermal_active(struct acpi_thermal *tz)
                        result = acpi_bus_set_power(active->devices.handles[j],
                                                    ACPI_STATE_D3);
                        if (result) {
-                               ACPI_DEBUG_PRINT((ACPI_DB_WARN,
-                                                 "Unable to turn cooling device [%p] 'off'\n",
-                                                 active->devices.handles[j]));
+                               printk(KERN_WARNING PREFIX
+                                             "Unable to turn cooling device [%p] 'off'\n",
+                                             active->devices.handles[j]);
                                continue;
                        }
                        active->flags.enabled = 0;
@@ -697,18 +668,17 @@ static void acpi_thermal_check(void *data)
        int i = 0;
        struct acpi_thermal_state state;
 
-       ACPI_FUNCTION_TRACE("acpi_thermal_check");
 
        if (!tz) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid (NULL) context.\n"));
-               return_VOID;
+               printk(KERN_ERR PREFIX "Invalid (NULL) context\n");
+               return;
        }
 
        state = tz->state;
 
        result = acpi_thermal_get_temperature(tz);
        if (result)
-               return_VOID;
+               return;
 
        memset(&tz->state, 0, sizeof(tz->state));
 
@@ -797,7 +767,7 @@ static void acpi_thermal_check(void *data)
                }
        }
 
-       return_VOID;
+       return;
 }
 
 /* --------------------------------------------------------------------------
@@ -810,7 +780,6 @@ static int acpi_thermal_state_seq_show(struct seq_file *seq, void *offset)
 {
        struct acpi_thermal *tz = (struct acpi_thermal *)seq->private;
 
-       ACPI_FUNCTION_TRACE("acpi_thermal_state_seq_show");
 
        if (!tz)
                goto end;
@@ -833,7 +802,7 @@ static int acpi_thermal_state_seq_show(struct seq_file *seq, void *offset)
        }
 
       end:
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_thermal_state_open_fs(struct inode *inode, struct file *file)
@@ -846,7 +815,6 @@ static int acpi_thermal_temp_seq_show(struct seq_file *seq, void *offset)
        int result = 0;
        struct acpi_thermal *tz = (struct acpi_thermal *)seq->private;
 
-       ACPI_FUNCTION_TRACE("acpi_thermal_temp_seq_show");
 
        if (!tz)
                goto end;
@@ -859,7 +827,7 @@ static int acpi_thermal_temp_seq_show(struct seq_file *seq, void *offset)
                   KELVIN_TO_CELSIUS(tz->temperature));
 
       end:
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_thermal_temp_open_fs(struct inode *inode, struct file *file)
@@ -873,7 +841,6 @@ static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)
        int i = 0;
        int j = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_thermal_trip_seq_show");
 
        if (!tz)
                goto end;
@@ -913,7 +880,7 @@ static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)
        }
 
       end:
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_thermal_trip_open_fs(struct inode *inode, struct file *file)
@@ -934,28 +901,25 @@ acpi_thermal_write_trip_points(struct file *file,
        int *active;
        int i = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_thermal_write_trip_points");
 
        limit_string = kmalloc(ACPI_THERMAL_MAX_LIMIT_STR_LEN, GFP_KERNEL);
        if (!limit_string)
-               return_VALUE(-ENOMEM);
+               return -ENOMEM;
 
        memset(limit_string, 0, ACPI_THERMAL_MAX_LIMIT_STR_LEN);
 
        active = kmalloc(ACPI_THERMAL_MAX_ACTIVE * sizeof(int), GFP_KERNEL);
        if (!active) {
                kfree(limit_string);
-               return_VALUE(-ENOMEM);
+               return -ENOMEM;
        }
 
        if (!tz || (count > ACPI_THERMAL_MAX_LIMIT_STR_LEN - 1)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument\n"));
                count = -EINVAL;
                goto end;
        }
 
        if (copy_from_user(limit_string, buffer, count)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data\n"));
                count = -EFAULT;
                goto end;
        }
@@ -968,7 +932,6 @@ acpi_thermal_write_trip_points(struct file *file,
                     &active[5], &active[6], &active[7], &active[8],
                     &active[9]);
        if (!(num >= 5 && num < (ACPI_THERMAL_MAX_ACTIVE + 3))) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data format\n"));
                count = -EINVAL;
                goto end;
        }
@@ -985,14 +948,13 @@ acpi_thermal_write_trip_points(struct file *file,
       end:
        kfree(active);
        kfree(limit_string);
-       return_VALUE(count);
+       return count;
 }
 
 static int acpi_thermal_cooling_seq_show(struct seq_file *seq, void *offset)
 {
        struct acpi_thermal *tz = (struct acpi_thermal *)seq->private;
 
-       ACPI_FUNCTION_TRACE("acpi_thermal_cooling_seq_show");
 
        if (!tz)
                goto end;
@@ -1008,7 +970,7 @@ static int acpi_thermal_cooling_seq_show(struct seq_file *seq, void *offset)
                           tz->cooling_mode ? "passive" : "active");
 
       end:
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_thermal_cooling_open_fs(struct inode *inode, struct file *file)
@@ -1027,16 +989,15 @@ acpi_thermal_write_cooling_mode(struct file *file,
        int result = 0;
        char mode_string[12] = { '\0' };
 
-       ACPI_FUNCTION_TRACE("acpi_thermal_write_cooling_mode");
 
        if (!tz || (count > sizeof(mode_string) - 1))
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (!tz->flags.cooling_mode)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        if (copy_from_user(mode_string, buffer, count))
-               return_VALUE(-EFAULT);
+               return -EFAULT;
 
        mode_string[count] = '\0';
 
@@ -1044,18 +1005,17 @@ acpi_thermal_write_cooling_mode(struct file *file,
                                               simple_strtoul(mode_string, NULL,
                                                              0));
        if (result)
-               return_VALUE(result);
+               return result;
 
        acpi_thermal_check(tz);
 
-       return_VALUE(count);
+       return count;
 }
 
 static int acpi_thermal_polling_seq_show(struct seq_file *seq, void *offset)
 {
        struct acpi_thermal *tz = (struct acpi_thermal *)seq->private;
 
-       ACPI_FUNCTION_TRACE("acpi_thermal_polling_seq_show");
 
        if (!tz)
                goto end;
@@ -1069,7 +1029,7 @@ static int acpi_thermal_polling_seq_show(struct seq_file *seq, void *offset)
                   (tz->polling_frequency / 10));
 
       end:
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_thermal_polling_open_fs(struct inode *inode, struct file *file)
@@ -1089,13 +1049,12 @@ acpi_thermal_write_polling(struct file *file,
        char polling_string[12] = { '\0' };
        int seconds = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_thermal_write_polling");
 
        if (!tz || (count > sizeof(polling_string) - 1))
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (copy_from_user(polling_string, buffer, count))
-               return_VALUE(-EFAULT);
+               return -EFAULT;
 
        polling_string[count] = '\0';
 
@@ -1103,24 +1062,23 @@ acpi_thermal_write_polling(struct file *file,
 
        result = acpi_thermal_set_polling(tz, seconds);
        if (result)
-               return_VALUE(result);
+               return result;
 
        acpi_thermal_check(tz);
 
-       return_VALUE(count);
+       return count;
 }
 
 static int acpi_thermal_add_fs(struct acpi_device *device)
 {
        struct proc_dir_entry *entry = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_thermal_add_fs");
 
        if (!acpi_device_dir(device)) {
                acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
                                                     acpi_thermal_dir);
                if (!acpi_device_dir(device))
-                       return_VALUE(-ENODEV);
+                       return -ENODEV;
                acpi_device_dir(device)->owner = THIS_MODULE;
        }
 
@@ -1128,9 +1086,7 @@ static int acpi_thermal_add_fs(struct acpi_device *device)
        entry = create_proc_entry(ACPI_THERMAL_FILE_STATE,
                                  S_IRUGO, acpi_device_dir(device));
        if (!entry)
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to create '%s' fs entry\n",
-                                 ACPI_THERMAL_FILE_STATE));
+               return -ENODEV;
        else {
                entry->proc_fops = &acpi_thermal_state_fops;
                entry->data = acpi_driver_data(device);
@@ -1141,9 +1097,7 @@ static int acpi_thermal_add_fs(struct acpi_device *device)
        entry = create_proc_entry(ACPI_THERMAL_FILE_TEMPERATURE,
                                  S_IRUGO, acpi_device_dir(device));
        if (!entry)
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to create '%s' fs entry\n",
-                                 ACPI_THERMAL_FILE_TEMPERATURE));
+               return -ENODEV;
        else {
                entry->proc_fops = &acpi_thermal_temp_fops;
                entry->data = acpi_driver_data(device);
@@ -1155,9 +1109,7 @@ static int acpi_thermal_add_fs(struct acpi_device *device)
                                  S_IFREG | S_IRUGO | S_IWUSR,
                                  acpi_device_dir(device));
        if (!entry)
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to create '%s' fs entry\n",
-                                 ACPI_THERMAL_FILE_TRIP_POINTS));
+               return -ENODEV;
        else {
                entry->proc_fops = &acpi_thermal_trip_fops;
                entry->data = acpi_driver_data(device);
@@ -1169,9 +1121,7 @@ static int acpi_thermal_add_fs(struct acpi_device *device)
                                  S_IFREG | S_IRUGO | S_IWUSR,
                                  acpi_device_dir(device));
        if (!entry)
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to create '%s' fs entry\n",
-                                 ACPI_THERMAL_FILE_COOLING_MODE));
+               return -ENODEV;
        else {
                entry->proc_fops = &acpi_thermal_cooling_fops;
                entry->data = acpi_driver_data(device);
@@ -1183,21 +1133,18 @@ static int acpi_thermal_add_fs(struct acpi_device *device)
                                  S_IFREG | S_IRUGO | S_IWUSR,
                                  acpi_device_dir(device));
        if (!entry)
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to create '%s' fs entry\n",
-                                 ACPI_THERMAL_FILE_POLLING_FREQ));
+               return -ENODEV;
        else {
                entry->proc_fops = &acpi_thermal_polling_fops;
                entry->data = acpi_driver_data(device);
                entry->owner = THIS_MODULE;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_thermal_remove_fs(struct acpi_device *device)
 {
-       ACPI_FUNCTION_TRACE("acpi_thermal_remove_fs");
 
        if (acpi_device_dir(device)) {
                remove_proc_entry(ACPI_THERMAL_FILE_POLLING_FREQ,
@@ -1214,7 +1161,7 @@ static int acpi_thermal_remove_fs(struct acpi_device *device)
                acpi_device_dir(device) = NULL;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 /* --------------------------------------------------------------------------
@@ -1226,13 +1173,11 @@ static void acpi_thermal_notify(acpi_handle handle, u32 event, void *data)
        struct acpi_thermal *tz = (struct acpi_thermal *)data;
        struct acpi_device *device = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_thermal_notify");
 
        if (!tz)
-               return_VOID;
+               return;
 
-       if (acpi_bus_get_device(tz->handle, &device))
-               return_VOID;
+       device = tz->device;
 
        switch (event) {
        case ACPI_THERMAL_NOTIFY_TEMPERATURE:
@@ -1254,27 +1199,26 @@ static void acpi_thermal_notify(acpi_handle handle, u32 event, void *data)
                break;
        }
 
-       return_VOID;
+       return;
 }
 
 static int acpi_thermal_get_info(struct acpi_thermal *tz)
 {
        int result = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_thermal_get_info");
 
        if (!tz)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        /* Get temperature [_TMP] (required) */
        result = acpi_thermal_get_temperature(tz);
        if (result)
-               return_VALUE(result);
+               return result;
 
        /* Get trip points [_CRT, _PSV, etc.] (required) */
        result = acpi_thermal_get_trip_points(tz);
        if (result)
-               return_VALUE(result);
+               return result;
 
        /* Set the cooling mode [_SCP] to active cooling (default) */
        result = acpi_thermal_set_cooling_mode(tz, ACPI_THERMAL_MODE_ACTIVE);
@@ -1314,7 +1258,7 @@ static int acpi_thermal_get_info(struct acpi_thermal *tz)
        if (!result)
                tz->flags.devices = 1;
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_thermal_add(struct acpi_device *device)
@@ -1323,17 +1267,16 @@ static int acpi_thermal_add(struct acpi_device *device)
        acpi_status status = AE_OK;
        struct acpi_thermal *tz = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_thermal_add");
 
        if (!device)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        tz = kmalloc(sizeof(struct acpi_thermal), GFP_KERNEL);
        if (!tz)
-               return_VALUE(-ENOMEM);
+               return -ENOMEM;
        memset(tz, 0, sizeof(struct acpi_thermal));
 
-       tz->handle = device->handle;
+       tz->device = device;
        strcpy(tz->name, device->pnp.bus_id);
        strcpy(acpi_device_name(device), ACPI_THERMAL_DEVICE_NAME);
        strcpy(acpi_device_class(device), ACPI_THERMAL_CLASS);
@@ -1351,12 +1294,10 @@ static int acpi_thermal_add(struct acpi_device *device)
 
        acpi_thermal_check(tz);
 
-       status = acpi_install_notify_handler(tz->handle,
+       status = acpi_install_notify_handler(device->handle,
                                             ACPI_DEVICE_NOTIFY,
                                             acpi_thermal_notify, tz);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Error installing notify handler\n"));
                result = -ENODEV;
                goto end;
        }
@@ -1371,7 +1312,7 @@ static int acpi_thermal_add(struct acpi_device *device)
                kfree(tz);
        }
 
-       return_VALUE(result);
+       return result;
 }
 
 static int acpi_thermal_remove(struct acpi_device *device, int type)
@@ -1379,10 +1320,9 @@ static int acpi_thermal_remove(struct acpi_device *device, int type)
        acpi_status status = AE_OK;
        struct acpi_thermal *tz = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_thermal_remove");
 
        if (!device || !acpi_driver_data(device))
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        tz = (struct acpi_thermal *)acpi_driver_data(device);
 
@@ -1395,12 +1335,9 @@ static int acpi_thermal_remove(struct acpi_device *device, int type)
        /* deferred task may reinsert timer */
        del_timer_sync(&(tz->timer));
 
-       status = acpi_remove_notify_handler(tz->handle,
+       status = acpi_remove_notify_handler(device->handle,
                                            ACPI_DEVICE_NOTIFY,
                                            acpi_thermal_notify);
-       if (ACPI_FAILURE(status))
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Error removing notify handler\n"));
 
        /* Terminate policy */
        if (tz->trips.passive.flags.valid && tz->trips.passive.flags.enabled) {
@@ -1416,7 +1353,7 @@ static int acpi_thermal_remove(struct acpi_device *device, int type)
        acpi_thermal_remove_fs(device);
 
        kfree(tz);
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_thermal_resume(struct acpi_device *device, int state)
@@ -1424,7 +1361,7 @@ static int acpi_thermal_resume(struct acpi_device *device, int state)
        struct acpi_thermal *tz = NULL;
 
        if (!device || !acpi_driver_data(device))
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        tz = (struct acpi_thermal *)acpi_driver_data(device);
 
@@ -1437,31 +1374,29 @@ static int __init acpi_thermal_init(void)
 {
        int result = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_thermal_init");
 
        acpi_thermal_dir = proc_mkdir(ACPI_THERMAL_CLASS, acpi_root_dir);
        if (!acpi_thermal_dir)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        acpi_thermal_dir->owner = THIS_MODULE;
 
        result = acpi_bus_register_driver(&acpi_thermal_driver);
        if (result < 0) {
                remove_proc_entry(ACPI_THERMAL_CLASS, acpi_root_dir);
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 static void __exit acpi_thermal_exit(void)
 {
-       ACPI_FUNCTION_TRACE("acpi_thermal_exit");
 
        acpi_bus_unregister_driver(&acpi_thermal_driver);
 
        remove_proc_entry(ACPI_THERMAL_CLASS, acpi_root_dir);
 
-       return_VOID;
+       return;
 }
 
 module_init(acpi_thermal_init);
index 7940fc1bd69ef88a1900ea903647f26531c49264..5cff17dc78b331855b143ebffa7d95b749dcab68 100644 (file)
@@ -166,10 +166,10 @@ acpi_status acpi_ut_delete_caches(void)
 
        /* Free memory lists */
 
-       acpi_os_free(acpi_gbl_global_list);
+       ACPI_FREE(acpi_gbl_global_list);
        acpi_gbl_global_list = NULL;
 
-       acpi_os_free(acpi_gbl_ns_node_list);
+       ACPI_FREE(acpi_gbl_ns_node_list);
        acpi_gbl_ns_node_list = NULL;
 #endif
 
index 56270a30718ae8b968430a527a20efc3b4087676..1a1f8109159cec3d9d988d1513a75cdb1638ecf4 100644 (file)
@@ -162,7 +162,7 @@ acpi_status acpi_os_delete_cache(struct acpi_memory_list * cache)
 
        /* Now we can delete the cache object */
 
-       acpi_os_free(cache);
+       ACPI_FREE(cache);
        return (AE_OK);
 }
 
index 67b9f325c6fae9036628c863a97b80bf8ddda66f..38ebe1c543304e9258fb01fca4fc294240666b8e 100644 (file)
@@ -155,21 +155,30 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object)
        case ACPI_TYPE_MUTEX:
 
                ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
-                                 "***** Mutex %p, Semaphore %p\n",
-                                 object, object->mutex.semaphore));
+                                 "***** Mutex %p, OS Mutex %p\n",
+                                 object, object->mutex.os_mutex));
 
-               acpi_ex_unlink_mutex(object);
-               (void)acpi_os_delete_semaphore(object->mutex.semaphore);
+               if (object->mutex.os_mutex != ACPI_GLOBAL_LOCK) {
+                       acpi_ex_unlink_mutex(object);
+                       acpi_os_delete_mutex(object->mutex.os_mutex);
+               } else {
+                       /* Global Lock "mutex" is actually a counting semaphore */
+
+                       (void)
+                           acpi_os_delete_semaphore
+                           (acpi_gbl_global_lock_semaphore);
+                       acpi_gbl_global_lock_semaphore = NULL;
+               }
                break;
 
        case ACPI_TYPE_EVENT:
 
                ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
-                                 "***** Event %p, Semaphore %p\n",
-                                 object, object->event.semaphore));
+                                 "***** Event %p, OS Semaphore %p\n",
+                                 object, object->event.os_semaphore));
 
-               (void)acpi_os_delete_semaphore(object->event.semaphore);
-               object->event.semaphore = NULL;
+               (void)acpi_os_delete_semaphore(object->event.os_semaphore);
+               object->event.os_semaphore = NULL;
                break;
 
        case ACPI_TYPE_METHOD:
@@ -177,12 +186,13 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object)
                ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
                                  "***** Method %p\n", object));
 
-               /* Delete the method semaphore if it exists */
+               /* Delete the method mutex if it exists */
 
-               if (object->method.semaphore) {
-                       (void)acpi_os_delete_semaphore(object->method.
-                                                      semaphore);
-                       object->method.semaphore = NULL;
+               if (object->method.mutex) {
+                       acpi_os_delete_mutex(object->method.mutex->mutex.
+                                            os_mutex);
+                       acpi_ut_delete_object_desc(object->method.mutex);
+                       object->method.mutex = NULL;
                }
                break;
 
index e5999c65c0b8c851fc021e39650c0de01854a74d..014030af8b5014f30415ede5cf3d5e9cf6d8f388 100644 (file)
@@ -794,6 +794,7 @@ void acpi_ut_init_globals(void)
 
        /* Global Lock support */
 
+       acpi_gbl_global_lock_semaphore = NULL;
        acpi_gbl_global_lock_acquired = FALSE;
        acpi_gbl_global_lock_thread_count = 0;
        acpi_gbl_global_lock_handle = 0;
index 5c75d35ad1cd8a96c4d428051164482ea3512912..33268310c73804be4249cfc258b80f788985c4db 100644 (file)
@@ -41,6 +41,8 @@
  * POSSIBILITY OF SUCH DAMAGES.
  */
 
+#include <linux/module.h>
+
 #include <acpi/acpi.h>
 #include <acpi/acnamesp.h>
 
@@ -962,6 +964,7 @@ acpi_ut_exception(char *module_name,
        acpi_os_vprintf(format, args);
        acpi_os_printf(" [%X]\n", ACPI_CA_VERSION);
 }
+EXPORT_SYMBOL(acpi_ut_exception);
 
 void ACPI_INTERNAL_VAR_XFACE
 acpi_ut_warning(char *module_name, u32 line_number, char *format, ...)
index 25eb34369afa22738ee48f8d11826ecf55068088..dfc8f30ca892d13255a78d1cbaa622de4a2dbb38 100644 (file)
@@ -82,12 +82,9 @@ acpi_status acpi_ut_mutex_initialize(void)
 
        /* Create the spinlocks for use at interrupt level */
 
-       status = acpi_os_create_lock(&acpi_gbl_gpe_lock);
-       if (ACPI_FAILURE(status)) {
-               return_ACPI_STATUS(status);
-       }
+       spin_lock_init(acpi_gbl_gpe_lock);
+       spin_lock_init(acpi_gbl_hardware_lock);
 
-       status = acpi_os_create_lock(&acpi_gbl_hardware_lock);
        return_ACPI_STATUS(status);
 }
 
@@ -146,9 +143,8 @@ static acpi_status acpi_ut_create_mutex(acpi_mutex_handle mutex_id)
        }
 
        if (!acpi_gbl_mutex_info[mutex_id].mutex) {
-               status = acpi_os_create_semaphore(1, 1,
-                                                 &acpi_gbl_mutex_info
-                                                 [mutex_id].mutex);
+               status =
+                   acpi_os_create_mutex(&acpi_gbl_mutex_info[mutex_id].mutex);
                acpi_gbl_mutex_info[mutex_id].thread_id =
                    ACPI_MUTEX_NOT_ACQUIRED;
                acpi_gbl_mutex_info[mutex_id].use_count = 0;
@@ -171,7 +167,6 @@ static acpi_status acpi_ut_create_mutex(acpi_mutex_handle mutex_id)
 
 static acpi_status acpi_ut_delete_mutex(acpi_mutex_handle mutex_id)
 {
-       acpi_status status;
 
        ACPI_FUNCTION_TRACE_U32(ut_delete_mutex, mutex_id);
 
@@ -179,12 +174,12 @@ static acpi_status acpi_ut_delete_mutex(acpi_mutex_handle mutex_id)
                return_ACPI_STATUS(AE_BAD_PARAMETER);
        }
 
-       status = acpi_os_delete_semaphore(acpi_gbl_mutex_info[mutex_id].mutex);
+       acpi_os_delete_mutex(acpi_gbl_mutex_info[mutex_id].mutex);
 
        acpi_gbl_mutex_info[mutex_id].mutex = NULL;
        acpi_gbl_mutex_info[mutex_id].thread_id = ACPI_MUTEX_NOT_ACQUIRED;
 
-       return_ACPI_STATUS(status);
+       return_ACPI_STATUS(AE_OK);
 }
 
 /*******************************************************************************
@@ -251,8 +246,8 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id)
                          "Thread %X attempting to acquire Mutex [%s]\n",
                          this_thread_id, acpi_ut_get_mutex_name(mutex_id)));
 
-       status = acpi_os_wait_semaphore(acpi_gbl_mutex_info[mutex_id].mutex,
-                                       1, ACPI_WAIT_FOREVER);
+       status = acpi_os_acquire_mutex(acpi_gbl_mutex_info[mutex_id].mutex,
+                                      ACPI_WAIT_FOREVER);
        if (ACPI_SUCCESS(status)) {
                ACPI_DEBUG_PRINT((ACPI_DB_MUTEX,
                                  "Thread %X acquired Mutex [%s]\n",
@@ -284,7 +279,6 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id)
 
 acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id)
 {
-       acpi_status status;
        acpi_thread_id this_thread_id;
 
        ACPI_FUNCTION_NAME(ut_release_mutex);
@@ -340,19 +334,6 @@ acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id)
 
        acpi_gbl_mutex_info[mutex_id].thread_id = ACPI_MUTEX_NOT_ACQUIRED;
 
-       status =
-           acpi_os_signal_semaphore(acpi_gbl_mutex_info[mutex_id].mutex, 1);
-
-       if (ACPI_FAILURE(status)) {
-               ACPI_EXCEPTION((AE_INFO, status,
-                               "Thread %X could not release Mutex [%X]",
-                               this_thread_id, mutex_id));
-       } else {
-               ACPI_DEBUG_PRINT((ACPI_DB_MUTEX,
-                                 "Thread %X released Mutex [%s]\n",
-                                 this_thread_id,
-                                 acpi_ut_get_mutex_name(mutex_id)));
-       }
-
-       return (status);
+       acpi_os_release_mutex(acpi_gbl_mutex_info[mutex_id].mutex);
+       return (AE_OK);
 }
index 6b516852ac12ac82d69515d6a3f98db96ed13c42..f48227f4c8c9183f03e224852af6fa2f1c14c129 100644 (file)
@@ -58,31 +58,29 @@ acpi_extract_package(union acpi_object *package,
        u8 *head = NULL;
        u8 *tail = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_extract_package");
 
        if (!package || (package->type != ACPI_TYPE_PACKAGE)
            || (package->package.count < 1)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_WARN,
-                                 "Invalid 'package' argument\n"));
-               return_ACPI_STATUS(AE_BAD_PARAMETER);
+               printk(KERN_WARNING PREFIX "Invalid package argument\n");
+               return AE_BAD_PARAMETER;
        }
 
        if (!format || !format->pointer || (format->length < 1)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid 'format' argument\n"));
-               return_ACPI_STATUS(AE_BAD_PARAMETER);
+               printk(KERN_WARNING PREFIX "Invalid format argument\n");
+               return AE_BAD_PARAMETER;
        }
 
        if (!buffer) {
-               ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid 'buffer' argument\n"));
-               return_ACPI_STATUS(AE_BAD_PARAMETER);
+               printk(KERN_WARNING PREFIX "Invalid buffer argument\n");
+               return AE_BAD_PARAMETER;
        }
 
        format_count = (format->length / sizeof(char)) - 1;
        if (format_count > package->package.count) {
-               ACPI_DEBUG_PRINT((ACPI_DB_WARN,
-                                 "Format specifies more objects [%d] than exist in package [%d].",
-                                 format_count, package->package.count));
-               return_ACPI_STATUS(AE_BAD_DATA);
+               printk(KERN_WARNING PREFIX "Format specifies more objects [%d]"
+                             " than exist in package [%d].\n",
+                             format_count, package->package.count);
+               return AE_BAD_DATA;
        }
 
        format_string = (char *)format->pointer;
@@ -95,7 +93,7 @@ acpi_extract_package(union acpi_object *package,
                union acpi_object *element = &(package->package.elements[i]);
 
                if (!element) {
-                       return_ACPI_STATUS(AE_BAD_DATA);
+                       return AE_BAD_DATA;
                }
 
                switch (element->type) {
@@ -113,10 +111,11 @@ acpi_extract_package(union acpi_object *package,
                                tail_offset += sizeof(char *);
                                break;
                        default:
-                               ACPI_DEBUG_PRINT((ACPI_DB_WARN,
-                                                 "Invalid package element [%d]: got number, expecing [%c].\n",
-                                                 i, format_string[i]));
-                               return_ACPI_STATUS(AE_BAD_DATA);
+                               printk(KERN_WARNING PREFIX "Invalid package element"
+                                             " [%d]: got number, expecing"
+                                             " [%c]\n",
+                                             i, format_string[i]);
+                               return AE_BAD_DATA;
                                break;
                        }
                        break;
@@ -138,10 +137,11 @@ acpi_extract_package(union acpi_object *package,
                                tail_offset += sizeof(u8 *);
                                break;
                        default:
-                               ACPI_DEBUG_PRINT((ACPI_DB_WARN,
-                                                 "Invalid package element [%d] got string/buffer, expecing [%c].\n",
-                                                 i, format_string[i]));
-                               return_ACPI_STATUS(AE_BAD_DATA);
+                               printk(KERN_WARNING PREFIX "Invalid package element"
+                                             " [%d] got string/buffer,"
+                                             " expecing [%c]\n",
+                                             i, format_string[i]);
+                               return AE_BAD_DATA;
                                break;
                        }
                        break;
@@ -152,7 +152,7 @@ acpi_extract_package(union acpi_object *package,
                                          "Found unsupported element at index=%d\n",
                                          i));
                        /* TBD: handle nested packages... */
-                       return_ACPI_STATUS(AE_SUPPORT);
+                       return AE_SUPPORT;
                        break;
                }
        }
@@ -162,9 +162,9 @@ acpi_extract_package(union acpi_object *package,
         */
        if (buffer->length < size_required) {
                buffer->length = size_required;
-               return_ACPI_STATUS(AE_BUFFER_OVERFLOW);
+               return AE_BUFFER_OVERFLOW;
        } else if (buffer->length != size_required || !buffer->pointer) {
-               return_ACPI_STATUS(AE_BAD_PARAMETER);
+               return AE_BAD_PARAMETER;
        }
 
        head = buffer->pointer;
@@ -179,7 +179,7 @@ acpi_extract_package(union acpi_object *package,
                union acpi_object *element = &(package->package.elements[i]);
 
                if (!element) {
-                       return_ACPI_STATUS(AE_BAD_DATA);
+                       return AE_BAD_DATA;
                }
 
                switch (element->type) {
@@ -244,7 +244,7 @@ acpi_extract_package(union acpi_object *package,
                }
        }
 
-       return_ACPI_STATUS(AE_OK);
+       return AE_OK;
 }
 
 EXPORT_SYMBOL(acpi_extract_package);
@@ -258,14 +258,13 @@ acpi_evaluate_integer(acpi_handle handle,
        union acpi_object *element;
        struct acpi_buffer buffer = { 0, NULL };
 
-       ACPI_FUNCTION_TRACE("acpi_evaluate_integer");
 
        if (!data)
-               return_ACPI_STATUS(AE_BAD_PARAMETER);
+               return AE_BAD_PARAMETER;
 
        element = kmalloc(sizeof(union acpi_object), GFP_KERNEL);
        if (!element)
-               return_ACPI_STATUS(AE_NO_MEMORY);
+               return AE_NO_MEMORY;
 
        memset(element, 0, sizeof(union acpi_object));
        buffer.length = sizeof(union acpi_object);
@@ -274,13 +273,13 @@ acpi_evaluate_integer(acpi_handle handle,
        if (ACPI_FAILURE(status)) {
                acpi_util_eval_error(handle, pathname, status);
                kfree(element);
-               return_ACPI_STATUS(status);
+               return status;
        }
 
        if (element->type != ACPI_TYPE_INTEGER) {
                acpi_util_eval_error(handle, pathname, AE_BAD_DATA);
                kfree(element);
-               return_ACPI_STATUS(AE_BAD_DATA);
+               return AE_BAD_DATA;
        }
 
        *data = element->integer.value;
@@ -288,7 +287,7 @@ acpi_evaluate_integer(acpi_handle handle,
 
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%lu]\n", *data));
 
-       return_ACPI_STATUS(AE_OK);
+       return AE_OK;
 }
 
 EXPORT_SYMBOL(acpi_evaluate_integer);
@@ -303,15 +302,14 @@ acpi_evaluate_string(acpi_handle handle,
        acpi_object *element = NULL;
        acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
 
-       ACPI_FUNCTION_TRACE("acpi_evaluate_string");
 
        if (!data)
-               return_ACPI_STATUS(AE_BAD_PARAMETER);
+               return AE_BAD_PARAMETER;
 
        status = acpi_evaluate_object(handle, pathname, arguments, &buffer);
        if (ACPI_FAILURE(status)) {
                acpi_util_eval_error(handle, pathname, status);
-               return_ACPI_STATUS(status);
+               return status;
        }
 
        element = (acpi_object *) buffer.pointer;
@@ -320,13 +318,13 @@ acpi_evaluate_string(acpi_handle handle,
            || (element->type != ACPI_TYPE_BUFFER)
            || !element->string.length) {
                acpi_util_eval_error(handle, pathname, AE_BAD_DATA);
-               return_ACPI_STATUS(AE_BAD_DATA);
+               return AE_BAD_DATA;
        }
 
        *data = kmalloc(element->string.length + 1, GFP_KERNEL);
        if (!data) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Memory allocation error\n"));
-               return_VALUE(-ENOMEM);
+               printk(KERN_ERR PREFIX "Memory allocation\n");
+               return -ENOMEM;
        }
        memset(*data, 0, element->string.length + 1);
 
@@ -334,9 +332,9 @@ acpi_evaluate_string(acpi_handle handle,
 
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%s]\n", *data));
 
-       acpi_os_free(buffer.pointer);
+       kfree(buffer.pointer);
 
-       return_ACPI_STATUS(AE_OK);
+       return AE_OK;
 }
 #endif
 
@@ -352,10 +350,9 @@ acpi_evaluate_reference(acpi_handle handle,
        struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
        u32 i = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_evaluate_reference");
 
        if (!list) {
-               return_ACPI_STATUS(AE_BAD_PARAMETER);
+               return AE_BAD_PARAMETER;
        }
 
        /* Evaluate object. */
@@ -367,32 +364,29 @@ acpi_evaluate_reference(acpi_handle handle,
        package = (union acpi_object *)buffer.pointer;
 
        if ((buffer.length == 0) || !package) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "No return object (len %X ptr %p)\n",
-                                 (unsigned)buffer.length, package));
+               printk(KERN_ERR PREFIX "No return object (len %X ptr %p)\n",
+                           (unsigned)buffer.length, package);
                status = AE_BAD_DATA;
                acpi_util_eval_error(handle, pathname, status);
                goto end;
        }
        if (package->type != ACPI_TYPE_PACKAGE) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Expecting a [Package], found type %X\n",
-                                 package->type));
+               printk(KERN_ERR PREFIX "Expecting a [Package], found type %X\n",
+                           package->type);
                status = AE_BAD_DATA;
                acpi_util_eval_error(handle, pathname, status);
                goto end;
        }
        if (!package->package.count) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "[Package] has zero elements (%p)\n",
-                                 package));
+               printk(KERN_ERR PREFIX "[Package] has zero elements (%p)\n",
+                           package);
                status = AE_BAD_DATA;
                acpi_util_eval_error(handle, pathname, status);
                goto end;
        }
 
        if (package->package.count > ACPI_MAX_HANDLES) {
-               return_ACPI_STATUS(AE_NO_MEMORY);
+               return AE_NO_MEMORY;
        }
        list->count = package->package.count;
 
@@ -404,9 +398,9 @@ acpi_evaluate_reference(acpi_handle handle,
 
                if (element->type != ACPI_TYPE_ANY) {
                        status = AE_BAD_DATA;
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                         "Expecting a [Reference] package element, found type %X\n",
-                                         element->type));
+                       printk(KERN_ERR PREFIX
+                                   "Expecting a [Reference] package element, found type %X\n",
+                                   element->type);
                        acpi_util_eval_error(handle, pathname, status);
                        break;
                }
@@ -424,9 +418,9 @@ acpi_evaluate_reference(acpi_handle handle,
                //kfree(list->handles);
        }
 
-       acpi_os_free(buffer.pointer);
+       kfree(buffer.pointer);
 
-       return_ACPI_STATUS(status);
+       return status;
 }
 
 EXPORT_SYMBOL(acpi_evaluate_reference);
index e7e9a693953a7bb58f37a0b446c9f7e6942c74b8..56666a9824760bc0fbf569aba85518a38ce995cb 100644 (file)
@@ -117,7 +117,7 @@ struct acpi_video_enumerated_device {
 };
 
 struct acpi_video_bus {
-       acpi_handle handle;
+       struct acpi_device *device;
        u8 dos_setting;
        struct acpi_video_enumerated_device *attached_array;
        u8 attached_count;
@@ -155,7 +155,6 @@ struct acpi_video_device_brightness {
 };
 
 struct acpi_video_device {
-       acpi_handle handle;
        unsigned long device_id;
        struct acpi_video_device_flags flags;
        struct acpi_video_device_cap cap;
@@ -272,10 +271,10 @@ static int
 acpi_video_device_query(struct acpi_video_device *device, unsigned long *state)
 {
        int status;
-       ACPI_FUNCTION_TRACE("acpi_video_device_query");
-       status = acpi_evaluate_integer(device->handle, "_DGS", NULL, state);
 
-       return_VALUE(status);
+       status = acpi_evaluate_integer(device->dev->handle, "_DGS", NULL, state);
+
+       return status;
 }
 
 static int
@@ -284,11 +283,9 @@ acpi_video_device_get_state(struct acpi_video_device *device,
 {
        int status;
 
-       ACPI_FUNCTION_TRACE("acpi_video_device_get_state");
-
-       status = acpi_evaluate_integer(device->handle, "_DCS", NULL, state);
+       status = acpi_evaluate_integer(device->dev->handle, "_DCS", NULL, state);
 
-       return_VALUE(status);
+       return status;
 }
 
 static int
@@ -299,12 +296,11 @@ acpi_video_device_set_state(struct acpi_video_device *device, int state)
        struct acpi_object_list args = { 1, &arg0 };
        unsigned long ret;
 
-       ACPI_FUNCTION_TRACE("acpi_video_device_set_state");
 
        arg0.integer.value = state;
-       status = acpi_evaluate_integer(device->handle, "_DSS", &args, &ret);
+       status = acpi_evaluate_integer(device->dev->handle, "_DSS", &args, &ret);
 
-       return_VALUE(status);
+       return status;
 }
 
 static int
@@ -315,28 +311,27 @@ acpi_video_device_lcd_query_levels(struct acpi_video_device *device,
        struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
        union acpi_object *obj;
 
-       ACPI_FUNCTION_TRACE("acpi_video_device_lcd_query_levels");
 
        *levels = NULL;
 
-       status = acpi_evaluate_object(device->handle, "_BCL", NULL, &buffer);
+       status = acpi_evaluate_object(device->dev->handle, "_BCL", NULL, &buffer);
        if (!ACPI_SUCCESS(status))
-               return_VALUE(status);
+               return status;
        obj = (union acpi_object *)buffer.pointer;
        if (!obj || (obj->type != ACPI_TYPE_PACKAGE)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _BCL data\n"));
+               printk(KERN_ERR PREFIX "Invalid _BCL data\n");
                status = -EFAULT;
                goto err;
        }
 
        *levels = obj;
 
-       return_VALUE(0);
+       return 0;
 
       err:
        kfree(buffer.pointer);
 
-       return_VALUE(status);
+       return status;
 }
 
 static int
@@ -346,13 +341,12 @@ acpi_video_device_lcd_set_level(struct acpi_video_device *device, int level)
        union acpi_object arg0 = { ACPI_TYPE_INTEGER };
        struct acpi_object_list args = { 1, &arg0 };
 
-       ACPI_FUNCTION_TRACE("acpi_video_device_lcd_set_level");
 
        arg0.integer.value = level;
-       status = acpi_evaluate_object(device->handle, "_BCM", &args, NULL);
+       status = acpi_evaluate_object(device->dev->handle, "_BCM", &args, NULL);
 
        printk(KERN_DEBUG "set_level status: %x\n", status);
-       return_VALUE(status);
+       return status;
 }
 
 static int
@@ -360,11 +354,10 @@ acpi_video_device_lcd_get_level_current(struct acpi_video_device *device,
                                        unsigned long *level)
 {
        int status;
-       ACPI_FUNCTION_TRACE("acpi_video_device_lcd_get_level_current");
 
-       status = acpi_evaluate_integer(device->handle, "_BQC", NULL, level);
+       status = acpi_evaluate_integer(device->dev->handle, "_BQC", NULL, level);
 
-       return_VALUE(status);
+       return status;
 }
 
 static int
@@ -377,34 +370,33 @@ acpi_video_device_EDID(struct acpi_video_device *device,
        union acpi_object arg0 = { ACPI_TYPE_INTEGER };
        struct acpi_object_list args = { 1, &arg0 };
 
-       ACPI_FUNCTION_TRACE("acpi_video_device_get_EDID");
 
        *edid = NULL;
 
        if (!device)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        if (length == 128)
                arg0.integer.value = 1;
        else if (length == 256)
                arg0.integer.value = 2;
        else
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
-       status = acpi_evaluate_object(device->handle, "_DDC", &args, &buffer);
+       status = acpi_evaluate_object(device->dev->handle, "_DDC", &args, &buffer);
        if (ACPI_FAILURE(status))
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        obj = (union acpi_object *)buffer.pointer;
 
        if (obj && obj->type == ACPI_TYPE_BUFFER)
                *edid = obj;
        else {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _DDC data\n"));
+               printk(KERN_ERR PREFIX "Invalid _DDC data\n");
                status = -EFAULT;
                kfree(obj);
        }
 
-       return_VALUE(status);
+       return status;
 }
 
 /* bus */
@@ -417,15 +409,14 @@ acpi_video_bus_set_POST(struct acpi_video_bus *video, unsigned long option)
        union acpi_object arg0 = { ACPI_TYPE_INTEGER };
        struct acpi_object_list args = { 1, &arg0 };
 
-       ACPI_FUNCTION_TRACE("acpi_video_bus_set_POST");
 
        arg0.integer.value = option;
 
-       status = acpi_evaluate_integer(video->handle, "_SPD", &args, &tmp);
+       status = acpi_evaluate_integer(video->device->handle, "_SPD", &args, &tmp);
        if (ACPI_SUCCESS(status))
                status = tmp ? (-EINVAL) : (AE_OK);
 
-       return_VALUE(status);
+       return status;
 }
 
 static int
@@ -433,11 +424,9 @@ acpi_video_bus_get_POST(struct acpi_video_bus *video, unsigned long *id)
 {
        int status;
 
-       ACPI_FUNCTION_TRACE("acpi_video_bus_get_POST");
-
-       status = acpi_evaluate_integer(video->handle, "_GPD", NULL, id);
+       status = acpi_evaluate_integer(video->device->handle, "_GPD", NULL, id);
 
-       return_VALUE(status);
+       return status;
 }
 
 static int
@@ -445,12 +434,11 @@ acpi_video_bus_POST_options(struct acpi_video_bus *video,
                            unsigned long *options)
 {
        int status;
-       ACPI_FUNCTION_TRACE("acpi_video_bus_POST_options");
 
-       status = acpi_evaluate_integer(video->handle, "_VPO", NULL, options);
+       status = acpi_evaluate_integer(video->device->handle, "_VPO", NULL, options);
        *options &= 3;
 
-       return_VALUE(status);
+       return status;
 }
 
 /*
@@ -481,7 +469,6 @@ acpi_video_bus_DOS(struct acpi_video_bus *video, int bios_flag, int lcd_flag)
        union acpi_object arg0 = { ACPI_TYPE_INTEGER };
        struct acpi_object_list args = { 1, &arg0 };
 
-       ACPI_FUNCTION_TRACE("acpi_video_bus_DOS");
 
        if (bios_flag < 0 || bios_flag > 3 || lcd_flag < 0 || lcd_flag > 1) {
                status = -1;
@@ -489,10 +476,10 @@ acpi_video_bus_DOS(struct acpi_video_bus *video, int bios_flag, int lcd_flag)
        }
        arg0.integer.value = (lcd_flag << 2) | bios_flag;
        video->dos_setting = arg0.integer.value;
-       acpi_evaluate_object(video->handle, "_DOS", &args, NULL);
+       acpi_evaluate_object(video->device->handle, "_DOS", &args, NULL);
 
       Failed:
-       return_VALUE(status);
+       return status;
 }
 
 /*
@@ -514,29 +501,28 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
        union acpi_object *obj = NULL;
        struct acpi_video_device_brightness *br = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_video_device_find_cap");
 
        memset(&device->cap, 0, 4);
 
-       if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_ADR", &h_dummy1))) {
+       if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_ADR", &h_dummy1))) {
                device->cap._ADR = 1;
        }
-       if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_BCL", &h_dummy1))) {
+       if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_BCL", &h_dummy1))) {
                device->cap._BCL = 1;
        }
-       if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_BCM", &h_dummy1))) {
+       if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_BCM", &h_dummy1))) {
                device->cap._BCM = 1;
        }
-       if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DDC", &h_dummy1))) {
+       if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_DDC", &h_dummy1))) {
                device->cap._DDC = 1;
        }
-       if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DCS", &h_dummy1))) {
+       if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_DCS", &h_dummy1))) {
                device->cap._DCS = 1;
        }
-       if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DGS", &h_dummy1))) {
+       if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_DGS", &h_dummy1))) {
                device->cap._DGS = 1;
        }
-       if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DSS", &h_dummy1))) {
+       if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_DSS", &h_dummy1))) {
                device->cap._DSS = 1;
        }
 
@@ -560,8 +546,7 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
                                o = (union acpi_object *)&obj->package.
                                    elements[i];
                                if (o->type != ACPI_TYPE_INTEGER) {
-                                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                                         "Invalid data\n"));
+                                       printk(KERN_ERR PREFIX "Invalid data\n");
                                        continue;
                                }
                                br->levels[count] = (u32) o->integer.value;
@@ -583,7 +568,7 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
 
        kfree(obj);
 
-       return_VOID;
+       return;
 }
 
 /*
@@ -601,22 +586,22 @@ static void acpi_video_bus_find_cap(struct acpi_video_bus *video)
        acpi_handle h_dummy1;
 
        memset(&video->cap, 0, 4);
-       if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_DOS", &h_dummy1))) {
+       if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_DOS", &h_dummy1))) {
                video->cap._DOS = 1;
        }
-       if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_DOD", &h_dummy1))) {
+       if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_DOD", &h_dummy1))) {
                video->cap._DOD = 1;
        }
-       if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_ROM", &h_dummy1))) {
+       if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_ROM", &h_dummy1))) {
                video->cap._ROM = 1;
        }
-       if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_GPD", &h_dummy1))) {
+       if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_GPD", &h_dummy1))) {
                video->cap._GPD = 1;
        }
-       if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_SPD", &h_dummy1))) {
+       if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_SPD", &h_dummy1))) {
                video->cap._SPD = 1;
        }
-       if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_VPO", &h_dummy1))) {
+       if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_VPO", &h_dummy1))) {
                video->cap._VPO = 1;
        }
 }
@@ -630,10 +615,9 @@ static int acpi_video_bus_check(struct acpi_video_bus *video)
 {
        acpi_status status = -ENOENT;
 
-       ACPI_FUNCTION_TRACE("acpi_video_bus_check");
 
        if (!video)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        /* Since there is no HID, CID and so on for VGA driver, we have
         * to check well known required nodes.
@@ -657,7 +641,7 @@ static int acpi_video_bus_check(struct acpi_video_bus *video)
                status = 0;
        }
 
-       return_VALUE(status);
+       return status;
 }
 
 /* --------------------------------------------------------------------------
@@ -673,7 +657,6 @@ static int acpi_video_device_info_seq_show(struct seq_file *seq, void *offset)
        struct acpi_video_device *dev =
            (struct acpi_video_device *)seq->private;
 
-       ACPI_FUNCTION_TRACE("acpi_video_device_info_seq_show");
 
        if (!dev)
                goto end;
@@ -692,7 +675,7 @@ static int acpi_video_device_info_seq_show(struct seq_file *seq, void *offset)
        seq_printf(seq, "known by bios: %s\n", dev->flags.bios ? "yes" : "no");
 
       end:
-       return_VALUE(0);
+       return 0;
 }
 
 static int
@@ -709,7 +692,6 @@ static int acpi_video_device_state_seq_show(struct seq_file *seq, void *offset)
            (struct acpi_video_device *)seq->private;
        unsigned long state;
 
-       ACPI_FUNCTION_TRACE("acpi_video_device_state_seq_show");
 
        if (!dev)
                goto end;
@@ -729,7 +711,7 @@ static int acpi_video_device_state_seq_show(struct seq_file *seq, void *offset)
                seq_printf(seq, "<not supported>\n");
 
       end:
-       return_VALUE(0);
+       return 0;
 }
 
 static int
@@ -750,13 +732,12 @@ acpi_video_device_write_state(struct file *file,
        char str[12] = { 0 };
        u32 state = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_video_device_write_state");
 
        if (!dev || count + 1 > sizeof str)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (copy_from_user(str, buffer, count))
-               return_VALUE(-EFAULT);
+               return -EFAULT;
 
        str[count] = 0;
        state = simple_strtoul(str, NULL, 0);
@@ -765,9 +746,9 @@ acpi_video_device_write_state(struct file *file,
        status = acpi_video_device_set_state(dev, state);
 
        if (status)
-               return_VALUE(-EFAULT);
+               return -EFAULT;
 
-       return_VALUE(count);
+       return count;
 }
 
 static int
@@ -777,11 +758,10 @@ acpi_video_device_brightness_seq_show(struct seq_file *seq, void *offset)
            (struct acpi_video_device *)seq->private;
        int i;
 
-       ACPI_FUNCTION_TRACE("acpi_video_device_brightness_seq_show");
 
        if (!dev || !dev->brightness) {
                seq_printf(seq, "<not supported>\n");
-               return_VALUE(0);
+               return 0;
        }
 
        seq_printf(seq, "levels: ");
@@ -789,7 +769,7 @@ acpi_video_device_brightness_seq_show(struct seq_file *seq, void *offset)
                seq_printf(seq, " %d", dev->brightness->levels[i]);
        seq_printf(seq, "\ncurrent: %d\n", dev->brightness->curr);
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int
@@ -810,19 +790,18 @@ acpi_video_device_write_brightness(struct file *file,
        unsigned int level = 0;
        int i;
 
-       ACPI_FUNCTION_TRACE("acpi_video_device_write_brightness");
 
        if (!dev || !dev->brightness || count + 1 > sizeof str)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (copy_from_user(str, buffer, count))
-               return_VALUE(-EFAULT);
+               return -EFAULT;
 
        str[count] = 0;
        level = simple_strtoul(str, NULL, 0);
 
        if (level > 100)
-               return_VALUE(-EFAULT);
+               return -EFAULT;
 
        /* validate though the list of available levels */
        for (i = 0; i < dev->brightness->count; i++)
@@ -833,7 +812,7 @@ acpi_video_device_write_brightness(struct file *file,
                        break;
                }
 
-       return_VALUE(count);
+       return count;
 }
 
 static int acpi_video_device_EDID_seq_show(struct seq_file *seq, void *offset)
@@ -844,7 +823,6 @@ static int acpi_video_device_EDID_seq_show(struct seq_file *seq, void *offset)
        int i;
        union acpi_object *edid = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_video_device_EDID_seq_show");
 
        if (!dev)
                goto out;
@@ -869,7 +847,7 @@ static int acpi_video_device_EDID_seq_show(struct seq_file *seq, void *offset)
        else
                kfree(edid);
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int
@@ -884,28 +862,26 @@ static int acpi_video_device_add_fs(struct acpi_device *device)
        struct proc_dir_entry *entry = NULL;
        struct acpi_video_device *vid_dev;
 
-       ACPI_FUNCTION_TRACE("acpi_video_device_add_fs");
 
        if (!device)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        vid_dev = (struct acpi_video_device *)acpi_driver_data(device);
        if (!vid_dev)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        if (!acpi_device_dir(device)) {
                acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
                                                     vid_dev->video->dir);
                if (!acpi_device_dir(device))
-                       return_VALUE(-ENODEV);
+                       return -ENODEV;
                acpi_device_dir(device)->owner = THIS_MODULE;
        }
 
        /* 'info' [R] */
        entry = create_proc_entry("info", S_IRUGO, acpi_device_dir(device));
        if (!entry)
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to create 'info' fs entry\n"));
+               return -ENODEV;
        else {
                entry->proc_fops = &acpi_video_device_info_fops;
                entry->data = acpi_driver_data(device);
@@ -917,8 +893,7 @@ static int acpi_video_device_add_fs(struct acpi_device *device)
            create_proc_entry("state", S_IFREG | S_IRUGO | S_IWUSR,
                              acpi_device_dir(device));
        if (!entry)
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to create 'state' fs entry\n"));
+               return -ENODEV;
        else {
                acpi_video_device_state_fops.write = acpi_video_device_write_state;
                entry->proc_fops = &acpi_video_device_state_fops;
@@ -931,8 +906,7 @@ static int acpi_video_device_add_fs(struct acpi_device *device)
            create_proc_entry("brightness", S_IFREG | S_IRUGO | S_IWUSR,
                              acpi_device_dir(device));
        if (!entry)
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to create 'brightness' fs entry\n"));
+               return -ENODEV;
        else {
                acpi_video_device_brightness_fops.write = acpi_video_device_write_brightness;
                entry->proc_fops = &acpi_video_device_brightness_fops;
@@ -943,25 +917,23 @@ static int acpi_video_device_add_fs(struct acpi_device *device)
        /* 'EDID' [R] */
        entry = create_proc_entry("EDID", S_IRUGO, acpi_device_dir(device));
        if (!entry)
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to create 'brightness' fs entry\n"));
+               return -ENODEV;
        else {
                entry->proc_fops = &acpi_video_device_EDID_fops;
                entry->data = acpi_driver_data(device);
                entry->owner = THIS_MODULE;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_video_device_remove_fs(struct acpi_device *device)
 {
        struct acpi_video_device *vid_dev;
-       ACPI_FUNCTION_TRACE("acpi_video_device_remove_fs");
 
        vid_dev = (struct acpi_video_device *)acpi_driver_data(device);
        if (!vid_dev || !vid_dev->video || !vid_dev->video->dir)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
 
        if (acpi_device_dir(device)) {
                remove_proc_entry("info", acpi_device_dir(device));
@@ -972,7 +944,7 @@ static int acpi_video_device_remove_fs(struct acpi_device *device)
                acpi_device_dir(device) = NULL;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 /* video bus */
@@ -980,7 +952,6 @@ static int acpi_video_bus_info_seq_show(struct seq_file *seq, void *offset)
 {
        struct acpi_video_bus *video = (struct acpi_video_bus *)seq->private;
 
-       ACPI_FUNCTION_TRACE("acpi_video_bus_info_seq_show");
 
        if (!video)
                goto end;
@@ -993,7 +964,7 @@ static int acpi_video_bus_info_seq_show(struct seq_file *seq, void *offset)
                   video->flags.post ? "yes" : "no");
 
       end:
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_video_bus_info_open_fs(struct inode *inode, struct file *file)
@@ -1006,7 +977,6 @@ static int acpi_video_bus_ROM_seq_show(struct seq_file *seq, void *offset)
 {
        struct acpi_video_bus *video = (struct acpi_video_bus *)seq->private;
 
-       ACPI_FUNCTION_TRACE("acpi_video_bus_ROM_seq_show");
 
        if (!video)
                goto end;
@@ -1015,7 +985,7 @@ static int acpi_video_bus_ROM_seq_show(struct seq_file *seq, void *offset)
        seq_printf(seq, "<TODO>\n");
 
       end:
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_video_bus_ROM_open_fs(struct inode *inode, struct file *file)
@@ -1029,7 +999,6 @@ static int acpi_video_bus_POST_info_seq_show(struct seq_file *seq, void *offset)
        unsigned long options;
        int status;
 
-       ACPI_FUNCTION_TRACE("acpi_video_bus_POST_info_seq_show");
 
        if (!video)
                goto end;
@@ -1052,7 +1021,7 @@ static int acpi_video_bus_POST_info_seq_show(struct seq_file *seq, void *offset)
        } else
                seq_printf(seq, "<not supported>\n");
       end:
-       return_VALUE(0);
+       return 0;
 }
 
 static int
@@ -1068,7 +1037,6 @@ static int acpi_video_bus_POST_seq_show(struct seq_file *seq, void *offset)
        int status;
        unsigned long id;
 
-       ACPI_FUNCTION_TRACE("acpi_video_bus_POST_seq_show");
 
        if (!video)
                goto end;
@@ -1081,18 +1049,17 @@ static int acpi_video_bus_POST_seq_show(struct seq_file *seq, void *offset)
        seq_printf(seq, "device posted is <%s>\n", device_decode[id & 3]);
 
       end:
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_video_bus_DOS_seq_show(struct seq_file *seq, void *offset)
 {
        struct acpi_video_bus *video = (struct acpi_video_bus *)seq->private;
 
-       ACPI_FUNCTION_TRACE("acpi_video_bus_DOS_seq_show");
 
        seq_printf(seq, "DOS setting: <%d>\n", video->dos_setting);
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_video_bus_POST_open_fs(struct inode *inode, struct file *file)
@@ -1117,22 +1084,21 @@ acpi_video_bus_write_POST(struct file *file,
        char str[12] = { 0 };
        unsigned long opt, options;
 
-       ACPI_FUNCTION_TRACE("acpi_video_bus_write_POST");
 
        if (!video || count + 1 > sizeof str)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        status = acpi_video_bus_POST_options(video, &options);
        if (!ACPI_SUCCESS(status))
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (copy_from_user(str, buffer, count))
-               return_VALUE(-EFAULT);
+               return -EFAULT;
 
        str[count] = 0;
        opt = strtoul(str, NULL, 0);
        if (opt > 3)
-               return_VALUE(-EFAULT);
+               return -EFAULT;
 
        /* just in case an OEM 'forget' the motherboard... */
        options |= 1;
@@ -1140,11 +1106,11 @@ acpi_video_bus_write_POST(struct file *file,
        if (options & (1ul << opt)) {
                status = acpi_video_bus_set_POST(video, opt);
                if (!ACPI_SUCCESS(status))
-                       return_VALUE(-EFAULT);
+                       return -EFAULT;
 
        }
 
-       return_VALUE(count);
+       return count;
 }
 
 static ssize_t
@@ -1158,25 +1124,24 @@ acpi_video_bus_write_DOS(struct file *file,
        char str[12] = { 0 };
        unsigned long opt;
 
-       ACPI_FUNCTION_TRACE("acpi_video_bus_write_DOS");
 
        if (!video || count + 1 > sizeof str)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (copy_from_user(str, buffer, count))
-               return_VALUE(-EFAULT);
+               return -EFAULT;
 
        str[count] = 0;
        opt = strtoul(str, NULL, 0);
        if (opt > 7)
-               return_VALUE(-EFAULT);
+               return -EFAULT;
 
        status = acpi_video_bus_DOS(video, opt & 0x3, (opt & 0x4) >> 2);
 
        if (!ACPI_SUCCESS(status))
-               return_VALUE(-EFAULT);
+               return -EFAULT;
 
-       return_VALUE(count);
+       return count;
 }
 
 static int acpi_video_bus_add_fs(struct acpi_device *device)
@@ -1184,7 +1149,6 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
        struct proc_dir_entry *entry = NULL;
        struct acpi_video_bus *video;
 
-       ACPI_FUNCTION_TRACE("acpi_video_bus_add_fs");
 
        video = (struct acpi_video_bus *)acpi_driver_data(device);
 
@@ -1192,7 +1156,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
                acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
                                                     acpi_video_dir);
                if (!acpi_device_dir(device))
-                       return_VALUE(-ENODEV);
+                       return -ENODEV;
                video->dir = acpi_device_dir(device);
                acpi_device_dir(device)->owner = THIS_MODULE;
        }
@@ -1200,8 +1164,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
        /* 'info' [R] */
        entry = create_proc_entry("info", S_IRUGO, acpi_device_dir(device));
        if (!entry)
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to create 'info' fs entry\n"));
+               return -ENODEV;
        else {
                entry->proc_fops = &acpi_video_bus_info_fops;
                entry->data = acpi_driver_data(device);
@@ -1211,8 +1174,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
        /* 'ROM' [R] */
        entry = create_proc_entry("ROM", S_IRUGO, acpi_device_dir(device));
        if (!entry)
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to create 'ROM' fs entry\n"));
+               return -ENODEV;
        else {
                entry->proc_fops = &acpi_video_bus_ROM_fops;
                entry->data = acpi_driver_data(device);
@@ -1223,8 +1185,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
        entry =
            create_proc_entry("POST_info", S_IRUGO, acpi_device_dir(device));
        if (!entry)
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to create 'POST_info' fs entry\n"));
+               return -ENODEV;
        else {
                entry->proc_fops = &acpi_video_bus_POST_info_fops;
                entry->data = acpi_driver_data(device);
@@ -1236,8 +1197,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
            create_proc_entry("POST", S_IFREG | S_IRUGO | S_IRUSR,
                              acpi_device_dir(device));
        if (!entry)
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to create 'POST' fs entry\n"));
+               return -ENODEV;
        else {
                acpi_video_bus_POST_fops.write = acpi_video_bus_write_POST;
                entry->proc_fops = &acpi_video_bus_POST_fops;
@@ -1250,8 +1210,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
            create_proc_entry("DOS", S_IFREG | S_IRUGO | S_IRUSR,
                              acpi_device_dir(device));
        if (!entry)
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unable to create 'DOS' fs entry\n"));
+               return -ENODEV;
        else {
                acpi_video_bus_DOS_fops.write = acpi_video_bus_write_DOS;
                entry->proc_fops = &acpi_video_bus_DOS_fops;
@@ -1259,14 +1218,13 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
                entry->owner = THIS_MODULE;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_video_bus_remove_fs(struct acpi_device *device)
 {
        struct acpi_video_bus *video;
 
-       ACPI_FUNCTION_TRACE("acpi_video_bus_remove_fs");
 
        video = (struct acpi_video_bus *)acpi_driver_data(device);
 
@@ -1280,7 +1238,7 @@ static int acpi_video_bus_remove_fs(struct acpi_device *device)
                acpi_device_dir(device) = NULL;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 /* --------------------------------------------------------------------------
@@ -1297,10 +1255,9 @@ acpi_video_bus_get_one_device(struct acpi_device *device,
        int status;
        struct acpi_video_device *data;
 
-       ACPI_FUNCTION_TRACE("acpi_video_bus_get_one_device");
 
        if (!device || !video)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        status =
            acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id);
@@ -1308,11 +1265,10 @@ acpi_video_bus_get_one_device(struct acpi_device *device,
 
                data = kmalloc(sizeof(struct acpi_video_device), GFP_KERNEL);
                if (!data)
-                       return_VALUE(-ENOMEM);
+                       return -ENOMEM;
 
                memset(data, 0, sizeof(struct acpi_video_device));
 
-               data->handle = device->handle;
                strcpy(acpi_device_name(device), ACPI_VIDEO_DEVICE_NAME);
                strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS);
                acpi_driver_data(device) = data;
@@ -1339,7 +1295,7 @@ acpi_video_bus_get_one_device(struct acpi_device *device,
                acpi_video_device_bind(video, data);
                acpi_video_device_find_cap(data);
 
-               status = acpi_install_notify_handler(data->handle,
+               status = acpi_install_notify_handler(device->handle,
                                                     ACPI_DEVICE_NOTIFY,
                                                     acpi_video_device_notify,
                                                     data);
@@ -1359,10 +1315,10 @@ acpi_video_bus_get_one_device(struct acpi_device *device,
 
                acpi_video_device_add_fs(device);
 
-               return_VALUE(0);
+               return 0;
        }
 
-       return_VALUE(-ENOENT);
+       return -ENOENT;
 }
 
 /*
@@ -1405,7 +1361,6 @@ acpi_video_device_bind(struct acpi_video_bus *video,
                       struct acpi_video_device *device)
 {
        int i;
-       ACPI_FUNCTION_TRACE("acpi_video_device_bind");
 
 #define IDS_VAL(i) video->attached_array[i].value.int_val
 #define IDS_BIND(i) video->attached_array[i].bind_info
@@ -1442,17 +1397,15 @@ static int acpi_video_device_enumerate(struct acpi_video_bus *video)
        union acpi_object *dod = NULL;
        union acpi_object *obj;
 
-       ACPI_FUNCTION_TRACE("acpi_video_device_enumerate");
-
-       status = acpi_evaluate_object(video->handle, "_DOD", NULL, &buffer);
+       status = acpi_evaluate_object(video->device->handle, "_DOD", NULL, &buffer);
        if (!ACPI_SUCCESS(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _DOD\n"));
-               return_VALUE(status);
+               ACPI_EXCEPTION((AE_INFO, status, "Evaluating _DOD"));
+               return status;
        }
 
        dod = (union acpi_object *)buffer.pointer;
        if (!dod || (dod->type != ACPI_TYPE_PACKAGE)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _DOD data\n"));
+               ACPI_EXCEPTION((AE_INFO, status, "Invalid _DOD data"));
                status = -EFAULT;
                goto out;
        }
@@ -1476,8 +1429,7 @@ static int acpi_video_device_enumerate(struct acpi_video_bus *video)
                obj = (union acpi_object *)&dod->package.elements[i];
 
                if (obj->type != ACPI_TYPE_INTEGER) {
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                         "Invalid _DOD data\n"));
+                       printk(KERN_ERR PREFIX "Invalid _DOD data\n");
                        active_device_list[i].value.int_val =
                            ACPI_VIDEO_HEAD_INVALID;
                }
@@ -1494,8 +1446,8 @@ static int acpi_video_device_enumerate(struct acpi_video_bus *video)
        video->attached_array = active_device_list;
        video->attached_count = count;
       out:
-       acpi_os_free(buffer.pointer);
-       return_VALUE(status);
+       kfree(buffer.pointer);
+       return status;
 }
 
 /*
@@ -1520,7 +1472,6 @@ static int acpi_video_switch_output(struct acpi_video_bus *video, int event)
        unsigned long state;
        int status = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_video_switch_output");
 
        list_for_each_safe(node, next, &video->video_device_list) {
                dev = container_of(node, struct acpi_video_device, entry);
@@ -1551,7 +1502,7 @@ static int acpi_video_switch_output(struct acpi_video_bus *video, int event)
                break;
        }
 
-       return_VALUE(status);
+       return status;
 }
 
 static int
@@ -1578,7 +1529,6 @@ acpi_video_bus_get_devices(struct acpi_video_bus *video,
        int status = 0;
        struct list_head *node, *next;
 
-       ACPI_FUNCTION_TRACE("acpi_video_get_devices");
 
        acpi_video_device_enumerate(video);
 
@@ -1591,13 +1541,12 @@ acpi_video_bus_get_devices(struct acpi_video_bus *video,
 
                status = acpi_video_bus_get_one_device(dev, video);
                if (ACPI_FAILURE(status)) {
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                         "Cant attach device\n"));
+                       ACPI_EXCEPTION((AE_INFO, status, "Cant attach device"));
                        continue;
                }
 
        }
-       return_VALUE(status);
+       return status;
 }
 
 static int acpi_video_bus_put_one_device(struct acpi_video_device *device)
@@ -1605,10 +1554,9 @@ static int acpi_video_bus_put_one_device(struct acpi_video_device *device)
        acpi_status status;
        struct acpi_video_bus *video;
 
-       ACPI_FUNCTION_TRACE("acpi_video_bus_put_one_device");
 
        if (!device || !device->video)
-               return_VALUE(-ENOENT);
+               return -ENOENT;
 
        video = device->video;
 
@@ -1617,14 +1565,11 @@ static int acpi_video_bus_put_one_device(struct acpi_video_device *device)
        up(&video->sem);
        acpi_video_device_remove_fs(device->dev);
 
-       status = acpi_remove_notify_handler(device->handle,
+       status = acpi_remove_notify_handler(device->dev->handle,
                                            ACPI_DEVICE_NOTIFY,
                                            acpi_video_device_notify);
-       if (ACPI_FAILURE(status))
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Error removing notify handler\n"));
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int acpi_video_bus_put_devices(struct acpi_video_bus *video)
@@ -1632,7 +1577,6 @@ static int acpi_video_bus_put_devices(struct acpi_video_bus *video)
        int status;
        struct list_head *node, *next;
 
-       ACPI_FUNCTION_TRACE("acpi_video_bus_put_devices");
 
        list_for_each_safe(node, next, &video->video_device_list) {
                struct acpi_video_device *data =
@@ -1651,7 +1595,7 @@ static int acpi_video_bus_put_devices(struct acpi_video_bus *video)
                kfree(data);
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 /* acpi_video interface */
@@ -1671,14 +1615,12 @@ static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data)
        struct acpi_video_bus *video = (struct acpi_video_bus *)data;
        struct acpi_device *device = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_video_bus_notify");
        printk("video bus notify\n");
 
        if (!video)
-               return_VOID;
+               return;
 
-       if (acpi_bus_get_device(handle, &device))
-               return_VOID;
+       device = video->device;
 
        switch (event) {
        case ACPI_VIDEO_NOTIFY_SWITCH:  /* User request that a switch occur,
@@ -1707,7 +1649,7 @@ static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data)
                break;
        }
 
-       return_VOID;
+       return;
 }
 
 static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data)
@@ -1716,14 +1658,12 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data)
            (struct acpi_video_device *)data;
        struct acpi_device *device = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_video_device_notify");
 
        printk("video device notify\n");
        if (!video_device)
-               return_VOID;
+               return;
 
-       if (acpi_bus_get_device(handle, &device))
-               return_VOID;
+       device = video_device->dev;
 
        switch (event) {
        case ACPI_VIDEO_NOTIFY_SWITCH:  /* change in status (cycle output device) */
@@ -1743,7 +1683,7 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data)
                                  "Unsupported event [0x%x]\n", event));
                break;
        }
-       return_VOID;
+       return;
 }
 
 static int acpi_video_bus_add(struct acpi_device *device)
@@ -1752,17 +1692,16 @@ static int acpi_video_bus_add(struct acpi_device *device)
        acpi_status status = 0;
        struct acpi_video_bus *video = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_video_bus_add");
 
        if (!device)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        video = kmalloc(sizeof(struct acpi_video_bus), GFP_KERNEL);
        if (!video)
-               return_VALUE(-ENOMEM);
+               return -ENOMEM;
        memset(video, 0, sizeof(struct acpi_video_bus));
 
-       video->handle = device->handle;
+       video->device = device;
        strcpy(acpi_device_name(device), ACPI_VIDEO_BUS_NAME);
        strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS);
        acpi_driver_data(device) = video;
@@ -1782,7 +1721,7 @@ static int acpi_video_bus_add(struct acpi_device *device)
        acpi_video_bus_get_devices(video, device);
        acpi_video_bus_start_devices(video);
 
-       status = acpi_install_notify_handler(video->handle,
+       status = acpi_install_notify_handler(device->handle,
                                             ACPI_DEVICE_NOTIFY,
                                             acpi_video_bus_notify, video);
        if (ACPI_FAILURE(status)) {
@@ -1806,7 +1745,7 @@ static int acpi_video_bus_add(struct acpi_device *device)
        if (result)
                kfree(video);
 
-       return_VALUE(result);
+       return result;
 }
 
 static int acpi_video_bus_remove(struct acpi_device *device, int type)
@@ -1814,21 +1753,17 @@ static int acpi_video_bus_remove(struct acpi_device *device, int type)
        acpi_status status = 0;
        struct acpi_video_bus *video = NULL;
 
-       ACPI_FUNCTION_TRACE("acpi_video_bus_remove");
 
        if (!device || !acpi_driver_data(device))
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        video = (struct acpi_video_bus *)acpi_driver_data(device);
 
        acpi_video_bus_stop_devices(video);
 
-       status = acpi_remove_notify_handler(video->handle,
+       status = acpi_remove_notify_handler(video->device->handle,
                                            ACPI_DEVICE_NOTIFY,
                                            acpi_video_bus_notify);
-       if (ACPI_FAILURE(status))
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Error removing notify handler\n"));
 
        acpi_video_bus_put_devices(video);
        acpi_video_bus_remove_fs(device);
@@ -1836,7 +1771,7 @@ static int acpi_video_bus_remove(struct acpi_device *device, int type)
        kfree(video->attached_array);
        kfree(video);
 
-       return_VALUE(0);
+       return 0;
 }
 
 static int
@@ -1846,10 +1781,9 @@ acpi_video_bus_match(struct acpi_device *device, struct acpi_driver *driver)
        acpi_handle h_dummy2;
        acpi_handle h_dummy3;
 
-       ACPI_FUNCTION_TRACE("acpi_video_bus_match");
 
        if (!device || !driver)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        /* Since there is no HID, CID for ACPI Video drivers, we have
         * to check well known required nodes for each feature we support.
@@ -1858,26 +1792,25 @@ acpi_video_bus_match(struct acpi_device *device, struct acpi_driver *driver)
        /* Does this device able to support video switching ? */
        if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOD", &h_dummy1)) &&
            ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOS", &h_dummy2)))
-               return_VALUE(0);
+               return 0;
 
        /* Does this device able to retrieve a video ROM ? */
        if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_ROM", &h_dummy1)))
-               return_VALUE(0);
+               return 0;
 
        /* Does this device able to configure which video head to be POSTed ? */
        if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_VPO", &h_dummy1)) &&
            ACPI_SUCCESS(acpi_get_handle(device->handle, "_GPD", &h_dummy2)) &&
            ACPI_SUCCESS(acpi_get_handle(device->handle, "_SPD", &h_dummy3)))
-               return_VALUE(0);
+               return 0;
 
-       return_VALUE(-ENODEV);
+       return -ENODEV;
 }
 
 static int __init acpi_video_init(void)
 {
        int result = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_video_init");
 
        /*
           acpi_dbg_level = 0xFFFFFFFF;
@@ -1886,27 +1819,26 @@ static int __init acpi_video_init(void)
 
        acpi_video_dir = proc_mkdir(ACPI_VIDEO_CLASS, acpi_root_dir);
        if (!acpi_video_dir)
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        acpi_video_dir->owner = THIS_MODULE;
 
        result = acpi_bus_register_driver(&acpi_video_bus);
        if (result < 0) {
                remove_proc_entry(ACPI_VIDEO_CLASS, acpi_root_dir);
-               return_VALUE(-ENODEV);
+               return -ENODEV;
        }
 
-       return_VALUE(0);
+       return 0;
 }
 
 static void __exit acpi_video_exit(void)
 {
-       ACPI_FUNCTION_TRACE("acpi_video_exit");
 
        acpi_bus_unregister_driver(&acpi_video_bus);
 
        remove_proc_entry(ACPI_VIDEO_CLASS, acpi_root_dir);
 
-       return_VOID;
+       return;
 }
 
 module_init(acpi_video_init);
index d1387cfe2d30e2ef96914dddd1e0f2ead5650c09..6cc93de0b71d120bcae769c97d9a477d1612caa6 100644 (file)
@@ -2,7 +2,6 @@
  * adummy.c: a dummy ATM driver
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/version.h>
 #include <linux/kernel.h>
index 4048681f36d503ca2030d0954311ce97327cc183..4521a249dd5632b0555c621c43ab4f974be0a627 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/atmdev.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
+#include <linux/poison.h>
 
 #include <asm/atomic.h>
 #include <asm/io.h>
@@ -1995,7 +1996,7 @@ static int __devinit ucode_init (loader_block * lb, amb_dev * dev) {
     }
     i += 1;
   }
-  if (*pointer == 0xdeadbeef) {
+  if (*pointer == ATM_POISON) {
     return loader_start (lb, dev, ucode_start);
   } else {
     // cast needed as there is no %? for pointer differnces
@@ -2286,7 +2287,7 @@ static int __devinit amb_probe(struct pci_dev *pci_dev, const struct pci_device_
        setup_pci_dev(pci_dev);
 
        // grab (but share) IRQ and install handler
-       err = request_irq(irq, interrupt_handler, SA_SHIRQ, DEV_LABEL, dev);
+       err = request_irq(irq, interrupt_handler, IRQF_SHARED, DEV_LABEL, dev);
        if (err < 0) {
                PRINTK (KERN_ERR, "request IRQ failed!");
                goto out_reset;
index 84a93063cfe1a9e54cf3a9665faa1600fe9d92e0..8296420ceaef3a59a422d240efb3e424f9fba8c1 100644 (file)
@@ -23,7 +23,6 @@
 #ifndef AMBASSADOR_H
 #define AMBASSADOR_H
 
-#include <linux/config.h>
 
 #ifdef CONFIG_ATM_AMBASSADOR_DEBUG
 #define DEBUG_AMBASSADOR
index c13c4d736ef56911324acb025b91bbe4bde0279e..df359a6c14f6ab57a140c62bed4d6b274595f674 100644 (file)
@@ -4,7 +4,6 @@
  
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/pci.h>
@@ -1798,7 +1797,7 @@ static int __devinit eni_start(struct atm_dev *dev)
 
        DPRINTK(">eni_start\n");
        eni_dev = ENI_DEV(dev);
-       if (request_irq(eni_dev->irq,&eni_int,SA_SHIRQ,DEV_LABEL,dev)) {
+       if (request_irq(eni_dev->irq,&eni_int,IRQF_SHARED,DEV_LABEL,dev)) {
                printk(KERN_ERR DEV_LABEL "(itf %d): IRQ%d is already in use\n",
                    dev->number,eni_dev->irq);
                error = -EAGAIN;
index d40605c1af73819daf6095dbcd3112bd7fb1c724..38fc054bd6715246f261f5a2e88e432026ef92eb 100644 (file)
@@ -1829,7 +1829,7 @@ static int __devinit fs_init (struct fs_dev *dev)
                init_q (dev, &dev->rx_rq[i], RXB_RQ(i), RXRQ_NENTRIES, 1);
 
        dev->irq = pci_dev->irq;
-       if (request_irq (dev->irq, fs_irq, SA_SHIRQ, "firestream", dev)) {
+       if (request_irq (dev->irq, fs_irq, IRQF_SHARED, "firestream", dev)) {
                printk (KERN_WARNING "couldn't get irq %d for firestream.\n", pci_dev->irq);
                /* XXX undo all previous stuff... */
                return 1;
index 92923bf272332bb9341130edc00eead478aa5d8d..98622130de5b65d9573d7d18856115d9579c7c52 100644 (file)
@@ -25,7 +25,6 @@
 */
 
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/init.h>
@@ -2124,7 +2123,7 @@ fore200e_change_qos(struct atm_vcc* vcc,struct atm_qos* qos, int flags)
 static int __devinit
 fore200e_irq_request(struct fore200e* fore200e)
 {
-    if (request_irq(fore200e->irq, fore200e_interrupt, SA_SHIRQ, fore200e->name, fore200e->atm_dev) < 0) {
+    if (request_irq(fore200e->irq, fore200e_interrupt, IRQF_SHARED, fore200e->name, fore200e->atm_dev) < 0) {
 
        printk(FORE200E "unable to reserve IRQ %s for device %s\n",
               fore200e_irq_itoa(fore200e->irq), fore200e->name);
index 2558eb853235442bc6931c7e40834835c7bf1e0a..f9abfdac33e44820d68897d975315fae91e97d29 100644 (file)
@@ -3,7 +3,6 @@
 #define _FORE200E_H
 
 #ifdef __KERNEL__
-#include <linux/config.h>
 
 /* rx buffer sizes */
 
index a486eb1f1640207c29351a99cddd38ae4684fdca..d369130f423555bd2fde66ef09ddafe32abcaec4 100644 (file)
@@ -55,7 +55,6 @@
 
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/skbuff.h>
@@ -1008,7 +1007,7 @@ he_init_irq(struct he_dev *he_dev)
        he_writel(he_dev, 0x0, GRP_54_MAP);
        he_writel(he_dev, 0x0, GRP_76_MAP);
 
-       if (request_irq(he_dev->pci_dev->irq, he_irq_handler, SA_INTERRUPT|SA_SHIRQ, DEV_LABEL, he_dev)) {
+       if (request_irq(he_dev->pci_dev->irq, he_irq_handler, IRQF_DISABLED|IRQF_SHARED, DEV_LABEL, he_dev)) {
                hprintk("irq %d already in use\n", he_dev->pci_dev->irq);
                return -EINVAL;
        }   
index 821c81e8cd38bb892cf16094a0135a5fd911dbcb..d1113e845f953bc6dc963215a5b9f37936062651 100644 (file)
@@ -2735,7 +2735,7 @@ static int __devinit hrz_probe(struct pci_dev *pci_dev, const struct pci_device_
        irq = pci_dev->irq;
        if (request_irq(irq,
                        interrupt_handler,
-                       SA_SHIRQ, /* irqflags guess */
+                       IRQF_SHARED, /* irqflags guess */
                        DEV_LABEL, /* name guess */
                        dev)) {
                PRINTD(DBG_WARN, "request IRQ failed!");
index e2cc7020fa3ba54c21851708496b4195a0ec33c2..4461229f56a54cf8aaa6c3df5b91bfe3aa62f519 100644 (file)
@@ -30,7 +30,6 @@
 #ifndef DRIVER_ATM_HORIZON_H
 #define DRIVER_ATM_HORIZON_H
 
-#include <linux/config.h>
 
 #ifdef CONFIG_ATM_HORIZON_DEBUG
 #define DEBUG_HORIZON
index b4a76cade646badde872e6895c07c97339465a22..b0369bb20f085043348600a47192298f94f48981 100644 (file)
@@ -34,8 +34,8 @@ static char const rcsid[] =
 
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/pci.h>
+#include <linux/poison.h>
 #include <linux/skbuff.h>
 #include <linux/kernel.h>
 #include <linux/vmalloc.h>
@@ -3387,7 +3387,7 @@ init_card(struct atm_dev *dev)
                writel(SAR_STAT_TMROF, SAR_REG_STAT);
        }
        IPRINTK("%s: Request IRQ ... ", card->name);
-       if (request_irq(pcidev->irq, idt77252_interrupt, SA_INTERRUPT|SA_SHIRQ,
+       if (request_irq(pcidev->irq, idt77252_interrupt, IRQF_DISABLED|IRQF_SHARED,
                        card->name, card) != 0) {
                printk("%s: can't allocate IRQ.\n", card->name);
                deinit_card(card);
@@ -3658,7 +3658,7 @@ probe_sram(struct idt77252_dev *card)
        writel(SAR_CMD_WRITE_SRAM | (0 << 2), SAR_REG_CMD);
 
        for (addr = 0x4000; addr < 0x80000; addr += 0x4000) {
-               writel(0xdeadbeef, SAR_REG_DR0);
+               writel(ATM_POISON, SAR_REG_DR0);
                writel(SAR_CMD_WRITE_SRAM | (addr << 2), SAR_REG_CMD);
 
                writel(SAR_CMD_READ_SRAM | (0 << 2), SAR_REG_CMD);
index 333a7bc609d24b0337bdb2d928ebd8f3d2d57b56..f20b0b2c06c6b19bc2643061e0ac740d692ac467 100644 (file)
@@ -2488,7 +2488,7 @@ static int __devinit ia_start(struct atm_dev *dev)
        u32 ctrl_reg;  
        IF_EVENT(printk(">ia_start\n");)  
        iadev = INPH_IA_DEV(dev);  
-        if (request_irq(iadev->irq, &ia_int, SA_SHIRQ, DEV_LABEL, dev)) {  
+        if (request_irq(iadev->irq, &ia_int, IRQF_SHARED, DEV_LABEL, dev)) {
                 printk(KERN_ERR DEV_LABEL "(itf %d): IRQ%d is already in use\n",  
                     dev->number, iadev->irq);  
                error = -EAGAIN;
index b8d0bd4d6c307d01ff934867b94f57a3af3650f5..133eefcc047507376977417dd056ae6bf4de8ea9 100644 (file)
@@ -43,7 +43,6 @@
 #ifndef IPHASE_H  
 #define IPHASE_H  
 
-#include <linux/config.h>
 
 /************************ IADBG DEFINE *********************************/
 /* IADebugFlag Bit Map */ 
index cac09e353be8d0d87135c7f17e1fb8eaba7a95e8..fe60a59b7fc02e103f8a31f31c0c4ca103166e5d 100644 (file)
@@ -2240,7 +2240,7 @@ static int __devinit lanai_dev_open(struct atm_dev *atmdev)
        conf2_write(lanai);
        reg_write(lanai, TX_FIFO_DEPTH, TxDepth_Reg);
        reg_write(lanai, 0, CBR_ICG_Reg);       /* CBR defaults to no limit */
-       if ((result = request_irq(lanai->pci->irq, lanai_int, SA_SHIRQ,
+       if ((result = request_irq(lanai->pci->irq, lanai_int, IRQF_SHARED,
            DEV_LABEL, lanai)) != 0) {
                printk(KERN_ERR DEV_LABEL ": can't allocate interrupt\n");
                goto error_vcctable;
index 074abc81ec3d099cc7353c1a2568bec68f005aaa..b8036899e56f467d18284dfa3ac852995d450069 100644 (file)
@@ -36,7 +36,6 @@
 /* Header files ***************************************************************/
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/skbuff.h>
 #include <linux/atmdev.h>
@@ -626,7 +625,7 @@ static int __devinit ns_init_card(int i, struct pci_dev *pcidev)
    if (mac[i] == NULL)
       nicstar_init_eprom(card->membase);
 
-   if (request_irq(pcidev->irq, &ns_irq_handler, SA_INTERRUPT | SA_SHIRQ, "nicstar", card) != 0)
+   if (request_irq(pcidev->irq, &ns_irq_handler, IRQF_DISABLED | IRQF_SHARED, "nicstar", card) != 0)
    {
       printk("nicstar%d: can't allocate IRQ %d.\n", i, pcidev->irq);
       error = 9;
index f484747f255e0121199ae60ac4796abb4ef19b1f..2c65e82f0d6b855310cb8e4e95a8a5c8c27a47bb 100644 (file)
@@ -3,7 +3,6 @@
 /* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
@@ -1271,7 +1270,7 @@ static int __init zatm_start(struct atm_dev *dev)
        zatm_dev->rx_map = zatm_dev->tx_map = NULL;
        for (i = 0; i < NR_MBX; i++)
                zatm_dev->mbx_start[i] = 0;
-       error = request_irq(zatm_dev->irq, zatm_int, SA_SHIRQ, DEV_LABEL, dev);
+       error = request_irq(zatm_dev->irq, zatm_int, IRQF_SHARED, DEV_LABEL, dev);
        if (error < 0) {
                printk(KERN_ERR DEV_LABEL "(itf %d): IRQ%d is already in use\n",
                    dev->number,zatm_dev->irq);
index 416fe0fda60cede4b3ad969eda2151b15188a755..ae9165ce15a0a2f2b3b9050bd15e02c95d8bc717 100644 (file)
@@ -6,7 +6,6 @@
 #ifndef DRIVER_ATM_ZATM_H
 #define DRIVER_ATM_ZATM_H
 
-#include <linux/config.h>
 #include <linux/skbuff.h>
 #include <linux/atm.h>
 #include <linux/atmdev.h>
index 050d86d0b872880c11807e9ece9bfd8f6b793377..83fa8b291a59ebdbcdf036cb331d86a9fe564a85 100644 (file)
@@ -8,7 +8,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/device.h>
 #include <linux/module.h>
 #include <linux/errno.h>
index 9aa1274602625fa6beb6c463838d77a770800919..de8908320f235f0d92b9a21b7cea4b9ea96375c7 100644 (file)
@@ -10,7 +10,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/device.h>
 #include <linux/module.h>
 #include <linux/init.h>
index 27c2176895dee0ccb5efd195d008f8a0333a0904..b21f864c9ce8810a6c16f0e091395dfffb1e545a 100644 (file)
@@ -8,7 +8,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/device.h>
 #include <linux/err.h>
 #include <linux/init.h>
index b400314e1c62d46d9d2dc047cb76a08292b7f9ff..562600dd540a942a08b49277f06209b016fb8d07 100644 (file)
@@ -8,7 +8,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/device.h>
 #include <linux/module.h>
 #include <linux/errno.h>
index eae2bdc183bb7741a85c23f086d156c95b1d0317..d7de1753e09412198db9707cab7dd8484eeab2d8 100644 (file)
@@ -40,24 +40,13 @@ static ssize_t node_read_meminfo(struct sys_device * dev, char * buf)
        int n;
        int nid = dev->id;
        struct sysinfo i;
-       struct page_state ps;
        unsigned long inactive;
        unsigned long active;
        unsigned long free;
 
        si_meminfo_node(&i, nid);
-       get_page_state_node(&ps, nid);
        __get_zone_counts(&active, &inactive, &free, NODE_DATA(nid));
 
-       /* Check for negative values in these approximate counters */
-       if ((long)ps.nr_dirty < 0)
-               ps.nr_dirty = 0;
-       if ((long)ps.nr_writeback < 0)
-               ps.nr_writeback = 0;
-       if ((long)ps.nr_mapped < 0)
-               ps.nr_mapped = 0;
-       if ((long)ps.nr_slab < 0)
-               ps.nr_slab = 0;
 
        n = sprintf(buf, "\n"
                       "Node %d MemTotal:     %8lu kB\n"
@@ -71,7 +60,12 @@ static ssize_t node_read_meminfo(struct sys_device * dev, char * buf)
                       "Node %d LowFree:      %8lu kB\n"
                       "Node %d Dirty:        %8lu kB\n"
                       "Node %d Writeback:    %8lu kB\n"
+                      "Node %d FilePages:    %8lu kB\n"
                       "Node %d Mapped:       %8lu kB\n"
+                      "Node %d AnonPages:    %8lu kB\n"
+                      "Node %d PageTables:   %8lu kB\n"
+                      "Node %d NFS Unstable: %8lu kB\n"
+                      "Node %d Bounce:       %8lu kB\n"
                       "Node %d Slab:         %8lu kB\n",
                       nid, K(i.totalram),
                       nid, K(i.freeram),
@@ -82,10 +76,15 @@ static ssize_t node_read_meminfo(struct sys_device * dev, char * buf)
                       nid, K(i.freehigh),
                       nid, K(i.totalram - i.totalhigh),
                       nid, K(i.freeram - i.freehigh),
-                      nid, K(ps.nr_dirty),
-                      nid, K(ps.nr_writeback),
-                      nid, K(ps.nr_mapped),
-                      nid, K(ps.nr_slab));
+                      nid, K(node_page_state(nid, NR_FILE_DIRTY)),
+                      nid, K(node_page_state(nid, NR_WRITEBACK)),
+                      nid, K(node_page_state(nid, NR_FILE_PAGES)),
+                      nid, K(node_page_state(nid, NR_FILE_MAPPED)),
+                      nid, K(node_page_state(nid, NR_ANON_PAGES)),
+                      nid, K(node_page_state(nid, NR_PAGETABLE)),
+                      nid, K(node_page_state(nid, NR_UNSTABLE_NFS)),
+                      nid, K(node_page_state(nid, NR_BOUNCE)),
+                      nid, K(node_page_state(nid, NR_SLAB)));
        n += hugetlb_report_node_meminfo(nid, buf + n);
        return n;
 }
@@ -95,28 +94,6 @@ static SYSDEV_ATTR(meminfo, S_IRUGO, node_read_meminfo, NULL);
 
 static ssize_t node_read_numastat(struct sys_device * dev, char * buf)
 {
-       unsigned long numa_hit, numa_miss, interleave_hit, numa_foreign;
-       unsigned long local_node, other_node;
-       int i, cpu;
-       pg_data_t *pg = NODE_DATA(dev->id);
-       numa_hit = 0;
-       numa_miss = 0;
-       interleave_hit = 0;
-       numa_foreign = 0;
-       local_node = 0;
-       other_node = 0;
-       for (i = 0; i < MAX_NR_ZONES; i++) {
-               struct zone *z = &pg->node_zones[i];
-               for_each_online_cpu(cpu) {
-                       struct per_cpu_pageset *ps = zone_pcp(z,cpu);
-                       numa_hit += ps->numa_hit;
-                       numa_miss += ps->numa_miss;
-                       numa_foreign += ps->numa_foreign;
-                       interleave_hit += ps->interleave_hit;
-                       local_node += ps->local_node;
-                       other_node += ps->other_node;
-               }
-       }
        return sprintf(buf,
                       "numa_hit %lu\n"
                       "numa_miss %lu\n"
@@ -124,12 +101,12 @@ static ssize_t node_read_numastat(struct sys_device * dev, char * buf)
                       "interleave_hit %lu\n"
                       "local_node %lu\n"
                       "other_node %lu\n",
-                      numa_hit,
-                      numa_miss,
-                      numa_foreign,
-                      interleave_hit,
-                      local_node,
-                      other_node);
+                      node_page_state(dev->id, NUMA_HIT),
+                      node_page_state(dev->id, NUMA_MISS),
+                      node_page_state(dev->id, NUMA_FOREIGN),
+                      node_page_state(dev->id, NUMA_INTERLEAVE_HIT),
+                      node_page_state(dev->id, NUMA_LOCAL),
+                      node_page_state(dev->id, NUMA_OTHER));
 }
 static SYSDEV_ATTR(numastat, S_IRUGO, node_read_numastat, NULL);
 
index 0d2e101e4f158c60b88f66db966d5047b2dc05ed..fdfa3d0cf6afa6f0bf2fb247f54333abfab8f1fc 100644 (file)
@@ -19,7 +19,6 @@
  * ancestral dependencies that the subsystem list maintains.
  */
 
-#include <linux/config.h>
 #include <linux/device.h>
 #include "power.h"
 
index 8826a5b6673eb9e4dfae4bb0d0b53126b77e4119..3483ae4d57f59a09025d8d0c49d2100ea72c81ee 100644 (file)
@@ -8,7 +8,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/device.h>
 #include <asm/semaphore.h>
 
index 6858178b3aff8d28e727e2d487adf289817324bd..04e5db445c74005a95a03c0c02de31df40aeabe0 100644 (file)
@@ -12,7 +12,6 @@
  * add themselves as children of the system bus.
  */
 
-#include <linux/config.h>
 #include <linux/sysdev.h>
 #include <linux/err.h>
 #include <linux/module.h>
index 50ca1aa4ee3b3956550f23fce6d1b098f0c86e30..4cd23c3eab41ab5e028cabc0474425323b5b5686 100644 (file)
@@ -3014,7 +3014,7 @@ DAC960_DetectController(struct pci_dev *PCI_Device,
      Acquire shared access to the IRQ Channel.
   */
   IRQ_Channel = PCI_Device->irq;
-  if (request_irq(IRQ_Channel, InterruptHandler, SA_SHIRQ,
+  if (request_irq(IRQ_Channel, InterruptHandler, IRQF_SHARED,
                      Controller->FullModelName, Controller) < 0)
   {
        DAC960_Error("Unable to acquire IRQ Channel %d for Controller at\n",
index a317e43039526ab586eae5a1f2bb73a9fe31345c..0b80fbb8dbfde08fa393d306432b647ef0ebf687 100644 (file)
@@ -43,7 +43,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
index 05fb08312c01c619fbc176a5246f277d4a90b34a..1c4df22dfd2a960a2309570e093828e570096d94 100644 (file)
@@ -3159,7 +3159,7 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
        /* make sure the board interrupts are off */
        hba[i]->access.set_intr_mask(hba[i], CCISS_INTR_OFF);
        if (request_irq(hba[i]->intr[SIMPLE_MODE_INT], do_cciss_intr,
-                       SA_INTERRUPT | SA_SHIRQ, hba[i]->devname, hba[i])) {
+                       IRQF_DISABLED | IRQF_SHARED, hba[i]->devname, hba[i])) {
                printk(KERN_ERR "cciss: Unable to get irq %d for %s\n",
                       hba[i]->intr[SIMPLE_MODE_INT], hba[i]->devname);
                goto clean2;
index bfd245df0a8c5bb81a79828d38b65b153e5dd0e3..757f42dd8e86683bf4afdbc9312f37a9237dbff8 100644 (file)
@@ -408,7 +408,7 @@ static int __init cpqarray_register_ctlr( int i, struct pci_dev *pdev)
        }
        hba[i]->access.set_intr_mask(hba[i], 0);
        if (request_irq(hba[i]->intr, do_ida_intr,
-               SA_INTERRUPT|SA_SHIRQ, hba[i]->devname, hba[i]))
+               IRQF_DISABLED|IRQF_SHARED, hba[i]->devname, hba[i]))
        {
                printk(KERN_ERR "cpqarray: Unable to get irq %d for %s\n",
                                hba[i]->intr, hba[i]->devname);
index 0242cbb86a8793d24ac4617fc344a43f6dcf9ca4..5109fa37c662161ecc55bca09c537c40b21fce01 100644 (file)
@@ -249,18 +249,6 @@ static int irqdma_allocated;
 #include <linux/cdrom.h>       /* for the compatibility eject ioctl */
 #include <linux/completion.h>
 
-/*
- * Interrupt freeing also means /proc VFS work - dont do it
- * from interrupt context. We push this work into keventd:
- */
-static void fd_free_irq_fn(void *data)
-{
-       fd_free_irq();
-}
-
-static DECLARE_WORK(fd_free_irq_work, fd_free_irq_fn, NULL);
-
-
 static struct request *current_req;
 static struct request_queue *floppy_queue;
 static void do_fd_request(request_queue_t * q);
@@ -826,15 +814,6 @@ static int set_dor(int fdc, char mask, char data)
                        UDRS->select_date = jiffies;
                }
        }
-       /*
-        *      We should propagate failures to grab the resources back
-        *      nicely from here. Actually we ought to rewrite the fd
-        *      driver some day too.
-        */
-       if (newdor & FLOPPY_MOTOR_MASK)
-               floppy_grab_irq_and_dma();
-       if (olddor & FLOPPY_MOTOR_MASK)
-               floppy_release_irq_and_dma();
        return olddor;
 }
 
@@ -892,8 +871,6 @@ static int _lock_fdc(int drive, int interruptible, int line)
                       line);
                return -1;
        }
-       if (floppy_grab_irq_and_dma() == -1)
-               return -EBUSY;
 
        if (test_and_set_bit(0, &fdc_busy)) {
                DECLARE_WAITQUEUE(wait, current);
@@ -915,6 +892,8 @@ static int _lock_fdc(int drive, int interruptible, int line)
 
                set_current_state(TASK_RUNNING);
                remove_wait_queue(&fdc_wait, &wait);
+
+               flush_scheduled_work();
        }
        command_status = FD_COMMAND_NONE;
 
@@ -948,7 +927,6 @@ static inline void unlock_fdc(void)
        if (elv_next_request(floppy_queue))
                do_fd_request(floppy_queue);
        spin_unlock_irqrestore(&floppy_lock, flags);
-       floppy_release_irq_and_dma();
        wake_up(&fdc_wait);
 }
 
@@ -3694,8 +3672,8 @@ static int floppy_release(struct inode *inode, struct file *filp)
        }
        if (!UDRS->fd_ref)
                opened_bdev[drive] = NULL;
-       floppy_release_irq_and_dma();
        mutex_unlock(&open_lock);
+
        return 0;
 }
 
@@ -3726,9 +3704,6 @@ static int floppy_open(struct inode *inode, struct file *filp)
        if (UDRS->fd_ref == -1 || (UDRS->fd_ref && (filp->f_flags & O_EXCL)))
                goto out2;
 
-       if (floppy_grab_irq_and_dma())
-               goto out2;
-
        if (filp->f_flags & O_EXCL)
                UDRS->fd_ref = -1;
        else
@@ -3805,7 +3780,6 @@ out:
                UDRS->fd_ref--;
        if (!UDRS->fd_ref)
                opened_bdev[drive] = NULL;
-       floppy_release_irq_and_dma();
 out2:
        mutex_unlock(&open_lock);
        return res;
@@ -3822,14 +3796,9 @@ static int check_floppy_change(struct gendisk *disk)
                return 1;
 
        if (time_after(jiffies, UDRS->last_checked + UDP->checkfreq)) {
-               if (floppy_grab_irq_and_dma()) {
-                       return 1;
-               }
-
                lock_fdc(drive, 0);
                poll_drive(0, 0);
                process_fd_request();
-               floppy_release_irq_and_dma();
        }
 
        if (UTESTF(FD_DISK_CHANGED) ||
@@ -4346,7 +4315,6 @@ static int __init floppy_init(void)
        fdc = 0;
        del_timer(&fd_timeout);
        current_drive = 0;
-       floppy_release_irq_and_dma();
        initialising = 0;
        if (have_no_fdc) {
                DPRINT("no floppy controllers found\n");
@@ -4504,7 +4472,7 @@ static void floppy_release_irq_and_dma(void)
        if (irqdma_allocated) {
                fd_disable_dma();
                fd_free_dma();
-               schedule_work(&fd_free_irq_work);
+               fd_free_irq();
                irqdma_allocated = 0;
        }
        set_dor(0, ~0, 8);
@@ -4600,8 +4568,6 @@ void cleanup_module(void)
        /* eject disk, if any */
        fd_eject(0);
 
-       flush_scheduled_work();         /* fd_free_irq() might be pending */
-
        wait_for_completion(&device_release);
 }
 
index 013c5daddb0b3bfc1163506a0be14961c9ac32e1..7b3b94ddddccb4aaf5cab64e6e94923ab2fb6c49 100644 (file)
@@ -50,7 +50,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/sched.h>
index 39662f0c9cce65afd9da3b397607093f05a3f026..0a1b1ea36ddcdc3064ba4daa35567a01e0f5b72d 100644 (file)
@@ -50,9 +50,9 @@
 #define DBG_RX          0x0200
 #define DBG_TX          0x0400
 static unsigned int debugflags;
-static unsigned int nbds_max = 16;
 #endif /* NDEBUG */
 
+static unsigned int nbds_max = 16;
 static struct nbd_device nbd_dev[MAX_NBD];
 
 /*
index ce94aa11f6a7020d900a5e07def3959479366ea6..4b258f7836f32f0b99b2f0607e3986a7bdebcbd1 100644 (file)
@@ -21,7 +21,6 @@
 #define PI_VERSION      "1.06"
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/kmod.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 3e4cce5e4736351befab56db81c42527223dade8..bde2c64b634660b0a49057b127ce5e05a97c8cc1 100644 (file)
@@ -44,7 +44,6 @@
  *************************************************************************/
 
 #include <linux/pktcdvd.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index a729013a39737b24541a999f38950c7206ae6181..5537974fb2424603c89983ba9643b2aabab13015 100644 (file)
@@ -29,7 +29,6 @@
 
 #define DEVICE_NAME "PS/2 ESDI"
 
-#include <linux/config.h>
 #include <linux/major.h>
 #include <linux/errno.h>
 #include <linux/wait.h>
@@ -341,9 +340,9 @@ static int __init ps2esdi_geninit(void)
        /* try to grab IRQ, and try to grab a slow IRQ if it fails, so we can
           share with the SCSI driver */
        if (request_irq(PS2ESDI_IRQ, ps2esdi_interrupt_handler,
-                 SA_INTERRUPT | SA_SHIRQ, "PS/2 ESDI", &ps2esdi_gendisk)
+                 IRQF_DISABLED | IRQF_SHARED, "PS/2 ESDI", &ps2esdi_gendisk)
            && request_irq(PS2ESDI_IRQ, ps2esdi_interrupt_handler,
-                          SA_SHIRQ, "PS/2 ESDI", &ps2esdi_gendisk)
+                          IRQF_SHARED, "PS/2 ESDI", &ps2esdi_gendisk)
            ) {
                printk("%s: Unable to get IRQ %d\n", DEVICE_NAME, PS2ESDI_IRQ);
                error = -EBUSY;
index a9e1c2524c2a9c99b93b36c544e716eb299cdc7f..3cf246abb5ecd09ccc4de255a60f4982cc7e1e8e 100644 (file)
@@ -42,7 +42,6 @@
  * and set blk_size for -ENOSPC,     Werner Fink <werner@suse.de>, Apr '99
  */
 
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/slab.h>
 #include <asm/atomic.h>
index 628877945f9badbae4f529f63e2add13292d35cf..cc42e762396f28fccff473f32b9cc1c73ef862fb 100644 (file)
@@ -16,7 +16,6 @@
  * handle GCR disks
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -251,8 +250,6 @@ static int floppy_open(struct inode *inode, struct file *filp);
 static int floppy_release(struct inode *inode, struct file *filp);
 static int floppy_check_change(struct gendisk *disk);
 static int floppy_revalidate(struct gendisk *disk);
-static int swim3_add_device(struct device_node *swims);
-int swim3_init(void);
 
 #ifndef CONFIG_PMAC_MEDIABAY
 #define check_media_bay(which, what)   1
@@ -1012,114 +1009,63 @@ static struct block_device_operations floppy_fops = {
        .revalidate_disk= floppy_revalidate,
 };
 
-int swim3_init(void)
-{
-       struct device_node *swim;
-       int err = -ENOMEM;
-       int i;
-
-       swim = find_devices("floppy");
-       while (swim && (floppy_count < MAX_FLOPPIES))
-       {
-               swim3_add_device(swim);
-               swim = swim->next;
-       }
-
-       swim = find_devices("swim3");
-       while (swim && (floppy_count < MAX_FLOPPIES))
-       {
-               swim3_add_device(swim);
-               swim = swim->next;
-       }
-
-       if (!floppy_count)
-               return -ENODEV;
-
-       for (i = 0; i < floppy_count; i++) {
-               disks[i] = alloc_disk(1);
-               if (!disks[i])
-                       goto out;
-       }
-
-       if (register_blkdev(FLOPPY_MAJOR, "fd")) {
-               err = -EBUSY;
-               goto out;
-       }
-
-       swim3_queue = blk_init_queue(do_fd_request, &swim3_lock);
-       if (!swim3_queue) {
-               err = -ENOMEM;
-               goto out_queue;
-       }
-
-       for (i = 0; i < floppy_count; i++) {
-               struct gendisk *disk = disks[i];
-               disk->major = FLOPPY_MAJOR;
-               disk->first_minor = i;
-               disk->fops = &floppy_fops;
-               disk->private_data = &floppy_states[i];
-               disk->queue = swim3_queue;
-               disk->flags |= GENHD_FL_REMOVABLE;
-               sprintf(disk->disk_name, "fd%d", i);
-               set_capacity(disk, 2880);
-               add_disk(disk);
-       }
-       return 0;
-
-out_queue:
-       unregister_blkdev(FLOPPY_MAJOR, "fd");
-out:
-       while (i--)
-               put_disk(disks[i]);
-       /* shouldn't we do something with results of swim_add_device()? */
-       return err;
-}
-
-static int swim3_add_device(struct device_node *swim)
+static int swim3_add_device(struct macio_dev *mdev, int index)
 {
+       struct device_node *swim = mdev->ofdev.node;
        struct device_node *mediabay;
-       struct floppy_state *fs = &floppy_states[floppy_count];
-       struct resource res_reg, res_dma;
+       struct floppy_state *fs = &floppy_states[index];
+       int rc = -EBUSY;
 
-       if (of_address_to_resource(swim, 0, &res_reg) ||
-           of_address_to_resource(swim, 1, &res_dma)) {
-               printk(KERN_ERR "swim3: Can't get addresses\n");
-               return -EINVAL;
+       /* Check & Request resources */
+       if (macio_resource_count(mdev) < 2) {
+               printk(KERN_WARNING "ifd%d: no address for %s\n",
+                      index, swim->full_name);
+               return -ENXIO;
        }
-       if (request_mem_region(res_reg.start, res_reg.end - res_reg.start + 1,
-                              " (reg)") == NULL) {
-               printk(KERN_ERR "swim3: Can't request register space\n");
-               return -EINVAL;
+       if (macio_irq_count(mdev) < 2) {
+               printk(KERN_WARNING "fd%d: no intrs for device %s\n",
+                       index, swim->full_name);
        }
-       if (request_mem_region(res_dma.start, res_dma.end - res_dma.start + 1,
-                              " (dma)") == NULL) {
-               release_mem_region(res_reg.start,
-                                  res_reg.end - res_reg.start + 1);
-               printk(KERN_ERR "swim3: Can't request DMA space\n");
-               return -EINVAL;
+       if (macio_request_resource(mdev, 0, "swim3 (mmio)")) {
+               printk(KERN_ERR "fd%d: can't request mmio resource for %s\n",
+                      index, swim->full_name);
+               return -EBUSY;
        }
-
-       if (swim->n_intrs < 2) {
-               printk(KERN_INFO "swim3: expecting 2 intrs (n_intrs:%d)\n",
-                      swim->n_intrs);
-               release_mem_region(res_reg.start,
-                                  res_reg.end - res_reg.start + 1);
-               release_mem_region(res_dma.start,
-                                  res_dma.end - res_dma.start + 1);
-               return -EINVAL;
+       if (macio_request_resource(mdev, 1, "swim3 (dma)")) {
+               printk(KERN_ERR "fd%d: can't request dma resource for %s\n",
+                      index, swim->full_name);
+               macio_release_resource(mdev, 0);
+               return -EBUSY;
        }
+       dev_set_drvdata(&mdev->ofdev.dev, fs);
 
-       mediabay = (strcasecmp(swim->parent->type, "media-bay") == 0) ? swim->parent : NULL;
+       mediabay = (strcasecmp(swim->parent->type, "media-bay") == 0) ?
+               swim->parent : NULL;
        if (mediabay == NULL)
                pmac_call_feature(PMAC_FTR_SWIM3_ENABLE, swim, 0, 1);
        
        memset(fs, 0, sizeof(*fs));
        spin_lock_init(&fs->lock);
        fs->state = idle;
-       fs->swim3 = (struct swim3 __iomem *)ioremap(res_reg.start, 0x200);
-       fs->dma = (struct dbdma_regs __iomem *)ioremap(res_dma.start, 0x200);
-       fs->swim3_intr = swim->intrs[0].line;
-       fs->dma_intr = swim->intrs[1].line;
+       fs->swim3 = (struct swim3 __iomem *)
+               ioremap(macio_resource_start(mdev, 0), 0x200);
+       if (fs->swim3 == NULL) {
+               printk("fd%d: couldn't map registers for %s\n",
+                      index, swim->full_name);
+               rc = -ENOMEM;
+               goto out_release;
+       }
+       fs->dma = (struct dbdma_regs __iomem *)
+               ioremap(macio_resource_start(mdev, 1), 0x200);
+       if (fs->dma == NULL) {
+               printk("fd%d: couldn't map DMA for %s\n",
+                      index, swim->full_name);
+               iounmap(fs->swim3);
+               rc = -ENOMEM;
+               goto out_release;
+       }
+       fs->swim3_intr = macio_irq(mdev, 0);
+       fs->dma_intr = macio_irq(mdev, 1);;
        fs->cur_cyl = -1;
        fs->cur_sector = -1;
        fs->secpercyl = 36;
@@ -1133,15 +1079,16 @@ static int swim3_add_device(struct device_node *swim)
        st_le16(&fs->dma_cmd[1].command, DBDMA_STOP);
 
        if (request_irq(fs->swim3_intr, swim3_interrupt, 0, "SWIM3", fs)) {
-               printk(KERN_ERR "Couldn't get irq %d for SWIM3\n", fs->swim3_intr);
+               printk(KERN_ERR "fd%d: couldn't request irq %d for %s\n",
+                      index, fs->swim3_intr, swim->full_name);
                pmac_call_feature(PMAC_FTR_SWIM3_ENABLE, swim, 0, 0);
+               goto out_unmap;
                return -EBUSY;
        }
 /*
        if (request_irq(fs->dma_intr, fd_dma_interrupt, 0, "SWIM3-dma", fs)) {
                printk(KERN_ERR "Couldn't get irq %d for SWIM3 DMA",
                       fs->dma_intr);
-               pmac_call_feature(PMAC_FTR_SWIM3_ENABLE, swim, 0, 0);
                return -EBUSY;
        }
 */
@@ -1151,8 +1098,90 @@ static int swim3_add_device(struct device_node *swim)
        printk(KERN_INFO "fd%d: SWIM3 floppy controller %s\n", floppy_count,
                mediabay ? "in media bay" : "");
 
-       floppy_count++;
-       
+       return 0;
+
+ out_unmap:
+       iounmap(fs->dma);
+       iounmap(fs->swim3);
+
+ out_release:
+       macio_release_resource(mdev, 0);
+       macio_release_resource(mdev, 1);
+
+       return rc;
+}
+
+static int __devinit swim3_attach(struct macio_dev *mdev, const struct of_device_id *match)
+{
+       int i, rc;
+       struct gendisk *disk;
+
+       /* Add the drive */
+       rc = swim3_add_device(mdev, floppy_count);
+       if (rc)
+               return rc;
+
+       /* Now create the queue if not there yet */
+       if (swim3_queue == NULL) {
+               /* If we failed, there isn't much we can do as the driver is still
+                * too dumb to remove the device, just bail out
+                */
+               if (register_blkdev(FLOPPY_MAJOR, "fd"))
+                       return 0;
+               swim3_queue = blk_init_queue(do_fd_request, &swim3_lock);
+               if (swim3_queue == NULL) {
+                       unregister_blkdev(FLOPPY_MAJOR, "fd");
+                       return 0;
+               }
+       }
+
+       /* Now register that disk. Same comment about failure handling */
+       i = floppy_count++;
+       disk = disks[i] = alloc_disk(1);
+       if (disk == NULL)
+               return 0;
+
+       disk->major = FLOPPY_MAJOR;
+       disk->first_minor = i;
+       disk->fops = &floppy_fops;
+       disk->private_data = &floppy_states[i];
+       disk->queue = swim3_queue;
+       disk->flags |= GENHD_FL_REMOVABLE;
+       sprintf(disk->disk_name, "fd%d", i);
+       set_capacity(disk, 2880);
+       add_disk(disk);
+
+       return 0;
+}
+
+static struct of_device_id swim3_match[] =
+{
+       {
+       .name           = "swim3",
+       },
+       {
+       .compatible     = "ohare-swim3"
+       },
+       {
+       .compatible     = "swim3"
+       },
+};
+
+static struct macio_driver swim3_driver =
+{
+       .name           = "swim3",
+       .match_table    = swim3_match,
+       .probe          = swim3_attach,
+#if 0
+       .suspend        = swim3_suspend,
+       .resume         = swim3_resume,
+#endif
+};
+
+
+int swim3_init(void)
+{
+       macio_register_driver(&swim3_driver);
        return 0;
 }
 
index 10a4aa5fb54df10d0f48b710a02bd12a26d382f5..c6beee18a07c90f8f965e2f1a566517463fd7f16 100644 (file)
@@ -1676,7 +1676,7 @@ static int carm_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
 
        pci_set_master(pdev);
 
-       rc = request_irq(pdev->irq, carm_interrupt, SA_SHIRQ, DRV_NAME, host);
+       rc = request_irq(pdev->irq, carm_interrupt, IRQF_SHARED, DRV_NAME, host);
        if (rc) {
                printk(KERN_ERR DRV_NAME "(%s): irq alloc failure\n",
                       pci_name(pdev));
index 585197b95af762118d5692b0d5303b713f95f472..5d8925bd90454c68d33d00d3263e93dac09b91df 100644 (file)
@@ -35,7 +35,6 @@
  */
 
 //#define DEBUG /* uncomment if you want debugging info (pr_debug) */
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/fs.h>
 #include <linux/bio.h>
@@ -1041,7 +1040,7 @@ static int __devinit mm_pci_probe(struct pci_dev *dev, const struct pci_device_i
        card->win_size = data;
 
 
-       if (request_irq(dev->irq, mm_interrupt, SA_SHIRQ, "pci-umem", card)) {
+       if (request_irq(dev->irq, mm_interrupt, IRQF_SHARED, "pci-umem", card)) {
                printk(KERN_ERR "MM%d: Unable to allocate IRQ\n", card->card_number);
                ret = -ENODEV;
 
index 3e7a067cc0871dafce5f0427f2690c383983a2c3..6f67141f4de0fbcc3b0d5461fb0a7766b7e627ff 100644 (file)
@@ -22,7 +22,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/kernel.h>
index 8947c8837dacf8bc64ebf202e87f1da87b58e730..23f96213f4acad7e9c5f72b51e1e392e22a208c8 100644 (file)
@@ -21,7 +21,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/kernel.h>
index 473a13b22b298e09a20f63749e8ce9f2d576f06f..8eebf9ca378664d3068fd963e1ae7f0fccf97b29 100644 (file)
@@ -20,7 +20,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/kernel.h>
@@ -740,6 +739,7 @@ static int bluecard_open(bluecard_info_t *info)
 
        hdev->type = HCI_PCCARD;
        hdev->driver_data = info;
+       SET_HCIDEV_DEV(hdev, &info->p_dev->dev);
 
        hdev->open     = bluecard_hci_open;
        hdev->close    = bluecard_hci_close;
index 9446960ac742914f3c912eb15a2870bb4dc42432..e0231dc2cb1a87a4d14425b22e2dbc0d0f8631b0 100644 (file)
@@ -21,7 +21,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/kernel.h>
index b94ac2f9f7baf2d5e9cc0641e52de23cd1536d13..df7bb016df491bdda5296eeee2b74e60e7713704 100644 (file)
@@ -21,7 +21,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/kernel.h>
@@ -583,6 +582,7 @@ static int bt3c_open(bt3c_info_t *info)
 
        hdev->type = HCI_PCCARD;
        hdev->driver_data = info;
+       SET_HCIDEV_DEV(hdev, &info->p_dev->dev);
 
        hdev->open     = bt3c_hci_open;
        hdev->close    = bt3c_hci_close;
index 9ce4c93467e57da73794711497e80936baaeaf3d..746ccca97f6f93aae72b8ffff71d6be269cb3417 100644 (file)
@@ -20,7 +20,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/kernel.h>
@@ -503,6 +502,7 @@ static int btuart_open(btuart_info_t *info)
 
        hdev->type = HCI_PCCARD;
        hdev->driver_data = info;
+       SET_HCIDEV_DEV(hdev, &info->p_dev->dev);
 
        hdev->open     = btuart_hci_open;
        hdev->close    = btuart_hci_close;
index ed8dca84ff690a9a9918fdf1f19ef6788ab3a441..0e99def8a1e3886f9abab5591343600515943efb 100644 (file)
@@ -20,7 +20,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/kernel.h>
@@ -485,6 +484,7 @@ static int dtl1_open(dtl1_info_t *info)
 
        hdev->type = HCI_PCCARD;
        hdev->driver_data = info;
+       SET_HCIDEV_DEV(hdev, &info->p_dev->dev);
 
        hdev->open     = dtl1_hci_open;
        hdev->close    = dtl1_hci_close;
index 7bd4ef90411542f6996596ae0f36d9a0880d22de..d0cface535fb33e851aeab4548c2bcd6097340dd 100644 (file)
@@ -22,7 +22,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/kernel.h>
index 4804d474dc8735d4a2365258385551134134c616..ad62abbbb739ae797560fa26391d6afa2a04a2ff 100644 (file)
@@ -23,7 +23,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/kernel.h>
index 613673b12fa6711cb8b749c8aea03cc0fc1c7b01..1994270c16e1992536380b620ef70afcf33c28bb 100644 (file)
@@ -23,7 +23,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/kernel.h>
index 92382e8232855188a1f588a739c5c98a03b055ef..6a0c2230f82fe64fdf60319f30a4c325501d76a5 100644 (file)
@@ -31,7 +31,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/kernel.h>
@@ -123,6 +122,9 @@ static struct usb_device_id blacklist_ids[] = {
        /* RTX Telecom based adapter with buggy SCO support */
        { USB_DEVICE(0x0400, 0x0807), .driver_info = HCI_BROKEN_ISOC },
 
+       /* Belkin F8T012 */
+       { USB_DEVICE(0x050d, 0x0012), .driver_info = HCI_WRONG_SCO_MTU },
+
        /* Digianswer devices */
        { USB_DEVICE(0x08fd, 0x0001), .driver_info = HCI_DIGIANSWER },
        { USB_DEVICE(0x08fd, 0x0002), .driver_info = HCI_IGNORE },
@@ -130,6 +132,9 @@ static struct usb_device_id blacklist_ids[] = {
        /* CSR BlueCore Bluetooth Sniffer */
        { USB_DEVICE(0x0a12, 0x0002), .driver_info = HCI_SNIFFER },
 
+       /* Frontline ComProbe Bluetooth Sniffer */
+       { USB_DEVICE(0x16d3, 0x0002), .driver_info = HCI_SNIFFER },
+
        { }     /* Terminating entry */
 };
 
@@ -985,6 +990,9 @@ static int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id
        if (reset || id->driver_info & HCI_RESET)
                set_bit(HCI_QUIRK_RESET_ON_INIT, &hdev->quirks);
 
+       if (id->driver_info & HCI_WRONG_SCO_MTU)
+               set_bit(HCI_QUIRK_FIXUP_BUFFER_SIZE, &hdev->quirks);
+
        if (id->driver_info & HCI_SNIFFER) {
                if (le16_to_cpu(udev->descriptor.bcdDevice) > 0x997)
                        set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks);
@@ -1043,10 +1051,81 @@ static void hci_usb_disconnect(struct usb_interface *intf)
        hci_free_dev(hdev);
 }
 
+static int hci_usb_suspend(struct usb_interface *intf, pm_message_t message)
+{
+       struct hci_usb *husb = usb_get_intfdata(intf);
+       struct list_head killed;
+       unsigned long flags;
+       int i;
+
+       if (!husb || intf == husb->isoc_iface)
+               return 0;
+
+       hci_suspend_dev(husb->hdev);
+
+       INIT_LIST_HEAD(&killed);
+
+       for (i = 0; i < 4; i++) {
+               struct _urb_queue *q = &husb->pending_q[i];
+               struct _urb *_urb, *_tmp;
+
+               while ((_urb = _urb_dequeue(q))) {
+                       /* reset queue since _urb_dequeue sets it to NULL */
+                       _urb->queue = q;
+                       usb_kill_urb(&_urb->urb);
+                       list_add(&_urb->list, &killed);
+               }
+
+               spin_lock_irqsave(&q->lock, flags);
+
+               list_for_each_entry_safe(_urb, _tmp, &killed, list) {
+                       list_move_tail(&_urb->list, &q->head);
+               }
+
+               spin_unlock_irqrestore(&q->lock, flags);
+       }
+
+       return 0;
+}
+
+static int hci_usb_resume(struct usb_interface *intf)
+{
+       struct hci_usb *husb = usb_get_intfdata(intf);
+       unsigned long flags;
+       int i, err = 0;
+
+       if (!husb || intf == husb->isoc_iface)
+               return 0;
+       
+       for (i = 0; i < 4; i++) {
+               struct _urb_queue *q = &husb->pending_q[i];
+               struct _urb *_urb;
+
+               spin_lock_irqsave(&q->lock, flags);
+
+               list_for_each_entry(_urb, &q->head, list) {
+                       err = usb_submit_urb(&_urb->urb, GFP_ATOMIC);
+                       if (err)
+                               break;
+               }
+
+               spin_unlock_irqrestore(&q->lock, flags);
+
+               if (err)
+                       return -EIO;
+       }
+
+       hci_resume_dev(husb->hdev);
+
+       return 0;
+}
+
 static struct usb_driver hci_usb_driver = {
        .name           = "hci_usb",
        .probe          = hci_usb_probe,
        .disconnect     = hci_usb_disconnect,
+       .suspend        = hci_usb_suspend,
+       .resume         = hci_usb_resume,
        .id_table       = bluetooth_ids,
 };
 
index 37100a6ea1a895a0b7a020550d590aef5bdff382..963fc55cdc85766225be38492551a0f3a1857f87 100644 (file)
@@ -35,6 +35,7 @@
 #define HCI_SNIFFER            0x10
 #define HCI_BCM92035           0x20
 #define HCI_BROKEN_ISOC                0x40
+#define HCI_WRONG_SCO_MTU      0x80
 
 #define HCI_MAX_IFACE_NUM      3
 
index 85738223ff0c47648c50b5985652baa0e1387e87..aac67a3a6019958a5ad77347aa0dcc11c6609c99 100644 (file)
@@ -23,7 +23,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/kernel.h>
@@ -278,7 +277,6 @@ static int vhci_open(struct inode *inode, struct file *file)
 
        hdev->type = HCI_VHCI;
        hdev->driver_data = vhci;
-       SET_HCIDEV_DEV(hdev, vhci_miscdev.dev);
 
        hdev->open     = vhci_open_dev;
        hdev->close    = vhci_close_dev;
index 3170eaa250873bf5f0dae15b88aacf66d2a3ef1e..ca27ee89240babcc1fac21f505973670e2e96855 100644 (file)
 /* #define ERRLOGMASK (CD_WARNING|CD_OPEN|CD_COUNT_TRACKS|CD_CLOSE) */
 /* #define ERRLOGMASK (CD_WARNING|CD_REG_UNREG|CD_DO_IOCTL|CD_OPEN|CD_CLOSE|CD_COUNT_TRACKS) */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/buffer_head.h>
index 5f0f2027f29e46ebb6593662423b4f8522792dfd..37bdb0163f0d1b47acf2df88392b318de984480a 100644 (file)
@@ -3141,7 +3141,7 @@ int __init cdu31a_init(void)
 
        if (cdu31a_irq > 0) {
                if (request_irq
-                   (cdu31a_irq, cdu31a_interrupt, SA_INTERRUPT,
+                   (cdu31a_irq, cdu31a_interrupt, IRQF_DISABLED,
                     "cdu31a", NULL)) {
                        printk(KERN_WARNING PFX "Unable to grab IRQ%d for "
                                        "the CDU31A driver\n", cdu31a_irq);
index 4ee288688fed492378f87fb2f10c1fdcf587fe7d..9b05ddd23141dbd4acb8b53b7bef3589de587cf4 100644 (file)
@@ -914,7 +914,7 @@ static void seek(int lba)
        cd->dsb = wait_dsb();
 }
 
-uch bcdbin(unsigned char bcd)
+static uch bcdbin(unsigned char bcd)
 {                              /* stolen from mcd.c! */
        return (bcd >> 4) * 10 + (bcd & 0xf);
 }
@@ -1532,7 +1532,7 @@ static void __init parse_options(void)
        }
 }
 
-static int __cm206_init(void)
+static int __init __cm206_init(void)
 {
        parse_options();
 #if !defined(AUTO_PROBE_MODULE)
@@ -1593,8 +1593,3 @@ __setup("cm206=", cm206_setup);
 #endif                         /* !MODULE */
 MODULE_ALIAS_BLOCKDEV_MAJOR(CM206_CDROM_MAJOR);
 
-/*
- * Local variables:
- * compile-command: "gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe -fno-strength-reduce -m486 -DMODULE -DMODVERSIONS -include /usr/src/linux/include/linux/modversions.h  -c -o cm206.o cm206.c"
- * End:
- */
index 788c7a0b2fe301600f4a5c6106e12fdb95592007..dcd1ab684f3e0dfa120fb373bdc16912f8f132c4 100644 (file)
@@ -1193,7 +1193,7 @@ static int __init mcdx_init_drive(int drive)
        }
 
        xtrace(INIT, "init() subscribe irq and i/o\n");
-       if (request_irq(stuffp->irq, mcdx_intr, SA_INTERRUPT, "mcdx", stuffp)) {
+       if (request_irq(stuffp->irq, mcdx_intr, IRQF_DISABLED, "mcdx", stuffp)) {
                release_region(stuffp->wreg_data, MCDX_IO_SIZE);
                xwarn("%s=0x%03x,%d: Init failed. Can't get irq (%d).\n",
                      MCDX, stuffp->wreg_data, stuffp->irq, stuffp->irq);
index 2fc966c65a0e4458293150c62cba30eda352e659..ba50e5a712f23fe2fe68511274fb7f3cc1d8dbec 100644 (file)
 #include <asm/io.h>
 #include <asm/uaccess.h>
 #include <stdarg.h>
-#include <linux/config.h>
 #include "sbpcd.h"
 
 #define MAJOR_NR MATSUSHITA_CDROM_MAJOR
index 8f7cc452af8da7143a7e77280ba639f909ea1857..30ab56258a92ff4fc82d333c03ffa08d8c255c5c 100644 (file)
@@ -1527,7 +1527,7 @@ static int __init sony535_init(void)
        }
        if (sony535_irq_used > 0) {
            if (request_irq(sony535_irq_used, cdu535_interrupt,
-                                               SA_INTERRUPT, CDU535_HANDLE, NULL)) {
+                                               IRQF_DISABLED, CDU535_HANDLE, NULL)) {
                        printk("Unable to grab IRQ%d for the " CDU535_MESSAGE_NAME
                                        " driver; polling instead.\n", sony535_irq_used);
                        sony535_irq_used = 0;
index f74eeeb8e37709167933ac53c3b7e23c41f2488f..8cd52984cda5230b8ecbf93561801cfc72b8977d 100644 (file)
@@ -8,7 +8,6 @@
  * work is done in the northbridge(s).
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/init.h>
index ffcf15c30e90b023fb5ee960ddefd412856f6bae..d9c5a9142ad1daa4a5e5de83e11175e7e0863e28 100644 (file)
@@ -1059,7 +1059,7 @@ ioctl_out:
        return ret_val;
 }
 
-static struct file_operations agp_fops =
+static const struct file_operations agp_fops =
 {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
index a92ab53a13703bc4c7df95380613ab2062166503..cc5ea347a8a7899a9e3228289697a2cd88378839 100644 (file)
@@ -27,7 +27,6 @@
  * TODO:
  * - Allocate more than order 0 pages to avoid too much linear map splitting.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/init.h>
index 6602b3156df590a0a0057154d45fbda371259361..9d6713a93ed74ddb74adaf18aa85fd22e0ee6508 100644 (file)
@@ -31,7 +31,6 @@
  *             ever possible.
  */
 
-#include <linux/config.h>
 #include <linux/delay.h>
 
 #undef SERIAL_PARANOIA_CHECK
@@ -2052,7 +2051,7 @@ static int __init rs_init(void)
 
        /* set ISRs, and then disable the rx interrupts */
        request_irq(IRQ_AMIGA_TBE, ser_tx_int, 0, "serial TX", state);
-       request_irq(IRQ_AMIGA_RBF, ser_rx_int, SA_INTERRUPT, "serial RX", state);
+       request_irq(IRQ_AMIGA_RBF, ser_rx_int, IRQF_DISABLED, "serial RX", state);
 
        /* turn off Rx and Tx interrupts */
        custom.intena = IF_RBF | IF_TBE;
index 72fb60765c45a4f973c77ae67c916e85aff80485..10a389dafd60ffe99fc8f052fb7330cf28f5832f 100644 (file)
@@ -112,7 +112,7 @@ static int ac_ioctl(struct inode *, struct file *, unsigned int,
                    unsigned long);
 static irqreturn_t ac_interrupt(int, void *, struct pt_regs *);
 
-static struct file_operations ac_fops = {
+static const struct file_operations ac_fops = {
        .owner = THIS_MODULE,
        .llseek = no_llseek,
        .read = ac_read,
@@ -229,7 +229,7 @@ static int __init applicom_init(void)
                        continue;
                }
 
-               if (request_irq(dev->irq, &ac_interrupt, SA_SHIRQ, "Applicom PCI", &dummy)) {
+               if (request_irq(dev->irq, &ac_interrupt, IRQF_SHARED, "Applicom PCI", &dummy)) {
                        printk(KERN_INFO "Could not allocate IRQ %d for PCI Applicom device.\n", dev->irq);
                        iounmap(RamIO);
                        pci_disable_device(dev);
@@ -276,7 +276,7 @@ static int __init applicom_init(void)
                printk(KERN_NOTICE "Applicom ISA card found at mem 0x%lx, irq %d\n", mem + (LEN_RAM_IO*i), irq);
 
                if (!numisa) {
-                       if (request_irq(irq, &ac_interrupt, SA_SHIRQ, "Applicom ISA", &dummy)) {
+                       if (request_irq(irq, &ac_interrupt, IRQF_SHARED, "Applicom ISA", &dummy)) {
                                printk(KERN_WARNING "Could not allocate IRQ %d for ISA Applicom device.\n", irq);
                                iounmap(RamIO);
                                apbs[boardno - 1].RamIO = NULL;
index c85a4fa60da7e235b207a6ba84d305928ec1e142..04a12027a740a57dea956fd3abbba1785739500e 100644 (file)
@@ -11,7 +11,6 @@
  * Fix bug in inverse translation. Stanislav Voronyi <stas@cnti.uanet.kharkov.ua>, Dec 1998
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kd.h>
 #include <linux/errno.h>
index 46d66037b917c5851222b56af77f4b158ce793aa..8ce3f34cfc2226ac213f1eeec63b84908c4313e8 100644 (file)
@@ -158,7 +158,7 @@ static int cs5535_gpio_open(struct inode *inode, struct file *file)
        return nonseekable_open(inode, file);
 }
 
-static struct file_operations cs5535_gpio_fops = {
+static const struct file_operations cs5535_gpio_fops = {
        .owner  = THIS_MODULE,
        .write  = cs5535_gpio_write,
        .read   = cs5535_gpio_read,
index 2657eeba7da63aec1bce32abe8e45a5a4fcb89a0..c1c67281750da61ef1750706bb8351e780cb3e43 100644 (file)
@@ -633,7 +633,6 @@ static char rcsid[] =
 /*
  * Include section 
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
@@ -4613,7 +4612,7 @@ cy_detect_isa(void)
 
                 /* allocate IRQ */
                 if(request_irq(cy_isa_irq, cyy_interrupt,
-                                  SA_INTERRUPT, "Cyclom-Y", &cy_card[j]))
+                                  IRQF_DISABLED, "Cyclom-Y", &cy_card[j]))
                 {
                         printk("Cyclom-Y/ISA found at 0x%lx ",
                                 (unsigned long) cy_isa_address);
@@ -4786,7 +4785,7 @@ cy_detect_pci(void)
 
                 /* allocate IRQ */
                 if(request_irq(cy_pci_irq, cyy_interrupt,
-                       SA_SHIRQ, "Cyclom-Y", &cy_card[j]))
+                       IRQF_SHARED, "Cyclom-Y", &cy_card[j]))
                 {
                         printk("Cyclom-Y/PCI found at 0x%lx ",
                            (ulong) cy_pci_phys2);
@@ -4966,7 +4965,7 @@ cy_detect_pci(void)
                 /* allocate IRQ only if board has an IRQ */
                if( (cy_pci_irq != 0) && (cy_pci_irq != 255) ) {
                    if(request_irq(cy_pci_irq, cyz_interrupt,
-                       SA_SHIRQ, "Cyclades-Z", &cy_card[j]))
+                       IRQF_SHARED, "Cyclades-Z", &cy_card[j]))
                    {
                         printk("Cyclom-8Zo/PCI found at 0x%lx ",
                            (ulong) cy_pci_phys2);
@@ -5060,7 +5059,7 @@ cy_detect_pci(void)
                 /* allocate IRQ only if board has an IRQ */
                if( (cy_pci_irq != 0) && (cy_pci_irq != 255) ) {
                    if(request_irq(cy_pci_irq, cyz_interrupt,
-                       SA_SHIRQ, "Cyclades-Z", &cy_card[j]))
+                       IRQF_SHARED, "Cyclades-Z", &cy_card[j]))
                    {
                         printk("Cyclom-Ze/PCI found at 0x%lx ",
                            (ulong) cy_pci_phys2);
index aa1440934e95acd1b0d0a64dd815aa3b5f14876b..85f404e25c7364d2a176b2ba2d75aa9d735da57e 100644 (file)
@@ -16,7 +16,6 @@
  *      console device I strongly recommend to use only one.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <asm/dec/machtype.h>
 
index 9da0ddb892b58fd3a0db271797ed80d378d27c6f..5642ac43e0f5fd84da2682b57d7ada29c81b3a1d 100644 (file)
@@ -38,7 +38,6 @@
 
 #if defined(__linux__)
 #if defined(__KERNEL__)
-#include <linux/config.h>
 #endif
 #include <asm/ioctl.h>         /* For _IO* macros */
 #define DRM_IOCTL_NR(n)                _IOC_NR(n)
index cb76e5ca9a23eed527b196a05158f09975f0addf..d2a56182bc35786a08c681abb273fea450e3abdd 100644 (file)
@@ -44,7 +44,6 @@
  * can build the DRM (part of PI DRI). 4/21/2000 S + B */
 #include <asm/current.h>
 #endif                         /* __alpha__ */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/miscdevice.h>
index 611a1173091de92116cb4a018cbd0d473bdadee3..ebdb7182c4fd7e2c973d27a5aaa602861058c960 100644 (file)
@@ -130,7 +130,7 @@ static int drm_irq_install(drm_device_t * dev)
 
        /* Install handler */
        if (drm_core_check_feature(dev, DRIVER_IRQ_SHARED))
-               sh_flags = SA_SHIRQ;
+               sh_flags = IRQF_SHARED;
 
        ret = request_irq(dev->irq, dev->driver->irq_handler,
                          sh_flags, dev->devname, dev);
index 7e3318e1d1c655c2d93682ffbf910cc5aa78d8f0..5681cae1d404980fb9a2c123912e6d836778a5ee 100644 (file)
@@ -33,7 +33,6 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include <linux/config.h>
 #include <linux/highmem.h>
 #include "drmP.h"
 
index 714d9aedcff5dd38200eaf18dfcf029f1a36722c..f1b97aff10cf65eb8304651dc776ccd3693271e9 100644 (file)
@@ -33,7 +33,6 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include <linux/config.h>
 #include <linux/highmem.h>
 #include <linux/vmalloc.h>
 #include "drmP.h"
index d117cc9971922f5ec8a6c713da435221c4eb2af7..74581af806e11d073e8b1ac6b5d29c6bdb0cea31 100644 (file)
@@ -31,7 +31,6 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include <linux/config.h>
 #include "drmP.h"
 
 typedef struct drm_mem_stats {
index ce81bf248200d619a097a6e2e564774b9ded3d6a..06ef7ddbe67d7f091e7706cdb70bb21389750e5a 100644 (file)
@@ -31,7 +31,6 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include <linux/config.h>
 #include <linux/vmalloc.h>
 #include "drmP.h"
 
index 0b9f98a7eb10b1e2528e763be712f7e56c4c8911..51ad98c685c3d9d102e0a0ae92e7c3c444780d98 100644 (file)
@@ -12,7 +12,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/device.h>
 #include <linux/kdev_t.h>
 #include <linux/err.h>
index c13f9abb41e9b2f3ad88a8303e525ebf874b35d5..dd45111a48547619063d30dfdadd2eb2c78a81ba 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 2000 David S. Miller (davem@redhat.com)
  */
 
-#include <linux/config.h>
 #include "ffb.h"
 #include "drmP.h"
 
index dfe6ad2b6a6e22ef23bf20dfe4c41064ae4a42e6..fabb9a817966cecde6b4f0ff5e83c8e36d1b8ea9 100644 (file)
@@ -30,7 +30,6 @@
  *    Gareth Hughes <gareth@valinux.com>
  */
 
-#include <linux/config.h>
 #include "drmP.h"
 #include "drm.h"
 #include "i810_drm.h"
index 722658188f5f45619ec8515c6214979f458dde93..389597e4a623281b1c7db76766ddd9b52b15f791 100644 (file)
@@ -32,7 +32,6 @@
  *    Keith Whitwell <keith@tungstengraphics.com>
  */
 
-#include <linux/config.h>
 #include "drmP.h"
 #include "drm.h"
 #include "i830_drm.h"
index 9f7ed0e0351b0c39cab6751c97df2b5694b5a872..e30f556b79f10b1a82c372c9cd8969d1aabce830 100644 (file)
@@ -29,7 +29,6 @@
  *    Gareth Hughes <gareth@valinux.com>
  */
 
-#include <linux/config.h>
 #include "drmP.h"
 #include "drm.h"
 #include "mga_drm.h"
index e20450ae220e3d8d109b12cbc4ac481f54842be9..6108e7587e12470daba9576ef185458f5fc545c1 100644 (file)
@@ -29,7 +29,6 @@
  *    Gareth Hughes <gareth@valinux.com>
  */
 
-#include <linux/config.h>
 #include "drmP.h"
 #include "drm.h"
 #include "r128_drm.h"
index b04ed1b562b9509c7e83635888c8f44baf6ae07b..eb985c2a31e96b3a81ac2ae3ef37357834cb2fb7 100644 (file)
@@ -29,7 +29,6 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include <linux/config.h>
 #include "drmP.h"
 #include "drm.h"
 #include "radeon_drm.h"
index aa6c0d1a82f87caec7ae419ccee64cf51261634b..eee52aa92a7c9942fc937c377d684ea1bb799c7b 100644 (file)
@@ -23,7 +23,6 @@
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include <linux/config.h>
 #include "drmP.h"
 #include "savage_drm.h"
 #include "savage_drv.h"
index 6f6d7d613ede7dbcade3db4d04988a1c96dfc950..5e9dc86f2956f5ed93683ca618f375b9917e03b2 100644 (file)
@@ -25,7 +25,6 @@
  *
  */
 
-#include <linux/config.h>
 #include "drmP.h"
 #include "sis_drm.h"
 #include "sis_drv.h"
index baa4416032a82f053214e34dbf82203ebdc43361..012ff2e356b2a7574a1c15dad979884bd39bea80 100644 (file)
@@ -30,7 +30,6 @@
  *    Gareth Hughes <gareth@valinux.com>
  */
 
-#include <linux/config.h>
 #include "drmP.h"
 #include "tdfx_drv.h"
 
index 3f012255d31532e9181d7880bc2e2f27539c6040..b3d364d793d748bf06eeb9833fbada3b38dff0b0 100644 (file)
@@ -22,7 +22,6 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include <linux/config.h>
 #include "drmP.h"
 #include "via_drm.h"
 #include "via_drv.h"
index d755cac14bc12b051efab89ae4a55381776d9701..21c8229f544388cfb2d75f68218abaac215b4c17 100644 (file)
@@ -281,7 +281,7 @@ static unsigned int ds1286_poll(struct file *file, poll_table *wait)
  *     The various file operations we support.
  */
 
-static struct file_operations ds1286_fops = {
+static const struct file_operations ds1286_fops = {
        .llseek         = no_llseek,
        .read           = ds1286_read,
        .poll           = ds1286_poll,
index a75e8609be01f65f605d13a8f063ac6f5f93496d..bcdb107aa96726c59c5226aacbe65df4bd9f5788 100644 (file)
@@ -12,7 +12,6 @@
 *!
 *!***************************************************************************/
 
-#include <linux/config.h>
 
 #include <linux/fs.h>
 #include <linux/init.h>
@@ -283,7 +282,7 @@ get_rtc_status(char *buf)
 
 /* The various file operations we support. */
 
-static struct file_operations rtc_fops = {
+static const struct file_operations rtc_fops = {
        .owner          = THIS_MODULE,
        .ioctl          = rtc_ioctl,
 };
index 62cda25724e30d6501870683c53849f5d8e273a5..48cb8f0e8ebf8000e5dcc697d1d20383ae7cfd50 100644 (file)
@@ -2,7 +2,6 @@
  * linux/drivers/char/ds1620.c: Dallas Semiconductors DS1620
  *   thermometer driver (as used in the Rebel.com NetWinder)
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/miscdevice.h>
@@ -337,7 +336,7 @@ proc_therm_ds1620_read(char *buf, char **start, off_t offset,
 static struct proc_dir_entry *proc_therm_ds1620;
 #endif
 
-static struct file_operations ds1620_fops = {
+static const struct file_operations ds1620_fops = {
        .owner          = THIS_MODULE,
        .open           = nonseekable_open,
        .read           = ds1620_read,
index 09b413618b5781e8c8294e66396361ab5e6354df..9b1bf60ffbe7f536deabd2e252479e0a9370808b 100644 (file)
@@ -483,7 +483,7 @@ static int dsp56k_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-static struct file_operations dsp56k_fops = {
+static const struct file_operations dsp56k_fops = {
        .owner          = THIS_MODULE,
        .read           = dsp56k_read,
        .write          = dsp56k_write,
index da2c89f1b8bc9e15399e37a56a091ad9ea0870ff..5e82c3bad2e31214fcc76053caf1c4995e08950a 100644 (file)
@@ -94,7 +94,7 @@ static int dtlk_release(struct inode *, struct file *);
 static int dtlk_ioctl(struct inode *inode, struct file *file,
                      unsigned int cmd, unsigned long arg);
 
-static struct file_operations dtlk_fops =
+static const struct file_operations dtlk_fops =
 {
        .owner          = THIS_MODULE,
        .read           = dtlk_read,
index 4aed66968821db9d978fa646558fe1e8d6844f39..abac18b1871c5a7102ea15d9b69f39e9dc461875 100644 (file)
@@ -26,7 +26,6 @@
  * (prumpf@tux.org).
  */
 
-#include <linux/config.h>
 
 #include <linux/spinlock.h>
 #include <linux/sched.h>
index 0090e7a4fcd34bd67cd04c73869072fce59bf7e7..004141d535a27852eda7d3a9ea287893ea3db2e7 100644 (file)
@@ -285,7 +285,7 @@ efi_rtc_close(struct inode *inode, struct file *file)
  *     The various file operations we support.
  */
 
-static struct file_operations efi_rtc_fops = {
+static const struct file_operations efi_rtc_fops = {
        .owner          = THIS_MODULE,
        .ioctl          = efi_rtc_ioctl,
        .open           = efi_rtc_open,
index d0b3890d93021165572b53ef876f01729704ffb3..86d290e9f307044041fed353cf6bca3ed0cc44cc 100644 (file)
@@ -30,7 +30,6 @@
 /* See README.epca for change history --DAT*/
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
index 9827d170ca17ff7cc0726ef09fd83c90de64a3fd..afcd83d9984be5b00937c7959d3bc7476ec2041c 100644 (file)
@@ -883,7 +883,7 @@ static int startup(struct esp_struct * info)
         * Allocate the IRQ
         */
 
-       retval = request_irq(info->irq, rs_interrupt_single, SA_SHIRQ,
+       retval = request_irq(info->irq, rs_interrupt_single, IRQF_SHARED,
                             "esp serial", info);
 
        if (retval) {
index 093fdf98b19a999dddc9b8ebe1dfe87dd4a2ad15..65c9d2ec60bdd7221a30a776fba377c37b89c078 100644 (file)
@@ -1268,7 +1268,7 @@ static int fdc_grab_irq_and_dma(void)
                /*  Get fast interrupt handler.
                 */
                if (request_irq(fdc.irq, ftape_interrupt,
-                               SA_INTERRUPT, "ft", ftape_id)) {
+                               IRQF_DISABLED, "ft", ftape_id)) {
                        TRACE_ABORT(-EIO, ft_t_bug,
                                    "Unable to grab IRQ%d for ftape driver",
                                    fdc.irq);
index 956b2586e138a150e385e7fda9fb93c464fb177e..8e50bfd35a5279781b2d08210480d27fbbc9da79 100644 (file)
@@ -24,7 +24,6 @@
  *      functions.
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/jiffies.h>
 #include <asm/system.h>
index 32e0439117900d1cb21aaae87bbf9750590b536c..5d7c1ce92d597a4371042016f180587c3fdfba94 100644 (file)
@@ -25,7 +25,6 @@
  *      QIC-40/80/3010/3020 floppy-tape driver "ftape" for Linux.
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/mm.h>
 #include <linux/mman.h>
index b54260d457c2a73eaa25c723c15244edb2b759a1..4998132a81d1f772a2f89371869264d085301558 100644 (file)
@@ -21,7 +21,6 @@
  *      for the QIC-40/80/3010/3020 floppy-tape driver for Linux.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
index c66251e997ed528037c4154008e03335bf2dd62a..e805b15e0a1239afd81ef8b63298ab3e4369a257 100644 (file)
@@ -26,7 +26,6 @@
  *     Old code removed, switched to dynamic proc entry.
  */
 
-#include <linux/config.h>
 
 #if defined(CONFIG_PROC_FS) && defined(CONFIG_FT_PROC_FS)
 
index 280a1a55d87ea280d575f27812dddc9619f72562..678340acd0b732141cb78fc23e0bc2345d718103 100644 (file)
@@ -25,7 +25,6 @@
  *      "ftape" for Linux.
  */
 
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/mm.h>
index fa7cd20ee66c78714ebfade3998cacc6cdefea9d..2950810c708502c7f30801b35aa6368bab3a51e3 100644 (file)
@@ -28,7 +28,6 @@
  *      QIC-40/80/3010/3020 floppy-tape driver "ftape" for Linux.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 
 /*
index 5dc3a380c9bf3d05fb47a0c997d853af6bbe92c3..8e0dc4a07ca600d93552142cccf1678fdf11a331 100644 (file)
@@ -25,7 +25,6 @@
  *      exports to its high level clients
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/ftape.h>
index 6c7874e5c199ec32f5ae8297fb0e41d0d9cc2804..22ba0f5d00cfbbd74cbff390352020dd86c438dd 100644 (file)
@@ -24,7 +24,6 @@
  *      for the QIC-40/80/3010/3020 floppy-tape driver for Linux.
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/mm.h>
 #include <linux/module.h>
index 4141598919906a3871a160b82f170d3fffc74ef2..8e6f2d7ac74ec26f29f59a906dd2ca3b73ed40be 100644 (file)
@@ -27,7 +27,6 @@
  *      for the QIC-40/80 floppy-tape driver for Linux.
  */
 
-#include <linux/config.h>
 #include <linux/ioctl.h>
 #include <linux/mtio.h>
 
index 3eeb869a9a11f22dca28bff078f5d9ae96998c77..164a1aa77a2fb2cc06eaee3a2f338cd79a280aa9 100644 (file)
@@ -20,7 +20,6 @@
  *      to the ftape floppy tape driver for Linux
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
@@ -87,7 +86,7 @@ static ssize_t zft_read (struct file *fp, char __user *buff,
 static ssize_t zft_write(struct file *fp, const char __user *buff,
                         size_t req_len, loff_t *ppos);
 
-static struct file_operations zft_cdev =
+static const struct file_operations zft_cdev =
 {
        .owner          = THIS_MODULE,
        .read           = zft_read,
index 588fca542a98ba514ebc6cfd2b6fa731351c7d25..817dc409ac20a054c00219b4b8860b0c4d2ddff8 100644 (file)
@@ -43,7 +43,6 @@
 #define RTC_VERSION    "1.07"
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/miscdevice.h>
 #include <linux/fcntl.h>
@@ -483,7 +482,7 @@ static inline int gen_rtc_proc_init(void) { return 0; }
  *     The various file operations we support.
  */
 
-static struct file_operations gen_rtc_fops = {
+static const struct file_operations gen_rtc_fops = {
        .owner          = THIS_MODULE,
 #ifdef CONFIG_GEN_RTC_X
        .read           = gen_rtc_read,
index 07473cd84121b54c66fc47d7776d4d64d6eb02bf..8afba339f05ab3bca332c939db69845e39293824 100644 (file)
@@ -11,7 +11,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/interrupt.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -396,7 +395,7 @@ static int hpet_ioctl_ieon(struct hpet_dev *devp)
 
                sprintf(devp->hd_name, "hpet%d", (int)(devp - hpetp->hp_dev));
                irq_flags = devp->hd_flags & HPET_SHARED_IRQ
-                                               ? SA_SHIRQ : SA_INTERRUPT;
+                                               ? IRQF_SHARED : IRQF_DISABLED;
                if (request_irq(irq, hpet_interrupt, irq_flags,
                                devp->hd_name, (void *)devp)) {
                        printk(KERN_ERR "hpet: IRQ %d is not free\n", irq);
@@ -554,7 +553,7 @@ hpet_ioctl_common(struct hpet_dev *devp, int cmd, unsigned long arg, int kernel)
        return err;
 }
 
-static struct file_operations hpet_fops = {
+static const struct file_operations hpet_fops = {
        .owner = THIS_MODULE,
        .llseek = no_llseek,
        .read = hpet_read,
index 6e380aecea6a3ba04ecf53bb80a9009027b70894..ca2f538e549e3fe6e87a3a850d3961e9b06ffeb9 100644 (file)
@@ -22,7 +22,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-#include <linux/config.h>
 #include <linux/console.h>
 #include <linux/cpumask.h>
 #include <linux/init.h>
@@ -347,7 +346,7 @@ static int hvc_open(struct tty_struct *tty, struct file * filp)
        spin_unlock_irqrestore(&hp->lock, flags);
        /* check error, fallback to non-irq */
        if (irq != NO_IRQ)
-               rc = request_irq(irq, hvc_handle_interrupt, SA_INTERRUPT, "hvc_console", hp);
+               rc = request_irq(irq, hvc_handle_interrupt, IRQF_DISABLED, "hvc_console", hp);
 
        /*
         * If the request_irq() fails and we return an error.  The tty layer
index 130dedc37568bce89af0630870c1f111c04ca2f9..4589ff302b076a123396bd5d218aa6007a08d294 100644 (file)
@@ -899,7 +899,7 @@ static int hvcs_enable_device(struct hvcs_struct *hvcsd, uint32_t unit_address,
         * the conn was registered and now.
         */
        if (!(rc = request_irq(irq, &hvcs_handle_interrupt,
-                               SA_INTERRUPT, "ibmhvcs", hvcsd))) {
+                               IRQF_DISABLED, "ibmhvcs", hvcsd))) {
                /*
                 * It is possible the vty-server was removed after the irq was
                 * requested but before we have time to enable interrupts.
index 7b04eb1532051846a6354650753e542fb5a00c75..56612a2dca6be14d2cf05d84552f6a1f2a1c538c 100644 (file)
@@ -1168,7 +1168,7 @@ static int __init hvsi_init(void)
                struct hvsi_struct *hp = &hvsi_ports[i];
                int ret = 1;
 
-               ret = request_irq(hp->virq, hvsi_interrupt, SA_INTERRUPT, "hvsi", hp);
+               ret = request_irq(hp->virq, hvsi_interrupt, IRQF_DISABLED, "hvsi", hp);
                if (ret)
                        printk(KERN_ERR "HVSI: couldn't reserve irq 0x%x (error %i)\n",
                                hp->virq, ret);
@@ -1299,13 +1299,12 @@ static int __init hvsi_console_init(void)
                hp->inbuf_end = hp->inbuf;
                hp->state = HVSI_CLOSED;
                hp->vtermno = *vtermno;
-               hp->virq = virt_irq_create_mapping(irq[0]);
+               hp->virq = irq_create_mapping(NULL, irq[0], 0);
                if (hp->virq == NO_IRQ) {
                        printk(KERN_ERR "%s: couldn't create irq mapping for 0x%x\n",
-                               __FUNCTION__, hp->virq);
+                               __FUNCTION__, irq[0]);
                        continue;
-               } else
-                       hp->virq = irq_offset_up(hp->virq);
+               }
 
                hvsi_count++;
        }
index 88b026639f105324f79d94089207b14ca35d09a6..154a81d328c169211809356654c3fe0302a4caf7 100644 (file)
@@ -149,7 +149,7 @@ out:
 }
 
 
-static struct file_operations rng_chrdev_ops = {
+static const struct file_operations rng_chrdev_ops = {
        .owner          = THIS_MODULE,
        .open           = rng_dev_open,
        .read           = rng_dev_read,
index f3c3aaf4560e86d07161fb2b8255882c9bf74599..353d9f3cf8d786cda5ae06f29a25c3d63b099057 100644 (file)
@@ -80,7 +80,7 @@ static int i8k_open_fs(struct inode *inode, struct file *file);
 static int i8k_ioctl(struct inode *, struct file *, unsigned int,
                     unsigned long);
 
-static struct file_operations i8k_fops = {
+static const struct file_operations i8k_fops = {
        .open           = i8k_open_fs,
        .read           = seq_read,
        .llseek         = seq_lseek,
index 510b026d7d261c95f9b6603b8e6739580da5ec52..5eabe47b0bc842f4abc60599b561dfa7229fbcdf 100644 (file)
@@ -47,7 +47,6 @@
 //----------------------
 // Mandatory Includes:
 //----------------------
-#include <linux/config.h>
 #include "ip2types.h"
 #include "i2hw.h"       // The hardware definitions
 
index 8619542766cb28cfdda56efc600c97bbe7afe4e8..518ece7ac656789be460a987d097243ea4565dda 100644 (file)
@@ -82,7 +82,6 @@
 /************/
 /* Includes */
 /************/
-#include <linux/config.h>
 
 #include <linux/ctype.h>
 #include <linux/string.h>
@@ -234,7 +233,7 @@ static void  *DevTableMem[IP2_MAX_BOARDS];
 /* This is the driver descriptor for the ip2ipl device, which is used to
  * download the loadware to the boards.
  */
-static struct file_operations ip2_ipl = {
+static const struct file_operations ip2_ipl = {
        .owner          = THIS_MODULE,
        .read           = ip2_ipl_read,
        .write          = ip2_ipl_write,
@@ -492,8 +491,8 @@ static struct tty_operations ip2_ops = {
 /* initialisation of the devices and driver structures, and registers itself  */
 /* with the relevant kernel modules.                                          */
 /******************************************************************************/
-/* SA_INTERRUPT- if set blocks all interrupts else only this line */
-/* SA_SHIRQ    - for shared irq PCI or maybe EISA only */
+/* IRQF_DISABLED - if set blocks all interrupts else only this line */
+/* IRQF_SHARED    - for shared irq PCI or maybe EISA only */
 /* SA_RANDOM   - can be source for cert. random number generators */
 #define IP2_SA_FLAGS   0
 
@@ -754,7 +753,7 @@ retry:
                                if (have_requested_irq(ip2config.irq[i]))
                                        continue;
                                rc = request_irq( ip2config.irq[i], ip2_interrupt,
-                                       IP2_SA_FLAGS | (ip2config.type[i] == PCI ? SA_SHIRQ : 0),
+                                       IP2_SA_FLAGS | (ip2config.type[i] == PCI ? IRQF_SHARED : 0),
                                        pcName, (void *)&pcName);
                                if (rc) {
                                        printk(KERN_ERR "IP2: an request_irq failed: error %d\n",rc);
index 3acdac3c967eec037fe9130e6cff011c0ff84077..a48da02aad2f3ae1480cb0df48b78ae4bcbb8e50 100644 (file)
@@ -196,7 +196,7 @@ static int rtc_release(struct inode *inode, struct file *file)
  *     The various file operations we support.
  */
 
-static struct file_operations rtc_fops = {
+static const struct file_operations rtc_fops = {
        .owner          = THIS_MODULE,
        .ioctl          = rtc_ioctl,
        .open           = rtc_open,
index da637adbbfaaf218ca26bc186ec772044b16c659..68d7c61a864e7ecc4f696e3b36f4ceb92201472f 100644 (file)
@@ -31,7 +31,6 @@
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/errno.h>
@@ -766,7 +765,7 @@ static long compat_ipmi_ioctl(struct file *filep, unsigned int cmd,
 }
 #endif
 
-static struct file_operations ipmi_fops = {
+static const struct file_operations ipmi_fops = {
        .owner          = THIS_MODULE,
        .ioctl          = ipmi_ioctl,
 #ifdef CONFIG_COMPAT
index ad26f4b997c5bc7508a2abe11a36bda7a65e4eab..0aa5d608fe6f539aa6eb2bbb84ba7e52e3dbc05a 100644 (file)
@@ -31,7 +31,6 @@
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <asm/system.h>
index d0b5c08e7b4eae9f1f4b0e2c8e652621105acb64..8d941db834570a98893af2a28ad5fc1ea01e11ec 100644 (file)
@@ -31,7 +31,6 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/proc_fs.h>
index bd4f2248b758e40a87039a75359a403c14357cb7..f57eba0bf253553135c1cd62495664baa46d6dae 100644 (file)
@@ -38,7 +38,6 @@
  * and drives the real SMI state machine.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <asm/system.h>
@@ -1042,7 +1041,7 @@ static int std_irq_setup(struct smi_info *info)
        if (info->si_type == SI_BT) {
                rv = request_irq(info->irq,
                                 si_bt_irq_handler,
-                                SA_INTERRUPT,
+                                IRQF_DISABLED,
                                 DEVICE_NAME,
                                 info);
                if (!rv)
@@ -1052,7 +1051,7 @@ static int std_irq_setup(struct smi_info *info)
        } else
                rv = request_irq(info->irq,
                                 si_irq_handler,
-                                SA_INTERRUPT,
+                                IRQF_DISABLED,
                                 DEVICE_NAME,
                                 info);
        if (rv) {
index 1a0a19c53605ed6f4c9f54afa70fbdbab2e002ea..accaaf1a6b697fb6c5604f290464a43d8b56a53f 100644 (file)
@@ -31,7 +31,6 @@
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/ipmi.h>
@@ -808,7 +807,7 @@ static int ipmi_close(struct inode *ino, struct file *filep)
        return 0;
 }
 
-static struct file_operations ipmi_wdog_fops = {
+static const struct file_operations ipmi_wdog_fops = {
        .owner   = THIS_MODULE,
        .read    = ipmi_read,
        .poll    = ipmi_poll,
index 478bf4d7d0659ac14922eb76adfecfcb448a6cbd..913be23e0a2427e16b07ae6e422ba9e8632bf7ea 100644 (file)
@@ -245,7 +245,7 @@ static int lock_card(struct isi_board *card)
        printk(KERN_WARNING "ISICOM: Failed to lock Card (0x%lx)\n",
                card->base);
 
-       return 0;       /* Failed to aquire the card! */
+       return 0;       /* Failed to acquire the card! */
 }
 
 static int lock_card_at_interrupt(struct isi_board *card)
@@ -262,7 +262,7 @@ static int lock_card_at_interrupt(struct isi_board *card)
                        spin_unlock_irqrestore(&card->card_lock, card->flags);
        }
        /* Failing in interrupt is an acceptable event */
-       return 0;       /* Failed to aquire the card! */
+       return 0;       /* Failed to acquire the card! */
 }
 
 static void unlock_card(struct isi_board *card)
@@ -1614,14 +1614,14 @@ static int __devinit isicom_register_isr(struct pci_dev *pdev,
        const unsigned int index)
 {
        struct isi_board *board = pci_get_drvdata(pdev);
-       unsigned long irqflags = SA_INTERRUPT;
+       unsigned long irqflags = IRQF_DISABLED;
        int retval = -EINVAL;
 
        if (!board->base)
                goto end;
 
        if (board->isa == NO)
-               irqflags |= SA_SHIRQ;
+               irqflags |= IRQF_SHARED;
 
        retval = request_irq(board->irq, isicom_interrupt, irqflags,
                ISICOM_NAME, board);
index c74e5660a9b7e244607007b1af933665348d97e7..84dfc4278139eaf809b666d47bd7de8623aa9898 100644 (file)
@@ -26,7 +26,6 @@
 
 /*****************************************************************************/
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
@@ -282,7 +281,6 @@ static char *stli_brdnames[] = {
 
 /*****************************************************************************/
 
-#ifdef MODULE
 /*
  *     Define some string labels for arguments passed from the module
  *     load line. These allow for easy board definitions, and easy
@@ -381,8 +379,6 @@ MODULE_PARM_DESC(board2, "Board 2 config -> name[,ioaddr[,memaddr]");
 module_param_array(board3, charp, NULL, 0);
 MODULE_PARM_DESC(board3, "Board 3 config -> name[,ioaddr[,memaddr]");
 
-#endif
-
 /*
  *     Set up a default memory address table for EISA board probing.
  *     The default addresses are all bellow 1Mbyte, which has to be the
@@ -643,14 +639,8 @@ static unsigned int        stli_baudrates[] = {
  *     Prototype all functions in this driver!
  */
 
-#ifdef MODULE
-static void    stli_argbrds(void);
 static int     stli_parsebrd(stlconf_t *confp, char **argp);
-
-static unsigned long   stli_atol(char *str);
-#endif
-
-int            stli_init(void);
+static int     stli_init(void);
 static int     stli_open(struct tty_struct *tty, struct file *filp);
 static void    stli_close(struct tty_struct *tty, struct file *filp);
 static int     stli_write(struct tty_struct *tty, const unsigned char *buf, int count);
@@ -758,7 +748,7 @@ static int  stli_initpcibrd(int brdtype, struct pci_dev *devp);
  *     will give access to the shared memory on the Stallion intelligent
  *     board. This is also a very useful debugging tool.
  */
-static struct file_operations  stli_fsiomem = {
+static const struct file_operations    stli_fsiomem = {
        .owner          = THIS_MODULE,
        .read           = stli_memread,
        .write          = stli_memwrite,
@@ -786,8 +776,6 @@ static int  stli_timeron;
 
 static struct class *istallion_class;
 
-#ifdef MODULE
-
 /*
  *     Loadable module initialization stuff.
  */
@@ -954,8 +942,6 @@ static int stli_parsebrd(stlconf_t *confp, char **argp)
        return(1);
 }
 
-#endif
-
 /*****************************************************************************/
 
 static int stli_open(struct tty_struct *tty, struct file *filp)
@@ -4694,7 +4680,7 @@ static struct tty_operations stli_ops = {
 
 /*****************************************************************************/
 
-int __init stli_init(void)
+static int __init stli_init(void)
 {
        int i;
        printk(KERN_INFO "%s: version %s\n", stli_drvtitle, stli_drvversion);
index d1ed6ac950d1208891188d1972530262d46c85d9..cde562d70c4f835c19e86ee2403985246b970309 100644 (file)
@@ -357,7 +357,7 @@ DEB(printk("interrupt 0x%x %d\n",ITE_GPAISR, i));
        }
 }
 
-static struct file_operations ite_gpio_fops = {
+static const struct file_operations ite_gpio_fops = {
        .owner          = THIS_MODULE,
        .ioctl          = ite_gpio_ioctl,
        .open           = ite_gpio_open,
@@ -397,7 +397,7 @@ int __init ite_gpio_init(void)
                init_waitqueue_head(&ite_gpio_wait[i]);
        }
 
-       if (request_irq(ite_gpio_irq, ite_gpio_irq_handler, SA_SHIRQ, "gpio", 0) < 0) {
+       if (request_irq(ite_gpio_irq, ite_gpio_irq_handler, IRQF_SHARED, "gpio", 0) < 0) {
                misc_deregister(&ite_gpio_miscdev);
                release_region(ite_gpio_base, 0x1c);
                return 0;
index 4bb3d22726046fbcc4cd7cbbb4dbd69ce15b9edb..056ebe84b81d4b55dc394248c47b3dcc423c34a4 100644 (file)
@@ -24,7 +24,6 @@
  * 21-08-02: Converted to input API, major cleanup. (Vojtech Pavlik)
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/tty.h>
index 29963d8be6674abdcd92fe7c9485f978c4c58c76..da601fd6c07ae24424350dc77541fb695c9ad15c 100644 (file)
@@ -14,7 +14,6 @@
 
 #define RTC_IO_EXTENT  0x10    /*Only really two ports, but... */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/miscdevice.h>
@@ -599,7 +598,7 @@ static ssize_t lcd_read(struct file *file, char *buf,
  *     The various file operations we support.
  */
 
-static struct file_operations lcd_fops = {
+static const struct file_operations lcd_fops = {
        .read = lcd_read,
        .ioctl = lcd_ioctl,
        .open = lcd_open,
index b11a390581bad05ea210165731cb2dcbbc013944..f875fda3b089d54332341671388716c99ebd05eb 100644 (file)
 #include <linux/module.h>
 #include <linux/init.h>
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
 #include <linux/major.h>
@@ -667,7 +666,7 @@ static int lp_ioctl(struct inode *inode, struct file *file,
        return retval;
 }
 
-static struct file_operations lp_fops = {
+static const struct file_operations lp_fops = {
        .owner          = THIS_MODULE,
        .write          = lp_write,
        .ioctl          = lp_ioctl,
index c268ee04b2aa31d40db4bf58931d1bef75f7b0ad..0385650f6077892843b966f3c68018c254a46492 100644 (file)
@@ -10,7 +10,6 @@
  *     MOATB Core Services driver.
  */
 
-#include <linux/config.h>
 #include <linux/interrupt.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
@@ -593,7 +592,7 @@ static int mbcs_intr_alloc(struct cx_dev *dev)
        getdma->intrHostDest = sn_irq->irq_xtalkaddr;
        getdma->intrVector = sn_irq->irq_irq;
        if (request_irq(sn_irq->irq_irq,
-                       (void *)mbcs_completion_intr_handler, SA_SHIRQ,
+                       (void *)mbcs_completion_intr_handler, IRQF_SHARED,
                        "MBCS get intr", (void *)soft)) {
                tiocx_irq_free(soft->get_sn_irq);
                return -EAGAIN;
@@ -609,7 +608,7 @@ static int mbcs_intr_alloc(struct cx_dev *dev)
        putdma->intrHostDest = sn_irq->irq_xtalkaddr;
        putdma->intrVector = sn_irq->irq_irq;
        if (request_irq(sn_irq->irq_irq,
-                       (void *)mbcs_completion_intr_handler, SA_SHIRQ,
+                       (void *)mbcs_completion_intr_handler, IRQF_SHARED,
                        "MBCS put intr", (void *)soft)) {
                tiocx_irq_free(soft->put_sn_irq);
                free_irq(soft->get_sn_irq->irq_irq, soft);
@@ -629,7 +628,7 @@ static int mbcs_intr_alloc(struct cx_dev *dev)
        algo->intrHostDest = sn_irq->irq_xtalkaddr;
        algo->intrVector = sn_irq->irq_irq;
        if (request_irq(sn_irq->irq_irq,
-                       (void *)mbcs_completion_intr_handler, SA_SHIRQ,
+                       (void *)mbcs_completion_intr_handler, IRQF_SHARED,
                        "MBCS algo intr", (void *)soft)) {
                tiocx_irq_free(soft->algo_sn_irq);
                free_irq(soft->put_sn_irq->irq_irq, soft);
index 6fe7b6c6c462efb0936e16f27e73a19e0438912e..e97c32ceb7962b745d3ea6d164a353f930686c74 100644 (file)
@@ -8,7 +8,6 @@
  *  Shared /dev/zero mmaping support, Feb 2000, Kanoj Sarcar <kanoj@sgi.com>
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/miscdevice.h>
 #include <linux/slab.h>
@@ -777,7 +776,7 @@ static int open_port(struct inode * inode, struct file * filp)
 #define open_kmem      open_mem
 #define open_oldmem    open_mem
 
-static struct file_operations mem_fops = {
+static const struct file_operations mem_fops = {
        .llseek         = memory_lseek,
        .read           = read_mem,
        .write          = write_mem,
@@ -785,7 +784,7 @@ static struct file_operations mem_fops = {
        .open           = open_mem,
 };
 
-static struct file_operations kmem_fops = {
+static const struct file_operations kmem_fops = {
        .llseek         = memory_lseek,
        .read           = read_kmem,
        .write          = write_kmem,
@@ -793,7 +792,7 @@ static struct file_operations kmem_fops = {
        .open           = open_kmem,
 };
 
-static struct file_operations null_fops = {
+static const struct file_operations null_fops = {
        .llseek         = null_lseek,
        .read           = read_null,
        .write          = write_null,
@@ -801,7 +800,7 @@ static struct file_operations null_fops = {
 };
 
 #if defined(CONFIG_ISA) || !defined(__mc68000__)
-static struct file_operations port_fops = {
+static const struct file_operations port_fops = {
        .llseek         = memory_lseek,
        .read           = read_port,
        .write          = write_port,
@@ -809,7 +808,7 @@ static struct file_operations port_fops = {
 };
 #endif
 
-static struct file_operations zero_fops = {
+static const struct file_operations zero_fops = {
        .llseek         = zero_lseek,
        .read           = read_zero,
        .write          = write_zero,
@@ -820,14 +819,14 @@ static struct backing_dev_info zero_bdi = {
        .capabilities   = BDI_CAP_MAP_COPY,
 };
 
-static struct file_operations full_fops = {
+static const struct file_operations full_fops = {
        .llseek         = full_lseek,
        .read           = read_full,
        .write          = write_full,
 };
 
 #ifdef CONFIG_CRASH_DUMP
-static struct file_operations oldmem_fops = {
+static const struct file_operations oldmem_fops = {
        .read   = read_oldmem,
        .open   = open_oldmem,
 };
@@ -854,7 +853,7 @@ static ssize_t kmsg_write(struct file * file, const char __user * buf,
        return ret;
 }
 
-static struct file_operations kmsg_fops = {
+static const struct file_operations kmsg_fops = {
        .write =        kmsg_write,
 };
 
@@ -904,7 +903,7 @@ static int memory_open(struct inode * inode, struct file * filp)
        return 0;
 }
 
-static struct file_operations memory_fops = {
+static const struct file_operations memory_fops = {
        .open           = memory_open,  /* just a selector for the real open */
 };
 
index dfe1cede391602b96d155a2fdb59dd0b2eebae3f..62ebe09656e3ad68b18992a0c0e4a8557c9f7992 100644 (file)
@@ -34,7 +34,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 
 #include <linux/fs.h>
 #include <linux/errno.h>
@@ -114,7 +113,7 @@ static int misc_seq_open(struct inode *inode, struct file *file)
        return seq_open(file, &misc_seq_ops);
 }
 
-static struct file_operations misc_proc_fops = {
+static const struct file_operations misc_proc_fops = {
        .owner   = THIS_MODULE,
        .open    = misc_seq_open,
        .read    = seq_read,
@@ -177,7 +176,7 @@ fail:
  */
 static struct class *misc_class;
 
-static struct file_operations misc_fops = {
+static const struct file_operations misc_fops = {
        .owner          = THIS_MODULE,
        .open           = misc_open,
 };
index 95e8122b8068d47bd617fdc7726b78eafffbdb7c..1f0f2b6dae2658e8736842db0d91c5ea3d90d929 100644 (file)
@@ -63,7 +63,7 @@ static int mmtimer_mmap(struct file *file, struct vm_area_struct *vma);
  */
 static unsigned long mmtimer_femtoperiod = 0;
 
-static struct file_operations mmtimer_fops = {
+static const struct file_operations mmtimer_fops = {
        .owner =        THIS_MODULE,
        .mmap =         mmtimer_mmap,
        .ioctl =        mmtimer_ioctl,
@@ -687,7 +687,7 @@ static int __init mmtimer_init(void)
        mmtimer_femtoperiod = ((unsigned long)1E15 + sn_rtc_cycles_per_second /
                               2) / sn_rtc_cycles_per_second;
 
-       if (request_irq(SGI_MMTIMER_VECTOR, mmtimer_interrupt, SA_PERCPU_IRQ, MMTIMER_NAME, NULL)) {
+       if (request_irq(SGI_MMTIMER_VECTOR, mmtimer_interrupt, IRQF_PERCPU, MMTIMER_NAME, NULL)) {
                printk(KERN_WARNING "%s: unable to allocate interrupt.",
                        MMTIMER_NAME);
                return -1;
index 52ef61f54ba0bc225c94f10a0e2470baf9e5926e..4ea7bd5f4f567b238586c1017129e0ff44a6a1da 100644 (file)
@@ -29,7 +29,6 @@
  *      version         : 5.1
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/mm.h>
index d1fe05e83882b57176b93f9be0f89d23478242da..4e4865e90e50b68a697764f9a07f0e87b2ce1d1e 100644 (file)
@@ -46,7 +46,6 @@
 *      First release to the public
 */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/unistd.h>
 #include <linux/delay.h>
index d3ba2f860ef02626a2d73c5f222a16051d5bab7f..39a2e661ff550e1ba50848539940c3a0e1e439b6 100644 (file)
@@ -454,7 +454,7 @@ static int register_serial_portandirq(unsigned int port, int irq)
 }
 
 
-static struct file_operations mwave_fops = {
+static const struct file_operations mwave_fops = {
        .owner          = THIS_MODULE,
        .read           = mwave_read,
        .write          = mwave_write,
index 72cfd09091e0a63ce1587cabec737aeaeb41e127..556abd3e0d0735e93ce55415fdf3c14834f69ba6 100644 (file)
@@ -36,7 +36,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/autoconf.h>
 #include <linux/errno.h>
@@ -95,7 +94,7 @@
 #define RELEVANT_IFLAG(iflag)  (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK|\
                                          IXON|IXOFF))
 
-#define IRQ_T(info) ((info->flags & ASYNC_SHARE_IRQ) ? SA_SHIRQ : SA_INTERRUPT)
+#define IRQ_T(info) ((info->flags & ASYNC_SHARE_IRQ) ? IRQF_SHARED : IRQF_DISABLED)
 
 #define C168_ASIC_ID    1
 #define C104_ASIC_ID    2
index 9f54733f16236e9e5618c91967d1d1434ef824ef..337a87f86a3bff05dc22eb296591ac1c5ae5e03d 100644 (file)
@@ -81,7 +81,6 @@
 #define HDLC_MAGIC 0x239e
 #define HDLC_VERSION "$Revision: 4.8 $"
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
index 3556ccd77570b691937ab47bea7ba2af09fe57c2..a39f19c35a6a8bd6fa2673f916069039f6142b6a 100644 (file)
@@ -37,7 +37,6 @@
 #define NVRAM_VERSION  "1.2"
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/smp_lock.h>
 #include <linux/nvram.h>
@@ -438,7 +437,7 @@ nvram_read_proc(char *buffer, char **start, off_t offset,
 
 #endif /* CONFIG_PROC_FS */
 
-static struct file_operations nvram_fops = {
+static const struct file_operations nvram_fops = {
        .owner          = THIS_MODULE,
        .llseek         = nvram_llseek,
        .read           = nvram_read,
index 4083b781adbffb355f2190d5d12b6df242d35afd..7c57ebfa8640a578d2840ba00a38cef5388eb761 100644 (file)
@@ -4,7 +4,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -184,7 +183,7 @@ static int button_read (struct file *filp, char __user *buffer,
  * attempts to perform these operations on the device.
  */
 
-static struct file_operations button_fops = {
+static const struct file_operations button_fops = {
        .owner          = THIS_MODULE,
        .read           = button_read,
 };
@@ -224,7 +223,7 @@ static int __init nwbutton_init(void)
                return -EBUSY;
        }
 
-       if (request_irq (IRQ_NETWINDER_BUTTON, button_handler, SA_INTERRUPT,
+       if (request_irq (IRQ_NETWINDER_BUTTON, button_handler, IRQF_DISABLED,
                        "nwbutton", NULL)) {
                printk (KERN_WARNING "nwbutton: IRQ %d is not free.\n",
                                IRQ_NETWINDER_BUTTON);
index 8865387d3448d4451aacf6fd72f66314a6dab6a1..206cf6f50695699be3fe865a5f024c1df9e640fe 100644 (file)
@@ -642,7 +642,7 @@ static void kick_open(void)
        udelay(25);
 }
 
-static struct file_operations flash_fops =
+static const struct file_operations flash_fops =
 {
        .owner          = THIS_MODULE,
        .llseek         = flash_llseek,
index 1c706ccfdbb36265aa3f66ac029007c73e684bc8..4005ee0aa11ed5a9a2bc02ccc1f069c2c2d05ff6 100644 (file)
@@ -236,7 +236,7 @@ static int pc8736x_gpio_open(struct inode *inode, struct file *file)
        return nonseekable_open(inode, file);
 }
 
-static struct file_operations pc8736x_gpio_fops = {
+static const struct file_operations pc8736x_gpio_fops = {
        .owner  = THIS_MODULE,
        .open   = pc8736x_gpio_open,
        .write  = nsc_gpio_write,
@@ -319,9 +319,10 @@ static int __init pc8736x_gpio_init(void)
        return 0;
 
 undo_platform_dev_add:
-       platform_device_put(pdev);
+       platform_device_del(pdev);
 undo_platform_dev_alloc:
-       kfree(pdev);
+       platform_device_put(pdev);
+
        return rc;
 }
 
index eab5394da66647fe3f86f6d836646cf144f6db79..50d20aafeb186638f836c3967644370c314168bf 100644 (file)
@@ -149,12 +149,7 @@ struct cm4000_dev {
 #define        ZERO_DEV(dev)                                           \
        memset(&dev->atr_csum,0,                                \
                sizeof(struct cm4000_dev) -                     \
-               /*link*/ sizeof(struct pcmcia_device *) -       \
-               /*node*/ sizeof(dev_node_t) -                   \
-               /*atr*/ MAX_ATR*sizeof(char) -                  \
-               /*rbuf*/ 512*sizeof(char) -                     \
-               /*sbuf*/ 512*sizeof(char) -                     \
-               /*queue*/ 4*sizeof(wait_queue_head_t))
+               offsetof(struct cm4000_dev, atr_csum))
 
 static struct pcmcia_device *dev_table[CM4000_MAX_DEV];
 static struct class *cmm_class;
@@ -1943,7 +1938,7 @@ static void cm4000_detach(struct pcmcia_device *link)
        return;
 }
 
-static struct file_operations cm4000_fops = {
+static const struct file_operations cm4000_fops = {
        .owner  = THIS_MODULE,
        .read   = cmm_read,
        .write  = cmm_write,
index 47a8465bf95beed694105640b1847f5589b8e2a3..55cf4be42976913547663b6b15b41b196d9c5800 100644 (file)
@@ -688,7 +688,7 @@ static void reader_detach(struct pcmcia_device *link)
        return;
 }
 
-static struct file_operations reader_fops = {
+static const struct file_operations reader_fops = {
        .owner          = THIS_MODULE,
        .read           = cm4040_read,
        .write          = cm4040_write,
index 24231d9743dc297a7db77bbb0796e190163591ca..520d2cf82bc0ca74edbe00b834288cfdd022ec8d 100644 (file)
@@ -739,7 +739,7 @@ static unsigned int pp_poll (struct file * file, poll_table * wait)
 
 static struct class *ppdev_class;
 
-static struct file_operations pp_fops = {
+static const struct file_operations pp_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .read           = pp_read,
index 9491e43075667be1f1e48ada2803bc77ae5a7b54..34dd4c38110e060f6bdfd866d0aa2bdb41994d08 100644 (file)
@@ -11,7 +11,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>      /* For EXPORT_SYMBOL */
 
 #include <linux/errno.h>
index 601d09baf9d76b04812b1471c611335b20b18ad4..9d134e98d2a0daa347ca72259579ddb7333b2083 100644 (file)
@@ -33,7 +33,6 @@
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 
 /* 
  * NOTE:  
@@ -145,7 +144,7 @@ void __init init_qtronix_990P_kbd(void)
        cir_port_init(cir);
 
        retval = request_irq(IT8172_CIR0_IRQ, kbd_int_handler, 
-                       (unsigned long )(SA_INTERRUPT|SA_SHIRQ), 
+                       (unsigned long )(IRQF_DISABLED|IRQF_SHARED),
                        (const char *)"Qtronix IR Keyboard", (void *)cir);
 
        if (retval) {
index 58f3512c52e16f1b92de5307c9e482a1ccf5b91f..4c3a5ca9d8f7a98f882cdbeed12f0949af940a55 100644 (file)
  */
 
 #include <linux/utsname.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/major.h>
@@ -417,7 +416,7 @@ static struct entropy_store input_pool = {
        .poolinfo = &poolinfo_table[0],
        .name = "input",
        .limit = 1,
-       .lock = SPIN_LOCK_UNLOCKED,
+       .lock = __SPIN_LOCK_UNLOCKED(&input_pool.lock),
        .pool = input_pool_data
 };
 
@@ -426,7 +425,7 @@ static struct entropy_store blocking_pool = {
        .name = "blocking",
        .limit = 1,
        .pull = &input_pool,
-       .lock = SPIN_LOCK_UNLOCKED,
+       .lock = __SPIN_LOCK_UNLOCKED(&blocking_pool.lock),
        .pool = blocking_pool_data
 };
 
@@ -434,7 +433,7 @@ static struct entropy_store nonblocking_pool = {
        .poolinfo = &poolinfo_table[1],
        .name = "nonblocking",
        .pull = &input_pool,
-       .lock = SPIN_LOCK_UNLOCKED,
+       .lock = __SPIN_LOCK_UNLOCKED(&nonblocking_pool.lock),
        .pool = nonblocking_pool_data
 };
 
index 9bf97c5e38c041e47dbb340f314740ddc43f3c5e..579868af4a54d91be8f0707c96053e3d9bfb7b5e 100644 (file)
@@ -30,7 +30,7 @@ struct raw_device_data {
 static struct class *raw_class;
 static struct raw_device_data raw_devices[MAX_RAW_MINORS];
 static DEFINE_MUTEX(raw_mutex);
-static struct file_operations raw_ctl_fops;         /* forward declaration */
+static const struct file_operations raw_ctl_fops; /* forward declaration */
 
 /*
  * Open/close code for raw IO.
@@ -261,7 +261,7 @@ static ssize_t raw_file_aio_write(struct kiocb *iocb, const char __user *buf,
 }
 
 
-static struct file_operations raw_fops = {
+static const struct file_operations raw_fops = {
        .read   =       generic_file_read,
        .aio_read =     generic_file_aio_read,
        .write  =       raw_file_write,
@@ -274,7 +274,7 @@ static struct file_operations raw_fops = {
        .owner  =       THIS_MODULE,
 };
 
-static struct file_operations raw_ctl_fops = {
+static const struct file_operations raw_ctl_fops = {
        .ioctl  =       raw_ctl_ioctl,
        .open   =       raw_open,
        .owner  =       THIS_MODULE,
index aa43436d5d1b7b331f077bb5f4b2bb12dc9817ba..3fa80aaf452751b24397192406ee944f7f3e04bc 100644 (file)
@@ -33,7 +33,6 @@
  * */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/kdev_t.h>
 #include <asm/io.h>
 #include <linux/kernel.h>
@@ -244,7 +243,7 @@ static struct real_driver rio_real_driver = {
  *
  */
 
-static struct file_operations rio_fw_fops = {
+static const struct file_operations rio_fw_fops = {
        .owner = THIS_MODULE,
        .ioctl = rio_fw_ioctl,
 };
@@ -1120,7 +1119,7 @@ static int __init rio_init(void)
        for (i = 0; i < p->RIONumHosts; i++) {
                hp = &p->RIOHosts[i];
                if (hp->Ivec) {
-                       int mode = SA_SHIRQ;
+                       int mode = IRQF_SHARED;
                        if (hp->Ivec & 0x8000) {
                                mode = 0;
                                hp->Ivec &= 0x7fff;
index 55b9c97e8477c59fb3b39d924d9b51ba1a83ab68..dc3f005614a36d5cefbc9df333a1fa09aab8546a 100644 (file)
@@ -23,7 +23,6 @@
  *  Version 1.0 -- July, 1999. 
  * 
  */
-#include <linux/config.h>
 
 #define RIO_NBOARDS        4
 #define RIO_PORTSPERBOARD 128
index 12e34bc3f7ceadecdfa91d7866e679aa3133f1e6..99f3df02b61c31adff0df7bcce73659fed7a5992 100644 (file)
@@ -33,7 +33,6 @@
 static char *_rioinit_c_sccs_ = "@(#)rioinit.c 1.3";
 #endif
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/errno.h>
index c84c3c3f10c3e4f27950c2e9075379fe87083679..f1c94f771af5e803426fd2f0a707cd7154e66897 100644 (file)
@@ -625,7 +625,7 @@ static inline int rc_setup_board(struct riscom_board * bp)
        if (bp->flags & RC_BOARD_ACTIVE) 
                return 0;
        
-       error = request_irq(bp->irq, rc_interrupt, SA_INTERRUPT,
+       error = request_irq(bp->irq, rc_interrupt, IRQF_DISABLED,
                            "RISCom/8", NULL);
        if (error) 
                return error;
index 0897b0c8d528b3931e0a4db2eb2a49649fd60eec..cc7bd1a3095b799fba093bee386bcdfe805529fb 100644 (file)
@@ -61,7 +61,6 @@
  *     this driver.)
  */
 
-#include <linux/config.h>
 #include <linux/interrupt.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -221,7 +220,7 @@ static inline unsigned char rtc_is_updating(void)
 
 #ifdef RTC_IRQ
 /*
- *     A very tiny interrupt handler. It runs with SA_INTERRUPT set,
+ *     A very tiny interrupt handler. It runs with IRQF_DISABLED set,
  *     but there is possibility of conflicting with the set_rtc_mmss()
  *     call (the rtc irq and the timer irq can easily run at the same
  *     time in two different CPUs). So we need to serialize
@@ -878,7 +877,7 @@ int rtc_control(rtc_task_t *task, unsigned int cmd, unsigned long arg)
  *     The various file operations we support.
  */
 
-static struct file_operations rtc_fops = {
+static const struct file_operations rtc_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .read           = rtc_read,
@@ -897,7 +896,7 @@ static struct miscdevice rtc_dev = {
        .fops           = &rtc_fops,
 };
 
-static struct file_operations rtc_proc_fops = {
+static const struct file_operations rtc_proc_fops = {
        .owner = THIS_MODULE,
        .open = rtc_proc_open,
        .read  = seq_read,
@@ -959,7 +958,7 @@ found:
         * XXX Interrupt pin #7 in Espresso is shared between RTC and
         * PCI Slot 2 INTA# (and some INTx# in Slot 1).
         */
-       if (request_irq(rtc_irq, rtc_interrupt, SA_SHIRQ, "rtc", (void *)&rtc_port)) {
+       if (request_irq(rtc_irq, rtc_interrupt, IRQF_SHARED, "rtc", (void *)&rtc_port)) {
                printk(KERN_ERR "rtc: cannot register IRQ %d\n", rtc_irq);
                return -EIO;
        }
@@ -977,7 +976,7 @@ no_irq:
                rtc_int_handler_ptr = rtc_interrupt;
        }
 
-       if(request_irq(RTC_IRQ, rtc_int_handler_ptr, SA_INTERRUPT, "rtc", NULL)) {
+       if(request_irq(RTC_IRQ, rtc_int_handler_ptr, IRQF_DISABLED, "rtc", NULL)) {
                /* Yeah right, seeing as irq 8 doesn't even hit the bus. */
                printk(KERN_ERR "rtc: IRQ %d is not free.\n", RTC_IRQ);
                release_region(RTC_PORT(0), RTC_IO_EXTENT);
index b0038b19b5056a7bbca2991b704749ed5d2a153a..5458ef1634e5881ac69bda9cd89c9babda935fe6 100644 (file)
@@ -341,13 +341,13 @@ static int s3c2410_rtc_open(void)
        int ret;
 
        ret = request_irq(s3c2410_rtc_alarmno, s3c2410_rtc_alarmirq,
-                         SA_INTERRUPT,  "s3c2410-rtc alarm", NULL);
+                         IRQF_DISABLED,  "s3c2410-rtc alarm", NULL);
 
        if (ret)
                printk(KERN_ERR "IRQ%d already in use\n", s3c2410_rtc_alarmno);
 
        ret = request_irq(s3c2410_rtc_tickno, s3c2410_rtc_tickirq,
-                         SA_INTERRUPT,  "s3c2410-rtc tick", NULL);
+                         IRQF_DISABLED,  "s3c2410-rtc tick", NULL);
 
        if (ret) {
                printk(KERN_ERR "IRQ%d already in use\n", s3c2410_rtc_tickno);
index 5a280a330401f76924b57d4031457439670f504e..425c58719db6a6af14c5dc12a68e2e53642087bc 100644 (file)
@@ -63,7 +63,7 @@ static int scx200_gpio_release(struct inode *inode, struct file *file)
 }
 
 
-static struct file_operations scx200_gpio_fops = {
+static const struct file_operations scx200_gpio_fops = {
        .owner   = THIS_MODULE,
        .write   = nsc_gpio_write,
        .read    = nsc_gpio_read,
@@ -126,9 +126,10 @@ static int __init scx200_gpio_init(void)
 undo_chrdev_region:
        unregister_chrdev_region(dev, num_pins);
 undo_platform_device_add:
-       platform_device_put(pdev);
+       platform_device_del(pdev);
 undo_malloc:
-       kfree(pdev);
+       platform_device_put(pdev);
+
        return rc;
 }
 
@@ -136,7 +137,6 @@ static void __exit scx200_gpio_cleanup(void)
 {
        kfree(scx200_devices);
        unregister_chrdev_region(MKDEV(major, 0), num_pins);
-       platform_device_put(pdev);
        platform_device_unregister(pdev);
        /* kfree(pdev); */
 }
index c851eeaa406913967ba03f154d1fdba1e2d6835c..21a710cb4bbaed1df2ebfc6a6044bcf5abeb67c4 100644 (file)
@@ -44,7 +44,6 @@
  * - replace bottom half handler with task queue handler
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
index 56c8243cdb734b2d9212ec1eed9643560e82864b..afc6eda602f7f6fa45ed1b70af620bf8810ed4fc 100644 (file)
@@ -105,7 +105,7 @@ scdrv_open(struct inode *inode, struct file *file)
 
        /* hook this subchannel up to the system controller interrupt */
        rv = request_irq(SGI_UART_VECTOR, scdrv_interrupt,
-                        SA_SHIRQ | SA_INTERRUPT,
+                        IRQF_SHARED | IRQF_DISABLED,
                         SYSCTL_BASENAME, sd);
        if (rv) {
                ia64_sn_irtr_close(sd->sd_nasid, sd->sd_subch);
@@ -347,7 +347,7 @@ scdrv_poll(struct file *file, struct poll_table_struct *wait)
        return mask;
 }
 
-static struct file_operations scdrv_fops = {
+static const struct file_operations scdrv_fops = {
        .owner =        THIS_MODULE,
        .read =         scdrv_read,
        .write =        scdrv_write,
index e234d50e142a027290b63aa2860841f274db2a8b..8b2210b633dfc2845396451d573507d69f566fd2 100644 (file)
@@ -310,7 +310,7 @@ scdrv_event_init(struct sysctl_data_s *scd)
 
        /* hook event subchannel up to the system controller interrupt */
        rv = request_irq(SGI_UART_VECTOR, scdrv_event_interrupt,
-                        SA_SHIRQ | SA_INTERRUPT,
+                        IRQF_SHARED | IRQF_DISABLED,
                         "system controller events", event_sd);
        if (rv) {
                printk(KERN_WARNING "%s: irq request failed (%d)\n",
index 43dfd8689dce31a0b8230c12c3ad922763cc4f77..d4e434d694b747f63d45b4fbad1735190d696c8d 100644 (file)
@@ -33,7 +33,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/input.h>
 #include <linux/pci.h>
@@ -1107,7 +1106,7 @@ static int sonypi_misc_ioctl(struct inode *ip, struct file *fp,
        return ret;
 }
 
-static struct file_operations sonypi_misc_fops = {
+static const struct file_operations sonypi_misc_fops = {
        .owner          = THIS_MODULE,
        .read           = sonypi_misc_read,
        .poll           = sonypi_misc_poll,
@@ -1283,7 +1282,7 @@ static int __devinit sonypi_setup_irq(struct sonypi_device *dev,
        while (irq_list->irq) {
 
                if (!request_irq(irq_list->irq, sonypi_irq,
-                                SA_SHIRQ, "sonypi", sonypi_irq)) {
+                                IRQF_SHARED, "sonypi", sonypi_irq)) {
                        dev->irq = irq_list->irq;
                        dev->bits = irq_list->bits;
                        return 0;
index d2d6b01dcd05a1168dbd7795ebd13d5c5be32dc9..cb2859249d49a9171899db66f9661f36fdcfdb90 100644 (file)
@@ -75,7 +75,6 @@
  * Documentation/specialix.txt
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <asm/io.h>
@@ -1016,9 +1015,9 @@ static inline int sx_setup_board(struct specialix_board * bp)
                return 0;
 
        if (bp->flags & SX_BOARD_IS_PCI)
-               error = request_irq(bp->irq, sx_interrupt, SA_INTERRUPT | SA_SHIRQ, "specialix IO8+", bp);
+               error = request_irq(bp->irq, sx_interrupt, IRQF_DISABLED | IRQF_SHARED, "specialix IO8+", bp);
        else
-               error = request_irq(bp->irq, sx_interrupt, SA_INTERRUPT, "specialix IO8+", bp);
+               error = request_irq(bp->irq, sx_interrupt, IRQF_DISABLED, "specialix IO8+", bp);
 
        if (error)
                return error;
index 0f7a542d9041052f730ecef16aaead6e1bfbdb4b..3beb2203d24be21375175daf23021bbdd8e6daae 100644 (file)
@@ -26,7 +26,6 @@
 
 /*****************************************************************************/
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
@@ -708,7 +707,7 @@ static unsigned int sc26198_baudtable[] = {
  *     Define the driver info for a user level control device. Used mainly
  *     to get at port stats - only not using the port device itself.
  */
-static struct file_operations  stl_fsiomem = {
+static const struct file_operations    stl_fsiomem = {
        .owner          = THIS_MODULE,
        .ioctl          = stl_memioctl,
 };
@@ -2303,7 +2302,7 @@ static inline int stl_initeio(stlbrd_t *brdp)
        brdp->nrpanels = 1;
        brdp->state |= BRD_FOUND;
        brdp->hwid = status;
-       if (request_irq(brdp->irq, stl_intr, SA_SHIRQ, name, brdp) != 0) {
+       if (request_irq(brdp->irq, stl_intr, IRQF_SHARED, name, brdp) != 0) {
                printk("STALLION: failed to register interrupt "
                    "routine for %s irq=%d\n", name, brdp->irq);
                rc = -ENODEV;
@@ -2513,7 +2512,7 @@ static inline int stl_initech(stlbrd_t *brdp)
                outb((brdp->ioctrlval | ECH_BRDDISABLE), brdp->ioctrl);
 
        brdp->state |= BRD_FOUND;
-       if (request_irq(brdp->irq, stl_intr, SA_SHIRQ, name, brdp) != 0) {
+       if (request_irq(brdp->irq, stl_intr, IRQF_SHARED, name, brdp) != 0) {
                printk("STALLION: failed to register interrupt "
                    "routine for %s irq=%d\n", name, brdp->irq);
                i = -ENODEV;
index 76b9107f7f814b53bda55814e3d5e8d890b02b44..e1cd2bc4b1e4222e5806dab4389169ffa774900b 100644 (file)
@@ -410,7 +410,7 @@ static struct real_driver sx_real_driver = {
  *
  */
 
-static struct file_operations sx_fw_fops = {
+static const struct file_operations sx_fw_fops = {
        .owner          = THIS_MODULE,
        .ioctl          = sx_fw_ioctl,
 };
@@ -1993,7 +1993,7 @@ static int sx_init_board (struct sx_board *board)
                if(board->irq > 0) {
                        /* fixed irq, probably PCI */
                        if(sx_irqmask & (1 << board->irq)) { /* may we use this irq? */
-                               if(request_irq(board->irq, sx_interrupt, SA_SHIRQ | SA_INTERRUPT, "sx", board)) {
+                               if(request_irq(board->irq, sx_interrupt, IRQF_SHARED | IRQF_DISABLED, "sx", board)) {
                                        printk(KERN_ERR "sx: Cannot allocate irq %d.\n", board->irq);
                                        board->irq = 0;
                                }
@@ -2005,7 +2005,7 @@ static int sx_init_board (struct sx_board *board)
                        int irqmask = sx_irqmask & (IS_SX_BOARD(board) ? SX_ISA_IRQ_MASK : SI2_ISA_IRQ_MASK);
                        for(irqnr = 15; irqnr > 0; irqnr--)
                                if(irqmask & (1 << irqnr))
-                                       if(! request_irq(irqnr, sx_interrupt, SA_SHIRQ | SA_INTERRUPT, "sx", board))
+                                       if(! request_irq(irqnr, sx_interrupt, IRQF_SHARED | IRQF_DISABLED, "sx", board))
                                                break;
                        if(! irqnr)
                                printk(KERN_ERR "sx: Cannot allocate IRQ.\n");
index fee2aca3f6a5c7eb77c8c07135489644e5ec8ab2..df782dd1098c1b61b92fc915d18f471b07dff0ad 100644 (file)
@@ -8150,7 +8150,7 @@ static int __devinit synclink_init_one (struct pci_dev *dev,
                                
        info->bus_type = MGSL_BUS_TYPE_PCI;
        info->io_addr_size = 8;
-       info->irq_flags = SA_SHIRQ;
+       info->irq_flags = IRQF_SHARED;
 
        if (dev->device == 0x0210) {
                /* Version 1 PCI9030 based universal PCI adapter */
index 4e35d41812248e7163c6bcbda1ee7f180dec1283..e829594195c1d836c6dca220c74e47939a5f45ec 100644 (file)
@@ -46,7 +46,6 @@
 //#define DBGRBUF(info) dump_rbufs(info)
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/version.h>
 #include <linux/errno.h>
@@ -3344,7 +3343,7 @@ static struct slgt_info *alloc_dev(int adapter_num, int port_num, struct pci_dev
                info->phys_reg_addr = pci_resource_start(pdev,0);
 
                info->bus_type = MGSL_BUS_TYPE_PCI;
-               info->irq_flags = SA_SHIRQ;
+               info->irq_flags = IRQF_SHARED;
 
                info->init_error = -1; /* assume error, set to 0 on successful init */
        }
index 21bf15ad998020cdb985eba98fa607bf6fefc406..1e443a233f5102e3eef924ef0cb114e82b6f8f43 100644 (file)
@@ -34,7 +34,6 @@
 
 #define MAX_DEVICES 12
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
@@ -3836,7 +3835,7 @@ static SLMP_INFO *alloc_dev(int adapter_num, int port_num, struct pci_dev *pdev)
                info->phys_statctrl_base &= ~(PAGE_SIZE-1);
 
                info->bus_type = MGSL_BUS_TYPE_PCI;
-               info->irq_flags = SA_SHIRQ;
+               info->irq_flags = IRQF_SHARED;
 
                init_timer(&info->tx_timer);
                info->tx_timer.data = (unsigned long)info;
index 35082dc12eaee8181cfd0344c15addcf82a4ed16..ee3ca8f1768e9be995a62a252404ad4712d5d6bc 100644 (file)
@@ -12,7 +12,6 @@
  *     based upon discusions in irc://irc.openprojects.net/#kernelnewbies
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/interrupt.h>
 #include <linux/mm.h>
@@ -148,12 +147,13 @@ static struct sysrq_key_op sysrq_mountro_op = {
        .enable_mask    = SYSRQ_ENABLE_REMOUNT,
 };
 
-#ifdef CONFIG_DEBUG_MUTEXES
+#ifdef CONFIG_LOCKDEP
 static void sysrq_handle_showlocks(int key, struct pt_regs *pt_regs,
                                struct tty_struct *tty)
 {
-       mutex_debug_show_all_locks();
+       debug_show_all_locks();
 }
+
 static struct sysrq_key_op sysrq_showlocks_op = {
        .handler        = sysrq_handle_showlocks,
        .help_msg       = "show-all-locks(D)",
index a80c83210872b544551573f214e5e9223c3921c6..bb1bad4c18f9e5718e56d014ecff7ebbe235c1fe 100644 (file)
@@ -255,7 +255,7 @@ static int tanbac_tb0219_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-static struct file_operations tb0219_fops = {
+static const struct file_operations tb0219_fops = {
        .owner          = THIS_MODULE,
        .read           = tanbac_tb0219_read,
        .write          = tanbac_tb0219_write,
index f7802e5bd7ca757069e91beabf09c1cb4017222c..d30dc09dbbc9df2ffbb5c09e8f3cb32e334a49e2 100644 (file)
@@ -42,7 +42,6 @@
  */
 #undef DEBUG                           /* change to #define to get debugging
                                         * output - for pr_debug() */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/errno.h>
@@ -382,7 +381,7 @@ tipar_ioctl(struct inode *inode, struct file *file,
 
 /* ----- kernel module registering ------------------------------------ */
 
-static struct file_operations tipar_fops = {
+static const struct file_operations tipar_fops = {
        .owner = THIS_MODULE,
        .llseek = no_llseek,
        .read = tipar_read,
index ef68d152d3e4799386b582a7fb25bf3cc24a1b61..d2c5ba4e83b8bcdada44f028b0dfe9dd93952222 100644 (file)
@@ -27,7 +27,6 @@
  * MPCBL0010 ATCA computer.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/sched.h>
@@ -209,7 +208,7 @@ static int tlclk_open(struct inode *inode, struct file *filp)
        /* This device is wired through the FPGA IO space of the ATCA blade
         * we can't share this IRQ */
        result = request_irq(telclk_interrupt, &tlclk_interrupt,
-                            SA_INTERRUPT, "telco_clock", tlclk_interrupt);
+                            IRQF_DISABLED, "telco_clock", tlclk_interrupt);
        if (result == -EBUSY) {
                printk(KERN_ERR "tlclk: Interrupt can't be reserved.\n");
                return -EBUSY;
@@ -248,7 +247,7 @@ static ssize_t tlclk_write(struct file *filp, const char __user *buf, size_t cou
        return 0;
 }
 
-static struct file_operations tlclk_fops = {
+static const struct file_operations tlclk_fops = {
        .read = tlclk_read,
        .write = tlclk_write,
        .open = tlclk_open,
index e2fb234dee40c36708b3cd046561469610ab0ad9..dd36fd04a8421c8c873e7754408ca196de64eaf7 100644 (file)
@@ -92,7 +92,7 @@ static int tosh_ioctl(struct inode *, struct file *, unsigned int,
        unsigned long);
 
 
-static struct file_operations tosh_fops = {
+static const struct file_operations tosh_fops = {
        .owner          = THIS_MODULE,
        .ioctl          = tosh_ioctl,
 };
index 58a258cec1530594ef3c46e9ecd591d3192213e9..ad8ffe49256f75990e45a535b534851133eb8526 100644 (file)
@@ -116,7 +116,7 @@ static u8 tpm_atml_status(struct tpm_chip *chip)
        return ioread8(chip->vendor.iobase + 1);
 }
 
-static struct file_operations atmel_ops = {
+static const struct file_operations atmel_ops = {
        .owner = THIS_MODULE,
        .llseek = no_llseek,
        .open = tpm_open,
index adfff21beb219f9965d50626dfbc582cc016be31..1353b5a6bae8eb13a6f5ccc20ebe227ab7f2b8cb 100644 (file)
@@ -338,7 +338,7 @@ static struct attribute *inf_attrs[] = {
 
 static struct attribute_group inf_attr_grp = {.attrs = inf_attrs };
 
-static struct file_operations inf_ops = {
+static const struct file_operations inf_ops = {
        .owner = THIS_MODULE,
        .llseek = no_llseek,
        .open = tpm_open,
index 4c8bc06c7d95af6462d867014c8528a2cc93a12e..26287aace87db5376bd7a48b18d37ba03564937f 100644 (file)
@@ -226,7 +226,7 @@ static u8 tpm_nsc_status(struct tpm_chip *chip)
        return inb(chip->vendor.base + NSC_STATUS);
 }
 
-static struct file_operations nsc_ops = {
+static const struct file_operations nsc_ops = {
        .owner = THIS_MODULE,
        .llseek = no_llseek,
        .open = tpm_open,
index 8ea70625f7ea08bbf2714933cf2e58acd1da44bf..3232b1932597e88989366a445d59c0de420728f7 100644 (file)
@@ -330,7 +330,7 @@ out_err:
        return rc;
 }
 
-static struct file_operations tis_ops = {
+static const struct file_operations tis_ops = {
        .owner = THIS_MODULE,
        .llseek = no_llseek,
        .open = tpm_open,
@@ -522,7 +522,7 @@ static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev,
                        iowrite8(i, chip->vendor.iobase +
                                    TPM_INT_VECTOR(chip->vendor.locality));
                        if (request_irq
-                           (i, tis_int_probe, SA_SHIRQ,
+                           (i, tis_int_probe, IRQF_SHARED,
                             chip->vendor.miscdev.name, chip) != 0) {
                                dev_info(chip->dev,
                                         "Unable to request irq: %d for probe\n",
@@ -557,7 +557,7 @@ static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev,
                         chip->vendor.iobase +
                         TPM_INT_VECTOR(chip->vendor.locality));
                if (request_irq
-                   (chip->vendor.irq, tis_int_handler, SA_SHIRQ,
+                   (chip->vendor.irq, tis_int_handler, IRQF_SHARED,
                     chip->vendor.miscdev.name, chip) != 0) {
                        dev_info(chip->dev,
                                 "Unable to request irq: %d for use\n",
index a1143238fecabb28e844717346b7aefa88307318..bfdb90242a905749021bc93a801cb543e969852c 100644 (file)
@@ -65,7 +65,6 @@
  * alloc_tty_struct() always uses kmalloc() -- Andrew Morton <andrewm@uow.edu.eu> 17Mar01
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/major.h>
 #include <linux/errno.h>
@@ -913,7 +912,7 @@ static int hung_up_tty_ioctl(struct inode * inode, struct file * file,
        return cmd == TIOCSPGRP ? -ENOTTY : -EIO;
 }
 
-static struct file_operations tty_fops = {
+static const struct file_operations tty_fops = {
        .llseek         = no_llseek,
        .read           = tty_read,
        .write          = tty_write,
@@ -925,7 +924,7 @@ static struct file_operations tty_fops = {
 };
 
 #ifdef CONFIG_UNIX98_PTYS
-static struct file_operations ptmx_fops = {
+static const struct file_operations ptmx_fops = {
        .llseek         = no_llseek,
        .read           = tty_read,
        .write          = tty_write,
@@ -937,7 +936,7 @@ static struct file_operations ptmx_fops = {
 };
 #endif
 
-static struct file_operations console_fops = {
+static const struct file_operations console_fops = {
        .llseek         = no_llseek,
        .read           = tty_read,
        .write          = redirected_tty_write,
@@ -948,7 +947,7 @@ static struct file_operations console_fops = {
        .fasync         = tty_fasync,
 };
 
-static struct file_operations hung_up_tty_fops = {
+static const struct file_operations hung_up_tty_fops = {
        .llseek         = no_llseek,
        .read           = hung_up_tty_read,
        .write          = hung_up_tty_write,
@@ -2337,7 +2336,7 @@ static int fionbio(struct file *file, int __user *p)
 
 static int tiocsctty(struct tty_struct *tty, int arg)
 {
-       task_t *p;
+       struct task_struct *p;
 
        if (current->signal->leader &&
            (current->signal->session == tty->session))
index 234d7f3fb114e161fde4aa7de491325e446db384..a9247b5213d58e10708cef11b85892ccc8cb6a68 100644 (file)
@@ -21,7 +21,6 @@
  *      - making it shorter - scr_readw are macros which expand in PRETTY long code
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/major.h>
 #include <linux/errno.h>
@@ -466,7 +465,7 @@ vcs_open(struct inode *inode, struct file *filp)
        return 0;
 }
 
-static struct file_operations vcs_fops = {
+static const struct file_operations vcs_fops = {
        .llseek         = vcs_lseek,
        .read           = vcs_read,
        .write          = vcs_write,
index 07f5ce4b28e368672ec52f161abd3b5ed6606a34..766f7864c6c6b1d8896453454608b7b9613b28e6 100644 (file)
@@ -25,7 +25,6 @@
  * 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/config.h>
 #include <linux/kernel.h>
 #include <linux/proc_fs.h>
 #include <linux/errno.h>
index 198f1505ae238fac3396ddff561e1c5c2834b7fc..b72b2049aaae1a448e7306d85e68e4e7bbb997c0 100644 (file)
@@ -31,7 +31,6 @@
  * the OS/400 partition.  The format of the messages is defined in
  * iseries/vio.h
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -293,7 +292,7 @@ static int proc_viotape_open(struct inode *inode, struct file *file)
        return single_open(file, proc_viotape_show, NULL);
 }
 
-static struct file_operations proc_viotape_operations = {
+static const struct file_operations proc_viotape_operations = {
        .open           = proc_viotape_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
index fe99fc1aba45c9d3978693dbb12dba5a6e330c76..bfe5ea948f6a51a4acb6687efe4f45ab05d441ff 100644 (file)
@@ -14,7 +14,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/kdev_t.h>
 #include <asm/io.h>
 #include <linux/kernel.h>
@@ -204,13 +203,13 @@ static int mvme147_scc_init(void)
        port->datap = port->ctrlp + 1;
        port->port_a = &scc_ports[0];
        port->port_b = &scc_ports[1];
-       request_irq(MVME147_IRQ_SCCA_TX, scc_tx_int, SA_INTERRUPT,
+       request_irq(MVME147_IRQ_SCCA_TX, scc_tx_int, IRQF_DISABLED,
                            "SCC-A TX", port);
-       request_irq(MVME147_IRQ_SCCA_STAT, scc_stat_int, SA_INTERRUPT,
+       request_irq(MVME147_IRQ_SCCA_STAT, scc_stat_int, IRQF_DISABLED,
                            "SCC-A status", port);
-       request_irq(MVME147_IRQ_SCCA_RX, scc_rx_int, SA_INTERRUPT,
+       request_irq(MVME147_IRQ_SCCA_RX, scc_rx_int, IRQF_DISABLED,
                            "SCC-A RX", port);
-       request_irq(MVME147_IRQ_SCCA_SPCOND, scc_spcond_int, SA_INTERRUPT,
+       request_irq(MVME147_IRQ_SCCA_SPCOND, scc_spcond_int, IRQF_DISABLED,
                            "SCC-A special cond", port);
        {
                SCC_ACCESS_INIT(port);
@@ -231,13 +230,13 @@ static int mvme147_scc_init(void)
        port->datap = port->ctrlp + 1;
        port->port_a = &scc_ports[0];
        port->port_b = &scc_ports[1];
-       request_irq(MVME147_IRQ_SCCB_TX, scc_tx_int, SA_INTERRUPT,
+       request_irq(MVME147_IRQ_SCCB_TX, scc_tx_int, IRQF_DISABLED,
                            "SCC-B TX", port);
-       request_irq(MVME147_IRQ_SCCB_STAT, scc_stat_int, SA_INTERRUPT,
+       request_irq(MVME147_IRQ_SCCB_STAT, scc_stat_int, IRQF_DISABLED,
                            "SCC-B status", port);
-       request_irq(MVME147_IRQ_SCCB_RX, scc_rx_int, SA_INTERRUPT,
+       request_irq(MVME147_IRQ_SCCB_RX, scc_rx_int, IRQF_DISABLED,
                            "SCC-B RX", port);
-       request_irq(MVME147_IRQ_SCCB_SPCOND, scc_spcond_int, SA_INTERRUPT,
+       request_irq(MVME147_IRQ_SCCB_SPCOND, scc_spcond_int, IRQF_DISABLED,
                            "SCC-B special cond", port);
        {
                SCC_ACCESS_INIT(port);
@@ -274,13 +273,13 @@ static int mvme162_scc_init(void)
        port->datap = port->ctrlp + 2;
        port->port_a = &scc_ports[0];
        port->port_b = &scc_ports[1];
-       request_irq(MVME162_IRQ_SCCA_TX, scc_tx_int, SA_INTERRUPT,
+       request_irq(MVME162_IRQ_SCCA_TX, scc_tx_int, IRQF_DISABLED,
                            "SCC-A TX", port);
-       request_irq(MVME162_IRQ_SCCA_STAT, scc_stat_int, SA_INTERRUPT,
+       request_irq(MVME162_IRQ_SCCA_STAT, scc_stat_int, IRQF_DISABLED,
                            "SCC-A status", port);
-       request_irq(MVME162_IRQ_SCCA_RX, scc_rx_int, SA_INTERRUPT,
+       request_irq(MVME162_IRQ_SCCA_RX, scc_rx_int, IRQF_DISABLED,
                            "SCC-A RX", port);
-       request_irq(MVME162_IRQ_SCCA_SPCOND, scc_spcond_int, SA_INTERRUPT,
+       request_irq(MVME162_IRQ_SCCA_SPCOND, scc_spcond_int, IRQF_DISABLED,
                            "SCC-A special cond", port);
        {
                SCC_ACCESS_INIT(port);
@@ -301,13 +300,13 @@ static int mvme162_scc_init(void)
        port->datap = port->ctrlp + 2;
        port->port_a = &scc_ports[0];
        port->port_b = &scc_ports[1];
-       request_irq(MVME162_IRQ_SCCB_TX, scc_tx_int, SA_INTERRUPT,
+       request_irq(MVME162_IRQ_SCCB_TX, scc_tx_int, IRQF_DISABLED,
                            "SCC-B TX", port);
-       request_irq(MVME162_IRQ_SCCB_STAT, scc_stat_int, SA_INTERRUPT,
+       request_irq(MVME162_IRQ_SCCB_STAT, scc_stat_int, IRQF_DISABLED,
                            "SCC-B status", port);
-       request_irq(MVME162_IRQ_SCCB_RX, scc_rx_int, SA_INTERRUPT,
+       request_irq(MVME162_IRQ_SCCB_RX, scc_rx_int, IRQF_DISABLED,
                            "SCC-B RX", port);
-       request_irq(MVME162_IRQ_SCCB_SPCOND, scc_spcond_int, SA_INTERRUPT,
+       request_irq(MVME162_IRQ_SCCB_SPCOND, scc_spcond_int, IRQF_DISABLED,
                            "SCC-B special cond", port);
 
        {
@@ -342,13 +341,13 @@ static int bvme6000_scc_init(void)
        port->datap = port->ctrlp + 4;
        port->port_a = &scc_ports[0];
        port->port_b = &scc_ports[1];
-       request_irq(BVME_IRQ_SCCA_TX, scc_tx_int, SA_INTERRUPT,
+       request_irq(BVME_IRQ_SCCA_TX, scc_tx_int, IRQF_DISABLED,
                            "SCC-A TX", port);
-       request_irq(BVME_IRQ_SCCA_STAT, scc_stat_int, SA_INTERRUPT,
+       request_irq(BVME_IRQ_SCCA_STAT, scc_stat_int, IRQF_DISABLED,
                            "SCC-A status", port);
-       request_irq(BVME_IRQ_SCCA_RX, scc_rx_int, SA_INTERRUPT,
+       request_irq(BVME_IRQ_SCCA_RX, scc_rx_int, IRQF_DISABLED,
                            "SCC-A RX", port);
-       request_irq(BVME_IRQ_SCCA_SPCOND, scc_spcond_int, SA_INTERRUPT,
+       request_irq(BVME_IRQ_SCCA_SPCOND, scc_spcond_int, IRQF_DISABLED,
                            "SCC-A special cond", port);
        {
                SCC_ACCESS_INIT(port);
@@ -369,13 +368,13 @@ static int bvme6000_scc_init(void)
        port->datap = port->ctrlp + 4;
        port->port_a = &scc_ports[0];
        port->port_b = &scc_ports[1];
-       request_irq(BVME_IRQ_SCCB_TX, scc_tx_int, SA_INTERRUPT,
+       request_irq(BVME_IRQ_SCCB_TX, scc_tx_int, IRQF_DISABLED,
                            "SCC-B TX", port);
-       request_irq(BVME_IRQ_SCCB_STAT, scc_stat_int, SA_INTERRUPT,
+       request_irq(BVME_IRQ_SCCB_STAT, scc_stat_int, IRQF_DISABLED,
                            "SCC-B status", port);
-       request_irq(BVME_IRQ_SCCB_RX, scc_rx_int, SA_INTERRUPT,
+       request_irq(BVME_IRQ_SCCB_RX, scc_rx_int, IRQF_DISABLED,
                            "SCC-B RX", port);
-       request_irq(BVME_IRQ_SCCB_SPCOND, scc_spcond_int, SA_INTERRUPT,
+       request_irq(BVME_IRQ_SCCB_SPCOND, scc_spcond_int, IRQF_DISABLED,
                            "SCC-B special cond", port);
 
        {
index 073da48c092e0ae804cc6354b9c897c668b6033c..1b9b1f1d4c490b0db1cafa32c13b6b60388d18e7 100644 (file)
@@ -605,7 +605,7 @@ static int gpio_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-static struct file_operations gpio_fops = {
+static const struct file_operations gpio_fops = {
        .owner          = THIS_MODULE,
        .read           = gpio_read,
        .write          = gpio_write,
index d6f65032649ab83398407026accffa8c9071ffdd..da7e66a2a38b5dcda25270c6b4329069f36a886f 100644 (file)
@@ -86,7 +86,6 @@
 #include <linux/consolemap.h>
 #include <linux/timer.h>
 #include <linux/interrupt.h>
-#include <linux/config.h>
 #include <linux/workqueue.h>
 #include <linux/bootmem.h>
 #include <linux/pm.h>
@@ -887,6 +886,7 @@ void vc_disallocate(unsigned int currcons)
        if (vc_cons_allocated(currcons)) {
                struct vc_data *vc = vc_cons[currcons].d;
                vc->vc_sw->con_deinit(vc);
+               module_put(vc->vc_sw->owner);
                if (vc->vc_kmalloced)
                        kfree(vc->vc_screenbuf);
                if (currcons >= MIN_NR_CONSOLES)
index 24011e7c81ff72fa6bade2d7c889c8a0c2c48c5a..eccffaf26faabd7acdb89b29d4ee98de37e8fad2 100644 (file)
@@ -10,7 +10,6 @@
  *  Check put/get_user, cleanups - acme@conectiva.com.br - Jun 2001
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
index 7289f4af93d0e6c90707ceac5f3b0bae1bb10336..c77fe3cf2852a198ff51133c0d79be03918a2960 100644 (file)
@@ -231,7 +231,7 @@ static int acq_notify_sys(struct notifier_block *this, unsigned long code,
  *     Kernel Interfaces
  */
 
-static struct file_operations acq_fops = {
+static const struct file_operations acq_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = acq_write,
index 194a3fd36b912e43c81f0aed8cf9cb65bfa050e8..8069be445edc3683f358e644ec7e883d7d4ad40c 100644 (file)
@@ -227,7 +227,7 @@ advwdt_notify_sys(struct notifier_block *this, unsigned long code,
  *     Kernel Interfaces
  */
 
-static struct file_operations advwdt_fops = {
+static const struct file_operations advwdt_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = advwdt_write,
index 8338ca300e2e75f2dfc74309deb075fac91c7e98..c5c94e4c94950ba93035e01e4053c9d1cc916a58 100644 (file)
@@ -362,7 +362,7 @@ static int __init ali_find_watchdog(void)
  *     Kernel Interfaces
  */
 
-static struct file_operations ali_fops = {
+static const struct file_operations ali_fops = {
        .owner =        THIS_MODULE,
        .llseek =       no_llseek,
        .write =        ali_write,
index c05ac188a4d7e3e2aae1e8cb355bbd7d2cb68b0c..ffd7684f999b3220572dbcf45cbe7a92b4a9b677 100644 (file)
@@ -281,7 +281,7 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
        }
 }
 
-static struct file_operations wdt_fops = {
+static const struct file_operations wdt_fops = {
        .owner=         THIS_MODULE,
        .llseek=        no_llseek,
        .write=         fop_write,
index 00080655533d338ae6438b8b3d37c4707f125fff..cc266715ea320b029496d0b5ad1d3ece4dc0d77e 100644 (file)
@@ -9,7 +9,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/init.h>
@@ -184,7 +183,7 @@ static ssize_t at91_wdt_write(struct file *file, const char *data, size_t len, l
 
 /* ......................................................................... */
 
-static struct file_operations at91wdt_fops = {
+static const struct file_operations at91wdt_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .ioctl          = at91_wdt_ioctl,
index b6640606b44d87d7402e11a6c96ba79126a2a649..e3cefc538b40476b341aeed5e4f61a874b64baa4 100644 (file)
@@ -14,7 +14,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/miscdevice.h>
@@ -146,7 +145,7 @@ static int booke_wdt_open (struct inode *inode, struct file *file)
        return 0;
 }
 
-static struct file_operations booke_wdt_fops = {
+static const struct file_operations booke_wdt_fops = {
   .owner = THIS_MODULE,
   .llseek = no_llseek,
   .write = booke_wdt_write,
index 3e8410b5a65e17504e0ae2cad18a113ad2b02aef..04c7e49918db0b5d491521f63a2415d318f0443a 100644 (file)
@@ -198,7 +198,7 @@ static ssize_t cpu5wdt_write(struct file *file, const char __user *buf, size_t c
        return count;
 }
 
-static struct file_operations cpu5wdt_fops = {
+static const struct file_operations cpu5wdt_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .ioctl          = cpu5wdt_ioctl,
index 9021dbb78299e6af800d09f2b50222386ba91375..77c8a955ae9e1f10f2e548b6b395bffe420d1f48 100644 (file)
@@ -187,7 +187,7 @@ static int ep93xx_wdt_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-static struct file_operations ep93xx_wdt_fops = {
+static const struct file_operations ep93xx_wdt_fops = {
        .owner          = THIS_MODULE,
        .write          = ep93xx_wdt_write,
        .ioctl          = ep93xx_wdt_ioctl,
index 25c2f257561152094e832aeac08d7ebcd9a8ed82..62dbccb2f6df979b23e0129871b6884df40b0c76 100644 (file)
@@ -40,7 +40,6 @@
  *     Added Matt Domsch's nowayout module option.
  */
 
-#include <linux/config.h>
 #include <linux/interrupt.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
@@ -357,7 +356,7 @@ static int eurwdt_notify_sys(struct notifier_block *this, unsigned long code,
  */
 
 
-static struct file_operations eurwdt_fops = {
+static const struct file_operations eurwdt_fops = {
        .owner  = THIS_MODULE,
        .llseek = no_llseek,
        .write  = eurwdt_write,
@@ -421,7 +420,7 @@ static int __init eurwdt_init(void)
                goto out;
        }
 
-       ret = request_irq(irq, eurwdt_interrupt, SA_INTERRUPT, "eurwdt", NULL);
+       ret = request_irq(irq, eurwdt_interrupt, IRQF_DISABLED, "eurwdt", NULL);
        if(ret) {
                printk(KERN_ERR "eurwdt: IRQ %d is not free.\n", irq);
                goto outmisc;
index 93785f13242eee7a972bd470adf3fb933269645e..870539eabbf3a93100693f19f966b1e404104ce5 100644 (file)
@@ -337,7 +337,7 @@ static int esb_notify_sys (struct notifier_block *this, unsigned long code, void
  *      Kernel Interfaces
  */
 
-static struct file_operations esb_fops = {
+static const struct file_operations esb_fops = {
         .owner =        THIS_MODULE,
         .llseek =       no_llseek,
         .write =        esb_write,
index bfbdbbf3c2f279a6fa2027e9837bbb4d539e6818..8385dd36eefe0fd7074306d7eacec6b4d4b25826 100644 (file)
@@ -378,7 +378,7 @@ static int i8xx_tco_notify_sys (struct notifier_block *this, unsigned long code,
  *     Kernel Interfaces
  */
 
-static struct file_operations i8xx_tco_fops = {
+static const struct file_operations i8xx_tco_fops = {
        .owner =        THIS_MODULE,
        .llseek =       no_llseek,
        .write =        i8xx_tco_write,
index cf60329eec85a16065c1de34191b789d9730d80a..fd95f7327798692c8612da2caacd1939ba0b7280 100644 (file)
@@ -31,7 +31,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/miscdevice.h>
@@ -256,7 +255,7 @@ ibwdt_notify_sys(struct notifier_block *this, unsigned long code,
  *     Kernel Interfaces
  */
 
-static struct file_operations ibwdt_fops = {
+static const struct file_operations ibwdt_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = ibwdt_write,
index 294c474ae485764eb9416a2c9c9cd5d56b773065..26ceee7a4df0922bd370560a4023d1bfa1892267 100644 (file)
@@ -10,7 +10,6 @@
  * of the GNU Public License, incorporated herein by reference.
  */
 
-#include <linux/config.h>
 #include <linux/fs.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
@@ -323,7 +322,7 @@ static int asr_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-static struct file_operations asr_fops = {
+static const struct file_operations asr_fops = {
        .owner =        THIS_MODULE,
        .llseek =       no_llseek,
        .write =        asr_write,
index b4b94daba67ea55e916173bf1738e422b2eec5d4..dacc1c20a310747aa322f9661047d82d47e1c7ab 100644 (file)
@@ -13,7 +13,6 @@
 
 #include <linux/module.h>
 #include <linux/moduleparam.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/fs.h>
@@ -155,7 +154,7 @@ static int indydog_notify_sys(struct notifier_block *this, unsigned long code, v
        return NOTIFY_DONE;
 }
 
-static struct file_operations indydog_fops = {
+static const struct file_operations indydog_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = indydog_write,
index 0cfb9b9c4a4b2c47634cf329640b89651a6802ad..692908819e26651cda0aa04ad555a78a651b6a52 100644 (file)
@@ -16,7 +16,6 @@
  * warranty of any kind, whether express or implied.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/types.h>
@@ -169,7 +168,7 @@ ixp2000_wdt_release(struct inode *inode, struct file *file)
 }
 
 
-static struct file_operations ixp2000_wdt_fops =
+static const struct file_operations ixp2000_wdt_fops =
 {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
index 3800835ca8f384d23f4e7cc5d8ee0167d04acb32..9db5cf2c38c37064334875b42c35c93dbce15126 100644 (file)
@@ -13,7 +13,6 @@
  * warranty of any kind, whether express or implied.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/types.h>
@@ -163,7 +162,7 @@ ixp4xx_wdt_release(struct inode *inode, struct file *file)
 }
 
 
-static struct file_operations ixp4xx_wdt_fops =
+static const struct file_operations ixp4xx_wdt_fops =
 {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
index a9a20aad61e705125f9e696abb8b07855ea2ec62..23734e07fb22503d5395550e49bae577595a1295 100644 (file)
@@ -28,7 +28,6 @@
  *      Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/types.h>
@@ -389,7 +388,7 @@ static int zf_notify_sys(struct notifier_block *this, unsigned long code,
 
 
 
-static struct file_operations zf_fops = {
+static const struct file_operations zf_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = zf_write,
index d8dede575402e14ab31952fec1d249cb0156b008..ae943324d2511e2b5ab174b59d864fc055ca60a3 100644 (file)
@@ -37,7 +37,6 @@
 
 #include <linux/module.h>
 #include <linux/moduleparam.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/miscdevice.h>
 #include <linux/ioport.h>
@@ -191,7 +190,7 @@ static int mixcomwd_ioctl(struct inode *inode, struct file *file,
        return 0;
 }
 
-static struct file_operations mixcomwd_fops=
+static const struct file_operations mixcomwd_fops=
 {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
index 5d6f5061603a5eab05b5e93a219961171ba3c3e9..a480903ee1a59cbf4e17e0bcd150cc0e4aef47c6 100644 (file)
@@ -15,7 +15,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/fs.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
@@ -130,7 +129,7 @@ static int mpc83xx_wdt_ioctl(struct inode *inode, struct file *file,
        }
 }
 
-static struct file_operations mpc83xx_wdt_fops = {
+static const struct file_operations mpc83xx_wdt_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = mpc83xx_wdt_write,
index b2fc71e20850191abc640b901ae63bb51184fb74..35dd9e6e114023e5b9d65a801b23e8a728be1263 100644 (file)
@@ -9,7 +9,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <linux/fs.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
@@ -133,7 +132,7 @@ static int mpc8xx_wdt_ioctl(struct inode *inode, struct file *file,
        return 0;
 }
 
-static struct file_operations mpc8xx_wdt_fops = {
+static const struct file_operations mpc8xx_wdt_fops = {
        .owner = THIS_MODULE,
        .llseek = no_llseek,
        .write = mpc8xx_wdt_write,
index 2c2c517732000a8337d2da0ee54383eb0ce1f0ed..54b3c56ead0df8abdde728fe425a54ac9fc7661f 100644 (file)
@@ -21,7 +21,6 @@
  */
 #include <linux/module.h>
 #include <linux/moduleparam.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/miscdevice.h>
 #include <linux/watchdog.h>
@@ -298,7 +297,7 @@ static void mpcore_wdt_shutdown(struct platform_device *dev)
 /*
  *     Kernel Interfaces
  */
-static struct file_operations mpcore_wdt_fops = {
+static const struct file_operations mpcore_wdt_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = mpcore_wdt_write,
@@ -356,7 +355,7 @@ static int __devinit mpcore_wdt_probe(struct platform_device *dev)
                goto err_misc;
        }
 
-       ret = request_irq(wdt->irq, mpcore_wdt_fire, SA_INTERRUPT, "mpcore_wdt", wdt);
+       ret = request_irq(wdt->irq, mpcore_wdt_fire, IRQF_DISABLED, "mpcore_wdt", wdt);
        if (ret) {
                dev_printk(KERN_ERR, _dev, "cannot register IRQ%d for watchdog\n", wdt->irq);
                goto err_irq;
index f1b9cf89f153ab727d357435437c0f6fc54dea73..5c8fab345b403668a6159cc9b8a35392a0cc3b36 100644 (file)
@@ -15,7 +15,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <linux/fs.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
@@ -167,7 +166,7 @@ static int mv64x60_wdt_ioctl(struct inode *inode, struct file *file,
        return 0;
 }
 
-static struct file_operations mv64x60_wdt_fops = {
+static const struct file_operations mv64x60_wdt_fops = {
        .owner = THIS_MODULE,
        .llseek = no_llseek,
        .write = mv64x60_wdt_write,
index 6d44ca68312dff82e3ef867a94feedce5e148752..cd7d1b6a5d9fb2dd97aeae7783327f74163d8830 100644 (file)
@@ -740,7 +740,7 @@ static int pcwd_notify_sys(struct notifier_block *this, unsigned long code, void
  *     Kernel Interfaces
  */
 
-static struct file_operations pcwd_fops = {
+static const struct file_operations pcwd_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = pcwd_write,
@@ -755,7 +755,7 @@ static struct miscdevice pcwd_miscdev = {
        .fops =         &pcwd_fops,
 };
 
-static struct file_operations pcwd_temp_fops = {
+static const struct file_operations pcwd_temp_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .read           = pcwd_temp_read,
index 1f40ecefbf7260c020c6117118975a0facfadff6..c7cfd6dbfe1b299b7bcf8db0189645cb3a5fe78d 100644 (file)
@@ -625,7 +625,7 @@ static int pcipcwd_notify_sys(struct notifier_block *this, unsigned long code, v
  *     Kernel Interfaces
  */
 
-static struct file_operations pcipcwd_fops = {
+static const struct file_operations pcipcwd_fops = {
        .owner =        THIS_MODULE,
        .llseek =       no_llseek,
        .write =        pcipcwd_write,
@@ -640,7 +640,7 @@ static struct miscdevice pcipcwd_miscdev = {
        .fops =         &pcipcwd_fops,
 };
 
-static struct file_operations pcipcwd_temp_fops = {
+static const struct file_operations pcipcwd_temp_fops = {
        .owner =        THIS_MODULE,
        .llseek =       no_llseek,
        .read =         pcipcwd_temp_read,
index 0d072bed501dfd744796e62a58d7468060e78f55..b7ae73dcdd0823602e1c75983fdb7455f9a7a824 100644 (file)
@@ -24,7 +24,6 @@
  *     http://www.berkprod.com/ or http://www.pcwatchdog.com/
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
@@ -524,7 +523,7 @@ static int usb_pcwd_notify_sys(struct notifier_block *this, unsigned long code,
  *     Kernel Interfaces
  */
 
-static struct file_operations usb_pcwd_fops = {
+static const struct file_operations usb_pcwd_fops = {
        .owner =        THIS_MODULE,
        .llseek =       no_llseek,
        .write =        usb_pcwd_write,
@@ -539,7 +538,7 @@ static struct miscdevice usb_pcwd_miscdev = {
        .fops =         &usb_pcwd_fops,
 };
 
-static struct file_operations usb_pcwd_temperature_fops = {
+static const struct file_operations usb_pcwd_temperature_fops = {
        .owner =        THIS_MODULE,
        .llseek =       no_llseek,
        .read =         usb_pcwd_temperature_read,
index 1ea04e9b2b0b0938cfc2cbfa04b2eed12b4da01b..be978e8ed754941fa215bc5864e72e8e3bb258ea 100644 (file)
@@ -37,7 +37,6 @@
 
 #include <linux/module.h>
 #include <linux/moduleparam.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/timer.h>
 #include <linux/miscdevice.h>
@@ -320,7 +319,7 @@ static int s3c2410wdt_ioctl(struct inode *inode, struct file *file,
 
 /* kernel interface */
 
-static struct file_operations s3c2410wdt_fops = {
+static const struct file_operations s3c2410wdt_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = s3c2410wdt_write,
index 522a9370db948052c4bde4954fadef09b5759d49..1fc16d995788792794e7cbf3cb673c62314464d0 100644 (file)
@@ -17,7 +17,6 @@
  *
  *      27/11/2000 Initial release
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/types.h>
@@ -136,7 +135,7 @@ static int sa1100dog_ioctl(struct inode *inode, struct file *file,
        return ret;
 }
 
-static struct file_operations sa1100dog_fops =
+static const struct file_operations sa1100dog_fops =
 {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
index ed0bd55fbfc1d7cd9cb98e5b464032a10f50fc2c..4663c2fd53cd6fbe57f41c6acad6c2577cbc452b 100644 (file)
@@ -282,7 +282,7 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
        }
 }
 
-static struct file_operations wdt_fops = {
+static const struct file_operations wdt_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = fop_write,
index c6cbf808d8c2d4ef655420eb5e3f26ccd078f4bb..1035be5b5019195ee114c86b7c98634001928876 100644 (file)
@@ -36,7 +36,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/miscdevice.h>
@@ -306,7 +305,7 @@ static int sbc8360_notify_sys(struct notifier_block *this, unsigned long code,
  *     Kernel Interfaces
  */
 
-static struct file_operations sbc8360_fops = {
+static const struct file_operations sbc8360_fops = {
        .owner = THIS_MODULE,
        .llseek = no_llseek,
        .write = sbc8360_write,
index 837b1ec3ffe32c640ebbd6f0f39c9ef646c28f60..bfc475dabe6d76406dd44b968479227c31678619 100644 (file)
@@ -15,7 +15,6 @@
 
 #include <linux/module.h>
 #include <linux/moduleparam.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/fs.h>
@@ -155,7 +154,7 @@ static int epx_c3_notify_sys(struct notifier_block *this, unsigned long code,
        return NOTIFY_DONE;
 }
 
-static struct file_operations epx_c3_fops = {
+static const struct file_operations epx_c3_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = epx_c3_write,
index 20b88f9b7be20d9081c58a72e217a89a394661f2..7c3cf293a5afc3684111c95bce7ad52653a4cb74 100644 (file)
@@ -27,7 +27,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/miscdevice.h>
@@ -293,7 +292,7 @@ static struct notifier_block sc1200wdt_notifier =
        .notifier_call =        sc1200wdt_notify_sys,
 };
 
-static struct file_operations sc1200wdt_fops =
+static const struct file_operations sc1200wdt_fops =
 {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
index 4ee9974ad8cbaec08ada8758d120c8bb32fdbc48..2c7c9db71be81e9eb5318cebe94d7fd215ecd8c3 100644 (file)
@@ -336,7 +336,7 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
        }
 }
 
-static struct file_operations wdt_fops = {
+static const struct file_operations wdt_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = fop_write,
index b4a102a2d7e390cfa3774d0a6c7871756e6b11ec..c561299a5537b483ab242399114bb9580c499930 100644 (file)
@@ -17,7 +17,6 @@
    of any nature resulting due to the use of this software. This
    software is provided AS-IS with no warranties. */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/init.h>
@@ -195,7 +194,7 @@ static int scx200_wdt_ioctl(struct inode *inode, struct file *file,
        }
 }
 
-static struct file_operations scx200_wdt_fops = {
+static const struct file_operations scx200_wdt_fops = {
        .owner   = THIS_MODULE,
        .llseek  = no_llseek,
        .write   = scx200_wdt_write,
index 1f4cab55b2efb26b9c5623a9a536eab48149aa7f..1355038f10440e27f4a708eea95694f897edbc0a 100644 (file)
@@ -17,7 +17,6 @@
  *     Added expect close support, made emulated timeout runtime changeable
  *     general cleanups, add some ioctls
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/init.h>
@@ -345,7 +344,7 @@ static int sh_wdt_notify_sys(struct notifier_block *this,
        return NOTIFY_DONE;
 }
 
-static struct file_operations sh_wdt_fops = {
+static const struct file_operations sh_wdt_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = sh_wdt_write,
index a91edaf3a350a1d7230740fe7832f537e85986f3..ef8da517545add27cabc43338cbf17d851170625 100644 (file)
@@ -38,7 +38,6 @@
 
 #include <linux/module.h>
 #include <linux/moduleparam.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/timer.h>
 #include <linux/miscdevice.h>
@@ -244,7 +243,7 @@ static int softdog_notify_sys(struct notifier_block *this, unsigned long code,
  *     Kernel Interfaces
  */
 
-static struct file_operations softdog_fops = {
+static const struct file_operations softdog_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = softdog_write,
index d15ca9a3986f03ab159102538a585d6b592eea9f..13f16d41c2fd33a1db8d68cd6b74b41038c2a103 100644 (file)
@@ -274,7 +274,7 @@ wdt_notify_sys(struct notifier_block *this, unsigned long code,
  *     Kernel Interfaces
  */
 
-static struct file_operations wdt_fops = {
+static const struct file_operations wdt_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = wdt_write,
index 52a8bd0a5988603ac6255d0c5db30c957f46d7a7..ccf6c0915945d8f517f124cbf989016f6c1b1ddf 100644 (file)
@@ -299,7 +299,7 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
        }
 }
 
-static struct file_operations wdt_fops = {
+static const struct file_operations wdt_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = fop_write,
index a7ff64c8921f299202a4eda9f2a040a42f360eff..98f4e17db70a478441bfa9d68e2d1d1a704df12a 100644 (file)
@@ -17,7 +17,6 @@
 
 #include <linux/module.h>
 #include <linux/moduleparam.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/fs.h>
@@ -450,7 +449,7 @@ static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
        return NOTIFY_DONE;
 }
 
-static struct file_operations wdt_fops=
+static const struct file_operations wdt_fops=
 {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
index 7cf6c9bbf4868848e75338f8cb48ad786f02f9f8..2bb6a9d6ad2805dba0bb60093a31acf6d5fd7e1c 100644 (file)
@@ -222,7 +222,7 @@ static int wafwdt_notify_sys(struct notifier_block *this, unsigned long code, vo
  *     Kernel Interfaces
  */
 
-static struct file_operations wafwdt_fops = {
+static const struct file_operations wafwdt_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = wafwdt_write,
index 84e60eb743377138326f4dfce6fe093ddb441b82..a4504f40394dc014adee3d902c3ef271105e5d6c 100644 (file)
@@ -19,7 +19,6 @@
  *
  */
 
-#include <linux/config.h>
 
 #define WDT_COUNT0             (io+0)
 #define WDT_COUNT1             (io+1)
index dacfe31caccf3fb5f3fb525f349dabec087cd644..5c38cdf41731201b7f37506e79cbadf6cfcd3438 100644 (file)
@@ -26,7 +26,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/fs.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
@@ -521,7 +520,7 @@ wdrtas_reboot(struct notifier_block *this, unsigned long code, void *ptr)
 
 /*** initialization stuff */
 
-static struct file_operations wdrtas_fops = {
+static const struct file_operations wdrtas_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = wdrtas_write,
@@ -536,7 +535,7 @@ static struct miscdevice wdrtas_miscdev = {
        .fops =         &wdrtas_fops,
 };
 
-static struct file_operations wdrtas_temp_fops = {
+static const struct file_operations wdrtas_temp_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .read           = wdrtas_temp_read,
index ec7e401228ee85d85d100ed331cc677796b0f039..70be81e39a61b3284cd86775ebcdc6fa0d9f54c3 100644 (file)
@@ -31,7 +31,6 @@
  *             Matt Domsch     :       Added nowayout module option
  */
 
-#include <linux/config.h>
 #include <linux/interrupt.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
@@ -495,7 +494,7 @@ static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
  */
 
 
-static struct file_operations wdt_fops = {
+static const struct file_operations wdt_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = wdt_write,
@@ -511,7 +510,7 @@ static struct miscdevice wdt_miscdev = {
 };
 
 #ifdef CONFIG_WDT_501
-static struct file_operations wdt_temp_fops = {
+static const struct file_operations wdt_temp_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .read           = wdt_temp_read,
@@ -581,7 +580,7 @@ static int __init wdt_init(void)
                goto out;
        }
 
-       ret = request_irq(irq, wdt_interrupt, SA_INTERRUPT, "wdt501p", NULL);
+       ret = request_irq(irq, wdt_interrupt, IRQF_DISABLED, "wdt501p", NULL);
        if(ret) {
                printk(KERN_ERR "wdt: IRQ %d is not free.\n", irq);
                goto outreg;
index 52825a1f1779b7a2292f6265f7c0359286477f5e..6555fb844f2342113a91ca7cec265403e25f628a 100644 (file)
@@ -178,7 +178,7 @@ watchdog_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
        return ret;
 }
 
-static struct file_operations watchdog_fops = {
+static const struct file_operations watchdog_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = watchdog_write,
index 3843900e94c49f8101364828f8d8bdeb656987b7..a0935bc775f8eb847d39ab4f32eacb8a7914ae47 100644 (file)
@@ -24,7 +24,6 @@
 
 #include <linux/module.h>
 #include <linux/moduleparam.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/fs.h>
@@ -419,7 +418,7 @@ static int wdt977_notify_sys(struct notifier_block *this, unsigned long code,
        return NOTIFY_DONE;
 }
 
-static struct file_operations wdt977_fops=
+static const struct file_operations wdt977_fops=
 {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
index 4b3311993d4876bf91f07ef9e9c2147bc75e3278..5918ca2c9c35b6c5bbc9bbb2d4012ebab122b80a 100644 (file)
@@ -35,7 +35,6 @@
  *             Matt Domsch     :       nowayout module option
  */
 
-#include <linux/config.h>
 #include <linux/interrupt.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
@@ -544,7 +543,7 @@ static int wdtpci_notify_sys(struct notifier_block *this, unsigned long code,
  */
 
 
-static struct file_operations wdtpci_fops = {
+static const struct file_operations wdtpci_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = wdtpci_write,
@@ -560,7 +559,7 @@ static struct miscdevice wdtpci_miscdev = {
 };
 
 #ifdef CONFIG_WDT_501_PCI
-static struct file_operations wdtpci_temp_fops = {
+static const struct file_operations wdtpci_temp_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .read           = wdtpci_temp_read,
@@ -618,7 +617,7 @@ static int __devinit wdtpci_init_one (struct pci_dev *dev,
                goto out_pci;
        }
 
-       if (request_irq (irq, wdtpci_interrupt, SA_INTERRUPT | SA_SHIRQ,
+       if (request_irq (irq, wdtpci_interrupt, IRQF_DISABLED | IRQF_SHARED,
                         "wdt_pci", &wdtpci_miscdev)) {
                printk (KERN_ERR PFX "IRQ %d is not free\n", irq);
                goto out_reg;
index 35e0b9ceecf7faa90f9ab34784112533e7d48ec7..1ba4039777e88757503af3601d791365abc1c59c 100644 (file)
@@ -15,7 +15,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
index 145061b8472a814b96e1075e51876ecbb5f3f246..25eee5394201d30866359043fd985c3075d8ef70 100644 (file)
@@ -9,7 +9,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sysdev.h>
 #include <linux/cpu.h>
index 071ee4f1bbf22a6ee542e16b29a579b422e323ca..44ae5e5b94cf4a30f4d1ab18287f72ec28caadb1 100644 (file)
@@ -11,7 +11,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/smp.h>
index 5829143558e1fa43dc05ef2d7fea891092da17b5..15278044295cbf38559c7a5d0410f3aa1873b29e 100644 (file)
@@ -166,8 +166,8 @@ static struct dma_chan *dma_client_chan_alloc(struct dma_client *client)
 }
 
 /**
- * dma_client_chan_free - release a DMA channel
- * @chan: &dma_chan
+ * dma_chan_cleanup - release a DMA channel's resources
+ * @kref: kernel reference structure that contains the DMA channel device
  */
 void dma_chan_cleanup(struct kref *kref)
 {
@@ -199,7 +199,7 @@ static void dma_client_chan_free(struct dma_chan *chan)
  * dma_chans_rebalance - reallocate channels to clients
  *
  * When the number of DMA channel in the system changes,
- * channels need to be rebalanced among clients
+ * channels need to be rebalanced among clients.
  */
 static void dma_chans_rebalance(void)
 {
@@ -264,7 +264,7 @@ struct dma_client *dma_async_client_register(dma_event_callback event_callback)
 
 /**
  * dma_async_client_unregister - unregister a client and free the &dma_client
- * @client:
+ * @client: &dma_client to free
  *
  * Force frees any allocated DMA channels, frees the &dma_client memory
  */
@@ -306,7 +306,7 @@ void dma_async_client_chan_request(struct dma_client *client,
 }
 
 /**
- * dma_async_device_register -
+ * dma_async_device_register - registers DMA devices found
  * @device: &dma_device
  */
 int dma_async_device_register(struct dma_device *device)
@@ -348,8 +348,8 @@ int dma_async_device_register(struct dma_device *device)
 }
 
 /**
- * dma_async_device_unregister -
- * @device: &dma_device
+ * dma_async_device_cleanup - function called when all references are released
+ * @kref: kernel reference object
  */
 static void dma_async_device_cleanup(struct kref *kref)
 {
@@ -359,7 +359,11 @@ static void dma_async_device_cleanup(struct kref *kref)
        complete(&device->done);
 }
 
-void dma_async_device_unregister(struct dma_device* device)
+/**
+ * dma_async_device_unregister - unregisters DMA devices
+ * @device: &dma_device
+ */
+void dma_async_device_unregister(struct dma_device *device)
 {
        struct dma_chan *chan;
        unsigned long flags;
index 2801d14a5e42e0c193cd143397124a209970d951..78bf46d917b70eec62feab544ca6b839e482f978 100644 (file)
@@ -217,7 +217,7 @@ static void ioat_dma_free_chan_resources(struct dma_chan *chan)
 
 /**
  * do_ioat_dma_memcpy - actual function that initiates a IOAT DMA transaction
- * @chan: IOAT DMA channel handle
+ * @ioat_chan: IOAT DMA channel handle
  * @dest: DMA destination address
  * @src: DMA source address
  * @len: transaction length in bytes
@@ -383,7 +383,7 @@ static dma_cookie_t ioat_dma_memcpy_buf_to_pg(struct dma_chan *chan,
  * @dest_off: offset into that page
  * @src_pg: pointer to the page to copy from
  * @src_off: offset into that page
- * @len: transaction length in bytes. This is guaranteed to not make a copy
+ * @len: transaction length in bytes. This is guaranteed not to make a copy
  *      across a page boundary.
  */
 
@@ -407,7 +407,7 @@ static dma_cookie_t ioat_dma_memcpy_pg_to_pg(struct dma_chan *chan,
 }
 
 /**
- * ioat_dma_memcpy_issue_pending - push potentially unrecognoized appended descriptors to hw
+ * ioat_dma_memcpy_issue_pending - push potentially unrecognized appended descriptors to hw
  * @chan: DMA channel handle
  */
 
@@ -510,6 +510,8 @@ static void ioat_dma_memcpy_cleanup(struct ioat_dma_chan *chan)
  * ioat_dma_is_complete - poll the status of a IOAT DMA transaction
  * @chan: IOAT DMA channel handle
  * @cookie: DMA transaction identifier
+ * @done: if not %NULL, updated with last completed transaction
+ * @used: if not %NULL, updated with last used transaction
  */
 
 static enum dma_status ioat_dma_is_complete(struct dma_chan *chan,
@@ -739,7 +741,7 @@ static int __devinit ioat_probe(struct pci_dev *pdev,
                device->msi = 0;
        }
 #endif
-       err = request_irq(pdev->irq, &ioat_do_interrupt, SA_SHIRQ, "ioat",
+       err = request_irq(pdev->irq, &ioat_do_interrupt, IRQF_SHARED, "ioat",
                device);
        if (err)
                goto err_irq;
@@ -826,7 +828,7 @@ static int __init ioat_init_module(void)
        /* if forced, worst case is that rmmod hangs */
        __unsafe(THIS_MODULE);
 
-       pci_module_init(&ioat_pci_drv);
+       return pci_module_init(&ioat_pci_drv);
 }
 
 module_init(ioat_init_module);
index 41a21ab2b000ea88c01bf0b3fb1142578dc5c28c..a30c7349075a20a4d98213fb8d34c03f21f523cd 100644 (file)
@@ -76,7 +76,7 @@
 #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 0xFFFFFFFFFFFFFFC0
+#define IOAT_CHANSTS_COMPLETED_DESCRIPTOR_ADDR 0xFFFFFFFFFFFFFFC0UL
 #define IOAT_CHANSTS_SOFT_ERR                  0x0000000000000010
 #define IOAT_CHANSTS_DMA_TRANSFER_STATUS       0x0000000000000007
 #define IOAT_CHANSTS_DMA_TRANSFER_STATUS_ACTIVE        0x0
index 5ed327e453a20a412aeb86d02dd579c72c833789..d637555a833b78870f2f19da130d54d93e0d2f96 100644 (file)
@@ -31,7 +31,7 @@
 #include <asm/io.h>
 #include <asm/uaccess.h>
 
-int num_pages_spanned(struct iovec *iov)
+static int num_pages_spanned(struct iovec *iov)
 {
        return
        ((PAGE_ALIGN((unsigned long)iov->iov_base + iov->iov_len) -
index 53423ad6d4a3a81c338e13c9360d58940267fe75..f79f6b587bfa740383bb9f7dfe0616a4b6f0b099 100644 (file)
@@ -12,7 +12,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/pci.h>
@@ -20,6 +19,9 @@
 #include <linux/slab.h>
 #include "edac_mc.h"
 
+#define AMD76X_REVISION        " Ver: 2.0.1 "  __DATE__
+#define EDAC_MOD_STR   "amd76x_edac"
+
 #define amd76x_printk(level, fmt, arg...) \
        edac_printk(level, "amd76x", fmt, ##arg)
 
@@ -102,15 +104,18 @@ static const struct amd76x_dev_info amd76x_devs[] = {
 static void amd76x_get_error_info(struct mem_ctl_info *mci,
                struct amd76x_error_info *info)
 {
-       pci_read_config_dword(mci->pdev, AMD76X_ECC_MODE_STATUS,
+       struct pci_dev *pdev;
+
+       pdev = to_pci_dev(mci->dev);
+       pci_read_config_dword(pdev, AMD76X_ECC_MODE_STATUS,
                                &info->ecc_mode_status);
 
        if (info->ecc_mode_status & BIT(8))
-               pci_write_bits32(mci->pdev, AMD76X_ECC_MODE_STATUS,
+               pci_write_bits32(pdev, AMD76X_ECC_MODE_STATUS,
                                (u32) BIT(8), (u32) BIT(8));
 
        if (info->ecc_mode_status & BIT(9))
-               pci_write_bits32(mci->pdev, AMD76X_ECC_MODE_STATUS,
+               pci_write_bits32(pdev, AMD76X_ECC_MODE_STATUS,
                                (u32) BIT(9), (u32) BIT(9));
 }
 
@@ -176,6 +181,38 @@ static void amd76x_check(struct mem_ctl_info *mci)
        amd76x_process_error_info(mci, &info, 1);
 }
 
+static void amd76x_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev,
+               enum edac_type edac_mode)
+{
+       struct csrow_info *csrow;
+       u32 mba, mba_base, mba_mask, dms;
+       int index;
+
+       for (index = 0; index < mci->nr_csrows; index++) {
+               csrow = &mci->csrows[index];
+
+               /* find the DRAM Chip Select Base address and mask */
+               pci_read_config_dword(pdev,
+                                     AMD76X_MEM_BASE_ADDR + (index * 4),
+                                     &mba);
+
+               if (!(mba & BIT(0)))
+                       continue;
+
+               mba_base = mba & 0xff800000UL;
+               mba_mask = ((mba & 0xff80) << 16) | 0x7fffffUL;
+               pci_read_config_dword(pdev, AMD76X_DRAM_MODE_STATUS, &dms);
+               csrow->first_page = mba_base >> PAGE_SHIFT;
+               csrow->nr_pages = (mba_mask + 1) >> PAGE_SHIFT;
+               csrow->last_page = csrow->first_page + csrow->nr_pages - 1;
+               csrow->page_mask = mba_mask >> PAGE_SHIFT;
+               csrow->grain = csrow->nr_pages << PAGE_SHIFT;
+               csrow->mtype = MEM_RDDR;
+               csrow->dtype = ((dms >> index) & 0x1) ? DEV_X4 : DEV_UNKNOWN;
+               csrow->edac_mode = edac_mode;
+       }
+}
+
 /**
  *     amd76x_probe1   -       Perform set up for detected device
  *     @pdev; PCI device detected
@@ -187,15 +224,13 @@ static void amd76x_check(struct mem_ctl_info *mci)
  */
 static int amd76x_probe1(struct pci_dev *pdev, int dev_idx)
 {
-       int rc = -ENODEV;
-       int index;
-       struct mem_ctl_info *mci = NULL;
-       enum edac_type ems_modes[] = {
+       static const enum edac_type ems_modes[] = {
                EDAC_NONE,
                EDAC_EC,
                EDAC_SECDED,
                EDAC_SECDED
        };
+       struct mem_ctl_info *mci = NULL;
        u32 ems;
        u32 ems_mode;
        struct amd76x_error_info discard;
@@ -206,53 +241,28 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx)
        mci = edac_mc_alloc(0, AMD76X_NR_CSROWS, AMD76X_NR_CHANS);
 
        if (mci == NULL) {
-               rc = -ENOMEM;
-               goto fail;
+               return -ENOMEM;
        }
 
        debugf0("%s(): mci = %p\n", __func__, mci);
-       mci->pdev = pdev;
+       mci->dev = &pdev->dev;
        mci->mtype_cap = MEM_FLAG_RDDR;
        mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_EC | EDAC_FLAG_SECDED;
        mci->edac_cap = ems_mode ?
                        (EDAC_FLAG_EC | EDAC_FLAG_SECDED) : EDAC_FLAG_NONE;
        mci->mod_name = EDAC_MOD_STR;
-       mci->mod_ver = "$Revision: 1.4.2.5 $";
+       mci->mod_ver = AMD76X_REVISION;
        mci->ctl_name = amd76x_devs[dev_idx].ctl_name;
        mci->edac_check = amd76x_check;
        mci->ctl_page_to_phys = NULL;
 
-       for (index = 0; index < mci->nr_csrows; index++) {
-               struct csrow_info *csrow = &mci->csrows[index];
-               u32 mba;
-               u32 mba_base;
-               u32 mba_mask;
-               u32 dms;
-
-               /* find the DRAM Chip Select Base address and mask */
-               pci_read_config_dword(mci->pdev,
-                               AMD76X_MEM_BASE_ADDR + (index * 4), &mba);
-
-               if (!(mba & BIT(0)))
-                       continue;
-
-               mba_base = mba & 0xff800000UL;
-               mba_mask = ((mba & 0xff80) << 16) | 0x7fffffUL;
-               pci_read_config_dword(mci->pdev, AMD76X_DRAM_MODE_STATUS,
-                               &dms);
-               csrow->first_page = mba_base >> PAGE_SHIFT;
-               csrow->nr_pages = (mba_mask + 1) >> PAGE_SHIFT;
-               csrow->last_page = csrow->first_page + csrow->nr_pages - 1;
-               csrow->page_mask = mba_mask >> PAGE_SHIFT;
-               csrow->grain = csrow->nr_pages << PAGE_SHIFT;
-               csrow->mtype = MEM_RDDR;
-               csrow->dtype = ((dms >> index) & 0x1) ? DEV_X4 : DEV_UNKNOWN;
-               csrow->edac_mode = ems_modes[ems_mode];
-       }
-
+       amd76x_init_csrows(mci, pdev, ems_modes[ems_mode]);
        amd76x_get_error_info(mci, &discard);  /* clear counters */
 
-       if (edac_mc_add_mc(mci)) {
+       /* Here we assume that we will never see multiple instances of this
+        * type of memory controller.  The ID is therefore hardcoded to 0.
+        */
+       if (edac_mc_add_mc(mci,0)) {
                debugf3("%s(): failed edac_mc_add_mc()\n", __func__);
                goto fail;
        }
@@ -262,9 +272,8 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx)
        return 0;
 
 fail:
-       if (mci != NULL)
-               edac_mc_free(mci);
-       return rc;
+       edac_mc_free(mci);
+       return -ENODEV;
 }
 
 /* returns count (>= 0), or negative on error */
@@ -291,7 +300,7 @@ static void __devexit amd76x_remove_one(struct pci_dev *pdev)
 
        debugf0("%s()\n", __func__);
 
-       if ((mci = edac_mc_del_mc(pdev)) == NULL)
+       if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL)
                return;
 
        edac_mc_free(mci);
index fce31936e6d718ac4a5b620ceb60babc3b1a3718..c82bc0ed7f143113fcea830717b60f388a46b3dd 100644 (file)
@@ -17,7 +17,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/pci.h>
@@ -25,6 +24,9 @@
 #include <linux/slab.h>
 #include "edac_mc.h"
 
+#define E752X_REVISION " Ver: 2.0.1 " __DATE__
+#define EDAC_MOD_STR   "e752x_edac"
+
 static int force_function_unhide;
 
 #define e752x_printk(level, fmt, arg...) \
@@ -763,22 +765,174 @@ static void e752x_check(struct mem_ctl_info *mci)
        e752x_process_error_info(mci, &info, 1);
 }
 
-static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
+/* Return 1 if dual channel mode is active.  Else return 0. */
+static inline int dual_channel_active(u16 ddrcsr)
+{
+       return (((ddrcsr >> 12) & 3) == 3);
+}
+
+static void e752x_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev,
+               u16 ddrcsr)
+{
+       struct csrow_info *csrow;
+       unsigned long last_cumul_size;
+       int index, mem_dev, drc_chan;
+       int drc_drbg;  /* DRB granularity 0=64mb, 1=128mb */
+       int drc_ddim;  /* DRAM Data Integrity Mode 0=none, 2=edac */
+       u8 value;
+       u32 dra, drc, cumul_size;
+
+       pci_read_config_dword(pdev, E752X_DRA, &dra);
+       pci_read_config_dword(pdev, E752X_DRC, &drc);
+       drc_chan = dual_channel_active(ddrcsr);
+       drc_drbg = drc_chan + 1;  /* 128 in dual mode, 64 in single */
+       drc_ddim = (drc >> 20) & 0x3;
+
+       /* The dram row boundary (DRB) reg values are boundary address for
+        * each DRAM row with a granularity of 64 or 128MB (single/dual
+        * channel operation).  DRB regs are cumulative; therefore DRB7 will
+        * contain the total memory contained in all eight rows.
+        */
+       for (last_cumul_size = index = 0; index < mci->nr_csrows; index++) {
+               /* mem_dev 0=x8, 1=x4 */
+               mem_dev = (dra >> (index * 4 + 2)) & 0x3;
+               csrow = &mci->csrows[index];
+
+               mem_dev = (mem_dev == 2);
+               pci_read_config_byte(pdev, E752X_DRB + index, &value);
+               /* convert a 128 or 64 MiB DRB to a page size. */
+               cumul_size = value << (25 + drc_drbg - PAGE_SHIFT);
+               debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index,
+                       cumul_size);
+               if (cumul_size == last_cumul_size)
+                       continue;       /* not populated */
+
+               csrow->first_page = last_cumul_size;
+               csrow->last_page = cumul_size - 1;
+               csrow->nr_pages = cumul_size - last_cumul_size;
+               last_cumul_size = cumul_size;
+               csrow->grain = 1 << 12; /* 4KiB - resolution of CELOG */
+               csrow->mtype = MEM_RDDR;        /* only one type supported */
+               csrow->dtype = mem_dev ? DEV_X4 : DEV_X8;
+
+               /*
+                * if single channel or x8 devices then SECDED
+                * if dual channel and x4 then S4ECD4ED
+                */
+               if (drc_ddim) {
+                       if (drc_chan && mem_dev) {
+                               csrow->edac_mode = EDAC_S4ECD4ED;
+                               mci->edac_cap |= EDAC_FLAG_S4ECD4ED;
+                       } else {
+                               csrow->edac_mode = EDAC_SECDED;
+                               mci->edac_cap |= EDAC_FLAG_SECDED;
+                       }
+               } else
+                       csrow->edac_mode = EDAC_NONE;
+       }
+}
+
+static void e752x_init_mem_map_table(struct pci_dev *pdev,
+               struct e752x_pvt *pvt)
 {
-       int rc = -ENODEV;
        int index;
+       u8 value, last, row, stat8;
+
+       last = 0;
+       row = 0;
+
+       for (index = 0; index < 8; index += 2) {
+               pci_read_config_byte(pdev, E752X_DRB + index, &value);
+               /* test if there is a dimm in this slot */
+               if (value == last) {
+                       /* no dimm in the slot, so flag it as empty */
+                       pvt->map[index] = 0xff;
+                       pvt->map[index + 1] = 0xff;
+               } else {        /* there is a dimm in the slot */
+                       pvt->map[index] = row;
+                       row++;
+                       last = value;
+                       /* test the next value to see if the dimm is double
+                        * sided
+                        */
+                       pci_read_config_byte(pdev, E752X_DRB + index + 1,
+                                            &value);
+                       pvt->map[index + 1] = (value == last) ?
+                           0xff :      /* the dimm is single sided,
+                                          so flag as empty */
+                           row;        /* this is a double sided dimm
+                                          to save the next row # */
+                       row++;
+                       last = value;
+               }
+       }
+
+       /* set the map type.  1 = normal, 0 = reversed */
+       pci_read_config_byte(pdev, E752X_DRM, &stat8);
+       pvt->map_type = ((stat8 & 0x0f) > ((stat8 >> 4) & 0x0f));
+}
+
+/* Return 0 on success or 1 on failure. */
+static int e752x_get_devs(struct pci_dev *pdev, int dev_idx,
+               struct e752x_pvt *pvt)
+{
+       struct pci_dev *dev;
+
+       pvt->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL,
+                                       pvt->dev_info->err_dev,
+                                       pvt->bridge_ck);
+
+       if (pvt->bridge_ck == NULL)
+               pvt->bridge_ck = pci_scan_single_device(pdev->bus,
+                                                       PCI_DEVFN(0, 1));
+
+       if (pvt->bridge_ck == NULL) {
+               e752x_printk(KERN_ERR, "error reporting device not found:"
+                      "vendor %x device 0x%x (broken BIOS?)\n",
+                      PCI_VENDOR_ID_INTEL, e752x_devs[dev_idx].err_dev);
+               return 1;
+       }
+
+       dev = pci_get_device(PCI_VENDOR_ID_INTEL, e752x_devs[dev_idx].ctl_dev,
+                            NULL);
+
+       if (dev == NULL)
+               goto fail;
+
+       pvt->dev_d0f0 = dev;
+       pvt->dev_d0f1 = pci_dev_get(pvt->bridge_ck);
+
+       return 0;
+
+fail:
+       pci_dev_put(pvt->bridge_ck);
+       return 1;
+}
+
+static void e752x_init_error_reporting_regs(struct e752x_pvt *pvt)
+{
+       struct pci_dev *dev;
+
+       dev = pvt->dev_d0f1;
+       /* Turn off error disable & SMI in case the BIOS turned it on */
+       pci_write_config_byte(dev, E752X_HI_ERRMASK, 0x00);
+       pci_write_config_byte(dev, E752X_HI_SMICMD, 0x00);
+       pci_write_config_word(dev, E752X_SYSBUS_ERRMASK, 0x00);
+       pci_write_config_word(dev, E752X_SYSBUS_SMICMD, 0x00);
+       pci_write_config_byte(dev, E752X_BUF_ERRMASK, 0x00);
+       pci_write_config_byte(dev, E752X_BUF_SMICMD, 0x00);
+       pci_write_config_byte(dev, E752X_DRAM_ERRMASK, 0x00);
+       pci_write_config_byte(dev, E752X_DRAM_SMICMD, 0x00);
+}
+
+static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
+{
        u16 pci_data;
        u8 stat8;
-       struct mem_ctl_info *mci = NULL;
-       struct e752x_pvt *pvt = NULL;
+       struct mem_ctl_info *mci;
+       struct e752x_pvt *pvt;
        u16 ddrcsr;
-       u32 drc;
        int drc_chan;   /* Number of channels 0=1chan,1=2chan */
-       int drc_drbg;   /* DRB granularity 0=64mb, 1=128mb */
-       int drc_ddim;   /* DRAM Data Integrity Mode 0=none,2=edac */
-       u32 dra;
-       unsigned long last_cumul_size;
-       struct pci_dev *dev = NULL;
        struct e752x_error_info discard;
 
        debugf0("%s(): mci\n", __func__);
@@ -792,25 +946,20 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
        if (!force_function_unhide && !(stat8 & (1 << 5))) {
                printk(KERN_INFO "Contact your BIOS vendor to see if the "
                        "E752x error registers can be safely un-hidden\n");
-               goto fail;
+               return -ENOMEM;
        }
        stat8 |= (1 << 5);
        pci_write_config_byte(pdev, E752X_DEVPRES1, stat8);
 
-       /* need to find out the number of channels */
-       pci_read_config_dword(pdev, E752X_DRC, &drc);
        pci_read_config_word(pdev, E752X_DDRCSR, &ddrcsr);
        /* FIXME: should check >>12 or 0xf, true for all? */
        /* Dual channel = 1, Single channel = 0 */
-       drc_chan = (((ddrcsr >> 12) & 3) == 3);
-       drc_drbg = drc_chan + 1;        /* 128 in dual mode, 64 in single */
-       drc_ddim = (drc >> 20) & 0x3;
+       drc_chan = dual_channel_active(ddrcsr);
 
        mci = edac_mc_alloc(sizeof(*pvt), E752X_NR_CSROWS, drc_chan + 1);
 
        if (mci == NULL) {
-               rc = -ENOMEM;
-               goto fail;
+               return -ENOMEM;
        }
 
        debugf3("%s(): init mci\n", __func__);
@@ -819,159 +968,54 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
            EDAC_FLAG_S4ECD4ED;
        /* FIXME - what if different memory types are in different csrows? */
        mci->mod_name = EDAC_MOD_STR;
-       mci->mod_ver = "$Revision: 1.5.2.11 $";
-       mci->pdev = pdev;
+       mci->mod_ver = E752X_REVISION;
+       mci->dev = &pdev->dev;
 
        debugf3("%s(): init pvt\n", __func__);
        pvt = (struct e752x_pvt *) mci->pvt_info;
        pvt->dev_info = &e752x_devs[dev_idx];
-       pvt->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL,
-                                       pvt->dev_info->err_dev,
-                                       pvt->bridge_ck);
-
-       if (pvt->bridge_ck == NULL)
-               pvt->bridge_ck = pci_scan_single_device(pdev->bus,
-                                       PCI_DEVFN(0, 1));
+       pvt->mc_symmetric = ((ddrcsr & 0x10) != 0);
 
-       if (pvt->bridge_ck == NULL) {
-               e752x_printk(KERN_ERR, "error reporting device not found:"
-                       "vendor %x device 0x%x (broken BIOS?)\n",
-                       PCI_VENDOR_ID_INTEL, e752x_devs[dev_idx].err_dev);
-               goto fail;
+       if (e752x_get_devs(pdev, dev_idx, pvt)) {
+               edac_mc_free(mci);
+               return -ENODEV;
        }
 
-       pvt->mc_symmetric = ((ddrcsr & 0x10) != 0);
        debugf3("%s(): more mci init\n", __func__);
        mci->ctl_name = pvt->dev_info->ctl_name;
        mci->edac_check = e752x_check;
        mci->ctl_page_to_phys = ctl_page_to_phys;
 
-       /* find out the device types */
-       pci_read_config_dword(pdev, E752X_DRA, &dra);
-
-       /*
-        * The dram row boundary (DRB) reg values are boundary address for
-        * each DRAM row with a granularity of 64 or 128MB (single/dual
-        * channel operation).  DRB regs are cumulative; therefore DRB7 will
-        * contain the total memory contained in all eight rows.
-        */
-       for (last_cumul_size = index = 0; index < mci->nr_csrows; index++) {
-               u8 value;
-               u32 cumul_size;
-
-               /* mem_dev 0=x8, 1=x4 */
-               int mem_dev = (dra >> (index * 4 + 2)) & 0x3;
-               struct csrow_info *csrow = &mci->csrows[index];
-
-               mem_dev = (mem_dev == 2);
-               pci_read_config_byte(mci->pdev, E752X_DRB + index, &value);
-               /* convert a 128 or 64 MiB DRB to a page size. */
-               cumul_size = value << (25 + drc_drbg - PAGE_SHIFT);
-               debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index,
-                       cumul_size);
-
-               if (cumul_size == last_cumul_size)
-                       continue; /* not populated */
-
-               csrow->first_page = last_cumul_size;
-               csrow->last_page = cumul_size - 1;
-               csrow->nr_pages = cumul_size - last_cumul_size;
-               last_cumul_size = cumul_size;
-               csrow->grain = 1 << 12;  /* 4KiB - resolution of CELOG */
-               csrow->mtype = MEM_RDDR;  /* only one type supported */
-               csrow->dtype = mem_dev ? DEV_X4 : DEV_X8;
-
-               /*
-                * if single channel or x8 devices then SECDED
-                * if dual channel and x4 then S4ECD4ED
-                */
-               if (drc_ddim) {
-                       if (drc_chan && mem_dev) {
-                               csrow->edac_mode = EDAC_S4ECD4ED;
-                               mci->edac_cap |= EDAC_FLAG_S4ECD4ED;
-                       } else {
-                               csrow->edac_mode = EDAC_SECDED;
-                               mci->edac_cap |= EDAC_FLAG_SECDED;
-                       }
-               } else
-                       csrow->edac_mode = EDAC_NONE;
-       }
-
-       /* Fill in the memory map table */
-       {
-               u8 value;
-               u8 last = 0;
-               u8 row = 0;
-
-               for (index = 0; index < 8; index += 2) {
-                       pci_read_config_byte(mci->pdev, E752X_DRB + index,
-                                       &value);
-
-                       /* test if there is a dimm in this slot */
-                       if (value == last) {
-                               /* no dimm in the slot, so flag it as empty */
-                               pvt->map[index] = 0xff;
-                               pvt->map[index + 1] = 0xff;
-                       } else { /* there is a dimm in the slot */
-                               pvt->map[index] = row;
-                               row++;
-                               last = value;
-                               /* test the next value to see if the dimm is
-                                  double sided */
-                               pci_read_config_byte(mci->pdev,
-                                               E752X_DRB + index + 1,
-                                               &value);
-                               pvt->map[index + 1] = (value == last) ?
-                                       0xff :  /* the dimm is single sided,
-                                                * so flag as empty
-                                                */
-                                       row;    /* this is a double sided dimm
-                                                * to save the next row #
-                                                */
-                               row++;
-                               last = value;
-                       }
-               }
-       }
+       e752x_init_csrows(mci, pdev, ddrcsr);
+       e752x_init_mem_map_table(pdev, pvt);
 
        /* set the map type.  1 = normal, 0 = reversed */
-       pci_read_config_byte(mci->pdev, E752X_DRM, &stat8);
+       pci_read_config_byte(pdev, E752X_DRM, &stat8);
        pvt->map_type = ((stat8 & 0x0f) > ((stat8 >> 4) & 0x0f));
 
        mci->edac_cap |= EDAC_FLAG_NONE;
        debugf3("%s(): tolm, remapbase, remaplimit\n", __func__);
 
        /* load the top of low memory, remap base, and remap limit vars */
-       pci_read_config_word(mci->pdev, E752X_TOLM, &pci_data);
+       pci_read_config_word(pdev, E752X_TOLM, &pci_data);
        pvt->tolm = ((u32) pci_data) << 4;
-       pci_read_config_word(mci->pdev, E752X_REMAPBASE, &pci_data);
+       pci_read_config_word(pdev, E752X_REMAPBASE, &pci_data);
        pvt->remapbase = ((u32) pci_data) << 14;
-       pci_read_config_word(mci->pdev, E752X_REMAPLIMIT, &pci_data);
+       pci_read_config_word(pdev, E752X_REMAPLIMIT, &pci_data);
        pvt->remaplimit = ((u32) pci_data) << 14;
        e752x_printk(KERN_INFO,
                "tolm = %x, remapbase = %x, remaplimit = %x\n", pvt->tolm,
                pvt->remapbase, pvt->remaplimit);
 
-       if (edac_mc_add_mc(mci)) {
+       /* Here we assume that we will never see multiple instances of this
+        * type of memory controller.  The ID is therefore hardcoded to 0.
+        */
+       if (edac_mc_add_mc(mci,0)) {
                debugf3("%s(): failed edac_mc_add_mc()\n", __func__);
                goto fail;
        }
 
-       dev = pci_get_device(PCI_VENDOR_ID_INTEL, e752x_devs[dev_idx].ctl_dev,
-                       NULL);
-       pvt->dev_d0f0 = dev;
-       /* find the error reporting device and clear errors */
-       dev = pvt->dev_d0f1 = pci_dev_get(pvt->bridge_ck);
-       /* Turn off error disable & SMI in case the BIOS turned it on */
-       pci_write_config_byte(dev, E752X_HI_ERRMASK, 0x00);
-       pci_write_config_byte(dev, E752X_HI_SMICMD, 0x00);
-       pci_write_config_word(dev, E752X_SYSBUS_ERRMASK, 0x00);
-       pci_write_config_word(dev, E752X_SYSBUS_SMICMD, 0x00);
-       pci_write_config_byte(dev, E752X_BUF_ERRMASK, 0x00);
-       pci_write_config_byte(dev, E752X_BUF_SMICMD, 0x00);
-       pci_write_config_byte(dev, E752X_DRAM_ERRMASK, 0x00);
-       pci_write_config_byte(dev, E752X_DRAM_SMICMD, 0x00);
-
+       e752x_init_error_reporting_regs(pvt);
        e752x_get_error_info(mci, &discard); /* clear other MCH errors */
 
        /* get this far and it's successful */
@@ -979,20 +1023,12 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
        return 0;
 
 fail:
-       if (mci) {
-               if (pvt->dev_d0f0)
-                       pci_dev_put(pvt->dev_d0f0);
-
-               if (pvt->dev_d0f1)
-                       pci_dev_put(pvt->dev_d0f1);
-
-               if (pvt->bridge_ck)
-                       pci_dev_put(pvt->bridge_ck);
-
-               edac_mc_free(mci);
-       }
+       pci_dev_put(pvt->dev_d0f0);
+       pci_dev_put(pvt->dev_d0f1);
+       pci_dev_put(pvt->bridge_ck);
+       edac_mc_free(mci);
 
-       return rc;
+       return -ENODEV;
 }
 
 /* returns count (>= 0), or negative on error */
@@ -1015,7 +1051,7 @@ static void __devexit e752x_remove_one(struct pci_dev *pdev)
 
        debugf0("%s()\n", __func__);
 
-       if ((mci = edac_mc_del_mc(pdev)) == NULL)
+       if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL)
                return;
 
        pvt = (struct e752x_pvt *) mci->pvt_info;
index a9518d3e4be4f3d46b205e4070685ad995b54002..310d91b41c96154bf0ba8154b5b017f126a441d1 100644 (file)
@@ -22,7 +22,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/pci.h>
@@ -30,6 +29,9 @@
 #include <linux/slab.h>
 #include "edac_mc.h"
 
+#define        E7XXX_REVISION " Ver: 2.0.1 " __DATE__
+#define        EDAC_MOD_STR    "e7xxx_edac"
+
 #define e7xxx_printk(level, fmt, arg...) \
        edac_printk(level, "e7xxx", fmt, ##arg)
 
@@ -333,99 +335,61 @@ static void e7xxx_check(struct mem_ctl_info *mci)
        e7xxx_process_error_info(mci, &info, 1);
 }
 
-static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
+/* Return 1 if dual channel mode is active.  Else return 0. */
+static inline int dual_channel_active(u32 drc, int dev_idx)
 {
-       int rc = -ENODEV;
-       int index;
-       u16 pci_data;
-       struct mem_ctl_info *mci = NULL;
-       struct e7xxx_pvt *pvt = NULL;
-       u32 drc;
-       int drc_chan = 1;       /* Number of channels 0=1chan,1=2chan */
-       int drc_drbg = 1;       /* DRB granularity 0=32mb,1=64mb */
-       int drc_ddim;           /* DRAM Data Integrity Mode 0=none,2=edac */
-       u32 dra;
-       unsigned long last_cumul_size;
-       struct e7xxx_error_info discard;
-
-       debugf0("%s(): mci\n", __func__);
+       return (dev_idx == E7501) ? ((drc >> 22) & 0x1) : 1;
+}
 
-       /* need to find out the number of channels */
-       pci_read_config_dword(pdev, E7XXX_DRC, &drc);
 
+/* Return DRB granularity (0=32mb, 1=64mb). */
+static inline int drb_granularity(u32 drc, int dev_idx)
+{
        /* only e7501 can be single channel */
-       if (dev_idx == E7501) {
-               drc_chan = ((drc >> 22) & 0x1);
-               drc_drbg = (drc >> 18) & 0x3;
-       }
-
-       drc_ddim = (drc >> 20) & 0x3;
-       mci = edac_mc_alloc(sizeof(*pvt), E7XXX_NR_CSROWS, drc_chan + 1);
-
-       if (mci == NULL) {
-               rc = -ENOMEM;
-               goto fail;
-       }
-
-       debugf3("%s(): init mci\n", __func__);
-       mci->mtype_cap = MEM_FLAG_RDDR;
-       mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED |
-                       EDAC_FLAG_S4ECD4ED;
-       /* FIXME - what if different memory types are in different csrows? */
-       mci->mod_name = EDAC_MOD_STR;
-       mci->mod_ver = "$Revision: 1.5.2.9 $";
-       mci->pdev = pdev;
+       return (dev_idx == E7501) ? ((drc >> 18) & 0x3) : 1;
+}
 
-       debugf3("%s(): init pvt\n", __func__);
-       pvt = (struct e7xxx_pvt *) mci->pvt_info;
-       pvt->dev_info = &e7xxx_devs[dev_idx];
-       pvt->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL,
-                                       pvt->dev_info->err_dev,
-                                       pvt->bridge_ck);
 
-       if (!pvt->bridge_ck) {
-               e7xxx_printk(KERN_ERR, "error reporting device not found:"
-                       "vendor %x device 0x%x (broken BIOS?)\n",
-                       PCI_VENDOR_ID_INTEL, e7xxx_devs[dev_idx].err_dev);
-               goto fail;
-       }
-
-       debugf3("%s(): more mci init\n", __func__);
-       mci->ctl_name = pvt->dev_info->ctl_name;
-       mci->edac_check = e7xxx_check;
-       mci->ctl_page_to_phys = ctl_page_to_phys;
+static void e7xxx_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev,
+               int dev_idx, u32 drc)
+{
+       unsigned long last_cumul_size;
+       int index;
+       u8 value;
+       u32 dra, cumul_size;
+       int drc_chan, drc_drbg, drc_ddim, mem_dev;
+       struct csrow_info *csrow;
 
-       /* find out the device types */
        pci_read_config_dword(pdev, E7XXX_DRA, &dra);
+       drc_chan = dual_channel_active(drc, dev_idx);
+       drc_drbg = drb_granularity(drc, dev_idx);
+       drc_ddim = (drc >> 20) & 0x3;
+       last_cumul_size = 0;
 
-       /*
-        * The dram row boundary (DRB) reg values are boundary address
+       /* The dram row boundary (DRB) reg values are boundary address
         * for each DRAM row with a granularity of 32 or 64MB (single/dual
         * channel operation).  DRB regs are cumulative; therefore DRB7 will
         * contain the total memory contained in all eight rows.
         */
-       for (last_cumul_size = index = 0; index < mci->nr_csrows; index++) {
-               u8 value;
-               u32 cumul_size;
+       for (index = 0; index < mci->nr_csrows; index++) {
                /* mem_dev 0=x8, 1=x4 */
-               int mem_dev = (dra >> (index * 4 + 3)) & 0x1;
-               struct csrow_info *csrow = &mci->csrows[index];
+               mem_dev = (dra >> (index * 4 + 3)) & 0x1;
+               csrow = &mci->csrows[index];
 
-               pci_read_config_byte(mci->pdev, E7XXX_DRB + index, &value);
+               pci_read_config_byte(pdev, E7XXX_DRB + index, &value);
                /* convert a 64 or 32 MiB DRB to a page size. */
                cumul_size = value << (25 + drc_drbg - PAGE_SHIFT);
                debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index,
                        cumul_size);
-
                if (cumul_size == last_cumul_size)
-                       continue;  /* not populated */
+                       continue;       /* not populated */
 
                csrow->first_page = last_cumul_size;
                csrow->last_page = cumul_size - 1;
                csrow->nr_pages = cumul_size - last_cumul_size;
                last_cumul_size = cumul_size;
-               csrow->grain = 1 << 12;  /* 4KiB - resolution of CELOG */
-               csrow->mtype = MEM_RDDR;  /* only one type supported */
+               csrow->grain = 1 << 12; /* 4KiB - resolution of CELOG */
+               csrow->mtype = MEM_RDDR;        /* only one type supported */
                csrow->dtype = mem_dev ? DEV_X4 : DEV_X8;
 
                /*
@@ -443,16 +407,61 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
                } else
                        csrow->edac_mode = EDAC_NONE;
        }
+}
 
-       mci->edac_cap |= EDAC_FLAG_NONE;
+static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
+{
+       u16 pci_data;
+       struct mem_ctl_info *mci = NULL;
+       struct e7xxx_pvt *pvt = NULL;
+       u32 drc;
+       int drc_chan;
+       struct e7xxx_error_info discard;
+
+       debugf0("%s(): mci\n", __func__);
+       pci_read_config_dword(pdev, E7XXX_DRC, &drc);
+
+       drc_chan = dual_channel_active(drc, dev_idx);
+       mci = edac_mc_alloc(sizeof(*pvt), E7XXX_NR_CSROWS, drc_chan + 1);
+
+       if (mci == NULL)
+               return -ENOMEM;
+
+       debugf3("%s(): init mci\n", __func__);
+       mci->mtype_cap = MEM_FLAG_RDDR;
+       mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED |
+                       EDAC_FLAG_S4ECD4ED;
+       /* FIXME - what if different memory types are in different csrows? */
+       mci->mod_name = EDAC_MOD_STR;
+       mci->mod_ver = E7XXX_REVISION;
+       mci->dev = &pdev->dev;
+       debugf3("%s(): init pvt\n", __func__);
+       pvt = (struct e7xxx_pvt *) mci->pvt_info;
+       pvt->dev_info = &e7xxx_devs[dev_idx];
+       pvt->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL,
+                                       pvt->dev_info->err_dev,
+                                       pvt->bridge_ck);
 
+       if (!pvt->bridge_ck) {
+               e7xxx_printk(KERN_ERR, "error reporting device not found:"
+                       "vendor %x device 0x%x (broken BIOS?)\n",
+                       PCI_VENDOR_ID_INTEL, e7xxx_devs[dev_idx].err_dev);
+               goto fail0;
+       }
+
+       debugf3("%s(): more mci init\n", __func__);
+       mci->ctl_name = pvt->dev_info->ctl_name;
+       mci->edac_check = e7xxx_check;
+       mci->ctl_page_to_phys = ctl_page_to_phys;
+       e7xxx_init_csrows(mci, pdev, dev_idx, drc);
+       mci->edac_cap |= EDAC_FLAG_NONE;
        debugf3("%s(): tolm, remapbase, remaplimit\n", __func__);
        /* load the top of low memory, remap base, and remap limit vars */
-       pci_read_config_word(mci->pdev, E7XXX_TOLM, &pci_data);
+       pci_read_config_word(pdev, E7XXX_TOLM, &pci_data);
        pvt->tolm = ((u32) pci_data) << 4;
-       pci_read_config_word(mci->pdev, E7XXX_REMAPBASE, &pci_data);
+       pci_read_config_word(pdev, E7XXX_REMAPBASE, &pci_data);
        pvt->remapbase = ((u32) pci_data) << 14;
-       pci_read_config_word(mci->pdev, E7XXX_REMAPLIMIT, &pci_data);
+       pci_read_config_word(pdev, E7XXX_REMAPLIMIT, &pci_data);
        pvt->remaplimit = ((u32) pci_data) << 14;
        e7xxx_printk(KERN_INFO,
                "tolm = %x, remapbase = %x, remaplimit = %x\n", pvt->tolm,
@@ -461,23 +470,25 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
        /* clear any pending errors, or initial state bits */
        e7xxx_get_error_info(mci, &discard);
 
-       if (edac_mc_add_mc(mci) != 0) {
+       /* Here we assume that we will never see multiple instances of this
+        * type of memory controller.  The ID is therefore hardcoded to 0.
+        */
+       if (edac_mc_add_mc(mci,0)) {
                debugf3("%s(): failed edac_mc_add_mc()\n", __func__);
-               goto fail;
+               goto fail1;
        }
 
        /* get this far and it's successful */
        debugf3("%s(): success\n", __func__);
        return 0;
 
-fail:
-       if (mci != NULL) {
-               if(pvt != NULL && pvt->bridge_ck)
-                       pci_dev_put(pvt->bridge_ck);
-               edac_mc_free(mci);
-       }
+fail1:
+       pci_dev_put(pvt->bridge_ck);
+
+fail0:
+       edac_mc_free(mci);
 
-       return rc;
+       return -ENODEV;
 }
 
 /* returns count (>= 0), or negative on error */
@@ -498,7 +509,7 @@ static void __devexit e7xxx_remove_one(struct pci_dev *pdev)
 
        debugf0("%s()\n", __func__);
 
-       if ((mci = edac_mc_del_mc(pdev)) == NULL)
+       if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL)
                return;
 
        pvt = (struct e7xxx_pvt *) mci->pvt_info;
index ea06e3a4dc358837c21ebf5081396851610a1f3b..3a7cfe88b16972f52672102cfe4a1a7609a5f66b 100644 (file)
@@ -12,7 +12,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/proc_fs.h>
 #include <linux/kernel.h>
@@ -54,16 +53,17 @@ static int log_ce = 1;
 static int panic_on_ue;
 static int poll_msec = 1000;
 
-static int check_pci_parity = 0;       /* default YES check PCI parity */
-static int panic_on_pci_parity;                /* default no panic on PCI Parity */
-static atomic_t pci_parity_count = ATOMIC_INIT(0);
-
 /* lock to memory controller's control array */
 static DECLARE_MUTEX(mem_ctls_mutex);
 static struct list_head mc_devices = LIST_HEAD_INIT(mc_devices);
 
 static struct task_struct *edac_thread;
 
+#ifdef CONFIG_PCI
+static int check_pci_parity = 0;       /* default YES check PCI parity */
+static int panic_on_pci_parity;                /* default no panic on PCI Parity */
+static atomic_t pci_parity_count = ATOMIC_INIT(0);
+
 /* Structure of the whitelist and blacklist arrays */
 struct edac_pci_device_list {
        unsigned int  vendor;           /* Vendor ID */
@@ -80,6 +80,12 @@ static int pci_blacklist_count;
 static struct edac_pci_device_list pci_whitelist[MAX_LISTED_PCI_DEVICES];
 static int pci_whitelist_count ;
 
+#ifndef DISABLE_EDAC_SYSFS
+static struct kobject edac_pci_kobj; /* /sys/devices/system/edac/pci */
+static struct completion edac_pci_kobj_complete;
+#endif /* DISABLE_EDAC_SYSFS */
+#endif /* CONFIG_PCI */
+
 /*  START sysfs data and methods */
 
 #ifndef DISABLE_EDAC_SYSFS
@@ -127,18 +133,15 @@ static struct sysdev_class edac_class = {
        set_kset_name("edac"),
 };
 
-/* sysfs objects:
+/* sysfs object:
  *     /sys/devices/system/edac/mc
- *     /sys/devices/system/edac/pci
  */
 static struct kobject edac_memctrl_kobj;
-static struct kobject edac_pci_kobj;
 
 /* We use these to wait for the reference counts on edac_memctrl_kobj and
  * edac_pci_kobj to reach 0.
  */
 static struct completion edac_memctrl_kobj_complete;
-static struct completion edac_pci_kobj_complete;
 
 /*
  * /sys/devices/system/edac/mc;
@@ -324,6 +327,8 @@ static void edac_sysfs_memctrl_teardown(void)
 #endif  /* DISABLE_EDAC_SYSFS */
 }
 
+#ifdef CONFIG_PCI
+
 #ifndef DISABLE_EDAC_SYSFS
 
 /*
@@ -624,6 +629,252 @@ static void edac_sysfs_pci_teardown(void)
 #endif
 }
 
+
+static u16 get_pci_parity_status(struct pci_dev *dev, int secondary)
+{
+       int where;
+       u16 status;
+
+       where = secondary ? PCI_SEC_STATUS : PCI_STATUS;
+       pci_read_config_word(dev, where, &status);
+
+       /* If we get back 0xFFFF then we must suspect that the card has been
+        * pulled but the Linux PCI layer has not yet finished cleaning up.
+        * We don't want to report on such devices
+        */
+
+       if (status == 0xFFFF) {
+               u32 sanity;
+
+               pci_read_config_dword(dev, 0, &sanity);
+
+               if (sanity == 0xFFFFFFFF)
+                       return 0;
+       }
+
+       status &= PCI_STATUS_DETECTED_PARITY | PCI_STATUS_SIG_SYSTEM_ERROR |
+               PCI_STATUS_PARITY;
+
+       if (status)
+               /* reset only the bits we are interested in */
+               pci_write_config_word(dev, where, status);
+
+       return status;
+}
+
+typedef void (*pci_parity_check_fn_t) (struct pci_dev *dev);
+
+/* Clear any PCI parity errors logged by this device. */
+static void edac_pci_dev_parity_clear(struct pci_dev *dev)
+{
+       u8 header_type;
+
+       get_pci_parity_status(dev, 0);
+
+       /* read the device TYPE, looking for bridges */
+       pci_read_config_byte(dev, PCI_HEADER_TYPE, &header_type);
+
+       if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE)
+               get_pci_parity_status(dev, 1);
+}
+
+/*
+ *  PCI Parity polling
+ *
+ */
+static void edac_pci_dev_parity_test(struct pci_dev *dev)
+{
+       u16 status;
+       u8  header_type;
+
+       /* read the STATUS register on this device
+        */
+       status = get_pci_parity_status(dev, 0);
+
+       debugf2("PCI STATUS= 0x%04x %s\n", status, dev->dev.bus_id );
+
+       /* check the status reg for errors */
+       if (status) {
+               if (status & (PCI_STATUS_SIG_SYSTEM_ERROR))
+                       edac_printk(KERN_CRIT, EDAC_PCI,
+                               "Signaled System Error on %s\n",
+                               pci_name(dev));
+
+               if (status & (PCI_STATUS_PARITY)) {
+                       edac_printk(KERN_CRIT, EDAC_PCI,
+                               "Master Data Parity Error on %s\n",
+                               pci_name(dev));
+
+                       atomic_inc(&pci_parity_count);
+               }
+
+               if (status & (PCI_STATUS_DETECTED_PARITY)) {
+                       edac_printk(KERN_CRIT, EDAC_PCI,
+                               "Detected Parity Error on %s\n",
+                               pci_name(dev));
+
+                       atomic_inc(&pci_parity_count);
+               }
+       }
+
+       /* read the device TYPE, looking for bridges */
+       pci_read_config_byte(dev, PCI_HEADER_TYPE, &header_type);
+
+       debugf2("PCI HEADER TYPE= 0x%02x %s\n", header_type, dev->dev.bus_id );
+
+       if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) {
+               /* On bridges, need to examine secondary status register  */
+               status = get_pci_parity_status(dev, 1);
+
+               debugf2("PCI SEC_STATUS= 0x%04x %s\n",
+                               status, dev->dev.bus_id );
+
+               /* check the secondary status reg for errors */
+               if (status) {
+                       if (status & (PCI_STATUS_SIG_SYSTEM_ERROR))
+                               edac_printk(KERN_CRIT, EDAC_PCI, "Bridge "
+                                       "Signaled System Error on %s\n",
+                                       pci_name(dev));
+
+                       if (status & (PCI_STATUS_PARITY)) {
+                               edac_printk(KERN_CRIT, EDAC_PCI, "Bridge "
+                                       "Master Data Parity Error on "
+                                       "%s\n", pci_name(dev));
+
+                               atomic_inc(&pci_parity_count);
+                       }
+
+                       if (status & (PCI_STATUS_DETECTED_PARITY)) {
+                               edac_printk(KERN_CRIT, EDAC_PCI, "Bridge "
+                                       "Detected Parity Error on %s\n",
+                                       pci_name(dev));
+
+                               atomic_inc(&pci_parity_count);
+                       }
+               }
+       }
+}
+
+/*
+ * check_dev_on_list: Scan for a PCI device on a white/black list
+ * @list:      an EDAC  &edac_pci_device_list  white/black list pointer
+ * @free_index:        index of next free entry on the list
+ * @pci_dev:   PCI Device pointer
+ *
+ * see if list contains the device.
+ *
+ * Returns:    0 not found
+ *             1 found on list
+ */
+static int check_dev_on_list(struct edac_pci_device_list *list,
+               int free_index, struct pci_dev *dev)
+{
+       int i;
+       int rc = 0;     /* Assume not found */
+       unsigned short vendor=dev->vendor;
+       unsigned short device=dev->device;
+
+       /* Scan the list, looking for a vendor/device match */
+       for (i = 0; i < free_index; i++, list++ ) {
+               if ((list->vendor == vendor ) && (list->device == device )) {
+                       rc = 1;
+                       break;
+               }
+       }
+
+       return rc;
+}
+
+/*
+ * pci_dev parity list iterator
+ *     Scan the PCI device list for one iteration, looking for SERRORs
+ *     Master Parity ERRORS or Parity ERRORs on primary or secondary devices
+ */
+static inline void edac_pci_dev_parity_iterator(pci_parity_check_fn_t fn)
+{
+       struct pci_dev *dev = NULL;
+
+       /* request for kernel access to the next PCI device, if any,
+        * and while we are looking at it have its reference count
+        * bumped until we are done with it
+        */
+       while((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
+               /* if whitelist exists then it has priority, so only scan
+                * those devices on the whitelist
+                */
+               if (pci_whitelist_count > 0 ) {
+                       if (check_dev_on_list(pci_whitelist,
+                                       pci_whitelist_count, dev))
+                               fn(dev);
+               } else {
+                       /*
+                        * if no whitelist, then check if this devices is
+                        * blacklisted
+                        */
+                       if (!check_dev_on_list(pci_blacklist,
+                                       pci_blacklist_count, dev))
+                               fn(dev);
+               }
+       }
+}
+
+static void do_pci_parity_check(void)
+{
+       unsigned long flags;
+       int before_count;
+
+       debugf3("%s()\n", __func__);
+
+       if (!check_pci_parity)
+               return;
+
+       before_count = atomic_read(&pci_parity_count);
+
+       /* scan all PCI devices looking for a Parity Error on devices and
+        * bridges
+        */
+       local_irq_save(flags);
+       edac_pci_dev_parity_iterator(edac_pci_dev_parity_test);
+       local_irq_restore(flags);
+
+       /* Only if operator has selected panic on PCI Error */
+       if (panic_on_pci_parity) {
+               /* If the count is different 'after' from 'before' */
+               if (before_count != atomic_read(&pci_parity_count))
+                       panic("EDAC: PCI Parity Error");
+       }
+}
+
+static inline void clear_pci_parity_errors(void)
+{
+       /* Clear any PCI bus parity errors that devices initially have logged
+        * in their registers.
+        */
+       edac_pci_dev_parity_iterator(edac_pci_dev_parity_clear);
+}
+
+#else  /* CONFIG_PCI */
+
+static inline void do_pci_parity_check(void)
+{
+       /* no-op */
+}
+
+static inline void clear_pci_parity_errors(void)
+{
+       /* no-op */
+}
+
+static void edac_sysfs_pci_teardown(void)
+{
+}
+
+static int edac_sysfs_pci_setup(void)
+{
+       return 0;
+}
+#endif /* CONFIG_PCI */
+
 #ifndef DISABLE_EDAC_SYSFS
 
 /* EDAC sysfs CSROW data structures and methods */
@@ -1132,7 +1383,7 @@ static int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
                return err;
 
        /* create a symlink for the device */
-       err = sysfs_create_link(edac_mci_kobj, &mci->pdev->dev.kobj,
+       err = sysfs_create_link(edac_mci_kobj, &mci->dev->kobj,
                                EDAC_DEVICE_SYMLINK);
 
        if (err)
@@ -1238,7 +1489,7 @@ void edac_mc_dump_mci(struct mem_ctl_info *mci)
        debugf4("\tmci->edac_check = %p\n", mci->edac_check);
        debugf3("\tmci->nr_csrows = %d, csrows = %p\n",
                mci->nr_csrows, mci->csrows);
-       debugf3("\tpdev = %p\n", mci->pdev);
+       debugf3("\tdev = %p\n", mci->dev);
        debugf3("\tmod_name:ctl_name = %s:%s\n",
                mci->mod_name, mci->ctl_name);
        debugf3("\tpvt_info = %p\n\n", mci->pvt_info);
@@ -1363,7 +1614,7 @@ void edac_mc_free(struct mem_ctl_info *mci)
 }
 EXPORT_SYMBOL_GPL(edac_mc_free);
 
-static struct mem_ctl_info *find_mci_by_pdev(struct pci_dev *pdev)
+static struct mem_ctl_info *find_mci_by_dev(struct device *dev)
 {
        struct mem_ctl_info *mci;
        struct list_head *item;
@@ -1373,54 +1624,53 @@ static struct mem_ctl_info *find_mci_by_pdev(struct pci_dev *pdev)
        list_for_each(item, &mc_devices) {
                mci = list_entry(item, struct mem_ctl_info, link);
 
-               if (mci->pdev == pdev)
+               if (mci->dev == dev)
                        return mci;
        }
 
        return NULL;
 }
 
-static int add_mc_to_global_list(struct mem_ctl_info *mci)
+/* Return 0 on success, 1 on failure.
+ * Before calling this function, caller must
+ * assign a unique value to mci->mc_idx.
+ */
+static int add_mc_to_global_list (struct mem_ctl_info *mci)
 {
        struct list_head *item, *insert_before;
        struct mem_ctl_info *p;
-       int i;
 
-       if (list_empty(&mc_devices)) {
-               mci->mc_idx = 0;
-               insert_before = &mc_devices;
-       } else {
-               if (find_mci_by_pdev(mci->pdev)) {
-                       edac_printk(KERN_WARNING, EDAC_MC,
-                               "%s (%s) %s %s already assigned %d\n",
-                               mci->pdev->dev.bus_id,
-                               pci_name(mci->pdev), mci->mod_name,
-                               mci->ctl_name, mci->mc_idx);
-                       return 1;
-               }
+       insert_before = &mc_devices;
 
-               insert_before = NULL;
-               i = 0;
+       if (unlikely((p = find_mci_by_dev(mci->dev)) != NULL))
+               goto fail0;
 
-               list_for_each(item, &mc_devices) {
-                       p = list_entry(item, struct mem_ctl_info, link);
+       list_for_each(item, &mc_devices) {
+               p = list_entry(item, struct mem_ctl_info, link);
 
-                       if (p->mc_idx != i) {
-                               insert_before = item;
-                               break;
-                       }
+               if (p->mc_idx >= mci->mc_idx) {
+                       if (unlikely(p->mc_idx == mci->mc_idx))
+                               goto fail1;
 
-                       i++;
+                       insert_before = item;
+                       break;
                }
-
-               mci->mc_idx = i;
-
-               if (insert_before == NULL)
-                       insert_before = &mc_devices;
        }
 
        list_add_tail_rcu(&mci->link, insert_before);
        return 0;
+
+fail0:
+       edac_printk(KERN_WARNING, EDAC_MC,
+                   "%s (%s) %s %s already assigned %d\n", p->dev->bus_id,
+                   dev_name(p->dev), p->mod_name, p->ctl_name, p->mc_idx);
+       return 1;
+
+fail1:
+       edac_printk(KERN_WARNING, EDAC_MC,
+                   "bug in low-level driver: attempt to assign\n"
+                   "    duplicate mc_idx %d in %s()\n", p->mc_idx, __func__);
+       return 1;
 }
 
 static void complete_mc_list_del(struct rcu_head *head)
@@ -1444,6 +1694,7 @@ static void del_mc_from_global_list(struct mem_ctl_info *mci)
  * edac_mc_add_mc: Insert the 'mci' structure into the mci global list and
  *                 create sysfs entries associated with mci structure
  * @mci: pointer to the mci structure to be added to the list
+ * @mc_idx: A unique numeric identifier to be assigned to the 'mci' structure.
  *
  * Return:
  *     0       Success
@@ -1451,9 +1702,10 @@ static void del_mc_from_global_list(struct mem_ctl_info *mci)
  */
 
 /* FIXME - should a warning be printed if no error detection? correction? */
-int edac_mc_add_mc(struct mem_ctl_info *mci)
+int edac_mc_add_mc(struct mem_ctl_info *mci, int mc_idx)
 {
        debugf0("%s()\n", __func__);
+       mci->mc_idx = mc_idx;
 #ifdef CONFIG_EDAC_DEBUG
        if (edac_debug_level >= 3)
                edac_mc_dump_mci(mci);
@@ -1486,8 +1738,8 @@ int edac_mc_add_mc(struct mem_ctl_info *mci)
         }
 
        /* Report action taken */
-       edac_mc_printk(mci, KERN_INFO, "Giving out device to %s %s: PCI %s\n",
-               mci->mod_name, mci->ctl_name, pci_name(mci->pdev));
+       edac_mc_printk(mci, KERN_INFO, "Giving out device to %s %s: DEV %s\n",
+               mci->mod_name, mci->ctl_name, dev_name(mci->dev));
 
        up(&mem_ctls_mutex);
        return 0;
@@ -1504,18 +1756,18 @@ EXPORT_SYMBOL_GPL(edac_mc_add_mc);
 /**
  * edac_mc_del_mc: Remove sysfs entries for specified mci structure and
  *                 remove mci structure from global list
- * @pdev: Pointer to 'struct pci_dev' representing mci structure to remove.
+ * @pdev: Pointer to 'struct device' representing mci structure to remove.
  *
  * Return pointer to removed mci structure, or NULL if device not found.
  */
-struct mem_ctl_info * edac_mc_del_mc(struct pci_dev *pdev)
+struct mem_ctl_info * edac_mc_del_mc(struct device *dev)
 {
        struct mem_ctl_info *mci;
 
        debugf0("MC: %s()\n", __func__);
        down(&mem_ctls_mutex);
 
-       if ((mci = find_mci_by_pdev(pdev)) == NULL) {
+       if ((mci = find_mci_by_dev(dev)) == NULL) {
                up(&mem_ctls_mutex);
                return NULL;
        }
@@ -1524,8 +1776,8 @@ struct mem_ctl_info * edac_mc_del_mc(struct pci_dev *pdev)
        del_mc_from_global_list(mci);
        up(&mem_ctls_mutex);
        edac_printk(KERN_INFO, EDAC_MC,
-               "Removed device %d for %s %s: PCI %s\n", mci->mc_idx,
-               mci->mod_name, mci->ctl_name, pci_name(mci->pdev));
+               "Removed device %d for %s %s: DEV %s\n", mci->mc_idx,
+               mci->mod_name, mci->ctl_name, dev_name(mci->dev));
        return mci;
 }
 EXPORT_SYMBOL_GPL(edac_mc_del_mc);
@@ -1739,244 +1991,6 @@ void edac_mc_handle_ue_no_info(struct mem_ctl_info *mci, const char *msg)
 }
 EXPORT_SYMBOL_GPL(edac_mc_handle_ue_no_info);
 
-#ifdef CONFIG_PCI
-
-static u16 get_pci_parity_status(struct pci_dev *dev, int secondary)
-{
-       int where;
-       u16 status;
-
-       where = secondary ? PCI_SEC_STATUS : PCI_STATUS;
-       pci_read_config_word(dev, where, &status);
-
-       /* If we get back 0xFFFF then we must suspect that the card has been
-        * pulled but the Linux PCI layer has not yet finished cleaning up.
-        * We don't want to report on such devices
-        */
-
-       if (status == 0xFFFF) {
-               u32 sanity;
-
-               pci_read_config_dword(dev, 0, &sanity);
-
-               if (sanity == 0xFFFFFFFF)
-                       return 0;
-       }
-
-       status &= PCI_STATUS_DETECTED_PARITY | PCI_STATUS_SIG_SYSTEM_ERROR |
-               PCI_STATUS_PARITY;
-
-       if (status)
-               /* reset only the bits we are interested in */
-               pci_write_config_word(dev, where, status);
-
-       return status;
-}
-
-typedef void (*pci_parity_check_fn_t) (struct pci_dev *dev);
-
-/* Clear any PCI parity errors logged by this device. */
-static void edac_pci_dev_parity_clear(struct pci_dev *dev)
-{
-       u8 header_type;
-
-       get_pci_parity_status(dev, 0);
-
-       /* read the device TYPE, looking for bridges */
-       pci_read_config_byte(dev, PCI_HEADER_TYPE, &header_type);
-
-       if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE)
-               get_pci_parity_status(dev, 1);
-}
-
-/*
- *  PCI Parity polling
- *
- */
-static void edac_pci_dev_parity_test(struct pci_dev *dev)
-{
-       u16 status;
-       u8  header_type;
-
-       /* read the STATUS register on this device
-        */
-       status = get_pci_parity_status(dev, 0);
-
-       debugf2("PCI STATUS= 0x%04x %s\n", status, dev->dev.bus_id );
-
-       /* check the status reg for errors */
-       if (status) {
-               if (status & (PCI_STATUS_SIG_SYSTEM_ERROR))
-                       edac_printk(KERN_CRIT, EDAC_PCI,
-                               "Signaled System Error on %s\n",
-                               pci_name(dev));
-
-               if (status & (PCI_STATUS_PARITY)) {
-                       edac_printk(KERN_CRIT, EDAC_PCI,
-                               "Master Data Parity Error on %s\n",
-                               pci_name(dev));
-
-                       atomic_inc(&pci_parity_count);
-               }
-
-               if (status & (PCI_STATUS_DETECTED_PARITY)) {
-                       edac_printk(KERN_CRIT, EDAC_PCI,
-                               "Detected Parity Error on %s\n",
-                               pci_name(dev));
-
-                       atomic_inc(&pci_parity_count);
-               }
-       }
-
-       /* read the device TYPE, looking for bridges */
-       pci_read_config_byte(dev, PCI_HEADER_TYPE, &header_type);
-
-       debugf2("PCI HEADER TYPE= 0x%02x %s\n", header_type, dev->dev.bus_id );
-
-       if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) {
-               /* On bridges, need to examine secondary status register  */
-               status = get_pci_parity_status(dev, 1);
-
-               debugf2("PCI SEC_STATUS= 0x%04x %s\n",
-                               status, dev->dev.bus_id );
-
-               /* check the secondary status reg for errors */
-               if (status) {
-                       if (status & (PCI_STATUS_SIG_SYSTEM_ERROR))
-                               edac_printk(KERN_CRIT, EDAC_PCI, "Bridge "
-                                       "Signaled System Error on %s\n",
-                                       pci_name(dev));
-
-                       if (status & (PCI_STATUS_PARITY)) {
-                               edac_printk(KERN_CRIT, EDAC_PCI, "Bridge "
-                                       "Master Data Parity Error on "
-                                       "%s\n", pci_name(dev));
-
-                               atomic_inc(&pci_parity_count);
-                       }
-
-                       if (status & (PCI_STATUS_DETECTED_PARITY)) {
-                               edac_printk(KERN_CRIT, EDAC_PCI, "Bridge "
-                                       "Detected Parity Error on %s\n",
-                                       pci_name(dev));
-
-                               atomic_inc(&pci_parity_count);
-                       }
-               }
-       }
-}
-
-/*
- * check_dev_on_list: Scan for a PCI device on a white/black list
- * @list:      an EDAC  &edac_pci_device_list  white/black list pointer
- * @free_index:        index of next free entry on the list
- * @pci_dev:   PCI Device pointer
- *
- * see if list contains the device.
- *
- * Returns:    0 not found
- *             1 found on list
- */
-static int check_dev_on_list(struct edac_pci_device_list *list,
-               int free_index, struct pci_dev *dev)
-{
-       int i;
-       int rc = 0;     /* Assume not found */
-       unsigned short vendor=dev->vendor;
-       unsigned short device=dev->device;
-
-       /* Scan the list, looking for a vendor/device match */
-       for (i = 0; i < free_index; i++, list++ ) {
-               if ((list->vendor == vendor ) && (list->device == device )) {
-                       rc = 1;
-                       break;
-               }
-       }
-
-       return rc;
-}
-
-/*
- * pci_dev parity list iterator
- *     Scan the PCI device list for one iteration, looking for SERRORs
- *     Master Parity ERRORS or Parity ERRORs on primary or secondary devices
- */
-static inline void edac_pci_dev_parity_iterator(pci_parity_check_fn_t fn)
-{
-       struct pci_dev *dev = NULL;
-
-       /* request for kernel access to the next PCI device, if any,
-        * and while we are looking at it have its reference count
-        * bumped until we are done with it
-        */
-       while((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
-               /* if whitelist exists then it has priority, so only scan
-                * those devices on the whitelist
-                */
-               if (pci_whitelist_count > 0 ) {
-                       if (check_dev_on_list(pci_whitelist,
-                                       pci_whitelist_count, dev))
-                               fn(dev);
-               } else {
-                       /*
-                        * if no whitelist, then check if this devices is
-                        * blacklisted
-                        */
-                       if (!check_dev_on_list(pci_blacklist,
-                                       pci_blacklist_count, dev))
-                               fn(dev);
-               }
-       }
-}
-
-static void do_pci_parity_check(void)
-{
-       unsigned long flags;
-       int before_count;
-
-       debugf3("%s()\n", __func__);
-
-       if (!check_pci_parity)
-               return;
-
-       before_count = atomic_read(&pci_parity_count);
-
-       /* scan all PCI devices looking for a Parity Error on devices and
-        * bridges
-        */
-       local_irq_save(flags);
-       edac_pci_dev_parity_iterator(edac_pci_dev_parity_test);
-       local_irq_restore(flags);
-
-       /* Only if operator has selected panic on PCI Error */
-       if (panic_on_pci_parity) {
-               /* If the count is different 'after' from 'before' */
-               if (before_count != atomic_read(&pci_parity_count))
-                       panic("EDAC: PCI Parity Error");
-       }
-}
-
-static inline void clear_pci_parity_errors(void)
-{
-       /* Clear any PCI bus parity errors that devices initially have logged
-        * in their registers.
-        */
-       edac_pci_dev_parity_iterator(edac_pci_dev_parity_clear);
-}
-
-#else  /* CONFIG_PCI */
-
-static inline void do_pci_parity_check(void)
-{
-       /* no-op */
-}
-
-static inline void clear_pci_parity_errors(void)
-{
-       /* no-op */
-}
-
-#endif  /* CONFIG_PCI */
 
 /*
  * Iterate over all MC instances and check for ECC, et al, errors
@@ -2096,10 +2110,12 @@ MODULE_DESCRIPTION("Core library routines for MC reporting");
 
 module_param(panic_on_ue, int, 0644);
 MODULE_PARM_DESC(panic_on_ue, "Panic on uncorrected error: 0=off 1=on");
+#ifdef CONFIG_PCI
 module_param(check_pci_parity, int, 0644);
 MODULE_PARM_DESC(check_pci_parity, "Check for PCI bus parity errors: 0=off 1=on");
 module_param(panic_on_pci_parity, int, 0644);
 MODULE_PARM_DESC(panic_on_pci_parity, "Panic on PCI Bus Parity error: 0=off 1=on");
+#endif
 module_param(log_ue, int, 0644);
 MODULE_PARM_DESC(log_ue, "Log uncorrectable error to console: 0=off 1=on");
 module_param(log_ce, int, 0644);
index 8d9e83909b9c3a864200734c6d68990ce85ddbd8..bf6ab8a8d5ed8700dce391de101a03b60ee72987 100644 (file)
@@ -18,7 +18,6 @@
 #ifndef _EDAC_MC_H_
 #define _EDAC_MC_H_
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/module.h>
@@ -79,15 +78,17 @@ extern int edac_debug_level;
 
 #endif  /* !CONFIG_EDAC_DEBUG */
 
-#define edac_xstr(s) edac_str(s)
-#define edac_str(s) #s
-#define EDAC_MOD_STR edac_xstr(KBUILD_BASENAME)
-
 #define BIT(x) (1 << (x))
 
 #define PCI_VEND_DEV(vend, dev) PCI_VENDOR_ID_ ## vend, \
        PCI_DEVICE_ID_ ## vend ## _ ## dev
 
+#if defined(CONFIG_X86) && defined(CONFIG_PCI)
+#define dev_name(dev) pci_name(to_pci_dev(dev))
+#else
+#define dev_name(dev) to_platform_device(dev)->name
+#endif
+
 /* memory devices */
 enum dev_type {
        DEV_UNKNOWN = 0,
@@ -327,10 +328,10 @@ struct mem_ctl_info {
        struct csrow_info *csrows;
        /*
         * FIXME - what about controllers on other busses? - IDs must be
-        * unique.  pdev pointer should be sufficiently unique, but
+        * unique.  dev pointer should be sufficiently unique, but
         * BUS:SLOT.FUNC numbers may not be unique.
         */
-       struct pci_dev *pdev;
+       struct device *dev;
        const char *mod_name;
        const char *mod_ver;
        const char *ctl_name;
@@ -353,6 +354,8 @@ struct mem_ctl_info {
        struct completion kobj_complete;
 };
 
+#ifdef CONFIG_PCI
+
 /* write all or some bits in a byte-register*/
 static inline void pci_write_bits8(struct pci_dev *pdev, int offset, u8 value,
                u8 mask)
@@ -401,14 +404,16 @@ static inline void pci_write_bits32(struct pci_dev *pdev, int offset,
        pci_write_config_dword(pdev, offset, value);
 }
 
+#endif /* CONFIG_PCI */
+
 #ifdef CONFIG_EDAC_DEBUG
 void edac_mc_dump_channel(struct channel_info *chan);
 void edac_mc_dump_mci(struct mem_ctl_info *mci);
 void edac_mc_dump_csrow(struct csrow_info *csrow);
 #endif  /* CONFIG_EDAC_DEBUG */
 
-extern int edac_mc_add_mc(struct mem_ctl_info *mci);
-extern struct mem_ctl_info * edac_mc_del_mc(struct pci_dev *pdev);
+extern int edac_mc_add_mc(struct mem_ctl_info *mci,int mc_idx);
+extern struct mem_ctl_info * edac_mc_del_mc(struct device *dev);
 extern int edac_mc_find_csrow_by_page(struct mem_ctl_info *mci,
                                        unsigned long page);
 extern void edac_mc_scrub_block(unsigned long page, unsigned long offset,
index fd342163cf97fa827099bbdd5a694f20134bad6f..e4bb298e613f4aea9a84d3320bfaa2fb21122d73 100644 (file)
@@ -9,7 +9,6 @@
  * by Thayne Harbaugh of Linux Networx. (http://lnxi.com)
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/pci.h>
@@ -17,6 +16,9 @@
 #include <linux/slab.h>
 #include "edac_mc.h"
 
+#define  I82860_REVISION " Ver: 2.0.1 " __DATE__
+#define EDAC_MOD_STR   "i82860_edac"
+
 #define i82860_printk(level, fmt, arg...) \
        edac_printk(level, "i82860", fmt, ##arg)
 
@@ -63,17 +65,21 @@ static struct pci_dev *mci_pdev = NULL;     /* init dev: in case that AGP code
 static void i82860_get_error_info(struct mem_ctl_info *mci,
                struct i82860_error_info *info)
 {
+       struct pci_dev *pdev;
+
+       pdev = to_pci_dev(mci->dev);
+
        /*
         * This is a mess because there is no atomic way to read all the
         * registers at once and the registers can transition from CE being
         * overwritten by UE.
         */
-       pci_read_config_word(mci->pdev, I82860_ERRSTS, &info->errsts);
-       pci_read_config_dword(mci->pdev, I82860_EAP, &info->eap);
-       pci_read_config_word(mci->pdev, I82860_DERRCTL_STS, &info->derrsyn);
-       pci_read_config_word(mci->pdev, I82860_ERRSTS, &info->errsts2);
+       pci_read_config_word(pdev, I82860_ERRSTS, &info->errsts);
+       pci_read_config_dword(pdev, I82860_EAP, &info->eap);
+       pci_read_config_word(pdev, I82860_DERRCTL_STS, &info->derrsyn);
+       pci_read_config_word(pdev, I82860_ERRSTS, &info->errsts2);
 
-       pci_write_bits16(mci->pdev, I82860_ERRSTS, 0x0003, 0x0003);
+       pci_write_bits16(pdev, I82860_ERRSTS, 0x0003, 0x0003);
 
        /*
         * If the error is the same for both reads then the first set of reads
@@ -84,8 +90,8 @@ static void i82860_get_error_info(struct mem_ctl_info *mci,
                return;
 
        if ((info->errsts ^ info->errsts2) & 0x0003) {
-               pci_read_config_dword(mci->pdev, I82860_EAP, &info->eap);
-               pci_read_config_word(mci->pdev, I82860_DERRCTL_STS,
+               pci_read_config_dword(pdev, I82860_EAP, &info->eap);
+               pci_read_config_word(pdev, I82860_DERRCTL_STS,
                                &info->derrsyn);
        }
 }
@@ -127,15 +133,50 @@ static void i82860_check(struct mem_ctl_info *mci)
        i82860_process_error_info(mci, &info, 1);
 }
 
-static int i82860_probe1(struct pci_dev *pdev, int dev_idx)
+static void i82860_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev)
 {
-       int rc = -ENODEV;
-       int index;
-       struct mem_ctl_info *mci = NULL;
        unsigned long last_cumul_size;
-       struct i82860_error_info discard;
+       u16 mchcfg_ddim;  /* DRAM Data Integrity Mode 0=none, 2=edac */
+       u16 value;
+       u32 cumul_size;
+       struct csrow_info *csrow;
+       int index;
+
+       pci_read_config_word(pdev, I82860_MCHCFG, &mchcfg_ddim);
+       mchcfg_ddim = mchcfg_ddim & 0x180;
+       last_cumul_size = 0;
+
+       /* The group row boundary (GRA) reg values are boundary address
+        * for each DRAM row with a granularity of 16MB.  GRA regs are
+        * cumulative; therefore GRA15 will contain the total memory contained
+        * in all eight rows.
+        */
+       for (index = 0; index < mci->nr_csrows; index++) {
+               csrow = &mci->csrows[index];
+               pci_read_config_word(pdev, I82860_GBA + index * 2, &value);
+               cumul_size = (value & I82860_GBA_MASK) <<
+                   (I82860_GBA_SHIFT - PAGE_SHIFT);
+               debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index,
+                       cumul_size);
 
-       u16 mchcfg_ddim;        /* DRAM Data Integrity Mode 0=none,2=edac */
+               if (cumul_size == last_cumul_size)
+                       continue;       /* not populated */
+
+               csrow->first_page = last_cumul_size;
+               csrow->last_page = cumul_size - 1;
+               csrow->nr_pages = cumul_size - last_cumul_size;
+               last_cumul_size = cumul_size;
+               csrow->grain = 1 << 12; /* I82860_EAP has 4KiB reolution */
+               csrow->mtype = MEM_RMBS;
+               csrow->dtype = DEV_UNKNOWN;
+               csrow->edac_mode = mchcfg_ddim ? EDAC_SECDED : EDAC_NONE;
+       }
+}
+
+static int i82860_probe1(struct pci_dev *pdev, int dev_idx)
+{
+       struct mem_ctl_info *mci;
+       struct i82860_error_info discard;
 
        /* RDRAM has channels but these don't map onto the abstractions that
           edac uses.
@@ -151,67 +192,35 @@ static int i82860_probe1(struct pci_dev *pdev, int dev_idx)
                return -ENOMEM;
 
        debugf3("%s(): init mci\n", __func__);
-       mci->pdev = pdev;
+       mci->dev = &pdev->dev;
        mci->mtype_cap = MEM_FLAG_DDR;
-
        mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED;
        /* I"m not sure about this but I think that all RDRAM is SECDED */
        mci->edac_cap = EDAC_FLAG_SECDED;
-       /* adjust FLAGS */
-
        mci->mod_name = EDAC_MOD_STR;
-       mci->mod_ver = "$Revision: 1.1.2.6 $";
+       mci->mod_ver = I82860_REVISION;
        mci->ctl_name = i82860_devs[dev_idx].ctl_name;
        mci->edac_check = i82860_check;
        mci->ctl_page_to_phys = NULL;
+       i82860_init_csrows(mci, pdev);
+       i82860_get_error_info(mci, &discard);  /* clear counters */
 
-       pci_read_config_word(mci->pdev, I82860_MCHCFG, &mchcfg_ddim);
-       mchcfg_ddim = mchcfg_ddim & 0x180;
-
-       /*
-        * The group row boundary (GRA) reg values are boundary address
-        * for each DRAM row with a granularity of 16MB.  GRA regs are
-        * cumulative; therefore GRA15 will contain the total memory contained
-        * in all eight rows.
+       /* Here we assume that we will never see multiple instances of this
+        * type of memory controller.  The ID is therefore hardcoded to 0.
         */
-       for (last_cumul_size = index = 0; index < mci->nr_csrows; index++) {
-               u16 value;
-               u32 cumul_size;
-               struct csrow_info *csrow = &mci->csrows[index];
-
-               pci_read_config_word(mci->pdev, I82860_GBA + index * 2,
-                               &value);
-
-               cumul_size = (value & I82860_GBA_MASK) <<
-                   (I82860_GBA_SHIFT - PAGE_SHIFT);
-               debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index,
-                       cumul_size);
-
-               if (cumul_size == last_cumul_size)
-                       continue;       /* not populated */
-
-               csrow->first_page = last_cumul_size;
-               csrow->last_page = cumul_size - 1;
-               csrow->nr_pages = cumul_size - last_cumul_size;
-               last_cumul_size = cumul_size;
-               csrow->grain = 1 << 12;  /* I82860_EAP has 4KiB reolution */
-               csrow->mtype = MEM_RMBS;
-               csrow->dtype = DEV_UNKNOWN;
-               csrow->edac_mode = mchcfg_ddim ? EDAC_SECDED : EDAC_NONE;
+       if (edac_mc_add_mc(mci,0)) {
+               debugf3("%s(): failed edac_mc_add_mc()\n", __func__);
+               goto fail;
        }
 
-       i82860_get_error_info(mci, &discard);  /* clear counters */
+       /* get this far and it's successful */
+       debugf3("%s(): success\n", __func__);
 
-       if (edac_mc_add_mc(mci)) {
-               debugf3("%s(): failed edac_mc_add_mc()\n", __func__);
-               edac_mc_free(mci);
-       } else {
-               /* get this far and it's successful */
-               debugf3("%s(): success\n", __func__);
-               rc = 0;
-       }
+       return 0;
 
-       return rc;
+fail:
+       edac_mc_free(mci);
+       return -ENODEV;
 }
 
 /* returns count (>= 0), or negative on error */
@@ -240,7 +249,7 @@ static void __devexit i82860_remove_one(struct pci_dev *pdev)
 
        debugf0("%s()\n", __func__);
 
-       if ((mci = edac_mc_del_mc(pdev)) == NULL)
+       if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL)
                return;
 
        edac_mc_free(mci);
index 0aec92698f17afc741a9307e265a49d1ad9aa0ba..161fe09a6d3871200dd353b272b6b70f3413c9c9 100644 (file)
@@ -13,7 +13,6 @@
  * Note: E7210 appears same as D82875P - zhenyu.z.wang at intel.com
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/pci.h>
@@ -21,6 +20,9 @@
 #include <linux/slab.h>
 #include "edac_mc.h"
 
+#define I82875P_REVISION       " Ver: 2.0.1 " __DATE__
+#define EDAC_MOD_STR           "i82875p_edac"
+
 #define i82875p_printk(level, fmt, arg...) \
        edac_printk(level, "i82875p", fmt, ##arg)
 
@@ -185,18 +187,22 @@ static int i82875p_registered = 1;
 static void i82875p_get_error_info(struct mem_ctl_info *mci,
                struct i82875p_error_info *info)
 {
+       struct pci_dev *pdev;
+
+       pdev = to_pci_dev(mci->dev);
+
        /*
         * This is a mess because there is no atomic way to read all the
         * registers at once and the registers can transition from CE being
         * overwritten by UE.
         */
-       pci_read_config_word(mci->pdev, I82875P_ERRSTS, &info->errsts);
-       pci_read_config_dword(mci->pdev, I82875P_EAP, &info->eap);
-       pci_read_config_byte(mci->pdev, I82875P_DES, &info->des);
-       pci_read_config_byte(mci->pdev, I82875P_DERRSYN, &info->derrsyn);
-       pci_read_config_word(mci->pdev, I82875P_ERRSTS, &info->errsts2);
+       pci_read_config_word(pdev, I82875P_ERRSTS, &info->errsts);
+       pci_read_config_dword(pdev, I82875P_EAP, &info->eap);
+       pci_read_config_byte(pdev, I82875P_DES, &info->des);
+       pci_read_config_byte(pdev, I82875P_DERRSYN, &info->derrsyn);
+       pci_read_config_word(pdev, I82875P_ERRSTS, &info->errsts2);
 
-       pci_write_bits16(mci->pdev, I82875P_ERRSTS, 0x0081, 0x0081);
+       pci_write_bits16(pdev, I82875P_ERRSTS, 0x0081, 0x0081);
 
        /*
         * If the error is the same then we can for both reads then
@@ -208,9 +214,9 @@ static void i82875p_get_error_info(struct mem_ctl_info *mci,
                return;
 
        if ((info->errsts ^ info->errsts2) & 0x0081) {
-               pci_read_config_dword(mci->pdev, I82875P_EAP, &info->eap);
-               pci_read_config_byte(mci->pdev, I82875P_DES, &info->des);
-               pci_read_config_byte(mci->pdev, I82875P_DERRSYN,
+               pci_read_config_dword(pdev, I82875P_EAP, &info->eap);
+               pci_read_config_byte(pdev, I82875P_DES, &info->des);
+               pci_read_config_byte(pdev, I82875P_DERRSYN,
                                &info->derrsyn);
        }
 }
@@ -259,116 +265,109 @@ static void i82875p_check(struct mem_ctl_info *mci)
 extern int pci_proc_attach_device(struct pci_dev *);
 #endif
 
-static int i82875p_probe1(struct pci_dev *pdev, int dev_idx)
+/* Return 0 on success or 1 on failure. */
+static int i82875p_setup_overfl_dev(struct pci_dev *pdev,
+               struct pci_dev **ovrfl_pdev, void __iomem **ovrfl_window)
 {
-       int rc = -ENODEV;
-       int index;
-       struct mem_ctl_info *mci = NULL;
-       struct i82875p_pvt *pvt = NULL;
-       unsigned long last_cumul_size;
-       struct pci_dev *ovrfl_pdev;
-       void __iomem *ovrfl_window = NULL;
-       u32 drc;
-       u32 drc_chan;           /* Number of channels 0=1chan,1=2chan */
-       u32 nr_chans;
-       u32 drc_ddim;           /* DRAM Data Integrity Mode 0=none,2=edac */
-       struct i82875p_error_info discard;
+       struct pci_dev *dev;
+       void __iomem *window;
 
-       debugf0("%s()\n", __func__);
-       ovrfl_pdev = pci_get_device(PCI_VEND_DEV(INTEL, 82875_6), NULL);
+       *ovrfl_pdev = NULL;
+       *ovrfl_window = NULL;
+       dev = pci_get_device(PCI_VEND_DEV(INTEL, 82875_6), NULL);
 
-       if (!ovrfl_pdev) {
-               /*
-                * Intel tells BIOS developers to hide device 6 which
+       if (dev == NULL) {
+               /* Intel tells BIOS developers to hide device 6 which
                 * configures the overflow device access containing
                 * the DRBs - this is where we expose device 6.
                 * http://www.x86-secret.com/articles/tweak/pat/patsecrets-2.htm
                 */
                pci_write_bits8(pdev, 0xf4, 0x2, 0x2);
-               ovrfl_pdev =
-                       pci_scan_single_device(pdev->bus, PCI_DEVFN(6, 0));
+               dev = pci_scan_single_device(pdev->bus, PCI_DEVFN(6, 0));
 
-               if (!ovrfl_pdev)
-                       return -ENODEV;
+               if (dev == NULL)
+                       return 1;
        }
 
+       *ovrfl_pdev = dev;
+
 #ifdef CONFIG_PROC_FS
-       if (!ovrfl_pdev->procent && pci_proc_attach_device(ovrfl_pdev)) {
-               i82875p_printk(KERN_ERR,
-                       "%s(): Failed to attach overflow device\n", __func__);
-               return -ENODEV;
+       if ((dev->procent == NULL) && pci_proc_attach_device(dev)) {
+               i82875p_printk(KERN_ERR, "%s(): Failed to attach overflow "
+                              "device\n", __func__);
+               return 1;
        }
-#endif
-                               /* CONFIG_PROC_FS */
-       if (pci_enable_device(ovrfl_pdev)) {
-               i82875p_printk(KERN_ERR,
-                       "%s(): Failed to enable overflow device\n", __func__);
-               return -ENODEV;
+#endif  /* CONFIG_PROC_FS */
+       if (pci_enable_device(dev)) {
+               i82875p_printk(KERN_ERR, "%s(): Failed to enable overflow "
+                              "device\n", __func__);
+               return 1;
        }
 
-       if (pci_request_regions(ovrfl_pdev, pci_name(ovrfl_pdev))) {
+       if (pci_request_regions(dev, pci_name(dev))) {
 #ifdef CORRECT_BIOS
                goto fail0;
 #endif
        }
 
        /* cache is irrelevant for PCI bus reads/writes */
-       ovrfl_window = ioremap_nocache(pci_resource_start(ovrfl_pdev, 0),
-                               pci_resource_len(ovrfl_pdev, 0));
+       window = ioremap_nocache(pci_resource_start(dev, 0),
+                                pci_resource_len(dev, 0));
 
-       if (!ovrfl_window) {
+       if (window == NULL) {
                i82875p_printk(KERN_ERR, "%s(): Failed to ioremap bar6\n",
-                       __func__);
+                              __func__);
                goto fail1;
        }
 
-       /* need to find out the number of channels */
-       drc = readl(ovrfl_window + I82875P_DRC);
-       drc_chan = ((drc >> 21) & 0x1);
-       nr_chans = drc_chan + 1;
+       *ovrfl_window = window;
+       return 0;
 
-       drc_ddim = (drc >> 18) & 0x1;
-       mci = edac_mc_alloc(sizeof(*pvt), I82875P_NR_CSROWS(nr_chans),
-                               nr_chans);
+fail1:
+       pci_release_regions(dev);
 
-       if (!mci) {
-               rc = -ENOMEM;
-               goto fail2;
-       }
+#ifdef CORRECT_BIOS
+fail0:
+       pci_disable_device(dev);
+#endif
+       /* NOTE: the ovrfl proc entry and pci_dev are intentionally left */
+       return 1;
+}
 
-       debugf3("%s(): init mci\n", __func__);
-       mci->pdev = pdev;
-       mci->mtype_cap = MEM_FLAG_DDR;
-       mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED;
-       mci->edac_cap = EDAC_FLAG_UNKNOWN;
-       /* adjust FLAGS */
 
-       mci->mod_name = EDAC_MOD_STR;
-       mci->mod_ver = "$Revision: 1.5.2.11 $";
-       mci->ctl_name = i82875p_devs[dev_idx].ctl_name;
-       mci->edac_check = i82875p_check;
-       mci->ctl_page_to_phys = NULL;
-       debugf3("%s(): init pvt\n", __func__);
-       pvt = (struct i82875p_pvt *) mci->pvt_info;
-       pvt->ovrfl_pdev = ovrfl_pdev;
-       pvt->ovrfl_window = ovrfl_window;
+/* Return 1 if dual channel mode is active.  Else return 0. */
+static inline int dual_channel_active(u32 drc)
+{
+       return (drc >> 21) & 0x1;
+}
 
-       /*
-        * The dram row boundary (DRB) reg values are boundary address
+
+static void i82875p_init_csrows(struct mem_ctl_info *mci,
+               struct pci_dev *pdev, void __iomem *ovrfl_window, u32 drc)
+{
+       struct csrow_info *csrow;
+       unsigned long last_cumul_size;
+       u8 value;
+       u32 drc_ddim;  /* DRAM Data Integrity Mode 0=none,2=edac */
+       u32 cumul_size;
+       int index;
+
+       drc_ddim = (drc >> 18) & 0x1;
+       last_cumul_size = 0;
+
+       /* The dram row boundary (DRB) reg values are boundary address
         * for each DRAM row with a granularity of 32 or 64MB (single/dual
         * channel operation).  DRB regs are cumulative; therefore DRB7 will
         * contain the total memory contained in all eight rows.
         */
-       for (last_cumul_size = index = 0; index < mci->nr_csrows; index++) {
-               u8 value;
-               u32 cumul_size;
-               struct csrow_info *csrow = &mci->csrows[index];
+
+       for (index = 0; index < mci->nr_csrows; index++) {
+               csrow = &mci->csrows[index];
 
                value = readb(ovrfl_window + I82875P_DRB + index);
                cumul_size = value << (I82875P_DRB_SHIFT - PAGE_SHIFT);
                debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index,
                        cumul_size);
-
                if (cumul_size == last_cumul_size)
                        continue;       /* not populated */
 
@@ -376,35 +375,75 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx)
                csrow->last_page = cumul_size - 1;
                csrow->nr_pages = cumul_size - last_cumul_size;
                last_cumul_size = cumul_size;
-               csrow->grain = 1 << 12;  /* I82875P_EAP has 4KiB reolution */
+               csrow->grain = 1 << 12; /* I82875P_EAP has 4KiB reolution */
                csrow->mtype = MEM_DDR;
                csrow->dtype = DEV_UNKNOWN;
                csrow->edac_mode = drc_ddim ? EDAC_SECDED : EDAC_NONE;
        }
+}
+
+static int i82875p_probe1(struct pci_dev *pdev, int dev_idx)
+{
+       int rc = -ENODEV;
+       struct mem_ctl_info *mci;
+       struct i82875p_pvt *pvt;
+       struct pci_dev *ovrfl_pdev;
+       void __iomem *ovrfl_window;
+       u32 drc;
+       u32 nr_chans;
+       struct i82875p_error_info discard;
+
+       debugf0("%s()\n", __func__);
+       ovrfl_pdev = pci_get_device(PCI_VEND_DEV(INTEL, 82875_6), NULL);
+
+       if (i82875p_setup_overfl_dev(pdev, &ovrfl_pdev, &ovrfl_window))
+               return -ENODEV;
+       drc = readl(ovrfl_window + I82875P_DRC);
+       nr_chans = dual_channel_active(drc) + 1;
+       mci = edac_mc_alloc(sizeof(*pvt), I82875P_NR_CSROWS(nr_chans),
+                               nr_chans);
+
+       if (!mci) {
+               rc = -ENOMEM;
+               goto fail0;
+       }
 
+       debugf3("%s(): init mci\n", __func__);
+       mci->dev = &pdev->dev;
+       mci->mtype_cap = MEM_FLAG_DDR;
+       mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED;
+       mci->edac_cap = EDAC_FLAG_UNKNOWN;
+       mci->mod_name = EDAC_MOD_STR;
+       mci->mod_ver = I82875P_REVISION;
+       mci->ctl_name = i82875p_devs[dev_idx].ctl_name;
+       mci->edac_check = i82875p_check;
+       mci->ctl_page_to_phys = NULL;
+       debugf3("%s(): init pvt\n", __func__);
+       pvt = (struct i82875p_pvt *) mci->pvt_info;
+       pvt->ovrfl_pdev = ovrfl_pdev;
+       pvt->ovrfl_window = ovrfl_window;
+       i82875p_init_csrows(mci, pdev, ovrfl_window, drc);
        i82875p_get_error_info(mci, &discard);  /* clear counters */
 
-       if (edac_mc_add_mc(mci)) {
+       /* Here we assume that we will never see multiple instances of this
+        * type of memory controller.  The ID is therefore hardcoded to 0.
+        */
+       if (edac_mc_add_mc(mci,0)) {
                debugf3("%s(): failed edac_mc_add_mc()\n", __func__);
-               goto fail3;
+               goto fail1;
        }
 
        /* get this far and it's successful */
        debugf3("%s(): success\n", __func__);
        return 0;
 
-fail3:
+fail1:
        edac_mc_free(mci);
 
-fail2:
+fail0:
        iounmap(ovrfl_window);
-
-fail1:
        pci_release_regions(ovrfl_pdev);
 
-#ifdef CORRECT_BIOS
-fail0:
-#endif
        pci_disable_device(ovrfl_pdev);
        /* NOTE: the ovrfl proc entry and pci_dev are intentionally left */
        return rc;
@@ -437,7 +476,7 @@ static void __devexit i82875p_remove_one(struct pci_dev *pdev)
 
        debugf0("%s()\n", __func__);
 
-       if ((mci = edac_mc_del_mc(pdev)) == NULL)
+       if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL)
                return;
 
        pvt = (struct i82875p_pvt *) mci->pvt_info;
index 2c29fafe67c7ef5877c950b6d9468caf6dc87cf2..a49cf0a39398a4476e37c7105c02b6a3123daee4 100644 (file)
@@ -15,7 +15,6 @@
  * references to this document given in []
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/pci.h>
@@ -23,6 +22,9 @@
 #include <linux/slab.h>
 #include "edac_mc.h"
 
+#define R82600_REVISION        " Ver: 2.0.1 " __DATE__
+#define EDAC_MOD_STR   "r82600_edac"
+
 #define r82600_printk(level, fmt, arg...) \
        edac_printk(level, "r82600", fmt, ##arg)
 
@@ -134,17 +136,20 @@ static unsigned int disable_hardware_scrub = 0;
 static void r82600_get_error_info (struct mem_ctl_info *mci,
                struct r82600_error_info *info)
 {
-       pci_read_config_dword(mci->pdev, R82600_EAP, &info->eapr);
+       struct pci_dev *pdev;
+
+       pdev = to_pci_dev(mci->dev);
+       pci_read_config_dword(pdev, R82600_EAP, &info->eapr);
 
        if (info->eapr & BIT(0))
                /* Clear error to allow next error to be reported [p.62] */
-               pci_write_bits32(mci->pdev, R82600_EAP,
+               pci_write_bits32(pdev, R82600_EAP,
                                ((u32) BIT(0) & (u32) BIT(1)),
                                ((u32) BIT(0) & (u32) BIT(1)));
 
        if (info->eapr & BIT(1))
                /* Clear error to allow next error to be reported [p.62] */
-               pci_write_bits32(mci->pdev, R82600_EAP,
+               pci_write_bits32(pdev, R82600_EAP,
                                ((u32) BIT(0) & (u32) BIT(1)),
                                ((u32) BIT(0) & (u32) BIT(1)));
 }
@@ -200,25 +205,72 @@ static void r82600_check(struct mem_ctl_info *mci)
        r82600_process_error_info(mci, &info, 1);
 }
 
-static int r82600_probe1(struct pci_dev *pdev, int dev_idx)
+static inline int ecc_enabled(u8 dramcr)
+{
+       return dramcr & BIT(5);
+}
+
+static void r82600_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev,
+               u8 dramcr)
 {
-       int rc = -ENODEV;
+       struct csrow_info *csrow;
        int index;
-       struct mem_ctl_info *mci = NULL;
+       u8 drbar;  /* SDRAM Row Boundry Address Register */
+       u32 row_high_limit, row_high_limit_last;
+       u32 reg_sdram, ecc_on, row_base;
+
+       ecc_on = ecc_enabled(dramcr);
+       reg_sdram = dramcr & BIT(4);
+       row_high_limit_last = 0;
+
+       for (index = 0; index < mci->nr_csrows; index++) {
+               csrow = &mci->csrows[index];
+
+               /* find the DRAM Chip Select Base address and mask */
+               pci_read_config_byte(pdev, R82600_DRBA + index, &drbar);
+
+               debugf1("%s() Row=%d DRBA = %#0x\n", __func__, index, drbar);
+
+               row_high_limit = ((u32) drbar << 24);
+/*             row_high_limit = ((u32)drbar << 24) | 0xffffffUL; */
+
+               debugf1("%s() Row=%d, Boundry Address=%#0x, Last = %#0x\n",
+                       __func__, index, row_high_limit, row_high_limit_last);
+
+               /* Empty row [p.57] */
+               if (row_high_limit == row_high_limit_last)
+                       continue;
+
+               row_base = row_high_limit_last;
+
+               csrow->first_page = row_base >> PAGE_SHIFT;
+               csrow->last_page = (row_high_limit >> PAGE_SHIFT) - 1;
+               csrow->nr_pages = csrow->last_page - csrow->first_page + 1;
+               /* Error address is top 19 bits - so granularity is      *
+                * 14 bits                                               */
+               csrow->grain = 1 << 14;
+               csrow->mtype = reg_sdram ? MEM_RDDR : MEM_DDR;
+               /* FIXME - check that this is unknowable with this chipset */
+               csrow->dtype = DEV_UNKNOWN;
+
+               /* Mode is global on 82600 */
+               csrow->edac_mode = ecc_on ? EDAC_SECDED : EDAC_NONE;
+               row_high_limit_last = row_high_limit;
+       }
+}
+
+static int r82600_probe1(struct pci_dev *pdev, int dev_idx)
+{
+       struct mem_ctl_info *mci;
        u8 dramcr;
-       u32 ecc_on;
-       u32 reg_sdram;
        u32 eapr;
        u32 scrub_disabled;
        u32 sdram_refresh_rate;
-       u32 row_high_limit_last = 0;
        struct r82600_error_info discard;
 
        debugf0("%s()\n", __func__);
        pci_read_config_byte(pdev, R82600_DRAMC, &dramcr);
        pci_read_config_dword(pdev, R82600_EAP, &eapr);
-       ecc_on = dramcr & BIT(5);
-       reg_sdram = dramcr & BIT(4);
        scrub_disabled = eapr & BIT(31);
        sdram_refresh_rate = dramcr & (BIT(0) | BIT(1));
        debugf2("%s(): sdram refresh rate = %#0x\n", __func__,
@@ -226,13 +278,11 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx)
        debugf2("%s(): DRAMC register = %#0x\n", __func__, dramcr);
        mci = edac_mc_alloc(0, R82600_NR_CSROWS, R82600_NR_CHANS);
 
-       if (mci == NULL) {
-               rc = -ENOMEM;
-               goto fail;
-       }
+       if (mci == NULL)
+               return -ENOMEM;
 
        debugf0("%s(): mci = %p\n", __func__, mci);
-       mci->pdev = pdev;
+       mci->dev = &pdev->dev;
        mci->mtype_cap = MEM_FLAG_RDDR | MEM_FLAG_DDR;
        mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_EC | EDAC_FLAG_SECDED;
        /* FIXME try to work out if the chip leads have been used for COM2
@@ -245,7 +295,7 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx)
         * is possible.                                               */
        mci->edac_cap = EDAC_FLAG_NONE | EDAC_FLAG_EC | EDAC_FLAG_SECDED;
 
-       if (ecc_on) {
+       if (ecc_enabled(dramcr)) {
                if (scrub_disabled)
                        debugf3("%s(): mci = %p - Scrubbing disabled! EAP: "
                                "%#0x\n", __func__, mci, eapr);
@@ -253,53 +303,17 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx)
                mci->edac_cap = EDAC_FLAG_NONE;
 
        mci->mod_name = EDAC_MOD_STR;
-       mci->mod_ver = "$Revision: 1.1.2.6 $";
+       mci->mod_ver = R82600_REVISION;
        mci->ctl_name = "R82600";
        mci->edac_check = r82600_check;
        mci->ctl_page_to_phys = NULL;
-
-       for (index = 0; index < mci->nr_csrows; index++) {
-               struct csrow_info *csrow = &mci->csrows[index];
-               u8 drbar;       /* sDram Row Boundry Address Register */
-               u32 row_high_limit;
-               u32 row_base;
-
-               /* find the DRAM Chip Select Base address and mask */
-               pci_read_config_byte(mci->pdev, R82600_DRBA + index, &drbar);
-
-               debugf1("MC%d: %s() Row=%d DRBA = %#0x\n", mci->mc_idx,
-                       __func__, index, drbar);
-
-               row_high_limit = ((u32) drbar << 24);
-/*             row_high_limit = ((u32)drbar << 24) | 0xffffffUL; */
-
-               debugf1("MC%d: %s() Row=%d, Boundry Address=%#0x, Last = "
-                       "%#0x \n", mci->mc_idx, __func__, index,
-                       row_high_limit, row_high_limit_last);
-
-               /* Empty row [p.57] */
-               if (row_high_limit == row_high_limit_last)
-                       continue;
-
-               row_base = row_high_limit_last;
-               csrow->first_page = row_base >> PAGE_SHIFT;
-               csrow->last_page = (row_high_limit >> PAGE_SHIFT) - 1;
-               csrow->nr_pages = csrow->last_page - csrow->first_page + 1;
-               /* Error address is top 19 bits - so granularity is      *
-                * 14 bits                                               */
-               csrow->grain = 1 << 14;
-               csrow->mtype = reg_sdram ? MEM_RDDR : MEM_DDR;
-               /* FIXME - check that this is unknowable with this chipset */
-               csrow->dtype = DEV_UNKNOWN;
-
-               /* Mode is global on 82600 */
-               csrow->edac_mode = ecc_on ? EDAC_SECDED : EDAC_NONE;
-               row_high_limit_last = row_high_limit;
-       }
-
+       r82600_init_csrows(mci, pdev, dramcr);
        r82600_get_error_info(mci, &discard);  /* clear counters */
 
-       if (edac_mc_add_mc(mci)) {
+       /* Here we assume that we will never see multiple instances of this
+        * type of memory controller.  The ID is therefore hardcoded to 0.
+        */
+       if (edac_mc_add_mc(mci,0)) {
                debugf3("%s(): failed edac_mc_add_mc()\n", __func__);
                goto fail;
        }
@@ -309,17 +323,15 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx)
        if (disable_hardware_scrub) {
                debugf3("%s(): Disabling Hardware Scrub (scrub on error)\n",
                        __func__);
-               pci_write_bits32(mci->pdev, R82600_EAP, BIT(31), BIT(31));
+               pci_write_bits32(pdev, R82600_EAP, BIT(31), BIT(31));
        }
 
        debugf3("%s(): success\n", __func__);
        return 0;
 
 fail:
-       if (mci)
-               edac_mc_free(mci);
-
-       return rc;
+       edac_mc_free(mci);
+       return -ENODEV;
 }
 
 /* returns count (>= 0), or negative on error */
@@ -338,7 +350,7 @@ static void __devexit r82600_remove_one(struct pci_dev *pdev)
 
        debugf0("%s()\n", __func__);
 
-       if ((mci = edac_mc_del_mc(pdev)) == NULL)
+       if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL)
                return;
 
        edac_mc_free(mci);
index 0f97a0cb0ff431733f27551ffaa779668143000e..9b4fcac03ad5fee8a87922ffd9c2cab2525ffda3 100644 (file)
@@ -7,7 +7,6 @@
  * This code is released under the GPL version 2.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
 #include <linux/eisa.h>
index ed85dfcef69a403ab84120824e248784a4acab3e..8700a8076d0482df55c2cd8e379d603e7873e918 100644 (file)
@@ -2,7 +2,6 @@
  * We should not even be trying to compile this if we are not doing
  * a module.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 
 #ifdef CONFIG_MODULES
index cf8768b8d1f126f5c488057dd348a1d6082bafcc..3b07e0ca81cdf9b60ac26214d60c0a7169b33bfc 100644 (file)
@@ -637,7 +637,7 @@ static inline void soc_init(struct sbus_dev *sdev, int no)
        
        irq = sdev->irqs[0];
 
-       if (request_irq (irq, soc_intr, SA_SHIRQ, "SOC", (void *)s)) {
+       if (request_irq (irq, soc_intr, IRQF_SHARED, "SOC", (void *)s)) {
                soc_printk ("Cannot order irq %d to go\n", irq);
                socs = s->next;
                return;
index f52d1e5bd5a5b0cd68711db46e32a6ce1c4c18b5..2b75edc5859d61dd6d62d883d2eec7e667005297 100644 (file)
@@ -761,7 +761,7 @@ static inline void socal_init(struct sbus_dev *sdev, int no)
        
        irq = sdev->irqs[0];
 
-       if (request_irq (irq, socal_intr, SA_SHIRQ, "SOCAL", (void *)s)) {
+       if (request_irq (irq, socal_intr, IRQF_SHARED, "SOCAL", (void *)s)) {
                socal_printk ("Cannot order irq %d to go\n", irq);
                socals = s->next;
                return;
index fdb8b042e64d121f3e4a9be60719efc25cf17f0c..23b086685453d295c6b119c3ce83253cd57e95d7 100644 (file)
@@ -34,7 +34,6 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/string.h>
index 9b7e4d52ffd474ef9f745b9d36c5db13ad172e2e..8ebce1c03ad77f887038924590ecfc009f782b1d 100644 (file)
@@ -66,7 +66,6 @@
  */
 
 #include <linux/capability.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index c37baf9448bc8665905c8479942c98ff083ea460..c2ad72fefd9d50a8f447062ad8a3e1daf8489519 100644 (file)
@@ -11,7 +11,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/acpi.h>
 #include <linux/console.h>
 #include <linux/efi.h>
index a6764ff00803bb2d43e7e0d2633351ada41c26a6..9d67320e6840161c7f8c5dcf068abf3fe69367e7 100644 (file)
@@ -22,7 +22,6 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/hwmon-vid.h>
index e407c74bda35bd4f10530acef841fbb2cf627b7f..7576ec9426a35b0e733d08f5552058aa67e9cd73 100644 (file)
@@ -35,7 +35,6 @@
     w83792d    9       7       7       3       0x7a    0x5ca3  yes     no
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
index 8b46ef7d9ff8365b9fda3dc8bc439a6654c90dca..7be1d0a3e8f8f59856562013e1b6361d569c6510 100644 (file)
@@ -494,8 +494,8 @@ static int __devinit i801_probe(struct pci_dev *dev, const struct pci_device_id
        err = pci_request_region(dev, SMBBAR, i801_driver.name);
        if (err) {
                dev_err(&dev->dev, "Failed to request SMBus region "
-                       "0x%lx-0x%lx\n", i801_smba,
-                       pci_resource_end(dev, SMBBAR));
+                       "0x%lx-0x%Lx\n", i801_smba,
+                       (unsigned long long)pci_resource_end(dev, SMBBAR));
                goto exit;
        }
 
index 87fae937e666dfdab0b8f00493a5afa94918e18c..0599bbd65d93b196fd946b1f270b89af48932730 100644 (file)
@@ -28,7 +28,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/ioport.h>
index d00a02fc23e42b3878390d58c2619eec0cf222bf..aca7e166860546174c59557aead82d7d90c25428 100644 (file)
@@ -26,7 +26,6 @@
  * the Free Software Foundation, version 2.
  */
 
-#include <linux/config.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
index 2721e4c8184a9a64f505686ebf7bf6e1e80ecf59..377ab40944b8d3cbecfc02ab3c0fe1fb7673ec7c 100644 (file)
@@ -13,7 +13,6 @@
  * warranty of any kind, whether express or implied.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/sched.h>
@@ -319,7 +318,7 @@ static int fsl_i2c_probe(struct platform_device *pdev)
 
        if (i2c->irq != 0)
                if ((result = request_irq(i2c->irq, mpc_i2c_isr,
-                                         SA_SHIRQ, "i2c-mpc", i2c)) < 0) {
+                                         IRQF_SHARED, "i2c-mpc", i2c)) < 0) {
                        printk(KERN_ERR
                               "i2c-mpc - failed to attach interrupt\n");
                        goto fail_irq;
index df786eb55295a41dc19ccfdc8eb371f0e890b63c..2a0b3be7cdd0824d910d90f5ddec5e312202abf9 100644 (file)
@@ -20,7 +20,6 @@
 
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
index 5155010b455e7eb9a094ed520d5bf4fbb25a9ae7..ee114b48face4e2662f85cd4b6ab09f697b03656 100644 (file)
@@ -968,7 +968,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
 #endif
 
        pxa_set_cken(CKEN14_I2C, 1);
-       ret = request_irq(IRQ_I2C, i2c_pxa_handler, SA_INTERRUPT,
+       ret = request_irq(IRQ_I2C, i2c_pxa_handler, IRQF_DISABLED,
                          "pxa2xx-i2c", i2c);
        if (ret)
                goto out;
index f7d40f8e5f5c91c053e44f106190e570cc5e6814..5d2950e91fc5fce62a6e3566791abcf2b1738d4c 100644 (file)
@@ -20,7 +20,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 
@@ -829,7 +828,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
                goto out;
        }
 
-       ret = request_irq(res->start, s3c24xx_i2c_irq, SA_INTERRUPT,
+       ret = request_irq(res->start, s3c24xx_i2c_irq, IRQF_DISABLED,
                          pdev->name, i2c);
 
        if (ret != 0) {
index 27fbfecc414fcf9b56f32f686a8b08b98ccc5019..cb3ef5ac99fd06976c0145fd4be0399044f03b90 100644 (file)
@@ -21,7 +21,6 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
index e6f1ab7b913c1d59db9c7e6e7e98b3920927ea21..f92505b94c61fb80b2907faacbfe1419df66d05b 100644 (file)
@@ -21,7 +21,6 @@
 #undef DEBUG
 #undef VERBOSE
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
@@ -909,7 +908,7 @@ static int otg_bind(struct isp1301 *isp)
 
        if (otg_dev)
                status = request_irq(otg_dev->resource[1].start, omap_otg_irq,
-                               SA_INTERRUPT, DRIVER_NAME, isp);
+                               IRQF_DISABLED, DRIVER_NAME, isp);
        else
                status = -ENODEV;
 
@@ -1579,7 +1578,7 @@ fail1:
        }
 
        status = request_irq(isp->irq, isp1301_irq,
-                       SA_SAMPLE_RANDOM, DRIVER_NAME, isp);
+                       IRQF_SAMPLE_RANDOM, DRIVER_NAME, isp);
        if (status < 0) {
                dev_dbg(&i2c->dev, "can't get IRQ %d, err %d\n",
                                isp->irq, status);
index 179b1e022d8094e7334d75ab05af9e66da8a9db6..e7e27049fbfa2d6ff350a040b00b1c4d633ffad7 100644 (file)
@@ -19,7 +19,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
@@ -522,14 +521,14 @@ tps65010_probe(struct i2c_adapter *bus, int address, int kind)
        }
 
 #ifdef CONFIG_ARM
-       irqflags = SA_SAMPLE_RANDOM | SA_TRIGGER_LOW;
+       irqflags = IRQF_SAMPLE_RANDOM | IRQF_TRIGGER_LOW;
        if (machine_is_omap_h2()) {
                tps->model = TPS65010;
                omap_cfg_reg(W4_GPIO58);
                tps->irq = OMAP_GPIO_IRQ(58);
                omap_request_gpio(58);
                omap_set_gpio_direction(58, 1);
-               irqflags |= SA_TRIGGER_FALLING;
+               irqflags |= IRQF_TRIGGER_FALLING;
        }
        if (machine_is_omap_osk()) {
                tps->model = TPS65010;
@@ -537,7 +536,7 @@ tps65010_probe(struct i2c_adapter *bus, int address, int kind)
                tps->irq = OMAP_GPIO_IRQ(OMAP_MPUIO(1));
                omap_request_gpio(OMAP_MPUIO(1));
                omap_set_gpio_direction(OMAP_MPUIO(1), 1);
-               irqflags |= SA_TRIGGER_FALLING;
+               irqflags |= IRQF_TRIGGER_FALLING;
        }
        if (machine_is_omap_h3()) {
                tps->model = TPS65013;
@@ -545,7 +544,7 @@ tps65010_probe(struct i2c_adapter *bus, int address, int kind)
                // FIXME set up this board's IRQ ...
        }
 #else
-       irqflags = SA_SAMPLE_RANDOM;
+       irqflags = IRQF_SAMPLE_RANDOM;
 #endif
 
        if (tps->irq > 0) {
index 308897e57e4dbab9375a18ea763f9865dbf8de21..8a1c27f28692c02c6fee0d43899eab4d000f126d 100644 (file)
@@ -6,7 +6,6 @@
  * Please note that this platform does not support 32-bit IDE IO.
  */
 
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/module.h>
 #include <linux/ioport.h>
index cd15e6260510d29e330f9eb5b509174dae00f040..5797e0b5a1327f4e87a41e772bdd568d6180abce 100644 (file)
@@ -19,7 +19,6 @@
 
 #undef REALLY_SLOW_IO           /* most systems can safely undef this */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/timer.h>
index fb91cb8bf2d29613624f3df1710685e9a040431a..15955996a1f34c7ed33b00e5658b30ae4a3c3f2c 100644 (file)
@@ -5,7 +5,6 @@
 
 #include <linux/init.h>
 #include <linux/ide.h>
-#include <linux/config.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
index bfafd4846a08024f1b470de94bc52d5f1793365d..654d4cd09847cebdcad66b77fc5c9f0167f78149 100644 (file)
  
 #define IDECD_VERSION "4.61"
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index d0227c39ced16d763c9242f85ee77415ddb36040..f712e4cfd9dcb7eb1dafba2dc59f7e1c584f80f2 100644 (file)
@@ -47,7 +47,6 @@
 
 //#define DEBUG
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/string.h>
index 783a2475ee8b12519e33adac7e69f1c55219b22d..98918fb6b2ce32a8854fa4c05068e2fc9ad184c4 100644 (file)
@@ -74,7 +74,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 68628327c0f55ce9c33e6938d350e4de09c702a1..adbe9f76a50533c64355078e77bf1ce564de746e 100644 (file)
@@ -82,7 +82,6 @@
 
 #define IDEFLOPPY_VERSION "0.99.newide"
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/string.h>
@@ -839,7 +838,7 @@ static ide_startstop_t idefloppy_pc_intr (ide_drive_t *drive)
                        "transferred\n", pc->actually_transferred);
                clear_bit(PC_DMA_IN_PROGRESS, &pc->flags);
 
-               local_irq_enable();
+               local_irq_enable_in_hardirq();
 
                if (status.b.check || test_bit(PC_DMA_ERROR, &pc->flags)) {
                        /* Error detected */
index 26ceab1e90bb5d94f71100e6239349343cd849cc..fb6795236e76c677c9bf990a48dc62ec675da8da 100644 (file)
@@ -24,7 +24,6 @@
  */
  
  
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/string.h>
@@ -694,7 +693,7 @@ static ide_startstop_t drive_cmd_intr (ide_drive_t *drive)
        u8 stat = hwif->INB(IDE_STATUS_REG);
        int retries = 10;
 
-       local_irq_enable();
+       local_irq_enable_in_hardirq();
        if ((stat & DRQ_STAT) && args && args[3]) {
                u8 io_32bit = drive->io_32bit;
                drive->io_32bit = 0;
@@ -1287,7 +1286,7 @@ static void ide_do_request (ide_hwgroup_t *hwgroup, int masked_irq)
                if (masked_irq != IDE_NO_IRQ && hwif->irq != masked_irq)
                        disable_irq_nosync(hwif->irq);
                spin_unlock(&ide_lock);
-               local_irq_enable();
+               local_irq_enable_in_hardirq();
                        /* allow other IRQs while we start this request */
                startstop = start_request(drive, rq);
                spin_lock_irq(&ide_lock);
@@ -1632,7 +1631,7 @@ irqreturn_t ide_intr (int irq, void *dev_id, struct pt_regs *regs)
        spin_unlock(&ide_lock);
 
        if (drive->unmask)
-               local_irq_enable();
+               local_irq_enable_in_hardirq();
        /* service this interrupt, may set handler for next interrupt */
        startstop = handler(drive);
        spin_lock_irq(&ide_lock);
@@ -1706,7 +1705,7 @@ int ide_do_drive_cmd (ide_drive_t *drive, struct request *rq, ide_action_t actio
 {
        unsigned long flags;
        ide_hwgroup_t *hwgroup = HWGROUP(drive);
-       DECLARE_COMPLETION(wait);
+       DECLARE_COMPLETION_ONSTACK(wait);
        int where = ELEVATOR_INSERT_BACK, err;
        int must_wait = (action == ide_wait || action == ide_head_wait);
 
index 32117f0ec5c00727f41fde8e0765d85449a4652b..657165297dc76c0a16bd2126b854920ffbf99cbe 100644 (file)
@@ -6,7 +6,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/string.h>
index 7ddb11828731e816ea9c6acafe382906bb0b81a5..1feff23487d44f515574809e153744a615c7ad26 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/string.h>
index 0d5038a2856060ac369bd7f61195e449e79758b7..9cadf0106c6c781d45a2add269b0b2961a1691aa 100644 (file)
@@ -33,7 +33,6 @@
 
 #undef REALLY_SLOW_IO          /* most systems can safely undef this */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/string.h>
@@ -1005,7 +1004,7 @@ static int ide_init_queue(ide_drive_t *drive)
  * and irq serialization situations.  This is somewhat complex because
  * it handles static as well as dynamic (PCMCIA) IDE interfaces.
  *
- * The SA_INTERRUPT in sa_flags means ide_intr() is always entered with
+ * The IRQF_DISABLED in sa_flags means ide_intr() is always entered with
  * interrupts completely disabled.  This can be bad for interrupt latency,
  * but anything else has led to problems on some machines.  We re-enable
  * interrupts as much as we can safely do in most places.
@@ -1091,15 +1090,15 @@ static int init_irq (ide_hwif_t *hwif)
         * Allocate the irq, if not already obtained for another hwif
         */
        if (!match || match->irq != hwif->irq) {
-               int sa = SA_INTERRUPT;
+               int sa = IRQF_DISABLED;
 #if defined(__mc68000__) || defined(CONFIG_APUS)
-               sa = SA_SHIRQ;
+               sa = IRQF_SHARED;
 #endif /* __mc68000__ || CONFIG_APUS */
 
                if (IDE_CHIPSET_IS_PCI(hwif->chipset)) {
-                       sa = SA_SHIRQ;
+                       sa = IRQF_SHARED;
 #ifndef CONFIG_IDEPCI_SHARE_IRQ
-                       sa |= SA_INTERRUPT;
+                       sa |= IRQF_DISABLED;
 #endif /* CONFIG_IDEPCI_SHARE_IRQ */
                }
 
index 84665e2ba3c85844436c1a1970d3ce6e7686987e..c12f1b71e934fcdd23b349dc309bef0a09053941 100644 (file)
@@ -22,7 +22,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <asm/uaccess.h>
index 4b91101e12b7715fee6682f6dcc8124006f672f6..7067ab997927d5515f32f2b09c8a48af1cc34cdf 100644 (file)
 
 #define IDETAPE_VERSION "1.19"
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/string.h>
index a839b2a8f6f485d17f30a1d861bbb7ecb7deda63..97a9244312fc0492fc813e2effa99cbbe2542b55 100644 (file)
@@ -27,7 +27,6 @@
  *     request.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/string.h>
@@ -223,7 +222,7 @@ ide_startstop_t task_no_data_intr (ide_drive_t *drive)
        ide_hwif_t *hwif        = HWIF(drive);
        u8 stat;
 
-       local_irq_enable();
+       local_irq_enable_in_hardirq();
        if (!OK_STAT(stat = hwif->INB(IDE_STATUS_REG),READY_STAT,BAD_STAT)) {
                return ide_error(drive, "task_no_data_intr", stat);
                /* calls ide_end_drive_cmd */
index 1cdf44205162cc79f347a45727e9261df4dbf53a..05fbd9298db7c7cd5e265a8d9a65a994ec1c81f5 100644 (file)
 
 #define _IDE_C                 /* Tell ide.h it's really us */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/string.h>
index fb88711812e68fcc6ca9c02b911c5a1d52da539f..9c544467cb74a50bf09aa24cd1a9e954d7e6e002 100644 (file)
@@ -40,7 +40,6 @@
 #undef REALLY_SLOW_IO           /* most systems can safely undef this */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
index 20eb5b872ca9eaba1174ce9406372470802d70cd..3b1d33baaa2f6c08758081c7ac1331ad5e3c8e74 100644 (file)
@@ -7,7 +7,6 @@
 #undef REALLY_SLOW_IO           /* most systems can safely undef this */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
index 3fac3e9ec47d7a24b5292535cfbb4cb27e1d9a84..64d42619ab06a1f7e4e4d576bd8f8ef329ff5ee8 100644 (file)
@@ -8,7 +8,6 @@
  *  more details.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/mm.h>
 #include <linux/interrupt.h>
index 6439dec66881619fc26d678a5bab544e18e06182..aebecd8f51ccd7be2119164ff3bf3d58a9525b46 100644 (file)
@@ -691,7 +691,7 @@ static struct block_device_operations hd_fops = {
 };
 
 /*
- * This is the hard disk IRQ description. The SA_INTERRUPT in sa_flags
+ * This is the hard disk IRQ description. The IRQF_DISABLED in sa_flags
  * means we run the IRQ-handler with interrupts disabled:  this is bad for
  * interrupt latency, but anything else has led to problems on some
  * machines.
@@ -806,7 +806,7 @@ static int __init hd_init(void)
                        p->cyl, p->head, p->sect);
        }
 
-       if (request_irq(HD_IRQ, hd_interrupt, SA_INTERRUPT, "hd", NULL)) {
+       if (request_irq(HD_IRQ, hd_interrupt, IRQF_DISABLED, "hd", NULL)) {
                printk("hd: unable to get IRQ%d for the hard disk driver\n",
                        HD_IRQ);
                goto out1;
index a77fb249d5cf8fa006bc77590929e6ec77c7504e..c48e87e512d38298bdc15f358a2751217e1b1615 100644 (file)
@@ -39,7 +39,6 @@
 #undef REALLY_SLOW_IO          /* most systems can safely undef this */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
index 602797a4420877f6fc74e659a05b4c50be8d54d6..b7e459e4f284af88a00b26a50b40ffed734f531d 100644 (file)
@@ -146,7 +146,16 @@ static void ide_detach(struct pcmcia_device *link)
     kfree(link->priv);
 } /* ide_detach */
 
-static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq, struct pcmcia_device *handle)
+static void idecs_mmio_fixup(ide_hwif_t *hwif)
+{
+       default_hwif_mmiops(hwif);
+       hwif->mmio = 2;
+
+       ide_undecoded_slave(hwif);
+}
+
+static int idecs_register(unsigned long io, unsigned long ctl,
+       unsigned long irq, struct pcmcia_device *handle, int is_mmio)
 {
     hw_regs_t hw;
     memset(&hw, 0, sizeof(hw));
@@ -154,7 +163,19 @@ static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq
     hw.irq = irq;
     hw.chipset = ide_pci;
     hw.dev = &handle->dev;
-    return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave);
+
+    if(is_mmio)
+       return ide_register_hw_with_fixup(&hw, NULL, idecs_mmio_fixup);
+    else
+        return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave);
+}
+
+void outb_io(unsigned char value, unsigned long port) {
+       outb(value, port);
+}
+
+void outb_mem(unsigned char value, unsigned long port) {
+       writeb(value, (void __iomem *) port);
 }
 
 /*======================================================================
@@ -180,7 +201,8 @@ static int ide_config(struct pcmcia_device *link)
     } *stk = NULL;
     cistpl_cftable_entry_t *cfg;
     int i, pass, last_ret = 0, last_fn = 0, hd, is_kme = 0;
-    unsigned long io_base, ctl_base;
+    unsigned long io_base, ctl_base, is_mmio, try_slave;
+    void (*my_outb)(unsigned char, unsigned long);
 
     DEBUG(0, "ide_config(0x%p)\n", link);
 
@@ -210,7 +232,7 @@ static int ide_config(struct pcmcia_device *link)
     /* Not sure if this is right... look up the current Vcc */
     CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &stk->conf));
 
-    pass = io_base = ctl_base = 0;
+    pass = io_base = ctl_base = is_mmio = try_slave = 0;
     tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
     tuple.Attributes = 0;
     CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
@@ -258,11 +280,45 @@ static int ide_config(struct pcmcia_device *link)
                        goto next_entry;
                io_base = link->io.BasePort1;
                ctl_base = link->io.BasePort1 + 0x0e;
+
+               if (io->win[0].len >= 0x20)
+                       try_slave = 1;
+
            } else goto next_entry;
            /* If we've got this far, we're done */
            break;
        }
 
+       if ((cfg->mem.nwin > 0) || (stk->dflt.mem.nwin > 0)) {
+           win_req_t req;
+           memreq_t map;
+           cistpl_mem_t *mem = (cfg->mem.nwin) ? &cfg->mem : &stk->dflt.mem;
+
+           if (mem->win[0].len < 16)
+               goto next_entry;
+
+           req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM;
+           req.Attributes |= WIN_ENABLE;
+           req.Base = mem->win[0].host_addr;
+           req.Size = 0;
+
+           req.AccessSpeed = 0;
+           if (pcmcia_request_window(&link, &req, &link->win) != 0)
+               goto next_entry;
+           map.Page = 0; map.CardOffset = mem->win[0].card_addr;
+           if (pcmcia_map_mem_page(link->win, &map) != 0)
+               goto next_entry;
+
+           io_base = (unsigned long) ioremap(req.Base, req.Size);
+           ctl_base = io_base + 0x0e;
+           is_mmio = 1;
+
+           if (mem->win[0].len >= 0x20)
+               try_slave = 1;
+
+           break;
+       }
+
     next_entry:
        if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
            memcpy(&stk->dflt, cfg, sizeof(stk->dflt));
@@ -278,21 +334,26 @@ static int ide_config(struct pcmcia_device *link)
     CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
     CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
 
+    if(is_mmio)
+       my_outb = outb_mem;
+    else
+       my_outb = outb_io;
+
     /* disable drive interrupts during IDE probe */
-    outb(0x02, ctl_base);
+    my_outb(0x02, ctl_base);
 
     /* special setup for KXLC005 card */
     if (is_kme)
-       outb(0x81, ctl_base+1);
+       my_outb(0x81, ctl_base+1);
 
     /* retry registration in case device is still spinning up */
     for (hd = -1, i = 0; i < 10; i++) {
-       hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link);
+       hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link, is_mmio);
        if (hd >= 0) break;
-       if (link->io.NumPorts1 == 0x20) {
-           outb(0x02, ctl_base + 0x10);
+       if (try_slave) {
+           my_outb(0x02, ctl_base + 0x10);
            hd = idecs_register(io_base + 0x10, ctl_base + 0x10,
-                               link->irq.AssignedIRQ, link);
+                               link->irq.AssignedIRQ, link, is_mmio);
            if (hd >= 0) {
                io_base += 0x10;
                ctl_base += 0x10;
index 90cac609d9cf1dba22def43eabd04e90e67811e1..d655da749144e10d3fd8a04823a884e02852668a 100644 (file)
@@ -11,7 +11,6 @@
  *  more details.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/mm.h>
 #include <linux/interrupt.h>
index 563fab0098beb74bfc7e97754a89b6b11e7afac0..d3c3bc2640e766acf58d619a81b0284d3efe0a58 100644 (file)
@@ -28,7 +28,6 @@
 #undef REALLY_SLOW_IO          /* most systems can safely undef this */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
index cdbdb2ff9f15eae54df50ec4e1bd696b8fe2d7a7..6e2c58c5f6a2f8ff5e6304f83fd1d3f009c53c2d 100644 (file)
@@ -40,7 +40,6 @@
 #define REALLY_SLOW_IO         /* some systems can safely undef this */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
index 3edd7060510fa6e668e46cc6deb1000fe4c4fc69..a7c725f8bf64507f3c5317d93322d3365aa197e1 100644 (file)
@@ -6,7 +6,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
index 8b24b4f2a839a0abe424cf5e75eebd2bf5a9434b..351dab2fcacf730f0c070cf772383270efa186ab 100644 (file)
@@ -27,7 +27,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 85007cb12c52356eaf7cab09b8d972e3441f5a8c..2b0ea8b6608df5cbd7d75f74397fc1b5111f1d16 100644 (file)
@@ -16,7 +16,6 @@
  * the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/ioport.h>
index 900efd1da587d782a0afd369579c62713935280b..a574de5f083572933ce68c5898ccae7192d5218c 100644 (file)
@@ -6,7 +6,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
index 11d035f1983de98561e4f884f8dd53bb9e892f2c..61b5f9c0b2f4da7620b8655b43afed4d580bc460 100644 (file)
 
 //#define CMD640_DUMP_REGS
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
index 92b7b1549b1668249b6cdea1bfdac4083a418527..20c32716bbc4fafede557c3a32d87d57842e9716 100644 (file)
@@ -14,7 +14,6 @@
  * Copyright (C) 1999-2002     Andre Hedrick <andre@linux-ide.org>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/pci.h>
index ea3c52cc8ac1cf5c55aad7d31267d6f5d2142a00..079f7c86726b118c334bfd6f42607a1924e27ee8 100644 (file)
@@ -32,7 +32,6 @@
  *
  */
  
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 09269e574b3e6e66a6db38df68404200af1ef197..380bb28c7c54aad4a6d99eefa5931e47f1459786 100644 (file)
@@ -14,7 +14,6 @@
  *     CS5530 documentation available from National Semiconductor.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 6eb305197f3c1a18955a29e7e523d45400f94a5b..5c5aec28e6717f3d9e7c81d243bc711ebf8b455b 100644 (file)
@@ -23,7 +23,6 @@
  *  CS5535 documentation available from AMD
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/ide.h>
index 9f41ecd563385c500d74378c17761436b2549e75..120929fbe7a37c652b0e6aa0d8189ffa1cc21990 100644 (file)
@@ -44,7 +44,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/pci.h>
index 7da550281cf23a112d61b6cc68d946ad0e540d19..b46cb042290abc59fe9059fa0cb36c38f9e8b3bf 100644 (file)
@@ -24,7 +24,6 @@
  * Non-bootable card or HPT343 :: pcicmd == 0x05
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 940bdd4c5784bf80092bac207c75df2352f5c32b..e993a51f250e5fa026c718d5f66091cd2952a5d2 100644 (file)
@@ -55,7 +55,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
index 93462926b9d5e0d208066a0a20d4926e38cf2248..0fc89fafad656d920b26431bde60e5554fd2923c 100644 (file)
@@ -28,7 +28,6 @@
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 38f41b377ff6f322d1ba5a1276ba00d5024fd518..3cb04424d351dcb9f88e0163a120ea103983b19c 100644 (file)
@@ -62,7 +62,6 @@
  *     -       Move to libata once it grows up
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/pci.h>
@@ -651,6 +650,8 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif)
        }
        ide_set_hwifdata(hwif, idev);
 
+       hwif->atapi_dma = 1;
+
        pci_read_config_byte(hwif->pci_dev, 0x50, &conf);
        if(conf & 1) {
                idev->smart = 1;
index fcd5142f5cfe1fa7108269c008ac20f1c878a1c2..d95714bcee4e92ab30d1255e4328f245451df76e 100644 (file)
@@ -9,7 +9,6 @@
  * Inspired by an earlier effort from David S. Miller <davem@redhat.com>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 5a8334d134fbda2d1caebb0ab0ea4e93444f80e9..6c097e80b4dff9716b4ad0220fa520b101991389 100644 (file)
@@ -14,7 +14,6 @@
  *  Released under terms of General Public License
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 1e209d8f9437f4e04199bc8b4365d4c48bd0f298..b46022a11bef82a2576d0e684282780ba814e0d6 100644 (file)
@@ -28,7 +28,6 @@
  *  Released under terms of General Public License
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
index 7fac6f57b5d625aaa3eb0056c6d448149b1eba6c..50332ddd5ddb9d3a2efd3617760cfb9191ae0f8a 100644 (file)
@@ -90,7 +90,6 @@
  *     ICH3    errata #18      - Don't use native mode
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
index 778b82ae964de770e81acef1c00eb18e20f5f8b6..fc2b5496b6d251a611bd3200baf733d8263e1f23 100644 (file)
@@ -11,7 +11,6 @@
  *     Available from National Semiconductor
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 5100b827a935213dcd737703d928b150d96f6033..03677bff0d726ba386ee6252a27c5bf34a477396 100644 (file)
@@ -29,7 +29,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
index 72dade14c725996acc24af25143df12eb7449c63..25ceb4a39ed21d96cdefdede5c90e1a192214f1c 100644 (file)
@@ -27,7 +27,6 @@
  *     if neccessary
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/pci.h>
index 8e9d87701ce245f4eb15ed4a370c4e2f4ba22111..8a6c23ac8cc1c556b0771ae5ae05ebf5f5d8c6bf 100644 (file)
@@ -44,7 +44,6 @@
  * 962/963.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
index 900301e43818bee500a9884870be937a6e9d1f16..0b4b604985153a4915aba1635c3e2ebaad14b638 100644 (file)
@@ -13,7 +13,6 @@
  *  -- Benjamin Herrenschmidt (01/11/03) benh@kernel.crashing.org
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
index 0968f6bc669a5684b7ba3f3e0205a2e03e250400..4a1853af3bbb774caaecdd18141424dfc5170e59 100644 (file)
@@ -8,7 +8,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
index f96b56838f339fb33de1d7d6b26972628c88daf2..56d84931d6de32ad3c819f95fe0b322c5cad8ca3 100644 (file)
@@ -27,7 +27,6 @@
  *     Not publically available.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
index fe80295974e15b5a4269e05bf672ca4851ccae15..2a282529bfc1abe46412398c65a89025adf29737 100644 (file)
  *
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
index 3e677c4f8c285f2663a6e2774e9c04830fc78be3..afdaee3c15c936147fd821aa5384375cdfd05877 100644 (file)
@@ -26,7 +26,6 @@
  * the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/ioport.h>
index b80c6135ae932f37c1c4be90f032a50748eb948f..0ac9da3a7378b327c21e66c96d2d29765a993d9d 100644 (file)
@@ -11,7 +11,6 @@
  *     by Mathew Locke <mattl@mvista.com>
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index e8ef3455ec356e4c9bf835f42532cb62cf57bea9..ebf961f1718d8428d64f048f67212016d9b46fd8 100644 (file)
@@ -22,7 +22,6 @@
  * big table
  * 
  */
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index c11e3b2e67a6b46711a16fea70e1abdc47e49b74..eb0945284accec16b4c0ff0075c504da59f34a35 100644 (file)
@@ -18,7 +18,6 @@
  *  configuration of all PCI IDE interfaces present in a system.  
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 1017fd7172486dd3058694ca22368b973f707469..e2de6fa0c9fe817d3bc26b2bd0101cc9c55e61f1 100644 (file)
@@ -9,7 +9,6 @@
  * directory of the kernel sources for details.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 
 #include "csr1212.h"
index 85c2d4ca0def60087a1b11120b98538e1da0f240..87532dd43374f9625d9f06693503a63c07a2758f 100644 (file)
@@ -83,7 +83,6 @@
 
 */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/list.h>
 #include <linux/slab.h>
index 25b22609e793a8880c53ef9d06ff87201ca4c3f4..694da82d820b5c7012d004dd14fa1c31bb934bce 100644 (file)
@@ -17,7 +17,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/slab.h>
 #include <linux/list.h>
 #include <linux/bitops.h>
index ad49c040b6749017b877bd5607816725820ee7f7..4feead4a35c5b7b404b2aacee5e2282f1dd4cd52 100644 (file)
@@ -10,7 +10,6 @@
  * directory of the kernel sources for details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/list.h>
@@ -108,6 +107,14 @@ static int alloc_hostnum_cb(struct hpsb_host *host, void *__data)
  */
 static DEFINE_MUTEX(host_num_alloc);
 
+/*
+ * The pending_packet_queue is special in that it's processed
+ * from hardirq context too (such as hpsb_bus_reset()). Hence
+ * split the lock class from the usual networking skb-head
+ * lock class by using a separate key for it:
+ */
+static struct lock_class_key pending_packet_queue_key;
+
 struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra,
                                  struct device *dev)
 {
@@ -129,6 +136,8 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra,
        h->driver = drv;
 
        skb_queue_head_init(&h->pending_packet_queue);
+       lockdep_set_class(&h->pending_packet_queue.lock,
+                          &pending_packet_queue_key);
        INIT_LIST_HEAD(&h->addr_space);
 
        for (i = 2; i < 16; i++)
index 49354de9fb8a6cd31702977c10b896d2d11fd09e..f43739c5cab2ed11176c8493d4cf90de2e9a5f49 100644 (file)
@@ -20,7 +20,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/list.h>
 #include <linux/string.h>
index 50c71e17de73701e4dbb175f4a99f527bc64dce6..d541b508a159b8103c128a0cc4f3d76d9bdd6d6a 100644 (file)
@@ -10,7 +10,6 @@
 
 #include <linux/bitmap.h>
 #include <linux/kernel.h>
-#include <linux/config.h>
 #include <linux/list.h>
 #include <linux/slab.h>
 #include <linux/smp_lock.h>
index 800c8d5184302b0195f5ab1f34783d718523e192..d4bad6704bbe2dcf5d6f5ab6fcc4b0fd69f2080b 100644 (file)
@@ -82,7 +82,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/list.h>
 #include <linux/slab.h>
@@ -3393,12 +3392,12 @@ static int __devinit ohci1394_pci_probe(struct pci_dev *dev,
        spin_lock_init(&ohci->event_lock);
 
        /*
-        * interrupts are disabled, all right, but... due to SA_SHIRQ we
+        * interrupts are disabled, all right, but... due to IRQF_SHARED we
         * might get called anyway.  We'll see no event, of course, but
         * we need to get to that "no event", so enough should be initialized
         * by that point.
         */
-       if (request_irq(dev->irq, ohci_irq_handler, SA_SHIRQ,
+       if (request_irq(dev->irq, ohci_irq_handler, IRQF_SHARED,
                         OHCI1394_DRIVER_NAME, ohci))
                FAIL(-ENOMEM, "Failed to allocate shared interrupt %d", dev->irq);
 
index d50dc7a2d087f21e9d461a35785122d35bbed27a..b9d0e8f10abb3287c370c909e2154a2dca4fc111 100644 (file)
@@ -3,7 +3,6 @@
 cat <<EOF
 /* Generated file for OUI database */
 
-#include <linux/config.h>
 
 #ifdef CONFIG_IEEE1394_OUI_DB
 struct oui_list_struct {
index e29dfd280bee0b550ebd1a94f1b0519cfd0f177b..e6f41238f5e8c6c2f579cb5de5ae1fe0d66ce224 100644 (file)
@@ -30,7 +30,6 @@
  *        Enhancements in async and iso send code
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
@@ -1254,7 +1253,7 @@ static int __devinit add_card(struct pci_dev *dev,
 
        sprintf (irq_buf, "%d", dev->irq);
 
-        if (!request_irq(dev->irq, lynx_irq_handler, SA_SHIRQ,
+        if (!request_irq(dev->irq, lynx_irq_handler, IRQF_SHARED,
                          PCILYNX_DRIVER_NAME, lynx)) {
                 PRINT(KERN_INFO, lynx->id, "allocated interrupt %s", irq_buf);
                 lynx->state = have_intr;
index d631aa8383ada2311102469f6fb545fce1e88b70..ec27321f6724e507ec2a79febf03025d6dec1fe5 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef __PCILYNX_H__
 #define __PCILYNX_H__
 
-#include <linux/config.h>
 
 #define PCILYNX_DRIVER_NAME      "pcilynx"
 #define PCILYNX_MAJOR            177
index 1d5ceb7ecc8329a22a5d7a3b34ea8fd4a1d8dcd6..aaa74f293aaf4279353c77404ba9f38ac2c98663 100644 (file)
@@ -38,7 +38,6 @@
  *       but the code needs additional debugging.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/list.h>
 #include <linux/string.h>
index 295d0f8c3d061513fbcfc76967deb7e1024626fd..c6e3f02bc6d74a731fd36ed3e6616e9d839c72bd 100644 (file)
@@ -28,7 +28,6 @@
  * ENOTTY for unsupported ioctl request
  *
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/list.h>
 #include <linux/slab.h>
index 450adfe0a4f1c5e4ed847c340e111ca62d000cbb..3f6705f3083ac65e7e501e9b7fa8b9cd403c587b 100644 (file)
@@ -3152,6 +3152,7 @@ static int cm_init_qp_rtr_attr(struct cm_id_private *cm_id_priv,
                }
                if (cm_id_priv->alt_av.ah_attr.dlid) {
                        *qp_attr_mask |= IB_QP_ALT_PATH;
+                       qp_attr->alt_port_num = cm_id_priv->alt_av.port->port_num;
                        qp_attr->alt_ah_attr = cm_id_priv->alt_av.ah_attr;
                }
                ret = 0;
index a908a7bdcd7fb09d44dfe94b1d0bd171168cb283..bdf5d5098190b7f6e9a2bd6312fd5c413d97d6aa 100644 (file)
@@ -1963,7 +1963,7 @@ ssize_t ib_uverbs_create_srq(struct ib_uverbs_file *file,
        if (!obj)
                return -ENOMEM;
 
-       init_uobj(&obj->uobject, 0, file->ucontext);
+       init_uobj(&obj->uobject, cmd.user_handle, file->ucontext);
        down_write(&obj->uobject.mutex);
 
        pd  = idr_read_pd(cmd.pd_handle, file->ucontext);
index 9ea67c409b6d4a83e32cbd76b06532c764e03a5b..1db9489f1e82bbc7ae0d10a934af5961a94397df 100644 (file)
@@ -1,16 +1,16 @@
 config IPATH_CORE
-       tristate "PathScale InfiniPath Driver"
+       tristate "QLogic InfiniPath Driver"
        depends on 64BIT && PCI_MSI && NET
        ---help---
-       This is a low-level driver for PathScale InfiniPath host channel
+       This is a low-level driver for QLogic InfiniPath host channel
        adapters (HCAs) based on the HT-400 and PE-800 chips.
 
 config INFINIBAND_IPATH
-       tristate "PathScale InfiniPath Verbs Driver"
+       tristate "QLogic InfiniPath Verbs Driver"
        depends on IPATH_CORE && INFINIBAND
        ---help---
        This is a driver that provides InfiniBand verbs support for
-       PathScale InfiniPath host channel adapters (HCAs).  This
+       QLogic InfiniPath host channel adapters (HCAs).  This
        allows these devices to be used with both kernel upper level
        protocols such as IP-over-InfiniBand as well as with userspace
        applications (in conjunction with InfiniBand userspace access).
index b4d084abfd22c3ace2a33198ec8cb63e09b98018..b0bf72864130e03945c0da8117d713f12b5b0302 100644 (file)
@@ -1,4 +1,4 @@
-EXTRA_CFLAGS += -DIPATH_IDSTR='"PathScale kernel.org driver"' \
+EXTRA_CFLAGS += -DIPATH_IDSTR='"QLogic kernel.org driver"' \
        -DIPATH_KERN_TYPE=0
 
 obj-$(CONFIG_IPATH_CORE) += ipath_core.o
index 48a55247b832df8b4aa08a2595b6f32814b357d0..062bd392e7e55d22e8d5bf95d057e8af2eb68c78 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -38,7 +39,8 @@
  * to communicate between kernel and user code.
  */
 
-/* This is the IEEE-assigned OUI for PathScale, Inc. */
+
+/* This is the IEEE-assigned OUI for QLogic Inc. InfiniPath */
 #define IPATH_SRC_OUI_1 0x00
 #define IPATH_SRC_OUI_2 0x11
 #define IPATH_SRC_OUI_3 0x75
@@ -96,8 +98,8 @@ struct infinipath_stats {
        __u64 sps_hwerrs;
        /* number of times IB link changed state unexpectedly */
        __u64 sps_iblink;
-       /* no longer used; left for compatibility */
-       __u64 sps_unused3;
+       /* kernel receive interrupts that didn't read intstat */
+       __u64 sps_fastrcvint;
        /* number of kernel (port0) packets received */
        __u64 sps_port0pkts;
        /* number of "ethernet" packets sent by driver */
@@ -121,8 +123,7 @@ struct infinipath_stats {
        __u64 sps_ports;
        /* list of pkeys (other than default) accepted (0 means not set) */
        __u16 sps_pkeys[4];
-       /* lids for up to 4 infinipaths, indexed by infinipath # */
-       __u16 sps_lid[4];
+       __u16 sps_unused16[4]; /* available; maintaining compatible layout */
        /* number of user ports per chip (not IB ports) */
        __u32 sps_nports;
        /* not our interrupt, or already handled */
@@ -140,10 +141,8 @@ struct infinipath_stats {
         * packets if ipath not configured, sma/mad, etc.)
         */
        __u64 sps_krdrops;
-       /* mlids for up to 4 infinipaths, indexed by infinipath # */
-       __u16 sps_mlid[4];
        /* pad for future growth */
-       __u64 __sps_pad[45];
+       __u64 __sps_pad[46];
 };
 
 /*
@@ -310,6 +309,9 @@ struct ipath_base_info {
        __u32 spi_rcv_egrchunksize;
        /* total size of mmap to cover full rcvegrbuffers */
        __u32 spi_rcv_egrbuftotlen;
+       __u32 spi_filler_for_align;
+       /* address of readonly memory copy of the rcvhdrq tail register. */
+       __u64 spi_rcvhdr_tailaddr;
 } __attribute__ ((aligned(8)));
 
 
@@ -342,9 +344,9 @@ struct ipath_base_info {
 /*
  * Similarly, this is the kernel version going back to the user.  It's
  * slightly different, in that we want to tell if the driver was built as
- * part of a PathScale release, or from the driver from OpenIB, kernel.org,
- * or a standard distribution, for support reasons.  The high bit is 0 for
- * non-PathScale, and 1 for PathScale-built/supplied.
+ * part of a QLogic release, or from the driver from openfabrics.org,
+ * kernel.org, or a standard distribution, for support reasons.
+ * The high bit is 0 for non-QLogic and 1 for QLogic-built/supplied.
  *
  * It's returned by the driver to the user code during initialization in the
  * spi_sw_version field of ipath_base_info, so the user code can in turn
@@ -379,13 +381,7 @@ struct ipath_user_info {
         */
        __u32 spu_rcvhdrsize;
 
-       /*
-        * cache line aligned (64 byte) user address to
-        * which the rcvhdrtail register will be written by infinipath
-        * whenever it changes, so that no chip registers are read in
-        * the performance path.
-        */
-       __u64 spu_rcvhdraddr;
+       __u64 spu_unused; /* kept for compatible layout */
 
        /*
         * address of struct base_info to write to
@@ -481,7 +477,7 @@ struct ipath_sma_pkt
  * Data layout in I2C flash (for GUID, etc.)
  * All fields are little-endian binary unless otherwise stated
  */
-#define IPATH_FLASH_VERSION 1
+#define IPATH_FLASH_VERSION 2
 struct ipath_flash {
        /* flash layout version (IPATH_FLASH_VERSION) */
        __u8 if_fversion;
@@ -489,14 +485,14 @@ struct ipath_flash {
        __u8 if_csum;
        /*
         * valid length (in use, protected by if_csum), including
-        * if_fversion and if_sum themselves)
+        * if_fversion and if_csum themselves)
         */
        __u8 if_length;
        /* the GUID, in network order */
        __u8 if_guid[8];
        /* number of GUIDs to use, starting from if_guid */
        __u8 if_numguid;
-       /* the board serial number, in ASCII */
+       /* the (last 10 characters of) board serial number, in ASCII */
        char if_serial[12];
        /* board mfg date (YYYYMMDD ASCII) */
        char if_mfgdate[8];
@@ -508,8 +504,10 @@ struct ipath_flash {
        __u8 if_powerhour[2];
        /* ASCII free-form comment field */
        char if_comment[32];
-       /* 78 bytes used, min flash size is 128 bytes */
-       __u8 if_future[50];
+       /* Backwards compatible prefix for longer QLogic Serial Numbers */
+       char if_sprefix[4];
+       /* 82 bytes used, min flash size is 128 bytes */
+       __u8 if_future[46];
 };
 
 /*
@@ -603,14 +601,118 @@ struct infinipath_counters {
 #define INFINIPATH_KPF_INTR 0x1
 
 /* SendPIO per-buffer control */
-#define INFINIPATH_SP_LENGTHP1_MASK 0x3FF
-#define INFINIPATH_SP_LENGTHP1_SHIFT 0
-#define INFINIPATH_SP_INTR    0x80000000
-#define INFINIPATH_SP_TEST    0x40000000
-#define INFINIPATH_SP_TESTEBP 0x20000000
+#define INFINIPATH_SP_TEST    0x40
+#define INFINIPATH_SP_TESTEBP 0x20
 
 /* SendPIOAvail bits */
 #define INFINIPATH_SENDPIOAVAIL_BUSY_SHIFT 1
 #define INFINIPATH_SENDPIOAVAIL_CHECK_SHIFT 0
 
+/* infinipath header format */
+struct ipath_header {
+       /*
+        * Version - 4 bits, Port - 4 bits, TID - 10 bits and Offset -
+        * 14 bits before ECO change ~28 Dec 03.  After that, Vers 4,
+        * Port 3, TID 11, offset 14.
+        */
+       __le32 ver_port_tid_offset;
+       __le16 chksum;
+       __le16 pkt_flags;
+};
+
+/* infinipath user message header format.
+ * This structure contains the first 4 fields common to all protocols
+ * that employ infinipath.
+ */
+struct ipath_message_header {
+       __be16 lrh[4];
+       __be32 bth[3];
+       /* fields below this point are in host byte order */
+       struct ipath_header iph;
+       __u8 sub_opcode;
+};
+
+/* infinipath ethernet header format */
+struct ether_header {
+       __be16 lrh[4];
+       __be32 bth[3];
+       struct ipath_header iph;
+       __u8 sub_opcode;
+       __u8 cmd;
+       __be16 lid;
+       __u16 mac[3];
+       __u8 frag_num;
+       __u8 seq_num;
+       __le32 len;
+       /* MUST be of word size due to PIO write requirements */
+       __le32 csum;
+       __le16 csum_offset;
+       __le16 flags;
+       __u16 first_2_bytes;
+       __u8 unused[2];         /* currently unused */
+};
+
+
+/* IB - LRH header consts */
+#define IPATH_LRH_GRH 0x0003   /* 1. word of IB LRH - next header: GRH */
+#define IPATH_LRH_BTH 0x0002   /* 1. word of IB LRH - next header: BTH */
+
+/* misc. */
+#define SIZE_OF_CRC 1
+
+#define IPATH_DEFAULT_P_KEY 0xFFFF
+#define IPATH_PERMISSIVE_LID 0xFFFF
+#define IPATH_AETH_CREDIT_SHIFT 24
+#define IPATH_AETH_CREDIT_MASK 0x1F
+#define IPATH_AETH_CREDIT_INVAL 0x1F
+#define IPATH_PSN_MASK 0xFFFFFF
+#define IPATH_MSN_MASK 0xFFFFFF
+#define IPATH_QPN_MASK 0xFFFFFF
+#define IPATH_MULTICAST_LID_BASE 0xC000
+#define IPATH_MULTICAST_QPN 0xFFFFFF
+
+/* Receive Header Queue: receive type (from infinipath) */
+#define RCVHQ_RCV_TYPE_EXPECTED  0
+#define RCVHQ_RCV_TYPE_EAGER     1
+#define RCVHQ_RCV_TYPE_NON_KD    2
+#define RCVHQ_RCV_TYPE_ERROR     3
+
+
+/* sub OpCodes - ith4x  */
+#define IPATH_ITH4X_OPCODE_ENCAP 0x81
+#define IPATH_ITH4X_OPCODE_LID_ARP 0x82
+
+#define IPATH_HEADER_QUEUE_WORDS 9
+
+/* functions for extracting fields from rcvhdrq entries for the driver.
+ */
+static inline __u32 ipath_hdrget_err_flags(const __le32 * rbuf)
+{
+       return __le32_to_cpu(rbuf[1]);
+}
+
+static inline __u32 ipath_hdrget_rcv_type(const __le32 * rbuf)
+{
+       return (__le32_to_cpu(rbuf[0]) >> INFINIPATH_RHF_RCVTYPE_SHIFT)
+           & INFINIPATH_RHF_RCVTYPE_MASK;
+}
+
+static inline __u32 ipath_hdrget_length_in_bytes(const __le32 * rbuf)
+{
+       return ((__le32_to_cpu(rbuf[0]) >> INFINIPATH_RHF_LENGTH_SHIFT)
+               & INFINIPATH_RHF_LENGTH_MASK) << 2;
+}
+
+static inline __u32 ipath_hdrget_index(const __le32 * rbuf)
+{
+       return (__le32_to_cpu(rbuf[0]) >> INFINIPATH_RHF_EGRINDEX_SHIFT)
+           & INFINIPATH_RHF_EGRINDEX_MASK;
+}
+
+static inline __u32 ipath_hdrget_ipath_ver(__le32 hdrword)
+{
+       return (__le32_to_cpu(hdrword) >> INFINIPATH_I_VERS_SHIFT)
+           & INFINIPATH_I_VERS_MASK;
+}
+
 #endif                         /* _IPATH_COMMON_H */
index 7ece1135ddfe8680981352f6bc356bee28014332..3efee341c9bcddcf31c1401a3b38ac17c3e6f641 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -157,10 +158,21 @@ struct ib_cq *ipath_create_cq(struct ib_device *ibdev, int entries,
                              struct ib_ucontext *context,
                              struct ib_udata *udata)
 {
+       struct ipath_ibdev *dev = to_idev(ibdev);
        struct ipath_cq *cq;
        struct ib_wc *wc;
        struct ib_cq *ret;
 
+       if (entries > ib_ipath_max_cqes) {
+               ret = ERR_PTR(-EINVAL);
+               goto bail;
+       }
+
+       if (dev->n_cqs_allocated == ib_ipath_max_cqs) {
+               ret = ERR_PTR(-ENOMEM);
+               goto bail;
+       }
+
        /*
         * Need to use vmalloc() if we want to support large #s of
         * entries.
@@ -196,6 +208,8 @@ struct ib_cq *ipath_create_cq(struct ib_device *ibdev, int entries,
 
        ret = &cq->ibcq;
 
+       dev->n_cqs_allocated++;
+
 bail:
        return ret;
 }
@@ -210,9 +224,11 @@ bail:
  */
 int ipath_destroy_cq(struct ib_cq *ibcq)
 {
+       struct ipath_ibdev *dev = to_idev(ibcq->device);
        struct ipath_cq *cq = to_icq(ibcq);
 
        tasklet_kill(&cq->comptask);
+       dev->n_cqs_allocated--;
        vfree(cq->queue);
        kfree(cq);
 
index 46762387f5f8e29fd65642a6d34d86a5353a5c08..f415beda0d32bd3e2c7809468625e10e90a3f862 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
index 28ddceb260e895dd88863e5995e4dbb6df1dbd9e..147dd89e21c901267c8799467f55fdfb2eb29e97 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
 #include <linux/pci.h>
 #include <asm/uaccess.h>
 
-#include "ipath_common.h"
 #include "ipath_kernel.h"
-#include "ips_common.h"
 #include "ipath_layer.h"
+#include "ipath_common.h"
 
 int ipath_diag_inuse;
 static int diag_set_link;
@@ -66,18 +66,20 @@ static struct file_operations diag_file_ops = {
        .release = ipath_diag_release
 };
 
-static struct cdev *diag_cdev;
-static struct class_device *diag_class_dev;
-
-int ipath_diag_init(void)
+int ipath_diag_add(struct ipath_devdata *dd)
 {
-       return ipath_cdev_init(IPATH_DIAG_MINOR, "ipath_diag",
-                              &diag_file_ops, &diag_cdev, &diag_class_dev);
+       char name[16];
+
+       snprintf(name, sizeof(name), "ipath_diag%d", dd->ipath_unit);
+
+       return ipath_cdev_init(IPATH_DIAG_MINOR_BASE + dd->ipath_unit, name,
+                              &diag_file_ops, &dd->diag_cdev,
+                              &dd->diag_class_dev);
 }
 
-void ipath_diag_cleanup(void)
+void ipath_diag_remove(struct ipath_devdata *dd)
 {
-       ipath_cdev_cleanup(&diag_cdev, &diag_class_dev);
+       ipath_cdev_cleanup(&dd->diag_cdev, &dd->diag_class_dev);
 }
 
 /**
@@ -101,8 +103,7 @@ static int ipath_read_umem64(struct ipath_devdata *dd, void __user *uaddr,
        int ret;
 
        /* not very efficient, but it works for now */
-       if (reg_addr < dd->ipath_kregbase ||
-           reg_end > dd->ipath_kregend) {
+       if (reg_addr < dd->ipath_kregbase || reg_end > dd->ipath_kregend) {
                ret = -EINVAL;
                goto bail;
        }
@@ -113,7 +114,7 @@ static int ipath_read_umem64(struct ipath_devdata *dd, void __user *uaddr,
                        goto bail;
                }
                reg_addr++;
-               uaddr++;
+               uaddr += sizeof(u64);
        }
        ret = 0;
 bail:
@@ -139,8 +140,7 @@ static int ipath_write_umem64(struct ipath_devdata *dd, void __iomem *caddr,
        int ret;
 
        /* not very efficient, but it works for now */
-       if (reg_addr < dd->ipath_kregbase ||
-           reg_end > dd->ipath_kregend) {
+       if (reg_addr < dd->ipath_kregbase || reg_end > dd->ipath_kregend) {
                ret = -EINVAL;
                goto bail;
        }
@@ -153,7 +153,7 @@ static int ipath_write_umem64(struct ipath_devdata *dd, void __iomem *caddr,
                writeq(data, reg_addr);
 
                reg_addr++;
-               uaddr++;
+               uaddr += sizeof(u64);
        }
        ret = 0;
 bail:
@@ -191,7 +191,8 @@ static int ipath_read_umem32(struct ipath_devdata *dd, void __user *uaddr,
                }
 
                reg_addr++;
-               uaddr++;
+               uaddr += sizeof(u32);
+
        }
        ret = 0;
 bail:
@@ -230,7 +231,7 @@ static int ipath_write_umem32(struct ipath_devdata *dd, void __iomem *caddr,
                writel(data, reg_addr);
 
                reg_addr++;
-               uaddr++;
+               uaddr += sizeof(u32);
        }
        ret = 0;
 bail:
@@ -239,59 +240,45 @@ bail:
 
 static int ipath_diag_open(struct inode *in, struct file *fp)
 {
+       int unit = iminor(in) - IPATH_DIAG_MINOR_BASE;
        struct ipath_devdata *dd;
-       int unit = 0; /* XXX this is bogus */
-       unsigned long flags;
        int ret;
 
-       dd = ipath_lookup(unit);
-
        mutex_lock(&ipath_mutex);
-       spin_lock_irqsave(&ipath_devs_lock, flags);
 
        if (ipath_diag_inuse) {
                ret = -EBUSY;
                goto bail;
        }
 
-       list_for_each_entry(dd, &ipath_dev_list, ipath_list) {
-               /*
-                * we need at least one infinipath device to be present
-                * (don't use INITTED, because we want to be able to open
-                * even if device is in freeze mode, which cleared INITTED).
-                * There is a small amount of risk to this, which is why we
-                * also verify kregbase is set.
-                */
-
-               if (!(dd->ipath_flags & IPATH_PRESENT) ||
-                   !dd->ipath_kregbase)
-                       continue;
-
-               ipath_diag_inuse = 1;
-               diag_set_link = 0;
-               ret = 0;
+       dd = ipath_lookup(unit);
+
+       if (dd == NULL || !(dd->ipath_flags & IPATH_PRESENT) ||
+           !dd->ipath_kregbase) {
+               ret = -ENODEV;
                goto bail;
        }
 
-       ret = -ENODEV;
-
-bail:
-       spin_unlock_irqrestore(&ipath_devs_lock, flags);
+       fp->private_data = dd;
+       ipath_diag_inuse = 1;
+       diag_set_link = 0;
+       ret = 0;
 
        /* Only expose a way to reset the device if we
           make it into diag mode. */
-       if (ret == 0)
-               ipath_expose_reset(&dd->pcidev->dev);
+       ipath_expose_reset(&dd->pcidev->dev);
 
+bail:
        mutex_unlock(&ipath_mutex);
 
        return ret;
 }
 
-static int ipath_diag_release(struct inode *i, struct file *f)
+static int ipath_diag_release(struct inode *in, struct file *fp)
 {
        mutex_lock(&ipath_mutex);
        ipath_diag_inuse = 0;
+       fp->private_data = NULL;
        mutex_unlock(&ipath_mutex);
        return 0;
 }
@@ -299,17 +286,10 @@ static int ipath_diag_release(struct inode *i, struct file *f)
 static ssize_t ipath_diag_read(struct file *fp, char __user *data,
                               size_t count, loff_t *off)
 {
-       int unit = 0; /* XXX provide for reads on other units some day */
-       struct ipath_devdata *dd;
+       struct ipath_devdata *dd = fp->private_data;
        void __iomem *kreg_base;
        ssize_t ret;
 
-       dd = ipath_lookup(unit);
-       if (!dd) {
-               ret = -ENODEV;
-               goto bail;
-       }
-
        kreg_base = dd->ipath_kregbase;
 
        if (count == 0)
@@ -328,23 +308,16 @@ static ssize_t ipath_diag_read(struct file *fp, char __user *data,
                ret = count;
        }
 
-bail:
        return ret;
 }
 
 static ssize_t ipath_diag_write(struct file *fp, const char __user *data,
                                size_t count, loff_t *off)
 {
-       int unit = 0; /* XXX this is bogus */
-       struct ipath_devdata *dd;
+       struct ipath_devdata *dd = fp->private_data;
        void __iomem *kreg_base;
        ssize_t ret;
 
-       dd = ipath_lookup(unit);
-       if (!dd) {
-               ret = -ENODEV;
-               goto bail;
-       }
        kreg_base = dd->ipath_kregbase;
 
        if (count == 0)
@@ -363,6 +336,5 @@ static ssize_t ipath_diag_write(struct file *fp, const char __user *data,
                ret = count;
        }
 
-bail:
        return ret;
 }
index e4b897fa569a5e945841fee575e1db1706f4ecd4..823131d58b34f67dc05055934c97434b3999ee20 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -38,8 +39,8 @@
 #include <linux/vmalloc.h>
 
 #include "ipath_kernel.h"
-#include "ips_common.h"
 #include "ipath_layer.h"
+#include "ipath_common.h"
 
 static void ipath_update_pio_bufs(struct ipath_devdata *);
 
@@ -52,7 +53,7 @@ const char *ipath_get_unit_name(int unit)
 
 EXPORT_SYMBOL_GPL(ipath_get_unit_name);
 
-#define DRIVER_LOAD_MSG "PathScale " IPATH_DRV_NAME " loaded: "
+#define DRIVER_LOAD_MSG "QLogic " IPATH_DRV_NAME " loaded: "
 #define PFX IPATH_DRV_NAME ": "
 
 /*
@@ -74,8 +75,8 @@ MODULE_PARM_DESC(debug, "mask for debug prints");
 EXPORT_SYMBOL_GPL(ipath_debug);
 
 MODULE_LICENSE("GPL");
-MODULE_AUTHOR("PathScale <support@pathscale.com>");
-MODULE_DESCRIPTION("Pathscale InfiniPath driver");
+MODULE_AUTHOR("QLogic <support@pathscale.com>");
+MODULE_DESCRIPTION("QLogic InfiniPath driver");
 
 const char *ipath_ibcstatus_str[] = {
        "Disabled",
@@ -130,14 +131,6 @@ static struct pci_driver ipath_driver = {
        .id_table = ipath_pci_tbl,
 };
 
-/*
- * This is where port 0's rcvhdrtail register is written back; we also
- * want nothing else sharing the cache line, so make it a cache line
- * in size.  Used for all units.
- */
-volatile __le64 *ipath_port0_rcvhdrtail;
-dma_addr_t ipath_port0_rcvhdrtail_dma;
-static int port0_rcvhdrtail_refs;
 
 static inline void read_bars(struct ipath_devdata *dd, struct pci_dev *dev,
                             u32 *bar0, u32 *bar1)
@@ -170,14 +163,13 @@ static void ipath_free_devdata(struct pci_dev *pdev,
                list_del(&dd->ipath_list);
                spin_unlock_irqrestore(&ipath_devs_lock, flags);
        }
-       dma_free_coherent(&pdev->dev, sizeof(*dd), dd, dd->ipath_dma_addr);
+       vfree(dd);
 }
 
 static struct ipath_devdata *ipath_alloc_devdata(struct pci_dev *pdev)
 {
        unsigned long flags;
        struct ipath_devdata *dd;
-       dma_addr_t dma_addr;
        int ret;
 
        if (!idr_pre_get(&unit_table, GFP_KERNEL)) {
@@ -185,15 +177,12 @@ static struct ipath_devdata *ipath_alloc_devdata(struct pci_dev *pdev)
                goto bail;
        }
 
-       dd = dma_alloc_coherent(&pdev->dev, sizeof(*dd), &dma_addr,
-                               GFP_KERNEL);
-
+       dd = vmalloc(sizeof(*dd));
        if (!dd) {
                dd = ERR_PTR(-ENOMEM);
                goto bail;
        }
-
-       dd->ipath_dma_addr = dma_addr;
+       memset(dd, 0, sizeof(*dd));
        dd->ipath_unit = -1;
 
        spin_lock_irqsave(&ipath_devs_lock, flags);
@@ -271,47 +260,6 @@ int ipath_count_units(int *npresentp, int *nupp, u32 *maxportsp)
        return nunits;
 }
 
-static int init_port0_rcvhdrtail(struct pci_dev *pdev)
-{
-       int ret;
-
-       mutex_lock(&ipath_mutex);
-
-       if (!ipath_port0_rcvhdrtail) {
-               ipath_port0_rcvhdrtail =
-                       dma_alloc_coherent(&pdev->dev,
-                                          IPATH_PORT0_RCVHDRTAIL_SIZE,
-                                          &ipath_port0_rcvhdrtail_dma,
-                                          GFP_KERNEL);
-
-               if (!ipath_port0_rcvhdrtail) {
-                       ret = -ENOMEM;
-                       goto bail;
-               }
-       }
-       port0_rcvhdrtail_refs++;
-       ret = 0;
-
-bail:
-       mutex_unlock(&ipath_mutex);
-
-       return ret;
-}
-
-static void cleanup_port0_rcvhdrtail(struct pci_dev *pdev)
-{
-       mutex_lock(&ipath_mutex);
-
-       if (!--port0_rcvhdrtail_refs) {
-               dma_free_coherent(&pdev->dev, IPATH_PORT0_RCVHDRTAIL_SIZE,
-                                 (void *) ipath_port0_rcvhdrtail,
-                                 ipath_port0_rcvhdrtail_dma);
-               ipath_port0_rcvhdrtail = NULL;
-       }
-
-       mutex_unlock(&ipath_mutex);
-}
-
 /*
  * These next two routines are placeholders in case we don't have per-arch
  * code for controlling write combining.  If explicit control of write
@@ -336,20 +284,12 @@ static int __devinit ipath_init_one(struct pci_dev *pdev,
        u32 bar0 = 0, bar1 = 0;
        u8 rev;
 
-       ret = init_port0_rcvhdrtail(pdev);
-       if (ret < 0) {
-               printk(KERN_ERR IPATH_DRV_NAME
-                      ": Could not allocate port0_rcvhdrtail: error %d\n",
-                      -ret);
-               goto bail;
-       }
-
        dd = ipath_alloc_devdata(pdev);
        if (IS_ERR(dd)) {
                ret = PTR_ERR(dd);
                printk(KERN_ERR IPATH_DRV_NAME
                       ": Could not allocate devdata: error %d\n", -ret);
-               goto bail_rcvhdrtail;
+               goto bail;
        }
 
        ipath_cdbg(VERBOSE, "initializing unit #%u\n", dd->ipath_unit);
@@ -424,12 +364,29 @@ static int __devinit ipath_init_one(struct pci_dev *pdev,
                 */
                ret = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
                if (ret) {
-                       dev_info(&pdev->dev, "pci_set_dma_mask unit %u "
-                                "fails: %d\n", dd->ipath_unit, ret);
+                       dev_info(&pdev->dev,
+                               "Unable to set DMA mask for unit %u: %d\n",
+                               dd->ipath_unit, ret);
                        goto bail_regions;
                }
-               else
+               else {
                        ipath_dbg("No 64bit DMA mask, used 32 bit mask\n");
+                       ret = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
+                       if (ret)
+                               dev_info(&pdev->dev,
+                                       "Unable to set DMA consistent mask "
+                                       "for unit %u: %d\n",
+                                       dd->ipath_unit, ret);
+
+               }
+       }
+       else {
+               ret = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK);
+               if (ret)
+                       dev_info(&pdev->dev,
+                               "Unable to set DMA consistent mask "
+                               "for unit %u: %d\n",
+                               dd->ipath_unit, ret);
        }
 
        pci_set_master(pdev);
@@ -452,7 +409,7 @@ static int __devinit ipath_init_one(struct pci_dev *pdev,
                ipath_init_pe800_funcs(dd);
                break;
        default:
-               ipath_dev_err(dd, "Found unknown PathScale deviceid 0x%x, "
+               ipath_dev_err(dd, "Found unknown QLogic deviceid 0x%x, "
                              "failing\n", ent->device);
                return -ENODEV;
        }
@@ -495,23 +452,23 @@ static int __devinit ipath_init_one(struct pci_dev *pdev,
                ((void __iomem *)dd->ipath_kregbase + len);
        dd->ipath_physaddr = addr;      /* used for io_remap, etc. */
        /* for user mmap */
-       dd->ipath_kregvirt = (u64 __iomem *) phys_to_virt(addr);
-       ipath_cdbg(VERBOSE, "mapped io addr %llx to kregbase %p "
-                  "kregvirt %p\n", addr, dd->ipath_kregbase,
-                  dd->ipath_kregvirt);
+       ipath_cdbg(VERBOSE, "mapped io addr %llx to kregbase %p\n",
+                  addr, dd->ipath_kregbase);
 
        /*
         * clear ipath_flags here instead of in ipath_init_chip as it is set
         * by ipath_setup_htconfig.
         */
        dd->ipath_flags = 0;
+       dd->ipath_lli_counter = 0;
+       dd->ipath_lli_errors = 0;
 
        if (dd->ipath_f_bus(dd, pdev))
                ipath_dev_err(dd, "Failed to setup config space; "
                              "continuing anyway\n");
 
        /*
-        * set up our interrupt handler; SA_SHIRQ probably not needed,
+        * set up our interrupt handler; IRQF_SHARED probably not needed,
         * since MSI interrupts shouldn't be shared but won't  hurt for now.
         * check 0 irq after we return from chip-specific bus setup, since
         * that can affect this due to setup
@@ -520,7 +477,7 @@ static int __devinit ipath_init_one(struct pci_dev *pdev,
                ipath_dev_err(dd, "irq is 0, BIOS error?  Interrupts won't "
                              "work\n");
        else {
-               ret = request_irq(pdev->irq, ipath_intr, SA_SHIRQ,
+               ret = request_irq(pdev->irq, ipath_intr, IRQF_SHARED,
                                  IPATH_DRV_NAME, dd);
                if (ret) {
                        ipath_dev_err(dd, "Couldn't setup irq handler, "
@@ -545,6 +502,7 @@ static int __devinit ipath_init_one(struct pci_dev *pdev,
        ipath_device_create_group(&pdev->dev, dd);
        ipathfs_add_device(dd);
        ipath_user_add(dd);
+       ipath_diag_add(dd);
        ipath_layer_add(dd);
 
        goto bail;
@@ -561,9 +519,6 @@ bail_disable:
 bail_devdata:
        ipath_free_devdata(pdev, dd);
 
-bail_rcvhdrtail:
-       cleanup_port0_rcvhdrtail(pdev);
-
 bail:
        return ret;
 }
@@ -577,8 +532,9 @@ static void __devexit ipath_remove_one(struct pci_dev *pdev)
                return;
 
        dd = pci_get_drvdata(pdev);
-       ipath_layer_del(dd);
-       ipath_user_del(dd);
+       ipath_layer_remove(dd);
+       ipath_diag_remove(dd);
+       ipath_user_remove(dd);
        ipathfs_remove_device(dd);
        ipath_device_remove_group(&pdev->dev, dd);
        ipath_cdbg(VERBOSE, "Releasing pci memory regions, dd %p, "
@@ -594,7 +550,6 @@ static void __devexit ipath_remove_one(struct pci_dev *pdev)
        pci_disable_device(pdev);
 
        ipath_free_devdata(pdev, dd);
-       cleanup_port0_rcvhdrtail(pdev);
 }
 
 /* general driver use */
@@ -868,7 +823,8 @@ static void ipath_rcv_layer(struct ipath_devdata *dd, u32 etail,
        u8 pad, *bthbytes;
        struct sk_buff *skb, *nskb;
 
-       if (dd->ipath_port0_skbs && hdr->sub_opcode == OPCODE_ENCAP) {
+       if (dd->ipath_port0_skbs &&
+                       hdr->sub_opcode == IPATH_ITH4X_OPCODE_ENCAP) {
                /*
                 * Allocate a new sk_buff to replace the one we give
                 * to the network stack.
@@ -899,7 +855,7 @@ static void ipath_rcv_layer(struct ipath_devdata *dd, u32 etail,
                /* another ether packet received */
                ipath_stats.sps_ether_rpkts++;
        }
-       else if (hdr->sub_opcode == OPCODE_LID_ARP)
+       else if (hdr->sub_opcode == IPATH_ITH4X_OPCODE_LID_ARP)
                __ipath_layer_rcv_lid(dd, hdr);
 }
 
@@ -916,8 +872,8 @@ void ipath_kreceive(struct ipath_devdata *dd)
        const u32 rsize = dd->ipath_rcvhdrentsize;      /* words */
        const u32 maxcnt = dd->ipath_rcvhdrcnt * rsize; /* words */
        u32 etail = -1, l, hdrqtail;
-       struct ips_message_header *hdr;
-       u32 eflags, i, etype, tlen, pkttot = 0;
+       struct ipath_message_header *hdr;
+       u32 eflags, i, etype, tlen, pkttot = 0, updegr=0, reloop=0;
        static u64 totcalls;    /* stats, may eventually remove */
        char emsg[128];
 
@@ -931,24 +887,18 @@ void ipath_kreceive(struct ipath_devdata *dd)
        if (test_and_set_bit(0, &dd->ipath_rcv_pending))
                goto bail;
 
-       if (dd->ipath_port0head ==
-           (u32)le64_to_cpu(*dd->ipath_hdrqtailptr))
+       l = dd->ipath_port0head;
+       hdrqtail = (u32) le64_to_cpu(*dd->ipath_hdrqtailptr);
+       if (l == hdrqtail)
                goto done;
 
-gotmore:
-       /*
-        * read only once at start.  If in flood situation, this helps
-        * performance slightly.  If more arrive while we are processing,
-        * we'll come back here and do them
-        */
-       hdrqtail = (u32)le64_to_cpu(*dd->ipath_hdrqtailptr);
-
-       for (i = 0, l = dd->ipath_port0head; l != hdrqtail; i++) {
+reloop:
+       for (i = 0; l != hdrqtail; i++) {
                u32 qp;
                u8 *bthbytes;
 
                rc = (u64 *) (dd->ipath_pd[0]->port_rcvhdrq + (l << 2));
-               hdr = (struct ips_message_header *)&rc[1];
+               hdr = (struct ipath_message_header *)&rc[1];
                /*
                 * could make a network order version of IPATH_KD_QP, and
                 * do the obvious shift before masking to speed this up.
@@ -956,10 +906,10 @@ gotmore:
                qp = ntohl(hdr->bth[1]) & 0xffffff;
                bthbytes = (u8 *) hdr->bth;
 
-               eflags = ips_get_hdr_err_flags((__le32 *) rc);
-               etype = ips_get_rcv_type((__le32 *) rc);
+               eflags = ipath_hdrget_err_flags((__le32 *) rc);
+               etype = ipath_hdrget_rcv_type((__le32 *) rc);
                /* total length */
-               tlen = ips_get_length_in_bytes((__le32 *) rc);
+               tlen = ipath_hdrget_length_in_bytes((__le32 *) rc);
                ebuf = NULL;
                if (etype != RCVHQ_RCV_TYPE_EXPECTED) {
                        /*
@@ -969,7 +919,7 @@ gotmore:
                         * set ebuf (so we try to copy data) unless the
                         * length requires it.
                         */
-                       etail = ips_get_index((__le32 *) rc);
+                       etail = ipath_hdrget_index((__le32 *) rc);
                        if (tlen > sizeof(*hdr) ||
                            etype == RCVHQ_RCV_TYPE_NON_KD)
                                ebuf = ipath_get_egrbuf(dd, etail, 0);
@@ -981,7 +931,7 @@ gotmore:
                 */
 
                if (etype != RCVHQ_RCV_TYPE_NON_KD && etype !=
-                   RCVHQ_RCV_TYPE_ERROR && ips_get_ipath_ver(
+                   RCVHQ_RCV_TYPE_ERROR && ipath_hdrget_ipath_ver(
                            hdr->iph.ver_port_tid_offset) !=
                    IPS_PROTO_VERSION) {
                        ipath_cdbg(PKT, "Bad InfiniPath protocol version "
@@ -994,7 +944,19 @@ gotmore:
                        ipath_cdbg(PKT, "RHFerrs %x hdrqtail=%x typ=%u "
                                   "tlen=%x opcode=%x egridx=%x: %s\n",
                                   eflags, l, etype, tlen, bthbytes[0],
-                                  ips_get_index((__le32 *) rc), emsg);
+                                  ipath_hdrget_index((__le32 *) rc), emsg);
+                       /* Count local link integrity errors. */
+                       if (eflags & (INFINIPATH_RHF_H_ICRCERR |
+                                     INFINIPATH_RHF_H_VCRCERR)) {
+                               u8 n = (dd->ipath_ibcctrl >>
+                                       INFINIPATH_IBCC_PHYERRTHRESHOLD_SHIFT) &
+                                       INFINIPATH_IBCC_PHYERRTHRESHOLD_MASK;
+
+                               if (++dd->ipath_lli_counter > n) {
+                                       dd->ipath_lli_counter = 0;
+                                       dd->ipath_lli_errors++;
+                               }
+                       }
                } else if (etype == RCVHQ_RCV_TYPE_NON_KD) {
                                int ret = __ipath_verbs_rcv(dd, rc + 1,
                                                            ebuf, tlen);
@@ -1002,6 +964,9 @@ gotmore:
                                        ipath_cdbg(VERBOSE,
                                                   "received IB packet, "
                                                   "not SMA (QP=%x)\n", qp);
+                               if (dd->ipath_lli_counter)
+                                       dd->ipath_lli_counter--;
+
                } else if (etype == RCVHQ_RCV_TYPE_EAGER) {
                        if (qp == IPATH_KD_QP &&
                            bthbytes[0] == ipath_layer_rcv_opcode &&
@@ -1054,25 +1019,49 @@ gotmore:
                l += rsize;
                if (l >= maxcnt)
                        l = 0;
+               if (etype != RCVHQ_RCV_TYPE_EXPECTED)
+                   updegr = 1;
                /*
-                * update for each packet, to help prevent overflows if we
-                * have lots of packets.
+                * update head regs on last packet, and every 16 packets.
+                * Reduce bus traffic, while still trying to prevent
+                * rcvhdrq overflows, for when the queue is nearly full
                 */
-               (void)ipath_write_ureg(dd, ur_rcvhdrhead,
-                                      dd->ipath_rhdrhead_intr_off | l, 0);
-               if (etype != RCVHQ_RCV_TYPE_EXPECTED)
-                       (void)ipath_write_ureg(dd, ur_rcvegrindexhead,
-                                              etail, 0);
+               if (l == hdrqtail || (i && !(i&0xf))) {
+                       u64 lval;
+                       if (l == hdrqtail) /* PE-800 interrupt only on last */
+                               lval = dd->ipath_rhdrhead_intr_off | l;
+                       else
+                               lval = l;
+                       (void)ipath_write_ureg(dd, ur_rcvhdrhead, lval, 0);
+                       if (updegr) {
+                               (void)ipath_write_ureg(dd, ur_rcvegrindexhead,
+                                                      etail, 0);
+                               updegr = 0;
+                       }
+               }
+       }
+
+       if (!dd->ipath_rhdrhead_intr_off && !reloop) {
+               /* HT-400 workaround; we can have a race clearing chip
+                * interrupt with another interrupt about to be delivered,
+                * and can clear it before it is delivered on the GPIO
+                * workaround.  By doing the extra check here for the
+                * in-memory tail register updating while we were doing
+                * earlier packets, we "almost" guarantee we have covered
+                * that case.
+                */
+               u32 hqtail = (u32)le64_to_cpu(*dd->ipath_hdrqtailptr);
+               if (hqtail != hdrqtail) {
+                       hdrqtail = hqtail;
+                       reloop = 1; /* loop 1 extra time at most */
+                       goto reloop;
+               }
        }
 
        pkttot += i;
 
        dd->ipath_port0head = l;
 
-       if (hdrqtail != (u32)le64_to_cpu(*dd->ipath_hdrqtailptr))
-               /* more arrived while we handled first batch */
-               goto gotmore;
-
        if (pkttot > ipath_stats.sps_maxpkts_call)
                ipath_stats.sps_maxpkts_call = pkttot;
        ipath_stats.sps_port0pkts += pkttot;
@@ -1369,26 +1358,20 @@ bail:
  * @dd: the infinipath device
  * @pd: the port data
  *
- * this *must* be physically contiguous memory, and for now,
- * that limits it to what kmalloc can do.
+ * this must be contiguous memory (from an i/o perspective), and must be
+ * DMA'able (which means for some systems, it will go through an IOMMU,
+ * or be forced into a low address range).
  */
 int ipath_create_rcvhdrq(struct ipath_devdata *dd,
                         struct ipath_portdata *pd)
 {
-       int ret = 0, amt;
+       int ret = 0;
 
-       amt = ALIGN(dd->ipath_rcvhdrcnt * dd->ipath_rcvhdrentsize *
-                   sizeof(u32), PAGE_SIZE);
        if (!pd->port_rcvhdrq) {
-               /*
-                * not using REPEAT isn't viable; at 128KB, we can easily
-                * fail this.  The problem with REPEAT is we can block here
-                * "forever".  There isn't an inbetween, unfortunately.  We
-                * could reduce the risk by never freeing the rcvhdrq except
-                * at unload, but even then, the first time a port is used,
-                * we could delay for some time...
-                */
+               dma_addr_t phys_hdrqtail;
                gfp_t gfp_flags = GFP_USER | __GFP_COMP;
+               int amt = ALIGN(dd->ipath_rcvhdrcnt * dd->ipath_rcvhdrentsize *
+                               sizeof(u32), PAGE_SIZE);
 
                pd->port_rcvhdrq = dma_alloc_coherent(
                        &dd->pcidev->dev, amt, &pd->port_rcvhdrq_phys,
@@ -1401,6 +1384,16 @@ int ipath_create_rcvhdrq(struct ipath_devdata *dd,
                        ret = -ENOMEM;
                        goto bail;
                }
+               pd->port_rcvhdrtail_kvaddr = dma_alloc_coherent(
+                       &dd->pcidev->dev, PAGE_SIZE, &phys_hdrqtail, GFP_KERNEL);
+               if (!pd->port_rcvhdrtail_kvaddr) {
+                       ipath_dev_err(dd, "attempt to allocate 1 page "
+                                     "for port %u rcvhdrqtailaddr failed\n",
+                                     pd->port_port);
+                       ret = -ENOMEM;
+                       goto bail;
+               }
+               pd->port_rcvhdrqtailaddr_phys = phys_hdrqtail;
 
                pd->port_rcvhdrq_size = amt;
 
@@ -1410,20 +1403,28 @@ int ipath_create_rcvhdrq(struct ipath_devdata *dd,
                           (unsigned long) pd->port_rcvhdrq_phys,
                           (unsigned long) pd->port_rcvhdrq_size,
                           pd->port_port);
-       } else {
-               /*
-                * clear for security, sanity, and/or debugging, each
-                * time we reuse
-                */
-               memset(pd->port_rcvhdrq, 0, amt);
+
+               ipath_cdbg(VERBOSE, "port %d hdrtailaddr, %llx physical\n",
+                          pd->port_port,
+                          (unsigned long long) phys_hdrqtail);
        }
+       else
+               ipath_cdbg(VERBOSE, "reuse port %d rcvhdrq @%p %llx phys; "
+                          "hdrtailaddr@%p %llx physical\n",
+                          pd->port_port, pd->port_rcvhdrq,
+                          pd->port_rcvhdrq_phys, pd->port_rcvhdrtail_kvaddr,
+                          (unsigned long long)pd->port_rcvhdrqtailaddr_phys);
+
+       /* clear for security and sanity on each use */
+       memset(pd->port_rcvhdrq, 0, pd->port_rcvhdrq_size);
+       memset((void *)pd->port_rcvhdrtail_kvaddr, 0, PAGE_SIZE);
 
        /*
         * tell chip each time we init it, even if we are re-using previous
-        * memory (we zero it at process close)
+        * memory (we zero the register at process close)
         */
-       ipath_cdbg(VERBOSE, "writing port %d rcvhdraddr as %lx\n",
-                  pd->port_port, (unsigned long) pd->port_rcvhdrq_phys);
+       ipath_write_kreg_port(dd, dd->ipath_kregs->kr_rcvhdrtailaddr,
+                             pd->port_port, pd->port_rcvhdrqtailaddr_phys);
        ipath_write_kreg_port(dd, dd->ipath_kregs->kr_rcvhdraddr,
                              pd->port_port, pd->port_rcvhdrq_phys);
 
@@ -1511,15 +1512,27 @@ void ipath_set_ib_lstate(struct ipath_devdata *dd, int which)
                [INFINIPATH_IBCC_LINKCMD_ARMED] = "ARMED",
                [INFINIPATH_IBCC_LINKCMD_ACTIVE] = "ACTIVE"
        };
+       int linkcmd = (which >> INFINIPATH_IBCC_LINKCMD_SHIFT) &
+                       INFINIPATH_IBCC_LINKCMD_MASK;
+
        ipath_cdbg(SMA, "Trying to move unit %u to %s, current ltstate "
                   "is %s\n", dd->ipath_unit,
-                  what[(which >> INFINIPATH_IBCC_LINKCMD_SHIFT) &
-                       INFINIPATH_IBCC_LINKCMD_MASK],
+                  what[linkcmd],
                   ipath_ibcstatus_str[
                           (ipath_read_kreg64
                            (dd, dd->ipath_kregs->kr_ibcstatus) >>
                            INFINIPATH_IBCS_LINKTRAININGSTATE_SHIFT) &
                           INFINIPATH_IBCS_LINKTRAININGSTATE_MASK]);
+       /* flush all queued sends when going to DOWN or INIT, to be sure that
+        * they don't block SMA and other MAD packets */
+       if (!linkcmd || linkcmd == INFINIPATH_IBCC_LINKCMD_INIT) {
+               ipath_write_kreg(dd, dd->ipath_kregs->kr_sendctrl,
+                                INFINIPATH_S_ABORT);
+               ipath_disarm_piobufs(dd, dd->ipath_lastport_piobuf,
+                                   (unsigned)(dd->ipath_piobcnt2k +
+                                   dd->ipath_piobcnt4k) -
+                                   dd->ipath_lastport_piobuf);
+       }
 
        ipath_write_kreg(dd, dd->ipath_kregs->kr_ibcctrl,
                         dd->ipath_ibcctrl | which);
@@ -1638,7 +1651,7 @@ void ipath_shutdown_device(struct ipath_devdata *dd)
        /* disable IBC */
        dd->ipath_control &= ~INFINIPATH_C_LINKENABLE;
        ipath_write_kreg(dd, dd->ipath_kregs->kr_control,
-                        dd->ipath_control);
+                        dd->ipath_control | INFINIPATH_C_FREEZEMODE);
 
        /*
         * clear SerdesEnable and turn the leds off; do this here because
@@ -1667,60 +1680,54 @@ void ipath_shutdown_device(struct ipath_devdata *dd)
 /**
  * ipath_free_pddata - free a port's allocated data
  * @dd: the infinipath device
- * @port: the port
- * @freehdrq: free the port data structure if true
+ * @pd: the portdata structure
  *
- * when closing, free up any allocated data for a port, if the
- * reference count goes to zero
- * Note: this also optionally frees the portdata itself!
- * Any changes here have to be matched up with the reinit case
- * of ipath_init_chip(), which calls this routine on reinit after reset.
+ * free up any allocated data for a port
+ * This should not touch anything that would affect a simultaneous
+ * re-allocation of port data, because it is called after ipath_mutex
+ * is released (and can be called from reinit as well).
+ * It should never change any chip state, or global driver state.
+ * (The only exception to global state is freeing the port0 port0_skbs.)
  */
-void ipath_free_pddata(struct ipath_devdata *dd, u32 port, int freehdrq)
+void ipath_free_pddata(struct ipath_devdata *dd, struct ipath_portdata *pd)
 {
-       struct ipath_portdata *pd = dd->ipath_pd[port];
-
        if (!pd)
                return;
-       if (freehdrq)
-               /*
-                * only clear and free portdata if we are going to also
-                * release the hdrq, otherwise we leak the hdrq on each
-                * open/close cycle
-                */
-               dd->ipath_pd[port] = NULL;
-       if (freehdrq && pd->port_rcvhdrq) {
+
+       if (pd->port_rcvhdrq) {
                ipath_cdbg(VERBOSE, "free closed port %d rcvhdrq @ %p "
                           "(size=%lu)\n", pd->port_port, pd->port_rcvhdrq,
                           (unsigned long) pd->port_rcvhdrq_size);
                dma_free_coherent(&dd->pcidev->dev, pd->port_rcvhdrq_size,
                                  pd->port_rcvhdrq, pd->port_rcvhdrq_phys);
                pd->port_rcvhdrq = NULL;
+               if (pd->port_rcvhdrtail_kvaddr) {
+                       dma_free_coherent(&dd->pcidev->dev, PAGE_SIZE,
+                                        (void *)pd->port_rcvhdrtail_kvaddr,
+                                        pd->port_rcvhdrqtailaddr_phys);
+                       pd->port_rcvhdrtail_kvaddr = NULL;
+               }
        }
-       if (port && pd->port_rcvegrbuf) {
-               /* always free this */
-               if (pd->port_rcvegrbuf) {
-                       unsigned e;
-
-                       for (e = 0; e < pd->port_rcvegrbuf_chunks; e++) {
-                               void *base = pd->port_rcvegrbuf[e];
-                               size_t size = pd->port_rcvegrbuf_size;
-
-                               ipath_cdbg(VERBOSE, "egrbuf free(%p, %lu), "
-                                          "chunk %u/%u\n", base,
-                                          (unsigned long) size,
-                                          e, pd->port_rcvegrbuf_chunks);
-                               dma_free_coherent(
-                                       &dd->pcidev->dev, size, base,
-                                       pd->port_rcvegrbuf_phys[e]);
-                       }
-                       vfree(pd->port_rcvegrbuf);
-                       pd->port_rcvegrbuf = NULL;
-                       vfree(pd->port_rcvegrbuf_phys);
-                       pd->port_rcvegrbuf_phys = NULL;
+       if (pd->port_port && pd->port_rcvegrbuf) {
+               unsigned e;
+
+               for (e = 0; e < pd->port_rcvegrbuf_chunks; e++) {
+                       void *base = pd->port_rcvegrbuf[e];
+                       size_t size = pd->port_rcvegrbuf_size;
+
+                       ipath_cdbg(VERBOSE, "egrbuf free(%p, %lu), "
+                                  "chunk %u/%u\n", base,
+                                  (unsigned long) size,
+                                  e, pd->port_rcvegrbuf_chunks);
+                       dma_free_coherent(&dd->pcidev->dev, size,
+                               base, pd->port_rcvegrbuf_phys[e]);
                }
+               vfree(pd->port_rcvegrbuf);
+               pd->port_rcvegrbuf = NULL;
+               vfree(pd->port_rcvegrbuf_phys);
+               pd->port_rcvegrbuf_phys = NULL;
                pd->port_rcvegrbuf_chunks = 0;
-       } else if (port == 0 && dd->ipath_port0_skbs) {
+       } else if (pd->port_port == 0 && dd->ipath_port0_skbs) {
                unsigned e;
                struct sk_buff **skbs = dd->ipath_port0_skbs;
 
@@ -1732,10 +1739,8 @@ void ipath_free_pddata(struct ipath_devdata *dd, u32 port, int freehdrq)
                                dev_kfree_skb(skbs[e]);
                vfree(skbs);
        }
-       if (freehdrq) {
-               kfree(pd->port_tid_pg_list);
-               kfree(pd);
-       }
+       kfree(pd->port_tid_pg_list);
+       kfree(pd);
 }
 
 static int __init infinipath_init(void)
@@ -1806,7 +1811,6 @@ static void cleanup_device(struct ipath_devdata *dd)
                         * re-init
                         */
                        dd->ipath_kregbase = NULL;
-                       dd->ipath_kregvirt = NULL;
                        dd->ipath_uregbase = 0;
                        dd->ipath_sregbase = 0;
                        dd->ipath_cregbase = 0;
@@ -1821,6 +1825,12 @@ static void cleanup_device(struct ipath_devdata *dd)
                                  dd->ipath_pioavailregs_phys);
                dd->ipath_pioavailregs_dma = NULL;
        }
+       if (dd->ipath_dummy_hdrq) {
+               dma_free_coherent(&dd->pcidev->dev,
+                       dd->ipath_pd[0]->port_rcvhdrq_size,
+                       dd->ipath_dummy_hdrq, dd->ipath_dummy_hdrq_phys);
+               dd->ipath_dummy_hdrq = NULL;
+       }
 
        if (dd->ipath_pageshadow) {
                struct page **tmpp = dd->ipath_pageshadow;
@@ -1861,10 +1871,14 @@ static void cleanup_device(struct ipath_devdata *dd)
 
        /*
         * free any resources still in use (usually just kernel ports)
-        * at unload
+        * at unload; we do for portcnt, not cfgports, because cfgports
+        * could have changed while we were loaded.
         */
-       for (port = 0; port < dd->ipath_cfgports; port++)
-               ipath_free_pddata(dd, port, 1);
+       for (port = 0; port < dd->ipath_portcnt; port++) {
+               struct ipath_portdata *pd = dd->ipath_pd[port];
+               dd->ipath_pd[port] = NULL;
+               ipath_free_pddata(dd, pd);
+       }
        kfree(dd->ipath_pd);
        /*
         * debuggability, in case some cleanup path tries to use it
index a2f1ceafcca9f67360d1187b8c58e9e5a813f3a0..3313356ab93aa13d1c6b3fe4bb60d543f21402fc 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -600,8 +601,31 @@ void ipath_get_eeprom_info(struct ipath_devdata *dd)
                guid = *(__be64 *) ifp->if_guid;
        dd->ipath_guid = guid;
        dd->ipath_nguid = ifp->if_numguid;
-       memcpy(dd->ipath_serial, ifp->if_serial,
-              sizeof(ifp->if_serial));
+       /*
+        * Things are slightly complicated by the desire to transparently
+        * support both the Pathscale 10-digit serial number and the QLogic
+        * 13-character version.
+        */
+       if ((ifp->if_fversion > 1) && ifp->if_sprefix[0]
+               && ((u8 *)ifp->if_sprefix)[0] != 0xFF) {
+               /* This board has a Serial-prefix, which is stored
+                * elsewhere for backward-compatibility.
+                */
+               char *snp = dd->ipath_serial;
+               int len;
+               memcpy(snp, ifp->if_sprefix, sizeof ifp->if_sprefix);
+               snp[sizeof ifp->if_sprefix] = '\0';
+               len = strlen(snp);
+               snp += len;
+               len = (sizeof dd->ipath_serial) - len;
+               if (len > sizeof ifp->if_serial) {
+                       len = sizeof ifp->if_serial;
+               }
+               memcpy(snp, ifp->if_serial, len);
+       } else
+               memcpy(dd->ipath_serial, ifp->if_serial,
+                      sizeof ifp->if_serial);
+
        ipath_cdbg(VERBOSE, "Initted GUID to %llx from eeprom\n",
                   (unsigned long long) be64_to_cpu(dd->ipath_guid));
 
index ada267e41f6c749901b53f898a9c39df891c7061..bbaa70e57db1ebf4442e6f3cb4e6e9f4a430efe6 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -38,8 +39,8 @@
 #include <asm/pgtable.h>
 
 #include "ipath_kernel.h"
-#include "ips_common.h"
 #include "ipath_layer.h"
+#include "ipath_common.h"
 
 static int ipath_open(struct inode *, struct file *);
 static int ipath_close(struct inode *, struct file *);
@@ -122,6 +123,7 @@ static int ipath_get_base_info(struct ipath_portdata *pd,
         * on to yet another method of dealing with this
         */
        kinfo->spi_rcvhdr_base = (u64) pd->port_rcvhdrq_phys;
+       kinfo->spi_rcvhdr_tailaddr = (u64)pd->port_rcvhdrqtailaddr_phys;
        kinfo->spi_rcv_egrbufs = (u64) pd->port_rcvegr_phys;
        kinfo->spi_pioavailaddr = (u64) dd->ipath_pioavailregs_phys;
        kinfo->spi_status = (u64) kinfo->spi_pioavailaddr +
@@ -456,7 +458,7 @@ static int ipath_set_part_key(struct ipath_portdata *pd, u16 key)
        u16 lkey = key & 0x7FFF;
        int ret;
 
-       if (lkey == (IPS_DEFAULT_P_KEY & 0x7FFF)) {
+       if (lkey == (IPATH_DEFAULT_P_KEY & 0x7FFF)) {
                /* nothing to do; this key always valid */
                ret = 0;
                goto bail;
@@ -704,6 +706,15 @@ static int ipath_create_user_egr(struct ipath_portdata *pd)
        unsigned e, egrcnt, alloced, egrperchunk, chunk, egrsize, egroff;
        size_t size;
        int ret;
+       gfp_t gfp_flags;
+
+       /*
+        * GFP_USER, but without GFP_FS, so buffer cache can be
+        * coalesced (we hope); otherwise, even at order 4,
+        * heavy filesystem activity makes these fail, and we can
+        * use compound pages.
+        */
+       gfp_flags = __GFP_WAIT | __GFP_IO | __GFP_COMP;
 
        egrcnt = dd->ipath_rcvegrcnt;
        /* TID number offset for this port */
@@ -720,10 +731,8 @@ static int ipath_create_user_egr(struct ipath_portdata *pd)
         * memory pressure (creating large files and then copying them over
         * NFS while doing lots of MPI jobs), we hit some allocation
         * failures, even though we can sleep...  (2.6.10) Still get
-        * failures at 64K.  32K is the lowest we can go without waiting
-        * more memory again.  It seems likely that the coalescing in
-        * free_pages, etc. still has issues (as it has had previously
-        * during 2.6.x development).
+        * failures at 64K.  32K is the lowest we can go without wasting
+        * additional memory.
         */
        size = 0x8000;
        alloced = ALIGN(egrsize * egrcnt, size);
@@ -744,12 +753,6 @@ static int ipath_create_user_egr(struct ipath_portdata *pd)
                goto bail_rcvegrbuf;
        }
        for (e = 0; e < pd->port_rcvegrbuf_chunks; e++) {
-               /*
-                * GFP_USER, but without GFP_FS, so buffer cache can be
-                * coalesced (we hope); otherwise, even at order 4,
-                * heavy filesystem activity makes these fail
-                */
-               gfp_t gfp_flags = __GFP_WAIT | __GFP_IO | __GFP_COMP;
 
                pd->port_rcvegrbuf[e] = dma_alloc_coherent(
                        &dd->pcidev->dev, size, &pd->port_rcvegrbuf_phys[e],
@@ -783,11 +786,12 @@ static int ipath_create_user_egr(struct ipath_portdata *pd)
 
 bail_rcvegrbuf_phys:
        for (e = 0; e < pd->port_rcvegrbuf_chunks &&
-                    pd->port_rcvegrbuf[e]; e++)
+               pd->port_rcvegrbuf[e]; e++) {
                dma_free_coherent(&dd->pcidev->dev, size,
                                  pd->port_rcvegrbuf[e],
                                  pd->port_rcvegrbuf_phys[e]);
 
+       }
        vfree(pd->port_rcvegrbuf_phys);
        pd->port_rcvegrbuf_phys = NULL;
 bail_rcvegrbuf:
@@ -802,10 +806,7 @@ static int ipath_do_user_init(struct ipath_portdata *pd,
 {
        int ret = 0;
        struct ipath_devdata *dd = pd->port_dd;
-       u64 physaddr, uaddr, off, atmp;
-       struct page *pagep;
        u32 head32;
-       u64 head;
 
        /* for now, if major version is different, bail */
        if ((uinfo->spu_userversion >> 16) != IPATH_USER_SWMAJOR) {
@@ -830,54 +831,6 @@ static int ipath_do_user_init(struct ipath_portdata *pd,
 
        /* for now we do nothing with rcvhdrcnt: uinfo->spu_rcvhdrcnt */
 
-       /* set up for the rcvhdr Q tail register writeback to user memory */
-       if (!uinfo->spu_rcvhdraddr ||
-           !access_ok(VERIFY_WRITE, (u64 __user *) (unsigned long)
-                      uinfo->spu_rcvhdraddr, sizeof(u64))) {
-               ipath_dbg("Port %d rcvhdrtail addr %llx not valid\n",
-                         pd->port_port,
-                         (unsigned long long) uinfo->spu_rcvhdraddr);
-               ret = -EINVAL;
-               goto done;
-       }
-
-       off = offset_in_page(uinfo->spu_rcvhdraddr);
-       uaddr = PAGE_MASK & (unsigned long) uinfo->spu_rcvhdraddr;
-       ret = ipath_get_user_pages_nocopy(uaddr, &pagep);
-       if (ret) {
-               dev_info(&dd->pcidev->dev, "Failed to lookup and lock "
-                        "address %llx for rcvhdrtail: errno %d\n",
-                        (unsigned long long) uinfo->spu_rcvhdraddr, -ret);
-               goto done;
-       }
-       ipath_stats.sps_pagelocks++;
-       pd->port_rcvhdrtail_uaddr = uaddr;
-       pd->port_rcvhdrtail_pagep = pagep;
-       pd->port_rcvhdrtail_kvaddr =
-               page_address(pagep);
-       pd->port_rcvhdrtail_kvaddr += off;
-       physaddr = page_to_phys(pagep) + off;
-       ipath_cdbg(VERBOSE, "port %d user addr %llx hdrtailaddr, %llx "
-                  "physical (off=%llx)\n",
-                  pd->port_port,
-                  (unsigned long long) uinfo->spu_rcvhdraddr,
-                  (unsigned long long) physaddr, (unsigned long long) off);
-       ipath_write_kreg_port(dd, dd->ipath_kregs->kr_rcvhdrtailaddr,
-                             pd->port_port, physaddr);
-       atmp = ipath_read_kreg64_port(dd,
-                                     dd->ipath_kregs->kr_rcvhdrtailaddr,
-                                     pd->port_port);
-       if (physaddr != atmp) {
-               ipath_dev_err(dd,
-                             "Catastrophic software error, "
-                             "RcvHdrTailAddr%u written as %llx, "
-                             "read back as %llx\n", pd->port_port,
-                             (unsigned long long) physaddr,
-                             (unsigned long long) atmp);
-               ret = -EINVAL;
-               goto done;
-       }
-
        /* for right now, kernel piobufs are at end, so port 1 is at 0 */
        pd->port_piobufs = dd->ipath_piobufbase +
                dd->ipath_pbufsport * (pd->port_port -
@@ -896,26 +849,18 @@ static int ipath_do_user_init(struct ipath_portdata *pd,
                ret = ipath_create_user_egr(pd);
        if (ret)
                goto done;
-       /* enable receives now */
-       /* atomically set enable bit for this port */
-       set_bit(INFINIPATH_R_PORTENABLE_SHIFT + pd->port_port,
-               &dd->ipath_rcvctrl);
 
        /*
-        * set the head registers for this port to the current values
+        * set the eager head register for this port to the current values
         * of the tail pointers, since we don't know if they were
         * updated on last use of the port.
         */
-       head32 = ipath_read_ureg32(dd, ur_rcvhdrtail, pd->port_port);
-       head = (u64) head32;
-       ipath_write_ureg(dd, ur_rcvhdrhead, head, pd->port_port);
        head32 = ipath_read_ureg32(dd, ur_rcvegrindextail, pd->port_port);
        ipath_write_ureg(dd, ur_rcvegrindexhead, head32, pd->port_port);
        dd->ipath_lastegrheads[pd->port_port] = -1;
        dd->ipath_lastrcvhdrqtails[pd->port_port] = -1;
-       ipath_cdbg(VERBOSE, "Wrote port%d head %llx, egrhead %x from "
-                  "tail regs\n", pd->port_port,
-                  (unsigned long long) head, head32);
+       ipath_cdbg(VERBOSE, "Wrote port%d egrhead %x from tail regs\n",
+               pd->port_port, head32);
        pd->port_tidcursor = 0; /* start at beginning after open */
        /*
         * now enable the port; the tail registers will be written to memory
@@ -924,24 +869,76 @@ static int ipath_do_user_init(struct ipath_portdata *pd,
         * transition from 0 to 1, so clear it first, then set it as part of
         * enabling the port.  This will (very briefly) affect any other
         * open ports, but it shouldn't be long enough to be an issue.
+        * We explictly set the in-memory copy to 0 beforehand, so we don't
+        * have to wait to be sure the DMA update has happened.
         */
+       *pd->port_rcvhdrtail_kvaddr = 0ULL;
+       set_bit(INFINIPATH_R_PORTENABLE_SHIFT + pd->port_port,
+               &dd->ipath_rcvctrl);
        ipath_write_kreg(dd, dd->ipath_kregs->kr_rcvctrl,
                         dd->ipath_rcvctrl & ~INFINIPATH_R_TAILUPD);
        ipath_write_kreg(dd, dd->ipath_kregs->kr_rcvctrl,
                         dd->ipath_rcvctrl);
-
 done:
        return ret;
 }
 
+
+/* common code for the mappings on dma_alloc_coherent mem */
+static int ipath_mmap_mem(struct vm_area_struct *vma,
+                            struct ipath_portdata *pd, unsigned len,
+                            int write_ok, dma_addr_t addr, char *what)
+{
+       struct ipath_devdata *dd = pd->port_dd;
+       unsigned pfn = (unsigned long)addr >> PAGE_SHIFT;
+       int ret;
+
+       if ((vma->vm_end - vma->vm_start) > len) {
+               dev_info(&dd->pcidev->dev,
+                        "FAIL on %s: len %lx > %x\n", what,
+                        vma->vm_end - vma->vm_start, len);
+               ret = -EFAULT;
+               goto bail;
+       }
+
+       if (!write_ok) {
+               if (vma->vm_flags & VM_WRITE) {
+                       dev_info(&dd->pcidev->dev,
+                                "%s must be mapped readonly\n", what);
+                       ret = -EPERM;
+                       goto bail;
+               }
+
+               /* don't allow them to later change with mprotect */
+               vma->vm_flags &= ~VM_MAYWRITE;
+       }
+
+       ret = remap_pfn_range(vma, vma->vm_start, pfn,
+                             len, vma->vm_page_prot);
+       if (ret)
+               dev_info(&dd->pcidev->dev,
+                        "%s port%u mmap of %lx, %x bytes r%c failed: %d\n",
+                        what, pd->port_port, (unsigned long)addr, len,
+                        write_ok?'w':'o', ret);
+       else
+               ipath_cdbg(VERBOSE, "%s port%u mmaped %lx, %x bytes r%c\n",
+                       what, pd->port_port, (unsigned long)addr, len,
+                        write_ok?'w':'o');
+bail:
+       return ret;
+}
+
 static int mmap_ureg(struct vm_area_struct *vma, struct ipath_devdata *dd,
                     u64 ureg)
 {
        unsigned long phys;
        int ret;
 
-       /* it's the real hardware, so io_remap works */
-
+       /*
+        * This is real hardware, so use io_remap.  This is the mechanism
+        * for the user process to update the head registers for their port
+        * in the chip.
+        */
        if ((vma->vm_end - vma->vm_start) > PAGE_SIZE) {
                dev_info(&dd->pcidev->dev, "FAIL mmap userreg: reqlen "
                         "%lx > PAGE\n", vma->vm_end - vma->vm_start);
@@ -967,10 +964,11 @@ static int mmap_piobufs(struct vm_area_struct *vma,
        int ret;
 
        /*
-        * When we map the PIO buffers, we want to map them as writeonly, no
-        * read possible.
+        * When we map the PIO buffers in the chip, we want to map them as
+        * writeonly, no read possible.   This prevents access to previous
+        * process data, and catches users who might try to read the i/o
+        * space due to a bug.
         */
-
        if ((vma->vm_end - vma->vm_start) >
            (dd->ipath_pbufsport * dd->ipath_palign)) {
                dev_info(&dd->pcidev->dev, "FAIL mmap piobufs: "
@@ -981,11 +979,10 @@ static int mmap_piobufs(struct vm_area_struct *vma,
        }
 
        phys = dd->ipath_physaddr + pd->port_piobufs;
+
        /*
-        * Do *NOT* mark this as non-cached (PWT bit), or we don't get the
+        * Don't mark this as non-cached, or we don't get the
         * write combining behavior we want on the PIO buffers!
-        * vma->vm_page_prot =
-        *        pgprot_noncached(vma->vm_page_prot);
         */
 
        if (vma->vm_flags & VM_READ) {
@@ -997,8 +994,7 @@ static int mmap_piobufs(struct vm_area_struct *vma,
        }
 
        /* don't allow them to later change to readable with mprotect */
-
-       vma->vm_flags &= ~VM_MAYWRITE;
+       vma->vm_flags &= ~VM_MAYREAD;
        vma->vm_flags |= VM_DONTCOPY | VM_DONTEXPAND;
 
        ret = io_remap_pfn_range(vma, vma->vm_start, phys >> PAGE_SHIFT,
@@ -1017,11 +1013,6 @@ static int mmap_rcvegrbufs(struct vm_area_struct *vma,
        dma_addr_t *phys;
        int ret;
 
-       if (!pd->port_rcvegrbuf) {
-               ret = -EFAULT;
-               goto bail;
-       }
-
        size = pd->port_rcvegrbuf_size;
        total_size = pd->port_rcvegrbuf_chunks * size;
        if ((vma->vm_end - vma->vm_start) > total_size) {
@@ -1039,13 +1030,12 @@ static int mmap_rcvegrbufs(struct vm_area_struct *vma,
                ret = -EPERM;
                goto bail;
        }
+       /* don't allow them to later change to writeable with mprotect */
+       vma->vm_flags &= ~VM_MAYWRITE;
 
        start = vma->vm_start;
        phys = pd->port_rcvegrbuf_phys;
 
-       /* don't allow them to later change to writeable with mprotect */
-       vma->vm_flags &= ~VM_MAYWRITE;
-
        for (i = 0; i < pd->port_rcvegrbuf_chunks; i++, start += size) {
                ret = remap_pfn_range(vma, start, phys[i] >> PAGE_SHIFT,
                                      size, vma->vm_page_prot);
@@ -1058,78 +1048,6 @@ bail:
        return ret;
 }
 
-static int mmap_rcvhdrq(struct vm_area_struct *vma,
-                       struct ipath_portdata *pd)
-{
-       struct ipath_devdata *dd = pd->port_dd;
-       size_t total_size;
-       int ret;
-
-       /*
-        * kmalloc'ed memory, physically contiguous; this is from
-        * spi_rcvhdr_base; we allow user to map read-write so they can
-        * write hdrq entries to allow protocol code to directly poll
-        * whether a hdrq entry has been written.
-        */
-       total_size = ALIGN(dd->ipath_rcvhdrcnt * dd->ipath_rcvhdrentsize *
-                          sizeof(u32), PAGE_SIZE);
-       if ((vma->vm_end - vma->vm_start) > total_size) {
-               dev_info(&dd->pcidev->dev,
-                        "FAIL on rcvhdrq: reqlen %lx > actual %lx\n",
-                        vma->vm_end - vma->vm_start,
-                        (unsigned long) total_size);
-               ret = -EFAULT;
-               goto bail;
-       }
-
-       ret = remap_pfn_range(vma, vma->vm_start,
-                             pd->port_rcvhdrq_phys >> PAGE_SHIFT,
-                             vma->vm_end - vma->vm_start,
-                             vma->vm_page_prot);
-bail:
-       return ret;
-}
-
-static int mmap_pioavailregs(struct vm_area_struct *vma,
-                            struct ipath_portdata *pd)
-{
-       struct ipath_devdata *dd = pd->port_dd;
-       int ret;
-
-       /*
-        * when we map the PIO bufferavail registers, we want to map them as
-        * readonly, no write possible.
-        *
-        * kmalloc'ed memory, physically contiguous, one page only, readonly
-        */
-
-       if ((vma->vm_end - vma->vm_start) > PAGE_SIZE) {
-               dev_info(&dd->pcidev->dev, "FAIL on pioavailregs_dma: "
-                        "reqlen %lx > actual %lx\n",
-                        vma->vm_end - vma->vm_start,
-                        (unsigned long) PAGE_SIZE);
-               ret = -EFAULT;
-               goto bail;
-       }
-
-       if (vma->vm_flags & VM_WRITE) {
-               dev_info(&dd->pcidev->dev,
-                        "Can't map pioavailregs as writable (flags=%lx)\n",
-                        vma->vm_flags);
-               ret = -EPERM;
-               goto bail;
-       }
-
-       /* don't allow them to later change with mprotect */
-       vma->vm_flags &= ~VM_MAYWRITE;
-
-       ret = remap_pfn_range(vma, vma->vm_start,
-                             dd->ipath_pioavailregs_phys >> PAGE_SHIFT,
-                             PAGE_SIZE, vma->vm_page_prot);
-bail:
-       return ret;
-}
-
 /**
  * ipath_mmap - mmap various structures into user space
  * @fp: the file pointer
@@ -1149,6 +1067,7 @@ static int ipath_mmap(struct file *fp, struct vm_area_struct *vma)
 
        pd = port_fp(fp);
        dd = pd->port_dd;
+
        /*
         * This is the ipath_do_user_init() code, mapping the shared buffers
         * into the user process. The address referred to by vm_pgoff is the
@@ -1158,28 +1077,59 @@ static int ipath_mmap(struct file *fp, struct vm_area_struct *vma)
        pgaddr = vma->vm_pgoff << PAGE_SHIFT;
 
        /*
-        * note that ureg does *NOT* have the kregvirt as part of it, to be
-        * sure that for 32 bit programs, we don't end up trying to map a >
-        * 44 address.  Has to match ipath_get_base_info() code that sets
-        * __spi_uregbase
+        * Must fit in 40 bits for our hardware; some checked elsewhere,
+        * but we'll be paranoid.  Check for 0 is mostly in case one of the
+        * allocations failed, but user called mmap anyway.   We want to catch
+        * that before it can match.
         */
+       if (!pgaddr || pgaddr >= (1ULL<<40))  {
+               ipath_dev_err(dd, "Bad phys addr %llx, start %lx, end %lx\n",
+                       (unsigned long long)pgaddr, vma->vm_start, vma->vm_end);
+               return -EINVAL;
+       }
 
+       /* just the offset of the port user registers, not physical addr */
        ureg = dd->ipath_uregbase + dd->ipath_palign * pd->port_port;
 
        ipath_cdbg(MM, "ushare: pgaddr %llx vm_start=%lx, vmlen %lx\n",
                   (unsigned long long) pgaddr, vma->vm_start,
                   vma->vm_end - vma->vm_start);
 
-       if (pgaddr == ureg)
+       if (vma->vm_start & (PAGE_SIZE-1)) {
+               ipath_dev_err(dd,
+                       "vm_start not aligned: %lx, end=%lx phys %lx\n",
+                       vma->vm_start, vma->vm_end, (unsigned long)pgaddr);
+               ret = -EINVAL;
+       }
+       else if (pgaddr == ureg)
                ret = mmap_ureg(vma, dd, ureg);
        else if (pgaddr == pd->port_piobufs)
                ret = mmap_piobufs(vma, dd, pd);
        else if (pgaddr == (u64) pd->port_rcvegr_phys)
                ret = mmap_rcvegrbufs(vma, pd);
-       else if (pgaddr == (u64) pd->port_rcvhdrq_phys)
-               ret = mmap_rcvhdrq(vma, pd);
+       else if (pgaddr == (u64) pd->port_rcvhdrq_phys) {
+               /*
+                * The rcvhdrq itself; readonly except on HT-400 (so have
+                * to allow writable mapping), multiple pages, contiguous
+                * from an i/o perspective.
+                */
+               unsigned total_size =
+                       ALIGN(dd->ipath_rcvhdrcnt * dd->ipath_rcvhdrentsize
+                          * sizeof(u32), PAGE_SIZE);
+               ret = ipath_mmap_mem(vma, pd, total_size, 1,
+                                    pd->port_rcvhdrq_phys,
+                                    "rcvhdrq");
+       }
+       else if (pgaddr == (u64)pd->port_rcvhdrqtailaddr_phys)
+               /* in-memory copy of rcvhdrq tail register */
+               ret = ipath_mmap_mem(vma, pd, PAGE_SIZE, 0,
+                                    pd->port_rcvhdrqtailaddr_phys,
+                                    "rcvhdrq tail");
        else if (pgaddr == dd->ipath_pioavailregs_phys)
-               ret = mmap_pioavailregs(vma, pd);
+               /* in-memory copy of pioavail registers */
+               ret = ipath_mmap_mem(vma, pd, PAGE_SIZE, 0,
+                                    dd->ipath_pioavailregs_phys,
+                                    "pioavail registers");
        else
                ret = -EINVAL;
 
@@ -1442,16 +1392,16 @@ done:
 
 static int ipath_open(struct inode *in, struct file *fp)
 {
-       int ret, minor;
+       int ret, user_minor;
 
        mutex_lock(&ipath_mutex);
 
-       minor = iminor(in);
+       user_minor = iminor(in) - IPATH_USER_MINOR_BASE;
        ipath_cdbg(VERBOSE, "open on dev %lx (minor %d)\n",
-                  (long)in->i_rdev, minor);
+                  (long)in->i_rdev, user_minor);
 
-       if (minor)
-               ret = find_free_port(minor - 1, fp);
+       if (user_minor)
+               ret = find_free_port(user_minor - 1, fp);
        else
                ret = find_best_unit(fp);
 
@@ -1536,53 +1486,54 @@ static int ipath_close(struct inode *in, struct file *fp)
        }
 
        if (dd->ipath_kregbase) {
-               if (pd->port_rcvhdrtail_uaddr) {
-                       pd->port_rcvhdrtail_uaddr = 0;
-                       pd->port_rcvhdrtail_kvaddr = NULL;
-                       ipath_release_user_pages_on_close(
-                               &pd->port_rcvhdrtail_pagep, 1);
-                       pd->port_rcvhdrtail_pagep = NULL;
-                       ipath_stats.sps_pageunlocks++;
-               }
-               ipath_write_kreg_port(
-                       dd, dd->ipath_kregs->kr_rcvhdrtailaddr,
-                       port, 0ULL);
-               ipath_write_kreg_port(
-                       dd, dd->ipath_kregs->kr_rcvhdraddr,
-                       pd->port_port, 0);
+               int i;
+               /* atomically clear receive enable port. */
+               clear_bit(INFINIPATH_R_PORTENABLE_SHIFT + port,
+                         &dd->ipath_rcvctrl);
+               ipath_write_kreg( dd, dd->ipath_kregs->kr_rcvctrl,
+                       dd->ipath_rcvctrl);
+               /* and read back from chip to be sure that nothing
+                * else is in flight when we do the rest */
+               (void)ipath_read_kreg64(dd, dd->ipath_kregs->kr_scratch);
 
                /* clean up the pkeys for this port user */
                ipath_clean_part_key(pd, dd);
 
-               if (port < dd->ipath_cfgports) {
-                       int i = dd->ipath_pbufsport * (port - 1);
-                       ipath_disarm_piobufs(dd, i, dd->ipath_pbufsport);
 
-                       /* atomically clear receive enable port. */
-                       clear_bit(INFINIPATH_R_PORTENABLE_SHIFT + port,
-                                 &dd->ipath_rcvctrl);
-                       ipath_write_kreg(
-                               dd,
-                               dd->ipath_kregs->kr_rcvctrl,
-                               dd->ipath_rcvctrl);
-
-                       if (dd->ipath_pageshadow)
-                               unlock_expected_tids(pd);
-                       ipath_stats.sps_ports--;
-                       ipath_cdbg(PROC, "%s[%u] closed port %u:%u\n",
-                                  pd->port_comm, pd->port_pid,
-                                  dd->ipath_unit, port);
-               }
+               /*
+                * be paranoid, and never write 0's to these, just use an
+                * unused part of the port 0 tail page.  Of course,
+                * rcvhdraddr points to a large chunk of memory, so this
+                * could still trash things, but at least it won't trash
+                * page 0, and by disabling the port, it should stop "soon",
+                * even if a packet or two is in already in flight after we
+                * disabled the port.
+                */
+               ipath_write_kreg_port(dd,
+                       dd->ipath_kregs->kr_rcvhdrtailaddr, port,
+                       dd->ipath_dummy_hdrq_phys);
+               ipath_write_kreg_port(dd, dd->ipath_kregs->kr_rcvhdraddr,
+                       pd->port_port, dd->ipath_dummy_hdrq_phys);
+
+               i = dd->ipath_pbufsport * (port - 1);
+               ipath_disarm_piobufs(dd, i, dd->ipath_pbufsport);
+
+               if (dd->ipath_pageshadow)
+                       unlock_expected_tids(pd);
+               ipath_stats.sps_ports--;
+               ipath_cdbg(PROC, "%s[%u] closed port %u:%u\n",
+                          pd->port_comm, pd->port_pid,
+                          dd->ipath_unit, port);
+
+               dd->ipath_f_clear_tids(dd, pd->port_port);
        }
 
        pd->port_cnt = 0;
        pd->port_pid = 0;
 
-       dd->ipath_f_clear_tids(dd, pd->port_port);
-
-       ipath_free_pddata(dd, pd->port_port, 0);
-
+       dd->ipath_pd[pd->port_port] = NULL; /* before releasing mutex */
        mutex_unlock(&ipath_mutex);
+       ipath_free_pddata(dd, pd); /* after releasing the mutex */
 
        return ret;
 }
@@ -1859,19 +1810,12 @@ int ipath_user_add(struct ipath_devdata *dd)
                                      "error %d\n", -ret);
                        goto bail;
                }
-               ret = ipath_diag_init();
-               if (ret < 0) {
-                       ipath_dev_err(dd, "Unable to set up diag support: "
-                                     "error %d\n", -ret);
-                       goto bail_sma;
-               }
-
                ret = init_cdev(0, "ipath", &ipath_file_ops, &wildcard_cdev,
                                &wildcard_class_dev);
                if (ret < 0) {
                        ipath_dev_err(dd, "Could not create wildcard "
                                      "minor: error %d\n", -ret);
-                       goto bail_diag;
+                       goto bail_sma;
                }
 
                atomic_set(&user_setup, 1);
@@ -1880,31 +1824,28 @@ int ipath_user_add(struct ipath_devdata *dd)
        snprintf(name, sizeof(name), "ipath%d", dd->ipath_unit);
 
        ret = init_cdev(dd->ipath_unit + 1, name, &ipath_file_ops,
-                       &dd->cdev, &dd->class_dev);
+                       &dd->user_cdev, &dd->user_class_dev);
        if (ret < 0)
                ipath_dev_err(dd, "Could not create user minor %d, %s\n",
                              dd->ipath_unit + 1, name);
 
        goto bail;
 
-bail_diag:
-       ipath_diag_cleanup();
 bail_sma:
        user_cleanup();
 bail:
        return ret;
 }
 
-void ipath_user_del(struct ipath_devdata *dd)
+void ipath_user_remove(struct ipath_devdata *dd)
 {
-       cleanup_cdev(&dd->cdev, &dd->class_dev);
+       cleanup_cdev(&dd->user_cdev, &dd->user_class_dev);
 
        if (atomic_dec_return(&user_count) == 0) {
                if (atomic_read(&user_setup) == 0)
                        goto bail;
 
                cleanup_cdev(&wildcard_cdev, &wildcard_class_dev);
-               ipath_diag_cleanup();
                user_cleanup();
 
                atomic_set(&user_setup, 0);
@@ -1912,3 +1853,4 @@ void ipath_user_del(struct ipath_devdata *dd)
 bail:
        return;
 }
+
index 63de3046aff30079415914aa4b55eb2d35e9b073..0936d8e8d7043bdc51408c5e4bdf9ba25d9bc54f 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -31,7 +32,6 @@
  */
 
 #include <linux/version.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/mount.h>
index fac0a2b74de2e3d08d054322157b773bc5b79967..3db015da6e77813e194ca10f77ce8ddd865fe2f3 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -1572,7 +1573,6 @@ void ipath_init_ht400_funcs(struct ipath_devdata *dd)
        dd->ipath_f_reset = ipath_setup_ht_reset;
        dd->ipath_f_get_boardname = ipath_ht_boardname;
        dd->ipath_f_init_hwerrors = ipath_ht_init_hwerrors;
-       dd->ipath_f_init_hwerrors = ipath_ht_init_hwerrors;
        dd->ipath_f_early_init = ipath_ht_early_init;
        dd->ipath_f_handle_hwerrors = ipath_ht_handle_hwerrors;
        dd->ipath_f_quiet_serdes = ipath_ht_quiet_serdes;
index dc83250d26a6a1dc3bf31f92385be816b6b7aca4..414cdd1d80a6fa8893121786825bc5646cd8d385 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -35,7 +36,7 @@
 #include <linux/vmalloc.h>
 
 #include "ipath_kernel.h"
-#include "ips_common.h"
+#include "ipath_common.h"
 
 /*
  * min buffers we want to have per port, after driver
@@ -114,6 +115,7 @@ static int create_port0_egr(struct ipath_devdata *dd)
                                      "eager TID %u\n", e);
                        while (e != 0)
                                dev_kfree_skb(skbs[--e]);
+                       vfree(skbs);
                        ret = -ENOMEM;
                        goto bail;
                }
@@ -275,7 +277,7 @@ static int init_chip_first(struct ipath_devdata *dd,
        pd->port_port = 0;
        pd->port_cnt = 1;
        /* The port 0 pkey table is used by the layer interface. */
-       pd->port_pkeys[0] = IPS_DEFAULT_P_KEY;
+       pd->port_pkeys[0] = IPATH_DEFAULT_P_KEY;
        dd->ipath_rcvtidcnt =
                ipath_read_kreg32(dd, dd->ipath_kregs->kr_rcvtidcnt);
        dd->ipath_rcvtidbase =
@@ -409,17 +411,8 @@ static int init_pioavailregs(struct ipath_devdata *dd)
        /* and its length */
        dd->ipath_freezelen = L1_CACHE_BYTES - sizeof(dd->ipath_statusp[0]);
 
-       if (dd->ipath_unit * 64 > (IPATH_PORT0_RCVHDRTAIL_SIZE - 64)) {
-               ipath_dev_err(dd, "unit %u too large for port 0 "
-                             "rcvhdrtail buffer size\n", dd->ipath_unit);
-               ret = -ENODEV;
-       }
-       else
-               ret = 0;
+       ret = 0;
 
-       /* so we can get current tail in ipath_kreceive(), per chip */
-       dd->ipath_hdrqtailptr = &ipath_port0_rcvhdrtail[
-               dd->ipath_unit * (64 / sizeof(*ipath_port0_rcvhdrtail))];
 done:
        return ret;
 }
@@ -652,8 +645,9 @@ int ipath_init_chip(struct ipath_devdata *dd, int reinit)
 {
        int ret = 0, i;
        u32 val32, kpiobufs;
-       u64 val, atmp;
+       u64 val;
        struct ipath_portdata *pd = NULL; /* keep gcc4 happy */
+       gfp_t gfp_flags = GFP_USER | __GFP_COMP;
 
        ret = init_housekeeping(dd, &pd, reinit);
        if (ret)
@@ -775,24 +769,6 @@ int ipath_init_chip(struct ipath_devdata *dd, int reinit)
                goto done;
        }
 
-       val = ipath_port0_rcvhdrtail_dma + dd->ipath_unit * 64;
-
-       /* verify that the alignment requirement was met */
-       ipath_write_kreg_port(dd, dd->ipath_kregs->kr_rcvhdrtailaddr,
-                             0, val);
-       atmp = ipath_read_kreg64_port(
-               dd, dd->ipath_kregs->kr_rcvhdrtailaddr, 0);
-       if (val != atmp) {
-               ipath_dev_err(dd, "Catastrophic software error, "
-                             "RcvHdrTailAddr0 written as %llx, "
-                             "read back as %llx from %x\n",
-                             (unsigned long long) val,
-                             (unsigned long long) atmp,
-                             dd->ipath_kregs->kr_rcvhdrtailaddr);
-               ret = -EINVAL;
-               goto done;
-       }
-
        ipath_write_kreg(dd, dd->ipath_kregs->kr_rcvbthqp, IPATH_KD_QP);
 
        /*
@@ -836,25 +812,45 @@ int ipath_init_chip(struct ipath_devdata *dd, int reinit)
        /* clear any interrups up to this point (ints still not enabled) */
        ipath_write_kreg(dd, dd->ipath_kregs->kr_intclear, -1LL);
 
-       ipath_stats.sps_lid[dd->ipath_unit] = dd->ipath_lid;
-
        /*
         * Set up the port 0 (kernel) rcvhdr q and egr TIDs.  If doing
         * re-init, the simplest way to handle this is to free
         * existing, and re-allocate.
         */
-       if (reinit)
-               ipath_free_pddata(dd, 0, 0);
+       if (reinit) {
+               struct ipath_portdata *pd = dd->ipath_pd[0];
+               dd->ipath_pd[0] = NULL;
+               ipath_free_pddata(dd, pd);
+       }
        dd->ipath_f_tidtemplate(dd);
        ret = ipath_create_rcvhdrq(dd, pd);
-       if (!ret)
+       if (!ret) {
+               dd->ipath_hdrqtailptr =
+                       (volatile __le64 *)pd->port_rcvhdrtail_kvaddr;
                ret = create_port0_egr(dd);
+       }
        if (ret)
                ipath_dev_err(dd, "failed to allocate port 0 (kernel) "
                              "rcvhdrq and/or egr bufs\n");
        else
                enable_chip(dd, pd, reinit);
 
+
+       if (!ret && !reinit) {
+           /* used when we close a port, for DMA already in flight at close */
+               dd->ipath_dummy_hdrq = dma_alloc_coherent(
+                       &dd->pcidev->dev, pd->port_rcvhdrq_size,
+                       &dd->ipath_dummy_hdrq_phys,
+                       gfp_flags);
+               if (!dd->ipath_dummy_hdrq ) {
+                       dev_info(&dd->pcidev->dev,
+                               "Couldn't allocate 0x%lx bytes for dummy hdrq\n",
+                               pd->port_rcvhdrq_size);
+                       /* fallback to just 0'ing */
+                       dd->ipath_dummy_hdrq_phys = 0UL;
+               }
+       }
+
        /*
         * cause retrigger of pending interrupts ignored during init,
         * even if we had errors
index 3e72a1fe3d73d0db9c64bd277b2d55a3648ed98e..280e732660a19776d69870c5a82893377008be2f 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
 #include <linux/pci.h>
 
 #include "ipath_kernel.h"
-#include "ips_common.h"
 #include "ipath_layer.h"
+#include "ipath_common.h"
 
+/* These are all rcv-related errors which we want to count for stats */
 #define E_SUM_PKTERRS \
        (INFINIPATH_E_RHDRLEN | INFINIPATH_E_RBADTID | \
         INFINIPATH_E_RBADVERSION | INFINIPATH_E_RHDR | \
@@ -44,6 +46,7 @@
         INFINIPATH_E_RFORMATERR | INFINIPATH_E_RUNSUPVL | \
         INFINIPATH_E_RUNEXPCHAR | INFINIPATH_E_REBP)
 
+/* These are all send-related errors which we want to count for stats */
 #define E_SUM_ERRS \
        (INFINIPATH_E_SPIOARMLAUNCH | INFINIPATH_E_SUNEXPERRPKTNUM | \
         INFINIPATH_E_SDROPPEDDATAPKT | INFINIPATH_E_SDROPPEDSMPPKT | \
         INFINIPATH_E_SMINPKTLEN | INFINIPATH_E_SPKTLEN | \
         INFINIPATH_E_INVALIDADDR)
 
+/*
+ * these are errors that can occur when the link changes state while
+ * a packet is being sent or received.  This doesn't cover things
+ * like EBP or VCRC that can be the result of a sending having the
+ * link change state, so we receive a "known bad" packet.
+ */
+#define E_SUM_LINK_PKTERRS \
+       (INFINIPATH_E_SDROPPEDDATAPKT | INFINIPATH_E_SDROPPEDSMPPKT | \
+        INFINIPATH_E_SMINPKTLEN | INFINIPATH_E_SPKTLEN | \
+        INFINIPATH_E_RSHORTPKTLEN | INFINIPATH_E_RMINPKTLEN | \
+        INFINIPATH_E_RUNEXPCHAR)
+
 static u64 handle_e_sum_errs(struct ipath_devdata *dd, ipath_err_t errs)
 {
        unsigned long sbuf[4];
@@ -100,9 +115,7 @@ static u64 handle_e_sum_errs(struct ipath_devdata *dd, ipath_err_t errs)
                if (ipath_debug & __IPATH_PKTDBG)
                        printk("\n");
        }
-       if ((errs & (INFINIPATH_E_SDROPPEDDATAPKT |
-                    INFINIPATH_E_SDROPPEDSMPPKT |
-                    INFINIPATH_E_SMINPKTLEN)) &&
+       if ((errs & E_SUM_LINK_PKTERRS) &&
            !(dd->ipath_flags & IPATH_LINKACTIVE)) {
                /*
                 * This can happen when SMA is trying to bring the link
@@ -111,11 +124,9 @@ static u64 handle_e_sum_errs(struct ipath_devdata *dd, ipath_err_t errs)
                 * valid.  We don't want to confuse people, so we just
                 * don't print them, except at debug
                 */
-               ipath_dbg("Ignoring pktsend errors %llx, because not "
-                         "yet active\n", (unsigned long long) errs);
-               ignore_this_time = INFINIPATH_E_SDROPPEDDATAPKT |
-                       INFINIPATH_E_SDROPPEDSMPPKT |
-                       INFINIPATH_E_SMINPKTLEN;
+               ipath_dbg("Ignoring packet errors %llx, because link not "
+                         "ACTIVE\n", (unsigned long long) errs);
+               ignore_this_time = errs & E_SUM_LINK_PKTERRS;
        }
 
        return ignore_this_time;
@@ -156,7 +167,29 @@ static void handle_e_ibstatuschanged(struct ipath_devdata *dd,
         */
        val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_ibcstatus);
        lstate = val & IPATH_IBSTATE_MASK;
-       if (lstate == IPATH_IBSTATE_INIT || lstate == IPATH_IBSTATE_ARM ||
+
+       /*
+        * this is confusing enough when it happens that I want to always put it
+        * on the console and in the logs.  If it was a requested state change,
+        * we'll have already cleared the flags, so we won't print this warning
+        */
+       if ((lstate != IPATH_IBSTATE_ARM && lstate != IPATH_IBSTATE_ACTIVE)
+               && (dd->ipath_flags & (IPATH_LINKARMED | IPATH_LINKACTIVE))) {
+               dev_info(&dd->pcidev->dev, "Link state changed from %s to %s\n",
+                                (dd->ipath_flags & IPATH_LINKARMED) ? "ARM" : "ACTIVE",
+                                ib_linkstate(lstate));
+               /*
+                * Flush all queued sends when link went to DOWN or INIT,
+                * to be sure that they don't block SMA and other MAD packets
+                */
+               ipath_write_kreg(dd, dd->ipath_kregs->kr_sendctrl,
+                                INFINIPATH_S_ABORT);
+               ipath_disarm_piobufs(dd, dd->ipath_lastport_piobuf,
+                                                       (unsigned)(dd->ipath_piobcnt2k +
+                                       dd->ipath_piobcnt4k) -
+                                       dd->ipath_lastport_piobuf);
+       }
+       else if (lstate == IPATH_IBSTATE_INIT || lstate == IPATH_IBSTATE_ARM ||
            lstate == IPATH_IBSTATE_ACTIVE) {
                /*
                 * only print at SMA if there is a change, debug if not
@@ -229,6 +262,7 @@ static void handle_e_ibstatuschanged(struct ipath_devdata *dd,
                                     | IPATH_LINKACTIVE |
                                     IPATH_LINKARMED);
                *dd->ipath_statusp &= ~IPATH_STATUS_IB_READY;
+               dd->ipath_lli_counter = 0;
                if (!noprint) {
                        if (((dd->ipath_lastibcstat >>
                              INFINIPATH_IBCS_LINKSTATE_SHIFT) &
@@ -350,7 +384,7 @@ static unsigned handle_frequent_errors(struct ipath_devdata *dd,
        return supp_msgs;
 }
 
-static void handle_errors(struct ipath_devdata *dd, ipath_err_t errs)
+static int handle_errors(struct ipath_devdata *dd, ipath_err_t errs)
 {
        char msg[512];
        u64 ignore_this_time = 0;
@@ -379,6 +413,19 @@ static void handle_errors(struct ipath_devdata *dd, ipath_err_t errs)
 
        if (errs & E_SUM_ERRS)
                ignore_this_time = handle_e_sum_errs(dd, errs);
+       else if ((errs & E_SUM_LINK_PKTERRS) &&
+           !(dd->ipath_flags & IPATH_LINKACTIVE)) {
+               /*
+                * This can happen when SMA is trying to bring the link
+                * up, but the IB link changes state at the "wrong" time.
+                * The IB logic then complains that the packet isn't
+                * valid.  We don't want to confuse people, so we just
+                * don't print them, except at debug
+                */
+               ipath_dbg("Ignoring packet errors %llx, because link not "
+                         "ACTIVE\n", (unsigned long long) errs);
+               ignore_this_time = errs & E_SUM_LINK_PKTERRS;
+       }
 
        if (supp_msgs == 250000) {
                /*
@@ -397,7 +444,7 @@ static void handle_errors(struct ipath_devdata *dd, ipath_err_t errs)
                if ((dd->ipath_maskederrs & ~dd->ipath_ignorederrs) &
                    ~(INFINIPATH_E_RRCVEGRFULL | INFINIPATH_E_RRCVHDRFULL))
                        ipath_dev_err(dd, "Disabling error(s) %llx because "
-                                     "occuring too frequently (%s)\n",
+                                     "occurring too frequently (%s)\n",
                                      (unsigned long long)
                                      (dd->ipath_maskederrs &
                                       ~dd->ipath_ignorederrs), msg);
@@ -434,7 +481,7 @@ static void handle_errors(struct ipath_devdata *dd, ipath_err_t errs)
                          INFINIPATH_E_IBSTATUSCHANGED);
        }
        if (!errs)
-               return;
+               return 0;
 
        if (!noprint)
                /*
@@ -493,10 +540,10 @@ static void handle_errors(struct ipath_devdata *dd, ipath_err_t errs)
                                continue;
                        if (hd == (tl + 1) ||
                            (!hd && tl == dd->ipath_hdrqlast)) {
-                               dd->ipath_lastrcvhdrqtails[i] = tl;
-                               pd->port_hdrqfull++;
                                if (i == 0)
                                        chkerrpkts = 1;
+                               dd->ipath_lastrcvhdrqtails[i] = tl;
+                               pd->port_hdrqfull++;
                        }
                }
        }
@@ -558,9 +605,7 @@ static void handle_errors(struct ipath_devdata *dd, ipath_err_t errs)
                wake_up_interruptible(&ipath_sma_state_wait);
        }
 
-       if (chkerrpkts)
-               /* process possible error packets in hdrq */
-               ipath_kreceive(dd);
+       return chkerrpkts;
 }
 
 /* this is separate to allow for better optimization of ipath_intr() */
@@ -678,7 +723,12 @@ set:
                         dd->ipath_sendctrl);
 }
 
-static void handle_rcv(struct ipath_devdata *dd, u32 istat)
+/*
+ * Handle receive interrupts for user ports; this means a user
+ * process was waiting for a packet to arrive, and didn't want
+ * to poll
+ */
+static void handle_urcv(struct ipath_devdata *dd, u32 istat)
 {
        u64 portr;
        int i;
@@ -688,22 +738,17 @@ static void handle_rcv(struct ipath_devdata *dd, u32 istat)
                 infinipath_i_rcvavail_mask)
                | ((istat >> INFINIPATH_I_RCVURG_SHIFT) &
                   infinipath_i_rcvurg_mask);
-       for (i = 0; i < dd->ipath_cfgports; i++) {
+       for (i = 1; i < dd->ipath_cfgports; i++) {
                struct ipath_portdata *pd = dd->ipath_pd[i];
-               if (portr & (1 << i) && pd &&
-                   pd->port_cnt) {
-                       if (i == 0)
-                               ipath_kreceive(dd);
-                       else if (test_bit(IPATH_PORT_WAITING_RCV,
-                                         &pd->port_flag)) {
-                               int rcbit;
-                               clear_bit(IPATH_PORT_WAITING_RCV,
-                                         &pd->port_flag);
-                               rcbit = i + INFINIPATH_R_INTRAVAIL_SHIFT;
-                               clear_bit(1UL << rcbit, &dd->ipath_rcvctrl);
-                               wake_up_interruptible(&pd->port_wait);
-                               rcvdint = 1;
-                       }
+               if (portr & (1 << i) && pd && pd->port_cnt &&
+                       test_bit(IPATH_PORT_WAITING_RCV, &pd->port_flag)) {
+                       int rcbit;
+                       clear_bit(IPATH_PORT_WAITING_RCV,
+                                 &pd->port_flag);
+                       rcbit = i + INFINIPATH_R_INTRAVAIL_SHIFT;
+                       clear_bit(1UL << rcbit, &dd->ipath_rcvctrl);
+                       wake_up_interruptible(&pd->port_wait);
+                       rcvdint = 1;
                }
        }
        if (rcvdint) {
@@ -719,16 +764,19 @@ static void handle_rcv(struct ipath_devdata *dd, u32 istat)
 irqreturn_t ipath_intr(int irq, void *data, struct pt_regs *regs)
 {
        struct ipath_devdata *dd = data;
-       u32 istat;
+       u32 istat, chk0rcv = 0;
        ipath_err_t estat = 0;
-       static unsigned unexpected = 0;
        irqreturn_t ret;
+       u32 oldhead, curtail;
+       static unsigned unexpected = 0;
+       static const u32 port0rbits = (1U<<INFINIPATH_I_RCVAVAIL_SHIFT) |
+                (1U<<INFINIPATH_I_RCVURG_SHIFT);
+
+       ipath_stats.sps_ints++;
 
-       if(!(dd->ipath_flags & IPATH_PRESENT)) {
-               /* this is mostly so we don't try to touch the chip while
-                * it is being reset */
+       if (!(dd->ipath_flags & IPATH_PRESENT)) {
                /*
-                * This return value is perhaps odd, but we do not want the
+                * This return value is not great, but we do not want the
                 * interrupt core code to remove our interrupt handler
                 * because we don't appear to be handling an interrupt
                 * during a chip reset.
@@ -736,7 +784,51 @@ irqreturn_t ipath_intr(int irq, void *data, struct pt_regs *regs)
                return IRQ_HANDLED;
        }
 
+       /*
+        * this needs to be flags&initted, not statusp, so we keep
+        * taking interrupts even after link goes down, etc.
+        * Also, we *must* clear the interrupt at some point, or we won't
+        * take it again, which can be real bad for errors, etc...
+        */
+
+       if (!(dd->ipath_flags & IPATH_INITTED)) {
+               ipath_bad_intr(dd, &unexpected);
+               ret = IRQ_NONE;
+               goto bail;
+       }
+
+       /*
+        * We try to avoid reading the interrupt status register, since
+        * that's a PIO read, and stalls the processor for up to about
+        * ~0.25 usec. The idea is that if we processed a port0 packet,
+        * we blindly clear the  port 0 receive interrupt bits, and nothing
+        * else, then return.  If other interrupts are pending, the chip
+        * will re-interrupt us as soon as we write the intclear register.
+        * We then won't process any more kernel packets (if not the 2nd
+        * time, then the 3rd or 4th) and we'll then handle the other
+        * interrupts.   We clear the interrupts first so that we don't
+        * lose intr for later packets that arrive while we are processing.
+        */
+       oldhead = dd->ipath_port0head;
+       curtail = (u32)le64_to_cpu(*dd->ipath_hdrqtailptr);
+       if (oldhead != curtail) {
+               if (dd->ipath_flags & IPATH_GPIO_INTR) {
+                       ipath_write_kreg(dd, dd->ipath_kregs->kr_gpio_clear,
+                                        (u64) (1 << 2));
+                       istat = port0rbits | INFINIPATH_I_GPIO;
+               }
+               else
+                       istat = port0rbits;
+               ipath_write_kreg(dd, dd->ipath_kregs->kr_intclear, istat);
+               ipath_kreceive(dd);
+               if (oldhead != dd->ipath_port0head) {
+                       ipath_stats.sps_fastrcvint++;
+                       goto done;
+               }
+       }
+
        istat = ipath_read_kreg32(dd, dd->ipath_kregs->kr_intstatus);
+
        if (unlikely(!istat)) {
                ipath_stats.sps_nullintr++;
                ret = IRQ_NONE; /* not our interrupt, or already handled */
@@ -749,31 +841,17 @@ irqreturn_t ipath_intr(int irq, void *data, struct pt_regs *regs)
                goto bail;
        }
 
-       ipath_stats.sps_ints++;
-
-       /*
-        * this needs to be flags&initted, not statusp, so we keep
-        * taking interrupts even after link goes down, etc.
-        * Also, we *must* clear the interrupt at some point, or we won't
-        * take it again, which can be real bad for errors, etc...
-        */
-
-       if (!(dd->ipath_flags & IPATH_INITTED)) {
-               ipath_bad_intr(dd, &unexpected);
-               ret = IRQ_NONE;
-               goto bail;
-       }
        if (unexpected)
                unexpected = 0;
 
-       ipath_cdbg(VERBOSE, "intr stat=0x%x\n", istat);
-
-       if (istat & ~infinipath_i_bitsextant)
+       if (unlikely(istat & ~infinipath_i_bitsextant))
                ipath_dev_err(dd,
                              "interrupt with unknown interrupts %x set\n",
                              istat & (u32) ~ infinipath_i_bitsextant);
+       else
+               ipath_cdbg(VERBOSE, "intr stat=0x%x\n", istat);
 
-       if (istat & INFINIPATH_I_ERROR) {
+       if (unlikely(istat & INFINIPATH_I_ERROR)) {
                ipath_stats.sps_errints++;
                estat = ipath_read_kreg64(dd,
                                          dd->ipath_kregs->kr_errorstatus);
@@ -788,10 +866,18 @@ irqreturn_t ipath_intr(int irq, void *data, struct pt_regs *regs)
                        ipath_dev_err(dd, "Read of error status failed "
                                      "(all bits set); ignoring\n");
                else
-                       handle_errors(dd, estat);
+                       if (handle_errors(dd, estat))
+                               /* force calling ipath_kreceive() */
+                               chk0rcv = 1;
        }
 
        if (istat & INFINIPATH_I_GPIO) {
+               /*
+                * Packets are available in the port 0 rcv queue.
+                * Eventually this needs to be generalized to check
+                * IPATH_GPIO_INTR, and the specific GPIO bit, if
+                * GPIO interrupts are used for anything else.
+                */
                if (unlikely(!(dd->ipath_flags & IPATH_GPIO_INTR))) {
                        u32 gpiostatus;
                        gpiostatus = ipath_read_kreg32(
@@ -804,27 +890,39 @@ irqreturn_t ipath_intr(int irq, void *data, struct pt_regs *regs)
                else {
                        /* Clear GPIO status bit 2 */
                        ipath_write_kreg(dd, dd->ipath_kregs->kr_gpio_clear,
-                                        (u64) (1 << 2));
-
-                       /*
-                        * Packets are available in the port 0 rcv queue.
-                        * Eventually this needs to be generalized to check
-                        * IPATH_GPIO_INTR, and the specific GPIO bit, if
-                        * GPIO interrupts are used for anything else.
-                        */
-                       ipath_kreceive(dd);
+                                       (u64) (1 << 2));
+                       chk0rcv = 1;
                }
        }
+       chk0rcv |= istat & port0rbits;
 
        /*
-        * clear the ones we will deal with on this round
-        * We clear it early, mostly for receive interrupts, so we
-        * know the chip will have seen this by the time we process
-        * the queue, and will re-interrupt if necessary.  The processor
-        * itself won't take the interrupt again until we return.
+        * Clear the interrupt bits we found set, unless they are receive
+        * related, in which case we already cleared them above, and don't
+        * want to clear them again, because we might lose an interrupt.
+        * Clear it early, so we "know" know the chip will have seen this by
+        * the time we process the queue, and will re-interrupt if necessary.
+        * The processor itself won't take the interrupt again until we return.
         */
        ipath_write_kreg(dd, dd->ipath_kregs->kr_intclear, istat);
 
+       /*
+        * handle port0 receive  before checking for pio buffers available,
+        * since receives can overflow; piobuf waiters can afford a few
+        * extra cycles, since they were waiting anyway, and user's waiting
+        * for receive are at the bottom.
+        */
+       if (chk0rcv) {
+               ipath_kreceive(dd);
+               istat &= ~port0rbits;
+       }
+
+       if (istat & ((infinipath_i_rcvavail_mask <<
+                     INFINIPATH_I_RCVAVAIL_SHIFT)
+                    | (infinipath_i_rcvurg_mask <<
+                       INFINIPATH_I_RCVURG_SHIFT)))
+               handle_urcv(dd, istat);
+
        if (istat & INFINIPATH_I_SPIOBUFAVAIL) {
                clear_bit(IPATH_S_PIOINTBUFAVAIL, &dd->ipath_sendctrl);
                ipath_write_kreg(dd, dd->ipath_kregs->kr_sendctrl,
@@ -836,17 +934,7 @@ irqreturn_t ipath_intr(int irq, void *data, struct pt_regs *regs)
                handle_layer_pioavail(dd);
        }
 
-       /*
-        * we check for both transition from empty to non-empty, and urgent
-        * packets (those with the interrupt bit set in the header)
-        */
-
-       if (istat & ((infinipath_i_rcvavail_mask <<
-                     INFINIPATH_I_RCVAVAIL_SHIFT)
-                    | (infinipath_i_rcvurg_mask <<
-                       INFINIPATH_I_RCVURG_SHIFT)))
-               handle_rcv(dd, istat);
-
+done:
        ret = IRQ_HANDLED;
 
 bail:
index 5d92d57b6f5479310a8206812d6d2516e526f71b..e9f374fb641ef6f1c8e0870e9e47551bc623188f 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _IPATH_KERNEL_H
 #define _IPATH_KERNEL_H
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -61,9 +62,7 @@ struct ipath_portdata {
        /* rcvhdrq base, needs mmap before useful */
        void *port_rcvhdrq;
        /* kernel virtual address where hdrqtail is updated */
-       u64 *port_rcvhdrtail_kvaddr;
-       /* page * used for uaddr */
-       struct page *port_rcvhdrtail_pagep;
+       volatile __le64 *port_rcvhdrtail_kvaddr;
        /*
         * temp buffer for expected send setup, allocated at open, instead
         * of each setup call
@@ -78,11 +77,7 @@ struct ipath_portdata {
        dma_addr_t port_rcvegr_phys;
        /* mmap of hdrq, must fit in 44 bits */
        dma_addr_t port_rcvhdrq_phys;
-       /*
-        * the actual user address that we ipath_mlock'ed, so we can
-        * ipath_munlock it at close
-        */
-       unsigned long port_rcvhdrtail_uaddr;
+       dma_addr_t port_rcvhdrqtailaddr_phys;
        /*
         * number of opens on this instance (0 or 1; ignoring forks, dup,
         * etc. for now)
@@ -157,17 +152,11 @@ struct ipath_devdata {
        unsigned long ipath_physaddr;
        /* base of memory alloced for ipath_kregbase, for free */
        u64 *ipath_kregalloc;
-       /*
-        * version of kregbase that doesn't have high bits set (for 32 bit
-        * programs, so mmap64 44 bit works)
-        */
-       u64 __iomem *ipath_kregvirt;
        /*
         * virtual address where port0 rcvhdrqtail updated for this unit.
         * only written to by the chip, not the driver.
         */
        volatile __le64 *ipath_hdrqtailptr;
-       dma_addr_t ipath_dma_addr;
        /* ipath_cfgports pointers */
        struct ipath_portdata **ipath_pd;
        /* sk_buffs used by port 0 eager receive queue */
@@ -354,13 +343,17 @@ struct ipath_devdata {
        char *ipath_freezemsg;
        /* pci access data structure */
        struct pci_dev *pcidev;
-       struct cdev *cdev;
-       struct class_device *class_dev;
+       struct cdev *user_cdev;
+       struct cdev *diag_cdev;
+       struct class_device *user_class_dev;
+       struct class_device *diag_class_dev;
        /* timer used to prevent stats overflow, error throttling, etc. */
        struct timer_list ipath_stats_timer;
        /* check for stale messages in rcv queue */
        /* only allow one intr at a time. */
        unsigned long ipath_rcv_pending;
+       void *ipath_dummy_hdrq; /* used after port close */
+       dma_addr_t ipath_dummy_hdrq_phys;
 
        /*
         * Shadow copies of registers; size indicates read access size.
@@ -500,8 +493,11 @@ struct ipath_devdata {
        u16 ipath_lid;
        /* list of pkeys programmed; 0 if not set */
        u16 ipath_pkeys[4];
-       /* ASCII serial number, from flash */
-       u8 ipath_serial[12];
+       /*
+        * ASCII serial number, from flash, large enough for original
+        * all digit strings, and longer QLogic serial number format
+        */
+       u8 ipath_serial[16];
        /* human readable board version */
        u8 ipath_boardversion[80];
        /* chip major rev, from ipath_revision */
@@ -516,12 +512,12 @@ struct ipath_devdata {
        u8 ipath_pci_cacheline;
        /* LID mask control */
        u8 ipath_lmc;
-};
-
-extern volatile __le64 *ipath_port0_rcvhdrtail;
-extern dma_addr_t ipath_port0_rcvhdrtail_dma;
 
-#define IPATH_PORT0_RCVHDRTAIL_SIZE PAGE_SIZE
+       /* local link integrity counter */
+       u32 ipath_lli_counter;
+       /* local link integrity errors */
+       u32 ipath_lli_errors;
+};
 
 extern struct list_head ipath_dev_list;
 extern spinlock_t ipath_devs_lock;
@@ -537,7 +533,7 @@ extern int __ipath_verbs_piobufavail(struct ipath_devdata *);
 extern int __ipath_verbs_rcv(struct ipath_devdata *, void *, void *, u32);
 
 void ipath_layer_add(struct ipath_devdata *);
-void ipath_layer_del(struct ipath_devdata *);
+void ipath_layer_remove(struct ipath_devdata *);
 
 int ipath_init_chip(struct ipath_devdata *, int);
 int ipath_enable_wc(struct ipath_devdata *dd);
@@ -551,14 +547,14 @@ int ipath_cdev_init(int minor, char *name, struct file_operations *fops,
 void ipath_cdev_cleanup(struct cdev **cdevp,
                        struct class_device **class_devp);
 
-int ipath_diag_init(void);
-void ipath_diag_cleanup(void);
+int ipath_diag_add(struct ipath_devdata *);
+void ipath_diag_remove(struct ipath_devdata *);
 void ipath_diag_bringup_link(struct ipath_devdata *);
 
 extern wait_queue_head_t ipath_sma_state_wait;
 
 int ipath_user_add(struct ipath_devdata *dd);
-void ipath_user_del(struct ipath_devdata *dd);
+void ipath_user_remove(struct ipath_devdata *dd);
 
 struct sk_buff *ipath_alloc_skb(struct ipath_devdata *dd, gfp_t);
 
@@ -582,7 +578,7 @@ void ipath_disarm_piobufs(struct ipath_devdata *, unsigned first,
                          unsigned cnt);
 
 int ipath_create_rcvhdrq(struct ipath_devdata *, struct ipath_portdata *);
-void ipath_free_pddata(struct ipath_devdata *, u32, int);
+void ipath_free_pddata(struct ipath_devdata *, struct ipath_portdata *);
 
 int ipath_parse_ushort(const char *str, unsigned short *valp);
 
@@ -720,13 +716,8 @@ u64 ipath_read_kreg64_port(const struct ipath_devdata *, ipath_kreg,
  * @port: port number
  *
  * Return the contents of a register that is virtualized to be per port.
- * Prints a debug message and returns -1 on errors (not distinguishable from
- * valid contents at runtime; we may add a separate error variable at some
- * point).
- *
- * This is normally not used by the kernel, but may be for debugging, and
- * has a different implementation than user mode, which is why it's not in
- * _common.h.
+ * Returns -1 on errors (not distinguishable from valid contents at
+ * runtime; we may add a separate error variable at some point).
  */
 static inline u32 ipath_read_ureg32(const struct ipath_devdata *dd,
                                    ipath_ureg regno, int port)
@@ -842,9 +833,10 @@ extern struct mutex ipath_mutex;
 
 #define IPATH_DRV_NAME         "ipath_core"
 #define IPATH_MAJOR            233
+#define IPATH_USER_MINOR_BASE  0
 #define IPATH_SMA_MINOR                128
-#define IPATH_DIAG_MINOR       129
-#define IPATH_NMINORS          130
+#define IPATH_DIAG_MINOR_BASE  129
+#define IPATH_NMINORS          255
 
 #define ipath_dev_err(dd,fmt,...) \
        do { \
index 5ae8761f9dd2e8b3ed5dc86430ac9617c251aab9..46773c673a1af9f587eef5e9fd743503b98f476b 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -120,6 +121,7 @@ int ipath_lkey_ok(struct ipath_lkey_table *rkt, struct ipath_sge *isge,
                  struct ib_sge *sge, int acc)
 {
        struct ipath_mregion *mr;
+       unsigned n, m;
        size_t off;
        int ret;
 
@@ -151,20 +153,22 @@ int ipath_lkey_ok(struct ipath_lkey_table *rkt, struct ipath_sge *isge,
        }
 
        off += mr->offset;
-       isge->mr = mr;
-       isge->m = 0;
-       isge->n = 0;
-       while (off >= mr->map[isge->m]->segs[isge->n].length) {
-               off -= mr->map[isge->m]->segs[isge->n].length;
-               isge->n++;
-               if (isge->n >= IPATH_SEGSZ) {
-                       isge->m++;
-                       isge->n = 0;
+       m = 0;
+       n = 0;
+       while (off >= mr->map[m]->segs[n].length) {
+               off -= mr->map[m]->segs[n].length;
+               n++;
+               if (n >= IPATH_SEGSZ) {
+                       m++;
+                       n = 0;
                }
        }
-       isge->vaddr = mr->map[isge->m]->segs[isge->n].vaddr + off;
-       isge->length = mr->map[isge->m]->segs[isge->n].length - off;
+       isge->mr = mr;
+       isge->vaddr = mr->map[m]->segs[n].vaddr + off;
+       isge->length = mr->map[m]->segs[n].length - off;
        isge->sge_length = sge->length;
+       isge->m = m;
+       isge->n = n;
 
        ret = 1;
 
@@ -189,6 +193,7 @@ int ipath_rkey_ok(struct ipath_ibdev *dev, struct ipath_sge_state *ss,
        struct ipath_lkey_table *rkt = &dev->lk_table;
        struct ipath_sge *sge = &ss->sge;
        struct ipath_mregion *mr;
+       unsigned n, m;
        size_t off;
        int ret;
 
@@ -206,20 +211,22 @@ int ipath_rkey_ok(struct ipath_ibdev *dev, struct ipath_sge_state *ss,
        }
 
        off += mr->offset;
-       sge->mr = mr;
-       sge->m = 0;
-       sge->n = 0;
-       while (off >= mr->map[sge->m]->segs[sge->n].length) {
-               off -= mr->map[sge->m]->segs[sge->n].length;
-               sge->n++;
-               if (sge->n >= IPATH_SEGSZ) {
-                       sge->m++;
-                       sge->n = 0;
+       m = 0;
+       n = 0;
+       while (off >= mr->map[m]->segs[n].length) {
+               off -= mr->map[m]->segs[n].length;
+               n++;
+               if (n >= IPATH_SEGSZ) {
+                       m++;
+                       n = 0;
                }
        }
-       sge->vaddr = mr->map[sge->m]->segs[sge->n].vaddr + off;
-       sge->length = mr->map[sge->m]->segs[sge->n].length - off;
+       sge->mr = mr;
+       sge->vaddr = mr->map[m]->segs[n].vaddr + off;
+       sge->length = mr->map[m]->segs[n].length - off;
        sge->sge_length = len;
+       sge->m = m;
+       sge->n = n;
        ss->sg_list = NULL;
        ss->num_sge = 1;
 
index 9ec4ac77b87f88df622d5b1d3bc3acf421d3c9b1..b28c6f81c73121b2195ef3667b30396d479ea9a1 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -40,8 +41,8 @@
 #include <asm/byteorder.h>
 
 #include "ipath_kernel.h"
-#include "ips_common.h"
 #include "ipath_layer.h"
+#include "ipath_common.h"
 
 /* Acquire before ipath_devs_lock. */
 static DEFINE_MUTEX(ipath_layer_mutex);
@@ -299,9 +300,8 @@ bail:
 
 EXPORT_SYMBOL_GPL(ipath_layer_set_mtu);
 
-int ipath_set_sps_lid(struct ipath_devdata *dd, u32 arg, u8 lmc)
+int ipath_set_lid(struct ipath_devdata *dd, u32 arg, u8 lmc)
 {
-       ipath_stats.sps_lid[dd->ipath_unit] = arg;
        dd->ipath_lid = arg;
        dd->ipath_lmc = lmc;
 
@@ -315,7 +315,7 @@ int ipath_set_sps_lid(struct ipath_devdata *dd, u32 arg, u8 lmc)
        return 0;
 }
 
-EXPORT_SYMBOL_GPL(ipath_set_sps_lid);
+EXPORT_SYMBOL_GPL(ipath_set_lid);
 
 int ipath_layer_set_guid(struct ipath_devdata *dd, __be64 guid)
 {
@@ -340,18 +340,26 @@ u32 ipath_layer_get_nguid(struct ipath_devdata *dd)
 
 EXPORT_SYMBOL_GPL(ipath_layer_get_nguid);
 
-int ipath_layer_query_device(struct ipath_devdata *dd, u32 * vendor,
-                            u32 * boardrev, u32 * majrev, u32 * minrev)
+u32 ipath_layer_get_majrev(struct ipath_devdata *dd)
 {
-       *vendor = dd->ipath_vendorid;
-       *boardrev = dd->ipath_boardrev;
-       *majrev = dd->ipath_majrev;
-       *minrev = dd->ipath_minrev;
+       return dd->ipath_majrev;
+}
 
-       return 0;
+EXPORT_SYMBOL_GPL(ipath_layer_get_majrev);
+
+u32 ipath_layer_get_minrev(struct ipath_devdata *dd)
+{
+       return dd->ipath_minrev;
+}
+
+EXPORT_SYMBOL_GPL(ipath_layer_get_minrev);
+
+u32 ipath_layer_get_pcirev(struct ipath_devdata *dd)
+{
+       return dd->ipath_pcirev;
 }
 
-EXPORT_SYMBOL_GPL(ipath_layer_query_device);
+EXPORT_SYMBOL_GPL(ipath_layer_get_pcirev);
 
 u32 ipath_layer_get_flags(struct ipath_devdata *dd)
 {
@@ -374,6 +382,13 @@ u16 ipath_layer_get_deviceid(struct ipath_devdata *dd)
 
 EXPORT_SYMBOL_GPL(ipath_layer_get_deviceid);
 
+u32 ipath_layer_get_vendorid(struct ipath_devdata *dd)
+{
+       return dd->ipath_vendorid;
+}
+
+EXPORT_SYMBOL_GPL(ipath_layer_get_vendorid);
+
 u64 ipath_layer_get_lastibcstat(struct ipath_devdata *dd)
 {
        return dd->ipath_lastibcstat;
@@ -403,7 +418,7 @@ void ipath_layer_add(struct ipath_devdata *dd)
        mutex_unlock(&ipath_layer_mutex);
 }
 
-void ipath_layer_del(struct ipath_devdata *dd)
+void ipath_layer_remove(struct ipath_devdata *dd)
 {
        mutex_lock(&ipath_layer_mutex);
 
@@ -607,7 +622,7 @@ int ipath_layer_open(struct ipath_devdata *dd, u32 * pktmax)
                goto bail;
        }
 
-       ret = ipath_setrcvhdrsize(dd, NUM_OF_EXTRA_WORDS_IN_HEADER_QUEUE);
+       ret = ipath_setrcvhdrsize(dd, IPATH_HEADER_QUEUE_WORDS);
 
        if (ret < 0)
                goto bail;
@@ -616,9 +631,9 @@ int ipath_layer_open(struct ipath_devdata *dd, u32 * pktmax)
 
        if (*dd->ipath_statusp & IPATH_STATUS_IB_READY)
                intval |= IPATH_LAYER_INT_IF_UP;
-       if (ipath_stats.sps_lid[dd->ipath_unit])
+       if (dd->ipath_lid)
                intval |= IPATH_LAYER_INT_LID;
-       if (ipath_stats.sps_mlid[dd->ipath_unit])
+       if (dd->ipath_mlid)
                intval |= IPATH_LAYER_INT_BCAST;
        /*
         * do this on open, in case low level is already up and
@@ -884,7 +899,7 @@ static void copy_io(u32 __iomem *piobuf, struct ipath_sge_state *ss,
 /**
  * ipath_verbs_send - send a packet from the verbs layer
  * @dd: the infinipath device
- * @hdrwords: the number of works in the header
+ * @hdrwords: the number of words in the header
  * @hdr: the packet header
  * @len: the length of the packet in bytes
  * @ss: the SGE to send
@@ -1016,19 +1031,22 @@ int ipath_layer_get_counters(struct ipath_devdata *dd,
                ipath_snap_cntr(dd, dd->ipath_cregs->cr_ibsymbolerrcnt);
        cntrs->link_error_recovery_counter =
                ipath_snap_cntr(dd, dd->ipath_cregs->cr_iblinkerrrecovcnt);
+       /*
+        * The link downed counter counts when the other side downs the
+        * connection.  We add in the number of times we downed the link
+        * due to local link integrity errors to compensate.
+        */
        cntrs->link_downed_counter =
                ipath_snap_cntr(dd, dd->ipath_cregs->cr_iblinkdowncnt);
        cntrs->port_rcv_errors =
                ipath_snap_cntr(dd, dd->ipath_cregs->cr_rxdroppktcnt) +
                ipath_snap_cntr(dd, dd->ipath_cregs->cr_rcvovflcnt) +
                ipath_snap_cntr(dd, dd->ipath_cregs->cr_portovflcnt) +
-               ipath_snap_cntr(dd, dd->ipath_cregs->cr_errrcvflowctrlcnt) +
                ipath_snap_cntr(dd, dd->ipath_cregs->cr_err_rlencnt) +
                ipath_snap_cntr(dd, dd->ipath_cregs->cr_invalidrlencnt) +
                ipath_snap_cntr(dd, dd->ipath_cregs->cr_erricrccnt) +
                ipath_snap_cntr(dd, dd->ipath_cregs->cr_errvcrccnt) +
                ipath_snap_cntr(dd, dd->ipath_cregs->cr_errlpcrccnt) +
-               ipath_snap_cntr(dd, dd->ipath_cregs->cr_errlinkcnt) +
                ipath_snap_cntr(dd, dd->ipath_cregs->cr_badformatcnt);
        cntrs->port_rcv_remphys_errors =
                ipath_snap_cntr(dd, dd->ipath_cregs->cr_rcvebpcnt);
@@ -1042,6 +1060,8 @@ int ipath_layer_get_counters(struct ipath_devdata *dd,
                ipath_snap_cntr(dd, dd->ipath_cregs->cr_pktsendcnt);
        cntrs->port_rcv_packets =
                ipath_snap_cntr(dd, dd->ipath_cregs->cr_pktrcvcnt);
+       cntrs->local_link_integrity_errors = dd->ipath_lli_errors;
+       cntrs->excessive_buffer_overrun_errors = 0; /* XXX */
 
        ret = 0;
 
@@ -1086,10 +1106,10 @@ int ipath_layer_send_hdr(struct ipath_devdata *dd, struct ether_header *hdr)
                }
 
        vlsllnh = *((__be16 *) hdr);
-       if (vlsllnh != htons(IPS_LRH_BTH)) {
+       if (vlsllnh != htons(IPATH_LRH_BTH)) {
                ipath_dbg("Warning: lrh[0] wrong (%x, not %x); "
                          "not sending\n", be16_to_cpu(vlsllnh),
-                         IPS_LRH_BTH);
+                         IPATH_LRH_BTH);
                ret = -EINVAL;
        }
        if (ret)
index 6fefd15bd2da6f2dab304c7a5be54f62ae3d9daf..71485096fcacabc1deb7cb5e8295e0020847fc2b 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -54,6 +55,8 @@ struct ipath_layer_counters {
        u64 port_rcv_data;
        u64 port_xmit_packets;
        u64 port_rcv_packets;
+       u32 local_link_integrity_errors;
+       u32 excessive_buffer_overrun_errors;
 };
 
 /*
@@ -126,7 +129,7 @@ u16 ipath_layer_get_bcast(struct ipath_devdata *dd);
 u32 ipath_layer_get_cr_errpkey(struct ipath_devdata *dd);
 int ipath_layer_set_linkstate(struct ipath_devdata *dd, u8 state);
 int ipath_layer_set_mtu(struct ipath_devdata *, u16);
-int ipath_set_sps_lid(struct ipath_devdata *, u32, u8);
+int ipath_set_lid(struct ipath_devdata *, u32, u8);
 int ipath_layer_send_hdr(struct ipath_devdata *dd,
                         struct ether_header *hdr);
 int ipath_verbs_send(struct ipath_devdata *dd, u32 hdrwords,
@@ -143,11 +146,13 @@ int ipath_layer_want_buffer(struct ipath_devdata *dd);
 int ipath_layer_set_guid(struct ipath_devdata *, __be64 guid);
 __be64 ipath_layer_get_guid(struct ipath_devdata *);
 u32 ipath_layer_get_nguid(struct ipath_devdata *);
-int ipath_layer_query_device(struct ipath_devdata *, u32 * vendor,
-                            u32 * boardrev, u32 * majrev, u32 * minrev);
+u32 ipath_layer_get_majrev(struct ipath_devdata *);
+u32 ipath_layer_get_minrev(struct ipath_devdata *);
+u32 ipath_layer_get_pcirev(struct ipath_devdata *);
 u32 ipath_layer_get_flags(struct ipath_devdata *dd);
 struct device *ipath_layer_get_device(struct ipath_devdata *dd);
 u16 ipath_layer_get_deviceid(struct ipath_devdata *dd);
+u32 ipath_layer_get_vendorid(struct ipath_devdata *);
 u64 ipath_layer_get_lastibcstat(struct ipath_devdata *dd);
 u32 ipath_layer_get_ibmtu(struct ipath_devdata *dd);
 int ipath_layer_enable_timer(struct ipath_devdata *dd);
index 1a9d0a2c33c37f6aa4d158f1505dc501548486ad..d3402341b7d0dddc154c1e765e6fe988ad72d091 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -34,7 +35,7 @@
 
 #include "ipath_kernel.h"
 #include "ipath_verbs.h"
-#include "ips_common.h"
+#include "ipath_common.h"
 
 #define IB_SMP_UNSUP_VERSION   __constant_htons(0x0004)
 #define IB_SMP_UNSUP_METHOD    __constant_htons(0x0008)
@@ -84,7 +85,7 @@ static int recv_subn_get_nodeinfo(struct ib_smp *smp,
 {
        struct nodeinfo *nip = (struct nodeinfo *)&smp->data;
        struct ipath_devdata *dd = to_idev(ibdev)->dd;
-       u32 vendor, boardid, majrev, minrev;
+       u32 vendor, majrev, minrev;
 
        if (smp->attr_mod)
                smp->status |= IB_SMP_INVALID_FIELD;
@@ -104,9 +105,11 @@ static int recv_subn_get_nodeinfo(struct ib_smp *smp,
        nip->port_guid = nip->sys_guid;
        nip->partition_cap = cpu_to_be16(ipath_layer_get_npkeys(dd));
        nip->device_id = cpu_to_be16(ipath_layer_get_deviceid(dd));
-       ipath_layer_query_device(dd, &vendor, &boardid, &majrev, &minrev);
+       majrev = ipath_layer_get_majrev(dd);
+       minrev = ipath_layer_get_minrev(dd);
        nip->revision = cpu_to_be32((majrev << 16) | minrev);
        nip->local_port_num = port;
+       vendor = ipath_layer_get_vendorid(dd);
        nip->vendor_id[0] = 0;
        nip->vendor_id[1] = vendor >> 8;
        nip->vendor_id[2] = vendor;
@@ -215,7 +218,7 @@ static int recv_subn_get_portinfo(struct ib_smp *smp,
        /* P_KeyViolations are counted by hardware. */
        pip->pkey_violations =
                cpu_to_be16((ipath_layer_get_cr_errpkey(dev->dd) -
-                            dev->n_pkey_violations) & 0xFFFF);
+                            dev->z_pkey_violations) & 0xFFFF);
        pip->qkey_violations = cpu_to_be16(dev->qkey_violations);
        /* Only the hardware GUID is supported for now */
        pip->guid_cap = 1;
@@ -303,9 +306,9 @@ static int recv_subn_set_portinfo(struct ib_smp *smp,
        lid = be16_to_cpu(pip->lid);
        if (lid != ipath_layer_get_lid(dev->dd)) {
                /* Must be a valid unicast LID address. */
-               if (lid == 0 || lid >= IPS_MULTICAST_LID_BASE)
+               if (lid == 0 || lid >= IPATH_MULTICAST_LID_BASE)
                        goto err;
-               ipath_set_sps_lid(dev->dd, lid, pip->mkeyprot_resv_lmc & 7);
+               ipath_set_lid(dev->dd, lid, pip->mkeyprot_resv_lmc & 7);
                event.event = IB_EVENT_LID_CHANGE;
                ib_dispatch_event(&event);
        }
@@ -313,7 +316,7 @@ static int recv_subn_set_portinfo(struct ib_smp *smp,
        smlid = be16_to_cpu(pip->sm_lid);
        if (smlid != dev->sm_lid) {
                /* Must be a valid unicast LID address. */
-               if (smlid == 0 || smlid >= IPS_MULTICAST_LID_BASE)
+               if (smlid == 0 || smlid >= IPATH_MULTICAST_LID_BASE)
                        goto err;
                dev->sm_lid = smlid;
                event.event = IB_EVENT_SM_CHANGE;
@@ -389,7 +392,7 @@ static int recv_subn_set_portinfo(struct ib_smp *smp,
         * later.
         */
        if (pip->pkey_violations == 0)
-               dev->n_pkey_violations =
+               dev->z_pkey_violations =
                        ipath_layer_get_cr_errpkey(dev->dd);
 
        if (pip->qkey_violations == 0)
@@ -610,6 +613,9 @@ struct ib_pma_portcounters {
 #define IB_PMA_SEL_PORT_RCV_ERRORS             __constant_htons(0x0008)
 #define IB_PMA_SEL_PORT_RCV_REMPHYS_ERRORS     __constant_htons(0x0010)
 #define IB_PMA_SEL_PORT_XMIT_DISCARDS          __constant_htons(0x0040)
+#define IB_PMA_SEL_LOCAL_LINK_INTEGRITY_ERRORS __constant_htons(0x0200)
+#define IB_PMA_SEL_EXCESSIVE_BUFFER_OVERRUNS   __constant_htons(0x0400)
+#define IB_PMA_SEL_PORT_VL15_DROPPED           __constant_htons(0x0800)
 #define IB_PMA_SEL_PORT_XMIT_DATA              __constant_htons(0x1000)
 #define IB_PMA_SEL_PORT_RCV_DATA               __constant_htons(0x2000)
 #define IB_PMA_SEL_PORT_XMIT_PACKETS           __constant_htons(0x4000)
@@ -844,18 +850,22 @@ static int recv_pma_get_portcounters(struct ib_perf *pmp,
        ipath_layer_get_counters(dev->dd, &cntrs);
 
        /* Adjust counters for any resets done. */
-       cntrs.symbol_error_counter -= dev->n_symbol_error_counter;
+       cntrs.symbol_error_counter -= dev->z_symbol_error_counter;
        cntrs.link_error_recovery_counter -=
-               dev->n_link_error_recovery_counter;
-       cntrs.link_downed_counter -= dev->n_link_downed_counter;
+               dev->z_link_error_recovery_counter;
+       cntrs.link_downed_counter -= dev->z_link_downed_counter;
        cntrs.port_rcv_errors += dev->rcv_errors;
-       cntrs.port_rcv_errors -= dev->n_port_rcv_errors;
-       cntrs.port_rcv_remphys_errors -= dev->n_port_rcv_remphys_errors;
-       cntrs.port_xmit_discards -= dev->n_port_xmit_discards;
-       cntrs.port_xmit_data -= dev->n_port_xmit_data;
-       cntrs.port_rcv_data -= dev->n_port_rcv_data;
-       cntrs.port_xmit_packets -= dev->n_port_xmit_packets;
-       cntrs.port_rcv_packets -= dev->n_port_rcv_packets;
+       cntrs.port_rcv_errors -= dev->z_port_rcv_errors;
+       cntrs.port_rcv_remphys_errors -= dev->z_port_rcv_remphys_errors;
+       cntrs.port_xmit_discards -= dev->z_port_xmit_discards;
+       cntrs.port_xmit_data -= dev->z_port_xmit_data;
+       cntrs.port_rcv_data -= dev->z_port_rcv_data;
+       cntrs.port_xmit_packets -= dev->z_port_xmit_packets;
+       cntrs.port_rcv_packets -= dev->z_port_rcv_packets;
+       cntrs.local_link_integrity_errors -=
+               dev->z_local_link_integrity_errors;
+       cntrs.excessive_buffer_overrun_errors -=
+               dev->z_excessive_buffer_overrun_errors;
 
        memset(pmp->data, 0, sizeof(pmp->data));
 
@@ -893,6 +903,16 @@ static int recv_pma_get_portcounters(struct ib_perf *pmp,
        else
                p->port_xmit_discards =
                        cpu_to_be16((u16)cntrs.port_xmit_discards);
+       if (cntrs.local_link_integrity_errors > 0xFUL)
+               cntrs.local_link_integrity_errors = 0xFUL;
+       if (cntrs.excessive_buffer_overrun_errors > 0xFUL)
+               cntrs.excessive_buffer_overrun_errors = 0xFUL;
+       p->lli_ebor_errors = (cntrs.local_link_integrity_errors << 4) |
+               cntrs.excessive_buffer_overrun_errors;
+       if (dev->n_vl15_dropped > 0xFFFFUL)
+               p->vl15_dropped = __constant_cpu_to_be16(0xFFFF);
+       else
+               p->vl15_dropped = cpu_to_be16((u16)dev->n_vl15_dropped);
        if (cntrs.port_xmit_data > 0xFFFFFFFFUL)
                p->port_xmit_data = __constant_cpu_to_be32(0xFFFFFFFF);
        else
@@ -928,10 +948,10 @@ static int recv_pma_get_portcounters_ext(struct ib_perf *pmp,
                                      &rpkts, &xwait);
 
        /* Adjust counters for any resets done. */
-       swords -= dev->n_port_xmit_data;
-       rwords -= dev->n_port_rcv_data;
-       spkts -= dev->n_port_xmit_packets;
-       rpkts -= dev->n_port_rcv_packets;
+       swords -= dev->z_port_xmit_data;
+       rwords -= dev->z_port_rcv_data;
+       spkts -= dev->z_port_xmit_packets;
+       rpkts -= dev->z_port_rcv_packets;
 
        memset(pmp->data, 0, sizeof(pmp->data));
 
@@ -967,37 +987,48 @@ static int recv_pma_set_portcounters(struct ib_perf *pmp,
        ipath_layer_get_counters(dev->dd, &cntrs);
 
        if (p->counter_select & IB_PMA_SEL_SYMBOL_ERROR)
-               dev->n_symbol_error_counter = cntrs.symbol_error_counter;
+               dev->z_symbol_error_counter = cntrs.symbol_error_counter;
 
        if (p->counter_select & IB_PMA_SEL_LINK_ERROR_RECOVERY)
-               dev->n_link_error_recovery_counter =
+               dev->z_link_error_recovery_counter =
                        cntrs.link_error_recovery_counter;
 
        if (p->counter_select & IB_PMA_SEL_LINK_DOWNED)
-               dev->n_link_downed_counter = cntrs.link_downed_counter;
+               dev->z_link_downed_counter = cntrs.link_downed_counter;
 
        if (p->counter_select & IB_PMA_SEL_PORT_RCV_ERRORS)
-               dev->n_port_rcv_errors =
+               dev->z_port_rcv_errors =
                        cntrs.port_rcv_errors + dev->rcv_errors;
 
        if (p->counter_select & IB_PMA_SEL_PORT_RCV_REMPHYS_ERRORS)
-               dev->n_port_rcv_remphys_errors =
+               dev->z_port_rcv_remphys_errors =
                        cntrs.port_rcv_remphys_errors;
 
        if (p->counter_select & IB_PMA_SEL_PORT_XMIT_DISCARDS)
-               dev->n_port_xmit_discards = cntrs.port_xmit_discards;
+               dev->z_port_xmit_discards = cntrs.port_xmit_discards;
+
+       if (p->counter_select & IB_PMA_SEL_LOCAL_LINK_INTEGRITY_ERRORS)
+               dev->z_local_link_integrity_errors =
+                       cntrs.local_link_integrity_errors;
+
+       if (p->counter_select & IB_PMA_SEL_EXCESSIVE_BUFFER_OVERRUNS)
+               dev->z_excessive_buffer_overrun_errors =
+                       cntrs.excessive_buffer_overrun_errors;
+
+       if (p->counter_select & IB_PMA_SEL_PORT_VL15_DROPPED)
+               dev->n_vl15_dropped = 0;
 
        if (p->counter_select & IB_PMA_SEL_PORT_XMIT_DATA)
-               dev->n_port_xmit_data = cntrs.port_xmit_data;
+               dev->z_port_xmit_data = cntrs.port_xmit_data;
 
        if (p->counter_select & IB_PMA_SEL_PORT_RCV_DATA)
-               dev->n_port_rcv_data = cntrs.port_rcv_data;
+               dev->z_port_rcv_data = cntrs.port_rcv_data;
 
        if (p->counter_select & IB_PMA_SEL_PORT_XMIT_PACKETS)
-               dev->n_port_xmit_packets = cntrs.port_xmit_packets;
+               dev->z_port_xmit_packets = cntrs.port_xmit_packets;
 
        if (p->counter_select & IB_PMA_SEL_PORT_RCV_PACKETS)
-               dev->n_port_rcv_packets = cntrs.port_rcv_packets;
+               dev->z_port_rcv_packets = cntrs.port_rcv_packets;
 
        return recv_pma_get_portcounters(pmp, ibdev, port);
 }
@@ -1014,16 +1045,16 @@ static int recv_pma_set_portcounters_ext(struct ib_perf *pmp,
                                      &rpkts, &xwait);
 
        if (p->counter_select & IB_PMA_SELX_PORT_XMIT_DATA)
-               dev->n_port_xmit_data = swords;
+               dev->z_port_xmit_data = swords;
 
        if (p->counter_select & IB_PMA_SELX_PORT_RCV_DATA)
-               dev->n_port_rcv_data = rwords;
+               dev->z_port_rcv_data = rwords;
 
        if (p->counter_select & IB_PMA_SELX_PORT_XMIT_PACKETS)
-               dev->n_port_xmit_packets = spkts;
+               dev->z_port_xmit_packets = spkts;
 
        if (p->counter_select & IB_PMA_SELX_PORT_RCV_PACKETS)
-               dev->n_port_rcv_packets = rpkts;
+               dev->z_port_rcv_packets = rpkts;
 
        if (p->counter_select & IB_PMA_SELX_PORT_UNI_XMIT_PACKETS)
                dev->n_unicast_xmit = 0;
@@ -1272,32 +1303,8 @@ int ipath_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
                      struct ib_wc *in_wc, struct ib_grh *in_grh,
                      struct ib_mad *in_mad, struct ib_mad *out_mad)
 {
-       struct ipath_ibdev *dev = to_idev(ibdev);
        int ret;
 
-       /*
-        * Snapshot current HW counters to "clear" them.
-        * This should be done when the driver is loaded except that for
-        * some reason we get a zillion errors when brining up the link.
-        */
-       if (dev->rcv_errors == 0) {
-               struct ipath_layer_counters cntrs;
-
-               ipath_layer_get_counters(to_idev(ibdev)->dd, &cntrs);
-               dev->rcv_errors++;
-               dev->n_symbol_error_counter = cntrs.symbol_error_counter;
-               dev->n_link_error_recovery_counter =
-                       cntrs.link_error_recovery_counter;
-               dev->n_link_downed_counter = cntrs.link_downed_counter;
-               dev->n_port_rcv_errors = cntrs.port_rcv_errors + 1;
-               dev->n_port_rcv_remphys_errors =
-                       cntrs.port_rcv_remphys_errors;
-               dev->n_port_xmit_discards = cntrs.port_xmit_discards;
-               dev->n_port_xmit_data = cntrs.port_xmit_data;
-               dev->n_port_rcv_data = cntrs.port_rcv_data;
-               dev->n_port_xmit_packets = cntrs.port_xmit_packets;
-               dev->n_port_rcv_packets = cntrs.port_rcv_packets;
-       }
        switch (in_mad->mad_hdr.mgmt_class) {
        case IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE:
        case IB_MGMT_CLASS_SUBN_LID_ROUTED:
index 69ffec66d45da972b01f0118d4ecbec13209831a..4ac31a5da3308dd5c77555d7e86fd69abce9b023 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -169,6 +170,11 @@ struct ib_mr *ipath_reg_user_mr(struct ib_pd *pd, struct ib_umem *region,
        int n, m, i;
        struct ib_mr *ret;
 
+       if (region->length == 0) {
+               ret = ERR_PTR(-EINVAL);
+               goto bail;
+       }
+
        n = 0;
        list_for_each_entry(chunk, &region->chunk_list, list)
                n += chunk->nents;
index 02e8c75b24f6d175ebde6b42a52da54429d0459b..b83f66d8262cfb0830ea61e424ec68822123ce89 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -44,7 +45,7 @@
 
 /*
  * This file contains all the chip-specific register information and
- * access functions for the PathScale PE800, the PCI-Express chip.
+ * access functions for the QLogic InfiniPath PE800, the PCI-Express chip.
  *
  * This lists the InfiniPath PE800 registers, in the actual chip layout.
  * This structure should never be directly accessed.
@@ -532,7 +533,7 @@ static int ipath_pe_boardname(struct ipath_devdata *dd, char *name,
        if (n)
                snprintf(name, namelen, "%s", n);
 
-       if (dd->ipath_majrev != 4 || dd->ipath_minrev != 1) {
+       if (dd->ipath_majrev != 4 || !dd->ipath_minrev || dd->ipath_minrev>2) {
                ipath_dev_err(dd, "Unsupported PE-800 revision %u.%u!\n",
                              dd->ipath_majrev, dd->ipath_minrev);
                ret = 1;
index 9f8855d970c87483d0f16faf358630e4bb73068f..83e557be591ed4165432cd6d51d0094d20cc719e 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -34,7 +35,7 @@
 #include <linux/vmalloc.h>
 
 #include "ipath_verbs.h"
-#include "ips_common.h"
+#include "ipath_common.h"
 
 #define BITS_PER_PAGE          (PAGE_SIZE*BITS_PER_BYTE)
 #define BITS_PER_PAGE_MASK     (BITS_PER_PAGE-1)
@@ -332,10 +333,11 @@ static void ipath_reset_qp(struct ipath_qp *qp)
        qp->remote_qpn = 0;
        qp->qkey = 0;
        qp->qp_access_flags = 0;
+       clear_bit(IPATH_S_BUSY, &qp->s_flags);
        qp->s_hdrwords = 0;
        qp->s_psn = 0;
        qp->r_psn = 0;
-       atomic_set(&qp->msn, 0);
+       qp->r_msn = 0;
        if (qp->ibqp.qp_type == IB_QPT_RC) {
                qp->s_state = IB_OPCODE_RC_SEND_LAST;
                qp->r_state = IB_OPCODE_RC_SEND_LAST;
@@ -344,7 +346,8 @@ static void ipath_reset_qp(struct ipath_qp *qp)
                qp->r_state = IB_OPCODE_UC_SEND_LAST;
        }
        qp->s_ack_state = IB_OPCODE_RC_ACKNOWLEDGE;
-       qp->s_nak_state = 0;
+       qp->r_ack_state = IB_OPCODE_RC_ACKNOWLEDGE;
+       qp->r_nak_state = 0;
        qp->s_rnr_timeout = 0;
        qp->s_head = 0;
        qp->s_tail = 0;
@@ -362,10 +365,10 @@ static void ipath_reset_qp(struct ipath_qp *qp)
  * @qp: the QP to put into an error state
  *
  * Flushes both send and receive work queues.
- * QP r_rq.lock and s_lock should be held.
+ * QP s_lock should be held and interrupts disabled.
  */
 
-static void ipath_error_qp(struct ipath_qp *qp)
+void ipath_error_qp(struct ipath_qp *qp)
 {
        struct ipath_ibdev *dev = to_idev(qp->ibqp.device);
        struct ib_wc wc;
@@ -408,12 +411,14 @@ static void ipath_error_qp(struct ipath_qp *qp)
        qp->s_ack_state = IB_OPCODE_RC_ACKNOWLEDGE;
 
        wc.opcode = IB_WC_RECV;
+       spin_lock(&qp->r_rq.lock);
        while (qp->r_rq.tail != qp->r_rq.head) {
                wc.wr_id = get_rwqe_ptr(&qp->r_rq, qp->r_rq.tail)->wr_id;
                if (++qp->r_rq.tail >= qp->r_rq.size)
                        qp->r_rq.tail = 0;
                ipath_cq_enter(to_icq(qp->ibqp.recv_cq), &wc, 1);
        }
+       spin_unlock(&qp->r_rq.lock);
 }
 
 /**
@@ -433,8 +438,7 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
        unsigned long flags;
        int ret;
 
-       spin_lock_irqsave(&qp->r_rq.lock, flags);
-       spin_lock(&qp->s_lock);
+       spin_lock_irqsave(&qp->s_lock, flags);
 
        cur_state = attr_mask & IB_QP_CUR_STATE ?
                attr->cur_qp_state : qp->state;
@@ -446,7 +450,7 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
 
        if (attr_mask & IB_QP_AV)
                if (attr->ah_attr.dlid == 0 ||
-                   attr->ah_attr.dlid >= IPS_MULTICAST_LID_BASE)
+                   attr->ah_attr.dlid >= IPATH_MULTICAST_LID_BASE)
                        goto inval;
 
        if (attr_mask & IB_QP_PKEY_INDEX)
@@ -505,34 +509,19 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
        }
 
        if (attr_mask & IB_QP_MIN_RNR_TIMER)
-               qp->s_min_rnr_timer = attr->min_rnr_timer;
+               qp->r_min_rnr_timer = attr->min_rnr_timer;
 
        if (attr_mask & IB_QP_QKEY)
                qp->qkey = attr->qkey;
 
-       if (attr_mask & IB_QP_PKEY_INDEX)
-               qp->s_pkey_index = attr->pkey_index;
-
        qp->state = new_state;
-       spin_unlock(&qp->s_lock);
-       spin_unlock_irqrestore(&qp->r_rq.lock, flags);
-
-       /*
-        * If QP1 changed to the RTS state, try to move to the link to INIT
-        * even if it was ACTIVE so the SM will reinitialize the SMA's
-        * state.
-        */
-       if (qp->ibqp.qp_num == 1 && new_state == IB_QPS_RTS) {
-               struct ipath_ibdev *dev = to_idev(ibqp->device);
+       spin_unlock_irqrestore(&qp->s_lock, flags);
 
-               ipath_layer_set_linkstate(dev->dd, IPATH_IB_LINKDOWN);
-       }
        ret = 0;
        goto bail;
 
 inval:
-       spin_unlock(&qp->s_lock);
-       spin_unlock_irqrestore(&qp->r_rq.lock, flags);
+       spin_unlock_irqrestore(&qp->s_lock, flags);
        ret = -EINVAL;
 
 bail:
@@ -566,7 +555,7 @@ int ipath_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
        attr->sq_draining = 0;
        attr->max_rd_atomic = 1;
        attr->max_dest_rd_atomic = 1;
-       attr->min_rnr_timer = qp->s_min_rnr_timer;
+       attr->min_rnr_timer = qp->r_min_rnr_timer;
        attr->port_num = 1;
        attr->timeout = 0;
        attr->retry_cnt = qp->s_retry_cnt;
@@ -593,21 +582,17 @@ int ipath_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
  * @qp: the queue pair to compute the AETH for
  *
  * Returns the AETH.
- *
- * The QP s_lock should be held.
  */
 __be32 ipath_compute_aeth(struct ipath_qp *qp)
 {
-       u32 aeth = atomic_read(&qp->msn) & IPS_MSN_MASK;
+       u32 aeth = qp->r_msn & IPATH_MSN_MASK;
 
-       if (qp->s_nak_state) {
-               aeth |= qp->s_nak_state << IPS_AETH_CREDIT_SHIFT;
-       } else if (qp->ibqp.srq) {
+       if (qp->ibqp.srq) {
                /*
                 * Shared receive queues don't generate credits.
                 * Set the credit field to the invalid value.
                 */
-               aeth |= IPS_AETH_CREDIT_INVAL << IPS_AETH_CREDIT_SHIFT;
+               aeth |= IPATH_AETH_CREDIT_INVAL << IPATH_AETH_CREDIT_SHIFT;
        } else {
                u32 min, max, x;
                u32 credits;
@@ -637,7 +622,7 @@ __be32 ipath_compute_aeth(struct ipath_qp *qp)
                        else
                                min = x;
                }
-               aeth |= x << IPS_AETH_CREDIT_SHIFT;
+               aeth |= x << IPATH_AETH_CREDIT_SHIFT;
        }
        return cpu_to_be32(aeth);
 }
@@ -663,12 +648,22 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
        size_t sz;
        struct ib_qp *ret;
 
-       if (init_attr->cap.max_send_sge > 255 ||
-           init_attr->cap.max_recv_sge > 255) {
+       if (init_attr->cap.max_send_sge > ib_ipath_max_sges ||
+           init_attr->cap.max_recv_sge > ib_ipath_max_sges ||
+           init_attr->cap.max_send_wr > ib_ipath_max_qp_wrs ||
+           init_attr->cap.max_recv_wr > ib_ipath_max_qp_wrs) {
                ret = ERR_PTR(-ENOMEM);
                goto bail;
        }
 
+       if (init_attr->cap.max_send_sge +
+           init_attr->cap.max_recv_sge +
+           init_attr->cap.max_send_wr +
+           init_attr->cap.max_recv_wr == 0) {
+               ret = ERR_PTR(-EINVAL);
+               goto bail;
+       }
+
        switch (init_attr->qp_type) {
        case IB_QPT_UC:
        case IB_QPT_RC:
@@ -686,18 +681,26 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
        case IB_QPT_GSI:
                qp = kmalloc(sizeof(*qp), GFP_KERNEL);
                if (!qp) {
+                       vfree(swq);
                        ret = ERR_PTR(-ENOMEM);
                        goto bail;
                }
-               qp->r_rq.size = init_attr->cap.max_recv_wr + 1;
-               sz = sizeof(struct ipath_sge) *
-                       init_attr->cap.max_recv_sge +
-                       sizeof(struct ipath_rwqe);
-               qp->r_rq.wq = vmalloc(qp->r_rq.size * sz);
-               if (!qp->r_rq.wq) {
-                       kfree(qp);
-                       ret = ERR_PTR(-ENOMEM);
-                       goto bail;
+               if (init_attr->srq) {
+                       qp->r_rq.size = 0;
+                       qp->r_rq.max_sge = 0;
+                       qp->r_rq.wq = NULL;
+               } else {
+                       qp->r_rq.size = init_attr->cap.max_recv_wr + 1;
+                       qp->r_rq.max_sge = init_attr->cap.max_recv_sge;
+                       sz = (sizeof(struct ipath_sge) * qp->r_rq.max_sge) +
+                               sizeof(struct ipath_rwqe);
+                       qp->r_rq.wq = vmalloc(qp->r_rq.size * sz);
+                       if (!qp->r_rq.wq) {
+                               kfree(qp);
+                               vfree(swq);
+                               ret = ERR_PTR(-ENOMEM);
+                               goto bail;
+                       }
                }
 
                /*
@@ -708,9 +711,7 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
                spin_lock_init(&qp->r_rq.lock);
                atomic_set(&qp->refcount, 0);
                init_waitqueue_head(&qp->wait);
-               tasklet_init(&qp->s_task,
-                            init_attr->qp_type == IB_QPT_RC ?
-                            ipath_do_rc_send : ipath_do_uc_send,
+               tasklet_init(&qp->s_task, ipath_do_ruc_send,
                             (unsigned long)qp);
                INIT_LIST_HEAD(&qp->piowait);
                INIT_LIST_HEAD(&qp->timerwait);
@@ -718,7 +719,6 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
                qp->s_wq = swq;
                qp->s_size = init_attr->cap.max_send_wr + 1;
                qp->s_max_sge = init_attr->cap.max_send_sge;
-               qp->r_rq.max_sge = init_attr->cap.max_recv_sge;
                qp->s_flags = init_attr->sq_sig_type == IB_SIGNAL_REQ_WR ?
                        1 << IPATH_S_SIGNAL_REQ_WR : 0;
                dev = to_idev(ibpd->device);
@@ -888,18 +888,18 @@ void ipath_sqerror_qp(struct ipath_qp *qp, struct ib_wc *wc)
  */
 void ipath_get_credit(struct ipath_qp *qp, u32 aeth)
 {
-       u32 credit = (aeth >> IPS_AETH_CREDIT_SHIFT) & IPS_AETH_CREDIT_MASK;
+       u32 credit = (aeth >> IPATH_AETH_CREDIT_SHIFT) & IPATH_AETH_CREDIT_MASK;
 
        /*
         * If the credit is invalid, we can send
         * as many packets as we like.  Otherwise, we have to
         * honor the credit field.
         */
-       if (credit == IPS_AETH_CREDIT_INVAL) {
+       if (credit == IPATH_AETH_CREDIT_INVAL)
                qp->s_lsn = (u32) -1;
-       else if (qp->s_lsn != (u32) -1) {
+       else if (qp->s_lsn != (u32) -1) {
                /* Compute new LSN (i.e., MSN + credit) */
-               credit = (aeth + credit_table[credit]) & IPS_MSN_MASK;
+               credit = (aeth + credit_table[credit]) & IPATH_MSN_MASK;
                if (ipath_cmp24(credit, qp->s_lsn) > 0)
                        qp->s_lsn = credit;
        }
index 493b1821a93426e8b69e09c54e1e4277edeba410..774d1615ce2f134f7058ffb72880190f25c1adde 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -31,7 +32,7 @@
  */
 
 #include "ipath_verbs.h"
-#include "ips_common.h"
+#include "ipath_common.h"
 
 /* cut down ridiculously long IB macro names */
 #define OP(x) IB_OPCODE_RC_##x
  * @qp: the QP who's SGE we're restarting
  * @wqe: the work queue to initialize the QP's SGE from
  *
- * The QP s_lock should be held.
+ * The QP s_lock should be held and interrupts disabled.
  */
 static void ipath_init_restart(struct ipath_qp *qp, struct ipath_swqe *wqe)
 {
        struct ipath_ibdev *dev;
        u32 len;
 
-       len = ((qp->s_psn - wqe->psn) & IPS_PSN_MASK) *
+       len = ((qp->s_psn - wqe->psn) & IPATH_PSN_MASK) *
                ib_mtu_enum_to_int(qp->path_mtu);
        qp->s_sge.sge = wqe->sg_list[0];
        qp->s_sge.sg_list = wqe->sg_list + 1;
@@ -72,11 +73,10 @@ static void ipath_init_restart(struct ipath_qp *qp, struct ipath_swqe *wqe)
  * Return bth0 if constructed; otherwise, return 0.
  * Note the QP s_lock must be held.
  */
-static inline u32 ipath_make_rc_ack(struct ipath_qp *qp,
-                                   struct ipath_other_headers *ohdr,
-                                   u32 pmtu)
+u32 ipath_make_rc_ack(struct ipath_qp *qp,
+                     struct ipath_other_headers *ohdr,
+                     u32 pmtu)
 {
-       struct ipath_sge_state *ss;
        u32 hwords;
        u32 len;
        u32 bth0;
@@ -90,13 +90,12 @@ static inline u32 ipath_make_rc_ack(struct ipath_qp *qp,
         */
        switch (qp->s_ack_state) {
        case OP(RDMA_READ_REQUEST):
-               ss = &qp->s_rdma_sge;
+               qp->s_cur_sge = &qp->s_rdma_sge;
                len = qp->s_rdma_len;
                if (len > pmtu) {
                        len = pmtu;
                        qp->s_ack_state = OP(RDMA_READ_RESPONSE_FIRST);
-               }
-               else
+               } else
                        qp->s_ack_state = OP(RDMA_READ_RESPONSE_ONLY);
                qp->s_rdma_len -= len;
                bth0 = qp->s_ack_state << 24;
@@ -108,7 +107,7 @@ static inline u32 ipath_make_rc_ack(struct ipath_qp *qp,
                qp->s_ack_state = OP(RDMA_READ_RESPONSE_MIDDLE);
                /* FALLTHROUGH */
        case OP(RDMA_READ_RESPONSE_MIDDLE):
-               ss = &qp->s_rdma_sge;
+               qp->s_cur_sge = &qp->s_rdma_sge;
                len = qp->s_rdma_len;
                if (len > pmtu)
                        len = pmtu;
@@ -127,41 +126,50 @@ static inline u32 ipath_make_rc_ack(struct ipath_qp *qp,
                 * We have to prevent new requests from changing
                 * the r_sge state while a ipath_verbs_send()
                 * is in progress.
-                * Changing r_state allows the receiver
-                * to continue processing new packets.
-                * We do it here now instead of above so
-                * that we are sure the packet was sent before
-                * changing the state.
                 */
-               qp->r_state = OP(RDMA_READ_RESPONSE_LAST);
                qp->s_ack_state = OP(ACKNOWLEDGE);
-               return 0;
+               bth0 = 0;
+               goto bail;
 
        case OP(COMPARE_SWAP):
        case OP(FETCH_ADD):
-               ss = NULL;
+               qp->s_cur_sge = NULL;
                len = 0;
-               qp->r_state = OP(SEND_LAST);
-               qp->s_ack_state = OP(ACKNOWLEDGE);
-               bth0 = IB_OPCODE_ATOMIC_ACKNOWLEDGE << 24;
+               /*
+                * Set the s_ack_state so the receive interrupt handler
+                * won't try to send an ACK (out of order) until this one
+                * is actually sent.
+                */
+               qp->s_ack_state = OP(RDMA_READ_RESPONSE_LAST);
+               bth0 = OP(ATOMIC_ACKNOWLEDGE) << 24;
                ohdr->u.at.aeth = ipath_compute_aeth(qp);
-               ohdr->u.at.atomic_ack_eth = cpu_to_be64(qp->s_ack_atomic);
+               ohdr->u.at.atomic_ack_eth = cpu_to_be64(qp->r_atomic_data);
                hwords += sizeof(ohdr->u.at) / 4;
                break;
 
        default:
                /* Send a regular ACK. */
-               ss = NULL;
+               qp->s_cur_sge = NULL;
                len = 0;
-               qp->s_ack_state = OP(ACKNOWLEDGE);
-               bth0 = qp->s_ack_state << 24;
-               ohdr->u.aeth = ipath_compute_aeth(qp);
+               /*
+                * Set the s_ack_state so the receive interrupt handler
+                * won't try to send an ACK (out of order) until this one
+                * is actually sent.
+                */
+               qp->s_ack_state = OP(RDMA_READ_RESPONSE_LAST);
+               bth0 = OP(ACKNOWLEDGE) << 24;
+               if (qp->s_nak_state)
+                       ohdr->u.aeth = cpu_to_be32((qp->r_msn & IPATH_MSN_MASK) |
+                                                   (qp->s_nak_state <<
+                                                    IPATH_AETH_CREDIT_SHIFT));
+               else
+                       ohdr->u.aeth = ipath_compute_aeth(qp);
                hwords++;
        }
        qp->s_hdrwords = hwords;
-       qp->s_cur_sge = ss;
        qp->s_cur_size = len;
 
+bail:
        return bth0;
 }
 
@@ -174,11 +182,11 @@ static inline u32 ipath_make_rc_ack(struct ipath_qp *qp,
  * @bth2p: pointer to the BTH PSN word
  *
  * Return 1 if constructed; otherwise, return 0.
- * Note the QP s_lock must be held.
+ * Note the QP s_lock must be held and interrupts disabled.
  */
-static inline int ipath_make_rc_req(struct ipath_qp *qp,
-                                   struct ipath_other_headers *ohdr,
-                                   u32 pmtu, u32 *bth0p, u32 *bth2p)
+int ipath_make_rc_req(struct ipath_qp *qp,
+                     struct ipath_other_headers *ohdr,
+                     u32 pmtu, u32 *bth0p, u32 *bth2p)
 {
        struct ipath_ibdev *dev = to_idev(qp->ibqp.device);
        struct ipath_sge_state *ss;
@@ -257,7 +265,7 @@ static inline int ipath_make_rc_req(struct ipath_qp *qp,
                        break;
 
                case IB_WR_RDMA_WRITE:
-                       if (newreq)
+                       if (newreq && qp->s_lsn != (u32) -1)
                                qp->s_lsn++;
                        /* FALLTHROUGH */
                case IB_WR_RDMA_WRITE_WITH_IMM:
@@ -283,8 +291,7 @@ static inline int ipath_make_rc_req(struct ipath_qp *qp,
                        else {
                                qp->s_state =
                                        OP(RDMA_WRITE_ONLY_WITH_IMMEDIATE);
-                               /* Immediate data comes
-                                * after RETH */
+                               /* Immediate data comes after RETH */
                                ohdr->u.rc.imm_data = wqe->wr.imm_data;
                                hwords += 1;
                                if (wqe->wr.send_flags & IB_SEND_SOLICITED)
@@ -304,7 +311,8 @@ static inline int ipath_make_rc_req(struct ipath_qp *qp,
                        qp->s_state = OP(RDMA_READ_REQUEST);
                        hwords += sizeof(ohdr->u.rc.reth) / 4;
                        if (newreq) {
-                               qp->s_lsn++;
+                               if (qp->s_lsn != (u32) -1)
+                                       qp->s_lsn++;
                                /*
                                 * Adjust s_next_psn to count the
                                 * expected number of responses.
@@ -335,7 +343,8 @@ static inline int ipath_make_rc_req(struct ipath_qp *qp,
                                wqe->wr.wr.atomic.compare_add);
                        hwords += sizeof(struct ib_atomic_eth) / 4;
                        if (newreq) {
-                               qp->s_lsn++;
+                               if (qp->s_lsn != (u32) -1)
+                                       qp->s_lsn++;
                                wqe->lpsn = wqe->psn;
                        }
                        if (++qp->s_cur == qp->s_size)
@@ -352,9 +361,14 @@ static inline int ipath_make_rc_req(struct ipath_qp *qp,
                        if (qp->s_tail >= qp->s_size)
                                qp->s_tail = 0;
                }
-               bth2 |= qp->s_psn++ & IPS_PSN_MASK;
+               bth2 |= qp->s_psn++ & IPATH_PSN_MASK;
                if ((int)(qp->s_psn - qp->s_next_psn) > 0)
                        qp->s_next_psn = qp->s_psn;
+               /*
+                * Put the QP on the pending list so lost ACKs will cause
+                * a retry.  More than one request can be pending so the
+                * QP may already be on the dev->pending list.
+                */
                spin_lock(&dev->pending_lock);
                if (list_empty(&qp->timerwait))
                        list_add_tail(&qp->timerwait,
@@ -364,8 +378,8 @@ static inline int ipath_make_rc_req(struct ipath_qp *qp,
 
        case OP(RDMA_READ_RESPONSE_FIRST):
                /*
-                * This case can only happen if a send is restarted.  See
-                * ipath_restart_rc().
+                * This case can only happen if a send is restarted.
+                * See ipath_restart_rc().
                 */
                ipath_init_restart(qp, wqe);
                /* FALLTHROUGH */
@@ -373,7 +387,7 @@ static inline int ipath_make_rc_req(struct ipath_qp *qp,
                qp->s_state = OP(SEND_MIDDLE);
                /* FALLTHROUGH */
        case OP(SEND_MIDDLE):
-               bth2 = qp->s_psn++ & IPS_PSN_MASK;
+               bth2 = qp->s_psn++ & IPATH_PSN_MASK;
                if ((int)(qp->s_psn - qp->s_next_psn) > 0)
                        qp->s_next_psn = qp->s_psn;
                ss = &qp->s_sge;
@@ -415,7 +429,7 @@ static inline int ipath_make_rc_req(struct ipath_qp *qp,
                qp->s_state = OP(RDMA_WRITE_MIDDLE);
                /* FALLTHROUGH */
        case OP(RDMA_WRITE_MIDDLE):
-               bth2 = qp->s_psn++ & IPS_PSN_MASK;
+               bth2 = qp->s_psn++ & IPATH_PSN_MASK;
                if ((int)(qp->s_psn - qp->s_next_psn) > 0)
                        qp->s_next_psn = qp->s_psn;
                ss = &qp->s_sge;
@@ -452,7 +466,7 @@ static inline int ipath_make_rc_req(struct ipath_qp *qp,
                 * See ipath_restart_rc().
                 */
                ipath_init_restart(qp, wqe);
-               len = ((qp->s_psn - wqe->psn) & IPS_PSN_MASK) * pmtu;
+               len = ((qp->s_psn - wqe->psn) & IPATH_PSN_MASK) * pmtu;
                ohdr->u.rc.reth.vaddr =
                        cpu_to_be64(wqe->wr.wr.rdma.remote_addr + len);
                ohdr->u.rc.reth.rkey =
@@ -460,7 +474,7 @@ static inline int ipath_make_rc_req(struct ipath_qp *qp,
                ohdr->u.rc.reth.length = cpu_to_be32(qp->s_len);
                qp->s_state = OP(RDMA_READ_REQUEST);
                hwords += sizeof(ohdr->u.rc.reth) / 4;
-               bth2 = qp->s_psn++ & IPS_PSN_MASK;
+               bth2 = qp->s_psn++ & IPATH_PSN_MASK;
                if ((int)(qp->s_psn - qp->s_next_psn) > 0)
                        qp->s_next_psn = qp->s_psn;
                ss = NULL;
@@ -496,189 +510,169 @@ done:
        return 0;
 }
 
-static inline void ipath_make_rc_grh(struct ipath_qp *qp,
-                                    struct ib_global_route *grh,
-                                    u32 nwords)
-{
-       struct ipath_ibdev *dev = to_idev(qp->ibqp.device);
-
-       /* GRH header size in 32-bit words. */
-       qp->s_hdrwords += 10;
-       qp->s_hdr.u.l.grh.version_tclass_flow =
-               cpu_to_be32((6 << 28) |
-                           (grh->traffic_class << 20) |
-                           grh->flow_label);
-       qp->s_hdr.u.l.grh.paylen =
-               cpu_to_be16(((qp->s_hdrwords - 12) + nwords +
-                            SIZE_OF_CRC) << 2);
-       /* next_hdr is defined by C8-7 in ch. 8.4.1 */
-       qp->s_hdr.u.l.grh.next_hdr = 0x1B;
-       qp->s_hdr.u.l.grh.hop_limit = grh->hop_limit;
-       /* The SGID is 32-bit aligned. */
-       qp->s_hdr.u.l.grh.sgid.global.subnet_prefix = dev->gid_prefix;
-       qp->s_hdr.u.l.grh.sgid.global.interface_id =
-               ipath_layer_get_guid(dev->dd);
-       qp->s_hdr.u.l.grh.dgid = grh->dgid;
-}
-
 /**
- * ipath_do_rc_send - perform a send on an RC QP
- * @data: contains a pointer to the QP
+ * send_rc_ack - Construct an ACK packet and send it
+ * @qp: a pointer to the QP
  *
- * Process entries in the send work queue until credit or queue is
- * exhausted.  Only allow one CPU to send a packet per QP (tasklet).
- * Otherwise, after we drop the QP s_lock, two threads could send
- * packets out of order.
+ * This is called from ipath_rc_rcv() and only uses the receive
+ * side QP state.
+ * Note that RDMA reads are handled in the send side QP state and tasklet.
  */
-void ipath_do_rc_send(unsigned long data)
+static void send_rc_ack(struct ipath_qp *qp)
 {
-       struct ipath_qp *qp = (struct ipath_qp *)data;
        struct ipath_ibdev *dev = to_idev(qp->ibqp.device);
-       unsigned long flags;
        u16 lrh0;
-       u32 nwords;
-       u32 extra_bytes;
        u32 bth0;
-       u32 bth2;
-       u32 pmtu = ib_mtu_enum_to_int(qp->path_mtu);
+       u32 hwords;
+       struct ipath_ib_header hdr;
        struct ipath_other_headers *ohdr;
 
-       if (test_and_set_bit(IPATH_S_BUSY, &qp->s_flags))
-               goto bail;
-
-       if (unlikely(qp->remote_ah_attr.dlid ==
-                    ipath_layer_get_lid(dev->dd))) {
-               struct ib_wc wc;
-
-               /*
-                * Pass in an uninitialized ib_wc to be consistent with
-                * other places where ipath_ruc_loopback() is called.
-                */
-               ipath_ruc_loopback(qp, &wc);
-               goto clear;
-       }
-
-       ohdr = &qp->s_hdr.u.oth;
-       if (qp->remote_ah_attr.ah_flags & IB_AH_GRH)
-               ohdr = &qp->s_hdr.u.l.oth;
-
-again:
-       /* Check for a constructed packet to be sent. */
-       if (qp->s_hdrwords != 0) {
-               /*
-                * If no PIO bufs are available, return.  An interrupt will
-                * call ipath_ib_piobufavail() when one is available.
-                */
-               _VERBS_INFO("h %u %p\n", qp->s_hdrwords, &qp->s_hdr);
-               _VERBS_INFO("d %u %p %u %p %u %u %u %u\n", qp->s_cur_size,
-                           qp->s_cur_sge->sg_list,
-                           qp->s_cur_sge->num_sge,
-                           qp->s_cur_sge->sge.vaddr,
-                           qp->s_cur_sge->sge.sge_length,
-                           qp->s_cur_sge->sge.length,
-                           qp->s_cur_sge->sge.m,
-                           qp->s_cur_sge->sge.n);
-               if (ipath_verbs_send(dev->dd, qp->s_hdrwords,
-                                    (u32 *) &qp->s_hdr, qp->s_cur_size,
-                                    qp->s_cur_sge)) {
-                       ipath_no_bufs_available(qp, dev);
-                       goto bail;
-               }
-               dev->n_unicast_xmit++;
-               /* Record that we sent the packet and s_hdr is empty. */
-               qp->s_hdrwords = 0;
-       }
-
-       /*
-        * The lock is needed to synchronize between setting
-        * qp->s_ack_state, resend timer, and post_send().
-        */
-       spin_lock_irqsave(&qp->s_lock, flags);
-
-       /* Sending responses has higher priority over sending requests. */
-       if (qp->s_ack_state != OP(ACKNOWLEDGE) &&
-           (bth0 = ipath_make_rc_ack(qp, ohdr, pmtu)) != 0)
-               bth2 = qp->s_ack_psn++ & IPS_PSN_MASK;
-       else if (!ipath_make_rc_req(qp, ohdr, pmtu, &bth0, &bth2))
-               goto done;
-
-       spin_unlock_irqrestore(&qp->s_lock, flags);
-
        /* Construct the header. */
-       extra_bytes = (4 - qp->s_cur_size) & 3;
-       nwords = (qp->s_cur_size + extra_bytes) >> 2;
-       lrh0 = IPS_LRH_BTH;
+       ohdr = &hdr.u.oth;
+       lrh0 = IPATH_LRH_BTH;
+       /* header size in 32-bit words LRH+BTH+AETH = (8+12+4)/4. */
+       hwords = 6;
        if (unlikely(qp->remote_ah_attr.ah_flags & IB_AH_GRH)) {
-               ipath_make_rc_grh(qp, &qp->remote_ah_attr.grh, nwords);
-               lrh0 = IPS_LRH_GRH;
+               hwords += ipath_make_grh(dev, &hdr.u.l.grh,
+                                        &qp->remote_ah_attr.grh,
+                                        hwords, 0);
+               ohdr = &hdr.u.l.oth;
+               lrh0 = IPATH_LRH_GRH;
        }
+       /* read pkey_index w/o lock (its atomic) */
+       bth0 = ipath_layer_get_pkey(dev->dd, qp->s_pkey_index);
+       if (qp->r_nak_state)
+               ohdr->u.aeth = cpu_to_be32((qp->r_msn & IPATH_MSN_MASK) |
+                                           (qp->r_nak_state <<
+                                            IPATH_AETH_CREDIT_SHIFT));
+       else
+               ohdr->u.aeth = ipath_compute_aeth(qp);
+       if (qp->r_ack_state >= OP(COMPARE_SWAP)) {
+               bth0 |= OP(ATOMIC_ACKNOWLEDGE) << 24;
+               ohdr->u.at.atomic_ack_eth = cpu_to_be64(qp->r_atomic_data);
+               hwords += sizeof(ohdr->u.at.atomic_ack_eth) / 4;
+       } else
+               bth0 |= OP(ACKNOWLEDGE) << 24;
        lrh0 |= qp->remote_ah_attr.sl << 4;
-       qp->s_hdr.lrh[0] = cpu_to_be16(lrh0);
-       qp->s_hdr.lrh[1] = cpu_to_be16(qp->remote_ah_attr.dlid);
-       qp->s_hdr.lrh[2] = cpu_to_be16(qp->s_hdrwords + nwords +
-                                      SIZE_OF_CRC);
-       qp->s_hdr.lrh[3] = cpu_to_be16(ipath_layer_get_lid(dev->dd));
-       bth0 |= ipath_layer_get_pkey(dev->dd, qp->s_pkey_index);
-       bth0 |= extra_bytes << 20;
+       hdr.lrh[0] = cpu_to_be16(lrh0);
+       hdr.lrh[1] = cpu_to_be16(qp->remote_ah_attr.dlid);
+       hdr.lrh[2] = cpu_to_be16(hwords + SIZE_OF_CRC);
+       hdr.lrh[3] = cpu_to_be16(ipath_layer_get_lid(dev->dd));
        ohdr->bth[0] = cpu_to_be32(bth0);
        ohdr->bth[1] = cpu_to_be32(qp->remote_qpn);
-       ohdr->bth[2] = cpu_to_be32(bth2);
+       ohdr->bth[2] = cpu_to_be32(qp->r_ack_psn & IPATH_PSN_MASK);
 
-       /* Check for more work to do. */
-       goto again;
+       /*
+        * If we can send the ACK, clear the ACK state.
+        */
+       if (ipath_verbs_send(dev->dd, hwords, (u32 *) &hdr, 0, NULL) == 0) {
+               qp->r_ack_state = OP(ACKNOWLEDGE);
+               dev->n_unicast_xmit++;
+       } else {
+               /*
+                * We are out of PIO buffers at the moment.
+                * Pass responsibility for sending the ACK to the
+                * send tasklet so that when a PIO buffer becomes
+                * available, the ACK is sent ahead of other outgoing
+                * packets.
+                */
+               dev->n_rc_qacks++;
+               spin_lock_irq(&qp->s_lock);
+               /* Don't coalesce if a RDMA read or atomic is pending. */
+               if (qp->s_ack_state == OP(ACKNOWLEDGE) ||
+                   qp->s_ack_state < OP(RDMA_READ_REQUEST)) {
+                       qp->s_ack_state = qp->r_ack_state;
+                       qp->s_nak_state = qp->r_nak_state;
+                       qp->s_ack_psn = qp->r_ack_psn;
+                       qp->r_ack_state = OP(ACKNOWLEDGE);
+               }
+               spin_unlock_irq(&qp->s_lock);
 
-done:
-       spin_unlock_irqrestore(&qp->s_lock, flags);
-clear:
-       clear_bit(IPATH_S_BUSY, &qp->s_flags);
-bail:
-       return;
+               /* Call ipath_do_rc_send() in another thread. */
+               tasklet_hi_schedule(&qp->s_task);
+       }
 }
 
-static void send_rc_ack(struct ipath_qp *qp)
+/**
+ * reset_psn - reset the QP state to send starting from PSN
+ * @qp: the QP
+ * @psn: the packet sequence number to restart at
+ *
+ * This is called from ipath_rc_rcv() to process an incoming RC ACK
+ * for the given QP.
+ * Called at interrupt level with the QP s_lock held.
+ */
+static void reset_psn(struct ipath_qp *qp, u32 psn)
 {
-       struct ipath_ibdev *dev = to_idev(qp->ibqp.device);
-       u16 lrh0;
-       u32 bth0;
-       struct ipath_other_headers *ohdr;
+       u32 n = qp->s_last;
+       struct ipath_swqe *wqe = get_swqe_ptr(qp, n);
+       u32 opcode;
 
-       /* Construct the header. */
-       ohdr = &qp->s_hdr.u.oth;
-       lrh0 = IPS_LRH_BTH;
-       /* header size in 32-bit words LRH+BTH+AETH = (8+12+4)/4. */
-       qp->s_hdrwords = 6;
-       if (unlikely(qp->remote_ah_attr.ah_flags & IB_AH_GRH)) {
-               ipath_make_rc_grh(qp, &qp->remote_ah_attr.grh, 0);
-               ohdr = &qp->s_hdr.u.l.oth;
-               lrh0 = IPS_LRH_GRH;
+       qp->s_cur = n;
+
+       /*
+        * If we are starting the request from the beginning,
+        * let the normal send code handle initialization.
+        */
+       if (ipath_cmp24(psn, wqe->psn) <= 0) {
+               qp->s_state = OP(SEND_LAST);
+               goto done;
        }
-       bth0 = ipath_layer_get_pkey(dev->dd, qp->s_pkey_index);
-       ohdr->u.aeth = ipath_compute_aeth(qp);
-       if (qp->s_ack_state >= OP(COMPARE_SWAP)) {
-               bth0 |= IB_OPCODE_ATOMIC_ACKNOWLEDGE << 24;
-               ohdr->u.at.atomic_ack_eth = cpu_to_be64(qp->s_ack_atomic);
-               qp->s_hdrwords += sizeof(ohdr->u.at.atomic_ack_eth) / 4;
+
+       /* Find the work request opcode corresponding to the given PSN. */
+       opcode = wqe->wr.opcode;
+       for (;;) {
+               int diff;
+
+               if (++n == qp->s_size)
+                       n = 0;
+               if (n == qp->s_tail)
+                       break;
+               wqe = get_swqe_ptr(qp, n);
+               diff = ipath_cmp24(psn, wqe->psn);
+               if (diff < 0)
+                       break;
+               qp->s_cur = n;
+               /*
+                * If we are starting the request from the beginning,
+                * let the normal send code handle initialization.
+                */
+               if (diff == 0) {
+                       qp->s_state = OP(SEND_LAST);
+                       goto done;
+               }
+               opcode = wqe->wr.opcode;
        }
-       else
-               bth0 |= OP(ACKNOWLEDGE) << 24;
-       lrh0 |= qp->remote_ah_attr.sl << 4;
-       qp->s_hdr.lrh[0] = cpu_to_be16(lrh0);
-       qp->s_hdr.lrh[1] = cpu_to_be16(qp->remote_ah_attr.dlid);
-       qp->s_hdr.lrh[2] = cpu_to_be16(qp->s_hdrwords + SIZE_OF_CRC);
-       qp->s_hdr.lrh[3] = cpu_to_be16(ipath_layer_get_lid(dev->dd));
-       ohdr->bth[0] = cpu_to_be32(bth0);
-       ohdr->bth[1] = cpu_to_be32(qp->remote_qpn);
-       ohdr->bth[2] = cpu_to_be32(qp->s_ack_psn & IPS_PSN_MASK);
 
        /*
-        * If we can send the ACK, clear the ACK state.
+        * Set the state to restart in the middle of a request.
+        * Don't change the s_sge, s_cur_sge, or s_cur_size.
+        * See ipath_do_rc_send().
         */
-       if (ipath_verbs_send(dev->dd, qp->s_hdrwords, (u32 *) &qp->s_hdr,
-                            0, NULL) == 0) {
-               qp->s_ack_state = OP(ACKNOWLEDGE);
-               dev->n_rc_qacks++;
-               dev->n_unicast_xmit++;
+       switch (opcode) {
+       case IB_WR_SEND:
+       case IB_WR_SEND_WITH_IMM:
+               qp->s_state = OP(RDMA_READ_RESPONSE_FIRST);
+               break;
+
+       case IB_WR_RDMA_WRITE:
+       case IB_WR_RDMA_WRITE_WITH_IMM:
+               qp->s_state = OP(RDMA_READ_RESPONSE_LAST);
+               break;
+
+       case IB_WR_RDMA_READ:
+               qp->s_state = OP(RDMA_READ_RESPONSE_MIDDLE);
+               break;
+
+       default:
+               /*
+                * This case shouldn't happen since its only
+                * one PSN per req.
+                */
+               qp->s_state = OP(SEND_LAST);
        }
+done:
+       qp->s_psn = psn;
 }
 
 /**
@@ -687,13 +681,12 @@ static void send_rc_ack(struct ipath_qp *qp)
  * @psn: packet sequence number for the request
  * @wc: the work completion request
  *
- * The QP s_lock should be held.
+ * The QP s_lock should be held and interrupts disabled.
  */
 void ipath_restart_rc(struct ipath_qp *qp, u32 psn, struct ib_wc *wc)
 {
        struct ipath_swqe *wqe = get_swqe_ptr(qp, qp->s_last);
        struct ipath_ibdev *dev;
-       u32 n;
 
        /*
         * If there are no requests pending, we are done.
@@ -735,62 +728,7 @@ void ipath_restart_rc(struct ipath_qp *qp, u32 psn, struct ib_wc *wc)
        else
                dev->n_rc_resends += (int)qp->s_psn - (int)psn;
 
-       /*
-        * If we are starting the request from the beginning, let the normal
-        * send code handle initialization.
-        */
-       qp->s_cur = qp->s_last;
-       if (ipath_cmp24(psn, wqe->psn) <= 0) {
-               qp->s_state = OP(SEND_LAST);
-               qp->s_psn = wqe->psn;
-       } else {
-               n = qp->s_cur;
-               for (;;) {
-                       if (++n == qp->s_size)
-                               n = 0;
-                       if (n == qp->s_tail) {
-                               if (ipath_cmp24(psn, qp->s_next_psn) >= 0) {
-                                       qp->s_cur = n;
-                                       wqe = get_swqe_ptr(qp, n);
-                               }
-                               break;
-                       }
-                       wqe = get_swqe_ptr(qp, n);
-                       if (ipath_cmp24(psn, wqe->psn) < 0)
-                               break;
-                       qp->s_cur = n;
-               }
-               qp->s_psn = psn;
-
-               /*
-                * Reset the state to restart in the middle of a request.
-                * Don't change the s_sge, s_cur_sge, or s_cur_size.
-                * See ipath_do_rc_send().
-                */
-               switch (wqe->wr.opcode) {
-               case IB_WR_SEND:
-               case IB_WR_SEND_WITH_IMM:
-                       qp->s_state = OP(RDMA_READ_RESPONSE_FIRST);
-                       break;
-
-               case IB_WR_RDMA_WRITE:
-               case IB_WR_RDMA_WRITE_WITH_IMM:
-                       qp->s_state = OP(RDMA_READ_RESPONSE_LAST);
-                       break;
-
-               case IB_WR_RDMA_READ:
-                       qp->s_state =
-                               OP(RDMA_READ_RESPONSE_MIDDLE);
-                       break;
-
-               default:
-                       /*
-                        * This case shouldn't happen since its only
-                        * one PSN per req.
-                        */
-                       qp->s_state = OP(SEND_LAST);
-               }
-       }
+       reset_psn(qp, psn);
 
 done:
        tasklet_hi_schedule(&qp->s_task);
@@ -799,77 +737,15 @@ bail:
        return;
 }
 
-/**
- * reset_psn - reset the QP state to send starting from PSN
- * @qp: the QP
- * @psn: the packet sequence number to restart at
- *
- * This is called from ipath_rc_rcv() to process an incoming RC ACK
- * for the given QP.
- * Called at interrupt level with the QP s_lock held.
- */
-static void reset_psn(struct ipath_qp *qp, u32 psn)
-{
-       struct ipath_swqe *wqe;
-       u32 n;
-
-       n = qp->s_cur;
-       wqe = get_swqe_ptr(qp, n);
-       for (;;) {
-               if (++n == qp->s_size)
-                       n = 0;
-               if (n == qp->s_tail) {
-                       if (ipath_cmp24(psn, qp->s_next_psn) >= 0) {
-                               qp->s_cur = n;
-                               wqe = get_swqe_ptr(qp, n);
-                       }
-                       break;
-               }
-               wqe = get_swqe_ptr(qp, n);
-               if (ipath_cmp24(psn, wqe->psn) < 0)
-                       break;
-               qp->s_cur = n;
-       }
-       qp->s_psn = psn;
-
-       /*
-        * Set the state to restart in the middle of a
-        * request.  Don't change the s_sge, s_cur_sge, or
-        * s_cur_size.  See ipath_do_rc_send().
-        */
-       switch (wqe->wr.opcode) {
-       case IB_WR_SEND:
-       case IB_WR_SEND_WITH_IMM:
-               qp->s_state = OP(RDMA_READ_RESPONSE_FIRST);
-               break;
-
-       case IB_WR_RDMA_WRITE:
-       case IB_WR_RDMA_WRITE_WITH_IMM:
-               qp->s_state = OP(RDMA_READ_RESPONSE_LAST);
-               break;
-
-       case IB_WR_RDMA_READ:
-               qp->s_state = OP(RDMA_READ_RESPONSE_MIDDLE);
-               break;
-
-       default:
-               /*
-                * This case shouldn't happen since its only
-                * one PSN per req.
-                */
-               qp->s_state = OP(SEND_LAST);
-       }
-}
-
 /**
  * do_rc_ack - process an incoming RC ACK
  * @qp: the QP the ACK came in on
  * @psn: the packet sequence number of the ACK
  * @opcode: the opcode of the request that resulted in the ACK
  *
- * This is called from ipath_rc_rcv() to process an incoming RC ACK
+ * This is called from ipath_rc_rcv_resp() to process an incoming RC ACK
  * for the given QP.
- * Called at interrupt level with the QP s_lock held.
+ * Called at interrupt level with the QP s_lock held and interrupts disabled.
  * Returns 1 if OK, 0 if current operation should be aborted (NAK).
  */
 static int do_rc_ack(struct ipath_qp *qp, u32 aeth, u32 psn, int opcode)
@@ -1006,26 +882,16 @@ static int do_rc_ack(struct ipath_qp *qp, u32 aeth, u32 psn, int opcode)
                if (qp->s_last == qp->s_tail)
                        goto bail;
 
-               /* The last valid PSN seen is the previous request's. */
-               qp->s_last_psn = wqe->psn - 1;
+               /* The last valid PSN is the previous PSN. */
+               qp->s_last_psn = psn - 1;
 
                dev->n_rc_resends += (int)qp->s_psn - (int)psn;
 
-               /*
-                * If we are starting the request from the beginning, let
-                * the normal send code handle initialization.
-                */
-               qp->s_cur = qp->s_last;
-               wqe = get_swqe_ptr(qp, qp->s_cur);
-               if (ipath_cmp24(psn, wqe->psn) <= 0) {
-                       qp->s_state = OP(SEND_LAST);
-                       qp->s_psn = wqe->psn;
-               } else
-                       reset_psn(qp, psn);
+               reset_psn(qp, psn);
 
                qp->s_rnr_timeout =
-                       ib_ipath_rnr_table[(aeth >> IPS_AETH_CREDIT_SHIFT) &
-                                          IPS_AETH_CREDIT_MASK];
+                       ib_ipath_rnr_table[(aeth >> IPATH_AETH_CREDIT_SHIFT) &
+                                          IPATH_AETH_CREDIT_MASK];
                ipath_insert_rnr_queue(qp);
                goto bail;
 
@@ -1033,8 +899,8 @@ static int do_rc_ack(struct ipath_qp *qp, u32 aeth, u32 psn, int opcode)
                /* The last valid PSN seen is the previous request's. */
                if (qp->s_last != qp->s_tail)
                        qp->s_last_psn = wqe->psn - 1;
-               switch ((aeth >> IPS_AETH_CREDIT_SHIFT) &
-                       IPS_AETH_CREDIT_MASK) {
+               switch ((aeth >> IPATH_AETH_CREDIT_SHIFT) &
+                       IPATH_AETH_CREDIT_MASK) {
                case 0: /* PSN sequence error */
                        dev->n_seq_naks++;
                        /*
@@ -1182,32 +1048,33 @@ static inline void ipath_rc_rcv_resp(struct ipath_ibdev *dev,
                        goto ack_done;
                }
        rdma_read:
-       if (unlikely(qp->s_state != OP(RDMA_READ_REQUEST)))
-               goto ack_done;
-       if (unlikely(tlen != (hdrsize + pmtu + 4)))
-               goto ack_done;
-       if (unlikely(pmtu >= qp->s_len))
-               goto ack_done;
-       /* We got a response so update the timeout. */
-       if (unlikely(qp->s_last == qp->s_tail ||
-                    get_swqe_ptr(qp, qp->s_last)->wr.opcode !=
-                    IB_WR_RDMA_READ))
-               goto ack_done;
-       spin_lock(&dev->pending_lock);
-       if (qp->s_rnr_timeout == 0 && !list_empty(&qp->timerwait))
-               list_move_tail(&qp->timerwait,
-                              &dev->pending[dev->pending_index]);
-       spin_unlock(&dev->pending_lock);
-       /*
-        * Update the RDMA receive state but do the copy w/o holding the
-        * locks and blocking interrupts.  XXX Yet another place that
-        * affects relaxed RDMA order since we don't want s_sge modified.
-        */
-       qp->s_len -= pmtu;
-       qp->s_last_psn = psn;
-       spin_unlock_irqrestore(&qp->s_lock, flags);
-       ipath_copy_sge(&qp->s_sge, data, pmtu);
-       goto bail;
+               if (unlikely(qp->s_state != OP(RDMA_READ_REQUEST)))
+                       goto ack_done;
+               if (unlikely(tlen != (hdrsize + pmtu + 4)))
+                       goto ack_done;
+               if (unlikely(pmtu >= qp->s_len))
+                       goto ack_done;
+               /* We got a response so update the timeout. */
+               if (unlikely(qp->s_last == qp->s_tail ||
+                            get_swqe_ptr(qp, qp->s_last)->wr.opcode !=
+                            IB_WR_RDMA_READ))
+                       goto ack_done;
+               spin_lock(&dev->pending_lock);
+               if (qp->s_rnr_timeout == 0 && !list_empty(&qp->timerwait))
+                       list_move_tail(&qp->timerwait,
+                                      &dev->pending[dev->pending_index]);
+               spin_unlock(&dev->pending_lock);
+               /*
+                * Update the RDMA receive state but do the copy w/o
+                * holding the locks and blocking interrupts.
+                * XXX Yet another place that affects relaxed RDMA order
+                * since we don't want s_sge modified.
+                */
+               qp->s_len -= pmtu;
+               qp->s_last_psn = psn;
+               spin_unlock_irqrestore(&qp->s_lock, flags);
+               ipath_copy_sge(&qp->s_sge, data, pmtu);
+               goto bail;
 
        case OP(RDMA_READ_RESPONSE_LAST):
                /* ACKs READ req. */
@@ -1230,18 +1097,12 @@ static inline void ipath_rc_rcv_resp(struct ipath_ibdev *dev,
                 * ICRC (4).
                 */
                if (unlikely(tlen <= (hdrsize + pad + 8))) {
-                       /*
-                        * XXX Need to generate an error CQ
-                        * entry.
-                        */
+                       /* XXX Need to generate an error CQ entry. */
                        goto ack_done;
                }
                tlen -= hdrsize + pad + 8;
                if (unlikely(tlen != qp->s_len)) {
-                       /*
-                        * XXX Need to generate an error CQ
-                        * entry.
-                        */
+                       /* XXX Need to generate an error CQ entry. */
                        goto ack_done;
                }
                if (!header_in_data)
@@ -1254,9 +1115,12 @@ static inline void ipath_rc_rcv_resp(struct ipath_ibdev *dev,
                if (do_rc_ack(qp, aeth, psn, OP(RDMA_READ_RESPONSE_LAST))) {
                        /*
                         * Change the state so we contimue
-                        * processing new requests.
+                        * processing new requests and wake up the
+                        * tasklet if there are posted sends.
                         */
                        qp->s_state = OP(SEND_LAST);
+                       if (qp->s_tail != qp->s_head)
+                               tasklet_hi_schedule(&qp->s_task);
                }
                goto ack_done;
        }
@@ -1302,18 +1166,16 @@ static inline int ipath_rc_rcv_error(struct ipath_ibdev *dev,
                 * Don't queue the NAK if a RDMA read, atomic, or
                 * NAK is pending though.
                 */
-               spin_lock(&qp->s_lock);
-               if ((qp->s_ack_state >= OP(RDMA_READ_REQUEST) &&
-                    qp->s_ack_state != IB_OPCODE_ACKNOWLEDGE) ||
-                   qp->s_nak_state != 0) {
-                       spin_unlock(&qp->s_lock);
+               if (qp->s_ack_state != OP(ACKNOWLEDGE) ||
+                   qp->r_nak_state != 0)
                        goto done;
+               if (qp->r_ack_state < OP(COMPARE_SWAP)) {
+                       qp->r_ack_state = OP(SEND_ONLY);
+                       qp->r_nak_state = IB_NAK_PSN_ERROR;
+                       /* Use the expected PSN. */
+                       qp->r_ack_psn = qp->r_psn;
                }
-               qp->s_ack_state = OP(SEND_ONLY);
-               qp->s_nak_state = IB_NAK_PSN_ERROR;
-               /* Use the expected PSN. */
-               qp->s_ack_psn = qp->r_psn;
-               goto resched;
+               goto send_ack;
        }
 
        /*
@@ -1327,27 +1189,7 @@ static inline int ipath_rc_rcv_error(struct ipath_ibdev *dev,
         * send the earliest so that RDMA reads can be restarted at
         * the requester's expected PSN.
         */
-       spin_lock(&qp->s_lock);
-       if (qp->s_ack_state != IB_OPCODE_ACKNOWLEDGE &&
-           ipath_cmp24(psn, qp->s_ack_psn) >= 0) {
-               if (qp->s_ack_state < IB_OPCODE_RDMA_READ_REQUEST)
-                       qp->s_ack_psn = psn;
-               spin_unlock(&qp->s_lock);
-               goto done;
-       }
-       switch (opcode) {
-       case OP(RDMA_READ_REQUEST):
-               /*
-                * We have to be careful to not change s_rdma_sge
-                * while ipath_do_rc_send() is using it and not
-                * holding the s_lock.
-                */
-               if (qp->s_ack_state != OP(ACKNOWLEDGE) &&
-                   qp->s_ack_state >= IB_OPCODE_RDMA_READ_REQUEST) {
-                       spin_unlock(&qp->s_lock);
-                       dev->n_rdma_dup_busy++;
-                       goto done;
-               }
+       if (opcode == OP(RDMA_READ_REQUEST)) {
                /* RETH comes after BTH */
                if (!header_in_data)
                        reth = &ohdr->u.rc.reth;
@@ -1355,6 +1197,22 @@ static inline int ipath_rc_rcv_error(struct ipath_ibdev *dev,
                        reth = (struct ib_reth *)data;
                        data += sizeof(*reth);
                }
+               /*
+                * If we receive a duplicate RDMA request, it means the
+                * requester saw a sequence error and needs to restart
+                * from an earlier point.  We can abort the current
+                * RDMA read send in that case.
+                */
+               spin_lock_irq(&qp->s_lock);
+               if (qp->s_ack_state != OP(ACKNOWLEDGE) &&
+                   (qp->s_hdrwords || ipath_cmp24(psn, qp->s_ack_psn) >= 0)) {
+                       /*
+                        * We are already sending earlier requested data.
+                        * Don't abort it to send later out of sequence data.
+                        */
+                       spin_unlock_irq(&qp->s_lock);
+                       goto done;
+               }
                qp->s_rdma_len = be32_to_cpu(reth->length);
                if (qp->s_rdma_len != 0) {
                        u32 rkey = be32_to_cpu(reth->rkey);
@@ -1368,8 +1226,10 @@ static inline int ipath_rc_rcv_error(struct ipath_ibdev *dev,
                        ok = ipath_rkey_ok(dev, &qp->s_rdma_sge,
                                           qp->s_rdma_len, vaddr, rkey,
                                           IB_ACCESS_REMOTE_READ);
-                       if (unlikely(!ok))
+                       if (unlikely(!ok)) {
+                               spin_unlock_irq(&qp->s_lock);
                                goto done;
+                       }
                } else {
                        qp->s_rdma_sge.sg_list = NULL;
                        qp->s_rdma_sge.num_sge = 0;
@@ -1378,25 +1238,44 @@ static inline int ipath_rc_rcv_error(struct ipath_ibdev *dev,
                        qp->s_rdma_sge.sge.length = 0;
                        qp->s_rdma_sge.sge.sge_length = 0;
                }
-               break;
+               qp->s_ack_state = opcode;
+               qp->s_ack_psn = psn;
+               spin_unlock_irq(&qp->s_lock);
+               tasklet_hi_schedule(&qp->s_task);
+               goto send_ack;
+       }
+
+       /*
+        * A pending RDMA read will ACK anything before it so
+        * ignore earlier duplicate requests.
+        */
+       if (qp->s_ack_state != OP(ACKNOWLEDGE))
+               goto done;
 
+       /*
+        * If an ACK is pending, don't replace the pending ACK
+        * with an earlier one since the later one will ACK the earlier.
+        * Also, if we already have a pending atomic, send it.
+        */
+       if (qp->r_ack_state != OP(ACKNOWLEDGE) &&
+           (ipath_cmp24(psn, qp->r_ack_psn) <= 0 ||
+            qp->r_ack_state >= OP(COMPARE_SWAP)))
+               goto send_ack;
+       switch (opcode) {
        case OP(COMPARE_SWAP):
        case OP(FETCH_ADD):
                /*
-                * Check for the PSN of the last atomic operations
+                * Check for the PSN of the last atomic operation
                 * performed and resend the result if found.
                 */
-               if ((psn & IPS_PSN_MASK) != qp->r_atomic_psn) {
-                       spin_unlock(&qp->s_lock);
+               if ((psn & IPATH_PSN_MASK) != qp->r_atomic_psn)
                        goto done;
-               }
-               qp->s_ack_atomic = qp->r_atomic_data;
                break;
        }
-       qp->s_ack_state = opcode;
-       qp->s_nak_state = 0;
-       qp->s_ack_psn = psn;
-resched:
+       qp->r_ack_state = opcode;
+       qp->r_nak_state = 0;
+       qp->r_ack_psn = psn;
+send_ack:
        return 0;
 
 done:
@@ -1424,7 +1303,6 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
        u32 hdrsize;
        u32 psn;
        u32 pad;
-       unsigned long flags;
        struct ib_wc wc;
        u32 pmtu = ib_mtu_enum_to_int(qp->path_mtu);
        int diff;
@@ -1453,11 +1331,6 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
                } else
                        psn = be32_to_cpu(ohdr->bth[2]);
        }
-       /*
-        * The opcode is in the low byte when its in network order
-        * (top byte when in host order).
-        */
-       opcode = be32_to_cpu(ohdr->bth[0]) >> 24;
 
        /*
         * Process responses (ACKs) before anything else.  Note that the
@@ -1465,22 +1338,21 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
         * queue rather than the expected receive packet sequence number.
         * In other words, this QP is the requester.
         */
+       opcode = be32_to_cpu(ohdr->bth[0]) >> 24;
        if (opcode >= OP(RDMA_READ_RESPONSE_FIRST) &&
            opcode <= OP(ATOMIC_ACKNOWLEDGE)) {
                ipath_rc_rcv_resp(dev, ohdr, data, tlen, qp, opcode, psn,
                                  hdrsize, pmtu, header_in_data);
-               goto bail;
+               goto done;
        }
 
-       spin_lock_irqsave(&qp->r_rq.lock, flags);
-
        /* Compute 24 bits worth of difference. */
        diff = ipath_cmp24(psn, qp->r_psn);
        if (unlikely(diff)) {
                if (ipath_rc_rcv_error(dev, ohdr, data, qp, opcode,
                                       psn, diff, header_in_data))
                        goto done;
-               goto resched;
+               goto send_ack;
        }
 
        /* Check for opcode sequence errors. */
@@ -1492,22 +1364,19 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
                    opcode == OP(SEND_LAST_WITH_IMMEDIATE))
                        break;
        nack_inv:
-       /*
-        * A NAK will ACK earlier sends and RDMA writes.  Don't queue the
-        * NAK if a RDMA read, atomic, or NAK is pending though.
-        */
-       spin_lock(&qp->s_lock);
-       if (qp->s_ack_state >= OP(RDMA_READ_REQUEST) &&
-           qp->s_ack_state != IB_OPCODE_ACKNOWLEDGE) {
-               spin_unlock(&qp->s_lock);
-               goto done;
-       }
-       /* XXX Flush WQEs */
-       qp->state = IB_QPS_ERR;
-       qp->s_ack_state = OP(SEND_ONLY);
-       qp->s_nak_state = IB_NAK_INVALID_REQUEST;
-       qp->s_ack_psn = qp->r_psn;
-       goto resched;
+               /*
+                * A NAK will ACK earlier sends and RDMA writes.
+                * Don't queue the NAK if a RDMA read, atomic, or NAK
+                * is pending though.
+                */
+               if (qp->r_ack_state >= OP(COMPARE_SWAP))
+                       goto send_ack;
+               /* XXX Flush WQEs */
+               qp->state = IB_QPS_ERR;
+               qp->r_ack_state = OP(SEND_ONLY);
+               qp->r_nak_state = IB_NAK_INVALID_REQUEST;
+               qp->r_ack_psn = qp->r_psn;
+               goto send_ack;
 
        case OP(RDMA_WRITE_FIRST):
        case OP(RDMA_WRITE_MIDDLE):
@@ -1517,20 +1386,6 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
                        break;
                goto nack_inv;
 
-       case OP(RDMA_READ_REQUEST):
-       case OP(COMPARE_SWAP):
-       case OP(FETCH_ADD):
-               /*
-                * Drop all new requests until a response has been sent.  A
-                * new request then ACKs the RDMA response we sent.  Relaxed
-                * ordering would allow new requests to be processed but we
-                * would need to keep a queue of rwqe's for all that are in
-                * progress.  Note that we can't RNR NAK this request since
-                * the RDMA READ or atomic response is already queued to be
-                * sent (unless we implement a response send queue).
-                */
-               goto done;
-
        default:
                if (opcode == OP(SEND_MIDDLE) ||
                    opcode == OP(SEND_LAST) ||
@@ -1539,6 +1394,11 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
                    opcode == OP(RDMA_WRITE_LAST) ||
                    opcode == OP(RDMA_WRITE_LAST_WITH_IMMEDIATE))
                        goto nack_inv;
+               /*
+                * Note that it is up to the requester to not send a new
+                * RDMA read or atomic operation before receiving an ACK
+                * for the previous operation.
+                */
                break;
        }
 
@@ -1555,17 +1415,12 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
                         * Don't queue the NAK if a RDMA read or atomic
                         * is pending though.
                         */
-                       spin_lock(&qp->s_lock);
-                       if (qp->s_ack_state >=
-                           OP(RDMA_READ_REQUEST) &&
-                           qp->s_ack_state != IB_OPCODE_ACKNOWLEDGE) {
-                               spin_unlock(&qp->s_lock);
-                               goto done;
-                       }
-                       qp->s_ack_state = OP(SEND_ONLY);
-                       qp->s_nak_state = IB_RNR_NAK | qp->s_min_rnr_timer;
-                       qp->s_ack_psn = qp->r_psn;
-                       goto resched;
+                       if (qp->r_ack_state >= OP(COMPARE_SWAP))
+                               goto send_ack;
+                       qp->r_ack_state = OP(SEND_ONLY);
+                       qp->r_nak_state = IB_RNR_NAK | qp->r_min_rnr_timer;
+                       qp->r_ack_psn = qp->r_psn;
+                       goto send_ack;
                }
                qp->r_rcv_len = 0;
                /* FALLTHROUGH */
@@ -1622,7 +1477,7 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
                if (unlikely(wc.byte_len > qp->r_len))
                        goto nack_inv;
                ipath_copy_sge(&qp->r_sge, data, tlen);
-               atomic_inc(&qp->msn);
+               qp->r_msn++;
                if (opcode == OP(RDMA_WRITE_LAST) ||
                    opcode == OP(RDMA_WRITE_ONLY))
                        break;
@@ -1666,29 +1521,8 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
                        ok = ipath_rkey_ok(dev, &qp->r_sge,
                                           qp->r_len, vaddr, rkey,
                                           IB_ACCESS_REMOTE_WRITE);
-                       if (unlikely(!ok)) {
-                       nack_acc:
-                               /*
-                                * A NAK will ACK earlier sends and RDMA
-                                * writes.  Don't queue the NAK if a RDMA
-                                * read, atomic, or NAK is pending though.
-                                */
-                               spin_lock(&qp->s_lock);
-                               if (qp->s_ack_state >=
-                                   OP(RDMA_READ_REQUEST) &&
-                                   qp->s_ack_state !=
-                                   IB_OPCODE_ACKNOWLEDGE) {
-                                       spin_unlock(&qp->s_lock);
-                                       goto done;
-                               }
-                               /* XXX Flush WQEs */
-                               qp->state = IB_QPS_ERR;
-                               qp->s_ack_state = OP(RDMA_WRITE_ONLY);
-                               qp->s_nak_state =
-                                       IB_NAK_REMOTE_ACCESS_ERROR;
-                               qp->s_ack_psn = qp->r_psn;
-                               goto resched;
-                       }
+                       if (unlikely(!ok))
+                               goto nack_acc;
                } else {
                        qp->r_sge.sg_list = NULL;
                        qp->r_sge.sge.mr = NULL;
@@ -1715,12 +1549,10 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
                        reth = (struct ib_reth *)data;
                        data += sizeof(*reth);
                }
-               spin_lock(&qp->s_lock);
-               if (qp->s_ack_state != OP(ACKNOWLEDGE) &&
-                   qp->s_ack_state >= IB_OPCODE_RDMA_READ_REQUEST) {
-                       spin_unlock(&qp->s_lock);
-                       goto done;
-               }
+               if (unlikely(!(qp->qp_access_flags &
+                              IB_ACCESS_REMOTE_READ)))
+                       goto nack_acc;
+               spin_lock_irq(&qp->s_lock);
                qp->s_rdma_len = be32_to_cpu(reth->length);
                if (qp->s_rdma_len != 0) {
                        u32 rkey = be32_to_cpu(reth->rkey);
@@ -1732,7 +1564,7 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
                                           qp->s_rdma_len, vaddr, rkey,
                                           IB_ACCESS_REMOTE_READ);
                        if (unlikely(!ok)) {
-                               spin_unlock(&qp->s_lock);
+                               spin_unlock_irq(&qp->s_lock);
                                goto nack_acc;
                        }
                        /*
@@ -1749,21 +1581,25 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
                        qp->s_rdma_sge.sge.length = 0;
                        qp->s_rdma_sge.sge.sge_length = 0;
                }
-               if (unlikely(!(qp->qp_access_flags &
-                              IB_ACCESS_REMOTE_READ)))
-                       goto nack_acc;
                /*
                 * We need to increment the MSN here instead of when we
                 * finish sending the result since a duplicate request would
                 * increment it more than once.
                 */
-               atomic_inc(&qp->msn);
+               qp->r_msn++;
+
                qp->s_ack_state = opcode;
-               qp->s_nak_state = 0;
                qp->s_ack_psn = psn;
+               spin_unlock_irq(&qp->s_lock);
+
                qp->r_psn++;
                qp->r_state = opcode;
-               goto rdmadone;
+               qp->r_nak_state = 0;
+
+               /* Call ipath_do_rc_send() in another thread. */
+               tasklet_hi_schedule(&qp->s_task);
+
+               goto done;
 
        case OP(COMPARE_SWAP):
        case OP(FETCH_ADD): {
@@ -1792,7 +1628,7 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
                        goto nack_acc;
                /* Perform atomic OP and save result. */
                sdata = be64_to_cpu(ateth->swap_data);
-               spin_lock(&dev->pending_lock);
+               spin_lock_irq(&dev->pending_lock);
                qp->r_atomic_data = *(u64 *) qp->r_sge.sge.vaddr;
                if (opcode == OP(FETCH_ADD))
                        *(u64 *) qp->r_sge.sge.vaddr =
@@ -1800,9 +1636,9 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
                else if (qp->r_atomic_data ==
                         be64_to_cpu(ateth->compare_data))
                        *(u64 *) qp->r_sge.sge.vaddr = sdata;
-               spin_unlock(&dev->pending_lock);
-               atomic_inc(&qp->msn);
-               qp->r_atomic_psn = psn & IPS_PSN_MASK;
+               spin_unlock_irq(&dev->pending_lock);
+               qp->r_msn++;
+               qp->r_atomic_psn = psn & IPATH_PSN_MASK;
                psn |= 1 << 31;
                break;
        }
@@ -1813,44 +1649,39 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
        }
        qp->r_psn++;
        qp->r_state = opcode;
+       qp->r_nak_state = 0;
        /* Send an ACK if requested or required. */
        if (psn & (1 << 31)) {
                /*
                 * Coalesce ACKs unless there is a RDMA READ or
                 * ATOMIC pending.
                 */
-               spin_lock(&qp->s_lock);
-               if (qp->s_ack_state == OP(ACKNOWLEDGE) ||
-                   qp->s_ack_state < IB_OPCODE_RDMA_READ_REQUEST) {
-                       qp->s_ack_state = opcode;
-                       qp->s_nak_state = 0;
-                       qp->s_ack_psn = psn;
-                       qp->s_ack_atomic = qp->r_atomic_data;
-                       goto resched;
+               if (qp->r_ack_state < OP(COMPARE_SWAP)) {
+                       qp->r_ack_state = opcode;
+                       qp->r_ack_psn = psn;
                }
-               spin_unlock(&qp->s_lock);
+               goto send_ack;
        }
-done:
-       spin_unlock_irqrestore(&qp->r_rq.lock, flags);
-       goto bail;
+       goto done;
 
-resched:
+nack_acc:
        /*
-        * Try to send ACK right away but not if ipath_do_rc_send() is
-        * active.
+        * A NAK will ACK earlier sends and RDMA writes.
+        * Don't queue the NAK if a RDMA read, atomic, or NAK
+        * is pending though.
         */
-       if (qp->s_hdrwords == 0 &&
-           (qp->s_ack_state < IB_OPCODE_RDMA_READ_REQUEST ||
-            qp->s_ack_state >= IB_OPCODE_COMPARE_SWAP))
+       if (qp->r_ack_state < OP(COMPARE_SWAP)) {
+               /* XXX Flush WQEs */
+               qp->state = IB_QPS_ERR;
+               qp->r_ack_state = OP(RDMA_WRITE_ONLY);
+               qp->r_nak_state = IB_NAK_REMOTE_ACCESS_ERROR;
+               qp->r_ack_psn = qp->r_psn;
+       }
+send_ack:
+       /* Send ACK right away unless the send tasklet has a pending ACK. */
+       if (qp->s_ack_state == OP(ACKNOWLEDGE))
                send_rc_ack(qp);
 
-rdmadone:
-       spin_unlock(&qp->s_lock);
-       spin_unlock_irqrestore(&qp->r_rq.lock, flags);
-
-       /* Call ipath_do_rc_send() in another thread. */
-       tasklet_hi_schedule(&qp->s_task);
-
-bail:
+done:
        return;
 }
index 402126eb79c96067bd0d7eef629fd5b1a0f5f36a..89df8f5ea998087c42af9e77c097933a6bffa35d 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
index d38f4f3cfd1dd291dd33e17d3780fc9b7ed1d17e..772bc59fb85c314fc4e1084c1656039a10c1fa6f 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -31,6 +32,7 @@
  */
 
 #include "ipath_verbs.h"
+#include "ipath_common.h"
 
 /*
  * Convert the AETH RNR timeout code into the number of milliseconds.
@@ -111,20 +113,23 @@ void ipath_insert_rnr_queue(struct ipath_qp *qp)
  *
  * Return 0 if no RWQE is available, otherwise return 1.
  *
- * Called at interrupt level with the QP r_rq.lock held.
+ * Can be called from interrupt level.
  */
 int ipath_get_rwqe(struct ipath_qp *qp, int wr_id_only)
 {
+       unsigned long flags;
        struct ipath_rq *rq;
        struct ipath_srq *srq;
        struct ipath_rwqe *wqe;
-       int ret;
+       int ret = 1;
 
        if (!qp->ibqp.srq) {
                rq = &qp->r_rq;
+               spin_lock_irqsave(&rq->lock, flags);
+
                if (unlikely(rq->tail == rq->head)) {
                        ret = 0;
-                       goto bail;
+                       goto done;
                }
                wqe = get_rwqe_ptr(rq, rq->tail);
                qp->r_wr_id = wqe->wr_id;
@@ -136,17 +141,16 @@ int ipath_get_rwqe(struct ipath_qp *qp, int wr_id_only)
                }
                if (++rq->tail >= rq->size)
                        rq->tail = 0;
-               ret = 1;
-               goto bail;
+               goto done;
        }
 
        srq = to_isrq(qp->ibqp.srq);
        rq = &srq->rq;
-       spin_lock(&rq->lock);
+       spin_lock_irqsave(&rq->lock, flags);
+
        if (unlikely(rq->tail == rq->head)) {
-               spin_unlock(&rq->lock);
                ret = 0;
-               goto bail;
+               goto done;
        }
        wqe = get_rwqe_ptr(rq, rq->tail);
        qp->r_wr_id = wqe->wr_id;
@@ -168,18 +172,18 @@ int ipath_get_rwqe(struct ipath_qp *qp, int wr_id_only)
                        n = rq->head - rq->tail;
                if (n < srq->limit) {
                        srq->limit = 0;
-                       spin_unlock(&rq->lock);
+                       spin_unlock_irqrestore(&rq->lock, flags);
                        ev.device = qp->ibqp.device;
                        ev.element.srq = qp->ibqp.srq;
                        ev.event = IB_EVENT_SRQ_LIMIT_REACHED;
                        srq->ibsrq.event_handler(&ev,
                                                 srq->ibsrq.srq_context);
-               } else
-                       spin_unlock(&rq->lock);
-       } else
-               spin_unlock(&rq->lock);
-       ret = 1;
+                       goto bail;
+               }
+       }
 
+done:
+       spin_unlock_irqrestore(&rq->lock, flags);
 bail:
        return ret;
 }
@@ -187,7 +191,6 @@ bail:
 /**
  * ipath_ruc_loopback - handle UC and RC lookback requests
  * @sqp: the loopback QP
- * @wc: the work completion entry
  *
  * This is called from ipath_do_uc_send() or ipath_do_rc_send() to
  * forward a WQE addressed to the same HCA.
@@ -196,13 +199,14 @@ bail:
  * receive interrupts since this is a connected protocol and all packets
  * will pass through here.
  */
-void ipath_ruc_loopback(struct ipath_qp *sqp, struct ib_wc *wc)
+static void ipath_ruc_loopback(struct ipath_qp *sqp)
 {
        struct ipath_ibdev *dev = to_idev(sqp->ibqp.device);
        struct ipath_qp *qp;
        struct ipath_swqe *wqe;
        struct ipath_sge *sge;
        unsigned long flags;
+       struct ib_wc wc;
        u64 sdata;
 
        qp = ipath_lookup_qpn(&dev->qp_table, sqp->remote_qpn);
@@ -233,8 +237,8 @@ again:
        wqe = get_swqe_ptr(sqp, sqp->s_last);
        spin_unlock_irqrestore(&sqp->s_lock, flags);
 
-       wc->wc_flags = 0;
-       wc->imm_data = 0;
+       wc.wc_flags = 0;
+       wc.imm_data = 0;
 
        sqp->s_sge.sge = wqe->sg_list[0];
        sqp->s_sge.sg_list = wqe->sg_list + 1;
@@ -242,39 +246,34 @@ again:
        sqp->s_len = wqe->length;
        switch (wqe->wr.opcode) {
        case IB_WR_SEND_WITH_IMM:
-               wc->wc_flags = IB_WC_WITH_IMM;
-               wc->imm_data = wqe->wr.imm_data;
+               wc.wc_flags = IB_WC_WITH_IMM;
+               wc.imm_data = wqe->wr.imm_data;
                /* FALLTHROUGH */
        case IB_WR_SEND:
-               spin_lock_irqsave(&qp->r_rq.lock, flags);
                if (!ipath_get_rwqe(qp, 0)) {
                rnr_nak:
-                       spin_unlock_irqrestore(&qp->r_rq.lock, flags);
                        /* Handle RNR NAK */
                        if (qp->ibqp.qp_type == IB_QPT_UC)
                                goto send_comp;
                        if (sqp->s_rnr_retry == 0) {
-                               wc->status = IB_WC_RNR_RETRY_EXC_ERR;
+                               wc.status = IB_WC_RNR_RETRY_EXC_ERR;
                                goto err;
                        }
                        if (sqp->s_rnr_retry_cnt < 7)
                                sqp->s_rnr_retry--;
                        dev->n_rnr_naks++;
                        sqp->s_rnr_timeout =
-                               ib_ipath_rnr_table[sqp->s_min_rnr_timer];
+                               ib_ipath_rnr_table[sqp->r_min_rnr_timer];
                        ipath_insert_rnr_queue(sqp);
                        goto done;
                }
-               spin_unlock_irqrestore(&qp->r_rq.lock, flags);
                break;
 
        case IB_WR_RDMA_WRITE_WITH_IMM:
-               wc->wc_flags = IB_WC_WITH_IMM;
-               wc->imm_data = wqe->wr.imm_data;
-               spin_lock_irqsave(&qp->r_rq.lock, flags);
+               wc.wc_flags = IB_WC_WITH_IMM;
+               wc.imm_data = wqe->wr.imm_data;
                if (!ipath_get_rwqe(qp, 1))
                        goto rnr_nak;
-               spin_unlock_irqrestore(&qp->r_rq.lock, flags);
                /* FALLTHROUGH */
        case IB_WR_RDMA_WRITE:
                if (wqe->length == 0)
@@ -284,20 +283,20 @@ again:
                                            wqe->wr.wr.rdma.rkey,
                                            IB_ACCESS_REMOTE_WRITE))) {
                acc_err:
-                       wc->status = IB_WC_REM_ACCESS_ERR;
+                       wc.status = IB_WC_REM_ACCESS_ERR;
                err:
-                       wc->wr_id = wqe->wr.wr_id;
-                       wc->opcode = ib_ipath_wc_opcode[wqe->wr.opcode];
-                       wc->vendor_err = 0;
-                       wc->byte_len = 0;
-                       wc->qp_num = sqp->ibqp.qp_num;
-                       wc->src_qp = sqp->remote_qpn;
-                       wc->pkey_index = 0;
-                       wc->slid = sqp->remote_ah_attr.dlid;
-                       wc->sl = sqp->remote_ah_attr.sl;
-                       wc->dlid_path_bits = 0;
-                       wc->port_num = 0;
-                       ipath_sqerror_qp(sqp, wc);
+                       wc.wr_id = wqe->wr.wr_id;
+                       wc.opcode = ib_ipath_wc_opcode[wqe->wr.opcode];
+                       wc.vendor_err = 0;
+                       wc.byte_len = 0;
+                       wc.qp_num = sqp->ibqp.qp_num;
+                       wc.src_qp = sqp->remote_qpn;
+                       wc.pkey_index = 0;
+                       wc.slid = sqp->remote_ah_attr.dlid;
+                       wc.sl = sqp->remote_ah_attr.sl;
+                       wc.dlid_path_bits = 0;
+                       wc.port_num = 0;
+                       ipath_sqerror_qp(sqp, &wc);
                        goto done;
                }
                break;
@@ -373,22 +372,22 @@ again:
                goto send_comp;
 
        if (wqe->wr.opcode == IB_WR_RDMA_WRITE_WITH_IMM)
-               wc->opcode = IB_WC_RECV_RDMA_WITH_IMM;
+               wc.opcode = IB_WC_RECV_RDMA_WITH_IMM;
        else
-               wc->opcode = IB_WC_RECV;
-       wc->wr_id = qp->r_wr_id;
-       wc->status = IB_WC_SUCCESS;
-       wc->vendor_err = 0;
-       wc->byte_len = wqe->length;
-       wc->qp_num = qp->ibqp.qp_num;
-       wc->src_qp = qp->remote_qpn;
+               wc.opcode = IB_WC_RECV;
+       wc.wr_id = qp->r_wr_id;
+       wc.status = IB_WC_SUCCESS;
+       wc.vendor_err = 0;
+       wc.byte_len = wqe->length;
+       wc.qp_num = qp->ibqp.qp_num;
+       wc.src_qp = qp->remote_qpn;
        /* XXX do we know which pkey matched? Only needed for GSI. */
-       wc->pkey_index = 0;
-       wc->slid = qp->remote_ah_attr.dlid;
-       wc->sl = qp->remote_ah_attr.sl;
-       wc->dlid_path_bits = 0;
+       wc.pkey_index = 0;
+       wc.slid = qp->remote_ah_attr.dlid;
+       wc.sl = qp->remote_ah_attr.sl;
+       wc.dlid_path_bits = 0;
        /* Signal completion event if the solicited bit is set. */
-       ipath_cq_enter(to_icq(qp->ibqp.recv_cq), wc,
+       ipath_cq_enter(to_icq(qp->ibqp.recv_cq), &wc,
                       wqe->wr.send_flags & IB_SEND_SOLICITED);
 
 send_comp:
@@ -396,19 +395,19 @@ send_comp:
 
        if (!test_bit(IPATH_S_SIGNAL_REQ_WR, &sqp->s_flags) ||
            (wqe->wr.send_flags & IB_SEND_SIGNALED)) {
-               wc->wr_id = wqe->wr.wr_id;
-               wc->status = IB_WC_SUCCESS;
-               wc->opcode = ib_ipath_wc_opcode[wqe->wr.opcode];
-               wc->vendor_err = 0;
-               wc->byte_len = wqe->length;
-               wc->qp_num = sqp->ibqp.qp_num;
-               wc->src_qp = 0;
-               wc->pkey_index = 0;
-               wc->slid = 0;
-               wc->sl = 0;
-               wc->dlid_path_bits = 0;
-               wc->port_num = 0;
-               ipath_cq_enter(to_icq(sqp->ibqp.send_cq), wc, 0);
+               wc.wr_id = wqe->wr.wr_id;
+               wc.status = IB_WC_SUCCESS;
+               wc.opcode = ib_ipath_wc_opcode[wqe->wr.opcode];
+               wc.vendor_err = 0;
+               wc.byte_len = wqe->length;
+               wc.qp_num = sqp->ibqp.qp_num;
+               wc.src_qp = 0;
+               wc.pkey_index = 0;
+               wc.slid = 0;
+               wc.sl = 0;
+               wc.dlid_path_bits = 0;
+               wc.port_num = 0;
+               ipath_cq_enter(to_icq(sqp->ibqp.send_cq), &wc, 0);
        }
 
        /* Update s_last now that we are finished with the SWQE */
@@ -454,11 +453,11 @@ void ipath_no_bufs_available(struct ipath_qp *qp, struct ipath_ibdev *dev)
 }
 
 /**
- * ipath_post_rc_send - post RC and UC sends
+ * ipath_post_ruc_send - post RC and UC sends
  * @qp: the QP to post on
  * @wr: the work request to send
  */
-int ipath_post_rc_send(struct ipath_qp *qp, struct ib_send_wr *wr)
+int ipath_post_ruc_send(struct ipath_qp *qp, struct ib_send_wr *wr)
 {
        struct ipath_swqe *wqe;
        unsigned long flags;
@@ -533,13 +532,149 @@ int ipath_post_rc_send(struct ipath_qp *qp, struct ib_send_wr *wr)
        qp->s_head = next;
        spin_unlock_irqrestore(&qp->s_lock, flags);
 
-       if (qp->ibqp.qp_type == IB_QPT_UC)
-               ipath_do_uc_send((unsigned long) qp);
-       else
-               ipath_do_rc_send((unsigned long) qp);
+       ipath_do_ruc_send((unsigned long) qp);
 
        ret = 0;
 
 bail:
        return ret;
 }
+
+/**
+ * ipath_make_grh - construct a GRH header
+ * @dev: a pointer to the ipath device
+ * @hdr: a pointer to the GRH header being constructed
+ * @grh: the global route address to send to
+ * @hwords: the number of 32 bit words of header being sent
+ * @nwords: the number of 32 bit words of data being sent
+ *
+ * Return the size of the header in 32 bit words.
+ */
+u32 ipath_make_grh(struct ipath_ibdev *dev, struct ib_grh *hdr,
+                  struct ib_global_route *grh, u32 hwords, u32 nwords)
+{
+       hdr->version_tclass_flow =
+               cpu_to_be32((6 << 28) |
+                           (grh->traffic_class << 20) |
+                           grh->flow_label);
+       hdr->paylen = cpu_to_be16((hwords - 2 + nwords + SIZE_OF_CRC) << 2);
+       /* next_hdr is defined by C8-7 in ch. 8.4.1 */
+       hdr->next_hdr = 0x1B;
+       hdr->hop_limit = grh->hop_limit;
+       /* The SGID is 32-bit aligned. */
+       hdr->sgid.global.subnet_prefix = dev->gid_prefix;
+       hdr->sgid.global.interface_id = ipath_layer_get_guid(dev->dd);
+       hdr->dgid = grh->dgid;
+
+       /* GRH header size in 32-bit words. */
+       return sizeof(struct ib_grh) / sizeof(u32);
+}
+
+/**
+ * ipath_do_ruc_send - perform a send on an RC or UC QP
+ * @data: contains a pointer to the QP
+ *
+ * Process entries in the send work queue until credit or queue is
+ * exhausted.  Only allow one CPU to send a packet per QP (tasklet).
+ * Otherwise, after we drop the QP s_lock, two threads could send
+ * packets out of order.
+ */
+void ipath_do_ruc_send(unsigned long data)
+{
+       struct ipath_qp *qp = (struct ipath_qp *)data;
+       struct ipath_ibdev *dev = to_idev(qp->ibqp.device);
+       unsigned long flags;
+       u16 lrh0;
+       u32 nwords;
+       u32 extra_bytes;
+       u32 bth0;
+       u32 bth2;
+       u32 pmtu = ib_mtu_enum_to_int(qp->path_mtu);
+       struct ipath_other_headers *ohdr;
+
+       if (test_and_set_bit(IPATH_S_BUSY, &qp->s_flags))
+               goto bail;
+
+       if (unlikely(qp->remote_ah_attr.dlid ==
+                    ipath_layer_get_lid(dev->dd))) {
+               ipath_ruc_loopback(qp);
+               goto clear;
+       }
+
+       ohdr = &qp->s_hdr.u.oth;
+       if (qp->remote_ah_attr.ah_flags & IB_AH_GRH)
+               ohdr = &qp->s_hdr.u.l.oth;
+
+again:
+       /* Check for a constructed packet to be sent. */
+       if (qp->s_hdrwords != 0) {
+               /*
+                * If no PIO bufs are available, return.  An interrupt will
+                * call ipath_ib_piobufavail() when one is available.
+                */
+               if (ipath_verbs_send(dev->dd, qp->s_hdrwords,
+                                    (u32 *) &qp->s_hdr, qp->s_cur_size,
+                                    qp->s_cur_sge)) {
+                       ipath_no_bufs_available(qp, dev);
+                       goto bail;
+               }
+               dev->n_unicast_xmit++;
+               /* Record that we sent the packet and s_hdr is empty. */
+               qp->s_hdrwords = 0;
+       }
+
+       /*
+        * The lock is needed to synchronize between setting
+        * qp->s_ack_state, resend timer, and post_send().
+        */
+       spin_lock_irqsave(&qp->s_lock, flags);
+
+       /* Sending responses has higher priority over sending requests. */
+       if (qp->s_ack_state != IB_OPCODE_RC_ACKNOWLEDGE &&
+           (bth0 = ipath_make_rc_ack(qp, ohdr, pmtu)) != 0)
+               bth2 = qp->s_ack_psn++ & IPATH_PSN_MASK;
+       else if (!((qp->ibqp.qp_type == IB_QPT_RC) ?
+                  ipath_make_rc_req(qp, ohdr, pmtu, &bth0, &bth2) :
+                  ipath_make_uc_req(qp, ohdr, pmtu, &bth0, &bth2))) {
+               /*
+                * Clear the busy bit before unlocking to avoid races with
+                * adding new work queue items and then failing to process
+                * them.
+                */
+               clear_bit(IPATH_S_BUSY, &qp->s_flags);
+               spin_unlock_irqrestore(&qp->s_lock, flags);
+               goto bail;
+       }
+
+       spin_unlock_irqrestore(&qp->s_lock, flags);
+
+       /* Construct the header. */
+       extra_bytes = (4 - qp->s_cur_size) & 3;
+       nwords = (qp->s_cur_size + extra_bytes) >> 2;
+       lrh0 = IPATH_LRH_BTH;
+       if (unlikely(qp->remote_ah_attr.ah_flags & IB_AH_GRH)) {
+               qp->s_hdrwords += ipath_make_grh(dev, &qp->s_hdr.u.l.grh,
+                                                &qp->remote_ah_attr.grh,
+                                                qp->s_hdrwords, nwords);
+               lrh0 = IPATH_LRH_GRH;
+       }
+       lrh0 |= qp->remote_ah_attr.sl << 4;
+       qp->s_hdr.lrh[0] = cpu_to_be16(lrh0);
+       qp->s_hdr.lrh[1] = cpu_to_be16(qp->remote_ah_attr.dlid);
+       qp->s_hdr.lrh[2] = cpu_to_be16(qp->s_hdrwords + nwords +
+                                      SIZE_OF_CRC);
+       qp->s_hdr.lrh[3] = cpu_to_be16(ipath_layer_get_lid(dev->dd));
+       bth0 |= ipath_layer_get_pkey(dev->dd, qp->s_pkey_index);
+       bth0 |= extra_bytes << 20;
+       ohdr->bth[0] = cpu_to_be32(bth0);
+       ohdr->bth[1] = cpu_to_be32(qp->remote_qpn);
+       ohdr->bth[2] = cpu_to_be32(bth2);
+
+       /* Check for more work to do. */
+       goto again;
+
+clear:
+       clear_bit(IPATH_S_BUSY, &qp->s_flags);
+bail:
+       return;
+}
index 01c4c6c56118a43733bc2e56a7f960af2ed4f1ed..f760434660bd1e589d666f9d31ab09b6d51b9fa7 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -125,11 +126,23 @@ struct ib_srq *ipath_create_srq(struct ib_pd *ibpd,
                                struct ib_srq_init_attr *srq_init_attr,
                                struct ib_udata *udata)
 {
+       struct ipath_ibdev *dev = to_idev(ibpd->device);
        struct ipath_srq *srq;
        u32 sz;
        struct ib_srq *ret;
 
-       if (srq_init_attr->attr.max_sge < 1) {
+       if (dev->n_srqs_allocated == ib_ipath_max_srqs) {
+               ret = ERR_PTR(-ENOMEM);
+               goto bail;
+       }
+
+       if (srq_init_attr->attr.max_wr == 0) {
+               ret = ERR_PTR(-EINVAL);
+               goto bail;
+       }
+
+       if ((srq_init_attr->attr.max_sge > ib_ipath_max_srq_sges) ||
+           (srq_init_attr->attr.max_wr > ib_ipath_max_srq_wrs)) {
                ret = ERR_PTR(-EINVAL);
                goto bail;
        }
@@ -164,6 +177,8 @@ struct ib_srq *ipath_create_srq(struct ib_pd *ibpd,
 
        ret = &srq->ibsrq;
 
+       dev->n_srqs_allocated++;
+
 bail:
        return ret;
 }
@@ -181,24 +196,26 @@ int ipath_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
        unsigned long flags;
        int ret;
 
-       if (attr_mask & IB_SRQ_LIMIT) {
-               spin_lock_irqsave(&srq->rq.lock, flags);
-               srq->limit = attr->srq_limit;
-               spin_unlock_irqrestore(&srq->rq.lock, flags);
-       }
-       if (attr_mask & IB_SRQ_MAX_WR) {
-               u32 size = attr->max_wr + 1;
-               struct ipath_rwqe *wq, *p;
-               u32 n;
-               u32 sz;
+       if (attr_mask & IB_SRQ_MAX_WR)
+               if ((attr->max_wr > ib_ipath_max_srq_wrs) ||
+                   (attr->max_sge > srq->rq.max_sge)) {
+                       ret = -EINVAL;
+                       goto bail;
+               }
 
-               if (attr->max_sge < srq->rq.max_sge) {
+       if (attr_mask & IB_SRQ_LIMIT)
+               if (attr->srq_limit >= srq->rq.size) {
                        ret = -EINVAL;
                        goto bail;
                }
 
+       if (attr_mask & IB_SRQ_MAX_WR) {
+               struct ipath_rwqe *wq, *p;
+               u32 sz, size, n;
+
                sz = sizeof(struct ipath_rwqe) +
                        attr->max_sge * sizeof(struct ipath_sge);
+               size = attr->max_wr + 1;
                wq = vmalloc(size * sz);
                if (!wq) {
                        ret = -ENOMEM;
@@ -242,6 +259,11 @@ int ipath_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
                spin_unlock_irqrestore(&srq->rq.lock, flags);
        }
 
+       if (attr_mask & IB_SRQ_LIMIT) {
+               spin_lock_irqsave(&srq->rq.lock, flags);
+               srq->limit = attr->srq_limit;
+               spin_unlock_irqrestore(&srq->rq.lock, flags);
+       }
        ret = 0;
 
 bail:
@@ -265,7 +287,9 @@ int ipath_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr)
 int ipath_destroy_srq(struct ib_srq *ibsrq)
 {
        struct ipath_srq *srq = to_isrq(ibsrq);
+       struct ipath_ibdev *dev = to_idev(ibsrq->device);
 
+       dev->n_srqs_allocated--;
        vfree(srq->rq.wq);
        kfree(srq);
 
index fe209137ee74f93770b8bab831002e3667557960..70351b7e35c0a8603247141c972edb47b3477ca4 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -185,7 +186,6 @@ static void ipath_qcheck(struct ipath_devdata *dd)
                                   dd->ipath_port0head,
                                   (unsigned long long)
                                   ipath_stats.sps_port0pkts);
-                       ipath_kreceive(dd);
                }
                dd->ipath_lastport0rcv_cnt = ipath_stats.sps_port0pkts;
        }
index f323791cc49513d2b25be8238f68f6538dda330b..b98821d7801d9be3b758825b11e50fd398a2dbe0 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -34,8 +35,8 @@
 #include <linux/pci.h>
 
 #include "ipath_kernel.h"
-#include "ips_common.h"
 #include "ipath_layer.h"
+#include "ipath_common.h"
 
 /**
  * ipath_parse_ushort - parse an unsigned short value in an arbitrary base
@@ -84,99 +85,6 @@ static ssize_t show_num_units(struct device_driver *dev, char *buf)
                         ipath_count_units(NULL, NULL, NULL));
 }
 
-#define DRIVER_STAT(name, attr) \
-       static ssize_t show_stat_##name(struct device_driver *dev, \
-                                       char *buf) \
-       { \
-               return scnprintf( \
-                       buf, PAGE_SIZE, "%llu\n", \
-                       (unsigned long long) ipath_stats.sps_ ##attr); \
-       } \
-       static DRIVER_ATTR(name, S_IRUGO, show_stat_##name, NULL)
-
-DRIVER_STAT(intrs, ints);
-DRIVER_STAT(err_intrs, errints);
-DRIVER_STAT(errs, errs);
-DRIVER_STAT(pkt_errs, pkterrs);
-DRIVER_STAT(crc_errs, crcerrs);
-DRIVER_STAT(hw_errs, hwerrs);
-DRIVER_STAT(ib_link, iblink);
-DRIVER_STAT(port0_pkts, port0pkts);
-DRIVER_STAT(ether_spkts, ether_spkts);
-DRIVER_STAT(ether_rpkts, ether_rpkts);
-DRIVER_STAT(sma_spkts, sma_spkts);
-DRIVER_STAT(sma_rpkts, sma_rpkts);
-DRIVER_STAT(hdrq_full, hdrqfull);
-DRIVER_STAT(etid_full, etidfull);
-DRIVER_STAT(no_piobufs, nopiobufs);
-DRIVER_STAT(ports, ports);
-DRIVER_STAT(pkey0, pkeys[0]);
-DRIVER_STAT(pkey1, pkeys[1]);
-DRIVER_STAT(pkey2, pkeys[2]);
-DRIVER_STAT(pkey3, pkeys[3]);
-/* XXX fix the following when dynamic table of devices used */
-DRIVER_STAT(lid0, lid[0]);
-DRIVER_STAT(lid1, lid[1]);
-DRIVER_STAT(lid2, lid[2]);
-DRIVER_STAT(lid3, lid[3]);
-
-DRIVER_STAT(nports, nports);
-DRIVER_STAT(null_intr, nullintr);
-DRIVER_STAT(max_pkts_call, maxpkts_call);
-DRIVER_STAT(avg_pkts_call, avgpkts_call);
-DRIVER_STAT(page_locks, pagelocks);
-DRIVER_STAT(page_unlocks, pageunlocks);
-DRIVER_STAT(krdrops, krdrops);
-/* XXX fix the following when dynamic table of devices used */
-DRIVER_STAT(mlid0, mlid[0]);
-DRIVER_STAT(mlid1, mlid[1]);
-DRIVER_STAT(mlid2, mlid[2]);
-DRIVER_STAT(mlid3, mlid[3]);
-
-static struct attribute *driver_stat_attributes[] = {
-       &driver_attr_intrs.attr,
-       &driver_attr_err_intrs.attr,
-       &driver_attr_errs.attr,
-       &driver_attr_pkt_errs.attr,
-       &driver_attr_crc_errs.attr,
-       &driver_attr_hw_errs.attr,
-       &driver_attr_ib_link.attr,
-       &driver_attr_port0_pkts.attr,
-       &driver_attr_ether_spkts.attr,
-       &driver_attr_ether_rpkts.attr,
-       &driver_attr_sma_spkts.attr,
-       &driver_attr_sma_rpkts.attr,
-       &driver_attr_hdrq_full.attr,
-       &driver_attr_etid_full.attr,
-       &driver_attr_no_piobufs.attr,
-       &driver_attr_ports.attr,
-       &driver_attr_pkey0.attr,
-       &driver_attr_pkey1.attr,
-       &driver_attr_pkey2.attr,
-       &driver_attr_pkey3.attr,
-       &driver_attr_lid0.attr,
-       &driver_attr_lid1.attr,
-       &driver_attr_lid2.attr,
-       &driver_attr_lid3.attr,
-       &driver_attr_nports.attr,
-       &driver_attr_null_intr.attr,
-       &driver_attr_max_pkts_call.attr,
-       &driver_attr_avg_pkts_call.attr,
-       &driver_attr_page_locks.attr,
-       &driver_attr_page_unlocks.attr,
-       &driver_attr_krdrops.attr,
-       &driver_attr_mlid0.attr,
-       &driver_attr_mlid1.attr,
-       &driver_attr_mlid2.attr,
-       &driver_attr_mlid3.attr,
-       NULL
-};
-
-static struct attribute_group driver_stat_attr_group = {
-       .name = "stats",
-       .attrs = driver_stat_attributes
-};
-
 static ssize_t show_status(struct device *dev,
                           struct device_attribute *attr,
                           char *buf)
@@ -272,23 +180,23 @@ static ssize_t store_lid(struct device *dev,
                          size_t count)
 {
        struct ipath_devdata *dd = dev_get_drvdata(dev);
-       u16 lid;
+       u16 lid = 0;
        int ret;
 
        ret = ipath_parse_ushort(buf, &lid);
        if (ret < 0)
                goto invalid;
 
-       if (lid == 0 || lid >= 0xc000) {
+       if (lid == 0 || lid >= IPATH_MULTICAST_LID_BASE) {
                ret = -EINVAL;
                goto invalid;
        }
 
-       ipath_set_sps_lid(dd, lid, 0);
+       ipath_set_lid(dd, lid, 0);
 
        goto bail;
 invalid:
-       ipath_dev_err(dd, "attempt to set invalid LID\n");
+       ipath_dev_err(dd, "attempt to set invalid LID 0x%x\n", lid);
 bail:
        return ret;
 }
@@ -313,13 +221,12 @@ static ssize_t store_mlid(struct device *dev,
        int ret;
 
        ret = ipath_parse_ushort(buf, &mlid);
-       if (ret < 0)
+       if (ret < 0 || mlid < IPATH_MULTICAST_LID_BASE)
                goto invalid;
 
        unit = dd->ipath_unit;
 
        dd->ipath_mlid = mlid;
-       ipath_stats.sps_mlid[unit] = mlid;
        ipath_layer_intr(dd, IPATH_LAYER_INT_BCAST);
 
        goto bail;
@@ -734,20 +641,12 @@ int ipath_driver_create_group(struct device_driver *drv)
        int ret;
 
        ret = sysfs_create_group(&drv->kobj, &driver_attr_group);
-       if (ret)
-               goto bail;
 
-       ret = sysfs_create_group(&drv->kobj, &driver_stat_attr_group);
-       if (ret)
-               sysfs_remove_group(&drv->kobj, &driver_attr_group);
-
-bail:
        return ret;
 }
 
 void ipath_driver_remove_group(struct device_driver *drv)
 {
-       sysfs_remove_group(&drv->kobj, &driver_stat_attr_group);
        sysfs_remove_group(&drv->kobj, &driver_attr_group);
 }
 
index 0d6dbc0a541e399dd4ae64deef480efa46cc5d01..c33abea2d5a7c72de0c3f56638e64a6ed7428def 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -31,7 +32,7 @@
  */
 
 #include "ipath_verbs.h"
-#include "ips_common.h"
+#include "ipath_common.h"
 
 /* cut down ridiculously long IB macro names */
 #define OP(x) IB_OPCODE_UC_##x
@@ -61,90 +62,40 @@ static void complete_last_send(struct ipath_qp *qp, struct ipath_swqe *wqe,
 }
 
 /**
- * ipath_do_uc_send - do a send on a UC queue
- * @data: contains a pointer to the QP to send on
+ * ipath_make_uc_req - construct a request packet (SEND, RDMA write)
+ * @qp: a pointer to the QP
+ * @ohdr: a pointer to the IB header being constructed
+ * @pmtu: the path MTU
+ * @bth0p: pointer to the BTH opcode word
+ * @bth2p: pointer to the BTH PSN word
  *
- * Process entries in the send work queue until the queue is exhausted.
- * Only allow one CPU to send a packet per QP (tasklet).
- * Otherwise, after we drop the QP lock, two threads could send
- * packets out of order.
- * This is similar to ipath_do_rc_send() below except we don't have
- * timeouts or resends.
+ * Return 1 if constructed; otherwise, return 0.
+ * Note the QP s_lock must be held and interrupts disabled.
  */
-void ipath_do_uc_send(unsigned long data)
+int ipath_make_uc_req(struct ipath_qp *qp,
+                     struct ipath_other_headers *ohdr,
+                     u32 pmtu, u32 *bth0p, u32 *bth2p)
 {
-       struct ipath_qp *qp = (struct ipath_qp *)data;
-       struct ipath_ibdev *dev = to_idev(qp->ibqp.device);
        struct ipath_swqe *wqe;
-       unsigned long flags;
-       u16 lrh0;
        u32 hwords;
-       u32 nwords;
-       u32 extra_bytes;
        u32 bth0;
-       u32 bth2;
-       u32 pmtu = ib_mtu_enum_to_int(qp->path_mtu);
        u32 len;
-       struct ipath_other_headers *ohdr;
        struct ib_wc wc;
 
-       if (test_and_set_bit(IPATH_S_BUSY, &qp->s_flags))
-               goto bail;
-
-       if (unlikely(qp->remote_ah_attr.dlid ==
-                    ipath_layer_get_lid(dev->dd))) {
-               /* Pass in an uninitialized ib_wc to save stack space. */
-               ipath_ruc_loopback(qp, &wc);
-               clear_bit(IPATH_S_BUSY, &qp->s_flags);
-               goto bail;
-       }
-
-       ohdr = &qp->s_hdr.u.oth;
-       if (qp->remote_ah_attr.ah_flags & IB_AH_GRH)
-               ohdr = &qp->s_hdr.u.l.oth;
-
-again:
-       /* Check for a constructed packet to be sent. */
-       if (qp->s_hdrwords != 0) {
-                       /*
-                        * If no PIO bufs are available, return.
-                        * An interrupt will call ipath_ib_piobufavail()
-                        * when one is available.
-                        */
-                       if (ipath_verbs_send(dev->dd, qp->s_hdrwords,
-                                            (u32 *) &qp->s_hdr,
-                                            qp->s_cur_size,
-                                            qp->s_cur_sge)) {
-                               ipath_no_bufs_available(qp, dev);
-                               goto bail;
-                       }
-                       dev->n_unicast_xmit++;
-               /* Record that we sent the packet and s_hdr is empty. */
-               qp->s_hdrwords = 0;
-       }
-
-       lrh0 = IPS_LRH_BTH;
-       /* header size in 32-bit words LRH+BTH = (8+12)/4. */
-       hwords = 5;
-
-       /*
-        * The lock is needed to synchronize between
-        * setting qp->s_ack_state and post_send().
-        */
-       spin_lock_irqsave(&qp->s_lock, flags);
-
        if (!(ib_ipath_state_ops[qp->state] & IPATH_PROCESS_SEND_OK))
                goto done;
 
-       bth0 = ipath_layer_get_pkey(dev->dd, qp->s_pkey_index);
+       /* header size in 32-bit words LRH+BTH = (8+12)/4. */
+       hwords = 5;
+       bth0 = 0;
 
-       /* Send a request. */
+       /* Get the next send request. */
        wqe = get_swqe_ptr(qp, qp->s_last);
        switch (qp->s_state) {
        default:
                /*
-                * Signal the completion of the last send (if there is
-                * one).
+                * Signal the completion of the last send
+                * (if there is one).
                 */
                if (qp->s_last != qp->s_tail)
                        complete_last_send(qp, wqe, &wc);
@@ -257,61 +208,16 @@ again:
                }
                break;
        }
-       bth2 = qp->s_next_psn++ & IPS_PSN_MASK;
        qp->s_len -= len;
-       bth0 |= qp->s_state << 24;
-
-       spin_unlock_irqrestore(&qp->s_lock, flags);
-
-       /* Construct the header. */
-       extra_bytes = (4 - len) & 3;
-       nwords = (len + extra_bytes) >> 2;
-       if (unlikely(qp->remote_ah_attr.ah_flags & IB_AH_GRH)) {
-               /* Header size in 32-bit words. */
-               hwords += 10;
-               lrh0 = IPS_LRH_GRH;
-               qp->s_hdr.u.l.grh.version_tclass_flow =
-                       cpu_to_be32((6 << 28) |
-                                   (qp->remote_ah_attr.grh.traffic_class
-                                    << 20) |
-                                   qp->remote_ah_attr.grh.flow_label);
-               qp->s_hdr.u.l.grh.paylen =
-                       cpu_to_be16(((hwords - 12) + nwords +
-                                    SIZE_OF_CRC) << 2);
-               /* next_hdr is defined by C8-7 in ch. 8.4.1 */
-               qp->s_hdr.u.l.grh.next_hdr = 0x1B;
-               qp->s_hdr.u.l.grh.hop_limit =
-                       qp->remote_ah_attr.grh.hop_limit;
-               /* The SGID is 32-bit aligned. */
-               qp->s_hdr.u.l.grh.sgid.global.subnet_prefix =
-                       dev->gid_prefix;
-               qp->s_hdr.u.l.grh.sgid.global.interface_id =
-                       ipath_layer_get_guid(dev->dd);
-               qp->s_hdr.u.l.grh.dgid = qp->remote_ah_attr.grh.dgid;
-       }
        qp->s_hdrwords = hwords;
        qp->s_cur_sge = &qp->s_sge;
        qp->s_cur_size = len;
-       lrh0 |= qp->remote_ah_attr.sl << 4;
-       qp->s_hdr.lrh[0] = cpu_to_be16(lrh0);
-       /* DEST LID */
-       qp->s_hdr.lrh[1] = cpu_to_be16(qp->remote_ah_attr.dlid);
-       qp->s_hdr.lrh[2] = cpu_to_be16(hwords + nwords + SIZE_OF_CRC);
-       qp->s_hdr.lrh[3] = cpu_to_be16(ipath_layer_get_lid(dev->dd));
-       bth0 |= extra_bytes << 20;
-       ohdr->bth[0] = cpu_to_be32(bth0);
-       ohdr->bth[1] = cpu_to_be32(qp->remote_qpn);
-       ohdr->bth[2] = cpu_to_be32(bth2);
-
-       /* Check for more work to do. */
-       goto again;
+       *bth0p = bth0 | (qp->s_state << 24);
+       *bth2p = qp->s_next_psn++ & IPATH_PSN_MASK;
+       return 1;
 
 done:
-       spin_unlock_irqrestore(&qp->s_lock, flags);
-       clear_bit(IPATH_S_BUSY, &qp->s_flags);
-
-bail:
-       return;
+       return 0;
 }
 
 /**
@@ -335,7 +241,6 @@ void ipath_uc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
        u32 hdrsize;
        u32 psn;
        u32 pad;
-       unsigned long flags;
        struct ib_wc wc;
        u32 pmtu = ib_mtu_enum_to_int(qp->path_mtu);
        struct ib_reth *reth;
@@ -373,8 +278,6 @@ void ipath_uc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
        wc.imm_data = 0;
        wc.wc_flags = 0;
 
-       spin_lock_irqsave(&qp->r_rq.lock, flags);
-
        /* Compare the PSN verses the expected PSN. */
        if (unlikely(ipath_cmp24(psn, qp->r_psn) != 0)) {
                /*
@@ -535,12 +438,13 @@ void ipath_uc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
                if (qp->r_len != 0) {
                        u32 rkey = be32_to_cpu(reth->rkey);
                        u64 vaddr = be64_to_cpu(reth->vaddr);
+                       int ok;
 
                        /* Check rkey */
-                       if (unlikely(!ipath_rkey_ok(
-                                            dev, &qp->r_sge, qp->r_len,
-                                            vaddr, rkey,
-                                            IB_ACCESS_REMOTE_WRITE))) {
+                       ok = ipath_rkey_ok(dev, &qp->r_sge, qp->r_len,
+                                          vaddr, rkey,
+                                          IB_ACCESS_REMOTE_WRITE);
+                       if (unlikely(!ok)) {
                                dev->n_pkt_drops++;
                                goto done;
                        }
@@ -558,8 +462,7 @@ void ipath_uc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
                }
                if (opcode == OP(RDMA_WRITE_ONLY))
                        goto rdma_last;
-               else if (opcode ==
-                        OP(RDMA_WRITE_ONLY_WITH_IMMEDIATE))
+               else if (opcode == OP(RDMA_WRITE_ONLY_WITH_IMMEDIATE))
                        goto rdma_last_imm;
                /* FALLTHROUGH */
        case OP(RDMA_WRITE_MIDDLE):
@@ -592,9 +495,9 @@ void ipath_uc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
                        dev->n_pkt_drops++;
                        goto done;
                }
-               if (qp->r_reuse_sge) {
+               if (qp->r_reuse_sge)
                        qp->r_reuse_sge = 0;
-               else if (!ipath_get_rwqe(qp, 1)) {
+               else if (!ipath_get_rwqe(qp, 1)) {
                        dev->n_pkt_drops++;
                        goto done;
                }
@@ -631,15 +534,11 @@ void ipath_uc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
 
        default:
                /* Drop packet for unknown opcodes. */
-               spin_unlock_irqrestore(&qp->r_rq.lock, flags);
                dev->n_pkt_drops++;
-               goto bail;
+               goto done;
        }
        qp->r_psn++;
        qp->r_state = opcode;
 done:
-       spin_unlock_irqrestore(&qp->r_rq.lock, flags);
-
-bail:
        return;
 }
index e606daf8321064582eb2a5d04a106f2166d2fef5..3466129af8043d6538399bf420ceac9a6e174ad8 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -33,7 +34,7 @@
 #include <rdma/ib_smi.h>
 
 #include "ipath_verbs.h"
-#include "ips_common.h"
+#include "ipath_common.h"
 
 /**
  * ipath_ud_loopback - handle send on loopback QPs
@@ -274,6 +275,11 @@ int ipath_post_ud_send(struct ipath_qp *qp, struct ib_send_wr *wr)
                len += wr->sg_list[i].length;
                ss.num_sge++;
        }
+       /* Check for invalid packet size. */
+       if (len > ipath_layer_get_ibmtu(dev->dd)) {
+               ret = -EINVAL;
+               goto bail;
+       }
        extra_bytes = (4 - len) & 3;
        nwords = (len + extra_bytes) >> 2;
 
@@ -283,8 +289,8 @@ int ipath_post_ud_send(struct ipath_qp *qp, struct ib_send_wr *wr)
                ret = -EINVAL;
                goto bail;
        }
-       if (ah_attr->dlid >= IPS_MULTICAST_LID_BASE) {
-               if (ah_attr->dlid != IPS_PERMISSIVE_LID)
+       if (ah_attr->dlid >= IPATH_MULTICAST_LID_BASE) {
+               if (ah_attr->dlid != IPATH_PERMISSIVE_LID)
                        dev->n_multicast_xmit++;
                else
                        dev->n_unicast_xmit++;
@@ -304,7 +310,7 @@ int ipath_post_ud_send(struct ipath_qp *qp, struct ib_send_wr *wr)
        if (ah_attr->ah_flags & IB_AH_GRH) {
                /* Header size in 32-bit words. */
                hwords = 17;
-               lrh0 = IPS_LRH_GRH;
+               lrh0 = IPATH_LRH_GRH;
                ohdr = &qp->s_hdr.u.l.oth;
                qp->s_hdr.u.l.grh.version_tclass_flow =
                        cpu_to_be32((6 << 28) |
@@ -330,7 +336,7 @@ int ipath_post_ud_send(struct ipath_qp *qp, struct ib_send_wr *wr)
        } else {
                /* Header size in 32-bit words. */
                hwords = 7;
-               lrh0 = IPS_LRH_BTH;
+               lrh0 = IPATH_LRH_BTH;
                ohdr = &qp->s_hdr.u.oth;
        }
        if (wr->opcode == IB_WR_SEND_WITH_IMM) {
@@ -361,18 +367,18 @@ int ipath_post_ud_send(struct ipath_qp *qp, struct ib_send_wr *wr)
        if (wr->send_flags & IB_SEND_SOLICITED)
                bth0 |= 1 << 23;
        bth0 |= extra_bytes << 20;
-       bth0 |= qp->ibqp.qp_type == IB_QPT_SMI ? IPS_DEFAULT_P_KEY :
+       bth0 |= qp->ibqp.qp_type == IB_QPT_SMI ? IPATH_DEFAULT_P_KEY :
                ipath_layer_get_pkey(dev->dd, qp->s_pkey_index);
        ohdr->bth[0] = cpu_to_be32(bth0);
        /*
         * Use the multicast QP if the destination LID is a multicast LID.
         */
-       ohdr->bth[1] = ah_attr->dlid >= IPS_MULTICAST_LID_BASE &&
-               ah_attr->dlid != IPS_PERMISSIVE_LID ?
-               __constant_cpu_to_be32(IPS_MULTICAST_QPN) :
+       ohdr->bth[1] = ah_attr->dlid >= IPATH_MULTICAST_LID_BASE &&
+               ah_attr->dlid != IPATH_PERMISSIVE_LID ?
+               __constant_cpu_to_be32(IPATH_MULTICAST_QPN) :
                cpu_to_be32(wr->wr.ud.remote_qpn);
        /* XXX Could lose a PSN count but not worth locking */
-       ohdr->bth[2] = cpu_to_be32(qp->s_next_psn++ & IPS_PSN_MASK);
+       ohdr->bth[2] = cpu_to_be32(qp->s_next_psn++ & IPATH_PSN_MASK);
        /*
         * Qkeys with the high order bit set mean use the
         * qkey from the QP context instead of the WR (see 10.2.5).
@@ -463,7 +469,7 @@ void ipath_ud_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
                        src_qp = be32_to_cpu(ohdr->u.ud.deth[1]);
                }
        }
-       src_qp &= IPS_QPN_MASK;
+       src_qp &= IPATH_QPN_MASK;
 
        /*
         * Check that the permissive LID is only used on QP0
@@ -554,7 +560,16 @@ void ipath_ud_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
        spin_lock_irqsave(&rq->lock, flags);
        if (rq->tail == rq->head) {
                spin_unlock_irqrestore(&rq->lock, flags);
-               dev->n_pkt_drops++;
+               /*
+                * Count VL15 packets dropped due to no receive buffer.
+                * Otherwise, count them as buffer overruns since usually,
+                * the HW will be able to receive packets even if there are
+                * no QPs with posted receive buffers.
+                */
+               if (qp->ibqp.qp_num == 0)
+                       dev->n_vl15_dropped++;
+               else
+                       dev->rcv_errors++;
                goto bail;
        }
        /* Silently drop packets which are too big. */
@@ -612,7 +627,7 @@ void ipath_ud_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
        /*
         * Save the LMC lower bits if the destination LID is a unicast LID.
         */
-       wc.dlid_path_bits = dlid >= IPS_MULTICAST_LID_BASE ? 0 :
+       wc.dlid_path_bits = dlid >= IPATH_MULTICAST_LID_BASE ? 0 :
                dlid & ((1 << (dev->mkeyprot_resv_lmc & 7)) - 1);
        /* Signal completion event if the solicited bit is set. */
        ipath_cq_enter(to_icq(qp->ibqp.recv_cq), &wc,
index 2bb08afc86d01ace15ff1fb6b9f405ab732f4a5d..e32fca9faf80360ced178df98a67516b78dd4bff 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -57,17 +58,6 @@ static int __get_user_pages(unsigned long start_page, size_t num_pages,
        size_t got;
        int ret;
 
-#if 0
-       /*
-        * XXX - causes MPI programs to fail, haven't had time to check
-        * yet
-        */
-       if (!capable(CAP_IPC_LOCK)) {
-               ret = -EPERM;
-               goto bail;
-       }
-#endif
-
        lock_limit = current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur >>
                PAGE_SHIFT;
 
index 28fdbdaa789db8acecceb4d72192cd3a5aea19bd..56ac336dd1ecb59560c2e018402dd82fd4201d83 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -36,7 +37,7 @@
 
 #include "ipath_kernel.h"
 #include "ipath_verbs.h"
-#include "ips_common.h"
+#include "ipath_common.h"
 
 /* Not static, because we don't want the compiler removing it */
 const char ipath_verbs_version[] = "ipath_verbs " IPATH_IDSTR;
@@ -55,9 +56,62 @@ unsigned int ib_ipath_debug; /* debug mask */
 module_param_named(debug, ib_ipath_debug, uint, S_IWUSR | S_IRUGO);
 MODULE_PARM_DESC(debug, "Verbs debug mask");
 
+static unsigned int ib_ipath_max_pds = 0xFFFF;
+module_param_named(max_pds, ib_ipath_max_pds, uint, S_IWUSR | S_IRUGO);
+MODULE_PARM_DESC(max_pds,
+                "Maximum number of protection domains to support");
+
+static unsigned int ib_ipath_max_ahs = 0xFFFF;
+module_param_named(max_ahs, ib_ipath_max_ahs, uint, S_IWUSR | S_IRUGO);
+MODULE_PARM_DESC(max_ahs, "Maximum number of address handles to support");
+
+unsigned int ib_ipath_max_cqes = 0x2FFFF;
+module_param_named(max_cqes, ib_ipath_max_cqes, uint, S_IWUSR | S_IRUGO);
+MODULE_PARM_DESC(max_cqes,
+                "Maximum number of completion queue entries to support");
+
+unsigned int ib_ipath_max_cqs = 0x1FFFF;
+module_param_named(max_cqs, ib_ipath_max_cqs, uint, S_IWUSR | S_IRUGO);
+MODULE_PARM_DESC(max_cqs, "Maximum number of completion queues to support");
+
+unsigned int ib_ipath_max_qp_wrs = 0x3FFF;
+module_param_named(max_qp_wrs, ib_ipath_max_qp_wrs, uint,
+                  S_IWUSR | S_IRUGO);
+MODULE_PARM_DESC(max_qp_wrs, "Maximum number of QP WRs to support");
+
+unsigned int ib_ipath_max_sges = 0x60;
+module_param_named(max_sges, ib_ipath_max_sges, uint, S_IWUSR | S_IRUGO);
+MODULE_PARM_DESC(max_sges, "Maximum number of SGEs to support");
+
+unsigned int ib_ipath_max_mcast_grps = 16384;
+module_param_named(max_mcast_grps, ib_ipath_max_mcast_grps, uint,
+                  S_IWUSR | S_IRUGO);
+MODULE_PARM_DESC(max_mcast_grps,
+                "Maximum number of multicast groups to support");
+
+unsigned int ib_ipath_max_mcast_qp_attached = 16;
+module_param_named(max_mcast_qp_attached, ib_ipath_max_mcast_qp_attached,
+                  uint, S_IWUSR | S_IRUGO);
+MODULE_PARM_DESC(max_mcast_qp_attached,
+                "Maximum number of attached QPs to support");
+
+unsigned int ib_ipath_max_srqs = 1024;
+module_param_named(max_srqs, ib_ipath_max_srqs, uint, S_IWUSR | S_IRUGO);
+MODULE_PARM_DESC(max_srqs, "Maximum number of SRQs to support");
+
+unsigned int ib_ipath_max_srq_sges = 128;
+module_param_named(max_srq_sges, ib_ipath_max_srq_sges,
+                  uint, S_IWUSR | S_IRUGO);
+MODULE_PARM_DESC(max_srq_sges, "Maximum number of SRQ SGEs to support");
+
+unsigned int ib_ipath_max_srq_wrs = 0x1FFFF;
+module_param_named(max_srq_wrs, ib_ipath_max_srq_wrs,
+                  uint, S_IWUSR | S_IRUGO);
+MODULE_PARM_DESC(max_srq_wrs, "Maximum number of SRQ WRs support");
+
 MODULE_LICENSE("GPL");
-MODULE_AUTHOR("PathScale <support@pathscale.com>");
-MODULE_DESCRIPTION("Pathscale InfiniPath driver");
+MODULE_AUTHOR("QLogic <support@pathscale.com>");
+MODULE_DESCRIPTION("QLogic InfiniPath driver");
 
 const int ib_ipath_state_ops[IB_QPS_ERR + 1] = {
        [IB_QPS_RESET] = 0,
@@ -193,7 +247,7 @@ static int ipath_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
                switch (qp->ibqp.qp_type) {
                case IB_QPT_UC:
                case IB_QPT_RC:
-                       err = ipath_post_rc_send(qp, wr);
+                       err = ipath_post_ruc_send(qp, wr);
                        break;
 
                case IB_QPT_SMI:
@@ -375,7 +429,7 @@ static void ipath_ib_rcv(void *arg, void *rhdr, void *data, u32 tlen)
 
        /* Check for a valid destination LID (see ch. 7.11.1). */
        lid = be16_to_cpu(hdr->lrh[1]);
-       if (lid < IPS_MULTICAST_LID_BASE) {
+       if (lid < IPATH_MULTICAST_LID_BASE) {
                lid &= ~((1 << (dev->mkeyprot_resv_lmc & 7)) - 1);
                if (unlikely(lid != ipath_layer_get_lid(dev->dd))) {
                        dev->rcv_errors++;
@@ -385,9 +439,9 @@ static void ipath_ib_rcv(void *arg, void *rhdr, void *data, u32 tlen)
 
        /* Check for GRH */
        lnh = be16_to_cpu(hdr->lrh[0]) & 3;
-       if (lnh == IPS_LRH_BTH)
+       if (lnh == IPATH_LRH_BTH)
                ohdr = &hdr->u.oth;
-       else if (lnh == IPS_LRH_GRH)
+       else if (lnh == IPATH_LRH_GRH)
                ohdr = &hdr->u.l.oth;
        else {
                dev->rcv_errors++;
@@ -399,8 +453,8 @@ static void ipath_ib_rcv(void *arg, void *rhdr, void *data, u32 tlen)
        dev->opstats[opcode].n_packets++;
 
        /* Get the destination QP number. */
-       qp_num = be32_to_cpu(ohdr->bth[1]) & IPS_QPN_MASK;
-       if (qp_num == IPS_MULTICAST_QPN) {
+       qp_num = be32_to_cpu(ohdr->bth[1]) & IPATH_QPN_MASK;
+       if (qp_num == IPATH_MULTICAST_QPN) {
                struct ipath_mcast *mcast;
                struct ipath_mcast_qp *p;
 
@@ -411,7 +465,7 @@ static void ipath_ib_rcv(void *arg, void *rhdr, void *data, u32 tlen)
                }
                dev->n_multicast_rcv++;
                list_for_each_entry_rcu(p, &mcast->qp_list, list)
-                       ipath_qp_rcv(dev, hdr, lnh == IPS_LRH_GRH, data,
+                       ipath_qp_rcv(dev, hdr, lnh == IPATH_LRH_GRH, data,
                                     tlen, p->qp);
                /*
                 * Notify ipath_multicast_detach() if it is waiting for us
@@ -423,7 +477,7 @@ static void ipath_ib_rcv(void *arg, void *rhdr, void *data, u32 tlen)
                qp = ipath_lookup_qpn(&dev->qp_table, qp_num);
                if (qp) {
                        dev->n_unicast_rcv++;
-                       ipath_qp_rcv(dev, hdr, lnh == IPS_LRH_GRH, data,
+                       ipath_qp_rcv(dev, hdr, lnh == IPATH_LRH_GRH, data,
                                     tlen, qp);
                        /*
                         * Notify ipath_destroy_qp() if it is waiting
@@ -567,40 +621,38 @@ static int ipath_query_device(struct ib_device *ibdev,
                              struct ib_device_attr *props)
 {
        struct ipath_ibdev *dev = to_idev(ibdev);
-       u32 vendor, boardrev, majrev, minrev;
 
        memset(props, 0, sizeof(*props));
 
        props->device_cap_flags = IB_DEVICE_BAD_PKEY_CNTR |
                IB_DEVICE_BAD_QKEY_CNTR | IB_DEVICE_SHUTDOWN_PORT |
                IB_DEVICE_SYS_IMAGE_GUID;
-       ipath_layer_query_device(dev->dd, &vendor, &boardrev,
-                                &majrev, &minrev);
-       props->vendor_id = vendor;
-       props->vendor_part_id = boardrev;
-       props->hw_ver = boardrev << 16 | majrev << 8 | minrev;
+       props->vendor_id = ipath_layer_get_vendorid(dev->dd);
+       props->vendor_part_id = ipath_layer_get_deviceid(dev->dd);
+       props->hw_ver = ipath_layer_get_pcirev(dev->dd);
 
        props->sys_image_guid = dev->sys_image_guid;
 
        props->max_mr_size = ~0ull;
-       props->max_qp = 0xffff;
-       props->max_qp_wr = 0xffff;
-       props->max_sge = 255;
-       props->max_cq = 0xffff;
-       props->max_cqe = 0xffff;
-       props->max_mr = 0xffff;
-       props->max_pd = 0xffff;
+       props->max_qp = dev->qp_table.max;
+       props->max_qp_wr = ib_ipath_max_qp_wrs;
+       props->max_sge = ib_ipath_max_sges;
+       props->max_cq = ib_ipath_max_cqs;
+       props->max_ah = ib_ipath_max_ahs;
+       props->max_cqe = ib_ipath_max_cqes;
+       props->max_mr = dev->lk_table.max;
+       props->max_pd = ib_ipath_max_pds;
        props->max_qp_rd_atom = 1;
        props->max_qp_init_rd_atom = 1;
        /* props->max_res_rd_atom */
-       props->max_srq = 0xffff;
-       props->max_srq_wr = 0xffff;
-       props->max_srq_sge = 255;
+       props->max_srq = ib_ipath_max_srqs;
+       props->max_srq_wr = ib_ipath_max_srq_wrs;
+       props->max_srq_sge = ib_ipath_max_srq_sges;
        /* props->local_ca_ack_delay */
        props->atomic_cap = IB_ATOMIC_HCA;
        props->max_pkeys = ipath_layer_get_npkeys(dev->dd);
-       props->max_mcast_grp = 0xffff;
-       props->max_mcast_qp_attach = 0xffff;
+       props->max_mcast_grp = ib_ipath_max_mcast_grps;
+       props->max_mcast_qp_attach = ib_ipath_max_mcast_qp_attached;
        props->max_total_mcast_qp_attach = props->max_mcast_qp_attach *
                props->max_mcast_grp;
 
@@ -643,10 +695,10 @@ static int ipath_query_port(struct ib_device *ibdev,
                ipath_layer_get_lastibcstat(dev->dd) & 0xf];
        props->port_cap_flags = dev->port_cap_flags;
        props->gid_tbl_len = 1;
-       props->max_msg_sz = 4096;
+       props->max_msg_sz = 0x80000000;
        props->pkey_tbl_len = ipath_layer_get_npkeys(dev->dd);
        props->bad_pkey_cntr = ipath_layer_get_cr_errpkey(dev->dd) -
-               dev->n_pkey_violations;
+               dev->z_pkey_violations;
        props->qkey_viol_cntr = dev->qkey_violations;
        props->active_width = IB_WIDTH_4X;
        /* See rate_show() */
@@ -743,15 +795,30 @@ static struct ib_pd *ipath_alloc_pd(struct ib_device *ibdev,
                                    struct ib_ucontext *context,
                                    struct ib_udata *udata)
 {
+       struct ipath_ibdev *dev = to_idev(ibdev);
        struct ipath_pd *pd;
        struct ib_pd *ret;
 
+       /*
+        * This is actually totally arbitrary.  Some correctness tests
+        * assume there's a maximum number of PDs that can be allocated.
+        * We don't actually have this limit, but we fail the test if
+        * we allow allocations of more than we report for this value.
+        */
+
+       if (dev->n_pds_allocated == ib_ipath_max_pds) {
+               ret = ERR_PTR(-ENOMEM);
+               goto bail;
+       }
+
        pd = kmalloc(sizeof *pd, GFP_KERNEL);
        if (!pd) {
                ret = ERR_PTR(-ENOMEM);
                goto bail;
        }
 
+       dev->n_pds_allocated++;
+
        /* ib_alloc_pd() will initialize pd->ibpd. */
        pd->user = udata != NULL;
 
@@ -764,6 +831,9 @@ bail:
 static int ipath_dealloc_pd(struct ib_pd *ibpd)
 {
        struct ipath_pd *pd = to_ipd(ibpd);
+       struct ipath_ibdev *dev = to_idev(ibpd->device);
+
+       dev->n_pds_allocated--;
 
        kfree(pd);
 
@@ -782,21 +852,40 @@ static struct ib_ah *ipath_create_ah(struct ib_pd *pd,
 {
        struct ipath_ah *ah;
        struct ib_ah *ret;
+       struct ipath_ibdev *dev = to_idev(pd->device);
+
+       if (dev->n_ahs_allocated == ib_ipath_max_ahs) {
+               ret = ERR_PTR(-ENOMEM);
+               goto bail;
+       }
 
        /* A multicast address requires a GRH (see ch. 8.4.1). */
-       if (ah_attr->dlid >= IPS_MULTICAST_LID_BASE &&
-           ah_attr->dlid != IPS_PERMISSIVE_LID &&
+       if (ah_attr->dlid >= IPATH_MULTICAST_LID_BASE &&
+           ah_attr->dlid != IPATH_PERMISSIVE_LID &&
            !(ah_attr->ah_flags & IB_AH_GRH)) {
                ret = ERR_PTR(-EINVAL);
                goto bail;
        }
 
+       if (ah_attr->dlid == 0) {
+               ret = ERR_PTR(-EINVAL);
+               goto bail;
+       }
+
+       if (ah_attr->port_num < 1 ||
+           ah_attr->port_num > pd->device->phys_port_cnt) {
+               ret = ERR_PTR(-EINVAL);
+               goto bail;
+       }
+
        ah = kmalloc(sizeof *ah, GFP_ATOMIC);
        if (!ah) {
                ret = ERR_PTR(-ENOMEM);
                goto bail;
        }
 
+       dev->n_ahs_allocated++;
+
        /* ib_create_ah() will initialize ah->ibah. */
        ah->attr = *ah_attr;
 
@@ -814,8 +903,11 @@ bail:
  */
 static int ipath_destroy_ah(struct ib_ah *ibah)
 {
+       struct ipath_ibdev *dev = to_idev(ibah->device);
        struct ipath_ah *ah = to_iah(ibah);
 
+       dev->n_ahs_allocated--;
+
        kfree(ah);
 
        return 0;
@@ -889,6 +981,7 @@ static int ipath_verbs_register_sysfs(struct ib_device *dev);
  */
 static void *ipath_register_ib_device(int unit, struct ipath_devdata *dd)
 {
+       struct ipath_layer_counters cntrs;
        struct ipath_ibdev *idev;
        struct ib_device *dev;
        int ret;
@@ -939,6 +1032,25 @@ static void *ipath_register_ib_device(int unit, struct ipath_devdata *dd)
        idev->pma_counter_select[5] = IB_PMA_PORT_XMIT_WAIT;
        idev->link_width_enabled = 3;   /* 1x or 4x */
 
+       /* Snapshot current HW counters to "clear" them. */
+       ipath_layer_get_counters(dd, &cntrs);
+       idev->z_symbol_error_counter = cntrs.symbol_error_counter;
+       idev->z_link_error_recovery_counter =
+               cntrs.link_error_recovery_counter;
+       idev->z_link_downed_counter = cntrs.link_downed_counter;
+       idev->z_port_rcv_errors = cntrs.port_rcv_errors;
+       idev->z_port_rcv_remphys_errors =
+               cntrs.port_rcv_remphys_errors;
+       idev->z_port_xmit_discards = cntrs.port_xmit_discards;
+       idev->z_port_xmit_data = cntrs.port_xmit_data;
+       idev->z_port_rcv_data = cntrs.port_rcv_data;
+       idev->z_port_xmit_packets = cntrs.port_xmit_packets;
+       idev->z_port_rcv_packets = cntrs.port_rcv_packets;
+       idev->z_local_link_integrity_errors =
+               cntrs.local_link_integrity_errors;
+       idev->z_excessive_buffer_overrun_errors =
+               cntrs.excessive_buffer_overrun_errors;
+
        /*
         * The system image GUID is supposed to be the same for all
         * IB HCAs in a single system but since there can be other
@@ -1109,11 +1221,8 @@ static ssize_t show_rev(struct class_device *cdev, char *buf)
 {
        struct ipath_ibdev *dev =
                container_of(cdev, struct ipath_ibdev, ibdev.class_dev);
-       int vendor, boardrev, majrev, minrev;
 
-       ipath_layer_query_device(dev->dd, &vendor, &boardrev,
-                                &majrev, &minrev);
-       return sprintf(buf, "%d.%d\n", majrev, minrev);
+       return sprintf(buf, "%x\n", ipath_layer_get_pcirev(dev->dd));
 }
 
 static ssize_t show_hca(struct class_device *cdev, char *buf)
index 4f8d59300e9b0c25839be4354be95e2cc12547e0..2df684727dc1bad27e3f8a369e41e5ad42ba2a04 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -148,6 +149,7 @@ struct ipath_mcast {
        struct list_head qp_list;
        wait_queue_head_t wait;
        atomic_t refcount;
+       int n_attached;
 };
 
 /* Memory region */
@@ -305,32 +307,34 @@ struct ipath_qp {
        u32 s_next_psn;         /* PSN for next request */
        u32 s_last_psn;         /* last response PSN processed */
        u32 s_psn;              /* current packet sequence number */
+       u32 s_ack_psn;          /* PSN for RDMA_READ */
        u32 s_rnr_timeout;      /* number of milliseconds for RNR timeout */
-       u32 s_ack_psn;          /* PSN for next ACK or RDMA_READ */
-       u64 s_ack_atomic;       /* data for atomic ACK */
+       u32 r_ack_psn;          /* PSN for next ACK or atomic ACK */
        u64 r_wr_id;            /* ID for current receive WQE */
        u64 r_atomic_data;      /* data for last atomic op */
        u32 r_atomic_psn;       /* PSN of last atomic op */
        u32 r_len;              /* total length of r_sge */
        u32 r_rcv_len;          /* receive data len processed */
        u32 r_psn;              /* expected rcv packet sequence number */
+       u32 r_msn;              /* message sequence number */
        u8 state;               /* QP state */
        u8 s_state;             /* opcode of last packet sent */
        u8 s_ack_state;         /* opcode of packet to ACK */
        u8 s_nak_state;         /* non-zero if NAK is pending */
        u8 r_state;             /* opcode of last packet received */
+       u8 r_ack_state;         /* opcode of packet to ACK */
+       u8 r_nak_state;         /* non-zero if NAK is pending */
+       u8 r_min_rnr_timer;     /* retry timeout value for RNR NAKs */
        u8 r_reuse_sge;         /* for UC receive errors */
        u8 r_sge_inx;           /* current index into sg_list */
-       u8 s_max_sge;           /* size of s_wq->sg_list */
        u8 qp_access_flags;
+       u8 s_max_sge;           /* size of s_wq->sg_list */
        u8 s_retry_cnt;         /* number of times to retry */
        u8 s_rnr_retry_cnt;
-       u8 s_min_rnr_timer;
        u8 s_retry;             /* requester retry counter */
        u8 s_rnr_retry;         /* requester RNR retry counter */
        u8 s_pkey_index;        /* PKEY index to use */
        enum ib_mtu path_mtu;
-       atomic_t msn;           /* message sequence number */
        u32 remote_qpn;
        u32 qkey;               /* QKEY for this QP (for UD or RD) */
        u32 s_size;             /* send work queue size */
@@ -431,6 +435,11 @@ struct ipath_ibdev {
        __be64 sys_image_guid;  /* in network order */
        __be64 gid_prefix;      /* in network order */
        __be64 mkey;
+       u32 n_pds_allocated;    /* number of PDs allocated for device */
+       u32 n_ahs_allocated;    /* number of AHs allocated for device */
+       u32 n_cqs_allocated;    /* number of CQs allocated for device */
+       u32 n_srqs_allocated;   /* number of SRQs allocated for device */
+       u32 n_mcast_grps_allocated; /* number of mcast groups allocated */
        u64 ipath_sword;        /* total dwords sent (sample result) */
        u64 ipath_rword;        /* total dwords received (sample result) */
        u64 ipath_spkts;        /* total packets sent (sample result) */
@@ -442,17 +451,19 @@ struct ipath_ibdev {
        u64 n_unicast_rcv;      /* total unicast packets received */
        u64 n_multicast_xmit;   /* total multicast packets sent */
        u64 n_multicast_rcv;    /* total multicast packets received */
-       u64 n_symbol_error_counter;     /* starting count for PMA */
-       u64 n_link_error_recovery_counter;      /* starting count for PMA */
-       u64 n_link_downed_counter;      /* starting count for PMA */
-       u64 n_port_rcv_errors;  /* starting count for PMA */
-       u64 n_port_rcv_remphys_errors;  /* starting count for PMA */
-       u64 n_port_xmit_discards;       /* starting count for PMA */
-       u64 n_port_xmit_data;   /* starting count for PMA */
-       u64 n_port_rcv_data;    /* starting count for PMA */
-       u64 n_port_xmit_packets;        /* starting count for PMA */
-       u64 n_port_rcv_packets; /* starting count for PMA */
-       u32 n_pkey_violations;  /* starting count for PMA */
+       u64 z_symbol_error_counter;             /* starting count for PMA */
+       u64 z_link_error_recovery_counter;      /* starting count for PMA */
+       u64 z_link_downed_counter;              /* starting count for PMA */
+       u64 z_port_rcv_errors;                  /* starting count for PMA */
+       u64 z_port_rcv_remphys_errors;          /* starting count for PMA */
+       u64 z_port_xmit_discards;               /* starting count for PMA */
+       u64 z_port_xmit_data;                   /* starting count for PMA */
+       u64 z_port_rcv_data;                    /* starting count for PMA */
+       u64 z_port_xmit_packets;                /* starting count for PMA */
+       u64 z_port_rcv_packets;                 /* starting count for PMA */
+       u32 z_pkey_violations;                  /* starting count for PMA */
+       u32 z_local_link_integrity_errors;      /* starting count for PMA */
+       u32 z_excessive_buffer_overrun_errors;  /* starting count for PMA */
        u32 n_rc_resends;
        u32 n_rc_acks;
        u32 n_rc_qacks;
@@ -462,6 +473,7 @@ struct ipath_ibdev {
        u32 n_other_naks;
        u32 n_timeouts;
        u32 n_pkt_drops;
+       u32 n_vl15_dropped;
        u32 n_wqe_errs;
        u32 n_rdma_dup_busy;
        u32 n_piowait;
@@ -580,10 +592,6 @@ void ipath_sqerror_qp(struct ipath_qp *qp, struct ib_wc *wc);
 
 void ipath_get_credit(struct ipath_qp *qp, u32 aeth);
 
-void ipath_do_rc_send(unsigned long data);
-
-void ipath_do_uc_send(unsigned long data);
-
 void ipath_cq_enter(struct ipath_cq *cq, struct ib_wc *entry, int sig);
 
 int ipath_rkey_ok(struct ipath_ibdev *dev, struct ipath_sge_state *ss,
@@ -596,7 +604,7 @@ void ipath_copy_sge(struct ipath_sge_state *ss, void *data, u32 length);
 
 void ipath_skip_sge(struct ipath_sge_state *ss, u32 length);
 
-int ipath_post_rc_send(struct ipath_qp *qp, struct ib_send_wr *wr);
+int ipath_post_ruc_send(struct ipath_qp *qp, struct ib_send_wr *wr);
 
 void ipath_uc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
                  int has_grh, void *data, u32 tlen, struct ipath_qp *qp);
@@ -678,7 +686,19 @@ void ipath_insert_rnr_queue(struct ipath_qp *qp);
 
 int ipath_get_rwqe(struct ipath_qp *qp, int wr_id_only);
 
-void ipath_ruc_loopback(struct ipath_qp *sqp, struct ib_wc *wc);
+u32 ipath_make_grh(struct ipath_ibdev *dev, struct ib_grh *hdr,
+                  struct ib_global_route *grh, u32 hwords, u32 nwords);
+
+void ipath_do_ruc_send(unsigned long data);
+
+u32 ipath_make_rc_ack(struct ipath_qp *qp, struct ipath_other_headers *ohdr,
+                     u32 pmtu);
+
+int ipath_make_rc_req(struct ipath_qp *qp, struct ipath_other_headers *ohdr,
+                     u32 pmtu, u32 *bth0p, u32 *bth2p);
+
+int ipath_make_uc_req(struct ipath_qp *qp, struct ipath_other_headers *ohdr,
+                     u32 pmtu, u32 *bth0p, u32 *bth2p);
 
 extern const enum ib_wc_opcode ib_ipath_wc_opcode[];
 
@@ -688,6 +708,24 @@ extern const int ib_ipath_state_ops[];
 
 extern unsigned int ib_ipath_lkey_table_size;
 
+extern unsigned int ib_ipath_max_cqes;
+
+extern unsigned int ib_ipath_max_cqs;
+
+extern unsigned int ib_ipath_max_qp_wrs;
+
+extern unsigned int ib_ipath_max_sges;
+
+extern unsigned int ib_ipath_max_mcast_grps;
+
+extern unsigned int ib_ipath_max_mcast_qp_attached;
+
+extern unsigned int ib_ipath_max_srqs;
+
+extern unsigned int ib_ipath_max_srq_sges;
+
+extern unsigned int ib_ipath_max_srq_wrs;
+
 extern const u32 ib_ipath_rnr_table[];
 
 #endif                         /* IPATH_VERBS_H */
index 10b31d2c4f20977b82988cdab304b250b317abf6..ee0e1d96d723441c1d6767354d15d1a21373f7fe 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -92,6 +93,7 @@ static struct ipath_mcast *ipath_mcast_alloc(union ib_gid *mgid)
        INIT_LIST_HEAD(&mcast->qp_list);
        init_waitqueue_head(&mcast->wait);
        atomic_set(&mcast->refcount, 0);
+       mcast->n_attached = 0;
 
 bail:
        return mcast;
@@ -157,7 +159,8 @@ bail:
  * the table but the QP was added.  Return ESRCH if the QP was already
  * attached and neither structure was added.
  */
-static int ipath_mcast_add(struct ipath_mcast *mcast,
+static int ipath_mcast_add(struct ipath_ibdev *dev,
+                          struct ipath_mcast *mcast,
                           struct ipath_mcast_qp *mqp)
 {
        struct rb_node **n = &mcast_tree.rb_node;
@@ -188,34 +191,47 @@ static int ipath_mcast_add(struct ipath_mcast *mcast,
                /* Search the QP list to see if this is already there. */
                list_for_each_entry_rcu(p, &tmcast->qp_list, list) {
                        if (p->qp == mqp->qp) {
-                               spin_unlock_irqrestore(&mcast_lock, flags);
                                ret = ESRCH;
                                goto bail;
                        }
                }
+               if (tmcast->n_attached == ib_ipath_max_mcast_qp_attached) {
+                       ret = ENOMEM;
+                       goto bail;
+               }
+
+               tmcast->n_attached++;
+
                list_add_tail_rcu(&mqp->list, &tmcast->qp_list);
-               spin_unlock_irqrestore(&mcast_lock, flags);
                ret = EEXIST;
                goto bail;
        }
 
+       if (dev->n_mcast_grps_allocated == ib_ipath_max_mcast_grps) {
+               ret = ENOMEM;
+               goto bail;
+       }
+
+       dev->n_mcast_grps_allocated++;
+
        list_add_tail_rcu(&mqp->list, &mcast->qp_list);
 
        atomic_inc(&mcast->refcount);
        rb_link_node(&mcast->rb_node, pn, n);
        rb_insert_color(&mcast->rb_node, &mcast_tree);
 
-       spin_unlock_irqrestore(&mcast_lock, flags);
-
        ret = 0;
 
 bail:
+       spin_unlock_irqrestore(&mcast_lock, flags);
+
        return ret;
 }
 
 int ipath_multicast_attach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
 {
        struct ipath_qp *qp = to_iqp(ibqp);
+       struct ipath_ibdev *dev = to_idev(ibqp->device);
        struct ipath_mcast *mcast;
        struct ipath_mcast_qp *mqp;
        int ret;
@@ -235,7 +251,7 @@ int ipath_multicast_attach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
                ret = -ENOMEM;
                goto bail;
        }
-       switch (ipath_mcast_add(mcast, mqp)) {
+       switch (ipath_mcast_add(dev, mcast, mqp)) {
        case ESRCH:
                /* Neither was used: can't attach the same QP twice. */
                ipath_mcast_qp_free(mqp);
@@ -245,6 +261,12 @@ int ipath_multicast_attach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
        case EEXIST:            /* The mcast wasn't used */
                ipath_mcast_free(mcast);
                break;
+       case ENOMEM:
+               /* Exceeded the maximum number of mcast groups. */
+               ipath_mcast_qp_free(mqp);
+               ipath_mcast_free(mcast);
+               ret = -ENOMEM;
+               goto bail;
        default:
                break;
        }
@@ -258,6 +280,7 @@ bail:
 int ipath_multicast_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
 {
        struct ipath_qp *qp = to_iqp(ibqp);
+       struct ipath_ibdev *dev = to_idev(ibqp->device);
        struct ipath_mcast *mcast = NULL;
        struct ipath_mcast_qp *p, *tmp;
        struct rb_node *n;
@@ -272,7 +295,7 @@ int ipath_multicast_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
        while (1) {
                if (n == NULL) {
                        spin_unlock_irqrestore(&mcast_lock, flags);
-                       ret = 0;
+                       ret = -EINVAL;
                        goto bail;
                }
 
@@ -296,6 +319,7 @@ int ipath_multicast_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
                 * link until we are sure there are no list walkers.
                 */
                list_del_rcu(&p->list);
+               mcast->n_attached--;
 
                /* If this was the last attached QP, remove the GID too. */
                if (list_empty(&mcast->qp_list)) {
@@ -319,6 +343,7 @@ int ipath_multicast_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
                atomic_dec(&mcast->refcount);
                wait_event(mcast->wait, !atomic_read(&mcast->refcount));
                ipath_mcast_free(mcast);
+               dev->n_mcast_grps_allocated--;
        }
 
        ret = 0;
index adc5322f15c17e9b273e6768d548ef5e198aae78..f8f9e2e8cbdd6217642076ff7842ed0b9036427b 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
diff --git a/drivers/infiniband/hw/ipath/ips_common.h b/drivers/infiniband/hw/ipath/ips_common.h
deleted file mode 100644 (file)
index ab7cbbb..0000000
+++ /dev/null
@@ -1,263 +0,0 @@
-#ifndef IPS_COMMON_H
-#define IPS_COMMON_H
-/*
- * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
- *
- * This software is available to you under a choice of one of two
- * licenses.  You may choose to be licensed under the terms of the GNU
- * General Public License (GPL) Version 2, available from the file
- * COPYING in the main directory of this source tree, or the
- * OpenIB.org BSD license below:
- *
- *     Redistribution and use in source and binary forms, with or
- *     without modification, are permitted provided that the following
- *     conditions are met:
- *
- *      - Redistributions of source code must retain the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer.
- *
- *      - Redistributions in binary form must reproduce the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer in the documentation and/or other materials
- *        provided with the distribution.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include "ipath_common.h"
-
-struct ipath_header {
-       /*
-        * Version - 4 bits, Port - 4 bits, TID - 10 bits and Offset -
-        * 14 bits before ECO change ~28 Dec 03.  After that, Vers 4,
-        * Port 3, TID 11, offset 14.
-        */
-       __le32 ver_port_tid_offset;
-       __le16 chksum;
-       __le16 pkt_flags;
-};
-
-struct ips_message_header {
-       __be16 lrh[4];
-       __be32 bth[3];
-       /* fields below this point are in host byte order */
-       struct ipath_header iph;
-       __u8 sub_opcode;
-       __u8 flags;
-       __u16 src_rank;
-       /* 24 bits. The upper 8 bit is available for other use */
-       union {
-               struct {
-                       unsigned ack_seq_num:24;
-                       unsigned port:4;
-                       unsigned unused:4;
-               };
-               __u32 ack_seq_num_org;
-       };
-       __u8 expected_tid_session_id;
-       __u8 tinylen;           /* to aid MPI */
-       union {
-           __u16 tag;          /* to aid MPI */
-           __u16 mqhdr;        /* for PSM MQ */
-       };
-       union {
-               __u32 mpi[4];   /* to aid MPI */
-               __u32 data[4];
-               __u64 mq[2];    /* for PSM MQ */
-               struct {
-                       __u16 mtu;
-                       __u8 major_ver;
-                       __u8 minor_ver;
-                       __u32 not_used; //free
-                       __u32 run_id;
-                       __u32 client_ver;
-               };
-       };
-};
-
-struct ether_header {
-       __be16 lrh[4];
-       __be32 bth[3];
-       struct ipath_header iph;
-       __u8 sub_opcode;
-       __u8 cmd;
-       __be16 lid;
-       __u16 mac[3];
-       __u8 frag_num;
-       __u8 seq_num;
-       __le32 len;
-       /* MUST be of word size due to PIO write requirements */
-       __le32 csum;
-       __le16 csum_offset;
-       __le16 flags;
-       __u16 first_2_bytes;
-       __u8 unused[2];         /* currently unused */
-};
-
-/*
- * The PIO buffer used for sending infinipath messages must only be written
- * in 32-bit words, all the data must be written, and no writes can occur
- * after the last word is written (which transfers "ownership" of the buffer
- * to the chip and triggers the message to be sent).
- * Since the Linux sk_buff structure can be recursive, non-aligned, and
- * any number of bytes in each segment, we use the following structure
- * to keep information about the overall state of the copy operation.
- * This is used to save the information needed to store the checksum
- * in the right place before sending the last word to the hardware and
- * to buffer the last 0-3 bytes of non-word sized segments.
- */
-struct copy_data_s {
-       struct ether_header *hdr;
-       /* addr of PIO buf to write csum to */
-       __u32 __iomem *csum_pio;
-       __u32 __iomem *to;      /* addr of PIO buf to write data to */
-       __u32 device;           /* which device to allocate PIO bufs from */
-       __s32 error;            /* set if there is an error. */
-       __s32 extra;            /* amount of data saved in u.buf below */
-       __u32 len;              /* total length to send in bytes */
-       __u32 flen;             /* frament length in words */
-       __u32 csum;             /* partial IP checksum */
-       __u32 pos;              /* position for partial checksum */
-       __u32 offset;           /* offset to where data currently starts */
-       __s32 checksum_calc;    /* set to 1 when csum has been calculated */
-       struct sk_buff *skb;
-       union {
-               __u32 w;
-               __u8 buf[4];
-       } u;
-};
-
-/* IB - LRH header consts */
-#define IPS_LRH_GRH 0x0003     /* 1. word of IB LRH - next header: GRH */
-#define IPS_LRH_BTH 0x0002     /* 1. word of IB LRH - next header: BTH */
-
-#define IPS_OFFSET  0
-
-/*
- * defines the cut-off point between the header queue and eager/expected
- * TID queue
- */
-#define NUM_OF_EXTRA_WORDS_IN_HEADER_QUEUE \
-       ((sizeof(struct ips_message_header) - \
-         offsetof(struct ips_message_header, iph)) >> 2)
-
-/* OpCodes  */
-#define OPCODE_IPS 0xC0
-#define OPCODE_ITH4X 0xC1
-
-/* OpCode 30 is use by stand-alone test programs  */
-#define OPCODE_RAW_DATA 0xDE
-/* last OpCode (31) is reserved for test  */
-#define OPCODE_TEST 0xDF
-
-/* sub OpCodes - ips  */
-#define OPCODE_SEQ_DATA 0x01
-#define OPCODE_SEQ_CTRL 0x02
-
-#define OPCODE_SEQ_MQ_DATA 0x03
-#define OPCODE_SEQ_MQ_CTRL 0x04
-
-#define OPCODE_ACK 0x10
-#define OPCODE_NAK 0x11
-
-#define OPCODE_ERR_CHK 0x20
-#define OPCODE_ERR_CHK_PLS 0x21
-
-#define OPCODE_STARTUP 0x30
-#define OPCODE_STARTUP_ACK 0x31
-#define OPCODE_STARTUP_NAK 0x32
-
-#define OPCODE_STARTUP_EXT 0x34
-#define OPCODE_STARTUP_ACK_EXT 0x35
-#define OPCODE_STARTUP_NAK_EXT 0x36
-
-#define OPCODE_TIDS_RELEASE 0x40
-#define OPCODE_TIDS_RELEASE_CONFIRM 0x41
-
-#define OPCODE_CLOSE 0x50
-#define OPCODE_CLOSE_ACK 0x51
-/*
- * like OPCODE_CLOSE, but no complaint if other side has already closed.
- * Used when doing abort(), MPI_Abort(), etc.
- */
-#define OPCODE_ABORT 0x52
-
-/* sub OpCodes - ith4x  */
-#define OPCODE_ENCAP 0x81
-#define OPCODE_LID_ARP 0x82
-
-/* Receive Header Queue: receive type (from infinipath) */
-#define RCVHQ_RCV_TYPE_EXPECTED  0
-#define RCVHQ_RCV_TYPE_EAGER     1
-#define RCVHQ_RCV_TYPE_NON_KD    2
-#define RCVHQ_RCV_TYPE_ERROR     3
-
-/* misc. */
-#define SIZE_OF_CRC 1
-
-#define EAGER_TID_ID INFINIPATH_I_TID_MASK
-
-#define IPS_DEFAULT_P_KEY 0xFFFF
-
-#define IPS_PERMISSIVE_LID 0xFFFF
-#define IPS_MULTICAST_LID_BASE 0xC000
-
-#define IPS_AETH_CREDIT_SHIFT 24
-#define IPS_AETH_CREDIT_MASK 0x1F
-#define IPS_AETH_CREDIT_INVAL 0x1F
-
-#define IPS_PSN_MASK 0xFFFFFF
-#define IPS_MSN_MASK 0xFFFFFF
-#define IPS_QPN_MASK 0xFFFFFF
-#define IPS_MULTICAST_QPN 0xFFFFFF
-
-/* functions for extracting fields from rcvhdrq entries */
-static inline __u32 ips_get_hdr_err_flags(const __le32 * rbuf)
-{
-       return __le32_to_cpu(rbuf[1]);
-}
-
-static inline __u32 ips_get_index(const __le32 * rbuf)
-{
-       return (__le32_to_cpu(rbuf[0]) >> INFINIPATH_RHF_EGRINDEX_SHIFT)
-           & INFINIPATH_RHF_EGRINDEX_MASK;
-}
-
-static inline __u32 ips_get_rcv_type(const __le32 * rbuf)
-{
-       return (__le32_to_cpu(rbuf[0]) >> INFINIPATH_RHF_RCVTYPE_SHIFT)
-           & INFINIPATH_RHF_RCVTYPE_MASK;
-}
-
-static inline __u32 ips_get_length_in_bytes(const __le32 * rbuf)
-{
-       return ((__le32_to_cpu(rbuf[0]) >> INFINIPATH_RHF_LENGTH_SHIFT)
-               & INFINIPATH_RHF_LENGTH_MASK) << 2;
-}
-
-static inline void *ips_get_first_protocol_header(const __u32 * rbuf)
-{
-       return (void *)&rbuf[2];
-}
-
-static inline struct ips_message_header *ips_get_ips_header(const __u32 *
-                                                           rbuf)
-{
-       return (struct ips_message_header *)&rbuf[2];
-}
-
-static inline __u32 ips_get_ipath_ver(__le32 hdrword)
-{
-       return (__le32_to_cpu(hdrword) >> INFINIPATH_I_VERS_SHIFT)
-           & INFINIPATH_I_VERS_MASK;
-}
-
-#endif                         /* IPS_COMMON_H */
index 40d693cf3f94c3cf94a00b69fcc87916a1e2358a..6186676f2a16fe01d627c67c13f9e97eedf35d5d 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
  * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
index d536217e700ea46f8acec32f2830fbd965b25af2..a29b1b6d82b1758c2d1c5328057059e27e6e1631 100644 (file)
@@ -900,7 +900,7 @@ int __devinit mthca_init_eq_table(struct mthca_dev *dev)
                                  mthca_is_memfree(dev) ?
                                  mthca_arbel_interrupt :
                                  mthca_tavor_interrupt,
-                                 SA_SHIRQ, DRV_NAME, dev);
+                                 IRQF_SHARED, DRV_NAME, dev);
                if (err)
                        goto err_out_cmd;
                dev->eq_table.have_irq = 1;
index 465fd220569c651a1cb7499daa1f970b5241811a..557cde3a4563cc26e14d54fb6d0cc75545a48ead 100644 (file)
@@ -34,7 +34,6 @@
  * $Id: mthca_main.c 1396 2004-12-28 04:10:27Z roland $
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/errno.h>
index 16c387d8170cc599b8b2b16aa8d0275672bbe920..490fc783bb0c899709488f7f83fbeaf261b36a0c 100644 (file)
@@ -224,7 +224,7 @@ static void *get_send_wqe(struct mthca_qp *qp, int n)
 
 static void mthca_wq_init(struct mthca_wq *wq)
 {
-       spin_lock_init(&wq->lock);
+       /* mthca_alloc_qp_common() initializes the locks */
        wq->next_ind  = 0;
        wq->last_comp = wq->max - 1;
        wq->head      = 0;
@@ -1114,6 +1114,9 @@ static int mthca_alloc_qp_common(struct mthca_dev *dev,
        qp->sq_policy    = send_policy;
        mthca_wq_init(&qp->sq);
        mthca_wq_init(&qp->rq);
+       /* these are initialized separately so lockdep can tell them apart */
+       spin_lock_init(&qp->sq.lock);
+       spin_lock_init(&qp->rq.lock);
 
        ret = mthca_map_memfree(dev, qp);
        if (ret)
index f4fddd5327f534039bd0de8b6e0c5cce91ea4c3d..91934f2d9dbafeedb0e8cba7a180957ec4baa885 100644 (file)
@@ -32,7 +32,6 @@
  * $Id: mthca_reset.c 1349 2004-12-16 21:09:43Z roland $
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/errno.h>
 #include <linux/pci.h>
index 491d2afaf5b499cc8089cd9f81d25a49d6001f1e..3f89f5e190367ce6d82f6930d2372bd94bb8955c 100644 (file)
@@ -42,7 +42,6 @@
 #include <linux/netdevice.h>
 #include <linux/workqueue.h>
 #include <linux/pci.h>
-#include <linux/config.h>
 #include <linux/kref.h>
 #include <linux/if_infiniband.h>
 #include <linux/mutex.h>
index 4c3f2de2a06ea8f88dcd5920bf1d7bef1c6ca6c4..34b0da5cfa0a73a6a40cef09f69b6bff6679ad59 100644 (file)
@@ -54,7 +54,6 @@
 #include <linux/blkdev.h>
 #include <linux/init.h>
 #include <linux/ioctl.h>
-#include <linux/devfs_fs_kernel.h>
 #include <linux/cdev.h>
 #include <linux/in.h>
 #include <linux/net.h>
@@ -438,159 +437,50 @@ iscsi_iser_session_create(struct iscsi_transport *iscsit,
 }
 
 static int
-iscsi_iser_conn_set_param(struct iscsi_cls_conn *cls_conn,
-                         enum iscsi_param param, uint32_t value)
+iscsi_iser_set_param(struct iscsi_cls_conn *cls_conn,
+                    enum iscsi_param param, char *buf, int buflen)
 {
-       struct iscsi_conn *conn = cls_conn->dd_data;
-       struct iscsi_session *session = conn->session;
-
-       spin_lock_bh(&session->lock);
-       if (conn->c_stage != ISCSI_CONN_INITIAL_STAGE &&
-           conn->stop_stage != STOP_CONN_RECOVER) {
-               printk(KERN_ERR "iscsi_iser: can not change parameter [%d]\n",
-                      param);
-               spin_unlock_bh(&session->lock);
-               return 0;
-       }
-       spin_unlock_bh(&session->lock);
+       int value;
 
        switch (param) {
        case ISCSI_PARAM_MAX_RECV_DLENGTH:
                /* TBD */
                break;
-       case ISCSI_PARAM_MAX_XMIT_DLENGTH:
-               conn->max_xmit_dlength =  value;
-               break;
        case ISCSI_PARAM_HDRDGST_EN:
+               sscanf(buf, "%d", &value);
                if (value) {
                        printk(KERN_ERR "DataDigest wasn't negotiated to None");
                        return -EPROTO;
                }
                break;
        case ISCSI_PARAM_DATADGST_EN:
+               sscanf(buf, "%d", &value);
                if (value) {
                        printk(KERN_ERR "DataDigest wasn't negotiated to None");
                        return -EPROTO;
                }
                break;
-       case ISCSI_PARAM_INITIAL_R2T_EN:
-               session->initial_r2t_en = value;
-               break;
-       case ISCSI_PARAM_IMM_DATA_EN:
-               session->imm_data_en = value;
-               break;
-       case ISCSI_PARAM_FIRST_BURST:
-               session->first_burst = value;
-               break;
-       case ISCSI_PARAM_MAX_BURST:
-               session->max_burst = value;
-               break;
-       case ISCSI_PARAM_PDU_INORDER_EN:
-               session->pdu_inorder_en = value;
-               break;
-       case ISCSI_PARAM_DATASEQ_INORDER_EN:
-               session->dataseq_inorder_en = value;
-               break;
-       case ISCSI_PARAM_ERL:
-               session->erl = value;
-               break;
        case ISCSI_PARAM_IFMARKER_EN:
+               sscanf(buf, "%d", &value);
                if (value) {
                        printk(KERN_ERR "IFMarker wasn't negotiated to No");
                        return -EPROTO;
                }
                break;
        case ISCSI_PARAM_OFMARKER_EN:
+               sscanf(buf, "%d", &value);
                if (value) {
                        printk(KERN_ERR "OFMarker wasn't negotiated to No");
                        return -EPROTO;
                }
                break;
        default:
-               break;
-       }
-
-       return 0;
-}
-
-static int
-iscsi_iser_session_get_param(struct iscsi_cls_session *cls_session,
-                            enum iscsi_param param, uint32_t *value)
-{
-       struct Scsi_Host *shost = iscsi_session_to_shost(cls_session);
-       struct iscsi_session *session = iscsi_hostdata(shost->hostdata);
-
-       switch (param) {
-       case ISCSI_PARAM_INITIAL_R2T_EN:
-               *value = session->initial_r2t_en;
-               break;
-       case ISCSI_PARAM_MAX_R2T:
-               *value = session->max_r2t;
-               break;
-       case ISCSI_PARAM_IMM_DATA_EN:
-               *value = session->imm_data_en;
-               break;
-       case ISCSI_PARAM_FIRST_BURST:
-               *value = session->first_burst;
-               break;
-       case ISCSI_PARAM_MAX_BURST:
-               *value = session->max_burst;
-               break;
-       case ISCSI_PARAM_PDU_INORDER_EN:
-               *value = session->pdu_inorder_en;
-               break;
-       case ISCSI_PARAM_DATASEQ_INORDER_EN:
-               *value = session->dataseq_inorder_en;
-               break;
-       case ISCSI_PARAM_ERL:
-               *value = session->erl;
-               break;
-       case ISCSI_PARAM_IFMARKER_EN:
-               *value = 0;
-               break;
-       case ISCSI_PARAM_OFMARKER_EN:
-               *value = 0;
-               break;
-       default:
-               return ISCSI_ERR_PARAM_NOT_FOUND;
-       }
-
-       return 0;
-}
-
-static int
-iscsi_iser_conn_get_param(struct iscsi_cls_conn *cls_conn,
-                         enum iscsi_param param, uint32_t *value)
-{
-       struct iscsi_conn *conn = cls_conn->dd_data;
-
-       switch(param) {
-       case ISCSI_PARAM_MAX_RECV_DLENGTH:
-               *value = conn->max_recv_dlength;
-               break;
-       case ISCSI_PARAM_MAX_XMIT_DLENGTH:
-               *value = conn->max_xmit_dlength;
-               break;
-       case ISCSI_PARAM_HDRDGST_EN:
-               *value = 0;
-               break;
-       case ISCSI_PARAM_DATADGST_EN:
-               *value = 0;
-               break;
-       /*case ISCSI_PARAM_TARGET_RECV_DLENGTH:
-               *value = conn->target_recv_dlength;
-               break;
-       case ISCSI_PARAM_INITIATOR_RECV_DLENGTH:
-               *value = conn->initiator_recv_dlength;
-               break;*/
-       default:
-               return ISCSI_ERR_PARAM_NOT_FOUND;
+               return iscsi_set_param(cls_conn, param, buf, buflen);
        }
 
        return 0;
 }
 
-
 static void
 iscsi_iser_conn_get_stats(struct iscsi_cls_conn *cls_conn, struct iscsi_stats *stats)
 {
@@ -702,7 +592,12 @@ static struct iscsi_transport iscsi_iser_transport = {
                                  ISCSI_FIRST_BURST |
                                  ISCSI_MAX_BURST |
                                  ISCSI_PDU_INORDER_EN |
-                                 ISCSI_DATASEQ_INORDER_EN,
+                                 ISCSI_DATASEQ_INORDER_EN |
+                                 ISCSI_EXP_STATSN |
+                                 ISCSI_PERSISTENT_PORT |
+                                 ISCSI_PERSISTENT_ADDRESS |
+                                 ISCSI_TARGET_NAME |
+                                 ISCSI_TPGT,
        .host_template          = &iscsi_iser_sht,
        .conndata_size          = sizeof(struct iscsi_conn),
        .max_lun                = ISCSI_ISER_MAX_LUN,
@@ -714,9 +609,9 @@ static struct iscsi_transport iscsi_iser_transport = {
        .create_conn            = iscsi_iser_conn_create,
        .bind_conn              = iscsi_iser_conn_bind,
        .destroy_conn           = iscsi_iser_conn_destroy,
-       .set_param              = iscsi_iser_conn_set_param,
-       .get_conn_param         = iscsi_iser_conn_get_param,
-       .get_session_param      = iscsi_iser_session_get_param,
+       .set_param              = iscsi_iser_set_param,
+       .get_conn_param         = iscsi_conn_get_param,
+       .get_session_param      = iscsi_session_get_param,
        .start_conn             = iscsi_iser_conn_start,
        .stop_conn              = iscsi_conn_stop,
        /* these are called as part of conn recovery */
index 462f8d300aae5629719c58a983627fed065879a5..9793ac36d17f22bd34861e14c7af14ea48b06283 100644 (file)
@@ -32,7 +32,6 @@
 
 #include <linux/module.h>
 #include <linux/ioport.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/gameport.h>
 #include <linux/slab.h>
index 3e2d28f263e9ad56c7b2cb7f3c4d697b28e849db..f68dbe6f7f04634ca7bf63688555de65be85f7f0 100644 (file)
@@ -33,7 +33,6 @@
 
 #include <linux/module.h>
 #include <linux/ioport.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/gameport.h>
index 01dc0b195d599277a5cba6bd340f2c7259765ffe..e9a02db36eccc3b0d431f1276f94fe090d4f2923 100644 (file)
@@ -28,7 +28,6 @@
  * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
  */
 
-#include <linux/config.h>
 #include <linux/delay.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
index 668f24535ba0778e23d34c8800f5ffea77d9b6f1..e9924d6f01b33991b975de0272588f6f0691ea7e 100644 (file)
@@ -35,7 +35,6 @@
 #include <linux/spinlock.h>
 #include <linux/usb.h>
 #include <linux/serio.h>
-#include <linux/config.h>
 #include <linux/circ_buf.h>
 #include <linux/mutex.h>
 
index 1f0e720267d75312c0a52eaa44b5e5764eaf53ce..1e03153b9bca99348c11e55e2d85ced8c05ad84b 100644 (file)
@@ -352,7 +352,7 @@ static int __init corgikbd_probe(struct platform_device *pdev)
        for (i = 0; i < CORGI_KEY_SENSE_NUM; i++) {
                pxa_gpio_mode(CORGI_GPIO_KEY_SENSE(i) | GPIO_IN);
                if (request_irq(CORGI_IRQ_GPIO_KEY_SENSE(i), corgikbd_interrupt,
-                               SA_INTERRUPT | SA_TRIGGER_RISING,
+                               IRQF_DISABLED | IRQF_TRIGGER_RISING,
                                "corgikbd", corgikbd))
                        printk(KERN_WARNING "corgikbd: Can't get IRQ: %d!\n", i);
        }
index 33edd030aa758048f6b9ab11bd0463609da4c6ab..d22c7c6242968ad1cc12c2f1b95bf94065ee1466 100644 (file)
@@ -18,7 +18,6 @@
 #include <linux/pci_ids.h>
 #include <linux/ioport.h>
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/input.h>
 #include <linux/init.h>
index 2c510881874ab70e5827bee15619286872542ed4..83906f80ba21c31aa0cc5eb443926b972cdefd37 100644 (file)
@@ -25,7 +25,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/init.h>
index c5d03fb77bcb9a364ca16ea075d469425c671950..e385710233f4fe18bc89eab48c4885fad18cfc40 100644 (file)
@@ -410,7 +410,7 @@ static int __init spitzkbd_probe(struct platform_device *dev)
        for (i = 0; i < SPITZ_KEY_SENSE_NUM; i++) {
                pxa_gpio_mode(spitz_senses[i] | GPIO_IN);
                if (request_irq(IRQ_GPIO(spitz_senses[i]), spitzkbd_interrupt,
-                               SA_INTERRUPT|SA_TRIGGER_RISING,
+                               IRQF_DISABLED|IRQF_TRIGGER_RISING,
                                "Spitzkbd Sense", spitzkbd))
                        printk(KERN_WARNING "spitzkbd: Can't get Sense IRQ: %d!\n", i);
        }
@@ -425,19 +425,19 @@ static int __init spitzkbd_probe(struct platform_device *dev)
        pxa_gpio_mode(SPITZ_GPIO_SWB | GPIO_IN);
 
        request_irq(SPITZ_IRQ_GPIO_SYNC, spitzkbd_interrupt,
-                   SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING,
+                   IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
                    "Spitzkbd Sync", spitzkbd);
        request_irq(SPITZ_IRQ_GPIO_ON_KEY, spitzkbd_interrupt,
-                   SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING,
+                   IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
                    "Spitzkbd PwrOn", spitzkbd);
        request_irq(SPITZ_IRQ_GPIO_SWA, spitzkbd_hinge_isr,
-                   SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING,
+                   IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
                    "Spitzkbd SWA", spitzkbd);
        request_irq(SPITZ_IRQ_GPIO_SWB, spitzkbd_hinge_isr,
-                   SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING,
+                   IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
                    "Spitzkbd SWB", spitzkbd);
        request_irq(SPITZ_IRQ_GPIO_AK_INT, spitzkbd_hinge_isr,
-                   SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING,
+                   IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
                    "Spitzkbd HP", spitzkbd);
 
        printk(KERN_INFO "input: Spitz Keyboard Registered\n");
index 3a6ae85cd69c718407fe7e991181fc711c85fa23..805b636e73d909927d91f6edc977337428b41385 100644 (file)
@@ -113,7 +113,7 @@ static int __devinit ixp4xx_spkr_probe(struct platform_device *dev)
        input_dev->event = ixp4xx_spkr_event;
 
        err = request_irq(IRQ_IXP4XX_TIMER2, &ixp4xx_spkr_interrupt,
-                         SA_INTERRUPT | SA_TIMER, "ixp4xx-beeper", (void *) dev->id);
+                         IRQF_DISABLED | IRQF_TIMER, "ixp4xx-beeper", (void *) dev->id);
        if (err)
                goto err_free_device;
 
index 42c11fbf3c79ff12d405f9f2c13d1ebed9da7901..106c94f33b93ebb86847c4c10cc1897a4d122a39 100644 (file)
@@ -4,7 +4,6 @@
  *  Copyright (c) 2002 Vojtech Pavlik
  *  Copyright (c) 2002, 2006 David S. Miller (davem@davemloft.net)
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
index afc66f56df43b5d5f6a415a81e595c31e07db27a..50f1fed10be404f759a8b138f6a35f6c9e9c38b9 100644 (file)
@@ -36,7 +36,6 @@
 
 #include <linux/module.h>
 #include <linux/moduleparam.h>
-#include <linux/config.h>
 #include <linux/ioport.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
index 09b6ffdb7582b1f143d7172a166d45cfb843022b..872b30bf7aadce2fc8f267048d44dbfc3d06b5db 100644 (file)
@@ -85,7 +85,7 @@ static int __init rpcmouse_init(void)
        rpcmouse_lastx = (short) iomd_readl(IOMD_MOUSEX);
        rpcmouse_lasty = (short) iomd_readl(IOMD_MOUSEY);
 
-       if (request_irq(IRQ_VSYNCPULSE, rpcmouse_irq, SA_SHIRQ, "rpcmouse", rpcmouse_dev)) {
+       if (request_irq(IRQ_VSYNCPULSE, rpcmouse_irq, IRQF_SHARED, "rpcmouse", rpcmouse_dev)) {
                printk(KERN_ERR "rpcmouse: unable to allocate VSYNC interrupt\n");
                input_free_device(rpcmouse_dev);
                return -EBUSY;
index a8974243171793c654a66f8bd1634fbbb734faf9..0023501a5b634fd086837d3e1e9dc49f116414d4 100644 (file)
@@ -33,7 +33,6 @@
 #include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/input.h>
-#include <linux/config.h>
 #include <linux/serio.h>
 #include <linux/init.h>
 
index 7b85bc21ae4a808f49086a517c55661f5b2c50b0..47edcfd022ba840bc4b1d65a4cfc1509216b8de5 100644 (file)
@@ -81,7 +81,6 @@
 #include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/input.h>
-#include <linux/config.h>
 #include <linux/serio.h>
 #include <linux/init.h>
 
index eb721b11ff3772af9f74fac759903f6a1cdf42ce..1f851acab30db2f692ab74886256701409432110 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/moduleparam.h>
 #include <linux/init.h>
 #include <linux/input.h>
-#include <linux/config.h>
 #include <linux/smp_lock.h>
 #include <linux/random.h>
 #include <linux/major.h>
index 526e6070600c8a02a29df0283d55fcae79217b0f..51a519e24b6d07bd146206d47cd1293719dedb48 100644 (file)
@@ -28,7 +28,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/input.h>
 #include <linux/slab.h>
 #include <linux/init.h>
index 1ac739ef2ffa53a41053b5bd02218f9073c33281..bc6e87add093258cc1364736e358fa5c0b6d4903 100644 (file)
@@ -31,7 +31,6 @@
 #include <linux/delay.h>
 #include <linux/module.h>
 #include <linux/ioport.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/serio.h>
index c0b1e4becad3c7b9a76f532589441188da629bce..cde036a92168150a8219a595437efe8c3cd8c0f1 100644 (file)
@@ -22,7 +22,6 @@
  *                 was usable/enabled ?)
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/serio.h>
@@ -371,7 +370,7 @@ static int __init gscps2_probe(struct parisc_device *dev)
        serio->dev.parent       = &dev->dev;
 
        ret = -EBUSY;
-       if (request_irq(dev->irq, gscps2_interrupt, SA_SHIRQ, ps2port->port->name, ps2port))
+       if (request_irq(dev->irq, gscps2_interrupt, IRQF_SHARED, ps2port->port->name, ps2port))
                goto fail_miserably;
 
        if (ps2port->id != GSC_ID_KEYBOARD && ps2port->id != GSC_ID_MOUSE) {
index 9cad197a4e685f8f4ade42abe1bcb28a4100e8bc..54adba2d8ed59edab76a80c5f6c2a3b65765d35f 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _I8042_SPARCIO_H
 #define _I8042_SPARCIO_H
 
-#include <linux/config.h>
 #include <asm/io.h>
 #include <asm/oplib.h>
 #include <asm/prom.h>
@@ -89,7 +88,7 @@ static struct of_device_id sparc_i8042_match[] = {
        },
        {},
 };
-MODULE_DEVICE_TABLE(of, i8042_match);
+MODULE_DEVICE_TABLE(of, sparc_i8042_match);
 
 static struct of_platform_driver sparc_i8042_driver = {
        .name           = "i8042",
index a7d91d5356a55c67035cf8ab5c0b183a1fffa05a..06a3f25657dd29062455027e076cbab0c99165b5 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/moduleparam.h>
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/serio.h>
 #include <linux/err.h>
@@ -329,7 +328,7 @@ static int i8042_open(struct serio *serio)
                        return 0;
 
        if (request_irq(port->irq, i8042_interrupt,
-                       SA_SHIRQ, "i8042", i8042_request_irq_cookie)) {
+                       IRQF_SHARED, "i8042", i8042_request_irq_cookie)) {
                printk(KERN_ERR "i8042.c: Can't get irq %d for %s, unregistering the port.\n", port->irq, port->name);
                goto irq_fail;
        }
@@ -611,7 +610,7 @@ static int __devinit i8042_check_aux(void)
  */
 
        if (request_irq(i8042_ports[I8042_AUX_PORT_NO].irq, i8042_interrupt,
-                       SA_SHIRQ, "i8042", &i8042_check_aux_cookie))
+                       IRQF_SHARED, "i8042", &i8042_check_aux_cookie))
                 return -1;
        free_irq(i8042_ports[I8042_AUX_PORT_NO].irq, &i8042_check_aux_cookie);
 
index cbbf3842da5bb353703757beeeaf8ff6da5967dc..af526ab9ec04205239f5d580aec7ce30323dc9e2 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _I8042_H
 #define _I8042_H
 
-#include <linux/config.h>
 
 /*
  *  Copyright (c) 1999-2002 Vojtech Pavlik
index 79c97f94bcbd5e9bcc31168020c3b7f1f0c32106..61a6f977846f3fe999ebddd5d58a839e8dac5472 100644 (file)
@@ -177,7 +177,7 @@ int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command)
                return -1;
        }
 
-       mutex_lock(&ps2dev->cmd_mutex);
+       mutex_lock_nested(&ps2dev->cmd_mutex, SINGLE_DEPTH_NESTING);
 
        serio_pause_rx(ps2dev->serio);
        ps2dev->flags = command == PS2_CMD_GETID ? PS2_FLAG_WAITID : 0;
index 1e139c5e59de13c3470b3f6134303bb8331663ad..fb727c66525356524ee90a6f7c801a12fb31b4ef 100644 (file)
@@ -107,7 +107,7 @@ static int pcips2_open(struct serio *io)
        outb(PS2_CTRL_ENABLE, ps2if->base);
        pcips2_flush_input(ps2if);
 
-       ret = request_irq(ps2if->dev->irq, pcips2_interrupt, SA_SHIRQ,
+       ret = request_irq(ps2if->dev->irq, pcips2_interrupt, IRQF_SHARED,
                          "pcips2", ps2if);
        if (ret == 0)
                val = PS2_CTRL_ENABLE | PS2_CTRL_RXIRQ;
index 386023c594d74d758bbc592302d2383f84eef80b..66e411badf70c9f2752a2a557d973587aa5c074b 100644 (file)
@@ -773,7 +773,7 @@ static int __devinit ads7846_probe(struct spi_device *spi)
 
        ts->last_msg = m;
 
-       if (request_irq(spi->irq, ads7846_irq, SA_TRIGGER_FALLING,
+       if (request_irq(spi->irq, ads7846_irq, IRQF_TRIGGER_FALLING,
                        spi->dev.driver->name, ts)) {
                dev_dbg(&spi->dev, "irq %d busy?\n", spi->irq);
                err = -EBUSY;
index 5013703db0e6261808872d4ac9cfb05153b1fb7a..9b66271d3ba82feefd4104f59473b4c3f53f95cc 100644 (file)
@@ -17,7 +17,7 @@
 #include <linux/interrupt.h>
 #include <linux/module.h>
 #include <linux/slab.h>
-//#include <asm/irq.h>
+#include <linux/irq.h>
 
 #include <asm/arch/sharpsl.h>
 #include <asm/arch/hardware.h>
@@ -318,7 +318,7 @@ static int __init corgits_probe(struct platform_device *pdev)
        corgi_ssp_ads7846_putget((5u << ADSCTRL_ADR_SH) | ADSCTRL_STS);
        mdelay(5);
 
-       if (request_irq(corgi_ts->irq_gpio, ts_interrupt, SA_INTERRUPT, "ts", corgi_ts)) {
+       if (request_irq(corgi_ts->irq_gpio, ts_interrupt, IRQF_DISABLED, "ts", corgi_ts)) {
                err = -EBUSY;
                goto fail;
        }
index 2de2139f2fed9f9f62ffe9fb2c4c8cebcb1b204d..e2b91001877368a0f491bc0f5f08f981d4341b02 100644 (file)
@@ -399,14 +399,14 @@ static int h3600ts_connect(struct serio *serio, struct serio_driver *drv)
        set_GPIO_IRQ_edge(GPIO_BITSY_NPOWER_BUTTON, GPIO_RISING_EDGE);
 
        if (request_irq(IRQ_GPIO_BITSY_ACTION_BUTTON, action_button_handler,
-                       SA_SHIRQ | SA_INTERRUPT, "h3600_action", &ts->dev)) {
+                       IRQF_SHARED | IRQF_DISABLED, "h3600_action", &ts->dev)) {
                printk(KERN_ERR "h3600ts.c: Could not allocate Action Button IRQ!\n");
                err = -EBUSY;
                goto fail2;
        }
 
        if (request_irq(IRQ_GPIO_BITSY_NPOWER_BUTTON, npower_button_handler,
-                       SA_SHIRQ | SA_INTERRUPT, "h3600_suspend", &ts->dev)) {
+                       IRQF_SHARED | IRQF_DISABLED, "h3600_suspend", &ts->dev)) {
                printk(KERN_ERR "h3600ts.c: Could not allocate Power Button IRQ!\n");
                err = -EBUSY;
                goto fail3;
index 957dd5a1b15ea40bb3be850f891be11df438e500..fa97e0f79e7eaaa7779a0a819ddb875251035712 100644 (file)
@@ -109,7 +109,7 @@ static int __init hp680_ts_init(void)
        input_register_device(hp680_ts_dev);
 
        if (request_irq(HP680_TS_IRQ, hp680_ts_interrupt,
-                       SA_INTERRUPT, MODNAME, 0) < 0) {
+                       IRQF_DISABLED, MODNAME, 0) < 0) {
                printk(KERN_ERR "hp680_touchscreen.c: Can't allocate irq %d\n",
                       HP680_TS_IRQ);
                input_unregister_device(hp680_ts_dev);
index 5f9ecad2ca75e81a0961555db81b14a061d517be..00e3929c62888a906852558cf7935cf9b6c36022 100644 (file)
@@ -48,7 +48,6 @@
 #include <linux/init.h>
 #include <linux/input.h>
 #include <linux/major.h>
-#include <linux/config.h>
 #include <linux/smp_lock.h>
 #include <linux/random.h>
 #include <linux/time.h>
index a518ec531021955eed502742a5cec7d007f88bd8..669f76393b5a5128de344b0cc7b7b1cda40179e2 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
index e7cf6bc286a6fe8428fa1f89e271ac33aaf8aabf..c1b21552fc036ae88fba6f53b975a61d5b56dfdb 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/init.h>
-#include <linux/config.h>
 #include <linux/isdn/capiutil.h>
 
 /* from CAPI2.0 DDK AVM Berlin GmbH */
index 1b37d86d5ee13f4b3cb0dac5714eb4ecf44f043e..399b316111f72db4a292e71f4b52470a0fe1ec05 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/poll.h>
 #include <linux/smp_lock.h>
index 1ca3bfdef51d0c43f0cdd839028cf477856589d1..884bd72c1bf47fa9b5c8656a14f025d3f13eeeb8 100644 (file)
@@ -16,7 +16,6 @@
 #ifndef GIGASET_H
 #define GIGASET_H
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/compiler.h>
 #include <linux/types.h>
index 4d64e5cbcdbf84e4d897aa5f48e201026cf1df5e..a4beeb46c8597dd1da932d4a7a454c6160a65df8 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/skbuff.h>
index 5435a6cfb5e7a3c414626d2220872708d5c60fae..90e2e6643d197abd44f499ed83efb4cc8a7eef0b 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/skbuff.h>
@@ -98,7 +97,7 @@ static int b1pci_probe(struct capicardparams *p, struct pci_dev *pdev)
        b1_reset(card->port);
        b1_getrevision(card);
        
-       retval = request_irq(card->irq, b1_interrupt, SA_SHIRQ, card->name, card);
+       retval = request_irq(card->irq, b1_interrupt, IRQF_SHARED, card->name, card);
        if (retval) {
                printk(KERN_ERR "b1pci: unable to get IRQ %d.\n", card->irq);
                retval = -EBUSY;
@@ -235,7 +234,7 @@ static int b1pciv4_probe(struct capicardparams *p, struct pci_dev *pdev)
        b1dma_reset(card);
        b1_getrevision(card);
 
-       retval = request_irq(card->irq, b1dma_interrupt, SA_SHIRQ, card->name, card);
+       retval = request_irq(card->irq, b1dma_interrupt, IRQF_SHARED, card->name, card);
        if (retval) {
                printk(KERN_ERR "b1pci: unable to get IRQ %d.\n",
                       card->irq);
index ad5025155b4e9bf7999c84e92ffa76ec39213b95..e479c0aef38d84aad3dc821a45b206b596fd479e 100644 (file)
@@ -82,7 +82,7 @@ static int b1pcmcia_add_card(unsigned int port, unsigned irq,
        card->irq = irq;
        card->cardtype = cardtype;
 
-       retval = request_irq(card->irq, b1_interrupt, SA_SHIRQ, card->name, card);
+       retval = request_irq(card->irq, b1_interrupt, IRQF_SHARED, card->name, card);
        if (retval) {
                printk(KERN_ERR "b1pcmcia: unable to get IRQ %d.\n",
                       card->irq);
index f7253b2136ea969b8ff3e88171db35bf7035073d..6c3d5f5f1f4bb40545b562e7689a6067da0bc0ea 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/skbuff.h>
@@ -1173,7 +1172,7 @@ static int c4_add_card(struct capicardparams *p, struct pci_dev *dev,
        }
        c4_reset(card);
 
-       retval = request_irq(card->irq, c4_interrupt, SA_SHIRQ, card->name, card);
+       retval = request_irq(card->irq, c4_interrupt, IRQF_SHARED, card->name, card);
        if (retval) {
                printk(KERN_ERR "c4: unable to get IRQ %d.\n",card->irq);
                retval = -EBUSY;
index 2ceec8e8419f311ee7160ccd8c5ff403a491caca..d1e253c94db4b751f353a58587f4378c0adc4666 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/skbuff.h>
@@ -104,7 +103,7 @@ static int t1pci_add_card(struct capicardparams *p, struct pci_dev *pdev)
        }
        b1dma_reset(card);
 
-       retval = request_irq(card->irq, b1dma_interrupt, SA_SHIRQ, card->name, card);
+       retval = request_irq(card->irq, b1dma_interrupt, IRQF_SHARED, card->name, card);
        if (retval) {
                printk(KERN_ERR "t1pci: unable to get IRQ %d.\n", card->irq);
                retval = -EBUSY;
index 8fe4f3f09353ed206e82169d1022f8dbe7cfec7b..7a74ed35b1bfa721745511bac3dcadb4f55b291e 100644 (file)
@@ -10,7 +10,6 @@
  * of the GNU General Public License, incorporated herein by reference.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <asm/uaccess.h>
index 27204f4b111a7c724407abd3adfa07ab99efacb0..14298b8c835fedc6ea3334a461e481d64735a94a 100644 (file)
@@ -11,7 +11,6 @@
  * of the GNU General Public License, incorporated herein by reference.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
index b163c5909182d40286c0b01ce41a18448efd40a2..77155d9f399bc1d1b46c2323ac4f6bedb48b30db 100644 (file)
@@ -10,7 +10,6 @@
  * of the GNU General Public License, incorporated herein by reference.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
index 6e7d89a31c1d668a3c2f4b02a28a6542c06b38ae..fff0d89c806b47a3a8be7736bd69719045837461 100644 (file)
@@ -10,7 +10,6 @@
  * of the GNU General Public License, incorporated herein by reference.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
index 9dee6a39104c617774454f4da58a968f6a5b57b0..b7dadba13e828c325a358e0630cc1ff24f8c4e77 100644 (file)
@@ -9,7 +9,6 @@
  * of the GNU General Public License, incorporated herein by reference.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
@@ -487,7 +486,7 @@ void __inline__ outpp(void __iomem *addr, word p)
 int diva_os_register_irq(void *context, byte irq, const char *name)
 {
        int result = request_irq(irq, diva_os_irq_wrapper,
-                                SA_INTERRUPT | SA_SHIRQ, name, context);
+                                IRQF_DISABLED | IRQF_SHARED, name, context);
        return (result);
 }
 
index c12efa6f842917340b870f58276ad0ffa5d6b23a..6a4373a4f1e8c7715a274eff93db299fdffa8970 100644 (file)
@@ -10,7 +10,6 @@
  * of the GNU General Public License, incorporated herein by reference.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/poll.h>
index 12b8ff29e97648a41fb85f90ba49605dc326a034..a66836cf756cfcf33df528579795d22ce0dd8bc6 100644 (file)
@@ -18,7 +18,6 @@
 #define DIVA_BUILD "local"
 #endif
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
index d643bb32ad09511dc3d18f87fc630c2a76dd42df..574e252dfa43b884eb1dbb0246c8441044dc6031 100644 (file)
@@ -255,7 +255,7 @@ setup_avm_a1_pcmcia(struct IsdnCard *card)
        cs->BC_Write_Reg = &WriteHSCX;
        cs->BC_Send_Data = &hscx_fill_fifo;
        cs->cardmsg = &AVM_card_msg;
-       cs->irq_flags = SA_SHIRQ;
+       cs->irq_flags = IRQF_SHARED;
        cs->irq_func = &avm_a1p_interrupt;
 
        ISACVersion(cs, "AVM A1 PCMCIA:");
index 4abe5ff10e723d0ce01920538de86bd0ab800843..04f5917bf5a14f7c58328c3fec48edf7a5f93f15 100644 (file)
@@ -12,7 +12,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include "hisax.h"
 #include "isac.h"
@@ -809,7 +808,7 @@ setup_avm_pcipnp(struct IsdnCard *card)
                printk(KERN_WARNING "FritzPCI: No PCI card found\n");
                return(0);
        }
-       cs->irq_flags |= SA_SHIRQ;
+       cs->irq_flags |= IRQF_SHARED;
 #else
        printk(KERN_WARNING "FritzPCI: NO_PCI_BIOS\n");
        return (0);
index dcb308aeb50cccdac293e64aae89a7ee7631fd9d..3cf1f2421789357caf588d3b3a4c882f2f0eacdc 100644 (file)
@@ -11,7 +11,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include "hisax.h"
 #include "isac.h"
@@ -336,7 +335,7 @@ setup_bkm_a4t(struct IsdnCard *card)
        cs->BC_Send_Data = &jade_fill_fifo;
        cs->cardmsg = &BKM_card_msg;
        cs->irq_func = &bkm_interrupt;
-       cs->irq_flags |= SA_SHIRQ;
+       cs->irq_flags |= IRQF_SHARED;
        ISACVersion(cs, "Telekom A4T:");
        /* Jade version */
        JadeVersion(cs, "Telekom A4T:");
index 5f21b82c8c8dcba3699b3ee89d112c3439313357..15681f3e73b8b0b40a950d59e27d912afa69944d 100644 (file)
@@ -11,7 +11,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include "hisax.h"
 #include "isac.h"
@@ -375,7 +374,7 @@ setup_sct_quadro(struct IsdnCard *card)
        pci_ioaddr5 &= PCI_BASE_ADDRESS_IO_MASK;
        /* Take over */
        cs->irq = pci_irq;
-       cs->irq_flags |= SA_SHIRQ;
+       cs->irq_flags |= IRQF_SHARED;
        /* pci_ioaddr1 is unique to all subdevices */
        /* pci_ioaddr2 is for the fourth subdevice only */
        /* pci_ioaddr3 is for the third subdevice only */
index 27332506f9f7911ba105c9a4d9e1b7e1423a022f..5333be5d2c4740fff12a38e52b9bb9f5583e9622 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/types.h>
 #include <linux/stddef.h>
 #include <linux/timer.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include "hisax.h"
 #include <linux/module.h>
index b0ff1cc97d7cb418bac3d3289fb0fe2b879904c4..323a02ef38441b8a1f3c57a77183b6aca258f30e 100644 (file)
@@ -16,7 +16,6 @@
  */
 
 #include <linux/init.h>
-#include <linux/config.h>
 #include "hisax.h"
 #include "isac.h"
 #include "hscx.h"
@@ -1077,7 +1076,7 @@ setup_diva(struct IsdnCard *card)
                        printk(KERN_WARNING "Diva: No IO-Adr for PCI card found\n");
                        return(0);
                }
-               cs->irq_flags |= SA_SHIRQ;
+               cs->irq_flags |= IRQF_SHARED;
 #else
                printk(KERN_WARNING "Diva: cfgreg 0 and NO_PCI_BIOS\n");
                printk(KERN_WARNING "Diva: unable to config DIVA PCI\n");
index f8ca4b3233316de5b31c3c2b6a76af8aa726fda8..3b3e318f6076ebf059ef61291400de58f8b5a15f 100644 (file)
@@ -19,7 +19,6 @@
  */
 
 #include <linux/init.h>
-#include <linux/config.h>
 #include "hisax.h"
 #include "arcofi.h"
 #include "isac.h"
@@ -86,8 +85,8 @@ static const char *ITACVer[] =
  ***                                                                    ***/
 
 /* Config-Register (Read) */
-#define ELSA_TIMER_RUN       0x02      /* Bit 1 des Config-Reg     */
-#define ELSA_TIMER_RUN_PCC8  0x01      /* Bit 0 des Config-Reg  bei PCC */
+#define ELIRQF_TIMER_RUN       0x02    /* Bit 1 des Config-Reg     */
+#define ELIRQF_TIMER_RUN_PCC8  0x01    /* Bit 0 des Config-Reg  bei PCC */
 #define ELSA_IRQ_IDX       0x38        /* Bit 3,4,5 des Config-Reg */
 #define ELSA_IRQ_IDX_PCC8  0x30        /* Bit 4,5 des Config-Reg */
 #define ELSA_IRQ_IDX_PC    0x0c        /* Bit 2,3 des Config-Reg */
@@ -103,7 +102,7 @@ static const char *ITACVer[] =
 #define ELSA_S0_POWER_BAD    0x08      /* Bit 3 S0-Bus Spannung fehlt */
 
 /* Status Flags */
-#define ELSA_TIMER_AKTIV 1
+#define ELIRQF_TIMER_AKTIV 1
 #define ELSA_BAD_PWR     2
 #define ELSA_ASSIGN      4
 
@@ -260,10 +259,10 @@ TimerRun(struct IsdnCardState *cs)
 
        v = bytein(cs->hw.elsa.cfg);
        if ((cs->subtyp == ELSA_QS1000) || (cs->subtyp == ELSA_QS3000))
-               return (0 == (v & ELSA_TIMER_RUN));
+               return (0 == (v & ELIRQF_TIMER_RUN));
        else if (cs->subtyp == ELSA_PCC8)
-               return (v & ELSA_TIMER_RUN_PCC8);
-       return (v & ELSA_TIMER_RUN);
+               return (v & ELIRQF_TIMER_RUN_PCC8);
+       return (v & ELIRQF_TIMER_RUN);
 }
 /*
  * fast interrupt HSCX stuff goes here
@@ -335,7 +334,7 @@ elsa_interrupt(int intno, void *dev_id, struct pt_regs *regs)
        writereg(cs->hw.elsa.ale, cs->hw.elsa.hscx, HSCX_MASK, 0xFF);
        writereg(cs->hw.elsa.ale, cs->hw.elsa.hscx, HSCX_MASK + 0x40, 0xFF);
        writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, ISAC_MASK, 0xFF);
-       if (cs->hw.elsa.status & ELSA_TIMER_AKTIV) {
+       if (cs->hw.elsa.status & ELIRQF_TIMER_AKTIV) {
                if (!TimerRun(cs)) {
                        /* Timer Restart */
                        byteout(cs->hw.elsa.timer, 0);
@@ -686,7 +685,7 @@ Elsa_card_msg(struct IsdnCardState *cs, int mt, void *arg)
                                spin_lock_irqsave(&cs->lock, flags);
                                cs->hw.elsa.counter = 0;
                                cs->hw.elsa.ctrl_reg |= ELSA_ENA_TIMER_INT;
-                               cs->hw.elsa.status |= ELSA_TIMER_AKTIV;
+                               cs->hw.elsa.status |= ELIRQF_TIMER_AKTIV;
                                byteout(cs->hw.elsa.ctrl, cs->hw.elsa.ctrl_reg);
                                byteout(cs->hw.elsa.timer, 0);
                                spin_unlock_irqrestore(&cs->lock, flags);
@@ -694,7 +693,7 @@ Elsa_card_msg(struct IsdnCardState *cs, int mt, void *arg)
                                spin_lock_irqsave(&cs->lock, flags);
                                cs->hw.elsa.ctrl_reg &= ~ELSA_ENA_TIMER_INT;
                                byteout(cs->hw.elsa.ctrl, cs->hw.elsa.ctrl_reg);
-                               cs->hw.elsa.status &= ~ELSA_TIMER_AKTIV;
+                               cs->hw.elsa.status &= ~ELIRQF_TIMER_AKTIV;
                                spin_unlock_irqrestore(&cs->lock, flags);
                                printk(KERN_INFO "Elsa: %d timer tics in 110 msek\n",
                                       cs->hw.elsa.counter);
@@ -1013,7 +1012,7 @@ setup_elsa(struct IsdnCard *card)
                cs->hw.elsa.timer = 0;
                cs->hw.elsa.trig = 0;
                cs->hw.elsa.ctrl = 0;
-               cs->irq_flags |= SA_SHIRQ;
+               cs->irq_flags |= IRQF_SHARED;
                printk(KERN_INFO
                       "Elsa: %s defined at %#lx IRQ %d\n",
                       Elsa_Types[cs->subtyp],
@@ -1062,7 +1061,7 @@ setup_elsa(struct IsdnCard *card)
                test_and_set_bit(HW_IPAC, &cs->HW_Flags);
                cs->hw.elsa.timer = 0;
                cs->hw.elsa.trig  = 0;
-               cs->irq_flags |= SA_SHIRQ;
+               cs->irq_flags |= IRQF_SHARED;
                printk(KERN_INFO
                       "Elsa: %s defined at %#lx/0x%x IRQ %d\n",
                       Elsa_Types[cs->subtyp],
index 898ec0916195a9b788a4679fad5bbd3b8fe50015..0279fb323cb14412404f6ea7d6a59714b461961c 100644 (file)
@@ -7,7 +7,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/serial.h>
 #include <linux/serial_reg.h>
 
index 3341cf1555312ee7e7672269373b7bdb42b55531..8fcbe2e7d765bb3b47a053eec74ddb8aa96d7072 100644 (file)
@@ -60,7 +60,6 @@
  */
 
 
-#include <linux/config.h>
 #include "hisax.h"
 #include "isac.h"
 #include "isdnl1.h"
@@ -406,7 +405,7 @@ setup_enternow_pci(struct IsdnCard *card)
        cs->BC_Send_Data = &netjet_fill_dma;
        cs->cardmsg = &enpci_card_msg;
        cs->irq_func = &enpci_interrupt;
-       cs->irq_flags |= SA_SHIRQ;
+       cs->irq_flags |= IRQF_SHARED;
 
         return (1);
 }
index 60b04c6d9e7dc4da3888a0ffcc3dd7d8709d9d2c..3e7d923035824bd8b7f01aed7343ef807cb8211d 100644 (file)
@@ -11,7 +11,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include "hisax.h"
 #include "isac.h"
@@ -593,7 +592,7 @@ setup_gazelpci(struct IsdnCardState *cs)
        cs->hw.gazel.hscxfifo[0] = cs->hw.gazel.hscx[0];
        cs->hw.gazel.hscxfifo[1] = cs->hw.gazel.hscx[1];
        cs->irq = pci_irq;
-       cs->irq_flags |= SA_SHIRQ;
+       cs->irq_flags |= IRQF_SHARED;
 
        switch (seekcard) {
                case PCI_DEVICE_ID_PLX_R685:
index e3866b0a97fd25b244520ed30f247f0b9e67cf3e..0f967b3df79dac9083d0f7634d2022bbfd471692 100644 (file)
@@ -22,7 +22,6 @@
 
 #include <linux/module.h>
 #include <linux/init.h>
-#include <linux/config.h>
 #include <linux/pci.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
@@ -1553,7 +1552,7 @@ setup_instance(hfc4s8s_hw * hw)
        INIT_WORK(&hw->tqueue, (void *) (void *) hfc4s8s_bh, hw);
 
        if (request_irq
-           (hw->irq, hfc4s8s_interrupt, SA_SHIRQ, hw->card_name, hw)) {
+           (hw->irq, hfc4s8s_interrupt, IRQF_SHARED, hw->card_name, hw)) {
                printk(KERN_INFO
                       "HFC-4S/8S: unable to alloc irq %d, card ignored\n",
                       hw->irq);
index 3622720f05053a01cb37161ab27b2ce9a2fb6f0c..7241e73879ba197d31ee130787189b8f89899a33 100644 (file)
@@ -16,7 +16,6 @@
  */
 
 #include <linux/init.h>
-#include <linux/config.h>
 #include "hisax.h"
 #include "hfc_pci.h"
 #include "isdnl1.h"
@@ -1733,7 +1732,7 @@ setup_hfcpci(struct IsdnCard *card)
                cs->BC_Read_Reg = NULL;
                cs->BC_Write_Reg = NULL;
                cs->irq_func = &hfcpci_interrupt;
-               cs->irq_flags |= SA_SHIRQ;
+               cs->irq_flags |= IRQF_SHARED;
                cs->hw.hfcpci.timer.function = (void *) hfcpci_Timer;
                cs->hw.hfcpci.timer.data = (long) cs;
                init_timer(&cs->hw.hfcpci.timer);
index 262c4412741904bb5dd16ac1252966474ada9a1d..b5e571a526943847f3bd1e0d0240d27c1041c989 100644 (file)
@@ -32,7 +32,6 @@
 #include <linux/types.h>
 #include <linux/stddef.h>
 #include <linux/timer.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/kernel_stat.h>
index 11fe537e2f6f00b1aaf0d1f5bf0d87894df35fd2..75920aa0a3c57711514ec795a3084f003c46a527 100644 (file)
@@ -6,7 +6,6 @@
  * of the GNU General Public License, incorporated herein by reference.
  *
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/major.h>
index ba518a7a7fb7c92adea7418628dd0a92de0a661d..ceafecdb103742c72f12beb4bce4cad7e80b0a10 100644 (file)
@@ -22,7 +22,6 @@
 #ifndef __HISAX_DEBUG_H__
 #define __HISAX_DEBUG_H__
 
-#include <linux/config.h>
 
 #ifdef CONFIG_HISAX_DEBUG
 
index dbcca287ee2c5b7dcffddd4684385918ac47361b..1d7cf3bd6aa336bbf1884869de15436efedcf57d 100644 (file)
@@ -725,11 +725,11 @@ static int __devinit fcpcipnp_setup(struct fritz_adapter *adapter)
 
        switch (adapter->type) {
        case AVM_FRITZ_PCIV2:
-               retval = request_irq(adapter->irq, fcpci2_irq, SA_SHIRQ, 
+               retval = request_irq(adapter->irq, fcpci2_irq, IRQF_SHARED,
                                     "fcpcipnp", adapter);
                break;
        case AVM_FRITZ_PCI:
-               retval = request_irq(adapter->irq, fcpci_irq, SA_SHIRQ,
+               retval = request_irq(adapter->irq, fcpci_irq, IRQF_SHARED,
                                     "fcpcipnp", adapter);
                break;
        case AVM_FRITZ_PNP:
index 2e9afae1254a1a42731936e7e68ef6e1d95cda8a..df5fc92a89b221a2f9853e4918f4e758eb2dc55f 100644 (file)
@@ -10,7 +10,6 @@
  *
  */
 #include <linux/kernel.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include "hisax_if.h"
 #include "hisax.h"
index c9917cd2132b74e0fb311447aaa66c1b03cdd395..281fa27d9f003cc0fd72e07efe1e9e7c40c47f5c 100644 (file)
@@ -18,7 +18,6 @@
 #include <linux/init.h>
 #include "hisax.h"
 #include "isdnl3.h"
-#include <linux/config.h>
 
 const char *l3_revision = "$Revision: 2.22.2.3 $";
 
index e96845cdd4f626897ad4521aeb5f91f0a84bfc0b..99feae8b92100db4765b5d05fda89b87b59c36a3 100644 (file)
@@ -23,7 +23,6 @@
 #include "isdnl3.h"
 #include "l3dss1.h"
 #include <linux/ctype.h>
-#include <linux/config.h>
 
 extern char *HiSax_getrev(const char *revision);
 static const char *dss1_revision = "$Revision: 2.32.2.3 $";
index 68a2159cbd1109ffd9d06d3de6ec83bcc4e53ea9..79a97b1c381263d7ebc75602a3386ed8c422c765 100644 (file)
@@ -14,7 +14,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include "hisax.h"
 #include "isac.h"
@@ -337,7 +336,7 @@ setup_niccy(struct IsdnCard *card)
                        printk(KERN_WARNING "Niccy: No PCI card found\n");
                        return(0);
                }
-               cs->irq_flags |= SA_SHIRQ;
+               cs->irq_flags |= IRQF_SHARED;
                cs->hw.niccy.isac = pci_ioaddr + ISAC_PCI_DATA;
                cs->hw.niccy.isac_ale = pci_ioaddr + ISAC_PCI_ADDR;
                cs->hw.niccy.hscx = pci_ioaddr + HSCX_PCI_DATA;
index a7d3cd3f36fdabf7b4fb2f6f25366ddb7aa28ba9..e5b900a6fa0b543db5da141037fe680657d46e0e 100644 (file)
@@ -5,7 +5,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include "hisax.h"
 #include "isac.h"
@@ -272,7 +271,7 @@ setup_netjet_s(struct IsdnCard *card)
        setup_isac(cs);
        cs->cardmsg = &NETjet_S_card_msg;
        cs->irq_func = &netjet_s_interrupt;
-       cs->irq_flags |= SA_SHIRQ;
+       cs->irq_flags |= IRQF_SHARED;
        ISACVersion(cs, "NETjet-S:");
        return (1);
 }
index 1ae7cac98a877724957349f52e9c3d7066e5623b..7002b09936d4efc848f2cb01596e8c245b88913c 100644 (file)
@@ -5,7 +5,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include "hisax.h"
 #include "icc.h"
@@ -238,7 +237,7 @@ setup_netjet_u(struct IsdnCard *card)
        cs->BC_Send_Data = &netjet_fill_dma;
        cs->cardmsg = &NETjet_U_card_msg;
        cs->irq_func = &netjet_u_interrupt;
-       cs->irq_flags |= SA_SHIRQ;
+       cs->irq_flags |= IRQF_SHARED;
        ICCVersion(cs, "NETspider-U:");
        return (1);
 }
index 8c044a6a7fe3b1e6567a5926f99d71932dee4494..8d8e8a299892381762140653beed8148dad2e175 100644 (file)
@@ -39,7 +39,6 @@
 */
 
 #include <linux/init.h>
-#include <linux/config.h>
 #include "hisax.h"
 #include "isac.h"
 #include "ipac.h"
@@ -633,7 +632,7 @@ setup_sedlbauer(struct IsdnCard *card)
                        printk(KERN_WARNING "Sedlbauer: No PCI card found\n");
                        return(0);
                }
-               cs->irq_flags |= SA_SHIRQ;
+               cs->irq_flags |= IRQF_SHARED;
                cs->hw.sedl.bus = SEDL_BUS_PCI;
                sub_vendor_id = dev_sedl->subsystem_vendor;
                sub_id = dev_sedl->subsystem_device;
@@ -810,7 +809,7 @@ ready:
                                cs->hw.sedl.hscx = cs->hw.sedl.cfg_reg + SEDL_HSCX_PCMCIA_HSCX;
                                cs->hw.sedl.reset_on = cs->hw.sedl.cfg_reg + SEDL_HSCX_PCMCIA_RESET;
                                cs->hw.sedl.reset_off = cs->hw.sedl.cfg_reg + SEDL_HSCX_PCMCIA_RESET;
-                               cs->irq_flags |= SA_SHIRQ;
+                               cs->irq_flags |= IRQF_SHARED;
                        } else {
                                cs->hw.sedl.adr = cs->hw.sedl.cfg_reg + SEDL_HSCX_ISA_ADR;
                                cs->hw.sedl.isac = cs->hw.sedl.cfg_reg + SEDL_HSCX_ISA_ISAC;
index 9ffaae7c657a1e09510698229adf285588d8ab91..04416bad611d5f68b32976f8f37ad8104c011054 100644 (file)
@@ -13,7 +13,6 @@
 #ifndef _ST5481_H_
 #define _ST5481_H_
 
-#include <linux/config.h>
 
 // USB IDs, the Product Id is in the range 0x4810-0x481F
 
index 99cb0f3d59a15ff4e4a65748b9bb309858dc5d21..2716aa5c60f7008b1c2df0742af1f722e35a2655 100644 (file)
@@ -24,7 +24,6 @@
  * clean up debug
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/usb.h>
index 090abd16b4bcb93317109ebc2977538fc447b4c8..5cb712437da4ce9f5e37ff51baa9735d3fae68eb 100644 (file)
@@ -369,7 +369,7 @@ setup_teles3(struct IsdnCard *card)
                               cs->hw.teles3.hscx[1] + 96);
                        return (0);
                }
-               cs->irq_flags |= SA_SHIRQ; /* cardbus can share */
+               cs->irq_flags |= IRQF_SHARED; /* cardbus can share */
        } else {
                if (cs->hw.teles3.cfg_reg) {
                        if (cs->typ == ISDN_CTYPE_COMPAQ_ISA) {
index e82ab2251b825089b9f0a28ad68b007c6dbfd0f9..9382cdf04d8d94029ba1448821acd47485404614 100644 (file)
@@ -13,7 +13,6 @@
  */
 
 #include <linux/init.h>
-#include <linux/config.h>
 #include "hisax.h"
 #include "isac.h"
 #include "hscx.h"
@@ -348,7 +347,7 @@ setup_telespci(struct IsdnCard *card)
        cs->BC_Send_Data = &hscx_fill_fifo;
        cs->cardmsg = &TelesPCI_card_msg;
        cs->irq_func = &telespci_interrupt;
-       cs->irq_flags |= SA_SHIRQ;
+       cs->irq_flags |= IRQF_SHARED;
        ISACVersion(cs, "TelesPCI:");
        if (HscxVersion(cs, "TelesPCI:")) {
                printk(KERN_WARNING
index 0352ee5f706ca904244839b102edb84746ca580a..6c68419c05ff928530bf631c47411698d8299c87 100644 (file)
@@ -10,7 +10,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include "hisax.h"
 #include "w6692.h"
@@ -1081,7 +1080,7 @@ setup_w6692(struct IsdnCard *card)
        cs->BC_Send_Data = &W6692B_fill_fifo;
        cs->cardmsg = &w6692_card_msg;
        cs->irq_func = &W6692_interrupt;
-       cs->irq_flags |= SA_SHIRQ;
+       cs->irq_flags |= IRQF_SHARED;
        W6692Version(cs, "W6692:");
        printk(KERN_INFO "W6692 ISTA=0x%X\n", ReadW6692(cs, W_ISTA));
        printk(KERN_INFO "W6692 IMASK=0x%X\n", ReadW6692(cs, W_IMASK));
index 48d134be99088166e9f711e8f6160932f49fa8f4..73afebdf80bdf868bb734517199c35b257698a3d 100644 (file)
@@ -14,7 +14,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/signal.h>
 #include <linux/kernel.h>
@@ -436,7 +435,7 @@ ergo_inithardware(hysdn_card * card)
        }
 
        ergo_stopcard(card);    /* disable interrupts */
-       if (request_irq(card->irq, ergo_interrupt, SA_SHIRQ, "HYSDN", card)) {
+       if (request_irq(card->irq, ergo_interrupt, IRQF_SHARED, "HYSDN", card)) {
                ergo_releasehardware(card); /* return the acquired hardware */
                return (-1);
        }
index 3a9b29b38bc4eef1afeebab6f8d42a38846c57a2..461e831592ddd28710c36c8d422ae0f286645445 100644 (file)
@@ -14,7 +14,6 @@
 #ifndef HYSDN_DEFS_H
 #define HYSDN_DEFS_H
 
-#include <linux/config.h>
 #include <linux/hysdn_if.h>
 #include <linux/interrupt.h>
 #include <linux/workqueue.h>
index b75ac5af236a1a5eb102f1ff84554b2d23b02d28..b702ed27252bd2ab0054d5c4431fdb9d31ca98db 100644 (file)
@@ -10,7 +10,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/poll.h>
index 133032920ff8339d6b272de59cc277f5c79bb9db..1c0d54ac12abeb8cb2686ea87adea4619b51e24f 100644 (file)
@@ -11,7 +11,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/signal.h>
 #include <linux/kernel.h>
index eb21063e6f63fb7939363bf1cdf527d5a38f151a..9f6c6375ff75014f3a441c0056e2d007b9de354e 100644 (file)
@@ -11,7 +11,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/poll.h>
index 96c115e13389cd16b2d18a34bd5bc65e19d4fd47..43da8ae1b2ada35d4b2f2bf51ef9a4f2a37f74a5 100644 (file)
@@ -22,7 +22,6 @@
  *           http://i4l.zabbadoz.net/i4l/cisco-hdlc.txt
  */
 
-#include <linux/config.h>
 #include <linux/isdn.h>
 #include <net/arp.h>
 #include <net/dst.h>
index 918742271c79f6e617bec47ab38bcca52eda3483..29e7667ec962e5dbd35abc5b9d61dc5dbd81fe20 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/isdn.h>
 #include <linux/poll.h>
 #include <linux/ppp-comp.h>
index 0a53a990c100a2662102cab27823c1b6a7e0b5a0..9ab66e8960d5ddc1082f5d23c5c86642c8c528c5 100644 (file)
@@ -11,7 +11,6 @@
  */
 #undef ISDN_TTY_STAT_DEBUG
 
-#include <linux/config.h>
 #include <linux/isdn.h>
 #include <linux/delay.h>
 #include "isdn_common.h"
index 9f0fa9501f4d40287fbf980c55a8ec0be9b5926f..692c74d6b74964fb4a9f35464f2795411bb50a42 100644 (file)
@@ -10,7 +10,6 @@
  *
  */
 
-#include <linux/config.h>
 
 #define DLE 0x10
 #define ETX 0x03
index a67d31af797a78030c5653bd1bc1f6f05e29937e..fabbd461603e217befac34687aa5eb08f7ebb575 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
index 62b7acfad8a4fcd289b05735d1f51a21790c658e..a627e68023f64e228671d02c20b3e96ed94eb666 100644 (file)
@@ -342,7 +342,7 @@ static int __init sc_init(void)
                 */
                sc_adapter[cinst]->interrupt = irq[b];
                if (request_irq(sc_adapter[cinst]->interrupt, interrupt_handler,
-                               SA_INTERRUPT, interface->id, NULL))
+                               IRQF_DISABLED, interface->id, NULL))
                {
                        kfree(sc_adapter[cinst]->channel);
                        indicate_status(cinst, ISDN_STAT_UNLOAD, 0, NULL);      /* Fix me */
index c75d0ef1609cb900d0cc014620bccbe8fbff2e7c..d424b4452028f2fb466ea70bd98d7ca0ae20339c 100644 (file)
@@ -9,7 +9,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 1b1ce6523960cb1676f342a718adf2e0962c42a6..47f0ff196328d2808268a17701444b08faafee1a 100644 (file)
@@ -11,7 +11,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index bb7d84df0121d2eafab984d7d4cfc61fcfb056d2..cf1dcd719a282eae18e596e7673807b48ef524c5 100644 (file)
@@ -11,7 +11,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
index 30ced150e4cfb8d2ea687a9f9487d11d690049e8..7dcf0b92c4603efe61c7d48c864d17351988360a 100644 (file)
@@ -31,7 +31,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
index 8419e29b71f4462ca4b4b6d580882143a6958991..3b87951aa5550211b829f5ab940fb6f98262b555 100644 (file)
@@ -8,7 +8,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/device.h>
index 650cf72dc675e9f659146f9ce9e935e522b36f11..fb1edc1c9edbd5556fbf86e97a8e67ce0c3dbfb2 100644 (file)
@@ -11,7 +11,6 @@
  * published by the Free Software Foundation.
 */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
index 65bbef4a5e0911402a63eb33fa9982a75c51ea8d..126d09cc96ecf97cad158fe47315e73c13e96779 100644 (file)
@@ -11,7 +11,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
index c9e8cc1ec4813db2942ad49c9a16c0b07e511e59..fb2416a38303ce87aab0766dac1c9997ecca506a 100644 (file)
@@ -12,7 +12,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
index fbf141ef46ec3488779a54c616cdff600f38890d..179c2876b5416cf871dbb7c3c3ce08ecebe8b137 100644 (file)
@@ -11,7 +11,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 9f1a049dc226a4d2a3086130ab0164f7889edbd2..360f93f6fcdb55de9941c14e38349c82a59f516b 100644 (file)
@@ -16,7 +16,6 @@
  * - move bus probe to a kernel thread
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
index cbfbbe2b150ab3167623e6622a972bab41b22e29..545be1ed692783035d190b2d3a884808db11515f 100644 (file)
@@ -34,7 +34,6 @@
  * Move to syfs
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/init.h>
index e5a2bbf9939939d15fed6d1f7fd9c109980f8abb..1293876a2ebd3c60244ae12c7ceb05bf630b315f 100644 (file)
@@ -18,7 +18,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/poll.h>
index a66636116f0b4f047f1071cf54b2c5cf334e2165..6b129eef7987cac903620a44109e8b63ce213871 100644 (file)
@@ -8,7 +8,6 @@
  * This file will soon be removed in favor of an uinput userspace tool.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/proc_fs.h>
 #include <linux/sysctl.h>
index 314fc0830d9004d4a32998e6bb563c5719357822..4b08852c35eecc24cfde1153f113edfc90ed0547 100644 (file)
@@ -90,22 +90,12 @@ int macio_init(void)
 {
        struct device_node *adbs;
        struct resource r;
+       unsigned int irq;
 
        adbs = find_compatible_devices("adb", "chrp,adb0");
        if (adbs == 0)
                return -ENXIO;
 
-#if 0
-       { int i = 0;
-
-       printk("macio_adb_init: node = %p, addrs =", adbs->node);
-       while(!of_address_to_resource(adbs, i, &r))
-               printk(" %x(%x)", r.start, r.end - r.start);
-       printk(", intrs =");
-       for (i = 0; i < adbs->n_intrs; ++i)
-               printk(" %x", adbs->intrs[i].line);
-       printk("\n"); }
-#endif
        if (of_address_to_resource(adbs, 0, &r))
                return -ENXIO;
        adb = ioremap(r.start, sizeof(struct adb_regs));
@@ -117,10 +107,9 @@ int macio_init(void)
        out_8(&adb->active_lo.r, 0xff);
        out_8(&adb->autopoll.r, APE);
 
-       if (request_irq(adbs->intrs[0].line, macio_adb_interrupt,
-                       0, "ADB", (void *)0)) {
-               printk(KERN_ERR "ADB: can't get irq %d\n",
-                      adbs->intrs[0].line);
+       irq = irq_of_parse_and_map(adbs, 0);
+       if (request_irq(irq, macio_adb_interrupt, 0, "ADB", (void *)0)) {
+               printk(KERN_ERR "ADB: can't get irq %d\n", irq);
                return -EAGAIN;
        }
        out_8(&adb->intr_enb.r, DFB | TAG);
index c687ac703941f514af7c352ab456e72be2fc18e2..80c0c665b5f6be34c103fc7759f05054652de616 100644 (file)
@@ -17,7 +17,6 @@
  *    sub-devices.
  */
  
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
@@ -281,75 +280,128 @@ static void macio_release_dev(struct device *dev)
 static int macio_resource_quirks(struct device_node *np, struct resource *res,
                                 int index)
 {
-       if (res->flags & IORESOURCE_MEM) {
-               /* Grand Central has too large resource 0 on some machines */
-               if (index == 0 && !strcmp(np->name, "gc"))
-                       res->end = res->start + 0x1ffff;
+       /* Only quirks for memory resources for now */
+       if ((res->flags & IORESOURCE_MEM) == 0)
+               return 0;
+
+       /* Grand Central has too large resource 0 on some machines */
+       if (index == 0 && !strcmp(np->name, "gc"))
+               res->end = res->start + 0x1ffff;
 
-               /* Airport has bogus resource 2 */
-               if (index >= 2 && !strcmp(np->name, "radio"))
-                       return 1;
+       /* Airport has bogus resource 2 */
+       if (index >= 2 && !strcmp(np->name, "radio"))
+               return 1;
 
 #ifndef CONFIG_PPC64
-               /* DBDMAs may have bogus sizes */
-               if ((res->start & 0x0001f000) == 0x00008000)
-                       res->end = res->start + 0xff;
+       /* DBDMAs may have bogus sizes */
+       if ((res->start & 0x0001f000) == 0x00008000)
+               res->end = res->start + 0xff;
 #endif /* CONFIG_PPC64 */
 
-               /* ESCC parent eats child resources. We could have added a
-                * level of hierarchy, but I don't really feel the need
-                * for it
-                */
-               if (!strcmp(np->name, "escc"))
-                       return 1;
-
-               /* ESCC has bogus resources >= 3 */
-               if (index >= 3 && !(strcmp(np->name, "ch-a") &&
-                                   strcmp(np->name, "ch-b")))
-                       return 1;
-
-               /* Media bay has too many resources, keep only first one */
-               if (index > 0 && !strcmp(np->name, "media-bay"))
-                       return 1;
-
-               /* Some older IDE resources have bogus sizes */
-               if (!(strcmp(np->name, "IDE") && strcmp(np->name, "ATA") &&
-                     strcmp(np->type, "ide") && strcmp(np->type, "ata"))) {
-                       if (index == 0 && (res->end - res->start) > 0xfff)
-                               res->end = res->start + 0xfff;
-                       if (index == 1 && (res->end - res->start) > 0xff)
-                               res->end = res->start + 0xff;
-               }
+       /* ESCC parent eats child resources. We could have added a
+        * level of hierarchy, but I don't really feel the need
+        * for it
+        */
+       if (!strcmp(np->name, "escc"))
+               return 1;
+
+       /* ESCC has bogus resources >= 3 */
+       if (index >= 3 && !(strcmp(np->name, "ch-a") &&
+                           strcmp(np->name, "ch-b")))
+               return 1;
+
+       /* Media bay has too many resources, keep only first one */
+       if (index > 0 && !strcmp(np->name, "media-bay"))
+               return 1;
+
+       /* Some older IDE resources have bogus sizes */
+       if (!(strcmp(np->name, "IDE") && strcmp(np->name, "ATA") &&
+             strcmp(np->type, "ide") && strcmp(np->type, "ata"))) {
+               if (index == 0 && (res->end - res->start) > 0xfff)
+                       res->end = res->start + 0xfff;
+               if (index == 1 && (res->end - res->start) > 0xff)
+                       res->end = res->start + 0xff;
        }
        return 0;
 }
 
+static void macio_create_fixup_irq(struct macio_dev *dev, int index,
+                                  unsigned int line)
+{
+       unsigned int irq;
 
-static void macio_setup_interrupts(struct macio_dev *dev)
+       irq = irq_create_mapping(NULL, line, 0);
+       if (irq != NO_IRQ) {
+               dev->interrupt[index].start = irq;
+               dev->interrupt[index].flags = IORESOURCE_IRQ;
+               dev->interrupt[index].name = dev->ofdev.dev.bus_id;
+       }
+       if (dev->n_interrupts <= index)
+               dev->n_interrupts = index + 1;
+}
+
+static void macio_add_missing_resources(struct macio_dev *dev)
 {
        struct device_node *np = dev->ofdev.node;
-       int i,j;
+       unsigned int irq_base;
+
+       /* Gatwick has some missing interrupts on child nodes */
+       if (dev->bus->chip->type != macio_gatwick)
+               return;
 
-       /* For now, we use pre-parsed entries in the device-tree for
-        * interrupt routing and addresses, but we should change that
-        * to dynamically parsed entries and so get rid of most of the
-        * clutter in struct device_node
+       /* irq_base is always 64 on gatwick. I have no cleaner way to get
+        * that value from here at this point
         */
-       for (i = j = 0; i < np->n_intrs; i++) {
+       irq_base = 64;
+
+       /* Fix SCC */
+       if (strcmp(np->name, "ch-a") == 0) {
+               macio_create_fixup_irq(dev, 0, 15 + irq_base);
+               macio_create_fixup_irq(dev, 1,  4 + irq_base);
+               macio_create_fixup_irq(dev, 2,  5 + irq_base);
+               printk(KERN_INFO "macio: fixed SCC irqs on gatwick\n");
+       }
+
+       /* Fix media-bay */
+       if (strcmp(np->name, "media-bay") == 0) {
+               macio_create_fixup_irq(dev, 0, 29 + irq_base);
+               printk(KERN_INFO "macio: fixed media-bay irq on gatwick\n");
+       }
+
+       /* Fix left media bay childs */
+       if (dev->media_bay != NULL && strcmp(np->name, "floppy") == 0) {
+               macio_create_fixup_irq(dev, 0, 19 + irq_base);
+               macio_create_fixup_irq(dev, 1,  1 + irq_base);
+               printk(KERN_INFO "macio: fixed left floppy irqs\n");
+       }
+       if (dev->media_bay != NULL && strcasecmp(np->name, "ata4") == 0) {
+               macio_create_fixup_irq(dev, 0, 14 + irq_base);
+               macio_create_fixup_irq(dev, 0,  3 + irq_base);
+               printk(KERN_INFO "macio: fixed left ide irqs\n");
+       }
+}
+
+static void macio_setup_interrupts(struct macio_dev *dev)
+{
+       struct device_node *np = dev->ofdev.node;
+       unsigned int irq;
+       int i = 0, j = 0;
+
+       for (;;) {
                struct resource *res = &dev->interrupt[j];
 
                if (j >= MACIO_DEV_COUNT_IRQS)
                        break;
-               res->start = np->intrs[i].line;
-               res->flags = IORESOURCE_IO;
-               if (np->intrs[j].sense)
-                       res->flags |= IORESOURCE_IRQ_LOWLEVEL;
-               else
-                       res->flags |= IORESOURCE_IRQ_HIGHEDGE;
+               irq = irq_of_parse_and_map(np, i++);
+               if (irq == NO_IRQ)
+                       break;
+               res->start = irq;
+               res->flags = IORESOURCE_IRQ;
                res->name = dev->ofdev.dev.bus_id;
-               if (macio_resource_quirks(np, res, i))
+               if (macio_resource_quirks(np, res, i - 1)) {
                        memset(res, 0, sizeof(struct resource));
-               else
+                       continue;
+               } else
                        j++;
        }
        dev->n_interrupts = j;
@@ -428,10 +480,10 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
 
        /* MacIO itself has a different reg, we use it's PCI base */
        if (np == chip->of_node) {
-               sprintf(dev->ofdev.dev.bus_id, "%1d.%016llx:%.*s",
+               sprintf(dev->ofdev.dev.bus_id, "%1d.%08x:%.*s",
                        chip->lbus.index,
 #ifdef CONFIG_PCI
-                       (unsigned long long)pci_resource_start(chip->lbus.pdev, 0),
+                       (unsigned int)pci_resource_start(chip->lbus.pdev, 0),
 #else
                        0, /* NuBus may want to do something better here */
 #endif
@@ -446,6 +498,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
        /* Setup interrupts & resources */
        macio_setup_interrupts(dev);
        macio_setup_resources(dev, parent_res);
+       macio_add_missing_resources(dev);
 
        /* Register with core */
        if (of_device_register(&dev->ofdev) != 0) {
index 7f7d4eaca870ac3650d4b0523355bd7bf7e22117..cae24a13526a36a83498a9e2ad02ab1499d8ab2e 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/stat.h>
 #include <asm/macio.h>
index 53c1c79094138781c2cff7e35fb71a9061b5cfb7..0acf2f7fd9d725a3348d583306464211683021ac 100644 (file)
@@ -10,7 +10,6 @@
  *  as published by the Free Software Foundation; either version
  *  2 of the License, or (at your option) any later version.
  */
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
index f4516ca7aa3a20ee13f100e7d06fa9e18eded116..f139a74696fe85a39ab96aa3b7e93902e6a90dee 100644 (file)
@@ -19,7 +19,6 @@
  *    the userland interface
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/device.h>
@@ -498,8 +497,7 @@ int __init smu_init (void)
        smu->doorbell = *data;
        if (smu->doorbell < 0x50)
                smu->doorbell += 0x50;
-       if (np->n_intrs > 0)
-               smu->db_irq = np->intrs[0].line;
+       smu->db_irq = irq_of_parse_and_map(np, 0);
 
        of_node_put(np);
 
@@ -516,8 +514,7 @@ int __init smu_init (void)
                smu->msg = *data;
                if (smu->msg < 0x50)
                        smu->msg += 0x50;
-               if (np->n_intrs > 0)
-                       smu->msg_irq = np->intrs[0].line;
+               smu->msg_irq = irq_of_parse_and_map(np, 0);
                of_node_put(np);
        } while(0);
 
@@ -556,7 +553,7 @@ static int smu_late_init(void)
 
        if (smu->db_irq != NO_IRQ) {
                if (request_irq(smu->db_irq, smu_db_intr,
-                               SA_SHIRQ, "SMU doorbell", smu) < 0) {
+                               IRQF_SHARED, "SMU doorbell", smu) < 0) {
                        printk(KERN_WARNING "SMU: can't "
                               "request interrupt %d\n",
                               smu->db_irq);
@@ -566,7 +563,7 @@ static int smu_late_init(void)
 
        if (smu->msg_irq != NO_IRQ) {
                if (request_irq(smu->msg_irq, smu_msg_intr,
-                               SA_SHIRQ, "SMU message", smu) < 0) {
+                               IRQF_SHARED, "SMU message", smu) < 0) {
                        printk(KERN_WARNING "SMU: can't "
                               "request interrupt %d\n",
                               smu->msg_irq);
index 5282fec17075be859759a29c0eeb8662603f016e..7f86478bdd36683799bcf99b204858976f3edc09 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/errno.h>
index 231146f439dddd841508b049d9aeaa14a9506468..c1fe0b368f7624ff12653f0f3f87d85e571939b7 100644 (file)
@@ -97,7 +97,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/errno.h>
index c17e61f9c418c081d7e9538894679b2594fc8fb1..fc7e9b7ecaf2da93f7323cf80e4939b935d93f10 100644 (file)
@@ -93,7 +93,7 @@ static char * critical_overtemp_path = "/sbin/critical_overtemp";
  * 0. This appear to be safe enough for this first version
  * of the driver, though I would accept any clean patch
  * doing a better use of the device-tree without turning the
- * while i2c registration mecanism into a racy mess
+ * while i2c registration mechanism into a racy mess
  *
  * Note: Xserve changed this. We have some bits on the K2 bus,
  * which I arbitrarily set to 0x200. Ultimately, we really want
index 3d9dd2e166aab2562d2f85dafc165459156afbf7..c7d1c290cb0c11280ee48a4840897adafaf68a86 100644 (file)
@@ -27,7 +27,6 @@
  *   
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/errno.h>
index 2d9d79150403b17996f034a8165a45ea28a687b5..69d5452fd22fc8f8178f494156f62304bc3d04ba 100644 (file)
@@ -9,7 +9,6 @@
  * Copyright (C) 1996 Paul Mackerras.
  */
 #include <stdarg.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
 static volatile unsigned char __iomem *via;
 static DEFINE_SPINLOCK(cuda_lock);
 
-#ifdef CONFIG_MAC
-#define CUDA_IRQ IRQ_MAC_ADB
-#define eieio()
-#else
-#define CUDA_IRQ vias->intrs[0].line
-#endif
-
 /* VIA registers - spaced 0x200 bytes apart */
 #define RS             0x200           /* skip between registers */
 #define B              0               /* B-side data */
@@ -190,11 +182,24 @@ int __init find_via_cuda(void)
 
 static int __init via_cuda_start(void)
 {
+    unsigned int irq;
+
     if (via == NULL)
        return -ENODEV;
 
-    if (request_irq(CUDA_IRQ, cuda_interrupt, 0, "ADB", cuda_interrupt)) {
-       printk(KERN_ERR "cuda_init: can't get irq %d\n", CUDA_IRQ);
+#ifdef CONFIG_MAC
+    irq = IRQ_MAC_ADB;
+#else /* CONFIG_MAC */
+    irq = irq_of_parse_and_map(vias, 0);
+    if (irq == NO_IRQ) {
+       printk(KERN_ERR "via-cuda: can't map interrupts for %s\n",
+              vias->full_name);
+       return -ENODEV;
+    }
+#endif /* CONFIG_MAP */
+
+    if (request_irq(irq, cuda_interrupt, 0, "ADB", cuda_interrupt)) {
+       printk(KERN_ERR "via-cuda: can't request irq %d\n", irq);
        return -EAGAIN;
     }
 
index 1ab4f16c08b92d1e34da8e6628f66930c77d463a..06ca80bfd6b98442dfce7c532d33a6d8a9e4ced0 100644 (file)
@@ -21,7 +21,6 @@
  *
  */
 #include <stdarg.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
 #include <asm/backlight.h>
 #endif
 
-#ifdef CONFIG_PPC32
-#include <asm/open_pic.h>
-#endif
-
 #include "via-pmu-event.h"
 
 /* Some compile options */
@@ -152,7 +147,7 @@ static int pmu_fully_inited = 0;
 static int pmu_has_adb;
 static struct device_node *gpio_node;
 static unsigned char __iomem *gpio_reg = NULL;
-static int gpio_irq = -1;
+static int gpio_irq = NO_IRQ;
 static int gpio_irq_enabled = -1;
 static volatile int pmu_suspended = 0;
 static spinlock_t pmu_lock;
@@ -404,22 +399,21 @@ static int __init pmu_init(void)
  */
 static int __init via_pmu_start(void)
 {
+       unsigned int irq;
+
        if (vias == NULL)
                return -ENODEV;
 
        batt_req.complete = 1;
 
-#ifndef CONFIG_PPC_MERGE
-       if (pmu_kind == PMU_KEYLARGO_BASED)
-               openpic_set_irq_priority(vias->intrs[0].line,
-                                        OPENPIC_PRIORITY_DEFAULT + 1);
-#endif
-
-       if (request_irq(vias->intrs[0].line, via_pmu_interrupt, 0, "VIA-PMU",
-                       (void *)0)) {
-               printk(KERN_ERR "VIA-PMU: can't get irq %d\n",
-                      vias->intrs[0].line);
-               return -EAGAIN;
+       irq = irq_of_parse_and_map(vias, 0);
+       if (irq == NO_IRQ) {
+               printk(KERN_ERR "via-pmu: can't map interruptn");
+               return -ENODEV;
+       }
+       if (request_irq(irq, via_pmu_interrupt, 0, "VIA-PMU", (void *)0)) {
+               printk(KERN_ERR "via-pmu: can't request irq %d\n", irq);
+               return -ENODEV;
        }
 
        if (pmu_kind == PMU_KEYLARGO_BASED) {
@@ -427,10 +421,10 @@ static int __init via_pmu_start(void)
                if (gpio_node == NULL)
                        gpio_node = of_find_node_by_name(NULL,
                                                         "pmu-interrupt");
-               if (gpio_node && gpio_node->n_intrs > 0)
-                       gpio_irq = gpio_node->intrs[0].line;
+               if (gpio_node)
+                       gpio_irq = irq_of_parse_and_map(gpio_node, 0);
 
-               if (gpio_irq != -1) {
+               if (gpio_irq != NO_IRQ) {
                        if (request_irq(gpio_irq, gpio1_interrupt, 0,
                                        "GPIO1 ADB", (void *)0))
                                printk(KERN_ERR "pmu: can't get irq %d"
index 81337cd16e80d1fc80f87ee17fb82aa88a03d00f..900aade0619871c683b2a29cf45a3638c925a957 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
index ebbd2d856256f148d9352a396e2c537d59564925..ecc56765d949ebc977ebbe5326b0dcc39197566e 100644 (file)
@@ -20,7 +20,6 @@
 #include <linux/errno.h>
 #include <linux/slab.h>
 #include <linux/init.h>
-#include <linux/config.h>
 #include <linux/timer.h>
 #include <linux/sched.h>
 #include <linux/list.h>
index 8eea0ddbf5ec7dad5d4b012bd251dfeca83cd286..1d0fafda0f761abb3630bd180f628dd7dfbbbc4d 100644 (file)
@@ -7,7 +7,6 @@
  */
 
 #include <linux/blkdev.h>
-#include <linux/config.h>
 #include <linux/ctype.h>
 #include <linux/device-mapper.h>
 #include <linux/fs.h>
index 73ab875fb1580789a0e260557caad2cea40e44de..f1db6eff48574c80d9340960ac3deb0d25831ca0 100644 (file)
@@ -12,7 +12,6 @@
 #include <asm/atomic.h>
 
 #include <linux/blkdev.h>
-#include <linux/config.h>
 #include <linux/fs.h>
 #include <linux/init.h>
 #include <linux/list.h>
index 2ec1b3520a0b7245344610bba7fd1763beb9d25d..e4e161372a3e431ba8cfb0bd0736f5efc4ecdf72 100644 (file)
@@ -33,7 +33,6 @@
 */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/kthread.h>
 #include <linux/linkage.h>
 #include <linux/raid/md.h>
@@ -1405,7 +1404,7 @@ static int lock_rdev(mdk_rdev_t *rdev, dev_t dev)
        struct block_device *bdev;
        char b[BDEVNAME_SIZE];
 
-       bdev = open_by_devnum(dev, FMODE_READ|FMODE_WRITE);
+       bdev = open_partition_by_devnum(dev, FMODE_READ|FMODE_WRITE);
        if (IS_ERR(bdev)) {
                printk(KERN_ERR "md: could not open %s.\n",
                        __bdevname(dev, b));
@@ -1415,7 +1414,7 @@ static int lock_rdev(mdk_rdev_t *rdev, dev_t dev)
        if (err) {
                printk(KERN_ERR "md: could not bd_claim %s.\n",
                        bdevname(bdev, b));
-               blkdev_put(bdev);
+               blkdev_put_partition(bdev);
                return err;
        }
        rdev->bdev = bdev;
@@ -1429,7 +1428,7 @@ static void unlock_rdev(mdk_rdev_t *rdev)
        if (!bdev)
                MD_BUG();
        bd_release(bdev);
-       blkdev_put(bdev);
+       blkdev_put_partition(bdev);
 }
 
 void md_autodetect_dev(dev_t dev);
index 837ec4eb3d604ce4e01023ccf87d0804ceef7f88..7433871f4b3a45e866c6a7d2508bfdaaa28f30e4 100644 (file)
@@ -19,7 +19,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/highmem.h>
index 8cdd4d265ffa235bb69a57f7a57679b6e0827e72..b88451e33c09cc67219a112cd78fb123cdd8a82f 100644 (file)
@@ -363,7 +363,7 @@ static int saa7146_init_one(struct pci_dev *pci, const struct pci_device_id *ent
        saa7146_write(dev, MC2, 0xf8000000);
 
        /* request an interrupt for the saa7146 */
-       err = request_irq(pci->irq, interrupt_hw, SA_SHIRQ | SA_INTERRUPT,
+       err = request_irq(pci->irq, interrupt_hw, IRQF_SHARED | IRQF_DISABLED,
                          dev->name, dev);
        if (err < 0) {
                ERR(("request_irq() failed.\n"));
index 2092e6c33dd289674a51b3c58a2389cb3c77ad4f..d2905720eb746b782f034b5e2b0aa1898c16b683 100644 (file)
@@ -158,7 +158,7 @@ static int calculate_h_scale_registers(struct saa7146_dev *dev,
        }
 
        /* the horizontal scaling increment controls the UV filter
-          to reduce the bandwith to improve the display quality,
+          to reduce the bandwidth to improve the display quality,
           so set it ... */
        if ( xsci == 0x400)
                pfuv = 0x00;
index b3dd0603cd9210ff1773c7e0f6a0b36ca0213b4d..5a6c4fe249e7b5bd190c1a062e4f28320c022534 100644 (file)
@@ -8,7 +8,6 @@
 #ifndef __FLEXCOP_COMMON_H__
 #define __FLEXCOP_COMMON_H__
 
-#include <linux/config.h>
 #include <linux/pci.h>
 #include <linux/mutex.h>
 
index f04041702191e7eb303f0920820f038756ee5d75..eb2e6432c8c210c9e663cf6a4e98ebf75b422914 100644 (file)
@@ -294,7 +294,7 @@ static int flexcop_pci_init(struct flexcop_pci *fc_pci)
        pci_set_drvdata(fc_pci->pdev, fc_pci);
 
        if ((ret = request_irq(fc_pci->pdev->irq, flexcop_pci_isr,
-                                       SA_SHIRQ, DRIVER_NAME, fc_pci)) != 0)
+                                       IRQF_SHARED, DRIVER_NAME, fc_pci)) != 0)
                goto err_pci_iounmap;
 
        spin_lock_init(&fc_pci->irq_lock);
index 761fa6e7d76222195638ca7666e027fb72e57b54..755822ee6e9ba1a981cd09e39805eb853b518006 100644 (file)
@@ -488,7 +488,7 @@ static int __devinit bt878_probe(struct pci_dev *dev,
        btwrite(0, BT848_INT_MASK);
 
        result = request_irq(bt->irq, bt878_irq,
-                            SA_SHIRQ | SA_INTERRUPT, "bt878",
+                            IRQF_SHARED | IRQF_DISABLED, "bt878",
                             (void *) bt);
        if (result == -EINVAL) {
                printk(KERN_ERR "bt878(%d): Bad irq number or handler\n",
index 1b895360042531722a60830aca59e455a1f93913..001c71b6be61a970a59aad312bf59b65ab706e54 100644 (file)
@@ -22,7 +22,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/slab.h>
index 5e8bb41a088b56c59bcb7f16c8f36264e1d54374..59ac35ddd51ef693f388eb3599a133d64cdd585e 100644 (file)
@@ -570,7 +570,8 @@ static int dvb_frontend_thread(void *data)
                                        dvb_frontend_add_event(fe, s);
                                        fepriv->status = s;
                                }
-                       }
+                       } else
+                               dvb_frontend_swzigzag(fe);
                } else
                        dvb_frontend_swzigzag(fe);
        }
@@ -975,6 +976,7 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file,
 
        case FE_SET_FRONTEND_TUNE_MODE:
                fepriv->tune_mode_flags = (unsigned long) parg;
+               err = 0;
                break;
        };
 
index 4cf9f89c51bf91c48f1faebee796d9a2839e0932..97f8ea9624385ae828834209bcf2ee872ab2e66f 100644 (file)
@@ -8,7 +8,6 @@
 #ifndef __DVB_USB_H__
 #define __DVB_USB_H__
 
-#include <linux/config.h>
 #include <linux/input.h>
 #include <linux/usb.h>
 #include <linux/firmware.h>
index 3c7c09a362b2ac88bf517ae1e2499fa347f97f82..13ad1bfae663f0c0386960d7314b7c65d4ff6ca7 100644 (file)
@@ -134,6 +134,7 @@ static int cx22700_set_tps (struct cx22700_state *state, struct dvb_ofdm_paramet
                return -EINVAL;
 
        if (p->code_rate_LP < FEC_1_2 || p->code_rate_LP > FEC_7_8)
+               return -EINVAL;
 
        if (p->code_rate_HP == FEC_4_5 || p->code_rate_LP == FEC_4_5)
                return -EINVAL;
index f2f795cba56aec2b18fc03b0c99f8bbe32820c5d..274a87b7a5d5fe8e54acf887aaeaa155bd82def1 100644 (file)
@@ -670,10 +670,10 @@ static int cx24123_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage
        switch (voltage) {
        case SEC_VOLTAGE_13:
                dprintk("%s: setting voltage 13V\n", __FUNCTION__);
-               return cx24123_writereg(state, 0x29, val | 0x80);
+               return cx24123_writereg(state, 0x29, val & 0x7f);
        case SEC_VOLTAGE_18:
                dprintk("%s: setting voltage 18V\n", __FUNCTION__);
-               return cx24123_writereg(state, 0x29, val & 0x7f);
+               return cx24123_writereg(state, 0x29, val | 0x80);
        default:
                return -EINVAL;
        };
index 7c6dc7e30900a428b5a037b0099d096dcc871156..5302e11883a24738153dfd75f1f4c6ed3c53b354 100644 (file)
@@ -21,7 +21,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
index 6c3be2529980b2de1b12bf3c7ae680fbb247e000..98673474a14021dd551ea887f9867e7b40ad4c79 100644 (file)
@@ -20,7 +20,6 @@
  * see Documentation/dvb/README.dibusb for more information
  *
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
index 6e8ad176e1a1468f0bbb3bf197232e850361f0d6..9a354708bd20a24f5dc946e05a1f25972a5899a7 100644 (file)
@@ -216,7 +216,7 @@ static int lgdt330x_init(struct dvb_frontend* fe)
                AGC_DELAY0, 0x07,
                AGC_DELAY2, 0xfe,
                /* Change the value of IAGCBW[15:8]
-                  of inner AGC loop filter bandwith */
+                  of inner AGC loop filter bandwidth */
                AGC_LOOP_BANDWIDTH0, 0x08,
                AGC_LOOP_BANDWIDTH1, 0x9a
        };
index e83ff2104c9b650c2e30a52118b7e291afa581f9..9cbd164aa281dead63829e13503bbef9fd39ebe8 100644 (file)
@@ -21,7 +21,6 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include <linux/config.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index 6bffe85c161cd1b54cbba3758c7402879e079fb6..9b57576bfeb411738495687aa490a3460bfc3f1b 100644 (file)
@@ -18,7 +18,6 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include <linux/config.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index acabea0793b6d08ab7845bad4d9d08fec2212298..2310b2bfed4e539fdd1ec16d148f6dd2eb99b94b 100644 (file)
@@ -616,7 +616,7 @@ static int __devinit pluto2_probe(struct pci_dev *pdev,
 
        pci_set_drvdata(pdev, pluto);
 
-       ret = request_irq(pdev->irq, pluto_irq, SA_SHIRQ, DRIVER_NAME, pluto);
+       ret = request_irq(pdev->irq, pluto_irq, IRQF_SHARED, DRIVER_NAME, pluto);
        if (ret < 0)
                goto err_pci_iounmap;
 
index 7a5c99c200e8e2a33e913c377d0fc89adecd3344..500f15c10aaf93047902c39a9a24b0a8e1c29b5e 100644 (file)
@@ -30,7 +30,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kmod.h>
 #include <linux/delay.h>
index 6163cb03b8f418e9859263be98d668881ad97482..5f111d407730611a661c50b00028f356638efe26 100644 (file)
@@ -1141,6 +1141,15 @@ static void frontend_init(struct budget_av *budget_av)
                break;
 
        case SUBID_DVBC_KNC1:
+               budget_av->reinitialise_demod = 1;
+               fe = tda10021_attach(&philips_cu1216_config,
+                                    &budget_av->budget.i2c_adap,
+                                    read_pwm(budget_av));
+               if (fe) {
+                       fe->ops.tuner_ops.set_params = philips_cu1216_tuner_set_params;
+               }
+               break;
+
        case SUBID_DVBC_KNC1_PLUS:
        case SUBID_DVBC_CINERGY1200:
                budget_av->reinitialise_demod = 1;
@@ -1293,11 +1302,7 @@ static int budget_av_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio
 
        budget_av->budget.dvb_adapter.priv = budget_av;
        frontend_init(budget_av);
-
-       if (!budget_av->has_saa7113) {
-               ciintf_init(budget_av);
-       }
-
+       ciintf_init(budget_av);
        return 0;
 }
 
index 336b2fe1a5f2e13463ba5247bdf41085103ff965..04cef3023457c34ccc7584cec6e83002844ff143 100644 (file)
@@ -43,7 +43,7 @@
     is a bit braindead (no matching channel masks or no matching filter mask),
     we won't support this - yet. it doesn't event support negative filters,
     so the best way is maybe to keep TTUSB_HWSECTIONS undef'd and just
-    parse TS data. USB bandwith will be a problem when having large
+    parse TS data. USB bandwidth will be a problem when having large
     datastreams, especially for dvb-net, but hey, that's not my problem.
 
   TTUSB_DISEQC, TTUSB_TONE:
index 9f249e7e60c9b16d2a0d9b4081d18ea28a478d20..4c82956390c1de098a28c290baba01b698fd0c5c 100644 (file)
@@ -37,7 +37,6 @@
  ***************************************************************************
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/list.h>
 #include <linux/module.h>
index ae14f5f32039cffb00016bc07ab677a340b343a1..5c5e682a30042f0528348219fbd3c4ad754a24f6 100644 (file)
@@ -18,7 +18,6 @@
  * 2003-09-01: Support w3cam by Takeo Takahashi
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/delay.h>
index e68a6d2fff2439a94aa8f2b49e393f0916b0724c..de14818d5cc462815ff503e206c4da1047391abe 100644 (file)
@@ -25,7 +25,6 @@
 
 */
 
-#include <linux/config.h>
 #include <linux/delay.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
@@ -3548,11 +3547,6 @@ void __devinit bttv_init_card2(struct bttv *btv)
        /* Hybrid DVB card, DOES have a tda9887 */
        if (btv->c.type == BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE)
                tda9887 = 1;
-       if((btv->tuner_type == TUNER_PHILIPS_FM1216ME_MK3) ||
-          (btv->tuner_type == TUNER_PHILIPS_FM1236_MK3) ||
-          (btv->tuner_type == TUNER_PHILIPS_FM1256_IH3) ||
-           tda9887)
-               request_module("tda9887");
        if (btv->tuner_type != UNSET)
                request_module("tuner");
 }
index aa3203ae670c94a7333fd6c2ea4561179ab6c676..5764a89d35627db94dd489558bdaf0655d3e1b0f 100644 (file)
@@ -4050,7 +4050,7 @@ static int __devinit bttv_probe(struct pci_dev *dev,
        /* disable irqs, register irq handler */
        btwrite(0, BT848_INT_MASK);
        result = request_irq(btv->c.pci->irq, bttv_irq,
-                            SA_SHIRQ | SA_INTERRUPT,btv->c.name,(void *)btv);
+                            IRQF_SHARED | IRQF_DISABLED,btv->c.name,(void *)btv);
        if (result < 0) {
                printk(KERN_ERR "bttv%d: can't get IRQ %d\n",
                       bttv_num,btv->c.pci->irq);
index d2956010f763c0cb05a58fb21c6fc629086f86dc..311c4c541e01d554f3b396248bdf18419ce99afa 100644 (file)
@@ -360,7 +360,7 @@ struct bttv {
        int mbox_csel;
 
        /* risc memory management data
-          - must aquire s_lock before changing these
+          - must acquire s_lock before changing these
           - only the irq handler is supported to touch top + bottom + vcurr */
        struct btcx_riscmem     main;
        struct bttv_buffer      *screen;    /* overlay             */
index 840fe0177121190275008fbda829019258236972..353d02b67c33014d73a3f5279f9b6ed5c0597a98 100644 (file)
@@ -12,7 +12,6 @@
  * ioctls.
  */
 
-#include <linux/config.h>
 #include <linux/compat.h>
 #include <linux/videodev.h>
 #include <linux/videodev2.h>
index 95c5aceecc5bb9566f64887d805713d4cfc28286..3b31a0dd2f0cde9645f8740753922161130654df 100644 (file)
@@ -26,7 +26,6 @@
 /* define _CPIA_DEBUG_ for verbose debug output (see cpia.h) */
 /* #define _CPIA_DEBUG_  1 */
 
-#include <linux/config.h>
 
 #include <linux/module.h>
 #include <linux/moduleparam.h>
index d129db57fcd4bab57861528b200092326bf86bc4..d09f49950f2a4be2a885bdfd130ab02825b075b1 100644 (file)
@@ -31,7 +31,6 @@
 
 #include <linux/version.h>
 
-#include <linux/config.h>
 
 #include <linux/module.h>
 #include <linux/time.h>
index 4c89bd395d3e6d275d78fda9580d16ed3a427d4a..41f4b8d17559d085eab1f3c6a3bf0f278eb71264 100644 (file)
@@ -25,7 +25,6 @@
 /* define _CPIA_DEBUG_ for verbose debug output (see cpia.h) */
 /* #define _CPIA_DEBUG_  1 */
 
-#include <linux/config.h>
 
 #include <linux/module.h>
 #include <linux/init.h>
index 292a5e81eb75fab5ad9a855f3623dae38b80067b..f0340662e078c9fc931fd6d84e8771ca2b42843f 100644 (file)
@@ -700,7 +700,7 @@ static int __devinit snd_cx88_create(struct snd_card *card,
 
        /* get irq */
        err = request_irq(chip->pci->irq, cx8801_irq,
-                         SA_SHIRQ | SA_INTERRUPT, chip->core->name, chip);
+                         IRQF_SHARED | IRQF_DISABLED, chip->core->name, chip);
        if (err < 0) {
                dprintk(0, "%s: can't get IRQ %d\n",
                       chip->core->name, chip->pci->irq);
index 4ff81582ec56ee5f71b17ec2e402c51730ce4698..349632b48e931a2dff360965703754ba0a3b1d19 100644 (file)
@@ -686,6 +686,39 @@ static struct videobuf_queue_ops blackbird_qops = {
 
 /* ------------------------------------------------------------------ */
 
+static const u32 *ctrl_classes[] = {
+       cx88_user_ctrls,
+       cx2341x_mpeg_ctrls,
+       NULL
+};
+
+static int blackbird_queryctrl(struct cx8802_dev *dev, struct v4l2_queryctrl *qctrl)
+{
+       qctrl->id = v4l2_ctrl_next(ctrl_classes, qctrl->id);
+       if (qctrl->id == 0)
+               return -EINVAL;
+
+       /* Standard V4L2 controls */
+       if (cx8800_ctrl_query(qctrl) == 0)
+               return 0;
+
+       /* MPEG V4L2 controls */
+       if (cx2341x_ctrl_query(&dev->params, qctrl))
+               qctrl->flags |= V4L2_CTRL_FLAG_DISABLED;
+       return 0;
+}
+
+static int blackbird_querymenu(struct cx8802_dev *dev, struct v4l2_querymenu *qmenu)
+{
+       struct v4l2_queryctrl qctrl;
+
+       qctrl.id = qmenu->id;
+       blackbird_queryctrl(dev, &qctrl);
+       return v4l2_ctrl_query_menu(qmenu, &qctrl, cx2341x_ctrl_get_menu(qmenu->id));
+}
+
+/* ------------------------------------------------------------------ */
+
 static int mpeg_do_ioctl(struct inode *inode, struct file *file,
                         unsigned int cmd, void *arg)
 {
@@ -866,6 +899,16 @@ static int mpeg_do_ioctl(struct inode *inode, struct file *file,
                       core->name);
                return 0;
        }
+       case VIDIOC_QUERYMENU:
+               return blackbird_querymenu(dev, arg);
+       case VIDIOC_QUERYCTRL:
+       {
+               struct v4l2_queryctrl *c = arg;
+
+               if (blackbird_queryctrl(dev, c) == 0)
+                       return 0;
+               return cx88_do_ioctl(inode, file, 0, dev->core, cmd, arg, mpeg_do_ioctl);
+       }
 
        default:
                return cx88_do_ioctl(inode, file, 0, dev->core, cmd, arg, mpeg_do_ioctl);
index f9d68f20dc88b87a77bc3c6565fcc9afcfe7936c..14bd4863d157514d526bc61735743cebe214a8e2 100644 (file)
@@ -1194,6 +1194,21 @@ struct cx88_board cx88_boards[] = {
                }},
                .dvb            = 1,
        },
+       [CX88_BOARD_GENIATECH_DVBS] = {
+               .name          = "Geniatech DVB-S",
+               .tuner_type    = TUNER_ABSENT,
+               .radio_type    = UNSET,
+               .tuner_addr    = ADDR_UNSET,
+               .radio_addr    = ADDR_UNSET,
+               .input  = {{
+                       .type  = CX88_VMUX_DVB,
+                       .vmux  = 0,
+               },{
+                       .type  = CX88_VMUX_COMPOSITE1,
+                       .vmux  = 1,
+               }},
+               .dvb      = 1,
+       },
 };
 const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards);
 
@@ -1439,6 +1454,10 @@ struct cx88_subid cx88_subids[] = {
                .subvendor = 0x18ac,
                .subdevice = 0xd800, /* FusionHDTV 3 Gold (original revision) */
                .card      = CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q,
+       },{
+               .subvendor = 0x14f1,
+               .subdevice = 0x0084,
+               .card      = CX88_BOARD_GENIATECH_DVBS,
        },
 };
 const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids);
index dce1feddd55d16f9d6ece0457cd71c47d7a681cb..afde3789d702e2f295cc66a4d953b2c028c9ddce 100644 (file)
@@ -496,6 +496,26 @@ static int kworld_dvbs_100_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t
        return 0;
 }
 
+static int geniatech_dvbs_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
+{
+       struct cx8802_dev *dev= fe->dvb->priv;
+       struct cx88_core *core = dev->core;
+
+       if (voltage == SEC_VOLTAGE_OFF) {
+               dprintk(1,"LNB Voltage OFF\n");
+               cx_write(MO_GP0_IO, 0x0000efff);
+       }
+
+       if (core->prev_set_voltage)
+               return core->prev_set_voltage(fe, voltage);
+       return 0;
+}
+
+static struct cx24123_config geniatech_dvbs_config = {
+       .demod_address  = 0x55,
+       .set_ts_params  = cx24123_set_ts_param,
+};
+
 static struct cx24123_config hauppauge_novas_config = {
        .demod_address          = 0x55,
        .set_ts_params          = cx24123_set_ts_param,
@@ -760,6 +780,14 @@ static int dvb_register(struct cx8802_dev *dev)
                        dev->dvb.frontend->ops.set_voltage = kworld_dvbs_100_set_voltage;
                }
                break;
+       case CX88_BOARD_GENIATECH_DVBS:
+               dev->dvb.frontend = cx24123_attach(&geniatech_dvbs_config,
+                                                  &dev->core->i2c_adap);
+               if (dev->dvb.frontend) {
+                       dev->core->prev_set_voltage = dev->dvb.frontend->ops.set_voltage;
+                       dev->dvb.frontend->ops.set_voltage = geniatech_dvbs_set_voltage;
+               }
+               break;
 #endif
        default:
                printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n",
index 2c12aca1b6a3d69fdf8a2b1f5e91e7cac7856093..138a4f692501786bcda6227baf75a62e20c84120 100644 (file)
@@ -438,7 +438,7 @@ int cx8802_init_common(struct cx8802_dev *dev)
 
        /* get irq */
        err = request_irq(dev->pci->irq, cx8802_irq,
-                         SA_SHIRQ | SA_INTERRUPT, dev->core->name, dev);
+                         IRQF_SHARED | IRQF_DISABLED, dev->core->name, dev);
        if (err < 0) {
                printk(KERN_ERR "%s: can't get IRQ %d\n",
                       dev->core->name, dev->pci->irq);
index 8d5cf474b68e817c9729d40ad3f5745092290d9c..2225d4b94140cb8f9079e751966ef4a3386b31d2 100644 (file)
@@ -327,6 +327,51 @@ static struct cx88_ctrl cx8800_ctls[] = {
 };
 static const int CX8800_CTLS = ARRAY_SIZE(cx8800_ctls);
 
+const u32 cx88_user_ctrls[] = {
+       V4L2_CID_USER_CLASS,
+       V4L2_CID_BRIGHTNESS,
+       V4L2_CID_CONTRAST,
+       V4L2_CID_SATURATION,
+       V4L2_CID_HUE,
+       V4L2_CID_AUDIO_VOLUME,
+       V4L2_CID_AUDIO_BALANCE,
+       V4L2_CID_AUDIO_MUTE,
+       0
+};
+EXPORT_SYMBOL(cx88_user_ctrls);
+
+static const u32 *ctrl_classes[] = {
+       cx88_user_ctrls,
+       NULL
+};
+
+int cx8800_ctrl_query(struct v4l2_queryctrl *qctrl)
+{
+       int i;
+
+       if (qctrl->id < V4L2_CID_BASE ||
+           qctrl->id >= V4L2_CID_LASTP1)
+               return -EINVAL;
+       for (i = 0; i < CX8800_CTLS; i++)
+               if (cx8800_ctls[i].v.id == qctrl->id)
+                       break;
+       if (i == CX8800_CTLS) {
+               *qctrl = no_ctl;
+               return 0;
+       }
+       *qctrl = cx8800_ctls[i].v;
+       return 0;
+}
+EXPORT_SYMBOL(cx8800_ctrl_query);
+
+static int cx88_queryctrl(struct v4l2_queryctrl *qctrl)
+{
+       qctrl->id = v4l2_ctrl_next(ctrl_classes, qctrl->id);
+       if (qctrl->id == 0)
+               return -EINVAL;
+       return cx8800_ctrl_query(qctrl);
+}
+
 /* ------------------------------------------------------------------- */
 /* resource management                                                 */
 
@@ -1362,20 +1407,8 @@ int cx88_do_ioctl(struct inode *inode, struct file *file, int radio,
        case VIDIOC_QUERYCTRL:
        {
                struct v4l2_queryctrl *c = arg;
-               int i;
 
-               if (c->id <  V4L2_CID_BASE ||
-                   c->id >= V4L2_CID_LASTP1)
-                       return -EINVAL;
-               for (i = 0; i < CX8800_CTLS; i++)
-                       if (cx8800_ctls[i].v.id == c->id)
-                               break;
-               if (i == CX8800_CTLS) {
-                       *c = no_ctl;
-                       return 0;
-               }
-               *c = cx8800_ctls[i].v;
-               return 0;
+               return cx88_queryctrl(c);
        }
        case VIDIOC_G_CTRL:
                return get_control(core,arg);
@@ -1882,7 +1915,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
 
        /* get irq */
        err = request_irq(pci_dev->irq, cx8800_irq,
-                         SA_SHIRQ | SA_INTERRUPT, core->name, dev);
+                         IRQF_SHARED | IRQF_DISABLED, core->name, dev);
        if (err < 0) {
                printk(KERN_ERR "%s: can't get IRQ %d\n",
                       core->name,pci_dev->irq);
@@ -1893,8 +1926,6 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
        /* load and configure helper modules */
        if (TUNER_ABSENT != core->tuner_type)
                request_module("tuner");
-       if (core->tda9887_conf)
-               request_module("tda9887");
 
        /* register v4l devices */
        dev->video_dev = cx88_vdev_init(core,dev->pci,
index 9a9a0fc7a41ad26a6df000c15e3a053033cdf749..e7810955dd4f845c803e954de86644eab40f4d73 100644 (file)
@@ -196,6 +196,7 @@ extern struct sram_channel cx88_sram_channels[];
 #define CX88_BOARD_PIXELVIEW_PLAYTV_P7000  49
 #define CX88_BOARD_NPGTECH_REALTV_TOP10FM  50
 #define CX88_BOARD_WINFAST_DTV2000H        51
+#define CX88_BOARD_GENIATECH_DVBS          52
 
 enum cx88_itype {
        CX88_VMUX_COMPOSITE1 = 1,
@@ -590,6 +591,8 @@ int cx8802_resume_common(struct pci_dev *pci_dev);
 extern int cx88_do_ioctl(struct inode *inode, struct file *file, int radio,
                                struct cx88_core *core, unsigned int cmd,
                                void *arg, v4l2_kioctl driver_ioctl);
+extern const u32 cx88_user_ctrls[];
+extern int cx8800_ctrl_query(struct v4l2_queryctrl *qctrl);
 
 /*
  * Local variables:
index 9286090817cd2d564d97a100fd8ceeb99789e4fe..2a461dde480c89c0dcf339920861764a709c89f9 100644 (file)
@@ -1574,8 +1574,6 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev,
                request_module("tvp5150");
        if (dev->has_tuner)
                request_module("tuner");
-       if (dev->tda9887_conf)
-               request_module("tda9887");
 #endif
        errCode = em28xx_config(dev);
        if (errCode) {
index f68ca7d9f5319b28a34e47e834022b6ea2a970c3..e278753f8f25ad805fff678e32d21673d3bff674 100644 (file)
@@ -26,7 +26,6 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/sched.h>
@@ -1882,7 +1881,7 @@ static int __devinit meye_probe(struct pci_dev *pcidev,
 
        meye.mchip_irq = pcidev->irq;
        if (request_irq(meye.mchip_irq, meye_irq,
-                       SA_INTERRUPT | SA_SHIRQ, "meye", meye_irq)) {
+                       IRQF_DISABLED | IRQF_SHARED, "meye", meye_irq)) {
                printk(KERN_ERR "meye: request_irq failed\n");
                goto outreqirq;
        }
index 0d09a0e3803c5cdfd5c4e6f911573cdae41b29a1..ea107cb5c845baf46b928bf880e1b54944257077 100644 (file)
@@ -36,7 +36,6 @@
 #define MEYE_DRIVER_VERSION __stringify(MEYE_DRIVER_MAJORVERSION) "." \
                            __stringify(MEYE_DRIVER_MINORVERSION)
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/pci.h>
 #include <linux/kfifo.h>
index 4e451049013de8d87a0f20a8eb27ec8456dfe8bf..545e4ac094f2e2dd513a275a8a730db4fdbe83bb 100644 (file)
@@ -90,8 +90,8 @@ struct msp_state {
        /* thread */
        struct task_struct   *kthread;
        wait_queue_head_t    wq;
-       int                  restart:1;
-       int                  watch_stereo:1;
+       unsigned int         restart:1;
+       unsigned int         watch_stereo:1;
 };
 
 /* msp3400-driver.c */
index a988df226aabc3aa4c709c322735c33156067dcd..1b07a61c2ebb7dd98854e7d40dcea077189868cb 100644 (file)
@@ -35,7 +35,6 @@
  * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/vmalloc.h>
index fed603ad0a6721b1a39ced19bab569ca4e1c2764..02e414210dac4ab61be1baa43558c5fc32610bd8 100644 (file)
@@ -8,7 +8,7 @@ obj-pvrusb2-24xxx-$(CONFIG_VIDEO_PVRUSB2_24XXX) := \
 pvrusb2-objs   := pvrusb2-i2c-core.o pvrusb2-i2c-cmd-v4l2.o \
                   pvrusb2-audio.o pvrusb2-i2c-chips-v4l2.o \
                   pvrusb2-encoder.o pvrusb2-video-v4l.o \
-                  pvrusb2-eeprom.o pvrusb2-tuner.o pvrusb2-demod.o \
+                  pvrusb2-eeprom.o pvrusb2-tuner.o \
                   pvrusb2-main.o pvrusb2-hdw.o pvrusb2-v4l2.o \
                   pvrusb2-ctrl.o pvrusb2-std.o \
                   pvrusb2-context.o pvrusb2-io.o pvrusb2-ioread.o \
index 313d2dcf9e4bfbd90c04e5f2cd573385ce6ca25f..9846c464ec801d02be993f2955edbfb0cd405894 100644 (file)
@@ -145,8 +145,8 @@ static int get_audio_status(struct pvr2_msp3400_handler *ctxt)
 
 static void pvr2_msp3400_detach(struct pvr2_msp3400_handler *ctxt)
 {
-       ctxt->client->handler = 0;
-       ctxt->hdw->audio_stat = 0;
+       ctxt->client->handler = NULL;
+       ctxt->hdw->audio_stat = NULL;
        kfree(ctxt);
 }
 
index 40dc59871a458e298ed54a45d6cf033c09116e08..f129f316d20eb42484ed84ffd67e2544dd5e9887 100644 (file)
@@ -77,7 +77,7 @@ struct pvr2_context *pvr2_context_create(
        const struct usb_device_id *devid,
        void (*setup_func)(struct pvr2_context *))
 {
-       struct pvr2_context *mp = 0;
+       struct pvr2_context *mp = NULL;
        mp = kmalloc(sizeof(*mp),GFP_KERNEL);
        if (!mp) goto done;
        memset(mp,0,sizeof(*mp));
@@ -87,7 +87,7 @@ struct pvr2_context *pvr2_context_create(
        mp->hdw = pvr2_hdw_create(intf,devid);
        if (!mp->hdw) {
                pvr2_context_destroy(mp);
-               mp = 0;
+               mp = NULL;
                goto done;
        }
 
@@ -145,7 +145,7 @@ void pvr2_channel_init(struct pvr2_channel *cp,struct pvr2_context *mp)
 {
        cp->hdw = mp->hdw;
        cp->mc_head = mp;
-       cp->mc_next = 0;
+       cp->mc_next = NULL;
        cp->mc_prev = mp->mc_last;
        if (mp->mc_last) {
                mp->mc_last->mc_next = cp;
@@ -160,8 +160,8 @@ static void pvr2_channel_disclaim_stream(struct pvr2_channel *cp)
 {
        if (!cp->stream) return;
        pvr2_stream_kill(cp->stream->stream);
-       cp->stream->user = 0;
-       cp->stream = 0;
+       cp->stream->user = NULL;
+       cp->stream = NULL;
 }
 
 
@@ -179,7 +179,7 @@ void pvr2_channel_done(struct pvr2_channel *cp)
        } else {
                mp->mc_first = cp->mc_next;
        }
-       cp->hdw = 0;
+       cp->hdw = NULL;
 }
 
 
@@ -212,7 +212,7 @@ struct pvr2_ioread *pvr2_channel_create_mpeg_stream(
 {
        struct pvr2_ioread *cp;
        cp = pvr2_ioread_create();
-       if (!cp) return 0;
+       if (!cp) return NULL;
        pvr2_ioread_setup(cp,sp->stream);
        pvr2_ioread_set_sync_key(cp,stream_sync_key,sizeof(stream_sync_key));
        return cp;
index d5df9fbeba2ff46b97d6929416984d41fabf0c8a..fb6198f1df98629dbb04d14eeb643838300c8041 100644 (file)
@@ -158,7 +158,7 @@ int pvr2_ctrl_get_mask(struct pvr2_ctrl *cptr)
 /* Retrieve the control's name */
 const char *pvr2_ctrl_get_name(struct pvr2_ctrl *cptr)
 {
-       if (!cptr) return 0;
+       if (!cptr) return NULL;
        return cptr->info->name;
 }
 
@@ -166,7 +166,7 @@ const char *pvr2_ctrl_get_name(struct pvr2_ctrl *cptr)
 /* Retrieve the control's desc */
 const char *pvr2_ctrl_get_desc(struct pvr2_ctrl *cptr)
 {
-       if (!cptr) return 0;
+       if (!cptr) return NULL;
        return cptr->info->desc;
 }
 
@@ -488,7 +488,7 @@ int pvr2_ctrl_sym_to_value(struct pvr2_ctrl *cptr,
 
        LOCK_TAKE(cptr->hdw->big_lock); do {
                if (cptr->info->type == pvr2_ctl_int) {
-                       ret = parse_token(ptr,len,valptr,0,0);
+                       ret = parse_token(ptr,len,valptr,NULL,0);
                        if ((ret >= 0) &&
                            ((*valptr < cptr->info->def.type_int.min_value) ||
                             (*valptr > cptr->info->def.type_int.max_value))) {
index 27eadaff75a0eeb052769db0ef55abf940b084a0..c80c26be6e4d31dd048964525184d676cc96bf0d 100644 (file)
@@ -139,8 +139,8 @@ static const struct pvr2_v4l_cx2584x_ops decoder_ops[] = {
 
 static void decoder_detach(struct pvr2_v4l_cx2584x *ctxt)
 {
-       ctxt->client->handler = 0;
-       ctxt->hdw->decoder_ctrl = 0;
+       ctxt->client->handler = NULL;
+       ctxt->hdw->decoder_ctrl = NULL;
        kfree(ctxt);
 }
 
@@ -221,7 +221,7 @@ static unsigned int decoder_describe(struct pvr2_v4l_cx2584x *ctxt,
 static void decoder_reset(struct pvr2_v4l_cx2584x *ctxt)
 {
        int ret;
-       ret = pvr2_i2c_client_cmd(ctxt->client,VIDIOC_INT_RESET,0);
+       ret = pvr2_i2c_client_cmd(ctxt->client,VIDIOC_INT_RESET,NULL);
        pvr2_trace(PVR2_TRACE_CHIPS,"i2c cx25840 decoder_reset (ret=%d)",ret);
 }
 
index 586900e365ff2eaac9062028b8347efbb81dfc19..f985f00d885ad5914e80d16be6a5fd60252b287a 100644 (file)
@@ -82,7 +82,7 @@ static unsigned int debugifc_isolate_word(const char *buf,unsigned int count,
        unsigned int wlen;
        unsigned int scnt;
 
-       wptr = 0;
+       wptr = NULL;
        wlen = 0;
        scnt = debugifc_count_whitespace(buf,count);
        consume_cnt += scnt; count -= scnt; buf += scnt;
@@ -337,8 +337,8 @@ int pvr2_debugifc_print_status(struct pvr2_hdw *hdw,
 }
 
 
-int pvr2_debugifc_do1cmd(struct pvr2_hdw *hdw,const char *buf,
-                        unsigned int count)
+static int pvr2_debugifc_do1cmd(struct pvr2_hdw *hdw,const char *buf,
+                               unsigned int count)
 {
        const char *wptr;
        unsigned int wlen;
diff --git a/drivers/media/video/pvrusb2/pvrusb2-demod.c b/drivers/media/video/pvrusb2/pvrusb2-demod.c
deleted file mode 100644 (file)
index 9686569..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- *
- *  $Id$
- *
- *  Copyright (C) 2005 Mike Isely <isely@pobox.com>
- *  Copyright (C) 2004 Aurelien Alleaume <slts@free.fr>
- *
- *  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
- *
- *  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 "pvrusb2.h"
-#include "pvrusb2-util.h"
-#include "pvrusb2-demod.h"
-#include "pvrusb2-hdw-internal.h"
-#include "pvrusb2-debug.h"
-#include <linux/videodev2.h>
-#include <media/tuner.h>
-#include <media/v4l2-common.h>
-
-
-struct pvr2_demod_handler {
-       struct pvr2_hdw *hdw;
-       struct pvr2_i2c_client *client;
-       struct pvr2_i2c_handler i2c_handler;
-       int type_update_fl;
-};
-
-
-static void set_config(struct pvr2_demod_handler *ctxt)
-{
-       struct pvr2_hdw *hdw = ctxt->hdw;
-       int cfg = 0;
-
-       switch (hdw->tuner_type) {
-       case TUNER_PHILIPS_FM1216ME_MK3:
-       case TUNER_PHILIPS_FM1236_MK3:
-               cfg = TDA9887_PORT1_ACTIVE|TDA9887_PORT2_ACTIVE;
-               break;
-       default:
-               break;
-       }
-       pvr2_trace(PVR2_TRACE_CHIPS,"i2c demod set_config(0x%x)",cfg);
-       pvr2_i2c_client_cmd(ctxt->client,TDA9887_SET_CONFIG,&cfg);
-       ctxt->type_update_fl = 0;
-}
-
-
-static int demod_check(struct pvr2_demod_handler *ctxt)
-{
-       struct pvr2_hdw *hdw = ctxt->hdw;
-       if (hdw->tuner_updated) ctxt->type_update_fl = !0;
-       return ctxt->type_update_fl != 0;
-}
-
-
-static void demod_update(struct pvr2_demod_handler *ctxt)
-{
-       if (ctxt->type_update_fl) set_config(ctxt);
-}
-
-
-static void demod_detach(struct pvr2_demod_handler *ctxt)
-{
-       ctxt->client->handler = 0;
-       kfree(ctxt);
-}
-
-
-static unsigned int demod_describe(struct pvr2_demod_handler *ctxt,char *buf,unsigned int cnt)
-{
-       return scnprintf(buf,cnt,"handler: pvrusb2-demod");
-}
-
-
-const static struct pvr2_i2c_handler_functions tuner_funcs = {
-       .detach = (void (*)(void *))demod_detach,
-       .check = (int (*)(void *))demod_check,
-       .update = (void (*)(void *))demod_update,
-       .describe = (unsigned int (*)(void *,char *,unsigned int))demod_describe,
-};
-
-
-int pvr2_i2c_demod_setup(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp)
-{
-       struct pvr2_demod_handler *ctxt;
-       if (cp->handler) return 0;
-
-       ctxt = kmalloc(sizeof(*ctxt),GFP_KERNEL);
-       if (!ctxt) return 0;
-       memset(ctxt,0,sizeof(*ctxt));
-
-       ctxt->i2c_handler.func_data = ctxt;
-       ctxt->i2c_handler.func_table = &tuner_funcs;
-       ctxt->type_update_fl = !0;
-       ctxt->client = cp;
-       ctxt->hdw = hdw;
-       cp->handler = &ctxt->i2c_handler;
-       pvr2_trace(PVR2_TRACE_CHIPS,"i2c 0x%x tda9887 V4L2 handler set up",
-                  cp->client->addr);
-       return !0;
-}
-
-
-
-
-/*
-  Stuff for Emacs to see, in order to encourage consistent editing style:
-  *** Local Variables: ***
-  *** mode: c ***
-  *** fill-column: 70 ***
-  *** tab-width: 8 ***
-  *** c-basic-offset: 8 ***
-  *** End: ***
-  */
diff --git a/drivers/media/video/pvrusb2/pvrusb2-demod.h b/drivers/media/video/pvrusb2/pvrusb2-demod.h
deleted file mode 100644 (file)
index 4c4e40f..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *
- *  $Id$
- *
- *  Copyright (C) 2005 Mike Isely <isely@pobox.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
- *
- *  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
- *
- */
-#ifndef __PVRUSB2_DEMOD_H
-#define __PVRUSB2_DEMOD_H
-
-#include "pvrusb2-i2c-core.h"
-
-int pvr2_i2c_demod_setup(struct pvr2_hdw *,struct pvr2_i2c_client *);
-
-#endif /* __PVRUSB2_DEMOD_H */
-
-/*
-  Stuff for Emacs to see, in order to encourage consistent editing style:
-  *** Local Variables: ***
-  *** mode: c ***
-  *** fill-column: 70 ***
-  *** tab-width: 8 ***
-  *** c-basic-offset: 8 ***
-  *** End: ***
-  */
index 94d383ff98897f4032ae1f2c1d5af5cff2192d3c..6cff8e75f4264bde5e471a02836c80b4ce2f0cae 100644 (file)
@@ -58,7 +58,7 @@ static u8 *pvr2_eeprom_fetch(struct pvr2_hdw *hdw)
                pvr2_trace(PVR2_TRACE_ERROR_LEGS,
                           "Failed to allocate memory"
                           " required to read eeprom");
-               return 0;
+               return NULL;
        }
 
        trace_eeprom("Value for eeprom addr from controller was 0x%x",
@@ -108,7 +108,7 @@ static u8 *pvr2_eeprom_fetch(struct pvr2_hdw *hdw)
                        pvr2_trace(PVR2_TRACE_ERROR_LEGS,
                                   "eeprom fetch set offs err=%d",ret);
                        kfree(eeprom);
-                       return 0;
+                       return NULL;
                }
        }
        return eeprom;
index 2cc31695b435cadfc9053a0e4d97a77d5274e217..18a7073501c6037fd845dfdf414d70cee51aefbc 100644 (file)
@@ -65,7 +65,7 @@ static int pvr2_encoder_write_words(struct pvr2_hdw *hdw,
                }
                ret = pvr2_send_request(hdw,
                                        hdw->cmd_buffer,1+(chunkCnt*7),
-                                       0,0);
+                                       NULL,0);
                if (ret) return ret;
                data += chunkCnt;
                dlen -= chunkCnt;
@@ -322,7 +322,7 @@ int pvr2_encoder_configure(struct pvr2_hdw *hdw)
        }
 
        ret = cx2341x_update(hdw,pvr2_encoder_cmd,
-                            (hdw->enc_cur_valid ? &hdw->enc_cur_state : 0),
+                            (hdw->enc_cur_valid ? &hdw->enc_cur_state : NULL),
                             &hdw->enc_ctl_state);
        if (ret) {
                pvr2_trace(PVR2_TRACE_ERROR_LEGS,
index ba2afbfe32c5b95de7b2aa55d233728c3d43c7ea..0d6dc33ca32046db2e34cd6aef0f7502af2af968 100644 (file)
@@ -354,23 +354,6 @@ struct pvr2_hdw {
        unsigned int control_cnt;
 };
 
-int pvr2_hdw_commit_ctl_internal(struct pvr2_hdw *hdw);
-
-unsigned int pvr2_hdw_get_signal_status_internal(struct pvr2_hdw *);
-
-void pvr2_hdw_subsys_bit_chg_no_lock(struct pvr2_hdw *hdw,
-                                    unsigned long msk,unsigned long val);
-void pvr2_hdw_subsys_stream_bit_chg_no_lock(struct pvr2_hdw *hdw,
-                                           unsigned long msk,
-                                           unsigned long val);
-
-void pvr2_hdw_internal_find_stdenum(struct pvr2_hdw *hdw);
-void pvr2_hdw_internal_set_std_avail(struct pvr2_hdw *hdw);
-
-int pvr2_i2c_basic_op(struct pvr2_hdw *,u8 i2c_addr,
-                     u8 *wdata,u16 wlen,
-                     u8 *rdata,u16 rlen);
-
 #endif /* __PVRUSB2_HDW_INTERNAL_H */
 
 /*
index 643c471375da1233c9a427d78490664630f80a5a..9b48abcf60897a84e6af0202bcfb3de9beb5359a 100644 (file)
@@ -63,7 +63,6 @@ struct pvr2_string_table {
 static const char *pvr2_client_24xxx[] = {
        "cx25840",
        "tuner",
-       "tda9887",
        "wm8775",
 };
 #endif
@@ -73,7 +72,6 @@ static const char *pvr2_client_29xxx[] = {
        "msp3400",
        "saa7115",
        "tuner",
-       "tda9887",
 };
 
 static struct pvr2_string_table pvr2_client_lists[] = {
@@ -89,8 +87,8 @@ static struct pvr2_string_table pvr2_client_lists[] = {
 #endif
 };
 
-static struct pvr2_hdw *unit_pointers[PVR_NUM] = {[ 0 ... PVR_NUM-1 ] = 0};
-DECLARE_MUTEX(pvr2_unit_sem);
+static struct pvr2_hdw *unit_pointers[PVR_NUM] = {[ 0 ... PVR_NUM-1 ] = NULL};
+static DECLARE_MUTEX(pvr2_unit_sem);
 
 static int ctlchg = 0;
 static int initusbreset = 1;
@@ -263,6 +261,25 @@ static const char *control_values_subsystem[] = {
        [PVR2_SUBSYS_B_ENC_RUN] = "enc_run",
 };
 
+static int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl);
+static int pvr2_hdw_commit_ctl_internal(struct pvr2_hdw *hdw);
+static int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw);
+static unsigned int pvr2_hdw_get_signal_status_internal(struct pvr2_hdw *hdw);
+static void pvr2_hdw_internal_find_stdenum(struct pvr2_hdw *hdw);
+static void pvr2_hdw_internal_set_std_avail(struct pvr2_hdw *hdw);
+static void pvr2_hdw_render_useless_unlocked(struct pvr2_hdw *hdw);
+static void pvr2_hdw_subsys_bit_chg_no_lock(struct pvr2_hdw *hdw,
+                                           unsigned long msk,
+                                           unsigned long val);
+static void pvr2_hdw_subsys_stream_bit_chg_no_lock(struct pvr2_hdw *hdw,
+                                                  unsigned long msk,
+                                                  unsigned long val);
+static int pvr2_send_request_ex(struct pvr2_hdw *hdw,
+                               unsigned int timeout,int probe_fl,
+                               void *write_data,unsigned int write_len,
+                               void *read_data,unsigned int read_len);
+static int pvr2_write_u16(struct pvr2_hdw *hdw, u16 data, int res);
+static int pvr2_write_u8(struct pvr2_hdw *hdw, u8 data, int res);
 
 static int ctrl_channelfreq_get(struct pvr2_ctrl *cptr,int *vp)
 {
@@ -405,7 +422,7 @@ static unsigned int ctrl_cx2341x_getv4lflags(struct pvr2_ctrl *cptr)
        info = (struct pvr2_ctl_info *)(cptr->info);
        if (qctrl.flags & V4L2_CTRL_FLAG_READ_ONLY) {
                if (info->set_value) {
-                       info->set_value = 0;
+                       info->set_value = NULL;
                }
        } else {
                if (!(info->set_value)) {
@@ -836,14 +853,6 @@ unsigned long pvr2_hdw_get_sn(struct pvr2_hdw *hdw)
 }
 
 
-struct pvr2_hdw *pvr2_hdw_find(int unit_number)
-{
-       if (unit_number < 0) return 0;
-       if (unit_number >= PVR_NUM) return 0;
-       return unit_pointers[unit_number];
-}
-
-
 int pvr2_hdw_get_unit_number(struct pvr2_hdw *hdw)
 {
        return hdw->unit_number;
@@ -917,9 +926,9 @@ static int pvr2_locate_firmware(struct pvr2_hdw *hdw,
  * is not suitable for an usb transaction.
  *
  */
-int pvr2_upload_firmware1(struct pvr2_hdw *hdw)
+static int pvr2_upload_firmware1(struct pvr2_hdw *hdw)
 {
-       const struct firmware *fw_entry = 0;
+       const struct firmware *fw_entry = NULL;
        void  *fw_ptr;
        unsigned int pipe;
        int ret;
@@ -1015,7 +1024,7 @@ int pvr2_upload_firmware1(struct pvr2_hdw *hdw)
 
 int pvr2_upload_firmware2(struct pvr2_hdw *hdw)
 {
-       const struct firmware *fw_entry = 0;
+       const struct firmware *fw_entry = NULL;
        void  *fw_ptr;
        unsigned int pipe, fw_len, fw_done;
        int actual_length;
@@ -1166,8 +1175,9 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw)
   reconfigure and start over.
 
 */
-void pvr2_hdw_subsys_bit_chg_no_lock(struct pvr2_hdw *hdw,
-                                    unsigned long msk,unsigned long val)
+static void pvr2_hdw_subsys_bit_chg_no_lock(struct pvr2_hdw *hdw,
+                                           unsigned long msk,
+                                           unsigned long val)
 {
        unsigned long nmsk;
        unsigned long vmsk;
@@ -1318,18 +1328,6 @@ void pvr2_hdw_subsys_bit_chg(struct pvr2_hdw *hdw,
 }
 
 
-void pvr2_hdw_subsys_bit_set(struct pvr2_hdw *hdw,unsigned long msk)
-{
-       pvr2_hdw_subsys_bit_chg(hdw,msk,msk);
-}
-
-
-void pvr2_hdw_subsys_bit_clr(struct pvr2_hdw *hdw,unsigned long msk)
-{
-       pvr2_hdw_subsys_bit_chg(hdw,msk,0);
-}
-
-
 unsigned long pvr2_hdw_subsys_get(struct pvr2_hdw *hdw)
 {
        return hdw->subsys_enabled_mask;
@@ -1342,9 +1340,9 @@ unsigned long pvr2_hdw_subsys_stream_get(struct pvr2_hdw *hdw)
 }
 
 
-void pvr2_hdw_subsys_stream_bit_chg_no_lock(struct pvr2_hdw *hdw,
-                                           unsigned long msk,
-                                           unsigned long val)
+static void pvr2_hdw_subsys_stream_bit_chg_no_lock(struct pvr2_hdw *hdw,
+                                                  unsigned long msk,
+                                                  unsigned long val)
 {
        unsigned long val2;
        msk &= PVR2_SUBSYS_ALL;
@@ -1366,7 +1364,7 @@ void pvr2_hdw_subsys_stream_bit_chg(struct pvr2_hdw *hdw,
 }
 
 
-int pvr2_hdw_set_streaming_no_lock(struct pvr2_hdw *hdw,int enableFl)
+static int pvr2_hdw_set_streaming_no_lock(struct pvr2_hdw *hdw,int enableFl)
 {
        if ((!enableFl) == !(hdw->flag_streaming_enabled)) return 0;
        if (enableFl) {
@@ -1400,8 +1398,8 @@ int pvr2_hdw_set_streaming(struct pvr2_hdw *hdw,int enable_flag)
 }
 
 
-int pvr2_hdw_set_stream_type_no_lock(struct pvr2_hdw *hdw,
-                                    enum pvr2_config config)
+static int pvr2_hdw_set_stream_type_no_lock(struct pvr2_hdw *hdw,
+                                           enum pvr2_config config)
 {
        unsigned long sm = hdw->subsys_enabled_mask;
        if (!hdw->flag_ok) return -EIO;
@@ -1741,7 +1739,7 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf,
            sizeof(pvr2_device_names)/sizeof(pvr2_device_names[0])) {
                pvr2_trace(PVR2_TRACE_ERROR_LEGS,
                           "Bogus device type of %u reported",hdw_type);
-               return 0;
+               return NULL;
        }
 
        hdw = kmalloc(sizeof(*hdw),GFP_KERNEL);
@@ -1922,38 +1920,38 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf,
                if (hdw->mpeg_ctrl_info) kfree(hdw->mpeg_ctrl_info);
                kfree(hdw);
        }
-       return 0;
+       return NULL;
 }
 
 
 /* Remove _all_ associations between this driver and the underlying USB
    layer. */
-void pvr2_hdw_remove_usb_stuff(struct pvr2_hdw *hdw)
+static void pvr2_hdw_remove_usb_stuff(struct pvr2_hdw *hdw)
 {
        if (hdw->flag_disconnected) return;
        pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_remove_usb_stuff: hdw=%p",hdw);
        if (hdw->ctl_read_urb) {
                usb_kill_urb(hdw->ctl_read_urb);
                usb_free_urb(hdw->ctl_read_urb);
-               hdw->ctl_read_urb = 0;
+               hdw->ctl_read_urb = NULL;
        }
        if (hdw->ctl_write_urb) {
                usb_kill_urb(hdw->ctl_write_urb);
                usb_free_urb(hdw->ctl_write_urb);
-               hdw->ctl_write_urb = 0;
+               hdw->ctl_write_urb = NULL;
        }
        if (hdw->ctl_read_buffer) {
                kfree(hdw->ctl_read_buffer);
-               hdw->ctl_read_buffer = 0;
+               hdw->ctl_read_buffer = NULL;
        }
        if (hdw->ctl_write_buffer) {
                kfree(hdw->ctl_write_buffer);
-               hdw->ctl_write_buffer = 0;
+               hdw->ctl_write_buffer = NULL;
        }
        pvr2_hdw_render_useless_unlocked(hdw);
        hdw->flag_disconnected = !0;
-       hdw->usb_dev = 0;
-       hdw->usb_intf = 0;
+       hdw->usb_dev = NULL;
+       hdw->usb_intf = NULL;
 }
 
 
@@ -1963,11 +1961,11 @@ void pvr2_hdw_destroy(struct pvr2_hdw *hdw)
        pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_destroy: hdw=%p",hdw);
        if (hdw->fw_buffer) {
                kfree(hdw->fw_buffer);
-               hdw->fw_buffer = 0;
+               hdw->fw_buffer = NULL;
        }
        if (hdw->vid_stream) {
                pvr2_stream_destroy(hdw->vid_stream);
-               hdw->vid_stream = 0;
+               hdw->vid_stream = NULL;
        }
        if (hdw->audio_stat) {
                hdw->audio_stat->detach(hdw->audio_stat->ctxt);
@@ -1981,7 +1979,7 @@ void pvr2_hdw_destroy(struct pvr2_hdw *hdw)
                if ((hdw->unit_number >= 0) &&
                    (hdw->unit_number < PVR_NUM) &&
                    (unit_pointers[hdw->unit_number] == hdw)) {
-                       unit_pointers[hdw->unit_number] = 0;
+                       unit_pointers[hdw->unit_number] = NULL;
                }
        } while (0); up(&pvr2_unit_sem);
        if (hdw->controls) kfree(hdw->controls);
@@ -2018,7 +2016,7 @@ void pvr2_hdw_disconnect(struct pvr2_hdw *hdw)
 
 // Attempt to autoselect an appropriate value for std_enum_cur given
 // whatever is currently in std_mask_cur
-void pvr2_hdw_internal_find_stdenum(struct pvr2_hdw *hdw)
+static void pvr2_hdw_internal_find_stdenum(struct pvr2_hdw *hdw)
 {
        unsigned int idx;
        for (idx = 1; idx < hdw->std_enum_cnt; idx++) {
@@ -2033,7 +2031,7 @@ void pvr2_hdw_internal_find_stdenum(struct pvr2_hdw *hdw)
 
 // Calculate correct set of enumerated standards based on currently known
 // set of available standards bits.
-void pvr2_hdw_internal_set_std_avail(struct pvr2_hdw *hdw)
+static void pvr2_hdw_internal_set_std_avail(struct pvr2_hdw *hdw)
 {
        struct v4l2_standard *newstd;
        unsigned int std_cnt;
@@ -2043,12 +2041,12 @@ void pvr2_hdw_internal_set_std_avail(struct pvr2_hdw *hdw)
 
        if (hdw->std_defs) {
                kfree(hdw->std_defs);
-               hdw->std_defs = 0;
+               hdw->std_defs = NULL;
        }
        hdw->std_enum_cnt = 0;
        if (hdw->std_enum_names) {
                kfree(hdw->std_enum_names);
-               hdw->std_enum_names = 0;
+               hdw->std_enum_names = NULL;
        }
 
        if (!std_cnt) {
@@ -2099,7 +2097,7 @@ unsigned int pvr2_hdw_get_ctrl_count(struct pvr2_hdw *hdw)
 struct pvr2_ctrl *pvr2_hdw_get_ctrl_by_index(struct pvr2_hdw *hdw,
                                             unsigned int idx)
 {
-       if (idx >= hdw->control_cnt) return 0;
+       if (idx >= hdw->control_cnt) return NULL;
        return hdw->controls + idx;
 }
 
@@ -2118,7 +2116,7 @@ struct pvr2_ctrl *pvr2_hdw_get_ctrl_by_id(struct pvr2_hdw *hdw,
                i = cptr->info->internal_id;
                if (i && (i == ctl_id)) return cptr;
        }
-       return 0;
+       return NULL;
 }
 
 
@@ -2135,7 +2133,7 @@ struct pvr2_ctrl *pvr2_hdw_get_ctrl_v4l(struct pvr2_hdw *hdw,unsigned int ctl_id
                i = cptr->info->v4l_id;
                if (i && (i == ctl_id)) return cptr;
        }
-       return 0;
+       return NULL;
 }
 
 
@@ -2149,7 +2147,7 @@ struct pvr2_ctrl *pvr2_hdw_get_ctrl_nextv4l(struct pvr2_hdw *hdw,
        int i;
 
        /* This could be made a lot more efficient, but for now... */
-       cp2 = 0;
+       cp2 = NULL;
        for (idx = 0; idx < hdw->control_cnt; idx++) {
                cptr = hdw->controls + idx;
                i = cptr->info->v4l_id;
@@ -2159,7 +2157,7 @@ struct pvr2_ctrl *pvr2_hdw_get_ctrl_nextv4l(struct pvr2_hdw *hdw,
                cp2 = cptr;
        }
        return cp2;
-       return 0;
+       return NULL;
 }
 
 
@@ -2182,7 +2180,7 @@ static const char *get_ctrl_typename(enum pvr2_ctl_type tp)
    state(s) back to their previous value before this function was called.
    Thus we can automatically reconfigure affected pieces of the driver as
    controls are changed. */
-int pvr2_hdw_commit_ctl_internal(struct pvr2_hdw *hdw)
+static int pvr2_hdw_commit_ctl_internal(struct pvr2_hdw *hdw)
 {
        unsigned long saved_subsys_mask = hdw->subsys_enabled_mask;
        unsigned long stale_subsys_mask = 0;
@@ -2321,14 +2319,6 @@ void pvr2_hdw_poll_trigger_unlocked(struct pvr2_hdw *hdw)
 }
 
 
-void pvr2_hdw_poll_trigger(struct pvr2_hdw *hdw)
-{
-       LOCK_TAKE(hdw->big_lock); do {
-               pvr2_hdw_poll_trigger_unlocked(hdw);
-       } while (0); LOCK_GIVE(hdw->big_lock);
-}
-
-
 /* Return name for this driver instance */
 const char *pvr2_hdw_get_driver_name(struct pvr2_hdw *hdw)
 {
@@ -2337,7 +2327,7 @@ const char *pvr2_hdw_get_driver_name(struct pvr2_hdw *hdw)
 
 
 /* Return bit mask indicating signal status */
-unsigned int pvr2_hdw_get_signal_status_internal(struct pvr2_hdw *hdw)
+static unsigned int pvr2_hdw_get_signal_status_internal(struct pvr2_hdw *hdw)
 {
        unsigned int msk = 0;
        switch (hdw->input_val) {
@@ -2424,7 +2414,7 @@ void pvr2_hdw_cpufw_set_enabled(struct pvr2_hdw *hdw, int enable_flag)
                        pvr2_trace(PVR2_TRACE_FIRMWARE,
                                   "Cleaning up after CPU firmware fetch");
                        kfree(hdw->fw_buffer);
-                       hdw->fw_buffer = 0;
+                       hdw->fw_buffer = NULL;
                        hdw->fw_size = 0;
                        /* Now release the CPU.  It will disconnect and
                           reconnect later. */
@@ -2519,22 +2509,6 @@ void pvr2_hdw_v4l_store_minor_number(struct pvr2_hdw *hdw,int v)
 }
 
 
-void pvr2_reset_ctl_endpoints(struct pvr2_hdw *hdw)
-{
-       if (!hdw->usb_dev) return;
-       usb_settoggle(hdw->usb_dev, PVR2_CTL_WRITE_ENDPOINT & 0xf,
-                     !(PVR2_CTL_WRITE_ENDPOINT & USB_DIR_IN), 0);
-       usb_settoggle(hdw->usb_dev, PVR2_CTL_READ_ENDPOINT & 0xf,
-                     !(PVR2_CTL_READ_ENDPOINT & USB_DIR_IN), 0);
-       usb_clear_halt(hdw->usb_dev,
-                      usb_rcvbulkpipe(hdw->usb_dev,
-                                      PVR2_CTL_READ_ENDPOINT & 0x7f));
-       usb_clear_halt(hdw->usb_dev,
-                      usb_sndbulkpipe(hdw->usb_dev,
-                                      PVR2_CTL_WRITE_ENDPOINT & 0x7f));
-}
-
-
 static void pvr2_ctl_write_complete(struct urb *urb, struct pt_regs *regs)
 {
        struct pvr2_hdw *hdw = urb->context;
@@ -2568,10 +2542,10 @@ static void pvr2_ctl_timeout(unsigned long data)
 }
 
 
-int pvr2_send_request_ex(struct pvr2_hdw *hdw,
-                        unsigned int timeout,int probe_fl,
-                        void *write_data,unsigned int write_len,
-                        void *read_data,unsigned int read_len)
+static int pvr2_send_request_ex(struct pvr2_hdw *hdw,
+                               unsigned int timeout,int probe_fl,
+                               void *write_data,unsigned int write_len,
+                               void *read_data,unsigned int read_len)
 {
        unsigned int idx;
        int status = 0;
@@ -2826,7 +2800,7 @@ int pvr2_write_register(struct pvr2_hdw *hdw, u16 reg, u32 data)
 }
 
 
-int pvr2_read_register(struct pvr2_hdw *hdw, u16 reg, u32 *data)
+static int pvr2_read_register(struct pvr2_hdw *hdw, u16 reg, u32 *data)
 {
        int ret = 0;
 
@@ -2850,7 +2824,7 @@ int pvr2_read_register(struct pvr2_hdw *hdw, u16 reg, u32 *data)
 }
 
 
-int pvr2_write_u16(struct pvr2_hdw *hdw, u16 data, int res)
+static int pvr2_write_u16(struct pvr2_hdw *hdw, u16 data, int res)
 {
        int ret;
 
@@ -2867,7 +2841,7 @@ int pvr2_write_u16(struct pvr2_hdw *hdw, u16 data, int res)
 }
 
 
-int pvr2_write_u8(struct pvr2_hdw *hdw, u8 data, int res)
+static int pvr2_write_u8(struct pvr2_hdw *hdw, u8 data, int res)
 {
        int ret;
 
@@ -2883,13 +2857,13 @@ int pvr2_write_u8(struct pvr2_hdw *hdw, u8 data, int res)
 }
 
 
-void pvr2_hdw_render_useless_unlocked(struct pvr2_hdw *hdw)
+static void pvr2_hdw_render_useless_unlocked(struct pvr2_hdw *hdw)
 {
        if (!hdw->flag_ok) return;
        pvr2_trace(PVR2_TRACE_INIT,"render_useless");
        hdw->flag_ok = 0;
        if (hdw->vid_stream) {
-               pvr2_stream_setup(hdw->vid_stream,0,0,0);
+               pvr2_stream_setup(hdw->vid_stream,NULL,0,0);
        }
        hdw->flag_streaming_enabled = 0;
        hdw->subsys_enabled_mask = 0;
@@ -2908,7 +2882,7 @@ void pvr2_hdw_device_reset(struct pvr2_hdw *hdw)
 {
        int ret;
        pvr2_trace(PVR2_TRACE_INIT,"Performing a device reset...");
-       ret = usb_lock_device_for_reset(hdw->usb_dev,0);
+       ret = usb_lock_device_for_reset(hdw->usb_dev,NULL);
        if (ret == 1) {
                ret = usb_reset_device(hdw->usb_dev);
                usb_unlock_device(hdw->usb_dev);
@@ -2957,7 +2931,7 @@ int pvr2_hdw_cmd_deep_reset(struct pvr2_hdw *hdw)
                pvr2_trace(PVR2_TRACE_INIT,"Requesting uproc hard reset");
                hdw->flag_ok = !0;
                hdw->cmd_buffer[0] = 0xdd;
-               status = pvr2_send_request(hdw,hdw->cmd_buffer,1,0,0);
+               status = pvr2_send_request(hdw,hdw->cmd_buffer,1,NULL,0);
        } while (0); LOCK_GIVE(hdw->ctl_lock);
        return status;
 }
@@ -2969,7 +2943,7 @@ int pvr2_hdw_cmd_powerup(struct pvr2_hdw *hdw)
        LOCK_TAKE(hdw->ctl_lock); do {
                pvr2_trace(PVR2_TRACE_INIT,"Requesting powerup");
                hdw->cmd_buffer[0] = 0xde;
-               status = pvr2_send_request(hdw,hdw->cmd_buffer,1,0,0);
+               status = pvr2_send_request(hdw,hdw->cmd_buffer,1,NULL,0);
        } while (0); LOCK_GIVE(hdw->ctl_lock);
        return status;
 }
@@ -2996,12 +2970,12 @@ int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *hdw)
 }
 
 
-int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl)
+static int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl)
 {
        int status;
        LOCK_TAKE(hdw->ctl_lock); do {
                hdw->cmd_buffer[0] = (runFl ? 0x36 : 0x37);
-               status = pvr2_send_request(hdw,hdw->cmd_buffer,1,0,0);
+               status = pvr2_send_request(hdw,hdw->cmd_buffer,1,NULL,0);
        } while (0); LOCK_GIVE(hdw->ctl_lock);
        if (!status) {
                hdw->subsys_enabled_mask =
@@ -3094,7 +3068,7 @@ int pvr2_hdw_gpio_chg_out(struct pvr2_hdw *hdw,u32 msk,u32 val)
 }
 
 
-int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw)
+static int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw)
 {
        int result;
        LOCK_TAKE(hdw->ctl_lock); do {
index 63f529154431d54a09e340d928a38f18f93005d9..fd931b5da490b4bc66c8538923ac80eb98cd118a 100644 (file)
@@ -91,7 +91,6 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf,
 void pvr2_hdw_poll(struct pvr2_hdw *);
 
 /* Trigger a poll to take place later at a convenient time */
-void pvr2_hdw_poll_trigger(struct pvr2_hdw *);
 void pvr2_hdw_poll_trigger_unlocked(struct pvr2_hdw *);
 
 /* Register a callback used to trigger a future poll */
@@ -99,9 +98,6 @@ void pvr2_hdw_setup_poll_trigger(struct pvr2_hdw *,
                                 void (*func)(void *),
                                 void *data);
 
-/* Get pointer to structure given unit number */
-struct pvr2_hdw *pvr2_hdw_find(int unit_number);
-
 /* Destroy hardware interaction structure */
 void pvr2_hdw_destroy(struct pvr2_hdw *);
 
@@ -180,12 +176,6 @@ int pvr2_hdw_get_stdenum_value(struct pvr2_hdw *hdw,struct v4l2_standard *std,
 void pvr2_hdw_subsys_bit_chg(struct pvr2_hdw *hdw,
                             unsigned long msk,unsigned long val);
 
-/* Shortcut for pvr2_hdw_subsys_bit_chg(hdw,msk,msk) */
-void pvr2_hdw_subsys_bit_set(struct pvr2_hdw *hdw,unsigned long msk);
-
-/* Shortcut for pvr2_hdw_subsys_bit_chg(hdw,msk,0) */
-void pvr2_hdw_subsys_bit_clr(struct pvr2_hdw *hdw,unsigned long msk);
-
 /* Retrieve mask indicating which pieces of hardware are currently enabled
    / configured. */
 unsigned long pvr2_hdw_subsys_get(struct pvr2_hdw *);
@@ -225,34 +215,18 @@ void pvr2_hdw_v4l_store_minor_number(struct pvr2_hdw *,int);
 /* The following entry points are all lower level things you normally don't
    want to worry about. */
 
-/* Attempt to recover from a USB foul-up (in practice I find that if you
-   have to do this, then it's already too late). */
-void pvr2_reset_ctl_endpoints(struct pvr2_hdw *hdw);
-
 /* Issue a command and get a response from the device.  LOTS of higher
    level stuff is built on this. */
 int pvr2_send_request(struct pvr2_hdw *,
                      void *write_ptr,unsigned int write_len,
                      void *read_ptr,unsigned int read_len);
 
-/* Issue a command and get a response from the device.  This extended
-   version includes a probe flag (which if set means that device errors
-   should not be logged or treated as fatal) and a timeout in jiffies.
-   This can be used to non-lethally probe the health of endpoint 1. */
-int pvr2_send_request_ex(struct pvr2_hdw *,unsigned int timeout,int probe_fl,
-                        void *write_ptr,unsigned int write_len,
-                        void *read_ptr,unsigned int read_len);
-
 /* Slightly higher level device communication functions. */
 int pvr2_write_register(struct pvr2_hdw *, u16, u32);
-int pvr2_read_register(struct pvr2_hdw *, u16, u32 *);
-int pvr2_write_u16(struct pvr2_hdw *, u16, int);
-int pvr2_write_u8(struct pvr2_hdw *, u8, int);
 
 /* Call if for any reason we can't talk to the hardware anymore - this will
    cause the driver to stop flailing on the device. */
 void pvr2_hdw_render_useless(struct pvr2_hdw *);
-void pvr2_hdw_render_useless_unlocked(struct pvr2_hdw *);
 
 /* Set / clear 8051's reset bit */
 void pvr2_hdw_cpureset_assert(struct pvr2_hdw *,int);
@@ -271,12 +245,6 @@ int pvr2_hdw_cmd_powerup(struct pvr2_hdw *);
 /* Order decoder to reset */
 int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *);
 
-/* Stop / start video stream transport */
-int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl);
-
-/* Find I2C address of eeprom */
-int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *);
-
 /* Direct manipulation of GPIO bits */
 int pvr2_hdw_gpio_get_dir(struct pvr2_hdw *hdw,u32 *);
 int pvr2_hdw_gpio_get_out(struct pvr2_hdw *hdw,u32 *);
index 1dd4f6249b9950285d82cb4adf328f9b1e72a022..fbe6039aeb6a8a5c588c3c7f1a81b389c54f5ae0 100644 (file)
@@ -25,7 +25,6 @@
 #include "pvrusb2-i2c-cmd-v4l2.h"
 #include "pvrusb2-audio.h"
 #include "pvrusb2-tuner.h"
-#include "pvrusb2-demod.h"
 #include "pvrusb2-video-v4l.h"
 #ifdef CONFIG_VIDEO_PVRUSB2_24XXX
 #include "pvrusb2-cx2584x-v4l.h"
@@ -89,11 +88,6 @@ void pvr2_i2c_probe(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp)
                        return;
                }
        }
-       if (id == I2C_DRIVERID_TDA9887) {
-               if (pvr2_i2c_demod_setup(hdw,cp)) {
-                       return;
-               }
-       }
 }
 
 
index 9f81aff2b38ac9e535f72b9b6f22cc23e06780a5..8a9933dec9123213ed092a04991f9e8b76b3e387 100644 (file)
@@ -196,7 +196,7 @@ const struct pvr2_i2c_op pvr2_i2c_op_v4l2_size = {
 static void do_log(struct pvr2_hdw *hdw)
 {
        pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 do_log()");
-       pvr2_i2c_core_cmd(hdw,VIDIOC_LOG_STATUS,0);
+       pvr2_i2c_core_cmd(hdw,VIDIOC_LOG_STATUS,NULL);
 
 }
 
@@ -217,7 +217,7 @@ const struct pvr2_i2c_op pvr2_i2c_op_v4l2_log = {
 void pvr2_v4l2_cmd_stream(struct pvr2_i2c_client *cp,int fl)
 {
        pvr2_i2c_client_cmd(cp,
-                           (fl ? VIDIOC_STREAMON : VIDIOC_STREAMOFF),0);
+                           (fl ? VIDIOC_STREAMON : VIDIOC_STREAMOFF),NULL);
 }
 
 
index c8d0bdee3ff1955bb4348e3acd1fb2f68d5bab70..7fca47982277a2ea68a013030a53cf0f584b3dcc 100644 (file)
@@ -37,6 +37,10 @@ static unsigned int i2c_scan = 0;
 module_param(i2c_scan, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(i2c_scan,"scan i2c bus at insmod time");
 
+static unsigned int pvr2_i2c_client_describe(struct pvr2_i2c_client *cp,
+                                            unsigned int detail,
+                                            char *buf,unsigned int maxlen);
+
 static int pvr2_i2c_write(struct pvr2_hdw *hdw, /* Context */
                          u8 i2c_addr,      /* I2C address we're talking to */
                          u8 *data,         /* Data to write */
@@ -165,12 +169,12 @@ static int pvr2_i2c_read(struct pvr2_hdw *hdw, /* Context */
 
 /* This is the common low level entry point for doing I2C operations to the
    hardware. */
-int pvr2_i2c_basic_op(struct pvr2_hdw *hdw,
-                     u8 i2c_addr,
-                     u8 *wdata,
-                     u16 wlen,
-                     u8 *rdata,
-                     u16 rlen)
+static int pvr2_i2c_basic_op(struct pvr2_hdw *hdw,
+                            u8 i2c_addr,
+                            u8 *wdata,
+                            u16 wlen,
+                            u8 *rdata,
+                            u16 rlen)
 {
        if (!rdata) rlen = 0;
        if (!wdata) wlen = 0;
@@ -267,7 +271,7 @@ static int i2c_hack_cx25840(struct pvr2_hdw *hdw,
                           "WARNING: Disabling further access to the device"
                           " to prevent other foul-ups.");
                // This blocks all further communication with the part.
-               hdw->i2c_func[0x44] = 0;
+               hdw->i2c_func[0x44] = NULL;
                pvr2_hdw_render_useless(hdw);
                goto fail;
        }
@@ -294,7 +298,7 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap,
                         int num)
 {
        int ret = -ENOTSUPP;
-       pvr2_i2c_func funcp = 0;
+       pvr2_i2c_func funcp = NULL;
        struct pvr2_hdw *hdw = (struct pvr2_hdw *)(i2c_adap->algo_data);
 
        if (!num) {
@@ -319,7 +323,7 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap,
                        u16 tcnt,bcnt,offs;
                        if (!msgs[0].len) {
                                /* Length == 0 read.  This is a probe. */
-                               if (funcp(hdw,msgs[0].addr,0,0,0,0)) {
+                               if (funcp(hdw,msgs[0].addr,NULL,0,NULL,0)) {
                                        ret = -EIO;
                                        goto done;
                                }
@@ -336,7 +340,7 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap,
                                if (bcnt > sizeof(hdw->cmd_buffer)-1) {
                                        bcnt = sizeof(hdw->cmd_buffer)-1;
                                }
-                               if (funcp(hdw,msgs[0].addr,0,0,
+                               if (funcp(hdw,msgs[0].addr,NULL,0,
                                          msgs[0].buf+offs,bcnt)) {
                                        ret = -EIO;
                                        goto done;
@@ -350,7 +354,7 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap,
                        /* Simple write */
                        ret = 1;
                        if (funcp(hdw,msgs[0].addr,
-                                 msgs[0].buf,msgs[0].len,0,0)) {
+                                 msgs[0].buf,msgs[0].len,NULL,0)) {
                                ret = -EIO;
                        }
                        goto done;
@@ -705,9 +709,9 @@ int pvr2_i2c_core_check_stale(struct pvr2_hdw *hdw)
        return (hdw->i2c_pend_types & PVR2_I2C_PEND_ALL) != 0;
 }
 
-unsigned int pvr2_i2c_client_describe(struct pvr2_i2c_client *cp,
-                                     unsigned int detail,
-                                     char *buf,unsigned int maxlen)
+static unsigned int pvr2_i2c_client_describe(struct pvr2_i2c_client *cp,
+                                            unsigned int detail,
+                                            char *buf,unsigned int maxlen)
 {
        unsigned int ccnt,bcnt;
        int spcfl = 0;
@@ -871,7 +875,7 @@ static void do_i2c_scan(struct pvr2_hdw *hdw)
        msg[0].addr = 0;
        msg[0].flags = I2C_M_RD;
        msg[0].len = 0;
-       msg[0].buf = 0;
+       msg[0].buf = NULL;
        printk("%s: i2c scan beginning\n",hdw->name);
        for (i = 0; i < 128; i++) {
                msg[0].addr = i;
index e8af5b0ed3ce3c04311edcf87609807a48261b1d..6d7e252475760fd2dbb5f20986d11ab7991f1b85 100644 (file)
@@ -75,9 +75,6 @@ unsigned int pvr2_i2c_report(struct pvr2_hdw *,char *buf,unsigned int maxlen);
        PVR2_I2C_DETAIL_DEBUG |\
        PVR2_I2C_DETAIL_HANDLER |\
        PVR2_I2C_DETAIL_CTLMASK)
-unsigned int pvr2_i2c_client_describe(struct pvr2_i2c_client *,
-                                     unsigned int detail_mask,
-                                     char *buf,unsigned int maxlen);
 
 void pvr2_i2c_probe(struct pvr2_hdw *,struct pvr2_i2c_client *);
 const struct pvr2_i2c_op *pvr2_i2c_get_op(unsigned int idx);
index a984c91f571c2eab5bdc941b95cb7c417c335d72..681f79c8064e68ce0a51d9553eb3b1804f7a5368 100644 (file)
@@ -93,7 +93,7 @@ struct pvr2_buffer {
        struct urb *purb;
 };
 
-const char *pvr2_buffer_state_decode(enum pvr2_buffer_state st)
+static const char *pvr2_buffer_state_decode(enum pvr2_buffer_state st)
 {
        switch (st) {
        case pvr2_buffer_state_none: return "none";
@@ -104,7 +104,8 @@ const char *pvr2_buffer_state_decode(enum pvr2_buffer_state st)
        return "unknown";
 }
 
-void pvr2_buffer_describe(struct pvr2_buffer *bp,const char *msg)
+#ifdef SANITY_CHECK_BUFFERS
+static void pvr2_buffer_describe(struct pvr2_buffer *bp,const char *msg)
 {
        pvr2_trace(PVR2_TRACE_INFO,
                   "buffer%s%s %p state=%s id=%d status=%d"
@@ -115,10 +116,11 @@ void pvr2_buffer_describe(struct pvr2_buffer *bp,const char *msg)
                   (bp ? pvr2_buffer_state_decode(bp->state) : "(invalid)"),
                   (bp ? bp->id : 0),
                   (bp ? bp->status : 0),
-                  (bp ? bp->stream : 0),
-                  (bp ? bp->purb : 0),
+                  (bp ? bp->stream : NULL),
+                  (bp ? bp->purb : NULL),
                   (bp ? bp->signature : 0));
 }
+#endif  /*  SANITY_CHECK_BUFFERS  */
 
 static void pvr2_buffer_remove(struct pvr2_buffer *bp)
 {
@@ -284,7 +286,7 @@ static void pvr2_buffer_done(struct pvr2_buffer *bp)
        pvr2_buffer_wipe(bp);
        pvr2_buffer_set_none(bp);
        bp->signature = 0;
-       bp->stream = 0;
+       bp->stream = NULL;
        if (bp->purb) usb_free_urb(bp->purb);
        pvr2_trace(PVR2_TRACE_BUF_POOL,"/*---TRACE_FLOW---*/"
                   " bufferDone     %p",bp);
@@ -339,13 +341,13 @@ static int pvr2_stream_buffer_count(struct pvr2_stream *sp,unsigned int cnt)
                        struct pvr2_buffer *bp;
                        bp = sp->buffers[sp->buffer_total_count - 1];
                        /* Paranoia */
-                       sp->buffers[sp->buffer_total_count - 1] = 0;
+                       sp->buffers[sp->buffer_total_count - 1] = NULL;
                        (sp->buffer_total_count)--;
                        pvr2_buffer_done(bp);
                        kfree(bp);
                }
                if (scnt < sp->buffer_slot_count) {
-                       struct pvr2_buffer **nb = 0;
+                       struct pvr2_buffer **nb = NULL;
                        if (scnt) {
                                nb = kmalloc(scnt * sizeof(*nb),GFP_KERNEL);
                                if (!nb) return -ENOMEM;
@@ -513,10 +515,6 @@ void pvr2_stream_set_callback(struct pvr2_stream *sp,
 }
 
 /* Query / set the nominal buffer count */
-int pvr2_stream_get_buffer_count(struct pvr2_stream *sp)
-{
-       return sp->buffer_target_count;
-}
 
 int pvr2_stream_set_buffer_count(struct pvr2_stream *sp,unsigned int cnt)
 {
@@ -532,21 +530,21 @@ int pvr2_stream_set_buffer_count(struct pvr2_stream *sp,unsigned int cnt)
 struct pvr2_buffer *pvr2_stream_get_idle_buffer(struct pvr2_stream *sp)
 {
        struct list_head *lp = sp->idle_list.next;
-       if (lp == &sp->idle_list) return 0;
+       if (lp == &sp->idle_list) return NULL;
        return list_entry(lp,struct pvr2_buffer,list_overhead);
 }
 
 struct pvr2_buffer *pvr2_stream_get_ready_buffer(struct pvr2_stream *sp)
 {
        struct list_head *lp = sp->ready_list.next;
-       if (lp == &sp->ready_list) return 0;
+       if (lp == &sp->ready_list) return NULL;
        return list_entry(lp,struct pvr2_buffer,list_overhead);
 }
 
 struct pvr2_buffer *pvr2_stream_get_buffer(struct pvr2_stream *sp,int id)
 {
-       if (id < 0) return 0;
-       if (id >= sp->buffer_total_count) return 0;
+       if (id < 0) return NULL;
+       if (id >= sp->buffer_total_count) return NULL;
        return sp->buffers[id];
 }
 
@@ -555,17 +553,6 @@ int pvr2_stream_get_ready_count(struct pvr2_stream *sp)
        return sp->r_count;
 }
 
-int pvr2_stream_get_idle_count(struct pvr2_stream *sp)
-{
-       return sp->i_count;
-}
-
-void pvr2_stream_flush(struct pvr2_stream *sp)
-{
-       mutex_lock(&sp->mutex); do {
-               pvr2_stream_internal_flush(sp);
-       } while(0); mutex_unlock(&sp->mutex);
-}
 
 void pvr2_stream_kill(struct pvr2_stream *sp)
 {
@@ -620,20 +607,6 @@ int pvr2_buffer_queue(struct pvr2_buffer *bp)
        return ret;
 }
 
-int pvr2_buffer_idle(struct pvr2_buffer *bp)
-{
-       struct pvr2_stream *sp;
-       if (!bp) return -EINVAL;
-       sp = bp->stream;
-       mutex_lock(&sp->mutex); do {
-               pvr2_buffer_wipe(bp);
-               pvr2_buffer_set_idle(bp);
-               if (sp->buffer_total_count != sp->buffer_target_count) {
-                       pvr2_stream_achieve_buffer_count(sp);
-               }
-       } while(0); mutex_unlock(&sp->mutex);
-       return 0;
-}
 
 int pvr2_buffer_set_buffer(struct pvr2_buffer *bp,void *ptr,unsigned int cnt)
 {
@@ -673,10 +646,6 @@ int pvr2_buffer_get_status(struct pvr2_buffer *bp)
        return bp->status;
 }
 
-enum pvr2_buffer_state pvr2_buffer_get_state(struct pvr2_buffer *bp)
-{
-       return bp->state;
-}
 
 int pvr2_buffer_get_id(struct pvr2_buffer *bp)
 {
index 65e11385b2b33380236963bd1642f16d17bf19d9..96285ad234a6ba1e20a4ebe7285bbcce14dd8570 100644 (file)
@@ -36,8 +36,6 @@ enum pvr2_buffer_state {
 struct pvr2_stream;
 struct pvr2_buffer;
 
-const char *pvr2_buffer_state_decode(enum pvr2_buffer_state);
-
 /* Initialize / tear down stream structure */
 struct pvr2_stream *pvr2_stream_create(void);
 void pvr2_stream_destroy(struct pvr2_stream *);
@@ -49,7 +47,6 @@ void pvr2_stream_set_callback(struct pvr2_stream *,
                              void *data);
 
 /* Query / set the nominal buffer count */
-int pvr2_stream_get_buffer_count(struct pvr2_stream *);
 int pvr2_stream_set_buffer_count(struct pvr2_stream *,unsigned int);
 
 /* Get a pointer to a buffer that is either idle, ready, or is specified
@@ -59,12 +56,8 @@ struct pvr2_buffer *pvr2_stream_get_ready_buffer(struct pvr2_stream *);
 struct pvr2_buffer *pvr2_stream_get_buffer(struct pvr2_stream *sp,int id);
 
 /* Find out how many buffers are idle or ready */
-int pvr2_stream_get_idle_count(struct pvr2_stream *);
 int pvr2_stream_get_ready_count(struct pvr2_stream *);
 
-/* Kill all pending operations */
-void pvr2_stream_flush(struct pvr2_stream *);
-
 /* Kill all pending buffers and throw away any ready buffers as well */
 void pvr2_stream_kill(struct pvr2_stream *);
 
@@ -77,18 +70,12 @@ unsigned int pvr2_buffer_get_count(struct pvr2_buffer *);
 /* Retrieve completion code for given ready buffer */
 int pvr2_buffer_get_status(struct pvr2_buffer *);
 
-/* Retrieve state of given buffer */
-enum pvr2_buffer_state pvr2_buffer_get_state(struct pvr2_buffer *);
-
 /* Retrieve ID of given buffer */
 int pvr2_buffer_get_id(struct pvr2_buffer *);
 
 /* Start reading into given buffer (kill it if needed) */
 int pvr2_buffer_queue(struct pvr2_buffer *);
 
-/* Move buffer back to idle pool (kill it if needed) */
-int pvr2_buffer_idle(struct pvr2_buffer *);
-
 #endif /* __PVRUSB2_IO_H */
 
 /*
index 49da062e32710067369f85e1325b09e09202f264..f7a2e225a002543287f171d00a91589b0877bcb6 100644 (file)
@@ -54,7 +54,7 @@ static int pvr2_ioread_init(struct pvr2_ioread *cp)
 {
        unsigned int idx;
 
-       cp->stream = 0;
+       cp->stream = NULL;
        mutex_init(&cp->mutex);
 
        for (idx = 0; idx < BUFFER_COUNT; idx++) {
@@ -77,7 +77,7 @@ static void pvr2_ioread_done(struct pvr2_ioread *cp)
 {
        unsigned int idx;
 
-       pvr2_ioread_setup(cp,0);
+       pvr2_ioread_setup(cp,NULL);
        for (idx = 0; idx < BUFFER_COUNT; idx++) {
                if (!(cp->buffer_storage[idx])) continue;
                kfree(cp->buffer_storage[idx]);
@@ -88,12 +88,12 @@ struct pvr2_ioread *pvr2_ioread_create(void)
 {
        struct pvr2_ioread *cp;
        cp = kmalloc(sizeof(*cp),GFP_KERNEL);
-       if (!cp) return 0;
+       if (!cp) return NULL;
        pvr2_trace(PVR2_TRACE_STRUCT,"pvr2_ioread_create id=%p",cp);
        memset(cp,0,sizeof(*cp));
        if (pvr2_ioread_init(cp) < 0) {
                kfree(cp);
-               return 0;
+               return NULL;
        }
        return cp;
 }
@@ -105,7 +105,7 @@ void pvr2_ioread_destroy(struct pvr2_ioread *cp)
        pvr2_trace(PVR2_TRACE_STRUCT,"pvr2_ioread_destroy id=%p",cp);
        if (cp->sync_key_ptr) {
                kfree(cp->sync_key_ptr);
-               cp->sync_key_ptr = 0;
+               cp->sync_key_ptr = NULL;
        }
        kfree(cp);
 }
@@ -124,7 +124,7 @@ void pvr2_ioread_set_sync_key(struct pvr2_ioread *cp,
        if (sync_key_len != cp->sync_key_len) {
                if (cp->sync_key_ptr) {
                        kfree(cp->sync_key_ptr);
-                       cp->sync_key_ptr = 0;
+                       cp->sync_key_ptr = NULL;
                }
                cp->sync_key_len = 0;
                if (sync_key_len) {
@@ -144,8 +144,8 @@ static void pvr2_ioread_stop(struct pvr2_ioread *cp)
        pvr2_trace(PVR2_TRACE_START_STOP,
                   "/*---TRACE_READ---*/ pvr2_ioread_stop id=%p",cp);
        pvr2_stream_kill(cp->stream);
-       cp->c_buf = 0;
-       cp->c_data_ptr = 0;
+       cp->c_buf = NULL;
+       cp->c_data_ptr = NULL;
        cp->c_data_len = 0;
        cp->c_data_offs = 0;
        cp->enabled = 0;
@@ -179,8 +179,8 @@ static int pvr2_ioread_start(struct pvr2_ioread *cp)
                }
        }
        cp->enabled = !0;
-       cp->c_buf = 0;
-       cp->c_data_ptr = 0;
+       cp->c_buf = NULL;
+       cp->c_data_ptr = NULL;
        cp->c_data_len = 0;
        cp->c_data_offs = 0;
        cp->stream_running = 0;
@@ -214,7 +214,7 @@ int pvr2_ioread_setup(struct pvr2_ioread *cp,struct pvr2_stream *sp)
                        pvr2_ioread_stop(cp);
                        pvr2_stream_kill(cp->stream);
                        pvr2_stream_set_buffer_count(cp->stream,0);
-                       cp->stream = 0;
+                       cp->stream = NULL;
                }
                if (sp) {
                        pvr2_trace(PVR2_TRACE_START_STOP,
@@ -251,12 +251,8 @@ int pvr2_ioread_set_enabled(struct pvr2_ioread *cp,int fl)
        return ret;
 }
 
-int pvr2_ioread_get_enabled(struct pvr2_ioread *cp)
-{
-       return cp->enabled != 0;
-}
 
-int pvr2_ioread_get_buffer(struct pvr2_ioread *cp)
+static int pvr2_ioread_get_buffer(struct pvr2_ioread *cp)
 {
        int stat;
 
@@ -274,8 +270,8 @@ int pvr2_ioread_get_buffer(struct pvr2_ioread *cp)
                                pvr2_ioread_stop(cp);
                                return 0;
                        }
-                       cp->c_buf = 0;
-                       cp->c_data_ptr = 0;
+                       cp->c_buf = NULL;
+                       cp->c_data_ptr = NULL;
                        cp->c_data_len = 0;
                        cp->c_data_offs = 0;
                }
@@ -307,7 +303,7 @@ int pvr2_ioread_get_buffer(struct pvr2_ioread *cp)
        return !0;
 }
 
-void pvr2_ioread_filter(struct pvr2_ioread *cp)
+static void pvr2_ioread_filter(struct pvr2_ioread *cp)
 {
        unsigned int idx;
        if (!cp->enabled) return;
index 6b002597f5de56e7a421077da2fceaa3cd77d25b..1d362f83358866aafc8fb57b5934201b4fa6223a 100644 (file)
@@ -33,7 +33,6 @@ void pvr2_ioread_set_sync_key(struct pvr2_ioread *,
                              const char *sync_key_ptr,
                              unsigned int sync_key_len);
 int pvr2_ioread_set_enabled(struct pvr2_ioread *,int fl);
-int pvr2_ioread_get_enabled(struct pvr2_ioread *);
 int pvr2_ioread_read(struct pvr2_ioread *,void __user *buf,unsigned int cnt);
 int pvr2_ioread_avail(struct pvr2_ioread *);
 
index b95248274ed0961ee05e1031340b54266df40b3a..8f1a5afdd34e25104466a6dff2b76a952f8c22f4 100644 (file)
@@ -54,7 +54,7 @@ module_param_named(debug,pvrusb2_debug,int,S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(debug, "Debug trace mask");
 
 #ifdef CONFIG_VIDEO_PVRUSB2_SYSFS
-static struct pvr2_sysfs_class *class_ptr = 0;
+static struct pvr2_sysfs_class *class_ptr = NULL;
 #endif /* CONFIG_VIDEO_PVRUSB2_SYSFS */
 
 static void pvr_setup_attach(struct pvr2_context *pvr)
@@ -104,10 +104,10 @@ static void pvr_disconnect(struct usb_interface *intf)
 }
 
 static struct usb_driver pvr_driver = {
-       name:           "pvrusb2",
-       id_table:       pvr2_device_table,
-       probe:          pvr_probe,
-       disconnect:     pvr_disconnect
+       .name =         "pvrusb2",
+       .id_table =     pvr2_device_table,
+       .probe =        pvr_probe,
+       .disconnect =   pvr_disconnect
 };
 
 /*
index 13406369364385f5661478087e7b99b49f0c64e0..f95c598ff627a263fa019e472e92d5ea7d743d44 100644 (file)
@@ -121,7 +121,7 @@ static const struct std_name *find_std_name(const struct std_name *arrPtr,
                if (strlen(p->name) != bufSize) continue;
                if (!memcmp(bufPtr,p->name,bufSize)) return p;
        }
-       return 0;
+       return NULL;
 }
 
 
@@ -289,7 +289,7 @@ static struct v4l2_standard *match_std(v4l2_std_id id)
                        return generic_standards + idx;
                }
        }
-       return 0;
+       return NULL;
 }
 
 static int pvr2_std_fill(struct v4l2_standard *std,v4l2_std_id id)
@@ -364,7 +364,7 @@ struct v4l2_standard *pvr2_std_create_enum(unsigned int *countptr,
 
        pvr2_trace(PVR2_TRACE_INIT,"Setting up %u unique standard(s)",
                   std_cnt);
-       if (!std_cnt) return 0; // paranoia
+       if (!std_cnt) return NULL; // paranoia
 
        stddefs = kmalloc(sizeof(struct v4l2_standard) * std_cnt,
                          GFP_KERNEL);
index c6e6523d74b43dd3df9ecc5ab50405198b9c43f9..6af55a8b6f055cb3b2e1e961bf00b3a78e8c817a 100644 (file)
@@ -504,7 +504,7 @@ static void pvr2_sysfs_add_control(struct pvr2_sysfs *sfp,int ctl_id)
        cip->cptr = cptr;
 
        cip->chptr = sfp;
-       cip->item_next = 0;
+       cip->item_next = NULL;
        if (sfp->item_last) {
                sfp->item_last->item_next = cip;
        } else {
@@ -625,7 +625,7 @@ static void pvr2_sysfs_tear_down_debugifc(struct pvr2_sysfs *sfp)
                                 &sfp->debugifc->attr_debuginfo);
        class_device_remove_file(sfp->class_dev,&sfp->debugifc->attr_debugcmd);
        kfree(sfp->debugifc);
-       sfp->debugifc = 0;
+       sfp->debugifc = NULL;
 }
 #endif /* CONFIG_VIDEO_PVRUSB2_DEBUGIFC */
 
@@ -678,9 +678,9 @@ static void class_dev_destroy(struct pvr2_sysfs *sfp)
        class_device_remove_file(sfp->class_dev,&sfp->attr_v4l_minor_number);
        class_device_remove_file(sfp->class_dev,&sfp->attr_unit_number);
        pvr2_sysfs_trace("Destroying class_dev id=%p",sfp->class_dev);
-       sfp->class_dev->class_data = 0;
+       sfp->class_dev->class_data = NULL;
        class_device_unregister(sfp->class_dev);
-       sfp->class_dev = 0;
+       sfp->class_dev = NULL;
 }
 
 
@@ -739,13 +739,13 @@ static void class_dev_create(struct pvr2_sysfs *sfp,
        sfp->attr_v4l_minor_number.attr.name = "v4l_minor_number";
        sfp->attr_v4l_minor_number.attr.mode = S_IRUGO;
        sfp->attr_v4l_minor_number.show = v4l_minor_number_show;
-       sfp->attr_v4l_minor_number.store = 0;
+       sfp->attr_v4l_minor_number.store = NULL;
        class_device_create_file(sfp->class_dev,&sfp->attr_v4l_minor_number);
        sfp->attr_unit_number.attr.owner = THIS_MODULE;
        sfp->attr_unit_number.attr.name = "unit_number";
        sfp->attr_unit_number.attr.mode = S_IRUGO;
        sfp->attr_unit_number.show = unit_number_show;
-       sfp->attr_unit_number.store = 0;
+       sfp->attr_unit_number.store = NULL;
        class_device_create_file(sfp->class_dev,&sfp->attr_unit_number);
 
        pvr2_sysfs_add_controls(sfp);
@@ -806,7 +806,7 @@ struct pvr2_sysfs_class *pvr2_sysfs_class_create(void)
                pvr2_sysfs_trace(
                        "Registration failed for pvr2_sysfs_class id=%p",clp);
                kfree(clp);
-               clp = 0;
+               clp = NULL;
        }
        return clp;
 }
index f4aba8144ce058ee0f1b064fefc1e3b85acf38fb..af9f246f8d3f08dc6bd29d0330218fa3309e495e 100644 (file)
@@ -69,7 +69,7 @@ static void tuner_update(struct pvr2_tuner_handler *ctxt)
 
 static void pvr2_tuner_detach(struct pvr2_tuner_handler *ctxt)
 {
-       ctxt->client->handler = 0;
+       ctxt->client->handler = NULL;
        kfree(ctxt);
 }
 
index 961951010c27f9648def6668d08094324bfd11c2..0caf70b8c0de94ca873e760a56c8224085f5ed74 100644 (file)
@@ -81,7 +81,7 @@ static int video_nr[PVR_NUM] = {[0 ... PVR_NUM-1] = -1};
 module_param_array(video_nr, int, NULL, 0444);
 MODULE_PARM_DESC(video_nr, "Offset for device's minor");
 
-struct v4l2_capability pvr_capability ={
+static struct v4l2_capability pvr_capability ={
        .driver         = "pvrusb2",
        .card           = "Hauppauge WinTV pvr-usb2",
        .bus_info       = "usb",
@@ -111,7 +111,7 @@ static struct v4l2_tuner pvr_v4l2_tuners[]= {
        }
 };
 
-struct v4l2_fmtdesc pvr_fmtdesc [] = {
+static struct v4l2_fmtdesc pvr_fmtdesc [] = {
        {
                .index          = 0,
                .type           = V4L2_BUF_TYPE_VIDEO_CAPTURE,
@@ -127,7 +127,7 @@ struct v4l2_fmtdesc pvr_fmtdesc [] = {
 #define PVR_FORMAT_PIX  0
 #define PVR_FORMAT_VBI  1
 
-struct v4l2_format pvr_format [] = {
+static struct v4l2_format pvr_format [] = {
        [PVR_FORMAT_PIX] = {
                .type   = V4L2_BUF_TYPE_VIDEO_CAPTURE,
                .fmt    = {
@@ -701,9 +701,8 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
 
 static void pvr2_v4l2_dev_destroy(struct pvr2_v4l2_dev *dip)
 {
-       pvr2_trace(PVR2_TRACE_INIT,
-                  "unregistering device video%d [%s]",
-                  dip->vdev->minor,pvr2_config_get_name(dip->config));
+       printk(KERN_INFO "pvrusb2: unregistering device video%d [%s]\n",
+              dip->vdev->minor,pvr2_config_get_name(dip->config));
        if (dip->ctxt_idx >= 0) {
                mutex_lock(&device_lock);
                devices[dip->ctxt_idx] = NULL;
@@ -725,7 +724,7 @@ static void pvr2_v4l2_destroy_no_lock(struct pvr2_v4l2 *vp)
 }
 
 
-void pvr2_v4l2_internal_check(struct pvr2_channel *chp)
+static void pvr2_v4l2_internal_check(struct pvr2_channel *chp)
 {
        struct pvr2_v4l2 *vp;
        vp = container_of(chp,struct pvr2_v4l2,channel);
@@ -735,8 +734,8 @@ void pvr2_v4l2_internal_check(struct pvr2_channel *chp)
 }
 
 
-int pvr2_v4l2_ioctl(struct inode *inode, struct file *file,
-                   unsigned int cmd, unsigned long arg)
+static int pvr2_v4l2_ioctl(struct inode *inode, struct file *file,
+                          unsigned int cmd, unsigned long arg)
 {
 
 /* Temporary hack : use ivtv api until a v4l2 one is available. */
@@ -747,7 +746,7 @@ int pvr2_v4l2_ioctl(struct inode *inode, struct file *file,
 }
 
 
-int pvr2_v4l2_release(struct inode *inode, struct file *file)
+static int pvr2_v4l2_release(struct inode *inode, struct file *file)
 {
        struct pvr2_v4l2_fh *fhp = file->private_data;
        struct pvr2_v4l2 *vp = fhp->vhead;
@@ -761,9 +760,9 @@ int pvr2_v4l2_release(struct inode *inode, struct file *file)
                hdw = fhp->channel.mc_head->hdw;
                pvr2_hdw_set_streaming(hdw,0);
                sp = pvr2_ioread_get_stream(fhp->rhp);
-               if (sp) pvr2_stream_set_callback(sp,0,0);
+               if (sp) pvr2_stream_set_callback(sp,NULL,NULL);
                pvr2_ioread_destroy(fhp->rhp);
-               fhp->rhp = 0;
+               fhp->rhp = NULL;
        }
        v4l2_prio_close(&vp->prio, &fhp->prio);
        file->private_data = NULL;
@@ -779,9 +778,9 @@ int pvr2_v4l2_release(struct inode *inode, struct file *file)
                } else {
                        vp->vfirst = fhp->vnext;
                }
-               fhp->vnext = 0;
-               fhp->vprev = 0;
-               fhp->vhead = 0;
+               fhp->vnext = NULL;
+               fhp->vprev = NULL;
+               fhp->vhead = NULL;
                pvr2_channel_done(&fhp->channel);
                pvr2_trace(PVR2_TRACE_STRUCT,
                           "Destroying pvr_v4l2_fh id=%p",fhp);
@@ -794,9 +793,9 @@ int pvr2_v4l2_release(struct inode *inode, struct file *file)
 }
 
 
-int pvr2_v4l2_open(struct inode *inode, struct file *file)
+static int pvr2_v4l2_open(struct inode *inode, struct file *file)
 {
-       struct pvr2_v4l2_dev *dip = 0; /* Our own context pointer */
+       struct pvr2_v4l2_dev *dip = NULL; /* Our own context pointer */
        struct pvr2_v4l2_fh *fhp;
        struct pvr2_v4l2 *vp;
        struct pvr2_hdw *hdw;
@@ -854,7 +853,7 @@ int pvr2_v4l2_open(struct inode *inode, struct file *file)
        pvr2_context_enter(vp->channel.mc_head); do {
                pvr2_trace(PVR2_TRACE_STRUCT,"Creating pvr_v4l2_fh id=%p",fhp);
                pvr2_channel_init(&fhp->channel,vp->channel.mc_head);
-               fhp->vnext = 0;
+               fhp->vnext = NULL;
                fhp->vprev = vp->vlast;
                if (vp->vlast) {
                        vp->vlast->vnext = fhp;
@@ -897,7 +896,7 @@ static int pvr2_v4l2_iosetup(struct pvr2_v4l2_fh *fh)
 
        fh->rhp = pvr2_channel_create_mpeg_stream(fh->dev_info->stream);
        if (!fh->rhp) {
-               pvr2_channel_claim_stream(&fh->channel,0);
+               pvr2_channel_claim_stream(&fh->channel,NULL);
                return -ENOMEM;
        }
 
@@ -1078,9 +1077,8 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip,
            (video_register_device(dip->vdev, v4l_type, -1) < 0)) {
                err("Failed to register pvrusb2 v4l video device");
        } else {
-               pvr2_trace(PVR2_TRACE_INIT,
-                          "registered device video%d [%s]",
-                          dip->vdev->minor,pvr2_config_get_name(dip->config));
+               printk(KERN_INFO "pvrusb2: registered device video%d [%s]\n",
+                      dip->vdev->minor,pvr2_config_get_name(dip->config));
        }
 
        if ((dip->vdev->minor < sizeof(devices)/sizeof(devices[0])) &&
index e4ec7f25194c5611f0ded98adaf2efecc83f0a0b..05f2cddeb47bbe86e594a26215a74d850fabbc60 100644 (file)
@@ -126,8 +126,8 @@ static const struct pvr2_v4l_decoder_ops decoder_ops[] = {
 
 static void decoder_detach(struct pvr2_v4l_decoder *ctxt)
 {
-       ctxt->client->handler = 0;
-       ctxt->hdw->decoder_ctrl = 0;
+       ctxt->client->handler = NULL;
+       ctxt->hdw->decoder_ctrl = NULL;
        kfree(ctxt);
 }
 
index fcad346e395503b835bccea817d8913971aa3731..2413e5198e1676f1d8d2b99a8da9724a83440941 100644 (file)
@@ -89,7 +89,7 @@ static unsigned int wm8775_describe(struct pvr2_v4l_wm8775 *ctxt,
 
 static void wm8775_detach(struct pvr2_v4l_wm8775 *ctxt)
 {
-       ctxt->client->handler = 0;
+       ctxt->client->handler = NULL;
        kfree(ctxt);
 }
 
index 041227f6524691d5f42971acbe00bf9acdd7df0c..43028e74e9e059f58643d180c118ac202707f4a8 100644 (file)
@@ -30,7 +30,6 @@
 #ifndef PWC_UNCOMPRESS_H
 #define PWC_UNCOMPRESS_H
 
-#include <linux/config.h>
 
 #include <media/pwc-ioctl.h>
 
index 629f79e44fb6ac940d4dad4ccd4aad11988bcd9b..7e9c4237d1e8ad145835c88d4a9e0625e8eb3ed5 100644 (file)
@@ -25,7 +25,6 @@
 #ifndef PWC_H
 #define PWC_H
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/usb.h>
 #include <linux/spinlock.h>
index d77e6a8d9432db4aba09eb8b0977893f098eee00..f1fd69e7f119ea5220cb44abf5f0e926b7f680bc 100644 (file)
@@ -929,7 +929,7 @@ static int alsa_card_saa7134_create(struct saa7134_dev *dev, int devnum)
 
 
        err = request_irq(dev->pci->irq, saa7134_alsa_irq,
-                               SA_SHIRQ | SA_INTERRUPT, dev->name,
+                               IRQF_SHARED | IRQF_DISABLED, dev->name,
                                (void*) &dev->dmasound);
 
        if (err < 0) {
index da3007d2f4115df49b6a53ba01dec178a7292529..6e97cc84ba8903c035ae3a6c605ddb35ab412391 100644 (file)
@@ -20,7 +20,6 @@
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/list.h>
 #include <linux/module.h>
@@ -924,7 +923,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
 
        /* get irq */
        err = request_irq(pci_dev->irq, saa7134_irq,
-                         SA_SHIRQ | SA_INTERRUPT, dev->name, dev);
+                         IRQF_SHARED | IRQF_DISABLED, dev->name, dev);
        if (err < 0) {
                printk(KERN_ERR "%s: can't get IRQ %d\n",
                       dev->name,pci_dev->irq);
@@ -942,8 +941,6 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
        /* load i2c helpers */
        if (TUNER_ABSENT != dev->tuner_type)
                request_module("tuner");
-       if (dev->tda9887_conf)
-               request_module("tda9887");
        if (card_is_empress(dev)) {
                request_module("saa6752hs");
                request_module_depend("saa7134-empress",&need_empress);
index 7aa02b34e012f37254d15d3853437ef0b8c6d9af..3895d05804ae93cc1944fcafe69ed8a30fcf8f9b 100644 (file)
@@ -845,7 +845,7 @@ int saa7134_oss_init1(struct saa7134_dev *dev)
 {
 
        if ((request_irq(dev->pci->irq, saa7134_oss_irq,
-                        SA_SHIRQ | SA_INTERRUPT, dev->name,
+                        IRQF_SHARED | IRQF_DISABLED, dev->name,
                        (void*) &dev->dmasound)) < 0)
                return -1;
 
index a846ebc78cd7b8e910208d8378210b25d0939735..67987baee77ae8e8c5767598d9c2ef32d248c6c5 100644 (file)
@@ -27,7 +27,6 @@
 
 static const char version[] = "0.24";
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/vmalloc.h>
index c18b31d9928c8d59f1e60906db240352dc105a65..b36ba9fa3a283786146789ae4776c392f92db147 100644 (file)
@@ -1983,7 +1983,7 @@ static int __devinit configure_saa7146(struct pci_dev *pdev, int num)
        memcpy(&saa->video_dev, &saa_template, sizeof(saa_template));
        saawrite(0, SAA7146_IER);       /* turn off all interrupts */
 
-       retval = request_irq(saa->irq, saa7146_irq, SA_SHIRQ | SA_INTERRUPT,
+       retval = request_irq(saa->irq, saa7146_irq, IRQF_SHARED | IRQF_DISABLED,
                "stradis", saa);
        if (retval == -EINVAL)
                dev_err(&pdev->dev, "%d: Bad irq number or handler\n", num);
index 351b182d921f22856edb5f48236db02185cf4f9d..2ba2991a214ff3026858a13929468869d9da2cf4 100644 (file)
@@ -58,7 +58,6 @@
  *                        Fixed proc entry removal bug.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/vmalloc.h>
index 2fadabf99688c766dc3aa170b4b0ead3afdea435..8dab481d384aa58b292de4dd26fd6155c8fda1ac 100644 (file)
@@ -590,8 +590,8 @@ int tda9887_tuner_init(struct i2c_client *c)
        t->set_tv_freq = tda9887_set_freq;
        t->set_radio_freq = tda9887_set_freq;
        t->standby = tda9887_standby;
-       t->tuner_status=tda9887_tuner_status;
-       t->get_afc=tda9887_get_afc;
+       t->tuner_status = tda9887_tuner_status;
+       t->get_afc = tda9887_get_afc;
 
        return 0;
 }
index 011413cf34a8ad9fcdec570d636d2819edde0c77..f7eb402d5f2b0254af18639e93b27f6a167967fd 100644 (file)
@@ -416,7 +416,7 @@ static void tuner_status(struct i2c_client *client)
 
 /* ---------------------------------------------------------------------- */
 
-/* static var Used only in tuner_attach and tuner_probe */
+/* static vars: used only in tuner_attach and tuner_probe */
 static unsigned default_mode_mask;
 
 /* During client attach, set_type is called by adapter's attach_inform callback.
@@ -608,13 +608,13 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
                tuner_dbg("VIDIOCSAUDIO not implemented.\n");
                break;
        case TDA9887_SET_CONFIG:
-       {
-               int *i = arg;
+               if (t->type == TUNER_TDA9887) {
+                       int *i = arg;
 
-               t->tda9887_config = *i;
-               set_freq(client, t->tv_freq);
+                       t->tda9887_config = *i;
+                       set_freq(client, t->tv_freq);
+               }
                break;
-       }
        /* --- v4l ioctls --- */
        /* take care: bttv does userspace copying, we'll get a
           kernel pointer here... */
index 6da6f82b8c885960b671a0aadf3b4f6140496073..d071c5cbf0131ba2517e9422773c9197b3ed8b28 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/i2c.h>
 #include <linux/videodev.h>
 #include <media/tuner.h>
+#include <media/v4l2-common.h>
 
 static int offset = 0;
 module_param(offset, int, 0666);
@@ -128,6 +129,7 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
        u8 buffer[4];
        int rc, IFPCoff, i, j;
        enum param_type desired_type;
+       struct tuner_params *params;
 
        tun = &tuners[t->type];
 
@@ -169,19 +171,20 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
                          IFPCoff,t->type);
                j = 0;
        }
+       params = &tun->params[j];
 
-       for (i = 0; i < tun->params[j].count; i++) {
-               if (freq > tun->params[j].ranges[i].limit)
+       for (i = 0; i < params->count; i++) {
+               if (freq > params->ranges[i].limit)
                        continue;
                break;
        }
-       if (i == tun->params[j].count) {
+       if (i == params->count) {
                tuner_dbg("TV frequency out of range (%d > %d)",
-                               freq, tun->params[j].ranges[i - 1].limit);
-               freq = tun->params[j].ranges[--i].limit;
+                               freq, params->ranges[i - 1].limit);
+               freq = params->ranges[--i].limit;
        }
-       config = tun->params[j].ranges[i].config;
-       cb     = tun->params[j].ranges[i].cb;
+       config = params->ranges[i].config;
+       cb     = params->ranges[i].cb;
        /*  i == 0 -> VHF_LO
         *  i == 1 -> VHF_HI
         *  i == 2 -> UHF     */
@@ -281,7 +284,7 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
                break;
        }
 
-       if (tuners[t->type].params->cb_first_if_lower_freq && div < t->last_div) {
+       if (params->cb_first_if_lower_freq && div < t->last_div) {
                buffer[0] = config;
                buffer[1] = cb;
                buffer[2] = (div>>8) & 0x7f;
@@ -293,6 +296,43 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
                buffer[3] = cb;
        }
        t->last_div = div;
+       if (params->has_tda9887) {
+               int config = 0;
+               int is_secam_l = (t->std & (V4L2_STD_SECAM_L | V4L2_STD_SECAM_LC)) &&
+                       !(t->std & ~(V4L2_STD_SECAM_L | V4L2_STD_SECAM_LC));
+
+               if (t->std == V4L2_STD_SECAM_LC) {
+                       if (params->port1_active ^ params->port1_invert_for_secam_lc)
+                               config |= TDA9887_PORT1_ACTIVE;
+                       if (params->port2_active ^ params->port2_invert_for_secam_lc)
+                               config |= TDA9887_PORT2_ACTIVE;
+               }
+               else {
+                       if (params->port1_active)
+                               config |= TDA9887_PORT1_ACTIVE;
+                       if (params->port2_active)
+                               config |= TDA9887_PORT2_ACTIVE;
+               }
+               if (params->intercarrier_mode)
+                       config |= TDA9887_INTERCARRIER;
+               if (is_secam_l) {
+                       if (i == 0 && params->default_top_secam_low)
+                               config |= TDA9887_TOP(params->default_top_secam_low);
+                       else if (i == 1 && params->default_top_secam_mid)
+                               config |= TDA9887_TOP(params->default_top_secam_mid);
+                       else if (params->default_top_secam_high)
+                               config |= TDA9887_TOP(params->default_top_secam_high);
+               }
+               else {
+                       if (i == 0 && params->default_top_low)
+                               config |= TDA9887_TOP(params->default_top_low);
+                       else if (i == 1 && params->default_top_mid)
+                               config |= TDA9887_TOP(params->default_top_mid);
+                       else if (params->default_top_high)
+                               config |= TDA9887_TOP(params->default_top_high);
+               }
+               i2c_clients_command(c->adapter, TDA9887_SET_CONFIG, &config);
+       }
        tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n",
                  buffer[0],buffer[1],buffer[2],buffer[3]);
 
@@ -339,6 +379,7 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq)
        u16 div;
        int rc, j;
        enum param_type desired_type = TUNER_PARAM_TYPE_RADIO;
+       struct tuner_params *params;
 
        tun = &tuners[t->type];
 
@@ -352,7 +393,8 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq)
                j = 0;
 
        div = (20 * freq / 16000) + (int)(20*10.7); /* IF 10.7 MHz */
-       buffer[2] = (tun->params[j].ranges[0].config & ~TUNER_RATIO_MASK) | TUNER_RATIO_SELECT_50; /* 50 kHz step */
+       params = &tun->params[j];
+       buffer[2] = (params->ranges[0].config & ~TUNER_RATIO_MASK) | TUNER_RATIO_SELECT_50; /* 50 kHz step */
 
        switch (t->type) {
        case TUNER_TENA_9533_DI:
@@ -384,7 +426,7 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq)
        }
        buffer[0] = (div>>8) & 0x7f;
        buffer[1] = div      & 0xff;
-       if (tuners[t->type].params->cb_first_if_lower_freq && div < t->last_div) {
+       if (params->cb_first_if_lower_freq && div < t->last_div) {
                buffer[0] = buffer[2];
                buffer[1] = buffer[3];
                buffer[2] = (div>>8) & 0x7f;
@@ -398,6 +440,18 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq)
               buffer[0],buffer[1],buffer[2],buffer[3]);
        t->last_div = div;
 
+       if (params->has_tda9887) {
+               int config = 0;
+               if (params->port1_active && !params->port1_fm_high_sensitivity)
+                       config |= TDA9887_PORT1_ACTIVE;
+               if (params->port2_active && !params->port2_fm_high_sensitivity)
+                       config |= TDA9887_PORT2_ACTIVE;
+               if (params->intercarrier_mode)
+                       config |= TDA9887_INTERCARRIER;
+/*             if (params->port1_set_for_fm_mono)
+                       config &= ~TDA9887_PORT1_ACTIVE;*/
+               i2c_clients_command(c->adapter, TDA9887_SET_CONFIG, &config);
+       }
        if (4 != (rc = i2c_master_send(c,buffer,4)))
                tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc);
 }
index 9d9226cb6393c389d481c502d09e32fb179582b4..a167e17c6dcd030d3d773c922146a364dd3aea4e 100644 (file)
@@ -380,6 +380,10 @@ static struct tuner_params tuner_philips_fq1216me_params[] = {
                .type   = TUNER_PARAM_TYPE_PAL,
                .ranges = tuner_lg_pal_ranges,
                .count  = ARRAY_SIZE(tuner_lg_pal_ranges),
+               .has_tda9887 = 1,
+               .port1_active = 1,
+               .port2_active = 1,
+               .port2_invert_for_secam_lc = 1,
        },
 };
 
@@ -542,6 +546,14 @@ static struct tuner_params tuner_fm1216me_mk3_params[] = {
                .ranges = tuner_fm1216me_mk3_pal_ranges,
                .count  = ARRAY_SIZE(tuner_fm1216me_mk3_pal_ranges),
                .cb_first_if_lower_freq = 1,
+               .has_tda9887 = 1,
+               .port1_active = 1,
+               .port2_active = 1,
+               .port2_invert_for_secam_lc = 1,
+               .port1_fm_high_sensitivity = 1,
+               .default_top_mid = -2,
+               .default_top_secam_mid = -2,
+               .default_top_secam_high = -2,
        },
 };
 
@@ -612,6 +624,10 @@ static struct tuner_params tuner_fm1236_mk3_params[] = {
                .ranges = tuner_fm1236_mk3_ntsc_ranges,
                .count  = ARRAY_SIZE(tuner_fm1236_mk3_ntsc_ranges),
                .cb_first_if_lower_freq = 1,
+               .has_tda9887 = 1,
+               .port1_active = 1,
+               .port2_active = 1,
+               .port1_fm_high_sensitivity = 1,
        },
 };
 
@@ -632,6 +648,8 @@ static struct tuner_params tuner_microtune_4049_fm5_params[] = {
                .type   = TUNER_PARAM_TYPE_PAL,
                .ranges = tuner_temic_4009f_5_pal_ranges,
                .count  = ARRAY_SIZE(tuner_temic_4009f_5_pal_ranges),
+               .has_tda9887 = 1,
+               .port1_invert_for_secam_lc = 1,
        },
 };
 
@@ -648,6 +666,8 @@ static struct tuner_params tuner_panasonic_vp27_params[] = {
                .type   = TUNER_PARAM_TYPE_NTSC,
                .ranges = tuner_panasonic_vp27_ntsc_ranges,
                .count  = ARRAY_SIZE(tuner_panasonic_vp27_ntsc_ranges),
+               .has_tda9887 = 1,
+               .intercarrier_mode = 1,
        },
 };
 
@@ -782,6 +802,13 @@ static struct tuner_params tuner_philips_fq1216ame_mk4_params[] = {
                .type   = TUNER_PARAM_TYPE_PAL,
                .ranges = tuner_philips_fq12_6a___mk4_pal_ranges,
                .count  = ARRAY_SIZE(tuner_philips_fq12_6a___mk4_pal_ranges),
+               .has_tda9887 = 1,
+               .port1_active = 1,
+               .port2_invert_for_secam_lc = 1,
+               .default_top_mid = -2,
+               .default_top_secam_low = -2,
+               .default_top_secam_mid = -2,
+               .default_top_secam_high = -2,
        },
 };
 
@@ -870,6 +897,12 @@ static struct tuner_params tuner_philips_fmd1216me_mk3_params[] = {
                .type   = TUNER_PARAM_TYPE_PAL,
                .ranges = tuner_philips_fmd1216me_mk3_pal_ranges,
                .count  = ARRAY_SIZE(tuner_philips_fmd1216me_mk3_pal_ranges),
+               .has_tda9887 = 1,
+               .port1_active = 1,
+               .port2_active = 1,
+               .port2_fm_high_sensitivity = 1,
+               .port2_invert_for_secam_lc = 1,
+               .port1_set_for_fm_mono = 1,
        },
 };
 
@@ -1005,6 +1038,7 @@ static struct tuner_params tuner_samsung_tcpn_2121p30a_params[] = {
                .type   = TUNER_PARAM_TYPE_NTSC,
                .ranges = tuner_samsung_tcpn_2121p30a_ntsc_ranges,
                .count  = ARRAY_SIZE(tuner_samsung_tcpn_2121p30a_ntsc_ranges),
+               .has_tda9887 = 1,
        },
 };
 
@@ -1037,6 +1071,10 @@ static struct tuner_params tuner_samsung_tcpg_6121p30a_params[] = {
                .type   = TUNER_PARAM_TYPE_PAL,
                .ranges = tuner_samsung_tcpg_6121p30a_pal_ranges,
                .count  = ARRAY_SIZE(tuner_samsung_tcpg_6121p30a_pal_ranges),
+               .has_tda9887 = 1,
+               .port1_active = 1,
+               .port2_active = 1,
+               .port2_invert_for_secam_lc = 1,
        },
 };
 
index c2b756107548ff56625b4d5c608381ffbf01746b..936e3f746fba59ca3f4f0cbf892408022ac80a23 100644 (file)
@@ -14,7 +14,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/kernel.h>
index 30f8d80ddcaa9c688ec817befb8872fcd156e5fd..d95529e8e51376dbadeea8e89f94ab770769cf6d 100644 (file)
@@ -73,14 +73,14 @@ static struct HAUPPAUGE_TUNER_FMT
 }
 hauppauge_tuner_fmt[] =
 {
-       { V4L2_STD_UNKNOWN," UNKNOWN" },
-       { V4L2_STD_UNKNOWN," FM" },
-       { V4L2_STD_PAL_BG, " PAL(B/G)" },
-       { V4L2_STD_NTSC_M, " NTSC(M)" },
-       { V4L2_STD_PAL_I,  " PAL(I)" },
-       { V4L2_STD_SECAM_L," SECAM(L/L')" },
-       { V4L2_STD_PAL_DK, " PAL(D/D1/K)" },
-       { V4L2_STD_ATSC,   " ATSC/DVB Digital" },
+       { V4L2_STD_UNKNOWN,                   " UNKNOWN" },
+       { V4L2_STD_UNKNOWN,                   " FM" },
+       { V4L2_STD_B|V4L2_STD_GH,             " PAL(B/G)" },
+       { V4L2_STD_MN,                        " NTSC(M)" },
+       { V4L2_STD_PAL_I,                     " PAL(I)" },
+       { V4L2_STD_SECAM_L|V4L2_STD_SECAM_LC, " SECAM(L/L')" },
+       { V4L2_STD_DK,                        " PAL(D/D1/K)" },
+       { V4L2_STD_ATSC,                      " ATSC/DVB Digital" },
 };
 
 /* This is the full list of possible tuners. Many thanks to Hauppauge for
@@ -219,7 +219,7 @@ hauppauge_tuner[] =
        { TUNER_ABSENT,        "Thompson DTT75105"},
        { TUNER_ABSENT,        "Conexant_CX24109"},
        { TUNER_TCL_2002N,     "TCL M2523_5N_E"},
-       { TUNER_ABSENT,        "TCL M2523_3DB_E"},
+       { TUNER_TCL_2002MB,    "TCL M2523_3DB_E"},
        { TUNER_ABSENT,        "Philips 8275A"},
        { TUNER_ABSENT,        "Microtune MT2060"},
        { TUNER_ABSENT,        "Philips FM1236 MK5"},
index 49dbee5f5628b49a38a299385e0da4d64b17eccd..051775d4c72611c89a1a6aeda4ba8260d90e81c0 100644 (file)
@@ -16,7 +16,6 @@
 #ifndef usbvideo_h
 #define        usbvideo_h
 
-#include <linux/config.h>
 #include <linux/videodev.h>
 #include <media/v4l2-common.h>
 #include <linux/usb.h>
index 19d3c20dc7efd73a4f1cf3b58376dbf953584011..d83a2c84d2334a279c7febcd070f6f7ef7a27899 100644 (file)
@@ -16,7 +16,6 @@
  *
  */
 
-#include <linux/config.h>
 
 #include <linux/init.h>
 #include <linux/module.h>
index 97f946db85978ae23e816b82b17d7ac84aa67e18..f06dc19e504a89652ae55c81c6911c4cd2438cc3 100644 (file)
@@ -44,7 +44,6 @@
  * Added Gerd Knorrs v4l1 enhancements (Justin Schoeman)
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 8f271de57fd6c8e0fe246b49cf692e6f02d4b510..2ae3fb250630be9dd7f51dfa82e6b61e36375ae1 100644 (file)
@@ -36,7 +36,6 @@
 #include <linux/slab.h>
 
 // kernel config is here (procfs flag)
-#include <linux/config.h>
 
 #ifdef CONFIG_PROC_FS
 #include <linux/proc_fs.h>
index 8c233720b6a50d3a56508ccdfb1c31ff5bcd941a..97a3bbeda5056acfa1a9fed0f05b836d6ce08269 100644 (file)
@@ -222,14 +222,14 @@ M                       zr36055[1] 0001 0000c001 00000000 (zr36050[1])
 /* ========================= */
 
 struct vfe_polarity {
-       int vsync_pol:1;
-       int hsync_pol:1;
-       int field_pol:1;
-       int blank_pol:1;
-       int subimg_pol:1;
-       int poe_pol:1;
-       int pvalid_pol:1;
-       int vclk_pol:1;
+       unsigned int vsync_pol:1;
+       unsigned int hsync_pol:1;
+       unsigned int field_pol:1;
+       unsigned int blank_pol:1;
+       unsigned int subimg_pol:1;
+       unsigned int poe_pol:1;
+       unsigned int pvalid_pol:1;
+       unsigned int vclk_pol:1;
 };
 
 struct vfe_settings {
index 2836b45ec2068bd34e519637ee891a483d74b1f3..ec7696e8f1fac3eaf3b47725c37db3ec1dde8154 100644 (file)
@@ -28,7 +28,6 @@
 #include <linux/spinlock.h>
 #include <linux/list.h>
 #include <linux/wait.h>
-#include <linux/config.h>
 #include <linux/param.h>
 #include <linux/types.h>
 #include <linux/rwsem.h>
index 958c1e6fc8529a7a9e6b8d53111ac707ef692c62..f2249ed25273bc5ded10a920e4891e587faf1c67 100644 (file)
@@ -29,7 +29,6 @@
 
 #include <linux/delay.h>
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -1381,7 +1380,7 @@ find_zr36057 (void)
 
                result = request_irq(zr->pci_dev->irq,
                                     zoran_irq,
-                                    SA_SHIRQ | SA_INTERRUPT,
+                                    IRQF_SHARED | IRQF_DISABLED,
                                     ZR_DEVNAME(zr),
                                     (void *) zr);
                if (result < 0) {
index 02168d9c218796a8c74b7f3cdf3baf921e31078b..3cbac2e8aed393b8f8acfb9e916a479f38330ae2 100644 (file)
@@ -27,7 +27,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
index 9711f6248ef75a0ba5001dabec60a58cf8207e86..d9a5876eb386f6ac411905e022a273fc9d8fe7bd 100644 (file)
@@ -44,7 +44,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/version.h>
 #include <linux/init.h>
 #include <linux/module.h>
index f4ffe79bdc5b710fd446694ad3b2fc9e7f77df7b..c7f6f6488360a191c8fa1eb713c76fd0c79ee88d 100644 (file)
@@ -27,7 +27,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
index 6ac3b67400895c489ca2612d0debbc3813b4adf4..50437383ed6297476380cc1f4ed49014a2778c9a 100644 (file)
@@ -1858,7 +1858,7 @@ int __init find_zoran(void)
                DEBUG(printk(KERN_DEBUG "zoran: mapped-memory at 0x%p\n",ztv->zoran_mem));
 
                result = request_irq(dev->irq, zoran_irq,
-                       SA_SHIRQ|SA_INTERRUPT,"zoran", ztv);
+                       IRQF_SHARED|IRQF_DISABLED,"zoran", ztv);
                if (result==-EINVAL)
                {
                        iounmap(ztv->zoran_mem);
index c87113d6cc6085d6501b4237a7a6127fc6958e98..416eaa93b8a4a85f0524685d85a95c916c32fac6 100644 (file)
@@ -18,7 +18,6 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
index 51740b346224b35fd80d79ad7e56882647d4a18b..b114236f43953ef126a85a6365812cfe2536ec01 100644 (file)
 #  For mptfc:
 #CFLAGS_mptfc.o += -DMPT_DEBUG_FC
 
+#  For mptsas:
+#CFLAGS_mptsas.o += -DMPT_DEBUG_SAS
+#CFLAGS_mptsas.o += -DMPT_DEBUG_SAS_WIDE
+
+
 #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-} LSI_LOGIC
 
 obj-$(CONFIG_FUSION_SPI)       += mptbase.o mptscsih.o mptspi.o
diff --git a/drivers/message/fusion/lsi/fc_log.h b/drivers/message/fusion/lsi/fc_log.h
deleted file mode 100644 (file)
index dc98d46..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- *  Copyright (c) 2000-2001 LSI Logic Corporation. All rights reserved.
- *
- *  NAME:           fc_log.h
- *  SUMMARY:        MPI IocLogInfo definitions for the SYMFC9xx chips
- *  DESCRIPTION:    Contains the enumerated list of values that may be returned
- *                  in the IOCLogInfo field of a MPI Default Reply Message.
- *
- *  CREATION DATE:  6/02/2000
- *  ID:             $Id: fc_log.h,v 4.6 2001/07/26 14:41:33 sschremm Exp $
- */
-
-
-/*
- * MpiIocLogInfo_t enum
- *
- * These 32 bit values are used in the IOCLogInfo field of the MPI reply
- * messages.
- * The value is 0xabcccccc where
- *          a = The type of log info as per the MPI spec. Since these codes are
- *              all for Fibre Channel this value will always be 2.
- *          b = Specifies a subclass of the firmware where
- *                  0 = FCP Initiator
- *                  1 = FCP Target
- *                  2 = LAN
- *                  3 = MPI Message Layer
- *                  4 = FC Link
- *                  5 = Context Manager
- *                  6 = Invalid Field Offset
- *                  7 = State Change Info
- *                  all others are reserved for future use
- *          c = A specific value within the subclass.
- *
- * NOTE: Any new values should be added to the end of each subclass so that the
- *       codes remain consistent across firmware releases.
- */
-typedef enum _MpiIocLogInfoFc
-{
-    MPI_IOCLOGINFO_FC_INIT_BASE                     = 0x20000000,
-    MPI_IOCLOGINFO_FC_INIT_ERROR_OUT_OF_ORDER_FRAME = 0x20000001, /* received an out of order frame - unsupported */
-    MPI_IOCLOGINFO_FC_INIT_ERROR_BAD_START_OF_FRAME = 0x20000002, /* Bad Rx Frame, bad start of frame primative */
-    MPI_IOCLOGINFO_FC_INIT_ERROR_BAD_END_OF_FRAME   = 0x20000003, /* Bad Rx Frame, bad end of frame primative */
-    MPI_IOCLOGINFO_FC_INIT_ERROR_OVER_RUN           = 0x20000004, /* Bad Rx Frame, overrun */
-    MPI_IOCLOGINFO_FC_INIT_ERROR_RX_OTHER           = 0x20000005, /* Other errors caught by IOC which require retries */
-    MPI_IOCLOGINFO_FC_INIT_ERROR_SUBPROC_DEAD       = 0x20000006, /* Main processor could not initialize sub-processor */
-    MPI_IOCLOGINFO_FC_INIT_ERROR_RX_OVERRUN         = 0x20000007, /* Scatter Gather overrun  */
-    MPI_IOCLOGINFO_FC_INIT_ERROR_RX_BAD_STATUS      = 0x20000008, /* Receiver detected context mismatch via invalid header */
-    MPI_IOCLOGINFO_FC_INIT_ERROR_RX_UNEXPECTED_FRAME= 0x20000009, /* CtxMgr detected unsupported frame type  */
-    MPI_IOCLOGINFO_FC_INIT_ERROR_LINK_FAILURE       = 0x2000000A, /* Link failure occurred  */
-    MPI_IOCLOGINFO_FC_INIT_ERROR_TX_TIMEOUT         = 0x2000000B, /* Transmitter timeout error */
-
-    MPI_IOCLOGINFO_FC_TARGET_BASE                   = 0x21000000,
-    MPI_IOCLOGINFO_FC_TARGET_NO_PDISC               = 0x21000001, /* not sent because we are waiting for a PDISC from the initiator */
-    MPI_IOCLOGINFO_FC_TARGET_NO_LOGIN               = 0x21000002, /* not sent because we are not logged in to the remote node */
-    MPI_IOCLOGINFO_FC_TARGET_DOAR_KILLED_BY_LIP     = 0x21000003, /* Data Out, Auto Response, not sent due to a LIP */
-    MPI_IOCLOGINFO_FC_TARGET_DIAR_KILLED_BY_LIP     = 0x21000004, /* Data In, Auto Response, not sent due to a LIP */
-    MPI_IOCLOGINFO_FC_TARGET_DIAR_MISSING_DATA      = 0x21000005, /* Data In, Auto Response, missing data frames */
-    MPI_IOCLOGINFO_FC_TARGET_DONR_KILLED_BY_LIP     = 0x21000006, /* Data Out, No Response, not sent due to a LIP */
-    MPI_IOCLOGINFO_FC_TARGET_WRSP_KILLED_BY_LIP     = 0x21000007, /* Auto-response after a write not sent due to a LIP */
-    MPI_IOCLOGINFO_FC_TARGET_DINR_KILLED_BY_LIP     = 0x21000008, /* Data In, No Response, not completed due to a LIP */
-    MPI_IOCLOGINFO_FC_TARGET_DINR_MISSING_DATA      = 0x21000009, /* Data In, No Response, missing data frames */
-    MPI_IOCLOGINFO_FC_TARGET_MRSP_KILLED_BY_LIP     = 0x2100000a, /* Manual Response not sent due to a LIP */
-    MPI_IOCLOGINFO_FC_TARGET_NO_CLASS_3             = 0x2100000b, /* not sent because remote node does not support Class 3 */
-    MPI_IOCLOGINFO_FC_TARGET_LOGIN_NOT_VALID        = 0x2100000c, /* not sent because login to remote node not validated */
-    MPI_IOCLOGINFO_FC_TARGET_FROM_OUTBOUND          = 0x2100000e, /* cleared from the outbound queue after a logout */
-    MPI_IOCLOGINFO_FC_TARGET_WAITING_FOR_DATA_IN    = 0x2100000f, /* cleared waiting for data after a logout */
-
-    MPI_IOCLOGINFO_FC_LAN_BASE                      = 0x22000000,
-    MPI_IOCLOGINFO_FC_LAN_TRANS_SGL_MISSING         = 0x22000001, /* Transaction Context Sgl Missing */
-    MPI_IOCLOGINFO_FC_LAN_TRANS_WRONG_PLACE         = 0x22000002, /* Transaction Context found before an EOB */
-    MPI_IOCLOGINFO_FC_LAN_TRANS_RES_BITS_SET        = 0x22000003, /* Transaction Context value has reserved bits set */
-    MPI_IOCLOGINFO_FC_LAN_WRONG_SGL_FLAG            = 0x22000004, /* Invalid SGL Flags */
-
-    MPI_IOCLOGINFO_FC_MSG_BASE                      = 0x23000000,
-
-    MPI_IOCLOGINFO_FC_LINK_BASE                     = 0x24000000,
-    MPI_IOCLOGINFO_FC_LINK_LOOP_INIT_TIMEOUT        = 0x24000001, /* Loop initialization timed out */
-    MPI_IOCLOGINFO_FC_LINK_ALREADY_INITIALIZED      = 0x24000002, /* Another system controller already initialized the loop */
-    MPI_IOCLOGINFO_FC_LINK_LINK_NOT_ESTABLISHED     = 0x24000003, /* Not synchronized to signal or still negotiating (possible cable problem) */
-    MPI_IOCLOGINFO_FC_LINK_CRC_ERROR                = 0x24000004, /* CRC check detected error on received frame */
-
-    MPI_IOCLOGINFO_FC_CTX_BASE                      = 0x25000000,
-
-    MPI_IOCLOGINFO_FC_INVALID_FIELD_BYTE_OFFSET     = 0x26000000, /* The lower 24 bits give the byte offset of the field in the request message that is invalid */
-    MPI_IOCLOGINFO_FC_INVALID_FIELD_MAX_OFFSET      = 0x26ffffff,
-
-    MPI_IOCLOGINFO_FC_STATE_CHANGE                  = 0x27000000  /* The lower 24 bits give additional information concerning state change */
-
-} MpiIocLogInfoFc_t;
index 02cdc840a06b0ab3c6c2d114c18699ac8b2430ad..81ad77622dacee63e3b0aa23054d12eadd087812 100644 (file)
@@ -6,7 +6,7 @@
  *          Title:  MPI Message independent structures and definitions
  *  Creation Date:  July 27, 2000
  *
- *    mpi.h Version:  01.05.10
+ *    mpi.h Version:  01.05.11
  *
  *  Version History
  *  ---------------
@@ -76,6 +76,7 @@
  *                      Added EEDP IOCStatus codes.
  *  08-03-05  01.05.09  Bumped MPI_HEADER_VERSION_UNIT.
  *  08-30-05  01.05.10  Added 2 new IOCStatus codes for Target.
+ *  03-27-06  01.05.11  Bumped MPI_HEADER_VERSION_UNIT.
  *  --------------------------------------------------------------------------
  */
 
 /* Note: The major versions of 0xe0 through 0xff are reserved */
 
 /* versioning for this MPI header set */
-#define MPI_HEADER_VERSION_UNIT             (0x0C)
+#define MPI_HEADER_VERSION_UNIT             (0x0D)
 #define MPI_HEADER_VERSION_DEV              (0x00)
 #define MPI_HEADER_VERSION_UNIT_MASK        (0xFF00)
 #define MPI_HEADER_VERSION_UNIT_SHIFT       (8)
index b1becec27e1bf021af9fde7bfb4d08d9b19d34b7..47e13e360c10aea30975a44c18e4f9ca36319288 100644 (file)
@@ -6,7 +6,7 @@
  *          Title:  MPI Config message, structures, and Pages
  *  Creation Date:  July 27, 2000
  *
- *    mpi_cnfg.h Version:  01.05.11
+ *    mpi_cnfg.h Version:  01.05.12
  *
  *  Version History
  *  ---------------
  *                      Added postpone SATA Init bit to SAS IO Unit Page 1
  *                      ControlFlags.
  *                      Changed LogEntry format for Log Page 0.
+ *  03-27-06  01.05.12  Added two new Flags defines for Manufacturing Page 4.
+ *                      Added Manufacturing Page 7.
+ *                      Added MPI_IOCPAGE2_CAP_FLAGS_RAID_64_BIT_ADDRESSING.
+ *                      Added IOC Page 6.
+ *                      Added PrevBootDeviceForm field to CONFIG_PAGE_BIOS_2.
+ *                      Added MaxLBAHigh field to RAID Volume Page 0.
+ *                      Added Nvdata version fields to SAS IO Unit Page 0.
+ *                      Added AdditionalControlFlags, MaxTargetPortConnectTime,
+ *                      ReportDeviceMissingDelay, and IODeviceMissingDelay
+ *                      fields to SAS IO Unit Page 1.
  *  --------------------------------------------------------------------------
  */
 
@@ -631,9 +641,11 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_4
 } CONFIG_PAGE_MANUFACTURING_4, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_4,
   ManufacturingPage4_t, MPI_POINTER pManufacturingPage4_t;
 
-#define MPI_MANUFACTURING4_PAGEVERSION                  (0x03)
+#define MPI_MANUFACTURING4_PAGEVERSION                  (0x04)
 
 /* defines for the Flags field */
+#define MPI_MANPAGE4_FORCE_BAD_BLOCK_TABLE              (0x80)
+#define MPI_MANPAGE4_FORCE_OFFLINE_FAILOVER             (0x40)
 #define MPI_MANPAGE4_IME_DISABLE                        (0x20)
 #define MPI_MANPAGE4_IM_DISABLE                         (0x10)
 #define MPI_MANPAGE4_IS_DISABLE                         (0x08)
@@ -668,6 +680,66 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_6
 #define MPI_MANUFACTURING6_PAGEVERSION                  (0x00)
 
 
+typedef struct _MPI_MANPAGE7_CONNECTOR_INFO
+{
+    U32                         Pinout;                 /* 00h */
+    U8                          Connector[16];          /* 04h */
+    U8                          Location;               /* 14h */
+    U8                          Reserved1;              /* 15h */
+    U16                         Slot;                   /* 16h */
+    U32                         Reserved2;              /* 18h */
+} MPI_MANPAGE7_CONNECTOR_INFO, MPI_POINTER PTR_MPI_MANPAGE7_CONNECTOR_INFO,
+  MpiManPage7ConnectorInfo_t, MPI_POINTER pMpiManPage7ConnectorInfo_t;
+
+/* defines for the Pinout field */
+#define MPI_MANPAGE7_PINOUT_SFF_8484_L4                 (0x00080000)
+#define MPI_MANPAGE7_PINOUT_SFF_8484_L3                 (0x00040000)
+#define MPI_MANPAGE7_PINOUT_SFF_8484_L2                 (0x00020000)
+#define MPI_MANPAGE7_PINOUT_SFF_8484_L1                 (0x00010000)
+#define MPI_MANPAGE7_PINOUT_SFF_8470_L4                 (0x00000800)
+#define MPI_MANPAGE7_PINOUT_SFF_8470_L3                 (0x00000400)
+#define MPI_MANPAGE7_PINOUT_SFF_8470_L2                 (0x00000200)
+#define MPI_MANPAGE7_PINOUT_SFF_8470_L1                 (0x00000100)
+#define MPI_MANPAGE7_PINOUT_SFF_8482                    (0x00000002)
+#define MPI_MANPAGE7_PINOUT_CONNECTION_UNKNOWN          (0x00000001)
+
+/* defines for the Location field */
+#define MPI_MANPAGE7_LOCATION_UNKNOWN                   (0x01)
+#define MPI_MANPAGE7_LOCATION_INTERNAL                  (0x02)
+#define MPI_MANPAGE7_LOCATION_EXTERNAL                  (0x04)
+#define MPI_MANPAGE7_LOCATION_SWITCHABLE                (0x08)
+#define MPI_MANPAGE7_LOCATION_AUTO                      (0x10)
+#define MPI_MANPAGE7_LOCATION_NOT_PRESENT               (0x20)
+#define MPI_MANPAGE7_LOCATION_NOT_CONNECTED             (0x80)
+
+/*
+ * Host code (drivers, BIOS, utilities, etc.) should leave this define set to
+ * one and check NumPhys at runtime.
+ */
+#ifndef MPI_MANPAGE7_CONNECTOR_INFO_MAX
+#define MPI_MANPAGE7_CONNECTOR_INFO_MAX   (1)
+#endif
+
+typedef struct _CONFIG_PAGE_MANUFACTURING_7
+{
+    CONFIG_PAGE_HEADER          Header;                 /* 00h */
+    U32                         Reserved1;              /* 04h */
+    U32                         Reserved2;              /* 08h */
+    U32                         Flags;                  /* 0Ch */
+    U8                          EnclosureName[16];      /* 10h */
+    U8                          NumPhys;                /* 20h */
+    U8                          Reserved3;              /* 21h */
+    U16                         Reserved4;              /* 22h */
+    MPI_MANPAGE7_CONNECTOR_INFO ConnectorInfo[MPI_MANPAGE7_CONNECTOR_INFO_MAX]; /* 24h */
+} CONFIG_PAGE_MANUFACTURING_7, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_7,
+  ManufacturingPage7_t, MPI_POINTER pManufacturingPage7_t;
+
+#define MPI_MANUFACTURING7_PAGEVERSION                  (0x00)
+
+/* defines for the Flags field */
+#define MPI_MANPAGE7_FLAG_USE_SLOT_INFO                 (0x00000001)
+
+
 /****************************************************************************
 *   IO Unit Config Pages
 ****************************************************************************/
@@ -867,7 +939,7 @@ typedef struct _CONFIG_PAGE_IOC_2
 } CONFIG_PAGE_IOC_2, MPI_POINTER PTR_CONFIG_PAGE_IOC_2,
   IOCPage2_t, MPI_POINTER pIOCPage2_t;
 
-#define MPI_IOCPAGE2_PAGEVERSION                        (0x03)
+#define MPI_IOCPAGE2_PAGEVERSION                        (0x04)
 
 /* IOC Page 2 Capabilities flags */
 
@@ -878,6 +950,7 @@ typedef struct _CONFIG_PAGE_IOC_2
 #define MPI_IOCPAGE2_CAP_FLAGS_RAID_6_SUPPORT           (0x00000010)
 #define MPI_IOCPAGE2_CAP_FLAGS_RAID_10_SUPPORT          (0x00000020)
 #define MPI_IOCPAGE2_CAP_FLAGS_RAID_50_SUPPORT          (0x00000040)
+#define MPI_IOCPAGE2_CAP_FLAGS_RAID_64_BIT_ADDRESSING   (0x10000000)
 #define MPI_IOCPAGE2_CAP_FLAGS_SES_SUPPORT              (0x20000000)
 #define MPI_IOCPAGE2_CAP_FLAGS_SAFTE_SUPPORT            (0x40000000)
 #define MPI_IOCPAGE2_CAP_FLAGS_CROSS_CHANNEL_SUPPORT    (0x80000000)
@@ -975,6 +1048,44 @@ typedef struct _CONFIG_PAGE_IOC_5
 
 #define MPI_IOCPAGE5_PAGEVERSION                        (0x00)
 
+typedef struct _CONFIG_PAGE_IOC_6
+{
+    CONFIG_PAGE_HEADER          Header;                         /* 00h */
+    U32                         CapabilitiesFlags;              /* 04h */
+    U8                          MaxDrivesIS;                    /* 08h */
+    U8                          MaxDrivesIM;                    /* 09h */
+    U8                          MaxDrivesIME;                   /* 0Ah */
+    U8                          Reserved1;                      /* 0Bh */
+    U8                          MinDrivesIS;                    /* 0Ch */
+    U8                          MinDrivesIM;                    /* 0Dh */
+    U8                          MinDrivesIME;                   /* 0Eh */
+    U8                          Reserved2;                      /* 0Fh */
+    U8                          MaxGlobalHotSpares;             /* 10h */
+    U8                          Reserved3;                      /* 11h */
+    U16                         Reserved4;                      /* 12h */
+    U32                         Reserved5;                      /* 14h */
+    U32                         SupportedStripeSizeMapIS;       /* 18h */
+    U32                         SupportedStripeSizeMapIME;      /* 1Ch */
+    U32                         Reserved6;                      /* 20h */
+    U8                          MetadataSize;                   /* 24h */
+    U8                          Reserved7;                      /* 25h */
+    U16                         Reserved8;                      /* 26h */
+    U16                         MaxBadBlockTableEntries;        /* 28h */
+    U16                         Reserved9;                      /* 2Ah */
+    U16                         IRNvsramUsage;                  /* 2Ch */
+    U16                         Reserved10;                     /* 2Eh */
+    U32                         IRNvsramVersion;                /* 30h */
+    U32                         Reserved11;                     /* 34h */
+    U32                         Reserved12;                     /* 38h */
+} CONFIG_PAGE_IOC_6, MPI_POINTER PTR_CONFIG_PAGE_IOC_6,
+  IOCPage6_t, MPI_POINTER pIOCPage6_t;
+
+#define MPI_IOCPAGE6_PAGEVERSION                        (0x00)
+
+/* IOC Page 6 Capabilities Flags */
+
+#define MPI_IOCPAGE6_CAP_FLAGS_GLOBAL_HOT_SPARE         (0x00000001)
+
 
 /****************************************************************************
 *   BIOS Config Pages
@@ -1218,13 +1329,13 @@ typedef struct _CONFIG_PAGE_BIOS_2
     U32                         Reserved5;              /* 14h */
     U32                         Reserved6;              /* 18h */
     U8                          BootDeviceForm;         /* 1Ch */
-    U8                          Reserved7;              /* 1Dh */
+    U8                          PrevBootDeviceForm;     /* 1Ch */
     U16                         Reserved8;              /* 1Eh */
     MPI_BIOSPAGE2_BOOT_DEVICE   BootDevice;             /* 20h */
 } CONFIG_PAGE_BIOS_2, MPI_POINTER PTR_CONFIG_PAGE_BIOS_2,
   BIOSPage2_t, MPI_POINTER pBIOSPage2_t;
 
-#define MPI_BIOSPAGE2_PAGEVERSION                       (0x01)
+#define MPI_BIOSPAGE2_PAGEVERSION                       (0x02)
 
 #define MPI_BIOSPAGE2_FORM_MASK                         (0x0F)
 #define MPI_BIOSPAGE2_FORM_ADAPTER_ORDER                (0x00)
@@ -2080,7 +2191,7 @@ typedef struct _CONFIG_PAGE_RAID_VOL_0
     RAID_VOL0_STATUS        VolumeStatus;   /* 08h */
     RAID_VOL0_SETTINGS      VolumeSettings; /* 0Ch */
     U32                     MaxLBA;         /* 10h */
-    U32                     Reserved1;      /* 14h */
+    U32                     MaxLBAHigh;     /* 14h */
     U32                     StripeSize;     /* 18h */
     U32                     Reserved2;      /* 1Ch */
     U32                     Reserved3;      /* 20h */
@@ -2092,7 +2203,7 @@ typedef struct _CONFIG_PAGE_RAID_VOL_0
 } CONFIG_PAGE_RAID_VOL_0, MPI_POINTER PTR_CONFIG_PAGE_RAID_VOL_0,
   RaidVolumePage0_t, MPI_POINTER pRaidVolumePage0_t;
 
-#define MPI_RAIDVOLPAGE0_PAGEVERSION                    (0x05)
+#define MPI_RAIDVOLPAGE0_PAGEVERSION                    (0x06)
 
 /* values for RAID Volume Page 0 InactiveStatus field */
 #define MPI_RAIDVOLPAGE0_UNKNOWN_INACTIVE               (0x00)
@@ -2324,7 +2435,8 @@ typedef struct _MPI_SAS_IO_UNIT0_PHY_DATA
 typedef struct _CONFIG_PAGE_SAS_IO_UNIT_0
 {
     CONFIG_EXTENDED_PAGE_HEADER     Header;                             /* 00h */
-    U32                             Reserved1;                          /* 08h */
+    U16                             NvdataVersionDefault;               /* 08h */
+    U16                             NvdataVersionPersistent;            /* 0Ah */
     U8                              NumPhys;                            /* 0Ch */
     U8                              Reserved2;                          /* 0Dh */
     U16                             Reserved3;                          /* 0Eh */
@@ -2332,7 +2444,7 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_0
 } CONFIG_PAGE_SAS_IO_UNIT_0, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_0,
   SasIOUnitPage0_t, MPI_POINTER pSasIOUnitPage0_t;
 
-#define MPI_SASIOUNITPAGE0_PAGEVERSION      (0x03)
+#define MPI_SASIOUNITPAGE0_PAGEVERSION      (0x04)
 
 /* values for SAS IO Unit Page 0 PortFlags */
 #define MPI_SAS_IOUNIT0_PORT_FLAGS_DISCOVERY_IN_PROGRESS    (0x08)
@@ -2373,12 +2485,13 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_0
 
 typedef struct _MPI_SAS_IO_UNIT1_PHY_DATA
 {
-    U8          Port;                   /* 00h */
-    U8          PortFlags;              /* 01h */
-    U8          PhyFlags;               /* 02h */
-    U8          MaxMinLinkRate;         /* 03h */
-    U32         ControllerPhyDeviceInfo;/* 04h */
-    U32         Reserved1;              /* 08h */
+    U8          Port;                       /* 00h */
+    U8          PortFlags;                  /* 01h */
+    U8          PhyFlags;                   /* 02h */
+    U8          MaxMinLinkRate;             /* 03h */
+    U32         ControllerPhyDeviceInfo;    /* 04h */
+    U16         MaxTargetPortConnectTime;   /* 08h */
+    U16         Reserved1;                  /* 0Ah */
 } MPI_SAS_IO_UNIT1_PHY_DATA, MPI_POINTER PTR_MPI_SAS_IO_UNIT1_PHY_DATA,
   SasIOUnit1PhyData, MPI_POINTER pSasIOUnit1PhyData;
 
@@ -2395,15 +2508,17 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_1
     CONFIG_EXTENDED_PAGE_HEADER Header;                             /* 00h */
     U16                         ControlFlags;                       /* 08h */
     U16                         MaxNumSATATargets;                  /* 0Ah */
-    U32                         Reserved1;                          /* 0Ch */
+    U16                         AdditionalControlFlags;             /* 0Ch */
+    U16                         Reserved1;                          /* 0Eh */
     U8                          NumPhys;                            /* 10h */
     U8                          SATAMaxQDepth;                      /* 11h */
-    U16                         Reserved2;                          /* 12h */
+    U8                          ReportDeviceMissingDelay;           /* 12h */
+    U8                          IODeviceMissingDelay;               /* 13h */
     MPI_SAS_IO_UNIT1_PHY_DATA   PhyData[MPI_SAS_IOUNIT1_PHY_MAX];   /* 14h */
 } CONFIG_PAGE_SAS_IO_UNIT_1, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_1,
   SasIOUnitPage1_t, MPI_POINTER pSasIOUnitPage1_t;
 
-#define MPI_SASIOUNITPAGE1_PAGEVERSION      (0x05)
+#define MPI_SASIOUNITPAGE1_PAGEVERSION      (0x06)
 
 /* values for SAS IO Unit Page 1 ControlFlags */
 #define MPI_SAS_IOUNIT1_CONTROL_DEVICE_SELF_TEST            (0x8000)
@@ -2428,6 +2543,13 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_1
 #define MPI_SAS_IOUNIT1_CONTROL_FIRST_LVL_DISC_ONLY         (0x0002)
 #define MPI_SAS_IOUNIT1_CONTROL_CLEAR_AFFILIATION           (0x0001)
 
+/* values for SAS IO Unit Page 1 AdditionalControlFlags */
+#define MPI_SAS_IOUNIT1_ACONTROL_ALLOW_TABLE_TO_TABLE       (0x0001)
+
+/* defines for SAS IO Unit Page 1 ReportDeviceMissingDelay */
+#define MPI_SAS_IOUNIT1_REPORT_MISSING_TIMEOUT_MASK         (0x7F)
+#define MPI_SAS_IOUNIT1_REPORT_MISSING_UNIT_16              (0x80)
+
 /* values for SAS IO Unit Page 1 PortFlags */
 #define MPI_SAS_IOUNIT1_PORT_FLAGS_0_TARGET_IOC_NUM         (0x00)
 #define MPI_SAS_IOUNIT1_PORT_FLAGS_1_TARGET_IOC_NUM         (0x04)
index 4a5f8dd1d7666711ccc0f29ad1395e88e30a7a4a..582cfe7c2aa10a81b823aeda0d025e0bd7687431 100644 (file)
@@ -6,25 +6,25 @@
  Copyright (c) 2000-2005 LSI Logic Corporation.
 
  ---------------------------------------
- Header Set Release Version:    01.05.12
- Header Set Release Date:       08-30-05
+ Header Set Release Version:    01.05.13
+ Header Set Release Date:       03-27-06
  ---------------------------------------
 
  Filename               Current version     Prior version
  ----------             ---------------     -------------
- mpi.h                  01.05.10            01.05.09
- mpi_ioc.h              01.05.10            01.05.09
- mpi_cnfg.h             01.05.11            01.05.10
- mpi_init.h             01.05.06            01.05.06
- mpi_targ.h             01.05.05            01.05.05
+ mpi.h                  01.05.11            01.05.10
+ mpi_ioc.h              01.05.11            01.05.10
+ mpi_cnfg.h             01.05.12            01.05.11
+ mpi_init.h             01.05.07            01.05.06
+ mpi_targ.h             01.05.06            01.05.05
  mpi_fc.h               01.05.01            01.05.01
  mpi_lan.h              01.05.01            01.05.01
  mpi_raid.h             01.05.02            01.05.02
  mpi_tool.h             01.05.03            01.05.03
  mpi_inb.h              01.05.01            01.05.01
- mpi_sas.h              01.05.02            01.05.01
- mpi_type.h             01.05.02            01.05.01
- mpi_history.txt        01.05.12            01.05.11
+ mpi_sas.h              01.05.03            01.05.02
+ mpi_type.h             01.05.02            01.05.02
+ mpi_history.txt        01.05.13            01.05.12
 
 
  *  Date      Version   Description
@@ -93,6 +93,7 @@ mpi.h
  *                      Added EEDP IOCStatus codes.
  *  08-03-05  01.05.09  Bumped MPI_HEADER_VERSION_UNIT.
  *  08-30-05  01.05.10  Added 2 new IOCStatus codes for Target.
+ *  03-27-06  01.05.11  Bumped MPI_HEADER_VERSION_UNIT.
  *  --------------------------------------------------------------------------
 
 mpi_ioc.h
@@ -170,6 +171,17 @@ mpi_ioc.h
  *                      Added new ReasonCode value for SAS Device Status Change
  *                      event.
  *                      Added new family code for FC949E.
+ *  03-27-06  01.05.11  Added MPI_IOCFACTS_CAPABILITY_TLR.
+ *                      Added additional Reason Codes and more event data fields
+ *                      to EVENT_DATA_SAS_DEVICE_STATUS_CHANGE.
+ *                      Added EVENT_DATA_SAS_BROADCAST_PRIMITIVE structure and
+ *                      new event.
+ *                      Added MPI_EVENT_SAS_SMP_ERROR and event data structure.
+ *                      Added MPI_EVENT_SAS_INIT_DEVICE_STATUS_CHANGE and event
+ *                      data structure.
+ *                      Added MPI_EVENT_SAS_INIT_TABLE_OVERFLOW and event
+ *                      data structure.
+ *                      Added MPI_EXT_IMAGE_TYPE_INITIALIZATION.
  *  --------------------------------------------------------------------------
 
 mpi_cnfg.h
@@ -425,6 +437,16 @@ mpi_cnfg.h
  *                      Added postpone SATA Init bit to SAS IO Unit Page 1
  *                      ControlFlags.
  *                      Changed LogEntry format for Log Page 0.
+ *  03-27-06  01.05.12  Added two new Flags defines for Manufacturing Page 4.
+ *                      Added Manufacturing Page 7.
+ *                      Added MPI_IOCPAGE2_CAP_FLAGS_RAID_64_BIT_ADDRESSING.
+ *                      Added IOC Page 6.
+ *                      Added PrevBootDeviceForm field to CONFIG_PAGE_BIOS_2.
+ *                      Added MaxLBAHigh field to RAID Volume Page 0.
+ *                      Added Nvdata version fields to SAS IO Unit Page 0.
+ *                      Added AdditionalControlFlags, MaxTargetPortConnectTime,
+ *                      ReportDeviceMissingDelay, and IODeviceMissingDelay
+ *                      fields to SAS IO Unit Page 1.
  *  --------------------------------------------------------------------------
 
 mpi_init.h
@@ -467,6 +489,7 @@ mpi_init.h
  *                      Added four new defines for SEP SlotStatus.
  *  08-03-05  01.05.06  Fixed some MPI_SCSIIO32_MSGFLGS_ defines to make them
  *                      unique in the first 32 characters.
+ *  03-27-06  01.05.07  Added Task Management type of Clear ACA.
  *  --------------------------------------------------------------------------
 
 mpi_targ.h
@@ -511,6 +534,7 @@ mpi_targ.h
  *  02-22-05  01.05.03  Changed a comment.
  *  03-11-05  01.05.04  Removed TargetAssistExtended Request.
  *  06-24-05  01.05.05  Added TargetAssistExtended structures and defines.
+ *  03-27-06  01.05.06  Added a comment.
  *  --------------------------------------------------------------------------
 
 mpi_fc.h
@@ -610,6 +634,10 @@ mpi_sas.h
  *  08-30-05  01.05.02  Added DeviceInfo bit for SEP.
  *                      Added PrimFlags and Primitive field to SAS IO Unit
  *                      Control request, and added a new operation code.
+ *  03-27-06  01.05.03  Added Force Full Discovery, Transmit Port Select Signal,
+ *                      and Remove Device operations to SAS IO Unit Control.
+ *                      Added DevHandle field to SAS IO Unit Control request and
+ *                      reply.
  *  --------------------------------------------------------------------------
 
 mpi_type.h
@@ -625,20 +653,20 @@ mpi_type.h
 
 mpi_history.txt         Parts list history
 
-Filename    01.05.12  01.05.11  01.05.10  01.05.09
-----------  --------  --------  --------  --------
-mpi.h       01.05.10  01.05.09  01.05.08  01.05.07
-mpi_ioc.h   01.05.10  01.05.09  01.05.09  01.05.08
-mpi_cnfg.h  01.05.11  01.05.10  01.05.09  01.05.08
-mpi_init.h  01.05.06  01.05.06  01.05.05  01.05.04
-mpi_targ.h  01.05.05  01.05.05  01.05.05  01.05.04
-mpi_fc.h    01.05.01  01.05.01  01.05.01  01.05.01
-mpi_lan.h   01.05.01  01.05.01  01.05.01  01.05.01
-mpi_raid.h  01.05.02  01.05.02  01.05.02  01.05.02
-mpi_tool.h  01.05.03  01.05.03  01.05.03  01.05.03
-mpi_inb.h   01.05.01  01.05.01  01.05.01  01.05.01
-mpi_sas.h   01.05.02  01.05.01  01.05.01  01.05.01
-mpi_type.h  01.05.02  01.05.01  01.05.01  01.05.01
+Filename    01.05.13  01.05.12  01.05.11  01.05.10  01.05.09
+----------  --------  --------  --------  --------  --------
+mpi.h       01.05.11  01.05.10  01.05.09  01.05.08  01.05.07
+mpi_ioc.h   01.05.11  01.05.10  01.05.09  01.05.09  01.05.08
+mpi_cnfg.h  01.05.12  01.05.11  01.05.10  01.05.09  01.05.08
+mpi_init.h  01.05.07  01.05.06  01.05.06  01.05.05  01.05.04
+mpi_targ.h  01.05.06  01.05.05  01.05.05  01.05.05  01.05.04
+mpi_fc.h    01.05.01  01.05.01  01.05.01  01.05.01  01.05.01
+mpi_lan.h   01.05.01  01.05.01  01.05.01  01.05.01  01.05.01
+mpi_raid.h  01.05.02  01.05.02  01.05.02  01.05.02  01.05.02
+mpi_tool.h  01.05.03  01.05.03  01.05.03  01.05.03  01.05.03
+mpi_inb.h   01.05.01  01.05.01  01.05.01  01.05.01  01.05.01
+mpi_sas.h   01.05.03  01.05.02  01.05.01  01.05.01  01.05.01
+mpi_type.h  01.05.02  01.05.02  01.05.01  01.05.01  01.05.01
 
 Filename    01.05.08   01.05.07   01.05.06   01.05.05   01.05.04   01.05.03
 ----------  --------   --------   --------   --------   --------   --------
index 68941f459ca33e3ae41ca0f26b886ecdea6c464d..c1c678989a2370335d548d2facd15d70970446df 100644 (file)
@@ -6,7 +6,7 @@
  *          Title:  MPI initiator mode messages and structures
  *  Creation Date:  June 8, 2000
  *
- *    mpi_init.h Version:  01.05.06
+ *    mpi_init.h Version:  01.05.07
  *
  *  Version History
  *  ---------------
@@ -52,6 +52,7 @@
  *                      Added four new defines for SEP SlotStatus.
  *  08-03-05  01.05.06  Fixed some MPI_SCSIIO32_MSGFLGS_ defines to make them
  *                      unique in the first 32 characters.
+ *  03-27-06  01.05.07  Added Task Management type of Clear ACA.
  *  --------------------------------------------------------------------------
  */
 
@@ -427,6 +428,7 @@ typedef struct _MSG_SCSI_TASK_MGMT
 #define MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET    (0x05)
 #define MPI_SCSITASKMGMT_TASKTYPE_CLEAR_TASK_SET        (0x06)
 #define MPI_SCSITASKMGMT_TASKTYPE_QUERY_TASK            (0x07)
+#define MPI_SCSITASKMGMT_TASKTYPE_CLEAR_ACA             (0x08)
 
 /* MsgFlags bits */
 #define MPI_SCSITASKMGMT_MSGFLAGS_TARGET_RESET_OPTION   (0x00)
index 2c5f43fa7c73d742522b1cc00e0163731f398fa1..18ba407fd3998093694c58c5b2f313aba6cbe008 100644 (file)
@@ -6,7 +6,7 @@
  *          Title:  MPI IOC, Port, Event, FW Download, and FW Upload messages
  *  Creation Date:  August 11, 2000
  *
- *    mpi_ioc.h Version:  01.05.10
+ *    mpi_ioc.h Version:  01.05.11
  *
  *  Version History
  *  ---------------
  *                      Added new ReasonCode value for SAS Device Status Change
  *                      event.
  *                      Added new family code for FC949E.
+ *  03-27-06  01.05.11  Added MPI_IOCFACTS_CAPABILITY_TLR.
+ *                      Added additional Reason Codes and more event data fields
+ *                      to EVENT_DATA_SAS_DEVICE_STATUS_CHANGE.
+ *                      Added EVENT_DATA_SAS_BROADCAST_PRIMITIVE structure and
+ *                      new event.
+ *                      Added MPI_EVENT_SAS_SMP_ERROR and event data structure.
+ *                      Added MPI_EVENT_SAS_INIT_DEVICE_STATUS_CHANGE and event
+ *                      data structure.
+ *                      Added MPI_EVENT_SAS_INIT_TABLE_OVERFLOW and event
+ *                      data structure.
+ *                      Added MPI_EXT_IMAGE_TYPE_INITIALIZATION.
  *  --------------------------------------------------------------------------
  */
 
@@ -272,6 +283,7 @@ typedef struct _MSG_IOC_FACTS_REPLY
 #define MPI_IOCFACTS_CAPABILITY_MULTICAST               (0x00000100)
 #define MPI_IOCFACTS_CAPABILITY_SCSIIO32                (0x00000200)
 #define MPI_IOCFACTS_CAPABILITY_NO_SCSIIO16             (0x00000400)
+#define MPI_IOCFACTS_CAPABILITY_TLR                     (0x00000800)
 
 
 /*****************************************************************************
@@ -448,30 +460,34 @@ typedef struct _MSG_EVENT_ACK_REPLY
 
 /* Event */
 
-#define MPI_EVENT_NONE                      (0x00000000)
-#define MPI_EVENT_LOG_DATA                  (0x00000001)
-#define MPI_EVENT_STATE_CHANGE              (0x00000002)
-#define MPI_EVENT_UNIT_ATTENTION            (0x00000003)
-#define MPI_EVENT_IOC_BUS_RESET             (0x00000004)
-#define MPI_EVENT_EXT_BUS_RESET             (0x00000005)
-#define MPI_EVENT_RESCAN                    (0x00000006)
-#define MPI_EVENT_LINK_STATUS_CHANGE        (0x00000007)
-#define MPI_EVENT_LOOP_STATE_CHANGE         (0x00000008)
-#define MPI_EVENT_LOGOUT                    (0x00000009)
-#define MPI_EVENT_EVENT_CHANGE              (0x0000000A)
-#define MPI_EVENT_INTEGRATED_RAID           (0x0000000B)
-#define MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE (0x0000000C)
-#define MPI_EVENT_ON_BUS_TIMER_EXPIRED      (0x0000000D)
-#define MPI_EVENT_QUEUE_FULL                (0x0000000E)
-#define MPI_EVENT_SAS_DEVICE_STATUS_CHANGE  (0x0000000F)
-#define MPI_EVENT_SAS_SES                   (0x00000010)
-#define MPI_EVENT_PERSISTENT_TABLE_FULL     (0x00000011)
-#define MPI_EVENT_SAS_PHY_LINK_STATUS       (0x00000012)
-#define MPI_EVENT_SAS_DISCOVERY_ERROR       (0x00000013)
-#define MPI_EVENT_IR_RESYNC_UPDATE          (0x00000014)
-#define MPI_EVENT_IR2                       (0x00000015)
-#define MPI_EVENT_SAS_DISCOVERY             (0x00000016)
-#define MPI_EVENT_LOG_ENTRY_ADDED           (0x00000021)
+#define MPI_EVENT_NONE                          (0x00000000)
+#define MPI_EVENT_LOG_DATA                      (0x00000001)
+#define MPI_EVENT_STATE_CHANGE                  (0x00000002)
+#define MPI_EVENT_UNIT_ATTENTION                (0x00000003)
+#define MPI_EVENT_IOC_BUS_RESET                 (0x00000004)
+#define MPI_EVENT_EXT_BUS_RESET                 (0x00000005)
+#define MPI_EVENT_RESCAN                        (0x00000006)
+#define MPI_EVENT_LINK_STATUS_CHANGE            (0x00000007)
+#define MPI_EVENT_LOOP_STATE_CHANGE             (0x00000008)
+#define MPI_EVENT_LOGOUT                        (0x00000009)
+#define MPI_EVENT_EVENT_CHANGE                  (0x0000000A)
+#define MPI_EVENT_INTEGRATED_RAID               (0x0000000B)
+#define MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE     (0x0000000C)
+#define MPI_EVENT_ON_BUS_TIMER_EXPIRED          (0x0000000D)
+#define MPI_EVENT_QUEUE_FULL                    (0x0000000E)
+#define MPI_EVENT_SAS_DEVICE_STATUS_CHANGE      (0x0000000F)
+#define MPI_EVENT_SAS_SES                       (0x00000010)
+#define MPI_EVENT_PERSISTENT_TABLE_FULL         (0x00000011)
+#define MPI_EVENT_SAS_PHY_LINK_STATUS           (0x00000012)
+#define MPI_EVENT_SAS_DISCOVERY_ERROR           (0x00000013)
+#define MPI_EVENT_IR_RESYNC_UPDATE              (0x00000014)
+#define MPI_EVENT_IR2                           (0x00000015)
+#define MPI_EVENT_SAS_DISCOVERY                 (0x00000016)
+#define MPI_EVENT_SAS_BROADCAST_PRIMITIVE       (0x00000017)
+#define MPI_EVENT_SAS_INIT_DEVICE_STATUS_CHANGE (0x00000018)
+#define MPI_EVENT_SAS_INIT_TABLE_OVERFLOW       (0x00000019)
+#define MPI_EVENT_SAS_SMP_ERROR                 (0x0000001A)
+#define MPI_EVENT_LOG_ENTRY_ADDED               (0x00000021)
 
 /* AckRequired field values */
 
@@ -558,18 +574,25 @@ typedef struct _EVENT_DATA_SAS_DEVICE_STATUS_CHANGE
     U8                      PhyNum;                     /* 0Eh */
     U8                      Reserved1;                  /* 0Fh */
     U64                     SASAddress;                 /* 10h */
+    U8                      LUN[8];                     /* 18h */
+    U16                     TaskTag;                    /* 20h */
+    U16                     Reserved2;                  /* 22h */
 } EVENT_DATA_SAS_DEVICE_STATUS_CHANGE,
   MPI_POINTER PTR_EVENT_DATA_SAS_DEVICE_STATUS_CHANGE,
   MpiEventDataSasDeviceStatusChange_t,
   MPI_POINTER pMpiEventDataSasDeviceStatusChange_t;
 
 /* MPI SAS Device Status Change Event data ReasonCode values */
-#define MPI_EVENT_SAS_DEV_STAT_RC_ADDED                 (0x03)
-#define MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING        (0x04)
-#define MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA            (0x05)
-#define MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED      (0x06)
-#define MPI_EVENT_SAS_DEV_STAT_RC_UNSUPPORTED           (0x07)
-#define MPI_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET (0x08)
+#define MPI_EVENT_SAS_DEV_STAT_RC_ADDED                     (0x03)
+#define MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING            (0x04)
+#define MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA                (0x05)
+#define MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED          (0x06)
+#define MPI_EVENT_SAS_DEV_STAT_RC_UNSUPPORTED               (0x07)
+#define MPI_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET     (0x08)
+#define MPI_EVENT_SAS_DEV_STAT_RC_TASK_ABORT_INTERNAL       (0x09)
+#define MPI_EVENT_SAS_DEV_STAT_RC_ABORT_TASK_SET_INTERNAL   (0x0A)
+#define MPI_EVENT_SAS_DEV_STAT_RC_CLEAR_TASK_SET_INTERNAL   (0x0B)
+#define MPI_EVENT_SAS_DEV_STAT_RC_QUERY_TASK_INTERNAL       (0x0C)
 
 
 /* SCSI Event data for Queue Full event */
@@ -742,6 +765,27 @@ typedef struct _EVENT_DATA_SAS_SES
 } EVENT_DATA_SAS_SES, MPI_POINTER PTR_EVENT_DATA_SAS_SES,
   MpiEventDataSasSes_t, MPI_POINTER pMpiEventDataSasSes_t;
 
+/* SAS Broadcast Primitive Event data */
+
+typedef struct _EVENT_DATA_SAS_BROADCAST_PRIMITIVE
+{
+    U8                      PhyNum;                     /* 00h */
+    U8                      Port;                       /* 01h */
+    U8                      PortWidth;                  /* 02h */
+    U8                      Primitive;                  /* 04h */
+} EVENT_DATA_SAS_BROADCAST_PRIMITIVE,
+  MPI_POINTER PTR_EVENT_DATA_SAS_BROADCAST_PRIMITIVE,
+  MpiEventDataSasBroadcastPrimitive_t,
+  MPI_POINTER pMpiEventDataSasBroadcastPrimitive_t;
+
+#define MPI_EVENT_PRIMITIVE_CHANGE              (0x01)
+#define MPI_EVENT_PRIMITIVE_EXPANDER            (0x03)
+#define MPI_EVENT_PRIMITIVE_RESERVED2           (0x04)
+#define MPI_EVENT_PRIMITIVE_RESERVED3           (0x05)
+#define MPI_EVENT_PRIMITIVE_RESERVED4           (0x06)
+#define MPI_EVENT_PRIMITIVE_CHANGE0_RESERVED    (0x07)
+#define MPI_EVENT_PRIMITIVE_CHANGE1_RESERVED    (0x08)
+
 /* SAS Phy Link Status Event data */
 
 typedef struct _EVENT_DATA_SAS_PHY_LINK_STATUS
@@ -804,6 +848,53 @@ typedef struct _EVENT_DATA_DISCOVERY_ERROR
 #define MPI_EVENT_DSCVRY_ERR_DS_MULTPL_PATHS                (0x00000800)
 #define MPI_EVENT_DSCVRY_ERR_DS_MAX_SATA_TARGETS            (0x00001000)
 
+/* SAS SMP Error Event data */
+
+typedef struct _EVENT_DATA_SAS_SMP_ERROR
+{
+    U8                      Status;                     /* 00h */
+    U8                      Port;                       /* 01h */
+    U8                      SMPFunctionResult;          /* 02h */
+    U8                      Reserved1;                  /* 03h */
+    U64                     SASAddress;                 /* 04h */
+} EVENT_DATA_SAS_SMP_ERROR, MPI_POINTER PTR_EVENT_DATA_SAS_SMP_ERROR,
+  MpiEventDataSasSmpError_t, MPI_POINTER pMpiEventDataSasSmpError_t;
+
+/* defines for the Status field of the SAS SMP Error event */
+#define MPI_EVENT_SAS_SMP_FUNCTION_RESULT_VALID         (0x00)
+#define MPI_EVENT_SAS_SMP_CRC_ERROR                     (0x01)
+#define MPI_EVENT_SAS_SMP_TIMEOUT                       (0x02)
+#define MPI_EVENT_SAS_SMP_NO_DESTINATION                (0x03)
+#define MPI_EVENT_SAS_SMP_BAD_DESTINATION               (0x04)
+
+/* SAS Initiator Device Status Change Event data */
+
+typedef struct _EVENT_DATA_SAS_INIT_DEV_STATUS_CHANGE
+{
+    U8                      ReasonCode;                 /* 00h */
+    U8                      Port;                       /* 01h */
+    U16                     DevHandle;                  /* 02h */
+    U64                     SASAddress;                 /* 04h */
+} EVENT_DATA_SAS_INIT_DEV_STATUS_CHANGE,
+  MPI_POINTER PTR_EVENT_DATA_SAS_INIT_DEV_STATUS_CHANGE,
+  MpiEventDataSasInitDevStatusChange_t,
+  MPI_POINTER pMpiEventDataSasInitDevStatusChange_t;
+
+/* defines for the ReasonCode field of the SAS Initiator Device Status Change event */
+#define MPI_EVENT_SAS_INIT_RC_ADDED                 (0x01)
+
+/* SAS Initiator Device Table Overflow Event data */
+
+typedef struct _EVENT_DATA_SAS_INIT_TABLE_OVERFLOW
+{
+    U8                      MaxInit;                    /* 00h */
+    U8                      CurrentInit;                /* 01h */
+    U16                     Reserved1;                  /* 02h */
+} EVENT_DATA_SAS_INIT_TABLE_OVERFLOW,
+  MPI_POINTER PTR_EVENT_DATA_SAS_INIT_TABLE_OVERFLOW,
+  MpiEventDataSasInitTableOverflow_t,
+  MPI_POINTER pMpiEventDataSasInitTableOverflow_t;
+
 
 /*****************************************************************************
 *
@@ -1013,5 +1104,6 @@ typedef struct _MPI_EXT_IMAGE_HEADER
 #define MPI_EXT_IMAGE_TYPE_FW                   (0x01)
 #define MPI_EXT_IMAGE_TYPE_NVDATA               (0x03)
 #define MPI_EXT_IMAGE_TYPE_BOOTLOADER           (0x04)
+#define MPI_EXT_IMAGE_TYPE_INITIALIZATION       (0x05)
 
 #endif
index a9c14ad132ce1a2dda6b965acf20211c2a0b6e9c..871ebc08b706133de56ea0ef96f5b248dda12aff 100644 (file)
@@ -13,6 +13,8 @@
 #ifndef IOPI_IOCLOGINFO_H_INCLUDED
 #define IOPI_IOCLOGINFO_H_INCLUDED
 
+#define SAS_LOGINFO_NEXUS_LOSS         0x31170000
+#define SAS_LOGINFO_MASK                       0xFFFF0000
 
 /****************************************************************************/
 /*  IOC LOGINFO defines, 0x00000000 - 0x0FFFFFFF                            */
@@ -51,6 +53,9 @@
 #define IOP_LOGINFO_CODE_CONFIG_INVALID_PAGE_DNM        (0x00030500) /* Device Not Mapped */
 #define IOP_LOGINFO_CODE_CONFIG_INVALID_PAGE_PERSIST    (0x00030600) /* Persistent Page not found */
 #define IOP_LOGINFO_CODE_CONFIG_INVALID_PAGE_DEFAULT    (0x00030700) /* Default Page not found */
+
+#define IOP_LOGINFO_CODE_DIAG_MSG_ERROR                 (0x00040000) /* Error handling diag msg - or'd with diag status */
+
 #define IOP_LOGINFO_CODE_TASK_TERMINATED                (0x00050000)
 
 #define IOP_LOGINFO_CODE_ENCL_MGMT_READ_ACTION_ERR0R    (0x00060001) /* Read Action not supported for SEP msg */
 #define PL_LOGINFO_CODE_IO_EXECUTED                         (0x00140000)
 #define PL_LOGINFO_CODE_PERS_RESV_OUT_NOT_AFFIL_OWNER       (0x00150000)
 #define PL_LOGINFO_CODE_OPEN_TXDMA_ABORT                    (0x00160000)
+#define PL_LOGINFO_CODE_IO_DEVICE_MISSING_DELAY_RETRY       (0x00170000)
 #define PL_LOGINFO_SUB_CODE_OPEN_FAILURE                    (0x00000100)
 #define PL_LOGINFO_SUB_CODE_OPEN_FAILURE_NO_DEST_TIMEOUT    (0x00000101)
 #define PL_LOGINFO_SUB_CODE_OPEN_FAILURE_ORR_TIMEOUT        (0x0000011A) /* Open Reject (Retry) Timeout */
 /****************************************************************************/
 /* IR LOGINFO_CODE defines, valid if IOC_LOGINFO_ORIGINATOR = IR            */
 /****************************************************************************/
-#define IR_LOGINFO_CODE_UNUSED1                         (0x00010000)
-#define IR_LOGINFO_CODE_UNUSED2                         (0x00020000)
+#define IR_LOGINFO_RAID_ACTION_ERROR                           (0x00010000)
+#define IR_LOGINFO_CODE_UNUSED2                                (0x00020000)
+
+/* Amount of information passed down for Create Volume is too large */
+#define IR_LOGINFO_VOLUME_CREATE_INVALID_LENGTH                (0x00010001)
+/* Creation of duplicate volume attempted (Bus/Target ID checked) */
+#define IR_LOGINFO_VOLUME_CREATE_DUPLICATE                     (0x00010002)
+/* Creation failed due to maximum number of supported volumes exceeded */
+#define IR_LOGINFO_VOLUME_CREATE_NO_SLOTS                      (0x00010003)
+/* Creation failed due to DMA error in trying to read from host */
+#define IR_LOGINFO_VOLUME_CREATE_DMA_ERROR                     (0x00010004)
+/* Creation failed due to invalid volume type passed down */
+#define IR_LOGINFO_VOLUME_CREATE_INVALID_VOLUME_TYPE           (0x00010005)
+/* Creation failed due to error reading MFG Page 4 */
+#define IR_LOGINFO_VOLUME_MFG_PAGE4_ERROR                      (0x00010006)
+/* Creation failed when trying to create internal structures */
+#define IR_LOGINFO_VOLUME_INTERNAL_CONFIG_STRUCTURE_ERROR      (0x00010007)
+
+/* Activation failed due to trying to activate an already active volume */
+#define IR_LOGINFO_VOLUME_ACTIVATING_AN_ACTIVE_VOLUME          (0x00010010)
+/* Activation failed due to trying to active unsupported volume type  */
+#define IR_LOGINFO_VOLUME_ACTIVATING_INVALID_VOLUME_TYPE       (0x00010011)
+/* Activation failed due to trying to active too many volumes  */
+#define IR_LOGINFO_VOLUME_ACTIVATING_TOO_MANY_VOLUMES          (0x00010012)
+/* Activation failed due to Volume ID in use already */
+#define IR_LOGINFO_VOLUME_ACTIVATING_VOLUME_ID_IN_USE          (0x00010013)
+/* Activation failed call to activateVolume returned failure */
+#define IR_LOGINFO_VOLUME_ACTIVATE_VOLUME_FAILED               (0x00010014)
+/* Activation failed trying to import the volume */
+#define IR_LOGINFO_VOLUME_ACTIVATING_IMPORT_VOLUME_FAILED      (0x00010015)
+
+/* Phys Disk failed, too many phys disks */
+#define IR_LOGINFO_PHYSDISK_CREATE_TOO_MANY_DISKS              (0x00010020)
+/* Amount of information passed down for Create Pnysdisk is too large */
+#define IR_LOGINFO_PHYSDISK_CREATE_INVALID_LENGTH              (0x00010021)
+/* Creation failed due to DMA error in trying to read from host */
+#define IR_LOGINFO_PHYSDISK_CREATE_DMA_ERROR                   (0x00010022)
+/* Creation failed due to invalid Bus TargetID passed down */
+#define IR_LOGINFO_PHYSDISK_CREATE_BUS_TID_INVALID             (0x00010023)
+/* Creation failed due to error in creating RAID Phys Disk Config Page */
+#define IR_LOGINFO_PHYSDISK_CREATE_CONFIG_PAGE_ERROR           (0x00010024)
+
+
+/* Compatibility Error : IR Disabled */
+#define IR_LOGINFO_COMPAT_ERROR_RAID_DISABLED                  (0x00010030)
+/* Compatibility Error : Inquiry Comand failed */
+#define IR_LOGINFO_COMPAT_ERROR_INQUIRY_FAILED                 (0x00010031)
+/* Compatibility Error : Device not direct access device */
+#define IR_LOGINFO_COMPAT_ERROR_NOT_DIRECT_ACCESS              (0x00010032)
+/* Compatibility Error : Removable device found */
+#define IR_LOGINFO_COMPAT_ERROR_REMOVABLE_FOUND                (0x00010033)
+/* Compatibility Error : Device SCSI Version not 2 or higher */
+#define IR_LOGINFO_COMPAT_ERROR_NEED_SCSI_2_OR_HIGHER          (0x00010034)
+/* Compatibility Error : SATA device, 48 BIT LBA not supported */
+#define IR_LOGINFO_COMPAT_ERROR_SATA_48BIT_LBA_NOT_SUPPORTED   (0x00010035)
+/* Compatibility Error : Device does not have 512 byte block sizes */
+#define IR_LOGINFO_COMPAT_ERROR_DEVICE_NOT_512_BYTE_BLOCK      (0x00010036)
+/* Compatibility Error : Volume Type check failed */
+#define IR_LOGINFO_COMPAT_ERROR_VOLUME_TYPE_CHECK_FAILED       (0x00010037)
+/* Compatibility Error : Volume Type is unsupported by FW */
+#define IR_LOGINFO_COMPAT_ERROR_UNSUPPORTED_VOLUME_TYPE        (0x00010038)
+/* Compatibility Error : Disk drive too small for use in volume */
+#define IR_LOGINFO_COMPAT_ERROR_DISK_TOO_SMALL                 (0x00010039)
+/* Compatibility Error : Phys disk for Create Volume not found */
+#define IR_LOGINFO_COMPAT_ERROR_PHYS_DISK_NOT_FOUND            (0x0001003A)
+/* Compatibility Error : membership count error, too many or too few disks for volume type */
+#define IR_LOGINFO_COMPAT_ERROR_MEMBERSHIP_COUNT               (0x0001003B)
+/* Compatibility Error : Disk stripe sizes must be 64KB */
+#define IR_LOGINFO_COMPAT_ERROR_NON_64K_STRIPE_SIZE            (0x0001003C)
+/* Compatibility Error : IME size limited to < 2TB */
+#define IR_LOGINFO_COMPAT_ERROR_IME_VOL_NOT_CURRENTLY_SUPPORTED (0x0001003D)
+
 
 /****************************************************************************/
-/* Defines for convienence                                                  */
+/* Defines for convenience                                                  */
 /****************************************************************************/
 #define IOC_LOGINFO_PREFIX_IOP                          ((MPI_IOCLOGINFO_TYPE_SAS << MPI_IOCLOGINFO_TYPE_SHIFT) | IOC_LOGINFO_ORIGINATOR_IOP)
 #define IOC_LOGINFO_PREFIX_PL                           ((MPI_IOCLOGINFO_TYPE_SAS << MPI_IOCLOGINFO_TYPE_SHIFT) | IOC_LOGINFO_ORIGINATOR_PL)
index 70514867bddf3befa735d75404b88c5d8bd84ea1..50b8f0a8f4560d5e222209cb43c2d856e8fa56c2 100644 (file)
@@ -6,7 +6,7 @@
  *          Title:  MPI Serial Attached SCSI structures and definitions
  *  Creation Date:  August 19, 2004
  *
- *    mpi_sas.h Version:  01.05.02
+ *    mpi_sas.h Version:  01.05.03
  *
  *  Version History
  *  ---------------
  *  08-30-05  01.05.02  Added DeviceInfo bit for SEP.
  *                      Added PrimFlags and Primitive field to SAS IO Unit
  *                      Control request, and added a new operation code.
+ *  03-27-06  01.05.03  Added Force Full Discovery, Transmit Port Select Signal,
+ *                      and Remove Device operations to SAS IO Unit Control.
+ *                      Added DevHandle field to SAS IO Unit Control request and
+ *                      reply.
  *  --------------------------------------------------------------------------
  */
 
@@ -209,7 +213,7 @@ typedef struct _MSG_SAS_IOUNIT_CONTROL_REQUEST
     U8                      Reserved1;          /* 01h */
     U8                      ChainOffset;        /* 02h */
     U8                      Function;           /* 03h */
-    U16                     Reserved2;          /* 04h */
+    U16                     DevHandle;          /* 04h */
     U8                      Reserved3;          /* 06h */
     U8                      MsgFlags;           /* 07h */
     U32                     MsgContext;         /* 08h */
@@ -231,6 +235,9 @@ typedef struct _MSG_SAS_IOUNIT_CONTROL_REQUEST
 #define MPI_SAS_OP_PHY_CLEAR_ERROR_LOG          (0x08)
 #define MPI_SAS_OP_MAP_CURRENT                  (0x09)
 #define MPI_SAS_OP_SEND_PRIMITIVE               (0x0A)
+#define MPI_SAS_OP_FORCE_FULL_DISCOVERY         (0x0B)
+#define MPI_SAS_OP_TRANSMIT_PORT_SELECT_SIGNAL  (0x0C)
+#define MPI_SAS_OP_TRANSMIT_REMOVE_DEVICE       (0x0D)
 
 /* values for the PrimFlags field */
 #define MPI_SAS_PRIMFLAGS_SINGLE                (0x08)
@@ -245,7 +252,7 @@ typedef struct _MSG_SAS_IOUNIT_CONTROL_REPLY
     U8                      Reserved1;          /* 01h */
     U8                      MsgLength;          /* 02h */
     U8                      Function;           /* 03h */
-    U16                     Reserved2;          /* 04h */
+    U16                     DevHandle;          /* 04h */
     U8                      Reserved3;          /* 06h */
     U8                      MsgFlags;           /* 07h */
     U32                     MsgContext;         /* 08h */
index 3f462859ceea9fb904560607cc059182e743d786..20b66731577334746b83a1ee643346850d955ab3 100644 (file)
@@ -6,7 +6,7 @@
  *          Title:  MPI Target mode messages and structures
  *  Creation Date:  June 22, 2000
  *
- *    mpi_targ.h Version:  01.05.05
+ *    mpi_targ.h Version:  01.05.06
  *
  *  Version History
  *  ---------------
@@ -54,6 +54,7 @@
  *  02-22-05  01.05.03  Changed a comment.
  *  03-11-05  01.05.04  Removed TargetAssistExtended Request.
  *  06-24-05  01.05.05  Added TargetAssistExtended structures and defines.
+ *  03-27-06  01.05.06  Added a comment.
  *  --------------------------------------------------------------------------
  */
 
@@ -351,7 +352,7 @@ typedef struct _MSG_TARGET_ASSIST_REQUEST
 #define TARGET_ASSIST_FLAGS_CONFIRMED               (0x08)
 #define TARGET_ASSIST_FLAGS_REPOST_CMD_BUFFER       (0x80)
 
-
+/* Standard Target Mode Reply message */
 typedef struct _MSG_TARGET_ERROR_REPLY
 {
     U16                     Reserved;                   /* 00h */
index 12dd8d493ee2aa4e6981e61222cb18cad2bb86b9..43308df64623ace8b1d261f9b28858643306fc8c 100644 (file)
@@ -46,7 +46,6 @@
 */
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/errno.h>
@@ -369,20 +368,21 @@ static irqreturn_t
 mpt_interrupt(int irq, void *bus_id, struct pt_regs *r)
 {
        MPT_ADAPTER *ioc = bus_id;
-       u32 pa;
+       u32 pa = CHIPREG_READ32_dmasync(&ioc->chip->ReplyFifo);
+
+       if (pa == 0xFFFFFFFF)
+               return IRQ_NONE;
 
        /*
         *  Drain the reply FIFO!
         */
-       while (1) {
-               pa = CHIPREG_READ32_dmasync(&ioc->chip->ReplyFifo);
-               if (pa == 0xFFFFFFFF)
-                       return IRQ_HANDLED;
-               else if (pa & MPI_ADDRESS_REPLY_A_BIT)
+       do {
+               if (pa & MPI_ADDRESS_REPLY_A_BIT)
                        mpt_reply(ioc, pa);
                else
                        mpt_turbo_reply(ioc, pa);
-       }
+               pa = CHIPREG_READ32_dmasync(&ioc->chip->ReplyFifo);
+       } while (pa != 0xFFFFFFFF);
 
        return IRQ_HANDLED;
 }
@@ -1220,31 +1220,25 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
        port = psize = 0;
        for (ii=0; ii < DEVICE_COUNT_RESOURCE; ii++) {
                if (pci_resource_flags(pdev, ii) & PCI_BASE_ADDRESS_SPACE_IO) {
+                       if (psize)
+                               continue;
                        /* Get I/O space! */
                        port = pci_resource_start(pdev, ii);
                        psize = pci_resource_len(pdev,ii);
                } else {
+                       if (msize)
+                               continue;
                        /* Get memmap */
                        mem_phys = pci_resource_start(pdev, ii);
                        msize = pci_resource_len(pdev,ii);
-                       break;
                }
        }
        ioc->mem_size = msize;
 
-       if (ii == DEVICE_COUNT_RESOURCE) {
-               printk(KERN_ERR MYNAM ": ERROR - MPT adapter has no memory regions defined!\n");
-               kfree(ioc);
-               return -EINVAL;
-       }
-
-       dinitprintk((KERN_INFO MYNAM ": MPT adapter @ %lx, msize=%dd bytes\n", mem_phys, msize));
-       dinitprintk((KERN_INFO MYNAM ": (port i/o @ %lx, psize=%dd bytes)\n", port, psize));
-
        mem = NULL;
        /* Get logical ptr for PciMem0 space */
        /*mem = ioremap(mem_phys, msize);*/
-       mem = ioremap(mem_phys, 0x100);
+       mem = ioremap(mem_phys, msize);
        if (mem == NULL) {
                printk(KERN_ERR MYNAM ": ERROR - Unable to map adapter memory!\n");
                kfree(ioc);
@@ -1344,11 +1338,6 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
                ioc->bus_type = SAS;
                ioc->errata_flag_1064 = 1;
        }
-       else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1066) {
-               ioc->prod_name = "LSISAS1066";
-               ioc->bus_type = SAS;
-               ioc->errata_flag_1064 = 1;
-       }
        else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1068) {
                ioc->prod_name = "LSISAS1068";
                ioc->bus_type = SAS;
@@ -1358,14 +1347,14 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
                ioc->prod_name = "LSISAS1064E";
                ioc->bus_type = SAS;
        }
-       else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1066E) {
-               ioc->prod_name = "LSISAS1066E";
-               ioc->bus_type = SAS;
-       }
        else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1068E) {
                ioc->prod_name = "LSISAS1068E";
                ioc->bus_type = SAS;
        }
+       else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1078) {
+               ioc->prod_name = "LSISAS1078";
+               ioc->bus_type = SAS;
+       }
 
        if (ioc->errata_flag_1064)
                pci_disable_io_access(pdev);
@@ -1706,7 +1695,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
                                printk(MYIOC_s_INFO_FMT "PCI-MSI enabled\n",
                                        ioc->name);
                        rc = request_irq(ioc->pcidev->irq, mpt_interrupt,
-                                       SA_SHIRQ, ioc->name, ioc);
+                                       IRQF_SHARED, ioc->name, ioc);
                        if (rc < 0) {
                                printk(MYIOC_s_ERR_FMT "Unable to allocate "
                                        "interrupt %d!\n", ioc->name,
@@ -3185,6 +3174,37 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)
        u32 diag1val = 0;
 #endif
 
+       if (ioc->pcidev->device == MPI_MANUFACTPAGE_DEVID_SAS1078) {
+               drsprintk((MYIOC_s_WARN_FMT "%s: Doorbell=%p; 1078 reset "
+                       "address=%p\n",  ioc->name, __FUNCTION__,
+                       &ioc->chip->Doorbell, &ioc->chip->Reset_1078));
+               CHIPREG_WRITE32(&ioc->chip->Reset_1078, 0x07);
+               if (sleepFlag == CAN_SLEEP)
+                       msleep(1);
+               else
+                       mdelay(1);
+
+               for (count = 0; count < 60; count ++) {
+                       doorbell = CHIPREG_READ32(&ioc->chip->Doorbell);
+                       doorbell &= MPI_IOC_STATE_MASK;
+
+                       drsprintk((MYIOC_s_INFO_FMT
+                               "looking for READY STATE: doorbell=%x"
+                               " count=%d\n",
+                               ioc->name, doorbell, count));
+                       if (doorbell == MPI_IOC_STATE_READY) {
+                               return 0;
+                       }
+
+                       /* wait 1 sec */
+                       if (sleepFlag == CAN_SLEEP)
+                               msleep(1000);
+                       else
+                               mdelay(1000);
+               }
+               return -1;
+       }
+
        /* Clear any existing interrupts */
        CHIPREG_WRITE32(&ioc->chip->IntStatus, 0);
 
@@ -5592,7 +5612,7 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag)
 
        /* The SCSI driver needs to adjust timeouts on all current
         * commands prior to the diagnostic reset being issued.
-        * Prevents timeouts occuring during a diagnostic reset...very bad.
+        * Prevents timeouts occurring during a diagnostic reset...very bad.
         * For all other protocol drivers, this is a no-op.
         */
        {
index 4720f9ae86aadda67b4847824b448b8e13e0ed84..a5ce10b67d02644640edae0d8930dc8037acb44b 100644 (file)
@@ -49,7 +49,6 @@
 #define MPTBASE_H_INCLUDED
 /*{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
 
@@ -76,8 +75,8 @@
 #define COPYRIGHT      "Copyright (c) 1999-2005 " MODULEAUTHOR
 #endif
 
-#define MPT_LINUX_VERSION_COMMON       "3.03.10"
-#define MPT_LINUX_PACKAGE_NAME         "@(#)mptlinux-3.03.10"
+#define MPT_LINUX_VERSION_COMMON       "3.04.00"
+#define MPT_LINUX_PACKAGE_NAME         "@(#)mptlinux-3.04.00"
 #define WHAT_MAGIC_STRING              "@" "(" "#" ")"
 
 #define show_mptmod_ver(s,ver)  \
@@ -308,7 +307,8 @@ typedef struct _SYSIF_REGS
        u32     HostIndex;      /* 50     Host Index register        */
        u32     Reserved4[15];  /* 54-8F                             */
        u32     Fubar;          /* 90     For Fubar usage            */
-       u32     Reserved5[27];  /* 94-FF                             */
+       u32     Reserved5[1050];/* 94-10F8                           */
+       u32     Reset_1078;     /* 10FC   Reset 1078                 */
 } SYSIF_REGS;
 
 /*
@@ -342,6 +342,7 @@ typedef struct _VirtTarget {
        u8                       negoFlags;     /* bit field, see above */
        u8                       raidVolume;    /* set, if RAID Volume */
        u8                       type;          /* byte 0 of Inquiry data */
+       u8                       deleted;       /* target in process of being removed */
        u32                      num_luns;
        u32                      luns[8];               /* Max LUNs is 256 */
 } VirtTarget;
@@ -630,10 +631,11 @@ typedef struct _MPT_ADAPTER
        struct mutex             sas_discovery_mutex;
        u8                       sas_discovery_runtime;
        u8                       sas_discovery_ignore_events;
+       u16                      handle;
        int                      sas_index; /* index refrencing */
        MPT_SAS_MGMT             sas_mgmt;
        int                      num_ports;
-       struct work_struct       mptscsih_persistTask;
+       struct work_struct       sas_persist_task;
 
        struct work_struct       fc_setup_reset_work;
        struct list_head         fc_rports;
@@ -642,6 +644,7 @@ typedef struct _MPT_ADAPTER
        struct work_struct       fc_rescan_work;
        char                     fc_rescan_work_q_name[KOBJ_NAME_LEN];
        struct workqueue_struct *fc_rescan_work_q;
+       u8              port_serial_number;
 } MPT_ADAPTER;
 
 /*
@@ -893,6 +896,13 @@ typedef struct _mpt_sge {
 #define DBG_DUMP_REQUEST_FRAME_HDR(mfp)
 #endif
 
+// debug sas wide ports
+#ifdef MPT_DEBUG_SAS_WIDE
+#define dsaswideprintk(x) printk x
+#else
+#define dsaswideprintk(x)
+#endif
+
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 
index 3ff8378ea660ad9aad1330122efd408f5faade01..a8f2fa985455b6bdf88af739f6d38efdee72299b 100644 (file)
@@ -132,21 +132,21 @@ static struct scsi_host_template mptfc_driver_template = {
  */
 
 static struct pci_device_id mptfc_pci_table[] = {
-       { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC909,
+       { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC909,
                PCI_ANY_ID, PCI_ANY_ID },
-       { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC919,
+       { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC919,
                PCI_ANY_ID, PCI_ANY_ID },
-       { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC929,
+       { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC929,
                PCI_ANY_ID, PCI_ANY_ID },
-       { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC919X,
+       { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC919X,
                PCI_ANY_ID, PCI_ANY_ID },
-       { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC929X,
+       { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC929X,
                PCI_ANY_ID, PCI_ANY_ID },
-       { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC939X,
+       { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC939X,
                PCI_ANY_ID, PCI_ANY_ID },
-       { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC949X,
+       { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC949X,
                PCI_ANY_ID, PCI_ANY_ID },
-       { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC949ES,
+       { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC949E,
                PCI_ANY_ID, PCI_ANY_ID },
        {0}     /* Terminating entry */
 };
index 85689ab46cbc26fcc30db0e471cc5081abd5dc66..f7bd8b11ed3be860feeffadc736aa6681e8d3724 100644 (file)
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/workqueue.h>
+#include <linux/delay.h>       /* for mdelay */
 
+#include <scsi/scsi.h>
 #include <scsi/scsi_cmnd.h>
 #include <scsi/scsi_device.h>
 #include <scsi/scsi_host.h>
 #include <scsi/scsi_transport_sas.h>
+#include <scsi/scsi_dbg.h>
 
 #include "mptbase.h"
 #include "mptscsih.h"
@@ -137,23 +140,37 @@ struct mptsas_devinfo {
        u32     device_info;    /* bitfield detailed info about this device */
 };
 
+/*
+ * Specific details on ports, wide/narrow
+ */
+struct mptsas_portinfo_details{
+       u8      port_id;        /* port number provided to transport */
+       u16     num_phys;       /* number of phys belong to this port */
+       u64     phy_bitmask;    /* TODO, extend support for 255 phys */
+       struct sas_rphy *rphy;  /* transport layer rphy object */
+       struct sas_port *port;  /* transport layer port object */
+       struct scsi_target *starget;
+       struct mptsas_portinfo *port_info;
+};
+
 struct mptsas_phyinfo {
        u8      phy_id;                 /* phy index */
-       u8      port_id;                /* port number this phy is part of */
+       u8      port_id;                /* firmware port identifier */
        u8      negotiated_link_rate;   /* nego'd link rate for this phy */
        u8      hw_link_rate;           /* hardware max/min phys link rate */
        u8      programmed_link_rate;   /* programmed max/min phy link rate */
+       u8      sas_port_add_phy;       /* flag to request sas_port_add_phy*/
        struct mptsas_devinfo identify; /* point to phy device info */
        struct mptsas_devinfo attached; /* point to attached device info */
-       struct sas_phy *phy;
-       struct sas_rphy *rphy;
-       struct scsi_target *starget;
+       struct sas_phy *phy;            /* transport layer phy object */
+       struct mptsas_portinfo *portinfo;
+       struct mptsas_portinfo_details * port_details;
 };
 
 struct mptsas_portinfo {
        struct list_head list;
        u16             handle;         /* unique id to address this */
-       u             num_phys;       /* number of phys */
+       u16             num_phys;       /* number of phys */
        struct mptsas_phyinfo *phy_info;
 };
 
@@ -169,7 +186,7 @@ struct mptsas_enclosure {
        u8      sep_channel;            /* SEP channel logical channel id */
 };
 
-#ifdef SASDEBUG
+#ifdef MPT_DEBUG_SAS
 static void mptsas_print_phy_data(MPI_SAS_IO_UNIT0_PHY_DATA *phy_data)
 {
        printk("---- IO UNIT PAGE 0 ------------\n");
@@ -305,7 +322,7 @@ mptsas_find_portinfo_by_handle(MPT_ADAPTER *ioc, u16 handle)
 static inline int
 mptsas_is_end_device(struct mptsas_devinfo * attached)
 {
-       if ((attached->handle) &&
+       if ((attached->sas_address) &&
            (attached->device_info &
            MPI_SAS_DEVICE_INFO_END_DEVICE) &&
            ((attached->device_info &
@@ -319,6 +336,253 @@ mptsas_is_end_device(struct mptsas_devinfo * attached)
                return 0;
 }
 
+/* no mutex */
+static void
+mptsas_port_delete(struct mptsas_portinfo_details * port_details)
+{
+       struct mptsas_portinfo *port_info;
+       struct mptsas_phyinfo *phy_info;
+       u8      i;
+
+       if (!port_details)
+               return;
+
+       port_info = port_details->port_info;
+       phy_info = port_info->phy_info;
+
+       dsaswideprintk((KERN_DEBUG "%s: [%p]: port=%02d num_phys=%02d "
+               "bitmask=0x%016llX\n",
+               __FUNCTION__, port_details, port_details->port_id,
+               port_details->num_phys, port_details->phy_bitmask));
+
+       for (i = 0; i < port_info->num_phys; i++, phy_info++) {
+               if(phy_info->port_details != port_details)
+                       continue;
+               memset(&phy_info->attached, 0, sizeof(struct mptsas_devinfo));
+               phy_info->port_details = NULL;
+       }
+       kfree(port_details);
+}
+
+static inline struct sas_rphy *
+mptsas_get_rphy(struct mptsas_phyinfo *phy_info)
+{
+       if (phy_info->port_details)
+               return phy_info->port_details->rphy;
+       else
+               return NULL;
+}
+
+static inline void
+mptsas_set_rphy(struct mptsas_phyinfo *phy_info, struct sas_rphy *rphy)
+{
+       if (phy_info->port_details) {
+               phy_info->port_details->rphy = rphy;
+               dsaswideprintk((KERN_DEBUG "sas_rphy_add: rphy=%p\n", rphy));
+       }
+
+#ifdef MPT_DEBUG_SAS_WIDE
+       if (rphy) {
+               dev_printk(KERN_DEBUG, &rphy->dev, "add:");
+               printk("rphy=%p release=%p\n",
+                       rphy, rphy->dev.release);
+       }
+#endif
+}
+
+static inline struct sas_port *
+mptsas_get_port(struct mptsas_phyinfo *phy_info)
+{
+       if (phy_info->port_details)
+               return phy_info->port_details->port;
+       else
+               return NULL;
+}
+
+static inline void
+mptsas_set_port(struct mptsas_phyinfo *phy_info, struct sas_port *port)
+{
+       if (phy_info->port_details)
+               phy_info->port_details->port = port;
+
+#ifdef MPT_DEBUG_SAS_WIDE
+       if (port) {
+               dev_printk(KERN_DEBUG, &port->dev, "add: ");
+               printk("port=%p release=%p\n",
+                       port, port->dev.release);
+       }
+#endif
+}
+
+static inline struct scsi_target *
+mptsas_get_starget(struct mptsas_phyinfo *phy_info)
+{
+       if (phy_info->port_details)
+               return phy_info->port_details->starget;
+       else
+               return NULL;
+}
+
+static inline void
+mptsas_set_starget(struct mptsas_phyinfo *phy_info, struct scsi_target *
+starget)
+{
+       if (phy_info->port_details)
+               phy_info->port_details->starget = starget;
+}
+
+
+/*
+ * mptsas_setup_wide_ports
+ *
+ * Updates for new and existing narrow/wide port configuration
+ * in the sas_topology
+ */
+static void
+mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info)
+{
+       struct mptsas_portinfo_details * port_details;
+       struct mptsas_phyinfo *phy_info, *phy_info_cmp;
+       u64     sas_address;
+       int     i, j;
+
+       mutex_lock(&ioc->sas_topology_mutex);
+
+       phy_info = port_info->phy_info;
+       for (i = 0 ; i < port_info->num_phys ; i++, phy_info++) {
+               if (phy_info->attached.handle)
+                       continue;
+               port_details = phy_info->port_details;
+               if (!port_details)
+                       continue;
+               if (port_details->num_phys < 2)
+                       continue;
+               /*
+                * Removing a phy from a port, letting the last
+                * phy be removed by firmware events.
+                */
+               dsaswideprintk((KERN_DEBUG
+                       "%s: [%p]: port=%d deleting phy = %d\n",
+                       __FUNCTION__, port_details,
+                       port_details->port_id, i));
+               port_details->num_phys--;
+               port_details->phy_bitmask &= ~ (1 << phy_info->phy_id);
+               memset(&phy_info->attached, 0, sizeof(struct mptsas_devinfo));
+               sas_port_delete_phy(port_details->port, phy_info->phy);
+               phy_info->port_details = NULL;
+       }
+
+       /*
+        * Populate and refresh the tree
+        */
+       phy_info = port_info->phy_info;
+       for (i = 0 ; i < port_info->num_phys ; i++, phy_info++) {
+               sas_address = phy_info->attached.sas_address;
+               dsaswideprintk((KERN_DEBUG "phy_id=%d sas_address=0x%018llX\n",
+                       i, sas_address));
+               if (!sas_address)
+                       continue;
+               port_details = phy_info->port_details;
+               /*
+                * Forming a port
+                */
+               if (!port_details) {
+                       port_details = kzalloc(sizeof(*port_details),
+                               GFP_KERNEL);
+                       if (!port_details)
+                               goto out;
+                       port_details->num_phys = 1;
+                       port_details->port_info = port_info;
+                       port_details->port_id = ioc->port_serial_number++;
+                       if (phy_info->phy_id < 64 )
+                               port_details->phy_bitmask |=
+                                   (1 << phy_info->phy_id);
+                       phy_info->sas_port_add_phy=1;
+                       dsaswideprintk((KERN_DEBUG "\t\tForming port\n\t\t"
+                               "phy_id=%d sas_address=0x%018llX\n",
+                               i, sas_address));
+                       phy_info->port_details = port_details;
+               }
+
+               if (i == port_info->num_phys - 1)
+                       continue;
+               phy_info_cmp = &port_info->phy_info[i + 1];
+               for (j = i + 1 ; j < port_info->num_phys ; j++,
+                   phy_info_cmp++) {
+                       if (!phy_info_cmp->attached.sas_address)
+                               continue;
+                       if (sas_address != phy_info_cmp->attached.sas_address)
+                               continue;
+                       if (phy_info_cmp->port_details == port_details )
+                               continue;
+                       dsaswideprintk((KERN_DEBUG
+                               "\t\tphy_id=%d sas_address=0x%018llX\n",
+                               j, phy_info_cmp->attached.sas_address));
+                       if (phy_info_cmp->port_details) {
+                               port_details->rphy =
+                                   mptsas_get_rphy(phy_info_cmp);
+                               port_details->port =
+                                   mptsas_get_port(phy_info_cmp);
+                               port_details->starget =
+                                   mptsas_get_starget(phy_info_cmp);
+                               port_details->port_id =
+                                       phy_info_cmp->port_details->port_id;
+                               port_details->num_phys =
+                                       phy_info_cmp->port_details->num_phys;
+//                             port_info->port_serial_number--;
+                               ioc->port_serial_number--;
+                               if (!phy_info_cmp->port_details->num_phys)
+                                       kfree(phy_info_cmp->port_details);
+                       } else
+                               phy_info_cmp->sas_port_add_phy=1;
+                       /*
+                        * Adding a phy to a port
+                        */
+                       phy_info_cmp->port_details = port_details;
+                       if (phy_info_cmp->phy_id < 64 )
+                               port_details->phy_bitmask |=
+                               (1 << phy_info_cmp->phy_id);
+                       port_details->num_phys++;
+               }
+       }
+
+ out:
+
+#ifdef MPT_DEBUG_SAS_WIDE
+       for (i = 0; i < port_info->num_phys; i++) {
+               port_details = port_info->phy_info[i].port_details;
+               if (!port_details)
+                       continue;
+               dsaswideprintk((KERN_DEBUG
+                       "%s: [%p]: phy_id=%02d port_id=%02d num_phys=%02d "
+                       "bitmask=0x%016llX\n",
+                       __FUNCTION__,
+                       port_details, i, port_details->port_id,
+                       port_details->num_phys, port_details->phy_bitmask));
+               dsaswideprintk((KERN_DEBUG"\t\tport = %p rphy=%p\n",
+                       port_details->port, port_details->rphy));
+       }
+       dsaswideprintk((KERN_DEBUG"\n"));
+#endif
+       mutex_unlock(&ioc->sas_topology_mutex);
+}
+
+static void
+mptsas_target_reset(MPT_ADAPTER *ioc, VirtTarget * vtarget)
+{
+       MPT_SCSI_HOST           *hd = (MPT_SCSI_HOST *)ioc->sh->hostdata;
+
+       if (mptscsih_TMHandler(hd,
+            MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET,
+            vtarget->bus_id, vtarget->target_id, 0, 0, 5) < 0) {
+               hd->tmPending = 0;
+               hd->tmState = TM_STATE_NONE;
+               printk(MYIOC_s_WARN_FMT
+              "Error processing TaskMgmt id=%d TARGET_RESET\n",
+                       ioc->name, vtarget->target_id);
+       }
+}
+
 static int
 mptsas_sas_enclosure_pg0(MPT_ADAPTER *ioc, struct mptsas_enclosure *enclosure,
                u32 form, u32 form_specific)
@@ -400,11 +664,105 @@ mptsas_slave_configure(struct scsi_device *sdev)
        return mptscsih_slave_configure(sdev);
 }
 
-/*
- * This is pretty ugly.  We will be able to seriously clean it up
- * once the DV code in mptscsih goes away and we can properly
- * implement ->target_alloc.
- */
+static int
+mptsas_target_alloc(struct scsi_target *starget)
+{
+       struct Scsi_Host *host = dev_to_shost(&starget->dev);
+       MPT_SCSI_HOST           *hd = (MPT_SCSI_HOST *)host->hostdata;
+       VirtTarget              *vtarget;
+       u32                     target_id;
+       u32                     channel;
+       struct sas_rphy         *rphy;
+       struct mptsas_portinfo  *p;
+       int                      i;
+
+       vtarget = kzalloc(sizeof(VirtTarget), GFP_KERNEL);
+       if (!vtarget)
+               return -ENOMEM;
+
+       vtarget->starget = starget;
+       vtarget->ioc_id = hd->ioc->id;
+       vtarget->tflags = MPT_TARGET_FLAGS_Q_YES|MPT_TARGET_FLAGS_VALID_INQUIRY;
+
+       target_id = starget->id;
+       channel = 0;
+
+       hd->Targets[target_id] = vtarget;
+
+       /*
+        * RAID volumes placed beyond the last expected port.
+        */
+       if (starget->channel == hd->ioc->num_ports)
+               goto out;
+
+       rphy = dev_to_rphy(starget->dev.parent);
+       mutex_lock(&hd->ioc->sas_topology_mutex);
+       list_for_each_entry(p, &hd->ioc->sas_topology, list) {
+               for (i = 0; i < p->num_phys; i++) {
+                       if (p->phy_info[i].attached.sas_address !=
+                                       rphy->identify.sas_address)
+                               continue;
+                       target_id = p->phy_info[i].attached.id;
+                       channel = p->phy_info[i].attached.channel;
+                       mptsas_set_starget(&p->phy_info[i], starget);
+
+                       /*
+                        * Exposing hidden raid components
+                        */
+                       if (mptscsih_is_phys_disk(hd->ioc, target_id)) {
+                               target_id = mptscsih_raid_id_to_num(hd,
+                                               target_id);
+                               vtarget->tflags |=
+                                   MPT_TARGET_FLAGS_RAID_COMPONENT;
+                       }
+                       mutex_unlock(&hd->ioc->sas_topology_mutex);
+                       goto out;
+               }
+       }
+       mutex_unlock(&hd->ioc->sas_topology_mutex);
+
+       kfree(vtarget);
+       return -ENXIO;
+
+ out:
+       vtarget->target_id = target_id;
+       vtarget->bus_id = channel;
+       starget->hostdata = vtarget;
+       return 0;
+}
+
+static void
+mptsas_target_destroy(struct scsi_target *starget)
+{
+       struct Scsi_Host *host = dev_to_shost(&starget->dev);
+       MPT_SCSI_HOST           *hd = (MPT_SCSI_HOST *)host->hostdata;
+       struct sas_rphy         *rphy;
+       struct mptsas_portinfo  *p;
+       int                      i;
+
+       if (!starget->hostdata)
+               return;
+
+       if (starget->channel == hd->ioc->num_ports)
+               goto out;
+
+       rphy = dev_to_rphy(starget->dev.parent);
+       list_for_each_entry(p, &hd->ioc->sas_topology, list) {
+               for (i = 0; i < p->num_phys; i++) {
+                       if (p->phy_info[i].attached.sas_address !=
+                                       rphy->identify.sas_address)
+                               continue;
+                       mptsas_set_starget(&p->phy_info[i], NULL);
+                       goto out;
+               }
+       }
+
+ out:
+       kfree(starget->hostdata);
+       starget->hostdata = NULL;
+}
+
+
 static int
 mptsas_slave_alloc(struct scsi_device *sdev)
 {
@@ -412,61 +770,41 @@ mptsas_slave_alloc(struct scsi_device *sdev)
        MPT_SCSI_HOST           *hd = (MPT_SCSI_HOST *)host->hostdata;
        struct sas_rphy         *rphy;
        struct mptsas_portinfo  *p;
-       VirtTarget              *vtarget;
        VirtDevice              *vdev;
        struct scsi_target      *starget;
-       u32                     target_id;
-       int i;
+       int                     i;
 
        vdev = kzalloc(sizeof(VirtDevice), GFP_KERNEL);
        if (!vdev) {
-               printk(MYIOC_s_ERR_FMT "slave_alloc kmalloc(%zd) FAILED!\n",
+               printk(MYIOC_s_ERR_FMT "slave_alloc kzalloc(%zd) FAILED!\n",
                                hd->ioc->name, sizeof(VirtDevice));
                return -ENOMEM;
        }
-       sdev->hostdata = vdev;
        starget = scsi_target(sdev);
-       vtarget = starget->hostdata;
-       vtarget->ioc_id = hd->ioc->id;
-       vdev->vtarget = vtarget;
-       if (vtarget->num_luns == 0) {
-               vtarget->tflags = MPT_TARGET_FLAGS_Q_YES|MPT_TARGET_FLAGS_VALID_INQUIRY;
-               hd->Targets[sdev->id] = vtarget;
-       }
+       vdev->vtarget = starget->hostdata;
 
        /*
-         RAID volumes placed beyond the last expected port.
-       */
-       if (sdev->channel == hd->ioc->num_ports) {
-               target_id = sdev->id;
-               vtarget->bus_id = 0;
-               vdev->lun = 0;
+        * RAID volumes placed beyond the last expected port.
+        */
+       if (sdev->channel == hd->ioc->num_ports)
                goto out;
-       }
 
        rphy = dev_to_rphy(sdev->sdev_target->dev.parent);
        mutex_lock(&hd->ioc->sas_topology_mutex);
        list_for_each_entry(p, &hd->ioc->sas_topology, list) {
                for (i = 0; i < p->num_phys; i++) {
-                       if (p->phy_info[i].attached.sas_address ==
-                                       rphy->identify.sas_address) {
-                               target_id = p->phy_info[i].attached.id;
-                               vtarget->bus_id = p->phy_info[i].attached.channel;
-                               vdev->lun = sdev->lun;
-                               p->phy_info[i].starget = sdev->sdev_target;
-                               /*
-                                * Exposing hidden disk (RAID)
-                                */
-                               if (mptscsih_is_phys_disk(hd->ioc, target_id)) {
-                                       target_id = mptscsih_raid_id_to_num(hd,
-                                                       target_id);
-                                       vdev->vtarget->tflags |=
-                                           MPT_TARGET_FLAGS_RAID_COMPONENT;
-                                       sdev->no_uld_attach = 1;
-                               }
-                               mutex_unlock(&hd->ioc->sas_topology_mutex);
-                               goto out;
-                       }
+                       if (p->phy_info[i].attached.sas_address !=
+                                       rphy->identify.sas_address)
+                               continue;
+                       vdev->lun = sdev->lun;
+                       /*
+                        * Exposing hidden raid components
+                        */
+                       if (mptscsih_is_phys_disk(hd->ioc,
+                                       p->phy_info[i].attached.id))
+                               sdev->no_uld_attach = 1;
+                       mutex_unlock(&hd->ioc->sas_topology_mutex);
+                       goto out;
                }
        }
        mutex_unlock(&hd->ioc->sas_topology_mutex);
@@ -475,57 +813,39 @@ mptsas_slave_alloc(struct scsi_device *sdev)
        return -ENXIO;
 
  out:
-       vtarget->target_id = target_id;
-       vtarget->num_luns++;
+       vdev->vtarget->num_luns++;
+       sdev->hostdata = vdev;
        return 0;
 }
 
-static void
-mptsas_slave_destroy(struct scsi_device *sdev)
+static int
+mptsas_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
 {
-       struct Scsi_Host *host = sdev->host;
-       MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata;
-       VirtDevice *vdev;
+       VirtDevice      *vdev = SCpnt->device->hostdata;
 
-       /*
-        * Issue target reset to flush firmware outstanding commands.
-        */
-       vdev = sdev->hostdata;
-       if (vdev->configured_lun){
-               if (mptscsih_TMHandler(hd,
-                    MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET,
-                    vdev->vtarget->bus_id,
-                    vdev->vtarget->target_id,
-                    0, 0, 5 /* 5 second timeout */)
-                    < 0){
-
-                       /* The TM request failed!
-                        * Fatal error case.
-                        */
-                       printk(MYIOC_s_WARN_FMT
-                      "Error processing TaskMgmt id=%d TARGET_RESET\n",
-                               hd->ioc->name,
-                               vdev->vtarget->target_id);
-
-                       hd->tmPending = 0;
-                       hd->tmState = TM_STATE_NONE;
-               }
+//     scsi_print_command(SCpnt);
+       if (vdev->vtarget->deleted) {
+               SCpnt->result = DID_NO_CONNECT << 16;
+               done(SCpnt);
+               return 0;
        }
-       mptscsih_slave_destroy(sdev);
+
+       return mptscsih_qcmd(SCpnt,done);
 }
 
+
 static struct scsi_host_template mptsas_driver_template = {
        .module                         = THIS_MODULE,
        .proc_name                      = "mptsas",
        .proc_info                      = mptscsih_proc_info,
        .name                           = "MPT SPI Host",
        .info                           = mptscsih_info,
-       .queuecommand                   = mptscsih_qcmd,
-       .target_alloc                   = mptscsih_target_alloc,
+       .queuecommand                   = mptsas_qcmd,
+       .target_alloc                   = mptsas_target_alloc,
        .slave_alloc                    = mptsas_slave_alloc,
        .slave_configure                = mptsas_slave_configure,
-       .target_destroy                 = mptscsih_target_destroy,
-       .slave_destroy                  = mptsas_slave_destroy,
+       .target_destroy                 = mptsas_target_destroy,
+       .slave_destroy                  = mptscsih_slave_destroy,
        .change_queue_depth             = mptscsih_change_queue_depth,
        .eh_abort_handler               = mptscsih_abort,
        .eh_device_reset_handler        = mptscsih_dev_reset,
@@ -795,7 +1115,7 @@ mptsas_sas_io_unit_pg0(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info)
 
        port_info->num_phys = buffer->NumPhys;
        port_info->phy_info = kcalloc(port_info->num_phys,
-               sizeof(struct mptsas_phyinfo),GFP_KERNEL);
+               sizeof(*port_info->phy_info),GFP_KERNEL);
        if (!port_info->phy_info) {
                error = -ENOMEM;
                goto out_free_consistent;
@@ -811,6 +1131,7 @@ mptsas_sas_io_unit_pg0(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info)
                    buffer->PhyData[i].Port;
                port_info->phy_info[i].negotiated_link_rate =
                    buffer->PhyData[i].NegotiatedLinkRate;
+               port_info->phy_info[i].portinfo = port_info;
        }
 
  out_free_consistent:
@@ -968,7 +1289,7 @@ mptsas_sas_expander_pg0(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info,
        CONFIGPARMS cfg;
        SasExpanderPage0_t *buffer;
        dma_addr_t dma_handle;
-       int error;
+       int i, error;
 
        hdr.PageVersion = MPI_SASEXPANDER0_PAGEVERSION;
        hdr.ExtPageLength = 0;
@@ -1013,12 +1334,15 @@ mptsas_sas_expander_pg0(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info,
        port_info->num_phys = buffer->NumPhys;
        port_info->handle = le16_to_cpu(buffer->DevHandle);
        port_info->phy_info = kcalloc(port_info->num_phys,
-               sizeof(struct mptsas_phyinfo),GFP_KERNEL);
+               sizeof(*port_info->phy_info),GFP_KERNEL);
        if (!port_info->phy_info) {
                error = -ENOMEM;
                goto out_free_consistent;
        }
 
+       for (i = 0; i < port_info->num_phys; i++)
+               port_info->phy_info[i].portinfo = port_info;
+
  out_free_consistent:
        pci_free_consistent(ioc->pcidev, hdr.ExtPageLength * 4,
                            buffer, dma_handle);
@@ -1161,19 +1485,23 @@ static int mptsas_probe_one_phy(struct device *dev,
 {
        MPT_ADAPTER *ioc;
        struct sas_phy *phy;
-       int error;
+       struct sas_port *port;
+       int error = 0;
 
-       if (!dev)
-               return -ENODEV;
+       if (!dev) {
+               error = -ENODEV;
+               goto out;
+       }
 
        if (!phy_info->phy) {
                phy = sas_phy_alloc(dev, index);
-               if (!phy)
-                       return -ENOMEM;
+               if (!phy) {
+                       error = -ENOMEM;
+                       goto out;
+               }
        } else
                phy = phy_info->phy;
 
-       phy->port_identifier = phy_info->port_id;
        mptsas_parse_device_info(&phy->identify, &phy_info->identify);
 
        /*
@@ -1265,19 +1593,52 @@ static int mptsas_probe_one_phy(struct device *dev,
                error = sas_phy_add(phy);
                if (error) {
                        sas_phy_free(phy);
-                       return error;
+                       goto out;
                }
                phy_info->phy = phy;
        }
 
-       if ((phy_info->attached.handle) &&
-           (!phy_info->rphy)) {
+       if (!phy_info->attached.handle ||
+                       !phy_info->port_details)
+               goto out;
+
+       port = mptsas_get_port(phy_info);
+       ioc = phy_to_ioc(phy_info->phy);
+
+       if (phy_info->sas_port_add_phy) {
+
+               if (!port) {
+                       port = sas_port_alloc(dev,
+                           phy_info->port_details->port_id);
+                       dsaswideprintk((KERN_DEBUG
+                           "sas_port_alloc: port=%p dev=%p port_id=%d\n",
+                           port, dev, phy_info->port_details->port_id));
+                       if (!port) {
+                               error = -ENOMEM;
+                               goto out;
+                       }
+                       error = sas_port_add(port);
+                       if (error) {
+                               dfailprintk((MYIOC_s_ERR_FMT
+                                       "%s: exit at line=%d\n", ioc->name,
+                                       __FUNCTION__, __LINE__));
+                               goto out;
+                       }
+                       mptsas_set_port(phy_info, port);
+               }
+               dsaswideprintk((KERN_DEBUG "sas_port_add_phy: phy_id=%d\n",
+                   phy_info->phy_id));
+               sas_port_add_phy(port, phy_info->phy);
+               phy_info->sas_port_add_phy = 0;
+       }
+
+       if (!mptsas_get_rphy(phy_info) && port && !port->rphy) {
 
                struct sas_rphy *rphy;
+               struct device *parent;
                struct sas_identify identify;
 
-               ioc = phy_to_ioc(phy_info->phy);
-
+               parent = dev->parent->parent;
                /*
                 * Let the hotplug_work thread handle processing
                 * the adding/removing of devices that occur
@@ -1285,36 +1646,63 @@ static int mptsas_probe_one_phy(struct device *dev,
                 */
                if (ioc->sas_discovery_runtime &&
                        mptsas_is_end_device(&phy_info->attached))
-                       return 0;
+                               goto out;
 
                mptsas_parse_device_info(&identify, &phy_info->attached);
+               if (scsi_is_host_device(parent)) {
+                       struct mptsas_portinfo *port_info;
+                       int i;
+
+                       mutex_lock(&ioc->sas_topology_mutex);
+                       port_info = mptsas_find_portinfo_by_handle(ioc,
+                                                                  ioc->handle);
+                       mutex_unlock(&ioc->sas_topology_mutex);
+
+                       for (i = 0; i < port_info->num_phys; i++)
+                               if (port_info->phy_info[i].identify.sas_address ==
+                                   identify.sas_address)
+                                       goto out;
+
+               } else if (scsi_is_sas_rphy(parent)) {
+                       struct sas_rphy *parent_rphy = dev_to_rphy(parent);
+                       if (identify.sas_address ==
+                           parent_rphy->identify.sas_address)
+                               goto out;
+               }
+
                switch (identify.device_type) {
                case SAS_END_DEVICE:
-                       rphy = sas_end_device_alloc(phy);
+                       rphy = sas_end_device_alloc(port);
                        break;
                case SAS_EDGE_EXPANDER_DEVICE:
                case SAS_FANOUT_EXPANDER_DEVICE:
-                       rphy = sas_expander_alloc(phy, identify.device_type);
+                       rphy = sas_expander_alloc(port, identify.device_type);
                        break;
                default:
                        rphy = NULL;
                        break;
                }
-               if (!rphy)
-                       return 0; /* non-fatal: an rphy can be added later */
+               if (!rphy) {
+                       dfailprintk((MYIOC_s_ERR_FMT
+                               "%s: exit at line=%d\n", ioc->name,
+                               __FUNCTION__, __LINE__));
+                       goto out;
+               }
 
                rphy->identify = identify;
-
                error = sas_rphy_add(rphy);
                if (error) {
+                       dfailprintk((MYIOC_s_ERR_FMT
+                               "%s: exit at line=%d\n", ioc->name,
+                               __FUNCTION__, __LINE__));
                        sas_rphy_free(rphy);
-                       return error;
+                       goto out;
                }
-
-               phy_info->rphy = rphy;
+               mptsas_set_rphy(phy_info, rphy);
        }
 
-       return 0;
+ out:
+       return error;
 }
 
 static int
@@ -1333,6 +1721,7 @@ mptsas_probe_hba_phys(MPT_ADAPTER *ioc)
                goto out_free_port_info;
 
        mutex_lock(&ioc->sas_topology_mutex);
+       ioc->handle = hba->handle;
        port_info = mptsas_find_portinfo_by_handle(ioc, hba->handle);
        if (!port_info) {
                port_info = hba;
@@ -1342,8 +1731,7 @@ mptsas_probe_hba_phys(MPT_ADAPTER *ioc)
                for (i = 0; i < hba->num_phys; i++)
                        port_info->phy_info[i].negotiated_link_rate =
                                hba->phy_info[i].negotiated_link_rate;
-               if (hba->phy_info)
-                       kfree(hba->phy_info);
+               kfree(hba->phy_info);
                kfree(hba);
                hba = NULL;
        }
@@ -1362,18 +1750,19 @@ mptsas_probe_hba_phys(MPT_ADAPTER *ioc)
                    port_info->phy_info[i].phy_id;
                handle = port_info->phy_info[i].identify.handle;
 
-               if (port_info->phy_info[i].attached.handle) {
+               if (port_info->phy_info[i].attached.handle)
                        mptsas_sas_device_pg0(ioc,
                                &port_info->phy_info[i].attached,
                                (MPI_SAS_DEVICE_PGAD_FORM_HANDLE <<
                                 MPI_SAS_DEVICE_PGAD_FORM_SHIFT),
                                port_info->phy_info[i].attached.handle);
-               }
+       }
+
+       mptsas_setup_wide_ports(ioc, port_info);
 
+       for (i = 0; i < port_info->num_phys; i++, ioc->sas_index++)
                mptsas_probe_one_phy(&ioc->sh->shost_gendev,
                    &port_info->phy_info[i], ioc->sas_index, 1);
-               ioc->sas_index++;
-       }
 
        return 0;
 
@@ -1387,6 +1776,8 @@ static int
 mptsas_probe_expander_phys(MPT_ADAPTER *ioc, u32 *handle)
 {
        struct mptsas_portinfo *port_info, *p, *ex;
+       struct device *parent;
+       struct sas_rphy *rphy;
        int error = -ENOMEM, i, j;
 
        ex = kzalloc(sizeof(*port_info), GFP_KERNEL);
@@ -1408,16 +1799,13 @@ mptsas_probe_expander_phys(MPT_ADAPTER *ioc, u32 *handle)
                list_add_tail(&port_info->list, &ioc->sas_topology);
        } else {
                port_info->handle = ex->handle;
-               if (ex->phy_info)
-                       kfree(ex->phy_info);
+               kfree(ex->phy_info);
                kfree(ex);
                ex = NULL;
        }
        mutex_unlock(&ioc->sas_topology_mutex);
 
        for (i = 0; i < port_info->num_phys; i++) {
-               struct device *parent;
-
                mptsas_sas_expander_pg1(ioc, &port_info->phy_info[i],
                        (MPI_SAS_EXPAND_PGAD_FORM_HANDLE_PHY_NUM <<
                         MPI_SAS_EXPAND_PGAD_FORM_SHIFT), (i << 16) + *handle);
@@ -1441,34 +1829,34 @@ mptsas_probe_expander_phys(MPT_ADAPTER *ioc, u32 *handle)
                        port_info->phy_info[i].attached.phy_id =
                            port_info->phy_info[i].phy_id;
                }
+       }
 
-               /*
-                * If we find a parent port handle this expander is
-                * attached to another expander, else it hangs of the
-                * HBA phys.
-                */
-               parent = &ioc->sh->shost_gendev;
+       parent = &ioc->sh->shost_gendev;
+       for (i = 0; i < port_info->num_phys; i++) {
                mutex_lock(&ioc->sas_topology_mutex);
                list_for_each_entry(p, &ioc->sas_topology, list) {
                        for (j = 0; j < p->num_phys; j++) {
-                               if (port_info->phy_info[i].identify.handle ==
+                               if (port_info->phy_info[i].identify.handle !=
                                                p->phy_info[j].attached.handle)
-                                       parent = &p->phy_info[j].rphy->dev;
+                                       continue;
+                               rphy = mptsas_get_rphy(&p->phy_info[j]);
+                               parent = &rphy->dev;
                        }
                }
                mutex_unlock(&ioc->sas_topology_mutex);
+       }
+
+       mptsas_setup_wide_ports(ioc, port_info);
 
+       for (i = 0; i < port_info->num_phys; i++, ioc->sas_index++)
                mptsas_probe_one_phy(parent, &port_info->phy_info[i],
                    ioc->sas_index, 0);
-               ioc->sas_index++;
-       }
 
        return 0;
 
  out_free_port_info:
        if (ex) {
-               if (ex->phy_info)
-                       kfree(ex->phy_info);
+               kfree(ex->phy_info);
                kfree(ex);
        }
  out:
@@ -1487,7 +1875,12 @@ mptsas_delete_expander_phys(MPT_ADAPTER *ioc)
 {
        struct mptsas_portinfo buffer;
        struct mptsas_portinfo *port_info, *n, *parent;
+       struct mptsas_phyinfo *phy_info;
+       struct scsi_target * starget;
+       VirtTarget * vtarget;
+       struct sas_port * port;
        int i;
+       u64     expander_sas_address;
 
        mutex_lock(&ioc->sas_topology_mutex);
        list_for_each_entry_safe(port_info, n, &ioc->sas_topology, list) {
@@ -1501,6 +1894,25 @@ mptsas_delete_expander_phys(MPT_ADAPTER *ioc)
                     (MPI_SAS_EXPAND_PGAD_FORM_HANDLE <<
                     MPI_SAS_EXPAND_PGAD_FORM_SHIFT), port_info->handle)) {
 
+                       /*
+                        * Issue target reset to all child end devices
+                        * then mark them deleted to prevent further
+                        * IO going to them.
+                        */
+                       phy_info = port_info->phy_info;
+                       for (i = 0; i < port_info->num_phys; i++, phy_info++) {
+                               starget = mptsas_get_starget(phy_info);
+                               if (!starget)
+                                       continue;
+                               vtarget = starget->hostdata;
+                               if(vtarget->deleted)
+                                       continue;
+                               vtarget->deleted = 1;
+                               mptsas_target_reset(ioc, vtarget);
+                               sas_port_delete(mptsas_get_port(phy_info));
+                               mptsas_port_delete(phy_info->port_details);
+                       }
+
                        /*
                         * Obtain the port_info instance to the parent port
                         */
@@ -1510,34 +1922,43 @@ mptsas_delete_expander_phys(MPT_ADAPTER *ioc)
                        if (!parent)
                                goto next_port;
 
+                       expander_sas_address =
+                               port_info->phy_info[0].identify.sas_address;
+
                        /*
                         * Delete rphys in the parent that point
                         * to this expander.  The transport layer will
                         * cleanup all the children.
                         */
-                       for (i = 0; i < parent->num_phys; i++) {
-                               if ((!parent->phy_info[i].rphy) ||
-                                   (parent->phy_info[i].attached.sas_address !=
-                                  port_info->phy_info[i].identify.sas_address))
+                       phy_info = parent->phy_info;
+                       for (i = 0; i < parent->num_phys; i++, phy_info++) {
+                               port = mptsas_get_port(phy_info);
+                               if (!port)
+                                       continue;
+                               if (phy_info->attached.sas_address !=
+                                       expander_sas_address)
                                        continue;
-                               sas_rphy_delete(parent->phy_info[i].rphy);
-                               memset(&parent->phy_info[i].attached, 0,
-                                   sizeof(struct mptsas_devinfo));
-                               parent->phy_info[i].rphy = NULL;
-                               parent->phy_info[i].starget = NULL;
+#ifdef MPT_DEBUG_SAS_WIDE
+                               dev_printk(KERN_DEBUG, &port->dev, "delete\n");
+#endif
+                               sas_port_delete(port);
+                               mptsas_port_delete(phy_info->port_details);
                        }
  next_port:
+
+                       phy_info = port_info->phy_info;
+                       for (i = 0; i < port_info->num_phys; i++, phy_info++)
+                               mptsas_port_delete(phy_info->port_details);
+
                        list_del(&port_info->list);
-                       if (port_info->phy_info)
-                               kfree(port_info->phy_info);
+                       kfree(port_info->phy_info);
                        kfree(port_info);
                }
                /*
                * Free this memory allocated from inside
                * mptsas_sas_expander_pg0
                */
-               if (buffer.phy_info)
-                       kfree(buffer.phy_info);
+               kfree(buffer.phy_info);
        }
        mutex_unlock(&ioc->sas_topology_mutex);
 }
@@ -1573,60 +1994,59 @@ mptsas_scan_sas_topology(MPT_ADAPTER *ioc)
 /*
  * Work queue thread to handle Runtime discovery
  * Mere purpose is the hot add/delete of expanders
+ *(Mutex UNLOCKED)
  */
 static void
-mptscsih_discovery_work(void * arg)
+__mptsas_discovery_work(MPT_ADAPTER *ioc)
 {
-       struct mptsas_discovery_event *ev = arg;
-       MPT_ADAPTER *ioc = ev->ioc;
        u32 handle = 0xFFFF;
 
-       mutex_lock(&ioc->sas_discovery_mutex);
        ioc->sas_discovery_runtime=1;
        mptsas_delete_expander_phys(ioc);
        mptsas_probe_hba_phys(ioc);
        while (!mptsas_probe_expander_phys(ioc, &handle))
                ;
-       kfree(ev);
        ioc->sas_discovery_runtime=0;
+}
+
+/*
+ * Work queue thread to handle Runtime discovery
+ * Mere purpose is the hot add/delete of expanders
+ *(Mutex LOCKED)
+ */
+static void
+mptsas_discovery_work(void * arg)
+{
+       struct mptsas_discovery_event *ev = arg;
+       MPT_ADAPTER *ioc = ev->ioc;
+
+       mutex_lock(&ioc->sas_discovery_mutex);
+       __mptsas_discovery_work(ioc);
        mutex_unlock(&ioc->sas_discovery_mutex);
+       kfree(ev);
 }
 
 static struct mptsas_phyinfo *
-mptsas_find_phyinfo_by_parent(MPT_ADAPTER *ioc, u16 parent_handle, u8 phy_id)
+mptsas_find_phyinfo_by_sas_address(MPT_ADAPTER *ioc, u64 sas_address)
 {
        struct mptsas_portinfo *port_info;
-       struct mptsas_devinfo device_info;
        struct mptsas_phyinfo *phy_info = NULL;
-       int i, error;
-
-       /*
-        * Retrieve the parent sas_address
-        */
-       error = mptsas_sas_device_pg0(ioc, &device_info,
-               (MPI_SAS_DEVICE_PGAD_FORM_HANDLE <<
-                MPI_SAS_DEVICE_PGAD_FORM_SHIFT),
-               parent_handle);
-       if (error)
-               return NULL;
+       int i;
 
-       /*
-        * The phy_info structures are never deallocated during lifetime of
-        * a host, so the code below is safe without additional refcounting.
-        */
        mutex_lock(&ioc->sas_topology_mutex);
        list_for_each_entry(port_info, &ioc->sas_topology, list) {
                for (i = 0; i < port_info->num_phys; i++) {
-                       if (port_info->phy_info[i].identify.sas_address ==
-                           device_info.sas_address &&
-                           port_info->phy_info[i].phy_id == phy_id) {
-                               phy_info = &port_info->phy_info[i];
-                               break;
-                       }
+                       if (port_info->phy_info[i].attached.sas_address
+                           != sas_address)
+                               continue;
+                       if (!mptsas_is_end_device(
+                               &port_info->phy_info[i].attached))
+                               continue;
+                       phy_info = &port_info->phy_info[i];
+                       break;
                }
        }
        mutex_unlock(&ioc->sas_topology_mutex);
-
        return phy_info;
 }
 
@@ -1637,21 +2057,19 @@ mptsas_find_phyinfo_by_target(MPT_ADAPTER *ioc, u32 id)
        struct mptsas_phyinfo *phy_info = NULL;
        int i;
 
-       /*
-        * The phy_info structures are never deallocated during lifetime of
-        * a host, so the code below is safe without additional refcounting.
-        */
        mutex_lock(&ioc->sas_topology_mutex);
        list_for_each_entry(port_info, &ioc->sas_topology, list) {
-               for (i = 0; i < port_info->num_phys; i++)
-                       if (mptsas_is_end_device(&port_info->phy_info[i].attached))
-                               if (port_info->phy_info[i].attached.id == id) {
-                                       phy_info = &port_info->phy_info[i];
-                                       break;
-                               }
+               for (i = 0; i < port_info->num_phys; i++) {
+                       if (port_info->phy_info[i].attached.id != id)
+                               continue;
+                       if (!mptsas_is_end_device(
+                               &port_info->phy_info[i].attached))
+                               continue;
+                       phy_info = &port_info->phy_info[i];
+                       break;
+               }
        }
        mutex_unlock(&ioc->sas_topology_mutex);
-
        return phy_info;
 }
 
@@ -1659,7 +2077,7 @@ mptsas_find_phyinfo_by_target(MPT_ADAPTER *ioc, u32 id)
  * Work queue thread to clear the persitency table
  */
 static void
-mptscsih_sas_persist_clear_table(void * arg)
+mptsas_persist_clear_table(void * arg)
 {
        MPT_ADAPTER *ioc = (MPT_ADAPTER *)arg;
 
@@ -1680,7 +2098,6 @@ mptsas_reprobe_target(struct scsi_target *starget, int uld_attach)
                        mptsas_reprobe_lun);
 }
 
-
 /*
  * Work queue thread to handle SAS hotplug events
  */
@@ -1691,14 +2108,17 @@ mptsas_hotplug_work(void *arg)
        MPT_ADAPTER *ioc = ev->ioc;
        struct mptsas_phyinfo *phy_info;
        struct sas_rphy *rphy;
+       struct sas_port *port;
        struct scsi_device *sdev;
+       struct scsi_target * starget;
        struct sas_identify identify;
        char *ds = NULL;
        struct mptsas_devinfo sas_device;
        VirtTarget *vtarget;
+       VirtDevice *vdevice;
 
-       mutex_lock(&ioc->sas_discovery_mutex);
 
+       mutex_lock(&ioc->sas_discovery_mutex);
        switch (ev->event_type) {
        case MPTSAS_DEL_DEVICE:
 
@@ -1707,24 +2127,50 @@ mptsas_hotplug_work(void *arg)
                /*
                 * Sanity checks, for non-existing phys and remote rphys.
                 */
-               if (!phy_info)
+               if (!phy_info || !phy_info->port_details) {
+                       dfailprintk((MYIOC_s_ERR_FMT
+                               "%s: exit at line=%d\n", ioc->name,
+                               __FUNCTION__, __LINE__));
                        break;
-               if (!phy_info->rphy)
+               }
+               rphy = mptsas_get_rphy(phy_info);
+               if (!rphy) {
+                       dfailprintk((MYIOC_s_ERR_FMT
+                               "%s: exit at line=%d\n", ioc->name,
+                               __FUNCTION__, __LINE__));
                        break;
-               if (phy_info->starget) {
-                       vtarget = phy_info->starget->hostdata;
+               }
+               port = mptsas_get_port(phy_info);
+               if (!port) {
+                       dfailprintk((MYIOC_s_ERR_FMT
+                               "%s: exit at line=%d\n", ioc->name,
+                               __FUNCTION__, __LINE__));
+                       break;
+               }
 
-                       if (!vtarget)
+               starget = mptsas_get_starget(phy_info);
+               if (starget) {
+                       vtarget = starget->hostdata;
+
+                       if (!vtarget) {
+                               dfailprintk((MYIOC_s_ERR_FMT
+                                       "%s: exit at line=%d\n", ioc->name,
+                                       __FUNCTION__, __LINE__));
                                break;
+                       }
+
                        /*
                         * Handling  RAID components
                         */
                        if (ev->phys_disk_num_valid) {
                                vtarget->target_id = ev->phys_disk_num;
                                vtarget->tflags |= MPT_TARGET_FLAGS_RAID_COMPONENT;
-                               mptsas_reprobe_target(vtarget->starget, 1);
+                               mptsas_reprobe_target(starget, 1);
                                break;
                        }
+
+                       vtarget->deleted = 1;
+                       mptsas_target_reset(ioc, vtarget);
                }
 
                if (phy_info->attached.device_info & MPI_SAS_DEVICE_INFO_SSP_TARGET)
@@ -1738,10 +2184,11 @@ mptsas_hotplug_work(void *arg)
                       "removing %s device, channel %d, id %d, phy %d\n",
                       ioc->name, ds, ev->channel, ev->id, phy_info->phy_id);
 
-               sas_rphy_delete(phy_info->rphy);
-               memset(&phy_info->attached, 0, sizeof(struct mptsas_devinfo));
-               phy_info->rphy = NULL;
-               phy_info->starget = NULL;
+#ifdef MPT_DEBUG_SAS_WIDE
+               dev_printk(KERN_DEBUG, &port->dev, "delete\n");
+#endif
+               sas_port_delete(port);
+               mptsas_port_delete(phy_info->port_details);
                break;
        case MPTSAS_ADD_DEVICE:
 
@@ -1753,59 +2200,60 @@ mptsas_hotplug_work(void *arg)
                 */
                if (mptsas_sas_device_pg0(ioc, &sas_device,
                    (MPI_SAS_DEVICE_PGAD_FORM_BUS_TARGET_ID <<
-                    MPI_SAS_DEVICE_PGAD_FORM_SHIFT), ev->id))
+                    MPI_SAS_DEVICE_PGAD_FORM_SHIFT), ev->id)) {
+                               dfailprintk((MYIOC_s_ERR_FMT
+                                       "%s: exit at line=%d\n", ioc->name,
+                                       __FUNCTION__, __LINE__));
                        break;
+               }
 
-               phy_info = mptsas_find_phyinfo_by_parent(ioc,
-                               sas_device.handle_parent, sas_device.phy_id);
+               ssleep(2);
+               __mptsas_discovery_work(ioc);
 
-               if (!phy_info) {
-                       u32 handle = 0xFFFF;
+               phy_info = mptsas_find_phyinfo_by_sas_address(ioc,
+                               sas_device.sas_address);
 
-                       /*
-                       * Its possible when an expander has been hot added
-                       * containing attached devices, the sas firmware
-                       * may send a RC_ADDED event prior to the
-                       * DISCOVERY STOP event. If that occurs, our
-                       * view of the topology in the driver in respect to this
-                       * expander might of not been setup, and we hit this
-                       * condition.
-                       * Therefore, this code kicks off discovery to
-                       * refresh the data.
-                       * Then again, we check whether the parent phy has
-                       * been created.
-                       */
-                       ioc->sas_discovery_runtime=1;
-                       mptsas_delete_expander_phys(ioc);
-                       mptsas_probe_hba_phys(ioc);
-                       while (!mptsas_probe_expander_phys(ioc, &handle))
-                               ;
-                       ioc->sas_discovery_runtime=0;
-
-                       phy_info = mptsas_find_phyinfo_by_parent(ioc,
-                               sas_device.handle_parent, sas_device.phy_id);
-                       if (!phy_info)
-                               break;
+               if (!phy_info || !phy_info->port_details) {
+                       dfailprintk((MYIOC_s_ERR_FMT
+                               "%s: exit at line=%d\n", ioc->name,
+                               __FUNCTION__, __LINE__));
+                       break;
                }
 
-               if (phy_info->starget) {
-                       vtarget = phy_info->starget->hostdata;
+               starget = mptsas_get_starget(phy_info);
+               if (starget) {
+                       vtarget = starget->hostdata;
 
-                       if (!vtarget)
+                       if (!vtarget) {
+                               dfailprintk((MYIOC_s_ERR_FMT
+                                       "%s: exit at line=%d\n", ioc->name,
+                                       __FUNCTION__, __LINE__));
                                break;
+                       }
                        /*
                         * Handling  RAID components
                         */
                        if (vtarget->tflags & MPT_TARGET_FLAGS_RAID_COMPONENT) {
                                vtarget->tflags &= ~MPT_TARGET_FLAGS_RAID_COMPONENT;
                                vtarget->target_id = ev->id;
-                               mptsas_reprobe_target(phy_info->starget, 0);
+                               mptsas_reprobe_target(starget, 0);
                        }
                        break;
                }
 
-               if (phy_info->rphy)
+               if (mptsas_get_rphy(phy_info)) {
+                       dfailprintk((MYIOC_s_ERR_FMT
+                               "%s: exit at line=%d\n", ioc->name,
+                               __FUNCTION__, __LINE__));
                        break;
+               }
+               port = mptsas_get_port(phy_info);
+               if (!port) {
+                       dfailprintk((MYIOC_s_ERR_FMT
+                               "%s: exit at line=%d\n", ioc->name,
+                               __FUNCTION__, __LINE__));
+                       break;
+               }
 
                memcpy(&phy_info->attached, &sas_device,
                    sizeof(struct mptsas_devinfo));
@@ -1822,28 +2270,23 @@ mptsas_hotplug_work(void *arg)
                       ioc->name, ds, ev->channel, ev->id, ev->phy_id);
 
                mptsas_parse_device_info(&identify, &phy_info->attached);
-               switch (identify.device_type) {
-               case SAS_END_DEVICE:
-                       rphy = sas_end_device_alloc(phy_info->phy);
-                       break;
-               case SAS_EDGE_EXPANDER_DEVICE:
-               case SAS_FANOUT_EXPANDER_DEVICE:
-                       rphy = sas_expander_alloc(phy_info->phy, identify.device_type);
-                       break;
-               default:
-                       rphy = NULL;
-                       break;
-               }
-               if (!rphy)
+               rphy = sas_end_device_alloc(port);
+               if (!rphy) {
+                       dfailprintk((MYIOC_s_ERR_FMT
+                               "%s: exit at line=%d\n", ioc->name,
+                               __FUNCTION__, __LINE__));
                        break; /* non-fatal: an rphy can be added later */
+               }
 
                rphy->identify = identify;
                if (sas_rphy_add(rphy)) {
+                       dfailprintk((MYIOC_s_ERR_FMT
+                               "%s: exit at line=%d\n", ioc->name,
+                               __FUNCTION__, __LINE__));
                        sas_rphy_free(rphy);
                        break;
                }
-
-               phy_info->rphy = rphy;
+               mptsas_set_rphy(phy_info, rphy);
                break;
        case MPTSAS_ADD_RAID:
                sdev = scsi_device_lookup(
@@ -1875,6 +2318,9 @@ mptsas_hotplug_work(void *arg)
                printk(MYIOC_s_INFO_FMT
                       "removing raid volume, channel %d, id %d\n",
                       ioc->name, ioc->num_ports, ev->id);
+               vdevice = sdev->hostdata;
+               vdevice->vtarget->deleted = 1;
+               mptsas_target_reset(ioc, vdevice->vtarget);
                scsi_remove_device(sdev);
                scsi_device_put(sdev);
                mpt_findImVolumes(ioc);
@@ -1884,12 +2330,13 @@ mptsas_hotplug_work(void *arg)
                break;
        }
 
-       kfree(ev);
        mutex_unlock(&ioc->sas_discovery_mutex);
+       kfree(ev);
+
 }
 
 static void
-mptscsih_send_sas_event(MPT_ADAPTER *ioc,
+mptsas_send_sas_event(MPT_ADAPTER *ioc,
                EVENT_DATA_SAS_DEVICE_STATUS_CHANGE *sas_event_data)
 {
        struct mptsas_hotplug_event *ev;
@@ -1905,7 +2352,7 @@ mptscsih_send_sas_event(MPT_ADAPTER *ioc,
        switch (sas_event_data->ReasonCode) {
        case MPI_EVENT_SAS_DEV_STAT_RC_ADDED:
        case MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING:
-               ev = kmalloc(sizeof(*ev), GFP_ATOMIC);
+               ev = kzalloc(sizeof(*ev), GFP_ATOMIC);
                if (!ev) {
                        printk(KERN_WARNING "mptsas: lost hotplug event\n");
                        break;
@@ -1935,10 +2382,9 @@ mptscsih_send_sas_event(MPT_ADAPTER *ioc,
        /*
         * Persistent table is full.
         */
-               INIT_WORK(&ioc->mptscsih_persistTask,
-                   mptscsih_sas_persist_clear_table,
-                   (void *)ioc);
-               schedule_work(&ioc->mptscsih_persistTask);
+               INIT_WORK(&ioc->sas_persist_task,
+                   mptsas_persist_clear_table, (void *)ioc);
+               schedule_work(&ioc->sas_persist_task);
                break;
        case MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA:
        /* TODO */
@@ -1950,7 +2396,7 @@ mptscsih_send_sas_event(MPT_ADAPTER *ioc,
 }
 
 static void
-mptscsih_send_raid_event(MPT_ADAPTER *ioc,
+mptsas_send_raid_event(MPT_ADAPTER *ioc,
                EVENT_DATA_RAID *raid_event_data)
 {
        struct mptsas_hotplug_event *ev;
@@ -1960,13 +2406,12 @@ mptscsih_send_raid_event(MPT_ADAPTER *ioc,
        if (ioc->bus_type != SAS)
                return;
 
-       ev = kmalloc(sizeof(*ev), GFP_ATOMIC);
+       ev = kzalloc(sizeof(*ev), GFP_ATOMIC);
        if (!ev) {
                printk(KERN_WARNING "mptsas: lost hotplug event\n");
                return;
        }
 
-       memset(ev,0,sizeof(struct mptsas_hotplug_event));
        INIT_WORK(&ev->work, mptsas_hotplug_work, ev);
        ev->ioc = ioc;
        ev->id = raid_event_data->VolumeID;
@@ -2028,7 +2473,7 @@ mptscsih_send_raid_event(MPT_ADAPTER *ioc,
 }
 
 static void
-mptscsih_send_discovery(MPT_ADAPTER *ioc,
+mptsas_send_discovery_event(MPT_ADAPTER *ioc,
        EVENT_DATA_SAS_DISCOVERY *discovery_data)
 {
        struct mptsas_discovery_event *ev;
@@ -2043,11 +2488,10 @@ mptscsih_send_discovery(MPT_ADAPTER *ioc,
        if (discovery_data->DiscoveryStatus)
                return;
 
-       ev = kmalloc(sizeof(*ev), GFP_ATOMIC);
+       ev = kzalloc(sizeof(*ev), GFP_ATOMIC);
        if (!ev)
                return;
-       memset(ev,0,sizeof(struct mptsas_discovery_event));
-       INIT_WORK(&ev->work, mptscsih_discovery_work, ev);
+       INIT_WORK(&ev->work, mptsas_discovery_work, ev);
        ev->ioc = ioc;
        schedule_work(&ev->work);
 };
@@ -2075,21 +2519,21 @@ mptsas_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *reply)
 
        switch (event) {
        case MPI_EVENT_SAS_DEVICE_STATUS_CHANGE:
-               mptscsih_send_sas_event(ioc,
+               mptsas_send_sas_event(ioc,
                        (EVENT_DATA_SAS_DEVICE_STATUS_CHANGE *)reply->Data);
                break;
        case MPI_EVENT_INTEGRATED_RAID:
-               mptscsih_send_raid_event(ioc,
+               mptsas_send_raid_event(ioc,
                        (EVENT_DATA_RAID *)reply->Data);
                break;
        case MPI_EVENT_PERSISTENT_TABLE_FULL:
-               INIT_WORK(&ioc->mptscsih_persistTask,
-                   mptscsih_sas_persist_clear_table,
+               INIT_WORK(&ioc->sas_persist_task,
+                   mptsas_persist_clear_table,
                    (void *)ioc);
-               schedule_work(&ioc->mptscsih_persistTask);
+               schedule_work(&ioc->sas_persist_task);
                break;
         case MPI_EVENT_SAS_DISCOVERY:
-               mptscsih_send_discovery(ioc,
+               mptsas_send_discovery_event(ioc,
                        (EVENT_DATA_SAS_DISCOVERY *)reply->Data);
                break;
        default:
@@ -2308,7 +2752,7 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
        return 0;
 
-out_mptsas_probe:
+ out_mptsas_probe:
 
        mptscsih_remove(pdev);
        return error;
@@ -2318,6 +2762,7 @@ static void __devexit mptsas_remove(struct pci_dev *pdev)
 {
        MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
        struct mptsas_portinfo *p, *n;
+       int i;
 
        ioc->sas_discovery_ignore_events=1;
        sas_remove_host(ioc->sh);
@@ -2325,8 +2770,9 @@ static void __devexit mptsas_remove(struct pci_dev *pdev)
        mutex_lock(&ioc->sas_topology_mutex);
        list_for_each_entry_safe(p, n, &ioc->sas_topology, list) {
                list_del(&p->list);
-               if (p->phy_info)
-                       kfree(p->phy_info);
+               for (i = 0 ; i < p->num_phys ; i++)
+                       mptsas_port_delete(p->phy_info[i].port_details);
+               kfree(p->phy_info);
                kfree(p);
        }
        mutex_unlock(&ioc->sas_topology_mutex);
@@ -2335,17 +2781,15 @@ static void __devexit mptsas_remove(struct pci_dev *pdev)
 }
 
 static struct pci_device_id mptsas_pci_table[] = {
-       { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_SAS1064,
-               PCI_ANY_ID, PCI_ANY_ID },
-       { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_SAS1066,
+       { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVID_SAS1064,
                PCI_ANY_ID, PCI_ANY_ID },
-       { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_SAS1068,
+       { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVID_SAS1068,
                PCI_ANY_ID, PCI_ANY_ID },
-       { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_SAS1064E,
+       { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVID_SAS1064E,
                PCI_ANY_ID, PCI_ANY_ID },
-       { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_SAS1066E,
+       { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVID_SAS1068E,
                PCI_ANY_ID, PCI_ANY_ID },
-       { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_SAS1068E,
+       { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVID_SAS1078,
                PCI_ANY_ID, PCI_ANY_ID },
        {0}     /* Terminating entry */
 };
index 3201de053943c5c278d50e2164419e95b9a02bcf..0a1ff762205f0eec3d3f1cb6306527cc3adf6eaf 100644 (file)
@@ -775,9 +775,9 @@ static struct spi_function_template mptspi_transport_functions = {
  */
 
 static struct pci_device_id mptspi_pci_table[] = {
-       { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_53C1030,
+       { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVID_53C1030,
                PCI_ANY_ID, PCI_ANY_ID },
-       { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_1030_53C1035,
+       { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVID_53C1035,
                PCI_ANY_ID, PCI_ANY_ID },
        {0}     /* Terminating entry */
 };
index 5a6cca8e8c45df6cf9ff6db950f95523f14f2618..8abe45e49ad717091e1def8e0a3354e8e933369a 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
index 4f1515cae5dc94ceb589d74f3c58a3327823efe5..1b58444d5aafa4d2bea4e96a18c9229357a5269d 100644 (file)
@@ -274,7 +274,7 @@ static int i2o_pci_irq_enable(struct i2o_controller *c)
        writel(0xffffffff, c->irq_mask);
 
        if (pdev->irq) {
-               rc = request_irq(pdev->irq, i2o_pci_interrupt, SA_SHIRQ,
+               rc = request_irq(pdev->irq, i2o_pci_interrupt, IRQF_SHARED,
                                 c->name, c);
                if (rc < 0) {
                        printk(KERN_ERR "%s: unable to allocate interrupt %d."
index c8426a9bf27333bb40264f980eea4585278c92e0..632bc218c86a0388328ff07c7b27ea336d892ff9 100644 (file)
@@ -16,7 +16,6 @@
  *  Note that all locks are private to this file.  Nothing else may
  *  touch them.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
@@ -509,7 +508,7 @@ static int ucb1x00_probe(struct mcp *mcp)
                goto err_free;
        }
 
-       ret = request_irq(ucb->irq, ucb1x00_irq, SA_TRIGGER_RISING,
+       ret = request_irq(ucb->irq, ucb1x00_irq, IRQF_TRIGGER_RISING,
                          "UCB1x00", ucb);
        if (ret) {
                printk(KERN_ERR "ucb1x00: unable to grab irq%d: %d\n",
index 79fd062ccb34bee7e02804f4271a82d6291a2950..02776814443e24df9218fed9b703542e6d66c614 100644 (file)
@@ -17,7 +17,6 @@
  * pin should provide pulses even when the LCD is blanked, otherwise
  * a pen touch needed to unblank the LCD will never be read.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/init.h>
index 6aba419544488c58571d115f264368d30b3bed67..634d538ccd14eb3c3e062b12316f7b3ef3385132 100644 (file)
@@ -29,7 +29,6 @@
 #include <linux/wait.h>
 #include <linux/spinlock.h>
 #include <linux/slab.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/device.h>
index 9706cc19134a1bc7b96e812e2717846ded951717..2f3bddfab937acf0c5e93a9a94c32196a32caf8c 100644 (file)
@@ -113,7 +113,7 @@ static int __devinit ibmasm_init_one(struct pci_dev *pdev, const struct pci_devi
                goto error_ioremap;
        }
 
-       result = request_irq(sp->irq, ibmasm_interrupt_handler, SA_SHIRQ, sp->devname, (void*)sp);
+       result = request_irq(sp->irq, ibmasm_interrupt_handler, IRQF_SHARED, sp->devname, (void*)sp);
        if (result) {
                dev_err(sp->dev, "Failed to register interrupt handler\n");
                goto error_request_irq;
index 3228516b7d19abee647a3af61c2ea1a36c9e0447..6b7638b84290c0e91d4bc03e2be7328ee0388c64 100644 (file)
@@ -53,7 +53,6 @@
      Gets the status of the write protect pin, if available.
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/init.h>
@@ -851,7 +850,7 @@ static int at91_mci_probe(struct platform_device *pdev)
        /*
         * Allocate the MCI interrupt
         */
-       ret = request_irq(AT91_ID_MCI, at91_mci_irq, SA_SHIRQ, DRIVER_NAME, host);
+       ret = request_irq(AT91_ID_MCI, at91_mci_irq, IRQF_SHARED, DRIVER_NAME, host);
        if (ret) {
                printk(KERN_ERR "Failed to request MCI interrupt\n");
                clk_disable(mci_clk);
index 5dc4bee7abebfb9c8685e61306ae54bdff754060..fb606165af3bb823ed5886fe2875faf545ac13fc 100644 (file)
@@ -34,7 +34,6 @@
  * So we use the timer to check the status manually.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
@@ -887,7 +886,7 @@ static int __devinit au1xmmc_probe(struct platform_device *pdev)
        int i, ret = 0;
 
        /* THe interrupt is shared among all controllers */
-       ret = request_irq(AU1100_SD_IRQ, au1xmmc_irq, SA_INTERRUPT, "MMC", 0);
+       ret = request_irq(AU1100_SD_IRQ, au1xmmc_irq, IRQF_DISABLED, "MMC", 0);
 
        if (ret) {
                printk(DRIVER_NAME "ERROR: Couldn't get int %d: %d\n",
index 5c62f4e6ad062fd5419f21133c9f422824b13765..7ca9e95bdf89b89c03237b3f4e1eb9f6ffa2124f 100644 (file)
@@ -25,7 +25,6 @@
  *             deficiencies
  *
  */
-#include <linux/config.h>
 
 #ifdef CONFIG_MMC_DEBUG
 #define DEBUG
index 6201f3086a0226d1810aab52067d0a33e22206fe..33525bdf2ab617fb4e5cd861f9d38a5d82dcde63 100644 (file)
@@ -9,7 +9,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
@@ -129,7 +128,7 @@ static void mmc_wait_done(struct mmc_request *mrq)
 
 int mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq)
 {
-       DECLARE_COMPLETION(complete);
+       DECLARE_COMPLETION_ONSTACK(complete);
 
        mrq->done_data = &complete;
        mrq->done = mmc_wait_done;
index 8576a65ca1c3383fbdf2c74ff895fbc8b75e7ba7..1886562abdd40100956cc50b12962bd91bf484d3 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.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/init.h>
@@ -532,11 +531,11 @@ static int mmci_probe(struct amba_device *dev, void *id)
        writel(0, host->base + MMCIMASK1);
        writel(0xfff, host->base + MMCICLEAR);
 
-       ret = request_irq(dev->irq[0], mmci_irq, SA_SHIRQ, DRIVER_NAME " (cmd)", host);
+       ret = request_irq(dev->irq[0], mmci_irq, IRQF_SHARED, DRIVER_NAME " (cmd)", host);
        if (ret)
                goto unmap;
 
-       ret = request_irq(dev->irq[1], mmci_pio_irq, SA_SHIRQ, DRIVER_NAME " (pio)", host);
+       ret = request_irq(dev->irq[1], mmci_pio_irq, IRQF_SHARED, DRIVER_NAME " (pio)", host);
        if (ret)
                goto irq0_free;
 
index c25244b3657bb532458fab1dae08874cf0aedc7f..ddf06b32c159912f6b4213364c4f0bc294fd49d4 100644 (file)
@@ -11,7 +11,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/init.h>
@@ -61,6 +60,7 @@ struct mmc_omap_host {
        unsigned char           id; /* 16xx chips have 2 MMC blocks */
        struct clk *            iclk;
        struct clk *            fclk;
+       struct resource         *res;
        void __iomem            *base;
        int                     irq;
        unsigned char           bus_mode;
@@ -340,8 +340,6 @@ static void
 mmc_omap_xfer_data(struct mmc_omap_host *host, int write)
 {
        int n;
-       void __iomem *reg;
-       u16 *p;
 
        if (host->buffer_bytes_left == 0) {
                host->sg_idx++;
@@ -658,12 +656,12 @@ static void mmc_omap_dma_cb(int lch, u16 ch_status, void *data)
        struct mmc_data *mmcdat = host->data;
 
        if (unlikely(host->dma_ch < 0)) {
-               dev_err(mmc_dev(host->mmc), "DMA callback while DMA not
-                               enabled\n");
+               dev_err(mmc_dev(host->mmc),
+                       "DMA callback while DMA not enabled\n");
                return;
        }
        /* FIXME: We really should do something to _handle_ the errors */
-       if (ch_status & OMAP_DMA_TOUT_IRQ) {
+       if (ch_status & OMAP1_DMA_TOUT_IRQ) {
                dev_err(mmc_dev(host->mmc),"DMA timeout\n");
                return;
        }
@@ -973,20 +971,20 @@ static int __init mmc_omap_probe(struct platform_device *pdev)
        struct omap_mmc_conf *minfo = pdev->dev.platform_data;
        struct mmc_host *mmc;
        struct mmc_omap_host *host = NULL;
+       struct resource *r;
        int ret = 0;
+       int irq;
        
-       if (platform_get_resource(pdev, IORESOURCE_MEM, 0) ||
-                       platform_get_irq(pdev, IORESOURCE_IRQ, 0)) {
-               dev_err(&pdev->dev, "mmc_omap_probe: invalid resource type\n");
-               return -ENODEV;
-       }
+       r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       irq = platform_get_irq(pdev, 0);
+       if (!r || irq < 0)
+               return -ENXIO;
 
-       if (!request_mem_region(pdev->resource[0].start,
+       r = request_mem_region(pdev->resource[0].start,
                                pdev->resource[0].end - pdev->resource[0].start + 1,
-                               pdev->name)) {
-               dev_dbg(&pdev->dev, "request_mem_region failed\n");
+                              pdev->name);
+       if (!r)
                return -EBUSY;
-       }
 
        mmc = mmc_alloc_host(sizeof(struct mmc_omap_host), &pdev->dev);
        if (!mmc) {
@@ -1003,6 +1001,8 @@ static int __init mmc_omap_probe(struct platform_device *pdev)
        host->dma_timer.data = (unsigned long) host;
 
        host->id = pdev->id;
+       host->res = r;
+       host->irq = irq;
 
        if (cpu_is_omap24xx()) {
                host->iclk = clk_get(&pdev->dev, "mmc_ick");
@@ -1032,13 +1032,9 @@ static int __init mmc_omap_probe(struct platform_device *pdev)
        host->dma_ch = -1;
 
        host->irq = pdev->resource[1].start;
-       host->base = ioremap(pdev->res.start, SZ_4K);
-       if (!host->base) {
-               ret = -ENOMEM;
-               goto out;
-       }
+       host->base = (void __iomem*)IO_ADDRESS(r->start);
 
-        if (minfo->wire4)
+       if (minfo->wire4)
                 mmc->caps |= MMC_CAP_4_BIT_DATA;
 
        mmc->ops = &mmc_omap_ops;
@@ -1057,8 +1053,8 @@ static int __init mmc_omap_probe(struct platform_device *pdev)
 
        if (host->power_pin >= 0) {
                if ((ret = omap_request_gpio(host->power_pin)) != 0) {
-                       dev_err(mmc_dev(host->mmc), "Unable to get GPIO
-                                       pin for MMC power\n");
+                       dev_err(mmc_dev(host->mmc),
+                               "Unable to get GPIO pin for MMC power\n");
                        goto out;
                }
                omap_set_gpio_direction(host->power_pin, 0);
@@ -1086,7 +1082,7 @@ static int __init mmc_omap_probe(struct platform_device *pdev)
 
                omap_set_gpio_direction(host->switch_pin, 1);
                ret = request_irq(OMAP_GPIO_IRQ(host->switch_pin),
-                                 mmc_omap_switch_irq, SA_TRIGGER_RISING, DRIVER_NAME, host);
+                                 mmc_omap_switch_irq, IRQF_TRIGGER_RISING, DRIVER_NAME, host);
                if (ret) {
                        dev_warn(mmc_dev(host->mmc), "Unable to get IRQ for MMC cover switch\n");
                        omap_free_gpio(host->switch_pin);
@@ -1100,7 +1096,7 @@ static int __init mmc_omap_probe(struct platform_device *pdev)
                                device_remove_file(&pdev->dev, &dev_attr_cover_switch);
                }
                if (ret) {
-                       dev_wan(mmc_dev(host->mmc), "Unable to create sysfs attributes\n");
+                       dev_warn(mmc_dev(host->mmc), "Unable to create sysfs attributes\n");
                        free_irq(OMAP_GPIO_IRQ(host->switch_pin), host);
                        omap_free_gpio(host->switch_pin);
                        host->switch_pin = -1;
index b49368fd96b82b051d59fe85ec00c9127ca05390..ef350908478c75217ff2474dca8824cdb9cd99e9 100644 (file)
@@ -16,7 +16,6 @@
  *     1 and 3 byte data transfers not supported
  *     max block length up to 1023
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/ioport.h>
index 8e9100bd57ef96596d9fd17884097f1da5b16f84..893319108ba4fc1abb707db60b33983c2daa69d4 100644 (file)
@@ -8,12 +8,6 @@
  * published by the Free Software Foundation.
  */
 
- /*
-  * Note that PIO transfer is rather crappy atm. The buffer full/empty
-  * interrupts aren't reliable so we currently transfer the entire buffer
-  * directly. Patches to solve the problem are welcome.
-  */
-
 #include <linux/delay.h>
 #include <linux/highmem.h>
 #include <linux/pci.h>
 #include "sdhci.h"
 
 #define DRIVER_NAME "sdhci"
-#define DRIVER_VERSION "0.11"
+#define DRIVER_VERSION "0.12"
 
 #define BUGMAIL "<sdhci-devel@list.drzeus.cx>"
 
 #define DBG(f, x...) \
        pr_debug(DRIVER_NAME " [%s()]: " f, __func__,## x)
 
+static unsigned int debug_nodma = 0;
+static unsigned int debug_forcedma = 0;
+static unsigned int debug_quirks = 0;
+
+#define SDHCI_QUIRK_CLOCK_BEFORE_RESET                 (1<<0)
+#define SDHCI_QUIRK_FORCE_DMA                          (1<<1)
+
 static const struct pci_device_id pci_ids[] __devinitdata = {
-       /* handle any SD host controller */
-       {PCI_DEVICE_CLASS((PCI_CLASS_SYSTEM_SDHCI << 8), 0xFFFF00)},
+       {
+               .vendor         = PCI_VENDOR_ID_RICOH,
+               .device         = PCI_DEVICE_ID_RICOH_R5C822,
+               .subvendor      = PCI_VENDOR_ID_IBM,
+               .subdevice      = PCI_ANY_ID,
+               .driver_data    = SDHCI_QUIRK_CLOCK_BEFORE_RESET |
+                                 SDHCI_QUIRK_FORCE_DMA,
+       },
+
+       {
+               .vendor         = PCI_VENDOR_ID_RICOH,
+               .device         = PCI_DEVICE_ID_RICOH_R5C822,
+               .subvendor      = PCI_ANY_ID,
+               .subdevice      = PCI_ANY_ID,
+               .driver_data    = SDHCI_QUIRK_FORCE_DMA,
+       },
+
+       {
+               .vendor         = PCI_VENDOR_ID_TI,
+               .device         = PCI_DEVICE_ID_TI_XX21_XX11_SD,
+               .subvendor      = PCI_ANY_ID,
+               .subdevice      = PCI_ANY_ID,
+               .driver_data    = SDHCI_QUIRK_FORCE_DMA,
+       },
+
+       {       /* Generic SD host controller */
+               PCI_DEVICE_CLASS((PCI_CLASS_SYSTEM_SDHCI << 8), 0xFFFF00)
+       },
+
        { /* end: all zeroes */ },
 };
 
@@ -94,12 +122,27 @@ static void sdhci_dumpregs(struct sdhci_host *host)
 
 static void sdhci_reset(struct sdhci_host *host, u8 mask)
 {
+       unsigned long timeout;
+
        writeb(mask, host->ioaddr + SDHCI_SOFTWARE_RESET);
 
-       if (mask & SDHCI_RESET_ALL) {
+       if (mask & SDHCI_RESET_ALL)
                host->clock = 0;
 
-               mdelay(50);
+       /* Wait max 100 ms */
+       timeout = 100;
+
+       /* hw clears the bit when it's done */
+       while (readb(host->ioaddr + SDHCI_SOFTWARE_RESET) & mask) {
+               if (timeout == 0) {
+                       printk(KERN_ERR "%s: Reset 0x%x never completed. "
+                               "Please report this to " BUGMAIL ".\n",
+                               mmc_hostname(host->mmc), (int)mask);
+                       sdhci_dumpregs(host);
+                       return;
+               }
+               timeout--;
+               mdelay(1);
        }
 }
 
@@ -109,13 +152,15 @@ static void sdhci_init(struct sdhci_host *host)
 
        sdhci_reset(host, SDHCI_RESET_ALL);
 
-       intmask = ~(SDHCI_INT_CARD_INT | SDHCI_INT_BUF_EMPTY | SDHCI_INT_BUF_FULL);
+       intmask = SDHCI_INT_BUS_POWER | SDHCI_INT_DATA_END_BIT |
+               SDHCI_INT_DATA_CRC | SDHCI_INT_DATA_TIMEOUT | SDHCI_INT_INDEX |
+               SDHCI_INT_END_BIT | SDHCI_INT_CRC | SDHCI_INT_TIMEOUT |
+               SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT |
+               SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL |
+               SDHCI_INT_DMA_END | SDHCI_INT_DATA_END | SDHCI_INT_RESPONSE;
 
        writel(intmask, host->ioaddr + SDHCI_INT_ENABLE);
        writel(intmask, host->ioaddr + SDHCI_SIGNAL_ENABLE);
-
-       /* This is unknown magic. */
-       writeb(0xE, host->ioaddr + SDHCI_TIMEOUT_CONTROL);
 }
 
 static void sdhci_activate_led(struct sdhci_host *host)
@@ -172,79 +217,96 @@ static inline int sdhci_next_sg(struct sdhci_host* host)
        return host->num_sg;
 }
 
-static void sdhci_transfer_pio(struct sdhci_host *host)
+static void sdhci_read_block_pio(struct sdhci_host *host)
 {
+       int blksize, chunk_remain;
+       u32 data;
        char *buffer;
-       u32 mask;
-       int bytes, size;
-       unsigned long max_jiffies;
+       int size;
 
-       BUG_ON(!host->data);
+       DBG("PIO reading\n");
 
-       if (host->num_sg == 0)
-               return;
-
-       bytes = 0;
-       if (host->data->flags & MMC_DATA_READ)
-               mask = SDHCI_DATA_AVAILABLE;
-       else
-               mask = SDHCI_SPACE_AVAILABLE;
+       blksize = host->data->blksz;
+       chunk_remain = 0;
+       data = 0;
 
        buffer = sdhci_kmap_sg(host) + host->offset;
 
-       /* Transfer shouldn't take more than 5 s */
-       max_jiffies = jiffies + HZ * 5;
+       while (blksize) {
+               if (chunk_remain == 0) {
+                       data = readl(host->ioaddr + SDHCI_BUFFER);
+                       chunk_remain = min(blksize, 4);
+               }
 
-       while (host->size > 0) {
-               if (time_after(jiffies, max_jiffies)) {
-                       printk(KERN_ERR "%s: PIO transfer stalled. "
-                               "Please report this to "
-                               BUGMAIL ".\n", mmc_hostname(host->mmc));
-                       sdhci_dumpregs(host);
+               size = min(host->size, host->remain);
+               size = min(size, chunk_remain);
 
-                       sdhci_kunmap_sg(host);
+               chunk_remain -= size;
+               blksize -= size;
+               host->offset += size;
+               host->remain -= size;
+               host->size -= size;
+               while (size) {
+                       *buffer = data & 0xFF;
+                       buffer++;
+                       data >>= 8;
+                       size--;
+               }
 
-                       host->data->error = MMC_ERR_FAILED;
-                       sdhci_finish_data(host);
-                       return;
+               if (host->remain == 0) {
+                       sdhci_kunmap_sg(host);
+                       if (sdhci_next_sg(host) == 0) {
+                               BUG_ON(blksize != 0);
+                               return;
+                       }
+                       buffer = sdhci_kmap_sg(host);
                }
+       }
 
-               if (!(readl(host->ioaddr + SDHCI_PRESENT_STATE) & mask))
-                       continue;
+       sdhci_kunmap_sg(host);
+}
 
-               size = min(host->size, host->remain);
+static void sdhci_write_block_pio(struct sdhci_host *host)
+{
+       int blksize, chunk_remain;
+       u32 data;
+       char *buffer;
+       int bytes, size;
 
-               if (size >= 4) {
-                       if (host->data->flags & MMC_DATA_READ)
-                               *(u32*)buffer = readl(host->ioaddr + SDHCI_BUFFER);
-                       else
-                               writel(*(u32*)buffer, host->ioaddr + SDHCI_BUFFER);
-                       size = 4;
-               } else if (size >= 2) {
-                       if (host->data->flags & MMC_DATA_READ)
-                               *(u16*)buffer = readw(host->ioaddr + SDHCI_BUFFER);
-                       else
-                               writew(*(u16*)buffer, host->ioaddr + SDHCI_BUFFER);
-                       size = 2;
-               } else {
-                       if (host->data->flags & MMC_DATA_READ)
-                               *(u8*)buffer = readb(host->ioaddr + SDHCI_BUFFER);
-                       else
-                               writeb(*(u8*)buffer, host->ioaddr + SDHCI_BUFFER);
-                       size = 1;
-               }
+       DBG("PIO writing\n");
+
+       blksize = host->data->blksz;
+       chunk_remain = 4;
+       data = 0;
 
-               buffer += size;
+       bytes = 0;
+       buffer = sdhci_kmap_sg(host) + host->offset;
+
+       while (blksize) {
+               size = min(host->size, host->remain);
+               size = min(size, chunk_remain);
+
+               chunk_remain -= size;
+               blksize -= size;
                host->offset += size;
                host->remain -= size;
-
-               bytes += size;
                host->size -= size;
+               while (size) {
+                       data >>= 8;
+                       data |= (u32)*buffer << 24;
+                       buffer++;
+                       size--;
+               }
+
+               if (chunk_remain == 0) {
+                       writel(data, host->ioaddr + SDHCI_BUFFER);
+                       chunk_remain = min(blksize, 4);
+               }
 
                if (host->remain == 0) {
                        sdhci_kunmap_sg(host);
                        if (sdhci_next_sg(host) == 0) {
-                               DBG("PIO transfer: %d bytes\n", bytes);
+                               BUG_ON(blksize != 0);
                                return;
                        }
                        buffer = sdhci_kmap_sg(host);
@@ -252,38 +314,87 @@ static void sdhci_transfer_pio(struct sdhci_host *host)
        }
 
        sdhci_kunmap_sg(host);
+}
+
+static void sdhci_transfer_pio(struct sdhci_host *host)
+{
+       u32 mask;
+
+       BUG_ON(!host->data);
+
+       if (host->size == 0)
+               return;
+
+       if (host->data->flags & MMC_DATA_READ)
+               mask = SDHCI_DATA_AVAILABLE;
+       else
+               mask = SDHCI_SPACE_AVAILABLE;
+
+       while (readl(host->ioaddr + SDHCI_PRESENT_STATE) & mask) {
+               if (host->data->flags & MMC_DATA_READ)
+                       sdhci_read_block_pio(host);
+               else
+                       sdhci_write_block_pio(host);
+
+               if (host->size == 0)
+                       break;
+
+               BUG_ON(host->num_sg == 0);
+       }
 
-       DBG("PIO transfer: %d bytes\n", bytes);
+       DBG("PIO transfer complete.\n");
 }
 
 static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data)
 {
-       u16 mode;
+       u8 count;
+       unsigned target_timeout, current_timeout;
 
        WARN_ON(host->data);
 
-       if (data == NULL) {
-               writew(0, host->ioaddr + SDHCI_TRANSFER_MODE);
+       if (data == NULL)
                return;
-       }
 
        DBG("blksz %04x blks %04x flags %08x\n",
                data->blksz, data->blocks, data->flags);
        DBG("tsac %d ms nsac %d clk\n",
                data->timeout_ns / 1000000, data->timeout_clks);
 
-       mode = SDHCI_TRNS_BLK_CNT_EN;
-       if (data->blocks > 1)
-               mode |= SDHCI_TRNS_MULTI;
-       if (data->flags & MMC_DATA_READ)
-               mode |= SDHCI_TRNS_READ;
-       if (host->flags & SDHCI_USE_DMA)
-               mode |= SDHCI_TRNS_DMA;
+       /* Sanity checks */
+       BUG_ON(data->blksz * data->blocks > 524288);
+       BUG_ON(data->blksz > host->max_block);
+       BUG_ON(data->blocks > 65535);
 
-       writew(mode, host->ioaddr + SDHCI_TRANSFER_MODE);
+       /* timeout in us */
+       target_timeout = data->timeout_ns / 1000 +
+               data->timeout_clks / host->clock;
 
-       writew(data->blksz, host->ioaddr + SDHCI_BLOCK_SIZE);
-       writew(data->blocks, host->ioaddr + SDHCI_BLOCK_COUNT);
+       /*
+        * Figure out needed cycles.
+        * We do this in steps in order to fit inside a 32 bit int.
+        * The first step is the minimum timeout, which will have a
+        * minimum resolution of 6 bits:
+        * (1) 2^13*1000 > 2^22,
+        * (2) host->timeout_clk < 2^16
+        *     =>
+        *     (1) / (2) > 2^6
+        */
+       count = 0;
+       current_timeout = (1 << 13) * 1000 / host->timeout_clk;
+       while (current_timeout < target_timeout) {
+               count++;
+               current_timeout <<= 1;
+               if (count >= 0xF)
+                       break;
+       }
+
+       if (count >= 0xF) {
+               printk(KERN_WARNING "%s: Too large timeout requested!\n",
+                       mmc_hostname(host->mmc));
+               count = 0xE;
+       }
+
+       writeb(count, host->ioaddr + SDHCI_TIMEOUT_CONTROL);
 
        if (host->flags & SDHCI_USE_DMA) {
                int count;
@@ -302,12 +413,37 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data)
                host->offset = 0;
                host->remain = host->cur_sg->length;
        }
+
+       /* We do not handle DMA boundaries, so set it to max (512 KiB) */
+       writew(SDHCI_MAKE_BLKSZ(7, data->blksz),
+               host->ioaddr + SDHCI_BLOCK_SIZE);
+       writew(data->blocks, host->ioaddr + SDHCI_BLOCK_COUNT);
+}
+
+static void sdhci_set_transfer_mode(struct sdhci_host *host,
+       struct mmc_data *data)
+{
+       u16 mode;
+
+       WARN_ON(host->data);
+
+       if (data == NULL)
+               return;
+
+       mode = SDHCI_TRNS_BLK_CNT_EN;
+       if (data->blocks > 1)
+               mode |= SDHCI_TRNS_MULTI;
+       if (data->flags & MMC_DATA_READ)
+               mode |= SDHCI_TRNS_READ;
+       if (host->flags & SDHCI_USE_DMA)
+               mode |= SDHCI_TRNS_DMA;
+
+       writew(mode, host->ioaddr + SDHCI_TRANSFER_MODE);
 }
 
 static void sdhci_finish_data(struct sdhci_host *host)
 {
        struct mmc_data *data;
-       u32 intmask;
        u16 blocks;
 
        BUG_ON(!host->data);
@@ -318,14 +454,6 @@ static void sdhci_finish_data(struct sdhci_host *host)
        if (host->flags & SDHCI_USE_DMA) {
                pci_unmap_sg(host->chip->pdev, data->sg, data->sg_len,
                        (data->flags & MMC_DATA_READ)?PCI_DMA_FROMDEVICE:PCI_DMA_TODEVICE);
-       } else {
-               intmask = readl(host->ioaddr + SDHCI_SIGNAL_ENABLE);
-               intmask &= ~(SDHCI_INT_BUF_EMPTY | SDHCI_INT_BUF_FULL);
-               writel(intmask, host->ioaddr + SDHCI_SIGNAL_ENABLE);
-
-               intmask = readl(host->ioaddr + SDHCI_INT_ENABLE);
-               intmask &= ~(SDHCI_INT_BUF_EMPTY | SDHCI_INT_BUF_FULL);
-               writel(intmask, host->ioaddr + SDHCI_INT_ENABLE);
        }
 
        /*
@@ -342,9 +470,7 @@ static void sdhci_finish_data(struct sdhci_host *host)
                        "though there were blocks left. Please report this "
                        "to " BUGMAIL ".\n", mmc_hostname(host->mmc));
                data->error = MMC_ERR_FAILED;
-       }
-
-       if (host->size != 0) {
+       } else if (host->size != 0) {
                printk(KERN_ERR "%s: %d bytes were left untransferred. "
                        "Please report this to " BUGMAIL ".\n",
                        mmc_hostname(host->mmc), host->size);
@@ -371,27 +497,38 @@ static void sdhci_finish_data(struct sdhci_host *host)
 static void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd)
 {
        int flags;
-       u32 present;
-       unsigned long max_jiffies;
+       u32 mask;
+       unsigned long timeout;
 
        WARN_ON(host->cmd);
 
        DBG("Sending cmd (%x)\n", cmd->opcode);
 
        /* Wait max 10 ms */
-       max_jiffies = jiffies + (HZ + 99)/100;
-       do {
-               if (time_after(jiffies, max_jiffies)) {
+       timeout = 10;
+
+       mask = SDHCI_CMD_INHIBIT;
+       if ((cmd->data != NULL) || (cmd->flags & MMC_RSP_BUSY))
+               mask |= SDHCI_DATA_INHIBIT;
+
+       /* We shouldn't wait for data inihibit for stop commands, even
+          though they might use busy signaling */
+       if (host->mrq->data && (cmd == host->mrq->data->stop))
+               mask &= ~SDHCI_DATA_INHIBIT;
+
+       while (readl(host->ioaddr + SDHCI_PRESENT_STATE) & mask) {
+               if (timeout == 0) {
                        printk(KERN_ERR "%s: Controller never released "
-                               "inhibit bits. Please report this to "
+                               "inhibit bit(s). Please report this to "
                                BUGMAIL ".\n", mmc_hostname(host->mmc));
                        sdhci_dumpregs(host);
                        cmd->error = MMC_ERR_FAILED;
                        tasklet_schedule(&host->finish_tasklet);
                        return;
                }
-               present = readl(host->ioaddr + SDHCI_PRESENT_STATE);
-       } while (present & (SDHCI_CMD_INHIBIT | SDHCI_DATA_INHIBIT));
+               timeout--;
+               mdelay(1);
+       }
 
        mod_timer(&host->timer, jiffies + 10 * HZ);
 
@@ -401,6 +538,8 @@ static void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd)
 
        writel(cmd->arg, host->ioaddr + SDHCI_ARGUMENT);
 
+       sdhci_set_transfer_mode(host, cmd->data);
+
        if ((cmd->flags & MMC_RSP_136) && (cmd->flags & MMC_RSP_BUSY)) {
                printk(KERN_ERR "%s: Unsupported response type! "
                        "Please report this to " BUGMAIL ".\n",
@@ -456,31 +595,9 @@ static void sdhci_finish_command(struct sdhci_host *host)
 
        DBG("Ending cmd (%x)\n", host->cmd->opcode);
 
-       if (host->cmd->data) {
-               u32 intmask;
-
+       if (host->cmd->data)
                host->data = host->cmd->data;
-
-               if (!(host->flags & SDHCI_USE_DMA)) {
-                       /*
-                        * Don't enable the interrupts until now to make sure we
-                        * get stable handling of the FIFO.
-                        */
-                       intmask = readl(host->ioaddr + SDHCI_INT_ENABLE);
-                       intmask |= SDHCI_INT_BUF_EMPTY | SDHCI_INT_BUF_FULL;
-                       writel(intmask, host->ioaddr + SDHCI_INT_ENABLE);
-
-                       intmask = readl(host->ioaddr + SDHCI_SIGNAL_ENABLE);
-                       intmask |= SDHCI_INT_BUF_EMPTY | SDHCI_INT_BUF_FULL;
-                       writel(intmask, host->ioaddr + SDHCI_SIGNAL_ENABLE);
-
-                       /*
-                        * The buffer interrupts are to unreliable so we
-                        * start the transfer immediatly.
-                        */
-                       sdhci_transfer_pio(host);
-               }
-       } else
+       else
                tasklet_schedule(&host->finish_tasklet);
 
        host->cmd = NULL;
@@ -490,7 +607,7 @@ static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock)
 {
        int div;
        u16 clk;
-       unsigned long max_jiffies;
+       unsigned long timeout;
 
        if (clock == host->clock)
                return;
@@ -511,17 +628,19 @@ static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock)
        writew(clk, host->ioaddr + SDHCI_CLOCK_CONTROL);
 
        /* Wait max 10 ms */
-       max_jiffies = jiffies + (HZ + 99)/100;
-       do {
-               if (time_after(jiffies, max_jiffies)) {
+       timeout = 10;
+       while (!((clk = readw(host->ioaddr + SDHCI_CLOCK_CONTROL))
+               & SDHCI_CLOCK_INT_STABLE)) {
+               if (timeout == 0) {
                        printk(KERN_ERR "%s: Internal clock never stabilised. "
                                "Please report this to " BUGMAIL ".\n",
                                mmc_hostname(host->mmc));
                        sdhci_dumpregs(host);
                        return;
                }
-               clk = readw(host->ioaddr + SDHCI_CLOCK_CONTROL);
-       } while (!(clk & SDHCI_CLOCK_INT_STABLE));
+               timeout--;
+               mdelay(1);
+       }
 
        clk |= SDHCI_CLOCK_CARD_EN;
        writew(clk, host->ioaddr + SDHCI_CLOCK_CONTROL);
@@ -530,6 +649,46 @@ out:
        host->clock = clock;
 }
 
+static void sdhci_set_power(struct sdhci_host *host, unsigned short power)
+{
+       u8 pwr;
+
+       if (host->power == power)
+               return;
+
+       writeb(0, host->ioaddr + SDHCI_POWER_CONTROL);
+
+       if (power == (unsigned short)-1)
+               goto out;
+
+       pwr = SDHCI_POWER_ON;
+
+       switch (power) {
+       case MMC_VDD_170:
+       case MMC_VDD_180:
+       case MMC_VDD_190:
+               pwr |= SDHCI_POWER_180;
+               break;
+       case MMC_VDD_290:
+       case MMC_VDD_300:
+       case MMC_VDD_310:
+               pwr |= SDHCI_POWER_300;
+               break;
+       case MMC_VDD_320:
+       case MMC_VDD_330:
+       case MMC_VDD_340:
+               pwr |= SDHCI_POWER_330;
+               break;
+       default:
+               BUG();
+       }
+
+       writeb(pwr, host->ioaddr + SDHCI_POWER_CONTROL);
+
+out:
+       host->power = power;
+}
+
 /*****************************************************************************\
  *                                                                           *
  * MMC callbacks                                                             *
@@ -576,17 +735,15 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
         */
        if (ios->power_mode == MMC_POWER_OFF) {
                writel(0, host->ioaddr + SDHCI_SIGNAL_ENABLE);
-               spin_unlock_irqrestore(&host->lock, flags);
                sdhci_init(host);
-               spin_lock_irqsave(&host->lock, flags);
        }
 
        sdhci_set_clock(host, ios->clock);
 
        if (ios->power_mode == MMC_POWER_OFF)
-               writeb(0, host->ioaddr + SDHCI_POWER_CONTROL);
+               sdhci_set_power(host, -1);
        else
-               writeb(0xFF, host->ioaddr + SDHCI_POWER_CONTROL);
+               sdhci_set_power(host, ios->vdd);
 
        ctrl = readb(host->ioaddr + SDHCI_HOST_CONTROL);
        if (ios->bus_width == MMC_BUS_WIDTH_4)
@@ -679,6 +836,19 @@ static void sdhci_tasklet_finish(unsigned long param)
        if ((mrq->cmd->error != MMC_ERR_NONE) ||
                (mrq->data && ((mrq->data->error != MMC_ERR_NONE) ||
                (mrq->data->stop && (mrq->data->stop->error != MMC_ERR_NONE))))) {
+
+               /* Some controllers need this kick or reset won't work here */
+               if (host->chip->quirks & SDHCI_QUIRK_CLOCK_BEFORE_RESET) {
+                       unsigned int clock;
+
+                       /* This is to force an update */
+                       clock = host->clock;
+                       host->clock = 0;
+                       sdhci_set_clock(host, clock);
+               }
+
+               /* Spec says we should do both at the same time, but Ricoh
+                  controllers do not like that. */
                sdhci_reset(host, SDHCI_RESET_CMD);
                sdhci_reset(host, SDHCI_RESET_DATA);
        }
@@ -793,7 +963,7 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask)
        if (host->data->error != MMC_ERR_NONE)
                sdhci_finish_data(host);
        else {
-               if (intmask & (SDHCI_INT_BUF_FULL | SDHCI_INT_BUF_EMPTY))
+               if (intmask & (SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL))
                        sdhci_transfer_pio(host);
 
                if (intmask & SDHCI_INT_DATA_END)
@@ -818,50 +988,44 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id, struct pt_regs *regs)
 
        DBG("*** %s got interrupt: 0x%08x\n", host->slot_descr, intmask);
 
-       if (intmask & (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE))
+       if (intmask & (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE)) {
+               writel(intmask & (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE),
+                       host->ioaddr + SDHCI_INT_STATUS);
                tasklet_schedule(&host->card_tasklet);
+       }
 
-       if (intmask & SDHCI_INT_CMD_MASK) {
-               sdhci_cmd_irq(host, intmask & SDHCI_INT_CMD_MASK);
+       intmask &= ~(SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE);
 
+       if (intmask & SDHCI_INT_CMD_MASK) {
                writel(intmask & SDHCI_INT_CMD_MASK,
                        host->ioaddr + SDHCI_INT_STATUS);
+               sdhci_cmd_irq(host, intmask & SDHCI_INT_CMD_MASK);
        }
 
        if (intmask & SDHCI_INT_DATA_MASK) {
-               sdhci_data_irq(host, intmask & SDHCI_INT_DATA_MASK);
-
                writel(intmask & SDHCI_INT_DATA_MASK,
                        host->ioaddr + SDHCI_INT_STATUS);
+               sdhci_data_irq(host, intmask & SDHCI_INT_DATA_MASK);
        }
 
        intmask &= ~(SDHCI_INT_CMD_MASK | SDHCI_INT_DATA_MASK);
 
-       if (intmask & SDHCI_INT_CARD_INT) {
-               printk(KERN_ERR "%s: Unexpected card interrupt. Please "
-                       "report this to " BUGMAIL ".\n",
-                       mmc_hostname(host->mmc));
-               sdhci_dumpregs(host);
-       }
-
        if (intmask & SDHCI_INT_BUS_POWER) {
-               printk(KERN_ERR "%s: Unexpected bus power interrupt. Please "
-                       "report this to " BUGMAIL ".\n",
+               printk(KERN_ERR "%s: Card is consuming too much power!\n",
                        mmc_hostname(host->mmc));
-               sdhci_dumpregs(host);
+               writel(SDHCI_INT_BUS_POWER, host->ioaddr + SDHCI_INT_STATUS);
        }
 
-       if (intmask & SDHCI_INT_ACMD12ERR) {
-               printk(KERN_ERR "%s: Unexpected auto CMD12 error. Please "
+       intmask &= SDHCI_INT_BUS_POWER;
+
+       if (intmask) {
+               printk(KERN_ERR "%s: Unexpected interrupt 0x%08x. Please "
                        "report this to " BUGMAIL ".\n",
-                       mmc_hostname(host->mmc));
+                       mmc_hostname(host->mmc), intmask);
                sdhci_dumpregs(host);
 
-               writew(~0, host->ioaddr + SDHCI_ACMD12_ERR);
-       }
-
-       if (intmask)
                writel(intmask, host->ioaddr + SDHCI_INT_STATUS);
+       }
 
        result = IRQ_HANDLED;
 
@@ -954,6 +1118,7 @@ static int sdhci_resume (struct pci_dev *pdev)
 static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
 {
        int ret;
+       unsigned int version;
        struct sdhci_chip *chip;
        struct mmc_host *mmc;
        struct sdhci_host *host;
@@ -985,6 +1150,16 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
                return -ENODEV;
        }
 
+       if ((pdev->class & 0x0000FF) == PCI_SDHCI_IFVENDOR) {
+               printk(KERN_ERR DRIVER_NAME ": Vendor specific interface. Aborting.\n");
+               return -ENODEV;
+       }
+
+       if ((pdev->class & 0x0000FF) > PCI_SDHCI_IFVENDOR) {
+               printk(KERN_ERR DRIVER_NAME ": Unknown interface. Aborting.\n");
+               return -ENODEV;
+       }
+
        mmc = mmc_alloc_host(sizeof(struct sdhci_host), &pdev->dev);
        if (!mmc)
                return -ENOMEM;
@@ -1012,9 +1187,32 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
                goto release;
        }
 
+       sdhci_reset(host, SDHCI_RESET_ALL);
+
+       version = readw(host->ioaddr + SDHCI_HOST_VERSION);
+       version = (version & SDHCI_SPEC_VER_MASK) >> SDHCI_SPEC_VER_SHIFT;
+       if (version != 0) {
+               printk(KERN_ERR "%s: Unknown controller version (%d). "
+                       "Cowardly refusing to continue.\n", host->slot_descr,
+                       version);
+               ret = -ENODEV;
+               goto unmap;
+       }
+
        caps = readl(host->ioaddr + SDHCI_CAPABILITIES);
 
-       if ((caps & SDHCI_CAN_DO_DMA) && ((pdev->class & 0x0000FF) == 0x01))
+       if (debug_nodma)
+               DBG("DMA forced off\n");
+       else if (debug_forcedma) {
+               DBG("DMA forced on\n");
+               host->flags |= SDHCI_USE_DMA;
+       } else if (chip->quirks & SDHCI_QUIRK_FORCE_DMA)
+               host->flags |= SDHCI_USE_DMA;
+       else if ((pdev->class & 0x0000FF) != PCI_SDHCI_IFDMA)
+               DBG("Controller doesn't have DMA interface\n");
+       else if (!(caps & SDHCI_CAN_DO_DMA))
+               DBG("Controller doesn't have DMA capability\n");
+       else
                host->flags |= SDHCI_USE_DMA;
 
        if (host->flags & SDHCI_USE_DMA) {
@@ -1030,18 +1228,59 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
        else /* XXX: Hack to get MMC layer to avoid highmem */
                pdev->dma_mask = 0;
 
-       host->max_clk = (caps & SDHCI_CLOCK_BASE_MASK) >> SDHCI_CLOCK_BASE_SHIFT;
+       host->max_clk =
+               (caps & SDHCI_CLOCK_BASE_MASK) >> SDHCI_CLOCK_BASE_SHIFT;
+       if (host->max_clk == 0) {
+               printk(KERN_ERR "%s: Hardware doesn't specify base clock "
+                       "frequency.\n", host->slot_descr);
+               ret = -ENODEV;
+               goto unmap;
+       }
        host->max_clk *= 1000000;
 
+       host->timeout_clk =
+               (caps & SDHCI_TIMEOUT_CLK_MASK) >> SDHCI_TIMEOUT_CLK_SHIFT;
+       if (host->timeout_clk == 0) {
+               printk(KERN_ERR "%s: Hardware doesn't specify timeout clock "
+                       "frequency.\n", host->slot_descr);
+               ret = -ENODEV;
+               goto unmap;
+       }
+       if (caps & SDHCI_TIMEOUT_CLK_UNIT)
+               host->timeout_clk *= 1000;
+
+       host->max_block = (caps & SDHCI_MAX_BLOCK_MASK) >> SDHCI_MAX_BLOCK_SHIFT;
+       if (host->max_block >= 3) {
+               printk(KERN_ERR "%s: Invalid maximum block size.\n",
+                       host->slot_descr);
+               ret = -ENODEV;
+               goto unmap;
+       }
+       host->max_block = 512 << host->max_block;
+
        /*
         * Set host parameters.
         */
        mmc->ops = &sdhci_ops;
        mmc->f_min = host->max_clk / 256;
        mmc->f_max = host->max_clk;
-       mmc->ocr_avail = MMC_VDD_32_33|MMC_VDD_33_34;
        mmc->caps = MMC_CAP_4_BIT_DATA;
 
+       mmc->ocr_avail = 0;
+       if (caps & SDHCI_CAN_VDD_330)
+               mmc->ocr_avail |= MMC_VDD_32_33|MMC_VDD_33_34;
+       else if (caps & SDHCI_CAN_VDD_300)
+               mmc->ocr_avail |= MMC_VDD_29_30|MMC_VDD_30_31;
+       else if (caps & SDHCI_CAN_VDD_180)
+               mmc->ocr_avail |= MMC_VDD_17_18|MMC_VDD_18_19;
+
+       if (mmc->ocr_avail == 0) {
+               printk(KERN_ERR "%s: Hardware doesn't report any "
+                       "support voltages.\n", host->slot_descr);
+               ret = -ENODEV;
+               goto unmap;
+       }
+
        spin_lock_init(&host->lock);
 
        /*
@@ -1054,10 +1293,10 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
        mmc->max_phys_segs = 16;
 
        /*
-        * Maximum number of sectors in one transfer. Limited by sector
-        * count register.
+        * Maximum number of sectors in one transfer. Limited by DMA boundary
+        * size (512KiB), which means (512 KiB/512=) 1024 entries.
         */
-       mmc->max_sectors = 0x3FFF;
+       mmc->max_sectors = 1024;
 
        /*
         * Maximum segment size. Could be one segment with the maximum number
@@ -1075,10 +1314,10 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
 
        setup_timer(&host->timer, sdhci_timeout_timer, (long)host);
 
-       ret = request_irq(host->irq, sdhci_irq, SA_SHIRQ,
+       ret = request_irq(host->irq, sdhci_irq, IRQF_SHARED,
                host->slot_descr, host);
        if (ret)
-               goto unmap;
+               goto untasklet;
 
        sdhci_init(host);
 
@@ -1097,10 +1336,10 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
 
        return 0;
 
-unmap:
+untasklet:
        tasklet_kill(&host->card_tasklet);
        tasklet_kill(&host->finish_tasklet);
-
+unmap:
        iounmap(host->ioaddr);
 release:
        pci_release_region(pdev, host->bar);
@@ -1144,13 +1383,18 @@ static int __devinit sdhci_probe(struct pci_dev *pdev,
        const struct pci_device_id *ent)
 {
        int ret, i;
-       u8 slots;
+       u8 slots, rev;
        struct sdhci_chip *chip;
 
        BUG_ON(pdev == NULL);
        BUG_ON(ent == NULL);
 
-       DBG("found at %s\n", pci_name(pdev));
+       pci_read_config_byte(pdev, PCI_CLASS_REVISION, &rev);
+
+       printk(KERN_INFO DRIVER_NAME
+               ": SDHCI controller found at %s [%04x:%04x] (rev %x)\n",
+               pci_name(pdev), (int)pdev->vendor, (int)pdev->device,
+               (int)rev);
 
        ret = pci_read_config_byte(pdev, PCI_SLOT_INFO, &slots);
        if (ret)
@@ -1173,6 +1417,10 @@ static int __devinit sdhci_probe(struct pci_dev *pdev,
        }
 
        chip->pdev = pdev;
+       chip->quirks = ent->driver_data;
+
+       if (debug_quirks)
+               chip->quirks = debug_quirks;
 
        chip->num_slots = slots;
        pci_set_drvdata(pdev, chip);
@@ -1251,7 +1499,15 @@ static void __exit sdhci_drv_exit(void)
 module_init(sdhci_drv_init);
 module_exit(sdhci_drv_exit);
 
+module_param(debug_nodma, uint, 0444);
+module_param(debug_forcedma, uint, 0444);
+module_param(debug_quirks, uint, 0444);
+
 MODULE_AUTHOR("Pierre Ossman <drzeus@drzeus.cx>");
 MODULE_DESCRIPTION("Secure Digital Host Controller Interface driver");
 MODULE_VERSION(DRIVER_VERSION);
 MODULE_LICENSE("GPL");
+
+MODULE_PARM_DESC(debug_nodma, "Forcefully disable DMA transfers. (default 0)");
+MODULE_PARM_DESC(debug_forcedma, "Forcefully enable DMA transfers. (default 0)");
+MODULE_PARM_DESC(debug_quirks, "Force certain quirks.");
index 3b270ef486b41f5d0a66a5c1457b508921faf1ed..f2453343f783bd3b7dc75ce3e8946c7c277a9eec 100644 (file)
  * PCI registers
  */
 
+#define PCI_SDHCI_IFPIO                        0x00
+#define PCI_SDHCI_IFDMA                        0x01
+#define PCI_SDHCI_IFVENDOR             0x02
+
 #define PCI_SLOT_INFO                  0x40    /* 8 bits */
 #define  PCI_SLOT_INFO_SLOTS(x)                ((x >> 4) & 7)
 #define  PCI_SLOT_INFO_FIRST_BAR_MASK  0x07
@@ -23,6 +27,7 @@
 #define SDHCI_DMA_ADDRESS      0x00
 
 #define SDHCI_BLOCK_SIZE       0x04
+#define  SDHCI_MAKE_BLKSZ(dma, blksz) (((dma & 0x7) << 12) | (blksz & 0xFFF))
 
 #define SDHCI_BLOCK_COUNT      0x06
 
 #define  SDHCI_CTRL_4BITBUS    0x02
 
 #define SDHCI_POWER_CONTROL    0x29
+#define  SDHCI_POWER_ON                0x01
+#define  SDHCI_POWER_180       0x0A
+#define  SDHCI_POWER_300       0x0C
+#define  SDHCI_POWER_330       0x0E
 
 #define SDHCI_BLOCK_GAP_CONTROL        0x2A
 
 #define  SDHCI_INT_RESPONSE    0x00000001
 #define  SDHCI_INT_DATA_END    0x00000002
 #define  SDHCI_INT_DMA_END     0x00000008
-#define  SDHCI_INT_BUF_EMPTY   0x00000010
-#define  SDHCI_INT_BUF_FULL    0x00000020
+#define  SDHCI_INT_SPACE_AVAIL 0x00000010
+#define  SDHCI_INT_DATA_AVAIL  0x00000020
 #define  SDHCI_INT_CARD_INSERT 0x00000040
 #define  SDHCI_INT_CARD_REMOVE 0x00000080
 #define  SDHCI_INT_CARD_INT    0x00000100
 #define  SDHCI_INT_CMD_MASK    (SDHCI_INT_RESPONSE | SDHCI_INT_TIMEOUT | \
                SDHCI_INT_CRC | SDHCI_INT_END_BIT | SDHCI_INT_INDEX)
 #define  SDHCI_INT_DATA_MASK   (SDHCI_INT_DATA_END | SDHCI_INT_DMA_END | \
-               SDHCI_INT_BUF_EMPTY | SDHCI_INT_BUF_FULL | \
+               SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL | \
                SDHCI_INT_DATA_TIMEOUT | SDHCI_INT_DATA_CRC | \
                SDHCI_INT_DATA_END_BIT)
 
 /* 3E-3F reserved */
 
 #define SDHCI_CAPABILITIES     0x40
-#define  SDHCI_CAN_DO_DMA      0x00400000
+#define  SDHCI_TIMEOUT_CLK_MASK        0x0000003F
+#define  SDHCI_TIMEOUT_CLK_SHIFT 0
+#define  SDHCI_TIMEOUT_CLK_UNIT        0x00000080
 #define  SDHCI_CLOCK_BASE_MASK 0x00003F00
 #define  SDHCI_CLOCK_BASE_SHIFT        8
+#define  SDHCI_MAX_BLOCK_MASK  0x00030000
+#define  SDHCI_MAX_BLOCK_SHIFT  16
+#define  SDHCI_CAN_DO_DMA      0x00400000
+#define  SDHCI_CAN_VDD_330     0x01000000
+#define  SDHCI_CAN_VDD_300     0x02000000
+#define  SDHCI_CAN_VDD_180     0x04000000
 
 /* 44-47 reserved for more caps */
 
 #define SDHCI_SLOT_INT_STATUS  0xFC
 
 #define SDHCI_HOST_VERSION     0xFE
+#define  SDHCI_VENDOR_VER_MASK 0xFF00
+#define  SDHCI_VENDOR_VER_SHIFT        8
+#define  SDHCI_SPEC_VER_MASK   0x00FF
+#define  SDHCI_SPEC_VER_SHIFT  0
 
 struct sdhci_chip;
 
@@ -149,8 +170,11 @@ struct sdhci_host {
 #define SDHCI_USE_DMA          (1<<0)
 
        unsigned int            max_clk;        /* Max possible freq (MHz) */
+       unsigned int            timeout_clk;    /* Timeout freq (KHz) */
+       unsigned int            max_block;      /* Max block size (bytes) */
 
        unsigned int            clock;          /* Current clock (MHz) */
+       unsigned short          power;          /* Current voltage */
 
        struct mmc_request      *mrq;           /* Current request */
        struct mmc_command      *cmd;           /* Current command */
@@ -180,6 +204,8 @@ struct sdhci_host {
 struct sdhci_chip {
        struct pci_dev          *pdev;
 
+       unsigned long           quirks;
+
        int                     num_slots;      /* Slots on controller */
        struct sdhci_host       *hosts[0];      /* Pointers to hosts */
 };
index 8167332d4013d3e7701f108d2aea0dcd241ea700..8a30ef3ae4191d52320516ae72b93c75f47a6aac 100644 (file)
@@ -21,7 +21,6 @@
  * - On APIC systems the FIFO empty interrupt is sometimes lost.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/init.h>
@@ -1554,7 +1553,7 @@ static int __devinit wbsd_request_irq(struct wbsd_host *host, int irq)
         * Allocate interrupt.
         */
 
-       ret = request_irq(irq, wbsd_irq, SA_SHIRQ, DRIVER_NAME, host);
+       ret = request_irq(irq, wbsd_irq, IRQF_SHARED, DRIVER_NAME, host);
        if (ret)
                return ret;
 
index 1e01ad38b26e91d0f17c60e74d6987c6833afba1..9885726a16e466d22e38bf58195f216dd3f7e2a6 100644 (file)
@@ -21,7 +21,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 4bf9f8cac0dd96746a6c1a9cca9afa4d8161449d..60e11a0ada97b4d6ae9b1792eec64a45e6865da8 100644 (file)
@@ -4,7 +4,6 @@
    $Id: cfi_probe.c,v 1.86 2005/11/29 14:48:31 gleixner Exp $
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index c2127840a183007b57976d9a611ab96789656c36..2174c97549f0e868290799970d71697560bdf4bb 100644 (file)
@@ -6,7 +6,6 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kmod.h>
 #include <linux/spinlock.h>
index 517ea33e7260feea4f25a79e536b7924bc3a5900..8f39d0a3143839be7fe136da7588657b009cc36e 100644 (file)
@@ -8,7 +8,6 @@
    Occasionally maintained by Thayne Harbaugh tharbaugh at lnxi dot com
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/types.h>
index be3f1c136d0211340a5b890b0f5648dd07c10777..ede3561be87090e4c21caecdf83b1111bfea14b3 100644 (file)
@@ -8,7 +8,6 @@
  *
  * Licence: GPL
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/blkdev.h>
index c54e40464d8283eb3a0de099e0ef27a481faeed2..603a7951ac9b1e3e9b646811a840c4e8139745b8 100644 (file)
@@ -55,10 +55,6 @@ static int doc_read(struct mtd_info *mtd, loff_t from, size_t len,
                    size_t *retlen, u_char *buf);
 static int doc_write(struct mtd_info *mtd, loff_t to, size_t len,
                     size_t *retlen, const u_char *buf);
-static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len,
-                       size_t *retlen, u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel);
-static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
-                        size_t *retlen, const u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel);
 static int doc_read_oob(struct mtd_info *mtd, loff_t ofs,
                        struct mtd_oob_ops *ops);
 static int doc_write_oob(struct mtd_info *mtd, loff_t ofs,
@@ -614,18 +610,11 @@ EXPORT_SYMBOL_GPL(DoC2k_init);
 
 static int doc_read(struct mtd_info *mtd, loff_t from, size_t len,
                    size_t * retlen, u_char * buf)
-{
-       /* Just a special case of doc_read_ecc */
-       return doc_read_ecc(mtd, from, len, retlen, buf, NULL, NULL);
-}
-
-static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len,
-                       size_t * retlen, u_char * buf, u_char * eccbuf, struct nand_oobinfo *oobsel)
 {
        struct DiskOnChip *this = mtd->priv;
        void __iomem *docptr = this->virtadr;
        struct Nand *mychip;
-       unsigned char syndrome[6];
+       unsigned char syndrome[6], eccbuf[6];
        volatile char dummy;
        int i, len256 = 0, ret=0;
        size_t left = len;
@@ -673,15 +662,9 @@ static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len,
                DoC_Address(this, ADDR_COLUMN_PAGE, from, CDSN_CTRL_WP,
                            CDSN_CTRL_ECC_IO);
 
-               if (eccbuf) {
-                       /* Prime the ECC engine */
-                       WriteDOC(DOC_ECC_RESET, docptr, ECCConf);
-                       WriteDOC(DOC_ECC_EN, docptr, ECCConf);
-               } else {
-                       /* disable the ECC engine */
-                       WriteDOC(DOC_ECC_RESET, docptr, ECCConf);
-                       WriteDOC(DOC_ECC_DIS, docptr, ECCConf);
-               }
+               /* Prime the ECC engine */
+               WriteDOC(DOC_ECC_RESET, docptr, ECCConf);
+               WriteDOC(DOC_ECC_EN, docptr, ECCConf);
 
                /* treat crossing 256-byte sector for 2M x 8bits devices */
                if (this->page256 && from + len > (from | 0xff) + 1) {
@@ -698,58 +681,59 @@ static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len,
                /* Let the caller know we completed it */
                *retlen += len;
 
-               if (eccbuf) {
-                       /* Read the ECC data through the DiskOnChip ECC logic */
-                       /* Note: this will work even with 2M x 8bit devices as   */
-                       /*       they have 8 bytes of OOB per 256 page. mf.      */
-                       DoC_ReadBuf(this, eccbuf, 6);
-
-                       /* Flush the pipeline */
-                       if (DoC_is_Millennium(this)) {
-                               dummy = ReadDOC(docptr, ECCConf);
-                               dummy = ReadDOC(docptr, ECCConf);
-                               i = ReadDOC(docptr, ECCConf);
-                       } else {
-                               dummy = ReadDOC(docptr, 2k_ECCStatus);
-                               dummy = ReadDOC(docptr, 2k_ECCStatus);
-                               i = ReadDOC(docptr, 2k_ECCStatus);
-                       }
+               /* Read the ECC data through the DiskOnChip ECC logic */
+               /* Note: this will work even with 2M x 8bit devices as   */
+               /*       they have 8 bytes of OOB per 256 page. mf.      */
+               DoC_ReadBuf(this, eccbuf, 6);
 
-                       /* Check the ECC Status */
-                       if (i & 0x80) {
-                               int nb_errors;
-                               /* There was an ECC error */
+               /* Flush the pipeline */
+               if (DoC_is_Millennium(this)) {
+                       dummy = ReadDOC(docptr, ECCConf);
+                       dummy = ReadDOC(docptr, ECCConf);
+                       i = ReadDOC(docptr, ECCConf);
+               } else {
+                       dummy = ReadDOC(docptr, 2k_ECCStatus);
+                       dummy = ReadDOC(docptr, 2k_ECCStatus);
+                       i = ReadDOC(docptr, 2k_ECCStatus);
+               }
+
+               /* Check the ECC Status */
+               if (i & 0x80) {
+                       int nb_errors;
+                       /* There was an ECC error */
 #ifdef ECC_DEBUG
-                               printk(KERN_ERR "DiskOnChip ECC Error: Read at %lx\n", (long)from);
+                       printk(KERN_ERR "DiskOnChip ECC Error: Read at %lx\n", (long)from);
 #endif
-                               /* Read the ECC syndrom through the DiskOnChip ECC logic.
-                                  These syndrome will be all ZERO when there is no error */
-                               for (i = 0; i < 6; i++) {
-                                       syndrome[i] =
-                                           ReadDOC(docptr, ECCSyndrome0 + i);
-                               }
-                               nb_errors = doc_decode_ecc(buf, syndrome);
+                       /* Read the ECC syndrom through the DiskOnChip ECC
+                          logic.  These syndrome will be all ZERO when there
+                          is no error */
+                       for (i = 0; i < 6; i++) {
+                               syndrome[i] =
+                                       ReadDOC(docptr, ECCSyndrome0 + i);
+                       }
+                       nb_errors = doc_decode_ecc(buf, syndrome);
 
 #ifdef ECC_DEBUG
-                               printk(KERN_ERR "Errors corrected: %x\n", nb_errors);
+                       printk(KERN_ERR "Errors corrected: %x\n", nb_errors);
 #endif
-                               if (nb_errors < 0) {
-                                       /* We return error, but have actually done the read. Not that
-                                          this can be told to user-space, via sys_read(), but at least
-                                          MTD-aware stuff can know about it by checking *retlen */
-                                       ret = -EIO;
-                               }
+                       if (nb_errors < 0) {
+                               /* We return error, but have actually done the
+                                  read. Not that this can be told to
+                                  user-space, via sys_read(), but at least
+                                  MTD-aware stuff can know about it by
+                                  checking *retlen */
+                               ret = -EIO;
                        }
+               }
 
 #ifdef PSYCHO_DEBUG
-                       printk(KERN_DEBUG "ECC DATA at %lxB: %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n",
-                                    (long)from, eccbuf[0], eccbuf[1], eccbuf[2],
-                                    eccbuf[3], eccbuf[4], eccbuf[5]);
+               printk(KERN_DEBUG "ECC DATA at %lxB: %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n",
+                      (long)from, eccbuf[0], eccbuf[1], eccbuf[2],
+                      eccbuf[3], eccbuf[4], eccbuf[5]);
 #endif
 
-                       /* disable the ECC engine */
-                       WriteDOC(DOC_ECC_DIS, docptr , ECCConf);
-               }
+               /* disable the ECC engine */
+               WriteDOC(DOC_ECC_DIS, docptr , ECCConf);
 
                /* according to 11.4.1, we need to wait for the busy line
                 * drop if we read to the end of the page.  */
@@ -770,18 +754,11 @@ static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len,
 
 static int doc_write(struct mtd_info *mtd, loff_t to, size_t len,
                     size_t * retlen, const u_char * buf)
-{
-       char eccbuf[6];
-       return doc_write_ecc(mtd, to, len, retlen, buf, eccbuf, NULL);
-}
-
-static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
-                        size_t * retlen, const u_char * buf,
-                        u_char * eccbuf, struct nand_oobinfo *oobsel)
 {
        struct DiskOnChip *this = mtd->priv;
        int di; /* Yes, DI is a hangover from when I was disassembling the binary driver */
        void __iomem *docptr = this->virtadr;
+       unsigned char eccbuf[6];
        volatile char dummy;
        int len256 = 0;
        struct Nand *mychip;
@@ -835,15 +812,9 @@ static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
                DoC_Command(this, NAND_CMD_SEQIN, 0);
                DoC_Address(this, ADDR_COLUMN_PAGE, to, 0, CDSN_CTRL_ECC_IO);
 
-               if (eccbuf) {
-                       /* Prime the ECC engine */
-                       WriteDOC(DOC_ECC_RESET, docptr, ECCConf);
-                       WriteDOC(DOC_ECC_EN | DOC_ECC_RW, docptr, ECCConf);
-               } else {
-                       /* disable the ECC engine */
-                       WriteDOC(DOC_ECC_RESET, docptr, ECCConf);
-                       WriteDOC(DOC_ECC_DIS, docptr, ECCConf);
-               }
+               /* Prime the ECC engine */
+               WriteDOC(DOC_ECC_RESET, docptr, ECCConf);
+               WriteDOC(DOC_ECC_EN | DOC_ECC_RW, docptr, ECCConf);
 
                /* treat crossing 256-byte sector for 2M x 8bits devices */
                if (this->page256 && to + len > (to | 0xff) + 1) {
@@ -873,39 +844,35 @@ static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
 
                DoC_WriteBuf(this, &buf[len256], len - len256);
 
-               if (eccbuf) {
-                       WriteDOC(CDSN_CTRL_ECC_IO | CDSN_CTRL_CE, docptr,
-                                CDSNControl);
-
-                       if (DoC_is_Millennium(this)) {
-                               WriteDOC(0, docptr, NOP);
-                               WriteDOC(0, docptr, NOP);
-                               WriteDOC(0, docptr, NOP);
-                       } else {
-                               WriteDOC_(0, docptr, this->ioreg);
-                               WriteDOC_(0, docptr, this->ioreg);
-                               WriteDOC_(0, docptr, this->ioreg);
-                       }
+               WriteDOC(CDSN_CTRL_ECC_IO | CDSN_CTRL_CE, docptr, CDSNControl);
 
-                       WriteDOC(CDSN_CTRL_ECC_IO | CDSN_CTRL_FLASH_IO | CDSN_CTRL_CE, docptr,
-                                CDSNControl);
+               if (DoC_is_Millennium(this)) {
+                       WriteDOC(0, docptr, NOP);
+                       WriteDOC(0, docptr, NOP);
+                       WriteDOC(0, docptr, NOP);
+               } else {
+                       WriteDOC_(0, docptr, this->ioreg);
+                       WriteDOC_(0, docptr, this->ioreg);
+                       WriteDOC_(0, docptr, this->ioreg);
+               }
 
-                       /* Read the ECC data through the DiskOnChip ECC logic */
-                       for (di = 0; di < 6; di++) {
-                               eccbuf[di] = ReadDOC(docptr, ECCSyndrome0 + di);
-                       }
+               WriteDOC(CDSN_CTRL_ECC_IO | CDSN_CTRL_FLASH_IO | CDSN_CTRL_CE, docptr,
+                        CDSNControl);
 
-                       /* Reset the ECC engine */
-                       WriteDOC(DOC_ECC_DIS, docptr, ECCConf);
+               /* Read the ECC data through the DiskOnChip ECC logic */
+               for (di = 0; di < 6; di++) {
+                       eccbuf[di] = ReadDOC(docptr, ECCSyndrome0 + di);
+               }
+
+               /* Reset the ECC engine */
+               WriteDOC(DOC_ECC_DIS, docptr, ECCConf);
 
 #ifdef PSYCHO_DEBUG
-                       printk
-                           ("OOB data at %lx is %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n",
-                            (long) to, eccbuf[0], eccbuf[1], eccbuf[2], eccbuf[3],
-                            eccbuf[4], eccbuf[5]);
+               printk
+                       ("OOB data at %lx is %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n",
+                        (long) to, eccbuf[0], eccbuf[1], eccbuf[2], eccbuf[3],
+                        eccbuf[4], eccbuf[5]);
 #endif
-               }
-
                DoC_Command(this, NAND_CMD_PAGEPROG, 0);
 
                DoC_Command(this, NAND_CMD_STATUS, CDSN_CTRL_WP);
index 0cf022a69e653433e9a5f941fd739fd4a712a13e..0e2a9326f717da9f18213b2032195e0529b7c132 100644 (file)
@@ -37,12 +37,6 @@ static int doc_read(struct mtd_info *mtd, loff_t from, size_t len,
                    size_t *retlen, u_char *buf);
 static int doc_write(struct mtd_info *mtd, loff_t to, size_t len,
                     size_t *retlen, const u_char *buf);
-static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len,
-                       size_t *retlen, u_char *buf, u_char *eccbuf,
-                       struct nand_oobinfo *oobsel);
-static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
-                        size_t *retlen, const u_char *buf, u_char *eccbuf,
-                        struct nand_oobinfo *oobsel);
 static int doc_read_oob(struct mtd_info *mtd, loff_t ofs,
                        struct mtd_oob_ops *ops);
 static int doc_write_oob(struct mtd_info *mtd, loff_t ofs,
@@ -396,18 +390,10 @@ EXPORT_SYMBOL_GPL(DoCMil_init);
 
 static int doc_read (struct mtd_info *mtd, loff_t from, size_t len,
                     size_t *retlen, u_char *buf)
-{
-       /* Just a special case of doc_read_ecc */
-       return doc_read_ecc(mtd, from, len, retlen, buf, NULL, NULL);
-}
-
-static int doc_read_ecc (struct mtd_info *mtd, loff_t from, size_t len,
-                        size_t *retlen, u_char *buf, u_char *eccbuf,
-                        struct nand_oobinfo *oobsel)
 {
        int i, ret;
        volatile char dummy;
-       unsigned char syndrome[6];
+       unsigned char syndrome[6], eccbuf[6];
        struct DiskOnChip *this = mtd->priv;
        void __iomem *docptr = this->virtadr;
        struct Nand *mychip = &this->chips[from >> (this->chipshift)];
@@ -437,15 +423,9 @@ static int doc_read_ecc (struct mtd_info *mtd, loff_t from, size_t len,
        DoC_Address(docptr, 3, from, CDSN_CTRL_WP, 0x00);
        DoC_WaitReady(docptr);
 
-       if (eccbuf) {
-               /* init the ECC engine, see Reed-Solomon EDC/ECC 11.1 .*/
-               WriteDOC (DOC_ECC_RESET, docptr, ECCConf);
-               WriteDOC (DOC_ECC_EN, docptr, ECCConf);
-       } else {
-               /* disable the ECC engine */
-               WriteDOC (DOC_ECC_RESET, docptr, ECCConf);
-               WriteDOC (DOC_ECC_DIS, docptr, ECCConf);
-       }
+       /* init the ECC engine, see Reed-Solomon EDC/ECC 11.1 .*/
+       WriteDOC (DOC_ECC_RESET, docptr, ECCConf);
+       WriteDOC (DOC_ECC_EN, docptr, ECCConf);
 
        /* Read the data via the internal pipeline through CDSN IO register,
           see Pipelined Read Operations 11.3 */
@@ -465,74 +445,65 @@ static int doc_read_ecc (struct mtd_info *mtd, loff_t from, size_t len,
        *retlen = len;
         ret = 0;
 
-       if (eccbuf) {
-               /* Read the ECC data from Spare Data Area,
-                  see Reed-Solomon EDC/ECC 11.1 */
-               dummy = ReadDOC(docptr, ReadPipeInit);
+       /* Read the ECC data from Spare Data Area,
+          see Reed-Solomon EDC/ECC 11.1 */
+       dummy = ReadDOC(docptr, ReadPipeInit);
 #ifndef USE_MEMCPY
-               for (i = 0; i < 5; i++) {
-                       /* N.B. you have to increase the source address in this way or the
-                          ECC logic will not work properly */
-                       eccbuf[i] = ReadDOC(docptr, Mil_CDSN_IO + i);
-               }
+       for (i = 0; i < 5; i++) {
+               /* N.B. you have to increase the source address in this way or the
+                  ECC logic will not work properly */
+               eccbuf[i] = ReadDOC(docptr, Mil_CDSN_IO + i);
+       }
 #else
-               memcpy_fromio(eccbuf, docptr + DoC_Mil_CDSN_IO, 5);
+       memcpy_fromio(eccbuf, docptr + DoC_Mil_CDSN_IO, 5);
 #endif
-               eccbuf[5] = ReadDOC(docptr, LastDataRead);
+       eccbuf[5] = ReadDOC(docptr, LastDataRead);
 
-               /* Flush the pipeline */
-               dummy = ReadDOC(docptr, ECCConf);
-               dummy = ReadDOC(docptr, ECCConf);
+       /* Flush the pipeline */
+       dummy = ReadDOC(docptr, ECCConf);
+       dummy = ReadDOC(docptr, ECCConf);
 
-               /* Check the ECC Status */
-               if (ReadDOC(docptr, ECCConf) & 0x80) {
-                        int nb_errors;
-                       /* There was an ECC error */
+       /* Check the ECC Status */
+       if (ReadDOC(docptr, ECCConf) & 0x80) {
+               int nb_errors;
+               /* There was an ECC error */
 #ifdef ECC_DEBUG
-                       printk("DiskOnChip ECC Error: Read at %lx\n", (long)from);
+               printk("DiskOnChip ECC Error: Read at %lx\n", (long)from);
 #endif
-                       /* Read the ECC syndrom through the DiskOnChip ECC logic.
-                          These syndrome will be all ZERO when there is no error */
-                       for (i = 0; i < 6; i++) {
-                               syndrome[i] = ReadDOC(docptr, ECCSyndrome0 + i);
-                       }
-                        nb_errors = doc_decode_ecc(buf, syndrome);
+               /* Read the ECC syndrom through the DiskOnChip ECC logic.
+                  These syndrome will be all ZERO when there is no error */
+               for (i = 0; i < 6; i++) {
+                       syndrome[i] = ReadDOC(docptr, ECCSyndrome0 + i);
+               }
+               nb_errors = doc_decode_ecc(buf, syndrome);
 #ifdef ECC_DEBUG
-                       printk("ECC Errors corrected: %x\n", nb_errors);
+               printk("ECC Errors corrected: %x\n", nb_errors);
 #endif
-                        if (nb_errors < 0) {
-                               /* We return error, but have actually done the read. Not that
-                                  this can be told to user-space, via sys_read(), but at least
-                                  MTD-aware stuff can know about it by checking *retlen */
-                               ret = -EIO;
-                        }
+               if (nb_errors < 0) {
+                       /* We return error, but have actually done the read. Not that
+                          this can be told to user-space, via sys_read(), but at least
+                          MTD-aware stuff can know about it by checking *retlen */
+                       ret = -EIO;
                }
+       }
 
 #ifdef PSYCHO_DEBUG
-               printk("ECC DATA at %lx: %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n",
-                      (long)from, eccbuf[0], eccbuf[1], eccbuf[2], eccbuf[3],
-                      eccbuf[4], eccbuf[5]);
+       printk("ECC DATA at %lx: %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n",
+              (long)from, eccbuf[0], eccbuf[1], eccbuf[2], eccbuf[3],
+              eccbuf[4], eccbuf[5]);
 #endif
 
-               /* disable the ECC engine */
-               WriteDOC(DOC_ECC_DIS, docptr , ECCConf);
-       }
+       /* disable the ECC engine */
+       WriteDOC(DOC_ECC_DIS, docptr , ECCConf);
 
        return ret;
 }
 
 static int doc_write (struct mtd_info *mtd, loff_t to, size_t len,
                      size_t *retlen, const u_char *buf)
-{
-       char eccbuf[6];
-       return doc_write_ecc(mtd, to, len, retlen, buf, eccbuf, NULL);
-}
-
-static int doc_write_ecc (struct mtd_info *mtd, loff_t to, size_t len,
-                         size_t *retlen, const u_char *buf, u_char *eccbuf,
-                        struct nand_oobinfo *oobsel)
 {
        int i,ret = 0;
+       char eccbuf[6];
        volatile char dummy;
        struct DiskOnChip *this = mtd->priv;
        void __iomem *docptr = this->virtadr;
@@ -573,15 +544,9 @@ static int doc_write_ecc (struct mtd_info *mtd, loff_t to, size_t len,
        DoC_Address(docptr, 3, to, 0x00, 0x00);
        DoC_WaitReady(docptr);
 
-       if (eccbuf) {
-               /* init the ECC engine, see Reed-Solomon EDC/ECC 11.1 .*/
-               WriteDOC (DOC_ECC_RESET, docptr, ECCConf);
-               WriteDOC (DOC_ECC_EN | DOC_ECC_RW, docptr, ECCConf);
-       } else {
-               /* disable the ECC engine */
-               WriteDOC (DOC_ECC_RESET, docptr, ECCConf);
-               WriteDOC (DOC_ECC_DIS, docptr, ECCConf);
-       }
+       /* init the ECC engine, see Reed-Solomon EDC/ECC 11.1 .*/
+       WriteDOC (DOC_ECC_RESET, docptr, ECCConf);
+       WriteDOC (DOC_ECC_EN | DOC_ECC_RW, docptr, ECCConf);
 
        /* Write the data via the internal pipeline through CDSN IO register,
           see Pipelined Write Operations 11.2 */
@@ -596,46 +561,44 @@ static int doc_write_ecc (struct mtd_info *mtd, loff_t to, size_t len,
 #endif
        WriteDOC(0x00, docptr, WritePipeTerm);
 
-       if (eccbuf) {
-               /* Write ECC data to flash, the ECC info is generated by the DiskOnChip ECC logic
-                  see Reed-Solomon EDC/ECC 11.1 */
-               WriteDOC(0, docptr, NOP);
-               WriteDOC(0, docptr, NOP);
-               WriteDOC(0, docptr, NOP);
+       /* Write ECC data to flash, the ECC info is generated by the DiskOnChip ECC logic
+          see Reed-Solomon EDC/ECC 11.1 */
+       WriteDOC(0, docptr, NOP);
+       WriteDOC(0, docptr, NOP);
+       WriteDOC(0, docptr, NOP);
 
-               /* Read the ECC data through the DiskOnChip ECC logic */
-               for (i = 0; i < 6; i++) {
-                       eccbuf[i] = ReadDOC(docptr, ECCSyndrome0 + i);
-               }
+       /* Read the ECC data through the DiskOnChip ECC logic */
+       for (i = 0; i < 6; i++) {
+               eccbuf[i] = ReadDOC(docptr, ECCSyndrome0 + i);
+       }
 
-               /* ignore the ECC engine */
-               WriteDOC(DOC_ECC_DIS, docptr , ECCConf);
+       /* ignore the ECC engine */
+       WriteDOC(DOC_ECC_DIS, docptr , ECCConf);
 
 #ifndef USE_MEMCPY
-               /* Write the ECC data to flash */
-               for (i = 0; i < 6; i++) {
-                       /* N.B. you have to increase the source address in this way or the
-                          ECC logic will not work properly */
-                       WriteDOC(eccbuf[i], docptr, Mil_CDSN_IO + i);
-               }
+       /* Write the ECC data to flash */
+       for (i = 0; i < 6; i++) {
+               /* N.B. you have to increase the source address in this way or the
+                  ECC logic will not work properly */
+               WriteDOC(eccbuf[i], docptr, Mil_CDSN_IO + i);
+       }
 #else
-               memcpy_toio(docptr + DoC_Mil_CDSN_IO, eccbuf, 6);
+       memcpy_toio(docptr + DoC_Mil_CDSN_IO, eccbuf, 6);
 #endif
 
-               /* write the block status BLOCK_USED (0x5555) at the end of ECC data
-                  FIXME: this is only a hack for programming the IPL area for LinuxBIOS
-                  and should be replace with proper codes in user space utilities */
-               WriteDOC(0x55, docptr, Mil_CDSN_IO);
-               WriteDOC(0x55, docptr, Mil_CDSN_IO + 1);
+       /* write the block status BLOCK_USED (0x5555) at the end of ECC data
+          FIXME: this is only a hack for programming the IPL area for LinuxBIOS
+          and should be replace with proper codes in user space utilities */
+       WriteDOC(0x55, docptr, Mil_CDSN_IO);
+       WriteDOC(0x55, docptr, Mil_CDSN_IO + 1);
 
-               WriteDOC(0x00, docptr, WritePipeTerm);
+       WriteDOC(0x00, docptr, WritePipeTerm);
 
 #ifdef PSYCHO_DEBUG
-               printk("OOB data at %lx is %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n",
-                      (long) to, eccbuf[0], eccbuf[1], eccbuf[2], eccbuf[3],
-                      eccbuf[4], eccbuf[5]);
+       printk("OOB data at %lx is %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n",
+              (long) to, eccbuf[0], eccbuf[1], eccbuf[2], eccbuf[3],
+              eccbuf[4], eccbuf[5]);
 #endif
-       }
 
        /* Commit the Page Program command and wait for ready
           see Software Requirement 11.4 item 1.*/
index 66cb1e50469a1df22f0c409f90a2786ebe3e929c..92dbb47f2ac35597e5e4d18cc39bd079eb6dc0ed 100644 (file)
@@ -41,12 +41,6 @@ static int doc_read(struct mtd_info *mtd, loff_t from, size_t len,
                size_t *retlen, u_char *buf);
 static int doc_write(struct mtd_info *mtd, loff_t to, size_t len,
                size_t *retlen, const u_char *buf);
-static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len,
-               size_t *retlen, u_char *buf, u_char *eccbuf,
-               struct nand_oobinfo *oobsel);
-static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
-               size_t *retlen, const u_char *buf, u_char *eccbuf,
-               struct nand_oobinfo *oobsel);
 static int doc_read_oob(struct mtd_info *mtd, loff_t ofs,
                        struct mtd_oob_ops *ops);
 static int doc_write_oob(struct mtd_info *mtd, loff_t ofs,
@@ -594,19 +588,11 @@ static int doc_dumpblk(struct mtd_info *mtd, loff_t from)
 
 static int doc_read(struct mtd_info *mtd, loff_t from, size_t len,
                    size_t *retlen, u_char *buf)
-{
-       /* Just a special case of doc_read_ecc */
-       return doc_read_ecc(mtd, from, len, retlen, buf, NULL, NULL);
-}
-
-static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len,
-                       size_t *retlen, u_char *buf, u_char *eccbuf,
-                       struct nand_oobinfo *oobsel)
 {
        int ret, i;
        volatile char dummy;
        loff_t fofs;
-       unsigned char syndrome[6];
+       unsigned char syndrome[6], eccbuf[6];
        struct DiskOnChip *this = mtd->priv;
        void __iomem * docptr = this->virtadr;
        struct Nand *mychip = &this->chips[from >> (this->chipshift)];
@@ -644,56 +630,51 @@ static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len,
        WriteDOC(0, docptr, Mplus_FlashControl);
        DoC_WaitReady(docptr);
 
-       if (eccbuf) {
-               /* init the ECC engine, see Reed-Solomon EDC/ECC 11.1 .*/
-               WriteDOC(DOC_ECC_RESET, docptr, Mplus_ECCConf);
-               WriteDOC(DOC_ECC_EN, docptr, Mplus_ECCConf);
-       } else {
-               /* disable the ECC engine */
-               WriteDOC(DOC_ECC_RESET, docptr, Mplus_ECCConf);
-       }
+       /* init the ECC engine, see Reed-Solomon EDC/ECC 11.1 .*/
+       WriteDOC(DOC_ECC_RESET, docptr, Mplus_ECCConf);
+       WriteDOC(DOC_ECC_EN, docptr, Mplus_ECCConf);
 
        /* Let the caller know we completed it */
        *retlen = len;
-        ret = 0;
+       ret = 0;
 
        ReadDOC(docptr, Mplus_ReadPipeInit);
        ReadDOC(docptr, Mplus_ReadPipeInit);
 
-       if (eccbuf) {
-               /* Read the data via the internal pipeline through CDSN IO
-                  register, see Pipelined Read Operations 11.3 */
-               MemReadDOC(docptr, buf, len);
+       /* Read the data via the internal pipeline through CDSN IO
+          register, see Pipelined Read Operations 11.3 */
+       MemReadDOC(docptr, buf, len);
 
-               /* Read the ECC data following raw data */
-               MemReadDOC(docptr, eccbuf, 4);
-               eccbuf[4] = ReadDOC(docptr, Mplus_LastDataRead);
-               eccbuf[5] = ReadDOC(docptr, Mplus_LastDataRead);
+       /* Read the ECC data following raw data */
+       MemReadDOC(docptr, eccbuf, 4);
+       eccbuf[4] = ReadDOC(docptr, Mplus_LastDataRead);
+       eccbuf[5] = ReadDOC(docptr, Mplus_LastDataRead);
 
-               /* Flush the pipeline */
-               dummy = ReadDOC(docptr, Mplus_ECCConf);
-               dummy = ReadDOC(docptr, Mplus_ECCConf);
+       /* Flush the pipeline */
+       dummy = ReadDOC(docptr, Mplus_ECCConf);
+       dummy = ReadDOC(docptr, Mplus_ECCConf);
 
-               /* Check the ECC Status */
-               if (ReadDOC(docptr, Mplus_ECCConf) & 0x80) {
-                        int nb_errors;
-                       /* There was an ECC error */
+       /* Check the ECC Status */
+       if (ReadDOC(docptr, Mplus_ECCConf) & 0x80) {
+               int nb_errors;
+               /* There was an ECC error */
 #ifdef ECC_DEBUG
-                       printk("DiskOnChip ECC Error: Read at %lx\n", (long)from);
+               printk("DiskOnChip ECC Error: Read at %lx\n", (long)from);
 #endif
-                       /* Read the ECC syndrom through the DiskOnChip ECC logic.
-                          These syndrome will be all ZERO when there is no error */
-                       for (i = 0; i < 6; i++)
-                               syndrome[i] = ReadDOC(docptr, Mplus_ECCSyndrome0 + i);
+               /* Read the ECC syndrom through the DiskOnChip ECC logic.
+                  These syndrome will be all ZERO when there is no error */
+               for (i = 0; i < 6; i++)
+                       syndrome[i] = ReadDOC(docptr, Mplus_ECCSyndrome0 + i);
 
-                        nb_errors = doc_decode_ecc(buf, syndrome);
+               nb_errors = doc_decode_ecc(buf, syndrome);
 #ifdef ECC_DEBUG
-                       printk("ECC Errors corrected: %x\n", nb_errors);
+               printk("ECC Errors corrected: %x\n", nb_errors);
 #endif
-                        if (nb_errors < 0) {
-                               /* We return error, but have actually done the read. Not that
-                                  this can be told to user-space, via sys_read(), but at least
-                                  MTD-aware stuff can know about it by checking *retlen */
+               if (nb_errors < 0) {
+                       /* We return error, but have actually done the
+                          read. Not that this can be told to user-space, via
+                          sys_read(), but at least MTD-aware stuff can know
+                          about it by checking *retlen */
 #ifdef ECC_DEBUG
                        printk("%s(%d): Millennium Plus ECC error (from=0x%x:\n",
                                __FILE__, __LINE__, (int)from);
@@ -707,24 +688,16 @@ static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len,
                                eccbuf[3], eccbuf[4], eccbuf[5]);
 #endif
                                ret = -EIO;
-                        }
                }
+       }
 
 #ifdef PSYCHO_DEBUG
-               printk("ECC DATA at %lx: %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n",
-                      (long)from, eccbuf[0], eccbuf[1], eccbuf[2], eccbuf[3],
-                      eccbuf[4], eccbuf[5]);
+       printk("ECC DATA at %lx: %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n",
+              (long)from, eccbuf[0], eccbuf[1], eccbuf[2], eccbuf[3],
+              eccbuf[4], eccbuf[5]);
 #endif
-
-               /* disable the ECC engine */
-               WriteDOC(DOC_ECC_DIS, docptr , Mplus_ECCConf);
-       } else {
-               /* Read the data via the internal pipeline through CDSN IO
-                  register, see Pipelined Read Operations 11.3 */
-               MemReadDOC(docptr, buf, len-2);
-               buf[len-2] = ReadDOC(docptr, Mplus_LastDataRead);
-               buf[len-1] = ReadDOC(docptr, Mplus_LastDataRead);
-       }
+       /* disable the ECC engine */
+       WriteDOC(DOC_ECC_DIS, docptr , Mplus_ECCConf);
 
        /* Disable flash internally */
        WriteDOC(0, docptr, Mplus_FlashSelect);
@@ -734,18 +707,11 @@ static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len,
 
 static int doc_write(struct mtd_info *mtd, loff_t to, size_t len,
                     size_t *retlen, const u_char *buf)
-{
-       char eccbuf[6];
-       return doc_write_ecc(mtd, to, len, retlen, buf, eccbuf, NULL);
-}
-
-static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
-                        size_t *retlen, const u_char *buf, u_char *eccbuf,
-                        struct nand_oobinfo *oobsel)
 {
        int i, before, ret = 0;
        loff_t fto;
        volatile char dummy;
+       char eccbuf[6];
        struct DiskOnChip *this = mtd->priv;
        void __iomem * docptr = this->virtadr;
        struct Nand *mychip = &this->chips[to >> (this->chipshift)];
@@ -795,46 +761,42 @@ static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
        /* Disable the ECC engine */
        WriteDOC(DOC_ECC_RESET, docptr, Mplus_ECCConf);
 
-       if (eccbuf) {
-               if (before) {
-                       /* Write the block status BLOCK_USED (0x5555) */
-                       WriteDOC(0x55, docptr, Mil_CDSN_IO);
-                       WriteDOC(0x55, docptr, Mil_CDSN_IO);
-               }
-
-               /* init the ECC engine, see Reed-Solomon EDC/ECC 11.1 .*/
-               WriteDOC(DOC_ECC_EN | DOC_ECC_RW, docptr, Mplus_ECCConf);
+       if (before) {
+               /* Write the block status BLOCK_USED (0x5555) */
+               WriteDOC(0x55, docptr, Mil_CDSN_IO);
+               WriteDOC(0x55, docptr, Mil_CDSN_IO);
        }
 
+       /* init the ECC engine, see Reed-Solomon EDC/ECC 11.1 .*/
+       WriteDOC(DOC_ECC_EN | DOC_ECC_RW, docptr, Mplus_ECCConf);
+
        MemWriteDOC(docptr, (unsigned char *) buf, len);
 
-       if (eccbuf) {
-               /* Write ECC data to flash, the ECC info is generated by
-                  the DiskOnChip ECC logic see Reed-Solomon EDC/ECC 11.1 */
-               DoC_Delay(docptr, 3);
+       /* Write ECC data to flash, the ECC info is generated by
+          the DiskOnChip ECC logic see Reed-Solomon EDC/ECC 11.1 */
+       DoC_Delay(docptr, 3);
 
-               /* Read the ECC data through the DiskOnChip ECC logic */
-               for (i = 0; i < 6; i++)
-                       eccbuf[i] = ReadDOC(docptr, Mplus_ECCSyndrome0 + i);
+       /* Read the ECC data through the DiskOnChip ECC logic */
+       for (i = 0; i < 6; i++)
+               eccbuf[i] = ReadDOC(docptr, Mplus_ECCSyndrome0 + i);
 
-               /* disable the ECC engine */
-               WriteDOC(DOC_ECC_DIS, docptr, Mplus_ECCConf);
+       /* disable the ECC engine */
+       WriteDOC(DOC_ECC_DIS, docptr, Mplus_ECCConf);
 
-               /* Write the ECC data to flash */
-               MemWriteDOC(docptr, eccbuf, 6);
+       /* Write the ECC data to flash */
+       MemWriteDOC(docptr, eccbuf, 6);
 
-               if (!before) {
-                       /* Write the block status BLOCK_USED (0x5555) */
-                       WriteDOC(0x55, docptr, Mil_CDSN_IO+6);
-                       WriteDOC(0x55, docptr, Mil_CDSN_IO+7);
-               }
+       if (!before) {
+               /* Write the block status BLOCK_USED (0x5555) */
+               WriteDOC(0x55, docptr, Mil_CDSN_IO+6);
+               WriteDOC(0x55, docptr, Mil_CDSN_IO+7);
+       }
 
 #ifdef PSYCHO_DEBUG
-               printk("OOB data at %lx is %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n",
-                      (long) to, eccbuf[0], eccbuf[1], eccbuf[2], eccbuf[3],
-                      eccbuf[4], eccbuf[5]);
+       printk("OOB data at %lx is %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n",
+              (long) to, eccbuf[0], eccbuf[1], eccbuf[2], eccbuf[3],
+              eccbuf[4], eccbuf[5]);
 #endif
-       }
 
        WriteDOC(0x00, docptr, Mplus_WritePipeTerm);
        WriteDOC(0x00, docptr, Mplus_WritePipeTerm);
index 593bb033a3fafac6b40cc5b5369b7299264900ae..78872c3f3760d63f191deed477a7307bb5d4c505 100644 (file)
@@ -40,7 +40,6 @@
 */
 #define DOC_SINGLE_DRIVER
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <asm/errno.h>
index 04271d02b6b6d990c1c32d363bea309792dbde4a..5db71604592789492a5718150d9659d1d0455b77 100644 (file)
@@ -9,7 +9,6 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
 */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
index b4438eacfd80d47c7dfc7e59146f9b806e8ae6e6..e427c82d5f4cb046ff4234e4ce8919062569fda3 100644 (file)
@@ -10,7 +10,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/ioport.h>
index 30f07b473ae2ad55b026c4f2ea23d30520c03957..6f9bbf6fee4d090237be6d418edb5323c1e3583b 100644 (file)
@@ -82,7 +82,6 @@
  *       * Comb the init routine.  It's still a bit cludgy on a few things.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <asm/uaccess.h>
index 1e21a2c3dd29eba442cd621deed1cf8f57788a8a..4116535805f1dbec9f81b75a1e5ace9103706f56 100644 (file)
@@ -24,7 +24,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/delay.h>
index b933a2a27b18c3b795aa3b060488564ad84baff5..7fc8097e41d224bbf690f9b72d7fc109495b68a3 100644 (file)
@@ -7,7 +7,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/types.h>
index a505870052635b6acc253b42c565e41099cc7ec6..447955be18af771b32df85d3678d6b8c9ab596cc 100644 (file)
@@ -14,7 +14,6 @@
 #include <linux/mtd/map.h>
 #include <linux/mtd/cfi.h>
 #include <linux/mtd/flashchip.h>
-#include <linux/config.h>
 #include <linux/pci.h>
 #include <linux/pci_ids.h>
 #include <linux/list.h>
index 5a95ab370a970cf6150d857de460a02bfeba29df..0402c21e291d40c750bd9a047dcf7f13bc811d7e 100644 (file)
@@ -14,7 +14,6 @@
  * $Id: ceiva.c,v 1.11 2004/09/16 23:27:12 gleixner Exp $
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/ioport.h>
index a370953c1513a2a6c1a24a9f551d7300ea52b47b..aa56defb94c805dfd4b93d2b13ac85ee53bf9af0 100644 (file)
@@ -38,7 +38,6 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
 #include <linux/mtd/partitions.h>
-#include <linux/config.h>
 #include <linux/delay.h>
 
 #if defined(CONFIG_MIPS_ITE8172) || defined(CONFIG_MIPS_IVR)
index 85c2a9e22b1e28ee6186da35ae51ae3ac9301278..92a9c7fac99328adbb0208cc69503685b84882cc 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
 #include <linux/mtd/partitions.h>
-#include <linux/config.h>
 #include <linux/errno.h>
 
 /* partition_info gives details on the logical partitions that the split the
index 8b3784e2de891d0f0f8b3b2d6c84b6d3ed3019cf..b32bb9347d713045bf9db02cdc08470e70b3165f 100644 (file)
@@ -7,7 +7,6 @@
  *
  * $Id: dc21285.c,v 1.24 2005/11/07 11:14:26 gleixner Exp $
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index c299d10b33e6ee10de83511acb61ad8c9897626c..b1104fe1f20723a4dfaca7400efc6d0e85bdab0b 100644 (file)
@@ -25,7 +25,6 @@
  * and http://www.ssv-embedded.de/ssv/pc104/p170.htm
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 2bb3c0f0f97048b4ac9485794b97193052c2250f..a43c49905cac812d2d6790ac0ca1666141d7a880 100644 (file)
@@ -16,7 +16,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/types.h>
index 60a6e51d662f33a80760738d57da53a85bdc0e2e..641e1dd8479e4fccc2e55484fba23b9f78acbcd1 100644 (file)
@@ -20,7 +20,6 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
 #include <linux/mtd/partitions.h>
-#include <linux/config.h>
 #include <asm/io.h>
 #include <asm/ibm44x.h>
 #include <platforms/4xx/ebony.h>
index b48a3473ffc16103f65947f471e5d35169118966..1c5b97c8968540703130e7e6817f5c4a32e71d1f 100644 (file)
@@ -17,7 +17,6 @@
 #include <asm/io.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
-#include <linux/config.h>
 
 #ifdef CONFIG_MTD_PARTITIONS
 #include <linux/mtd/partitions.h>
index 0667101ccbe1df53ef15e8baf88655b1bdf0496f..6dde3182d64a6966d1b6247bc52dd5ee25c8c78b 100644 (file)
@@ -8,7 +8,6 @@
  *     2003 Thomas Gleixner <tglx@linutronix.de>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 16732794edf31b8ebb522528f3bb330a97f7ea22..db4b570d874ab1885f0f103dbb9ee3334a97cf0d 100644 (file)
@@ -14,7 +14,6 @@
 #include <linux/mtd/map.h>
 #include <linux/mtd/cfi.h>
 #include <linux/mtd/flashchip.h>
-#include <linux/config.h>
 #include <linux/pci.h>
 #include <linux/pci_ids.h>
 #include <linux/list.h>
index ba7f40311a7e359352156b2d9e51738b6cd7e55c..a0b4dc7155dc66ffc6fd02a5582f860f0381794b 100644 (file)
@@ -17,7 +17,6 @@
 #include <asm/io.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
-#include <linux/config.h>
 
 #ifdef CONFIG_MTD_PARTITIONS
 #include <linux/mtd/partitions.h>
index a3ba52fbd86835968bc01a3c9ffe053641265d25..c8db01b3e45f2d68f4a6612f47d67cd5c9153e6b 100644 (file)
@@ -26,7 +26,6 @@
 
 ======================================================================*/
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index b8ccb0a9578984221c5ad3caad30ee3caa9d03d3..f27c132794c3efa365e6408b7fa40196ec661ecb 100644 (file)
@@ -8,7 +8,6 @@
  * $Id: ipaq-flash.c,v 1.5 2005/11/07 11:14:27 gleixner Exp $
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 851bf957605205c66ed3a7fe0d0777e83b44e4f6..6b784ef5ee702a165c54ecea554b71d96cdc47bb 100644 (file)
@@ -13,7 +13,6 @@
 #include <asm/io.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
-#include <linux/config.h>
 
 #define PIIXE_IOBASE_RESOURCE  11
 
index c658d4045ef287a1a22b93dabe0563a3d31e56bc..1c13d2dc0cdff37968ee826ea1cc3607b71a89ae 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
 #include <linux/mtd/partitions.h>
-#include <linux/config.h>
 #include <asm/lasat/lasat.h>
 
 static struct mtd_info *lasat_mtd;
index 4685e8e134601d0ffa02f5916d8473a102f60d9d..45a00fac88acbcf0f8804afd3e92b6a2ea3b0722 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
 #include <linux/mtd/partitions.h>
-#include <linux/config.h>
 
 static struct mtd_info *flash_mtd;
 static struct mtd_partition *parsed_parts;
index 5c25d4e552c61053cc11daf0d32fcda1144f1cb6..d884f2be28f6574fb45f19a7cd423bee4a81a1de 100644 (file)
@@ -8,7 +8,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/init.h>
index a21fcd195ab40ddd1b2692c889bdc473131f711c..2f07602ba9408f251b4622cc30e6fbef38ed4b51 100644 (file)
@@ -18,7 +18,6 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
 #include <linux/mtd/partitions.h>
-#include <linux/config.h>
 #include <asm/io.h>
 #include <asm/ibm44x.h>
 #include <platforms/4xx/ocotea.h>
index dc37652700570e3c6899fb881f1269fc17e8d270..e6e391efbeb6925c30398e5eb8bc2879337aee9b 100644 (file)
@@ -8,7 +8,6 @@
  * $Id: omap-toto-flash.c,v 1.5 2005/11/07 11:14:27 gleixner Exp $
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index d6301f08906dffd0b769643a55a3281b13f2dcb6..7799a25a7f2ae9c55242b6e83682e19b3981723c 100644 (file)
@@ -18,7 +18,6 @@
 #include <linux/platform_device.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
-#include <linux/config.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/physmap.h>
 #include <asm/io.h>
index 50b14033613f665554af3fc93168cfd126ab3709..ec8fdae1dd99c87fca4e2078a1ca7b1a81a08588 100644 (file)
@@ -13,7 +13,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 5cefb015633ce896e2a08dc75269c93169496573..950bf1c578417f0d2ba3d5b035fd0adb8e5b99ac 100644 (file)
@@ -5,7 +5,6 @@
  *
  * $Id: sa1100-flash.c,v 1.51 2005/11/07 11:14:28 gleixner Exp $
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/ioport.h>
index 350286dc1d2eeaa0d8eedf39f3a095b51f38f231..7d0fcf8f4f338bcbd0667b9ddf064c6e07e644c0 100644 (file)
@@ -18,7 +18,6 @@
  * Both parts are JEDEC compatible.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index e8c130e1efd320aeb784d2f7fa50df9a1f7eff8e..9b50cfc355b113b411040b6d473a518ec5e92ccb 100644 (file)
@@ -25,7 +25,6 @@
  * For details see http://www.amd.com/products/epd/desiging/evalboards/18.elansc520/520_cdp_brief/index.html
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 97a8dfd69258188a29bea7afd3c64c08a594fbbe..dcfb85840d1e4c5d5fd355dc783b7f55aef75464 100644 (file)
@@ -53,7 +53,6 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
 #include <linux/mtd/cfi.h>
-#include <linux/config.h>
 #include <linux/pci.h>
 #include <linux/pci_ids.h>
 
index 331a15859d710df20354f143e5f34a98ae17e22e..7391fd544e86fc7351e46fb4efa209afe31fbb25 100644 (file)
@@ -8,7 +8,6 @@
 */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index c53c2c369c9d5dcc2df5aec29b26c48c3e6157ee..d76ceef453ce66169c6b02754ed19f26aa05db59 100644 (file)
@@ -16,7 +16,6 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
 #include <linux/mtd/partitions.h>
-#include <linux/config.h>
 #include <linux/errno.h>
 
 static struct mtd_info *flash_mtd;
index c7ae9a515c1aa1a1d3161933db1e4cae904a9c07..58e5912bd381463ea971cbb53c9b7d0f0719ace8 100644 (file)
@@ -11,7 +11,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/types.h>
index a43517053e7cfe4819a51f0c1974ffc767ef8251..19578ba84ee8d934e0354fdb0adf80f61beaa8c0 100644 (file)
@@ -22,7 +22,6 @@
  * Thus, we choose CONFIG_MTD_CFI_I2 & CONFIG_MTD_CFI_B4 at
  * kernel configuration.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index a7422c200567d8afd583b201745b13db2c81a102..b47270e850bc78754ed876e2704f9355e0d87fec 100644 (file)
@@ -26,7 +26,6 @@
  * $Id: ts5500_flash.c,v 1.5 2005/11/07 11:14:28 gleixner Exp $
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
index f7264dc2ac9bc0dab0c9c62e904f28e380d0dfdd..389fea28b9a6da2e05de4a0bf6be59a4c0fdfe1f 100644 (file)
@@ -10,7 +10,6 @@
 
 /****************************************************************************/
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/init.h>
index f46bec66150fe4ea89713e24405d33f45e06e26a..ec80eec376bfce79c6d383844a60865e07a2aec3 100644 (file)
@@ -20,7 +20,6 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
 #include <linux/mtd/partitions.h>
-#include <linux/config.h>
 #include <asm/io.h>
 #include <asm/ibm4xx.h>
 #include <platforms/4xx/walnut.h>
index 60c197ec455b87cf40b6ee20303fdb0fe3046610..ac5b8105b6efe69ca210571ffc2b098a7997b762 100644 (file)
@@ -17,7 +17,6 @@
 #include <asm/io.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
-#include <linux/config.h>
 #include <linux/mtd/partitions.h>
 
 #include <asm/immap_cpm2.h>
index e5c78463ebfd5361c38429c171720b0f1cef281b..04ed34694b147f4c691b046680d0d995186d496f 100644 (file)
@@ -7,7 +7,6 @@
  * (C) 1999-2003 David Woodhouse <dwmw2@infradead.org>
  */
 
-#include <linux/config.h>
 #include <linux/fs.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
index 9a4b59d925252a554c4840455b6e00455e6aa7df..fb8b4f7e48d3a14a295f5661b9014908f1110dd4 100644 (file)
@@ -5,7 +5,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/device.h>
 #include <linux/fs.h>
 #include <linux/init.h>
index 16a952dd486a90277580d0eb30493a7bb5fda458..168d3ba063c3637ca48373312271e59f897f4fb4 100644 (file)
@@ -6,7 +6,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index 77a7123a5c56514b75de1e519a22916add1dd228..06a930372b7a5eb174d03872763612ecc0753adb 100644 (file)
@@ -16,7 +16,6 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/list.h>
-#include <linux/config.h>
 #include <linux/kmod.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
index 80a76654d963749a18d2c9a79a5df29f1093159c..62b861304e03e92ebb40860aebd8e07c3fc9f9f1 100644 (file)
@@ -155,7 +155,7 @@ static u16 nand_read_word(struct mtd_info *mtd)
 /**
  * nand_select_chip - [DEFAULT] control CE line
  * @mtd:       MTD device structure
- * @chip:      chipnumber to select, -1 for deselect
+ * @chipnr:    chipnumber to select, -1 for deselect
  *
  * Default select function for 1 chip devices.
  */
@@ -542,7 +542,6 @@ static void nand_command(struct mtd_info *mtd, unsigned int command,
  * Send command to NAND device. This is the version for the new large page
  * devices We dont have the separate regions as we have in the small page
  * devices.  We must emulate NAND_CMD_READOOB to keep the code compatible.
- *
  */
 static void nand_command_lp(struct mtd_info *mtd, unsigned int command,
                            int column, int page_addr)
@@ -656,7 +655,7 @@ static void nand_command_lp(struct mtd_info *mtd, unsigned int command,
 
 /**
  * nand_get_device - [GENERIC] Get chip for selected access
- * @this:      the nand chip descriptor
+ * @chip:      the nand chip descriptor
  * @mtd:       MTD device structure
  * @new_state: the state which is requested
  *
@@ -696,13 +695,12 @@ nand_get_device(struct nand_chip *chip, struct mtd_info *mtd, int new_state)
 /**
  * nand_wait - [DEFAULT]  wait until the command is done
  * @mtd:       MTD device structure
- * @this:      NAND chip structure
+ * @chip:      NAND chip structure
  *
  * Wait for command done. This applies to erase and program only
  * Erase can take up to 400ms and program up to 20ms according to
  * general NAND and SmartMedia specs
- *
-*/
+ */
 static int nand_wait(struct mtd_info *mtd, struct nand_chip *chip)
 {
 
@@ -896,6 +894,7 @@ static int nand_read_page_syndrome(struct mtd_info *mtd, struct nand_chip *chip,
 /**
  * nand_transfer_oob - [Internal] Transfer oob to client buffer
  * @chip:      nand chip structure
+ * @oob:       oob destination address
  * @ops:       oob ops structure
  */
 static uint8_t *nand_transfer_oob(struct nand_chip *chip, uint8_t *oob,
@@ -946,6 +945,7 @@ static uint8_t *nand_transfer_oob(struct nand_chip *chip, uint8_t *oob,
  *
  * @mtd:       MTD device structure
  * @from:      offset to read from
+ * @ops:       oob ops structure
  *
  * Internal function. Called with chip held.
  */
@@ -1760,7 +1760,7 @@ static int nand_do_write_oob(struct mtd_info *mtd, loff_t to,
 /**
  * nand_write_oob - [MTD Interface] NAND write data and/or out-of-band
  * @mtd:       MTD device structure
- * @from:      offset to read from
+ * @to:                offset to write to
  * @ops:       oob operation description structure
  */
 static int nand_write_oob(struct mtd_info *mtd, loff_t to,
@@ -2055,7 +2055,7 @@ static void nand_sync(struct mtd_info *mtd)
 /**
  * nand_block_isbad - [MTD Interface] Check if block at offset is bad
  * @mtd:       MTD device structure
- * @ofs:       offset relative to mtd start
+ * @offs:      offset relative to mtd start
  */
 static int nand_block_isbad(struct mtd_info *mtd, loff_t offs)
 {
index 2a163e4084df0dde8a3ada36357b58b60f11ce50..dd438ca47d9ab46a1978483ffa0c5ce5b239c04a 100644 (file)
@@ -65,8 +65,7 @@ static const u_char nand_ecc_precalc_table[] = {
 };
 
 /**
- * nand_calculate_ecc - [NAND Interface] Calculate 3 byte ECC code
- *                     for 256 byte block
+ * nand_calculate_ecc - [NAND Interface] Calculate 3-byte ECC for 256-byte block
  * @mtd:       MTD block structure
  * @dat:       raw data
  * @ecc_code:  buffer for ECC
index ebd64abc8be809ead329761205798c3a48fb60da..545ff252d81eb675dfa7c5bf349b212461ee8240 100644 (file)
@@ -25,7 +25,6 @@
  * $Id: nandsim.c,v 1.8 2005/03/19 15:33:56 dedekind Exp $
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/types.h>
 #include <linux/module.h>
index 21743658d1505942e59fd5f1ead23b8fa8cab755..fbeedc3184e913c97c954588ba7db54a604d07e6 100644 (file)
@@ -237,11 +237,6 @@ static int __init sharpsl_nand_init(void)
                }
        }
 
-       if (machine_is_husky() || machine_is_borzoi() || machine_is_akita()) {
-               /* Need to use small eraseblock size for backward compatibility */
-               sharpsl_mtd->flags |= MTD_NO_VIRTBLOCKS;
-       }
-
        add_mtd_partitions(sharpsl_mtd, sharpsl_partition_info, nr_partitions);
 
        /* Return happy */
@@ -255,8 +250,6 @@ module_init(sharpsl_nand_init);
  */
 static void __exit sharpsl_nand_cleanup(void)
 {
-       struct nand_chip *this = (struct nand_chip *)&sharpsl_mtd[1];
-
        /* Release resources, unregister device */
        nand_release(sharpsl_mtd);
 
index dc7573501d8c0ded5812f355741c369f72bffdf2..dd5cea8b4a7a2dc31b1429ce6a7ebe07c143ec7b 100644 (file)
@@ -11,7 +11,6 @@
 
 #define PRERELEASE
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <asm/errno.h>
index dc845f36fe49e001ceb5e8580916f7aa89d64b12..cbdae54f715f297d1de8bee584401d0d77d60dc5 100644 (file)
@@ -68,7 +68,6 @@
 /* Maximum events (Rx packets, etc.) to handle at each interrupt. */
 static int max_interrupt_work = 10;
 
-#include <linux/config.h>
 #include <linux/module.h>
 #ifdef CONFIG_MCA
 #include <linux/mca.h>
index 91d1c4c24d9b9616799fa3cc7c171ad51f139e76..4532b17e40ea04a9649baa2b197077a718dc8c04 100644 (file)
@@ -57,7 +57,6 @@ static int max_interrupt_work = 20;
 #define RX_RING_SIZE   16
 #define PKT_BUF_SZ             1536    /* Size of each temporary Rx buffer. */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/isapnp.h>
 #include <linux/kernel.h>
@@ -761,7 +760,7 @@ static int corkscrew_open(struct net_device *dev)
                                   vp->product_name, dev)) return -EAGAIN;
                enable_dma(dev->dma);
                set_dma_mode(dev->dma, DMA_MODE_CASCADE);
-       } else if (request_irq(dev->irq, &corkscrew_interrupt, SA_SHIRQ,
+       } else if (request_irq(dev->irq, &corkscrew_interrupt, IRQF_SHARED,
                               vp->product_name, dev)) {
                return -EAGAIN;
        }
index 4bf8510655c52574a543b34bd6204a40ea47f7f5..5dfd97f0ba9ea1b7efc15b856ddf7e0006021a0d 100644 (file)
@@ -289,7 +289,7 @@ static int elmc_open(struct net_device *dev)
 
        elmc_id_attn586();      /* disable interrupts */
 
-       ret = request_irq(dev->irq, &elmc_interrupt, SA_SHIRQ | SA_SAMPLE_RANDOM,
+       ret = request_irq(dev->irq, &elmc_interrupt, IRQF_SHARED | IRQF_SAMPLE_RANDOM,
                          dev->name, dev);
        if (ret) {
                printk(KERN_ERR "%s: couldn't get irq %d\n", dev->name, dev->irq);
index 157eda57392536df2af842f1baf36c82bb0792e7..03c0f7176fc918a902537c524352e907c5ef0f6d 100644 (file)
@@ -435,7 +435,7 @@ static int __init mc32_probe1(struct net_device *dev, int slot)
         *      Grab the IRQ
         */
 
-       err = request_irq(dev->irq, &mc32_interrupt, SA_SHIRQ | SA_SAMPLE_RANDOM, DRV_NAME, dev);
+       err = request_irq(dev->irq, &mc32_interrupt, IRQF_SHARED | IRQF_SAMPLE_RANDOM, DRV_NAME, dev);
        if (err) {
                release_region(dev->base_addr, MC32_IO_EXTENT);
                printk(KERN_ERR "%s: unable to get IRQ %d.\n", DRV_NAME, dev->irq);
index d2f808979a2b5a9a598f45310f6fdd9ef5905b95..2819de79442cb9a864cc231564d0106077e5559f 100644 (file)
@@ -236,7 +236,6 @@ static int vortex_debug = VORTEX_DEBUG;
 static int vortex_debug = 1;
 #endif
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
@@ -997,7 +996,7 @@ static int vortex_resume(struct pci_dev *pdev)
                pci_enable_device(pdev);
                pci_set_master(pdev);
                if (request_irq(dev->irq, vp->full_bus_master_rx ?
-                               &boomerang_interrupt : &vortex_interrupt, SA_SHIRQ, dev->name, dev)) {
+                               &boomerang_interrupt : &vortex_interrupt, IRQF_SHARED, dev->name, dev)) {
                        printk(KERN_WARNING "%s: Could not reserve IRQ %d\n", dev->name, dev->irq);
                        pci_disable_device(pdev);
                        return -EBUSY;
@@ -1834,7 +1833,7 @@ vortex_open(struct net_device *dev)
 
        /* Use the now-standard shared IRQ implementation. */
        if ((retval = request_irq(dev->irq, vp->full_bus_master_rx ?
-                               &boomerang_interrupt : &vortex_interrupt, SA_SHIRQ, dev->name, dev))) {
+                               &boomerang_interrupt : &vortex_interrupt, IRQF_SHARED, dev->name, dev))) {
                printk(KERN_ERR "%s: Could not reserve IRQ %d\n", dev->name, dev->irq);
                goto out;
        }
@@ -1898,7 +1897,7 @@ vortex_timer(unsigned long data)
                printk(KERN_DEBUG "dev->watchdog_timeo=%d\n", dev->watchdog_timeo);
        }
 
-       disable_irq(dev->irq);
+       disable_irq_lockdep(dev->irq);
        old_window = ioread16(ioaddr + EL3_CMD) >> 13;
        EL3WINDOW(4);
        media_status = ioread16(ioaddr + Wn4_Media);
@@ -1979,7 +1978,7 @@ leave_media_alone:
                         dev->name, media_tbl[dev->if_port].name);
 
        EL3WINDOW(old_window);
-       enable_irq(dev->irq);
+       enable_irq_lockdep(dev->irq);
        mod_timer(&vp->timer, RUN_AT(next_tick));
        if (vp->deferred)
                iowrite16(FakeIntr, ioaddr + EL3_CMD);
index d26dd6a7062dcd2e72cb05a973fe1e78962fb7b4..1959654cbec8c06ee685f9a7b8fed7a3e61a2a59 100644 (file)
@@ -52,7 +52,6 @@
 #define DRV_RELDATE            "Mar 22, 2004"
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/kernel.h>
@@ -1204,7 +1203,7 @@ static int cp_open (struct net_device *dev)
 
        cp_init_hw(cp);
 
-       rc = request_irq(dev->irq, cp_interrupt, SA_SHIRQ, dev->name, dev);
+       rc = request_irq(dev->irq, cp_interrupt, IRQF_SHARED, dev->name, dev);
        if (rc)
                goto err_out_hw;
 
index ed2e3c03bc880678307b42a73b4fa61b005655c9..717506b2b13a5ab41b056ced8d277a8cbc532650 100644 (file)
@@ -93,7 +93,6 @@
 #define DRV_VERSION    "0.9.27"
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/compiler.h>
@@ -1311,7 +1310,7 @@ static int rtl8139_open (struct net_device *dev)
        int retval;
        void __iomem *ioaddr = tp->mmio_addr;
 
-       retval = request_irq (dev->irq, rtl8139_interrupt, SA_SHIRQ, dev->name, dev);
+       retval = request_irq (dev->irq, rtl8139_interrupt, IRQF_SHARED, dev->name, dev);
        if (retval)
                return retval;
 
index 8a9f7d61b9b1e51b161a61d3e176b108df403a10..7e2ca9571467c8e4d9f441c0147537b69371ec35 100644 (file)
@@ -40,7 +40,6 @@
 
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
index 86be96af9c8fd18380e40163b121f48d01fba748..d2935ae39814ae8e5dce9e4e66b7b2cba43d96ea 100644 (file)
@@ -249,7 +249,7 @@ void ei_tx_timeout(struct net_device *dev)
 
        /* Ugly but a reset can be slow, yet must be protected */
                
-       disable_irq_nosync(dev->irq);
+       disable_irq_nosync_lockdep(dev->irq);
        spin_lock(&ei_local->page_lock);
                
        /* Try to restart the card.  Perhaps the user has fixed something. */
@@ -257,7 +257,7 @@ void ei_tx_timeout(struct net_device *dev)
        NS8390_init(dev, 1);
                
        spin_unlock(&ei_local->page_lock);
-       enable_irq(dev->irq);
+       enable_irq_lockdep(dev->irq);
        netif_wake_queue(dev);
 }
     
index 51e39dcd06030846dc885ea0a63fe4866161bbca..a9a58f518f45cc28cdef4c71ba7c6d6b6708860f 100644 (file)
@@ -7,7 +7,6 @@
 #ifndef _8390_h
 #define _8390_h
 
-#include <linux/config.h>
 #include <linux/if_ether.h>
 #include <linux/ioport.h>
 #include <linux/skbuff.h>
index 60304f7e7e5b9703a6973a733cb452ff44517b18..a8c245a822611d39bbfc92ef60200d28e1bf3a7c 100644 (file)
@@ -27,7 +27,6 @@
  *             as published by the Free Software Foundation; either version
  *             2 of the License, or (at your option) any later version.
  */
-#include <linux/config.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/trdevice.h>
index 71165ac0257a4deba97110e011f7fee23e0e247b..f4ea62641acd59c41958bc96721051045f171bd3 100644 (file)
@@ -48,7 +48,6 @@
 #include <linux/skbuff.h>
 #include <linux/slab.h>
 #include <linux/string.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/crc32.h>
 #include <linux/zorro.h>
@@ -496,7 +495,7 @@ static int lance_open (struct net_device *dev)
        ll->rdp = LE_C0_STOP;
 
        /* Install the Interrupt handler */
-       ret = request_irq(IRQ_AMIGA_PORTS, lance_interrupt, SA_SHIRQ,
+       ret = request_irq(IRQ_AMIGA_PORTS, lance_interrupt, IRQF_SHARED,
                          dev->name, dev);
        if (ret) return ret;
 
index 23ff22ba5d31ade17265123ed2444302e402de7b..1c01e9b3d07c88cd2856232d268736ac77d87adc 100644 (file)
@@ -50,7 +50,6 @@
  *   Grant Grundler <grundler@cup.hp.com>: PCI write posting fixes.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/version.h>
@@ -1195,7 +1194,7 @@ static int __devinit ace_init(struct net_device *dev)
                goto init_error;
        }
 
-       ecode = request_irq(pdev->irq, ace_interrupt, SA_SHIRQ,
+       ecode = request_irq(pdev->irq, ace_interrupt, IRQF_SHARED,
                            DRV_NAME, dev);
        if (ecode) {
                printk(KERN_WARNING "%s: Requested IRQ %d is busy\n",
index a97107023495656ddeff4e2e20070a5f0d346f26..62ec8ceee698f954ff8ab225ba0bf3d0aa141822 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _ACENIC_H_
 #define _ACENIC_H_
 
-#include <linux/config.h>
 
 /*
  * Generate TX index update each time, when TX ring is closed.
index d7882dd783c80010a459fbc28be86cd0c1353dfb..ec146f60d77bb9a82190c1c3602f3fd85db2a9f0 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 /*
  * Declare these here even if Tigon I support is disabled to avoid
  * the compiler complaining about undefined symbols.
index d9ba8be72af804462735ef7a6facad667f3da765..ed322a76980d760bd045630f0abdf2842d674a5b 100644 (file)
@@ -69,7 +69,6 @@ Revision History:
 */
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
@@ -1377,7 +1376,7 @@ static int amd8111e_open(struct net_device * dev )
 {
        struct amd8111e_priv *lp = netdev_priv(dev);
 
-       if(dev->irq ==0 || request_irq(dev->irq, amd8111e_interrupt, SA_SHIRQ,
+       if(dev->irq ==0 || request_irq(dev->irq, amd8111e_interrupt, IRQF_SHARED,
                                         dev->name, dev)) 
                return -EAGAIN;
 
index b9820b86cdcc28f8d93031b9cccbe28d8544e44b..9cc13a0250d6f4af6689e07e72c3f602f1a63cfe 100644 (file)
@@ -313,7 +313,7 @@ static int __init apne_probe1(struct net_device *dev, int ioaddr)
     dev->base_addr = ioaddr;
 
     /* Install the Interrupt handler */
-    i = request_irq(IRQ_AMIGA_PORTS, apne_interrupt, SA_SHIRQ, DRV_NAME, dev);
+    i = request_irq(IRQ_AMIGA_PORTS, apne_interrupt, IRQF_SHARED, DRV_NAME, dev);
     if (i) return i;
 
     for(i = 0; i < ETHER_ADDR_LEN; i++) {
index 9edaa183227a36afb5f15737055e015631055d12..1d01ac0000e46c0fe79b73d3664d6ceb1c758e39 100644 (file)
@@ -48,7 +48,6 @@ static const char *version =
  *       the driver figure it out.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
index 31cf8c9c947ff3d15468b6ce81675b795f7d23ff..b02005087c1b4b2212f3185cbfeb468a6c6c6e40 100644 (file)
@@ -24,7 +24,6 @@
  *      - Jay Schulist <jschlst@samba.org>
  */
 
-#include <linux/config.h>
 
 #ifdef CONFIG_COPS_DAYNA
 
index 4afb8e18ba654ed9e523831d5f9f94cdd898f407..c699b1ad31da1298f823f109eaab6da4da56d8ae 100644 (file)
@@ -23,7 +23,6 @@
  *      - Jay Schulist <jschlst@samba.org>
  */
  
-#include <linux/config.h>
 
 #ifdef CONFIG_COPS_TANGENT
 
index 1a44a79ed0644b19c68183beb7818e1c008cbf20..7f7dd450226a8f853224a987302a21b2bf24acc2 100644 (file)
@@ -23,7 +23,6 @@
  *      of the GNU General Public License, incorporated herein by reference.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index fabc0607b0f1d15a500b1abd6989507ac2777561..5a95005253fa1a104adb1b1321f147751f0c049e 100644 (file)
@@ -44,7 +44,6 @@
 #define VERSION "arcnet: v3.93 BETA 2000/04/29 - by Avery Pennarun et al.\n"
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/delay.h>
 #include <linux/netdevice.h>
index 96636ca8754e896b85a7d47d90aa4caba371b4b8..979a33df0a8c3d84dc4871188c465871b822b50f 100644 (file)
@@ -120,7 +120,7 @@ static int __devinit com20020pci_probe(struct pci_dev *pdev, const struct pci_de
                goto out_port;
        }
 
-       if ((err = com20020_found(dev, SA_SHIRQ)) != 0)
+       if ((err = com20020_found(dev, IRQF_SHARED)) != 0)
                goto out_port;
 
        return 0;
index a9bb7a4aff9842dcd1413940882ec2e551085436..cc721addd576e8a7613c103854503ba2a9b53d07 100644 (file)
@@ -320,7 +320,7 @@ static int ariadne_open(struct net_device *dev)
 
     netif_start_queue(dev);
 
-    i = request_irq(IRQ_AMIGA_PORTS, ariadne_interrupt, SA_SHIRQ,
+    i = request_irq(IRQ_AMIGA_PORTS, ariadne_interrupt, IRQF_SHARED,
                     dev->name, dev);
     if (i) return i;
 
index 613005a0285d6552e3955ed714bd611e3b2c5345..85493b7b924f5f7528538ffaf80e3bdf5ec0c5fb 100644 (file)
@@ -19,7 +19,6 @@
 
 #include <linux/module.h>
 #include <linux/init.h>
-#include <linux/config.h>
 #include <linux/mii.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
index e613cc289749d6a89ee595eb24b8285a95b41163..5d7929c79bce8743acf4cebdef6079358898d713 100644 (file)
@@ -35,7 +35,6 @@
        response to inb()s from other device probes!
 */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
index 038d5fcb15e67439bc23ce782eaf3b4beabe1751..55f6e3f65b535d1bd82f574df311487717ac7fd0 100644 (file)
@@ -35,7 +35,6 @@
  * 
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index a7e4ba5a580f6ff67d8794541b1ec20279ab1eef..cd98d31dee8c319ad9ad487d7ecce0e3767ddb73 100644 (file)
@@ -1421,7 +1421,7 @@ static int b44_open(struct net_device *dev)
 
        b44_check_phy(bp);
 
-       err = request_irq(dev->irq, b44_interrupt, SA_SHIRQ, dev->name, dev);
+       err = request_irq(dev->irq, b44_interrupt, IRQF_SHARED, dev->name, dev);
        if (unlikely(err < 0)) {
                b44_chip_reset(bp);
                b44_free_rings(bp);
@@ -2322,7 +2322,7 @@ static int b44_resume(struct pci_dev *pdev)
        if (!netif_running(dev))
                return 0;
 
-       if (request_irq(dev->irq, b44_interrupt, SA_SHIRQ, dev->name, dev))
+       if (request_irq(dev->irq, b44_interrupt, IRQF_SHARED, dev->name, dev))
                printk(KERN_ERR PFX "%s: request_irq failed\n", dev->name);
 
        spin_lock_irq(&bp->lock);
index bbca8ae8018c3718e0e41dd723f61d1712489791..6fad83f24c4f5d08880baecc266c3f9f2c2732b7 100644 (file)
@@ -7,7 +7,6 @@
  * May 1999, Al Viro: proper release of /proc/net/bmac entry, switched to
  * dynamic procfs inode.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
index d55b0f7939a645a27ddc60082c466cfa5d7b6efd..4f4db5ae503b35a27fac24c4a5da51e4b966bc4e 100644 (file)
@@ -9,7 +9,6 @@
  * Written by: Michael Chan  (mchan@broadcom.com)
  */
 
-#include <linux/config.h>
 
 #include <linux/module.h>
 #include <linux/moduleparam.h>
@@ -4261,11 +4260,11 @@ bnx2_open(struct net_device *dev)
                }
                else {
                        rc = request_irq(bp->pdev->irq, bnx2_interrupt,
-                                       SA_SHIRQ, dev->name, dev);
+                                       IRQF_SHARED, dev->name, dev);
                }
        }
        else {
-               rc = request_irq(bp->pdev->irq, bnx2_interrupt, SA_SHIRQ,
+               rc = request_irq(bp->pdev->irq, bnx2_interrupt, IRQF_SHARED,
                                dev->name, dev);
        }
        if (rc) {
@@ -4312,7 +4311,7 @@ bnx2_open(struct net_device *dev)
 
                        if (!rc) {
                                rc = request_irq(bp->pdev->irq, bnx2_interrupt,
-                                       SA_SHIRQ, dev->name, dev);
+                                       IRQF_SHARED, dev->name, dev);
                        }
                        if (rc) {
                                bnx2_free_skbs(bp);
index 8171cae066888c23d0ec22d0019bdda9353c840f..8b951238f3a278b4299cf88977bceb883b729c45 100644 (file)
@@ -33,7 +33,6 @@
 
 //#define BONDING_DEBUG 1
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/sched.h>
index 5a9bd95884bef0ebd35f85518c3a6c4f63acef05..cfe4dc3a93a3b8c1264ee03dd4516f3aa44dfbd4 100644 (file)
@@ -20,7 +20,6 @@
  * file called LICENSE.
  *
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/sched.h>
index 565a54f1d06a1852bac76a8c317906bd04dbcac9..d33130f647000d7f50c030df89d875feb7ff35f8 100644 (file)
@@ -66,7 +66,6 @@
  * by default, the selective clear mask is set up to process rx packets.  
  */
 
-#include <linux/config.h>
 
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -4350,7 +4349,7 @@ static int cas_open(struct net_device *dev)
         * mapping to expose them
         */
        if (request_irq(cp->pdev->irq, cas_interrupt,
-                       SA_SHIRQ, dev->name, (void *) dev)) {
+                       IRQF_SHARED, dev->name, (void *) dev)) {
                printk(KERN_ERR "%s: failed to request irq !\n", 
                       cp->dev->name);
                err = -EAGAIN;
index bf3e7b6a7a1898290635cfb134f6bce0016992ef..5d9dd14427c5f30ac27d777c684e0b7c3d5d0d66 100644 (file)
@@ -39,7 +39,6 @@
 #ifndef _CXGB_COMMON_H_
 #define _CXGB_COMMON_H_
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/netdevice.h>
 #include <linux/types.h>
index 7fe2638ae06d9b64748a0997cdf66f157a7280b3..e67872433e9277bd1e778c3d1532710b53915015 100644 (file)
@@ -37,7 +37,6 @@
  ****************************************************************************/
 
 #include "common.h"
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/pci.h>
@@ -219,7 +218,7 @@ static int cxgb_up(struct adapter *adapter)
 
        t1_interrupts_clear(adapter);
        if ((err = request_irq(adapter->pdev->irq,
-                              t1_select_intr_handler(adapter), SA_SHIRQ,
+                              t1_select_intr_handler(adapter), IRQF_SHARED,
                               adapter->name, adapter))) {
                goto out_err;
        }
index 53efff6da78485352d41801da8833349c17e2766..87f94d939ff832a198a98bd9d26fc285238e8b2e 100644 (file)
@@ -39,7 +39,6 @@
 
 #include "common.h"
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/pci.h>
index 64105e4eaf31fec7aa643ff55338748fc05eb5ac..0eb1f8787ed740ddf72c9fc8e3f0c10e5f54e8c6 100644 (file)
  *
  */
 
-#include <linux/config.h>
 
 #include <linux/module.h>
 
@@ -672,7 +671,7 @@ e100_open(struct net_device *dev)
        /* allocate the irq corresponding to the receiving DMA */
 
        if (request_irq(NETWORK_DMA_RX_IRQ_NBR, e100rxtx_interrupt,
-                       SA_SAMPLE_RANDOM, cardname, (void *)dev)) {
+                       IRQF_SAMPLE_RANDOM, cardname, (void *)dev)) {
                goto grace_exit0;
        }
 
index ef54ebeb29b85196ea8626a4597ec46437076912..47eecce35fa446e3a2bb91fd279ca855598896ca 100644 (file)
 
 /* Always include 'config.h' first in case the user wants to turn on
    or override something. */
-#include <linux/config.h>
 #include <linux/module.h>
 
 /*
index bd954aaa636f2490850e29aec57b9fb265f2dca8..968fe11a0bf0e061e610d3249d22ecfeb4e7f404 100644 (file)
@@ -14,7 +14,6 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    */
 
-#include <linux/config.h>
 
 #define PP_ChipID 0x0000       /* offset   0h -> Corp -ID              */
                                /* offset   2h -> Model/Product Number  */
index d3d958e7ac56bc55dce349c303244f48d006515f..2038ca7e49ceb7dc6ad702c6ce75acbe2d0959d8 100644 (file)
@@ -42,7 +42,6 @@
  *              bits. macro
  */
 
-#include <linux/config.h>
 #include <linux/crc32.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
index 5acd35c312acb0734b91fc9a6983224a7f517e78..91cc8cbdd440dd8f2f7ce8da0c653e221f014e13 100644 (file)
@@ -1228,7 +1228,7 @@ static int dfx_open(struct net_device *dev)
        
        /* Register IRQ - support shared interrupts by passing device ptr */
 
-       ret = request_irq(dev->irq, dfx_interrupt, SA_SHIRQ, dev->name, dev);
+       ret = request_irq(dev->irq, dfx_interrupt, IRQF_SHARED, dev->name, dev);
        if (ret) {
                printk(KERN_ERR "%s: Requested IRQ %d is busy\n", dev->name, dev->irq);
                return ret;
index e946c43d3b10ad23ec9a0deae5c536a53cc2cbaf..b1cbe99249c15afbfbd7ea4fe58fb505611e2f81 100644 (file)
     =========================================================================
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
index e175d4876682d8705023ac84bd4c7d35afa7e129..fa4f09432975b5d17ee5797b419c6b43f3150567 100644 (file)
@@ -1191,7 +1191,7 @@ dgrs_probe1(struct net_device *dev)
        if (priv->plxreg)
                OUTL(dev->base_addr + PLX_LCL2PCI_DOORBELL, 1);
        
-       rc = request_irq(dev->irq, &dgrs_intr, SA_SHIRQ, "RightSwitch", dev);
+       rc = request_irq(dev->irq, &dgrs_intr, IRQF_SHARED, "RightSwitch", dev);
        if (rc)
                goto err_out;
 
index 038447fb5c5ee82ef17110189497e029c01d42fd..4b6ddb70f921b9ab734ba63c9aa9aea1295ffd47 100644 (file)
@@ -390,7 +390,7 @@ parse_eeprom (struct net_device *dev)
        for (i = 0; i < 6; i++)
                dev->dev_addr[i] = psrom->mac_addr[i];
 
-       /* Parse Software Infomation Block */
+       /* Parse Software Information Block */
        i = 0x30;
        psib = (u8 *) sromdata;
        do {
@@ -440,7 +440,7 @@ rio_open (struct net_device *dev)
        int i;
        u16 macctrl;
        
-       i = request_irq (dev->irq, &rio_interrupt, SA_SHIRQ, dev->name, dev);
+       i = request_irq (dev->irq, &rio_interrupt, IRQF_SHARED, dev->name, dev);
        if (i)
                return i;
        
index 7965a9b08e797fc3e0878422ebc989c4af28b728..1b758b70713486231d6f8593c559f0ced494801a 100644 (file)
@@ -603,7 +603,7 @@ dm9000_open(struct net_device *dev)
 
        PRINTK2("entering dm9000_open\n");
 
-       if (request_irq(dev->irq, &dm9000_interrupt, SA_SHIRQ, dev->name, dev))
+       if (request_irq(dev->irq, &dm9000_interrupt, IRQF_SHARED, dev->name, dev))
                return -EAGAIN;
 
        /* Initialize DM9000 board */
index dd8c15ac5c77b8cf5448feb9f2518a59ab8d5bfa..36d511729f7116549bdf560ee1df3c149f4b737c 100644 (file)
@@ -28,7 +28,6 @@
                        Alan Cox, 30th May 1994
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
index 93a286570923c523e118022a8024ddec68755843..91ef5f2fd76883807eb23a5678fdff79014b6d50 100644 (file)
  *     - Stratus87247: protect MDI control register manipulations
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/kernel.h>
@@ -2064,7 +2063,7 @@ static int e100_up(struct nic *nic)
        e100_set_multicast_list(nic->netdev);
        e100_start_receiver(nic, NULL);
        mod_timer(&nic->watchdog, jiffies);
-       if((err = request_irq(nic->pdev->irq, e100_intr, SA_SHIRQ,
+       if((err = request_irq(nic->pdev->irq, e100_intr, IRQF_SHARED,
                nic->netdev->name, nic->netdev)))
                goto err_no_irq;
        netif_wake_queue(nic->netdev);
index 2bc34fbfa69c0ee93b7b17f277c6fd14e67d4712..3042d33e2d4d9458dbd6ab6ab869063c6eded0bd 100644 (file)
@@ -34,7 +34,6 @@
 #define _E1000_H_
 
 #include <linux/stddef.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <asm/byteorder.h>
index 6ed7f599eba3dd656ce3e3d1bb4776d21c4af93a..d19664891768799690fbbc624d9a589a3c26e707 100644 (file)
@@ -871,10 +871,10 @@ e1000_intr_test(struct e1000_adapter *adapter, uint64_t *data)
        *data = 0;
 
        /* Hook up test interrupt handler just for this test */
-       if (!request_irq(irq, &e1000_test_intr, SA_PROBEIRQ, netdev->name,
-                        netdev)) {
+       if (!request_irq(irq, &e1000_test_intr, IRQF_PROBE_SHARED,
+                        netdev->name, netdev)) {
                shared_int = FALSE;
-       } else if (request_irq(irq, &e1000_test_intr, SA_SHIRQ,
+       } else if (request_irq(irq, &e1000_test_intr, IRQF_SHARED,
                              netdev->name, netdev)){
                *data = 1;
                return -1;
index 32b7d444b374073dca33b3333cdcccab1627cd0e..f77624f5f17bf33b0b23c3e2b6d31a25c795f0b2 100644 (file)
@@ -426,7 +426,7 @@ e1000_up(struct e1000_adapter *adapter)
        }
 #endif
        if ((err = request_irq(adapter->pdev->irq, &e1000_intr,
-                             SA_SHIRQ | SA_SAMPLE_RANDOM,
+                             IRQF_SHARED | IRQF_SAMPLE_RANDOM,
                              netdev->name, netdev))) {
                DPRINTK(PROBE, ERR,
                    "Unable to allocate interrupt Error: %d\n", err);
index e70f172699dbfe4f0cb6196d187f9dbb840e02c7..20d31430c74f9869ee29491f77cb03478f867f35 100644 (file)
@@ -920,7 +920,7 @@ static int  eepro_grab_irq(struct net_device *dev)
 
                eepro_sw2bank0(ioaddr); /* Switch back to Bank 0 */
 
-               if (request_irq (*irqp, NULL, SA_SHIRQ, "bogus", dev) != EBUSY) {
+               if (request_irq (*irqp, NULL, IRQF_SHARED, "bogus", dev) != EBUSY) {
                        unsigned long irq_mask;
                        /* Twinkle the interrupt, and check if it's seen */
                        irq_mask = probe_irq_on();
index ecf5ad85a6847e32ac7ecb3d1eee398033cffc66..2ad327542927246ff70530be1653e6364e45089a 100644 (file)
@@ -87,7 +87,6 @@ static int options[] = {-1, -1, -1, -1, -1, -1, -1, -1};
 /* Size of an pre-allocated Rx buffer: <Ethernet MTU> + slack.*/
 #define PKT_BUF_SZ             1536
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/kernel.h>
@@ -978,7 +977,7 @@ speedo_open(struct net_device *dev)
        sp->in_interrupt = 0;
 
        /* .. we can safely take handler calls during init. */
-       retval = request_irq(dev->irq, &speedo_interrupt, SA_SHIRQ, dev->name, dev);
+       retval = request_irq(dev->irq, &speedo_interrupt, IRQF_SHARED, dev->name, dev);
        if (retval) {
                return retval;
        }
index a74b20715755d4ff5dd63f98aa57e53248c41b1e..33291bcf6d4cc917289184c73e77c4a15f6667ca 100644 (file)
@@ -97,7 +97,6 @@
 #define LOCKUP16 0
 #endif
   
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
index ee34a16eb4e24b8feb2667b774d5627e8168a139..9f3e09a3d88c8e5f9e50b5d95e4f692f4a9e6fc1 100644 (file)
@@ -114,7 +114,6 @@ static int rx_copybreak;
 #define TX_FIFO_THRESH 256
 #define RX_FIFO_THRESH 1               /* 0-3, 0==32, 64,96, or 3==128 bytes  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
@@ -714,7 +713,7 @@ static int epic_open(struct net_device *dev)
        /* Soft reset the chip. */
        outl(0x4001, ioaddr + GENCTL);
 
-       if ((retval = request_irq(dev->irq, &epic_interrupt, SA_SHIRQ, dev->name, dev)))
+       if ((retval = request_irq(dev->irq, &epic_interrupt, IRQF_SHARED, dev->name, dev)))
                return retval;
 
        epic_init_ring(dev);
index 13eca7ede2af8175d524b541fd74ec60900dd5cb..c701951dcd6f2ff7bbf02de85a071fafddf53c17 100644 (file)
@@ -834,7 +834,7 @@ static int netdev_open(struct net_device *dev)
 
        iowrite32(0x00000001, ioaddr + BCR);    /* Reset */
 
-       if (request_irq(dev->irq, &intr_handler, SA_SHIRQ, dev->name, dev))
+       if (request_irq(dev->irq, &intr_handler, IRQF_SHARED, dev->name, dev))
                return -EAGAIN;
 
        for (i = 0; i < 3; i++)
index db694c83298961ad4630e2764cf0f7f8833098e2..9b403003174410812b07d7acbf189a676130ac0a 100644 (file)
@@ -25,7 +25,6 @@
  * Copyright (c) 2004-2006 Macq Electronique SA.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
index 29c275e1d566f5c25c0d3adac39836a13d6bb540..790d9dbe42ddf127b4e9f6794d8b26cb60cdbb6c 100644 (file)
@@ -2,7 +2,6 @@
  * FEC instantatiation file for NETTA
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/sched.h>
index 7e433809713968b4f719ff280df017f436e073c7..282b1452c39a6fe795fd965da351a3d5d895939b 100644 (file)
@@ -10,7 +10,6 @@
  * Released under the GPL
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
index 3b44ac1a7bfe7b66d1ce5383d4e760086fa8603c..d3c16b85d9a41fa405b1f2da83ff144f08b521fd 100644 (file)
@@ -10,7 +10,6 @@
  * Released under the GPL
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 21be4fa071b52b47a8e20f547e484a937db78dc9..037d870712ff645510328bb2708e0926ff31d744 100644 (file)
@@ -2622,21 +2622,21 @@ static int nv_request_irq(struct net_device *dev, int intr_test)
                        np->msi_flags |= NV_MSI_X_ENABLED;
                        if (optimization_mode == NV_OPTIMIZATION_MODE_THROUGHPUT && !intr_test) {
                                /* Request irq for rx handling */
-                               if (request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_RX].vector, &nv_nic_irq_rx, SA_SHIRQ, dev->name, dev) != 0) {
+                               if (request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_RX].vector, &nv_nic_irq_rx, IRQF_SHARED, dev->name, dev) != 0) {
                                        printk(KERN_INFO "forcedeth: request_irq failed for rx %d\n", ret);
                                        pci_disable_msix(np->pci_dev);
                                        np->msi_flags &= ~NV_MSI_X_ENABLED;
                                        goto out_err;
                                }
                                /* Request irq for tx handling */
-                               if (request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_TX].vector, &nv_nic_irq_tx, SA_SHIRQ, dev->name, dev) != 0) {
+                               if (request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_TX].vector, &nv_nic_irq_tx, IRQF_SHARED, dev->name, dev) != 0) {
                                        printk(KERN_INFO "forcedeth: request_irq failed for tx %d\n", ret);
                                        pci_disable_msix(np->pci_dev);
                                        np->msi_flags &= ~NV_MSI_X_ENABLED;
                                        goto out_free_rx;
                                }
                                /* Request irq for link and timer handling */
-                               if (request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_OTHER].vector, &nv_nic_irq_other, SA_SHIRQ, dev->name, dev) != 0) {
+                               if (request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_OTHER].vector, &nv_nic_irq_other, IRQF_SHARED, dev->name, dev) != 0) {
                                        printk(KERN_INFO "forcedeth: request_irq failed for link %d\n", ret);
                                        pci_disable_msix(np->pci_dev);
                                        np->msi_flags &= ~NV_MSI_X_ENABLED;
@@ -2651,9 +2651,9 @@ static int nv_request_irq(struct net_device *dev, int intr_test)
                        } else {
                                /* Request irq for all interrupts */
                                if ((!intr_test &&
-                                    request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector, &nv_nic_irq, SA_SHIRQ, dev->name, dev) != 0) ||
+                                    request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector, &nv_nic_irq, IRQF_SHARED, dev->name, dev) != 0) ||
                                    (intr_test &&
-                                    request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector, &nv_nic_irq_test, SA_SHIRQ, dev->name, dev) != 0)) {
+                                    request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector, &nv_nic_irq_test, IRQF_SHARED, dev->name, dev) != 0)) {
                                        printk(KERN_INFO "forcedeth: request_irq failed %d\n", ret);
                                        pci_disable_msix(np->pci_dev);
                                        np->msi_flags &= ~NV_MSI_X_ENABLED;
@@ -2669,8 +2669,8 @@ static int nv_request_irq(struct net_device *dev, int intr_test)
        if (ret != 0 && np->msi_flags & NV_MSI_CAPABLE) {
                if ((ret = pci_enable_msi(np->pci_dev)) == 0) {
                        np->msi_flags |= NV_MSI_ENABLED;
-                       if ((!intr_test && request_irq(np->pci_dev->irq, &nv_nic_irq, SA_SHIRQ, dev->name, dev) != 0) ||
-                           (intr_test && request_irq(np->pci_dev->irq, &nv_nic_irq_test, SA_SHIRQ, dev->name, dev) != 0)) {
+                       if ((!intr_test && request_irq(np->pci_dev->irq, &nv_nic_irq, IRQF_SHARED, dev->name, dev) != 0) ||
+                           (intr_test && request_irq(np->pci_dev->irq, &nv_nic_irq_test, IRQF_SHARED, dev->name, dev) != 0)) {
                                printk(KERN_INFO "forcedeth: request_irq failed %d\n", ret);
                                pci_disable_msi(np->pci_dev);
                                np->msi_flags &= ~NV_MSI_ENABLED;
@@ -2685,8 +2685,8 @@ static int nv_request_irq(struct net_device *dev, int intr_test)
                }
        }
        if (ret != 0) {
-               if ((!intr_test && request_irq(np->pci_dev->irq, &nv_nic_irq, SA_SHIRQ, dev->name, dev) != 0) ||
-                   (intr_test && request_irq(np->pci_dev->irq, &nv_nic_irq_test, SA_SHIRQ, dev->name, dev) != 0))
+               if ((!intr_test && request_irq(np->pci_dev->irq, &nv_nic_irq, IRQF_SHARED, dev->name, dev) != 0) ||
+                   (intr_test && request_irq(np->pci_dev->irq, &nv_nic_irq_test, IRQF_SHARED, dev->name, dev) != 0))
                        goto out_err;
 
        }
@@ -2735,21 +2735,21 @@ static void nv_do_nic_poll(unsigned long data)
 
        if (!using_multi_irqs(dev)) {
                if (np->msi_flags & NV_MSI_X_ENABLED)
-                       disable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector);
+                       disable_irq_lockdep(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector);
                else
-                       disable_irq(dev->irq);
+                       disable_irq_lockdep(dev->irq);
                mask = np->irqmask;
        } else {
                if (np->nic_poll_irq & NVREG_IRQ_RX_ALL) {
-                       disable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_RX].vector);
+                       disable_irq_lockdep(np->msi_x_entry[NV_MSI_X_VECTOR_RX].vector);
                        mask |= NVREG_IRQ_RX_ALL;
                }
                if (np->nic_poll_irq & NVREG_IRQ_TX_ALL) {
-                       disable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_TX].vector);
+                       disable_irq_lockdep(np->msi_x_entry[NV_MSI_X_VECTOR_TX].vector);
                        mask |= NVREG_IRQ_TX_ALL;
                }
                if (np->nic_poll_irq & NVREG_IRQ_OTHER) {
-                       disable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_OTHER].vector);
+                       disable_irq_lockdep(np->msi_x_entry[NV_MSI_X_VECTOR_OTHER].vector);
                        mask |= NVREG_IRQ_OTHER;
                }
        }
@@ -2761,23 +2761,23 @@ static void nv_do_nic_poll(unsigned long data)
        pci_push(base);
 
        if (!using_multi_irqs(dev)) {
-               nv_nic_irq((int) 0, (void *) data, (struct pt_regs *) NULL);
+               nv_nic_irq(0, dev, NULL);
                if (np->msi_flags & NV_MSI_X_ENABLED)
-                       enable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector);
+                       enable_irq_lockdep(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector);
                else
-                       enable_irq(dev->irq);
+                       enable_irq_lockdep(dev->irq);
        } else {
                if (np->nic_poll_irq & NVREG_IRQ_RX_ALL) {
-                       nv_nic_irq_rx((int) 0, (void *) data, (struct pt_regs *) NULL);
-                       enable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_RX].vector);
+                       nv_nic_irq_rx(0, dev, NULL);
+                       enable_irq_lockdep(np->msi_x_entry[NV_MSI_X_VECTOR_RX].vector);
                }
                if (np->nic_poll_irq & NVREG_IRQ_TX_ALL) {
-                       nv_nic_irq_tx((int) 0, (void *) data, (struct pt_regs *) NULL);
-                       enable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_TX].vector);
+                       nv_nic_irq_tx(0, dev, NULL);
+                       enable_irq_lockdep(np->msi_x_entry[NV_MSI_X_VECTOR_TX].vector);
                }
                if (np->nic_poll_irq & NVREG_IRQ_OTHER) {
-                       nv_nic_irq_other((int) 0, (void *) data, (struct pt_regs *) NULL);
-                       enable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_OTHER].vector);
+                       nv_nic_irq_other(0, dev, NULL);
+                       enable_irq_lockdep(np->msi_x_entry[NV_MSI_X_VECTOR_OTHER].vector);
                }
        }
 }
index 196298f33db8b31bb950ac30c855aa70204564bd..f6abff5846b35fd1ca5f3bccec6c62d639129bc6 100644 (file)
@@ -15,7 +15,6 @@
  * kind, whether express or implied.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
@@ -672,7 +671,7 @@ static int fs_request_irq(struct net_device *dev, int irq, const char *name,
        struct fs_enet_private *fep = netdev_priv(dev);
 
        (*fep->ops->pre_request_irq)(dev, irq);
-       return request_irq(irq, irqf, SA_SHIRQ, name, dev);
+       return request_irq(irq, irqf, IRQF_SHARED, name, dev);
 }
 
 static void fs_free_irq(struct net_device *dev, int irq)
index 0cd07150bf4aeee6e3add86d7e6e5e23544c3288..b7e6e21725cbcdfff6f6029b32153173b380155a 100644 (file)
@@ -16,7 +16,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 95e2bb8dd7b415cacb3a770dc1dfc9e135e566d9..64e20982c1fedc66a136eeb72893a1055cc0fa2c 100644 (file)
@@ -12,7 +12,6 @@
  * kind, whether express or implied.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
index 3dad69dfdb2ccd90c407837906d085fdca42cbf2..e09547077529c917bbdb318e0e455ddde363bb45 100644 (file)
@@ -12,7 +12,6 @@
  * kind, whether express or implied.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
index a772b286f96d842e8c3391a6b50f10254e976d0b..eaa24fab645fb5b3e906af00943fabd26005d6ec 100644 (file)
@@ -12,7 +12,6 @@
  * kind, whether express or implied.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
index 24a5e2e23d18ab8b0225a7fc3b33062bb99e2a3f..48f9cf83ab6f4e857aa0fbf30daa47f8ace08898 100644 (file)
@@ -13,7 +13,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index b3e192d612e5e83a85542051ada458f3b3553c8b..ae4a9c3bb393abc82aacfbed4ceb50040de4476f 100644 (file)
@@ -13,7 +13,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 218d31764c525414afc152d027569c10dd81c5e1..ebbbd6ca6204e28ba605cd980d8b6d5e1a408047 100644 (file)
@@ -64,7 +64,6 @@
  *  The driver then cleans up the buffer.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/string.h>
index 127c98cf33362b199c51c4a470f3a488ccdcdf28..f87bbc408dae33898680c3d118d6cc7e25220052 100644 (file)
@@ -22,7 +22,6 @@
 #ifndef __GIANFAR_H
 #define __GIANFAR_H
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/string.h>
index d69698c695ef5ed15e69d69a9d9b0efce41d3bc9..e0f505285e5088535d0d809a0e302324de827985 100644 (file)
@@ -15,7 +15,6 @@
  *  by reference.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/string.h>
index c6b725529af508352698a32bca989999bc977457..c92e65984fd03dabc618792d1e769669ce03c9cc 100644 (file)
@@ -16,7 +16,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/string.h>
index a6d5c43199cbfa6eeff4336e6d34db6df3ce292d..e8a18f18d08ce30eec37dd98e8042bfce1d43e9c 100644 (file)
@@ -19,7 +19,6 @@
  * Sysfs file creation and management
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/string.h>
index 2d24354046144870370d26c054fea3b6a7e57774..49dacc6e35aaf8f37dbcca1eb3eeff7237479a89 100644 (file)
@@ -1030,7 +1030,7 @@ gt96100_open(struct net_device *dev)
        }
 
        if ((retval = request_irq(dev->irq, &gt96100_interrupt,
-                                 SA_SHIRQ, dev->name, dev))) {
+                                 IRQF_SHARED, dev->name, dev))) {
                err("unable to get IRQ %d\n", dev->irq);
                return retval;
        }
index 395869c5ed3edc4e4751377615ea8a1f2db2806a..2a8331938b841f6af25006e544f2f2a639b268e1 100644 (file)
@@ -27,7 +27,6 @@
 #ifndef _GT96100ETH_H
 #define _GT96100ETH_H
 
-#include <linux/config.h>
 #include <asm/galileo-boards/gt96100.h>
 
 #define dbg(lvl, format, arg...) \
index 0ea4cb4a0d80aa1f0735f904a728ff09345d6089..7bcd939c6edda2a75a704f7f254ae5292a59a9c0 100644 (file)
@@ -871,7 +871,7 @@ static int hamachi_open(struct net_device *dev)
        u32 rx_int_var, tx_int_var;
        u16 fifo_info;
 
-       i = request_irq(dev->irq, &hamachi_interrupt, SA_SHIRQ, dev->name, dev);
+       i = request_irq(dev->irq, &hamachi_interrupt, IRQF_SHARED, dev->name, dev);
        if (i)
                return i;
 
index d12605f0ac7c6e0f4b01ed0558d61a47c4037008..86b3bb9bec2d38727922fda410b58f73f9019fde 100644 (file)
@@ -12,7 +12,6 @@
  *             Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
index 232793d2ce6b0a46bf7d4a1a04e6683ac7624d14..55906c7b4bb12e25c877225901a83543dd0ccf12 100644 (file)
@@ -434,7 +434,7 @@ static int ser12_open(struct net_device *dev)
        outb(0, FCR(dev->base_addr));  /* disable FIFOs */
        outb(0x0d, MCR(dev->base_addr));
        outb(0, IER(dev->base_addr));
-       if (request_irq(dev->irq, ser12_interrupt, SA_INTERRUPT | SA_SHIRQ,
+       if (request_irq(dev->irq, ser12_interrupt, IRQF_DISABLED | IRQF_SHARED,
                        "baycom_ser_fdx", dev)) {
                release_region(dev->base_addr, SER12_EXTENT);
                return -EBUSY;
index be596a3eb3fd9b164b6107410498d4dde7a76ace..de95de8983dae4a46c78013ca2eb5604ff87f318 100644 (file)
@@ -488,7 +488,7 @@ static int ser12_open(struct net_device *dev)
        outb(0, FCR(dev->base_addr));  /* disable FIFOs */
        outb(0x0d, MCR(dev->base_addr));
        outb(0, IER(dev->base_addr));
-       if (request_irq(dev->irq, ser12_interrupt, SA_INTERRUPT | SA_SHIRQ,
+       if (request_irq(dev->irq, ser12_interrupt, IRQF_DISABLED | IRQF_SHARED,
                        "baycom_ser12", dev)) {
                release_region(dev->base_addr, SER12_EXTENT);       
                return -EBUSY;
index cb43a9d28774fa8886dbfed420cc69c13312df74..0641f54fc6389d622c4e971a4da0a4083943928e 100644 (file)
@@ -54,7 +54,6 @@
  *     BPQ   004       Joerg(DL1BKE)           Fixed to not lock up on ifconfig.
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/socket.h>
index 3ebbbe56b6e94be8c9fd7ec3be2b7d3486f7c51d..d8715b200c17bfcdef02ee8aa5c8f2358a4bcecb 100644 (file)
@@ -16,7 +16,6 @@
  * Copyright (C) 2004, 05 Ralf Baechle DL5RB <ralf@linux-mips.org>
  * Copyright (C) 2004, 05 Thomas Osterried DL9SAU <thomas@x-berg.in-berlin.de>
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <asm/system.h>
 #include <linux/bitops.h>
index 5927784df3f9373a035e4003c3758c9d56d44b3c..df4b68142ac7b6dfdd1e43640ecfd83898f2f318 100644 (file)
 
 /* ----------------------------------------------------------------------- */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
@@ -1737,7 +1736,7 @@ static int scc_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
                                
                        if (!Ivec[hwcfg.irq].used && hwcfg.irq)
                        {
-                               if (request_irq(hwcfg.irq, scc_isr, SA_INTERRUPT, "AX.25 SCC", NULL))
+                               if (request_irq(hwcfg.irq, scc_isr, IRQF_DISABLED, "AX.25 SCC", NULL))
                                        printk(KERN_WARNING "z8530drv: warning, cannot get IRQ %d\n", hwcfg.irq);
                                else
                                        Ivec[hwcfg.irq].used = 1;
index b49884048caa29df1cb6f09764e1528a0d99c79b..f98f5777dfbb7807729e20c79651ee8c7291e1bb 100644 (file)
@@ -42,7 +42,6 @@
 
 /*****************************************************************************/
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/net.h>
@@ -874,7 +873,7 @@ static int yam_open(struct net_device *dev)
                goto out_release_base;
        }
        outb(0, IER(dev->base_addr));
-       if (request_irq(dev->irq, yam_interrupt, SA_INTERRUPT | SA_SHIRQ, dev->name, dev)) {
+       if (request_irq(dev->irq, yam_interrupt, IRQF_DISABLED | IRQF_SHARED, dev->name, dev)) {
                printk(KERN_ERR "%s: irq %d busy\n", dev->name, dev->irq);
                ret = -EBUSY;
                goto out_release_base;
index dd1dc32dc98dc3181db5bb41be53f550bd3e1844..e7d9bf330287b504958b647e9e262440750c3a64 100644 (file)
@@ -1079,7 +1079,7 @@ static int hp100_open(struct net_device *dev)
        /* New: if bus is PCI or EISA, interrupts might be shared interrupts */
        if (request_irq(dev->irq, hp100_interrupt,
                        lp->bus == HP100_BUS_PCI || lp->bus ==
-                       HP100_BUS_EISA ? SA_SHIRQ : SA_INTERRUPT,
+                       HP100_BUS_EISA ? IRQF_SHARED : IRQF_DISABLED,
                        "hp100", dev)) {
                printk("hp100: %s: unable to get IRQ %d\n", dev->name, dev->irq);
                return -EAGAIN;
index d9fb8e74e631d7e019e9d61fb30a04412b3c3be9..91326ea3e12b3ce9a2393020039aff9c9d55954e 100644 (file)
@@ -117,7 +117,7 @@ static int __devinit hydra_init(struct zorro_dev *z)
     dev->irq = IRQ_AMIGA_PORTS;
 
     /* Install the Interrupt handler */
-    if (request_irq(IRQ_AMIGA_PORTS, ei_interrupt, SA_SHIRQ, "Hydra Ethernet",
+    if (request_irq(IRQ_AMIGA_PORTS, ei_interrupt, IRQF_SHARED, "Hydra Ethernet",
                    dev)) {
        free_netdev(dev);
        return -EAGAIN;
index c2dae6092c4c44a67703d4b0bdc486cc642a26f1..97ed22bb4320c0e593fae8e02da5d06aabc1b653 100644 (file)
@@ -20,7 +20,6 @@
 #ifndef __IBM_EMAC_H_
 #define __IBM_EMAC_H_
 
-#include <linux/config.h>
 #include <linux/types.h>
 
 /* This is a simple check to prevent use of this driver on non-tested SoCs */
index 7e49522b8b3c6a10cc5c75070edb378d1c935658..82468e2dc7991dfc386ccae6d96ccfba8aa36f65 100644 (file)
@@ -19,7 +19,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index f61273b2e94fea4031187c98dc1d6b16209d4c49..dabb94afeb98a63a9ef0fd080b4dbf3b8a43e3a3 100644 (file)
@@ -20,7 +20,6 @@
 #ifndef __IBM_EMAC_CORE_H_
 #define __IBM_EMAC_CORE_H_
 
-#include <linux/config.h>
 #include <linux/netdevice.h>
 #include <linux/dma-mapping.h>
 #include <asm/ocp.h>
index c7e1ecfa08fe34aec91cac603dd34fbcedd2cdad..c3645908034db3af5ea0c1235e15a8322242a942 100644 (file)
@@ -12,7 +12,6 @@
  * option) any later version.
  *
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
index e85fbe0a8da9e5c66b4a7c0625f959b66b5f516e..5761389495d008c8cf750aad0fc0dc3d7ed379c7 100644 (file)
@@ -15,7 +15,6 @@
 #ifndef __IBM_EMAC_DEBUG_H_
 #define __IBM_EMAC_DEBUG_H_
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include "ibm_emac_core.h"
 #include "ibm_emac_mal.h"
index da88d43081cc1e10348dee7372f5ecef5b50bef6..af50e7b2e0d7f998bcb9cf5f42d728366bc384e8 100644 (file)
@@ -19,7 +19,6 @@
  * option) any later version.
  *
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index 2a2d3b24b0370c099d7c1a67850220853fb54ffa..f73f10a0a56217c13f378dd5466209f33e2d73d4 100644 (file)
@@ -19,7 +19,6 @@
 #ifndef __IBM_EMAC_MAL_H_
 #define __IBM_EMAC_MAL_H_
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/list.h>
 #include <linux/netdevice.h>
index 67935dd33a6578788b0062122b69473cbc6e1fc8..4a97024061e530f84f3c2cac3d4015d8925e2086 100644 (file)
@@ -12,7 +12,6 @@
  * (c) 2004-2005, Eugene Surovegin <ebs@ebshome.net>
  *
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
index f0b1ffb2dbbf1638e8f2fdbb14837a77ec4fa30f..53d281cb9a16a3eb67c48a90611ddf57b8185584 100644 (file)
@@ -16,7 +16,6 @@
  * option) any later version.
  *
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/ethtool.h>
 #include <asm/io.h>
index 7f03d536c9a3e7f7d1f934eaec93f1cb93dbd2e7..94abde55e2e9fde1a930de8fe748568503b9aa59 100644 (file)
@@ -21,7 +21,6 @@
 #ifndef _IBM_EMAC_RGMII_H_
 #define _IBM_EMAC_RGMII_H_
 
-#include <linux/config.h>
 
 /* RGMII bridge */
 struct rgmii_regs {
index af08afc22f9f4385f7eb5966d44d116aa6b97c91..e287b451bb44f66a4449ec1bcb36b3e9e067d106 100644 (file)
@@ -13,7 +13,6 @@
  * Free Software Foundation;  either version 2 of the  License, or (at your
  * option) any later version.
  */
-#include <linux/config.h>
 #include <asm/io.h>
 
 #include "ibm_emac_core.h"
index 9299b5dd7eb1d3c0f699bead79abe016deaa9b1a..38153945a2402dde37939983dad98bd7372a5a27 100644 (file)
@@ -17,7 +17,6 @@
 #ifndef _IBM_EMAC_TAH_H
 #define _IBM_EMAC_TAH_H
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <asm/ocp.h>
 
index e129e0aaa045512f26e84a18def908225e1843b7..37dc8f3428688896df77719162c836e37e344bc1 100644 (file)
@@ -16,7 +16,6 @@
  * option) any later version.
  *
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/ethtool.h>
 #include <asm/io.h>
index 92c8544107537d34d59ad595272463d87e0ba10f..972e3a44a09ffe7dfbfbd5d25c0e3f7d8c2c18d9 100644 (file)
@@ -19,7 +19,6 @@
 #ifndef _IBM_EMAC_ZMII_H_
 #define _IBM_EMAC_ZMII_H_
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <asm/ocp.h>
 
index 51fd51609ea9308af6b7e7755cc058dcd8b81905..2a95d72fa593d9631afc7ccc88d76cf76dbb2498 100644 (file)
@@ -782,7 +782,7 @@ static int ibmlana_open(struct net_device *dev)
 
        /* register resources - only necessary for IRQ */
 
-       result = request_irq(priv->realirq, irq_handler, SA_SHIRQ | SA_SAMPLE_RANDOM, dev->name, dev);
+       result = request_irq(priv->realirq, irq_handler, IRQF_SHARED | IRQF_SAMPLE_RANDOM, dev->name, dev);
        if (result != 0) {
                printk(KERN_ERR "%s: failed to register irq %d\n", dev->name, dev->irq);
                return result;
index 4c2e7279ba347eaab36af160de623cda697d17cf..0464e78f733ad86ccecea99f3a18306544f1cffe 100644 (file)
@@ -33,7 +33,6 @@
   - possibly remove procfs support
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/errno.h>
index 2e222ef91e224892c675766831fddc851e40f017..3a42afab50362983fc2b393b191757d59f5d5c21 100644 (file)
@@ -27,7 +27,6 @@
 */
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
index e76e6e7be0b1b20c46990df26d55b81bc0f4bf9b..68d8af7df08e31fe6e1bee61f7c495782ceba1ec 100644 (file)
@@ -30,7 +30,6 @@
 #define IOC3_NAME      "ioc3-eth"
 #define IOC3_VERSION   "2.6.3-3"
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/kernel.h>
@@ -1064,7 +1063,7 @@ static int ioc3_open(struct net_device *dev)
 {
        struct ioc3_private *ip = netdev_priv(dev);
 
-       if (request_irq(dev->irq, ioc3_interrupt, SA_SHIRQ, ioc3_str, dev)) {
+       if (request_irq(dev->irq, ioc3_interrupt, IRQF_SHARED, ioc3_str, dev)) {
                printk(KERN_ERR "%s: Can't get irq %d\n", dev->name, dev->irq);
 
                return -EAGAIN;
index e6b1985767c2f85498b87926a209bc27f62e3151..7b2b4135bb237d3a9392fb91d63badc8e8c46862 100644 (file)
@@ -18,7 +18,6 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/init.h>
index 910c0cab35b02a7d2b939779ec9a04aff2cd30e0..33c07d5275da22b3ff719b6e66d4cb06167172b6 100644 (file)
@@ -1372,7 +1372,7 @@ toshoboe_net_open (struct net_device *dev)
     return 0;
 
   if (request_irq (self->io.irq, toshoboe_interrupt,
-                   SA_SHIRQ | SA_INTERRUPT, dev->name, (void *) self))
+                   IRQF_SHARED | IRQF_DISABLED, dev->name, (void *) self))
     {
       return -EAGAIN;
     }
@@ -1573,7 +1573,7 @@ toshoboe_open (struct pci_dev *pci_dev, const struct pci_device_id *pdid)
   self->io.fir_base = self->base;
   self->io.fir_ext = OBOE_IO_EXTENT;
   self->io.irq = pci_dev->irq;
-  self->io.irqflags = SA_SHIRQ | SA_INTERRUPT;
+  self->io.irqflags = IRQF_SHARED | IRQF_DISABLED;
 
   self->speed = self->io.speed = 9600;
   self->async = 0;
index e1aa9910503bf08bf844f8327f26a5419eb9b939..afb19e8d95c8dbcd5b040ac1cbf5623959d0011e 100644 (file)
@@ -12,7 +12,6 @@
  * Infra-red driver (SIR/FIR) for the PXA2xx embedded microprocessor
  *
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/init.h>
index f530686bd09f80fc374a2d4c5d2bcb95e7c44a09..8d5a288d7976a249cc97c8a6d7f725191a19d9b2 100644 (file)
@@ -18,7 +18,6 @@
  *     power_leve:level        - set the transmitter power level
  *     tx_lpm:0|1              - set transmit low power mode
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/types.h>
index d70b9e8d6e6054208216efb7ff9f88b1e50d7970..92d646cc9edcfc2e773332ce71b722b6be46b3c0 100644 (file)
@@ -21,7 +21,6 @@
  *
  ********************************************************************/
 
-#include <linux/config.h>
 #include <linux/module.h>
  
 #define DRIVER_NAME            "vlsi_ir"
@@ -1518,7 +1517,7 @@ static int vlsi_open(struct net_device *ndev)
 
        outb(IRINTR_INT_MASK, ndev->base_addr+VLSI_PIO_IRINTR);
 
-       if (request_irq(ndev->irq, vlsi_interrupt, SA_SHIRQ,
+       if (request_irq(ndev->irq, vlsi_interrupt, IRQF_SHARED,
                        drivername, ndev)) {
                IRDA_WARNING("%s: couldn't get IRQ: %d\n",
                             __FUNCTION__, ndev->irq);
index 93394d76587ab749bdd1adb7b22b03fb3e9aaec0..cdc14401cdbeb6531941afcca376da99bb1769ca 100644 (file)
@@ -56,7 +56,6 @@
  * number of packets outstanding to a remote partition at a time.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/errno.h>
index a83ef28dadb0c0832ee68e3fd7b3854fe94f4dc9..82b67af54c941ab5224a6c0ff7cbae2b700f40e1 100644 (file)
@@ -30,7 +30,6 @@
 #define _IXGB_H_
 
 #include <linux/stddef.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <asm/byteorder.h>
index 8bb32f94699371b815b2f61a9e2aa676270c1cf5..b91e082483f63067a976b207f39ff806eeeb2172 100644 (file)
@@ -253,7 +253,7 @@ ixgb_up(struct ixgb_adapter *adapter)
 
 #endif
        if((err = request_irq(adapter->pdev->irq, &ixgb_intr,
-                                 SA_SHIRQ | SA_SAMPLE_RANDOM,
+                                 IRQF_SHARED | IRQF_SAMPLE_RANDOM,
                                  netdev->name, netdev))) {
                DPRINTK(PROBE, ERR,
                 "Unable to allocate interrupt Error: %d\n", err);
index 3595e107df22ae0e408ddfe0aea27049e602d409..7dea5b95012c303a42a16a5d17fca66ceb42efb2 100644 (file)
@@ -9,7 +9,6 @@
  * (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/delay.h>
 #include <asm/io.h>
index b67f586d7392ab199e29181517d18af00cc9a8e1..d3f4235c585d42d8c7b5ac2cc7684a59b6aee8c6 100644 (file)
@@ -9,7 +9,6 @@
  * (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
index 48a3a891d3a42affde88c395c947efe4b07459df..9ec38eebfb5629fed388f25347cd2501bfe1f5e7 100644 (file)
@@ -11,7 +11,6 @@
  * License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <asm/hardware.h>
index fbc2d21020f4ee9ac2cca49a5b3b3d7764a9a9fe..6eeb965b4d72b9214a3edddbfc52f6b8f7f21394 100644 (file)
@@ -9,7 +9,6 @@
  * (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
@@ -236,7 +235,7 @@ static int ixpdev_open(struct net_device *dev)
 
        if (!nds_open++) {
                err = request_irq(IRQ_IXP2000_THDA0, ixpdev_interrupt,
-                                       SA_SHIRQ, "ixp2000_eth", nds);
+                                       IRQF_SHARED, "ixp2000_eth", nds);
                if (err) {
                        nds_open--;
                        return err;
index 5224651c9aac30e3ab308286c7d01f93c987ee79..e08d3f9863b8d28fd0d797941da479bcd2453e71 100644 (file)
@@ -9,7 +9,6 @@
  * (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/delay.h>
 #include <linux/netdevice.h>
index 272d331d29cd5a6a6363861ca0b1f91cba5ca33a..661d75b4cad205a65dcd6e42b54eaccf07f0a9c7 100644 (file)
@@ -260,7 +260,7 @@ MODULE_DESCRIPTION("Jazz SONIC ethernet driver");
 module_param(sonic_debug, int, 0);
 MODULE_PARM_DESC(sonic_debug, "jazzsonic debug level (1-4)");
 
-#define SONIC_IRQ_FLAG SA_INTERRUPT
+#define SONIC_IRQ_FLAG IRQF_DISABLED
 
 #include "sonic.c"
 
index bf3f343ae7153dc56bc9107da56f4cdf4f3bcdf1..b783a6984abc0efd6f88ab8e814a70adc3656fc9 100644 (file)
@@ -851,7 +851,7 @@ static int i596_open(struct net_device *dev)
 {
        int i;
 
-       i = request_irq(dev->irq, &i596_interrupt, SA_SHIRQ, dev->name, dev);
+       i = request_irq(dev->irq, &i596_interrupt, IRQF_SHARED, dev->name, dev);
        if (i) {
                printk(KERN_ERR "%s: IRQ %d not free\n", dev->name, dev->irq);
                return i;
index 77792b28602787e342f8b9e1ea7bfc1aed5f9db6..29e4b5aa6eadb1e954eb9e3a95ea20684decd955 100644 (file)
@@ -5,7 +5,6 @@
  * Copyright (C) 1996 Paul Mackerras.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
@@ -243,12 +242,12 @@ static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_i
        }
        rc = request_irq(mp->tx_dma_intr, mace_txdma_intr, 0, "MACE-txdma", dev);
        if (rc) {
-               printk(KERN_ERR "MACE: can't get irq %d\n", mace->intrs[1].line);
+               printk(KERN_ERR "MACE: can't get irq %d\n", mp->tx_dma_intr);
                goto err_free_irq;
        }
        rc = request_irq(mp->rx_dma_intr, mace_rxdma_intr, 0, "MACE-rxdma", dev);
        if (rc) {
-               printk(KERN_ERR "MACE: can't get irq %d\n", mace->intrs[2].line);
+               printk(KERN_ERR "MACE: can't get irq %d\n", mp->rx_dma_intr);
                goto err_free_tx_irq;
        }
 
index bbffb585b3b383a4582c22ab2078dafd471f1f14..07e58f4a29164c6ea76f6a91c9151cfbb0c9ace9 100644 (file)
@@ -179,7 +179,7 @@ static int mipsnet_open(struct net_device *dev)
        pr_debug("%s: mipsnet_open\n", dev->name);
 
        err = request_irq(dev->irq, &mipsnet_interrupt,
-                         SA_SHIRQ, dev->name, (void *) dev);
+                         IRQF_SHARED, dev->name, (void *) dev);
 
        if (err) {
                pr_debug("%s: %s(): can't get irq %d\n",
index 625ff61c9988e7e0519c3dda2ba82f59cbc33d53..760c61b9886709515efb39e2fefbc4d41ce0a3e7 100644 (file)
@@ -778,7 +778,7 @@ static int mv643xx_eth_open(struct net_device *dev)
        int err;
 
        err = request_irq(dev->irq, mv643xx_eth_int_handler,
-                       SA_SHIRQ | SA_SAMPLE_RANDOM, dev->name, dev);
+                       IRQF_SHARED | IRQF_SAMPLE_RANDOM, dev->name, dev);
        if (err) {
                printk(KERN_ERR "Can not assign IRQ number to MV643XX_eth%d\n",
                                                                port_num);
index 4262c1da6d4a883d1fc761f39e06b5629570e2d0..33c5fafdbbd3f2cfae431b9fa03d15f172df0a9b 100644 (file)
@@ -258,7 +258,7 @@ struct pkt_info {
        struct sk_buff *return_info;    /* User resource return information */
 };
 
-/* Ethernet port specific infomation */
+/* Ethernet port specific information */
 
 struct mv643xx_mib_counters {
        u64 good_octets_received;
index dbdf189436fab53b4d1a5fd8fa4a24180b2ef4f6..72aad42db7b46039bce72bd5de9fd7e644752130 100644 (file)
@@ -2413,7 +2413,7 @@ static int myri10ge_resume(struct pci_dev *pdev)
        pci_enable_device(pdev);
        pci_set_master(pdev);
 
-       status = request_irq(pdev->irq, myri10ge_intr, SA_SHIRQ,
+       status = request_irq(pdev->irq, myri10ge_intr, IRQF_SHARED,
                             netdev->name, mgp);
        if (status != 0) {
                dev_err(&pdev->dev, "failed to allocate IRQ\n");
@@ -2694,7 +2694,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                        mgp->msi_enabled = 1;
        }
 
-       status = request_irq(pdev->irq, myri10ge_intr, SA_SHIRQ,
+       status = request_irq(pdev->irq, myri10ge_intr, IRQF_SHARED,
                             netdev->name, mgp);
        if (status != 0) {
                dev_err(&pdev->dev, "failed to allocate IRQ\n");
index d9f616fea3d9a3c9ad637f0904d327e1fb7efbde..1b965a2b56e4fc22e0de85e5a9c2f0fbf60fe5ae 100644 (file)
@@ -7,7 +7,6 @@ static char version[] =
         "myri_sbus.c:v2.0 June 23, 2006 David S. Miller (davem@davemloft.net)\n";
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
@@ -1070,7 +1069,7 @@ static int __init myri_ether_init(struct sbus_dev *sdev)
        /* Register interrupt handler now. */
        DET(("Requesting MYRIcom IRQ line.\n"));
        if (request_irq(dev->irq, &myri_interrupt,
-                       SA_SHIRQ, "MyriCOM Ethernet", (void *) dev)) {
+                       IRQF_SHARED, "MyriCOM Ethernet", (void *) dev)) {
                printk("MyriCOM: Cannot register interrupt handler.\n");
                goto err;
        }
index 5657049c216041faea5c59f61e37898643f14447..9df2628be1e733add4e8b55e92217f52aa0583fa 100644 (file)
        * big endian support with CFG:BEM instead of cpu_to_le32
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
@@ -1575,7 +1574,7 @@ static int netdev_open(struct net_device *dev)
        /* Reset the chip, just in case. */
        natsemi_reset(dev);
 
-       i = request_irq(dev->irq, &intr_handler, SA_SHIRQ, dev->name, dev);
+       i = request_irq(dev->irq, &intr_handler, IRQF_SHARED, dev->name, dev);
        if (i) return i;
 
        if (netif_msg_ifup(np))
index ced9fdb8335cc4225639cf49d67612d066833a31..fa50eb8894089dea2d47bb87fe3f7ca819862b71 100644 (file)
@@ -420,7 +420,7 @@ static int ne2k_pci_set_fdx(struct net_device *dev)
 
 static int ne2k_pci_open(struct net_device *dev)
 {
-       int ret = request_irq(dev->irq, ei_interrupt, SA_SHIRQ, dev->name, dev);
+       int ret = request_irq(dev->irq, ei_interrupt, IRQF_SHARED, dev->name, dev);
        if (ret)
                return ret;
 
index b92430c4e3accfe82a949c1150af0714b3588b6b..b1311ae82675035a6725dece3f017be2b395dd4e 100644 (file)
@@ -223,7 +223,7 @@ static int netx_eth_open(struct net_device *ndev)
        struct netx_eth_priv *priv = netdev_priv(ndev);
 
        if (request_irq
-           (ndev->irq, &netx_eth_interrupt, SA_SHIRQ, ndev->name, ndev))
+           (ndev->irq, &netx_eth_interrupt, IRQF_SHARED, ndev->name, ndev))
                return -EAGAIN;
 
        writel(ndev->dev_addr[0] |
index 706aed7d717f5ec5200a0287476c446cc7e8a901..70429108c40d30e83f16c7d8fadb4e6a026480ea 100644 (file)
@@ -96,7 +96,6 @@
 //#define dprintk              printk
 #define dprintk(x...)          do { } while (0)
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/types.h>
@@ -1882,7 +1881,7 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
 
        dev->IMR_cache = 0;
 
-       err = request_irq(pci_dev->irq, ns83820_irq, SA_SHIRQ,
+       err = request_irq(pci_dev->irq, ns83820_irq, IRQF_SHARED,
                          DRV_NAME, ndev);
        if (err) {
                printk(KERN_INFO "ns83820: unable to register irq %d\n",
index a7bb54df75a89e3bb5d2b0bf9fa348ae3a352f34..3388ee1313ea33dc952bf8cefc2bb085b1f7ed09 100644 (file)
@@ -85,7 +85,6 @@ IVc. Errata
 
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
@@ -1076,7 +1075,7 @@ static int netdrv_open (struct net_device *dev)
 
        DPRINTK ("ENTER\n");
 
-       retval = request_irq (dev->irq, netdrv_interrupt, SA_SHIRQ, dev->name, dev);
+       retval = request_irq (dev->irq, netdrv_interrupt, IRQF_SHARED, dev->name, dev);
        if (retval) {
                DPRINTK ("EXIT, returning %d\n", retval);
                return retval;
index 2ea66aca648b417ae0109ae132921965b9615eb9..297e9f8053663e0efefda780c0d7978669ce5b64 100644 (file)
@@ -535,7 +535,7 @@ static int axnet_open(struct net_device *dev)
 
     link->open++;
 
-    request_irq(dev->irq, ei_irq_wrapper, SA_SHIRQ, "axnet_cs", dev);
+    request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED, "axnet_cs", dev);
 
     info->link_status = 0x00;
     init_timer(&info->watchdog);
index 441de824ab6baeb0b7b1cfffd4f1981f5b1a3774..48434d7924ebaa2943d0475f49028dc30c9b95cb 100644 (file)
@@ -387,7 +387,10 @@ static int com20020_resume(struct pcmcia_device *link)
 }
 
 static struct pcmcia_device_id com20020_ids[] = {
-       PCMCIA_DEVICE_PROD_ID12("Contemporary Control Systems, Inc.", "PCM20 Arcnet Adapter", 0x59991666, 0x95dfffaf),
+       PCMCIA_DEVICE_PROD_ID12("Contemporary Control Systems, Inc.",
+                       "PCM20 Arcnet Adapter", 0x59991666, 0x95dfffaf),
+       PCMCIA_DEVICE_PROD_ID12("SoHard AG",
+                       "SH ARC PCMCIA", 0xf8991729, 0x69dff0c7),
        PCMCIA_DEVICE_NULL
 };
 MODULE_DEVICE_TABLE(pcmcia, com20020_ids);
index 661bfe54ff5d8543f7a0d99b4ecd9adca3afd49f..0ecebfc31f073be959ebf9ca646bd4c6a858b0f2 100644 (file)
@@ -998,7 +998,7 @@ static int pcnet_open(struct net_device *dev)
     link->open++;
 
     set_misc_reg(dev);
-    request_irq(dev->irq, ei_irq_wrapper, SA_SHIRQ, dev_info, dev);
+    request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED, dev_info, dev);
 
     info->phy_id = info->eth_phy;
     info->link_status = 0x00;
index 0e01c75da4296647884603414f9002fea6834e2a..d768f3d1ac28e39c2688896016f173e3589e934b 100644 (file)
@@ -1541,7 +1541,7 @@ static int pcnet32_open(struct net_device *dev)
        unsigned long flags;
 
        if (request_irq(dev->irq, &pcnet32_interrupt,
-                       lp->shared_irq ? SA_SHIRQ : 0, dev->name,
+                       lp->shared_irq ? IRQF_SHARED : 0, dev->name,
                        (void *)dev)) {
                return -EAGAIN;
        }
index 7d8d534255c07f3a53955361b1a1791848362ee3..3efb715c28dcc6f3c45417bba10d71cbf6bab354 100644 (file)
@@ -13,7 +13,6 @@
  * option) any later version.
  *
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/string.h>
index 5e9002e444c52ddc35838e717091388da7d433eb..aa7983f55838b5c844cebccb6f4a8bb5bfe4257f 100644 (file)
@@ -13,7 +13,6 @@
  * option) any later version.
  *
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/string.h>
index 3f702c503afe9377aeddb835c9c9eb7c8707665a..69d2325f848c7ee55690f3dc7074cd7bd9142726 100644 (file)
@@ -13,7 +13,6 @@
  * option) any later version.
  *
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/string.h>
index a2d6386d13bcb187e2473ebeb9856108d7fb704d..0ad253282d0d0c8388503efcf7d7e6e9304fbb60 100644 (file)
@@ -13,7 +13,6 @@
  * option) any later version.
  *
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/string.h>
index 1b236bdf6b928d0dafa81c64ddcd3ac679c32e6c..1dde390c164d9952e0324582a1f5e6c80bd64b6d 100644 (file)
@@ -13,7 +13,6 @@
  * option) any later version.
  *
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/string.h>
index 33cec2dab942559f1a4e731f630688bf2ab11a1c..7d5c2233c252fac78c386f6b6e3cc9bc4f21b88e 100644 (file)
@@ -14,7 +14,6 @@
  * option) any later version.
  *
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/string.h>
@@ -557,7 +556,7 @@ int phy_start_interrupts(struct phy_device *phydev)
        INIT_WORK(&phydev->phy_queue, phy_change, phydev);
 
        if (request_irq(phydev->irq, phy_interrupt,
-                               SA_SHIRQ,
+                               IRQF_SHARED,
                                "phy_interrupt",
                                phydev) < 0) {
                printk(KERN_WARNING "%s: Can't get IRQ %d (PHY)\n",
index 7da0e3dd5fe3ee44c5830761a77f7a1979e4a203..1bc1e032c5d6c9654912b8b6cdef51658b88cb7d 100644 (file)
@@ -14,7 +14,6 @@
  * option) any later version.
  *
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/string.h>
index 65d995b02b25249d1fcdc18f6e3dd3c636c27266..2b50e1739aa54deaa3ebae7105d3ea866769b377 100644 (file)
@@ -13,7 +13,6 @@
  * option) any later version.
  *
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/string.h>
index 425ff5b117f1c3e2da4338ee44e9dbce25f318fe..0ec6e9d57b9499d438c9cf1838a212238e261a09 100644 (file)
@@ -22,7 +22,6 @@
  * ==FILEVERSION 20041108==
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/kmod.h>
index 1985d1b57c45360b8a889430792c6934a0120e51..51ff9a9d1bb5fb8ad43c12f19660115d7aeb013a 100644 (file)
@@ -43,7 +43,6 @@
  *                    deprecated in 2.6
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/version.h>
index 12d1cb289bb0849ee6bae315a48492595b9261fb..16a0ef1b1369cd27cad05af34fca13dcc7886b0a 100644 (file)
@@ -1726,7 +1726,7 @@ static int rtl8169_open(struct net_device *dev)
        rtl8169_set_rxbufsize(tp, dev);
 
        retval =
-           request_irq(dev->irq, rtl8169_interrupt, SA_SHIRQ, dev->name, dev);
+           request_irq(dev->irq, rtl8169_interrupt, IRQF_SHARED, dev->name, dev);
        if (retval < 0)
                goto out;
 
index 19c2df9c86fe9bc6902dc306ae0ef691505e746f..c3ed734cbe39cdabd5713c5c1e2214e9827b9513 100644 (file)
@@ -28,7 +28,6 @@
 #define RX_DMA_SKBUFF 1
 #define PKT_COPY_THRESHOLD 512
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/errno.h>
@@ -1253,7 +1252,7 @@ static int rr_open(struct net_device *dev)
        readl(&regs->HostCtrl);
        spin_unlock_irqrestore(&rrpriv->lock, flags);
 
-       if (request_irq(dev->irq, rr_interrupt, SA_SHIRQ, dev->name, dev)) {
+       if (request_irq(dev->irq, rr_interrupt, IRQF_SHARED, dev->name, dev)) {
                printk(KERN_WARNING "%s: Requested IRQ %d is busy\n",
                       dev->name, dev->irq);
                ecode = -EAGAIN;
index 10baae55953a40afdb45bd71d1e75bb2972aff6f..2c3c91ebd99f01c95d7d827460f5225c0fe401b0 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _RRUNNER_H_
 #define _RRUNNER_H_
 
-#include <linux/config.h>
 #include <linux/interrupt.h>
 
 #if ((BITS_PER_LONG != 32) && (BITS_PER_LONG != 64))
index 3defe5d4f7d3ea19004b21d39081e2a9c0b10572..c6b77acb35ef88ace82eb594e96adc6394cb1b4e 100644 (file)
@@ -44,7 +44,6 @@
  *     aggregated as a single large packet
  ************************************************************************/
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/errno.h>
@@ -3762,7 +3761,7 @@ static int s2io_open(struct net_device *dev)
        /* After proper initialization of H/W, register ISR */
        if (sp->intr_type == MSI) {
                err = request_irq((int) sp->pdev->irq, s2io_msi_handle, 
-                       SA_SHIRQ, sp->name, dev);
+                       IRQF_SHARED, sp->name, dev);
                if (err) {
                        DBG_PRINT(ERR_DBG, "%s: MSI registration \
 failed\n", dev->name);
@@ -3800,7 +3799,7 @@ failed\n", dev->name, i);
                }
        }
        if (sp->intr_type == INTA) {
-               err = request_irq((int) sp->pdev->irq, s2io_isr, SA_SHIRQ,
+               err = request_irq((int) sp->pdev->irq, s2io_isr, IRQF_SHARED,
                                sp->name, dev);
                if (err) {
                        DBG_PRINT(ERR_DBG, "%s: ISR registration failed\n",
@@ -3960,7 +3959,7 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
        txdp->Control_2 = 0;
 #ifdef NETIF_F_TSO
        mss = skb_shinfo(skb)->gso_size;
-       if (skb_shinfo(skb)->gso_type == SKB_GSO_TCPV4) {
+       if (skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)) {
                txdp->Control_1 |= TXD_TCP_LSO_EN;
                txdp->Control_1 |= TXD_TCP_LSO_MSS(mss);
        }
@@ -3980,7 +3979,7 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
        }
 
        frg_len = skb->len - skb->data_len;
-       if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4) {
+       if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP) {
                int ufo_size;
 
                ufo_size = skb_shinfo(skb)->gso_size;
@@ -4009,7 +4008,7 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
        txdp->Host_Control = (unsigned long) skb;
        txdp->Control_1 |= TXD_BUFFER0_SIZE(frg_len);
 
-       if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4)
+       if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP)
                txdp->Control_1 |= TXD_UFO_EN;
 
        frg_cnt = skb_shinfo(skb)->nr_frags;
@@ -4024,12 +4023,12 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
                    (sp->pdev, frag->page, frag->page_offset,
                     frag->size, PCI_DMA_TODEVICE);
                txdp->Control_1 = TXD_BUFFER0_SIZE(frag->size);
-               if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4)
+               if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP)
                        txdp->Control_1 |= TXD_UFO_EN;
        }
        txdp->Control_1 |= TXD_GATHER_CODE_LAST;
 
-       if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4)
+       if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP)
                frg_cnt++; /* as Txd0 was used for inband header */
 
        tx_fifo = mac_control->tx_FIFO_start[queue];
@@ -4043,7 +4042,7 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
        if (mss)
                val64 |= TX_FIFO_SPECIAL_FUNC;
 #endif
-       if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4)
+       if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP)
                val64 |= TX_FIFO_SPECIAL_FUNC;
        writeq(val64, &tx_fifo->List_Control);
 
@@ -7020,6 +7019,9 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
                dev->features |= NETIF_F_HIGHDMA;
 #ifdef NETIF_F_TSO
        dev->features |= NETIF_F_TSO;
+#endif
+#ifdef NETIF_F_TSO6
+       dev->features |= NETIF_F_TSO6;
 #endif
        if (sp->device_type & XFRAME_II_DEVICE) {
                dev->features |= NETIF_F_UFO;
index 3203732a668d81357353dd0e1c19511dadeef02c..c43f5217970833278ce36f80894fff52cf6cd2c3 100644 (file)
@@ -652,7 +652,7 @@ typedef struct fifo_info {
        nic_t *nic;
 }fifo_info_t;
 
-/* Infomation related to the Tx and Rx FIFOs and Rings of Xena
+/* Information related to the Tx and Rx FIFOs and Rings of Xena
  * is maintained in this structure.
  */
 typedef struct mac_info {
index f2be9f83f09172b7a02ab530f3dc7d4b518ffe27..9ab1618e82a4a9e2a1ce1cfc0a39ec4bd921ceae 100644 (file)
@@ -31,7 +31,6 @@
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
 #include <linux/init.h>
-#include <linux/config.h>
 #include <linux/bitops.h>
 #include <asm/processor.h>             /* Processor type for cache alignment. */
 #include <asm/io.h>
@@ -2451,7 +2450,7 @@ static int sbmac_open(struct net_device *dev)
         */
 
        __raw_readq(sc->sbm_isr);
-       if (request_irq(dev->irq, &sbmac_intr, SA_SHIRQ, dev->name, dev))
+       if (request_irq(dev->irq, &sbmac_intr, IRQF_SHARED, dev->name, dev))
                return -EBUSY;
 
        /*
index 88e212043a43969cd0b9ea1447fe7265f10deb58..c7832e69f1776b02e0958f4a06a300f07ade5edd 100644 (file)
@@ -69,7 +69,6 @@
  *                              2000/03 Andi Kleen
  */
  
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/fcntl.h>
index df39f34476550613891392a24e4df5e854a626ca..df0cbebb3277ac69a167ef62154ab2ccf00a33ce 100644 (file)
@@ -1054,7 +1054,7 @@ static int sis190_open(struct net_device *dev)
 
        sis190_request_timer(dev);
 
-       rc = request_irq(dev->irq, sis190_interrupt, SA_SHIRQ, dev->name, dev);
+       rc = request_irq(dev->irq, sis190_interrupt, IRQF_SHARED, dev->name, dev);
        if (rc < 0)
                goto err_release_timer_2;
 
index d058741722091c3555f1b3cf0f399c0a67b83a6e..29ee7ffedfff0f060dd3dfd8b3423d8af71ba7b1 100644 (file)
@@ -1013,7 +1013,7 @@ sis900_open(struct net_device *net_dev)
        /* Equalizer workaround Rule */
        sis630_set_eq(net_dev, sis_priv->chipset_rev);
 
-       ret = request_irq(net_dev->irq, &sis900_interrupt, SA_SHIRQ,
+       ret = request_irq(net_dev->irq, &sis900_interrupt, IRQF_SHARED,
                                                net_dev->name, net_dev);
        if (ret)
                return ret;
index f3efbd177ae7deda0b3a72979655f87a0a1d418d..ee62845d3ac9d9140eea0e2a8c0e801ce75a9682 100644 (file)
@@ -570,9 +570,9 @@ SK_BOOL     DualNet;
        spin_unlock_irqrestore(&pAC->SlowPathLock, Flags);
 
        if (pAC->GIni.GIMacsFound == 2) {
-                Ret = request_irq(dev->irq, SkGeIsr, SA_SHIRQ, "sk98lin", dev);
+                Ret = request_irq(dev->irq, SkGeIsr, IRQF_SHARED, "sk98lin", dev);
        } else if (pAC->GIni.GIMacsFound == 1) {
-               Ret = request_irq(dev->irq, SkGeIsrOnePort, SA_SHIRQ,
+               Ret = request_irq(dev->irq, SkGeIsrOnePort, IRQF_SHARED,
                        "sk98lin", dev);
        } else {
                printk(KERN_WARNING "sk98lin: Illegal number of ports: %d\n",
@@ -5073,9 +5073,9 @@ static int skge_resume(struct pci_dev *pdev)
        pci_enable_device(pdev);
        pci_set_master(pdev);
        if (pAC->GIni.GIMacsFound == 2)
-               ret = request_irq(dev->irq, SkGeIsr, SA_SHIRQ, "sk98lin", dev);
+               ret = request_irq(dev->irq, SkGeIsr, IRQF_SHARED, "sk98lin", dev);
        else
-               ret = request_irq(dev->irq, SkGeIsrOnePort, SA_SHIRQ, "sk98lin", dev);
+               ret = request_irq(dev->irq, SkGeIsrOnePort, IRQF_SHARED, "sk98lin", dev);
        if (ret) {
                printk(KERN_WARNING "sk98lin: unable to acquire IRQ %d\n", dev->irq);
                pAC->AllocFlag &= ~SK_ALLOC_IRQ;
index 17786056c66a9ebbc10b0322b3903fc86e8986df..1e662aaebf84a3c32c624d67f18b49bbc053a9ba 100644 (file)
@@ -22,7 +22,7 @@
  ******************************************************************************/
 
 /*
-       Please refer skvpd.txt for infomation how to include this module
+       Please refer skvpd.txt for information how to include this module
  */
 static const char SysKonnectFileId[] =
        "@(#)$Id: skvpd.c,v 1.37 2003/01/13 10:42:45 rschmidt Exp $ (C) SK";
index e5d6d95960c7b76a1c746e247170545fcf7ba4f7..799e0980193438ed599992b63b8d5997638dec57 100644 (file)
@@ -824,7 +824,7 @@ static int skmca_open(struct net_device *dev)
        /* register resources - only necessary for IRQ */
        result =
            request_irq(priv->realirq, irq_handler,
-                       SA_SHIRQ | SA_SAMPLE_RANDOM, "sk_mca", dev);
+                       IRQF_SHARED | IRQF_SAMPLE_RANDOM, "sk_mca", dev);
        if (result != 0) {
                printk("%s: failed to register irq %d\n", dev->name,
                       dev->irq);
index df716cd5784a8028feac830603b4d3b177b6ed8e..638cf0283bc402be20f1499aed914751c3d84591 100644 (file)
@@ -13,7 +13,7 @@
  ******************************************************************************/
 
 /*
- * Synchronous Bandwith Allocation (SBA) structs
+ * Synchronous Bandwidth Allocation (SBA) structs
  */
  
 #ifndef _SBA_
index c7fb6133047e097a9f0030570c5661d12825664a..b5714a60237d91ea37b874878d6835d60ade2fd5 100644 (file)
@@ -497,7 +497,7 @@ static int skfp_open(struct net_device *dev)
 
        PRINTK(KERN_INFO "entering skfp_open\n");
        /* Register IRQ - support shared interrupts by passing device ptr */
-       err = request_irq(dev->irq, (void *) skfp_interrupt, SA_SHIRQ,
+       err = request_irq(dev->irq, (void *) skfp_interrupt, IRQF_SHARED,
                          dev->name, dev);
        if (err)
                return err;
index 1608efab4e3de39c914dfb964dfbd767a2ccea4b..82200bfaa8ed2bb5bef5ea7f959d1a183887f234 100644 (file)
@@ -24,7 +24,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/in.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -3342,7 +3341,7 @@ static int __devinit skge_probe(struct pci_dev *pdev,
                goto err_out_free_hw;
        }
 
-       err = request_irq(pdev->irq, skge_intr, SA_SHIRQ, DRV_NAME, hw);
+       err = request_irq(pdev->irq, skge_intr, IRQF_SHARED, DRV_NAME, hw);
        if (err) {
                printk(KERN_ERR PFX "%s: cannot assign irq %d\n",
                       pci_name(pdev), pdev->irq);
index e122007e16da08b599d5644a503f34b2f359758f..418f169a6a31e9f964964467b142e7691e7985ec 100644 (file)
@@ -23,7 +23,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/crc32.h>
 #include <linux/kernel.h>
 #include <linux/version.h>
@@ -3189,7 +3188,7 @@ static int __devinit sky2_test_msi(struct sky2_hw *hw)
 
        sky2_write32(hw, B0_IMSK, Y2_IS_IRQ_SW);
 
-       err = request_irq(pdev->irq, sky2_test_intr, SA_SHIRQ, DRV_NAME, hw);
+       err = request_irq(pdev->irq, sky2_test_intr, IRQF_SHARED, DRV_NAME, hw);
        if (err) {
                printk(KERN_ERR PFX "%s: cannot assign irq %d\n",
                       pci_name(pdev), pdev->irq);
@@ -3349,7 +3348,7 @@ static int __devinit sky2_probe(struct pci_dev *pdev,
                        goto err_out_unregister;
        }
 
-       err = request_irq(pdev->irq,  sky2_intr, SA_SHIRQ, DRV_NAME, hw);
+       err = request_irq(pdev->irq,  sky2_intr, IRQF_SHARED, DRV_NAME, hw);
        if (err) {
                printk(KERN_ERR PFX "%s: cannot assign irq %d\n",
                       pci_name(pdev), pdev->irq);
index c6fbb1ede0ed23e66dbd6a1941a145689622cef6..3a1b7131681cd5fa5c9313cdde005d0b0faa76fa 100644 (file)
@@ -50,7 +50,6 @@
  *     driver code belonging close to PPP and SLIP
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/string.h>
index b2e18d28850d6b45e27916553408ff5b23c580a9..1588cb7f6c835ecd2bed3c9204fe7230cfe9a09e 100644 (file)
@@ -55,7 +55,6 @@
  */
 
 #define SL_CHECK_TRANSMIT
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 
index ab3efe66a642d0c363912251f4650a0fe0246dd1..29d87dd45a24ea3e77cc4b72503f66d7832667ac 100644 (file)
@@ -22,7 +22,6 @@
 #ifndef _LINUX_SLIP_H
 #define _LINUX_SLIP_H
 
-#include <linux/config.h>
 
 #if defined(CONFIG_INET) && defined(CONFIG_SLIP_COMPRESSED)
 # define SL_INCLUDE_CSLIP
index 5b4e8529d4ab756f19d46de14cb755a23801a03a..45449353a95808161aa35aeb30609e52b21cda07 100644 (file)
@@ -57,7 +57,6 @@
 static const char version[] =
        "smc-ultra.c:v2.02 2/3/98 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index ff9bd97746dcb67d0a4dafeb30a782d2b025cfac..85be22a05973027782f17e243b9b891a2e736d73 100644 (file)
@@ -290,7 +290,7 @@ out:
 static int ultra32_open(struct net_device *dev)
 {
        int ioaddr = dev->base_addr - ULTRA32_NIC_OFFSET; /* ASIC addr */
-       int irq_flags = (inb(ioaddr + ULTRA32_CFG5) & 0x08) ? 0 : SA_SHIRQ;
+       int irq_flags = (inb(ioaddr + ULTRA32_CFG5) & 0x08) ? 0 : IRQF_SHARED;
        int retval;
 
        retval = request_irq(dev->irq, ei_interrupt, irq_flags, dev->name, dev);
index bdd8702ead54578b300e1821604b3117403d3127..d37bd860b336937c8f50645efec075a581283673 100644 (file)
@@ -2081,7 +2081,7 @@ static int __init smc911x_probe(struct net_device *dev, unsigned long ioaddr)
        lp->ctl_rspeed = 100;
 
        /* Grab the IRQ */
-       retval = request_irq(dev->irq, &smc911x_interrupt, SA_SHIRQ, dev->name, dev);
+       retval = request_irq(dev->irq, &smc911x_interrupt, IRQF_SHARED, dev->name, dev);
        if (retval)
                goto err_out;
 
index 0e9833adf9feafe09303db8c73f38adde2a69ea9..3d8dcb6c8758f32eff96fcaf905374a6105d6427 100644 (file)
@@ -66,7 +66,6 @@ static const char version[] =
 #endif
 
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
index bf776125ca38c86bab8e3468085aca9de4941194..b4028049ed764215b07255f40d111e61ae49f6c4 100644 (file)
@@ -207,7 +207,7 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg)
                   machine_is_omap_h2() \
                || machine_is_omap_h3() \
                || (machine_is_omap_innovator() && !cpu_is_omap1510()) \
-       ) ? SA_TRIGGER_FALLING : SA_TRIGGER_RISING)
+       ) ? IRQF_TRIGGER_FALLING : IRQF_TRIGGER_RISING)
 
 
 #elif  defined(CONFIG_SH_SH4202_MICRODEV)
@@ -540,7 +540,7 @@ smc_pxa_dma_irq(int dma, void *dummy, struct pt_regs *regs)
 #endif
 
 #ifndef        SMC_IRQ_FLAGS
-#define        SMC_IRQ_FLAGS           SA_TRIGGER_RISING
+#define        SMC_IRQ_FLAGS           IRQF_TRIGGER_RISING
 #endif
 
 #ifndef SMC_INTERRUPT_PREAMBLE
index cede969a8baae88fcfc0a8083a049999d84cb11d..7f5c4ebcc17a4ab4ced55fc0b814bf03fa61f469 100644 (file)
@@ -22,7 +22,6 @@
 #ifndef SONIC_H
 #define SONIC_H
 
-#include <linux/config.h>
 
 /*
  * SONIC register offsets
index 394339d5e87c0494c300fad7f60eaf9984e8c78f..fb1d5a8a45cf996c47623402b9a406dd7df8fa56 100644 (file)
@@ -21,7 +21,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/compiler.h>
 #include <linux/crc32.h>
 #include <linux/delay.h>
@@ -1745,7 +1744,7 @@ spider_net_open(struct net_device *netdev)
 
        result = -EBUSY;
        if (request_irq(netdev->irq, spider_net_interrupt,
-                            SA_SHIRQ, netdev->name, netdev))
+                            IRQF_SHARED, netdev->name, netdev))
                goto register_int_failed;
 
        spider_net_enable_card(card);
index c158eedc78135d60fd1b01456f10aaa394238bf2..ed1f59901ff4e08fff80d45b85ade4f0d277f24c 100644 (file)
@@ -146,7 +146,6 @@ TODO:       - fix forced speed/duplexing code (broken a long time ago, when
 #define DRV_VERSION    "1.03+LK1.4.2.1"
 #define DRV_RELDATE    "October 3, 2005"
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
@@ -1071,7 +1070,7 @@ static int netdev_open(struct net_device *dev)
 
        /* Do we ever need to reset the chip??? */
 
-       retval = request_irq(dev->irq, &intr_handler, SA_SHIRQ, dev->name, dev);
+       retval = request_irq(dev->irq, &intr_handler, IRQF_SHARED, dev->name, dev);
        if (retval)
                return retval;
 
index b6dfdf8f44dac25b83f9c5cd82775cb4bb96853b..74228348995d2425b9c6dbca7fb594b64baae40b 100644 (file)
@@ -7,7 +7,6 @@
  * Copyright (C) 1999 kaz Kojima
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index a2fad50437e67a319a7e727ef6a6c42400824747..2dcadb169a22ef562a8476e0bd7274fdb36894a2 100644 (file)
@@ -341,7 +341,7 @@ static int __init lance_probe( struct net_device *dev)
 
        REGA(CSR0) = CSR0_STOP; 
 
-       request_irq(LANCE_IRQ, lance_interrupt, SA_INTERRUPT, "SUN3 Lance", dev);
+       request_irq(LANCE_IRQ, lance_interrupt, IRQF_DISABLED, "SUN3 Lance", dev);
        dev->irq = (unsigned short)LANCE_IRQ;
 
 
index 7127f0f36f0e9d64e23003a6707e4c0f0294cc15..d46891510767578425bbc80a348223817e075f98 100644 (file)
@@ -918,7 +918,7 @@ static int bigmac_open(struct net_device *dev)
        struct bigmac *bp = (struct bigmac *) dev->priv;
        int ret;
 
-       ret = request_irq(dev->irq, &bigmac_interrupt, SA_SHIRQ, dev->name, bp);
+       ret = request_irq(dev->irq, &bigmac_interrupt, IRQF_SHARED, dev->name, bp);
        if (ret) {
                printk(KERN_ERR "BIGMAC: Can't order irq %d to go.\n", dev->irq);
                return ret;
index f13b2a195c708fe32d8c53d05988875a51bd52e1..643fceae3db5d8eb6a00686d39c37f56b3724725 100644 (file)
@@ -870,7 +870,7 @@ static int netdev_open(struct net_device *dev)
 
        /* Do we need to reset the chip??? */
 
-       i = request_irq(dev->irq, &intr_handler, SA_SHIRQ, dev->name, dev);
+       i = request_irq(dev->irq, &intr_handler, IRQF_SHARED, dev->name, dev);
        if (i)
                return i;
 
index 5248670d29f70e33c2af87939985b3c3c72cd4c4..b70bbd7489789f826fd969262dfa16912b565e65 100644 (file)
@@ -2220,7 +2220,7 @@ static int gem_do_start(struct net_device *dev)
        spin_unlock_irqrestore(&gp->lock, flags);
 
        if (request_irq(gp->pdev->irq, gem_interrupt,
-                                  SA_SHIRQ, dev->name, (void *)dev)) {
+                                  IRQF_SHARED, dev->name, (void *)dev)) {
                printk(KERN_ERR "%s: failed to request irq !\n", gp->dev->name);
 
                spin_lock_irqsave(&gp->lock, flags);
index 9282b4b0c0229e0f86b6f779c02d52189e34f8e8..278c7cb222162dc939c28a9594ef58615db90ca7 100644 (file)
@@ -19,7 +19,6 @@
  *    of darwin, still need to reverse engineer that
  */
 
-#include <linux/config.h>
 
 #include <linux/module.h>
 
index 9b246e44f7562cc3b1d3a6519487464b443236cc..8673fd4c08c7bfe76e5027a078d949a472fd0c78 100644 (file)
@@ -13,7 +13,6 @@
  *     argument : macaddr=0x00,0x10,0x20,0x30,0x40,0x50
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
@@ -2195,7 +2194,7 @@ static int happy_meal_open(struct net_device *dev)
         */
        if ((hp->happy_flags & (HFLAG_QUATTRO|HFLAG_PCI)) != HFLAG_QUATTRO) {
                if (request_irq(dev->irq, &happy_meal_interrupt,
-                               SA_SHIRQ, dev->name, (void *)dev)) {
+                               IRQF_SHARED, dev->name, (void *)dev)) {
                        HMD(("EAGAIN\n"));
                        printk(KERN_ERR "happy_meal(SBUS): Can't order irq %d to go.\n",
                               dev->irq);
@@ -2609,7 +2608,7 @@ static void __init quattro_sbus_register_irqs(void)
 
                err = request_irq(sdev->irqs[0],
                                  quattro_sbus_interrupt,
-                                 SA_SHIRQ, "Quattro",
+                                 IRQF_SHARED, "Quattro",
                                  qp);
                if (err != 0) {
                        printk(KERN_ERR "Quattro: Fatal IRQ registery error %d.\n", err);
index 9b7ccaeeee89f2bc87229c0d70186946b4049297..90f446db9ba21cac02d0f2fec0c5bf8ad8c3e650 100644 (file)
@@ -8,7 +8,6 @@
 #ifndef _SUNHME_H
 #define _SUNHME_H
 
-#include <linux/config.h>
 #include <linux/pci.h>
 
 /* Happy Meal global registers. */
index 2c239ab63a80e1877df202cb88fd8116a2bd9d87..1ef9fd39a79a9cfc3b1dacb6235088a0c0525e5d 100644 (file)
@@ -71,7 +71,6 @@
 
 static char lancestr[] = "LANCE";
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
@@ -931,7 +930,7 @@ static int lance_open(struct net_device *dev)
 
        STOP_LANCE(lp);
 
-       if (request_irq(dev->irq, &lance_interrupt, SA_SHIRQ,
+       if (request_irq(dev->irq, &lance_interrupt, IRQF_SHARED,
                        lancestr, (void *) dev)) {
                printk(KERN_ERR "Lance: Can't get irq %d\n", dev->irq);
                return -EAGAIN;
index 9da6d5b87173186987dadda983fe18abb16a955c..817a40b66638a2c268060dbd2cf0e54539b6bf91 100644 (file)
@@ -811,7 +811,7 @@ static struct sunqec * __init get_qec(struct sbus_dev *child_sdev)
                        qec_init_once(qecp, qec_sdev);
 
                        if (request_irq(qec_sdev->irqs[0], &qec_interrupt,
-                                       SA_SHIRQ, "qec", (void *) qecp)) {
+                                       IRQF_SHARED, "qec", (void *) qecp)) {
                                printk(KERN_ERR "qec: Can't register irq.\n");
                                goto fail;
                        }
index c2ec9fd8c31d1c3cb3ddbed9cf9167c12c1c4d26..8b53ded66d3714ba16541c3e475868edd5b1d60b 100644 (file)
@@ -880,7 +880,7 @@ tc35815_open(struct net_device *dev)
         */
 
        if (dev->irq == 0  ||
-           request_irq(dev->irq, &tc35815_interrupt, SA_SHIRQ, cardname, dev)) {
+           request_irq(dev->irq, &tc35815_interrupt, IRQF_SHARED, cardname, dev)) {
                return -EAGAIN;
        }
 
index 35f931638750cd333d376e0928ad5fd844e39866..f645921aff8bac752fb476291ed660ee59dcab4e 100644 (file)
@@ -15,7 +15,6 @@
  *     notice is accompanying it.
  */
 
-#include <linux/config.h>
 
 #include <linux/module.h>
 #include <linux/moduleparam.h>
@@ -69,8 +68,8 @@
 
 #define DRV_MODULE_NAME                "tg3"
 #define PFX DRV_MODULE_NAME    ": "
-#define DRV_MODULE_VERSION     "3.60"
-#define DRV_MODULE_RELDATE     "June 17, 2006"
+#define DRV_MODULE_VERSION     "3.62"
+#define DRV_MODULE_RELDATE     "June 30, 2006"
 
 #define TG3_DEF_MAC_MODE       0
 #define TG3_DEF_RX_MODE                0
@@ -3195,7 +3194,7 @@ static int tg3_vlan_rx(struct tg3 *tp, struct sk_buff *skb, u16 vlan_tag)
  */
 static int tg3_rx(struct tg3 *tp, int budget)
 {
-       u32 work_mask;
+       u32 work_mask, rx_std_posted = 0;
        u32 sw_idx = tp->rx_rcb_ptr;
        u16 hw_idx;
        int received;
@@ -3222,6 +3221,7 @@ static int tg3_rx(struct tg3 *tp, int budget)
                                                  mapping);
                        skb = tp->rx_std_buffers[desc_idx].skb;
                        post_ptr = &tp->rx_std_ptr;
+                       rx_std_posted++;
                } else if (opaque_key == RXD_OPAQUE_RING_JUMBO) {
                        dma_addr = pci_unmap_addr(&tp->rx_jumbo_buffers[desc_idx],
                                                  mapping);
@@ -3309,6 +3309,15 @@ static int tg3_rx(struct tg3 *tp, int budget)
 
 next_pkt:
                (*post_ptr)++;
+
+               if (unlikely(rx_std_posted >= tp->rx_std_max_post)) {
+                       u32 idx = *post_ptr % TG3_RX_RING_SIZE;
+
+                       tw32_rx_mbox(MAILBOX_RCV_STD_PROD_IDX +
+                                    TG3_64BIT_REG_LOW, idx);
+                       work_mask &= ~RXD_OPAQUE_RING_STD;
+                       rx_std_posted = 0;
+               }
 next_pkt_nopost:
                sw_idx++;
                sw_idx %= TG3_RX_RCB_RING_SIZE(tp);
@@ -3789,18 +3798,24 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
                        goto out_unlock;
                }
 
-               tcp_opt_len = ((skb->h.th->doff - 5) * 4);
-               ip_tcp_len = (skb->nh.iph->ihl * 4) + sizeof(struct tcphdr);
+               if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6)
+                       mss |= (skb_headlen(skb) - ETH_HLEN) << 9;
+               else {
+                       tcp_opt_len = ((skb->h.th->doff - 5) * 4);
+                       ip_tcp_len = (skb->nh.iph->ihl * 4) +
+                                    sizeof(struct tcphdr);
+
+                       skb->nh.iph->check = 0;
+                       skb->nh.iph->tot_len = htons(mss + ip_tcp_len +
+                                                    tcp_opt_len);
+                       mss |= (ip_tcp_len + tcp_opt_len) << 9;
+               }
 
                base_flags |= (TXD_FLAG_CPU_PRE_DMA |
                               TXD_FLAG_CPU_POST_DMA);
 
-               skb->nh.iph->check = 0;
-               skb->nh.iph->tot_len = htons(mss + ip_tcp_len + tcp_opt_len);
-
                skb->h.th->check = 0;
 
-               mss |= (ip_tcp_len + tcp_opt_len) << 9;
        }
        else if (skb->ip_summed == CHECKSUM_HW)
                base_flags |= TXD_FLAG_TCPUDP_CSUM;
@@ -3870,6 +3885,40 @@ out_unlock:
        return NETDEV_TX_OK;
 }
 
+#if TG3_TSO_SUPPORT != 0
+static int tg3_start_xmit_dma_bug(struct sk_buff *, struct net_device *);
+
+/* Use GSO to workaround a rare TSO bug that may be triggered when the
+ * TSO header is greater than 80 bytes.
+ */
+static int tg3_tso_bug(struct tg3 *tp, struct sk_buff *skb)
+{
+       struct sk_buff *segs, *nskb;
+
+       /* Estimate the number of fragments in the worst case */
+       if (unlikely(TX_BUFFS_AVAIL(tp) <= (skb_shinfo(skb)->gso_segs * 3))) {
+               netif_stop_queue(tp->dev);
+               return NETDEV_TX_BUSY;
+       }
+
+       segs = skb_gso_segment(skb, tp->dev->features & ~NETIF_F_TSO);
+       if (unlikely(IS_ERR(segs)))
+               goto tg3_tso_bug_end;
+
+       do {
+               nskb = segs;
+               segs = segs->next;
+               nskb->next = NULL;
+               tg3_start_xmit_dma_bug(nskb, tp->dev);
+       } while (segs);
+
+tg3_tso_bug_end:
+       dev_kfree_skb(skb);
+
+       return NETDEV_TX_OK;
+}
+#endif
+
 /* hard_start_xmit for devices that have the 4G bug and/or 40-bit bug and
  * support TG3_FLG2_HW_TSO_1 or firmware TSO only.
  */
@@ -3906,7 +3955,7 @@ static int tg3_start_xmit_dma_bug(struct sk_buff *skb, struct net_device *dev)
        mss = 0;
        if (skb->len > (tp->dev->mtu + ETH_HLEN) &&
            (mss = skb_shinfo(skb)->gso_size) != 0) {
-               int tcp_opt_len, ip_tcp_len;
+               int tcp_opt_len, ip_tcp_len, hdr_len;
 
                if (skb_header_cloned(skb) &&
                    pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) {
@@ -3917,11 +3966,16 @@ static int tg3_start_xmit_dma_bug(struct sk_buff *skb, struct net_device *dev)
                tcp_opt_len = ((skb->h.th->doff - 5) * 4);
                ip_tcp_len = (skb->nh.iph->ihl * 4) + sizeof(struct tcphdr);
 
+               hdr_len = ip_tcp_len + tcp_opt_len;
+               if (unlikely((ETH_HLEN + hdr_len) > 80) &&
+                            (tp->tg3_flags2 & TG3_FLG2_HW_TSO_1_BUG))
+                       return (tg3_tso_bug(tp, skb));
+
                base_flags |= (TXD_FLAG_CPU_PRE_DMA |
                               TXD_FLAG_CPU_POST_DMA);
 
                skb->nh.iph->check = 0;
-               skb->nh.iph->tot_len = htons(mss + ip_tcp_len + tcp_opt_len);
+               skb->nh.iph->tot_len = htons(mss + hdr_len);
                if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) {
                        skb->h.th->check = 0;
                        base_flags &= ~TXD_FLAG_TCPUDP_CSUM;
@@ -5981,7 +6035,13 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
        }
 
        /* Setup replenish threshold. */
-       tw32(RCVBDI_STD_THRESH, tp->rx_pending / 8);
+       val = tp->rx_pending / 8;
+       if (val == 0)
+               val = 1;
+       else if (val > tp->rx_std_max_post)
+               val = tp->rx_std_max_post;
+
+       tw32(RCVBDI_STD_THRESH, val);
 
        /* Initialize TG3_BDINFO's at:
         *  RCVDBDI_STD_BD:     standard eth size rx ring
@@ -6141,8 +6201,12 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
 #endif
 
        /* Receive/send statistics. */
-       if ((rdmac_mode & RDMAC_MODE_FIFO_SIZE_128) &&
-           (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE)) {
+       if (tp->tg3_flags2 & TG3_FLG2_5750_PLUS) {
+               val = tr32(RCVLPC_STATS_ENABLE);
+               val &= ~RCVLPC_STATSENAB_DACK_FIX;
+               tw32(RCVLPC_STATS_ENABLE, val);
+       } else if ((rdmac_mode & RDMAC_MODE_FIFO_SIZE_128) &&
+                  (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE)) {
                val = tr32(RCVLPC_STATS_ENABLE);
                val &= ~RCVLPC_STATSENAB_LNGBRST_RFIX;
                tw32(RCVLPC_STATS_ENABLE, val);
@@ -6644,12 +6708,12 @@ static int tg3_request_irq(struct tg3 *tp)
                fn = tg3_msi;
                if (tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI)
                        fn = tg3_msi_1shot;
-               flags = SA_SAMPLE_RANDOM;
+               flags = IRQF_SAMPLE_RANDOM;
        } else {
                fn = tg3_interrupt;
                if (tp->tg3_flags & TG3_FLAG_TAGGED_STATUS)
                        fn = tg3_interrupt_tagged;
-               flags = SA_SHIRQ | SA_SAMPLE_RANDOM;
+               flags = IRQF_SHARED | IRQF_SAMPLE_RANDOM;
        }
        return (request_irq(tp->pdev->irq, fn, flags, dev->name, dev));
 }
@@ -6668,7 +6732,7 @@ static int tg3_test_interrupt(struct tg3 *tp)
        free_irq(tp->pdev->irq, dev);
 
        err = request_irq(tp->pdev->irq, tg3_test_isr,
-                         SA_SHIRQ | SA_SAMPLE_RANDOM, dev->name, dev);
+                         IRQF_SHARED | IRQF_SAMPLE_RANDOM, dev->name, dev);
        if (err)
                return err;
 
@@ -7829,6 +7893,12 @@ static int tg3_set_tso(struct net_device *dev, u32 value)
                        return -EINVAL;
                return 0;
        }
+       if (tp->tg3_flags2 & TG3_FLG2_HW_TSO_2) {
+               if (value)
+                       dev->features |= NETIF_F_TSO6;
+               else
+                       dev->features &= ~NETIF_F_TSO6;
+       }
        return ethtool_op_set_tso(dev, value);
 }
 #endif
@@ -8738,6 +8808,9 @@ static void tg3_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
 {
        struct tg3 *tp = netdev_priv(dev);
 
+       if (netif_running(dev))
+               tg3_netif_stop(tp);
+
        tg3_full_lock(tp, 0);
 
        tp->vlgrp = grp;
@@ -8746,16 +8819,25 @@ static void tg3_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
        __tg3_set_rx_mode(dev);
 
        tg3_full_unlock(tp);
+
+       if (netif_running(dev))
+               tg3_netif_start(tp);
 }
 
 static void tg3_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
 {
        struct tg3 *tp = netdev_priv(dev);
 
+       if (netif_running(dev))
+               tg3_netif_stop(tp);
+
        tg3_full_lock(tp, 0);
        if (tp->vlgrp)
                tp->vlgrp->vlan_devices[vid] = NULL;
        tg3_full_unlock(tp);
+
+       if (netif_running(dev))
+               tg3_netif_start(tp);
 }
 #endif
 
@@ -10160,8 +10242,14 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
                    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787) {
                        tp->tg3_flags2 |= TG3_FLG2_HW_TSO_2;
                        tp->tg3_flags2 |= TG3_FLG2_1SHOT_MSI;
-               } else
-                       tp->tg3_flags2 |= TG3_FLG2_HW_TSO_1;
+               } else {
+                       tp->tg3_flags2 |= TG3_FLG2_HW_TSO_1 |
+                                         TG3_FLG2_HW_TSO_1_BUG;
+                       if (GET_ASIC_REV(tp->pci_chip_rev_id) ==
+                               ASIC_REV_5750 &&
+                           tp->pci_chip_rev_id >= CHIPREV_ID_5750_C2)
+                               tp->tg3_flags2 &= ~TG3_FLG2_HW_TSO_1_BUG;
+               }
        }
 
        if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705 &&
@@ -10533,6 +10621,16 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
            (tp->tg3_flags & TG3_FLAG_PCIX_MODE) != 0)
                tp->rx_offset = 0;
 
+       tp->rx_std_max_post = TG3_RX_RING_SIZE;
+
+       /* Increment the rx prod index on the rx std ring by at most
+        * 8 for these chips to workaround hw errata.
+        */
+       if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750 ||
+           GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5752 ||
+           GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755)
+               tp->rx_std_max_post = 8;
+
        /* By default, disable wake-on-lan.  User can change this
         * using ETHTOOL_SWOL.
         */
@@ -11421,8 +11519,11 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
         * Firmware TSO on older chips gives lower performance, so it
         * is off by default, but can be enabled using ethtool.
         */
-       if (tp->tg3_flags2 & TG3_FLG2_HW_TSO)
+       if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) {
                dev->features |= NETIF_F_TSO;
+               if (tp->tg3_flags2 & TG3_FLG2_HW_TSO_2)
+                       dev->features |= NETIF_F_TSO6;
+       }
 
 #endif
 
index 8209da5dd15fee447c2b989a11215b2f75a8e21b..ba2c98711c88dc9d524f35204652e823b9d4c177 100644 (file)
 #define  CHIPREV_ID_5750_A0             0x4000
 #define  CHIPREV_ID_5750_A1             0x4001
 #define  CHIPREV_ID_5750_A3             0x4003
+#define  CHIPREV_ID_5750_C2             0x4202
 #define  CHIPREV_ID_5752_A0_HW          0x5000
 #define  CHIPREV_ID_5752_A0             0x6000
 #define  CHIPREV_ID_5752_A1             0x6001
 #define  RCVLPC_STATSCTRL_ENABLE        0x00000001
 #define  RCVLPC_STATSCTRL_FASTUPD       0x00000002
 #define RCVLPC_STATS_ENABLE            0x00002018
+#define  RCVLPC_STATSENAB_DACK_FIX      0x00040000
 #define  RCVLPC_STATSENAB_LNGBRST_RFIX  0x00400000
 #define RCVLPC_STATS_INCMASK           0x0000201c
 /* 0x2020 --> 0x2100 unused */
@@ -2137,6 +2139,7 @@ struct tg3 {
        struct tg3_rx_buffer_desc       *rx_std;
        struct ring_info                *rx_std_buffers;
        dma_addr_t                      rx_std_mapping;
+       u32                             rx_std_max_post;
 
        struct tg3_rx_buffer_desc       *rx_jumbo;
        struct ring_info                *rx_jumbo_buffers;
@@ -2191,7 +2194,7 @@ struct tg3 {
 #define TG3_FLAG_INIT_COMPLETE         0x80000000
        u32                             tg3_flags2;
 #define TG3_FLG2_RESTART_TIMER         0x00000001
-/*                                     0x00000002 available */
+#define TG3_FLG2_HW_TSO_1_BUG          0x00000002
 #define TG3_FLG2_NO_ETH_WIRE_SPEED     0x00000004
 #define TG3_FLG2_IS_5788               0x00000008
 #define TG3_FLG2_MAX_RXPEND_64         0x00000010
index 12076f8f942c7d40017bfefbd016f3fe5f3dc710..23c0017f25a91e02f622bb5937a1128a4a952a57 100644 (file)
@@ -943,7 +943,7 @@ static int TLan_Open( struct net_device *dev )
        int             err;
        
        priv->tlanRev = TLan_DioRead8( dev->base_addr, TLAN_DEF_REVISION );
-       err = request_irq( dev->irq, TLan_HandleInterrupt, SA_SHIRQ, TLanSignature, dev );
+       err = request_irq( dev->irq, TLan_HandleInterrupt, IRQF_SHARED, TLanSignature, dev );
        
        if ( err ) {
                printk(KERN_ERR "TLAN:  Cannot open %s because IRQ %d is already in use.\n", dev->name, dev->irq );
index 41e0cd8f478670215bfa71792cecc00625500ee8..465921e3874c933e7e114c71c7d1179b25ffabc5 100644 (file)
@@ -42,7 +42,6 @@
 
 #define XL_DEBUG 0
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -577,7 +576,7 @@ static int xl_open(struct net_device *dev)
 
        u16 switchsettings, switchsettings_eeprom  ;
  
-       if(request_irq(dev->irq, &xl_interrupt, SA_SHIRQ , "3c359", dev)) {
+       if(request_irq(dev->irq, &xl_interrupt, IRQF_SHARED , "3c359", dev)) {
                return -EAGAIN;
        }
 
index 649d8ea354f553688a6a7bb4373e0a6c5e5210ad..1bdd3beefbe54cf17121d1296e5d18dbfed3ac04 100644 (file)
@@ -123,7 +123,7 @@ static int __devinit abyss_attach(struct pci_dev *pdev, const struct pci_device_
                goto err_out_trdev;
        }
                
-       ret = request_irq(pdev->irq, tms380tr_interrupt, SA_SHIRQ,
+       ret = request_irq(pdev->irq, tms380tr_interrupt, IRQF_SHARED,
                          dev->name, dev);
        if (ret)
                goto err_out_region;
index c58a4c31d0dda6c7caa5e747c2e49fa4fb2582c2..28d968ffd5d0ff37f6ed82fe67e0c23f40ee2844 100644 (file)
 
 #define STREAMER_IOCTL 0
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -602,7 +601,7 @@ static int streamer_open(struct net_device *dev)
                rc=streamer_reset(dev);
        }
 
-       if (request_irq(dev->irq, &streamer_interrupt, SA_SHIRQ, "lanstreamer", dev)) {
+       if (request_irq(dev->irq, &streamer_interrupt, IRQF_SHARED, "lanstreamer", dev)) {
                return -EAGAIN;
        }
 #if STREAMER_DEBUG
index 19e6f4dfd69ce8478a86c200f060dd97d529efa5..666bbaaae82f5fe780f3d3d8571b26c9eaec6aa5 100644 (file)
@@ -311,7 +311,7 @@ static int __devinit madgemc_probe(struct device *device)
         */ 
        outb(0, dev->base_addr + MC_CONTROL_REG0); /* sanity */
        madgemc_setsifsel(dev, 1);
-       if (request_irq(dev->irq, madgemc_interrupt, SA_SHIRQ,
+       if (request_irq(dev->irq, madgemc_interrupt, IRQF_SHARED,
                       "madgemc", dev)) {
                ret = -EBUSY;
                goto getout3;
index c3cb8d26cfe305241efd33ad5c00594d23f349fb..85831484bc40ce9914572d7d3525a103e2bb137b 100644 (file)
@@ -80,7 +80,6 @@
 #define OLYMPIC_DEBUG 0
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -446,7 +445,7 @@ static int olympic_open(struct net_device *dev)
 
        olympic_init(dev);
 
-       if(request_irq(dev->irq, &olympic_interrupt, SA_SHIRQ , "olympic", dev)) {
+       if(request_irq(dev->irq, &olympic_interrupt, IRQF_SHARED , "olympic", dev)) {
                return -EAGAIN;
        }
 
index 67d2b596ce22ec7df5757cc83772688e42afb668..cd2e0251e2bc387c910622d2e0ee25e73690bc6d 100644 (file)
@@ -29,7 +29,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/fcntl.h>
@@ -532,7 +531,7 @@ static int __init smctr_chk_mca(struct net_device *dev)
                        dev->irq = 15;
                                break;
        }
-       if (request_irq(dev->irq, smctr_interrupt, SA_SHIRQ, smctr_name, dev)) {
+       if (request_irq(dev->irq, smctr_interrupt, IRQF_SHARED, smctr_name, dev)) {
                release_region(dev->base_addr, SMCTR_IO_EXTENT);
                return -ENODEV;
        }
@@ -1062,7 +1061,7 @@ static int __init smctr_chk_isa(struct net_device *dev)
                         goto out2;
          }
 
-        if (request_irq(dev->irq, smctr_interrupt, SA_SHIRQ, smctr_name, dev))
+        if (request_irq(dev->irq, smctr_interrupt, IRQF_SHARED, smctr_name, dev))
                 goto out2;
 
         /* Get 58x Rom Base */
index 48994b043b7cf0e06e29b2f4424257edfae107b5..292e50ddf01a58c095a8285647ca6d951ff59c18 100644 (file)
@@ -17,7 +17,6 @@
  *  - Jay Schulist <jschlst@samba.org>
  */
 
-#include <linux/config.h>
 
 #if defined(CONFIG_SMCTR) || defined(CONFIG_SMCTR_MODULE)
 
index ab47c0547a3ba0ada36f835a7a6a88d5b2ba39a4..7d3e270c4f4539888d9caf0162688eaeb643ea80 100644 (file)
@@ -122,7 +122,7 @@ static int __devinit tms_pci_attach(struct pci_dev *pdev, const struct pci_devic
                goto err_out_trdev;
        }
 
-       ret = request_irq(pdev->irq, tms380tr_interrupt, SA_SHIRQ,
+       ret = request_irq(pdev->irq, tms380tr_interrupt, IRQF_SHARED,
                          dev->name, dev);
        if (ret)
                goto err_out_region;
index fc2468ecce0b1db743e8158d07468c15f1eca80c..d05c5aa254eeb1163ffcc80c438a79072f20b22b 100644 (file)
@@ -31,7 +31,6 @@
 #define DRV_VERSION            "0.7"
 #define DRV_RELDATE            "Mar 17, 2004"
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
@@ -1372,7 +1371,7 @@ static int de_open (struct net_device *dev)
 
        dw32(IntrMask, 0);
 
-       rc = request_irq(dev->irq, de_interrupt, SA_SHIRQ, dev->name, dev);
+       rc = request_irq(dev->irq, de_interrupt, IRQF_SHARED, dev->name, dev);
        if (rc) {
                printk(KERN_ERR "%s: IRQ %d request failure, err=%d\n",
                       dev->name, dev->irq, rc);
index da8bd0d62a3fcaf57540558ba487f78500a45076..75ff14a552399937f052d4f970e8a5cb9cbd818f 100644 (file)
       0.41    21-Mar-96   Don't check for get_hw_addr checksum unless DEC card
                           only <niles@axp745gsfc.nasa.gov>
                          Fix for multiple PCI cards reported by <jos@xos.nl>
-                         Duh, put the SA_SHIRQ flag into request_interrupt().
+                         Duh, put the IRQF_SHARED flag into request_interrupt().
                          Fix SMC ethernet address in enet_det[].
                          Print chip name instead of "UNKNOWN" during boot.
       0.42    26-Apr-96   Fix MII write TA bit error.
                           infoblocks.
                          Added DC21142 and DC21143 functions.
                          Added byte counters from <phil@tazenda.demon.co.uk>
-                         Added SA_INTERRUPT temporary fix from
+                         Added IRQF_DISABLED temporary fix from
                           <mjacob@feral.com>.
       0.53   12-Nov-97    Fix the *_probe() to include 'eth??' name during
                            module load: bug reported by
     =========================================================================
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
@@ -1320,10 +1319,10 @@ de4x5_open(struct net_device *dev)
     lp->state = OPEN;
     de4x5_dbg_open(dev);
 
-    if (request_irq(dev->irq, (void *)de4x5_interrupt, SA_SHIRQ,
+    if (request_irq(dev->irq, (void *)de4x5_interrupt, IRQF_SHARED,
                                                     lp->adapter_name, dev)) {
        printk("de4x5_open(): Requested IRQ%d is busy - attemping FAST/SHARE...", dev->irq);
-       if (request_irq(dev->irq, de4x5_interrupt, SA_INTERRUPT | SA_SHIRQ,
+       if (request_irq(dev->irq, de4x5_interrupt, IRQF_DISABLED | IRQF_SHARED,
                                                     lp->adapter_name, dev)) {
            printk("\n              Cannot get IRQ- reconfigure your hardware.\n");
            disable_ast(dev);
index ba5b112093f4d6f28c9bb998749c12306c0e5be9..4e5b0f2acc395b2b407ca1a76d12564baac38151 100644 (file)
@@ -506,7 +506,7 @@ static int dmfe_open(struct DEVICE *dev)
 
        DMFE_DBUG(0, "dmfe_open", 0);
 
-       ret = request_irq(dev->irq, &dmfe_interrupt, SA_SHIRQ, dev->name, dev);
+       ret = request_irq(dev->irq, &dmfe_interrupt, IRQF_SHARED, dev->name, dev);
        if (ret)
                return ret;
 
index da4f7593c50f54111b0242f9497c9afc7a0bfa3f..99ccf2ebb342ed3f19d4607507288fd7502948a8 100644 (file)
@@ -16,7 +16,6 @@
 
 #include <linux/pci.h>
 #include "tulip.h"
-#include <linux/config.h>
 #include <linux/etherdevice.h>
 
 int tulip_rx_copybreak;
index d25020da679879ab8e1539fa8f8c2b0be63ea6e9..3bcfbf3d23ed4763750ff193946c417098c97cde 100644 (file)
@@ -16,7 +16,6 @@
 #ifndef __NET_TULIP_H__
 #define __NET_TULIP_H__
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/spinlock.h>
index 53fd9b56d0bd7967b51cbf794128c1c15918979b..7351831f57cec5f96c9687515c017a2e51d33b00 100644 (file)
@@ -14,7 +14,6 @@
 
 */
 
-#include <linux/config.h>
 
 #define DRV_NAME       "tulip"
 #ifdef CONFIG_TULIP_NAPI
@@ -490,7 +489,7 @@ tulip_open(struct net_device *dev)
 {
        int retval;
 
-       if ((retval = request_irq(dev->irq, &tulip_interrupt, SA_SHIRQ, dev->name, dev)))
+       if ((retval = request_irq(dev->irq, &tulip_interrupt, IRQF_SHARED, dev->name, dev)))
                return retval;
 
        tulip_init_ring (dev);
@@ -1771,7 +1770,7 @@ static int tulip_resume(struct pci_dev *pdev)
 
        pci_enable_device(pdev);
 
-       if ((retval = request_irq(dev->irq, &tulip_interrupt, SA_SHIRQ, dev->name, dev))) {
+       if ((retval = request_irq(dev->irq, &tulip_interrupt, IRQF_SHARED, dev->name, dev))) {
                printk (KERN_ERR "tulip: request_irq failed in resume\n");
                return retval;
        }
index 8b3a28f53c3d0165d096287d4a983359413d8447..fd64b2b3e99c7d3949723b22a08ac677b0ab07fb 100644 (file)
@@ -436,7 +436,7 @@ static int uli526x_open(struct net_device *dev)
 
        ULI526X_DBUG(0, "uli526x_open", 0);
 
-       ret = request_irq(dev->irq, &uli526x_interrupt, SA_SHIRQ, dev->name, dev);
+       ret = request_irq(dev->irq, &uli526x_interrupt, IRQF_SHARED, dev->name, dev);
        if (ret)
                return ret;
 
index 602a6e5002a076fcefb64a04742535c2012e8b4d..b4c0d101a7d72ac75fb55def0b141ac2e02cdaa0 100644 (file)
@@ -658,7 +658,7 @@ static int netdev_open(struct net_device *dev)
        iowrite32(0x00000001, ioaddr + PCIBusCfg);              /* Reset */
 
        netif_device_detach(dev);
-       i = request_irq(dev->irq, &intr_handler, SA_SHIRQ, dev->name, dev);
+       i = request_irq(dev->irq, &intr_handler, IRQF_SHARED, dev->name, dev);
        if (i)
                goto out_err;
 
index 63c2175ed138bb89f496fdba3cb8b1092556771c..f874e4f6ccf6076d90899a3f73ba80c4fe4a58c2 100644 (file)
@@ -457,7 +457,7 @@ static int xircom_open(struct net_device *dev)
        int retval;
        enter("xircom_open");
        printk(KERN_INFO "xircom cardbus adaptor found, registering as %s, using irq %i \n",dev->name,dev->irq);
-       retval = request_irq(dev->irq, &xircom_interrupt, SA_SHIRQ, dev->name, dev);
+       retval = request_irq(dev->irq, &xircom_interrupt, IRQF_SHARED, dev->name, dev);
        if (retval) {
                leave("xircom_open - No IRQ");
                return retval;
index 887d7245fe7b436231eee334d6aefc1f7de969c6..091ebb7a62f6013e12253e5b3855b7d3a4c6fd91 100644 (file)
@@ -98,7 +98,6 @@ static int csr0 = 0x00A00000 | 0x4800;
 /* PCI registers */
 #define PCI_POWERMGMT  0x40
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/kernel.h>
@@ -808,7 +807,7 @@ xircom_open(struct net_device *dev)
 {
        struct xircom_private *tp = netdev_priv(dev);
 
-       if (request_irq(dev->irq, &xircom_interrupt, SA_SHIRQ, dev->name, dev))
+       if (request_irq(dev->irq, &xircom_interrupt, IRQF_SHARED, dev->name, dev))
                return -EAGAIN;
 
        xircom_up(dev);
index 732c5edec2e5edd3cab20c8d0aa43233b8fab8c8..329d9feb9b8934717bf817c06822bb8f6f9345ce 100644 (file)
@@ -39,7 +39,6 @@
 #define DRV_DESCRIPTION        "Universal TUN/TAP device driver"
 #define DRV_COPYRIGHT  "(C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>"
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
index e24d2dafcf6c3695662c4ea3cdb8ece7cd672e38..063816f2b11ecf8de32f779c2dfb7ac3b192afdd 100644 (file)
@@ -2131,7 +2131,7 @@ typhoon_open(struct net_device *dev)
                goto out_sleep;
        }
 
-       err = request_irq(dev->irq, &typhoon_interrupt, SA_SHIRQ,
+       err = request_irq(dev->irq, &typhoon_interrupt, IRQF_SHARED,
                                dev->name, dev);
        if(err < 0)
                goto out_sleep;
index c80a4f1d5f7a958dc42e29856780925e2249a36e..98b6f3207d3da307c28a46825f3f8355885e589a 100644 (file)
@@ -1210,7 +1210,7 @@ static int rhine_open(struct net_device *dev)
        void __iomem *ioaddr = rp->base;
        int rc;
 
-       rc = request_irq(rp->pdev->irq, &rhine_interrupt, SA_SHIRQ, dev->name,
+       rc = request_irq(rp->pdev->irq, &rhine_interrupt, IRQF_SHARED, dev->name,
                        dev);
        if (rc)
                return rc;
@@ -1999,7 +1999,7 @@ static int rhine_resume(struct pci_dev *pdev)
        if (!netif_running(dev))
                return 0;
 
-        if (request_irq(dev->irq, rhine_interrupt, SA_SHIRQ, dev->name, dev))
+        if (request_irq(dev->irq, rhine_interrupt, IRQF_SHARED, dev->name, dev))
                printk(KERN_ERR "via-rhine %s: request_irq failed\n", dev->name);
 
        ret = pci_set_power_state(pdev, PCI_D0);
index 09e05fe40c381b437e8c121bb49d94ca1db0f5f4..ba2972ba3757c30e5977bfdcb442450bfb1bde19 100644 (file)
@@ -47,7 +47,6 @@
 
 #include <linux/module.h>
 #include <linux/types.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <linux/errno.h>
@@ -65,7 +64,6 @@
 #include <linux/wait.h>
 #include <asm/io.h>
 #include <linux/if.h>
-#include <linux/config.h>
 #include <asm/uaccess.h>
 #include <linux/proc_fs.h>
 #include <linux/inetdevice.h>
@@ -1752,7 +1750,7 @@ static int velocity_open(struct net_device *dev)
        
        velocity_init_registers(vptr, VELOCITY_INIT_COLD);
 
-       ret = request_irq(vptr->pdev->irq, &velocity_intr, SA_SHIRQ,
+       ret = request_irq(vptr->pdev->irq, &velocity_intr, IRQF_SHARED,
                          dev->name, dev);
        if (ret < 0) {
                /* Power down the chip */
index be5e33814cb144ea7db78787342c6dda1e7e0a08..1f95b4864ea19e381031b379377711642a7996c5 100644 (file)
@@ -79,7 +79,6 @@
 \f
 /* ---------- Headers, macros, data structures ---------- */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
index 04a376ec0ed84ab737c373342914ed172a4b1129..684af4316ffdafee26c70342cc765b8bdb8dcaf1 100644 (file)
@@ -752,7 +752,7 @@ static int __devinit dscc4_init_one(struct pci_dev *pdev,
 
        priv = pci_get_drvdata(pdev);
 
-       rc = request_irq(pdev->irq, dscc4_irq, SA_SHIRQ, DRV_NAME, priv->root);
+       rc = request_irq(pdev->irq, dscc4_irq, IRQF_SHARED, DRV_NAME, priv->root);
        if (rc < 0) {
                printk(KERN_WARNING "%s: IRQ %d busy\n", DRV_NAME, pdev->irq);
                goto err_release_4;
index 7981a2c7906e0522aa3a34c4cd9ba7f6c84637fc..3705db04a343b54ab345edcc313b9dfa0856f093 100644 (file)
@@ -2519,7 +2519,7 @@ fst_add_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        dbg(DBG_PCI, "kernel mem %p, ctlmem %p\n", card->mem, card->ctlmem);
 
        /* Register the interrupt handler */
-       if (request_irq(pdev->irq, fst_intr, SA_SHIRQ, FST_DEV_NAME, card)) {
+       if (request_irq(pdev->irq, fst_intr, IRQF_SHARED, FST_DEV_NAME, card)) {
                printk_err("Unable to register interrupt %d\n", card->irq);
                pci_release_regions(pdev);
                pci_disable_device(pdev);
index 57f9538b8fb5efead8c45e792610df97bcf57500..b7da55140fbd854b54568cb84add8c1420fd7e8a 100644 (file)
@@ -22,7 +22,6 @@
  * - proto.start() and stop() are called with spin_lock_irq held.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
index cf5c805452a39ec0474dd8268694b5719b341aca..a4f735723c4100ad2a7df897f8868f4e1a4b2b93 100644 (file)
@@ -264,7 +264,7 @@ static struct sv11_device *sv11_init(int iobase, int irq)
        /* We want a fast IRQ for this device. Actually we'd like an even faster
           IRQ ;) - This is one driver RtLinux is made for */
           
-       if(request_irq(irq, &z8530_interrupt, SA_INTERRUPT, "Hostess SV11", dev)<0)
+       if(request_irq(irq, &z8530_interrupt, IRQF_DISABLED, "Hostess SV11", dev)<0)
        {
                printk(KERN_WARNING "hostess: IRQ %d already in use.\n", irq);
                goto fail1;
index 40926d779161d10602090f5314392625c68af622..39f44241a72854781691f33e619785994486bf11 100644 (file)
@@ -1058,7 +1058,7 @@ static int lmc_open (struct net_device *dev) /*fold00*/
     lmc_softreset (sc);
 
     /* Since we have to use PCI bus, this should work on x86,alpha,ppc */
-    if (request_irq (dev->irq, &lmc_interrupt, SA_SHIRQ, dev->name, dev)){
+    if (request_irq (dev->irq, &lmc_interrupt, IRQF_SHARED, dev->name, dev)){
         printk(KERN_WARNING "%s: could not get irq: %d\n", dev->name, dev->irq);
         lmc_trace(dev, "lmc_open irq failed out");
         return -EAGAIN;
index af8b55fdd9d98008bfe040b895ae734bfafb088b..ae01555d24cf8bf637580be4405b9fe35a77f762 100644 (file)
@@ -1,6 +1,5 @@
 /* $Id: lmc_media.c,v 1.13 2000/04/11 05:25:26 asj Exp $ */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/timer.h>
index d7897ae89f904dc906250c67cdde073f2243e7ed..567effff4a3e2b86849daae5c155bab5a42c10d0 100644 (file)
@@ -3600,7 +3600,7 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        }
 
        /* Allocate IRQ */
-       if (request_irq(card->hw.irq, cpc_intr, SA_SHIRQ, "Cyclades-PC300", card)) {
+       if (request_irq(card->hw.irq, cpc_intr, IRQF_SHARED, "Cyclades-PC300", card)) {
                printk ("PC300 found at RAM 0x%08x, but could not allocate IRQ%d.\n",
                         card->hw.ramphys, card->hw.irq);
                goto err_io_unmap;
index 24c3c57c13c933d90f50933d1540791425d61f13..4df61fa3214b52415a3972604a1df73a5d3bd463 100644 (file)
@@ -402,7 +402,7 @@ static int __devinit pci200_pci_init_one(struct pci_dev *pdev,
        writew(readw(p) | 0x0040, p);
 
        /* Allocate IRQ */
-       if (request_irq(pdev->irq, sca_intr, SA_SHIRQ, devname, card)) {
+       if (request_irq(pdev->irq, sca_intr, IRQF_SHARED, devname, card)) {
                printk(KERN_WARNING "pci200syn: could not allocate IRQ%d.\n",
                       pdev->irq);
                pci200_pci_remove_one(pdev);
index 175ba13bce41b32fec866d58f5674c9b2cbb82da..fc75bec19029d6372c65a48d0a9cda92cb1a15bb 100644 (file)
@@ -37,7 +37,6 @@
  *     Known problem: this driver wasn't tested on multiprocessor machine.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/ptrace.h>
@@ -1193,7 +1192,7 @@ sbni_open( struct net_device  *dev )
                        }
        }
 
-       if( request_irq(dev->irq, sbni_interrupt, SA_SHIRQ, dev->name, dev) ) {
+       if( request_irq(dev->irq, sbni_interrupt, IRQF_SHARED, dev->name, dev) ) {
                printk( KERN_ERR "%s: unable to get IRQ %d.\n",
                        dev->name, dev->irq );
                return  -EAGAIN;
index 050e854e77749a7b5d77c7afb34c927e13aa7f5a..70fb1b98b1ddd271950ba08760f24f6da0e08ec4 100644 (file)
@@ -322,7 +322,7 @@ static __init struct slvl_board *slvl_init(int iobase, int irq,
        /* We want a fast IRQ for this device. Actually we'd like an even faster
           IRQ ;) - This is one driver RtLinux is made for */
    
-       if(request_irq(irq, &z8530_interrupt, SA_INTERRUPT, "SeaLevel", dev)<0)
+       if(request_irq(irq, &z8530_interrupt, IRQF_DISABLED, "SeaLevel", dev)<0)
        {
                printk(KERN_WARNING "sealevel: IRQ %d already in use.\n", irq);
                goto fail1_1;
index 2d1bba06a08512d5d0a5af5bb8283ee9f9493922..c13b459a013789a62c1d7ade07739833791c9752 100644 (file)
@@ -37,7 +37,6 @@
  */
 #undef DEBUG
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index 437e0e938e38ba7c0239d4a7e9c6b732faa742fc..d564224cdca90494046fda6e51a95a9f6c99e25c 100644 (file)
@@ -755,7 +755,7 @@ static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
               pci_name(pdev), plx_phy, ramsize / 1024, mem_phy, pdev->irq);
 
        /* Allocate IRQ */
-       if (request_irq(pdev->irq, wanxl_intr, SA_SHIRQ, "wanXL", card)) {
+       if (request_irq(pdev->irq, wanxl_intr, IRQF_SHARED, "wanXL", card)) {
                printk(KERN_WARNING "wanXL %s: could not allocate IRQ%i.\n",
                       pci_name(pdev), pdev->irq);
                wanxl_pci_remove_one(pdev);
index 4069b79d825972b4fb3ad21c7aad31d73edb07d4..a4dd1394271446192ccf51a26a82d70c4d0bf042 100644 (file)
@@ -19,7 +19,6 @@
 
 ======================================================================*/
 
-#include <linux/config.h>
 #include <linux/init.h>
 
 #include <linux/kernel.h>
@@ -2849,7 +2848,7 @@ static struct net_device *_init_airo_card( unsigned short irq, int port,
        reset_card (dev, 1);
        msleep(400);
 
-       rc = request_irq( dev->irq, airo_interrupt, SA_SHIRQ, dev->name, dev );
+       rc = request_irq( dev->irq, airo_interrupt, IRQF_SHARED, dev->name, dev );
        if (rc) {
                airo_print_err(dev->name, "register interrupt %d failed, rc %d",
                                irq, rc);
index af0cbb6c5c0c6a35391bfe45e5f441fbbd2d90fa..ac9437d497f08e9bf530a7a3eb1e1aa721af9599 100644 (file)
@@ -20,7 +20,6 @@
     
 ======================================================================*/
 
-#include <linux/config.h>
 #ifdef __IN_PCMCIA_PACKAGE__
 #include <pcmcia/k_compat.h>
 #endif
index 7b321f7cf358d05b3656dfce2e918daa373ce39b..38fac3bbcd823b0e568fef8729961dac95fd2c3d 100644 (file)
@@ -14,7 +14,6 @@
 #define DRIVER_NAME "airport"
 #define PFX DRIVER_NAME ": "
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index bed6823d980906908da6ecb1b608c7ec5fa32816..bb6bea4f32331fa026a037107ca57082dfe44cac 100644 (file)
@@ -5,7 +5,6 @@
  * This module provides support for the Arlan 655 card made by Aironet
  */
 
-#include <linux/config.h>
 #include "arlan.h"
 
 #if BITS_PER_LONG != 32
index a2cca521f4449b29825ca076ca184bf3515cef41..5fa985435ffa2f9f56d1aed7019fab856e49c841 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include "arlan.h"
 
 #include <linux/sysctl.h>
index 70a6d7b83c4a05bb26dff8d020d195973cf875f9..3ed1df75900f49f47d7ae163c3c9dddeabf9ac65 100644 (file)
@@ -5,7 +5,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/skbuff.h>
index 8606c88886fca9237fd8b3f4bd774fca8aa7e02c..995c7bea5897e9727ad66275eafd048658ec570f 100644 (file)
@@ -39,7 +39,6 @@
 
 ******************************************************************************/
 
-#include <linux/config.h>
 #include <linux/init.h>
 
 #include <linux/kernel.h>
@@ -1578,7 +1577,7 @@ struct net_device *init_atmel_card(unsigned short irq, unsigned long port,
 
        SET_NETDEV_DEV(dev, sys_dev);
 
-       if ((rc = request_irq(dev->irq, service_interrupt, SA_SHIRQ, dev->name, dev))) {
+       if ((rc = request_irq(dev->irq, service_interrupt, IRQF_SHARED, dev->name, dev))) {
                printk(KERN_ERR "%s: register interrupt %d failed, rc %d\n", dev->name, irq, rc);
                goto err_out_free;
        }
index 26bf1127524df2f147f5e517d87a3e8101d58949..785664090bb47d07da1e4b8167b81946532a9666 100644 (file)
@@ -29,7 +29,6 @@
 
 ******************************************************************************/
 
-#include <linux/config.h>
 #ifdef __IN_PCMCIA_PACKAGE__
 #include <pcmcia/k_compat.h>
 #endif
index a61b3bc6cccf4c94aac6bf57216d4389d055f61e..d425c3cefdedbac00c91b1d320d01d9828587846 100644 (file)
@@ -19,7 +19,6 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 ******************************************************************************/
-#include <linux/config.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
index b3ffcf50131163453c73a348199dd460bbc64676..e386dcc32e8c395276bcfa5bc33f16f01d0d0884 100644 (file)
@@ -32,7 +32,7 @@
 #include <linux/netdevice.h>
 #include <linux/pci.h>
 #include <linux/string.h>
-#include <linux/version.h>
+#include <linux/utsrelease.h>
 
 
 static void bcm43xx_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
index 27bcf47228e23c3cc03957703fccc2129d3f9251..d8f5600578b492fb6da90840c3a4ec3e71bc3c32 100644 (file)
@@ -2175,7 +2175,7 @@ static int bcm43xx_initialize_irq(struct bcm43xx_private *bcm)
        }
 #endif
        res = request_irq(bcm->irq, bcm43xx_interrupt_handler,
-                         SA_SHIRQ, KBUILD_MODNAME, bcm);
+                         IRQF_SHARED, KBUILD_MODNAME, bcm);
        if (res) {
                printk(KERN_ERR PFX "Cannot register IRQ%d\n", bcm->irq);
                return -ENODEV;
index 2aa2f389c0d5905a200921ecec2f5e4c582fe88f..29d39105f5b869a4a59be436e41ab2015a3c822e 100644 (file)
@@ -38,7 +38,6 @@
  * under either the MPL or the GPL.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index db03dc2646dfb08d27b741f57774ca66303de609..52e6df5c1a92a6b719c985009725239e8738fd9c 100644 (file)
@@ -1,6 +1,5 @@
 #define PRISM2_PCCARD
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/if.h>
@@ -844,7 +843,7 @@ static struct pcmcia_device_id hostap_cs_ids[] = {
        PCMCIA_DEVICE_MANF_CARD(0x02d2, 0x0001),
        PCMCIA_DEVICE_MANF_CARD(0x50c2, 0x0001),
        PCMCIA_DEVICE_MANF_CARD(0x50c2, 0x7300),
-       PCMCIA_DEVICE_MANF_CARD(0xc00f, 0x0000),
+/*     PCMCIA_DEVICE_MANF_CARD(0xc00f, 0x0000),    conflict with pcnet_cs */
        PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0002),
        PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0005),
        PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0010),
index 328e9a1d13b569da739270f335e683a3001811c9..dafaa5ff5aa693d065f85cc4777e1c53c3c7054a 100644 (file)
@@ -30,7 +30,6 @@
  */
 
 
-#include <linux/config.h>
 
 #include <asm/delay.h>
 #include <asm/uaccess.h>
@@ -3096,6 +3095,14 @@ static void prism2_clear_set_tim_queue(local_info_t *local)
 }
 
 
+/*
+ * HostAP uses two layers of net devices, where the inner
+ * layer gets called all the time from the outer layer.
+ * This is a natural nesting, which needs a split lock type.
+ */
+static struct lock_class_key hostap_netdev_xmit_lock_key;
+
+
 static struct net_device *
 prism2_init_local_data(struct prism2_helper_functions *funcs, int card_idx,
                       struct device *sdev)
@@ -3260,6 +3267,8 @@ while (0)
        SET_NETDEV_DEV(dev, sdev);
        if (ret >= 0)
                ret = register_netdevice(dev);
+
+       lockdep_set_class(&dev->_xmit_lock, &hostap_netdev_xmit_lock_key);
        rtnl_unlock();
        if (ret < 0) {
                printk(KERN_WARNING "%s: register netdevice failed!\n",
index 93786f4218f0d422092813dd17bb9b9e083d8997..53374fcba77e5fc220c04ab26802ae43dd17fb73 100644 (file)
@@ -12,7 +12,6 @@
  * more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
index 194f07097581dcdb538b05b077d18db5eeb76bc7..c2fa011be291d90c32f1e6d9a4ec70ba3f951847 100644 (file)
@@ -4,7 +4,6 @@
  * driver patches from Reyk Floeter <reyk@vantronix.net> and
  * Andy Warner <andyw@pobox.com> */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/if.h>
@@ -338,7 +337,7 @@ static int prism2_pci_probe(struct pci_dev *pdev,
 
        pci_set_drvdata(pdev, dev);
 
-       if (request_irq(dev->irq, prism2_interrupt, SA_SHIRQ, dev->name,
+       if (request_irq(dev->irq, prism2_interrupt, IRQF_SHARED, dev->name,
                        dev)) {
                printk(KERN_WARNING "%s: request_irq failed\n", dev->name);
                goto fail;
index edaaa943eb8f54c026c436e6b62a19a9e3ee3ee8..49860fa61c307f0cea50df9e031ca485d10222e7 100644 (file)
@@ -7,7 +7,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/if.h>
@@ -551,7 +550,7 @@ static int prism2_plx_probe(struct pci_dev *pdev,
 
        pci_set_drvdata(pdev, dev);
 
-       if (request_irq(dev->irq, prism2_interrupt, SA_SHIRQ, dev->name,
+       if (request_irq(dev->irq, prism2_interrupt, IRQF_SHARED, dev->name,
                        dev)) {
                printk(KERN_WARNING "%s: request_irq failed\n", dev->name);
                goto fail;
index 94aeb23a77298c6c0153ff6d8fa18f6994524790..e955db435b30b4ef9e2c87106790ada253582fa6 100644 (file)
@@ -134,7 +134,6 @@ that only one external action is invoked at a time.
 */
 
 #include <linux/compiler.h>
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/if_arp.h>
 #include <linux/in6.h>
@@ -5358,7 +5357,7 @@ static int ipw2100_set_key(struct ipw2100_priv *priv,
                     idx, keylen, len);
 
        /* NOTE: We don't check cached values in case the firmware was reset
-        * or some other problem is occuring.  If the user is setting the key,
+        * or some other problem is occurring.  If the user is setting the key,
         * then we push the change */
 
        wep_key->idx = idx;
@@ -6230,7 +6229,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
        ipw2100_queues_initialize(priv);
 
        err = request_irq(pci_dev->irq,
-                         ipw2100_interrupt, SA_SHIRQ, dev->name, priv);
+                         ipw2100_interrupt, IRQF_SHARED, dev->name, priv);
        if (err) {
                printk(KERN_WARNING DRV_NAME
                       "Error calling request_irq: %d.\n", pci_dev->irq);
index a8a8f975432fe1e32a3fb04aa0a4bc2d59d94e24..b3300ffe4eecb8dc888091255d4fbda501ce7efc 100644 (file)
@@ -11545,7 +11545,7 @@ static int ipw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
        ipw_sw_reset(priv, 1);
 
-       err = request_irq(pdev->irq, ipw_isr, SA_SHIRQ, DRV_NAME, priv);
+       err = request_irq(pdev->irq, ipw_isr, IRQF_SHARED, DRV_NAME, priv);
        if (err) {
                IPW_ERROR("Error allocating IRQ %d\n", pdev->irq);
                goto out_destroy_workqueue;
index ea12ad66b8e8f9141c51c9f3bf7c3e6bbf9993d6..8b1cd7c749a4e537e434d9d44d3ba0658d4f0efc 100644 (file)
@@ -31,7 +31,6 @@
 
 #include <linux/module.h>
 #include <linux/moduleparam.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/mutex.h>
 
index 9343d970537beca857ac12242580e099218d2689..36b5e004305ee4455000ad832222d4246ca467ff 100644 (file)
@@ -37,7 +37,6 @@
 /* To have statistics (just packets sent) define this */
 #undef NETWAVE_STATS
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 8a31b591a901198f36b67eab7b4ab1612aa76992..d6ed5781b93a8cf6ffce52cabd4ba3e01847acc5 100644 (file)
@@ -76,7 +76,6 @@
 
 #define DRIVER_NAME "orinoco"
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index b2aec4d9fbb12b3dc759233564722ac43975daf5..bc14689cbf24fb209b1fc38cdd875f3f7aba9012 100644 (file)
@@ -13,7 +13,6 @@
 #define DRIVER_NAME "orinoco_cs"
 #define PFX DRIVER_NAME ": "
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 74b9d5b2ba9ee00005586938f832cf4c1f36911e..bf05b907747eaae6e1f7ce03ec12584b465371e9 100644 (file)
@@ -40,7 +40,6 @@
 #define DRIVER_NAME "orinoco_nortel"
 #define PFX DRIVER_NAME ": "
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -199,7 +198,7 @@ static int orinoco_nortel_init_one(struct pci_dev *pdev,
 
        hermes_struct_init(&priv->hw, hermes_io, HERMES_16BIT_REGSPACING);
 
-       err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ,
+       err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED,
                          dev->name, dev);
        if (err) {
                printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq);
index 1c105f40f8d55f250f344f0e2427baf150bcb3d8..1759c543fbee9bc6da6ed8bc2572cd765edc12e5 100644 (file)
@@ -44,7 +44,6 @@
 #define DRIVER_NAME "orinoco_pci"
 #define PFX DRIVER_NAME ": "
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -154,7 +153,7 @@ static int orinoco_pci_init_one(struct pci_dev *pdev,
 
        hermes_struct_init(&priv->hw, hermes_io, HERMES_32BIT_REGSPACING);
 
-       err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ,
+       err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED,
                          dev->name, dev);
        if (err) {
                printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq);
index 7eb1e08113e0886fa1b9e3ddfc9d0e529991ecb1..be1abea4b64f69ff9a28992622b866c838a32af4 100644 (file)
@@ -63,7 +63,7 @@ static int orinoco_pci_resume(struct pci_dev *pdev)
        pci_enable_device(pdev);
        pci_restore_state(pdev);
 
-       err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ,
+       err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED,
                          dev->name, dev);
        if (err) {
                printk(KERN_ERR "%s: cannot re-allocate IRQ on resume\n",
index 84f696c77551e1ce420a6e7341e0a3f0717e73c7..7f006f6241711d0d6ad52e013d976e7284219b70 100644 (file)
@@ -86,7 +86,6 @@
 #define DRIVER_NAME "orinoco_plx"
 #define PFX DRIVER_NAME ": "
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -238,7 +237,7 @@ static int orinoco_plx_init_one(struct pci_dev *pdev,
 
        hermes_struct_init(&priv->hw, hermes_io, HERMES_16BIT_REGSPACING);
 
-       err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ,
+       err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED,
                          dev->name, dev);
        if (err) {
                printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq);
index d2b4decb7a7d005cdf87c2c91d9269f7f5e8cd92..0831721e4d6ccf38e5e5052190cd09d41e4df8d7 100644 (file)
@@ -40,7 +40,6 @@
 #define DRIVER_NAME "orinoco_tmd"
 #define PFX DRIVER_NAME ": "
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -140,7 +139,7 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev,
 
        hermes_struct_init(&priv->hw, hermes_io, HERMES_16BIT_REGSPACING);
 
-       err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ,
+       err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED,
                          dev->name, dev);
        if (err) {
                printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq);
index bfa0cc319a098717ed6f7712e2ed35ccabed07eb..09fc17a0f02972494f96b28bfb34928f6e6ca49c 100644 (file)
@@ -189,7 +189,7 @@ prism54_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
        /* request for the interrupt before uploading the firmware */
        rvalue = request_irq(pdev->irq, &islpci_interrupt,
-                            SA_SHIRQ, ndev->name, priv);
+                            IRQF_SHARED, ndev->name, priv);
 
        if (rvalue) {
                /* error, could not hook the handler to the irq */
index 6a60c5970cb519b237f4c9b7b95f09a4d2adb649..2e061a80b294542fd02a12c29af2328a46cca900 100644 (file)
@@ -18,7 +18,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/netdevice.h>
 #include <linux/module.h>
 #include <linux/pci.h>
index 55541c01752eb4395d1333f9dc40dd7921399db1..d71eca55a302af351291790bf7e139203c7c04d9 100644 (file)
@@ -29,7 +29,6 @@
 
 #include <linux/device.h>
 #include <linux/firmware.h>
-#include <linux/config.h>
 #include <linux/moduleparam.h>
 #include <linux/workqueue.h>
 #include <linux/compiler.h>
index a915fe6c6aa5d441fea41835f4ac6a04ae583b2a..61b83a5e737a719719646d37a4ff76d03b9fd949 100644 (file)
@@ -30,7 +30,6 @@
  * 
 =============================================================================*/
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/proc_fs.h>
index 7f9aa139c3475fb11e526433fd85566ada350c48..15465278c789ed607e154775ccb55a3dcbc20f1e 100644 (file)
@@ -21,7 +21,6 @@
 #define DRIVER_NAME "spectrum_cs"
 #define PFX DRIVER_NAME ": "
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 18a44580b53b2f8358b94901d0cf92341358f987..fd31885c6844ab2b72c6dea2ba3cd2e5f0681a33 100644 (file)
@@ -81,7 +81,6 @@ static const char StripVersion[] = "1.3A-STUART.CHESHIRE";
 /************************************************************************/
 /* Header files                                                                */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
index c65fe7a391ecf15b400fbe529ad38f4a47ca13e0..f34a36b0c7b0e0ec2424d7c909b88c89ec695f0e 100644 (file)
 /***************************** INCLUDES *****************************/
 
 /* Linux headers that we need */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index e52a650f6737a91089ffe60cb2bc71f22489bc27..c03e400faceefe26714d11a92fce08e940899c61 100644 (file)
@@ -28,7 +28,6 @@
  */
 #undef REALLY_SLOW_IO  /* most systems can safely undef this */
 
-#include <linux/config.h>
 #include <linux/delay.h>
 #include <linux/types.h>
 #include <linux/ethtool.h>
index 569305f57561fd5304a3ae73b490f78edebfe380..bbbf7e274a2a98f756785effdcac44e66d231663 100644 (file)
@@ -602,7 +602,7 @@ static int yellowfin_open(struct net_device *dev)
        /* Reset the chip. */
        iowrite32(0x80000000, ioaddr + DMACtrl);
 
-       i = request_irq(dev->irq, &yellowfin_interrupt, SA_SHIRQ, dev->name, dev);
+       i = request_irq(dev->irq, &yellowfin_interrupt, IRQF_SHARED, dev->name, dev);
        if (i) return i;
 
        if (yellowfin_debug > 1)
index a7c089df66e6e0a0619e4f28b4a3fd05f9f9c6d8..9f0291f35290d3d657b2d0caf1f80b8a210851b2 100644 (file)
@@ -85,7 +85,6 @@
    - Understand why some traffic patterns add a 1s latency...
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
index 8037e5806d0a48b33a28815cdd828cb90cfe77eb..df04e050c647184df6c76852a11cc13058c9719a 100644 (file)
@@ -201,7 +201,7 @@ static int __devinit zorro8390_init(struct net_device *dev,
     dev->irq = IRQ_AMIGA_PORTS;
 
     /* Install the Interrupt handler */
-    i = request_irq(IRQ_AMIGA_PORTS, ei_interrupt, SA_SHIRQ, DRV_NAME, dev);
+    i = request_irq(IRQ_AMIGA_PORTS, ei_interrupt, IRQF_SHARED, DRV_NAME, dev);
     if (i) return i;
 
     for(i = 0; i < ETHER_ADDR_LEN; i++) {
index 14cbe34eb897d43a50aea55147dccd93332c2967..3a0a3a7349334e9eba1ec143a2518f46f1e060d7 100644 (file)
@@ -7,7 +7,6 @@
  *      and others.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
index 22c1dc9f87b3362892fe899b398ad759d0caf1e8..9204f04fbf0b3f4d38dedff6308249042e4a89a2 100644 (file)
@@ -2,7 +2,6 @@
 
    (c) 1999 David Huggins-Daines <dhd@debian.org> */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/nubus.h>
index a5d826237b265a0b683e0b2bbea513c33e11cc34..68cb3a080050d78d47bc787dd47366c5057c3c5f 100644 (file)
@@ -31,7 +31,6 @@
 **        the coherency design originally worked out. Only PCX-W does.
 */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/mm.h>
index ce0a6ebcff15dfa74a4ff8e8812878078a8e46a9..0d96c50ffe9cdb26d4f353d321247c7b166fb4d9 100644 (file)
@@ -43,7 +43,6 @@
 **       for PCI drivers devices which implement/use MMIO registers.
 */
 
-#include <linux/config.h>
 #include <linux/delay.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 58f0ce8d78e066c2f75fb63371924db5f41f549f..884965cedec9aee3460ef7a3be7dec52769c4a92 100644 (file)
@@ -340,7 +340,7 @@ static int __devinit eisa_probe(struct parisc_device *dev)
        }
        pcibios_register_hba(&eisa_dev.hba);
 
-       result = request_irq(dev->irq, eisa_irq, SA_SHIRQ, "EISA", &eisa_dev);
+       result = request_irq(dev->irq, eisa_irq, IRQF_SHARED, "EISA", &eisa_dev);
        if (result) {
                printk(KERN_ERR "EISA: request_irq failed!\n");
                return result;
index 5476ba7709b3cc4a9a7aec1612d74be7898a0f83..b45aa5c675a0a88981e97b913ef756ec9e3de46f 100644 (file)
@@ -14,7 +14,6 @@
  */
 
 #include <linux/bitops.h>
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
index 298f2ddb2c179693ed062b9b50f8740f7120770a..bf00fa2537bbb6f8774611eb55481751bede4965 100644 (file)
@@ -23,7 +23,6 @@
  *                               David Pye <dmp@davidmpye.dyndns.org>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/stddef.h>      /* for offsetof() */
 #include <linux/init.h>
@@ -411,16 +410,17 @@ static __inline__ int led_get_net_activity(void)
 static __inline__ int led_get_diskio_activity(void)
 {      
        static unsigned long last_pgpgin, last_pgpgout;
-       struct page_state pgstat;
+       unsigned long events[NR_VM_EVENT_ITEMS];
        int changed;
 
-       get_full_page_state(&pgstat); /* get no of sectors in & out */
+       all_vm_events(events);
 
        /* Just use a very simple calculation here. Do not care about overflow,
           since we only want to know if there was activity or not. */
-       changed = (pgstat.pgpgin != last_pgpgin) || (pgstat.pgpgout != last_pgpgout);
-       last_pgpgin  = pgstat.pgpgin;
-       last_pgpgout = pgstat.pgpgout;
+       changed = (events[PGPGIN] != last_pgpgin) ||
+                 (events[PGPGOUT] != last_pgpgout);
+       last_pgpgin  = events[PGPGIN];
+       last_pgpgout = events[PGPGOUT];
 
        return (changed ? LED_DISK_IO : 0);
 }
index 0bcab83b40804f751d173d4d2ee205ca715906f6..fad5a33bf0fa3ecac80bc57358cbd2327c2dbd68 100644 (file)
@@ -35,7 +35,6 @@
  *  runtime through the "/proc/sys/kernel/power" procfs entry.
  */ 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
index d09e39e39c60cbbef178b3e39c6b3e0c1a7ab7c8..8b47328155112ee1631aec5d47e300e5464971c7 100644 (file)
@@ -19,7 +19,6 @@
 ** FIXME: add DMA hint support programming in both sba and lba modules.
 */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/spinlock.h>
index a988dc7a9abd33a4c7f579bcf15e7a3aab003dfe..4ee26a6d9e2544852a29f42e637da7b60de2d5cb 100644 (file)
@@ -271,7 +271,7 @@ superio_init(struct pci_dev *pcidev)
        else
                printk(KERN_ERR PFX "USB regulator not initialized!\n");
 
-       if (request_irq(pdev->irq, superio_interrupt, SA_INTERRUPT,
+       if (request_irq(pdev->irq, superio_interrupt, IRQF_DISABLED,
                        SUPERIO, (void *)sio)) {
 
                printk(KERN_ERR PFX "could not get irq\n");
index 690b239ad3a7c3fe5b0b7763fb3856b0d64a052e..7ff09f0f858f76e9cea359b9b96107d815db4b25 100644 (file)
@@ -16,7 +16,6 @@
  * Various hacks, Fred Barnes <frmb2@ukc.ac.uk>, 04/2000
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/threads.h>
 #include <linux/parport.h>
index d6c77658231e9ae15ada522bbbcc66f7fde066ec..525312f2fe9c4658e1116990d095325e9dfdc5e3 100644 (file)
@@ -14,7 +14,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/parport.h>
 #include <linux/delay.h>
index 4baa719439a2fe4db93e349996d908769797c490..1850632590fdc9def3f2290e7151b8de04fa268a 100644 (file)
@@ -345,7 +345,7 @@ static int parport_ax88796_probe(struct platform_device *pdev)
        if (irq >= 0) {
                /* request irq */
                ret = request_irq(irq, parport_ax88796_interrupt,
-                                 SA_TRIGGER_FALLING, pdev->name, pp);
+                                 IRQF_TRIGGER_FALLING, pdev->name, pp);
 
                if (ret < 0)
                        goto exit_port;
index c85364765ef842c3fc222a781152b82a56cf5958..b2b8092a2b39104192de7e8a659e40fc399d8190 100644 (file)
@@ -353,7 +353,7 @@ static int __init parport_mfc3_init(void)
 
                if (p->irq != PARPORT_IRQ_NONE) {
                        if (use_cnt++ == 0)
-                               if (request_irq(IRQ_AMIGA_PORTS, mfc3_interrupt, SA_SHIRQ, p->name, &pp_mfc3_ops))
+                               if (request_irq(IRQ_AMIGA_PORTS, mfc3_interrupt, IRQF_SHARED, p->name, &pp_mfc3_ops))
                                        goto out_irq;
                }
 
index 7318e4a9e436f099fbb20175394f162d301816c7..fe800dc0be9f7fedfdf69e92ff262ebe0b51d787 100644 (file)
@@ -42,7 +42,6 @@
  * but rather will start at port->base_hi.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/sched.h>
index 7c43c5392bedb8fdfe69b216393a3a272ede7847..fac333b279bf1f7541b2f82548079bb0bcbbfe70 100644 (file)
@@ -322,7 +322,7 @@ static int __devinit init_one_port(struct sbus_dev *sdev)
        p->size = size;
 
        if ((err = request_irq(p->irq, parport_sunbpp_interrupt,
-                              SA_SHIRQ, p->name, p)) != 0) {
+                              IRQF_SHARED, p->name, p)) != 0) {
                goto out_put_port;
        }
 
index 8610ae88b92d56ec457938fd861e67848004bf02..2e744a274517c517b31889e0553451427e28a209 100644 (file)
@@ -13,7 +13,6 @@
  */
 
 #include <linux/string.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/errno.h>
index 2cb22c8d3357fbe4922a54a613c9aec116265029..94dc506b83d13ea2089105f709c9bbd62d102c10 100644 (file)
@@ -17,7 +17,6 @@
 
 #undef PARPORT_DEBUG_SHARING           /* undef for production */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/threads.h>
index 421cfffb1756e597066706336a15660a9878669e..34a1891191fd4c06261de07a8671512869e3d08d 100644 (file)
@@ -40,8 +40,7 @@ ibmphp-objs           :=      ibmphp_core.o   \
                                ibmphp_hpc.o
 
 acpiphp-objs           :=      acpiphp_core.o  \
-                               acpiphp_glue.o  \
-                               acpiphp_dock.o
+                               acpiphp_glue.o
 
 rpaphp-objs            :=      rpaphp_core.o   \
                                rpaphp_pci.o    \
index 17a93f890dba9d2626e621b7f9dda91a1b5dc90e..be104eced34c63ffea077e1e8d64f93cad1e56e5 100644 (file)
@@ -130,7 +130,7 @@ struct acpiphp_func {
 
        struct list_head sibling;
        struct pci_dev *pci_dev;
-
+       struct notifier_block nb;
        acpi_handle     handle;
 
        u8              function;       /* pci function# */
@@ -151,24 +151,6 @@ struct acpiphp_attention_info
 };
 
 
-struct dependent_device {
-       struct list_head device_list;
-       struct list_head pci_list;
-       acpi_handle handle;
-       struct acpiphp_func *func;
-};
-
-
-struct acpiphp_dock_station {
-       acpi_handle handle;
-       u32 last_dock_time;
-       u32 flags;
-       struct acpiphp_func *dock_bridge;
-       struct list_head dependent_devices;
-       struct list_head pci_dependent_devices;
-};
-
-
 /* PCI bus bridge HID */
 #define ACPI_PCI_HOST_HID              "PNP0A03"
 
@@ -207,11 +189,6 @@ struct acpiphp_dock_station {
 #define FUNC_HAS_PS2           (0x00000040)
 #define FUNC_HAS_PS3           (0x00000080)
 #define FUNC_HAS_DCK            (0x00000100)
-#define FUNC_IS_DD              (0x00000200)
-
-/* dock station flags */
-#define DOCK_DOCKING            (0x00000001)
-#define DOCK_HAS_BRIDGE         (0x00000002)
 
 /* function prototypes */
 
@@ -226,7 +203,6 @@ extern int acpiphp_glue_init (void);
 extern void acpiphp_glue_exit (void);
 extern int acpiphp_get_num_slots (void);
 typedef int (*acpiphp_callback)(struct acpiphp_slot *slot, void *data);
-void handle_hotplug_event_func(acpi_handle, u32, void*);
 
 extern int acpiphp_enable_slot (struct acpiphp_slot *slot);
 extern int acpiphp_disable_slot (struct acpiphp_slot *slot);
@@ -236,16 +212,6 @@ extern u8 acpiphp_get_latch_status (struct acpiphp_slot *slot);
 extern u8 acpiphp_get_adapter_status (struct acpiphp_slot *slot);
 extern u32 acpiphp_get_address (struct acpiphp_slot *slot);
 
-/* acpiphp_dock.c */
-extern int find_dock_station(void);
-extern void remove_dock_station(void);
-extern void add_dependent_device(struct dependent_device *new_dd);
-extern void add_pci_dependent_device(struct dependent_device *new_dd);
-extern struct dependent_device *get_dependent_device(acpi_handle handle);
-extern int is_dependent_device(acpi_handle handle);
-extern int detect_dependent_devices(acpi_handle *bridge_handle);
-extern struct dependent_device *alloc_dependent_device(acpi_handle handle);
-
 /* variables */
 extern int acpiphp_debug;
 
index 4f1b0da8e47e7bad04fa7877441244df6929004b..34de5697983db4f867cc7fd57ecc28f544f2b890 100644 (file)
@@ -416,27 +416,12 @@ void acpiphp_unregister_hotplug_slot(struct acpiphp_slot *acpiphp_slot)
 
 static int __init acpiphp_init(void)
 {
-       int retval;
-       int docking_station;
-
        info(DRIVER_DESC " version: " DRIVER_VERSION "\n");
 
        acpiphp_debug = debug;
 
-       docking_station = find_dock_station();
-
        /* read all the ACPI info from the system */
-       retval = init_acpi();
-
-       /* if we have found a docking station, we should
-        * go ahead and load even if init_acpi has found
-        * no slots.  This handles the case when the _DCK
-        * method not defined under the actual dock bridge
-        */
-       if (docking_station)
-               return 0;
-       else
-               return retval;
+       return init_acpi();
 }
 
 
@@ -444,8 +429,6 @@ static void __exit acpiphp_exit(void)
 {
        /* deallocate internal data structures etc. */
        acpiphp_glue_exit();
-
-       remove_dock_station();
 }
 
 module_init(acpiphp_init);
diff --git a/drivers/pci/hotplug/acpiphp_dock.c b/drivers/pci/hotplug/acpiphp_dock.c
deleted file mode 100644 (file)
index 4f1aaf1..0000000
+++ /dev/null
@@ -1,438 +0,0 @@
-/*
- * ACPI PCI HotPlug dock functions to ACPI CA subsystem
- *
- * Copyright (C) 2006 Kristen Carlson Accardi (kristen.c.accardi@intel.com)
- * Copyright (C) 2006 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 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, GOOD TITLE or
- * NON INFRINGEMENT.  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.
- *
- * Send feedback to <kristen.c.accardi@intel.com>
- *
- */
-#include <linux/init.h>
-#include <linux/module.h>
-
-#include <linux/kernel.h>
-#include <linux/pci.h>
-#include <linux/smp_lock.h>
-#include <linux/mutex.h>
-
-#include "../pci.h"
-#include "pci_hotplug.h"
-#include "acpiphp.h"
-
-static struct acpiphp_dock_station *ds;
-#define MY_NAME "acpiphp_dock"
-
-
-int is_dependent_device(acpi_handle handle)
-{
-       return (get_dependent_device(handle) ? 1 : 0);
-}
-
-
-static acpi_status
-find_dependent_device(acpi_handle handle, u32 lvl, void *context, void **rv)
-{
-       int *count = (int *)context;
-
-       if (is_dependent_device(handle)) {
-               (*count)++;
-               return AE_CTRL_TERMINATE;
-       } else {
-               return AE_OK;
-       }
-}
-
-
-
-
-void add_dependent_device(struct dependent_device *new_dd)
-{
-       list_add_tail(&new_dd->device_list, &ds->dependent_devices);
-}
-
-
-void add_pci_dependent_device(struct dependent_device *new_dd)
-{
-       list_add_tail(&new_dd->pci_list, &ds->pci_dependent_devices);
-}
-
-
-
-struct dependent_device * get_dependent_device(acpi_handle handle)
-{
-       struct dependent_device *dd;
-
-       if (!ds)
-               return NULL;
-
-       list_for_each_entry(dd, &ds->dependent_devices, device_list) {
-               if (handle == dd->handle)
-                       return dd;
-       }
-       return NULL;
-}
-
-
-
-struct dependent_device *alloc_dependent_device(acpi_handle handle)
-{
-       struct dependent_device *dd;
-
-       dd = kzalloc(sizeof(*dd), GFP_KERNEL);
-       if (dd) {
-               INIT_LIST_HEAD(&dd->pci_list);
-               INIT_LIST_HEAD(&dd->device_list);
-               dd->handle = handle;
-       }
-       return dd;
-}
-
-
-
-static int is_dock(acpi_handle handle)
-{
-       acpi_status status;
-       acpi_handle tmp;
-
-       status = acpi_get_handle(handle, "_DCK", &tmp);
-       if (ACPI_FAILURE(status)) {
-               return 0;
-       }
-       return 1;
-}
-
-
-
-static int dock_present(void)
-{
-       unsigned long sta;
-       acpi_status status;
-
-       if (ds) {
-               status = acpi_evaluate_integer(ds->handle, "_STA", NULL, &sta);
-               if (ACPI_SUCCESS(status) && sta)
-                       return 1;
-       }
-       return 0;
-}
-
-
-
-static void eject_dock(void)
-{
-       struct acpi_object_list arg_list;
-       union acpi_object arg;
-
-       arg_list.count = 1;
-       arg_list.pointer = &arg;
-       arg.type = ACPI_TYPE_INTEGER;
-       arg.integer.value = 1;
-
-       if (ACPI_FAILURE(acpi_evaluate_object(ds->handle, "_EJ0",
-                                       &arg_list, NULL)) || dock_present())
-               warn("%s: failed to eject dock!\n", __FUNCTION__);
-
-       return;
-}
-
-
-
-
-static acpi_status handle_dock(int dock)
-{
-       acpi_status status;
-       struct acpi_object_list arg_list;
-       union acpi_object arg;
-       struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
-
-       dbg("%s: %s\n", __FUNCTION__, dock ? "docking" : "undocking");
-
-       /* _DCK method has one argument */
-       arg_list.count = 1;
-       arg_list.pointer = &arg;
-       arg.type = ACPI_TYPE_INTEGER;
-       arg.integer.value = dock;
-       status = acpi_evaluate_object(ds->handle, "_DCK",
-                                       &arg_list, &buffer);
-       if (ACPI_FAILURE(status))
-               err("%s: failed to execute _DCK\n", __FUNCTION__);
-       acpi_os_free(buffer.pointer);
-
-       return status;
-}
-
-
-
-static inline void dock(void)
-{
-       handle_dock(1);
-}
-
-
-
-static inline void undock(void)
-{
-       handle_dock(0);
-}
-
-
-
-/*
- * the _DCK method can do funny things... and sometimes not
- * hah-hah funny.
- *
- * TBD - figure out a way to only call fixups for
- * systems that require them.
- */
-static void post_dock_fixups(void)
-{
-       struct pci_bus *bus;
-       u32 buses;
-       struct dependent_device *dd;
-
-       list_for_each_entry(dd, &ds->pci_dependent_devices, pci_list) {
-               bus = dd->func->slot->bridge->pci_bus;
-
-               /* fixup bad _DCK function that rewrites
-                * secondary bridge on slot
-                */
-               pci_read_config_dword(bus->self,
-                               PCI_PRIMARY_BUS,
-                               &buses);
-
-               if (((buses >> 8) & 0xff) != bus->secondary) {
-                       buses = (buses & 0xff000000)
-                               | ((unsigned int)(bus->primary)     <<  0)
-                               | ((unsigned int)(bus->secondary)   <<  8)
-                               | ((unsigned int)(bus->subordinate) << 16);
-                       pci_write_config_dword(bus->self,
-                                       PCI_PRIMARY_BUS,
-                                       buses);
-               }
-       }
-}
-
-
-
-static void hotplug_pci(u32 type)
-{
-       struct dependent_device *dd;
-
-       list_for_each_entry(dd, &ds->pci_dependent_devices, pci_list)
-               handle_hotplug_event_func(dd->handle, type, dd->func);
-}
-
-
-
-static inline void begin_dock(void)
-{
-       ds->flags |= DOCK_DOCKING;
-}
-
-
-static inline void complete_dock(void)
-{
-       ds->flags &= ~(DOCK_DOCKING);
-       ds->last_dock_time = jiffies;
-}
-
-
-static int dock_in_progress(void)
-{
-       if (ds->flags & DOCK_DOCKING ||
-               ds->last_dock_time == jiffies) {
-               dbg("dock in progress\n");
-               return 1;
-       }
-       return 0;
-}
-
-
-
-static void
-handle_hotplug_event_dock(acpi_handle handle, u32 type, void *context)
-{
-       dbg("%s: enter\n", __FUNCTION__);
-
-       switch (type) {
-               case ACPI_NOTIFY_BUS_CHECK:
-                       dbg("BUS Check\n");
-                       if (!dock_in_progress() && dock_present()) {
-                               begin_dock();
-                               dock();
-                               if (!dock_present()) {
-                                       err("Unable to dock!\n");
-                                       break;
-                               }
-                               post_dock_fixups();
-                               hotplug_pci(type);
-                               complete_dock();
-                       }
-                       break;
-               case ACPI_NOTIFY_EJECT_REQUEST:
-                       dbg("EJECT request\n");
-                       if (!dock_in_progress() && dock_present()) {
-                               hotplug_pci(type);
-                               undock();
-                               eject_dock();
-                               if (dock_present())
-                                       err("Unable to undock!\n");
-                       }
-                       break;
-       }
-}
-
-
-
-
-static acpi_status
-find_dock_ejd(acpi_handle handle, u32 lvl, void *context, void **rv)
-{
-       acpi_status status;
-       acpi_handle tmp;
-       acpi_handle dck_handle = (acpi_handle) context;
-       char objname[64];
-       struct acpi_buffer buffer = { .length = sizeof(objname),
-                                     .pointer = objname };
-       struct acpi_buffer ejd_buffer = {ACPI_ALLOCATE_BUFFER, NULL};
-       union acpi_object *ejd_obj;
-
-       status = acpi_get_handle(handle, "_EJD", &tmp);
-       if (ACPI_FAILURE(status))
-               return AE_OK;
-
-       /* make sure we are dependent on the dock device,
-        * by executing the _EJD method, then getting a handle
-        * to the device referenced by that name.  If that
-        * device handle is the same handle as the dock station
-        * handle, then we are a device dependent on the dock station
-        */
-       acpi_get_name(dck_handle, ACPI_FULL_PATHNAME, &buffer);
-       status = acpi_evaluate_object(handle, "_EJD", NULL, &ejd_buffer);
-       if (ACPI_FAILURE(status)) {
-               err("Unable to execute _EJD!\n");
-               goto find_ejd_out;
-       }
-       ejd_obj = ejd_buffer.pointer;
-       status = acpi_get_handle(NULL, ejd_obj->string.pointer, &tmp);
-       if (ACPI_FAILURE(status))
-               goto find_ejd_out;
-
-       if (tmp == dck_handle) {
-               struct dependent_device *dd;
-               dbg("%s: found device dependent on dock\n", __FUNCTION__);
-               dd = alloc_dependent_device(handle);
-               if (!dd) {
-                       err("Can't allocate memory for dependent device!\n");
-                       goto find_ejd_out;
-               }
-               add_dependent_device(dd);
-       }
-
-find_ejd_out:
-       acpi_os_free(ejd_buffer.pointer);
-       return AE_OK;
-}
-
-
-
-int detect_dependent_devices(acpi_handle *bridge_handle)
-{
-       acpi_status status;
-       int count;
-
-       count = 0;
-
-       status = acpi_walk_namespace(ACPI_TYPE_DEVICE, bridge_handle,
-                                       (u32)1, find_dependent_device,
-                                       (void *)&count, NULL);
-
-       return count;
-}
-
-
-
-
-
-static acpi_status
-find_dock(acpi_handle handle, u32 lvl, void *context, void **rv)
-{
-       int *count = (int *)context;
-
-       if (is_dock(handle)) {
-               dbg("%s: found dock\n", __FUNCTION__);
-               ds = kzalloc(sizeof(*ds), GFP_KERNEL);
-               ds->handle = handle;
-               INIT_LIST_HEAD(&ds->dependent_devices);
-               INIT_LIST_HEAD(&ds->pci_dependent_devices);
-
-               /* look for devices dependent on dock station */
-               acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
-                       ACPI_UINT32_MAX, find_dock_ejd, handle, NULL);
-
-               acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
-                       handle_hotplug_event_dock, ds);
-               (*count)++;
-       }
-
-       return AE_OK;
-}
-
-
-
-
-int find_dock_station(void)
-{
-       int num = 0;
-
-       ds = NULL;
-
-       /* start from the root object, because some laptops define
-        * _DCK methods outside the scope of PCI (IBM x-series laptop)
-        */
-       acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
-                       ACPI_UINT32_MAX, find_dock, &num, NULL);
-
-       return num;
-}
-
-
-
-void remove_dock_station(void)
-{
-       struct dependent_device *dd, *tmp;
-       if (ds) {
-               if (ACPI_FAILURE(acpi_remove_notify_handler(ds->handle,
-                       ACPI_SYSTEM_NOTIFY, handle_hotplug_event_dock)))
-                       err("failed to remove dock notify handler\n");
-
-               /* free all dependent devices */
-               list_for_each_entry_safe(dd, tmp, &ds->dependent_devices,
-                               device_list)
-                       kfree(dd);
-
-               /* no need to touch the pci_dependent_device list,
-                * cause all memory was freed above
-                */
-               kfree(ds);
-       }
-}
-
-
index d370f999782e9575793299203154d5970e695eb9..ef95d12fb32c6beca0fc0b1e6f0c645f8ad9b6dd 100644 (file)
@@ -59,6 +59,7 @@ static LIST_HEAD(bridge_list);
 static void handle_hotplug_event_bridge (acpi_handle, u32, void *);
 static void acpiphp_sanitize_bus(struct pci_bus *bus);
 static void acpiphp_set_hpp_values(acpi_handle handle, struct pci_bus *bus);
+static void handle_hotplug_event_func(acpi_handle handle, u32 type, void *context);
 
 
 /*
@@ -116,6 +117,59 @@ is_ejectable_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
        }
 }
 
+/* callback routine to check for the existance of a pci dock device */
+static acpi_status
+is_pci_dock_device(acpi_handle handle, u32 lvl, void *context, void **rv)
+{
+       int *count = (int *)context;
+
+       if (is_dock_device(handle)) {
+               (*count)++;
+               return AE_CTRL_TERMINATE;
+       } else {
+               return AE_OK;
+       }
+}
+
+
+
+
+/*
+ * the _DCK method can do funny things... and sometimes not
+ * hah-hah funny.
+ *
+ * TBD - figure out a way to only call fixups for
+ * systems that require them.
+ */
+static int post_dock_fixups(struct notifier_block *nb, unsigned long val,
+       void *v)
+{
+       struct acpiphp_func *func = container_of(nb, struct acpiphp_func, nb);
+       struct pci_bus *bus = func->slot->bridge->pci_bus;
+       u32 buses;
+
+       if (!bus->self)
+               return  NOTIFY_OK;
+
+       /* fixup bad _DCK function that rewrites
+        * secondary bridge on slot
+        */
+       pci_read_config_dword(bus->self,
+                       PCI_PRIMARY_BUS,
+                       &buses);
+
+       if (((buses >> 8) & 0xff) != bus->secondary) {
+               buses = (buses & 0xff000000)
+                       | ((unsigned int)(bus->primary)     <<  0)
+                       | ((unsigned int)(bus->secondary)   <<  8)
+                       | ((unsigned int)(bus->subordinate) << 16);
+               pci_write_config_dword(bus->self, PCI_PRIMARY_BUS, buses);
+       }
+       return NOTIFY_OK;
+}
+
+
+
 
 /* callback routine to register each ACPI PCI slot object */
 static acpi_status
@@ -124,7 +178,6 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
        struct acpiphp_bridge *bridge = (struct acpiphp_bridge *)context;
        struct acpiphp_slot *slot;
        struct acpiphp_func *newfunc;
-       struct dependent_device *dd;
        acpi_handle tmp;
        acpi_status status = AE_OK;
        unsigned long adr, sun;
@@ -137,7 +190,7 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
 
        status = acpi_get_handle(handle, "_EJ0", &tmp);
 
-       if (ACPI_FAILURE(status) && !(is_dependent_device(handle)))
+       if (ACPI_FAILURE(status) && !(is_dock_device(handle)))
                return AE_OK;
 
        device = (adr >> 16) & 0xffff;
@@ -162,22 +215,17 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
        if (ACPI_SUCCESS(acpi_get_handle(handle, "_PS3", &tmp)))
                newfunc->flags |= FUNC_HAS_PS3;
 
-       if (ACPI_SUCCESS(acpi_get_handle(handle, "_DCK", &tmp))) {
+       if (ACPI_SUCCESS(acpi_get_handle(handle, "_DCK", &tmp)))
                newfunc->flags |= FUNC_HAS_DCK;
-               /* add to devices dependent on dock station,
-                * because this may actually be the dock bridge
-                */
-               dd = alloc_dependent_device(handle);
-                if (!dd)
-                        err("Can't allocate memory for "
-                               "new dependent device!\n");
-               else
-                       add_dependent_device(dd);
-       }
 
        status = acpi_evaluate_integer(handle, "_SUN", NULL, &sun);
-       if (ACPI_FAILURE(status))
-               sun = -1;
+       if (ACPI_FAILURE(status)) {
+               /*
+                * use the count of the number of slots we've found
+                * for the number of the slot
+                */
+               sun = bridge->nr_slots+1;
+       }
 
        /* search for objects that share the same slot */
        for (slot = bridge->slots; slot; slot = slot->next)
@@ -225,20 +273,23 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
                slot->flags |= (SLOT_ENABLED | SLOT_POWEREDON);
        }
 
-       /* if this is a device dependent on a dock station,
-        * associate the acpiphp_func to the dependent_device
-        * struct.
-        */
-       if ((dd = get_dependent_device(handle))) {
-               newfunc->flags |= FUNC_IS_DD;
-               /*
-                * we don't want any devices which is dependent
-                * on the dock to have it's _EJ0 method executed.
-                * because we need to run _DCK first.
+       if (is_dock_device(handle)) {
+               /* we don't want to call this device's _EJ0
+                * because we want the dock notify handler
+                * to call it after it calls _DCK
                 */
                newfunc->flags &= ~FUNC_HAS_EJ0;
-               dd->func = newfunc;
-               add_pci_dependent_device(dd);
+               if (register_hotplug_dock_device(handle,
+                       handle_hotplug_event_func, newfunc))
+                       dbg("failed to register dock device\n");
+
+               /* we need to be notified when dock events happen
+                * outside of the hotplug operation, since we may
+                * need to do fixups before we can hotplug.
+                */
+               newfunc->nb.notifier_call = post_dock_fixups;
+               if (register_dock_notifier(&newfunc->nb))
+                       dbg("failed to register a dock notifier");
        }
 
        /* install notify handler */
@@ -277,6 +328,15 @@ static int detect_ejectable_slots(acpi_handle *bridge_handle)
        status = acpi_walk_namespace(ACPI_TYPE_DEVICE, bridge_handle, (u32)1,
                                     is_ejectable_slot, (void *)&count, NULL);
 
+       /*
+        * we also need to add this bridge if there is a dock bridge or
+        * other pci device on a dock station (removable)
+        */
+       if (!count)
+               status = acpi_walk_namespace(ACPI_TYPE_DEVICE, bridge_handle,
+                               (u32)1, is_pci_dock_device, (void *)&count,
+                               NULL);
+
        return count;
 }
 
@@ -487,8 +547,7 @@ find_p2p_bridge(acpi_handle handle, u32 lvl, void *context, void **rv)
                goto out;
 
        /* check if this bridge has ejectable slots */
-       if ((detect_ejectable_slots(handle) > 0) ||
-               (detect_dependent_devices(handle) > 0)) {
+       if ((detect_ejectable_slots(handle) > 0)) {
                dbg("found PCI-to-PCI bridge at PCI %s\n", pci_name(dev));
                add_p2p_bridge(handle, dev);
        }
@@ -605,6 +664,10 @@ static void cleanup_bridge(struct acpiphp_bridge *bridge)
                list_for_each_safe (list, tmp, &slot->funcs) {
                        struct acpiphp_func *func;
                        func = list_entry(list, struct acpiphp_func, sibling);
+                       if (is_dock_device(func->handle)) {
+                               unregister_hotplug_dock_device(func->handle);
+                               unregister_dock_notifier(&func->nb);
+                       }
                        if (!(func->flags & FUNC_HAS_DCK)) {
                                status = acpi_remove_notify_handler(func->handle,
                                                ACPI_SYSTEM_NOTIFY,
@@ -1440,7 +1503,7 @@ static void handle_hotplug_event_bridge(acpi_handle handle, u32 type, void *cont
  * handles ACPI event notification on slots
  *
  */
-void handle_hotplug_event_func(acpi_handle handle, u32 type, void *context)
+static void handle_hotplug_event_func(acpi_handle handle, u32 type, void *context)
 {
        struct acpiphp_func *func;
        char objname[64];
index 037ce4c916879b8ef04a47c3ba55c9bbb3ba2fed..d5df5871cfa200eb5cfb1c67408340c31eff82b3 100644 (file)
@@ -25,7 +25,6 @@
  * Send feedback to <scottm@somanetworks.com>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
@@ -348,7 +347,7 @@ cpci_hp_intr(int irq, void *data, struct pt_regs *regs)
        dbg("entered cpci_hp_intr");
 
        /* Check to see if it was our interrupt */
-       if ((controller->irq_flags & SA_SHIRQ) &&
+       if ((controller->irq_flags & IRQF_SHARED) &&
            !controller->ops->check_irq(controller->dev_id)) {
                dbg("exited cpci_hp_intr, not our interrupt");
                return IRQ_NONE;
index 225b5e551dd6f53133b982087624b541310bc0ee..02be74caa89f3db8f7576bdafbc4667130efcb87 100644 (file)
@@ -23,7 +23,6 @@
  * Send feedback to <scottm@somanetworks.com>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
index 2d4639d6841f4a6c93e29d6d3a2c9d5713ca3309..e847f0d6c7fea74dd00e3a757a7c2ea8b4e2d159 100644 (file)
@@ -34,7 +34,6 @@
  * Send feedback to <scottm@somanetworks.com>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/errno.h>
index 1ec165df85223e4495ebb310b2702b70a1e14fd6..1c12e9171097cba1de5dffb6f13ea605e9116d59 100644 (file)
  * Send feedback to <scottm@somanetworks.com>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/init.h>
 #include <linux/errno.h>
 #include <linux/pci.h>
-#include <linux/signal.h>      /* SA_SHIRQ */
+#include <linux/interrupt.h>
+#include <linux/signal.h>      /* IRQF_SHARED */
 #include "cpci_hotplug.h"
 #include "cpcihp_zt5550.h"
 
@@ -220,7 +220,7 @@ static int zt5550_hc_init_one (struct pci_dev *pdev, const struct pci_device_id
        zt5550_hpc.ops = &zt5550_hpc_ops;
        if(!poll) {
                zt5550_hpc.irq = hc_dev->irq;
-               zt5550_hpc.irq_flags = SA_SHIRQ;
+               zt5550_hpc.irq_flags = IRQF_SHARED;
                zt5550_hpc.dev_id = hc_dev;
 
                zt5550_hpc_ops.enable_irq = zt5550_hc_enable_irq;
index f8658d63f0773ca7022505bbe0aef995e4aaca12..1fc259913b68448b5a0b7e798d0b68ca08ae57e8 100644 (file)
@@ -29,7 +29,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/kernel.h>
@@ -1189,7 +1188,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        /* set up the interrupt */
        dbg("HPC interrupt = %d \n", ctrl->interrupt);
        if (request_irq(ctrl->interrupt, cpqhp_ctrl_intr,
-                       SA_SHIRQ, MY_NAME, ctrl)) {
+                       IRQF_SHARED, MY_NAME, ctrl)) {
                err("Can't get irq %d for the hotplug pci controller\n",
                        ctrl->interrupt);
                rc = -ENODEV;
index 55d2dc7e39cad5c17237852e210799a2a20f348c..ae2dd36efef2c0a06fbeaa6a16cc145c63e927b5 100644 (file)
@@ -26,7 +26,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
index ac98a11bd1ebca08cb2ebe7977d75f227dd90803..cf0878917537e912425b8f619c0564765da39f94 100644 (file)
@@ -26,7 +26,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
index 00b81a7bdd266a9513a6c39506236bb52c1c3622..0d9688952f4af4cba74e1dfb296da89693d08934 100644 (file)
@@ -26,7 +26,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
index bbfeed767ff1f894e459883fa3936129cb52489a..8b3da007e859abc803a9109ba046ba31e6be432c 100644 (file)
@@ -26,7 +26,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
index 71b80c23e8cecd70e8e80a6d97c6cfc1bbaa69fd..dd2b762777c4bbb72a8086401173c6e9e2707ce8 100644 (file)
@@ -32,7 +32,6 @@
  * Enabling PCI devices is left as an exercise for the reader...
  *
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/pci.h>
index c4282902cb5245494ba84870d64432b71b203154..b7b378df89e3ffeb2a3fda1debb70558a02b401d 100644 (file)
@@ -27,7 +27,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/kernel.h>
index 11f7858f0064f7a6ef992e7de171468e53806208..0d8fb6e607a1dd38a6f43c47ae650a3337fa6c78 100644 (file)
@@ -1458,7 +1458,7 @@ int pcie_init(struct controller * ctrl, struct pcie_device *dev)
                start_int_poll_timer( php_ctlr, 10 );   /* start with 10 second delay */
        } else {
                /* Installs the interrupt handler */
-               rc = request_irq(php_ctlr->irq, pcie_isr, SA_SHIRQ, MY_NAME, (void *) ctrl);
+               rc = request_irq(php_ctlr->irq, pcie_isr, IRQF_SHARED, MY_NAME, (void *) ctrl);
                dbg("%s: request_irq %d for hpc%d (returns %d)\n", __FUNCTION__, php_ctlr->irq, ctlr_seq_num, rc);
                if (rc) {
                        err("Can't get irq %d for the hotplug controller\n", php_ctlr->irq);
index 0a46f549676a4287e32487bdfc19d5896e442ec7..8ad446605f756fe3afad4feaea3d9e7c82cd0a1a 100644 (file)
@@ -28,7 +28,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/kernel.h>
index 638004546700a9dd809a887914be8a4fe3f681e6..076bd6dcafae6ffa588898f2930f47c3f9833a10 100644 (file)
@@ -22,7 +22,6 @@
  * Send feedback to <lxie@us.ibm.com>
  *
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
index 45facaad39bddc4ecec7135c0651408a31d0ac73..0f9798df470429a90f08d7f4e8824d5f234fc191 100644 (file)
@@ -1246,7 +1246,7 @@ int shpc_init(struct controller * ctrl, struct pci_dev * pdev)
                } else
                        php_ctlr->irq = pdev->irq;
                
-               rc = request_irq(php_ctlr->irq, shpc_isr, SA_SHIRQ, MY_NAME, (void *) ctrl);
+               rc = request_irq(php_ctlr->irq, shpc_isr, IRQF_SHARED, MY_NAME, (void *) ctrl);
                dbg("%s: request_irq %d for hpc%d (returns %d)\n", __FUNCTION__, php_ctlr->irq, ctlr_seq_num, rc);
                if (rc) {
                        err("Can't get irq %d for the hotplug controller\n", php_ctlr->irq);
index 76d023d8a33b92c7f940c05815434061f47a6adb..36bc7c415af7a8dfe8b0d394dc64913577d6ad96 100644 (file)
@@ -10,7 +10,6 @@
 #include <linux/irq.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
-#include <linux/config.h>
 #include <linux/ioport.h>
 #include <linux/smp_lock.h>
 #include <linux/pci.h>
index 606f9b6f70ebe220617aa437982c4f5287046d40..fdefa7dcd15675758f31c3ce3ababd69368433d4 100644 (file)
@@ -15,7 +15,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/stat.h>
index 4364d793f73b06d8391a872ab22567b1bff41a3d..d1d7333bb71bf17502c0ffd9f0aa2491f2f504ec 100644 (file)
@@ -15,7 +15,6 @@
  *  use the PowerTweak utility (see http://powertweak.sourceforge.net).
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
index cbb69cf41311a947f96fd3231f1d00b070d98082..f5ee7ce16fa61ea6fc4c3e096edc86140fa4e668 100644 (file)
@@ -6,7 +6,6 @@
  *
  * PCI ROM access routines
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
index a4d50940ebebf0f652de3163077d312e30e39269..40569f40e90e8f44d54968413c3dc166de45d620 100644 (file)
@@ -214,11 +214,10 @@ static struct pccard_operations at91_cf_ops = {
 
 /*--------------------------------------------------------------------------*/
 
-static int __init at91_cf_probe(struct device *dev)
+static int __init at91_cf_probe(struct platform_device *pdev)
 {
        struct at91_cf_socket   *cf;
-       struct at91_cf_data     *board = dev->platform_data;
-       struct platform_device  *pdev = to_platform_device(dev);
+       struct at91_cf_data     *board = pdev->dev.platform_data;
        struct resource         *io;
        unsigned int            csa;
        int                     status;
@@ -236,7 +235,7 @@ static int __init at91_cf_probe(struct device *dev)
 
        cf->board = board;
        cf->pdev = pdev;
-       dev_set_drvdata(dev, cf);
+       platform_set_drvdata(pdev, cf);
 
        /* CF takes over CS4, CS5, CS6 */
        csa = at91_sys_read(AT91_EBI_CSA);
@@ -268,9 +267,10 @@ static int __init at91_cf_probe(struct device *dev)
 
        /* must be a GPIO; ergo must trigger on both edges */
        status = request_irq(board->det_pin, at91_cf_irq,
-                       SA_SAMPLE_RANDOM, driver_name, cf);
+                       IRQF_SAMPLE_RANDOM, driver_name, cf);
        if (status < 0)
                goto fail0;
+       device_init_wakeup(&pdev->dev, 1);
 
        /*
         * The card driver will request this irq later as needed.
@@ -280,7 +280,7 @@ static int __init at91_cf_probe(struct device *dev)
         */
        if (board->irq_pin) {
                status = request_irq(board->irq_pin, at91_cf_irq,
-                               SA_SHIRQ, driver_name, cf);
+                               IRQF_SHARED, driver_name, cf);
                if (status < 0)
                        goto fail0a;
                cf->socket.pci_irq = board->irq_pin;
@@ -301,7 +301,7 @@ static int __init at91_cf_probe(struct device *dev)
                board->det_pin, board->irq_pin);
 
        cf->socket.owner = THIS_MODULE;
-       cf->socket.dev.dev = dev;
+       cf->socket.dev.dev = &pdev->dev;
        cf->socket.ops = &at91_cf_ops;
        cf->socket.resource_ops = &pccard_static_ops;
        cf->socket.features = SS_CAP_PCCARD | SS_CAP_STATIC_MAP
@@ -323,21 +323,25 @@ fail1:
                free_irq(board->irq_pin, cf);
 fail0a:
        free_irq(board->det_pin, cf);
+       device_init_wakeup(&pdev->dev, 0);
 fail0:
        at91_sys_write(AT91_EBI_CSA, csa);
        kfree(cf);
        return status;
 }
 
-static int __exit at91_cf_remove(struct device *dev)
+static int __exit at91_cf_remove(struct platform_device *pdev)
 {
-       struct at91_cf_socket   *cf = dev_get_drvdata(dev);
+       struct at91_cf_socket   *cf = platform_get_drvdata(pdev);
+       struct at91_cf_data     *board = cf->board;
        struct resource         *io = cf->socket.io[0].res;
        unsigned int            csa;
 
        pcmcia_unregister_socket(&cf->socket);
-       free_irq(cf->board->irq_pin, cf);
-       free_irq(cf->board->det_pin, cf);
+       if (board->irq_pin)
+               free_irq(board->irq_pin, cf);
+       free_irq(board->det_pin, cf);
+       device_init_wakeup(&pdev->dev, 0);
        iounmap((void __iomem *) cf->socket.io_offset);
        release_mem_region(io->start, io->end + 1 - io->start);
 
@@ -348,26 +352,65 @@ static int __exit at91_cf_remove(struct device *dev)
        return 0;
 }
 
-static struct device_driver at91_cf_driver = {
-       .name           = (char *) driver_name,
-       .bus            = &platform_bus_type,
+#ifdef CONFIG_PM
+
+static int at91_cf_suspend(struct platform_device *pdev, pm_message_t mesg)
+{
+       struct at91_cf_socket   *cf = platform_get_drvdata(pdev);
+       struct at91_cf_data     *board = cf->board;
+
+       pcmcia_socket_dev_suspend(&pdev->dev, mesg);
+       if (device_may_wakeup(&pdev->dev))
+               enable_irq_wake(board->det_pin);
+       else {
+               disable_irq_wake(board->det_pin);
+               disable_irq(board->det_pin);
+       }
+       if (board->irq_pin)
+               disable_irq(board->irq_pin);
+       return 0;
+}
+
+static int at91_cf_resume(struct platform_device *pdev)
+{
+       struct at91_cf_socket   *cf = platform_get_drvdata(pdev);
+       struct at91_cf_data     *board = cf->board;
+
+       if (board->irq_pin)
+               enable_irq(board->irq_pin);
+       if (!device_may_wakeup(&pdev->dev))
+               enable_irq(board->det_pin);
+       pcmcia_socket_dev_resume(&pdev->dev);
+       return 0;
+}
+
+#else
+#define        at91_cf_suspend         NULL
+#define        at91_cf_resume          NULL
+#endif
+
+static struct platform_driver at91_cf_driver = {
+       .driver = {
+               .name           = (char *) driver_name,
+               .owner          = THIS_MODULE,
+       },
        .probe          = at91_cf_probe,
        .remove         = __exit_p(at91_cf_remove),
-       .suspend        = pcmcia_socket_dev_suspend,
-       .resume         = pcmcia_socket_dev_resume,
+       .suspend        = at91_cf_suspend,
+       .resume         = at91_cf_resume,
 };
 
 /*--------------------------------------------------------------------------*/
 
 static int __init at91_cf_init(void)
 {
-       return driver_register(&at91_cf_driver);
+       return platform_driver_register(&at91_cf_driver);
 }
 module_init(at91_cf_init);
 
 static void __exit at91_cf_exit(void)
 {
-       driver_unregister(&at91_cf_driver);
+       platform_driver_unregister(&at91_cf_driver);
 }
 module_exit(at91_cf_exit);
 
index abc13f28ba3f409396fe4b76d6caae9512b96cb3..74e051535d6c0419cad92901dabb9c0737929deb 100644 (file)
@@ -30,7 +30,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -296,7 +295,7 @@ struct pcmcia_low_level db1x00_pcmcia_ops = {
        .socket_suspend         = db1x00_socket_suspend
 };
 
-int __init au1x_board_init(struct device *dev)
+int au1x_board_init(struct device *dev)
 {
        int ret = -ENODEV;
        bcsr->pcmcia = 0; /* turn off power, if it's not already off */
index 971a352816499a0113cb08fc40094e068561d255..d5dd0ce65536bcac012f596d7f07586c0303754b 100644 (file)
@@ -33,7 +33,6 @@
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/init.h>
-#include <linux/config.h>
 #include <linux/cpufreq.h>
 #include <linux/ioport.h>
 #include <linux/kernel.h>
index f2c970b5f4ffa5ef2192b429208255acc10f3cc0..1e467bb54077fed1f5f92175ba240d251e6a256d 100644 (file)
@@ -22,7 +22,6 @@
 #define __ASM_AU1000_PCMCIA_H
 
 /* include the world */
-#include <linux/config.h>
 
 #include <pcmcia/cs_types.h>
 #include <pcmcia/cs.h>
index fd5522ede867c6ea18421493e213aa6eaad7851a..86c0808d6a057920bfe07412cf1e73c9efff7c2a 100644 (file)
@@ -21,7 +21,6 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/delay.h>
index 3162998579c1769be912cd4e792c462102aa8838..f9cd831a3f3159ab18085dae94476976ade6c4fd 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/pm.h>
 #include <linux/pci.h>
 #include <linux/device.h>
+#include <linux/kthread.h>
 #include <asm/system.h>
 #include <asm/irq.h>
 
@@ -176,6 +177,7 @@ static int pccardd(void *__skt);
  */
 int pcmcia_register_socket(struct pcmcia_socket *socket)
 {
+       struct task_struct *tsk;
        int ret;
 
        if (!socket || !socket->ops || !socket->dev.dev || !socket->resource_ops)
@@ -239,15 +241,18 @@ int pcmcia_register_socket(struct pcmcia_socket *socket)
        mutex_init(&socket->skt_mutex);
        spin_lock_init(&socket->thread_lock);
 
-       ret = kernel_thread(pccardd, socket, CLONE_KERNEL);
-       if (ret < 0)
+       tsk = kthread_run(pccardd, socket, "pccardd");
+       if (IS_ERR(tsk)) {
+               ret = PTR_ERR(tsk);
                goto err;
+       }
 
        wait_for_completion(&socket->thread_done);
-       if(!socket->thread) {
+       if (!socket->thread) {
                printk(KERN_WARNING "PCMCIA: warning: socket thread for socket %p did not start\n", socket);
                return -EIO;
        }
+
        pcmcia_parse_events(socket, SS_DETECT);
 
        return 0;
@@ -272,10 +277,8 @@ void pcmcia_unregister_socket(struct pcmcia_socket *socket)
        cs_dbg(socket, 0, "pcmcia_unregister_socket(0x%p)\n", socket->ops);
 
        if (socket->thread) {
-               init_completion(&socket->thread_done);
-               socket->thread = NULL;
                wake_up(&socket->thread_wait);
-               wait_for_completion(&socket->thread_done);
+               kthread_stop(socket->thread);
        }
        release_cis_mem(socket);
 
@@ -630,8 +633,6 @@ static int pccardd(void *__skt)
        DECLARE_WAITQUEUE(wait, current);
        int ret;
 
-       daemonize("pccardd");
-
        skt->thread = current;
        skt->socket = dead_socket;
        skt->ops->init(skt);
@@ -643,7 +644,8 @@ static int pccardd(void *__skt)
                printk(KERN_WARNING "PCMCIA: unable to register socket 0x%p\n",
                        skt);
                skt->thread = NULL;
-               complete_and_exit(&skt->thread_done, 0);
+               complete(&skt->thread_done);
+               return 0;
        }
 
        add_wait_queue(&skt->thread_wait, &wait);
@@ -674,7 +676,7 @@ static int pccardd(void *__skt)
                        continue;
                }
 
-               if (!skt->thread)
+               if (kthread_should_stop())
                        break;
 
                schedule();
@@ -688,7 +690,7 @@ static int pccardd(void *__skt)
        /* remove from the device core */
        class_device_unregister(&skt->dev);
 
-       complete_and_exit(&skt->thread_done, 0);
+       return 0;
 }
 
 /*
@@ -697,11 +699,12 @@ static int pccardd(void *__skt)
  */
 void pcmcia_parse_events(struct pcmcia_socket *s, u_int events)
 {
+       unsigned long flags;
        cs_dbg(s, 4, "parse_events: events %08x\n", events);
        if (s->thread) {
-               spin_lock(&s->thread_lock);
+               spin_lock_irqsave(&s->thread_lock, flags);
                s->thread_events |= events;
-               spin_unlock(&s->thread_lock);
+               spin_unlock_irqrestore(&s->thread_lock, flags);
 
                wake_up(&s->thread_wait);
        }
index c662e4f89d46174cf54b2d8af74c8d63b23fcc10..ad02629c8be21255ed14c595b580b6a93e8a5464 100644 (file)
@@ -761,7 +761,7 @@ static int hs_init_socket(hs_socket_t *sp, int irq, unsigned long mem_base,
        
        hd64465_register_irq_demux(sp->irq, hs_irq_demux, sp);
        
-       if ((err = request_irq(sp->irq, hs_interrupt, SA_INTERRUPT, MODNAME, sp)) < 0)
+       if ((err = request_irq(sp->irq, hs_interrupt, IRQF_DISABLED, MODNAME, sp)) < 0)
            return err;
        if (request_mem_region(sp->mem_base, sp->mem_length, MODNAME) == 0) {
            sp->mem_base = 0;
index d5f03a338c6c50c863debff24b1bfd4ddebe79ad..2163aa75a25759525ac2570a3d92c6980199c012 100644 (file)
@@ -149,7 +149,7 @@ static int __devinit i82092aa_pci_probe(struct pci_dev *dev, const struct pci_de
 
        /* Register the interrupt handler */
        dprintk(KERN_DEBUG "Requesting interrupt %i \n",dev->irq);
-       if ((ret = request_irq(dev->irq, i82092aa_interrupt, SA_SHIRQ, "i82092aa", i82092aa_interrupt))) {
+       if ((ret = request_irq(dev->irq, i82092aa_interrupt, IRQF_SHARED, "i82092aa", i82092aa_interrupt))) {
                printk(KERN_ERR "i82092aa: Failed to register IRQ %d, aborting\n", dev->irq);
                goto err_out_free_res;
        }
index ff51a65d9433af984b04ce8cf2fe88812f023796..1cc2682394b1557e677ca7c122722d8aa301b71d 100644 (file)
@@ -509,7 +509,7 @@ static irqreturn_t i365_count_irq(int irq, void *dev, struct pt_regs *regs)
 static u_int __init test_irq(u_short sock, int irq)
 {
     debug(2, "  testing ISA irq %d\n", irq);
-    if (request_irq(irq, i365_count_irq, SA_PROBEIRQ, "scan",
+    if (request_irq(irq, i365_count_irq, IRQF_PROBE_SHARED, "scan",
                        i365_count_irq) != 0)
        return 1;
     irq_hits = 0; irq_sock = sock;
@@ -562,7 +562,7 @@ static u_int __init isa_scan(u_short sock, u_int mask0)
     } else {
        /* Fallback: just find interrupts that aren't in use */
        for (i = 0; i < 16; i++)
-           if ((mask0 & (1 << i)) && (_check_irq(i, SA_PROBEIRQ) == 0))
+           if ((mask0 & (1 << i)) && (_check_irq(i, IRQF_PROBE_SHARED) == 0))
                mask1 |= (1 << i);
        printk("default");
        /* If scan failed, default to polled status */
@@ -726,7 +726,7 @@ static void __init add_pcic(int ns, int type)
        u_int cs_mask = mask & ((cs_irq) ? (1<<cs_irq) : ~(1<<12));
        for (cs_irq = 15; cs_irq > 0; cs_irq--)
            if ((cs_mask & (1 << cs_irq)) &&
-               (_check_irq(cs_irq, SA_PROBEIRQ) == 0))
+               (_check_irq(cs_irq, IRQF_PROBE_SHARED) == 0))
                break;
        if (cs_irq) {
            grab_irq = 1;
index 071cf485e1a391c88893e6cb8c871444004d6d1c..9e768eaef17a39955dbed341a1410861d732f679 100644 (file)
@@ -10,7 +10,6 @@
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/init.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/fcntl.h>
 #include <linux/string.h>
index 70d5f0748d559fcb6abc63784e5546cbcfb0a5e1..61d50b5620ddab3ef749bb5322fdf43e40e2250b 100644 (file)
@@ -10,7 +10,6 @@
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/init.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/fcntl.h>
 #include <linux/string.h>
index 2c23d758439982be6eb765667e586596a44dea08..420e10aec0ae451c52961cceb9c2e3ca4f5de306 100644 (file)
@@ -232,7 +232,7 @@ static int __init omap_cf_probe(struct device *dev)
        dev_set_drvdata(dev, cf);
 
        /* this primarily just shuts up irq handling noise */
-       status = request_irq(irq, omap_cf_irq, SA_SHIRQ,
+       status = request_irq(irq, omap_cf_irq, IRQF_SHARED,
                        driver_name, cf);
        if (status < 0)
                goto fail0;
index 3131bb0a0095af500d4aa063dbf79e692284cec2..7bf25b88ea314ffdc730d5fef834232aa1116980 100644 (file)
@@ -788,6 +788,7 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
        struct pcmcia_socket *s = p_dev->socket;
        config_t *c;
        int ret = CS_IN_USE, irq = 0;
+       int type;
 
        if (!(s->state & SOCKET_PRESENT))
                return CS_NO_CARD;
@@ -797,6 +798,13 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
        if (c->state & CONFIG_IRQ_REQ)
                return CS_IN_USE;
 
+       /* Decide what type of interrupt we are registering */
+       type = 0;
+       if (s->functions > 1)           /* All of this ought to be handled higher up */
+               type = IRQF_SHARED;
+       if (req->Attributes & IRQ_TYPE_DYNAMIC_SHARING)
+               type = IRQF_SHARED;
+
 #ifdef CONFIG_PCMCIA_PROBE
        if (s->irq.AssignedIRQ != 0) {
                /* If the interrupt is already assigned, it must be the same */
@@ -822,9 +830,7 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
                         * marked as used by the kernel resource management core */
                        ret = request_irq(irq,
                                          (req->Attributes & IRQ_HANDLE_PRESENT) ? req->Handler : test_action,
-                                         ((req->Attributes & IRQ_TYPE_DYNAMIC_SHARING) ||
-                                          (s->functions > 1) ||
-                                          (irq == s->pci_irq)) ? SA_SHIRQ : 0,
+                                         type,
                                          p_dev->devname,
                                          (req->Attributes & IRQ_HANDLE_PRESENT) ? req->Instance : data);
                        if (!ret) {
@@ -839,18 +845,21 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
        if (ret && !s->irq.AssignedIRQ) {
                if (!s->pci_irq)
                        return ret;
+               type = IRQF_SHARED;
                irq = s->pci_irq;
        }
 
-       if (ret && req->Attributes & IRQ_HANDLE_PRESENT) {
-               if (request_irq(irq, req->Handler,
-                               ((req->Attributes & IRQ_TYPE_DYNAMIC_SHARING) ||
-                                (s->functions > 1) ||
-                                (irq == s->pci_irq)) ? SA_SHIRQ : 0,
-                               p_dev->devname, req->Instance))
+       if (ret && (req->Attributes & IRQ_HANDLE_PRESENT)) {
+               if (request_irq(irq, req->Handler, type,  p_dev->devname, req->Instance))
                        return CS_IN_USE;
        }
 
+       /* Make sure the fact the request type was overridden is passed back */
+       if (type == IRQF_SHARED && !(req->Attributes & IRQ_TYPE_DYNAMIC_SHARING)) {
+               req->Attributes |= IRQ_TYPE_DYNAMIC_SHARING;
+               printk(KERN_WARNING "pcmcia: request for exclusive IRQ could not be fulfilled.\n");
+               printk(KERN_WARNING "pcmcia: the driver needs updating to supported shared IRQ lines.\n");
+       }
        c->irq.Attributes = req->Attributes;
        s->irq.AssignedIRQ = req->AssignedIRQ = irq;
        s->irq.Config++;
index 9ee26c1b863566a0d846e4033a424aa3b8f9f68d..22c5e7427dddd13f60575e7b9c18145293f8b19e 100644 (file)
@@ -689,7 +689,7 @@ static int __devinit pd6729_pci_probe(struct pci_dev *dev,
        pci_set_drvdata(dev, socket);
        if (irq_mode == 1) {
                /* Register the interrupt handler */
-               if ((ret = request_irq(dev->irq, pd6729_interrupt, SA_SHIRQ,
+               if ((ret = request_irq(dev->irq, pd6729_interrupt, IRQF_SHARED,
                                                        "pd6729", socket))) {
                        printk(KERN_ERR "pd6729: Failed to register irq %d, "
                                                        "aborting\n", dev->irq);
index 7fa18fb814bc7b862478e38c4d3b3a42f3e79b40..b3518131ea0d502c1677e392ac3242771330e418 100644 (file)
@@ -18,7 +18,6 @@
 
 #include <linux/module.h>
 #include <linux/init.h>
-#include <linux/config.h>
 #include <linux/cpufreq.h>
 #include <linux/ioport.h>
 #include <linux/kernel.h>
index 6d441ec75c6a14bc1fa34e9b31cd866f1c6a8397..c5b2a44b4c3783bc4da19bb2bd481cd2b30088ca 100644 (file)
@@ -32,7 +32,6 @@
 
 #include <linux/module.h>
 #include <linux/init.h>
-#include <linux/config.h>
 #include <linux/platform_device.h>
 
 #include <pcmcia/cs_types.h>
index 81ded52c8959aadc6efc6673de0604f0d11a84a1..658cddfbcf290f3701cf1b70a4f41b9703100ebf 100644 (file)
@@ -5,7 +5,6 @@
  * basically means we handle everything except controlling the
  * power.  Power is machine specific...
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/ioport.h>
index 59c5d968e9f67c00111dcf25f9aacc8802acbb06..31a7abc55b23a5b3056fc1b7f86756d07d0ee92d 100644 (file)
@@ -32,7 +32,6 @@
 
 #include <linux/module.h>
 #include <linux/init.h>
-#include <linux/config.h>
 #include <linux/cpufreq.h>
 #include <linux/ioport.h>
 #include <linux/kernel.h>
index ea7d9ca160b2810ccfe7da19a494f99521cfda4f..ecaa132fa5924aefd4ef7b0e8d4dc2ee5bc6c0b7 100644 (file)
@@ -31,7 +31,6 @@
 ======================================================================*/
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/init.h>
 #include <linux/timer.h>
 #include <linux/mm.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/spinlock.h>
 #include <linux/cpufreq.h>
 
 #include <asm/hardware.h>
 #include <asm/io.h>
-#include <asm/irq.h>
 #include <asm/system.h>
 
 #include "soc_common.h"
@@ -524,7 +523,7 @@ int soc_pcmcia_request_irqs(struct soc_pcmcia_socket *skt,
                if (irqs[i].sock != skt->nr)
                        continue;
                res = request_irq(irqs[i].irq, soc_common_pcmcia_interrupt,
-                                 SA_INTERRUPT, irqs[i].str, skt);
+                                 IRQF_DISABLED, irqs[i].str, skt);
                if (res)
                        break;
                set_irq_type(irqs[i].irq, IRQT_NOEDGE);
index 7a3d1b8e16b926d3f290a6371a15e3d8f9bad654..62e9ebf967f9943ff7eacbad14e6b72900620a07 100644 (file)
@@ -647,6 +647,7 @@ static int ti12xx_2nd_slot_empty(struct yenta_socket *socket)
                 */
                break;
 
+       case PCI_DEVICE_ID_TI_XX12:
        case PCI_DEVICE_ID_TI_X515:
        case PCI_DEVICE_ID_TI_X420:
        case PCI_DEVICE_ID_TI_X620:
index 459e6e1946fd57d8b7c158881d87be256549deec..e076a13db555bafa93f1f6fb7da46b1cb361d79a 100644 (file)
@@ -730,7 +730,7 @@ static int __devinit vrc4171_card_init(void)
 
        retval = vrc4171_add_sockets();
        if (retval == 0)
-               retval = request_irq(vrc4171_irq, pccard_interrupt, SA_SHIRQ,
+               retval = request_irq(vrc4171_irq, pccard_interrupt, IRQF_SHARED,
                                     vrc4171_card_name, vrc4171_sockets);
 
        if (retval < 0) {
index 6004196f7cc10e586f98d9eeb746aaafef422570..d19a9138135f0181b54ef034623bd2ce5dbd7118 100644 (file)
@@ -500,7 +500,7 @@ static int __devinit vrc4173_cardu_probe(struct pci_dev *dev,
                return -ENOMEM;
        }
 
-       if (request_irq(dev->irq, cardu_interrupt, SA_SHIRQ, socket->name, socket) < 0) {
+       if (request_irq(dev->irq, cardu_interrupt, IRQF_SHARED, socket->name, socket) < 0) {
                pcmcia_unregister_socket(socket->pcmcia_socket);
                socket->pcmcia_socket = NULL;
                iounmap(socket->base);
index 4145eb83b9b6d708d57a07da1a0633829d3773f8..1344746381e8dce0fb6020760956d083fb5815ac 100644 (file)
@@ -287,7 +287,10 @@ static int yenta_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
        struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket);
        u16 bridge;
 
-       yenta_set_power(socket, state);
+       /* if powering down: do it immediately */
+       if (state->Vcc == 0)
+               yenta_set_power(socket, state);
+
        socket->io_irq = state->io_irq;
        bridge = config_readw(socket, CB_BRIDGE_CONTROL) & ~(CB_BRIDGE_CRST | CB_BRIDGE_INTR);
        if (cb_readl(socket, CB_SOCKET_STATE) & CB_CBCARD) {
@@ -339,6 +342,10 @@ static int yenta_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
        /* Socket event mask: get card insert/remove events.. */
        cb_writel(socket, CB_SOCKET_EVENT, -1);
        cb_writel(socket, CB_SOCKET_MASK, CB_CDMASK);
+
+       /* if powering up: do it as the last step when the socket is configured */
+       if (state->Vcc != 0)
+               yenta_set_power(socket, state);
        return 0;
 }
 
@@ -916,7 +923,7 @@ static int yenta_probe_cb_irq(struct yenta_socket *socket)
 
        socket->probe_status = 0;
 
-       if (request_irq(socket->cb_irq, yenta_probe_handler, SA_SHIRQ, "yenta", socket)) {
+       if (request_irq(socket->cb_irq, yenta_probe_handler, IRQF_SHARED, "yenta", socket)) {
                printk(KERN_WARNING "Yenta: request_irq() in yenta_probe_cb_irq() failed!\n");
                return -1;
        }
@@ -998,6 +1005,77 @@ static void yenta_config_init(struct yenta_socket *socket)
        config_writew(socket, CB_BRIDGE_CONTROL, bridge);
 }
 
+/**
+ * yenta_fixup_parent_bridge - Fix subordinate bus# of the parent bridge
+ * @cardbus_bridge: The PCI bus which the CardBus bridge bridges to
+ *
+ * Checks if devices on the bus which the CardBus bridge bridges to would be
+ * invisible during PCI scans because of a misconfigured subordinate number
+ * of the parent brige - some BIOSes seem to be too lazy to set it right.
+ * Does the fixup carefully by checking how far it can go without conflicts.
+ * See http://bugzilla.kernel.org/show_bug.cgi?id=2944 for more information.
+ */
+static void yenta_fixup_parent_bridge(struct pci_bus *cardbus_bridge)
+{
+       struct list_head *tmp;
+       unsigned char upper_limit;
+       /*
+        * We only check and fix the parent bridge: All systems which need
+        * this fixup that have been reviewed are laptops and the only bridge
+        * which needed fixing was the parent bridge of the CardBus bridge:
+        */
+       struct pci_bus *bridge_to_fix = cardbus_bridge->parent;
+
+       /* Check bus numbers are already set up correctly: */
+       if (bridge_to_fix->subordinate >= cardbus_bridge->subordinate)
+               return; /* The subordinate number is ok, nothing to do */
+
+       if (!bridge_to_fix->parent)
+               return; /* Root bridges are ok */
+
+       /* stay within the limits of the bus range of the parent: */
+       upper_limit = bridge_to_fix->parent->subordinate;
+
+       /* check the bus ranges of all silbling bridges to prevent overlap */
+       list_for_each(tmp, &bridge_to_fix->parent->children) {
+               struct pci_bus * silbling = pci_bus_b(tmp);
+               /*
+                * If the silbling has a higher secondary bus number
+                * and it's secondary is equal or smaller than our
+                * current upper limit, set the new upper limit to
+                * the bus number below the silbling's range:
+                */
+               if (silbling->secondary > bridge_to_fix->subordinate
+                   && silbling->secondary <= upper_limit)
+                       upper_limit = silbling->secondary - 1;
+       }
+
+       /* Show that the wanted subordinate number is not possible: */
+       if (cardbus_bridge->subordinate > upper_limit)
+               printk(KERN_WARNING "Yenta: Upper limit for fixing this "
+                       "bridge's parent bridge: #%02x\n", upper_limit);
+
+       /* If we have room to increase the bridge's subordinate number, */
+       if (bridge_to_fix->subordinate < upper_limit) {
+
+               /* use the highest number of the hidden bus, within limits */
+               unsigned char subordinate_to_assign =
+                       min(cardbus_bridge->subordinate, upper_limit);
+
+               printk(KERN_INFO "Yenta: Raising subordinate bus# of parent "
+                       "bus (#%02x) from #%02x to #%02x\n",
+                       bridge_to_fix->number,
+                       bridge_to_fix->subordinate, subordinate_to_assign);
+
+               /* Save the new subordinate in the bus struct of the bridge */
+               bridge_to_fix->subordinate = subordinate_to_assign;
+
+               /* and update the PCI config space with the new subordinate */
+               pci_write_config_byte(bridge_to_fix->self,
+                       PCI_SUBORDINATE_BUS, bridge_to_fix->subordinate);
+       }
+}
+
 /*
  * Initialize a cardbus controller. Make sure we have a usable
  * interrupt, and that we can map the cardbus area. Fill in the
@@ -1094,7 +1172,7 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i
 
        /* We must finish initialization here */
 
-       if (!socket->cb_irq || request_irq(socket->cb_irq, yenta_interrupt, SA_SHIRQ, "yenta", socket)) {
+       if (!socket->cb_irq || request_irq(socket->cb_irq, yenta_interrupt, IRQF_SHARED, "yenta", socket)) {
                /* No IRQ or request_irq failed. Poll */
                socket->cb_irq = 0; /* But zero is a valid IRQ number. */
                init_timer(&socket->poll_timer);
@@ -1113,6 +1191,8 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i
        yenta_get_socket_capabilities(socket, isa_interrupts);
        printk(KERN_INFO "Socket status: %08x\n", cb_readl(socket, CB_SOCKET_STATE));
 
+       yenta_fixup_parent_bridge(dev->subordinate);
+
        /* Register it with the pcmcia layer.. */
        ret = pcmcia_register_socket(&socket->socket);
        if (ret == 0) {
@@ -1232,6 +1312,7 @@ static struct pci_device_id yenta_table [] = {
 
        CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_XX21_XX11, TI12XX),
        CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_X515, TI12XX),
+       CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_XX12, TI12XX),
        CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_X420, TI12XX),
        CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_X620, TI12XX),
        CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_7410, TI12XX),
index 0b4adcb60df4060db26bbaef9e6a6c26dc40ff3b..227600cd636048478126adbb20bc7be1157577b1 100644 (file)
@@ -5,7 +5,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/pnp.h>
index e54c153831937f8985a28ded2ccd71a4f55458e5..e161423b4300d7f76c6f2b5a207362e2e4688ed1 100644 (file)
@@ -5,7 +5,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/list.h>
 #include <linux/module.h>
index 3ff7e76b33bde2201ead86a4c49b585d320a20af..0697ab88a9ac5df1fcb04e519438c9a594456e26 100644 (file)
@@ -8,7 +8,6 @@
  
 /* TODO: see if more isapnp functions are needed here */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/isapnp.h>
 #include <linux/string.h>
index ac7c2bb6c69e683a148b4285550b99dfd1bb7c00..f2e0179962e2f85f6aae48db8bacc42c6ac9f700 100644 (file)
@@ -34,7 +34,6 @@
  *  2003-08-11 Resource Management Updates - Adam Belay <ambx1@neo.rr.com>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index cf54b0a3628e64fe2d6c642eb191ba703fd74b18..958c11bedd0d66da73e35de1d7d02f3760aaf91f 100644 (file)
@@ -19,7 +19,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/isapnp.h>
 #include <linux/proc_fs.h>
index 1d7a5b87f4cbc3157e7abbf86d11da638f748eeb..5026b345cb30226c7ed3d13dc3cc664e41e75edd 100644 (file)
@@ -6,7 +6,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/module.h>
 #include <linux/init.h>
index f104577f73e09f7daac4c3523e04b280b28fc779..6cf34a63c79044f39f122633b07d836fb75eb4ef 100644 (file)
@@ -19,7 +19,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
  
-#include <linux/config.h>
 #include <linux/acpi.h>
 #include <linux/pnp.h>
 #include <acpi/acpi_bus.h>
index 3a4a644c26869bbf7b6ce10820fe65e0fb437c9c..21226888185789f24d112b32ab78d1b76e63d458 100644 (file)
@@ -74,7 +74,7 @@ static void decode_irq_flags(int flag, int *triggering, int *polarity)
 
 static void
 pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res, u32 gsi,
-       int triggering, int polarity)
+       int triggering, int polarity, int shareable)
 {
        int i = 0;
        int irq;
@@ -95,6 +95,9 @@ pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res, u32 gsi,
                return;
        }
 
+       if (shareable)
+               res->irq_resource[i].flags |= IORESOURCE_IRQ_SHAREABLE;
+
        res->irq_resource[i].start = irq;
        res->irq_resource[i].end = irq;
        pcibios_penalize_isa_irq(irq, 1);
@@ -194,7 +197,8 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
                        pnpacpi_parse_allocated_irqresource(res_table,
                                res->data.irq.interrupts[i],
                                res->data.irq.triggering,
-                               res->data.irq.polarity);
+                               res->data.irq.polarity,
+                               res->data.irq.sharable);
                }
                break;
 
@@ -255,7 +259,8 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
                        pnpacpi_parse_allocated_irqresource(res_table,
                                res->data.extended_irq.interrupts[i],
                                res->data.extended_irq.triggering,
-                               res->data.extended_irq.polarity);
+                               res->data.extended_irq.polarity,
+                               res->data.extended_irq.sharable);
                }
                break;
 
index c89c98a2cca8004dd826130a4bbf5e93efa724f3..ef508a4de557fd23ca4816f9313b3e4a66846dea 100644 (file)
@@ -3,7 +3,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/ctype.h>
 #include <linux/pnp.h>
 #include <linux/pnpbios.h>
index 8936b0cb2ec3718bc60937efcace3bc22c27b2fb..e97ecefe85841c966be495f27588ea128684bc25 100644 (file)
@@ -11,7 +11,6 @@
  *  Copyright (c) 1999 Martin Mares <mj@ucw.cz>
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
index 7bb892f58cc09815da0ee5963417cbc312bf0f9b..5c8ec21e1086c71a0440508f6774098d9a504a35 100644 (file)
@@ -6,7 +6,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/interrupt.h>
@@ -396,7 +395,8 @@ int pnp_check_irq(struct pnp_dev * dev, int idx)
        /* check if the resource is already in use, skip if the
         * device is active because it itself may be in use */
        if(!dev->active) {
-               if (request_irq(*irq, pnp_test_handler, SA_INTERRUPT, "pnp", NULL))
+               if (request_irq(*irq, pnp_test_handler,
+                               IRQF_DISABLED|IRQF_PROBE_SHARED, "pnp", NULL))
                        return 0;
                free_irq(*irq, NULL);
        }
index 61fe998944bd1ce0d0f6816687f964861e8d8934..946a0dcd627dcc0a30c48246827057a30bae7076 100644 (file)
@@ -5,7 +5,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/ctype.h>
 #include <linux/pnp.h>
index 94e30fe4b8f3242b17f8adc5c1623669d2a513b6..7bf7b2c88245358e023b1ddc8d97a19999b1a047 100644 (file)
@@ -10,7 +10,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 
index bef9316e95df8b610302f0716f930b52bae383c7..5687b8fcbf93d4f62e7a666704dc512cf06b3397 100644 (file)
@@ -10,7 +10,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/rio.h>
 #include <linux/rio_drv.h>
index 5e382470faa27fdb538e263ed6e83dee556d7f47..f644807da2f911b92503abcb18c91a6868fd5a00 100644 (file)
@@ -11,7 +11,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 
index f2fc81a9074d8af26c79940f87ddaa8c98712999..f5b9f187a9300bcac74143cd0b5c999c406608ed 100644 (file)
@@ -15,7 +15,7 @@ config RTC_CLASS
        help
          Generic RTC class support. If you say yes here, you will
          be allowed to plug one or more RTCs to your system. You will
-         probably want to enable one of more of the interfaces below.
+         probably want to enable one or more of the interfaces below.
 
          This driver can also be built as a module. If so, the module
          will be called rtc-class.
@@ -182,6 +182,22 @@ config RTC_DRV_RS5C372
          This driver can also be built as a module. If so, the module
          will be called rtc-rs5c372.
 
+config RTC_DRV_S3C
+       tristate "Samsung S3C series SoC RTC"
+       depends on RTC_CLASS && ARCH_S3C2410
+       help
+         RTC (Realtime Clock) driver for the clock inbuilt into the
+         Samsung S3C24XX series of SoCs. This can provide periodic
+         interrupt rates from 1Hz to 64Hz for user programs, and
+         wakeup from Alarm.
+
+         The driver currently supports the common features on all the
+         S3C24XX range, such as the S3C2410, S3C2412, S3C2413, S3C2440
+         and S3C2442.
+
+         This driver can also be build as a module. If so, the module
+         will be called rtc-s3c.
+
 config RTC_DRV_M48T86
        tristate "ST M48T86/Dallas DS12887"
        depends on RTC_CLASS
index da5e38774e130f444f1eb43f31740f5bae404abe..54220714ff49b348ee68edfc56a5a2368efbb9a0 100644 (file)
@@ -19,6 +19,7 @@ obj-$(CONFIG_RTC_DRV_DS1742)  += rtc-ds1742.o
 obj-$(CONFIG_RTC_DRV_PCF8563)  += rtc-pcf8563.o
 obj-$(CONFIG_RTC_DRV_PCF8583)  += rtc-pcf8583.o
 obj-$(CONFIG_RTC_DRV_RS5C372)  += rtc-rs5c372.o
+obj-$(CONFIG_RTC_DRV_S3C)      += rtc-s3c.o
 obj-$(CONFIG_RTC_DRV_RS5C348)  += rtc-rs5c348.o
 obj-$(CONFIG_RTC_DRV_M48T86)   += rtc-m48t86.o
 obj-$(CONFIG_RTC_DRV_DS1553)   += rtc-ds1553.o
index b676f443c17e4f0264a7856fec156b3acf133338..dfd0ce86f6a0d82e445752653e667899959d22cd 100644 (file)
@@ -293,7 +293,7 @@ static int __init at91_rtc_probe(struct platform_device *pdev)
                                        AT91_RTC_CALEV);
 
        ret = request_irq(AT91_ID_SYS, at91_rtc_interrupt,
-                               SA_SHIRQ, "at91_rtc", pdev);
+                               IRQF_SHARED, "at91_rtc", pdev);
        if (ret) {
                printk(KERN_ERR "at91_rtc: IRQ %d already in use.\n",
                                AT91_ID_SYS);
index 762521a1419cf296f080e7e4672e430f3029decc..209001495474f9f88b74cbee8bb410fd7b868523 100644 (file)
@@ -341,7 +341,7 @@ static int __init ds1553_rtc_probe(struct platform_device *pdev)
 
        if (pdata->irq >= 0) {
                writeb(0, ioaddr + RTC_INTERRUPTS);
-               if (request_irq(pdata->irq, ds1553_rtc_interrupt, SA_SHIRQ,
+               if (request_irq(pdata->irq, ds1553_rtc_interrupt, IRQF_SHARED,
                                pdev->name, pdev) < 0) {
                        dev_warn(&pdev->dev, "interrupt not available.\n");
                        pdata->irq = -1;
index ee538632660bd0fef1ab72b6f7c737b7c60fb781..d6d1c5726b0ee87347e9532a1da267c6cb1c79e3 100644 (file)
@@ -173,7 +173,7 @@ static int pl031_probe(struct amba_device *adev, void *id)
                goto out_no_remap;
        }
 
-       if (request_irq(adev->irq[0], pl031_interrupt, SA_INTERRUPT,
+       if (request_irq(adev->irq[0], pl031_interrupt, IRQF_DISABLED,
                        "rtc-pl031", ldata->rtc)) {
                ret = -EIO;
                goto out_no_irq;
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
new file mode 100644 (file)
index 0000000..d6d1bff
--- /dev/null
@@ -0,0 +1,607 @@
+/* drivers/rtc/rtc-s3c.c
+ *
+ * Copyright (c) 2004,2006 Simtec Electronics
+ *     Ben Dooks, <ben@simtec.co.uk>
+ *     http://armlinux.simtec.co.uk/
+ *
+ * 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.
+ *
+ * S3C2410/S3C2440/S3C24XX Internal RTC Driver
+*/
+
+#include <linux/module.h>
+#include <linux/fs.h>
+#include <linux/string.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/interrupt.h>
+#include <linux/rtc.h>
+#include <linux/bcd.h>
+#include <linux/clk.h>
+
+#include <asm/hardware.h>
+#include <asm/uaccess.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/rtc.h>
+
+#include <asm/mach/time.h>
+
+#include <asm/arch/regs-rtc.h>
+
+/* I have yet to find an S3C implementation with more than one
+ * of these rtc blocks in */
+
+static struct resource *s3c_rtc_mem;
+
+static void __iomem *s3c_rtc_base;
+static int s3c_rtc_alarmno = NO_IRQ;
+static int s3c_rtc_tickno  = NO_IRQ;
+static int s3c_rtc_freq    = 1;
+
+static DEFINE_SPINLOCK(s3c_rtc_pie_lock);
+static unsigned int tick_count;
+
+/* IRQ Handlers */
+
+static irqreturn_t s3c_rtc_alarmirq(int irq, void *id, struct pt_regs *r)
+{
+       struct rtc_device *rdev = id;
+
+       rtc_update_irq(&rdev->class_dev, 1, RTC_AF | RTC_IRQF);
+       return IRQ_HANDLED;
+}
+
+static irqreturn_t s3c_rtc_tickirq(int irq, void *id, struct pt_regs *r)
+{
+       struct rtc_device *rdev = id;
+
+       rtc_update_irq(&rdev->class_dev, tick_count++, RTC_PF | RTC_IRQF);
+       return IRQ_HANDLED;
+}
+
+/* Update control registers */
+static void s3c_rtc_setaie(int to)
+{
+       unsigned int tmp;
+
+       pr_debug("%s: aie=%d\n", __FUNCTION__, to);
+
+       tmp = readb(S3C2410_RTCALM) & ~S3C2410_RTCALM_ALMEN;
+
+       if (to)
+               tmp |= S3C2410_RTCALM_ALMEN;
+
+       writeb(tmp, S3C2410_RTCALM);
+}
+
+static void s3c_rtc_setpie(int to)
+{
+       unsigned int tmp;
+
+       pr_debug("%s: pie=%d\n", __FUNCTION__, to);
+
+       spin_lock_irq(&s3c_rtc_pie_lock);
+       tmp = readb(S3C2410_TICNT) & ~S3C2410_TICNT_ENABLE;
+
+       if (to)
+               tmp |= S3C2410_TICNT_ENABLE;
+
+       writeb(tmp, S3C2410_TICNT);
+       spin_unlock_irq(&s3c_rtc_pie_lock);
+}
+
+static void s3c_rtc_setfreq(int freq)
+{
+       unsigned int tmp;
+
+       spin_lock_irq(&s3c_rtc_pie_lock);
+       tmp = readb(S3C2410_TICNT) & S3C2410_TICNT_ENABLE;
+
+       s3c_rtc_freq = freq;
+
+       tmp |= (128 / freq)-1;
+
+       writeb(tmp, S3C2410_TICNT);
+       spin_unlock_irq(&s3c_rtc_pie_lock);
+}
+
+/* Time read/write */
+
+static int s3c_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm)
+{
+       unsigned int have_retried = 0;
+
+ retry_get_time:
+       rtc_tm->tm_min  = readb(S3C2410_RTCMIN);
+       rtc_tm->tm_hour = readb(S3C2410_RTCHOUR);
+       rtc_tm->tm_mday = readb(S3C2410_RTCDATE);
+       rtc_tm->tm_mon  = readb(S3C2410_RTCMON);
+       rtc_tm->tm_year = readb(S3C2410_RTCYEAR);
+       rtc_tm->tm_sec  = readb(S3C2410_RTCSEC);
+
+       /* the only way to work out wether the system was mid-update
+        * when we read it is to check the second counter, and if it
+        * is zero, then we re-try the entire read
+        */
+
+       if (rtc_tm->tm_sec == 0 && !have_retried) {
+               have_retried = 1;
+               goto retry_get_time;
+       }
+
+       pr_debug("read time %02x.%02x.%02x %02x/%02x/%02x\n",
+                rtc_tm->tm_year, rtc_tm->tm_mon, rtc_tm->tm_mday,
+                rtc_tm->tm_hour, rtc_tm->tm_min, rtc_tm->tm_sec);
+
+       BCD_TO_BIN(rtc_tm->tm_sec);
+       BCD_TO_BIN(rtc_tm->tm_min);
+       BCD_TO_BIN(rtc_tm->tm_hour);
+       BCD_TO_BIN(rtc_tm->tm_mday);
+       BCD_TO_BIN(rtc_tm->tm_mon);
+       BCD_TO_BIN(rtc_tm->tm_year);
+
+       rtc_tm->tm_year += 100;
+       rtc_tm->tm_mon -= 1;
+
+       return 0;
+}
+
+static int s3c_rtc_settime(struct device *dev, struct rtc_time *tm)
+{
+       /* the rtc gets round the y2k problem by just not supporting it */
+
+       if (tm->tm_year < 100)
+               return -EINVAL;
+
+       writeb(BIN2BCD(tm->tm_sec),  S3C2410_RTCSEC);
+       writeb(BIN2BCD(tm->tm_min),  S3C2410_RTCMIN);
+       writeb(BIN2BCD(tm->tm_hour), S3C2410_RTCHOUR);
+       writeb(BIN2BCD(tm->tm_mday), S3C2410_RTCDATE);
+       writeb(BIN2BCD(tm->tm_mon + 1), S3C2410_RTCMON);
+       writeb(BIN2BCD(tm->tm_year - 100), S3C2410_RTCYEAR);
+
+       return 0;
+}
+
+static int s3c_rtc_getalarm(struct device *dev, struct rtc_wkalrm *alrm)
+{
+       struct rtc_time *alm_tm = &alrm->time;
+       unsigned int alm_en;
+
+       alm_tm->tm_sec  = readb(S3C2410_ALMSEC);
+       alm_tm->tm_min  = readb(S3C2410_ALMMIN);
+       alm_tm->tm_hour = readb(S3C2410_ALMHOUR);
+       alm_tm->tm_mon  = readb(S3C2410_ALMMON);
+       alm_tm->tm_mday = readb(S3C2410_ALMDATE);
+       alm_tm->tm_year = readb(S3C2410_ALMYEAR);
+
+       alm_en = readb(S3C2410_RTCALM);
+
+       pr_debug("read alarm %02x %02x.%02x.%02x %02x/%02x/%02x\n",
+                alm_en,
+                alm_tm->tm_year, alm_tm->tm_mon, alm_tm->tm_mday,
+                alm_tm->tm_hour, alm_tm->tm_min, alm_tm->tm_sec);
+
+
+       /* decode the alarm enable field */
+
+       if (alm_en & S3C2410_RTCALM_SECEN)
+               BCD_TO_BIN(alm_tm->tm_sec);
+       else
+               alm_tm->tm_sec = 0xff;
+
+       if (alm_en & S3C2410_RTCALM_MINEN)
+               BCD_TO_BIN(alm_tm->tm_min);
+       else
+               alm_tm->tm_min = 0xff;
+
+       if (alm_en & S3C2410_RTCALM_HOUREN)
+               BCD_TO_BIN(alm_tm->tm_hour);
+       else
+               alm_tm->tm_hour = 0xff;
+
+       if (alm_en & S3C2410_RTCALM_DAYEN)
+               BCD_TO_BIN(alm_tm->tm_mday);
+       else
+               alm_tm->tm_mday = 0xff;
+
+       if (alm_en & S3C2410_RTCALM_MONEN) {
+               BCD_TO_BIN(alm_tm->tm_mon);
+               alm_tm->tm_mon -= 1;
+       } else {
+               alm_tm->tm_mon = 0xff;
+       }
+
+       if (alm_en & S3C2410_RTCALM_YEAREN)
+               BCD_TO_BIN(alm_tm->tm_year);
+       else
+               alm_tm->tm_year = 0xffff;
+
+       return 0;
+}
+
+static int s3c_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm)
+{
+       struct rtc_time *tm = &alrm->time;
+       unsigned int alrm_en;
+
+       pr_debug("s3c_rtc_setalarm: %d, %02x/%02x/%02x %02x.%02x.%02x\n",
+                alrm->enabled,
+                tm->tm_mday & 0xff, tm->tm_mon & 0xff, tm->tm_year & 0xff,
+                tm->tm_hour & 0xff, tm->tm_min & 0xff, tm->tm_sec);
+
+
+       alrm_en = readb(S3C2410_RTCALM) & S3C2410_RTCALM_ALMEN;
+       writeb(0x00, S3C2410_RTCALM);
+
+       if (tm->tm_sec < 60 && tm->tm_sec >= 0) {
+               alrm_en |= S3C2410_RTCALM_SECEN;
+               writeb(BIN2BCD(tm->tm_sec), S3C2410_ALMSEC);
+       }
+
+       if (tm->tm_min < 60 && tm->tm_min >= 0) {
+               alrm_en |= S3C2410_RTCALM_MINEN;
+               writeb(BIN2BCD(tm->tm_min), S3C2410_ALMMIN);
+       }
+
+       if (tm->tm_hour < 24 && tm->tm_hour >= 0) {
+               alrm_en |= S3C2410_RTCALM_HOUREN;
+               writeb(BIN2BCD(tm->tm_hour), S3C2410_ALMHOUR);
+       }
+
+       pr_debug("setting S3C2410_RTCALM to %08x\n", alrm_en);
+
+       writeb(alrm_en, S3C2410_RTCALM);
+
+       if (0) {
+               alrm_en = readb(S3C2410_RTCALM);
+               alrm_en &= ~S3C2410_RTCALM_ALMEN;
+               writeb(alrm_en, S3C2410_RTCALM);
+               disable_irq_wake(s3c_rtc_alarmno);
+       }
+
+       if (alrm->enabled)
+               enable_irq_wake(s3c_rtc_alarmno);
+       else
+               disable_irq_wake(s3c_rtc_alarmno);
+
+       return 0;
+}
+
+static int s3c_rtc_ioctl(struct device *dev,
+                        unsigned int cmd, unsigned long arg)
+{
+       unsigned int ret = -ENOIOCTLCMD;
+
+       switch (cmd) {
+       case RTC_AIE_OFF:
+       case RTC_AIE_ON:
+               s3c_rtc_setaie((cmd == RTC_AIE_ON) ? 1 : 0);
+               ret = 0;
+               break;
+
+       case RTC_PIE_OFF:
+       case RTC_PIE_ON:
+               tick_count = 0;
+               s3c_rtc_setpie((cmd == RTC_PIE_ON) ? 1 : 0);
+               ret = 0;
+               break;
+
+       case RTC_IRQP_READ:
+               ret = put_user(s3c_rtc_freq, (unsigned long __user *)arg);
+               break;
+
+       case RTC_IRQP_SET:
+               /* check for power of 2 */
+
+               if ((arg & (arg-1)) != 0 || arg < 1) {
+                       ret = -EINVAL;
+                       goto exit;
+               }
+
+               pr_debug("s3c2410_rtc: setting frequency %ld\n", arg);
+
+               s3c_rtc_setfreq(arg);
+               ret = 0;
+               break;
+
+       case RTC_UIE_ON:
+       case RTC_UIE_OFF:
+               ret = -EINVAL;
+       }
+
+ exit:
+       return ret;
+}
+
+static int s3c_rtc_proc(struct device *dev, struct seq_file *seq)
+{
+       unsigned int rtcalm = readb(S3C2410_RTCALM);
+       unsigned int ticnt = readb (S3C2410_TICNT);
+
+       seq_printf(seq, "alarm_IRQ\t: %s\n",
+                  (rtcalm & S3C2410_RTCALM_ALMEN) ? "yes" : "no" );
+
+       seq_printf(seq, "periodic_IRQ\t: %s\n",
+                    (ticnt & S3C2410_TICNT_ENABLE) ? "yes" : "no" );
+
+       seq_printf(seq, "periodic_freq\t: %d\n", s3c_rtc_freq);
+
+       return 0;
+}
+
+static int s3c_rtc_open(struct device *dev)
+{
+       struct platform_device *pdev = to_platform_device(dev);
+       struct rtc_device *rtc_dev = platform_get_drvdata(pdev);
+       int ret;
+
+       ret = request_irq(s3c_rtc_alarmno, s3c_rtc_alarmirq,
+                         SA_INTERRUPT,  "s3c2410-rtc alarm", rtc_dev);
+
+       if (ret) {
+               dev_err(dev, "IRQ%d error %d\n", s3c_rtc_alarmno, ret);
+               return ret;
+       }
+
+       ret = request_irq(s3c_rtc_tickno, s3c_rtc_tickirq,
+                         SA_INTERRUPT,  "s3c2410-rtc tick", rtc_dev);
+
+       if (ret) {
+               dev_err(dev, "IRQ%d error %d\n", s3c_rtc_tickno, ret);
+               goto tick_err;
+       }
+
+       return ret;
+
+ tick_err:
+       free_irq(s3c_rtc_alarmno, rtc_dev);
+       return ret;
+}
+
+static void s3c_rtc_release(struct device *dev)
+{
+       struct platform_device *pdev = to_platform_device(dev);
+       struct rtc_device *rtc_dev = platform_get_drvdata(pdev);
+
+       /* do not clear AIE here, it may be needed for wake */
+
+       s3c_rtc_setpie(0);
+       free_irq(s3c_rtc_alarmno, rtc_dev);
+       free_irq(s3c_rtc_tickno, rtc_dev);
+}
+
+static struct rtc_class_ops s3c_rtcops = {
+       .open           = s3c_rtc_open,
+       .release        = s3c_rtc_release,
+       .ioctl          = s3c_rtc_ioctl,
+       .read_time      = s3c_rtc_gettime,
+       .set_time       = s3c_rtc_settime,
+       .read_alarm     = s3c_rtc_getalarm,
+       .set_alarm      = s3c_rtc_setalarm,
+       .proc           = s3c_rtc_proc,
+};
+
+static void s3c_rtc_enable(struct platform_device *pdev, int en)
+{
+       unsigned int tmp;
+
+       if (s3c_rtc_base == NULL)
+               return;
+
+       if (!en) {
+               tmp = readb(S3C2410_RTCCON);
+               writeb(tmp & ~S3C2410_RTCCON_RTCEN, S3C2410_RTCCON);
+
+               tmp = readb(S3C2410_TICNT);
+               writeb(tmp & ~S3C2410_TICNT_ENABLE, S3C2410_TICNT);
+       } else {
+               /* re-enable the device, and check it is ok */
+
+               if ((readb(S3C2410_RTCCON) & S3C2410_RTCCON_RTCEN) == 0){
+                       dev_info(&pdev->dev, "rtc disabled, re-enabling\n");
+
+                       tmp = readb(S3C2410_RTCCON);
+                       writeb(tmp | S3C2410_RTCCON_RTCEN , S3C2410_RTCCON);
+               }
+
+               if ((readb(S3C2410_RTCCON) & S3C2410_RTCCON_CNTSEL)){
+                       dev_info(&pdev->dev, "removing RTCCON_CNTSEL\n");
+
+                       tmp = readb(S3C2410_RTCCON);
+                       writeb(tmp& ~S3C2410_RTCCON_CNTSEL , S3C2410_RTCCON);
+               }
+
+               if ((readb(S3C2410_RTCCON) & S3C2410_RTCCON_CLKRST)){
+                       dev_info(&pdev->dev, "removing RTCCON_CLKRST\n");
+
+                       tmp = readb(S3C2410_RTCCON);
+                       writeb(tmp & ~S3C2410_RTCCON_CLKRST, S3C2410_RTCCON);
+               }
+       }
+}
+
+static int s3c_rtc_remove(struct platform_device *dev)
+{
+       struct rtc_device *rtc = platform_get_drvdata(dev);
+
+       platform_set_drvdata(dev, NULL);
+       rtc_device_unregister(rtc);
+
+       s3c_rtc_setpie(0);
+       s3c_rtc_setaie(0);
+
+       iounmap(s3c_rtc_base);
+       release_resource(s3c_rtc_mem);
+       kfree(s3c_rtc_mem);
+
+       return 0;
+}
+
+static int s3c_rtc_probe(struct platform_device *pdev)
+{
+       struct rtc_device *rtc;
+       struct resource *res;
+       int ret;
+
+       pr_debug("%s: probe=%p\n", __FUNCTION__, pdev);
+
+       /* find the IRQs */
+
+       s3c_rtc_tickno = platform_get_irq(pdev, 1);
+       if (s3c_rtc_tickno < 0) {
+               dev_err(&pdev->dev, "no irq for rtc tick\n");
+               return -ENOENT;
+       }
+
+       s3c_rtc_alarmno = platform_get_irq(pdev, 0);
+       if (s3c_rtc_alarmno < 0) {
+               dev_err(&pdev->dev, "no irq for alarm\n");
+               return -ENOENT;
+       }
+
+       pr_debug("s3c2410_rtc: tick irq %d, alarm irq %d\n",
+                s3c_rtc_tickno, s3c_rtc_alarmno);
+
+       /* get the memory region */
+
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       if (res == NULL) {
+               dev_err(&pdev->dev, "failed to get memory region resource\n");
+               return -ENOENT;
+       }
+
+       s3c_rtc_mem = request_mem_region(res->start,
+                                            res->end-res->start+1,
+                                            pdev->name);
+
+       if (s3c_rtc_mem == NULL) {
+               dev_err(&pdev->dev, "failed to reserve memory region\n");
+               ret = -ENOENT;
+               goto err_nores;
+       }
+
+       s3c_rtc_base = ioremap(res->start, res->end - res->start + 1);
+       if (s3c_rtc_base == NULL) {
+               dev_err(&pdev->dev, "failed ioremap()\n");
+               ret = -EINVAL;
+               goto err_nomap;
+       }
+
+       /* check to see if everything is setup correctly */
+
+       s3c_rtc_enable(pdev, 1);
+
+       pr_debug("s3c2410_rtc: RTCCON=%02x\n", readb(S3C2410_RTCCON));
+
+       s3c_rtc_setfreq(s3c_rtc_freq);
+
+       /* register RTC and exit */
+
+       rtc = rtc_device_register("s3c", &pdev->dev, &s3c_rtcops,
+                                 THIS_MODULE);
+
+       if (IS_ERR(rtc)) {
+               dev_err(&pdev->dev, "cannot attach rtc\n");
+               ret = PTR_ERR(rtc);
+               goto err_nortc;
+       }
+
+       rtc->max_user_freq = 128;
+
+       platform_set_drvdata(pdev, rtc);
+       return 0;
+
+ err_nortc:
+       s3c_rtc_enable(pdev, 0);
+       iounmap(s3c_rtc_base);
+
+ err_nomap:
+       release_resource(s3c_rtc_mem);
+
+ err_nores:
+       return ret;
+}
+
+#ifdef CONFIG_PM
+
+/* 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)
+{
+       struct rtc_time tm;
+       struct timespec time;
+
+       time.tv_nsec = 0;
+
+       /* save TICNT for anyone using periodic interrupts */
+
+       ticnt_save = readb(S3C2410_TICNT);
+
+       /* calculate time delta for suspend */
+
+       s3c_rtc_gettime(&pdev->dev, &tm);
+       rtc_tm_to_time(&tm, &time.tv_sec);
+       save_time_delta(&s3c_rtc_delta, &time);
+       s3c_rtc_enable(pdev, 0);
+
+       return 0;
+}
+
+static int s3c_rtc_resume(struct platform_device *pdev)
+{
+       struct rtc_time tm;
+       struct timespec time;
+
+       time.tv_nsec = 0;
+
+       s3c_rtc_enable(pdev, 1);
+       s3c_rtc_gettime(&pdev->dev, &tm);
+       rtc_tm_to_time(&tm, &time.tv_sec);
+       restore_time_delta(&s3c_rtc_delta, &time);
+
+       writeb(ticnt_save, S3C2410_TICNT);
+       return 0;
+}
+#else
+#define s3c_rtc_suspend NULL
+#define s3c_rtc_resume  NULL
+#endif
+
+static struct platform_driver s3c2410_rtcdrv = {
+       .probe          = s3c_rtc_probe,
+       .remove         = s3c_rtc_remove,
+       .suspend        = s3c_rtc_suspend,
+       .resume         = s3c_rtc_resume,
+       .driver         = {
+               .name   = "s3c2410-rtc",
+               .owner  = THIS_MODULE,
+       },
+};
+
+static char __initdata banner[] = "S3C24XX RTC, (c) 2004,2006 Simtec Electronics\n";
+
+static int __init s3c_rtc_init(void)
+{
+       printk(banner);
+       return platform_driver_register(&s3c2410_rtcdrv);
+}
+
+static void __exit s3c_rtc_exit(void)
+{
+       platform_driver_unregister(&s3c2410_rtcdrv);
+}
+
+module_init(s3c_rtc_init);
+module_exit(s3c_rtc_exit);
+
+MODULE_DESCRIPTION("Samsung S3C RTC Driver");
+MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
+MODULE_LICENSE("GPL");
index 9cd1cb304bb2a7b66a4a5aab5442e472419961df..ee4b61ee67b03de09faa6296137dd0c3f925d495 100644 (file)
@@ -157,19 +157,19 @@ static int sa1100_rtc_open(struct device *dev)
 {
        int ret;
 
-       ret = request_irq(IRQ_RTC1Hz, sa1100_rtc_interrupt, SA_INTERRUPT,
+       ret = request_irq(IRQ_RTC1Hz, sa1100_rtc_interrupt, IRQF_DISABLED,
                                "rtc 1Hz", dev);
        if (ret) {
                dev_err(dev, "IRQ %d already in use.\n", IRQ_RTC1Hz);
                goto fail_ui;
        }
-       ret = request_irq(IRQ_RTCAlrm, sa1100_rtc_interrupt, SA_INTERRUPT,
+       ret = request_irq(IRQ_RTCAlrm, sa1100_rtc_interrupt, IRQF_DISABLED,
                                "rtc Alrm", dev);
        if (ret) {
                dev_err(dev, "IRQ %d already in use.\n", IRQ_RTCAlrm);
                goto fail_ai;
        }
-       ret = request_irq(IRQ_OST1, timer1_interrupt, SA_INTERRUPT,
+       ret = request_irq(IRQ_OST1, timer1_interrupt, IRQF_DISABLED,
                                "rtc timer", dev);
        if (ret) {
                dev_err(dev, "IRQ %d already in use.\n", IRQ_OST1);
index 4b9291dd444354ab1f2f374c26d2d0069266b800..bb6d5ff24fd0a3ee254c7f23c140420b5d6e322e 100644 (file)
@@ -345,11 +345,11 @@ static int __devinit rtc_probe(struct platform_device *pdev)
        spin_unlock_irq(&rtc_lock);
 
        irq = ELAPSEDTIME_IRQ;
-       retval = request_irq(irq, elapsedtime_interrupt, SA_INTERRUPT,
+       retval = request_irq(irq, elapsedtime_interrupt, IRQF_DISABLED,
                             "elapsed_time", pdev);
        if (retval == 0) {
                irq = RTCLONG1_IRQ;
-               retval = request_irq(irq, rtclong1_interrupt, SA_INTERRUPT,
+               retval = request_irq(irq, rtclong1_interrupt, IRQF_DISABLED,
                                     "rtclong1", pdev);
        }
 
index 2dc179b14ce6484e5dd6f53a8221461d0854857f..4bf03fb67f8d46320e72a068e84aa4230a53d017 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kmod.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
index 9e9ae71796028162b94d45316776ec2b2f7f0d6b..d7295386821cb39884811519a1262c47c9b1c345 100644 (file)
@@ -13,7 +13,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/ctype.h>
 #include <linux/init.h>
 #include <linux/module.h>
index 4002f6c1c1b3222a01b1fa2ced3b8df3da0fe043..23fa0b289173e84098c48411ac10287db517e8e1 100644 (file)
@@ -8,7 +8,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
index 0dfab30e8089814ca75b1320ce4114a0942dcb8a..2e655f466743e32c5f7f1b72f6e48a016215440d 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
index 4108d96f6a5a8b9ae5622c79efc09f16adf38b04..58a65097922bb430d3f8e6b224755596e71fb746 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/ctype.h>
 #include <linux/init.h>
 
index bb7755b9b19d7dfa408a9d79c959ff40f858468e..808434d38526a6b30504ee48ff060b6defdb08f1 100644 (file)
@@ -6,7 +6,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <asm/debug.h>
index 61ffde718a7a84f881969d0b51a5a0cd394b4829..12c7d296eaa8a6bcbb9268d4b38494e1e5a68535 100644 (file)
@@ -11,7 +11,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/interrupt.h>
 #include <linux/fs.h>
 #include <linux/blkpg.h>
index 302bcd0f28be4c4532862915417ba2a5add9ea2d..e97f5316ad2d5629c7986c87bd17051d9c0d0d2b 100644 (file)
@@ -9,7 +9,6 @@
  *
  * i/o controls for the dasd driver.
  */
-#include <linux/config.h>
 #include <linux/interrupt.h>
 #include <linux/major.h>
 #include <linux/fs.h>
index ad23aede356c63254f8aa215284425fd71b51a54..bfa010f6dab25275223d7c6fde5e6e753883fa73 100644 (file)
@@ -11,7 +11,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/ctype.h>
 #include <linux/seq_file.h>
 #include <linux/vmalloc.h>
index 606f6ad285a0e3db07ea97f919d467c35818d6c1..f25c6d116f6f6f8a130d84501c5e4ea348e560f2 100644 (file)
@@ -11,7 +11,6 @@
  *            Dan Morrison, IBM Corporation (dmorriso@cse.buffalo.edu)
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kdev_t.h>
index ef607a1de55a30707ac2098eeea64a9f3cc41b24..7566be8906889036aab0056d777d789b46029a19 100644 (file)
@@ -8,7 +8,6 @@
  *     -- Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation
  */
 
-#include <linux/config.h>
 #include <linux/bootmem.h>
 #include <linux/console.h>
 #include <linux/init.h>
index be463242cf0f6c4a1262e53786bba5da4b48ba92..0ea6f36a25277862234b3045f35fa6d70689baa6 100644 (file)
@@ -7,7 +7,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <asm/errno.h>
 #include <linux/sysrq.h>
index a6415377bc736b62dfa37277e205334c9381194f..6099c14de42910319141ec492b6ada8bc1b8da9f 100644 (file)
@@ -8,7 +8,6 @@
  *     -- Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation
  */
 
-#include <linux/config.h>
 #include <linux/bootmem.h>
 #include <linux/console.h>
 #include <linux/init.h>
index d4d2ff0a9da2003eb7ed8cd0d2b70dc0ae827c3b..547ef906ae2c7839c7751c4d54ed3317b6f2880e 100644 (file)
@@ -7,7 +7,6 @@
  *    Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/sysrq.h>
index 3c1314b7391b0fe5141982210c366dfb902875e0..e95b56f810dbb25e1e4aea8730e6fa271c1bbcd3 100644 (file)
@@ -8,7 +8,6 @@
  *     -- Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation
  */
 
-#include <linux/config.h>
 #include <linux/bootmem.h>
 #include <linux/module.h>
 #include <linux/err.h>
index 4138564402b8c2ee27b3bf04731bebe1c3caf35e..985d1613baaa59235d5c6a6edcb76e91f5fa9b0c 100644 (file)
@@ -383,6 +383,7 @@ void
 sclp_sync_wait(void)
 {
        unsigned long psw_mask;
+       unsigned long flags;
        unsigned long cr0, cr0_sync;
        u64 timeout;
 
@@ -395,9 +396,11 @@ sclp_sync_wait(void)
                          sclp_tod_from_jiffies(sclp_request_timer.expires -
                                                jiffies);
        }
+       local_irq_save(flags);
        /* Prevent bottom half from executing once we force interrupts open */
        local_bh_disable();
        /* Enable service-signal interruption, disable timer interrupts */
+       trace_hardirqs_on();
        __ctl_store(cr0, 0, 0);
        cr0_sync = cr0;
        cr0_sync |= 0x00000200;
@@ -415,11 +418,10 @@ sclp_sync_wait(void)
                barrier();
                cpu_relax();
        }
-       /* Restore interrupt settings */
-       asm volatile ("SSM 0(%0)"
-                     : : "a" (&psw_mask) : "memory");
+       local_irq_disable();
        __ctl_load(cr0, 0, 0);
-       __local_bh_enable();
+       _local_bh_enable();
+       local_irq_restore(flags);
 }
 
 EXPORT_SYMBOL(sclp_sync_wait);
index 10ef22f1354168b2d0007ca861a871fa44bec9b0..86864f641716045b4b9e234018962136c1a1095e 100644 (file)
@@ -8,7 +8,6 @@
  *              Martin Schwidefsky <schwidefsky@de.ibm.com>
  */
 
-#include <linux/config.h>
 #include <linux/kmod.h>
 #include <linux/console.h>
 #include <linux/init.h>
index 80f7f31310e677465af3d848411a5850d70bb5df..732dfbdb85c45860c575e7c6667fbdfc3d35c0b8 100644 (file)
@@ -5,7 +5,6 @@
  * SCLP Control-Program Identification.
  */
 
-#include <linux/config.h>
 #include <linux/version.h>
 #include <linux/kmod.h>
 #include <linux/module.h>
index a4c53c172db6440bc9e0892169dd7ec835e012ef..32004aae95c1738629b74c437ed9303d8f32197d 100644 (file)
@@ -7,7 +7,6 @@
  *             Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/cpumask.h>
index 91e93c78f57a0340657f1130ff33a9d20b4854e8..0c92d3909cca411f6fac68d8ff758d22457a2f48 100644 (file)
@@ -8,7 +8,6 @@
  *              Martin Schwidefsky <schwidefsky@de.ibm.com>
  */
 
-#include <linux/config.h>
 #include <linux/kmod.h>
 #include <linux/types.h>
 #include <linux/err.h>
index 6cbf067f1a8f8b4720686d22f3c15a3fea94f848..f6cf9023039e352bed29b71ca0da273ecd8b6d24 100644 (file)
@@ -8,7 +8,6 @@
  *              Martin Schwidefsky <schwidefsky@de.ibm.com>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kmod.h>
 #include <linux/tty.h>
index 9e02625c82cfc2853b3fa5be86fb883ddb82c8c2..54fba6f171883fda8384ab794adb77f761759991 100644 (file)
@@ -7,7 +7,6 @@
  *    Author(s): Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #include <linux/list.h>
index cd51ace8b61060bc72884acce4fe3dd0e49ccee4..1f4c89967be4f0b7c742cba55455ed284a202121 100644 (file)
@@ -16,7 +16,6 @@
 #include <asm/ccwdev.h>
 #include <asm/debug.h>
 #include <asm/idals.h>
-#include <linux/config.h>
 #include <linux/blkdev.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
index d4f2da7380784850d354515a29434b16fe457b86..48b4d30a725612fedef6af60ba58d0bff4a792cf 100644 (file)
@@ -8,7 +8,6 @@
  *              Martin Schwidefsky <schwidefsky@de.ibm.com>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/bio.h>
index d71ef1adea59815b1e821460870fe45f94d55e52..928cbefc49d5959932f501b183487254e578f0c2 100644 (file)
@@ -8,7 +8,6 @@
  *              Martin Schwidefsky <schwidefsky@de.ibm.com>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/bio.h>
index b70d926902424dd9943c8dbfbc1c8353a03b7804..3225fcd1dcb47eb41d86a5b2e4ea7cd18a208971 100644 (file)
@@ -11,7 +11,6 @@
  */
 
 #include <linux/fs.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/blkdev.h>
 #include <linux/interrupt.h>
index 5ce7ca38ace0d54db704191c1a295ce3e81514e5..97f75237bed6cbc3b2d64767a8e915e4eeee6740 100644 (file)
@@ -10,7 +10,6 @@
  *              Martin Schwidefsky <schwidefsky@de.ibm.com>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/proc_fs.h>
index e6e4086d3224bf077ff2025c53953a2b371c722b..122b4d8965c36028ccb2d2e657104eb14c9a6f04 100644 (file)
@@ -11,7 +11,6 @@
  *              Stefan Bader <shbader@de.ibm.com>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>             // for kernel parameters
 #include <linux/kmod.h>             // for requesting modules
index 5fec0a10cc3d089b172da95a59acbe6aaca7e744..655d375ab22bc626fdc9ad3aba7197dcd2b9e736 100644 (file)
@@ -11,7 +11,6 @@
  * PROCFS Functions
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/vmalloc.h>
 #include <linux/seq_file.h>
index 99cf881f41db8b3f995c5199e8440bb18f6ab711..7a76ec413a3a15ac239367f821ffed0458420dd2 100644 (file)
@@ -11,7 +11,6 @@
  *              Stefan Bader <shbader@de.ibm.com>
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/bio.h>
index 7d26a3e4cb80797f10256e5de65f389f619cd960..f496f236b9c06c3954ea9e885f49ed0c6c5b9ed1 100644 (file)
@@ -8,7 +8,6 @@
  *     -- Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kdev_t.h>
index 15b895496a45025038559b18eb874d1b6b6cfc50..12c2d6b746e697b5e017d6414f2281a509aae1ff 100644 (file)
@@ -9,7 +9,6 @@
  *              Arnd Bergmann (arndb@de.ibm.com)
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/vmalloc.h>
 #include <linux/slab.h>
index b00f3ed051a094bf259d90b62026959ad139143c..a01f3bba4a7b094d81edf8d128371e350e666093 100644 (file)
@@ -10,7 +10,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/device.h>
index 5b20d8c9c0257eec01184b8de15eb4bd2167dd12..6fec90eab00e82031b9634897c148080b62f5fd1 100644 (file)
@@ -11,7 +11,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/device.h>
@@ -148,7 +147,7 @@ cio_tpi(void)
                sch->driver->irq(&sch->dev);
        spin_unlock(&sch->lock);
        irq_exit ();
-       __local_bh_enable();
+       _local_bh_enable();
        return 1;
 }
 
index eafde43e8410cd3e1f041343f86dad2bd543d8c6..67f0de6aed33942ba078887e272287cdfca9ae7d 100644 (file)
@@ -8,7 +8,6 @@
  *              Cornelia Huck (cornelia.huck@de.ibm.com)
  *              Martin Schwidefsky (schwidefsky@de.ibm.com)
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
index 7d0dd72635ebde671ce882d13cab17ad6094019f..cb1af0b6f033c4b43e057f29e9ddf2ef2d4596b0 100644 (file)
@@ -9,7 +9,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/jiffies.h>
 #include <linux/string.h>
index e60b2d8103b8b547627405b755f4b193ac6055c0..438db483035d033a85013e184fcef818a75dcfd2 100644 (file)
@@ -10,7 +10,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/init.h>
 
 #include <asm/ccwdev.h>
index b266ad8e14ff2623fc6e5cea70e04d9a4160435b..a60124264beec97583a150973f07550eb4845193 100644 (file)
@@ -6,7 +6,6 @@
  *    Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
  *               Cornelia Huck (cornelia.huck@de.ibm.com)
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/errno.h>
index 85b1020a1fcce51e6371852fa4cf12c5d6cca772..54cb64ed0786dc469957f7b2089bff7f6402d40e 100644 (file)
@@ -9,7 +9,6 @@
  * Path Group ID functions.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 
index 6c762b43f921cf5f063d3499e91d70efa1615dbb..14bef2c179bf383f7eecb4f1506710b6bb0991ad 100644 (file)
@@ -9,7 +9,6 @@
  * Status accumulation and basic sense functions.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 
index 96f519281d92c4452207d746269bbae2d7925adf..b70039af70d6204062850f8b3089f6e9765084e5 100644 (file)
@@ -30,7 +30,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 
index 7145e2134cf00c19d7a27711ad5de3c1eccccb22..2c1db8036b7c7aa04bbc33b725da877a0794601b 100644 (file)
@@ -4,7 +4,6 @@
  */
 
 #include "fsm.h"
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/timer.h>
 
index e0c7deb9883189f012d0b27d67c83db08317b01e..189a49275433879f1935685c8a51b05d8ab6158e 100644 (file)
@@ -33,7 +33,6 @@
 
 #include <linux/module.h>
 #include <linux/moduleparam.h>
-#include <linux/config.h>
 
 #include <linux/spinlock.h>
 #include <linux/kernel.h>
index 38aad8321456e9142d60c293e4e42bfb6965a578..8491598f91495fe30fae194c4ef312540809cdd7 100644 (file)
@@ -8,7 +8,6 @@
  *    Author(s): Thomas Spatzier <tspat@de.ibm.com>
  *
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/ip.h>
 #include <linux/inetdevice.h>
index 56009d76832639dc3f28445e271e6ed8eeb18518..8e8963f1573173a41fb8995dd3d9866605fdc714 100644 (file)
@@ -27,7 +27,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/string.h>
@@ -85,6 +84,8 @@ static debug_info_t *qeth_dbf_qerr = NULL;
 
 DEFINE_PER_CPU(char[256], qeth_dbf_txt_buf);
 
+static struct lock_class_key qdio_out_skb_queue_key;
+
 /**
  * some more definitions and declarations
  */
@@ -3230,6 +3231,9 @@ qeth_alloc_qdio_buffers(struct qeth_card *card)
                                &card->qdio.out_qs[i]->qdio_bufs[j];
                        skb_queue_head_init(&card->qdio.out_qs[i]->bufs[j].
                                            skb_list);
+                       lockdep_set_class(
+                               &card->qdio.out_qs[i]->bufs[j].skb_list.lock,
+                               &qdio_out_skb_queue_key);
                        INIT_LIST_HEAD(&card->qdio.out_qs[i]->bufs[j].ctx_list);
                }
        }
@@ -5273,6 +5277,7 @@ qeth_free_vlan_buffer(struct qeth_card *card, struct qeth_qdio_out_buffer *buf,
        struct sk_buff_head tmp_list;
 
        skb_queue_head_init(&tmp_list);
+       lockdep_set_class(&tmp_list.lock, &qdio_out_skb_queue_key);
        for(i = 0; i < QETH_MAX_BUFFER_ELEMENTS(card); ++i){
                while ((skb = skb_dequeue(&buf->skb_list))){
                        if (vlan_tx_tag_present(skb) &&
index 8dc75002acbea71b1788ed35d314b42dc0e70207..ffb3677e354fe9c1a7d0848453d91353fb33cc7e 100644 (file)
@@ -8,7 +8,6 @@
  *              Martin Schwidefsky (schwidefsky@de.ibm.com)
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/errno.h>
@@ -379,6 +378,8 @@ s390_do_machine_check(struct pt_regs *regs)
        struct mcck_struct *mcck;
        int umode;
 
+       lockdep_off();
+
        mci = (struct mci *) &S390_lowcore.mcck_interruption_code;
        mcck = &__get_cpu_var(cpu_mcck);
        umode = user_mode(regs);
@@ -483,6 +484,7 @@ s390_do_machine_check(struct pt_regs *regs)
                mcck->warning = 1;
                set_thread_flag(TIF_MCCK_PENDING);
        }
+       lockdep_on();
 }
 
 /*
index 909731b99d2671e9d54dc51ab21ca1399ce882a4..8ec8da0beaa863e2987b123fb473bba5c4b884b5 100644 (file)
@@ -2168,9 +2168,9 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action)
                atomic_clear_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT,
                                  &adapter->status);
                ZFCP_LOG_DEBUG("Doing exchange config data\n");
-               write_lock(&adapter->erp_lock);
+               write_lock_irq(&adapter->erp_lock);
                zfcp_erp_action_to_running(erp_action);
-               write_unlock(&adapter->erp_lock);
+               write_unlock_irq(&adapter->erp_lock);
                zfcp_erp_timeout_init(erp_action);
                if (zfcp_fsf_exchange_config_data(erp_action)) {
                        retval = ZFCP_ERP_FAILED;
@@ -2236,9 +2236,9 @@ zfcp_erp_adapter_strategy_open_fsf_xport(struct zfcp_erp_action *erp_action)
        adapter = erp_action->adapter;
        atomic_clear_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status);
 
-       write_lock(&adapter->erp_lock);
+       write_lock_irq(&adapter->erp_lock);
        zfcp_erp_action_to_running(erp_action);
-       write_unlock(&adapter->erp_lock);
+       write_unlock_irq(&adapter->erp_lock);
 
        zfcp_erp_timeout_init(erp_action);
        ret = zfcp_fsf_exchange_port_data(erp_action, adapter, NULL);
index 345a191926a4d5e8dce3b3ffa9af05dbd4c46ae8..49ea5add4abc88542ce84f57f3922e32788b917e 100644 (file)
@@ -427,6 +427,7 @@ int
 zfcp_qdio_reqid_check(struct zfcp_adapter *adapter, void *sbale_addr)
 {
        struct zfcp_fsf_req *fsf_req;
+       unsigned long flags;
 
        /* invalid (per convention used in this driver) */
        if (unlikely(!sbale_addr)) {
@@ -438,15 +439,15 @@ zfcp_qdio_reqid_check(struct zfcp_adapter *adapter, void *sbale_addr)
        fsf_req = (struct zfcp_fsf_req *) sbale_addr;
 
        /* serialize with zfcp_fsf_req_dismiss_all */
-       spin_lock(&adapter->fsf_req_list_lock);
+       spin_lock_irqsave(&adapter->fsf_req_list_lock, flags);
        if (list_empty(&adapter->fsf_req_list_head)) {
-               spin_unlock(&adapter->fsf_req_list_lock);
+               spin_unlock_irqrestore(&adapter->fsf_req_list_lock, flags);
                return 0;
        }
        list_del(&fsf_req->list);
        atomic_dec(&adapter->fsf_reqs_active);
-       spin_unlock(&adapter->fsf_req_list_lock);
-       
+       spin_unlock_irqrestore(&adapter->fsf_req_list_lock, flags);
+
        if (unlikely(adapter != fsf_req->adapter)) {
                ZFCP_LOG_NORMAL("bug: invalid reqid (fsf_req=%p, "
                                "fsf_req->adapter=%p, adapter=%p)\n",
index 66da840c931672f4d70eef5e92b608b95d51fc75..d1c1e75bfd60d7a766302c1745b2f81d04a8f8b7 100644 (file)
@@ -5,7 +5,6 @@
  *    Author(s): Ulrich Weigand (Ulrich.Weigand@de.ibm.com)
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/proc_fs.h>
index 015db40ad8a46079607b00eb9b13ed4564707aca..4fdb2c932210a80772d74c69636061734af334cf 100644 (file)
@@ -337,19 +337,19 @@ static int aurora_probe(void)
                                printk("intr pri %d\n", grrr);
 #endif
                                if ((bp->irq=irqs[bn]) && valid_irq(bp->irq) &&
-                                   !request_irq(bp->irq|0x30, aurora_interrupt, SA_SHIRQ, "sio16", bp)) {
+                                   !request_irq(bp->irq|0x30, aurora_interrupt, IRQF_SHARED, "sio16", bp)) {
                                        free_irq(bp->irq|0x30, bp);
                                } else
                                if ((bp->irq=prom_getint(sdev->prom_node, "bintr")) && valid_irq(bp->irq) &&
-                                   !request_irq(bp->irq|0x30, aurora_interrupt, SA_SHIRQ, "sio16", bp)) {
+                                   !request_irq(bp->irq|0x30, aurora_interrupt, IRQF_SHARED, "sio16", bp)) {
                                        free_irq(bp->irq|0x30, bp);
                                } else
                                if ((bp->irq=prom_getint(sdev->prom_node, "intr")) && valid_irq(bp->irq) &&
-                                   !request_irq(bp->irq|0x30, aurora_interrupt, SA_SHIRQ, "sio16", bp)) {
+                                   !request_irq(bp->irq|0x30, aurora_interrupt, IRQF_SHARED, "sio16", bp)) {
                                        free_irq(bp->irq|0x30, bp);
                                } else
                                for(grrr=0;grrr<TYPE_1_IRQS;grrr++) {
-                                       if ((bp->irq=type_1_irq[grrr])&&!request_irq(bp->irq|0x30, aurora_interrupt, SA_SHIRQ, "sio16", bp)) {
+                                       if ((bp->irq=type_1_irq[grrr])&&!request_irq(bp->irq|0x30, aurora_interrupt, IRQF_SHARED, "sio16", bp)) {
                                                free_irq(bp->irq|0x30, bp);
                                                break;
                                        } else {
@@ -909,14 +909,14 @@ static int aurora_setup_board(struct Aurora_board * bp)
 #ifdef AURORA_ALLIRQ
        int i;
        for (i = 0; i < AURORA_ALLIRQ; i++) {
-               error = request_irq(allirq[i]|0x30, aurora_interrupt, SA_SHIRQ,
+               error = request_irq(allirq[i]|0x30, aurora_interrupt, IRQF_SHARED,
                                    "sio16", bp);
                if (error)
                        printk(KERN_ERR "IRQ%d request error %d\n",
                               allirq[i], error);
        }
 #else
-       error = request_irq(bp->irq|0x30, aurora_interrupt, SA_SHIRQ,
+       error = request_irq(bp->irq|0x30, aurora_interrupt, IRQF_SHARED,
                            "sio16", bp);
        if (error) {
                printk(KERN_ERR "IRQ request error %d\n", error);
index 73634371393bdcd7513cb2adec1505bf2cdf3584..7186235594f999580325bfe5791de8075c3c2278 100644 (file)
@@ -377,7 +377,7 @@ static int __init attach_one_i2c(struct linux_ebus_device *edev, int index)
        bp->waiting = 0;
        init_waitqueue_head(&bp->wq);
        if (request_irq(edev->irqs[0], bbc_i2c_interrupt,
-                       SA_SHIRQ, "bbc_i2c", bp))
+                       IRQF_SHARED, "bbc_i2c", bp))
                goto fail;
 
        bp->index = index;
index 21737b7e86a1ccbe78647347625b94e9fc7b74b5..836a58bb0305436a0ca30c35c74c80489620ee31 100644 (file)
@@ -301,7 +301,7 @@ static int wd_open(struct inode *inode, struct file *f)
        {       
                if (request_irq(wd_dev.irq, 
                                                &wd_interrupt, 
-                                               SA_SHIRQ,
+                                               IRQF_SHARED,
                                                WD_OBPNAME,
                                                (void *)wd_dev.regs)) {
                        printk("%s: Cannot register IRQ %d\n", 
index cf97e9efe9b663a4c9338e6bcb26137e1f6c2690..063e676a3ac046e5de17809cce433ca281b21dd5 100644 (file)
@@ -22,7 +22,6 @@
 #define __KERNEL_SYSCALLS__
 static int errno;
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/kthread.h>
index 31b8a5f6116f83fc88a30e4459e4fe6dbc2590b0..fa2418f7ad393c78af158a4540fa80cf6213d297 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 1997  Eddie C. Dost  (ecd@skynet.be)
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/errno.h>
index d7e4bb41bd79a5dcb8ffc21b849156a339654c6e..293bb2fdb1d5540285734993b8dd108dd4914db7 100644 (file)
@@ -29,7 +29,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index 378a1d68024da32556eeda812f5dfea7a0203b86..57e1526746a27e1ae8424d12c2cbd3f326ef9101 100644 (file)
@@ -3,7 +3,6 @@
  * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
  */
 
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
index 387a6aa8c020cf8746c4f8a8807d803f3499930a..16b59773c0bb9b66828b2887d4d4aa9f4af080fb 100644 (file)
@@ -5,7 +5,6 @@
 
 #include <linux/kernel.h>
 #include <linux/slab.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/pci.h>
 
index b003baf8d404a0dcad3896197edebdfa002c89d1..5a9475e56d0eb7baea0b33d0188787aaffb799c0 100644 (file)
@@ -2122,7 +2122,7 @@ static int __devinit twa_probe(struct pci_dev *pdev, const struct pci_device_id
                                     TW_PARAM_PORTCOUNT, TW_PARAM_PORTCOUNT_LENGTH)));
 
        /* Now setup the interrupt handler */
-       retval = request_irq(pdev->irq, twa_interrupt, SA_SHIRQ, "3w-9xxx", tw_dev);
+       retval = request_irq(pdev->irq, twa_interrupt, IRQF_SHARED, "3w-9xxx", tw_dev);
        if (retval) {
                TW_PRINTK(tw_dev->host, TW_DRIVER, 0x30, "Error requesting IRQ");
                goto out_remove_host;
index 17dbd4ac86929d557f3feeb0e03be3551e4c0c2d..f3a5f422a8e4d5f11f636a5c5ef798d239b82392 100644 (file)
@@ -2397,7 +2397,7 @@ static int __devinit tw_probe(struct pci_dev *pdev, const struct pci_device_id *
        printk(KERN_WARNING "3w-xxxx: scsi%d: Found a 3ware Storage Controller at 0x%x, IRQ: %d.\n", host->host_no, tw_dev->base_addr, pdev->irq);
 
        /* Now setup the interrupt handler */
-       retval = request_irq(pdev->irq, tw_interrupt, SA_SHIRQ, "3w-xxxx", tw_dev);
+       retval = request_irq(pdev->irq, tw_interrupt, IRQF_SHARED, "3w-xxxx", tw_dev);
        if (retval) {
                printk(KERN_WARNING "3w-xxxx: Error requesting IRQ.");
                goto out_remove_host;
index 3c683dc23541cc017ffb703005400220872feb2f..657a3ab75399426b23f7028a925b37d2860fdd97 100644 (file)
  * */
 #define NCR_700_VERSION "2.8"
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/string.h>
@@ -174,6 +173,7 @@ STATIC int NCR_700_bus_reset(struct scsi_cmnd * SCpnt);
 STATIC int NCR_700_host_reset(struct scsi_cmnd * SCpnt);
 STATIC void NCR_700_chip_setup(struct Scsi_Host *host);
 STATIC void NCR_700_chip_reset(struct Scsi_Host *host);
+STATIC int NCR_700_slave_alloc(struct scsi_device *SDpnt);
 STATIC int NCR_700_slave_configure(struct scsi_device *SDpnt);
 STATIC void NCR_700_slave_destroy(struct scsi_device *SDpnt);
 static int NCR_700_change_queue_depth(struct scsi_device *SDpnt, int depth);
@@ -183,10 +183,6 @@ STATIC struct device_attribute *NCR_700_dev_attrs[];
 
 STATIC struct scsi_transport_template *NCR_700_transport_template = NULL;
 
-struct NCR_700_sense {
-       unsigned char cmnd[MAX_COMMAND_SIZE];
-};
-
 static char *NCR_700_phase[] = {
        "",
        "after selection",
@@ -334,6 +330,7 @@ NCR_700_detect(struct scsi_host_template *tpnt,
        tpnt->use_clustering = ENABLE_CLUSTERING;
        tpnt->slave_configure = NCR_700_slave_configure;
        tpnt->slave_destroy = NCR_700_slave_destroy;
+       tpnt->slave_alloc = NCR_700_slave_alloc;
        tpnt->change_queue_depth = NCR_700_change_queue_depth;
        tpnt->change_queue_type = NCR_700_change_queue_type;
 
@@ -612,9 +609,10 @@ NCR_700_scsi_done(struct NCR_700_Host_Parameters *hostdata,
                struct NCR_700_command_slot *slot = 
                        (struct NCR_700_command_slot *)SCp->host_scribble;
                
-               NCR_700_unmap(hostdata, SCp, slot);
+               dma_unmap_single(hostdata->dev, slot->pCmd,
+                                sizeof(SCp->cmnd), DMA_TO_DEVICE);
                if (slot->flags == NCR_700_FLAG_AUTOSENSE) {
-                       struct NCR_700_sense *sense = SCp->device->hostdata;
+                       char *cmnd = NCR_700_get_sense_cmnd(SCp->device);
 #ifdef NCR_700_DEBUG
                        printk(" ORIGINAL CMD %p RETURNED %d, new return is %d sense is\n",
                               SCp, SCp->cmnd[7], result);
@@ -625,10 +623,9 @@ NCR_700_scsi_done(struct NCR_700_Host_Parameters *hostdata,
                        /* restore the old result if the request sense was
                         * successful */
                        if(result == 0)
-                               result = sense->cmnd[7];
+                               result = cmnd[7];
                } else
-                       dma_unmap_single(hostdata->dev, slot->pCmd,
-                                        sizeof(SCp->cmnd), DMA_TO_DEVICE);
+                       NCR_700_unmap(hostdata, SCp, slot);
 
                free_slot(slot, hostdata);
 #ifdef NCR_700_DEBUG
@@ -970,14 +967,15 @@ process_script_interrupt(__u32 dsps, __u32 dsp, struct scsi_cmnd *SCp,
                   status_byte(hostdata->status[0]) == COMMAND_TERMINATED) {
                        struct NCR_700_command_slot *slot =
                                (struct NCR_700_command_slot *)SCp->host_scribble;
-                       if(SCp->cmnd[0] == REQUEST_SENSE) {
+                       if(slot->flags == NCR_700_FLAG_AUTOSENSE) {
                                /* OOPS: bad device, returning another
                                 * contingent allegiance condition */
                                scmd_printk(KERN_ERR, SCp,
                                        "broken device is looping in contingent allegiance: ignoring\n");
                                NCR_700_scsi_done(hostdata, SCp, hostdata->status[0]);
                        } else {
-                               struct NCR_700_sense *sense = SCp->device->hostdata;
+                               char *cmnd =
+                                       NCR_700_get_sense_cmnd(SCp->device);
 #ifdef NCR_DEBUG
                                scsi_print_command(SCp);
                                printk("  cmd %p has status %d, requesting sense\n",
@@ -995,21 +993,21 @@ process_script_interrupt(__u32 dsps, __u32 dsp, struct scsi_cmnd *SCp,
                                                 sizeof(SCp->cmnd),
                                                 DMA_TO_DEVICE);
 
-                               sense->cmnd[0] = REQUEST_SENSE;
-                               sense->cmnd[1] = (SCp->device->lun & 0x7) << 5;
-                               sense->cmnd[2] = 0;
-                               sense->cmnd[3] = 0;
-                               sense->cmnd[4] = sizeof(SCp->sense_buffer);
-                               sense->cmnd[5] = 0;
+                               cmnd[0] = REQUEST_SENSE;
+                               cmnd[1] = (SCp->device->lun & 0x7) << 5;
+                               cmnd[2] = 0;
+                               cmnd[3] = 0;
+                               cmnd[4] = sizeof(SCp->sense_buffer);
+                               cmnd[5] = 0;
                                /* Here's a quiet hack: the
                                 * REQUEST_SENSE command is six bytes,
                                 * so store a flag indicating that
                                 * this was an internal sense request
                                 * and the original status at the end
                                 * of the command */
-                               sense->cmnd[6] = NCR_700_INTERNAL_SENSE_MAGIC;
-                               sense->cmnd[7] = hostdata->status[0];
-                               slot->pCmd = dma_map_single(hostdata->dev, sense->cmnd, sizeof(sense->cmnd), DMA_TO_DEVICE);
+                               cmnd[6] = NCR_700_INTERNAL_SENSE_MAGIC;
+                               cmnd[7] = hostdata->status[0];
+                               slot->pCmd = dma_map_single(hostdata->dev, cmnd, MAX_COMMAND_SIZE, DMA_TO_DEVICE);
                                slot->dma_handle = dma_map_single(hostdata->dev, SCp->sense_buffer, sizeof(SCp->sense_buffer), DMA_FROM_DEVICE);
                                slot->SG[0].ins = bS_to_host(SCRIPT_MOVE_DATA_IN | sizeof(SCp->sense_buffer));
                                slot->SG[0].pAddr = bS_to_host(slot->dma_handle);
@@ -1531,7 +1529,7 @@ NCR_700_intr(int irq, void *dev_id, struct pt_regs *regs)
 
                        /* clear all the negotiated parameters */
                        __shost_for_each_device(SDp, host)
-                               SDp->hostdata = NULL;
+                               NCR_700_clear_flag(SDp, ~0);
                        
                        /* clear all the slots and their pending commands */
                        for(i = 0; i < NCR_700_COMMAND_SLOTS_PER_HOST; i++) {
@@ -2036,7 +2034,17 @@ NCR_700_set_offset(struct scsi_target *STp, int offset)
        spi_flags(STp) |= NCR_700_DEV_PRINT_SYNC_NEGOTIATION;
 }
 
+STATIC int
+NCR_700_slave_alloc(struct scsi_device *SDp)
+{
+       SDp->hostdata = kzalloc(sizeof(struct NCR_700_Device_Parameters),
+                               GFP_KERNEL);
 
+       if (!SDp->hostdata)
+               return -ENOMEM;
+
+       return 0;
+}
 
 STATIC int
 NCR_700_slave_configure(struct scsi_device *SDp)
@@ -2044,11 +2052,6 @@ NCR_700_slave_configure(struct scsi_device *SDp)
        struct NCR_700_Host_Parameters *hostdata = 
                (struct NCR_700_Host_Parameters *)SDp->host->hostdata[0];
 
-       SDp->hostdata = kmalloc(GFP_KERNEL, sizeof(struct NCR_700_sense));
-
-       if (!SDp->hostdata)
-               return -ENOMEM;
-
        /* to do here: allocate memory; build a queue_full list */
        if(SDp->tagged_supported) {
                scsi_set_tag_type(SDp, MSG_ORDERED_TAG);
index 7f22a06fe5ec5cb80dd6dec7157d3d705a2a0e53..97ebe71b701ba367427a60dc67ccdc993a8cbfd1 100644 (file)
@@ -12,7 +12,7 @@
 #include <asm/io.h>
 
 #include <scsi/scsi_device.h>
-
+#include <scsi/scsi_cmnd.h>
 
 /* Turn on for general debugging---too verbose for normal use */
 #undef NCR_700_DEBUG
@@ -76,11 +76,16 @@ struct NCR_700_SG_List {
        #define SCRIPT_RETURN                   0x90080000
 };
 
-/* We use device->hostdata to store negotiated parameters.  This is
- * supposed to be a pointer to a device private area, but we cannot
- * really use it as such since it will never be freed, so just use the
- * 32 bits to cram the information.  The SYNC negotiation sequence looks
- * like:
+struct NCR_700_Device_Parameters {
+       /* space for creating a request sense command. Really, except
+        * for the annoying SCSI-2 requirement for LUN information in
+        * cmnd[1], this could be in static storage */
+       unsigned char cmnd[MAX_COMMAND_SIZE];
+       __u8    depth;
+};
+
+
+/* The SYNC negotiation sequence looks like:
  * 
  * If DEV_NEGOTIATED_SYNC not set, tack and SDTR message on to the
  * initial identify for the device and set DEV_BEGIN_SYNC_NEGOTATION
@@ -98,19 +103,26 @@ struct NCR_700_SG_List {
 #define NCR_700_DEV_BEGIN_SYNC_NEGOTIATION     (1<<17)
 #define NCR_700_DEV_PRINT_SYNC_NEGOTIATION (1<<19)
 
+static inline char *NCR_700_get_sense_cmnd(struct scsi_device *SDp)
+{
+       struct NCR_700_Device_Parameters *hostdata = SDp->hostdata;
+
+       return hostdata->cmnd;
+}
+
 static inline void
 NCR_700_set_depth(struct scsi_device *SDp, __u8 depth)
 {
-       long l = (long)SDp->hostdata;
+       struct NCR_700_Device_Parameters *hostdata = SDp->hostdata;
 
-       l &= 0xffff00ff;
-       l |= 0xff00 & (depth << 8);
-       SDp->hostdata = (void *)l;
+       hostdata->depth = depth;
 }
 static inline __u8
 NCR_700_get_depth(struct scsi_device *SDp)
 {
-       return ((((unsigned long)SDp->hostdata) & 0xff00)>>8);
+       struct NCR_700_Device_Parameters *hostdata = SDp->hostdata;
+
+       return hostdata->depth;
 }
 static inline int
 NCR_700_is_flag_set(struct scsi_device *SDp, __u32 flag)
index 765769a629e444a86f2cf7a25f73bf6b09314c0d..c690c2b89e41ddf59abb611a3a7c2f43448bbed8 100644 (file)
 
 #include <linux/module.h>
 
-#include <linux/config.h>
 
 #include <linux/types.h>
 #include <asm/setup.h>
@@ -1071,7 +1070,7 @@ NCR53c7x0_init (struct Scsi_Host *host) {
 
     NCR53c7x0_driver_init (host);
 
-    if (request_irq(host->irq, NCR53c7x0_intr, SA_SHIRQ, "53c7xx", host))
+    if (request_irq(host->irq, NCR53c7x0_intr, IRQF_SHARED, "53c7xx", host))
     {
        printk("scsi%d : IRQ%d not free, detaching\n",
                host->host_no, host->irq);
@@ -4233,7 +4232,7 @@ restart:
  * Purpose : handle NCR53c7x0 interrupts for all NCR devices sharing
  *     the same IRQ line.  
  * 
- * Inputs : Since we're using the SA_INTERRUPT interrupt handler
+ * Inputs : Since we're using the IRQF_DISABLED interrupt handler
  *     semantics, irq indicates the interrupt which invoked 
  *     this handler.  
  *
index bde3d5834ade134c8ba1a44915af2cd5b027a64f..16a12a3b7b2bc8e07db215d43bab05cc4093a4e6 100644 (file)
@@ -29,7 +29,6 @@
 #define BusLogic_DriverVersion         "2.1.16"
 #define BusLogic_DriverDate            "18 July 2002"
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
@@ -1845,7 +1844,7 @@ static boolean __init BusLogic_AcquireResources(struct BusLogic_HostAdapter *Hos
        /*
           Acquire shared access to the IRQ Channel.
         */
-       if (request_irq(HostAdapter->IRQ_Channel, BusLogic_InterruptHandler, SA_SHIRQ, HostAdapter->FullModelName, HostAdapter) < 0) {
+       if (request_irq(HostAdapter->IRQ_Channel, BusLogic_InterruptHandler, IRQF_SHARED, HostAdapter->FullModelName, HostAdapter) < 0) {
                BusLogic_Error("UNABLE TO ACQUIRE IRQ CHANNEL %d - DETACHING\n", HostAdapter, HostAdapter->IRQ_Channel);
                return false;
        }
index 1aaa6569edacdd771ef74bad2f9c62bdb56b4d3d..9792e5af5252c4a6378490667fe64f5318c64dac 100644 (file)
@@ -28,7 +28,6 @@
 #ifndef _BUSLOGIC_H
 #define _BUSLOGIC_H
 
-#include <linux/config.h>
 
 #ifndef PACKED
 #define PACKED __attribute__((packed))
index 8e3d949b7118ac54b9d6864cdd3915deaa8197d3..7c00680495867d0a81a2f81d379a270fb1ff846a 100644 (file)
@@ -15,7 +15,6 @@
 
 */
 
-#include <linux/config.h>
 
 #ifndef CONFIG_SCSI_OMIT_FLASHPOINT
 
index 75f2f7ae2a8e0e62fa9ed03a55a0cb9a771784eb..616810ad17d885200f10b3fb269975385c9c3b5c 100644 (file)
@@ -585,7 +585,7 @@ static int __init NCR5380_probe_irq(struct Scsi_Host *instance, int possible)
        NCR5380_setup(instance);
 
        for (trying_irqs = i = 0, mask = 1; i < 16; ++i, mask <<= 1)
-               if ((mask & possible) && (request_irq(i, &probe_intr, SA_INTERRUPT, "NCR-probe", NULL) == 0))
+               if ((mask & possible) && (request_irq(i, &probe_intr, IRQF_DISABLED, "NCR-probe", NULL) == 0))
                        trying_irqs |= mask;
 
        timeout = jiffies + (250 * HZ / 1000);
index c7dd0154d012b10bdeb5fc4d51a855955e0b61ac..8a4659e94105c58c81327db2cbc876bf46c93611 100644 (file)
@@ -23,7 +23,6 @@
 
 #include <linux/module.h>
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
 #include <linux/types.h>
index 65a9b377a410d983bd75e3037bf6aec13611f734..481653c977cf34523dff40e5d1c727ef6f9a80b9 100644 (file)
@@ -13,7 +13,6 @@
 #ifndef NCR53C9X_H
 #define NCR53C9X_H
 
-#include <linux/config.h>
 #include <linux/interrupt.h>
 
 /* djweis for mac driver */
index 577e6349977884dcad39f69d51cc1e9399b3f798..a06f547e87f715c7211a0b0bab17f77d20e32e10 100644 (file)
@@ -320,7 +320,7 @@ NCR_D700_probe(struct device *dev)
        memset(p, '\0', sizeof(*p));
        p->dev = dev;
        snprintf(p->name, sizeof(p->name), "D700(%s)", dev->bus_id);
-       if (request_irq(irq, NCR_D700_intr, SA_SHIRQ, p->name, p)) {
+       if (request_irq(irq, NCR_D700_intr, IRQF_SHARED, p->name, p)) {
                printk(KERN_ERR "D700: request_irq failed\n");
                kfree(p);
                return -EBUSY;
index 9d18ec90510f65b736d5a1bc58d759c54befb53c..c39ffbb86e390e4c0cdd5b1c190cf906a5562e90 100644 (file)
@@ -265,7 +265,7 @@ NCR_Q720_probe(struct device *dev)
        p->irq = irq;
        p->siops = siops;
 
-       if (request_irq(irq, NCR_Q720_intr, SA_SHIRQ, "NCR_Q720", p)) {
+       if (request_irq(irq, NCR_Q720_intr, IRQF_SHARED, "NCR_Q720", p)) {
                printk(KERN_ERR "NCR_Q720: request irq %d failed\n", irq);
                goto out_release;
        }
index 3dce21c7873730cf70719689576d224763ad99e4..d7e9fab54c60eb5a4ff1ae6505ecc72b1b702311 100644 (file)
@@ -1120,7 +1120,7 @@ static int __devinit inia100_probe_one(struct pci_dev *pdev,
        shost->sg_tablesize = TOTAL_SG_ENTRY;
 
        /* Initial orc chip           */
-       error = request_irq(pdev->irq, inia100_intr, SA_SHIRQ,
+       error = request_irq(pdev->irq, inia100_intr, IRQF_SHARED,
                        "inia100", shost);
        if (error < 0) {
                printk(KERN_WARNING "inia100: unable to get irq %d\n",
index 54996eaae979a0ff50004cd8f615eceffad65d35..fddfa2ebcd7075afbabf22b2388409df3a28a328 100644 (file)
@@ -208,7 +208,7 @@ int __init a2091_detect(struct scsi_host_template *tpnt)
        regs.SASR = &(DMA(instance)->SASR);
        regs.SCMD = &(DMA(instance)->SCMD);
        wd33c93_init(instance, regs, dma_setup, dma_stop, WD33C93_FS_8_10);
-       request_irq(IRQ_AMIGA_PORTS, a2091_intr, SA_SHIRQ, "A2091 SCSI",
+       request_irq(IRQ_AMIGA_PORTS, a2091_intr, IRQF_SHARED, "A2091 SCSI",
                    instance);
        DMA(instance)->CNTR = CNTR_PDMD | CNTR_INTEN;
        num_a2091++;
index f425d424bf08714e739a8457f3a94be5237bafcc..ae9ab4b136ac355cff634f22c484ce11938dd34c 100644 (file)
@@ -190,7 +190,7 @@ int __init a3000_detect(struct scsi_host_template *tpnt)
     regs.SASR = &(DMA(a3000_host)->SASR);
     regs.SCMD = &(DMA(a3000_host)->SCMD);
     wd33c93_init(a3000_host, regs, dma_setup, dma_stop, WD33C93_FS_12_15);
-    if (request_irq(IRQ_AMIGA_PORTS, a3000_intr, SA_SHIRQ, "A3000 SCSI",
+    if (request_irq(IRQ_AMIGA_PORTS, a3000_intr, IRQF_SHARED, "A3000 SCSI",
                    a3000_intr))
         goto fail_irq;
     DMA(a3000_host)->CNTR = CNTR_PDMD | CNTR_INTEN;
index 7cea514e810aa955923b9d20e6ed63f17c9307ef..1cd3584ba7ff6ee39cf3c4e40bb8b0ce5c3741e0 100644 (file)
@@ -92,31 +92,7 @@ static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long co
        init->AdapterFibsPhysicalAddress = cpu_to_le32((u32)phys);
        init->AdapterFibsSize = cpu_to_le32(fibsize);
        init->AdapterFibAlign = cpu_to_le32(sizeof(struct hw_fib));
-       /* 
-        * number of 4k pages of host physical memory. The aacraid fw needs
-        * this number to be less than 4gb worth of pages. num_physpages is in
-        * system page units. New firmware doesn't have any issues with the
-        * mapping system, but older Firmware did, and had *troubles* dealing
-        * with the math overloading past 32 bits, thus we must limit this
-        * field.
-        *
-        * This assumes the memory is mapped zero->n, which isnt
-        * always true on real computers. It also has some slight problems
-        * with the GART on x86-64. I've btw never tried DMA from PCI space
-        * on this platform but don't be surprised if its problematic.
-        * [AK: something is very very wrong when a driver tests this symbol.
-        *  Someone should figure out what the comment writer really meant here and fix
-        *  the code. Or just remove that bad code. ]
-        */
-#ifndef CONFIG_IOMMU
-       if ((num_physpages << (PAGE_SHIFT - 12)) <= AAC_MAX_HOSTPHYSMEMPAGES) {
-               init->HostPhysMemPages = 
-                       cpu_to_le32(num_physpages << (PAGE_SHIFT-12));
-       } else 
-#endif 
-       {
-               init->HostPhysMemPages = cpu_to_le32(AAC_MAX_HOSTPHYSMEMPAGES);
-       }
+       init->HostPhysMemPages = cpu_to_le32(AAC_MAX_HOSTPHYSMEMPAGES);
 
        init->InitFlags = 0;
        if (dev->new_comm_interface) {
index 5b52966bbbf3009dec252aa1f46e03938550ae00..458ea897fd72f64c09c915b2280a609e305ef4b9 100644 (file)
@@ -453,7 +453,7 @@ int aac_rkt_init(struct aac_dev *dev)
                }
                msleep(1);
        }
-       if (request_irq(dev->scsi_host_ptr->irq, aac_rkt_intr, SA_SHIRQ|SA_INTERRUPT, "aacraid", (void *)dev)<0) 
+       if (request_irq(dev->scsi_host_ptr->irq, aac_rkt_intr, IRQF_SHARED|IRQF_DISABLED, "aacraid", (void *)dev)<0)
        {
                printk(KERN_ERR "%s%d: Interrupt unavailable.\n", name, instance);
                goto error_iounmap;
index 9dadfb28b3f1ce750406f3c39d1202ec97492df0..035018db69b1b8fb85dd89a8d5252981f9f0f7d6 100644 (file)
@@ -453,7 +453,7 @@ int aac_rx_init(struct aac_dev *dev)
                }
                msleep(1);
        }
-       if (request_irq(dev->scsi_host_ptr->irq, aac_rx_intr, SA_SHIRQ|SA_INTERRUPT, "aacraid", (void *)dev)<0) 
+       if (request_irq(dev->scsi_host_ptr->irq, aac_rx_intr, IRQF_SHARED|IRQF_DISABLED, "aacraid", (void *)dev)<0)
        {
                printk(KERN_ERR "%s%d: Interrupt unavailable.\n", name, instance);
                goto error_iounmap;
index 88d400fccc94eee64ee797f234b88f667b4934ad..cd586cc8f9bef7c21a6171541179d686a3320649 100644 (file)
@@ -327,7 +327,7 @@ int aac_sa_init(struct aac_dev *dev)
                msleep(1);
        }
 
-       if (request_irq(dev->scsi_host_ptr->irq, aac_sa_intr, SA_SHIRQ|SA_INTERRUPT, "aacraid", (void *)dev ) < 0) {
+       if (request_irq(dev->scsi_host_ptr->irq, aac_sa_intr, IRQF_SHARED|IRQF_DISABLED, "aacraid", (void *)dev ) < 0) {
                printk(KERN_WARNING "%s%d: Interrupt unavailable.\n", name, instance);
                goto error_iounmap;
        }
index dd9fb3d91000a7794c10a5f30cd7b42f18e261b4..e32b4ab2f8fb27f689494039606e8990d5125683 100644 (file)
 
      1.5 (8/8/96):
          1. Add support for ABP-940U (PCI Ultra) adapter.
-         2. Add support for IRQ sharing by setting the SA_SHIRQ flag for
+         2. Add support for IRQ sharing by setting the IRQF_SHARED flag for
             request_irq and supplying a dev_id pointer to both request_irq()
             and free_irq().
          3. In AscSearchIOPortAddr11() restore a call to check_region() which
          3. For v2.1.93 and newer kernels use CONFIG_PCI and new PCI BIOS
             access functions.
          4. Update board serial number printing.
-         5. Try allocating an IRQ both with and without the SA_INTERRUPT
+         5. Try allocating an IRQ both with and without the IRQF_DISABLED
             flag set to allow IRQ sharing with drivers that do not set
-            the SA_INTERRUPT flag. Also display a more descriptive error
+            the IRQF_DISABLED flag. Also display a more descriptive error
             message if request_irq() fails.
          6. Update to latest Asc and Adv Libraries.
 
  * --- Linux Include Files
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #if defined(CONFIG_X86) && !defined(CONFIG_ISA)
@@ -5203,19 +5202,19 @@ advansys_detect(struct scsi_host_template *tpnt)
             /* Register IRQ Number. */
             ASC_DBG1(2, "advansys_detect: request_irq() %d\n", shp->irq);
            /*
-            * If request_irq() fails with the SA_INTERRUPT flag set,
-            * then try again without the SA_INTERRUPT flag set. This
+            * If request_irq() fails with the IRQF_DISABLED flag set,
+            * then try again without the IRQF_DISABLED flag set. This
             * allows IRQ sharing to work even with other drivers that
-            * do not set the SA_INTERRUPT flag.
+            * do not set the IRQF_DISABLED flag.
             *
-            * If SA_INTERRUPT is not set, then interrupts are enabled
+            * If IRQF_DISABLED is not set, then interrupts are enabled
             * before the driver interrupt function is called.
             */
             if (((ret = request_irq(shp->irq, advansys_interrupt,
-                            SA_INTERRUPT | (share_irq == TRUE ? SA_SHIRQ : 0),
+                            IRQF_DISABLED | (share_irq == TRUE ? IRQF_SHARED : 0),
                             "advansys", boardp)) != 0) &&
                 ((ret = request_irq(shp->irq, advansys_interrupt,
-                            (share_irq == TRUE ? SA_SHIRQ : 0),
+                            (share_irq == TRUE ? IRQF_SHARED : 0),
                             "advansys", boardp)) != 0))
             {
                 if (ret == -EBUSY) {
index de80cdfb5b9d4e8f85d3b08e6836d66ec542e257..36e63f82d9f8c3e57dc2d51f4878e8d119b08546 100644 (file)
@@ -855,7 +855,7 @@ struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *setup)
        SETPORT(SIMODE0, 0);
        SETPORT(SIMODE1, 0);
 
-       if( request_irq(shpnt->irq, swintr, SA_INTERRUPT|SA_SHIRQ, "aha152x", shpnt) ) {
+       if( request_irq(shpnt->irq, swintr, IRQF_DISABLED|IRQF_SHARED, "aha152x", shpnt) ) {
                printk(KERN_ERR "aha152x%d: irq %d busy.\n", shpnt->host_no, shpnt->irq);
                goto out_host_put;
        }
@@ -889,7 +889,7 @@ struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *setup)
        SETPORT(SSTAT0, 0x7f);
        SETPORT(SSTAT1, 0xef);
 
-       if ( request_irq(shpnt->irq, intr, SA_INTERRUPT|SA_SHIRQ, "aha152x", shpnt) ) {
+       if ( request_irq(shpnt->irq, intr, IRQF_DISABLED|IRQF_SHARED, "aha152x", shpnt) ) {
                printk(KERN_ERR "aha152x%d: failed to reassign irq %d.\n", shpnt->host_no, shpnt->irq);
                goto out_host_put;
        }
index 86c6bd234591c7c8af1211f8bc4519c7c33230f7..24f0f5461792d4068c35d053a6967cb4525b6347 100644 (file)
@@ -25,7 +25,6 @@
  *        Added proper detection of the AHA-1640 (MCA version of AHA-1540)
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
index 4b8c6a543925c7e236fb2fc09d159023caf58e02..0e4a7ebe300a07d1bb51686cbc804436b639ae2f 100644 (file)
@@ -634,7 +634,7 @@ static int aha1740_probe (struct device *dev)
        }
        
        DEB(printk("aha1740_probe: enable interrupt channel %d\n",irq_level));
-       if (request_irq(irq_level,aha1740_intr_handle,irq_type ? 0 : SA_SHIRQ,
+       if (request_irq(irq_level,aha1740_intr_handle,irq_type ? 0 : IRQF_SHARED,
                        "aha1740",shpnt)) {
                printk(KERN_ERR "aha1740_probe: Unable to allocate IRQ %d.\n",
                       irq_level);
index f059467777183f0463d604eefb3860c3884a3d36..15f6cd4279b750f5cd1f4d2527c1ae243a00c8ca 100644 (file)
@@ -1371,7 +1371,7 @@ static int ahci_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
        probe_ent->port_ops     = ahci_port_info[board_idx].port_ops;
 
                probe_ent->irq = pdev->irq;
-               probe_ent->irq_flags = SA_SHIRQ;
+               probe_ent->irq_flags = IRQF_SHARED;
        probe_ent->mmio_base = mmio_base;
        probe_ent->private_data = hpriv;
 
index d754b32678631dd9984ff273d3ee32f1ce6d2c5e..867cbe23579b6310f583187c4b927494f4edb54b 100644 (file)
@@ -65,7 +65,7 @@ aic7770_map_int(struct ahc_softc *ahc, u_int irq)
 
        shared = 0;
        if ((ahc->flags & AHC_EDGE_INTERRUPT) == 0)
-               shared = SA_SHIRQ;
+               shared = IRQF_SHARED;
 
        error = request_irq(irq, ahc_linux_isr, shared, "aic7xxx", ahc);
        if (error == 0)
index eb7745692682048dbd7cfc83fb0e6f3c8ee634b7..df3346b5caf8a722fe14c2b137401ab5a3978da3 100644 (file)
@@ -1487,6 +1487,7 @@ typedef enum {
 } ahd_queue_alg;
 
 void                   ahd_set_tags(struct ahd_softc *ahd,
+                                    struct scsi_cmnd *cmd,
                                     struct ahd_devinfo *devinfo,
                                     ahd_queue_alg alg);
 
index 801fc81d0b202ff296bbbb1394fe6f5cb286ff4c..a1e8ca758594ab43936efd73f0aa1b43ae46c292 100644 (file)
@@ -1090,7 +1090,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat)
 
                        /* Notify XPT */
                        ahd_send_async(ahd, devinfo.channel, devinfo.target,
-                                      CAM_LUN_WILDCARD, AC_SENT_BDR, NULL);
+                                      CAM_LUN_WILDCARD, AC_SENT_BDR);
 
                        /*
                         * Allow the sequencer to continue with
@@ -3062,7 +3062,7 @@ ahd_set_syncrate(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
                tinfo->curr.ppr_options = ppr_options;
 
                ahd_send_async(ahd, devinfo->channel, devinfo->target,
-                              CAM_LUN_WILDCARD, AC_TRANSFER_NEG, NULL);
+                              CAM_LUN_WILDCARD, AC_TRANSFER_NEG);
                if (bootverbose) {
                        if (offset != 0) {
                                int options;
@@ -3184,7 +3184,7 @@ ahd_set_width(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
 
                tinfo->curr.width = width;
                ahd_send_async(ahd, devinfo->channel, devinfo->target,
-                              CAM_LUN_WILDCARD, AC_TRANSFER_NEG, NULL);
+                              CAM_LUN_WILDCARD, AC_TRANSFER_NEG);
                if (bootverbose) {
                        printf("%s: target %d using %dbit transfers\n",
                               ahd_name(ahd), devinfo->target,
@@ -3211,12 +3211,14 @@ ahd_set_width(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
  * Update the current state of tagged queuing for a given target.
  */
 void
-ahd_set_tags(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
-            ahd_queue_alg alg)
+ahd_set_tags(struct ahd_softc *ahd, struct scsi_cmnd *cmd,
+            struct ahd_devinfo *devinfo, ahd_queue_alg alg)
 {
-       ahd_platform_set_tags(ahd, devinfo, alg);
+       struct scsi_device *sdev = cmd->device;
+
+       ahd_platform_set_tags(ahd, sdev, devinfo, alg);
        ahd_send_async(ahd, devinfo->channel, devinfo->target,
-                      devinfo->lun, AC_TRANSFER_NEG, &alg);
+                      devinfo->lun, AC_TRANSFER_NEG);
 }
 
 static void
@@ -4746,7 +4748,7 @@ ahd_handle_msg_reject(struct ahd_softc *ahd, struct ahd_devinfo *devinfo)
                        printf("(%s:%c:%d:%d): refuses tagged commands.  "
                               "Performing non-tagged I/O\n", ahd_name(ahd),
                               devinfo->channel, devinfo->target, devinfo->lun);
-                       ahd_set_tags(ahd, devinfo, AHD_QUEUE_NONE);
+                       ahd_set_tags(ahd, scb->io_ctx, devinfo, AHD_QUEUE_NONE);
                        mask = ~0x23;
                } else {
                        printf("(%s:%c:%d:%d): refuses %s tagged commands.  "
@@ -4754,7 +4756,7 @@ ahd_handle_msg_reject(struct ahd_softc *ahd, struct ahd_devinfo *devinfo)
                               ahd_name(ahd), devinfo->channel, devinfo->target,
                               devinfo->lun, tag_type == MSG_ORDERED_TASK
                               ? "ordered" : "head of queue");
-                       ahd_set_tags(ahd, devinfo, AHD_QUEUE_BASIC);
+                       ahd_set_tags(ahd, scb->io_ctx, devinfo, AHD_QUEUE_BASIC);
                        mask = ~0x03;
                }
 
@@ -5098,7 +5100,7 @@ ahd_handle_devreset(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
        
        if (status != CAM_SEL_TIMEOUT)
                ahd_send_async(ahd, devinfo->channel, devinfo->target,
-                              CAM_LUN_WILDCARD, AC_SENT_BDR, NULL);
+                              CAM_LUN_WILDCARD, AC_SENT_BDR);
 
        if (message != NULL && bootverbose)
                printf("%s: %s on %c:%d. %d SCBs aborted\n", ahd_name(ahd),
@@ -7952,7 +7954,7 @@ ahd_reset_channel(struct ahd_softc *ahd, char channel, int initiate_reset)
 #endif
        /* Notify the XPT that a bus reset occurred */
        ahd_send_async(ahd, devinfo.channel, CAM_TARGET_WILDCARD,
-                      CAM_LUN_WILDCARD, AC_BUS_RESET, NULL);
+                      CAM_LUN_WILDCARD, AC_BUS_RESET);
 
        /*
         * Revert to async/narrow transfers until we renegotiate.
index e0ccdf362200613416dbe2e89a354edff4684f8b..b244c712417923ac088c06f5665e2741b5017e6d 100644 (file)
@@ -484,7 +484,6 @@ ahd_linux_target_alloc(struct scsi_target *starget)
        struct seeprom_config *sc = ahd->seep_config;
        unsigned long flags;
        struct scsi_target **ahd_targp = ahd_linux_target_in_softc(starget);
-       struct ahd_linux_target *targ = scsi_transport_target_data(starget);
        struct ahd_devinfo devinfo;
        struct ahd_initiator_tinfo *tinfo;
        struct ahd_tmode_tstate *tstate;
@@ -495,7 +494,6 @@ ahd_linux_target_alloc(struct scsi_target *starget)
        BUG_ON(*ahd_targp != NULL);
 
        *ahd_targp = starget;
-       memset(targ, 0, sizeof(*targ));
 
        if (sc) {
                int flags = sc->device_flags[starget->id];
@@ -551,15 +549,11 @@ ahd_linux_slave_alloc(struct scsi_device *sdev)
 {
        struct  ahd_softc *ahd =
                *((struct ahd_softc **)sdev->host->hostdata);
-       struct scsi_target *starget = sdev->sdev_target;
-       struct ahd_linux_target *targ = scsi_transport_target_data(starget);
        struct ahd_linux_device *dev;
 
        if (bootverbose)
                printf("%s: Slave Alloc %d\n", ahd_name(ahd), sdev->id);
 
-       BUG_ON(targ->sdev[sdev->lun] != NULL);
-
        dev = scsi_transport_device_data(sdev);
        memset(dev, 0, sizeof(*dev));
 
@@ -576,8 +570,6 @@ ahd_linux_slave_alloc(struct scsi_device *sdev)
         */
        dev->maxtags = 0;
        
-       targ->sdev[sdev->lun] = sdev;
-
        return (0);
 }
 
@@ -599,23 +591,6 @@ ahd_linux_slave_configure(struct scsi_device *sdev)
        return 0;
 }
 
-static void
-ahd_linux_slave_destroy(struct scsi_device *sdev)
-{
-       struct  ahd_softc *ahd;
-       struct  ahd_linux_device *dev = scsi_transport_device_data(sdev);
-       struct  ahd_linux_target *targ = scsi_transport_target_data(sdev->sdev_target);
-
-       ahd = *((struct ahd_softc **)sdev->host->hostdata);
-       if (bootverbose)
-               printf("%s: Slave Destroy %d\n", ahd_name(ahd), sdev->id);
-
-       BUG_ON(dev->active);
-
-       targ->sdev[sdev->lun] = NULL;
-
-}
-
 #if defined(__i386__)
 /*
  * Return the disk geometry for the given SCSI device.
@@ -822,7 +797,6 @@ struct scsi_host_template aic79xx_driver_template = {
        .use_clustering         = ENABLE_CLUSTERING,
        .slave_alloc            = ahd_linux_slave_alloc,
        .slave_configure        = ahd_linux_slave_configure,
-       .slave_destroy          = ahd_linux_slave_destroy,
        .target_alloc           = ahd_linux_target_alloc,
        .target_destroy         = ahd_linux_target_destroy,
 };
@@ -1249,20 +1223,13 @@ void
 ahd_platform_free(struct ahd_softc *ahd)
 {
        struct scsi_target *starget;
-       int i, j;
+       int i;
 
        if (ahd->platform_data != NULL) {
                /* destroy all of the device and target objects */
                for (i = 0; i < AHD_NUM_TARGETS; i++) {
                        starget = ahd->platform_data->starget[i];
                        if (starget != NULL) {
-                               for (j = 0; j < AHD_NUM_LUNS; j++) {
-                                       struct ahd_linux_target *targ =
-                                               scsi_transport_target_data(starget);
-                                       if (targ->sdev[j] == NULL)
-                                               continue;
-                                       targ->sdev[j] = NULL;
-                               }
                                ahd->platform_data->starget[i] = NULL;
                        }
                }
@@ -1318,20 +1285,13 @@ ahd_platform_freeze_devq(struct ahd_softc *ahd, struct scb *scb)
 }
 
 void
-ahd_platform_set_tags(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
-                     ahd_queue_alg alg)
+ahd_platform_set_tags(struct ahd_softc *ahd, struct scsi_device *sdev,
+                     struct ahd_devinfo *devinfo, ahd_queue_alg alg)
 {
-       struct scsi_target *starget;
-       struct ahd_linux_target *targ;
        struct ahd_linux_device *dev;
-       struct scsi_device *sdev;
        int was_queuing;
        int now_queuing;
 
-       starget = ahd->platform_data->starget[devinfo->target];
-       targ = scsi_transport_target_data(starget);
-       BUG_ON(targ == NULL);
-       sdev = targ->sdev[devinfo->lun];
        if (sdev == NULL)
                return;
 
@@ -1467,11 +1427,15 @@ ahd_linux_device_queue_depth(struct scsi_device *sdev)
        tags = ahd_linux_user_tagdepth(ahd, &devinfo);
        if (tags != 0 && sdev->tagged_supported != 0) {
 
-               ahd_set_tags(ahd, &devinfo, AHD_QUEUE_TAGGED);
+               ahd_platform_set_tags(ahd, sdev, &devinfo, AHD_QUEUE_TAGGED);
+               ahd_send_async(ahd, devinfo.channel, devinfo.target,
+                              devinfo.lun, AC_TRANSFER_NEG);
                ahd_print_devinfo(ahd, &devinfo);
                printf("Tagged Queuing enabled.  Depth %d\n", tags);
        } else {
-               ahd_set_tags(ahd, &devinfo, AHD_QUEUE_NONE);
+               ahd_platform_set_tags(ahd, sdev, &devinfo, AHD_QUEUE_NONE);
+               ahd_send_async(ahd, devinfo.channel, devinfo.target,
+                              devinfo.lun, AC_TRANSFER_NEG);
        }
 }
 
@@ -1629,7 +1593,7 @@ ahd_linux_isr(int irq, void *dev_id, struct pt_regs * regs)
 
 void
 ahd_send_async(struct ahd_softc *ahd, char channel,
-              u_int target, u_int lun, ac_code code, void *arg)
+              u_int target, u_int lun, ac_code code)
 {
        switch (code) {
        case AC_TRANSFER_NEG:
@@ -1956,7 +1920,7 @@ ahd_linux_handle_scsi_status(struct ahd_softc *ahd,
                        }
                        ahd_set_transaction_status(scb, CAM_REQUEUE_REQ);
                        ahd_set_scsi_status(scb, SCSI_STATUS_OK);
-                       ahd_platform_set_tags(ahd, &devinfo,
+                       ahd_platform_set_tags(ahd, sdev, &devinfo,
                                     (dev->flags & AHD_DEV_Q_BASIC)
                                   ? AHD_QUEUE_BASIC : AHD_QUEUE_TAGGED);
                        break;
@@ -1966,7 +1930,7 @@ ahd_linux_handle_scsi_status(struct ahd_softc *ahd,
                 * as if the target returned BUSY SCSI status.
                 */
                dev->openings = 1;
-               ahd_platform_set_tags(ahd, &devinfo,
+               ahd_platform_set_tags(ahd, sdev, &devinfo,
                             (dev->flags & AHD_DEV_Q_BASIC)
                           ? AHD_QUEUE_BASIC : AHD_QUEUE_TAGGED);
                ahd_set_scsi_status(scb, SCSI_STATUS_BUSY);
@@ -2778,8 +2742,6 @@ ahd_linux_init(void)
        if (!ahd_linux_transport_template)
                return -ENODEV;
 
-       scsi_transport_reserve_target(ahd_linux_transport_template,
-                                     sizeof(struct ahd_linux_target));
        scsi_transport_reserve_device(ahd_linux_transport_template,
                                      sizeof(struct ahd_linux_device));
 
index 2b8331649eeb74caa6d0edc5db2907d2ce0ab10d..9e871de2383564816c7ac703966b4d8ecf24600c 100644 (file)
@@ -42,7 +42,6 @@
 #ifndef _AIC79XX_LINUX_H_
 #define _AIC79XX_LINUX_H_
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/blkdev.h>
 #include <linux/delay.h>
@@ -263,7 +262,6 @@ typedef enum {
        AHD_DEV_PERIODIC_OTAG    = 0x40, /* Send OTAG to prevent starvation */
 } ahd_linux_dev_flags;
 
-struct ahd_linux_target;
 struct ahd_linux_device {
        TAILQ_ENTRY(ahd_linux_device) links;
 
@@ -343,12 +341,6 @@ struct ahd_linux_device {
 #define AHD_OTAG_THRESH        500
 };
 
-struct ahd_linux_target {
-       struct scsi_device       *sdev[AHD_NUM_LUNS];
-       struct ahd_transinfo      last_tinfo;
-       struct ahd_softc         *ahd;
-};
-
 /********************* Definitions Required by the Core ***********************/
 /*
  * Number of SG segments we require.  So long as the S/G segments for
@@ -865,7 +857,7 @@ ahd_freeze_scb(struct scb *scb)
         }
 }
 
-void   ahd_platform_set_tags(struct ahd_softc *ahd,
+void   ahd_platform_set_tags(struct ahd_softc *ahd, struct scsi_device *sdev,
                              struct ahd_devinfo *devinfo, ahd_queue_alg);
 int    ahd_platform_abort_scbs(struct ahd_softc *ahd, int target,
                                char channel, int lun, u_int tag,
@@ -874,7 +866,7 @@ irqreturn_t
        ahd_linux_isr(int irq, void *dev_id, struct pt_regs * regs);
 void   ahd_done(struct ahd_softc*, struct scb*);
 void   ahd_send_async(struct ahd_softc *, char channel,
-                      u_int target, u_int lun, ac_code, void *);
+                      u_int target, u_int lun, ac_code);
 void   ahd_print_path(struct ahd_softc *, struct scb *);
 
 #ifdef CONFIG_PCI
index ebbf7e4ff4cc653e6639caa0ccc8ae5c5867f267..50a41eda580eb4daebac5be164fa8db2f8c8ebc2 100644 (file)
@@ -342,7 +342,7 @@ ahd_pci_map_int(struct ahd_softc *ahd)
        int error;
 
        error = request_irq(ahd->dev_softc->irq, ahd_linux_isr,
-                           SA_SHIRQ, "aic79xx", ahd);
+                           IRQF_SHARED, "aic79xx", ahd);
        if (!error)
                ahd->platform_data->irq = ahd->dev_softc->irq;
        
index 24fd59a230bf490c980895ffc5dbbeb9beee38ac..c5f0ee59150963a0f7a564cd9b3ec51f9a345d75 100644 (file)
@@ -47,7 +47,7 @@ static int    copy_info(struct info_str *info, char *fmt, ...);
 static void    ahd_dump_target_state(struct ahd_softc *ahd,
                                      struct info_str *info,
                                      u_int our_id, char channel,
-                                     u_int target_id, u_int target_offset);
+                                     u_int target_id);
 static void    ahd_dump_device_state(struct info_str *info,
                                      struct scsi_device *sdev);
 static int     ahd_proc_write_seeprom(struct ahd_softc *ahd,
@@ -204,10 +204,8 @@ ahd_format_transinfo(struct info_str *info, struct ahd_transinfo *tinfo)
 
 static void
 ahd_dump_target_state(struct ahd_softc *ahd, struct info_str *info,
-                     u_int our_id, char channel, u_int target_id,
-                     u_int target_offset)
+                     u_int our_id, char channel, u_int target_id)
 {
-       struct  ahd_linux_target *targ;
        struct  scsi_target *starget;
        struct  ahd_initiator_tinfo *tinfo;
        struct  ahd_tmode_tstate *tstate;
@@ -218,10 +216,9 @@ ahd_dump_target_state(struct ahd_softc *ahd, struct info_str *info,
        copy_info(info, "Target %d Negotiation Settings\n", target_id);
        copy_info(info, "\tUser: ");
        ahd_format_transinfo(info, &tinfo->user);
-       starget = ahd->platform_data->starget[target_offset];
+       starget = ahd->platform_data->starget[target_id];
        if (starget == NULL)
                return;
-       targ = scsi_transport_target_data(starget);
 
        copy_info(info, "\tGoal: ");
        ahd_format_transinfo(info, &tinfo->goal);
@@ -231,7 +228,7 @@ ahd_dump_target_state(struct ahd_softc *ahd, struct info_str *info,
        for (lun = 0; lun < AHD_NUM_LUNS; lun++) {
                struct scsi_device *dev;
 
-               dev = targ->sdev[lun];
+               dev = scsi_device_lookup_by_target(starget, lun);
 
                if (dev == NULL)
                        continue;
@@ -355,7 +352,7 @@ ahd_linux_proc_info(struct Scsi_Host *shost, char *buffer, char **start,
        copy_info(&info, "Allocated SCBs: %d, SG List Length: %d\n\n",
                  ahd->scb_data.numscbs, AHD_NSEG);
 
-       max_targ = 15;
+       max_targ = 16;
 
        if (ahd->seep_config == NULL)
                copy_info(&info, "No Serial EEPROM\n");
@@ -373,12 +370,12 @@ ahd_linux_proc_info(struct Scsi_Host *shost, char *buffer, char **start,
        copy_info(&info, "\n");
 
        if ((ahd->features & AHD_WIDE) == 0)
-               max_targ = 7;
+               max_targ = 8;
 
-       for (i = 0; i <= max_targ; i++) {
+       for (i = 0; i < max_targ; i++) {
 
                ahd_dump_target_state(ahd, &info, ahd->our_id, 'A',
-                                     /*target_id*/i, /*target_offset*/i);
+                                     /*target_id*/i);
        }
        retval = info.pos > info.offset ? info.pos - info.offset : 0;
 done:
index a20b08c9ff15ef8aa51501fe59f7887f495de21b..d42a71ee076df62f7c59cca626398984966a1027 100644 (file)
@@ -59,7 +59,6 @@
 #ifndef _AIC7XXX_LINUX_H_
 #define _AIC7XXX_LINUX_H_
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/blkdev.h>
 #include <linux/delay.h>
index 0c9c2f400bf6b21982c4fdb5e1fa0974bb372f5c..7e42f07a27f3d2879aec66a395f6504afe6a6fb0 100644 (file)
@@ -375,7 +375,7 @@ ahc_pci_map_int(struct ahc_softc *ahc)
        int error;
 
        error = request_irq(ahc->dev_softc->irq, ahc_linux_isr,
-                           SA_SHIRQ, "aic7xxx", ahc);
+                           IRQF_SHARED, "aic7xxx", ahc);
        if (error == 0)
                ahc->platform_data->irq = ahc->dev_softc->irq;
        
index 5dba1c63122e24c18813e35eb85168835ab993a4..3f85b5e978f1a9c2f9f251a32a847f820467e652 100644 (file)
@@ -8322,11 +8322,11 @@ aic7xxx_register(struct scsi_host_template *template, struct aic7xxx_host *p,
   }
   else
   {
-    result = (request_irq(p->irq, do_aic7xxx_isr, SA_SHIRQ,
+    result = (request_irq(p->irq, do_aic7xxx_isr, IRQF_SHARED,
               "aic7xxx", p));
     if (result < 0)
     {
-      result = (request_irq(p->irq, do_aic7xxx_isr, SA_INTERRUPT | SA_SHIRQ,
+      result = (request_irq(p->irq, do_aic7xxx_isr, IRQF_DISABLED | IRQF_SHARED,
               "aic7xxx", p));
     }
   }
index 3bf334931a8a0ad75801a5d1a941c5fcda4309ca..b07e4f04fd00b3b82e3121a9decd8fe87b1a5a5e 100644 (file)
@@ -29,7 +29,6 @@
  *  $Id: aic7xxx_proc.c,v 4.1 1997/06/97 08:23:42 deang Exp $
  *-M*************************************************************************/
 
-#include <linux/config.h>
 
 #define        BLS     (&aic7xxx_buffer[size])
 #define HDRB \
index c0844fa32c5de60aa775216f3352c6e73383411b..9099d531d5a4402cb401ee0f97bf6f2efe96e51d 100644 (file)
@@ -11,7 +11,6 @@
 #include <linux/mm.h>
 #include <linux/blkdev.h>
 #include <linux/sched.h>
-#include <linux/config.h>
 #include <linux/zorro.h>
 #include <linux/stat.h>
 
index dda5a5f79c53297af2cd8ebaa6a64d884bde5971..7621e3fa37b15fb96333eea7ed6cd2e6b89948b1 100644 (file)
 #define STRx(x) STRINGIFY(x)
 #define NO_WRITE_STR STRx(NO_WRITE)
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -3031,7 +3030,7 @@ acornscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
        if (!request_region(host->io_port, 2048, "acornscsi(ram)"))
                goto err_5;
 
-       ret = request_irq(host->irq, acornscsi_intr, SA_INTERRUPT, "acornscsi", ashost);
+       ret = request_irq(host->irq, acornscsi_intr, IRQF_DISABLED, "acornscsi", ashost);
        if (ret) {
                printk(KERN_CRIT "scsi%d: IRQ%d not free: %d\n",
                        host->host_no, ashost->scsi.irq, ret);
index e6c9491dc5c08656ea73ffb0d101b1610327efa0..3bdfc36481ae8f8e7c8b0ea1c7ddba83f4465db7 100644 (file)
@@ -277,7 +277,7 @@ cumanascsi1_probe(struct expansion_card *ec, const struct ecard_id *id)
         ((struct NCR5380_hostdata *)host->hostdata)->ctrl = 0;
         outb(0x00, host->io_port - 577);
 
-       ret = request_irq(host->irq, cumanascsi_intr, SA_INTERRUPT,
+       ret = request_irq(host->irq, cumanascsi_intr, IRQF_DISABLED,
                          "CumanaSCSI-1", host);
        if (ret) {
                printk("scsi%d: IRQ%d not free: %d\n",
index fad2109268bb3175321afd6c5b10f5e8d9e44ebb..719af0dcc0e580d9059cff9c2be96091435f3865 100644 (file)
@@ -460,7 +460,7 @@ cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id)
                goto out_free;
 
        ret = request_irq(ec->irq, cumanascsi_2_intr,
-                         SA_INTERRUPT, "cumanascsi2", info);
+                         IRQF_DISABLED, "cumanascsi2", info);
        if (ret) {
                printk("scsi%d: IRQ%d not free: %d\n",
                       host->host_no, ec->irq, ret);
index 3d69f6c45a6b5b80698bef6bedd3fbf14468db27..b2c346a470527543a02db9ce71c25b6e8c9ebde9 100644 (file)
@@ -373,7 +373,7 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
                goto out_free;
 
        ret = request_irq(ec->irq, powertecscsi_intr,
-                         SA_INTERRUPT, "powertec", info);
+                         IRQF_DISABLED, "powertec", info);
        if (ret) {
                printk("scsi%d: IRQ%d not free: %d\n",
                       host->host_no, ec->irq, ret);
index 57295bcea3e766a4ae87d760ab6bf4cf1be35b32..007a14e5c3fddac952adcdd467c72bd744329007 100644 (file)
@@ -524,7 +524,6 @@ static __inline__ void initialize_SCp(Scsi_Cmnd *cmd)
     }
 }
 
-#include <linux/config.h>
 #include <linux/delay.h>
 
 #if NDEBUG
index f677c5a32a681c505b8322263f4e3c987acdd00d..e1be4a4387cd5309351c1bd78ae428663d4a4d62 100644 (file)
@@ -65,7 +65,6 @@
 
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #define NDEBUG (0)
index 3ee4d4d3f445612ecc3556eac2c07eb62b20cf63..0ec41f34f46261bdbcfdf934aafb44c72c5efabf 100644 (file)
@@ -2625,29 +2625,32 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        unsigned int base_io, tmport, error,n;
        unsigned char host_id;
        struct Scsi_Host *shpnt = NULL;
-       struct atp_unit atp_dev, *p;
+       struct atp_unit *atpdev, *p;
        unsigned char setupdata[2][16];
        int count = 0;
-       
+
+       atpdev = kzalloc(sizeof(*atpdev), GFP_KERNEL);
+       if (!atpdev)
+               return -ENOMEM;
+
        if (pci_enable_device(pdev))
-               return -EIO;
+               goto err_eio;
 
         if (!pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
                 printk(KERN_INFO "atp870u: use 32bit DMA mask.\n");
         } else {
                 printk(KERN_ERR "atp870u: DMA mask required but not available.\n");
-                return -EIO;
+               goto err_eio;
         }
 
-       memset(&atp_dev, 0, sizeof atp_dev);
        /*
         * It's probably easier to weed out some revisions like
         * this than via the PCI device table
         */
        if (ent->device == PCI_DEVICE_ID_ARTOP_AEC7610) {
-               error = pci_read_config_byte(pdev, PCI_CLASS_REVISION, &atp_dev.chip_ver);
-               if (atp_dev.chip_ver < 2)
-                       return -EIO;
+               error = pci_read_config_byte(pdev, PCI_CLASS_REVISION, &atpdev->chip_ver);
+               if (atpdev->chip_ver < 2)
+                       goto err_eio;
        }
 
        switch (ent->device) {
@@ -2656,15 +2659,15 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        case ATP880_DEVID1:     
        case ATP880_DEVID2:     
        case ATP885_DEVID:      
-               atp_dev.chip_ver = 0x04;
+               atpdev->chip_ver = 0x04;
        default:
                break;
        }
        base_io = pci_resource_start(pdev, 0);
        base_io &= 0xfffffff8;
-       
+
        if ((ent->device == ATP880_DEVID1)||(ent->device == ATP880_DEVID2)) {
-               error = pci_read_config_byte(pdev, PCI_CLASS_REVISION, &atp_dev.chip_ver);
+               error = pci_read_config_byte(pdev, PCI_CLASS_REVISION, &atpdev->chip_ver);
                pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0x80);//JCC082803
 
                host_id = inb(base_io + 0x39);
@@ -2672,17 +2675,17 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
                printk(KERN_INFO "   ACARD AEC-67160 PCI Ultra3 LVD Host Adapter: %d"
                        "    IO:%x, IRQ:%d.\n", count, base_io, pdev->irq);
-               atp_dev.ioport[0] = base_io + 0x40;
-               atp_dev.pciport[0] = base_io + 0x28;
-               atp_dev.dev_id = ent->device;
-               atp_dev.host_id[0] = host_id;
+               atpdev->ioport[0] = base_io + 0x40;
+               atpdev->pciport[0] = base_io + 0x28;
+               atpdev->dev_id = ent->device;
+               atpdev->host_id[0] = host_id;
 
                tmport = base_io + 0x22;
-               atp_dev.scam_on = inb(tmport);
+               atpdev->scam_on = inb(tmport);
                tmport += 0x13;
-               atp_dev.global_map[0] = inb(tmport);
+               atpdev->global_map[0] = inb(tmport);
                tmport += 0x07;
-               atp_dev.ultra_map[0] = inw(tmport);
+               atpdev->ultra_map[0] = inw(tmport);
 
                n = 0x3f09;
 next_fblk_880:
@@ -2695,63 +2698,63 @@ next_fblk_880:
                if (inb(base_io + 0x30) == 0xff)
                        goto flash_ok_880;
 
-               atp_dev.sp[0][m++] = inb(base_io + 0x30);
-               atp_dev.sp[0][m++] = inb(base_io + 0x31);
-               atp_dev.sp[0][m++] = inb(base_io + 0x32);
-               atp_dev.sp[0][m++] = inb(base_io + 0x33);
+               atpdev->sp[0][m++] = inb(base_io + 0x30);
+               atpdev->sp[0][m++] = inb(base_io + 0x31);
+               atpdev->sp[0][m++] = inb(base_io + 0x32);
+               atpdev->sp[0][m++] = inb(base_io + 0x33);
                outw(n, base_io + 0x34);
                n += 0x0002;
-               atp_dev.sp[0][m++] = inb(base_io + 0x30);
-               atp_dev.sp[0][m++] = inb(base_io + 0x31);
-               atp_dev.sp[0][m++] = inb(base_io + 0x32);
-               atp_dev.sp[0][m++] = inb(base_io + 0x33);
+               atpdev->sp[0][m++] = inb(base_io + 0x30);
+               atpdev->sp[0][m++] = inb(base_io + 0x31);
+               atpdev->sp[0][m++] = inb(base_io + 0x32);
+               atpdev->sp[0][m++] = inb(base_io + 0x33);
                outw(n, base_io + 0x34);
                n += 0x0002;
-               atp_dev.sp[0][m++] = inb(base_io + 0x30);
-               atp_dev.sp[0][m++] = inb(base_io + 0x31);
-               atp_dev.sp[0][m++] = inb(base_io + 0x32);
-               atp_dev.sp[0][m++] = inb(base_io + 0x33);
+               atpdev->sp[0][m++] = inb(base_io + 0x30);
+               atpdev->sp[0][m++] = inb(base_io + 0x31);
+               atpdev->sp[0][m++] = inb(base_io + 0x32);
+               atpdev->sp[0][m++] = inb(base_io + 0x33);
                outw(n, base_io + 0x34);
                n += 0x0002;
-               atp_dev.sp[0][m++] = inb(base_io + 0x30);
-               atp_dev.sp[0][m++] = inb(base_io + 0x31);
-               atp_dev.sp[0][m++] = inb(base_io + 0x32);
-               atp_dev.sp[0][m++] = inb(base_io + 0x33);
+               atpdev->sp[0][m++] = inb(base_io + 0x30);
+               atpdev->sp[0][m++] = inb(base_io + 0x31);
+               atpdev->sp[0][m++] = inb(base_io + 0x32);
+               atpdev->sp[0][m++] = inb(base_io + 0x33);
                n += 0x0018;
                goto next_fblk_880;
 flash_ok_880:
                outw(0, base_io + 0x34);
-               atp_dev.ultra_map[0] = 0;
-               atp_dev.async[0] = 0;
+               atpdev->ultra_map[0] = 0;
+               atpdev->async[0] = 0;
                for (k = 0; k < 16; k++) {
                        n = 1;
                        n = n << k;
-                       if (atp_dev.sp[0][k] > 1) {
-                               atp_dev.ultra_map[0] |= n;
+                       if (atpdev->sp[0][k] > 1) {
+                               atpdev->ultra_map[0] |= n;
                        } else {
-                               if (atp_dev.sp[0][k] == 0)
-                                       atp_dev.async[0] |= n;
+                               if (atpdev->sp[0][k] == 0)
+                                       atpdev->async[0] |= n;
                        }
                }
-               atp_dev.async[0] = ~(atp_dev.async[0]);
-               outb(atp_dev.global_map[0], base_io + 0x35);
+               atpdev->async[0] = ~(atpdev->async[0]);
+               outb(atpdev->global_map[0], base_io + 0x35);
  
                shpnt = scsi_host_alloc(&atp870u_template, sizeof(struct atp_unit));
                if (!shpnt)
-                       return -ENOMEM;
+                       goto err_nomem;
 
                p = (struct atp_unit *)&shpnt->hostdata;
 
-               atp_dev.host = shpnt;
-               atp_dev.pdev = pdev;
+               atpdev->host = shpnt;
+               atpdev->pdev = pdev;
                pci_set_drvdata(pdev, p);
-               memcpy(p, &atp_dev, sizeof atp_dev);
+               memcpy(p, atpdev, sizeof(*atpdev));
                if (atp870u_init_tables(shpnt) < 0) {
                        printk(KERN_ERR "Unable to allocate tables for Acard controller\n");
                        goto unregister;
                }
 
-               if (request_irq(pdev->irq, atp870u_intr_handle, SA_SHIRQ, "atp880i", shpnt)) {
+               if (request_irq(pdev->irq, atp870u_intr_handle, IRQF_SHARED, "atp880i", shpnt)) {
                        printk(KERN_ERR "Unable to allocate IRQ%d for Acard controller.\n", pdev->irq);
                        goto free_tables;
                }
@@ -2798,31 +2801,31 @@ flash_ok_880:
                        printk(KERN_INFO "   ACARD AEC-67162 PCI Ultra3 LVD Host Adapter:  IO:%x, IRQ:%d.\n"
                               , base_io, pdev->irq);
                
-               atp_dev.pdev = pdev;    
-               atp_dev.dev_id  = ent->device;
-               atp_dev.baseport = base_io;
-               atp_dev.ioport[0] = base_io + 0x80;
-               atp_dev.ioport[1] = base_io + 0xc0;
-               atp_dev.pciport[0] = base_io + 0x40;
-               atp_dev.pciport[1] = base_io + 0x50;
+               atpdev->pdev = pdev;
+               atpdev->dev_id  = ent->device;
+               atpdev->baseport = base_io;
+               atpdev->ioport[0] = base_io + 0x80;
+               atpdev->ioport[1] = base_io + 0xc0;
+               atpdev->pciport[0] = base_io + 0x40;
+               atpdev->pciport[1] = base_io + 0x50;
                                
                shpnt = scsi_host_alloc(&atp870u_template, sizeof(struct atp_unit));
                if (!shpnt)
-                       return -ENOMEM;
+                       goto err_nomem;
                
                p = (struct atp_unit *)&shpnt->hostdata;
                
-               atp_dev.host = shpnt;
-               atp_dev.pdev = pdev;
+               atpdev->host = shpnt;
+               atpdev->pdev = pdev;
                pci_set_drvdata(pdev, p);
-               memcpy(p, &atp_dev, sizeof(struct atp_unit));
+               memcpy(p, atpdev, sizeof(struct atp_unit));
                if (atp870u_init_tables(shpnt) < 0)
                        goto unregister;
                        
 #ifdef ED_DBGP         
        printk("request_irq() shpnt %p hostdata %p\n", shpnt, p);
 #endif         
-               if (request_irq(pdev->irq, atp870u_intr_handle, SA_SHIRQ, "atp870u", shpnt)) {
+               if (request_irq(pdev->irq, atp870u_intr_handle, IRQF_SHARED, "atp870u", shpnt)) {
                                printk(KERN_ERR "Unable to allocate IRQ for Acard controller.\n");
                        goto free_tables;
                }
@@ -2974,43 +2977,43 @@ flash_ok_885:
                printk(KERN_INFO "   ACARD AEC-671X PCI Ultra/W SCSI-2/3 Host Adapter: %d "
                        "IO:%x, IRQ:%d.\n", count, base_io, pdev->irq);
 
-               atp_dev.ioport[0] = base_io;
-               atp_dev.pciport[0] = base_io + 0x20;
-               atp_dev.dev_id = ent->device;
+               atpdev->ioport[0] = base_io;
+               atpdev->pciport[0] = base_io + 0x20;
+               atpdev->dev_id = ent->device;
                host_id &= 0x07;
-               atp_dev.host_id[0] = host_id;
+               atpdev->host_id[0] = host_id;
                tmport = base_io + 0x22;
-               atp_dev.scam_on = inb(tmport);
+               atpdev->scam_on = inb(tmport);
                tmport += 0x0b;
-               atp_dev.global_map[0] = inb(tmport++);
-               atp_dev.ultra_map[0] = inw(tmport);
+               atpdev->global_map[0] = inb(tmport++);
+               atpdev->ultra_map[0] = inw(tmport);
 
-               if (atp_dev.ultra_map[0] == 0) {
-                       atp_dev.scam_on = 0x00;
-                       atp_dev.global_map[0] = 0x20;
-                       atp_dev.ultra_map[0] = 0xffff;
+               if (atpdev->ultra_map[0] == 0) {
+                       atpdev->scam_on = 0x00;
+                       atpdev->global_map[0] = 0x20;
+                       atpdev->ultra_map[0] = 0xffff;
                }
 
                shpnt = scsi_host_alloc(&atp870u_template, sizeof(struct atp_unit));
                if (!shpnt)
-                       return -ENOMEM;
+                       goto err_nomem;
 
                p = (struct atp_unit *)&shpnt->hostdata;
                
-               atp_dev.host = shpnt;
-               atp_dev.pdev = pdev;
+               atpdev->host = shpnt;
+               atpdev->pdev = pdev;
                pci_set_drvdata(pdev, p);
-               memcpy(p, &atp_dev, sizeof atp_dev);
+               memcpy(p, atpdev, sizeof(*atpdev));
                if (atp870u_init_tables(shpnt) < 0)
                        goto unregister;
 
-               if (request_irq(pdev->irq, atp870u_intr_handle, SA_SHIRQ, "atp870i", shpnt)) {
+               if (request_irq(pdev->irq, atp870u_intr_handle, IRQF_SHARED, "atp870i", shpnt)) {
                        printk(KERN_ERR "Unable to allocate IRQ%d for Acard controller.\n", pdev->irq);
                        goto free_tables;
                }
 
                spin_lock_irqsave(shpnt->host_lock, flags);
-               if (atp_dev.chip_ver > 0x07) {  /* check if atp876 chip then enable terminator */
+               if (atpdev->chip_ver > 0x07) {  /* check if atp876 chip then enable terminator */
                        tmport = base_io + 0x3e;
                        outb(0x00, tmport);
                }
@@ -3044,7 +3047,7 @@ flash_ok_885:
                outb((inb(tmport) & 0xef), tmport);
                tmport++;
                outb((inb(tmport) | 0x20), tmport);
-               if (atp_dev.chip_ver == 4)
+               if (atpdev->chip_ver == 4)
                        shpnt->max_id = 16;
                else            
                        shpnt->max_id = 8;
@@ -3093,6 +3096,12 @@ unregister:
        printk("atp870u_prob:unregister\n");
        scsi_host_put(shpnt);
        return -1;              
+err_eio:
+       kfree(atpdev);
+       return -EIO;
+err_nomem:
+       kfree(atpdev);
+       return -ENOMEM;
 }
 
 /* The abort command does not leave the device in a clean state where
index 3867ac2de4c22666790c18c91fba03b3d76d6eb7..329a8f297b318fa1c76594e90e2dcf6e6d746f54 100644 (file)
@@ -172,7 +172,7 @@ int __init blz1230_esp_detect(struct scsi_host_template *tpnt)
 
                esp->irq = IRQ_AMIGA_PORTS;
                esp->slot = board+REAL_BLZ1230_ESP_ADDR;
-               if (request_irq(IRQ_AMIGA_PORTS, esp_intr, SA_SHIRQ,
+               if (request_irq(IRQ_AMIGA_PORTS, esp_intr, IRQF_SHARED,
                                 "Blizzard 1230 SCSI IV", esp->ehost))
                        goto err_out;
 
index 4ebe69e3275696bf8ae25fd4878f05089c13ec57..b6c137b9735056985820216ce397a9e914f8d08b 100644 (file)
@@ -146,7 +146,7 @@ int __init blz2060_esp_detect(struct scsi_host_template *tpnt)
                esp->esp_command_dvma = virt_to_bus((void *)cmd_buffer);
 
                esp->irq = IRQ_AMIGA_PORTS;
-               request_irq(IRQ_AMIGA_PORTS, esp_intr, SA_SHIRQ,
+               request_irq(IRQ_AMIGA_PORTS, esp_intr, IRQF_SHARED,
                            "Blizzard 2060 SCSI", esp->ehost);
 
                /* Figure out our scsi ID on the bus */
index d9abd1645d1550ab7d693e652843fd7acf6a4d42..f6caa43077680b3a87d1621e3006f40883a1eb35 100644 (file)
@@ -7,7 +7,6 @@
 
 #define VERSION "0.25"
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/fs.h>
index d92d5040a9feed7eacd728a00d03e56f5f2abf40..dddd2acce76f0cd11a4151cfd4752834432b1914 100644 (file)
@@ -7,7 +7,6 @@
  * Additions for SPC-3 T10/1416-D Rev 21 22 Sept 2004, D. Gilbert 20041025
  */
 
-#include <linux/config.h>
 #include <linux/blkdev.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
index a4a4fac5c0a11454473f53bf26056e40ef43c8dd..7c7cfb54e8976a9f1070ca412309798d3c2b8214 100644 (file)
@@ -172,7 +172,7 @@ int __init cyber_esp_detect(struct scsi_host_template *tpnt)
                esp->esp_command_dvma = virt_to_bus((void *)cmd_buffer);
 
                esp->irq = IRQ_AMIGA_PORTS;
-               request_irq(IRQ_AMIGA_PORTS, esp_intr, SA_SHIRQ,
+               request_irq(IRQ_AMIGA_PORTS, esp_intr, IRQF_SHARED,
                            "CyberStorm SCSI", esp->ehost);
                /* Figure out our scsi ID on the bus */
                /* The DMA cond flag contains a hardcoded jumper bit
index 3a803d73bc5fa46591c792d59de0edeea7b15de7..d88cb9cf091e4a880b8e5e22daa419a4613326f4 100644 (file)
@@ -153,7 +153,7 @@ int __init cyberII_esp_detect(struct scsi_host_template *tpnt)
                esp->esp_command_dvma = virt_to_bus((void *)cmd_buffer);
 
                esp->irq = IRQ_AMIGA_PORTS;
-               request_irq(IRQ_AMIGA_PORTS, esp_intr, SA_SHIRQ,
+               request_irq(IRQ_AMIGA_PORTS, esp_intr, IRQF_SHARED,
                            "CyberStorm SCSI Mk II", esp->ehost);
 
                /* Figure out our scsi ID on the bus */
index 58b0748045eecbff1712157b1ccd2ee286315597..ff2b1796fa34634ac95b3eee22051743dc706819 100644 (file)
@@ -4562,7 +4562,7 @@ static int __devinit adapter_init(struct AdapterCtlBlk *acb,
        acb->io_port_base = io_port;
        acb->io_port_len = io_port_len;
        
-       if (request_irq(irq, dc395x_interrupt, SA_SHIRQ, DC395X_NAME, acb)) {
+       if (request_irq(irq, dc395x_interrupt, IRQF_SHARED, DC395X_NAME, acb)) {
                /* release the region we just claimed */
                dprintkl(KERN_INFO, "Failed to register IRQ\n");
                goto failed;
index a35ee43a48df78e1b627c63e33e6895035d0fe1a..eb32062f7e683271eb6c79c698dc74cd0fb34dc0 100644 (file)
@@ -202,19 +202,19 @@ static int dec_esp_detect(struct scsi_host_template * tpnt)
 
                esp_initialize(esp);
 
-               if (request_irq(esp->irq, esp_intr, SA_INTERRUPT,
+               if (request_irq(esp->irq, esp_intr, IRQF_DISABLED,
                                "ncr53c94", esp->ehost))
                        goto err_dealloc;
                if (request_irq(dec_interrupt[DEC_IRQ_ASC_MERR],
-                               scsi_dma_merr_int, SA_INTERRUPT,
+                               scsi_dma_merr_int, IRQF_DISABLED,
                                "ncr53c94 error", esp->ehost))
                        goto err_free_irq;
                if (request_irq(dec_interrupt[DEC_IRQ_ASC_ERR],
-                               scsi_dma_err_int, SA_INTERRUPT,
+                               scsi_dma_err_int, IRQF_DISABLED,
                                "ncr53c94 overrun", esp->ehost))
                        goto err_free_irq_merr;
                if (request_irq(dec_interrupt[DEC_IRQ_ASC_DMA],
-                               scsi_dma_int, SA_INTERRUPT,
+                               scsi_dma_int, IRQF_DISABLED,
                                "ncr53c94 dma", esp->ehost))
                        goto err_free_irq_err;
 
@@ -276,7 +276,7 @@ static int dec_esp_detect(struct scsi_host_template * tpnt)
                        esp->dma_mmu_release_scsi_sgl = 0;
                        esp->dma_advance_sg = 0;
 
-                       if (request_irq(esp->irq, esp_intr, SA_INTERRUPT,
+                       if (request_irq(esp->irq, esp_intr, IRQF_DISABLED,
                                         "PMAZ_AA", esp->ehost)) {
                                esp_deallocate(esp);
                                release_tc_card(slot);
index 38e4010eff96e7dcc081f221d7ec534ff5cb7aa7..879a2665767611dc6749df5111f6d3b6341c6ee1 100644 (file)
@@ -94,7 +94,7 @@ static int __devinit dmx3191d_probe_one(struct pci_dev *pdev,
 
        NCR5380_init(shost, FLAG_NO_PSEUDO_DMA | FLAG_DTC3181E);
 
-       if (request_irq(pdev->irq, NCR5380_intr, SA_SHIRQ,
+       if (request_irq(pdev->irq, NCR5380_intr, IRQF_SHARED,
                                DMX3191D_DRIVER_NAME, shost)) {
                /*
                 * Steam powered scsi controllers run without an IRQ anyway
index a9585f5235d92a63b184ffa54c46dfcef6d31d24..d84a281ad944a518987c28cebefddd9d11da7bdb 100644 (file)
@@ -23,7 +23,6 @@
 
 #include <asm/semaphore.h> /* Needed for MUTEX init macros */
 #include <linux/version.h>
-#include <linux/config.h>
 #include <linux/notifier.h>
 #include <asm/atomic.h>
 
index b1b704a42efdb8f24bd6ffb3c81f47d5587dd9da..e1337339cacc2311d77077a3c5cf49b82560a3a1 100644 (file)
@@ -1009,7 +1009,7 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev
                printk(KERN_INFO"     BAR1 %p - size= %x\n",msg_addr_virt,hba_map1_area_size);
        }
 
-       if (request_irq (pDev->irq, adpt_isr, SA_SHIRQ, pHba->name, pHba)) {
+       if (request_irq (pDev->irq, adpt_isr, IRQF_SHARED, pHba->name, pHba)) {
                printk(KERN_ERR"%s: Couldn't register IRQ %d\n", pHba->name, pDev->irq);
                adpt_i2o_delete_hba(pHba);
                return -EINVAL;
index c5108c8c887b901bbf2bfe4763d5504b40e1d85f..0d5713dfa204749bbe0b09f339893217918debe2 100644 (file)
@@ -280,7 +280,7 @@ found:
                /* With interrupts enabled, it will sometimes hang when doing heavy
                 * reads. So better not enable them until I finger it out. */
                if (instance->irq != SCSI_IRQ_NONE)
-                       if (request_irq(instance->irq, dtc_intr, SA_INTERRUPT, "dtc", instance)) {
+                       if (request_irq(instance->irq, dtc_intr, IRQF_DISABLED, "dtc", instance)) {
                                printk(KERN_ERR "scsi%d : IRQ%d not free, interrupts disabled\n", instance->host_no, instance->irq);
                                instance->irq = SCSI_IRQ_NONE;
                        }
index 059eeee4b55412cbb4c0d534308fae807a13ba02..a5ff43b1b2633ba130f2cbd6273210d9f2282001 100644 (file)
  *  the driver sets host->wish_block = 1 for all ISA boards.
  */
 
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/ioport.h>
@@ -1222,7 +1221,7 @@ static int port_detect(unsigned long port_base, unsigned int j,
 
        /* Board detected, allocate its IRQ */
        if (request_irq(irq, do_interrupt_handler,
-                       SA_INTERRUPT | ((subversion == ESA) ? SA_SHIRQ : 0),
+                       IRQF_DISABLED | ((subversion == ESA) ? IRQF_SHARED : 0),
                        driver_name, (void *)&sha[j])) {
                printk("%s: unable to allocate IRQ %u, detaching.\n", name,
                       irq);
index 23beb48c79c58e62ddbda9498237e62c1aad6124..771b01984cbc9c1127240f15541344df96a619a9 100644 (file)
@@ -46,7 +46,6 @@
  *  last change: 2002/11/02               OS: Linux 2.5.45  *
  ************************************************************/
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -732,7 +731,7 @@ static int register_pio_HBA(long base, struct get_conf *gc)
                return 0;
 
        if (!reg_IRQ[gc->IRQ]) {        /* Interrupt already registered ? */
-               if (!request_irq(gc->IRQ, do_eata_pio_int_handler, SA_INTERRUPT, "EATA-PIO", sh)) {
+               if (!request_irq(gc->IRQ, do_eata_pio_int_handler, IRQF_DISABLED, "EATA-PIO", sh)) {
                        reg_IRQ[gc->IRQ]++;
                        if (!gc->IRQ_TR)
                                reg_IRQL[gc->IRQ] = 1;  /* IRQ is edge triggered */
@@ -966,7 +965,7 @@ static int eata_pio_detect(struct scsi_host_template *tpnt)
 
        for (i = 0; i <= MAXIRQ; i++)
                if (reg_IRQ[i])
-                       request_irq(i, do_eata_pio_int_handler, SA_INTERRUPT, "EATA-PIO", NULL);
+                       request_irq(i, do_eata_pio_int_handler, IRQF_DISABLED, "EATA-PIO", NULL);
 
        HBA_ptr = first_HBA;
 
index ddb512463b457f64041854c28d2e51b58e0e9fbf..10573c24a50bc02a514770d6b09272efdd73e30a 100644 (file)
@@ -12,7 +12,6 @@
  * 3) Add tagged queueing.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
 #include <linux/types.h>
@@ -779,7 +778,7 @@ static int __init esp_register_irq(struct esp *esp)
         * sanely maintain.
         */
        if (request_irq(esp->ehost->irq, esp_intr,
-                       SA_SHIRQ, "ESP SCSI", esp)) {
+                       IRQF_SHARED, "ESP SCSI", esp)) {
                printk("esp%d: Cannot acquire irq line\n",
                       esp->esp_id);
                return -1;
index 8ae9c406a83b4d1727756af596feec9408f8a11f..2a1c5c22b9e0a9baa2f6ccf8e49e127576a38ecf 100644 (file)
@@ -210,7 +210,7 @@ int __init fastlane_esp_detect(struct scsi_host_template *tpnt)
 
                esp->irq = IRQ_AMIGA_PORTS;
                esp->slot = board+FASTLANE_ESP_ADDR;
-               if (request_irq(IRQ_AMIGA_PORTS, esp_intr, SA_SHIRQ,
+               if (request_irq(IRQ_AMIGA_PORTS, esp_intr, IRQF_SHARED,
                                "Fastlane SCSI", esp->ehost)) {
                        printk(KERN_WARNING "Fastlane: Could not get IRQ%d, aborting.\n", IRQ_AMIGA_PORTS);
                        goto err_unmap;
index 03416548f20cfc70deb7fcac76faf2710a8fa319..7f891023aa15c9857e21f7bdb59610f7305e4d58 100644 (file)
@@ -13,7 +13,6 @@
 #include <linux/proc_fs.h>
 #include <linux/stat.h>
 #include <linux/init.h>
-#include <linux/config.h>
 #ifdef CONFIG_KMOD
 #include <linux/kmod.h>
 #endif
index 70a1606bd580033eeeaab4923d279a6eed168622..dde3edf35c03667ed2762119dca8bcb9344327a7 100644 (file)
@@ -400,7 +400,7 @@ static int fd_mcs_detect(struct scsi_host_template * tpnt)
                                mca_set_adapter_name(slot - 1, fd_mcs_adapters[loop].name);
 
                                /* check irq/region */
-                               if (request_irq(irq, fd_mcs_intr, SA_SHIRQ, "fd_mcs", hosts)) {
+                               if (request_irq(irq, fd_mcs_intr, IRQF_SHARED, "fd_mcs", hosts)) {
                                        printk(KERN_ERR "fd_mcs: interrupt is not available, skipping...\n");
                                        continue;
                                }
index e16013f0ad6ee6570833ee1df7f5bcb82aa2e08a..b0694dcce246e435c3936f3a7a0b37509f39effb 100644 (file)
 
  **************************************************************************/
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
@@ -950,7 +949,7 @@ struct Scsi_Host *__fdomain_16x0_detect(struct scsi_host_template *tpnt )
       /* Register the IRQ with the kernel */
 
       retcode = request_irq( interrupt_level,
-                            do_fdomain_16x0_intr, pdev?SA_SHIRQ:0, "fdomain", shpnt);
+                            do_fdomain_16x0_intr, pdev?IRQF_SHARED:0, "fdomain", shpnt);
 
       if (retcode < 0) {
         if (retcode == -EINVAL) {
index 5f313c93b7a943e3809d7a6de2d6cdbad859f875..67f1100f310361708647f4c28952895a608dc82f 100644 (file)
@@ -91,7 +91,6 @@
 #define AUTOPROBE_IRQ
 #define AUTOSENSE
 
-#include <linux/config.h>
 
 #ifdef CONFIG_SCSI_GENERIC_NCR53C400
 #define NCR53C400_PSEUDO_DMA 1
@@ -462,7 +461,7 @@ int __init generic_NCR5380_detect(struct scsi_host_template * tpnt)
                        instance->irq = NCR5380_probe_irq(instance, 0xffff);
 
                if (instance->irq != SCSI_IRQ_NONE)
-                       if (request_irq(instance->irq, generic_NCR5380_intr, SA_INTERRUPT, "NCR5380", instance)) {
+                       if (request_irq(instance->irq, generic_NCR5380_intr, IRQF_DISABLED, "NCR5380", instance)) {
                                printk(KERN_WARNING "scsi%d : IRQ%d not free, interrupts disabled\n", instance->host_no, instance->irq);
                                instance->irq = SCSI_IRQ_NONE;
                        }
index d60a89cb8052b2f20f12d77b583a82429b73b603..df0b3f69ef635ae6d850269f32c36e0fadff6595 100644 (file)
@@ -32,7 +32,6 @@
 #ifndef GENERIC_NCR5380_H
 #define GENERIC_NCR5380_H
 
-#include <linux/config.h>
 
 #define GENERIC_NCR5380_PUBLIC_RELEASE 1
 
index 76071a15830646a8f34be9b219984ec53faa27ec..43afd476e606adad053fb3a1ff8d94dccb5b1cb8 100644 (file)
@@ -4350,7 +4350,7 @@ static int __init gdth_detect(Scsi_Host_Template *shtp)
                 printk("Configuring GDT-ISA HA at BIOS 0x%05X IRQ %u DRQ %u\n",
                        isa_bios,ha->irq,ha->drq);
 
-                if (request_irq(ha->irq,gdth_interrupt,SA_INTERRUPT,"gdth",ha)) {
+                if (request_irq(ha->irq,gdth_interrupt,IRQF_DISABLED,"gdth",ha)) {
                     printk("GDT-ISA: Unable to allocate IRQ\n");
                     scsi_unregister(shp);
                     continue;
@@ -4476,7 +4476,7 @@ static int __init gdth_detect(Scsi_Host_Template *shtp)
                 printk("Configuring GDT-EISA HA at Slot %d IRQ %u\n",
                        eisa_slot>>12,ha->irq);
 
-                if (request_irq(ha->irq,gdth_interrupt,SA_INTERRUPT,"gdth",ha)) {
+                if (request_irq(ha->irq,gdth_interrupt,IRQF_DISABLED,"gdth",ha)) {
                     printk("GDT-EISA: Unable to allocate IRQ\n");
                     scsi_unregister(shp);
                     continue;
@@ -4603,7 +4603,7 @@ static int __init gdth_detect(Scsi_Host_Template *shtp)
                pcistr[ctr].bus,PCI_SLOT(pcistr[ctr].device_fn),ha->irq);
 
         if (request_irq(ha->irq, gdth_interrupt,
-                        SA_INTERRUPT|SA_SHIRQ, "gdth", ha))
+                        IRQF_DISABLED|IRQF_SHARED, "gdth", ha))
         {
             printk("GDT-PCI: Unable to allocate IRQ\n");
             scsi_unregister(shp);
index 5b154498056d5cda154666a14d9e77b6b1cafd9f..a0d831b1bada75a2b9650d8c1c592d6e0383e568 100644 (file)
@@ -328,7 +328,7 @@ int __init gvp11_detect(struct scsi_host_template *tpnt)
                     (epc & GVP_SCSICLKMASK) ? WD33C93_FS_8_10
                                             : WD33C93_FS_12_15);
 
-       request_irq(IRQ_AMIGA_PORTS, gvp11_intr, SA_SHIRQ, "GVP11 SCSI",
+       request_irq(IRQ_AMIGA_PORTS, gvp11_intr, IRQF_SHARED, "GVP11 SCSI",
                    instance);
        DMA(instance)->CNTR = GVP11_DMAC_INT_ENABLE;
        num_gvp11++;
index f77808329e7cb8937913bb725ef4d0b402e8d9c0..ab2f8b26790857e2388564aaa58688df5598c70c 100644 (file)
@@ -1304,7 +1304,7 @@ static int __devinit hptiop_probe(struct pci_dev *pcidev,
 
        pci_set_drvdata(pcidev, host);
 
-       if (request_irq(pcidev->irq, hptiop_intr, SA_SHIRQ,
+       if (request_irq(pcidev->irq, hptiop_intr, IRQF_SHARED,
                                        driver_name, hba)) {
                printk(KERN_ERR "scsi%d: request irq %d failed\n",
                                        hba->host->host_no, pcidev->irq);
index 497f6642b2dc55da4ba6c71ba23b9404d49e315e..2be1dc5d852ad59c0bb864831503e9849497d5bc 100644 (file)
@@ -17,7 +17,6 @@
  
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
@@ -1511,7 +1510,7 @@ int ibmmca_detect(struct scsi_host_template * scsi_template)
 #endif
 
        /* get interrupt request level */
-       if (request_irq(IM_IRQ, interrupt_handler, SA_SHIRQ, "ibmmcascsi", hosts)) {
+       if (request_irq(IM_IRQ, interrupt_handler, IRQF_SHARED, "ibmmcascsi", hosts)) {
                printk(KERN_ERR "IBM MCA SCSI: Unable to get shared IRQ %d.\n", IM_IRQ);
                return 0;
        } else
@@ -1636,7 +1635,7 @@ int ibmmca_detect(struct scsi_host_template * scsi_template)
                                /* IRQ11 is used by SCSI-2 F/W Adapter/A */
                                printk(KERN_DEBUG "IBM MCA SCSI: SCSI-2 F/W adapter needs IRQ 11.\n");
                                /* get interrupt request level */
-                               if (request_irq(IM_IRQ_FW, interrupt_handler, SA_SHIRQ, "ibmmcascsi", hosts)) {
+                               if (request_irq(IM_IRQ_FW, interrupt_handler, IRQF_SHARED, "ibmmcascsi", hosts)) {
                                        printk(KERN_ERR "IBM MCA SCSI: Unable to get shared IRQ %d.\n", IM_IRQ_FW);
                                } else
                                        IRQ11_registered++;
@@ -1697,7 +1696,7 @@ int ibmmca_detect(struct scsi_host_template * scsi_template)
                                /* IRQ11 is used by SCSI-2 F/W Adapter/A */
                                printk(KERN_DEBUG  "IBM MCA SCSI: SCSI-2 F/W adapter needs IRQ 11.\n");
                                /* get interrupt request level */
-                               if (request_irq(IM_IRQ_FW, interrupt_handler, SA_SHIRQ, "ibmmcascsi", hosts))
+                               if (request_irq(IM_IRQ_FW, interrupt_handler, IRQF_SHARED, "ibmmcascsi", hosts))
                                        printk(KERN_ERR "IBM MCA SCSI: Unable to get shared IRQ %d.\n", IM_IRQ_FW);
                                else
                                        IRQ11_registered++;
index 944fc1203ebda836d96581757bd30b04dd507e2c..669ea4fff166096496f7f998cfb83448f80be985 100644 (file)
@@ -535,6 +535,7 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct,
                                   struct ibmvscsi_host_data *hostdata)
 {
        u64 *crq_as_u64 = (u64 *) &evt_struct->crq;
+       int request_status;
        int rc;
 
        /* If we have exhausted our request limit, just fail this request.
@@ -542,9 +543,18 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct,
         * (such as task management requests) that the mid layer may think we
         * can handle more requests (can_queue) when we actually can't
         */
-       if ((evt_struct->crq.format == VIOSRP_SRP_FORMAT) &&
-           (atomic_dec_if_positive(&hostdata->request_limit) < 0))
-               goto send_error;
+       if (evt_struct->crq.format == VIOSRP_SRP_FORMAT) {
+               request_status =
+                       atomic_dec_if_positive(&hostdata->request_limit);
+               /* If request limit was -1 when we started, it is now even
+                * less than that
+                */
+               if (request_status < -1)
+                       goto send_error;
+               /* Otherwise, if we have run out of requests */
+               else if (request_status < 0)
+                       goto send_busy;
+       }
 
        /* Copy the IU into the transfer area */
        *evt_struct->xfer_iu = evt_struct->iu;
@@ -567,11 +577,23 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct,
 
        return 0;
 
- send_error:
+ send_busy:
        unmap_cmd_data(&evt_struct->iu.srp.cmd, evt_struct, hostdata->dev);
 
        free_event_struct(&hostdata->pool, evt_struct);
        return SCSI_MLQUEUE_HOST_BUSY;
+
+ send_error:
+       unmap_cmd_data(&evt_struct->iu.srp.cmd, evt_struct, hostdata->dev);
+
+       if (evt_struct->cmnd != NULL) {
+               evt_struct->cmnd->result = DID_ERROR << 16;
+               evt_struct->cmnd_done(evt_struct->cmnd);
+       } else if (evt_struct->done)
+               evt_struct->done(evt_struct);
+
+       free_event_struct(&hostdata->pool, evt_struct);
+       return 0;
 }
 
 /**
@@ -1184,27 +1206,37 @@ void ibmvscsi_handle_crq(struct viosrp_crq *crq,
                return;
        case 0xFF:      /* Hypervisor telling us the connection is closed */
                scsi_block_requests(hostdata->host);
+               atomic_set(&hostdata->request_limit, 0);
                if (crq->format == 0x06) {
                        /* We need to re-setup the interpartition connection */
                        printk(KERN_INFO
                               "ibmvscsi: Re-enabling adapter!\n");
-                       atomic_set(&hostdata->request_limit, -1);
                        purge_requests(hostdata, DID_REQUEUE);
-                       if (ibmvscsi_reenable_crq_queue(&hostdata->queue,
-                                                       hostdata) == 0)
-                               if (ibmvscsi_send_crq(hostdata,
-                                                     0xC001000000000000LL, 0))
+                       if ((ibmvscsi_reenable_crq_queue(&hostdata->queue,
+                                                       hostdata) == 0) ||
+                           (ibmvscsi_send_crq(hostdata,
+                                              0xC001000000000000LL, 0))) {
+                                       atomic_set(&hostdata->request_limit,
+                                                  -1);
                                        printk(KERN_ERR
-                                              "ibmvscsi: transmit error after"
+                                              "ibmvscsi: error after"
                                               " enable\n");
+                       }
                } else {
                        printk(KERN_INFO
                               "ibmvscsi: Virtual adapter failed rc %d!\n",
                               crq->format);
 
-                       atomic_set(&hostdata->request_limit, -1);
                        purge_requests(hostdata, DID_ERROR);
-                       ibmvscsi_reset_crq_queue(&hostdata->queue, hostdata);
+                       if ((ibmvscsi_reset_crq_queue(&hostdata->queue,
+                                                       hostdata)) ||
+                           (ibmvscsi_send_crq(hostdata,
+                                              0xC001000000000000LL, 0))) {
+                                       atomic_set(&hostdata->request_limit,
+                                                  -1);
+                                       printk(KERN_ERR
+                                              "ibmvscsi: error after reset\n");
+                       }
                }
                scsi_unblock_requests(hostdata->host);
                return;
@@ -1467,6 +1499,7 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id)
        struct Scsi_Host *host;
        struct device *dev = &vdev->dev;
        unsigned long wait_switch = 0;
+       int rc;
 
        vdev->dev.driver_data = NULL;
 
@@ -1484,8 +1517,8 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id)
        atomic_set(&hostdata->request_limit, -1);
        hostdata->host->max_sectors = 32 * 8; /* default max I/O 32 pages */
 
-       if (ibmvscsi_init_crq_queue(&hostdata->queue, hostdata,
-                                   max_requests) != 0) {
+       rc = ibmvscsi_init_crq_queue(&hostdata->queue, hostdata, max_requests);
+       if (rc != 0 && rc != H_RESOURCE) {
                printk(KERN_ERR "ibmvscsi: couldn't initialize crq\n");
                goto init_crq_failed;
        }
@@ -1505,7 +1538,8 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id)
         * to fail if the other end is not acive.  In that case we don't
         * want to scan
         */
-       if (ibmvscsi_send_crq(hostdata, 0xC001000000000000LL, 0) == 0) {
+       if (ibmvscsi_send_crq(hostdata, 0xC001000000000000LL, 0) == 0
+           || rc == H_RESOURCE) {
                /*
                 * Wait around max init_timeout secs for the adapter to finish
                 * initializing. When we are done initializing, we will have a
index 1a9992bdfef85ef944886e4a3f9fb334f34ed64f..242b8873b33363c26692db97cc36218d5aed378e 100644 (file)
@@ -208,6 +208,7 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue,
                            int max_requests)
 {
        int rc;
+       int retrc;
        struct vio_dev *vdev = to_vio_dev(hostdata->dev);
 
        queue->msgs = (struct viosrp_crq *)get_zeroed_page(GFP_KERNEL);
@@ -226,7 +227,7 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue,
        gather_partition_info();
        set_adapter_info(hostdata);
 
-       rc = plpar_hcall_norets(H_REG_CRQ,
+       retrc = rc = plpar_hcall_norets(H_REG_CRQ,
                                vdev->unit_address,
                                queue->msg_token, PAGE_SIZE);
        if (rc == H_RESOURCE)
@@ -263,7 +264,7 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue,
        tasklet_init(&hostdata->srp_task, (void *)ibmvscsi_task,
                     (unsigned long)hostdata);
 
-       return 0;
+       return retrc;
 
       req_irq_failed:
        do {
index 988e6f7af01a28d4a5bf9fc67e3b2428696279ea..f7b5d7372d2638abb7c681210459c0c5d6a11263 100644 (file)
@@ -34,7 +34,6 @@
 #define IDESCSI_VERSION "0.92"
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
index 681bd18493f3c1afd29825330bcf7caa06f1b5cd..2d95ac9c32c1576e1a6ea01c562fac839330dac6 100644 (file)
@@ -8,7 +8,6 @@
  *              future expansion to five letters.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
index 883bc92b4d9a41159ad1459797889210a67478dd..59a4097f1254127de677d042619b766d1199b0a3 100644 (file)
@@ -2015,7 +2015,7 @@ static int __init in2000_detect(struct scsi_host_template * tpnt)
                write1_io(0, IO_FIFO_READ);     /* start fifo out in read mode */
                write1_io(0, IO_INTR_MASK);     /* allow all ints */
                x = int_tab[(switches & (SW_INT0 | SW_INT1)) >> SW_INT_SHIFT];
-               if (request_irq(x, in2000_intr, SA_INTERRUPT, "in2000", instance)) {
+               if (request_irq(x, in2000_intr, IRQF_DISABLED, "in2000", instance)) {
                        printk("in2000_detect: Unable to allocate IRQ.\n");
                        detect_count--;
                        continue;
index 913ba95f85bdf297551dd8985a8480e5732ac1de..9e10dac61cfd2857dbd3560320f737694e9cafe8 100644 (file)
 #include <linux/blkdev.h>
 #include <linux/spinlock.h>
 #include <linux/stat.h>
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/proc_fs.h>
 #include <linux/string.h>
@@ -2868,7 +2867,7 @@ static int i91u_detect(struct scsi_host_template * tpnt)
                hreg->sg_tablesize = TOTAL_SG_ENTRY;    /* Maximun support is 32 */
 
                /* Initial tulip chip           */
-               ok = request_irq(pHCB->HCS_Intr, i91u_intr, SA_INTERRUPT | SA_SHIRQ, "i91u", hreg);
+               ok = request_irq(pHCB->HCS_Intr, i91u_intr, IRQF_DISABLED | IRQF_SHARED, "i91u", hreg);
                if (ok < 0) {
                        printk(KERN_WARNING "i91u: unable to request IRQ %d\n\n", pHCB->HCS_Intr);
                        return 0;
index 3efb1184fc39ea66230eea7bd5c08530dc31f9d2..acb67a4af2cce0ad5bab6b4262580176bd539fb2 100644 (file)
@@ -54,7 +54,6 @@
  **************************************************************************/
 
 
-#include <linux/config.h>
 #include <linux/types.h>
 
 #define ULONG   unsigned long
@@ -193,13 +192,13 @@ typedef struct {
 #define TSC_SEL_ATN_DIRECT_OUT  0x15   /* Select With ATN Sequence     */
 #define TSC_SEL_ATN3_DIRECT_IN  0xB5   /* Select With ATN3 Sequence    */
 #define TSC_SEL_ATN3_DIRECT_OUT 0x35   /* Select With ATN3 Sequence    */
-#define TSC_XF_DMA_OUT_DIRECT   0x06   /* DMA Xfer Infomation out      */
-#define TSC_XF_DMA_IN_DIRECT    0x86   /* DMA Xfer Infomation in       */
+#define TSC_XF_DMA_OUT_DIRECT   0x06   /* DMA Xfer Information out      */
+#define TSC_XF_DMA_IN_DIRECT    0x86   /* DMA Xfer Information in       */
 
-#define TSC_XF_DMA_OUT  0x43   /* DMA Xfer Infomation out              */
-#define TSC_XF_DMA_IN   0xC3   /* DMA Xfer Infomation in               */
-#define TSC_XF_FIFO_OUT 0x03   /* FIFO Xfer Infomation out             */
-#define TSC_XF_FIFO_IN  0x83   /* FIFO Xfer Infomation in              */
+#define TSC_XF_DMA_OUT  0x43   /* DMA Xfer Information out              */
+#define TSC_XF_DMA_IN   0xC3   /* DMA Xfer Information in               */
+#define TSC_XF_FIFO_OUT 0x03   /* FIFO Xfer Information out             */
+#define TSC_XF_FIFO_IN  0x83   /* FIFO Xfer Information in              */
 
 #define TSC_MSG_ACCEPT  0x0F   /* Message Accept                       */
 
index 96b65b307dd05e1854fc8f533ffab181eea9f2a2..01080b3acf5e7a7f0d97cc6a409f72cb15aaa236 100644 (file)
@@ -54,7 +54,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/fs.h>
 #include <linux/init.h>
 #include <linux/types.h>
@@ -6429,7 +6428,7 @@ static int __devinit ipr_probe_ioa(struct pci_dev *pdev,
                ioa_cfg->needs_hard_reset = 1;
 
        ipr_mask_and_clear_interrupts(ioa_cfg, ~IPR_PCII_IOA_TRANS_TO_OPER);
-       rc = request_irq(pdev->irq, ipr_isr, SA_SHIRQ, IPR_NAME, ioa_cfg);
+       rc = request_irq(pdev->irq, ipr_isr, IRQF_SHARED, IPR_NAME, ioa_cfg);
 
        if (rc) {
                dev_err(&pdev->dev, "Couldn't register IRQ %d! rc=%d\n",
index 78f2ff736c3eccfb2b9042a9229e040c72dd3f9d..3c639286ec1edeb7496e5d11aa47422da0a6c4a0 100644 (file)
 #include <linux/module.h>
 
 #include <linux/stat.h>
-#include <linux/config.h>
 
 #include <linux/spinlock.h>
 #include <linux/init.h>
@@ -7008,7 +7007,7 @@ ips_register_scsi(int index)
        memcpy(ha, oldha, sizeof (ips_ha_t));
        free_irq(oldha->irq, oldha);
        /* Install the interrupt handler with the new ha */
-       if (request_irq(ha->irq, do_ipsintr, SA_SHIRQ, ips_name, ha)) {
+       if (request_irq(ha->irq, do_ipsintr, IRQF_SHARED, ips_name, ha)) {
                IPS_PRINTK(KERN_WARNING, ha->pcidev,
                           "Unable to install interrupt handler\n");
                scsi_host_put(sh);
@@ -7420,7 +7419,7 @@ ips_init_phase2(int index)
        }
 
        /* Install the interrupt handler */
-       if (request_irq(ha->irq, do_ipsintr, SA_SHIRQ, ips_name, ha)) {
+       if (request_irq(ha->irq, do_ipsintr, IRQF_SHARED, ips_name, ha)) {
                IPS_PRINTK(KERN_WARNING, ha->pcidev,
                           "Unable to install interrupt handler\n");
                return ips_abort_init(ha, index);
index b4743a9ecc80584006678302140e88aeaa4d634f..848fb2aa4ca36ba395cee5911a5ec4b446dc50f5 100644 (file)
@@ -2130,19 +2130,21 @@ iscsi_r2tpool_free(struct iscsi_session *session)
 
 static int
 iscsi_conn_set_param(struct iscsi_cls_conn *cls_conn, enum iscsi_param param,
-                    uint32_t value)
+                    char *buf, int buflen)
 {
        struct iscsi_conn *conn = cls_conn->dd_data;
        struct iscsi_session *session = conn->session;
        struct iscsi_tcp_conn *tcp_conn = conn->dd_data;
+       int value;
 
        switch(param) {
        case ISCSI_PARAM_MAX_RECV_DLENGTH: {
                char *saveptr = tcp_conn->data;
                gfp_t flags = GFP_KERNEL;
 
+               sscanf(buf, "%d", &value);
                if (tcp_conn->data_size >= value) {
-                       conn->max_recv_dlength = value;
+                       iscsi_set_param(cls_conn, param, buf, buflen);
                        break;
                }
 
@@ -2165,15 +2167,12 @@ iscsi_conn_set_param(struct iscsi_cls_conn *cls_conn, enum iscsi_param param,
                else
                        free_pages((unsigned long)saveptr,
                                   get_order(tcp_conn->data_size));
-               conn->max_recv_dlength = value;
+               iscsi_set_param(cls_conn, param, buf, buflen);
                tcp_conn->data_size = value;
-               }
-               break;
-       case ISCSI_PARAM_MAX_XMIT_DLENGTH:
-               conn->max_xmit_dlength =  value;
                break;
+               }
        case ISCSI_PARAM_HDRDGST_EN:
-               conn->hdrdgst_en = value;
+               iscsi_set_param(cls_conn, param, buf, buflen);
                tcp_conn->hdr_size = sizeof(struct iscsi_hdr);
                if (conn->hdrdgst_en) {
                        tcp_conn->hdr_size += sizeof(__u32);
@@ -2197,7 +2196,7 @@ iscsi_conn_set_param(struct iscsi_cls_conn *cls_conn, enum iscsi_param param,
                }
                break;
        case ISCSI_PARAM_DATADGST_EN:
-               conn->datadgst_en = value;
+               iscsi_set_param(cls_conn, param, buf, buflen);
                if (conn->datadgst_en) {
                        if (!tcp_conn->data_tx_tfm)
                                tcp_conn->data_tx_tfm =
@@ -2220,121 +2219,36 @@ iscsi_conn_set_param(struct iscsi_cls_conn *cls_conn, enum iscsi_param param,
                tcp_conn->sendpage = conn->datadgst_en ?
                        sock_no_sendpage : tcp_conn->sock->ops->sendpage;
                break;
-       case ISCSI_PARAM_INITIAL_R2T_EN:
-               session->initial_r2t_en = value;
-               break;
        case ISCSI_PARAM_MAX_R2T:
+               sscanf(buf, "%d", &value);
                if (session->max_r2t == roundup_pow_of_two(value))
                        break;
                iscsi_r2tpool_free(session);
-               session->max_r2t = value;
+               iscsi_set_param(cls_conn, param, buf, buflen);
                if (session->max_r2t & (session->max_r2t - 1))
                        session->max_r2t = roundup_pow_of_two(session->max_r2t);
                if (iscsi_r2tpool_alloc(session))
                        return -ENOMEM;
                break;
-       case ISCSI_PARAM_IMM_DATA_EN:
-               session->imm_data_en = value;
-               break;
-       case ISCSI_PARAM_FIRST_BURST:
-               session->first_burst = value;
-               break;
-       case ISCSI_PARAM_MAX_BURST:
-               session->max_burst = value;
-               break;
-       case ISCSI_PARAM_PDU_INORDER_EN:
-               session->pdu_inorder_en = value;
-               break;
-       case ISCSI_PARAM_DATASEQ_INORDER_EN:
-               session->dataseq_inorder_en = value;
-               break;
-       case ISCSI_PARAM_ERL:
-               session->erl = value;
-               break;
-       case ISCSI_PARAM_IFMARKER_EN:
-               BUG_ON(value);
-               session->ifmarker_en = value;
-               break;
-       case ISCSI_PARAM_OFMARKER_EN:
-               BUG_ON(value);
-               session->ofmarker_en = value;
-               break;
-       case ISCSI_PARAM_EXP_STATSN:
-               conn->exp_statsn = value;
-               break;
-       default:
-               break;
-       }
-
-       return 0;
-}
-
-static int
-iscsi_session_get_param(struct iscsi_cls_session *cls_session,
-                       enum iscsi_param param, uint32_t *value)
-{
-       struct Scsi_Host *shost = iscsi_session_to_shost(cls_session);
-       struct iscsi_session *session = iscsi_hostdata(shost->hostdata);
-
-       switch(param) {
-       case ISCSI_PARAM_INITIAL_R2T_EN:
-               *value = session->initial_r2t_en;
-               break;
-       case ISCSI_PARAM_MAX_R2T:
-               *value = session->max_r2t;
-               break;
-       case ISCSI_PARAM_IMM_DATA_EN:
-               *value = session->imm_data_en;
-               break;
-       case ISCSI_PARAM_FIRST_BURST:
-               *value = session->first_burst;
-               break;
-       case ISCSI_PARAM_MAX_BURST:
-               *value = session->max_burst;
-               break;
-       case ISCSI_PARAM_PDU_INORDER_EN:
-               *value = session->pdu_inorder_en;
-               break;
-       case ISCSI_PARAM_DATASEQ_INORDER_EN:
-               *value = session->dataseq_inorder_en;
-               break;
-       case ISCSI_PARAM_ERL:
-               *value = session->erl;
-               break;
-       case ISCSI_PARAM_IFMARKER_EN:
-               *value = session->ifmarker_en;
-               break;
-       case ISCSI_PARAM_OFMARKER_EN:
-               *value = session->ofmarker_en;
-               break;
        default:
-               return -EINVAL;
+               return iscsi_set_param(cls_conn, param, buf, buflen);
        }
 
        return 0;
 }
 
 static int
-iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn,
-                    enum iscsi_param param, uint32_t *value)
+iscsi_tcp_conn_get_param(struct iscsi_cls_conn *cls_conn,
+                        enum iscsi_param param, char *buf)
 {
        struct iscsi_conn *conn = cls_conn->dd_data;
        struct iscsi_tcp_conn *tcp_conn = conn->dd_data;
        struct inet_sock *inet;
+       struct ipv6_pinfo *np;
+       struct sock *sk;
+       int len;
 
        switch(param) {
-       case ISCSI_PARAM_MAX_RECV_DLENGTH:
-               *value = conn->max_recv_dlength;
-               break;
-       case ISCSI_PARAM_MAX_XMIT_DLENGTH:
-               *value = conn->max_xmit_dlength;
-               break;
-       case ISCSI_PARAM_HDRDGST_EN:
-               *value = conn->hdrdgst_en;
-               break;
-       case ISCSI_PARAM_DATADGST_EN:
-               *value = conn->datadgst_en;
-               break;
        case ISCSI_PARAM_CONN_PORT:
                mutex_lock(&conn->xmitmutex);
                if (!tcp_conn->sock) {
@@ -2343,30 +2257,9 @@ iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn,
                }
 
                inet = inet_sk(tcp_conn->sock->sk);
-               *value = be16_to_cpu(inet->dport);
+               len = sprintf(buf, "%hu\n", be16_to_cpu(inet->dport));
                mutex_unlock(&conn->xmitmutex);
-       case ISCSI_PARAM_EXP_STATSN:
-               *value = conn->exp_statsn;
                break;
-       default:
-               return -EINVAL;
-       }
-
-       return 0;
-}
-
-static int
-iscsi_conn_get_str_param(struct iscsi_cls_conn *cls_conn,
-                        enum iscsi_param param, char *buf)
-{
-       struct iscsi_conn *conn = cls_conn->dd_data;
-       struct iscsi_tcp_conn *tcp_conn = conn->dd_data;
-       struct sock *sk;
-       struct inet_sock *inet;
-       struct ipv6_pinfo *np;
-       int len = 0;
-
-       switch (param) {
        case ISCSI_PARAM_CONN_ADDRESS:
                mutex_lock(&conn->xmitmutex);
                if (!tcp_conn->sock) {
@@ -2388,7 +2281,7 @@ iscsi_conn_get_str_param(struct iscsi_cls_conn *cls_conn,
                mutex_unlock(&conn->xmitmutex);
                break;
        default:
-               return -EINVAL;
+               return iscsi_conn_get_param(cls_conn, param, buf);
        }
 
        return len;
@@ -2501,7 +2394,11 @@ static struct iscsi_transport iscsi_tcp_transport = {
                                  ISCSI_ERL |
                                  ISCSI_CONN_PORT |
                                  ISCSI_CONN_ADDRESS |
-                                 ISCSI_EXP_STATSN,
+                                 ISCSI_EXP_STATSN |
+                                 ISCSI_PERSISTENT_PORT |
+                                 ISCSI_PERSISTENT_ADDRESS |
+                                 ISCSI_TARGET_NAME |
+                                 ISCSI_TPGT,
        .host_template          = &iscsi_sht,
        .conndata_size          = sizeof(struct iscsi_conn),
        .max_conn               = 1,
@@ -2514,8 +2411,7 @@ static struct iscsi_transport iscsi_tcp_transport = {
        .bind_conn              = iscsi_tcp_conn_bind,
        .destroy_conn           = iscsi_tcp_conn_destroy,
        .set_param              = iscsi_conn_set_param,
-       .get_conn_param         = iscsi_conn_get_param,
-       .get_conn_str_param     = iscsi_conn_get_str_param,
+       .get_conn_param         = iscsi_tcp_conn_get_param,
        .get_session_param      = iscsi_session_get_param,
        .start_conn             = iscsi_conn_start,
        .stop_conn              = iscsi_conn_stop,
index fc031c76dade4e39fcedd9083c3d34e4d8fea6a4..3fd8a96f2af397989c80788e65423ad02ed50de3 100644 (file)
@@ -131,7 +131,7 @@ static int jazz_esp_detect(struct scsi_host_template *tpnt)
        esp->esp_command_dvma = vdma_alloc(CPHYSADDR(cmd_buffer), sizeof (cmd_buffer));
        
        esp->irq = JAZZ_SCSI_IRQ;
-       request_irq(JAZZ_SCSI_IRQ, esp_intr, SA_INTERRUPT, "JAZZ SCSI",
+       request_irq(JAZZ_SCSI_IRQ, esp_intr, IRQF_DISABLED, "JAZZ SCSI",
                    esp->ehost);
 
        /*
index eb7bd310cc82d18752aa577865b329c6622e485a..f0871c3ac3d98d279a7d465c487b3b7bd70da65d 100644 (file)
@@ -131,7 +131,7 @@ lasi700_probe(struct parisc_device *dev)
        host->this_id = 7;
        host->base = base;
        host->irq = dev->irq;
-       if(request_irq(dev->irq, NCR_700_intr, SA_SHIRQ, "lasi700", host)) {
+       if(request_irq(dev->irq, NCR_700_intr, IRQF_SHARED, "lasi700", host)) {
                printk(KERN_ERR "lasi700: request_irq failed!\n");
                goto out_put_host;
        }
index 004e1a0d8b711df18570688eb9f861ae087bac76..9ce221f25954426af69ce124bb11a4beaf0feff2 100644 (file)
@@ -32,7 +32,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/libata.h>
@@ -854,7 +853,7 @@ ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int
                return NULL;
 
        probe_ent->irq = pdev->irq;
-       probe_ent->irq_flags = SA_SHIRQ;
+       probe_ent->irq_flags = IRQF_SHARED;
        probe_ent->private_data = port[0]->private_data;
 
        if (ports & ATA_PORT_PRIMARY) {
index d1c1c30d123f36946d74cbd873ddad63d1902ae4..1c960ac1617f00665eea8ea8d87f2e0b18af64b5 100644 (file)
@@ -32,7 +32,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/pci.h>
@@ -1002,7 +1001,7 @@ unsigned ata_exec_internal(struct ata_device *dev,
        struct ata_queued_cmd *qc;
        unsigned int tag, preempted_tag;
        u32 preempted_sactive, preempted_qc_active;
-       DECLARE_COMPLETION(wait);
+       DECLARE_COMPLETION_ONSTACK(wait);
        unsigned long flags;
        unsigned int err_mask;
        int rc;
index 2673a11a9495ef2297ada1591cf65cfcbd94c0a1..7e6e031cc41bf0a09541d55bc6f6bb6f9850178c 100644 (file)
@@ -1287,13 +1287,18 @@ iscsi_session_setup(struct iscsi_transport *iscsit,
        if (scsi_add_host(shost, NULL))
                goto add_host_fail;
 
+       if (!try_module_get(iscsit->owner))
+               goto cls_session_fail;
+
        cls_session = iscsi_create_session(shost, iscsit, 0);
        if (!cls_session)
-               goto cls_session_fail;
+               goto module_put;
        *(unsigned long*)shost->hostdata = (unsigned long)cls_session;
 
        return cls_session;
 
+module_put:
+       module_put(iscsit->owner);
 cls_session_fail:
        scsi_remove_host(shost);
 add_host_fail:
@@ -1325,6 +1330,7 @@ void iscsi_session_teardown(struct iscsi_cls_session *cls_session)
 
        iscsi_destroy_session(cls_session);
        scsi_host_put(shost);
+       module_put(cls_session->transport->owner);
 }
 EXPORT_SYMBOL_GPL(iscsi_session_teardown);
 
@@ -1697,6 +1703,185 @@ int iscsi_conn_bind(struct iscsi_cls_session *cls_session,
 }
 EXPORT_SYMBOL_GPL(iscsi_conn_bind);
 
+
+int iscsi_set_param(struct iscsi_cls_conn *cls_conn,
+                   enum iscsi_param param, char *buf, int buflen)
+{
+       struct iscsi_conn *conn = cls_conn->dd_data;
+       struct iscsi_session *session = conn->session;
+       uint32_t value;
+
+       switch(param) {
+       case ISCSI_PARAM_MAX_RECV_DLENGTH:
+               sscanf(buf, "%d", &conn->max_recv_dlength);
+               break;
+       case ISCSI_PARAM_MAX_XMIT_DLENGTH:
+               sscanf(buf, "%d", &conn->max_xmit_dlength);
+               break;
+       case ISCSI_PARAM_HDRDGST_EN:
+               sscanf(buf, "%d", &conn->hdrdgst_en);
+               break;
+       case ISCSI_PARAM_DATADGST_EN:
+               sscanf(buf, "%d", &conn->datadgst_en);
+               break;
+       case ISCSI_PARAM_INITIAL_R2T_EN:
+               sscanf(buf, "%d", &session->initial_r2t_en);
+               break;
+       case ISCSI_PARAM_MAX_R2T:
+               sscanf(buf, "%d", &session->max_r2t);
+               break;
+       case ISCSI_PARAM_IMM_DATA_EN:
+               sscanf(buf, "%d", &session->imm_data_en);
+               break;
+       case ISCSI_PARAM_FIRST_BURST:
+               sscanf(buf, "%d", &session->first_burst);
+               break;
+       case ISCSI_PARAM_MAX_BURST:
+               sscanf(buf, "%d", &session->max_burst);
+               break;
+       case ISCSI_PARAM_PDU_INORDER_EN:
+               sscanf(buf, "%d", &session->pdu_inorder_en);
+               break;
+       case ISCSI_PARAM_DATASEQ_INORDER_EN:
+               sscanf(buf, "%d", &session->dataseq_inorder_en);
+               break;
+       case ISCSI_PARAM_ERL:
+               sscanf(buf, "%d", &session->erl);
+               break;
+       case ISCSI_PARAM_IFMARKER_EN:
+               sscanf(buf, "%d", &value);
+               BUG_ON(value);
+               break;
+       case ISCSI_PARAM_OFMARKER_EN:
+               sscanf(buf, "%d", &value);
+               BUG_ON(value);
+               break;
+       case ISCSI_PARAM_EXP_STATSN:
+               sscanf(buf, "%u", &conn->exp_statsn);
+               break;
+       case ISCSI_PARAM_TARGET_NAME:
+               /* this should not change between logins */
+               if (session->targetname)
+                       break;
+
+               session->targetname = kstrdup(buf, GFP_KERNEL);
+               if (!session->targetname)
+                       return -ENOMEM;
+               break;
+       case ISCSI_PARAM_TPGT:
+               sscanf(buf, "%d", &session->tpgt);
+               break;
+       case ISCSI_PARAM_PERSISTENT_PORT:
+               sscanf(buf, "%d", &conn->persistent_port);
+               break;
+       case ISCSI_PARAM_PERSISTENT_ADDRESS:
+               /*
+                * this is the address returned in discovery so it should
+                * not change between logins.
+                */
+               if (conn->persistent_address)
+                       break;
+
+               conn->persistent_address = kstrdup(buf, GFP_KERNEL);
+               if (!conn->persistent_address)
+                       return -ENOMEM;
+               break;
+       default:
+               return -ENOSYS;
+       }
+
+       return 0;
+}
+EXPORT_SYMBOL_GPL(iscsi_set_param);
+
+int iscsi_session_get_param(struct iscsi_cls_session *cls_session,
+                           enum iscsi_param param, char *buf)
+{
+       struct Scsi_Host *shost = iscsi_session_to_shost(cls_session);
+       struct iscsi_session *session = iscsi_hostdata(shost->hostdata);
+       int len;
+
+       switch(param) {
+       case ISCSI_PARAM_INITIAL_R2T_EN:
+               len = sprintf(buf, "%d\n", session->initial_r2t_en);
+               break;
+       case ISCSI_PARAM_MAX_R2T:
+               len = sprintf(buf, "%hu\n", session->max_r2t);
+               break;
+       case ISCSI_PARAM_IMM_DATA_EN:
+               len = sprintf(buf, "%d\n", session->imm_data_en);
+               break;
+       case ISCSI_PARAM_FIRST_BURST:
+               len = sprintf(buf, "%u\n", session->first_burst);
+               break;
+       case ISCSI_PARAM_MAX_BURST:
+               len = sprintf(buf, "%u\n", session->max_burst);
+               break;
+       case ISCSI_PARAM_PDU_INORDER_EN:
+               len = sprintf(buf, "%d\n", session->pdu_inorder_en);
+               break;
+       case ISCSI_PARAM_DATASEQ_INORDER_EN:
+               len = sprintf(buf, "%d\n", session->dataseq_inorder_en);
+               break;
+       case ISCSI_PARAM_ERL:
+               len = sprintf(buf, "%d\n", session->erl);
+               break;
+       case ISCSI_PARAM_TARGET_NAME:
+               len = sprintf(buf, "%s\n", session->targetname);
+               break;
+       case ISCSI_PARAM_TPGT:
+               len = sprintf(buf, "%d\n", session->tpgt);
+               break;
+       default:
+               return -ENOSYS;
+       }
+
+       return len;
+}
+EXPORT_SYMBOL_GPL(iscsi_session_get_param);
+
+int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn,
+                        enum iscsi_param param, char *buf)
+{
+       struct iscsi_conn *conn = cls_conn->dd_data;
+       int len;
+
+       switch(param) {
+       case ISCSI_PARAM_MAX_RECV_DLENGTH:
+               len = sprintf(buf, "%u\n", conn->max_recv_dlength);
+               break;
+       case ISCSI_PARAM_MAX_XMIT_DLENGTH:
+               len = sprintf(buf, "%u\n", conn->max_xmit_dlength);
+               break;
+       case ISCSI_PARAM_HDRDGST_EN:
+               len = sprintf(buf, "%d\n", conn->hdrdgst_en);
+               break;
+       case ISCSI_PARAM_DATADGST_EN:
+               len = sprintf(buf, "%d\n", conn->datadgst_en);
+               break;
+       case ISCSI_PARAM_IFMARKER_EN:
+               len = sprintf(buf, "%d\n", conn->ifmarker_en);
+               break;
+       case ISCSI_PARAM_OFMARKER_EN:
+               len = sprintf(buf, "%d\n", conn->ofmarker_en);
+               break;
+       case ISCSI_PARAM_EXP_STATSN:
+               len = sprintf(buf, "%u\n", conn->exp_statsn);
+               break;
+       case ISCSI_PARAM_PERSISTENT_PORT:
+               len = sprintf(buf, "%d\n", conn->persistent_port);
+               break;
+       case ISCSI_PARAM_PERSISTENT_ADDRESS:
+               len = sprintf(buf, "%s\n", conn->persistent_address);
+               break;
+       default:
+               return -ENOSYS;
+       }
+
+       return len;
+}
+EXPORT_SYMBOL_GPL(iscsi_conn_get_param);
+
 MODULE_AUTHOR("Mike Christie");
 MODULE_DESCRIPTION("iSCSI library functions");
 MODULE_LICENSE("GPL");
index 087c44539a16a9d7fb0c00adb9790083121bdae5..f81691fcf177f5ddd1bd56da746730fd9beeeda4 100644 (file)
@@ -174,7 +174,6 @@ struct lpfc_hba {
        dma_addr_t slim2p_mapping;
        uint16_t pci_cfg_value;
 
-       struct semaphore hba_can_block;
        int32_t hba_state;
 
 #define LPFC_STATE_UNKNOWN        0    /* HBA state is unknown */
index 283b7d824c34fae6693f5a2e71ae60e1008219b6..4126fd87956f76d7f947322a2ed6d7ef26c6f30b 100644 (file)
@@ -821,7 +821,7 @@ lpfc_issue_els_plogi(struct lpfc_hba * phba, uint32_t did, uint8_t retry)
        pring = &psli->ring[LPFC_ELS_RING];     /* ELS ring */
 
        cmdsize = (sizeof (uint32_t) + sizeof (struct serv_parm));
-       elsiocb = lpfc_prep_els_iocb(phba, 1, cmdsize, retry, 0, did,
+       elsiocb = lpfc_prep_els_iocb(phba, 1, cmdsize, retry, NULL, did,
                                                                ELS_CMD_PLOGI);
        if (!elsiocb)
                return 1;
@@ -2791,8 +2791,8 @@ lpfc_els_rsp_rps_acc(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb)
 
        ndlp = (struct lpfc_nodelist *) pmb->context2;
        xri = (uint16_t) ((unsigned long)(pmb->context1));
-       pmb->context1 = 0;
-       pmb->context2 = 0;
+       pmb->context1 = NULL;
+       pmb->context2 = NULL;
 
        if (mb->mbxStatus) {
                mempool_free( pmb, phba->mbox_mem_pool);
index 908d0f27706f9cc55591e6833161c7a41b7eefd0..81755a3f7c6868ebf2e7a7cc60d457db8cb4f9b2 100644 (file)
@@ -939,12 +939,12 @@ lpfc_get_hba_model_desc(struct lpfc_hba * phba, uint8_t * mdp, uint8_t * descp)
                                        "10-port ", "PCIe"};
                        break;
                default:
-                       m = (typeof(m)){ 0 };
+                       m = (typeof(m)){ NULL };
                        break;
                }
                break;
        default:
-               m = (typeof(m)){ 0 };
+               m = (typeof(m)){ NULL };
                break;
        }
 
@@ -1451,7 +1451,6 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
                goto out_put_host;
 
        host->unique_id = phba->brd_no;
-       init_MUTEX(&phba->hba_can_block);
        INIT_LIST_HEAD(&phba->ctrspbuflist);
        INIT_LIST_HEAD(&phba->rnidrspbuflist);
        INIT_LIST_HEAD(&phba->freebufList);
@@ -1620,7 +1619,7 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
        if (error)
                goto out_remove_host;
 
-       error = request_irq(phba->pcidev->irq, lpfc_intr_handler, SA_SHIRQ,
+       error = request_irq(phba->pcidev->irq, lpfc_intr_handler, IRQF_SHARED,
                                                        LPFC_DRIVER_NAME, phba);
        if (error) {
                lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
index 7dc4c2e6bed2bbc6ba625be3cf60a32bc83ed291..aea1ee472f3d503d263684669bd4dd1374406883 100644 (file)
 #define LPFC_ABORT_WAIT  2
 
 
-static inline void
-lpfc_block_requests(struct lpfc_hba * phba)
-{
-       down(&phba->hba_can_block);
-       scsi_block_requests(phba->host);
-}
-
-static inline void
-lpfc_unblock_requests(struct lpfc_hba * phba)
-{
-       scsi_unblock_requests(phba->host);
-       up(&phba->hba_can_block);
-}
-
 /*
  * This routine allocates a scsi buffer, which contains all the necessary
  * information needed to initiate a SCSI I/O.  The non-DMAable buffer region
@@ -859,7 +845,6 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd)
        unsigned int loop_count = 0;
        int ret = SUCCESS;
 
-       lpfc_block_requests(phba);
        spin_lock_irq(shost->host_lock);
 
        lpfc_cmd = (struct lpfc_scsi_buf *)cmnd->host_scribble;
@@ -945,7 +930,6 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd)
                        cmnd->device->lun, cmnd->serial_number);
 
        spin_unlock_irq(shost->host_lock);
-       lpfc_unblock_requests(phba);
 
        return ret;
 }
@@ -963,7 +947,6 @@ lpfc_reset_lun_handler(struct scsi_cmnd *cmnd)
        int ret = FAILED;
        int cnt, loopcnt;
 
-       lpfc_block_requests(phba);
        spin_lock_irq(shost->host_lock);
        /*
         * If target is not in a MAPPED state, delay the reset until
@@ -1065,7 +1048,6 @@ out_free_scsi_buf:
 
 out:
        spin_unlock_irq(shost->host_lock);
-       lpfc_unblock_requests(phba);
        return ret;
 }
 
@@ -1080,7 +1062,6 @@ lpfc_reset_bus_handler(struct scsi_cmnd *cmnd)
        int cnt, loopcnt;
        struct lpfc_scsi_buf * lpfc_cmd;
 
-       lpfc_block_requests(phba);
        spin_lock_irq(shost->host_lock);
 
        lpfc_cmd = lpfc_get_scsi_buf(phba);
@@ -1163,7 +1144,6 @@ lpfc_reset_bus_handler(struct scsi_cmnd *cmnd)
                        phba->brd_no, ret);
 out:
        spin_unlock_irq(shost->host_lock);
-       lpfc_unblock_requests(phba);
        return ret;
 }
 
index 5d2cefb5e52d242a56fe47a24ebbc3fa4063a6e9..76edbb639d373b9e51d48b16f1bb2c146612eea0 100644 (file)
@@ -4714,7 +4714,7 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 
        if (request_irq(irq, (adapter->flag & BOARD_MEMMAP) ?
                                megaraid_isr_memmapped : megaraid_isr_iomapped,
-                                       SA_SHIRQ, "megaraid", adapter)) {
+                                       IRQF_SHARED, "megaraid", adapter)) {
                printk(KERN_WARNING
                        "megaraid: Couldn't register IRQ %d!\n", irq);
                goto out_free_scb_list;
index b7caf60638e81da07ac3ae6728529df117a6fe05..92715130ac0995f1d2cf15a5eadcf24ef6dff3b1 100644 (file)
@@ -767,7 +767,7 @@ megaraid_init_mbox(adapter_t *adapter)
        //
 
        // request IRQ and register the interrupt service routine
-       if (request_irq(adapter->irq, megaraid_isr, SA_SHIRQ, "megaraid",
+       if (request_irq(adapter->irq, megaraid_isr, IRQF_SHARED, "megaraid",
                adapter)) {
 
                con_log(CL_ANN, (KERN_WARNING
index 0c9516ff636ffdfa0e1bc9f576321137e7d4df72..a8c9627a15c4d59cdf013c4503da34818b3b8f98 100644 (file)
@@ -10,7 +10,7 @@
  *        2 of the License, or (at your option) any later version.
  *
  * FILE                : megaraid_sas.c
- * Version     : v00.00.02.04
+ * Version     : v00.00.03.01
  *
  * Authors:
  *     Sreenivas Bagalkote     <Sreenivas.Bagalkote@lsil.com>
@@ -55,19 +55,25 @@ static struct pci_device_id megasas_pci_table[] = {
 
        {
         PCI_VENDOR_ID_LSI_LOGIC,
-        PCI_DEVICE_ID_LSI_SAS1064R, // xscale IOP
+        PCI_DEVICE_ID_LSI_SAS1064R, /* xscale IOP */
         PCI_ANY_ID,
         PCI_ANY_ID,
         },
        {
         PCI_VENDOR_ID_LSI_LOGIC,
-        PCI_DEVICE_ID_LSI_SAS1078R, // ppc IOP
+        PCI_DEVICE_ID_LSI_SAS1078R, /* ppc IOP */
         PCI_ANY_ID,
         PCI_ANY_ID,
        },
+       {
+        PCI_VENDOR_ID_LSI_LOGIC,
+        PCI_DEVICE_ID_LSI_VERDE_ZCR,   /* xscale IOP, vega */
+        PCI_ANY_ID,
+        PCI_ANY_ID,
+        },
        {
         PCI_VENDOR_ID_DELL,
-        PCI_DEVICE_ID_DELL_PERC5, // xscale IOP
+        PCI_DEVICE_ID_DELL_PERC5, /* xscale IOP */
         PCI_ANY_ID,
         PCI_ANY_ID,
         },
@@ -289,9 +295,14 @@ static struct megasas_instance_template megasas_instance_template_ppc = {
  * @regs:                      MFI register set
  */
 static inline void
-megasas_disable_intr(struct megasas_register_set __iomem * regs)
+megasas_disable_intr(struct megasas_instance *instance)
 {
        u32 mask = 0x1f; 
+       struct megasas_register_set __iomem *regs = instance->reg_set;
+
+       if(instance->pdev->device == PCI_DEVICE_ID_LSI_SAS1078R)
+               mask = 0xffffffff;
+
        writel(mask, &regs->outbound_intr_mask);
 
        /* Dummy readl to force pci flush */
@@ -1260,7 +1271,7 @@ megasas_transition_to_ready(struct megasas_instance* instance)
                        /*
                         * Bring it to READY state; assuming max wait 2 secs
                         */
-                       megasas_disable_intr(instance->reg_set);
+                       megasas_disable_intr(instance);
                        writel(MFI_INIT_READY, &instance->reg_set->inbound_doorbell);
 
                        max_wait = 10;
@@ -1756,6 +1767,11 @@ static int megasas_init_mfi(struct megasas_instance *instance)
 
        init_frame->data_xfer_len = sizeof(struct megasas_init_queue_info);
 
+       /*
+        * disable the intr before firing the init frame to FW
+        */
+       megasas_disable_intr(instance);
+
        /*
         * Issue the init frame in polled mode
         */
@@ -2191,7 +2207,7 @@ megasas_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
        /*
         * Register IRQ
         */
-       if (request_irq(pdev->irq, megasas_isr, SA_SHIRQ, "megasas", instance)) {
+       if (request_irq(pdev->irq, megasas_isr, IRQF_SHARED, "megasas", instance)) {
                printk(KERN_DEBUG "megasas: Failed to register IRQ\n");
                goto fail_irq;
        }
@@ -2234,7 +2250,7 @@ megasas_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
        megasas_mgmt_info.max_index--;
 
        pci_set_drvdata(pdev, NULL);
-       megasas_disable_intr(instance->reg_set);
+       megasas_disable_intr(instance);
        free_irq(instance->pdev->irq, instance);
 
        megasas_release_mfi(instance);
@@ -2364,7 +2380,7 @@ static void megasas_detach_one(struct pci_dev *pdev)
 
        pci_set_drvdata(instance->pdev, NULL);
 
-       megasas_disable_intr(instance->reg_set);
+       megasas_disable_intr(instance);
 
        free_irq(instance->pdev->irq, instance);
 
index 927d6ffef05f14c53367106e15fdbf9e21079c6c..3531a14222a737780f8574eae0e010a71c6fd137 100644 (file)
 /**
  * MegaRAID SAS Driver meta data
  */
-#define MEGASAS_VERSION                                "00.00.02.04"
-#define MEGASAS_RELDATE                                "Feb 03, 2006"
-#define MEGASAS_EXT_VERSION                    "Fri Feb 03 14:31:44 PST 2006"
+#define MEGASAS_VERSION                                "00.00.03.01"
+#define MEGASAS_RELDATE                                "May 14, 2006"
+#define MEGASAS_EXT_VERSION                    "Sun May 14 22:49:52 PDT 2006"
+
+/*
+ * Device IDs
+ */
+#define        PCI_DEVICE_ID_LSI_SAS1078R              0x0060
+#define        PCI_DEVICE_ID_LSI_VERDE_ZCR             0x0413
+
 /*
  * =====================================
  * MegaRAID SAS MFI firmware definitions
@@ -554,7 +561,11 @@ struct megasas_ctrl_info {
 #define MFI_POLL_TIMEOUT_SECS                  10
 
 #define MFI_REPLY_1078_MESSAGE_INTERRUPT       0x80000000
-#define PCI_DEVICE_ID_LSI_SAS1078R             0x00000060
+
+/*
+* register set for both 1068 and 1078 controllers
+* structure extended for 1078 registers
+*/
  
 struct megasas_register_set {
        u32     reserved_0[4];                  /*0000h*/
@@ -1150,10 +1161,10 @@ struct compat_megasas_iocpacket {
        struct compat_iovec sgl[MAX_IOCTL_SGE];
 } __attribute__ ((packed));
 
+#define MEGASAS_IOC_FIRMWARE32 _IOWR('M', 1, struct compat_megasas_iocpacket)
 #endif
 
 #define MEGASAS_IOC_FIRMWARE   _IOWR('M', 1, struct megasas_iocpacket)
-#define MEGASAS_IOC_FIRMWARE32 _IOWR('M', 1, struct compat_megasas_iocpacket)
 #define MEGASAS_IOC_GET_AEN    _IOW('M', 3, struct megasas_aen)
 
 struct megasas_mgmt_info {
index f852421002ef7fb44de3f3d6046e01b631416cf5..c88717727be8ed58e9cbf23a2b1c376a2819ac09 100644 (file)
@@ -18,7 +18,6 @@
  * - retry arbitration if lost (unless higher levels do this for us)
  * - power down the chip when no device is detected
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
index 0e4e46a01336530dc4204b1f1a7a8f86b9500896..78818b6684f83b35105502726b5d4f8befb25e2c 100644 (file)
 #ifndef NCR53C8XX_H
 #define NCR53C8XX_H
 
-#include <linux/config.h>
 #include <scsi/scsi_host.h>
 
-#include <linux/config.h>
 
 /*
 **     If you want a driver as small as possible, donnot define the 
index 5c55e152e7189f7ea6dd7ac287cd517bfa3a03cf..bfb4f49e125d28b82a5dea1472641c1d43e45339 100644 (file)
@@ -2866,8 +2866,7 @@ static int nsp32_detect(struct scsi_host_template *sht)
         */
        nsp32_do_bus_reset(data);
 
-       ret = request_irq(host->irq, do_nsp32_isr,
-                         SA_SHIRQ | SA_SAMPLE_RANDOM, "nsp32", data);
+       ret = request_irq(host->irq, do_nsp32_isr, IRQF_SHARED, "nsp32", data);
        if (ret < 0) {
                nsp32_msg(KERN_ERR, "Unable to allocate IRQ for NinjaSCSI32 "
                          "SCSI PCI controller. Interrupt: %d", host->irq);
@@ -2886,12 +2885,19 @@ static int nsp32_detect(struct scsi_host_template *sht)
         }
 
 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,73))
-       scsi_add_host (host, &PCIDEV->dev);
+       ret = scsi_add_host(host, &PCIDEV->dev);
+       if (ret) {
+               nsp32_msg(KERN_ERR, "failed to add scsi host");
+               goto free_region;
+       }
        scsi_scan_host(host);
 #endif
        pci_set_drvdata(PCIDEV, host);
        return DETECT_OK;
 
+ free_region:
+       release_region(host->io_port, host->n_io_port);
+
  free_irq:
        free_irq(host->irq, data);
 
index dee426f8c07b566bd8fdbdf148483b40e4f09e06..dd67a68c5c23961e5617feda7c1686d0ada8227e 100644 (file)
@@ -6,7 +6,6 @@
  * Based on cyber_esp.c
  */
 
-#include <linux/config.h>
 
 #if defined(CONFIG_AMIGA) || defined(CONFIG_APUS)
 #define USE_BOTTOM_HALF
@@ -198,7 +197,7 @@ int oktagon_esp_detect(struct scsi_host_template *tpnt)
                esp->esp_command_dvma = (__u32) cmd_buffer;
 
                esp->irq = IRQ_AMIGA_PORTS;
-               request_irq(IRQ_AMIGA_PORTS, esp_intr, SA_SHIRQ,
+               request_irq(IRQ_AMIGA_PORTS, esp_intr, IRQF_SHARED,
                            "BSC Oktagon SCSI", esp->ehost);
 
                /* Figure out our scsi ID on the bus */
index 08ce8d80d8f59094279e4eefb540c6d3c4a93979..8a7340b02707bb014dcda7c637a7ab30f559fc31 100644 (file)
@@ -23,7 +23,6 @@ int oktag_from_io(long *addr,long *paddr,long len)
  * is moved to/from the IO register.
  */
 
-#include <linux/config.h>
 
 #ifdef CONFIG_APUS
 
index 011d4d6ca9f9780835bdbe67641f7c9bb863356a..1e426f5d0ed8a734357c58897ff7619609b7a046 100644 (file)
@@ -3,7 +3,6 @@
  */
 
 #include <asm/byteorder.h>
-#include <linux/config.h>
 #include <linux/completion.h>
 
 /*     FIXME - rename and use the following two types or delete them!
index 1bf96ed8f935ac86b21ae0a0e21ee556e7d42395..1434209a8ac54a99dc618310d7065490b2de5988 100644 (file)
@@ -454,7 +454,7 @@ int __init pas16_detect(struct scsi_host_template * tpnt)
            instance->irq = NCR5380_probe_irq(instance, PAS16_IRQS);
 
        if (instance->irq != SCSI_IRQ_NONE) 
-           if (request_irq(instance->irq, pas16_intr, SA_INTERRUPT, "pas16", instance)) {
+           if (request_irq(instance->irq, pas16_intr, IRQF_DISABLED, "pas16", instance)) {
                printk("scsi%d : IRQ%d not free, interrupts disabled\n", 
                    instance->host_no, instance->irq);
                instance->irq = SCSI_IRQ_NONE;
index 231f9c311c697d77f1652343d536b6746c825d27..0d4c04e1f3de3f941655ec67a023992e77d46f04 100644 (file)
@@ -1623,7 +1623,7 @@ static int nsp_cs_probe(struct pcmcia_device *link)
        /* Interrupt handler */
        link->irq.Handler        = &nspintr;
        link->irq.Instance       = info;
-       link->irq.Attributes     |= (SA_SHIRQ | SA_SAMPLE_RANDOM);
+       link->irq.Attributes     |= IRQF_SHARED;
 
        /* General socket configuration */
        link->conf.Attributes    = CONF_ENABLE_IRQ;
index 9f59827707f0c7e6bd01d55f1642d4d82007707c..0b65099acb1a64c405bd87f31f36755373e54d34 100644 (file)
@@ -799,7 +799,7 @@ next_entry:
        data = (struct sym53c500_data *)host->hostdata;
 
        if (irq_level > 0) {
-               if (request_irq(irq_level, SYM53C500_intr, SA_SHIRQ, "SYM53C500", host)) {
+               if (request_irq(irq_level, SYM53C500_intr, IRQF_SHARED, "SYM53C500", host)) {
                        printk("SYM53C500: unable to allocate IRQ %d\n", irq_level);
                        goto err_free_scsi;
                }
index 7ebe8e03aa96c392c3a92157755b49538d2d5c5c..d1f38c32aa153e56404ae011edcf9ed8f04e0285 100644 (file)
@@ -690,7 +690,7 @@ static int adma_ata_init_one(struct pci_dev *pdev,
        probe_ent->port_ops     = adma_port_info[board_idx].port_ops;
 
        probe_ent->irq          = pdev->irq;
-       probe_ent->irq_flags    = SA_SHIRQ;
+       probe_ent->irq_flags    = IRQF_SHARED;
        probe_ent->mmio_base    = mmio_base;
        probe_ent->n_ports      = ADMA_PORTS;
 
index 83a671799934465240952a5b1b4d5f8b455dd1e3..7abf64d1bfc9960c051b827b6d3c0377e51041be 100644 (file)
@@ -13,7 +13,6 @@
 #include <linux/proc_fs.h>
 #include <linux/stat.h>
 #include <linux/init.h>
-#include <linux/config.h>
 #ifdef CONFIG_KMOD
 #include <linux/kmod.h>
 #endif
index d58ac5ad509d1963801c4d83d02057f85fff8367..b0eba39f208af27612ed5c86cd45c5cffe5e6205 100644 (file)
@@ -8,7 +8,6 @@
  * 
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
index 680f6063954b2a94a3246266a68bdd830fa1fe96..8953991462d78f3d9600ea6445ed08820e133ec4 100644 (file)
         - Don't walk the entire list in qla1280_putq_t() just to directly
          grab the pointer to the last element afterwards
     Rev  3.23.5 Beta August 9, 2001, Jes Sorensen
-       - Don't use SA_INTERRUPT, it's use is deprecated for this kinda driver
+       - Don't use IRQF_DISABLED, it's use is deprecated for this kinda driver
     Rev  3.23.4 Beta August 8, 2001, Jes Sorensen
        - Set dev->max_sectors to 1024
     Rev  3.23.3 Beta August 6, 2001, Jes Sorensen
 *****************************************************************************/
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/version.h>
@@ -4210,7 +4209,7 @@ qla1280_setup(char *s)
 }
 
 
-static int
+static int __init
 qla1280_get_token(char *str)
 {
        char *sep;
@@ -4370,7 +4369,7 @@ qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
        /* Disable ISP interrupts. */
        qla1280_disable_intrs(ha);
 
-       if (request_irq(pdev->irq, qla1280_intr_handler, SA_SHIRQ,
+       if (request_irq(pdev->irq, qla1280_intr_handler, IRQF_SHARED,
                                "qla1280", ha)) {
                printk("qla1280 : Failed to reserve interrupt %d already "
                       "in use\n", pdev->irq);
index e96d58ded57c3a08e28a7ddc73ecc193f6762107..87f90c4f08e94e07ae7cab8353ce67998a677a41 100644 (file)
@@ -16,15 +16,16 @@ qla2x00_sysfs_read_fw_dump(struct kobject *kobj, char *buf, loff_t off,
 {
        struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj,
            struct device, kobj)));
+       char *rbuf = (char *)ha->fw_dump;
 
        if (ha->fw_dump_reading == 0)
                return 0;
-       if (off > ha->fw_dump_buffer_len)
-               return 0;
-       if (off + count > ha->fw_dump_buffer_len)
-               count = ha->fw_dump_buffer_len - off;
+       if (off > ha->fw_dump_len)
+                return 0;
+       if (off + count > ha->fw_dump_len)
+               count = ha->fw_dump_len - off;
 
-       memcpy(buf, &ha->fw_dump_buffer[off], count);
+       memcpy(buf, &rbuf[off], count);
 
        return (count);
 }
@@ -36,7 +37,6 @@ qla2x00_sysfs_write_fw_dump(struct kobject *kobj, char *buf, loff_t off,
        struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj,
            struct device, kobj)));
        int reading;
-       uint32_t dump_size;
 
        if (off != 0)
                return (0);
@@ -44,46 +44,27 @@ qla2x00_sysfs_write_fw_dump(struct kobject *kobj, char *buf, loff_t off,
        reading = simple_strtol(buf, NULL, 10);
        switch (reading) {
        case 0:
-               if (ha->fw_dump_reading == 1) {
-                       qla_printk(KERN_INFO, ha,
-                           "Firmware dump cleared on (%ld).\n", ha->host_no);
+               if (!ha->fw_dump_reading)
+                       break;
 
-                       vfree(ha->fw_dump_buffer);
-                       ha->fw_dump_buffer = NULL;
-                       ha->fw_dump_reading = 0;
-                       ha->fw_dumped = 0;
-               }
+               qla_printk(KERN_INFO, ha,
+                   "Firmware dump cleared on (%ld).\n", ha->host_no);
+
+               ha->fw_dump_reading = 0;
+               ha->fw_dumped = 0;
                break;
        case 1:
                if (ha->fw_dumped && !ha->fw_dump_reading) {
                        ha->fw_dump_reading = 1;
 
-                       if (IS_QLA24XX(ha) || IS_QLA54XX(ha))
-                               dump_size = FW_DUMP_SIZE_24XX;
-                       else {
-                               dump_size = FW_DUMP_SIZE_1M;
-                               if (ha->fw_memory_size < 0x20000)
-                                       dump_size = FW_DUMP_SIZE_128K;
-                               else if (ha->fw_memory_size < 0x80000)
-                                       dump_size = FW_DUMP_SIZE_512K;
-                       }
-                       ha->fw_dump_buffer = (char *)vmalloc(dump_size);
-                       if (ha->fw_dump_buffer == NULL) {
-                               qla_printk(KERN_WARNING, ha,
-                                   "Unable to allocate memory for firmware "
-                                   "dump buffer (%d).\n", dump_size);
-
-                               ha->fw_dump_reading = 0;
-                               return (count);
-                       }
                        qla_printk(KERN_INFO, ha,
-                           "Firmware dump ready for read on (%ld).\n",
+                           "Raw firmware dump ready for read on (%ld).\n",
                            ha->host_no);
-                       memset(ha->fw_dump_buffer, 0, dump_size);
-                       ha->isp_ops.ascii_fw_dump(ha);
-                       ha->fw_dump_buffer_len = strlen(ha->fw_dump_buffer);
                }
                break;
+       case 2:
+               qla2x00_alloc_fw_dump(ha);
+               break;
        }
        return (count);
 }
@@ -313,9 +294,6 @@ qla2x00_sysfs_read_vpd(struct kobject *kobj, char *buf, loff_t off,
        if (!capable(CAP_SYS_ADMIN) || off != 0)
                return 0;
 
-       if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha))
-               return -ENOTSUPP;
-
        /* Read NVRAM. */
        spin_lock_irqsave(&ha->hardware_lock, flags);
        ha->isp_ops.read_nvram(ha, (uint8_t *)buf, ha->vpd_base, ha->vpd_size);
@@ -335,9 +313,6 @@ qla2x00_sysfs_write_vpd(struct kobject *kobj, char *buf, loff_t off,
        if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->vpd_size)
                return 0;
 
-       if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha))
-               return -ENOTSUPP;
-
        /* Write NVRAM. */
        spin_lock_irqsave(&ha->hardware_lock, flags);
        ha->isp_ops.write_nvram(ha, (uint8_t *)buf, ha->vpd_base, count);
@@ -357,6 +332,53 @@ static struct bin_attribute sysfs_vpd_attr = {
        .write = qla2x00_sysfs_write_vpd,
 };
 
+static ssize_t
+qla2x00_sysfs_read_sfp(struct kobject *kobj, char *buf, loff_t off,
+    size_t count)
+{
+       struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj,
+           struct device, kobj)));
+       uint16_t iter, addr, offset;
+       int rval;
+
+       if (!capable(CAP_SYS_ADMIN) || off != 0 || count != SFP_DEV_SIZE * 2)
+               return 0;
+
+       addr = 0xa0;
+       for (iter = 0, offset = 0; iter < (SFP_DEV_SIZE * 2) / SFP_BLOCK_SIZE;
+           iter++, offset += SFP_BLOCK_SIZE) {
+               if (iter == 4) {
+                       /* Skip to next device address. */
+                       addr = 0xa2;
+                       offset = 0;
+               }
+
+               rval = qla2x00_read_sfp(ha, ha->sfp_data_dma, addr, offset,
+                   SFP_BLOCK_SIZE);
+               if (rval != QLA_SUCCESS) {
+                       qla_printk(KERN_WARNING, ha,
+                           "Unable to read SFP data (%x/%x/%x).\n", rval,
+                           addr, offset);
+                       count = 0;
+                       break;
+               }
+               memcpy(buf, ha->sfp_data, SFP_BLOCK_SIZE);
+               buf += SFP_BLOCK_SIZE;
+       }
+
+       return count;
+}
+
+static struct bin_attribute sysfs_sfp_attr = {
+       .attr = {
+               .name = "sfp",
+               .mode = S_IRUSR | S_IWUSR,
+               .owner = THIS_MODULE,
+       },
+       .size = SFP_DEV_SIZE * 2,
+       .read = qla2x00_sysfs_read_sfp,
+};
+
 void
 qla2x00_alloc_sysfs_attr(scsi_qla_host_t *ha)
 {
@@ -367,7 +389,12 @@ qla2x00_alloc_sysfs_attr(scsi_qla_host_t *ha)
        sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_optrom_attr);
        sysfs_create_bin_file(&host->shost_gendev.kobj,
            &sysfs_optrom_ctl_attr);
-       sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_vpd_attr);
+       if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
+               sysfs_create_bin_file(&host->shost_gendev.kobj,
+                   &sysfs_vpd_attr);
+               sysfs_create_bin_file(&host->shost_gendev.kobj,
+                   &sysfs_sfp_attr);
+       }
 }
 
 void
@@ -380,7 +407,12 @@ qla2x00_free_sysfs_attr(scsi_qla_host_t *ha)
        sysfs_remove_bin_file(&host->shost_gendev.kobj, &sysfs_optrom_attr);
        sysfs_remove_bin_file(&host->shost_gendev.kobj,
            &sysfs_optrom_ctl_attr);
-       sysfs_remove_bin_file(&host->shost_gendev.kobj, &sysfs_vpd_attr);
+       if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
+               sysfs_remove_bin_file(&host->shost_gendev.kobj,
+                   &sysfs_vpd_attr);
+               sysfs_remove_bin_file(&host->shost_gendev.kobj,
+                   &sysfs_sfp_attr);
+       }
 
        if (ha->beacon_blink_led == 1)
                ha->isp_ops.beacon_off(ha);
index 74e54713aa7c2307f0f0200b874c6b5a7a1b891b..f6ed6962bc2b71617b631d422e0221eb8c190488 100644 (file)
@@ -8,7 +8,34 @@
 
 #include <linux/delay.h>
 
-static int qla_uprintf(char **, char *, ...);
+static inline void
+qla2xxx_prep_dump(scsi_qla_host_t *ha, struct qla2xxx_fw_dump *fw_dump)
+{
+       fw_dump->fw_major_version = htonl(ha->fw_major_version);
+       fw_dump->fw_minor_version = htonl(ha->fw_minor_version);
+       fw_dump->fw_subminor_version = htonl(ha->fw_subminor_version);
+       fw_dump->fw_attributes = htonl(ha->fw_attributes);
+
+       fw_dump->vendor = htonl(ha->pdev->vendor);
+       fw_dump->device = htonl(ha->pdev->device);
+       fw_dump->subsystem_vendor = htonl(ha->pdev->subsystem_vendor);
+       fw_dump->subsystem_device = htonl(ha->pdev->subsystem_device);
+}
+
+static inline void *
+qla2xxx_copy_queues(scsi_qla_host_t *ha, void *ptr)
+{
+       /* Request queue. */
+       memcpy(ptr, ha->request_ring, ha->request_q_length *
+           sizeof(request_t));
+
+       /* Response queue. */
+       ptr += ha->request_q_length * sizeof(request_t);
+       memcpy(ptr, ha->response_ring, ha->response_q_length  *
+           sizeof(response_t));
+
+       return ptr + (ha->response_q_length * sizeof(response_t));
+}
 
 /**
  * qla2300_fw_dump() - Dumps binary data from the 2300 firmware.
@@ -49,10 +76,11 @@ qla2300_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
                    "request...\n", ha->fw_dump);
                goto qla2300_fw_dump_failed;
        }
-       fw = ha->fw_dump;
+       fw = &ha->fw_dump->isp.isp23;
+       qla2xxx_prep_dump(ha, ha->fw_dump);
 
        rval = QLA_SUCCESS;
-       fw->hccr = RD_REG_WORD(&reg->hccr);
+       fw->hccr = htons(RD_REG_WORD(&reg->hccr));
 
        /* Pause RISC. */
        WRT_REG_WORD(&reg->hccr, HCCR_PAUSE_RISC);
@@ -73,85 +101,86 @@ qla2300_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
        if (rval == QLA_SUCCESS) {
                dmp_reg = (uint16_t __iomem *)(reg + 0);
                for (cnt = 0; cnt < sizeof(fw->pbiu_reg) / 2; cnt++)
-                       fw->pbiu_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->pbiu_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
 
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x10);
                for (cnt = 0; cnt < sizeof(fw->risc_host_reg) / 2; cnt++)
-                       fw->risc_host_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->risc_host_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
 
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x40);
                for (cnt = 0; cnt < sizeof(fw->mailbox_reg) / 2; cnt++)
-                       fw->mailbox_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->mailbox_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
 
                WRT_REG_WORD(&reg->ctrl_status, 0x40);
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
                for (cnt = 0; cnt < sizeof(fw->resp_dma_reg) / 2; cnt++)
-                       fw->resp_dma_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->resp_dma_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
 
                WRT_REG_WORD(&reg->ctrl_status, 0x50);
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
                for (cnt = 0; cnt < sizeof(fw->dma_reg) / 2; cnt++)
-                       fw->dma_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->dma_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
 
                WRT_REG_WORD(&reg->ctrl_status, 0x00);
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0xA0);
                for (cnt = 0; cnt < sizeof(fw->risc_hdw_reg) / 2; cnt++)
-                       fw->risc_hdw_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->risc_hdw_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
 
                WRT_REG_WORD(&reg->pcr, 0x2000);
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
                for (cnt = 0; cnt < sizeof(fw->risc_gp0_reg) / 2; cnt++)
-                       fw->risc_gp0_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->risc_gp0_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
 
                WRT_REG_WORD(&reg->pcr, 0x2200);
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
                for (cnt = 0; cnt < sizeof(fw->risc_gp1_reg) / 2; cnt++)
-                       fw->risc_gp1_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->risc_gp1_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
 
                WRT_REG_WORD(&reg->pcr, 0x2400);
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
                for (cnt = 0; cnt < sizeof(fw->risc_gp2_reg) / 2; cnt++)
-                       fw->risc_gp2_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->risc_gp2_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
 
                WRT_REG_WORD(&reg->pcr, 0x2600);
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
                for (cnt = 0; cnt < sizeof(fw->risc_gp3_reg) / 2; cnt++)
-                       fw->risc_gp3_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->risc_gp3_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
 
                WRT_REG_WORD(&reg->pcr, 0x2800);
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
                for (cnt = 0; cnt < sizeof(fw->risc_gp4_reg) / 2; cnt++)
-                       fw->risc_gp4_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->risc_gp4_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
 
                WRT_REG_WORD(&reg->pcr, 0x2A00);
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
                for (cnt = 0; cnt < sizeof(fw->risc_gp5_reg) / 2; cnt++)
-                       fw->risc_gp5_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->risc_gp5_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
 
                WRT_REG_WORD(&reg->pcr, 0x2C00);
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
                for (cnt = 0; cnt < sizeof(fw->risc_gp6_reg) / 2; cnt++)
-                       fw->risc_gp6_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->risc_gp6_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
 
                WRT_REG_WORD(&reg->pcr, 0x2E00);
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
                for (cnt = 0; cnt < sizeof(fw->risc_gp7_reg) / 2; cnt++)
-                       fw->risc_gp7_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->risc_gp7_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
 
                WRT_REG_WORD(&reg->ctrl_status, 0x10);
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
                for (cnt = 0; cnt < sizeof(fw->frame_buf_hdw_reg) / 2; cnt++)
-                       fw->frame_buf_hdw_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->frame_buf_hdw_reg[cnt] =
+                           htons(RD_REG_WORD(dmp_reg++));
 
                WRT_REG_WORD(&reg->ctrl_status, 0x20);
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
                for (cnt = 0; cnt < sizeof(fw->fpm_b0_reg) / 2; cnt++)
-                       fw->fpm_b0_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->fpm_b0_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
 
                WRT_REG_WORD(&reg->ctrl_status, 0x30);
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
                for (cnt = 0; cnt < sizeof(fw->fpm_b1_reg) / 2; cnt++)
-                       fw->fpm_b1_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->fpm_b1_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
 
                /* Reset RISC. */
                WRT_REG_WORD(&reg->ctrl_status, CSR_ISP_SOFT_RESET);
@@ -226,7 +255,7 @@ qla2300_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
 
                if (test_and_clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags)) {
                        rval = mb0 & MBS_MASK;
-                       fw->risc_ram[cnt] = mb2;
+                       fw->risc_ram[cnt] = htons(mb2);
                } else {
                        rval = QLA_FUNCTION_FAILED;
                }
@@ -285,7 +314,7 @@ qla2300_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
 
                if (test_and_clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags)) {
                        rval = mb0 & MBS_MASK;
-                       fw->stack_ram[cnt] = mb2;
+                       fw->stack_ram[cnt] = htons(mb2);
                } else {
                        rval = QLA_FUNCTION_FAILED;
                }
@@ -345,12 +374,15 @@ qla2300_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
 
                if (test_and_clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags)) {
                        rval = mb0 & MBS_MASK;
-                       fw->data_ram[cnt] = mb2;
+                       fw->data_ram[cnt] = htons(mb2);
                } else {
                        rval = QLA_FUNCTION_FAILED;
                }
        }
 
+       if (rval == QLA_SUCCESS)
+               qla2xxx_copy_queues(ha, &fw->data_ram[cnt]);
+
        if (rval != QLA_SUCCESS) {
                qla_printk(KERN_WARNING, ha,
                    "Failed to dump firmware (%x)!!!\n", rval);
@@ -368,193 +400,6 @@ qla2300_fw_dump_failed:
                spin_unlock_irqrestore(&ha->hardware_lock, flags);
 }
 
-/**
- * qla2300_ascii_fw_dump() - Converts a binary firmware dump to ASCII.
- * @ha: HA context
- */
-void
-qla2300_ascii_fw_dump(scsi_qla_host_t *ha)
-{
-       uint32_t cnt;
-       char *uiter;
-       char fw_info[30];
-       struct qla2300_fw_dump *fw;
-       uint32_t data_ram_cnt;
-
-       uiter = ha->fw_dump_buffer;
-       fw = ha->fw_dump;
-
-       qla_uprintf(&uiter, "%s Firmware Version %s\n", ha->model_number,
-           ha->isp_ops.fw_version_str(ha, fw_info));
-
-       qla_uprintf(&uiter, "\n[==>BEG]\n");
-
-       qla_uprintf(&uiter, "HCCR Register:\n%04x\n\n", fw->hccr);
-
-       qla_uprintf(&uiter, "PBIU Registers:");
-       for (cnt = 0; cnt < sizeof (fw->pbiu_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->pbiu_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nReqQ-RspQ-Risc2Host Status registers:");
-       for (cnt = 0; cnt < sizeof (fw->risc_host_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->risc_host_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nMailbox Registers:");
-       for (cnt = 0; cnt < sizeof (fw->mailbox_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->mailbox_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nAuto Request Response DMA Registers:");
-       for (cnt = 0; cnt < sizeof (fw->resp_dma_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->resp_dma_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nDMA Registers:");
-       for (cnt = 0; cnt < sizeof (fw->dma_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->dma_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nRISC Hardware Registers:");
-       for (cnt = 0; cnt < sizeof (fw->risc_hdw_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->risc_hdw_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nRISC GP0 Registers:");
-       for (cnt = 0; cnt < sizeof (fw->risc_gp0_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->risc_gp0_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nRISC GP1 Registers:");
-       for (cnt = 0; cnt < sizeof (fw->risc_gp1_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->risc_gp1_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nRISC GP2 Registers:");
-       for (cnt = 0; cnt < sizeof (fw->risc_gp2_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->risc_gp2_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nRISC GP3 Registers:");
-       for (cnt = 0; cnt < sizeof (fw->risc_gp3_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->risc_gp3_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nRISC GP4 Registers:");
-       for (cnt = 0; cnt < sizeof (fw->risc_gp4_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->risc_gp4_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nRISC GP5 Registers:");
-       for (cnt = 0; cnt < sizeof (fw->risc_gp5_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->risc_gp5_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nRISC GP6 Registers:");
-       for (cnt = 0; cnt < sizeof (fw->risc_gp6_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->risc_gp6_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nRISC GP7 Registers:");
-       for (cnt = 0; cnt < sizeof (fw->risc_gp7_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->risc_gp7_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nFrame Buffer Hardware Registers:");
-       for (cnt = 0; cnt < sizeof (fw->frame_buf_hdw_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->frame_buf_hdw_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nFPM B0 Registers:");
-       for (cnt = 0; cnt < sizeof (fw->fpm_b0_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->fpm_b0_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nFPM B1 Registers:");
-       for (cnt = 0; cnt < sizeof (fw->fpm_b1_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->fpm_b1_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nCode RAM Dump:");
-       for (cnt = 0; cnt < sizeof (fw->risc_ram) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n%04x: ", cnt + 0x0800);
-               }
-               qla_uprintf(&uiter, "%04x ", fw->risc_ram[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nStack RAM Dump:");
-       for (cnt = 0; cnt < sizeof (fw->stack_ram) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n%05x: ", cnt + 0x10000);
-               }
-               qla_uprintf(&uiter, "%04x ", fw->stack_ram[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nData RAM Dump:");
-       data_ram_cnt = ha->fw_memory_size - 0x11000 + 1;
-       for (cnt = 0; cnt < data_ram_cnt; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n%05x: ", cnt + 0x11000);
-               }
-               qla_uprintf(&uiter, "%04x ", fw->data_ram[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\n[<==END] ISP Debug Dump.");
-}
-
 /**
  * qla2100_fw_dump() - Dumps binary data from the 2100/2200 firmware.
  * @ha: HA context
@@ -591,10 +436,11 @@ qla2100_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
                    "request...\n", ha->fw_dump);
                goto qla2100_fw_dump_failed;
        }
-       fw = ha->fw_dump;
+       fw = &ha->fw_dump->isp.isp21;
+       qla2xxx_prep_dump(ha, ha->fw_dump);
 
        rval = QLA_SUCCESS;
-       fw->hccr = RD_REG_WORD(&reg->hccr);
+       fw->hccr = htons(RD_REG_WORD(&reg->hccr));
 
        /* Pause RISC. */
        WRT_REG_WORD(&reg->hccr, HCCR_PAUSE_RISC);
@@ -608,79 +454,81 @@ qla2100_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
        if (rval == QLA_SUCCESS) {
                dmp_reg = (uint16_t __iomem *)(reg + 0);
                for (cnt = 0; cnt < sizeof(fw->pbiu_reg) / 2; cnt++)
-                       fw->pbiu_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->pbiu_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
 
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x10);
                for (cnt = 0; cnt < ha->mbx_count; cnt++) {
                        if (cnt == 8) {
-                               dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0xe0);
+                               dmp_reg = (uint16_t __iomem *)
+                                       ((uint8_t __iomem *)reg + 0xe0);
                        }
-                       fw->mailbox_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->mailbox_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
                }
 
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x20);
                for (cnt = 0; cnt < sizeof(fw->dma_reg) / 2; cnt++)
-                       fw->dma_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->dma_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
 
                WRT_REG_WORD(&reg->ctrl_status, 0x00);
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0xA0);
                for (cnt = 0; cnt < sizeof(fw->risc_hdw_reg) / 2; cnt++)
-                       fw->risc_hdw_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->risc_hdw_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
 
                WRT_REG_WORD(&reg->pcr, 0x2000);
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
                for (cnt = 0; cnt < sizeof(fw->risc_gp0_reg) / 2; cnt++)
-                       fw->risc_gp0_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->risc_gp0_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
 
                WRT_REG_WORD(&reg->pcr, 0x2100);
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
                for (cnt = 0; cnt < sizeof(fw->risc_gp1_reg) / 2; cnt++)
-                       fw->risc_gp1_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->risc_gp1_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
 
                WRT_REG_WORD(&reg->pcr, 0x2200);
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
                for (cnt = 0; cnt < sizeof(fw->risc_gp2_reg) / 2; cnt++)
-                       fw->risc_gp2_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->risc_gp2_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
 
                WRT_REG_WORD(&reg->pcr, 0x2300);
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
                for (cnt = 0; cnt < sizeof(fw->risc_gp3_reg) / 2; cnt++)
-                       fw->risc_gp3_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->risc_gp3_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
 
                WRT_REG_WORD(&reg->pcr, 0x2400);
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
                for (cnt = 0; cnt < sizeof(fw->risc_gp4_reg) / 2; cnt++)
-                       fw->risc_gp4_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->risc_gp4_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
 
                WRT_REG_WORD(&reg->pcr, 0x2500);
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
                for (cnt = 0; cnt < sizeof(fw->risc_gp5_reg) / 2; cnt++)
-                       fw->risc_gp5_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->risc_gp5_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
 
                WRT_REG_WORD(&reg->pcr, 0x2600);
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
                for (cnt = 0; cnt < sizeof(fw->risc_gp6_reg) / 2; cnt++)
-                       fw->risc_gp6_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->risc_gp6_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
 
                WRT_REG_WORD(&reg->pcr, 0x2700);
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
                for (cnt = 0; cnt < sizeof(fw->risc_gp7_reg) / 2; cnt++)
-                       fw->risc_gp7_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->risc_gp7_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
 
                WRT_REG_WORD(&reg->ctrl_status, 0x10);
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
                for (cnt = 0; cnt < sizeof(fw->frame_buf_hdw_reg) / 2; cnt++)
-                       fw->frame_buf_hdw_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->frame_buf_hdw_reg[cnt] =
+                           htons(RD_REG_WORD(dmp_reg++));
 
                WRT_REG_WORD(&reg->ctrl_status, 0x20);
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
                for (cnt = 0; cnt < sizeof(fw->fpm_b0_reg) / 2; cnt++)
-                       fw->fpm_b0_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->fpm_b0_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
 
                WRT_REG_WORD(&reg->ctrl_status, 0x30);
                dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
                for (cnt = 0; cnt < sizeof(fw->fpm_b1_reg) / 2; cnt++)
-                       fw->fpm_b1_reg[cnt] = RD_REG_WORD(dmp_reg++);
+                       fw->fpm_b1_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
 
                /* Reset the ISP. */
                WRT_REG_WORD(&reg->ctrl_status, CSR_ISP_SOFT_RESET);
@@ -755,12 +603,15 @@ qla2100_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
 
                if (test_and_clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags)) {
                        rval = mb0 & MBS_MASK;
-                       fw->risc_ram[cnt] = mb2;
+                       fw->risc_ram[cnt] = htons(mb2);
                } else {
                        rval = QLA_FUNCTION_FAILED;
                }
        }
 
+       if (rval == QLA_SUCCESS)
+               qla2xxx_copy_queues(ha, &fw->risc_ram[cnt]);
+
        if (rval != QLA_SUCCESS) {
                qla_printk(KERN_WARNING, ha,
                    "Failed to dump firmware (%x)!!!\n", rval);
@@ -778,179 +629,6 @@ qla2100_fw_dump_failed:
                spin_unlock_irqrestore(&ha->hardware_lock, flags);
 }
 
-/**
- * qla2100_ascii_fw_dump() - Converts a binary firmware dump to ASCII.
- * @ha: HA context
- */
-void
-qla2100_ascii_fw_dump(scsi_qla_host_t *ha)
-{
-       uint32_t cnt;
-       char *uiter;
-       char fw_info[30];
-       struct qla2100_fw_dump *fw;
-
-       uiter = ha->fw_dump_buffer;
-       fw = ha->fw_dump;
-
-       qla_uprintf(&uiter, "%s Firmware Version %s\n", ha->model_number,
-           ha->isp_ops.fw_version_str(ha, fw_info));
-
-       qla_uprintf(&uiter, "\n[==>BEG]\n");
-
-       qla_uprintf(&uiter, "HCCR Register:\n%04x\n\n", fw->hccr);
-
-       qla_uprintf(&uiter, "PBIU Registers:");
-       for (cnt = 0; cnt < sizeof (fw->pbiu_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->pbiu_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nMailbox Registers:");
-       for (cnt = 0; cnt < sizeof (fw->mailbox_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->mailbox_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nDMA Registers:");
-       for (cnt = 0; cnt < sizeof (fw->dma_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->dma_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nRISC Hardware Registers:");
-       for (cnt = 0; cnt < sizeof (fw->risc_hdw_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->risc_hdw_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nRISC GP0 Registers:");
-       for (cnt = 0; cnt < sizeof (fw->risc_gp0_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->risc_gp0_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nRISC GP1 Registers:");
-       for (cnt = 0; cnt < sizeof (fw->risc_gp1_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->risc_gp1_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nRISC GP2 Registers:");
-       for (cnt = 0; cnt < sizeof (fw->risc_gp2_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->risc_gp2_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nRISC GP3 Registers:");
-       for (cnt = 0; cnt < sizeof (fw->risc_gp3_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->risc_gp3_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nRISC GP4 Registers:");
-       for (cnt = 0; cnt < sizeof (fw->risc_gp4_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->risc_gp4_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nRISC GP5 Registers:");
-       for (cnt = 0; cnt < sizeof (fw->risc_gp5_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->risc_gp5_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nRISC GP6 Registers:");
-       for (cnt = 0; cnt < sizeof (fw->risc_gp6_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->risc_gp6_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nRISC GP7 Registers:");
-       for (cnt = 0; cnt < sizeof (fw->risc_gp7_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->risc_gp7_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nFrame Buffer Hardware Registers:");
-       for (cnt = 0; cnt < sizeof (fw->frame_buf_hdw_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->frame_buf_hdw_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nFPM B0 Registers:");
-       for (cnt = 0; cnt < sizeof (fw->fpm_b0_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->fpm_b0_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nFPM B1 Registers:");
-       for (cnt = 0; cnt < sizeof (fw->fpm_b1_reg) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n");
-               }
-               qla_uprintf(&uiter, "%04x ", fw->fpm_b1_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nRISC SRAM:");
-       for (cnt = 0; cnt < sizeof (fw->risc_ram) / 2; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n%04x: ", cnt + 0x1000);
-               }
-               qla_uprintf(&uiter, "%04x ", fw->risc_ram[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\n[<==END] ISP Debug Dump.");
-
-       return;
-}
-
-static int
-qla_uprintf(char **uiter, char *fmt, ...)
-{
-       int     iter, len;
-       char    buf[128];
-       va_list args;
-
-       va_start(args, fmt);
-       len = vsprintf(buf, fmt, args);
-       va_end(args);
-
-       for (iter = 0; iter < len; iter++, *uiter += 1)
-               *uiter[0] = buf[iter];
-
-       return (len);
-}
-
-
 void
 qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
 {
@@ -967,6 +645,7 @@ qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
        unsigned long   flags;
        struct qla24xx_fw_dump *fw;
        uint32_t        ext_mem_cnt;
+       void            *eft;
 
        risc_address = ext_mem_cnt = 0;
        memset(mb, 0, sizeof(mb));
@@ -987,10 +666,11 @@ qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
                    "request...\n", ha->fw_dump);
                goto qla24xx_fw_dump_failed;
        }
-       fw = ha->fw_dump;
+       fw = &ha->fw_dump->isp.isp24;
+       qla2xxx_prep_dump(ha, ha->fw_dump);
 
        rval = QLA_SUCCESS;
-       fw->host_status = RD_REG_DWORD(&reg->host_status);
+       fw->host_status = htonl(RD_REG_DWORD(&reg->host_status));
 
        /* Pause RISC. */
        if ((RD_REG_DWORD(&reg->hccr) & HCCRX_RISC_PAUSE) == 0) {
@@ -1012,7 +692,7 @@ qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
                /* Host interface registers. */
                dmp_reg = (uint32_t __iomem *)(reg + 0);
                for (cnt = 0; cnt < sizeof(fw->host_reg) / 4; cnt++)
-                       fw->host_reg[cnt] = RD_REG_DWORD(dmp_reg++);
+                       fw->host_reg[cnt] = htonl(RD_REG_DWORD(dmp_reg++));
 
                /* Disable interrupts. */
                WRT_REG_DWORD(&reg->ictrl, 0);
@@ -1024,470 +704,471 @@ qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0);
                WRT_REG_DWORD(dmp_reg, 0xB0000000);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xFC);
-               fw->shadow_reg[0] = RD_REG_DWORD(dmp_reg);
+               fw->shadow_reg[0] = htonl(RD_REG_DWORD(dmp_reg));
 
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0);
                WRT_REG_DWORD(dmp_reg, 0xB0100000);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xFC);
-               fw->shadow_reg[1] = RD_REG_DWORD(dmp_reg);
+               fw->shadow_reg[1] = htonl(RD_REG_DWORD(dmp_reg));
 
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0);
                WRT_REG_DWORD(dmp_reg, 0xB0200000);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xFC);
-               fw->shadow_reg[2] = RD_REG_DWORD(dmp_reg);
+               fw->shadow_reg[2] = htonl(RD_REG_DWORD(dmp_reg));
 
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0);
                WRT_REG_DWORD(dmp_reg, 0xB0300000);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xFC);
-               fw->shadow_reg[3] = RD_REG_DWORD(dmp_reg);
+               fw->shadow_reg[3] = htonl(RD_REG_DWORD(dmp_reg));
 
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0);
                WRT_REG_DWORD(dmp_reg, 0xB0400000);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xFC);
-               fw->shadow_reg[4] = RD_REG_DWORD(dmp_reg);
+               fw->shadow_reg[4] = htonl(RD_REG_DWORD(dmp_reg));
 
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0);
                WRT_REG_DWORD(dmp_reg, 0xB0500000);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xFC);
-               fw->shadow_reg[5] = RD_REG_DWORD(dmp_reg);
+               fw->shadow_reg[5] = htonl(RD_REG_DWORD(dmp_reg));
 
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0);
                WRT_REG_DWORD(dmp_reg, 0xB0600000);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xFC);
-               fw->shadow_reg[6] = RD_REG_DWORD(dmp_reg);
+               fw->shadow_reg[6] = htonl(RD_REG_DWORD(dmp_reg));
 
                /* Mailbox registers. */
                mbx_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
                for (cnt = 0; cnt < sizeof(fw->mailbox_reg) / 2; cnt++)
-                       fw->mailbox_reg[cnt] = RD_REG_WORD(mbx_reg++);
+                       fw->mailbox_reg[cnt] = htons(RD_REG_WORD(mbx_reg++));
 
                /* Transfer sequence registers. */
                iter_reg = fw->xseq_gp_reg;
                WRT_REG_DWORD(&reg->iobase_addr, 0xBF00);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0xBF10);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0xBF20);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0xBF30);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0xBF40);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0xBF50);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0xBF60);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0xBF70);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0xBFE0);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < sizeof(fw->xseq_0_reg) / 4; cnt++)
-                       fw->xseq_0_reg[cnt] = RD_REG_DWORD(dmp_reg++);
+                       fw->xseq_0_reg[cnt] = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0xBFF0);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < sizeof(fw->xseq_1_reg) / 4; cnt++)
-                       fw->xseq_1_reg[cnt] = RD_REG_DWORD(dmp_reg++);
+                       fw->xseq_1_reg[cnt] = htonl(RD_REG_DWORD(dmp_reg++));
 
                /* Receive sequence registers. */
                iter_reg = fw->rseq_gp_reg;
                WRT_REG_DWORD(&reg->iobase_addr, 0xFF00);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0xFF10);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0xFF20);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0xFF30);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0xFF40);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0xFF50);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0xFF60);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0xFF70);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0xFFD0);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < sizeof(fw->rseq_0_reg) / 4; cnt++)
-                       fw->rseq_0_reg[cnt] = RD_REG_DWORD(dmp_reg++);
+                       fw->rseq_0_reg[cnt] = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0xFFE0);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < sizeof(fw->rseq_1_reg) / 4; cnt++)
-                       fw->rseq_1_reg[cnt] = RD_REG_DWORD(dmp_reg++);
+                       fw->rseq_1_reg[cnt] = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0xFFF0);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < sizeof(fw->rseq_2_reg) / 4; cnt++)
-                       fw->rseq_2_reg[cnt] = RD_REG_DWORD(dmp_reg++);
+                       fw->rseq_2_reg[cnt] = htonl(RD_REG_DWORD(dmp_reg++));
 
                /* Command DMA registers. */
                WRT_REG_DWORD(&reg->iobase_addr, 0x7100);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < sizeof(fw->cmd_dma_reg) / 4; cnt++)
-                       fw->cmd_dma_reg[cnt] = RD_REG_DWORD(dmp_reg++);
+                       fw->cmd_dma_reg[cnt] = htonl(RD_REG_DWORD(dmp_reg++));
 
                /* Queues. */
                iter_reg = fw->req0_dma_reg;
                WRT_REG_DWORD(&reg->iobase_addr, 0x7200);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 8; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xE4);
                for (cnt = 0; cnt < 7; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                iter_reg = fw->resp0_dma_reg;
                WRT_REG_DWORD(&reg->iobase_addr, 0x7300);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 8; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xE4);
                for (cnt = 0; cnt < 7; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                iter_reg = fw->req1_dma_reg;
                WRT_REG_DWORD(&reg->iobase_addr, 0x7400);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 8; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xE4);
                for (cnt = 0; cnt < 7; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                /* Transmit DMA registers. */
                iter_reg = fw->xmt0_dma_reg;
                WRT_REG_DWORD(&reg->iobase_addr, 0x7600);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x7610);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                iter_reg = fw->xmt1_dma_reg;
                WRT_REG_DWORD(&reg->iobase_addr, 0x7620);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x7630);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                iter_reg = fw->xmt2_dma_reg;
                WRT_REG_DWORD(&reg->iobase_addr, 0x7640);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x7650);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                iter_reg = fw->xmt3_dma_reg;
                WRT_REG_DWORD(&reg->iobase_addr, 0x7660);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x7670);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                iter_reg = fw->xmt4_dma_reg;
                WRT_REG_DWORD(&reg->iobase_addr, 0x7680);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x7690);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x76A0);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < sizeof(fw->xmt_data_dma_reg) / 4; cnt++)
-                       fw->xmt_data_dma_reg[cnt] = RD_REG_DWORD(dmp_reg++);
+                       fw->xmt_data_dma_reg[cnt] =
+                           htonl(RD_REG_DWORD(dmp_reg++));
 
                /* Receive DMA registers. */
                iter_reg = fw->rcvt0_data_dma_reg;
                WRT_REG_DWORD(&reg->iobase_addr, 0x7700);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x7710);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                iter_reg = fw->rcvt1_data_dma_reg;
                WRT_REG_DWORD(&reg->iobase_addr, 0x7720);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x7730);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                /* RISC registers. */
                iter_reg = fw->risc_gp_reg;
                WRT_REG_DWORD(&reg->iobase_addr, 0x0F00);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x0F10);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x0F20);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x0F30);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x0F40);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x0F50);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x0F60);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x0F70);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                /* Local memory controller registers. */
                iter_reg = fw->lmc_reg;
                WRT_REG_DWORD(&reg->iobase_addr, 0x3000);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x3010);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x3020);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x3030);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x3040);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x3050);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x3060);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                /* Fibre Protocol Module registers. */
                iter_reg = fw->fpm_hdw_reg;
                WRT_REG_DWORD(&reg->iobase_addr, 0x4000);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x4010);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x4020);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x4030);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x4040);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x4050);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x4060);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x4070);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x4080);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x4090);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x40A0);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x40B0);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                /* Frame Buffer registers. */
                iter_reg = fw->fb_hdw_reg;
                WRT_REG_DWORD(&reg->iobase_addr, 0x6000);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x6010);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x6020);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x6030);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x6040);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x6100);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x6130);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x6150);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x6170);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x6190);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                WRT_REG_DWORD(&reg->iobase_addr, 0x61B0);
                dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0);
                for (cnt = 0; cnt < 16; cnt++)
-                       *iter_reg++ = RD_REG_DWORD(dmp_reg++);
+                       *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++));
 
                /* Reset RISC. */
                WRT_REG_DWORD(&reg->ctrl_status,
@@ -1577,7 +1258,7 @@ qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
 
                if (test_and_clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags)) {
                        rval = mb[0] & MBS_MASK;
-                       fw->code_ram[cnt] = (mb[3] << 16) | mb[2];
+                       fw->code_ram[cnt] = htonl((mb[3] << 16) | mb[2]);
                } else {
                        rval = QLA_FUNCTION_FAILED;
                }
@@ -1627,12 +1308,18 @@ qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
 
                if (test_and_clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags)) {
                        rval = mb[0] & MBS_MASK;
-                       fw->ext_mem[cnt] = (mb[3] << 16) | mb[2];
+                       fw->ext_mem[cnt] = htonl((mb[3] << 16) | mb[2]);
                } else {
                        rval = QLA_FUNCTION_FAILED;
                }
        }
 
+       if (rval == QLA_SUCCESS) {
+               eft = qla2xxx_copy_queues(ha, &fw->ext_mem[cnt]);
+               if (ha->eft)
+                       memcpy(eft, ha->eft, ntohl(ha->fw_dump->eft_size));
+       }
+
        if (rval != QLA_SUCCESS) {
                qla_printk(KERN_WARNING, ha,
                    "Failed to dump firmware (%x)!!!\n", rval);
@@ -1650,252 +1337,6 @@ qla24xx_fw_dump_failed:
                spin_unlock_irqrestore(&ha->hardware_lock, flags);
 }
 
-void
-qla24xx_ascii_fw_dump(scsi_qla_host_t *ha)
-{
-       uint32_t cnt;
-       char *uiter;
-       struct qla24xx_fw_dump *fw;
-       uint32_t ext_mem_cnt;
-
-       uiter = ha->fw_dump_buffer;
-       fw = ha->fw_dump;
-
-       qla_uprintf(&uiter, "ISP FW Version %d.%02d.%02d Attributes %04x\n",
-           ha->fw_major_version, ha->fw_minor_version,
-           ha->fw_subminor_version, ha->fw_attributes);
-
-       qla_uprintf(&uiter, "\nR2H Status Register\n%04x\n", fw->host_status);
-
-       qla_uprintf(&uiter, "\nHost Interface Registers");
-       for (cnt = 0; cnt < sizeof(fw->host_reg) / 4; cnt++) {
-               if (cnt % 8 == 0)
-                       qla_uprintf(&uiter, "\n");
-
-               qla_uprintf(&uiter, "%08x ", fw->host_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nShadow Registers");
-       for (cnt = 0; cnt < sizeof(fw->shadow_reg) / 4; cnt++) {
-               if (cnt % 8 == 0)
-                       qla_uprintf(&uiter, "\n");
-
-               qla_uprintf(&uiter, "%08x ", fw->shadow_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nMailbox Registers");
-       for (cnt = 0; cnt < sizeof(fw->mailbox_reg) / 2; cnt++) {
-               if (cnt % 8 == 0)
-                       qla_uprintf(&uiter, "\n");
-
-               qla_uprintf(&uiter, "%08x ", fw->mailbox_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nXSEQ GP Registers");
-       for (cnt = 0; cnt < sizeof(fw->xseq_gp_reg) / 4; cnt++) {
-               if (cnt % 8 == 0)
-                       qla_uprintf(&uiter, "\n");
-
-               qla_uprintf(&uiter, "%08x ", fw->xseq_gp_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nXSEQ-0 Registers");
-       for (cnt = 0; cnt < sizeof(fw->xseq_0_reg) / 4; cnt++) {
-               if (cnt % 8 == 0)
-                       qla_uprintf(&uiter, "\n");
-
-               qla_uprintf(&uiter, "%08x ", fw->xseq_0_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nXSEQ-1 Registers");
-       for (cnt = 0; cnt < sizeof(fw->xseq_1_reg) / 4; cnt++) {
-               if (cnt % 8 == 0)
-                       qla_uprintf(&uiter, "\n");
-
-               qla_uprintf(&uiter, "%08x ", fw->xseq_1_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nRSEQ GP Registers");
-       for (cnt = 0; cnt < sizeof(fw->rseq_gp_reg) / 4; cnt++) {
-               if (cnt % 8 == 0)
-                       qla_uprintf(&uiter, "\n");
-
-               qla_uprintf(&uiter, "%08x ", fw->rseq_gp_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nRSEQ-0 Registers");
-       for (cnt = 0; cnt < sizeof(fw->rseq_0_reg) / 4; cnt++) {
-               if (cnt % 8 == 0)
-                       qla_uprintf(&uiter, "\n");
-
-               qla_uprintf(&uiter, "%08x ", fw->rseq_0_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nRSEQ-1 Registers");
-       for (cnt = 0; cnt < sizeof(fw->rseq_1_reg) / 4; cnt++) {
-               if (cnt % 8 == 0)
-                       qla_uprintf(&uiter, "\n");
-
-               qla_uprintf(&uiter, "%08x ", fw->rseq_1_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nRSEQ-2 Registers");
-       for (cnt = 0; cnt < sizeof(fw->rseq_2_reg) / 4; cnt++) {
-               if (cnt % 8 == 0)
-                       qla_uprintf(&uiter, "\n");
-
-               qla_uprintf(&uiter, "%08x ", fw->rseq_2_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nCommand DMA Registers");
-       for (cnt = 0; cnt < sizeof(fw->cmd_dma_reg) / 4; cnt++) {
-               if (cnt % 8 == 0)
-                       qla_uprintf(&uiter, "\n");
-
-               qla_uprintf(&uiter, "%08x ", fw->cmd_dma_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nRequest0 Queue DMA Channel Registers");
-       for (cnt = 0; cnt < sizeof(fw->req0_dma_reg) / 4; cnt++) {
-               if (cnt % 8 == 0)
-                       qla_uprintf(&uiter, "\n");
-
-               qla_uprintf(&uiter, "%08x ", fw->req0_dma_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nResponse0 Queue DMA Channel Registers");
-       for (cnt = 0; cnt < sizeof(fw->resp0_dma_reg) / 4; cnt++) {
-               if (cnt % 8 == 0)
-                       qla_uprintf(&uiter, "\n");
-
-               qla_uprintf(&uiter, "%08x ", fw->resp0_dma_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nRequest1 Queue DMA Channel Registers");
-       for (cnt = 0; cnt < sizeof(fw->req1_dma_reg) / 4; cnt++) {
-               if (cnt % 8 == 0)
-                       qla_uprintf(&uiter, "\n");
-
-               qla_uprintf(&uiter, "%08x ", fw->req1_dma_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nXMT0 Data DMA Registers");
-       for (cnt = 0; cnt < sizeof(fw->xmt0_dma_reg) / 4; cnt++) {
-               if (cnt % 8 == 0)
-                       qla_uprintf(&uiter, "\n");
-
-               qla_uprintf(&uiter, "%08x ", fw->xmt0_dma_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nXMT1 Data DMA Registers");
-       for (cnt = 0; cnt < sizeof(fw->xmt1_dma_reg) / 4; cnt++) {
-               if (cnt % 8 == 0)
-                       qla_uprintf(&uiter, "\n");
-
-               qla_uprintf(&uiter, "%08x ", fw->xmt1_dma_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nXMT2 Data DMA Registers");
-       for (cnt = 0; cnt < sizeof(fw->xmt2_dma_reg) / 4; cnt++) {
-               if (cnt % 8 == 0)
-                       qla_uprintf(&uiter, "\n");
-
-               qla_uprintf(&uiter, "%08x ", fw->xmt2_dma_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nXMT3 Data DMA Registers");
-       for (cnt = 0; cnt < sizeof(fw->xmt3_dma_reg) / 4; cnt++) {
-               if (cnt % 8 == 0)
-                       qla_uprintf(&uiter, "\n");
-
-               qla_uprintf(&uiter, "%08x ", fw->xmt3_dma_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nXMT4 Data DMA Registers");
-       for (cnt = 0; cnt < sizeof(fw->xmt4_dma_reg) / 4; cnt++) {
-               if (cnt % 8 == 0)
-                       qla_uprintf(&uiter, "\n");
-
-               qla_uprintf(&uiter, "%08x ", fw->xmt4_dma_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nXMT Data DMA Common Registers");
-       for (cnt = 0; cnt < sizeof(fw->xmt_data_dma_reg) / 4; cnt++) {
-               if (cnt % 8 == 0)
-                       qla_uprintf(&uiter, "\n");
-
-               qla_uprintf(&uiter, "%08x ", fw->xmt_data_dma_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nRCV Thread 0 Data DMA Registers");
-       for (cnt = 0; cnt < sizeof(fw->rcvt0_data_dma_reg) / 4; cnt++) {
-               if (cnt % 8 == 0)
-                       qla_uprintf(&uiter, "\n");
-
-               qla_uprintf(&uiter, "%08x ", fw->rcvt0_data_dma_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nRCV Thread 1 Data DMA Registers");
-       for (cnt = 0; cnt < sizeof(fw->rcvt1_data_dma_reg) / 4; cnt++) {
-               if (cnt % 8 == 0)
-                       qla_uprintf(&uiter, "\n");
-
-               qla_uprintf(&uiter, "%08x ", fw->rcvt1_data_dma_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nRISC GP Registers");
-       for (cnt = 0; cnt < sizeof(fw->risc_gp_reg) / 4; cnt++) {
-               if (cnt % 8 == 0)
-                       qla_uprintf(&uiter, "\n");
-
-               qla_uprintf(&uiter, "%08x ", fw->risc_gp_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nLMC Registers");
-       for (cnt = 0; cnt < sizeof(fw->lmc_reg) / 4; cnt++) {
-               if (cnt % 8 == 0)
-                       qla_uprintf(&uiter, "\n");
-
-               qla_uprintf(&uiter, "%08x ", fw->lmc_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nFPM Hardware Registers");
-       for (cnt = 0; cnt < sizeof(fw->fpm_hdw_reg) / 4; cnt++) {
-               if (cnt % 8 == 0)
-                       qla_uprintf(&uiter, "\n");
-
-               qla_uprintf(&uiter, "%08x ", fw->fpm_hdw_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nFB Hardware Registers");
-       for (cnt = 0; cnt < sizeof(fw->fb_hdw_reg) / 4; cnt++) {
-               if (cnt % 8 == 0)
-                       qla_uprintf(&uiter, "\n");
-
-               qla_uprintf(&uiter, "%08x ", fw->fb_hdw_reg[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nCode RAM");
-       for (cnt = 0; cnt < sizeof (fw->code_ram) / 4; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n%08x: ", cnt + 0x20000);
-               }
-               qla_uprintf(&uiter, "%08x ", fw->code_ram[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n\nExternal Memory");
-       ext_mem_cnt = ha->fw_memory_size - 0x100000 + 1;
-       for (cnt = 0; cnt < ext_mem_cnt; cnt++) {
-               if (cnt % 8 == 0) {
-                       qla_uprintf(&uiter, "\n%08x: ", cnt + 0x100000);
-               }
-               qla_uprintf(&uiter, "%08x ", fw->ext_mem[cnt]);
-       }
-
-       qla_uprintf(&uiter, "\n[<==END] ISP Debug Dump");
-}
-
-
 /****************************************************************************/
 /*                         Driver Debug Functions.                          */
 /****************************************************************************/
index ab6afeaa2f2cafe79555b5d154f17c59b8e7b714..533425338e05ec5fb43e54b54d37c2875ac08f8f 100644 (file)
 /*
 * Macros use for debugging the driver.
 */
-#undef ENTER_TRACE
-#if defined(ENTER_TRACE)
-#define ENTER(x)       do { printk("qla2100 : Entering %s()\n", x); } while (0)
-#define LEAVE(x)       do { printk("qla2100 : Leaving %s()\n", x);  } while (0)
-#define ENTER_INTR(x)  do { printk("qla2100 : Entering %s()\n", x); } while (0)
-#define LEAVE_INTR(x)  do { printk("qla2100 : Leaving %s()\n", x);  } while (0)
-#else
-#define ENTER(x)       do {} while (0)
-#define LEAVE(x)       do {} while (0)
-#define ENTER_INTR(x)  do {} while (0)
-#define LEAVE_INTR(x)   do {} while (0)
-#endif
 
-#if  DEBUG_QLA2100
-#define DEBUG(x)       do {x;} while (0);
-#else
-#define DEBUG(x)       do {} while (0);
-#endif
+#define DEBUG(x)       do { if (extended_error_logging) { x; } } while (0)
 
 #if defined(QL_DEBUG_LEVEL_1)
-#define DEBUG1(x)      do {x;} while (0);
+#define DEBUG1(x)      do {x;} while (0)
 #else
-#define DEBUG1(x)      do {} while (0);
+#define DEBUG1(x)      do {} while (0)
 #endif
 
-#if defined(QL_DEBUG_LEVEL_2)
-#define DEBUG2(x)       do {x;} while (0);
-#define DEBUG2_3(x)     do {x;} while (0);
-#define DEBUG2_3_11(x)  do {x;} while (0);
-#define DEBUG2_9_10(x)    do {x;} while (0);
-#define DEBUG2_11(x)    do {x;} while (0);
-#define DEBUG2_13(x)    do {x;} while (0);
-#else
-#define DEBUG2(x)      do {} while (0);
-#endif
+#define DEBUG2(x)      do { if (extended_error_logging) { x; } } while (0)
+#define DEBUG2_3(x)    do { if (extended_error_logging) { x; } } while (0)
+#define DEBUG2_3_11(x) do { if (extended_error_logging) { x; } } while (0)
+#define DEBUG2_9_10(x) do { if (extended_error_logging) { x; } } while (0)
+#define DEBUG2_11(x)   do { if (extended_error_logging) { x; } } while (0)
+#define DEBUG2_13(x)   do { if (extended_error_logging) { x; } } while (0)
 
 #if defined(QL_DEBUG_LEVEL_3)
-#define DEBUG3(x)      do {x;} while (0);
-#define DEBUG2_3(x)    do {x;} while (0);
-#define DEBUG2_3_11(x) do {x;} while (0);
-#define DEBUG3_11(x)   do {x;} while (0);
+#define DEBUG3(x)      do {x;} while (0)
+#define DEBUG3_11(x)   do {x;} while (0)
 #else
-#define DEBUG3(x)      do {} while (0);
-  #if !defined(QL_DEBUG_LEVEL_2)
-  #define DEBUG2_3(x)  do {} while (0);
-  #endif
+#define DEBUG3(x)      do {} while (0)
 #endif
 
 #if defined(QL_DEBUG_LEVEL_4)
-#define DEBUG4(x)      do {x;} while (0);
+#define DEBUG4(x)      do {x;} while (0)
 #else
-#define DEBUG4(x)      do {} while (0);
+#define DEBUG4(x)      do {} while (0)
 #endif
 
 #if defined(QL_DEBUG_LEVEL_5)
-#define DEBUG5(x)          do {x;} while (0);
+#define DEBUG5(x)          do {x;} while (0)
 #else
-#define DEBUG5(x)      do {} while (0);
+#define DEBUG5(x)      do {} while (0)
 #endif
 
 #if defined(QL_DEBUG_LEVEL_7)
-#define DEBUG7(x)          do {x;} while (0);
+#define DEBUG7(x)          do {x;} while (0)
 #else
-#define DEBUG7(x)         do {} while (0);
+#define DEBUG7(x)         do {} while (0)
 #endif
 
 #if defined(QL_DEBUG_LEVEL_9)
-#define DEBUG9(x)       do {x;} while (0);
-#define DEBUG9_10(x)    do {x;} while (0);
-#define DEBUG2_9_10(x) do {x;} while (0);
+#define DEBUG9(x)       do {x;} while (0)
+#define DEBUG9_10(x)    do {x;} while (0)
 #else
-#define DEBUG9(x)      do {} while (0);
+#define DEBUG9(x)      do {} while (0)
 #endif
 
 #if defined(QL_DEBUG_LEVEL_10)
-#define DEBUG10(x)      do {x;} while (0);
-#define DEBUG2_9_10(x) do {x;} while (0);
-#define DEBUG9_10(x)   do {x;} while (0);
+#define DEBUG10(x)      do {x;} while (0)
+#define DEBUG9_10(x)   do {x;} while (0)
 #else
-#define DEBUG10(x)     do {} while (0);
-  #if !defined(DEBUG2_9_10)
-  #define DEBUG2_9_10(x)       do {} while (0);
-  #endif
+#define DEBUG10(x)     do {} while (0)
   #if !defined(DEBUG9_10)
-  #define DEBUG9_10(x) do {} while (0);
+  #define DEBUG9_10(x) do {} while (0)
   #endif
 #endif
 
 #if defined(QL_DEBUG_LEVEL_11)
-#define DEBUG11(x)      do{x;} while(0);
-#if !defined(DEBUG2_11)
-#define DEBUG2_11(x)    do{x;} while(0);
-#endif
-#if !defined(DEBUG2_3_11)
-#define DEBUG2_3_11(x)  do{x;} while(0);
-#endif
+#define DEBUG11(x)      do{x;} while(0)
 #if !defined(DEBUG3_11)
-#define DEBUG3_11(x)    do{x;} while(0);
+#define DEBUG3_11(x)    do{x;} while(0)
 #endif
 #else
-#define DEBUG11(x)     do{} while(0);
-  #if !defined(QL_DEBUG_LEVEL_2)
-  #define DEBUG2_11(x) do{} while(0);
-    #if !defined(QL_DEBUG_LEVEL_3)
-    #define DEBUG2_3_11(x) do{} while(0);
-    #endif
-  #endif
+#define DEBUG11(x)     do{} while(0)
   #if !defined(QL_DEBUG_LEVEL_3)
-  #define DEBUG3_11(x) do{} while(0);
+  #define DEBUG3_11(x) do{} while(0)
   #endif
 #endif
 
 #if defined(QL_DEBUG_LEVEL_12)
-#define DEBUG12(x)      do {x;} while (0);
+#define DEBUG12(x)      do {x;} while (0)
 #else
-#define DEBUG12(x)     do {} while (0);
+#define DEBUG12(x)     do {} while (0)
 #endif
 
 #if defined(QL_DEBUG_LEVEL_13)
 #define DEBUG13(x)      do {x;} while (0)
-#if !defined(DEBUG2_13)
-#define DEBUG2_13(x)    do {x;} while(0)
-#endif
 #else
 #define DEBUG13(x)     do {} while (0)
-#if !defined(QL_DEBUG_LEVEL_2)
-#define DEBUG2_13(x)   do {} while(0)
-#endif
 #endif
 
 #if defined(QL_DEBUG_LEVEL_14)
 /*
  * Firmware Dump structure definition
  */
-#define FW_DUMP_SIZE_128K      0xBC000
-#define FW_DUMP_SIZE_512K      0x2FC000
-#define FW_DUMP_SIZE_1M                0x5FC000
 
 struct qla2300_fw_dump {
        uint16_t hccr;
@@ -224,8 +173,6 @@ struct qla2100_fw_dump {
        uint16_t risc_ram[0xf000];
 };
 
-#define FW_DUMP_SIZE_24XX      0x2B0000
-
 struct qla24xx_fw_dump {
        uint32_t host_status;
        uint32_t host_reg[32];
@@ -257,3 +204,39 @@ struct qla24xx_fw_dump {
        uint32_t code_ram[0x2000];
        uint32_t ext_mem[1];
 };
+
+#define EFT_NUM_BUFFERS                4
+#define EFT_BYTES_PER_BUFFER   0x4000
+#define EFT_SIZE               ((EFT_BYTES_PER_BUFFER) * (EFT_NUM_BUFFERS))
+
+struct qla2xxx_fw_dump {
+       uint8_t signature[4];
+       uint32_t version;
+
+       uint32_t fw_major_version;
+       uint32_t fw_minor_version;
+       uint32_t fw_subminor_version;
+       uint32_t fw_attributes;
+
+       uint32_t vendor;
+       uint32_t device;
+       uint32_t subsystem_vendor;
+       uint32_t subsystem_device;
+
+       uint32_t fixed_size;
+       uint32_t mem_size;
+       uint32_t req_q_size;
+       uint32_t rsp_q_size;
+
+       uint32_t eft_size;
+       uint32_t eft_addr_l;
+       uint32_t eft_addr_h;
+
+       uint32_t header_size;
+
+       union {
+               struct qla2100_fw_dump isp21;
+               struct qla2300_fw_dump isp23;
+               struct qla24xx_fw_dump isp24;
+       } isp;
+};
index d6f6579cfd277671da7fcfcbdccba0fef26ffe14..139ea0e27fd7c1c7bfe92f36a5454142bcfee8ba 100644 (file)
@@ -608,7 +608,9 @@ typedef struct {
 #define MBC_SERDES_PARAMS              0x10    /* Serdes Tx Parameters. */
 #define MBC_GET_IOCB_STATUS            0x12    /* Get IOCB status command. */
 #define MBC_GET_TIMEOUT_PARAMS         0x22    /* Get FW timeouts. */
+#define MBC_TRACE_CONTROL              0x27    /* Trace control command. */
 #define MBC_GEN_SYSTEM_ERROR           0x2a    /* Generate System Error. */
+#define MBC_READ_SFP                   0x31    /* Read SFP Data. */
 #define MBC_SET_TIMEOUT_PARAMS         0x32    /* Set FW timeouts. */
 #define MBC_MID_INITIALIZE_FIRMWARE    0x48    /* MID Initialize firmware. */
 #define MBC_MID_GET_VP_DATABASE                0x49    /* MID Get VP Database. */
@@ -618,6 +620,9 @@ typedef struct {
 #define MBC_GET_LINK_PRIV_STATS                0x6d    /* Get link & private data. */
 #define MBC_SET_VENDOR_ID              0x76    /* Set Vendor ID. */
 
+#define TC_ENABLE                      4
+#define TC_DISABLE                     5
+
 /* Firmware return data sizes */
 #define FCAL_MAP_SIZE  128
 
@@ -1997,7 +2002,6 @@ struct isp_operations {
                uint32_t);
 
        void (*fw_dump) (struct scsi_qla_host *, int);
-       void (*ascii_fw_dump) (struct scsi_qla_host *);
 
        int (*beacon_on) (struct scsi_qla_host *);
        int (*beacon_off) (struct scsi_qla_host *);
@@ -2041,6 +2045,7 @@ typedef struct scsi_qla_host {
                uint32_t        enable_led_scheme       :1;
                uint32_t        msi_enabled             :1;
                uint32_t        msix_enabled            :1;
+               uint32_t        disable_serdes          :1;
        } flags;
 
        atomic_t        loop_state;
@@ -2134,7 +2139,7 @@ typedef struct scsi_qla_host {
        mempool_t       *srb_mempool;
 
        /* This spinlock is used to protect "io transactions", you must
-        * aquire it before doing any IO to the card, eg with RD_REG*() and
+        * acquire it before doing any IO to the card, eg with RD_REG*() and
         * WRT_REG*() for the duration of your entire commandtransaction.
         *
         * This spinlock is of lower priority than the io request lock.
@@ -2238,6 +2243,11 @@ typedef struct scsi_qla_host {
        struct sns_cmd_pkt      *sns_cmd;
        dma_addr_t              sns_cmd_dma;
 
+#define SFP_DEV_SIZE   256
+#define SFP_BLOCK_SIZE 64
+       void                    *sfp_data;
+       dma_addr_t              sfp_data_dma;
+
        struct task_struct      *dpc_thread;
        uint8_t dpc_active;                  /* DPC routine is active */
 
@@ -2303,11 +2313,12 @@ typedef struct scsi_qla_host {
        uint16_t        fw_seriallink_options24[4];
 
        /* Firmware dump information. */
-       void            *fw_dump;
+       struct qla2xxx_fw_dump *fw_dump;
+       uint32_t        fw_dump_len;
        int             fw_dumped;
        int             fw_dump_reading;
-       char            *fw_dump_buffer;
-       int             fw_dump_buffer_len;
+       dma_addr_t      eft_dma;
+       void            *eft;
 
        uint8_t         host_str[16];
        uint32_t        pci_attr;
index a8fc0ffc7fc54829703faeb64a6fc124d97d65ff..dd435410dfa2a9dd0fb95b78e23fed635a5aa91c 100644 (file)
@@ -1,4 +1,4 @@
-#define QLA_MODEL_NAMES         0x4A
+#define QLA_MODEL_NAMES                0x57
 
 /*
  * Adapter model names and descriptions.
@@ -76,6 +76,19 @@ static char *qla2x00_model_name[QLA_MODEL_NAMES*2] = {
        "QLE2440",      "PCI-Express to 4Gb FC, Single Channel",        /* 0x145 */
        "QLE2464",      "PCI-Express to 4Gb FC, Quad Channel",          /* 0x146 */
        "QLA2440",      "PCI-X 2.0 to 4Gb FC, Single Channel",          /* 0x147 */
-       " ",            " ",                                            /* 0x148 */
+       "HP AE369A",    "PCI-X 2.0 to 4Gb FC, Dual Channel",            /* 0x148 */
        "QLA2340",      "Sun 133MHz PCI-X to 2Gb FC, Single Channel",   /* 0x149 */
+       " ",            " ",                                            /* 0x14a */
+       " ",            " ",                                            /* 0x14b */
+       "QMC2432M",     "IBM eServer BC 4Gb FC Expansion Card CFFE",    /* 0x14c */
+       "QMC2422M",     "IBM eServer BC 4Gb FC Expansion Card CFFX",    /* 0x14d */
+       "QLE220",       "Sun PCI-Express to 4Gb FC, Single Channel",    /* 0x14e */
+       " ",            " ",                                            /* 0x14f */
+       " ",            " ",                                            /* 0x150 */
+       " ",            " ",                                            /* 0x151 */
+       "QME2462",      "PCI-Express to 4Gb FC, Dual Channel Mezz HBA", /* 0x152 */
+       "QMH2462",      "PCI-Express to 4Gb FC, Dual Channel Mezz HBA", /* 0x153 */
+       " ",            " ",                                            /* 0x154 */
+       "QLE220",       "PCI-Express to 4Gb FC, Single Channel",        /* 0x155 */
+       "QLE220",       "PCI-Express to 4Gb FC, Single Channel",        /* 0x156 */
 };
index 3af478663be7f2755d05fc689debccddf3788f91..a0a722cf423769fb8fd152eaeff5aa140a9ccdb3 100644 (file)
@@ -141,7 +141,7 @@ struct nvram_24xx {
         * BIT 2  = Enable Memory Map BIOS
         * BIT 3  = Enable Selectable Boot
         * BIT 4  = Disable RISC code load
-        * BIT 5  =
+        * BIT 5  = Disable Serdes
         * BIT 6  =
         * BIT 7  =
         *
@@ -278,7 +278,7 @@ struct init_cb_24xx {
        uint16_t response_q_length;
        uint16_t request_q_length;
 
-       uint16_t link_down_timeout;             /* Milliseconds. */
+       uint16_t link_down_on_nos;              /* Milliseconds. */
 
        uint16_t prio_request_q_length;
 
index 164d53ccbfd0c60223d814ad15627a72289a6d05..8311ac2b93a858c7ca5d20131e90588e6e74d15f 100644 (file)
@@ -31,13 +31,9 @@ extern void qla2x00_update_fw_options(struct scsi_qla_host *);
 extern void qla24xx_update_fw_options(scsi_qla_host_t *);
 extern int qla2x00_load_risc(struct scsi_qla_host *, uint32_t *);
 extern int qla24xx_load_risc(scsi_qla_host_t *, uint32_t *);
-extern int qla24xx_load_risc_flash(scsi_qla_host_t *, uint32_t *);
-
-extern fc_port_t *qla2x00_alloc_fcport(scsi_qla_host_t *, gfp_t);
 
 extern int qla2x00_loop_resync(scsi_qla_host_t *);
 
-extern int qla2x00_find_new_loop_id(scsi_qla_host_t *, fc_port_t *);
 extern int qla2x00_fabric_login(scsi_qla_host_t *, fc_port_t *, uint16_t *);
 extern int qla2x00_local_device_login(scsi_qla_host_t *, fc_port_t *);
 
@@ -51,6 +47,8 @@ extern int qla2x00_abort_isp(scsi_qla_host_t *);
 extern void qla2x00_update_fcport(scsi_qla_host_t *, fc_port_t *);
 extern void qla2x00_reg_remote_port(scsi_qla_host_t *, fc_port_t *);
 
+extern void qla2x00_alloc_fw_dump(scsi_qla_host_t *);
+
 /*
  * Global Data in qla_os.c source file.
  */
@@ -61,6 +59,8 @@ extern int qlport_down_retry;
 extern int ql2xplogiabsentdevice;
 extern int ql2xloginretrycount;
 extern int ql2xfdmienable;
+extern int ql2xallocfwdump;
+extern int extended_error_logging;
 
 extern void qla2x00_sp_compl(scsi_qla_host_t *, srb_t *);
 
@@ -80,8 +80,6 @@ extern void qla2xxx_wake_dpc(scsi_qla_host_t *);
 /*
  * Global Function Prototypes in qla_iocb.c source file.
  */
-extern void qla2x00_isp_cmd(scsi_qla_host_t *);
-
 extern uint16_t qla2x00_calc_iocbs_32(uint16_t);
 extern uint16_t qla2x00_calc_iocbs_64(uint16_t);
 extern void qla2x00_build_scsi_iocbs_32(srb_t *, cmd_entry_t *, uint16_t);
@@ -204,6 +202,12 @@ qla2x00_set_serdes_params(scsi_qla_host_t *, uint16_t, uint16_t, uint16_t);
 extern int
 qla2x00_stop_firmware(scsi_qla_host_t *);
 
+extern int
+qla2x00_trace_control(scsi_qla_host_t *, uint16_t, dma_addr_t, uint16_t);
+
+extern int
+qla2x00_read_sfp(scsi_qla_host_t *, dma_addr_t, uint16_t, uint16_t, uint16_t);
+
 /*
  * Global Function Prototypes in qla_isr.c source file.
  */
@@ -254,9 +258,6 @@ extern int qla24xx_write_optrom_data(struct scsi_qla_host *, uint8_t *,
 extern void qla2100_fw_dump(scsi_qla_host_t *, int);
 extern void qla2300_fw_dump(scsi_qla_host_t *, int);
 extern void qla24xx_fw_dump(scsi_qla_host_t *, int);
-extern void qla2100_ascii_fw_dump(scsi_qla_host_t *);
-extern void qla2300_ascii_fw_dump(scsi_qla_host_t *);
-extern void qla24xx_ascii_fw_dump(scsi_qla_host_t *);
 extern void qla2x00_dump_regs(scsi_qla_host_t *);
 extern void qla2x00_dump_buffer(uint8_t *, uint32_t);
 extern void qla2x00_print_scsi_cmd(struct scsi_cmnd *);
@@ -279,13 +280,6 @@ extern void *qla2x00_prep_ms_fdmi_iocb(scsi_qla_host_t *, uint32_t, uint32_t);
 extern void *qla24xx_prep_ms_fdmi_iocb(scsi_qla_host_t *, uint32_t, uint32_t);
 extern int qla2x00_fdmi_register(scsi_qla_host_t *);
 
-/*
- * Global Function Prototypes in qla_xioctl.c source file.
- */
-#define qla2x00_enqueue_aen(ha, cmd, mode)     do { } while (0)
-#define qla2x00_alloc_ioctl_mem(ha)            (0)
-#define qla2x00_free_ioctl_mem(ha)             do { } while (0)
-
 /*
  * Global Function Prototypes in qla_attr.c source file.
  */
index 3d4487eac9b7f35d469fbf9331024482d3ae3d43..9758dba9554247b7c979953a7864fdcad5d02aac 100644 (file)
@@ -39,6 +39,8 @@ static int qla2x00_fabric_dev_login(scsi_qla_host_t *, fc_port_t *,
 
 static int qla2x00_restart_isp(scsi_qla_host_t *);
 
+static int qla2x00_find_new_loop_id(scsi_qla_host_t *ha, fc_port_t *dev);
+
 /****************************************************************************/
 /*                QLogic ISP2x00 Hardware Support Functions.                */
 /****************************************************************************/
@@ -89,6 +91,17 @@ qla2x00_initialize_adapter(scsi_qla_host_t *ha)
 
        ha->isp_ops.nvram_config(ha);
 
+       if (ha->flags.disable_serdes) {
+               /* Mask HBA via NVRAM settings? */
+               qla_printk(KERN_INFO, ha, "Masking HBA WWPN "
+                   "%02x%02x%02x%02x%02x%02x%02x%02x (via NVRAM).\n",
+                   ha->port_name[0], ha->port_name[1],
+                   ha->port_name[2], ha->port_name[3],
+                   ha->port_name[4], ha->port_name[5],
+                   ha->port_name[6], ha->port_name[7]);
+               return QLA_FUNCTION_FAILED;
+       }
+
        qla_printk(KERN_INFO, ha, "Verifying loaded RISC code...\n");
 
        retry = 10;
@@ -770,29 +783,104 @@ qla24xx_chip_diag(scsi_qla_host_t *ha)
        return rval;
 }
 
-static void
+void
 qla2x00_alloc_fw_dump(scsi_qla_host_t *ha)
 {
-       uint32_t dump_size = 0;
+       int rval;
+       uint32_t dump_size, fixed_size, mem_size, req_q_size, rsp_q_size,
+           eft_size;
+       dma_addr_t eft_dma;
+       void *eft;
+
+       if (ha->fw_dump) {
+               qla_printk(KERN_WARNING, ha,
+                   "Firmware dump previously allocated.\n");
+               return;
+       }
 
        ha->fw_dumped = 0;
+       fixed_size = mem_size = eft_size = 0;
        if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
-               dump_size = sizeof(struct qla2100_fw_dump);
+               fixed_size = sizeof(struct qla2100_fw_dump);
        } else if (IS_QLA23XX(ha)) {
-               dump_size = sizeof(struct qla2300_fw_dump);
-               dump_size += (ha->fw_memory_size - 0x11000) * sizeof(uint16_t);
-        } else if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
-               dump_size = sizeof(struct qla24xx_fw_dump);
-               dump_size += (ha->fw_memory_size - 0x100000) * sizeof(uint32_t);
+               fixed_size = offsetof(struct qla2300_fw_dump, data_ram);
+               mem_size = (ha->fw_memory_size - 0x11000 + 1) *
+                   sizeof(uint16_t);
+       } else if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
+               fixed_size = offsetof(struct qla24xx_fw_dump, ext_mem);
+               mem_size = (ha->fw_memory_size - 0x100000 + 1) *
+                   sizeof(uint32_t);
+
+               /* Allocate memory for Extended Trace Buffer. */
+               eft = dma_alloc_coherent(&ha->pdev->dev, EFT_SIZE, &eft_dma,
+                   GFP_KERNEL);
+               if (!eft) {
+                       qla_printk(KERN_WARNING, ha, "Unable to allocate "
+                           "(%d KB) for EFT.\n", EFT_SIZE / 1024);
+                       goto cont_alloc;
+               }
+
+               rval = qla2x00_trace_control(ha, TC_ENABLE, eft_dma,
+                   EFT_NUM_BUFFERS);
+               if (rval) {
+                       qla_printk(KERN_WARNING, ha, "Unable to initialize "
+                           "EFT (%d).\n", rval);
+                       dma_free_coherent(&ha->pdev->dev, EFT_SIZE, eft,
+                           eft_dma);
+                       goto cont_alloc;
+               }
+
+               qla_printk(KERN_INFO, ha, "Allocated (%d KB) for EFT...\n",
+                   EFT_SIZE / 1024);
+
+               eft_size = EFT_SIZE;
+               memset(eft, 0, eft_size);
+               ha->eft_dma = eft_dma;
+               ha->eft = eft;
        }
+cont_alloc:
+       req_q_size = ha->request_q_length * sizeof(request_t);
+       rsp_q_size = ha->response_q_length * sizeof(response_t);
+
+       dump_size = offsetof(struct qla2xxx_fw_dump, isp);
+       dump_size += fixed_size + mem_size + req_q_size + rsp_q_size +
+           eft_size;
 
        ha->fw_dump = vmalloc(dump_size);
-       if (ha->fw_dump)
-               qla_printk(KERN_INFO, ha, "Allocated (%d KB) for firmware "
-                   "dump...\n", dump_size / 1024);
-       else
+       if (!ha->fw_dump) {
                qla_printk(KERN_WARNING, ha, "Unable to allocate (%d KB) for "
                    "firmware dump!!!\n", dump_size / 1024);
+
+               if (ha->eft) {
+                       dma_free_coherent(&ha->pdev->dev, eft_size, ha->eft,
+                           ha->eft_dma);
+                       ha->eft = NULL;
+                       ha->eft_dma = 0;
+               }
+               return;
+       }
+
+       qla_printk(KERN_INFO, ha, "Allocated (%d KB) for firmware dump...\n",
+           dump_size / 1024);
+
+       ha->fw_dump_len = dump_size;
+       ha->fw_dump->signature[0] = 'Q';
+       ha->fw_dump->signature[1] = 'L';
+       ha->fw_dump->signature[2] = 'G';
+       ha->fw_dump->signature[3] = 'C';
+       ha->fw_dump->version = __constant_htonl(1);
+
+       ha->fw_dump->fixed_size = htonl(fixed_size);
+       ha->fw_dump->mem_size = htonl(mem_size);
+       ha->fw_dump->req_q_size = htonl(req_q_size);
+       ha->fw_dump->rsp_q_size = htonl(rsp_q_size);
+
+       ha->fw_dump->eft_size = htonl(eft_size);
+       ha->fw_dump->eft_addr_l = htonl(LSD(ha->eft_dma));
+       ha->fw_dump->eft_addr_h = htonl(MSD(ha->eft_dma));
+
+       ha->fw_dump->header_size =
+           htonl(offsetof(struct qla2xxx_fw_dump, isp));
 }
 
 /**
@@ -810,8 +898,6 @@ qla2x00_resize_request_q(scsi_qla_host_t *ha)
        dma_addr_t request_dma;
        request_t *request_ring;
 
-       qla2x00_alloc_fw_dump(ha);
-
        /* Valid only on recent ISPs. */
        if (IS_QLA2100(ha) || IS_QLA2200(ha))
                return;
@@ -883,6 +969,9 @@ qla2x00_setup_chip(scsi_qla_host_t *ha)
                                    &ha->fw_subminor_version,
                                    &ha->fw_attributes, &ha->fw_memory_size);
                                qla2x00_resize_request_q(ha);
+
+                               if (ql2xallocfwdump)
+                                       qla2x00_alloc_fw_dump(ha);
                        }
                } else {
                        DEBUG2(printk(KERN_INFO
@@ -1186,8 +1275,7 @@ qla2x00_fw_ready(scsi_qla_host_t *ha)
                        rval = QLA_FUNCTION_FAILED;
 
                        if (atomic_read(&ha->loop_down_timer) &&
-                           (fw_state >= FSTATE_LOSS_OF_SYNC ||
-                               fw_state == FSTATE_WAIT_AL_PA)) {
+                           fw_state != FSTATE_READY) {
                                /* Loop down. Timeout on min_wait for states
                                 * other than Wait for Login.
                                 */
@@ -1555,6 +1643,8 @@ qla2x00_nvram_config(scsi_qla_host_t *ha)
        /*
         * Set host adapter parameters.
         */
+       if (nv->host_p[0] & BIT_7)
+               extended_error_logging = 1;
        ha->flags.disable_risc_code_load = ((nv->host_p[0] & BIT_4) ? 1 : 0);
        /* Always load RISC code on non ISP2[12]00 chips. */
        if (!IS_QLA2100(ha) && !IS_QLA2200(ha))
@@ -1563,6 +1653,7 @@ qla2x00_nvram_config(scsi_qla_host_t *ha)
        ha->flags.enable_lip_full_login = ((nv->host_p[1] & BIT_2) ? 1 : 0);
        ha->flags.enable_target_reset = ((nv->host_p[1] & BIT_3) ? 1 : 0);
        ha->flags.enable_led_scheme = (nv->special_options[1] & BIT_4) ? 1 : 0;
+       ha->flags.disable_serdes = 0;
 
        ha->operating_mode =
            (icb->add_firmware_options[0] & (BIT_6 | BIT_5 | BIT_4)) >> 4;
@@ -1701,7 +1792,7 @@ qla2x00_rport_del(void *data)
  *
  * Returns a pointer to the allocated fcport, or NULL, if none available.
  */
-fc_port_t *
+static fc_port_t *
 qla2x00_alloc_fcport(scsi_qla_host_t *ha, gfp_t flags)
 {
        fc_port_t *fcport;
@@ -2497,7 +2588,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *ha, struct list_head *new_fcports)
  * Context:
  *     Kernel context.
  */
-int
+static int
 qla2x00_find_new_loop_id(scsi_qla_host_t *ha, fc_port_t *dev)
 {
        int     rval;
@@ -3048,14 +3139,14 @@ qla2x00_abort_isp(scsi_qla_host_t *ha)
                                        ha->isp_abort_cnt--;
                                        DEBUG(printk("qla%ld: ISP abort - "
                                            "retry remaining %d\n",
-                                           ha->host_no, ha->isp_abort_cnt);)
+                                           ha->host_no, ha->isp_abort_cnt));
                                        status = 1;
                                }
                        } else {
                                ha->isp_abort_cnt = MAX_RETRIES_OF_ISP_ABORT;
                                DEBUG(printk("qla2x00(%ld): ISP error recovery "
                                    "- retrying (%d) more times\n",
-                                   ha->host_no, ha->isp_abort_cnt);)
+                                   ha->host_no, ha->isp_abort_cnt));
                                set_bit(ISP_ABORT_RETRY, &ha->dpc_flags);
                                status = 1;
                        }
@@ -3069,7 +3160,7 @@ qla2x00_abort_isp(scsi_qla_host_t *ha)
        } else {
                DEBUG(printk(KERN_INFO
                                "qla2x00_abort_isp(%ld): exiting.\n",
-                               ha->host_no);)
+                               ha->host_no));
        }
 
        return(status);
@@ -3145,7 +3236,7 @@ qla2x00_restart_isp(scsi_qla_host_t *ha)
                clear_bit(RESET_MARKER_NEEDED, &ha->dpc_flags);
                if (!(status = qla2x00_fw_ready(ha))) {
                        DEBUG(printk("%s(): Start configure loop, "
-                           "status = %d\n", __func__, status);)
+                           "status = %d\n", __func__, status));
 
                        /* Issue a marker after FW becomes ready. */
                        qla2x00_marker(ha, 0, 0, MK_SYNC_ALL);
@@ -3169,7 +3260,7 @@ qla2x00_restart_isp(scsi_qla_host_t *ha)
 
                DEBUG(printk("%s(): Configure loop done, status = 0x%x\n",
                                __func__,
-                               status);)
+                               status));
        }
        return (status);
 }
@@ -3289,7 +3380,6 @@ qla24xx_nvram_config(scsi_qla_host_t *ha)
                nv->node_name[6] = 0x55;
                nv->node_name[7] = 0x86;
                nv->login_retry_count = __constant_cpu_to_le16(8);
-               nv->link_down_timeout = __constant_cpu_to_le16(200);
                nv->interrupt_delay_timer = __constant_cpu_to_le16(0);
                nv->login_timeout = __constant_cpu_to_le16(0);
                nv->firmware_options_1 =
@@ -3318,7 +3408,7 @@ qla24xx_nvram_config(scsi_qla_host_t *ha)
                *dptr1++ = *dptr2++;
 
        icb->login_retry_count = nv->login_retry_count;
-       icb->link_down_timeout = nv->link_down_timeout;
+       icb->link_down_on_nos = nv->link_down_on_nos;
 
        /* Copy 2nd segment. */
        dptr1 = (uint8_t *)&icb->interrupt_delay_timer;
@@ -3373,6 +3463,7 @@ qla24xx_nvram_config(scsi_qla_host_t *ha)
        ha->flags.enable_lip_full_login = 1;
        ha->flags.enable_target_reset = 1;
        ha->flags.enable_led_scheme = 0;
+       ha->flags.disable_serdes = le32_to_cpu(nv->host_p) & BIT_5 ? 1: 0;
 
        ha->operating_mode = (le32_to_cpu(icb->firmware_options_2) &
            (BIT_6 | BIT_5 | BIT_4)) >> 4;
@@ -3472,7 +3563,7 @@ qla24xx_nvram_config(scsi_qla_host_t *ha)
        return (rval);
 }
 
-int
+static int
 qla24xx_load_risc_flash(scsi_qla_host_t *ha, uint32_t *srisc_addr)
 {
        int     rval;
index 8c769cfaa14ca670ff0dcd2c86b3d24eb02b6c46..2b60a27eff0bfbcee3ab89385e4d462712391d20 100644 (file)
@@ -15,6 +15,7 @@ static inline uint16_t qla2x00_get_cmd_direction(struct scsi_cmnd *cmd);
 static inline cont_entry_t *qla2x00_prep_cont_type0_iocb(scsi_qla_host_t *);
 static inline cont_a64_entry_t *qla2x00_prep_cont_type1_iocb(scsi_qla_host_t *);
 static request_t *qla2x00_req_pkt(scsi_qla_host_t *ha);
+static void qla2x00_isp_cmd(scsi_qla_host_t *ha);
 
 /**
  * qla2x00_get_cmd_direction() - Determine control_flag data direction.
@@ -574,7 +575,7 @@ qla2x00_req_pkt(scsi_qla_host_t *ha)
  *
  * Note: The caller must hold the hardware lock before calling this routine.
  */
-void
+static void
 qla2x00_isp_cmd(scsi_qla_host_t *ha)
 {
        device_reg_t __iomem *reg = ha->iobase;
index b28ac0a27e251532e3494470b81d605bbda52ec4..795bf15b1b8f0a916dc20f6669d626c85103098c 100644 (file)
@@ -395,10 +395,6 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
                set_bit(REGISTER_FC4_NEEDED, &ha->dpc_flags);
 
                ha->flags.management_server_logged_in = 0;
-
-               /* Update AEN queue. */
-               qla2x00_enqueue_aen(ha, MBA_LIP_OCCURRED, NULL);
-
                break;
 
        case MBA_LOOP_UP:               /* Loop Up Event */
@@ -418,9 +414,6 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
                    link_speed);
 
                ha->flags.management_server_logged_in = 0;
-
-               /* Update AEN queue. */
-               qla2x00_enqueue_aen(ha, MBA_LOOP_UP, NULL);
                break;
 
        case MBA_LOOP_DOWN:             /* Loop Down Event */
@@ -439,9 +432,6 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
                ha->link_data_rate = LDR_UNKNOWN;
                if (ql2xfdmienable)
                        set_bit(REGISTER_FDMI_NEEDED, &ha->dpc_flags);
-
-               /* Update AEN queue. */
-               qla2x00_enqueue_aen(ha, MBA_LOOP_DOWN, NULL);
                break;
 
        case MBA_LIP_RESET:             /* LIP reset occurred */
@@ -460,10 +450,6 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
 
                ha->operating_mode = LOOP;
                ha->flags.management_server_logged_in = 0;
-
-               /* Update AEN queue. */
-               qla2x00_enqueue_aen(ha, MBA_LIP_RESET, NULL);
-
                break;
 
        case MBA_POINT_TO_POINT:        /* Point-to-Point */
@@ -545,9 +531,6 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
 
                set_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags);
                set_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags);
-
-               /* Update AEN queue. */
-               qla2x00_enqueue_aen(ha, MBA_PORT_UPDATE, NULL);
                break;
 
        case MBA_RSCN_UPDATE:           /* State Change Registration */
@@ -584,9 +567,6 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
 
                set_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags);
                set_bit(RSCN_UPDATE, &ha->dpc_flags);
-
-               /* Update AEN queue. */
-               qla2x00_enqueue_aen(ha, MBA_RSCN_UPDATE, &mb[0]);
                break;
 
        /* case MBA_RIO_RESPONSE: */
@@ -1452,8 +1432,8 @@ qla24xx_ms_entry(scsi_qla_host_t *ha, struct ct_entry_24xx *pkt)
        DEBUG3(printk("%s(%ld): pkt=%p pkthandle=%d.\n",
            __func__, ha->host_no, pkt, pkt->handle));
 
-       DEBUG9(printk("%s: ct pkt dump:\n", __func__);)
-       DEBUG9(qla2x00_dump_buffer((void *)pkt, sizeof(struct ct_entry_24xx));)
+       DEBUG9(printk("%s: ct pkt dump:\n", __func__));
+       DEBUG9(qla2x00_dump_buffer((void *)pkt, sizeof(struct ct_entry_24xx)));
 
        /* Validate handle. */
        if (pkt->handle < MAX_OUTSTANDING_COMMANDS)
index d6cb3bd1a29a4b0277e47c97287730a3b11255b5..879f281e2ea219a0cb580157a8ba8e99a6c66fc9 100644 (file)
@@ -13,13 +13,13 @@ qla2x00_mbx_sem_timeout(unsigned long data)
 {
        struct semaphore        *sem_ptr = (struct semaphore *)data;
 
-       DEBUG11(printk("qla2x00_sem_timeout: entered.\n");)
+       DEBUG11(printk("qla2x00_sem_timeout: entered.\n"));
 
        if (sem_ptr != NULL) {
                up(sem_ptr);
        }
 
-       DEBUG11(printk("qla2x00_mbx_sem_timeout: exiting.\n");)
+       DEBUG11(printk("qla2x00_mbx_sem_timeout: exiting.\n"));
 }
 
 /*
@@ -61,7 +61,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
        rval = QLA_SUCCESS;
        abort_active = test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags);
 
-       DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no);)
+       DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));
 
        /*
         * Wait for active mailbox commands to finish by waiting at most tov
@@ -72,7 +72,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
                if (qla2x00_down_timeout(&ha->mbx_cmd_sem, mcp->tov * HZ)) {
                        /* Timeout occurred. Return error. */
                        DEBUG2_3_11(printk("%s(%ld): cmd access timeout. "
-                           "Exiting.\n", __func__, ha->host_no);)
+                           "Exiting.\n", __func__, ha->host_no));
                        return QLA_FUNCTION_TIMEOUT;
                }
        }
@@ -86,7 +86,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
                spin_lock_irqsave(&ha->mbx_reg_lock, mbx_flags);
 
        DEBUG11(printk("scsi(%ld): prepare to issue mbox cmd=0x%x.\n",
-           ha->host_no, mcp->mb[0]);)
+           ha->host_no, mcp->mb[0]));
 
        spin_lock_irqsave(&ha->hardware_lock, flags);
 
@@ -131,14 +131,14 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
 
        /* Unlock mbx registers and wait for interrupt */
        DEBUG11(printk("%s(%ld): going to unlock irq & waiting for interrupt. "
-           "jiffies=%lx.\n", __func__, ha->host_no, jiffies);)
+           "jiffies=%lx.\n", __func__, ha->host_no, jiffies));
 
        /* Wait for mbx cmd completion until timeout */
 
        if (!abort_active && io_lock_on) {
                /* sleep on completion semaphore */
                DEBUG11(printk("%s(%ld): INTERRUPT MODE. Initializing timer.\n",
-                   __func__, ha->host_no);)
+                   __func__, ha->host_no));
 
                init_timer(&tmp_intr_timer);
                tmp_intr_timer.data = (unsigned long)&ha->mbx_intr_sem;
@@ -147,11 +147,11 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
                    (void (*)(unsigned long))qla2x00_mbx_sem_timeout;
 
                DEBUG11(printk("%s(%ld): Adding timer.\n", __func__,
-                   ha->host_no);)
+                   ha->host_no));
                add_timer(&tmp_intr_timer);
 
                DEBUG11(printk("%s(%ld): going to unlock & sleep. "
-                   "time=0x%lx.\n", __func__, ha->host_no, jiffies);)
+                   "time=0x%lx.\n", __func__, ha->host_no, jiffies));
 
                set_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags);
 
@@ -170,14 +170,14 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
                down(&ha->mbx_intr_sem);
 
                DEBUG11(printk("%s(%ld): waking up. time=0x%lx\n", __func__,
-                   ha->host_no, jiffies);)
+                   ha->host_no, jiffies));
                clear_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags);
 
                /* delete the timer */
                del_timer(&tmp_intr_timer);
        } else {
                DEBUG3_11(printk("%s(%ld): cmd=%x POLLING MODE.\n", __func__,
-                   ha->host_no, command);)
+                   ha->host_no, command));
 
                if (IS_QLA24XX(ha) || IS_QLA54XX(ha))
                        WRT_REG_DWORD(&reg->isp24.hccr, HCCRX_SET_HOST_INT);
@@ -209,7 +209,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
                uint16_t *iptr2;
 
                DEBUG3_11(printk("%s(%ld): cmd %x completed.\n", __func__,
-                   ha->host_no, command);)
+                   ha->host_no, command));
 
                /* Got interrupt. Clear the flag. */
                ha->flags.mbox_int = 0;
@@ -266,7 +266,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
 
        if (!abort_active) {
                DEBUG11(printk("%s(%ld): checking for additional resp "
-                   "interrupt.\n", __func__, ha->host_no);)
+                   "interrupt.\n", __func__, ha->host_no));
 
                /* polling mode for non isp_abort commands. */
                qla2x00_poll(ha);
@@ -277,9 +277,9 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
                if (!io_lock_on || (mcp->flags & IOCTL_CMD)) {
                        /* not in dpc. schedule it for dpc to take over. */
                        DEBUG(printk("%s(%ld): timeout schedule "
-                           "isp_abort_needed.\n", __func__, ha->host_no);)
+                           "isp_abort_needed.\n", __func__, ha->host_no));
                        DEBUG2_3_11(printk("%s(%ld): timeout schedule "
-                           "isp_abort_needed.\n", __func__, ha->host_no);)
+                           "isp_abort_needed.\n", __func__, ha->host_no));
                        qla_printk(KERN_WARNING, ha,
                            "Mailbox command timeout occured. Scheduling ISP "
                            "abort.\n");
@@ -288,9 +288,9 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
                } else if (!abort_active) {
                        /* call abort directly since we are in the DPC thread */
                        DEBUG(printk("%s(%ld): timeout calling abort_isp\n",
-                           __func__, ha->host_no);)
+                           __func__, ha->host_no));
                        DEBUG2_3_11(printk("%s(%ld): timeout calling "
-                           "abort_isp\n", __func__, ha->host_no);)
+                           "abort_isp\n", __func__, ha->host_no));
                        qla_printk(KERN_WARNING, ha,
                            "Mailbox command timeout occured. Issuing ISP "
                            "abort.\n");
@@ -303,9 +303,9 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
                        }
                        clear_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags);
                        DEBUG(printk("%s(%ld): finished abort_isp\n", __func__,
-                           ha->host_no);)
+                           ha->host_no));
                        DEBUG2_3_11(printk("%s(%ld): finished abort_isp\n",
-                           __func__, ha->host_no);)
+                           __func__, ha->host_no));
                }
        }
 
@@ -316,9 +316,9 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
        if (rval) {
                DEBUG2_3_11(printk("%s(%ld): **** FAILED. mbx0=%x, mbx1=%x, "
                    "mbx2=%x, cmd=%x ****\n", __func__, ha->host_no,
-                   mcp->mb[0], mcp->mb[1], mcp->mb[2], command);)
+                   mcp->mb[0], mcp->mb[1], mcp->mb[2], command));
        } else {
-               DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no);)
+               DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no));
        }
 
        return rval;
@@ -394,7 +394,7 @@ qla2x00_execute_fw(scsi_qla_host_t *ha, uint32_t risc_addr)
        mbx_cmd_t mc;
        mbx_cmd_t *mcp = &mc;
 
-       DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no);)
+       DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));
 
        mcp->mb[0] = MBC_EXECUTE_FIRMWARE;
        mcp->out_mb = MBX_0;
@@ -424,10 +424,10 @@ qla2x00_execute_fw(scsi_qla_host_t *ha, uint32_t risc_addr)
        } else {
                if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
                        DEBUG11(printk("%s(%ld): done exchanges=%x.\n",
-                           __func__, ha->host_no, mcp->mb[1]);)
+                           __func__, ha->host_no, mcp->mb[1]));
                } else {
                        DEBUG11(printk("%s(%ld): done.\n", __func__,
-                           ha->host_no);)
+                           ha->host_no));
                }
        }
 
@@ -611,7 +611,7 @@ qla2x00_mbx_reg_test(scsi_qla_host_t *ha)
        mbx_cmd_t mc;
        mbx_cmd_t *mcp = &mc;
 
-       DEBUG11(printk("qla2x00_mbx_reg_test(%ld): entered.\n", ha->host_no);)
+       DEBUG11(printk("qla2x00_mbx_reg_test(%ld): entered.\n", ha->host_no));
 
        mcp->mb[0] = MBC_MAILBOX_REGISTER_TEST;
        mcp->mb[1] = 0xAAAA;
@@ -639,11 +639,11 @@ qla2x00_mbx_reg_test(scsi_qla_host_t *ha)
        if (rval != QLA_SUCCESS) {
                /*EMPTY*/
                DEBUG2_3_11(printk("qla2x00_mbx_reg_test(%ld): failed=%x.\n",
-                   ha->host_no, rval);)
+                   ha->host_no, rval));
        } else {
                /*EMPTY*/
                DEBUG11(printk("qla2x00_mbx_reg_test(%ld): done.\n",
-                   ha->host_no);)
+                   ha->host_no));
        }
 
        return rval;
@@ -671,7 +671,7 @@ qla2x00_verify_checksum(scsi_qla_host_t *ha, uint32_t risc_addr)
        mbx_cmd_t mc;
        mbx_cmd_t *mcp = &mc;
 
-       DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no);)
+       DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));
 
        mcp->mb[0] = MBC_VERIFY_CHECKSUM;
        mcp->out_mb = MBX_0;
@@ -694,9 +694,9 @@ qla2x00_verify_checksum(scsi_qla_host_t *ha, uint32_t risc_addr)
        if (rval != QLA_SUCCESS) {
                DEBUG2_3_11(printk("%s(%ld): failed=%x chk sum=%x.\n", __func__,
                    ha->host_no, rval, (IS_QLA24XX(ha) || IS_QLA54XX(ha) ?
-                   (mcp->mb[2] << 16) | mcp->mb[1]: mcp->mb[1]));)
+                   (mcp->mb[2] << 16) | mcp->mb[1]: mcp->mb[1])));
        } else {
-               DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no);)
+               DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no));
        }
 
        return rval;
@@ -743,9 +743,9 @@ qla2x00_issue_iocb(scsi_qla_host_t *ha, void*  buffer, dma_addr_t phys_addr,
        if (rval != QLA_SUCCESS) {
                /*EMPTY*/
                DEBUG(printk("qla2x00_issue_iocb(%ld): failed rval 0x%x\n",
-                   ha->host_no, rval);)
+                   ha->host_no, rval));
                DEBUG2(printk("qla2x00_issue_iocb(%ld): failed rval 0x%x\n",
-                   ha->host_no, rval);)
+                   ha->host_no, rval));
        } else {
                sts_entry_t *sts_entry = (sts_entry_t *) buffer;
 
@@ -781,7 +781,7 @@ qla2x00_abort_command(scsi_qla_host_t *ha, srb_t *sp)
        mbx_cmd_t       mc;
        mbx_cmd_t       *mcp = &mc;
 
-       DEBUG11(printk("qla2x00_abort_command(%ld): entered.\n", ha->host_no);)
+       DEBUG11(printk("qla2x00_abort_command(%ld): entered.\n", ha->host_no));
 
        fcport = sp->fcport;
 
@@ -813,11 +813,11 @@ qla2x00_abort_command(scsi_qla_host_t *ha, srb_t *sp)
 
        if (rval != QLA_SUCCESS) {
                DEBUG2_3_11(printk("qla2x00_abort_command(%ld): failed=%x.\n",
-                   ha->host_no, rval);)
+                   ha->host_no, rval));
        } else {
                sp->flags |= SRB_ABORT_PENDING;
                DEBUG11(printk("qla2x00_abort_command(%ld): done.\n",
-                   ha->host_no);)
+                   ha->host_no));
        }
 
        return rval;
@@ -848,7 +848,7 @@ qla2x00_abort_target(fc_port_t *fcport)
        if (fcport == NULL)
                return 0;
 
-       DEBUG11(printk("%s(%ld): entered.\n", __func__, fcport->ha->host_no);)
+       DEBUG11(printk("%s(%ld): entered.\n", __func__, fcport->ha->host_no));
 
        ha = fcport->ha;
        mcp->mb[0] = MBC_ABORT_TARGET;
@@ -872,11 +872,11 @@ qla2x00_abort_target(fc_port_t *fcport)
 
        if (rval != QLA_SUCCESS) {
                DEBUG2_3_11(printk("qla2x00_abort_target(%ld): failed=%x.\n",
-                   ha->host_no, rval);)
+                   ha->host_no, rval));
        } else {
                /*EMPTY*/
                DEBUG11(printk("qla2x00_abort_target(%ld): done.\n",
-                   ha->host_no);)
+                   ha->host_no));
        }
 
        return rval;
@@ -912,7 +912,7 @@ qla2x00_get_adapter_id(scsi_qla_host_t *ha, uint16_t *id, uint8_t *al_pa,
        mbx_cmd_t *mcp = &mc;
 
        DEBUG11(printk("qla2x00_get_adapter_id(%ld): entered.\n",
-           ha->host_no);)
+           ha->host_no));
 
        mcp->mb[0] = MBC_GET_ADAPTER_LOOP_ID;
        mcp->out_mb = MBX_0;
@@ -933,11 +933,11 @@ qla2x00_get_adapter_id(scsi_qla_host_t *ha, uint16_t *id, uint8_t *al_pa,
        if (rval != QLA_SUCCESS) {
                /*EMPTY*/
                DEBUG2_3_11(printk("qla2x00_get_adapter_id(%ld): failed=%x.\n",
-                   ha->host_no, rval);)
+                   ha->host_no, rval));
        } else {
                /*EMPTY*/
                DEBUG11(printk("qla2x00_get_adapter_id(%ld): done.\n",
-                   ha->host_no);)
+                   ha->host_no));
        }
 
        return rval;
@@ -968,7 +968,7 @@ qla2x00_get_retry_cnt(scsi_qla_host_t *ha, uint8_t *retry_cnt, uint8_t *tov,
        mbx_cmd_t *mcp = &mc;
 
        DEBUG11(printk("qla2x00_get_retry_cnt(%ld): entered.\n",
-                       ha->host_no);)
+                       ha->host_no));
 
        mcp->mb[0] = MBC_GET_RETRY_COUNT;
        mcp->out_mb = MBX_0;
@@ -980,7 +980,7 @@ qla2x00_get_retry_cnt(scsi_qla_host_t *ha, uint8_t *retry_cnt, uint8_t *tov,
        if (rval != QLA_SUCCESS) {
                /*EMPTY*/
                DEBUG2_3_11(printk("qla2x00_get_retry_cnt(%ld): failed = %x.\n",
-                   ha->host_no, mcp->mb[0]);)
+                   ha->host_no, mcp->mb[0]));
        } else {
                /* Convert returned data and check our values. */
                *r_a_tov = mcp->mb[3] / 2;
@@ -992,7 +992,7 @@ qla2x00_get_retry_cnt(scsi_qla_host_t *ha, uint8_t *retry_cnt, uint8_t *tov,
                }
 
                DEBUG11(printk("qla2x00_get_retry_cnt(%ld): done. mb3=%d "
-                   "ratov=%d.\n", ha->host_no, mcp->mb[3], ratov);)
+                   "ratov=%d.\n", ha->host_no, mcp->mb[3], ratov));
        }
 
        return rval;
@@ -1023,7 +1023,7 @@ qla2x00_init_firmware(scsi_qla_host_t *ha, uint16_t size)
        mbx_cmd_t *mcp = &mc;
 
        DEBUG11(printk("qla2x00_init_firmware(%ld): entered.\n",
-           ha->host_no);)
+           ha->host_no));
 
        mcp->mb[0] = MBC_INITIALIZE_FIRMWARE;
        mcp->mb[2] = MSW(ha->init_cb_dma);
@@ -1043,11 +1043,11 @@ qla2x00_init_firmware(scsi_qla_host_t *ha, uint16_t size)
                /*EMPTY*/
                DEBUG2_3_11(printk("qla2x00_init_firmware(%ld): failed=%x "
                    "mb0=%x.\n",
-                   ha->host_no, rval, mcp->mb[0]);)
+                   ha->host_no, rval, mcp->mb[0]));
        } else {
                /*EMPTY*/
                DEBUG11(printk("qla2x00_init_firmware(%ld): done.\n",
-                   ha->host_no);)
+                   ha->host_no));
        }
 
        return rval;
@@ -1079,7 +1079,7 @@ qla2x00_get_port_database(scsi_qla_host_t *ha, fc_port_t *fcport, uint8_t opt)
        struct port_database_24xx *pd24;
        dma_addr_t pd_dma;
 
-       DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no);)
+       DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));
 
        pd24 = NULL;
        pd = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, &pd_dma);
@@ -1220,7 +1220,7 @@ qla2x00_get_firmware_state(scsi_qla_host_t *ha, uint16_t *dptr)
        mbx_cmd_t *mcp = &mc;
 
        DEBUG11(printk("qla2x00_get_firmware_state(%ld): entered.\n",
-           ha->host_no);)
+           ha->host_no));
 
        mcp->mb[0] = MBC_GET_FIRMWARE_STATE;
        mcp->out_mb = MBX_0;
@@ -1235,11 +1235,11 @@ qla2x00_get_firmware_state(scsi_qla_host_t *ha, uint16_t *dptr)
        if (rval != QLA_SUCCESS) {
                /*EMPTY*/
                DEBUG2_3_11(printk("qla2x00_get_firmware_state(%ld): "
-                   "failed=%x.\n", ha->host_no, rval);)
+                   "failed=%x.\n", ha->host_no, rval));
        } else {
                /*EMPTY*/
                DEBUG11(printk("qla2x00_get_firmware_state(%ld): done.\n",
-                   ha->host_no);)
+                   ha->host_no));
        }
 
        return rval;
@@ -1272,7 +1272,7 @@ qla2x00_get_port_name(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t *name,
        mbx_cmd_t *mcp = &mc;
 
        DEBUG11(printk("qla2x00_get_port_name(%ld): entered.\n",
-           ha->host_no);)
+           ha->host_no));
 
        mcp->mb[0] = MBC_GET_PORT_NAME;
        mcp->out_mb = MBX_1|MBX_0;
@@ -1292,7 +1292,7 @@ qla2x00_get_port_name(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t *name,
        if (rval != QLA_SUCCESS) {
                /*EMPTY*/
                DEBUG2_3_11(printk("qla2x00_get_port_name(%ld): failed=%x.\n",
-                   ha->host_no, rval);)
+                   ha->host_no, rval));
        } else {
                if (name != NULL) {
                        /* This function returns name in big endian. */
@@ -1307,7 +1307,7 @@ qla2x00_get_port_name(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t *name,
                }
 
                DEBUG11(printk("qla2x00_get_port_name(%ld): done.\n",
-                   ha->host_no);)
+                   ha->host_no));
        }
 
        return rval;
@@ -1335,7 +1335,7 @@ qla2x00_lip_reset(scsi_qla_host_t *ha)
        mbx_cmd_t mc;
        mbx_cmd_t *mcp = &mc;
 
-       DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no);)
+       DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));
 
        if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
                mcp->mb[0] = MBC_LIP_FULL_LOGIN;
@@ -1364,10 +1364,10 @@ qla2x00_lip_reset(scsi_qla_host_t *ha)
        if (rval != QLA_SUCCESS) {
                /*EMPTY*/
                DEBUG2_3_11(printk("%s(%ld): failed=%x.\n",
-                   __func__, ha->host_no, rval);)
+                   __func__, ha->host_no, rval));
        } else {
                /*EMPTY*/
-               DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no);)
+               DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no));
        }
 
        return rval;
@@ -1400,10 +1400,10 @@ qla2x00_send_sns(scsi_qla_host_t *ha, dma_addr_t sns_phys_address,
        mbx_cmd_t *mcp = &mc;
 
        DEBUG11(printk("qla2x00_send_sns(%ld): entered.\n",
-           ha->host_no);)
+           ha->host_no));
 
        DEBUG11(printk("qla2x00_send_sns: retry cnt=%d ratov=%d total "
-           "tov=%d.\n", ha->retry_count, ha->login_timeout, mcp->tov);)
+           "tov=%d.\n", ha->retry_count, ha->login_timeout, mcp->tov));
 
        mcp->mb[0] = MBC_SEND_SNS_COMMAND;
        mcp->mb[1] = cmd_size;
@@ -1421,12 +1421,12 @@ qla2x00_send_sns(scsi_qla_host_t *ha, dma_addr_t sns_phys_address,
        if (rval != QLA_SUCCESS) {
                /*EMPTY*/
                DEBUG(printk("qla2x00_send_sns(%ld): failed=%x mb[0]=%x "
-                   "mb[1]=%x.\n", ha->host_no, rval, mcp->mb[0], mcp->mb[1]);)
+                   "mb[1]=%x.\n", ha->host_no, rval, mcp->mb[0], mcp->mb[1]));
                DEBUG2_3_11(printk("qla2x00_send_sns(%ld): failed=%x mb[0]=%x "
-                   "mb[1]=%x.\n", ha->host_no, rval, mcp->mb[0], mcp->mb[1]);)
+                   "mb[1]=%x.\n", ha->host_no, rval, mcp->mb[0], mcp->mb[1]));
        } else {
                /*EMPTY*/
-               DEBUG11(printk("qla2x00_send_sns(%ld): done.\n", ha->host_no);)
+               DEBUG11(printk("qla2x00_send_sns(%ld): done.\n", ha->host_no));
        }
 
        return rval;
@@ -1442,7 +1442,7 @@ qla24xx_login_fabric(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t domain,
        dma_addr_t      lg_dma;
        uint32_t        iop[2];
 
-       DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no);)
+       DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));
 
        lg = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, &lg_dma);
        if (lg == NULL) {
@@ -1458,13 +1458,15 @@ qla24xx_login_fabric(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t domain,
        lg->control_flags = __constant_cpu_to_le16(LCF_COMMAND_PLOGI);
        if (opt & BIT_0)
                lg->control_flags |= __constant_cpu_to_le16(LCF_COND_PLOGI);
+       if (opt & BIT_1)
+               lg->control_flags |= __constant_cpu_to_le16(LCF_SKIP_PRLI);
        lg->port_id[0] = al_pa;
        lg->port_id[1] = area;
        lg->port_id[2] = domain;
        rval = qla2x00_issue_iocb(ha, lg, lg_dma, 0);
        if (rval != QLA_SUCCESS) {
                DEBUG2_3_11(printk("%s(%ld): failed to issue Login IOCB "
-                   "(%x).\n", __func__, ha->host_no, rval);)
+                   "(%x).\n", __func__, ha->host_no, rval));
        } else if (lg->entry_status != 0) {
                DEBUG2_3_11(printk("%s(%ld): failed to complete IOCB "
                    "-- error status (%x).\n", __func__, ha->host_no,
@@ -1505,7 +1507,7 @@ qla24xx_login_fabric(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t domain,
                        break;
                }
        } else {
-               DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no);)
+               DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no));
 
                iop[0] = le32_to_cpu(lg->io_parameter[0]);
 
@@ -1559,7 +1561,7 @@ qla2x00_login_fabric(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t domain,
        mbx_cmd_t mc;
        mbx_cmd_t *mcp = &mc;
 
-       DEBUG11(printk("qla2x00_login_fabric(%ld): entered.\n", ha->host_no);)
+       DEBUG11(printk("qla2x00_login_fabric(%ld): entered.\n", ha->host_no));
 
        mcp->mb[0] = MBC_LOGIN_FABRIC_PORT;
        mcp->out_mb = MBX_3|MBX_2|MBX_1|MBX_0;
@@ -1604,11 +1606,11 @@ qla2x00_login_fabric(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t domain,
                /*EMPTY*/
                DEBUG2_3_11(printk("qla2x00_login_fabric(%ld): failed=%x "
                    "mb[0]=%x mb[1]=%x mb[2]=%x.\n", ha->host_no, rval,
-                   mcp->mb[0], mcp->mb[1], mcp->mb[2]);)
+                   mcp->mb[0], mcp->mb[1], mcp->mb[2]));
        } else {
                /*EMPTY*/
                DEBUG11(printk("qla2x00_login_fabric(%ld): done.\n",
-                   ha->host_no);)
+                   ha->host_no));
        }
 
        return rval;
@@ -1643,7 +1645,7 @@ qla2x00_login_local_device(scsi_qla_host_t *ha, fc_port_t *fcport,
                    fcport->d_id.b.domain, fcport->d_id.b.area,
                    fcport->d_id.b.al_pa, mb_ret, opt);
 
-       DEBUG3(printk("%s(%ld): entered.\n", __func__, ha->host_no);)
+       DEBUG3(printk("%s(%ld): entered.\n", __func__, ha->host_no));
 
        mcp->mb[0] = MBC_LOGIN_LOOP_PORT;
        if (HAS_EXTENDED_IDS(ha))
@@ -1677,13 +1679,13 @@ qla2x00_login_local_device(scsi_qla_host_t *ha, fc_port_t *fcport,
 
                DEBUG(printk("%s(%ld): failed=%x mb[0]=%x mb[1]=%x "
                    "mb[6]=%x mb[7]=%x.\n", __func__, ha->host_no, rval,
-                   mcp->mb[0], mcp->mb[1], mcp->mb[6], mcp->mb[7]);)
+                   mcp->mb[0], mcp->mb[1], mcp->mb[6], mcp->mb[7]));
                DEBUG2_3(printk("%s(%ld): failed=%x mb[0]=%x mb[1]=%x "
                    "mb[6]=%x mb[7]=%x.\n", __func__, ha->host_no, rval,
-                   mcp->mb[0], mcp->mb[1], mcp->mb[6], mcp->mb[7]);)
+                   mcp->mb[0], mcp->mb[1], mcp->mb[6], mcp->mb[7]));
        } else {
                /*EMPTY*/
-               DEBUG3(printk("%s(%ld): done.\n", __func__, ha->host_no);)
+               DEBUG3(printk("%s(%ld): done.\n", __func__, ha->host_no));
        }
 
        return (rval);
@@ -1697,7 +1699,7 @@ qla24xx_fabric_logout(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t domain,
        struct logio_entry_24xx *lg;
        dma_addr_t      lg_dma;
 
-       DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no);)
+       DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));
 
        lg = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, &lg_dma);
        if (lg == NULL) {
@@ -1718,7 +1720,7 @@ qla24xx_fabric_logout(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t domain,
        rval = qla2x00_issue_iocb(ha, lg, lg_dma, 0);
        if (rval != QLA_SUCCESS) {
                DEBUG2_3_11(printk("%s(%ld): failed to issue Logout IOCB "
-                   "(%x).\n", __func__, ha->host_no, rval);)
+                   "(%x).\n", __func__, ha->host_no, rval));
        } else if (lg->entry_status != 0) {
                DEBUG2_3_11(printk("%s(%ld): failed to complete IOCB "
                    "-- error status (%x).\n", __func__, ha->host_no,
@@ -1729,10 +1731,10 @@ qla24xx_fabric_logout(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t domain,
                    "-- completion status (%x)  ioparam=%x/%x.\n", __func__,
                    ha->host_no, le16_to_cpu(lg->comp_status),
                    le32_to_cpu(lg->io_parameter[0]),
-                   le32_to_cpu(lg->io_parameter[1]));)
+                   le32_to_cpu(lg->io_parameter[1])));
        } else {
                /*EMPTY*/
-               DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no);)
+               DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no));
        }
 
        dma_pool_free(ha->s_dma_pool, lg, lg_dma);
@@ -1765,7 +1767,7 @@ qla2x00_fabric_logout(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t domain,
        mbx_cmd_t *mcp = &mc;
 
        DEBUG11(printk("qla2x00_fabric_logout(%ld): entered.\n",
-           ha->host_no);)
+           ha->host_no));
 
        mcp->mb[0] = MBC_LOGOUT_FABRIC_PORT;
        mcp->out_mb = MBX_1|MBX_0;
@@ -1785,11 +1787,11 @@ qla2x00_fabric_logout(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t domain,
        if (rval != QLA_SUCCESS) {
                /*EMPTY*/
                DEBUG2_3_11(printk("qla2x00_fabric_logout(%ld): failed=%x "
-                   "mbx1=%x.\n", ha->host_no, rval, mcp->mb[1]);)
+                   "mbx1=%x.\n", ha->host_no, rval, mcp->mb[1]));
        } else {
                /*EMPTY*/
                DEBUG11(printk("qla2x00_fabric_logout(%ld): done.\n",
-                   ha->host_no);)
+                   ha->host_no));
        }
 
        return rval;
@@ -1818,7 +1820,7 @@ qla2x00_full_login_lip(scsi_qla_host_t *ha)
        mbx_cmd_t *mcp = &mc;
 
        DEBUG11(printk("qla2x00_full_login_lip(%ld): entered.\n",
-           ha->host_no);)
+           ha->host_no));
 
        mcp->mb[0] = MBC_LIP_FULL_LOGIN;
        mcp->mb[1] = 0;
@@ -1833,11 +1835,11 @@ qla2x00_full_login_lip(scsi_qla_host_t *ha)
        if (rval != QLA_SUCCESS) {
                /*EMPTY*/
                DEBUG2_3_11(printk("qla2x00_full_login_lip(%ld): failed=%x.\n",
-                   ha->host_no, rval);)
+                   ha->host_no, rval));
        } else {
                /*EMPTY*/
                DEBUG11(printk("qla2x00_full_login_lip(%ld): done.\n",
-                   ha->host_no);)
+                   ha->host_no));
        }
 
        return rval;
@@ -1864,7 +1866,7 @@ qla2x00_get_id_list(scsi_qla_host_t *ha, void *id_list, dma_addr_t id_list_dma,
        mbx_cmd_t *mcp = &mc;
 
        DEBUG11(printk("qla2x00_get_id_list(%ld): entered.\n",
-           ha->host_no);)
+           ha->host_no));
 
        if (id_list == NULL)
                return QLA_FUNCTION_FAILED;
@@ -1893,11 +1895,11 @@ qla2x00_get_id_list(scsi_qla_host_t *ha, void *id_list, dma_addr_t id_list_dma,
        if (rval != QLA_SUCCESS) {
                /*EMPTY*/
                DEBUG2_3_11(printk("qla2x00_get_id_list(%ld): failed=%x.\n",
-                   ha->host_no, rval);)
+                   ha->host_no, rval));
        } else {
                *entries = mcp->mb[1];
                DEBUG11(printk("qla2x00_get_id_list(%ld): done.\n",
-                   ha->host_no);)
+                   ha->host_no));
        }
 
        return rval;
@@ -1936,7 +1938,7 @@ qla2x00_get_resource_cnts(scsi_qla_host_t *ha, uint16_t *cur_xchg_cnt,
        if (rval != QLA_SUCCESS) {
                /*EMPTY*/
                DEBUG2_3_11(printk("%s(%ld): failed = %x.\n", __func__,
-                   ha->host_no, mcp->mb[0]);)
+                   ha->host_no, mcp->mb[0]));
        } else {
                DEBUG11(printk("%s(%ld): done. mb1=%x mb2=%x mb3=%x mb6=%x "
                    "mb7=%x mb10=%x.\n", __func__, ha->host_no,
@@ -2045,7 +2047,7 @@ qla2x00_get_link_status(scsi_qla_host_t *ha, uint16_t loop_id,
        link_stat_t *stat_buf;
        dma_addr_t stat_buf_dma;
 
-       DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no);)
+       DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));
 
        stat_buf = dma_pool_alloc(ha->s_dma_pool, GFP_ATOMIC, &stat_buf_dma);
        if (stat_buf == NULL) {
@@ -2083,7 +2085,7 @@ qla2x00_get_link_status(scsi_qla_host_t *ha, uint16_t loop_id,
        if (rval == QLA_SUCCESS) {
                if (mcp->mb[0] != MBS_COMMAND_COMPLETE) {
                        DEBUG2_3_11(printk("%s(%ld): cmd failed. mbx0=%x.\n",
-                           __func__, ha->host_no, mcp->mb[0]);)
+                           __func__, ha->host_no, mcp->mb[0]));
                        status[0] = mcp->mb[0];
                        rval = BIT_1;
                } else {
@@ -2108,12 +2110,12 @@ qla2x00_get_link_status(scsi_qla_host_t *ha, uint16_t loop_id,
                            stat_buf->loss_sync_cnt, stat_buf->loss_sig_cnt,
                            stat_buf->prim_seq_err_cnt,
                            stat_buf->inval_xmit_word_cnt,
-                           stat_buf->inval_crc_cnt);)
+                           stat_buf->inval_crc_cnt));
                }
        } else {
                /* Failed. */
                DEBUG2_3_11(printk("%s(%ld): failed=%x.\n", __func__,
-                   ha->host_no, rval);)
+                   ha->host_no, rval));
                rval = BIT_1;
        }
 
@@ -2132,7 +2134,7 @@ qla24xx_get_isp_stats(scsi_qla_host_t *ha, uint32_t *dwbuf, uint32_t dwords,
        uint32_t *sbuf, *siter;
        dma_addr_t sbuf_dma;
 
-       DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no);)
+       DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));
 
        if (dwords > (DMA_POOL_SIZE / 4)) {
                DEBUG2_3_11(printk("%s(%ld): Unabled to retrieve %d DWORDs "
@@ -2196,7 +2198,7 @@ qla24xx_abort_command(scsi_qla_host_t *ha, srb_t *sp)
        dma_addr_t      abt_dma;
        uint32_t        handle;
 
-       DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no);)
+       DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));
 
        fcport = sp->fcport;
 
@@ -2229,7 +2231,7 @@ qla24xx_abort_command(scsi_qla_host_t *ha, srb_t *sp)
        rval = qla2x00_issue_iocb(ha, abt, abt_dma, 0);
        if (rval != QLA_SUCCESS) {
                DEBUG2_3_11(printk("%s(%ld): failed to issue IOCB (%x).\n",
-                   __func__, ha->host_no, rval);)
+                   __func__, ha->host_no, rval));
        } else if (abt->entry_status != 0) {
                DEBUG2_3_11(printk("%s(%ld): failed to complete IOCB "
                    "-- error status (%x).\n", __func__, ha->host_no,
@@ -2238,10 +2240,10 @@ qla24xx_abort_command(scsi_qla_host_t *ha, srb_t *sp)
        } else if (abt->nport_handle != __constant_cpu_to_le16(0)) {
                DEBUG2_3_11(printk("%s(%ld): failed to complete IOCB "
                    "-- completion status (%x).\n", __func__, ha->host_no,
-                   le16_to_cpu(abt->nport_handle));)
+                   le16_to_cpu(abt->nport_handle)));
                rval = QLA_FUNCTION_FAILED;
        } else {
-               DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no);)
+               DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no));
                sp->flags |= SRB_ABORT_PENDING;
        }
 
@@ -2268,7 +2270,7 @@ qla24xx_abort_target(fc_port_t *fcport)
        if (fcport == NULL)
                return 0;
 
-       DEBUG11(printk("%s(%ld): entered.\n", __func__, fcport->ha->host_no);)
+       DEBUG11(printk("%s(%ld): entered.\n", __func__, fcport->ha->host_no));
 
        ha = fcport->ha;
        tsk = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, &tsk_dma);
@@ -2290,7 +2292,7 @@ qla24xx_abort_target(fc_port_t *fcport)
        rval = qla2x00_issue_iocb(ha, tsk, tsk_dma, 0);
        if (rval != QLA_SUCCESS) {
                DEBUG2_3_11(printk("%s(%ld): failed to issue Target Reset IOCB "
-                   "(%x).\n", __func__, ha->host_no, rval);)
+                   "(%x).\n", __func__, ha->host_no, rval));
                goto atarget_done;
        } else if (tsk->p.sts.entry_status != 0) {
                DEBUG2_3_11(printk("%s(%ld): failed to complete IOCB "
@@ -2302,7 +2304,7 @@ qla24xx_abort_target(fc_port_t *fcport)
            __constant_cpu_to_le16(CS_COMPLETE)) {
                DEBUG2_3_11(printk("%s(%ld): failed to complete IOCB "
                    "-- completion status (%x).\n", __func__,
-                   ha->host_no, le16_to_cpu(tsk->p.sts.comp_status));)
+                   ha->host_no, le16_to_cpu(tsk->p.sts.comp_status)));
                rval = QLA_FUNCTION_FAILED;
                goto atarget_done;
        }
@@ -2311,9 +2313,9 @@ qla24xx_abort_target(fc_port_t *fcport)
        rval = qla2x00_marker(ha, fcport->loop_id, 0, MK_SYNC_ID);
        if (rval != QLA_SUCCESS) {
                DEBUG2_3_11(printk("%s(%ld): failed to issue Marker IOCB "
-                   "(%x).\n", __func__, ha->host_no, rval);)
+                   "(%x).\n", __func__, ha->host_no, rval));
        } else {
-               DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no);)
+               DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no));
        }
 
 atarget_done:
@@ -2460,3 +2462,81 @@ qla2x00_stop_firmware(scsi_qla_host_t *ha)
 
        return rval;
 }
+
+int
+qla2x00_trace_control(scsi_qla_host_t *ha, uint16_t ctrl, dma_addr_t eft_dma,
+    uint16_t buffers)
+{
+       int rval;
+       mbx_cmd_t mc;
+       mbx_cmd_t *mcp = &mc;
+
+       if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha))
+               return QLA_FUNCTION_FAILED;
+
+       DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));
+
+       mcp->mb[0] = MBC_TRACE_CONTROL;
+       mcp->mb[1] = ctrl;
+       mcp->out_mb = MBX_1|MBX_0;
+       mcp->in_mb = MBX_1|MBX_0;
+       if (ctrl == TC_ENABLE) {
+               mcp->mb[2] = LSW(eft_dma);
+               mcp->mb[3] = MSW(eft_dma);
+               mcp->mb[4] = LSW(MSD(eft_dma));
+               mcp->mb[5] = MSW(MSD(eft_dma));
+               mcp->mb[6] = buffers;
+               mcp->mb[7] = buffers;
+               mcp->out_mb |= MBX_7|MBX_6|MBX_5|MBX_4|MBX_3|MBX_2;
+       }
+       mcp->tov = 30;
+       mcp->flags = 0;
+       rval = qla2x00_mailbox_command(ha, mcp);
+
+       if (rval != QLA_SUCCESS) {
+               DEBUG2_3_11(printk("%s(%ld): failed=%x mb[0]=%x mb[1]=%x.\n",
+                   __func__, ha->host_no, rval, mcp->mb[0], mcp->mb[1]));
+       } else {
+               DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no));
+       }
+
+       return rval;
+}
+
+int
+qla2x00_read_sfp(scsi_qla_host_t *ha, dma_addr_t sfp_dma, uint16_t addr,
+    uint16_t off, uint16_t count)
+{
+       int rval;
+       mbx_cmd_t mc;
+       mbx_cmd_t *mcp = &mc;
+
+       if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha))
+               return QLA_FUNCTION_FAILED;
+
+       DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));
+
+       mcp->mb[0] = MBC_READ_SFP;
+       mcp->mb[1] = addr;
+       mcp->mb[2] = MSW(sfp_dma);
+       mcp->mb[3] = LSW(sfp_dma);
+       mcp->mb[6] = MSW(MSD(sfp_dma));
+       mcp->mb[7] = LSW(MSD(sfp_dma));
+       mcp->mb[8] = count;
+       mcp->mb[9] = off;
+       mcp->mb[10] = 0;
+       mcp->out_mb = MBX_10|MBX_9|MBX_8|MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0;
+       mcp->in_mb = MBX_0;
+       mcp->tov = 30;
+       mcp->flags = 0;
+       rval = qla2x00_mailbox_command(ha, mcp);
+
+       if (rval != QLA_SUCCESS) {
+               DEBUG2_3_11(printk("%s(%ld): failed=%x (%x).\n", __func__,
+                   ha->host_no, rval, mcp->mb[0]));
+       } else {
+               DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no));
+       }
+
+       return rval;
+}
index ccaad0b08d35a4108e58daed4767ad0f0a2c2abb..ec7ebb6037e618232c84bc68578c9a2a8baec563 100644 (file)
@@ -39,14 +39,14 @@ MODULE_PARM_DESC(ql2xlogintimeout,
 int qlport_down_retry = 30;
 module_param(qlport_down_retry, int, S_IRUGO|S_IRUSR);
 MODULE_PARM_DESC(qlport_down_retry,
-               "Maximum number of command retries to a port that returns"
+               "Maximum number of command retries to a port that returns "
                "a PORT-DOWN status.");
 
 int ql2xplogiabsentdevice;
 module_param(ql2xplogiabsentdevice, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(ql2xplogiabsentdevice,
                "Option to enable PLOGI to devices that are not present after "
-               "a Fabric scan.  This is needed for several broken switches."
+               "a Fabric scan.  This is needed for several broken switches. "
                "Default is 0 - no PLOGI. 1 - perfom PLOGI.");
 
 int ql2xloginretrycount = 0;
@@ -54,6 +54,19 @@ module_param(ql2xloginretrycount, int, S_IRUGO|S_IRUSR);
 MODULE_PARM_DESC(ql2xloginretrycount,
                "Specify an alternate value for the NVRAM login retry count.");
 
+int ql2xallocfwdump = 1;
+module_param(ql2xallocfwdump, int, S_IRUGO|S_IRUSR);
+MODULE_PARM_DESC(ql2xallocfwdump,
+               "Option to enable allocation of memory for a firmware dump "
+               "during HBA initialization.  Memory allocation requirements "
+               "vary by ISP type.  Default is 1 - allocate memory.");
+
+int extended_error_logging;
+module_param(extended_error_logging, int, S_IRUGO|S_IRUSR);
+MODULE_PARM_DESC(extended_error_logging,
+               "Option to enable extended error logging, "
+               "Default is 0 - no logging. 1 - log errors.");
+
 static void qla2x00_free_device(scsi_qla_host_t *);
 
 static void qla2x00_config_dma_addressing(scsi_qla_host_t *ha);
@@ -624,7 +637,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
 
                DEBUG2(printk("%s(%ld): aborting sp %p from RISC. pid=%ld.\n",
                    __func__, ha->host_no, sp, serial));
-               DEBUG3(qla2x00_print_scsi_cmd(cmd);)
+               DEBUG3(qla2x00_print_scsi_cmd(cmd));
 
                spin_unlock_irqrestore(&ha->hardware_lock, flags);
                if (ha->isp_ops.abort_command(ha, sp)) {
@@ -766,7 +779,7 @@ qla2xxx_eh_device_reset(struct scsi_cmnd *cmd)
 #endif
        } else {
                DEBUG2(printk(KERN_INFO
-                   "%s failed: loop not ready\n",__func__);)
+                   "%s failed: loop not ready\n",__func__));
        }
 
        if (ret == FAILED) {
@@ -1021,12 +1034,12 @@ qla2x00_loop_reset(scsi_qla_host_t *ha)
                /* Empty */
                DEBUG2_3(printk("%s(%ld): **** FAILED ****\n",
                                __func__,
-                               ha->host_no);)
+                               ha->host_no));
        } else {
                /* Empty */
                DEBUG3(printk("%s(%ld): exiting normally.\n",
                                __func__,
-                               ha->host_no);)
+                               ha->host_no));
        }
 
        return(status);
@@ -1324,7 +1337,8 @@ qla24xx_disable_intrs(scsi_qla_host_t *ha)
 /*
  * PCI driver interface
  */
-static int qla2x00_probe_one(struct pci_dev *pdev)
+static int __devinit
+qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 {
        int     ret = -ENODEV;
        device_reg_t __iomem *reg;
@@ -1405,7 +1419,6 @@ static int qla2x00_probe_one(struct pci_dev *pdev)
        ha->isp_ops.read_nvram          = qla2x00_read_nvram_data;
        ha->isp_ops.write_nvram         = qla2x00_write_nvram_data;
        ha->isp_ops.fw_dump             = qla2100_fw_dump;
-       ha->isp_ops.ascii_fw_dump       = qla2100_ascii_fw_dump;
        ha->isp_ops.read_optrom         = qla2x00_read_optrom_data;
        ha->isp_ops.write_optrom        = qla2x00_write_optrom_data;
        if (IS_QLA2100(ha)) {
@@ -1432,7 +1445,6 @@ static int qla2x00_probe_one(struct pci_dev *pdev)
                ha->isp_ops.pci_config = qla2300_pci_config;
                ha->isp_ops.intr_handler = qla2300_intr_handler;
                ha->isp_ops.fw_dump = qla2300_fw_dump;
-               ha->isp_ops.ascii_fw_dump = qla2300_ascii_fw_dump;
                ha->isp_ops.beacon_on = qla2x00_beacon_on;
                ha->isp_ops.beacon_off = qla2x00_beacon_off;
                ha->isp_ops.beacon_blink = qla2x00_beacon_blink;
@@ -1469,7 +1481,6 @@ static int qla2x00_probe_one(struct pci_dev *pdev)
                ha->isp_ops.read_nvram = qla24xx_read_nvram_data;
                ha->isp_ops.write_nvram = qla24xx_write_nvram_data;
                ha->isp_ops.fw_dump = qla24xx_fw_dump;
-               ha->isp_ops.ascii_fw_dump = qla24xx_ascii_fw_dump;
                ha->isp_ops.read_optrom = qla24xx_read_optrom_data;
                ha->isp_ops.write_optrom = qla24xx_write_optrom_data;
                ha->isp_ops.beacon_on = qla24xx_beacon_on;
@@ -1541,7 +1552,7 @@ static int qla2x00_probe_one(struct pci_dev *pdev)
        host->transportt = qla2xxx_transport_template;
 
        ret = request_irq(pdev->irq, ha->isp_ops.intr_handler,
-           SA_INTERRUPT|SA_SHIRQ, QLA2XXX_DRIVER_NAME, ha);
+           IRQF_DISABLED|IRQF_SHARED, QLA2XXX_DRIVER_NAME, ha);
        if (ret) {
                qla_printk(KERN_WARNING, ha,
                    "Failed to reserve interrupt %d already in use.\n",
@@ -1640,7 +1651,8 @@ probe_out:
        return ret;
 }
 
-static void qla2x00_remove_one(struct pci_dev *pdev)
+static void __devexit
+qla2x00_remove_one(struct pci_dev *pdev)
 {
        scsi_qla_host_t *ha;
 
@@ -1678,6 +1690,9 @@ qla2x00_free_device(scsi_qla_host_t *ha)
                kthread_stop(t);
        }
 
+       if (ha->eft)
+               qla2x00_trace_control(ha, TC_DISABLE, 0, 0);
+
        /* Stop currently executing firmware. */
        qla2x00_stop_firmware(ha);
 
@@ -1899,17 +1914,6 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha)
                }
                memset(ha->init_cb, 0, ha->init_cb_size);
 
-               /* Allocate ioctl related memory. */
-               if (qla2x00_alloc_ioctl_mem(ha)) {
-                       qla_printk(KERN_WARNING, ha,
-                           "Memory Allocation failed - ioctl_mem\n");
-
-                       qla2x00_mem_free(ha);
-                       msleep(100);
-
-                       continue;
-               }
-
                if (qla2x00_allocate_sp_pool(ha)) {
                        qla_printk(KERN_WARNING, ha,
                            "Memory Allocation failed - "
@@ -1972,6 +1976,26 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha)
                                continue;
                        }
                        memset(ha->ct_sns, 0, sizeof(struct ct_sns_pkt));
+
+                       if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
+                               /*
+                                * Get consistent memory allocated for SFP
+                                * block.
+                                */
+                               ha->sfp_data = dma_pool_alloc(ha->s_dma_pool,
+                                   GFP_KERNEL, &ha->sfp_data_dma);
+                               if (ha->sfp_data == NULL) {
+                                       qla_printk(KERN_WARNING, ha,
+                                           "Memory Allocation failed - "
+                                           "sfp_data\n");
+
+                                       qla2x00_mem_free(ha);
+                                       msleep(100);
+
+                                       continue;
+                               }
+                               memset(ha->sfp_data, 0, SFP_BLOCK_SIZE);
+                       }
                }
 
                /* Done all allocations without any error. */
@@ -2006,12 +2030,16 @@ qla2x00_mem_free(scsi_qla_host_t *ha)
                return;
        }
 
-       /* free ioctl memory */
-       qla2x00_free_ioctl_mem(ha);
-
        /* free sp pool */
        qla2x00_free_sp_pool(ha);
 
+       if (ha->fw_dump) {
+               if (ha->eft)
+                       dma_free_coherent(&ha->pdev->dev,
+                           ntohl(ha->fw_dump->eft_size), ha->eft, ha->eft_dma);
+               vfree(ha->fw_dump);
+       }
+
        if (ha->sns_cmd)
                dma_free_coherent(&ha->pdev->dev, sizeof(struct sns_cmd_pkt),
                    ha->sns_cmd, ha->sns_cmd_dma);
@@ -2020,6 +2048,9 @@ qla2x00_mem_free(scsi_qla_host_t *ha)
                dma_free_coherent(&ha->pdev->dev, sizeof(struct ct_sns_pkt),
                    ha->ct_sns, ha->ct_sns_dma);
 
+       if (ha->sfp_data)
+               dma_pool_free(ha->s_dma_pool, ha->sfp_data, ha->sfp_data_dma);
+
        if (ha->ms_iocb)
                dma_pool_free(ha->s_dma_pool, ha->ms_iocb, ha->ms_iocb_dma);
 
@@ -2043,6 +2074,8 @@ qla2x00_mem_free(scsi_qla_host_t *ha)
                    (ha->request_q_length + 1) * sizeof(request_t),
                    ha->request_ring, ha->request_dma);
 
+       ha->eft = NULL;
+       ha->eft_dma = 0;
        ha->sns_cmd = NULL;
        ha->sns_cmd_dma = 0;
        ha->ct_sns = NULL;
@@ -2071,13 +2104,9 @@ qla2x00_mem_free(scsi_qla_host_t *ha)
        }
        INIT_LIST_HEAD(&ha->fcports);
 
-       vfree(ha->fw_dump);
-       vfree(ha->fw_dump_buffer);
-
        ha->fw_dump = NULL;
        ha->fw_dumped = 0;
        ha->fw_dump_reading = 0;
-       ha->fw_dump_buffer = NULL;
 
        vfree(ha->optrom_buffer);
 }
@@ -2617,40 +2646,16 @@ static struct pci_device_id qla2xxx_pci_tbl[] = {
 };
 MODULE_DEVICE_TABLE(pci, qla2xxx_pci_tbl);
 
-static int __devinit
-qla2xxx_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
-{
-       return qla2x00_probe_one(pdev);
-}
-
-static void __devexit
-qla2xxx_remove_one(struct pci_dev *pdev)
-{
-       qla2x00_remove_one(pdev);
-}
-
 static struct pci_driver qla2xxx_pci_driver = {
        .name           = QLA2XXX_DRIVER_NAME,
        .driver         = {
                .owner          = THIS_MODULE,
        },
        .id_table       = qla2xxx_pci_tbl,
-       .probe          = qla2xxx_probe_one,
-       .remove         = __devexit_p(qla2xxx_remove_one),
+       .probe          = qla2x00_probe_one,
+       .remove         = __devexit_p(qla2x00_remove_one),
 };
 
-static inline int
-qla2x00_pci_module_init(void)
-{
-       return pci_module_init(&qla2xxx_pci_driver);
-}
-
-static inline void
-qla2x00_pci_module_exit(void)
-{
-       pci_unregister_driver(&qla2xxx_pci_driver);
-}
-
 /**
  * qla2x00_module_init - Module initialization.
  **/
@@ -2670,16 +2675,16 @@ qla2x00_module_init(void)
 
        /* Derive version string. */
        strcpy(qla2x00_version_str, QLA2XXX_VERSION);
-#if DEBUG_QLA2100
-       strcat(qla2x00_version_str, "-debug");
-#endif
+       if (extended_error_logging)
+               strcat(qla2x00_version_str, "-debug");
+
        qla2xxx_transport_template =
            fc_attach_transport(&qla2xxx_transport_functions);
        if (!qla2xxx_transport_template)
                return -ENODEV;
 
        printk(KERN_INFO "QLogic Fibre Channel HBA Driver\n");
-       ret = qla2x00_pci_module_init();
+       ret = pci_register_driver(&qla2xxx_pci_driver);
        if (ret) {
                kmem_cache_destroy(srb_cachep);
                fc_release_transport(qla2xxx_transport_template);
@@ -2693,7 +2698,7 @@ qla2x00_module_init(void)
 static void __exit
 qla2x00_module_exit(void)
 {
-       qla2x00_pci_module_exit();
+       pci_unregister_driver(&qla2xxx_pci_driver);
        qla2x00_release_firmware();
        kmem_cache_destroy(srb_cachep);
        fc_release_transport(qla2xxx_transport_template);
index 6b315521bd893578c6cc96b3b251e6dd2856900d..d2d6834406599120e0c85a9e0c395357ed080f6c 100644 (file)
@@ -7,7 +7,7 @@
 /*
  * Driver version
  */
-#define QLA2XXX_VERSION      "8.01.05-k2"
+#define QLA2XXX_VERSION      "8.01.05-k3"
 
 #define QLA_DRIVER_MAJOR_VER   8
 #define QLA_DRIVER_MINOR_VER   1
index 329ead263714466350b280ace50228373017732c..69e0551a81d26abf80e5a4a53dda1ed9f8c6459e 100644 (file)
@@ -718,7 +718,7 @@ static int __init qpti_register_irq(struct qlogicpti *qpti)
         * sanely maintain.
         */
        if (request_irq(qpti->irq, qpti_intr,
-                       SA_SHIRQ, "Qlogic/PTI", qpti))
+                       IRQF_SHARED, "Qlogic/PTI", qpti))
                goto fail;
 
        printk("qpti%d: IRQ %d ", qpti->qpti_id, qpti->irq);
index 4a71578df3c1ce24d8e9a34338d9eb87395a8430..1053c7c76b7db9fc3b3218b1173d217fda1198d4 100644 (file)
@@ -2395,7 +2395,7 @@ static int mv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        probe_ent->port_ops = mv_port_info[board_idx].port_ops;
 
        probe_ent->irq = pdev->irq;
-       probe_ent->irq_flags = SA_SHIRQ;
+       probe_ent->irq_flags = IRQF_SHARED;
        probe_ent->mmio_base = mmio_base;
        probe_ent->private_data = hpriv;
 
index 5cc42c6054eb66ebd8dbc67052b3e86ca4f2032a..56da25581f31a345486229e187bd7077784f6949 100644 (file)
@@ -31,7 +31,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/pci.h>
index b2b6ed5216e001b8ba5c3dd2dc53b3ea5ac70206..64631bd38952e28dd806506eceec01ac44ad0190 100644 (file)
@@ -743,7 +743,7 @@ static int pdc_ata_init_one (struct pci_dev *pdev, const struct pci_device_id *e
        probe_ent->port_ops     = pdc_port_info[board_idx].port_ops;
 
                probe_ent->irq = pdev->irq;
-               probe_ent->irq_flags = SA_SHIRQ;
+               probe_ent->irq_flags = IRQF_SHARED;
        probe_ent->mmio_base = mmio_base;
 
        pdc_ata_setup_port(&probe_ent->port[0], base + 0x200);
index 98ddc25655f0a9d3a61889555a02c3a356fb0edb..d374c1db0cf312b63f59cf9ae1f044fc1e33d9c6 100644 (file)
@@ -680,7 +680,7 @@ static int qs_ata_init_one(struct pci_dev *pdev,
        probe_ent->port_ops     = qs_port_info[board_idx].port_ops;
 
        probe_ent->irq          = pdev->irq;
-       probe_ent->irq_flags    = SA_SHIRQ;
+       probe_ent->irq_flags    = IRQF_SHARED;
        probe_ent->mmio_base    = mmio_base;
        probe_ent->n_ports      = QS_PORTS;
 
index 51d86d750e84f6892b05c98beaa9ac7f82e09fcb..7aabb45c35e58b6e62f243c37bebe3941c7249c8 100644 (file)
@@ -608,7 +608,7 @@ static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
        probe_ent->mwdma_mask = sil_port_info[ent->driver_data].mwdma_mask;
        probe_ent->udma_mask = sil_port_info[ent->driver_data].udma_mask;
                probe_ent->irq = pdev->irq;
-               probe_ent->irq_flags = SA_SHIRQ;
+               probe_ent->irq_flags = IRQF_SHARED;
        probe_ent->host_flags = sil_port_info[ent->driver_data].host_flags;
 
        mmio_base = pci_iomap(pdev, 5, 0);
index b5f8fa955679063e6420bfe915d36aa75760a75c..07a1c6a8a414e2beab1df9cb162b6ca2534fea5b 100644 (file)
@@ -1041,7 +1041,7 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        probe_ent->n_ports      = SIL24_FLAG2NPORTS(pinfo->host_flags);
 
        probe_ent->irq = pdev->irq;
-       probe_ent->irq_flags = SA_SHIRQ;
+       probe_ent->irq_flags = IRQF_SHARED;
        probe_ent->mmio_base = port_base;
        probe_ent->private_data = hpriv;
 
index 809d337ed64184f6423d93f06e26cacd2219d389..ee6b5df41d309833d1ffdbdd2e9cd1bc0fd2330b 100644 (file)
@@ -30,7 +30,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/pci.h>
index 7566c2cabaf725bcde3d2c7ac4fa09add5259e0e..7d0858095e1fed49324d2ac20787e95fc83768ef 100644 (file)
@@ -36,7 +36,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/pci.h>
@@ -429,7 +428,7 @@ static int k2_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *e
        probe_ent->port_ops = &k2_sata_ops;
        probe_ent->n_ports = 4;
        probe_ent->irq = pdev->irq;
-       probe_ent->irq_flags = SA_SHIRQ;
+       probe_ent->irq_flags = IRQF_SHARED;
        probe_ent->mmio_base = mmio_base;
 
        /* We don't care much about the PIO/UDMA masks, but the core won't like us
index 7f864410f7c21a30ade9327c54e30dcdc50328a4..ccc8cad24f7dc20ef599ecdaf8f745d8df57fe55 100644 (file)
@@ -1436,7 +1436,7 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *
        probe_ent->port_ops     = pdc_port_info[board_idx].port_ops;
 
                probe_ent->irq = pdev->irq;
-               probe_ent->irq_flags = SA_SHIRQ;
+               probe_ent->irq_flags = IRQF_SHARED;
        probe_ent->mmio_base = mmio_base;
 
        probe_ent->private_data = hpriv;
index 64f3c1aeed217d5f07250a69c8f8e8afacff8d77..33cdb4867ef13bd222b92695bf2317eb741d8f67 100644 (file)
@@ -24,7 +24,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/pci.h>
index 501ce1791782a7284f5af4614d1552468d29bb5b..03baec2191bfe8f4ee27668ecc3f5c1491f7a856 100644 (file)
@@ -242,7 +242,7 @@ static struct ata_probe_ent *vt6421_init_probe_ent(struct pci_dev *pdev)
        probe_ent->port_ops     = &svia_sata_ops;
        probe_ent->n_ports      = N_PORTS;
        probe_ent->irq          = pdev->irq;
-       probe_ent->irq_flags    = SA_SHIRQ;
+       probe_ent->irq_flags    = IRQF_SHARED;
        probe_ent->pio_mask     = 0x1f;
        probe_ent->mwdma_mask   = 0x07;
        probe_ent->udma_mask    = 0x7f;
index 616fd9634b4b0deb83a09e62dbde168c0da849ca..916fe6fba756d43b6a88ffb8dd64514c23a6a0d2 100644 (file)
@@ -400,7 +400,7 @@ static int __devinit vsc_sata_init_one (struct pci_dev *pdev, const struct pci_d
        probe_ent->port_ops = &vsc_sata_ops;
        probe_ent->n_ports = 4;
        probe_ent->irq = pdev->irq;
-       probe_ent->irq_flags = SA_SHIRQ;
+       probe_ent->irq_flags = IRQF_SHARED;
        probe_ent->mmio_base = mmio_base;
 
        /* We don't care much about the PIO/UDMA masks, but the core won't like us
index 5a5d2af8ee43bdae6f8f0fa8523be9e243d0f4b4..9c63b00773c43c9be0a4df3b9fc0c055954ae5d3 100644 (file)
@@ -24,7 +24,6 @@
  *        module options to "modprobe scsi_debug num_tgts=2" [20021221]
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/kernel.h>
 #include "scsi_logging.h"
 #include "scsi_debug.h"
 
-#define SCSI_DEBUG_VERSION "1.75"
-static const char * scsi_debug_version_date = "20050113";
+#define SCSI_DEBUG_VERSION "1.79"
+static const char * scsi_debug_version_date = "20060604";
 
 /* Additional Sense Code (ASC) used */
-#define NO_ADDED_SENSE 0x0
+#define NO_ADDITIONAL_SENSE 0x0
+#define LOGICAL_UNIT_NOT_READY 0x4
 #define UNRECOVERED_READ_ERR 0x11
+#define PARAMETER_LIST_LENGTH_ERR 0x1a
 #define INVALID_OPCODE 0x20
 #define ADDR_OUT_OF_RANGE 0x21
 #define INVALID_FIELD_IN_CDB 0x24
+#define INVALID_FIELD_IN_PARAM_LIST 0x26
 #define POWERON_RESET 0x29
 #define SAVING_PARAMS_UNSUP 0x39
-#define THRESHHOLD_EXCEEDED 0x5d
+#define THRESHOLD_EXCEEDED 0x5d
+#define LOW_POWER_COND_ON 0x5e
 
 #define SDEBUG_TAGGED_QUEUING 0 /* 0 | MSG_SIMPLE_TAG | MSG_ORDERED_TAG */
 
@@ -81,6 +84,8 @@ static const char * scsi_debug_version_date = "20050113";
 #define DEF_SCSI_LEVEL   5    /* INQUIRY, byte2 [5->SPC-3] */
 #define DEF_PTYPE   0
 #define DEF_D_SENSE   0
+#define DEF_NO_LUN_0   0
+#define DEF_VIRTUAL_GB   0
 
 /* bit mask values for scsi_debug_opts */
 #define SCSI_DEBUG_OPT_NOISE   1
@@ -107,6 +112,7 @@ static const char * scsi_debug_version_date = "20050113";
 /* If REPORT LUNS has luns >= 256 it can choose "flat space" (value 1)
  * or "peripheral device" addressing (value 0) */
 #define SAM2_LUN_ADDRESS_METHOD 0
+#define SAM2_WLUN_REPORT_LUNS 0xc101
 
 static int scsi_debug_add_host = DEF_NUM_HOST;
 static int scsi_debug_delay = DEF_DELAY;
@@ -119,13 +125,16 @@ static int scsi_debug_opts = DEF_OPTS;
 static int scsi_debug_scsi_level = DEF_SCSI_LEVEL;
 static int scsi_debug_ptype = DEF_PTYPE; /* SCSI peripheral type (0==disk) */
 static int scsi_debug_dsense = DEF_D_SENSE;
+static int scsi_debug_no_lun_0 = DEF_NO_LUN_0;
+static int scsi_debug_virtual_gb = DEF_VIRTUAL_GB;
 
 static int scsi_debug_cmnd_count = 0;
 
 #define DEV_READONLY(TGT)      (0)
 #define DEV_REMOVEABLE(TGT)    (0)
 
-static unsigned long sdebug_store_size;        /* in bytes */
+static unsigned int sdebug_store_size; /* in bytes */
+static unsigned int sdebug_store_sectors;
 static sector_t sdebug_capacity;       /* in sectors */
 
 /* old BIOS stuff, kernel may get rid of them but some mode sense pages
@@ -150,7 +159,9 @@ struct sdebug_dev_info {
        unsigned int target;
        unsigned int lun;
        struct sdebug_host_info *sdbg_host;
+       unsigned int wlun;
        char reset;
+       char stopped;
        char used;
 };
 
@@ -194,11 +205,11 @@ static struct scsi_host_template sdebug_driver_template = {
        .bios_param =           scsi_debug_biosparam,
        .can_queue =            SCSI_DEBUG_CANQUEUE,
        .this_id =              7,
-       .sg_tablesize =         64,
-       .cmd_per_lun =          3,
-       .max_sectors =          4096,
+       .sg_tablesize =         256,
+       .cmd_per_lun =          16,
+       .max_sectors =          0xffff,
        .unchecked_isa_dma =    0,
-       .use_clustering =       DISABLE_CLUSTERING,
+       .use_clustering =       ENABLE_CLUSTERING,
        .module =               THIS_MODULE,
 };
 
@@ -226,19 +237,32 @@ static struct device_driver sdebug_driverfs_driver = {
 static const int check_condition_result =
                (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION;
 
+static unsigned char ctrl_m_pg[] = {0xa, 10, 2, 0, 0, 0, 0, 0,
+                                   0, 0, 0x2, 0x4b};
+static unsigned char iec_m_pg[] = {0x1c, 0xa, 0x08, 0, 0, 0, 0, 0,
+                                  0, 0, 0x0, 0x0};
+
 /* function declarations */
 static int resp_inquiry(struct scsi_cmnd * SCpnt, int target,
                        struct sdebug_dev_info * devip);
 static int resp_requests(struct scsi_cmnd * SCpnt,
                         struct sdebug_dev_info * devip);
+static int resp_start_stop(struct scsi_cmnd * scp,
+                          struct sdebug_dev_info * devip);
 static int resp_readcap(struct scsi_cmnd * SCpnt,
                        struct sdebug_dev_info * devip);
-static int resp_mode_sense(struct scsi_cmnd * SCpnt, int target,
+static int resp_readcap16(struct scsi_cmnd * SCpnt,
+                         struct sdebug_dev_info * devip);
+static int resp_mode_sense(struct scsi_cmnd * scp, int target,
                           struct sdebug_dev_info * devip);
-static int resp_read(struct scsi_cmnd * SCpnt, int upper_blk, int block,
-                    int num, struct sdebug_dev_info * devip);
-static int resp_write(struct scsi_cmnd * SCpnt, int upper_blk, int block,
-                     int num, struct sdebug_dev_info * devip);
+static int resp_mode_select(struct scsi_cmnd * scp, int mselect6,
+                           struct sdebug_dev_info * devip);
+static int resp_log_sense(struct scsi_cmnd * scp,
+                         struct sdebug_dev_info * devip);
+static int resp_read(struct scsi_cmnd * SCpnt, unsigned long long lba,
+                    unsigned int num, struct sdebug_dev_info * devip);
+static int resp_write(struct scsi_cmnd * SCpnt, unsigned long long lba,
+                     unsigned int num, struct sdebug_dev_info * devip);
 static int resp_report_luns(struct scsi_cmnd * SCpnt,
                            struct sdebug_dev_info * devip);
 static int fill_from_dev_buffer(struct scsi_cmnd * scp, unsigned char * arr,
@@ -249,8 +273,8 @@ static void timer_intr_handler(unsigned long);
 static struct sdebug_dev_info * devInfoReg(struct scsi_device * sdev);
 static void mk_sense_buffer(struct sdebug_dev_info * devip, int key,
                            int asc, int asq);
-static int check_reset(struct scsi_cmnd * SCpnt,
-                      struct sdebug_dev_info * devip);
+static int check_readiness(struct scsi_cmnd * SCpnt, int reset_only,
+                          struct sdebug_dev_info * devip);
 static int schedule_resp(struct scsi_cmnd * cmnd,
                         struct sdebug_dev_info * devip,
                         done_funct_t done, int scsi_result, int delta_jiff);
@@ -258,8 +282,10 @@ static void __init sdebug_build_parts(unsigned char * ramp);
 static void __init init_all_queued(void);
 static void stop_all_queued(void);
 static int stop_queued_cmnd(struct scsi_cmnd * cmnd);
-static int inquiry_evpd_83(unsigned char * arr, int dev_id_num,
-                           const char * dev_id_str, int dev_id_str_len);
+static int inquiry_evpd_83(unsigned char * arr, int target_dev_id,
+                          int dev_id_num, const char * dev_id_str,
+                          int dev_id_str_len);
+static int inquiry_evpd_88(unsigned char * arr, int target_dev_id);
 static void do_create_driverfs_files(void);
 static void do_remove_driverfs_files(void);
 
@@ -275,18 +301,22 @@ static
 int scsi_debug_queuecommand(struct scsi_cmnd * SCpnt, done_funct_t done)
 {
        unsigned char *cmd = (unsigned char *) SCpnt->cmnd;
-       int block, upper_blk, num, k;
+       int len, k, j;
+       unsigned int num;
+       unsigned long long lba;
        int errsts = 0;
-       int target = scmd_id(SCpnt);
+       int target = SCpnt->device->id;
        struct sdebug_dev_info * devip = NULL;
        int inj_recovered = 0;
+       int delay_override = 0;
 
        if (done == NULL)
                return 0;       /* assume mid level reprocessing command */
 
+       SCpnt->resid = 0;
        if ((SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) && cmd) {
                printk(KERN_INFO "scsi_debug: cmd ");
-               for (k = 0, num = SCpnt->cmd_len; k < num; ++k)
+               for (k = 0, len = SCpnt->cmd_len; k < len; ++k)
                        printk("%02x ", (int)cmd[k]);
                printk("\n");
        }
@@ -297,7 +327,8 @@ int scsi_debug_queuecommand(struct scsi_cmnd * SCpnt, done_funct_t done)
                                     DID_NO_CONNECT << 16, 0);
         }
 
-       if (SCpnt->device->lun >= scsi_debug_max_luns)
+       if ((SCpnt->device->lun >= scsi_debug_max_luns) &&
+           (SCpnt->device->lun != SAM2_WLUN_REPORT_LUNS))
                return schedule_resp(SCpnt, NULL, done,
                                     DID_NO_CONNECT << 16, 0);
        devip = devInfoReg(SCpnt->device);
@@ -316,118 +347,150 @@ int scsi_debug_queuecommand(struct scsi_cmnd * SCpnt, done_funct_t done)
                        inj_recovered = 1; /* to reads and writes below */
         }
 
+       if (devip->wlun) {
+               switch (*cmd) {
+               case INQUIRY:
+               case REQUEST_SENSE:
+               case TEST_UNIT_READY:
+               case REPORT_LUNS:
+                       break;  /* only allowable wlun commands */
+               default:
+                       if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)
+                               printk(KERN_INFO "scsi_debug: Opcode: 0x%x "
+                                      "not supported for wlun\n", *cmd);
+                       mk_sense_buffer(devip, ILLEGAL_REQUEST,
+                                       INVALID_OPCODE, 0);
+                       errsts = check_condition_result;
+                       return schedule_resp(SCpnt, devip, done, errsts,
+                                            0);
+               }
+       }
+
        switch (*cmd) {
        case INQUIRY:     /* mandatory, ignore unit attention */
+               delay_override = 1;
                errsts = resp_inquiry(SCpnt, target, devip);
                break;
        case REQUEST_SENSE:     /* mandatory, ignore unit attention */
+               delay_override = 1;
                errsts = resp_requests(SCpnt, devip);
                break;
        case REZERO_UNIT:       /* actually this is REWIND for SSC */
        case START_STOP:
-               errsts = check_reset(SCpnt, devip);
+               errsts = resp_start_stop(SCpnt, devip);
                break;
        case ALLOW_MEDIUM_REMOVAL:
-               if ((errsts = check_reset(SCpnt, devip)))
+               if ((errsts = check_readiness(SCpnt, 1, devip)))
                        break;
                if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)
                        printk(KERN_INFO "scsi_debug: Medium removal %s\n",
                                cmd[4] ? "inhibited" : "enabled");
                break;
        case SEND_DIAGNOSTIC:     /* mandatory */
-               errsts = check_reset(SCpnt, devip);
+               errsts = check_readiness(SCpnt, 1, devip);
                break;
        case TEST_UNIT_READY:     /* mandatory */
-               errsts = check_reset(SCpnt, devip);
+               delay_override = 1;
+               errsts = check_readiness(SCpnt, 0, devip);
                break;
         case RESERVE:
-               errsts = check_reset(SCpnt, devip);
+               errsts = check_readiness(SCpnt, 1, devip);
                 break;
         case RESERVE_10:
-               errsts = check_reset(SCpnt, devip);
+               errsts = check_readiness(SCpnt, 1, devip);
                 break;
         case RELEASE:
-               errsts = check_reset(SCpnt, devip);
+               errsts = check_readiness(SCpnt, 1, devip);
                 break;
         case RELEASE_10:
-               errsts = check_reset(SCpnt, devip);
+               errsts = check_readiness(SCpnt, 1, devip);
                 break;
        case READ_CAPACITY:
                errsts = resp_readcap(SCpnt, devip);
                break;
+       case SERVICE_ACTION_IN:
+               if (SAI_READ_CAPACITY_16 != cmd[1]) {
+                       mk_sense_buffer(devip, ILLEGAL_REQUEST,
+                                       INVALID_OPCODE, 0);
+                       errsts = check_condition_result;
+                       break;
+               }
+               errsts = resp_readcap16(SCpnt, devip);
+               break;
        case READ_16:
        case READ_12:
        case READ_10:
        case READ_6:
-               if ((errsts = check_reset(SCpnt, devip)))
+               if ((errsts = check_readiness(SCpnt, 0, devip)))
                        break;
-               upper_blk = 0;
                if ((*cmd) == READ_16) {
-                       upper_blk = cmd[5] + (cmd[4] << 8) +
-                                   (cmd[3] << 16) + (cmd[2] << 24);
-                       block = cmd[9] + (cmd[8] << 8) +
-                               (cmd[7] << 16) + (cmd[6] << 24);
+                       for (lba = 0, j = 0; j < 8; ++j) {
+                               if (j > 0)
+                                       lba <<= 8;
+                               lba += cmd[2 + j];
+                       }
                        num = cmd[13] + (cmd[12] << 8) +
                                (cmd[11] << 16) + (cmd[10] << 24);
                } else if ((*cmd) == READ_12) {
-                       block = cmd[5] + (cmd[4] << 8) +
+                       lba = cmd[5] + (cmd[4] << 8) +
                                (cmd[3] << 16) + (cmd[2] << 24);
                        num = cmd[9] + (cmd[8] << 8) +
                                (cmd[7] << 16) + (cmd[6] << 24);
                } else if ((*cmd) == READ_10) {
-                       block = cmd[5] + (cmd[4] << 8) +
+                       lba = cmd[5] + (cmd[4] << 8) +
                                (cmd[3] << 16) + (cmd[2] << 24);
                        num = cmd[8] + (cmd[7] << 8);
-               } else {
-                       block = cmd[3] + (cmd[2] << 8) +
+               } else {        /* READ (6) */
+                       lba = cmd[3] + (cmd[2] << 8) +
                                ((cmd[1] & 0x1f) << 16);
-                       num = cmd[4];
+                       num = (0 == cmd[4]) ? 256 : cmd[4];
                }
-               errsts = resp_read(SCpnt, upper_blk, block, num, devip);
+               errsts = resp_read(SCpnt, lba, num, devip);
                if (inj_recovered && (0 == errsts)) {
                        mk_sense_buffer(devip, RECOVERED_ERROR,
-                                       THRESHHOLD_EXCEEDED, 0);
+                                       THRESHOLD_EXCEEDED, 0);
                        errsts = check_condition_result;
                }
                break;
        case REPORT_LUNS:       /* mandatory, ignore unit attention */
+               delay_override = 1;
                errsts = resp_report_luns(SCpnt, devip);
                break;
        case VERIFY:            /* 10 byte SBC-2 command */
-               errsts = check_reset(SCpnt, devip);
+               errsts = check_readiness(SCpnt, 0, devip);
                break;
        case WRITE_16:
        case WRITE_12:
        case WRITE_10:
        case WRITE_6:
-               if ((errsts = check_reset(SCpnt, devip)))
+               if ((errsts = check_readiness(SCpnt, 0, devip)))
                        break;
-               upper_blk = 0;
                if ((*cmd) == WRITE_16) {
-                       upper_blk = cmd[5] + (cmd[4] << 8) +
-                                   (cmd[3] << 16) + (cmd[2] << 24);
-                       block = cmd[9] + (cmd[8] << 8) +
-                               (cmd[7] << 16) + (cmd[6] << 24);
+                       for (lba = 0, j = 0; j < 8; ++j) {
+                               if (j > 0)
+                                       lba <<= 8;
+                               lba += cmd[2 + j];
+                       }
                        num = cmd[13] + (cmd[12] << 8) +
                                (cmd[11] << 16) + (cmd[10] << 24);
                } else if ((*cmd) == WRITE_12) {
-                       block = cmd[5] + (cmd[4] << 8) +
+                       lba = cmd[5] + (cmd[4] << 8) +
                                (cmd[3] << 16) + (cmd[2] << 24);
                        num = cmd[9] + (cmd[8] << 8) +
                                (cmd[7] << 16) + (cmd[6] << 24);
                } else if ((*cmd) == WRITE_10) {
-                       block = cmd[5] + (cmd[4] << 8) +
+                       lba = cmd[5] + (cmd[4] << 8) +
                                (cmd[3] << 16) + (cmd[2] << 24);
                        num = cmd[8] + (cmd[7] << 8);
-               } else {
-                       block = cmd[3] + (cmd[2] << 8) +
+               } else {        /* WRITE (6) */
+                       lba = cmd[3] + (cmd[2] << 8) +
                                ((cmd[1] & 0x1f) << 16);
-                       num = cmd[4];
+                       num = (0 == cmd[4]) ? 256 : cmd[4];
                }
-               errsts = resp_write(SCpnt, upper_blk, block, num, devip);
+               errsts = resp_write(SCpnt, lba, num, devip);
                if (inj_recovered && (0 == errsts)) {
                        mk_sense_buffer(devip, RECOVERED_ERROR,
-                                       THRESHHOLD_EXCEEDED, 0);
+                                       THRESHOLD_EXCEEDED, 0);
                        errsts = check_condition_result;
                }
                break;
@@ -435,20 +498,31 @@ int scsi_debug_queuecommand(struct scsi_cmnd * SCpnt, done_funct_t done)
        case MODE_SENSE_10:
                errsts = resp_mode_sense(SCpnt, target, devip);
                break;
+       case MODE_SELECT:
+               errsts = resp_mode_select(SCpnt, 1, devip);
+               break;
+       case MODE_SELECT_10:
+               errsts = resp_mode_select(SCpnt, 0, devip);
+               break;
+       case LOG_SENSE:
+               errsts = resp_log_sense(SCpnt, devip);
+               break;
        case SYNCHRONIZE_CACHE:
-               errsts = check_reset(SCpnt, devip);
+               delay_override = 1;
+               errsts = check_readiness(SCpnt, 0, devip);
                break;
        default:
                if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)
                        printk(KERN_INFO "scsi_debug: Opcode: 0x%x not "
                               "supported\n", *cmd);
-               if ((errsts = check_reset(SCpnt, devip)))
+               if ((errsts = check_readiness(SCpnt, 1, devip)))
                        break;  /* Unit attention takes precedence */
                mk_sense_buffer(devip, ILLEGAL_REQUEST, INVALID_OPCODE, 0);
                errsts = check_condition_result;
                break;
        }
-       return schedule_resp(SCpnt, devip, done, errsts, scsi_debug_delay);
+       return schedule_resp(SCpnt, devip, done, errsts,
+                            (delay_override ? 0 : scsi_debug_delay));
 }
 
 static int scsi_debug_ioctl(struct scsi_device *dev, int cmd, void __user *arg)
@@ -460,7 +534,8 @@ static int scsi_debug_ioctl(struct scsi_device *dev, int cmd, void __user *arg)
        /* return -ENOTTY; // correct return but upsets fdisk */
 }
 
-static int check_reset(struct scsi_cmnd * SCpnt, struct sdebug_dev_info * devip)
+static int check_readiness(struct scsi_cmnd * SCpnt, int reset_only,
+                          struct sdebug_dev_info * devip)
 {
        if (devip->reset) {
                if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)
@@ -470,6 +545,14 @@ static int check_reset(struct scsi_cmnd * SCpnt, struct sdebug_dev_info * devip)
                mk_sense_buffer(devip, UNIT_ATTENTION, POWERON_RESET, 0);
                return check_condition_result;
        }
+       if ((0 == reset_only) && devip->stopped) {
+               if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)
+                       printk(KERN_INFO "scsi_debug: Reporting Not "
+                              "ready: initializing command required\n");
+               mk_sense_buffer(devip, NOT_READY, LOGICAL_UNIT_NOT_READY,
+                               0x2);
+               return check_condition_result;
+       }
        return 0;
 }
 
@@ -493,7 +576,10 @@ static int fill_from_dev_buffer(struct scsi_cmnd * scp, unsigned char * arr,
                req_len = scp->request_bufflen;
                act_len = (req_len < arr_len) ? req_len : arr_len;
                memcpy(scp->request_buffer, arr, act_len);
-               scp->resid = req_len - act_len;
+               if (scp->resid)
+                       scp->resid -= act_len;
+               else
+                       scp->resid = req_len - act_len;
                return 0;
        }
        sgpnt = (struct scatterlist *)scp->request_buffer;
@@ -516,7 +602,10 @@ static int fill_from_dev_buffer(struct scsi_cmnd * scp, unsigned char * arr,
                }
                req_len += sgpnt->length;
        }
-       scp->resid = req_len - act_len;
+       if (scp->resid)
+               scp->resid -= act_len;
+       else
+               scp->resid = req_len - act_len;
        return 0;
 }
 
@@ -567,12 +656,14 @@ static const char * inq_vendor_id = "Linux   ";
 static const char * inq_product_id = "scsi_debug      ";
 static const char * inq_product_rev = "0004";
 
-static int inquiry_evpd_83(unsigned char * arr, int dev_id_num,
-                          const char * dev_id_str, int dev_id_str_len)
+static int inquiry_evpd_83(unsigned char * arr, int target_dev_id,
+                          int dev_id_num, const char * dev_id_str,
+                          int dev_id_str_len)
 {
-       int num;
+       int num, port_a;
+       char b[32];
 
-       /* Two identification descriptors: */
+       port_a = target_dev_id + 1;
        /* T10 vendor identifier field format (faked) */
        arr[0] = 0x2;   /* ASCII */
        arr[1] = 0x1;
@@ -583,25 +674,246 @@ static int inquiry_evpd_83(unsigned char * arr, int dev_id_num,
        num = 8 + 16 + dev_id_str_len;
        arr[3] = num;
        num += 4;
-       /* NAA IEEE registered identifier (faked) */
-       arr[num] = 0x1; /* binary */
-       arr[num + 1] = 0x3;
-       arr[num + 2] = 0x0;
-       arr[num + 3] = 0x8;
-       arr[num + 4] = 0x51;    /* ieee company id=0x123456 (faked) */
-       arr[num + 5] = 0x23;
-       arr[num + 6] = 0x45;
-       arr[num + 7] = 0x60;
-       arr[num + 8] = (dev_id_num >> 24);
-       arr[num + 9] = (dev_id_num >> 16) & 0xff;
-       arr[num + 10] = (dev_id_num >> 8) & 0xff;
-       arr[num + 11] = dev_id_num & 0xff;
-       return num + 12;
+       if (dev_id_num >= 0) {
+               /* NAA-5, Logical unit identifier (binary) */
+               arr[num++] = 0x1;       /* binary (not necessarily sas) */
+               arr[num++] = 0x3;       /* PIV=0, lu, naa */
+               arr[num++] = 0x0;
+               arr[num++] = 0x8;
+               arr[num++] = 0x53;  /* naa-5 ieee company id=0x333333 (fake) */
+               arr[num++] = 0x33;
+               arr[num++] = 0x33;
+               arr[num++] = 0x30;
+               arr[num++] = (dev_id_num >> 24);
+               arr[num++] = (dev_id_num >> 16) & 0xff;
+               arr[num++] = (dev_id_num >> 8) & 0xff;
+               arr[num++] = dev_id_num & 0xff;
+               /* Target relative port number */
+               arr[num++] = 0x61;      /* proto=sas, binary */
+               arr[num++] = 0x94;      /* PIV=1, target port, rel port */
+               arr[num++] = 0x0;       /* reserved */
+               arr[num++] = 0x4;       /* length */
+               arr[num++] = 0x0;       /* reserved */
+               arr[num++] = 0x0;       /* reserved */
+               arr[num++] = 0x0;
+               arr[num++] = 0x1;       /* relative port A */
+       }
+       /* NAA-5, Target port identifier */
+       arr[num++] = 0x61;      /* proto=sas, binary */
+       arr[num++] = 0x93;      /* piv=1, target port, naa */
+       arr[num++] = 0x0;
+       arr[num++] = 0x8;
+       arr[num++] = 0x52;      /* naa-5, company id=0x222222 (fake) */
+       arr[num++] = 0x22;
+       arr[num++] = 0x22;
+       arr[num++] = 0x20;
+       arr[num++] = (port_a >> 24);
+       arr[num++] = (port_a >> 16) & 0xff;
+       arr[num++] = (port_a >> 8) & 0xff;
+       arr[num++] = port_a & 0xff;
+       /* NAA-5, Target device identifier */
+       arr[num++] = 0x61;      /* proto=sas, binary */
+       arr[num++] = 0xa3;      /* piv=1, target device, naa */
+       arr[num++] = 0x0;
+       arr[num++] = 0x8;
+       arr[num++] = 0x52;      /* naa-5, company id=0x222222 (fake) */
+       arr[num++] = 0x22;
+       arr[num++] = 0x22;
+       arr[num++] = 0x20;
+       arr[num++] = (target_dev_id >> 24);
+       arr[num++] = (target_dev_id >> 16) & 0xff;
+       arr[num++] = (target_dev_id >> 8) & 0xff;
+       arr[num++] = target_dev_id & 0xff;
+       /* SCSI name string: Target device identifier */
+       arr[num++] = 0x63;      /* proto=sas, UTF-8 */
+       arr[num++] = 0xa8;      /* piv=1, target device, SCSI name string */
+       arr[num++] = 0x0;
+       arr[num++] = 24;
+       memcpy(arr + num, "naa.52222220", 12);
+       num += 12;
+       snprintf(b, sizeof(b), "%08X", target_dev_id);
+       memcpy(arr + num, b, 8);
+       num += 8;
+       memset(arr + num, 0, 4);
+       num += 4;
+       return num;
+}
+
+
+static unsigned char vpd84_data[] = {
+/* from 4th byte */ 0x22,0x22,0x22,0x0,0xbb,0x0,
+    0x22,0x22,0x22,0x0,0xbb,0x1,
+    0x22,0x22,0x22,0x0,0xbb,0x2,
+};
+
+static int inquiry_evpd_84(unsigned char * arr)
+{
+       memcpy(arr, vpd84_data, sizeof(vpd84_data));
+       return sizeof(vpd84_data);
+}
+
+static int inquiry_evpd_85(unsigned char * arr)
+{
+       int num = 0;
+       const char * na1 = "https://www.kernel.org/config";
+       const char * na2 = "http://www.kernel.org/log";
+       int plen, olen;
+
+       arr[num++] = 0x1;       /* lu, storage config */
+       arr[num++] = 0x0;       /* reserved */
+       arr[num++] = 0x0;
+       olen = strlen(na1);
+       plen = olen + 1;
+       if (plen % 4)
+               plen = ((plen / 4) + 1) * 4;
+       arr[num++] = plen;      /* length, null termianted, padded */
+       memcpy(arr + num, na1, olen);
+       memset(arr + num + olen, 0, plen - olen);
+       num += plen;
+
+       arr[num++] = 0x4;       /* lu, logging */
+       arr[num++] = 0x0;       /* reserved */
+       arr[num++] = 0x0;
+       olen = strlen(na2);
+       plen = olen + 1;
+       if (plen % 4)
+               plen = ((plen / 4) + 1) * 4;
+       arr[num++] = plen;      /* length, null terminated, padded */
+       memcpy(arr + num, na2, olen);
+       memset(arr + num + olen, 0, plen - olen);
+       num += plen;
+
+       return num;
+}
+
+/* SCSI ports VPD page */
+static int inquiry_evpd_88(unsigned char * arr, int target_dev_id)
+{
+       int num = 0;
+       int port_a, port_b;
+
+       port_a = target_dev_id + 1;
+       port_b = port_a + 1;
+       arr[num++] = 0x0;       /* reserved */
+       arr[num++] = 0x0;       /* reserved */
+       arr[num++] = 0x0;
+       arr[num++] = 0x1;       /* relative port 1 (primary) */
+       memset(arr + num, 0, 6);
+       num += 6;
+       arr[num++] = 0x0;
+       arr[num++] = 12;        /* length tp descriptor */
+       /* naa-5 target port identifier (A) */
+       arr[num++] = 0x61;      /* proto=sas, binary */
+       arr[num++] = 0x93;      /* PIV=1, target port, NAA */
+       arr[num++] = 0x0;       /* reserved */
+       arr[num++] = 0x8;       /* length */
+       arr[num++] = 0x52;      /* NAA-5, company_id=0x222222 (fake) */
+       arr[num++] = 0x22;
+       arr[num++] = 0x22;
+       arr[num++] = 0x20;
+       arr[num++] = (port_a >> 24);
+       arr[num++] = (port_a >> 16) & 0xff;
+       arr[num++] = (port_a >> 8) & 0xff;
+       arr[num++] = port_a & 0xff;
+
+       arr[num++] = 0x0;       /* reserved */
+       arr[num++] = 0x0;       /* reserved */
+       arr[num++] = 0x0;
+       arr[num++] = 0x2;       /* relative port 2 (secondary) */
+       memset(arr + num, 0, 6);
+       num += 6;
+       arr[num++] = 0x0;
+       arr[num++] = 12;        /* length tp descriptor */
+       /* naa-5 target port identifier (B) */
+       arr[num++] = 0x61;      /* proto=sas, binary */
+       arr[num++] = 0x93;      /* PIV=1, target port, NAA */
+       arr[num++] = 0x0;       /* reserved */
+       arr[num++] = 0x8;       /* length */
+       arr[num++] = 0x52;      /* NAA-5, company_id=0x222222 (fake) */
+       arr[num++] = 0x22;
+       arr[num++] = 0x22;
+       arr[num++] = 0x20;
+       arr[num++] = (port_b >> 24);
+       arr[num++] = (port_b >> 16) & 0xff;
+       arr[num++] = (port_b >> 8) & 0xff;
+       arr[num++] = port_b & 0xff;
+
+       return num;
+}
+
+
+static unsigned char vpd89_data[] = {
+/* from 4th byte */ 0,0,0,0,
+'l','i','n','u','x',' ',' ',' ',
+'S','A','T',' ','s','c','s','i','_','d','e','b','u','g',' ',' ',
+'1','2','3','4',
+0x34,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,
+0xec,0,0,0,
+0x5a,0xc,0xff,0x3f,0x37,0xc8,0x10,0,0,0,0,0,0x3f,0,0,0,
+0,0,0,0,0x58,0x58,0x58,0x58,0x58,0x58,0x58,0x58,0x20,0x20,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0,0,0,0x40,0x4,0,0x2e,0x33,
+0x38,0x31,0x20,0x20,0x20,0x20,0x54,0x53,0x38,0x33,0x30,0x30,0x33,0x31,
+0x53,0x41,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x10,0x80,
+0,0,0,0x2f,0,0,0,0x2,0,0x2,0x7,0,0xff,0xff,0x1,0,
+0x3f,0,0xc1,0xff,0x3e,0,0x10,0x1,0xb0,0xf8,0x50,0x9,0,0,0x7,0,
+0x3,0,0x78,0,0x78,0,0xf0,0,0x78,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0x2,0,0,0,0,0,0,0,
+0x7e,0,0x1b,0,0x6b,0x34,0x1,0x7d,0x3,0x40,0x69,0x34,0x1,0x3c,0x3,0x40,
+0x7f,0x40,0,0,0,0,0xfe,0xfe,0,0,0,0,0,0xfe,0,0,
+0,0,0,0,0,0,0,0,0xb0,0xf8,0x50,0x9,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0x1,0,0xb0,0xf8,0x50,0x9,0xb0,0xf8,0x50,0x9,0x20,0x20,0x2,0,0xb6,0x42,
+0,0x80,0x8a,0,0x6,0x3c,0xa,0x3c,0xff,0xff,0xc6,0x7,0,0x1,0,0x8,
+0xf0,0xf,0,0x10,0x2,0,0x30,0,0,0,0,0,0,0,0x6,0xfe,
+0,0,0x2,0,0x50,0,0x8a,0,0x4f,0x95,0,0,0x21,0,0xb,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0xa5,0x51,
+};
+
+static int inquiry_evpd_89(unsigned char * arr)
+{
+       memcpy(arr, vpd89_data, sizeof(vpd89_data));
+       return sizeof(vpd89_data);
+}
+
+
+static unsigned char vpdb0_data[] = {
+       /* from 4th byte */ 0,0,0,4,
+       0,0,0x4,0,
+       0,0,0,64,
+};
+
+static int inquiry_evpd_b0(unsigned char * arr)
+{
+       memcpy(arr, vpdb0_data, sizeof(vpdb0_data));
+       if (sdebug_store_sectors > 0x400) {
+               arr[4] = (sdebug_store_sectors >> 24) & 0xff;
+               arr[5] = (sdebug_store_sectors >> 16) & 0xff;
+               arr[6] = (sdebug_store_sectors >> 8) & 0xff;
+               arr[7] = sdebug_store_sectors & 0xff;
+       }
+       return sizeof(vpdb0_data);
 }
 
 
 #define SDEBUG_LONG_INQ_SZ 96
-#define SDEBUG_MAX_INQ_ARR_SZ 128
+#define SDEBUG_MAX_INQ_ARR_SZ 584
 
 static int resp_inquiry(struct scsi_cmnd * scp, int target,
                        struct sdebug_dev_info * devip)
@@ -609,64 +921,113 @@ static int resp_inquiry(struct scsi_cmnd * scp, int target,
        unsigned char pq_pdt;
        unsigned char arr[SDEBUG_MAX_INQ_ARR_SZ];
        unsigned char *cmd = (unsigned char *)scp->cmnd;
-       int alloc_len;
+       int alloc_len, n;
 
        alloc_len = (cmd[3] << 8) + cmd[4];
        memset(arr, 0, SDEBUG_MAX_INQ_ARR_SZ);
-       pq_pdt = (scsi_debug_ptype & 0x1f);
+       if (devip->wlun)
+               pq_pdt = 0x1e;  /* present, wlun */
+       else if (scsi_debug_no_lun_0 && (0 == devip->lun))
+               pq_pdt = 0x7f;  /* not present, no device type */
+       else
+               pq_pdt = (scsi_debug_ptype & 0x1f);
        arr[0] = pq_pdt;
        if (0x2 & cmd[1]) {  /* CMDDT bit set */
                mk_sense_buffer(devip, ILLEGAL_REQUEST, INVALID_FIELD_IN_CDB,
                                0);
                return check_condition_result;
        } else if (0x1 & cmd[1]) {  /* EVPD bit set */
-               int dev_id_num, len;
-               char dev_id_str[6];
+               int lu_id_num, target_dev_id, len;
+               char lu_id_str[6];
+               int host_no = devip->sdbg_host->shost->host_no;
                
-               dev_id_num = ((devip->sdbg_host->shost->host_no + 1) * 2000) +
-                            (devip->target * 1000) + devip->lun;
-               len = scnprintf(dev_id_str, 6, "%d", dev_id_num);
+               lu_id_num = devip->wlun ? -1 : (((host_no + 1) * 2000) +
+                           (devip->target * 1000) + devip->lun);
+               target_dev_id = ((host_no + 1) * 2000) +
+                                (devip->target * 1000) - 3;
+               len = scnprintf(lu_id_str, 6, "%d", lu_id_num);
                if (0 == cmd[2]) { /* supported vital product data pages */
-                       arr[3] = 3;
-                       arr[4] = 0x0; /* this page */
-                       arr[5] = 0x80; /* unit serial number */
-                       arr[6] = 0x83; /* device identification */
+                       arr[1] = cmd[2];        /*sanity */
+                       n = 4;
+                       arr[n++] = 0x0;   /* this page */
+                       arr[n++] = 0x80;  /* unit serial number */
+                       arr[n++] = 0x83;  /* device identification */
+                       arr[n++] = 0x84;  /* software interface ident. */
+                       arr[n++] = 0x85;  /* management network addresses */
+                       arr[n++] = 0x86;  /* extended inquiry */
+                       arr[n++] = 0x87;  /* mode page policy */
+                       arr[n++] = 0x88;  /* SCSI ports */
+                       arr[n++] = 0x89;  /* ATA information */
+                       arr[n++] = 0xb0;  /* Block limits (SBC) */
+                       arr[3] = n - 4;   /* number of supported VPD pages */
                } else if (0x80 == cmd[2]) { /* unit serial number */
-                       arr[1] = 0x80;
+                       arr[1] = cmd[2];        /*sanity */
                        arr[3] = len;
-                       memcpy(&arr[4], dev_id_str, len);
+                       memcpy(&arr[4], lu_id_str, len);
                } else if (0x83 == cmd[2]) { /* device identification */
-                       arr[1] = 0x83;
-                       arr[3] = inquiry_evpd_83(&arr[4], dev_id_num,
-                                                dev_id_str, len);
+                       arr[1] = cmd[2];        /*sanity */
+                       arr[3] = inquiry_evpd_83(&arr[4], target_dev_id,
+                                                lu_id_num, lu_id_str, len);
+               } else if (0x84 == cmd[2]) { /* Software interface ident. */
+                       arr[1] = cmd[2];        /*sanity */
+                       arr[3] = inquiry_evpd_84(&arr[4]);
+               } else if (0x85 == cmd[2]) { /* Management network addresses */
+                       arr[1] = cmd[2];        /*sanity */
+                       arr[3] = inquiry_evpd_85(&arr[4]);
+               } else if (0x86 == cmd[2]) { /* extended inquiry */
+                       arr[1] = cmd[2];        /*sanity */
+                       arr[3] = 0x3c;  /* number of following entries */
+                       arr[4] = 0x0;   /* no protection stuff */
+                       arr[5] = 0x7;   /* head of q, ordered + simple q's */
+               } else if (0x87 == cmd[2]) { /* mode page policy */
+                       arr[1] = cmd[2];        /*sanity */
+                       arr[3] = 0x8;   /* number of following entries */
+                       arr[4] = 0x2;   /* disconnect-reconnect mp */
+                       arr[6] = 0x80;  /* mlus, shared */
+                       arr[8] = 0x18;   /* protocol specific lu */
+                       arr[10] = 0x82;  /* mlus, per initiator port */
+               } else if (0x88 == cmd[2]) { /* SCSI Ports */
+                       arr[1] = cmd[2];        /*sanity */
+                       arr[3] = inquiry_evpd_88(&arr[4], target_dev_id);
+               } else if (0x89 == cmd[2]) { /* ATA information */
+                       arr[1] = cmd[2];        /*sanity */
+                       n = inquiry_evpd_89(&arr[4]);
+                       arr[2] = (n >> 8);
+                       arr[3] = (n & 0xff);
+               } else if (0xb0 == cmd[2]) { /* Block limits (SBC) */
+                       arr[1] = cmd[2];        /*sanity */
+                       arr[3] = inquiry_evpd_b0(&arr[4]);
                } else {
                        /* Illegal request, invalid field in cdb */
                        mk_sense_buffer(devip, ILLEGAL_REQUEST,
                                        INVALID_FIELD_IN_CDB, 0);
                        return check_condition_result;
                }
+               len = min(((arr[2] << 8) + arr[3]) + 4, alloc_len);
                return fill_from_dev_buffer(scp, arr,
-                           min(alloc_len, SDEBUG_MAX_INQ_ARR_SZ));
+                           min(len, SDEBUG_MAX_INQ_ARR_SZ));
        }
        /* drops through here for a standard inquiry */
        arr[1] = DEV_REMOVEABLE(target) ? 0x80 : 0;     /* Removable disk */
        arr[2] = scsi_debug_scsi_level;
        arr[3] = 2;    /* response_data_format==2 */
        arr[4] = SDEBUG_LONG_INQ_SZ - 5;
-       arr[6] = 0x1; /* claim: ADDR16 */
+       arr[6] = 0x10; /* claim: MultiP */
        /* arr[6] |= 0x40; ... claim: EncServ (enclosure services) */
-       arr[7] = 0x3a; /* claim: WBUS16, SYNC, LINKED + CMDQUE */
+       arr[7] = 0xa; /* claim: LINKED + CMDQUE */
        memcpy(&arr[8], inq_vendor_id, 8);
        memcpy(&arr[16], inq_product_id, 16);
        memcpy(&arr[32], inq_product_rev, 4);
        /* version descriptors (2 bytes each) follow */
-       arr[58] = 0x0; arr[59] = 0x40; /* SAM-2 */
-       arr[60] = 0x3; arr[61] = 0x0;  /* SPC-3 */
+       arr[58] = 0x0; arr[59] = 0x77; /* SAM-3 ANSI */
+       arr[60] = 0x3; arr[61] = 0x14;  /* SPC-3 ANSI */
+       n = 62;
        if (scsi_debug_ptype == 0) {
-               arr[62] = 0x1; arr[63] = 0x80; /* SBC */
+               arr[n++] = 0x3; arr[n++] = 0x3d; /* SBC-2 ANSI */
        } else if (scsi_debug_ptype == 1) {
-               arr[62] = 0x2; arr[63] = 0x00; /* SSC */
+               arr[n++] = 0x3; arr[n++] = 0x60; /* SSC-2 no version */
        }
+       arr[n++] = 0xc; arr[n++] = 0xf;  /* SAS-1.1 rev 10 */
        return fill_from_dev_buffer(scp, arr,
                            min(alloc_len, SDEBUG_LONG_INQ_SZ));
 }
@@ -677,46 +1038,141 @@ static int resp_requests(struct scsi_cmnd * scp,
        unsigned char * sbuff;
        unsigned char *cmd = (unsigned char *)scp->cmnd;
        unsigned char arr[SDEBUG_SENSE_LEN];
+       int want_dsense;
        int len = 18;
 
-       memset(arr, 0, SDEBUG_SENSE_LEN);
+       memset(arr, 0, sizeof(arr));
        if (devip->reset == 1)
-               mk_sense_buffer(devip, 0, NO_ADDED_SENSE, 0);
+               mk_sense_buffer(devip, 0, NO_ADDITIONAL_SENSE, 0);
+       want_dsense = !!(cmd[1] & 1) || scsi_debug_dsense;
        sbuff = devip->sense_buff;
-       if ((cmd[1] & 1) && (! scsi_debug_dsense)) {
-               /* DESC bit set and sense_buff in fixed format */
-               arr[0] = 0x72;
-               arr[1] = sbuff[2];     /* sense key */
-               arr[2] = sbuff[12];    /* asc */
-               arr[3] = sbuff[13];    /* ascq */
-               len = 8;
-       } else
+       if ((iec_m_pg[2] & 0x4) && (6 == (iec_m_pg[3] & 0xf))) {
+               if (want_dsense) {
+                       arr[0] = 0x72;
+                       arr[1] = 0x0;           /* NO_SENSE in sense_key */
+                       arr[2] = THRESHOLD_EXCEEDED;
+                       arr[3] = 0xff;          /* TEST set and MRIE==6 */
+               } else {
+                       arr[0] = 0x70;
+                       arr[2] = 0x0;           /* NO_SENSE in sense_key */
+                       arr[7] = 0xa;           /* 18 byte sense buffer */
+                       arr[12] = THRESHOLD_EXCEEDED;
+                       arr[13] = 0xff;         /* TEST set and MRIE==6 */
+               }
+       } else if (devip->stopped) {
+               if (want_dsense) {
+                       arr[0] = 0x72;
+                       arr[1] = 0x0;           /* NO_SENSE in sense_key */
+                       arr[2] = LOW_POWER_COND_ON;
+                       arr[3] = 0x0;           /* TEST set and MRIE==6 */
+               } else {
+                       arr[0] = 0x70;
+                       arr[2] = 0x0;           /* NO_SENSE in sense_key */
+                       arr[7] = 0xa;           /* 18 byte sense buffer */
+                       arr[12] = LOW_POWER_COND_ON;
+                       arr[13] = 0x0;          /* TEST set and MRIE==6 */
+               }
+       } else {
                memcpy(arr, sbuff, SDEBUG_SENSE_LEN);
-       mk_sense_buffer(devip, 0, NO_ADDED_SENSE, 0);
+               if ((cmd[1] & 1) && (! scsi_debug_dsense)) {
+                       /* DESC bit set and sense_buff in fixed format */
+                       memset(arr, 0, sizeof(arr));
+                       arr[0] = 0x72;
+                       arr[1] = sbuff[2];     /* sense key */
+                       arr[2] = sbuff[12];    /* asc */
+                       arr[3] = sbuff[13];    /* ascq */
+                       len = 8;
+               }
+       }
+       mk_sense_buffer(devip, 0, NO_ADDITIONAL_SENSE, 0);
        return fill_from_dev_buffer(scp, arr, len);
 }
 
+static int resp_start_stop(struct scsi_cmnd * scp,
+                          struct sdebug_dev_info * devip)
+{
+       unsigned char *cmd = (unsigned char *)scp->cmnd;
+       int power_cond, errsts, start;
+
+       if ((errsts = check_readiness(scp, 1, devip)))
+               return errsts;
+       power_cond = (cmd[4] & 0xf0) >> 4;
+       if (power_cond) {
+               mk_sense_buffer(devip, ILLEGAL_REQUEST, INVALID_FIELD_IN_CDB,
+                               0);
+               return check_condition_result;
+       }
+       start = cmd[4] & 1;
+       if (start == devip->stopped)
+               devip->stopped = !start;
+       return 0;
+}
+
 #define SDEBUG_READCAP_ARR_SZ 8
 static int resp_readcap(struct scsi_cmnd * scp,
                        struct sdebug_dev_info * devip)
 {
        unsigned char arr[SDEBUG_READCAP_ARR_SZ];
-       unsigned long capac;
+       unsigned int capac;
        int errsts;
 
-       if ((errsts = check_reset(scp, devip)))
+       if ((errsts = check_readiness(scp, 1, devip)))
                return errsts;
+       /* following just in case virtual_gb changed */
+       if (scsi_debug_virtual_gb > 0) {
+               sdebug_capacity = 2048 * 1024;
+               sdebug_capacity *= scsi_debug_virtual_gb;
+       } else
+               sdebug_capacity = sdebug_store_sectors;
        memset(arr, 0, SDEBUG_READCAP_ARR_SZ);
-       capac = (unsigned long)sdebug_capacity - 1;
-       arr[0] = (capac >> 24);
-       arr[1] = (capac >> 16) & 0xff;
-       arr[2] = (capac >> 8) & 0xff;
-       arr[3] = capac & 0xff;
+       if (sdebug_capacity < 0xffffffff) {
+               capac = (unsigned int)sdebug_capacity - 1;
+               arr[0] = (capac >> 24);
+               arr[1] = (capac >> 16) & 0xff;
+               arr[2] = (capac >> 8) & 0xff;
+               arr[3] = capac & 0xff;
+       } else {
+               arr[0] = 0xff;
+               arr[1] = 0xff;
+               arr[2] = 0xff;
+               arr[3] = 0xff;
+       }
        arr[6] = (SECT_SIZE_PER(target) >> 8) & 0xff;
        arr[7] = SECT_SIZE_PER(target) & 0xff;
        return fill_from_dev_buffer(scp, arr, SDEBUG_READCAP_ARR_SZ);
 }
 
+#define SDEBUG_READCAP16_ARR_SZ 32
+static int resp_readcap16(struct scsi_cmnd * scp,
+                         struct sdebug_dev_info * devip)
+{
+       unsigned char *cmd = (unsigned char *)scp->cmnd;
+       unsigned char arr[SDEBUG_READCAP16_ARR_SZ];
+       unsigned long long capac;
+       int errsts, k, alloc_len;
+
+       if ((errsts = check_readiness(scp, 1, devip)))
+               return errsts;
+       alloc_len = ((cmd[10] << 24) + (cmd[11] << 16) + (cmd[12] << 8)
+                    + cmd[13]);
+       /* following just in case virtual_gb changed */
+       if (scsi_debug_virtual_gb > 0) {
+               sdebug_capacity = 2048 * 1024;
+               sdebug_capacity *= scsi_debug_virtual_gb;
+       } else
+               sdebug_capacity = sdebug_store_sectors;
+       memset(arr, 0, SDEBUG_READCAP16_ARR_SZ);
+       capac = sdebug_capacity - 1;
+       for (k = 0; k < 8; ++k, capac >>= 8)
+               arr[7 - k] = capac & 0xff;
+       arr[8] = (SECT_SIZE_PER(target) >> 24) & 0xff;
+       arr[9] = (SECT_SIZE_PER(target) >> 16) & 0xff;
+       arr[10] = (SECT_SIZE_PER(target) >> 8) & 0xff;
+       arr[11] = SECT_SIZE_PER(target) & 0xff;
+       return fill_from_dev_buffer(scp, arr,
+                                   min(alloc_len, SDEBUG_READCAP16_ARR_SZ));
+}
+
 /* <<Following mode page info copied from ST318451LW>> */
 
 static int resp_err_recov_pg(unsigned char * p, int pcontrol, int target)
@@ -772,27 +1228,98 @@ static int resp_caching_pg(unsigned char * p, int pcontrol, int target)
 
 static int resp_ctrl_m_pg(unsigned char * p, int pcontrol, int target)
 {      /* Control mode page for mode_sense */
-       unsigned char ctrl_m_pg[] = {0xa, 10, 2, 0, 0, 0, 0, 0,
+       unsigned char ch_ctrl_m_pg[] = {/* 0xa, 10, */ 0x6, 0, 0, 0, 0, 0,
+                                       0, 0, 0, 0};
+       unsigned char d_ctrl_m_pg[] = {0xa, 10, 2, 0, 0, 0, 0, 0,
                                     0, 0, 0x2, 0x4b};
 
        if (scsi_debug_dsense)
                ctrl_m_pg[2] |= 0x4;
+       else
+               ctrl_m_pg[2] &= ~0x4;
        memcpy(p, ctrl_m_pg, sizeof(ctrl_m_pg));
        if (1 == pcontrol)
-               memset(p + 2, 0, sizeof(ctrl_m_pg) - 2);
+               memcpy(p + 2, ch_ctrl_m_pg, sizeof(ch_ctrl_m_pg));
+       else if (2 == pcontrol)
+               memcpy(p, d_ctrl_m_pg, sizeof(d_ctrl_m_pg));
        return sizeof(ctrl_m_pg);
 }
 
+
 static int resp_iec_m_pg(unsigned char * p, int pcontrol, int target)
 {      /* Informational Exceptions control mode page for mode_sense */
-       unsigned char iec_m_pg[] = {0x1c, 0xa, 0x08, 0, 0, 0, 0, 0,
-                                   0, 0, 0x0, 0x0};
+       unsigned char ch_iec_m_pg[] = {/* 0x1c, 0xa, */ 0x4, 0xf, 0, 0, 0, 0,
+                                      0, 0, 0x0, 0x0};
+       unsigned char d_iec_m_pg[] = {0x1c, 0xa, 0x08, 0, 0, 0, 0, 0,
+                                     0, 0, 0x0, 0x0};
+
        memcpy(p, iec_m_pg, sizeof(iec_m_pg));
        if (1 == pcontrol)
-               memset(p + 2, 0, sizeof(iec_m_pg) - 2);
+               memcpy(p + 2, ch_iec_m_pg, sizeof(ch_iec_m_pg));
+       else if (2 == pcontrol)
+               memcpy(p, d_iec_m_pg, sizeof(d_iec_m_pg));
        return sizeof(iec_m_pg);
 }
 
+static int resp_sas_sf_m_pg(unsigned char * p, int pcontrol, int target)
+{      /* SAS SSP mode page - short format for mode_sense */
+       unsigned char sas_sf_m_pg[] = {0x19, 0x6,
+               0x6, 0x0, 0x7, 0xd0, 0x0, 0x0};
+
+       memcpy(p, sas_sf_m_pg, sizeof(sas_sf_m_pg));
+       if (1 == pcontrol)
+               memset(p + 2, 0, sizeof(sas_sf_m_pg) - 2);
+       return sizeof(sas_sf_m_pg);
+}
+
+
+static int resp_sas_pcd_m_spg(unsigned char * p, int pcontrol, int target,
+                             int target_dev_id)
+{      /* SAS phy control and discover mode page for mode_sense */
+       unsigned char sas_pcd_m_pg[] = {0x59, 0x1, 0, 0x64, 0, 0x6, 0, 2,
+                   0, 0, 0, 0, 0x10, 0x9, 0x8, 0x0,
+                   0x52, 0x22, 0x22, 0x20, 0x0, 0x0, 0x0, 0x0,
+                   0x51, 0x11, 0x11, 0x10, 0x0, 0x0, 0x0, 0x1,
+                   0x2, 0, 0, 0, 0, 0, 0, 0,
+                   0x88, 0x99, 0, 0, 0, 0, 0, 0,
+                   0, 0, 0, 0, 0, 0, 0, 0,
+                   0, 1, 0, 0, 0x10, 0x9, 0x8, 0x0,
+                   0x52, 0x22, 0x22, 0x20, 0x0, 0x0, 0x0, 0x0,
+                   0x51, 0x11, 0x11, 0x10, 0x0, 0x0, 0x0, 0x1,
+                   0x3, 0, 0, 0, 0, 0, 0, 0,
+                   0x88, 0x99, 0, 0, 0, 0, 0, 0,
+                   0, 0, 0, 0, 0, 0, 0, 0,
+               };
+       int port_a, port_b;
+
+       port_a = target_dev_id + 1;
+       port_b = port_a + 1;
+       memcpy(p, sas_pcd_m_pg, sizeof(sas_pcd_m_pg));
+       p[20] = (port_a >> 24);
+       p[21] = (port_a >> 16) & 0xff;
+       p[22] = (port_a >> 8) & 0xff;
+       p[23] = port_a & 0xff;
+       p[48 + 20] = (port_b >> 24);
+       p[48 + 21] = (port_b >> 16) & 0xff;
+       p[48 + 22] = (port_b >> 8) & 0xff;
+       p[48 + 23] = port_b & 0xff;
+       if (1 == pcontrol)
+               memset(p + 4, 0, sizeof(sas_pcd_m_pg) - 4);
+       return sizeof(sas_pcd_m_pg);
+}
+
+static int resp_sas_sha_m_spg(unsigned char * p, int pcontrol)
+{      /* SAS SSP shared protocol specific port mode subpage */
+       unsigned char sas_sha_m_pg[] = {0x59, 0x2, 0, 0xc, 0, 0x6, 0x10, 0,
+                   0, 0, 0, 0, 0, 0, 0, 0,
+               };
+
+       memcpy(p, sas_sha_m_pg, sizeof(sas_sha_m_pg));
+       if (1 == pcontrol)
+               memset(p + 4, 0, sizeof(sas_sha_m_pg) - 4);
+       return sizeof(sas_sha_m_pg);
+}
+
 #define SDEBUG_MAX_MSENSE_SZ 256
 
 static int resp_mode_sense(struct scsi_cmnd * scp, int target,
@@ -801,12 +1328,12 @@ static int resp_mode_sense(struct scsi_cmnd * scp, int target,
        unsigned char dbd;
        int pcontrol, pcode, subpcode;
        unsigned char dev_spec;
-       int alloc_len, msense_6, offset, len, errsts;
+       int alloc_len, msense_6, offset, len, errsts, target_dev_id;
        unsigned char * ap;
        unsigned char arr[SDEBUG_MAX_MSENSE_SZ];
        unsigned char *cmd = (unsigned char *)scp->cmnd;
 
-       if ((errsts = check_reset(scp, devip)))
+       if ((errsts = check_readiness(scp, 1, devip)))
                return errsts;
        dbd = cmd[1] & 0x8;
        pcontrol = (cmd[2] & 0xc0) >> 6;
@@ -820,6 +1347,8 @@ static int resp_mode_sense(struct scsi_cmnd * scp, int target,
                                0);
                return check_condition_result;
        }
+       target_dev_id = ((devip->sdbg_host->shost->host_no + 1) * 2000) +
+                       (devip->target * 1000) - 3;
        dev_spec = DEV_READONLY(target) ? 0x80 : 0x0;
        if (msense_6) {
                arr[2] = dev_spec;
@@ -830,7 +1359,8 @@ static int resp_mode_sense(struct scsi_cmnd * scp, int target,
        }
        ap = arr + offset;
 
-       if (0 != subpcode) { /* TODO: Control Extension page */
+       if ((subpcode > 0x0) && (subpcode < 0xff) && (0x19 != pcode)) {
+               /* TODO: Control Extension page */
                mk_sense_buffer(devip, ILLEGAL_REQUEST, INVALID_FIELD_IN_CDB,
                                0);
                return check_condition_result;
@@ -856,17 +1386,45 @@ static int resp_mode_sense(struct scsi_cmnd * scp, int target,
                len = resp_ctrl_m_pg(ap, pcontrol, target);
                offset += len;
                break;
+       case 0x19:      /* if spc==1 then sas phy, control+discover */
+               if ((subpcode > 0x2) && (subpcode < 0xff)) {
+                       mk_sense_buffer(devip, ILLEGAL_REQUEST,
+                                       INVALID_FIELD_IN_CDB, 0);
+                       return check_condition_result;
+               }
+               len = 0;
+               if ((0x0 == subpcode) || (0xff == subpcode))
+                       len += resp_sas_sf_m_pg(ap + len, pcontrol, target);
+               if ((0x1 == subpcode) || (0xff == subpcode))
+                       len += resp_sas_pcd_m_spg(ap + len, pcontrol, target,
+                                                 target_dev_id);
+               if ((0x2 == subpcode) || (0xff == subpcode))
+                       len += resp_sas_sha_m_spg(ap + len, pcontrol);
+               offset += len;
+               break;
        case 0x1c:      /* Informational Exceptions Mode page, all devices */
                len = resp_iec_m_pg(ap, pcontrol, target);
                offset += len;
                break;
        case 0x3f:      /* Read all Mode pages */
-               len = resp_err_recov_pg(ap, pcontrol, target);
-               len += resp_disconnect_pg(ap + len, pcontrol, target);
-               len += resp_format_pg(ap + len, pcontrol, target);
-               len += resp_caching_pg(ap + len, pcontrol, target);
-               len += resp_ctrl_m_pg(ap + len, pcontrol, target);
-               len += resp_iec_m_pg(ap + len, pcontrol, target);
+               if ((0 == subpcode) || (0xff == subpcode)) {
+                       len = resp_err_recov_pg(ap, pcontrol, target);
+                       len += resp_disconnect_pg(ap + len, pcontrol, target);
+                       len += resp_format_pg(ap + len, pcontrol, target);
+                       len += resp_caching_pg(ap + len, pcontrol, target);
+                       len += resp_ctrl_m_pg(ap + len, pcontrol, target);
+                       len += resp_sas_sf_m_pg(ap + len, pcontrol, target);
+                       if (0xff == subpcode) {
+                               len += resp_sas_pcd_m_spg(ap + len, pcontrol,
+                                                 target, target_dev_id);
+                               len += resp_sas_sha_m_spg(ap + len, pcontrol);
+                       }
+                       len += resp_iec_m_pg(ap + len, pcontrol, target);
+               } else {
+                       mk_sense_buffer(devip, ILLEGAL_REQUEST,
+                                       INVALID_FIELD_IN_CDB, 0);
+                       return check_condition_result;
+                }
                offset += len;
                break;
        default:
@@ -883,71 +1441,274 @@ static int resp_mode_sense(struct scsi_cmnd * scp, int target,
        return fill_from_dev_buffer(scp, arr, min(alloc_len, offset));
 }
 
-static int resp_read(struct scsi_cmnd * SCpnt, int upper_blk, int block,
-                    int num, struct sdebug_dev_info * devip)
+#define SDEBUG_MAX_MSELECT_SZ 512
+
+static int resp_mode_select(struct scsi_cmnd * scp, int mselect6,
+                           struct sdebug_dev_info * devip)
+{
+       int pf, sp, ps, md_len, bd_len, off, spf, pg_len;
+       int param_len, res, errsts, mpage;
+       unsigned char arr[SDEBUG_MAX_MSELECT_SZ];
+       unsigned char *cmd = (unsigned char *)scp->cmnd;
+
+       if ((errsts = check_readiness(scp, 1, devip)))
+               return errsts;
+       memset(arr, 0, sizeof(arr));
+       pf = cmd[1] & 0x10;
+       sp = cmd[1] & 0x1;
+       param_len = mselect6 ? cmd[4] : ((cmd[7] << 8) + cmd[8]);
+       if ((0 == pf) || sp || (param_len > SDEBUG_MAX_MSELECT_SZ)) {
+               mk_sense_buffer(devip, ILLEGAL_REQUEST,
+                               INVALID_FIELD_IN_CDB, 0);
+               return check_condition_result;
+       }
+        res = fetch_to_dev_buffer(scp, arr, param_len);
+        if (-1 == res)
+                return (DID_ERROR << 16);
+        else if ((res < param_len) &&
+                 (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts))
+                printk(KERN_INFO "scsi_debug: mode_select: cdb indicated=%d, "
+                       " IO sent=%d bytes\n", param_len, res);
+       md_len = mselect6 ? (arr[0] + 1) : ((arr[0] << 8) + arr[1] + 2);
+       bd_len = mselect6 ? arr[3] : ((arr[6] << 8) + arr[7]);
+       if ((md_len > 2) || (0 != bd_len)) {
+               mk_sense_buffer(devip, ILLEGAL_REQUEST,
+                               INVALID_FIELD_IN_PARAM_LIST, 0);
+               return check_condition_result;
+       }
+       off = bd_len + (mselect6 ? 4 : 8);
+       mpage = arr[off] & 0x3f;
+       ps = !!(arr[off] & 0x80);
+       if (ps) {
+               mk_sense_buffer(devip, ILLEGAL_REQUEST,
+                               INVALID_FIELD_IN_PARAM_LIST, 0);
+               return check_condition_result;
+       }
+       spf = !!(arr[off] & 0x40);
+       pg_len = spf ? ((arr[off + 2] << 8) + arr[off + 3] + 4) :
+                      (arr[off + 1] + 2);
+       if ((pg_len + off) > param_len) {
+               mk_sense_buffer(devip, ILLEGAL_REQUEST,
+                               PARAMETER_LIST_LENGTH_ERR, 0);
+               return check_condition_result;
+       }
+       switch (mpage) {
+       case 0xa:      /* Control Mode page */
+               if (ctrl_m_pg[1] == arr[off + 1]) {
+                       memcpy(ctrl_m_pg + 2, arr + off + 2,
+                              sizeof(ctrl_m_pg) - 2);
+                       scsi_debug_dsense = !!(ctrl_m_pg[2] & 0x4);
+                       return 0;
+               }
+               break;
+       case 0x1c:      /* Informational Exceptions Mode page */
+               if (iec_m_pg[1] == arr[off + 1]) {
+                       memcpy(iec_m_pg + 2, arr + off + 2,
+                              sizeof(iec_m_pg) - 2);
+                       return 0;
+               }
+               break;
+       default:
+               break;
+       }
+       mk_sense_buffer(devip, ILLEGAL_REQUEST,
+                       INVALID_FIELD_IN_PARAM_LIST, 0);
+       return check_condition_result;
+}
+
+static int resp_temp_l_pg(unsigned char * arr)
+{
+       unsigned char temp_l_pg[] = {0x0, 0x0, 0x3, 0x2, 0x0, 38,
+                                    0x0, 0x1, 0x3, 0x2, 0x0, 65,
+               };
+
+        memcpy(arr, temp_l_pg, sizeof(temp_l_pg));
+        return sizeof(temp_l_pg);
+}
+
+static int resp_ie_l_pg(unsigned char * arr)
+{
+       unsigned char ie_l_pg[] = {0x0, 0x0, 0x3, 0x3, 0x0, 0x0, 38,
+               };
+
+        memcpy(arr, ie_l_pg, sizeof(ie_l_pg));
+       if (iec_m_pg[2] & 0x4) {        /* TEST bit set */
+               arr[4] = THRESHOLD_EXCEEDED;
+               arr[5] = 0xff;
+       }
+        return sizeof(ie_l_pg);
+}
+
+#define SDEBUG_MAX_LSENSE_SZ 512
+
+static int resp_log_sense(struct scsi_cmnd * scp,
+                          struct sdebug_dev_info * devip)
+{
+       int ppc, sp, pcontrol, pcode, alloc_len, errsts, len, n;
+       unsigned char arr[SDEBUG_MAX_LSENSE_SZ];
+       unsigned char *cmd = (unsigned char *)scp->cmnd;
+
+       if ((errsts = check_readiness(scp, 1, devip)))
+               return errsts;
+       memset(arr, 0, sizeof(arr));
+       ppc = cmd[1] & 0x2;
+       sp = cmd[1] & 0x1;
+       if (ppc || sp) {
+               mk_sense_buffer(devip, ILLEGAL_REQUEST,
+                               INVALID_FIELD_IN_CDB, 0);
+               return check_condition_result;
+       }
+       pcontrol = (cmd[2] & 0xc0) >> 6;
+       pcode = cmd[2] & 0x3f;
+       alloc_len = (cmd[7] << 8) + cmd[8];
+       arr[0] = pcode;
+       switch (pcode) {
+       case 0x0:       /* Supported log pages log page */
+               n = 4;
+               arr[n++] = 0x0;         /* this page */
+               arr[n++] = 0xd;         /* Temperature */
+               arr[n++] = 0x2f;        /* Informational exceptions */
+               arr[3] = n - 4;
+               break;
+       case 0xd:       /* Temperature log page */
+               arr[3] = resp_temp_l_pg(arr + 4);
+               break;
+       case 0x2f:      /* Informational exceptions log page */
+               arr[3] = resp_ie_l_pg(arr + 4);
+               break;
+       default:
+               mk_sense_buffer(devip, ILLEGAL_REQUEST,
+                               INVALID_FIELD_IN_CDB, 0);
+               return check_condition_result;
+       }
+       len = min(((arr[2] << 8) + arr[3]) + 4, alloc_len);
+       return fill_from_dev_buffer(scp, arr,
+                   min(len, SDEBUG_MAX_INQ_ARR_SZ));
+}
+
+static int resp_read(struct scsi_cmnd * SCpnt, unsigned long long lba,
+                    unsigned int num, struct sdebug_dev_info * devip)
 {
        unsigned long iflags;
+       unsigned int block, from_bottom;
+       unsigned long long u;
        int ret;
 
-       if (upper_blk || (block + num > sdebug_capacity)) {
+       if (lba + num > sdebug_capacity) {
                mk_sense_buffer(devip, ILLEGAL_REQUEST, ADDR_OUT_OF_RANGE,
                                0);
                return check_condition_result;
        }
+       /* transfer length excessive (tie in to block limits VPD page) */
+       if (num > sdebug_store_sectors) {
+               mk_sense_buffer(devip, ILLEGAL_REQUEST, INVALID_FIELD_IN_CDB,
+                               0);
+               return check_condition_result;
+       }
        if ((SCSI_DEBUG_OPT_MEDIUM_ERR & scsi_debug_opts) &&
-           (block <= OPT_MEDIUM_ERR_ADDR) &&
-           ((block + num) > OPT_MEDIUM_ERR_ADDR)) {
+           (lba <= OPT_MEDIUM_ERR_ADDR) &&
+           ((lba + num) > OPT_MEDIUM_ERR_ADDR)) {
+               /* claim unrecoverable read error */
                mk_sense_buffer(devip, MEDIUM_ERROR, UNRECOVERED_READ_ERR,
                                0);
-               /* claim unrecoverable read error */
+               /* set info field and valid bit for fixed descriptor */
+               if (0x70 == (devip->sense_buff[0] & 0x7f)) {
+                       devip->sense_buff[0] |= 0x80;   /* Valid bit */
+                       ret = OPT_MEDIUM_ERR_ADDR;
+                       devip->sense_buff[3] = (ret >> 24) & 0xff;
+                       devip->sense_buff[4] = (ret >> 16) & 0xff;
+                       devip->sense_buff[5] = (ret >> 8) & 0xff;
+                       devip->sense_buff[6] = ret & 0xff;
+               }
                return check_condition_result;
        }
        read_lock_irqsave(&atomic_rw, iflags);
-       ret = fill_from_dev_buffer(SCpnt, fake_storep + (block * SECT_SIZE),
-                                  num * SECT_SIZE);
+       if ((lba + num) <= sdebug_store_sectors)
+               ret = fill_from_dev_buffer(SCpnt,
+                                          fake_storep + (lba * SECT_SIZE),
+                                          num * SECT_SIZE);
+       else {
+               /* modulo when one arg is 64 bits needs do_div() */
+               u = lba;
+               block = do_div(u, sdebug_store_sectors);
+               from_bottom = 0;
+               if ((block + num) > sdebug_store_sectors)
+                       from_bottom = (block + num) - sdebug_store_sectors;
+               ret = fill_from_dev_buffer(SCpnt,
+                                          fake_storep + (block * SECT_SIZE),
+                                          (num - from_bottom) * SECT_SIZE);
+               if ((0 == ret) && (from_bottom > 0))
+                       ret = fill_from_dev_buffer(SCpnt, fake_storep,
+                                                  from_bottom * SECT_SIZE);
+       }
        read_unlock_irqrestore(&atomic_rw, iflags);
        return ret;
 }
 
-static int resp_write(struct scsi_cmnd * SCpnt, int upper_blk, int block,
-                     int num, struct sdebug_dev_info * devip)
+static int resp_write(struct scsi_cmnd * SCpnt, unsigned long long lba,
+                     unsigned int num, struct sdebug_dev_info * devip)
 {
        unsigned long iflags;
+       unsigned int block, to_bottom;
+       unsigned long long u;
        int res;
 
-       if (upper_blk || (block + num > sdebug_capacity)) {
+       if (lba + num > sdebug_capacity) {
                mk_sense_buffer(devip, ILLEGAL_REQUEST, ADDR_OUT_OF_RANGE,
                                0);
                return check_condition_result;
        }
+       /* transfer length excessive (tie in to block limits VPD page) */
+       if (num > sdebug_store_sectors) {
+               mk_sense_buffer(devip, ILLEGAL_REQUEST, INVALID_FIELD_IN_CDB,
+                               0);
+               return check_condition_result;
+       }
 
        write_lock_irqsave(&atomic_rw, iflags);
-       res = fetch_to_dev_buffer(SCpnt, fake_storep + (block * SECT_SIZE),
-                                 num * SECT_SIZE);
+       if ((lba + num) <= sdebug_store_sectors)
+               res = fetch_to_dev_buffer(SCpnt,
+                                         fake_storep + (lba * SECT_SIZE),
+                                         num * SECT_SIZE);
+       else {
+               /* modulo when one arg is 64 bits needs do_div() */
+               u = lba;
+               block = do_div(u, sdebug_store_sectors);
+               to_bottom = 0;
+               if ((block + num) > sdebug_store_sectors)
+                       to_bottom = (block + num) - sdebug_store_sectors;
+               res = fetch_to_dev_buffer(SCpnt,
+                                         fake_storep + (block * SECT_SIZE),
+                                         (num - to_bottom) * SECT_SIZE);
+               if ((0 == res) && (to_bottom > 0))
+                       res = fetch_to_dev_buffer(SCpnt, fake_storep,
+                                                 to_bottom * SECT_SIZE);
+       }
        write_unlock_irqrestore(&atomic_rw, iflags);
        if (-1 == res)
                return (DID_ERROR << 16);
        else if ((res < (num * SECT_SIZE)) &&
                 (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts))
-               printk(KERN_INFO "scsi_debug: write: cdb indicated=%d, "
+               printk(KERN_INFO "scsi_debug: write: cdb indicated=%u, "
                       " IO sent=%d bytes\n", num * SECT_SIZE, res);
        return 0;
 }
 
-#define SDEBUG_RLUN_ARR_SZ 128
+#define SDEBUG_RLUN_ARR_SZ 256
 
 static int resp_report_luns(struct scsi_cmnd * scp,
                            struct sdebug_dev_info * devip)
 {
        unsigned int alloc_len;
-       int lun_cnt, i, upper;
+       int lun_cnt, i, upper, num, n, wlun, lun;
        unsigned char *cmd = (unsigned char *)scp->cmnd;
        int select_report = (int)cmd[2];
        struct scsi_lun *one_lun;
        unsigned char arr[SDEBUG_RLUN_ARR_SZ];
+       unsigned char * max_addr;
 
        alloc_len = cmd[9] + (cmd[8] << 8) + (cmd[7] << 16) + (cmd[6] << 24);
-       if ((alloc_len < 16) || (select_report > 2)) {
+       if ((alloc_len < 4) || (select_report > 2)) {
                mk_sense_buffer(devip, ILLEGAL_REQUEST, INVALID_FIELD_IN_CDB,
                                0);
                return check_condition_result;
@@ -955,18 +1716,37 @@ static int resp_report_luns(struct scsi_cmnd * scp,
        /* can produce response with up to 16k luns (lun 0 to lun 16383) */
        memset(arr, 0, SDEBUG_RLUN_ARR_SZ);
        lun_cnt = scsi_debug_max_luns;
-       arr[2] = ((sizeof(struct scsi_lun) * lun_cnt) >> 8) & 0xff;
-       arr[3] = (sizeof(struct scsi_lun) * lun_cnt) & 0xff;
-       lun_cnt = min((int)((SDEBUG_RLUN_ARR_SZ - 8) /
-                           sizeof(struct scsi_lun)), lun_cnt);
+       if (1 == select_report)
+               lun_cnt = 0;
+       else if (scsi_debug_no_lun_0 && (lun_cnt > 0))
+               --lun_cnt;
+       wlun = (select_report > 0) ? 1 : 0;
+       num = lun_cnt + wlun;
+       arr[2] = ((sizeof(struct scsi_lun) * num) >> 8) & 0xff;
+       arr[3] = (sizeof(struct scsi_lun) * num) & 0xff;
+       n = min((int)((SDEBUG_RLUN_ARR_SZ - 8) /
+                           sizeof(struct scsi_lun)), num);
+       if (n < num) {
+               wlun = 0;
+               lun_cnt = n;
+       }
        one_lun = (struct scsi_lun *) &arr[8];
-       for (i = 0; i < lun_cnt; i++) {
-               upper = (i >> 8) & 0x3f;
+       max_addr = arr + SDEBUG_RLUN_ARR_SZ;
+       for (i = 0, lun = (scsi_debug_no_lun_0 ? 1 : 0);
+             ((i < lun_cnt) && ((unsigned char *)(one_lun + i) < max_addr));
+            i++, lun++) {
+               upper = (lun >> 8) & 0x3f;
                if (upper)
                        one_lun[i].scsi_lun[0] =
                            (upper | (SAM2_LUN_ADDRESS_METHOD << 6));
-               one_lun[i].scsi_lun[1] = i & 0xff;
+               one_lun[i].scsi_lun[1] = lun & 0xff;
+       }
+       if (wlun) {
+               one_lun[i].scsi_lun[0] = (SAM2_WLUN_REPORT_LUNS >> 8) & 0xff;
+               one_lun[i].scsi_lun[1] = SAM2_WLUN_REPORT_LUNS & 0xff;
+               i++;
        }
+       alloc_len = (unsigned char *)(one_lun + i) - arr;
        return fill_from_dev_buffer(scp, arr,
                                    min((int)alloc_len, SDEBUG_RLUN_ARR_SZ));
 }
@@ -1002,7 +1782,8 @@ static void timer_intr_handler(unsigned long indx)
 static int scsi_debug_slave_alloc(struct scsi_device * sdp)
 {
        if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)
-               sdev_printk(KERN_INFO, sdp, "scsi_debug: slave_alloc\n");
+               printk(KERN_INFO "scsi_debug: slave_alloc <%u %u %u %u>\n",
+                      sdp->host->host_no, sdp->channel, sdp->id, sdp->lun);
        return 0;
 }
 
@@ -1011,7 +1792,8 @@ static int scsi_debug_slave_configure(struct scsi_device * sdp)
        struct sdebug_dev_info * devip;
 
        if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)
-               sdev_printk(KERN_INFO, sdp, "scsi_debug: slave_configure\n");
+               printk(KERN_INFO "scsi_debug: slave_configure <%u %u %u %u>\n",
+                      sdp->host->host_no, sdp->channel, sdp->id, sdp->lun);
        if (sdp->host->max_cmd_len != SCSI_DEBUG_MAX_CMD_LEN)
                sdp->host->max_cmd_len = SCSI_DEBUG_MAX_CMD_LEN;
        devip = devInfoReg(sdp);
@@ -1019,6 +1801,7 @@ static int scsi_debug_slave_configure(struct scsi_device * sdp)
        if (sdp->host->cmd_per_lun)
                scsi_adjust_queue_depth(sdp, SDEBUG_TAGGED_QUEUING,
                                        sdp->host->cmd_per_lun);
+       blk_queue_max_segment_size(sdp->request_queue, 256 * 1024);
        return 0;
 }
 
@@ -1028,7 +1811,8 @@ static void scsi_debug_slave_destroy(struct scsi_device * sdp)
                                (struct sdebug_dev_info *)sdp->hostdata;
 
        if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)
-               sdev_printk(KERN_INFO, sdp, "scsi_debug: slave_destroy\n");
+               printk(KERN_INFO "scsi_debug: slave_destroy <%u %u %u %u>\n",
+                      sdp->host->host_no, sdp->channel, sdp->id, sdp->lun);
        if (devip) {
                /* make this slot avaliable for re-use */
                devip->used = 0;
@@ -1085,6 +1869,8 @@ static struct sdebug_dev_info * devInfoReg(struct scsi_device * sdev)
                        open_devip->sense_buff[0] = 0x70;
                        open_devip->sense_buff[7] = 0xa;
                }
+               if (sdev->lun == SAM2_WLUN_REPORT_LUNS)
+                       open_devip->wlun = SAM2_WLUN_REPORT_LUNS & 0xff;
                return open_devip;
         }
         return NULL;
@@ -1273,7 +2059,7 @@ static void __init sdebug_build_parts(unsigned char * ramp)
                printk(KERN_WARNING "scsi_debug:build_parts: reducing "
                                    "partitions to %d\n", SDEBUG_MAX_PARTS);
        }
-       num_sectors = (int)(sdebug_store_size / SECT_SIZE);
+       num_sectors = (int)sdebug_store_sectors;
        sectors_per_part = (num_sectors - sdebug_sectors_per)
                           / scsi_debug_num_parts;
        heads_by_sects = sdebug_heads * sdebug_sectors_per;
@@ -1316,9 +2102,9 @@ static int schedule_resp(struct scsi_cmnd * cmnd,
                if (scsi_result) {
                        struct scsi_device * sdp = cmnd->device;
 
-                       sdev_printk(KERN_INFO, sdp,
-                               "non-zero result=0x%x\n",
-                               scsi_result);
+                       printk(KERN_INFO "scsi_debug:    <%u %u %u %u> "
+                              "non-zero result=0x%x\n", sdp->host->host_no,
+                              sdp->channel, sdp->id, sdp->lun, scsi_result);
                }
        }
        if (cmnd && devip) {
@@ -1365,21 +2151,19 @@ static int schedule_resp(struct scsi_cmnd * cmnd,
        }
 }
 
-/* Set 'perm' (4th argument) to 0 to disable module_param's definition
- * of sysfs parameters (which module_param doesn't yet support).
- * Sysfs parameters defined explicitly below.
- */
-module_param_named(add_host, scsi_debug_add_host, int, 0); /* perm=0644 */
-module_param_named(delay, scsi_debug_delay, int, 0); /* perm=0644 */
-module_param_named(dev_size_mb, scsi_debug_dev_size_mb, int, 0);
-module_param_named(dsense, scsi_debug_dsense, int, 0);
-module_param_named(every_nth, scsi_debug_every_nth, int, 0);
-module_param_named(max_luns, scsi_debug_max_luns, int, 0);
-module_param_named(num_parts, scsi_debug_num_parts, int, 0);
-module_param_named(num_tgts, scsi_debug_num_tgts, int, 0);
-module_param_named(opts, scsi_debug_opts, int, 0); /* perm=0644 */
-module_param_named(ptype, scsi_debug_ptype, int, 0);
-module_param_named(scsi_level, scsi_debug_scsi_level, int, 0);
+module_param_named(add_host, scsi_debug_add_host, int, S_IRUGO | S_IWUSR);
+module_param_named(delay, scsi_debug_delay, int, S_IRUGO | S_IWUSR);
+module_param_named(dev_size_mb, scsi_debug_dev_size_mb, int, S_IRUGO);
+module_param_named(dsense, scsi_debug_dsense, int, S_IRUGO | S_IWUSR);
+module_param_named(every_nth, scsi_debug_every_nth, int, S_IRUGO | S_IWUSR);
+module_param_named(max_luns, scsi_debug_max_luns, int, S_IRUGO | S_IWUSR);
+module_param_named(no_lun_0, scsi_debug_no_lun_0, int, S_IRUGO | S_IWUSR);
+module_param_named(num_parts, scsi_debug_num_parts, int, S_IRUGO);
+module_param_named(num_tgts, scsi_debug_num_tgts, int, S_IRUGO | S_IWUSR);
+module_param_named(opts, scsi_debug_opts, int, S_IRUGO | S_IWUSR);
+module_param_named(ptype, scsi_debug_ptype, int, S_IRUGO | S_IWUSR);
+module_param_named(scsi_level, scsi_debug_scsi_level, int, S_IRUGO);
+module_param_named(virtual_gb, scsi_debug_virtual_gb, int, S_IRUGO | S_IWUSR);
 
 MODULE_AUTHOR("Eric Youngdale + Douglas Gilbert");
 MODULE_DESCRIPTION("SCSI debug adapter driver");
@@ -1388,15 +2172,17 @@ MODULE_VERSION(SCSI_DEBUG_VERSION);
 
 MODULE_PARM_DESC(add_host, "0..127 hosts allowed(def=1)");
 MODULE_PARM_DESC(delay, "# of jiffies to delay response(def=1)");
-MODULE_PARM_DESC(dev_size_mb, "size in MB of ram shared by devs");
-MODULE_PARM_DESC(dsense, "use descriptor sense format(def: fixed)");
+MODULE_PARM_DESC(dev_size_mb, "size in MB of ram shared by devs(def=8)");
+MODULE_PARM_DESC(dsense, "use descriptor sense format(def=0 -> fixed)");
 MODULE_PARM_DESC(every_nth, "timeout every nth command(def=100)");
-MODULE_PARM_DESC(max_luns, "number of SCSI LUNs per target to simulate");
+MODULE_PARM_DESC(max_luns, "number of LUNs per target to simulate(def=1)");
+MODULE_PARM_DESC(no_lun_0, "no LU number 0 (def=0 -> have lun 0)");
 MODULE_PARM_DESC(num_parts, "number of partitions(def=0)");
-MODULE_PARM_DESC(num_tgts, "number of SCSI targets per host to simulate");
-MODULE_PARM_DESC(opts, "1->noise, 2->medium_error, 4->...");
+MODULE_PARM_DESC(num_tgts, "number of targets per host to simulate(def=1)");
+MODULE_PARM_DESC(opts, "1->noise, 2->medium_error, 4->... (def=0)");
 MODULE_PARM_DESC(ptype, "SCSI peripheral type(def=0[disk])");
 MODULE_PARM_DESC(scsi_level, "SCSI level to simulate(def=5[SPC-3])");
+MODULE_PARM_DESC(virtual_gb, "virtual gigabyte size (def=0 -> use dev_size_mb)");
 
 
 static char sdebug_info[256];
@@ -1548,6 +2334,24 @@ static ssize_t sdebug_dsense_store(struct device_driver * ddp,
 DRIVER_ATTR(dsense, S_IRUGO | S_IWUSR, sdebug_dsense_show,
            sdebug_dsense_store);
 
+static ssize_t sdebug_no_lun_0_show(struct device_driver * ddp, char * buf)
+{
+        return scnprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_no_lun_0);
+}
+static ssize_t sdebug_no_lun_0_store(struct device_driver * ddp,
+                                    const char * buf, size_t count)
+{
+        int n;
+
+       if ((count > 0) && (1 == sscanf(buf, "%d", &n)) && (n >= 0)) {
+               scsi_debug_no_lun_0 = n;
+               return count;
+       }
+       return -EINVAL;
+}
+DRIVER_ATTR(no_lun_0, S_IRUGO | S_IWUSR, sdebug_no_lun_0_show,
+           sdebug_no_lun_0_store);
+
 static ssize_t sdebug_num_tgts_show(struct device_driver * ddp, char * buf)
 {
         return scnprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_num_tgts);
@@ -1623,6 +2427,29 @@ static ssize_t sdebug_scsi_level_show(struct device_driver * ddp, char * buf)
 }
 DRIVER_ATTR(scsi_level, S_IRUGO, sdebug_scsi_level_show, NULL);
 
+static ssize_t sdebug_virtual_gb_show(struct device_driver * ddp, char * buf)
+{
+        return scnprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_virtual_gb);
+}
+static ssize_t sdebug_virtual_gb_store(struct device_driver * ddp,
+                                      const char * buf, size_t count)
+{
+        int n;
+
+       if ((count > 0) && (1 == sscanf(buf, "%d", &n)) && (n >= 0)) {
+               scsi_debug_virtual_gb = n;
+               if (scsi_debug_virtual_gb > 0) {
+                       sdebug_capacity = 2048 * 1024;
+                       sdebug_capacity *= scsi_debug_virtual_gb;
+               } else
+                       sdebug_capacity = sdebug_store_sectors;
+               return count;
+       }
+       return -EINVAL;
+}
+DRIVER_ATTR(virtual_gb, S_IRUGO | S_IWUSR, sdebug_virtual_gb_show,
+           sdebug_virtual_gb_store);
+
 static ssize_t sdebug_add_host_show(struct device_driver * ddp, char * buf)
 {
         return scnprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_add_host);
@@ -1692,14 +2519,19 @@ static void do_remove_driverfs_files(void)
 
 static int __init scsi_debug_init(void)
 {
-       unsigned long sz;
+       unsigned int sz;
        int host_to_add;
        int k;
 
        if (scsi_debug_dev_size_mb < 1)
                scsi_debug_dev_size_mb = 1;  /* force minimum 1 MB ramdisk */
-       sdebug_store_size = (unsigned long)scsi_debug_dev_size_mb * 1048576;
-       sdebug_capacity = sdebug_store_size / SECT_SIZE;
+       sdebug_store_size = (unsigned int)scsi_debug_dev_size_mb * 1048576;
+       sdebug_store_sectors = sdebug_store_size / SECT_SIZE;
+       if (scsi_debug_virtual_gb > 0) {
+               sdebug_capacity = 2048 * 1024;
+               sdebug_capacity *= scsi_debug_virtual_gb;
+       } else
+               sdebug_capacity = sdebug_store_sectors;
 
        /* play around with geometry, don't waste too much on track 0 */
        sdebug_heads = 8;
@@ -1813,7 +2645,7 @@ static int sdebug_add_adapter(void)
         struct sdebug_dev_info *sdbg_devinfo;
         struct list_head *lh, *lh_sf;
 
-        sdbg_host = kzalloc(sizeof(*sdbg_host), GFP_KERNEL);
+        sdbg_host = kzalloc(sizeof(*sdbg_host),GFP_KERNEL);
 
         if (NULL == sdbg_host) {
                 printk(KERN_ERR "%s: out of memory at line %d\n",
@@ -1825,7 +2657,7 @@ static int sdebug_add_adapter(void)
 
        devs_per_host = scsi_debug_num_tgts * scsi_debug_max_luns;
         for (k = 0; k < devs_per_host; k++) {
-                sdbg_devinfo = kzalloc(sizeof(*sdbg_devinfo), GFP_KERNEL);
+                sdbg_devinfo = kzalloc(sizeof(*sdbg_devinfo),GFP_KERNEL);
                 if (NULL == sdbg_devinfo) {
                         printk(KERN_ERR "%s: out of memory at line %d\n",
                                __FUNCTION__, __LINE__);
@@ -1906,7 +2738,7 @@ static int sdebug_driver_probe(struct device * dev)
                hpnt->max_id = scsi_debug_num_tgts + 1;
        else
                hpnt->max_id = scsi_debug_num_tgts;
-       hpnt->max_lun = scsi_debug_max_luns;
+       hpnt->max_lun = SAM2_WLUN_REPORT_LUNS;  /* = scsi_debug_max_luns; */
 
         error = scsi_add_host(hpnt, &sdbg_host->dev);
         if (error) {
@@ -1960,7 +2792,7 @@ static void sdebug_max_tgts_luns(void)
                        hpnt->max_id = scsi_debug_num_tgts + 1;
                else
                        hpnt->max_id = scsi_debug_num_tgts;
-               hpnt->max_lun = scsi_debug_max_luns;
+               hpnt->max_lun = SAM2_WLUN_REPORT_LUNS; /* scsi_debug_max_luns; */
        }
        spin_unlock(&sdebug_host_list_lock);
 }
index fb5cb4c9ac65b24bcced53b9adf9811a443852b2..3d0429bc14abeb74052ea756790b41bf1de4f894 100644 (file)
@@ -162,7 +162,7 @@ static struct {
        {"HITACHI", "DISK-SUBSYSTEM", "*", BLIST_ATTACH_PQ3 | BLIST_SPARSELUN | BLIST_LARGELUN},
        {"HITACHI", "OPEN-E", "*", BLIST_ATTACH_PQ3 | BLIST_SPARSELUN | BLIST_LARGELUN},
        {"HP", "A6189A", NULL, BLIST_SPARSELUN | BLIST_LARGELUN},       /* HP VA7400 */
-       {"HP", "OPEN-", "*", BLIST_SPARSELUN | BLIST_LARGELUN}, /* HP XP Arrays */
+       {"HP", "OPEN-", "*", BLIST_REPORTLUN2}, /* HP XP Arrays */
        {"HP", "NetRAID-4M", NULL, BLIST_FORCELUN},
        {"HP", "HSV100", NULL, BLIST_REPORTLUN2 | BLIST_NOSTARTONADD},
        {"HP", "C1557A", NULL, BLIST_FORCELUN},
index 6a7a60fc0a4e54eaa069012ed71cfa9b86f4a6df..6683d596234a7acab897066d96cad4f25af49608 100644 (file)
@@ -1672,7 +1672,9 @@ int
 scsi_reset_provider(struct scsi_device *dev, int flag)
 {
        struct scsi_cmnd *scmd = scsi_get_command(dev, GFP_KERNEL);
+       struct Scsi_Host *shost = dev->host;
        struct request req;
+       unsigned long flags;
        int rtn;
 
        scmd->request = &req;
@@ -1699,6 +1701,10 @@ scsi_reset_provider(struct scsi_device *dev, int flag)
         */
        scmd->pid                       = 0;
 
+       spin_lock_irqsave(shost->host_lock, flags);
+       shost->tmf_in_progress = 1;
+       spin_unlock_irqrestore(shost->host_lock, flags);
+
        switch (flag) {
        case SCSI_TRY_RESET_DEVICE:
                rtn = scsi_try_bus_device_reset(scmd);
@@ -1717,6 +1723,22 @@ scsi_reset_provider(struct scsi_device *dev, int flag)
                rtn = FAILED;
        }
 
+       spin_lock_irqsave(shost->host_lock, flags);
+       shost->tmf_in_progress = 0;
+       spin_unlock_irqrestore(shost->host_lock, flags);
+
+       /*
+        * be sure to wake up anyone who was sleeping or had their queue
+        * suspended while we performed the TMF.
+        */
+       SCSI_LOG_ERROR_RECOVERY(3,
+               printk("%s: waking up host to restart after TMF\n",
+               __FUNCTION__));
+
+       wake_up(&shost->host_wait);
+
+       scsi_run_host_queues(shost);
+
        scsi_next_command(scmd);
        return rtn;
 }
index 3d04a9f386acc51744aad2c098b7ee3b9abeb518..08af9aae7df38e22f86c6d17da7dc4fc491edb72 100644 (file)
@@ -855,8 +855,7 @@ static void scsi_release_buffers(struct scsi_cmnd *cmd)
  *             b) We can just use scsi_requeue_command() here.  This would
  *                be used if we just wanted to retry, for example.
  */
-void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes,
-                       unsigned int block_bytes)
+void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
 {
        int result = cmd->result;
        int this_count = cmd->bufflen;
@@ -921,87 +920,70 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes,
         * Next deal with any sectors which we were able to correctly
         * handle.
         */
-       if (good_bytes >= 0) {
-               SCSI_LOG_HLCOMPLETE(1, printk("%ld sectors total, %d bytes done.\n",
-                                             req->nr_sectors, good_bytes));
-               SCSI_LOG_HLCOMPLETE(1, printk("use_sg is %d\n", cmd->use_sg));
+       SCSI_LOG_HLCOMPLETE(1, printk("%ld sectors total, "
+                                     "%d bytes done.\n",
+                                     req->nr_sectors, good_bytes));
+       SCSI_LOG_HLCOMPLETE(1, printk("use_sg is %d\n", cmd->use_sg));
 
-               if (clear_errors)
-                       req->errors = 0;
-               /*
-                * If multiple sectors are requested in one buffer, then
-                * they will have been finished off by the first command.
-                * If not, then we have a multi-buffer command.
-                *
-                * If block_bytes != 0, it means we had a medium error
-                * of some sort, and that we want to mark some number of
-                * sectors as not uptodate.  Thus we want to inhibit
-                * requeueing right here - we will requeue down below
-                * when we handle the bad sectors.
-                */
+       if (clear_errors)
+               req->errors = 0;
 
-               /*
-                * If the command completed without error, then either
-                * finish off the rest of the command, or start a new one.
-                */
-               if (scsi_end_request(cmd, 1, good_bytes, result == 0) == NULL)
-                       return;
-       }
-       /*
-        * Now, if we were good little boys and girls, Santa left us a request
-        * sense buffer.  We can extract information from this, so we
-        * can choose a block to remap, etc.
+       /* A number of bytes were successfully read.  If there
+        * are leftovers and there is some kind of error
+        * (result != 0), retry the rest.
+        */
+       if (scsi_end_request(cmd, 1, good_bytes, result == 0) == NULL)
+               return;
+
+       /* good_bytes = 0, or (inclusive) there were leftovers and
+        * result = 0, so scsi_end_request couldn't retry.
         */
        if (sense_valid && !sense_deferred) {
                switch (sshdr.sense_key) {
                case UNIT_ATTENTION:
                        if (cmd->device->removable) {
-                               /* detected disc change.  set a bit 
+                               /* Detected disc change.  Set a bit
                                 * and quietly refuse further access.
                                 */
                                cmd->device->changed = 1;
-                               scsi_end_request(cmd, 0,
-                                               this_count, 1);
+                               scsi_end_request(cmd, 0, this_count, 1);
                                return;
                        } else {
-                               /*
-                               * Must have been a power glitch, or a
-                               * bus reset.  Could not have been a
-                               * media change, so we just retry the
-                               * request and see what happens.  
-                               */
+                               /* Must have been a power glitch, or a
+                                * bus reset.  Could not have been a
+                                * media change, so we just retry the
+                                * request and see what happens.
+                                */
                                scsi_requeue_command(q, cmd);
                                return;
                        }
                        break;
                case ILLEGAL_REQUEST:
-                       /*
-                       * If we had an ILLEGAL REQUEST returned, then we may
-                       * have performed an unsupported command.  The only
-                       * thing this should be would be a ten byte read where
-                       * only a six byte read was supported.  Also, on a
-                       * system where READ CAPACITY failed, we may have read
-                       * past the end of the disk.
-                       */
+                       /* If we had an ILLEGAL REQUEST returned, then
+                        * we may have performed an unsupported
+                        * command.  The only thing this should be
+                        * would be a ten byte read where only a six
+                        * byte read was supported.  Also, on a system
+                        * where READ CAPACITY failed, we may have
+                        * read past the end of the disk.
+                        */
                        if ((cmd->device->use_10_for_rw &&
                            sshdr.asc == 0x20 && sshdr.ascq == 0x00) &&
                            (cmd->cmnd[0] == READ_10 ||
                             cmd->cmnd[0] == WRITE_10)) {
                                cmd->device->use_10_for_rw = 0;
-                               /*
-                                * This will cause a retry with a 6-byte
-                                * command.
+                               /* This will cause a retry with a
+                                * 6-byte command.
                                 */
                                scsi_requeue_command(q, cmd);
-                               result = 0;
+                               return;
                        } else {
                                scsi_end_request(cmd, 0, this_count, 1);
                                return;
                        }
                        break;
                case NOT_READY:
-                       /*
-                        * If the device is in the process of becoming
+                       /* If the device is in the process of becoming
                         * ready, or has a temporary blockage, retry.
                         */
                        if (sshdr.asc == 0x04) {
@@ -1021,7 +1003,7 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes,
                        }
                        if (!(req->flags & REQ_QUIET)) {
                                scmd_printk(KERN_INFO, cmd,
-                                          "Device not ready: ");
+                                           "Device not ready: ");
                                scsi_print_sense_hdr("", &sshdr);
                        }
                        scsi_end_request(cmd, 0, this_count, 1);
@@ -1029,21 +1011,21 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes,
                case VOLUME_OVERFLOW:
                        if (!(req->flags & REQ_QUIET)) {
                                scmd_printk(KERN_INFO, cmd,
-                                          "Volume overflow, CDB: ");
+                                           "Volume overflow, CDB: ");
                                __scsi_print_command(cmd->data_cmnd);
                                scsi_print_sense("", cmd);
                        }
-                       scsi_end_request(cmd, 0, block_bytes, 1);
+                       /* See SSC3rXX or current. */
+                       scsi_end_request(cmd, 0, this_count, 1);
                        return;
                default:
                        break;
                }
-       }                       /* driver byte != 0 */
+       }
        if (host_byte(result) == DID_RESET) {
-               /*
-                * Third party bus reset or reset for error
-                * recovery reasons.  Just retry the request
-                * and see what happens.  
+               /* Third party bus reset or reset for error recovery
+                * reasons.  Just retry the request and see what
+                * happens.
                 */
                scsi_requeue_command(q, cmd);
                return;
@@ -1051,21 +1033,13 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes,
        if (result) {
                if (!(req->flags & REQ_QUIET)) {
                        scmd_printk(KERN_INFO, cmd,
-                                  "SCSI error: return code = 0x%x\n", result);
-
+                                   "SCSI error: return code = 0x%08x\n",
+                                   result);
                        if (driver_byte(result) & DRIVER_SENSE)
                                scsi_print_sense("", cmd);
                }
-               /*
-                * Mark a single buffer as not uptodate.  Queue the remainder.
-                * We sometimes get this cruft in the event that a medium error
-                * isn't properly reported.
-                */
-               block_bytes = req->hard_cur_sectors << 9;
-               if (!block_bytes)
-                       block_bytes = req->data_len;
-               scsi_end_request(cmd, 0, block_bytes, 1);
        }
+       scsi_end_request(cmd, 0, this_count, !result);
 }
 EXPORT_SYMBOL(scsi_io_completion);
 
@@ -1169,7 +1143,7 @@ static void scsi_blk_pc_done(struct scsi_cmnd *cmd)
         * successfully. Since this is a REQ_BLOCK_PC command the
         * caller should check the request's errors value
         */
-       scsi_io_completion(cmd, cmd->bufflen, 0);
+       scsi_io_completion(cmd, cmd->bufflen);
 }
 
 static void scsi_setup_blk_pc_cmnd(struct scsi_cmnd *cmd)
@@ -2050,6 +2024,7 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state)
                switch (oldstate) {
                case SDEV_CREATED:
                case SDEV_RUNNING:
+               case SDEV_QUIESCE:
                case SDEV_OFFLINE:
                case SDEV_BLOCK:
                        break;
@@ -2060,6 +2035,9 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state)
 
        case SDEV_DEL:
                switch (oldstate) {
+               case SDEV_CREATED:
+               case SDEV_RUNNING:
+               case SDEV_OFFLINE:
                case SDEV_CANCEL:
                        break;
                default:
index a3e2af6a846c732ac0298a26cc58a4ed29a5aa49..1f65139e14f8d3e9dc470c696c1e3aedabf344a8 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _SCSI_LOGGING_H
 #define _SCSI_LOGGING_H
 
-#include <linux/config.h>
 
 /*
  * This defines the scsi logging feature.  It is a means by which the user
index a1727a0e1bdd7cd1eaced522ba5636f66ff74898..e2fbe9a9d5a98945a9641d86f4adb9cc72ab86f9 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _SCSI_PRIV_H
 #define _SCSI_PRIV_H
 
-#include <linux/config.h>
 #include <linux/device.h>
 
 struct request_queue;
@@ -117,7 +116,7 @@ extern struct bus_type scsi_bus_type;
  * classes.
  */
 
-#define SCSI_DEVICE_BLOCK_MAX_TIMEOUT  (HZ*60)
+#define SCSI_DEVICE_BLOCK_MAX_TIMEOUT  600     /* units in seconds */
 extern int scsi_internal_device_block(struct scsi_device *sdev);
 extern int scsi_internal_device_unblock(struct scsi_device *sdev);
 
index d76e6e3d8ca568e1462645465f586db047b0cd13..e1edab45a37bead9919b3657dc8014cbcbb1572b 100644 (file)
@@ -2,7 +2,8 @@
 #define _SCSI_SAS_INTERNAL_H
 
 #define SAS_HOST_ATTRS         0
-#define SAS_PORT_ATTRS         17
+#define SAS_PHY_ATTRS          17
+#define SAS_PORT_ATTRS         1
 #define SAS_RPORT_ATTRS                7
 #define SAS_END_DEV_ATTRS      3
 #define SAS_EXPANDER_ATTRS     7
@@ -13,12 +14,14 @@ struct sas_internal {
        struct sas_domain_function_template *dft;
 
        struct class_device_attribute private_host_attrs[SAS_HOST_ATTRS];
-       struct class_device_attribute private_phy_attrs[SAS_PORT_ATTRS];
+       struct class_device_attribute private_phy_attrs[SAS_PHY_ATTRS];
+       struct class_device_attribute private_port_attrs[SAS_PORT_ATTRS];
        struct class_device_attribute private_rphy_attrs[SAS_RPORT_ATTRS];
        struct class_device_attribute private_end_dev_attrs[SAS_END_DEV_ATTRS];
        struct class_device_attribute private_expander_attrs[SAS_EXPANDER_ATTRS];
 
        struct transport_container phy_attr_cont;
+       struct transport_container port_attr_cont;
        struct transport_container rphy_attr_cont;
        struct transport_container end_dev_attr_cont;
        struct transport_container expander_attr_cont;
@@ -28,7 +31,8 @@ struct sas_internal {
         * needed by scsi_sysfs.c
         */
        struct class_device_attribute *host_attrs[SAS_HOST_ATTRS + 1];
-       struct class_device_attribute *phy_attrs[SAS_PORT_ATTRS + 1];
+       struct class_device_attribute *phy_attrs[SAS_PHY_ATTRS + 1];
+       struct class_device_attribute *port_attrs[SAS_PORT_ATTRS + 1];
        struct class_device_attribute *rphy_attrs[SAS_RPORT_ATTRS + 1];
        struct class_device_attribute *end_dev_attrs[SAS_END_DEV_ATTRS + 1];
        struct class_device_attribute *expander_attrs[SAS_EXPANDER_ATTRS + 1];
index 0f7e6f94d66bd0149bcba35b3c0af6bd9471c780..1bd92b9b46d9ccc5209103beb59cfb75ccafdb5d 100644 (file)
@@ -25,7 +25,6 @@
  *             or a LUN is seen that cannot have a device attached to it.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/init.h>
@@ -810,6 +809,7 @@ static int scsi_add_lun(struct scsi_device *sdev, char *inq_result, int *bflags)
 
 static inline void scsi_destroy_sdev(struct scsi_device *sdev)
 {
+       scsi_device_set_state(sdev, SDEV_DEL);
        if (sdev->host->hostt->slave_destroy)
                sdev->host->hostt->slave_destroy(sdev);
        transport_destroy_device(&sdev->sdev_gendev);
index 5ec7a4fb0145bfc83b488cdae27a1e2a16e9a81a..e7fe565b96de93ffb5354d4c86d36dfd46410806 100644 (file)
@@ -6,7 +6,6 @@
  * Created to pull SCSI mid layer sysfs routines into one file.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/blkdev.h>
index f2db7a41cf1d4dbbb973eb1ad033dbcaa44183e9..b03aa85108e5f0b6860e9d3b405b5087fb6d3aad 100644 (file)
@@ -368,7 +368,7 @@ static DECLARE_TRANSPORT_CLASS(fc_rport_class,
  *   should insulate the loss of a remote port.
  *   The maximum will be capped by the value of SCSI_DEVICE_BLOCK_MAX_TIMEOUT.
  */
-static unsigned int fc_dev_loss_tmo = SCSI_DEVICE_BLOCK_MAX_TIMEOUT;
+static unsigned int fc_dev_loss_tmo = 60;              /* seconds */
 
 module_param_named(dev_loss_tmo, fc_dev_loss_tmo, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(dev_loss_tmo,
@@ -1284,7 +1284,9 @@ EXPORT_SYMBOL(fc_release_transport);
  * @work:      Work to queue for execution.
  *
  * Return value:
- *     0 on success / != 0 for error
+ *     1 - work queued for execution
+ *     0 - work is already queued
+ *     -EINVAL - work queue doesn't exist
  **/
 static int
 fc_queue_work(struct Scsi_Host *shost, struct work_struct *work)
@@ -1434,8 +1436,6 @@ fc_starget_delete(void *data)
        struct Scsi_Host *shost = rport_to_shost(rport);
        unsigned long flags;
 
-       scsi_target_unblock(&rport->dev);
-
        spin_lock_irqsave(shost->host_lock, flags);
        if (rport->flags & FC_RPORT_DEVLOSS_PENDING) {
                spin_unlock_irqrestore(shost->host_lock, flags);
@@ -1476,7 +1476,8 @@ fc_rport_final_delete(void *data)
        transport_remove_device(dev);
        device_del(dev);
        transport_destroy_device(dev);
-       put_device(&shost->shost_gendev);
+       put_device(&shost->shost_gendev);       /* for fc_host->rport list */
+       put_device(dev);                        /* for self-reference */
 }
 
 
@@ -1537,13 +1538,13 @@ fc_rport_create(struct Scsi_Host *shost, int channel,
        else
                rport->scsi_target_id = -1;
        list_add_tail(&rport->peers, &fc_host->rports);
-       get_device(&shost->shost_gendev);
+       get_device(&shost->shost_gendev);       /* for fc_host->rport list */
 
        spin_unlock_irqrestore(shost->host_lock, flags);
 
        dev = &rport->dev;
-       device_initialize(dev);
-       dev->parent = get_device(&shost->shost_gendev);
+       device_initialize(dev);                 /* takes self reference */
+       dev->parent = get_device(&shost->shost_gendev); /* parent reference */
        dev->release = fc_rport_dev_release;
        sprintf(dev->bus_id, "rport-%d:%d-%d",
                shost->host_no, channel, rport->number);
@@ -1567,10 +1568,9 @@ fc_rport_create(struct Scsi_Host *shost, int channel,
 
 delete_rport:
        transport_destroy_device(dev);
-       put_device(dev->parent);
        spin_lock_irqsave(shost->host_lock, flags);
        list_del(&rport->peers);
-       put_device(&shost->shost_gendev);
+       put_device(&shost->shost_gendev);       /* for fc_host->rport list */
        spin_unlock_irqrestore(shost->host_lock, flags);
        put_device(dev->parent);
        kfree(rport);
@@ -1707,6 +1707,8 @@ fc_remote_port_add(struct Scsi_Host *shost, int channel,
 
                                spin_unlock_irqrestore(shost->host_lock, flags);
 
+                               scsi_target_unblock(&rport->dev);
+
                                return rport;
                        }
                }
@@ -1762,9 +1764,10 @@ fc_remote_port_add(struct Scsi_Host *shost, int channel,
                                /* initiate a scan of the target */
                                rport->flags |= FC_RPORT_SCAN_PENDING;
                                scsi_queue_work(shost, &rport->scan_work);
-                       }
-
-                       spin_unlock_irqrestore(shost->host_lock, flags);
+                               spin_unlock_irqrestore(shost->host_lock, flags);
+                               scsi_target_unblock(&rport->dev);
+                       } else
+                               spin_unlock_irqrestore(shost->host_lock, flags);
 
                        return rport;
                }
@@ -1938,6 +1941,7 @@ fc_remote_port_rolechg(struct fc_rport  *rport, u32 roles)
                rport->flags |= FC_RPORT_SCAN_PENDING;
                scsi_queue_work(shost, &rport->scan_work);
                spin_unlock_irqrestore(shost->host_lock, flags);
+               scsi_target_unblock(&rport->dev);
        }
 }
 EXPORT_SYMBOL(fc_remote_port_rolechg);
@@ -1970,8 +1974,9 @@ fc_timeout_deleted_rport(void  *data)
                dev_printk(KERN_ERR, &rport->dev,
                        "blocked FC remote port time out: no longer"
                        " a FCP target, removing starget\n");
-               fc_queue_work(shost, &rport->stgt_delete_work);
                spin_unlock_irqrestore(shost->host_lock, flags);
+               scsi_target_unblock(&rport->dev);
+               fc_queue_work(shost, &rport->stgt_delete_work);
                return;
        }
 
@@ -2035,17 +2040,15 @@ fc_timeout_deleted_rport(void  *data)
         * went away and didn't come back - we'll remove
         * all attached scsi devices.
         */
-       fc_queue_work(shost, &rport->stgt_delete_work);
-
        spin_unlock_irqrestore(shost->host_lock, flags);
+
+       scsi_target_unblock(&rport->dev);
+       fc_queue_work(shost, &rport->stgt_delete_work);
 }
 
 /**
  * fc_scsi_scan_rport - called to perform a scsi scan on a remote port.
  *
- * Will unblock the target (in case it went away and has now come back),
- * then invoke a scan.
- *
  * @data:      remote port to be scanned.
  **/
 static void
@@ -2057,7 +2060,6 @@ fc_scsi_scan_rport(void *data)
 
        if ((rport->port_state == FC_PORTSTATE_ONLINE) &&
            (rport->roles & FC_RPORT_ROLE_FCP_TARGET)) {
-               scsi_target_unblock(&rport->dev);
                scsi_scan_target(&rport->dev, rport->channel,
                        rport->scsi_target_id, SCAN_WILD_CARD, 1);
        }
index 5569fdcfd621d3cee2363bc6415a7409dc501380..7b9e8fa1a4e00b9f173bf23edbf96964dc0b8922 100644 (file)
@@ -228,14 +228,11 @@ static struct iscsi_cls_conn *iscsi_conn_lookup(uint32_t sid, uint32_t cid)
 static void iscsi_session_release(struct device *dev)
 {
        struct iscsi_cls_session *session = iscsi_dev_to_session(dev);
-       struct iscsi_transport *transport = session->transport;
        struct Scsi_Host *shost;
 
        shost = iscsi_session_to_shost(session);
        scsi_host_put(shost);
-       kfree(session->targetname);
        kfree(session);
-       module_put(transport->owner);
 }
 
 static int iscsi_is_session_dev(const struct device *dev)
@@ -251,10 +248,9 @@ static int iscsi_user_scan(struct Scsi_Host *shost, uint channel,
 
        mutex_lock(&ihost->mutex);
        list_for_each_entry(session, &ihost->sessions, host_list) {
-               if ((channel == SCAN_WILD_CARD ||
-                    channel == session->channel) &&
+               if ((channel == SCAN_WILD_CARD || channel == 0) &&
                    (id == SCAN_WILD_CARD || id == session->target_id))
-                       scsi_scan_target(&session->dev, session->channel,
+                       scsi_scan_target(&session->dev, 0,
                                         session->target_id, lun, 1);
        }
        mutex_unlock(&ihost->mutex);
@@ -291,80 +287,92 @@ void iscsi_block_session(struct iscsi_cls_session *session)
 }
 EXPORT_SYMBOL_GPL(iscsi_block_session);
 
-/**
- * iscsi_create_session - create iscsi class session
- * @shost: scsi host
- * @transport: iscsi transport
- *
- * This can be called from a LLD or iscsi_transport.
- **/
 struct iscsi_cls_session *
-iscsi_create_session(struct Scsi_Host *shost,
-                    struct iscsi_transport *transport, int channel)
+iscsi_alloc_session(struct Scsi_Host *shost,
+                   struct iscsi_transport *transport)
 {
-       struct iscsi_host *ihost;
        struct iscsi_cls_session *session;
-       int err;
-
-       if (!try_module_get(transport->owner))
-               return NULL;
 
        session = kzalloc(sizeof(*session) + transport->sessiondata_size,
                          GFP_KERNEL);
        if (!session)
-               goto module_put;
+               return NULL;
+
        session->transport = transport;
        session->recovery_tmo = 120;
        INIT_WORK(&session->recovery_work, session_recovery_timedout, session);
        INIT_LIST_HEAD(&session->host_list);
        INIT_LIST_HEAD(&session->sess_list);
 
+       /* this is released in the dev's release function */
+       scsi_host_get(shost);
+       session->dev.parent = &shost->shost_gendev;
+       session->dev.release = iscsi_session_release;
+       device_initialize(&session->dev);
        if (transport->sessiondata_size)
                session->dd_data = &session[1];
+       return session;
+}
+EXPORT_SYMBOL_GPL(iscsi_alloc_session);
 
-       /* this is released in the dev's release function */
-       scsi_host_get(shost);
-       ihost = shost->shost_data;
+int iscsi_add_session(struct iscsi_cls_session *session, unsigned int target_id)
+{
+       struct Scsi_Host *shost = iscsi_session_to_shost(session);
+       struct iscsi_host *ihost;
+       int err;
 
+       ihost = shost->shost_data;
        session->sid = iscsi_session_nr++;
-       session->channel = channel;
-       session->target_id = ihost->next_target_id++;
+       session->target_id = target_id;
 
        snprintf(session->dev.bus_id, BUS_ID_SIZE, "session%u",
                 session->sid);
-       session->dev.parent = &shost->shost_gendev;
-       session->dev.release = iscsi_session_release;
-       err = device_register(&session->dev);
+       err = device_add(&session->dev);
        if (err) {
                dev_printk(KERN_ERR, &session->dev, "iscsi: could not "
                           "register session's dev\n");
-               goto free_session;
+               goto release_host;
        }
        transport_register_device(&session->dev);
 
        mutex_lock(&ihost->mutex);
        list_add(&session->host_list, &ihost->sessions);
        mutex_unlock(&ihost->mutex);
+       return 0;
 
-       return session;
-
-free_session:
-       kfree(session);
-module_put:
-       module_put(transport->owner);
-       return NULL;
+release_host:
+       scsi_host_put(shost);
+       return err;
 }
-
-EXPORT_SYMBOL_GPL(iscsi_create_session);
+EXPORT_SYMBOL_GPL(iscsi_add_session);
 
 /**
- * iscsi_destroy_session - destroy iscsi session
- * @session: iscsi_session
+ * iscsi_create_session - create iscsi class session
+ * @shost: scsi host
+ * @transport: iscsi transport
  *
- * Can be called by a LLD or iscsi_transport. There must not be
- * any running connections.
+ * This can be called from a LLD or iscsi_transport.
  **/
-int iscsi_destroy_session(struct iscsi_cls_session *session)
+struct iscsi_cls_session *
+iscsi_create_session(struct Scsi_Host *shost,
+                    struct iscsi_transport *transport,
+                    unsigned int target_id)
+{
+       struct iscsi_cls_session *session;
+
+       session = iscsi_alloc_session(shost, transport);
+       if (!session)
+               return NULL;
+
+       if (iscsi_add_session(session, target_id)) {
+               iscsi_free_session(session);
+               return NULL;
+       }
+       return session;
+}
+EXPORT_SYMBOL_GPL(iscsi_create_session);
+
+void iscsi_remove_session(struct iscsi_cls_session *session)
 {
        struct Scsi_Host *shost = iscsi_session_to_shost(session);
        struct iscsi_host *ihost = shost->shost_data;
@@ -376,19 +384,88 @@ int iscsi_destroy_session(struct iscsi_cls_session *session)
        list_del(&session->host_list);
        mutex_unlock(&ihost->mutex);
 
+       scsi_remove_target(&session->dev);
+
        transport_unregister_device(&session->dev);
-       device_unregister(&session->dev);
-       return 0;
+       device_del(&session->dev);
+}
+EXPORT_SYMBOL_GPL(iscsi_remove_session);
+
+void iscsi_free_session(struct iscsi_cls_session *session)
+{
+       put_device(&session->dev);
 }
 
+EXPORT_SYMBOL_GPL(iscsi_free_session);
+
+/**
+ * iscsi_destroy_session - destroy iscsi session
+ * @session: iscsi_session
+ *
+ * Can be called by a LLD or iscsi_transport. There must not be
+ * any running connections.
+ **/
+int iscsi_destroy_session(struct iscsi_cls_session *session)
+{
+       iscsi_remove_session(session);
+       iscsi_free_session(session);
+       return 0;
+}
 EXPORT_SYMBOL_GPL(iscsi_destroy_session);
 
+static void mempool_zone_destroy(struct mempool_zone *zp)
+{
+       mempool_destroy(zp->pool);
+       kfree(zp);
+}
+
+static void*
+mempool_zone_alloc_skb(gfp_t gfp_mask, void *pool_data)
+{
+       struct mempool_zone *zone = pool_data;
+
+       return alloc_skb(zone->size, gfp_mask);
+}
+
+static void
+mempool_zone_free_skb(void *element, void *pool_data)
+{
+       kfree_skb(element);
+}
+
+static struct mempool_zone *
+mempool_zone_init(unsigned max, unsigned size, unsigned hiwat)
+{
+       struct mempool_zone *zp;
+
+       zp = kzalloc(sizeof(*zp), GFP_KERNEL);
+       if (!zp)
+               return NULL;
+
+       zp->size = size;
+       zp->hiwat = hiwat;
+       INIT_LIST_HEAD(&zp->freequeue);
+       spin_lock_init(&zp->freelock);
+       atomic_set(&zp->allocated, 0);
+
+       zp->pool = mempool_create(max, mempool_zone_alloc_skb,
+                                 mempool_zone_free_skb, zp);
+       if (!zp->pool) {
+               kfree(zp);
+               return NULL;
+       }
+
+       return zp;
+}
+
 static void iscsi_conn_release(struct device *dev)
 {
        struct iscsi_cls_conn *conn = iscsi_dev_to_conn(dev);
        struct device *parent = conn->dev.parent;
 
-       kfree(conn->persistent_address);
+       mempool_zone_destroy(conn->z_pdu);
+       mempool_zone_destroy(conn->z_error);
+
        kfree(conn);
        put_device(parent);
 }
@@ -398,6 +475,31 @@ static int iscsi_is_conn_dev(const struct device *dev)
        return dev->release == iscsi_conn_release;
 }
 
+static int iscsi_create_event_pools(struct iscsi_cls_conn *conn)
+{
+       conn->z_pdu = mempool_zone_init(Z_MAX_PDU,
+                       NLMSG_SPACE(sizeof(struct iscsi_uevent) +
+                                   sizeof(struct iscsi_hdr) +
+                                   DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH),
+                       Z_HIWAT_PDU);
+       if (!conn->z_pdu) {
+               dev_printk(KERN_ERR, &conn->dev, "iscsi: can not allocate "
+                          "pdu zone for new conn\n");
+               return -ENOMEM;
+       }
+
+       conn->z_error = mempool_zone_init(Z_MAX_ERROR,
+                       NLMSG_SPACE(sizeof(struct iscsi_uevent)),
+                       Z_HIWAT_ERROR);
+       if (!conn->z_error) {
+               dev_printk(KERN_ERR, &conn->dev, "iscsi: can not allocate "
+                          "error zone for new conn\n");
+               mempool_zone_destroy(conn->z_pdu);
+               return -ENOMEM;
+       }
+       return 0;
+}
+
 /**
  * iscsi_create_conn - create iscsi class connection
  * @session: iscsi cls session
@@ -430,9 +532,12 @@ iscsi_create_conn(struct iscsi_cls_session *session, uint32_t cid)
        conn->transport = transport;
        conn->cid = cid;
 
+       if (iscsi_create_event_pools(conn))
+               goto free_conn;
+
        /* this is released in the dev's release function */
        if (!get_device(&session->dev))
-               goto free_conn;
+               goto free_conn_pools;
 
        snprintf(conn->dev.bus_id, BUS_ID_SIZE, "connection%d:%u",
                 session->sid, cid);
@@ -449,6 +554,8 @@ iscsi_create_conn(struct iscsi_cls_session *session, uint32_t cid)
 
 release_parent_ref:
        put_device(&session->dev);
+free_conn_pools:
+
 free_conn:
        kfree(conn);
        return NULL;
@@ -496,20 +603,6 @@ static inline struct list_head *skb_to_lh(struct sk_buff *skb)
        return (struct list_head *)&skb->cb;
 }
 
-static void*
-mempool_zone_alloc_skb(gfp_t gfp_mask, void *pool_data)
-{
-       struct mempool_zone *zone = pool_data;
-
-       return alloc_skb(zone->size, gfp_mask);
-}
-
-static void
-mempool_zone_free_skb(void *element, void *pool_data)
-{
-       kfree_skb(element);
-}
-
 static void
 mempool_zone_complete(struct mempool_zone *zone)
 {
@@ -529,37 +622,6 @@ mempool_zone_complete(struct mempool_zone *zone)
        spin_unlock_irqrestore(&zone->freelock, flags);
 }
 
-static struct mempool_zone *
-mempool_zone_init(unsigned max, unsigned size, unsigned hiwat)
-{
-       struct mempool_zone *zp;
-
-       zp = kzalloc(sizeof(*zp), GFP_KERNEL);
-       if (!zp)
-               return NULL;
-
-       zp->size = size;
-       zp->hiwat = hiwat;
-       INIT_LIST_HEAD(&zp->freequeue);
-       spin_lock_init(&zp->freelock);
-       atomic_set(&zp->allocated, 0);
-
-       zp->pool = mempool_create(max, mempool_zone_alloc_skb,
-                                 mempool_zone_free_skb, zp);
-       if (!zp->pool) {
-               kfree(zp);
-               return NULL;
-       }
-
-       return zp;
-}
-
-static void mempool_zone_destroy(struct mempool_zone *zp)
-{
-       mempool_destroy(zp->pool);
-       kfree(zp);
-}
-
 static struct sk_buff*
 mempool_zone_get_skb(struct mempool_zone *zone)
 {
@@ -571,6 +633,27 @@ mempool_zone_get_skb(struct mempool_zone *zone)
        return skb;
 }
 
+static int
+iscsi_broadcast_skb(struct mempool_zone *zone, struct sk_buff *skb)
+{
+       unsigned long flags;
+       int rc;
+
+       skb_get(skb);
+       rc = netlink_broadcast(nls, skb, 0, 1, GFP_KERNEL);
+       if (rc < 0) {
+               mempool_free(skb, zone->pool);
+               printk(KERN_ERR "iscsi: can not broadcast skb (%d)\n", rc);
+               return rc;
+       }
+
+       spin_lock_irqsave(&zone->freelock, flags);
+       INIT_LIST_HEAD(skb_to_lh(skb));
+       list_add(skb_to_lh(skb), &zone->freequeue);
+       spin_unlock_irqrestore(&zone->freelock, flags);
+       return 0;
+}
+
 static int
 iscsi_unicast_skb(struct mempool_zone *zone, struct sk_buff *skb, int pid)
 {
@@ -666,7 +749,7 @@ void iscsi_conn_error(struct iscsi_cls_conn *conn, enum iscsi_err error)
        ev->r.connerror.cid = conn->cid;
        ev->r.connerror.sid = iscsi_conn_get_sid(conn);
 
-       iscsi_unicast_skb(conn->z_error, skb, priv->daemon_pid);
+       iscsi_broadcast_skb(conn->z_error, skb);
 
        dev_printk(KERN_INFO, &conn->dev, "iscsi: detected conn error (%d)\n",
                   error);
@@ -767,6 +850,131 @@ iscsi_if_get_stats(struct iscsi_transport *transport, struct nlmsghdr *nlh)
        return err;
 }
 
+/**
+ * iscsi_if_destroy_session_done - send session destr. completion event
+ * @conn: last connection for session
+ *
+ * This is called by HW iscsi LLDs to notify userpsace that its HW has
+ * removed a session.
+ **/
+int iscsi_if_destroy_session_done(struct iscsi_cls_conn *conn)
+{
+       struct iscsi_internal *priv;
+       struct iscsi_cls_session *session;
+       struct Scsi_Host *shost;
+       struct iscsi_uevent *ev;
+       struct sk_buff  *skb;
+       struct nlmsghdr *nlh;
+       unsigned long flags;
+       int rc, len = NLMSG_SPACE(sizeof(*ev));
+
+       priv = iscsi_if_transport_lookup(conn->transport);
+       if (!priv)
+               return -EINVAL;
+
+       session = iscsi_dev_to_session(conn->dev.parent);
+       shost = iscsi_session_to_shost(session);
+
+       mempool_zone_complete(conn->z_pdu);
+
+       skb = mempool_zone_get_skb(conn->z_pdu);
+       if (!skb) {
+               dev_printk(KERN_ERR, &conn->dev, "Cannot notify userspace of "
+                         "session creation event\n");
+               return -ENOMEM;
+       }
+
+       nlh = __nlmsg_put(skb, priv->daemon_pid, 0, 0, (len - sizeof(*nlh)), 0);
+       ev = NLMSG_DATA(nlh);
+       ev->transport_handle = iscsi_handle(conn->transport);
+       ev->type = ISCSI_KEVENT_DESTROY_SESSION;
+       ev->r.d_session.host_no = shost->host_no;
+       ev->r.d_session.sid = session->sid;
+
+       /*
+        * this will occur if the daemon is not up, so we just warn
+        * the user and when the daemon is restarted it will handle it
+        */
+       rc = iscsi_broadcast_skb(conn->z_pdu, skb);
+       if (rc < 0)
+               dev_printk(KERN_ERR, &conn->dev, "Cannot notify userspace of "
+                         "session destruction event. Check iscsi daemon\n");
+
+       spin_lock_irqsave(&sesslock, flags);
+       list_del(&session->sess_list);
+       spin_unlock_irqrestore(&sesslock, flags);
+
+       spin_lock_irqsave(&connlock, flags);
+       conn->active = 0;
+       list_del(&conn->conn_list);
+       spin_unlock_irqrestore(&connlock, flags);
+
+       return rc;
+}
+EXPORT_SYMBOL_GPL(iscsi_if_destroy_session_done);
+
+/**
+ * iscsi_if_create_session_done - send session creation completion event
+ * @conn: leading connection for session
+ *
+ * This is called by HW iscsi LLDs to notify userpsace that its HW has
+ * created a session or a existing session is back in the logged in state.
+ **/
+int iscsi_if_create_session_done(struct iscsi_cls_conn *conn)
+{
+       struct iscsi_internal *priv;
+       struct iscsi_cls_session *session;
+       struct Scsi_Host *shost;
+       struct iscsi_uevent *ev;
+       struct sk_buff  *skb;
+       struct nlmsghdr *nlh;
+       unsigned long flags;
+       int rc, len = NLMSG_SPACE(sizeof(*ev));
+
+       priv = iscsi_if_transport_lookup(conn->transport);
+       if (!priv)
+               return -EINVAL;
+
+       session = iscsi_dev_to_session(conn->dev.parent);
+       shost = iscsi_session_to_shost(session);
+
+       mempool_zone_complete(conn->z_pdu);
+
+       skb = mempool_zone_get_skb(conn->z_pdu);
+       if (!skb) {
+               dev_printk(KERN_ERR, &conn->dev, "Cannot notify userspace of "
+                         "session creation event\n");
+               return -ENOMEM;
+       }
+
+       nlh = __nlmsg_put(skb, priv->daemon_pid, 0, 0, (len - sizeof(*nlh)), 0);
+       ev = NLMSG_DATA(nlh);
+       ev->transport_handle = iscsi_handle(conn->transport);
+       ev->type = ISCSI_UEVENT_CREATE_SESSION;
+       ev->r.c_session_ret.host_no = shost->host_no;
+       ev->r.c_session_ret.sid = session->sid;
+
+       /*
+        * this will occur if the daemon is not up, so we just warn
+        * the user and when the daemon is restarted it will handle it
+        */
+       rc = iscsi_broadcast_skb(conn->z_pdu, skb);
+       if (rc < 0)
+               dev_printk(KERN_ERR, &conn->dev, "Cannot notify userspace of "
+                         "session creation event. Check iscsi daemon\n");
+
+       spin_lock_irqsave(&sesslock, flags);
+       list_add(&session->sess_list, &sesslist);
+       spin_unlock_irqrestore(&sesslock, flags);
+
+       spin_lock_irqsave(&connlock, flags);
+       list_add(&conn->conn_list, &connlist);
+       conn->active = 1;
+       spin_unlock_irqrestore(&connlock, flags);
+       return rc;
+}
+EXPORT_SYMBOL_GPL(iscsi_if_create_session_done);
+
 static int
 iscsi_if_create_session(struct iscsi_internal *priv, struct iscsi_uevent *ev)
 {
@@ -812,26 +1020,6 @@ iscsi_if_create_conn(struct iscsi_transport *transport, struct iscsi_uevent *ev)
                return -ENOMEM;
        }
 
-       conn->z_pdu = mempool_zone_init(Z_MAX_PDU,
-                       NLMSG_SPACE(sizeof(struct iscsi_uevent) +
-                                   sizeof(struct iscsi_hdr) +
-                                   DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH),
-                       Z_HIWAT_PDU);
-       if (!conn->z_pdu) {
-               dev_printk(KERN_ERR, &conn->dev, "iscsi: can not allocate "
-                          "pdu zone for new conn\n");
-               goto destroy_conn;
-       }
-
-       conn->z_error = mempool_zone_init(Z_MAX_ERROR,
-                       NLMSG_SPACE(sizeof(struct iscsi_uevent)),
-                       Z_HIWAT_ERROR);
-       if (!conn->z_error) {
-               dev_printk(KERN_ERR, &conn->dev, "iscsi: can not allocate "
-                          "error zone for new conn\n");
-               goto free_pdu_pool;
-       }
-
        ev->r.c_conn_ret.sid = session->sid;
        ev->r.c_conn_ret.cid = conn->cid;
 
@@ -841,13 +1029,6 @@ iscsi_if_create_conn(struct iscsi_transport *transport, struct iscsi_uevent *ev)
        spin_unlock_irqrestore(&connlock, flags);
 
        return 0;
-
-free_pdu_pool:
-       mempool_zone_destroy(conn->z_pdu);
-destroy_conn:
-       if (transport->destroy_conn)
-               transport->destroy_conn(conn->dd_data);
-       return -ENOMEM;
 }
 
 static int
@@ -855,7 +1036,6 @@ iscsi_if_destroy_conn(struct iscsi_transport *transport, struct iscsi_uevent *ev
 {
        unsigned long flags;
        struct iscsi_cls_conn *conn;
-       struct mempool_zone *z_error, *z_pdu;
 
        conn = iscsi_conn_lookup(ev->u.d_conn.sid, ev->u.d_conn.cid);
        if (!conn)
@@ -865,35 +1045,18 @@ iscsi_if_destroy_conn(struct iscsi_transport *transport, struct iscsi_uevent *ev
        list_del(&conn->conn_list);
        spin_unlock_irqrestore(&connlock, flags);
 
-       z_pdu = conn->z_pdu;
-       z_error = conn->z_error;
-
        if (transport->destroy_conn)
                transport->destroy_conn(conn);
-
-       mempool_zone_destroy(z_pdu);
-       mempool_zone_destroy(z_error);
-
        return 0;
 }
 
-static void
-iscsi_copy_param(struct iscsi_uevent *ev, uint32_t *value, char *data)
-{
-       if (ev->u.set_param.len != sizeof(uint32_t))
-               BUG();
-       memcpy(value, data, min_t(uint32_t, sizeof(uint32_t),
-               ev->u.set_param.len));
-}
-
 static int
 iscsi_set_param(struct iscsi_transport *transport, struct iscsi_uevent *ev)
 {
        char *data = (char*)ev + sizeof(*ev);
        struct iscsi_cls_conn *conn;
        struct iscsi_cls_session *session;
-       int err = 0;
-       uint32_t value = 0;
+       int err = 0, value = 0;
 
        session = iscsi_session_lookup(ev->u.set_param.sid);
        conn = iscsi_conn_lookup(ev->u.set_param.sid, ev->u.set_param.cid);
@@ -902,42 +1065,13 @@ iscsi_set_param(struct iscsi_transport *transport, struct iscsi_uevent *ev)
 
        switch (ev->u.set_param.param) {
        case ISCSI_PARAM_SESS_RECOVERY_TMO:
-               iscsi_copy_param(ev, &value, data);
+               sscanf(data, "%d", &value);
                if (value != 0)
                        session->recovery_tmo = value;
                break;
-       case ISCSI_PARAM_TARGET_NAME:
-               /* this should not change between logins */
-               if (session->targetname)
-                       return 0;
-
-               session->targetname = kstrdup(data, GFP_KERNEL);
-               if (!session->targetname)
-                       return -ENOMEM;
-               break;
-       case ISCSI_PARAM_TPGT:
-               iscsi_copy_param(ev, &value, data);
-               session->tpgt = value;
-               break;
-       case ISCSI_PARAM_PERSISTENT_PORT:
-               iscsi_copy_param(ev, &value, data);
-               conn->persistent_port = value;
-               break;
-       case ISCSI_PARAM_PERSISTENT_ADDRESS:
-               /*
-                * this is the address returned in discovery so it should
-                * not change between logins.
-                */
-               if (conn->persistent_address)
-                       return 0;
-
-               conn->persistent_address = kstrdup(data, GFP_KERNEL);
-               if (!conn->persistent_address)
-                       return -ENOMEM;
-               break;
        default:
-               iscsi_copy_param(ev, &value, data);
-               err = transport->set_param(conn, ev->u.set_param.param, value);
+               err = transport->set_param(conn, ev->u.set_param.param,
+                                          data, ev->u.set_param.len);
        }
 
        return err;
@@ -977,6 +1111,21 @@ iscsi_if_transport_ep(struct iscsi_transport *transport,
        return rc;
 }
 
+static int
+iscsi_tgt_dscvr(struct iscsi_transport *transport,
+               struct iscsi_uevent *ev)
+{
+       struct sockaddr *dst_addr;
+
+       if (!transport->tgt_dscvr)
+               return -EINVAL;
+
+       dst_addr = (struct sockaddr *)((char*)ev + sizeof(*ev));
+       return transport->tgt_dscvr(ev->u.tgt_dscvr.type,
+                                   ev->u.tgt_dscvr.host_no,
+                                   ev->u.tgt_dscvr.enable, dst_addr);
+}
+
 static int
 iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
 {
@@ -1065,6 +1214,9 @@ iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
        case ISCSI_UEVENT_TRANSPORT_EP_DISCONNECT:
                err = iscsi_if_transport_ep(transport, ev, nlh->nlmsg_type);
                break;
+       case ISCSI_UEVENT_TGT_DSCVR:
+               err = iscsi_tgt_dscvr(transport, ev);
+               break;
        default:
                err = -EINVAL;
                break;
@@ -1147,49 +1299,31 @@ struct class_device_attribute class_device_attr_##_prefix##_##_name =   \
 /*
  * iSCSI connection attrs
  */
-#define iscsi_conn_int_attr_show(param, format)                                \
-static ssize_t                                                         \
-show_conn_int_param_##param(struct class_device *cdev, char *buf)      \
-{                                                                      \
-       uint32_t value = 0;                                             \
-       struct iscsi_cls_conn *conn = iscsi_cdev_to_conn(cdev);         \
-       struct iscsi_transport *t = conn->transport;                    \
-                                                                       \
-       t->get_conn_param(conn, param, &value);                         \
-       return snprintf(buf, 20, format"\n", value);                    \
-}
-
-#define iscsi_conn_int_attr(field, param, format)                      \
-       iscsi_conn_int_attr_show(param, format)                         \
-static ISCSI_CLASS_ATTR(conn, field, S_IRUGO, show_conn_int_param_##param, \
-                       NULL);
-
-iscsi_conn_int_attr(max_recv_dlength, ISCSI_PARAM_MAX_RECV_DLENGTH, "%u");
-iscsi_conn_int_attr(max_xmit_dlength, ISCSI_PARAM_MAX_XMIT_DLENGTH, "%u");
-iscsi_conn_int_attr(header_digest, ISCSI_PARAM_HDRDGST_EN, "%d");
-iscsi_conn_int_attr(data_digest, ISCSI_PARAM_DATADGST_EN, "%d");
-iscsi_conn_int_attr(ifmarker, ISCSI_PARAM_IFMARKER_EN, "%d");
-iscsi_conn_int_attr(ofmarker, ISCSI_PARAM_OFMARKER_EN, "%d");
-iscsi_conn_int_attr(persistent_port, ISCSI_PARAM_PERSISTENT_PORT, "%d");
-iscsi_conn_int_attr(port, ISCSI_PARAM_CONN_PORT, "%d");
-iscsi_conn_int_attr(exp_statsn, ISCSI_PARAM_EXP_STATSN, "%u");
-
-#define iscsi_conn_str_attr_show(param)                                        \
+#define iscsi_conn_attr_show(param)                                    \
 static ssize_t                                                         \
-show_conn_str_param_##param(struct class_device *cdev, char *buf)      \
+show_conn_param_##param(struct class_device *cdev, char *buf)          \
 {                                                                      \
        struct iscsi_cls_conn *conn = iscsi_cdev_to_conn(cdev);         \
        struct iscsi_transport *t = conn->transport;                    \
-       return t->get_conn_str_param(conn, param, buf);                 \
+       return t->get_conn_param(conn, param, buf);                     \
 }
 
-#define iscsi_conn_str_attr(field, param)                              \
-       iscsi_conn_str_attr_show(param)                                 \
-static ISCSI_CLASS_ATTR(conn, field, S_IRUGO, show_conn_str_param_##param, \
+#define iscsi_conn_attr(field, param)                                  \
+       iscsi_conn_attr_show(param)                                     \
+static ISCSI_CLASS_ATTR(conn, field, S_IRUGO, show_conn_param_##param, \
                        NULL);
 
-iscsi_conn_str_attr(persistent_address, ISCSI_PARAM_PERSISTENT_ADDRESS);
-iscsi_conn_str_attr(address, ISCSI_PARAM_CONN_ADDRESS);
+iscsi_conn_attr(max_recv_dlength, ISCSI_PARAM_MAX_RECV_DLENGTH);
+iscsi_conn_attr(max_xmit_dlength, ISCSI_PARAM_MAX_XMIT_DLENGTH);
+iscsi_conn_attr(header_digest, ISCSI_PARAM_HDRDGST_EN);
+iscsi_conn_attr(data_digest, ISCSI_PARAM_DATADGST_EN);
+iscsi_conn_attr(ifmarker, ISCSI_PARAM_IFMARKER_EN);
+iscsi_conn_attr(ofmarker, ISCSI_PARAM_OFMARKER_EN);
+iscsi_conn_attr(persistent_port, ISCSI_PARAM_PERSISTENT_PORT);
+iscsi_conn_attr(port, ISCSI_PARAM_CONN_PORT);
+iscsi_conn_attr(exp_statsn, ISCSI_PARAM_EXP_STATSN);
+iscsi_conn_attr(persistent_address, ISCSI_PARAM_PERSISTENT_ADDRESS);
+iscsi_conn_attr(address, ISCSI_PARAM_CONN_ADDRESS);
 
 #define iscsi_cdev_to_session(_cdev) \
        iscsi_dev_to_session(_cdev->dev)
@@ -1197,61 +1331,36 @@ iscsi_conn_str_attr(address, ISCSI_PARAM_CONN_ADDRESS);
 /*
  * iSCSI session attrs
  */
-#define iscsi_session_int_attr_show(param, format)                     \
-static ssize_t                                                         \
-show_session_int_param_##param(struct class_device *cdev, char *buf)   \
-{                                                                      \
-       uint32_t value = 0;                                             \
-       struct iscsi_cls_session *session = iscsi_cdev_to_session(cdev);        \
-       struct iscsi_transport *t = session->transport;                 \
-                                                                       \
-       t->get_session_param(session, param, &value);                   \
-       return snprintf(buf, 20, format"\n", value);                    \
-}
-
-#define iscsi_session_int_attr(field, param, format)                   \
-       iscsi_session_int_attr_show(param, format)                      \
-static ISCSI_CLASS_ATTR(sess, field, S_IRUGO, show_session_int_param_##param, \
-                       NULL);
-
-iscsi_session_int_attr(initial_r2t, ISCSI_PARAM_INITIAL_R2T_EN, "%d");
-iscsi_session_int_attr(max_outstanding_r2t, ISCSI_PARAM_MAX_R2T, "%hu");
-iscsi_session_int_attr(immediate_data, ISCSI_PARAM_IMM_DATA_EN, "%d");
-iscsi_session_int_attr(first_burst_len, ISCSI_PARAM_FIRST_BURST, "%u");
-iscsi_session_int_attr(max_burst_len, ISCSI_PARAM_MAX_BURST, "%u");
-iscsi_session_int_attr(data_pdu_in_order, ISCSI_PARAM_PDU_INORDER_EN, "%d");
-iscsi_session_int_attr(data_seq_in_order, ISCSI_PARAM_DATASEQ_INORDER_EN, "%d");
-iscsi_session_int_attr(erl, ISCSI_PARAM_ERL, "%d");
-iscsi_session_int_attr(tpgt, ISCSI_PARAM_TPGT, "%d");
-
-#define iscsi_session_str_attr_show(param)                             \
+#define iscsi_session_attr_show(param)                                 \
 static ssize_t                                                         \
-show_session_str_param_##param(struct class_device *cdev, char *buf)   \
+show_session_param_##param(struct class_device *cdev, char *buf)       \
 {                                                                      \
        struct iscsi_cls_session *session = iscsi_cdev_to_session(cdev); \
        struct iscsi_transport *t = session->transport;                 \
-       return t->get_session_str_param(session, param, buf);           \
+       return t->get_session_param(session, param, buf);               \
 }
 
-#define iscsi_session_str_attr(field, param)                           \
-       iscsi_session_str_attr_show(param)                              \
-static ISCSI_CLASS_ATTR(sess, field, S_IRUGO, show_session_str_param_##param, \
+#define iscsi_session_attr(field, param)                               \
+       iscsi_session_attr_show(param)                                  \
+static ISCSI_CLASS_ATTR(sess, field, S_IRUGO, show_session_param_##param, \
                        NULL);
 
-iscsi_session_str_attr(targetname, ISCSI_PARAM_TARGET_NAME);
+iscsi_session_attr(targetname, ISCSI_PARAM_TARGET_NAME);
+iscsi_session_attr(initial_r2t, ISCSI_PARAM_INITIAL_R2T_EN);
+iscsi_session_attr(max_outstanding_r2t, ISCSI_PARAM_MAX_R2T);
+iscsi_session_attr(immediate_data, ISCSI_PARAM_IMM_DATA_EN);
+iscsi_session_attr(first_burst_len, ISCSI_PARAM_FIRST_BURST);
+iscsi_session_attr(max_burst_len, ISCSI_PARAM_MAX_BURST);
+iscsi_session_attr(data_pdu_in_order, ISCSI_PARAM_PDU_INORDER_EN);
+iscsi_session_attr(data_seq_in_order, ISCSI_PARAM_DATASEQ_INORDER_EN);
+iscsi_session_attr(erl, ISCSI_PARAM_ERL);
+iscsi_session_attr(tpgt, ISCSI_PARAM_TPGT);
 
-/*
- * Private session and conn attrs. userspace uses several iscsi values
- * to identify each session between reboots. Some of these values may not
- * be present in the iscsi_transport/LLD driver becuase userspace handles
- * login (and failback for login redirect) so for these type of drivers
- * the class manages the attrs and values for the iscsi_transport/LLD
- */
 #define iscsi_priv_session_attr_show(field, format)                    \
 static ssize_t                                                         \
-show_priv_session_##field(struct class_device *cdev, char *buf)        \
+show_priv_session_##field(struct class_device *cdev, char *buf)                \
 {                                                                      \
-       struct iscsi_cls_session *session = iscsi_cdev_to_session(cdev); \
+       struct iscsi_cls_session *session = iscsi_cdev_to_session(cdev);\
        return sprintf(buf, format"\n", session->field);                \
 }
 
@@ -1259,31 +1368,15 @@ show_priv_session_##field(struct class_device *cdev, char *buf) \
        iscsi_priv_session_attr_show(field, format)                     \
 static ISCSI_CLASS_ATTR(priv_sess, field, S_IRUGO, show_priv_session_##field, \
                        NULL)
-iscsi_priv_session_attr(targetname, "%s");
-iscsi_priv_session_attr(tpgt, "%d");
 iscsi_priv_session_attr(recovery_tmo, "%d");
 
-#define iscsi_priv_conn_attr_show(field, format)                       \
-static ssize_t                                                         \
-show_priv_conn_##field(struct class_device *cdev, char *buf)           \
-{                                                                      \
-       struct iscsi_cls_conn *conn = iscsi_cdev_to_conn(cdev);         \
-       return sprintf(buf, format"\n", conn->field);                   \
-}
-
-#define iscsi_priv_conn_attr(field, format)                            \
-       iscsi_priv_conn_attr_show(field, format)                        \
-static ISCSI_CLASS_ATTR(priv_conn, field, S_IRUGO, show_priv_conn_##field, \
-                       NULL)
-iscsi_priv_conn_attr(persistent_address, "%s");
-iscsi_priv_conn_attr(persistent_port, "%d");
-
 #define SETUP_PRIV_SESSION_RD_ATTR(field)                              \
 do {                                                                   \
        priv->session_attrs[count] = &class_device_attr_priv_sess_##field; \
        count++;                                                        \
 } while (0)
 
+
 #define SETUP_SESSION_RD_ATTR(field, param_flag)                       \
 do {                                                                   \
        if (tt->param_mask & param_flag) {                              \
@@ -1292,12 +1385,6 @@ do {                                                                     \
        }                                                               \
 } while (0)
 
-#define SETUP_PRIV_CONN_RD_ATTR(field)                                 \
-do {                                                                   \
-       priv->conn_attrs[count] = &class_device_attr_priv_conn_##field; \
-       count++;                                                        \
-} while (0)
-
 #define SETUP_CONN_RD_ATTR(field, param_flag)                          \
 do {                                                                   \
        if (tt->param_mask & param_flag) {                              \
@@ -1388,6 +1475,7 @@ iscsi_register_transport(struct iscsi_transport *tt)
        if (!priv)
                return NULL;
        INIT_LIST_HEAD(&priv->list);
+       priv->daemon_pid = -1;
        priv->iscsi_transport = tt;
        priv->t.user_scan = iscsi_user_scan;
 
@@ -1424,16 +1512,8 @@ iscsi_register_transport(struct iscsi_transport *tt)
        SETUP_CONN_RD_ATTR(address, ISCSI_CONN_ADDRESS);
        SETUP_CONN_RD_ATTR(port, ISCSI_CONN_PORT);
        SETUP_CONN_RD_ATTR(exp_statsn, ISCSI_EXP_STATSN);
-
-       if (tt->param_mask & ISCSI_PERSISTENT_ADDRESS)
-               SETUP_CONN_RD_ATTR(persistent_address, ISCSI_PERSISTENT_ADDRESS);
-       else
-               SETUP_PRIV_CONN_RD_ATTR(persistent_address);
-
-       if (tt->param_mask & ISCSI_PERSISTENT_PORT)
-               SETUP_CONN_RD_ATTR(persistent_port, ISCSI_PERSISTENT_PORT);
-       else
-               SETUP_PRIV_CONN_RD_ATTR(persistent_port);
+       SETUP_CONN_RD_ATTR(persistent_address, ISCSI_PERSISTENT_ADDRESS);
+       SETUP_CONN_RD_ATTR(persistent_port, ISCSI_PERSISTENT_PORT);
 
        BUG_ON(count > ISCSI_CONN_ATTRS);
        priv->conn_attrs[count] = NULL;
@@ -1453,18 +1533,10 @@ iscsi_register_transport(struct iscsi_transport *tt)
        SETUP_SESSION_RD_ATTR(data_pdu_in_order, ISCSI_PDU_INORDER_EN);
        SETUP_SESSION_RD_ATTR(data_seq_in_order, ISCSI_DATASEQ_INORDER_EN);
        SETUP_SESSION_RD_ATTR(erl, ISCSI_ERL);
+       SETUP_SESSION_RD_ATTR(targetname, ISCSI_TARGET_NAME);
+       SETUP_SESSION_RD_ATTR(tpgt, ISCSI_TPGT);
        SETUP_PRIV_SESSION_RD_ATTR(recovery_tmo);
 
-       if (tt->param_mask & ISCSI_TARGET_NAME)
-               SETUP_SESSION_RD_ATTR(targetname, ISCSI_TARGET_NAME);
-       else
-               SETUP_PRIV_SESSION_RD_ATTR(targetname);
-
-       if (tt->param_mask & ISCSI_TPGT)
-               SETUP_SESSION_RD_ATTR(tpgt, ISCSI_TPGT);
-       else
-               SETUP_PRIV_SESSION_RD_ATTR(tpgt);
-
        BUG_ON(count > ISCSI_SESSION_ATTRS);
        priv->session_attrs[count] = NULL;
 
index 1fe6b2d01853288adbe0e9b01121a7bc25b888dd..dd075627e605f073f72677985ad13b25db66054c 100644 (file)
@@ -174,11 +174,28 @@ static int sas_host_match(struct attribute_container *cont,
 
 static int do_sas_phy_delete(struct device *dev, void *data)
 {
-       if (scsi_is_sas_phy(dev))
+       int pass = (int)(unsigned long)data;
+
+       if (pass == 0 && scsi_is_sas_port(dev))
+               sas_port_delete(dev_to_sas_port(dev));
+       else if (pass == 1 && scsi_is_sas_phy(dev))
                sas_phy_delete(dev_to_phy(dev));
        return 0;
 }
 
+/**
+ * sas_remove_children  --  tear down a devices SAS data structures
+ * @dev:       device belonging to the sas object
+ *
+ * Removes all SAS PHYs and remote PHYs for a given object
+ */
+void sas_remove_children(struct device *dev)
+{
+       device_for_each_child(dev, (void *)0, do_sas_phy_delete);
+       device_for_each_child(dev, (void *)1, do_sas_phy_delete);
+}
+EXPORT_SYMBOL(sas_remove_children);
+
 /**
  * sas_remove_host  --  tear down a Scsi_Host's SAS data structures
  * @shost:     Scsi Host that is torn down
@@ -188,13 +205,13 @@ static int do_sas_phy_delete(struct device *dev, void *data)
  */
 void sas_remove_host(struct Scsi_Host *shost)
 {
-       device_for_each_child(&shost->shost_gendev, NULL, do_sas_phy_delete);
+       sas_remove_children(&shost->shost_gendev);
 }
 EXPORT_SYMBOL(sas_remove_host);
 
 
 /*
- * SAS Port attributes
+ * SAS Phy attributes
  */
 
 #define sas_phy_show_simple(field, name, format_string, cast)          \
@@ -310,7 +327,7 @@ sas_phy_protocol_attr(identify.target_port_protocols,
 sas_phy_simple_attr(identify.sas_address, sas_address, "0x%016llx\n",
                unsigned long long);
 sas_phy_simple_attr(identify.phy_identifier, phy_identifier, "%d\n", u8);
-sas_phy_simple_attr(port_identifier, port_identifier, "%d\n", u8);
+//sas_phy_simple_attr(port_identifier, port_identifier, "%d\n", u8);
 sas_phy_linkspeed_attr(negotiated_linkrate);
 sas_phy_linkspeed_attr(minimum_linkrate_hw);
 sas_phy_linkspeed_attr(minimum_linkrate);
@@ -378,9 +395,10 @@ struct sas_phy *sas_phy_alloc(struct device *parent, int number)
        device_initialize(&phy->dev);
        phy->dev.parent = get_device(parent);
        phy->dev.release = sas_phy_release;
+       INIT_LIST_HEAD(&phy->port_siblings);
        if (scsi_is_sas_expander_device(parent)) {
                struct sas_rphy *rphy = dev_to_rphy(parent);
-               sprintf(phy->dev.bus_id, "phy-%d-%d:%d", shost->host_no,
+               sprintf(phy->dev.bus_id, "phy-%d:%d:%d", shost->host_no,
                        rphy->scsi_target_id, number);
        } else
                sprintf(phy->dev.bus_id, "phy-%d:%d", shost->host_no, number);
@@ -440,8 +458,8 @@ sas_phy_delete(struct sas_phy *phy)
 {
        struct device *dev = &phy->dev;
 
-       if (phy->rphy)
-               sas_rphy_delete(phy->rphy);
+       /* this happens if the phy is still part of a port when deleted */
+       BUG_ON(!list_empty(&phy->port_siblings));
 
        transport_remove_device(dev);
        device_del(dev);
@@ -463,6 +481,258 @@ int scsi_is_sas_phy(const struct device *dev)
 }
 EXPORT_SYMBOL(scsi_is_sas_phy);
 
+/*
+ * SAS Port attributes
+ */
+#define sas_port_show_simple(field, name, format_string, cast)         \
+static ssize_t                                                         \
+show_sas_port_##name(struct class_device *cdev, char *buf)             \
+{                                                                      \
+       struct sas_port *port = transport_class_to_sas_port(cdev);      \
+                                                                       \
+       return snprintf(buf, 20, format_string, cast port->field);      \
+}
+
+#define sas_port_simple_attr(field, name, format_string, type)         \
+       sas_port_show_simple(field, name, format_string, (type))        \
+static CLASS_DEVICE_ATTR(name, S_IRUGO, show_sas_port_##name, NULL)
+
+sas_port_simple_attr(num_phys, num_phys, "%d\n", int);
+
+static DECLARE_TRANSPORT_CLASS(sas_port_class,
+                              "sas_port", NULL, NULL, NULL);
+
+static int sas_port_match(struct attribute_container *cont, struct device *dev)
+{
+       struct Scsi_Host *shost;
+       struct sas_internal *i;
+
+       if (!scsi_is_sas_port(dev))
+               return 0;
+       shost = dev_to_shost(dev->parent);
+
+       if (!shost->transportt)
+               return 0;
+       if (shost->transportt->host_attrs.ac.class !=
+                       &sas_host_class.class)
+               return 0;
+
+       i = to_sas_internal(shost->transportt);
+       return &i->port_attr_cont.ac == cont;
+}
+
+
+static void sas_port_release(struct device *dev)
+{
+       struct sas_port *port = dev_to_sas_port(dev);
+
+       BUG_ON(!list_empty(&port->phy_list));
+
+       put_device(dev->parent);
+       kfree(port);
+}
+
+static void sas_port_create_link(struct sas_port *port,
+                                struct sas_phy *phy)
+{
+       sysfs_create_link(&port->dev.kobj, &phy->dev.kobj, phy->dev.bus_id);
+       sysfs_create_link(&phy->dev.kobj, &port->dev.kobj, "port");
+}
+
+static void sas_port_delete_link(struct sas_port *port,
+                                struct sas_phy *phy)
+{
+       sysfs_remove_link(&port->dev.kobj, phy->dev.bus_id);
+       sysfs_remove_link(&phy->dev.kobj, "port");
+}
+
+/** sas_port_alloc - allocate and initialize a SAS port structure
+ *
+ * @parent:    parent device
+ * @port_id:   port number
+ *
+ * Allocates a SAS port structure.  It will be added to the device tree
+ * below the device specified by @parent which must be either a Scsi_Host
+ * or a sas_expander_device.
+ *
+ * Returns %NULL on error
+ */
+struct sas_port *sas_port_alloc(struct device *parent, int port_id)
+{
+       struct Scsi_Host *shost = dev_to_shost(parent);
+       struct sas_port *port;
+
+       port = kzalloc(sizeof(*port), GFP_KERNEL);
+       if (!port)
+               return NULL;
+
+       port->port_identifier = port_id;
+
+       device_initialize(&port->dev);
+
+       port->dev.parent = get_device(parent);
+       port->dev.release = sas_port_release;
+
+       mutex_init(&port->phy_list_mutex);
+       INIT_LIST_HEAD(&port->phy_list);
+
+       if (scsi_is_sas_expander_device(parent)) {
+               struct sas_rphy *rphy = dev_to_rphy(parent);
+               sprintf(port->dev.bus_id, "port-%d:%d:%d", shost->host_no,
+                       rphy->scsi_target_id, port->port_identifier);
+       } else
+               sprintf(port->dev.bus_id, "port-%d:%d", shost->host_no,
+                       port->port_identifier);
+
+       transport_setup_device(&port->dev);
+
+       return port;
+}
+EXPORT_SYMBOL(sas_port_alloc);
+
+/**
+ * sas_port_add - add a SAS port to the device hierarchy
+ *
+ * @port:      port to be added
+ *
+ * publishes a port to the rest of the system
+ */
+int sas_port_add(struct sas_port *port)
+{
+       int error;
+
+       /* No phys should be added until this is made visible */
+       BUG_ON(!list_empty(&port->phy_list));
+
+       error = device_add(&port->dev);
+
+       if (error)
+               return error;
+
+       transport_add_device(&port->dev);
+       transport_configure_device(&port->dev);
+
+       return 0;
+}
+EXPORT_SYMBOL(sas_port_add);
+
+/**
+ * sas_port_free  --  free a SAS PORT
+ * @port:      SAS PORT to free
+ *
+ * Frees the specified SAS PORT.
+ *
+ * Note:
+ *   This function must only be called on a PORT that has not
+ *   sucessfully been added using sas_port_add().
+ */
+void sas_port_free(struct sas_port *port)
+{
+       transport_destroy_device(&port->dev);
+       put_device(&port->dev);
+}
+EXPORT_SYMBOL(sas_port_free);
+
+/**
+ * sas_port_delete  --  remove SAS PORT
+ * @port:      SAS PORT to remove
+ *
+ * Removes the specified SAS PORT.  If the SAS PORT has an
+ * associated phys, unlink them from the port as well.
+ */
+void sas_port_delete(struct sas_port *port)
+{
+       struct device *dev = &port->dev;
+       struct sas_phy *phy, *tmp_phy;
+
+       if (port->rphy) {
+               sas_rphy_delete(port->rphy);
+               port->rphy = NULL;
+       }
+
+       mutex_lock(&port->phy_list_mutex);
+       list_for_each_entry_safe(phy, tmp_phy, &port->phy_list,
+                                port_siblings) {
+               sas_port_delete_link(port, phy);
+               list_del_init(&phy->port_siblings);
+       }
+       mutex_unlock(&port->phy_list_mutex);
+
+       transport_remove_device(dev);
+       device_del(dev);
+       transport_destroy_device(dev);
+       put_device(dev);
+}
+EXPORT_SYMBOL(sas_port_delete);
+
+/**
+ * scsi_is_sas_port --  check if a struct device represents a SAS port
+ * @dev:       device to check
+ *
+ * Returns:
+ *     %1 if the device represents a SAS Port, %0 else
+ */
+int scsi_is_sas_port(const struct device *dev)
+{
+       return dev->release == sas_port_release;
+}
+EXPORT_SYMBOL(scsi_is_sas_port);
+
+/**
+ * sas_port_add_phy - add another phy to a port to form a wide port
+ * @port:      port to add the phy to
+ * @phy:       phy to add
+ *
+ * When a port is initially created, it is empty (has no phys).  All
+ * ports must have at least one phy to operated, and all wide ports
+ * must have at least two.  The current code makes no difference
+ * between ports and wide ports, but the only object that can be
+ * connected to a remote device is a port, so ports must be formed on
+ * all devices with phys if they're connected to anything.
+ */
+void sas_port_add_phy(struct sas_port *port, struct sas_phy *phy)
+{
+       mutex_lock(&port->phy_list_mutex);
+       if (unlikely(!list_empty(&phy->port_siblings))) {
+               /* make sure we're already on this port */
+               struct sas_phy *tmp;
+
+               list_for_each_entry(tmp, &port->phy_list, port_siblings)
+                       if (tmp == phy)
+                               break;
+               /* If this trips, you added a phy that was already
+                * part of a different port */
+               if (unlikely(tmp != phy)) {
+                       dev_printk(KERN_ERR, &port->dev, "trying to add phy %s fails: it's already part of another port\n", phy->dev.bus_id);
+                       BUG();
+               }
+       } else {
+               sas_port_create_link(port, phy);
+               list_add_tail(&phy->port_siblings, &port->phy_list);
+               port->num_phys++;
+       }
+       mutex_unlock(&port->phy_list_mutex);
+}
+EXPORT_SYMBOL(sas_port_add_phy);
+
+/**
+ * sas_port_delete_phy - remove a phy from a port or wide port
+ * @port:      port to remove the phy from
+ * @phy:       phy to remove
+ *
+ * This operation is used for tearing down ports again.  It must be
+ * done to every port or wide port before calling sas_port_delete.
+ */
+void sas_port_delete_phy(struct sas_port *port, struct sas_phy *phy)
+{
+       mutex_lock(&port->phy_list_mutex);
+       sas_port_delete_link(port, phy);
+       list_del_init(&phy->port_siblings);
+       port->num_phys--;
+       mutex_unlock(&port->phy_list_mutex);
+}
+EXPORT_SYMBOL(sas_port_delete_phy);
+
 /*
  * SAS remote PHY attributes.
  */
@@ -767,7 +1037,7 @@ static void sas_rphy_initialize(struct sas_rphy *rphy)
  * Returns:
  *     SAS PHY allocated or %NULL if the allocation failed.
  */
-struct sas_rphy *sas_end_device_alloc(struct sas_phy *parent)
+struct sas_rphy *sas_end_device_alloc(struct sas_port *parent)
 {
        struct Scsi_Host *shost = dev_to_shost(&parent->dev);
        struct sas_end_device *rdev;
@@ -780,8 +1050,13 @@ struct sas_rphy *sas_end_device_alloc(struct sas_phy *parent)
        device_initialize(&rdev->rphy.dev);
        rdev->rphy.dev.parent = get_device(&parent->dev);
        rdev->rphy.dev.release = sas_end_device_release;
-       sprintf(rdev->rphy.dev.bus_id, "end_device-%d:%d-%d",
-               shost->host_no, parent->port_identifier, parent->number);
+       if (scsi_is_sas_expander_device(parent->dev.parent)) {
+               struct sas_rphy *rphy = dev_to_rphy(parent->dev.parent);
+               sprintf(rdev->rphy.dev.bus_id, "end_device-%d:%d:%d",
+                       shost->host_no, rphy->scsi_target_id, parent->port_identifier);
+       } else
+               sprintf(rdev->rphy.dev.bus_id, "end_device-%d:%d",
+                       shost->host_no, parent->port_identifier);
        rdev->rphy.identify.device_type = SAS_END_DEVICE;
        sas_rphy_initialize(&rdev->rphy);
        transport_setup_device(&rdev->rphy.dev);
@@ -798,7 +1073,7 @@ EXPORT_SYMBOL(sas_end_device_alloc);
  * Returns:
  *     SAS PHY allocated or %NULL if the allocation failed.
  */
-struct sas_rphy *sas_expander_alloc(struct sas_phy *parent,
+struct sas_rphy *sas_expander_alloc(struct sas_port *parent,
                                    enum sas_device_type type)
 {
        struct Scsi_Host *shost = dev_to_shost(&parent->dev);
@@ -837,7 +1112,7 @@ EXPORT_SYMBOL(sas_expander_alloc);
  */
 int sas_rphy_add(struct sas_rphy *rphy)
 {
-       struct sas_phy *parent = dev_to_phy(rphy->dev.parent);
+       struct sas_port *parent = dev_to_sas_port(rphy->dev.parent);
        struct Scsi_Host *shost = dev_to_shost(parent->dev.parent);
        struct sas_host_attrs *sas_host = to_sas_host_attrs(shost);
        struct sas_identify *identify = &rphy->identify;
@@ -910,7 +1185,7 @@ void
 sas_rphy_delete(struct sas_rphy *rphy)
 {
        struct device *dev = &rphy->dev;
-       struct sas_phy *parent = dev_to_phy(dev->parent);
+       struct sas_port *parent = dev_to_sas_port(dev->parent);
        struct Scsi_Host *shost = dev_to_shost(parent->dev.parent);
        struct sas_host_attrs *sas_host = to_sas_host_attrs(shost);
 
@@ -920,7 +1195,7 @@ sas_rphy_delete(struct sas_rphy *rphy)
                break;
        case SAS_EDGE_EXPANDER_DEVICE:
        case SAS_FANOUT_EXPANDER_DEVICE:
-               device_for_each_child(dev, NULL, do_sas_phy_delete);
+               sas_remove_children(dev);
                break;
        default:
                break;
@@ -967,7 +1242,7 @@ static int sas_user_scan(struct Scsi_Host *shost, uint channel,
 
        mutex_lock(&sas_host->lock);
        list_for_each_entry(rphy, &sas_host->rphy_list, list) {
-               struct sas_phy *parent = dev_to_phy(rphy->dev.parent);
+               struct sas_port *parent = dev_to_sas_port(rphy->dev.parent);
 
                if (rphy->identify.device_type != SAS_END_DEVICE ||
                    rphy->scsi_target_id == -1)
@@ -1003,16 +1278,19 @@ static int sas_user_scan(struct Scsi_Host *shost, uint channel,
 #define SETUP_OPTIONAL_RPORT_ATTRIBUTE(field, func)                    \
        SETUP_TEMPLATE(rphy_attrs, field, S_IRUGO, i->f->func)
 
-#define SETUP_PORT_ATTRIBUTE(field)                                    \
+#define SETUP_PHY_ATTRIBUTE(field)                                     \
        SETUP_TEMPLATE(phy_attrs, field, S_IRUGO, 1)
 
-#define SETUP_OPTIONAL_PORT_ATTRIBUTE(field, func)                     \
+#define SETUP_PORT_ATTRIBUTE(field)                                    \
+       SETUP_TEMPLATE(port_attrs, field, S_IRUGO, 1)
+
+#define SETUP_OPTIONAL_PHY_ATTRIBUTE(field, func)                      \
        SETUP_TEMPLATE(phy_attrs, field, S_IRUGO, i->f->func)
 
-#define SETUP_PORT_ATTRIBUTE_WRONLY(field)                             \
+#define SETUP_PHY_ATTRIBUTE_WRONLY(field)                              \
        SETUP_TEMPLATE(phy_attrs, field, S_IWUGO, 1)
 
-#define SETUP_OPTIONAL_PORT_ATTRIBUTE_WRONLY(field, func)              \
+#define SETUP_OPTIONAL_PHY_ATTRIBUTE_WRONLY(field, func)               \
        SETUP_TEMPLATE(phy_attrs, field, S_IWUGO, i->f->func)
 
 #define SETUP_END_DEV_ATTRIBUTE(field)                                 \
@@ -1048,6 +1326,11 @@ sas_attach_transport(struct sas_function_template *ft)
        i->phy_attr_cont.ac.match = sas_phy_match;
        transport_container_register(&i->phy_attr_cont);
 
+       i->port_attr_cont.ac.class = &sas_port_class.class;
+       i->port_attr_cont.ac.attrs = &i->port_attrs[0];
+       i->port_attr_cont.ac.match = sas_port_match;
+       transport_container_register(&i->port_attr_cont);
+
        i->rphy_attr_cont.ac.class = &sas_rphy_class.class;
        i->rphy_attr_cont.ac.attrs = &i->rphy_attrs[0];
        i->rphy_attr_cont.ac.match = sas_rphy_match;
@@ -1066,29 +1349,34 @@ sas_attach_transport(struct sas_function_template *ft)
        i->f = ft;
 
        count = 0;
+       SETUP_PORT_ATTRIBUTE(num_phys);
        i->host_attrs[count] = NULL;
 
        count = 0;
-       SETUP_PORT_ATTRIBUTE(initiator_port_protocols);
-       SETUP_PORT_ATTRIBUTE(target_port_protocols);
-       SETUP_PORT_ATTRIBUTE(device_type);
-       SETUP_PORT_ATTRIBUTE(sas_address);
-       SETUP_PORT_ATTRIBUTE(phy_identifier);
-       SETUP_PORT_ATTRIBUTE(port_identifier);
-       SETUP_PORT_ATTRIBUTE(negotiated_linkrate);
-       SETUP_PORT_ATTRIBUTE(minimum_linkrate_hw);
-       SETUP_PORT_ATTRIBUTE(minimum_linkrate);
-       SETUP_PORT_ATTRIBUTE(maximum_linkrate_hw);
-       SETUP_PORT_ATTRIBUTE(maximum_linkrate);
-
-       SETUP_PORT_ATTRIBUTE(invalid_dword_count);
-       SETUP_PORT_ATTRIBUTE(running_disparity_error_count);
-       SETUP_PORT_ATTRIBUTE(loss_of_dword_sync_count);
-       SETUP_PORT_ATTRIBUTE(phy_reset_problem_count);
-       SETUP_OPTIONAL_PORT_ATTRIBUTE_WRONLY(link_reset, phy_reset);
-       SETUP_OPTIONAL_PORT_ATTRIBUTE_WRONLY(hard_reset, phy_reset);
+       SETUP_PHY_ATTRIBUTE(initiator_port_protocols);
+       SETUP_PHY_ATTRIBUTE(target_port_protocols);
+       SETUP_PHY_ATTRIBUTE(device_type);
+       SETUP_PHY_ATTRIBUTE(sas_address);
+       SETUP_PHY_ATTRIBUTE(phy_identifier);
+       //SETUP_PHY_ATTRIBUTE(port_identifier);
+       SETUP_PHY_ATTRIBUTE(negotiated_linkrate);
+       SETUP_PHY_ATTRIBUTE(minimum_linkrate_hw);
+       SETUP_PHY_ATTRIBUTE(minimum_linkrate);
+       SETUP_PHY_ATTRIBUTE(maximum_linkrate_hw);
+       SETUP_PHY_ATTRIBUTE(maximum_linkrate);
+
+       SETUP_PHY_ATTRIBUTE(invalid_dword_count);
+       SETUP_PHY_ATTRIBUTE(running_disparity_error_count);
+       SETUP_PHY_ATTRIBUTE(loss_of_dword_sync_count);
+       SETUP_PHY_ATTRIBUTE(phy_reset_problem_count);
+       SETUP_OPTIONAL_PHY_ATTRIBUTE_WRONLY(link_reset, phy_reset);
+       SETUP_OPTIONAL_PHY_ATTRIBUTE_WRONLY(hard_reset, phy_reset);
        i->phy_attrs[count] = NULL;
 
+       count = 0;
+       SETUP_PORT_ATTRIBUTE(num_phys);
+       i->port_attrs[count] = NULL;
+
        count = 0;
        SETUP_RPORT_ATTRIBUTE(rphy_initiator_port_protocols);
        SETUP_RPORT_ATTRIBUTE(rphy_target_port_protocols);
@@ -1131,6 +1419,7 @@ void sas_release_transport(struct scsi_transport_template *t)
 
        transport_container_unregister(&i->t.host_attrs);
        transport_container_unregister(&i->phy_attr_cont);
+       transport_container_unregister(&i->port_attr_cont);
        transport_container_unregister(&i->rphy_attr_cont);
        transport_container_unregister(&i->end_dev_attr_cont);
        transport_container_unregister(&i->expander_attr_cont);
@@ -1149,9 +1438,12 @@ static __init int sas_transport_init(void)
        error = transport_class_register(&sas_phy_class);
        if (error)
                goto out_unregister_transport;
-       error = transport_class_register(&sas_rphy_class);
+       error = transport_class_register(&sas_port_class);
        if (error)
                goto out_unregister_phy;
+       error = transport_class_register(&sas_rphy_class);
+       if (error)
+               goto out_unregister_port;
        error = transport_class_register(&sas_end_dev_class);
        if (error)
                goto out_unregister_rphy;
@@ -1165,6 +1457,8 @@ static __init int sas_transport_init(void)
        transport_class_unregister(&sas_end_dev_class);
  out_unregister_rphy:
        transport_class_unregister(&sas_rphy_class);
+ out_unregister_port:
+       transport_class_unregister(&sas_port_class);
  out_unregister_phy:
        transport_class_unregister(&sas_phy_class);
  out_unregister_transport:
@@ -1178,6 +1472,7 @@ static void __exit sas_transport_exit(void)
 {
        transport_class_unregister(&sas_host_class);
        transport_class_unregister(&sas_phy_class);
+       transport_class_unregister(&sas_port_class);
        transport_class_unregister(&sas_rphy_class);
        transport_class_unregister(&sas_end_dev_class);
        transport_class_unregister(&sas_expander_class);
index ace49d5bd9c49a307ad01959cb50849f560f174e..29a9a53cdd1a14f2475693db505b374848201103 100644 (file)
@@ -18,7 +18,6 @@
  *  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/config.h>
 #include <linux/ctype.h>
 #include <linux/init.h>
 #include <linux/module.h>
index b78354fc4b1715fe0ffc08c3500a9937075e245f..cd68a66c7bb3cef1d297d9fde33eadcfef967630 100644 (file)
@@ -57,6 +57,7 @@ EXPORT_SYMBOL(scsi_bios_ptable);
 int scsicam_bios_param(struct block_device *bdev, sector_t capacity, int *ip)
 {
        unsigned char *p;
+       u64 capacity64 = capacity;      /* Suppress gcc warning */
        int ret;
 
        p = scsi_bios_ptable(bdev);
@@ -68,7 +69,7 @@ int scsicam_bios_param(struct block_device *bdev, sector_t capacity, int *ip)
                               (unsigned int *)ip + 0, (unsigned int *)ip + 1);
        kfree(p);
 
-       if (ret == -1) {
+       if (ret == -1 && capacity64 < (1ULL << 32)) {
                /* pick some standard mapping with at most 1024 cylinders,
                   and at most 62 sectors per track - this works up to
                   7905 MB */
index 354199011246633ce9cf8fcc172231648492d6ef..3225d31449e1167e818e879f9e9a7cf3fddc9f7e 100644 (file)
@@ -32,7 +32,6 @@
  *     than the level indicated above to trigger output.       
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/kernel.h>
@@ -208,6 +207,23 @@ static ssize_t sd_store_cache_type(struct class_device *cdev, const char *buf,
        return count;
 }
 
+static ssize_t sd_store_allow_restart(struct class_device *cdev, const char *buf,
+                                     size_t count)
+{
+       struct scsi_disk *sdkp = to_scsi_disk(cdev);
+       struct scsi_device *sdp = sdkp->device;
+
+       if (!capable(CAP_SYS_ADMIN))
+               return -EACCES;
+
+       if (sdp->type != TYPE_DISK)
+               return -EINVAL;
+
+       sdp->allow_restart = simple_strtoul(buf, NULL, 10);
+
+       return count;
+}
+
 static ssize_t sd_show_cache_type(struct class_device *cdev, char *buf)
 {
        struct scsi_disk *sdkp = to_scsi_disk(cdev);
@@ -223,10 +239,19 @@ static ssize_t sd_show_fua(struct class_device *cdev, char *buf)
        return snprintf(buf, 20, "%u\n", sdkp->DPOFUA);
 }
 
+static ssize_t sd_show_allow_restart(struct class_device *cdev, char *buf)
+{
+       struct scsi_disk *sdkp = to_scsi_disk(cdev);
+
+       return snprintf(buf, 40, "%d\n", sdkp->device->allow_restart);
+}
+
 static struct class_device_attribute sd_disk_attrs[] = {
        __ATTR(cache_type, S_IRUGO|S_IWUSR, sd_show_cache_type,
               sd_store_cache_type),
        __ATTR(FUA, S_IRUGO, sd_show_fua, NULL),
+       __ATTR(allow_restart, S_IRUGO|S_IWUSR, sd_show_allow_restart,
+              sd_store_allow_restart),
        __ATTR_NULL,
 };
 
@@ -891,11 +916,10 @@ static struct block_device_operations sd_fops = {
 static void sd_rw_intr(struct scsi_cmnd * SCpnt)
 {
        int result = SCpnt->result;
-       int this_count = SCpnt->request_bufflen;
-       int good_bytes = (result == 0 ? this_count : 0);
-       sector_t block_sectors = 1;
-       u64 first_err_block;
-       sector_t error_sector;
+       unsigned int xfer_size = SCpnt->request_bufflen;
+       unsigned int good_bytes = result ? 0 : xfer_size;
+       u64 start_lba = SCpnt->request->sector;
+       u64 bad_lba;
        struct scsi_sense_hdr sshdr;
        int sense_valid = 0;
        int sense_deferred = 0;
@@ -906,7 +930,6 @@ static void sd_rw_intr(struct scsi_cmnd * SCpnt)
                if (sense_valid)
                        sense_deferred = scsi_sense_is_deferred(&sshdr);
        }
-
 #ifdef CONFIG_SCSI_LOGGING
        SCSI_LOG_HLCOMPLETE(1, printk("sd_rw_intr: %s: res=0x%x\n", 
                                SCpnt->request->rq_disk->disk_name, result));
@@ -916,89 +939,72 @@ static void sd_rw_intr(struct scsi_cmnd * SCpnt)
                                sshdr.sense_key, sshdr.asc, sshdr.ascq));
        }
 #endif
-       /*
-          Handle MEDIUM ERRORs that indicate partial success.  Since this is a
-          relatively rare error condition, no care is taken to avoid
-          unnecessary additional work such as memcpy's that could be avoided.
-        */
-       if (driver_byte(result) != 0 &&
-                sense_valid && !sense_deferred) {
-               switch (sshdr.sense_key) {
-               case MEDIUM_ERROR:
-                       if (!blk_fs_request(SCpnt->request))
-                               break;
-                       info_valid = scsi_get_sense_info_fld(
-                               SCpnt->sense_buffer, SCSI_SENSE_BUFFERSIZE,
-                               &first_err_block);
-                       /*
-                        * May want to warn and skip if following cast results
-                        * in actual truncation (if sector_t < 64 bits)
-                        */
-                       error_sector = (sector_t)first_err_block;
-                       if (SCpnt->request->bio != NULL)
-                               block_sectors = bio_sectors(SCpnt->request->bio);
-                       switch (SCpnt->device->sector_size) {
-                       case 1024:
-                               error_sector <<= 1;
-                               if (block_sectors < 2)
-                                       block_sectors = 2;
-                               break;
-                       case 2048:
-                               error_sector <<= 2;
-                               if (block_sectors < 4)
-                                       block_sectors = 4;
-                               break;
-                       case 4096:
-                               error_sector <<=3;
-                               if (block_sectors < 8)
-                                       block_sectors = 8;
-                               break;
-                       case 256:
-                               error_sector >>= 1;
-                               break;
-                       default:
-                               break;
-                       }
+       if (driver_byte(result) != DRIVER_SENSE &&
+           (!sense_valid || sense_deferred))
+               goto out;
 
-                       error_sector &= ~(block_sectors - 1);
-                       good_bytes = (error_sector - SCpnt->request->sector) << 9;
-                       if (good_bytes < 0 || good_bytes >= this_count)
-                               good_bytes = 0;
+       switch (sshdr.sense_key) {
+       case HARDWARE_ERROR:
+       case MEDIUM_ERROR:
+               if (!blk_fs_request(SCpnt->request))
+                       goto out;
+               info_valid = scsi_get_sense_info_fld(SCpnt->sense_buffer,
+                                                    SCSI_SENSE_BUFFERSIZE,
+                                                    &bad_lba);
+               if (!info_valid)
+                       goto out;
+               if (xfer_size <= SCpnt->device->sector_size)
+                       goto out;
+               switch (SCpnt->device->sector_size) {
+               case 256:
+                       start_lba <<= 1;
                        break;
-
-               case RECOVERED_ERROR: /* an error occurred, but it recovered */
-               case NO_SENSE: /* LLDD got sense data */
-                       /*
-                        * Inform the user, but make sure that it's not treated
-                        * as a hard error.
-                        */
-                       scsi_print_sense("sd", SCpnt);
-                       SCpnt->result = 0;
-                       memset(SCpnt->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);
-                       good_bytes = this_count;
+               case 512:
                        break;
-
-               case ILLEGAL_REQUEST:
-                       if (SCpnt->device->use_10_for_rw &&
-                           (SCpnt->cmnd[0] == READ_10 ||
-                            SCpnt->cmnd[0] == WRITE_10))
-                               SCpnt->device->use_10_for_rw = 0;
-                       if (SCpnt->device->use_10_for_ms &&
-                           (SCpnt->cmnd[0] == MODE_SENSE_10 ||
-                            SCpnt->cmnd[0] == MODE_SELECT_10))
-                               SCpnt->device->use_10_for_ms = 0;
+               case 1024:
+                       start_lba >>= 1;
+                       break;
+               case 2048:
+                       start_lba >>= 2;
+                       break;
+               case 4096:
+                       start_lba >>= 3;
                        break;
-
                default:
+                       /* Print something here with limiting frequency. */
+                       goto out;
                        break;
                }
+               /* This computation should always be done in terms of
+                * the resolution of the device's medium.
+                */
+               good_bytes = (bad_lba - start_lba)*SCpnt->device->sector_size;
+               break;
+       case RECOVERED_ERROR:
+       case NO_SENSE:
+               /* Inform the user, but make sure that it's not treated
+                * as a hard error.
+                */
+               scsi_print_sense("sd", SCpnt);
+               SCpnt->result = 0;
+               memset(SCpnt->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);
+               good_bytes = xfer_size;
+               break;
+       case ILLEGAL_REQUEST:
+               if (SCpnt->device->use_10_for_rw &&
+                   (SCpnt->cmnd[0] == READ_10 ||
+                    SCpnt->cmnd[0] == WRITE_10))
+                       SCpnt->device->use_10_for_rw = 0;
+               if (SCpnt->device->use_10_for_ms &&
+                   (SCpnt->cmnd[0] == MODE_SENSE_10 ||
+                    SCpnt->cmnd[0] == MODE_SELECT_10))
+                       SCpnt->device->use_10_for_ms = 0;
+               break;
+       default:
+               break;
        }
-       /*
-        * This calls the generic completion function, now that we know
-        * how many actual sectors finished, and how many sectors we need
-        * to say have failed.
-        */
-       scsi_io_completion(SCpnt, good_bytes, block_sectors << 9);
+ out:
+       scsi_io_completion(SCpnt, good_bytes);
 }
 
 static int media_not_present(struct scsi_disk *sdkp,
index 7fa4da4ea64fc4c05d7f7bd99f64cde9bc9826ee..3f312a84c6a7d585dc7d9f08859b35bc6daff9a8 100644 (file)
@@ -497,7 +497,7 @@ int __init seagate_st0x_detect (struct scsi_host_template * tpnt)
                return 0;
 
        hostno = instance->host_no;
-       if (request_irq (irq, do_seagate_reconnect_intr, SA_INTERRUPT, (controller_type == SEAGATE) ? "seagate" : "tmc-8xx", instance)) {
+       if (request_irq (irq, do_seagate_reconnect_intr, IRQF_DISABLED, (controller_type == SEAGATE) ? "seagate" : "tmc-8xx", instance)) {
                printk(KERN_ERR "scsi%d : unable to allocate IRQ%d\n", hostno, irq);
                return 0;
        }
index 98b9312ba8da233344751ea5a9820f0a3becc102..65eef33846bb1eca61111e40ef2fb6d4a7d8dac3 100644 (file)
@@ -28,7 +28,6 @@ static int sg_version_num = 30533;    /* 2 digits for each component */
  *        (otherwise the macros compile to empty statements).
  *
  */
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/fs.h>
@@ -1402,6 +1401,7 @@ sg_add(struct class_device *cl_dev, struct class_interface *cl_intf)
        Sg_device *sdp = NULL;
        struct cdev * cdev = NULL;
        int error, k;
+       unsigned long iflags;
 
        disk = alloc_disk(1);
        if (!disk) {
@@ -1429,7 +1429,7 @@ sg_add(struct class_device *cl_dev, struct class_interface *cl_intf)
 
        error = cdev_add(cdev, MKDEV(SCSI_GENERIC_MAJOR, k), 1);
        if (error)
-               goto out;
+               goto cdev_add_err;
 
        sdp->cdev = cdev;
        if (sg_sysfs_valid) {
@@ -1456,6 +1456,13 @@ sg_add(struct class_device *cl_dev, struct class_interface *cl_intf)
 
        return 0;
 
+cdev_add_err:
+       write_lock_irqsave(&sg_dev_arr_lock, iflags);
+       kfree(sg_dev_arr[k]);
+       sg_dev_arr[k] = NULL;
+       sg_nr_dev--;
+       write_unlock_irqrestore(&sg_dev_arr_lock, iflags);
+
 out:
        put_disk(disk);
        if (cdev)
index 255886a9ac55c29b88660dd4dfdc7f7a09b0ef81..b27e85428daab7a59decef0a2ba3e170afb0bca2 100644 (file)
@@ -26,7 +26,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/blkdev.h>
@@ -134,7 +133,7 @@ sim710_probe_common(struct device *dev, unsigned long base_addr,
        host->this_id = scsi_id;
        host->base = base_addr;
        host->irq = irq;
-       if (request_irq(irq, NCR_700_intr, SA_SHIRQ, "sim710", host)) {
+       if (request_irq(irq, NCR_700_intr, IRQF_SHARED, "sim710", host)) {
                printk(KERN_ERR "sim710: request_irq failed\n");
                goto out_put_host;
        }
index ebf6579ed6985bb9e781b35bbc5e4d6daf85af33..fd94408577e5ae3aec19b5e7fa3657d14e641e22 100644 (file)
@@ -292,7 +292,7 @@ static void rw_intr(struct scsi_cmnd * SCpnt)
         * how many actual sectors finished, and how many sectors we need
         * to say have failed.
         */
-       scsi_io_completion(SCpnt, good_bytes, block_sectors << 9);
+       scsi_io_completion(SCpnt, good_bytes);
 }
 
 static int sr_init_command(struct scsi_cmnd * SCpnt)
index 9dde8df2f5c9feccf5d3ae98daad805b37bcecd3..a3e9d0f2eb5ba2da67f6431e68888487ac93158d 100644 (file)
@@ -34,7 +34,6 @@
  *              HP 6020 writers now supported.
  */
 
-#include <linux/config.h>
 #include <linux/cdrom.h>
 #include <linux/errno.h>
 #include <linux/string.h>
index b5218fc0ac8611eea4d68fa600573ca851f27747..756ceb93ddc801f5249ca5f20f67f0ccea78f88d 100644 (file)
@@ -3599,7 +3599,6 @@ static struct st_buffer *
        tb->use_sg = max_sg;
        tb->frp = (struct st_buf_fragment *)(&(tb->sg[0]) + max_sg);
 
-       tb->in_use = 1;
        tb->dma = need_dma;
        tb->buffer_size = got;
 
index 411209048d74ba7ccadcf3da0bf0df3de81e48e6..05a5cae126ec06e8c75c632821f8a6d8548236eb 100644 (file)
@@ -31,7 +31,6 @@ struct st_request {
 
 /* The tape buffer descriptor. */
 struct st_buffer {
-       unsigned char in_use;
        unsigned char dma;      /* DMA-able buffer */
        unsigned char do_dio;   /* direct i/o set up? */
        int buffer_size;
index 25cced91c8a63c0e3b85ad4e062e71be27f07eaa..2ebe0d66389969b3cc6504ee7deed2515e4e1fc0 100644 (file)
@@ -535,7 +535,6 @@ static __inline__ void initialize_SCp(Scsi_Cmnd *cmd)
     
 }
 
-#include <linux/config.h>
 #include <linux/delay.h>
 
 #if 1
index 2e2c1eb156364d4f7c10a6c138013f603792dacc..1f328cae5c05c2faf303204f7acd16329e4ba23b 100644 (file)
@@ -97,7 +97,7 @@ int sun3x_esp_detect(struct scsi_host_template *tpnt)
        esp->esp_command_dvma = dvma_vtob((unsigned long)esp->esp_command);
 
        esp->irq = 2;
-       if (request_irq(esp->irq, esp_intr, SA_INTERRUPT, 
+       if (request_irq(esp->irq, esp_intr, IRQF_DISABLED,
                        "SUN3X SCSI", esp->ehost)) {
                esp_deallocate(esp);
                return 0;
index 481103769729f024fbcdba26a048600b5137d10e..7519728dfc382d2a20140679c26c03bdb7534683 100644 (file)
@@ -40,7 +40,6 @@
 #ifndef SYM53C8XX_H
 #define SYM53C8XX_H
 
-#include <linux/config.h>
 
 /*
  *  DMA addressing mode.
index ea82d3df63af4d2263fa76f3f165f1e322a6201d..8c505076c0eb3631268dfa356528591284797835 100644 (file)
@@ -1547,7 +1547,7 @@ static struct Scsi_Host * __devinit sym_attach(struct scsi_host_template *tpnt,
         *  If we synchonize the C code with SCRIPTS on interrupt, 
         *  we do not want to share the INTR line at all.
         */
-       if (request_irq(pdev->irq, sym53c8xx_intr, SA_SHIRQ, NAME53C8XX, np)) {
+       if (request_irq(pdev->irq, sym53c8xx_intr, IRQF_SHARED, NAME53C8XX, np)) {
                printf_err("%s: request irq %d failure\n",
                        sym_name(np), pdev->irq);
                goto attach_failed;
index a446cda3f64c015d6a8fe1301497b6a888bed6e5..e022d3c71b59fc55e5679315ae167600fd091ce7 100644 (file)
@@ -40,7 +40,6 @@
 #ifndef SYM_GLUE_H
 #define SYM_GLUE_H
 
-#include <linux/config.h>
 #include <linux/delay.h>
 #include <linux/ioport.h>
 #include <linux/pci.h>
index a24f661b02701fbaf8b4cc6340767450cd328829..2df6747cb76fb5ce68a410b42ed748513ab5b80f 100644 (file)
@@ -260,7 +260,7 @@ found:
            instance->irq = NCR5380_probe_irq(instance, T128_IRQS);
 
        if (instance->irq != SCSI_IRQ_NONE) 
-           if (request_irq(instance->irq, t128_intr, SA_INTERRUPT, "t128", instance)) {
+           if (request_irq(instance->irq, t128_intr, IRQF_DISABLED, "t128", instance)) {
                printk("scsi%d : IRQ%d not free, interrupts disabled\n", 
                    instance->host_no, instance->irq);
                instance->irq = SCSI_IRQ_NONE;
index 91322aff241d4a8447ca7aea0d8ad9828f74c1bb..9404ff3d4c79233ff63a471a2f14901d03d167b2 100644 (file)
 #endif
 #define DCBDEBUG1(x) C_NOP
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/delay.h>
 #include <linux/signal.h>
@@ -2585,7 +2584,7 @@ static int __devinit dc390_probe_one(struct pci_dev *pdev,
        /* Reset Pending INT */
        DC390_read8_(INT_Status, io_port);
 
-       if (request_irq(pdev->irq, do_DC390_Interrupt, SA_SHIRQ,
+       if (request_irq(pdev->irq, do_DC390_Interrupt, IRQF_SHARED,
                                "tmscsim", pACB)) {
                printk(KERN_ERR "DC390: register IRQ error!\n");
                goto out_release_region;
index d4495272fb40d4991043198527eb666cef7bf794..9b66fa8d38d948129df809016c0e81deb87cc900 100644 (file)
@@ -9,7 +9,6 @@
 #define _TMSCSIM_H
 
 #include <linux/types.h>
-#include <linux/config.h>
 
 #define SCSI_IRQ_NONE 255
 
index 33cd90fc657b839d0659768e4f013ccb88b9e4f7..57449611e714ec86e44fd02c02c28044a248cb37 100644 (file)
  *  the driver sets host->wish_block = TRUE for all ISA boards.
  */
 
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/ioport.h>
@@ -873,7 +872,7 @@ static int port_detect \
 
    /* Board detected, allocate its IRQ */
    if (request_irq(irq, do_interrupt_handler,
-             SA_INTERRUPT | ((subversion == ESA) ? SA_SHIRQ : 0),
+             IRQF_DISABLED | ((subversion == ESA) ? IRQF_SHARED : 0),
              driver_name, (void *) &sha[j])) {
       printk("%s: unable to allocate IRQ %u, detaching.\n", name, irq);
       goto freelock;
index 27307fe5a4c8d8b7ea3d19d25ee3decbe8818e01..680f38ab60d8800c4458738b337a75156bba5d17 100644 (file)
@@ -71,7 +71,6 @@
  *     Richard Hirst <richard@sleepie.demon.co.uk>  August 2000
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/sched.h>
index 193ec517d252ac73a048578c14c970820f3b0618..edcb0365cf0c4d88a3bbff42fed3970da8ba704d 100644 (file)
@@ -22,7 +22,6 @@
 #ifndef WD33C93_H
 #define WD33C93_H
 
-#include <linux/config.h>
 
 #define PROC_INTERFACE     /* add code for /proc/scsi/wd33c93/xxx interface */
 #ifdef  PROC_INTERFACE
index 574955b78a2449d624d5bbfb6577a7e77daa2678..a0b61af48f1c422532609b367e6c131ea258225f 100644 (file)
@@ -1250,7 +1250,7 @@ static int wd7000_init(Adapter * host)
                return 0;
 
 
-       if (request_irq(host->irq, wd7000_intr, SA_INTERRUPT, "wd7000", host)) {
+       if (request_irq(host->irq, wd7000_intr, IRQF_DISABLED, "wd7000", host)) {
                printk("wd7000_init: can't get IRQ %d.\n", host->irq);
                return (0);
        }
index a6cfbb3b361c8addafa373468828c698d4bedbcf..4b5f908d35c308c26f76afd8a7cbb0100dc2cce4 100644 (file)
@@ -136,7 +136,7 @@ zalon_probe(struct parisc_device *dev)
        if (!host)
                goto fail;
 
-       if (request_irq(dev->irq, ncr53c8xx_intr, SA_SHIRQ, "zalon", host)) {
+       if (request_irq(dev->irq, ncr53c8xx_intr, IRQF_SHARED, "zalon", host)) {
                printk(KERN_ERR "%s: irq problem with %d, detaching\n ",
                        dev->dev.bus_id, dev->irq);
                goto fail;
index 9fd0de4b7afdb961608af0d0c62b1e7c8d56cbf6..57438326b07f94549e32705801e16e8ced09acd5 100644 (file)
@@ -7,7 +7,6 @@
  *
  *  $Id: 21285.c,v 1.37 2002/07/28 10:03:27 rmk Exp $
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/tty.h>
 #include <linux/ioport.h>
index bff94541991c099047ce91fa47f6563da27ff825..993a702422ec6e2e22175ea67e6c9bacb55ab093 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/interrupt.h>
 #include <linux/tty.h>
 #include <linux/tty_flip.h>
-#include <linux/config.h>
 #include <linux/major.h>
 #include <linux/string.h>
 #include <linux/fcntl.h>
index 978f8a609f3dbf8c3b4d901fae505331b4935de2..58aa2154655b01385b14e63df1abf81a24d32b9d 100644 (file)
@@ -11,7 +11,6 @@
 #ifndef _MC683XX_SERIAL_H
 #define _MC683XX_SERIAL_H
 
-#include <linux/config.h>
 
 struct serial_struct {
        int     type;
index 9843ae3d420e24f1441efc6513f0ed1ddbb945b2..e80e70e9b12620487236f4ec56b3cb416104fc53 100644 (file)
@@ -20,7 +20,6 @@
  *     int rs_360_init(void);
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
index f361b356bd1d693f79a8777e9a568fdc9878267b..0995430e4cf1ca3d4f5927856d0cb64739e0f7ac 100644 (file)
@@ -19,7 +19,6 @@
  *  mapbase is the physical address of the IO port.
  *  membase is an 'ioremapped' cookie.
  */
-#include <linux/config.h>
 
 #if defined(CONFIG_SERIAL_8250_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
 #define SUPPORT_SYSRQ
@@ -49,7 +48,7 @@
 
 /*
  * Configuration:
- *   share_irqs - whether we pass SA_SHIRQ to request_irq().  This option
+ *   share_irqs - whether we pass IRQF_SHARED to request_irq().  This option
  *                is unsafe when used on edge-triggered interrupts.
  */
 static unsigned int share_irqs = SERIAL8250_SHARE_IRQS;
@@ -1401,7 +1400,7 @@ static void serial_do_unlink(struct irq_info *i, struct uart_8250_port *up)
 static int serial_link_irq_chain(struct uart_8250_port *up)
 {
        struct irq_info *i = irq_lists + up->port.irq;
-       int ret, irq_flags = up->port.flags & UPF_SHARE_IRQ ? SA_SHIRQ : 0;
+       int ret, irq_flags = up->port.flags & UPF_SHARE_IRQ ? IRQF_SHARED : 0;
 
        spin_lock_irq(&i->lock);
 
index 490606b8709511e72ecd09dffc95836e43b694cd..91bd28f2bb473c637c8f19b719b9d5d8a84875a3 100644 (file)
@@ -15,7 +15,6 @@
  *  $Id: 8250.h,v 1.8 2002/07/21 21:32:30 rmk Exp $
  */
 
-#include <linux/config.h>
 #include <linux/serial_8250.h>
 
 struct old_serial_port {
index ac205256d5f308f758c5a325093bcaf2f3c86acd..d10be944ad44478818eff256d3254a0c12404c77 100644 (file)
@@ -8,7 +8,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/mca.h>
index 864ef859be5676e3c6638517e31d87d1a4045229..a1d322f8a16c8fdfc388c49e6833241e96302700 100644 (file)
@@ -134,7 +134,7 @@ afavlab_setup(struct serial_private *priv, struct pciserial_board *board,
  * and Keystone have one Diva chip with 3 UARTs.  Some later machines have
  * one Diva chip, but it has been expanded to 5 UARTs.
  */
-static int __devinit pci_hp_diva_init(struct pci_dev *dev)
+static int pci_hp_diva_init(struct pci_dev *dev)
 {
        int rc = 0;
 
@@ -194,7 +194,7 @@ pci_hp_diva_setup(struct serial_private *priv, struct pciserial_board *board,
 /*
  * Added for EKF Intel i960 serial boards
  */
-static int __devinit pci_inteli960ni_init(struct pci_dev *dev)
+static int pci_inteli960ni_init(struct pci_dev *dev)
 {
        unsigned long oldval;
 
@@ -216,7 +216,7 @@ static int __devinit pci_inteli960ni_init(struct pci_dev *dev)
  * seems to be mainly needed on card using the PLX which also use I/O
  * mapped memory.
  */
-static int __devinit pci_plx9050_init(struct pci_dev *dev)
+static int pci_plx9050_init(struct pci_dev *dev)
 {
        u8 irq_config;
        void __iomem *p;
@@ -314,7 +314,7 @@ sbs_setup(struct serial_private *priv, struct pciserial_board *board,
 /* global control register offset for SBS PMC-OctalPro */
 #define OCT_REG_CR_OFF         0x500
 
-static int __devinit sbs_init(struct pci_dev *dev)
+static int sbs_init(struct pci_dev *dev)
 {
        u8 __iomem *p;
 
@@ -493,7 +493,7 @@ static const struct timedia_struct {
        { 0, NULL }
 };
 
-static int __devinit pci_timedia_init(struct pci_dev *dev)
+static int pci_timedia_init(struct pci_dev *dev)
 {
        unsigned short *ids;
        int i, j;
@@ -566,13 +566,13 @@ titan_400l_800l_setup(struct serial_private *priv,
        return setup_port(priv, port, bar, offset, board->reg_shift);
 }
 
-static int __devinit pci_xircom_init(struct pci_dev *dev)
+static int pci_xircom_init(struct pci_dev *dev)
 {
        msleep(100);
        return 0;
 }
 
-static int __devinit pci_netmos_init(struct pci_dev *dev)
+static int pci_netmos_init(struct pci_dev *dev)
 {
        /* subdevice 0x00PS means <P> parallel, <S> serial */
        unsigned int num_serial = dev->subsystem_device & 0xf;
@@ -622,7 +622,7 @@ pci_default_setup(struct serial_private *priv, struct pciserial_board *board,
  */
 static struct pci_serial_quirk pci_serial_quirks[] = {
        /*
-        * AFAVLAB cards.
+        * AFAVLAB cards - these may be called via parport_serial
         *  It is not clear whether this applies to all products.
         */
        {
@@ -754,7 +754,7 @@ static struct pci_serial_quirk pci_serial_quirks[] = {
                .exit           = __devexit_p(sbs_exit),
        },
        /*
-        * SIIG cards.
+        * SIIG cards - these may be called via parport_serial
         */
        {
                .vendor         = PCI_VENDOR_ID_SIIG,
@@ -811,7 +811,7 @@ static struct pci_serial_quirk pci_serial_quirks[] = {
                .setup          = pci_default_setup,
        },
        /*
-        * Netmos cards
+        * Netmos cards - these may be called via parport_serial
         */
        {
                .vendor         = PCI_VENDOR_ID_NETMOS,
index 739bc84f91e9217ebce019ed8383ad8ed75a74a0..632f62d6ec7e773d09ac9c3a2fb9b5b693bb197b 100644 (file)
@@ -431,6 +431,8 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
 #endif
 
        port.flags |= UPF_SKIP_TEST | UPF_BOOT_AUTOCONF;
+       if (pnp_irq_flags(dev, 0) & IORESOURCE_IRQ_SHAREABLE)
+               port.flags |= UPF_SHARE_IRQ;
        port.uartclk = 1843200;
        port.dev = &dev->dev;
 
index e920d196d0b1b64bb6f0c3f3d1f2a1149ddb3504..7311d8487c9693f8e9b980faad8a8ee8210ee970 100644 (file)
@@ -31,7 +31,6 @@
  * required, these have to be supplied via some other means (eg, GPIO)
  * and hooked into this driver.
  */
-#include <linux/config.h>
 
 #if defined(CONFIG_SERIAL_AMBA_PL010_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
 #define SUPPORT_SYSRQ
index 3d966cfc9a38cba524a5a13383f4c6bda4a62328..a8d7124e84a1a515a97caf514231efb5ae160ee6 100644 (file)
@@ -31,7 +31,6 @@
  * required, these have to be supplied via some other means (eg, GPIO)
  * and hooked into this driver.
  */
-#include <linux/config.h>
 
 #if defined(CONFIG_SERIAL_AMBA_PL011_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
 #define SUPPORT_SYSRQ
index df9500bdaded4ebe5903e57e56dc16a746e7d6b7..a7d664383dae48f2d2202fbfb8c5e3d499fd9274 100644 (file)
@@ -22,7 +22,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/tty.h>
 #include <linux/ioport.h>
@@ -388,7 +387,7 @@ static int at91_startup(struct uart_port *port)
        /*
         * Allocate the IRQ
         */
-       retval = request_irq(port->irq, at91_interrupt, SA_SHIRQ, "at91_serial", port);
+       retval = request_irq(port->irq, at91_interrupt, IRQF_SHARED, "at91_serial", port);
        if (retval) {
                printk("at91_serial: at91_startup - Can't get irq\n");
                return retval;
index 2691112c84adacc0c52724ff5319d3852eb6ea65..f27d852ce50db48947e6343a958ac261eb3ffc41 100644 (file)
@@ -25,7 +25,6 @@
  *  $Id: clps711x.c,v 1.42 2002/07/28 10:03:28 rmk Exp $
  *
  */
-#include <linux/config.h>
 
 #if defined(CONFIG_SERIAL_CLPS711X_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
 #define SUPPORT_SYSRQ
index 5cba59ad7dc5a38eff874cbc735ec140bdb2829c..90ff96e3339bce5c8817f833e66d5d9580661a50 100644 (file)
@@ -31,7 +31,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/tty.h>
 #include <linux/ioport.h>
index 17406a05ce1f8f0336e509e9d5917e9ba1a9898b..95afc37297a849253d495e744bb90b47cde3a437 100644 (file)
@@ -27,7 +27,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/tty.h>
 #include <linux/ioport.h>
index cdba128250a96e5f2f98a07c5dcbf2318c65ff92..ef3bb476c4326ab5c46b98cc43530a48c3312b93 100644 (file)
@@ -27,7 +27,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/tty.h>
 #include <linux/ioport.h>
index b84137cdeb2be6c55d361280f01021bb7ba70ad7..cabd048c8636060138b497b294bd9b4f6e9e1382 100644 (file)
  * 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 SA_SHIRQ when request_irq() for ser2 and ser3 (shared with) par0 and par1.
+ * 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 $";
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
@@ -4943,55 +4942,55 @@ rs_init(void)
        /* 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, SA_SHIRQ | SA_INTERRUPT, "serial ", NULL))
+       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, SA_INTERRUPT, "serial 0 dma tr", NULL))
+       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, SA_INTERRUPT, "serial 0 dma rec", NULL))
+       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, SA_INTERRUPT, "serial 1 dma tr", NULL))
+       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, SA_INTERRUPT, "serial 1 dma rec", NULL))
+       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, SA_SHIRQ | SA_INTERRUPT, "serial 2 dma tr", NULL))
+       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, SA_SHIRQ | SA_INTERRUPT, "serial 2 dma rec", NULL))
+       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, SA_SHIRQ | SA_INTERRUPT, "serial 3 dma tr", NULL))
+       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, SA_SHIRQ | SA_INTERRUPT, "serial 3 dma rec", NULL))
+       if (request_irq(SER3_DMA_RX_IRQ_NBR, rec_interrupt, IRQF_SHARED | IRQF_DISABLED, "serial 3 dma rec", NULL))
                panic("irq21");
 #endif
 #endif
 
 #ifdef CONFIG_ETRAX_SERIAL_FLUSH_DMA_FAST
-       if (request_irq(TIMER1_IRQ_NBR, timeout_interrupt, SA_SHIRQ | SA_INTERRUPT,
+       if (request_irq(TIMER1_IRQ_NBR, timeout_interrupt, IRQF_SHARED | IRQF_DISABLED,
                       "fast serial dma timeout", NULL)) {
                printk(KERN_CRIT "err: timer1 irq\n");
        }
index 1800c0e7531a45e1c99fe36735a438b11db8844c..f30b93d6ef79ff85e7a0318eba71880d3c6a6686 100644 (file)
@@ -7,7 +7,6 @@
 #ifndef _ETRAX_SERIAL_H
 #define _ETRAX_SERIAL_H
 
-#include <linux/config.h>
 #include <linux/circ_buf.h>
 #include <asm/termios.h>
 
index 466d06cc7d3762473b812ddf45a4d4146dbd0e28..d119c8296a78a96d69e697a61b7c60ebb96670d9 100644 (file)
@@ -26,7 +26,6 @@
 
 #undef DEBUG_DZ
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
@@ -798,7 +797,7 @@ int __init dz_init(void)
        restore_flags(flags);
 
        if (request_irq(dz_ports[0].port.irq, dz_interrupt,
-                       SA_INTERRUPT, "DZ", &dz_ports[0]))
+                       IRQF_DISABLED, "DZ", &dz_ports[0]))
                panic("Unable to register DZ interrupt");
 
        ret = uart_register_driver(&dz_reg);
index 144a7a352b28c4fb2328a3b0857d90fc72da4e90..a3c00a2521497c7c326678853d32179de40e4e96 100644 (file)
@@ -24,7 +24,6 @@
   */
 #define SERIAL_DO_RESTART
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
@@ -1564,7 +1563,7 @@ static int __devinit icom_probe(struct pci_dev *dev,
 
         /* save off irq and request irq line */
         if ( (retval = request_irq(dev->irq, icom_interrupt,
-                                  SA_INTERRUPT | SA_SHIRQ, ICOM_DRIVER_NAME,
+                                  IRQF_DISABLED | IRQF_SHARED, ICOM_DRIVER_NAME,
                                   (void *) icom_adapter))) {
                  goto probe_exit2;
         }
index da85bafa09423fab636cc784d3dd1c98eb5de9e9..4a142d6b8f3890aa11c0bc16b3978806e42bb539 100644 (file)
@@ -25,7 +25,6 @@
  * [29-Mar-2005] Mike Lee
  * Added hardware handshake
  */
-#include <linux/config.h>
 
 #if defined(CONFIG_SERIAL_IMX_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
 #define SUPPORT_SYSRQ
@@ -405,7 +404,7 @@ static int imx_startup(struct uart_port *port)
        if (retval) goto error_out2;
 
        retval = request_irq(sport->rtsirq, imx_rtsint,
-                            SA_TRIGGER_FALLING | SA_TRIGGER_RISING,
+                            IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
                             DRIVER_NAME, sport);
        if (retval) goto error_out3;
 
index 717e47bbd784748dd810d67b17f0d9bd53cac7e7..576ca1eaa2b68119acedf4fc4ea33ee2a3209a3f 100644 (file)
@@ -2855,7 +2855,7 @@ ioc4_serial_attach_one(struct ioc4_driver_data *idd)
        control->ic_soft = soft;
 
        /* Hook up interrupt handler */
-       if (!request_irq(idd->idd_pdev->irq, ioc4_intr, SA_SHIRQ,
+       if (!request_irq(idd->idd_pdev->irq, ioc4_intr, IRQF_SHARED,
                                "sgi-ioc4serial", soft)) {
                control->ic_irq = idd->idd_pdev->irq;
        } else {
index 56b093ecd779eac6c122130d08724ac92baa9f9c..342042889f6e1c3000d9f5dc64f3f14a20c36f69 100644 (file)
@@ -12,7 +12,6 @@
  *  Copyright (C) 2002 Ralf Baechle (ralf@linux-mips.org)
  *  Copyright (C) 2002 David S. Miller (davem@redhat.com)
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index b3e1f71be4da0632b36d5524557afb579e076035..244f63be3a03f777819ba5471563af8bd7e4a936 100644 (file)
@@ -121,7 +121,7 @@ static int jsm_probe_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        }
 
        rc = request_irq(brd->irq, brd->bd_ops->intr,
-                       SA_INTERRUPT|SA_SHIRQ, "JSM", brd);
+                       IRQF_DISABLED|IRQF_SHARED, "JSM", brd);
        if (rc) {
                printk(KERN_WARNING "Failed to hook IRQ %d\n",brd->irq);
                goto out_iounmap;
index 6a2a25d9b59638762f0c1830dbbd7d6056094fcd..e7fe4bb46ecaf2c3dc169a2fb7862449fd6b0baf 100644 (file)
@@ -25,7 +25,6 @@
  *  membase is an 'ioremapped' cookie.  This is compatible with the old
  *  serial.c driver, and is currently the preferred form.
  */
-#include <linux/config.h>
 
 #if defined(CONFIG_SERIAL_M32R_SIO_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
 #define SUPPORT_SYSRQ
@@ -543,7 +542,7 @@ static void serial_do_unlink(struct irq_info *i, struct uart_sio_port *up)
 static int serial_link_irq_chain(struct uart_sio_port *up)
 {
        struct irq_info *i = irq_lists + up->port.irq;
-       int ret, irq_flags = up->port.flags & UPF_SHARE_IRQ ? SA_SHIRQ : 0;
+       int ret, irq_flags = up->port.flags & UPF_SHARE_IRQ ? IRQF_SHARED : 0;
 
        spin_lock_irq(&i->lock);
 
index 7c3ec24f7e50413466b0350835f12c84ef4a136c..849f1b2c2531a41fb5f94b949343ab415318396e 100644 (file)
@@ -15,7 +15,6 @@
  * (at your option) any later version.
  */
 
-#include <linux/config.h>
 
 struct m32r_sio_probe {
        struct module   *owner;
index 9c864529451b1f1a2548ce2450e7ef6ab154a18d..4671473793e3ccb53a1f84f56fb7d8751228280a 100644 (file)
@@ -15,7 +15,6 @@
 #ifndef _M32R_SIO_REG_H
 #define _M32R_SIO_REG_H
 
-#include <linux/config.h>
 
 #ifdef CONFIG_SERIAL_M32R_PLDSIO
 
index 29c0630e3e64a2edfdfd83e98a098f313854a613..832abd3c4706ddabe8a3a6c07d9caf0e2b8e139f 100644 (file)
@@ -1596,7 +1596,7 @@ static void mcfrs_irqinit(struct mcf_serial *info)
        /* Clear mask, so no surprise interrupts. */
        uartp[MCFUART_UIMR] = 0;
 
-       if (request_irq(info->irq, mcfrs_interrupt, SA_INTERRUPT,
+       if (request_irq(info->irq, mcfrs_interrupt, IRQF_DISABLED,
            "ColdFire UART", NULL)) {
                printk("MCFRS: Unable to attach ColdFire UART %d interrupt "
                        "vector=%d\n", info->line, info->irq);
index a2b28e8629f92885d9328dae768ba0ab4374f7eb..56420e2cb110d946da96f24f631770d7502a3e6f 100644 (file)
@@ -14,7 +14,6 @@
 #ifndef _MCF_SERIAL_H
 #define _MCF_SERIAL_H
 
-#include <linux/config.h>
 #include <linux/serial.h>
 
 #ifdef __KERNEL__
index 1aa34844218cee9065bf7e3f8d4304af5b688fff..7708e5dd3656967882ae990d1984e33b361301b3 100644 (file)
@@ -44,7 +44,6 @@
  * will be mapped to.
  */
 
-#include <linux/config.h>
 #include <linux/platform_device.h>
 #include <linux/module.h>
 #include <linux/tty.h>
@@ -191,7 +190,7 @@ mpc52xx_uart_startup(struct uart_port *port)
 
        /* Request IRQ */
        ret = request_irq(port->irq, mpc52xx_uart_int,
-               SA_INTERRUPT | SA_SAMPLE_RANDOM, "mpc52xx_psc_uart", port);
+               IRQF_DISABLED | IRQF_SAMPLE_RANDOM, "mpc52xx_psc_uart", port);
        if (ret)
                return ret;
 
@@ -727,8 +726,7 @@ mpc52xx_uart_probe(struct platform_device *dev)
 
        spin_lock_init(&port->lock);
        port->uartclk   = __res.bi_ipbfreq / 2; /* Look at CTLR doc */
-       port->fifosize  = 255; /* Should be 512 ! But it can't be */
-                              /* stored in a unsigned char       */
+       port->fifosize  = 512;
        port->iotype    = UPIO_MEM;
        port->flags     = UPF_BOOT_AUTOCONF |
                          ( uart_console(port) ? 0 : UPF_IOREMAP );
index 1cd102f84bfad80bd789016880ddb4a9f2d0c94d..63d2a66e563bac3823fbb699b11ecabce44cdbb3 100644 (file)
@@ -50,7 +50,6 @@
  * 4) AFAICT, hardware flow control isn't supported by the controller --MAG.
  */
 
-#include <linux/config.h>
 
 #if defined(CONFIG_SERIAL_MPSC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
 #define SUPPORT_SYSRQ
@@ -1413,7 +1412,7 @@ mpsc_startup(struct uart_port *port)
 
                /* If irq's are shared, need to set flag */
                if (mpsc_ports[0].port.irq == mpsc_ports[1].port.irq)
-                       flag = SA_SHIRQ;
+                       flag = IRQF_SHARED;
 
                if (request_irq(pi->port.irq, mpsc_sdma_intr, flag,
                                "mpsc-sdma", pi))
index 64c0e89124c9983bc4a29e844e2842e9cac18fb8..4a1c9983f38f8e38a78e47f761b996da129c6969 100644 (file)
@@ -16,7 +16,6 @@
 **
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/tty.h>
 #include <linux/ioport.h>
index e3ba7e17a240b8cc080c11aacc7979d49454403f..bfd2a22759ebb11fd5befc5031f861d6d50edf0e 100644 (file)
@@ -42,7 +42,6 @@
 #undef DEBUG_HARD
 #undef USE_CTRL_O_SYSRQ
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/tty.h>
 
@@ -935,7 +934,7 @@ static int pmz_startup(struct uart_port *port)
        }       
 
        pmz_get_port_A(uap)->flags |= PMACZILOG_FLAG_IS_IRQ_ON;
-       if (request_irq(uap->port.irq, pmz_interrupt, SA_SHIRQ, "PowerMac Zilog", uap)) {
+       if (request_irq(uap->port.irq, pmz_interrupt, IRQF_SHARED, "PowerMac Zilog", uap)) {
                dev_err(&uap->dev->ofdev.dev,
                        "Unable to register zs interrupt handler.\n");
                pmz_set_scc_power(uap, 0);
@@ -1444,8 +1443,8 @@ static int __init pmz_init_port(struct uart_pmac_port *uap)
                        uap->flags &= ~PMACZILOG_FLAG_HAS_DMA;
                        goto no_dma;
                }
-               uap->tx_dma_irq = np->intrs[1].line;
-               uap->rx_dma_irq = np->intrs[2].line;
+               uap->tx_dma_irq = irq_of_parse_and_map(np, 1);
+               uap->rx_dma_irq = irq_of_parse_and_map(np, 2);
        }
 no_dma:
 
@@ -1492,7 +1491,7 @@ no_dma:
         * Init remaining bits of "port" structure
         */
        uap->port.iotype = UPIO_MEM;
-       uap->port.irq = np->intrs[0].line;
+       uap->port.irq = irq_of_parse_and_map(np, 0);
        uap->port.uartclk = ZS_CLOCK;
        uap->port.fifosize = 1;
        uap->port.ops = &pmz_pops;
index 0fa0ccc9ed272b9c7dc8f9b4d71a64cc800969ed..a720953a404ee3be6d6da99484f537b40a116d66 100644 (file)
@@ -24,7 +24,6 @@
  * with the serial core maintainer satisfaction to appear soon.
  */
 
-#include <linux/config.h>
 
 #if defined(CONFIG_SERIAL_PXA_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
 #define SUPPORT_SYSRQ
@@ -390,7 +389,7 @@ static int serial_pxa_startup(struct uart_port *port)
 
        /*
         * Finally, enable interrupts.  Note: Modem status interrupts
-        * are set via set_termios(), which will be occuring imminently
+        * are set via set_termios(), which will be occurring imminently
         * anyway, so we don't enable them here.
         */
        up->ier = UART_IER_RLSI | UART_IER_RDI | UART_IER_RTOIE | UART_IER_UUE;
index 4c62ab949ecc3e01aaf04da45ca23cb7d2443a21..392bffcf96e87635b2b5d47264dd438db0724883 100644 (file)
@@ -55,7 +55,6 @@
  * BJD, 04-Nov-2004
 */
 
-#include <linux/config.h>
 
 #if defined(CONFIG_SERIAL_S3C2410_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
 #define SUPPORT_SYSRQ
index 8bbd8567669cdf955888cc0bccd4542a9470faab..db3486d338707cd9d1e22e24d78bf3d9e80f4c2c 100644 (file)
@@ -24,7 +24,6 @@
  *  $Id: sa1100.c,v 1.50 2002/07/29 14:41:04 rmk Exp $
  *
  */
-#include <linux/config.h>
 
 #if defined(CONFIG_SERIAL_SA1100_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
 #define SUPPORT_SYSRQ
index 7dc1e67b6851b2e0ade005e73be8aea60a7df782..d5f636fbf29a727b751c0e6a933f4b41137517fa 100644 (file)
@@ -22,7 +22,6 @@
  * 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/config.h>
 #include <linux/module.h>
 #include <linux/tty.h>
 #include <linux/slab.h>
  */
 static DEFINE_MUTEX(port_mutex);
 
+/*
+ * lockdep: port->lock is initialized in two places, but we
+ *          want only one lock-class:
+ */
+static struct lock_class_key port_lock_key;
+
 #define HIGH_BITS_OFFSET       ((sizeof(long)-sizeof(int))*8)
 
 #define uart_users(state)      ((state)->count + ((state)->info ? (state)->info->blocked_open : 0))
@@ -691,7 +696,8 @@ static int uart_set_info(struct uart_state *state,
                    (new_serial.baud_base != port->uartclk / 16) ||
                    (close_delay != state->close_delay) ||
                    (closing_wait != state->closing_wait) ||
-                   (new_serial.xmit_fifo_size != port->fifosize) ||
+                   (new_serial.xmit_fifo_size &&
+                    new_serial.xmit_fifo_size != port->fifosize) ||
                    (((new_flags ^ old_flags) & ~UPF_USR_MASK) != 0))
                        goto exit;
                port->flags = ((port->flags & ~UPF_USR_MASK) |
@@ -796,7 +802,8 @@ static int uart_set_info(struct uart_state *state,
        port->custom_divisor   = new_serial.custom_divisor;
        state->close_delay     = close_delay;
        state->closing_wait    = closing_wait;
-       port->fifosize         = new_serial.xmit_fifo_size;
+       if (new_serial.xmit_fifo_size)
+               port->fifosize = new_serial.xmit_fifo_size;
        if (state->info->tty)
                state->info->tty->low_latency =
                        (port->flags & UPF_LOW_LATENCY) ? 1 : 0;
@@ -1866,6 +1873,7 @@ uart_set_options(struct uart_port *port, struct console *co,
         * early.
         */
        spin_lock_init(&port->lock);
+       lockdep_set_class(&port->lock, &port_lock_key);
 
        memset(&termios, 0, sizeof(struct termios));
 
@@ -2248,8 +2256,10 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *port)
         * If this port is a console, then the spinlock is already
         * initialised.
         */
-       if (!(uart_console(port) && (port->cons->flags & CON_ENABLED)))
+       if (!(uart_console(port) && (port->cons->flags & CON_ENABLED))) {
                spin_lock_init(&port->lock);
+               lockdep_set_class(&port->lock, &port_lock_key);
+       }
 
        uart_configure_port(drv, state, port);
 
index 2c70773543e052b94f98931557e967c9eb13a9eb..cbf260bc225dc6c5bcd41758f22bb49bd3809550 100644 (file)
@@ -786,6 +786,7 @@ static struct pcmcia_device_id serial_ids[] = {
        PCMCIA_DEVICE_CIS_PROD_ID12("ADVANTECH", "COMpad-32/85B-4", 0x96913a85, 0xcec8f102, "COMpad4.cis"),
        PCMCIA_DEVICE_CIS_PROD_ID123("ADVANTECH", "COMpad-32/85", "1.0", 0x96913a85, 0x8fbe92ae, 0x0877b627, "COMpad2.cis"),
        PCMCIA_DEVICE_CIS_PROD_ID2("RS-COM 2P", 0xad20b156, "RS-COM-2P.cis"),
+       PCMCIA_DEVICE_CIS_MANF_CARD(0x0013, 0x0000, "GLOBETROTTER.cis"),
        /* too generic */
        /* PCMCIA_MFC_DEVICE_MANF_CARD(0, 0x0160, 0x0002), */
        /* PCMCIA_MFC_DEVICE_MANF_CARD(1, 0x0160, 0x0002), */
index 776d4ff060840b62ac3758097f671a8b523d9bd1..23ddedbaec086b8bf307137492e8f2a8820f14f7 100644 (file)
@@ -27,7 +27,6 @@
  *
  */
 
-#include <linux/config.h>
 
 #if defined(CONFIG_SERIAL_LH7A40X_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
 #define SUPPORT_SYSRQ
index a901a7e446f3ca91c696989fd35426a5151401e2..b361669f85a17bf8372df6fa6417e0dbbc0fc13e 100644 (file)
@@ -38,7 +38,6 @@
  *             Fix some spin_locks.
  *             Do not call uart_add_one_port for absent ports.
  */
-#include <linux/config.h>
 
 #if defined(CONFIG_SERIAL_TXX9_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
 #define SUPPORT_SYSRQ
@@ -496,7 +495,7 @@ static int serial_txx9_startup(struct uart_port *port)
        sio_out(up, TXX9_SIDISR, 0);
 
        retval = request_irq(up->port.irq, serial_txx9_interrupt,
-                            SA_SHIRQ, "serial_txx9", up);
+                            IRQF_SHARED, "serial_txx9", up);
        if (retval)
                return retval;
 
index d97f3ca6cc29996b6f4a5ed274a2b90f0af1f05c..301573373c30ad856f02752c1b1306b27b81e12a 100644 (file)
@@ -20,7 +20,6 @@
 
 #undef DEBUG
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
@@ -842,7 +841,7 @@ static int sci_request_irq(struct sci_port *port)
                        printk(KERN_ERR "sci: Cannot allocate irq.(IRQ=0)\n");
                        return -ENODEV;
                }
-               if (request_irq(port->irqs[0], sci_mpxed_interrupt, SA_INTERRUPT,
+               if (request_irq(port->irqs[0], sci_mpxed_interrupt, IRQF_DISABLED,
                                "sci", port)) {
                        printk(KERN_ERR "sci: Cannot allocate irq.\n");
                        return -ENODEV;
@@ -851,7 +850,7 @@ static int sci_request_irq(struct sci_port *port)
                for (i = 0; i < ARRAY_SIZE(handlers); i++) {
                        if (!port->irqs[i])
                                continue;
-                       if (request_irq(port->irqs[i], handlers[i], SA_INTERRUPT,
+                       if (request_irq(port->irqs[i], handlers[i], IRQF_DISABLED,
                                        desc[i], port)) {
                                printk(KERN_ERR "sci: Cannot allocate irq.\n");
                                return -ENODEV;
index 1f14bb4382f6ef5bfc6094b1b766d432454e9791..ab320fa3237c7f29ac29f6077c802574f70aeaca 100644 (file)
@@ -10,7 +10,6 @@
  *  Modified to support SH7300(SH-Mobile) SCIF. Takashi Kusuda (Jun 2003).
  *  Modified to support H8/300 Series Yoshinori Sato (Feb 2004).
  */
-#include <linux/config.h>
 #include <linux/serial_core.h>
 
 #if defined(__H8300H__) || defined(__H8300S__)
index 60ea4a3f071396637de3fc4459a10aebc7c9d268..2f148e5b92557f17d0ca76aa92054984062fcbc3 100644 (file)
@@ -37,7 +37,6 @@
  * http://oss.sgi.com/projects/GenInfo/NoticeExplan
  */
 
-#include <linux/config.h>
 #include <linux/interrupt.h>
 #include <linux/tty.h>
 #include <linux/serial.h>
@@ -649,7 +648,7 @@ static irqreturn_t sn_sal_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 static int sn_sal_connect_interrupt(struct sn_cons_port *port)
 {
        if (request_irq(SGI_UART_VECTOR, sn_sal_interrupt,
-                       SA_INTERRUPT | SA_SHIRQ,
+                       IRQF_DISABLED | IRQF_SHARED,
                        "SAL console driver", port) >= 0) {
                return SGI_UART_VECTOR;
        }
index fa4ae94243c21a070bf25d23af022648258172e7..e35d9ab359f156313f37b4d728b72cbe78fd7a24 100644 (file)
@@ -10,7 +10,6 @@
  * Copyright (C) 2002 David S. Miller (davem@redhat.com)
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/console.h>
index d36bc4003399ed27021299a92585adbd1e062d66..f851f0f44f9b83352aea262b58dc869ca01f1ee0 100644 (file)
@@ -20,8 +20,8 @@
 
 #include <asm/hypervisor.h>
 #include <asm/spitfire.h>
-#include <asm/vdev.h>
-#include <asm/oplib.h>
+#include <asm/prom.h>
+#include <asm/of_device.h>
 #include <asm/irq.h>
 
 #if defined(CONFIG_MAGIC_SYSRQ)
@@ -407,144 +407,120 @@ static inline struct console *SUNHV_CONSOLE(void)
        return &sunhv_console;
 }
 
-static int __init hv_console_compatible(char *buf, int len)
-{
-       while (len) {
-               int this_len;
-
-               if (!strcmp(buf, "qcn"))
-                       return 1;
-
-               this_len = strlen(buf) + 1;
-
-               buf += this_len;
-               len -= this_len;
-       }
-
-       return 0;
-}
-
-static unsigned int __init get_interrupt(void)
-{
-       struct device_node *dev_node;
-
-       dev_node = sun4v_vdev_root->child;
-       while (dev_node != NULL) {
-               struct property *prop;
-
-               if (strcmp(dev_node->name, "console"))
-                       goto next_sibling;
-
-               prop = of_find_property(dev_node, "compatible", NULL);
-               if (!prop)
-                       goto next_sibling;
-
-               if (hv_console_compatible(prop->value, prop->length))
-                       break;
-
-       next_sibling:
-               dev_node = dev_node->sibling;
-       }
-       if (!dev_node)
-               return 0;
-
-       /* Ok, the this is the OBP node for the sun4v hypervisor
-        * console device.  Decode the interrupt.
-        */
-       return sun4v_vdev_device_interrupt(dev_node);
-}
-
-static int __init sunhv_init(void)
+static int __devinit hv_probe(struct of_device *op, const struct of_device_id *match)
 {
        struct uart_port *port;
-       int ret;
+       int err;
 
-       if (tlb_type != hypervisor)
+       if (op->irqs[0] == 0xffffffff)
                return -ENODEV;
 
-       port = kmalloc(sizeof(struct uart_port), GFP_KERNEL);
+       port = kzalloc(sizeof(struct uart_port), GFP_KERNEL);
        if (unlikely(!port))
                return -ENOMEM;
 
-       memset(port, 0, sizeof(struct uart_port));
+       sunhv_port = port;
 
        port->line = 0;
        port->ops = &sunhv_pops;
        port->type = PORT_SUNHV;
        port->uartclk = ( 29491200 / 16 ); /* arbitrary */
 
-       /* Set this just to make uart_configure_port() happy.  */
        port->membase = (unsigned char __iomem *) __pa(port);
 
-       port->irq = get_interrupt();
-       if (!port->irq) {
-               kfree(port);
-               return -ENODEV;
-       }
+       port->irq = op->irqs[0];
+
+       port->dev = &op->dev;
 
        sunhv_reg.minor = sunserial_current_minor;
        sunhv_reg.nr = 1;
 
-       ret = uart_register_driver(&sunhv_reg);
-       if (ret < 0) {
-               printk(KERN_ERR "SUNHV: uart_register_driver() failed %d\n",
-                      ret);
-               kfree(port);
-
-               return ret;
-       }
+       err = uart_register_driver(&sunhv_reg);
+       if (err)
+               goto out_free_port;
 
        sunhv_reg.tty_driver->name_base = sunhv_reg.minor - 64;
        sunserial_current_minor += 1;
 
        sunhv_reg.cons = SUNHV_CONSOLE();
 
-       sunhv_port = port;
+       err = uart_add_one_port(&sunhv_reg, port);
+       if (err)
+               goto out_unregister_driver;
 
-       ret = uart_add_one_port(&sunhv_reg, port);
-       if (ret < 0) {
-               printk(KERN_ERR "SUNHV: uart_add_one_port() failed %d\n", ret);
-               sunserial_current_minor -= 1;
-               uart_unregister_driver(&sunhv_reg);
-               kfree(port);
-               sunhv_port = NULL;
-               return -ENODEV;
-       }
+       err = request_irq(port->irq, sunhv_interrupt, 0, "hvcons", port);
+       if (err)
+               goto out_remove_port;
 
-       if (request_irq(port->irq, sunhv_interrupt,
-                       SA_SHIRQ, "serial(sunhv)", port)) {
-               printk(KERN_ERR "sunhv: Cannot register IRQ\n");
-               uart_remove_one_port(&sunhv_reg, port);
-               sunserial_current_minor -= 1;
-               uart_unregister_driver(&sunhv_reg);
-               kfree(port);
-               sunhv_port = NULL;
-               return -ENODEV;
-       }
+       dev_set_drvdata(&op->dev, port);
 
        return 0;
+
+out_remove_port:
+       uart_remove_one_port(&sunhv_reg, port);
+
+out_unregister_driver:
+       sunserial_current_minor -= 1;
+       uart_unregister_driver(&sunhv_reg);
+
+out_free_port:
+       kfree(port);
+       sunhv_port = NULL;
+       return err;
 }
 
-static void __exit sunhv_exit(void)
+static int __devexit hv_remove(struct of_device *dev)
 {
-       struct uart_port *port = sunhv_port;
-
-       BUG_ON(!port);
+       struct uart_port *port = dev_get_drvdata(&dev->dev);
 
        free_irq(port->irq, port);
 
        uart_remove_one_port(&sunhv_reg, port);
-       sunserial_current_minor -= 1;
 
+       sunserial_current_minor -= 1;
        uart_unregister_driver(&sunhv_reg);
 
-       kfree(sunhv_port);
+       kfree(port);
        sunhv_port = NULL;
+
+       dev_set_drvdata(&dev->dev, NULL);
+
+       return 0;
+}
+
+static struct of_device_id hv_match[] = {
+       {
+               .name = "console",
+               .compatible = "qcn",
+       },
+       {},
+};
+MODULE_DEVICE_TABLE(of, hv_match);
+
+static struct of_platform_driver hv_driver = {
+       .name           = "hv",
+       .match_table    = hv_match,
+       .probe          = hv_probe,
+       .remove         = __devexit_p(hv_remove),
+};
+
+static int __init sunhv_init(void)
+{
+       if (tlb_type != hypervisor)
+               return -ENODEV;
+
+       return of_register_driver(&hv_driver, &of_bus_type);
+}
+
+static void __exit sunhv_exit(void)
+{
+       of_unregister_driver(&hv_driver);
 }
 
 module_init(sunhv_init);
 module_exit(sunhv_exit);
 
 MODULE_AUTHOR("David S. Miller");
-MODULE_DESCRIPTION("SUN4V Hypervisor console driver")
+MODULE_DESCRIPTION("SUN4V Hypervisor console driver");
+MODULE_VERSION("2.0");
 MODULE_LICENSE("GPL");
index 141fedbefbc4cd51096b4d8a2569e14722a933d8..0dbd4df44c05140499f03bbcb8e2d33be236d3fa 100644 (file)
@@ -15,7 +15,6 @@
  *   David S. Miller <davem@davemloft.net>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -1028,7 +1027,7 @@ static int __devinit sunsab_init_one(struct uart_sunsab_port *up,
                int err;
 
                err = request_irq(up->port.irq, sunsab_interrupt,
-                                 SA_SHIRQ, "sab", up);
+                                 IRQF_SHARED, "sab", up);
                if (err) {
                        of_iounmap(up->port.membase,
                                   sizeof(union sab82532_async_regs));
index 73a043b914ef61a1f32b3e9d35b9d9e3e595af98..f9013baba05b4f09f6bb1b06e038e9db9b39f907 100644 (file)
@@ -15,7 +15,6 @@
  *   David S. Miller (davem@davemloft.net), 2002-Jul-29
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -668,10 +667,10 @@ static int sunsu_startup(struct uart_port *port)
 
        if (up->su_type != SU_PORT_PORT) {
                retval = request_irq(up->port.irq, sunsu_kbd_ms_interrupt,
-                                    SA_SHIRQ, su_typev[up->su_type], up);
+                                    IRQF_SHARED, su_typev[up->su_type], up);
        } else {
                retval = request_irq(up->port.irq, sunsu_serial_interrupt,
-                                    SA_SHIRQ, su_typev[up->su_type], up);
+                                    IRQF_SHARED, su_typev[up->su_type], up);
        }
        if (retval) {
                printk("su: Cannot register IRQ %d\n", up->port.irq);
@@ -1439,6 +1438,8 @@ static int __devinit su_probe(struct of_device *op, const struct of_device_id *m
                err = sunsu_kbd_ms_init(up);
                if (err)
                        goto out_unmap;
+
+               return 0;
        }
 
        up->port.flags |= UPF_BOOT_AUTOCONF;
index 1caa286a6be680c4f7097eeec101d1a0eb071bf5..a1456d9352cba115bb7471ba5a43aacc9c75f0e8 100644 (file)
@@ -12,7 +12,6 @@
  *  Copyright (C) 2002, 2006 David S. Miller (davem@davemloft.net)
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -1355,7 +1354,7 @@ static int __devinit zs_probe(struct of_device *dev, const struct of_device_id *
 
        if (zilog_irq == -1) {
                zilog_irq = op->irqs[0];
-               err = request_irq(zilog_irq, sunzilog_interrupt, SA_SHIRQ,
+               err = request_irq(zilog_irq, sunzilog_interrupt, IRQF_SHARED,
                                  "zs", sunzilog_irq_chain);
                if (err) {
                        of_iounmap(rp, sizeof(struct zilog_layout));
index a0da2aaf71c4436d60de6d7086b5b21b682527bd..f802867c95c5ad4a7f3ca55b521b70712ae5cb84 100644 (file)
@@ -372,13 +372,13 @@ static int v850e_uart_startup (struct uart_port *port)
 
        /* Alloc RX irq.  */
        err = request_irq (V850E_UART_RX_IRQ (port->line), v850e_uart_rx_irq,
-                          SA_INTERRUPT, "v850e_uart", port);
+                          IRQF_DISABLED, "v850e_uart", port);
        if (err)
                return err;
 
        /* Alloc TX irq.  */
        err = request_irq (V850E_UART_TX_IRQ (port->line), v850e_uart_tx_irq,
-                          SA_INTERRUPT, "v850e_uart", port);
+                          IRQF_DISABLED, "v850e_uart", port);
        if (err) {
                free_irq (V850E_UART_RX_IRQ (port->line), port);
                return err;
index 017571ffa19cec0bd744cea32743fd561a99c4c8..e93d0edc2e0890b79accfcb488abbe7980d8620e 100644 (file)
@@ -19,7 +19,6 @@
  *  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/config.h>
 
 #if defined(CONFIG_SERIAL_VR41XX_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
 #define SUPPORT_SYSRQ
index ed946311d3a47e3120185e909eeb9524185cf4bc..6c7e0352d561f6ffdae0bfc568aea97f1baf4c2e 100644 (file)
@@ -7,7 +7,6 @@
  *   Pat Gefre <pfg@sgi.com> - IOC3 serial port IRQ demuxer
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/module.h>
 #include <linux/pci.h>
@@ -707,7 +706,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
                writel(~0, &idd->vma->eisr);
 
                idd->dual_irq = 1;
-               if (!request_irq(pdev->irq, ioc3_intr_eth, SA_SHIRQ,
+               if (!request_irq(pdev->irq, ioc3_intr_eth, IRQF_SHARED,
                                 "ioc3-eth", (void *)idd)) {
                        idd->irq_eth = pdev->irq;
                } else {
@@ -715,7 +714,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
                               "%s : request_irq fails for IRQ 0x%x\n ",
                               __FUNCTION__, pdev->irq);
                }
-               if (!request_irq(pdev->irq+2, ioc3_intr_io, SA_SHIRQ,
+               if (!request_irq(pdev->irq+2, ioc3_intr_io, IRQF_SHARED,
                                 "ioc3-io", (void *)idd)) {
                        idd->irq_io = pdev->irq+2;
                } else {
@@ -724,7 +723,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
                               __FUNCTION__, pdev->irq+2);
                }
        } else {
-               if (!request_irq(pdev->irq, ioc3_intr_io, SA_SHIRQ,
+               if (!request_irq(pdev->irq, ioc3_intr_io, IRQF_SHARED,
                                 "ioc3", (void *)idd)) {
                        idd->irq_io = pdev->irq;
                } else {
index ed1cdf6ac8f34dbe5d61a6b172b49ccea1bfdddd..146298ad73718189c6fd32b4af9f55ad0edba66c 100644 (file)
@@ -510,7 +510,7 @@ static void spi_complete(void *arg)
  */
 int spi_sync(struct spi_device *spi, struct spi_message *message)
 {
-       DECLARE_COMPLETION(done);
+       DECLARE_COMPLETION_ONSTACK(done);
        int status;
 
        message->complete = spi_complete;
index dd2f950b21a734ca753a48ddf55fdd31d1b573bc..a23862ef72b26cac0685cc22963d321e0919039c 100644 (file)
@@ -16,7 +16,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
 #include <linux/workqueue.h>
index a006a1ee27acb6f4ca59f4a89693673650a84e86..39d9b20f2038c436a85ba8a3543d6ec57db475c6 100644 (file)
@@ -17,7 +17,6 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/delay.h>
index cf10d5cdfb931ce1e3a08806c7e8b6d38f2c7854..757dec9c7ee9fc89b11d05dd7253ea3993c70eb8 100644 (file)
@@ -8,7 +8,6 @@
  * Copyright (C) 2001, 2002, 2003, 2004  Maciej W. Rozycki
  */
 
-#include <linux/config.h>
 
 #include <linux/errno.h>
 #include <linux/sched.h>
index 7f27b356eaf723450d3598db9d62a60a5ab3a441..5e8a27620f6f339045981b5994b4138c69be073a 100644 (file)
@@ -39,7 +39,6 @@
  *     is shared with DSRS(DTE) at pin 23.
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
@@ -1792,7 +1791,7 @@ int __init zs_init(void)
                zs_soft[channel].clk_divisor = 16;
                zs_soft[channel].zs_baud = get_zsbaud(&zs_soft[channel]);
 
-               if (request_irq(zs_soft[channel].irq, rs_interrupt, SA_SHIRQ,
+               if (request_irq(zs_soft[channel].irq, rs_interrupt, IRQF_SHARED,
                                "scc", &zs_soft[channel]))
                        printk(KERN_ERR "decserial: can't get irq %d\n",
                               zs_soft[channel].irq);
index ad742cec94fa09d1e8b5f5b1b9f0cf249b9e9e57..f4f4ef0f377ae001c2aee0d24bec14dc91a46442 100644 (file)
@@ -5,7 +5,6 @@
  * and should work with all USB controllers, regardles of bus type.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
index a9d89c78cc2087f1140b6d89613a1d065d0201cc..4c9e63e665b6988f54f4feca6566a4d6444c231e 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/usb.h>
 #include <linux/module.h>
 #include <linux/init.h>
index bcbeaf7101d16c5549c097c564eb26d5855c43bf..f7bdd94b3aa89b26cb704bf9c202a1f84432bf1b 100644 (file)
@@ -47,6 +47,7 @@
 #include <linux/usbdevice_fs.h>
 #include <linux/cdev.h>
 #include <linux/notifier.h>
+#include <linux/security.h>
 #include <asm/uaccess.h>
 #include <asm/byteorder.h>
 #include <linux/moduleparam.h>
@@ -68,6 +69,7 @@ struct async {
        void __user *userbuffer;
        void __user *userurb;
        struct urb *urb;
+       u32 secid;
 };
 
 static int usbfs_snoop = 0;
@@ -312,7 +314,7 @@ static void async_completed(struct urb *urb, struct pt_regs *regs)
                sinfo.si_code = SI_ASYNCIO;
                sinfo.si_addr = as->userurb;
                kill_proc_info_as_uid(as->signr, &sinfo, as->pid, as->uid, 
-                                     as->euid);
+                                     as->euid, as->secid);
        }
        snoop(&urb->dev->dev, "urb complete\n");
        snoop_urb(urb, as->userurb);
@@ -572,6 +574,7 @@ static int usbdev_open(struct inode *inode, struct file *file)
        ps->disc_euid = current->euid;
        ps->disccontext = NULL;
        ps->ifclaimed = 0;
+       security_task_getsecid(current, &ps->secid);
        wmb();
        list_add_tail(&ps->list, &dev->filelist);
        file->private_data = ps;
@@ -1053,6 +1056,7 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
        as->pid = current->pid;
        as->uid = current->uid;
        as->euid = current->euid;
+       security_task_getsecid(current, &as->secid);
        if (!(uurb->endpoint & USB_DIR_IN)) {
                if (copy_from_user(as->urb->transfer_buffer, uurb->buffer, as->urb->transfer_buffer_length)) {
                        free_async(as);
index c196f38453056b54eee53634faafa3345b197552..ec8906501415b38cac0298e52194874ff58a1c2f 100644 (file)
@@ -21,7 +21,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/device.h>
 #include <linux/usb.h>
 #include "hcd.h"
index f65b193cde3d43ab1a68fdd31575b298990f18cc..abee0f5b6a66492c1a9e417a8f908a0cb9d8606d 100644 (file)
@@ -15,7 +15,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #include <linux/errno.h>
index 66b78404ab34cfd4786d2742cb40c0c1c81de288..5078fb3375e34e5c573ef86113b81437ffff1d32 100644 (file)
@@ -16,7 +16,6 @@
  * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/pci.h>
@@ -126,7 +125,7 @@ int usb_hcd_pci_probe (struct pci_dev *dev, const struct pci_device_id *id)
 
        pci_set_master (dev);
 
-       retval = usb_add_hcd (hcd, dev->irq, SA_SHIRQ);
+       retval = usb_add_hcd (hcd, dev->irq, IRQF_SHARED);
        if (retval != 0)
                goto err4;
        return retval;
index 4bf914d00a14ddc9a9110c1c87b098e3a412e539..fb4d058bbde00d006deb8d4f50ce7496fbcf1384 100644 (file)
@@ -22,7 +22,6 @@
  * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/version.h>
 #include <linux/kernel.h>
index e1731ff8af4d803f73489200527ca45caf8468df..875596e98e422de1c18bbdadf37db2886193d0f4 100644 (file)
@@ -8,7 +8,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/module.h>
index bfc9b28a7242e5df48e62e188fbf405ce72f3a18..f48c3dbc367ae4e97aa7919c15439a5c0207a9ed 100644 (file)
@@ -27,7 +27,6 @@
 
 /*****************************************************************************/
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/mount.h>
@@ -201,7 +200,7 @@ static void update_sb(struct super_block *sb)
        if (!root)
                return;
 
-       mutex_lock(&root->d_inode->i_mutex);
+       mutex_lock_nested(&root->d_inode->i_mutex, I_MUTEX_PARENT);
 
        list_for_each_entry(bus, &root->d_subdirs, d_u.d_child) {
                if (bus->d_inode) {
@@ -528,7 +527,7 @@ static void fs_remove_file (struct dentry *dentry)
        if (!parent || !parent->d_inode)
                return;
 
-       mutex_lock(&parent->d_inode->i_mutex);
+       mutex_lock_nested(&parent->d_inode->i_mutex, I_MUTEX_PARENT);
        if (usbfs_positive(dentry)) {
                if (dentry->d_inode) {
                        if (S_ISDIR(dentry->d_inode->i_mode))
@@ -700,7 +699,7 @@ static void usbfs_remove_device(struct usb_device *dev)
                        sinfo.si_errno = EPIPE;
                        sinfo.si_code = SI_ASYNCIO;
                        sinfo.si_addr = ds->disccontext;
-                       kill_proc_info_as_uid(ds->discsignr, &sinfo, ds->disc_pid, ds->disc_uid, ds->disc_euid);
+                       kill_proc_info_as_uid(ds->discsignr, &sinfo, ds->disc_pid, ds->disc_uid, ds->disc_euid, ds->secid);
                }
        }
 }
index 8569600f313071dbda5fb278c2cd06d77d3c7862..4cc8d3e67db795f54f5f8dcc1d5a393c391796eb 100644 (file)
@@ -2,7 +2,6 @@
  * message.c - synchronous message handling
  */
 
-#include <linux/config.h>
 #include <linux/pci.h> /* for scatterlist macros */
 #include <linux/usb.h>
 #include <linux/module.h>
index fe0ed54fa0ae1b982c8ea1e94d15dfdf8d568bb5..b042676af0a5b11b70b1fa9e422aba2de4f2a551 100644 (file)
@@ -9,7 +9,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/notifier.h>
 #include <linux/usb.h>
index 3f49bf51cff75a6f4de11b7b2cd73bffbb52a931..dec973affb0f5b2639d9bbaeb237726c0bbd9d56 100644 (file)
@@ -10,7 +10,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/usb.h>
 #include "usb.h"
index dad4d8fd8180afc8ee779a04b380a7d364cdc9db..9864988377c74c11c052336a2065be1bdf8c54c7 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/bitops.h>
index fb488c8a860c9fc1ee8bc0605a501bd3de2d6e5a..184c24660a4c572b89fd4175d24314dd1fcb8f6c 100644 (file)
@@ -21,7 +21,6 @@
  * are evil.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/bitops.h>
index 7a650c763a627a2992f0133f662f104fba94f572..49f69236b4201614b5a8329f7d7d12ec0309d5d5 100644 (file)
@@ -80,6 +80,7 @@ struct dev_state {
        uid_t disc_uid, disc_euid;
        void __user *disccontext;
        unsigned long ifclaimed;
+       u32 secid;
 };
 
 /* internal notify stuff */
index b8d0b7825bf360c7a446aaa683e4b0a006cfa75d..1c459ff037cef275d5e487da9de0f8362fee4b26 100644 (file)
@@ -25,7 +25,6 @@
 #undef VERBOSE
 #undef PACKET_TRACE
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
@@ -1654,13 +1653,13 @@ static int __devinit at91udc_probe(struct platform_device *pdev)
        pullup(udc, 0);
 
        /* request UDC and maybe VBUS irqs */
-       if (request_irq(AT91_ID_UDP, at91_udc_irq, SA_INTERRUPT, driver_name, udc)) {
+       if (request_irq(AT91_ID_UDP, at91_udc_irq, IRQF_DISABLED, driver_name, udc)) {
                DBG("request irq %d failed\n", AT91_ID_UDP);
                retval = -EBUSY;
                goto fail1;
        }
        if (udc->board.vbus_pin > 0) {
-               if (request_irq(udc->board.vbus_pin, at91_vbus_irq, SA_INTERRUPT, driver_name, udc)) {
+               if (request_irq(udc->board.vbus_pin, at91_vbus_irq, IRQF_DISABLED, driver_name, udc)) {
                        DBG("request vbus irq %d failed\n", udc->board.vbus_pin);
                        free_irq(AT91_ID_UDP, udc);
                        retval = -EBUSY;
index 42ce41d71b7fd8d0e97dc6c96fb40040fd9eb6a8..4be47195bd38d633b3b6dca431682cc69543bcfa 100644 (file)
@@ -36,7 +36,6 @@
 
 #define DEBUG
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
index 078daa026718b234c3994d81a4c6f57a6c27557f..8320fcef04256f642cfa3830bfe8ba20043dcd9d 100644 (file)
@@ -23,7 +23,6 @@
 // #define DEBUG 1
 // #define VERBOSE
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
index a43dc908ac59218fa564b13a3ce10d3eb312f52a..b1a9cf06f3e67efe3f0baf87d7dd834d265aaa8d 100644 (file)
 #undef VERBOSE
 #undef DUMP_MSGS
 
-#include <linux/config.h>
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
index 5378c175729215c9822b240b9f68922eef263ed5..7cf2999e8616b3b8ae68a5e6a699ea26bcc90fe2 100644 (file)
@@ -24,7 +24,6 @@
 // #define     VERBOSE         /* extra debug messages (success too) */
 // #define     USB_TRACE       /* packet-level success messages */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/pci.h>
@@ -1917,7 +1916,7 @@ static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id)
        /* init to known state, then setup irqs */
        udc_reset(dev);
        udc_reinit (dev);
-       if (request_irq(pdev->irq, goku_irq, SA_SHIRQ/*|SA_SAMPLE_RANDOM*/,
+       if (request_irq(pdev->irq, goku_irq, IRQF_SHARED/*|IRQF_SAMPLE_RANDOM*/,
                        driver_name, dev) != 0) {
                DBG(dev, "request interrupt %d failed\n", pdev->irq);
                retval = -EBUSY;
index 0d3424eda0380f622d0b96053132ad873f310e7f..36db7257937728e8d399bf13576c03d6c305c7a5 100644 (file)
@@ -2107,7 +2107,7 @@ static int lh7a40x_udc_probe(struct platform_device *pdev)
 
        /* irq setup after old hardware state is cleaned up */
        retval =
-           request_irq(IRQ_USBINTR, lh7a40x_udc_irq, SA_INTERRUPT, driver_name,
+           request_irq(IRQ_USBINTR, lh7a40x_udc_irq, IRQF_DISABLED, driver_name,
                        dev);
        if (retval != 0) {
                DEBUG(KERN_ERR "%s: can't get irq %i, err %d\n", driver_name,
@@ -2143,7 +2143,7 @@ static int lh7a40x_udc_remove(struct platform_device *pdev)
 
 static struct platform_driver udc_driver = {
        .probe = lh7a40x_udc_probe,
-       .remove = lh7a40x_udc_remove
+       .remove = lh7a40x_udc_remove,
            /* FIXME power management support */
            /* .suspend = ... disable UDC */
            /* .resume = ... re-enable UDC */
index 9b2e6f7cbb8b3dc37980e8944074c89cd381c130..e3bb78524c8817fbb6144f46971f8067ddc2e6d6 100644 (file)
@@ -24,7 +24,6 @@
 #ifndef __LH7A40X_H_
 #define __LH7A40X_H_
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/ioport.h>
index 1facdea56a8a54140d72f4a5d9063fb95cffe003..09243239d948cf4c034515c89838b41b769b7817 100644 (file)
@@ -46,7 +46,6 @@
 #undef DEBUG           /* messages on error and most fault paths */
 #undef VERBOSE         /* extra debug messages (success too) */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/dma-mapping.h>
@@ -2896,7 +2895,7 @@ static int net2280_probe (struct pci_dev *pdev, const struct pci_device_id *id)
                goto done;
        }
 
-       if (request_irq (pdev->irq, net2280_irq, SA_SHIRQ, driver_name, dev)
+       if (request_irq (pdev->irq, net2280_irq, IRQF_SHARED, driver_name, dev)
                        != 0) {
                ERROR (dev, "request interrupt %d failed\n", pdev->irq);
                retval = -EBUSY;
index fbea514489094778c334c6876e906514b7b1cbce..2de9748ee6734c7763a2e4618f9769c91d36bce2 100644 (file)
@@ -22,7 +22,6 @@
 #undef DEBUG
 #undef VERBOSE
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/ioport.h>
@@ -773,7 +772,7 @@ static void dma_error(int lch, u16 ch_status, void *data)
        struct omap_ep  *ep = data;
 
        /* if ch_status & OMAP_DMA_DROP_IRQ ... */
-       /* if ch_status & OMAP_DMA_TOUT_IRQ ... */
+       /* if ch_status & OMAP1_DMA_TOUT_IRQ ... */
        ERR("%s dma error, lch %d status %02x\n", ep->ep.name, lch, ch_status);
 
        /* complete current transfer ... */
@@ -2819,7 +2818,7 @@ bad_on_1710:
 
        /* USB general purpose IRQ:  ep0, state changes, dma, etc */
        status = request_irq(pdev->resource[1].start, omap_udc_irq,
-                       SA_SAMPLE_RANDOM, driver_name, udc);
+                       IRQF_SAMPLE_RANDOM, driver_name, udc);
        if (status != 0) {
                ERR( "can't get irq %ld, err %d\n",
                        pdev->resource[1].start, status);
@@ -2828,7 +2827,7 @@ bad_on_1710:
 
        /* USB "non-iso" IRQ (PIO for all but ep0) */
        status = request_irq(pdev->resource[2].start, omap_udc_pio_irq,
-                       SA_SAMPLE_RANDOM, "omap_udc pio", udc);
+                       IRQF_SAMPLE_RANDOM, "omap_udc pio", udc);
        if (status != 0) {
                ERR( "can't get irq %ld, err %d\n",
                        pdev->resource[2].start, status);
@@ -2836,7 +2835,7 @@ bad_on_1710:
        }
 #ifdef USE_ISO
        status = request_irq(pdev->resource[3].start, omap_udc_iso_irq,
-                       SA_INTERRUPT, "omap_udc iso", udc);
+                       IRQF_DISABLED, "omap_udc iso", udc);
        if (status != 0) {
                ERR("can't get irq %ld, err %d\n",
                        pdev->resource[3].start, status);
index 735e9dbd39fdfaedec41a6ac59f91a07bb0f1381..fff027d30a09d2e564f842baa4eba11a90a80ad2 100644 (file)
@@ -27,7 +27,6 @@
 #undef DEBUG
 // #define     VERBOSE DBG_VERBOSE
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/ioport.h>
@@ -2522,7 +2521,7 @@ static int __init pxa2xx_udc_probe(struct platform_device *pdev)
 
        /* irq setup after old hardware state is cleaned up */
        retval = request_irq(IRQ_USB, pxa2xx_udc_irq,
-                       SA_INTERRUPT, driver_name, dev);
+                       IRQF_DISABLED, driver_name, dev);
        if (retval != 0) {
                printk(KERN_ERR "%s: can't get irq %i, err %d\n",
                        driver_name, IRQ_USB, retval);
@@ -2534,7 +2533,7 @@ static int __init pxa2xx_udc_probe(struct platform_device *pdev)
        if (machine_is_lubbock()) {
                retval = request_irq(LUBBOCK_USB_DISC_IRQ,
                                lubbock_vbus_irq,
-                               SA_INTERRUPT | SA_SAMPLE_RANDOM,
+                               IRQF_DISABLED | IRQF_SAMPLE_RANDOM,
                                driver_name, dev);
                if (retval != 0) {
                        printk(KERN_ERR "%s: can't get irq %i, err %d\n",
@@ -2545,7 +2544,7 @@ lubbock_fail0:
                }
                retval = request_irq(LUBBOCK_USB_IRQ,
                                lubbock_vbus_irq,
-                               SA_INTERRUPT | SA_SAMPLE_RANDOM,
+                               IRQF_DISABLED | IRQF_SAMPLE_RANDOM,
                                driver_name, dev);
                if (retval != 0) {
                        printk(KERN_ERR "%s: can't get irq %i, err %d\n",
index 3ff6db7828a04560eaf963f6ec77eec9d14dd2a3..354670d123080c4f244e387409feeb8e0f847cb2 100644 (file)
@@ -23,7 +23,6 @@
  *             updates to merge with Linux 2.6, better match RNDIS spec
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/kernel.h>
index 416acac879df5d3b96d43d99bfe984a3bb9081bd..30d7664d449d7d34340efbd06813461f517d4fa0 100644 (file)
@@ -17,7 +17,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
index 68e3d8f5da8947cb8d28cf17c2056b8829d04190..3a08a7ab4ce062b83039b98b94c121a955b4dc60 100644 (file)
@@ -62,7 +62,6 @@
 #define DEBUG 1
 // #define VERBOSE
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
index 9b4697add3130b4e482bc10483ff774ccc7a57de..d66867aa527e5630144cd879d40717fe68778a62 100644 (file)
@@ -148,7 +148,7 @@ int usb_ehci_au1xxx_probe(const struct hc_driver *driver,
        /* ehci_hcd_init(hcd_to_ehci(hcd)); */
 
        retval =
-           usb_add_hcd(hcd, dev->resource[1].start, SA_INTERRUPT | SA_SHIRQ);
+           usb_add_hcd(hcd, dev->resource[1].start, IRQF_DISABLED | IRQF_SHARED);
        if (retval == 0)
                return retval;
 
index a49a689bf4237c619c1d37f971c04d91cebb7268..d030516edfb9f6077003d7b553ee3d52a0805580 100644 (file)
@@ -121,7 +121,7 @@ int usb_hcd_fsl_probe(const struct hc_driver *driver,
        temp = in_le32(hcd->regs + 0x1a8);
        out_le32(hcd->regs + 0x1a8, temp | 0x3);
 
-       retval = usb_add_hcd(hcd, irq, SA_SHIRQ);
+       retval = usb_add_hcd(hcd, irq, IRQF_SHARED);
        if (retval != 0)
                goto err4;
        return retval;
index 9b37e508ada329119958d99d6955b7bba2ecbe65..cee6f538de0a2760abc086edbe5eb549003fd5d2 100644 (file)
@@ -16,7 +16,6 @@
  * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/dmapool.h>
index 4a22909518f5506fec0b5cc839ae78057d173550..61e571782cf7a9222d629d7e81c97076c15c3c17 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (c) 2002, 2003 Axis Communications AB.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
 #include <linux/ioport.h>
index 14386254c87029546d84f8858033958134e31580..5147ed4a66626f5a75a89b6da80f14b90a51b7cc 100644 (file)
@@ -1653,7 +1653,7 @@ static int __init isp116x_probe(struct platform_device *pdev)
                goto err6;
        }
 
-       ret = usb_add_hcd(hcd, irq, SA_INTERRUPT);
+       ret = usb_add_hcd(hcd, irq, IRQF_DISABLED);
        if (ret)
                goto err6;
 
index 6b7350b52419fc57e925081e21ea9757b6e33ef5..cdbafb710000a1f30d06083f5dfc721ce57653f4 100644 (file)
@@ -125,7 +125,7 @@ int usb_hcd_at91_probe (const struct hc_driver *driver, struct platform_device *
        at91_start_hc(pdev);
        ohci_hcd_init(hcd_to_ohci(hcd));
 
-       retval = usb_add_hcd(hcd, pdev->resource[1].start, SA_INTERRUPT);
+       retval = usb_add_hcd(hcd, pdev->resource[1].start, IRQF_DISABLED);
        if (retval == 0)
                return retval;
 
index a1c8b3b2fcc7a29c57abcbd75c0b4622e531878c..689261e44018e128566569498556687ce68a2360 100644 (file)
@@ -191,7 +191,7 @@ static int usb_ohci_au1xxx_probe(const struct hc_driver *driver,
        au1xxx_start_ohc(dev);
        ohci_hcd_init(hcd_to_ohci(hcd));
 
-       retval = usb_add_hcd(hcd, dev->resource[1].start, SA_INTERRUPT | SA_SHIRQ);
+       retval = usb_add_hcd(hcd, dev->resource[1].start, IRQF_DISABLED | IRQF_SHARED);
        if (retval == 0)
                return retval;
 
index 73f5a379d9b332a37e73b100862ad3c817e0df9e..8fb842ed5f6e1ef0f58d8e3d0a4b953f94fdee33 100644 (file)
@@ -74,7 +74,6 @@
  * This file is licenced under the GPL.
  */
  
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/pci.h>
index 0020ed7a39d0c9eada4b93d54115bf160353651c..5602da9bd52c9446e6706544f7acb11a57672aea 100644 (file)
@@ -100,7 +100,7 @@ int usb_hcd_lh7a404_probe (const struct hc_driver *driver,
        lh7a404_start_hc(dev);
        ohci_hcd_init(hcd_to_ohci(hcd));
 
-       retval = usb_add_hcd(hcd, dev->resource[1].start, SA_INTERRUPT);
+       retval = usb_add_hcd(hcd, dev->resource[1].start, IRQF_DISABLED);
        if (retval == 0)
                return retval;
 
index ca19abe01c5331437bfb9e25e9324f05686ab964..c4c4babd4767f52bd12ed0a67586021a471f1b43 100644 (file)
@@ -14,7 +14,7 @@
  * This file is licenced under the GPL.
  */
 
-#include <linux/signal.h>      /* SA_INTERRUPT */
+#include <linux/signal.h>      /* IRQF_DISABLED */
 #include <linux/jiffies.h>
 #include <linux/platform_device.h>
 #include <linux/clk.h>
@@ -334,7 +334,7 @@ int usb_hcd_omap_probe (const struct hc_driver *driver,
                retval = -ENXIO;
                goto err2;
        }
-       retval = usb_add_hcd(hcd, irq, SA_INTERRUPT);
+       retval = usb_add_hcd(hcd, irq, IRQF_DISABLED);
        if (retval == 0)
                return retval;
 
index b2a8dfa488707e78d92caffd7242d371b59cc257..9fe56ff1615dab3740cf6d75b4149c1b3556c131 100644 (file)
@@ -75,7 +75,7 @@ static int usb_hcd_ppc_soc_probe(const struct hc_driver *driver,
        ohci->flags |= OHCI_BIG_ENDIAN;
        ohci_hcd_init(ohci);
 
-       retval = usb_add_hcd(hcd, irq, SA_INTERRUPT);
+       retval = usb_add_hcd(hcd, irq, IRQF_DISABLED);
        if (retval == 0)
                return retval;
 
index fafe7c1265b31f9e719dadc9a7fbb3bebefbc89d..6f559e102789462e9efbff65ee30bcbf45e92bf4 100644 (file)
@@ -190,7 +190,7 @@ int usb_hcd_pxa27x_probe (const struct hc_driver *driver, struct platform_device
 
        ohci_hcd_init(hcd_to_ohci(hcd));
 
-       retval = usb_add_hcd(hcd, pdev->resource[1].start, SA_INTERRUPT);
+       retval = usb_add_hcd(hcd, pdev->resource[1].start, IRQF_DISABLED);
        if (retval == 0)
                return retval;
 
index 1da5de573a6fb22896e1bfffee25fc187ee40c59..d2fc6969a9f77ae6784fe2838aee33e9fe5f9bbe 100644 (file)
@@ -388,7 +388,7 @@ static int usb_hcd_s3c2410_probe (const struct hc_driver *driver,
 
        ohci_hcd_init(hcd_to_ohci(hcd));
 
-       retval = usb_add_hcd(hcd, dev->resource[1].start, SA_INTERRUPT);
+       retval = usb_add_hcd(hcd, dev->resource[1].start, IRQF_DISABLED);
        if (retval != 0)
                goto err_ioremap;
 
index fb3221ebbb29ecb298a7e803eceffbf959279c7c..ce3de106cadc46872f8d57491b634c7a2aa2ac67 100644 (file)
@@ -143,7 +143,7 @@ int usb_hcd_sa1111_probe (const struct hc_driver *driver,
        sa1111_start_hc(dev);
        ohci_hcd_init(hcd_to_ohci(hcd));
 
-       retval = usb_add_hcd(hcd, dev->irq[1], SA_INTERRUPT);
+       retval = usb_add_hcd(hcd, dev->irq[1], IRQF_DISABLED);
        if (retval == 0)
                return retval;
 
index 1045f846fbe2c4cedb5d3ac498488b572246258a..dff60568b4a147cb2e1875c4659bf8cb3a2db164 100644 (file)
@@ -8,7 +8,6 @@
  *  (and others)
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
index 89bcda5a329897aee7d5694b879595355190d84e..fa34092bbcde1e82ac9338d7a2366aea48c2e1d3 100644 (file)
@@ -31,7 +31,6 @@
 #undef VERBOSE
 #undef PACKET_TRACE
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/kernel.h>
@@ -1750,7 +1749,7 @@ sl811h_probe(struct platform_device *dev)
         * was on a system with single edge triggering, so most sorts of
         * triggering arrangement should work.
         */
-       retval = usb_add_hcd(hcd, irq, SA_INTERRUPT | SA_SHIRQ);
+       retval = usb_add_hcd(hcd, irq, IRQF_DISABLED | IRQF_SHARED);
        if (retval != 0)
                goto err6;
 
index 6637a0e49978b0b897e671dfd54861db05eb0f89..dc286a48cafdeba4d687069a294a94d2980e47d1 100644 (file)
@@ -9,7 +9,6 @@
  * (C) Copyright 1999-2001 Johannes Erdfelt
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/debugfs.h>
 #include <linux/smp_lock.h>
index 7b48567622ef318bc22317c121c752f0a48aa47f..4151f618602d13bb801f9f2360d290c898733830 100644 (file)
@@ -22,7 +22,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
index 36855062eacc8c5c984e5f8a6ca77a76c7c3b31e..9e3f139033714b49c2c7ef101803d52a78e02112 100644 (file)
@@ -27,7 +27,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index 07c8c0e665dd301ced352c6f20e0bb68a0034b98..05d2d6012eb247d4700abdb086bc257eaea1c792 100644 (file)
@@ -85,7 +85,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index c4670e1d46545f12cdfe0ef9cdd89c106d1ca594..70477f02cc29fc49d93bf9f808ce56bb72b19b3b 100644 (file)
@@ -25,7 +25,6 @@
  * e-mail - mail your message to Paul Stewart <stewart@wetlogic.net>
  */
 
-#include <linux/config.h>
 #include <linux/poll.h>
 #include <linux/slab.h>
 #include <linux/module.h>
index 5c570cc703f355af8adf2198967424e62aa968da..86acb5f1907aeebe10e644a53dc37ea02e2781ac 100644 (file)
@@ -39,7 +39,6 @@
  *
  *****************************************************************************/
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/module.h>
index 70af985b5db9ad50d63f791b99f8bb1ee648134d..4723b310f277e5358dfeb7445c92b790789af013 100644 (file)
@@ -11,7 +11,6 @@
  * and Keyspan, Inc the manufacturers of the Keyspan USB DMR product.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index 4fdee4db0729d3e165258957d1f5bfb3c58d1552..a9ccda8810e00af0fddd555c5326b587efeafeed 100644 (file)
@@ -39,7 +39,6 @@
  *
  *****************************************************************************/
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/module.h>
index da7b0bf51aff80d8b6eda7334ddfd3627c0401ff..0149043ffb975366b6e41cc3522734773c83ee32 100644 (file)
@@ -24,7 +24,6 @@
 
 //#define DEBUG
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/module.h>
index cfd4a4e04334fbcfbf78e139b58188f242c6549a..9889b1cda05b8600a181bb946698b054ecceb0e6 100644 (file)
@@ -54,7 +54,6 @@
  * 2002-07-17 - 0.0.5 : simplified d-pad handling
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/slab.h>
index 24aedbb20f032e405c8d5714ed8f3b36ad13a718..575a4e672e96a24c47925321f92b17945f87aeab 100644 (file)
@@ -46,7 +46,6 @@
  *   20050816 henk     Merge 2.6.13-rc6
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/slab.h>
index a04204292aa3db244f73ee38ad3e96e414d9d75b..b20bec445552007b23d0008bc6998a3f717244af 100644 (file)
@@ -14,7 +14,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index d0b167256699dd07c56cbd6539da65075c9d47ff..fcd69c52aea93a9f2acb1736672929ee7e70c2e9 100644 (file)
@@ -16,7 +16,6 @@
 
 */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/delay.h>
index 966acb474f678f873d90ad22bd604cadbc911bea..f30ab1fbb3c8c5f119edf1ac66dd1e3d31341bfe 100644 (file)
@@ -27,7 +27,6 @@
  * V0.13 (mh) Added support for LD X-Ray and Machine Test System
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index 779bcf0373adb9e75224bdbdab3a7306f88dfb30..7699d970e680d783bbb83c6a06280c9552bf2fcb 100644 (file)
@@ -75,7 +75,6 @@
  *   - move reset into open to clean out spurious data
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index 13aeea2026ccb6a916efca8a178ff65c6e274486..bfbbbfbb92bcca4ef3b56fe8aea5241ef057ca7b 100644 (file)
@@ -13,7 +13,6 @@
  * This is a driver for the USB PhidgetInterfaceKit.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index 5a040c205eed58f3cb3760a955aaff3cf020dff2..c0df79c9653810b17e0e87737eb9e1ab37b1dad0 100644 (file)
@@ -25,7 +25,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index 968f0d38cff769b87cfb46135fe5bff37bf0739d..9b30f896281471ab05656fb0c07e33c4040ee40a 100644 (file)
@@ -36,7 +36,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index f441964132c044315cd87ec0733bfc6bf4f8748a..0c5ee0ad6bb952fecc1eda6708cbab753ebc4120 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index 81ba14c73dc7b5b321408979043c3e2a0c428712..786e1dbe88ec4dbbd82484146ad77fa6d7444473 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index 37111acec8756a3b013bfe002bc395d9f72e2ece..2e2bbc003e9392c7ae974b6ee62f86a1b287eb9d 100644 (file)
@@ -22,7 +22,6 @@
 // #define     DEBUG                   // error path messages, extra info
 // #define     VERBOSE                 // more; success messages
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kmod.h>
 #include <linux/sched.h>
index efd195b5912c6bdab30a27f2fa86158a2a9d1ab2..82ce0358d9a3e5f13e44a76089c319e28622b662 100644 (file)
@@ -20,7 +20,6 @@
 // #define     DEBUG                   // error path messages, extra info
 // #define     VERBOSE                 // more; success messages
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/init.h>
index ec801e8bb1bba093142449e956393e29f67bfe86..e2fae85851a3e654117f61308866ad888654d150 100644 (file)
@@ -17,7 +17,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kmod.h>
 #include <linux/sched.h>
index faf1e86be687db900e4aeb15965ca52b012971d3..3155f25f1d48ba82a4abfe40c096441f8d230ff1 100644 (file)
@@ -21,7 +21,6 @@
 // #define     DEBUG                   // error path messages, extra info
 // #define     VERBOSE                 // more; success messages
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/init.h>
index 78e6a43b1087037e81bdbb74b2489b590676ccdc..a9b6eeac3e3fa5da89949bca70990f2258c3e279 100644 (file)
@@ -20,7 +20,6 @@
 // #define     DEBUG                   // error path messages, extra info
 // #define     VERBOSE                 // more; success messages
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/init.h>
index 4fe863389cb76a522cb3a8437495efd521329664..5d17cdfc7bab00e468f8beafe466533b1815596e 100644 (file)
@@ -20,7 +20,6 @@
 // #define     DEBUG                   // error path messages, extra info
 // #define     VERBOSE                 // more; success messages
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/init.h>
index f551546d7521834872cf5e0db502238449d2b7a1..c2a28d88ef3c8d174124790c0be00f116173d5c5 100644 (file)
@@ -20,7 +20,6 @@
 // #define     DEBUG                   // error path messages, extra info
 // #define     VERBOSE                 // more; success messages
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/init.h>
index 1bbbae283c0b64d7faeec26eb1acb92539ad84cf..718f8e2b552b008d8c5285e147eca5c364d2ba96 100644 (file)
@@ -6,7 +6,6 @@
  * version 2 as published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/init.h>
 #include <linux/signal.h>
index 362d6907c9bba3d68cd54f6898581deca3c7eada..54183e173a6d9a071b30609ab744490b08061243 100644 (file)
@@ -33,7 +33,6 @@
 // #define     DEBUG                   // error path messages, extra info
 // #define     VERBOSE                 // more; success messages
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/init.h>
index 813e470d0600435d058f14f471118817850b46c4..144566bda583aa26b029de28ee8eeb7d27a65727 100644 (file)
@@ -20,7 +20,6 @@
 // #define     DEBUG                   // error path messages, extra info
 // #define     VERBOSE                 // more; success messages
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/init.h>
index 4144777ea18b29fc6bf9adbcb3dc667093b2ecb2..3faa7aa0111afa4826f2f551312fb171b243ead8 100644 (file)
@@ -63,7 +63,6 @@
  *    UsbSnoop on Windows2000 and from examining the other USB drivers.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index e9f9f4bafa17568eecd17b030e014790d792909b..f2d993b70c18250cf51a8e87f7dfe4670f8d900b 100644 (file)
@@ -8,7 +8,6 @@
  *     2 as published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/tty.h>
index f3404e10afb4a3abb05bfeecc637883d68a3d3d2..3d456b32c3166e5e02d756b64c8564f8b713eb9e 100644 (file)
@@ -11,7 +11,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/slab.h>
index f8c0cb287736998ab767abd1627fa6f8ace34de5..df0a4f98b4ae6487ede58b83eb14d17b6927a3b1 100644 (file)
@@ -17,7 +17,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/slab.h>
index 1fd5c5a9f2efd45a38c9609f99642745dccf419c..49b51ab0d4cbae9f8d3a2ab5c36885885b0eb612 100644 (file)
@@ -28,7 +28,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index 5de76efe1b37f986fb3f6623717dc6cccb8d4c67..4ff2dfb299bd9a1281b8fb70179ecf13a76f5984 100644 (file)
@@ -48,7 +48,6 @@
 /* Code originates and was built up from ftdi_sio, belkin, pl2303 and others. */
 
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index b3f776a90c932c8ea1c249adb19c0aa8e2720bb2..6953d3ef5738069aea3ab3ae35caabab0c549b0b 100644 (file)
 *  $Id: digi_acceleport.c,v 1.80.1.2 2000/11/02 05:45:08 root Exp $
 */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index afca1eae5fb52499dc20b9dcd1d4b9da48fc6592..1e2b31eeb4973fc9433d51519cd215769d4766ef 100644 (file)
@@ -51,7 +51,6 @@
  * 
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index 1e419c8d7392bddde44302dece08a180d0e53704..debc3b0f96629c28c6eb9ed05f09f04215d116c5 100644 (file)
@@ -8,7 +8,6 @@
  *     2 as published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index b2bfea7c815aa3e9d7fefa1831877386a4b6f0d8..8a74b19f1283f08860c49f0a75d521eb2dfdc322 100644 (file)
 /*   to talk to the device */
 /* Thanx to gkh and the rest of the usb dev group for all code I have assimilated :-) */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index 04767759cf8a8e5190a93b232d4fca7c76ba727c..1f5d1620baa12180b55d1ddea0131333ec2c8cce 100644 (file)
@@ -23,7 +23,6 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index 07a478c59fb2bd43b3a31df788430dc5b696ff6c..945b8bb38c92ec4f422d645644dca8adfff292fd 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/slab.h>
index e9719da2aca1ed2700e8b57467b9e9a672553e45..7e06358b03109015baf2adb080aff6ad0623521d 100644 (file)
@@ -12,7 +12,6 @@
  * See Documentation/usb/usb-serial.txt for more information on using this driver
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/tty.h>
index b85d2156dfdc49c3fa211b0efd50a61b8ed497fa..bd2c05dac2a92953884644dc2717536093213f1d 100644 (file)
@@ -29,7 +29,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/jiffies.h>
 #include <linux/errno.h>
index 8e1e2253748bfaa2e2f72a768de4f70e802165cb..723a12ae87b5db65e048d36c6efce4826897bd6d 100644 (file)
@@ -24,7 +24,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/jiffies.h>
 #include <linux/errno.h>
index 9da6d2a8f2b0c692a03186a6a2110ef40419b0e4..dbcfe172a5cc954ac406abf3fbdb63feaed6cfa4 100644 (file)
@@ -44,7 +44,6 @@
  *     Thanks to info from Heath Robinson and Arieh Davidoff.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index d7f3f736a6928fc760d2159e1562132935584e40..2cf1fed3de43eb8a48d594e71624d4cd14d63692 100644 (file)
@@ -46,7 +46,6 @@
  *     initial version released.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index 2cf6ade704e41b77a267eba82c4250100a54786e..d7c58f1bc960ddb364b8a967bc7f47dbaecea726 100644 (file)
@@ -95,7 +95,6 @@
 */
 
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/jiffies.h>
 #include <linux/errno.h>
index b0441c35f98fcc8b708e5569623017b931be9b54..03ab3c0f3cce26e3f70293d37ab1ba123ff3bcfd 100644 (file)
@@ -66,7 +66,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index 65d79f630fa4b8012435d5c6e6700810f33dd011..b45ff3e7ab40f9fcca0d7216d033984ed91787aa 100644 (file)
@@ -45,7 +45,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index 87dfcd89ffabf44316fefa86d18cf4ecb1f077ce..4577333747729576672ac2028216bc46f6f30671 100644 (file)
@@ -35,7 +35,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index 35bd29b6c408e50967f177b12aeab5d71af8ae60..ca05d3275f3e01170692dd18736c99bcf98d52c3 100644 (file)
@@ -64,7 +64,6 @@
  *   (via linux-usb-devel).
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index 6dcdb5f598b88b4ae211f9a0b1590d546be7a9ad..cfb711a21a45e61f0bae25c4223ac88d26b7f6e2 100644 (file)
@@ -35,7 +35,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index b0861b61bba78e36920e8913e15fcd3b4733658d..78ad4b3126a646a7311a8255bac4d9d821c050e5 100644 (file)
@@ -57,7 +57,6 @@
 #define DRIVER_AUTHOR "Matthias Urlichs <smurf@smurf.noris.de>"
 #define DRIVER_DESC "USB Driver for GSM modems"
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/jiffies.h>
 #include <linux/errno.h>
index d88704387202389af2376b848497ee2cf06a3210..de93a2b909e78b72fb303fa4ff0702a1c206115d 100644 (file)
@@ -14,7 +14,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index f0215f850d2d3eea98faf2b6569075f596aec3cd..897d8447252b522c77c8dc741a02f191d3b2ad38 100644 (file)
@@ -60,7 +60,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index c3a2071b802d283de1d6a9a520b883925f698e32..a9afff31a9210b2dd6e8c512c0f485a130e30d7c 100644 (file)
@@ -68,7 +68,6 @@
  * fi
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index f466f89eeb6d542353652fe0f9d1a77f631f9fe6..b59a0536ea5c98a2952ef9c4075986dc43445ba7 100644 (file)
@@ -16,7 +16,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index d53ea9b11e816c1609a11c8729f67cc1ab622c62..0f2802a60194a8d347baee83583a1c41e722ba3a 100644 (file)
@@ -14,7 +14,6 @@
 #ifndef __LINUX_USB_SERIAL_H
 #define __LINUX_USB_SERIAL_H
 
-#include <linux/config.h>
 #include <linux/kref.h>
 #include <linux/mutex.h>
 
index 9e89b8d54f725a19276e075d69a2b814db69d386..95a2936e902e22a00c4360ec819292d0c531e73d 100644 (file)
@@ -13,7 +13,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index 56ffc81302fcc80fe48f4a6fdca2f16f331df0d6..540438c3f381ad7d69ae2f5044150277ae86a73e 100644 (file)
@@ -65,7 +65,6 @@
  * 
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index cd2096acc723e7d64bb3092e90b41a117ff191cd..77e244a8c37662c8db8773acc7c52802e7d224c8 100644 (file)
@@ -44,7 +44,6 @@
 #ifndef _DEBUG_H_
 #define _DEBUG_H_
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 
 #define USB_STORAGE "usb-storage: "
index 92b69e4c8047855faa5fee3803dc44e32d39e9dc..1628cb258562845e6ad85daa09eb04c5491aa7aa 100644 (file)
@@ -29,7 +29,6 @@
  * 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <scsi/scsi.h>
 #include <scsi/scsi_cmnd.h>
 #include <scsi/scsi_device.h>
index 30e96050fe0c631d966b32ef7a2816e3aa248e94..88aa59ab756321997d670082cc7c24ef84a6ba74 100644 (file)
@@ -28,7 +28,6 @@
  * (http://www.freecom.de/)
  */
 
-#include <linux/config.h>
 #include <linux/hdreg.h>
 
 #include <scsi/scsi.h>
index f9907a5cf129f42057d590bd7ca3c6551533599d..927f7781080f0afebff4b1e5ee4602cf27b6526a 100644 (file)
@@ -37,7 +37,6 @@
  * 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include "usb.h"
 #include "transport.h"
 
index 026a587eb8dd2502aedb8916c8e26077c51375fe..313920d980c9aa7b7fc39c7864409b2ed7bb6130 100644 (file)
@@ -28,7 +28,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/input.h>
 #include <linux/init.h>
index 19b25c5cafd4e2686ec3db4a5846f52a634a89cc..eb7188b3565c840622e05c2663517de512fb0549 100644 (file)
@@ -45,7 +45,6 @@
  * 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/slab.h>
index 543244d421c1f2e24bc934538187a500b56ae3a1..c7e84e653df9a38a548b954cf4d3a2fc51703577 100644 (file)
@@ -31,7 +31,6 @@
  * the following thing for it to work:
  * The macro UNUSUAL_DEV() must be defined before this file is included
  */
-#include <linux/config.h>
 
 /* If you edit this file, please try to keep it sorted first by VendorID,
  * then by ProductID.
index e232c7c8990910a285d1f1dad8fcc9acf84b4c0b..1185acac4b216ec9fb1e2a59967474d0bcb07a74 100644 (file)
@@ -47,7 +47,6 @@
  * 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/suspend.h>
index 4de9fb56ebfc02294636e65b1ca92303286e2b4e..b362039792b30fb596a916f8229f00b536b368ef 100644 (file)
@@ -13,7 +13,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index 17de4c84db698a04ff933fecfb3c7112233069d2..3badb48d662b09d1e3c99c35b8d6b4563b0398ca 100644 (file)
@@ -1557,6 +1557,21 @@ config FB_S3C2410_DEBUG
          Turn on debugging messages. Note that you can set/unset at run time
          through sysfs
 
+config FB_PNX4008_DUM
+       tristate "Display Update Module support on Philips PNX4008 board"
+       depends on FB && ARCH_PNX4008
+       ---help---
+         Say Y here to enable support for PNX4008 Display Update Module (DUM)
+
+config FB_PNX4008_DUM_RGB
+       tristate "RGB Framebuffer support on Philips PNX4008 board"
+       depends on FB_PNX4008_DUM
+       select FB_CFB_FILLRECT
+       select FB_CFB_COPYAREA
+       select FB_CFB_IMAGEBLIT
+       ---help---
+         Say Y here to enable support for PNX4008 RGB Framebuffer
+
 config FB_VIRTUAL
        tristate "Virtual Frame Buffer support (ONLY FOR TESTING!)"
        depends on FB
index c335e9bc3b2008bebf0056eefbd4933980d34481..6283d015f8f53b02056437dde71853ade2bee1fe 100644 (file)
@@ -94,6 +94,8 @@ obj-$(CONFIG_FB_TX3912)                 += tx3912fb.o
 obj-$(CONFIG_FB_S1D13XXX)        += s1d13xxxfb.o
 obj-$(CONFIG_FB_IMX)              += imxfb.o
 obj-$(CONFIG_FB_S3C2410)         += s3c2410fb.o
+obj-$(CONFIG_FB_PNX4008_DUM)     += pnx4008/
+obj-$(CONFIG_FB_PNX4008_DUM_RGB)  += pnx4008/
 
 # Platform or fallback drivers go here
 obj-$(CONFIG_FB_VESA)             += vesafb.o
index 455fda990ff70472a895cfb36b346a1d2fe181d6..e714e8449c1d1bd844485773f06ce9fdd5d3060c 100644 (file)
@@ -23,7 +23,6 @@
 
 */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/errno.h>
index 98baecccb3fd4c0522b1a6a39a2f4b31d24969c8..61a8bf159cb0d2eb0464915b3be43ec7381c45fb 100644 (file)
@@ -17,7 +17,6 @@
  *  - Blanking 8bpp displays with VIDC
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index 3033c72dea200ae7252170ee36efb882be662782..f9bc9f777e75e61b2bd895dae2eabaafdea3d8fc 100644 (file)
@@ -48,7 +48,6 @@
 #include <linux/tty.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
-#include <linux/config.h>
 #include <linux/interrupt.h>
 #include <linux/fb.h>
 #include <linux/init.h>
index 466042808dafabec885e89da3b103712a8908ac7..fd95c2dbd4f76d93d44f52a616929f8923a5b32f 100644 (file)
@@ -561,7 +561,7 @@ static int __init arcfb_probe(struct platform_device *dev)
        platform_set_drvdata(dev, info);
        if (irq) {
                par->irq = irq;
-               if (request_irq(par->irq, &arcfb_interrupt, SA_SHIRQ,
+               if (request_irq(par->irq, &arcfb_interrupt, IRQF_SHARED,
                                "arcfb", info)) {
                        printk(KERN_INFO
                                "arcfb: Failed req IRQ %d\n", par->irq);
index 29f9f0dfe3b4ce17367c1ca59c7cb96cdef0630e..eaeaf4d1a094e777c8fbffc887c997ba7d336921 100644 (file)
@@ -29,7 +29,6 @@
  *  more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index 11cf7fcb1d554ad595ddb3615f74a9cb7709dd06..72c5891094710d09451ea42e0296909d364145ef 100644 (file)
@@ -46,7 +46,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/kernel.h>
index 43d2cb58af87822ddb54c0faa14d36298c18370b..55fb8b04489b77ea3caf04ad01a1983b6054fa76 100644 (file)
@@ -2,7 +2,6 @@
  *  ATI Frame Buffer Device Driver Core Definitions
  */
 
-#include <linux/config.h>
 #include <linux/spinlock.h>
 #include <linux/wait.h>
     /*
index 22e720611bf674b31702260ca858b684c889084f..0c9706746d7955393b13c21b02833dc6c3cced76 100644 (file)
@@ -49,7 +49,6 @@
 ******************************************************************************/
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/kernel.h>
@@ -1568,7 +1567,7 @@ static int aty_enable_irq(struct atyfb_par *par, int reenable)
        u32 int_cntl;
 
        if (!test_and_set_bit(0, &par->irq_flags)) {
-               if (request_irq(par->irq, aty_irq, SA_SHIRQ, "atyfb", par)) {
+               if (request_irq(par->irq, aty_irq, IRQF_SHARED, "atyfb", par)) {
                        clear_bit(0, &par->irq_flags);
                        return -EINVAL;
                }
index 68b15645b89354535368ae43d3307eed57e9e52d..51b78f8de949aac8dfe31e999013eb786b093025 100644 (file)
@@ -52,7 +52,6 @@
 
 #define RADEON_VERSION "0.2.0"
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/kernel.h>
index a9d0414e4655a0ad2885cbaa807494ef0f757fc3..9aaca58c074ac6c4926d55608ae98bae7aab0c9f 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index 1645943b1123a43fc54af6e9d24a179c02dddfa9..38657b2d10eb9c2010d10a578584f8f3c0a4a46e 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef __RADEONFB_H__
 #define __RADEONFB_H__
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -382,7 +381,7 @@ struct radeonfb_info {
 /* Note about this function: we have some rare cases where we must not schedule,
  * this typically happen with our special "wake up early" hook which allows us to
  * wake up the graphic chip (and thus get the console back) before everything else
- * on some machines that support that mecanism. At this point, interrupts are off
+ * on some machines that support that mechanism. At this point, interrupts are off
  * and scheduling is not permitted
  */
 static inline void _radeon_msleep(struct radeonfb_info *rinfo, unsigned long ms)
index 9ef68cd83bb4d0cc527524c073779fae21579d20..a92a91fef16fc303d0aa393c4af607a063e305a2 100644 (file)
@@ -40,7 +40,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index 600d3e0e08b7343c4a3fea704ecf6ba68ff27bf2..c6a5f0ccc107232ff8ac7bd866abeccd57dea69b 100644 (file)
@@ -1694,7 +1694,7 @@ static int au1200fb_drv_probe(struct device *dev)
 
        /* Now hook interrupt too */
        if ((ret = request_irq(AU1200_LCD_INT, au1200fb_handle_irq,
-                         SA_INTERRUPT | SA_SHIRQ, "lcd", (void *)dev)) < 0) {
+                         IRQF_DISABLED | IRQF_SHARED, "lcd", (void *)dev)) < 0) {
                print_err("fail to request interrupt line %d (err: %d)",
                          AU1200_LCD_INT, ret);
                goto failed;
index bd879b7ec1193442edb2623d56909c8a16ceb843..caf1eca199b0041fa526afe23ae6f10393443a52 100644 (file)
@@ -11,7 +11,6 @@
  */
 
 /* LCD power functions */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/delay.h>
index 74415325b016db9d6e9e4f2e6983e188f28f0816..6faea4034e3db7dccd666bb032c73a1fece237a3 100644 (file)
@@ -24,7 +24,6 @@
 
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
index e5ff62e9cfb81c1952823c99ea4b4be17c8e9761..f00b50aab6061e509f957aebd5fd48f603617a48 100644 (file)
@@ -17,7 +17,6 @@
  *  the native cpu endians. I also need to deal with MSB position in the word.
  *
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/fb.h>
index ad8a89bf8eaeedcb3a087f68c7d7d3ecaeeccc64..51d35386a9450d74bd8d96ea674b7356dfd3341a 100644 (file)
@@ -29,7 +29,6 @@
  *  Also need to add code to deal with cards endians that are different than
  *  the native cpu endians. I also need to deal with MSB position in the word.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/fb.h>
index d76bbfac92ccf15e3e9a8141547b89c3fa8dbb13..0e465c80ef241f261e7948425eca67c82d1a60a4 100644 (file)
@@ -14,7 +14,6 @@
  *  more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index dda240eb73609c5f93a0efa7895548d5f47603cf..7355da09c721bc8fa7ad1fee66f51d4356abe7c3 100644 (file)
@@ -36,7 +36,6 @@
 
 #define CIRRUSFB_VERSION "2.0-pre2"
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index eea422eb1ab56b8bf83bcae1083e51066beeca98..308850df16fea8bafaa7c610cf954f87fc7cd866 100644 (file)
@@ -10,7 +10,6 @@
  *  more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/fb.h>
index 1ecda91e5a9ce254784ced7b7c2f5340c0c6eb6e..878707a0439824488cbdd7ae5d81b214e6dd2129 100644 (file)
@@ -22,7 +22,6 @@
 #define DUMMY_ROWS     ORIG_VIDEO_LINES
 #elif defined(__hppa__)
 /* set by Kconfig. Use 80x25 for 640x480 and 160x64 for 1280x1024 */
-#include <linux/config.h>
 #define DUMMY_COLUMNS  CONFIG_DUMMY_CONSOLE_COLUMNS
 #define DUMMY_ROWS     CONFIG_DUMMY_CONSOLE_ROWS
 #else
index 5dc4083552d844b9b4618d7b599599e7a63bed80..94e9f7069bef085cfa37707e0875b63ffe161801 100644 (file)
@@ -58,7 +58,6 @@
 
 #undef FBCONDEBUG
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/sched.h>
index 3487a636370af24199b0db23f015ce38f0418ee3..f244ad066d688852af1826a8f3b0aabc550c0b6a 100644 (file)
@@ -11,7 +11,6 @@
 #ifndef _VIDEO_FBCON_H
 #define _VIDEO_FBCON_H
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/vt_buffer.h>
 #include <linux/vt_kern.h>
index 990289a69b785163ac95b3dfb28dde61e03d3b0b..4481c80b8b2a12b533b206cda6e19775ea6bbe1b 100644 (file)
@@ -8,7 +8,6 @@
  *  more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/fb.h>
index d44c5fa515fb3e9156d93d0e057c17d01d238e7d..7f92c06afea7a7b749e9ce8e7dba20b691f8ac43 100644 (file)
@@ -8,7 +8,6 @@
  *  more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/fb.h>
index 2dc091fbd5c9c0d29066817b1c0c4ae436ef2178..00884e013f0f2713591bad338b978ac37713b5cf 100644 (file)
@@ -8,7 +8,6 @@
  *  more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/fb.h>
index f56ed068a5bc753f3b54a52da1f8941ad60e0a34..ab91005e64dc67d07688dc24a175b2fa68d45f83 100644 (file)
@@ -8,7 +8,6 @@
  *  more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/fb.h>
index 2d2e39632e2d72032d402cc124b0baf22e8f2af3..40f3d4eeb1980256aafd9bb506c2b8d90b51de6b 100644 (file)
@@ -1,6 +1,5 @@
 /* Acorn-like font definition, with PC graphics characters */
 
-#include <linux/config.h>
 #include <linux/font.h>
 
 static const unsigned char acorndata_8x8[] = {
index 0cc1bfda76a684c22584108526201531c34507e1..c960728b7e82dd2fe6439f2a7364cabdcede9c43 100644 (file)
@@ -12,7 +12,6 @@
  * for more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/string.h>
index d6e6ad537f9f73e8a05c5a5ff698bc08f0547161..5cd5e114d1e67cb9e1f4be2fe9302e6f8ae8d70a 100644 (file)
@@ -5,7 +5,6 @@
  * Copyright (C) 1998  Jakub Jelinek  (jj@ultra.linux.cz)
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index 74ac2acaf72c820b60ca65f6d4e46ed7f67c7fe6..88e7038eab889f68eedc0ace5911cac131e3ec93 100644 (file)
@@ -13,7 +13,6 @@
  * 
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 153352ca9461c030515c755e8867f465cf0fff1a..d981fe4d86c6b18dc5396dc99a032b5f02ca455d 100644 (file)
@@ -8,7 +8,6 @@
  *  more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/fb.h>
index 01401cd63ac061279a382f9884cb86424f2d0cd7..05735ff4e9c5205d311c7cf39e20ff62dcececc9 100644 (file)
@@ -33,7 +33,6 @@
  *  more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/sched.h>
index 655301a8671c139f4ead17f56b05ad89a3a26d03..acdd6a103dbb49d97c881274c0314e691382f1e0 100644 (file)
@@ -31,7 +31,6 @@
  *  more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index 55a3514157ed743e09035bdf9a866d8f7e942deb..2e2924957d8f81a00d335957ada78df74e35eff4 100644 (file)
@@ -36,7 +36,6 @@
  * (which, incidentally, is about the same saving as a 2.5in hard disk
  * entering standby mode.)
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index bd7e1c040781d597b29583b0cc3f781f91cf2355..de4fc43e51c1a2b1e954e9bd03b519fed2568d70 100644 (file)
@@ -9,7 +9,6 @@
  *
  * Integraphics Cyber2000 frame buffer device
  */
-#include <linux/config.h>
 
 /*
  * Internal CyberPro sizes and offsets.
index 0ae0a97b0fed05c5ea8129b018d2179eecac87bc..94a66c2d2cf528a7f9f31c1c209ef3841f6433a1 100644 (file)
@@ -14,7 +14,6 @@
 
 #define CYBLAFB_PIXMAPSIZE 8192
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/fb.h>
index a171daab0ad0b7467f97c5fde87fefb1ec1f8569..33034f81114d48e64b860528db1cc5c70ab269e0 100644 (file)
@@ -11,7 +11,6 @@
  * for more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/compat.h>
index 5e25b98601967722df5e6014fbfb35d97abedcb7..bf0e60b5a3b645c71e64430657e22366250ae141 100644 (file)
@@ -9,7 +9,6 @@
  *  more details.
  */
 
-#include <linux/config.h>
 #include <linux/delay.h>
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
index f04ca721f94c53895f19f72b23e2998b48d2ffc7..01864767450dbd3e70e47f8060e038d18380854f 100644 (file)
@@ -11,7 +11,6 @@
  *  more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index 3fe3ae1aff120425c834b1568af7cb4e49d0234d..c1f7b49975dd1a8bb78fd1817ddfd33cd3e5018a 100644 (file)
@@ -8,7 +8,6 @@
  *  License. See the file COPYING in the main directory of this archive for
  *  more details.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index a1f7d80f0ac103928003127b7c6a2fb90c66f7b2..fbe8a2c4b04c158b9df60d7f3770f5e934b5098c 100644 (file)
@@ -29,7 +29,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/string.h>
index 7b1c168c834d6db07431d1cc89d158d31bcf0df2..cdbae173d69a4ef393eb7ecd84545204478503f8 100644 (file)
@@ -207,10 +207,6 @@ static int __init imacfb_probe(struct platform_device *dev)
                size_remap = size_total;
        imacfb_fix.smem_len = size_remap;
 
-#ifndef __i386__
-       screen_info.imacpm_seg = 0;
-#endif
-
        if (!request_mem_region(imacfb_fix.smem_start, size_total, "imacfb")) {
                printk(KERN_WARNING
                       "imacfb: cannot reserve video memory at 0x%lx\n",
index f73c642b50c2b6d28d040d12efbaf055010e4971..5f393d985b11270f800cdd84c3f500d04bd9bef7 100644 (file)
@@ -16,7 +16,6 @@
  *  more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index 1718baaeed2a6b2271135d6bda6358c333f839c9..0f9b2fdc28b19f4117c01f4b96e98728936b865c 100644 (file)
@@ -18,7 +18,6 @@
 
 //#define DEBUG 1
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index 0a0a8b199ecc510f90858dd33cc45f3de34669fb..3f39d84015f1bccb7c96d057fcd71de7806ba55a 100644 (file)
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index 7533b3dd08ac96b247579dc77f5ec1fe15f8a0d0..3b78a57924f0483135fdaffa04af1e017d98d8ca 100644 (file)
@@ -19,7 +19,6 @@
 
 /* $DHD: intelfb/intelfbhw.c,v 1.9 2003/06/27 15:06:25 dawes Exp $ */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index 477ad297de4e03f7a9096c745ef2f885d878dde2..2fdbe9b2b04bfcf5dfd68355fdad1037959f5805 100644 (file)
@@ -9,7 +9,6 @@
  * for more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 788fa812c871a851c457d61834adac900445c5ec..80c03618eb535910b7796eab43006c0b841422f7 100644 (file)
@@ -9,7 +9,6 @@
  *  Copyright (C) 2003 Geert Uytterhoeven <geert@linux-m68k.org>
  */
 
-#include <linux/config.h>
 #include <linux/linux_logo.h>
 #include <linux/stddef.h>
 #include <linux/module.h>
index d21321ca7c39603eb9d61f053ba1b1e474149a43..ab2149531a0413e596d43009a6d3c9d26bc4ab3d 100644 (file)
@@ -15,7 +15,6 @@
  *  more details.
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/fb.h>
 #include <linux/string.h>
index a456e67a5b004270048a7a38a351bee3d410c9f8..c4b570b4a4df0e448365acd66f7c6ab8c7284303 100644 (file)
@@ -12,7 +12,6 @@
  *
  */
 
-#include <linux/config.h>
 
 #include "matroxfb_DAC1064.h"
 #include "matroxfb_misc.h"
index 56513a5d220b03d44531c2b677441bd3f3b2380a..df39c3193735743ce21043a92c6aefce81d7cd37 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef __MATROXFB_DAC1064_H__
 #define __MATROXFB_DAC1064_H__
 
-#include <linux/config.h>
 
 #include "matroxfb_base.h"
 
index 23ebad0a12d8ca55a0d598cf4219868e03cfa045..a5690a5f29d585f69f069c43e7b783af8f494475 100644 (file)
@@ -78,7 +78,6 @@
  *
  */
 
-#include <linux/config.h>
 
 #include "matroxfb_Ti3026.h"
 #include "matroxfb_misc.h"
index 536e5f69de9fb338f3ef6983f3c728592e2b216c..27872aaa0a17d494d5cadc73de0609093744f99f 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef __MATROXFB_TI3026_H__
 #define __MATROXFB_TI3026_H__
 
-#include <linux/config.h>
 
 #include "matroxfb_base.h"
 
index f4ddd3431f179055e54b12118162c26b40cf2278..4a57dabb77d4a1cf028d47b5f84f8643fb00f663 100644 (file)
@@ -99,7 +99,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/version.h>
 
 #define __OLD_VIDIOC_
@@ -234,7 +233,7 @@ int matroxfb_enable_irq(WPMINFO int reenable) {
 
        if (!test_and_set_bit(0, &ACCESS_FBINFO(irq_flags))) {
                if (request_irq(ACCESS_FBINFO(pcidev)->irq, matrox_irq,
-                               SA_SHIRQ, "matroxfb", MINFO)) {
+                               IRQF_SHARED, "matroxfb", MINFO)) {
                        clear_bit(0, &ACCESS_FBINFO(irq_flags));
                        return -EINVAL;
                }
index b71737178d0d9bcbbfc328d62e88aae7433dbc7c..b95779b57c0650e69070ebf028aefa9fd96f8651 100644 (file)
@@ -25,7 +25,6 @@
 /* Guard accelerator accesses with spin_lock_irqsave... */
 #undef MATROXFB_USE_SPINLOCKS
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index 263d801ef78fd00898d0447205236c39b03c604f..18886b629cb1bb3c8fcea5cb9a0f4132f0fdb20c 100644 (file)
@@ -84,7 +84,6 @@
  *
  */
 
-#include <linux/config.h>
 
 #include "matroxfb_misc.h"
 #include <linux/interrupt.h>
index 2f156b724d1ccf00901de1f6f1eac2c8e0c08100..773855a311e83d7b1e51c7fb1cad1b6a73fe79b4 100644 (file)
@@ -54,7 +54,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index 1edb1c432b753ed4349600e4d82a4142bb8b38e3..19eef3a090232854860ad993365993dc7e5f68f6 100644 (file)
@@ -10,7 +10,6 @@
  * for more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index 7a03d040b1a3255bb0d9e2a5dbc4828b49c36c42..8209106e26eee00fbbbe2e2c282a87675e11dbba 100644 (file)
@@ -10,7 +10,6 @@
  * for more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index 7b5cffb2785127dca434b8e55804198a7e27d3c4..b02d6033cc0c021740c539269c0b35f878fc4eca 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index ad1434e3f2277ff33bbc5dad7224ceff8e7da4a5..71ce1fa45cf4da03eb4c8d36bed2d2edfcfbe4b0 100644 (file)
@@ -12,7 +12,6 @@
  *  more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -98,14 +97,43 @@ static int offb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
                          u_int transp, struct fb_info *info)
 {
        struct offb_par *par = (struct offb_par *) info->par;
+       int i, depth;
+       u32 *pal = info->pseudo_palette;
 
-       if (!par->cmap_adr || regno > 255)
+       depth = info->var.bits_per_pixel;
+       if (depth == 16)
+               depth = (info->var.green.length == 5) ? 15 : 16;
+
+       if (regno > 255 ||
+           (depth == 16 && regno > 63) ||
+           (depth == 15 && regno > 31))
                return 1;
 
+       if (regno < 16) {
+               switch (depth) {
+               case 15:
+                       pal[regno] = (regno << 10) | (regno << 5) | regno;
+                       break;
+               case 16:
+                       pal[regno] = (regno << 11) | (regno << 5) | regno;
+                       break;
+               case 24:
+                       pal[regno] = (regno << 16) | (regno << 8) | regno;
+                       break;
+               case 32:
+                       i = (regno << 8) | regno;
+                       pal[regno] = (i << 16) | i;
+                       break;
+               }
+       }
+
        red >>= 8;
        green >>= 8;
        blue >>= 8;
 
+       if (!par->cmap_adr)
+               return 0;
+
        switch (par->cmap_type) {
        case cmap_m64:
                writeb(regno, par->cmap_adr);
@@ -142,20 +170,6 @@ static int offb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
                break;
        }
 
-       if (regno < 16)
-               switch (info->var.bits_per_pixel) {
-               case 16:
-                       ((u16 *) (info->pseudo_palette))[regno] =
-                           (regno << 10) | (regno << 5) | regno;
-                       break;
-               case 32:
-                       {
-                               int i = (regno << 8) | regno;
-                               ((u32 *) (info->pseudo_palette))[regno] =
-                                   (i << 16) | i;
-                               break;
-                       }
-               }
        return 0;
 }
 
@@ -224,81 +238,9 @@ int __init offb_init(void)
 {
        struct device_node *dp = NULL, *boot_disp = NULL;
 
-#if defined(CONFIG_BOOTX_TEXT) && defined(CONFIG_PPC32)
-       struct device_node *macos_display = NULL;
-#endif
        if (fb_get_options("offb", NULL))
                return -ENODEV;
 
-#if defined(CONFIG_BOOTX_TEXT) && defined(CONFIG_PPC32)
-       /* If we're booted from BootX... */
-       if (boot_infos != 0) {
-               unsigned long addr =
-                   (unsigned long) boot_infos->dispDeviceBase;
-               u32 *addrp;
-               u64 daddr, dsize;
-               unsigned int flags;
-
-               /* find the device node corresponding to the macos display */
-               while ((dp = of_find_node_by_type(dp, "display"))) {
-                       int i;
-
-                       /*
-                        * Look for an AAPL,address property first.
-                        */
-                       unsigned int na;
-                       unsigned int *ap =
-                               (unsigned int *)get_property(dp, "AAPL,address",
-                                                            &na);
-                       if (ap != 0) {
-                               for (na /= sizeof(unsigned int); na > 0;
-                                    --na, ++ap)
-                                       if (*ap <= addr &&
-                                           addr < *ap + 0x1000000) {
-                                               macos_display = dp;
-                                               goto foundit;
-                                       }
-                       }
-
-                       /*
-                        * See if the display address is in one of the address
-                        * ranges for this display.
-                        */
-                       i = 0;
-                       for (;;) {
-                               addrp = of_get_address(dp, i++, &dsize, &flags);
-                               if (addrp == NULL)
-                                       break;
-                               if (!(flags & IORESOURCE_MEM))
-                                       continue;
-                               daddr = of_translate_address(dp, addrp);
-                               if (daddr == OF_BAD_ADDR)
-                                       continue;
-                               if (daddr <= addr && addr < (daddr + dsize)) {
-                                       macos_display = dp;
-                                       goto foundit;
-                               }
-                       }
-               foundit:
-                       if (macos_display) {
-                               printk(KERN_INFO "MacOS display is %s\n",
-                                      dp->full_name);
-                               break;
-                       }
-               }
-
-               /* initialize it */
-               offb_init_fb(macos_display ? macos_display->
-                            name : "MacOS display",
-                            macos_display ? macos_display->
-                            full_name : "MacOS display",
-                            boot_infos->dispDeviceRect[2],
-                            boot_infos->dispDeviceRect[3],
-                            boot_infos->dispDeviceDepth,
-                            boot_infos->dispDeviceRowBytes, addr, NULL);
-       }
-#endif /* defined(CONFIG_BOOTX_TEXT) && defined(CONFIG_PPC32) */
-
        for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) {
                if (get_property(dp, "linux,opened", NULL) &&
                    get_property(dp, "linux,boot-display", NULL)) {
@@ -318,94 +260,93 @@ int __init offb_init(void)
 
 static void __init offb_init_nodriver(struct device_node *dp)
 {
-       int *pp, i;
        unsigned int len;
-       int width = 640, height = 480, depth = 8, pitch;
-       unsigned int flags, rsize, *up;
-       u64 address = OF_BAD_ADDR;
-       u32 *addrp;
+       int i, width = 640, height = 480, depth = 8, pitch = 640;
+       unsigned int flags, rsize, addr_prop = 0;
+       unsigned long max_size = 0;
+       u64 rstart, address = OF_BAD_ADDR;
+       u32 *pp, *addrp, *up;
        u64 asize;
 
-       if ((pp = (int *) get_property(dp, "depth", &len)) != NULL
-           && len == sizeof(int))
+       pp = (u32 *)get_property(dp, "linux,bootx-depth", &len);
+       if (pp == NULL)
+               pp = (u32 *)get_property(dp, "depth", &len);
+       if (pp && len == sizeof(u32))
                depth = *pp;
-       if ((pp = (int *) get_property(dp, "width", &len)) != NULL
-           && len == sizeof(int))
+
+       pp = (u32 *)get_property(dp, "linux,bootx-width", &len);
+       if (pp == NULL)
+               pp = (u32 *)get_property(dp, "width", &len);
+       if (pp && len == sizeof(u32))
                width = *pp;
-       if ((pp = (int *) get_property(dp, "height", &len)) != NULL
-           && len == sizeof(int))
+
+       pp = (u32 *)get_property(dp, "linux,bootx-height", &len);
+       if (pp == NULL)
+               pp = (u32 *)get_property(dp, "height", &len);
+       if (pp && len == sizeof(u32))
                height = *pp;
-       if ((pp = (int *) get_property(dp, "linebytes", &len)) != NULL
-           && len == sizeof(int)) {
+
+       pp = (u32 *)get_property(dp, "linux,bootx-linebytes", &len);
+       if (pp == NULL)
+               pp = (u32 *)get_property(dp, "linebytes", &len);
+       if (pp && len == sizeof(u32))
                pitch = *pp;
-               if (pitch == 1)
-                       pitch = 0x1000;
-       } else
-               pitch = width;
-
-       rsize = (unsigned long)pitch * (unsigned long)height *
-               (unsigned long)(depth / 8);
-
-       /* Try to match device to a PCI device in order to get a properly
-       * translated address rather then trying to decode the open firmware
-       * stuff in various incorrect ways
-       */
-#ifdef CONFIG_PCI
-       /* First try to locate the PCI device if any */
-       {
-               struct pci_dev *pdev = NULL;
-
-              for_each_pci_dev(pdev) {
-                       if (dp == pci_device_to_OF_node(pdev))
-                               break;
-              }
-               if (pdev) {
-                       for (i = 0; i < 6 && address == OF_BAD_ADDR; i++) {
-                               if ((pci_resource_flags(pdev, i) &
-                                   IORESOURCE_MEM) &&
-                                  (pci_resource_len(pdev, i) >= rsize))
-                                       address = pci_resource_start(pdev, i);
-                       }
-                      pci_dev_put(pdev);
-               }
-        }
-#endif /* CONFIG_PCI */
-
-       /* This one is dodgy, we may drop it ... */
-       if (address == OF_BAD_ADDR &&
-          (up = (unsigned *) get_property(dp, "address", &len)) != NULL &&
-          len == sizeof(unsigned int))
-              address = (u64) * up;
-
-       if (address == OF_BAD_ADDR) {
-              for (i = 0; (addrp = of_get_address(dp, i, &asize, &flags))
-                           != NULL; i++) {
-                      if (!(flags & IORESOURCE_MEM))
-                              continue;
-                      if (asize >= pitch * height * depth / 8)
-                              break;
-              }
-               if (addrp == NULL) {
-                       printk(KERN_ERR
-                              "no framebuffer address found for %s\n",
-                              dp->full_name);
-                       return;
-               }
-               address = of_translate_address(dp, addrp);
-               if (address == OF_BAD_ADDR) {
-                       printk(KERN_ERR
-                              "can't translate framebuffer address for %s\n",
-                              dp->full_name);
-                       return;
+       else
+               pitch = width * ((depth + 7) / 8);
+
+       rsize = (unsigned long)pitch * (unsigned long)height;
+
+       /* Ok, now we try to figure out the address of the framebuffer.
+        *
+        * Unfortunately, Open Firmware doesn't provide a standard way to do
+        * so. All we can do is a dodgy heuristic that happens to work in
+        * practice. On most machines, the "address" property contains what
+        * we need, though not on Matrox cards found in IBM machines. What I've
+        * found that appears to give good results is to go through the PCI
+        * ranges and pick one that is both big enough and if possible encloses
+        * the "address" property. If none match, we pick the biggest
+        */
+       up = (u32 *)get_property(dp, "linux,bootx-addr", &len);
+       if (up == NULL)
+               up = (u32 *)get_property(dp, "address", &len);
+       if (up && len == sizeof(u32))
+               addr_prop = *up;
+
+       for (i = 0; (addrp = of_get_address(dp, i, &asize, &flags))
+                    != NULL; i++) {
+               int match_addrp = 0;
+
+               if (!(flags & IORESOURCE_MEM))
+                       continue;
+               if (asize < rsize)
+                       continue;
+               rstart = of_translate_address(dp, addrp);
+               if (rstart == OF_BAD_ADDR)
+                       continue;
+               if (addr_prop && (rstart <= addr_prop) &&
+                   ((rstart + asize) >= (addr_prop + rsize)))
+                       match_addrp = 1;
+               if (match_addrp) {
+                       address = addr_prop;
+                       break;
                }
+               if (rsize > max_size) {
+                       max_size = rsize;
+                       address = OF_BAD_ADDR;
+               }
 
+               if (address == OF_BAD_ADDR)
+                       address = rstart;
+       }
+       if (address == OF_BAD_ADDR && addr_prop)
+               address = (u64)addr_prop;
+       if (address != OF_BAD_ADDR) {
                /* kludge for valkyrie */
                if (strcmp(dp->name, "valkyrie") == 0)
                        address += 0x1000;
+               offb_init_fb(dp->name, dp->full_name, width, height, depth,
+                            pitch, address, dp);
        }
-       offb_init_fb(dp->name, dp->full_name, width, height, depth,
-                    pitch, address, dp);
-
 }
 
 static void __init offb_init_fb(const char *name, const char *full_name,
@@ -413,7 +354,7 @@ static void __init offb_init_fb(const char *name, const char *full_name,
                                int pitch, unsigned long address,
                                struct device_node *dp)
 {
-       unsigned long res_size = pitch * height * depth / 8;
+       unsigned long res_size = pitch * height * (depth + 7) / 8;
        struct offb_par *par = &default_par;
        unsigned long res_start = address;
        struct fb_fix_screeninfo *fix;
@@ -427,7 +368,7 @@ static void __init offb_init_fb(const char *name, const char *full_name,
        printk(KERN_INFO
               "Using unsupported %dx%d %s at %lx, depth=%d, pitch=%d\n",
               width, height, name, address, depth, pitch);
-       if (depth != 8 && depth != 16 && depth != 32) {
+       if (depth != 8 && depth != 15 && depth != 16 && depth != 32) {
                printk(KERN_ERR "%s: can't use depth = %d\n", full_name,
                       depth);
                release_mem_region(res_start, res_size);
@@ -503,7 +444,6 @@ static void __init offb_init_fb(const char *name, const char *full_name,
                                   : */ FB_VISUAL_TRUECOLOR;
 
        var->xoffset = var->yoffset = 0;
-       var->bits_per_pixel = depth;
        switch (depth) {
        case 8:
                var->bits_per_pixel = 8;
@@ -516,7 +456,7 @@ static void __init offb_init_fb(const char *name, const char *full_name,
                var->transp.offset = 0;
                var->transp.length = 0;
                break;
-       case 16:                /* RGB 555 */
+       case 15:                /* RGB 555 */
                var->bits_per_pixel = 16;
                var->red.offset = 10;
                var->red.length = 5;
@@ -527,6 +467,17 @@ static void __init offb_init_fb(const char *name, const char *full_name,
                var->transp.offset = 0;
                var->transp.length = 0;
                break;
+       case 16:                /* RGB 565 */
+               var->bits_per_pixel = 16;
+               var->red.offset = 11;
+               var->red.length = 5;
+               var->green.offset = 5;
+               var->green.length = 6;
+               var->blue.offset = 0;
+               var->blue.length = 5;
+               var->transp.offset = 0;
+               var->transp.length = 0;
+               break;
        case 32:                /* RGB 888 */
                var->bits_per_pixel = 32;
                var->red.offset = 16;
index 335e3746555983bb4678c325fef450aab47f75ef..450e802e0aa8fb55f30a9d953016ed1209e128dc 100644 (file)
@@ -17,7 +17,6 @@
  *  more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index 4e963930b50ae40ee358e19e999e12dc5b3db368..49a203e1591c748f1233d6afbaa36aaa11efd572 100644 (file)
@@ -27,7 +27,6 @@
  * 
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/kernel.h>
index 52c18a35fb411d0cd5c6f8b9c3d81010195ddc2a..0e0f977b05ee29a466fb7b07054e846750a76cf3 100644 (file)
@@ -52,7 +52,6 @@
  *  Wed Feb 21 14:47:06 CET 2001, v 1.0.0: First working version
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
diff --git a/drivers/video/pnx4008/Makefile b/drivers/video/pnx4008/Makefile
new file mode 100644 (file)
index 0000000..636aacc
--- /dev/null
@@ -0,0 +1,7 @@
+#
+# Makefile for the new PNX4008 framebuffer device driver
+#
+
+obj-$(CONFIG_FB_PNX4008_DUM) += sdum.o
+obj-$(CONFIG_FB_PNX4008_DUM_RGB) += pnxrgbfb.o
+
diff --git a/drivers/video/pnx4008/dum.h b/drivers/video/pnx4008/dum.h
new file mode 100644 (file)
index 0000000..d80a614
--- /dev/null
@@ -0,0 +1,211 @@
+/*
+ * linux/drivers/video/pnx4008/dum.h
+ *
+ * Internal header for SDUM
+ *
+ * 2005 (c) Koninklijke Philips N.V. 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 __PNX008_DUM_H__
+#define __PNX008_DUM_H__
+
+#include <asm/arch/platform.h>
+
+#define PNX4008_DUMCONF_VA_BASE                IO_ADDRESS(PNX4008_DUMCONF_BASE)
+#define PNX4008_DUM_MAIN_VA_BASE       IO_ADDRESS(PNX4008_DUM_MAINCFG_BASE)
+
+/* DUM CFG ADDRESSES */
+#define DUM_CH_BASE_ADR                (PNX4008_DUMCONF_VA_BASE + 0x00)
+#define DUM_CH_MIN_ADR         (PNX4008_DUMCONF_VA_BASE + 0x00)
+#define DUM_CH_MAX_ADR         (PNX4008_DUMCONF_VA_BASE + 0x04)
+#define DUM_CH_CONF_ADR                (PNX4008_DUMCONF_VA_BASE + 0x08)
+#define DUM_CH_STAT_ADR                (PNX4008_DUMCONF_VA_BASE + 0x0C)
+#define DUM_CH_CTRL_ADR                (PNX4008_DUMCONF_VA_BASE + 0x10)
+
+#define CH_MARG                (0x100 / sizeof(u32))
+#define DUM_CH_MIN(i)  (*((volatile u32 *)DUM_CH_MIN_ADR + (i) * CH_MARG))
+#define DUM_CH_MAX(i)  (*((volatile u32 *)DUM_CH_MAX_ADR + (i) * CH_MARG))
+#define DUM_CH_CONF(i) (*((volatile u32 *)DUM_CH_CONF_ADR + (i) * CH_MARG))
+#define DUM_CH_STAT(i) (*((volatile u32 *)DUM_CH_STAT_ADR + (i) * CH_MARG))
+#define DUM_CH_CTRL(i) (*((volatile u32 *)DUM_CH_CTRL_ADR + (i) * CH_MARG))
+
+#define DUM_CONF_ADR          (PNX4008_DUM_MAIN_VA_BASE + 0x00)
+#define DUM_CTRL_ADR          (PNX4008_DUM_MAIN_VA_BASE + 0x04)
+#define DUM_STAT_ADR          (PNX4008_DUM_MAIN_VA_BASE + 0x08)
+#define DUM_DECODE_ADR        (PNX4008_DUM_MAIN_VA_BASE + 0x0C)
+#define DUM_COM_BASE_ADR      (PNX4008_DUM_MAIN_VA_BASE + 0x10)
+#define DUM_SYNC_C_ADR        (PNX4008_DUM_MAIN_VA_BASE + 0x14)
+#define DUM_CLK_DIV_ADR       (PNX4008_DUM_MAIN_VA_BASE + 0x18)
+#define DUM_DIRTY_LOW_ADR     (PNX4008_DUM_MAIN_VA_BASE + 0x20)
+#define DUM_DIRTY_HIGH_ADR    (PNX4008_DUM_MAIN_VA_BASE + 0x24)
+#define DUM_FORMAT_ADR        (PNX4008_DUM_MAIN_VA_BASE + 0x28)
+#define DUM_WTCFG1_ADR        (PNX4008_DUM_MAIN_VA_BASE + 0x30)
+#define DUM_RTCFG1_ADR        (PNX4008_DUM_MAIN_VA_BASE + 0x34)
+#define DUM_WTCFG2_ADR        (PNX4008_DUM_MAIN_VA_BASE + 0x38)
+#define DUM_RTCFG2_ADR        (PNX4008_DUM_MAIN_VA_BASE + 0x3C)
+#define DUM_TCFG_ADR          (PNX4008_DUM_MAIN_VA_BASE + 0x40)
+#define DUM_OUTP_FORMAT1_ADR  (PNX4008_DUM_MAIN_VA_BASE + 0x44)
+#define DUM_OUTP_FORMAT2_ADR  (PNX4008_DUM_MAIN_VA_BASE + 0x48)
+#define DUM_SYNC_MODE_ADR     (PNX4008_DUM_MAIN_VA_BASE + 0x4C)
+#define DUM_SYNC_OUT_C_ADR    (PNX4008_DUM_MAIN_VA_BASE + 0x50)
+
+#define DUM_CONF              (*(volatile u32 *)(DUM_CONF_ADR))
+#define DUM_CTRL              (*(volatile u32 *)(DUM_CTRL_ADR))
+#define DUM_STAT              (*(volatile u32 *)(DUM_STAT_ADR))
+#define DUM_DECODE            (*(volatile u32 *)(DUM_DECODE_ADR))
+#define DUM_COM_BASE          (*(volatile u32 *)(DUM_COM_BASE_ADR))
+#define DUM_SYNC_C            (*(volatile u32 *)(DUM_SYNC_C_ADR))
+#define DUM_CLK_DIV           (*(volatile u32 *)(DUM_CLK_DIV_ADR))
+#define DUM_DIRTY_LOW         (*(volatile u32 *)(DUM_DIRTY_LOW_ADR))
+#define DUM_DIRTY_HIGH        (*(volatile u32 *)(DUM_DIRTY_HIGH_ADR))
+#define DUM_FORMAT            (*(volatile u32 *)(DUM_FORMAT_ADR))
+#define DUM_WTCFG1            (*(volatile u32 *)(DUM_WTCFG1_ADR))
+#define DUM_RTCFG1            (*(volatile u32 *)(DUM_RTCFG1_ADR))
+#define DUM_WTCFG2            (*(volatile u32 *)(DUM_WTCFG2_ADR))
+#define DUM_RTCFG2            (*(volatile u32 *)(DUM_RTCFG2_ADR))
+#define DUM_TCFG              (*(volatile u32 *)(DUM_TCFG_ADR))
+#define DUM_OUTP_FORMAT1      (*(volatile u32 *)(DUM_OUTP_FORMAT1_ADR))
+#define DUM_OUTP_FORMAT2      (*(volatile u32 *)(DUM_OUTP_FORMAT2_ADR))
+#define DUM_SYNC_MODE         (*(volatile u32 *)(DUM_SYNC_MODE_ADR))
+#define DUM_SYNC_OUT_C        (*(volatile u32 *)(DUM_SYNC_OUT_C_ADR))
+
+/* DUM SLAVE ADDRESSES */
+#define DUM_SLAVE_WRITE_ADR      (PNX4008_DUM_MAINCFG_BASE + 0x0000000)
+#define DUM_SLAVE_READ1_I_ADR    (PNX4008_DUM_MAINCFG_BASE + 0x1000000)
+#define DUM_SLAVE_READ1_R_ADR    (PNX4008_DUM_MAINCFG_BASE + 0x1000004)
+#define DUM_SLAVE_READ2_I_ADR    (PNX4008_DUM_MAINCFG_BASE + 0x1000008)
+#define DUM_SLAVE_READ2_R_ADR    (PNX4008_DUM_MAINCFG_BASE + 0x100000C)
+
+#define DUM_SLAVE_WRITE_W  ((volatile u32 *)(DUM_SLAVE_WRITE_ADR))
+#define DUM_SLAVE_WRITE_HW ((volatile u16 *)(DUM_SLAVE_WRITE_ADR))
+#define DUM_SLAVE_READ1_I  ((volatile u8 *)(DUM_SLAVE_READ1_I_ADR))
+#define DUM_SLAVE_READ1_R  ((volatile u16 *)(DUM_SLAVE_READ1_R_ADR))
+#define DUM_SLAVE_READ2_I  ((volatile u8 *)(DUM_SLAVE_READ2_I_ADR))
+#define DUM_SLAVE_READ2_R  ((volatile u16 *)(DUM_SLAVE_READ2_R_ADR))
+
+/* Sony display register addresses */
+#define DISP_0_REG            (0x00)
+#define DISP_1_REG            (0x01)
+#define DISP_CAL_REG          (0x20)
+#define DISP_ID_REG           (0x2A)
+#define DISP_XMIN_L_REG       (0x30)
+#define DISP_XMIN_H_REG       (0x31)
+#define DISP_YMIN_REG         (0x32)
+#define DISP_XMAX_L_REG       (0x34)
+#define DISP_XMAX_H_REG       (0x35)
+#define DISP_YMAX_REG         (0x36)
+#define DISP_SYNC_EN_REG      (0x38)
+#define DISP_SYNC_RISE_L_REG  (0x3C)
+#define DISP_SYNC_RISE_H_REG  (0x3D)
+#define DISP_SYNC_FALL_L_REG  (0x3E)
+#define DISP_SYNC_FALL_H_REG  (0x3F)
+#define DISP_PIXEL_REG        (0x0B)
+#define DISP_DUMMY1_REG       (0x28)
+#define DISP_DUMMY2_REG       (0x29)
+#define DISP_TIMING_REG       (0x98)
+#define DISP_DUMP_REG         (0x99)
+
+/* Sony display constants */
+#define SONY_ID1              (0x22)
+#define SONY_ID2              (0x23)
+
+/* Philips display register addresses */
+#define PH_DISP_ORIENT_REG    (0x003)
+#define PH_DISP_YPOINT_REG    (0x200)
+#define PH_DISP_XPOINT_REG    (0x201)
+#define PH_DISP_PIXEL_REG     (0x202)
+#define PH_DISP_YMIN_REG      (0x406)
+#define PH_DISP_YMAX_REG      (0x407)
+#define PH_DISP_XMIN_REG      (0x408)
+#define PH_DISP_XMAX_REG      (0x409)
+
+/* Misc constants */
+#define NO_VALID_DISPLAY_FOUND      (0)
+#define DISPLAY2_IS_NOT_CONNECTED   (0)
+
+/* register values */
+#define V_BAC_ENABLE           (BIT(0))
+#define V_BAC_DISABLE_IDLE     (BIT(1))
+#define V_BAC_DISABLE_TRIG     (BIT(2))
+#define V_DUM_RESET            (BIT(3))
+#define V_MUX_RESET            (BIT(4))
+#define BAC_ENABLED            (BIT(0))
+#define BAC_DISABLED           0
+
+/* Sony LCD commands */
+#define V_LCD_STANDBY_OFF      ((BIT(25)) | (0 << 16) | DISP_0_REG)
+#define V_LCD_USE_9BIT_BUS     ((BIT(25)) | (2 << 16) | DISP_1_REG)
+#define V_LCD_SYNC_RISE_L      ((BIT(25)) | (0 << 16) | DISP_SYNC_RISE_L_REG)
+#define V_LCD_SYNC_RISE_H      ((BIT(25)) | (0 << 16) | DISP_SYNC_RISE_H_REG)
+#define V_LCD_SYNC_FALL_L      ((BIT(25)) | (160 << 16) | DISP_SYNC_FALL_L_REG)
+#define V_LCD_SYNC_FALL_H      ((BIT(25)) | (0 << 16) | DISP_SYNC_FALL_H_REG)
+#define V_LCD_SYNC_ENABLE      ((BIT(25)) | (128 << 16) | DISP_SYNC_EN_REG)
+#define V_LCD_DISPLAY_ON       ((BIT(25)) | (64 << 16) | DISP_0_REG)
+
+enum {
+       PAD_NONE,
+       PAD_512,
+       PAD_1024
+};
+
+enum {
+       RGB888,
+       RGB666,
+       RGB565,
+       BGR565,
+       ARGB1555,
+       ABGR1555,
+       ARGB4444,
+       ABGR4444
+};
+
+struct dum_setup {
+       int sync_neg_edge;
+       int round_robin;
+       int mux_int;
+       int synced_dirty_flag_int;
+       int dirty_flag_int;
+       int error_int;
+       int pf_empty_int;
+       int sf_empty_int;
+       int bac_dis_int;
+       u32 dirty_base_adr;
+       u32 command_base_adr;
+       u32 sync_clk_div;
+       int sync_output;
+       u32 sync_restart_val;
+       u32 set_sync_high;
+       u32 set_sync_low;
+};
+
+struct dum_ch_setup {
+       int disp_no;
+       u32 xmin;
+       u32 ymin;
+       u32 xmax;
+       u32 ymax;
+       int xmirror;
+       int ymirror;
+       int rotate;
+       u32 minadr;
+       u32 maxadr;
+       u32 dirtybuffer;
+       int pad;
+       int format;
+       int hwdirty;
+       int slave_trans;
+};
+
+struct disp_window {
+       u32 xmin_l;
+       u32 xmin_h;
+       u32 ymin;
+       u32 xmax_l;
+       u32 xmax_h;
+       u32 ymax;
+};
+
+#endif                         /* #ifndef __PNX008_DUM_H__ */
diff --git a/drivers/video/pnx4008/fbcommon.h b/drivers/video/pnx4008/fbcommon.h
new file mode 100644 (file)
index 0000000..4ebc87d
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2005 Philips Semiconductors
+ *
+ * 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, 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; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA, or http://www.gnu.org/licenses/gpl.html
+*/
+
+#define QCIF_W  (176)
+#define QCIF_H  (144)
+
+#define CIF_W   (352)
+#define CIF_H   (288)
+
+#define LCD_X_RES      208
+#define LCD_Y_RES      320
+#define LCD_X_PAD      256
+#define LCD_BBP                4       /* Bytes Per Pixel */
+
+#define DISP_MAX_X_SIZE     (320)
+#define DISP_MAX_Y_SIZE     (208)
+
+#define RETURNVAL_BASE (0x400)
+
+enum fb_ioctl_returntype {
+       ENORESOURCESLEFT = RETURNVAL_BASE,
+       ERESOURCESNOTFREED,
+       EPROCNOTOWNER,
+       EFBNOTOWNER,
+       ECOPYFAILED,
+       EIOREMAPFAILED,
+};
diff --git a/drivers/video/pnx4008/pnxrgbfb.c b/drivers/video/pnx4008/pnxrgbfb.c
new file mode 100644 (file)
index 0000000..7d9453c
--- /dev/null
@@ -0,0 +1,213 @@
+/*
+ * drivers/video/pnx4008/pnxrgbfb.c
+ *
+ * PNX4008's framebuffer support
+ *
+ * Author: Grigory Tolstolytkin <gtolstolytkin@ru.mvista.com>
+ * Based on Philips Semiconductors's code
+ *
+ * Copyrght (c) 2005 MontaVista Software, Inc.
+ * Copyright (c) 2005 Philips Semiconductors
+ * 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/errno.h>
+#include <linux/string.h>
+#include <linux/mm.h>
+#include <linux/slab.h>
+#include <linux/vmalloc.h>
+#include <linux/delay.h>
+#include <linux/interrupt.h>
+#include <linux/fb.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+
+#include <asm/uaccess.h>
+#include "sdum.h"
+#include "fbcommon.h"
+
+static u32 colreg[16];
+
+static struct fb_var_screeninfo rgbfb_var __initdata = {
+       .xres = LCD_X_RES,
+       .yres = LCD_Y_RES,
+       .xres_virtual = LCD_X_RES,
+       .yres_virtual = LCD_Y_RES,
+       .bits_per_pixel = 32,
+       .red.offset = 16,
+       .red.length = 8,
+       .green.offset = 8,
+       .green.length = 8,
+       .blue.offset = 0,
+       .blue.length = 8,
+       .left_margin = 0,
+       .right_margin = 0,
+       .upper_margin = 0,
+       .lower_margin = 0,
+       .vmode = FB_VMODE_NONINTERLACED,
+};
+static struct fb_fix_screeninfo rgbfb_fix __initdata = {
+       .id = "RGBFB",
+       .line_length = LCD_X_RES * LCD_BBP,
+       .type = FB_TYPE_PACKED_PIXELS,
+       .visual = FB_VISUAL_TRUECOLOR,
+       .xpanstep = 0,
+       .ypanstep = 0,
+       .ywrapstep = 0,
+       .accel = FB_ACCEL_NONE,
+};
+
+static int channel_owned;
+
+static int no_cursor(struct fb_info *info, struct fb_cursor *cursor)
+{
+       return 0;
+}
+
+static int rgbfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
+                          u_int transp, struct fb_info *info)
+{
+       if (regno > 15)
+               return 1;
+
+       colreg[regno] = ((red & 0xff00) << 8) | (green & 0xff00) |
+           ((blue & 0xff00) >> 8);
+       return 0;
+}
+
+static int rgbfb_mmap(struct fb_info *info, struct vm_area_struct *vma)
+{
+       return pnx4008_sdum_mmap(info, vma, NULL);
+}
+
+static struct fb_ops rgbfb_ops = {
+       .fb_mmap = rgbfb_mmap,
+       .fb_setcolreg = rgbfb_setcolreg,
+       .fb_fillrect = cfb_fillrect,
+       .fb_copyarea = cfb_copyarea,
+       .fb_imageblit = cfb_imageblit,
+};
+
+static int rgbfb_remove(struct platform_device *pdev)
+{
+       struct fb_info *info = platform_get_drvdata(pdev);
+
+       if (info) {
+               unregister_framebuffer(info);
+               fb_dealloc_cmap(&info->cmap);
+               framebuffer_release(info);
+               platform_set_drvdata(pdev, NULL);
+               kfree(info);
+       }
+
+       pnx4008_free_dum_channel(channel_owned, pdev->id);
+       pnx4008_set_dum_exit_notification(pdev->id);
+
+       return 0;
+}
+
+static int __devinit rgbfb_probe(struct platform_device *pdev)
+{
+       struct fb_info *info;
+       struct dumchannel_uf chan_uf;
+       int ret;
+       char *option;
+
+       info = framebuffer_alloc(sizeof(u32) * 16, &pdev->dev);
+       if (!info) {
+               ret = -ENOMEM;
+               goto err;
+       }
+
+       pnx4008_get_fb_addresses(FB_TYPE_RGB, (void **)&info->screen_base,
+                                (dma_addr_t *) &rgbfb_fix.smem_start,
+                                &rgbfb_fix.smem_len);
+
+       if ((ret = pnx4008_alloc_dum_channel(pdev->id)) < 0)
+               goto err0;
+       else {
+               channel_owned = ret;
+               chan_uf.channelnr = channel_owned;
+               chan_uf.dirty = (u32 *) NULL;
+               chan_uf.source = (u32 *) rgbfb_fix.smem_start;
+               chan_uf.x_offset = 0;
+               chan_uf.y_offset = 0;
+               chan_uf.width = LCD_X_RES;
+               chan_uf.height = LCD_Y_RES;
+
+               if ((ret = pnx4008_put_dum_channel_uf(chan_uf, pdev->id))< 0)
+                       goto err1;
+
+               if ((ret =
+                    pnx4008_set_dum_channel_sync(channel_owned, CONF_SYNC_ON,
+                                                 pdev->id)) < 0)
+                       goto err1;
+
+               if ((ret =
+                    pnx4008_set_dum_channel_dirty_detect(channel_owned,
+                                                        CONF_DIRTYDETECTION_ON,
+                                                        pdev->id)) < 0)
+                       goto err1;
+       }
+
+       if (!fb_get_options("pnxrgbfb", &option) && !strcmp(option, "nocursor"))
+               rgbfb_ops.fb_cursor = no_cursor;
+
+       info->node = -1;
+       info->flags = FBINFO_FLAG_DEFAULT;
+       info->fbops = &rgbfb_ops;
+       info->fix = rgbfb_fix;
+       info->var = rgbfb_var;
+       info->screen_size = rgbfb_fix.smem_len;
+       info->pseudo_palette = info->par;
+       info->par = NULL;
+
+       ret = fb_alloc_cmap(&info->cmap, 256, 0);
+       if (ret < 0)
+               goto err2;
+
+       ret = register_framebuffer(info);
+       if (ret < 0)
+               goto err3;
+       platform_set_drvdata(pdev, info);
+
+       return 0;
+
+err3:
+       fb_dealloc_cmap(&info->cmap);
+err2:
+       framebuffer_release(info);
+err1:
+       pnx4008_free_dum_channel(channel_owned, pdev->id);
+err0:
+       kfree(info);
+err:
+       return ret;
+}
+
+static struct platform_driver rgbfb_driver = {
+       .driver = {
+               .name = "rgbfb",
+       },
+       .probe = rgbfb_probe,
+       .remove = rgbfb_remove,
+};
+
+static int __init rgbfb_init(void)
+{
+       return platform_driver_register(&rgbfb_driver);
+}
+
+static void __exit rgbfb_exit(void)
+{
+       platform_driver_unregister(&rgbfb_driver);
+}
+
+module_init(rgbfb_init);
+module_exit(rgbfb_exit);
+
+MODULE_LICENSE("GPL");
diff --git a/drivers/video/pnx4008/sdum.c b/drivers/video/pnx4008/sdum.c
new file mode 100644 (file)
index 0000000..51f0ecc
--- /dev/null
@@ -0,0 +1,872 @@
+/*
+ * drivers/video/pnx4008/sdum.c
+ *
+ * Display Update Master support
+ *
+ * Authors: Grigory Tolstolytkin <gtolstolytkin@ru.mvista.com>
+ *          Vitaly Wool <vitalywool@gmail.com>
+ * Based on Philips Semiconductors's code
+ *
+ * Copyrght (c) 2005-2006 MontaVista Software, Inc.
+ * Copyright (c) 2005 Philips Semiconductors
+ * 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/errno.h>
+#include <linux/string.h>
+#include <linux/mm.h>
+#include <linux/tty.h>
+#include <linux/slab.h>
+#include <linux/vmalloc.h>
+#include <linux/delay.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+#include <linux/fb.h>
+#include <linux/init.h>
+#include <linux/dma-mapping.h>
+#include <linux/clk.h>
+#include <asm/uaccess.h>
+#include <asm/arch/gpio.h>
+
+#include "sdum.h"
+#include "fbcommon.h"
+#include "dum.h"
+
+/* Framebuffers we have */
+
+static struct pnx4008_fb_addr {
+       int fb_type;
+       long addr_offset;
+       long fb_length;
+} fb_addr[] = {
+       [0] = {
+               FB_TYPE_YUV, 0, 0xB0000
+       },
+       [1] = {
+               FB_TYPE_RGB, 0xB0000, 0x50000
+       },
+};
+
+static struct dum_data {
+       u32 lcd_phys_start;
+       u32 lcd_virt_start;
+       u32 slave_phys_base;
+       u32 *slave_virt_base;
+       int fb_owning_channel[MAX_DUM_CHANNELS];
+       struct dumchannel_uf chan_uf_store[MAX_DUM_CHANNELS];
+} dum_data;
+
+/* Different local helper functions */
+
+static u32 nof_pixels_dx(struct dum_ch_setup *ch_setup)
+{
+       return (ch_setup->xmax - ch_setup->xmin + 1);
+}
+
+static u32 nof_pixels_dy(struct dum_ch_setup *ch_setup)
+{
+       return (ch_setup->ymax - ch_setup->ymin + 1);
+}
+
+static u32 nof_pixels_dxy(struct dum_ch_setup *ch_setup)
+{
+       return (nof_pixels_dx(ch_setup) * nof_pixels_dy(ch_setup));
+}
+
+static u32 nof_bytes(struct dum_ch_setup *ch_setup)
+{
+       u32 r = nof_pixels_dxy(ch_setup);
+       switch (ch_setup->format) {
+       case RGB888:
+       case RGB666:
+               r *= 4;
+               break;
+
+       default:
+               r *= 2;
+               break;
+       }
+       return r;
+}
+
+static u32 build_command(int disp_no, u32 reg, u32 val)
+{
+       return ((disp_no << 26) | BIT(25) | (val << 16) | (disp_no << 10) |
+               (reg << 0));
+}
+
+static u32 build_double_index(int disp_no, u32 val)
+{
+       return ((disp_no << 26) | (val << 16) | (disp_no << 10) | (val << 0));
+}
+
+static void build_disp_window(struct dum_ch_setup * ch_setup, struct disp_window * dw)
+{
+       dw->ymin = ch_setup->ymin;
+       dw->ymax = ch_setup->ymax;
+       dw->xmin_l = ch_setup->xmin & 0xFF;
+       dw->xmin_h = (ch_setup->xmin & BIT(8)) >> 8;
+       dw->xmax_l = ch_setup->xmax & 0xFF;
+       dw->xmax_h = (ch_setup->xmax & BIT(8)) >> 8;
+}
+
+static int put_channel(struct dumchannel chan)
+{
+       int i = chan.channelnr;
+
+       if (i < 0 || i > MAX_DUM_CHANNELS)
+               return -EINVAL;
+       else {
+               DUM_CH_MIN(i) = chan.dum_ch_min;
+               DUM_CH_MAX(i) = chan.dum_ch_max;
+               DUM_CH_CONF(i) = chan.dum_ch_conf;
+               DUM_CH_CTRL(i) = chan.dum_ch_ctrl;
+       }
+
+       return 0;
+}
+
+static void clear_channel(int channr)
+{
+       struct dumchannel chan;
+
+       chan.channelnr = channr;
+       chan.dum_ch_min = 0;
+       chan.dum_ch_max = 0;
+       chan.dum_ch_conf = 0;
+       chan.dum_ch_ctrl = 0;
+
+       put_channel(chan);
+}
+
+static int put_cmd_string(struct cmdstring cmds)
+{
+       u16 *cmd_str_virtaddr;
+       u32 *cmd_ptr0_virtaddr;
+       u32 cmd_str_physaddr;
+
+       int i = cmds.channelnr;
+
+       if (i < 0 || i > MAX_DUM_CHANNELS)
+               return -EINVAL;
+       else if ((cmd_ptr0_virtaddr =
+                 (int *)ioremap_nocache(DUM_COM_BASE,
+                                        sizeof(int) * MAX_DUM_CHANNELS)) ==
+                NULL)
+               return -EIOREMAPFAILED;
+       else {
+               cmd_str_physaddr = ioread32(&cmd_ptr0_virtaddr[cmds.channelnr]);
+               if ((cmd_str_virtaddr =
+                    (u16 *) ioremap_nocache(cmd_str_physaddr,
+                                            sizeof(cmds))) == NULL) {
+                       iounmap(cmd_ptr0_virtaddr);
+                       return -EIOREMAPFAILED;
+               } else {
+                       int t;
+                       for (t = 0; t < 8; t++)
+                               iowrite16(*((u16 *)&cmds.prestringlen + t),
+                                         cmd_str_virtaddr + t);
+
+                       for (t = 0; t < cmds.prestringlen / 2; t++)
+                                iowrite16(*((u16 *)&cmds.precmd + t),
+                                          cmd_str_virtaddr + t + 8);
+
+                       for (t = 0; t < cmds.poststringlen / 2; t++)
+                               iowrite16(*((u16 *)&cmds.postcmd + t),
+                                         cmd_str_virtaddr + t + 8 +
+                                               cmds.prestringlen / 2);
+
+                       iounmap(cmd_ptr0_virtaddr);
+                       iounmap(cmd_str_virtaddr);
+               }
+       }
+
+       return 0;
+}
+
+static u32 dum_ch_setup(int ch_no, struct dum_ch_setup * ch_setup)
+{
+       struct cmdstring cmds_c;
+       struct cmdstring *cmds = &cmds_c;
+       struct disp_window dw;
+       int standard;
+       u32 orientation = 0;
+       struct dumchannel chan = { 0 };
+       int ret;
+
+       if ((ch_setup->xmirror) || (ch_setup->ymirror) || (ch_setup->rotate)) {
+               standard = 0;
+
+               orientation = BIT(1);   /* always set 9-bit-bus */
+               if (ch_setup->xmirror)
+                       orientation |= BIT(4);
+               if (ch_setup->ymirror)
+                       orientation |= BIT(3);
+               if (ch_setup->rotate)
+                       orientation |= BIT(0);
+       } else
+               standard = 1;
+
+       cmds->channelnr = ch_no;
+
+       /* build command string header */
+       if (standard) {
+               cmds->prestringlen = 32;
+               cmds->poststringlen = 0;
+       } else {
+               cmds->prestringlen = 48;
+               cmds->poststringlen = 16;
+       }
+
+       cmds->format =
+           (u16) ((ch_setup->disp_no << 4) | (BIT(3)) | (ch_setup->format));
+       cmds->reserved = 0x0;
+       cmds->startaddr_low = (ch_setup->minadr & 0xFFFF);
+       cmds->startaddr_high = (ch_setup->minadr >> 16);
+
+       if ((ch_setup->minadr == 0) && (ch_setup->maxadr == 0)
+           && (ch_setup->xmin == 0)
+           && (ch_setup->ymin == 0) && (ch_setup->xmax == 0)
+           && (ch_setup->ymax == 0)) {
+               cmds->pixdatlen_low = 0;
+               cmds->pixdatlen_high = 0;
+       } else {
+               u32 nbytes = nof_bytes(ch_setup);
+               cmds->pixdatlen_low = (nbytes & 0xFFFF);
+               cmds->pixdatlen_high = (nbytes >> 16);
+       }
+
+       if (ch_setup->slave_trans)
+               cmds->pixdatlen_high |= BIT(15);
+
+       /* build pre-string */
+       build_disp_window(ch_setup, &dw);
+
+       if (standard) {
+               cmds->precmd[0] =
+                   build_command(ch_setup->disp_no, DISP_XMIN_L_REG, 0x99);
+               cmds->precmd[1] =
+                   build_command(ch_setup->disp_no, DISP_XMIN_L_REG,
+                                 dw.xmin_l);
+               cmds->precmd[2] =
+                   build_command(ch_setup->disp_no, DISP_XMIN_H_REG,
+                                 dw.xmin_h);
+               cmds->precmd[3] =
+                   build_command(ch_setup->disp_no, DISP_YMIN_REG, dw.ymin);
+               cmds->precmd[4] =
+                   build_command(ch_setup->disp_no, DISP_XMAX_L_REG,
+                                 dw.xmax_l);
+               cmds->precmd[5] =
+                   build_command(ch_setup->disp_no, DISP_XMAX_H_REG,
+                                 dw.xmax_h);
+               cmds->precmd[6] =
+                   build_command(ch_setup->disp_no, DISP_YMAX_REG, dw.ymax);
+               cmds->precmd[7] =
+                   build_double_index(ch_setup->disp_no, DISP_PIXEL_REG);
+       } else {
+               if (dw.xmin_l == ch_no)
+                       cmds->precmd[0] =
+                           build_command(ch_setup->disp_no, DISP_XMIN_L_REG,
+                                         0x99);
+               else
+                       cmds->precmd[0] =
+                           build_command(ch_setup->disp_no, DISP_XMIN_L_REG,
+                                         ch_no);
+
+               cmds->precmd[1] =
+                   build_command(ch_setup->disp_no, DISP_XMIN_L_REG,
+                                 dw.xmin_l);
+               cmds->precmd[2] =
+                   build_command(ch_setup->disp_no, DISP_XMIN_H_REG,
+                                 dw.xmin_h);
+               cmds->precmd[3] =
+                   build_command(ch_setup->disp_no, DISP_YMIN_REG, dw.ymin);
+               cmds->precmd[4] =
+                   build_command(ch_setup->disp_no, DISP_XMAX_L_REG,
+                                 dw.xmax_l);
+               cmds->precmd[5] =
+                   build_command(ch_setup->disp_no, DISP_XMAX_H_REG,
+                                 dw.xmax_h);
+               cmds->precmd[6] =
+                   build_command(ch_setup->disp_no, DISP_YMAX_REG, dw.ymax);
+               cmds->precmd[7] =
+                   build_command(ch_setup->disp_no, DISP_1_REG, orientation);
+               cmds->precmd[8] =
+                   build_double_index(ch_setup->disp_no, DISP_PIXEL_REG);
+               cmds->precmd[9] =
+                   build_double_index(ch_setup->disp_no, DISP_PIXEL_REG);
+               cmds->precmd[0xA] =
+                   build_double_index(ch_setup->disp_no, DISP_PIXEL_REG);
+               cmds->precmd[0xB] =
+                   build_double_index(ch_setup->disp_no, DISP_PIXEL_REG);
+               cmds->postcmd[0] =
+                   build_command(ch_setup->disp_no, DISP_1_REG, BIT(1));
+               cmds->postcmd[1] =
+                   build_command(ch_setup->disp_no, DISP_DUMMY1_REG, 1);
+               cmds->postcmd[2] =
+                   build_command(ch_setup->disp_no, DISP_DUMMY1_REG, 2);
+               cmds->postcmd[3] =
+                   build_command(ch_setup->disp_no, DISP_DUMMY1_REG, 3);
+       }
+
+       if ((ret = put_cmd_string(cmds_c)) != 0) {
+               return ret;
+       }
+
+       chan.channelnr = cmds->channelnr;
+       chan.dum_ch_min = ch_setup->dirtybuffer + ch_setup->minadr;
+       chan.dum_ch_max = ch_setup->dirtybuffer + ch_setup->maxadr;
+       chan.dum_ch_conf = 0x002;
+       chan.dum_ch_ctrl = 0x04;
+
+       put_channel(chan);
+
+       return 0;
+}
+
+static u32 display_open(int ch_no, int auto_update, u32 * dirty_buffer,
+                       u32 * frame_buffer, u32 xpos, u32 ypos, u32 w, u32 h)
+{
+
+       struct dum_ch_setup k;
+       int ret;
+
+       /* keep width & height within display area */
+       if ((xpos + w) > DISP_MAX_X_SIZE)
+               w = DISP_MAX_X_SIZE - xpos;
+
+       if ((ypos + h) > DISP_MAX_Y_SIZE)
+               h = DISP_MAX_Y_SIZE - ypos;
+
+       /* assume 1 display only */
+       k.disp_no = 0;
+       k.xmin = xpos;
+       k.ymin = ypos;
+       k.xmax = xpos + (w - 1);
+       k.ymax = ypos + (h - 1);
+
+       /* adjust min and max values if necessary */
+       if (k.xmin > DISP_MAX_X_SIZE - 1)
+               k.xmin = DISP_MAX_X_SIZE - 1;
+       if (k.ymin > DISP_MAX_Y_SIZE - 1)
+               k.ymin = DISP_MAX_Y_SIZE - 1;
+
+       if (k.xmax > DISP_MAX_X_SIZE - 1)
+               k.xmax = DISP_MAX_X_SIZE - 1;
+       if (k.ymax > DISP_MAX_Y_SIZE - 1)
+               k.ymax = DISP_MAX_Y_SIZE - 1;
+
+       k.xmirror = 0;
+       k.ymirror = 0;
+       k.rotate = 0;
+       k.minadr = (u32) frame_buffer;
+       k.maxadr = (u32) frame_buffer + (((w - 1) << 10) | ((h << 2) - 2));
+       k.pad = PAD_1024;
+       k.dirtybuffer = (u32) dirty_buffer;
+       k.format = RGB888;
+       k.hwdirty = 0;
+       k.slave_trans = 0;
+
+       ret = dum_ch_setup(ch_no, &k);
+
+       return ret;
+}
+
+static void lcd_reset(void)
+{
+       u32 *dum_pio_base = (u32 *)IO_ADDRESS(PNX4008_PIO_BASE);
+
+       udelay(1);
+       iowrite32(BIT(19), &dum_pio_base[2]);
+       udelay(1);
+       iowrite32(BIT(19), &dum_pio_base[1]);
+       udelay(1);
+}
+
+static int dum_init(struct platform_device *pdev)
+{
+       struct clk *clk;
+
+       /* enable DUM clock */
+       clk = clk_get(&pdev->dev, "dum_ck");
+       if (IS_ERR(clk)) {
+               printk(KERN_ERR "pnx4008_dum: Unable to access DUM clock\n");
+               return PTR_ERR(clk);
+       }
+
+       clk_set_rate(clk, 1);
+       clk_put(clk);
+
+       DUM_CTRL = V_DUM_RESET;
+
+       /* set priority to "round-robin". All other params to "false" */
+       DUM_CONF = BIT(9);
+
+       /* Display 1 */
+       DUM_WTCFG1 = PNX4008_DUM_WT_CFG;
+       DUM_RTCFG1 = PNX4008_DUM_RT_CFG;
+       DUM_TCFG = PNX4008_DUM_T_CFG;
+
+       return 0;
+}
+
+static void dum_chan_init(void)
+{
+       int i = 0, ch = 0;
+       u32 *cmdptrs;
+       u32 *cmdstrings;
+
+       DUM_COM_BASE =
+               CMDSTRING_BASEADDR + BYTES_PER_CMDSTRING * NR_OF_CMDSTRINGS;
+
+       if ((cmdptrs =
+            (u32 *) ioremap_nocache(DUM_COM_BASE,
+                                    sizeof(u32) * NR_OF_CMDSTRINGS)) == NULL)
+               return;
+
+       for (ch = 0; ch < NR_OF_CMDSTRINGS; ch++)
+               iowrite32(CMDSTRING_BASEADDR + BYTES_PER_CMDSTRING * ch,
+                         cmdptrs + ch);
+
+       for (ch = 0; ch < MAX_DUM_CHANNELS; ch++)
+               clear_channel(ch);
+
+       /* Clear the cmdstrings */
+       cmdstrings =
+           (u32 *)ioremap_nocache(*cmdptrs,
+                                  BYTES_PER_CMDSTRING * NR_OF_CMDSTRINGS);
+
+       if (!cmdstrings)
+               goto out;
+
+       for (i = 0; i < NR_OF_CMDSTRINGS * BYTES_PER_CMDSTRING / sizeof(u32);
+            i++)
+               iowrite32(0, cmdstrings + i);
+
+       iounmap((u32 *)cmdstrings);
+
+out:
+       iounmap((u32 *)cmdptrs);
+}
+
+static void lcd_init(void)
+{
+       lcd_reset();
+
+       DUM_OUTP_FORMAT1 = 0; /* RGB666 */
+
+       udelay(1);
+       iowrite32(V_LCD_STANDBY_OFF, dum_data.slave_virt_base);
+       udelay(1);
+       iowrite32(V_LCD_USE_9BIT_BUS, dum_data.slave_virt_base);
+       udelay(1);
+       iowrite32(V_LCD_SYNC_RISE_L, dum_data.slave_virt_base);
+       udelay(1);
+       iowrite32(V_LCD_SYNC_RISE_H, dum_data.slave_virt_base);
+       udelay(1);
+       iowrite32(V_LCD_SYNC_FALL_L, dum_data.slave_virt_base);
+       udelay(1);
+       iowrite32(V_LCD_SYNC_FALL_H, dum_data.slave_virt_base);
+       udelay(1);
+       iowrite32(V_LCD_SYNC_ENABLE, dum_data.slave_virt_base);
+       udelay(1);
+       iowrite32(V_LCD_DISPLAY_ON, dum_data.slave_virt_base);
+       udelay(1);
+}
+
+/* Interface exported to framebuffer drivers */
+
+int pnx4008_get_fb_addresses(int fb_type, void **virt_addr,
+                            dma_addr_t *phys_addr, int *fb_length)
+{
+       int i;
+       int ret = -1;
+       for (i = 0; i < ARRAY_SIZE(fb_addr); i++)
+               if (fb_addr[i].fb_type == fb_type) {
+                       *virt_addr = (void *)(dum_data.lcd_virt_start +
+                                       fb_addr[i].addr_offset);
+                       *phys_addr =
+                           dum_data.lcd_phys_start + fb_addr[i].addr_offset;
+                       *fb_length = fb_addr[i].fb_length;
+                       ret = 0;
+                       break;
+               }
+
+       return ret;
+}
+
+EXPORT_SYMBOL(pnx4008_get_fb_addresses);
+
+int pnx4008_alloc_dum_channel(int dev_id)
+{
+       int i = 0;
+
+       while ((i < MAX_DUM_CHANNELS) && (dum_data.fb_owning_channel[i] != -1))
+               i++;
+
+       if (i == MAX_DUM_CHANNELS)
+               return -ENORESOURCESLEFT;
+       else {
+               dum_data.fb_owning_channel[i] = dev_id;
+               return i;
+       }
+}
+
+EXPORT_SYMBOL(pnx4008_alloc_dum_channel);
+
+int pnx4008_free_dum_channel(int channr, int dev_id)
+{
+       if (channr < 0 || channr > MAX_DUM_CHANNELS)
+               return -EINVAL;
+       else if (dum_data.fb_owning_channel[channr] != dev_id)
+               return -EFBNOTOWNER;
+       else {
+               clear_channel(channr);
+               dum_data.fb_owning_channel[channr] = -1;
+       }
+
+       return 0;
+}
+
+EXPORT_SYMBOL(pnx4008_free_dum_channel);
+
+int pnx4008_put_dum_channel_uf(struct dumchannel_uf chan_uf, int dev_id)
+{
+       int i = chan_uf.channelnr;
+       int ret;
+
+       if (i < 0 || i > MAX_DUM_CHANNELS)
+               return -EINVAL;
+       else if (dum_data.fb_owning_channel[i] != dev_id)
+               return -EFBNOTOWNER;
+       else if ((ret =
+                 display_open(chan_uf.channelnr, 0, chan_uf.dirty,
+                              chan_uf.source, chan_uf.y_offset,
+                              chan_uf.x_offset, chan_uf.height,
+                              chan_uf.width)) != 0)
+               return ret;
+       else {
+               dum_data.chan_uf_store[i].dirty = chan_uf.dirty;
+               dum_data.chan_uf_store[i].source = chan_uf.source;
+               dum_data.chan_uf_store[i].x_offset = chan_uf.x_offset;
+               dum_data.chan_uf_store[i].y_offset = chan_uf.y_offset;
+               dum_data.chan_uf_store[i].width = chan_uf.width;
+               dum_data.chan_uf_store[i].height = chan_uf.height;
+       }
+
+       return 0;
+}
+
+EXPORT_SYMBOL(pnx4008_put_dum_channel_uf);
+
+int pnx4008_set_dum_channel_sync(int channr, int val, int dev_id)
+{
+       if (channr < 0 || channr > MAX_DUM_CHANNELS)
+               return -EINVAL;
+       else if (dum_data.fb_owning_channel[channr] != dev_id)
+               return -EFBNOTOWNER;
+       else {
+               if (val == CONF_SYNC_ON) {
+                       DUM_CH_CONF(channr) |= CONF_SYNCENABLE;
+                       DUM_CH_CONF(channr) |= DUM_CHANNEL_CFG_SYNC_MASK |
+                               DUM_CHANNEL_CFG_SYNC_MASK_SET;
+               } else if (val == CONF_SYNC_OFF)
+                       DUM_CH_CONF(channr) &= ~CONF_SYNCENABLE;
+               else
+                       return -EINVAL;
+       }
+
+       return 0;
+}
+
+EXPORT_SYMBOL(pnx4008_set_dum_channel_sync);
+
+int pnx4008_set_dum_channel_dirty_detect(int channr, int val, int dev_id)
+{
+       if (channr < 0 || channr > MAX_DUM_CHANNELS)
+               return -EINVAL;
+       else if (dum_data.fb_owning_channel[channr] != dev_id)
+               return -EFBNOTOWNER;
+       else {
+               if (val == CONF_DIRTYDETECTION_ON)
+                       DUM_CH_CONF(channr) |= CONF_DIRTYENABLE;
+               else if (val == CONF_DIRTYDETECTION_OFF)
+                       DUM_CH_CONF(channr) &= ~CONF_DIRTYENABLE;
+               else
+                       return -EINVAL;
+       }
+
+       return 0;
+}
+
+EXPORT_SYMBOL(pnx4008_set_dum_channel_dirty_detect);
+
+#if 0 /* Functions not used currently, but likely to be used in future */
+
+static int get_channel(struct dumchannel *p_chan)
+{
+       int i = p_chan->channelnr;
+
+       if (i < 0 || i > MAX_DUM_CHANNELS)
+               return -EINVAL;
+       else {
+               p_chan->dum_ch_min = DUM_CH_MIN(i);
+               p_chan->dum_ch_max = DUM_CH_MAX(i);
+               p_chan->dum_ch_conf = DUM_CH_CONF(i);
+               p_chan->dum_ch_stat = DUM_CH_STAT(i);
+               p_chan->dum_ch_ctrl = 0;        /* WriteOnly control register */
+       }
+
+       return 0;
+}
+
+int pnx4008_get_dum_channel_uf(struct dumchannel_uf *p_chan_uf, int dev_id)
+{
+       int i = p_chan_uf->channelnr;
+
+       if (i < 0 || i > MAX_DUM_CHANNELS)
+               return -EINVAL;
+       else if (dum_data.fb_owning_channel[i] != dev_id)
+               return -EFBNOTOWNER;
+       else {
+               p_chan_uf->dirty = dum_data.chan_uf_store[i].dirty;
+               p_chan_uf->source = dum_data.chan_uf_store[i].source;
+               p_chan_uf->x_offset = dum_data.chan_uf_store[i].x_offset;
+               p_chan_uf->y_offset = dum_data.chan_uf_store[i].y_offset;
+               p_chan_uf->width = dum_data.chan_uf_store[i].width;
+               p_chan_uf->height = dum_data.chan_uf_store[i].height;
+       }
+
+       return 0;
+}
+
+EXPORT_SYMBOL(pnx4008_get_dum_channel_uf);
+
+int pnx4008_get_dum_channel_config(int channr, int dev_id)
+{
+       int ret;
+       struct dumchannel chan;
+
+       if (channr < 0 || channr > MAX_DUM_CHANNELS)
+               return -EINVAL;
+       else if (dum_data.fb_owning_channel[channr] != dev_id)
+               return -EFBNOTOWNER;
+       else {
+               chan.channelnr = channr;
+               if ((ret = get_channel(&chan)) != 0)
+                       return ret;
+       }
+
+       return (chan.dum_ch_conf & DUM_CHANNEL_CFG_MASK);
+}
+
+EXPORT_SYMBOL(pnx4008_get_dum_channel_config);
+
+int pnx4008_force_update_dum_channel(int channr, int dev_id)
+{
+       if (channr < 0 || channr > MAX_DUM_CHANNELS)
+               return -EINVAL;
+
+       else if (dum_data.fb_owning_channel[channr] != dev_id)
+               return -EFBNOTOWNER;
+       else
+               DUM_CH_CTRL(channr) = CTRL_SETDIRTY;
+
+       return 0;
+}
+
+EXPORT_SYMBOL(pnx4008_force_update_dum_channel);
+
+#endif
+
+int pnx4008_sdum_mmap(struct fb_info *info, struct vm_area_struct *vma,
+                     struct device *dev)
+{
+       unsigned long off = vma->vm_pgoff << PAGE_SHIFT;
+
+       if (off < info->fix.smem_len) {
+               vma->vm_pgoff += 1;
+               return dma_mmap_writecombine(dev, vma,
+                               (void *)dum_data.lcd_virt_start,
+                               dum_data.lcd_phys_start,
+                               FB_DMA_SIZE);
+       }
+       return -EINVAL;
+}
+
+EXPORT_SYMBOL(pnx4008_sdum_mmap);
+
+int pnx4008_set_dum_exit_notification(int dev_id)
+{
+       int i;
+
+       for (i = 0; i < MAX_DUM_CHANNELS; i++)
+               if (dum_data.fb_owning_channel[i] == dev_id)
+                       return -ERESOURCESNOTFREED;
+
+       return 0;
+}
+
+EXPORT_SYMBOL(pnx4008_set_dum_exit_notification);
+
+/* Platform device driver for DUM */
+
+static int sdum_suspend(struct platform_device *pdev, pm_message_t state)
+{
+       int retval = 0;
+       struct clk *clk;
+
+       clk = clk_get(0, "dum_ck");
+       if (!IS_ERR(clk)) {
+               clk_set_rate(clk, 0);
+               clk_put(clk);
+       } else
+               retval = PTR_ERR(clk);
+
+       /* disable BAC */
+       DUM_CTRL = V_BAC_DISABLE_IDLE;
+
+       /* LCD standby & turn off display */
+       lcd_reset();
+
+       return retval;
+}
+
+static int sdum_resume(struct platform_device *pdev)
+{
+       int retval = 0;
+       struct clk *clk;
+
+       clk = clk_get(0, "dum_ck");
+       if (!IS_ERR(clk)) {
+               clk_set_rate(clk, 1);
+               clk_put(clk);
+       } else
+               retval = PTR_ERR(clk);
+
+       /* wait for BAC disable */
+       DUM_CTRL = V_BAC_DISABLE_TRIG;
+
+       while (DUM_CTRL & BAC_ENABLED)
+               udelay(10);
+
+       /* re-init LCD */
+       lcd_init();
+
+       /* enable BAC and reset MUX */
+       DUM_CTRL = V_BAC_ENABLE;
+       udelay(1);
+       DUM_CTRL = V_MUX_RESET;
+       return 0;
+}
+
+static int __devinit sdum_probe(struct platform_device *pdev)
+{
+       int ret = 0, i = 0;
+
+       /* map frame buffer */
+       dum_data.lcd_virt_start = (u32) dma_alloc_writecombine(&pdev->dev,
+                                                      FB_DMA_SIZE,
+                                                      &dum_data.lcd_phys_start,
+                                                      GFP_KERNEL);
+
+       if (!dum_data.lcd_virt_start) {
+               ret = -ENOMEM;
+               goto out_3;
+       }
+
+       /* map slave registers */
+       dum_data.slave_phys_base = PNX4008_DUM_SLAVE_BASE;
+       dum_data.slave_virt_base =
+           (u32 *) ioremap_nocache(dum_data.slave_phys_base, sizeof(u32));
+
+       if (dum_data.slave_virt_base == NULL) {
+               ret = -ENOMEM;
+               goto out_2;
+       }
+
+       /* initialize DUM and LCD display */
+       ret = dum_init(pdev);
+       if (ret)
+               goto out_1;
+
+       dum_chan_init();
+       lcd_init();
+
+       DUM_CTRL = V_BAC_ENABLE;
+       udelay(1);
+       DUM_CTRL = V_MUX_RESET;
+
+       /* set decode address and sync clock divider */
+       DUM_DECODE = dum_data.lcd_phys_start & DUM_DECODE_MASK;
+       DUM_CLK_DIV = PNX4008_DUM_CLK_DIV;
+
+       for (i = 0; i < MAX_DUM_CHANNELS; i++)
+               dum_data.fb_owning_channel[i] = -1;
+
+       /*setup wakeup interrupt */
+       start_int_set_rising_edge(SE_DISP_SYNC_INT);
+       start_int_ack(SE_DISP_SYNC_INT);
+       start_int_umask(SE_DISP_SYNC_INT);
+
+       return 0;
+
+out_1:
+       iounmap((void *)dum_data.slave_virt_base);
+out_2:
+       dma_free_writecombine(&pdev->dev, FB_DMA_SIZE,
+                       (void *)dum_data.lcd_virt_start,
+                       dum_data.lcd_phys_start);
+out_3:
+       return ret;
+}
+
+static int sdum_remove(struct platform_device *pdev)
+{
+       struct clk *clk;
+
+       start_int_mask(SE_DISP_SYNC_INT);
+
+       clk = clk_get(0, "dum_ck");
+       if (!IS_ERR(clk)) {
+               clk_set_rate(clk, 0);
+               clk_put(clk);
+       }
+
+       iounmap((void *)dum_data.slave_virt_base);
+
+       dma_free_writecombine(&pdev->dev, FB_DMA_SIZE,
+                       (void *)dum_data.lcd_virt_start,
+                       dum_data.lcd_phys_start);
+
+       return 0;
+}
+
+static struct platform_driver sdum_driver = {
+       .driver = {
+               .name = "sdum",
+       },
+       .probe = sdum_probe,
+       .remove = sdum_remove,
+       .suspend = sdum_suspend,
+       .resume = sdum_resume,
+};
+
+int __init sdum_init(void)
+{
+       return platform_driver_register(&sdum_driver);
+}
+
+static void __exit sdum_exit(void)
+{
+       platform_driver_unregister(&sdum_driver);
+};
+
+module_init(sdum_init);
+module_exit(sdum_exit);
+
+MODULE_LICENSE("GPL");
diff --git a/drivers/video/pnx4008/sdum.h b/drivers/video/pnx4008/sdum.h
new file mode 100644 (file)
index 0000000..e8c5dcd
--- /dev/null
@@ -0,0 +1,139 @@
+/*
+ * Copyright (C) 2005 Philips Semiconductors
+ *
+ * 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, 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; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA, or http://www.gnu.org/licenses/gpl.html
+*/
+
+#define MAX_DUM_CHANNELS       64
+
+#define RGB_MEM_WINDOW(x) (0x10000000 + (x)*0x00100000)
+
+#define QCIF_OFFSET(x) (((x) == 0) ? 0x00000: ((x) == 1) ? 0x30000: -1)
+#define CIF_OFFSET(x)  (((x) == 0) ? 0x00000: ((x) == 1) ? 0x60000: -1)
+
+#define CTRL_SETDIRTY          (0x00000001)
+#define CONF_DIRTYENABLE       (0x00000020)
+#define CONF_SYNCENABLE                (0x00000004)
+
+#define DIRTY_ENABLED(conf)    ((conf) & 0x0020)
+#define SYNC_ENABLED(conf)     ((conf) & 0x0004)
+
+/* Display 1 & 2 Write Timing Configuration */
+#define PNX4008_DUM_WT_CFG             0x00372000
+
+/* Display 1 & 2 Read Timing Configuration */
+#define PNX4008_DUM_RT_CFG             0x00003A47
+
+/* DUM Transit State Timing Configuration */
+#define PNX4008_DUM_T_CFG              0x1D    /* 29 HCLK cycles */
+
+/* DUM Sync count clock divider */
+#define PNX4008_DUM_CLK_DIV            0x02DD
+
+/* Memory size for framebuffer, allocated through dma_alloc_writecombine().
+ * Must be PAGE aligned
+ */
+#define FB_DMA_SIZE (PAGE_ALIGN(SZ_1M + PAGE_SIZE))
+
+#define OFFSET_RGBBUFFER (0xB0000)
+#define OFFSET_YUVBUFFER (0x00000)
+
+#define YUVBUFFER (lcd_video_start + OFFSET_YUVBUFFER)
+#define RGBBUFFER (lcd_video_start + OFFSET_RGBBUFFER)
+
+#define CMDSTRING_BASEADDR     (0x00C000)      /* iram */
+#define BYTES_PER_CMDSTRING    (0x80)
+#define NR_OF_CMDSTRINGS       (64)
+
+#define MAX_NR_PRESTRINGS (0x40)
+#define MAX_NR_POSTSTRINGS (0x40)
+
+/* various mask definitions */
+#define DUM_CLK_ENABLE 0x01
+#define DUM_CLK_DISABLE 0
+#define DUM_DECODE_MASK 0x1FFFFFFF
+#define DUM_CHANNEL_CFG_MASK 0x01FF
+#define DUM_CHANNEL_CFG_SYNC_MASK 0xFFFE00FF
+#define DUM_CHANNEL_CFG_SYNC_MASK_SET 0x0CA00
+
+#define SDUM_RETURNVAL_BASE (0x500)
+
+#define CONF_SYNC_OFF          (0x602)
+#define CONF_SYNC_ON           (0x603)
+
+#define CONF_DIRTYDETECTION_OFF        (0x600)
+#define CONF_DIRTYDETECTION_ON (0x601)
+
+/* Set the corresponding bit. */
+#define BIT(n) (0x1U << (n))
+
+struct dumchannel_uf {
+       int channelnr;
+       u32 *dirty;
+       u32 *source;
+       u32 x_offset;
+       u32 y_offset;
+       u32 width;
+       u32 height;
+};
+
+enum {
+       FB_TYPE_YUV,
+       FB_TYPE_RGB
+};
+
+struct cmdstring {
+       int channelnr;
+       uint16_t prestringlen;
+       uint16_t poststringlen;
+       uint16_t format;
+       uint16_t reserved;
+       uint16_t startaddr_low;
+       uint16_t startaddr_high;
+       uint16_t pixdatlen_low;
+       uint16_t pixdatlen_high;
+       u32 precmd[MAX_NR_PRESTRINGS];
+       u32 postcmd[MAX_NR_POSTSTRINGS];
+
+};
+
+struct dumchannel {
+       int channelnr;
+       int dum_ch_min;
+       int dum_ch_max;
+       int dum_ch_conf;
+       int dum_ch_stat;
+       int dum_ch_ctrl;
+};
+
+int pnx4008_alloc_dum_channel(int dev_id);
+int pnx4008_free_dum_channel(int channr, int dev_id);
+
+int pnx4008_get_dum_channel_uf(struct dumchannel_uf *pChan_uf, int dev_id);
+int pnx4008_put_dum_channel_uf(struct dumchannel_uf chan_uf, int dev_id);
+
+int pnx4008_set_dum_channel_sync(int channr, int val, int dev_id);
+int pnx4008_set_dum_channel_dirty_detect(int channr, int val, int dev_id);
+
+int pnx4008_force_dum_update_channel(int channr, int dev_id);
+
+int pnx4008_get_dum_channel_config(int channr, int dev_id);
+
+int pnx4008_sdum_mmap(struct fb_info *info, struct vm_area_struct *vma, struct device *dev);
+int pnx4008_set_dum_exit_notification(int dev_id);
+
+int pnx4008_get_fb_addresses(int fb_type, void **virt_addr,
+                            dma_addr_t * phys_addr, int *fb_length);
index ec4bacf9dd2e90d2c4b0d696356bdcfff6ee9b53..4a1e0e8569200e39d7e6de0ec7f0f9d88014949a 100644 (file)
@@ -56,7 +56,6 @@
 #include <linux/tty.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
-#include <linux/config.h>
 #include <linux/interrupt.h>
 #include <linux/fb.h>
 #include <linux/init.h>
index 809fc5eefc15b2a84c434ec84a3e407070471de4..bbb07106cd54b1b50f2a3de7cf769590a7a56536 100644 (file)
@@ -22,7 +22,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/kernel.h>
@@ -1335,7 +1334,7 @@ int __init pxafb_probe(struct platform_device *dev)
                goto failed;
        }
 
-       ret = request_irq(IRQ_LCD, pxafb_handle_irq, SA_INTERRUPT, "LCD", fbi);
+       ret = request_irq(IRQ_LCD, pxafb_handle_irq, IRQF_DISABLED, "LCD", fbi);
        if (ret) {
                dev_err(&dev->dev, "request_irq failed: %d\n", ret);
                ret = -EBUSY;
index 12af58c5cf1f44cc205fc2b7c44bef90c6b78861..2788655e6e7de76c93e96d2c2ba5850565c69b19 100644 (file)
@@ -29,7 +29,6 @@
  *     doublescan modes are broken
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index 8b1967fc116ad19636309da4bd0cd77f4ed7ed9a..9751c37c0bfd57de13b4c182090c2adcc0422dd7 100644 (file)
@@ -12,7 +12,6 @@
  * for more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index 440ff445689b79b81a915617cd18556638991804..7fa13fc9c4135837fdef1a7b94e18ef41a2a71ac 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef __RIVAFB_H
 #define __RIVAFB_H
 
-#include <linux/config.h>
 #include <linux/fb.h>
 #include <video/vga.h>
 #include <linux/i2c.h>
index feec47bdd47996dbe4ab22ee8fbbc3859585a8dd..a5333c1907898ef71a301eecd75d8e3e56cbb5fd 100644 (file)
@@ -28,7 +28,6 @@
  * more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/delay.h>
index fbc4118506865532aaec8622176225968c5231e4..f461eb10cc798fcf5df30a6a3d6d946e64bf87ae 100644 (file)
@@ -735,7 +735,7 @@ static int __init s3c2410fb_probe(struct platform_device *pdev)
 
        dprintk("got LCD region\n");
 
-       ret = request_irq(irq, s3c2410fb_irq, SA_INTERRUPT, pdev->name, info);
+       ret = request_irq(irq, s3c2410fb_irq, IRQF_DISABLED, pdev->name, info);
        if (ret) {
                dev_err(&pdev->dev, "cannot get irq %d - err %d\n", irq, ret);
                ret = -EBUSY;
index d9831fd4234184c92a0a4468839eb2612cec5388..a2e6e7205d7e082b79a2428a35b406059fa59c3e 100644 (file)
  *     - Add patch 681/1 and clean up stork definitions.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -1473,7 +1472,7 @@ static int __init sa1100fb_probe(struct platform_device *pdev)
        if (ret)
                goto failed;
 
-       ret = request_irq(irq, sa1100fb_handle_irq, SA_INTERRUPT,
+       ret = request_irq(irq, sa1100fb_handle_irq, IRQF_DISABLED,
                          "LCD", fbi);
        if (ret) {
                printk(KERN_ERR "sa1100fb: request_irq failed: %d\n", ret);
index 21debed863ac4d459bd9222b544841fe862eb476..e83befd16d634328ddb6029df79aaa3330f1a5a1 100644 (file)
@@ -10,7 +10,6 @@
  * for more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index 78883cf66a4d8876b6aa6754de16d588e696aee3..4729af477fbf0300af93400eb1de4e279f294339 100644 (file)
@@ -41,7 +41,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index c0cc5e3ba7b5fe28d689071a52836897d8450627..ebb6756aea0894b9546db8b7a1e8ff2b739fa7c8 100644 (file)
@@ -9,7 +9,6 @@
  *  more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
index 634c0a9d219b1a1da486c76633deb21c41f8c2a0..7ecab87cef027cece07ad55c987bd96a280f4a39 100644 (file)
@@ -73,7 +73,6 @@
 #ifdef SIS_CP
 #undef SIS_CP
 #endif
-#include <linux/config.h>
 #include <linux/version.h>
 #include <linux/types.h>
 #include <asm/io.h>
index c3e070a6effd9f61a25f5a98e2d8ba674da37954..f13faddc618102f3040a8370ace0203f2344372a 100644 (file)
@@ -8043,8 +8043,8 @@ SiS_SetCHTVReg(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short
       SiS_SetCH700x(SiS_Pr,0x01,0x28);
 
       /* Set video bandwidth
-            High bandwith Luma composite video filter(S0=1)
-            low bandwith Luma S-video filter (S2-1=00)
+            High bandwidth Luma composite video filter(S0=1)
+            low bandwidth Luma S-video filter (S2-1=00)
            disable peak filter in S-video channel (S3=0)
            high bandwidth Chroma Filter (S5-4=11)
            =00110001=0x31
index f475b21a85cfa6f87161698a84ef8e65d4c98df4..bc321dc57e92ebc1ceb4b70eadd1c2934c72fcf8 100644 (file)
@@ -67,7 +67,6 @@
 #ifdef SIS_CP
 #undef SIS_CP
 #endif
-#include <linux/config.h>
 #include <linux/version.h>
 #include <linux/types.h>
 #include <asm/io.h>
index cc856d90903c147dd8139014c565bf5601d6a95e..09f5d758b6c02b79d3aab802698664c949f9de0d 100644 (file)
@@ -30,7 +30,6 @@
 #include "vgatypes.h"
 #include "vstruct.h"
 
-#include <linux/config.h>
 #include <linux/version.h>
 #include <linux/types.h>
 #include <linux/fb.h>
index 841ca3190cd4d15fbe329763016a0e5639698bc9..f59568020eb220d7a720a10c73c87b3b5dadb66e 100644 (file)
@@ -90,7 +90,6 @@
 /**********************************************************************/
 
 #ifdef SIS_LINUX_KERNEL
-#include <linux/config.h>
 #include <linux/version.h>
 
 #ifdef CONFIG_FB_SIS_300
index 0b6e625d7331672d5ff8e6ab04d42a02adb2cf74..a259446ca7fe3f883afb49fee8f67dd787b936d2 100644 (file)
@@ -24,7 +24,6 @@
 #ifndef _SIS_H_
 #define _SIS_H_
 
-#include <linux/config.h>
 #include <linux/version.h>
 
 #include "osdef.h"
index bab933e6c6a697ffe8dcd804517b69c8363506b8..3b7ce032e2ed6af47599e9336c01d37bdc864e8c 100644 (file)
@@ -28,7 +28,6 @@
  *                     for more information and updates)
  */
 
-#include <linux/config.h>
 #include <linux/version.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
index c63c0e721b827c1093dca5c03d069bb3b881870c..b848ca7db7f9798c7d94d530775cc6be279885b2 100644 (file)
@@ -33,7 +33,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/version.h>
 #include <linux/module.h>
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
index c44de90ca12e7078b373cba7e76c108c5b0676fe..dad54e73147b4d68420fb5c189889c94213f34bd 100644 (file)
@@ -82,7 +82,6 @@
  * Includes
  */
 
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
index 4a292aae6eb26878e69277a1f53eb58da759a8a8..3e16e2d9d55dd50a39187b9d332e41b67b4723e1 100644 (file)
@@ -54,7 +54,6 @@
 #undef DEBUG_STIFB_REGS                /* debug sti register accesses */
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index 9b36b9df535f2cdcd45207f63612631258628ed3..e046e20f02b91aead446abd4b62afa1117aaff7a 100644 (file)
@@ -25,7 +25,6 @@
  *  more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index 5e5328d682db52aee991d6b48fa11951395250ba..239b1496874b826a444e3bb49c9ebc8542a50a62 100644 (file)
@@ -58,7 +58,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index 41f8c2d938924ad431359e5b2d0eaa791b26cad6..14175cdb9c9c837ab097e915c7415cf3d1ae0b8d 100644 (file)
@@ -15,7 +15,6 @@
  *     TGUI acceleration       
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/fb.h>
 #include <linux/init.h>
index 2bdeb4baa9529c53426a76dfd27a9b3afbee9c2d..1d76c035050ea2297bbb45139c18412b1725a8e3 100644 (file)
@@ -39,7 +39,6 @@
  *  more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index 15179ec62339f4dd6a02897442ded8bf85d6ab3e..d94efafc77b57362ee8e29e8fdf2e118b69756a4 100644 (file)
@@ -13,7 +13,6 @@
  * archive for more details.  
  *
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/fb.h>
index 0dd532d3a5d60e5a1d62965b89e5b530f15777a2..e8517c3d8e82df3d9b34f9049a29bdedd0a61b0e 100644 (file)
@@ -9,7 +9,6 @@
  *     David Mosberger-Tang, Martin Mares
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
index a767e05b60bf3d03eb9438344246be3bdc71bbfc..1e898144eb7c167bb3a2ad30dc1760c8cb8f19ba 100644 (file)
@@ -24,7 +24,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
index 981fe8ecd78045b315c1709502590d50dd6fb213..ae91555c155894be0b0118bc075e095ae01b5262 100644 (file)
@@ -27,7 +27,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/list.h>
index 6f2617820a4ef3ad001bad832978ea55ad379774..8556097fcda869bf8aea8197ad879c0cfbb6fa41 100644 (file)
@@ -24,7 +24,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
index 583e827baebd9e09e56d8ed572a03516c03ef1d0..34b96114a28d479ae319c0c9524fe942c96cc1eb 100644 (file)
@@ -21,7 +21,6 @@
  *  Boston, MA  02111-1301  USA
  *
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
index b7608af07ce8b44db2c3378f0a1b3f49efb65191..70492ccb43850843dafe2ea0c35945e251a1bd75 100644 (file)
@@ -20,7 +20,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
index 8d45ed6688376461f357ca69d6ec6c9abe3c671a..90a79c784549f108f4929a7865295deaf0a69b23 100644 (file)
@@ -23,7 +23,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
index 94e0a7fd9fc2c30b6954001620a975005a742e29..34d43355beb7212c4226bd248aa68e4bd0e2612e 100644 (file)
@@ -25,7 +25,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/in.h>
 #include <linux/module.h>
 #include <linux/net.h>
index d37416eb57919d8caa20e21b81b37b8ce4701fa9..22f7ccd58d38725f7c23f5064c3ace5047aba97f 100644 (file)
@@ -23,7 +23,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
index d4f0aa3c87f2fc2717413169d5ec651cda144aa8..9dfd259a70b477c4f0bb67d33c4ed2311fde405c 100644 (file)
@@ -31,7 +31,6 @@
 #include <linux/string.h>
 #include <linux/smp_lock.h>
 #include <linux/inet.h>
-#include <linux/version.h>
 #include <linux/pagemap.h>
 #include <linux/idr.h>
 
index 1a8e46084f0e1b25f14dc12417429dd79e94529f..c3c47eda7574fc24a6cbb33e4730a16140c1c988 100644 (file)
@@ -31,7 +31,6 @@
 #include <linux/string.h>
 #include <linux/smp_lock.h>
 #include <linux/inet.h>
-#include <linux/version.h>
 #include <linux/list.h>
 #include <asm/uaccess.h>
 #include <linux/idr.h>
index 8b15bb22cacac67b4d8e6e28ef95e272501ed98e..63320d4e15d260fc0e7800d2bc0d2a54141666ff 100644 (file)
@@ -25,7 +25,6 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
index 7b075fc397da7bcffece6dcde249afdf2d097f1e..d3c7905b2ddc007decc5084e5a5a6761ac52b43a 100644 (file)
@@ -9,7 +9,6 @@
  *
  *  Common directory handling for ADFS
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/adfs_fs.h>
index a83e889a97cd7d8d79dd04fe29b5f0f43edbe890..fcaeead9696b135f6481ff93afd7829980d53e5e 100644 (file)
@@ -325,7 +325,7 @@ befs_read_inode(struct inode *inode)
        if (!bh) {
                befs_error(sb, "unable to read inode block - "
                           "inode = %lu", inode->i_ino);
-               goto unaquire_none;
+               goto unacquire_none;
        }
 
        raw_inode = (befs_inode *) bh->b_data;
@@ -334,7 +334,7 @@ befs_read_inode(struct inode *inode)
 
        if (befs_check_inode(sb, raw_inode, inode->i_ino) != BEFS_OK) {
                befs_error(sb, "Bad inode: %lu", inode->i_ino);
-               goto unaquire_bh;
+               goto unacquire_bh;
        }
 
        inode->i_mode = (umode_t) fs32_to_cpu(sb, raw_inode->mode);
@@ -402,17 +402,17 @@ befs_read_inode(struct inode *inode)
                befs_error(sb, "Inode %lu is not a regular file, "
                           "directory or symlink. THAT IS WRONG! BeFS has no "
                           "on disk special files", inode->i_ino);
-               goto unaquire_bh;
+               goto unacquire_bh;
        }
 
        brelse(bh);
        befs_debug(sb, "<--- befs_read_inode()");
        return;
 
-      unaquire_bh:
+      unacquire_bh:
        brelse(bh);
 
-      unaquire_none:
+      unacquire_none:
        make_bad_inode(inode);
        befs_debug(sb, "<--- befs_read_inode() - Bad inode");
        return;
@@ -761,14 +761,14 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
                printk(KERN_ERR
                       "BeFS(%s): Unable to allocate memory for private "
                       "portion of superblock. Bailing.\n", sb->s_id);
-               goto unaquire_none;
+               goto unacquire_none;
        }
        befs_sb = BEFS_SB(sb);
        memset(befs_sb, 0, sizeof(befs_sb_info));
 
        if (!parse_options((char *) data, &befs_sb->mount_opts)) {
                befs_error(sb, "cannot parse mount options");
-               goto unaquire_priv_sbp;
+               goto unacquire_priv_sbp;
        }
 
        befs_debug(sb, "---> befs_fill_super()");
@@ -794,7 +794,7 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
 
        if (!(bh = sb_bread(sb, sb_block))) {
                befs_error(sb, "unable to read superblock");
-               goto unaquire_priv_sbp;
+               goto unacquire_priv_sbp;
        }
 
        /* account for offset of super block on x86 */
@@ -809,20 +809,20 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
        }
 
        if (befs_load_sb(sb, disk_sb) != BEFS_OK)
-               goto unaquire_bh;
+               goto unacquire_bh;
 
        befs_dump_super_block(sb, disk_sb);
 
        brelse(bh);
 
        if (befs_check_sb(sb) != BEFS_OK)
-               goto unaquire_priv_sbp;
+               goto unacquire_priv_sbp;
 
        if( befs_sb->num_blocks > ~((sector_t)0) ) {
                befs_error(sb, "blocks count: %Lu "
                        "is larger than the host can use",
                        befs_sb->num_blocks);
-               goto unaquire_priv_sbp;
+               goto unacquire_priv_sbp;
        }
 
        /*
@@ -838,7 +838,7 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
        if (!sb->s_root) {
                iput(root);
                befs_error(sb, "get root inode failed");
-               goto unaquire_priv_sbp;
+               goto unacquire_priv_sbp;
        }
 
        /* load nls library */
@@ -860,13 +860,13 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
 
        return 0;
 /*****************/
-      unaquire_bh:
+      unacquire_bh:
        brelse(bh);
 
-      unaquire_priv_sbp:
+      unacquire_priv_sbp:
        kfree(sb->s_fs_info);
 
-      unaquire_none:
+      unacquire_none:
        sb->s_fs_info = NULL;
        return -EINVAL;
 }
@@ -925,18 +925,18 @@ init_befs_fs(void)
 
        err = befs_init_inodecache();
        if (err)
-               goto unaquire_none;
+               goto unacquire_none;
 
        err = register_filesystem(&befs_fs_type);
        if (err)
-               goto unaquire_inodecache;
+               goto unacquire_inodecache;
 
        return 0;
 
-unaquire_inodecache:
+unacquire_inodecache:
        befs_destroy_inodecache();
 
-unaquire_none:
+unacquire_none:
        return err;
 }
 
index d0434406eaeb46553eccf772668cb7a59e35eb81..f42e64210ee5de985d976507cd0d9acbd42fa86d 100644 (file)
@@ -84,7 +84,7 @@ static struct linux_binfmt elf_format = {
                .min_coredump   = ELF_EXEC_PAGESIZE
 };
 
-#define BAD_ADDR(x) ((unsigned long)(x) > TASK_SIZE)
+#define BAD_ADDR(x) ((unsigned long)(x) >= TASK_SIZE)
 
 static int set_brk(unsigned long start, unsigned long end)
 {
@@ -394,7 +394,7 @@ static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex,
                         * <= p_memsize so it's only necessary to check p_memsz.
                         */
                        k = load_addr + eppnt->p_vaddr;
-                       if (k > TASK_SIZE ||
+                       if (BAD_ADDR(k) ||
                            eppnt->p_filesz > eppnt->p_memsz ||
                            eppnt->p_memsz > TASK_SIZE ||
                            TASK_SIZE - eppnt->p_memsz < k) {
@@ -887,7 +887,7 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
                 * allowed task size. Note that p_filesz must always be
                 * <= p_memsz so it is only necessary to check p_memsz.
                 */
-               if (k > TASK_SIZE || elf_ppnt->p_filesz > elf_ppnt->p_memsz ||
+               if (BAD_ADDR(k) || elf_ppnt->p_filesz > elf_ppnt->p_memsz ||
                    elf_ppnt->p_memsz > TASK_SIZE ||
                    TASK_SIZE - elf_ppnt->p_memsz < k) {
                        /* set_brk can never work. Avoid overflows. */
@@ -941,10 +941,9 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
                                                    interpreter,
                                                    &interp_load_addr);
                if (BAD_ADDR(elf_entry)) {
-                       printk(KERN_ERR "Unable to load interpreter %.128s\n",
-                               elf_interpreter);
                        force_sig(SIGSEGV, current);
-                       retval = -ENOEXEC; /* Nobody gets to see this, but.. */
+                       retval = IS_ERR((void *)elf_entry) ?
+                                       (int)elf_entry : -EINVAL;
                        goto out_free_dentry;
                }
                reloc_func_desc = interp_load_addr;
@@ -955,8 +954,8 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
        } else {
                elf_entry = loc->elf_ex.e_entry;
                if (BAD_ADDR(elf_entry)) {
-                       send_sig(SIGSEGV, current, 0);
-                       retval = -ENOEXEC; /* Nobody gets to see this, but.. */
+                       force_sig(SIGSEGV, current);
+                       retval = -EINVAL;
                        goto out_free_dentry;
                }
        }
index c94d52eafd1bc3c98c9ca5108228ebd762565d36..a62fd4018a201199fcb113d37920f3a643c3d321 100644 (file)
@@ -16,7 +16,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
index 00a91dc25d164154fac1326f39129257bc72c94f..32b5d625ce9c7c311835139eea61e8b98896a7b1 100644 (file)
@@ -32,7 +32,6 @@
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 
-#include <linux/config.h>
 
 #include <linux/elf.h>
 
index 909cb0595b4e5279a54176cf52e2a2287a4c0bef..37534573960bc5cd1149ef52c118d438dd66833d 100644 (file)
@@ -5,7 +5,6 @@
  *  Copyright (C) 2001  Andrea Arcangeli <andrea@suse.de> SuSE
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <linux/fcntl.h>
@@ -740,7 +739,7 @@ static int bd_claim_by_kobject(struct block_device *bdev, void *holder,
        if (!bo)
                return -ENOMEM;
 
-       mutex_lock(&bdev->bd_mutex);
+       mutex_lock_nested(&bdev->bd_mutex, BD_MUTEX_PARTITION);
        res = bd_claim(bdev, holder);
        if (res || !add_bd_holder(bdev, bo))
                free_bd_holder(bo);
@@ -765,7 +764,7 @@ static void bd_release_from_kobject(struct block_device *bdev,
        if (!kobj)
                return;
 
-       mutex_lock(&bdev->bd_mutex);
+       mutex_lock_nested(&bdev->bd_mutex, BD_MUTEX_PARTITION);
        bd_release(bdev);
        if ((bo = del_bd_holder(bdev, kobj)))
                free_bd_holder(bo);
@@ -823,6 +822,22 @@ struct block_device *open_by_devnum(dev_t dev, unsigned mode)
 
 EXPORT_SYMBOL(open_by_devnum);
 
+static int
+blkdev_get_partition(struct block_device *bdev, mode_t mode, unsigned flags);
+
+struct block_device *open_partition_by_devnum(dev_t dev, unsigned mode)
+{
+       struct block_device *bdev = bdget(dev);
+       int err = -ENOMEM;
+       int flags = mode & FMODE_WRITE ? O_RDWR : O_RDONLY;
+       if (bdev)
+               err = blkdev_get_partition(bdev, mode, flags);
+       return err ? ERR_PTR(err) : bdev;
+}
+
+EXPORT_SYMBOL(open_partition_by_devnum);
+
+
 /*
  * This routine checks whether a removable media has been changed,
  * and invalidates all buffer-cache-entries in that case. This
@@ -869,7 +884,11 @@ void bd_set_size(struct block_device *bdev, loff_t size)
 }
 EXPORT_SYMBOL(bd_set_size);
 
-static int do_open(struct block_device *bdev, struct file *file)
+static int
+blkdev_get_whole(struct block_device *bdev, mode_t mode, unsigned flags);
+
+static int
+do_open(struct block_device *bdev, struct file *file, unsigned int subclass)
 {
        struct module *owner = NULL;
        struct gendisk *disk;
@@ -886,7 +905,8 @@ static int do_open(struct block_device *bdev, struct file *file)
        }
        owner = disk->fops->owner;
 
-       mutex_lock(&bdev->bd_mutex);
+       mutex_lock_nested(&bdev->bd_mutex, subclass);
+
        if (!bdev->bd_openers) {
                bdev->bd_disk = disk;
                bdev->bd_contains = bdev;
@@ -913,11 +933,11 @@ static int do_open(struct block_device *bdev, struct file *file)
                        ret = -ENOMEM;
                        if (!whole)
                                goto out_first;
-                       ret = blkdev_get(whole, file->f_mode, file->f_flags);
+                       ret = blkdev_get_whole(whole, file->f_mode, file->f_flags);
                        if (ret)
                                goto out_first;
                        bdev->bd_contains = whole;
-                       mutex_lock(&whole->bd_mutex);
+                       mutex_lock_nested(&whole->bd_mutex, BD_MUTEX_WHOLE);
                        whole->bd_part_count++;
                        p = disk->part[part - 1];
                        bdev->bd_inode->i_data.backing_dev_info =
@@ -945,7 +965,8 @@ static int do_open(struct block_device *bdev, struct file *file)
                        if (bdev->bd_invalidated)
                                rescan_partitions(bdev->bd_disk, bdev);
                } else {
-                       mutex_lock(&bdev->bd_contains->bd_mutex);
+                       mutex_lock_nested(&bdev->bd_contains->bd_mutex,
+                                         BD_MUTEX_PARTITION);
                        bdev->bd_contains->bd_part_count++;
                        mutex_unlock(&bdev->bd_contains->bd_mutex);
                }
@@ -986,11 +1007,49 @@ int blkdev_get(struct block_device *bdev, mode_t mode, unsigned flags)
        fake_file.f_dentry = &fake_dentry;
        fake_dentry.d_inode = bdev->bd_inode;
 
-       return do_open(bdev, &fake_file);
+       return do_open(bdev, &fake_file, BD_MUTEX_NORMAL);
 }
 
 EXPORT_SYMBOL(blkdev_get);
 
+static int
+blkdev_get_whole(struct block_device *bdev, mode_t mode, unsigned flags)
+{
+       /*
+        * This crockload is due to bad choice of ->open() type.
+        * It will go away.
+        * For now, block device ->open() routine must _not_
+        * examine anything in 'inode' argument except ->i_rdev.
+        */
+       struct file fake_file = {};
+       struct dentry fake_dentry = {};
+       fake_file.f_mode = mode;
+       fake_file.f_flags = flags;
+       fake_file.f_dentry = &fake_dentry;
+       fake_dentry.d_inode = bdev->bd_inode;
+
+       return do_open(bdev, &fake_file, BD_MUTEX_WHOLE);
+}
+
+static int
+blkdev_get_partition(struct block_device *bdev, mode_t mode, unsigned flags)
+{
+       /*
+        * This crockload is due to bad choice of ->open() type.
+        * It will go away.
+        * For now, block device ->open() routine must _not_
+        * examine anything in 'inode' argument except ->i_rdev.
+        */
+       struct file fake_file = {};
+       struct dentry fake_dentry = {};
+       fake_file.f_mode = mode;
+       fake_file.f_flags = flags;
+       fake_file.f_dentry = &fake_dentry;
+       fake_dentry.d_inode = bdev->bd_inode;
+
+       return do_open(bdev, &fake_file, BD_MUTEX_PARTITION);
+}
+
 static int blkdev_open(struct inode * inode, struct file * filp)
 {
        struct block_device *bdev;
@@ -1006,7 +1065,7 @@ static int blkdev_open(struct inode * inode, struct file * filp)
 
        bdev = bd_acquire(inode);
 
-       res = do_open(bdev, filp);
+       res = do_open(bdev, filp, BD_MUTEX_NORMAL);
        if (res)
                return res;
 
@@ -1020,13 +1079,13 @@ static int blkdev_open(struct inode * inode, struct file * filp)
        return res;
 }
 
-int blkdev_put(struct block_device *bdev)
+static int __blkdev_put(struct block_device *bdev, unsigned int subclass)
 {
        int ret = 0;
        struct inode *bd_inode = bdev->bd_inode;
        struct gendisk *disk = bdev->bd_disk;
 
-       mutex_lock(&bdev->bd_mutex);
+       mutex_lock_nested(&bdev->bd_mutex, subclass);
        lock_kernel();
        if (!--bdev->bd_openers) {
                sync_blockdev(bdev);
@@ -1036,7 +1095,8 @@ int blkdev_put(struct block_device *bdev)
                if (disk->fops->release)
                        ret = disk->fops->release(bd_inode, NULL);
        } else {
-               mutex_lock(&bdev->bd_contains->bd_mutex);
+               mutex_lock_nested(&bdev->bd_contains->bd_mutex,
+                                 subclass + 1);
                bdev->bd_contains->bd_part_count--;
                mutex_unlock(&bdev->bd_contains->bd_mutex);
        }
@@ -1052,9 +1112,8 @@ int blkdev_put(struct block_device *bdev)
                }
                bdev->bd_disk = NULL;
                bdev->bd_inode->i_data.backing_dev_info = &default_backing_dev_info;
-               if (bdev != bdev->bd_contains) {
-                       blkdev_put(bdev->bd_contains);
-               }
+               if (bdev != bdev->bd_contains)
+                       __blkdev_put(bdev->bd_contains, subclass + 1);
                bdev->bd_contains = NULL;
        }
        unlock_kernel();
@@ -1063,8 +1122,20 @@ int blkdev_put(struct block_device *bdev)
        return ret;
 }
 
+int blkdev_put(struct block_device *bdev)
+{
+       return __blkdev_put(bdev, BD_MUTEX_NORMAL);
+}
+
 EXPORT_SYMBOL(blkdev_put);
 
+int blkdev_put_partition(struct block_device *bdev)
+{
+       return __blkdev_put(bdev, BD_MUTEX_PARTITION);
+}
+
+EXPORT_SYMBOL(blkdev_put_partition);
+
 static int blkdev_close(struct inode * inode, struct file * filp)
 {
        struct block_device *bdev = I_BDEV(filp->f_mapping->host);
index e9994722f4a30959019e1df6e0516f8da23b9402..3660dcb975912d5a831a7940192df8f53354024d 100644 (file)
@@ -18,7 +18,6 @@
  * async buffer flushing, 1999 Andrea Arcangeli <andrea@suse.de>
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/syscalls.h>
 #include <linux/fs.h>
@@ -852,7 +851,7 @@ int __set_page_dirty_buffers(struct page *page)
                write_lock_irq(&mapping->tree_lock);
                if (page->mapping) {    /* Race with truncate? */
                        if (mapping_cap_account_dirty(mapping))
-                               inc_page_state(nr_dirty);
+                               __inc_zone_page_state(page, NR_FILE_DIRTY);
                        radix_tree_tag_set(&mapping->page_tree,
                                                page_index(page),
                                                PAGECACHE_TAG_DIRTY);
index 97986635b641393dd1b39cfc43eb4acdc1dbfc4e..a4cbc6706ef0062343ca8ef6d2db18c429bd8f2e 100644 (file)
@@ -4,7 +4,6 @@
  *  Copyright (C) 1991, 1992  Linus Torvalds
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/fs.h>
 #include <linux/slab.h>
index 031cdf2932568ae5dea33d4813d5b8bac314e1c5..2e75883b7f549ef4e9f09573fb20900a35a5838b 100644 (file)
@@ -17,7 +17,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 5861eb42e6260135ff491f95512e961e60c3e11a..944d2b9e092d27262e6ec669ff792bdb8a4e0df4 100644 (file)
@@ -324,7 +324,7 @@ out:
        return rc;
 }
 
-/* Try to reaquire byte range locks that were released when session */
+/* Try to reacquire byte range locks that were released when session */
 /* to server was lost */
 static int cifs_relock_file(struct cifsFileInfo *cifsFile)
 {
index f0b10757288f332907af862204c9dd7fa9d53c32..1c82e9a7d7c8a799698e404e1b50b31031ac3021 100644 (file)
@@ -11,7 +11,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/time.h>
 #include <linux/mm.h>
 #include <linux/sysctl.h>
index d8d50a70c58d65064931f6b0b5a8f2fa1beaf1a0..4063a939697768d990faa971a4488efe21f80dcb 100644 (file)
@@ -10,7 +10,6 @@
  * ioctls.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/compat.h>
 #include <linux/kernel.h>
index 48b44a714b3558c5f73099315094799b680b82ff..1b4a3a34ec57f20d605386c129c9ebf315dd1765 100644 (file)
@@ -14,7 +14,6 @@
  * the dcache entry is deleted or garbage collected.
  */
 
-#include <linux/config.h>
 #include <linux/syscalls.h>
 #include <linux/string.h>
 #include <linux/mm.h>
@@ -39,7 +38,7 @@ int sysctl_vfs_cache_pressure __read_mostly = 100;
 EXPORT_SYMBOL_GPL(sysctl_vfs_cache_pressure);
 
  __cacheline_aligned_in_smp DEFINE_SPINLOCK(dcache_lock);
-static seqlock_t rename_lock __cacheline_aligned_in_smp = SEQLOCK_UNLOCKED;
+static __cacheline_aligned_in_smp DEFINE_SEQLOCK(rename_lock);
 
 EXPORT_SYMBOL(dcache_lock);
 
@@ -1340,10 +1339,10 @@ void d_move(struct dentry * dentry, struct dentry * target)
         */
        if (target < dentry) {
                spin_lock(&target->d_lock);
-               spin_lock(&dentry->d_lock);
+               spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
        } else {
                spin_lock(&dentry->d_lock);
-               spin_lock(&target->d_lock);
+               spin_lock_nested(&target->d_lock, DENTRY_D_LOCK_NESTED);
        }
 
        /* Move the dentry to the target hash queue, if on different bucket */
index 8749339bf4f6c5ed45cdaf37239751c4d05663d4..0c4b0674854bbe0a47506a00ea1b5ef4b2529e4d 100644 (file)
@@ -12,7 +12,6 @@
  * to the pair and can be looked up from userspace.
  */
 
-#include <linux/config.h>
 #include <linux/syscalls.h>
 #include <linux/module.h>
 #include <linux/slab.h>
index 66a505422e5cbb8f75756022366a27a16688628b..39640fd034580f66c8f58ed9329e8220d4392c07 100644 (file)
@@ -13,7 +13,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/pagemap.h>
index 6fa1e04f8415f61d9f866b4d9e4b257c07ac0636..e8ae3042b806464649ceb767b721a0e7b4d9fa79 100644 (file)
@@ -16,7 +16,6 @@
 /* uncomment to get debug messages from the debug filesystem, ah the irony. */
 /* #define DEBUG */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/mount.h>
index 538fb0418fbab7aba852cc298b5a9ded054935f2..5981e17f46f051afa98ec0b7af67c1b25a0dc897 100644 (file)
@@ -220,7 +220,8 @@ static void dio_complete(struct dio *dio, loff_t offset, ssize_t bytes)
        if (dio->end_io && dio->result)
                dio->end_io(dio->iocb, offset, bytes, dio->map_bh.b_private);
        if (dio->lock_type == DIO_LOCKING)
-               up_read(&dio->inode->i_alloc_sem);
+               /* lockdep: non-owner release */
+               up_read_non_owner(&dio->inode->i_alloc_sem);
 }
 
 /*
@@ -1261,7 +1262,8 @@ __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
                }
 
                if (dio_lock_type == DIO_LOCKING)
-                       down_read(&inode->i_alloc_sem);
+                       /* lockdep: not the owner will release it */
+                       down_read_non_owner(&inode->i_alloc_sem);
        }
 
        /*
index 9c677bbd0b0823c3bc6d28ee1bf8d2545ee22ced..19ffb043abbccfb7fc564d114acabeaae8984a60 100644 (file)
@@ -120,7 +120,7 @@ struct epoll_filefd {
  */
 struct wake_task_node {
        struct list_head llink;
-       task_t *task;
+       struct task_struct *task;
        wait_queue_head_t *wq;
 };
 
@@ -413,7 +413,7 @@ static void ep_poll_safewake(struct poll_safewake *psw, wait_queue_head_t *wq)
 {
        int wake_nests = 0;
        unsigned long flags;
-       task_t *this_task = current;
+       struct task_struct *this_task = current;
        struct list_head *lsthead = &psw->wake_task_list, *lnk;
        struct wake_task_node *tncur;
        struct wake_task_node tnode;
index c8494f513eaf578ce674e74219597f7d6f6b47ec..8344ba73a2a670d37d2b08a2587e149490f87eaa 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -22,7 +22,6 @@
  * formats. 
  */
 
-#include <linux/config.h>
 #include <linux/slab.h>
 #include <linux/file.h>
 #include <linux/mman.h>
index 433a213a8bd9450f7f1ab3e7926002217d6cf1f9..d4870432ecfc9be0d6d3b35807a57501c2d517f6 100644 (file)
@@ -11,7 +11,6 @@
  *        David S. Miller (davem@caip.rutgers.edu), 1995
  */
 
-#include <linux/config.h>
 #include "ext2.h"
 #include <linux/quotaops.h>
 #include <linux/sched.h>
index 308c252568c6ed131a74377a0ebf9e2262002037..de85c61c58c57548cd302ebace431b29bfee8241 100644 (file)
@@ -12,7 +12,6 @@
  *        David S. Miller (davem@caip.rutgers.edu), 1995
  */
 
-#include <linux/config.h>
 #include <linux/quotaops.h>
 #include <linux/sched.h>
 #include <linux/backing-dev.h>
index d4233b2e6436ec3926110bb7c5160060ba6dd239..f2702cda977981673264f96c33f8d974545d9694 100644 (file)
@@ -16,7 +16,6 @@
  *        David S. Miller (davem@caip.rutgers.edu), 1995
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/fs.h>
@@ -1158,7 +1157,7 @@ static ssize_t ext2_quota_write(struct super_block *sb, int type,
        struct buffer_head tmp_bh;
        struct buffer_head *bh;
 
-       mutex_lock(&inode->i_mutex);
+       mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA);
        while (towrite > 0) {
                tocopy = sb->s_blocksize - offset < towrite ?
                                sb->s_blocksize - offset : towrite;
index 67cfeb66e897328869b1a34fb1c709b2aa356779..bf8175b2ced95ed1cb69ed541f76437dbe2f29f0 100644 (file)
@@ -6,7 +6,6 @@
   (C) 2001 Andreas Gruenbacher, <a.gruenbacher@computer.org>
 */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/xattr.h>
 
index 96172e89ddc3ca945eb959db272658fef495e479..a504a40d6d2944206f081ef3beacef1df84f244f 100644 (file)
@@ -11,7 +11,6 @@
  *        David S. Miller (davem@caip.rutgers.edu), 1995
  */
 
-#include <linux/config.h>
 #include <linux/time.h>
 #include <linux/capability.h>
 #include <linux/fs.h>
index dfd811895d8f4564e8a2781c4786132fa1e96eba..5e1337fd878a93c4bbd079e3daea0bf3c2d8ec3d 100644 (file)
@@ -8,7 +8,6 @@
  * This could probably be made into a module, because it is not often in use.
  */
 
-#include <linux/config.h>
 
 #define EXT3FS_DEBUG
 
index b7483360a2db4ab49b796d370d0089b23c6d95f8..813d589cc6c0d4b736e0bffd36f012ef41343853 100644 (file)
@@ -16,7 +16,6 @@
  *        David S. Miller (davem@caip.rutgers.edu), 1995
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/fs.h>
@@ -2615,7 +2614,7 @@ static ssize_t ext3_quota_write(struct super_block *sb, int type,
        struct buffer_head *bh;
        handle_t *handle = journal_current_handle();
 
-       mutex_lock(&inode->i_mutex);
+       mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA);
        while (towrite > 0) {
                tocopy = sb->s_blocksize - offset < towrite ?
                                sb->s_blocksize - offset : towrite;
index 2ceae38f3d49726293f36997cb5b514a7d05bc2e..6b1ae1c6182c04bf43173a941b422b9f93d29335 100644 (file)
@@ -6,7 +6,6 @@
   (C) 2001 Andreas Gruenbacher, <a.gruenbacher@computer.org>
 */
 
-#include <linux/config.h>
 #include <linux/xattr.h>
 
 /* Magic value in attribute blocks */
index 506d5307108d71be668f4c00d25960c9d7528307..0131ba06e1ee48bc9714805efa8b15a11a21edcc 100644 (file)
@@ -5,7 +5,6 @@
  *  Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
  */
 
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/slab.h>
 #include <linux/file.h>
index 031b27a4bc9a170a9436f73353e10864fe78d5d1..892643dc9af10a1a6fbf7c858fd430ab209a5724 100644 (file)
@@ -464,8 +464,8 @@ void sync_inodes_sb(struct super_block *sb, int wait)
                .range_start    = 0,
                .range_end      = LLONG_MAX,
        };
-       unsigned long nr_dirty = read_page_state(nr_dirty);
-       unsigned long nr_unstable = read_page_state(nr_unstable);
+       unsigned long nr_dirty = global_page_state(NR_FILE_DIRTY);
+       unsigned long nr_unstable = global_page_state(NR_UNSTABLE_NFS);
 
        wbc.nr_to_write = nr_dirty + nr_unstable +
                        (inodes_stat.nr_inodes - inodes_stat.nr_unused) +
index d9227bf14e86b2a93cee03e9ef2482c30cc4d2b8..34937ee83ab1052d2510d1ead5d3ca9fdf78af63 100644 (file)
@@ -12,7 +12,6 @@
  * Based on the minix file system code, (C) 1991, 1992 by Linus Torvalds
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/blkdev.h>
 #include <linux/mount.h>
index 0a92fa2336a2dd3bd88172f5aeb9e958fcd800b8..d279d5924f2857338815f9637567bad248f5a45e 100644 (file)
@@ -7,7 +7,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/pagemap.h>
index f42961eb983b476f66e591939e42450eb64641d0..0bf9f0444a964bb5398e50a533a5a942eb701eae 100644 (file)
@@ -4,7 +4,6 @@
  * (C) 1997 Linus Torvalds
  */
 
-#include <linux/config.h>
 #include <linux/fs.h>
 #include <linux/mm.h>
 #include <linux/dcache.h>
@@ -452,15 +451,14 @@ static void prune_icache(int nr_to_scan)
                nr_pruned++;
        }
        inodes_stat.nr_unused -= nr_pruned;
+       if (current_is_kswapd())
+               __count_vm_events(KSWAPD_INODESTEAL, reap);
+       else
+               __count_vm_events(PGINODESTEAL, reap);
        spin_unlock(&inode_lock);
 
        dispose_list(&freeable);
        mutex_unlock(&iprune_mutex);
-
-       if (current_is_kswapd())
-               mod_page_state(kswapd_inodesteal, reap);
-       else
-               mod_page_state(pginodesteal, reap);
 }
 
 /*
index f8aeec3ca10c20985146e292023e5554b2290765..4b7660b09ac0679cd79481bc14727dbd4888eeb5 100644 (file)
@@ -4,7 +4,6 @@
  *  Copyright (C) 1991, 1992  Linus Torvalds
  */
 
-#include <linux/config.h>
 #include <linux/syscalls.h>
 #include <linux/mm.h>
 #include <linux/smp_lock.h>
index 7fa76ed53c10333cfd703c97eb1fb25669985e12..93aa5715f224cd5163e070473dc04e6d76409667 100644 (file)
@@ -125,11 +125,24 @@ asmlinkage long sys_ioprio_set(int which, int who, int ioprio)
        return ret;
 }
 
+static int get_task_ioprio(struct task_struct *p)
+{
+       int ret;
+
+       ret = security_task_getioprio(p);
+       if (ret)
+               goto out;
+       ret = p->ioprio;
+out:
+       return ret;
+}
+
 asmlinkage long sys_ioprio_get(int which, int who)
 {
        struct task_struct *g, *p;
        struct user_struct *user;
        int ret = -ESRCH;
+       int tmpio;
 
        read_lock_irq(&tasklist_lock);
        switch (which) {
@@ -139,16 +152,19 @@ asmlinkage long sys_ioprio_get(int which, int who)
                        else
                                p = find_task_by_pid(who);
                        if (p)
-                               ret = p->ioprio;
+                               ret = get_task_ioprio(p);
                        break;
                case IOPRIO_WHO_PGRP:
                        if (!who)
                                who = process_group(current);
                        do_each_task_pid(who, PIDTYPE_PGID, p) {
+                               tmpio = get_task_ioprio(p);
+                               if (tmpio < 0)
+                                       continue;
                                if (ret == -ESRCH)
-                                       ret = p->ioprio;
+                                       ret = tmpio;
                                else
-                                       ret = ioprio_best(ret, p->ioprio);
+                                       ret = ioprio_best(ret, tmpio);
                        } while_each_task_pid(who, PIDTYPE_PGID, p);
                        break;
                case IOPRIO_WHO_USER:
@@ -163,10 +179,13 @@ asmlinkage long sys_ioprio_get(int which, int who)
                        do_each_thread(g, p) {
                                if (p->uid != user->uid)
                                        continue;
+                               tmpio = get_task_ioprio(p);
+                               if (tmpio < 0)
+                                       continue;
                                if (ret == -ESRCH)
-                                       ret = p->ioprio;
+                                       ret = tmpio;
                                else
-                                       ret = ioprio_best(ret, p->ioprio);
+                                       ret = ioprio_best(ret, tmpio);
                        } while_each_thread(g, p);
 
                        if (who)
index 3a39158cca964384e12d73bdbf9b4f7b84c645c6..731816332b12b5a310623fbc85134710714ddd41 100644 (file)
@@ -16,7 +16,6 @@
  * Transparent decompression of files on an iso9660 filesystem
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 
index 5440ea292c6964678ce6038db108633d69363962..27e276987fd2705536e3ea2e00e530f12cbfbe48 100644 (file)
@@ -10,7 +10,6 @@
  * 
  *  isofs directory handling functions
  */
-#include <linux/config.h>
 #include <linux/smp_lock.h>
 #include "isofs.h"
 
index bb11c7fb4019b4c8c1a860f661e704158d8a1321..14391361c8863b63e21fb87f5c2351d752ebcc10 100644 (file)
@@ -11,7 +11,6 @@
  *     2004  Paul Serice - NFS Export Operations
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 
index 5371a403130ae2b95900bc51864e54abc0e7e4df..9000f1effedf9523991c5692f0c61238e1645809 100644 (file)
@@ -55,7 +55,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/slab.h>
 #include <linux/jffs.h>
index c794d923df2ae46d1365c940f4bfa2d00968cbe6..9ee6ad29eff5de856f5401464346a5b110324bc3 100644 (file)
@@ -20,7 +20,6 @@
 #ifndef __LINUX_JFFS_FM_H__
 #define __LINUX_JFFS_FM_H__
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/jffs.h>
 #include <linux/mtd/mtd.h>
index 9c2077e7e081c7375b3df564fa1b8e3b6e2d4722..0ae3cd10702c06be9b14203872ba6cfe110f0ecb 100644 (file)
@@ -345,10 +345,8 @@ int jffs2_init_acl(struct inode *inode, struct inode *dir)
        return rc;
 }
 
-void jffs2_clear_acl(struct inode *inode)
+void jffs2_clear_acl(struct jffs2_inode_info *f)
 {
-       struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode);
-
        if (f->i_acl_access && f->i_acl_access != JFFS2_ACL_NOT_CACHED) {
                posix_acl_release(f->i_acl_access);
                f->i_acl_access = JFFS2_ACL_NOT_CACHED;
index 8893bd1a6ba7be45bdb17faeb65e7b0606575fb9..fa327dbd31714a498d22d242289ceb5e0a2e2f71 100644 (file)
@@ -30,7 +30,7 @@ struct jffs2_acl_header {
 extern int jffs2_permission(struct inode *, int, struct nameidata *);
 extern int jffs2_acl_chmod(struct inode *);
 extern int jffs2_init_acl(struct inode *, struct inode *);
-extern void jffs2_clear_acl(struct inode *);
+extern void jffs2_clear_acl(struct jffs2_inode_info *);
 
 extern struct xattr_handler jffs2_acl_access_xattr_handler;
 extern struct xattr_handler jffs2_acl_default_xattr_handler;
@@ -40,6 +40,6 @@ extern struct xattr_handler jffs2_acl_default_xattr_handler;
 #define jffs2_permission NULL
 #define jffs2_acl_chmod(inode)         (0)
 #define jffs2_init_acl(inode,dir)      (0)
-#define jffs2_clear_acl(inode)
+#define jffs2_clear_acl(f)
 
 #endif /* CONFIG_JFFS2_FS_POSIX_ACL */
index 5c63e0cdcf4c76cb98cbc86e8fae3720023f2439..3681d0728ac7901f2179534ebec0f4d9c88afcf8 100644 (file)
@@ -15,7 +15,6 @@
 #error "The userspace support got too messy and was removed. Update your mkfs.jffs2"
 #endif
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
index 5fa494a792b2ab69cd66b1050620b9ccaee91108..3daf3bca03767050d1580f6731996e1aaa4d6e6f 100644 (file)
@@ -13,7 +13,6 @@
 #ifndef _JFFS2_DEBUG_H_
 #define _JFFS2_DEBUG_H_
 
-#include <linux/config.h>
 
 #ifndef CONFIG_JFFS2_FS_DEBUG
 #define CONFIG_JFFS2_FS_DEBUG 0
index 97caa77d60cf23db5ce8dc98848780e2a1caf49c..4780f82825d6fc3bbea2562b0ab245c40088625f 100644 (file)
@@ -12,7 +12,6 @@
  */
 
 #include <linux/capability.h>
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/fs.h>
index 8310c95478e9201dfbe2422bb640340aa1c32e90..33f291005012bedf622daaaaa4ebf5f77655d2a1 100644 (file)
@@ -190,7 +190,7 @@ void jffs2_free_tmp_dnode_info(struct jffs2_tmp_dnode_info *x)
        kmem_cache_free(tmp_dnode_info_slab, x);
 }
 
-struct jffs2_raw_node_ref *jffs2_alloc_refblock(void)
+static struct jffs2_raw_node_ref *jffs2_alloc_refblock(void)
 {
        struct jffs2_raw_node_ref *ret;
 
index b16c60bbcf6ed191d1ab2c08f75fe0b9dded1ec5..cae92c14116dc76de6e7ab53fc53a7ea4bc1606a 100644 (file)
@@ -14,7 +14,6 @@
 #ifndef __JFFS2_NODELIST_H__
 #define __JFFS2_NODELIST_H__
 
-#include <linux/config.h>
 #include <linux/fs.h>
 #include <linux/types.h>
 #include <linux/jffs2.h>
@@ -427,8 +426,6 @@ char *jffs2_getlink(struct jffs2_sb_info *c, struct jffs2_inode_info *f);
 /* scan.c */
 int jffs2_scan_medium(struct jffs2_sb_info *c);
 void jffs2_rotate_lists(struct jffs2_sb_info *c);
-int jffs2_fill_scan_buf(struct jffs2_sb_info *c, void *buf,
-                               uint32_t ofs, uint32_t len);
 struct jffs2_inode_cache *jffs2_scan_make_ino_cache(struct jffs2_sb_info *c, uint32_t ino);
 int jffs2_scan_classify_jeb(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
 int jffs2_scan_dirty_space(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, uint32_t size);
index cc1899268c439a0c68e8bc877c6f4c56854bd3ba..266423b2709d04be8709164b0dacdbbebc4f22b8 100644 (file)
@@ -968,6 +968,7 @@ void jffs2_do_clear_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f)
        struct jffs2_full_dirent *fd, *fds;
        int deleted;
 
+       jffs2_clear_acl(f);
        jffs2_xattr_delete_inode(c, f->inocache);
        down(&f->sem);
        deleted = f->inocache && !f->inocache->nlink;
index 2bfdc33752d38c69c959729d5d9f462882ef54f6..e2413466ddd5ac34d54f580769667111c64b8414 100644 (file)
@@ -274,8 +274,8 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
        return ret;
 }
 
-int jffs2_fill_scan_buf (struct jffs2_sb_info *c, void *buf,
-                               uint32_t ofs, uint32_t len)
+static int jffs2_fill_scan_buf(struct jffs2_sb_info *c, void *buf,
+                              uint32_t ofs, uint32_t len)
 {
        int ret;
        size_t retlen;
index 2378a662c2561660e10a592937f771bf74d8241e..68e3953419b4324504cbe8723a9b62e1cb48b3da 100644 (file)
@@ -11,7 +11,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/slab.h>
index 18e66dbf23b497d456a191c75c9d7cb1b52edd65..25bc1ae0864843adc7024721262d2932cde4ce73 100644 (file)
  *   is used to write xdatum to medium. xd->version will be incremented.
  * create_xattr_datum(c, xprefix, xname, xvalue, xsize)
  *   is used to create new xdatum and write to medium.
- * delete_xattr_datum(c, xd)
- *   is used to delete a xdatum. It marks xd JFFS2_XFLAGS_DEAD, and allows
- *   GC to reclaim those physical nodes.
+ * unrefer_xattr_datum(c, xd)
+ *   is used to delete a xdatum. When nobody refers this xdatum, JFFS2_XFLAGS_DEAD
+ *   is set on xd->flags and chained xattr_dead_list or release it immediately.
+ *   In the first case, the garbage collector release it later.
  * -------------------------------------------------- */
 static uint32_t xattr_datum_hashkey(int xprefix, const char *xname, const char *xvalue, int xsize)
 {
@@ -394,22 +395,24 @@ static struct jffs2_xattr_datum *create_xattr_datum(struct jffs2_sb_info *c,
        return xd;
 }
 
-static void delete_xattr_datum(struct jffs2_sb_info *c, struct jffs2_xattr_datum *xd)
+static void unrefer_xattr_datum(struct jffs2_sb_info *c, struct jffs2_xattr_datum *xd)
 {
        /* must be called under down_write(xattr_sem) */
-       BUG_ON(atomic_read(&xd->refcnt));
+       if (atomic_dec_and_lock(&xd->refcnt, &c->erase_completion_lock)) {
+               uint32_t xid = xd->xid, version = xd->version;
 
-       unload_xattr_datum(c, xd);
-       xd->flags |= JFFS2_XFLAGS_DEAD;
-       spin_lock(&c->erase_completion_lock);
-       if (xd->node == (void *)xd) {
-               BUG_ON(!(xd->flags & JFFS2_XFLAGS_INVALID));
-               jffs2_free_xattr_datum(xd);
-       } else {
-               list_add(&xd->xindex, &c->xattr_dead_list);
+               unload_xattr_datum(c, xd);
+               xd->flags |= JFFS2_XFLAGS_DEAD;
+               if (xd->node == (void *)xd) {
+                       BUG_ON(!(xd->flags & JFFS2_XFLAGS_INVALID));
+                       jffs2_free_xattr_datum(xd);
+               } else {
+                       list_add(&xd->xindex, &c->xattr_dead_list);
+               }
+               spin_unlock(&c->erase_completion_lock);
+
+               dbg_xattr("xdatum(xid=%u, version=%u) was removed.\n", xid, version);
        }
-       spin_unlock(&c->erase_completion_lock);
-       dbg_xattr("xdatum(xid=%u, version=%u) was removed.\n", xd->xid, xd->version);
 }
 
 /* -------- xref related functions ------------------
@@ -580,8 +583,7 @@ static void delete_xattr_ref(struct jffs2_sb_info *c, struct jffs2_xattr_ref *re
        dbg_xattr("xref(ino=%u, xid=%u, xseqno=%u) was removed.\n",
                  ref->ino, ref->xid, ref->xseqno);
 
-       if (atomic_dec_and_test(&xd->refcnt))
-               delete_xattr_datum(c, xd);
+       unrefer_xattr_datum(c, xd);
 }
 
 void jffs2_xattr_delete_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic)
@@ -1119,8 +1121,7 @@ int do_jffs2_setxattr(struct inode *inode, int xprefix, const char *xname,
                                        ref->next = c->xref_dead_list;
                                        c->xref_dead_list = ref;
                                        spin_unlock(&c->erase_completion_lock);
-                                       if (atomic_dec_and_test(&xd->refcnt))
-                                               delete_xattr_datum(c, xd);
+                                       unrefer_xattr_datum(c, xd);
                                } else {
                                        ref->ic = ic;
                                        ref->xd = xd;
@@ -1156,8 +1157,7 @@ int do_jffs2_setxattr(struct inode *inode, int xprefix, const char *xname,
        down_write(&c->xattr_sem);
        if (rc) {
                JFFS2_WARNING("jffs2_reserve_space()=%d, request=%u\n", rc, request);
-               if (atomic_dec_and_test(&xd->refcnt))
-                       delete_xattr_datum(c, xd);
+               unrefer_xattr_datum(c, xd);
                up_write(&c->xattr_sem);
                return rc;
        }
@@ -1170,8 +1170,7 @@ int do_jffs2_setxattr(struct inode *inode, int xprefix, const char *xname,
                        ic->xref = ref;
                }
                rc = PTR_ERR(newref);
-               if (atomic_dec_and_test(&xd->refcnt))
-                       delete_xattr_datum(c, xd);
+               unrefer_xattr_datum(c, xd);
        } else if (ref) {
                delete_xattr_ref(c, ref);
        }
index ac3d66948e8ceae440e77d944bd2667f9a9e8e76..10c46231ce15c86bd2832c8fb838610368d558c2 100644 (file)
@@ -842,7 +842,7 @@ struct tlock *txLock(tid_t tid, struct inode *ip, struct metapage * mp,
        TXN_UNLOCK();
        release_metapage(mp);
        TXN_LOCK();
-       xtid = tlck->tid;       /* reaquire after dropping TXN_LOCK */
+       xtid = tlck->tid;       /* reacquire after dropping TXN_LOCK */
 
        jfs_info("txLock: in waitLock, tid = %d, xtid = %d, lid = %d",
                 tid, xtid, lid);
index 73d2aba084c62e09d8b1d85f3347ec8e32eae952..4f6cfebc82dbed167db0e5350613aec969f62f8e 100644 (file)
@@ -18,7 +18,6 @@
  */
 
 #include <linux/fs.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/parser.h>
 #include <linux/completion.h>
index 4db62098d3f42da5093747b70077c97c556290c8..5980c45998cc371332085f78abcd467452c41cc0 100644 (file)
@@ -6,7 +6,6 @@
  * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/errno.h>
index fd56c8872f3444297aebef53fe3272db18189dba..9a991b52c647d7614cb014100c73b1124751b517 100644 (file)
@@ -12,7 +12,6 @@
  * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/sysctl.h>
index 3ef739120dff32b1a772514be25167e546b7d3af..baf5ae513481f97ade8d76d73a2079dcdfe5dc58 100644 (file)
@@ -20,7 +20,6 @@
  * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
index d210cf304e922f3f2eca906f0ec025cf2832f865..dbb66a3b5cd97ddd49f0b83a71fa177f31b8ec04 100644 (file)
@@ -7,7 +7,6 @@
  * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/time.h>
 #include <linux/slab.h>
index a570e5c8a930fe6525d8c65e96ebb32f285fbc83..2a4df9b3779a154d0a2c9c0a43b87295c9a3b808 100644 (file)
@@ -6,7 +6,6 @@
  * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/string.h>
 #include <linux/time.h>
index f22a3764461a365981a29cbe0db61d4d92a97363..033ea4ac2c30be2590f36103d9f2f1fe4dd7023a 100644 (file)
@@ -6,7 +6,6 @@
  * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/sched.h>
 #include <linux/utsname.h>
index c784e8bb57a35c6fa272ece7303095887ef65e8a..c9750d755aff63e8d4b5e3774998c5ff93cd22e7 100644 (file)
@@ -1423,7 +1423,7 @@ struct dentry *lock_rename(struct dentry *p1, struct dentry *p2)
        struct dentry *p;
 
        if (p1 == p2) {
-               mutex_lock(&p1->d_inode->i_mutex);
+               mutex_lock_nested(&p1->d_inode->i_mutex, I_MUTEX_PARENT);
                return NULL;
        }
 
@@ -1431,22 +1431,22 @@ struct dentry *lock_rename(struct dentry *p1, struct dentry *p2)
 
        for (p = p1; p->d_parent != p; p = p->d_parent) {
                if (p->d_parent == p2) {
-                       mutex_lock(&p2->d_inode->i_mutex);
-                       mutex_lock(&p1->d_inode->i_mutex);
+                       mutex_lock_nested(&p2->d_inode->i_mutex, I_MUTEX_PARENT);
+                       mutex_lock_nested(&p1->d_inode->i_mutex, I_MUTEX_CHILD);
                        return p;
                }
        }
 
        for (p = p2; p->d_parent != p; p = p->d_parent) {
                if (p->d_parent == p1) {
-                       mutex_lock(&p1->d_inode->i_mutex);
-                       mutex_lock(&p2->d_inode->i_mutex);
+                       mutex_lock_nested(&p1->d_inode->i_mutex, I_MUTEX_PARENT);
+                       mutex_lock_nested(&p2->d_inode->i_mutex, I_MUTEX_CHILD);
                        return p;
                }
        }
 
-       mutex_lock(&p1->d_inode->i_mutex);
-       mutex_lock(&p2->d_inode->i_mutex);
+       mutex_lock_nested(&p1->d_inode->i_mutex, I_MUTEX_PARENT);
+       mutex_lock_nested(&p2->d_inode->i_mutex, I_MUTEX_CHILD);
        return NULL;
 }
 
@@ -1751,7 +1751,7 @@ struct dentry *lookup_create(struct nameidata *nd, int is_dir)
 {
        struct dentry *dentry = ERR_PTR(-EEXIST);
 
-       mutex_lock(&nd->dentry->d_inode->i_mutex);
+       mutex_lock_nested(&nd->dentry->d_inode->i_mutex, I_MUTEX_PARENT);
        /*
         * Yucky last component or no last component at all?
         * (foo/., foo/.., /////)
@@ -2008,7 +2008,7 @@ static long do_rmdir(int dfd, const char __user *pathname)
                        error = -EBUSY;
                        goto exit1;
        }
-       mutex_lock(&nd.dentry->d_inode->i_mutex);
+       mutex_lock_nested(&nd.dentry->d_inode->i_mutex, I_MUTEX_PARENT);
        dentry = lookup_hash(&nd);
        error = PTR_ERR(dentry);
        if (!IS_ERR(dentry)) {
@@ -2082,7 +2082,7 @@ static long do_unlinkat(int dfd, const char __user *pathname)
        error = -EISDIR;
        if (nd.last_type != LAST_NORM)
                goto exit1;
-       mutex_lock(&nd.dentry->d_inode->i_mutex);
+       mutex_lock_nested(&nd.dentry->d_inode->i_mutex, I_MUTEX_PARENT);
        dentry = lookup_hash(&nd);
        error = PTR_ERR(dentry);
        if (!IS_ERR(dentry)) {
index b3ed212ea416f4686b1c5da0e37895d42bfa677e..fa7ed6a9fc2d2cf79a2633f8f6834311f8051be3 100644 (file)
@@ -8,7 +8,6 @@
  * Heavily rewritten.
  */
 
-#include <linux/config.h>
 #include <linux/syscalls.h>
 #include <linux/slab.h>
 #include <linux/sched.h>
index f0860c602d8bbcc14b51b1d7c96732653bed890c..b4ee89250e952047c20ec8f8d33919089bae46ab 100644 (file)
@@ -10,7 +10,6 @@
  *
  */
 
-#include <linux/config.h>
 
 #include <linux/time.h>
 #include <linux/errno.h>
index 6c51c1198464efff9de569e5c98228b93206cf94..1ddf77b0b825d08282944604e582b78244852704 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <asm/system.h>
index eb3813ad136f192e5c0a7551eefc8cd417d09fb3..42039fe0653c0c3afc546748e060b005ca882fd8 100644 (file)
@@ -7,7 +7,6 @@
  *
  */
 
-#include <linux/config.h>
 
 #include <asm/uaccess.h>
 #include <linux/capability.h>
index 52d60c3d8996210dac419106b1dc7862a6fb8856..e7d5a3097fe60d2ff05dc4d0a1fc28ba9683d867 100644 (file)
@@ -93,7 +93,7 @@ static struct page* ncp_file_mmap_nopage(struct vm_area_struct *area,
         */
        if (type)
                *type = VM_FAULT_MAJOR;
-       inc_page_state(pgmajfault);
+       count_vm_event(PGMAJFAULT);
        return page;
 }
 
index d9ebf6439f59a29793c7041adf0ff49915020e50..551e0bac7aac6fd20476b844c8929e0116002f77 100644 (file)
@@ -10,7 +10,6 @@
  */
 
 
-#include <linux/config.h>
 
 #include "ncplib_kernel.h"
 
index 799e5c2bec55bf7d1f401e2b207d2c1e96e5d312..2441d1ab57dc57abe66ba24126b3b9221b1692bc 100644 (file)
@@ -12,7 +12,6 @@
 #ifndef _NCPLIB_H
 #define _NCPLIB_H
 
-#include <linux/config.h>
 
 #include <linux/fs.h>
 #include <linux/types.h>
index a6ec90cd8894b7ef58372d2b5174808375ae3e25..749a18d33599cb456fe8d1f06360de38e25a1fd6 100644 (file)
@@ -5,7 +5,6 @@
  *
  */
 
-#include <linux/config.h>
 
 #ifdef CONFIG_NCPFS_PACKET_SIGNING
 
index 8783eb7ec6412915f1141c4fb88c162ecf01cbb7..11c2b252ebedd9f63f5da6b5f8d2003bd1baccfa 100644 (file)
@@ -8,7 +8,6 @@
  *
  */
 
-#include <linux/config.h>
 
 #include <linux/time.h>
 #include <linux/errno.h>
index f76b1392a012cbc291de7284437d862dc0c7a253..ca92c240663564c319627de827c58deed0a635ea 100644 (file)
@@ -20,7 +20,6 @@
  *
  */
 
-#include <linux/config.h>
 
 #include <asm/uaccess.h>
 
index d53f8c6a9ecb5483fe0467404d92e895acba5a75..fe0a6b8ac149cbb5cfb5808343948f44990fb752 100644 (file)
@@ -6,7 +6,6 @@
  * NFSv4 callback handling
  */
 
-#include <linux/config.h>
 #include <linux/completion.h>
 #include <linux/ip.h>
 #include <linux/module.h>
index 462cfceb50c508574378fd83d587112a89419809..7719483ecdfc0827171f1a8a8fd5b8a4aef42ba2 100644 (file)
@@ -5,7 +5,6 @@
  *
  * NFSv4 callback procedures
  */
-#include <linux/config.h>
 #include <linux/nfs4.h>
 #include <linux/nfs_fs.h>
 #include "nfs4_fs.h"
index c92991328d9a157bd503ed77fd0f4e2f71fbf29d..29f932192054004c6b0859fdacf89c530cab5a60 100644 (file)
@@ -5,7 +5,6 @@
  *
  * NFSv4 callback encode/decode procedures
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sunrpc/svc.h>
 #include <linux/nfs4.h>
index d3be923d4e437651ae4c6eadade69ec125e71d0e..9540a316c05e6e103a64cffd3dad567a170fbddb 100644 (file)
@@ -6,7 +6,6 @@
  * NFS file delegation management
  *
  */
-#include <linux/config.h>
 #include <linux/completion.h>
 #include <linux/kthread.h>
 #include <linux/module.h>
index 8ca9707be6c9d06f28a843fbe6282afd1d405e77..4cdd1b499e3566d1f31821c2fe776349d64a5bb0 100644 (file)
@@ -38,7 +38,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index c5b916605fb012b856bdee1c5cc8c8b4d9a8c81a..d349fb2245da4dabe1c44ecd8700e2c90112e8ae 100644 (file)
@@ -13,7 +13,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 
index 4fe51c1292bb763918cd885c0df1ba093fccd80e..e4f4e5def0fcc095edd2d3c3e32adfd41dac6428 100644 (file)
@@ -81,9 +81,9 @@ extern struct file_system_type clone_nfs_fs_type;
 #ifdef CONFIG_NFS_V4
 extern struct file_system_type clone_nfs4_fs_type;
 #endif
-#ifdef CONFIG_PROC_FS
+
 extern struct rpc_stat nfs_rpcstat;
-#endif
+
 extern int __init register_nfs_fs(void);
 extern void __exit unregister_nfs_fs(void);
 
index 96e5b82c153b7f688331549de5fb6c6e16b7a65a..090a36b07a2231a966eb01d3af19fe59d68b43e6 100644 (file)
@@ -38,7 +38,6 @@
  * subsequent patch.
  */
 
-#include <linux/config.h>
 #include <linux/slab.h>
 #include <linux/smp_lock.h>
 #include <linux/nfs_fs.h>
index d89f6fb3b3a3517fea9679caec85982584ad7d81..36e902a88ca1b92bd9e81cee86317fa18a427d63 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/slab.h>
 #include <linux/file.h>
 #include <linux/sunrpc/clnt.h>
@@ -315,6 +314,7 @@ nfs_scan_lock_dirty(struct nfs_inode *nfsi, struct list_head *dst,
                                                req->wb_index, NFS_PAGE_TAG_DIRTY);
                                nfs_list_remove_request(req);
                                nfs_list_add_request(req, dst);
+                               dec_zone_page_state(req->wb_page, NR_FILE_DIRTY);
                                res++;
                        }
                }
index 32cf3773af0cdc0a21b41363e6ddc34c7a40bff2..52bf634260a11c162cd7b5a8859782ff5924a1bd 100644 (file)
@@ -15,7 +15,6 @@
  * within the RPC code when root squashing is suspected.
  */
 
-#include <linux/config.h>
 #include <linux/time.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index db61e51bb154747a949e63788c7bdd3e9765ffd2..2fe3403c24094bce4973b0f1b52b2cc26e760f0a 100644 (file)
@@ -3,7 +3,6 @@
  *
  * Sysctl interface to NFS parameters
  */
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/linkage.h>
 #include <linux/ctype.h>
index 8fccb9cb173ba9588c6f8946ba69cc67485659c2..bca5734ca9fb524f02ce80d814512c0fbbc7e2fe 100644 (file)
@@ -46,7 +46,6 @@
  * Copyright (C) 1996, 1997, Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/slab.h>
 #include <linux/mm.h>
@@ -497,7 +496,7 @@ nfs_mark_request_dirty(struct nfs_page *req)
        nfs_list_add_request(req, &nfsi->dirty);
        nfsi->ndirty++;
        spin_unlock(&nfsi->req_lock);
-       inc_page_state(nr_dirty);
+       inc_zone_page_state(req->wb_page, NR_FILE_DIRTY);
        mark_inode_dirty(inode);
 }
 
@@ -525,7 +524,7 @@ nfs_mark_request_commit(struct nfs_page *req)
        nfs_list_add_request(req, &nfsi->commit);
        nfsi->ncommit++;
        spin_unlock(&nfsi->req_lock);
-       inc_page_state(nr_unstable);
+       inc_zone_page_state(req->wb_page, NR_UNSTABLE_NFS);
        mark_inode_dirty(inode);
 }
 #endif
@@ -609,7 +608,6 @@ nfs_scan_dirty(struct inode *inode, struct list_head *dst, unsigned long idx_sta
        if (nfsi->ndirty != 0) {
                res = nfs_scan_lock_dirty(nfsi, dst, idx_start, npages);
                nfsi->ndirty -= res;
-               sub_page_state(nr_dirty,res);
                if ((nfsi->ndirty == 0) != list_empty(&nfsi->dirty))
                        printk(KERN_ERR "NFS: desynchronized value of nfs_i.ndirty.\n");
        }
@@ -1394,7 +1392,6 @@ static void nfs_commit_done(struct rpc_task *task, void *calldata)
 {
        struct nfs_write_data   *data = calldata;
        struct nfs_page         *req;
-       int res = 0;
 
         dprintk("NFS: %4d nfs_commit_done (status %d)\n",
                                 task->tk_pid, task->tk_status);
@@ -1406,6 +1403,7 @@ static void nfs_commit_done(struct rpc_task *task, void *calldata)
        while (!list_empty(&data->pages)) {
                req = nfs_list_entry(data->pages.next);
                nfs_list_remove_request(req);
+               dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS);
 
                dprintk("NFS: commit (%s/%Ld %d@%Ld)",
                        req->wb_context->dentry->d_inode->i_sb->s_id,
@@ -1432,9 +1430,7 @@ static void nfs_commit_done(struct rpc_task *task, void *calldata)
                nfs_mark_request_dirty(req);
        next:
                nfs_clear_page_writeback(req);
-               res++;
        }
-       sub_page_state(nr_unstable,res);
 }
 
 static const struct rpc_call_ops nfs_commit_ops = {
index a5a18d4aca40a89661ac5dc219c5041e83ac75bb..c043136a82caa862d9b72d7196047765490064a0 100644 (file)
@@ -4,7 +4,6 @@
  *     This should eventually move to userland.
  *
  */
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/file.h>
 #include <linux/fs.h>
index 3eec30000f3fb3955e029283e8a26bee184b66ba..01bc68c628ad16b92f84ce183e9cf908e09511c3 100644 (file)
@@ -126,7 +126,7 @@ static int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
        if (*ep)
                goto out;
        dprintk("found fsidtype %d\n", fsidtype);
-       if (fsidtype > 2)
+       if (key_len(fsidtype)==0) /* invalid type */
                goto out;
        if ((len=qword_get(&mesg, buf, PAGE_SIZE)) <= 0)
                goto out;
index dbaf3f93f3283f45e431e788aa23733f5c34b8b3..54b37b1d2e3a90576c5bddd3f24898dd316cd059 100644 (file)
@@ -33,7 +33,6 @@
  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/list.h>
 #include <linux/inet.h>
index 4b6aa60dfcebf81956fcd83cd34eb9f87967780f..bea6b94781145e7707c59dcaaaabf4cb98ea8a3f 100644 (file)
@@ -34,7 +34,6 @@
  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 
index 7c7d01672d35a4dc47bbd5ca5d059adcdc1c6598..9daa0b9feb8d027e438ef39c846daee95cf2d6cf 100644 (file)
@@ -1237,8 +1237,15 @@ find_file(struct inode *ino)
        return NULL;
 }
 
-#define TEST_ACCESS(x) ((x > 0 || x < 4)?1:0)
-#define TEST_DENY(x) ((x >= 0 || x < 5)?1:0)
+static int access_valid(u32 x)
+{
+       return (x > 0 && x < 4);
+}
+
+static int deny_valid(u32 x)
+{
+       return (x >= 0 && x < 5);
+}
 
 static void
 set_access(unsigned int *access, unsigned long bmap) {
@@ -1745,7 +1752,8 @@ nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nf
        int status;
 
        status = nfserr_inval;
-       if (!TEST_ACCESS(open->op_share_access) || !TEST_DENY(open->op_share_deny))
+       if (!access_valid(open->op_share_access)
+                       || !deny_valid(open->op_share_deny))
                goto out;
        /*
         * Lookup file; if found, lookup stateid and check open request,
@@ -1782,10 +1790,10 @@ nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nf
        } else {
                /* Stateid was not found, this is a new OPEN */
                int flags = 0;
+               if (open->op_share_access & NFS4_SHARE_ACCESS_READ)
+                       flags |= MAY_READ;
                if (open->op_share_access & NFS4_SHARE_ACCESS_WRITE)
-                       flags = MAY_WRITE;
-               else
-                       flags = MAY_READ;
+                       flags |= MAY_WRITE;
                status = nfs4_new_open(rqstp, &stp, dp, current_fh, flags);
                if (status)
                        goto out;
@@ -2070,16 +2078,12 @@ nfs4_preprocess_stateid_op(struct svc_fh *current_fh, stateid_t *stateid, int fl
        if (!stateid->si_fileid) { /* delegation stateid */
                if(!(dp = find_delegation_stateid(ino, stateid))) {
                        dprintk("NFSD: delegation stateid not found\n");
-                       if (nfs4_in_grace())
-                               status = nfserr_grace;
                        goto out;
                }
                stidp = &dp->dl_stateid;
        } else { /* open or lock stateid */
                if (!(stp = find_stateid(stateid, flags))) {
                        dprintk("NFSD: open or lock stateid not found\n");
-                       if (nfs4_in_grace())
-                               status = nfserr_grace;
                        goto out;
                }
                if ((flags & CHECK_FH) && nfs4_check_fh(current_fh, stp))
@@ -2252,8 +2256,9 @@ nfsd4_open_confirm(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfs
                        (int)current_fh->fh_dentry->d_name.len,
                        current_fh->fh_dentry->d_name.name);
 
-       if ((status = fh_verify(rqstp, current_fh, S_IFREG, 0)))
-               goto out;
+       status = fh_verify(rqstp, current_fh, S_IFREG, 0);
+       if (status)
+               return status;
 
        nfs4_lock_state();
 
@@ -2320,7 +2325,8 @@ nfsd4_open_downgrade(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct n
                        (int)current_fh->fh_dentry->d_name.len,
                        current_fh->fh_dentry->d_name.name);
 
-       if (!TEST_ACCESS(od->od_share_access) || !TEST_DENY(od->od_share_deny))
+       if (!access_valid(od->od_share_access)
+                       || !deny_valid(od->od_share_deny))
                return nfserr_inval;
 
        nfs4_lock_state();
index a1810e6a93e562fe9f5bbf3ed44086bddbf151c4..7046ac9cf97fa14e50743ed1cc4655d4b4ec26f7 100644 (file)
@@ -6,7 +6,6 @@
  * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/linkage.h>
index 3f2ec2e6d06c7d4dc80d98749898e0d9e21589ab..ecc439d2565fda18ecbeb460ec18eb5cb3115742 100644 (file)
@@ -187,13 +187,6 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
                        goto out;
                }
 
-               /* Set user creds for this exportpoint */
-               error = nfsd_setuser(rqstp, exp);
-               if (error) {
-                       error = nfserrno(error);
-                       goto out;
-               }
-
                /*
                 * Look up the dentry using the NFS file handle.
                 */
@@ -251,6 +244,14 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
        }
        cache_get(&exp->h);
 
+       /* 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));
+       if (error)
+               goto out;
+
        error = nfsd_mode_check(rqstp, dentry->d_inode->i_mode, type);
        if (error)
                goto out;
@@ -312,8 +313,8 @@ int
 fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry, struct svc_fh *ref_fh)
 {
        /* ref_fh is a reference file handle.
-        * if it is non-null, then we should compose a filehandle which is
-        * of the same version, where possible.
+        * if it is non-null and for the same filesystem, then we should compose
+        * a filehandle which is of the same version, where possible.
         * Currently, that means that if ref_fh->fh_handle.fh_version == 0xca
         * Then create a 32byte filehandle using nfs_fhbase_old
         *
@@ -332,7 +333,7 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry, st
                parent->d_name.name, dentry->d_name.name,
                (inode ? inode->i_ino : 0));
 
-       if (ref_fh) {
+       if (ref_fh && ref_fh->fh_export == exp) {
                ref_fh_version = ref_fh->fh_handle.fh_version;
                if (ref_fh_version == 0xca)
                        ref_fh_fsid_type = 0;
@@ -461,7 +462,7 @@ fh_update(struct svc_fh *fhp)
        } else {
                int size;
                if (fhp->fh_handle.fh_fileid_type != 0)
-                       goto out_uptodate;
+                       goto out;
                datap = fhp->fh_handle.fh_auth+
                        fhp->fh_handle.fh_size/4 -1;
                size = (fhp->fh_maxsize - fhp->fh_handle.fh_size)/4;
@@ -481,10 +482,6 @@ out_negative:
        printk(KERN_ERR "fh_update: %s/%s still negative!\n",
                dentry->d_parent->d_name.name, dentry->d_name.name);
        goto out;
-out_uptodate:
-       printk(KERN_ERR "fh_update: %s/%s already up-to-date!\n",
-               dentry->d_parent->d_name.name, dentry->d_name.name);
-       goto out;
 }
 
 /*
index 3790727e5dfdb8a8fb94ba4c5c7ca497d4ae6ae4..ec1decf29babd194b8ea8f2ae94912f252d770ec 100644 (file)
@@ -8,7 +8,6 @@
  * Copyright (C) 1995, 1996, 1997 Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/time.h>
index 245eaa1fb59b2959cac3ebfb1a8a9d35c065a324..c9e3b5a8fe07d6ce8a790f668da75898cb0474f7 100644 (file)
@@ -16,7 +16,6 @@
  * Zerocpy NFS support (C) 2002 Hirokazu Takahashi <taka@valinux.co.jp>
  */
 
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/time.h>
 #include <linux/errno.h>
@@ -673,7 +672,10 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
                goto out_nfserr;
 
        if (access & MAY_WRITE) {
-               flags = O_WRONLY|O_LARGEFILE;
+               if (access & MAY_READ)
+                       flags = O_RDWR|O_LARGEFILE;
+               else
+                       flags = O_WRONLY|O_LARGEFILE;
 
                DQUOT_INIT(inode);
        }
@@ -834,7 +836,7 @@ nfsd_vfs_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
        if (ra && ra->p_set)
                file->f_ra = ra->p_ra;
 
-       if (file->f_op->sendfile) {
+       if (file->f_op->sendfile && rqstp->rq_sendfile_ok) {
                svc_pushback_unused_pages(rqstp);
                err = file->f_op->sendfile(file, &offset, *count,
                                                 nfsd_read_actor, rqstp);
@@ -1517,14 +1519,15 @@ nfsd_link(struct svc_rqst *rqstp, struct svc_fh *ffhp,
                        err = nfserrno(err);
        }
 
-       fh_unlock(ffhp);
        dput(dnew);
+out_unlock:
+       fh_unlock(ffhp);
 out:
        return err;
 
 out_nfserr:
        err = nfserrno(err);
-       goto out;
+       goto out_unlock;
 }
 
 /*
@@ -1553,7 +1556,7 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen,
        tdir = tdentry->d_inode;
 
        err = (rqstp->rq_vers == 2) ? nfserr_acces : nfserr_xdev;
-       if (fdir->i_sb != tdir->i_sb)
+       if (ffhp->fh_export != tfhp->fh_export)
                goto out;
 
        err = nfserr_perm;
index a912debcd20b3c27850c4e5754e164888a0a9e9d..9de6b495f1128c09dd7c7d87767473e0431122cd 100644 (file)
@@ -10,7 +10,6 @@
 
 #include <linux/module.h>
 #include <linux/string.h>
-#include <linux/config.h>
 #include <linux/nls.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index 4c86b7e1d1eb435addf5822d6fd67132b580604a..d313f356e66a9b8925ae75161cf182da08e79133 100644 (file)
@@ -367,6 +367,12 @@ static void ntfs_destroy_extent_inode(ntfs_inode *ni)
        kmem_cache_free(ntfs_inode_cache, ni);
 }
 
+/*
+ * The attribute runlist lock has separate locking rules from the
+ * normal runlist lock, so split the two lock-classes:
+ */
+static struct lock_class_key attr_list_rl_lock_class;
+
 /**
  * __ntfs_init_inode - initialize ntfs specific part of an inode
  * @sb:                super block of mounted volume
@@ -394,6 +400,8 @@ void __ntfs_init_inode(struct super_block *sb, ntfs_inode *ni)
        ni->attr_list_size = 0;
        ni->attr_list = NULL;
        ntfs_init_runlist(&ni->attr_list_rl);
+       lockdep_set_class(&ni->attr_list_rl.lock,
+                               &attr_list_rl_lock_class);
        ni->itype.index.bmp_ino = NULL;
        ni->itype.index.block_size = 0;
        ni->itype.index.vcn_size = 0;
@@ -405,6 +413,13 @@ void __ntfs_init_inode(struct super_block *sb, ntfs_inode *ni)
        ni->ext.base_ntfs_ino = NULL;
 }
 
+/*
+ * Extent inodes get MFT-mapped in a nested way, while the base inode
+ * is still mapped. Teach this nesting to the lock validator by creating
+ * a separate class for nested inode's mrec_lock's:
+ */
+static struct lock_class_key extent_inode_mrec_lock_key;
+
 inline ntfs_inode *ntfs_new_extent_inode(struct super_block *sb,
                unsigned long mft_no)
 {
@@ -413,6 +428,7 @@ inline ntfs_inode *ntfs_new_extent_inode(struct super_block *sb,
        ntfs_debug("Entering.");
        if (likely(ni != NULL)) {
                __ntfs_init_inode(sb, ni);
+               lockdep_set_class(&ni->mrec_lock, &extent_inode_mrec_lock_key);
                ni->mft_no = mft_no;
                ni->type = AT_UNUSED;
                ni->name = NULL;
@@ -1722,6 +1738,15 @@ err_out:
        return err;
 }
 
+/*
+ * The MFT inode has special locking, so teach the lock validator
+ * about this by splitting off the locking rules of the MFT from
+ * the locking rules of other inodes. The MFT inode can never be
+ * accessed from the VFS side (or even internally), only by the
+ * map_mft functions.
+ */
+static struct lock_class_key mft_ni_runlist_lock_key, mft_ni_mrec_lock_key;
+
 /**
  * ntfs_read_inode_mount - special read_inode for mount time use only
  * @vi:                inode to read
@@ -2148,6 +2173,14 @@ int ntfs_read_inode_mount(struct inode *vi)
        ntfs_attr_put_search_ctx(ctx);
        ntfs_debug("Done.");
        ntfs_free(m);
+
+       /*
+        * Split the locking rules of the MFT inode from the
+        * locking rules of other inodes:
+        */
+       lockdep_set_class(&ni->runlist.lock, &mft_ni_runlist_lock_key);
+       lockdep_set_class(&ni->mrec_lock, &mft_ni_mrec_lock_key);
+
        return 0;
 
 em_put_err_out:
index 0e14acea3f8b831d13dabc6256e10b82d0fe622f..74e0ee8fce721ec8326a090b62a4ad79cb5d0156 100644 (file)
@@ -1724,6 +1724,14 @@ upcase_failed:
        return FALSE;
 }
 
+/*
+ * The lcn and mft bitmap inodes are NTFS-internal inodes with
+ * their own special locking rules:
+ */
+static struct lock_class_key
+       lcnbmp_runlist_lock_key, lcnbmp_mrec_lock_key,
+       mftbmp_runlist_lock_key, mftbmp_mrec_lock_key;
+
 /**
  * load_system_files - open the system files using normal functions
  * @vol:       ntfs super block describing device whose system files to load
@@ -1780,6 +1788,10 @@ static BOOL load_system_files(ntfs_volume *vol)
                ntfs_error(sb, "Failed to load $MFT/$BITMAP attribute.");
                goto iput_mirr_err_out;
        }
+       lockdep_set_class(&NTFS_I(vol->mftbmp_ino)->runlist.lock,
+                          &mftbmp_runlist_lock_key);
+       lockdep_set_class(&NTFS_I(vol->mftbmp_ino)->mrec_lock,
+                          &mftbmp_mrec_lock_key);
        /* Read upcase table and setup @vol->upcase and @vol->upcase_len. */
        if (!load_and_init_upcase(vol))
                goto iput_mftbmp_err_out;
@@ -1802,6 +1814,11 @@ static BOOL load_system_files(ntfs_volume *vol)
                        iput(vol->lcnbmp_ino);
                goto bitmap_failed;
        }
+       lockdep_set_class(&NTFS_I(vol->lcnbmp_ino)->runlist.lock,
+                          &lcnbmp_runlist_lock_key);
+       lockdep_set_class(&NTFS_I(vol->lcnbmp_ino)->mrec_lock,
+                          &lcnbmp_mrec_lock_key);
+
        NInoSetSparseDisabled(NTFS_I(vol->lcnbmp_ino));
        if ((vol->nr_clusters + 7) >> 3 > i_size_read(vol->lcnbmp_ino)) {
                iput(vol->lcnbmp_ino);
@@ -2743,6 +2760,17 @@ static int ntfs_fill_super(struct super_block *sb, void *opt, const int silent)
        struct inode *tmp_ino;
        int blocksize, result;
 
+       /*
+        * We do a pretty difficult piece of bootstrap by reading the
+        * MFT (and other metadata) from disk into memory. We'll only
+        * release this metadata during umount, so the locking patterns
+        * observed during bootstrap do not count. So turn off the
+        * observation of locking patterns (strictly for this context
+        * only) while mounting NTFS. [The validator is still active
+        * otherwise, even for this context: it will for example record
+        * lock class registrations.]
+        */
+       lockdep_off();
        ntfs_debug("Entering.");
 #ifndef NTFS_RW
        sb->s_flags |= MS_RDONLY;
@@ -2754,6 +2782,7 @@ static int ntfs_fill_super(struct super_block *sb, void *opt, const int silent)
                if (!silent)
                        ntfs_error(sb, "Allocation of NTFS volume structure "
                                        "failed. Aborting mount...");
+               lockdep_on();
                return -ENOMEM;
        }
        /* Initialize ntfs_volume structure. */
@@ -2940,6 +2969,7 @@ static int ntfs_fill_super(struct super_block *sb, void *opt, const int silent)
                mutex_unlock(&ntfs_lock);
                sb->s_export_op = &ntfs_export_ops;
                lock_kernel();
+               lockdep_on();
                return 0;
        }
        ntfs_error(sb, "Failed to allocate root directory.");
@@ -3059,6 +3089,7 @@ err_out_now:
        sb->s_fs_info = NULL;
        kfree(vol);
        ntfs_debug("Failed, returning -EINVAL.");
+       lockdep_on();
        return -EINVAL;
 }
 
index c8064cae8f17edfc743c25b886c63135b30dbcf5..beda5bf96405df5f8c630ffe1197395969adf86a 100644 (file)
@@ -24,7 +24,6 @@
 #ifndef _LINUX_NTFS_SYSCTL_H
 #define _LINUX_NTFS_SYSCTL_H
 
-#include <linux/config.h>
 
 #if defined(DEBUG) && defined(CONFIG_SYSCTL)
 
index c05085710fce5a32c689620c915dd3f9bf519712..1bc9f372c7d4cbf94c676f128ef66db757afb386 100644 (file)
@@ -12,7 +12,6 @@
  *  every single manufacturer of SCSI and IDE cards created their own
  *  method.
  */
-#include <linux/config.h>
 #include <linux/buffer_head.h>
 #include <linux/adfs_fs.h>
 
index 0f5b017aebad2ad1adb6657d819c52fa4b936153..63730282ad813688410809c25d22055c5cb38570 100644 (file)
@@ -91,7 +91,6 @@
  * - Code works, detects all the partitions.
  *
  ************************************************************/
-#include <linux/config.h>
 #include <linux/crc32.h>
 #include "check.h"
 #include "efi.h"
index c44fb0561448603fea42f9f758834b3ea641ad2b..2cc89d0475bff121145a423cd928cc71a31f3cea 100644 (file)
@@ -26,7 +26,6 @@
 #define FS_PART_EFI_H_INCLUDED
 
 #include <linux/types.h>
-#include <linux/config.h>
 #include <linux/fs.h>
 #include <linux/genhd.h>
 #include <linux/kernel.h>
index 830c55d86ab1f8e1a9903097e56ea8091efbe50e..d352a7381fed88ff20f5f1c7b9b6365a2264e436 100644 (file)
@@ -6,7 +6,6 @@
  * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
  */
 
-#include <linux/config.h>
 #include <linux/buffer_head.h>
 #include <linux/hdreg.h>
 #include <linux/slab.h>
index 813292f21210d73ffa47f4013fab164743e9a3f9..c0871002d00d00f8c036d8b3a873f5a7e31a765b 100644 (file)
@@ -6,7 +6,6 @@
  *  Re-organised Feb 1998 Russell King
  */
 
-#include <linux/config.h>
 #include <linux/ctype.h>
 #include "check.h"
 #include "mac.h"
index 9935d254186ef10276781815193995895b3dab8b..8f12587c3129731fcd92392b41f8c86a9be3c646 100644 (file)
@@ -19,7 +19,6 @@
  *  Re-organised Feb 1998 Russell King
  */
 
-#include <linux/config.h>
 
 #include "check.h"
 #include "msdos.h"
index 7a76ad5702302e7e975d9cd49ce64fdec9daf6c4..7495d3e207757ab29ef9ef2a3dd717187ec5c228 100644 (file)
@@ -52,7 +52,6 @@
  *                      :  base.c too.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/time.h>
index 6ba7785319de46dd2020c6b1132c2bf9e4462fe9..243a94af0427b2630fb85f489a5419410dac3bfc 100644 (file)
@@ -49,7 +49,6 @@
 
 #include <asm/uaccess.h>
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/time.h>
 #include <linux/proc_fs.h>
index 17f6e8fa13978801e939a2a9cf749fcae8d7bf4f..036d14d836271b9cba65ca044988614c091e6019 100644 (file)
@@ -9,7 +9,6 @@
  *     Safe accesses to vmalloc/direct-mapped discontiguous areas, Kanoj Sarcar <kanoj@sgi.com>
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/proc_fs.h>
 #include <linux/user.h>
index 5c10ea1574251c0e0809e3800d0dc05e144d01c4..9f2cfc30f9cfc0176ac6096e87df859b4c52cd3d 100644 (file)
@@ -26,7 +26,6 @@
 #include <linux/mman.h>
 #include <linux/proc_fs.h>
 #include <linux/ioport.h>
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/mmzone.h>
 #include <linux/pagemap.h>
@@ -120,7 +119,6 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
 {
        struct sysinfo i;
        int len;
-       struct page_state ps;
        unsigned long inactive;
        unsigned long active;
        unsigned long free;
@@ -129,7 +127,6 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
        struct vmalloc_info vmi;
        long cached;
 
-       get_page_state(&ps);
        get_zone_counts(&active, &inactive, &free);
 
 /*
@@ -142,7 +139,8 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
        allowed = ((totalram_pages - hugetlb_total_pages())
                * sysctl_overcommit_ratio / 100) + total_swap_pages;
 
-       cached = get_page_cache_size() - total_swapcache_pages - i.bufferram;
+       cached = global_page_state(NR_FILE_PAGES) -
+                       total_swapcache_pages - i.bufferram;
        if (cached < 0)
                cached = 0;
 
@@ -167,11 +165,14 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
                "SwapFree:     %8lu kB\n"
                "Dirty:        %8lu kB\n"
                "Writeback:    %8lu kB\n"
+               "AnonPages:    %8lu kB\n"
                "Mapped:       %8lu kB\n"
                "Slab:         %8lu kB\n"
+               "PageTables:   %8lu kB\n"
+               "NFS Unstable: %8lu kB\n"
+               "Bounce:       %8lu kB\n"
                "CommitLimit:  %8lu kB\n"
                "Committed_AS: %8lu kB\n"
-               "PageTables:   %8lu kB\n"
                "VmallocTotal: %8lu kB\n"
                "VmallocUsed:  %8lu kB\n"
                "VmallocChunk: %8lu kB\n",
@@ -188,13 +189,16 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
                K(i.freeram-i.freehigh),
                K(i.totalswap),
                K(i.freeswap),
-               K(ps.nr_dirty),
-               K(ps.nr_writeback),
-               K(ps.nr_mapped),
-               K(ps.nr_slab),
+               K(global_page_state(NR_FILE_DIRTY)),
+               K(global_page_state(NR_WRITEBACK)),
+               K(global_page_state(NR_ANON_PAGES)),
+               K(global_page_state(NR_FILE_MAPPED)),
+               K(global_page_state(NR_SLAB)),
+               K(global_page_state(NR_PAGETABLE)),
+               K(global_page_state(NR_UNSTABLE_NFS)),
+               K(global_page_state(NR_BOUNCE)),
                K(allowed),
                K(committed),
-               K(ps.nr_page_table_pages),
                (unsigned long)VMALLOC_TOTAL >> 10,
                vmi.used >> 10,
                vmi.largest_chunk >> 10
index 9995356ce73e573285ff2ed3623f04fc72fcbfcc..8901c65caca83be55d575ea70d51411435d5410e 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/time.h>
 #include <linux/proc_fs.h>
 #include <linux/stat.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/bitops.h>
index af69f28277b653631b8b417371b14a625598dd22..4616ed50ffcdea037a49111cf3d5f0d53af994c6 100644 (file)
@@ -107,7 +107,7 @@ int proc_exe_link(struct inode *inode, struct dentry **dentry, struct vfsmount *
 {
        struct vm_list_struct *vml;
        struct vm_area_struct *vma;
-       struct task_struct *task = proc_task(inode);
+       struct task_struct *task = get_proc_task(inode);
        struct mm_struct *mm = get_task_mm(task);
        int result = -ENOENT;
 
index 20d4b2237fcefd482112a3752669fe87004884bf..d96050728c43841c048ff3c4a181c1431f918e10 100644 (file)
@@ -7,7 +7,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/proc_fs.h>
 #include <linux/user.h>
index 46efbf52cbeca2c1962c1222bde634393193206c..8425cf6e96248c5eb16a4c802d03b845b43d0af3 100644 (file)
@@ -13,7 +13,6 @@
  * 28-06-1998 by Frank Denis : qnx4_free_inode (to be fixed) .
  */
 
-#include <linux/config.h>
 #include <linux/time.h>
 #include <linux/fs.h>
 #include <linux/qnx4_fs.h>
index 9031948fefd056104a4822ab4f193529f70a1475..0d7103fa0df5c253217f313f0d5b9599867216ab 100644 (file)
@@ -11,7 +11,6 @@
  * 20-06-1998 by Frank Denis : Linux 2.1.99+ & dcache support.
  */
 
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
index df5bc75d5414374a02018cb62b737889bd137d08..aa3b19544beea6aeb93bf30ceb5c1229f068aacf 100644 (file)
@@ -10,7 +10,6 @@
  * 24-03-1998 by Richard Frowijn : first release.
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/time.h>
 #include <linux/stat.h>
index 8bc182a88748a91abbdc7b46032d81ac5c9ad9fa..5a903491e6972577ef38ee98a1d1c5fb1ddfc1e7 100644 (file)
@@ -12,7 +12,6 @@
  * 30-06-1998 by Frank Denis : first step to write inodes.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/string.h>
index 4af4951d7f54fc1c9f6a763bf5df7c1f150f683d..c3d83f67154a61c2fe39421d7809a04d4769577b 100644 (file)
@@ -12,7 +12,6 @@
  * 04-07-1998 by Frank Denis : first step for rmdir/unlink.
  */
 
-#include <linux/config.h>
 #include <linux/time.h>
 #include <linux/fs.h>
 #include <linux/qnx4_fs.h>
index 86563ec01b395645eb2a85df4a7d9237eeda09d6..6437c1c3d1dd077d2ecbc9fb98ee16c4dcb54da6 100644 (file)
@@ -10,7 +10,6 @@
  * 30-06-1998 by Frank DENIS : ugly filler.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
index 909f71e9a30f4887c171b42dc5d8c799b4d03f6a..4a7dbdee1b6d73f1d1ae8fb44becb0410c6e58d1 100644 (file)
@@ -3,7 +3,6 @@
  */
 /* Reiserfs block (de)allocator, bitmap-based. */
 
-#include <linux/config.h>
 #include <linux/time.h>
 #include <linux/reiserfs_fs.h>
 #include <linux/errno.h>
index 973c819f803387a9f5adce136825c62bdeea4010..9aabcc0ccd2d002401e7611a93f5f6b8458136c0 100644 (file)
@@ -2,7 +2,6 @@
  * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README
  */
 
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
index b2264ba3cc569d4ca639eab826d56d085453b07e..fba304e64de81d51805d52434b152a6fc8aed50b 100644 (file)
@@ -15,7 +15,6 @@
  **
  **/
 
-#include <linux/config.h>
 #include <asm/uaccess.h>
 #include <linux/time.h>
 #include <linux/reiserfs_fs.h>
index 5600d3d60cf7d9f467ff5fc0f0046cc0adb8070f..6d0e554daa9d845fd9a608826654f84cc6834f59 100644 (file)
@@ -34,7 +34,6 @@
  ** 
  **/
 
-#include <linux/config.h>
 #include <linux/time.h>
 #include <linux/string.h>
 #include <linux/reiserfs_fs.h>
index 6c5a726fd34bf8920da792af32563bc6a47bbc81..de391a82b9999830cb8eb89b3633b960ac96e2e8 100644 (file)
@@ -2,7 +2,6 @@
  * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README
  */
 
-#include <linux/config.h>
 #include <asm/uaccess.h>
 #include <linux/string.h>
 #include <linux/time.h>
index a24858a632fab85ef57f3ebf291a8a2235f2f182..12dfdcfbee3dfb8666712f81fb8ca28f203568cb 100644 (file)
@@ -2,7 +2,6 @@
  * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README
  */
 
-#include <linux/config.h>
 #include <linux/time.h>
 #include <linux/fs.h>
 #include <linux/reiserfs_fs.h>
@@ -2933,6 +2932,11 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr)
                        }
                        if (error)
                                goto out;
+                       /*
+                        * file size is changed, ctime and mtime are
+                        * to be updated
+                        */
+                       attr->ia_valid |= (ATTR_MTIME | ATTR_CTIME);
                }
        }
 
index 49d1a53dbef0e80f9dc2bea5ec61e415a8b53a5d..9b3672d69367251b6109c6550c5e8e7f81986634 100644 (file)
@@ -34,7 +34,6 @@
 **                     from within kupdate, it will ignore the immediate flag
 */
 
-#include <linux/config.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
 
index 2533c1f64aba16b1d30d27ba3420afb1217cf092..281f8061ac58112579d82c5a2078327aff576d59 100644 (file)
@@ -2,7 +2,6 @@
  * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README
  */
 
-#include <linux/config.h>
 #include <asm/uaccess.h>
 #include <linux/string.h>
 #include <linux/time.h>
index 284f7852de8b00e53211e40822d935acef0d9a67..c61710e49c6244e9559cb0f1b0fb92e24442d59f 100644 (file)
@@ -11,7 +11,6 @@
  * NO WARRANTY
  */
 
-#include <linux/config.h>
 #include <linux/time.h>
 #include <linux/bitops.h>
 #include <linux/reiserfs_fs.h>
index f62590aa9c956a89af2529e181d60e9060aecb8a..65feba4deb69a778168cf12ae42133fe8d115c3d 100644 (file)
@@ -2,7 +2,6 @@
  * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README
  */
 
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/random.h>
 #include <linux/time.h>
index 27bd3a1df2ad0146663c995856c319a78d9fc2f2..bc808a91eeaa75fba63c211667b3869a295ce1ed 100644 (file)
@@ -2,7 +2,6 @@
  * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README
  */
 
-#include <linux/config.h>
 #include <linux/time.h>
 #include <linux/fs.h>
 #include <linux/reiserfs_fs.h>
index 731688e1cfe334608001da8648f9d8c051d2b1c1..5d8a8cfebc7042282cc5e589021e86361dd0d66d 100644 (file)
@@ -10,7 +10,6 @@
 
 /* $Id: procfs.c,v 1.1.8.2 2001/07/15 17:08:42 god Exp $ */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/time.h>
 #include <linux/seq_file.h>
index d2b25e1ba6e9739c5bd49b58945d50a7956fb74d..8b9b131271363f2f9b3ef5ed9bcd7fa55a35cab2 100644 (file)
@@ -49,7 +49,6 @@
  * reiserfs_insert_item
  */
 
-#include <linux/config.h>
 #include <linux/time.h>
 #include <linux/string.h>
 #include <linux/pagemap.h>
index 00f1321e9209e2f21c5123ba6fe767509916b710..5567328f10415c85fbbe068672ed85a5f7ad0ead 100644 (file)
@@ -11,7 +11,6 @@
  * NO WARRANTY
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/vmalloc.h>
 #include <linux/time.h>
@@ -2204,7 +2203,7 @@ static ssize_t reiserfs_quota_write(struct super_block *sb, int type,
        size_t towrite = len;
        struct buffer_head tmp_bh, *bh;
 
-       mutex_lock(&inode->i_mutex);
+       mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA);
        while (towrite > 0) {
                tocopy = sb->s_blocksize - offset < towrite ?
                    sb->s_blocksize - offset : towrite;
index 196e971c03c9aa93e92e087b60012ee4eed33df9..36f108fc1cf5fde849204bdc14a146e72fb7e600 100644 (file)
@@ -2,7 +2,6 @@
  * Copyright 1999 Hans Reiser, see reiserfs/README for licensing and copyright details
  */
 
-#include <linux/config.h>
 #include <linux/time.h>
 #include <linux/pagemap.h>
 #include <linux/buffer_head.h>
index 506ff87c1d4bdf99abbcd69b7f9900f2064b2c13..a1ed657c3c84323037f526cc341bb63fd44336cf 100644 (file)
@@ -7,7 +7,6 @@
  *  Please add a note about your changes to smbfs in the ChangeLog file.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/time.h>
 #include <linux/kernel.h>
index 24577e2c489b7997e40a691d076c88dd4ac03f79..e675404412880eb6d602cd7d9de3dbe6aef13c0a 100644 (file)
@@ -5,7 +5,6 @@
  *  Copyright (C) 2001, Urban Widmark
  */
 
-#include <linux/config.h>
 
 #include <linux/sched.h>
 #include <linux/kernel.h>
index 0f282face3225f2becf2694f8961b8272caf635c..3a44dcf97da23d1704b599527db4a50edcbc04a6 100644 (file)
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -4,7 +4,6 @@
  *  Copyright (C) 1991, 1992  Linus Torvalds
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/mm.h>
 #include <linux/errno.h>
index 8a669f6f3f52144f09d9225bbb20b646671fd8f6..6d4e8174b6db4fd7548b94403aafdd49043966f9 100644 (file)
@@ -20,7 +20,6 @@
  *  Heavily rewritten for 'one fs - one tree' dcache architecture. AV, Mar 2000
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/init.h>
@@ -54,7 +53,7 @@ DEFINE_SPINLOCK(sb_lock);
  *     Allocates and initializes a new &struct super_block.  alloc_super()
  *     returns a pointer new superblock or %NULL if allocation had failed.
  */
-static struct super_block *alloc_super(void)
+static struct super_block *alloc_super(struct file_system_type *type)
 {
        struct super_block *s = kzalloc(sizeof(struct super_block),  GFP_USER);
        static struct super_operations default_op;
@@ -73,6 +72,13 @@ static struct super_block *alloc_super(void)
                INIT_LIST_HEAD(&s->s_inodes);
                init_rwsem(&s->s_umount);
                mutex_init(&s->s_lock);
+               lockdep_set_class(&s->s_umount, &type->s_umount_key);
+               /*
+                * The locking rules for s_lock are up to the
+                * filesystem. For example ext3fs has different
+                * lock ordering than usbfs:
+                */
+               lockdep_set_class(&s->s_lock, &type->s_lock_key);
                down_write(&s->s_umount);
                s->s_count = S_BIAS;
                atomic_set(&s->s_active, 1);
@@ -296,7 +302,7 @@ retry:
        }
        if (!s) {
                spin_unlock(&sb_lock);
-               s = alloc_super();
+               s = alloc_super(type);
                if (!s)
                        return ERR_PTR(-ENOMEM);
                goto retry;
index 44fe2cb0bbb28518f9426edac3b00ca318ff11f6..4df822c881b69357038f96f0d91f6231f7da4a15 100644 (file)
@@ -40,7 +40,6 @@
 
 #include "udfdecl.h"    
 
-#include <linux/config.h>
 #include <linux/blkdev.h>
 #include <linux/slab.h>
 #include <linux/kernel.h>
index 2f992387cc9ed0a9cba2bd64c704d2e175f78fe2..1033b7cf29393e6d23c8e4e1f011db7476de1381 100644 (file)
@@ -6,7 +6,6 @@
 #include "osta_udf.h"
 
 #include <linux/fs.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/udf_fs_i.h>
 #include <linux/udf_fs_sb.h>
index 95b878e5c7a077783f4971abae30cf9794c91442..b01804baa120f630c1fe2480a970086e96e58cde 100644 (file)
@@ -217,48 +217,6 @@ failed:
        return;
 }
 
-static struct page *ufs_get_locked_page(struct address_space *mapping,
-                                 unsigned long index)
-{
-       struct page *page;
-
-try_again:
-       page = find_lock_page(mapping, index);
-       if (!page) {
-               page = read_cache_page(mapping, index,
-                                      (filler_t*)mapping->a_ops->readpage,
-                                      NULL);
-               if (IS_ERR(page)) {
-                       printk(KERN_ERR "ufs_change_blocknr: "
-                              "read_cache_page error: ino %lu, index: %lu\n",
-                              mapping->host->i_ino, index);
-                       goto out;
-               }
-
-               lock_page(page);
-
-               if (!PageUptodate(page) || PageError(page)) {
-                       unlock_page(page);
-                       page_cache_release(page);
-
-                       printk(KERN_ERR "ufs_change_blocknr: "
-                              "can not read page: ino %lu, index: %lu\n",
-                              mapping->host->i_ino, index);
-
-                       page = ERR_PTR(-EIO);
-                       goto out;
-               }
-       }
-
-       if (unlikely(!page->mapping || !page_has_buffers(page))) {
-               unlock_page(page);
-               page_cache_release(page);
-               goto try_again;/*we really need these buffers*/
-       }
-out:
-       return page;
-}
-
 /*
  * Modify inode page cache in such way:
  * have - blocks with b_blocknr equal to oldb...oldb+count-1
@@ -311,10 +269,8 @@ static void ufs_change_blocknr(struct inode *inode, unsigned int baseblk,
 
                set_page_dirty(page);
 
-               if (likely(cur_index != index)) {
-                       unlock_page(page);
-                       page_cache_release(page);
-               }
+               if (likely(cur_index != index))
+                       ufs_put_locked_page(page);
        }
        UFSD("EXIT\n");
 }
index 0e5001512a9d85f0d176c247096aa96ededddda1..a9c6e5f04faea080ddc271602cab79f829295548 100644 (file)
@@ -60,7 +60,3 @@ const struct file_operations ufs_file_operations = {
        .fsync          = ufs_sync_file,
        .sendfile       = generic_file_sendfile,
 };
-
-struct inode_operations ufs_file_inode_operations = {
-       .truncate       = ufs_truncate,
-};
index 488b5ff48afb1330ca5f40360af42e25231637d3..e7c8615beb65fa31da416c3522390557e582c848 100644 (file)
@@ -843,14 +843,17 @@ int ufs_sync_inode (struct inode *inode)
 
 void ufs_delete_inode (struct inode * inode)
 {
+       loff_t old_i_size;
+
        truncate_inode_pages(&inode->i_data, 0);
        /*UFS_I(inode)->i_dtime = CURRENT_TIME;*/
        lock_kernel();
        mark_inode_dirty(inode);
        ufs_update_inode(inode, IS_SYNC(inode));
+       old_i_size = inode->i_size;
        inode->i_size = 0;
-       if (inode->i_blocks)
-               ufs_truncate (inode);
+       if (inode->i_blocks && ufs_truncate(inode, old_i_size))
+               ufs_warning(inode->i_sb, __FUNCTION__, "ufs_truncate failed\n");
        ufs_free_inode (inode);
        unlock_kernel();
 }
index 74ef5e9bedffaf764c5e51a5492c803a0ff15f31..992ee0b87cc3f7835fa376c75733822d9ddfbdc6 100644 (file)
@@ -64,7 +64,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/bitops.h>
 
@@ -1327,7 +1326,7 @@ static ssize_t ufs_quota_write(struct super_block *sb, int type,
        size_t towrite = len;
        struct buffer_head *bh;
 
-       mutex_lock(&inode->i_mutex);
+       mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA);
        while (towrite > 0) {
                tocopy = sb->s_blocksize - offset < towrite ?
                                sb->s_blocksize - offset : towrite;
index 3c3b301f87014eeec6327e7480befd367d8ac336..c9b55872079b5a328264021c992ea71a408585db 100644 (file)
@@ -369,24 +369,97 @@ static int ufs_trunc_tindirect (struct inode * inode)
        UFSD("EXIT\n");
        return retry;
 }
-               
-void ufs_truncate (struct inode * inode)
+
+static int ufs_alloc_lastblock(struct inode *inode)
 {
+       int err = 0;
+       struct address_space *mapping = inode->i_mapping;
+       struct ufs_sb_private_info *uspi = UFS_SB(inode->i_sb)->s_uspi;
        struct ufs_inode_info *ufsi = UFS_I(inode);
-       struct super_block * sb;
-       struct ufs_sb_private_info * uspi;
-       int retry;
+       unsigned lastfrag, i, end;
+       struct page *lastpage;
+       struct buffer_head *bh;
+
+       lastfrag = (i_size_read(inode) + uspi->s_fsize - 1) >> uspi->s_fshift;
+
+       if (!lastfrag) {
+               ufsi->i_lastfrag = 0;
+               goto out;
+       }
+       lastfrag--;
+
+       lastpage = ufs_get_locked_page(mapping, lastfrag >>
+                                      (PAGE_CACHE_SHIFT - inode->i_blkbits));
+       if (IS_ERR(lastpage)) {
+               err = -EIO;
+               goto out;
+       }
+
+       end = lastfrag & ((1 << (PAGE_CACHE_SHIFT - inode->i_blkbits)) - 1);
+       bh = page_buffers(lastpage);
+       for (i = 0; i < end; ++i)
+               bh = bh->b_this_page;
+
+       if (!buffer_mapped(bh)) {
+               err = ufs_getfrag_block(inode, lastfrag, bh, 1);
+
+               if (unlikely(err))
+                       goto out_unlock;
+
+               if (buffer_new(bh)) {
+                       clear_buffer_new(bh);
+                       unmap_underlying_metadata(bh->b_bdev,
+                                                bh->b_blocknr);
+                      /*
+                       * we do not zeroize fragment, because of
+                       * if it maped to hole, it already contains zeroes
+                       */
+                       set_buffer_uptodate(bh);
+                       mark_buffer_dirty(bh);
+                       set_page_dirty(lastpage);
+               }
+       }
+out_unlock:
+       ufs_put_locked_page(lastpage);
+out:
+       return err;
+}
+
+int ufs_truncate(struct inode *inode, loff_t old_i_size)
+{
+       struct ufs_inode_info *ufsi = UFS_I(inode);
+       struct super_block *sb = inode->i_sb;
+       struct ufs_sb_private_info *uspi = UFS_SB(sb)->s_uspi;
+       int retry, err = 0;
        
        UFSD("ENTER\n");
-       sb = inode->i_sb;
-       uspi = UFS_SB(sb)->s_uspi;
 
-       if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode)))
-               return;
+       if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
+             S_ISLNK(inode->i_mode)))
+               return -EINVAL;
        if (IS_APPEND(inode) || IS_IMMUTABLE(inode))
-               return;
+               return -EPERM;
+
+       if (inode->i_size > old_i_size) {
+               /*
+                * if we expand file we should care about
+                * allocation of block for last byte first of all
+                */
+               err = ufs_alloc_lastblock(inode);
+
+               if (err) {
+                       i_size_write(inode, old_i_size);
+                       goto out;
+               }
+               /*
+                * go away, because of we expand file, and we do not
+                * need free blocks, and zeroizes page
+                */
+               lock_kernel();
+               goto almost_end;
+       }
 
-       block_truncate_page(inode->i_mapping,   inode->i_size, ufs_getfrag_block);
+       block_truncate_page(inode->i_mapping, inode->i_size, ufs_getfrag_block);
 
        lock_kernel();
        while (1) {
@@ -404,9 +477,58 @@ void ufs_truncate (struct inode * inode)
                yield();
        }
 
+       if (inode->i_size < old_i_size) {
+               /*
+                * now we should have enough space
+                * to allocate block for last byte
+                */
+               err = ufs_alloc_lastblock(inode);
+               if (err)
+                       /*
+                        * looks like all the same - we have no space,
+                        * but we truncate file already
+                        */
+                       inode->i_size = (ufsi->i_lastfrag - 1) * uspi->s_fsize;
+       }
+almost_end:
        inode->i_mtime = inode->i_ctime = CURRENT_TIME_SEC;
-       ufsi->i_lastfrag = DIRECT_FRAGMENT;
        unlock_kernel();
        mark_inode_dirty(inode);
-       UFSD("EXIT\n");
+out:
+       UFSD("EXIT: err %d\n", err);
+       return err;
 }
+
+
+/*
+ * We don't define our `inode->i_op->truncate', and call it here,
+ * because of:
+ * - there is no way to know old size
+ * - there is no way inform user about error, if it happens in `truncate'
+ */
+static int ufs_setattr(struct dentry *dentry, struct iattr *attr)
+{
+       struct inode *inode = dentry->d_inode;
+       unsigned int ia_valid = attr->ia_valid;
+       int error;
+
+       error = inode_change_ok(inode, attr);
+       if (error)
+               return error;
+
+       if (ia_valid & ATTR_SIZE &&
+           attr->ia_size != i_size_read(inode)) {
+               loff_t old_i_size = inode->i_size;
+               error = vmtruncate(inode, attr->ia_size);
+               if (error)
+                       return error;
+               error = ufs_truncate(inode, old_i_size);
+               if (error)
+                       return error;
+       }
+       return inode_setattr(inode, attr);
+}
+
+struct inode_operations ufs_file_inode_operations = {
+       .setattr = ufs_setattr,
+};
index a2f13f45708b7d0fa6d688579f3551176465f3bd..337cf2c46d109f1e9c9cef3492ed2dd26bffe07e 100644 (file)
@@ -233,3 +233,57 @@ ufs_set_inode_dev(struct super_block *sb, struct ufs_inode_info *ufsi, dev_t dev
        else
                ufsi->i_u1.i_data[0] = fs32;
 }
+
+/**
+ * ufs_get_locked_page() - locate, pin and lock a pagecache page, if not exist
+ * read it from disk.
+ * @mapping: the address_space to search
+ * @index: the page index
+ *
+ * Locates the desired pagecache page, if not exist we'll read it,
+ * locks it, increments its reference
+ * count and returns its address.
+ *
+ */
+
+struct page *ufs_get_locked_page(struct address_space *mapping,
+                                pgoff_t index)
+{
+       struct page *page;
+
+try_again:
+       page = find_lock_page(mapping, index);
+       if (!page) {
+               page = read_cache_page(mapping, index,
+                                      (filler_t*)mapping->a_ops->readpage,
+                                      NULL);
+               if (IS_ERR(page)) {
+                       printk(KERN_ERR "ufs_change_blocknr: "
+                              "read_cache_page error: ino %lu, index: %lu\n",
+                              mapping->host->i_ino, index);
+                       goto out;
+               }
+
+               lock_page(page);
+
+               if (!PageUptodate(page) || PageError(page)) {
+                       unlock_page(page);
+                       page_cache_release(page);
+
+                       printk(KERN_ERR "ufs_change_blocknr: "
+                              "can not read page: ino %lu, index: %lu\n",
+                              mapping->host->i_ino, index);
+
+                       page = ERR_PTR(-EIO);
+                       goto out;
+               }
+       }
+
+       if (unlikely(!page->mapping || !page_has_buffers(page))) {
+               unlock_page(page);
+               page_cache_release(page);
+               goto try_again;/*we really need these buffers*/
+       }
+out:
+       return page;
+}
index 406981fff5e7ca01317a7aa26c34f803827ec7fc..28fce6c239b56f8d960a7bf7a820c12ad1b2b3e4 100644 (file)
@@ -251,6 +251,14 @@ extern void _ubh_ubhcpymem_(struct ufs_sb_private_info *, unsigned char *, struc
 #define ubh_memcpyubh(ubh,mem,size) _ubh_memcpyubh_(uspi,ubh,mem,size)
 extern void _ubh_memcpyubh_(struct ufs_sb_private_info *, struct ufs_buffer_head *, unsigned char *, unsigned);
 
+/* This functions works with cache pages*/
+extern struct page *ufs_get_locked_page(struct address_space *mapping,
+                                       pgoff_t index);
+static inline void ufs_put_locked_page(struct page *page)
+{
+       unlock_page(page);
+       page_cache_release(page);
+}
 
 
 /*
index 4dd6592d5a4cbf0c9f3ebdfa7a95fcc5870d253d..ceda3a2859d2db29975b5ace0994e9624b327db5 100644 (file)
@@ -18,7 +18,6 @@
 #ifndef __XFS_BUF_H__
 #define __XFS_BUF_H__
 
-#include <linux/config.h>
 #include <linux/list.h>
 #include <linux/types.h>
 #include <linux/spinlock.h>
index 601f01c92f7f49afb49ce30f506571c5a126f2ca..270db0f3861d1597c6401a2e25872b005e97fe26 100644 (file)
@@ -15,7 +15,6 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include <linux/config.h>
 #include <linux/compat.h>
 #include <linux/init.h>
 #include <linux/ioctl.h>
index 028eb17ec2edd8b17e35b333e1b0692ba63414c7..8c021dc57d1f80552df7ea2229558da053312be5 100644 (file)
@@ -19,7 +19,6 @@
 #define __XFS_LINUX__
 
 #include <linux/types.h>
-#include <linux/config.h>
 
 /*
  * Some types are conditional depending on the target system.
diff --git a/include/Kbuild b/include/Kbuild
new file mode 100644 (file)
index 0000000..cb25348
--- /dev/null
@@ -0,0 +1,2 @@
+header-y += asm-generic/ linux/ scsi/ sound/ mtd/ rdma/ video/
+header-y += asm-$(ARCH)/ 
index b9beceb33141706bbf755792299d113b8dccd11e..b492857fe7213e51cf3262605f7e0ea11b009f4e 100644 (file)
@@ -63,7 +63,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20060608
+#define ACPI_CA_VERSION                 0x20060623
 
 /*
  * OS name, used for the _OS object.  The _OS object is essentially obsolete,
index 288f84903af76634e292d7d71615c5c3acbc0db6..a22fe9cf8493dc3fb9ed5003fa53b48e0a824c9d 100644 (file)
@@ -201,7 +201,7 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
 acpi_status
 acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
                               union acpi_operand_object *obj_desc,
-                              struct acpi_namespace_node *calling_method_node);
+                              struct acpi_walk_state *walk_state);
 
 acpi_status
 acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state);
index 14531d48f6b63e48bd3c873741b3ccd5e99fed9f..06972e6637de50d8b8be1dafdab911801ce08490 100644 (file)
@@ -181,6 +181,12 @@ ACPI_EXTERN u8 acpi_gbl_integer_nybble_width;
 extern struct acpi_table_list acpi_gbl_table_lists[ACPI_TABLE_ID_MAX + 1];
 extern struct acpi_table_support acpi_gbl_table_data[ACPI_TABLE_ID_MAX + 1];
 
+/*****************************************************************************
+ *
+ * Mutual exlusion within ACPICA subsystem
+ *
+ ****************************************************************************/
+
 /*
  * Predefined mutex objects.  This array contains the
  * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs.
@@ -188,6 +194,20 @@ extern struct acpi_table_support acpi_gbl_table_data[ACPI_TABLE_ID_MAX + 1];
  */
 ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[ACPI_NUM_MUTEX];
 
+/*
+ * Global lock semaphore works in conjunction with the actual HW global lock
+ */
+ACPI_EXTERN acpi_semaphore acpi_gbl_global_lock_semaphore;
+
+/*
+ * Spinlocks are used for interfaces that can be possibly called at
+ * interrupt level
+ */
+ACPI_EXTERN spinlock_t _acpi_gbl_gpe_lock;     /* For GPE data structs and registers */
+ACPI_EXTERN spinlock_t _acpi_gbl_hardware_lock;        /* For ACPI H/W except GPE registers */
+#define acpi_gbl_gpe_lock      &_acpi_gbl_gpe_lock
+#define acpi_gbl_hardware_lock &_acpi_gbl_hardware_lock
+
 /*****************************************************************************
  *
  * Miscellaneous globals
@@ -217,7 +237,6 @@ ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_system_notify;
 ACPI_EXTERN acpi_exception_handler acpi_gbl_exception_handler;
 ACPI_EXTERN acpi_init_handler acpi_gbl_init_handler;
 ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk;
-ACPI_EXTERN acpi_handle acpi_gbl_global_lock_semaphore;
 
 /* Misc */
 
@@ -315,11 +334,6 @@ ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head;
 ACPI_EXTERN struct acpi_gpe_block_info
     *acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS];
 
-/* Spinlocks */
-
-ACPI_EXTERN acpi_handle acpi_gbl_gpe_lock;
-ACPI_EXTERN acpi_handle acpi_gbl_hardware_lock;
-
 /*****************************************************************************
  *
  * Debugger globals
index 9f22cfcb624b97ff5bbe168770d53de74d3d1fd7..216339a8f1f662114856c8448c50ebb069490beb 100644 (file)
@@ -287,7 +287,10 @@ acpi_ex_system_wait_event(union acpi_operand_object *time,
 
 acpi_status acpi_ex_system_reset_event(union acpi_operand_object *obj_desc);
 
-acpi_status acpi_ex_system_wait_semaphore(acpi_handle semaphore, u16 timeout);
+acpi_status
+acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout);
+
+acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout);
 
 /*
  * exoparg1 - ACPI AML execution, 1 operand
index 1eeca7adca9535c0549e94a13cca4f2362f9b91e..56b8024861611ed6d77a8705801b260a07cfeda9 100644 (file)
 /* acpisrc:struct_defs -- for acpisrc conversion */
 
 #define ACPI_WAIT_FOREVER               0xFFFF /* u16, as per ACPI spec */
-#define ACPI_INFINITE_CONCURRENCY       0xFF
+#define ACPI_DO_NOT_WAIT                0
+#define ACPI_SERIALIZED                 0xFF
 
-typedef void *acpi_mutex;
 typedef u32 acpi_mutex_handle;
+#define ACPI_GLOBAL_LOCK                (acpi_semaphore) (-1)
 
 /* Total number of aml opcodes defined */
 
@@ -79,16 +80,15 @@ union acpi_parse_object;
  * table below also!
  */
 #define ACPI_MTX_INTERPRETER            0      /* AML Interpreter, main lock */
-#define ACPI_MTX_CONTROL_METHOD         1      /* Control method termination [TBD: may no longer be necessary] */
-#define ACPI_MTX_TABLES                 2      /* Data for ACPI tables */
-#define ACPI_MTX_NAMESPACE              3      /* ACPI Namespace */
-#define ACPI_MTX_EVENTS                 4      /* Data for ACPI events */
-#define ACPI_MTX_CACHES                 5      /* Internal caches, general purposes */
-#define ACPI_MTX_MEMORY                 6      /* Debug memory tracking lists */
-#define ACPI_MTX_DEBUG_CMD_COMPLETE     7      /* AML debugger */
-#define ACPI_MTX_DEBUG_CMD_READY        8      /* AML debugger */
-
-#define ACPI_MAX_MUTEX                  8
+#define ACPI_MTX_TABLES                 1      /* Data for ACPI tables */
+#define ACPI_MTX_NAMESPACE              2      /* ACPI Namespace */
+#define ACPI_MTX_EVENTS                 3      /* Data for ACPI events */
+#define ACPI_MTX_CACHES                 4      /* Internal caches, general purposes */
+#define ACPI_MTX_MEMORY                 5      /* Debug memory tracking lists */
+#define ACPI_MTX_DEBUG_CMD_COMPLETE     6      /* AML debugger */
+#define ACPI_MTX_DEBUG_CMD_READY        7      /* AML debugger */
+
+#define ACPI_MAX_MUTEX                  7
 #define ACPI_NUM_MUTEX                  ACPI_MAX_MUTEX+1
 
 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
@@ -98,14 +98,13 @@ union acpi_parse_object;
 
 static char *acpi_gbl_mutex_names[ACPI_NUM_MUTEX] = {
        "ACPI_MTX_Interpreter",
-       "ACPI_MTX_Method",
        "ACPI_MTX_Tables",
        "ACPI_MTX_Namespace",
        "ACPI_MTX_Events",
        "ACPI_MTX_Caches",
        "ACPI_MTX_Memory",
-       "ACPI_MTX_DebugCmdComplete",
-       "ACPI_MTX_DebugCmdReady"
+       "ACPI_MTX_CommandComplete",
+       "ACPI_MTX_CommandReady"
 };
 
 #endif
@@ -704,6 +703,13 @@ struct acpi_bit_register_info {
        u16 access_bit_mask;
 };
 
+/*
+ * Some ACPI registers have bits that must be ignored -- meaning that they
+ * must be preserved.
+ */
+#define ACPI_PM1_STATUS_PRESERVED_BITS          0x0800 /* Bit 11 */
+#define ACPI_PM1_CONTROL_PRESERVED_BITS         0x0201 /* Bit 9, Bit 0 (SCI_EN) */
+
 /*
  * Register IDs
  * These are the full ACPI registers
index 38f9aa4bef00468d8771fcd8221260186f873fb1..f1ac6109556e8d69fa53d3157bfbff877dbafb37 100644 (file)
 #define ACPI_REGISTER_PREPARE_BITS(val, pos, mask)      ((val << pos) & mask)
 #define ACPI_REGISTER_INSERT_VALUE(reg, pos, mask, val)  reg = (reg & (~(mask))) | ACPI_REGISTER_PREPARE_BITS(val, pos, mask)
 
+#define ACPI_INSERT_BITS(target, mask, source)          target = ((target & (~(mask))) | (source & mask))
+
 /* Generate a UUID */
 
 #define ACPI_INIT_UUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \
 
 #define ACPI_ALLOCATE(a)            acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__)
 #define ACPI_ALLOCATE_ZEROED(a)     acpi_ut_allocate_zeroed((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__)
-#define ACPI_FREE(a)                acpi_os_free(a)
+#define ACPI_FREE(a)                kfree(a)
 #define ACPI_MEM_TRACKING(a)
 
 #else
index 1747d94084d824308614a9c3fb3a6eeaef1db659..8fdee31119f360c1f896dcda2645ad14a72f4237 100644 (file)
@@ -140,14 +140,14 @@ struct acpi_object_package {
  *****************************************************************************/
 
 struct acpi_object_event {
-       ACPI_OBJECT_COMMON_HEADER void *semaphore;
+       ACPI_OBJECT_COMMON_HEADER acpi_semaphore os_semaphore;  /* Actual OS synchronization object */
 };
 
 struct acpi_object_mutex {
        ACPI_OBJECT_COMMON_HEADER u8 sync_level;        /* 0-15, specified in Mutex() call */
        u16 acquisition_depth;  /* Allow multiple Acquires, same thread */
        struct acpi_thread_state *owner_thread; /* Current owner of the mutex */
-       void *semaphore;        /* Actual OS synchronization object */
+       acpi_mutex os_mutex;    /* Actual OS synchronization object */
        union acpi_operand_object *prev;        /* Link for list of acquired mutexes */
        union acpi_operand_object *next;        /* Link for list of acquired mutexes */
        struct acpi_namespace_node *node;       /* Containing namespace node */
@@ -166,8 +166,8 @@ struct acpi_object_region {
 struct acpi_object_method {
        ACPI_OBJECT_COMMON_HEADER u8 method_flags;
        u8 param_count;
-       u8 concurrency;
-       void *semaphore;
+       u8 sync_level;
+       union acpi_operand_object *mutex;
        u8 *aml_start;
        ACPI_INTERNAL_METHOD implementation;
        u32 aml_length;
index a2b3e390a503ffdad7b66464bd6881ae4df1c9ee..f338e40bd54477b2af0cc26ad0dd3455619d393b 100644 (file)
@@ -334,7 +334,7 @@ int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent,
                 acpi_handle handle, int type);
 int acpi_bus_trim(struct acpi_device *start, int rmdevice);
 int acpi_bus_start(struct acpi_device *device);
-
+acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle *ejd);
 int acpi_match_ids(struct acpi_device *device, char *ids);
 int acpi_create_dir(struct acpi_device *);
 void acpi_remove_dir(struct acpi_device *);
index b425f9bb6d43962da0c4c0b134e31f76635f4b92..6a5bdcefec6438ef81f6abcf5142cb843e035886 100644 (file)
@@ -110,4 +110,21 @@ int acpi_processor_set_thermal_limit(acpi_handle handle, int type);
 
 extern int acpi_specific_hotkey_enabled;
 
+/*--------------------------------------------------------------------------
+                                  Dock Station
+  -------------------------------------------------------------------------- */
+#if defined(CONFIG_ACPI_DOCK) || defined(CONFIG_ACPI_DOCK_MODULE)
+extern int is_dock_device(acpi_handle handle);
+extern int register_dock_notifier(struct notifier_block *nb);
+extern void unregister_dock_notifier(struct notifier_block *nb);
+extern int register_hotplug_dock_device(acpi_handle handle,
+       acpi_notify_handler handler, void *context);
+extern void unregister_hotplug_dock_device(acpi_handle handle);
+#else
+#define is_dock_device(h)                      (0)
+#define register_dock_notifier(nb)             (-ENODEV)
+#define unregister_dock_notifier(nb)                   do { } while(0)
+#define register_hotplug_dock_device(h1, h2, c)        (-ENODEV)
+#define unregister_hotplug_dock_device(h)       do { } while(0)
+#endif
 #endif /*__ACPI_DRIVERS_H__*/
index 8f473c83b7c4a974684a923eae415ef4e39c9fb2..0cd63bce0ae423d1905d37448879df7c802d79ac 100644 (file)
@@ -96,33 +96,53 @@ acpi_os_table_override(struct acpi_table_header *existing_table,
                       struct acpi_table_header **new_table);
 
 /*
- * Synchronization primitives
+ * Spinlock primitives
+ */
+acpi_status acpi_os_create_lock(acpi_spinlock * out_handle);
+
+void acpi_os_delete_lock(acpi_spinlock handle);
+
+acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock handle);
+
+void acpi_os_release_lock(acpi_spinlock handle, acpi_cpu_flags flags);
+
+/*
+ * Semaphore primitives
  */
 acpi_status
 acpi_os_create_semaphore(u32 max_units,
-                        u32 initial_units, acpi_handle * out_handle);
+                        u32 initial_units, acpi_semaphore * out_handle);
 
-acpi_status acpi_os_delete_semaphore(acpi_handle handle);
+acpi_status acpi_os_delete_semaphore(acpi_semaphore handle);
 
-acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 timeout);
+acpi_status
+acpi_os_wait_semaphore(acpi_semaphore handle, u32 units, u16 timeout);
+
+acpi_status acpi_os_signal_semaphore(acpi_semaphore handle, u32 units);
+
+/*
+ * Mutex primitives
+ */
+acpi_status acpi_os_create_mutex(acpi_mutex * out_handle);
 
-acpi_status acpi_os_signal_semaphore(acpi_handle handle, u32 units);
+void acpi_os_delete_mutex(acpi_mutex handle);
 
-acpi_status acpi_os_create_lock(acpi_handle * out_handle);
+acpi_status acpi_os_acquire_mutex(acpi_mutex handle, u16 timeout);
 
-void acpi_os_delete_lock(acpi_handle handle);
+void acpi_os_release_mutex(acpi_mutex handle);
 
-acpi_cpu_flags acpi_os_acquire_lock(acpi_handle handle);
+/* Temporary macros for Mutex* interfaces, map to existing semaphore xfaces */
 
-void acpi_os_release_lock(acpi_handle handle, acpi_cpu_flags flags);
+#define acpi_os_create_mutex(out_handle)    acpi_os_create_semaphore (1, 1, out_handle)
+#define acpi_os_delete_mutex(handle)        (void) acpi_os_delete_semaphore (handle)
+#define acpi_os_acquire_mutex(handle,time)  acpi_os_wait_semaphore (handle, 1, time)
+#define acpi_os_release_mutex(handle)       (void) acpi_os_signal_semaphore (handle, 1)
 
 /*
  * Memory allocation and mapping
  */
 void *acpi_os_allocate(acpi_size size);
 
-void acpi_os_free(void *memory);
-
 acpi_status
 acpi_os_map_memory(acpi_physical_address physical_address,
                   acpi_size size, void __iomem ** logical_address);
index 77cf1236b05ac5fe45ddb2851e7c9a936ecd9db8..64b603cfe92e1df95227ddf9108d205644dd8520 100644 (file)
@@ -241,7 +241,7 @@ typedef acpi_native_uint acpi_size;
 
 /*******************************************************************************
  *
- * OS- or compiler-dependent types
+ * OS-dependent and compiler-dependent types
  *
  * If the defaults below are not appropriate for the host system, they can
  * be defined in the compiler-specific or OS-specific header, and this will
@@ -249,29 +249,36 @@ typedef acpi_native_uint acpi_size;
  *
  ******************************************************************************/
 
-/* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */
+/* Value returned by acpi_os_get_thread_id */
 
-#ifndef acpi_uintptr_t
-#define acpi_uintptr_t                  void *
+#ifndef acpi_thread_id
+#define acpi_thread_id                  acpi_native_uint
 #endif
 
-/*
- * If acpi_cache_t was not defined in the OS-dependent header,
- * define it now. This is typically the case where the local cache
- * manager implementation is to be used (ACPI_USE_LOCAL_CACHE)
- */
-#ifndef acpi_cache_t
-#define acpi_cache_t                    struct acpi_memory_list
+/* Object returned from acpi_os_create_lock */
+
+#ifndef acpi_spinlock
+#define acpi_spinlock                   void *
 #endif
 
-/*
- * Allow the CPU flags word to be defined per-OS to simplify the use of the
- * lock and unlock OSL interfaces.
- */
+/* Flags for acpi_os_acquire_lock/acpi_os_release_lock */
+
 #ifndef acpi_cpu_flags
 #define acpi_cpu_flags                  acpi_native_uint
 #endif
 
+/* Object returned from acpi_os_create_cache */
+
+#ifndef acpi_cache_t
+#define acpi_cache_t                    struct acpi_memory_list
+#endif
+
+/* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */
+
+#ifndef acpi_uintptr_t
+#define acpi_uintptr_t                  void *
+#endif
+
 /*
  * ACPI_PRINTF_LIKE is used to tag functions as "printf-like" because
  * some compilers can catch printf format string problems
@@ -298,13 +305,6 @@ typedef acpi_native_uint acpi_size;
 #define ACPI_EXPORT_SYMBOL(symbol)
 #endif
 
-/*
- * thread_id is returned by acpi_os_get_thread_id.
- */
-#ifndef acpi_thread_id
-#define acpi_thread_id                  acpi_native_uint
-#endif
-
 /*******************************************************************************
  *
  * Independent types
@@ -380,6 +380,11 @@ struct uint32_struct {
        u32 hi;
 };
 
+/* Synchronization objects */
+
+#define acpi_mutex                      void *
+#define acpi_semaphore                  void *
+
 /*
  * Acpi integer width. In ACPI version 1, integers are
  * 32 bits.  In ACPI version 2, integers are 64 bits.
index 277d35bced038525efd00abfd6b9c75355c9b28e..3f853cabbd4159d7e905e8955864171cabdd70d3 100644 (file)
 #include <asm/div64.h>
 #include <asm/acpi.h>
 #include <linux/slab.h>
+#include <linux/spinlock_types.h>
 
 /* Host-dependent types and defines */
 
 #define ACPI_MACHINE_WIDTH          BITS_PER_LONG
 #define acpi_cache_t                        kmem_cache_t
+#define acpi_spinlock                   spinlock_t *
 #define ACPI_EXPORT_SYMBOL(symbol)  EXPORT_SYMBOL(symbol);
 #define strtoul                     simple_strtoul
 
index 77371b3cdc44ef0fe03ec774407b78615060a007..9dd5b75961f84c19ba9a731eb071f15950577d75 100644 (file)
@@ -62,6 +62,7 @@ struct acpi_processor_cx {
        u32 latency_ticks;
        u32 power;
        u32 usage;
+       u64 time;
        struct acpi_processor_cx_policy promotion;
        struct acpi_processor_cx_policy demotion;
 };
diff --git a/include/asm-alpha/Kbuild b/include/asm-alpha/Kbuild
new file mode 100644 (file)
index 0000000..e57fd57
--- /dev/null
@@ -0,0 +1,5 @@
+include include/asm-generic/Kbuild.asm
+
+unifdef-y += console.h fpu.h sysinfo.h
+
+header-y += gentrap.h regdef.h pal.h reg.h
index 21816d35ef899fb4773dba6b4c390bebf968fa9a..6a9f02af95294b4995e61dfc514b88433fd4f6ff 100644 (file)
@@ -26,7 +26,7 @@
 #define fd_disable_irq()        disable_irq(FLOPPY_IRQ)
 #define fd_cacheflush(addr,size) /* nothing */
 #define fd_request_irq()        request_irq(FLOPPY_IRQ, floppy_interrupt,\
-                                           SA_INTERRUPT, "floppy", NULL)
+                                           IRQF_DISABLED, "floppy", NULL)
 #define fd_free_irq()           free_irq(FLOPPY_IRQ, NULL);
 
 #ifdef CONFIG_PCI
index fafdd4f7010a821155a86302b4262b091de286f2..1570c0b5433649e4bafeb6601bfa77aeee8d6a44 100644 (file)
@@ -36,20 +36,11 @@ struct rw_semaphore {
 #define RWSEM_ACTIVE_WRITE_BIAS                (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
        spinlock_t              wait_lock;
        struct list_head        wait_list;
-#if RWSEM_DEBUG
-       int                     debug;
-#endif
 };
 
-#if RWSEM_DEBUG
-#define __RWSEM_DEBUG_INIT      , 0
-#else
-#define __RWSEM_DEBUG_INIT     /* */
-#endif
-
 #define __RWSEM_INITIALIZER(name) \
        { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \
-       LIST_HEAD_INIT((name).wait_list) __RWSEM_DEBUG_INIT }
+       LIST_HEAD_INIT((name).wait_list) }
 
 #define DECLARE_RWSEM(name) \
        struct rw_semaphore name = __RWSEM_INITIALIZER(name)
@@ -59,9 +50,6 @@ static inline void init_rwsem(struct rw_semaphore *sem)
        sem->count = RWSEM_UNLOCKED_VALUE;
        spin_lock_init(&sem->wait_lock);
        INIT_LIST_HEAD(&sem->wait_list);
-#if RWSEM_DEBUG
-       sem->debug = 0;
-#endif
 }
 
 static inline void __down_read(struct rw_semaphore *sem)
index 1a2c52a056fb8cc23f985ea2b1aea674ab4e2262..13c2305d35ef781b2f784ea553856c53c3ee28fc 100644 (file)
@@ -77,7 +77,6 @@ typedef unsigned long sigset_t;
  * SA_FLAGS values:
  *
  * SA_ONSTACK indicates that a registered stack_t will be used.
- * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
  * SA_RESTART flag to get restarting signals (which were the default long ago)
  * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  * SA_RESETHAND clears the handler when the signal is delivered.
@@ -98,7 +97,6 @@ typedef unsigned long sigset_t;
 
 #define SA_ONESHOT     SA_RESETHAND
 #define SA_NOMASK      SA_NODEFER
-#define SA_INTERRUPT   0x20000000 /* dummy -- ignored */
 
 /* 
  * sigaltstack controls
diff --git a/include/asm-arm/Kbuild b/include/asm-arm/Kbuild
new file mode 100644 (file)
index 0000000..c68e168
--- /dev/null
@@ -0,0 +1 @@
+include include/asm-generic/Kbuild.asm
index 1fdd70b23809c145d2fea2f575acb26bd48ef247..c1ca9a4658ec9e801aa49bc2d7ba746420615c34 100644 (file)
@@ -20,7 +20,7 @@
 
 /*
  * These are data structures found in platform_device.dev.platform_data,
- * and describing board-specfic data needed by drivers.  For example,
+ * and describing board-specific data needed by drivers.  For example,
  * which pin is used for a given GPIO role.
  *
  * In 2.6, drivers should strongly avoid board-specific knowledge so
index b59520e56fc7fee72bc8262a08c9af2d8d690985..0d517267fb63edf0d49809fd64c701629e2c1d41 100644 (file)
@@ -38,7 +38,7 @@ extern int ixp4xx_pci_write(u32 addr, u32 cmd, u32 data);
  * 2) If > 64MB of memory space is required, the IXP4xx can be configured
  *    to use indirect registers to access PCI (as we do below for I/O
  *    transactions). This allows for up to 128MB (0x48000000 to 0x4fffffff)
- *    of memory on the bus. The disadvantadge of this is that every 
+ *    of memory on the bus. The disadvantage of this is that every 
  *    PCI access requires three local register accesses plus a spinlock,
  *    but in some cases the performance hit is acceptable. In addition,
  *    you cannot mmap() PCI devices in this case.
diff --git a/include/asm-arm/arch-omap/board-fsample.h b/include/asm-arm/arch-omap/board-fsample.h
new file mode 100644 (file)
index 0000000..89a1e52
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * linux/include/asm-arm/arch-omap/board-fsample.h
+ *
+ * Board-specific goodies for TI F-Sample.
+ *
+ * Copyright (C) 2006 Google, Inc.
+ * Author: Brian Swetland <swetland@google.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __ASM_ARCH_OMAP_FSAMPLE_H
+#define __ASM_ARCH_OMAP_FSAMPLE_H
+
+/* fsample is pretty close to p2-sample */
+#include <asm/arch/board-perseus2.h>
+
+#define fsample_cpld_read(reg) __raw_readb(reg)
+#define fsample_cpld_write(val, reg) __raw_writeb(val, reg)
+
+#define FSAMPLE_CPLD_BASE    0xE8100000
+#define FSAMPLE_CPLD_SIZE    SZ_4K
+#define FSAMPLE_CPLD_START   0x05080000
+
+#define FSAMPLE_CPLD_REG_A   (FSAMPLE_CPLD_BASE + 0x00)
+#define FSAMPLE_CPLD_SWITCH  (FSAMPLE_CPLD_BASE + 0x02)
+#define FSAMPLE_CPLD_UART    (FSAMPLE_CPLD_BASE + 0x02)
+#define FSAMPLE_CPLD_REG_B   (FSAMPLE_CPLD_BASE + 0x04)
+#define FSAMPLE_CPLD_VERSION (FSAMPLE_CPLD_BASE + 0x06)
+#define FSAMPLE_CPLD_SET_CLR (FSAMPLE_CPLD_BASE + 0x06)
+
+#define FSAMPLE_CPLD_BIT_BT_RESET         0
+#define FSAMPLE_CPLD_BIT_LCD_RESET        1
+#define FSAMPLE_CPLD_BIT_CAM_PWDN         2
+#define FSAMPLE_CPLD_BIT_CHARGER_ENABLE   3
+#define FSAMPLE_CPLD_BIT_SD_MMC_EN        4
+#define FSAMPLE_CPLD_BIT_aGPS_PWREN       5
+#define FSAMPLE_CPLD_BIT_BACKLIGHT        6
+#define FSAMPLE_CPLD_BIT_aGPS_EN_RESET    7
+#define FSAMPLE_CPLD_BIT_aGPS_SLEEPx_N    8
+#define FSAMPLE_CPLD_BIT_OTG_RESET        9
+
+#define fsample_cpld_set(bit) \
+    fsample_cpld_write((((bit) & 15) << 4) | 0x0f, FSAMPLE_CPLD_SET_CLR)
+
+#define fsample_cpld_clear(bit) \
+    fsample_cpld_write(0xf0 | ((bit) & 15), FSAMPLE_CPLD_SET_CLR)
+
+#endif
index dfdbf06fd646c5a14d053fc36606054945b8b3aa..edf1dc6ad919b45ec807807762c1cdcd37c487e8 100644 (file)
@@ -22,6 +22,7 @@
 #define OMAP_TAG_UART          0x4f07
 #define OMAP_TAG_FBMEM         0x4f08
 #define OMAP_TAG_STI_CONSOLE   0x4f09
+#define OMAP_TAG_CAMERA_SENSOR 0x4f0a
 
 #define OMAP_TAG_BOOT_REASON    0x4f80
 #define OMAP_TAG_FLASH_PART    0x4f81
@@ -61,6 +62,12 @@ struct omap_sti_console_config {
        u8 channel;
 };
 
+struct omap_camera_sensor_config {
+       u16 reset_gpio;
+       int (*power_on)(void * data);
+       int (*power_off)(void * data);
+};
+
 struct omap_usb_config {
        /* Configure drivers according to the connectors on your board:
         *  - "A" connector (rectagular)
index ca1202312a45724bae12f410cc35a1bf0bd161b5..1b1b02307e77f5c600ed32064915bf0594158511 100644 (file)
 /* DMA channels for 24xx */
 #define OMAP24XX_DMA_NO_DEVICE         0
 #define OMAP24XX_DMA_XTI_DMA           1       /* S_DMA_0 */
-#define OMAP24XX_DMA_EXT_NDMA_REQ0     2       /* S_DMA_1 */
-#define OMAP24XX_DMA_EXT_NDMA_REQ1     3       /* S_DMA_2 */
+#define OMAP24XX_DMA_EXT_DMAREQ0       2       /* S_DMA_1 */
+#define OMAP24XX_DMA_EXT_DMAREQ1       3       /* S_DMA_2 */
 #define OMAP24XX_DMA_GPMC              4       /* S_DMA_3 */
 #define OMAP24XX_DMA_GFX               5       /* S_DMA_4 */
 #define OMAP24XX_DMA_DSS               6       /* S_DMA_5 */
 #define OMAP24XX_DMA_DES_TX            11      /* S_DMA_10 */
 #define OMAP24XX_DMA_DES_RX            12      /* S_DMA_11 */
 #define OMAP24XX_DMA_SHA1MD5_RX                13      /* S_DMA_12 */
-
+#define OMAP24XX_DMA_EXT_DMAREQ2       14      /* S_DMA_13 */
+#define OMAP24XX_DMA_EXT_DMAREQ3       15      /* S_DMA_14 */
+#define OMAP24XX_DMA_EXT_DMAREQ4       16      /* S_DMA_15 */
 #define OMAP24XX_DMA_EAC_AC_RD         17      /* S_DMA_16 */
 #define OMAP24XX_DMA_EAC_AC_WR         18      /* S_DMA_17 */
 #define OMAP24XX_DMA_EAC_MD_UL_RD      19      /* S_DMA_18 */
 #define OMAP24XX_DMA_MMC1_TX           61      /* SDMA_60 */
 #define OMAP24XX_DMA_MMC1_RX           62      /* SDMA_61 */
 #define OMAP24XX_DMA_MS                        63      /* SDMA_62 */
+#define OMAP24XX_DMA_EXT_DMAREQ5       64      /* S_DMA_63 */
 
 /*----------------------------------------------------------------------------*/
 
 #define OMAP1610_DMA_LCD_LCH_CTRL      (OMAP1610_DMA_LCD_BASE + 0xea)
 #define OMAP1610_DMA_LCD_SRC_FI_B1_U   (OMAP1610_DMA_LCD_BASE + 0xf4)
 
-#define OMAP_DMA_TOUT_IRQ              (1 << 0)        /* Only on omap1 */
+#define OMAP1_DMA_TOUT_IRQ             (1 << 0)
 #define OMAP_DMA_DROP_IRQ              (1 << 1)
 #define OMAP_DMA_HALF_IRQ              (1 << 2)
 #define OMAP_DMA_FRAME_IRQ             (1 << 3)
@@ -315,11 +318,11 @@ enum {
        OMAP_LCD_DMA_B2_BOTTOM
 };
 
-/* REVISIT: Check if BURST_4 is really 1 (or 2) */
 enum omap_dma_burst_mode {
        OMAP_DMA_DATA_BURST_DIS = 0,
        OMAP_DMA_DATA_BURST_4,
-       OMAP_DMA_DATA_BURST_8
+       OMAP_DMA_DATA_BURST_8,
+       OMAP_DMA_DATA_BURST_16,
 };
 
 enum omap_dma_color_mode {
index e6522e6a38344dee5c19c19549a767ee4fca5a50..7a289ff07404c3b333c756e5b751316b9bfffb88 100644 (file)
@@ -5,6 +5,7 @@
  *
  * Copyright (C) 2005 Nokia Corporation
  * Author: Lauri Leukkunen <lauri.leukkunen@nokia.com>
+ * PWM and clock framwork support by Timo Teras.
  *
  * 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
  * 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#ifndef __ASM_ARCH_TIMER_H
-#define __ASM_ARCH_TIMER_H
-
-#include <linux/list.h>
-
-#define OMAP_TIMER_SRC_ARMXOR          0x00
-#define OMAP_TIMER_SRC_32_KHZ          0x01
-#define OMAP_TIMER_SRC_EXT_CLK         0x02
-
-/* timer control reg bits */
-#define OMAP_TIMER_CTRL_CAPTMODE       (1 << 13)
-#define OMAP_TIMER_CTRL_PT             (1 << 12)
-#define OMAP_TIMER_CTRL_TRG_OVERFLOW   (0x1 << 10)
-#define OMAP_TIMER_CTRL_TRG_OFANDMATCH (0x2 << 10)
-#define OMAP_TIMER_CTRL_TCM_LOWTOHIGH  (0x1 << 8)
-#define OMAP_TIMER_CTRL_TCM_HIGHTOLOW  (0x2 << 8)
-#define OMAP_TIMER_CTRL_TCM_BOTHEDGES  (0x3 << 8)
-#define OMAP_TIMER_CTRL_SCPWM          (1 << 7)
-#define OMAP_TIMER_CTRL_CE             (1 << 6)        /* compare enable */
-#define OMAP_TIMER_CTRL_PRE            (1 << 5)        /* prescaler enable */
-#define OMAP_TIMER_CTRL_PTV_SHIFT      2               /* how much to shift the prescaler value */
-#define OMAP_TIMER_CTRL_AR             (1 << 1)        /* auto-reload enable */
-#define OMAP_TIMER_CTRL_ST             (1 << 0)        /* start timer */
+#ifndef __ASM_ARCH_DMTIMER_H
+#define __ASM_ARCH_DMTIMER_H
 
-/* timer interrupt enable bits */
-#define OMAP_TIMER_INT_CAPTURE         (1 << 2)
-#define OMAP_TIMER_INT_OVERFLOW                (1 << 1)
-#define OMAP_TIMER_INT_MATCH           (1 << 0)
+/* clock sources */
+#define OMAP_TIMER_SRC_SYS_CLK                 0x00
+#define OMAP_TIMER_SRC_32_KHZ                  0x01
+#define OMAP_TIMER_SRC_EXT_CLK                 0x02
 
+/* timer interrupt enable bits */
+#define OMAP_TIMER_INT_CAPTURE                 (1 << 2)
+#define OMAP_TIMER_INT_OVERFLOW                        (1 << 1)
+#define OMAP_TIMER_INT_MATCH                   (1 << 0)
 
-struct omap_dm_timer {
-       struct list_head timer_list;
+/* trigger types */
+#define OMAP_TIMER_TRIGGER_NONE                        0x00
+#define OMAP_TIMER_TRIGGER_OVERFLOW            0x01
+#define OMAP_TIMER_TRIGGER_OVERFLOW_AND_COMPARE        0x02
 
-       u32 base;
-       unsigned int irq;
-};
+struct omap_dm_timer;
+struct clk;
 
-u32 omap_dm_timer_read_reg(struct omap_dm_timer *timer, int reg);
-void omap_dm_timer_write_reg(struct omap_dm_timer *timer, int reg, u32 value);
+int omap_dm_timer_init(void);
 
-struct omap_dm_timer * omap_dm_timer_request(void);
+struct omap_dm_timer *omap_dm_timer_request(void);
+struct omap_dm_timer *omap_dm_timer_request_specific(int timer_id);
 void omap_dm_timer_free(struct omap_dm_timer *timer);
-void omap_dm_timer_set_source(struct omap_dm_timer *timer, int source);
 
-void omap_dm_timer_set_int_enable(struct omap_dm_timer *timer, unsigned int value);
-void omap_dm_timer_set_trigger(struct omap_dm_timer *timer, unsigned int value);
-void omap_dm_timer_enable_compare(struct omap_dm_timer *timer);
-void omap_dm_timer_enable_autoreload(struct omap_dm_timer *timer);
+int omap_dm_timer_get_irq(struct omap_dm_timer *timer);
+
+u32 omap_dm_timer_modify_idlect_mask(u32 inputmask);
+struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer);
 
 void omap_dm_timer_trigger(struct omap_dm_timer *timer);
 void omap_dm_timer_start(struct omap_dm_timer *timer);
 void omap_dm_timer_stop(struct omap_dm_timer *timer);
 
-void omap_dm_timer_set_load(struct omap_dm_timer *timer, unsigned int load);
-void omap_dm_timer_set_match(struct omap_dm_timer *timer, unsigned int match);
+void omap_dm_timer_set_source(struct omap_dm_timer *timer, int source);
+void omap_dm_timer_set_load(struct omap_dm_timer *timer, int autoreload, unsigned int value);
+void omap_dm_timer_set_match(struct omap_dm_timer *timer, int enable, unsigned int match);
+void omap_dm_timer_set_pwm(struct omap_dm_timer *timer, int def_on, int toggle, int trigger);
+void omap_dm_timer_set_prescaler(struct omap_dm_timer *timer, int prescaler);
+
+void omap_dm_timer_set_int_enable(struct omap_dm_timer *timer, unsigned int value);
 
 unsigned int omap_dm_timer_read_status(struct omap_dm_timer *timer);
 void omap_dm_timer_write_status(struct omap_dm_timer *timer, unsigned int value);
-
 unsigned int omap_dm_timer_read_counter(struct omap_dm_timer *timer);
-void omap_dm_timer_reset_counter(struct omap_dm_timer *timer);
+void omap_dm_timer_write_counter(struct omap_dm_timer *timer, unsigned int value);
 
 int omap_dm_timers_active(void);
-u32 omap_dm_timer_modify_idlect_mask(u32 inputmask);
 
-#endif /* __ASM_ARCH_TIMER_H */
+
+#endif /* __ASM_ARCH_DMTIMER_H */
diff --git a/include/asm-arm/arch-omap/gpmc.h b/include/asm-arm/arch-omap/gpmc.h
new file mode 100644 (file)
index 0000000..1a0a520
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * General-Purpose Memory Controller for OMAP2
+ *
+ * Copyright (C) 2005-2006 Nokia Corporation
+ *
+ * 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 __OMAP2_GPMC_H
+#define __OMAP2_GPMC_H
+
+#define GPMC_CS_CONFIG1                0x00
+#define GPMC_CS_CONFIG2                0x04
+#define GPMC_CS_CONFIG3                0x08
+#define GPMC_CS_CONFIG4                0x0c
+#define GPMC_CS_CONFIG5                0x10
+#define GPMC_CS_CONFIG6                0x14
+#define GPMC_CS_CONFIG7                0x18
+#define GPMC_CS_NAND_COMMAND   0x1c
+#define GPMC_CS_NAND_ADDRESS   0x20
+#define GPMC_CS_NAND_DATA      0x24
+
+#define GPMC_CONFIG1_WRAPBURST_SUPP     (1 << 31)
+#define GPMC_CONFIG1_READMULTIPLE_SUPP  (1 << 20)
+#define GPMC_CONFIG1_READTYPE_ASYNC     (0 << 29)
+#define GPMC_CONFIG1_READTYPE_SYNC      (1 << 29)
+#define GPMC_CONFIG1_WRITETYPE_ASYNC    (0 << 27)
+#define GPMC_CONFIG1_WRITETYPE_SYNC     (1 << 27)
+#define GPMC_CONFIG1_CLKACTIVATIONTIME(val) ((val & 3) << 25)
+#define GPMC_CONFIG1_PAGE_LEN(val)      ((val & 3) << 23)
+#define GPMC_CONFIG1_WAIT_READ_MON      (1 << 22)
+#define GPMC_CONFIG1_WAIT_WRITE_MON     (1 << 21)
+#define GPMC_CONFIG1_WAIT_MON_IIME(val) ((val & 3) << 18)
+#define GPMC_CONFIG1_WAIT_PIN_SEL(val)  ((val & 3) << 16)
+#define GPMC_CONFIG1_DEVICESIZE(val)    ((val & 3) << 12)
+#define GPMC_CONFIG1_DEVICESIZE_16      GPMC_CONFIG1_DEVICESIZE(1)
+#define GPMC_CONFIG1_DEVICETYPE(val)    ((val & 3) << 10)
+#define GPMC_CONFIG1_DEVICETYPE_NOR     GPMC_CONFIG1_DEVICETYPE(0)
+#define GPMC_CONFIG1_DEVICETYPE_NAND    GPMC_CONFIG1_DEVICETYPE(1)
+#define GPMC_CONFIG1_MUXADDDATA         (1 << 9)
+#define GPMC_CONFIG1_TIME_PARA_GRAN     (1 << 4)
+#define GPMC_CONFIG1_FCLK_DIV(val)      (val & 3)
+#define GPMC_CONFIG1_FCLK_DIV2          (GPMC_CONFIG1_FCLK_DIV(1))
+#define GPMC_CONFIG1_FCLK_DIV3          (GPMC_CONFIG1_FCLK_DIV(2))
+#define GPMC_CONFIG1_FCLK_DIV4          (GPMC_CONFIG1_FCLK_DIV(3))
+
+/*
+ * Note that all values in this struct are in nanoseconds, while
+ * the register values are in gpmc_fck cycles.
+ */
+struct gpmc_timings {
+       /* Minimum clock period for synchronous mode */
+       u16 sync_clk;
+
+       /* Chip-select signal timings corresponding to GPMC_CS_CONFIG2 */
+       u16 cs_on;              /* Assertion time */
+       u16 cs_rd_off;          /* Read deassertion time */
+       u16 cs_wr_off;          /* Write deassertion time */
+
+       /* ADV signal timings corresponding to GPMC_CONFIG3 */
+       u16 adv_on;             /* Assertion time */
+       u16 adv_rd_off;         /* Read deassertion time */
+       u16 adv_wr_off;         /* Write deassertion time */
+
+       /* WE signals timings corresponding to GPMC_CONFIG4 */
+       u16 we_on;              /* WE assertion time */
+       u16 we_off;             /* WE deassertion time */
+
+       /* OE signals timings corresponding to GPMC_CONFIG4 */
+       u16 oe_on;              /* OE assertion time */
+       u16 oe_off;             /* OE deassertion time */
+
+       /* Access time and cycle time timings corresponding to GPMC_CONFIG5 */
+       u16 page_burst_access;  /* Multiple access word delay */
+       u16 access;             /* Start-cycle to first data valid delay */
+       u16 rd_cycle;           /* Total read cycle time */
+       u16 wr_cycle;           /* Total write cycle time */
+};
+
+extern unsigned int gpmc_ns_to_ticks(unsigned int time_ns);
+
+extern void gpmc_cs_write_reg(int cs, int idx, u32 val);
+extern u32 gpmc_cs_read_reg(int cs, int idx);
+extern int gpmc_cs_calc_divider(int cs, unsigned int sync_clk);
+extern int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t);
+extern unsigned long gpmc_cs_get_base_addr(int cs);
+
+
+#endif
index c7d9e857795df7fde58111cbec5fb8b5b65d6036..481048d65214815d85b22568b742995f3ea3269d 100644 (file)
 #include "board-perseus2.h"
 #endif
 
+#ifdef CONFIG_MACH_OMAP_FSAMPLE
+#include "board-fsample.h"
+#endif
+
 #ifdef CONFIG_MACH_OMAP_H3
 #include "board-h3.h"
 #endif
index 42098d99f302293748180d99649158086b9579dd..2542495d8a435db14adc3baaaa1429d8bc114c49 100644 (file)
 #define INT_24XX_GPIO_BANK2    30
 #define INT_24XX_GPIO_BANK3    31
 #define INT_24XX_GPIO_BANK4    32
+#define INT_24XX_GPTIMER1      37
+#define INT_24XX_GPTIMER2      38
+#define INT_24XX_GPTIMER3      39
+#define INT_24XX_GPTIMER4      40
+#define INT_24XX_GPTIMER5      41
+#define INT_24XX_GPTIMER6      42
+#define INT_24XX_GPTIMER7      43
+#define INT_24XX_GPTIMER8      44
+#define INT_24XX_GPTIMER9      45
+#define INT_24XX_GPTIMER10     46
+#define INT_24XX_GPTIMER11     47
+#define INT_24XX_GPTIMER12     48
 #define INT_24XX_MCBSP1_IRQ_TX 59
 #define INT_24XX_MCBSP1_IRQ_RX 60
 #define INT_24XX_MCBSP2_IRQ_TX 62
 #define INT_24XX_MCBSP2_IRQ_RX 63
+#define INT_24XX_UART1_IRQ     72
+#define INT_24XX_UART2_IRQ     73
 #define INT_24XX_UART3_IRQ     74
 
 /* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730) and
index 0dc24d4ba59c7f7d291216299dae512c5dfd446d..679869c5e68fbdd0ff4aca17028645cb9ee5bab6 100644 (file)
@@ -410,6 +410,12 @@ enum omap24xx_index {
        /* 24xx clock */
        W14_24XX_SYS_CLKOUT,
 
+       /* 24xx GPMC wait pin monitoring */
+       L3_GPMC_WAIT0,
+       N7_GPMC_WAIT1,
+       M1_GPMC_WAIT2,
+       P1_GPMC_WAIT3,
+
        /* 242X McBSP */
        Y15_24XX_MCBSP2_CLKX,
        R14_24XX_MCBSP2_FSX,
@@ -429,6 +435,26 @@ enum omap24xx_index {
        M15_24XX_GPIO92,
        V14_24XX_GPIO117,
 
+       /* 242x DBG GPIO */
+       V4_242X_GPIO49,
+       W2_242X_GPIO50,
+       U4_242X_GPIO51,
+       V3_242X_GPIO52,
+       V2_242X_GPIO53,
+       V6_242X_GPIO53,
+       T4_242X_GPIO54,
+       Y4_242X_GPIO54,
+       T3_242X_GPIO55,
+       U2_242X_GPIO56,
+
+       /* 24xx external DMA requests */
+       AA10_242X_DMAREQ0,
+       AA6_242X_DMAREQ1,
+       E4_242X_DMAREQ2,
+       G4_242X_DMAREQ3,
+       D3_242X_DMAREQ4,
+       E3_242X_DMAREQ5,
+
        P20_24XX_TSC_IRQ,
 
        /* UART3 */
index 05b003f3a94c6e78511fead8eadf40788e297306..e46623c61a729aca1df5547c7cfc2b52d070618b 100644 (file)
@@ -299,10 +299,43 @@ enum omap24xx_save_state {
        OMAP24XX_SLEEP_SAVE_INTC_MIR0,
        OMAP24XX_SLEEP_SAVE_INTC_MIR1,
        OMAP24XX_SLEEP_SAVE_INTC_MIR2,
+
+       OMAP24XX_SLEEP_SAVE_CM_CLKSTCTRL_MPU,
+       OMAP24XX_SLEEP_SAVE_CM_CLKSTCTRL_CORE,
+       OMAP24XX_SLEEP_SAVE_CM_CLKSTCTRL_GFX,
+       OMAP24XX_SLEEP_SAVE_CM_CLKSTCTRL_DSP,
+       OMAP24XX_SLEEP_SAVE_CM_CLKSTCTRL_MDM,
+
+       OMAP24XX_SLEEP_SAVE_PM_PWSTCTRL_MPU,
+       OMAP24XX_SLEEP_SAVE_PM_PWSTCTRL_CORE,
+       OMAP24XX_SLEEP_SAVE_PM_PWSTCTRL_GFX,
+       OMAP24XX_SLEEP_SAVE_PM_PWSTCTRL_DSP,
+       OMAP24XX_SLEEP_SAVE_PM_PWSTCTRL_MDM,
+
+       OMAP24XX_SLEEP_SAVE_CM_IDLEST1_CORE,
+       OMAP24XX_SLEEP_SAVE_CM_IDLEST2_CORE,
+       OMAP24XX_SLEEP_SAVE_CM_IDLEST3_CORE,
+       OMAP24XX_SLEEP_SAVE_CM_IDLEST4_CORE,
+       OMAP24XX_SLEEP_SAVE_CM_IDLEST_GFX,
+       OMAP24XX_SLEEP_SAVE_CM_IDLEST_WKUP,
+       OMAP24XX_SLEEP_SAVE_CM_IDLEST_CKGEN,
+       OMAP24XX_SLEEP_SAVE_CM_IDLEST_DSP,
+       OMAP24XX_SLEEP_SAVE_CM_IDLEST_MDM,
+
+       OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE1_CORE,
+       OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE2_CORE,
+       OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE3_CORE,
+       OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE4_CORE,
+       OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE_WKUP,
+       OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE_PLL,
+       OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE_DSP,
+       OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE_MDM,
+
        OMAP24XX_SLEEP_SAVE_CM_FCLKEN1_CORE,
        OMAP24XX_SLEEP_SAVE_CM_FCLKEN2_CORE,
        OMAP24XX_SLEEP_SAVE_CM_ICLKEN1_CORE,
        OMAP24XX_SLEEP_SAVE_CM_ICLKEN2_CORE,
+       OMAP24XX_SLEEP_SAVE_CM_ICLKEN3_CORE,
        OMAP24XX_SLEEP_SAVE_CM_ICLKEN4_CORE,
        OMAP24XX_SLEEP_SAVE_GPIO1_IRQENABLE1,
        OMAP24XX_SLEEP_SAVE_GPIO2_IRQENABLE1,
index 9f83f4adfbf3592331b40713c563158bea6ced22..f5cc65dd7d0d31e4e08abfaf19a488c6580c8dc0 100644 (file)
 #define GPIO84_NSRXD           84      /* NSSP receive */
 #define GPIO85_nPCE_1          85      /* Card Enable for Card Space (PXA27x) */
 #define GPIO92_MMCDAT0         92      /* MMC DAT0 (PXA27x) */
+#define GPIO102_nPCE_1         102     /* PCMCIA (PXA27x) */
 #define GPIO109_MMCDAT1                109     /* MMC DAT1 (PXA27x) */
 #define GPIO110_MMCDAT2                110     /* MMC DAT2 (PXA27x) */
 #define GPIO110_MMCCS0         110     /* MMC Chip Select 0 (PXA27x) */
 #define GPIO84_NSSP_RX         (84 | GPIO_ALT_FN_2_IN)
 #define GPIO85_nPCE_1_MD       (85 | GPIO_ALT_FN_1_OUT)
 #define GPIO92_MMCDAT0_MD      (92 | GPIO_ALT_FN_1_OUT)
+#define GPIO102_nPCE_1_MD      (102 | GPIO_ALT_FN_1_OUT)
 #define GPIO104_pSKTSEL_MD     (104 | GPIO_ALT_FN_1_OUT)
 #define GPIO109_MMCDAT1_MD     (109 | GPIO_ALT_FN_1_OUT)
 #define GPIO110_MMCDAT2_MD     (110 | GPIO_ALT_FN_1_OUT)
diff --git a/include/asm-arm/arch-pxa/trizeps4.h b/include/asm-arm/arch-pxa/trizeps4.h
new file mode 100644 (file)
index 0000000..641d0ec
--- /dev/null
@@ -0,0 +1,106 @@
+/************************************************************************
+ * Include file for TRIZEPS4 SoM and ConXS eval-board
+ * Copyright (c) Jürgen Schindele
+ * 2006
+ ************************************************************************/
+
+/*
+ * Includes/Defines
+ */
+#ifndef _TRIPEPS4_H_
+#define _TRIPEPS4_H_
+
+/* physical memory regions */
+#define TRIZEPS4_FLASH_PHYS    (PXA_CS0_PHYS)  /* Flash region */
+#define TRIZEPS4_DISK_PHYS     (PXA_CS1_PHYS)  /* Disk On Chip region */
+#define TRIZEPS4_ETH_PHYS      (PXA_CS2_PHYS)  /* Ethernet DM9000 region */
+#define TRIZEPS4_PIC_PHYS      (PXA_CS3_PHYS)  /* Logic chip on ConXS-Board */
+#define TRIZEPS4_SDRAM_BASE    0xa0000000      /* SDRAM region */
+
+#define TRIZEPS4_CFSR_PHYS     (PXA_CS3_PHYS)                  /* Logic chip on ConXS-Board CSFR register */
+#define TRIZEPS4_BOCR_PHYS     (PXA_CS3_PHYS+0x02000000)       /* Logic chip on ConXS-Board BOCR register */
+#define TRIZEPS4_IRCR_PHYS     (PXA_CS3_PHYS+0x02400000)       /* Logic chip on ConXS-Board IRCR register*/
+#define TRIZEPS4_UPSR_PHYS     (PXA_CS3_PHYS+0x02800000)       /* Logic chip on ConXS-Board UPSR register*/
+#define TRIZEPS4_DICR_PHYS     (PXA_CS3_PHYS+0x03800000)       /* Logic chip on ConXS-Board DICR register*/
+
+/* virtual memory regions */
+#define TRIZEPS4_DISK_VIRT     0xF0000000      /* Disk On Chip region */
+
+#define TRIZEPS4_PIC_VIRT      0xF0100000      /* not used */
+#define TRIZEPS4_CFSR_VIRT     0xF0100000
+#define TRIZEPS4_BOCR_VIRT     0xF0200000
+#define TRIZEPS4_DICR_VIRT     0xF0300000
+#define TRIZEPS4_IRCR_VIRT     0xF0400000
+#define TRIZEPS4_UPSR_VIRT     0xF0500000
+
+/* size of flash */
+#define TRIZEPS4_FLASH_SIZE    0x02000000      /* Flash size 32 MB */
+
+/* Ethernet Controller Davicom DM9000 */
+#define GPIO_DM9000            101
+#define TRIZEPS4_ETH_IRQ       IRQ_GPIO(GPIO_DM9000)
+
+/* UCB1400 audio / TS-controller */
+#define GPIO_UCB1400           1
+#define TRIZEPS4_UCB1400_IRQ   IRQ_GPIO(GPIO_UCB1400)
+
+/* PCMCIA socket Compact Flash */
+#define GPIO_PCD               11              /* PCMCIA Card Detect */
+#define TRIZEPS4_CD_IRQ                IRQ_GPIO(GPIO_PCD)
+#define GPIO_PRDY              13              /* READY / nINT */
+#define TRIZEPS4_READY_NINT    IRQ_GPIO(GPIO_PRDY)
+
+/* MMC socket */
+#define GPIO_MMC_DET           12
+#define TRIZEPS4_MMC_IRQ       IRQ_GPIO(GPIO_MMC_DET)
+
+/* LEDS using tx2 / rx2 */
+#define GPIO_SYS_BUSY_LED      46
+#define GPIO_HEARTBEAT_LED     47
+
+/* Off-module PIC on ConXS board */
+#define GPIO_PIC               0
+#define TRIZEPS4_PIC_IRQ       IRQ_GPIO(GPIO_PIC)
+
+#define CFSR_P2V(x)            ((x) - TRIZEPS4_CFSR_PHYS + TRIZEPS4_CFSR_VIRT)
+#define CFSR_V2P(x)            ((x) - TRIZEPS4_CFSR_VIRT + TRIZEPS4_CFSR_PHYS)
+
+#define BCR_P2V(x)             ((x) - TRIZEPS4_BOCR_PHYS + TRIZEPS4_BOCR_VIRT)
+#define BCR_V2P(x)             ((x) - TRIZEPS4_BOCR_VIRT + TRIZEPS4_BOCR_PHYS)
+
+#define DCR_P2V(x)             ((x) - TRIZEPS4_DICR_PHYS + TRIZEPS4_DICR_VIRT)
+#define DCR_V2P(x)             ((x) - TRIZEPS4_DICR_VIRT + TRIZEPS4_DICR_PHYS)
+
+#ifndef __ASSEMBLY__
+#define ConXS_CFSR             (*((volatile unsigned short *)CFSR_P2V(0x0C000000)))
+#define ConXS_BCR              (*((volatile unsigned short *)BCR_P2V(0x0E000000)))
+#define ConXS_DCR              (*((volatile unsigned short *)DCR_P2V(0x0F800000)))
+#else
+#define ConXS_CFSR             CFSR_P2V(0x0C000000)
+#define ConXS_BCR              BCR_P2V(0x0E000000)
+#define ConXS_DCR              DCR_P2V(0x0F800000)
+#endif
+
+#define ConXS_CFSR_BVD_MASK    0x0003
+#define ConXS_CFSR_BVD1                (1 << 0)
+#define ConXS_CFSR_BVD2                (1 << 1)
+#define ConXS_CFSR_VS_MASK     0x000C
+#define ConXS_CFSR_VS1         (1 << 2)
+#define ConXS_CFSR_VS2         (1 << 3)
+#define ConXS_CFSR_VS_5V       (0x3 << 2)
+#define ConXS_CFSR_VS_3V3      0x0
+
+#define ConXS_BCR_S0_POW_EN0   (1 << 0)
+#define ConXS_BCR_S0_POW_EN1   (1 << 1)
+#define ConXS_BCR_L_DISP       (1 << 4)
+#define ConXS_BCR_CF_BUF_EN    (1 << 5)
+#define ConXS_BCR_CF_RESET     (1 << 7)
+#define ConXS_BCR_S0_VCC_3V3   0x1
+#define ConXS_BCR_S0_VCC_5V0   0x2
+#define ConXS_BCR_S0_VPP_12V   0x4
+#define ConXS_BCR_S0_VPP_3V3   0x8
+
+#define ConXS_IRCR_MODE                (1 << 0)
+#define ConXS_IRCR_SD          (1 << 1)
+
+#endif /* _TRIPEPS4_H_ */
index 7fb02138f585985dd810407a82a8643bb3874d9f..0e36fd5d87df2f3d1771a9f34581cf82e17dfc2b 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _ASMARM_BUG_H
 #define _ASMARM_BUG_H
 
-#include <linux/config.h>
 
 #ifdef CONFIG_BUG
 #ifdef CONFIG_DEBUG_BUGVERBOSE
diff --git a/include/asm-arm/dyntick.h b/include/asm-arm/dyntick.h
new file mode 100644 (file)
index 0000000..19fab2d
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef _ASMARM_DYNTICK_H
+#define _ASMARM_DYNTICK_H
+
+#include <asm/mach/time.h>
+
+#endif /* _ASMARM_DYNTICK_H */
index aa0c8d28d8d946ae6b3de0785c5a5aef0b6701e5..54b5ae44ed94498151572c7fa1e0a193e1ec20e9 100644 (file)
@@ -25,7 +25,7 @@
 
 #define fd_inb(port)           inb((port))
 #define fd_request_irq()       request_irq(IRQ_FLOPPYDISK,floppy_interrupt,\
-                                           SA_INTERRUPT,"floppy",NULL)
+                                           IRQF_DISABLED,"floppy",NULL)
 #define fd_free_irq()          free_irq(IRQ_FLOPPYDISK,NULL)
 #define fd_disable_irq()       disable_irq(IRQ_FLOPPYDISK)
 #define fd_enable_irq()                enable_irq(IRQ_FLOPPYDISK)
diff --git a/include/asm-arm/hw_irq.h b/include/asm-arm/hw_irq.h
new file mode 100644 (file)
index 0000000..ea85697
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * Nothing to see here yet
+ */
+#ifndef _ARCH_ARM_HW_IRQ_H
+#define _ARCH_ARM_HW_IRQ_H
+
+#include <asm/mach/irq.h>
+
+#if defined(CONFIG_NO_IDLE_HZ)
+# include <asm/dyntick.h>
+# define handle_dynamic_tick(action)                                   \
+       if (!(action->flags & IRQF_TIMER) && system_timer->dyn_tick) {  \
+               write_seqlock(&xtime_lock);                             \
+               if (system_timer->dyn_tick->state & DYN_TICK_ENABLED)   \
+                       system_timer->dyn_tick->handler(irq, 0, regs);  \
+               write_sequnlock(&xtime_lock);                           \
+       }
+#endif
+
+#endif
index 66e67e60bc563af489fbd1d16d04e2560d65bbbf..283af50a16cb359e7ee0709a0d81efb982cc952f 100644 (file)
 
 struct irqaction;
 
-extern void disable_irq_nosync(unsigned int);
-extern void disable_irq(unsigned int);
-extern void enable_irq(unsigned int);
-
 /*
- * These correspond with the SA_TRIGGER_* defines, and therefore the
- * IORESOURCE_IRQ_* defines.
+ * Migration helpers
  */
-#define __IRQT_RISEDGE (1 << 0)
-#define __IRQT_FALEDGE (1 << 1)
-#define __IRQT_HIGHLVL (1 << 2)
-#define __IRQT_LOWLVL  (1 << 3)
+#define __IRQT_FALEDGE IRQ_TYPE_EDGE_FALLING
+#define __IRQT_RISEDGE IRQ_TYPE_EDGE_RISING
+#define __IRQT_LOWLVL  IRQ_TYPE_LEVEL_LOW
+#define __IRQT_HIGHLVL IRQ_TYPE_LEVEL_HIGH
 
 #define IRQT_NOEDGE    (0)
 #define IRQT_RISING    (__IRQT_RISEDGE)
@@ -40,12 +35,7 @@ extern void enable_irq(unsigned int);
 #define IRQT_BOTHEDGE  (__IRQT_RISEDGE|__IRQT_FALEDGE)
 #define IRQT_LOW       (__IRQT_LOWLVL)
 #define IRQT_HIGH      (__IRQT_HIGHLVL)
-#define IRQT_PROBE     (1 << 4)
-
-int set_irq_type(unsigned int irq, unsigned int type);
-void disable_irq_wake(unsigned int irq);
-void enable_irq_wake(unsigned int irq);
-int setup_irq(unsigned int, struct irqaction *);
+#define IRQT_PROBE     IRQ_TYPE_PROBE
 
 extern void migrate_irqs(void);
 #endif
index d4d420ecf3a826c37293fad7406a8cf9354bb5c8..131f33733d25597167f4d67462a032455920f5d4 100644 (file)
 #ifndef __ASM_ARM_MACH_IRQ_H
 #define __ASM_ARM_MACH_IRQ_H
 
-struct irqdesc;
-struct pt_regs;
-struct seq_file;
-
-typedef void (*irq_handler_t)(unsigned int, struct irqdesc *, struct pt_regs *);
-typedef void (*irq_control_t)(unsigned int);
-
-struct irqchip {
-       /*
-        * Acknowledge the IRQ.
-        * If this is a level-based IRQ, then it is expected to mask the IRQ
-        * as well.
-        */
-       void (*ack)(unsigned int);
-       /*
-        * Mask the IRQ in hardware.
-        */
-       void (*mask)(unsigned int);
-       /*
-        * Unmask the IRQ in hardware.
-        */
-       void (*unmask)(unsigned int);
-       /*
-        * Ask the hardware to re-trigger the IRQ.
-        * Note: This method _must_ _not_ call the interrupt handler.
-        * If you are unable to retrigger the interrupt, do not
-        * provide a function, or if you do, return non-zero.
-        */
-       int (*retrigger)(unsigned int);
-       /*
-        * Set the type of the IRQ.
-        */
-       int (*set_type)(unsigned int, unsigned int);
-       /*
-        * Set wakeup-enable on the selected IRQ
-        */
-       int (*set_wake)(unsigned int, unsigned int);
-
-#ifdef CONFIG_SMP
-       /*
-        * Route an interrupt to a CPU
-        */
-       void (*set_cpu)(struct irqdesc *desc, unsigned int irq, unsigned int cpu);
-#endif
-};
-
-struct irqdesc {
-       irq_handler_t   handle;
-       struct irqchip  *chip;
-       struct irqaction *action;
-       struct list_head pend;
-       void __iomem    *base;
-       void            *data;
-       unsigned int    disable_depth;
-
-       unsigned int    triggered: 1;           /* IRQ has occurred           */
-       unsigned int    running  : 1;           /* IRQ is running             */
-       unsigned int    pending  : 1;           /* IRQ is pending             */
-       unsigned int    probing  : 1;           /* IRQ in use for a probe     */
-       unsigned int    probe_ok : 1;           /* IRQ can be used for probe  */
-       unsigned int    valid    : 1;           /* IRQ claimable              */
-       unsigned int    noautoenable : 1;       /* don't automatically enable IRQ */
-       unsigned int    unused   :25;
-
-       unsigned int    irqs_unhandled;
-       struct proc_dir_entry *procdir;
-
-#ifdef CONFIG_SMP
-       cpumask_t       affinity;
-       unsigned int    cpu;
-#endif
-
-       /*
-        * IRQ lock detection
-        */
-       unsigned int    lck_cnt;
-       unsigned int    lck_pc;
-       unsigned int    lck_jif;
-};
-
-extern struct irqdesc irq_desc[];
+#include <linux/irq.h>
 
-/*
- * Helpful inline function for calling irq descriptor handlers.
- */
-static inline void desc_handle_irq(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
-{
-       desc->handle(irq, desc, regs);
-}
+struct seq_file;
 
 /*
  * This is internal.  Do not use it.
@@ -106,18 +20,22 @@ static inline void desc_handle_irq(unsigned int irq, struct irqdesc *desc, struc
 extern void (*init_arch_irq)(void);
 extern void init_FIQ(void);
 extern int show_fiq_list(struct seq_file *, void *);
-void __set_irq_handler(unsigned int irq, irq_handler_t, int);
 
 /*
- * External stuff.
+ * Function wrappers
+ */
+#define set_irq_chipdata(irq, d)       set_irq_chip_data(irq, d)
+#define get_irq_chipdata(irq)          get_irq_chip_data(irq)
+
+/*
+ * Obsolete inline function for calling irq descriptor handlers.
  */
-#define set_irq_handler(irq,handler)           __set_irq_handler(irq,handler,0)
-#define set_irq_chained_handler(irq,handler)   __set_irq_handler(irq,handler,1)
-#define set_irq_data(irq,d)                    do { irq_desc[irq].data = d; } while (0)
-#define set_irq_chipdata(irq,d)                        do { irq_desc[irq].base = d; } while (0)
-#define get_irq_chipdata(irq)                  (irq_desc[irq].base)
+static inline void desc_handle_irq(unsigned int irq, struct irq_desc *desc,
+                                  struct pt_regs *regs)
+{
+       desc->handle_irq(irq, desc, regs);
+}
 
-void set_irq_chip(unsigned int irq, struct irqchip *);
 void set_irq_flags(unsigned int irq, unsigned int flags);
 
 #define IRQF_VALID     (1 << 0)
@@ -125,12 +43,25 @@ void set_irq_flags(unsigned int irq, unsigned int flags);
 #define IRQF_NOAUTOEN  (1 << 2)
 
 /*
- * Built-in IRQ handlers.
+ * This is for easy migration, but should be changed in the source
  */
-void do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs);
-void do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs);
-void do_simple_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs);
-void do_bad_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs);
-void dummy_mask_unmask_irq(unsigned int irq);
+#define do_level_IRQ   handle_level_irq
+#define do_edge_IRQ    handle_edge_irq
+#define do_simple_IRQ  handle_simple_irq
+#define irqdesc                irq_desc
+#define irqchip                irq_chip
+
+#define do_bad_IRQ(irq,desc,regs)                      \
+do {                                                   \
+       spin_lock(&desc->lock);                         \
+       handle_bad_irq(irq, desc, regs);                \
+       spin_unlock(&desc->lock);                       \
+} while(0)
+
+extern unsigned long irq_err_count;
+static inline void ack_bad_irq(int irq)
+{
+       irq_err_count++;
+}
 
 #endif
index 9f28073559e8f6140788546012acecdd16479330..dee0bc336fe8393ae8e13b4079a1a3f3eab6f328 100644 (file)
@@ -69,6 +69,7 @@ extern void timer_tick(struct pt_regs *);
 /*
  * Kernel time keeping support.
  */
+struct timespec;
 extern int (*set_rtc)(void);
 extern void save_time_delta(struct timespec *delta, struct timespec *rtc);
 extern void restore_time_delta(struct timespec *delta, struct timespec *rtc);
index 94f973b704f1578f1f88e42dec61a8ac2670007d..91d536c215d79fc700b5c79f0dfb185bc6003eba 100644 (file)
  */
 #define XIP_VIRT_ADDR(physaddr)  (MODULE_START + ((physaddr) & 0x000fffff))
 
+/*
+ * Allow 16MB-aligned ioremap pages
+ */
+#define IOREMAP_MAX_ORDER      24
+
 #else /* CONFIG_MMU */
 
 /*
index 23dde52e0945f31c24ddd9fc4ddc1b8e66a74163..fe2a23b5627bc41639aa8d0626c152149366b4ee 100644 (file)
@@ -7,6 +7,7 @@ typedef struct {
 #if __LINUX_ARM_ARCH__ >= 6
        unsigned int id;
 #endif
+       unsigned int kvm_seq;
 } mm_context_t;
 
 #if __LINUX_ARM_ARCH__ >= 6
index 9fadb01e030d15a4fd67dda4ac143ff52406be46..d1a65b1edcaab236f0a65706380f60e85d26fc04 100644 (file)
@@ -17,6 +17,8 @@
 #include <asm/cacheflush.h>
 #include <asm/proc-fns.h>
 
+void __check_kvm_seq(struct mm_struct *mm);
+
 #if __LINUX_ARM_ARCH__ >= 6
 
 /*
@@ -45,13 +47,21 @@ static inline void check_context(struct mm_struct *mm)
 {
        if (unlikely((mm->context.id ^ cpu_last_asid) >> ASID_BITS))
                __new_context(mm);
+
+       if (unlikely(mm->context.kvm_seq != init_mm.context.kvm_seq))
+               __check_kvm_seq(mm);
 }
 
 #define init_new_context(tsk,mm)       (__init_new_context(tsk,mm),0)
 
 #else
 
-#define check_context(mm)              do { } while (0)
+static inline void check_context(struct mm_struct *mm)
+{
+       if (unlikely(mm->context.kvm_seq != init_mm.context.kvm_seq))
+               __check_kvm_seq(mm);
+}
+
 #define init_new_context(tsk,mm)       0
 
 #endif
index 1bc1f997bda2a9d6658ed4bcf6668199603f9120..f3b5120c99fef34b598dd110790cc008eb815f7e 100644 (file)
@@ -28,6 +28,7 @@
  */
 #define PMD_SECT_BUFFERABLE    (1 << 2)
 #define PMD_SECT_CACHEABLE     (1 << 3)
+#define PMD_SECT_XN            (1 << 4)        /* v6 */
 #define PMD_SECT_AP_WRITE      (1 << 10)
 #define PMD_SECT_AP_READ       (1 << 11)
 #define PMD_SECT_TEX(x)                ((x) << 12)     /* v5 */
index 842526055225a02e88a7cc9d8ed34a8c49ef8c21..edb7b6502fcf8c33d2a816b02ebf7e96012670cd 100644 (file)
@@ -29,7 +29,8 @@ struct processor;
 struct proc_info_list {
        unsigned int            cpu_val;
        unsigned int            cpu_mask;
-       unsigned long           __cpu_mmu_flags;        /* used by head.S */
+       unsigned long           __cpu_mm_mmu_flags;     /* used by head.S */
+       unsigned long           __cpu_io_mmu_flags;     /* used by head.S */
        unsigned long           __cpu_flush;            /* used by head.S */
        const char              *arch_name;
        const char              *elf_name;
index ced69161917b802cd3184017cdd1614f0477f86b..d0fb487aba4f268811d96abc1a37cec2d3bbfdfd 100644 (file)
@@ -82,7 +82,6 @@ typedef unsigned long sigset_t;
  *                     is running in 26-bit.
  * SA_ONSTACK          allows alternate signal stacks (see sigaltstack(2)).
  * SA_RESTART          flag to get restarting signals (which were the default long ago)
- * SA_INTERRUPT                is a no-op, but left due to historical reasons. Use the
  * SA_NODEFER          prevents the current signal from being masked in the handler.
  * SA_RESETHAND                clears the handler when the signal is delivered.
  *
@@ -101,7 +100,6 @@ typedef unsigned long sigset_t;
 
 #define SA_NOMASK      SA_NODEFER
 #define SA_ONESHOT     SA_RESETHAND
-#define SA_INTERRUPT   0x20000000 /* dummy -- ignored */
 
 
 /* 
@@ -113,10 +111,6 @@ typedef unsigned long sigset_t;
 #define MINSIGSTKSZ    2048
 #define SIGSTKSZ       8192
 
-#ifdef __KERNEL__
-#define SA_TIMER               0x40000000
-#endif
-
 #include <asm-generic/signal.h>
 
 #ifdef __KERNEL__
index c46b5c84275f3f2f5b2ac91d8a60002963fdc9f5..f28b236139ed4000ed907015601629bf99b26808 100644 (file)
@@ -111,12 +111,13 @@ extern void iwmmxt_task_disable(struct thread_info *);
 extern void iwmmxt_task_copy(struct thread_info *, void *);
 extern void iwmmxt_task_restore(struct thread_info *, void *);
 extern void iwmmxt_task_release(struct thread_info *);
+extern void iwmmxt_task_switch(struct thread_info *);
 
 #endif
 
 /*
  * We use bit 30 of the preempt_count to indicate that kernel
- * preemption is occuring.  See include/asm-arm/hardirq.h.
+ * preemption is occurring.  See include/asm-arm/hardirq.h.
  */
 #define PREEMPT_ACTIVE 0x40000000
 
diff --git a/include/asm-arm26/Kbuild b/include/asm-arm26/Kbuild
new file mode 100644 (file)
index 0000000..c68e168
--- /dev/null
@@ -0,0 +1 @@
+include include/asm-generic/Kbuild.asm
index a18af069ca28844ea155ad79f23393933f716dc8..efb732165a4ffed9abcf8e1402b2e3cfb348de5c 100644 (file)
@@ -22,7 +22,7 @@
 
 #define fd_inb(port)           inb((port))
 #define fd_request_irq()       request_irq(IRQ_FLOPPYDISK,floppy_interrupt,\
-                                       SA_INTERRUPT,"floppy",NULL)
+                                       IRQF_DISABLED,"floppy",NULL)
 #define fd_free_irq()          free_irq(IRQ_FLOPPYDISK,NULL)
 #define fd_disable_irq()       disable_irq(IRQ_FLOPPYDISK)
 #define fd_enable_irq()                enable_irq(IRQ_FLOPPYDISK)
index 37ad25355591f57bdbc3fb3dbc3795c2a452b818..967ba4947e401376877ecce7f39effa6bf5d6eed 100644 (file)
@@ -82,7 +82,6 @@ typedef unsigned long sigset_t;
  *                     is running in 26-bit.
  * SA_ONSTACK          allows alternate signal stacks (see sigaltstack(2)).
  * SA_RESTART          flag to get restarting signals (which were the default long ago)
- * SA_INTERRUPT                is a no-op, but left due to historical reasons. Use the
  * SA_NODEFER          prevents the current signal from being masked in the handler.
  * SA_RESETHAND                clears the handler when the signal is delivered.
  *
@@ -101,7 +100,6 @@ typedef unsigned long sigset_t;
 
 #define SA_NOMASK      SA_NODEFER
 #define SA_ONESHOT     SA_RESETHAND
-#define SA_INTERRUPT   0x20000000 /* dummy -- ignored */
 
 
 /* 
diff --git a/include/asm-cris/Kbuild b/include/asm-cris/Kbuild
new file mode 100644 (file)
index 0000000..c68e168
--- /dev/null
@@ -0,0 +1 @@
+include include/asm-generic/Kbuild.asm
index 4fa8945b02637fd6dfb2104ddae421fae7573b6a..b1128a9984ae5aa344ae34b226cb6854e2544c88 100644 (file)
@@ -141,7 +141,7 @@ __asm__ ( \
  * it here, we would not get the multiple_irq at all.
  *
  * The non-blocking here is based on the knowledge that the timer interrupt is 
- * registred as a fast interrupt (SA_INTERRUPT) so that we _know_ there will not
+ * registred as a fast interrupt (IRQF_DISABLED) so that we _know_ there will not
  * be an sti() before the timer irq handler is run to acknowledge the interrupt.
  */
 
index dba3c285cacd5bbcd34d1fe41fbeaff504f79379..081a911d7af179dba91e367b548636f767b5e788 100644 (file)
@@ -20,8 +20,8 @@ enum
   arbiter_all_accesses = 0xff
 };
 
-int crisv32_arbiter_allocate_bandwith(int client, int region,
-                                      unsigned long bandwidth);
+int crisv32_arbiter_allocate_bandwidth(int client, int region,
+                                      unsigned long bandwidth);
 int crisv32_arbiter_watch(unsigned long start, unsigned long size,
                           unsigned long clients, unsigned long accesses,
                           watch_callback* cb);
index eeb0a80262c88ed0df39c8649639850a0d88b789..bac94ee6bc90bd5e259ad95c6ea18d5d38896c9d 100644 (file)
@@ -98,7 +98,7 @@ __asm__ (                             \
  * if we had BLOCK'edit here, we would not get the multiple_irq at all.
  *
  * The non-blocking here is based on the knowledge that the timer interrupt is
- * registred as a fast interrupt (SA_INTERRUPT) so that we _know_ there will not
+ * registred as a fast interrupt (IRQF_DISABLED) so that we _know_ there will not
  * be an sti() before the timer irq handler is run to acknowledge the interrupt.
  */
 #define BUILD_TIMER_IRQ(nr, mask)      \
index dfe039593a78d067e9478826a2fac0876b4d0d27..349ae682b568625083fd2dcbf3f8e157a4251ab6 100644 (file)
@@ -74,7 +74,6 @@ typedef unsigned long sigset_t;
  * SA_FLAGS values:
  *
  * SA_ONSTACK indicates that a registered stack_t will be used.
- * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
  * SA_RESTART flag to get restarting signals (which were the default long ago)
  * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  * SA_RESETHAND clears the handler when the signal is delivered.
@@ -95,7 +94,6 @@ typedef unsigned long sigset_t;
 
 #define SA_NOMASK      SA_NODEFER
 #define SA_ONESHOT     SA_RESETHAND
-#define SA_INTERRUPT   0x20000000 /* dummy -- ignored */
 
 #define SA_RESTORER    0x04000000
 
diff --git a/include/asm-frv/Kbuild b/include/asm-frv/Kbuild
new file mode 100644 (file)
index 0000000..c68e168
--- /dev/null
@@ -0,0 +1 @@
+include include/asm-generic/Kbuild.asm
index 686fb2b39d6a5e11014d993a0df658c36ff7c029..ac3ab900a1dce05ef4f6e7e25e3b61d73a563ba0 100644 (file)
@@ -51,7 +51,7 @@ struct irq_source {
 struct irq_level {
        int                     usage;
        int                     disable_count;
-       unsigned long           flags;          /* current SA_INTERRUPT and SA_SHIRQ settings */
+       unsigned long           flags;          /* current IRQF_DISABLED and IRQF_SHARED settings */
        spinlock_t              lock;
        struct irq_source       *sources;
 };
index dcc1b35929188af5df9dab5d8e93fa365960e32d..2079197d483d3855e1539f00ef4b650e6b36dc3b 100644 (file)
@@ -74,7 +74,6 @@ typedef unsigned long sigset_t;
  * SA_FLAGS values:
  *
  * SA_ONSTACK indicates that a registered stack_t will be used.
- * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
  * SA_RESTART flag to get restarting signals (which were the default long ago)
  * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  * SA_RESETHAND clears the handler when the signal is delivered.
@@ -94,7 +93,6 @@ typedef unsigned long sigset_t;
 
 #define SA_NOMASK      SA_NODEFER
 #define SA_ONESHOT     SA_RESETHAND
-#define SA_INTERRUPT   0x20000000 /* dummy -- ignored */
 
 #define SA_RESTORER    0x04000000
 
diff --git a/include/asm-generic/Kbuild b/include/asm-generic/Kbuild
new file mode 100644 (file)
index 0000000..70594b2
--- /dev/null
@@ -0,0 +1,3 @@
+header-y += atomic.h errno-base.h errno.h fcntl.h ioctl.h ipc.h mman.h \
+       signal.h statfs.h
+unifdef-y := resource.h siginfo.h
diff --git a/include/asm-generic/Kbuild.asm b/include/asm-generic/Kbuild.asm
new file mode 100644 (file)
index 0000000..d8d0bce
--- /dev/null
@@ -0,0 +1,11 @@
+unifdef-y += a.out.h auxvec.h byteorder.h errno.h fcntl.h ioctl.h      \
+       ioctls.h ipcbuf.h irq.h mman.h msgbuf.h param.h poll.h          \
+       posix_types.h ptrace.h resource.h sembuf.h shmbuf.h shmparam.h  \
+       sigcontext.h siginfo.h signal.h socket.h sockios.h stat.h       \
+       statfs.h termbits.h termios.h timex.h types.h unistd.h user.h
+
+# These really shouldn't be exported
+unifdef-y += atomic.h io.h
+
+# These probably shouldn't be exported
+unifdef-y += elf.h page.h
diff --git a/include/asm-generic/audit_change_attr.h b/include/asm-generic/audit_change_attr.h
new file mode 100644 (file)
index 0000000..cb05bf6
--- /dev/null
@@ -0,0 +1,18 @@
+__NR_chmod,
+__NR_fchmod,
+__NR_chown,
+__NR_fchown,
+__NR_lchown,
+__NR_setxattr,
+__NR_lsetxattr,
+__NR_fsetxattr,
+__NR_removexattr,
+__NR_lremovexattr,
+__NR_fremovexattr,
+__NR_fchownat,
+__NR_fchmodat,
+#ifdef __NR_chown32
+__NR_chown32,
+__NR_fchown32,
+__NR_lchown32,
+#endif
diff --git a/include/asm-generic/audit_dir_write.h b/include/asm-generic/audit_dir_write.h
new file mode 100644 (file)
index 0000000..161a7a5
--- /dev/null
@@ -0,0 +1,14 @@
+__NR_rename,
+__NR_mkdir,
+__NR_rmdir,
+__NR_creat,
+__NR_link,
+__NR_unlink,
+__NR_symlink,
+__NR_mknod,
+__NR_mkdirat,
+__NR_mknodat,
+__NR_unlinkat,
+__NR_renameat,
+__NR_linkat,
+__NR_symlinkat,
index 5cf8b7ce0c456085a536818d13e011e10b4ee6b7..254a126ede5c694fc4b024c5b43c192c13b928d8 100644 (file)
 #ifndef _ASM_GENERIC_MUTEX_NULL_H
 #define _ASM_GENERIC_MUTEX_NULL_H
 
-/* extra parameter only needed for mutex debugging: */
-#ifndef __IP__
-# define __IP__
-#endif
-
-#define __mutex_fastpath_lock(count, fail_fn)        fail_fn(count __RET_IP__)
-#define __mutex_fastpath_lock_retval(count, fail_fn)  fail_fn(count __RET_IP__)
-#define __mutex_fastpath_unlock(count, fail_fn)       fail_fn(count __RET_IP__)
-#define __mutex_fastpath_trylock(count, fail_fn)      fail_fn(count)
-#define __mutex_slowpath_needs_to_unlock()           1
+#define __mutex_fastpath_lock(count, fail_fn)          fail_fn(count)
+#define __mutex_fastpath_lock_retval(count, fail_fn)   fail_fn(count)
+#define __mutex_fastpath_unlock(count, fail_fn)                fail_fn(count)
+#define __mutex_fastpath_trylock(count, fail_fn)       fail_fn(count)
+#define __mutex_slowpath_needs_to_unlock()             1
 
 #endif
index c745211574614bfdc5f8a63c7510bbc4a79e749f..e160e04290fb9ed2e0977e0a460a49ec18f62a81 100644 (file)
@@ -7,6 +7,8 @@
 
 extern unsigned long __per_cpu_offset[NR_CPUS];
 
+#define per_cpu_offset(x) (__per_cpu_offset[x])
+
 /* Separate out the type, so (int[3], foo) works. */
 #define DEFINE_PER_CPU(type, name) \
     __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name
index 0b49f9e070f14ac2ac780e0b7e4170d7677ed399..962cad7cfbbda0849cc68380b43c2da97643f23c 100644 (file)
@@ -14,5 +14,6 @@ extern char _end[];
 extern char __per_cpu_start[], __per_cpu_end[];
 extern char __kprobes_text_start[], __kprobes_text_end[];
 extern char __initdata_begin[], __initdata_end[];
+extern char __start_rodata[], __end_rodata[];
 
 #endif /* _ASM_GENERIC_SECTIONS_H_ */
diff --git a/include/asm-h8300/Kbuild b/include/asm-h8300/Kbuild
new file mode 100644 (file)
index 0000000..c68e168
--- /dev/null
@@ -0,0 +1 @@
+include include/asm-generic/Kbuild.asm
index 8eccdc1761635a71ff3802726694297647bebf76..7bc15048a64f810ad4a0fee4475cd31c1ba4c975 100644 (file)
@@ -74,7 +74,6 @@ typedef unsigned long sigset_t;
  * SA_FLAGS values:
  *
  * SA_ONSTACK indicates that a registered stack_t will be used.
- * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
  * SA_RESTART flag to get restarting signals (which were the default long ago)
  * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  * SA_RESETHAND clears the handler when the signal is delivered.
@@ -94,7 +93,6 @@ typedef unsigned long sigset_t;
 
 #define SA_NOMASK      SA_NODEFER
 #define SA_ONESHOT     SA_RESETHAND
-#define SA_INTERRUPT   0x20000000 /* dummy -- ignored */
 
 #define SA_RESTORER    0x04000000
 
diff --git a/include/asm-i386/Kbuild b/include/asm-i386/Kbuild
new file mode 100644 (file)
index 0000000..c064a8e
--- /dev/null
@@ -0,0 +1,5 @@
+include include/asm-generic/Kbuild.asm
+
+header-y += boot.h cpufeature.h debugreg.h ldt.h setup.h ucontext.h
+
+unifdef-y += mtrr.h vm86.h
index c61bd1a17f3706a959b1b120977237ee65852628..96adbabec7406fe2c285baad3629257ac8579702 100644 (file)
@@ -19,11 +19,19 @@ struct alt_instr {
 extern void apply_alternatives(struct alt_instr *start, struct alt_instr *end);
 
 struct module;
+#ifdef CONFIG_SMP
 extern void alternatives_smp_module_add(struct module *mod, char *name,
                                        void *locks, void *locks_end,
                                        void *text, void *text_end);
 extern void alternatives_smp_module_del(struct module *mod);
 extern void alternatives_smp_switch(int smp);
+#else
+static inline void alternatives_smp_module_add(struct module *mod, char *name,
+                                       void *locks, void *locks_end,
+                                       void *text, void *text_end) {}
+static inline void alternatives_smp_module_del(struct module *mod) {}
+static inline void alternatives_smp_switch(int smp) {}
+#endif
 
 #endif
 
index 9cb2793eb211d1597c40ebe19e9cdd7bd6cb819e..359ead60b7189f33e5b3989e78e4bff1fd732341 100644 (file)
@@ -144,11 +144,11 @@ static int vdma_get_dma_residue(unsigned int dummy)
 static int fd_request_irq(void)
 {
        if(can_use_virtual_dma)
-               return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT,
-                                                  "floppy", NULL);
+               return request_irq(FLOPPY_IRQ, floppy_hardint,
+                                  IRQF_DISABLED, "floppy", NULL);
        else
-               return request_irq(FLOPPY_IRQ, floppy_interrupt, SA_INTERRUPT,
-                                  "floppy", NULL);
+               return request_irq(FLOPPY_IRQ, floppy_interrupt,
+                                  IRQF_DISABLED, "floppy", NULL);
 
 }
 
diff --git a/include/asm-i386/irqflags.h b/include/asm-i386/irqflags.h
new file mode 100644 (file)
index 0000000..e1bdb97
--- /dev/null
@@ -0,0 +1,127 @@
+/*
+ * include/asm-i386/irqflags.h
+ *
+ * IRQ flags handling
+ *
+ * This file gets included from lowlevel asm headers too, to provide
+ * wrapped versions of the local_irq_*() APIs, based on the
+ * raw_local_irq_*() functions from the lowlevel headers.
+ */
+#ifndef _ASM_IRQFLAGS_H
+#define _ASM_IRQFLAGS_H
+
+#ifndef __ASSEMBLY__
+
+static inline unsigned long __raw_local_save_flags(void)
+{
+       unsigned long flags;
+
+       __asm__ __volatile__(
+               "pushfl ; popl %0"
+               : "=g" (flags)
+               : /* no input */
+       );
+
+       return flags;
+}
+
+#define raw_local_save_flags(flags) \
+               do { (flags) = __raw_local_save_flags(); } while (0)
+
+static inline void raw_local_irq_restore(unsigned long flags)
+{
+       __asm__ __volatile__(
+               "pushl %0 ; popfl"
+               : /* no output */
+               :"g" (flags)
+               :"memory", "cc"
+       );
+}
+
+static inline void raw_local_irq_disable(void)
+{
+       __asm__ __volatile__("cli" : : : "memory");
+}
+
+static inline void raw_local_irq_enable(void)
+{
+       __asm__ __volatile__("sti" : : : "memory");
+}
+
+/*
+ * Used in the idle loop; sti takes one instruction cycle
+ * to complete:
+ */
+static inline void raw_safe_halt(void)
+{
+       __asm__ __volatile__("sti; hlt" : : : "memory");
+}
+
+/*
+ * Used when interrupts are already enabled or to
+ * shutdown the processor:
+ */
+static inline void halt(void)
+{
+       __asm__ __volatile__("hlt": : :"memory");
+}
+
+static inline int raw_irqs_disabled_flags(unsigned long flags)
+{
+       return !(flags & (1 << 9));
+}
+
+static inline int raw_irqs_disabled(void)
+{
+       unsigned long flags = __raw_local_save_flags();
+
+       return raw_irqs_disabled_flags(flags);
+}
+
+/*
+ * For spinlocks, etc:
+ */
+static inline unsigned long __raw_local_irq_save(void)
+{
+       unsigned long flags = __raw_local_save_flags();
+
+       raw_local_irq_disable();
+
+       return flags;
+}
+
+#define raw_local_irq_save(flags) \
+               do { (flags) = __raw_local_irq_save(); } while (0)
+
+#endif /* __ASSEMBLY__ */
+
+/*
+ * Do the CPU's IRQ-state tracing from assembly code. We call a
+ * C function, so save all the C-clobbered registers:
+ */
+#ifdef CONFIG_TRACE_IRQFLAGS
+
+# define TRACE_IRQS_ON                         \
+       pushl %eax;                             \
+       pushl %ecx;                             \
+       pushl %edx;                             \
+       call trace_hardirqs_on;                 \
+       popl %edx;                              \
+       popl %ecx;                              \
+       popl %eax;
+
+# define TRACE_IRQS_OFF                                \
+       pushl %eax;                             \
+       pushl %ecx;                             \
+       pushl %edx;                             \
+       call trace_hardirqs_off;                \
+       popl %edx;                              \
+       popl %ecx;                              \
+       popl %eax;
+
+#else
+# define TRACE_IRQS_ON
+# define TRACE_IRQS_OFF
+#endif
+
+#endif
index be4ab859238ec3322e44c0e221deb17e339f3b2d..2f07601562e752a3a2646ffc67b8fba06e7c9c91 100644 (file)
@@ -40,6 +40,7 @@
 
 #include <linux/list.h>
 #include <linux/spinlock.h>
+#include <linux/lockdep.h>
 
 struct rwsem_waiter;
 
@@ -61,36 +62,34 @@ struct rw_semaphore {
 #define RWSEM_ACTIVE_WRITE_BIAS                (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
        spinlock_t              wait_lock;
        struct list_head        wait_list;
-#if RWSEM_DEBUG
-       int                     debug;
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+       struct lockdep_map dep_map;
 #endif
 };
 
-/*
- * initialisation
- */
-#if RWSEM_DEBUG
-#define __RWSEM_DEBUG_INIT      , 0
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+# define __RWSEM_DEP_MAP_INIT(lockname) , .dep_map = { .name = #lockname }
 #else
-#define __RWSEM_DEBUG_INIT     /* */
+# define __RWSEM_DEP_MAP_INIT(lockname)
 #endif
 
+
 #define __RWSEM_INITIALIZER(name) \
 { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) \
-       __RWSEM_DEBUG_INIT }
+       __RWSEM_DEP_MAP_INIT(name) }
 
 #define DECLARE_RWSEM(name) \
        struct rw_semaphore name = __RWSEM_INITIALIZER(name)
 
-static inline void init_rwsem(struct rw_semaphore *sem)
-{
-       sem->count = RWSEM_UNLOCKED_VALUE;
-       spin_lock_init(&sem->wait_lock);
-       INIT_LIST_HEAD(&sem->wait_list);
-#if RWSEM_DEBUG
-       sem->debug = 0;
-#endif
-}
+extern void __init_rwsem(struct rw_semaphore *sem, const char *name,
+                        struct lock_class_key *key);
+
+#define init_rwsem(sem)                                                \
+do {                                                           \
+       static struct lock_class_key __key;                     \
+                                                               \
+       __init_rwsem((sem), #sem, &__key);                      \
+} while (0)
 
 /*
  * lock for reading
@@ -143,7 +142,7 @@ LOCK_PREFIX "  cmpxchgl  %2,%0\n\t"
 /*
  * lock for writing
  */
-static inline void __down_write(struct rw_semaphore *sem)
+static inline void __down_write_nested(struct rw_semaphore *sem, int subclass)
 {
        int tmp;
 
@@ -167,6 +166,11 @@ LOCK_PREFIX        "  xadd      %%edx,(%%eax)\n\t" /* subtract 0x0000ffff, returns the
                : "memory", "cc");
 }
 
+static inline void __down_write(struct rw_semaphore *sem)
+{
+       __down_write_nested(sem, 0);
+}
+
 /*
  * trylock for writing -- returns 1 if successful, 0 if contention
  */
index 026fd231488dc9729302a7b02de7d463fa07c35d..3824a502351f545ca997e14a5ff6cfe226e594f4 100644 (file)
@@ -77,7 +77,6 @@ typedef unsigned long sigset_t;
  * SA_FLAGS values:
  *
  * SA_ONSTACK indicates that a registered stack_t will be used.
- * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
  * SA_RESTART flag to get restarting signals (which were the default long ago)
  * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  * SA_RESETHAND clears the handler when the signal is delivered.
@@ -97,7 +96,6 @@ typedef unsigned long sigset_t;
 
 #define SA_NOMASK      SA_NODEFER
 #define SA_ONESHOT     SA_RESETHAND
-#define SA_INTERRUPT   0x20000000 /* dummy -- ignored */
 
 #define SA_RESTORER    0x04000000
 
index 04ba30234c486e383e73127a34cb3ea8bc3bb898..87c40f8306532b1bf4cf854bc39180f1ebe11098 100644 (file)
        "jmp 1b\n" \
        "3:\n\t"
 
+/*
+ * NOTE: there's an irqs-on section here, which normally would have to be
+ * irq-traced, but on CONFIG_TRACE_IRQFLAGS we never use
+ * __raw_spin_lock_string_flags().
+ */
 #define __raw_spin_lock_string_flags \
        "\n1:\t" \
        "lock ; decb %0\n\t" \
@@ -63,6 +68,12 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock)
                "=m" (lock->slock) : : "memory");
 }
 
+/*
+ * It is easier for the lock validator if interrupts are not re-enabled
+ * in the middle of a lock-acquire. This is a performance feature anyway
+ * so we turn it off:
+ */
+#ifndef CONFIG_PROVE_LOCKING
 static inline void __raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long flags)
 {
        alternative_smp(
@@ -70,6 +81,7 @@ static inline void __raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long fla
                __raw_spin_lock_string_up,
                "=m" (lock->slock) : "r" (flags) : "memory");
 }
+#endif
 
 static inline int __raw_spin_trylock(raw_spinlock_t *lock)
 {
index cab0180567f978164dd6bc3e7a566db1316273b6..db398d88b1d950eaad4ae4296dd14169b4faf826 100644 (file)
@@ -456,25 +456,7 @@ static inline unsigned long long __cmpxchg64(volatile void *ptr, unsigned long l
 
 #define set_wmb(var, value) do { var = value; wmb(); } while (0)
 
-/* interrupt control.. */
-#define local_save_flags(x)    do { typecheck(unsigned long,x); __asm__ __volatile__("pushfl ; popl %0":"=g" (x): /* no input */); } while (0)
-#define local_irq_restore(x)   do { typecheck(unsigned long,x); __asm__ __volatile__("pushl %0 ; popfl": /* no output */ :"g" (x):"memory", "cc"); } while (0)
-#define local_irq_disable()    __asm__ __volatile__("cli": : :"memory")
-#define local_irq_enable()     __asm__ __volatile__("sti": : :"memory")
-/* used in the idle loop; sti takes one instruction cycle to complete */
-#define safe_halt()            __asm__ __volatile__("sti; hlt": : :"memory")
-/* used when interrupts are already enabled or to shutdown the processor */
-#define halt()                 __asm__ __volatile__("hlt": : :"memory")
-
-#define irqs_disabled()                        \
-({                                     \
-       unsigned long flags;            \
-       local_save_flags(flags);        \
-       !(flags & (1<<9));              \
-})
-
-/* For spinlocks etc */
-#define local_irq_save(x)      __asm__ __volatile__("pushfl ; popl %0 ; cli":"=g" (x): /* no input */ :"memory")
+#include <linux/irqflags.h>
 
 /*
  * disable hlt during certain critical i/o operations
diff --git a/include/asm-ia64/Kbuild b/include/asm-ia64/Kbuild
new file mode 100644 (file)
index 0000000..85d6f80
--- /dev/null
@@ -0,0 +1,7 @@
+include include/asm-generic/Kbuild.asm
+
+header-y += break.h fpu.h fpswa.h gcc_intrin.h ia64regs.h              \
+        intel_intrin.h intrinsics.h perfmon_default_smpl.h     \
+        ptrace_offsets.h rse.h setup.h ucontext.h
+
+unifdef-y += perfmon.h
index 24d898b650c5ddd0142c4747db2ea8ed06c6f61e..fbe5cf3ab8dc0db74001a074960e8217b92bcb06 100644 (file)
@@ -36,6 +36,7 @@
 #ifdef CONFIG_SMP
 
 extern unsigned long __per_cpu_offset[NR_CPUS];
+#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 1327c91ea39c77f0752c94e0a83cb49cac26089d..2d1640cc240a72adae31ec3033bbbdce37f96eb8 100644 (file)
@@ -33,9 +33,6 @@ struct rw_semaphore {
        signed long             count;
        spinlock_t              wait_lock;
        struct list_head        wait_list;
-#if RWSEM_DEBUG
-       int                     debug;
-#endif
 };
 
 #define RWSEM_UNLOCKED_VALUE           __IA64_UL_CONST(0x0000000000000000)
@@ -45,19 +42,9 @@ struct rw_semaphore {
 #define RWSEM_ACTIVE_READ_BIAS         RWSEM_ACTIVE_BIAS
 #define RWSEM_ACTIVE_WRITE_BIAS                (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
 
-/*
- * initialization
- */
-#if RWSEM_DEBUG
-#define __RWSEM_DEBUG_INIT      , 0
-#else
-#define __RWSEM_DEBUG_INIT     /* */
-#endif
-
 #define __RWSEM_INITIALIZER(name) \
        { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \
-         LIST_HEAD_INIT((name).wait_list) \
-         __RWSEM_DEBUG_INIT }
+         LIST_HEAD_INIT((name).wait_list) }
 
 #define DECLARE_RWSEM(name) \
        struct rw_semaphore name = __RWSEM_INITIALIZER(name)
@@ -73,9 +60,6 @@ init_rwsem (struct rw_semaphore *sem)
        sem->count = RWSEM_UNLOCKED_VALUE;
        spin_lock_init(&sem->wait_lock);
        INIT_LIST_HEAD(&sem->wait_list);
-#if RWSEM_DEBUG
-       sem->debug = 0;
-#endif
 }
 
 /*
index 5e328ed5d01d5f33b55d80e2be3575759f817b18..4f5ca5643cb12553430f9b013e0096695567582e 100644 (file)
@@ -56,7 +56,6 @@
  * SA_FLAGS values:
  *
  * SA_ONSTACK indicates that a registered stack_t will be used.
- * SA_INTERRUPT is a no-op, but left due to historical reasons.
  * SA_RESTART flag to get restarting signals (which were the default long ago)
  * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  * SA_RESETHAND clears the handler when the signal is delivered.
@@ -76,7 +75,6 @@
 
 #define SA_NOMASK      SA_NODEFER
 #define SA_ONESHOT     SA_RESETHAND
-#define SA_INTERRUPT   0x20000000 /* dummy -- ignored */
 
 #define SA_RESTORER    0x04000000
 
 #define _NSIG_BPW      64
 #define _NSIG_WORDS    (_NSIG / _NSIG_BPW)
 
-#define SA_PERCPU_IRQ          0x02000000
-
 #endif /* __KERNEL__ */
 
 #include <asm-generic/signal.h>
index ab7fe2463468d36caca6ddf2acccb639c900afc3..65cdd73c2a57a641e3c32461f55053c04c1c16da 100644 (file)
@@ -27,7 +27,7 @@
 #define PV908234 (1 << 1)
   /* CA:AGPDMA write request data mismatch with ABC1CL merge */
 #define PV895469 (1 << 1)
-  /* TIO:CA TLB invalidate of written GART entries possibly not occuring in CA*/
+  /* TIO:CA TLB invalidate of written GART entries possibly not occurring in CA*/
 #define PV910244 (1 << 1)
 
 struct tioca_dmamap{
index 8bc9869e57652dd65003dcffeb44d13aa655c202..8adcde0934ca4e127b621278b48f8ba84a2c4a4b 100644 (file)
@@ -68,7 +68,7 @@ struct thread_info {
 #define end_of_stack(p) (unsigned long *)((void *)(p) + IA64_RBS_OFFSET)
 
 #define __HAVE_ARCH_TASK_STRUCT_ALLOCATOR
-#define alloc_task_struct()    ((task_t *)__get_free_pages(GFP_KERNEL | __GFP_COMP, KERNEL_STACK_SIZE_ORDER))
+#define alloc_task_struct()    ((struct task_struct *)__get_free_pages(GFP_KERNEL | __GFP_COMP, KERNEL_STACK_SIZE_ORDER))
 #define free_task_struct(tsk)  free_pages((unsigned long) (tsk), KERNEL_STACK_SIZE_ORDER)
 
 #endif /* !__ASSEMBLY */
diff --git a/include/asm-m32r/Kbuild b/include/asm-m32r/Kbuild
new file mode 100644 (file)
index 0000000..c68e168
--- /dev/null
@@ -0,0 +1 @@
+include include/asm-generic/Kbuild.asm
index 95f69b1919537c0972a6486b9e53377e8573e830..e750045164d4e9b8ff24564e1024c244ba0dab4f 100644 (file)
@@ -81,7 +81,6 @@ typedef unsigned long sigset_t;
  * SA_FLAGS values:
  *
  * SA_ONSTACK indicates that a registered stack_t will be used.
- * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
  * SA_RESTART flag to get restarting signals (which were the default long ago)
  * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  * SA_RESETHAND clears the handler when the signal is delivered.
@@ -101,7 +100,6 @@ typedef unsigned long sigset_t;
 
 #define SA_NOMASK      SA_NODEFER
 #define SA_ONESHOT     SA_RESETHAND
-#define SA_INTERRUPT   0x20000000 /* dummy -- ignored */
 
 #define SA_RESTORER    0x04000000
 
index 66c4742f09e74e82a9ba7d3eb59c8f41c8922a70..311cebf44eff76ecf96ca6e69ffcd7b72be77123 100644 (file)
@@ -18,7 +18,7 @@
  * switch_to(prev, next) should switch from task `prev' to `next'
  * `prev' will never be the same as `next'.
  *
- * `next' and `prev' should be task_t, but it isn't always defined
+ * `next' and `prev' should be struct task_struct, but it isn't always defined
  */
 
 #define switch_to(prev, next, last)  do { \
diff --git a/include/asm-m68k/Kbuild b/include/asm-m68k/Kbuild
new file mode 100644 (file)
index 0000000..c68e168
--- /dev/null
@@ -0,0 +1 @@
+include include/asm-generic/Kbuild.asm
index 63a05ed95c17f1fd833385364c1fab00c1bf9bab..57f4fdda65ab264cda6aad4c28de27af34bf8d78 100644 (file)
@@ -88,8 +88,8 @@ static __inline__ void fd_outb(unsigned char value, int port)
 static int fd_request_irq(void)
 {
        if(MACH_IS_Q40)
-               return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT,
-                                                  "floppy", floppy_hardint);
+               return request_irq(FLOPPY_IRQ, floppy_hardint,
+                                  IRQF_DISABLED, "floppy", floppy_hardint);
        else if(MACH_IS_SUN3X)
                return sun3xflop_request_irq();
        return -ENXIO;
index f4ae7d8feac682cc9190e795f3cbdaf2a43280a3..3257f9881002dd3d69a9d6023620629b1a929c72 100644 (file)
@@ -67,8 +67,8 @@ struct pt_regs;
 
 /*
  * various flags for request_irq() - the Amiga now uses the standard
- * mechanism like all other architectures - SA_INTERRUPT and SA_SHIRQ
- * are your friends.
+ * mechanism like all other architectures - IRQF_DISABLED and
+ * IRQF_SHARED are your friends.
  */
 #ifndef MACH_AMIGA_ONLY
 #define IRQ_FLG_LOCK   (0x0001)        /* handler is not replaceable   */
index 85037a3d3e8e0cb0e1505c466ed05298e6eee08a..de1ba6ead3b4391de37e71bbb14fe2dcae92ed40 100644 (file)
@@ -74,7 +74,6 @@ typedef unsigned long sigset_t;
  * SA_FLAGS values:
  *
  * SA_ONSTACK indicates that a registered stack_t will be used.
- * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
  * SA_RESTART flag to get restarting signals (which were the default long ago)
  * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  * SA_RESETHAND clears the handler when the signal is delivered.
@@ -94,7 +93,6 @@ typedef unsigned long sigset_t;
 
 #define SA_NOMASK      SA_NODEFER
 #define SA_ONESHOT     SA_RESETHAND
-#define SA_INTERRUPT   0x20000000 /* dummy -- ignored */
 
 /*
  * sigaltstack controls
index 98a9f79dab29b0c6288cae4fd10e2a9db0355c87..ca8cc41138437960cd82aadd221fc6d263589966 100644 (file)
@@ -208,7 +208,8 @@ static int sun3xflop_request_irq(void)
 
        if(!once) {
                once = 1;
-               error = request_irq(FLOPPY_IRQ, sun3xflop_hardint, SA_INTERRUPT, "floppy", NULL);
+               error = request_irq(FLOPPY_IRQ, sun3xflop_hardint,
+                                   IRQF_DISABLED, "floppy", NULL);
                return ((error == 0) ? 0 : -1);
        } else return 0;
 }
diff --git a/include/asm-m68knommu/Kbuild b/include/asm-m68knommu/Kbuild
new file mode 100644 (file)
index 0000000..c68e168
--- /dev/null
@@ -0,0 +1 @@
+include include/asm-generic/Kbuild.asm
index 53557274eef81d7386ab675aabafd42dcd620428..45e7a2fd16893b0b830da7868e15dc3a7268316f 100644 (file)
@@ -62,8 +62,8 @@ extern void (*mach_disable_irq)(unsigned int);
 
 /*
  * various flags for request_irq() - the Amiga now uses the standard
- * mechanism like all other architectures - SA_INTERRUPT and SA_SHIRQ
- * are your friends.
+ * mechanism like all other architectures - IRQF_DISABLED and
+ * IRQF_SHARED are your friends.
  */
 #define IRQ_FLG_LOCK   (0x0001)        /* handler is not replaceable   */
 #define IRQ_FLG_REPLACE        (0x0002)        /* replace existing handler     */
index 1d13187f60629885185bbfaf4757c2796e706655..216c08be54a03f48fea866c9dc74b067e5355902 100644 (file)
@@ -74,7 +74,6 @@ typedef unsigned long sigset_t;
  * SA_FLAGS values:
  *
  * SA_ONSTACK indicates that a registered stack_t will be used.
- * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
  * SA_RESTART flag to get restarting signals (which were the default long ago)
  * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  * SA_RESETHAND clears the handler when the signal is delivered.
@@ -94,7 +93,6 @@ typedef unsigned long sigset_t;
 
 #define SA_NOMASK      SA_NODEFER
 #define SA_ONESHOT     SA_RESETHAND
-#define SA_INTERRUPT   0x20000000 /* dummy -- ignored */
 
 /* 
  * sigaltstack controls
diff --git a/include/asm-mips/Kbuild b/include/asm-mips/Kbuild
new file mode 100644 (file)
index 0000000..c68e168
--- /dev/null
@@ -0,0 +1 @@
+include include/asm-generic/Kbuild.asm
index 83cd69e30ec3f6024a1e316dcbb4531beb1bf96d..001a8ce17c1733f390291451b5c87985efbd97dd 100644 (file)
@@ -98,7 +98,7 @@ static inline void fd_disable_irq(void)
 static inline int fd_request_irq(void)
 {
        return request_irq(FLOPPY_IRQ, floppy_interrupt,
-                          SA_INTERRUPT, "floppy", NULL);
+                          IRQF_DISABLED, "floppy", NULL);
 }
 
 static inline void fd_free_irq(void)
index 9413117915f49716eba65ee75f136b2836c3af3b..56e9ca6ae426b28923c57f084b82ede0411193db 100644 (file)
@@ -90,7 +90,7 @@ static inline void fd_disable_irq(void)
 static inline int fd_request_irq(void)
 {
        return request_irq(FLOPPY_IRQ, floppy_interrupt,
-                          SA_INTERRUPT, "floppy", NULL);
+                          IRQF_DISABLED, "floppy", NULL);
 }
 
 static inline void fd_free_irq(void)
index a1f3a3fa9bd60e49af8b1bfa858fc3b26df42236..87a1dff9519917d2480025310e54dc6a5dfd9830 100644 (file)
@@ -64,7 +64,6 @@ typedef unsigned long old_sigset_t;           /* at least 32 bits */
  * SA_FLAGS values:
  *
  * SA_ONSTACK indicates that a registered stack_t will be used.
- * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
  * SA_RESTART flag to get restarting signals (which were the default long ago)
  * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  * SA_RESETHAND clears the handler when the signal is delivered.
@@ -84,7 +83,6 @@ typedef unsigned long old_sigset_t;           /* at least 32 bits */
 
 #define SA_NOMASK      SA_NODEFER
 #define SA_ONESHOT     SA_RESETHAND
-#define SA_INTERRUPT   0x20000000      /* dummy -- ignored */
 
 #define SA_RESTORER    0x04000000      /* Only for o32 */
 
@@ -99,15 +97,6 @@ typedef unsigned long old_sigset_t;          /* at least 32 bits */
 
 #ifdef __KERNEL__
 
-/*
- * These values of sa_flags are used only by the kernel as part of the
- * irq handling routines.
- *
- * SA_INTERRUPT is also used by the irq handling routines.
- * SA_SHIRQ flag is for shared interrupt support on PCI and EISA.
- */
-#define SA_SAMPLE_RANDOM       SA_RESTART
-
 #ifdef CONFIG_TRAD_SIGNALS
 #define sig_uses_siginfo(ka)   ((ka)->sa.sa_flags & SA_SIGINFO)
 #else
diff --git a/include/asm-parisc/Kbuild b/include/asm-parisc/Kbuild
new file mode 100644 (file)
index 0000000..c68e168
--- /dev/null
@@ -0,0 +1 @@
+include include/asm-generic/Kbuild.asm
index 458cdb2a753075d2a2acf2125b1c619a4be75a00..da2f9c1571430e8a6a52e1c7b402eeea5205e31d 100644 (file)
@@ -156,11 +156,11 @@ static int vdma_get_dma_residue(unsigned int dummy)
 static int fd_request_irq(void)
 {
        if(can_use_virtual_dma)
-               return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT,
-                                                  "floppy", NULL);
+               return request_irq(FLOPPY_IRQ, floppy_hardint,
+                                  IRQF_DISABLED, "floppy", NULL);
        else
-               return request_irq(FLOPPY_IRQ, floppy_interrupt, SA_INTERRUPT,
-                                  "floppy", NULL);
+               return request_irq(FLOPPY_IRQ, floppy_interrupt,
+                                  IRQF_DISABLED, "floppy", NULL);
 }
 
 static unsigned long dma_mem_alloc(unsigned long size)
index 25cb23ef7dd120dab907d0cfe802c82e583e7ce5..98a82fa0cfdbffeb53bee0ba8d2f61cfeccb0185 100644 (file)
@@ -48,7 +48,6 @@
  * SA_FLAGS values:
  *
  * SA_ONSTACK indicates that a registered stack_t will be used.
- * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
  * SA_RESTART flag to get restarting signals (which were the default long ago)
  * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  * SA_RESETHAND clears the handler when the signal is delivered.
@@ -69,7 +68,6 @@
 
 #define SA_NOMASK      SA_NODEFER
 #define SA_ONESHOT     SA_RESETHAND
-#define SA_INTERRUPT   0x20000000 /* dummy -- ignored */
 
 #define SA_RESTORER    0x04000000 /* obsolete -- ignored */
 
diff --git a/include/asm-powerpc/Kbuild b/include/asm-powerpc/Kbuild
new file mode 100644 (file)
index 0000000..ac61d7e
--- /dev/null
@@ -0,0 +1,10 @@
+include include/asm-generic/Kbuild.asm
+
+unifdef-y += a.out.h asm-compat.h bootx.h byteorder.h cputable.h elf.h \
+       nvram.h param.h posix_types.h ptrace.h seccomp.h signal.h       \
+       termios.h types.h unistd.h
+
+header-y += auxvec.h ioctls.h mman.h sembuf.h siginfo.h stat.h errno.h \
+       ipcbuf.h msgbuf.h shmbuf.h socket.h termbits.h fcntl.h ipc.h    \
+       poll.h shmparam.h sockios.h ucontext.h ioctl.h linkage.h        \
+       resource.h sigcontext.h statfs.h
index 9c8d91bf5a0d95c50e28d2883ae520edfa609a41..fd242a22331c622ad141cf1bb4adc098f6b7add3 100644 (file)
@@ -27,7 +27,7 @@
 #define fd_disable_irq()        disable_irq(FLOPPY_IRQ)
 #define fd_cacheflush(addr,size) /* nothing */
 #define fd_request_irq()        request_irq(FLOPPY_IRQ, floppy_interrupt, \
-                                           SA_INTERRUPT, "floppy", NULL)
+                                           IRQF_DISABLED, "floppy", NULL)
 #define fd_free_irq()           free_irq(FLOPPY_IRQ, NULL);
 
 #ifdef CONFIG_PCI
index 0392159e16e4f9cbd3b1c99519a858bf505755e8..c80e113052cd3a3da7b3f0d1f065898de6428b78 100644 (file)
@@ -4,11 +4,13 @@
 
 #include <linux/irq.h>
 
-extern struct hw_interrupt_type i8259_pic;
-
+#ifdef CONFIG_PPC_MERGE
+extern void i8259_init(struct device_node *node, unsigned long intack_addr);
+extern unsigned int i8259_irq(struct pt_regs *regs);
+#else
 extern void i8259_init(unsigned long intack_addr, int offset);
 extern int i8259_irq(struct pt_regs *regs);
-extern int i8259_irq_cascade(struct pt_regs *regs, void *unused);
+#endif
 
 #endif /* __KERNEL__ */
 #endif /* _ASM_POWERPC_I8259_H */
index eb5f33e1977a2cce8ff839eb7917f2813b4b7ce1..e057547520289ce2fff960c48ac7b070bc15a9d6 100644 (file)
@@ -9,26 +9,14 @@
  * 2 of the License, or (at your option) any later version.
  */
 
+#include <linux/config.h>
 #include <linux/threads.h>
+#include <linux/list.h>
+#include <linux/radix-tree.h>
 
 #include <asm/types.h>
 #include <asm/atomic.h>
 
-/* this number is used when no interrupt has been assigned */
-#define NO_IRQ                 (-1)
-
-/*
- * These constants are used for passing information about interrupt
- * signal polarity and level/edge sensing to the low-level PIC chip
- * drivers.
- */
-#define IRQ_SENSE_MASK         0x1
-#define IRQ_SENSE_LEVEL                0x1     /* interrupt on active level */
-#define IRQ_SENSE_EDGE         0x0     /* interrupt triggered by edge */
-
-#define IRQ_POLARITY_MASK      0x2
-#define IRQ_POLARITY_POSITIVE  0x2     /* high level or low->high edge */
-#define IRQ_POLARITY_NEGATIVE  0x0     /* low level or high->low edge */
 
 #define get_irq_desc(irq) (&irq_desc[(irq)])
 
 #define for_each_irq(i) \
        for ((i) = 0; (i) < NR_IRQS; ++(i))
 
-#ifdef CONFIG_PPC64
+extern atomic_t ppc_n_lost_interrupts;
 
-/*
- * Maximum number of interrupt sources that we can handle.
+#ifdef CONFIG_PPC_MERGE
+
+/* This number is used when no interrupt has been assigned */
+#define NO_IRQ                 (0)
+
+/* This is a special irq number to return from get_irq() to tell that
+ * no interrupt happened _and_ ignore it (don't count it as bad). Some
+ * platforms like iSeries rely on that.
  */
+#define NO_IRQ_IGNORE          ((unsigned int)-1)
+
+/* Total number of virq in the platform (make it a CONFIG_* option ? */
 #define NR_IRQS                512
 
-/* Interrupt numbers are virtual in case they are sparsely
- * distributed by the hardware.
+/* Number of irqs reserved for the legacy controller */
+#define NUM_ISA_INTERRUPTS     16
+
+/* This type is the placeholder for a hardware interrupt number. It has to
+ * be big enough to enclose whatever representation is used by a given
+ * platform.
+ */
+typedef unsigned long irq_hw_number_t;
+
+/* Interrupt controller "host" data structure. This could be defined as a
+ * irq domain controller. That is, it handles the mapping between hardware
+ * and virtual interrupt numbers for a given interrupt domain. The host
+ * structure is generally created by the PIC code for a given PIC instance
+ * (though a host can cover more than one PIC if they have a flat number
+ * model). It's the host callbacks that are responsible for setting the
+ * irq_chip on a given irq_desc after it's been mapped.
+ *
+ * The host code and data structures are fairly agnostic to the fact that
+ * we use an open firmware device-tree. We do have references to struct
+ * device_node in two places: in irq_find_host() to find the host matching
+ * a given interrupt controller node, and of course as an argument to its
+ * counterpart host->ops->match() callback. However, those are treated as
+ * generic pointers by the core and the fact that it's actually a device-node
+ * pointer is purely a convention between callers and implementation. This
+ * code could thus be used on other architectures by replacing those two
+ * by some sort of arch-specific void * "token" used to identify interrupt
+ * controllers.
  */
-extern unsigned int virt_irq_to_real_map[NR_IRQS];
+struct irq_host;
+struct radix_tree_root;
 
-/* The maximum virtual IRQ number that we support.  This
- * can be set by the platform and will be reduced by the
- * value of __irq_offset_value.  It defaults to and is
- * capped by (NR_IRQS - 1).
+/* Functions below are provided by the host and called whenever a new mapping
+ * is created or an old mapping is disposed. The host can then proceed to
+ * whatever internal data structures management is required. It also needs
+ * to setup the irq_desc when returning from map().
  */
-extern unsigned int virt_irq_max;
+struct irq_host_ops {
+       /* Match an interrupt controller device node to a host, returns
+        * 1 on a match
+        */
+       int (*match)(struct irq_host *h, struct device_node *node);
+
+       /* Create or update a mapping between a virtual irq number and a hw
+        * irq number. This can be called several times for the same mapping
+        * but with different flags, though unmap shall always be called
+        * before the virq->hw mapping is changed.
+        */
+       int (*map)(struct irq_host *h, unsigned int virq,
+                  irq_hw_number_t hw, unsigned int flags);
+
+       /* Dispose of such a mapping */
+       void (*unmap)(struct irq_host *h, unsigned int virq);
+
+       /* Translate device-tree interrupt specifier from raw format coming
+        * from the firmware to a irq_hw_number_t (interrupt line number) and
+        * trigger flags that can be passed to irq_create_mapping().
+        * If no translation is provided, raw format is assumed to be one cell
+        * for interrupt line and default sense.
+        */
+       int (*xlate)(struct irq_host *h, struct device_node *ctrler,
+                    u32 *intspec, unsigned int intsize,
+                    irq_hw_number_t *out_hwirq, unsigned int *out_flags);
+};
+
+struct irq_host {
+       struct list_head        link;
+
+       /* type of reverse mapping technique */
+       unsigned int            revmap_type;
+#define IRQ_HOST_MAP_LEGACY     0 /* legacy 8259, gets irqs 1..15 */
+#define IRQ_HOST_MAP_NOMAP     1 /* no fast reverse mapping */
+#define IRQ_HOST_MAP_LINEAR    2 /* linear map of interrupts */
+#define IRQ_HOST_MAP_TREE      3 /* radix tree */
+       union {
+               struct {
+                       unsigned int size;
+                       unsigned int *revmap;
+               } linear;
+               struct radix_tree_root tree;
+       } revmap_data;
+       struct irq_host_ops     *ops;
+       void                    *host_data;
+       irq_hw_number_t         inval_irq;
+};
+
+/* The main irq map itself is an array of NR_IRQ entries containing the
+ * associate host and irq number. An entry with a host of NULL is free.
+ * An entry can be allocated if it's free, the allocator always then sets
+ * hwirq first to the host's invalid irq number and then fills ops.
+ */
+struct irq_map_entry {
+       irq_hw_number_t hwirq;
+       struct irq_host *host;
+};
+
+extern struct irq_map_entry irq_map[NR_IRQS];
+
 
-/* Create a mapping for a real_irq if it doesn't already exist.
- * Return the virtual irq as a convenience.
+/***
+ * irq_alloc_host - Allocate a new irq_host data structure
+ * @node: device-tree node of the interrupt controller
+ * @revmap_type: type of reverse mapping to use
+ * @revmap_arg: for IRQ_HOST_MAP_LINEAR linear only: size of the map
+ * @ops: map/unmap host callbacks
+ * @inval_irq: provide a hw number in that host space that is always invalid
+ *
+ * Allocates and initialize and irq_host structure. Note that in the case of
+ * IRQ_HOST_MAP_LEGACY, the map() callback will be called before this returns
+ * for all legacy interrupts except 0 (which is always the invalid irq for
+ * a legacy controller). For a IRQ_HOST_MAP_LINEAR, the map is allocated by
+ * this call as well. For a IRQ_HOST_MAP_TREE, the radix tree will be allocated
+ * later during boot automatically (the reverse mapping will use the slow path
+ * until that happens).
+ */
+extern struct irq_host *irq_alloc_host(unsigned int revmap_type,
+                                      unsigned int revmap_arg,
+                                      struct irq_host_ops *ops,
+                                      irq_hw_number_t inval_irq);
+
+
+/***
+ * irq_find_host - Locates a host for a given device node
+ * @node: device-tree node of the interrupt controller
+ */
+extern struct irq_host *irq_find_host(struct device_node *node);
+
+
+/***
+ * irq_set_default_host - Set a "default" host
+ * @host: default host pointer
+ *
+ * For convenience, it's possible to set a "default" host that will be used
+ * whenever NULL is passed to irq_create_mapping(). It makes life easier for
+ * platforms that want to manipulate a few hard coded interrupt numbers that
+ * aren't properly represented in the device-tree.
+ */
+extern void irq_set_default_host(struct irq_host *host);
+
+
+/***
+ * irq_set_virq_count - Set the maximum number of virt irqs
+ * @count: number of linux virtual irqs, capped with NR_IRQS
+ *
+ * This is mainly for use by platforms like iSeries who want to program
+ * the virtual irq number in the controller to avoid the reverse mapping
+ */
+extern void irq_set_virq_count(unsigned int count);
+
+
+/***
+ * irq_create_mapping - Map a hardware interrupt into linux virq space
+ * @host: host owning this hardware interrupt or NULL for default host
+ * @hwirq: hardware irq number in that host space
+ * @flags: flags passed to the controller. contains the trigger type among
+ *         others. Use IRQ_TYPE_* defined in include/linux/irq.h
+ *
+ * Only one mapping per hardware interrupt is permitted. Returns a linux
+ * virq number. The flags can be used to provide sense information to the
+ * controller (typically extracted from the device-tree). If no information
+ * is passed, the controller defaults will apply (for example, xics can only
+ * do edge so flags are irrelevant for some pseries specific irqs).
+ *
+ * The device-tree generally contains the trigger info in an encoding that is
+ * specific to a given type of controller. In that case, you can directly use
+ * host->ops->trigger_xlate() to translate that.
+ *
+ * It is recommended that new PICs that don't have existing OF bindings chose
+ * to use a representation of triggers identical to linux.
+ */
+extern unsigned int irq_create_mapping(struct irq_host *host,
+                                      irq_hw_number_t hwirq,
+                                      unsigned int flags);
+
+
+/***
+ * irq_dispose_mapping - Unmap an interrupt
+ * @virq: linux virq number of the interrupt to unmap
+ */
+extern void irq_dispose_mapping(unsigned int virq);
+
+/***
+ * irq_find_mapping - Find a linux virq from an hw irq number.
+ * @host: host owning this hardware interrupt
+ * @hwirq: hardware irq number in that host space
+ *
+ * This is a slow path, for use by generic code. It's expected that an
+ * irq controller implementation directly calls the appropriate low level
+ * mapping function.
  */
-int virt_irq_create_mapping(unsigned int real_irq);
-void virt_irq_init(void);
+extern unsigned int irq_find_mapping(struct irq_host *host,
+                                    irq_hw_number_t hwirq);
 
-static inline unsigned int virt_irq_to_real(unsigned int virt_irq)
+
+/***
+ * irq_radix_revmap - Find a linux virq from a hw irq number.
+ * @host: host owning this hardware interrupt
+ * @hwirq: hardware irq number in that host space
+ *
+ * This is a fast path, for use by irq controller code that uses radix tree
+ * revmaps
+ */
+extern unsigned int irq_radix_revmap(struct irq_host *host,
+                                    irq_hw_number_t hwirq);
+
+/***
+ * irq_linear_revmap - Find a linux virq from a hw irq number.
+ * @host: host owning this hardware interrupt
+ * @hwirq: hardware irq number in that host space
+ *
+ * This is a fast path, for use by irq controller code that uses linear
+ * revmaps. It does fallback to the slow path if the revmap doesn't exist
+ * yet and will create the revmap entry with appropriate locking
+ */
+
+extern unsigned int irq_linear_revmap(struct irq_host *host,
+                                     irq_hw_number_t hwirq);
+
+
+
+/***
+ * irq_alloc_virt - Allocate virtual irq numbers
+ * @host: host owning these new virtual irqs
+ * @count: number of consecutive numbers to allocate
+ * @hint: pass a hint number, the allocator will try to use a 1:1 mapping
+ *
+ * This is a low level function that is used internally by irq_create_mapping()
+ * and that can be used by some irq controllers implementations for things
+ * like allocating ranges of numbers for MSIs. The revmaps are left untouched.
+ */
+extern unsigned int irq_alloc_virt(struct irq_host *host,
+                                  unsigned int count,
+                                  unsigned int hint);
+
+/***
+ * irq_free_virt - Free virtual irq numbers
+ * @virq: virtual irq number of the first interrupt to free
+ * @count: number of interrupts to free
+ *
+ * This function is the opposite of irq_alloc_virt. It will not clear reverse
+ * maps, this should be done previously by unmap'ing the interrupt. In fact,
+ * all interrupts covered by the range being freed should have been unmapped
+ * prior to calling this.
+ */
+extern void irq_free_virt(unsigned int virq, unsigned int count);
+
+
+/* -- OF helpers -- */
+
+/* irq_create_of_mapping - Map a hardware interrupt into linux virq space
+ * @controller: Device node of the interrupt controller
+ * @inspec: Interrupt specifier from the device-tree
+ * @intsize: Size of the interrupt specifier from the device-tree
+ *
+ * This function is identical to irq_create_mapping except that it takes
+ * as input informations straight from the device-tree (typically the results
+ * of the of_irq_map_*() functions
+ */
+extern unsigned int irq_create_of_mapping(struct device_node *controller,
+                                         u32 *intspec, unsigned int intsize);
+
+
+/* irq_of_parse_and_map - Parse nad Map an interrupt into linux virq space
+ * @device: Device node of the device whose interrupt is to be mapped
+ * @index: Index of the interrupt to map
+ *
+ * This function is a wrapper that chains of_irq_map_one() and
+ * irq_create_of_mapping() to make things easier to callers
+ */
+extern unsigned int irq_of_parse_and_map(struct device_node *dev, int index);
+
+/* -- End OF helpers -- */
+
+/***
+ * irq_early_init - Init irq remapping subsystem
+ */
+extern void irq_early_init(void);
+
+static __inline__ int irq_canonicalize(int irq)
 {
-       return virt_irq_to_real_map[virt_irq];
+       return irq;
 }
 
-extern unsigned int real_irq_to_virt_slowpath(unsigned int real_irq);
+
+#else /* CONFIG_PPC_MERGE */
+
+/* This number is used when no interrupt has been assigned */
+#define NO_IRQ                 (-1)
+#define NO_IRQ_IGNORE          (-2)
+
 
 /*
- * List of interrupt controllers.
+ * These constants are used for passing information about interrupt
+ * signal polarity and level/edge sensing to the low-level PIC chip
+ * drivers.
  */
-#define IC_INVALID    0
-#define IC_OPEN_PIC   1
-#define IC_PPC_XIC    2
-#define IC_CELL_PIC   3
-#define IC_ISERIES    4
+#define IRQ_SENSE_MASK         0x1
+#define IRQ_SENSE_LEVEL                0x1     /* interrupt on active level */
+#define IRQ_SENSE_EDGE         0x0     /* interrupt triggered by edge */
 
-extern u64 ppc64_interrupt_controller;
+#define IRQ_POLARITY_MASK      0x2
+#define IRQ_POLARITY_POSITIVE  0x2     /* high level or low->high edge */
+#define IRQ_POLARITY_NEGATIVE  0x0     /* low level or high->low edge */
 
-#else /* 32-bit */
 
 #if defined(CONFIG_40x)
 #include <asm/ibm4xx.h>
@@ -512,16 +775,11 @@ extern u64 ppc64_interrupt_controller;
 
 #endif /* CONFIG_8260 */
 
-#endif
+#endif /* Whatever way too big #ifdef */
 
 #define NR_MASK_WORDS  ((NR_IRQS + 31) / 32)
 /* pedantic: these are long because they are used with set_bit --RR */
 extern unsigned long ppc_cached_irq_mask[NR_MASK_WORDS];
-extern atomic_t ppc_n_lost_interrupts;
-
-#define virt_irq_create_mapping(x)     (x)
-
-#endif
 
 /*
  * Because many systems have two overlapping names spaces for
@@ -560,6 +818,7 @@ static __inline__ int irq_canonicalize(int irq)
                irq = 9;
        return irq;
 }
+#endif /* CONFIG_PPC_MERGE */
 
 extern int distribute_irqs;
 
@@ -579,9 +838,8 @@ extern struct thread_info *softirq_ctx[NR_CPUS];
 
 extern void irq_ctx_init(void);
 extern void call_do_softirq(struct thread_info *tp);
-extern int call___do_IRQ(int irq, struct pt_regs *regs,
-               struct thread_info *tp);
-
+extern int call_handle_irq(int irq, void *p1, void *p2,
+                          struct thread_info *tp, void *func);
 #else
 #define irq_ctx_init()
 
diff --git a/include/asm-powerpc/irqflags.h b/include/asm-powerpc/irqflags.h
new file mode 100644 (file)
index 0000000..7970cba
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * include/asm-powerpc/irqflags.h
+ *
+ * IRQ flags handling
+ *
+ * This file gets included from lowlevel asm headers too, to provide
+ * wrapped versions of the local_irq_*() APIs, based on the
+ * raw_local_irq_*() macros from the lowlevel headers.
+ */
+#ifndef _ASM_IRQFLAGS_H
+#define _ASM_IRQFLAGS_H
+
+/*
+ * Get definitions for raw_local_save_flags(x), etc.
+ */
+#include <asm-powerpc/hw_irq.h>
+
+/*
+ * Do the CPU's IRQ-state tracing from assembly code. We call a
+ * C function, so save all the C-clobbered registers:
+ */
+#ifdef CONFIG_TRACE_IRQFLAGS
+
+#error No support on PowerPC yet for CONFIG_TRACE_IRQFLAGS
+
+#else
+# define TRACE_IRQS_ON
+# define TRACE_IRQS_OFF
+#endif
+
+#endif
index eba133d149a793d3e7c2b05b25bb4036920a6a5b..c17c1374240114bc4f0f9a211c03a9d366279bea 100644 (file)
@@ -97,7 +97,7 @@ struct machdep_calls {
        void            (*show_percpuinfo)(struct seq_file *m, int i);
 
        void            (*init_IRQ)(void);
-       int             (*get_irq)(struct pt_regs *);
+       unsigned int    (*get_irq)(struct pt_regs *);
 #ifdef CONFIG_KEXEC
        void            (*kexec_cpu_down)(int crash_shutdown, int secondary);
 #endif
index f0d22ac34b96dd7d3d1e438afba263303d93b811..eb241c99c457d4e8aedc127f9181a5dfc5afd89f 100644 (file)
 #define MPIC_VEC_TIMER_1       248
 #define MPIC_VEC_TIMER_0       247
 
-/* Type definition of the cascade handler */
-typedef int (*mpic_cascade_t)(struct pt_regs *regs, void *data);
-
 #ifdef CONFIG_MPIC_BROKEN_U3
 /* Fixup table entry */
 struct mpic_irq_fixup
@@ -132,10 +129,19 @@ struct mpic_irq_fixup
 /* The instance data of a given MPIC */
 struct mpic
 {
+       /* The device node of the interrupt controller */
+       struct device_node      *of_node;
+
+       /* The remapper for this MPIC */
+       struct irq_host         *irqhost;
+
        /* The "linux" controller struct */
-       hw_irq_controller       hc_irq;
+       struct irq_chip         hc_irq;
+#ifdef CONFIG_MPIC_BROKEN_U3
+       struct irq_chip         hc_ht_irq;
+#endif
 #ifdef CONFIG_SMP
-       hw_irq_controller       hc_ipi;
+       struct irq_chip         hc_ipi;
 #endif
        const char              *name;
        /* Flags */
@@ -144,20 +150,12 @@ struct mpic
        unsigned int            isu_size;
        unsigned int            isu_shift;
        unsigned int            isu_mask;
-       /* Offset of irq vector numbers */
-       unsigned int            irq_offset;     
        unsigned int            irq_count;
-       /* Offset of ipi vector numbers */
-       unsigned int            ipi_offset;
        /* Number of sources */
        unsigned int            num_sources;
        /* Number of CPUs */
        unsigned int            num_cpus;
-       /* cascade handler */
-       mpic_cascade_t          cascade;
-       void                    *cascade_data;
-       unsigned int            cascade_vec;
-       /* senses array */
+       /* default senses array */
        unsigned char           *senses;
        unsigned int            senses_count;
 
@@ -213,14 +211,11 @@ struct mpic
  * The values in the array start at the first source of the MPIC,
  * that is senses[0] correspond to linux irq "irq_offset".
  */
-extern struct mpic *mpic_alloc(unsigned long phys_addr,
+extern struct mpic *mpic_alloc(struct device_node *node,
+                              unsigned long phys_addr,
                               unsigned int flags,
                               unsigned int isu_size,
-                              unsigned int irq_offset,
                               unsigned int irq_count,
-                              unsigned int ipi_offset,
-                              unsigned char *senses,
-                              unsigned int senses_num,
                               const char *name);
 
 /* Assign ISUs, to call before mpic_init()
@@ -232,22 +227,27 @@ extern struct mpic *mpic_alloc(unsigned long phys_addr,
 extern void mpic_assign_isu(struct mpic *mpic, unsigned int isu_num,
                            unsigned long phys_addr);
 
+/* Set default sense codes
+ *
+ * @mpic:      controller
+ * @senses:    array of sense codes
+ * @count:     size of above array
+ *
+ * Optionally provide an array (indexed on hardware interrupt numbers
+ * for this MPIC) of default sense codes for the chip. Those are linux
+ * sense codes IRQ_TYPE_*
+ *
+ * The driver gets ownership of the pointer, don't dispose of it or
+ * anything like that. __init only.
+ */
+extern void mpic_set_default_senses(struct mpic *mpic, u8 *senses, int count);
+
+
 /* Initialize the controller. After this has been called, none of the above
  * should be called again for this mpic
  */
 extern void mpic_init(struct mpic *mpic);
 
-/* Setup a cascade. Currently, only one cascade is supported this
- * way, though you can always do a normal request_irq() and add
- * other cascades this way. You should call this _after_ having
- * added all the ISUs
- *
- * @irq_no:    "linux" irq number of the cascade (that is offset'ed vector)
- * @handler:   cascade handler function
- */
-extern void mpic_setup_cascade(unsigned int irq_no, mpic_cascade_t hanlder,
-                              void *data);
-
 /*
  * All of the following functions must only be used after the
  * ISUs have been assigned and the controller fully initialized
@@ -284,9 +284,9 @@ extern void mpic_send_ipi(unsigned int ipi_no, unsigned int cpu_mask);
 void smp_mpic_message_pass(int target, int msg);
 
 /* Fetch interrupt from a given mpic */
-extern int mpic_get_one_irq(struct mpic *mpic, struct pt_regs *regs);
+extern unsigned int mpic_get_one_irq(struct mpic *mpic, struct pt_regs *regs);
 /* This one gets to the primary mpic */
-extern int mpic_get_irq(struct pt_regs *regs);
+extern unsigned int mpic_get_irq(struct pt_regs *regs);
 
 /* Set the EPIC clock ratio */
 void mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio);
@@ -294,8 +294,5 @@ void mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio);
 /* Enable/Disable EPIC serial interrupt mode */
 void mpic_set_serial_int(struct mpic *mpic, int enable);
 
-/* global mpic for pSeries */
-extern struct mpic *pSeries_mpic;
-
 #endif /* __KERNEL__ */
 #endif /* _ASM_POWERPC_MPIC_H */
index 6249a7c396395c469dd67a0ac25ddf5edb554876..c5c0b0b3cd52cdbe235bc7277e93c829f048e2fe 100644 (file)
@@ -9,7 +9,7 @@
 /*
  * The of_platform_bus_type is a bus type used by drivers that do not
  * attach to a macio or similar bus but still use OF probing
- * mecanism
+ * mechanism
  */
 extern struct bus_type of_platform_bus_type;
 
index faa1fc70305368993778aa8fc3ece4f181b333d2..2f2e3024fa619e23bb8d9dd4d47fc60c8551bd19 100644 (file)
@@ -14,6 +14,7 @@
 
 #define __per_cpu_offset(cpu) (paca[cpu].data_offset)
 #define __my_cpu_offset() get_paca()->data_offset
+#define per_cpu_offset(x) (__per_cpu_offset(x))
 
 /* Separate out the type, so (int[3], foo) works. */
 #define DEFINE_PER_CPU(type, name) \
index cef61304ffc2b9004812cf07ac79db7a879dc2b7..1330d6a58c57c630f1f429825f8331d5c718de9a 100644 (file)
@@ -205,7 +205,7 @@ extern void pmf_do_irq(struct pmf_function *func);
  *
  * The args array contains as many arguments as is required by the function,
  * this is dependent on the function you are calling, unfortunately Apple
- * mecanism provides no way to encode that so you have to get it right at
+ * mechanism provides no way to encode that so you have to get it right at
  * the call site. Some functions require no args, in which case, you can
  * pass NULL.
  *
index 010d186d095b98b999c7212889b268198f7591fd..b095a285c84b5d89401fa6c9540ad1a553fe6e0f 100644 (file)
@@ -64,11 +64,6 @@ struct boot_param_header
 typedef u32 phandle;
 typedef u32 ihandle;
 
-struct interrupt_info {
-       int     line;
-       int     sense;          /* +ve/-ve logic, edge or level, etc. */
-};
-
 struct property {
        char    *name;
        int     length;
@@ -81,8 +76,6 @@ struct device_node {
        char    *type;
        phandle node;
        phandle linux_phandle;
-       int     n_intrs;
-       struct  interrupt_info *intrs;
        char    *full_name;
 
        struct  property *properties;
@@ -167,8 +160,8 @@ extern void unflatten_device_tree(void);
 extern void early_init_devtree(void *);
 extern int device_is_compatible(struct device_node *device, const char *);
 extern int machine_is_compatible(const char *compat);
-extern unsigned char *get_property(struct device_node *node, const char *name,
-                                  int *lenp);
+extern void *get_property(struct device_node *node, const char *name,
+               int *lenp);
 extern void print_properties(struct device_node *node);
 extern int prom_n_addr_cells(struct device_node* np);
 extern int prom_n_size_cells(struct device_node* np);
@@ -204,6 +197,15 @@ extern int release_OF_resource(struct device_node* node, int index);
  */
 
 
+/* Helper to read a big number */
+static inline u64 of_read_number(u32 *cell, int size)
+{
+       u64 r = 0;
+       while (size--)
+               r = (r << 32) | *(cell++);
+       return r;
+}
+
 /* Translate an OF address block into a CPU physical address
  */
 #define OF_BAD_ADDR    ((u64)-1)
@@ -240,5 +242,83 @@ extern void kdump_move_device_tree(void);
 /* CPU OF node matching */
 struct device_node *of_get_cpu_node(int cpu, unsigned int *thread);
 
+
+/*
+ * OF interrupt mapping
+ */
+
+/* This structure is returned when an interrupt is mapped. The controller
+ * field needs to be put() after use
+ */
+
+#define OF_MAX_IRQ_SPEC                 4 /* We handle specifiers of at most 4 cells */
+
+struct of_irq {
+       struct device_node *controller; /* Interrupt controller node */
+       u32 size;                       /* Specifier size */
+       u32 specifier[OF_MAX_IRQ_SPEC]; /* Specifier copy */
+};
+
+/***
+ * of_irq_map_init - Initialize the irq remapper
+ * @flags:     flags defining workarounds to enable
+ *
+ * Some machines have bugs in the device-tree which require certain workarounds
+ * to be applied. Call this before any interrupt mapping attempts to enable
+ * those workarounds.
+ */
+#define OF_IMAP_OLDWORLD_MAC   0x00000001
+#define OF_IMAP_NO_PHANDLE     0x00000002
+
+extern void of_irq_map_init(unsigned int flags);
+
+/***
+ * of_irq_map_raw - Low level interrupt tree parsing
+ * @parent:    the device interrupt parent
+ * @intspec:   interrupt specifier ("interrupts" property of the device)
+ * @addr:      address specifier (start of "reg" property of the device)
+ * @out_irq:   structure of_irq filled by this function
+ *
+ * Returns 0 on success and a negative number on error
+ *
+ * This function is a low-level interrupt tree walking function. It
+ * can be used to do a partial walk with synthetized reg and interrupts
+ * properties, for example when resolving PCI interrupts when no device
+ * node exist for the parent.
+ *
+ */
+
+extern int of_irq_map_raw(struct device_node *parent, u32 *intspec, u32 *addr,
+                         struct of_irq *out_irq);
+
+
+/***
+ * of_irq_map_one - Resolve an interrupt for a device
+ * @device:    the device whose interrupt is to be resolved
+ * @index:             index of the interrupt to resolve
+ * @out_irq:   structure of_irq filled by this function
+ *
+ * This function resolves an interrupt, walking the tree, for a given
+ * device-tree node. It's the high level pendant to of_irq_map_raw().
+ * It also implements the workarounds for OldWolrd Macs.
+ */
+extern int of_irq_map_one(struct device_node *device, int index,
+                         struct of_irq *out_irq);
+
+/***
+ * of_irq_map_pci - Resolve the interrupt for a PCI device
+ * @pdev:      the device whose interrupt is to be resolved
+ * @out_irq:   structure of_irq filled by this function
+ *
+ * This function resolves the PCI interrupt for a given PCI device. If a
+ * device-node exists for a given pci_dev, it will use normal OF tree
+ * walking. If not, it will implement standard swizzling and walk up the
+ * PCI tree until an device-node is found, at which point it will finish
+ * resolving using the OF tree walking.
+ */
+struct pci_dev;
+extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq);
+
+
 #endif /* __KERNEL__ */
 #endif /* _POWERPC_PROM_H */
index 2c2fe9647595bd3de91342000551ae8baae26b9a..e929145e1e46700bdef35c903acb6725ef5c66e3 100644 (file)
@@ -28,24 +28,11 @@ struct rw_semaphore {
 #define RWSEM_ACTIVE_WRITE_BIAS                (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
        spinlock_t              wait_lock;
        struct list_head        wait_list;
-#if RWSEM_DEBUG
-       int                     debug;
-#endif
 };
 
-/*
- * initialisation
- */
-#if RWSEM_DEBUG
-#define __RWSEM_DEBUG_INIT      , 0
-#else
-#define __RWSEM_DEBUG_INIT     /* */
-#endif
-
 #define __RWSEM_INITIALIZER(name) \
        { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \
-         LIST_HEAD_INIT((name).wait_list) \
-         __RWSEM_DEBUG_INIT }
+         LIST_HEAD_INIT((name).wait_list) }
 
 #define DECLARE_RWSEM(name)            \
        struct rw_semaphore name = __RWSEM_INITIALIZER(name)
@@ -60,9 +47,6 @@ static inline void init_rwsem(struct rw_semaphore *sem)
        sem->count = RWSEM_UNLOCKED_VALUE;
        spin_lock_init(&sem->wait_lock);
        INIT_LIST_HEAD(&sem->wait_list);
-#if RWSEM_DEBUG
-       sem->debug = 0;
-#endif
 }
 
 /*
index a4d8f864854125e1f1bdd369738519d844f7538e..a8c7babf4950ca86b8a04eb2d96aef26241fe022 100644 (file)
@@ -63,7 +63,6 @@ typedef struct {
  * SA_FLAGS values:
  *
  * SA_ONSTACK is not currently supported, but will allow sigaltstack(2).
- * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
  * SA_RESTART flag to get restarting signals (which were the default long ago)
  * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  * SA_RESETHAND clears the handler when the signal is delivered.
@@ -83,7 +82,6 @@ typedef struct {
 
 #define SA_NOMASK      SA_NODEFER
 #define SA_ONESHOT     SA_RESETHAND
-#define SA_INTERRUPT   0x20000000u /* dummy -- ignored */
 
 #define SA_RESTORER    0x04000000U
 
index 9609d3ee8798a18fc2ea49994c28b362fd612051..c02d105d8294da0f322b000be520492a02d089ea 100644 (file)
@@ -117,6 +117,7 @@ struct spu {
        struct list_head sched_list;
        int number;
        int nid;
+       unsigned int irqs[3];
        u32 isrc;
        u32 node;
        u64 flags;
index 2ba191eba4482dda70005de3093914f4922912ac..d3963ca79ad88a76c358a86c2a13c92969a977f6 100644 (file)
@@ -96,11 +96,11 @@ static int vdma_get_dma_residue(unsigned int dummy)
 static int fd_request_irq(void)
 {
        if (can_use_virtual_dma)
-               return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT,
-                                                  "floppy", NULL);
+               return request_irq(FLOPPY_IRQ, floppy_hardint,
+                                  IRQF_DISABLED, "floppy", NULL);
        else
-               return request_irq(FLOPPY_IRQ, floppy_interrupt, SA_INTERRUPT,
-                                  "floppy", NULL);
+               return request_irq(FLOPPY_IRQ, floppy_interrupt,
+                                  IRQF_DISABLED, "floppy", NULL);
 }
 
 static int vdma_dma_setup(char *addr, unsigned long size, int mode, int io)
index 0b19af82507ff25b8793694c79fef18632185cab..fe95c8258cf9f3e40397b97149fd651e61fa8c13 100644 (file)
@@ -170,7 +170,7 @@ extern __inline__ int get_order(unsigned long size)
 #define VM_DATA_DEFAULT_FLAGS  (VM_READ | VM_WRITE | VM_EXEC | \
                                 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
 
-/* We do define AT_SYSINFO_EHDR but don't use the gate mecanism */
+/* We do define AT_SYSINFO_EHDR but don't use the gate mechanism */
 #define __HAVE_ARCH_GATE_AREA          1
 
 #include <asm-generic/memory_model.h>
diff --git a/include/asm-s390/Kbuild b/include/asm-s390/Kbuild
new file mode 100644 (file)
index 0000000..ed8955f
--- /dev/null
@@ -0,0 +1,4 @@
+include include/asm-generic/Kbuild.asm
+
+unifdef-y += cmb.h debug.h
+header-y += dasd.h qeth.h tape390.h ucontext.h vtoc.h z90crypt.h
diff --git a/include/asm-s390/irqflags.h b/include/asm-s390/irqflags.h
new file mode 100644 (file)
index 0000000..65f4db6
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ *  include/asm-s390/irqflags.h
+ *
+ *    Copyright (C) IBM Corp. 2006
+ *    Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>
+ */
+
+#ifndef __ASM_IRQFLAGS_H
+#define __ASM_IRQFLAGS_H
+
+#ifdef __KERNEL__
+
+/* interrupt control.. */
+#define raw_local_irq_enable() ({ \
+       unsigned long  __dummy; \
+       __asm__ __volatile__ ( \
+               "stosm 0(%1),0x03" \
+               : "=m" (__dummy) : "a" (&__dummy) : "memory" ); \
+       })
+
+#define raw_local_irq_disable() ({ \
+       unsigned long __flags; \
+       __asm__ __volatile__ ( \
+               "stnsm 0(%1),0xfc" : "=m" (__flags) : "a" (&__flags) ); \
+       __flags; \
+       })
+
+#define raw_local_save_flags(x) \
+       __asm__ __volatile__("stosm 0(%1),0" : "=m" (x) : "a" (&x), "m" (x) )
+
+#define raw_local_irq_restore(x) \
+       __asm__ __volatile__("ssm   0(%0)" : : "a" (&x), "m" (x) : "memory")
+
+#define raw_irqs_disabled()            \
+({                                     \
+       unsigned long flags;            \
+       local_save_flags(flags);        \
+       !((flags >> __FLAG_SHIFT) & 3); \
+})
+
+static inline int raw_irqs_disabled_flags(unsigned long flags)
+{
+       return !((flags >> __FLAG_SHIFT) & 3);
+}
+
+/* For spinlocks etc */
+#define raw_local_irq_save(x)  ((x) = raw_local_irq_disable())
+
+#endif /* __KERNEL__ */
+#endif /* __ASM_IRQFLAGS_H */
index d9a8cca9b653ad149003583e140a133fe914cf40..28b3517e787cd141d8c778e37cff68f143b6bf53 100644 (file)
@@ -42,6 +42,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
 #define __get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset)
 #define __raw_get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset)
 #define per_cpu(var,cpu) __reloc_hide(var,__per_cpu_offset[cpu])
+#define per_cpu_offset(x) (__per_cpu_offset[x])
 
 /* A macro to avoid #include hell... */
 #define percpu_modcopy(pcpudst, src, size)                     \
index 859b5e969826302baf456044a48272f0cb66bfc0..24312387fa244c453b6840441fe26eb6dcb974c6 100644 (file)
@@ -657,13 +657,6 @@ static inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot)
        __pte;                                                            \
 })
 
-#define SetPageUptodate(_page) \
-       do {                                                                  \
-               struct page *__page = (_page);                                \
-               if (!test_and_set_bit(PG_uptodate, &__page->flags))           \
-                       page_test_and_clear_dirty(_page);                     \
-       } while (0)
-
 #ifdef __s390x__
 
 #define pfn_pmd(pfn, pgprot)                                              \
index 0422a085dd56a2d54d36cd46a190c54b7c7af4ac..13ec16965150af1ca147ff4426b81b351d234c24 100644 (file)
@@ -61,6 +61,9 @@ struct rw_semaphore {
        signed long             count;
        spinlock_t              wait_lock;
        struct list_head        wait_list;
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+       struct lockdep_map      dep_map;
+#endif
 };
 
 #ifndef __s390x__
@@ -80,8 +83,16 @@ struct rw_semaphore {
 /*
  * initialisation
  */
+
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+# define __RWSEM_DEP_MAP_INIT(lockname) , .dep_map = { .name = #lockname }
+#else
+# define __RWSEM_DEP_MAP_INIT(lockname)
+#endif
+
 #define __RWSEM_INITIALIZER(name) \
-{ RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) }
+{ RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) \
+  __RWSEM_DEP_MAP_INIT(name) }
 
 #define DECLARE_RWSEM(name) \
        struct rw_semaphore name = __RWSEM_INITIALIZER(name)
@@ -93,6 +104,17 @@ static inline void init_rwsem(struct rw_semaphore *sem)
        INIT_LIST_HEAD(&sem->wait_list);
 }
 
+extern void __init_rwsem(struct rw_semaphore *sem, const char *name,
+                        struct lock_class_key *key);
+
+#define init_rwsem(sem)                                \
+do {                                           \
+       static struct lock_class_key __key;     \
+                                               \
+       __init_rwsem((sem), #sem, &__key);      \
+} while (0)
+
+
 /*
  * lock for reading
  */
@@ -155,7 +177,7 @@ static inline int __down_read_trylock(struct rw_semaphore *sem)
 /*
  * lock for writing
  */
-static inline void __down_write(struct rw_semaphore *sem)
+static inline void __down_write_nested(struct rw_semaphore *sem, int subclass)
 {
        signed long old, new, tmp;
 
@@ -181,6 +203,11 @@ static inline void __down_write(struct rw_semaphore *sem)
                rwsem_down_write_failed(sem);
 }
 
+static inline void __down_write(struct rw_semaphore *sem)
+{
+       __down_write_nested(sem, 0);
+}
+
 /*
  * trylock for writing -- returns 1 if successful, 0 if contention
  */
index 702cf436698c60e77ee5198600df6ad8506c07c4..32cdc69f39f4dd28c42521e67d77a7b536356cdc 100644 (file)
@@ -37,7 +37,8 @@ struct semaphore {
 
 static inline void sema_init (struct semaphore *sem, int val)
 {
-       *sem = (struct semaphore) __SEMAPHORE_INITIALIZER((*sem),val);
+       atomic_set(&sem->count, val);
+       init_waitqueue_head(&sem->wait);
 }
 
 static inline void init_MUTEX (struct semaphore *sem)
index 7084626de215750590bf4dfac15f88257ce187bb..f6cfddb278cb95bafc4189a50216915530a74360 100644 (file)
@@ -84,7 +84,6 @@ typedef unsigned long sigset_t;
  * SA_FLAGS values:
  *
  * SA_ONSTACK indicates that a registered stack_t will be used.
- * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
  * SA_RESTART flag to get restarting signals (which were the default long ago)
  * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  * SA_RESETHAND clears the handler when the signal is delivered.
@@ -104,7 +103,6 @@ typedef unsigned long sigset_t;
 
 #define SA_NOMASK       SA_NODEFER
 #define SA_ONESHOT      SA_RESETHAND
-#define SA_INTERRUPT    0x20000000 /* dummy -- ignored */
 
 #define SA_RESTORER     0x04000000
 
index 71a0732cd5180f89b59a2a53ecef653416783b75..9ab186ffde23e2009511bb132cd96909df1a0457 100644 (file)
@@ -301,34 +301,6 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
 #define set_mb(var, value)      do { var = value; mb(); } while (0)
 #define set_wmb(var, value)     do { var = value; wmb(); } while (0)
 
-/* interrupt control.. */
-#define local_irq_enable() ({ \
-        unsigned long  __dummy; \
-        __asm__ __volatile__ ( \
-                "stosm 0(%1),0x03" \
-               : "=m" (__dummy) : "a" (&__dummy) : "memory" ); \
-        })
-
-#define local_irq_disable() ({ \
-        unsigned long __flags; \
-        __asm__ __volatile__ ( \
-                "stnsm 0(%1),0xfc" : "=m" (__flags) : "a" (&__flags) ); \
-        __flags; \
-        })
-
-#define local_save_flags(x) \
-        __asm__ __volatile__("stosm 0(%1),0" : "=m" (x) : "a" (&x), "m" (x) )
-
-#define local_irq_restore(x) \
-        __asm__ __volatile__("ssm   0(%0)" : : "a" (&x), "m" (x) : "memory")
-
-#define irqs_disabled()                        \
-({                                     \
-       unsigned long flags;            \
-       local_save_flags(flags);        \
-        !((flags >> __FLAG_SHIFT) & 3);        \
-})
-
 #ifdef __s390x__
 
 #define __ctl_load(array, low, high) ({ \
@@ -442,8 +414,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
         })
 #endif /* __s390x__ */
 
-/* For spinlocks etc */
-#define local_irq_save(x)      ((x) = local_irq_disable())
+#include <linux/irqflags.h>
 
 /*
  * Use to set psw mask except for the first byte which
@@ -482,4 +453,3 @@ extern void (*_machine_power_off)(void);
 #endif /* __KERNEL__ */
 
 #endif
-
diff --git a/include/asm-sh/Kbuild b/include/asm-sh/Kbuild
new file mode 100644 (file)
index 0000000..c68e168
--- /dev/null
@@ -0,0 +1 @@
+include include/asm-generic/Kbuild.asm
index 307d9ce9f9ed6bfbeec86c15fb32f3b6e15ab3b1..dc1ad464fa32f2b2fe30f7ba48f0223744e0d34a 100644 (file)
@@ -146,12 +146,11 @@ static int vdma_get_dma_residue(unsigned int dummy)
 static int fd_request_irq(void)
 {
        if(can_use_virtual_dma)
-               return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT,
-                                  "floppy", NULL);
+               return request_irq(FLOPPY_IRQ, floppy_hardint,
+                                  IRQF_DISABLED, "floppy", NULL);
        else
-               return request_irq(FLOPPY_IRQ, floppy_interrupt, SA_INTERRUPT,
-                                  "floppy", NULL);
-
+               return request_irq(FLOPPY_IRQ, floppy_interrupt,
+                                  IRQF_DISABLED, "floppy", NULL);
 }
 
 static unsigned long dma_mem_alloc(unsigned long size)
index 5f0b9088c79676594bcdedbb02aa1abce3a5f795..71ef4cf4242dd5770e416e62eef01a48e2939a4f 100644 (file)
@@ -57,7 +57,7 @@ extern unsigned char pckbd_sysrq_xlate[128];
 #define AUX_IRQ 12
 
 #define aux_request_irq(hand, dev_id)                                  \
-       request_irq(AUX_IRQ, hand, SA_SHIRQ, "PS2 Mouse", dev_id)
+       request_irq(AUX_IRQ, hand, IRQF_SHARED, "PS2 Mouse", dev_id)
 
 #define aux_free_irq(dev_id) free_irq(AUX_IRQ, dev_id)
 
index 0262d3d1e5e018a2ddb9e7913d48124eb4311a4e..9d2aea5e848854c170c21f901f999ea13a0e9492 100644 (file)
@@ -25,24 +25,11 @@ struct rw_semaphore {
 #define RWSEM_ACTIVE_WRITE_BIAS                (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
        spinlock_t              wait_lock;
        struct list_head        wait_list;
-#if RWSEM_DEBUG
-       int                     debug;
-#endif
 };
 
-/*
- * initialisation
- */
-#if RWSEM_DEBUG
-#define __RWSEM_DEBUG_INIT      , 0
-#else
-#define __RWSEM_DEBUG_INIT     /* */
-#endif
-
 #define __RWSEM_INITIALIZER(name) \
        { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \
-         LIST_HEAD_INIT((name).wait_list) \
-         __RWSEM_DEBUG_INIT }
+         LIST_HEAD_INIT((name).wait_list) }
 
 #define DECLARE_RWSEM(name)            \
        struct rw_semaphore name = __RWSEM_INITIALIZER(name)
@@ -57,9 +44,6 @@ static inline void init_rwsem(struct rw_semaphore *sem)
        sem->count = RWSEM_UNLOCKED_VALUE;
        spin_lock_init(&sem->wait_lock);
        INIT_LIST_HEAD(&sem->wait_list);
-#if RWSEM_DEBUG
-       sem->debug = 0;
-#endif
 }
 
 /*
index d6e8eb0e65c71c5394b37578ce991c29798e76ba..5c5c1e852089f2b4e81f8f07f96a660dbb81afe6 100644 (file)
@@ -75,7 +75,6 @@ typedef unsigned long sigset_t;
  * SA_FLAGS values:
  *
  * SA_ONSTACK indicates that a registered stack_t will be used.
- * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
  * SA_RESTART flag to get restarting signals (which were the default long ago)
  * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  * SA_RESETHAND clears the handler when the signal is delivered.
@@ -95,7 +94,6 @@ typedef unsigned long sigset_t;
 
 #define SA_NOMASK      SA_NODEFER
 #define SA_ONESHOT     SA_RESETHAND
-#define SA_INTERRUPT   0x20000000 /* dummy -- ignored */
 
 #define SA_RESTORER    0x04000000
 
index b752e5cbb830f174c18b87b49dc3b1c5df5d2d49..ce2e60664a86750ec1c07e84bc4765b3eafa95e7 100644 (file)
@@ -12,7 +12,7 @@
  */
 
 #define switch_to(prev, next, last) do {                               \
task_t *__last;                                                       \
struct task_struct *__last;                                           \
  register unsigned long *__ts1 __asm__ ("r1") = &prev->thread.sp;      \
  register unsigned long *__ts2 __asm__ ("r2") = &prev->thread.pc;      \
  register unsigned long *__ts4 __asm__ ("r4") = (unsigned long *)prev; \
diff --git a/include/asm-sh64/Kbuild b/include/asm-sh64/Kbuild
new file mode 100644 (file)
index 0000000..c68e168
--- /dev/null
@@ -0,0 +1 @@
+include include/asm-generic/Kbuild.asm
index 733e2bbe7b8c9e4294d4100a430c6696e72cb8ea..1fab96d792bff9452cd2335db32f7abdddc11ce3 100644 (file)
@@ -65,7 +65,7 @@ extern unsigned char pckbd_sysrq_xlate[128];
 #endif
 
 #define aux_request_irq(hand, dev_id)                                  \
-       request_irq(AUX_IRQ, hand, SA_SHIRQ, "PS2 Mouse", dev_id)
+       request_irq(AUX_IRQ, hand, IRQF_SHARED, "PS2 Mouse", dev_id)
 
 #define aux_free_irq(dev_id) free_irq(AUX_IRQ, dev_id)
 
index 2400dc688a657d477d4209c1487c81f6a2979353..a5a28203cb3bfb67f1f378073fa4d459fe74c316 100644 (file)
@@ -74,7 +74,6 @@ typedef struct {
  * SA_FLAGS values:
  *
  * SA_ONSTACK indicates that a registered stack_t will be used.
- * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
  * SA_RESTART flag to get restarting signals (which were the default long ago)
  * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  * SA_RESETHAND clears the handler when the signal is delivered.
@@ -94,7 +93,6 @@ typedef struct {
 
 #define SA_NOMASK      SA_NODEFER
 #define SA_ONESHOT     SA_RESETHAND
-#define SA_INTERRUPT   0x20000000 /* dummy -- ignored */
 
 #define SA_RESTORER    0x04000000
 
diff --git a/include/asm-sparc/Kbuild b/include/asm-sparc/Kbuild
new file mode 100644 (file)
index 0000000..e2a57fd
--- /dev/null
@@ -0,0 +1,6 @@
+include include/asm-generic/Kbuild.asm
+
+unifdef-y += fbio.h perfctr.h psr.h
+header-y += apc.h asi.h auxio.h bpp.h head.h ipc.h jsflash.h   \
+       openpromio.h pbm.h pconf.h pgtsun4.h reg.h traps.h      \
+       turbosparc.h vfc_ioctls.h winmacro.h
index 7a941b800b6b42efc00bb80ca3510ad740f4a036..c53b332c850a696c63dcd6bb0cd71ea8a2a32ccb 100644 (file)
@@ -271,7 +271,8 @@ static int sun_fd_request_irq(void)
 
        if(!once) {
                once = 1;
-               error = request_fast_irq(FLOPPY_IRQ, floppy_hardint, SA_INTERRUPT, "floppy");
+               error = request_fast_irq(FLOPPY_IRQ, floppy_hardint,
+                                        IRQF_DISABLED, "floppy");
                return ((error == 0) ? 0 : -1);
        } else return 0;
 }
index aa9960ad0ca9d2d4039767ffbdf33a80d3bef832..0ae5084c427b3f4d2a9dab4cde24d6a57e095e8f 100644 (file)
@@ -132,16 +132,13 @@ struct sigstack {
  * usage of signal stacks by using the (now obsolete) sa_restorer field in
  * the sigaction structure as a stack pointer. This is now possible due to
  * the changes in signal handling. LBT 010493.
- * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
  * SA_RESTART flag to get restarting signals (which were the default long ago)
- * SA_SHIRQ flag is for shared interrupt support on PCI and EISA.
  */
 #define SA_NOCLDSTOP   _SV_IGNCHILD
 #define SA_STACK       _SV_SSTACK
 #define SA_ONSTACK     _SV_SSTACK
 #define SA_RESTART     _SV_INTR
 #define SA_ONESHOT     _SV_RESET
-#define SA_INTERRUPT   0x10u
 #define SA_NOMASK      0x20u
 #define SA_NOCLDWAIT   0x100u
 #define SA_SIGINFO     0x200u
diff --git a/include/asm-sparc64/Kbuild b/include/asm-sparc64/Kbuild
new file mode 100644 (file)
index 0000000..c78d44b
--- /dev/null
@@ -0,0 +1,10 @@
+include include/asm-generic/Kbuild.asm
+
+ALTARCH := sparc
+ARCHDEF := defined __sparc__ && defined __arch64__
+ALTARCHDEF := defined __sparc__ && !defined __arch64__
+
+unifdef-y := fbio.h perfctr.h
+header-y += apb.h asi.h bbc.h bpp.h display7seg.h envctrl.h floppy.h   \
+       ipc.h kdebug.h mostek.h openprom.h openpromio.h parport.h       \
+       pconf.h psrcompat.h pstate.h reg.h uctx.h utrap.h watchdog.h
index b591d0e8d8f0ec6901755f73240fa8e4be156d40..abf1500380192adeb427a001b63d233fbea0ab54 100644 (file)
@@ -267,7 +267,7 @@ static int sun_fd_request_irq(void)
                once = 1;
 
                error = request_irq(FLOPPY_IRQ, sparc_floppy_irq, 
-                                   SA_INTERRUPT, "floppy", NULL);
+                                   IRQF_DISABLED, "floppy", NULL);
 
                return ((error == 0) ? 0 : -1);
        }
index a6ece06b83dbc8144b7475c89c3423ce9b0b5360..ced8cbde046dab27cc505aea639fc43e25914b4f 100644 (file)
@@ -11,6 +11,7 @@ extern unsigned long __per_cpu_base;
 extern unsigned long __per_cpu_shift;
 #define __per_cpu_offset(__cpu) \
        (__per_cpu_base + ((unsigned long)(__cpu) << __per_cpu_shift))
+#define per_cpu_offset(x) (__per_cpu_offset(x))
 
 /* Separate out the type, so (int[3], foo) works. */
 #define DEFINE_PER_CPU(type, name) \
index fdc42a14d4e64a776aef4af390967811f03f7eaf..9968871103bcf79cf2b802b4c6ea9516cfdf0da8 100644 (file)
@@ -133,16 +133,13 @@ struct sigstack {
  * usage of signal stacks by using the (now obsolete) sa_restorer field in
  * the sigaction structure as a stack pointer. This is now possible due to
  * the changes in signal handling. LBT 010493.
- * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
  * SA_RESTART flag to get restarting signals (which were the default long ago)
- * SA_SHIRQ flag is for shared interrupt support on PCI and EISA.
  */
 #define SA_NOCLDSTOP   _SV_IGNCHILD
 #define SA_STACK       _SV_SSTACK
 #define SA_ONSTACK     _SV_SSTACK
 #define SA_RESTART     _SV_INTR
 #define SA_ONESHOT     _SV_RESET
-#define SA_INTERRUPT   0x10u
 #define SA_NOMASK      0x20u
 #define SA_NOCLDWAIT    0x100u
 #define SA_SIGINFO      0x200u
diff --git a/include/asm-sparc64/vdev.h b/include/asm-sparc64/vdev.h
deleted file mode 100644 (file)
index 25637c5..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/* vdev.h: SUN4V virtual device interfaces and defines.
- *
- * Copyright (C) 2006 David S. Miller <davem@davemloft.net>
- */
-
-#ifndef _SPARC64_VDEV_H
-#define _SPARC64_VDEV_H
-
-#include <linux/types.h>
-#include <asm/prom.h>
-
-extern u32 sun4v_vdev_devhandle;
-extern struct device_node *sun4v_vdev_root;
-
-extern unsigned int sun4v_vdev_device_interrupt(struct device_node *dev_node);
-
-#endif /* !(_SPARC64_VDEV_H) */
diff --git a/include/asm-um/Kbuild b/include/asm-um/Kbuild
new file mode 100644 (file)
index 0000000..c68e168
--- /dev/null
@@ -0,0 +1 @@
+include include/asm-generic/Kbuild.asm
index 1934d9340e2cd6d5c0ca4c58f4ce1869edf97453..44e8b8c772ae8b1d3c0fc6da06b128f5f0874eed 100644 (file)
@@ -45,8 +45,13 @@ static inline void writel(unsigned int b, volatile void __iomem *addr)
 {
        *(volatile unsigned int __force *) addr = b;
 }
+static inline void writeq(unsigned int b, volatile void __iomem *addr)
+{
+       *(volatile unsigned long long __force *) addr = b;
+}
 #define __raw_writeb writeb
 #define __raw_writew writew
 #define __raw_writel writel
+#define __raw_writeq writeq
 
 #endif
index 0b22ad776e76e6ef9d68205d25f4fb9f978e26a5..6c03acdb4405bf0eb1fc4a05d546cebf25aae6e7 100644 (file)
@@ -6,6 +6,24 @@
 #ifndef __UM_KMAP_TYPES_H
 #define __UM_KMAP_TYPES_H
 
-#include "asm/arch/kmap_types.h"
+/* No more #include "asm/arch/kmap_types.h" ! */
+
+enum km_type {
+       KM_BOUNCE_READ,
+       KM_SKB_SUNRPC_DATA,
+       KM_SKB_DATA_SOFTIRQ,
+       KM_USER0,
+       KM_USER1,
+       KM_UML_USERCOPY,        /* UML specific, for copy_*_user - used in do_op_one_page */
+       KM_BIO_SRC_IRQ,
+       KM_BIO_DST_IRQ,
+       KM_PTE0,
+       KM_PTE1,
+       KM_IRQ0,
+       KM_IRQ1,
+       KM_SOFTIRQ0,
+       KM_SOFTIRQ1,
+       KM_TYPE_NR
+};
 
 #endif
diff --git a/include/asm-v850/Kbuild b/include/asm-v850/Kbuild
new file mode 100644 (file)
index 0000000..c68e168
--- /dev/null
@@ -0,0 +1 @@
+include include/asm-generic/Kbuild.asm
index cb52caa69925b4ae669675c605456df4bfd02a3a..a38df0834bbffc7c4e830613a4820c912d415dc1 100644 (file)
@@ -77,7 +77,6 @@ typedef unsigned long sigset_t;
  * SA_FLAGS values:
  *
  * SA_ONSTACK indicates that a registered stack_t will be used.
- * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
  * SA_RESTART flag to get restarting signals (which were the default long ago)
  * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  * SA_RESETHAND clears the handler when the signal is delivered.
@@ -97,7 +96,6 @@ typedef unsigned long sigset_t;
 
 #define SA_NOMASK      SA_NODEFER
 #define SA_ONESHOT     SA_RESETHAND
-#define SA_INTERRUPT   0x20000000 /* dummy -- ignored */
 
 #define SA_RESTORER    0x04000000
 
diff --git a/include/asm-x86_64/Kbuild b/include/asm-x86_64/Kbuild
new file mode 100644 (file)
index 0000000..dc4d101
--- /dev/null
@@ -0,0 +1,11 @@
+include include/asm-generic/Kbuild.asm
+
+ALTARCH := i386
+ARCHDEF := defined __x86_64__
+ALTARCHDEF := defined __i386__
+
+header-y += boot.h bootsetup.h cpufeature.h debugreg.h ldt.h \
+        msr.h prctl.h setup.h sigcontext32.h ucontext.h \
+        vsyscall32.h
+
+unifdef-y += mce.h mtrr.h vsyscall.h
index 387c8f66af7d5d8b2e103d1f3c734b79e0589e53..aa67bfd1b3ce63a73a4f29467d9e5a664bcc1190 100644 (file)
@@ -17,11 +17,20 @@ struct alt_instr {
 extern void apply_alternatives(struct alt_instr *start, struct alt_instr *end);
 
 struct module;
+
+#ifdef CONFIG_SMP
 extern void alternatives_smp_module_add(struct module *mod, char *name,
                                        void *locks, void *locks_end,
                                        void *text, void *text_end);
 extern void alternatives_smp_module_del(struct module *mod);
 extern void alternatives_smp_switch(int smp);
+#else
+static inline void alternatives_smp_module_add(struct module *mod, char *name,
+                                       void *locks, void *locks_end,
+                                       void *text, void *text_end) {}
+static inline void alternatives_smp_module_del(struct module *mod) {}
+static inline void alternatives_smp_switch(int smp) {}
+#endif
 
 #endif
 
index 006291e89b4a12e60b0947fc1d18b9c4f1410aae..32ff5d132714f44c5826472aa46efe16e2ee6e9f 100644 (file)
@@ -144,11 +144,11 @@ static int vdma_get_dma_residue(unsigned int dummy)
 static int fd_request_irq(void)
 {
        if(can_use_virtual_dma)
-               return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT,
-                                                  "floppy", NULL);
+               return request_irq(FLOPPY_IRQ, floppy_hardint,
+                                  IRQF_DISABLED, "floppy", NULL);
        else
-               return request_irq(FLOPPY_IRQ, floppy_interrupt, SA_INTERRUPT,
-                                  "floppy", NULL);
+               return request_irq(FLOPPY_IRQ, floppy_interrupt,
+                                  IRQF_DISABLED, "floppy", NULL);
 }
 
 static unsigned long dma_mem_alloc(unsigned long size)
diff --git a/include/asm-x86_64/irqflags.h b/include/asm-x86_64/irqflags.h
new file mode 100644 (file)
index 0000000..cce6937
--- /dev/null
@@ -0,0 +1,141 @@
+/*
+ * include/asm-x86_64/irqflags.h
+ *
+ * IRQ flags handling
+ *
+ * This file gets included from lowlevel asm headers too, to provide
+ * wrapped versions of the local_irq_*() APIs, based on the
+ * raw_local_irq_*() functions from the lowlevel headers.
+ */
+#ifndef _ASM_IRQFLAGS_H
+#define _ASM_IRQFLAGS_H
+
+#ifndef __ASSEMBLY__
+/*
+ * Interrupt control:
+ */
+
+static inline unsigned long __raw_local_save_flags(void)
+{
+       unsigned long flags;
+
+       __asm__ __volatile__(
+               "# __raw_save_flags\n\t"
+               "pushfq ; popq %q0"
+               : "=g" (flags)
+               : /* no input */
+               : "memory"
+       );
+
+       return flags;
+}
+
+#define raw_local_save_flags(flags) \
+               do { (flags) = __raw_local_save_flags(); } while (0)
+
+static inline void raw_local_irq_restore(unsigned long flags)
+{
+       __asm__ __volatile__(
+               "pushq %0 ; popfq"
+               : /* no output */
+               :"g" (flags)
+               :"memory", "cc"
+       );
+}
+
+#ifdef CONFIG_X86_VSMP
+
+/*
+ * Interrupt control for the VSMP architecture:
+ */
+
+static inline void raw_local_irq_disable(void)
+{
+       unsigned long flags = __raw_local_save_flags();
+
+       raw_local_irq_restore((flags & ~(1 << 9)) | (1 << 18));
+}
+
+static inline void raw_local_irq_enable(void)
+{
+       unsigned long flags = __raw_local_save_flags();
+
+       raw_local_irq_restore((flags | (1 << 9)) & ~(1 << 18));
+}
+
+static inline int raw_irqs_disabled_flags(unsigned long flags)
+{
+       return !(flags & (1<<9)) || (flags & (1 << 18));
+}
+
+#else /* CONFIG_X86_VSMP */
+
+static inline void raw_local_irq_disable(void)
+{
+       __asm__ __volatile__("cli" : : : "memory");
+}
+
+static inline void raw_local_irq_enable(void)
+{
+       __asm__ __volatile__("sti" : : : "memory");
+}
+
+static inline int raw_irqs_disabled_flags(unsigned long flags)
+{
+       return !(flags & (1 << 9));
+}
+
+#endif
+
+/*
+ * For spinlocks, etc.:
+ */
+
+static inline unsigned long __raw_local_irq_save(void)
+{
+       unsigned long flags = __raw_local_save_flags();
+
+       raw_local_irq_disable();
+
+       return flags;
+}
+
+#define raw_local_irq_save(flags) \
+               do { (flags) = __raw_local_irq_save(); } while (0)
+
+static inline int raw_irqs_disabled(void)
+{
+       unsigned long flags = __raw_local_save_flags();
+
+       return raw_irqs_disabled_flags(flags);
+}
+
+/*
+ * Used in the idle loop; sti takes one instruction cycle
+ * to complete:
+ */
+static inline void raw_safe_halt(void)
+{
+       __asm__ __volatile__("sti; hlt" : : : "memory");
+}
+
+/*
+ * Used when interrupts are already enabled or to
+ * shutdown the processor:
+ */
+static inline void halt(void)
+{
+       __asm__ __volatile__("hlt": : :"memory");
+}
+
+#else /* __ASSEMBLY__: */
+# ifdef CONFIG_TRACE_IRQFLAGS
+#  define TRACE_IRQS_ON                call trace_hardirqs_on_thunk
+#  define TRACE_IRQS_OFF       call trace_hardirqs_off_thunk
+# else
+#  define TRACE_IRQS_ON
+#  define TRACE_IRQS_OFF
+# endif
+#endif
+
+#endif
index cd52c7f33bca2f02b8b56256fe6de5613164854e..2b0c088e29578434530b45290792b7e66f5355a7 100644 (file)
@@ -49,7 +49,7 @@ static inline int notify_die(enum die_val val, const char *str,
        return atomic_notifier_call_chain(&die_chain, val, &args);
 } 
 
-extern int printk_address(unsigned long address);
+extern void printk_address(unsigned long address);
 extern void die(const char *,struct pt_regs *,long);
 extern void __die(const char *,struct pt_regs *,long);
 extern void show_registers(struct pt_regs *regs);
index 549eb929b2c0b551952cc9f41aa3e50cbe914f4a..08dd9f9dda81854dc1b222dacd24ef209e6be29f 100644 (file)
@@ -14,6 +14,8 @@
 #define __per_cpu_offset(cpu) (cpu_pda(cpu)->data_offset)
 #define __my_cpu_offset() read_pda(data_offset)
 
+#define per_cpu_offset(x) (__per_cpu_offset(x))
+
 /* Separate out the type, so (int[3], foo) works. */
 #define DEFINE_PER_CPU(type, name) \
     __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name
index f8d55798535ac4ccf06e1fc46cbc624a6b68cd76..cef7a7d51b7e9a1a55f1d433dac4866348f0c6ae 100644 (file)
@@ -83,7 +83,6 @@ typedef unsigned long sigset_t;
  * SA_FLAGS values:
  *
  * SA_ONSTACK indicates that a registered stack_t will be used.
- * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
  * SA_RESTART flag to get restarting signals (which were the default long ago)
  * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  * SA_RESETHAND clears the handler when the signal is delivered.
@@ -103,7 +102,6 @@ typedef unsigned long sigset_t;
 
 #define SA_NOMASK      SA_NODEFER
 #define SA_ONESHOT     SA_RESETHAND
-#define SA_INTERRUPT   0x20000000 /* dummy -- ignored */
 
 #define SA_RESTORER    0x04000000
 
index 68e559f3631c00de7b7b03ed830ace3b43173de8..f67f2873a9225281b98818102ce0cd1ba5cf45b2 100644 (file)
@@ -244,43 +244,7 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
 
 #define warn_if_not_ulong(x) do { unsigned long foo; (void) (&(x) == &foo); } while (0)
 
-/* interrupt control.. */
-#define local_save_flags(x)    do { warn_if_not_ulong(x); __asm__ __volatile__("# save_flags \n\t pushfq ; popq %q0":"=g" (x): /* no input */ :"memory"); } while (0)
-#define local_irq_restore(x)   __asm__ __volatile__("# restore_flags \n\t pushq %0 ; popfq": /* no output */ :"g" (x):"memory", "cc")
-
-#ifdef CONFIG_X86_VSMP
-/* Interrupt control for VSMP  architecture */
-#define local_irq_disable()    do { unsigned long flags; local_save_flags(flags); local_irq_restore((flags & ~(1 << 9)) | (1 << 18)); } while (0)
-#define local_irq_enable()     do { unsigned long flags; local_save_flags(flags); local_irq_restore((flags | (1 << 9)) & ~(1 << 18)); } while (0)
-
-#define irqs_disabled()                                        \
-({                                                     \
-       unsigned long flags;                            \
-       local_save_flags(flags);                        \
-       (flags & (1<<18)) || !(flags & (1<<9));         \
-})
-
-/* For spinlocks etc */
-#define local_irq_save(x)      do { local_save_flags(x); local_irq_restore((x & ~(1 << 9)) | (1 << 18)); } while (0)
-#else  /* CONFIG_X86_VSMP */
-#define local_irq_disable()    __asm__ __volatile__("cli": : :"memory")
-#define local_irq_enable()     __asm__ __volatile__("sti": : :"memory")
-
-#define irqs_disabled()                        \
-({                                     \
-       unsigned long flags;            \
-       local_save_flags(flags);        \
-       !(flags & (1<<9));              \
-})
-
-/* For spinlocks etc */
-#define local_irq_save(x)      do { warn_if_not_ulong(x); __asm__ __volatile__("# local_irq_save \n\t pushfq ; popq %0 ; cli":"=g" (x): /* no input */ :"memory"); } while (0)
-#endif
-
-/* used in the idle loop; sti takes one instruction cycle to complete */
-#define safe_halt()            __asm__ __volatile__("sti; hlt": : :"memory")
-/* used when interrupts are already enabled or to shutdown the processor */
-#define halt()                 __asm__ __volatile__("hlt": : :"memory")
+#include <linux/irqflags.h>
 
 void cpu_idle_wait(void);
 
diff --git a/include/asm-xtensa/Kbuild b/include/asm-xtensa/Kbuild
new file mode 100644 (file)
index 0000000..c68e168
--- /dev/null
@@ -0,0 +1 @@
+include include/asm-generic/Kbuild.asm
index abcd86dc5ab9b362b848aec08b969d773e7a3d28..0aad3a5875516a3c640b5e7cddf41cf7c044225f 100644 (file)
@@ -31,24 +31,11 @@ struct rw_semaphore {
 #define RWSEM_ACTIVE_WRITE_BIAS                (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
        spinlock_t              wait_lock;
        struct list_head        wait_list;
-#if RWSEM_DEBUG
-       int                     debug;
-#endif
 };
 
-/*
- * initialisation
- */
-#if RWSEM_DEBUG
-#define __RWSEM_DEBUG_INIT      , 0
-#else
-#define __RWSEM_DEBUG_INIT     /* */
-#endif
-
 #define __RWSEM_INITIALIZER(name) \
        { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \
-         LIST_HEAD_INIT((name).wait_list) \
-         __RWSEM_DEBUG_INIT }
+         LIST_HEAD_INIT((name).wait_list) }
 
 #define DECLARE_RWSEM(name)            \
        struct rw_semaphore name = __RWSEM_INITIALIZER(name)
@@ -63,9 +50,6 @@ static inline void init_rwsem(struct rw_semaphore *sem)
        sem->count = RWSEM_UNLOCKED_VALUE;
        spin_lock_init(&sem->wait_lock);
        INIT_LIST_HEAD(&sem->wait_list);
-#if RWSEM_DEBUG
-       sem->debug = 0;
-#endif
 }
 
 /*
index a99c9aec64ec9667663f6512286c5a87b202d464..633ba73bc4d21ee924086f903cc75abf8cbeb06d 100644 (file)
@@ -75,7 +75,6 @@ typedef struct {
  * SA_FLAGS values:
  *
  * SA_ONSTACK indicates that a registered stack_t will be used.
- * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
  * SA_RESTART flag to get restarting signals (which were the default long ago)
  * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  * SA_RESETHAND clears the handler when the signal is delivered.
@@ -95,7 +94,6 @@ typedef struct {
 
 #define SA_NOMASK      SA_NODEFER
 #define SA_ONESHOT     SA_RESETHAND
-#define SA_INTERRUPT   0x20000000 /* dummy -- ignored */
 
 #define SA_RESTORER    0x04000000
 
@@ -109,19 +107,6 @@ typedef struct {
 #define SIGSTKSZ       8192
 
 #ifndef __ASSEMBLY__
-#ifdef __KERNEL__
-
-/*
- * These values of sa_flags are used only by the kernel as part of the
- * irq handling routines.
- *
- * SA_INTERRUPT is also used by the irq handling routines.
- * SA_SHIRQ is for shared interrupt support on PCI and EISA.
- */
-#define SA_SAMPLE_RANDOM       SA_RESTART
-#define SA_SHIRQ               0x04000000
-#define SA_PROBEIRQ            0x08000000
-#endif
 
 #define SIG_BLOCK          0   /* for blocking signals */
 #define SIG_UNBLOCK        1   /* for unblocking signals */
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
new file mode 100644 (file)
index 0000000..2b8a7d6
--- /dev/null
@@ -0,0 +1,63 @@
+header-y := byteorder/ dvb/ hdlc/ isdn/ nfsd/ raid/ sunrpc/ tc_act/    \
+       netfilter/ netfilter_arp/ netfilter_bridge/ netfilter_ipv4/     \
+       netfilter_ipv6/
+
+header-y += affs_fs.h affs_hardblocks.h aio_abi.h a.out.h arcfb.h      \
+       atmapi.h atmbr2684.h atmclip.h atm_eni.h atm_he.h               \
+       atm_idt77105.h atmioc.h atmlec.h atmmpc.h atm_nicstar.h         \
+       atmppp.h atmsap.h atmsvc.h atm_zatm.h auto_fs4.h auxvec.h       \
+       awe_voice.h ax25.h b1lli.h baycom.h bfs_fs.h blkpg.h            \
+       bpqether.h cdk.h chio.h coda_psdev.h coff.h comstats.h          \
+       consolemap.h cycx_cfm.h dm-ioctl.h dn.h dqblk_v1.h              \
+       dqblk_v2.h dqblk_xfs.h efs_fs_sb.h elf-fdpic.h elf.h elf-em.h   \
+       fadvise.h fd.h fdreg.h ftape-header-segment.h ftape-vendors.h   \
+       fuse.h futex.h genetlink.h gen_stats.h gigaset_dev.h hdsmart.h  \
+       hpfs_fs.h hysdn_if.h i2c-dev.h i8k.h icmp.h                     \
+       if_arcnet.h if_arp.h if_bonding.h if_cablemodem.h if_fc.h       \
+       if_fddi.h if.h if_hippi.h if_infiniband.h if_packet.h           \
+       if_plip.h if_ppp.h if_slip.h if_strip.h if_tunnel.h in6.h       \
+       in_route.h ioctl.h ip.h ipmi_msgdefs.h ip_mp_alg.h ipsec.h      \
+       ipx.h irda.h isdn_divertif.h iso_fs.h ite_gpio.h ixjuser.h      \
+       jffs2.h keyctl.h limits.h major.h matroxfb.h meye.h minix_fs.h  \
+       mmtimer.h mqueue.h mtio.h ncp_no.h netfilter_arp.h netrom.h     \
+       nfs2.h nfs4_mount.h nfs_mount.h openprom_fs.h param.h           \
+       pci_ids.h pci_regs.h personality.h pfkeyv2.h pg.h pkt_cls.h     \
+       pkt_sched.h posix_types.h ppdev.h prctl.h ps2esdi.h qic117.h    \
+       qnxtypes.h quotaio_v1.h quotaio_v2.h radeonfb.h raw.h           \
+       resource.h rose.h sctp.h smbno.h snmp.h sockios.h som.h         \
+       sound.h stddef.h synclink.h telephony.h termios.h ticable.h     \
+       times.h tiocl.h tipc.h toshiba.h ultrasound.h un.h utime.h      \
+       utsname.h video_decoder.h video_encoder.h videotext.h vt.h      \
+       wavefront.h wireless.h xattr.h x25.h zorro_ids.h
+
+unifdef-y += acct.h adb.h adfs_fs.h agpgart.h apm_bios.h atalk.h       \
+       atmarp.h atmdev.h atm.h atm_tcp.h audit.h auto_fs.h binfmts.h   \
+       capability.h capi.h cciss_ioctl.h cdrom.h cm4000_cs.h           \
+       cn_proc.h coda.h connector.h cramfs_fs.h cuda.h cyclades.h      \
+       dccp.h dirent.h divert.h elfcore.h errno.h errqueue.h           \
+       ethtool.h eventpoll.h ext2_fs.h ext3_fs.h fb.h fcntl.h          \
+       filter.h flat.h fs.h ftape.h gameport.h generic_serial.h        \
+       genhd.h hayesesp.h hdlcdrv.h hdlc.h hdreg.h hiddev.h hpet.h     \
+       i2c.h i2o-dev.h icmpv6.h if_bridge.h if_ec.h                    \
+       if_eql.h if_ether.h if_frad.h if_ltalk.h if_pppox.h             \
+       if_shaper.h if_tr.h if_tun.h if_vlan.h if_wanpipe.h igmp.h      \
+       inet_diag.h in.h inotify.h input.h ipc.h ipmi.h ipv6.h          \
+       ipv6_route.h isdn.h isdnif.h isdn_ppp.h isicom.h jbd.h          \
+       joystick.h kdev_t.h kd.h kernelcapi.h kernel.h keyboard.h       \
+       llc.h loop.h lp.h mempolicy.h mii.h mman.h mroute.h msdos_fs.h  \
+       msg.h nbd.h ncp_fs.h ncp.h ncp_mount.h netdevice.h              \
+       netfilter_bridge.h netfilter_decnet.h netfilter.h               \
+       netfilter_ipv4.h netfilter_ipv6.h netfilter_logging.h net.h     \
+       netlink.h nfs3.h nfs4.h nfsacl.h nfs_fs.h nfs.h nfs_idmap.h     \
+       n_r3964.h nubus.h nvram.h parport.h patchkey.h pci.h pktcdvd.h  \
+       pmu.h poll.h ppp_defs.h ppp-comp.h ptrace.h qnx4_fs.h quota.h   \
+       random.h reboot.h reiserfs_fs.h reiserfs_xattr.h romfs_fs.h     \
+       route.h rtc.h rtnetlink.h scc.h sched.h sdla.h                  \
+       selinux_netlink.h sem.h serial_core.h serial.h serio.h shm.h    \
+       signal.h smb_fs.h smb.h smb_mount.h socket.h sonet.h sonypi.h   \
+       soundcard.h stat.h sysctl.h tcp.h time.h timex.h tty.h types.h  \
+       udf_fs_i.h udp.h uinput.h uio.h unistd.h usb_ch9.h              \
+       usbdevice_fs.h user.h videodev2.h videodev.h wait.h             \
+       wanrouter.h watchdog.h xfrm.h zftape.h
+
+objhdr-y := version.h
index e051ff9c5b5061fabd5b92dc7fbf5463f9eec4d5..b27d7debc5a1df971dd5778f4a9bfae3237d8376 100644 (file)
 /* Rule structure sizes -- if these change, different AUDIT_ADD and
  * AUDIT_LIST commands must be implemented. */
 #define AUDIT_MAX_FIELDS   64
+#define AUDIT_MAX_KEY_LEN  32
 #define AUDIT_BITMASK_SIZE 64
 #define AUDIT_WORD(nr) ((__u32)((nr)/32))
 #define AUDIT_BIT(nr)  (1 << ((nr) - AUDIT_WORD(nr)*32))
 
+#define AUDIT_SYSCALL_CLASSES 16
+#define AUDIT_CLASS_DIR_WRITE 0
+#define AUDIT_CLASS_DIR_WRITE_32 1
+#define AUDIT_CLASS_CHATTR 2
+#define AUDIT_CLASS_CHATTR_32 3
+
 /* This bitmask is used to validate user input.  It represents all bits that
  * are currently used in an audit field constant understood by the kernel.
  * If you are adding a new #define AUDIT_<whatever>, please ensure that
 #define AUDIT_PERS     10
 #define AUDIT_ARCH     11
 #define AUDIT_MSGTYPE  12
-#define AUDIT_SE_USER  13      /* security label user */
-#define AUDIT_SE_ROLE  14      /* security label role */
-#define AUDIT_SE_TYPE  15      /* security label type */
-#define AUDIT_SE_SEN   16      /* security label sensitivity label */
-#define AUDIT_SE_CLR   17      /* security label clearance label */
+#define AUDIT_SUBJ_USER        13      /* security label user */
+#define AUDIT_SUBJ_ROLE        14      /* security label role */
+#define AUDIT_SUBJ_TYPE        15      /* security label type */
+#define AUDIT_SUBJ_SEN 16      /* security label sensitivity label */
+#define AUDIT_SUBJ_CLR 17      /* security label clearance label */
 #define AUDIT_PPID     18
+#define AUDIT_OBJ_USER 19
+#define AUDIT_OBJ_ROLE 20
+#define AUDIT_OBJ_TYPE 21
+#define AUDIT_OBJ_LEV_LOW      22
+#define AUDIT_OBJ_LEV_HIGH     23
 
                                /* These are ONLY useful when checking
                                 * at syscall exit time (AUDIT_AT_EXIT). */
 #define AUDIT_ARG2      (AUDIT_ARG0+2)
 #define AUDIT_ARG3      (AUDIT_ARG0+3)
 
+#define AUDIT_FILTERKEY        210
+
 #define AUDIT_NEGATE                   0x80000000
 
 /* These are the supported operators.
@@ -299,6 +313,7 @@ struct mqstat;
 #define AUDITSC_SUCCESS 1
 #define AUDITSC_FAILURE 2
 #define AUDITSC_RESULT(x) ( ((long)(x))<0?AUDITSC_FAILURE:AUDITSC_SUCCESS )
+extern int __init audit_register_class(int class, unsigned *list);
 #ifdef CONFIG_AUDITSYSCALL
 /* These are defined in auditsc.c */
                                /* Public API */
diff --git a/include/linux/byteorder/Kbuild b/include/linux/byteorder/Kbuild
new file mode 100644 (file)
index 0000000..84a57d4
--- /dev/null
@@ -0,0 +1,2 @@
+unifdef-y += generic.h swabb.h swab.h
+header-y += big_endian.h little_endian.h pdp_endian.h
index 90663ad217f983635231dc3550d7ac1fc8b18bee..251c41e3ddd5b870f3c05c1654ded90a02d95cff 100644 (file)
@@ -21,6 +21,18 @@ struct completion {
 #define DECLARE_COMPLETION(work) \
        struct completion work = COMPLETION_INITIALIZER(work)
 
+/*
+ * Lockdep needs to run a non-constant initializer for on-stack
+ * completions - so we use the _ONSTACK() variant for those that
+ * are on the kernel stack:
+ */
+#ifdef CONFIG_LOCKDEP
+# define DECLARE_COMPLETION_ONSTACK(work) \
+       struct completion work = ({ init_completion(&work); work; })
+#else
+# define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work)
+#endif
+
 static inline void init_completion(struct completion *x)
 {
        x->done = 0;
index a3caf6866bae588885c43618d9965a6285f0913c..44a11f1ccaf2d9f543c4dea5b2d602d82d3aab41 100644 (file)
@@ -87,9 +87,9 @@ int cpu_down(unsigned int cpu);
 #define lock_cpu_hotplug()     do { } while (0)
 #define unlock_cpu_hotplug()   do { } while (0)
 #define lock_cpu_hotplug_interruptible() 0
-#define hotcpu_notifier(fn, pri)
-#define register_hotcpu_notifier(nb)
-#define unregister_hotcpu_notifier(nb)
+#define hotcpu_notifier(fn, pri)       do { } while (0)
+#define register_hotcpu_notifier(nb)   do { } while (0)
+#define unregister_hotcpu_notifier(nb) do { } while (0)
 
 /* CPUs don't go offline once they're online w/o CONFIG_HOTPLUG_CPU */
 static inline int cpu_is_offline(int cpu) { return 0; }
index 466fbe9e489983bc74fcbc64affcf7f1b717be9a..35e137636b0b4c6dc44cdfc04ef53ec787ffadfd 100644 (file)
@@ -100,8 +100,10 @@ struct cpufreq_policy {
 #define CPUFREQ_INCOMPATIBLE   (1)
 #define CPUFREQ_NOTIFY         (2)
 
-#define CPUFREQ_SHARED_TYPE_ALL        (0) /* All dependent CPUs should set freq */
-#define CPUFREQ_SHARED_TYPE_ANY        (1) /* Freq can be set from any dependent CPU */
+#define CPUFREQ_SHARED_TYPE_NONE (0) /* None */
+#define CPUFREQ_SHARED_TYPE_HW  (1) /* HW does needed coordination */
+#define CPUFREQ_SHARED_TYPE_ALL         (2) /* All dependent CPUs should set freq */
+#define CPUFREQ_SHARED_TYPE_ANY         (3) /* Freq can be set from any dependent CPU*/
 
 /******************** cpufreq transition notifiers *******************/
 
index 0dd1610a94a940bdc38a12c0bd875c9159e55685..471781ffeab117c48762d31a6a08bae5124c2533 100644 (file)
@@ -114,6 +114,18 @@ struct dentry {
        unsigned char d_iname[DNAME_INLINE_LEN_MIN];    /* small names */
 };
 
+/*
+ * dentry->d_lock spinlock nesting subclasses:
+ *
+ * 0: normal
+ * 1: nested
+ */
+enum dentry_d_lock_class
+{
+       DENTRY_D_LOCK_NORMAL, /* implicitly used by plain spin_lock() APIs. */
+       DENTRY_D_LOCK_NESTED
+};
+
 struct dentry_operations {
        int (*d_revalidate)(struct dentry *, struct nameidata *);
        int (*d_hash) (struct dentry *, struct qstr *);
diff --git a/include/linux/debug_locks.h b/include/linux/debug_locks.h
new file mode 100644 (file)
index 0000000..6a70478
--- /dev/null
@@ -0,0 +1,69 @@
+#ifndef __LINUX_DEBUG_LOCKING_H
+#define __LINUX_DEBUG_LOCKING_H
+
+extern int debug_locks;
+extern int debug_locks_silent;
+
+/*
+ * Generic 'turn off all lock debugging' function:
+ */
+extern int debug_locks_off(void);
+
+/*
+ * In the debug case we carry the caller's instruction pointer into
+ * other functions, but we dont want the function argument overhead
+ * in the nondebug case - hence these macros:
+ */
+#define _RET_IP_               (unsigned long)__builtin_return_address(0)
+#define _THIS_IP_  ({ __label__ __here; __here: (unsigned long)&&__here; })
+
+#define DEBUG_LOCKS_WARN_ON(c)                                         \
+({                                                                     \
+       int __ret = 0;                                                  \
+                                                                       \
+       if (unlikely(c)) {                                              \
+               if (debug_locks_off())                                  \
+                       WARN_ON(1);                                     \
+               __ret = 1;                                              \
+       }                                                               \
+       __ret;                                                          \
+})
+
+#ifdef CONFIG_SMP
+# define SMP_DEBUG_LOCKS_WARN_ON(c)                    DEBUG_LOCKS_WARN_ON(c)
+#else
+# define SMP_DEBUG_LOCKS_WARN_ON(c)                    do { } while (0)
+#endif
+
+#ifdef CONFIG_DEBUG_LOCKING_API_SELFTESTS
+  extern void locking_selftest(void);
+#else
+# define locking_selftest()    do { } while (0)
+#endif
+
+#ifdef CONFIG_LOCKDEP
+extern void debug_show_all_locks(void);
+extern void debug_show_held_locks(struct task_struct *task);
+extern void debug_check_no_locks_freed(const void *from, unsigned long len);
+extern void debug_check_no_locks_held(struct task_struct *task);
+#else
+static inline void debug_show_all_locks(void)
+{
+}
+
+static inline void debug_show_held_locks(struct task_struct *task)
+{
+}
+
+static inline void
+debug_check_no_locks_freed(const void *from, unsigned long len)
+{
+}
+
+static inline void
+debug_check_no_locks_held(struct task_struct *task)
+{
+}
+#endif
+
+#endif
index 272010a6078a9181dfb4a49a51f3820d47ee1b01..c94d8f1d62e5f297ed4ef39d5c309e86a97e563f 100644 (file)
@@ -44,7 +44,7 @@ enum dma_event {
 };
 
 /**
- * typedef dma_cookie_t
+ * typedef dma_cookie_t - an opaque DMA cookie
  *
  * if dma_cookie_t is >0 it's a DMA request cookie, <0 it's an error code
  */
@@ -80,14 +80,14 @@ struct dma_chan_percpu {
 
 /**
  * struct dma_chan - devices supply DMA channels, clients use them
- * @client: ptr to the client user of this chan, will be NULL when unused
- * @device: ptr to the dma device who supplies this channel, always !NULL
+ * @client: ptr to the client user of this chan, will be %NULL when unused
+ * @device: ptr to the dma device who supplies this channel, always !%NULL
  * @cookie: last cookie value returned to client
- * @chan_id:
- * @class_dev:
+ * @chan_id: channel ID for sysfs
+ * @class_dev: class device for sysfs
  * @refcount: kref, used in "bigref" slow-mode
- * @slow_ref:
- * @rcu:
+ * @slow_ref: indicates that the DMA channel is free
+ * @rcu: the DMA channel's RCU head
  * @client_node: used to add this to the client chan list
  * @device_node: used to add this to the device chan list
  * @local: per-cpu pointer to a struct dma_chan_percpu
@@ -162,10 +162,17 @@ struct dma_client {
  * @chancnt: how many DMA channels are supported
  * @channels: the list of struct dma_chan
  * @global_node: list_head for global dma_device_list
- * @refcount:
- * @done:
- * @dev_id:
- * Other func ptrs: used to make use of this device's capabilities
+ * @refcount: reference count
+ * @done: IO completion struct
+ * @dev_id: unique device ID
+ * @device_alloc_chan_resources: allocate resources and return the
+ *     number of allocated descriptors
+ * @device_free_chan_resources: release DMA channel's resources
+ * @device_memcpy_buf_to_buf: memcpy buf pointer to buf pointer
+ * @device_memcpy_buf_to_pg: memcpy buf pointer to struct page
+ * @device_memcpy_pg_to_pg: memcpy struct page/offset to struct page/offset
+ * @device_memcpy_complete: poll the status of an IOAT DMA transaction
+ * @device_memcpy_issue_pending: push appended descriptors to hardware
  */
 struct dma_device {
 
@@ -211,7 +218,7 @@ void dma_async_client_chan_request(struct dma_client *client,
  * Both @dest and @src must be mappable to a bus address according to the
  * DMA mapping API rules for streaming mappings.
  * Both @dest and @src must stay memory resident (kernel memory or locked
- * user space pages)
+ * user space pages).
  */
 static inline dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan,
        void *dest, void *src, size_t len)
@@ -225,7 +232,7 @@ static inline dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan,
 }
 
 /**
- * dma_async_memcpy_buf_to_pg - offloaded copy
+ * dma_async_memcpy_buf_to_pg - offloaded copy from address to page
  * @chan: DMA channel to offload copy to
  * @page: destination page
  * @offset: offset in page to copy to
@@ -250,18 +257,18 @@ static inline dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan,
 }
 
 /**
- * dma_async_memcpy_buf_to_pg - offloaded copy
+ * dma_async_memcpy_pg_to_pg - offloaded copy from page to page
  * @chan: DMA channel to offload copy to
- * @dest_page: destination page
+ * @dest_pg: destination page
  * @dest_off: offset in page to copy to
- * @src_page: source page
+ * @src_pg: source page
  * @src_off: offset in page to copy from
  * @len: length
  *
  * Both @dest_page/@dest_off and @src_page/@src_off must be mappable to a bus
  * address according to the DMA mapping API rules for streaming mappings.
  * Both @dest_page/@dest_off and @src_page/@src_off must stay memory resident
- * (kernel memory or locked user space pages)
+ * (kernel memory or locked user space pages).
  */
 static inline dma_cookie_t dma_async_memcpy_pg_to_pg(struct dma_chan *chan,
        struct page *dest_pg, unsigned int dest_off, struct page *src_pg,
@@ -278,7 +285,7 @@ static inline dma_cookie_t dma_async_memcpy_pg_to_pg(struct dma_chan *chan,
 
 /**
  * dma_async_memcpy_issue_pending - flush pending copies to HW
- * @chan:
+ * @chan: target DMA channel
  *
  * This allows drivers to push copies to HW in batches,
  * reducing MMIO writes where possible.
index 2fda1b2aabd964416137b337e70695f978458f66..527504c11c5e810b9848bcfc2dc480028bc103a5 100644 (file)
@@ -125,14 +125,14 @@ typedef struct fs_disk_quota {
 
 /*
  * fs_quota_stat is the struct returned in Q_XGETQSTAT for a given file system.
- * Provides a centralized way to get meta infomation about the quota subsystem.
+ * Provides a centralized way to get meta information about the quota subsystem.
  * eg. space taken up for user and group quotas, number of dquots currently
  * incore.
  */
 #define FS_QSTAT_VERSION       1       /* fs_quota_stat.qs_version */
 
 /*
- * Some basic infomation about 'quota files'.
+ * Some basic information about 'quota files'.
  */
 typedef struct fs_qfilestat {
        __u64           qfs_ino;        /* inode number */
diff --git a/include/linux/dvb/Kbuild b/include/linux/dvb/Kbuild
new file mode 100644 (file)
index 0000000..63973af
--- /dev/null
@@ -0,0 +1,2 @@
+header-y += ca.h frontend.h net.h osd.h version.h
+unifdef-y := audio.h dmx.h video.h
index ff71d2af5da33ac711da7f64957d8d93bad4f91f..cd3b367f7445e5aa0f25ddbf2f0b96c44a19b94f 100644 (file)
@@ -13,7 +13,9 @@
  * This should be a per-architecture thing, to allow different
  * error and pointer decisions.
  */
-#define IS_ERR_VALUE(x) unlikely((x) > (unsigned long)-1000L)
+#define MAX_ERRNO      4095
+
+#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)
 
 static inline void *ERR_PTR(long error)
 {
index b45928f5c63fe838dee88eb7d03da5a6e4679e8b..ffefeeeeca937a6cb96d4ea7495853696e8ce65f 100644 (file)
@@ -557,7 +557,7 @@ struct fb_pixmap {
  * Frame buffer operations
  *
  * LOCKING NOTE: those functions must _ALL_ be called with the console
- * semaphore held, this is the only suitable locking mecanism we have
+ * semaphore held, this is the only suitable locking mechanism we have
  * in 2.6. Some may be called at interrupt time at this point though.
  */
 
index e04a5cfe874f978c91efbaa3bfe5ac71d259aefe..134b320682467fa84045e8cb7e8c68d2f20a7108 100644 (file)
@@ -435,6 +435,21 @@ struct block_device {
        unsigned long           bd_private;
 };
 
+/*
+ * bdev->bd_mutex nesting subclasses for the lock validator:
+ *
+ * 0: normal
+ * 1: 'whole'
+ * 2: 'partition'
+ */
+enum bdev_bd_mutex_lock_class
+{
+       BD_MUTEX_NORMAL,
+       BD_MUTEX_WHOLE,
+       BD_MUTEX_PARTITION
+};
+
+
 /*
  * Radix-tree tags, for tagging dirty and writeback pages within the pagecache
  * radix trees
@@ -542,6 +557,25 @@ struct inode {
 #endif
 };
 
+/*
+ * inode->i_mutex nesting subclasses for the lock validator:
+ *
+ * 0: the object of the current VFS operation
+ * 1: parent
+ * 2: child/target
+ * 3: quota file
+ *
+ * The locking order between these classes is
+ * parent -> child -> normal -> quota
+ */
+enum inode_i_mutex_lock_class
+{
+       I_MUTEX_NORMAL,
+       I_MUTEX_PARENT,
+       I_MUTEX_CHILD,
+       I_MUTEX_QUOTA
+};
+
 /*
  * NOTE: in a 32bit arch with a preemptable kernel and
  * an UP compile the i_size_read/write must be atomic
@@ -1276,6 +1310,8 @@ struct file_system_type {
        struct module *owner;
        struct file_system_type * next;
        struct list_head fs_supers;
+       struct lock_class_key s_lock_key;
+       struct lock_class_key s_umount_key;
 };
 
 extern int get_sb_bdev(struct file_system_type *fs_type,
@@ -1404,6 +1440,7 @@ extern void bd_set_size(struct block_device *, loff_t size);
 extern void bd_forget(struct inode *inode);
 extern void bdput(struct block_device *);
 extern struct block_device *open_by_devnum(dev_t, unsigned);
+extern struct block_device *open_partition_by_devnum(dev_t, unsigned);
 extern const struct file_operations def_blk_fops;
 extern const struct address_space_operations def_blk_aops;
 extern const struct file_operations def_chr_fops;
@@ -1414,6 +1451,7 @@ extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long);
 extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);
 extern int blkdev_get(struct block_device *, mode_t, unsigned);
 extern int blkdev_put(struct block_device *);
+extern int blkdev_put_partition(struct block_device *);
 extern int bd_claim(struct block_device *, void *);
 extern void bd_release(struct block_device *);
 #ifdef CONFIG_SYSFS
index 114ae583cca9a28480ba684c342a54b97bf46686..50d8b5744cf6fc5d7e5387289e7139e99cb557b3 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <linux/preempt.h>
 #include <linux/smp_lock.h>
+#include <linux/lockdep.h>
 #include <asm/hardirq.h>
 #include <asm/system.h>
 
@@ -86,9 +87,6 @@ extern void synchronize_irq(unsigned int irq);
 # define synchronize_irq(irq)  barrier()
 #endif
 
-#define nmi_enter()            irq_enter()
-#define nmi_exit()             sub_preempt_count(HARDIRQ_OFFSET)
-
 struct task_struct;
 
 #ifndef CONFIG_VIRT_CPU_ACCOUNTING
@@ -97,12 +95,35 @@ static inline void account_system_vtime(struct task_struct *tsk)
 }
 #endif
 
+/*
+ * It is safe to do non-atomic ops on ->hardirq_context,
+ * because NMI handlers may not preempt and the ops are
+ * always balanced, so the interrupted value of ->hardirq_context
+ * will always be restored.
+ */
 #define irq_enter()                                    \
        do {                                            \
                account_system_vtime(current);          \
                add_preempt_count(HARDIRQ_OFFSET);      \
+               trace_hardirq_enter();                  \
+       } while (0)
+
+/*
+ * Exit irq context without processing softirqs:
+ */
+#define __irq_exit()                                   \
+       do {                                            \
+               trace_hardirq_exit();                   \
+               account_system_vtime(current);          \
+               sub_preempt_count(HARDIRQ_OFFSET);      \
        } while (0)
 
+/*
+ * Exit irq context and process softirqs if needed:
+ */
 extern void irq_exit(void);
 
+#define nmi_enter()            do { lockdep_off(); irq_enter(); } while (0)
+#define nmi_exit()             do { __irq_exit(); lockdep_on(); } while (0)
+
 #endif /* LINUX_HARDIRQ_H */
diff --git a/include/linux/hdlc/Kbuild b/include/linux/hdlc/Kbuild
new file mode 100644 (file)
index 0000000..1fb2644
--- /dev/null
@@ -0,0 +1 @@
+header-y += ioctl.h
index 07d7305f131e6a5f1997b9d5af9c1a28412895f8..e4bccbcc2750a3f19711996f764fce80b6d7962a 100644 (file)
@@ -91,6 +91,7 @@ struct hrtimer_base {
        ktime_t                 (*get_softirq_time)(void);
        struct hrtimer          *curr_timer;
        ktime_t                 softirq_time;
+       struct lock_class_key lock_key;
 };
 
 /*
index 285316c836b5436932f9d90abb384d16ef983b59..dc7abef1096545c167e9ee7122ddc32b5712413b 100644 (file)
@@ -1359,7 +1359,7 @@ extern struct semaphore ide_cfg_sem;
  * ide_drive_t->hwif: constant, no locking
  */
 
-#define local_irq_set(flags)   do { local_save_flags((flags)); local_irq_enable(); } while (0)
+#define local_irq_set(flags)   do { local_save_flags((flags)); local_irq_enable_in_hardirq(); } while (0)
 
 extern struct bus_type ide_bus_type;
 
index f559a719dbe8ac215c114621a07cd4e6b7e0270c..826803449db7982063c831fc29196f3ce5c3377e 100644 (file)
@@ -66,7 +66,7 @@ struct idr {
        .id_free        = NULL,                                 \
        .layers         = 0,                                    \
        .id_free_cnt    = 0,                                    \
-       .lock           = SPIN_LOCK_UNLOCKED,                   \
+       .lock           = __SPIN_LOCK_UNLOCKED(name.lock),      \
 }
 #define DEFINE_IDR(name)       struct idr name = IDR_INIT(name)
 
index 3a256957fb56a7f05453dd3ea60cb075ca086b01..60aac2cea0cf63764b26d09f1f05cbc88b53e7ee 100644 (file)
@@ -3,6 +3,8 @@
 
 #include <linux/file.h>
 #include <linux/rcupdate.h>
+#include <linux/irqflags.h>
+#include <linux/lockdep.h>
 
 #define INIT_FDTABLE \
 {                                                      \
@@ -21,7 +23,7 @@
        .count          = ATOMIC_INIT(1),               \
        .fdt            = &init_files.fdtab,            \
        .fdtab          = INIT_FDTABLE,                 \
-       .file_lock      = SPIN_LOCK_UNLOCKED,           \
+       .file_lock      = __SPIN_LOCK_UNLOCKED(init_task.file_lock), \
        .next_fd        = 0,                            \
        .close_on_exec_init = { { 0, } },               \
        .open_fds_init  = { { 0, } },                   \
@@ -36,7 +38,7 @@
        .user_id        = 0,                            \
        .next           = NULL,                         \
        .wait           = __WAIT_QUEUE_HEAD_INITIALIZER(name.wait), \
-       .ctx_lock       = SPIN_LOCK_UNLOCKED,           \
+       .ctx_lock       = __SPIN_LOCK_UNLOCKED(name.ctx_lock), \
        .reqs_active    = 0U,                           \
        .max_reqs       = ~0U,                          \
 }
@@ -48,7 +50,7 @@
        .mm_users       = ATOMIC_INIT(2),                       \
        .mm_count       = ATOMIC_INIT(1),                       \
        .mmap_sem       = __RWSEM_INITIALIZER(name.mmap_sem),   \
-       .page_table_lock =  SPIN_LOCK_UNLOCKED,                 \
+       .page_table_lock =  __SPIN_LOCK_UNLOCKED(name.page_table_lock), \
        .mmlist         = LIST_HEAD_INIT(name.mmlist),          \
        .cpu_vm_mask    = CPU_MASK_ALL,                         \
 }
@@ -69,7 +71,7 @@
 #define INIT_SIGHAND(sighand) {                                                \
        .count          = ATOMIC_INIT(1),                               \
        .action         = { { { .sa_handler = NULL, } }, },             \
-       .siglock        = SPIN_LOCK_UNLOCKED,                           \
+       .siglock        = __SPIN_LOCK_UNLOCKED(sighand.siglock),        \
 }
 
 extern struct group_info init_groups;
@@ -119,12 +121,13 @@ extern struct group_info init_groups;
                .list = LIST_HEAD_INIT(tsk.pending.list),               \
                .signal = {{0}}},                                       \
        .blocked        = {{0}},                                        \
-       .alloc_lock     = SPIN_LOCK_UNLOCKED,                           \
+       .alloc_lock     = __SPIN_LOCK_UNLOCKED(tsk.alloc_lock),         \
        .journal_info   = NULL,                                         \
        .cpu_timers     = INIT_CPU_TIMERS(tsk.cpu_timers),              \
        .fs_excl        = ATOMIC_INIT(0),                               \
        .pi_lock        = SPIN_LOCK_UNLOCKED,                           \
-       INIT_RT_MUTEXES(tsk)                                            \
+       INIT_TRACE_IRQFLAGS                                             \
+       INIT_LOCKDEP                                                    \
 }
 
 
index db2a63a11633cb9ebdfeb21dc9436b1a23bd92ea..d5afee95fd435294f2ee894cd75a31b7cc96be7b 100644 (file)
 #include <linux/irqreturn.h>
 #include <linux/hardirq.h>
 #include <linux/sched.h>
+#include <linux/irqflags.h>
 #include <asm/atomic.h>
 #include <asm/ptrace.h>
 #include <asm/system.h>
 
+/*
+ * These correspond to the IORESOURCE_IRQ_* defines in
+ * linux/ioport.h to select the interrupt line behaviour.  When
+ * requesting an interrupt without specifying a IRQF_TRIGGER, the
+ * setting should be assumed to be "as already configured", which
+ * may be as per machine or firmware initialisation.
+ */
+#define IRQF_TRIGGER_NONE      0x00000000
+#define IRQF_TRIGGER_RISING    0x00000001
+#define IRQF_TRIGGER_FALLING   0x00000002
+#define IRQF_TRIGGER_HIGH      0x00000004
+#define IRQF_TRIGGER_LOW       0x00000008
+#define IRQF_TRIGGER_MASK      (IRQF_TRIGGER_HIGH | IRQF_TRIGGER_LOW | \
+                                IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)
+#define IRQF_TRIGGER_PROBE     0x00000010
+
+/*
+ * These flags used only by the kernel as part of the
+ * irq handling routines.
+ *
+ * IRQF_DISABLED - keep irqs disabled when calling the action handler
+ * IRQF_SAMPLE_RANDOM - irq is used to feed the random generator
+ * IRQF_SHARED - allow sharing the irq among several devices
+ * IRQF_PROBE_SHARED - set by callers when they expect sharing mismatches to occur
+ * IRQF_TIMER - Flag to mark this interrupt as timer interrupt
+ */
+#define IRQF_DISABLED          0x00000020
+#define IRQF_SAMPLE_RANDOM     0x00000040
+#define IRQF_SHARED            0x00000080
+#define IRQF_PROBE_SHARED      0x00000100
+#define IRQF_TIMER             0x00000200
+#define IRQF_PERCPU            0x00000400
+
+/*
+ * Migration helpers. Scheduled for removal in 1/2007
+ * Do not use for new code !
+ */
+#define SA_INTERRUPT           IRQF_DISABLED
+#define SA_SAMPLE_RANDOM       IRQF_SAMPLE_RANDOM
+#define SA_SHIRQ               IRQF_SHARED
+#define SA_PROBEIRQ            IRQF_PROBE_SHARED
+#define SA_PERCPU              IRQF_PERCPU
+
+#define SA_TRIGGER_LOW         IRQF_TRIGGER_LOW
+#define SA_TRIGGER_HIGH                IRQF_TRIGGER_HIGH
+#define SA_TRIGGER_FALLING     IRQF_TRIGGER_FALLING
+#define SA_TRIGGER_RISING      IRQF_TRIGGER_RISING
+#define SA_TRIGGER_MASK                IRQF_TRIGGER_MASK
+
 struct irqaction {
        irqreturn_t (*handler)(int, void *, struct pt_regs *);
        unsigned long flags;
@@ -31,12 +81,64 @@ extern int request_irq(unsigned int,
                       unsigned long, const char *, void *);
 extern void free_irq(unsigned int, void *);
 
+/*
+ * On lockdep we dont want to enable hardirqs in hardirq
+ * context. Use local_irq_enable_in_hardirq() to annotate
+ * kernel code that has to do this nevertheless (pretty much
+ * the only valid case is for old/broken hardware that is
+ * insanely slow).
+ *
+ * NOTE: in theory this might break fragile code that relies
+ * on hardirq delivery - in practice we dont seem to have such
+ * places left. So the only effect should be slightly increased
+ * irqs-off latencies.
+ */
+#ifdef CONFIG_LOCKDEP
+# define local_irq_enable_in_hardirq() do { } while (0)
+#else
+# define local_irq_enable_in_hardirq() local_irq_enable()
+#endif
 
 #ifdef CONFIG_GENERIC_HARDIRQS
 extern void disable_irq_nosync(unsigned int irq);
 extern void disable_irq(unsigned int irq);
 extern void enable_irq(unsigned int irq);
 
+/*
+ * Special lockdep variants of irq disabling/enabling.
+ * These should be used for locking constructs that
+ * know that a particular irq context which is disabled,
+ * and which is the only irq-context user of a lock,
+ * that it's safe to take the lock in the irq-disabled
+ * section without disabling hardirqs.
+ *
+ * On !CONFIG_LOCKDEP they are equivalent to the normal
+ * irq disable/enable methods.
+ */
+static inline void disable_irq_nosync_lockdep(unsigned int irq)
+{
+       disable_irq_nosync(irq);
+#ifdef CONFIG_LOCKDEP
+       local_irq_disable();
+#endif
+}
+
+static inline void disable_irq_lockdep(unsigned int irq)
+{
+       disable_irq(irq);
+#ifdef CONFIG_LOCKDEP
+       local_irq_disable();
+#endif
+}
+
+static inline void enable_irq_lockdep(unsigned int irq)
+{
+#ifdef CONFIG_LOCKDEP
+       local_irq_enable();
+#endif
+       enable_irq(irq);
+}
+
 /* IRQ wakeup (PM) control: */
 extern int set_irq_wake(unsigned int irq, unsigned int on);
 
@@ -50,7 +152,19 @@ static inline int disable_irq_wake(unsigned int irq)
        return set_irq_wake(irq, 0);
 }
 
-#endif
+#else /* !CONFIG_GENERIC_HARDIRQS */
+/*
+ * NOTE: non-genirq architectures, if they want to support the lock
+ * validator need to define the methods below in their asm/irq.h
+ * files, under an #ifdef CONFIG_LOCKDEP section.
+ */
+# ifndef CONFIG_LOCKDEP
+#  define disable_irq_nosync_lockdep(irq)      disable_irq_nosync(irq)
+#  define disable_irq_lockdep(irq)             disable_irq(irq)
+#  define enable_irq_lockdep(irq)              enable_irq(irq)
+# endif
+
+#endif /* CONFIG_GENERIC_HARDIRQS */
 
 #ifndef __ARCH_SET_SOFTIRQ_PENDING
 #define set_softirq_pending(x) (local_softirq_pending() = (x))
@@ -86,13 +200,11 @@ static inline void __deprecated save_and_cli(unsigned long *x)
 #define save_and_cli(x)        save_and_cli(&x)
 #endif /* CONFIG_SMP */
 
-/* SoftIRQ primitives.  */
-#define local_bh_disable() \
-               do { add_preempt_count(SOFTIRQ_OFFSET); barrier(); } while (0)
-#define __local_bh_enable() \
-               do { barrier(); sub_preempt_count(SOFTIRQ_OFFSET); } while (0)
-
+extern void local_bh_disable(void);
+extern void __local_bh_enable(void);
+extern void _local_bh_enable(void);
 extern void local_bh_enable(void);
+extern void local_bh_enable_ip(unsigned long ip);
 
 /* PLEASE, avoid to allocate new softirqs, if you need not _really_ high
    frequency threaded job scheduling. For almost all the purposes
index 87a9fc039b4789e6d68e65510cb06bafaf18c801..5612dfeeae5055c5305bb6512325b9a5ca98ad5e 100644 (file)
@@ -55,6 +55,7 @@ struct resource_list {
 #define IORESOURCE_IRQ_LOWEDGE         (1<<1)
 #define IORESOURCE_IRQ_HIGHLEVEL       (1<<2)
 #define IORESOURCE_IRQ_LOWLEVEL                (1<<3)
+#define IORESOURCE_IRQ_SHAREABLE       (1<<4)
 
 /* ISA PnP DMA specific bits (IORESOURCE_BITS) */
 #define IORESOURCE_DMA_TYPE_MASK       (3<<0)
index 0832149cdb180df6e8ba75e1f7a951c438b03546..b48eae32dc61c05eb5afd83c1c6c23ab4d10b85f 100644 (file)
 
 /*
  * IRQ line status.
+ *
+ * Bits 0-16 are reserved for the IRQF_* bits in linux/interrupt.h
+ *
+ * IRQ types
  */
-#define IRQ_INPROGRESS 1       /* IRQ handler active - do not enter! */
-#define IRQ_DISABLED   2       /* IRQ disabled - do not enter! */
-#define IRQ_PENDING    4       /* IRQ pending - replay on enable */
-#define IRQ_REPLAY     8       /* IRQ has been replayed but not acked yet */
-#define IRQ_AUTODETECT 16      /* IRQ is being autodetected */
-#define IRQ_WAITING    32      /* IRQ not yet seen - for autodetection */
-#define IRQ_LEVEL      64      /* IRQ level triggered */
-#define IRQ_MASKED     128     /* IRQ masked - shouldn't be seen again */
+#define IRQ_TYPE_NONE          0x00000000      /* Default, unspecified type */
+#define IRQ_TYPE_EDGE_RISING   0x00000001      /* Edge rising type */
+#define IRQ_TYPE_EDGE_FALLING  0x00000002      /* Edge falling type */
+#define IRQ_TYPE_EDGE_BOTH (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)
+#define IRQ_TYPE_LEVEL_HIGH    0x00000004      /* Level high type */
+#define IRQ_TYPE_LEVEL_LOW     0x00000008      /* Level low type */
+#define IRQ_TYPE_SENSE_MASK    0x0000000f      /* Mask of the above */
+#define IRQ_TYPE_PROBE         0x00000010      /* Probing in progress */
+
+/* Internal flags */
+#define IRQ_INPROGRESS         0x00010000      /* IRQ handler active - do not enter! */
+#define IRQ_DISABLED           0x00020000      /* IRQ disabled - do not enter! */
+#define IRQ_PENDING            0x00040000      /* IRQ pending - replay on enable */
+#define IRQ_REPLAY             0x00080000      /* IRQ has been replayed but not acked yet */
+#define IRQ_AUTODETECT         0x00100000      /* IRQ is being autodetected */
+#define IRQ_WAITING            0x00200000      /* IRQ not yet seen - for autodetection */
+#define IRQ_LEVEL              0x00400000      /* IRQ level triggered */
+#define IRQ_MASKED             0x00800000      /* IRQ masked - shouldn't be seen again */
 #ifdef CONFIG_IRQ_PER_CPU
-# define IRQ_PER_CPU   256     /* IRQ is per CPU */
+# define IRQ_PER_CPU           0x01000000      /* IRQ is per CPU */
 # define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU)
 #else
 # define CHECK_IRQ_PER_CPU(var) 0
 #endif
 
-#define IRQ_NOPROBE    512     /* IRQ is not valid for probing */
-#define IRQ_NOREQUEST  1024    /* IRQ cannot be requested */
-#define IRQ_NOAUTOEN   2048    /* IRQ will not be enabled on request irq */
-#define IRQ_DELAYED_DISABLE \
-                       4096    /* IRQ disable (masking) happens delayed. */
-
-/*
- * IRQ types, see also include/linux/interrupt.h
- */
-#define IRQ_TYPE_NONE          0x0000          /* Default, unspecified type */
-#define IRQ_TYPE_EDGE_RISING   0x0001          /* Edge rising type */
-#define IRQ_TYPE_EDGE_FALLING  0x0002          /* Edge falling type */
-#define IRQ_TYPE_EDGE_BOTH (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)
-#define IRQ_TYPE_LEVEL_HIGH    0x0004          /* Level high type */
-#define IRQ_TYPE_LEVEL_LOW     0x0008          /* Level low type */
-#define IRQ_TYPE_SENSE_MASK    0x000f          /* Mask of the above */
-#define IRQ_TYPE_SIMPLE                0x0010          /* Simple type */
-#define IRQ_TYPE_PERCPU                0x0020          /* Per CPU type */
-#define IRQ_TYPE_PROBE         0x0040          /* Probing in progress */
+#define IRQ_NOPROBE            0x02000000      /* IRQ is not valid for probing */
+#define IRQ_NOREQUEST          0x04000000      /* IRQ cannot be requested */
+#define IRQ_NOAUTOEN           0x08000000      /* IRQ will not be enabled on request irq */
+#define IRQ_DELAYED_DISABLE    0x10000000      /* IRQ disable (masking) happens delayed. */
 
 struct proc_dir_entry;
 
@@ -183,6 +182,10 @@ extern int setup_irq(unsigned int irq, struct irqaction *new);
 
 #ifdef CONFIG_GENERIC_HARDIRQS
 
+#ifndef handle_dynamic_tick
+# define handle_dynamic_tick(a)                do { } while (0)
+#endif
+
 #ifdef CONFIG_SMP
 static inline void set_native_irq_info(int irq, cpumask_t mask)
 {
@@ -348,8 +351,9 @@ extern int noirqdebug_setup(char *str);
 /* Checks whether the interrupt can be requested by request_irq(): */
 extern int can_request_irq(unsigned int irq, unsigned long irqflags);
 
-/* Dummy irq-chip implementation: */
+/* Dummy irq-chip implementations: */
 extern struct irq_chip no_irq_chip;
+extern struct irq_chip dummy_irq_chip;
 
 extern void
 set_irq_chip_and_handler(unsigned int irq, struct irq_chip *chip,
diff --git a/include/linux/irqflags.h b/include/linux/irqflags.h
new file mode 100644 (file)
index 0000000..412e025
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ * include/linux/irqflags.h
+ *
+ * IRQ flags tracing: follow the state of the hardirq and softirq flags and
+ * provide callbacks for transitions between ON and OFF states.
+ *
+ * This file gets included from lowlevel asm headers too, to provide
+ * wrapped versions of the local_irq_*() APIs, based on the
+ * raw_local_irq_*() macros from the lowlevel headers.
+ */
+#ifndef _LINUX_TRACE_IRQFLAGS_H
+#define _LINUX_TRACE_IRQFLAGS_H
+
+#ifdef CONFIG_TRACE_IRQFLAGS
+  extern void trace_hardirqs_on(void);
+  extern void trace_hardirqs_off(void);
+  extern void trace_softirqs_on(unsigned long ip);
+  extern void trace_softirqs_off(unsigned long ip);
+# define trace_hardirq_context(p)      ((p)->hardirq_context)
+# define trace_softirq_context(p)      ((p)->softirq_context)
+# define trace_hardirqs_enabled(p)     ((p)->hardirqs_enabled)
+# define trace_softirqs_enabled(p)     ((p)->softirqs_enabled)
+# define trace_hardirq_enter() do { current->hardirq_context++; } while (0)
+# define trace_hardirq_exit()  do { current->hardirq_context--; } while (0)
+# define trace_softirq_enter() do { current->softirq_context++; } while (0)
+# define trace_softirq_exit()  do { current->softirq_context--; } while (0)
+# define INIT_TRACE_IRQFLAGS   .softirqs_enabled = 1,
+#else
+# define trace_hardirqs_on()           do { } while (0)
+# define trace_hardirqs_off()          do { } while (0)
+# define trace_softirqs_on(ip)         do { } while (0)
+# define trace_softirqs_off(ip)                do { } while (0)
+# define trace_hardirq_context(p)      0
+# define trace_softirq_context(p)      0
+# define trace_hardirqs_enabled(p)     0
+# define trace_softirqs_enabled(p)     0
+# define trace_hardirq_enter()         do { } while (0)
+# define trace_hardirq_exit()          do { } while (0)
+# define trace_softirq_enter()         do { } while (0)
+# define trace_softirq_exit()          do { } while (0)
+# define INIT_TRACE_IRQFLAGS
+#endif
+
+#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT
+
+#include <asm/irqflags.h>
+
+#define local_irq_enable() \
+       do { trace_hardirqs_on(); raw_local_irq_enable(); } while (0)
+#define local_irq_disable() \
+       do { raw_local_irq_disable(); trace_hardirqs_off(); } while (0)
+#define local_irq_save(flags) \
+       do { raw_local_irq_save(flags); trace_hardirqs_off(); } while (0)
+
+#define local_irq_restore(flags)                               \
+       do {                                                    \
+               if (raw_irqs_disabled_flags(flags)) {           \
+                       raw_local_irq_restore(flags);           \
+                       trace_hardirqs_off();                   \
+               } else {                                        \
+                       trace_hardirqs_on();                    \
+                       raw_local_irq_restore(flags);           \
+               }                                               \
+       } while (0)
+#else /* !CONFIG_TRACE_IRQFLAGS_SUPPORT */
+/*
+ * The local_irq_*() APIs are equal to the raw_local_irq*()
+ * if !TRACE_IRQFLAGS.
+ */
+# define raw_local_irq_disable()       local_irq_disable()
+# define raw_local_irq_enable()                local_irq_enable()
+# define raw_local_irq_save(flags)     local_irq_save(flags)
+# define raw_local_irq_restore(flags)  local_irq_restore(flags)
+#endif /* CONFIG_TRACE_IRQFLAGS_SUPPORT */
+
+#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT
+#define safe_halt()                                            \
+       do {                                                    \
+               trace_hardirqs_on();                            \
+               raw_safe_halt();                                \
+       } while (0)
+
+#define local_save_flags(flags)                raw_local_save_flags(flags)
+
+#define irqs_disabled()                                                \
+({                                                             \
+       unsigned long flags;                                    \
+                                                               \
+       raw_local_save_flags(flags);                            \
+       raw_irqs_disabled_flags(flags);                         \
+})
+
+#define irqs_disabled_flags(flags)     raw_irqs_disabled_flags(flags)
+#endif         /* CONFIG_X86 */
+
+#endif
diff --git a/include/linux/isdn/Kbuild b/include/linux/isdn/Kbuild
new file mode 100644 (file)
index 0000000..991cdb2
--- /dev/null
@@ -0,0 +1 @@
+header-y += capicmd.h
index 54e2549f96bacb1d15433d6bf6b68747e60d9f87..849043ce4ed6ad811d77decf3463238a1c9a6f82 100644 (file)
@@ -57,10 +57,25 @@ do {                                                \
 #define print_fn_descriptor_symbol(fmt, addr) print_symbol(fmt, addr)
 #endif
 
-#define print_symbol(fmt, addr)                        \
-do {                                           \
-       __check_printsym_format(fmt, "");       \
-       __print_symbol(fmt, addr);              \
+static inline void print_symbol(const char *fmt, unsigned long addr)
+{
+       __check_printsym_format(fmt, "");
+       __print_symbol(fmt, (unsigned long)
+                      __builtin_extract_return_addr((void *)addr));
+}
+
+#ifndef CONFIG_64BIT
+#define print_ip_sym(ip)               \
+do {                                   \
+       printk("[<%08lx>]", ip);        \
+       print_symbol(" %s\n", ip);      \
 } while(0)
+#else
+#define print_ip_sym(ip)               \
+do {                                   \
+       printk("[<%016lx>]", ip);       \
+       print_symbol(" %s\n", ip);      \
+} while(0)
+#endif
 
 #endif /*_LINUX_KALLSYMS_H*/
index 2d229327959ed9809042af03c8fdb917913e000e..0503b2ed8bae8ae4e2fb89f01df052e5cebe3497 100644 (file)
@@ -46,6 +46,8 @@ enum kobject_action {
        KOBJ_UMOUNT     = (__force kobject_action_t) 0x05,      /* umount event for block devices (broken) */
        KOBJ_OFFLINE    = (__force kobject_action_t) 0x06,      /* device offline */
        KOBJ_ONLINE     = (__force kobject_action_t) 0x07,      /* device online */
+       KOBJ_UNDOCK     = (__force kobject_action_t) 0x08,      /* undocking */
+       KOBJ_DOCK       = (__force kobject_action_t) 0x09,      /* dock */
 };
 
 struct kobject {
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
new file mode 100644 (file)
index 0000000..316e0fb
--- /dev/null
@@ -0,0 +1,353 @@
+/*
+ * Runtime locking correctness validator
+ *
+ *  Copyright (C) 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
+ *
+ * see Documentation/lockdep-design.txt for more details.
+ */
+#ifndef __LINUX_LOCKDEP_H
+#define __LINUX_LOCKDEP_H
+
+#include <linux/linkage.h>
+#include <linux/list.h>
+#include <linux/debug_locks.h>
+#include <linux/stacktrace.h>
+
+#ifdef CONFIG_LOCKDEP
+
+/*
+ * Lock-class usage-state bits:
+ */
+enum lock_usage_bit
+{
+       LOCK_USED = 0,
+       LOCK_USED_IN_HARDIRQ,
+       LOCK_USED_IN_SOFTIRQ,
+       LOCK_ENABLED_SOFTIRQS,
+       LOCK_ENABLED_HARDIRQS,
+       LOCK_USED_IN_HARDIRQ_READ,
+       LOCK_USED_IN_SOFTIRQ_READ,
+       LOCK_ENABLED_SOFTIRQS_READ,
+       LOCK_ENABLED_HARDIRQS_READ,
+       LOCK_USAGE_STATES
+};
+
+/*
+ * Usage-state bitmasks:
+ */
+#define LOCKF_USED                     (1 << LOCK_USED)
+#define LOCKF_USED_IN_HARDIRQ          (1 << LOCK_USED_IN_HARDIRQ)
+#define LOCKF_USED_IN_SOFTIRQ          (1 << LOCK_USED_IN_SOFTIRQ)
+#define LOCKF_ENABLED_HARDIRQS         (1 << LOCK_ENABLED_HARDIRQS)
+#define LOCKF_ENABLED_SOFTIRQS         (1 << LOCK_ENABLED_SOFTIRQS)
+
+#define LOCKF_ENABLED_IRQS (LOCKF_ENABLED_HARDIRQS | LOCKF_ENABLED_SOFTIRQS)
+#define LOCKF_USED_IN_IRQ (LOCKF_USED_IN_HARDIRQ | LOCKF_USED_IN_SOFTIRQ)
+
+#define LOCKF_USED_IN_HARDIRQ_READ     (1 << LOCK_USED_IN_HARDIRQ_READ)
+#define LOCKF_USED_IN_SOFTIRQ_READ     (1 << LOCK_USED_IN_SOFTIRQ_READ)
+#define LOCKF_ENABLED_HARDIRQS_READ    (1 << LOCK_ENABLED_HARDIRQS_READ)
+#define LOCKF_ENABLED_SOFTIRQS_READ    (1 << LOCK_ENABLED_SOFTIRQS_READ)
+
+#define LOCKF_ENABLED_IRQS_READ \
+               (LOCKF_ENABLED_HARDIRQS_READ | LOCKF_ENABLED_SOFTIRQS_READ)
+#define LOCKF_USED_IN_IRQ_READ \
+               (LOCKF_USED_IN_HARDIRQ_READ | LOCKF_USED_IN_SOFTIRQ_READ)
+
+#define MAX_LOCKDEP_SUBCLASSES         8UL
+
+/*
+ * Lock-classes are keyed via unique addresses, by embedding the
+ * lockclass-key into the kernel (or module) .data section. (For
+ * static locks we use the lock address itself as the key.)
+ */
+struct lockdep_subclass_key {
+       char __one_byte;
+} __attribute__ ((__packed__));
+
+struct lock_class_key {
+       struct lockdep_subclass_key     subkeys[MAX_LOCKDEP_SUBCLASSES];
+};
+
+/*
+ * The lock-class itself:
+ */
+struct lock_class {
+       /*
+        * class-hash:
+        */
+       struct list_head                hash_entry;
+
+       /*
+        * global list of all lock-classes:
+        */
+       struct list_head                lock_entry;
+
+       struct lockdep_subclass_key     *key;
+       unsigned int                    subclass;
+
+       /*
+        * IRQ/softirq usage tracking bits:
+        */
+       unsigned long                   usage_mask;
+       struct stack_trace              usage_traces[LOCK_USAGE_STATES];
+
+       /*
+        * These fields represent a directed graph of lock dependencies,
+        * to every node we attach a list of "forward" and a list of
+        * "backward" graph nodes.
+        */
+       struct list_head                locks_after, locks_before;
+
+       /*
+        * Generation counter, when doing certain classes of graph walking,
+        * to ensure that we check one node only once:
+        */
+       unsigned int                    version;
+
+       /*
+        * Statistics counter:
+        */
+       unsigned long                   ops;
+
+       const char                      *name;
+       int                             name_version;
+};
+
+/*
+ * Map the lock object (the lock instance) to the lock-class object.
+ * This is embedded into specific lock instances:
+ */
+struct lockdep_map {
+       struct lock_class_key           *key;
+       struct lock_class               *class[MAX_LOCKDEP_SUBCLASSES];
+       const char                      *name;
+};
+
+/*
+ * Every lock has a list of other locks that were taken after it.
+ * We only grow the list, never remove from it:
+ */
+struct lock_list {
+       struct list_head                entry;
+       struct lock_class               *class;
+       struct stack_trace              trace;
+};
+
+/*
+ * We record lock dependency chains, so that we can cache them:
+ */
+struct lock_chain {
+       struct list_head                entry;
+       u64                             chain_key;
+};
+
+struct held_lock {
+       /*
+        * One-way hash of the dependency chain up to this point. We
+        * hash the hashes step by step as the dependency chain grows.
+        *
+        * We use it for dependency-caching and we skip detection
+        * passes and dependency-updates if there is a cache-hit, so
+        * it is absolutely critical for 100% coverage of the validator
+        * to have a unique key value for every unique dependency path
+        * that can occur in the system, to make a unique hash value
+        * as likely as possible - hence the 64-bit width.
+        *
+        * The task struct holds the current hash value (initialized
+        * with zero), here we store the previous hash value:
+        */
+       u64                             prev_chain_key;
+       struct lock_class               *class;
+       unsigned long                   acquire_ip;
+       struct lockdep_map              *instance;
+
+       /*
+        * The lock-stack is unified in that the lock chains of interrupt
+        * contexts nest ontop of process context chains, but we 'separate'
+        * the hashes by starting with 0 if we cross into an interrupt
+        * context, and we also keep do not add cross-context lock
+        * dependencies - the lock usage graph walking covers that area
+        * anyway, and we'd just unnecessarily increase the number of
+        * dependencies otherwise. [Note: hardirq and softirq contexts
+        * are separated from each other too.]
+        *
+        * The following field is used to detect when we cross into an
+        * interrupt context:
+        */
+       int                             irq_context;
+       int                             trylock;
+       int                             read;
+       int                             check;
+       int                             hardirqs_off;
+};
+
+/*
+ * Initialization, self-test and debugging-output methods:
+ */
+extern void lockdep_init(void);
+extern void lockdep_info(void);
+extern void lockdep_reset(void);
+extern void lockdep_reset_lock(struct lockdep_map *lock);
+extern void lockdep_free_key_range(void *start, unsigned long size);
+
+extern void lockdep_off(void);
+extern void lockdep_on(void);
+extern int lockdep_internal(void);
+
+/*
+ * These methods are used by specific locking variants (spinlocks,
+ * rwlocks, mutexes and rwsems) to pass init/acquire/release events
+ * to lockdep:
+ */
+
+extern void lockdep_init_map(struct lockdep_map *lock, const char *name,
+                            struct lock_class_key *key);
+
+/*
+ * Reinitialize a lock key - for cases where there is special locking or
+ * special initialization of locks so that the validator gets the scope
+ * of dependencies wrong: they are either too broad (they need a class-split)
+ * or they are too narrow (they suffer from a false class-split):
+ */
+#define lockdep_set_class(lock, key) \
+               lockdep_init_map(&(lock)->dep_map, #key, key)
+#define lockdep_set_class_and_name(lock, key, name) \
+               lockdep_init_map(&(lock)->dep_map, name, key)
+
+/*
+ * Acquire a lock.
+ *
+ * Values for "read":
+ *
+ *   0: exclusive (write) acquire
+ *   1: read-acquire (no recursion allowed)
+ *   2: read-acquire with same-instance recursion allowed
+ *
+ * Values for check:
+ *
+ *   0: disabled
+ *   1: simple checks (freeing, held-at-exit-time, etc.)
+ *   2: full validation
+ */
+extern void lock_acquire(struct lockdep_map *lock, unsigned int subclass,
+                        int trylock, int read, int check, unsigned long ip);
+
+extern void lock_release(struct lockdep_map *lock, int nested,
+                        unsigned long ip);
+
+# define INIT_LOCKDEP                          .lockdep_recursion = 0,
+
+#else /* !LOCKDEP */
+
+static inline void lockdep_off(void)
+{
+}
+
+static inline void lockdep_on(void)
+{
+}
+
+static inline int lockdep_internal(void)
+{
+       return 0;
+}
+
+# define lock_acquire(l, s, t, r, c, i)                do { } while (0)
+# define lock_release(l, n, i)                 do { } while (0)
+# define lockdep_init()                                do { } while (0)
+# define lockdep_info()                                do { } while (0)
+# define lockdep_init_map(lock, name, key)     do { (void)(key); } while (0)
+# define lockdep_set_class(lock, key)          do { (void)(key); } while (0)
+# define lockdep_set_class_and_name(lock, key, name) \
+               do { (void)(key); } while (0)
+# define INIT_LOCKDEP
+# define lockdep_reset()               do { debug_locks = 1; } while (0)
+# define lockdep_free_key_range(start, size)   do { } while (0)
+/*
+ * The class key takes no space if lockdep is disabled:
+ */
+struct lock_class_key { };
+#endif /* !LOCKDEP */
+
+#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_GENERIC_HARDIRQS)
+extern void early_init_irq_lock_class(void);
+#else
+# define early_init_irq_lock_class()           do { } while (0)
+#endif
+
+#ifdef CONFIG_TRACE_IRQFLAGS
+extern void early_boot_irqs_off(void);
+extern void early_boot_irqs_on(void);
+#else
+# define early_boot_irqs_off()                 do { } while (0)
+# define early_boot_irqs_on()                  do { } while (0)
+#endif
+
+/*
+ * For trivial one-depth nesting of a lock-class, the following
+ * global define can be used. (Subsystems with multiple levels
+ * of nesting should define their own lock-nesting subclasses.)
+ */
+#define SINGLE_DEPTH_NESTING                   1
+
+/*
+ * Map the dependency ops to NOP or to real lockdep ops, depending
+ * on the per lock-class debug mode:
+ */
+
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+# ifdef CONFIG_PROVE_LOCKING
+#  define spin_acquire(l, s, t, i)             lock_acquire(l, s, t, 0, 2, i)
+# else
+#  define spin_acquire(l, s, t, i)             lock_acquire(l, s, t, 0, 1, i)
+# endif
+# define spin_release(l, n, i)                 lock_release(l, n, i)
+#else
+# define spin_acquire(l, s, t, i)              do { } while (0)
+# define spin_release(l, n, i)                 do { } while (0)
+#endif
+
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+# ifdef CONFIG_PROVE_LOCKING
+#  define rwlock_acquire(l, s, t, i)           lock_acquire(l, s, t, 0, 2, i)
+#  define rwlock_acquire_read(l, s, t, i)      lock_acquire(l, s, t, 2, 2, i)
+# else
+#  define rwlock_acquire(l, s, t, i)           lock_acquire(l, s, t, 0, 1, i)
+#  define rwlock_acquire_read(l, s, t, i)      lock_acquire(l, s, t, 2, 1, i)
+# endif
+# define rwlock_release(l, n, i)               lock_release(l, n, i)
+#else
+# define rwlock_acquire(l, s, t, i)            do { } while (0)
+# define rwlock_acquire_read(l, s, t, i)       do { } while (0)
+# define rwlock_release(l, n, i)               do { } while (0)
+#endif
+
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+# ifdef CONFIG_PROVE_LOCKING
+#  define mutex_acquire(l, s, t, i)            lock_acquire(l, s, t, 0, 2, i)
+# else
+#  define mutex_acquire(l, s, t, i)            lock_acquire(l, s, t, 0, 1, i)
+# endif
+# define mutex_release(l, n, i)                        lock_release(l, n, i)
+#else
+# define mutex_acquire(l, s, t, i)             do { } while (0)
+# define mutex_release(l, n, i)                        do { } while (0)
+#endif
+
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+# ifdef CONFIG_PROVE_LOCKING
+#  define rwsem_acquire(l, s, t, i)            lock_acquire(l, s, t, 0, 2, i)
+#  define rwsem_acquire_read(l, s, t, i)       lock_acquire(l, s, t, 1, 2, i)
+# else
+#  define rwsem_acquire(l, s, t, i)            lock_acquire(l, s, t, 0, 1, i)
+#  define rwsem_acquire_read(l, s, t, i)       lock_acquire(l, s, t, 1, 1, i)
+# endif
+# define rwsem_release(l, n, i)                        lock_release(l, n, i)
+#else
+# define rwsem_acquire(l, s, t, i)             do { } while (0)
+# define rwsem_acquire_read(l, s, t, i)                do { } while (0)
+# define rwsem_release(l, n, i)                        do { } while (0)
+#endif
+
+#endif /* __LINUX_LOCKDEP_H */
index c41a1299b8cf354cc8b9d9677f328aa4bc8b8533..990957e0929f2319f217115df75977b3467ce5a4 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/prio_tree.h>
 #include <linux/fs.h>
 #include <linux/mutex.h>
+#include <linux/debug_locks.h>
 
 struct mempolicy;
 struct anon_vma;
@@ -36,7 +37,6 @@ extern int sysctl_legacy_va_layout;
 #include <asm/page.h>
 #include <asm/pgtable.h>
 #include <asm/processor.h>
-#include <asm/atomic.h>
 
 #define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n))
 
@@ -515,6 +515,11 @@ static inline void set_page_links(struct page *page, unsigned long zone,
        set_page_section(page, pfn_to_section_nr(pfn));
 }
 
+/*
+ * Some inline functions in vmstat.h depend on page_zone()
+ */
+#include <linux/vmstat.h>
+
 #ifndef CONFIG_DISCONTIGMEM
 /* The array of struct pages - for discontigmem use pgdat->lmem_map */
 extern struct page *mem_map;
@@ -1030,13 +1035,6 @@ static inline void vm_stat_account(struct mm_struct *mm,
 }
 #endif /* CONFIG_PROC_FS */
 
-static inline void
-debug_check_no_locks_freed(const void *from, unsigned long len)
-{
-       mutex_debug_check_no_locks_freed(from, len);
-       rt_mutex_debug_check_no_locks_freed(from, len);
-}
-
 #ifndef CONFIG_DEBUG_PAGEALLOC
 static inline void
 kernel_map_pages(struct page *page, int numpages, int enable)
index d6120fa69116f92399bfeb6951250ac1cc21e4a5..656b588a9f9640a027fdca5d00064d01b371db2a 100644 (file)
@@ -46,6 +46,27 @@ struct zone_padding {
 #define ZONE_PADDING(name)
 #endif
 
+enum zone_stat_item {
+       NR_ANON_PAGES,  /* Mapped anonymous pages */
+       NR_FILE_MAPPED, /* pagecache pages mapped into pagetables.
+                          only modified from process context */
+       NR_FILE_PAGES,
+       NR_SLAB,        /* Pages used by slab allocator */
+       NR_PAGETABLE,   /* used for pagetables */
+       NR_FILE_DIRTY,
+       NR_WRITEBACK,
+       NR_UNSTABLE_NFS,        /* NFS unstable pages */
+       NR_BOUNCE,
+#ifdef CONFIG_NUMA
+       NUMA_HIT,               /* allocated in intended node */
+       NUMA_MISS,              /* allocated in non intended node */
+       NUMA_FOREIGN,           /* was intended here, hit elsewhere */
+       NUMA_INTERLEAVE_HIT,    /* interleaver preferred this zone */
+       NUMA_LOCAL,             /* allocation from local node */
+       NUMA_OTHER,             /* allocation from other node */
+#endif
+       NR_VM_ZONE_STAT_ITEMS };
+
 struct per_cpu_pages {
        int count;              /* number of pages in the list */
        int high;               /* high watermark, emptying needed */
@@ -55,13 +76,8 @@ struct per_cpu_pages {
 
 struct per_cpu_pageset {
        struct per_cpu_pages pcp[2];    /* 0: hot.  1: cold */
-#ifdef CONFIG_NUMA
-       unsigned long numa_hit;         /* allocated in intended node */
-       unsigned long numa_miss;        /* allocated in non intended node */
-       unsigned long numa_foreign;     /* was intended here, hit elsewhere */
-       unsigned long interleave_hit;   /* interleaver prefered this zone */
-       unsigned long local_node;       /* allocation from local node */
-       unsigned long other_node;       /* allocation from other node */
+#ifdef CONFIG_SMP
+       s8 vm_stat_diff[NR_VM_ZONE_STAT_ITEMS];
 #endif
 } ____cacheline_aligned_in_smp;
 
@@ -134,6 +150,10 @@ struct zone {
        unsigned long           lowmem_reserve[MAX_NR_ZONES];
 
 #ifdef CONFIG_NUMA
+       /*
+        * zone reclaim becomes active if more unmapped pages exist.
+        */
+       unsigned long           min_unmapped_ratio;
        struct per_cpu_pageset  *pageset[NR_CPUS];
 #else
        struct per_cpu_pageset  pageset[NR_CPUS];
@@ -165,12 +185,8 @@ struct zone {
        /* A count of how many reclaimers are scanning this zone */
        atomic_t                reclaim_in_progress;
 
-       /*
-        * timestamp (in jiffies) of the last zone reclaim that did not
-        * result in freeing of pages. This is used to avoid repeated scans
-        * if all memory in the zone is in use.
-        */
-       unsigned long           last_unsuccessful_zone_reclaim;
+       /* Zone statistics */
+       atomic_long_t           vm_stat[NR_VM_ZONE_STAT_ITEMS];
 
        /*
         * prev_priority holds the scanning priority for this zone.  It is
@@ -402,6 +418,8 @@ int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int, struct file *,
                                        void __user *, size_t *, loff_t *);
 int percpu_pagelist_fraction_sysctl_handler(struct ctl_table *, int, struct file *,
                                        void __user *, size_t *, loff_t *);
+int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *, int,
+                       struct file *, void __user *, size_t *, loff_t *);
 
 #include <linux/topology.h>
 /* Returns the number of the current Node. */
index 9e9dc7c24d9589e50e84913c76f46ac9ec3b2ae5..d06c74fb8c262a13b4e5231ae41b489ce674ba8f 100644 (file)
@@ -358,6 +358,7 @@ static inline int module_is_live(struct module *mod)
 /* Is this address in a module? (second is with no locks, for oops) */
 struct module *module_text_address(unsigned long addr);
 struct module *__module_text_address(unsigned long addr);
+int is_module_address(unsigned long addr);
 
 /* Returns module and fills in value, defined and namebuf, or NULL if
    symnum out of range. */
@@ -496,6 +497,11 @@ static inline struct module *__module_text_address(unsigned long addr)
        return NULL;
 }
 
+static inline int is_module_address(unsigned long addr)
+{
+       return 0;
+}
+
 /* Get/put a kernel symbol (calls should be symmetric) */
 #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); })
 #define symbol_put(x) do { } while(0)
index 7a7fbe87fef0908906eea4cfd16682f849e943fd..1221b7c44158e21bfc653876d22c83c37cf0b64c 100644 (file)
 
 /**
  * struct nand_bbt_descr - bad block table descriptor
- * @param options      options for this descriptor
- * @param pages                the page(s) where we find the bbt, used with
+ * @options:           options for this descriptor
+ * @pages:             the page(s) where we find the bbt, used with
  *                     option BBT_ABSPAGE when bbt is searched,
  *                     then we store the found bbts pages here.
  *                     Its an array and supports up to 8 chips now
- * @param offs         offset of the pattern in the oob area of the page
- * @param veroffs      offset of the bbt version counter in the oob are of the page
- * @param version      version read from the bbt page during scan
- * @param len          length of the pattern, if 0 no pattern check is performed
- * @param maxblocks    maximum number of blocks to search for a bbt. This number of
- *                     blocks is reserved at the end of the device
+ * @offs:              offset of the pattern in the oob area of the page
+ * @veroffs:           offset of the bbt version counter in the oob area of the page
+ * @version:           version read from the bbt page during scan
+ * @len:               length of the pattern, if 0 no pattern check is performed
+ * @maxblocks:         maximum number of blocks to search for a bbt. This
+ *                     number of blocks is reserved at the end of the device
  *                     where the tables are written.
- * @param reserved_block_code  if non-0, this pattern denotes a reserved
+ * @reserved_block_code: if non-0, this pattern denotes a reserved
  *                     (rather than bad) block in the stored bbt
- * @param pattern      pattern to identify bad block table or factory marked
+ * @pattern:           pattern to identify bad block table or factory marked
  *                     good / bad blocks, can be NULL, if len = 0
  *
  * Descriptor for the bad block table marker and the descriptor for the
@@ -93,12 +93,15 @@ struct nand_bbt_descr {
 #define ONENAND_BADBLOCK_POS   0
 
 /**
- * struct bbt_info - [GENERIC] Bad Block Table data structure
- * @param bbt_erase_shift      [INTERN] number of address bits in a bbt entry
- * @param badblockpos          [INTERN] position of the bad block marker in the oob area
- * @param bbt                  [INTERN] bad block table pointer
- * @param badblock_pattern     [REPLACEABLE] bad block scan pattern used for initial bad block scan
- * @param priv                 [OPTIONAL] pointer to private bbm date
+ * struct bbm_info - [GENERIC] Bad Block Table data structure
+ * @bbt_erase_shift:   [INTERN] number of address bits in a bbt entry
+ * @badblockpos:       [INTERN] position of the bad block marker in the oob area
+ * @options:           options for this descriptor
+ * @bbt:               [INTERN] bad block table pointer
+ * @isbad_bbt:         function to determine if a block is bad
+ * @badblock_pattern:  [REPLACEABLE] bad block scan pattern used for
+ *                     initial bad block scan
+ * @priv:              [OPTIONAL] pointer to private bbm date
  */
 struct bbm_info {
        int bbt_erase_shift;
index 9b7a2b525d630edfe03f5f54692f03745d594ac0..94a443d45258485cf79e71f76c7d01bc2c39b2eb 100644 (file)
@@ -77,11 +77,11 @@ typedef enum {
  *
  * @len:       number of bytes to write/read. When a data buffer is given
  *             (datbuf != NULL) this is the number of data bytes. When
+             no data buffer is available this is the number of oob bytes.
*             no data buffer is available this is the number of oob bytes.
  *
  * @retlen:    number of bytes written/read. When a data buffer is given
  *             (datbuf != NULL) this is the number of data bytes. When
+             no data buffer is available this is the number of oob bytes.
*             no data buffer is available this is the number of oob bytes.
  *
  * @ooblen:    number of oob bytes per page
  * @ooboffs:   offset of oob data in the oob area (only relevant when
index 66559272ebcb86f2f3f4f05a1f025d232a984663..0b4cd2fa64aa6cf5a1b6da709b761ab8f2234fc8 100644 (file)
@@ -202,7 +202,7 @@ typedef enum {
 struct nand_chip;
 
 /**
- * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independend devices
+ * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independent devices
  * @lock:               protection lock
  * @active:            the mtd device which holds the controller currently
  * @wq:                        wait queue to sleep on if a NAND operation is in progress
@@ -223,12 +223,15 @@ struct nand_hw_control {
  * @total:     total number of ecc bytes per page
  * @prepad:    padding information for syndrome based ecc generators
  * @postpad:   padding information for syndrome based ecc generators
+ * @layout:    ECC layout control struct pointer
  * @hwctl:     function to control hardware ecc generator. Must only
  *             be provided if an hardware ECC is available
  * @calculate: function for ecc calculation or readback from ecc hardware
  * @correct:   function for ecc correction, matching to ecc generator (sw/hw)
  * @read_page: function to read a page according to the ecc generator requirements
  * @write_page:        function to write a page according to the ecc generator requirements
+ * @read_oob:  function to read chip OOB data
+ * @write_oob: function to write chip OOB data
  */
 struct nand_ecc_ctrl {
        nand_ecc_modes_t        mode;
@@ -300,11 +303,15 @@ struct nand_buffers {
  * @cmdfunc:           [REPLACEABLE] hardwarespecific function for writing commands to the chip
  * @waitfunc:          [REPLACEABLE] hardwarespecific function for wait on ready
  * @ecc:               [BOARDSPECIFIC] ecc control ctructure
+ * @buffers:           buffer structure for read/write
+ * @hwcontrol:         platform-specific hardware control structure
+ * @ops:               oob operation operands
  * @erase_cmd:         [INTERN] erase command write function, selectable due to AND support
  * @scan_bbt:          [REPLACEABLE] function to scan bad block table
  * @chip_delay:                [BOARDSPECIFIC] chip dependent delay for transfering data from array to read regs (tR)
  * @wq:                        [INTERN] wait queue to sleep on if a NAND operation is in progress
  * @state:             [INTERN] the current state of the NAND device
+ * @oob_poi:           poison value buffer
  * @page_shift:                [INTERN] number of address bits in a page (column address bits)
  * @phys_erase_shift:  [INTERN] number of address bits in a physical eraseblock
  * @bbt_erase_shift:   [INTERN] number of address bits in a bbt entry
@@ -400,7 +407,6 @@ struct nand_chip {
 
 /**
  * struct nand_flash_dev - NAND Flash Device ID Structure
- *
  * @name:      Identify the device type
  * @id:                device ID code
  * @pagesize:  Pagesize in bytes. Either 256 or 512 or 0
@@ -519,9 +525,8 @@ extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len,
 
 /**
  * struct platform_nand_chip - chip level device structure
- *
  * @nr_chips:          max. number of chips to scan for
- * @chip_offs:         chip number offset
+ * @chip_offset:       chip number offset
  * @nr_partitions:     number of partitions pointed to by partitions (or zero)
  * @partitions:                mtd partition list
  * @chip_delay:                R/B delay value in us
@@ -542,11 +547,10 @@ struct platform_nand_chip {
 
 /**
  * struct platform_nand_ctrl - controller level device structure
- *
  * @hwcontrol:         platform specific hardware control structure
  * @dev_ready:         platform specific function to read ready/busy pin
  * @select_chip:       platform specific chip select function
- * @priv_data:         private data to transport driver specific settings
+ * @priv:              private data to transport driver specific settings
  *
  * All fields are optional and depend on the hardware driver requirements
  */
index 9ce9a48db444a4cec4889661482281411ea5fc8e..1f4972155249887c1c70e3a2a25f42520ac2f871 100644 (file)
@@ -23,7 +23,7 @@ extern int onenand_scan(struct mtd_info *mtd, int max_chips);
 /* Free resources held by the OneNAND device */
 extern void onenand_release(struct mtd_info *mtd);
 
-/**
+/*
  * onenand_state_t - chip states
  * Enumeration for OneNAND flash chip state
  */
@@ -42,9 +42,9 @@ typedef enum {
 
 /**
  * struct onenand_bufferram - OneNAND BufferRAM Data
- * @param block                block address in BufferRAM
- * @param page         page address in BufferRAM
- * @param valid                valid flag
+ * @block:             block address in BufferRAM
+ * @page:              page address in BufferRAM
+ * @valid:             valid flag
  */
 struct onenand_bufferram {
        int block;
@@ -54,32 +54,43 @@ struct onenand_bufferram {
 
 /**
  * struct onenand_chip - OneNAND Private Flash Chip Data
- * @param base         [BOARDSPECIFIC] address to access OneNAND
- * @param chipsize     [INTERN] the size of one chip for multichip arrays
- * @param device_id    [INTERN] device ID
- * @param verstion_id  [INTERN] version ID
- * @param options      [BOARDSPECIFIC] various chip options. They can partly be set to inform onenand_scan about
- * @param erase_shift  [INTERN] number of address bits in a block
- * @param page_shift   [INTERN] number of address bits in a page
- * @param ppb_shift    [INTERN] number of address bits in a pages per block
- * @param page_mask    [INTERN] a page per block mask
- * @param bufferam_index       [INTERN] BufferRAM index
- * @param bufferam     [INTERN] BufferRAM info
- * @param readw                [REPLACEABLE] hardware specific function for read short
- * @param writew       [REPLACEABLE] hardware specific function for write short
- * @param command      [REPLACEABLE] hardware specific function for writing commands to the chip
- * @param wait         [REPLACEABLE] hardware specific function for wait on ready
- * @param read_bufferram       [REPLACEABLE] hardware specific function for BufferRAM Area
- * @param write_bufferram      [REPLACEABLE] hardware specific function for BufferRAM Area
- * @param read_word    [REPLACEABLE] hardware specific function for read register of OneNAND
- * @param write_word   [REPLACEABLE] hardware specific function for write register of OneNAND
- * @param scan_bbt     [REPLACEALBE] hardware specific function for scaning Bad block Table
- * @param chip_lock    [INTERN] spinlock used to protect access to this structure and the chip
- * @param wq           [INTERN] wait queue to sleep on if a OneNAND operation is in progress
- * @param state                [INTERN] the current state of the OneNAND device
- * @param ecclayout    [REPLACEABLE] the default ecc placement scheme
- * @param bbm          [REPLACEABLE] pointer to Bad Block Management
- * @param priv         [OPTIONAL] pointer to private chip date
+ * @base:              [BOARDSPECIFIC] address to access OneNAND
+ * @chipsize:          [INTERN] the size of one chip for multichip arrays
+ * @device_id:         [INTERN] device ID
+ * @density_mask:      chip density, used for DDP devices
+ * @verstion_id:       [INTERN] version ID
+ * @options:           [BOARDSPECIFIC] various chip options. They can
+ *                     partly be set to inform onenand_scan about
+ * @erase_shift:       [INTERN] number of address bits in a block
+ * @page_shift:                [INTERN] number of address bits in a page
+ * @ppb_shift:         [INTERN] number of address bits in a pages per block
+ * @page_mask:         [INTERN] a page per block mask
+ * @bufferram_index:   [INTERN] BufferRAM index
+ * @bufferram:         [INTERN] BufferRAM info
+ * @readw:             [REPLACEABLE] hardware specific function for read short
+ * @writew:            [REPLACEABLE] hardware specific function for write short
+ * @command:           [REPLACEABLE] hardware specific function for writing
+ *                     commands to the chip
+ * @wait:              [REPLACEABLE] hardware specific function for wait on ready
+ * @read_bufferram:    [REPLACEABLE] hardware specific function for BufferRAM Area
+ * @write_bufferram:   [REPLACEABLE] hardware specific function for BufferRAM Area
+ * @read_word:         [REPLACEABLE] hardware specific function for read
+ *                     register of OneNAND
+ * @write_word:                [REPLACEABLE] hardware specific function for write
+ *                     register of OneNAND
+ * @mmcontrol:         sync burst read function
+ * @block_markbad:     function to mark a block as bad
+ * @scan_bbt:          [REPLACEALBE] hardware specific function for scanning
+ *                     Bad block Table
+ * @chip_lock:         [INTERN] spinlock used to protect access to this
+ *                     structure and the chip
+ * @wq:                        [INTERN] wait queue to sleep on if a OneNAND
+ *                     operation is in progress
+ * @state:             [INTERN] the current state of the OneNAND device
+ * @page_buf:          data buffer
+ * @ecclayout:         [REPLACEABLE] the default ecc placement scheme
+ * @bbm:               [REPLACEABLE] pointer to Bad Block Management
+ * @priv:              [OPTIONAL] pointer to private chip date
  */
 struct onenand_chip {
        void __iomem            *base;
@@ -147,9 +158,9 @@ struct onenand_chip {
 #define ONENAND_MFR_SAMSUNG    0xec
 
 /**
- * struct nand_manufacturers - NAND Flash Manufacturer ID Structure
- * @param name:                Manufacturer name
- * @param id:          manufacturer ID code of device.
+ * struct onenand_manufacturers - NAND Flash Manufacturer ID Structure
+ * @name:      Manufacturer name
+ * @id:                manufacturer ID code of device.
 */
 struct onenand_manufacturers {
         int id;
index 8b5769f00467c6ea172112d6a02b80f5f8c370ca..2537285e10641de6ae4a5d51170912860aff03e2 100644 (file)
@@ -2,22 +2,22 @@
 #define __LINUX_MUTEX_DEBUG_H
 
 #include <linux/linkage.h>
+#include <linux/lockdep.h>
 
 /*
  * Mutexes - debugging helpers:
  */
 
-#define __DEBUG_MUTEX_INITIALIZER(lockname) \
-       , .held_list = LIST_HEAD_INIT(lockname.held_list), \
-         .name = #lockname , .magic = &lockname
+#define __DEBUG_MUTEX_INITIALIZER(lockname)                            \
+       , .magic = &lockname
 
-#define mutex_init(sem)                __mutex_init(sem, __FUNCTION__)
+#define mutex_init(mutex)                                              \
+do {                                                                   \
+       static struct lock_class_key __key;                             \
+                                                                       \
+       __mutex_init((mutex), #mutex, &__key);                          \
+} while (0)
 
 extern void FASTCALL(mutex_destroy(struct mutex *lock));
 
-extern void mutex_debug_show_all_locks(void);
-extern void mutex_debug_show_held_locks(struct task_struct *filter);
-extern void mutex_debug_check_no_locks_held(struct task_struct *task);
-extern void mutex_debug_check_no_locks_freed(const void *from, unsigned long len);
-
 #endif
index f1ac507fa20da323800bf32393a0c77c5ad64dde..27c48daa3183297dd84e0d6345093c8a12c14145 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/list.h>
 #include <linux/spinlock_types.h>
 #include <linux/linkage.h>
+#include <linux/lockdep.h>
 
 #include <asm/atomic.h>
 
@@ -50,11 +51,12 @@ struct mutex {
        struct list_head        wait_list;
 #ifdef CONFIG_DEBUG_MUTEXES
        struct thread_info      *owner;
-       struct list_head        held_list;
-       unsigned long           acquire_ip;
        const char              *name;
        void                    *magic;
 #endif
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+       struct lockdep_map      dep_map;
+#endif
 };
 
 /*
@@ -74,24 +76,34 @@ struct mutex_waiter {
 # include <linux/mutex-debug.h>
 #else
 # define __DEBUG_MUTEX_INITIALIZER(lockname)
-# define mutex_init(mutex)                     __mutex_init(mutex, NULL)
+# define mutex_init(mutex) \
+do {                                                   \
+       static struct lock_class_key __key;             \
+                                                       \
+       __mutex_init((mutex), #mutex, &__key);          \
+} while (0)
 # define mutex_destroy(mutex)                          do { } while (0)
-# define mutex_debug_show_all_locks()                  do { } while (0)
-# define mutex_debug_show_held_locks(p)                        do { } while (0)
-# define mutex_debug_check_no_locks_held(task)         do { } while (0)
-# define mutex_debug_check_no_locks_freed(from, len)   do { } while (0)
+#endif
+
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+# define __DEP_MAP_MUTEX_INITIALIZER(lockname) \
+               , .dep_map = { .name = #lockname }
+#else
+# define __DEP_MAP_MUTEX_INITIALIZER(lockname)
 #endif
 
 #define __MUTEX_INITIALIZER(lockname) \
                { .count = ATOMIC_INIT(1) \
                , .wait_lock = SPIN_LOCK_UNLOCKED \
                , .wait_list = LIST_HEAD_INIT(lockname.wait_list) \
-               __DEBUG_MUTEX_INITIALIZER(lockname) }
+               __DEBUG_MUTEX_INITIALIZER(lockname) \
+               __DEP_MAP_MUTEX_INITIALIZER(lockname) }
 
 #define DEFINE_MUTEX(mutexname) \
        struct mutex mutexname = __MUTEX_INITIALIZER(mutexname)
 
-extern void fastcall __mutex_init(struct mutex *lock, const char *name);
+extern void __mutex_init(struct mutex *lock, const char *name,
+                        struct lock_class_key *key);
 
 /***
  * mutex_is_locked - is the mutex locked
@@ -110,6 +122,13 @@ static inline int fastcall mutex_is_locked(struct mutex *lock)
  */
 extern void fastcall mutex_lock(struct mutex *lock);
 extern int fastcall mutex_lock_interruptible(struct mutex *lock);
+
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass);
+#else
+# define mutex_lock_nested(lock, subclass) mutex_lock(lock)
+#endif
+
 /*
  * NOTE: mutex_trylock() follows the spin_trylock() convention,
  *       not the down_trylock() convention!
index aa2d3c12c4d80cffdb6a011ee1d01a0ca57f8af9..85f99f60deea46c3f5af0f24f9c3a806b51dfd7c 100644 (file)
@@ -313,10 +313,12 @@ struct net_device
 
        /* Segmentation offload features */
 #define NETIF_F_GSO_SHIFT      16
+#define NETIF_F_GSO_MASK       0xffff0000
 #define NETIF_F_TSO            (SKB_GSO_TCPV4 << NETIF_F_GSO_SHIFT)
-#define NETIF_F_UFO            (SKB_GSO_UDPV4 << NETIF_F_GSO_SHIFT)
+#define NETIF_F_UFO            (SKB_GSO_UDP << NETIF_F_GSO_SHIFT)
 #define NETIF_F_GSO_ROBUST     (SKB_GSO_DODGY << NETIF_F_GSO_SHIFT)
-#define NETIF_F_TSO_ECN                (SKB_GSO_TCPV4_ECN << NETIF_F_GSO_SHIFT)
+#define NETIF_F_TSO_ECN                (SKB_GSO_TCP_ECN << NETIF_F_GSO_SHIFT)
+#define NETIF_F_TSO6           (SKB_GSO_TCPV6 << NETIF_F_GSO_SHIFT)
 
 #define NETIF_F_GEN_CSUM       (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM)
 #define NETIF_F_ALL_CSUM       (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM)
@@ -991,13 +993,18 @@ extern void dev_seq_stop(struct seq_file *seq, void *v);
 
 extern void linkwatch_run_queue(void);
 
-static inline int skb_gso_ok(struct sk_buff *skb, int features)
+static inline int net_gso_ok(int features, int gso_type)
 {
-       int feature = skb_shinfo(skb)->gso_size ?
-                     skb_shinfo(skb)->gso_type << NETIF_F_GSO_SHIFT : 0;
+       int feature = gso_type << NETIF_F_GSO_SHIFT;
        return (features & feature) == feature;
 }
 
+static inline int skb_gso_ok(struct sk_buff *skb, int features)
+{
+       return net_gso_ok(features, skb_shinfo(skb)->gso_size ?
+                                   skb_shinfo(skb)->gso_type : 0);
+}
+
 static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb)
 {
        return !skb_gso_ok(skb, dev->features);
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild
new file mode 100644 (file)
index 0000000..d06311a
--- /dev/null
@@ -0,0 +1,11 @@
+header-y := nf_conntrack_sctp.h nf_conntrack_tuple_common.h            \
+           nfnetlink_conntrack.h nfnetlink_log.h nfnetlink_queue.h     \
+           xt_CLASSIFY.h xt_comment.h xt_connbytes.h xt_connmark.h     \
+           xt_CONNMARK.h xt_conntrack.h xt_dccp.h xt_esp.h             \
+           xt_helper.h xt_length.h xt_limit.h xt_mac.h xt_mark.h       \
+           xt_MARK.h xt_multiport.h xt_NFQUEUE.h xt_pkttype.h          \
+           xt_policy.h xt_realm.h xt_sctp.h xt_state.h xt_string.h     \
+           xt_tcpmss.h xt_tcpudp.h
+
+unifdef-y := nf_conntrack_common.h nf_conntrack_ftp.h          \
+       nf_conntrack_tcp.h nfnetlink.h x_tables.h xt_physdev.h
diff --git a/include/linux/netfilter_arp/Kbuild b/include/linux/netfilter_arp/Kbuild
new file mode 100644 (file)
index 0000000..198ec5e
--- /dev/null
@@ -0,0 +1,2 @@
+header-y := arpt_mangle.h
+unifdef-y := arp_tables.h
diff --git a/include/linux/netfilter_bridge/Kbuild b/include/linux/netfilter_bridge/Kbuild
new file mode 100644 (file)
index 0000000..5b1aba6
--- /dev/null
@@ -0,0 +1,4 @@
+header-y += ebt_among.h ebt_arp.h ebt_arpreply.h ebt_ip.h ebt_limit.h  \
+       ebt_log.h ebt_mark_m.h ebt_mark_t.h ebt_nat.h ebt_pkttype.h     \
+       ebt_redirect.h ebt_stp.h ebt_ulog.h ebt_vlan.h
+unifdef-y := ebtables.h ebt_802_3.h
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild
new file mode 100644 (file)
index 0000000..04e4d27
--- /dev/null
@@ -0,0 +1,21 @@
+
+header-y := ip_conntrack_helper.h ip_conntrack_helper_h323_asn1.h      \
+           ip_conntrack_helper_h323_types.h ip_conntrack_protocol.h    \
+           ip_conntrack_sctp.h ip_conntrack_tcp.h ip_conntrack_tftp.h  \
+           ip_nat_pptp.h ipt_addrtype.h ipt_ah.h       \
+           ipt_CLASSIFY.h ipt_CLUSTERIP.h ipt_comment.h                \
+           ipt_connbytes.h ipt_connmark.h ipt_CONNMARK.h               \
+           ipt_conntrack.h ipt_dccp.h ipt_dscp.h ipt_DSCP.h ipt_ecn.h  \
+           ipt_ECN.h ipt_esp.h ipt_hashlimit.h ipt_helper.h            \
+           ipt_iprange.h ipt_length.h ipt_limit.h ipt_LOG.h ipt_mac.h  \
+           ipt_mark.h ipt_MARK.h ipt_multiport.h ipt_NFQUEUE.h         \
+           ipt_owner.h ipt_physdev.h ipt_pkttype.h ipt_policy.h        \
+           ipt_realm.h ipt_recent.h ipt_REJECT.h ipt_SAME.h            \
+           ipt_sctp.h ipt_state.h ipt_string.h ipt_tcpmss.h            \
+           ipt_TCPMSS.h ipt_tos.h ipt_TOS.h ipt_ttl.h ipt_TTL.h        \
+           ipt_ULOG.h
+
+unifdef-y := ip_conntrack.h ip_conntrack_h323.h ip_conntrack_irc.h     \
+       ip_conntrack_pptp.h ip_conntrack_proto_gre.h                    \
+       ip_conntrack_tuple.h ip_nat.h ip_nat_rule.h ip_queue.h          \
+       ip_tables.h
diff --git a/include/linux/netfilter_ipv6/Kbuild b/include/linux/netfilter_ipv6/Kbuild
new file mode 100644 (file)
index 0000000..913ddbf
--- /dev/null
@@ -0,0 +1,6 @@
+header-y += ip6t_HL.h ip6t_LOG.h ip6t_MARK.h ip6t_REJECT.h ip6t_ah.h   \
+       ip6t_esp.h ip6t_frag.h ip6t_hl.h ip6t_ipv6header.h              \
+       ip6t_length.h ip6t_limit.h ip6t_mac.h ip6t_mark.h               \
+       ip6t_multiport.h ip6t_opts.h ip6t_owner.h ip6t_policy.h         \
+       ip6t_physdev.h ip6t_rt.h
+unifdef-y := ip6_tables.h
index d90b1bb3756305d71303de5e726636fa9f3cdfe1..55ea853d57bcbce9c6acfff30c132001954314e5 100644 (file)
@@ -9,7 +9,6 @@
 #ifndef _LINUX_NFS_FS_H
 #define _LINUX_NFS_FS_H
 
-#include <linux/config.h>
 #include <linux/in.h>
 #include <linux/mm.h>
 #include <linux/pagemap.h>
diff --git a/include/linux/nfsd/Kbuild b/include/linux/nfsd/Kbuild
new file mode 100644 (file)
index 0000000..c8c5456
--- /dev/null
@@ -0,0 +1,2 @@
+unifdef-y := const.h export.h stats.h syscall.h nfsfh.h debug.h auth.h
+
index 51dbab9710c7ea27ccdf9743076f9387d02a9d2a..7ff386a6ae87dd216e719dca52c39ce7aa12946f 100644 (file)
@@ -65,7 +65,7 @@ struct raw_notifier_head {
        } while (0)
 
 #define ATOMIC_NOTIFIER_INIT(name) {                           \
-               .lock = SPIN_LOCK_UNLOCKED,                     \
+               .lock = __SPIN_LOCK_UNLOCKED(name.lock),        \
                .head = NULL }
 #define BLOCKING_NOTIFIER_INIT(name) {                         \
                .rwsem = __RWSEM_INITIALIZER((name).rwsem),     \
index 0c076d58c6760751a3e82fda67c71fc02c7cc83a..5748642e9f3660790652efdd7488ef7d42efe44f 100644 (file)
@@ -5,12 +5,8 @@
 #ifndef PAGE_FLAGS_H
 #define PAGE_FLAGS_H
 
-#include <linux/percpu.h>
-#include <linux/cache.h>
 #include <linux/types.h>
 
-#include <asm/pgtable.h>
-
 /*
  * Various page->flags bits:
  *
 #define PG_uncached            31      /* Page has been mapped as uncached */
 #endif
 
-/*
- * Global page accounting.  One instance per CPU.  Only unsigned longs are
- * allowed.
- *
- * - Fields can be modified with xxx_page_state and xxx_page_state_zone at
- * any time safely (which protects the instance from modification by
- * interrupt.
- * - The __xxx_page_state variants can be used safely when interrupts are
- * disabled.
- * - The __xxx_page_state variants can be used if the field is only
- * modified from process context and protected from preemption, or only
- * modified from interrupt context.  In this case, the field should be
- * commented here.
- */
-struct page_state {
-       unsigned long nr_dirty;         /* Dirty writeable pages */
-       unsigned long nr_writeback;     /* Pages under writeback */
-       unsigned long nr_unstable;      /* NFS unstable pages */
-       unsigned long nr_page_table_pages;/* Pages used for pagetables */
-       unsigned long nr_mapped;        /* mapped into pagetables.
-                                        * only modified from process context */
-       unsigned long nr_slab;          /* In slab */
-#define GET_PAGE_STATE_LAST nr_slab
-
-       /*
-        * The below are zeroed by get_page_state().  Use get_full_page_state()
-        * to add up all these.
-        */
-       unsigned long pgpgin;           /* Disk reads */
-       unsigned long pgpgout;          /* Disk writes */
-       unsigned long pswpin;           /* swap reads */
-       unsigned long pswpout;          /* swap writes */
-
-       unsigned long pgalloc_high;     /* page allocations */
-       unsigned long pgalloc_normal;
-       unsigned long pgalloc_dma32;
-       unsigned long pgalloc_dma;
-
-       unsigned long pgfree;           /* page freeings */
-       unsigned long pgactivate;       /* pages moved inactive->active */
-       unsigned long pgdeactivate;     /* pages moved active->inactive */
-
-       unsigned long pgfault;          /* faults (major+minor) */
-       unsigned long pgmajfault;       /* faults (major only) */
-
-       unsigned long pgrefill_high;    /* inspected in refill_inactive_zone */
-       unsigned long pgrefill_normal;
-       unsigned long pgrefill_dma32;
-       unsigned long pgrefill_dma;
-
-       unsigned long pgsteal_high;     /* total highmem pages reclaimed */
-       unsigned long pgsteal_normal;
-       unsigned long pgsteal_dma32;
-       unsigned long pgsteal_dma;
-
-       unsigned long pgscan_kswapd_high;/* total highmem pages scanned */
-       unsigned long pgscan_kswapd_normal;
-       unsigned long pgscan_kswapd_dma32;
-       unsigned long pgscan_kswapd_dma;
-
-       unsigned long pgscan_direct_high;/* total highmem pages scanned */
-       unsigned long pgscan_direct_normal;
-       unsigned long pgscan_direct_dma32;
-       unsigned long pgscan_direct_dma;
-
-       unsigned long pginodesteal;     /* pages reclaimed via inode freeing */
-       unsigned long slabs_scanned;    /* slab objects scanned */
-       unsigned long kswapd_steal;     /* pages reclaimed by kswapd */
-       unsigned long kswapd_inodesteal;/* reclaimed via kswapd inode freeing */
-       unsigned long pageoutrun;       /* kswapd's calls to page reclaim */
-       unsigned long allocstall;       /* direct reclaim calls */
-
-       unsigned long pgrotated;        /* pages rotated to tail of the LRU */
-       unsigned long nr_bounce;        /* pages for bounce buffers */
-};
-
-extern void get_page_state(struct page_state *ret);
-extern void get_page_state_node(struct page_state *ret, int node);
-extern void get_full_page_state(struct page_state *ret);
-extern unsigned long read_page_state_offset(unsigned long offset);
-extern void mod_page_state_offset(unsigned long offset, unsigned long delta);
-extern void __mod_page_state_offset(unsigned long offset, unsigned long delta);
-
-#define read_page_state(member) \
-       read_page_state_offset(offsetof(struct page_state, member))
-
-#define mod_page_state(member, delta)  \
-       mod_page_state_offset(offsetof(struct page_state, member), (delta))
-
-#define __mod_page_state(member, delta)        \
-       __mod_page_state_offset(offsetof(struct page_state, member), (delta))
-
-#define inc_page_state(member)         mod_page_state(member, 1UL)
-#define dec_page_state(member)         mod_page_state(member, 0UL - 1)
-#define add_page_state(member,delta)   mod_page_state(member, (delta))
-#define sub_page_state(member,delta)   mod_page_state(member, 0UL - (delta))
-
-#define __inc_page_state(member)       __mod_page_state(member, 1UL)
-#define __dec_page_state(member)       __mod_page_state(member, 0UL - 1)
-#define __add_page_state(member,delta) __mod_page_state(member, (delta))
-#define __sub_page_state(member,delta) __mod_page_state(member, 0UL - (delta))
-
-#define page_state(member) (*__page_state(offsetof(struct page_state, member)))
-
-#define state_zone_offset(zone, member)                                        \
-({                                                                     \
-       unsigned offset;                                                \
-       if (is_highmem(zone))                                           \
-               offset = offsetof(struct page_state, member##_high);    \
-       else if (is_normal(zone))                                       \
-               offset = offsetof(struct page_state, member##_normal);  \
-       else if (is_dma32(zone))                                        \
-               offset = offsetof(struct page_state, member##_dma32);   \
-       else                                                            \
-               offset = offsetof(struct page_state, member##_dma);     \
-       offset;                                                         \
-})
-
-#define __mod_page_state_zone(zone, member, delta)                     \
- do {                                                                  \
-       __mod_page_state_offset(state_zone_offset(zone, member), (delta)); \
- } while (0)
-
-#define mod_page_state_zone(zone, member, delta)                       \
- do {                                                                  \
-       mod_page_state_offset(state_zone_offset(zone, member), (delta)); \
- } while (0)
-
 /*
  * Manipulation of page state flags
  */
@@ -254,7 +122,14 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta);
 #define TestClearPageReferenced(page) test_and_clear_bit(PG_referenced, &(page)->flags)
 
 #define PageUptodate(page)     test_bit(PG_uptodate, &(page)->flags)
-#ifndef SetPageUptodate
+#ifdef CONFIG_S390
+#define SetPageUptodate(_page) \
+       do {                                                                  \
+               struct page *__page = (_page);                                \
+               if (!test_and_set_bit(PG_uptodate, &__page->flags))           \
+                       page_test_and_clear_dirty(_page);                     \
+       } while (0)
+#else
 #define SetPageUptodate(page)  set_bit(PG_uptodate, &(page)->flags)
 #endif
 #define ClearPageUptodate(page)        clear_bit(PG_uptodate, &(page)->flags)
@@ -306,7 +181,7 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta);
        do {                                                            \
                if (!test_and_set_bit(PG_writeback,                     \
                                &(page)->flags))                        \
-                       inc_page_state(nr_writeback);                   \
+                       inc_zone_page_state(page, NR_WRITEBACK);        \
        } while (0)
 #define TestSetPageWriteback(page)                                     \
        ({                                                              \
@@ -314,14 +189,14 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta);
                ret = test_and_set_bit(PG_writeback,                    \
                                        &(page)->flags);                \
                if (!ret)                                               \
-                       inc_page_state(nr_writeback);                   \
+                       inc_zone_page_state(page, NR_WRITEBACK);        \
                ret;                                                    \
        })
 #define ClearPageWriteback(page)                                       \
        do {                                                            \
                if (test_and_clear_bit(PG_writeback,                    \
                                &(page)->flags))                        \
-                       dec_page_state(nr_writeback);                   \
+                       dec_zone_page_state(page, NR_WRITEBACK);        \
        } while (0)
 #define TestClearPageWriteback(page)                                   \
        ({                                                              \
@@ -329,7 +204,7 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta);
                ret = test_and_clear_bit(PG_writeback,                  \
                                &(page)->flags);                        \
                if (ret)                                                \
-                       dec_page_state(nr_writeback);                   \
+                       dec_zone_page_state(page, NR_WRITEBACK);        \
                ret;                                                    \
        })
 
index 1245df7141aa6c6c1a973ac429ef417fa70488e9..0a2f5d27f60e71b8630d5bd71e9f2821e6251b33 100644 (file)
@@ -113,51 +113,6 @@ int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
 extern void remove_from_page_cache(struct page *page);
 extern void __remove_from_page_cache(struct page *page);
 
-extern atomic_t nr_pagecache;
-
-#ifdef CONFIG_SMP
-
-#define PAGECACHE_ACCT_THRESHOLD        max(16, NR_CPUS * 2)
-DECLARE_PER_CPU(long, nr_pagecache_local);
-
-/*
- * pagecache_acct implements approximate accounting for pagecache.
- * vm_enough_memory() do not need high accuracy. Writers will keep
- * an offset in their per-cpu arena and will spill that into the
- * global count whenever the absolute value of the local count
- * exceeds the counter's threshold.
- *
- * MUST be protected from preemption.
- * current protection is mapping->page_lock.
- */
-static inline void pagecache_acct(int count)
-{
-       long *local;
-
-       local = &__get_cpu_var(nr_pagecache_local);
-       *local += count;
-       if (*local > PAGECACHE_ACCT_THRESHOLD || *local < -PAGECACHE_ACCT_THRESHOLD) {
-               atomic_add(*local, &nr_pagecache);
-               *local = 0;
-       }
-}
-
-#else
-
-static inline void pagecache_acct(int count)
-{
-       atomic_add(count, &nr_pagecache);
-}
-#endif
-
-static inline unsigned long get_page_cache_size(void)
-{
-       int ret = atomic_read(&nr_pagecache);
-       if (unlikely(ret < 0))
-               ret = 0;
-       return ret;
-}
-
 /*
  * Return byte-offset into filesystem object for page.
  */
index 9ae6b1a753668e74155316473c7b5adcbe5da209..685081c01342771c63d9966e1cd317cf6d3a59f7 100644 (file)
 #define PCI_DEVICE_ID_TI_TVP4020       0x3d07
 #define PCI_DEVICE_ID_TI_4450          0x8011
 #define PCI_DEVICE_ID_TI_XX21_XX11     0x8031
+#define PCI_DEVICE_ID_TI_XX21_XX11_SD  0x8034
 #define PCI_DEVICE_ID_TI_X515          0x8036
+#define PCI_DEVICE_ID_TI_XX12          0x8039
 #define PCI_DEVICE_ID_TI_1130          0xac12
 #define PCI_DEVICE_ID_TI_1031          0xac13
 #define PCI_DEVICE_ID_TI_1131          0xac15
 #define PCI_DEVICE_ID_RICOH_RL5C475    0x0475
 #define PCI_DEVICE_ID_RICOH_RL5C476    0x0476
 #define PCI_DEVICE_ID_RICOH_RL5C478    0x0478
+#define PCI_DEVICE_ID_RICOH_R5C822     0x0822
 
 #define PCI_VENDOR_ID_DLINK            0x1186
 #define PCI_DEVICE_ID_DLINK_DGE510T    0x4c00
index a5347c02432e99eaa5b57ae5edeafa96c18152ee..3e628f990fdfd020d23d9e46163a8ea4f094ea78 100644 (file)
 
 /********** drivers/atm/ **********/
 #define ATM_POISON_FREE                0x12
+#define ATM_POISON             0xdeadbeef
+
+/********** net/ **********/
+#define NEIGHBOR_DEAD          0xdeadbeef
+#define NETFILTER_LINK_POISON  0xdead57ac
 
 /********** kernel/mutexes **********/
 #define MUTEX_DEBUG_INIT       0x11
diff --git a/include/linux/raid/Kbuild b/include/linux/raid/Kbuild
new file mode 100644 (file)
index 0000000..73fa27a
--- /dev/null
@@ -0,0 +1 @@
+header-y += md_p.h md_u.h
index 48dfe00070c70bbcd27574870b19288f7655364c..b4ca73d65891ba8b60ba24d1fe2e0adca745911a 100644 (file)
@@ -163,14 +163,22 @@ extern int rcu_needs_cpu(int cpu);
  *
  * It is illegal to block while in an RCU read-side critical section.
  */
-#define rcu_read_lock()                preempt_disable()
+#define rcu_read_lock() \
+       do { \
+               preempt_disable(); \
+               __acquire(RCU); \
+       } while(0)
 
 /**
  * rcu_read_unlock - marks the end of an RCU read-side critical section.
  *
  * See rcu_read_lock() for more information.
  */
-#define rcu_read_unlock()      preempt_enable()
+#define rcu_read_unlock() \
+       do { \
+               __release(RCU); \
+               preempt_enable(); \
+       } while(0)
 
 /*
  * So where is rcu_write_lock()?  It does not exist, as there is no
@@ -193,14 +201,22 @@ extern int rcu_needs_cpu(int cpu);
  * can use just rcu_read_lock().
  *
  */
-#define rcu_read_lock_bh()     local_bh_disable()
+#define rcu_read_lock_bh() \
+       do { \
+               local_bh_disable(); \
+               __acquire(RCU_BH); \
+       } while(0)
 
 /*
  * rcu_read_unlock_bh - marks the end of a softirq-only RCU critical section
  *
  * See rcu_read_lock_bh() for more information.
  */
-#define rcu_read_unlock_bh()   local_bh_enable()
+#define rcu_read_unlock_bh() \
+       do { \
+               __release(RCU_BH); \
+               local_bh_enable(); \
+       } while(0)
 
 /**
  * rcu_dereference - fetch an RCU-protected pointer in an
index 36e2bf4b43151317fe21141e1ea360fbda8ca83a..5371e4e745958f37e67cba09db7eaa9e49a2ada0 100644 (file)
@@ -34,8 +34,8 @@ struct rtc_time {
  * alarm API.
  */
 struct rtc_wkalrm {
-       unsigned char enabled;  /* 0 = alarm disable, 1 = alarm disabled */
-       unsigned char pending;  /* 0 = alarm pending, 1 = alarm not pending */
+       unsigned char enabled;  /* 0 = alarm disabled, 1 = alarm enabled */
+       unsigned char pending;  /* 0 = alarm not pending, 1 = alarm pending */
        struct rtc_time time;   /* time the alarm is set to */
 };
 
index fa4a3b82ba704a9bc22144eeacdc22d345a60b6f..5d41dee82f80310d333aa2ee5ba67a07bbc54d63 100644 (file)
@@ -29,8 +29,6 @@ struct rt_mutex {
        struct task_struct      *owner;
 #ifdef CONFIG_DEBUG_RT_MUTEXES
        int                     save_state;
-       struct list_head        held_list_entry;
-       unsigned long           acquire_ip;
        const char              *name, *file;
        int                     line;
        void                    *magic;
@@ -98,14 +96,6 @@ extern int rt_mutex_trylock(struct rt_mutex *lock);
 
 extern void rt_mutex_unlock(struct rt_mutex *lock);
 
-#ifdef CONFIG_DEBUG_RT_MUTEXES
-# define INIT_RT_MUTEX_DEBUG(tsk)                                      \
-       .held_list_head = LIST_HEAD_INIT(tsk.held_list_head),           \
-       .held_list_lock = SPIN_LOCK_UNLOCKED
-#else
-# define INIT_RT_MUTEX_DEBUG(tsk)
-#endif
-
 #ifdef CONFIG_RT_MUTEXES
 # define INIT_RT_MUTEXES(tsk)                                          \
        .pi_waiters     = PLIST_HEAD_INIT(tsk.pi_waiters, tsk.pi_lock), \
index f30f805080ae4a883c352a97183871f6a31c1ff2..ae1fcadd598e222aa8f572e768aa5a331ca986a7 100644 (file)
@@ -32,30 +32,37 @@ struct rw_semaphore {
        __s32                   activity;
        spinlock_t              wait_lock;
        struct list_head        wait_list;
-#if RWSEM_DEBUG
-       int                     debug;
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+       struct lockdep_map dep_map;
 #endif
 };
 
-/*
- * initialisation
- */
-#if RWSEM_DEBUG
-#define __RWSEM_DEBUG_INIT      , 0
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+# define __RWSEM_DEP_MAP_INIT(lockname) , .dep_map = { .name = #lockname }
 #else
-#define __RWSEM_DEBUG_INIT     /* */
+# define __RWSEM_DEP_MAP_INIT(lockname)
 #endif
 
 #define __RWSEM_INITIALIZER(name) \
-{ 0, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) __RWSEM_DEBUG_INIT }
+{ 0, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) __RWSEM_DEP_MAP_INIT(name) }
 
 #define DECLARE_RWSEM(name) \
        struct rw_semaphore name = __RWSEM_INITIALIZER(name)
 
-extern void FASTCALL(init_rwsem(struct rw_semaphore *sem));
+extern void __init_rwsem(struct rw_semaphore *sem, const char *name,
+                        struct lock_class_key *key);
+
+#define init_rwsem(sem)                                                \
+do {                                                           \
+       static struct lock_class_key __key;                     \
+                                                               \
+       __init_rwsem((sem), #sem, &__key);                      \
+} while (0)
+
 extern void FASTCALL(__down_read(struct rw_semaphore *sem));
 extern int FASTCALL(__down_read_trylock(struct rw_semaphore *sem));
 extern void FASTCALL(__down_write(struct rw_semaphore *sem));
+extern void FASTCALL(__down_write_nested(struct rw_semaphore *sem, int subclass));
 extern int FASTCALL(__down_write_trylock(struct rw_semaphore *sem));
 extern void FASTCALL(__up_read(struct rw_semaphore *sem));
 extern void FASTCALL(__up_write(struct rw_semaphore *sem));
index f99fe90732abfe7cc0bdbc0e103fd0b717950bd4..658afb37c3f51456766ffb10e02a336462189ec2 100644 (file)
@@ -9,8 +9,6 @@
 
 #include <linux/linkage.h>
 
-#define RWSEM_DEBUG 0
-
 #ifdef __KERNEL__
 
 #include <linux/types.h>
@@ -26,89 +24,58 @@ struct rw_semaphore;
 #include <asm/rwsem.h> /* use an arch-specific implementation */
 #endif
 
-#ifndef rwsemtrace
-#if RWSEM_DEBUG
-extern void FASTCALL(rwsemtrace(struct rw_semaphore *sem, const char *str));
-#else
-#define rwsemtrace(SEM,FMT)
-#endif
-#endif
-
 /*
  * lock for reading
  */
-static inline void down_read(struct rw_semaphore *sem)
-{
-       might_sleep();
-       rwsemtrace(sem,"Entering down_read");
-       __down_read(sem);
-       rwsemtrace(sem,"Leaving down_read");
-}
+extern void down_read(struct rw_semaphore *sem);
 
 /*
  * trylock for reading -- returns 1 if successful, 0 if contention
  */
-static inline int down_read_trylock(struct rw_semaphore *sem)
-{
-       int ret;
-       rwsemtrace(sem,"Entering down_read_trylock");
-       ret = __down_read_trylock(sem);
-       rwsemtrace(sem,"Leaving down_read_trylock");
-       return ret;
-}
+extern int down_read_trylock(struct rw_semaphore *sem);
 
 /*
  * lock for writing
  */
-static inline void down_write(struct rw_semaphore *sem)
-{
-       might_sleep();
-       rwsemtrace(sem,"Entering down_write");
-       __down_write(sem);
-       rwsemtrace(sem,"Leaving down_write");
-}
+extern void down_write(struct rw_semaphore *sem);
 
 /*
  * trylock for writing -- returns 1 if successful, 0 if contention
  */
-static inline int down_write_trylock(struct rw_semaphore *sem)
-{
-       int ret;
-       rwsemtrace(sem,"Entering down_write_trylock");
-       ret = __down_write_trylock(sem);
-       rwsemtrace(sem,"Leaving down_write_trylock");
-       return ret;
-}
+extern int down_write_trylock(struct rw_semaphore *sem);
 
 /*
  * release a read lock
  */
-static inline void up_read(struct rw_semaphore *sem)
-{
-       rwsemtrace(sem,"Entering up_read");
-       __up_read(sem);
-       rwsemtrace(sem,"Leaving up_read");
-}
+extern void up_read(struct rw_semaphore *sem);
 
 /*
  * release a write lock
  */
-static inline void up_write(struct rw_semaphore *sem)
-{
-       rwsemtrace(sem,"Entering up_write");
-       __up_write(sem);
-       rwsemtrace(sem,"Leaving up_write");
-}
+extern void up_write(struct rw_semaphore *sem);
 
 /*
  * downgrade write lock to read lock
  */
-static inline void downgrade_write(struct rw_semaphore *sem)
-{
-       rwsemtrace(sem,"Entering downgrade_write");
-       __downgrade_write(sem);
-       rwsemtrace(sem,"Leaving downgrade_write");
-}
+extern void downgrade_write(struct rw_semaphore *sem);
+
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+/*
+ * nested locking:
+ */
+extern void down_read_nested(struct rw_semaphore *sem, int subclass);
+extern void down_write_nested(struct rw_semaphore *sem, int subclass);
+/*
+ * Take/release a lock when not the owner will release it:
+ */
+extern void down_read_non_owner(struct rw_semaphore *sem);
+extern void up_read_non_owner(struct rw_semaphore *sem);
+#else
+# define down_read_nested(sem, subclass)               down_read(sem)
+# define down_write_nested(sem, subclass)      down_write(sem)
+# define down_read_non_owner(sem)              down_read(sem)
+# define up_read_non_owner(sem)                        up_read(sem)
+#endif
 
 #endif /* __KERNEL__ */
 #endif /* _LINUX_RWSEM_H */
index 821f0481ebe190c0b5e171a4e6ab887802b3015c..1c876e27ff936dfe375694bc3cb6b812f1ef33a2 100644 (file)
@@ -184,11 +184,11 @@ extern unsigned long weighted_cpuload(const int cpu);
 extern rwlock_t tasklist_lock;
 extern spinlock_t mmlist_lock;
 
-typedef struct task_struct task_t;
+struct task_struct;
 
 extern void sched_init(void);
 extern void sched_init_smp(void);
-extern void init_idle(task_t *idle, int cpu);
+extern void init_idle(struct task_struct *idle, int cpu);
 
 extern cpumask_t nohz_cpu_mask;
 
@@ -383,7 +383,7 @@ struct signal_struct {
        wait_queue_head_t       wait_chldexit;  /* for wait4() */
 
        /* current thread group signal load-balancing target: */
-       task_t                  *curr_target;
+       struct task_struct      *curr_target;
 
        /* shared signal handling: */
        struct sigpending       shared_pending;
@@ -534,7 +534,6 @@ extern struct user_struct *find_user(uid_t);
 extern struct user_struct root_user;
 #define INIT_USER (&root_user)
 
-typedef struct prio_array prio_array_t;
 struct backing_dev_info;
 struct reclaim_state;
 
@@ -699,7 +698,7 @@ extern int groups_search(struct group_info *group_info, gid_t grp);
     ((gi)->blocks[(i)/NGROUPS_PER_BLOCK][(i)%NGROUPS_PER_BLOCK])
 
 #ifdef ARCH_HAS_PREFETCH_SWITCH_STACK
-extern void prefetch_stack(struct task_struct*);
+extern void prefetch_stack(struct task_struct *t);
 #else
 static inline void prefetch_stack(struct task_struct *t) { }
 #endif
@@ -715,6 +714,8 @@ enum sleep_type {
        SLEEP_INTERRUPTED,
 };
 
+struct prio_array;
+
 struct task_struct {
        volatile long state;    /* -1 unrunnable, 0 runnable, >0 stopped */
        struct thread_info *thread_info;
@@ -732,7 +733,7 @@ struct task_struct {
        int load_weight;        /* for niceness load balancing purposes */
        int prio, static_prio, normal_prio;
        struct list_head run_list;
-       prio_array_t *array;
+       struct prio_array *array;
 
        unsigned short ioprio;
        unsigned int btrace_seq;
@@ -865,16 +866,34 @@ struct task_struct {
        struct plist_head pi_waiters;
        /* Deadlock detection and priority inheritance handling */
        struct rt_mutex_waiter *pi_blocked_on;
-# ifdef CONFIG_DEBUG_RT_MUTEXES
-       spinlock_t held_list_lock;
-       struct list_head held_list_head;
-# endif
 #endif
 
 #ifdef CONFIG_DEBUG_MUTEXES
        /* mutex deadlock detection */
        struct mutex_waiter *blocked_on;
 #endif
+#ifdef CONFIG_TRACE_IRQFLAGS
+       unsigned int irq_events;
+       int hardirqs_enabled;
+       unsigned long hardirq_enable_ip;
+       unsigned int hardirq_enable_event;
+       unsigned long hardirq_disable_ip;
+       unsigned int hardirq_disable_event;
+       int softirqs_enabled;
+       unsigned long softirq_disable_ip;
+       unsigned int softirq_disable_event;
+       unsigned long softirq_enable_ip;
+       unsigned int softirq_enable_event;
+       int hardirq_context;
+       int softirq_context;
+#endif
+#ifdef CONFIG_LOCKDEP
+# define MAX_LOCK_DEPTH 30UL
+       u64 curr_chain_key;
+       int lockdep_depth;
+       struct held_lock held_locks[MAX_LOCK_DEPTH];
+       unsigned int lockdep_recursion;
+#endif
 
 /* journalling filesystem info */
        void *journal_info;
@@ -1013,9 +1032,9 @@ static inline void put_task_struct(struct task_struct *t)
 #define used_math() tsk_used_math(current)
 
 #ifdef CONFIG_SMP
-extern int set_cpus_allowed(task_t *p, cpumask_t new_mask);
+extern int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask);
 #else
-static inline int set_cpus_allowed(task_t *p, cpumask_t new_mask)
+static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
 {
        if (!cpu_isset(0, new_mask))
                return -EINVAL;
@@ -1024,7 +1043,8 @@ static inline int set_cpus_allowed(task_t *p, cpumask_t new_mask)
 #endif
 
 extern unsigned long long sched_clock(void);
-extern unsigned long long current_sched_time(const task_t *current_task);
+extern unsigned long long
+current_sched_time(const struct task_struct *current_task);
 
 /* sched_exec is called by processes performing an exec */
 #ifdef CONFIG_SMP
@@ -1042,27 +1062,27 @@ static inline void idle_task_exit(void) {}
 extern void sched_idle_next(void);
 
 #ifdef CONFIG_RT_MUTEXES
-extern int rt_mutex_getprio(task_t *p);
-extern void rt_mutex_setprio(task_t *p, int prio);
-extern void rt_mutex_adjust_pi(task_t *p);
+extern int rt_mutex_getprio(struct task_struct *p);
+extern void rt_mutex_setprio(struct task_struct *p, int prio);
+extern void rt_mutex_adjust_pi(struct task_struct *p);
 #else
-static inline int rt_mutex_getprio(task_t *p)
+static inline int rt_mutex_getprio(struct task_struct *p)
 {
        return p->normal_prio;
 }
 # define rt_mutex_adjust_pi(p)         do { } while (0)
 #endif
 
-extern void set_user_nice(task_t *p, long nice);
-extern int task_prio(const task_t *p);
-extern int task_nice(const task_t *p);
-extern int can_nice(const task_t *p, const int nice);
-extern int task_curr(const task_t *p);
+extern void set_user_nice(struct task_struct *p, long nice);
+extern int task_prio(const struct task_struct *p);
+extern int task_nice(const struct task_struct *p);
+extern int can_nice(const struct task_struct *p, const int nice);
+extern int task_curr(const struct task_struct *p);
 extern int idle_cpu(int cpu);
 extern int sched_setscheduler(struct task_struct *, int, struct sched_param *);
-extern task_t *idle_task(int cpu);
-extern task_t *curr_task(int cpu);
-extern void set_curr_task(int cpu, task_t *p);
+extern struct task_struct *idle_task(int cpu);
+extern struct task_struct *curr_task(int cpu);
+extern void set_curr_task(int cpu, struct task_struct *p);
 
 void yield(void);
 
@@ -1119,8 +1139,8 @@ extern void FASTCALL(wake_up_new_task(struct task_struct * tsk,
 #else
  static inline void kick_process(struct task_struct *tsk) { }
 #endif
-extern void FASTCALL(sched_fork(task_t * p, int clone_flags));
-extern void FASTCALL(sched_exit(task_t * p));
+extern void FASTCALL(sched_fork(struct task_struct * p, int clone_flags));
+extern void FASTCALL(sched_exit(struct task_struct * p));
 
 extern int in_group_p(gid_t);
 extern int in_egroup_p(gid_t);
@@ -1153,7 +1173,7 @@ extern int force_sig_info(int, struct siginfo *, struct task_struct *);
 extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp);
 extern int kill_pg_info(int, struct siginfo *, pid_t);
 extern int kill_proc_info(int, struct siginfo *, pid_t);
-extern int kill_proc_info_as_uid(int, struct siginfo *, pid_t, uid_t, uid_t);
+extern int kill_proc_info_as_uid(int, struct siginfo *, pid_t, uid_t, uid_t, u32);
 extern void do_notify_parent(struct task_struct *, int);
 extern void force_sig(int, struct task_struct *);
 extern void force_sig_specific(int, struct task_struct *);
@@ -1225,17 +1245,17 @@ extern NORET_TYPE void do_group_exit(int);
 extern void daemonize(const char *, ...);
 extern int allow_signal(int);
 extern int disallow_signal(int);
-extern task_t *child_reaper;
+extern struct task_struct *child_reaper;
 
 extern int do_execve(char *, char __user * __user *, char __user * __user *, struct pt_regs *);
 extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *);
-task_t *fork_idle(int);
+struct task_struct *fork_idle(int);
 
 extern void set_task_comm(struct task_struct *tsk, char *from);
 extern void get_task_comm(char *to, struct task_struct *tsk);
 
 #ifdef CONFIG_SMP
-extern void wait_task_inactive(task_t * p);
+extern void wait_task_inactive(struct task_struct * p);
 #else
 #define wait_task_inactive(p)  do { } while (0)
 #endif
@@ -1261,13 +1281,13 @@ extern void wait_task_inactive(task_t * p);
 /* de_thread depends on thread_group_leader not being a pid based check */
 #define thread_group_leader(p) (p == p->group_leader)
 
-static inline task_t *next_thread(const task_t *p)
+static inline struct task_struct *next_thread(const struct task_struct *p)
 {
        return list_entry(rcu_dereference(p->thread_group.next),
-                               task_t, thread_group);
+                         struct task_struct, thread_group);
 }
 
-static inline int thread_group_empty(task_t *p)
+static inline int thread_group_empty(struct task_struct *p)
 {
        return list_empty(&p->thread_group);
 }
index c7ea15716dce5cdcc5c293c120471a99248fa669..f75303831d09b1c8645530c9c2f90c27385afe91 100644 (file)
@@ -567,6 +567,9 @@ struct swap_info_struct;
  *     @p.
  *     @p contains the task_struct for the process.
  *     Return 0 if permission is granted.
+ * @task_getsecid:
+ *     Retrieve the security identifier of the process @p.
+ *     @p contains the task_struct for the process and place is into @secid.
  * @task_setgroups:
  *     Check permission before setting the supplementary group set of the
  *     current process.
@@ -582,6 +585,10 @@ struct swap_info_struct;
  *     @p contains the task_struct of process.
  *     @ioprio contains the new ioprio value
  *     Return 0 if permission is granted.
+ * @task_getioprio
+ *     Check permission before getting the ioprio value of @p.
+ *     @p contains the task_struct of process.
+ *     Return 0 if permission is granted.
  * @task_setrlimit:
  *     Check permission before setting the resource limits of the current
  *     process for @resource to @new_rlim.  The old resource limit values can
@@ -615,6 +622,7 @@ struct swap_info_struct;
  *     @p contains the task_struct for process.
  *     @info contains the signal information.
  *     @sig contains the signal value.
+ *     @secid contains the sid of the process where the signal originated
  *     Return 0 if permission is granted.
  * @task_wait:
  *     Check permission before allowing a process to reap a child process @p
@@ -1219,16 +1227,18 @@ struct security_operations {
        int (*task_setpgid) (struct task_struct * p, pid_t pgid);
        int (*task_getpgid) (struct task_struct * p);
        int (*task_getsid) (struct task_struct * p);
+       void (*task_getsecid) (struct task_struct * p, u32 * secid);
        int (*task_setgroups) (struct group_info *group_info);
        int (*task_setnice) (struct task_struct * p, int nice);
        int (*task_setioprio) (struct task_struct * p, int ioprio);
+       int (*task_getioprio) (struct task_struct * p);
        int (*task_setrlimit) (unsigned int resource, struct rlimit * new_rlim);
        int (*task_setscheduler) (struct task_struct * p, int policy,
                                  struct sched_param * lp);
        int (*task_getscheduler) (struct task_struct * p);
        int (*task_movememory) (struct task_struct * p);
        int (*task_kill) (struct task_struct * p,
-                         struct siginfo * info, int sig);
+                         struct siginfo * info, int sig, u32 secid);
        int (*task_wait) (struct task_struct * p);
        int (*task_prctl) (int option, unsigned long arg2,
                           unsigned long arg3, unsigned long arg4,
@@ -1839,6 +1849,11 @@ static inline int security_task_getsid (struct task_struct *p)
        return security_ops->task_getsid (p);
 }
 
+static inline void security_task_getsecid (struct task_struct *p, u32 *secid)
+{
+       security_ops->task_getsecid (p, secid);
+}
+
 static inline int security_task_setgroups (struct group_info *group_info)
 {
        return security_ops->task_setgroups (group_info);
@@ -1854,6 +1869,11 @@ static inline int security_task_setioprio (struct task_struct *p, int ioprio)
        return security_ops->task_setioprio (p, ioprio);
 }
 
+static inline int security_task_getioprio (struct task_struct *p)
+{
+       return security_ops->task_getioprio (p);
+}
+
 static inline int security_task_setrlimit (unsigned int resource,
                                           struct rlimit *new_rlim)
 {
@@ -1878,9 +1898,10 @@ static inline int security_task_movememory (struct task_struct *p)
 }
 
 static inline int security_task_kill (struct task_struct *p,
-                                     struct siginfo *info, int sig)
+                                     struct siginfo *info, int sig,
+                                     u32 secid)
 {
-       return security_ops->task_kill (p, info, sig);
+       return security_ops->task_kill (p, info, sig, secid);
 }
 
 static inline int security_task_wait (struct task_struct *p)
@@ -2491,6 +2512,9 @@ static inline int security_task_getsid (struct task_struct *p)
        return 0;
 }
 
+static inline void security_task_getsecid (struct task_struct *p, u32 *secid)
+{ }
+
 static inline int security_task_setgroups (struct group_info *group_info)
 {
        return 0;
@@ -2506,6 +2530,11 @@ static inline int security_task_setioprio (struct task_struct *p, int ioprio)
        return 0;
 }
 
+static inline int security_task_getioprio (struct task_struct *p)
+{
+       return 0;
+}
+
 static inline int security_task_setrlimit (unsigned int resource,
                                           struct rlimit *new_rlim)
 {
@@ -2530,7 +2559,8 @@ static inline int security_task_movememory (struct task_struct *p)
 }
 
 static inline int security_task_kill (struct task_struct *p,
-                                     struct siginfo *info, int sig)
+                                     struct siginfo *info, int sig,
+                                     u32 secid)
 {
        return 0;
 }
index 7bc5c7c12b541fc2b282180b8b4d458ba9ec8618..46000936f8f1d5f39e92aa1e260518475b567e1a 100644 (file)
@@ -38,9 +38,17 @@ typedef struct {
  * These macros triggered gcc-3.x compile-time problems.  We think these are
  * OK now.  Be cautious.
  */
-#define SEQLOCK_UNLOCKED { 0, SPIN_LOCK_UNLOCKED }
-#define seqlock_init(x)        do { *(x) = (seqlock_t) SEQLOCK_UNLOCKED; } while (0)
+#define __SEQLOCK_UNLOCKED(lockname) \
+                { 0, __SPIN_LOCK_UNLOCKED(lockname) }
 
+#define SEQLOCK_UNLOCKED \
+                __SEQLOCK_UNLOCKED(old_style_seqlock_init)
+
+#define seqlock_init(x) \
+               do { *(x) = (seqlock_t) __SEQLOCK_UNLOCKED(x); } while (0)
+
+#define DEFINE_SEQLOCK(x) \
+               seqlock_t x = __SEQLOCK_UNLOCKED(x)
 
 /* Lock out other writers and update the count.
  * Acts like a normal spin_lock/unlock.
index fc1104a2cfa9c52841fe84ce7d3b68975df24c8b..058cba70818a57654dc1fc0534fce9ecf0877a9b 100644 (file)
@@ -216,10 +216,11 @@ struct uart_port {
        unsigned char __iomem   *membase;               /* read/write[bwl] */
        unsigned int            irq;                    /* irq number */
        unsigned int            uartclk;                /* base uart clock */
-       unsigned char           fifosize;               /* tx fifo size */
+       unsigned int            fifosize;               /* tx fifo size */
        unsigned char           x_char;                 /* xon/xoff char */
        unsigned char           regshift;               /* reg offset shift */
        unsigned char           iotype;                 /* io access style */
+       unsigned char           unused1;
 
 #define UPIO_PORT              (0)
 #define UPIO_HUB6              (1)
index 1e4ce7225eeef979c26cfc8a8cde48eba797dad2..117135e33d67116e4cf303b2f3872d2c6e63a1b8 100644 (file)
@@ -8,32 +8,6 @@
 #include <linux/list.h>
 #include <linux/spinlock.h>
 
-/*
- * These values of sa_flags are used only by the kernel as part of the
- * irq handling routines.
- *
- * SA_INTERRUPT is also used by the irq handling routines.
- * SA_SHIRQ is for shared interrupt support on PCI and EISA.
- * SA_PROBEIRQ is set by callers when they expect sharing mismatches to occur
- */
-#define SA_SAMPLE_RANDOM       SA_RESTART
-#define SA_SHIRQ               0x04000000
-#define SA_PROBEIRQ            0x08000000
-
-/*
- * As above, these correspond to the IORESOURCE_IRQ_* defines in
- * linux/ioport.h to select the interrupt line behaviour.  When
- * requesting an interrupt without specifying a SA_TRIGGER, the
- * setting should be assumed to be "as already configured", which
- * may be as per machine or firmware initialisation.
- */
-#define SA_TRIGGER_LOW         0x00000008
-#define SA_TRIGGER_HIGH                0x00000004
-#define SA_TRIGGER_FALLING     0x00000002
-#define SA_TRIGGER_RISING      0x00000001
-#define SA_TRIGGER_MASK        (SA_TRIGGER_HIGH|SA_TRIGGER_LOW|\
-                                SA_TRIGGER_RISING|SA_TRIGGER_FALLING)
-
 /*
  * Real Time signals may be queued.
  */
index 59918be91d0a95c203e43356ae95371861e97132..3597b4f14389b2dbb4fef37552367266fad5d016 100644 (file)
@@ -171,13 +171,15 @@ enum {
 
 enum {
        SKB_GSO_TCPV4 = 1 << 0,
-       SKB_GSO_UDPV4 = 1 << 1,
+       SKB_GSO_UDP = 1 << 1,
 
        /* This indicates the skb is from an untrusted source. */
        SKB_GSO_DODGY = 1 << 2,
 
        /* This indicates the tcp segment has CWR set. */
-       SKB_GSO_TCPV4_ECN = 1 << 3,
+       SKB_GSO_TCP_ECN = 1 << 3,
+
+       SKB_GSO_TCPV6 = 1 << 4,
 };
 
 /** 
@@ -602,9 +604,12 @@ static inline __u32 skb_queue_len(const struct sk_buff_head *list_)
        return list_->qlen;
 }
 
+extern struct lock_class_key skb_queue_lock_key;
+
 static inline void skb_queue_head_init(struct sk_buff_head *list)
 {
        spin_lock_init(&list->lock);
+       lockdep_set_class(&list->lock, &skb_queue_lock_key);
        list->prev = list->next = (struct sk_buff *)list;
        list->qlen = 0;
 }
index c93c3fe4308c898cd2a6fa9939305e9b4203bbc5..837e8bce134930405e98192986c3b4fd10ce4151 100644 (file)
@@ -125,4 +125,6 @@ static inline void smp_send_reschedule(int cpu) { }
 #define put_cpu()              preempt_enable()
 #define put_cpu_no_resched()   preempt_enable_no_resched()
 
+void smp_setup_processor_id(void);
+
 #endif /* __LINUX_SMP_H */
index ae23beef9cc98be3917ae54f9ce44f91a527c783..31473db92d3b68f81663687a55ef9521a19ccdc8 100644 (file)
@@ -82,14 +82,40 @@ extern int __lockfunc generic__raw_read_trylock(raw_rwlock_t *lock);
 /*
  * Pull the __raw*() functions/declarations (UP-nondebug doesnt need them):
  */
-#if defined(CONFIG_SMP)
+#ifdef CONFIG_SMP
 # include <asm/spinlock.h>
 #else
 # include <linux/spinlock_up.h>
 #endif
 
-#define spin_lock_init(lock)   do { *(lock) = SPIN_LOCK_UNLOCKED; } while (0)
-#define rwlock_init(lock)      do { *(lock) = RW_LOCK_UNLOCKED; } while (0)
+#ifdef CONFIG_DEBUG_SPINLOCK
+  extern void __spin_lock_init(spinlock_t *lock, const char *name,
+                              struct lock_class_key *key);
+# define spin_lock_init(lock)                                  \
+do {                                                           \
+       static struct lock_class_key __key;                     \
+                                                               \
+       __spin_lock_init((lock), #lock, &__key);                \
+} while (0)
+
+#else
+# define spin_lock_init(lock)                                  \
+       do { *(lock) = SPIN_LOCK_UNLOCKED; } while (0)
+#endif
+
+#ifdef CONFIG_DEBUG_SPINLOCK
+  extern void __rwlock_init(rwlock_t *lock, const char *name,
+                           struct lock_class_key *key);
+# define rwlock_init(lock)                                     \
+do {                                                           \
+       static struct lock_class_key __key;                     \
+                                                               \
+       __rwlock_init((lock), #lock, &__key);                   \
+} while (0)
+#else
+# define rwlock_init(lock)                                     \
+       do { *(lock) = RW_LOCK_UNLOCKED; } while (0)
+#endif
 
 #define spin_is_locked(lock)   __raw_spin_is_locked(&(lock)->raw_lock)
 
@@ -113,7 +139,6 @@ extern int __lockfunc generic__raw_read_trylock(raw_rwlock_t *lock);
 #define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock)
  extern int _raw_spin_trylock(spinlock_t *lock);
  extern void _raw_spin_unlock(spinlock_t *lock);
-
  extern void _raw_read_lock(rwlock_t *lock);
  extern int _raw_read_trylock(rwlock_t *lock);
  extern void _raw_read_unlock(rwlock_t *lock);
@@ -121,17 +146,17 @@ extern int __lockfunc generic__raw_read_trylock(raw_rwlock_t *lock);
  extern int _raw_write_trylock(rwlock_t *lock);
  extern void _raw_write_unlock(rwlock_t *lock);
 #else
-# define _raw_spin_unlock(lock)                __raw_spin_unlock(&(lock)->raw_lock)
-# define _raw_spin_trylock(lock)       __raw_spin_trylock(&(lock)->raw_lock)
 # define _raw_spin_lock(lock)          __raw_spin_lock(&(lock)->raw_lock)
 # define _raw_spin_lock_flags(lock, flags) \
                __raw_spin_lock_flags(&(lock)->raw_lock, *(flags))
+# define _raw_spin_trylock(lock)       __raw_spin_trylock(&(lock)->raw_lock)
+# define _raw_spin_unlock(lock)                __raw_spin_unlock(&(lock)->raw_lock)
 # define _raw_read_lock(rwlock)                __raw_read_lock(&(rwlock)->raw_lock)
-# define _raw_write_lock(rwlock)       __raw_write_lock(&(rwlock)->raw_lock)
-# define _raw_read_unlock(rwlock)      __raw_read_unlock(&(rwlock)->raw_lock)
-# define _raw_write_unlock(rwlock)     __raw_write_unlock(&(rwlock)->raw_lock)
 # define _raw_read_trylock(rwlock)     __raw_read_trylock(&(rwlock)->raw_lock)
+# define _raw_read_unlock(rwlock)      __raw_read_unlock(&(rwlock)->raw_lock)
+# define _raw_write_lock(rwlock)       __raw_write_lock(&(rwlock)->raw_lock)
 # define _raw_write_trylock(rwlock)    __raw_write_trylock(&(rwlock)->raw_lock)
+# define _raw_write_unlock(rwlock)     __raw_write_unlock(&(rwlock)->raw_lock)
 #endif
 
 #define read_can_lock(rwlock)          __raw_read_can_lock(&(rwlock)->raw_lock)
@@ -147,6 +172,13 @@ extern int __lockfunc generic__raw_read_trylock(raw_rwlock_t *lock);
 #define write_trylock(lock)            __cond_lock(_write_trylock(lock))
 
 #define spin_lock(lock)                        _spin_lock(lock)
+
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+# define spin_lock_nested(lock, subclass) _spin_lock_nested(lock, subclass)
+#else
+# define spin_lock_nested(lock, subclass) _spin_lock(lock)
+#endif
+
 #define write_lock(lock)               _write_lock(lock)
 #define read_lock(lock)                        _read_lock(lock)
 
@@ -172,21 +204,18 @@ extern int __lockfunc generic__raw_read_trylock(raw_rwlock_t *lock);
 /*
  * We inline the unlock functions in the nondebug case:
  */
-#if defined(CONFIG_DEBUG_SPINLOCK) || defined(CONFIG_PREEMPT) || !defined(CONFIG_SMP)
+#if defined(CONFIG_DEBUG_SPINLOCK) || defined(CONFIG_PREEMPT) || \
+       !defined(CONFIG_SMP)
 # define spin_unlock(lock)             _spin_unlock(lock)
 # define read_unlock(lock)             _read_unlock(lock)
 # define write_unlock(lock)            _write_unlock(lock)
-#else
-# define spin_unlock(lock)             __raw_spin_unlock(&(lock)->raw_lock)
-# define read_unlock(lock)             __raw_read_unlock(&(lock)->raw_lock)
-# define write_unlock(lock)            __raw_write_unlock(&(lock)->raw_lock)
-#endif
-
-#if defined(CONFIG_DEBUG_SPINLOCK) || defined(CONFIG_PREEMPT) || !defined(CONFIG_SMP)
 # define spin_unlock_irq(lock)         _spin_unlock_irq(lock)
 # define read_unlock_irq(lock)         _read_unlock_irq(lock)
 # define write_unlock_irq(lock)                _write_unlock_irq(lock)
 #else
+# define spin_unlock(lock)             __raw_spin_unlock(&(lock)->raw_lock)
+# define read_unlock(lock)             __raw_read_unlock(&(lock)->raw_lock)
+# define write_unlock(lock)            __raw_write_unlock(&(lock)->raw_lock)
 # define spin_unlock_irq(lock) \
     do { __raw_spin_unlock(&(lock)->raw_lock); local_irq_enable(); } while (0)
 # define read_unlock_irq(lock) \
index 78e6989ffb542e75b54cc9e8dda12c230ab15e36..b2c4f8299464e86558b2721823bd0723da5f1ea3 100644 (file)
@@ -20,6 +20,8 @@ int in_lock_functions(unsigned long addr);
 #define assert_spin_locked(x)  BUG_ON(!spin_is_locked(x))
 
 void __lockfunc _spin_lock(spinlock_t *lock)           __acquires(spinlock_t);
+void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass)
+                                                       __acquires(spinlock_t);
 void __lockfunc _read_lock(rwlock_t *lock)             __acquires(rwlock_t);
 void __lockfunc _write_lock(rwlock_t *lock)            __acquires(rwlock_t);
 void __lockfunc _spin_lock_bh(spinlock_t *lock)                __acquires(spinlock_t);
index cd81cee566f4abc642f3650f13b9f66aa90ccc3e..67faa044c5f5574042e72c28fa18f7f38e1fe51f 100644 (file)
@@ -49,6 +49,7 @@
   do { local_irq_restore(flags); __UNLOCK(lock); } while (0)
 
 #define _spin_lock(lock)                       __LOCK(lock)
+#define _spin_lock_nested(lock, subclass)      __LOCK(lock)
 #define _read_lock(lock)                       __LOCK(lock)
 #define _write_lock(lock)                      __LOCK(lock)
 #define _spin_lock_bh(lock)                    __LOCK_BH(lock)
index 9cb51e0703909ccaaea60108349f11366c6284d5..dc5fb69e4de9333ec84fef3f28c9a5bbbbab649d 100644 (file)
@@ -9,6 +9,8 @@
  * Released under the General Public License (GPL).
  */
 
+#include <linux/lockdep.h>
+
 #if defined(CONFIG_SMP)
 # include <asm/spinlock_types.h>
 #else
@@ -24,6 +26,9 @@ typedef struct {
        unsigned int magic, owner_cpu;
        void *owner;
 #endif
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+       struct lockdep_map dep_map;
+#endif
 } spinlock_t;
 
 #define SPINLOCK_MAGIC         0xdead4ead
@@ -37,31 +42,53 @@ typedef struct {
        unsigned int magic, owner_cpu;
        void *owner;
 #endif
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+       struct lockdep_map dep_map;
+#endif
 } rwlock_t;
 
 #define RWLOCK_MAGIC           0xdeaf1eed
 
 #define SPINLOCK_OWNER_INIT    ((void *)-1L)
 
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+# define SPIN_DEP_MAP_INIT(lockname)   .dep_map = { .name = #lockname }
+#else
+# define SPIN_DEP_MAP_INIT(lockname)
+#endif
+
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+# define RW_DEP_MAP_INIT(lockname)     .dep_map = { .name = #lockname }
+#else
+# define RW_DEP_MAP_INIT(lockname)
+#endif
+
 #ifdef CONFIG_DEBUG_SPINLOCK
-# define SPIN_LOCK_UNLOCKED                                            \
+# define __SPIN_LOCK_UNLOCKED(lockname)                                        \
        (spinlock_t)    {       .raw_lock = __RAW_SPIN_LOCK_UNLOCKED,   \
                                .magic = SPINLOCK_MAGIC,                \
                                .owner = SPINLOCK_OWNER_INIT,           \
-                               .owner_cpu = -1 }
-#define RW_LOCK_UNLOCKED                                               \
+                               .owner_cpu = -1,                        \
+                               SPIN_DEP_MAP_INIT(lockname) }
+#define __RW_LOCK_UNLOCKED(lockname)                                   \
        (rwlock_t)      {       .raw_lock = __RAW_RW_LOCK_UNLOCKED,     \
                                .magic = RWLOCK_MAGIC,                  \
                                .owner = SPINLOCK_OWNER_INIT,           \
-                               .owner_cpu = -1 }
+                               .owner_cpu = -1,                        \
+                               RW_DEP_MAP_INIT(lockname) }
 #else
-# define SPIN_LOCK_UNLOCKED \
-       (spinlock_t)    {       .raw_lock = __RAW_SPIN_LOCK_UNLOCKED }
-#define RW_LOCK_UNLOCKED \
-       (rwlock_t)      {       .raw_lock = __RAW_RW_LOCK_UNLOCKED }
+# define __SPIN_LOCK_UNLOCKED(lockname) \
+       (spinlock_t)    {       .raw_lock = __RAW_SPIN_LOCK_UNLOCKED,   \
+                               SPIN_DEP_MAP_INIT(lockname) }
+#define __RW_LOCK_UNLOCKED(lockname) \
+       (rwlock_t)      {       .raw_lock = __RAW_RW_LOCK_UNLOCKED,     \
+                               RW_DEP_MAP_INIT(lockname) }
 #endif
 
-#define DEFINE_SPINLOCK(x)     spinlock_t x = SPIN_LOCK_UNLOCKED
-#define DEFINE_RWLOCK(x)       rwlock_t x = RW_LOCK_UNLOCKED
+#define SPIN_LOCK_UNLOCKED     __SPIN_LOCK_UNLOCKED(old_style_spin_init)
+#define RW_LOCK_UNLOCKED       __RW_LOCK_UNLOCKED(old_style_rw_init)
+
+#define DEFINE_SPINLOCK(x)     spinlock_t x = __SPIN_LOCK_UNLOCKED(x)
+#define DEFINE_RWLOCK(x)       rwlock_t x = __RW_LOCK_UNLOCKED(x)
 
 #endif /* __LINUX_SPINLOCK_TYPES_H */
index 04135b0e198e31bfca6c3d1bea508d9af638f4b4..27644af20b7c8db11cfee4252c16006c522eaeef 100644 (file)
  * Released under the General Public License (GPL).
  */
 
-#ifdef CONFIG_DEBUG_SPINLOCK
+#if defined(CONFIG_DEBUG_SPINLOCK) || \
+       defined(CONFIG_DEBUG_LOCK_ALLOC)
 
 typedef struct {
        volatile unsigned int slock;
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+       struct lockdep_map dep_map;
+#endif
 } raw_spinlock_t;
 
 #define __RAW_SPIN_LOCK_UNLOCKED { 1 }
@@ -30,6 +34,9 @@ typedef struct { } raw_spinlock_t;
 
 typedef struct {
        /* no debug version on UP */
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+       struct lockdep_map dep_map;
+#endif
 } raw_rwlock_t;
 
 #define __RAW_RW_LOCK_UNLOCKED { }
index 31accf2f0b137645910b230bc7a4028a93115b2d..ea54c4c9a4ecd2c678b6f8d717b0b8bc98d50cfa 100644 (file)
@@ -18,7 +18,6 @@
  */
 
 #ifdef CONFIG_DEBUG_SPINLOCK
-
 #define __raw_spin_is_locked(x)                ((x)->slock == 0)
 
 static inline void __raw_spin_lock(raw_spinlock_t *lock)
diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h
new file mode 100644 (file)
index 0000000..9cc81e5
--- /dev/null
@@ -0,0 +1,20 @@
+#ifndef __LINUX_STACKTRACE_H
+#define __LINUX_STACKTRACE_H
+
+#ifdef CONFIG_STACKTRACE
+struct stack_trace {
+       unsigned int nr_entries, max_entries;
+       unsigned long *entries;
+};
+
+extern void save_stack_trace(struct stack_trace *trace,
+                            struct task_struct *task, int all_contexts,
+                            unsigned int skip);
+
+extern void print_stack_trace(struct stack_trace *trace, int spaces);
+#else
+# define save_stack_trace(trace, task, all, skip)      do { } while (0)
+# define print_stack_trace(trace)                      do { } while (0)
+#endif
+
+#endif
diff --git a/include/linux/sunrpc/Kbuild b/include/linux/sunrpc/Kbuild
new file mode 100644 (file)
index 0000000..0d1d768
--- /dev/null
@@ -0,0 +1 @@
+unifdef-y := debug.h
index 50356438454525d46b951e3fde65058478bf8017..7b27c09b56046e19bef6e499922f628bec5c0a6e 100644 (file)
@@ -159,7 +159,9 @@ struct svc_rqst {
                                                 * determine what device number
                                                 * to report (real or virtual)
                                                 */
-
+       int                     rq_sendfile_ok; /* turned off in gss privacy
+                                                * to prevent encrypting page
+                                                * cache pages */
        wait_queue_head_t       rq_wait;        /* synchronization */
 };
 
index c41e2d6d1acc3dfb4ca036a6a78047e02181d5c0..5e59184c909647306edb1aa1d68bd52ffae4f545 100644 (file)
@@ -189,7 +189,7 @@ extern long vm_total_pages;
 
 #ifdef CONFIG_NUMA
 extern int zone_reclaim_mode;
-extern int zone_reclaim_interval;
+extern int sysctl_min_unmapped_ratio;
 extern int zone_reclaim(struct zone *, gfp_t, unsigned int);
 #else
 #define zone_reclaim_mode 0
index 46e4d8f2771f9fa5812205c01a0fc85778fa9a44..e4b1a4d4dcf36968ca133b0b6fd4730a6e626b92 100644 (file)
@@ -188,7 +188,7 @@ enum
        VM_DROP_PAGECACHE=29,   /* int: nuke lots of pagecache */
        VM_PERCPU_PAGELIST_FRACTION=30,/* int: fraction of pages in each percpu_pagelist */
        VM_ZONE_RECLAIM_MODE=31, /* reclaim local zone memory before going off node */
-       VM_ZONE_RECLAIM_INTERVAL=32, /* time period to wait after reclaim failure */
+       VM_MIN_UNMAPPED=32,     /* Set min percent of unmapped pages */
        VM_PANIC_ON_OOM=33,     /* panic at out-of-memory */
        VM_VDSO_ENABLED=34,     /* map VDSO into new processes? */
 };
diff --git a/include/linux/tc_act/Kbuild b/include/linux/tc_act/Kbuild
new file mode 100644 (file)
index 0000000..5251a50
--- /dev/null
@@ -0,0 +1 @@
+header-y += tc_gact.h tc_ipt.h tc_mirred.h tc_pedit.h
diff --git a/include/linux/tc_ematch/Kbuild b/include/linux/tc_ematch/Kbuild
new file mode 100644 (file)
index 0000000..381e930
--- /dev/null
@@ -0,0 +1 @@
+headers-y := tc_em_cmp.h tc_em_meta.h tc_em_nbyte.h tc_em_text.h
index bdd39be094065fa5a53c26864e9db5feb51e5122..90223f057d507bd86edf2c8e30333319773e8f23 100644 (file)
@@ -46,7 +46,7 @@ struct udp_sock {
        unsigned int     corkflag;      /* Cork is required */
        __u16            encap_type;    /* Is this an Encapsulation socket? */
        /*
-        * Following member retains the infomation to create a UDP header
+        * Following member retains the information to create a UDP header
         * when the socket is uncorked.
         */
        __u16            len;           /* total length of pending frames */
index e39b7cc433902565d9b7aa5d450f5be86a10118b..fc62887c5206628d78279a1480628e6448c154a1 100644 (file)
@@ -993,7 +993,7 @@ extern void ufs_panic (struct super_block *, const char *, const char *, ...) __
 extern struct inode_operations ufs_fast_symlink_inode_operations;
 
 /* truncate.c */
-extern void ufs_truncate (struct inode *);
+extern int ufs_truncate (struct inode *, loff_t);
 
 static inline struct ufs_sb_info *UFS_SB(struct super_block *sb)
 {
index dc7c621e464714b6e6646b9abcf48b6519c1856a..46919f9f5eb35b9d023e9c5a7818bc528b5fa2e5 100644 (file)
@@ -1,4 +1,4 @@
-#include <linux/version.h>
+#include <linux/utsrelease.h>
 #include <linux/module.h>
 
 /* Simply sanity version stamp for modules. */
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
new file mode 100644 (file)
index 0000000..3e0daf5
--- /dev/null
@@ -0,0 +1,215 @@
+#ifndef _LINUX_VMSTAT_H
+#define _LINUX_VMSTAT_H
+
+#include <linux/types.h>
+#include <linux/percpu.h>
+#include <linux/config.h>
+#include <linux/mmzone.h>
+#include <asm/atomic.h>
+
+#ifdef CONFIG_VM_EVENT_COUNTERS
+/*
+ * Light weight per cpu counter implementation.
+ *
+ * Counters should only be incremented and no critical kernel component
+ * should rely on the counter values.
+ *
+ * Counters are handled completely inline. On many platforms the code
+ * generated will simply be the increment of a global address.
+ */
+
+#define FOR_ALL_ZONES(x) x##_DMA, x##_DMA32, x##_NORMAL, x##_HIGH
+
+enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
+               FOR_ALL_ZONES(PGALLOC),
+               PGFREE, PGACTIVATE, PGDEACTIVATE,
+               PGFAULT, PGMAJFAULT,
+               FOR_ALL_ZONES(PGREFILL),
+               FOR_ALL_ZONES(PGSTEAL),
+               FOR_ALL_ZONES(PGSCAN_KSWAPD),
+               FOR_ALL_ZONES(PGSCAN_DIRECT),
+               PGINODESTEAL, SLABS_SCANNED, KSWAPD_STEAL, KSWAPD_INODESTEAL,
+               PAGEOUTRUN, ALLOCSTALL, PGROTATED,
+               NR_VM_EVENT_ITEMS
+};
+
+struct vm_event_state {
+       unsigned long event[NR_VM_EVENT_ITEMS];
+};
+
+DECLARE_PER_CPU(struct vm_event_state, vm_event_states);
+
+static inline void __count_vm_event(enum vm_event_item item)
+{
+       __get_cpu_var(vm_event_states.event[item])++;
+}
+
+static inline void count_vm_event(enum vm_event_item item)
+{
+       get_cpu_var(vm_event_states.event[item])++;
+       put_cpu();
+}
+
+static inline void __count_vm_events(enum vm_event_item item, long delta)
+{
+       __get_cpu_var(vm_event_states.event[item]) += delta;
+}
+
+static inline void count_vm_events(enum vm_event_item item, long delta)
+{
+       get_cpu_var(vm_event_states.event[item])++;
+       put_cpu();
+}
+
+extern void all_vm_events(unsigned long *);
+extern void vm_events_fold_cpu(int cpu);
+
+#else
+
+/* Disable counters */
+#define get_cpu_vm_events(e)   0L
+#define count_vm_event(e)      do { } while (0)
+#define count_vm_events(e,d)   do { } while (0)
+#define __count_vm_event(e)    do { } while (0)
+#define __count_vm_events(e,d) do { } while (0)
+#define vm_events_fold_cpu(x)  do { } while (0)
+
+#endif /* CONFIG_VM_EVENT_COUNTERS */
+
+#define __count_zone_vm_events(item, zone, delta) \
+                       __count_vm_events(item##_DMA + zone_idx(zone), delta)
+
+/*
+ * Zone based page accounting with per cpu differentials.
+ */
+extern atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS];
+
+static inline void zone_page_state_add(long x, struct zone *zone,
+                                enum zone_stat_item item)
+{
+       atomic_long_add(x, &zone->vm_stat[item]);
+       atomic_long_add(x, &vm_stat[item]);
+}
+
+static inline unsigned long global_page_state(enum zone_stat_item item)
+{
+       long x = atomic_long_read(&vm_stat[item]);
+#ifdef CONFIG_SMP
+       if (x < 0)
+               x = 0;
+#endif
+       return x;
+}
+
+static inline unsigned long zone_page_state(struct zone *zone,
+                                       enum zone_stat_item item)
+{
+       long x = atomic_long_read(&zone->vm_stat[item]);
+#ifdef CONFIG_SMP
+       if (x < 0)
+               x = 0;
+#endif
+       return x;
+}
+
+#ifdef CONFIG_NUMA
+/*
+ * Determine the per node value of a stat item. This function
+ * is called frequently in a NUMA machine, so try to be as
+ * frugal as possible.
+ */
+static inline unsigned long node_page_state(int node,
+                                enum zone_stat_item item)
+{
+       struct zone *zones = NODE_DATA(node)->node_zones;
+
+       return
+#ifndef CONFIG_DMA_IS_NORMAL
+#if !defined(CONFIG_DMA_IS_DMA32) && BITS_PER_LONG >= 64
+               zone_page_state(&zones[ZONE_DMA32], item) +
+#endif
+               zone_page_state(&zones[ZONE_NORMAL], item) +
+#endif
+#ifdef CONFIG_HIGHMEM
+               zone_page_state(&zones[ZONE_HIGHMEM], item) +
+#endif
+               zone_page_state(&zones[ZONE_DMA], item);
+}
+
+extern void zone_statistics(struct zonelist *, struct zone *);
+
+#else
+
+#define node_page_state(node, item) global_page_state(item)
+#define zone_statistics(_zl,_z) do { } while (0)
+
+#endif /* CONFIG_NUMA */
+
+#define __add_zone_page_state(__z, __i, __d)   \
+               __mod_zone_page_state(__z, __i, __d)
+#define __sub_zone_page_state(__z, __i, __d)   \
+               __mod_zone_page_state(__z, __i,-(__d))
+
+#define add_zone_page_state(__z, __i, __d) mod_zone_page_state(__z, __i, __d)
+#define sub_zone_page_state(__z, __i, __d) mod_zone_page_state(__z, __i, -(__d))
+
+static inline void zap_zone_vm_stats(struct zone *zone)
+{
+       memset(zone->vm_stat, 0, sizeof(zone->vm_stat));
+}
+
+extern void inc_zone_state(struct zone *, enum zone_stat_item);
+
+#ifdef CONFIG_SMP
+void __mod_zone_page_state(struct zone *, enum zone_stat_item item, int);
+void __inc_zone_page_state(struct page *, enum zone_stat_item);
+void __dec_zone_page_state(struct page *, enum zone_stat_item);
+
+void mod_zone_page_state(struct zone *, enum zone_stat_item, int);
+void inc_zone_page_state(struct page *, enum zone_stat_item);
+void dec_zone_page_state(struct page *, enum zone_stat_item);
+
+extern void inc_zone_state(struct zone *, enum zone_stat_item);
+
+void refresh_cpu_vm_stats(int);
+void refresh_vm_stats(void);
+
+#else /* CONFIG_SMP */
+
+/*
+ * We do not maintain differentials in a single processor configuration.
+ * The functions directly modify the zone and global counters.
+ */
+static inline void __mod_zone_page_state(struct zone *zone,
+                       enum zone_stat_item item, int delta)
+{
+       zone_page_state_add(delta, zone, item);
+}
+
+static inline void __inc_zone_page_state(struct page *page,
+                       enum zone_stat_item item)
+{
+       atomic_long_inc(&page_zone(page)->vm_stat[item]);
+       atomic_long_inc(&vm_stat[item]);
+}
+
+static inline void __dec_zone_page_state(struct page *page,
+                       enum zone_stat_item item)
+{
+       atomic_long_dec(&page_zone(page)->vm_stat[item]);
+       atomic_long_dec(&vm_stat[item]);
+}
+
+/*
+ * We only use atomic operations to update counters. So there is no need to
+ * disable interrupts.
+ */
+#define inc_zone_page_state __inc_zone_page_state
+#define dec_zone_page_state __dec_zone_page_state
+#define mod_zone_page_state __mod_zone_page_state
+
+static inline void refresh_cpu_vm_stats(int cpu) { }
+static inline void refresh_vm_stats(void) { }
+#endif
+
+#endif /* _LINUX_VMSTAT_H */
index 544e855c7c02d9f6a10607a921d229e909a10efe..794be7af58aeff2191059ab350b1b258ea597a03 100644 (file)
@@ -68,7 +68,7 @@ struct task_struct;
        wait_queue_t name = __WAITQUEUE_INITIALIZER(name, tsk)
 
 #define __WAIT_QUEUE_HEAD_INITIALIZER(name) {                          \
-       .lock           = SPIN_LOCK_UNLOCKED,                           \
+       .lock           = __SPIN_LOCK_UNLOCKED(name.lock),              \
        .task_list      = { &(name).task_list, &(name).task_list } }
 
 #define DECLARE_WAIT_QUEUE_HEAD(name) \
@@ -77,9 +77,15 @@ struct task_struct;
 #define __WAIT_BIT_KEY_INITIALIZER(word, bit)                          \
        { .flags = word, .bit_nr = bit, }
 
+/*
+ * lockdep: we want one lock-class for all waitqueue locks.
+ */
+extern struct lock_class_key waitqueue_lock_key;
+
 static inline void init_waitqueue_head(wait_queue_head_t *q)
 {
        spin_lock_init(&q->lock);
+       lockdep_set_class(&q->lock, &waitqueue_lock_key);
        INIT_LIST_HEAD(&q->task_list);
 }
 
index ad9c171bfa07177e0716e34a6d0c8be4e84b547d..3c43b95f4c0dd5062b07b5d3864027b0ca0aff89 100644 (file)
@@ -20,6 +20,7 @@ struct tuner_range {
 
 struct tuner_params {
        enum param_type type;
+
        /* Many Philips based tuners have a comment like this in their
         * datasheet:
         *
@@ -39,6 +40,60 @@ struct tuner_params {
         * static unless the control byte was sent first.
         */
        unsigned int cb_first_if_lower_freq:1;
+       /* Set to 1 if this tuner uses a tda9887 */
+       unsigned int has_tda9887:1;
+       /* Many Philips tuners use tda9887 PORT1 to select the FM radio
+          sensitivity. If this setting is 1, then set PORT1 to 1 to
+          get proper FM reception. */
+       unsigned int port1_fm_high_sensitivity:1;
+       /* Some Philips tuners use tda9887 PORT2 to select the FM radio
+          sensitivity. If this setting is 1, then set PORT2 to 1 to
+          get proper FM reception. */
+       unsigned int port2_fm_high_sensitivity:1;
+       /* Most tuners with a tda9887 use QSS mode. Some (cheaper) tuners
+          use Intercarrier mode. If this setting is 1, then the tuner
+          needs to be set to intercarrier mode. */
+       unsigned int intercarrier_mode:1;
+       /* This setting sets the default value for PORT1.
+          0 means inactive, 1 means active. Note: the actual bit
+          value written to the tda9887 is inverted. So a 0 here
+          means a 1 in the B6 bit. */
+       unsigned int port1_active:1;
+       /* This setting sets the default value for PORT2.
+          0 means inactive, 1 means active. Note: the actual bit
+          value written to the tda9887 is inverted. So a 0 here
+          means a 1 in the B7 bit. */
+       unsigned int port2_active:1;
+       /* Sometimes PORT1 is inverted when the SECAM-L' standard is selected.
+          Set this bit to 1 if this is needed. */
+       unsigned int port1_invert_for_secam_lc:1;
+       /* Sometimes PORT2 is inverted when the SECAM-L' standard is selected.
+          Set this bit to 1 if this is needed. */
+       unsigned int port2_invert_for_secam_lc:1;
+       /* Some cards require PORT1 to be 1 for mono Radio FM and 0 for stereo. */
+       unsigned int port1_set_for_fm_mono:1;
+       /* Default tda9887 TOP value in dB for the low band. Default is 0.
+          Range: -16:+15 */
+       signed int default_top_low:5;
+       /* Default tda9887 TOP value in dB for the mid band. Default is 0.
+          Range: -16:+15 */
+       signed int default_top_mid:5;
+       /* Default tda9887 TOP value in dB for the high band. Default is 0.
+          Range: -16:+15 */
+       signed int default_top_high:5;
+       /* Default tda9887 TOP value in dB for SECAM-L/L' for the low band.
+          Default is 0. Several tuners require a different TOP value for
+          the SECAM-L/L' standards. Range: -16:+15 */
+       signed int default_top_secam_low:5;
+       /* Default tda9887 TOP value in dB for SECAM-L/L' for the mid band.
+          Default is 0. Several tuners require a different TOP value for
+          the SECAM-L/L' standards. Range: -16:+15 */
+       signed int default_top_secam_mid:5;
+       /* Default tda9887 TOP value in dB for SECAM-L/L' for the high band.
+          Default is 0. Several tuners require a different TOP value for
+          the SECAM-L/L' standards. Range: -16:+15 */
+       signed int default_top_secam_high:5;
+
 
        unsigned int count;
        struct tuner_range *ranges;
diff --git a/include/mtd/Kbuild b/include/mtd/Kbuild
new file mode 100644 (file)
index 0000000..e1da2a5
--- /dev/null
@@ -0,0 +1,2 @@
+unifdef-y := mtd-abi.h
+header-y := inftl-user.h jffs2-user.h mtd-user.h nftl-user.h
index 31329fce1ff5dc6111095a83b2ce961881460e1e..1da3f7fa79934914a36ca2f2fbfdfd2f17eb062d 100644 (file)
@@ -133,7 +133,7 @@ struct nand_ecclayout {
 };
 
 /**
- * struct mtd_ecc_stats - error correction status
+ * struct mtd_ecc_stats - error correction stats
  *
  * @corrected: number of corrected bits
  * @failed:    number of uncorrectable errors
index 5ba72d95280c3f87a4aa3f434805e375f69dc9e6..2fec827c8801456e6058c4a94ea16917559ace83 100644 (file)
@@ -67,6 +67,9 @@ struct unix_skb_parms {
 #define unix_state_rlock(s)    spin_lock(&unix_sk(s)->lock)
 #define unix_state_runlock(s)  spin_unlock(&unix_sk(s)->lock)
 #define unix_state_wlock(s)    spin_lock(&unix_sk(s)->lock)
+#define unix_state_wlock_nested(s) \
+                               spin_lock_nested(&unix_sk(s)->lock, \
+                               SINGLE_DEPTH_NESTING)
 #define unix_state_wunlock(s)  spin_unlock(&unix_sk(s)->lock)
 
 #ifdef __KERNEL__
index 7cd528e9d668af3a00b7b5f10c6654ff186b2877..69374cd1a857a05e1a8c8d0673afcb75f7badbfb 100644 (file)
@@ -182,14 +182,26 @@ typedef struct {
 
 typedef struct ax25_route {
        struct ax25_route       *next;
-       atomic_t                ref;
+       atomic_t                refcount;
        ax25_address            callsign;
        struct net_device       *dev;
        ax25_digi               *digipeat;
        char                    ip_mode;
-       struct timer_list       timer;
 } ax25_route;
 
+static inline void ax25_hold_route(ax25_route *ax25_rt)
+{
+       atomic_inc(&ax25_rt->refcount);
+}
+
+extern void __ax25_put_route(ax25_route *ax25_rt);
+
+static inline void ax25_put_route(ax25_route *ax25_rt)
+{
+       if (atomic_dec_and_test(&ax25_rt->refcount))
+               __ax25_put_route(ax25_rt);
+}
+
 typedef struct {
        char                    slave;                  /* slave_mode?   */
        struct timer_list       slave_timer;            /* timeout timer */
@@ -348,17 +360,11 @@ extern int  ax25_check_iframes_acked(ax25_cb *, unsigned short);
 extern void ax25_rt_device_down(struct net_device *);
 extern int  ax25_rt_ioctl(unsigned int, void __user *);
 extern struct file_operations ax25_route_fops;
+extern ax25_route *ax25_get_route(ax25_address *addr, struct net_device *dev);
 extern int  ax25_rt_autobind(ax25_cb *, ax25_address *);
-extern ax25_route *ax25_rt_find_route(ax25_route *, ax25_address *,
-       struct net_device *);
 extern struct sk_buff *ax25_rt_build_path(struct sk_buff *, ax25_address *, ax25_address *, ax25_digi *);
 extern void ax25_rt_free(void);
 
-static inline void ax25_put_route(ax25_route *ax25_rt)
-{
-       atomic_dec(&ax25_rt->ref);
-}
-
 /* ax25_std_in.c */
 extern int  ax25_std_frame_in(ax25_cb *, struct sk_buff *, int);
 
index 911ceb5cd263b51c90eee3e5803cee3206a88bd8..771d17783c1889d7d89d7875bdfb28a350e9d4e7 100644 (file)
@@ -175,6 +175,6 @@ extern int hci_sock_cleanup(void);
 extern int bt_sysfs_init(void);
 extern void bt_sysfs_cleanup(void);
 
-extern struct class bt_class;
+extern struct class *bt_class;
 
 #endif /* __BLUETOOTH_H */
index b06a2d2f63d2dd3d8aaef4b7f7ad22431609a64d..b2bdb1aa04291c7104113ef93532dcb26c166a44 100644 (file)
@@ -54,7 +54,8 @@
 /* HCI device quirks */
 enum {
        HCI_QUIRK_RESET_ON_INIT,
-       HCI_QUIRK_RAW_DEVICE
+       HCI_QUIRK_RAW_DEVICE,
+       HCI_QUIRK_FIXUP_BUFFER_SIZE
 };
 
 /* HCI device flags */
@@ -100,9 +101,10 @@ enum {
 #define HCIINQUIRY     _IOR('H', 240, int)
 
 /* HCI timeouts */
-#define HCI_CONN_TIMEOUT       (HZ * 40)
-#define HCI_DISCONN_TIMEOUT    (HZ * 2)
-#define HCI_CONN_IDLE_TIMEOUT  (HZ * 60)
+#define HCI_CONNECT_TIMEOUT    (40000) /* 40 seconds */
+#define HCI_DISCONN_TIMEOUT    (2000)  /* 2 seconds */
+#define HCI_IDLE_TIMEOUT       (6000)  /* 6 seconds */
+#define HCI_INIT_TIMEOUT       (10000) /* 10 seconds */
 
 /* HCI Packet types */
 #define HCI_COMMAND_PKT                0x01
@@ -144,7 +146,7 @@ enum {
 #define LMP_TACCURACY  0x10
 #define LMP_RSWITCH    0x20
 #define LMP_HOLD       0x40
-#define LMP_SNIF       0x80
+#define LMP_SNIFF      0x80
 
 #define LMP_PARK       0x01
 #define LMP_RSSI       0x02
@@ -159,13 +161,21 @@ enum {
 #define LMP_PSCHEME    0x02
 #define LMP_PCONTROL   0x04
 
+#define LMP_SNIFF_SUBR 0x02
+
+/* Connection modes */
+#define HCI_CM_ACTIVE  0x0000
+#define HCI_CM_HOLD    0x0001
+#define HCI_CM_SNIFF   0x0002
+#define HCI_CM_PARK    0x0003
+
 /* Link policies */
 #define HCI_LP_RSWITCH 0x0001
 #define HCI_LP_HOLD    0x0002
 #define HCI_LP_SNIFF   0x0004
 #define HCI_LP_PARK    0x0008
 
-/* Link mode */
+/* Link modes */
 #define HCI_LM_ACCEPT  0x8000
 #define HCI_LM_MASTER  0x0001
 #define HCI_LM_AUTH    0x0002
@@ -191,7 +201,7 @@ struct hci_rp_read_loc_version {
 } __attribute__ ((packed));
 
 #define OCF_READ_LOCAL_FEATURES        0x0003
-struct hci_rp_read_loc_features {
+struct hci_rp_read_local_features {
        __u8 status;
        __u8 features[8];
 } __attribute__ ((packed));
@@ -375,17 +385,32 @@ struct hci_cp_change_conn_link_key {
 } __attribute__ ((packed));
 
 #define OCF_READ_REMOTE_FEATURES 0x001B
-struct hci_cp_read_rmt_features {
+struct hci_cp_read_remote_features {
        __le16   handle;
 } __attribute__ ((packed));
 
 #define OCF_READ_REMOTE_VERSION 0x001D
-struct hci_cp_read_rmt_version {
+struct hci_cp_read_remote_version {
        __le16   handle;
 } __attribute__ ((packed));
 
 /* Link Policy */
-#define OGF_LINK_POLICY         0x02   
+#define OGF_LINK_POLICY        0x02   
+
+#define OCF_SNIFF_MODE         0x0003
+struct hci_cp_sniff_mode {
+       __le16   handle;
+       __le16   max_interval;
+       __le16   min_interval;
+       __le16   attempt;
+       __le16   timeout;
+} __attribute__ ((packed));
+
+#define OCF_EXIT_SNIFF_MODE    0x0004
+struct hci_cp_exit_sniff_mode {
+       __le16   handle;
+} __attribute__ ((packed));
+
 #define OCF_ROLE_DISCOVERY     0x0009
 struct hci_cp_role_discovery {
        __le16   handle;
@@ -406,7 +431,7 @@ struct hci_rp_read_link_policy {
        __le16   policy;
 } __attribute__ ((packed));
 
-#define OCF_SWITCH_ROLE        0x000B
+#define OCF_SWITCH_ROLE                0x000B
 struct hci_cp_switch_role {
        bdaddr_t bdaddr;
        __u8     role;
@@ -422,6 +447,14 @@ struct hci_rp_write_link_policy {
        __le16   handle;
 } __attribute__ ((packed));
 
+#define OCF_SNIFF_SUBRATE      0x0011
+struct hci_cp_sniff_subrate {
+       __le16   handle;
+       __le16   max_latency;
+       __le16   min_remote_timeout;
+       __le16   min_local_timeout;
+} __attribute__ ((packed));
+
 /* Status params */
 #define OGF_STATUS_PARAM       0x05
 
@@ -581,15 +614,15 @@ struct hci_ev_link_key_notify {
        __u8     key_type;
 } __attribute__ ((packed));
 
-#define HCI_EV_RMT_FEATURES    0x0B
-struct hci_ev_rmt_features {
+#define HCI_EV_REMOTE_FEATURES 0x0B
+struct hci_ev_remote_features {
        __u8     status;
        __le16   handle;
        __u8     features[8];
 } __attribute__ ((packed));
 
-#define HCI_EV_RMT_VERSION     0x0C
-struct hci_ev_rmt_version {
+#define HCI_EV_REMOTE_VERSION  0x0C
+struct hci_ev_remote_version {
        __u8     status;
        __le16   handle;
        __u8     lmp_ver;
@@ -610,6 +643,16 @@ struct hci_ev_pscan_rep_mode {
        __u8     pscan_rep_mode;
 } __attribute__ ((packed));
 
+#define HCI_EV_SNIFF_SUBRATE   0x2E
+struct hci_ev_sniff_subrate {
+       __u8     status;
+       __le16   handle;
+       __le16   max_tx_latency;
+       __le16   max_rx_latency;
+       __le16   max_remote_timeout;
+       __le16   max_local_timeout;
+} __attribute__ ((packed));
+
 /* Internal events generated by Bluetooth stack */
 #define HCI_EV_STACK_INTERNAL  0xFD
 struct hci_ev_stack_internal {
index bb9f81dc8723c5522daffd6d6184f3df675d0321..d84855fe7336d24938e0aed2055aaf316818cefe 100644 (file)
 #define HCI_PROTO_L2CAP        0
 #define HCI_PROTO_SCO  1
 
-#define HCI_INIT_TIMEOUT (HZ * 10)
-
 /* HCI Core structures */
-
 struct inquiry_data {
        bdaddr_t        bdaddr;
        __u8            pscan_rep_mode;
@@ -81,6 +78,10 @@ struct hci_dev {
        __u16           link_policy;
        __u16           link_mode;
 
+       __u32           idle_timeout;
+       __u16           sniff_min_interval;
+       __u16           sniff_max_interval;
+
        unsigned long   quirks;
 
        atomic_t        cmd_cnt;
@@ -123,7 +124,8 @@ struct hci_dev {
 
        atomic_t                promisc;
 
-       struct class_device     class_dev;
+       struct device           *parent;
+       struct device           dev;
 
        struct module           *owner;
 
@@ -145,18 +147,24 @@ struct hci_conn {
        bdaddr_t         dst;
        __u16            handle;
        __u16            state;
+       __u8             mode;
        __u8             type;
        __u8             out;
        __u8             dev_class[3];
+       __u8             features[8];
+       __u16            interval;
+       __u16            link_policy;
        __u32            link_mode;
+       __u8             power_save;
        unsigned long    pend;
-       
+
        unsigned int     sent;
-       
+
        struct sk_buff_head data_q;
 
-       struct timer_list timer;
-       
+       struct timer_list disc_timer;
+       struct timer_list idle_timer;
+
        struct hci_dev  *hdev;
        void            *l2cap_data;
        void            *sco_data;
@@ -211,7 +219,8 @@ void hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_data *data);
 enum {
        HCI_CONN_AUTH_PEND,
        HCI_CONN_ENCRYPT_PEND,
-       HCI_CONN_RSWITCH_PEND
+       HCI_CONN_RSWITCH_PEND,
+       HCI_CONN_MODE_CHANGE_PEND,
 };
 
 static inline void hci_conn_hash_init(struct hci_dev *hdev)
@@ -286,31 +295,27 @@ int hci_conn_encrypt(struct hci_conn *conn);
 int hci_conn_change_link_key(struct hci_conn *conn);
 int hci_conn_switch_role(struct hci_conn *conn, uint8_t role);
 
-static inline void hci_conn_set_timer(struct hci_conn *conn, unsigned long timeout)
-{
-       mod_timer(&conn->timer, jiffies + timeout);
-}
-
-static inline void hci_conn_del_timer(struct hci_conn *conn)
-{
-       del_timer(&conn->timer);
-}
+void hci_conn_enter_active_mode(struct hci_conn *conn);
+void hci_conn_enter_sniff_mode(struct hci_conn *conn);
 
 static inline void hci_conn_hold(struct hci_conn *conn)
 {
        atomic_inc(&conn->refcnt);
-       hci_conn_del_timer(conn);
+       del_timer(&conn->disc_timer);
 }
 
 static inline void hci_conn_put(struct hci_conn *conn)
 {
        if (atomic_dec_and_test(&conn->refcnt)) {
+               unsigned long timeo;
                if (conn->type == ACL_LINK) {
-                       unsigned long timeo = (conn->out) ?
-                               HCI_DISCONN_TIMEOUT : HCI_DISCONN_TIMEOUT * 2;
-                       hci_conn_set_timer(conn, timeo);
+                       timeo = msecs_to_jiffies(HCI_DISCONN_TIMEOUT);
+                       if (!conn->out)
+                               timeo *= 2;
+                       del_timer(&conn->idle_timer);
                } else
-                       hci_conn_set_timer(conn, HZ / 100);
+                       timeo = msecs_to_jiffies(10);
+               mod_timer(&conn->disc_timer, jiffies + timeo);
        }
 }
 
@@ -408,11 +413,13 @@ static inline int hci_recv_frame(struct sk_buff *skb)
 int hci_register_sysfs(struct hci_dev *hdev);
 void hci_unregister_sysfs(struct hci_dev *hdev);
 
-#define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->class_dev.dev = (pdev))
+#define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->parent = (pdev))
 
 /* ----- LMP capabilities ----- */
-#define lmp_rswitch_capable(dev) (dev->features[0] & LMP_RSWITCH)
-#define lmp_encrypt_capable(dev) (dev->features[0] & LMP_ENCRYPT)
+#define lmp_rswitch_capable(dev)   ((dev)->features[0] & LMP_RSWITCH)
+#define lmp_encrypt_capable(dev)   ((dev)->features[0] & LMP_ENCRYPT)
+#define lmp_sniff_capable(dev)     ((dev)->features[0] & LMP_SNIFF)
+#define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR)
 
 /* ----- HCI protocols ----- */
 struct hci_proto {
index a398ae5e30f991c427638af44216de453492474f..ab29dafb1a6af2711557a202e70127e882e3b18c 100644 (file)
@@ -146,7 +146,7 @@ static inline void ip6_dst_store(struct sock *sk, struct dst_entry *dst,
        struct rt6_info *rt = (struct rt6_info *) dst;
 
        write_lock(&sk->sk_dst_lock);
-       __sk_dst_set(sk, dst);
+       sk_setup_caps(sk, dst);
        np->daddr_cache = daddr;
        np->dst_cookie = rt->rt6i_node ? rt->rt6i_node->fn_sernum : 0;
        write_unlock(&sk->sk_dst_lock);
index 0575c59a5c96b203c3d93c4cf0e5027ede827327..bca19ca7bdd47418b7d93d7aca538479951047d9 100644 (file)
@@ -160,7 +160,7 @@ typedef struct {
         int irq, irq2;        /* Interrupts used */
         int dma, dma2;        /* DMA channel(s) used */
         int fifo_size;        /* FIFO size */
-        int irqflags;         /* interrupt flags (ie, SA_SHIRQ|SA_INTERRUPT) */
+        int irqflags;         /* interrupt flags (ie, IRQF_SHARED|IRQF_DISABLED) */
        int direction;        /* Link direction, used by some FIR drivers */
        int enabled;          /* Powered on? */
        int suspended;        /* Suspended by APM */
index 40b6b9c9973f5dd2756fd3dc4c6439d7676784e6..a225d6371cb12f5d5efa6b4318d1a54004c4bc01 100644 (file)
@@ -50,11 +50,17 @@ struct inet6_protocol
                               struct inet6_skb_parm *opt,
                               int type, int code, int offset,
                               __u32 info);
+
+       struct sk_buff *(*gso_segment)(struct sk_buff *skb,
+                                      int features);
+
        unsigned int    flags;  /* INET6_PROTO_xxx */
 };
 
 #define INET6_PROTO_NOPOLICY   0x1
 #define INET6_PROTO_FINAL      0x2
+/* This should be set for any extension header which is compatible with GSO. */
+#define INET6_PROTO_GSO_EXTHDR 0x4
 #endif
 
 /* This is used to register socket interfaces for IP protocols.  */
index 7136bae48c2f1d98977542f253d7b0b97a055829..324b3ea233d6000f04e4d5894b799535bb397e6e 100644 (file)
@@ -44,6 +44,7 @@
 #include <linux/timer.h>
 #include <linux/cache.h>
 #include <linux/module.h>
+#include <linux/lockdep.h>
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>      /* struct sk_buff */
 #include <linux/security.h>
@@ -78,14 +79,17 @@ typedef struct {
        spinlock_t              slock;
        struct sock_iocb        *owner;
        wait_queue_head_t       wq;
+       /*
+        * We express the mutex-alike socket_lock semantics
+        * to the lock validator by explicitly managing
+        * the slock as a lock variant (in addition to
+        * the slock itself):
+        */
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+       struct lockdep_map dep_map;
+#endif
 } socket_lock_t;
 
-#define sock_lock_init(__sk) \
-do {   spin_lock_init(&((__sk)->sk_lock.slock)); \
-       (__sk)->sk_lock.owner = NULL; \
-       init_waitqueue_head(&((__sk)->sk_lock.wq)); \
-} while(0)
-
 struct sock;
 struct proto;
 
@@ -140,6 +144,7 @@ struct sock_common {
   *    @sk_flags: %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE, %SO_OOBINLINE settings
   *    @sk_no_check: %SO_NO_CHECK setting, wether or not checkup packets
   *    @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO)
+  *    @sk_gso_type: GSO type (e.g. %SKB_GSO_TCPV4)
   *    @sk_lingertime: %SO_LINGER l_linger setting
   *    @sk_backlog: always used with the per-socket spinlock held
   *    @sk_callback_lock: used with the callbacks in the end of this struct
@@ -211,6 +216,7 @@ struct sock {
        gfp_t                   sk_allocation;
        int                     sk_sndbuf;
        int                     sk_route_caps;
+       int                     sk_gso_type;
        int                     sk_rcvlowat;
        unsigned long           sk_flags;
        unsigned long           sk_lingertime;
@@ -745,6 +751,9 @@ extern void FASTCALL(release_sock(struct sock *sk));
 
 /* BH context may only use the following locking interface. */
 #define bh_lock_sock(__sk)     spin_lock(&((__sk)->sk_lock.slock))
+#define bh_lock_sock_nested(__sk) \
+                               spin_lock_nested(&((__sk)->sk_lock.slock), \
+                               SINGLE_DEPTH_NESTING)
 #define bh_unlock_sock(__sk)   spin_unlock(&((__sk)->sk_lock.slock))
 
 extern struct sock             *sk_alloc(int family,
@@ -1025,15 +1034,20 @@ extern struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie);
 
 extern struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie);
 
+static inline int sk_can_gso(const struct sock *sk)
+{
+       return net_gso_ok(sk->sk_route_caps, sk->sk_gso_type);
+}
+
 static inline void sk_setup_caps(struct sock *sk, struct dst_entry *dst)
 {
        __sk_dst_set(sk, dst);
        sk->sk_route_caps = dst->dev->features;
        if (sk->sk_route_caps & NETIF_F_GSO)
-               sk->sk_route_caps |= NETIF_F_TSO;
-       if (sk->sk_route_caps & NETIF_F_TSO) {
+               sk->sk_route_caps |= NETIF_F_GSO_MASK;
+       if (sk_can_gso(sk)) {
                if (dst->header_len)
-                       sk->sk_route_caps &= ~NETIF_F_TSO;
+                       sk->sk_route_caps &= ~NETIF_F_GSO_MASK;
                else 
                        sk->sk_route_caps |= NETIF_F_SG | NETIF_F_HW_CSUM;
        }
index 624921e763329d952cf5b68805cc75ca20399d5c..3cd803b0d7a531537961483aec4ea77923b8d418 100644 (file)
@@ -751,7 +751,7 @@ static inline int tcp_is_cwnd_limited(const struct sock *sk, u32 in_flight)
        if (in_flight >= tp->snd_cwnd)
                return 1;
 
-       if (!(sk->sk_route_caps & NETIF_F_TSO))
+       if (!sk_can_gso(sk))
                return 0;
 
        left = tp->snd_cwnd - in_flight;
index 7bb366f70934787e19b7dfa2f0ddd05895cd12a0..4629d77173f23e9954cdf6106d581de1b668c559 100644 (file)
@@ -55,9 +55,7 @@ static inline void TCP_ECN_send(struct sock *sk, struct tcp_sock *tp,
                        if (tp->ecn_flags&TCP_ECN_QUEUE_CWR) {
                                tp->ecn_flags &= ~TCP_ECN_QUEUE_CWR;
                                skb->h.th->cwr = 1;
-                               if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV4)
-                                       skb_shinfo(skb)->gso_type |=
-                                               SKB_GSO_TCPV4_ECN;
+                               skb_shinfo(skb)->gso_type |= SKB_GSO_TCP_ECN;
                        }
                } else {
                        /* ACK or retransmitted segment: clear ECT|CE */
diff --git a/include/rdma/Kbuild b/include/rdma/Kbuild
new file mode 100644 (file)
index 0000000..eb710ba
--- /dev/null
@@ -0,0 +1 @@
+header-y := ib_user_mad.h
diff --git a/include/scsi/Kbuild b/include/scsi/Kbuild
new file mode 100644 (file)
index 0000000..14a033d
--- /dev/null
@@ -0,0 +1,2 @@
+header-y += scsi.h
+unifdef-y := scsi_ioctl.h sg.h
index 253797c60095d48d7d773d2103f66c1e903acfe4..55ebf035e620f386cabad881585f33126d62bff5 100644 (file)
@@ -47,10 +47,19 @@ enum iscsi_uevent_e {
        ISCSI_UEVENT_TRANSPORT_EP_POLL          = UEVENT_BASE + 13,
        ISCSI_UEVENT_TRANSPORT_EP_DISCONNECT    = UEVENT_BASE + 14,
 
+       ISCSI_UEVENT_TGT_DSCVR          = UEVENT_BASE + 15,
+
        /* up events */
        ISCSI_KEVENT_RECV_PDU           = KEVENT_BASE + 1,
        ISCSI_KEVENT_CONN_ERROR         = KEVENT_BASE + 2,
        ISCSI_KEVENT_IF_ERROR           = KEVENT_BASE + 3,
+       ISCSI_KEVENT_DESTROY_SESSION    = KEVENT_BASE + 4,
+};
+
+enum iscsi_tgt_dscvr {
+       ISCSI_TGT_DSCVR_SEND_TARGETS    = 1,
+       ISCSI_TGT_DSCVR_ISNS            = 2,
+       ISCSI_TGT_DSCVR_SLP             = 3,
 };
 
 struct iscsi_uevent {
@@ -116,6 +125,17 @@ struct iscsi_uevent {
                struct msg_transport_disconnect {
                        uint64_t        ep_handle;
                } ep_disconnect;
+               struct msg_tgt_dscvr {
+                       enum iscsi_tgt_dscvr    type;
+                       uint32_t        host_no;
+                       /*
+                        * enable = 1 to establish a new connection
+                        * with the server. enable = 0 to disconnect
+                        * from the server. Used primarily to switch
+                        * from one iSNS server to another.
+                        */
+                       uint32_t        enable;
+               } tgt_dscvr;
        } u;
        union {
                /* messages k -> u */
@@ -138,6 +158,10 @@ struct iscsi_uevent {
                        uint32_t        cid;
                        uint32_t        error; /* enum iscsi_err */
                } connerror;
+               struct msg_session_destroyed {
+                       uint32_t        host_no;
+                       uint32_t        sid;
+               } d_session;
                struct msg_transport_connect_ret {
                        uint64_t        handle;
                } ep_connect_ret;
index cbf7e58bd6f9bd69d680080b7b00d69b94bb93f1..ba2760802ded6f15715b03e0983ccb4ac8bceaa3 100644 (file)
@@ -157,6 +157,11 @@ struct iscsi_conn {
        int                     max_xmit_dlength; /* target_max_recv_dsl */
        int                     hdrdgst_en;
        int                     datadgst_en;
+       int                     ifmarker_en;
+       int                     ofmarker_en;
+       /* values userspace uses to id a conn */
+       int                     persistent_port;
+       char                    *persistent_address;
 
        /* MIB-statistics */
        uint64_t                txdata_octets;
@@ -196,8 +201,8 @@ struct iscsi_session {
        int                     pdu_inorder_en;
        int                     dataseq_inorder_en;
        int                     erl;
-       int                     ifmarker_en;
-       int                     ofmarker_en;
+       int                     tpgt;
+       char                    *targetname;
 
        /* control data */
        struct iscsi_transport  *tt;
@@ -240,6 +245,10 @@ iscsi_session_setup(struct iscsi_transport *, struct scsi_transport_template *,
 extern void iscsi_session_teardown(struct iscsi_cls_session *);
 extern struct iscsi_session *class_to_transport_session(struct iscsi_cls_session *);
 extern void iscsi_session_recovery_timedout(struct iscsi_cls_session *);
+extern int iscsi_set_param(struct iscsi_cls_conn *cls_conn,
+                          enum iscsi_param param, char *buf, int buflen);
+extern int iscsi_session_get_param(struct iscsi_cls_session *cls_session,
+                                  enum iscsi_param param, char *buf);
 
 #define session_to_cls(_sess) \
        hostdata_session(_sess->host->hostdata)
@@ -255,6 +264,8 @@ extern void iscsi_conn_stop(struct iscsi_cls_conn *, int);
 extern int iscsi_conn_bind(struct iscsi_cls_session *, struct iscsi_cls_conn *,
                           int);
 extern void iscsi_conn_failure(struct iscsi_conn *conn, enum iscsi_err err);
+extern int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn,
+                               enum iscsi_param param, char *buf);
 
 /*
  * pdu and task processing
index e46cd404bd7d2bdeffcbaba5e4147d53251d6efd..371f70d9aa92e993438a29a2981f182772f7478b 100644 (file)
@@ -143,7 +143,7 @@ struct scsi_cmnd {
 
 extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t);
 extern void scsi_put_command(struct scsi_cmnd *);
-extern void scsi_io_completion(struct scsi_cmnd *, unsigned int, unsigned int);
+extern void scsi_io_completion(struct scsi_cmnd *, unsigned int);
 extern void scsi_finish_command(struct scsi_cmnd *cmd);
 extern void scsi_req_abort_cmd(struct scsi_cmnd *cmd);
 
index a42efd6e4be88ec79890a4b404f8f02cf4ec99fc..b3dd90f3e85868a4023fecceecefb7336f795324 100644 (file)
@@ -542,6 +542,9 @@ struct Scsi_Host {
         */
        unsigned ordered_tag:1;
 
+       /* task mgmt function in progress */
+       unsigned tmf_in_progress:1;
+
        /*
         * Optional work queue to be utilized by the transport
         */
@@ -619,7 +622,8 @@ static inline int scsi_host_in_recovery(struct Scsi_Host *shost)
 {
        return shost->shost_state == SHOST_RECOVERY ||
                shost->shost_state == SHOST_CANCEL_RECOVERY ||
-               shost->shost_state == SHOST_DEL_RECOVERY;
+               shost->shost_state == SHOST_DEL_RECOVERY ||
+               shost->tmf_in_progress;
 }
 
 extern int scsi_queue_work(struct Scsi_Host *, struct work_struct *);
index b684426a5900ba2798072e2237179d450046e174..5a3df1d7085f249018249dedfc08d40f33840e6d 100644 (file)
@@ -34,6 +34,7 @@ struct iscsi_cls_conn;
 struct iscsi_conn;
 struct iscsi_cmd_task;
 struct iscsi_mgmt_task;
+struct sockaddr;
 
 /**
  * struct iscsi_transport - iSCSI Transport template
@@ -46,7 +47,12 @@ struct iscsi_mgmt_task;
  * @bind_conn:         associate this connection with existing iSCSI session
  *                     and specified transport descriptor
  * @destroy_conn:      destroy inactive iSCSI connection
- * @set_param:         set iSCSI Data-Path operational parameter
+ * @set_param:         set iSCSI parameter. Return 0 on success, -ENODATA
+ *                     when param is not supported, and a -Exx value on other
+ *                     error.
+ * @get_param          get iSCSI parameter. Must return number of bytes
+ *                     copied to buffer on success, -ENODATA when param
+ *                     is not supported, and a -Exx value on other error
  * @start_conn:                set connection to be operational
  * @stop_conn:         suspend/recover/terminate connection
  * @send_pdu:          send iSCSI PDU, Login, Logout, NOP-Out, Reject, Text.
@@ -97,15 +103,11 @@ struct iscsi_transport {
        void (*stop_conn) (struct iscsi_cls_conn *conn, int flag);
        void (*destroy_conn) (struct iscsi_cls_conn *conn);
        int (*set_param) (struct iscsi_cls_conn *conn, enum iscsi_param param,
-                         uint32_t value);
+                         char *buf, int buflen);
        int (*get_conn_param) (struct iscsi_cls_conn *conn,
-                              enum iscsi_param param, uint32_t *value);
+                              enum iscsi_param param, char *buf);
        int (*get_session_param) (struct iscsi_cls_session *session,
-                                 enum iscsi_param param, uint32_t *value);
-       int (*get_conn_str_param) (struct iscsi_cls_conn *conn,
-                                  enum iscsi_param param, char *buf);
-       int (*get_session_str_param) (struct iscsi_cls_session *session,
-                                     enum iscsi_param param, char *buf);
+                                 enum iscsi_param param, char *buf);
        int (*send_pdu) (struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr,
                         char *data, uint32_t data_size);
        void (*get_stats) (struct iscsi_cls_conn *conn,
@@ -127,6 +129,8 @@ struct iscsi_transport {
                           uint64_t *ep_handle);
        int (*ep_poll) (uint64_t ep_handle, int timeout_ms);
        void (*ep_disconnect) (uint64_t ep_handle);
+       int (*tgt_dscvr) (enum iscsi_tgt_dscvr type, uint32_t host_no,
+                         uint32_t enable, struct sockaddr *dst_addr);
 };
 
 /*
@@ -155,13 +159,6 @@ struct iscsi_cls_conn {
        struct iscsi_transport *transport;
        uint32_t cid;                   /* connection id */
 
-       /* portal/group values we got during discovery */
-       char *persistent_address;
-       int persistent_port;
-       /* portal/group values we are currently using */
-       char *address;
-       int port;
-
        int active;                     /* must be accessed with the connlock */
        struct device dev;              /* sysfs transport/container device */
        struct mempool_zone *z_error;
@@ -185,16 +182,11 @@ struct iscsi_cls_session {
        struct list_head host_list;
        struct iscsi_transport *transport;
 
-       /* iSCSI values used as unique id by userspace. */
-       char *targetname;
-       int tpgt;
-
        /* recovery fields */
        int recovery_tmo;
        struct work_struct recovery_work;
 
        int target_id;
-       int channel;
 
        int sid;                                /* session id */
        void *dd_data;                          /* LLD private data */
@@ -207,8 +199,10 @@ struct iscsi_cls_session {
 #define iscsi_session_to_shost(_session) \
        dev_to_shost(_session->dev.parent)
 
+#define starget_to_session(_stgt) \
+       iscsi_dev_to_session(_stgt->dev.parent)
+
 struct iscsi_host {
-       int next_target_id;
        struct list_head sessions;
        struct mutex mutex;
 };
@@ -216,8 +210,17 @@ struct iscsi_host {
 /*
  * session and connection functions that can be used by HW iSCSI LLDs
  */
+extern struct iscsi_cls_session *iscsi_alloc_session(struct Scsi_Host *shost,
+                                       struct iscsi_transport *transport);
+extern int iscsi_add_session(struct iscsi_cls_session *session,
+                            unsigned int target_id);
+extern int iscsi_if_create_session_done(struct iscsi_cls_conn *conn);
+extern int iscsi_if_destroy_session_done(struct iscsi_cls_conn *conn);
 extern struct iscsi_cls_session *iscsi_create_session(struct Scsi_Host *shost,
-                               struct iscsi_transport *t, int channel);
+                                               struct iscsi_transport *t,
+                                               unsigned int target_id);
+extern void iscsi_remove_session(struct iscsi_cls_session *session);
+extern void iscsi_free_session(struct iscsi_cls_session *session);
 extern int iscsi_destroy_session(struct iscsi_cls_session *session);
 extern struct iscsi_cls_conn *iscsi_create_conn(struct iscsi_cls_session *sess,
                                            uint32_t cid);
@@ -225,4 +228,5 @@ extern int iscsi_destroy_conn(struct iscsi_cls_conn *conn);
 extern void iscsi_unblock_session(struct iscsi_cls_session *session);
 extern void iscsi_block_session(struct iscsi_cls_session *session);
 
+
 #endif
index 93cfb4bf4211231ba82f92e492b788d65a366c03..e3c503cd175ea5b9e5b00bbbf7ab3e42c3a18429 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <linux/transport_class.h>
 #include <linux/types.h>
+#include <linux/mutex.h>
 
 struct scsi_transport_template;
 struct sas_rphy;
@@ -55,7 +56,6 @@ struct sas_phy {
        enum sas_linkrate       minimum_linkrate;
        enum sas_linkrate       maximum_linkrate_hw;
        enum sas_linkrate       maximum_linkrate;
-       u8                      port_identifier;
 
        /* internal state */
        unsigned int            local_attached : 1;
@@ -66,8 +66,8 @@ struct sas_phy {
        u32                     loss_of_dword_sync_count;
        u32                     phy_reset_problem_count;
 
-       /* the other end of the link */
-       struct sas_rphy         *rphy;
+       /* for the list of phys belonging to a port */
+       struct list_head        port_siblings;
 };
 
 #define dev_to_phy(d) \
@@ -124,6 +124,24 @@ struct sas_expander_device {
 #define rphy_to_expander_device(r) \
        container_of((r), struct sas_expander_device, rphy)
 
+struct sas_port {
+       struct device           dev;
+
+       u8                      port_identifier;
+       int                     num_phys;
+
+       /* the other end of the link */
+       struct sas_rphy         *rphy;
+
+       struct mutex            phy_list_mutex;
+       struct list_head        phy_list;
+};
+
+#define dev_to_sas_port(d) \
+       container_of((d), struct sas_port, dev)
+#define transport_class_to_sas_port(cdev) \
+       dev_to_sas_port((cdev)->dev)
+
 /* The functions by which the transport class and the driver communicate */
 struct sas_function_template {
        int (*get_linkerrors)(struct sas_phy *);
@@ -133,6 +151,7 @@ struct sas_function_template {
 };
 
 
+void sas_remove_children(struct device *);
 extern void sas_remove_host(struct Scsi_Host *);
 
 extern struct sas_phy *sas_phy_alloc(struct device *, int);
@@ -141,13 +160,21 @@ extern int sas_phy_add(struct sas_phy *);
 extern void sas_phy_delete(struct sas_phy *);
 extern int scsi_is_sas_phy(const struct device *);
 
-extern struct sas_rphy *sas_end_device_alloc(struct sas_phy *);
-extern struct sas_rphy *sas_expander_alloc(struct sas_phy *, enum sas_device_type);
+extern struct sas_rphy *sas_end_device_alloc(struct sas_port *);
+extern struct sas_rphy *sas_expander_alloc(struct sas_port *, enum sas_device_type);
 void sas_rphy_free(struct sas_rphy *);
 extern int sas_rphy_add(struct sas_rphy *);
 extern void sas_rphy_delete(struct sas_rphy *);
 extern int scsi_is_sas_rphy(const struct device *);
 
+struct sas_port *sas_port_alloc(struct device *, int);
+int sas_port_add(struct sas_port *);
+void sas_port_free(struct sas_port *);
+void sas_port_delete(struct sas_port *);
+void sas_port_add_phy(struct sas_port *, struct sas_phy *);
+void sas_port_delete_phy(struct sas_port *, struct sas_phy *);
+int scsi_is_sas_port(const struct device *);
+
 extern struct scsi_transport_template *
 sas_attach_transport(struct sas_function_template *);
 extern void sas_release_transport(struct scsi_transport_template *);
diff --git a/include/sound/Kbuild b/include/sound/Kbuild
new file mode 100644 (file)
index 0000000..3a5a3df
--- /dev/null
@@ -0,0 +1,2 @@
+header-y := asound_fm.h hdsp.h hdspm.h sfnt_info.h sscape_ioctl.h
+unifdef-y := asequencer.h asound.h emu10k1.h sb16_csp.h 
index d45170b9e0b70add3d0b7483a2341477036a9ac6..2ae76efc696fef63fe3d8b51d8c30dd9b528b774 100644 (file)
@@ -62,7 +62,7 @@ static int snd_legacy_find_free_irq(int *irq_table)
 {
        while (*irq_table != -1) {
                if (!request_irq(*irq_table, snd_legacy_empty_irq_handler,
-                                SA_INTERRUPT | SA_PROBEIRQ, "ALSA Test IRQ",
+                                IRQF_DISABLED | IRQF_PROBE_SHARED, "ALSA Test IRQ",
                                 (void *) irq_table)) {
                        free_irq(*irq_table, (void *) irq_table);
                        return *irq_table;
diff --git a/include/video/Kbuild b/include/video/Kbuild
new file mode 100644 (file)
index 0000000..76a6073
--- /dev/null
@@ -0,0 +1 @@
+unifdef-y := sisfb.h
index f70f2fd273c2152708bdac6800d038229b58a8cc..a5b073a103e7cf9cd5a3438765a97e6468c23c6f 100644 (file)
@@ -54,8 +54,8 @@ config LOCK_KERNEL
 
 config INIT_ENV_ARG_LIMIT
        int
-       default 32 if !USERMODE
-       default 128 if USERMODE
+       default 32 if !UML
+       default 128 if UML
        help
          Maximum of each of the number of arguments and environment
          variables passed to init from the kernel command line.
@@ -379,6 +379,15 @@ config SLAB
          SLOB is more space efficient but does not scale well and is
          more susceptible to fragmentation.
 
+config VM_EVENT_COUNTERS
+       default y
+       bool "Enable VM event counters for /proc/vmstat" if EMBEDDED
+       help
+         VM event counters are only needed to for event counts to be
+         shown. They have no function for the kernel itself. This
+         option allows the disabling of the VM event counters.
+         /proc/vmstat will only show page counts.
+
 endmenu                # General setup
 
 config TINY_SHMEM
index bce0eb7f4f8fb50413a516b1a3bafbb8ae81b821..628b8e9e841ae9ed86fedd98cdd850a5af2815f6 100644 (file)
@@ -11,7 +11,6 @@
 
 #define __KERNEL_SYSCALLS__
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/proc_fs.h>
@@ -48,6 +47,8 @@
 #include <linux/key.h>
 #include <linux/unwind.h>
 #include <linux/buffer_head.h>
+#include <linux/debug_locks.h>
+#include <linux/lockdep.h>
 
 #include <asm/io.h>
 #include <asm/bugs.h>
@@ -446,10 +447,27 @@ static void __init boot_cpu_init(void)
        cpu_set(cpu, cpu_possible_map);
 }
 
+void __init __attribute__((weak)) smp_setup_processor_id(void)
+{
+}
+
 asmlinkage void __init start_kernel(void)
 {
        char * command_line;
        extern struct kernel_param __start___param[], __stop___param[];
+
+       smp_setup_processor_id();
+
+       /*
+        * Need to run as early as possible, to initialize the
+        * lockdep hash:
+        */
+       lockdep_init();
+
+       local_irq_disable();
+       early_boot_irqs_off();
+       early_init_irq_lock_class();
+
 /*
  * Interrupts are still disabled. Do necessary setups, then
  * enable them
@@ -490,8 +508,13 @@ asmlinkage void __init start_kernel(void)
        init_timers();
        hrtimers_init();
        softirq_init();
-       time_init();
        timekeeping_init();
+       time_init();
+       profile_init();
+       if (!irqs_disabled())
+               printk("start_kernel(): bug: interrupts were enabled early\n");
+       early_boot_irqs_on();
+       local_irq_enable();
 
        /*
         * HACK ALERT! This is early. We're enabling the console before
@@ -501,8 +524,16 @@ asmlinkage void __init start_kernel(void)
        console_init();
        if (panic_later)
                panic(panic_later, panic_param);
-       profile_init();
-       local_irq_enable();
+
+       lockdep_info();
+
+       /*
+        * Need to run this when irqs are enabled, because it wants
+        * to self-test [hard/soft]-irqs on/off lock inversion bugs
+        * too:
+        */
+       locking_selftest();
+
 #ifdef CONFIG_BLK_DEV_INITRD
        if (initrd_start && !initrd_below_start_ok &&
                        initrd_start < min_low_pfn << PAGE_SHIFT) {
index 3ddc3ceec2fe702e75f0623747cba6104089f877..e290802c6bd2c4920245d82cbe7b549a78cd1593 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/module.h>
 #include <linux/uts.h>
 #include <linux/utsname.h>
+#include <linux/utsrelease.h>
 #include <linux/version.h>
 
 #define version(a) Version_ ## a
index a544dfbb082a652625dc2f6b2b1b1adbe057233c..4d20cfd38f0abbc6c9311deaa829e7b79aa12839 100644 (file)
@@ -21,7 +21,6 @@
  *
  */
 #include <linux/compat.h>
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/highuid.h>
 #include <linux/init.h>
index 00f015a092d292347d781a60bf9f72c71b4381d1..cd92d342953e500717557a475f09dca9535c6c1a 100644 (file)
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -19,7 +19,6 @@
  */
 
 #include <linux/capability.h>
-#include <linux/config.h>
 #include <linux/slab.h>
 #include <linux/msg.h>
 #include <linux/spinlock.h>
index fce0bc8b5ad6f9c8652883a62c0b5ff2821f3853..6013c751156fe81bee30536bef27bab7792eb1bb 100644 (file)
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -66,7 +66,6 @@
  * Dustin Kirkland <dustin.kirkland@us.ibm.com>
  */
 
-#include <linux/config.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <linux/init.h>
index fe7ae73b698159cadb35290a13f187a6596c7c32..940b0c9b13aab7c33159760bba2a3a53756779dd 100644 (file)
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -17,7 +17,6 @@
  * Dustin Kirkland <dustin.kirkland@us.ibm.com>
  */
 
-#include <linux/config.h>
 #include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/hugetlb.h>
index 8193299f45f664e5b01e74960c804e9421bc4cf1..67b6d178db6e17d95b54e84b75361aec9a0544cc 100644 (file)
@@ -14,7 +14,6 @@
  *            Dustin Kirkland <dustin.kirkland@us.ibm.com>
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/shm.h>
 #include <linux/init.h>
index 82fb182f6f618421cb822aac8131914486b8a651..47dbcd570cd8d67599cea355a33fa704614dd297 100644 (file)
@@ -8,10 +8,15 @@ obj-y     = sched.o fork.o exec_domain.o panic.o printk.o profile.o \
            signal.o sys.o kmod.o workqueue.o pid.o \
            rcupdate.o extable.o params.o posix-timers.o \
            kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \
-           hrtimer.o
+           hrtimer.o rwsem.o
 
+obj-$(CONFIG_STACKTRACE) += stacktrace.o
 obj-y += time/
 obj-$(CONFIG_DEBUG_MUTEXES) += mutex-debug.o
+obj-$(CONFIG_LOCKDEP) += lockdep.o
+ifeq ($(CONFIG_PROC_FS),y)
+obj-$(CONFIG_LOCKDEP) += lockdep_proc.o
+endif
 obj-$(CONFIG_FUTEX) += futex.o
 ifeq ($(CONFIG_COMPAT),y)
 obj-$(CONFIG_FUTEX) += futex_compat.o
@@ -22,6 +27,7 @@ obj-$(CONFIG_RT_MUTEX_TESTER) += rtmutex-tester.o
 obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o
 obj-$(CONFIG_SMP) += cpu.o spinlock.o
 obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o
+obj-$(CONFIG_PROVE_LOCKING) += spinlock.o
 obj-$(CONFIG_UID16) += uid16.o
 obj-$(CONFIG_MODULES) += module.o
 obj-$(CONFIG_KALLSYMS) += kallsyms.o
index 126ca43d5d2ba9eb566af4380668c9546266efcd..f18e0b8df3e1d036e6276befb3e707c4610944de 100644 (file)
@@ -43,7 +43,6 @@
  * a struct file opened for write. Fixed. 2/6/2000, AV.
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/slab.h>
 #include <linux/acct.h>
index 8323e4132a3308fe2d679eeb167c6c9b9f86a830..6aa33b848cf2f0363ba6b8f8f477e9c36f2affc8 100644 (file)
@@ -81,6 +81,7 @@ struct audit_krule {
        u32                     mask[AUDIT_BITMASK_SIZE];
        u32                     buflen; /* for data alloc on list rules */
        u32                     field_count;
+       char                    *filterkey; /* ties events to rules */
        struct audit_field      *fields;
        struct audit_field      *inode_f; /* quick access to an inode field */
        struct audit_watch      *watch; /* associated watch */
index 4c99d2c586edcb2549f27e3e0d18f68e77c48763..5b4e16276ca05a4bd91512762a6f2fc86e5509a1 100644 (file)
@@ -141,6 +141,7 @@ static inline void audit_free_rule(struct audit_entry *e)
                        selinux_audit_rule_free(f->se_rule);
                }
        kfree(e->rule.fields);
+       kfree(e->rule.filterkey);
        kfree(e);
 }
 
@@ -278,6 +279,29 @@ static int audit_to_watch(struct audit_krule *krule, char *path, int len,
        return 0;
 }
 
+static __u32 *classes[AUDIT_SYSCALL_CLASSES];
+
+int __init audit_register_class(int class, unsigned *list)
+{
+       __u32 *p = kzalloc(AUDIT_BITMASK_SIZE * sizeof(__u32), GFP_KERNEL);
+       if (!p)
+               return -ENOMEM;
+       while (*list != ~0U) {
+               unsigned n = *list++;
+               if (n >= AUDIT_BITMASK_SIZE * 32 - AUDIT_SYSCALL_CLASSES) {
+                       kfree(p);
+                       return -EINVAL;
+               }
+               p[AUDIT_WORD(n)] |= AUDIT_BIT(n);
+       }
+       if (class >= AUDIT_SYSCALL_CLASSES || classes[class]) {
+               kfree(p);
+               return -EINVAL;
+       }
+       classes[class] = p;
+       return 0;
+}
+
 /* Common user-space to kernel rule translation. */
 static inline struct audit_entry *audit_to_entry_common(struct audit_rule *rule)
 {
@@ -321,6 +345,22 @@ static inline struct audit_entry *audit_to_entry_common(struct audit_rule *rule)
        for (i = 0; i < AUDIT_BITMASK_SIZE; i++)
                entry->rule.mask[i] = rule->mask[i];
 
+       for (i = 0; i < AUDIT_SYSCALL_CLASSES; i++) {
+               int bit = AUDIT_BITMASK_SIZE * 32 - i - 1;
+               __u32 *p = &entry->rule.mask[AUDIT_WORD(bit)];
+               __u32 *class;
+
+               if (!(*p & AUDIT_BIT(bit)))
+                       continue;
+               *p &= ~AUDIT_BIT(bit);
+               class = classes[i];
+               if (class) {
+                       int j;
+                       for (j = 0; j < AUDIT_BITMASK_SIZE; j++)
+                               entry->rule.mask[j] |= class[j];
+               }
+       }
+
        return entry;
 
 exit_err:
@@ -469,11 +509,16 @@ static struct audit_entry *audit_data_to_entry(struct audit_rule_data *data,
                case AUDIT_ARG2:
                case AUDIT_ARG3:
                        break;
-               case AUDIT_SE_USER:
-               case AUDIT_SE_ROLE:
-               case AUDIT_SE_TYPE:
-               case AUDIT_SE_SEN:
-               case AUDIT_SE_CLR:
+               case AUDIT_SUBJ_USER:
+               case AUDIT_SUBJ_ROLE:
+               case AUDIT_SUBJ_TYPE:
+               case AUDIT_SUBJ_SEN:
+               case AUDIT_SUBJ_CLR:
+               case AUDIT_OBJ_USER:
+               case AUDIT_OBJ_ROLE:
+               case AUDIT_OBJ_TYPE:
+               case AUDIT_OBJ_LEV_LOW:
+               case AUDIT_OBJ_LEV_HIGH:
                        str = audit_unpack_string(&bufp, &remain, f->val);
                        if (IS_ERR(str))
                                goto exit_free;
@@ -511,6 +556,16 @@ static struct audit_entry *audit_data_to_entry(struct audit_rule_data *data,
                        if (err)
                                goto exit_free;
                        break;
+               case AUDIT_FILTERKEY:
+                       err = -EINVAL;
+                       if (entry->rule.filterkey || f->val > AUDIT_MAX_KEY_LEN)
+                               goto exit_free;
+                       str = audit_unpack_string(&bufp, &remain, f->val);
+                       if (IS_ERR(str))
+                               goto exit_free;
+                       entry->rule.buflen += f->val;
+                       entry->rule.filterkey = str;
+                       break;
                default:
                        goto exit_free;
                }
@@ -600,11 +655,16 @@ static struct audit_rule_data *audit_krule_to_data(struct audit_krule *krule)
                data->fields[i] = f->type;
                data->fieldflags[i] = f->op;
                switch(f->type) {
-               case AUDIT_SE_USER:
-               case AUDIT_SE_ROLE:
-               case AUDIT_SE_TYPE:
-               case AUDIT_SE_SEN:
-               case AUDIT_SE_CLR:
+               case AUDIT_SUBJ_USER:
+               case AUDIT_SUBJ_ROLE:
+               case AUDIT_SUBJ_TYPE:
+               case AUDIT_SUBJ_SEN:
+               case AUDIT_SUBJ_CLR:
+               case AUDIT_OBJ_USER:
+               case AUDIT_OBJ_ROLE:
+               case AUDIT_OBJ_TYPE:
+               case AUDIT_OBJ_LEV_LOW:
+               case AUDIT_OBJ_LEV_HIGH:
                        data->buflen += data->values[i] =
                                audit_pack_string(&bufp, f->se_str);
                        break;
@@ -612,6 +672,10 @@ static struct audit_rule_data *audit_krule_to_data(struct audit_krule *krule)
                        data->buflen += data->values[i] =
                                audit_pack_string(&bufp, krule->watch->path);
                        break;
+               case AUDIT_FILTERKEY:
+                       data->buflen += data->values[i] =
+                               audit_pack_string(&bufp, krule->filterkey);
+                       break;
                default:
                        data->values[i] = f->val;
                }
@@ -639,11 +703,16 @@ static int audit_compare_rule(struct audit_krule *a, struct audit_krule *b)
                        return 1;
 
                switch(a->fields[i].type) {
-               case AUDIT_SE_USER:
-               case AUDIT_SE_ROLE:
-               case AUDIT_SE_TYPE:
-               case AUDIT_SE_SEN:
-               case AUDIT_SE_CLR:
+               case AUDIT_SUBJ_USER:
+               case AUDIT_SUBJ_ROLE:
+               case AUDIT_SUBJ_TYPE:
+               case AUDIT_SUBJ_SEN:
+               case AUDIT_SUBJ_CLR:
+               case AUDIT_OBJ_USER:
+               case AUDIT_OBJ_ROLE:
+               case AUDIT_OBJ_TYPE:
+               case AUDIT_OBJ_LEV_LOW:
+               case AUDIT_OBJ_LEV_HIGH:
                        if (strcmp(a->fields[i].se_str, b->fields[i].se_str))
                                return 1;
                        break;
@@ -651,6 +720,11 @@ static int audit_compare_rule(struct audit_krule *a, struct audit_krule *b)
                        if (strcmp(a->watch->path, b->watch->path))
                                return 1;
                        break;
+               case AUDIT_FILTERKEY:
+                       /* both filterkeys exist based on above type compare */
+                       if (strcmp(a->filterkey, b->filterkey))
+                               return 1;
+                       break;
                default:
                        if (a->fields[i].val != b->fields[i].val)
                                return 1;
@@ -730,6 +804,7 @@ static struct audit_entry *audit_dupe_rule(struct audit_krule *old,
        u32 fcount = old->field_count;
        struct audit_entry *entry;
        struct audit_krule *new;
+       char *fk;
        int i, err = 0;
 
        entry = audit_init_entry(fcount);
@@ -753,13 +828,25 @@ static struct audit_entry *audit_dupe_rule(struct audit_krule *old,
         * the originals will all be freed when the old rule is freed. */
        for (i = 0; i < fcount; i++) {
                switch (new->fields[i].type) {
-               case AUDIT_SE_USER:
-               case AUDIT_SE_ROLE:
-               case AUDIT_SE_TYPE:
-               case AUDIT_SE_SEN:
-               case AUDIT_SE_CLR:
+               case AUDIT_SUBJ_USER:
+               case AUDIT_SUBJ_ROLE:
+               case AUDIT_SUBJ_TYPE:
+               case AUDIT_SUBJ_SEN:
+               case AUDIT_SUBJ_CLR:
+               case AUDIT_OBJ_USER:
+               case AUDIT_OBJ_ROLE:
+               case AUDIT_OBJ_TYPE:
+               case AUDIT_OBJ_LEV_LOW:
+               case AUDIT_OBJ_LEV_HIGH:
                        err = audit_dupe_selinux_field(&new->fields[i],
                                                       &old->fields[i]);
+                       break;
+               case AUDIT_FILTERKEY:
+                       fk = kstrdup(old->filterkey, GFP_KERNEL);
+                       if (unlikely(!fk))
+                               err = -ENOMEM;
+                       else
+                               new->filterkey = fk;
                }
                if (err) {
                        audit_free_rule(entry);
@@ -1245,6 +1332,34 @@ static void audit_list_rules(int pid, int seq, struct sk_buff_head *q)
                skb_queue_tail(q, skb);
 }
 
+/* Log rule additions and removals */
+static void audit_log_rule_change(uid_t loginuid, u32 sid, char *action,
+                                 struct audit_krule *rule, int res)
+{
+       struct audit_buffer *ab;
+
+       ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE);
+       if (!ab)
+               return;
+       audit_log_format(ab, "auid=%u", loginuid);
+       if (sid) {
+               char *ctx = NULL;
+               u32 len;
+               if (selinux_ctxid_to_string(sid, &ctx, &len))
+                       audit_log_format(ab, " ssid=%u", sid);
+               else
+                       audit_log_format(ab, " subj=%s", ctx);
+               kfree(ctx);
+       }
+       audit_log_format(ab, " %s rule key=", action);
+       if (rule->filterkey)
+               audit_log_untrustedstring(ab, rule->filterkey);
+       else
+               audit_log_format(ab, "(null)");
+       audit_log_format(ab, " list=%d res=%d", rule->listnr, res);
+       audit_log_end(ab);
+}
+
 /**
  * audit_receive_filter - apply all rules to the specified message type
  * @type: audit message type
@@ -1304,24 +1419,7 @@ int audit_receive_filter(int type, int pid, int uid, int seq, void *data,
 
                err = audit_add_rule(entry,
                                     &audit_filter_list[entry->rule.listnr]);
-
-               if (sid) {
-                       char *ctx = NULL;
-                       u32 len;
-                       if (selinux_ctxid_to_string(sid, &ctx, &len)) {
-                               /* Maybe call audit_panic? */
-                               audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE,
-                                "auid=%u ssid=%u add rule to list=%d res=%d",
-                                loginuid, sid, entry->rule.listnr, !err);
-                       } else
-                               audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE,
-                                "auid=%u subj=%s add rule to list=%d res=%d",
-                                loginuid, ctx, entry->rule.listnr, !err);
-                       kfree(ctx);
-               } else
-                       audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE,
-                               "auid=%u add rule to list=%d res=%d",
-                               loginuid, entry->rule.listnr, !err);
+               audit_log_rule_change(loginuid, sid, "add", &entry->rule, !err);
 
                if (err)
                        audit_free_rule(entry);
@@ -1337,24 +1435,8 @@ int audit_receive_filter(int type, int pid, int uid, int seq, void *data,
 
                err = audit_del_rule(entry,
                                     &audit_filter_list[entry->rule.listnr]);
-
-               if (sid) {
-                       char *ctx = NULL;
-                       u32 len;
-                       if (selinux_ctxid_to_string(sid, &ctx, &len)) {
-                               /* Maybe call audit_panic? */
-                               audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE,
-                                       "auid=%u ssid=%u remove rule from list=%d res=%d",
-                                        loginuid, sid, entry->rule.listnr, !err);
-                       } else
-                               audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE,
-                                       "auid=%u subj=%s remove rule from list=%d res=%d",
-                                        loginuid, ctx, entry->rule.listnr, !err);
-                       kfree(ctx);
-               } else
-                       audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE,
-                               "auid=%u remove rule from list=%d res=%d",
-                               loginuid, entry->rule.listnr, !err);
+               audit_log_rule_change(loginuid, sid, "remove", &entry->rule,
+                                     !err);
 
                audit_free_rule(entry);
                break;
@@ -1514,11 +1596,16 @@ static inline int audit_rule_has_selinux(struct audit_krule *rule)
        for (i = 0; i < rule->field_count; i++) {
                struct audit_field *f = &rule->fields[i];
                switch (f->type) {
-               case AUDIT_SE_USER:
-               case AUDIT_SE_ROLE:
-               case AUDIT_SE_TYPE:
-               case AUDIT_SE_SEN:
-               case AUDIT_SE_CLR:
+               case AUDIT_SUBJ_USER:
+               case AUDIT_SUBJ_ROLE:
+               case AUDIT_SUBJ_TYPE:
+               case AUDIT_SUBJ_SEN:
+               case AUDIT_SUBJ_CLR:
+               case AUDIT_OBJ_USER:
+               case AUDIT_OBJ_ROLE:
+               case AUDIT_OBJ_TYPE:
+               case AUDIT_OBJ_LEV_LOW:
+               case AUDIT_OBJ_LEV_HIGH:
                        return 1;
                }
        }
index dc5e3f01efe747c9d1816895ae1a1e40fb527489..ae40ac8c39e7246c5d2b11c96429073f6daffbc0 100644 (file)
@@ -186,6 +186,7 @@ struct audit_context {
        int                 auditable;  /* 1 if record should be written */
        int                 name_count;
        struct audit_names  names[AUDIT_NAMES];
+       char *              filterkey;  /* key for rule that triggered record */
        struct dentry *     pwd;
        struct vfsmount *   pwdmnt;
        struct audit_context *previous; /* For nested syscalls */
@@ -320,11 +321,11 @@ static int audit_filter_rules(struct task_struct *tsk,
                        if (ctx)
                                result = audit_comparator(ctx->loginuid, f->op, f->val);
                        break;
-               case AUDIT_SE_USER:
-               case AUDIT_SE_ROLE:
-               case AUDIT_SE_TYPE:
-               case AUDIT_SE_SEN:
-               case AUDIT_SE_CLR:
+               case AUDIT_SUBJ_USER:
+               case AUDIT_SUBJ_ROLE:
+               case AUDIT_SUBJ_TYPE:
+               case AUDIT_SUBJ_SEN:
+               case AUDIT_SUBJ_CLR:
                        /* NOTE: this may return negative values indicating
                           a temporary error.  We simply treat this as a
                           match for now to avoid losing information that
@@ -341,6 +342,46 @@ static int audit_filter_rules(struct task_struct *tsk,
                                                                  ctx);
                        }
                        break;
+               case AUDIT_OBJ_USER:
+               case AUDIT_OBJ_ROLE:
+               case AUDIT_OBJ_TYPE:
+               case AUDIT_OBJ_LEV_LOW:
+               case AUDIT_OBJ_LEV_HIGH:
+                       /* The above note for AUDIT_SUBJ_USER...AUDIT_SUBJ_CLR
+                          also applies here */
+                       if (f->se_rule) {
+                               /* Find files that match */
+                               if (name) {
+                                       result = selinux_audit_rule_match(
+                                                  name->osid, f->type, f->op,
+                                                  f->se_rule, ctx);
+                               } else if (ctx) {
+                                       for (j = 0; j < ctx->name_count; j++) {
+                                               if (selinux_audit_rule_match(
+                                                     ctx->names[j].osid,
+                                                     f->type, f->op,
+                                                     f->se_rule, ctx)) {
+                                                       ++result;
+                                                       break;
+                                               }
+                                       }
+                               }
+                               /* Find ipc objects that match */
+                               if (ctx) {
+                                       struct audit_aux_data *aux;
+                                       for (aux = ctx->aux; aux;
+                                            aux = aux->next) {
+                                               if (aux->type == AUDIT_IPC) {
+                                                       struct audit_aux_data_ipcctl *axi = (void *)aux;
+                                                       if (selinux_audit_rule_match(axi->osid, f->type, f->op, f->se_rule, ctx)) {
+                                                               ++result;
+                                                               break;
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+                       break;
                case AUDIT_ARG0:
                case AUDIT_ARG1:
                case AUDIT_ARG2:
@@ -348,11 +389,17 @@ static int audit_filter_rules(struct task_struct *tsk,
                        if (ctx)
                                result = audit_comparator(ctx->argv[f->type-AUDIT_ARG0], f->op, f->val);
                        break;
+               case AUDIT_FILTERKEY:
+                       /* ignore this field for filtering */
+                       result = 1;
+                       break;
                }
 
                if (!result)
                        return 0;
        }
+       if (rule->filterkey)
+               ctx->filterkey = kstrdup(rule->filterkey, GFP_ATOMIC);
        switch (rule->action) {
        case AUDIT_NEVER:    *state = AUDIT_DISABLED;       break;
        case AUDIT_ALWAYS:   *state = AUDIT_RECORD_CONTEXT; break;
@@ -627,6 +674,7 @@ static inline void audit_free_context(struct audit_context *context)
                }
                audit_free_names(context);
                audit_free_aux(context);
+               kfree(context->filterkey);
                kfree(context);
                context  = previous;
        } while (context);
@@ -735,6 +783,11 @@ static void audit_log_exit(struct audit_context *context, struct task_struct *ts
                  context->euid, context->suid, context->fsuid,
                  context->egid, context->sgid, context->fsgid, tty);
        audit_log_task_info(ab, tsk);
+       if (context->filterkey) {
+               audit_log_format(ab, " key=");
+               audit_log_untrustedstring(ab, context->filterkey);
+       } else
+               audit_log_format(ab, " key=(null)");
        audit_log_end(ab);
 
        for (aux = context->aux; aux; aux = aux->next) {
@@ -1060,6 +1113,8 @@ void audit_syscall_exit(int valid, long return_code)
        } else {
                audit_free_names(context);
                audit_free_aux(context);
+               kfree(context->filterkey);
+               context->filterkey = NULL;
                tsk->audit_context = context;
        }
 }
index 1a4d8a40d3f9e120f204b59c060cd3e46232e70f..c7685ad00a97c4ddfd2f47029f0b5b4342da80be 100644 (file)
@@ -46,7 +46,7 @@ asmlinkage long sys_capget(cap_user_header_t header, cap_user_data_t dataptr)
      int ret = 0;
      pid_t pid;
      __u32 version;
-     task_t *target;
+     struct task_struct *target;
      struct __user_cap_data_struct data;
 
      if (get_user(version, &header->version))
@@ -96,7 +96,7 @@ static inline int cap_set_pg(int pgrp, kernel_cap_t *effective,
                              kernel_cap_t *inheritable,
                              kernel_cap_t *permitted)
 {
-       task_t *g, *target;
+       struct task_struct *g, *target;
        int ret = -EPERM;
        int found = 0;
 
@@ -128,7 +128,7 @@ static inline int cap_set_all(kernel_cap_t *effective,
                               kernel_cap_t *inheritable,
                               kernel_cap_t *permitted)
 {
-     task_t *g, *target;
+     struct task_struct *g, *target;
      int ret = -EPERM;
      int found = 0;
 
@@ -172,7 +172,7 @@ asmlinkage long sys_capset(cap_user_header_t header, const cap_user_data_t data)
 {
      kernel_cap_t inheritable, permitted, effective;
      __u32 version;
-     task_t *target;
+     struct task_struct *target;
      int ret;
      pid_t pid;
 
index 009e1ebdcb88e57b62d64daafb4be1be9468a514..f9e31974f4addf262cee19d1049f6b1fd55bc47e 100644 (file)
@@ -23,7 +23,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/proc_fs.h>
index 1535af3a912d9d7e6a21fb7d6c610e808c1cddda..c232dc0774389378c9fc8130ac84fb4067835f43 100644 (file)
@@ -18,7 +18,6 @@
  *  distribution for more details.
  */
 
-#include <linux/config.h>
 #include <linux/cpu.h>
 #include <linux/cpumask.h>
 #include <linux/cpuset.h>
@@ -1064,7 +1063,7 @@ static int update_flag(cpuset_flagbits_t bit, struct cpuset *cs, char *buf)
 }
 
 /*
- * Frequency meter - How fast is some event occuring?
+ * Frequency meter - How fast is some event occurring?
  *
  * These routines manage a digitally filtered, constant time based,
  * event frequency meter.  There are four routines:
index c01cead2cfd61978cb342853651fe9b158365976..3c2eaea66b1e16347bcd564b0c492b8f026dcf21 100644 (file)
@@ -7,7 +7,6 @@
  * 2001-05-06  Complete rewrite,  Christoph Hellwig (hch@infradead.org)
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/kmod.h>
index ab06b9f88f64677ca036dea0285f740ccb54e1e9..6664c084783d49c0a80faf22f5b84fad6015fe0b 100644 (file)
@@ -4,7 +4,6 @@
  *  Copyright (C) 1991, 1992  Linus Torvalds
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
@@ -135,8 +134,8 @@ static void delayed_put_task_struct(struct rcu_head *rhp)
 
 void release_task(struct task_struct * p)
 {
+       struct task_struct *leader;
        int zap_leader;
-       task_t *leader;
 repeat:
        atomic_dec(&p->user->processes);
        write_lock_irq(&tasklist_lock);
@@ -210,7 +209,7 @@ out:
  *
  * "I ask you, have you ever known what it is to be an orphan?"
  */
-static int will_become_orphaned_pgrp(int pgrp, task_t *ignored_task)
+static int will_become_orphaned_pgrp(int pgrp, struct task_struct *ignored_task)
 {
        struct task_struct *p;
        int ret = 1;
@@ -583,7 +582,8 @@ static void exit_mm(struct task_struct * tsk)
        mmput(mm);
 }
 
-static inline void choose_new_parent(task_t *p, task_t *reaper)
+static inline void
+choose_new_parent(struct task_struct *p, struct task_struct *reaper)
 {
        /*
         * Make sure we're not reparenting to ourselves and that
@@ -593,7 +593,8 @@ static inline void choose_new_parent(task_t *p, task_t *reaper)
        p->real_parent = reaper;
 }
 
-static void reparent_thread(task_t *p, task_t *father, int traced)
+static void
+reparent_thread(struct task_struct *p, struct task_struct *father, int traced)
 {
        /* We don't want people slaying init.  */
        if (p->exit_signal != -1)
@@ -657,8 +658,8 @@ static void reparent_thread(task_t *p, task_t *father, int traced)
  * group, and if no such member exists, give it to
  * the global child reaper process (ie "init")
  */
-static void forget_original_parent(struct task_struct * father,
-                                         struct list_head *to_release)
+static void
+forget_original_parent(struct task_struct *father, struct list_head *to_release)
 {
        struct task_struct *p, *reaper = father;
        struct list_head *_p, *_n;
@@ -681,7 +682,7 @@ static void forget_original_parent(struct task_struct * father,
         */
        list_for_each_safe(_p, _n, &father->children) {
                int ptrace;
-               p = list_entry(_p,struct task_struct,sibling);
+               p = list_entry(_p, struct task_struct, sibling);
 
                ptrace = p->ptrace;
 
@@ -710,7 +711,7 @@ static void forget_original_parent(struct task_struct * father,
                        list_add(&p->ptrace_list, to_release);
        }
        list_for_each_safe(_p, _n, &father->ptrace_children) {
-               p = list_entry(_p,struct task_struct,ptrace_list);
+               p = list_entry(_p, struct task_struct, ptrace_list);
                choose_new_parent(p, reaper);
                reparent_thread(p, father, 1);
        }
@@ -830,7 +831,7 @@ static void exit_notify(struct task_struct *tsk)
 
        list_for_each_safe(_p, _n, &ptrace_dead) {
                list_del_init(_p);
-               t = list_entry(_p,struct task_struct,ptrace_list);
+               t = list_entry(_p, struct task_struct, ptrace_list);
                release_task(t);
        }
 
@@ -934,10 +935,9 @@ fastcall NORET_TYPE void do_exit(long code)
        if (unlikely(current->pi_state_cache))
                kfree(current->pi_state_cache);
        /*
-        * If DEBUG_MUTEXES is on, make sure we are holding no locks:
+        * Make sure we are holding no locks:
         */
-       mutex_debug_check_no_locks_held(tsk);
-       rt_mutex_debug_check_no_locks_held(tsk);
+       debug_check_no_locks_held(tsk);
 
        if (tsk->io_context)
                exit_io_context();
@@ -1012,7 +1012,7 @@ asmlinkage void sys_exit_group(int error_code)
        do_group_exit((error_code & 0xff) << 8);
 }
 
-static int eligible_child(pid_t pid, int options, task_t *p)
+static int eligible_child(pid_t pid, int options, struct task_struct *p)
 {
        if (pid > 0) {
                if (p->pid != pid)
@@ -1053,12 +1053,13 @@ static int eligible_child(pid_t pid, int options, task_t *p)
        return 1;
 }
 
-static int wait_noreap_copyout(task_t *p, pid_t pid, uid_t uid,
+static int wait_noreap_copyout(struct task_struct *p, pid_t pid, uid_t uid,
                               int why, int status,
                               struct siginfo __user *infop,
                               struct rusage __user *rusagep)
 {
        int retval = rusagep ? getrusage(p, RUSAGE_BOTH, rusagep) : 0;
+
        put_task_struct(p);
        if (!retval)
                retval = put_user(SIGCHLD, &infop->si_signo);
@@ -1083,7 +1084,7 @@ static int wait_noreap_copyout(task_t *p, pid_t pid, uid_t uid,
  * the lock and this task is uninteresting.  If we return nonzero, we have
  * released the lock and the system call should return.
  */
-static int wait_task_zombie(task_t *p, int noreap,
+static int wait_task_zombie(struct task_struct *p, int noreap,
                            struct siginfo __user *infop,
                            int __user *stat_addr, struct rusage __user *ru)
 {
@@ -1245,8 +1246,8 @@ static int wait_task_zombie(task_t *p, int noreap,
  * the lock and this task is uninteresting.  If we return nonzero, we have
  * released the lock and the system call should return.
  */
-static int wait_task_stopped(task_t *p, int delayed_group_leader, int noreap,
-                            struct siginfo __user *infop,
+static int wait_task_stopped(struct task_struct *p, int delayed_group_leader,
+                            int noreap, struct siginfo __user *infop,
                             int __user *stat_addr, struct rusage __user *ru)
 {
        int retval, exit_code;
@@ -1360,7 +1361,7 @@ bail_ref:
  * the lock and this task is uninteresting.  If we return nonzero, we have
  * released the lock and the system call should return.
  */
-static int wait_task_continued(task_t *p, int noreap,
+static int wait_task_continued(struct task_struct *p, int noreap,
                               struct siginfo __user *infop,
                               int __user *stat_addr, struct rusage __user *ru)
 {
@@ -1446,7 +1447,7 @@ repeat:
                int ret;
 
                list_for_each(_p,&tsk->children) {
-                       p = list_entry(_p,struct task_struct,sibling);
+                       p = list_entry(_p, struct task_struct, sibling);
 
                        ret = eligible_child(pid, options, p);
                        if (!ret)
index 628198a4f28a722b25b37c26ecbd401c67919a8d..56e4e07e45f7f1098ab692dfe2eb7bf1f277a1e4 100644 (file)
@@ -11,7 +11,6 @@
  * management can be a bitch. See 'mm/memory.c': 'copy_page_range()'
  */
 
-#include <linux/config.h>
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/unistd.h>
@@ -194,7 +193,10 @@ static inline int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
 
        down_write(&oldmm->mmap_sem);
        flush_cache_mm(oldmm);
-       down_write(&mm->mmap_sem);
+       /*
+        * Not linked in yet - no deadlock potential:
+        */
+       down_write_nested(&mm->mmap_sem, SINGLE_DEPTH_NESTING);
 
        mm->locked_vm = 0;
        mm->mmap = NULL;
@@ -920,10 +922,6 @@ static inline void rt_mutex_init_task(struct task_struct *p)
        spin_lock_init(&p->pi_lock);
        plist_head_init(&p->pi_waiters, &p->pi_lock);
        p->pi_blocked_on = NULL;
-# ifdef CONFIG_DEBUG_RT_MUTEXES
-       spin_lock_init(&p->held_list_lock);
-       INIT_LIST_HEAD(&p->held_list_head);
-# endif
 #endif
 }
 
@@ -935,13 +933,13 @@ static inline void rt_mutex_init_task(struct task_struct *p)
  * parts of the process environment (as per the clone
  * flags). The actual kick-off is left to the caller.
  */
-static task_t *copy_process(unsigned long clone_flags,
-                                unsigned long stack_start,
-                                struct pt_regs *regs,
-                                unsigned long stack_size,
-                                int __user *parent_tidptr,
-                                int __user *child_tidptr,
-                                int pid)
+static struct task_struct *copy_process(unsigned long clone_flags,
+                                       unsigned long stack_start,
+                                       struct pt_regs *regs,
+                                       unsigned long stack_size,
+                                       int __user *parent_tidptr,
+                                       int __user *child_tidptr,
+                                       int pid)
 {
        int retval;
        struct task_struct *p = NULL;
@@ -973,6 +971,10 @@ static task_t *copy_process(unsigned long clone_flags,
        if (!p)
                goto fork_out;
 
+#ifdef CONFIG_TRACE_IRQFLAGS
+       DEBUG_LOCKS_WARN_ON(!p->hardirqs_enabled);
+       DEBUG_LOCKS_WARN_ON(!p->softirqs_enabled);
+#endif
        retval = -EAGAIN;
        if (atomic_read(&p->user->processes) >=
                        p->signal->rlim[RLIMIT_NPROC].rlim_cur) {
@@ -1047,6 +1049,26 @@ static task_t *copy_process(unsigned long clone_flags,
        }
        mpol_fix_fork_child_flag(p);
 #endif
+#ifdef CONFIG_TRACE_IRQFLAGS
+       p->irq_events = 0;
+       p->hardirqs_enabled = 0;
+       p->hardirq_enable_ip = 0;
+       p->hardirq_enable_event = 0;
+       p->hardirq_disable_ip = _THIS_IP_;
+       p->hardirq_disable_event = 0;
+       p->softirqs_enabled = 1;
+       p->softirq_enable_ip = _THIS_IP_;
+       p->softirq_enable_event = 0;
+       p->softirq_disable_ip = 0;
+       p->softirq_disable_event = 0;
+       p->hardirq_context = 0;
+       p->softirq_context = 0;
+#endif
+#ifdef CONFIG_LOCKDEP
+       p->lockdep_depth = 0; /* no locks held yet */
+       p->curr_chain_key = 0;
+       p->lockdep_recursion = 0;
+#endif
 
        rt_mutex_init_task(p);
 
@@ -1272,9 +1294,9 @@ struct pt_regs * __devinit __attribute__((weak)) idle_regs(struct pt_regs *regs)
        return regs;
 }
 
-task_t * __devinit fork_idle(int cpu)
+struct task_struct * __devinit fork_idle(int cpu)
 {
-       task_t *task;
+       struct task_struct *task;
        struct pt_regs regs;
 
        task = copy_process(CLONE_VM, 0, idle_regs(&regs), 0, NULL, NULL, 0);
index 6c91f938005db0719bac62a643fff9b411b7f594..1dc98e4dd287ec95872c7c771aab7f14e0d9ca42 100644 (file)
@@ -606,6 +606,22 @@ static int unlock_futex_pi(u32 __user *uaddr, u32 uval)
        return 0;
 }
 
+/*
+ * Express the locking dependencies for lockdep:
+ */
+static inline void
+double_lock_hb(struct futex_hash_bucket *hb1, struct futex_hash_bucket *hb2)
+{
+       if (hb1 <= hb2) {
+               spin_lock(&hb1->lock);
+               if (hb1 < hb2)
+                       spin_lock_nested(&hb2->lock, SINGLE_DEPTH_NESTING);
+       } else { /* hb1 > hb2 */
+               spin_lock(&hb2->lock);
+               spin_lock_nested(&hb1->lock, SINGLE_DEPTH_NESTING);
+       }
+}
+
 /*
  * Wake up all waiters hashed on the physical page that is mapped
  * to this virtual address:
@@ -630,8 +646,10 @@ static int futex_wake(u32 __user *uaddr, int nr_wake)
 
        list_for_each_entry_safe(this, next, head, list) {
                if (match_futex (&this->key, &key)) {
-                       if (this->pi_state)
-                               return -EINVAL;
+                       if (this->pi_state) {
+                               ret = -EINVAL;
+                               break;
+                       }
                        wake_futex(this);
                        if (++ret >= nr_wake)
                                break;
@@ -672,11 +690,7 @@ retryfull:
        hb2 = hash_futex(&key2);
 
 retry:
-       if (hb1 < hb2)
-               spin_lock(&hb1->lock);
-       spin_lock(&hb2->lock);
-       if (hb1 > hb2)
-               spin_lock(&hb1->lock);
+       double_lock_hb(hb1, hb2);
 
        op_ret = futex_atomic_op_inuser(op, uaddr2);
        if (unlikely(op_ret < 0)) {
@@ -785,11 +799,7 @@ static int futex_requeue(u32 __user *uaddr1, u32 __user *uaddr2,
        hb1 = hash_futex(&key1);
        hb2 = hash_futex(&key2);
 
-       if (hb1 < hb2)
-               spin_lock(&hb1->lock);
-       spin_lock(&hb2->lock);
-       if (hb1 > hb2)
-               spin_lock(&hb1->lock);
+       double_lock_hb(hb1, hb2);
 
        if (likely(cmpval != NULL)) {
                u32 curval;
@@ -1208,7 +1218,7 @@ static int do_futex_lock_pi(u32 __user *uaddr, int detect, int trylock,
        }
 
        down_read(&curr->mm->mmap_sem);
-       hb = queue_lock(&q, -1, NULL);
+       spin_lock(q.lock_ptr);
 
        /*
         * Got the lock. We might not be the anticipated owner if we
index 8d3dc29ef41ae1fb616d4d8765cb1d077c862852..d17766d40dab781ea1d189e715de32b61a4972ed 100644 (file)
@@ -669,7 +669,7 @@ static int hrtimer_wakeup(struct hrtimer *timer)
        return HRTIMER_NORESTART;
 }
 
-void hrtimer_init_sleeper(struct hrtimer_sleeper *sl, task_t *task)
+void hrtimer_init_sleeper(struct hrtimer_sleeper *sl, struct task_struct *task)
 {
        sl->timer.function = hrtimer_wakeup;
        sl->task = task;
@@ -782,8 +782,10 @@ static void __devinit init_hrtimers_cpu(int cpu)
        struct hrtimer_base *base = per_cpu(hrtimer_bases, cpu);
        int i;
 
-       for (i = 0; i < MAX_HRTIMER_BASES; i++, base++)
+       for (i = 0; i < MAX_HRTIMER_BASES; i++, base++) {
                spin_lock_init(&base->lock);
+               lockdep_set_class(&base->lock, &base->lock_key);
+       }
 }
 
 #ifdef CONFIG_HOTPLUG_CPU
index 4a0952d9458b481f12abd61133dbd38e57a33573..9336f2e89e40210a3265092135c3060f4fcf251c 100644 (file)
@@ -261,10 +261,13 @@ handle_level_irq(unsigned int irq, struct irq_desc *desc, struct pt_regs *regs)
         * keep it masked and get out of here
         */
        action = desc->action;
-       if (unlikely(!action || (desc->status & IRQ_DISABLED)))
+       if (unlikely(!action || (desc->status & IRQ_DISABLED))) {
+               desc->status |= IRQ_PENDING;
                goto out;
+       }
 
        desc->status |= IRQ_INPROGRESS;
+       desc->status &= ~IRQ_PENDING;
        spin_unlock(&desc->lock);
 
        action_ret = handle_IRQ_event(irq, regs, action);
@@ -462,9 +465,18 @@ __set_irq_handler(unsigned int irq,
        if (!handle)
                handle = handle_bad_irq;
 
-       if (is_chained && desc->chip == &no_irq_chip)
-               printk(KERN_WARNING "Trying to install "
-                      "chained interrupt type for IRQ%d\n", irq);
+       if (desc->chip == &no_irq_chip) {
+               printk(KERN_WARNING "Trying to install %sinterrupt handler "
+                      "for IRQ%d\n", is_chained ? "chained " : " ", irq);
+               /*
+                * Some ARM implementations install a handler for really dumb
+                * interrupt hardware without setting an irq_chip. This worked
+                * with the ARM no_irq_chip but the check in setup_irq would
+                * prevent us to setup the interrupt at all. Switch it to
+                * dummy_irq_chip for easy transition.
+                */
+               desc->chip = &dummy_irq_chip;
+       }
 
        spin_lock_irqsave(&desc->lock, flags);
 
index 5a360dd4331b0505a6f4e54c0c26317f23d3c189..fc4e906aedbd77ef5cf7057dcb8b3d089b240e14 100644 (file)
@@ -91,6 +91,22 @@ struct irq_chip no_irq_chip = {
        .end            = noop,
 };
 
+/*
+ * Generic dummy implementation which can be used for
+ * real dumb interrupt sources
+ */
+struct irq_chip dummy_irq_chip = {
+       .name           = "dummy",
+       .startup        = noop_ret,
+       .shutdown       = noop,
+       .enable         = noop,
+       .disable        = noop,
+       .ack            = noop,
+       .mask           = noop,
+       .unmask         = noop,
+       .end            = noop,
+};
+
 /*
  * Special, empty irq handler:
  */
@@ -113,8 +129,10 @@ irqreturn_t handle_IRQ_event(unsigned int irq, struct pt_regs *regs,
        irqreturn_t ret, retval = IRQ_NONE;
        unsigned int status = 0;
 
-       if (!(action->flags & SA_INTERRUPT))
-               local_irq_enable();
+       handle_dynamic_tick(action);
+
+       if (!(action->flags & IRQF_DISABLED))
+               local_irq_enable_in_hardirq();
 
        do {
                ret = action->handler(irq, action->dev_id, regs);
@@ -124,7 +142,7 @@ irqreturn_t handle_IRQ_event(unsigned int irq, struct pt_regs *regs,
                action = action->next;
        } while (action);
 
-       if (status & SA_SAMPLE_RANDOM)
+       if (status & IRQF_SAMPLE_RANDOM)
                add_interrupt_randomness(irq);
        local_irq_disable();
 
@@ -231,3 +249,19 @@ out:
        return 1;
 }
 
+#ifdef CONFIG_TRACE_IRQFLAGS
+
+/*
+ * lockdep: we want to handle all irq_desc locks as a single lock-class:
+ */
+static struct lock_class_key irq_desc_lock_class;
+
+void early_init_irq_lock_class(void)
+{
+       int i;
+
+       for (i = 0; i < NR_IRQS; i++)
+               lockdep_set_class(&irq_desc[i].lock, &irq_desc_lock_class);
+}
+
+#endif
index 9eb1d518ee1c8dc8da68f7903cd207482352e8fa..4e461438e48bfe687f4ced338a0f2c69791fb33e 100644 (file)
@@ -7,7 +7,6 @@
  * This file contains driver APIs to the irq subsystem.
  */
 
-#include <linux/config.h>
 #include <linux/irq.h>
 #include <linux/module.h>
 #include <linux/random.h>
@@ -115,7 +114,7 @@ void enable_irq(unsigned int irq)
        spin_lock_irqsave(&desc->lock, flags);
        switch (desc->depth) {
        case 0:
-               printk(KERN_WARNING "Unablanced enable_irq(%d)\n", irq);
+               printk(KERN_WARNING "Unbalanced enable for IRQ %d\n", irq);
                WARN_ON(1);
                break;
        case 1: {
@@ -168,7 +167,7 @@ int can_request_irq(unsigned int irq, unsigned long irqflags)
 
        action = irq_desc[irq].action;
        if (action)
-               if (irqflags & action->flags & SA_SHIRQ)
+               if (irqflags & action->flags & IRQF_SHARED)
                        action = NULL;
 
        return !action;
@@ -206,7 +205,7 @@ int setup_irq(unsigned int irq, struct irqaction *new)
         * so we have to be careful not to interfere with a
         * running system.
         */
-       if (new->flags & SA_SAMPLE_RANDOM) {
+       if (new->flags & IRQF_SAMPLE_RANDOM) {
                /*
                 * This function might sleep, we want to call it first,
                 * outside of the atomic block.
@@ -228,16 +227,17 @@ int setup_irq(unsigned int irq, struct irqaction *new)
                /*
                 * Can't share interrupts unless both agree to and are
                 * the same type (level, edge, polarity). So both flag
-                * fields must have SA_SHIRQ set and the bits which
+                * fields must have IRQF_SHARED set and the bits which
                 * set the trigger type must match.
                 */
-               if (!((old->flags & new->flags) & SA_SHIRQ) ||
-                   ((old->flags ^ new->flags) & SA_TRIGGER_MASK))
+               if (!((old->flags & new->flags) & IRQF_SHARED) ||
+                   ((old->flags ^ new->flags) & IRQF_TRIGGER_MASK))
                        goto mismatch;
 
-#if defined(CONFIG_IRQ_PER_CPU) && defined(SA_PERCPU_IRQ)
+#if defined(CONFIG_IRQ_PER_CPU)
                /* All handlers must agree on per-cpuness */
-               if ((old->flags & IRQ_PER_CPU) != (new->flags & IRQ_PER_CPU))
+               if ((old->flags & IRQF_PERCPU) !=
+                   (new->flags & IRQF_PERCPU))
                        goto mismatch;
 #endif
 
@@ -250,26 +250,27 @@ int setup_irq(unsigned int irq, struct irqaction *new)
        }
 
        *p = new;
-#if defined(CONFIG_IRQ_PER_CPU) && defined(SA_PERCPU_IRQ)
-       if (new->flags & SA_PERCPU_IRQ)
+#if defined(CONFIG_IRQ_PER_CPU)
+       if (new->flags & IRQF_PERCPU)
                desc->status |= IRQ_PER_CPU;
 #endif
        if (!shared) {
                irq_chip_set_defaults(desc->chip);
 
                /* Setup the type (level, edge polarity) if configured: */
-               if (new->flags & SA_TRIGGER_MASK) {
+               if (new->flags & IRQF_TRIGGER_MASK) {
                        if (desc->chip && desc->chip->set_type)
                                desc->chip->set_type(irq,
-                                               new->flags & SA_TRIGGER_MASK);
+                                               new->flags & IRQF_TRIGGER_MASK);
                        else
                                /*
-                                * SA_TRIGGER_* but the PIC does not support
+                                * IRQF_TRIGGER_* but the PIC does not support
                                 * multiple flow-types?
                                 */
-                               printk(KERN_WARNING "setup_irq(%d) SA_TRIGGER"
-                                      "set. No set_type function available\n",
-                                      irq);
+                               printk(KERN_WARNING "No IRQF_TRIGGER set_type "
+                                      "function for IRQ %d (%s)\n", irq,
+                                      desc->chip ? desc->chip->name :
+                                      "unknown");
                } else
                        compat_irq_chip_set_default_handler(desc);
 
@@ -298,8 +299,8 @@ int setup_irq(unsigned int irq, struct irqaction *new)
 
 mismatch:
        spin_unlock_irqrestore(&desc->lock, flags);
-       if (!(new->flags & SA_PROBEIRQ)) {
-               printk(KERN_ERR "%s: irq handler mismatch\n", __FUNCTION__);
+       if (!(new->flags & IRQF_PROBE_SHARED)) {
+               printk(KERN_ERR "IRQ handler type mismatch for IRQ %d\n", irq);
                dump_stack();
        }
        return -EBUSY;
@@ -366,7 +367,7 @@ void free_irq(unsigned int irq, void *dev_id)
                        kfree(action);
                        return;
                }
-               printk(KERN_ERR "Trying to free free IRQ%d\n", irq);
+               printk(KERN_ERR "Trying to free already-free IRQ %d\n", irq);
                spin_unlock_irqrestore(&desc->lock, flags);
                return;
        }
@@ -397,9 +398,9 @@ EXPORT_SYMBOL(free_irq);
  *
  *     Flags:
  *
- *     SA_SHIRQ                Interrupt is shared
- *     SA_INTERRUPT            Disable local interrupts while processing
- *     SA_SAMPLE_RANDOM        The interrupt can be used for entropy
+ *     IRQF_SHARED             Interrupt is shared
+ *     IRQF_DISABLED   Disable local interrupts while processing
+ *     IRQF_SAMPLE_RANDOM      The interrupt can be used for entropy
  *
  */
 int request_irq(unsigned int irq,
@@ -409,13 +410,19 @@ int request_irq(unsigned int irq,
        struct irqaction *action;
        int retval;
 
+#ifdef CONFIG_LOCKDEP
+       /*
+        * Lockdep wants atomic interrupt handlers:
+        */
+       irqflags |= SA_INTERRUPT;
+#endif
        /*
         * Sanity-check: shared interrupts must pass in a real dev-ID,
         * otherwise we'll have trouble later trying to figure out
         * which interrupt is which (messes up the interrupt freeing
         * logic etc).
         */
-       if ((irqflags & SA_SHIRQ) && !dev_id)
+       if ((irqflags & IRQF_SHARED) && !dev_id)
                return -EINVAL;
        if (irq >= NR_IRQS)
                return -EINVAL;
index b483deed311cf7a3111fd31aafd938a1aae1f9f7..417e98092cf20a6e843c6ae973a6ee4c216cd435 100644 (file)
@@ -36,7 +36,7 @@ static int misrouted_irq(int irq, struct pt_regs *regs)
                         * Already running: If it is shared get the other
                         * CPU to go looking for our mystery interrupt too
                         */
-                       if (desc->action && (desc->action->flags & SA_SHIRQ))
+                       if (desc->action && (desc->action->flags & IRQF_SHARED))
                                desc->status |= IRQ_PENDING;
                        spin_unlock(&desc->lock);
                        continue;
@@ -48,7 +48,7 @@ static int misrouted_irq(int irq, struct pt_regs *regs)
 
                while (action) {
                        /* Only shared IRQ handlers are safe to call */
-                       if (action->flags & SA_SHIRQ) {
+                       if (action->flags & IRQF_SHARED) {
                                if (action->handler(i, action->dev_id, regs) ==
                                                IRQ_HANDLED)
                                        ok = 1;
index 20a997c73c3d0c3951c66f8b5c8e6fd61f51abc3..1d32defa38abe5ab08114281e93d92ccf947ecb3 100644 (file)
@@ -20,7 +20,6 @@
 */
 #define __KERNEL_SYSCALLS__
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/syscalls.h>
@@ -234,7 +233,7 @@ static void __call_usermodehelper(void *data)
 int call_usermodehelper_keys(char *path, char **argv, char **envp,
                             struct key *session_keyring, int wait)
 {
-       DECLARE_COMPLETION(done);
+       DECLARE_COMPLETION_ONSTACK(done);
        struct subprocess_info sub_info = {
                .complete       = &done,
                .path           = path,
index 9e28478a17a50a0081503f7ae54cd25eb6142d44..e0ffe4ab091785d36bccdec062a1fc2cb26c4936 100644 (file)
@@ -8,7 +8,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kobject.h>
 #include <linux/string.h>
 #include <linux/sysfs.h>
diff --git a/kernel/lockdep.c b/kernel/lockdep.c
new file mode 100644 (file)
index 0000000..f32ca78
--- /dev/null
@@ -0,0 +1,2702 @@
+/*
+ * kernel/lockdep.c
+ *
+ * Runtime locking correctness validator
+ *
+ * Started by Ingo Molnar:
+ *
+ *  Copyright (C) 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
+ *
+ * this code maps all the lock dependencies as they occur in a live kernel
+ * and will warn about the following classes of locking bugs:
+ *
+ * - lock inversion scenarios
+ * - circular lock dependencies
+ * - hardirq/softirq safe/unsafe locking bugs
+ *
+ * Bugs are reported even if the current locking scenario does not cause
+ * any deadlock at this point.
+ *
+ * I.e. if anytime in the past two locks were taken in a different order,
+ * even if it happened for another task, even if those were different
+ * locks (but of the same class as this lock), this code will detect it.
+ *
+ * Thanks to Arjan van de Ven for coming up with the initial idea of
+ * mapping lock dependencies runtime.
+ */
+#include <linux/mutex.h>
+#include <linux/sched.h>
+#include <linux/delay.h>
+#include <linux/module.h>
+#include <linux/proc_fs.h>
+#include <linux/seq_file.h>
+#include <linux/spinlock.h>
+#include <linux/kallsyms.h>
+#include <linux/interrupt.h>
+#include <linux/stacktrace.h>
+#include <linux/debug_locks.h>
+#include <linux/irqflags.h>
+
+#include <asm/sections.h>
+
+#include "lockdep_internals.h"
+
+/*
+ * hash_lock: protects the lockdep hashes and class/list/hash allocators.
+ *
+ * This is one of the rare exceptions where it's justified
+ * to use a raw spinlock - we really dont want the spinlock
+ * code to recurse back into the lockdep code.
+ */
+static raw_spinlock_t hash_lock = (raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED;
+
+static int lockdep_initialized;
+
+unsigned long nr_list_entries;
+static struct lock_list list_entries[MAX_LOCKDEP_ENTRIES];
+
+/*
+ * Allocate a lockdep entry. (assumes hash_lock held, returns
+ * with NULL on failure)
+ */
+static struct lock_list *alloc_list_entry(void)
+{
+       if (nr_list_entries >= MAX_LOCKDEP_ENTRIES) {
+               __raw_spin_unlock(&hash_lock);
+               debug_locks_off();
+               printk("BUG: MAX_LOCKDEP_ENTRIES too low!\n");
+               printk("turning off the locking correctness validator.\n");
+               return NULL;
+       }
+       return list_entries + nr_list_entries++;
+}
+
+/*
+ * All data structures here are protected by the global debug_lock.
+ *
+ * Mutex key structs only get allocated, once during bootup, and never
+ * get freed - this significantly simplifies the debugging code.
+ */
+unsigned long nr_lock_classes;
+static struct lock_class lock_classes[MAX_LOCKDEP_KEYS];
+
+/*
+ * We keep a global list of all lock classes. The list only grows,
+ * never shrinks. The list is only accessed with the lockdep
+ * spinlock lock held.
+ */
+LIST_HEAD(all_lock_classes);
+
+/*
+ * The lockdep classes are in a hash-table as well, for fast lookup:
+ */
+#define CLASSHASH_BITS         (MAX_LOCKDEP_KEYS_BITS - 1)
+#define CLASSHASH_SIZE         (1UL << CLASSHASH_BITS)
+#define CLASSHASH_MASK         (CLASSHASH_SIZE - 1)
+#define __classhashfn(key)     ((((unsigned long)key >> CLASSHASH_BITS) + (unsigned long)key) & CLASSHASH_MASK)
+#define classhashentry(key)    (classhash_table + __classhashfn((key)))
+
+static struct list_head classhash_table[CLASSHASH_SIZE];
+
+unsigned long nr_lock_chains;
+static struct lock_chain lock_chains[MAX_LOCKDEP_CHAINS];
+
+/*
+ * We put the lock dependency chains into a hash-table as well, to cache
+ * their existence:
+ */
+#define CHAINHASH_BITS         (MAX_LOCKDEP_CHAINS_BITS-1)
+#define CHAINHASH_SIZE         (1UL << CHAINHASH_BITS)
+#define CHAINHASH_MASK         (CHAINHASH_SIZE - 1)
+#define __chainhashfn(chain) \
+               (((chain >> CHAINHASH_BITS) + chain) & CHAINHASH_MASK)
+#define chainhashentry(chain)  (chainhash_table + __chainhashfn((chain)))
+
+static struct list_head chainhash_table[CHAINHASH_SIZE];
+
+/*
+ * The hash key of the lock dependency chains is a hash itself too:
+ * it's a hash of all locks taken up to that lock, including that lock.
+ * It's a 64-bit hash, because it's important for the keys to be
+ * unique.
+ */
+#define iterate_chain_key(key1, key2) \
+       (((key1) << MAX_LOCKDEP_KEYS_BITS/2) ^ \
+       ((key1) >> (64-MAX_LOCKDEP_KEYS_BITS/2)) ^ \
+       (key2))
+
+void lockdep_off(void)
+{
+       current->lockdep_recursion++;
+}
+
+EXPORT_SYMBOL(lockdep_off);
+
+void lockdep_on(void)
+{
+       current->lockdep_recursion--;
+}
+
+EXPORT_SYMBOL(lockdep_on);
+
+int lockdep_internal(void)
+{
+       return current->lockdep_recursion != 0;
+}
+
+EXPORT_SYMBOL(lockdep_internal);
+
+/*
+ * Debugging switches:
+ */
+
+#define VERBOSE                        0
+#ifdef VERBOSE
+# define VERY_VERBOSE          0
+#endif
+
+#if VERBOSE
+# define HARDIRQ_VERBOSE       1
+# define SOFTIRQ_VERBOSE       1
+#else
+# define HARDIRQ_VERBOSE       0
+# define SOFTIRQ_VERBOSE       0
+#endif
+
+#if VERBOSE || HARDIRQ_VERBOSE || SOFTIRQ_VERBOSE
+/*
+ * Quick filtering for interesting events:
+ */
+static int class_filter(struct lock_class *class)
+{
+       if (class->name_version == 1 &&
+                       !strcmp(class->name, "&rl->lock"))
+               return 1;
+       if (class->name_version == 1 &&
+                       !strcmp(class->name, "&ni->mrec_lock"))
+               return 1;
+       if (class->name_version == 1 &&
+                       !strcmp(class->name, "mft_ni_runlist_lock"))
+               return 1;
+       if (class->name_version == 1 &&
+                       !strcmp(class->name, "mft_ni_mrec_lock"))
+               return 1;
+       if (class->name_version == 1 &&
+                       !strcmp(class->name, "&vol->lcnbmp_lock"))
+               return 1;
+       return 0;
+}
+#endif
+
+static int verbose(struct lock_class *class)
+{
+#if VERBOSE
+       return class_filter(class);
+#endif
+       return 0;
+}
+
+#ifdef CONFIG_TRACE_IRQFLAGS
+
+static int hardirq_verbose(struct lock_class *class)
+{
+#if HARDIRQ_VERBOSE
+       return class_filter(class);
+#endif
+       return 0;
+}
+
+static int softirq_verbose(struct lock_class *class)
+{
+#if SOFTIRQ_VERBOSE
+       return class_filter(class);
+#endif
+       return 0;
+}
+
+#endif
+
+/*
+ * Stack-trace: tightly packed array of stack backtrace
+ * addresses. Protected by the hash_lock.
+ */
+unsigned long nr_stack_trace_entries;
+static unsigned long stack_trace[MAX_STACK_TRACE_ENTRIES];
+
+static int save_trace(struct stack_trace *trace)
+{
+       trace->nr_entries = 0;
+       trace->max_entries = MAX_STACK_TRACE_ENTRIES - nr_stack_trace_entries;
+       trace->entries = stack_trace + nr_stack_trace_entries;
+
+       save_stack_trace(trace, NULL, 0, 3);
+
+       trace->max_entries = trace->nr_entries;
+
+       nr_stack_trace_entries += trace->nr_entries;
+       if (DEBUG_LOCKS_WARN_ON(nr_stack_trace_entries > MAX_STACK_TRACE_ENTRIES))
+               return 0;
+
+       if (nr_stack_trace_entries == MAX_STACK_TRACE_ENTRIES) {
+               __raw_spin_unlock(&hash_lock);
+               if (debug_locks_off()) {
+                       printk("BUG: MAX_STACK_TRACE_ENTRIES too low!\n");
+                       printk("turning off the locking correctness validator.\n");
+                       dump_stack();
+               }
+               return 0;
+       }
+
+       return 1;
+}
+
+unsigned int nr_hardirq_chains;
+unsigned int nr_softirq_chains;
+unsigned int nr_process_chains;
+unsigned int max_lockdep_depth;
+unsigned int max_recursion_depth;
+
+#ifdef CONFIG_DEBUG_LOCKDEP
+/*
+ * We cannot printk in early bootup code. Not even early_printk()
+ * might work. So we mark any initialization errors and printk
+ * about it later on, in lockdep_info().
+ */
+static int lockdep_init_error;
+
+/*
+ * Various lockdep statistics:
+ */
+atomic_t chain_lookup_hits;
+atomic_t chain_lookup_misses;
+atomic_t hardirqs_on_events;
+atomic_t hardirqs_off_events;
+atomic_t redundant_hardirqs_on;
+atomic_t redundant_hardirqs_off;
+atomic_t softirqs_on_events;
+atomic_t softirqs_off_events;
+atomic_t redundant_softirqs_on;
+atomic_t redundant_softirqs_off;
+atomic_t nr_unused_locks;
+atomic_t nr_cyclic_checks;
+atomic_t nr_cyclic_check_recursions;
+atomic_t nr_find_usage_forwards_checks;
+atomic_t nr_find_usage_forwards_recursions;
+atomic_t nr_find_usage_backwards_checks;
+atomic_t nr_find_usage_backwards_recursions;
+# define debug_atomic_inc(ptr)         atomic_inc(ptr)
+# define debug_atomic_dec(ptr)         atomic_dec(ptr)
+# define debug_atomic_read(ptr)                atomic_read(ptr)
+#else
+# define debug_atomic_inc(ptr)         do { } while (0)
+# define debug_atomic_dec(ptr)         do { } while (0)
+# define debug_atomic_read(ptr)                0
+#endif
+
+/*
+ * Locking printouts:
+ */
+
+static const char *usage_str[] =
+{
+       [LOCK_USED] =                   "initial-use ",
+       [LOCK_USED_IN_HARDIRQ] =        "in-hardirq-W",
+       [LOCK_USED_IN_SOFTIRQ] =        "in-softirq-W",
+       [LOCK_ENABLED_SOFTIRQS] =       "softirq-on-W",
+       [LOCK_ENABLED_HARDIRQS] =       "hardirq-on-W",
+       [LOCK_USED_IN_HARDIRQ_READ] =   "in-hardirq-R",
+       [LOCK_USED_IN_SOFTIRQ_READ] =   "in-softirq-R",
+       [LOCK_ENABLED_SOFTIRQS_READ] =  "softirq-on-R",
+       [LOCK_ENABLED_HARDIRQS_READ] =  "hardirq-on-R",
+};
+
+const char * __get_key_name(struct lockdep_subclass_key *key, char *str)
+{
+       unsigned long offs, size;
+       char *modname;
+
+       return kallsyms_lookup((unsigned long)key, &size, &offs, &modname, str);
+}
+
+void
+get_usage_chars(struct lock_class *class, char *c1, char *c2, char *c3, char *c4)
+{
+       *c1 = '.', *c2 = '.', *c3 = '.', *c4 = '.';
+
+       if (class->usage_mask & LOCKF_USED_IN_HARDIRQ)
+               *c1 = '+';
+       else
+               if (class->usage_mask & LOCKF_ENABLED_HARDIRQS)
+                       *c1 = '-';
+
+       if (class->usage_mask & LOCKF_USED_IN_SOFTIRQ)
+               *c2 = '+';
+       else
+               if (class->usage_mask & LOCKF_ENABLED_SOFTIRQS)
+                       *c2 = '-';
+
+       if (class->usage_mask & LOCKF_ENABLED_HARDIRQS_READ)
+               *c3 = '-';
+       if (class->usage_mask & LOCKF_USED_IN_HARDIRQ_READ) {
+               *c3 = '+';
+               if (class->usage_mask & LOCKF_ENABLED_HARDIRQS_READ)
+                       *c3 = '?';
+       }
+
+       if (class->usage_mask & LOCKF_ENABLED_SOFTIRQS_READ)
+               *c4 = '-';
+       if (class->usage_mask & LOCKF_USED_IN_SOFTIRQ_READ) {
+               *c4 = '+';
+               if (class->usage_mask & LOCKF_ENABLED_SOFTIRQS_READ)
+                       *c4 = '?';
+       }
+}
+
+static void print_lock_name(struct lock_class *class)
+{
+       char str[128], c1, c2, c3, c4;
+       const char *name;
+
+       get_usage_chars(class, &c1, &c2, &c3, &c4);
+
+       name = class->name;
+       if (!name) {
+               name = __get_key_name(class->key, str);
+               printk(" (%s", name);
+       } else {
+               printk(" (%s", name);
+               if (class->name_version > 1)
+                       printk("#%d", class->name_version);
+               if (class->subclass)
+                       printk("/%d", class->subclass);
+       }
+       printk("){%c%c%c%c}", c1, c2, c3, c4);
+}
+
+static void print_lockdep_cache(struct lockdep_map *lock)
+{
+       const char *name;
+       char str[128];
+
+       name = lock->name;
+       if (!name)
+               name = __get_key_name(lock->key->subkeys, str);
+
+       printk("%s", name);
+}
+
+static void print_lock(struct held_lock *hlock)
+{
+       print_lock_name(hlock->class);
+       printk(", at: ");
+       print_ip_sym(hlock->acquire_ip);
+}
+
+static void lockdep_print_held_locks(struct task_struct *curr)
+{
+       int i, depth = curr->lockdep_depth;
+
+       if (!depth) {
+               printk("no locks held by %s/%d.\n", curr->comm, curr->pid);
+               return;
+       }
+       printk("%d lock%s held by %s/%d:\n",
+               depth, depth > 1 ? "s" : "", curr->comm, curr->pid);
+
+       for (i = 0; i < depth; i++) {
+               printk(" #%d: ", i);
+               print_lock(curr->held_locks + i);
+       }
+}
+/*
+ * Helper to print a nice hierarchy of lock dependencies:
+ */
+static void print_spaces(int nr)
+{
+       int i;
+
+       for (i = 0; i < nr; i++)
+               printk("  ");
+}
+
+static void print_lock_class_header(struct lock_class *class, int depth)
+{
+       int bit;
+
+       print_spaces(depth);
+       printk("->");
+       print_lock_name(class);
+       printk(" ops: %lu", class->ops);
+       printk(" {\n");
+
+       for (bit = 0; bit < LOCK_USAGE_STATES; bit++) {
+               if (class->usage_mask & (1 << bit)) {
+                       int len = depth;
+
+                       print_spaces(depth);
+                       len += printk("   %s", usage_str[bit]);
+                       len += printk(" at:\n");
+                       print_stack_trace(class->usage_traces + bit, len);
+               }
+       }
+       print_spaces(depth);
+       printk(" }\n");
+
+       print_spaces(depth);
+       printk(" ... key      at: ");
+       print_ip_sym((unsigned long)class->key);
+}
+
+/*
+ * printk all lock dependencies starting at <entry>:
+ */
+static void print_lock_dependencies(struct lock_class *class, int depth)
+{
+       struct lock_list *entry;
+
+       if (DEBUG_LOCKS_WARN_ON(depth >= 20))
+               return;
+
+       print_lock_class_header(class, depth);
+
+       list_for_each_entry(entry, &class->locks_after, entry) {
+               DEBUG_LOCKS_WARN_ON(!entry->class);
+               print_lock_dependencies(entry->class, depth + 1);
+
+               print_spaces(depth);
+               printk(" ... acquired at:\n");
+               print_stack_trace(&entry->trace, 2);
+               printk("\n");
+       }
+}
+
+/*
+ * Add a new dependency to the head of the list:
+ */
+static int add_lock_to_list(struct lock_class *class, struct lock_class *this,
+                           struct list_head *head, unsigned long ip)
+{
+       struct lock_list *entry;
+       /*
+        * Lock not present yet - get a new dependency struct and
+        * add it to the list:
+        */
+       entry = alloc_list_entry();
+       if (!entry)
+               return 0;
+
+       entry->class = this;
+       save_trace(&entry->trace);
+
+       /*
+        * Since we never remove from the dependency list, the list can
+        * be walked lockless by other CPUs, it's only allocation
+        * that must be protected by the spinlock. But this also means
+        * we must make new entries visible only once writes to the
+        * entry become visible - hence the RCU op:
+        */
+       list_add_tail_rcu(&entry->entry, head);
+
+       return 1;
+}
+
+/*
+ * Recursive, forwards-direction lock-dependency checking, used for
+ * both noncyclic checking and for hardirq-unsafe/softirq-unsafe
+ * checking.
+ *
+ * (to keep the stackframe of the recursive functions small we
+ *  use these global variables, and we also mark various helper
+ *  functions as noinline.)
+ */
+static struct held_lock *check_source, *check_target;
+
+/*
+ * Print a dependency chain entry (this is only done when a deadlock
+ * has been detected):
+ */
+static noinline int
+print_circular_bug_entry(struct lock_list *target, unsigned int depth)
+{
+       if (debug_locks_silent)
+               return 0;
+       printk("\n-> #%u", depth);
+       print_lock_name(target->class);
+       printk(":\n");
+       print_stack_trace(&target->trace, 6);
+
+       return 0;
+}
+
+/*
+ * When a circular dependency is detected, print the
+ * header first:
+ */
+static noinline int
+print_circular_bug_header(struct lock_list *entry, unsigned int depth)
+{
+       struct task_struct *curr = current;
+
+       __raw_spin_unlock(&hash_lock);
+       debug_locks_off();
+       if (debug_locks_silent)
+               return 0;
+
+       printk("\n=======================================================\n");
+       printk(  "[ INFO: possible circular locking dependency detected ]\n");
+       printk(  "-------------------------------------------------------\n");
+       printk("%s/%d is trying to acquire lock:\n",
+               curr->comm, curr->pid);
+       print_lock(check_source);
+       printk("\nbut task is already holding lock:\n");
+       print_lock(check_target);
+       printk("\nwhich lock already depends on the new lock.\n\n");
+       printk("\nthe existing dependency chain (in reverse order) is:\n");
+
+       print_circular_bug_entry(entry, depth);
+
+       return 0;
+}
+
+static noinline int print_circular_bug_tail(void)
+{
+       struct task_struct *curr = current;
+       struct lock_list this;
+
+       if (debug_locks_silent)
+               return 0;
+
+       this.class = check_source->class;
+       save_trace(&this.trace);
+       print_circular_bug_entry(&this, 0);
+
+       printk("\nother info that might help us debug this:\n\n");
+       lockdep_print_held_locks(curr);
+
+       printk("\nstack backtrace:\n");
+       dump_stack();
+
+       return 0;
+}
+
+static int noinline print_infinite_recursion_bug(void)
+{
+       __raw_spin_unlock(&hash_lock);
+       DEBUG_LOCKS_WARN_ON(1);
+
+       return 0;
+}
+
+/*
+ * Prove that the dependency graph starting at <entry> can not
+ * lead to <target>. Print an error and return 0 if it does.
+ */
+static noinline int
+check_noncircular(struct lock_class *source, unsigned int depth)
+{
+       struct lock_list *entry;
+
+       debug_atomic_inc(&nr_cyclic_check_recursions);
+       if (depth > max_recursion_depth)
+               max_recursion_depth = depth;
+       if (depth >= 20)
+               return print_infinite_recursion_bug();
+       /*
+        * Check this lock's dependency list:
+        */
+       list_for_each_entry(entry, &source->locks_after, entry) {
+               if (entry->class == check_target->class)
+                       return print_circular_bug_header(entry, depth+1);
+               debug_atomic_inc(&nr_cyclic_checks);
+               if (!check_noncircular(entry->class, depth+1))
+                       return print_circular_bug_entry(entry, depth+1);
+       }
+       return 1;
+}
+
+static int very_verbose(struct lock_class *class)
+{
+#if VERY_VERBOSE
+       return class_filter(class);
+#endif
+       return 0;
+}
+#ifdef CONFIG_TRACE_IRQFLAGS
+
+/*
+ * Forwards and backwards subgraph searching, for the purposes of
+ * proving that two subgraphs can be connected by a new dependency
+ * without creating any illegal irq-safe -> irq-unsafe lock dependency.
+ */
+static enum lock_usage_bit find_usage_bit;
+static struct lock_class *forwards_match, *backwards_match;
+
+/*
+ * Find a node in the forwards-direction dependency sub-graph starting
+ * at <source> that matches <find_usage_bit>.
+ *
+ * Return 2 if such a node exists in the subgraph, and put that node
+ * into <forwards_match>.
+ *
+ * Return 1 otherwise and keep <forwards_match> unchanged.
+ * Return 0 on error.
+ */
+static noinline int
+find_usage_forwards(struct lock_class *source, unsigned int depth)
+{
+       struct lock_list *entry;
+       int ret;
+
+       if (depth > max_recursion_depth)
+               max_recursion_depth = depth;
+       if (depth >= 20)
+               return print_infinite_recursion_bug();
+
+       debug_atomic_inc(&nr_find_usage_forwards_checks);
+       if (source->usage_mask & (1 << find_usage_bit)) {
+               forwards_match = source;
+               return 2;
+       }
+
+       /*
+        * Check this lock's dependency list:
+        */
+       list_for_each_entry(entry, &source->locks_after, entry) {
+               debug_atomic_inc(&nr_find_usage_forwards_recursions);
+               ret = find_usage_forwards(entry->class, depth+1);
+               if (ret == 2 || ret == 0)
+                       return ret;
+       }
+       return 1;
+}
+
+/*
+ * Find a node in the backwards-direction dependency sub-graph starting
+ * at <source> that matches <find_usage_bit>.
+ *
+ * Return 2 if such a node exists in the subgraph, and put that node
+ * into <backwards_match>.
+ *
+ * Return 1 otherwise and keep <backwards_match> unchanged.
+ * Return 0 on error.
+ */
+static noinline int
+find_usage_backwards(struct lock_class *source, unsigned int depth)
+{
+       struct lock_list *entry;
+       int ret;
+
+       if (depth > max_recursion_depth)
+               max_recursion_depth = depth;
+       if (depth >= 20)
+               return print_infinite_recursion_bug();
+
+       debug_atomic_inc(&nr_find_usage_backwards_checks);
+       if (source->usage_mask & (1 << find_usage_bit)) {
+               backwards_match = source;
+               return 2;
+       }
+
+       /*
+        * Check this lock's dependency list:
+        */
+       list_for_each_entry(entry, &source->locks_before, entry) {
+               debug_atomic_inc(&nr_find_usage_backwards_recursions);
+               ret = find_usage_backwards(entry->class, depth+1);
+               if (ret == 2 || ret == 0)
+                       return ret;
+       }
+       return 1;
+}
+
+static int
+print_bad_irq_dependency(struct task_struct *curr,
+                        struct held_lock *prev,
+                        struct held_lock *next,
+                        enum lock_usage_bit bit1,
+                        enum lock_usage_bit bit2,
+                        const char *irqclass)
+{
+       __raw_spin_unlock(&hash_lock);
+       debug_locks_off();
+       if (debug_locks_silent)
+               return 0;
+
+       printk("\n======================================================\n");
+       printk(  "[ INFO: %s-safe -> %s-unsafe lock order detected ]\n",
+               irqclass, irqclass);
+       printk(  "------------------------------------------------------\n");
+       printk("%s/%d [HC%u[%lu]:SC%u[%lu]:HE%u:SE%u] is trying to acquire:\n",
+               curr->comm, curr->pid,
+               curr->hardirq_context, hardirq_count() >> HARDIRQ_SHIFT,
+               curr->softirq_context, softirq_count() >> SOFTIRQ_SHIFT,
+               curr->hardirqs_enabled,
+               curr->softirqs_enabled);
+       print_lock(next);
+
+       printk("\nand this task is already holding:\n");
+       print_lock(prev);
+       printk("which would create a new lock dependency:\n");
+       print_lock_name(prev->class);
+       printk(" ->");
+       print_lock_name(next->class);
+       printk("\n");
+
+       printk("\nbut this new dependency connects a %s-irq-safe lock:\n",
+               irqclass);
+       print_lock_name(backwards_match);
+       printk("\n... which became %s-irq-safe at:\n", irqclass);
+
+       print_stack_trace(backwards_match->usage_traces + bit1, 1);
+
+       printk("\nto a %s-irq-unsafe lock:\n", irqclass);
+       print_lock_name(forwards_match);
+       printk("\n... which became %s-irq-unsafe at:\n", irqclass);
+       printk("...");
+
+       print_stack_trace(forwards_match->usage_traces + bit2, 1);
+
+       printk("\nother info that might help us debug this:\n\n");
+       lockdep_print_held_locks(curr);
+
+       printk("\nthe %s-irq-safe lock's dependencies:\n", irqclass);
+       print_lock_dependencies(backwards_match, 0);
+
+       printk("\nthe %s-irq-unsafe lock's dependencies:\n", irqclass);
+       print_lock_dependencies(forwards_match, 0);
+
+       printk("\nstack backtrace:\n");
+       dump_stack();
+
+       return 0;
+}
+
+static int
+check_usage(struct task_struct *curr, struct held_lock *prev,
+           struct held_lock *next, enum lock_usage_bit bit_backwards,
+           enum lock_usage_bit bit_forwards, const char *irqclass)
+{
+       int ret;
+
+       find_usage_bit = bit_backwards;
+       /* fills in <backwards_match> */
+       ret = find_usage_backwards(prev->class, 0);
+       if (!ret || ret == 1)
+               return ret;
+
+       find_usage_bit = bit_forwards;
+       ret = find_usage_forwards(next->class, 0);
+       if (!ret || ret == 1)
+               return ret;
+       /* ret == 2 */
+       return print_bad_irq_dependency(curr, prev, next,
+                       bit_backwards, bit_forwards, irqclass);
+}
+
+#endif
+
+static int
+print_deadlock_bug(struct task_struct *curr, struct held_lock *prev,
+                  struct held_lock *next)
+{
+       debug_locks_off();
+       __raw_spin_unlock(&hash_lock);
+       if (debug_locks_silent)
+               return 0;
+
+       printk("\n=============================================\n");
+       printk(  "[ INFO: possible recursive locking detected ]\n");
+       printk(  "---------------------------------------------\n");
+       printk("%s/%d is trying to acquire lock:\n",
+               curr->comm, curr->pid);
+       print_lock(next);
+       printk("\nbut task is already holding lock:\n");
+       print_lock(prev);
+
+       printk("\nother info that might help us debug this:\n");
+       lockdep_print_held_locks(curr);
+
+       printk("\nstack backtrace:\n");
+       dump_stack();
+
+       return 0;
+}
+
+/*
+ * Check whether we are holding such a class already.
+ *
+ * (Note that this has to be done separately, because the graph cannot
+ * detect such classes of deadlocks.)
+ *
+ * Returns: 0 on deadlock detected, 1 on OK, 2 on recursive read
+ */
+static int
+check_deadlock(struct task_struct *curr, struct held_lock *next,
+              struct lockdep_map *next_instance, int read)
+{
+       struct held_lock *prev;
+       int i;
+
+       for (i = 0; i < curr->lockdep_depth; i++) {
+               prev = curr->held_locks + i;
+               if (prev->class != next->class)
+                       continue;
+               /*
+                * Allow read-after-read recursion of the same
+                * lock class (i.e. read_lock(lock)+read_lock(lock)):
+                */
+               if ((read == 2) && prev->read)
+                       return 2;
+               return print_deadlock_bug(curr, prev, next);
+       }
+       return 1;
+}
+
+/*
+ * There was a chain-cache miss, and we are about to add a new dependency
+ * to a previous lock. We recursively validate the following rules:
+ *
+ *  - would the adding of the <prev> -> <next> dependency create a
+ *    circular dependency in the graph? [== circular deadlock]
+ *
+ *  - does the new prev->next dependency connect any hardirq-safe lock
+ *    (in the full backwards-subgraph starting at <prev>) with any
+ *    hardirq-unsafe lock (in the full forwards-subgraph starting at
+ *    <next>)? [== illegal lock inversion with hardirq contexts]
+ *
+ *  - does the new prev->next dependency connect any softirq-safe lock
+ *    (in the full backwards-subgraph starting at <prev>) with any
+ *    softirq-unsafe lock (in the full forwards-subgraph starting at
+ *    <next>)? [== illegal lock inversion with softirq contexts]
+ *
+ * any of these scenarios could lead to a deadlock.
+ *
+ * Then if all the validations pass, we add the forwards and backwards
+ * dependency.
+ */
+static int
+check_prev_add(struct task_struct *curr, struct held_lock *prev,
+              struct held_lock *next)
+{
+       struct lock_list *entry;
+       int ret;
+
+       /*
+        * Prove that the new <prev> -> <next> dependency would not
+        * create a circular dependency in the graph. (We do this by
+        * forward-recursing into the graph starting at <next>, and
+        * checking whether we can reach <prev>.)
+        *
+        * We are using global variables to control the recursion, to
+        * keep the stackframe size of the recursive functions low:
+        */
+       check_source = next;
+       check_target = prev;
+       if (!(check_noncircular(next->class, 0)))
+               return print_circular_bug_tail();
+
+#ifdef CONFIG_TRACE_IRQFLAGS
+       /*
+        * Prove that the new dependency does not connect a hardirq-safe
+        * lock with a hardirq-unsafe lock - to achieve this we search
+        * the backwards-subgraph starting at <prev>, and the
+        * forwards-subgraph starting at <next>:
+        */
+       if (!check_usage(curr, prev, next, LOCK_USED_IN_HARDIRQ,
+                                       LOCK_ENABLED_HARDIRQS, "hard"))
+               return 0;
+
+       /*
+        * Prove that the new dependency does not connect a hardirq-safe-read
+        * lock with a hardirq-unsafe lock - to achieve this we search
+        * the backwards-subgraph starting at <prev>, and the
+        * forwards-subgraph starting at <next>:
+        */
+       if (!check_usage(curr, prev, next, LOCK_USED_IN_HARDIRQ_READ,
+                                       LOCK_ENABLED_HARDIRQS, "hard-read"))
+               return 0;
+
+       /*
+        * Prove that the new dependency does not connect a softirq-safe
+        * lock with a softirq-unsafe lock - to achieve this we search
+        * the backwards-subgraph starting at <prev>, and the
+        * forwards-subgraph starting at <next>:
+        */
+       if (!check_usage(curr, prev, next, LOCK_USED_IN_SOFTIRQ,
+                                       LOCK_ENABLED_SOFTIRQS, "soft"))
+               return 0;
+       /*
+        * Prove that the new dependency does not connect a softirq-safe-read
+        * lock with a softirq-unsafe lock - to achieve this we search
+        * the backwards-subgraph starting at <prev>, and the
+        * forwards-subgraph starting at <next>:
+        */
+       if (!check_usage(curr, prev, next, LOCK_USED_IN_SOFTIRQ_READ,
+                                       LOCK_ENABLED_SOFTIRQS, "soft"))
+               return 0;
+#endif
+       /*
+        * For recursive read-locks we do all the dependency checks,
+        * but we dont store read-triggered dependencies (only
+        * write-triggered dependencies). This ensures that only the
+        * write-side dependencies matter, and that if for example a
+        * write-lock never takes any other locks, then the reads are
+        * equivalent to a NOP.
+        */
+       if (next->read == 2 || prev->read == 2)
+               return 1;
+       /*
+        * Is the <prev> -> <next> dependency already present?
+        *
+        * (this may occur even though this is a new chain: consider
+        *  e.g. the L1 -> L2 -> L3 -> L4 and the L5 -> L1 -> L2 -> L3
+        *  chains - the second one will be new, but L1 already has
+        *  L2 added to its dependency list, due to the first chain.)
+        */
+       list_for_each_entry(entry, &prev->class->locks_after, entry) {
+               if (entry->class == next->class)
+                       return 2;
+       }
+
+       /*
+        * Ok, all validations passed, add the new lock
+        * to the previous lock's dependency list:
+        */
+       ret = add_lock_to_list(prev->class, next->class,
+                              &prev->class->locks_after, next->acquire_ip);
+       if (!ret)
+               return 0;
+       /*
+        * Return value of 2 signals 'dependency already added',
+        * in that case we dont have to add the backlink either.
+        */
+       if (ret == 2)
+               return 2;
+       ret = add_lock_to_list(next->class, prev->class,
+                              &next->class->locks_before, next->acquire_ip);
+
+       /*
+        * Debugging printouts:
+        */
+       if (verbose(prev->class) || verbose(next->class)) {
+               __raw_spin_unlock(&hash_lock);
+               printk("\n new dependency: ");
+               print_lock_name(prev->class);
+               printk(" => ");
+               print_lock_name(next->class);
+               printk("\n");
+               dump_stack();
+               __raw_spin_lock(&hash_lock);
+       }
+       return 1;
+}
+
+/*
+ * Add the dependency to all directly-previous locks that are 'relevant'.
+ * The ones that are relevant are (in increasing distance from curr):
+ * all consecutive trylock entries and the final non-trylock entry - or
+ * the end of this context's lock-chain - whichever comes first.
+ */
+static int
+check_prevs_add(struct task_struct *curr, struct held_lock *next)
+{
+       int depth = curr->lockdep_depth;
+       struct held_lock *hlock;
+
+       /*
+        * Debugging checks.
+        *
+        * Depth must not be zero for a non-head lock:
+        */
+       if (!depth)
+               goto out_bug;
+       /*
+        * At least two relevant locks must exist for this
+        * to be a head:
+        */
+       if (curr->held_locks[depth].irq_context !=
+                       curr->held_locks[depth-1].irq_context)
+               goto out_bug;
+
+       for (;;) {
+               hlock = curr->held_locks + depth-1;
+               /*
+                * Only non-recursive-read entries get new dependencies
+                * added:
+                */
+               if (hlock->read != 2) {
+                       check_prev_add(curr, hlock, next);
+                       /*
+                        * Stop after the first non-trylock entry,
+                        * as non-trylock entries have added their
+                        * own direct dependencies already, so this
+                        * lock is connected to them indirectly:
+                        */
+                       if (!hlock->trylock)
+                               break;
+               }
+               depth--;
+               /*
+                * End of lock-stack?
+                */
+               if (!depth)
+                       break;
+               /*
+                * Stop the search if we cross into another context:
+                */
+               if (curr->held_locks[depth].irq_context !=
+                               curr->held_locks[depth-1].irq_context)
+                       break;
+       }
+       return 1;
+out_bug:
+       __raw_spin_unlock(&hash_lock);
+       DEBUG_LOCKS_WARN_ON(1);
+
+       return 0;
+}
+
+
+/*
+ * Is this the address of a static object:
+ */
+static int static_obj(void *obj)
+{
+       unsigned long start = (unsigned long) &_stext,
+                     end   = (unsigned long) &_end,
+                     addr  = (unsigned long) obj;
+#ifdef CONFIG_SMP
+       int i;
+#endif
+
+       /*
+        * static variable?
+        */
+       if ((addr >= start) && (addr < end))
+               return 1;
+
+#ifdef CONFIG_SMP
+       /*
+        * percpu var?
+        */
+       for_each_possible_cpu(i) {
+               start = (unsigned long) &__per_cpu_start + per_cpu_offset(i);
+               end   = (unsigned long) &__per_cpu_end   + per_cpu_offset(i);
+
+               if ((addr >= start) && (addr < end))
+                       return 1;
+       }
+#endif
+
+       /*
+        * module var?
+        */
+       return is_module_address(addr);
+}
+
+/*
+ * To make lock name printouts unique, we calculate a unique
+ * class->name_version generation counter:
+ */
+static int count_matching_names(struct lock_class *new_class)
+{
+       struct lock_class *class;
+       int count = 0;
+
+       if (!new_class->name)
+               return 0;
+
+       list_for_each_entry(class, &all_lock_classes, lock_entry) {
+               if (new_class->key - new_class->subclass == class->key)
+                       return class->name_version;
+               if (class->name && !strcmp(class->name, new_class->name))
+                       count = max(count, class->name_version);
+       }
+
+       return count + 1;
+}
+
+extern void __error_too_big_MAX_LOCKDEP_SUBCLASSES(void);
+
+/*
+ * Register a lock's class in the hash-table, if the class is not present
+ * yet. Otherwise we look it up. We cache the result in the lock object
+ * itself, so actual lookup of the hash should be once per lock object.
+ */
+static inline struct lock_class *
+register_lock_class(struct lockdep_map *lock, unsigned int subclass)
+{
+       struct lockdep_subclass_key *key;
+       struct list_head *hash_head;
+       struct lock_class *class;
+
+#ifdef CONFIG_DEBUG_LOCKDEP
+       /*
+        * If the architecture calls into lockdep before initializing
+        * the hashes then we'll warn about it later. (we cannot printk
+        * right now)
+        */
+       if (unlikely(!lockdep_initialized)) {
+               lockdep_init();
+               lockdep_init_error = 1;
+       }
+#endif
+
+       /*
+        * Static locks do not have their class-keys yet - for them the key
+        * is the lock object itself:
+        */
+       if (unlikely(!lock->key))
+               lock->key = (void *)lock;
+
+       /*
+        * NOTE: the class-key must be unique. For dynamic locks, a static
+        * lock_class_key variable is passed in through the mutex_init()
+        * (or spin_lock_init()) call - which acts as the key. For static
+        * locks we use the lock object itself as the key.
+        */
+       if (sizeof(struct lock_class_key) > sizeof(struct lock_class))
+               __error_too_big_MAX_LOCKDEP_SUBCLASSES();
+
+       key = lock->key->subkeys + subclass;
+
+       hash_head = classhashentry(key);
+
+       /*
+        * We can walk the hash lockfree, because the hash only
+        * grows, and we are careful when adding entries to the end:
+        */
+       list_for_each_entry(class, hash_head, hash_entry)
+               if (class->key == key)
+                       goto out_set;
+
+       /*
+        * Debug-check: all keys must be persistent!
+        */
+       if (!static_obj(lock->key)) {
+               debug_locks_off();
+               printk("INFO: trying to register non-static key.\n");
+               printk("the code is fine but needs lockdep annotation.\n");
+               printk("turning off the locking correctness validator.\n");
+               dump_stack();
+
+               return NULL;
+       }
+
+       __raw_spin_lock(&hash_lock);
+       /*
+        * We have to do the hash-walk again, to avoid races
+        * with another CPU:
+        */
+       list_for_each_entry(class, hash_head, hash_entry)
+               if (class->key == key)
+                       goto out_unlock_set;
+       /*
+        * Allocate a new key from the static array, and add it to
+        * the hash:
+        */
+       if (nr_lock_classes >= MAX_LOCKDEP_KEYS) {
+               __raw_spin_unlock(&hash_lock);
+               debug_locks_off();
+               printk("BUG: MAX_LOCKDEP_KEYS too low!\n");
+               printk("turning off the locking correctness validator.\n");
+               return NULL;
+       }
+       class = lock_classes + nr_lock_classes++;
+       debug_atomic_inc(&nr_unused_locks);
+       class->key = key;
+       class->name = lock->name;
+       class->subclass = subclass;
+       INIT_LIST_HEAD(&class->lock_entry);
+       INIT_LIST_HEAD(&class->locks_before);
+       INIT_LIST_HEAD(&class->locks_after);
+       class->name_version = count_matching_names(class);
+       /*
+        * We use RCU's safe list-add method to make
+        * parallel walking of the hash-list safe:
+        */
+       list_add_tail_rcu(&class->hash_entry, hash_head);
+
+       if (verbose(class)) {
+               __raw_spin_unlock(&hash_lock);
+               printk("\nnew class %p: %s", class->key, class->name);
+               if (class->name_version > 1)
+                       printk("#%d", class->name_version);
+               printk("\n");
+               dump_stack();
+               __raw_spin_lock(&hash_lock);
+       }
+out_unlock_set:
+       __raw_spin_unlock(&hash_lock);
+
+out_set:
+       lock->class[subclass] = class;
+
+       DEBUG_LOCKS_WARN_ON(class->subclass != subclass);
+
+       return class;
+}
+
+/*
+ * Look up a dependency chain. If the key is not present yet then
+ * add it and return 0 - in this case the new dependency chain is
+ * validated. If the key is already hashed, return 1.
+ */
+static inline int lookup_chain_cache(u64 chain_key)
+{
+       struct list_head *hash_head = chainhashentry(chain_key);
+       struct lock_chain *chain;
+
+       DEBUG_LOCKS_WARN_ON(!irqs_disabled());
+       /*
+        * We can walk it lock-free, because entries only get added
+        * to the hash:
+        */
+       list_for_each_entry(chain, hash_head, entry) {
+               if (chain->chain_key == chain_key) {
+cache_hit:
+                       debug_atomic_inc(&chain_lookup_hits);
+                       /*
+                        * In the debugging case, force redundant checking
+                        * by returning 1:
+                        */
+#ifdef CONFIG_DEBUG_LOCKDEP
+                       __raw_spin_lock(&hash_lock);
+                       return 1;
+#endif
+                       return 0;
+               }
+       }
+       /*
+        * Allocate a new chain entry from the static array, and add
+        * it to the hash:
+        */
+       __raw_spin_lock(&hash_lock);
+       /*
+        * We have to walk the chain again locked - to avoid duplicates:
+        */
+       list_for_each_entry(chain, hash_head, entry) {
+               if (chain->chain_key == chain_key) {
+                       __raw_spin_unlock(&hash_lock);
+                       goto cache_hit;
+               }
+       }
+       if (unlikely(nr_lock_chains >= MAX_LOCKDEP_CHAINS)) {
+               __raw_spin_unlock(&hash_lock);
+               debug_locks_off();
+               printk("BUG: MAX_LOCKDEP_CHAINS too low!\n");
+               printk("turning off the locking correctness validator.\n");
+               return 0;
+       }
+       chain = lock_chains + nr_lock_chains++;
+       chain->chain_key = chain_key;
+       list_add_tail_rcu(&chain->entry, hash_head);
+       debug_atomic_inc(&chain_lookup_misses);
+#ifdef CONFIG_TRACE_IRQFLAGS
+       if (current->hardirq_context)
+               nr_hardirq_chains++;
+       else {
+               if (current->softirq_context)
+                       nr_softirq_chains++;
+               else
+                       nr_process_chains++;
+       }
+#else
+       nr_process_chains++;
+#endif
+
+       return 1;
+}
+
+/*
+ * We are building curr_chain_key incrementally, so double-check
+ * it from scratch, to make sure that it's done correctly:
+ */
+static void check_chain_key(struct task_struct *curr)
+{
+#ifdef CONFIG_DEBUG_LOCKDEP
+       struct held_lock *hlock, *prev_hlock = NULL;
+       unsigned int i, id;
+       u64 chain_key = 0;
+
+       for (i = 0; i < curr->lockdep_depth; i++) {
+               hlock = curr->held_locks + i;
+               if (chain_key != hlock->prev_chain_key) {
+                       debug_locks_off();
+                       printk("hm#1, depth: %u [%u], %016Lx != %016Lx\n",
+                               curr->lockdep_depth, i,
+                               (unsigned long long)chain_key,
+                               (unsigned long long)hlock->prev_chain_key);
+                       WARN_ON(1);
+                       return;
+               }
+               id = hlock->class - lock_classes;
+               DEBUG_LOCKS_WARN_ON(id >= MAX_LOCKDEP_KEYS);
+               if (prev_hlock && (prev_hlock->irq_context !=
+                                                       hlock->irq_context))
+                       chain_key = 0;
+               chain_key = iterate_chain_key(chain_key, id);
+               prev_hlock = hlock;
+       }
+       if (chain_key != curr->curr_chain_key) {
+               debug_locks_off();
+               printk("hm#2, depth: %u [%u], %016Lx != %016Lx\n",
+                       curr->lockdep_depth, i,
+                       (unsigned long long)chain_key,
+                       (unsigned long long)curr->curr_chain_key);
+               WARN_ON(1);
+       }
+#endif
+}
+
+#ifdef CONFIG_TRACE_IRQFLAGS
+
+/*
+ * print irq inversion bug:
+ */
+static int
+print_irq_inversion_bug(struct task_struct *curr, struct lock_class *other,
+                       struct held_lock *this, int forwards,
+                       const char *irqclass)
+{
+       __raw_spin_unlock(&hash_lock);
+       debug_locks_off();
+       if (debug_locks_silent)
+               return 0;
+
+       printk("\n=========================================================\n");
+       printk(  "[ INFO: possible irq lock inversion dependency detected ]\n");
+       printk(  "---------------------------------------------------------\n");
+       printk("%s/%d just changed the state of lock:\n",
+               curr->comm, curr->pid);
+       print_lock(this);
+       if (forwards)
+               printk("but this lock took another, %s-irq-unsafe lock in the past:\n", irqclass);
+       else
+               printk("but this lock was taken by another, %s-irq-safe lock in the past:\n", irqclass);
+       print_lock_name(other);
+       printk("\n\nand interrupts could create inverse lock ordering between them.\n\n");
+
+       printk("\nother info that might help us debug this:\n");
+       lockdep_print_held_locks(curr);
+
+       printk("\nthe first lock's dependencies:\n");
+       print_lock_dependencies(this->class, 0);
+
+       printk("\nthe second lock's dependencies:\n");
+       print_lock_dependencies(other, 0);
+
+       printk("\nstack backtrace:\n");
+       dump_stack();
+
+       return 0;
+}
+
+/*
+ * Prove that in the forwards-direction subgraph starting at <this>
+ * there is no lock matching <mask>:
+ */
+static int
+check_usage_forwards(struct task_struct *curr, struct held_lock *this,
+                    enum lock_usage_bit bit, const char *irqclass)
+{
+       int ret;
+
+       find_usage_bit = bit;
+       /* fills in <forwards_match> */
+       ret = find_usage_forwards(this->class, 0);
+       if (!ret || ret == 1)
+               return ret;
+
+       return print_irq_inversion_bug(curr, forwards_match, this, 1, irqclass);
+}
+
+/*
+ * Prove that in the backwards-direction subgraph starting at <this>
+ * there is no lock matching <mask>:
+ */
+static int
+check_usage_backwards(struct task_struct *curr, struct held_lock *this,
+                     enum lock_usage_bit bit, const char *irqclass)
+{
+       int ret;
+
+       find_usage_bit = bit;
+       /* fills in <backwards_match> */
+       ret = find_usage_backwards(this->class, 0);
+       if (!ret || ret == 1)
+               return ret;
+
+       return print_irq_inversion_bug(curr, backwards_match, this, 0, irqclass);
+}
+
+static inline void print_irqtrace_events(struct task_struct *curr)
+{
+       printk("irq event stamp: %u\n", curr->irq_events);
+       printk("hardirqs last  enabled at (%u): ", curr->hardirq_enable_event);
+       print_ip_sym(curr->hardirq_enable_ip);
+       printk("hardirqs last disabled at (%u): ", curr->hardirq_disable_event);
+       print_ip_sym(curr->hardirq_disable_ip);
+       printk("softirqs last  enabled at (%u): ", curr->softirq_enable_event);
+       print_ip_sym(curr->softirq_enable_ip);
+       printk("softirqs last disabled at (%u): ", curr->softirq_disable_event);
+       print_ip_sym(curr->softirq_disable_ip);
+}
+
+#else
+static inline void print_irqtrace_events(struct task_struct *curr)
+{
+}
+#endif
+
+static int
+print_usage_bug(struct task_struct *curr, struct held_lock *this,
+               enum lock_usage_bit prev_bit, enum lock_usage_bit new_bit)
+{
+       __raw_spin_unlock(&hash_lock);
+       debug_locks_off();
+       if (debug_locks_silent)
+               return 0;
+
+       printk("\n=================================\n");
+       printk(  "[ INFO: inconsistent lock state ]\n");
+       printk(  "---------------------------------\n");
+
+       printk("inconsistent {%s} -> {%s} usage.\n",
+               usage_str[prev_bit], usage_str[new_bit]);
+
+       printk("%s/%d [HC%u[%lu]:SC%u[%lu]:HE%u:SE%u] takes:\n",
+               curr->comm, curr->pid,
+               trace_hardirq_context(curr), hardirq_count() >> HARDIRQ_SHIFT,
+               trace_softirq_context(curr), softirq_count() >> SOFTIRQ_SHIFT,
+               trace_hardirqs_enabled(curr),
+               trace_softirqs_enabled(curr));
+       print_lock(this);
+
+       printk("{%s} state was registered at:\n", usage_str[prev_bit]);
+       print_stack_trace(this->class->usage_traces + prev_bit, 1);
+
+       print_irqtrace_events(curr);
+       printk("\nother info that might help us debug this:\n");
+       lockdep_print_held_locks(curr);
+
+       printk("\nstack backtrace:\n");
+       dump_stack();
+
+       return 0;
+}
+
+/*
+ * Print out an error if an invalid bit is set:
+ */
+static inline int
+valid_state(struct task_struct *curr, struct held_lock *this,
+           enum lock_usage_bit new_bit, enum lock_usage_bit bad_bit)
+{
+       if (unlikely(this->class->usage_mask & (1 << bad_bit)))
+               return print_usage_bug(curr, this, bad_bit, new_bit);
+       return 1;
+}
+
+#define STRICT_READ_CHECKS     1
+
+/*
+ * Mark a lock with a usage bit, and validate the state transition:
+ */
+static int mark_lock(struct task_struct *curr, struct held_lock *this,
+                    enum lock_usage_bit new_bit, unsigned long ip)
+{
+       unsigned int new_mask = 1 << new_bit, ret = 1;
+
+       /*
+        * If already set then do not dirty the cacheline,
+        * nor do any checks:
+        */
+       if (likely(this->class->usage_mask & new_mask))
+               return 1;
+
+       __raw_spin_lock(&hash_lock);
+       /*
+        * Make sure we didnt race:
+        */
+       if (unlikely(this->class->usage_mask & new_mask)) {
+               __raw_spin_unlock(&hash_lock);
+               return 1;
+       }
+
+       this->class->usage_mask |= new_mask;
+
+#ifdef CONFIG_TRACE_IRQFLAGS
+       if (new_bit == LOCK_ENABLED_HARDIRQS ||
+                       new_bit == LOCK_ENABLED_HARDIRQS_READ)
+               ip = curr->hardirq_enable_ip;
+       else if (new_bit == LOCK_ENABLED_SOFTIRQS ||
+                       new_bit == LOCK_ENABLED_SOFTIRQS_READ)
+               ip = curr->softirq_enable_ip;
+#endif
+       if (!save_trace(this->class->usage_traces + new_bit))
+               return 0;
+
+       switch (new_bit) {
+#ifdef CONFIG_TRACE_IRQFLAGS
+       case LOCK_USED_IN_HARDIRQ:
+               if (!valid_state(curr, this, new_bit, LOCK_ENABLED_HARDIRQS))
+                       return 0;
+               if (!valid_state(curr, this, new_bit,
+                                LOCK_ENABLED_HARDIRQS_READ))
+                       return 0;
+               /*
+                * just marked it hardirq-safe, check that this lock
+                * took no hardirq-unsafe lock in the past:
+                */
+               if (!check_usage_forwards(curr, this,
+                                         LOCK_ENABLED_HARDIRQS, "hard"))
+                       return 0;
+#if STRICT_READ_CHECKS
+               /*
+                * just marked it hardirq-safe, check that this lock
+                * took no hardirq-unsafe-read lock in the past:
+                */
+               if (!check_usage_forwards(curr, this,
+                               LOCK_ENABLED_HARDIRQS_READ, "hard-read"))
+                       return 0;
+#endif
+               if (hardirq_verbose(this->class))
+                       ret = 2;
+               break;
+       case LOCK_USED_IN_SOFTIRQ:
+               if (!valid_state(curr, this, new_bit, LOCK_ENABLED_SOFTIRQS))
+                       return 0;
+               if (!valid_state(curr, this, new_bit,
+                                LOCK_ENABLED_SOFTIRQS_READ))
+                       return 0;
+               /*
+                * just marked it softirq-safe, check that this lock
+                * took no softirq-unsafe lock in the past:
+                */
+               if (!check_usage_forwards(curr, this,
+                                         LOCK_ENABLED_SOFTIRQS, "soft"))
+                       return 0;
+#if STRICT_READ_CHECKS
+               /*
+                * just marked it softirq-safe, check that this lock
+                * took no softirq-unsafe-read lock in the past:
+                */
+               if (!check_usage_forwards(curr, this,
+                               LOCK_ENABLED_SOFTIRQS_READ, "soft-read"))
+                       return 0;
+#endif
+               if (softirq_verbose(this->class))
+                       ret = 2;
+               break;
+       case LOCK_USED_IN_HARDIRQ_READ:
+               if (!valid_state(curr, this, new_bit, LOCK_ENABLED_HARDIRQS))
+                       return 0;
+               /*
+                * just marked it hardirq-read-safe, check that this lock
+                * took no hardirq-unsafe lock in the past:
+                */
+               if (!check_usage_forwards(curr, this,
+                                         LOCK_ENABLED_HARDIRQS, "hard"))
+                       return 0;
+               if (hardirq_verbose(this->class))
+                       ret = 2;
+               break;
+       case LOCK_USED_IN_SOFTIRQ_READ:
+               if (!valid_state(curr, this, new_bit, LOCK_ENABLED_SOFTIRQS))
+                       return 0;
+               /*
+                * just marked it softirq-read-safe, check that this lock
+                * took no softirq-unsafe lock in the past:
+                */
+               if (!check_usage_forwards(curr, this,
+                                         LOCK_ENABLED_SOFTIRQS, "soft"))
+                       return 0;
+               if (softirq_verbose(this->class))
+                       ret = 2;
+               break;
+       case LOCK_ENABLED_HARDIRQS:
+               if (!valid_state(curr, this, new_bit, LOCK_USED_IN_HARDIRQ))
+                       return 0;
+               if (!valid_state(curr, this, new_bit,
+                                LOCK_USED_IN_HARDIRQ_READ))
+                       return 0;
+               /*
+                * just marked it hardirq-unsafe, check that no hardirq-safe
+                * lock in the system ever took it in the past:
+                */
+               if (!check_usage_backwards(curr, this,
+                                          LOCK_USED_IN_HARDIRQ, "hard"))
+                       return 0;
+#if STRICT_READ_CHECKS
+               /*
+                * just marked it hardirq-unsafe, check that no
+                * hardirq-safe-read lock in the system ever took
+                * it in the past:
+                */
+               if (!check_usage_backwards(curr, this,
+                                  LOCK_USED_IN_HARDIRQ_READ, "hard-read"))
+                       return 0;
+#endif
+               if (hardirq_verbose(this->class))
+                       ret = 2;
+               break;
+       case LOCK_ENABLED_SOFTIRQS:
+               if (!valid_state(curr, this, new_bit, LOCK_USED_IN_SOFTIRQ))
+                       return 0;
+               if (!valid_state(curr, this, new_bit,
+                                LOCK_USED_IN_SOFTIRQ_READ))
+                       return 0;
+               /*
+                * just marked it softirq-unsafe, check that no softirq-safe
+                * lock in the system ever took it in the past:
+                */
+               if (!check_usage_backwards(curr, this,
+                                          LOCK_USED_IN_SOFTIRQ, "soft"))
+                       return 0;
+#if STRICT_READ_CHECKS
+               /*
+                * just marked it softirq-unsafe, check that no
+                * softirq-safe-read lock in the system ever took
+                * it in the past:
+                */
+               if (!check_usage_backwards(curr, this,
+                                  LOCK_USED_IN_SOFTIRQ_READ, "soft-read"))
+                       return 0;
+#endif
+               if (softirq_verbose(this->class))
+                       ret = 2;
+               break;
+       case LOCK_ENABLED_HARDIRQS_READ:
+               if (!valid_state(curr, this, new_bit, LOCK_USED_IN_HARDIRQ))
+                       return 0;
+#if STRICT_READ_CHECKS
+               /*
+                * just marked it hardirq-read-unsafe, check that no
+                * hardirq-safe lock in the system ever took it in the past:
+                */
+               if (!check_usage_backwards(curr, this,
+                                          LOCK_USED_IN_HARDIRQ, "hard"))
+                       return 0;
+#endif
+               if (hardirq_verbose(this->class))
+                       ret = 2;
+               break;
+       case LOCK_ENABLED_SOFTIRQS_READ:
+               if (!valid_state(curr, this, new_bit, LOCK_USED_IN_SOFTIRQ))
+                       return 0;
+#if STRICT_READ_CHECKS
+               /*
+                * just marked it softirq-read-unsafe, check that no
+                * softirq-safe lock in the system ever took it in the past:
+                */
+               if (!check_usage_backwards(curr, this,
+                                          LOCK_USED_IN_SOFTIRQ, "soft"))
+                       return 0;
+#endif
+               if (softirq_verbose(this->class))
+                       ret = 2;
+               break;
+#endif
+       case LOCK_USED:
+               /*
+                * Add it to the global list of classes:
+                */
+               list_add_tail_rcu(&this->class->lock_entry, &all_lock_classes);
+               debug_atomic_dec(&nr_unused_locks);
+               break;
+       default:
+               debug_locks_off();
+               WARN_ON(1);
+               return 0;
+       }
+
+       __raw_spin_unlock(&hash_lock);
+
+       /*
+        * We must printk outside of the hash_lock:
+        */
+       if (ret == 2) {
+               printk("\nmarked lock as {%s}:\n", usage_str[new_bit]);
+               print_lock(this);
+               print_irqtrace_events(curr);
+               dump_stack();
+       }
+
+       return ret;
+}
+
+#ifdef CONFIG_TRACE_IRQFLAGS
+/*
+ * Mark all held locks with a usage bit:
+ */
+static int
+mark_held_locks(struct task_struct *curr, int hardirq, unsigned long ip)
+{
+       enum lock_usage_bit usage_bit;
+       struct held_lock *hlock;
+       int i;
+
+       for (i = 0; i < curr->lockdep_depth; i++) {
+               hlock = curr->held_locks + i;
+
+               if (hardirq) {
+                       if (hlock->read)
+                               usage_bit = LOCK_ENABLED_HARDIRQS_READ;
+                       else
+                               usage_bit = LOCK_ENABLED_HARDIRQS;
+               } else {
+                       if (hlock->read)
+                               usage_bit = LOCK_ENABLED_SOFTIRQS_READ;
+                       else
+                               usage_bit = LOCK_ENABLED_SOFTIRQS;
+               }
+               if (!mark_lock(curr, hlock, usage_bit, ip))
+                       return 0;
+       }
+
+       return 1;
+}
+
+/*
+ * Debugging helper: via this flag we know that we are in
+ * 'early bootup code', and will warn about any invalid irqs-on event:
+ */
+static int early_boot_irqs_enabled;
+
+void early_boot_irqs_off(void)
+{
+       early_boot_irqs_enabled = 0;
+}
+
+void early_boot_irqs_on(void)
+{
+       early_boot_irqs_enabled = 1;
+}
+
+/*
+ * Hardirqs will be enabled:
+ */
+void trace_hardirqs_on(void)
+{
+       struct task_struct *curr = current;
+       unsigned long ip;
+
+       if (unlikely(!debug_locks || current->lockdep_recursion))
+               return;
+
+       if (DEBUG_LOCKS_WARN_ON(unlikely(!early_boot_irqs_enabled)))
+               return;
+
+       if (unlikely(curr->hardirqs_enabled)) {
+               debug_atomic_inc(&redundant_hardirqs_on);
+               return;
+       }
+       /* we'll do an OFF -> ON transition: */
+       curr->hardirqs_enabled = 1;
+       ip = (unsigned long) __builtin_return_address(0);
+
+       if (DEBUG_LOCKS_WARN_ON(!irqs_disabled()))
+               return;
+       if (DEBUG_LOCKS_WARN_ON(current->hardirq_context))
+               return;
+       /*
+        * We are going to turn hardirqs on, so set the
+        * usage bit for all held locks:
+        */
+       if (!mark_held_locks(curr, 1, ip))
+               return;
+       /*
+        * If we have softirqs enabled, then set the usage
+        * bit for all held locks. (disabled hardirqs prevented
+        * this bit from being set before)
+        */
+       if (curr->softirqs_enabled)
+               if (!mark_held_locks(curr, 0, ip))
+                       return;
+
+       curr->hardirq_enable_ip = ip;
+       curr->hardirq_enable_event = ++curr->irq_events;
+       debug_atomic_inc(&hardirqs_on_events);
+}
+
+EXPORT_SYMBOL(trace_hardirqs_on);
+
+/*
+ * Hardirqs were disabled:
+ */
+void trace_hardirqs_off(void)
+{
+       struct task_struct *curr = current;
+
+       if (unlikely(!debug_locks || current->lockdep_recursion))
+               return;
+
+       if (DEBUG_LOCKS_WARN_ON(!irqs_disabled()))
+               return;
+
+       if (curr->hardirqs_enabled) {
+               /*
+                * We have done an ON -> OFF transition:
+                */
+               curr->hardirqs_enabled = 0;
+               curr->hardirq_disable_ip = _RET_IP_;
+               curr->hardirq_disable_event = ++curr->irq_events;
+               debug_atomic_inc(&hardirqs_off_events);
+       } else
+               debug_atomic_inc(&redundant_hardirqs_off);
+}
+
+EXPORT_SYMBOL(trace_hardirqs_off);
+
+/*
+ * Softirqs will be enabled:
+ */
+void trace_softirqs_on(unsigned long ip)
+{
+       struct task_struct *curr = current;
+
+       if (unlikely(!debug_locks))
+               return;
+
+       if (DEBUG_LOCKS_WARN_ON(!irqs_disabled()))
+               return;
+
+       if (curr->softirqs_enabled) {
+               debug_atomic_inc(&redundant_softirqs_on);
+               return;
+       }
+
+       /*
+        * We'll do an OFF -> ON transition:
+        */
+       curr->softirqs_enabled = 1;
+       curr->softirq_enable_ip = ip;
+       curr->softirq_enable_event = ++curr->irq_events;
+       debug_atomic_inc(&softirqs_on_events);
+       /*
+        * We are going to turn softirqs on, so set the
+        * usage bit for all held locks, if hardirqs are
+        * enabled too:
+        */
+       if (curr->hardirqs_enabled)
+               mark_held_locks(curr, 0, ip);
+}
+
+/*
+ * Softirqs were disabled:
+ */
+void trace_softirqs_off(unsigned long ip)
+{
+       struct task_struct *curr = current;
+
+       if (unlikely(!debug_locks))
+               return;
+
+       if (DEBUG_LOCKS_WARN_ON(!irqs_disabled()))
+               return;
+
+       if (curr->softirqs_enabled) {
+               /*
+                * We have done an ON -> OFF transition:
+                */
+               curr->softirqs_enabled = 0;
+               curr->softirq_disable_ip = ip;
+               curr->softirq_disable_event = ++curr->irq_events;
+               debug_atomic_inc(&softirqs_off_events);
+               DEBUG_LOCKS_WARN_ON(!softirq_count());
+       } else
+               debug_atomic_inc(&redundant_softirqs_off);
+}
+
+#endif
+
+/*
+ * Initialize a lock instance's lock-class mapping info:
+ */
+void lockdep_init_map(struct lockdep_map *lock, const char *name,
+                     struct lock_class_key *key)
+{
+       if (unlikely(!debug_locks))
+               return;
+
+       if (DEBUG_LOCKS_WARN_ON(!key))
+               return;
+       if (DEBUG_LOCKS_WARN_ON(!name))
+               return;
+       /*
+        * Sanity check, the lock-class key must be persistent:
+        */
+       if (!static_obj(key)) {
+               printk("BUG: key %p not in .data!\n", key);
+               DEBUG_LOCKS_WARN_ON(1);
+               return;
+       }
+       lock->name = name;
+       lock->key = key;
+       memset(lock->class, 0, sizeof(lock->class[0])*MAX_LOCKDEP_SUBCLASSES);
+}
+
+EXPORT_SYMBOL_GPL(lockdep_init_map);
+
+/*
+ * This gets called for every mutex_lock*()/spin_lock*() operation.
+ * We maintain the dependency maps and validate the locking attempt:
+ */
+static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,
+                         int trylock, int read, int check, int hardirqs_off,
+                         unsigned long ip)
+{
+       struct task_struct *curr = current;
+       struct held_lock *hlock;
+       struct lock_class *class;
+       unsigned int depth, id;
+       int chain_head = 0;
+       u64 chain_key;
+
+       if (unlikely(!debug_locks))
+               return 0;
+
+       if (DEBUG_LOCKS_WARN_ON(!irqs_disabled()))
+               return 0;
+
+       if (unlikely(subclass >= MAX_LOCKDEP_SUBCLASSES)) {
+               debug_locks_off();
+               printk("BUG: MAX_LOCKDEP_SUBCLASSES too low!\n");
+               printk("turning off the locking correctness validator.\n");
+               return 0;
+       }
+
+       class = lock->class[subclass];
+       /* not cached yet? */
+       if (unlikely(!class)) {
+               class = register_lock_class(lock, subclass);
+               if (!class)
+                       return 0;
+       }
+       debug_atomic_inc((atomic_t *)&class->ops);
+       if (very_verbose(class)) {
+               printk("\nacquire class [%p] %s", class->key, class->name);
+               if (class->name_version > 1)
+                       printk("#%d", class->name_version);
+               printk("\n");
+               dump_stack();
+       }
+
+       /*
+        * Add the lock to the list of currently held locks.
+        * (we dont increase the depth just yet, up until the
+        * dependency checks are done)
+        */
+       depth = curr->lockdep_depth;
+       if (DEBUG_LOCKS_WARN_ON(depth >= MAX_LOCK_DEPTH))
+               return 0;
+
+       hlock = curr->held_locks + depth;
+
+       hlock->class = class;
+       hlock->acquire_ip = ip;
+       hlock->instance = lock;
+       hlock->trylock = trylock;
+       hlock->read = read;
+       hlock->check = check;
+       hlock->hardirqs_off = hardirqs_off;
+
+       if (check != 2)
+               goto out_calc_hash;
+#ifdef CONFIG_TRACE_IRQFLAGS
+       /*
+        * If non-trylock use in a hardirq or softirq context, then
+        * mark the lock as used in these contexts:
+        */
+       if (!trylock) {
+               if (read) {
+                       if (curr->hardirq_context)
+                               if (!mark_lock(curr, hlock,
+                                               LOCK_USED_IN_HARDIRQ_READ, ip))
+                                       return 0;
+                       if (curr->softirq_context)
+                               if (!mark_lock(curr, hlock,
+                                               LOCK_USED_IN_SOFTIRQ_READ, ip))
+                                       return 0;
+               } else {
+                       if (curr->hardirq_context)
+                               if (!mark_lock(curr, hlock, LOCK_USED_IN_HARDIRQ, ip))
+                                       return 0;
+                       if (curr->softirq_context)
+                               if (!mark_lock(curr, hlock, LOCK_USED_IN_SOFTIRQ, ip))
+                                       return 0;
+               }
+       }
+       if (!hardirqs_off) {
+               if (read) {
+                       if (!mark_lock(curr, hlock,
+                                       LOCK_ENABLED_HARDIRQS_READ, ip))
+                               return 0;
+                       if (curr->softirqs_enabled)
+                               if (!mark_lock(curr, hlock,
+                                               LOCK_ENABLED_SOFTIRQS_READ, ip))
+                                       return 0;
+               } else {
+                       if (!mark_lock(curr, hlock,
+                                       LOCK_ENABLED_HARDIRQS, ip))
+                               return 0;
+                       if (curr->softirqs_enabled)
+                               if (!mark_lock(curr, hlock,
+                                               LOCK_ENABLED_SOFTIRQS, ip))
+                                       return 0;
+               }
+       }
+#endif
+       /* mark it as used: */
+       if (!mark_lock(curr, hlock, LOCK_USED, ip))
+               return 0;
+out_calc_hash:
+       /*
+        * Calculate the chain hash: it's the combined has 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
+        * results.
+        *
+        * The 'key ID' is what is the most compact key value to drive
+        * the hash, not class->key.
+        */
+       id = class - lock_classes;
+       if (DEBUG_LOCKS_WARN_ON(id >= MAX_LOCKDEP_KEYS))
+               return 0;
+
+       chain_key = curr->curr_chain_key;
+       if (!depth) {
+               if (DEBUG_LOCKS_WARN_ON(chain_key != 0))
+                       return 0;
+               chain_head = 1;
+       }
+
+       hlock->prev_chain_key = chain_key;
+
+#ifdef CONFIG_TRACE_IRQFLAGS
+       /*
+        * Keep track of points where we cross into an interrupt context:
+        */
+       hlock->irq_context = 2*(curr->hardirq_context ? 1 : 0) +
+                               curr->softirq_context;
+       if (depth) {
+               struct held_lock *prev_hlock;
+
+               prev_hlock = curr->held_locks + depth-1;
+               /*
+                * If we cross into another context, reset the
+                * hash key (this also prevents the checking and the
+                * adding of the dependency to 'prev'):
+                */
+               if (prev_hlock->irq_context != hlock->irq_context) {
+                       chain_key = 0;
+                       chain_head = 1;
+               }
+       }
+#endif
+       chain_key = iterate_chain_key(chain_key, id);
+       curr->curr_chain_key = chain_key;
+
+       /*
+        * Trylock needs to maintain the stack of held locks, but it
+        * does not add new dependencies, because trylock can be done
+        * in any order.
+        *
+        * We look up the chain_key and do the O(N^2) check and update of
+        * the dependencies only if this is a new dependency chain.
+        * (If lookup_chain_cache() returns with 1 it acquires
+        * hash_lock for us)
+        */
+       if (!trylock && (check == 2) && lookup_chain_cache(chain_key)) {
+               /*
+                * Check whether last held lock:
+                *
+                * - is irq-safe, if this lock is irq-unsafe
+                * - is softirq-safe, if this lock is hardirq-unsafe
+                *
+                * And check whether the new lock's dependency graph
+                * could lead back to the previous lock.
+                *
+                * any of these scenarios could lead to a deadlock. If
+                * All validations
+                */
+               int ret = check_deadlock(curr, hlock, lock, read);
+
+               if (!ret)
+                       return 0;
+               /*
+                * Mark recursive read, as we jump over it when
+                * building dependencies (just like we jump over
+                * trylock entries):
+                */
+               if (ret == 2)
+                       hlock->read = 2;
+               /*
+                * Add dependency only if this lock is not the head
+                * of the chain, and if it's not a secondary read-lock:
+                */
+               if (!chain_head && ret != 2)
+                       if (!check_prevs_add(curr, hlock))
+                               return 0;
+               __raw_spin_unlock(&hash_lock);
+       }
+       curr->lockdep_depth++;
+       check_chain_key(curr);
+       if (unlikely(curr->lockdep_depth >= MAX_LOCK_DEPTH)) {
+               debug_locks_off();
+               printk("BUG: MAX_LOCK_DEPTH too low!\n");
+               printk("turning off the locking correctness validator.\n");
+               return 0;
+       }
+       if (unlikely(curr->lockdep_depth > max_lockdep_depth))
+               max_lockdep_depth = curr->lockdep_depth;
+
+       return 1;
+}
+
+static int
+print_unlock_inbalance_bug(struct task_struct *curr, struct lockdep_map *lock,
+                          unsigned long ip)
+{
+       if (!debug_locks_off())
+               return 0;
+       if (debug_locks_silent)
+               return 0;
+
+       printk("\n=====================================\n");
+       printk(  "[ BUG: bad unlock balance detected! ]\n");
+       printk(  "-------------------------------------\n");
+       printk("%s/%d is trying to release lock (",
+               curr->comm, curr->pid);
+       print_lockdep_cache(lock);
+       printk(") at:\n");
+       print_ip_sym(ip);
+       printk("but there are no more locks to release!\n");
+       printk("\nother info that might help us debug this:\n");
+       lockdep_print_held_locks(curr);
+
+       printk("\nstack backtrace:\n");
+       dump_stack();
+
+       return 0;
+}
+
+/*
+ * Common debugging checks for both nested and non-nested unlock:
+ */
+static int check_unlock(struct task_struct *curr, struct lockdep_map *lock,
+                       unsigned long ip)
+{
+       if (unlikely(!debug_locks))
+               return 0;
+       if (DEBUG_LOCKS_WARN_ON(!irqs_disabled()))
+               return 0;
+
+       if (curr->lockdep_depth <= 0)
+               return print_unlock_inbalance_bug(curr, lock, ip);
+
+       return 1;
+}
+
+/*
+ * Remove the lock to the list of currently held locks in a
+ * potentially non-nested (out of order) manner. This is a
+ * relatively rare operation, as all the unlock APIs default
+ * to nested mode (which uses lock_release()):
+ */
+static int
+lock_release_non_nested(struct task_struct *curr,
+                       struct lockdep_map *lock, unsigned long ip)
+{
+       struct held_lock *hlock, *prev_hlock;
+       unsigned int depth;
+       int i;
+
+       /*
+        * Check whether the lock exists in the current stack
+        * of held locks:
+        */
+       depth = curr->lockdep_depth;
+       if (DEBUG_LOCKS_WARN_ON(!depth))
+               return 0;
+
+       prev_hlock = NULL;
+       for (i = depth-1; i >= 0; i--) {
+               hlock = curr->held_locks + i;
+               /*
+                * We must not cross into another context:
+                */
+               if (prev_hlock && prev_hlock->irq_context != hlock->irq_context)
+                       break;
+               if (hlock->instance == lock)
+                       goto found_it;
+               prev_hlock = hlock;
+       }
+       return print_unlock_inbalance_bug(curr, lock, ip);
+
+found_it:
+       /*
+        * We have the right lock to unlock, 'hlock' points to it.
+        * Now we remove it from the stack, and add back the other
+        * entries (if any), recalculating the hash along the way:
+        */
+       curr->lockdep_depth = i;
+       curr->curr_chain_key = hlock->prev_chain_key;
+
+       for (i++; i < depth; i++) {
+               hlock = curr->held_locks + i;
+               if (!__lock_acquire(hlock->instance,
+                       hlock->class->subclass, hlock->trylock,
+                               hlock->read, hlock->check, hlock->hardirqs_off,
+                               hlock->acquire_ip))
+                       return 0;
+       }
+
+       if (DEBUG_LOCKS_WARN_ON(curr->lockdep_depth != depth - 1))
+               return 0;
+       return 1;
+}
+
+/*
+ * Remove the lock to the list of currently held locks - this gets
+ * called on mutex_unlock()/spin_unlock*() (or on a failed
+ * mutex_lock_interruptible()). This is done for unlocks that nest
+ * perfectly. (i.e. the current top of the lock-stack is unlocked)
+ */
+static int lock_release_nested(struct task_struct *curr,
+                              struct lockdep_map *lock, unsigned long ip)
+{
+       struct held_lock *hlock;
+       unsigned int depth;
+
+       /*
+        * Pop off the top of the lock stack:
+        */
+       depth = curr->lockdep_depth - 1;
+       hlock = curr->held_locks + depth;
+
+       /*
+        * Is the unlock non-nested:
+        */
+       if (hlock->instance != lock)
+               return lock_release_non_nested(curr, lock, ip);
+       curr->lockdep_depth--;
+
+       if (DEBUG_LOCKS_WARN_ON(!depth && (hlock->prev_chain_key != 0)))
+               return 0;
+
+       curr->curr_chain_key = hlock->prev_chain_key;
+
+#ifdef CONFIG_DEBUG_LOCKDEP
+       hlock->prev_chain_key = 0;
+       hlock->class = NULL;
+       hlock->acquire_ip = 0;
+       hlock->irq_context = 0;
+#endif
+       return 1;
+}
+
+/*
+ * Remove the lock to the list of currently held locks - this gets
+ * called on mutex_unlock()/spin_unlock*() (or on a failed
+ * mutex_lock_interruptible()). This is done for unlocks that nest
+ * perfectly. (i.e. the current top of the lock-stack is unlocked)
+ */
+static void
+__lock_release(struct lockdep_map *lock, int nested, unsigned long ip)
+{
+       struct task_struct *curr = current;
+
+       if (!check_unlock(curr, lock, ip))
+               return;
+
+       if (nested) {
+               if (!lock_release_nested(curr, lock, ip))
+                       return;
+       } else {
+               if (!lock_release_non_nested(curr, lock, ip))
+                       return;
+       }
+
+       check_chain_key(curr);
+}
+
+/*
+ * Check whether we follow the irq-flags state precisely:
+ */
+static void check_flags(unsigned long flags)
+{
+#if defined(CONFIG_DEBUG_LOCKDEP) && defined(CONFIG_TRACE_IRQFLAGS)
+       if (!debug_locks)
+               return;
+
+       if (irqs_disabled_flags(flags))
+               DEBUG_LOCKS_WARN_ON(current->hardirqs_enabled);
+       else
+               DEBUG_LOCKS_WARN_ON(!current->hardirqs_enabled);
+
+       /*
+        * We dont accurately track softirq state in e.g.
+        * hardirq contexts (such as on 4KSTACKS), so only
+        * check if not in hardirq contexts:
+        */
+       if (!hardirq_count()) {
+               if (softirq_count())
+                       DEBUG_LOCKS_WARN_ON(current->softirqs_enabled);
+               else
+                       DEBUG_LOCKS_WARN_ON(!current->softirqs_enabled);
+       }
+
+       if (!debug_locks)
+               print_irqtrace_events(current);
+#endif
+}
+
+/*
+ * We are not always called with irqs disabled - do that here,
+ * and also avoid lockdep recursion:
+ */
+void lock_acquire(struct lockdep_map *lock, unsigned int subclass,
+                 int trylock, int read, int check, unsigned long ip)
+{
+       unsigned long flags;
+
+       if (unlikely(current->lockdep_recursion))
+               return;
+
+       raw_local_irq_save(flags);
+       check_flags(flags);
+
+       current->lockdep_recursion = 1;
+       __lock_acquire(lock, subclass, trylock, read, check,
+                      irqs_disabled_flags(flags), ip);
+       current->lockdep_recursion = 0;
+       raw_local_irq_restore(flags);
+}
+
+EXPORT_SYMBOL_GPL(lock_acquire);
+
+void lock_release(struct lockdep_map *lock, int nested, unsigned long ip)
+{
+       unsigned long flags;
+
+       if (unlikely(current->lockdep_recursion))
+               return;
+
+       raw_local_irq_save(flags);
+       check_flags(flags);
+       current->lockdep_recursion = 1;
+       __lock_release(lock, nested, ip);
+       current->lockdep_recursion = 0;
+       raw_local_irq_restore(flags);
+}
+
+EXPORT_SYMBOL_GPL(lock_release);
+
+/*
+ * Used by the testsuite, sanitize the validator state
+ * after a simulated failure:
+ */
+
+void lockdep_reset(void)
+{
+       unsigned long flags;
+
+       raw_local_irq_save(flags);
+       current->curr_chain_key = 0;
+       current->lockdep_depth = 0;
+       current->lockdep_recursion = 0;
+       memset(current->held_locks, 0, MAX_LOCK_DEPTH*sizeof(struct held_lock));
+       nr_hardirq_chains = 0;
+       nr_softirq_chains = 0;
+       nr_process_chains = 0;
+       debug_locks = 1;
+       raw_local_irq_restore(flags);
+}
+
+static void zap_class(struct lock_class *class)
+{
+       int i;
+
+       /*
+        * Remove all dependencies this lock is
+        * involved in:
+        */
+       for (i = 0; i < nr_list_entries; i++) {
+               if (list_entries[i].class == class)
+                       list_del_rcu(&list_entries[i].entry);
+       }
+       /*
+        * Unhash the class and remove it from the all_lock_classes list:
+        */
+       list_del_rcu(&class->hash_entry);
+       list_del_rcu(&class->lock_entry);
+
+}
+
+static inline int within(void *addr, void *start, unsigned long size)
+{
+       return addr >= start && addr < start + size;
+}
+
+void lockdep_free_key_range(void *start, unsigned long size)
+{
+       struct lock_class *class, *next;
+       struct list_head *head;
+       unsigned long flags;
+       int i;
+
+       raw_local_irq_save(flags);
+       __raw_spin_lock(&hash_lock);
+
+       /*
+        * Unhash all classes that were created by this module:
+        */
+       for (i = 0; i < CLASSHASH_SIZE; i++) {
+               head = classhash_table + i;
+               if (list_empty(head))
+                       continue;
+               list_for_each_entry_safe(class, next, head, hash_entry)
+                       if (within(class->key, start, size))
+                               zap_class(class);
+       }
+
+       __raw_spin_unlock(&hash_lock);
+       raw_local_irq_restore(flags);
+}
+
+void lockdep_reset_lock(struct lockdep_map *lock)
+{
+       struct lock_class *class, *next, *entry;
+       struct list_head *head;
+       unsigned long flags;
+       int i, j;
+
+       raw_local_irq_save(flags);
+       __raw_spin_lock(&hash_lock);
+
+       /*
+        * Remove all classes this lock has:
+        */
+       for (i = 0; i < CLASSHASH_SIZE; i++) {
+               head = classhash_table + i;
+               if (list_empty(head))
+                       continue;
+               list_for_each_entry_safe(class, next, head, hash_entry) {
+                       for (j = 0; j < MAX_LOCKDEP_SUBCLASSES; j++) {
+                               entry = lock->class[j];
+                               if (class == entry) {
+                                       zap_class(class);
+                                       lock->class[j] = NULL;
+                                       break;
+                               }
+                       }
+               }
+       }
+
+       /*
+        * Debug check: in the end all mapped classes should
+        * be gone.
+        */
+       for (j = 0; j < MAX_LOCKDEP_SUBCLASSES; j++) {
+               entry = lock->class[j];
+               if (!entry)
+                       continue;
+               __raw_spin_unlock(&hash_lock);
+               DEBUG_LOCKS_WARN_ON(1);
+               raw_local_irq_restore(flags);
+               return;
+       }
+
+       __raw_spin_unlock(&hash_lock);
+       raw_local_irq_restore(flags);
+}
+
+void __init lockdep_init(void)
+{
+       int i;
+
+       /*
+        * Some architectures have their own start_kernel()
+        * code which calls lockdep_init(), while we also
+        * call lockdep_init() from the start_kernel() itself,
+        * and we want to initialize the hashes only once:
+        */
+       if (lockdep_initialized)
+               return;
+
+       for (i = 0; i < CLASSHASH_SIZE; i++)
+               INIT_LIST_HEAD(classhash_table + i);
+
+       for (i = 0; i < CHAINHASH_SIZE; i++)
+               INIT_LIST_HEAD(chainhash_table + i);
+
+       lockdep_initialized = 1;
+}
+
+void __init lockdep_info(void)
+{
+       printk("Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar\n");
+
+       printk("... MAX_LOCKDEP_SUBCLASSES:    %lu\n", MAX_LOCKDEP_SUBCLASSES);
+       printk("... MAX_LOCK_DEPTH:          %lu\n", MAX_LOCK_DEPTH);
+       printk("... MAX_LOCKDEP_KEYS:        %lu\n", MAX_LOCKDEP_KEYS);
+       printk("... CLASSHASH_SIZE:           %lu\n", CLASSHASH_SIZE);
+       printk("... MAX_LOCKDEP_ENTRIES:     %lu\n", MAX_LOCKDEP_ENTRIES);
+       printk("... MAX_LOCKDEP_CHAINS:      %lu\n", MAX_LOCKDEP_CHAINS);
+       printk("... CHAINHASH_SIZE:          %lu\n", CHAINHASH_SIZE);
+
+       printk(" memory used by lock dependency info: %lu kB\n",
+               (sizeof(struct lock_class) * MAX_LOCKDEP_KEYS +
+               sizeof(struct list_head) * CLASSHASH_SIZE +
+               sizeof(struct lock_list) * MAX_LOCKDEP_ENTRIES +
+               sizeof(struct lock_chain) * MAX_LOCKDEP_CHAINS +
+               sizeof(struct list_head) * CHAINHASH_SIZE) / 1024);
+
+       printk(" per task-struct memory footprint: %lu bytes\n",
+               sizeof(struct held_lock) * MAX_LOCK_DEPTH);
+
+#ifdef CONFIG_DEBUG_LOCKDEP
+       if (lockdep_init_error)
+               printk("WARNING: lockdep init error! Arch code didnt call lockdep_init() early enough?\n");
+#endif
+}
+
+static inline int in_range(const void *start, const void *addr, const void *end)
+{
+       return addr >= start && addr <= end;
+}
+
+static void
+print_freed_lock_bug(struct task_struct *curr, const void *mem_from,
+                    const void *mem_to)
+{
+       if (!debug_locks_off())
+               return;
+       if (debug_locks_silent)
+               return;
+
+       printk("\n=========================\n");
+       printk(  "[ BUG: held lock freed! ]\n");
+       printk(  "-------------------------\n");
+       printk("%s/%d is freeing memory %p-%p, with a lock still held there!\n",
+               curr->comm, curr->pid, mem_from, mem_to-1);
+       lockdep_print_held_locks(curr);
+
+       printk("\nstack backtrace:\n");
+       dump_stack();
+}
+
+/*
+ * Called when kernel memory is freed (or unmapped), or if a lock
+ * is destroyed or reinitialized - this code checks whether there is
+ * any held lock in the memory range of <from> to <to>:
+ */
+void debug_check_no_locks_freed(const void *mem_from, unsigned long mem_len)
+{
+       const void *mem_to = mem_from + mem_len, *lock_from, *lock_to;
+       struct task_struct *curr = current;
+       struct held_lock *hlock;
+       unsigned long flags;
+       int i;
+
+       if (unlikely(!debug_locks))
+               return;
+
+       local_irq_save(flags);
+       for (i = 0; i < curr->lockdep_depth; i++) {
+               hlock = curr->held_locks + i;
+
+               lock_from = (void *)hlock->instance;
+               lock_to = (void *)(hlock->instance + 1);
+
+               if (!in_range(mem_from, lock_from, mem_to) &&
+                                       !in_range(mem_from, lock_to, mem_to))
+                       continue;
+
+               print_freed_lock_bug(curr, mem_from, mem_to);
+               break;
+       }
+       local_irq_restore(flags);
+}
+
+static void print_held_locks_bug(struct task_struct *curr)
+{
+       if (!debug_locks_off())
+               return;
+       if (debug_locks_silent)
+               return;
+
+       printk("\n=====================================\n");
+       printk(  "[ BUG: lock held at task exit time! ]\n");
+       printk(  "-------------------------------------\n");
+       printk("%s/%d is exiting with locks still held!\n",
+               curr->comm, curr->pid);
+       lockdep_print_held_locks(curr);
+
+       printk("\nstack backtrace:\n");
+       dump_stack();
+}
+
+void debug_check_no_locks_held(struct task_struct *task)
+{
+       if (unlikely(task->lockdep_depth > 0))
+               print_held_locks_bug(task);
+}
+
+void debug_show_all_locks(void)
+{
+       struct task_struct *g, *p;
+       int count = 10;
+       int unlock = 1;
+
+       printk("\nShowing all locks held in the system:\n");
+
+       /*
+        * Here we try to get the tasklist_lock as hard as possible,
+        * if not successful after 2 seconds we ignore it (but keep
+        * trying). This is to enable a debug printout even if a
+        * tasklist_lock-holding task deadlocks or crashes.
+        */
+retry:
+       if (!read_trylock(&tasklist_lock)) {
+               if (count == 10)
+                       printk("hm, tasklist_lock locked, retrying... ");
+               if (count) {
+                       count--;
+                       printk(" #%d", 10-count);
+                       mdelay(200);
+                       goto retry;
+               }
+               printk(" ignoring it.\n");
+               unlock = 0;
+       }
+       if (count != 10)
+               printk(" locked it.\n");
+
+       do_each_thread(g, p) {
+               if (p->lockdep_depth)
+                       lockdep_print_held_locks(p);
+               if (!unlock)
+                       if (read_trylock(&tasklist_lock))
+                               unlock = 1;
+       } while_each_thread(g, p);
+
+       printk("\n");
+       printk("=============================================\n\n");
+
+       if (unlock)
+               read_unlock(&tasklist_lock);
+}
+
+EXPORT_SYMBOL_GPL(debug_show_all_locks);
+
+void debug_show_held_locks(struct task_struct *task)
+{
+       lockdep_print_held_locks(task);
+}
+
+EXPORT_SYMBOL_GPL(debug_show_held_locks);
+
diff --git a/kernel/lockdep_internals.h b/kernel/lockdep_internals.h
new file mode 100644 (file)
index 0000000..0d355f2
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * kernel/lockdep_internals.h
+ *
+ * Runtime locking correctness validator
+ *
+ * lockdep subsystem internal functions and variables.
+ */
+
+/*
+ * MAX_LOCKDEP_ENTRIES is the maximum number of lock dependencies
+ * we track.
+ *
+ * We use the per-lock dependency maps in two ways: we grow it by adding
+ * every to-be-taken lock to all currently held lock's own dependency
+ * table (if it's not there yet), and we check it for lock order
+ * conflicts and deadlocks.
+ */
+#define MAX_LOCKDEP_ENTRIES    8192UL
+
+#define MAX_LOCKDEP_KEYS_BITS  11
+#define MAX_LOCKDEP_KEYS       (1UL << MAX_LOCKDEP_KEYS_BITS)
+
+#define MAX_LOCKDEP_CHAINS_BITS        13
+#define MAX_LOCKDEP_CHAINS     (1UL << MAX_LOCKDEP_CHAINS_BITS)
+
+/*
+ * Stack-trace: tightly packed array of stack backtrace
+ * addresses. Protected by the hash_lock.
+ */
+#define MAX_STACK_TRACE_ENTRIES        131072UL
+
+extern struct list_head all_lock_classes;
+
+extern void
+get_usage_chars(struct lock_class *class, char *c1, char *c2, char *c3, char *c4);
+
+extern const char * __get_key_name(struct lockdep_subclass_key *key, char *str);
+
+extern unsigned long nr_lock_classes;
+extern unsigned long nr_list_entries;
+extern unsigned long nr_lock_chains;
+extern unsigned long nr_stack_trace_entries;
+
+extern unsigned int nr_hardirq_chains;
+extern unsigned int nr_softirq_chains;
+extern unsigned int nr_process_chains;
+extern unsigned int max_lockdep_depth;
+extern unsigned int max_recursion_depth;
+
+#ifdef CONFIG_DEBUG_LOCKDEP
+/*
+ * Various lockdep statistics:
+ */
+extern atomic_t chain_lookup_hits;
+extern atomic_t chain_lookup_misses;
+extern atomic_t hardirqs_on_events;
+extern atomic_t hardirqs_off_events;
+extern atomic_t redundant_hardirqs_on;
+extern atomic_t redundant_hardirqs_off;
+extern atomic_t softirqs_on_events;
+extern atomic_t softirqs_off_events;
+extern atomic_t redundant_softirqs_on;
+extern atomic_t redundant_softirqs_off;
+extern atomic_t nr_unused_locks;
+extern atomic_t nr_cyclic_checks;
+extern atomic_t nr_cyclic_check_recursions;
+extern atomic_t nr_find_usage_forwards_checks;
+extern atomic_t nr_find_usage_forwards_recursions;
+extern atomic_t nr_find_usage_backwards_checks;
+extern atomic_t nr_find_usage_backwards_recursions;
+# define debug_atomic_inc(ptr)         atomic_inc(ptr)
+# define debug_atomic_dec(ptr)         atomic_dec(ptr)
+# define debug_atomic_read(ptr)                atomic_read(ptr)
+#else
+# define debug_atomic_inc(ptr)         do { } while (0)
+# define debug_atomic_dec(ptr)         do { } while (0)
+# define debug_atomic_read(ptr)                0
+#endif
diff --git a/kernel/lockdep_proc.c b/kernel/lockdep_proc.c
new file mode 100644 (file)
index 0000000..f6e72ea
--- /dev/null
@@ -0,0 +1,345 @@
+/*
+ * kernel/lockdep_proc.c
+ *
+ * Runtime locking correctness validator
+ *
+ * Started by Ingo Molnar:
+ *
+ *  Copyright (C) 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
+ *
+ * Code for /proc/lockdep and /proc/lockdep_stats:
+ *
+ */
+#include <linux/sched.h>
+#include <linux/module.h>
+#include <linux/proc_fs.h>
+#include <linux/seq_file.h>
+#include <linux/kallsyms.h>
+#include <linux/debug_locks.h>
+
+#include "lockdep_internals.h"
+
+static void *l_next(struct seq_file *m, void *v, loff_t *pos)
+{
+       struct lock_class *class = v;
+
+       (*pos)++;
+
+       if (class->lock_entry.next != &all_lock_classes)
+               class = list_entry(class->lock_entry.next, struct lock_class,
+                                 lock_entry);
+       else
+               class = NULL;
+       m->private = class;
+
+       return class;
+}
+
+static void *l_start(struct seq_file *m, loff_t *pos)
+{
+       struct lock_class *class = m->private;
+
+       if (&class->lock_entry == all_lock_classes.next)
+               seq_printf(m, "all lock classes:\n");
+
+       return class;
+}
+
+static void l_stop(struct seq_file *m, void *v)
+{
+}
+
+static unsigned long count_forward_deps(struct lock_class *class)
+{
+       struct lock_list *entry;
+       unsigned long ret = 1;
+
+       /*
+        * Recurse this class's dependency list:
+        */
+       list_for_each_entry(entry, &class->locks_after, entry)
+               ret += count_forward_deps(entry->class);
+
+       return ret;
+}
+
+static unsigned long count_backward_deps(struct lock_class *class)
+{
+       struct lock_list *entry;
+       unsigned long ret = 1;
+
+       /*
+        * Recurse this class's dependency list:
+        */
+       list_for_each_entry(entry, &class->locks_before, entry)
+               ret += count_backward_deps(entry->class);
+
+       return ret;
+}
+
+static int l_show(struct seq_file *m, void *v)
+{
+       unsigned long nr_forward_deps, nr_backward_deps;
+       struct lock_class *class = m->private;
+       char str[128], c1, c2, c3, c4;
+       const char *name;
+
+       seq_printf(m, "%p", class->key);
+#ifdef CONFIG_DEBUG_LOCKDEP
+       seq_printf(m, " OPS:%8ld", class->ops);
+#endif
+       nr_forward_deps = count_forward_deps(class);
+       seq_printf(m, " FD:%5ld", nr_forward_deps);
+
+       nr_backward_deps = count_backward_deps(class);
+       seq_printf(m, " BD:%5ld", nr_backward_deps);
+
+       get_usage_chars(class, &c1, &c2, &c3, &c4);
+       seq_printf(m, " %c%c%c%c", c1, c2, c3, c4);
+
+       name = class->name;
+       if (!name) {
+               name = __get_key_name(class->key, str);
+               seq_printf(m, ": %s", name);
+       } else{
+               seq_printf(m, ": %s", name);
+               if (class->name_version > 1)
+                       seq_printf(m, "#%d", class->name_version);
+               if (class->subclass)
+                       seq_printf(m, "/%d", class->subclass);
+       }
+       seq_puts(m, "\n");
+
+       return 0;
+}
+
+static struct seq_operations lockdep_ops = {
+       .start  = l_start,
+       .next   = l_next,
+       .stop   = l_stop,
+       .show   = l_show,
+};
+
+static int lockdep_open(struct inode *inode, struct file *file)
+{
+       int res = seq_open(file, &lockdep_ops);
+       if (!res) {
+               struct seq_file *m = file->private_data;
+
+               if (!list_empty(&all_lock_classes))
+                       m->private = list_entry(all_lock_classes.next,
+                                       struct lock_class, lock_entry);
+               else
+                       m->private = NULL;
+       }
+       return res;
+}
+
+static struct file_operations proc_lockdep_operations = {
+       .open           = lockdep_open,
+       .read           = seq_read,
+       .llseek         = seq_lseek,
+       .release        = seq_release,
+};
+
+static void lockdep_stats_debug_show(struct seq_file *m)
+{
+#ifdef CONFIG_DEBUG_LOCKDEP
+       unsigned int hi1 = debug_atomic_read(&hardirqs_on_events),
+                    hi2 = debug_atomic_read(&hardirqs_off_events),
+                    hr1 = debug_atomic_read(&redundant_hardirqs_on),
+                    hr2 = debug_atomic_read(&redundant_hardirqs_off),
+                    si1 = debug_atomic_read(&softirqs_on_events),
+                    si2 = debug_atomic_read(&softirqs_off_events),
+                    sr1 = debug_atomic_read(&redundant_softirqs_on),
+                    sr2 = debug_atomic_read(&redundant_softirqs_off);
+
+       seq_printf(m, " chain lookup misses:           %11u\n",
+               debug_atomic_read(&chain_lookup_misses));
+       seq_printf(m, " chain lookup hits:             %11u\n",
+               debug_atomic_read(&chain_lookup_hits));
+       seq_printf(m, " cyclic checks:                 %11u\n",
+               debug_atomic_read(&nr_cyclic_checks));
+       seq_printf(m, " cyclic-check recursions:       %11u\n",
+               debug_atomic_read(&nr_cyclic_check_recursions));
+       seq_printf(m, " find-mask forwards checks:     %11u\n",
+               debug_atomic_read(&nr_find_usage_forwards_checks));
+       seq_printf(m, " find-mask forwards recursions: %11u\n",
+               debug_atomic_read(&nr_find_usage_forwards_recursions));
+       seq_printf(m, " find-mask backwards checks:    %11u\n",
+               debug_atomic_read(&nr_find_usage_backwards_checks));
+       seq_printf(m, " find-mask backwards recursions:%11u\n",
+               debug_atomic_read(&nr_find_usage_backwards_recursions));
+
+       seq_printf(m, " hardirq on events:             %11u\n", hi1);
+       seq_printf(m, " hardirq off events:            %11u\n", hi2);
+       seq_printf(m, " redundant hardirq ons:         %11u\n", hr1);
+       seq_printf(m, " redundant hardirq offs:        %11u\n", hr2);
+       seq_printf(m, " softirq on events:             %11u\n", si1);
+       seq_printf(m, " softirq off events:            %11u\n", si2);
+       seq_printf(m, " redundant softirq ons:         %11u\n", sr1);
+       seq_printf(m, " redundant softirq offs:        %11u\n", sr2);
+#endif
+}
+
+static int lockdep_stats_show(struct seq_file *m, void *v)
+{
+       struct lock_class *class;
+       unsigned long nr_unused = 0, nr_uncategorized = 0,
+                     nr_irq_safe = 0, nr_irq_unsafe = 0,
+                     nr_softirq_safe = 0, nr_softirq_unsafe = 0,
+                     nr_hardirq_safe = 0, nr_hardirq_unsafe = 0,
+                     nr_irq_read_safe = 0, nr_irq_read_unsafe = 0,
+                     nr_softirq_read_safe = 0, nr_softirq_read_unsafe = 0,
+                     nr_hardirq_read_safe = 0, nr_hardirq_read_unsafe = 0,
+                     sum_forward_deps = 0, factor = 0;
+
+       list_for_each_entry(class, &all_lock_classes, lock_entry) {
+
+               if (class->usage_mask == 0)
+                       nr_unused++;
+               if (class->usage_mask == LOCKF_USED)
+                       nr_uncategorized++;
+               if (class->usage_mask & LOCKF_USED_IN_IRQ)
+                       nr_irq_safe++;
+               if (class->usage_mask & LOCKF_ENABLED_IRQS)
+                       nr_irq_unsafe++;
+               if (class->usage_mask & LOCKF_USED_IN_SOFTIRQ)
+                       nr_softirq_safe++;
+               if (class->usage_mask & LOCKF_ENABLED_SOFTIRQS)
+                       nr_softirq_unsafe++;
+               if (class->usage_mask & LOCKF_USED_IN_HARDIRQ)
+                       nr_hardirq_safe++;
+               if (class->usage_mask & LOCKF_ENABLED_HARDIRQS)
+                       nr_hardirq_unsafe++;
+               if (class->usage_mask & LOCKF_USED_IN_IRQ_READ)
+                       nr_irq_read_safe++;
+               if (class->usage_mask & LOCKF_ENABLED_IRQS_READ)
+                       nr_irq_read_unsafe++;
+               if (class->usage_mask & LOCKF_USED_IN_SOFTIRQ_READ)
+                       nr_softirq_read_safe++;
+               if (class->usage_mask & LOCKF_ENABLED_SOFTIRQS_READ)
+                       nr_softirq_read_unsafe++;
+               if (class->usage_mask & LOCKF_USED_IN_HARDIRQ_READ)
+                       nr_hardirq_read_safe++;
+               if (class->usage_mask & LOCKF_ENABLED_HARDIRQS_READ)
+                       nr_hardirq_read_unsafe++;
+
+               sum_forward_deps += count_forward_deps(class);
+       }
+#ifdef CONFIG_LOCKDEP_DEBUG
+       DEBUG_LOCKS_WARN_ON(debug_atomic_read(&nr_unused_locks) != nr_unused);
+#endif
+       seq_printf(m, " lock-classes:                  %11lu [max: %lu]\n",
+                       nr_lock_classes, MAX_LOCKDEP_KEYS);
+       seq_printf(m, " direct dependencies:           %11lu [max: %lu]\n",
+                       nr_list_entries, MAX_LOCKDEP_ENTRIES);
+       seq_printf(m, " indirect dependencies:         %11lu\n",
+                       sum_forward_deps);
+
+       /*
+        * Total number of dependencies:
+        *
+        * All irq-safe locks may nest inside irq-unsafe locks,
+        * plus all the other known dependencies:
+        */
+       seq_printf(m, " all direct dependencies:       %11lu\n",
+                       nr_irq_unsafe * nr_irq_safe +
+                       nr_hardirq_unsafe * nr_hardirq_safe +
+                       nr_list_entries);
+
+       /*
+        * Estimated factor between direct and indirect
+        * dependencies:
+        */
+       if (nr_list_entries)
+               factor = sum_forward_deps / nr_list_entries;
+
+       seq_printf(m, " dependency chains:             %11lu [max: %lu]\n",
+                       nr_lock_chains, MAX_LOCKDEP_CHAINS);
+
+#ifdef CONFIG_TRACE_IRQFLAGS
+       seq_printf(m, " in-hardirq chains:             %11u\n",
+                       nr_hardirq_chains);
+       seq_printf(m, " in-softirq chains:             %11u\n",
+                       nr_softirq_chains);
+#endif
+       seq_printf(m, " in-process chains:             %11u\n",
+                       nr_process_chains);
+       seq_printf(m, " stack-trace entries:           %11lu [max: %lu]\n",
+                       nr_stack_trace_entries, MAX_STACK_TRACE_ENTRIES);
+       seq_printf(m, " combined max dependencies:     %11u\n",
+                       (nr_hardirq_chains + 1) *
+                       (nr_softirq_chains + 1) *
+                       (nr_process_chains + 1)
+       );
+       seq_printf(m, " hardirq-safe locks:            %11lu\n",
+                       nr_hardirq_safe);
+       seq_printf(m, " hardirq-unsafe locks:          %11lu\n",
+                       nr_hardirq_unsafe);
+       seq_printf(m, " softirq-safe locks:            %11lu\n",
+                       nr_softirq_safe);
+       seq_printf(m, " softirq-unsafe locks:          %11lu\n",
+                       nr_softirq_unsafe);
+       seq_printf(m, " irq-safe locks:                %11lu\n",
+                       nr_irq_safe);
+       seq_printf(m, " irq-unsafe locks:              %11lu\n",
+                       nr_irq_unsafe);
+
+       seq_printf(m, " hardirq-read-safe locks:       %11lu\n",
+                       nr_hardirq_read_safe);
+       seq_printf(m, " hardirq-read-unsafe locks:     %11lu\n",
+                       nr_hardirq_read_unsafe);
+       seq_printf(m, " softirq-read-safe locks:       %11lu\n",
+                       nr_softirq_read_safe);
+       seq_printf(m, " softirq-read-unsafe locks:     %11lu\n",
+                       nr_softirq_read_unsafe);
+       seq_printf(m, " irq-read-safe locks:           %11lu\n",
+                       nr_irq_read_safe);
+       seq_printf(m, " irq-read-unsafe locks:         %11lu\n",
+                       nr_irq_read_unsafe);
+
+       seq_printf(m, " uncategorized locks:           %11lu\n",
+                       nr_uncategorized);
+       seq_printf(m, " unused locks:                  %11lu\n",
+                       nr_unused);
+       seq_printf(m, " max locking depth:             %11u\n",
+                       max_lockdep_depth);
+       seq_printf(m, " max recursion depth:           %11u\n",
+                       max_recursion_depth);
+       lockdep_stats_debug_show(m);
+       seq_printf(m, " debug_locks:                   %11u\n",
+                       debug_locks);
+
+       return 0;
+}
+
+static int lockdep_stats_open(struct inode *inode, struct file *file)
+{
+       return single_open(file, lockdep_stats_show, NULL);
+}
+
+static struct file_operations proc_lockdep_stats_operations = {
+       .open           = lockdep_stats_open,
+       .read           = seq_read,
+       .llseek         = seq_lseek,
+       .release        = seq_release,
+};
+
+static int __init lockdep_proc_init(void)
+{
+       struct proc_dir_entry *entry;
+
+       entry = create_proc_entry("lockdep", S_IRUSR, NULL);
+       if (entry)
+               entry->proc_fops = &proc_lockdep_operations;
+
+       entry = create_proc_entry("lockdep_stats", S_IRUSR, NULL);
+       if (entry)
+               entry->proc_fops = &proc_lockdep_stats_operations;
+
+       return 0;
+}
+
+__initcall(lockdep_proc_init);
+
index 99c022ac3d21c7105e5d37fdc288e0dc7527d8a8..35e1b1f859d715053376e638c35ec5569ca51053 100644 (file)
@@ -16,7 +16,6 @@
     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/config.h>
 #include <linux/module.h>
 #include <linux/moduleloader.h>
 #include <linux/init.h>
@@ -1122,6 +1121,9 @@ static void free_module(struct module *mod)
        if (mod->percpu)
                percpu_modfree(mod->percpu);
 
+       /* Free lock-classes: */
+       lockdep_free_key_range(mod->module_core, mod->core_size);
+
        /* Finally, free the core (containing the module structure) */
        module_free(mod, mod->module_core);
 }
@@ -2160,6 +2162,29 @@ const struct exception_table_entry *search_module_extables(unsigned long addr)
        return e;
 }
 
+/*
+ * Is this a valid module address?
+ */
+int is_module_address(unsigned long addr)
+{
+       unsigned long flags;
+       struct module *mod;
+
+       spin_lock_irqsave(&modlist_lock, flags);
+
+       list_for_each_entry(mod, &modules, list) {
+               if (within(addr, mod->module_core, mod->core_size)) {
+                       spin_unlock_irqrestore(&modlist_lock, flags);
+                       return 1;
+               }
+       }
+
+       spin_unlock_irqrestore(&modlist_lock, flags);
+
+       return 0;
+}
+
+
 /* Is this a valid kernel address?  We don't grab the lock: we are oopsing. */
 struct module *__module_text_address(unsigned long addr)
 {
index e38e4bac97cac6dde3cacd552f189ef77882bb62..e3203c654dda80ab646ffcbd4b0306e942fde846 100644 (file)
 #include <linux/spinlock.h>
 #include <linux/kallsyms.h>
 #include <linux/interrupt.h>
+#include <linux/debug_locks.h>
 
 #include "mutex-debug.h"
 
-/*
- * We need a global lock when we walk through the multi-process
- * lock tree. Only used in the deadlock-debugging case.
- */
-DEFINE_SPINLOCK(debug_mutex_lock);
-
-/*
- * All locks held by all tasks, in a single global list:
- */
-LIST_HEAD(debug_mutex_held_locks);
-
-/*
- * In the debug case we carry the caller's instruction pointer into
- * other functions, but we dont want the function argument overhead
- * in the nondebug case - hence these macros:
- */
-#define __IP_DECL__            , unsigned long ip
-#define __IP__                 , ip
-#define __RET_IP__             , (unsigned long)__builtin_return_address(0)
-
-/*
- * "mutex debugging enabled" flag. We turn it off when we detect
- * the first problem because we dont want to recurse back
- * into the tracing code when doing error printk or
- * executing a BUG():
- */
-int debug_mutex_on = 1;
-
-static void printk_task(struct task_struct *p)
-{
-       if (p)
-               printk("%16s:%5d [%p, %3d]", p->comm, p->pid, p, p->prio);
-       else
-               printk("<none>");
-}
-
-static void printk_ti(struct thread_info *ti)
-{
-       if (ti)
-               printk_task(ti->task);
-       else
-               printk("<none>");
-}
-
-static void printk_task_short(struct task_struct *p)
-{
-       if (p)
-               printk("%s/%d [%p, %3d]", p->comm, p->pid, p, p->prio);
-       else
-               printk("<none>");
-}
-
-static void printk_lock(struct mutex *lock, int print_owner)
-{
-       printk(" [%p] {%s}\n", lock, lock->name);
-
-       if (print_owner && lock->owner) {
-               printk(".. held by:  ");
-               printk_ti(lock->owner);
-               printk("\n");
-       }
-       if (lock->owner) {
-               printk("... acquired at:               ");
-               print_symbol("%s\n", lock->acquire_ip);
-       }
-}
-
-/*
- * printk locks held by a task:
- */
-static void show_task_locks(struct task_struct *p)
-{
-       switch (p->state) {
-       case TASK_RUNNING:              printk("R"); break;
-       case TASK_INTERRUPTIBLE:        printk("S"); break;
-       case TASK_UNINTERRUPTIBLE:      printk("D"); break;
-       case TASK_STOPPED:              printk("T"); break;
-       case EXIT_ZOMBIE:               printk("Z"); break;
-       case EXIT_DEAD:                 printk("X"); break;
-       default:                        printk("?"); break;
-       }
-       printk_task(p);
-       if (p->blocked_on) {
-               struct mutex *lock = p->blocked_on->lock;
-
-               printk(" blocked on mutex:");
-               printk_lock(lock, 1);
-       } else
-               printk(" (not blocked on mutex)\n");
-}
-
-/*
- * printk all locks held in the system (if filter == NULL),
- * or all locks belonging to a single task (if filter != NULL):
- */
-void show_held_locks(struct task_struct *filter)
-{
-       struct list_head *curr, *cursor = NULL;
-       struct mutex *lock;
-       struct thread_info *t;
-       unsigned long flags;
-       int count = 0;
-
-       if (filter) {
-               printk("------------------------------\n");
-               printk("| showing all locks held by: |  (");
-               printk_task_short(filter);
-               printk("):\n");
-               printk("------------------------------\n");
-       } else {
-               printk("---------------------------\n");
-               printk("| showing all locks held: |\n");
-               printk("---------------------------\n");
-       }
-
-       /*
-        * Play safe and acquire the global trace lock. We
-        * cannot printk with that lock held so we iterate
-        * very carefully:
-        */
-next:
-       debug_spin_lock_save(&debug_mutex_lock, flags);
-       list_for_each(curr, &debug_mutex_held_locks) {
-               if (cursor && curr != cursor)
-                       continue;
-               lock = list_entry(curr, struct mutex, held_list);
-               t = lock->owner;
-               if (filter && (t != filter->thread_info))
-                       continue;
-               count++;
-               cursor = curr->next;
-               debug_spin_unlock_restore(&debug_mutex_lock, flags);
-
-               printk("\n#%03d:            ", count);
-               printk_lock(lock, filter ? 0 : 1);
-               goto next;
-       }
-       debug_spin_unlock_restore(&debug_mutex_lock, flags);
-       printk("\n");
-}
-
-void mutex_debug_show_all_locks(void)
-{
-       struct task_struct *g, *p;
-       int count = 10;
-       int unlock = 1;
-
-       printk("\nShowing all blocking locks in the system:\n");
-
-       /*
-        * Here we try to get the tasklist_lock as hard as possible,
-        * if not successful after 2 seconds we ignore it (but keep
-        * trying). This is to enable a debug printout even if a
-        * tasklist_lock-holding task deadlocks or crashes.
-        */
-retry:
-       if (!read_trylock(&tasklist_lock)) {
-               if (count == 10)
-                       printk("hm, tasklist_lock locked, retrying... ");
-               if (count) {
-                       count--;
-                       printk(" #%d", 10-count);
-                       mdelay(200);
-                       goto retry;
-               }
-               printk(" ignoring it.\n");
-               unlock = 0;
-       }
-       if (count != 10)
-               printk(" locked it.\n");
-
-       do_each_thread(g, p) {
-               show_task_locks(p);
-               if (!unlock)
-                       if (read_trylock(&tasklist_lock))
-                               unlock = 1;
-       } while_each_thread(g, p);
-
-       printk("\n");
-       show_held_locks(NULL);
-       printk("=============================================\n\n");
-
-       if (unlock)
-               read_unlock(&tasklist_lock);
-}
-
-static void report_deadlock(struct task_struct *task, struct mutex *lock,
-                           struct mutex *lockblk, unsigned long ip)
-{
-       printk("\n%s/%d is trying to acquire this lock:\n",
-               current->comm, current->pid);
-       printk_lock(lock, 1);
-       printk("... trying at:                 ");
-       print_symbol("%s\n", ip);
-       show_held_locks(current);
-
-       if (lockblk) {
-               printk("but %s/%d is deadlocking current task %s/%d!\n\n",
-                       task->comm, task->pid, current->comm, current->pid);
-               printk("\n%s/%d is blocked on this lock:\n",
-                       task->comm, task->pid);
-               printk_lock(lockblk, 1);
-
-               show_held_locks(task);
-
-               printk("\n%s/%d's [blocked] stackdump:\n\n",
-                       task->comm, task->pid);
-               show_stack(task, NULL);
-       }
-
-       printk("\n%s/%d's [current] stackdump:\n\n",
-               current->comm, current->pid);
-       dump_stack();
-       mutex_debug_show_all_locks();
-       printk("[ turning off deadlock detection. Please report this. ]\n\n");
-       local_irq_disable();
-}
-
-/*
- * Recursively check for mutex deadlocks:
- */
-static int check_deadlock(struct mutex *lock, int depth,
-                         struct thread_info *ti, unsigned long ip)
-{
-       struct mutex *lockblk;
-       struct task_struct *task;
-
-       if (!debug_mutex_on)
-               return 0;
-
-       ti = lock->owner;
-       if (!ti)
-               return 0;
-
-       task = ti->task;
-       lockblk = NULL;
-       if (task->blocked_on)
-               lockblk = task->blocked_on->lock;
-
-       /* Self-deadlock: */
-       if (current == task) {
-               DEBUG_OFF();
-               if (depth)
-                       return 1;
-               printk("\n==========================================\n");
-               printk(  "[ BUG: lock recursion deadlock detected! |\n");
-               printk(  "------------------------------------------\n");
-               report_deadlock(task, lock, NULL, ip);
-               return 0;
-       }
-
-       /* Ugh, something corrupted the lock data structure? */
-       if (depth > 20) {
-               DEBUG_OFF();
-               printk("\n===========================================\n");
-               printk(  "[ BUG: infinite lock dependency detected!? |\n");
-               printk(  "-------------------------------------------\n");
-               report_deadlock(task, lock, lockblk, ip);
-               return 0;
-       }
-
-       /* Recursively check for dependencies: */
-       if (lockblk && check_deadlock(lockblk, depth+1, ti, ip)) {
-               printk("\n============================================\n");
-               printk(  "[ BUG: circular locking deadlock detected! ]\n");
-               printk(  "--------------------------------------------\n");
-               report_deadlock(task, lock, lockblk, ip);
-               return 0;
-       }
-       return 0;
-}
-
-/*
- * Called when a task exits, this function checks whether the
- * task is holding any locks, and reports the first one if so:
- */
-void mutex_debug_check_no_locks_held(struct task_struct *task)
-{
-       struct list_head *curr, *next;
-       struct thread_info *t;
-       unsigned long flags;
-       struct mutex *lock;
-
-       if (!debug_mutex_on)
-               return;
-
-       debug_spin_lock_save(&debug_mutex_lock, flags);
-       list_for_each_safe(curr, next, &debug_mutex_held_locks) {
-               lock = list_entry(curr, struct mutex, held_list);
-               t = lock->owner;
-               if (t != task->thread_info)
-                       continue;
-               list_del_init(curr);
-               DEBUG_OFF();
-               debug_spin_unlock_restore(&debug_mutex_lock, flags);
-
-               printk("BUG: %s/%d, lock held at task exit time!\n",
-                       task->comm, task->pid);
-               printk_lock(lock, 1);
-               if (lock->owner != task->thread_info)
-                       printk("exiting task is not even the owner??\n");
-               return;
-       }
-       debug_spin_unlock_restore(&debug_mutex_lock, flags);
-}
-
-/*
- * Called when kernel memory is freed (or unmapped), or if a mutex
- * is destroyed or reinitialized - this code checks whether there is
- * any held lock in the memory range of <from> to <to>:
- */
-void mutex_debug_check_no_locks_freed(const void *from, unsigned long len)
-{
-       struct list_head *curr, *next;
-       const void *to = from + len;
-       unsigned long flags;
-       struct mutex *lock;
-       void *lock_addr;
-
-       if (!debug_mutex_on)
-               return;
-
-       debug_spin_lock_save(&debug_mutex_lock, flags);
-       list_for_each_safe(curr, next, &debug_mutex_held_locks) {
-               lock = list_entry(curr, struct mutex, held_list);
-               lock_addr = lock;
-               if (lock_addr < from || lock_addr >= to)
-                       continue;
-               list_del_init(curr);
-               DEBUG_OFF();
-               debug_spin_unlock_restore(&debug_mutex_lock, flags);
-
-               printk("BUG: %s/%d, active lock [%p(%p-%p)] freed!\n",
-                       current->comm, current->pid, lock, from, to);
-               dump_stack();
-               printk_lock(lock, 1);
-               if (lock->owner != current_thread_info())
-                       printk("freeing task is not even the owner??\n");
-               return;
-       }
-       debug_spin_unlock_restore(&debug_mutex_lock, flags);
-}
-
 /*
  * Must be called with lock->wait_lock held.
  */
-void debug_mutex_set_owner(struct mutex *lock,
-                          struct thread_info *new_owner __IP_DECL__)
+void debug_mutex_set_owner(struct mutex *lock, struct thread_info *new_owner)
 {
        lock->owner = new_owner;
-       DEBUG_WARN_ON(!list_empty(&lock->held_list));
-       if (debug_mutex_on) {
-               list_add_tail(&lock->held_list, &debug_mutex_held_locks);
-               lock->acquire_ip = ip;
-       }
 }
 
-void debug_mutex_init_waiter(struct mutex_waiter *waiter)
+void debug_mutex_lock_common(struct mutex *lock, struct mutex_waiter *waiter)
 {
        memset(waiter, MUTEX_DEBUG_INIT, sizeof(*waiter));
        waiter->magic = waiter;
@@ -389,23 +41,23 @@ void debug_mutex_init_waiter(struct mutex_waiter *waiter)
 
 void debug_mutex_wake_waiter(struct mutex *lock, struct mutex_waiter *waiter)
 {
-       SMP_DEBUG_WARN_ON(!spin_is_locked(&lock->wait_lock));
-       DEBUG_WARN_ON(list_empty(&lock->wait_list));
-       DEBUG_WARN_ON(waiter->magic != waiter);
-       DEBUG_WARN_ON(list_empty(&waiter->list));
+       SMP_DEBUG_LOCKS_WARN_ON(!spin_is_locked(&lock->wait_lock));
+       DEBUG_LOCKS_WARN_ON(list_empty(&lock->wait_list));
+       DEBUG_LOCKS_WARN_ON(waiter->magic != waiter);
+       DEBUG_LOCKS_WARN_ON(list_empty(&waiter->list));
 }
 
 void debug_mutex_free_waiter(struct mutex_waiter *waiter)
 {
-       DEBUG_WARN_ON(!list_empty(&waiter->list));
+       DEBUG_LOCKS_WARN_ON(!list_empty(&waiter->list));
        memset(waiter, MUTEX_DEBUG_FREE, sizeof(*waiter));
 }
 
 void debug_mutex_add_waiter(struct mutex *lock, struct mutex_waiter *waiter,
-                           struct thread_info *ti __IP_DECL__)
+                           struct thread_info *ti)
 {
-       SMP_DEBUG_WARN_ON(!spin_is_locked(&lock->wait_lock));
-       check_deadlock(lock, 0, ti, ip);
+       SMP_DEBUG_LOCKS_WARN_ON(!spin_is_locked(&lock->wait_lock));
+
        /* Mark the current thread as blocked on the lock: */
        ti->task->blocked_on = waiter;
        waiter->lock = lock;
@@ -414,9 +66,9 @@ void debug_mutex_add_waiter(struct mutex *lock, struct mutex_waiter *waiter,
 void mutex_remove_waiter(struct mutex *lock, struct mutex_waiter *waiter,
                         struct thread_info *ti)
 {
-       DEBUG_WARN_ON(list_empty(&waiter->list));
-       DEBUG_WARN_ON(waiter->task != ti->task);
-       DEBUG_WARN_ON(ti->task->blocked_on != waiter);
+       DEBUG_LOCKS_WARN_ON(list_empty(&waiter->list));
+       DEBUG_LOCKS_WARN_ON(waiter->task != ti->task);
+       DEBUG_LOCKS_WARN_ON(ti->task->blocked_on != waiter);
        ti->task->blocked_on = NULL;
 
        list_del_init(&waiter->list);
@@ -425,24 +77,23 @@ void mutex_remove_waiter(struct mutex *lock, struct mutex_waiter *waiter,
 
 void debug_mutex_unlock(struct mutex *lock)
 {
-       DEBUG_WARN_ON(lock->magic != lock);
-       DEBUG_WARN_ON(!lock->wait_list.prev && !lock->wait_list.next);
-       DEBUG_WARN_ON(lock->owner != current_thread_info());
-       if (debug_mutex_on) {
-               DEBUG_WARN_ON(list_empty(&lock->held_list));
-               list_del_init(&lock->held_list);
-       }
+       DEBUG_LOCKS_WARN_ON(lock->owner != current_thread_info());
+       DEBUG_LOCKS_WARN_ON(lock->magic != lock);
+       DEBUG_LOCKS_WARN_ON(!lock->wait_list.prev && !lock->wait_list.next);
+       DEBUG_LOCKS_WARN_ON(lock->owner != current_thread_info());
 }
 
-void debug_mutex_init(struct mutex *lock, const char *name)
+void debug_mutex_init(struct mutex *lock, const char *name,
+                     struct lock_class_key *key)
 {
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
        /*
         * Make sure we are not reinitializing a held lock:
         */
-       mutex_debug_check_no_locks_freed((void *)lock, sizeof(*lock));
+       debug_check_no_locks_freed((void *)lock, sizeof(*lock));
+       lockdep_init_map(&lock->dep_map, name, key);
+#endif
        lock->owner = NULL;
-       INIT_LIST_HEAD(&lock->held_list);
-       lock->name = name;
        lock->magic = lock;
 }
 
@@ -456,7 +107,7 @@ void debug_mutex_init(struct mutex *lock, const char *name)
  */
 void fastcall mutex_destroy(struct mutex *lock)
 {
-       DEBUG_WARN_ON(mutex_is_locked(lock));
+       DEBUG_LOCKS_WARN_ON(mutex_is_locked(lock));
        lock->magic = NULL;
 }
 
index a5196c36a5fdce7f21cfd5e56ea9e84720961261..babfbdfc534b7127e3769405433499f1929a44a5 100644 (file)
  * More details are in kernel/mutex-debug.c.
  */
 
-extern spinlock_t debug_mutex_lock;
-extern struct list_head debug_mutex_held_locks;
-extern int debug_mutex_on;
-
-/*
- * In the debug case we carry the caller's instruction pointer into
- * other functions, but we dont want the function argument overhead
- * in the nondebug case - hence these macros:
- */
-#define __IP_DECL__            , unsigned long ip
-#define __IP__                 , ip
-#define __RET_IP__             , (unsigned long)__builtin_return_address(0)
-
 /*
  * This must be called with lock->wait_lock held.
  */
-extern void debug_mutex_set_owner(struct mutex *lock,
-                                 struct thread_info *new_owner __IP_DECL__);
+extern void
+debug_mutex_set_owner(struct mutex *lock, struct thread_info *new_owner);
 
 static inline void debug_mutex_clear_owner(struct mutex *lock)
 {
        lock->owner = NULL;
 }
 
-extern void debug_mutex_init_waiter(struct mutex_waiter *waiter);
+extern void debug_mutex_lock_common(struct mutex *lock,
+                                   struct mutex_waiter *waiter);
 extern void debug_mutex_wake_waiter(struct mutex *lock,
                                    struct mutex_waiter *waiter);
 extern void debug_mutex_free_waiter(struct mutex_waiter *waiter);
 extern void debug_mutex_add_waiter(struct mutex *lock,
                                   struct mutex_waiter *waiter,
-                                  struct thread_info *ti __IP_DECL__);
+                                  struct thread_info *ti);
 extern void mutex_remove_waiter(struct mutex *lock, struct mutex_waiter *waiter,
                                struct thread_info *ti);
 extern void debug_mutex_unlock(struct mutex *lock);
-extern void debug_mutex_init(struct mutex *lock, const char *name);
-
-#define debug_spin_lock_save(lock, flags)              \
-       do {                                            \
-               local_irq_save(flags);                  \
-               if (debug_mutex_on)                     \
-                       spin_lock(lock);                \
-       } while (0)
-
-#define debug_spin_unlock_restore(lock, flags)         \
-       do {                                            \
-               if (debug_mutex_on)                     \
-                       spin_unlock(lock);              \
-               local_irq_restore(flags);               \
-               preempt_check_resched();                \
-       } while (0)
+extern void debug_mutex_init(struct mutex *lock, const char *name,
+                            struct lock_class_key *key);
 
 #define spin_lock_mutex(lock, flags)                   \
        do {                                            \
                struct mutex *l = container_of(lock, struct mutex, wait_lock); \
                                                        \
-               DEBUG_WARN_ON(in_interrupt());          \
-               debug_spin_lock_save(&debug_mutex_lock, flags); \
-               spin_lock(lock);                        \
-               DEBUG_WARN_ON(l->magic != l);           \
+               DEBUG_LOCKS_WARN_ON(in_interrupt());    \
+               local_irq_save(flags);                  \
+               __raw_spin_lock(&(lock)->raw_lock);     \
+               DEBUG_LOCKS_WARN_ON(l->magic != l);     \
        } while (0)
 
 #define spin_unlock_mutex(lock, flags)                 \
        do {                                            \
-               spin_unlock(lock);                      \
-               debug_spin_unlock_restore(&debug_mutex_lock, flags);    \
+               __raw_spin_unlock(&(lock)->raw_lock);   \
+               local_irq_restore(flags);               \
+               preempt_check_resched();                \
        } while (0)
-
-#define DEBUG_OFF()                                    \
-do {                                                   \
-       if (debug_mutex_on) {                           \
-               debug_mutex_on = 0;                     \
-               console_verbose();                      \
-               if (spin_is_locked(&debug_mutex_lock))  \
-                       spin_unlock(&debug_mutex_lock); \
-       }                                               \
-} while (0)
-
-#define DEBUG_BUG()                                    \
-do {                                                   \
-       if (debug_mutex_on) {                           \
-               DEBUG_OFF();                            \
-               BUG();                                  \
-       }                                               \
-} while (0)
-
-#define DEBUG_WARN_ON(c)                               \
-do {                                                   \
-       if (unlikely(c && debug_mutex_on)) {            \
-               DEBUG_OFF();                            \
-               WARN_ON(1);                             \
-       }                                               \
-} while (0)
-
-# define DEBUG_BUG_ON(c)                               \
-do {                                                   \
-       if (unlikely(c))                                \
-               DEBUG_BUG();                            \
-} while (0)
-
-#ifdef CONFIG_SMP
-# define SMP_DEBUG_WARN_ON(c)                  DEBUG_WARN_ON(c)
-# define SMP_DEBUG_BUG_ON(c)                   DEBUG_BUG_ON(c)
-#else
-# define SMP_DEBUG_WARN_ON(c)                  do { } while (0)
-# define SMP_DEBUG_BUG_ON(c)                   do { } while (0)
-#endif
-
index 7043db21bbce208b098aa60e100ca2c8e0d86009..8c71cf72a497de63ec5672f3f5f8f728fbb9f9df 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #include <linux/interrupt.h>
+#include <linux/debug_locks.h>
 
 /*
  * In the DEBUG case we are using the "NULL fastpath" for mutexes,
  *
  * It is not allowed to initialize an already locked mutex.
  */
-void fastcall __mutex_init(struct mutex *lock, const char *name)
+void
+__mutex_init(struct mutex *lock, const char *name, struct lock_class_key *key)
 {
        atomic_set(&lock->count, 1);
        spin_lock_init(&lock->wait_lock);
        INIT_LIST_HEAD(&lock->wait_list);
 
-       debug_mutex_init(lock, name);
+       debug_mutex_init(lock, name, key);
 }
 
 EXPORT_SYMBOL(__mutex_init);
@@ -56,7 +58,7 @@ EXPORT_SYMBOL(__mutex_init);
  * branch is predicted by the CPU as default-untaken.
  */
 static void fastcall noinline __sched
-__mutex_lock_slowpath(atomic_t *lock_count __IP_DECL__);
+__mutex_lock_slowpath(atomic_t *lock_count);
 
 /***
  * mutex_lock - acquire the mutex
@@ -79,7 +81,7 @@ __mutex_lock_slowpath(atomic_t *lock_count __IP_DECL__);
  *
  * This function is similar to (but not equivalent to) down().
  */
-void fastcall __sched mutex_lock(struct mutex *lock)
+void inline fastcall __sched mutex_lock(struct mutex *lock)
 {
        might_sleep();
        /*
@@ -92,7 +94,7 @@ void fastcall __sched mutex_lock(struct mutex *lock)
 EXPORT_SYMBOL(mutex_lock);
 
 static void fastcall noinline __sched
-__mutex_unlock_slowpath(atomic_t *lock_count __IP_DECL__);
+__mutex_unlock_slowpath(atomic_t *lock_count);
 
 /***
  * mutex_unlock - release the mutex
@@ -120,18 +122,18 @@ EXPORT_SYMBOL(mutex_unlock);
  * Lock a mutex (possibly interruptible), slowpath:
  */
 static inline int __sched
-__mutex_lock_common(struct mutex *lock, long state __IP_DECL__)
+__mutex_lock_common(struct mutex *lock, long state, unsigned int subclass)
 {
        struct task_struct *task = current;
        struct mutex_waiter waiter;
        unsigned int old_val;
        unsigned long flags;
 
-       debug_mutex_init_waiter(&waiter);
-
        spin_lock_mutex(&lock->wait_lock, flags);
 
-       debug_mutex_add_waiter(lock, &waiter, task->thread_info, ip);
+       debug_mutex_lock_common(lock, &waiter);
+       mutex_acquire(&lock->dep_map, subclass, 0, _RET_IP_);
+       debug_mutex_add_waiter(lock, &waiter, task->thread_info);
 
        /* add waiting tasks to the end of the waitqueue (FIFO): */
        list_add_tail(&waiter.list, &lock->wait_list);
@@ -158,6 +160,7 @@ __mutex_lock_common(struct mutex *lock, long state __IP_DECL__)
                if (unlikely(state == TASK_INTERRUPTIBLE &&
                                                signal_pending(task))) {
                        mutex_remove_waiter(lock, &waiter, task->thread_info);
+                       mutex_release(&lock->dep_map, 1, _RET_IP_);
                        spin_unlock_mutex(&lock->wait_lock, flags);
 
                        debug_mutex_free_waiter(&waiter);
@@ -173,7 +176,7 @@ __mutex_lock_common(struct mutex *lock, long state __IP_DECL__)
 
        /* got the lock - rejoice! */
        mutex_remove_waiter(lock, &waiter, task->thread_info);
-       debug_mutex_set_owner(lock, task->thread_info __IP__);
+       debug_mutex_set_owner(lock, task->thread_info);
 
        /* set it to 0 if there are no waiters left: */
        if (likely(list_empty(&lock->wait_list)))
@@ -183,32 +186,40 @@ __mutex_lock_common(struct mutex *lock, long state __IP_DECL__)
 
        debug_mutex_free_waiter(&waiter);
 
-       DEBUG_WARN_ON(list_empty(&lock->held_list));
-       DEBUG_WARN_ON(lock->owner != task->thread_info);
-
        return 0;
 }
 
 static void fastcall noinline __sched
-__mutex_lock_slowpath(atomic_t *lock_count __IP_DECL__)
+__mutex_lock_slowpath(atomic_t *lock_count)
 {
        struct mutex *lock = container_of(lock_count, struct mutex, count);
 
-       __mutex_lock_common(lock, TASK_UNINTERRUPTIBLE __IP__);
+       __mutex_lock_common(lock, TASK_UNINTERRUPTIBLE, 0);
+}
+
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+void __sched
+mutex_lock_nested(struct mutex *lock, unsigned int subclass)
+{
+       might_sleep();
+       __mutex_lock_common(lock, TASK_UNINTERRUPTIBLE, subclass);
 }
 
+EXPORT_SYMBOL_GPL(mutex_lock_nested);
+#endif
+
 /*
  * Release the lock, slowpath:
  */
-static fastcall noinline void
-__mutex_unlock_slowpath(atomic_t *lock_count __IP_DECL__)
+static fastcall inline void
+__mutex_unlock_common_slowpath(atomic_t *lock_count, int nested)
 {
        struct mutex *lock = container_of(lock_count, struct mutex, count);
        unsigned long flags;
 
-       DEBUG_WARN_ON(lock->owner != current_thread_info());
-
        spin_lock_mutex(&lock->wait_lock, flags);
+       mutex_release(&lock->dep_map, nested, _RET_IP_);
+       debug_mutex_unlock(lock);
 
        /*
         * some architectures leave the lock unlocked in the fastpath failure
@@ -218,8 +229,6 @@ __mutex_unlock_slowpath(atomic_t *lock_count __IP_DECL__)
        if (__mutex_slowpath_needs_to_unlock())
                atomic_set(&lock->count, 1);
 
-       debug_mutex_unlock(lock);
-
        if (!list_empty(&lock->wait_list)) {
                /* get the first entry from the wait-list: */
                struct mutex_waiter *waiter =
@@ -236,12 +245,21 @@ __mutex_unlock_slowpath(atomic_t *lock_count __IP_DECL__)
        spin_unlock_mutex(&lock->wait_lock, flags);
 }
 
+/*
+ * Release the lock, slowpath:
+ */
+static fastcall noinline void
+__mutex_unlock_slowpath(atomic_t *lock_count)
+{
+       __mutex_unlock_common_slowpath(lock_count, 1);
+}
+
 /*
  * Here come the less common (and hence less performance-critical) APIs:
  * mutex_lock_interruptible() and mutex_trylock().
  */
 static int fastcall noinline __sched
-__mutex_lock_interruptible_slowpath(atomic_t *lock_count __IP_DECL__);
+__mutex_lock_interruptible_slowpath(atomic_t *lock_count);
 
 /***
  * mutex_lock_interruptible - acquire the mutex, interruptable
@@ -264,11 +282,11 @@ int fastcall __sched mutex_lock_interruptible(struct mutex *lock)
 EXPORT_SYMBOL(mutex_lock_interruptible);
 
 static int fastcall noinline __sched
-__mutex_lock_interruptible_slowpath(atomic_t *lock_count __IP_DECL__)
+__mutex_lock_interruptible_slowpath(atomic_t *lock_count)
 {
        struct mutex *lock = container_of(lock_count, struct mutex, count);
 
-       return __mutex_lock_common(lock, TASK_INTERRUPTIBLE __IP__);
+       return __mutex_lock_common(lock, TASK_INTERRUPTIBLE, 0);
 }
 
 /*
@@ -284,8 +302,10 @@ static inline int __mutex_trylock_slowpath(atomic_t *lock_count)
        spin_lock_mutex(&lock->wait_lock, flags);
 
        prev = atomic_xchg(&lock->count, -1);
-       if (likely(prev == 1))
-               debug_mutex_set_owner(lock, current_thread_info() __RET_IP__);
+       if (likely(prev == 1)) {
+               debug_mutex_set_owner(lock, current_thread_info());
+               mutex_acquire(&lock->dep_map, 0, 1, _RET_IP_);
+       }
        /* Set it back to 0 if there are no waiters: */
        if (likely(list_empty(&lock->wait_list)))
                atomic_set(&lock->count, 0);
@@ -309,7 +329,7 @@ static inline int __mutex_trylock_slowpath(atomic_t *lock_count)
  * This function must not be used in interrupt context. The
  * mutex must be released by the same task that acquired it.
  */
-int fastcall mutex_trylock(struct mutex *lock)
+int fastcall __sched mutex_trylock(struct mutex *lock)
 {
        return __mutex_fastpath_trylock(&lock->count,
                                        __mutex_trylock_slowpath);
index 06918994725726cec4e0f98456d391a821258d49..a075dafbb290c18bdf8972c361d8063f2478fa69 100644 (file)
 #define mutex_remove_waiter(lock, waiter, ti) \
                __list_del((waiter)->list.prev, (waiter)->list.next)
 
-#define DEBUG_WARN_ON(c)                               do { } while (0)
 #define debug_mutex_set_owner(lock, new_owner)         do { } while (0)
 #define debug_mutex_clear_owner(lock)                  do { } while (0)
-#define debug_mutex_init_waiter(waiter)                        do { } while (0)
 #define debug_mutex_wake_waiter(lock, waiter)          do { } while (0)
 #define debug_mutex_free_waiter(waiter)                        do { } while (0)
-#define debug_mutex_add_waiter(lock, waiter, ti, ip)   do { } while (0)
+#define debug_mutex_add_waiter(lock, waiter, ti)       do { } while (0)
 #define debug_mutex_unlock(lock)                       do { } while (0)
-#define debug_mutex_init(lock, name)                   do { } while (0)
-
-/*
- * Return-address parameters/declarations. They are very useful for
- * debugging, but add overhead in the !DEBUG case - so we go the
- * trouble of using this not too elegant but zero-cost solution:
- */
-#define __IP_DECL__
-#define __IP__
-#define __RET_IP__
+#define debug_mutex_init(lock, name, key)              do { } while (0)
 
+static inline void
+debug_mutex_lock_common(struct mutex *lock, struct mutex_waiter *waiter)
+{
+}
index cc2a4c9c36ac231781a41fba4031a17bc3b1f7e7..ab13f0f668b53efa359233c7c6829e08683f4b65 100644 (file)
@@ -8,7 +8,6 @@
  * This function is used through-out the kernel (including mm and fs)
  * to indicate a major problem.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/delay.h>
index af43ecdc8d9b21b21599bd1f3c8a063bc5c43100..91aea7aa532e53940fc7c63367d6a9634249be95 100644 (file)
@@ -15,7 +15,6 @@
     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/config.h>
 #include <linux/moduleparam.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
index eeb836b65ca4ec887e6dc83c73e73004ac066978..93e212f20671fd3b19838327366c45e3ad54ced8 100644 (file)
@@ -218,7 +218,7 @@ struct pid * fastcall find_pid(int nr)
        return NULL;
 }
 
-int fastcall attach_pid(task_t *task, enum pid_type type, int nr)
+int fastcall attach_pid(struct task_struct *task, enum pid_type type, int nr)
 {
        struct pid_link *link;
        struct pid *pid;
@@ -233,7 +233,7 @@ int fastcall attach_pid(task_t *task, enum pid_type type, int nr)
        return 0;
 }
 
-void fastcall detach_pid(task_t *task, enum pid_type type)
+void fastcall detach_pid(struct task_struct *task, enum pid_type type)
 {
        struct pid_link *link;
        struct pid *pid;
@@ -267,7 +267,7 @@ struct task_struct * fastcall pid_task(struct pid *pid, enum pid_type type)
 /*
  * Must be called under rcu_read_lock() or with tasklist_lock read-held.
  */
-task_t *find_task_by_pid_type(int type, int nr)
+struct task_struct *find_task_by_pid_type(int type, int nr)
 {
        return pid_task(find_pid(nr), type);
 }
index 857b4fa091244758b5fc0976cf44d58f914f20ec..ae44a70aae8acb4664ca46107d04525205c32ad6 100644 (file)
@@ -100,18 +100,6 @@ config PM_STD_PARTITION
          suspended image to. It will simply pick the first available swap 
          device.
 
-config SWSUSP_ENCRYPT
-       bool "Encrypt suspend image"
-       depends on SOFTWARE_SUSPEND && CRYPTO=y && (CRYPTO_AES=y || CRYPTO_AES_586=y || CRYPTO_AES_X86_64=y)
-       default ""
-       ---help---
-         To prevent data gathering from swap after resume you can encrypt
-         the suspend image with a temporary key that is deleted on
-         resume.
-
-         Note that the temporary key is stored unencrypted on disk while the
-         system is suspended.
-
 config SUSPEND_SMP
        bool
        depends on HOTPLUG_CPU && X86 && PM
index 95b7fe17f124c259a54d0227ac1d0a08ddb62800..bdba5d80496c98c9ccfe41a4372cd944d5b334a1 100644 (file)
@@ -26,7 +26,6 @@
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/interrupt.h>                   /* For in_interrupt() */
-#include <linux/config.h>
 #include <linux/delay.h>
 #include <linux/smp.h>
 #include <linux/security.h>
@@ -519,7 +518,9 @@ asmlinkage int vprintk(const char *fmt, va_list args)
                zap_locks();
 
        /* This stops the holder of console_sem just where we want him */
-       spin_lock_irqsave(&logbuf_lock, flags);
+       local_irq_save(flags);
+       lockdep_off();
+       spin_lock(&logbuf_lock);
        printk_cpu = smp_processor_id();
 
        /* Emit the output into the temporary buffer */
@@ -589,7 +590,7 @@ asmlinkage int vprintk(const char *fmt, va_list args)
                 */
                console_locked = 1;
                printk_cpu = UINT_MAX;
-               spin_unlock_irqrestore(&logbuf_lock, flags);
+               spin_unlock(&logbuf_lock);
 
                /*
                 * Console drivers may assume that per-cpu resources have
@@ -605,6 +606,8 @@ asmlinkage int vprintk(const char *fmt, va_list args)
                        console_locked = 0;
                        up(&console_sem);
                }
+               lockdep_on();
+               local_irq_restore(flags);
        } else {
                /*
                 * Someone else owns the drivers.  We drop the spinlock, which
@@ -612,7 +615,9 @@ asmlinkage int vprintk(const char *fmt, va_list args)
                 * console drivers with the output which we just produced.
                 */
                printk_cpu = UINT_MAX;
-               spin_unlock_irqrestore(&logbuf_lock, flags);
+               spin_unlock(&logbuf_lock);
+               lockdep_on();
+               local_irq_restore(flags);
        }
 
        preempt_enable();
@@ -810,8 +815,15 @@ void release_console_sem(void)
        console_may_schedule = 0;
        up(&console_sem);
        spin_unlock_irqrestore(&logbuf_lock, flags);
-       if (wake_klogd && !oops_in_progress && waitqueue_active(&log_wait))
-               wake_up_interruptible(&log_wait);
+       if (wake_klogd && !oops_in_progress && waitqueue_active(&log_wait)) {
+               /*
+                * If we printk from within the lock dependency code,
+                * from within the scheduler code, then do not lock
+                * up due to self-recursion:
+                */
+               if (!lockdep_internal())
+                       wake_up_interruptible(&log_wait);
+       }
 }
 EXPORT_SYMBOL(release_console_sem);
 
index 5a730fdb1a2cecf6b10c2112ba777fbb5fb7c794..d5bd75e7501cadef54651a3f886514f0fbcc6f92 100644 (file)
@@ -13,7 +13,6 @@
  *     to resolve timer interrupt livelocks, William Irwin, Oracle, 2004
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/profile.h>
 #include <linux/bootmem.h>
index 335c5b932e14ffdac1a4c689dcf3895dc7e934ea..9a111f70145c6673cddf08eeaf2e86da03dff8d8 100644 (file)
@@ -28,7 +28,7 @@
  *
  * Must be called with the tasklist lock write-held.
  */
-void __ptrace_link(task_t *child, task_t *new_parent)
+void __ptrace_link(struct task_struct *child, struct task_struct *new_parent)
 {
        BUG_ON(!list_empty(&child->ptrace_list));
        if (child->parent == new_parent)
@@ -46,7 +46,7 @@ void __ptrace_link(task_t *child, task_t *new_parent)
  * TASK_TRACED, resume it now.
  * Requires that irqs be disabled.
  */
-void ptrace_untrace(task_t *child)
+void ptrace_untrace(struct task_struct *child)
 {
        spin_lock(&child->sighand->siglock);
        if (child->state == TASK_TRACED) {
@@ -65,7 +65,7 @@ void ptrace_untrace(task_t *child)
  *
  * Must be called with the tasklist lock write-held.
  */
-void __ptrace_unlink(task_t *child)
+void __ptrace_unlink(struct task_struct *child)
 {
        BUG_ON(!child->ptrace);
 
index f464f5ae3f11a8edfe12d7ff83b609013526cfe6..759805c9859a28f7552363c8e7fdce680e0f694a 100644 (file)
 static struct rcu_ctrlblk rcu_ctrlblk = {
        .cur = -300,
        .completed = -300,
-       .lock = SPIN_LOCK_UNLOCKED,
+       .lock = __SPIN_LOCK_UNLOCKED(&rcu_ctrlblk.lock),
        .cpumask = CPU_MASK_NONE,
 };
 static struct rcu_ctrlblk rcu_bh_ctrlblk = {
        .cur = -300,
        .completed = -300,
-       .lock = SPIN_LOCK_UNLOCKED,
+       .lock = __SPIN_LOCK_UNLOCKED(&rcu_bh_ctrlblk.lock),
        .cpumask = CPU_MASK_NONE,
 };
 
index bf1130d81b7f09d35c81e436592b407e56c526d3..129cf046e56173d16201bcc089eff410bd530eca 100644 (file)
@@ -7,7 +7,6 @@
  * Arbitrary resource management.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/errno.h>
index 4aa8a2c9f45341935827b904b1aa27b74b5fc8c8..0c1faa950af7a21e3e582f679e788d3d8b91ade7 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/interrupt.h>
 #include <linux/plist.h>
 #include <linux/fs.h>
+#include <linux/debug_locks.h>
 
 #include "rtmutex_common.h"
 
@@ -45,8 +46,6 @@ do {                                                          \
                console_verbose();                              \
                if (spin_is_locked(&current->pi_lock))          \
                        spin_unlock(&current->pi_lock);         \
-               if (spin_is_locked(&current->held_list_lock))   \
-                       spin_unlock(&current->held_list_lock);  \
        }                                                       \
 } while (0)
 
@@ -97,7 +96,7 @@ void deadlock_trace_off(void)
        rt_trace_on = 0;
 }
 
-static void printk_task(task_t *p)
+static void printk_task(struct task_struct *p)
 {
        if (p)
                printk("%16s:%5d [%p, %3d]", p->comm, p->pid, p, p->prio);
@@ -105,14 +104,6 @@ static void printk_task(task_t *p)
                printk("<none>");
 }
 
-static void printk_task_short(task_t *p)
-{
-       if (p)
-               printk("%s/%d [%p, %3d]", p->comm, p->pid, p, p->prio);
-       else
-               printk("<none>");
-}
-
 static void printk_lock(struct rt_mutex *lock, int print_owner)
 {
        if (lock->name)
@@ -128,222 +119,6 @@ static void printk_lock(struct rt_mutex *lock, int print_owner)
                printk_task(rt_mutex_owner(lock));
                printk("\n");
        }
-       if (rt_mutex_owner(lock)) {
-               printk("... acquired at:               ");
-               print_symbol("%s\n", lock->acquire_ip);
-       }
-}
-
-static void printk_waiter(struct rt_mutex_waiter *w)
-{
-       printk("-------------------------\n");
-       printk("| waiter struct %p:\n", w);
-       printk("| w->list_entry: [DP:%p/%p|SP:%p/%p|PRI:%d]\n",
-              w->list_entry.plist.prio_list.prev, w->list_entry.plist.prio_list.next,
-              w->list_entry.plist.node_list.prev, w->list_entry.plist.node_list.next,
-              w->list_entry.prio);
-       printk("| w->pi_list_entry: [DP:%p/%p|SP:%p/%p|PRI:%d]\n",
-              w->pi_list_entry.plist.prio_list.prev, w->pi_list_entry.plist.prio_list.next,
-              w->pi_list_entry.plist.node_list.prev, w->pi_list_entry.plist.node_list.next,
-              w->pi_list_entry.prio);
-       printk("\n| lock:\n");
-       printk_lock(w->lock, 1);
-       printk("| w->ti->task:\n");
-       printk_task(w->task);
-       printk("| blocked at:  ");
-       print_symbol("%s\n", w->ip);
-       printk("-------------------------\n");
-}
-
-static void show_task_locks(task_t *p)
-{
-       switch (p->state) {
-       case TASK_RUNNING:              printk("R"); break;
-       case TASK_INTERRUPTIBLE:        printk("S"); break;
-       case TASK_UNINTERRUPTIBLE:      printk("D"); break;
-       case TASK_STOPPED:              printk("T"); break;
-       case EXIT_ZOMBIE:               printk("Z"); break;
-       case EXIT_DEAD:                 printk("X"); break;
-       default:                        printk("?"); break;
-       }
-       printk_task(p);
-       if (p->pi_blocked_on) {
-               struct rt_mutex *lock = p->pi_blocked_on->lock;
-
-               printk(" blocked on:");
-               printk_lock(lock, 1);
-       } else
-               printk(" (not blocked)\n");
-}
-
-void rt_mutex_show_held_locks(task_t *task, int verbose)
-{
-       struct list_head *curr, *cursor = NULL;
-       struct rt_mutex *lock;
-       task_t *t;
-       unsigned long flags;
-       int count = 0;
-
-       if (!rt_trace_on)
-               return;
-
-       if (verbose) {
-               printk("------------------------------\n");
-               printk("| showing all locks held by: |  (");
-               printk_task_short(task);
-               printk("):\n");
-               printk("------------------------------\n");
-       }
-
-next:
-       spin_lock_irqsave(&task->held_list_lock, flags);
-       list_for_each(curr, &task->held_list_head) {
-               if (cursor && curr != cursor)
-                       continue;
-               lock = list_entry(curr, struct rt_mutex, held_list_entry);
-               t = rt_mutex_owner(lock);
-               WARN_ON(t != task);
-               count++;
-               cursor = curr->next;
-               spin_unlock_irqrestore(&task->held_list_lock, flags);
-
-               printk("\n#%03d:            ", count);
-               printk_lock(lock, 0);
-               goto next;
-       }
-       spin_unlock_irqrestore(&task->held_list_lock, flags);
-
-       printk("\n");
-}
-
-void rt_mutex_show_all_locks(void)
-{
-       task_t *g, *p;
-       int count = 10;
-       int unlock = 1;
-
-       printk("\n");
-       printk("----------------------\n");
-       printk("| showing all tasks: |\n");
-       printk("----------------------\n");
-
-       /*
-        * Here we try to get the tasklist_lock as hard as possible,
-        * if not successful after 2 seconds we ignore it (but keep
-        * trying). This is to enable a debug printout even if a
-        * tasklist_lock-holding task deadlocks or crashes.
-        */
-retry:
-       if (!read_trylock(&tasklist_lock)) {
-               if (count == 10)
-                       printk("hm, tasklist_lock locked, retrying... ");
-               if (count) {
-                       count--;
-                       printk(" #%d", 10-count);
-                       mdelay(200);
-                       goto retry;
-               }
-               printk(" ignoring it.\n");
-               unlock = 0;
-       }
-       if (count != 10)
-               printk(" locked it.\n");
-
-       do_each_thread(g, p) {
-               show_task_locks(p);
-               if (!unlock)
-                       if (read_trylock(&tasklist_lock))
-                               unlock = 1;
-       } while_each_thread(g, p);
-
-       printk("\n");
-
-       printk("-----------------------------------------\n");
-       printk("| showing all locks held in the system: |\n");
-       printk("-----------------------------------------\n");
-
-       do_each_thread(g, p) {
-               rt_mutex_show_held_locks(p, 0);
-               if (!unlock)
-                       if (read_trylock(&tasklist_lock))
-                               unlock = 1;
-       } while_each_thread(g, p);
-
-
-       printk("=============================================\n\n");
-
-       if (unlock)
-               read_unlock(&tasklist_lock);
-}
-
-void rt_mutex_debug_check_no_locks_held(task_t *task)
-{
-       struct rt_mutex_waiter *w;
-       struct list_head *curr;
-       struct rt_mutex *lock;
-
-       if (!rt_trace_on)
-               return;
-       if (!rt_prio(task->normal_prio) && rt_prio(task->prio)) {
-               printk("BUG: PI priority boost leaked!\n");
-               printk_task(task);
-               printk("\n");
-       }
-       if (list_empty(&task->held_list_head))
-               return;
-
-       spin_lock(&task->pi_lock);
-       plist_for_each_entry(w, &task->pi_waiters, pi_list_entry) {
-               TRACE_OFF();
-
-               printk("hm, PI interest held at exit time? Task:\n");
-               printk_task(task);
-               printk_waiter(w);
-               return;
-       }
-       spin_unlock(&task->pi_lock);
-
-       list_for_each(curr, &task->held_list_head) {
-               lock = list_entry(curr, struct rt_mutex, held_list_entry);
-
-               printk("BUG: %s/%d, lock held at task exit time!\n",
-                      task->comm, task->pid);
-               printk_lock(lock, 1);
-               if (rt_mutex_owner(lock) != task)
-                       printk("exiting task is not even the owner??\n");
-       }
-}
-
-int rt_mutex_debug_check_no_locks_freed(const void *from, unsigned long len)
-{
-       const void *to = from + len;
-       struct list_head *curr;
-       struct rt_mutex *lock;
-       unsigned long flags;
-       void *lock_addr;
-
-       if (!rt_trace_on)
-               return 0;
-
-       spin_lock_irqsave(&current->held_list_lock, flags);
-       list_for_each(curr, &current->held_list_head) {
-               lock = list_entry(curr, struct rt_mutex, held_list_entry);
-               lock_addr = lock;
-               if (lock_addr < from || lock_addr >= to)
-                       continue;
-               TRACE_OFF();
-
-               printk("BUG: %s/%d, active lock [%p(%p-%p)] freed!\n",
-                       current->comm, current->pid, lock, from, to);
-               dump_stack();
-               printk_lock(lock, 1);
-               if (rt_mutex_owner(lock) != current)
-                       printk("freeing task is not even the owner??\n");
-               return 1;
-       }
-       spin_unlock_irqrestore(&current->held_list_lock, flags);
-
-       return 0;
 }
 
 void rt_mutex_debug_task_free(struct task_struct *task)
@@ -395,85 +170,41 @@ void debug_rt_mutex_print_deadlock(struct rt_mutex_waiter *waiter)
               current->comm, current->pid);
        printk_lock(waiter->lock, 1);
 
-       printk("... trying at:                 ");
-       print_symbol("%s\n", waiter->ip);
-
        printk("\n2) %s/%d is blocked on this lock:\n", task->comm, task->pid);
        printk_lock(waiter->deadlock_lock, 1);
 
-       rt_mutex_show_held_locks(current, 1);
-       rt_mutex_show_held_locks(task, 1);
+       debug_show_held_locks(current);
+       debug_show_held_locks(task);
 
        printk("\n%s/%d's [blocked] stackdump:\n\n", task->comm, task->pid);
        show_stack(task, NULL);
        printk("\n%s/%d's [current] stackdump:\n\n",
               current->comm, current->pid);
        dump_stack();
-       rt_mutex_show_all_locks();
+       debug_show_all_locks();
+
        printk("[ turning off deadlock detection."
               "Please report this trace. ]\n\n");
        local_irq_disable();
 }
 
-void debug_rt_mutex_lock(struct rt_mutex *lock __IP_DECL__)
+void debug_rt_mutex_lock(struct rt_mutex *lock)
 {
-       unsigned long flags;
-
-       if (rt_trace_on) {
-               TRACE_WARN_ON_LOCKED(!list_empty(&lock->held_list_entry));
-
-               spin_lock_irqsave(&current->held_list_lock, flags);
-               list_add_tail(&lock->held_list_entry, &current->held_list_head);
-               spin_unlock_irqrestore(&current->held_list_lock, flags);
-
-               lock->acquire_ip = ip;
-       }
 }
 
 void debug_rt_mutex_unlock(struct rt_mutex *lock)
 {
-       unsigned long flags;
-
-       if (rt_trace_on) {
-               TRACE_WARN_ON_LOCKED(rt_mutex_owner(lock) != current);
-               TRACE_WARN_ON_LOCKED(list_empty(&lock->held_list_entry));
-
-               spin_lock_irqsave(&current->held_list_lock, flags);
-               list_del_init(&lock->held_list_entry);
-               spin_unlock_irqrestore(&current->held_list_lock, flags);
-       }
+       TRACE_WARN_ON_LOCKED(rt_mutex_owner(lock) != current);
 }
 
-void debug_rt_mutex_proxy_lock(struct rt_mutex *lock,
-                              struct task_struct *powner __IP_DECL__)
+void
+debug_rt_mutex_proxy_lock(struct rt_mutex *lock, struct task_struct *powner)
 {
-       unsigned long flags;
-
-       if (rt_trace_on) {
-               TRACE_WARN_ON_LOCKED(!list_empty(&lock->held_list_entry));
-
-               spin_lock_irqsave(&powner->held_list_lock, flags);
-               list_add_tail(&lock->held_list_entry, &powner->held_list_head);
-               spin_unlock_irqrestore(&powner->held_list_lock, flags);
-
-               lock->acquire_ip = ip;
-       }
 }
 
 void debug_rt_mutex_proxy_unlock(struct rt_mutex *lock)
 {
-       unsigned long flags;
-
-       if (rt_trace_on) {
-               struct task_struct *owner = rt_mutex_owner(lock);
-
-               TRACE_WARN_ON_LOCKED(!owner);
-               TRACE_WARN_ON_LOCKED(list_empty(&lock->held_list_entry));
-
-               spin_lock_irqsave(&owner->held_list_lock, flags);
-               list_del_init(&lock->held_list_entry);
-               spin_unlock_irqrestore(&owner->held_list_lock, flags);
-       }
+       TRACE_WARN_ON_LOCKED(!rt_mutex_owner(lock));
 }
 
 void debug_rt_mutex_init_waiter(struct rt_mutex_waiter *waiter)
@@ -493,17 +224,15 @@ void debug_rt_mutex_free_waiter(struct rt_mutex_waiter *waiter)
 
 void debug_rt_mutex_init(struct rt_mutex *lock, const char *name)
 {
-       void *addr = lock;
-
-       if (rt_trace_on) {
-               rt_mutex_debug_check_no_locks_freed(addr,
-                                                   sizeof(struct rt_mutex));
-               INIT_LIST_HEAD(&lock->held_list_entry);
-               lock->name = name;
-       }
+       /*
+        * Make sure we are not reinitializing a held lock:
+        */
+       debug_check_no_locks_freed((void *)lock, sizeof(*lock));
+       lock->name = name;
 }
 
-void rt_mutex_deadlock_account_lock(struct rt_mutex *lock, task_t *task)
+void
+rt_mutex_deadlock_account_lock(struct rt_mutex *lock, struct task_struct *task)
 {
 }
 
index 7612fbc62d701b2ab95b52f4fbbe4265055b23ee..14193d596d7858c1db04baeebc55c3e665e01208 100644 (file)
@@ -9,20 +9,16 @@
  * This file contains macros used solely by rtmutex.c. Debug version.
  */
 
-#define __IP_DECL__            , unsigned long ip
-#define __IP__                 , ip
-#define __RET_IP__             , (unsigned long)__builtin_return_address(0)
-
 extern void
 rt_mutex_deadlock_account_lock(struct rt_mutex *lock, struct task_struct *task);
 extern void rt_mutex_deadlock_account_unlock(struct task_struct *task);
 extern void debug_rt_mutex_init_waiter(struct rt_mutex_waiter *waiter);
 extern void debug_rt_mutex_free_waiter(struct rt_mutex_waiter *waiter);
 extern void debug_rt_mutex_init(struct rt_mutex *lock, const char *name);
-extern void debug_rt_mutex_lock(struct rt_mutex *lock __IP_DECL__);
+extern void debug_rt_mutex_lock(struct rt_mutex *lock);
 extern void debug_rt_mutex_unlock(struct rt_mutex *lock);
 extern void debug_rt_mutex_proxy_lock(struct rt_mutex *lock,
-                                     struct task_struct *powner __IP_DECL__);
+                                     struct task_struct *powner);
 extern void debug_rt_mutex_proxy_unlock(struct rt_mutex *lock);
 extern void debug_rt_mutex_deadlock(int detect, struct rt_mutex_waiter *waiter,
                                    struct rt_mutex *lock);
index e82c2f848249462f64faecda994cae841af02b27..494dac872a135823f42a6dec51a8dea301e05f17 100644 (file)
@@ -33,7 +33,7 @@ struct test_thread_data {
 };
 
 static struct test_thread_data thread_data[MAX_RT_TEST_THREADS];
-static task_t *threads[MAX_RT_TEST_THREADS];
+static struct task_struct *threads[MAX_RT_TEST_THREADS];
 static struct rt_mutex mutexes[MAX_RT_TEST_MUTEXES];
 
 enum test_opcodes {
@@ -361,8 +361,8 @@ static ssize_t sysfs_test_command(struct sys_device *dev, const char *buf,
 static ssize_t sysfs_test_status(struct sys_device *dev, char *buf)
 {
        struct test_thread_data *td;
+       struct task_struct *tsk;
        char *curr = buf;
-       task_t *tsk;
        int i;
 
        td = container_of(dev, struct test_thread_data, sysdev);
index 45d61016da57612ec7690568abaef95a4515c547..d2ef13b485e7a802641ecaa480640a56e7ab1d86 100644 (file)
@@ -157,12 +157,11 @@ int max_lock_depth = 1024;
  * Decreases task's usage by one - may thus free the task.
  * Returns 0 or -EDEADLK.
  */
-static int rt_mutex_adjust_prio_chain(task_t *task,
+static int rt_mutex_adjust_prio_chain(struct task_struct *task,
                                      int deadlock_detect,
                                      struct rt_mutex *orig_lock,
                                      struct rt_mutex_waiter *orig_waiter,
-                                     struct task_struct *top_task
-                                     __IP_DECL__)
+                                     struct task_struct *top_task)
 {
        struct rt_mutex *lock;
        struct rt_mutex_waiter *waiter, *top_waiter = orig_waiter;
@@ -283,6 +282,7 @@ static int rt_mutex_adjust_prio_chain(task_t *task,
        spin_unlock_irqrestore(&task->pi_lock, flags);
  out_put_task:
        put_task_struct(task);
+
        return ret;
 }
 
@@ -357,7 +357,7 @@ static inline int try_to_steal_lock(struct rt_mutex *lock)
  *
  * Must be called with lock->wait_lock held.
  */
-static int try_to_take_rt_mutex(struct rt_mutex *lock __IP_DECL__)
+static int try_to_take_rt_mutex(struct rt_mutex *lock)
 {
        /*
         * We have to be careful here if the atomic speedups are
@@ -384,7 +384,7 @@ static int try_to_take_rt_mutex(struct rt_mutex *lock __IP_DECL__)
                return 0;
 
        /* We got the lock. */
-       debug_rt_mutex_lock(lock __IP__);
+       debug_rt_mutex_lock(lock);
 
        rt_mutex_set_owner(lock, current, 0);
 
@@ -402,13 +402,12 @@ static int try_to_take_rt_mutex(struct rt_mutex *lock __IP_DECL__)
  */
 static int task_blocks_on_rt_mutex(struct rt_mutex *lock,
                                   struct rt_mutex_waiter *waiter,
-                                  int detect_deadlock
-                                  __IP_DECL__)
+                                  int detect_deadlock)
 {
+       struct task_struct *owner = rt_mutex_owner(lock);
        struct rt_mutex_waiter *top_waiter = waiter;
-       task_t *owner = rt_mutex_owner(lock);
-       int boost = 0, res;
        unsigned long flags;
+       int boost = 0, res;
 
        spin_lock_irqsave(&current->pi_lock, flags);
        __rt_mutex_adjust_prio(current);
@@ -454,7 +453,7 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock,
        spin_unlock(&lock->wait_lock);
 
        res = rt_mutex_adjust_prio_chain(owner, detect_deadlock, lock, waiter,
-                                        current __IP__);
+                                        current);
 
        spin_lock(&lock->wait_lock);
 
@@ -526,12 +525,12 @@ static void wakeup_next_waiter(struct rt_mutex *lock)
  * Must be called with lock->wait_lock held
  */
 static void remove_waiter(struct rt_mutex *lock,
-                         struct rt_mutex_waiter *waiter  __IP_DECL__)
+                         struct rt_mutex_waiter *waiter)
 {
        int first = (waiter == rt_mutex_top_waiter(lock));
-       int boost = 0;
-       task_t *owner = rt_mutex_owner(lock);
+       struct task_struct *owner = rt_mutex_owner(lock);
        unsigned long flags;
+       int boost = 0;
 
        spin_lock_irqsave(&current->pi_lock, flags);
        plist_del(&waiter->list_entry, &lock->wait_list);
@@ -568,7 +567,7 @@ static void remove_waiter(struct rt_mutex *lock,
 
        spin_unlock(&lock->wait_lock);
 
-       rt_mutex_adjust_prio_chain(owner, 0, lock, NULL, current __IP__);
+       rt_mutex_adjust_prio_chain(owner, 0, lock, NULL, current);
 
        spin_lock(&lock->wait_lock);
 }
@@ -595,7 +594,7 @@ void rt_mutex_adjust_pi(struct task_struct *task)
        get_task_struct(task);
        spin_unlock_irqrestore(&task->pi_lock, flags);
 
-       rt_mutex_adjust_prio_chain(task, 0, NULL, NULL, task __RET_IP__);
+       rt_mutex_adjust_prio_chain(task, 0, NULL, NULL, task);
 }
 
 /*
@@ -604,7 +603,7 @@ void rt_mutex_adjust_pi(struct task_struct *task)
 static int __sched
 rt_mutex_slowlock(struct rt_mutex *lock, int state,
                  struct hrtimer_sleeper *timeout,
-                 int detect_deadlock __IP_DECL__)
+                 int detect_deadlock)
 {
        struct rt_mutex_waiter waiter;
        int ret = 0;
@@ -615,7 +614,7 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state,
        spin_lock(&lock->wait_lock);
 
        /* Try to acquire the lock again: */
-       if (try_to_take_rt_mutex(lock __IP__)) {
+       if (try_to_take_rt_mutex(lock)) {
                spin_unlock(&lock->wait_lock);
                return 0;
        }
@@ -629,7 +628,7 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state,
 
        for (;;) {
                /* Try to acquire the lock: */
-               if (try_to_take_rt_mutex(lock __IP__))
+               if (try_to_take_rt_mutex(lock))
                        break;
 
                /*
@@ -653,7 +652,7 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state,
                 */
                if (!waiter.task) {
                        ret = task_blocks_on_rt_mutex(lock, &waiter,
-                                                     detect_deadlock __IP__);
+                                                     detect_deadlock);
                        /*
                         * If we got woken up by the owner then start loop
                         * all over without going into schedule to try
@@ -680,7 +679,7 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state,
        set_current_state(TASK_RUNNING);
 
        if (unlikely(waiter.task))
-               remove_waiter(lock, &waiter __IP__);
+               remove_waiter(lock, &waiter);
 
        /*
         * try_to_take_rt_mutex() sets the waiter bit
@@ -711,7 +710,7 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state,
  * Slow path try-lock function:
  */
 static inline int
-rt_mutex_slowtrylock(struct rt_mutex *lock __IP_DECL__)
+rt_mutex_slowtrylock(struct rt_mutex *lock)
 {
        int ret = 0;
 
@@ -719,7 +718,7 @@ rt_mutex_slowtrylock(struct rt_mutex *lock __IP_DECL__)
 
        if (likely(rt_mutex_owner(lock) != current)) {
 
-               ret = try_to_take_rt_mutex(lock __IP__);
+               ret = try_to_take_rt_mutex(lock);
                /*
                 * try_to_take_rt_mutex() sets the lock waiters
                 * bit unconditionally. Clean this up.
@@ -769,13 +768,13 @@ rt_mutex_fastlock(struct rt_mutex *lock, int state,
                  int detect_deadlock,
                  int (*slowfn)(struct rt_mutex *lock, int state,
                                struct hrtimer_sleeper *timeout,
-                               int detect_deadlock __IP_DECL__))
+                               int detect_deadlock))
 {
        if (!detect_deadlock && likely(rt_mutex_cmpxchg(lock, NULL, current))) {
                rt_mutex_deadlock_account_lock(lock, current);
                return 0;
        } else
-               return slowfn(lock, state, NULL, detect_deadlock __RET_IP__);
+               return slowfn(lock, state, NULL, detect_deadlock);
 }
 
 static inline int
@@ -783,24 +782,24 @@ rt_mutex_timed_fastlock(struct rt_mutex *lock, int state,
                        struct hrtimer_sleeper *timeout, int detect_deadlock,
                        int (*slowfn)(struct rt_mutex *lock, int state,
                                      struct hrtimer_sleeper *timeout,
-                                     int detect_deadlock __IP_DECL__))
+                                     int detect_deadlock))
 {
        if (!detect_deadlock && likely(rt_mutex_cmpxchg(lock, NULL, current))) {
                rt_mutex_deadlock_account_lock(lock, current);
                return 0;
        } else
-               return slowfn(lock, state, timeout, detect_deadlock __RET_IP__);
+               return slowfn(lock, state, timeout, detect_deadlock);
 }
 
 static inline int
 rt_mutex_fasttrylock(struct rt_mutex *lock,
-                    int (*slowfn)(struct rt_mutex *lock __IP_DECL__))
+                    int (*slowfn)(struct rt_mutex *lock))
 {
        if (likely(rt_mutex_cmpxchg(lock, NULL, current))) {
                rt_mutex_deadlock_account_lock(lock, current);
                return 1;
        }
-       return slowfn(lock __RET_IP__);
+       return slowfn(lock);
 }
 
 static inline void
@@ -948,7 +947,7 @@ void rt_mutex_init_proxy_locked(struct rt_mutex *lock,
                                struct task_struct *proxy_owner)
 {
        __rt_mutex_init(lock, NULL);
-       debug_rt_mutex_proxy_lock(lock, proxy_owner __RET_IP__);
+       debug_rt_mutex_proxy_lock(lock, proxy_owner);
        rt_mutex_set_owner(lock, proxy_owner, 0);
        rt_mutex_deadlock_account_lock(lock, proxy_owner);
 }
index 1e0fca13ff72b4e132e32eee2934837db737d87b..a1a1dd06421d05742e9e5a612b2b010cbdfa096c 100644 (file)
@@ -10,9 +10,6 @@
  * Non-debug version.
  */
 
-#define __IP_DECL__
-#define __IP__
-#define __RET_IP__
 #define rt_mutex_deadlock_check(l)                     (0)
 #define rt_mutex_deadlock_account_lock(m, t)           do { } while (0)
 #define rt_mutex_deadlock_account_unlock(l)            do { } while (0)
diff --git a/kernel/rwsem.c b/kernel/rwsem.c
new file mode 100644 (file)
index 0000000..291ded5
--- /dev/null
@@ -0,0 +1,147 @@
+/* kernel/rwsem.c: R/W semaphores, public implementation
+ *
+ * Written by David Howells (dhowells@redhat.com).
+ * Derived from asm-i386/semaphore.h
+ */
+
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/rwsem.h>
+
+#include <asm/system.h>
+#include <asm/atomic.h>
+
+/*
+ * lock for reading
+ */
+void down_read(struct rw_semaphore *sem)
+{
+       might_sleep();
+       rwsem_acquire_read(&sem->dep_map, 0, 0, _RET_IP_);
+
+       __down_read(sem);
+}
+
+EXPORT_SYMBOL(down_read);
+
+/*
+ * trylock for reading -- returns 1 if successful, 0 if contention
+ */
+int down_read_trylock(struct rw_semaphore *sem)
+{
+       int ret = __down_read_trylock(sem);
+
+       if (ret == 1)
+               rwsem_acquire_read(&sem->dep_map, 0, 1, _RET_IP_);
+       return ret;
+}
+
+EXPORT_SYMBOL(down_read_trylock);
+
+/*
+ * lock for writing
+ */
+void down_write(struct rw_semaphore *sem)
+{
+       might_sleep();
+       rwsem_acquire(&sem->dep_map, 0, 0, _RET_IP_);
+
+       __down_write(sem);
+}
+
+EXPORT_SYMBOL(down_write);
+
+/*
+ * trylock for writing -- returns 1 if successful, 0 if contention
+ */
+int down_write_trylock(struct rw_semaphore *sem)
+{
+       int ret = __down_write_trylock(sem);
+
+       if (ret == 1)
+               rwsem_acquire(&sem->dep_map, 0, 0, _RET_IP_);
+       return ret;
+}
+
+EXPORT_SYMBOL(down_write_trylock);
+
+/*
+ * release a read lock
+ */
+void up_read(struct rw_semaphore *sem)
+{
+       rwsem_release(&sem->dep_map, 1, _RET_IP_);
+
+       __up_read(sem);
+}
+
+EXPORT_SYMBOL(up_read);
+
+/*
+ * release a write lock
+ */
+void up_write(struct rw_semaphore *sem)
+{
+       rwsem_release(&sem->dep_map, 1, _RET_IP_);
+
+       __up_write(sem);
+}
+
+EXPORT_SYMBOL(up_write);
+
+/*
+ * downgrade write lock to read lock
+ */
+void downgrade_write(struct rw_semaphore *sem)
+{
+       /*
+        * lockdep: a downgraded write will live on as a write
+        * dependency.
+        */
+       __downgrade_write(sem);
+}
+
+EXPORT_SYMBOL(downgrade_write);
+
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+
+void down_read_nested(struct rw_semaphore *sem, int subclass)
+{
+       might_sleep();
+       rwsem_acquire_read(&sem->dep_map, subclass, 0, _RET_IP_);
+
+       __down_read(sem);
+}
+
+EXPORT_SYMBOL(down_read_nested);
+
+void down_read_non_owner(struct rw_semaphore *sem)
+{
+       might_sleep();
+
+       __down_read(sem);
+}
+
+EXPORT_SYMBOL(down_read_non_owner);
+
+void down_write_nested(struct rw_semaphore *sem, int subclass)
+{
+       might_sleep();
+       rwsem_acquire(&sem->dep_map, subclass, 0, _RET_IP_);
+
+       __down_write_nested(sem, subclass);
+}
+
+EXPORT_SYMBOL(down_write_nested);
+
+void up_read_non_owner(struct rw_semaphore *sem)
+{
+       __up_read(sem);
+}
+
+EXPORT_SYMBOL(up_read_non_owner);
+
+#endif
+
+
index 2629c1711fd62be84574153e0ae62077895f3b36..4ee400f9d56bc950c33c6afefd616ff1591359fc 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/capability.h>
 #include <linux/completion.h>
 #include <linux/kernel_stat.h>
+#include <linux/debug_locks.h>
 #include <linux/security.h>
 #include <linux/notifier.h>
 #include <linux/profile.h>
@@ -178,20 +179,15 @@ static unsigned int static_prio_timeslice(int static_prio)
                return SCALE_PRIO(DEF_TIMESLICE, static_prio);
 }
 
-static inline unsigned int task_timeslice(task_t *p)
+static inline unsigned int task_timeslice(struct task_struct *p)
 {
        return static_prio_timeslice(p->static_prio);
 }
 
-#define task_hot(p, now, sd) ((long long) ((now) - (p)->last_ran)      \
-                               < (long long) (sd)->cache_hot_time)
-
 /*
  * These are the runqueue data structures:
  */
 
-typedef struct runqueue runqueue_t;
-
 struct prio_array {
        unsigned int nr_active;
        DECLARE_BITMAP(bitmap, MAX_PRIO+1); /* include 1 bit for delimiter */
@@ -205,7 +201,7 @@ struct prio_array {
  * (such as the load balancing or the thread migration code), lock
  * acquire operations must be ordered by ascending &runqueue.
  */
-struct runqueue {
+struct rq {
        spinlock_t lock;
 
        /*
@@ -229,9 +225,9 @@ struct runqueue {
 
        unsigned long expired_timestamp;
        unsigned long long timestamp_last_tick;
-       task_t *curr, *idle;
+       struct task_struct *curr, *idle;
        struct mm_struct *prev_mm;
-       prio_array_t *active, *expired, arrays[2];
+       struct prio_array *active, *expired, arrays[2];
        int best_expired_prio;
        atomic_t nr_iowait;
 
@@ -242,7 +238,7 @@ struct runqueue {
        int active_balance;
        int push_cpu;
 
-       task_t *migration_thread;
+       struct task_struct *migration_thread;
        struct list_head migration_queue;
 #endif
 
@@ -265,9 +261,10 @@ struct runqueue {
        unsigned long ttwu_cnt;
        unsigned long ttwu_local;
 #endif
+       struct lock_class_key rq_lock_key;
 };
 
-static DEFINE_PER_CPU(struct runqueue, runqueues);
+static DEFINE_PER_CPU(struct rq, runqueues);
 
 /*
  * The domain tree (rq->sd) is protected by RCU's quiescent state transition.
@@ -276,8 +273,8 @@ static DEFINE_PER_CPU(struct runqueue, runqueues);
  * The domain tree of any CPU may only be accessed from within
  * preempt-disabled sections.
  */
-#define for_each_domain(cpu, domain) \
-for (domain = rcu_dereference(cpu_rq(cpu)->sd); domain; domain = domain->parent)
+#define for_each_domain(cpu, __sd) \
+       for (__sd = rcu_dereference(cpu_rq(cpu)->sd); __sd; __sd = __sd->parent)
 
 #define cpu_rq(cpu)            (&per_cpu(runqueues, (cpu)))
 #define this_rq()              (&__get_cpu_var(runqueues))
@@ -292,26 +289,33 @@ for (domain = rcu_dereference(cpu_rq(cpu)->sd); domain; domain = domain->parent)
 #endif
 
 #ifndef __ARCH_WANT_UNLOCKED_CTXSW
-static inline int task_running(runqueue_t *rq, task_t *p)
+static inline int task_running(struct rq *rq, struct task_struct *p)
 {
        return rq->curr == p;
 }
 
-static inline void prepare_lock_switch(runqueue_t *rq, task_t *next)
+static inline void prepare_lock_switch(struct rq *rq, struct task_struct *next)
 {
 }
 
-static inline void finish_lock_switch(runqueue_t *rq, task_t *prev)
+static inline void finish_lock_switch(struct rq *rq, struct task_struct *prev)
 {
 #ifdef CONFIG_DEBUG_SPINLOCK
        /* this is a valid case when another task releases the spinlock */
        rq->lock.owner = current;
 #endif
+       /*
+        * If we are tracking spinlock dependencies then we have to
+        * fix up the runqueue lock - which gets 'carried over' from
+        * prev into current:
+        */
+       spin_acquire(&rq->lock.dep_map, 0, 0, _THIS_IP_);
+
        spin_unlock_irq(&rq->lock);
 }
 
 #else /* __ARCH_WANT_UNLOCKED_CTXSW */
-static inline int task_running(runqueue_t *rq, task_t *p)
+static inline int task_running(struct rq *rq, struct task_struct *p)
 {
 #ifdef CONFIG_SMP
        return p->oncpu;
@@ -320,7 +324,7 @@ static inline int task_running(runqueue_t *rq, task_t *p)
 #endif
 }
 
-static inline void prepare_lock_switch(runqueue_t *rq, task_t *next)
+static inline void prepare_lock_switch(struct rq *rq, struct task_struct *next)
 {
 #ifdef CONFIG_SMP
        /*
@@ -337,7 +341,7 @@ static inline void prepare_lock_switch(runqueue_t *rq, task_t *next)
 #endif
 }
 
-static inline void finish_lock_switch(runqueue_t *rq, task_t *prev)
+static inline void finish_lock_switch(struct rq *rq, struct task_struct *prev)
 {
 #ifdef CONFIG_SMP
        /*
@@ -358,10 +362,10 @@ static inline void finish_lock_switch(runqueue_t *rq, task_t *prev)
  * __task_rq_lock - lock the runqueue a given task resides on.
  * Must be called interrupts disabled.
  */
-static inline runqueue_t *__task_rq_lock(task_t *p)
+static inline struct rq *__task_rq_lock(struct task_struct *p)
        __acquires(rq->lock)
 {
-       struct runqueue *rq;
+       struct rq *rq;
 
 repeat_lock_task:
        rq = task_rq(p);
@@ -378,10 +382,10 @@ repeat_lock_task:
  * interrupts.  Note the ordering: we can safely lookup the task_rq without
  * explicitly disabling preemption.
  */
-static runqueue_t *task_rq_lock(task_t *p, unsigned long *flags)
+static struct rq *task_rq_lock(struct task_struct *p, unsigned long *flags)
        __acquires(rq->lock)
 {
-       struct runqueue *rq;
+       struct rq *rq;
 
 repeat_lock_task:
        local_irq_save(*flags);
@@ -394,13 +398,13 @@ repeat_lock_task:
        return rq;
 }
 
-static inline void __task_rq_unlock(runqueue_t *rq)
+static inline void __task_rq_unlock(struct rq *rq)
        __releases(rq->lock)
 {
        spin_unlock(&rq->lock);
 }
 
-static inline void task_rq_unlock(runqueue_t *rq, unsigned long *flags)
+static inline void task_rq_unlock(struct rq *rq, unsigned long *flags)
        __releases(rq->lock)
 {
        spin_unlock_irqrestore(&rq->lock, *flags);
@@ -420,7 +424,7 @@ static int show_schedstat(struct seq_file *seq, void *v)
        seq_printf(seq, "version %d\n", SCHEDSTAT_VERSION);
        seq_printf(seq, "timestamp %lu\n", jiffies);
        for_each_online_cpu(cpu) {
-               runqueue_t *rq = cpu_rq(cpu);
+               struct rq *rq = cpu_rq(cpu);
 #ifdef CONFIG_SMP
                struct sched_domain *sd;
                int dcnt = 0;
@@ -507,10 +511,10 @@ struct file_operations proc_schedstat_operations = {
 /*
  * rq_lock - lock a given runqueue and disable interrupts.
  */
-static inline runqueue_t *this_rq_lock(void)
+static inline struct rq *this_rq_lock(void)
        __acquires(rq->lock)
 {
-       runqueue_t *rq;
+       struct rq *rq;
 
        local_irq_disable();
        rq = this_rq();
@@ -535,7 +539,7 @@ static inline runqueue_t *this_rq_lock(void)
  * long it was from the *first* time it was queued to the time that it
  * finally hit a cpu.
  */
-static inline void sched_info_dequeued(task_t *t)
+static inline void sched_info_dequeued(struct task_struct *t)
 {
        t->sched_info.last_queued = 0;
 }
@@ -545,10 +549,10 @@ static inline void sched_info_dequeued(task_t *t)
  * long it was waiting to run.  We also note when it began so that we
  * can keep stats on how long its timeslice is.
  */
-static void sched_info_arrive(task_t *t)
+static void sched_info_arrive(struct task_struct *t)
 {
        unsigned long now = jiffies, diff = 0;
-       struct runqueue *rq = task_rq(t);
+       struct rq *rq = task_rq(t);
 
        if (t->sched_info.last_queued)
                diff = now - t->sched_info.last_queued;
@@ -579,7 +583,7 @@ static void sched_info_arrive(task_t *t)
  * the timestamp if it is already not set.  It's assumed that
  * sched_info_dequeued() will clear that stamp when appropriate.
  */
-static inline void sched_info_queued(task_t *t)
+static inline void sched_info_queued(struct task_struct *t)
 {
        if (!t->sched_info.last_queued)
                t->sched_info.last_queued = jiffies;
@@ -589,9 +593,9 @@ static inline void sched_info_queued(task_t *t)
  * Called when a process ceases being the active-running process, either
  * voluntarily or involuntarily.  Now we can calculate how long we ran.
  */
-static inline void sched_info_depart(task_t *t)
+static inline void sched_info_depart(struct task_struct *t)
 {
-       struct runqueue *rq = task_rq(t);
+       struct rq *rq = task_rq(t);
        unsigned long diff = jiffies - t->sched_info.last_arrival;
 
        t->sched_info.cpu_time += diff;
@@ -605,9 +609,10 @@ static inline void sched_info_depart(task_t *t)
  * their time slice.  (This may also be called when switching to or from
  * the idle task.)  We are only called when prev != next.
  */
-static inline void sched_info_switch(task_t *prev, task_t *next)
+static inline void
+sched_info_switch(struct task_struct *prev, struct task_struct *next)
 {
-       struct runqueue *rq = task_rq(prev);
+       struct rq *rq = task_rq(prev);
 
        /*
         * prev now departs the cpu.  It's not interesting to record
@@ -628,7 +633,7 @@ static inline void sched_info_switch(task_t *prev, task_t *next)
 /*
  * Adding/removing a task to/from a priority array:
  */
-static void dequeue_task(struct task_struct *p, prio_array_t *array)
+static void dequeue_task(struct task_struct *p, struct prio_array *array)
 {
        array->nr_active--;
        list_del(&p->run_list);
@@ -636,7 +641,7 @@ static void dequeue_task(struct task_struct *p, prio_array_t *array)
                __clear_bit(p->prio, array->bitmap);
 }
 
-static void enqueue_task(struct task_struct *p, prio_array_t *array)
+static void enqueue_task(struct task_struct *p, struct prio_array *array)
 {
        sched_info_queued(p);
        list_add_tail(&p->run_list, array->queue + p->prio);
@@ -649,12 +654,13 @@ static void enqueue_task(struct task_struct *p, prio_array_t *array)
  * Put task to the end of the run list without the overhead of dequeue
  * followed by enqueue.
  */
-static void requeue_task(struct task_struct *p, prio_array_t *array)
+static void requeue_task(struct task_struct *p, struct prio_array *array)
 {
        list_move_tail(&p->run_list, array->queue + p->prio);
 }
 
-static inline void enqueue_task_head(struct task_struct *p, prio_array_t *array)
+static inline void
+enqueue_task_head(struct task_struct *p, struct prio_array *array)
 {
        list_add(&p->run_list, array->queue + p->prio);
        __set_bit(p->prio, array->bitmap);
@@ -677,7 +683,7 @@ static inline void enqueue_task_head(struct task_struct *p, prio_array_t *array)
  * Both properties are important to certain workloads.
  */
 
-static inline int __normal_prio(task_t *p)
+static inline int __normal_prio(struct task_struct *p)
 {
        int bonus, prio;
 
@@ -713,7 +719,7 @@ static inline int __normal_prio(task_t *p)
 #define RTPRIO_TO_LOAD_WEIGHT(rp) \
        (PRIO_TO_LOAD_WEIGHT(MAX_RT_PRIO) + LOAD_WEIGHT(rp))
 
-static void set_load_weight(task_t *p)
+static void set_load_weight(struct task_struct *p)
 {
        if (has_rt_policy(p)) {
 #ifdef CONFIG_SMP
@@ -731,23 +737,25 @@ static void set_load_weight(task_t *p)
                p->load_weight = PRIO_TO_LOAD_WEIGHT(p->static_prio);
 }
 
-static inline void inc_raw_weighted_load(runqueue_t *rq, const task_t *p)
+static inline void
+inc_raw_weighted_load(struct rq *rq, const struct task_struct *p)
 {
        rq->raw_weighted_load += p->load_weight;
 }
 
-static inline void dec_raw_weighted_load(runqueue_t *rq, const task_t *p)
+static inline void
+dec_raw_weighted_load(struct rq *rq, const struct task_struct *p)
 {
        rq->raw_weighted_load -= p->load_weight;
 }
 
-static inline void inc_nr_running(task_t *p, runqueue_t *rq)
+static inline void inc_nr_running(struct task_struct *p, struct rq *rq)
 {
        rq->nr_running++;
        inc_raw_weighted_load(rq, p);
 }
 
-static inline void dec_nr_running(task_t *p, runqueue_t *rq)
+static inline void dec_nr_running(struct task_struct *p, struct rq *rq)
 {
        rq->nr_running--;
        dec_raw_weighted_load(rq, p);
@@ -760,7 +768,7 @@ static inline void dec_nr_running(task_t *p, runqueue_t *rq)
  * setprio syscalls, and whenever the interactivity
  * estimator recalculates.
  */
-static inline int normal_prio(task_t *p)
+static inline int normal_prio(struct task_struct *p)
 {
        int prio;
 
@@ -778,7 +786,7 @@ static inline int normal_prio(task_t *p)
  * interactivity modifiers. Will be RT if the task got
  * RT-boosted. If not then it returns p->normal_prio.
  */
-static int effective_prio(task_t *p)
+static int effective_prio(struct task_struct *p)
 {
        p->normal_prio = normal_prio(p);
        /*
@@ -794,9 +802,9 @@ static int effective_prio(task_t *p)
 /*
  * __activate_task - move a task to the runqueue.
  */
-static void __activate_task(task_t *p, runqueue_t *rq)
+static void __activate_task(struct task_struct *p, struct rq *rq)
 {
-       prio_array_t *target = rq->active;
+       struct prio_array *target = rq->active;
 
        if (batch_task(p))
                target = rq->expired;
@@ -807,7 +815,7 @@ static void __activate_task(task_t *p, runqueue_t *rq)
 /*
  * __activate_idle_task - move idle task to the _front_ of runqueue.
  */
-static inline void __activate_idle_task(task_t *p, runqueue_t *rq)
+static inline void __activate_idle_task(struct task_struct *p, struct rq *rq)
 {
        enqueue_task_head(p, rq->active);
        inc_nr_running(p, rq);
@@ -817,7 +825,7 @@ static inline void __activate_idle_task(task_t *p, runqueue_t *rq)
  * Recalculate p->normal_prio and p->prio after having slept,
  * updating the sleep-average too:
  */
-static int recalc_task_prio(task_t *p, unsigned long long now)
+static int recalc_task_prio(struct task_struct *p, unsigned long long now)
 {
        /* Caller must always ensure 'now >= p->timestamp' */
        unsigned long sleep_time = now - p->timestamp;
@@ -889,7 +897,7 @@ static int recalc_task_prio(task_t *p, unsigned long long now)
  * Update all the scheduling statistics stuff. (sleep average
  * calculation, priority modifiers, etc.)
  */
-static void activate_task(task_t *p, runqueue_t *rq, int local)
+static void activate_task(struct task_struct *p, struct rq *rq, int local)
 {
        unsigned long long now;
 
@@ -897,7 +905,7 @@ static void activate_task(task_t *p, runqueue_t *rq, int local)
 #ifdef CONFIG_SMP
        if (!local) {
                /* Compensate for drifting sched_clock */
-               runqueue_t *this_rq = this_rq();
+               struct rq *this_rq = this_rq();
                now = (now - this_rq->timestamp_last_tick)
                        + rq->timestamp_last_tick;
        }
@@ -936,7 +944,7 @@ static void activate_task(task_t *p, runqueue_t *rq, int local)
 /*
  * deactivate_task - remove a task from the runqueue.
  */
-static void deactivate_task(struct task_struct *p, runqueue_t *rq)
+static void deactivate_task(struct task_struct *p, struct rq *rq)
 {
        dec_nr_running(p, rq);
        dequeue_task(p, p->array);
@@ -956,7 +964,7 @@ static void deactivate_task(struct task_struct *p, runqueue_t *rq)
 #define tsk_is_polling(t) test_tsk_thread_flag(t, TIF_POLLING_NRFLAG)
 #endif
 
-static void resched_task(task_t *p)
+static void resched_task(struct task_struct *p)
 {
        int cpu;
 
@@ -977,7 +985,7 @@ static void resched_task(task_t *p)
                smp_send_reschedule(cpu);
 }
 #else
-static inline void resched_task(task_t *p)
+static inline void resched_task(struct task_struct *p)
 {
        assert_spin_locked(&task_rq(p)->lock);
        set_tsk_need_resched(p);
@@ -988,7 +996,7 @@ static inline void resched_task(task_t *p)
  * task_curr - is this task currently executing on a CPU?
  * @p: the task in question.
  */
-inline int task_curr(const task_t *p)
+inline int task_curr(const struct task_struct *p)
 {
        return cpu_curr(task_cpu(p)) == p;
 }
@@ -1000,22 +1008,23 @@ unsigned long weighted_cpuload(const int cpu)
 }
 
 #ifdef CONFIG_SMP
-typedef struct {
+struct migration_req {
        struct list_head list;
 
-       task_t *task;
+       struct task_struct *task;
        int dest_cpu;
 
        struct completion done;
-} migration_req_t;
+};
 
 /*
  * The task's runqueue lock must be held.
  * Returns true if you have to wait for migration thread.
  */
-static int migrate_task(task_t *p, int dest_cpu, migration_req_t *req)
+static int
+migrate_task(struct task_struct *p, int dest_cpu, struct migration_req *req)
 {
-       runqueue_t *rq = task_rq(p);
+       struct rq *rq = task_rq(p);
 
        /*
         * If the task is not on a runqueue (and not running), then
@@ -1030,6 +1039,7 @@ static int migrate_task(task_t *p, int dest_cpu, migration_req_t *req)
        req->task = p;
        req->dest_cpu = dest_cpu;
        list_add(&req->list, &rq->migration_queue);
+
        return 1;
 }
 
@@ -1042,10 +1052,10 @@ static int migrate_task(task_t *p, int dest_cpu, migration_req_t *req)
  * smp_call_function() if an IPI is sent by the same process we are
  * waiting to become inactive.
  */
-void wait_task_inactive(task_t *p)
+void wait_task_inactive(struct task_struct *p)
 {
        unsigned long flags;
-       runqueue_t *rq;
+       struct rq *rq;
        int preempted;
 
 repeat:
@@ -1076,7 +1086,7 @@ repeat:
  * to another CPU then no harm is done and the purpose has been
  * achieved as well.
  */
-void kick_process(task_t *p)
+void kick_process(struct task_struct *p)
 {
        int cpu;
 
@@ -1096,7 +1106,7 @@ void kick_process(task_t *p)
  */
 static inline unsigned long source_load(int cpu, int type)
 {
-       runqueue_t *rq = cpu_rq(cpu);
+       struct rq *rq = cpu_rq(cpu);
 
        if (type == 0)
                return rq->raw_weighted_load;
@@ -1110,7 +1120,7 @@ static inline unsigned long source_load(int cpu, int type)
  */
 static inline unsigned long target_load(int cpu, int type)
 {
-       runqueue_t *rq = cpu_rq(cpu);
+       struct rq *rq = cpu_rq(cpu);
 
        if (type == 0)
                return rq->raw_weighted_load;
@@ -1123,10 +1133,10 @@ static inline unsigned long target_load(int cpu, int type)
  */
 static inline unsigned long cpu_avg_load_per_task(int cpu)
 {
-       runqueue_t *rq = cpu_rq(cpu);
+       struct rq *rq = cpu_rq(cpu);
        unsigned long n = rq->nr_running;
 
-       return n ?  rq->raw_weighted_load / n : SCHED_LOAD_SCALE;
+       return n ? rq->raw_weighted_load / n : SCHED_LOAD_SCALE;
 }
 
 /*
@@ -1279,7 +1289,7 @@ nextlevel:
  * Returns the CPU we should wake onto.
  */
 #if defined(ARCH_HAS_SCHED_WAKE_IDLE)
-static int wake_idle(int cpu, task_t *p)
+static int wake_idle(int cpu, struct task_struct *p)
 {
        cpumask_t tmp;
        struct sched_domain *sd;
@@ -1302,7 +1312,7 @@ static int wake_idle(int cpu, task_t *p)
        return cpu;
 }
 #else
-static inline int wake_idle(int cpu, task_t *p)
+static inline int wake_idle(int cpu, struct task_struct *p)
 {
        return cpu;
 }
@@ -1322,15 +1332,15 @@ static inline int wake_idle(int cpu, task_t *p)
  *
  * returns failure only if the task is already active.
  */
-static int try_to_wake_up(task_t *p, unsigned int state, int sync)
+static int try_to_wake_up(struct task_struct *p, unsigned int state, int sync)
 {
        int cpu, this_cpu, success = 0;
        unsigned long flags;
        long old_state;
-       runqueue_t *rq;
+       struct rq *rq;
 #ifdef CONFIG_SMP
-       unsigned long load, this_load;
        struct sched_domain *sd, *this_sd = NULL;
+       unsigned long load, this_load;
        int new_cpu;
 #endif
 
@@ -1480,15 +1490,14 @@ out:
        return success;
 }
 
-int fastcall wake_up_process(task_t *p)
+int fastcall wake_up_process(struct task_struct *p)
 {
        return try_to_wake_up(p, TASK_STOPPED | TASK_TRACED |
                                 TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE, 0);
 }
-
 EXPORT_SYMBOL(wake_up_process);
 
-int fastcall wake_up_state(task_t *p, unsigned int state)
+int fastcall wake_up_state(struct task_struct *p, unsigned int state)
 {
        return try_to_wake_up(p, state, 0);
 }
@@ -1497,7 +1506,7 @@ int fastcall wake_up_state(task_t *p, unsigned int state)
  * Perform scheduler related setup for a newly forked process p.
  * p is forked by current.
  */
-void fastcall sched_fork(task_t *p, int clone_flags)
+void fastcall sched_fork(struct task_struct *p, int clone_flags)
 {
        int cpu = get_cpu();
 
@@ -1565,11 +1574,11 @@ void fastcall sched_fork(task_t *p, int clone_flags)
  * that must be done for every newly created context, then puts the task
  * on the runqueue and wakes it.
  */
-void fastcall wake_up_new_task(task_t *p, unsigned long clone_flags)
+void fastcall wake_up_new_task(struct task_struct *p, unsigned long clone_flags)
 {
+       struct rq *rq, *this_rq;
        unsigned long flags;
        int this_cpu, cpu;
-       runqueue_t *rq, *this_rq;
 
        rq = task_rq_lock(p, &flags);
        BUG_ON(p->state != TASK_RUNNING);
@@ -1649,10 +1658,10 @@ void fastcall wake_up_new_task(task_t *p, unsigned long clone_flags)
  * artificially, because any timeslice recovered here
  * was given away by the parent in the first place.)
  */
-void fastcall sched_exit(task_t *p)
+void fastcall sched_exit(struct task_struct *p)
 {
        unsigned long flags;
-       runqueue_t *rq;
+       struct rq *rq;
 
        /*
         * If the child was a (relative-) CPU hog then decrease
@@ -1683,7 +1692,7 @@ void fastcall sched_exit(task_t *p)
  * prepare_task_switch sets up locking and calls architecture specific
  * hooks.
  */
-static inline void prepare_task_switch(runqueue_t *rq, task_t *next)
+static inline void prepare_task_switch(struct rq *rq, struct task_struct *next)
 {
        prepare_lock_switch(rq, next);
        prepare_arch_switch(next);
@@ -1704,7 +1713,7 @@ static inline void prepare_task_switch(runqueue_t *rq, task_t *next)
  * with the lock held can cause deadlocks; see schedule() for
  * details.)
  */
-static inline void finish_task_switch(runqueue_t *rq, task_t *prev)
+static inline void finish_task_switch(struct rq *rq, struct task_struct *prev)
        __releases(rq->lock)
 {
        struct mm_struct *mm = rq->prev_mm;
@@ -1742,10 +1751,11 @@ static inline void finish_task_switch(runqueue_t *rq, task_t *prev)
  * schedule_tail - first thing a freshly forked thread must call.
  * @prev: the thread we just switched away from.
  */
-asmlinkage void schedule_tail(task_t *prev)
+asmlinkage void schedule_tail(struct task_struct *prev)
        __releases(rq->lock)
 {
-       runqueue_t *rq = this_rq();
+       struct rq *rq = this_rq();
+
        finish_task_switch(rq, prev);
 #ifdef __ARCH_WANT_UNLOCKED_CTXSW
        /* In this case, finish_task_switch does not reenable preemption */
@@ -1759,8 +1769,9 @@ asmlinkage void schedule_tail(task_t *prev)
  * context_switch - switch to the new MM and the new
  * thread's register state.
  */
-static inline
-task_t * context_switch(runqueue_t *rq, task_t *prev, task_t *next)
+static inline struct task_struct *
+context_switch(struct rq *rq, struct task_struct *prev,
+              struct task_struct *next)
 {
        struct mm_struct *mm = next->mm;
        struct mm_struct *oldmm = prev->active_mm;
@@ -1777,6 +1788,7 @@ task_t * context_switch(runqueue_t *rq, task_t *prev, task_t *next)
                WARN_ON(rq->prev_mm);
                rq->prev_mm = oldmm;
        }
+       spin_release(&rq->lock.dep_map, 1, _THIS_IP_);
 
        /* Here we just switch the register state and the stack. */
        switch_to(prev, next, prev);
@@ -1856,13 +1868,22 @@ unsigned long nr_active(void)
 
 #ifdef CONFIG_SMP
 
+/*
+ * Is this task likely cache-hot:
+ */
+static inline int
+task_hot(struct task_struct *p, unsigned long long now, struct sched_domain *sd)
+{
+       return (long long)(now - p->last_ran) < (long long)sd->cache_hot_time;
+}
+
 /*
  * double_rq_lock - safely lock two runqueues
  *
  * Note this does not disable interrupts like task_rq_lock,
  * you need to do so manually before calling.
  */
-static void double_rq_lock(runqueue_t *rq1, runqueue_t *rq2)
+static void double_rq_lock(struct rq *rq1, struct rq *rq2)
        __acquires(rq1->lock)
        __acquires(rq2->lock)
 {
@@ -1886,7 +1907,7 @@ static void double_rq_lock(runqueue_t *rq1, runqueue_t *rq2)
  * Note this does not restore interrupts like task_rq_unlock,
  * you need to do so manually after calling.
  */
-static void double_rq_unlock(runqueue_t *rq1, runqueue_t *rq2)
+static void double_rq_unlock(struct rq *rq1, struct rq *rq2)
        __releases(rq1->lock)
        __releases(rq2->lock)
 {
@@ -1900,7 +1921,7 @@ static void double_rq_unlock(runqueue_t *rq1, runqueue_t *rq2)
 /*
  * double_lock_balance - lock the busiest runqueue, this_rq is locked already.
  */
-static void double_lock_balance(runqueue_t *this_rq, runqueue_t *busiest)
+static void double_lock_balance(struct rq *this_rq, struct rq *busiest)
        __releases(this_rq->lock)
        __acquires(busiest->lock)
        __acquires(this_rq->lock)
@@ -1921,11 +1942,11 @@ static void double_lock_balance(runqueue_t *this_rq, runqueue_t *busiest)
  * allow dest_cpu, which will force the cpu onto dest_cpu.  Then
  * the cpu_allowed mask is restored.
  */
-static void sched_migrate_task(task_t *p, int dest_cpu)
+static void sched_migrate_task(struct task_struct *p, int dest_cpu)
 {
-       migration_req_t req;
-       runqueue_t *rq;
+       struct migration_req req;
        unsigned long flags;
+       struct rq *rq;
 
        rq = task_rq_lock(p, &flags);
        if (!cpu_isset(dest_cpu, p->cpus_allowed)
@@ -1936,11 +1957,13 @@ static void sched_migrate_task(task_t *p, int dest_cpu)
        if (migrate_task(p, dest_cpu, &req)) {
                /* Need to wait for migration thread (might exit: take ref). */
                struct task_struct *mt = rq->migration_thread;
+
                get_task_struct(mt);
                task_rq_unlock(rq, &flags);
                wake_up_process(mt);
                put_task_struct(mt);
                wait_for_completion(&req.done);
+
                return;
        }
 out:
@@ -1964,9 +1987,9 @@ void sched_exec(void)
  * pull_task - move a task from a remote runqueue to the local runqueue.
  * Both runqueues must be locked.
  */
-static
-void pull_task(runqueue_t *src_rq, prio_array_t *src_array, task_t *p,
-              runqueue_t *this_rq, prio_array_t *this_array, int this_cpu)
+static void pull_task(struct rq *src_rq, struct prio_array *src_array,
+                     struct task_struct *p, struct rq *this_rq,
+                     struct prio_array *this_array, int this_cpu)
 {
        dequeue_task(p, src_array);
        dec_nr_running(p, src_rq);
@@ -1987,7 +2010,7 @@ void pull_task(runqueue_t *src_rq, prio_array_t *src_array, task_t *p,
  * can_migrate_task - may task p from runqueue rq be migrated to this_cpu?
  */
 static
-int can_migrate_task(task_t *p, runqueue_t *rq, int this_cpu,
+int can_migrate_task(struct task_struct *p, struct rq *rq, int this_cpu,
                     struct sched_domain *sd, enum idle_type idle,
                     int *all_pinned)
 {
@@ -2019,6 +2042,7 @@ int can_migrate_task(task_t *p, runqueue_t *rq, int this_cpu,
 }
 
 #define rq_best_prio(rq) min((rq)->curr->prio, (rq)->best_expired_prio)
+
 /*
  * move_tasks tries to move up to max_nr_move tasks and max_load_move weighted
  * load from busiest to this_rq, as part of a balancing operation within
@@ -2026,18 +2050,17 @@ int can_migrate_task(task_t *p, runqueue_t *rq, int this_cpu,
  *
  * Called with both runqueues locked.
  */
-static int move_tasks(runqueue_t *this_rq, int this_cpu, runqueue_t *busiest,
+static int move_tasks(struct rq *this_rq, int this_cpu, struct rq *busiest,
                      unsigned long max_nr_move, unsigned long max_load_move,
                      struct sched_domain *sd, enum idle_type idle,
                      int *all_pinned)
 {
-       prio_array_t *array, *dst_array;
+       int idx, pulled = 0, pinned = 0, this_best_prio, best_prio,
+           best_prio_seen, skip_for_load;
+       struct prio_array *array, *dst_array;
        struct list_head *head, *curr;
-       int idx, pulled = 0, pinned = 0, this_best_prio, busiest_best_prio;
-       int busiest_best_prio_seen;
-       int skip_for_load; /* skip the task based on weighted load issues */
+       struct task_struct *tmp;
        long rem_load_move;
-       task_t *tmp;
 
        if (max_nr_move == 0 || max_load_move == 0)
                goto out;
@@ -2045,15 +2068,15 @@ static int move_tasks(runqueue_t *this_rq, int this_cpu, runqueue_t *busiest,
        rem_load_move = max_load_move;
        pinned = 1;
        this_best_prio = rq_best_prio(this_rq);
-       busiest_best_prio = rq_best_prio(busiest);
+       best_prio = rq_best_prio(busiest);
        /*
         * Enable handling of the case where there is more than one task
         * with the best priority.   If the current running task is one
-        * of those with prio==busiest_best_prio we know it won't be moved
+        * of those with prio==best_prio we know it won't be moved
         * and therefore it's safe to override the skip (based on load) of
         * any task we find with that prio.
         */
-       busiest_best_prio_seen = busiest_best_prio == busiest->curr->prio;
+       best_prio_seen = best_prio == busiest->curr->prio;
 
        /*
         * We first consider expired tasks. Those will likely not be
@@ -2089,7 +2112,7 @@ skip_bitmap:
        head = array->queue + idx;
        curr = head->prev;
 skip_queue:
-       tmp = list_entry(curr, task_t, run_list);
+       tmp = list_entry(curr, struct task_struct, run_list);
 
        curr = curr->prev;
 
@@ -2100,10 +2123,11 @@ skip_queue:
         */
        skip_for_load = tmp->load_weight > rem_load_move;
        if (skip_for_load && idx < this_best_prio)
-               skip_for_load = !busiest_best_prio_seen && idx == busiest_best_prio;
+               skip_for_load = !best_prio_seen && idx == best_prio;
        if (skip_for_load ||
            !can_migrate_task(tmp, busiest, this_cpu, sd, idle, &pinned)) {
-               busiest_best_prio_seen |= idx == busiest_best_prio;
+
+               best_prio_seen |= idx == best_prio;
                if (curr != head)
                        goto skip_queue;
                idx++;
@@ -2146,8 +2170,8 @@ out:
 
 /*
  * find_busiest_group finds and returns the busiest CPU group within the
- * domain. It calculates and returns the amount of weighted load which should be
- * moved to restore balance via the imbalance parameter.
+ * domain. It calculates and returns the amount of weighted load which
+ * should be moved to restore balance via the imbalance parameter.
  */
 static struct sched_group *
 find_busiest_group(struct sched_domain *sd, int this_cpu,
@@ -2188,7 +2212,7 @@ find_busiest_group(struct sched_domain *sd, int this_cpu,
                sum_weighted_load = sum_nr_running = avg_load = 0;
 
                for_each_cpu_mask(i, group->cpumask) {
-                       runqueue_t *rq = cpu_rq(i);
+                       struct rq *rq = cpu_rq(i);
 
                        if (*sd_idle && !idle_cpu(i))
                                *sd_idle = 0;
@@ -2269,7 +2293,7 @@ find_busiest_group(struct sched_domain *sd, int this_cpu,
                 * capacity but still has some space to pick up some load
                 * from other group and save more power
                 */
-               if (sum_nr_running <= group_capacity - 1)
+               if (sum_nr_running <= group_capacity - 1) {
                        if (sum_nr_running > leader_nr_running ||
                            (sum_nr_running == leader_nr_running &&
                             first_cpu(group->cpumask) >
@@ -2277,7 +2301,7 @@ find_busiest_group(struct sched_domain *sd, int this_cpu,
                                group_leader = group;
                                leader_nr_running = sum_nr_running;
                        }
-
+               }
 group_next:
 #endif
                group = group->next;
@@ -2332,8 +2356,7 @@ group_next:
         * moved
         */
        if (*imbalance < busiest_load_per_task) {
-               unsigned long pwr_now, pwr_move;
-               unsigned long tmp;
+               unsigned long tmp, pwr_now, pwr_move;
                unsigned int imbn;
 
 small_imbalance:
@@ -2405,22 +2428,23 @@ ret:
 /*
  * find_busiest_queue - find the busiest runqueue among the cpus in group.
  */
-static runqueue_t *find_busiest_queue(struct sched_group *group,
-       enum idle_type idle, unsigned long imbalance)
+static struct rq *
+find_busiest_queue(struct sched_group *group, enum idle_type idle,
+                  unsigned long imbalance)
 {
+       struct rq *busiest = NULL, *rq;
        unsigned long max_load = 0;
-       runqueue_t *busiest = NULL, *rqi;
        int i;
 
        for_each_cpu_mask(i, group->cpumask) {
-               rqi = cpu_rq(i);
+               rq = cpu_rq(i);
 
-               if (rqi->nr_running == 1 && rqi->raw_weighted_load > imbalance)
+               if (rq->nr_running == 1 && rq->raw_weighted_load > imbalance)
                        continue;
 
-               if (rqi->raw_weighted_load > max_load) {
-                       max_load = rqi->raw_weighted_load;
-                       busiest = rqi;
+               if (rq->raw_weighted_load > max_load) {
+                       max_load = rq->raw_weighted_load;
+                       busiest = rq;
                }
        }
 
@@ -2433,22 +2457,24 @@ static runqueue_t *find_busiest_queue(struct sched_group *group,
  */
 #define MAX_PINNED_INTERVAL    512
 
-#define minus_1_or_zero(n) ((n) > 0 ? (n) - 1 : 0)
+static inline unsigned long minus_1_or_zero(unsigned long n)
+{
+       return n > 0 ? n - 1 : 0;
+}
+
 /*
  * Check this_cpu to ensure it is balanced within domain. Attempt to move
  * tasks if there is an imbalance.
  *
  * Called with this_rq unlocked.
  */
-static int load_balance(int this_cpu, runqueue_t *this_rq,
+static int load_balance(int this_cpu, struct rq *this_rq,
                        struct sched_domain *sd, enum idle_type idle)
 {
+       int nr_moved, all_pinned = 0, active_balance = 0, sd_idle = 0;
        struct sched_group *group;
-       runqueue_t *busiest;
        unsigned long imbalance;
-       int nr_moved, all_pinned = 0;
-       int active_balance = 0;
-       int sd_idle = 0;
+       struct rq *busiest;
 
        if (idle != NOT_IDLE && sd->flags & SD_SHARE_CPUPOWER &&
            !sched_smt_power_savings)
@@ -2482,8 +2508,8 @@ static int load_balance(int this_cpu, runqueue_t *this_rq,
                 */
                double_rq_lock(this_rq, busiest);
                nr_moved = move_tasks(this_rq, this_cpu, busiest,
-                                       minus_1_or_zero(busiest->nr_running),
-                                       imbalance, sd, idle, &all_pinned);
+                                     minus_1_or_zero(busiest->nr_running),
+                                     imbalance, sd, idle, &all_pinned);
                double_rq_unlock(this_rq, busiest);
 
                /* All tasks on this runqueue were pinned by CPU affinity */
@@ -2556,7 +2582,8 @@ out_one_pinned:
                        (sd->balance_interval < sd->max_interval))
                sd->balance_interval *= 2;
 
-       if (!sd_idle && sd->flags & SD_SHARE_CPUPOWER && !sched_smt_power_savings)
+       if (!sd_idle && sd->flags & SD_SHARE_CPUPOWER &&
+                       !sched_smt_power_savings)
                return -1;
        return 0;
 }
@@ -2568,11 +2595,11 @@ out_one_pinned:
  * Called from schedule when this_rq is about to become idle (NEWLY_IDLE).
  * this_rq is locked.
  */
-static int load_balance_newidle(int this_cpu, runqueue_t *this_rq,
-                               struct sched_domain *sd)
+static int
+load_balance_newidle(int this_cpu, struct rq *this_rq, struct sched_domain *sd)
 {
        struct sched_group *group;
-       runqueue_t *busiest = NULL;
+       struct rq *busiest = NULL;
        unsigned long imbalance;
        int nr_moved = 0;
        int sd_idle = 0;
@@ -2618,9 +2645,11 @@ static int load_balance_newidle(int this_cpu, runqueue_t *this_rq,
 
 out_balanced:
        schedstat_inc(sd, lb_balanced[NEWLY_IDLE]);
-       if (!sd_idle && sd->flags & SD_SHARE_CPUPOWER && !sched_smt_power_savings)
+       if (!sd_idle && sd->flags & SD_SHARE_CPUPOWER &&
+                                       !sched_smt_power_savings)
                return -1;
        sd->nr_balance_failed = 0;
+
        return 0;
 }
 
@@ -2628,16 +2657,15 @@ out_balanced:
  * idle_balance is called by schedule() if this_cpu is about to become
  * idle. Attempts to pull tasks from other CPUs.
  */
-static void idle_balance(int this_cpu, runqueue_t *this_rq)
+static void idle_balance(int this_cpu, struct rq *this_rq)
 {
        struct sched_domain *sd;
 
        for_each_domain(this_cpu, sd) {
                if (sd->flags & SD_BALANCE_NEWIDLE) {
-                       if (load_balance_newidle(this_cpu, this_rq, sd)) {
-                               /* We've pulled tasks over so stop searching */
+                       /* If we've pulled tasks over stop searching: */
+                       if (load_balance_newidle(this_cpu, this_rq, sd))
                                break;
-                       }
                }
        }
 }
@@ -2650,14 +2678,14 @@ static void idle_balance(int this_cpu, runqueue_t *this_rq)
  *
  * Called with busiest_rq locked.
  */
-static void active_load_balance(runqueue_t *busiest_rq, int busiest_cpu)
+static void active_load_balance(struct rq *busiest_rq, int busiest_cpu)
 {
-       struct sched_domain *sd;
-       runqueue_t *target_rq;
        int target_cpu = busiest_rq->push_cpu;
+       struct sched_domain *sd;
+       struct rq *target_rq;
 
+       /* Is there any task to move? */
        if (busiest_rq->nr_running <= 1)
-               /* no task to move */
                return;
 
        target_rq = cpu_rq(target_cpu);
@@ -2675,21 +2703,20 @@ static void active_load_balance(runqueue_t *busiest_rq, int busiest_cpu)
        /* Search for an sd spanning us and the target CPU. */
        for_each_domain(target_cpu, sd) {
                if ((sd->flags & SD_LOAD_BALANCE) &&
-                       cpu_isset(busiest_cpu, sd->span))
+                   cpu_isset(busiest_cpu, sd->span))
                                break;
        }
 
-       if (unlikely(sd == NULL))
-               goto out;
-
-       schedstat_inc(sd, alb_cnt);
+       if (likely(sd)) {
+               schedstat_inc(sd, alb_cnt);
 
-       if (move_tasks(target_rq, target_cpu, busiest_rq, 1,
-                       RTPRIO_TO_LOAD_WEIGHT(100), sd, SCHED_IDLE, NULL))
-               schedstat_inc(sd, alb_pushed);
-       else
-               schedstat_inc(sd, alb_failed);
-out:
+               if (move_tasks(target_rq, target_cpu, busiest_rq, 1,
+                              RTPRIO_TO_LOAD_WEIGHT(100), sd, SCHED_IDLE,
+                              NULL))
+                       schedstat_inc(sd, alb_pushed);
+               else
+                       schedstat_inc(sd, alb_failed);
+       }
        spin_unlock(&target_rq->lock);
 }
 
@@ -2702,23 +2729,27 @@ out:
  * Balancing parameters are set up in arch_init_sched_domains.
  */
 
-/* Don't have all balancing operations going off at once */
-#define CPU_OFFSET(cpu) (HZ * cpu / NR_CPUS)
+/* Don't have all balancing operations going off at once: */
+static inline unsigned long cpu_offset(int cpu)
+{
+       return jiffies + cpu * HZ / NR_CPUS;
+}
 
-static void rebalance_tick(int this_cpu, runqueue_t *this_rq,
-                          enum idle_type idle)
+static void
+rebalance_tick(int this_cpu, struct rq *this_rq, enum idle_type idle)
 {
-       unsigned long old_load, this_load;
-       unsigned long j = jiffies + CPU_OFFSET(this_cpu);
+       unsigned long this_load, interval, j = cpu_offset(this_cpu);
        struct sched_domain *sd;
-       int i;
+       int i, scale;
 
        this_load = this_rq->raw_weighted_load;
-       /* Update our load */
-       for (i = 0; i < 3; i++) {
-               unsigned long new_load = this_load;
-               int scale = 1 << i;
+
+       /* Update our load: */
+       for (i = 0, scale = 1; i < 3; i++, scale <<= 1) {
+               unsigned long old_load, new_load;
+
                old_load = this_rq->cpu_load[i];
+               new_load = this_load;
                /*
                 * Round up the averaging division if load is increasing. This
                 * prevents us from getting stuck on 9 if the load is 10, for
@@ -2730,8 +2761,6 @@ static void rebalance_tick(int this_cpu, runqueue_t *this_rq,
        }
 
        for_each_domain(this_cpu, sd) {
-               unsigned long interval;
-
                if (!(sd->flags & SD_LOAD_BALANCE))
                        continue;
 
@@ -2761,17 +2790,18 @@ static void rebalance_tick(int this_cpu, runqueue_t *this_rq,
 /*
  * on UP we do not need to balance between CPUs:
  */
-static inline void rebalance_tick(int cpu, runqueue_t *rq, enum idle_type idle)
+static inline void rebalance_tick(int cpu, struct rq *rq, enum idle_type idle)
 {
 }
-static inline void idle_balance(int cpu, runqueue_t *rq)
+static inline void idle_balance(int cpu, struct rq *rq)
 {
 }
 #endif
 
-static inline int wake_priority_sleeper(runqueue_t *rq)
+static inline int wake_priority_sleeper(struct rq *rq)
 {
        int ret = 0;
+
 #ifdef CONFIG_SCHED_SMT
        spin_lock(&rq->lock);
        /*
@@ -2795,25 +2825,26 @@ EXPORT_PER_CPU_SYMBOL(kstat);
  * This is called on clock ticks and on context switches.
  * Bank in p->sched_time the ns elapsed since the last tick or switch.
  */
-static inline void update_cpu_clock(task_t *p, runqueue_t *rq,
-                                   unsigned long long now)
+static inline void
+update_cpu_clock(struct task_struct *p, struct rq *rq, unsigned long long now)
 {
-       unsigned long long last = max(p->timestamp, rq->timestamp_last_tick);
-       p->sched_time += now - last;
+       p->sched_time += now - max(p->timestamp, rq->timestamp_last_tick);
 }
 
 /*
  * Return current->sched_time plus any more ns on the sched_clock
  * that have not yet been banked.
  */
-unsigned long long current_sched_time(const task_t *tsk)
+unsigned long long current_sched_time(const struct task_struct *p)
 {
        unsigned long long ns;
        unsigned long flags;
+
        local_irq_save(flags);
-       ns = max(tsk->timestamp, task_rq(tsk)->timestamp_last_tick);
-       ns = tsk->sched_time + (sched_clock() - ns);
+       ns = max(p->timestamp, task_rq(p)->timestamp_last_tick);
+       ns = p->sched_time + sched_clock() - ns;
        local_irq_restore(flags);
+
        return ns;
 }
 
@@ -2827,11 +2858,16 @@ unsigned long long current_sched_time(const task_t *tsk)
  * increasing number of running tasks. We also ignore the interactivity
  * if a better static_prio task has expired:
  */
-#define EXPIRED_STARVING(rq) \
-       ((STARVATION_LIMIT && ((rq)->expired_timestamp && \
-               (jiffies - (rq)->expired_timestamp >= \
-                       STARVATION_LIMIT * ((rq)->nr_running) + 1))) || \
-                       ((rq)->curr->static_prio > (rq)->best_expired_prio))
+static inline int expired_starving(struct rq *rq)
+{
+       if (rq->curr->static_prio > rq->best_expired_prio)
+               return 1;
+       if (!STARVATION_LIMIT || !rq->expired_timestamp)
+               return 0;
+       if (jiffies - rq->expired_timestamp > STARVATION_LIMIT * rq->nr_running)
+               return 1;
+       return 0;
+}
 
 /*
  * Account user cpu time to a process.
@@ -2864,7 +2900,7 @@ void account_system_time(struct task_struct *p, int hardirq_offset,
                         cputime_t cputime)
 {
        struct cpu_usage_stat *cpustat = &kstat_this_cpu.cpustat;
-       runqueue_t *rq = this_rq();
+       struct rq *rq = this_rq();
        cputime64_t tmp;
 
        p->stime = cputime_add(p->stime, cputime);
@@ -2894,7 +2930,7 @@ void account_steal_time(struct task_struct *p, cputime_t steal)
 {
        struct cpu_usage_stat *cpustat = &kstat_this_cpu.cpustat;
        cputime64_t tmp = cputime_to_cputime64(steal);
-       runqueue_t *rq = this_rq();
+       struct rq *rq = this_rq();
 
        if (p == rq->idle) {
                p->stime = cputime_add(p->stime, steal);
@@ -2915,10 +2951,10 @@ void account_steal_time(struct task_struct *p, cputime_t steal)
  */
 void scheduler_tick(void)
 {
-       int cpu = smp_processor_id();
-       runqueue_t *rq = this_rq();
-       task_t *p = current;
        unsigned long long now = sched_clock();
+       struct task_struct *p = current;
+       int cpu = smp_processor_id();
+       struct rq *rq = cpu_rq(cpu);
 
        update_cpu_clock(p, rq, now);
 
@@ -2968,7 +3004,7 @@ void scheduler_tick(void)
 
                if (!rq->expired_timestamp)
                        rq->expired_timestamp = jiffies;
-               if (!TASK_INTERACTIVE(p) || EXPIRED_STARVING(rq)) {
+               if (!TASK_INTERACTIVE(p) || expired_starving(rq)) {
                        enqueue_task(p, rq->expired);
                        if (p->static_prio < rq->best_expired_prio)
                                rq->best_expired_prio = p->static_prio;
@@ -3007,7 +3043,7 @@ out:
 }
 
 #ifdef CONFIG_SCHED_SMT
-static inline void wakeup_busy_runqueue(runqueue_t *rq)
+static inline void wakeup_busy_runqueue(struct rq *rq)
 {
        /* If an SMT runqueue is sleeping due to priority reasons wake it up */
        if (rq->curr == rq->idle && rq->nr_running)
@@ -3033,7 +3069,7 @@ static void wake_sleeping_dependent(int this_cpu)
                return;
 
        for_each_cpu_mask(i, sd->span) {
-               runqueue_t *smt_rq = cpu_rq(i);
+               struct rq *smt_rq = cpu_rq(i);
 
                if (i == this_cpu)
                        continue;
@@ -3050,7 +3086,8 @@ static void wake_sleeping_dependent(int this_cpu)
  * utilize, if another task runs on a sibling. This models the
  * slowdown effect of other tasks running on siblings:
  */
-static inline unsigned long smt_slice(task_t *p, struct sched_domain *sd)
+static inline unsigned long
+smt_slice(struct task_struct *p, struct sched_domain *sd)
 {
        return p->time_slice * (100 - sd->per_cpu_gain) / 100;
 }
@@ -3061,7 +3098,8 @@ static inline unsigned long smt_slice(task_t *p, struct sched_domain *sd)
  * acquire their lock. As we only trylock the normal locking order does not
  * need to be obeyed.
  */
-static int dependent_sleeper(int this_cpu, runqueue_t *this_rq, task_t *p)
+static int
+dependent_sleeper(int this_cpu, struct rq *this_rq, struct task_struct *p)
 {
        struct sched_domain *tmp, *sd = NULL;
        int ret = 0, i;
@@ -3081,8 +3119,8 @@ static int dependent_sleeper(int this_cpu, runqueue_t *this_rq, task_t *p)
                return 0;
 
        for_each_cpu_mask(i, sd->span) {
-               runqueue_t *smt_rq;
-               task_t *smt_curr;
+               struct task_struct *smt_curr;
+               struct rq *smt_rq;
 
                if (i == this_cpu)
                        continue;
@@ -3127,9 +3165,8 @@ unlock:
 static inline void wake_sleeping_dependent(int this_cpu)
 {
 }
-
-static inline int dependent_sleeper(int this_cpu, runqueue_t *this_rq,
-                                       task_t *p)
+static inline int
+dependent_sleeper(int this_cpu, struct rq *this_rq, struct task_struct *p)
 {
        return 0;
 }
@@ -3142,12 +3179,13 @@ void fastcall add_preempt_count(int val)
        /*
         * Underflow?
         */
-       BUG_ON((preempt_count() < 0));
+       if (DEBUG_LOCKS_WARN_ON((preempt_count() < 0)))
+               return;
        preempt_count() += val;
        /*
         * Spinlock count overflowing soon?
         */
-       BUG_ON((preempt_count() & PREEMPT_MASK) >= PREEMPT_MASK-10);
+       DEBUG_LOCKS_WARN_ON((preempt_count() & PREEMPT_MASK) >= PREEMPT_MASK-10);
 }
 EXPORT_SYMBOL(add_preempt_count);
 
@@ -3156,11 +3194,15 @@ void fastcall sub_preempt_count(int val)
        /*
         * Underflow?
         */
-       BUG_ON(val > preempt_count());
+       if (DEBUG_LOCKS_WARN_ON(val > preempt_count()))
+               return;
        /*
         * Is the spinlock portion underflowing?
         */
-       BUG_ON((val < PREEMPT_MASK) && !(preempt_count() & PREEMPT_MASK));
+       if (DEBUG_LOCKS_WARN_ON((val < PREEMPT_MASK) &&
+                       !(preempt_count() & PREEMPT_MASK)))
+               return;
+
        preempt_count() -= val;
 }
 EXPORT_SYMBOL(sub_preempt_count);
@@ -3178,14 +3220,14 @@ static inline int interactive_sleep(enum sleep_type sleep_type)
  */
 asmlinkage void __sched schedule(void)
 {
-       long *switch_count;
-       task_t *prev, *next;
-       runqueue_t *rq;
-       prio_array_t *array;
+       struct task_struct *prev, *next;
+       struct prio_array *array;
        struct list_head *queue;
        unsigned long long now;
        unsigned long run_time;
        int cpu, idx, new_prio;
+       long *switch_count;
+       struct rq *rq;
 
        /*
         * Test if we are atomic.  Since do_exit() needs to call into
@@ -3275,7 +3317,7 @@ need_resched_nonpreemptible:
 
        idx = sched_find_first_bit(array->bitmap);
        queue = array->queue + idx;
-       next = list_entry(queue->next, task_t, run_list);
+       next = list_entry(queue->next, struct task_struct, run_list);
 
        if (!rt_task(next) && interactive_sleep(next->sleep_type)) {
                unsigned long long delta = now - next->timestamp;
@@ -3338,7 +3380,6 @@ switch_tasks:
        if (unlikely(test_thread_flag(TIF_NEED_RESCHED)))
                goto need_resched;
 }
-
 EXPORT_SYMBOL(schedule);
 
 #ifdef CONFIG_PREEMPT
@@ -3383,7 +3424,6 @@ need_resched:
        if (unlikely(test_thread_flag(TIF_NEED_RESCHED)))
                goto need_resched;
 }
-
 EXPORT_SYMBOL(preempt_schedule);
 
 /*
@@ -3432,10 +3472,8 @@ need_resched:
 int default_wake_function(wait_queue_t *curr, unsigned mode, int sync,
                          void *key)
 {
-       task_t *p = curr->private;
-       return try_to_wake_up(p, mode, sync);
+       return try_to_wake_up(curr->private, mode, sync);
 }
-
 EXPORT_SYMBOL(default_wake_function);
 
 /*
@@ -3453,13 +3491,11 @@ static void __wake_up_common(wait_queue_head_t *q, unsigned int mode,
        struct list_head *tmp, *next;
 
        list_for_each_safe(tmp, next, &q->task_list) {
-               wait_queue_t *curr;
-               unsigned flags;
-               curr = list_entry(tmp, wait_queue_t, task_list);
-               flags = curr->flags;
+               wait_queue_t *curr = list_entry(tmp, wait_queue_t, task_list);
+               unsigned flags = curr->flags;
+
                if (curr->func(curr, mode, sync, key) &&
-                   (flags & WQ_FLAG_EXCLUSIVE) &&
-                   !--nr_exclusive)
+                               (flags & WQ_FLAG_EXCLUSIVE) && !--nr_exclusive)
                        break;
        }
 }
@@ -3480,7 +3516,6 @@ void fastcall __wake_up(wait_queue_head_t *q, unsigned int mode,
        __wake_up_common(q, mode, nr_exclusive, 0, key);
        spin_unlock_irqrestore(&q->lock, flags);
 }
-
 EXPORT_SYMBOL(__wake_up);
 
 /*
@@ -3549,6 +3584,7 @@ EXPORT_SYMBOL(complete_all);
 void fastcall __sched wait_for_completion(struct completion *x)
 {
        might_sleep();
+
        spin_lock_irq(&x->wait.lock);
        if (!x->done) {
                DECLARE_WAITQUEUE(wait, current);
@@ -3693,7 +3729,6 @@ void fastcall __sched interruptible_sleep_on(wait_queue_head_t *q)
        schedule();
        SLEEP_ON_TAIL
 }
-
 EXPORT_SYMBOL(interruptible_sleep_on);
 
 long fastcall __sched
@@ -3709,7 +3744,6 @@ interruptible_sleep_on_timeout(wait_queue_head_t *q, long timeout)
 
        return timeout;
 }
-
 EXPORT_SYMBOL(interruptible_sleep_on_timeout);
 
 void fastcall __sched sleep_on(wait_queue_head_t *q)
@@ -3722,7 +3756,6 @@ void fastcall __sched sleep_on(wait_queue_head_t *q)
        schedule();
        SLEEP_ON_TAIL
 }
-
 EXPORT_SYMBOL(sleep_on);
 
 long fastcall __sched sleep_on_timeout(wait_queue_head_t *q, long timeout)
@@ -3752,11 +3785,11 @@ EXPORT_SYMBOL(sleep_on_timeout);
  *
  * Used by the rt_mutex code to implement priority inheritance logic.
  */
-void rt_mutex_setprio(task_t *p, int prio)
+void rt_mutex_setprio(struct task_struct *p, int prio)
 {
+       struct prio_array *array;
        unsigned long flags;
-       prio_array_t *array;
-       runqueue_t *rq;
+       struct rq *rq;
        int oldprio;
 
        BUG_ON(prio < 0 || prio > MAX_PRIO);
@@ -3793,12 +3826,12 @@ void rt_mutex_setprio(task_t *p, int prio)
 
 #endif
 
-void set_user_nice(task_t *p, long nice)
+void set_user_nice(struct task_struct *p, long nice)
 {
-       unsigned long flags;
-       prio_array_t *array;
-       runqueue_t *rq;
+       struct prio_array *array;
        int old_prio, delta;
+       unsigned long flags;
+       struct rq *rq;
 
        if (TASK_NICE(p) == nice || nice < -20 || nice > 19)
                return;
@@ -3849,10 +3882,11 @@ EXPORT_SYMBOL(set_user_nice);
  * @p: task
  * @nice: nice value
  */
-int can_nice(const task_t *p, const int nice)
+int can_nice(const struct task_struct *p, const int nice)
 {
        /* convert nice value [19,-20] to rlimit style value [1,40] */
        int nice_rlim = 20 - nice;
+
        return (nice_rlim <= p->signal->rlim[RLIMIT_NICE].rlim_cur ||
                capable(CAP_SYS_NICE));
 }
@@ -3868,8 +3902,7 @@ int can_nice(const task_t *p, const int nice)
  */
 asmlinkage long sys_nice(int increment)
 {
-       int retval;
-       long nice;
+       long nice, retval;
 
        /*
         * Setpriority might change our priority at the same moment.
@@ -3908,7 +3941,7 @@ asmlinkage long sys_nice(int increment)
  * RT tasks are offset by -200. Normal tasks are centered
  * around 0, value goes from -16 to +15.
  */
-int task_prio(const task_t *p)
+int task_prio(const struct task_struct *p)
 {
        return p->prio - MAX_RT_PRIO;
 }
@@ -3917,7 +3950,7 @@ int task_prio(const task_t *p)
  * task_nice - return the nice value of a given task.
  * @p: the task in question.
  */
-int task_nice(const task_t *p)
+int task_nice(const struct task_struct *p)
 {
        return TASK_NICE(p);
 }
@@ -3936,7 +3969,7 @@ int idle_cpu(int cpu)
  * idle_task - return the idle task for a given cpu.
  * @cpu: the processor in question.
  */
-task_t *idle_task(int cpu)
+struct task_struct *idle_task(int cpu)
 {
        return cpu_rq(cpu)->idle;
 }
@@ -3945,7 +3978,7 @@ task_t *idle_task(int cpu)
  * find_process_by_pid - find a process with a matching PID value.
  * @pid: the pid in question.
  */
-static inline task_t *find_process_by_pid(pid_t pid)
+static inline struct task_struct *find_process_by_pid(pid_t pid)
 {
        return pid ? find_task_by_pid(pid) : current;
 }
@@ -3954,6 +3987,7 @@ static inline task_t *find_process_by_pid(pid_t pid)
 static void __setscheduler(struct task_struct *p, int policy, int prio)
 {
        BUG_ON(p->array);
+
        p->policy = policy;
        p->rt_priority = prio;
        p->normal_prio = normal_prio(p);
@@ -3977,11 +4011,10 @@ static void __setscheduler(struct task_struct *p, int policy, int prio)
 int sched_setscheduler(struct task_struct *p, int policy,
                       struct sched_param *param)
 {
-       int retval;
-       int oldprio, oldpolicy = -1;
-       prio_array_t *array;
+       int retval, oldprio, oldpolicy = -1;
+       struct prio_array *array;
        unsigned long flags;
-       runqueue_t *rq;
+       struct rq *rq;
 
        /* may grab non-irq protected spin_locks */
        BUG_ON(in_interrupt());
@@ -4079,9 +4112,9 @@ EXPORT_SYMBOL_GPL(sched_setscheduler);
 static int
 do_sched_setscheduler(pid_t pid, int policy, struct sched_param __user *param)
 {
-       int retval;
        struct sched_param lparam;
        struct task_struct *p;
+       int retval;
 
        if (!param || pid < 0)
                return -EINVAL;
@@ -4097,6 +4130,7 @@ do_sched_setscheduler(pid_t pid, int policy, struct sched_param __user *param)
        read_unlock_irq(&tasklist_lock);
        retval = sched_setscheduler(p, policy, &lparam);
        put_task_struct(p);
+
        return retval;
 }
 
@@ -4132,8 +4166,8 @@ asmlinkage long sys_sched_setparam(pid_t pid, struct sched_param __user *param)
  */
 asmlinkage long sys_sched_getscheduler(pid_t pid)
 {
+       struct task_struct *p;
        int retval = -EINVAL;
-       task_t *p;
 
        if (pid < 0)
                goto out_nounlock;
@@ -4160,8 +4194,8 @@ out_nounlock:
 asmlinkage long sys_sched_getparam(pid_t pid, struct sched_param __user *param)
 {
        struct sched_param lp;
+       struct task_struct *p;
        int retval = -EINVAL;
-       task_t *p;
 
        if (!param || pid < 0)
                goto out_nounlock;
@@ -4194,9 +4228,9 @@ out_unlock:
 
 long sched_setaffinity(pid_t pid, cpumask_t new_mask)
 {
-       task_t *p;
-       int retval;
        cpumask_t cpus_allowed;
+       struct task_struct *p;
+       int retval;
 
        lock_cpu_hotplug();
        read_lock(&tasklist_lock);
@@ -4282,8 +4316,8 @@ cpumask_t cpu_possible_map __read_mostly = CPU_MASK_ALL;
 
 long sched_getaffinity(pid_t pid, cpumask_t *mask)
 {
+       struct task_struct *p;
        int retval;
-       task_t *p;
 
        lock_cpu_hotplug();
        read_lock(&tasklist_lock);
@@ -4342,9 +4376,8 @@ asmlinkage long sys_sched_getaffinity(pid_t pid, unsigned int len,
  */
 asmlinkage long sys_sched_yield(void)
 {
-       runqueue_t *rq = this_rq_lock();
-       prio_array_t *array = current->array;
-       prio_array_t *target = rq->expired;
+       struct rq *rq = this_rq_lock();
+       struct prio_array *array = current->array, *target = rq->expired;
 
        schedstat_inc(rq, yld_cnt);
        /*
@@ -4378,6 +4411,7 @@ asmlinkage long sys_sched_yield(void)
         * no need to preempt or enable interrupts:
         */
        __release(rq->lock);
+       spin_release(&rq->lock.dep_map, 1, _THIS_IP_);
        _raw_spin_unlock(&rq->lock);
        preempt_enable_no_resched();
 
@@ -4386,7 +4420,16 @@ asmlinkage long sys_sched_yield(void)
        return 0;
 }
 
-static inline void __cond_resched(void)
+static inline int __resched_legal(void)
+{
+       if (unlikely(preempt_count()))
+               return 0;
+       if (unlikely(system_state != SYSTEM_RUNNING))
+               return 0;
+       return 1;
+}
+
+static void __cond_resched(void)
 {
 #ifdef CONFIG_DEBUG_SPINLOCK_SLEEP
        __might_sleep(__FILE__, __LINE__);
@@ -4396,10 +4439,6 @@ static inline void __cond_resched(void)
         * PREEMPT_ACTIVE, which could trigger a second
         * cond_resched() call.
         */
-       if (unlikely(preempt_count()))
-               return;
-       if (unlikely(system_state != SYSTEM_RUNNING))
-               return;
        do {
                add_preempt_count(PREEMPT_ACTIVE);
                schedule();
@@ -4409,13 +4448,12 @@ static inline void __cond_resched(void)
 
 int __sched cond_resched(void)
 {
-       if (need_resched()) {
+       if (need_resched() && __resched_legal()) {
                __cond_resched();
                return 1;
        }
        return 0;
 }
-
 EXPORT_SYMBOL(cond_resched);
 
 /*
@@ -4436,7 +4474,8 @@ int cond_resched_lock(spinlock_t *lock)
                ret = 1;
                spin_lock(lock);
        }
-       if (need_resched()) {
+       if (need_resched() && __resched_legal()) {
+               spin_release(&lock->dep_map, 1, _THIS_IP_);
                _raw_spin_unlock(lock);
                preempt_enable_no_resched();
                __cond_resched();
@@ -4445,25 +4484,24 @@ int cond_resched_lock(spinlock_t *lock)
        }
        return ret;
 }
-
 EXPORT_SYMBOL(cond_resched_lock);
 
 int __sched cond_resched_softirq(void)
 {
        BUG_ON(!in_softirq());
 
-       if (need_resched()) {
-               __local_bh_enable();
+       if (need_resched() && __resched_legal()) {
+               raw_local_irq_disable();
+               _local_bh_enable();
+               raw_local_irq_enable();
                __cond_resched();
                local_bh_disable();
                return 1;
        }
        return 0;
 }
-
 EXPORT_SYMBOL(cond_resched_softirq);
 
-
 /**
  * yield - yield the current processor to other threads.
  *
@@ -4475,7 +4513,6 @@ void __sched yield(void)
        set_current_state(TASK_RUNNING);
        sys_sched_yield();
 }
-
 EXPORT_SYMBOL(yield);
 
 /*
@@ -4487,18 +4524,17 @@ EXPORT_SYMBOL(yield);
  */
 void __sched io_schedule(void)
 {
-       struct runqueue *rq = &__raw_get_cpu_var(runqueues);
+       struct rq *rq = &__raw_get_cpu_var(runqueues);
 
        atomic_inc(&rq->nr_iowait);
        schedule();
        atomic_dec(&rq->nr_iowait);
 }
-
 EXPORT_SYMBOL(io_schedule);
 
 long __sched io_schedule_timeout(long timeout)
 {
-       struct runqueue *rq = &__raw_get_cpu_var(runqueues);
+       struct rq *rq = &__raw_get_cpu_var(runqueues);
        long ret;
 
        atomic_inc(&rq->nr_iowait);
@@ -4565,9 +4601,9 @@ asmlinkage long sys_sched_get_priority_min(int policy)
 asmlinkage
 long sys_sched_rr_get_interval(pid_t pid, struct timespec __user *interval)
 {
+       struct task_struct *p;
        int retval = -EINVAL;
        struct timespec t;
-       task_t *p;
 
        if (pid < 0)
                goto out_nounlock;
@@ -4595,28 +4631,32 @@ out_unlock:
 
 static inline struct task_struct *eldest_child(struct task_struct *p)
 {
-       if (list_empty(&p->children)) return NULL;
+       if (list_empty(&p->children))
+               return NULL;
        return list_entry(p->children.next,struct task_struct,sibling);
 }
 
 static inline struct task_struct *older_sibling(struct task_struct *p)
 {
-       if (p->sibling.prev==&p->parent->children) return NULL;
+       if (p->sibling.prev==&p->parent->children)
+               return NULL;
        return list_entry(p->sibling.prev,struct task_struct,sibling);
 }
 
 static inline struct task_struct *younger_sibling(struct task_struct *p)
 {
-       if (p->sibling.next==&p->parent->children) return NULL;
+       if (p->sibling.next==&p->parent->children)
+               return NULL;
        return list_entry(p->sibling.next,struct task_struct,sibling);
 }
 
-static void show_task(task_t *p)
+static const char *stat_nam[] = { "R", "S", "D", "T", "t", "Z", "X" };
+
+static void show_task(struct task_struct *p)
 {
-       task_t *relative;
-       unsigned state;
+       struct task_struct *relative;
        unsigned long free = 0;
-       static const char *stat_nam[] = { "R", "S", "D", "T", "t", "Z", "X" };
+       unsigned state;
 
        printk("%-13.13s ", p->comm);
        state = p->state ? __ffs(p->state) + 1 : 0;
@@ -4667,7 +4707,7 @@ static void show_task(task_t *p)
 
 void show_state(void)
 {
-       task_t *g, *p;
+       struct task_struct *g, *p;
 
 #if (BITS_PER_LONG == 32)
        printk("\n"
@@ -4689,7 +4729,7 @@ void show_state(void)
        } while_each_thread(g, p);
 
        read_unlock(&tasklist_lock);
-       mutex_debug_show_all_locks();
+       debug_show_all_locks();
 }
 
 /**
@@ -4700,9 +4740,9 @@ void show_state(void)
  * NOTE: this function does not set the idle thread's NEED_RESCHED
  * flag, to make booting more robust.
  */
-void __devinit init_idle(task_t *idle, int cpu)
+void __devinit init_idle(struct task_struct *idle, int cpu)
 {
-       runqueue_t *rq = cpu_rq(cpu);
+       struct rq *rq = cpu_rq(cpu);
        unsigned long flags;
 
        idle->timestamp = sched_clock();
@@ -4741,7 +4781,7 @@ cpumask_t nohz_cpu_mask = CPU_MASK_NONE;
 /*
  * This is how migration works:
  *
- * 1) we queue a migration_req_t structure in the source CPU's
+ * 1) we queue a struct migration_req structure in the source CPU's
  *    runqueue and wake up that CPU's migration thread.
  * 2) we down() the locked semaphore => thread blocks.
  * 3) migration thread wakes up (implicitly it forces the migrated
@@ -4763,12 +4803,12 @@ cpumask_t nohz_cpu_mask = CPU_MASK_NONE;
  * task must not exit() & deallocate itself prematurely.  The
  * call is not atomic; no spinlocks may be held.
  */
-int set_cpus_allowed(task_t *p, cpumask_t new_mask)
+int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
 {
+       struct migration_req req;
        unsigned long flags;
+       struct rq *rq;
        int ret = 0;
-       migration_req_t req;
-       runqueue_t *rq;
 
        rq = task_rq_lock(p, &flags);
        if (!cpus_intersects(new_mask, cpu_online_map)) {
@@ -4791,9 +4831,9 @@ int set_cpus_allowed(task_t *p, cpumask_t new_mask)
        }
 out:
        task_rq_unlock(rq, &flags);
+
        return ret;
 }
-
 EXPORT_SYMBOL_GPL(set_cpus_allowed);
 
 /*
@@ -4809,7 +4849,7 @@ EXPORT_SYMBOL_GPL(set_cpus_allowed);
  */
 static int __migrate_task(struct task_struct *p, int src_cpu, int dest_cpu)
 {
-       runqueue_t *rq_dest, *rq_src;
+       struct rq *rq_dest, *rq_src;
        int ret = 0;
 
        if (unlikely(cpu_is_offline(dest_cpu)))
@@ -4854,16 +4894,16 @@ out:
  */
 static int migration_thread(void *data)
 {
-       runqueue_t *rq;
        int cpu = (long)data;
+       struct rq *rq;
 
        rq = cpu_rq(cpu);
        BUG_ON(rq->migration_thread != current);
 
        set_current_state(TASK_INTERRUPTIBLE);
        while (!kthread_should_stop()) {
+               struct migration_req *req;
                struct list_head *head;
-               migration_req_t *req;
 
                try_to_freeze();
 
@@ -4887,7 +4927,7 @@ static int migration_thread(void *data)
                        set_current_state(TASK_INTERRUPTIBLE);
                        continue;
                }
-               req = list_entry(head->next, migration_req_t, list);
+               req = list_entry(head->next, struct migration_req, list);
                list_del_init(head->next);
 
                spin_unlock(&rq->lock);
@@ -4912,28 +4952,28 @@ wait_to_die:
 
 #ifdef CONFIG_HOTPLUG_CPU
 /* Figure out where task on dead CPU should go, use force if neccessary. */
-static void move_task_off_dead_cpu(int dead_cpu, struct task_struct *tsk)
+static void move_task_off_dead_cpu(int dead_cpu, struct task_struct *p)
 {
-       runqueue_t *rq;
        unsigned long flags;
-       int dest_cpu;
        cpumask_t mask;
+       struct rq *rq;
+       int dest_cpu;
 
 restart:
        /* On same node? */
        mask = node_to_cpumask(cpu_to_node(dead_cpu));
-       cpus_and(mask, mask, tsk->cpus_allowed);
+       cpus_and(mask, mask, p->cpus_allowed);
        dest_cpu = any_online_cpu(mask);
 
        /* On any allowed CPU? */
        if (dest_cpu == NR_CPUS)
-               dest_cpu = any_online_cpu(tsk->cpus_allowed);
+               dest_cpu = any_online_cpu(p->cpus_allowed);
 
        /* No more Mr. Nice Guy. */
        if (dest_cpu == NR_CPUS) {
-               rq = task_rq_lock(tsk, &flags);
-               cpus_setall(tsk->cpus_allowed);
-               dest_cpu = any_online_cpu(tsk->cpus_allowed);
+               rq = task_rq_lock(p, &flags);
+               cpus_setall(p->cpus_allowed);
+               dest_cpu = any_online_cpu(p->cpus_allowed);
                task_rq_unlock(rq, &flags);
 
                /*
@@ -4941,12 +4981,12 @@ restart:
                 * kernel threads (both mm NULL), since they never
                 * leave kernel.
                 */
-               if (tsk->mm && printk_ratelimit())
+               if (p->mm && printk_ratelimit())
                        printk(KERN_INFO "process %d (%s) no "
                               "longer affine to cpu%d\n",
-                              tsk->pid, tsk->comm, dead_cpu);
+                              p->pid, p->comm, dead_cpu);
        }
-       if (!__migrate_task(tsk, dead_cpu, dest_cpu))
+       if (!__migrate_task(p, dead_cpu, dest_cpu))
                goto restart;
 }
 
@@ -4957,9 +4997,9 @@ restart:
  * their home CPUs. So we just add the counter to another CPU's counter,
  * to keep the global sum constant after CPU-down:
  */
-static void migrate_nr_uninterruptible(runqueue_t *rq_src)
+static void migrate_nr_uninterruptible(struct rq *rq_src)
 {
-       runqueue_t *rq_dest = cpu_rq(any_online_cpu(CPU_MASK_ALL));
+       struct rq *rq_dest = cpu_rq(any_online_cpu(CPU_MASK_ALL));
        unsigned long flags;
 
        local_irq_save(flags);
@@ -4973,48 +5013,51 @@ static void migrate_nr_uninterruptible(runqueue_t *rq_src)
 /* Run through task list and migrate tasks from the dead cpu. */
 static void migrate_live_tasks(int src_cpu)
 {
-       struct task_struct *tsk, *t;
+       struct task_struct *p, *t;
 
        write_lock_irq(&tasklist_lock);
 
-       do_each_thread(t, tsk) {
-               if (tsk == current)
+       do_each_thread(t, p) {
+               if (p == current)
                        continue;
 
-               if (task_cpu(tsk) == src_cpu)
-                       move_task_off_dead_cpu(src_cpu, tsk);
-       } while_each_thread(t, tsk);
+               if (task_cpu(p) == src_cpu)
+                       move_task_off_dead_cpu(src_cpu, p);
+       } while_each_thread(t, p);
 
        write_unlock_irq(&tasklist_lock);
 }
 
 /* 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 runqueue. Used by CPU offline code.
+ * the _front_ of the runqueue. Used by CPU offline code.
  */
 void sched_idle_next(void)
 {
-       int cpu = smp_processor_id();
-       runqueue_t *rq = this_rq();
+       int this_cpu = smp_processor_id();
+       struct rq *rq = cpu_rq(this_cpu);
        struct task_struct *p = rq->idle;
        unsigned long flags;
 
        /* cpu has to be offline */
-       BUG_ON(cpu_online(cpu));
+       BUG_ON(cpu_online(this_cpu));
 
-       /* Strictly not necessary since rest of the CPUs are stopped by now
-        * and interrupts disabled on current cpu.
+       /*
+        * Strictly not necessary since rest of the CPUs are stopped by now
+        * and interrupts disabled on the current cpu.
         */
        spin_lock_irqsave(&rq->lock, flags);
 
        __setscheduler(p, SCHED_FIFO, MAX_RT_PRIO-1);
-       /* Add idle task to _front_ of it's priority queue */
+
+       /* Add idle task to the _front_ of its priority queue: */
        __activate_idle_task(p, rq);
 
        spin_unlock_irqrestore(&rq->lock, flags);
 }
 
-/* Ensures that the idle task is using init_mm right before its cpu goes
+/*
+ * Ensures that the idle task is using init_mm right before its cpu goes
  * offline.
  */
 void idle_task_exit(void)
@@ -5028,17 +5071,17 @@ void idle_task_exit(void)
        mmdrop(mm);
 }
 
-static void migrate_dead(unsigned int dead_cpu, task_t *tsk)
+static void migrate_dead(unsigned int dead_cpu, struct task_struct *p)
 {
-       struct runqueue *rq = cpu_rq(dead_cpu);
+       struct rq *rq = cpu_rq(dead_cpu);
 
        /* Must be exiting, otherwise would be on tasklist. */
-       BUG_ON(tsk->exit_state != EXIT_ZOMBIE && tsk->exit_state != EXIT_DEAD);
+       BUG_ON(p->exit_state != EXIT_ZOMBIE && p->exit_state != EXIT_DEAD);
 
        /* Cannot have done final schedule yet: would have vanished. */
-       BUG_ON(tsk->flags & PF_DEAD);
+       BUG_ON(p->flags & PF_DEAD);
 
-       get_task_struct(tsk);
+       get_task_struct(p);
 
        /*
         * Drop lock around migration; if someone else moves it,
@@ -5046,25 +5089,25 @@ static void migrate_dead(unsigned int dead_cpu, task_t *tsk)
         * fine.
         */
        spin_unlock_irq(&rq->lock);
-       move_task_off_dead_cpu(dead_cpu, tsk);
+       move_task_off_dead_cpu(dead_cpu, p);
        spin_lock_irq(&rq->lock);
 
-       put_task_struct(tsk);
+       put_task_struct(p);
 }
 
 /* release_task() removes task from tasklist, so we won't find dead tasks. */
 static void migrate_dead_tasks(unsigned int dead_cpu)
 {
-       unsigned arr, i;
-       struct runqueue *rq = cpu_rq(dead_cpu);
+       struct rq *rq = cpu_rq(dead_cpu);
+       unsigned int arr, i;
 
        for (arr = 0; arr < 2; arr++) {
                for (i = 0; i < MAX_PRIO; i++) {
                        struct list_head *list = &rq->arrays[arr].queue[i];
+
                        while (!list_empty(list))
-                               migrate_dead(dead_cpu,
-                                            list_entry(list->next, task_t,
-                                                       run_list));
+                               migrate_dead(dead_cpu, list_entry(list->next,
+                                            struct task_struct, run_list));
                }
        }
 }
@@ -5074,14 +5117,13 @@ static void migrate_dead_tasks(unsigned int dead_cpu)
  * migration_call - callback that gets triggered when a CPU is added.
  * Here we can start up the necessary migration thread for the new CPU.
  */
-static int __cpuinit migration_call(struct notifier_block *nfb,
-                       unsigned long action,
-                       void *hcpu)
+static int __cpuinit
+migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu)
 {
-       int cpu = (long)hcpu;
        struct task_struct *p;
-       struct runqueue *rq;
+       int cpu = (long)hcpu;
        unsigned long flags;
+       struct rq *rq;
 
        switch (action) {
        case CPU_UP_PREPARE:
@@ -5096,10 +5138,12 @@ static int __cpuinit migration_call(struct notifier_block *nfb,
                task_rq_unlock(rq, &flags);
                cpu_rq(cpu)->migration_thread = p;
                break;
+
        case CPU_ONLINE:
                /* Strictly unneccessary, as first user will wake it. */
                wake_up_process(cpu_rq(cpu)->migration_thread);
                break;
+
 #ifdef CONFIG_HOTPLUG_CPU
        case CPU_UP_CANCELED:
                if (!cpu_rq(cpu)->migration_thread)
@@ -5110,6 +5154,7 @@ static int __cpuinit migration_call(struct notifier_block *nfb,
                kthread_stop(cpu_rq(cpu)->migration_thread);
                cpu_rq(cpu)->migration_thread = NULL;
                break;
+
        case CPU_DEAD:
                migrate_live_tasks(cpu);
                rq = cpu_rq(cpu);
@@ -5130,9 +5175,10 @@ static int __cpuinit migration_call(struct notifier_block *nfb,
                 * the requestors. */
                spin_lock_irq(&rq->lock);
                while (!list_empty(&rq->migration_queue)) {
-                       migration_req_t *req;
+                       struct migration_req *req;
+
                        req = list_entry(rq->migration_queue.next,
-                                        migration_req_t, list);
+                                        struct migration_req, list);
                        list_del_init(&req->list);
                        complete(&req->done);
                }
@@ -5154,10 +5200,12 @@ static struct notifier_block __cpuinitdata migration_notifier = {
 int __init migration_init(void)
 {
        void *cpu = (void *)(long)smp_processor_id();
-       /* Start one for boot CPU. */
+
+       /* Start one for the boot CPU: */
        migration_call(&migration_notifier, CPU_UP_PREPARE, cpu);
        migration_call(&migration_notifier, CPU_ONLINE, cpu);
        register_cpu_notifier(&migration_notifier);
+
        return 0;
 }
 #endif
@@ -5253,7 +5301,7 @@ static void sched_domain_debug(struct sched_domain *sd, int cpu)
        } while (sd);
 }
 #else
-#define sched_domain_debug(sd, cpu) {}
+# define sched_domain_debug(sd, cpu) do { } while (0)
 #endif
 
 static int sd_degenerate(struct sched_domain *sd)
@@ -5279,8 +5327,8 @@ static int sd_degenerate(struct sched_domain *sd)
        return 1;
 }
 
-static int sd_parent_degenerate(struct sched_domain *sd,
-                                               struct sched_domain *parent)
+static int
+sd_parent_degenerate(struct sched_domain *sd, struct sched_domain *parent)
 {
        unsigned long cflags = sd->flags, pflags = parent->flags;
 
@@ -5313,7 +5361,7 @@ static int sd_parent_degenerate(struct sched_domain *sd,
  */
 static void cpu_attach_domain(struct sched_domain *sd, int cpu)
 {
-       runqueue_t *rq = cpu_rq(cpu);
+       struct rq *rq = cpu_rq(cpu);
        struct sched_domain *tmp;
 
        /* Remove the sched domains which do not contribute to scheduling. */
@@ -5575,8 +5623,8 @@ static void touch_cache(void *__cache, unsigned long __size)
 /*
  * Measure the cache-cost of one task migration. Returns in units of nsec.
  */
-static unsigned long long measure_one(void *cache, unsigned long size,
-                                     int source, int target)
+static unsigned long long
+measure_one(void *cache, unsigned long size, int source, int target)
 {
        cpumask_t mask, saved_mask;
        unsigned long long t0, t1, t2, t3, cost;
@@ -5926,9 +5974,9 @@ static int find_next_best_node(int node, unsigned long *used_nodes)
  */
 static cpumask_t sched_domain_node_span(int node)
 {
-       int i;
-       cpumask_t span, nodemask;
        DECLARE_BITMAP(used_nodes, MAX_NUMNODES);
+       cpumask_t span, nodemask;
+       int i;
 
        cpus_clear(span);
        bitmap_zero(used_nodes, MAX_NUMNODES);
@@ -5939,6 +5987,7 @@ static cpumask_t sched_domain_node_span(int node)
 
        for (i = 1; i < SD_NODES_PER_DOMAIN; i++) {
                int next_node = find_next_best_node(node, used_nodes);
+
                nodemask = node_to_cpumask(next_node);
                cpus_or(span, span, nodemask);
        }
@@ -5948,19 +5997,23 @@ static cpumask_t sched_domain_node_span(int node)
 #endif
 
 int sched_smt_power_savings = 0, sched_mc_power_savings = 0;
+
 /*
- * At the moment, CONFIG_SCHED_SMT is never defined, but leave it in so we
- * can switch it on easily if needed.
+ * SMT sched-domains:
  */
 #ifdef CONFIG_SCHED_SMT
 static DEFINE_PER_CPU(struct sched_domain, cpu_domains);
 static struct sched_group sched_group_cpus[NR_CPUS];
+
 static int cpu_to_cpu_group(int cpu)
 {
        return cpu;
 }
 #endif
 
+/*
+ * multi-core sched-domains:
+ */
 #ifdef CONFIG_SCHED_MC
 static DEFINE_PER_CPU(struct sched_domain, core_domains);
 static struct sched_group *sched_group_core_bycpu[NR_CPUS];
@@ -5980,9 +6033,10 @@ static int cpu_to_core_group(int cpu)
 
 static DEFINE_PER_CPU(struct sched_domain, phys_domains);
 static struct sched_group *sched_group_phys_bycpu[NR_CPUS];
+
 static int cpu_to_phys_group(int cpu)
 {
-#if defined(CONFIG_SCHED_MC)
+#ifdef CONFIG_SCHED_MC
        cpumask_t mask = cpu_coregroup_map(cpu);
        return first_cpu(mask);
 #elif defined(CONFIG_SCHED_SMT)
@@ -6528,6 +6582,7 @@ static ssize_t sched_power_savings_store(const char *buf, size_t count, int smt)
 int sched_create_sysfs_power_savings_entries(struct sysdev_class *cls)
 {
        int err = 0;
+
 #ifdef CONFIG_SCHED_SMT
        if (smt_capable())
                err = sysfs_create_file(&cls->kset.kobj,
@@ -6547,7 +6602,8 @@ static ssize_t sched_mc_power_savings_show(struct sys_device *dev, char *page)
 {
        return sprintf(page, "%u\n", sched_mc_power_savings);
 }
-static ssize_t sched_mc_power_savings_store(struct sys_device *dev, const char *buf, size_t count)
+static ssize_t sched_mc_power_savings_store(struct sys_device *dev,
+                                           const char *buf, size_t count)
 {
        return sched_power_savings_store(buf, count, 0);
 }
@@ -6560,7 +6616,8 @@ static ssize_t sched_smt_power_savings_show(struct sys_device *dev, char *page)
 {
        return sprintf(page, "%u\n", sched_smt_power_savings);
 }
-static ssize_t sched_smt_power_savings_store(struct sys_device *dev, const char *buf, size_t count)
+static ssize_t sched_smt_power_savings_store(struct sys_device *dev,
+                                            const char *buf, size_t count)
 {
        return sched_power_savings_store(buf, count, 1);
 }
@@ -6622,6 +6679,7 @@ int in_sched_functions(unsigned long addr)
 {
        /* Linker adds these: start and end of __sched functions */
        extern char __sched_text_start[], __sched_text_end[];
+
        return in_lock_functions(addr) ||
                (addr >= (unsigned long)__sched_text_start
                && addr < (unsigned long)__sched_text_end);
@@ -6629,14 +6687,15 @@ int in_sched_functions(unsigned long addr)
 
 void __init sched_init(void)
 {
-       runqueue_t *rq;
        int i, j, k;
 
        for_each_possible_cpu(i) {
-               prio_array_t *array;
+               struct prio_array *array;
+               struct rq *rq;
 
                rq = cpu_rq(i);
                spin_lock_init(&rq->lock);
+               lockdep_set_class(&rq->lock, &rq->rq_lock_key);
                rq->nr_running = 0;
                rq->active = rq->arrays;
                rq->expired = rq->arrays + 1;
@@ -6683,7 +6742,7 @@ void __init sched_init(void)
 #ifdef CONFIG_DEBUG_SPINLOCK_SLEEP
 void __might_sleep(char *file, int line)
 {
-#if defined(in_atomic)
+#ifdef in_atomic
        static unsigned long prev_jiffy;        /* ratelimiting */
 
        if ((in_atomic() || irqs_disabled()) &&
@@ -6705,10 +6764,10 @@ EXPORT_SYMBOL(__might_sleep);
 #ifdef CONFIG_MAGIC_SYSRQ
 void normalize_rt_tasks(void)
 {
+       struct prio_array *array;
        struct task_struct *p;
-       prio_array_t *array;
        unsigned long flags;
-       runqueue_t *rq;
+       struct rq *rq;
 
        read_lock_irq(&tasklist_lock);
        for_each_process(p) {
@@ -6752,7 +6811,7 @@ void normalize_rt_tasks(void)
  *
  * ONLY VALID WHEN THE WHOLE SYSTEM IS STOPPED!
  */
-task_t *curr_task(int cpu)
+struct task_struct *curr_task(int cpu)
 {
        return cpu_curr(cpu);
 }
@@ -6772,7 +6831,7 @@ task_t *curr_task(int cpu)
  *
  * ONLY VALID WHEN THE WHOLE SYSTEM IS STOPPED!
  */
-void set_curr_task(int cpu, task_t *p)
+void set_curr_task(int cpu, struct task_struct *p)
 {
        cpu_curr(cpu) = p;
 }
index 52adf53929f656f6806714ea6f0ade39b986b882..7fe874d12faeb4dba5cb6cfa30b376c045831f4b 100644 (file)
@@ -10,7 +10,6 @@
  *             to allow signals to be sent reliably.
  */
 
-#include <linux/config.h>
 #include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/smp_lock.h>
@@ -584,7 +583,7 @@ static int check_kill_permission(int sig, struct siginfo *info,
            && !capable(CAP_KILL))
                return error;
 
-       error = security_task_kill(t, info, sig);
+       error = security_task_kill(t, info, sig, 0);
        if (!error)
                audit_signal_info(sig, t); /* Let audit system see the signal */
        return error;
@@ -1107,7 +1106,7 @@ kill_proc_info(int sig, struct siginfo *info, pid_t pid)
 
 /* like kill_proc_info(), but doesn't use uid/euid of "current" */
 int kill_proc_info_as_uid(int sig, struct siginfo *info, pid_t pid,
-                     uid_t uid, uid_t euid)
+                     uid_t uid, uid_t euid, u32 secid)
 {
        int ret = -EINVAL;
        struct task_struct *p;
@@ -1127,6 +1126,9 @@ int kill_proc_info_as_uid(int sig, struct siginfo *info, pid_t pid,
                ret = -EPERM;
                goto out_unlock;
        }
+       ret = security_task_kill(p, info, sig, secid);
+       if (ret)
+               goto out_unlock;
        if (sig && p->sighand) {
                unsigned long flags;
                spin_lock_irqsave(&p->sighand->siglock, flags);
index 8f03e3b89b5540a0e21b1bab99dcb455bb74ffd5..215541e26c1a079a7230eac7d0b83ad1a674ea25 100644 (file)
@@ -61,6 +61,119 @@ static inline void wakeup_softirqd(void)
                wake_up_process(tsk);
 }
 
+/*
+ * This one is for softirq.c-internal use,
+ * where hardirqs are disabled legitimately:
+ */
+static void __local_bh_disable(unsigned long ip)
+{
+       unsigned long flags;
+
+       WARN_ON_ONCE(in_irq());
+
+       raw_local_irq_save(flags);
+       add_preempt_count(SOFTIRQ_OFFSET);
+       /*
+        * Were softirqs turned off above:
+        */
+       if (softirq_count() == SOFTIRQ_OFFSET)
+               trace_softirqs_off(ip);
+       raw_local_irq_restore(flags);
+}
+
+void local_bh_disable(void)
+{
+       __local_bh_disable((unsigned long)__builtin_return_address(0));
+}
+
+EXPORT_SYMBOL(local_bh_disable);
+
+void __local_bh_enable(void)
+{
+       WARN_ON_ONCE(in_irq());
+
+       /*
+        * softirqs should never be enabled by __local_bh_enable(),
+        * it always nests inside local_bh_enable() sections:
+        */
+       WARN_ON_ONCE(softirq_count() == SOFTIRQ_OFFSET);
+
+       sub_preempt_count(SOFTIRQ_OFFSET);
+}
+EXPORT_SYMBOL_GPL(__local_bh_enable);
+
+/*
+ * Special-case - softirqs can safely be enabled in
+ * cond_resched_softirq(), or by __do_softirq(),
+ * without processing still-pending softirqs:
+ */
+void _local_bh_enable(void)
+{
+       WARN_ON_ONCE(in_irq());
+       WARN_ON_ONCE(!irqs_disabled());
+
+       if (softirq_count() == SOFTIRQ_OFFSET)
+               trace_softirqs_on((unsigned long)__builtin_return_address(0));
+       sub_preempt_count(SOFTIRQ_OFFSET);
+}
+
+EXPORT_SYMBOL(_local_bh_enable);
+
+void local_bh_enable(void)
+{
+       unsigned long flags;
+
+       WARN_ON_ONCE(in_irq());
+       WARN_ON_ONCE(irqs_disabled());
+
+       local_irq_save(flags);
+       /*
+        * Are softirqs going to be turned on now:
+        */
+       if (softirq_count() == SOFTIRQ_OFFSET)
+               trace_softirqs_on((unsigned long)__builtin_return_address(0));
+       /*
+        * Keep preemption disabled until we are done with
+        * softirq processing:
+        */
+       sub_preempt_count(SOFTIRQ_OFFSET - 1);
+
+       if (unlikely(!in_interrupt() && local_softirq_pending()))
+               do_softirq();
+
+       dec_preempt_count();
+       local_irq_restore(flags);
+       preempt_check_resched();
+}
+EXPORT_SYMBOL(local_bh_enable);
+
+void local_bh_enable_ip(unsigned long ip)
+{
+       unsigned long flags;
+
+       WARN_ON_ONCE(in_irq());
+
+       local_irq_save(flags);
+       /*
+        * Are softirqs going to be turned on now:
+        */
+       if (softirq_count() == SOFTIRQ_OFFSET)
+               trace_softirqs_on(ip);
+       /*
+        * Keep preemption disabled until we are done with
+        * softirq processing:
+        */
+       sub_preempt_count(SOFTIRQ_OFFSET - 1);
+
+       if (unlikely(!in_interrupt() && local_softirq_pending()))
+               do_softirq();
+
+       dec_preempt_count();
+       local_irq_restore(flags);
+       preempt_check_resched();
+}
+EXPORT_SYMBOL(local_bh_enable_ip);
+
 /*
  * We restart softirq processing MAX_SOFTIRQ_RESTART times,
  * and we fall back to softirqd after that.
@@ -80,8 +193,11 @@ asmlinkage void __do_softirq(void)
        int cpu;
 
        pending = local_softirq_pending();
+       account_system_vtime(current);
+
+       __local_bh_disable((unsigned long)__builtin_return_address(0));
+       trace_softirq_enter();
 
-       local_bh_disable();
        cpu = smp_processor_id();
 restart:
        /* Reset the pending bitmask before enabling irqs */
@@ -109,7 +225,10 @@ restart:
        if (pending)
                wakeup_softirqd();
 
-       __local_bh_enable();
+       trace_softirq_exit();
+
+       account_system_vtime(current);
+       _local_bh_enable();
 }
 
 #ifndef __ARCH_HAS_DO_SOFTIRQ
@@ -136,23 +255,6 @@ EXPORT_SYMBOL(do_softirq);
 
 #endif
 
-void local_bh_enable(void)
-{
-       WARN_ON(irqs_disabled());
-       /*
-        * Keep preemption disabled until we are done with
-        * softirq processing:
-        */
-       sub_preempt_count(SOFTIRQ_OFFSET - 1);
-
-       if (unlikely(!in_interrupt() && local_softirq_pending()))
-               do_softirq();
-
-       dec_preempt_count();
-       preempt_check_resched();
-}
-EXPORT_SYMBOL(local_bh_enable);
-
 #ifdef __ARCH_IRQ_EXIT_IRQS_DISABLED
 # define invoke_softirq()      __do_softirq()
 #else
@@ -165,6 +267,7 @@ EXPORT_SYMBOL(local_bh_enable);
 void irq_exit(void)
 {
        account_system_vtime(current);
+       trace_hardirq_exit();
        sub_preempt_count(IRQ_EXIT_OFFSET);
        if (!in_interrupt() && local_softirq_pending())
                invoke_softirq();
index d1b810782bc4e1b643faac72733074e2dc492fa4..bfd6ad9c0330b61b34d780392fdcf3e2a4c64386 100644 (file)
@@ -9,11 +9,11 @@
  * SMP and the DEBUG_SPINLOCK cases. (UP-nondebug inlines them)
  */
 
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <linux/preempt.h>
 #include <linux/spinlock.h>
 #include <linux/interrupt.h>
+#include <linux/debug_locks.h>
 #include <linux/module.h>
 
 /*
@@ -30,8 +30,10 @@ EXPORT_SYMBOL(generic__raw_read_trylock);
 int __lockfunc _spin_trylock(spinlock_t *lock)
 {
        preempt_disable();
-       if (_raw_spin_trylock(lock))
+       if (_raw_spin_trylock(lock)) {
+               spin_acquire(&lock->dep_map, 0, 1, _RET_IP_);
                return 1;
+       }
        
        preempt_enable();
        return 0;
@@ -41,8 +43,10 @@ EXPORT_SYMBOL(_spin_trylock);
 int __lockfunc _read_trylock(rwlock_t *lock)
 {
        preempt_disable();
-       if (_raw_read_trylock(lock))
+       if (_raw_read_trylock(lock)) {
+               rwlock_acquire_read(&lock->dep_map, 0, 1, _RET_IP_);
                return 1;
+       }
 
        preempt_enable();
        return 0;
@@ -52,19 +56,28 @@ EXPORT_SYMBOL(_read_trylock);
 int __lockfunc _write_trylock(rwlock_t *lock)
 {
        preempt_disable();
-       if (_raw_write_trylock(lock))
+       if (_raw_write_trylock(lock)) {
+               rwlock_acquire(&lock->dep_map, 0, 1, _RET_IP_);
                return 1;
+       }
 
        preempt_enable();
        return 0;
 }
 EXPORT_SYMBOL(_write_trylock);
 
-#if !defined(CONFIG_PREEMPT) || !defined(CONFIG_SMP)
+/*
+ * If lockdep is enabled then we use the non-preemption spin-ops
+ * even on CONFIG_PREEMPT, because lockdep assumes that interrupts are
+ * not re-enabled during lock-acquire (which the preempt-spin-ops do):
+ */
+#if !defined(CONFIG_PREEMPT) || !defined(CONFIG_SMP) || \
+       defined(CONFIG_PROVE_LOCKING)
 
 void __lockfunc _read_lock(rwlock_t *lock)
 {
        preempt_disable();
+       rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_);
        _raw_read_lock(lock);
 }
 EXPORT_SYMBOL(_read_lock);
@@ -75,7 +88,17 @@ unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock)
 
        local_irq_save(flags);
        preempt_disable();
+       spin_acquire(&lock->dep_map, 0, 0, _RET_IP_);
+       /*
+        * On lockdep we dont want the hand-coded irq-enable of
+        * _raw_spin_lock_flags() code, because lockdep assumes
+        * that interrupts are not re-enabled during lock-acquire:
+        */
+#ifdef CONFIG_PROVE_LOCKING
+       _raw_spin_lock(lock);
+#else
        _raw_spin_lock_flags(lock, &flags);
+#endif
        return flags;
 }
 EXPORT_SYMBOL(_spin_lock_irqsave);
@@ -84,6 +107,7 @@ void __lockfunc _spin_lock_irq(spinlock_t *lock)
 {
        local_irq_disable();
        preempt_disable();
+       spin_acquire(&lock->dep_map, 0, 0, _RET_IP_);
        _raw_spin_lock(lock);
 }
 EXPORT_SYMBOL(_spin_lock_irq);
@@ -92,6 +116,7 @@ void __lockfunc _spin_lock_bh(spinlock_t *lock)
 {
        local_bh_disable();
        preempt_disable();
+       spin_acquire(&lock->dep_map, 0, 0, _RET_IP_);
        _raw_spin_lock(lock);
 }
 EXPORT_SYMBOL(_spin_lock_bh);
@@ -102,6 +127,7 @@ unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock)
 
        local_irq_save(flags);
        preempt_disable();
+       rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_);
        _raw_read_lock(lock);
        return flags;
 }
@@ -111,6 +137,7 @@ void __lockfunc _read_lock_irq(rwlock_t *lock)
 {
        local_irq_disable();
        preempt_disable();
+       rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_);
        _raw_read_lock(lock);
 }
 EXPORT_SYMBOL(_read_lock_irq);
@@ -119,6 +146,7 @@ void __lockfunc _read_lock_bh(rwlock_t *lock)
 {
        local_bh_disable();
        preempt_disable();
+       rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_);
        _raw_read_lock(lock);
 }
 EXPORT_SYMBOL(_read_lock_bh);
@@ -129,6 +157,7 @@ unsigned long __lockfunc _write_lock_irqsave(rwlock_t *lock)
 
        local_irq_save(flags);
        preempt_disable();
+       rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_);
        _raw_write_lock(lock);
        return flags;
 }
@@ -138,6 +167,7 @@ void __lockfunc _write_lock_irq(rwlock_t *lock)
 {
        local_irq_disable();
        preempt_disable();
+       rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_);
        _raw_write_lock(lock);
 }
 EXPORT_SYMBOL(_write_lock_irq);
@@ -146,6 +176,7 @@ void __lockfunc _write_lock_bh(rwlock_t *lock)
 {
        local_bh_disable();
        preempt_disable();
+       rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_);
        _raw_write_lock(lock);
 }
 EXPORT_SYMBOL(_write_lock_bh);
@@ -153,6 +184,7 @@ EXPORT_SYMBOL(_write_lock_bh);
 void __lockfunc _spin_lock(spinlock_t *lock)
 {
        preempt_disable();
+       spin_acquire(&lock->dep_map, 0, 0, _RET_IP_);
        _raw_spin_lock(lock);
 }
 
@@ -161,6 +193,7 @@ EXPORT_SYMBOL(_spin_lock);
 void __lockfunc _write_lock(rwlock_t *lock)
 {
        preempt_disable();
+       rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_);
        _raw_write_lock(lock);
 }
 
@@ -256,8 +289,22 @@ BUILD_LOCK_OPS(write, rwlock);
 
 #endif /* CONFIG_PREEMPT */
 
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+
+void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass)
+{
+       preempt_disable();
+       spin_acquire(&lock->dep_map, subclass, 0, _RET_IP_);
+       _raw_spin_lock(lock);
+}
+
+EXPORT_SYMBOL(_spin_lock_nested);
+
+#endif
+
 void __lockfunc _spin_unlock(spinlock_t *lock)
 {
+       spin_release(&lock->dep_map, 1, _RET_IP_);
        _raw_spin_unlock(lock);
        preempt_enable();
 }
@@ -265,6 +312,7 @@ EXPORT_SYMBOL(_spin_unlock);
 
 void __lockfunc _write_unlock(rwlock_t *lock)
 {
+       rwlock_release(&lock->dep_map, 1, _RET_IP_);
        _raw_write_unlock(lock);
        preempt_enable();
 }
@@ -272,6 +320,7 @@ EXPORT_SYMBOL(_write_unlock);
 
 void __lockfunc _read_unlock(rwlock_t *lock)
 {
+       rwlock_release(&lock->dep_map, 1, _RET_IP_);
        _raw_read_unlock(lock);
        preempt_enable();
 }
@@ -279,6 +328,7 @@ EXPORT_SYMBOL(_read_unlock);
 
 void __lockfunc _spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags)
 {
+       spin_release(&lock->dep_map, 1, _RET_IP_);
        _raw_spin_unlock(lock);
        local_irq_restore(flags);
        preempt_enable();
@@ -287,6 +337,7 @@ EXPORT_SYMBOL(_spin_unlock_irqrestore);
 
 void __lockfunc _spin_unlock_irq(spinlock_t *lock)
 {
+       spin_release(&lock->dep_map, 1, _RET_IP_);
        _raw_spin_unlock(lock);
        local_irq_enable();
        preempt_enable();
@@ -295,14 +346,16 @@ EXPORT_SYMBOL(_spin_unlock_irq);
 
 void __lockfunc _spin_unlock_bh(spinlock_t *lock)
 {
+       spin_release(&lock->dep_map, 1, _RET_IP_);
        _raw_spin_unlock(lock);
        preempt_enable_no_resched();
-       local_bh_enable();
+       local_bh_enable_ip((unsigned long)__builtin_return_address(0));
 }
 EXPORT_SYMBOL(_spin_unlock_bh);
 
 void __lockfunc _read_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
 {
+       rwlock_release(&lock->dep_map, 1, _RET_IP_);
        _raw_read_unlock(lock);
        local_irq_restore(flags);
        preempt_enable();
@@ -311,6 +364,7 @@ EXPORT_SYMBOL(_read_unlock_irqrestore);
 
 void __lockfunc _read_unlock_irq(rwlock_t *lock)
 {
+       rwlock_release(&lock->dep_map, 1, _RET_IP_);
        _raw_read_unlock(lock);
        local_irq_enable();
        preempt_enable();
@@ -319,14 +373,16 @@ EXPORT_SYMBOL(_read_unlock_irq);
 
 void __lockfunc _read_unlock_bh(rwlock_t *lock)
 {
+       rwlock_release(&lock->dep_map, 1, _RET_IP_);
        _raw_read_unlock(lock);
        preempt_enable_no_resched();
-       local_bh_enable();
+       local_bh_enable_ip((unsigned long)__builtin_return_address(0));
 }
 EXPORT_SYMBOL(_read_unlock_bh);
 
 void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
 {
+       rwlock_release(&lock->dep_map, 1, _RET_IP_);
        _raw_write_unlock(lock);
        local_irq_restore(flags);
        preempt_enable();
@@ -335,6 +391,7 @@ EXPORT_SYMBOL(_write_unlock_irqrestore);
 
 void __lockfunc _write_unlock_irq(rwlock_t *lock)
 {
+       rwlock_release(&lock->dep_map, 1, _RET_IP_);
        _raw_write_unlock(lock);
        local_irq_enable();
        preempt_enable();
@@ -343,9 +400,10 @@ EXPORT_SYMBOL(_write_unlock_irq);
 
 void __lockfunc _write_unlock_bh(rwlock_t *lock)
 {
+       rwlock_release(&lock->dep_map, 1, _RET_IP_);
        _raw_write_unlock(lock);
        preempt_enable_no_resched();
-       local_bh_enable();
+       local_bh_enable_ip((unsigned long)__builtin_return_address(0));
 }
 EXPORT_SYMBOL(_write_unlock_bh);
 
@@ -353,11 +411,13 @@ int __lockfunc _spin_trylock_bh(spinlock_t *lock)
 {
        local_bh_disable();
        preempt_disable();
-       if (_raw_spin_trylock(lock))
+       if (_raw_spin_trylock(lock)) {
+               spin_acquire(&lock->dep_map, 0, 1, _RET_IP_);
                return 1;
+       }
 
        preempt_enable_no_resched();
-       local_bh_enable();
+       local_bh_enable_ip((unsigned long)__builtin_return_address(0));
        return 0;
 }
 EXPORT_SYMBOL(_spin_trylock_bh);
diff --git a/kernel/stacktrace.c b/kernel/stacktrace.c
new file mode 100644 (file)
index 0000000..b71816e
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * kernel/stacktrace.c
+ *
+ * Stack trace management functions
+ *
+ *  Copyright (C) 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
+ */
+#include <linux/sched.h>
+#include <linux/kallsyms.h>
+#include <linux/stacktrace.h>
+
+void print_stack_trace(struct stack_trace *trace, int spaces)
+{
+       int i, j;
+
+       for (i = 0; i < trace->nr_entries; i++) {
+               unsigned long ip = trace->entries[i];
+
+               for (j = 0; j < spaces + 1; j++)
+                       printk(" ");
+               print_ip_sym(ip);
+       }
+}
+
index 2c0aacc37c5513b0a3898f49e937683501f66ae2..dcfb5d731466257f7f003ba5eb84083f0185d22c 100644 (file)
@@ -4,7 +4,6 @@
 #include <linux/cpu.h>
 #include <linux/err.h>
 #include <linux/syscalls.h>
-#include <linux/kthread.h>
 #include <asm/atomic.h>
 #include <asm/semaphore.h>
 #include <asm/uaccess.h>
@@ -26,11 +25,13 @@ static unsigned int stopmachine_num_threads;
 static atomic_t stopmachine_thread_ack;
 static DECLARE_MUTEX(stopmachine_mutex);
 
-static int stopmachine(void *unused)
+static int stopmachine(void *cpu)
 {
        int irqs_disabled = 0;
        int prepared = 0;
 
+       set_cpus_allowed(current, cpumask_of_cpu((int)(long)cpu));
+
        /* Ack: we are alive */
        smp_mb(); /* Theoretically the ack = 0 might not be on this CPU yet. */
        atomic_inc(&stopmachine_thread_ack);
@@ -84,8 +85,7 @@ static void stopmachine_set_state(enum stopmachine_state state)
 
 static int stop_machine(void)
 {
-       int ret = 0;
-       unsigned int i;
+       int i, ret = 0;
        struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 };
 
        /* One high-prio thread per cpu.  We'll do this one. */
@@ -96,16 +96,11 @@ static int stop_machine(void)
        stopmachine_state = STOPMACHINE_WAIT;
 
        for_each_online_cpu(i) {
-               struct task_struct *tsk;
                if (i == raw_smp_processor_id())
                        continue;
-               tsk = kthread_create(stopmachine, NULL, "stopmachine");
-               if (IS_ERR(tsk)) {
-                       ret = PTR_ERR(tsk);
+               ret = kernel_thread(stopmachine, (void *)(long)i,CLONE_KERNEL);
+               if (ret < 0)
                        break;
-               }
-               kthread_bind(tsk, i);
-               wake_up_process(tsk);
                stopmachine_num_threads++;
        }
 
index 2d5179c67cec727f40476e2f9e75fbb9eeeb8d8c..dbb3b9c7ea64b17cf6aa7b96dcd007469e18f5d5 100644 (file)
@@ -4,7 +4,6 @@
  *  Copyright (C) 1991, 1992  Linus Torvalds
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/mm.h>
 #include <linux/utsname.h>
index 93a2c53986488f5c29cf05318db80241118bda74..362a0cc371381cceab3f4a77b03430a604ecdb71 100644 (file)
@@ -18,7 +18,6 @@
  *  Removed it and replaced it with older style, 03/23/00, Bill Wendling
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/mm.h>
 #include <linux/swap.h>
@@ -934,13 +933,15 @@ static ctl_table vm_table[] = {
                .extra1         = &zero,
        },
        {
-               .ctl_name       = VM_ZONE_RECLAIM_INTERVAL,
-               .procname       = "zone_reclaim_interval",
-               .data           = &zone_reclaim_interval,
-               .maxlen         = sizeof(zone_reclaim_interval),
+               .ctl_name       = VM_MIN_UNMAPPED,
+               .procname       = "min_unmapped_ratio",
+               .data           = &sysctl_min_unmapped_ratio,
+               .maxlen         = sizeof(sysctl_min_unmapped_ratio),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_jiffies,
-               .strategy       = &sysctl_jiffies,
+               .proc_handler   = &sysctl_min_unmapped_ratio_sysctl_handler,
+               .strategy       = &sysctl_intvec,
+               .extra1         = &zero,
+               .extra2         = &one_hundred,
        },
 #endif
 #ifdef CONFIG_X86_32
index 5a8960253063d00495366a48d92e06e5eb4133fa..396a3c024c2c5ba95a9cb663d009acba16b5df0f 100644 (file)
@@ -1208,7 +1208,7 @@ unsigned long wall_jiffies = INITIAL_JIFFIES;
  * playing with xtime and avenrun.
  */
 #ifndef ARCH_HAVE_XTIME_LOCK
-seqlock_t xtime_lock __cacheline_aligned_in_smp = SEQLOCK_UNLOCKED;
+__cacheline_aligned_in_smp DEFINE_SEQLOCK(xtime_lock);
 
 EXPORT_SYMBOL(xtime_lock);
 #endif
@@ -1368,7 +1368,7 @@ asmlinkage long sys_getegid(void)
 
 static void process_timeout(unsigned long __data)
 {
-       wake_up_process((task_t *)__data);
+       wake_up_process((struct task_struct *)__data);
 }
 
 /**
@@ -1559,6 +1559,13 @@ asmlinkage long sys_sysinfo(struct sysinfo __user *info)
        return 0;
 }
 
+/*
+ * lockdep: we want to track each per-CPU base as a separate lock-class,
+ * but timer-bases are kmalloc()-ed, so we need to attach separate
+ * keys to them:
+ */
+static struct lock_class_key base_lock_keys[NR_CPUS];
+
 static int __devinit init_timers_cpu(int cpu)
 {
        int j;
@@ -1594,6 +1601,8 @@ static int __devinit init_timers_cpu(int cpu)
        }
 
        spin_lock_init(&base->lock);
+       lockdep_set_class(&base->lock, base_lock_keys + cpu);
+
        for (j = 0; j < TVN_SIZE; j++) {
                INIT_LIST_HEAD(base->tv5.vec + j);
                INIT_LIST_HEAD(base->tv4.vec + j);
index 791681cfea981d49e5b9f74de41f928c1c8da38b..a1d57aeb7f7543fe2eeedb4aa8d8899f5abf3242 100644 (file)
@@ -3,7 +3,6 @@
  *
  * (C) 2004 William Irwin, Oracle
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/wait.h>
 #include <linux/hash.h>
 
+struct lock_class_key waitqueue_lock_key;
+
+EXPORT_SYMBOL(waitqueue_lock_key);
+
 void fastcall add_wait_queue(wait_queue_head_t *q, wait_queue_t *wait)
 {
        unsigned long flags;
index 7f1c30c7273b9e763af73079979955664710fdf9..eebb1d83923515d02a848e69bf363b83d871ae67 100644 (file)
@@ -51,7 +51,7 @@ struct cpu_workqueue_struct {
        wait_queue_head_t work_done;
 
        struct workqueue_struct *wq;
-       task_t *thread;
+       struct task_struct *thread;
 
        int run_depth;          /* Detect run_workqueue() recursion depth */
 } ____cacheline_aligned;
index e4fcbd12cf6ef75b75d7eebc40d1b45de3a22236..e5889b1a33ff6fbec48441ee0c158b3323703715 100644 (file)
@@ -48,7 +48,7 @@ config DEBUG_KERNEL
 config LOG_BUF_SHIFT
        int "Kernel log buffer size (16 => 64KB, 17 => 128KB)" if DEBUG_KERNEL
        range 12 21
-       default 17 if S390
+       default 17 if S390 || LOCKDEP
        default 16 if X86_NUMAQ || IA64
        default 15 if SMP
        default 14
@@ -107,7 +107,7 @@ config DEBUG_SLAB_LEAK
 
 config DEBUG_PREEMPT
        bool "Debug preemptible kernel"
-       depends on DEBUG_KERNEL && PREEMPT
+       depends on DEBUG_KERNEL && PREEMPT && TRACE_IRQFLAGS_SUPPORT
        default y
        help
          If you say Y here then the kernel will use a debug variant of the
@@ -115,14 +115,6 @@ config DEBUG_PREEMPT
          if kernel code uses it in a preemption-unsafe way. Also, the kernel
          will detect preemption count underflows.
 
-config DEBUG_MUTEXES
-       bool "Mutex debugging, deadlock detection"
-       default n
-       depends on DEBUG_KERNEL
-       help
-        This allows mutex semantics violations and mutex related deadlocks
-        (lockups) to be detected and reported automatically.
-
 config DEBUG_RT_MUTEXES
        bool "RT Mutex debugging, deadlock detection"
        depends on DEBUG_KERNEL && RT_MUTEXES
@@ -142,7 +134,7 @@ config RT_MUTEX_TESTER
          This option enables a rt-mutex tester.
 
 config DEBUG_SPINLOCK
-       bool "Spinlock debugging"
+       bool "Spinlock and rw-lock debugging: basic checks"
        depends on DEBUG_KERNEL
        help
          Say Y here and build SMP to catch missing spinlock initialization
@@ -150,13 +142,122 @@ config DEBUG_SPINLOCK
          best used in conjunction with the NMI watchdog so that spinlock
          deadlocks are also debuggable.
 
+config DEBUG_MUTEXES
+       bool "Mutex debugging: basic checks"
+       depends on DEBUG_KERNEL
+       help
+        This feature allows mutex semantics violations to be detected and
+        reported.
+
+config DEBUG_RWSEMS
+       bool "RW-sem debugging: basic checks"
+       depends on DEBUG_KERNEL
+       help
+        This feature allows read-write semaphore semantics violations to
+        be detected and reported.
+
+config DEBUG_LOCK_ALLOC
+       bool "Lock debugging: detect incorrect freeing of live locks"
+       depends on TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
+       select DEBUG_SPINLOCK
+       select DEBUG_MUTEXES
+       select DEBUG_RWSEMS
+       select LOCKDEP
+       help
+        This feature will check whether any held lock (spinlock, rwlock,
+        mutex or rwsem) is incorrectly freed by the kernel, via any of the
+        memory-freeing routines (kfree(), kmem_cache_free(), free_pages(),
+        vfree(), etc.), whether a live lock is incorrectly reinitialized via
+        spin_lock_init()/mutex_init()/etc., or whether there is any lock
+        held during task exit.
+
+config PROVE_LOCKING
+       bool "Lock debugging: prove locking correctness"
+       depends on TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
+       select LOCKDEP
+       select DEBUG_SPINLOCK
+       select DEBUG_MUTEXES
+       select DEBUG_RWSEMS
+       select DEBUG_LOCK_ALLOC
+       default n
+       help
+        This feature enables the kernel to prove that all locking
+        that occurs in the kernel runtime is mathematically
+        correct: that under no circumstance could an arbitrary (and
+        not yet triggered) combination of observed locking
+        sequences (on an arbitrary number of CPUs, running an
+        arbitrary number of tasks and interrupt contexts) cause a
+        deadlock.
+
+        In short, this feature enables the kernel to report locking
+        related deadlocks before they actually occur.
+
+        The proof does not depend on how hard and complex a
+        deadlock scenario would be to trigger: how many
+        participant CPUs, tasks and irq-contexts would be needed
+        for it to trigger. The proof also does not depend on
+        timing: if a race and a resulting deadlock is possible
+        theoretically (no matter how unlikely the race scenario
+        is), it will be proven so and will immediately be
+        reported by the kernel (once the event is observed that
+        makes the deadlock theoretically possible).
+
+        If a deadlock is impossible (i.e. the locking rules, as
+        observed by the kernel, are mathematically correct), the
+        kernel reports nothing.
+
+        NOTE: this feature can also be enabled for rwlocks, mutexes
+        and rwsems - in which case all dependencies between these
+        different locking variants are observed and mapped too, and
+        the proof of observed correctness is also maintained for an
+        arbitrary combination of these separate locking variants.
+
+        For more details, see Documentation/lockdep-design.txt.
+
+config LOCKDEP
+       bool
+       depends on TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
+       select STACKTRACE
+       select FRAME_POINTER
+       select KALLSYMS
+       select KALLSYMS_ALL
+
+config DEBUG_LOCKDEP
+       bool "Lock dependency engine debugging"
+       depends on LOCKDEP
+       help
+         If you say Y here, the lock dependency engine will do
+         additional runtime checks to debug itself, at the price
+         of more runtime overhead.
+
+config TRACE_IRQFLAGS
+       bool
+       default y
+       depends on TRACE_IRQFLAGS_SUPPORT
+       depends on PROVE_LOCKING
+
 config DEBUG_SPINLOCK_SLEEP
-       bool "Sleep-inside-spinlock checking"
+       bool "Spinlock debugging: sleep-inside-spinlock checking"
        depends on DEBUG_KERNEL
        help
          If you say Y here, various routines which may sleep will become very
          noisy if they are called with a spinlock held.
 
+config DEBUG_LOCKING_API_SELFTESTS
+       bool "Locking API boot-time self-tests"
+       depends on DEBUG_KERNEL
+       help
+         Say Y here if you want the kernel to run a short self-test during
+         bootup. The self-test checks whether common types of locking bugs
+         are detected by debugging mechanisms or not. (if you disable
+         lock debugging then those bugs wont be detected of course.)
+         The following locking APIs are covered: spinlocks, rwlocks,
+         mutexes and rwsems.
+
+config STACKTRACE
+       bool
+       depends on STACKTRACE_SUPPORT
+
 config DEBUG_KOBJECT
        bool "kobject debugging"
        depends on DEBUG_KERNEL
@@ -212,7 +313,7 @@ config DEBUG_VM
 
 config FRAME_POINTER
        bool "Compile the kernel with frame pointers"
-       depends on DEBUG_KERNEL && (X86 || CRIS || M68K || M68KNOMMU || FRV || UML)
+       depends on DEBUG_KERNEL && (X86 || CRIS || M68K || M68KNOMMU || FRV || UML || S390)
        default y if DEBUG_INFO && UML
        help
          If you say Y here the resulting kernel image will be slightly larger
index 10c13c9d7824d21aa6425001b3a1d0c0403edfa5..be9719ae82d047f3d6d29f977d4086a280113b43 100644 (file)
@@ -11,13 +11,14 @@ lib-$(CONFIG_SMP) += cpumask.o
 
 lib-y  += kobject.o kref.o kobject_uevent.o klist.o
 
-obj-y += sort.o parser.o halfmd4.o iomap_copy.o
+obj-y += sort.o parser.o halfmd4.o iomap_copy.o debug_locks.o
 
 ifeq ($(CONFIG_DEBUG_KOBJECT),y)
 CFLAGS_kobject.o += -DDEBUG
 CFLAGS_kobject_uevent.o += -DDEBUG
 endif
 
+obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) += locking-selftest.o
 obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock_debug.o
 lib-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o
 lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o
index 6bb7319e09a006588e697bda90a063703868b04c..a2055bc3ef623d1b2f4659bdbd7dfe729ae47aa6 100644 (file)
@@ -7,7 +7,6 @@
  * and panic() information from reaching the user.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/spinlock.h>
 #include <linux/tty.h>
diff --git a/lib/debug_locks.c b/lib/debug_locks.c
new file mode 100644 (file)
index 0000000..0ef01d1
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * lib/debug_locks.c
+ *
+ * Generic place for common debugging facilities for various locks:
+ * spinlocks, rwlocks, mutexes and rwsems.
+ *
+ * Started by Ingo Molnar:
+ *
+ *  Copyright (C) 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
+ */
+#include <linux/rwsem.h>
+#include <linux/mutex.h>
+#include <linux/module.h>
+#include <linux/spinlock.h>
+#include <linux/debug_locks.h>
+
+/*
+ * We want to turn all lock-debugging facilities on/off at once,
+ * via a global flag. The reason is that once a single bug has been
+ * detected and reported, there might be cascade of followup bugs
+ * that would just muddy the log. So we report the first one and
+ * shut up after that.
+ */
+int debug_locks = 1;
+
+/*
+ * The locking-testsuite uses <debug_locks_silent> to get a
+ * 'silent failure': nothing is printed to the console when
+ * a locking bug is detected.
+ */
+int debug_locks_silent;
+
+/*
+ * Generic 'turn off all lock debugging' function:
+ */
+int debug_locks_off(void)
+{
+       if (xchg(&debug_locks, 0)) {
+               if (!debug_locks_silent) {
+                       console_verbose();
+                       return 1;
+               }
+       }
+       return 0;
+}
index 01c08b5836f5e8441920df88df4efc9859776efe..463f4560f16da1e6d03394b46d8e0763948501f7 100644 (file)
@@ -9,7 +9,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/sort.h>
index e713e86811aeb1ff1efdb5d68fabea7a63042c3c..e0fdfddb406ec3975673f150f46bd3302bc08599 100644 (file)
@@ -177,7 +177,12 @@ static inline void __lock_kernel(void)
 
 static inline void __unlock_kernel(void)
 {
-       spin_unlock(&kernel_flag);
+       /*
+        * the BKL is not covered by lockdep, so we open-code the
+        * unlocking sequence (and thus avoid the dep-chain ops):
+        */
+       _raw_spin_unlock(&kernel_flag);
+       preempt_enable();
 }
 
 /*
index 7f20e7b857cb559b7624d89ca4c52bbf86bc1b65..2b1530fc573bfaa4af0c7288eba1fce7af51513f 100644 (file)
@@ -50,6 +50,10 @@ static char *action_to_string(enum kobject_action action)
                return "offline";
        case KOBJ_ONLINE:
                return "online";
+       case KOBJ_DOCK:
+               return "dock";
+       case KOBJ_UNDOCK:
+               return "undock";
        default:
                return NULL;
        }
diff --git a/lib/locking-selftest-hardirq.h b/lib/locking-selftest-hardirq.h
new file mode 100644 (file)
index 0000000..10d4a15
--- /dev/null
@@ -0,0 +1,9 @@
+#undef IRQ_DISABLE
+#undef IRQ_ENABLE
+#undef IRQ_ENTER
+#undef IRQ_EXIT
+
+#define IRQ_ENABLE             HARDIRQ_ENABLE
+#define IRQ_DISABLE            HARDIRQ_DISABLE
+#define IRQ_ENTER              HARDIRQ_ENTER
+#define IRQ_EXIT               HARDIRQ_EXIT
diff --git a/lib/locking-selftest-mutex.h b/lib/locking-selftest-mutex.h
new file mode 100644 (file)
index 0000000..68601b6
--- /dev/null
@@ -0,0 +1,11 @@
+#undef LOCK
+#define LOCK           ML
+
+#undef UNLOCK
+#define UNLOCK         MU
+
+#undef RLOCK
+#undef WLOCK
+
+#undef INIT
+#define INIT           MI
diff --git a/lib/locking-selftest-rlock-hardirq.h b/lib/locking-selftest-rlock-hardirq.h
new file mode 100644 (file)
index 0000000..9f517eb
--- /dev/null
@@ -0,0 +1,2 @@
+#include "locking-selftest-rlock.h"
+#include "locking-selftest-hardirq.h"
diff --git a/lib/locking-selftest-rlock-softirq.h b/lib/locking-selftest-rlock-softirq.h
new file mode 100644 (file)
index 0000000..981455d
--- /dev/null
@@ -0,0 +1,2 @@
+#include "locking-selftest-rlock.h"
+#include "locking-selftest-softirq.h"
diff --git a/lib/locking-selftest-rlock.h b/lib/locking-selftest-rlock.h
new file mode 100644 (file)
index 0000000..6789044
--- /dev/null
@@ -0,0 +1,14 @@
+#undef LOCK
+#define LOCK           RL
+
+#undef UNLOCK
+#define UNLOCK         RU
+
+#undef RLOCK
+#define RLOCK          RL
+
+#undef WLOCK
+#define WLOCK          WL
+
+#undef INIT
+#define INIT           RWI
diff --git a/lib/locking-selftest-rsem.h b/lib/locking-selftest-rsem.h
new file mode 100644 (file)
index 0000000..62da886
--- /dev/null
@@ -0,0 +1,14 @@
+#undef LOCK
+#define LOCK           RSL
+
+#undef UNLOCK
+#define UNLOCK         RSU
+
+#undef RLOCK
+#define RLOCK          RSL
+
+#undef WLOCK
+#define WLOCK          WSL
+
+#undef INIT
+#define INIT           RWSI
diff --git a/lib/locking-selftest-softirq.h b/lib/locking-selftest-softirq.h
new file mode 100644 (file)
index 0000000..a83de2a
--- /dev/null
@@ -0,0 +1,9 @@
+#undef IRQ_DISABLE
+#undef IRQ_ENABLE
+#undef IRQ_ENTER
+#undef IRQ_EXIT
+
+#define IRQ_DISABLE            SOFTIRQ_DISABLE
+#define IRQ_ENABLE             SOFTIRQ_ENABLE
+#define IRQ_ENTER              SOFTIRQ_ENTER
+#define IRQ_EXIT               SOFTIRQ_EXIT
diff --git a/lib/locking-selftest-spin-hardirq.h b/lib/locking-selftest-spin-hardirq.h
new file mode 100644 (file)
index 0000000..693198d
--- /dev/null
@@ -0,0 +1,2 @@
+#include "locking-selftest-spin.h"
+#include "locking-selftest-hardirq.h"
diff --git a/lib/locking-selftest-spin-softirq.h b/lib/locking-selftest-spin-softirq.h
new file mode 100644 (file)
index 0000000..c472e2a
--- /dev/null
@@ -0,0 +1,2 @@
+#include "locking-selftest-spin.h"
+#include "locking-selftest-softirq.h"
diff --git a/lib/locking-selftest-spin.h b/lib/locking-selftest-spin.h
new file mode 100644 (file)
index 0000000..ccd1b4b
--- /dev/null
@@ -0,0 +1,11 @@
+#undef LOCK
+#define LOCK           L
+
+#undef UNLOCK
+#define UNLOCK         U
+
+#undef RLOCK
+#undef WLOCK
+
+#undef INIT
+#define INIT           SI
diff --git a/lib/locking-selftest-wlock-hardirq.h b/lib/locking-selftest-wlock-hardirq.h
new file mode 100644 (file)
index 0000000..2dd2e51
--- /dev/null
@@ -0,0 +1,2 @@
+#include "locking-selftest-wlock.h"
+#include "locking-selftest-hardirq.h"
diff --git a/lib/locking-selftest-wlock-softirq.h b/lib/locking-selftest-wlock-softirq.h
new file mode 100644 (file)
index 0000000..cb80d1c
--- /dev/null
@@ -0,0 +1,2 @@
+#include "locking-selftest-wlock.h"
+#include "locking-selftest-softirq.h"
diff --git a/lib/locking-selftest-wlock.h b/lib/locking-selftest-wlock.h
new file mode 100644 (file)
index 0000000..0815322
--- /dev/null
@@ -0,0 +1,14 @@
+#undef LOCK
+#define LOCK           WL
+
+#undef UNLOCK
+#define UNLOCK         WU
+
+#undef RLOCK
+#define RLOCK          RL
+
+#undef WLOCK
+#define WLOCK          WL
+
+#undef INIT
+#define INIT           RWI
diff --git a/lib/locking-selftest-wsem.h b/lib/locking-selftest-wsem.h
new file mode 100644 (file)
index 0000000..b88c5f2
--- /dev/null
@@ -0,0 +1,14 @@
+#undef LOCK
+#define LOCK           WSL
+
+#undef UNLOCK
+#define UNLOCK         WSU
+
+#undef RLOCK
+#define RLOCK          RSL
+
+#undef WLOCK
+#define WLOCK          WSL
+
+#undef INIT
+#define INIT           RWSI
diff --git a/lib/locking-selftest.c b/lib/locking-selftest.c
new file mode 100644 (file)
index 0000000..7945787
--- /dev/null
@@ -0,0 +1,1216 @@
+/*
+ * lib/locking-selftest.c
+ *
+ * Testsuite for various locking APIs: spinlocks, rwlocks,
+ * mutexes and rw-semaphores.
+ *
+ * It is checking both false positives and false negatives.
+ *
+ * Started by Ingo Molnar:
+ *
+ *  Copyright (C) 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
+ */
+#include <linux/rwsem.h>
+#include <linux/mutex.h>
+#include <linux/sched.h>
+#include <linux/delay.h>
+#include <linux/module.h>
+#include <linux/lockdep.h>
+#include <linux/spinlock.h>
+#include <linux/kallsyms.h>
+#include <linux/interrupt.h>
+#include <linux/debug_locks.h>
+#include <linux/irqflags.h>
+
+/*
+ * Change this to 1 if you want to see the failure printouts:
+ */
+static unsigned int debug_locks_verbose;
+
+static int __init setup_debug_locks_verbose(char *str)
+{
+       get_option(&str, &debug_locks_verbose);
+
+       return 1;
+}
+
+__setup("debug_locks_verbose=", setup_debug_locks_verbose);
+
+#define FAILURE                0
+#define SUCCESS                1
+
+#define LOCKTYPE_SPIN  0x1
+#define LOCKTYPE_RWLOCK        0x2
+#define LOCKTYPE_MUTEX 0x4
+#define LOCKTYPE_RWSEM 0x8
+
+/*
+ * Normal standalone locks, for the circular and irq-context
+ * dependency tests:
+ */
+static DEFINE_SPINLOCK(lock_A);
+static DEFINE_SPINLOCK(lock_B);
+static DEFINE_SPINLOCK(lock_C);
+static DEFINE_SPINLOCK(lock_D);
+
+static DEFINE_RWLOCK(rwlock_A);
+static DEFINE_RWLOCK(rwlock_B);
+static DEFINE_RWLOCK(rwlock_C);
+static DEFINE_RWLOCK(rwlock_D);
+
+static DEFINE_MUTEX(mutex_A);
+static DEFINE_MUTEX(mutex_B);
+static DEFINE_MUTEX(mutex_C);
+static DEFINE_MUTEX(mutex_D);
+
+static DECLARE_RWSEM(rwsem_A);
+static DECLARE_RWSEM(rwsem_B);
+static DECLARE_RWSEM(rwsem_C);
+static DECLARE_RWSEM(rwsem_D);
+
+/*
+ * Locks that we initialize dynamically as well so that
+ * e.g. X1 and X2 becomes two instances of the same class,
+ * but X* and Y* are different classes. We do this so that
+ * we do not trigger a real lockup:
+ */
+static DEFINE_SPINLOCK(lock_X1);
+static DEFINE_SPINLOCK(lock_X2);
+static DEFINE_SPINLOCK(lock_Y1);
+static DEFINE_SPINLOCK(lock_Y2);
+static DEFINE_SPINLOCK(lock_Z1);
+static DEFINE_SPINLOCK(lock_Z2);
+
+static DEFINE_RWLOCK(rwlock_X1);
+static DEFINE_RWLOCK(rwlock_X2);
+static DEFINE_RWLOCK(rwlock_Y1);
+static DEFINE_RWLOCK(rwlock_Y2);
+static DEFINE_RWLOCK(rwlock_Z1);
+static DEFINE_RWLOCK(rwlock_Z2);
+
+static DEFINE_MUTEX(mutex_X1);
+static DEFINE_MUTEX(mutex_X2);
+static DEFINE_MUTEX(mutex_Y1);
+static DEFINE_MUTEX(mutex_Y2);
+static DEFINE_MUTEX(mutex_Z1);
+static DEFINE_MUTEX(mutex_Z2);
+
+static DECLARE_RWSEM(rwsem_X1);
+static DECLARE_RWSEM(rwsem_X2);
+static DECLARE_RWSEM(rwsem_Y1);
+static DECLARE_RWSEM(rwsem_Y2);
+static DECLARE_RWSEM(rwsem_Z1);
+static DECLARE_RWSEM(rwsem_Z2);
+
+/*
+ * non-inlined runtime initializers, to let separate locks share
+ * the same lock-class:
+ */
+#define INIT_CLASS_FUNC(class)                                 \
+static noinline void                                   \
+init_class_##class(spinlock_t *lock, rwlock_t *rwlock, struct mutex *mutex, \
+                struct rw_semaphore *rwsem)            \
+{                                                      \
+       spin_lock_init(lock);                           \
+       rwlock_init(rwlock);                            \
+       mutex_init(mutex);                              \
+       init_rwsem(rwsem);                              \
+}
+
+INIT_CLASS_FUNC(X)
+INIT_CLASS_FUNC(Y)
+INIT_CLASS_FUNC(Z)
+
+static void init_shared_classes(void)
+{
+       init_class_X(&lock_X1, &rwlock_X1, &mutex_X1, &rwsem_X1);
+       init_class_X(&lock_X2, &rwlock_X2, &mutex_X2, &rwsem_X2);
+
+       init_class_Y(&lock_Y1, &rwlock_Y1, &mutex_Y1, &rwsem_Y1);
+       init_class_Y(&lock_Y2, &rwlock_Y2, &mutex_Y2, &rwsem_Y2);
+
+       init_class_Z(&lock_Z1, &rwlock_Z1, &mutex_Z1, &rwsem_Z1);
+       init_class_Z(&lock_Z2, &rwlock_Z2, &mutex_Z2, &rwsem_Z2);
+}
+
+/*
+ * For spinlocks and rwlocks we also do hardirq-safe / softirq-safe tests.
+ * The following functions use a lock from a simulated hardirq/softirq
+ * context, causing the locks to be marked as hardirq-safe/softirq-safe:
+ */
+
+#define HARDIRQ_DISABLE                local_irq_disable
+#define HARDIRQ_ENABLE         local_irq_enable
+
+#define HARDIRQ_ENTER()                                \
+       local_irq_disable();                    \
+       irq_enter();                            \
+       WARN_ON(!in_irq());
+
+#define HARDIRQ_EXIT()                         \
+       __irq_exit();                           \
+       local_irq_enable();
+
+#define SOFTIRQ_DISABLE                local_bh_disable
+#define SOFTIRQ_ENABLE         local_bh_enable
+
+#define SOFTIRQ_ENTER()                                \
+               local_bh_disable();             \
+               local_irq_disable();            \
+               trace_softirq_enter();          \
+               WARN_ON(!in_softirq());
+
+#define SOFTIRQ_EXIT()                         \
+               trace_softirq_exit();           \
+               local_irq_enable();             \
+               local_bh_enable();
+
+/*
+ * Shortcuts for lock/unlock API variants, to keep
+ * the testcases compact:
+ */
+#define L(x)                   spin_lock(&lock_##x)
+#define U(x)                   spin_unlock(&lock_##x)
+#define LU(x)                  L(x); U(x)
+#define SI(x)                  spin_lock_init(&lock_##x)
+
+#define WL(x)                  write_lock(&rwlock_##x)
+#define WU(x)                  write_unlock(&rwlock_##x)
+#define WLU(x)                 WL(x); WU(x)
+
+#define RL(x)                  read_lock(&rwlock_##x)
+#define RU(x)                  read_unlock(&rwlock_##x)
+#define RLU(x)                 RL(x); RU(x)
+#define RWI(x)                 rwlock_init(&rwlock_##x)
+
+#define ML(x)                  mutex_lock(&mutex_##x)
+#define MU(x)                  mutex_unlock(&mutex_##x)
+#define MI(x)                  mutex_init(&mutex_##x)
+
+#define WSL(x)                 down_write(&rwsem_##x)
+#define WSU(x)                 up_write(&rwsem_##x)
+
+#define RSL(x)                 down_read(&rwsem_##x)
+#define RSU(x)                 up_read(&rwsem_##x)
+#define RWSI(x)                        init_rwsem(&rwsem_##x)
+
+#define LOCK_UNLOCK_2(x,y)     LOCK(x); LOCK(y); UNLOCK(y); UNLOCK(x)
+
+/*
+ * Generate different permutations of the same testcase, using
+ * the same basic lock-dependency/state events:
+ */
+
+#define GENERATE_TESTCASE(name)                        \
+                                               \
+static void name(void) { E(); }
+
+#define GENERATE_PERMUTATIONS_2_EVENTS(name)   \
+                                               \
+static void name##_12(void) { E1(); E2(); }    \
+static void name##_21(void) { E2(); E1(); }
+
+#define GENERATE_PERMUTATIONS_3_EVENTS(name)           \
+                                                       \
+static void name##_123(void) { E1(); E2(); E3(); }     \
+static void name##_132(void) { E1(); E3(); E2(); }     \
+static void name##_213(void) { E2(); E1(); E3(); }     \
+static void name##_231(void) { E2(); E3(); E1(); }     \
+static void name##_312(void) { E3(); E1(); E2(); }     \
+static void name##_321(void) { E3(); E2(); E1(); }
+
+/*
+ * AA deadlock:
+ */
+
+#define E()                                    \
+                                               \
+       LOCK(X1);                               \
+       LOCK(X2); /* this one should fail */
+
+/*
+ * 6 testcases:
+ */
+#include "locking-selftest-spin.h"
+GENERATE_TESTCASE(AA_spin)
+#include "locking-selftest-wlock.h"
+GENERATE_TESTCASE(AA_wlock)
+#include "locking-selftest-rlock.h"
+GENERATE_TESTCASE(AA_rlock)
+#include "locking-selftest-mutex.h"
+GENERATE_TESTCASE(AA_mutex)
+#include "locking-selftest-wsem.h"
+GENERATE_TESTCASE(AA_wsem)
+#include "locking-selftest-rsem.h"
+GENERATE_TESTCASE(AA_rsem)
+
+#undef E
+
+/*
+ * Special-case for read-locking, they are
+ * allowed to recurse on the same lock class:
+ */
+static void rlock_AA1(void)
+{
+       RL(X1);
+       RL(X1); // this one should NOT fail
+}
+
+static void rlock_AA1B(void)
+{
+       RL(X1);
+       RL(X2); // this one should NOT fail
+}
+
+static void rsem_AA1(void)
+{
+       RSL(X1);
+       RSL(X1); // this one should fail
+}
+
+static void rsem_AA1B(void)
+{
+       RSL(X1);
+       RSL(X2); // this one should fail
+}
+/*
+ * The mixing of read and write locks is not allowed:
+ */
+static void rlock_AA2(void)
+{
+       RL(X1);
+       WL(X2); // this one should fail
+}
+
+static void rsem_AA2(void)
+{
+       RSL(X1);
+       WSL(X2); // this one should fail
+}
+
+static void rlock_AA3(void)
+{
+       WL(X1);
+       RL(X2); // this one should fail
+}
+
+static void rsem_AA3(void)
+{
+       WSL(X1);
+       RSL(X2); // this one should fail
+}
+
+/*
+ * ABBA deadlock:
+ */
+
+#define E()                                    \
+                                               \
+       LOCK_UNLOCK_2(A, B);                    \
+       LOCK_UNLOCK_2(B, A); /* fail */
+
+/*
+ * 6 testcases:
+ */
+#include "locking-selftest-spin.h"
+GENERATE_TESTCASE(ABBA_spin)
+#include "locking-selftest-wlock.h"
+GENERATE_TESTCASE(ABBA_wlock)
+#include "locking-selftest-rlock.h"
+GENERATE_TESTCASE(ABBA_rlock)
+#include "locking-selftest-mutex.h"
+GENERATE_TESTCASE(ABBA_mutex)
+#include "locking-selftest-wsem.h"
+GENERATE_TESTCASE(ABBA_wsem)
+#include "locking-selftest-rsem.h"
+GENERATE_TESTCASE(ABBA_rsem)
+
+#undef E
+
+/*
+ * AB BC CA deadlock:
+ */
+
+#define E()                                    \
+                                               \
+       LOCK_UNLOCK_2(A, B);                    \
+       LOCK_UNLOCK_2(B, C);                    \
+       LOCK_UNLOCK_2(C, A); /* fail */
+
+/*
+ * 6 testcases:
+ */
+#include "locking-selftest-spin.h"
+GENERATE_TESTCASE(ABBCCA_spin)
+#include "locking-selftest-wlock.h"
+GENERATE_TESTCASE(ABBCCA_wlock)
+#include "locking-selftest-rlock.h"
+GENERATE_TESTCASE(ABBCCA_rlock)
+#include "locking-selftest-mutex.h"
+GENERATE_TESTCASE(ABBCCA_mutex)
+#include "locking-selftest-wsem.h"
+GENERATE_TESTCASE(ABBCCA_wsem)
+#include "locking-selftest-rsem.h"
+GENERATE_TESTCASE(ABBCCA_rsem)
+
+#undef E
+
+/*
+ * AB CA BC deadlock:
+ */
+
+#define E()                                    \
+                                               \
+       LOCK_UNLOCK_2(A, B);                    \
+       LOCK_UNLOCK_2(C, A);                    \
+       LOCK_UNLOCK_2(B, C); /* fail */
+
+/*
+ * 6 testcases:
+ */
+#include "locking-selftest-spin.h"
+GENERATE_TESTCASE(ABCABC_spin)
+#include "locking-selftest-wlock.h"
+GENERATE_TESTCASE(ABCABC_wlock)
+#include "locking-selftest-rlock.h"
+GENERATE_TESTCASE(ABCABC_rlock)
+#include "locking-selftest-mutex.h"
+GENERATE_TESTCASE(ABCABC_mutex)
+#include "locking-selftest-wsem.h"
+GENERATE_TESTCASE(ABCABC_wsem)
+#include "locking-selftest-rsem.h"
+GENERATE_TESTCASE(ABCABC_rsem)
+
+#undef E
+
+/*
+ * AB BC CD DA deadlock:
+ */
+
+#define E()                                    \
+                                               \
+       LOCK_UNLOCK_2(A, B);                    \
+       LOCK_UNLOCK_2(B, C);                    \
+       LOCK_UNLOCK_2(C, D);                    \
+       LOCK_UNLOCK_2(D, A); /* fail */
+
+/*
+ * 6 testcases:
+ */
+#include "locking-selftest-spin.h"
+GENERATE_TESTCASE(ABBCCDDA_spin)
+#include "locking-selftest-wlock.h"
+GENERATE_TESTCASE(ABBCCDDA_wlock)
+#include "locking-selftest-rlock.h"
+GENERATE_TESTCASE(ABBCCDDA_rlock)
+#include "locking-selftest-mutex.h"
+GENERATE_TESTCASE(ABBCCDDA_mutex)
+#include "locking-selftest-wsem.h"
+GENERATE_TESTCASE(ABBCCDDA_wsem)
+#include "locking-selftest-rsem.h"
+GENERATE_TESTCASE(ABBCCDDA_rsem)
+
+#undef E
+
+/*
+ * AB CD BD DA deadlock:
+ */
+#define E()                                    \
+                                               \
+       LOCK_UNLOCK_2(A, B);                    \
+       LOCK_UNLOCK_2(C, D);                    \
+       LOCK_UNLOCK_2(B, D);                    \
+       LOCK_UNLOCK_2(D, A); /* fail */
+
+/*
+ * 6 testcases:
+ */
+#include "locking-selftest-spin.h"
+GENERATE_TESTCASE(ABCDBDDA_spin)
+#include "locking-selftest-wlock.h"
+GENERATE_TESTCASE(ABCDBDDA_wlock)
+#include "locking-selftest-rlock.h"
+GENERATE_TESTCASE(ABCDBDDA_rlock)
+#include "locking-selftest-mutex.h"
+GENERATE_TESTCASE(ABCDBDDA_mutex)
+#include "locking-selftest-wsem.h"
+GENERATE_TESTCASE(ABCDBDDA_wsem)
+#include "locking-selftest-rsem.h"
+GENERATE_TESTCASE(ABCDBDDA_rsem)
+
+#undef E
+
+/*
+ * AB CD BC DA deadlock:
+ */
+#define E()                                    \
+                                               \
+       LOCK_UNLOCK_2(A, B);                    \
+       LOCK_UNLOCK_2(C, D);                    \
+       LOCK_UNLOCK_2(B, C);                    \
+       LOCK_UNLOCK_2(D, A); /* fail */
+
+/*
+ * 6 testcases:
+ */
+#include "locking-selftest-spin.h"
+GENERATE_TESTCASE(ABCDBCDA_spin)
+#include "locking-selftest-wlock.h"
+GENERATE_TESTCASE(ABCDBCDA_wlock)
+#include "locking-selftest-rlock.h"
+GENERATE_TESTCASE(ABCDBCDA_rlock)
+#include "locking-selftest-mutex.h"
+GENERATE_TESTCASE(ABCDBCDA_mutex)
+#include "locking-selftest-wsem.h"
+GENERATE_TESTCASE(ABCDBCDA_wsem)
+#include "locking-selftest-rsem.h"
+GENERATE_TESTCASE(ABCDBCDA_rsem)
+
+#undef E
+
+/*
+ * Double unlock:
+ */
+#define E()                                    \
+                                               \
+       LOCK(A);                                \
+       UNLOCK(A);                              \
+       UNLOCK(A); /* fail */
+
+/*
+ * 6 testcases:
+ */
+#include "locking-selftest-spin.h"
+GENERATE_TESTCASE(double_unlock_spin)
+#include "locking-selftest-wlock.h"
+GENERATE_TESTCASE(double_unlock_wlock)
+#include "locking-selftest-rlock.h"
+GENERATE_TESTCASE(double_unlock_rlock)
+#include "locking-selftest-mutex.h"
+GENERATE_TESTCASE(double_unlock_mutex)
+#include "locking-selftest-wsem.h"
+GENERATE_TESTCASE(double_unlock_wsem)
+#include "locking-selftest-rsem.h"
+GENERATE_TESTCASE(double_unlock_rsem)
+
+#undef E
+
+/*
+ * Bad unlock ordering:
+ */
+#define E()                                    \
+                                               \
+       LOCK(A);                                \
+       LOCK(B);                                \
+       UNLOCK(A); /* fail */                   \
+       UNLOCK(B);
+
+/*
+ * 6 testcases:
+ */
+#include "locking-selftest-spin.h"
+GENERATE_TESTCASE(bad_unlock_order_spin)
+#include "locking-selftest-wlock.h"
+GENERATE_TESTCASE(bad_unlock_order_wlock)
+#include "locking-selftest-rlock.h"
+GENERATE_TESTCASE(bad_unlock_order_rlock)
+#include "locking-selftest-mutex.h"
+GENERATE_TESTCASE(bad_unlock_order_mutex)
+#include "locking-selftest-wsem.h"
+GENERATE_TESTCASE(bad_unlock_order_wsem)
+#include "locking-selftest-rsem.h"
+GENERATE_TESTCASE(bad_unlock_order_rsem)
+
+#undef E
+
+/*
+ * initializing a held lock:
+ */
+#define E()                                    \
+                                               \
+       LOCK(A);                                \
+       INIT(A); /* fail */
+
+/*
+ * 6 testcases:
+ */
+#include "locking-selftest-spin.h"
+GENERATE_TESTCASE(init_held_spin)
+#include "locking-selftest-wlock.h"
+GENERATE_TESTCASE(init_held_wlock)
+#include "locking-selftest-rlock.h"
+GENERATE_TESTCASE(init_held_rlock)
+#include "locking-selftest-mutex.h"
+GENERATE_TESTCASE(init_held_mutex)
+#include "locking-selftest-wsem.h"
+GENERATE_TESTCASE(init_held_wsem)
+#include "locking-selftest-rsem.h"
+GENERATE_TESTCASE(init_held_rsem)
+
+#undef E
+
+/*
+ * locking an irq-safe lock with irqs enabled:
+ */
+#define E1()                           \
+                                       \
+       IRQ_ENTER();                    \
+       LOCK(A);                        \
+       UNLOCK(A);                      \
+       IRQ_EXIT();
+
+#define E2()                           \
+                                       \
+       LOCK(A);                        \
+       UNLOCK(A);
+
+/*
+ * Generate 24 testcases:
+ */
+#include "locking-selftest-spin-hardirq.h"
+GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_hard_spin)
+
+#include "locking-selftest-rlock-hardirq.h"
+GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_hard_rlock)
+
+#include "locking-selftest-wlock-hardirq.h"
+GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_hard_wlock)
+
+#include "locking-selftest-spin-softirq.h"
+GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_soft_spin)
+
+#include "locking-selftest-rlock-softirq.h"
+GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_soft_rlock)
+
+#include "locking-selftest-wlock-softirq.h"
+GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_soft_wlock)
+
+#undef E1
+#undef E2
+
+/*
+ * Enabling hardirqs with a softirq-safe lock held:
+ */
+#define E1()                           \
+                                       \
+       SOFTIRQ_ENTER();                \
+       LOCK(A);                        \
+       UNLOCK(A);                      \
+       SOFTIRQ_EXIT();
+
+#define E2()                           \
+                                       \
+       HARDIRQ_DISABLE();              \
+       LOCK(A);                        \
+       HARDIRQ_ENABLE();               \
+       UNLOCK(A);
+
+/*
+ * Generate 12 testcases:
+ */
+#include "locking-selftest-spin.h"
+GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2A_spin)
+
+#include "locking-selftest-wlock.h"
+GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2A_wlock)
+
+#include "locking-selftest-rlock.h"
+GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2A_rlock)
+
+#undef E1
+#undef E2
+
+/*
+ * Enabling irqs with an irq-safe lock held:
+ */
+#define E1()                           \
+                                       \
+       IRQ_ENTER();                    \
+       LOCK(A);                        \
+       UNLOCK(A);                      \
+       IRQ_EXIT();
+
+#define E2()                           \
+                                       \
+       IRQ_DISABLE();                  \
+       LOCK(A);                        \
+       IRQ_ENABLE();                   \
+       UNLOCK(A);
+
+/*
+ * Generate 24 testcases:
+ */
+#include "locking-selftest-spin-hardirq.h"
+GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_hard_spin)
+
+#include "locking-selftest-rlock-hardirq.h"
+GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_hard_rlock)
+
+#include "locking-selftest-wlock-hardirq.h"
+GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_hard_wlock)
+
+#include "locking-selftest-spin-softirq.h"
+GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_soft_spin)
+
+#include "locking-selftest-rlock-softirq.h"
+GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_soft_rlock)
+
+#include "locking-selftest-wlock-softirq.h"
+GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_soft_wlock)
+
+#undef E1
+#undef E2
+
+/*
+ * Acquiring a irq-unsafe lock while holding an irq-safe-lock:
+ */
+#define E1()                           \
+                                       \
+       LOCK(A);                        \
+       LOCK(B);                        \
+       UNLOCK(B);                      \
+       UNLOCK(A);                      \
+
+#define E2()                           \
+                                       \
+       LOCK(B);                        \
+       UNLOCK(B);
+
+#define E3()                           \
+                                       \
+       IRQ_ENTER();                    \
+       LOCK(A);                        \
+       UNLOCK(A);                      \
+       IRQ_EXIT();
+
+/*
+ * Generate 36 testcases:
+ */
+#include "locking-selftest-spin-hardirq.h"
+GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_hard_spin)
+
+#include "locking-selftest-rlock-hardirq.h"
+GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_hard_rlock)
+
+#include "locking-selftest-wlock-hardirq.h"
+GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_hard_wlock)
+
+#include "locking-selftest-spin-softirq.h"
+GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_soft_spin)
+
+#include "locking-selftest-rlock-softirq.h"
+GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_soft_rlock)
+
+#include "locking-selftest-wlock-softirq.h"
+GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_soft_wlock)
+
+#undef E1
+#undef E2
+#undef E3
+
+/*
+ * If a lock turns into softirq-safe, but earlier it took
+ * a softirq-unsafe lock:
+ */
+
+#define E1()                           \
+       IRQ_DISABLE();                  \
+       LOCK(A);                        \
+       LOCK(B);                        \
+       UNLOCK(B);                      \
+       UNLOCK(A);                      \
+       IRQ_ENABLE();
+
+#define E2()                           \
+       LOCK(B);                        \
+       UNLOCK(B);
+
+#define E3()                           \
+       IRQ_ENTER();                    \
+       LOCK(A);                        \
+       UNLOCK(A);                      \
+       IRQ_EXIT();
+
+/*
+ * Generate 36 testcases:
+ */
+#include "locking-selftest-spin-hardirq.h"
+GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_hard_spin)
+
+#include "locking-selftest-rlock-hardirq.h"
+GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_hard_rlock)
+
+#include "locking-selftest-wlock-hardirq.h"
+GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_hard_wlock)
+
+#include "locking-selftest-spin-softirq.h"
+GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_soft_spin)
+
+#include "locking-selftest-rlock-softirq.h"
+GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_soft_rlock)
+
+#include "locking-selftest-wlock-softirq.h"
+GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_soft_wlock)
+
+#undef E1
+#undef E2
+#undef E3
+
+/*
+ * read-lock / write-lock irq inversion.
+ *
+ * Deadlock scenario:
+ *
+ * CPU#1 is at #1, i.e. it has write-locked A, but has not
+ * taken B yet.
+ *
+ * CPU#2 is at #2, i.e. it has locked B.
+ *
+ * Hardirq hits CPU#2 at point #2 and is trying to read-lock A.
+ *
+ * The deadlock occurs because CPU#1 will spin on B, and CPU#2
+ * will spin on A.
+ */
+
+#define E1()                           \
+                                       \
+       IRQ_DISABLE();                  \
+       WL(A);                          \
+       LOCK(B);                        \
+       UNLOCK(B);                      \
+       WU(A);                          \
+       IRQ_ENABLE();
+
+#define E2()                           \
+                                       \
+       LOCK(B);                        \
+       UNLOCK(B);
+
+#define E3()                           \
+                                       \
+       IRQ_ENTER();                    \
+       RL(A);                          \
+       RU(A);                          \
+       IRQ_EXIT();
+
+/*
+ * Generate 36 testcases:
+ */
+#include "locking-selftest-spin-hardirq.h"
+GENERATE_PERMUTATIONS_3_EVENTS(irq_inversion_hard_spin)
+
+#include "locking-selftest-rlock-hardirq.h"
+GENERATE_PERMUTATIONS_3_EVENTS(irq_inversion_hard_rlock)
+
+#include "locking-selftest-wlock-hardirq.h"
+GENERATE_PERMUTATIONS_3_EVENTS(irq_inversion_hard_wlock)
+
+#include "locking-selftest-spin-softirq.h"
+GENERATE_PERMUTATIONS_3_EVENTS(irq_inversion_soft_spin)
+
+#include "locking-selftest-rlock-softirq.h"
+GENERATE_PERMUTATIONS_3_EVENTS(irq_inversion_soft_rlock)
+
+#include "locking-selftest-wlock-softirq.h"
+GENERATE_PERMUTATIONS_3_EVENTS(irq_inversion_soft_wlock)
+
+#undef E1
+#undef E2
+#undef E3
+
+/*
+ * read-lock / write-lock recursion that is actually safe.
+ */
+
+#define E1()                           \
+                                       \
+       IRQ_DISABLE();                  \
+       WL(A);                          \
+       WU(A);                          \
+       IRQ_ENABLE();
+
+#define E2()                           \
+                                       \
+       RL(A);                          \
+       RU(A);                          \
+
+#define E3()                           \
+                                       \
+       IRQ_ENTER();                    \
+       RL(A);                          \
+       L(B);                           \
+       U(B);                           \
+       RU(A);                          \
+       IRQ_EXIT();
+
+/*
+ * Generate 12 testcases:
+ */
+#include "locking-selftest-hardirq.h"
+GENERATE_PERMUTATIONS_3_EVENTS(irq_read_recursion_hard)
+
+#include "locking-selftest-softirq.h"
+GENERATE_PERMUTATIONS_3_EVENTS(irq_read_recursion_soft)
+
+#undef E1
+#undef E2
+#undef E3
+
+/*
+ * read-lock / write-lock recursion that is unsafe.
+ */
+
+#define E1()                           \
+                                       \
+       IRQ_DISABLE();                  \
+       L(B);                           \
+       WL(A);                          \
+       WU(A);                          \
+       U(B);                           \
+       IRQ_ENABLE();
+
+#define E2()                           \
+                                       \
+       RL(A);                          \
+       RU(A);                          \
+
+#define E3()                           \
+                                       \
+       IRQ_ENTER();                    \
+       L(B);                           \
+       U(B);                           \
+       IRQ_EXIT();
+
+/*
+ * Generate 12 testcases:
+ */
+#include "locking-selftest-hardirq.h"
+// GENERATE_PERMUTATIONS_3_EVENTS(irq_read_recursion2_hard)
+
+#include "locking-selftest-softirq.h"
+// GENERATE_PERMUTATIONS_3_EVENTS(irq_read_recursion2_soft)
+
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+# define I_SPINLOCK(x) lockdep_reset_lock(&lock_##x.dep_map)
+# define I_RWLOCK(x)   lockdep_reset_lock(&rwlock_##x.dep_map)
+# define I_MUTEX(x)    lockdep_reset_lock(&mutex_##x.dep_map)
+# define I_RWSEM(x)    lockdep_reset_lock(&rwsem_##x.dep_map)
+#else
+# define I_SPINLOCK(x)
+# define I_RWLOCK(x)
+# define I_MUTEX(x)
+# define I_RWSEM(x)
+#endif
+
+#define I1(x)                                  \
+       do {                                    \
+               I_SPINLOCK(x);                  \
+               I_RWLOCK(x);                    \
+               I_MUTEX(x);                     \
+               I_RWSEM(x);                     \
+       } while (0)
+
+#define I2(x)                                  \
+       do {                                    \
+               spin_lock_init(&lock_##x);      \
+               rwlock_init(&rwlock_##x);       \
+               mutex_init(&mutex_##x);         \
+               init_rwsem(&rwsem_##x);         \
+       } while (0)
+
+static void reset_locks(void)
+{
+       local_irq_disable();
+       I1(A); I1(B); I1(C); I1(D);
+       I1(X1); I1(X2); I1(Y1); I1(Y2); I1(Z1); I1(Z2);
+       lockdep_reset();
+       I2(A); I2(B); I2(C); I2(D);
+       init_shared_classes();
+       local_irq_enable();
+}
+
+#undef I
+
+static int testcase_total;
+static int testcase_successes;
+static int expected_testcase_failures;
+static int unexpected_testcase_failures;
+
+static void dotest(void (*testcase_fn)(void), int expected, int lockclass_mask)
+{
+       unsigned long saved_preempt_count = preempt_count();
+       int expected_failure = 0;
+
+       WARN_ON(irqs_disabled());
+
+       testcase_fn();
+       /*
+        * Filter out expected failures:
+        */
+#ifndef CONFIG_PROVE_LOCKING
+       if ((lockclass_mask & LOCKTYPE_SPIN) && debug_locks != expected)
+               expected_failure = 1;
+       if ((lockclass_mask & LOCKTYPE_RWLOCK) && debug_locks != expected)
+               expected_failure = 1;
+       if ((lockclass_mask & LOCKTYPE_MUTEX) && debug_locks != expected)
+               expected_failure = 1;
+       if ((lockclass_mask & LOCKTYPE_RWSEM) && debug_locks != expected)
+               expected_failure = 1;
+#endif
+       if (debug_locks != expected) {
+               if (expected_failure) {
+                       expected_testcase_failures++;
+                       printk("failed|");
+               } else {
+                       unexpected_testcase_failures++;
+                       printk("FAILED|");
+               }
+       } else {
+               testcase_successes++;
+               printk("  ok  |");
+       }
+       testcase_total++;
+
+       if (debug_locks_verbose)
+               printk(" lockclass mask: %x, debug_locks: %d, expected: %d\n",
+                       lockclass_mask, debug_locks, expected);
+       /*
+        * Some tests (e.g. double-unlock) might corrupt the preemption
+        * count, so restore it:
+        */
+       preempt_count() = saved_preempt_count;
+#ifdef CONFIG_TRACE_IRQFLAGS
+       if (softirq_count())
+               current->softirqs_enabled = 0;
+       else
+               current->softirqs_enabled = 1;
+#endif
+
+       reset_locks();
+}
+
+static inline void print_testname(const char *testname)
+{
+       printk("%33s:", testname);
+}
+
+#define DO_TESTCASE_1(desc, name, nr)                          \
+       print_testname(desc"/"#nr);                             \
+       dotest(name##_##nr, SUCCESS, LOCKTYPE_RWLOCK);          \
+       printk("\n");
+
+#define DO_TESTCASE_1B(desc, name, nr)                         \
+       print_testname(desc"/"#nr);                             \
+       dotest(name##_##nr, FAILURE, LOCKTYPE_RWLOCK);          \
+       printk("\n");
+
+#define DO_TESTCASE_3(desc, name, nr)                          \
+       print_testname(desc"/"#nr);                             \
+       dotest(name##_spin_##nr, FAILURE, LOCKTYPE_SPIN);       \
+       dotest(name##_wlock_##nr, FAILURE, LOCKTYPE_RWLOCK);    \
+       dotest(name##_rlock_##nr, SUCCESS, LOCKTYPE_RWLOCK);    \
+       printk("\n");
+
+#define DO_TESTCASE_3RW(desc, name, nr)                                \
+       print_testname(desc"/"#nr);                             \
+       dotest(name##_spin_##nr, FAILURE, LOCKTYPE_SPIN|LOCKTYPE_RWLOCK);\
+       dotest(name##_wlock_##nr, FAILURE, LOCKTYPE_RWLOCK);    \
+       dotest(name##_rlock_##nr, SUCCESS, LOCKTYPE_RWLOCK);    \
+       printk("\n");
+
+#define DO_TESTCASE_6(desc, name)                              \
+       print_testname(desc);                                   \
+       dotest(name##_spin, FAILURE, LOCKTYPE_SPIN);            \
+       dotest(name##_wlock, FAILURE, LOCKTYPE_RWLOCK);         \
+       dotest(name##_rlock, FAILURE, LOCKTYPE_RWLOCK);         \
+       dotest(name##_mutex, FAILURE, LOCKTYPE_MUTEX);          \
+       dotest(name##_wsem, FAILURE, LOCKTYPE_RWSEM);           \
+       dotest(name##_rsem, FAILURE, LOCKTYPE_RWSEM);           \
+       printk("\n");
+
+#define DO_TESTCASE_6_SUCCESS(desc, name)                      \
+       print_testname(desc);                                   \
+       dotest(name##_spin, SUCCESS, LOCKTYPE_SPIN);            \
+       dotest(name##_wlock, SUCCESS, LOCKTYPE_RWLOCK);         \
+       dotest(name##_rlock, SUCCESS, LOCKTYPE_RWLOCK);         \
+       dotest(name##_mutex, SUCCESS, LOCKTYPE_MUTEX);          \
+       dotest(name##_wsem, SUCCESS, LOCKTYPE_RWSEM);           \
+       dotest(name##_rsem, SUCCESS, LOCKTYPE_RWSEM);           \
+       printk("\n");
+
+/*
+ * 'read' variant: rlocks must not trigger.
+ */
+#define DO_TESTCASE_6R(desc, name)                             \
+       print_testname(desc);                                   \
+       dotest(name##_spin, FAILURE, LOCKTYPE_SPIN);            \
+       dotest(name##_wlock, FAILURE, LOCKTYPE_RWLOCK);         \
+       dotest(name##_rlock, SUCCESS, LOCKTYPE_RWLOCK);         \
+       dotest(name##_mutex, FAILURE, LOCKTYPE_MUTEX);          \
+       dotest(name##_wsem, FAILURE, LOCKTYPE_RWSEM);           \
+       dotest(name##_rsem, FAILURE, LOCKTYPE_RWSEM);           \
+       printk("\n");
+
+#define DO_TESTCASE_2I(desc, name, nr)                         \
+       DO_TESTCASE_1("hard-"desc, name##_hard, nr);            \
+       DO_TESTCASE_1("soft-"desc, name##_soft, nr);
+
+#define DO_TESTCASE_2IB(desc, name, nr)                                \
+       DO_TESTCASE_1B("hard-"desc, name##_hard, nr);           \
+       DO_TESTCASE_1B("soft-"desc, name##_soft, nr);
+
+#define DO_TESTCASE_6I(desc, name, nr)                         \
+       DO_TESTCASE_3("hard-"desc, name##_hard, nr);            \
+       DO_TESTCASE_3("soft-"desc, name##_soft, nr);
+
+#define DO_TESTCASE_6IRW(desc, name, nr)                       \
+       DO_TESTCASE_3RW("hard-"desc, name##_hard, nr);          \
+       DO_TESTCASE_3RW("soft-"desc, name##_soft, nr);
+
+#define DO_TESTCASE_2x3(desc, name)                            \
+       DO_TESTCASE_3(desc, name, 12);                          \
+       DO_TESTCASE_3(desc, name, 21);
+
+#define DO_TESTCASE_2x6(desc, name)                            \
+       DO_TESTCASE_6I(desc, name, 12);                         \
+       DO_TESTCASE_6I(desc, name, 21);
+
+#define DO_TESTCASE_6x2(desc, name)                            \
+       DO_TESTCASE_2I(desc, name, 123);                        \
+       DO_TESTCASE_2I(desc, name, 132);                        \
+       DO_TESTCASE_2I(desc, name, 213);                        \
+       DO_TESTCASE_2I(desc, name, 231);                        \
+       DO_TESTCASE_2I(desc, name, 312);                        \
+       DO_TESTCASE_2I(desc, name, 321);
+
+#define DO_TESTCASE_6x2B(desc, name)                           \
+       DO_TESTCASE_2IB(desc, name, 123);                       \
+       DO_TESTCASE_2IB(desc, name, 132);                       \
+       DO_TESTCASE_2IB(desc, name, 213);                       \
+       DO_TESTCASE_2IB(desc, name, 231);                       \
+       DO_TESTCASE_2IB(desc, name, 312);                       \
+       DO_TESTCASE_2IB(desc, name, 321);
+
+#define DO_TESTCASE_6x6(desc, name)                            \
+       DO_TESTCASE_6I(desc, name, 123);                        \
+       DO_TESTCASE_6I(desc, name, 132);                        \
+       DO_TESTCASE_6I(desc, name, 213);                        \
+       DO_TESTCASE_6I(desc, name, 231);                        \
+       DO_TESTCASE_6I(desc, name, 312);                        \
+       DO_TESTCASE_6I(desc, name, 321);
+
+#define DO_TESTCASE_6x6RW(desc, name)                          \
+       DO_TESTCASE_6IRW(desc, name, 123);                      \
+       DO_TESTCASE_6IRW(desc, name, 132);                      \
+       DO_TESTCASE_6IRW(desc, name, 213);                      \
+       DO_TESTCASE_6IRW(desc, name, 231);                      \
+       DO_TESTCASE_6IRW(desc, name, 312);                      \
+       DO_TESTCASE_6IRW(desc, name, 321);
+
+
+void locking_selftest(void)
+{
+       /*
+        * Got a locking failure before the selftest ran?
+        */
+       if (!debug_locks) {
+               printk("----------------------------------\n");
+               printk("| Locking API testsuite disabled |\n");
+               printk("----------------------------------\n");
+               return;
+       }
+
+       /*
+        * Run the testsuite:
+        */
+       printk("------------------------\n");
+       printk("| Locking API testsuite:\n");
+       printk("----------------------------------------------------------------------------\n");
+       printk("                                 | spin |wlock |rlock |mutex | wsem | rsem |\n");
+       printk("  --------------------------------------------------------------------------\n");
+
+       init_shared_classes();
+       debug_locks_silent = !debug_locks_verbose;
+
+       DO_TESTCASE_6R("A-A deadlock", AA);
+       DO_TESTCASE_6R("A-B-B-A deadlock", ABBA);
+       DO_TESTCASE_6R("A-B-B-C-C-A deadlock", ABBCCA);
+       DO_TESTCASE_6R("A-B-C-A-B-C deadlock", ABCABC);
+       DO_TESTCASE_6R("A-B-B-C-C-D-D-A deadlock", ABBCCDDA);
+       DO_TESTCASE_6R("A-B-C-D-B-D-D-A deadlock", ABCDBDDA);
+       DO_TESTCASE_6R("A-B-C-D-B-C-D-A deadlock", ABCDBCDA);
+       DO_TESTCASE_6("double unlock", double_unlock);
+       DO_TESTCASE_6("initialize held", init_held);
+       DO_TESTCASE_6_SUCCESS("bad unlock order", bad_unlock_order);
+
+       printk("  --------------------------------------------------------------------------\n");
+       print_testname("recursive read-lock");
+       printk("             |");
+       dotest(rlock_AA1, SUCCESS, LOCKTYPE_RWLOCK);
+       printk("             |");
+       dotest(rsem_AA1, FAILURE, LOCKTYPE_RWSEM);
+       printk("\n");
+
+       print_testname("recursive read-lock #2");
+       printk("             |");
+       dotest(rlock_AA1B, SUCCESS, LOCKTYPE_RWLOCK);
+       printk("             |");
+       dotest(rsem_AA1B, FAILURE, LOCKTYPE_RWSEM);
+       printk("\n");
+
+       print_testname("mixed read-write-lock");
+       printk("             |");
+       dotest(rlock_AA2, FAILURE, LOCKTYPE_RWLOCK);
+       printk("             |");
+       dotest(rsem_AA2, FAILURE, LOCKTYPE_RWSEM);
+       printk("\n");
+
+       print_testname("mixed write-read-lock");
+       printk("             |");
+       dotest(rlock_AA3, FAILURE, LOCKTYPE_RWLOCK);
+       printk("             |");
+       dotest(rsem_AA3, FAILURE, LOCKTYPE_RWSEM);
+       printk("\n");
+
+       printk("  --------------------------------------------------------------------------\n");
+
+       /*
+        * irq-context testcases:
+        */
+       DO_TESTCASE_2x6("irqs-on + irq-safe-A", irqsafe1);
+       DO_TESTCASE_2x3("sirq-safe-A => hirqs-on", irqsafe2A);
+       DO_TESTCASE_2x6("safe-A + irqs-on", irqsafe2B);
+       DO_TESTCASE_6x6("safe-A + unsafe-B #1", irqsafe3);
+       DO_TESTCASE_6x6("safe-A + unsafe-B #2", irqsafe4);
+       DO_TESTCASE_6x6RW("irq lock-inversion", irq_inversion);
+
+       DO_TESTCASE_6x2("irq read-recursion", irq_read_recursion);
+//     DO_TESTCASE_6x2B("irq read-recursion #2", irq_read_recursion2);
+
+       if (unexpected_testcase_failures) {
+               printk("-----------------------------------------------------------------\n");
+               debug_locks = 0;
+               printk("BUG: %3d unexpected failures (out of %3d) - debugging disabled! |\n",
+                       unexpected_testcase_failures, testcase_total);
+               printk("-----------------------------------------------------------------\n");
+       } else if (expected_testcase_failures && testcase_successes) {
+               printk("--------------------------------------------------------\n");
+               printk("%3d out of %3d testcases failed, as expected. |\n",
+                       expected_testcase_failures, testcase_total);
+               printk("----------------------------------------------------\n");
+               debug_locks = 1;
+       } else if (expected_testcase_failures && !testcase_successes) {
+               printk("--------------------------------------------------------\n");
+               printk("All %3d testcases failed, as expected. |\n",
+                       expected_testcase_failures);
+               printk("----------------------------------------\n");
+               debug_locks = 1;
+       } else {
+               printk("-------------------------------------------------------\n");
+               printk("Good, all %3d testcases passed! |\n",
+                       testcase_successes);
+               printk("---------------------------------\n");
+               debug_locks = 1;
+       }
+       debug_locks_silent = 0;
+}
index 40ffde940a86522dedca220e359367f436bb9023..db4fed74b9407d5ec2ddae1a95247f583ab0d569 100644 (file)
@@ -17,27 +17,22 @@ struct rwsem_waiter {
 #define RWSEM_WAITING_FOR_WRITE        0x00000002
 };
 
-#if RWSEM_DEBUG
-void rwsemtrace(struct rw_semaphore *sem, const char *str)
-{
-       if (sem->debug)
-               printk("[%d] %s({%d,%d})\n",
-                      current->pid, str, sem->activity,
-                      list_empty(&sem->wait_list) ? 0 : 1);
-}
-#endif
-
 /*
  * initialise the semaphore
  */
-void fastcall init_rwsem(struct rw_semaphore *sem)
+void __init_rwsem(struct rw_semaphore *sem, const char *name,
+                 struct lock_class_key *key)
 {
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+       /*
+        * Make sure we are not reinitializing a held semaphore:
+        */
+       debug_check_no_locks_freed((void *)sem, sizeof(*sem));
+       lockdep_init_map(&sem->dep_map, name, key);
+#endif
        sem->activity = 0;
        spin_lock_init(&sem->wait_lock);
        INIT_LIST_HEAD(&sem->wait_list);
-#if RWSEM_DEBUG
-       sem->debug = 0;
-#endif
 }
 
 /*
@@ -56,8 +51,6 @@ __rwsem_do_wake(struct rw_semaphore *sem, int wakewrite)
        struct task_struct *tsk;
        int woken;
 
-       rwsemtrace(sem, "Entering __rwsem_do_wake");
-
        waiter = list_entry(sem->wait_list.next, struct rwsem_waiter, list);
 
        if (!wakewrite) {
@@ -104,7 +97,6 @@ __rwsem_do_wake(struct rw_semaphore *sem, int wakewrite)
        sem->activity += woken;
 
  out:
-       rwsemtrace(sem, "Leaving __rwsem_do_wake");
        return sem;
 }
 
@@ -138,8 +130,6 @@ void fastcall __sched __down_read(struct rw_semaphore *sem)
        struct rwsem_waiter waiter;
        struct task_struct *tsk;
 
-       rwsemtrace(sem, "Entering __down_read");
-
        spin_lock_irq(&sem->wait_lock);
 
        if (sem->activity >= 0 && list_empty(&sem->wait_list)) {
@@ -171,9 +161,8 @@ void fastcall __sched __down_read(struct rw_semaphore *sem)
        }
 
        tsk->state = TASK_RUNNING;
-
  out:
-       rwsemtrace(sem, "Leaving __down_read");
+       ;
 }
 
 /*
@@ -184,7 +173,6 @@ int fastcall __down_read_trylock(struct rw_semaphore *sem)
        unsigned long flags;
        int ret = 0;
 
-       rwsemtrace(sem, "Entering __down_read_trylock");
 
        spin_lock_irqsave(&sem->wait_lock, flags);
 
@@ -196,7 +184,6 @@ int fastcall __down_read_trylock(struct rw_semaphore *sem)
 
        spin_unlock_irqrestore(&sem->wait_lock, flags);
 
-       rwsemtrace(sem, "Leaving __down_read_trylock");
        return ret;
 }
 
@@ -204,13 +191,11 @@ int fastcall __down_read_trylock(struct rw_semaphore *sem)
  * get a write lock on the semaphore
  * - we increment the waiting count anyway to indicate an exclusive lock
  */
-void fastcall __sched __down_write(struct rw_semaphore *sem)
+void fastcall __sched __down_write_nested(struct rw_semaphore *sem, int subclass)
 {
        struct rwsem_waiter waiter;
        struct task_struct *tsk;
 
-       rwsemtrace(sem, "Entering __down_write");
-
        spin_lock_irq(&sem->wait_lock);
 
        if (sem->activity == 0 && list_empty(&sem->wait_list)) {
@@ -242,9 +227,13 @@ void fastcall __sched __down_write(struct rw_semaphore *sem)
        }
 
        tsk->state = TASK_RUNNING;
-
  out:
-       rwsemtrace(sem, "Leaving __down_write");
+       ;
+}
+
+void fastcall __sched __down_write(struct rw_semaphore *sem)
+{
+       __down_write_nested(sem, 0);
 }
 
 /*
@@ -255,8 +244,6 @@ int fastcall __down_write_trylock(struct rw_semaphore *sem)
        unsigned long flags;
        int ret = 0;
 
-       rwsemtrace(sem, "Entering __down_write_trylock");
-
        spin_lock_irqsave(&sem->wait_lock, flags);
 
        if (sem->activity == 0 && list_empty(&sem->wait_list)) {
@@ -267,7 +254,6 @@ int fastcall __down_write_trylock(struct rw_semaphore *sem)
 
        spin_unlock_irqrestore(&sem->wait_lock, flags);
 
-       rwsemtrace(sem, "Leaving __down_write_trylock");
        return ret;
 }
 
@@ -278,16 +264,12 @@ void fastcall __up_read(struct rw_semaphore *sem)
 {
        unsigned long flags;
 
-       rwsemtrace(sem, "Entering __up_read");
-
        spin_lock_irqsave(&sem->wait_lock, flags);
 
        if (--sem->activity == 0 && !list_empty(&sem->wait_list))
                sem = __rwsem_wake_one_writer(sem);
 
        spin_unlock_irqrestore(&sem->wait_lock, flags);
-
-       rwsemtrace(sem, "Leaving __up_read");
 }
 
 /*
@@ -297,8 +279,6 @@ void fastcall __up_write(struct rw_semaphore *sem)
 {
        unsigned long flags;
 
-       rwsemtrace(sem, "Entering __up_write");
-
        spin_lock_irqsave(&sem->wait_lock, flags);
 
        sem->activity = 0;
@@ -306,8 +286,6 @@ void fastcall __up_write(struct rw_semaphore *sem)
                sem = __rwsem_do_wake(sem, 1);
 
        spin_unlock_irqrestore(&sem->wait_lock, flags);
-
-       rwsemtrace(sem, "Leaving __up_write");
 }
 
 /*
@@ -318,8 +296,6 @@ void fastcall __downgrade_write(struct rw_semaphore *sem)
 {
        unsigned long flags;
 
-       rwsemtrace(sem, "Entering __downgrade_write");
-
        spin_lock_irqsave(&sem->wait_lock, flags);
 
        sem->activity = 1;
@@ -327,18 +303,14 @@ void fastcall __downgrade_write(struct rw_semaphore *sem)
                sem = __rwsem_do_wake(sem, 0);
 
        spin_unlock_irqrestore(&sem->wait_lock, flags);
-
-       rwsemtrace(sem, "Leaving __downgrade_write");
 }
 
-EXPORT_SYMBOL(init_rwsem);
+EXPORT_SYMBOL(__init_rwsem);
 EXPORT_SYMBOL(__down_read);
 EXPORT_SYMBOL(__down_read_trylock);
+EXPORT_SYMBOL(__down_write_nested);
 EXPORT_SYMBOL(__down_write);
 EXPORT_SYMBOL(__down_write_trylock);
 EXPORT_SYMBOL(__up_read);
 EXPORT_SYMBOL(__up_write);
 EXPORT_SYMBOL(__downgrade_write);
-#if RWSEM_DEBUG
-EXPORT_SYMBOL(rwsemtrace);
-#endif
index 62fa4eba9ffeb3066b385def40c853c4ff05a37f..b322421c2969f1e3046313e91dcd3a07aa3fca9a 100644 (file)
@@ -8,6 +8,26 @@
 #include <linux/init.h>
 #include <linux/module.h>
 
+/*
+ * Initialize an rwsem:
+ */
+void __init_rwsem(struct rw_semaphore *sem, const char *name,
+                 struct lock_class_key *key)
+{
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+       /*
+        * Make sure we are not reinitializing a held semaphore:
+        */
+       debug_check_no_locks_freed((void *)sem, sizeof(*sem));
+       lockdep_init_map(&sem->dep_map, name, key);
+#endif
+       sem->count = RWSEM_UNLOCKED_VALUE;
+       spin_lock_init(&sem->wait_lock);
+       INIT_LIST_HEAD(&sem->wait_list);
+}
+
+EXPORT_SYMBOL(__init_rwsem);
+
 struct rwsem_waiter {
        struct list_head list;
        struct task_struct *task;
@@ -16,17 +36,6 @@ struct rwsem_waiter {
 #define RWSEM_WAITING_FOR_WRITE        0x00000002
 };
 
-#if RWSEM_DEBUG
-#undef rwsemtrace
-void rwsemtrace(struct rw_semaphore *sem, const char *str)
-{
-       printk("sem=%p\n", sem);
-       printk("(sem)=%08lx\n", sem->count);
-       if (sem->debug)
-               printk("[%d] %s({%08lx})\n", current->pid, str, sem->count);
-}
-#endif
-
 /*
  * handle the lock release when processes blocked on it that can now run
  * - if we come here from up_xxxx(), then:
@@ -45,8 +54,6 @@ __rwsem_do_wake(struct rw_semaphore *sem, int downgrading)
        struct list_head *next;
        signed long oldcount, woken, loop;
 
-       rwsemtrace(sem, "Entering __rwsem_do_wake");
-
        if (downgrading)
                goto dont_wake_writers;
 
@@ -127,7 +134,6 @@ __rwsem_do_wake(struct rw_semaphore *sem, int downgrading)
        next->prev = &sem->wait_list;
 
  out:
-       rwsemtrace(sem, "Leaving __rwsem_do_wake");
        return sem;
 
        /* undo the change to count, but check for a transition 1->0 */
@@ -186,13 +192,9 @@ rwsem_down_read_failed(struct rw_semaphore *sem)
 {
        struct rwsem_waiter waiter;
 
-       rwsemtrace(sem, "Entering rwsem_down_read_failed");
-
        waiter.flags = RWSEM_WAITING_FOR_READ;
        rwsem_down_failed_common(sem, &waiter,
                                RWSEM_WAITING_BIAS - RWSEM_ACTIVE_BIAS);
-
-       rwsemtrace(sem, "Leaving rwsem_down_read_failed");
        return sem;
 }
 
@@ -204,12 +206,9 @@ rwsem_down_write_failed(struct rw_semaphore *sem)
 {
        struct rwsem_waiter waiter;
 
-       rwsemtrace(sem, "Entering rwsem_down_write_failed");
-
        waiter.flags = RWSEM_WAITING_FOR_WRITE;
        rwsem_down_failed_common(sem, &waiter, -RWSEM_ACTIVE_BIAS);
 
-       rwsemtrace(sem, "Leaving rwsem_down_write_failed");
        return sem;
 }
 
@@ -221,8 +220,6 @@ struct rw_semaphore fastcall *rwsem_wake(struct rw_semaphore *sem)
 {
        unsigned long flags;
 
-       rwsemtrace(sem, "Entering rwsem_wake");
-
        spin_lock_irqsave(&sem->wait_lock, flags);
 
        /* do nothing if list empty */
@@ -231,8 +228,6 @@ struct rw_semaphore fastcall *rwsem_wake(struct rw_semaphore *sem)
 
        spin_unlock_irqrestore(&sem->wait_lock, flags);
 
-       rwsemtrace(sem, "Leaving rwsem_wake");
-
        return sem;
 }
 
@@ -245,8 +240,6 @@ struct rw_semaphore fastcall *rwsem_downgrade_wake(struct rw_semaphore *sem)
 {
        unsigned long flags;
 
-       rwsemtrace(sem, "Entering rwsem_downgrade_wake");
-
        spin_lock_irqsave(&sem->wait_lock, flags);
 
        /* do nothing if list empty */
@@ -255,7 +248,6 @@ struct rw_semaphore fastcall *rwsem_downgrade_wake(struct rw_semaphore *sem)
 
        spin_unlock_irqrestore(&sem->wait_lock, flags);
 
-       rwsemtrace(sem, "Leaving rwsem_downgrade_wake");
        return sem;
 }
 
@@ -263,6 +255,3 @@ EXPORT_SYMBOL(rwsem_down_read_failed);
 EXPORT_SYMBOL(rwsem_down_write_failed);
 EXPORT_SYMBOL(rwsem_wake);
 EXPORT_SYMBOL(rwsem_downgrade_wake);
-#if RWSEM_DEBUG
-EXPORT_SYMBOL(rwsemtrace);
-#endif
index 4d5f18889fa54c7535dcf8fced756d4344a88afc..128180523860388004c5679394b2d64946d37c62 100644 (file)
@@ -12,7 +12,6 @@
  *
  * rw semaphores implemented November 1999 by Benjamin LaHaise <bcrl@kvack.org>
  */
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/err.h>
 #include <linux/init.h>
index d8b6bb419d49cd9fed7c6e33b7bc8c1850477f35..3d9c4dc965ed5d3f90173eff828da22fac0ccb4b 100644 (file)
@@ -6,41 +6,73 @@
  * DEBUG_SPINLOCK.
  */
 
-#include <linux/config.h>
 #include <linux/spinlock.h>
 #include <linux/interrupt.h>
+#include <linux/debug_locks.h>
 #include <linux/delay.h>
+#include <linux/module.h>
+
+void __spin_lock_init(spinlock_t *lock, const char *name,
+                     struct lock_class_key *key)
+{
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+       /*
+        * Make sure we are not reinitializing a held lock:
+        */
+       debug_check_no_locks_freed((void *)lock, sizeof(*lock));
+       lockdep_init_map(&lock->dep_map, name, key);
+#endif
+       lock->raw_lock = (raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED;
+       lock->magic = SPINLOCK_MAGIC;
+       lock->owner = SPINLOCK_OWNER_INIT;
+       lock->owner_cpu = -1;
+}
+
+EXPORT_SYMBOL(__spin_lock_init);
+
+void __rwlock_init(rwlock_t *lock, const char *name,
+                  struct lock_class_key *key)
+{
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+       /*
+        * Make sure we are not reinitializing a held lock:
+        */
+       debug_check_no_locks_freed((void *)lock, sizeof(*lock));
+       lockdep_init_map(&lock->dep_map, name, key);
+#endif
+       lock->raw_lock = (raw_rwlock_t) __RAW_RW_LOCK_UNLOCKED;
+       lock->magic = RWLOCK_MAGIC;
+       lock->owner = SPINLOCK_OWNER_INIT;
+       lock->owner_cpu = -1;
+}
+
+EXPORT_SYMBOL(__rwlock_init);
 
 static void spin_bug(spinlock_t *lock, const char *msg)
 {
-       static long print_once = 1;
        struct task_struct *owner = NULL;
 
-       if (xchg(&print_once, 0)) {
-               if (lock->owner && lock->owner != SPINLOCK_OWNER_INIT)
-                       owner = lock->owner;
-               printk(KERN_EMERG "BUG: spinlock %s on CPU#%d, %s/%d\n",
-                       msg, raw_smp_processor_id(),
-                       current->comm, current->pid);
-               printk(KERN_EMERG " lock: %p, .magic: %08x, .owner: %s/%d, "
-                               ".owner_cpu: %d\n",
-                       lock, lock->magic,
-                       owner ? owner->comm : "<none>",
-                       owner ? owner->pid : -1,
-                       lock->owner_cpu);
-               dump_stack();
-#ifdef CONFIG_SMP
-               /*
-                * We cannot continue on SMP:
-                */
-//             panic("bad locking");
-#endif
-       }
+       if (!debug_locks_off())
+               return;
+
+       if (lock->owner && lock->owner != SPINLOCK_OWNER_INIT)
+               owner = lock->owner;
+       printk(KERN_EMERG "BUG: spinlock %s on CPU#%d, %s/%d\n",
+               msg, raw_smp_processor_id(),
+               current->comm, current->pid);
+       printk(KERN_EMERG " lock: %p, .magic: %08x, .owner: %s/%d, "
+                       ".owner_cpu: %d\n",
+               lock, lock->magic,
+               owner ? owner->comm : "<none>",
+               owner ? owner->pid : -1,
+               lock->owner_cpu);
+       dump_stack();
 }
 
 #define SPIN_BUG_ON(cond, lock, msg) if (unlikely(cond)) spin_bug(lock, msg)
 
-static inline void debug_spin_lock_before(spinlock_t *lock)
+static inline void
+debug_spin_lock_before(spinlock_t *lock)
 {
        SPIN_BUG_ON(lock->magic != SPINLOCK_MAGIC, lock, "bad magic");
        SPIN_BUG_ON(lock->owner == current, lock, "recursion");
@@ -119,20 +151,13 @@ void _raw_spin_unlock(spinlock_t *lock)
 
 static void rwlock_bug(rwlock_t *lock, const char *msg)
 {
-       static long print_once = 1;
-
-       if (xchg(&print_once, 0)) {
-               printk(KERN_EMERG "BUG: rwlock %s on CPU#%d, %s/%d, %p\n",
-                       msg, raw_smp_processor_id(), current->comm,
-                       current->pid, lock);
-               dump_stack();
-#ifdef CONFIG_SMP
-               /*
-                * We cannot continue on SMP:
-                */
-               panic("bad locking");
-#endif
-       }
+       if (!debug_locks_off())
+               return;
+
+       printk(KERN_EMERG "BUG: rwlock %s on CPU#%d, %s/%d, %p\n",
+               msg, raw_smp_processor_id(), current->comm,
+               current->pid, lock);
+       dump_stack();
 }
 
 #define RWLOCK_BUG_ON(cond, lock, msg) if (unlikely(cond)) rwlock_bug(lock, msg)
index 6f3093efbd7b0f084edc5b3a85e6b71bbb357783..2cb4a437942e980979098d302efef163d3d3f9f1 100644 (file)
@@ -93,7 +93,6 @@
  * ==========================================================================
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/string.h>
index c4c1ac5fbd1aea372553ce094171ff8c152b2433..0110e4414805440968a90a14e87c4fda8093edce 100644 (file)
@@ -35,7 +35,6 @@
  *   matchings spread over multiple fragments, then go BM.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/types.h>
index ca3211206eef99bd253532c4faf03c67bd582e17..87847c2ae9e28d9330c28df80dbef75ad99206b4 100644 (file)
@@ -26,7 +26,6 @@
  *   however while in strict mode the average runtime can be better.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/string.h>
index 7fd45451b44a61e95371008305e6caa87b959a55..3ced628cab4b92dde2c3da1ca984b81e720c73c1 100644 (file)
@@ -30,7 +30,6 @@
  *   [2] See finite automation theory
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/string.h>
index 0b8f73f2ed1640a86832dafac9301b003011a91f..9dd824c11eeb9602e95fbdb9a28ffb6276acf5e0 100644 (file)
@@ -10,7 +10,7 @@ mmu-$(CONFIG_MMU)     := fremap.o highmem.o madvise.o memory.o mincore.o \
 obj-y                  := bootmem.o filemap.o mempool.o oom_kill.o fadvise.o \
                           page_alloc.o page-writeback.o pdflush.o \
                           readahead.o swap.o truncate.o vmscan.o \
-                          prio_tree.o util.o mmzone.o $(mmu-y)
+                          prio_tree.o util.o mmzone.o vmstat.o $(mmu-y)
 
 obj-$(CONFIG_SWAP)     += page_io.o swap_state.o swapfile.o thrash.o
 obj-$(CONFIG_HUGETLBFS)        += hugetlb.o
index 648f2c0c8e18896b1f979f2f31a848986cc6492b..d087fc3d3281cdeab1d751652b34702d65bf023e 100644 (file)
@@ -9,7 +9,6 @@
  * most "normal" filesystems (but you don't /have/ to use this:
  * the NFS filesystem used to do this differently, for example)
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/compiler.h>
@@ -120,7 +119,7 @@ void __remove_from_page_cache(struct page *page)
        radix_tree_delete(&mapping->page_tree, page->index);
        page->mapping = NULL;
        mapping->nrpages--;
-       pagecache_acct(-1);
+       __dec_zone_page_state(page, NR_FILE_PAGES);
 }
 
 void remove_from_page_cache(struct page *page)
@@ -449,7 +448,7 @@ int add_to_page_cache(struct page *page, struct address_space *mapping,
                        page->mapping = mapping;
                        page->index = offset;
                        mapping->nrpages++;
-                       pagecache_acct(1);
+                       __inc_zone_page_state(page, NR_FILE_PAGES);
                }
                write_unlock_irq(&mapping->tree_lock);
                radix_tree_preload_end();
@@ -1416,7 +1415,7 @@ retry_find:
                 */
                if (!did_readaround) {
                        majmin = VM_FAULT_MAJOR;
-                       inc_page_state(pgmajfault);
+                       count_vm_event(PGMAJFAULT);
                }
                did_readaround = 1;
                ra_pages = max_sane_readahead(file->f_ra.ra_pages);
@@ -1487,7 +1486,7 @@ no_cached_page:
 page_not_uptodate:
        if (!did_readaround) {
                majmin = VM_FAULT_MAJOR;
-               inc_page_state(pgmajfault);
+               count_vm_event(PGMAJFAULT);
        }
        lock_page(page);
 
index 9b274fdf9d08d66c3ec78ae396284a6a0c70ac61..9b2a5403c447a7bd0f147700a0db48df5b0b58f4 100644 (file)
@@ -315,8 +315,8 @@ static void bounce_end_io(struct bio *bio, mempool_t *pool, int err)
                if (bvec->bv_page == org_vec->bv_page)
                        continue;
 
-               mempool_free(bvec->bv_page, pool);      
-               dec_page_state(nr_bounce);
+               dec_zone_page_state(bvec->bv_page, NR_BOUNCE);
+               mempool_free(bvec->bv_page, pool);
        }
 
        bio_endio(bio_orig, bio_orig->bi_size, err);
@@ -397,7 +397,7 @@ static void __blk_queue_bounce(request_queue_t *q, struct bio **bio_orig,
                to->bv_page = mempool_alloc(pool, q->bounce_gfp);
                to->bv_len = from->bv_len;
                to->bv_offset = from->bv_offset;
-               inc_page_state(nr_bounce);
+               inc_zone_page_state(to->bv_page, NR_BOUNCE);
 
                if (rw == WRITE) {
                        char *vto, *vfrom;
index 247b5c312b9b073d1c76769a67e73d39ee8bdd39..c1e14c9e67e4da1c8696f0cc695e0b1212a302a2 100644 (file)
@@ -126,7 +126,7 @@ static void free_pte_range(struct mmu_gather *tlb, pmd_t *pmd)
        pmd_clear(pmd);
        pte_lock_deinit(page);
        pte_free_tlb(tlb, page);
-       dec_page_state(nr_page_table_pages);
+       dec_zone_page_state(page, NR_PAGETABLE);
        tlb->mm->nr_ptes--;
 }
 
@@ -311,7 +311,7 @@ int __pte_alloc(struct mm_struct *mm, pmd_t *pmd, unsigned long address)
                pte_free(new);
        } else {
                mm->nr_ptes++;
-               inc_page_state(nr_page_table_pages);
+               inc_zone_page_state(new, NR_PAGETABLE);
                pmd_populate(mm, pmd, new);
        }
        spin_unlock(&mm->page_table_lock);
@@ -503,7 +503,7 @@ again:
                return -ENOMEM;
        src_pte = pte_offset_map_nested(src_pmd, addr);
        src_ptl = pte_lockptr(src_mm, src_pmd);
-       spin_lock(src_ptl);
+       spin_lock_nested(src_ptl, SINGLE_DEPTH_NESTING);
 
        do {
                /*
@@ -1951,7 +1951,7 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma,
 
                /* Had to read the page from swap area: Major fault */
                ret = VM_FAULT_MAJOR;
-               inc_page_state(pgmajfault);
+               count_vm_event(PGMAJFAULT);
                grab_swap_token();
        }
 
@@ -2324,7 +2324,7 @@ int __handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
 
        __set_current_state(TASK_RUNNING);
 
-       inc_page_state(pgfault);
+       count_vm_event(PGFAULT);
 
        if (unlikely(is_vm_hugetlb_page(vma)))
                return hugetlb_fault(mm, vma, address, write_access);
index ea4038838b0a2b4c95a46cc3d4f1eaad25556f5f..01c9fb97c619135edce3431d265e397f49113b58 100644 (file)
@@ -4,7 +4,6 @@
  *  Copyright (C)
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/mm.h>
 #include <linux/swap.h>
index 6b9740bbf4c0199cee2096ad6e6544d4c6b8a255..e07e27e846a22981a05804aefcdbdb31d88f15be 100644 (file)
@@ -1209,10 +1209,8 @@ static struct page *alloc_page_interleave(gfp_t gfp, unsigned order,
 
        zl = NODE_DATA(nid)->node_zonelists + gfp_zone(gfp);
        page = __alloc_pages(gfp, order, zl);
-       if (page && page_zone(page) == zl->zones[0]) {
-               zone_pcp(zl->zones[0],get_cpu())->interleave_hit++;
-               put_cpu();
-       }
+       if (page && page_zone(page) == zl->zones[0])
+               inc_zone_page_state(page, NUMA_INTERLEAVE_HIT);
        return page;
 }
 
index 6446c6134b04d8a8a10993e774b2bbe8bbcbd663..c1868ecdbc5facfd8ba25835e71e05cfee9d9680 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -96,7 +96,7 @@ int __vm_enough_memory(long pages, int cap_sys_admin)
        if (sysctl_overcommit_memory == OVERCOMMIT_GUESS) {
                unsigned long n;
 
-               free = get_page_cache_size();
+               free = global_page_state(NR_FILE_PAGES);
                free += nr_swap_pages;
 
                /*
index b022370e612e990d0d9d80c12e65b0f97ba5c81e..0959ee1a4795e65b3dba523770b0d2ea4033baca 100644 (file)
@@ -5,7 +5,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/mmzone.h>
 #include <linux/module.h>
index 1903bdf65e428d88e5bf124243d99ee7ab7c51e3..7c15cf3373ad0d0e94ba6f5b74145339da0052d3 100644 (file)
@@ -97,7 +97,7 @@ static void move_ptes(struct vm_area_struct *vma, pmd_t *old_pmd,
        new_pte = pte_offset_map_nested(new_pmd, new_addr);
        new_ptl = pte_lockptr(mm, new_pmd);
        if (new_ptl != old_ptl)
-               spin_lock(new_ptl);
+               spin_lock_nested(new_ptl, SINGLE_DEPTH_NESTING);
 
        for (; old_addr < old_end; old_pte++, old_addr += PAGE_SIZE,
                                   new_pte++, new_addr += PAGE_SIZE) {
index 029fadac0fb5d1d6f89f5ddbd216ccb4004e5804..5151c44a8257aa49cecfa7ffb38572e9bad93dc4 100644 (file)
@@ -1122,7 +1122,7 @@ int __vm_enough_memory(long pages, int cap_sys_admin)
        if (sysctl_overcommit_memory == OVERCOMMIT_GUESS) {
                unsigned long n;
 
-               free = get_page_cache_size();
+               free = global_page_state(NR_FILE_PAGES);
                free += nr_swap_pages;
 
                /*
index d46ed0f1dc06e19cb9fbd61d9025873dbb78c341..b9af136e5cfa7c7e7a23cb40f25d60b11f9b11a5 100644 (file)
@@ -225,7 +225,7 @@ static struct task_struct *select_bad_process(unsigned long *ppoints)
  * CAP_SYS_RAW_IO set, send SIGTERM instead (but it's unlikely that
  * we select a process with CAP_SYS_RAW_IO set).
  */
-static void __oom_kill_task(task_t *p, const char *message)
+static void __oom_kill_task(struct task_struct *p, const char *message)
 {
        if (p->pid == 1) {
                WARN_ON(1);
@@ -255,10 +255,10 @@ static void __oom_kill_task(task_t *p, const char *message)
        force_sig(SIGKILL, p);
 }
 
-static int oom_kill_task(task_t *p, const char *message)
+static int oom_kill_task(struct task_struct *p, const char *message)
 {
        struct mm_struct *mm;
-       task_t * g, * q;
+       struct task_struct *g, *q;
 
        mm = p->mm;
 
@@ -316,7 +316,7 @@ static int oom_kill_process(struct task_struct *p, unsigned long points,
  */
 void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order)
 {
-       task_t *p;
+       struct task_struct *p;
        unsigned long points = 0;
 
        if (printk_ratelimit()) {
index 4ec7026c7bab14e1f4a9e512742e318a6630607f..e630188ccc40cb84dbc6bbf0266d22621bc23df5 100644 (file)
@@ -99,22 +99,6 @@ EXPORT_SYMBOL(laptop_mode);
 
 static void background_writeout(unsigned long _min_pages);
 
-struct writeback_state
-{
-       unsigned long nr_dirty;
-       unsigned long nr_unstable;
-       unsigned long nr_mapped;
-       unsigned long nr_writeback;
-};
-
-static void get_writeback_state(struct writeback_state *wbs)
-{
-       wbs->nr_dirty = read_page_state(nr_dirty);
-       wbs->nr_unstable = read_page_state(nr_unstable);
-       wbs->nr_mapped = read_page_state(nr_mapped);
-       wbs->nr_writeback = read_page_state(nr_writeback);
-}
-
 /*
  * Work out the current dirty-memory clamping and background writeout
  * thresholds.
@@ -133,8 +117,8 @@ static void get_writeback_state(struct writeback_state *wbs)
  * clamping level.
  */
 static void
-get_dirty_limits(struct writeback_state *wbs, long *pbackground, long *pdirty,
-               struct address_space *mapping)
+get_dirty_limits(long *pbackground, long *pdirty,
+                                       struct address_space *mapping)
 {
        int background_ratio;           /* Percentages */
        int dirty_ratio;
@@ -144,8 +128,6 @@ get_dirty_limits(struct writeback_state *wbs, long *pbackground, long *pdirty,
        unsigned long available_memory = total_pages;
        struct task_struct *tsk;
 
-       get_writeback_state(wbs);
-
 #ifdef CONFIG_HIGHMEM
        /*
         * If this mapping can only allocate from low memory,
@@ -156,7 +138,9 @@ get_dirty_limits(struct writeback_state *wbs, long *pbackground, long *pdirty,
 #endif
 
 
-       unmapped_ratio = 100 - (wbs->nr_mapped * 100) / total_pages;
+       unmapped_ratio = 100 - ((global_page_state(NR_FILE_MAPPED) +
+                               global_page_state(NR_ANON_PAGES)) * 100) /
+                                       total_pages;
 
        dirty_ratio = vm_dirty_ratio;
        if (dirty_ratio > unmapped_ratio / 2)
@@ -189,7 +173,6 @@ get_dirty_limits(struct writeback_state *wbs, long *pbackground, long *pdirty,
  */
 static void balance_dirty_pages(struct address_space *mapping)
 {
-       struct writeback_state wbs;
        long nr_reclaimable;
        long background_thresh;
        long dirty_thresh;
@@ -207,11 +190,12 @@ static void balance_dirty_pages(struct address_space *mapping)
                        .range_cyclic   = 1,
                };
 
-               get_dirty_limits(&wbs, &background_thresh,
-                                       &dirty_thresh, mapping);
-               nr_reclaimable = wbs.nr_dirty + wbs.nr_unstable;
-               if (nr_reclaimable + wbs.nr_writeback <= dirty_thresh)
-                       break;
+               get_dirty_limits(&background_thresh, &dirty_thresh, mapping);
+               nr_reclaimable = global_page_state(NR_FILE_DIRTY) +
+                                       global_page_state(NR_UNSTABLE_NFS);
+               if (nr_reclaimable + global_page_state(NR_WRITEBACK) <=
+                       dirty_thresh)
+                               break;
 
                if (!dirty_exceeded)
                        dirty_exceeded = 1;
@@ -224,11 +208,14 @@ static void balance_dirty_pages(struct address_space *mapping)
                 */
                if (nr_reclaimable) {
                        writeback_inodes(&wbc);
-                       get_dirty_limits(&wbs, &background_thresh,
-                                       &dirty_thresh, mapping);
-                       nr_reclaimable = wbs.nr_dirty + wbs.nr_unstable;
-                       if (nr_reclaimable + wbs.nr_writeback <= dirty_thresh)
-                               break;
+                       get_dirty_limits(&background_thresh,
+                                               &dirty_thresh, mapping);
+                       nr_reclaimable = global_page_state(NR_FILE_DIRTY) +
+                                       global_page_state(NR_UNSTABLE_NFS);
+                       if (nr_reclaimable +
+                               global_page_state(NR_WRITEBACK)
+                                       <= dirty_thresh)
+                                               break;
                        pages_written += write_chunk - wbc.nr_to_write;
                        if (pages_written >= write_chunk)
                                break;          /* We've done our duty */
@@ -236,8 +223,9 @@ static void balance_dirty_pages(struct address_space *mapping)
                blk_congestion_wait(WRITE, HZ/10);
        }
 
-       if (nr_reclaimable + wbs.nr_writeback <= dirty_thresh && dirty_exceeded)
-               dirty_exceeded = 0;
+       if (nr_reclaimable + global_page_state(NR_WRITEBACK)
+               <= dirty_thresh && dirty_exceeded)
+                       dirty_exceeded = 0;
 
        if (writeback_in_progress(bdi))
                return;         /* pdflush is already working this queue */
@@ -299,12 +287,11 @@ EXPORT_SYMBOL(balance_dirty_pages_ratelimited_nr);
 
 void throttle_vm_writeout(void)
 {
-       struct writeback_state wbs;
        long background_thresh;
        long dirty_thresh;
 
         for ( ; ; ) {
-               get_dirty_limits(&wbs, &background_thresh, &dirty_thresh, NULL);
+               get_dirty_limits(&background_thresh, &dirty_thresh, NULL);
 
                 /*
                  * Boost the allowable dirty threshold a bit for page
@@ -312,8 +299,9 @@ void throttle_vm_writeout(void)
                  */
                 dirty_thresh += dirty_thresh / 10;      /* wheeee... */
 
-                if (wbs.nr_unstable + wbs.nr_writeback <= dirty_thresh)
-                        break;
+                if (global_page_state(NR_UNSTABLE_NFS) +
+                       global_page_state(NR_WRITEBACK) <= dirty_thresh)
+                               break;
                 blk_congestion_wait(WRITE, HZ/10);
         }
 }
@@ -336,12 +324,12 @@ static void background_writeout(unsigned long _min_pages)
        };
 
        for ( ; ; ) {
-               struct writeback_state wbs;
                long background_thresh;
                long dirty_thresh;
 
-               get_dirty_limits(&wbs, &background_thresh, &dirty_thresh, NULL);
-               if (wbs.nr_dirty + wbs.nr_unstable < background_thresh
+               get_dirty_limits(&background_thresh, &dirty_thresh, NULL);
+               if (global_page_state(NR_FILE_DIRTY) +
+                       global_page_state(NR_UNSTABLE_NFS) < background_thresh
                                && min_pages <= 0)
                        break;
                wbc.encountered_congestion = 0;
@@ -365,12 +353,9 @@ static void background_writeout(unsigned long _min_pages)
  */
 int wakeup_pdflush(long nr_pages)
 {
-       if (nr_pages == 0) {
-               struct writeback_state wbs;
-
-               get_writeback_state(&wbs);
-               nr_pages = wbs.nr_dirty + wbs.nr_unstable;
-       }
+       if (nr_pages == 0)
+               nr_pages = global_page_state(NR_FILE_DIRTY) +
+                               global_page_state(NR_UNSTABLE_NFS);
        return pdflush_operation(background_writeout, nr_pages);
 }
 
@@ -401,7 +386,6 @@ static void wb_kupdate(unsigned long arg)
        unsigned long start_jif;
        unsigned long next_jif;
        long nr_to_write;
-       struct writeback_state wbs;
        struct writeback_control wbc = {
                .bdi            = NULL,
                .sync_mode      = WB_SYNC_NONE,
@@ -414,11 +398,11 @@ static void wb_kupdate(unsigned long arg)
 
        sync_supers();
 
-       get_writeback_state(&wbs);
        oldest_jif = jiffies - dirty_expire_interval;
        start_jif = jiffies;
        next_jif = start_jif + dirty_writeback_interval;
-       nr_to_write = wbs.nr_dirty + wbs.nr_unstable +
+       nr_to_write = global_page_state(NR_FILE_DIRTY) +
+                       global_page_state(NR_UNSTABLE_NFS) +
                        (inodes_stat.nr_inodes - inodes_stat.nr_unused);
        while (nr_to_write > 0) {
                wbc.encountered_congestion = 0;
@@ -640,7 +624,8 @@ int __set_page_dirty_nobuffers(struct page *page)
                        if (mapping2) { /* Race with truncate? */
                                BUG_ON(mapping2 != mapping);
                                if (mapping_cap_account_dirty(mapping))
-                                       inc_page_state(nr_dirty);
+                                       __inc_zone_page_state(page,
+                                                               NR_FILE_DIRTY);
                                radix_tree_tag_set(&mapping->page_tree,
                                        page_index(page), PAGECACHE_TAG_DIRTY);
                        }
@@ -727,9 +712,9 @@ int test_clear_page_dirty(struct page *page)
                        radix_tree_tag_clear(&mapping->page_tree,
                                                page_index(page),
                                                PAGECACHE_TAG_DIRTY);
-                       write_unlock_irqrestore(&mapping->tree_lock, flags);
                        if (mapping_cap_account_dirty(mapping))
-                               dec_page_state(nr_dirty);
+                               __dec_zone_page_state(page, NR_FILE_DIRTY);
+                       write_unlock_irqrestore(&mapping->tree_lock, flags);
                        return 1;
                }
                write_unlock_irqrestore(&mapping->tree_lock, flags);
@@ -760,7 +745,7 @@ int clear_page_dirty_for_io(struct page *page)
        if (mapping) {
                if (TestClearPageDirty(page)) {
                        if (mapping_cap_account_dirty(mapping))
-                               dec_page_state(nr_dirty);
+                               dec_zone_page_state(page, NR_FILE_DIRTY);
                        return 1;
                }
                return 0;
index 084a2de7e52a8c8b4ceaa3c78997199d17f770e5..54a4f5375bbaeaaa9af8faef441e4a758b89d12e 100644 (file)
@@ -14,7 +14,6 @@
  *          (lots of bits borrowed from Ingo Molnar & Andrew Morton)
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/mm.h>
 #include <linux/swap.h>
@@ -456,7 +455,7 @@ static void __free_pages_ok(struct page *page, unsigned int order)
 
        kernel_map_pages(page, 1 << order, 0);
        local_irq_save(flags);
-       __mod_page_state(pgfree, 1 << order);
+       __count_vm_events(PGFREE, 1 << order);
        free_one_page(page_zone(page), page, order);
        local_irq_restore(flags);
 }
@@ -709,27 +708,6 @@ void drain_local_pages(void)
 }
 #endif /* CONFIG_PM */
 
-static void zone_statistics(struct zonelist *zonelist, struct zone *z, int cpu)
-{
-#ifdef CONFIG_NUMA
-       pg_data_t *pg = z->zone_pgdat;
-       pg_data_t *orig = zonelist->zones[0]->zone_pgdat;
-       struct per_cpu_pageset *p;
-
-       p = zone_pcp(z, cpu);
-       if (pg == orig) {
-               p->numa_hit++;
-       } else {
-               p->numa_miss++;
-               zone_pcp(zonelist->zones[0], cpu)->numa_foreign++;
-       }
-       if (pg == NODE_DATA(numa_node_id()))
-               p->local_node++;
-       else
-               p->other_node++;
-#endif
-}
-
 /*
  * Free a 0-order page
  */
@@ -750,7 +728,7 @@ static void fastcall free_hot_cold_page(struct page *page, int cold)
 
        pcp = &zone_pcp(zone, get_cpu())->pcp[cold];
        local_irq_save(flags);
-       __inc_page_state(pgfree);
+       __count_vm_event(PGFREE);
        list_add(&page->lru, &pcp->list);
        pcp->count++;
        if (pcp->count >= pcp->high) {
@@ -826,8 +804,8 @@ again:
                        goto failed;
        }
 
-       __mod_page_state_zone(zone, pgalloc, 1 << order);
-       zone_statistics(zonelist, zone, cpu);
+       __count_zone_vm_events(PGALLOC, zone, 1 << order);
+       zone_statistics(zonelist, zone);
        local_irq_restore(flags);
        put_cpu();
 
@@ -1231,141 +1209,6 @@ static void show_node(struct zone *zone)
 #define show_node(zone)        do { } while (0)
 #endif
 
-/*
- * Accumulate the page_state information across all CPUs.
- * The result is unavoidably approximate - it can change
- * during and after execution of this function.
- */
-static DEFINE_PER_CPU(struct page_state, page_states) = {0};
-
-atomic_t nr_pagecache = ATOMIC_INIT(0);
-EXPORT_SYMBOL(nr_pagecache);
-#ifdef CONFIG_SMP
-DEFINE_PER_CPU(long, nr_pagecache_local) = 0;
-#endif
-
-static void __get_page_state(struct page_state *ret, int nr, cpumask_t *cpumask)
-{
-       unsigned cpu;
-
-       memset(ret, 0, nr * sizeof(unsigned long));
-       cpus_and(*cpumask, *cpumask, cpu_online_map);
-
-       for_each_cpu_mask(cpu, *cpumask) {
-               unsigned long *in;
-               unsigned long *out;
-               unsigned off;
-               unsigned next_cpu;
-
-               in = (unsigned long *)&per_cpu(page_states, cpu);
-
-               next_cpu = next_cpu(cpu, *cpumask);
-               if (likely(next_cpu < NR_CPUS))
-                       prefetch(&per_cpu(page_states, next_cpu));
-
-               out = (unsigned long *)ret;
-               for (off = 0; off < nr; off++)
-                       *out++ += *in++;
-       }
-}
-
-void get_page_state_node(struct page_state *ret, int node)
-{
-       int nr;
-       cpumask_t mask = node_to_cpumask(node);
-
-       nr = offsetof(struct page_state, GET_PAGE_STATE_LAST);
-       nr /= sizeof(unsigned long);
-
-       __get_page_state(ret, nr+1, &mask);
-}
-
-void get_page_state(struct page_state *ret)
-{
-       int nr;
-       cpumask_t mask = CPU_MASK_ALL;
-
-       nr = offsetof(struct page_state, GET_PAGE_STATE_LAST);
-       nr /= sizeof(unsigned long);
-
-       __get_page_state(ret, nr + 1, &mask);
-}
-
-void get_full_page_state(struct page_state *ret)
-{
-       cpumask_t mask = CPU_MASK_ALL;
-
-       __get_page_state(ret, sizeof(*ret) / sizeof(unsigned long), &mask);
-}
-
-unsigned long read_page_state_offset(unsigned long offset)
-{
-       unsigned long ret = 0;
-       int cpu;
-
-       for_each_online_cpu(cpu) {
-               unsigned long in;
-
-               in = (unsigned long)&per_cpu(page_states, cpu) + offset;
-               ret += *((unsigned long *)in);
-       }
-       return ret;
-}
-
-void __mod_page_state_offset(unsigned long offset, unsigned long delta)
-{
-       void *ptr;
-
-       ptr = &__get_cpu_var(page_states);
-       *(unsigned long *)(ptr + offset) += delta;
-}
-EXPORT_SYMBOL(__mod_page_state_offset);
-
-void mod_page_state_offset(unsigned long offset, unsigned long delta)
-{
-       unsigned long flags;
-       void *ptr;
-
-       local_irq_save(flags);
-       ptr = &__get_cpu_var(page_states);
-       *(unsigned long *)(ptr + offset) += delta;
-       local_irq_restore(flags);
-}
-EXPORT_SYMBOL(mod_page_state_offset);
-
-void __get_zone_counts(unsigned long *active, unsigned long *inactive,
-                       unsigned long *free, struct pglist_data *pgdat)
-{
-       struct zone *zones = pgdat->node_zones;
-       int i;
-
-       *active = 0;
-       *inactive = 0;
-       *free = 0;
-       for (i = 0; i < MAX_NR_ZONES; i++) {
-               *active += zones[i].nr_active;
-               *inactive += zones[i].nr_inactive;
-               *free += zones[i].free_pages;
-       }
-}
-
-void get_zone_counts(unsigned long *active,
-               unsigned long *inactive, unsigned long *free)
-{
-       struct pglist_data *pgdat;
-
-       *active = 0;
-       *inactive = 0;
-       *free = 0;
-       for_each_online_pgdat(pgdat) {
-               unsigned long l, m, n;
-               __get_zone_counts(&l, &m, &n, pgdat);
-               *active += l;
-               *inactive += m;
-               *free += n;
-       }
-}
-
 void si_meminfo(struct sysinfo *val)
 {
        val->totalram = totalram_pages;
@@ -1406,7 +1249,6 @@ void si_meminfo_node(struct sysinfo *val, int nid)
  */
 void show_free_areas(void)
 {
-       struct page_state ps;
        int cpu, temperature;
        unsigned long active;
        unsigned long inactive;
@@ -1438,7 +1280,6 @@ void show_free_areas(void)
                }
        }
 
-       get_page_state(&ps);
        get_zone_counts(&active, &inactive, &free);
 
        printk("Free pages: %11ukB (%ukB HighMem)\n",
@@ -1449,13 +1290,13 @@ void show_free_areas(void)
                "unstable:%lu free:%u slab:%lu mapped:%lu pagetables:%lu\n",
                active,
                inactive,
-               ps.nr_dirty,
-               ps.nr_writeback,
-               ps.nr_unstable,
+               global_page_state(NR_FILE_DIRTY),
+               global_page_state(NR_WRITEBACK),
+               global_page_state(NR_UNSTABLE_NFS),
                nr_free_pages(),
-               ps.nr_slab,
-               ps.nr_mapped,
-               ps.nr_page_table_pages);
+               global_page_state(NR_SLAB),
+               global_page_state(NR_FILE_MAPPED),
+               global_page_state(NR_PAGETABLE));
 
        for_each_zone(zone) {
                int i;
@@ -2164,6 +2005,10 @@ static void __meminit free_area_init_core(struct pglist_data *pgdat,
 
                zone->spanned_pages = size;
                zone->present_pages = realsize;
+#ifdef CONFIG_NUMA
+               zone->min_unmapped_ratio = (realsize*sysctl_min_unmapped_ratio)
+                                               / 100;
+#endif
                zone->name = zone_names[j];
                spin_lock_init(&zone->lock);
                spin_lock_init(&zone->lru_lock);
@@ -2180,6 +2025,7 @@ static void __meminit free_area_init_core(struct pglist_data *pgdat,
                zone->nr_scan_inactive = 0;
                zone->nr_active = 0;
                zone->nr_inactive = 0;
+               zap_zone_vm_stats(zone);
                atomic_set(&zone->reclaim_in_progress, 0);
                if (!size)
                        continue;
@@ -2253,307 +2099,18 @@ void __init free_area_init(unsigned long *zones_size)
                        __pa(PAGE_OFFSET) >> PAGE_SHIFT, NULL);
 }
 
-#ifdef CONFIG_PROC_FS
-
-#include <linux/seq_file.h>
-
-static void *frag_start(struct seq_file *m, loff_t *pos)
-{
-       pg_data_t *pgdat;
-       loff_t node = *pos;
-       for (pgdat = first_online_pgdat();
-            pgdat && node;
-            pgdat = next_online_pgdat(pgdat))
-               --node;
-
-       return pgdat;
-}
-
-static void *frag_next(struct seq_file *m, void *arg, loff_t *pos)
-{
-       pg_data_t *pgdat = (pg_data_t *)arg;
-
-       (*pos)++;
-       return next_online_pgdat(pgdat);
-}
-
-static void frag_stop(struct seq_file *m, void *arg)
-{
-}
-
-/* 
- * This walks the free areas for each zone.
- */
-static int frag_show(struct seq_file *m, void *arg)
-{
-       pg_data_t *pgdat = (pg_data_t *)arg;
-       struct zone *zone;
-       struct zone *node_zones = pgdat->node_zones;
-       unsigned long flags;
-       int order;
-
-       for (zone = node_zones; zone - node_zones < MAX_NR_ZONES; ++zone) {
-               if (!populated_zone(zone))
-                       continue;
-
-               spin_lock_irqsave(&zone->lock, flags);
-               seq_printf(m, "Node %d, zone %8s ", pgdat->node_id, zone->name);
-               for (order = 0; order < MAX_ORDER; ++order)
-                       seq_printf(m, "%6lu ", zone->free_area[order].nr_free);
-               spin_unlock_irqrestore(&zone->lock, flags);
-               seq_putc(m, '\n');
-       }
-       return 0;
-}
-
-struct seq_operations fragmentation_op = {
-       .start  = frag_start,
-       .next   = frag_next,
-       .stop   = frag_stop,
-       .show   = frag_show,
-};
-
-/*
- * Output information about zones in @pgdat.
- */
-static int zoneinfo_show(struct seq_file *m, void *arg)
-{
-       pg_data_t *pgdat = arg;
-       struct zone *zone;
-       struct zone *node_zones = pgdat->node_zones;
-       unsigned long flags;
-
-       for (zone = node_zones; zone - node_zones < MAX_NR_ZONES; zone++) {
-               int i;
-
-               if (!populated_zone(zone))
-                       continue;
-
-               spin_lock_irqsave(&zone->lock, flags);
-               seq_printf(m, "Node %d, zone %8s", pgdat->node_id, zone->name);
-               seq_printf(m,
-                          "\n  pages free     %lu"
-                          "\n        min      %lu"
-                          "\n        low      %lu"
-                          "\n        high     %lu"
-                          "\n        active   %lu"
-                          "\n        inactive %lu"
-                          "\n        scanned  %lu (a: %lu i: %lu)"
-                          "\n        spanned  %lu"
-                          "\n        present  %lu",
-                          zone->free_pages,
-                          zone->pages_min,
-                          zone->pages_low,
-                          zone->pages_high,
-                          zone->nr_active,
-                          zone->nr_inactive,
-                          zone->pages_scanned,
-                          zone->nr_scan_active, zone->nr_scan_inactive,
-                          zone->spanned_pages,
-                          zone->present_pages);
-               seq_printf(m,
-                          "\n        protection: (%lu",
-                          zone->lowmem_reserve[0]);
-               for (i = 1; i < ARRAY_SIZE(zone->lowmem_reserve); i++)
-                       seq_printf(m, ", %lu", zone->lowmem_reserve[i]);
-               seq_printf(m,
-                          ")"
-                          "\n  pagesets");
-               for_each_online_cpu(i) {
-                       struct per_cpu_pageset *pageset;
-                       int j;
-
-                       pageset = zone_pcp(zone, i);
-                       for (j = 0; j < ARRAY_SIZE(pageset->pcp); j++) {
-                               if (pageset->pcp[j].count)
-                                       break;
-                       }
-                       if (j == ARRAY_SIZE(pageset->pcp))
-                               continue;
-                       for (j = 0; j < ARRAY_SIZE(pageset->pcp); j++) {
-                               seq_printf(m,
-                                          "\n    cpu: %i pcp: %i"
-                                          "\n              count: %i"
-                                          "\n              high:  %i"
-                                          "\n              batch: %i",
-                                          i, j,
-                                          pageset->pcp[j].count,
-                                          pageset->pcp[j].high,
-                                          pageset->pcp[j].batch);
-                       }
-#ifdef CONFIG_NUMA
-                       seq_printf(m,
-                                  "\n            numa_hit:       %lu"
-                                  "\n            numa_miss:      %lu"
-                                  "\n            numa_foreign:   %lu"
-                                  "\n            interleave_hit: %lu"
-                                  "\n            local_node:     %lu"
-                                  "\n            other_node:     %lu",
-                                  pageset->numa_hit,
-                                  pageset->numa_miss,
-                                  pageset->numa_foreign,
-                                  pageset->interleave_hit,
-                                  pageset->local_node,
-                                  pageset->other_node);
-#endif
-               }
-               seq_printf(m,
-                          "\n  all_unreclaimable: %u"
-                          "\n  prev_priority:     %i"
-                          "\n  temp_priority:     %i"
-                          "\n  start_pfn:         %lu",
-                          zone->all_unreclaimable,
-                          zone->prev_priority,
-                          zone->temp_priority,
-                          zone->zone_start_pfn);
-               spin_unlock_irqrestore(&zone->lock, flags);
-               seq_putc(m, '\n');
-       }
-       return 0;
-}
-
-struct seq_operations zoneinfo_op = {
-       .start  = frag_start, /* iterate over all zones. The same as in
-                              * fragmentation. */
-       .next   = frag_next,
-       .stop   = frag_stop,
-       .show   = zoneinfo_show,
-};
-
-static char *vmstat_text[] = {
-       "nr_dirty",
-       "nr_writeback",
-       "nr_unstable",
-       "nr_page_table_pages",
-       "nr_mapped",
-       "nr_slab",
-
-       "pgpgin",
-       "pgpgout",
-       "pswpin",
-       "pswpout",
-
-       "pgalloc_high",
-       "pgalloc_normal",
-       "pgalloc_dma32",
-       "pgalloc_dma",
-
-       "pgfree",
-       "pgactivate",
-       "pgdeactivate",
-
-       "pgfault",
-       "pgmajfault",
-
-       "pgrefill_high",
-       "pgrefill_normal",
-       "pgrefill_dma32",
-       "pgrefill_dma",
-
-       "pgsteal_high",
-       "pgsteal_normal",
-       "pgsteal_dma32",
-       "pgsteal_dma",
-
-       "pgscan_kswapd_high",
-       "pgscan_kswapd_normal",
-       "pgscan_kswapd_dma32",
-       "pgscan_kswapd_dma",
-
-       "pgscan_direct_high",
-       "pgscan_direct_normal",
-       "pgscan_direct_dma32",
-       "pgscan_direct_dma",
-
-       "pginodesteal",
-       "slabs_scanned",
-       "kswapd_steal",
-       "kswapd_inodesteal",
-       "pageoutrun",
-       "allocstall",
-
-       "pgrotated",
-       "nr_bounce",
-};
-
-static void *vmstat_start(struct seq_file *m, loff_t *pos)
-{
-       struct page_state *ps;
-
-       if (*pos >= ARRAY_SIZE(vmstat_text))
-               return NULL;
-
-       ps = kmalloc(sizeof(*ps), GFP_KERNEL);
-       m->private = ps;
-       if (!ps)
-               return ERR_PTR(-ENOMEM);
-       get_full_page_state(ps);
-       ps->pgpgin /= 2;                /* sectors -> kbytes */
-       ps->pgpgout /= 2;
-       return (unsigned long *)ps + *pos;
-}
-
-static void *vmstat_next(struct seq_file *m, void *arg, loff_t *pos)
-{
-       (*pos)++;
-       if (*pos >= ARRAY_SIZE(vmstat_text))
-               return NULL;
-       return (unsigned long *)m->private + *pos;
-}
-
-static int vmstat_show(struct seq_file *m, void *arg)
-{
-       unsigned long *l = arg;
-       unsigned long off = l - (unsigned long *)m->private;
-
-       seq_printf(m, "%s %lu\n", vmstat_text[off], *l);
-       return 0;
-}
-
-static void vmstat_stop(struct seq_file *m, void *arg)
-{
-       kfree(m->private);
-       m->private = NULL;
-}
-
-struct seq_operations vmstat_op = {
-       .start  = vmstat_start,
-       .next   = vmstat_next,
-       .stop   = vmstat_stop,
-       .show   = vmstat_show,
-};
-
-#endif /* CONFIG_PROC_FS */
-
 #ifdef CONFIG_HOTPLUG_CPU
 static int page_alloc_cpu_notify(struct notifier_block *self,
                                 unsigned long action, void *hcpu)
 {
        int cpu = (unsigned long)hcpu;
-       long *count;
-       unsigned long *src, *dest;
 
        if (action == CPU_DEAD) {
-               int i;
-
-               /* Drain local pagecache count. */
-               count = &per_cpu(nr_pagecache_local, cpu);
-               atomic_add(*count, &nr_pagecache);
-               *count = 0;
                local_irq_disable();
                __drain_pages(cpu);
-
-               /* Add dead cpu's page_states to our own. */
-               dest = (unsigned long *)&__get_cpu_var(page_states);
-               src = (unsigned long *)&per_cpu(page_states, cpu);
-
-               for (i = 0; i < sizeof(struct page_state)/sizeof(unsigned long);
-                               i++) {
-                       dest[i] += src[i];
-                       src[i] = 0;
-               }
-
+               vm_events_fold_cpu(cpu);
                local_irq_enable();
+               refresh_cpu_vm_stats(cpu);
        }
        return NOTIFY_OK;
 }
@@ -2745,6 +2302,24 @@ int min_free_kbytes_sysctl_handler(ctl_table *table, int write,
        return 0;
 }
 
+#ifdef CONFIG_NUMA
+int sysctl_min_unmapped_ratio_sysctl_handler(ctl_table *table, int write,
+       struct file *file, void __user *buffer, size_t *length, loff_t *ppos)
+{
+       struct zone *zone;
+       int rc;
+
+       rc = proc_dointvec_minmax(table, write, file, buffer, length, ppos);
+       if (rc)
+               return rc;
+
+       for_each_zone(zone)
+               zone->min_unmapped_ratio = (zone->present_pages *
+                               sysctl_min_unmapped_ratio) / 100;
+       return 0;
+}
+#endif
+
 /*
  * lowmem_reserve_ratio_sysctl_handler - just a wrapper around
  *     proc_dointvec() so that we can call setup_per_zone_lowmem_reserve()
index bb2b0d53889cbd89557fee7cc8873e4860df34e1..88029948d00aeebdda7f413899faef6bd2196d1a 100644 (file)
@@ -101,7 +101,7 @@ int swap_writepage(struct page *page, struct writeback_control *wbc)
        }
        if (wbc->sync_mode == WB_SYNC_ALL)
                rw |= (1 << BIO_RW_SYNC);
-       inc_page_state(pswpout);
+       count_vm_event(PSWPOUT);
        set_page_writeback(page);
        unlock_page(page);
        submit_bio(rw, bio);
@@ -123,7 +123,7 @@ int swap_readpage(struct file *file, struct page *page)
                ret = -ENOMEM;
                goto out;
        }
-       inc_page_state(pswpin);
+       count_vm_event(PSWPIN);
        submit_bio(READ, bio);
 out:
        return ret;
index e76909e880ca8c2847b3b405f03ed56b453a4a44..40158b59729ec3f6dac4390ecd5a57db7c719b52 100644 (file)
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -455,7 +455,7 @@ static void __page_set_anon_rmap(struct page *page,
         * nr_mapped state can be updated without turning off
         * interrupts because it is not modified via interrupt.
         */
-       __inc_page_state(nr_mapped);
+       __inc_zone_page_state(page, NR_ANON_PAGES);
 }
 
 /**
@@ -499,7 +499,7 @@ void page_add_new_anon_rmap(struct page *page,
 void page_add_file_rmap(struct page *page)
 {
        if (atomic_inc_and_test(&page->_mapcount))
-               __inc_page_state(nr_mapped);
+               __inc_zone_page_state(page, NR_FILE_MAPPED);
 }
 
 /**
@@ -531,7 +531,8 @@ void page_remove_rmap(struct page *page)
                 */
                if (page_test_and_clear_dirty(page))
                        set_page_dirty(page);
-               __dec_page_state(nr_mapped);
+               __dec_zone_page_state(page,
+                               PageAnon(page) ? NR_ANON_PAGES : NR_FILE_MAPPED);
        }
 }
 
index b14ff817d16264db042313ccb8ba362edc1be014..db21c51531ca894f647d1aea6b79f72b0d6fc56d 100644 (file)
@@ -23,7 +23,6 @@
  * which makes it a completely usable filesystem.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/fs.h>
@@ -1045,12 +1044,12 @@ repeat:
                swappage = lookup_swap_cache(swap);
                if (!swappage) {
                        shmem_swp_unmap(entry);
-                       spin_unlock(&info->lock);
                        /* here we actually do the io */
                        if (type && *type == VM_FAULT_MINOR) {
-                               inc_page_state(pgmajfault);
+                               __count_vm_event(PGMAJFAULT);
                                *type = VM_FAULT_MAJOR;
                        }
+                       spin_unlock(&info->lock);
                        swappage = shmem_swapin(info, swap, idx);
                        if (!swappage) {
                                spin_lock(&info->lock);
index 233e39d14caf5ae2966c9df788c9c73dc6a563e3..85c2e03098a7fcf60f9c2f250b0af5a72a0330cf 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -309,6 +309,13 @@ struct kmem_list3 __initdata initkmem_list3[NUM_INIT_LISTS];
 #define        SIZE_AC 1
 #define        SIZE_L3 (1 + MAX_NUMNODES)
 
+static int drain_freelist(struct kmem_cache *cache,
+                       struct kmem_list3 *l3, int tofree);
+static void free_block(struct kmem_cache *cachep, void **objpp, int len,
+                       int node);
+static void enable_cpucache(struct kmem_cache *cachep);
+static void cache_reap(void *unused);
+
 /*
  * This function must be completely optimized away if a constant is passed to
  * it.  Mostly the same as what is in linux/slab.h except it returns an index.
@@ -456,7 +463,7 @@ struct kmem_cache {
 #define        STATS_DEC_ACTIVE(x)     ((x)->num_active--)
 #define        STATS_INC_ALLOCED(x)    ((x)->num_allocations++)
 #define        STATS_INC_GROWN(x)      ((x)->grown++)
-#define        STATS_INC_REAPED(x)     ((x)->reaped++)
+#define        STATS_ADD_REAPED(x,y)   ((x)->reaped += (y))
 #define        STATS_SET_HIGH(x)                                               \
        do {                                                            \
                if ((x)->num_active > (x)->high_mark)                   \
@@ -480,7 +487,7 @@ struct kmem_cache {
 #define        STATS_DEC_ACTIVE(x)     do { } while (0)
 #define        STATS_INC_ALLOCED(x)    do { } while (0)
 #define        STATS_INC_GROWN(x)      do { } while (0)
-#define        STATS_INC_REAPED(x)     do { } while (0)
+#define        STATS_ADD_REAPED(x,y)   do { } while (0)
 #define        STATS_SET_HIGH(x)       do { } while (0)
 #define        STATS_INC_ERR(x)        do { } while (0)
 #define        STATS_INC_NODEALLOCS(x) do { } while (0)
@@ -700,12 +707,6 @@ int slab_is_available(void)
 
 static DEFINE_PER_CPU(struct work_struct, reap_work);
 
-static void free_block(struct kmem_cache *cachep, void **objpp, int len,
-                       int node);
-static void enable_cpucache(struct kmem_cache *cachep);
-static void cache_reap(void *unused);
-static int __node_shrink(struct kmem_cache *cachep, int node);
-
 static inline struct array_cache *cpu_cache_get(struct kmem_cache *cachep)
 {
        return cachep->array[smp_processor_id()];
@@ -1020,7 +1021,8 @@ static void drain_alien_cache(struct kmem_cache *cachep,
        }
 }
 
-static inline int cache_free_alien(struct kmem_cache *cachep, void *objp)
+static inline int cache_free_alien(struct kmem_cache *cachep, void *objp,
+                                  int nesting)
 {
        struct slab *slabp = virt_to_slab(objp);
        int nodeid = slabp->nodeid;
@@ -1038,7 +1040,7 @@ static inline int cache_free_alien(struct kmem_cache *cachep, void *objp)
        STATS_INC_NODEFREES(cachep);
        if (l3->alien && l3->alien[nodeid]) {
                alien = l3->alien[nodeid];
-               spin_lock(&alien->lock);
+               spin_lock_nested(&alien->lock, nesting);
                if (unlikely(alien->avail == alien->limit)) {
                        STATS_INC_ACOVERFLOW(cachep);
                        __drain_alien_cache(cachep, alien, nodeid);
@@ -1067,7 +1069,8 @@ static inline void free_alien_cache(struct array_cache **ac_ptr)
 {
 }
 
-static inline int cache_free_alien(struct kmem_cache *cachep, void *objp)
+static inline int cache_free_alien(struct kmem_cache *cachep, void *objp,
+                                  int nesting)
 {
        return 0;
 }
@@ -1241,10 +1244,7 @@ free_array_cache:
                        l3 = cachep->nodelists[node];
                        if (!l3)
                                continue;
-                       spin_lock_irq(&l3->list_lock);
-                       /* free slabs belonging to this node */
-                       __node_shrink(cachep, node);
-                       spin_unlock_irq(&l3->list_lock);
+                       drain_freelist(cachep, l3, l3->free_objects);
                }
                mutex_unlock(&cache_chain_mutex);
                break;
@@ -1274,6 +1274,11 @@ static void init_list(struct kmem_cache *cachep, struct kmem_list3 *list,
 
        local_irq_disable();
        memcpy(ptr, list, sizeof(struct kmem_list3));
+       /*
+        * Do not assume that spinlocks can be initialized via memcpy:
+        */
+       spin_lock_init(&ptr->list_lock);
+
        MAKE_ALL_LISTS(cachep, ptr, nodeid);
        cachep->nodelists[nodeid] = ptr;
        local_irq_enable();
@@ -1400,7 +1405,7 @@ void __init kmem_cache_init(void)
        }
        /* 4) Replace the bootstrap head arrays */
        {
-               void *ptr;
+               struct array_cache *ptr;
 
                ptr = kmalloc(sizeof(struct arraycache_init), GFP_KERNEL);
 
@@ -1408,6 +1413,11 @@ void __init kmem_cache_init(void)
                BUG_ON(cpu_cache_get(&cache_cache) != &initarray_cache.cache);
                memcpy(ptr, cpu_cache_get(&cache_cache),
                       sizeof(struct arraycache_init));
+               /*
+                * Do not assume that spinlocks can be initialized via memcpy:
+                */
+               spin_lock_init(&ptr->lock);
+
                cache_cache.array[smp_processor_id()] = ptr;
                local_irq_enable();
 
@@ -1418,6 +1428,11 @@ void __init kmem_cache_init(void)
                       != &initarray_generic.cache);
                memcpy(ptr, cpu_cache_get(malloc_sizes[INDEX_AC].cs_cachep),
                       sizeof(struct arraycache_init));
+               /*
+                * Do not assume that spinlocks can be initialized via memcpy:
+                */
+               spin_lock_init(&ptr->lock);
+
                malloc_sizes[INDEX_AC].cs_cachep->array[smp_processor_id()] =
                    ptr;
                local_irq_enable();
@@ -1507,7 +1522,7 @@ static void *kmem_getpages(struct kmem_cache *cachep, gfp_t flags, int nodeid)
        nr_pages = (1 << cachep->gfporder);
        if (cachep->flags & SLAB_RECLAIM_ACCOUNT)
                atomic_add(nr_pages, &slab_reclaim_pages);
-       add_page_state(nr_slab, nr_pages);
+       add_zone_page_state(page_zone(page), NR_SLAB, nr_pages);
        for (i = 0; i < nr_pages; i++)
                __SetPageSlab(page + i);
        return page_address(page);
@@ -1522,12 +1537,12 @@ static void kmem_freepages(struct kmem_cache *cachep, void *addr)
        struct page *page = virt_to_page(addr);
        const unsigned long nr_freed = i;
 
+       sub_zone_page_state(page_zone(page), NR_SLAB, nr_freed);
        while (i--) {
                BUG_ON(!PageSlab(page));
                __ClearPageSlab(page);
                page++;
        }
-       sub_page_state(nr_slab, nr_freed);
        if (current->reclaim_state)
                current->reclaim_state->reclaimed_slab += nr_freed;
        free_pages((unsigned long)addr, cachep->gfporder);
@@ -1745,6 +1760,8 @@ static void slab_destroy_objs(struct kmem_cache *cachep, struct slab *slabp)
 }
 #endif
 
+static void __cache_free(struct kmem_cache *cachep, void *objp, int nesting);
+
 /**
  * slab_destroy - destroy and release all objects in a slab
  * @cachep: cache pointer being destroyed
@@ -1768,8 +1785,17 @@ static void slab_destroy(struct kmem_cache *cachep, struct slab *slabp)
                call_rcu(&slab_rcu->head, kmem_rcu_free);
        } else {
                kmem_freepages(cachep, addr);
-               if (OFF_SLAB(cachep))
-                       kmem_cache_free(cachep->slabp_cache, slabp);
+               if (OFF_SLAB(cachep)) {
+                       unsigned long flags;
+
+                       /*
+                        * lockdep: we may nest inside an already held
+                        * ac->lock, so pass in a nesting flag:
+                        */
+                       local_irq_save(flags);
+                       __cache_free(cachep->slabp_cache, slabp, 1);
+                       local_irq_restore(flags);
+               }
        }
 }
 
@@ -2248,32 +2274,45 @@ static void drain_cpu_caches(struct kmem_cache *cachep)
        }
 }
 
-static int __node_shrink(struct kmem_cache *cachep, int node)
+/*
+ * Remove slabs from the list of free slabs.
+ * Specify the number of slabs to drain in tofree.
+ *
+ * Returns the actual number of slabs released.
+ */
+static int drain_freelist(struct kmem_cache *cache,
+                       struct kmem_list3 *l3, int tofree)
 {
+       struct list_head *p;
+       int nr_freed;
        struct slab *slabp;
-       struct kmem_list3 *l3 = cachep->nodelists[node];
-       int ret;
 
-       for (;;) {
-               struct list_head *p;
+       nr_freed = 0;
+       while (nr_freed < tofree && !list_empty(&l3->slabs_free)) {
 
+               spin_lock_irq(&l3->list_lock);
                p = l3->slabs_free.prev;
-               if (p == &l3->slabs_free)
-                       break;
+               if (p == &l3->slabs_free) {
+                       spin_unlock_irq(&l3->list_lock);
+                       goto out;
+               }
 
-               slabp = list_entry(l3->slabs_free.prev, struct slab, list);
+               slabp = list_entry(p, struct slab, list);
 #if DEBUG
                BUG_ON(slabp->inuse);
 #endif
                list_del(&slabp->list);
-
-               l3->free_objects -= cachep->num;
+               /*
+                * Safe to drop the lock. The slab is no longer linked
+                * to the cache.
+                */
+               l3->free_objects -= cache->num;
                spin_unlock_irq(&l3->list_lock);
-               slab_destroy(cachep, slabp);
-               spin_lock_irq(&l3->list_lock);
+               slab_destroy(cache, slabp);
+               nr_freed++;
        }
-       ret = !list_empty(&l3->slabs_full) || !list_empty(&l3->slabs_partial);
-       return ret;
+out:
+       return nr_freed;
 }
 
 static int __cache_shrink(struct kmem_cache *cachep)
@@ -2286,11 +2325,13 @@ static int __cache_shrink(struct kmem_cache *cachep)
        check_irq_on();
        for_each_online_node(i) {
                l3 = cachep->nodelists[i];
-               if (l3) {
-                       spin_lock_irq(&l3->list_lock);
-                       ret += __node_shrink(cachep, i);
-                       spin_unlock_irq(&l3->list_lock);
-               }
+               if (!l3)
+                       continue;
+
+               drain_freelist(cachep, l3, l3->free_objects);
+
+               ret += !list_empty(&l3->slabs_full) ||
+                       !list_empty(&l3->slabs_partial);
        }
        return (ret ? 1 : 0);
 }
@@ -3059,7 +3100,16 @@ static void free_block(struct kmem_cache *cachep, void **objpp, int nr_objects,
                if (slabp->inuse == 0) {
                        if (l3->free_objects > l3->free_limit) {
                                l3->free_objects -= cachep->num;
+                               /*
+                                * It is safe to drop the lock. The slab is
+                                * no longer linked to the cache. cachep
+                                * cannot disappear - we are using it and
+                                * all destruction of caches must be
+                                * serialized properly by the user.
+                                */
+                               spin_unlock(&l3->list_lock);
                                slab_destroy(cachep, slabp);
+                               spin_lock(&l3->list_lock);
                        } else {
                                list_add(&slabp->list, &l3->slabs_free);
                        }
@@ -3085,7 +3135,7 @@ static void cache_flusharray(struct kmem_cache *cachep, struct array_cache *ac)
 #endif
        check_irq_off();
        l3 = cachep->nodelists[node];
-       spin_lock(&l3->list_lock);
+       spin_lock_nested(&l3->list_lock, SINGLE_DEPTH_NESTING);
        if (l3->shared) {
                struct array_cache *shared_array = l3->shared;
                int max = shared_array->limit - shared_array->avail;
@@ -3128,14 +3178,14 @@ free_done:
  * Release an obj back to its cache. If the obj has a constructed state, it must
  * be in this state _before_ it is released.  Called with disabled ints.
  */
-static inline void __cache_free(struct kmem_cache *cachep, void *objp)
+static void __cache_free(struct kmem_cache *cachep, void *objp, int nesting)
 {
        struct array_cache *ac = cpu_cache_get(cachep);
 
        check_irq_off();
        objp = cache_free_debugcheck(cachep, objp, __builtin_return_address(0));
 
-       if (cache_free_alien(cachep, objp))
+       if (cache_free_alien(cachep, objp, nesting))
                return;
 
        if (likely(ac->avail < ac->limit)) {
@@ -3374,7 +3424,7 @@ void kmem_cache_free(struct kmem_cache *cachep, void *objp)
        BUG_ON(virt_to_cache(objp) != cachep);
 
        local_irq_save(flags);
-       __cache_free(cachep, objp);
+       __cache_free(cachep, objp, 0);
        local_irq_restore(flags);
 }
 EXPORT_SYMBOL(kmem_cache_free);
@@ -3399,7 +3449,7 @@ void kfree(const void *objp)
        kfree_debugcheck(objp);
        c = virt_to_cache(objp);
        debug_check_no_locks_freed(objp, obj_size(c));
-       __cache_free(c, (void *)objp);
+       __cache_free(c, (void *)objp, 0);
        local_irq_restore(flags);
 }
 EXPORT_SYMBOL(kfree);
@@ -3694,10 +3744,6 @@ static void cache_reap(void *unused)
        }
 
        list_for_each_entry(searchp, &cache_chain, next) {
-               struct list_head *p;
-               int tofree;
-               struct slab *slabp;
-
                check_irq_on();
 
                /*
@@ -3722,47 +3768,22 @@ static void cache_reap(void *unused)
 
                drain_array(searchp, l3, l3->shared, 0, node);
 
-               if (l3->free_touched) {
+               if (l3->free_touched)
                        l3->free_touched = 0;
-                       goto next;
-               }
-
-               tofree = (l3->free_limit + 5 * searchp->num - 1) /
-                               (5 * searchp->num);
-               do {
-                       /*
-                        * Do not lock if there are no free blocks.
-                        */
-                       if (list_empty(&l3->slabs_free))
-                               break;
-
-                       spin_lock_irq(&l3->list_lock);
-                       p = l3->slabs_free.next;
-                       if (p == &(l3->slabs_free)) {
-                               spin_unlock_irq(&l3->list_lock);
-                               break;
-                       }
-
-                       slabp = list_entry(p, struct slab, list);
-                       BUG_ON(slabp->inuse);
-                       list_del(&slabp->list);
-                       STATS_INC_REAPED(searchp);
+               else {
+                       int freed;
 
-                       /*
-                        * Safe to drop the lock. The slab is no longer linked
-                        * to the cache. searchp cannot disappear, we hold
-                        * cache_chain_lock
-                        */
-                       l3->free_objects -= searchp->num;
-                       spin_unlock_irq(&l3->list_lock);
-                       slab_destroy(searchp, slabp);
-               } while (--tofree > 0);
+                       freed = drain_freelist(searchp, l3, (l3->free_limit +
+                               5 * searchp->num - 1) / (5 * searchp->num));
+                       STATS_ADD_REAPED(searchp, freed);
+               }
 next:
                cond_resched();
        }
        check_irq_on();
        mutex_unlock(&cache_chain_mutex);
        next_reap_node();
+       refresh_cpu_vm_stats(smp_processor_id());
        /* Set up the next iteration */
        schedule_delayed_work(&__get_cpu_var(reap_work), REAPTIMEOUT_CPUC);
 }
index a68255ba4553770f7c4050857a11661160ea3942..7b52b20b9607f9c3be1f1244b4c5b14dce07f4a7 100644 (file)
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -29,7 +29,6 @@
  * essentially no allocation space overhead.
  */
 
-#include <linux/config.h>
 #include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/cache.h>
index c7a2b3a0e46b2961fbc6fe6794e562be66def97e..86c52ab80878f1df2239ae9270c5f49b643ab1b0 100644 (file)
@@ -1,7 +1,6 @@
 /*
  * sparse memory mappings.
  */
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/mmzone.h>
 #include <linux/bootmem.h>
index 990868afc1c6aed8d3716af0fcea25d4e6776d8f..8fd095c4ae51b00b314e732ac9ea5547a5cd26b2 100644 (file)
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -87,7 +87,7 @@ int rotate_reclaimable_page(struct page *page)
        spin_lock_irqsave(&zone->lru_lock, flags);
        if (PageLRU(page) && !PageActive(page)) {
                list_move_tail(&page->lru, &zone->inactive_list);
-               inc_page_state(pgrotated);
+               __count_vm_event(PGROTATED);
        }
        if (!test_clear_page_writeback(page))
                BUG();
@@ -107,7 +107,7 @@ void fastcall activate_page(struct page *page)
                del_page_from_inactive_list(zone, page);
                SetPageActive(page);
                add_page_to_active_list(zone, page);
-               inc_page_state(pgactivate);
+               __count_vm_event(PGACTIVATE);
        }
        spin_unlock_irq(&zone->lru_lock);
 }
index 7535211bb495c9f54a3ece2e37feaa4c0589162d..5f7cf2a4cb55f8e9a106776b8d45ec5433c6991e 100644 (file)
@@ -38,7 +38,7 @@ static struct backing_dev_info swap_backing_dev_info = {
 
 struct address_space swapper_space = {
        .page_tree      = RADIX_TREE_INIT(GFP_ATOMIC|__GFP_NOWARN),
-       .tree_lock      = RW_LOCK_UNLOCKED,
+       .tree_lock      = __RW_LOCK_UNLOCKED(swapper_space.tree_lock),
        .a_ops          = &swap_aops,
        .i_mmap_nonlinear = LIST_HEAD_INIT(swapper_space.i_mmap_nonlinear),
        .backing_dev_info = &swap_backing_dev_info,
@@ -87,7 +87,7 @@ static int __add_to_swap_cache(struct page *page, swp_entry_t entry,
                        SetPageSwapCache(page);
                        set_page_private(page, entry.val);
                        total_swapcache_pages++;
-                       pagecache_acct(1);
+                       __inc_zone_page_state(page, NR_FILE_PAGES);
                }
                write_unlock_irq(&swapper_space.tree_lock);
                radix_tree_preload_end();
@@ -132,7 +132,7 @@ void __delete_from_swap_cache(struct page *page)
        set_page_private(page, 0);
        ClearPageSwapCache(page);
        total_swapcache_pages--;
-       pagecache_acct(-1);
+       __dec_zone_page_state(page, NR_FILE_PAGES);
        INC_CACHE_INFO(del_total);
 }
 
index cc367f7e75d87f39f27a3f4c214a9174b61e87fd..e70d6c6d6fee6f626a0c247c53f213413454cd0e 100644 (file)
@@ -5,7 +5,6 @@
  *  Swap reorganised 29.12.95, Stephen Tweedie
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/hugetlb.h>
 #include <linux/mman.h>
index 35f8553f893a7ffe0416732827c71385646c4ea3..7b450798b458874f4f835aba6be4acb8da1cb35d 100644 (file)
@@ -330,6 +330,8 @@ void __vunmap(void *addr, int deallocate_pages)
                return;
        }
 
+       debug_check_no_locks_freed(addr, area->size);
+
        if (deallocate_pages) {
                int i;
 
index eeacb0d695c35233e57688e4d20314a149d1d22c..5d4c4d02254dc977d84951845dada98a80bd0627 100644 (file)
@@ -47,8 +47,6 @@ struct scan_control {
        /* Incremented by the number of inactive pages that were scanned */
        unsigned long nr_scanned;
 
-       unsigned long nr_mapped;        /* From page_state */
-
        /* This context's GFP mask */
        gfp_t gfp_mask;
 
@@ -217,7 +215,7 @@ unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask,
                                break;
                        if (shrink_ret < nr_before)
                                ret += nr_before - shrink_ret;
-                       mod_page_state(slabs_scanned, this_scan);
+                       count_vm_events(SLABS_SCANNED, this_scan);
                        total_scan -= this_scan;
 
                        cond_resched();
@@ -571,7 +569,7 @@ keep:
        list_splice(&ret_pages, page_list);
        if (pagevec_count(&freed_pvec))
                __pagevec_release_nonlru(&freed_pvec);
-       mod_page_state(pgactivate, pgactivate);
+       count_vm_events(PGACTIVATE, pgactivate);
        return nr_reclaimed;
 }
 
@@ -661,11 +659,11 @@ static unsigned long shrink_inactive_list(unsigned long max_scan,
                nr_reclaimed += nr_freed;
                local_irq_disable();
                if (current_is_kswapd()) {
-                       __mod_page_state_zone(zone, pgscan_kswapd, nr_scan);
-                       __mod_page_state(kswapd_steal, nr_freed);
+                       __count_zone_vm_events(PGSCAN_KSWAPD, zone, nr_scan);
+                       __count_vm_events(KSWAPD_STEAL, nr_freed);
                } else
-                       __mod_page_state_zone(zone, pgscan_direct, nr_scan);
-               __mod_page_state_zone(zone, pgsteal, nr_freed);
+                       __count_zone_vm_events(PGSCAN_DIRECT, zone, nr_scan);
+               __count_vm_events(PGACTIVATE, nr_freed);
 
                if (nr_taken == 0)
                        goto done;
@@ -744,7 +742,9 @@ static void shrink_active_list(unsigned long nr_pages, struct zone *zone,
                 * how much memory
                 * is mapped.
                 */
-               mapped_ratio = (sc->nr_mapped * 100) / vm_total_pages;
+               mapped_ratio = ((global_page_state(NR_FILE_MAPPED) +
+                               global_page_state(NR_ANON_PAGES)) * 100) /
+                                       vm_total_pages;
 
                /*
                 * Now decide how much we really want to unmap some pages.  The
@@ -841,11 +841,10 @@ static void shrink_active_list(unsigned long nr_pages, struct zone *zone,
                }
        }
        zone->nr_active += pgmoved;
-       spin_unlock(&zone->lru_lock);
 
-       __mod_page_state_zone(zone, pgrefill, pgscanned);
-       __mod_page_state(pgdeactivate, pgdeactivate);
-       local_irq_enable();
+       __count_zone_vm_events(PGREFILL, zone, pgscanned);
+       __count_vm_events(PGDEACTIVATE, pgdeactivate);
+       spin_unlock_irq(&zone->lru_lock);
 
        pagevec_release(&pvec);
 }
@@ -977,7 +976,7 @@ unsigned long try_to_free_pages(struct zone **zones, gfp_t gfp_mask)
                .swappiness = vm_swappiness,
        };
 
-       inc_page_state(allocstall);
+       count_vm_event(ALLOCSTALL);
 
        for (i = 0; zones[i] != NULL; i++) {
                struct zone *zone = zones[i];
@@ -990,7 +989,6 @@ unsigned long try_to_free_pages(struct zone **zones, gfp_t gfp_mask)
        }
 
        for (priority = DEF_PRIORITY; priority >= 0; priority--) {
-               sc.nr_mapped = read_page_state(nr_mapped);
                sc.nr_scanned = 0;
                if (!priority)
                        disable_swap_token();
@@ -1075,9 +1073,7 @@ loop_again:
        total_scanned = 0;
        nr_reclaimed = 0;
        sc.may_writepage = !laptop_mode;
-       sc.nr_mapped = read_page_state(nr_mapped);
-
-       inc_page_state(pageoutrun);
+       count_vm_event(PAGEOUTRUN);
 
        for (i = 0; i < pgdat->nr_zones; i++) {
                struct zone *zone = pgdat->node_zones + i;
@@ -1365,7 +1361,7 @@ unsigned long shrink_all_memory(unsigned long nr_pages)
        for_each_zone(zone)
                lru_pages += zone->nr_active + zone->nr_inactive;
 
-       nr_slab = read_page_state(nr_slab);
+       nr_slab = global_page_state(NR_SLAB);
        /* If slab caches are huge, it's better to hit them first */
        while (nr_slab >= lru_pages) {
                reclaim_state.reclaimed_slab = 0;
@@ -1407,9 +1403,7 @@ unsigned long shrink_all_memory(unsigned long nr_pages)
                for (prio = DEF_PRIORITY; prio >= 0; prio--) {
                        unsigned long nr_to_scan = nr_pages - ret;
 
-                       sc.nr_mapped = read_page_state(nr_mapped);
                        sc.nr_scanned = 0;
-
                        ret += shrink_all_zones(nr_to_scan, prio, pass, &sc);
                        if (ret >= nr_pages)
                                goto out;
@@ -1509,10 +1503,6 @@ module_init(kswapd_init)
  *
  * If non-zero call zone_reclaim when the number of free pages falls below
  * the watermarks.
- *
- * In the future we may add flags to the mode. However, the page allocator
- * should only have to check that zone_reclaim_mode != 0 before calling
- * zone_reclaim().
  */
 int zone_reclaim_mode __read_mostly;
 
@@ -1522,11 +1512,6 @@ int zone_reclaim_mode __read_mostly;
 #define RECLAIM_SWAP (1<<2)    /* Swap pages out during reclaim */
 #define RECLAIM_SLAB (1<<3)    /* Do a global slab shrink if the zone is out of memory */
 
-/*
- * Mininum time between zone reclaim scans
- */
-int zone_reclaim_interval __read_mostly = 30*HZ;
-
 /*
  * Priority for ZONE_RECLAIM. This determines the fraction of pages
  * of a node considered for each zone_reclaim. 4 scans 1/16th of
@@ -1534,6 +1519,12 @@ int zone_reclaim_interval __read_mostly = 30*HZ;
  */
 #define ZONE_RECLAIM_PRIORITY 4
 
+/*
+ * Percentage of pages in a zone that must be unmapped for zone_reclaim to
+ * occur.
+ */
+int sysctl_min_unmapped_ratio = 1;
+
 /*
  * Try to free up some pages from this zone through reclaim.
  */
@@ -1548,7 +1539,6 @@ static int __zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order)
        struct scan_control sc = {
                .may_writepage = !!(zone_reclaim_mode & RECLAIM_WRITE),
                .may_swap = !!(zone_reclaim_mode & RECLAIM_SWAP),
-               .nr_mapped = read_page_state(nr_mapped),
                .swap_cluster_max = max_t(unsigned long, nr_pages,
                                        SWAP_CLUSTER_MAX),
                .gfp_mask = gfp_mask,
@@ -1593,16 +1583,6 @@ static int __zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order)
 
        p->reclaim_state = NULL;
        current->flags &= ~(PF_MEMALLOC | PF_SWAPWRITE);
-
-       if (nr_reclaimed == 0) {
-               /*
-                * We were unable to reclaim enough pages to stay on node.  We
-                * now allow off node accesses for a certain time period before
-                * trying again to reclaim pages from the local zone.
-                */
-               zone->last_unsuccessful_zone_reclaim = jiffies;
-       }
-
        return nr_reclaimed >= nr_pages;
 }
 
@@ -1612,14 +1592,17 @@ int zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order)
        int node_id;
 
        /*
-        * Do not reclaim if there was a recent unsuccessful attempt at zone
-        * reclaim.  In that case we let allocations go off node for the
-        * zone_reclaim_interval.  Otherwise we would scan for each off-node
-        * page allocation.
+        * Zone reclaim reclaims unmapped file backed pages.
+        *
+        * A small portion of unmapped file backed pages is needed for
+        * file I/O otherwise pages read by file I/O will be immediately
+        * thrown out if the zone is overallocated. So we do not reclaim
+        * if less than a specified percentage of the zone is used by
+        * unmapped file backed pages.
         */
-       if (time_before(jiffies,
-               zone->last_unsuccessful_zone_reclaim + zone_reclaim_interval))
-                       return 0;
+       if (zone_page_state(zone, NR_FILE_PAGES) -
+           zone_page_state(zone, NR_FILE_MAPPED) <= zone->min_unmapped_ratio)
+               return 0;
 
        /*
         * Avoid concurrent zone reclaims, do not reclaim in a zone that does
diff --git a/mm/vmstat.c b/mm/vmstat.c
new file mode 100644 (file)
index 0000000..73b83d6
--- /dev/null
@@ -0,0 +1,614 @@
+/*
+ *  linux/mm/vmstat.c
+ *
+ *  Manages VM statistics
+ *  Copyright (C) 1991, 1992, 1993, 1994  Linus Torvalds
+ *
+ *  zoned VM statistics
+ *  Copyright (C) 2006 Silicon Graphics, Inc.,
+ *             Christoph Lameter <christoph@lameter.com>
+ */
+
+#include <linux/config.h>
+#include <linux/mm.h>
+#include <linux/module.h>
+
+void __get_zone_counts(unsigned long *active, unsigned long *inactive,
+                       unsigned long *free, struct pglist_data *pgdat)
+{
+       struct zone *zones = pgdat->node_zones;
+       int i;
+
+       *active = 0;
+       *inactive = 0;
+       *free = 0;
+       for (i = 0; i < MAX_NR_ZONES; i++) {
+               *active += zones[i].nr_active;
+               *inactive += zones[i].nr_inactive;
+               *free += zones[i].free_pages;
+       }
+}
+
+void get_zone_counts(unsigned long *active,
+               unsigned long *inactive, unsigned long *free)
+{
+       struct pglist_data *pgdat;
+
+       *active = 0;
+       *inactive = 0;
+       *free = 0;
+       for_each_online_pgdat(pgdat) {
+               unsigned long l, m, n;
+               __get_zone_counts(&l, &m, &n, pgdat);
+               *active += l;
+               *inactive += m;
+               *free += n;
+       }
+}
+
+#ifdef CONFIG_VM_EVENT_COUNTERS
+DEFINE_PER_CPU(struct vm_event_state, vm_event_states) = {{0}};
+EXPORT_PER_CPU_SYMBOL(vm_event_states);
+
+static void sum_vm_events(unsigned long *ret, cpumask_t *cpumask)
+{
+       int cpu = 0;
+       int i;
+
+       memset(ret, 0, NR_VM_EVENT_ITEMS * sizeof(unsigned long));
+
+       cpu = first_cpu(*cpumask);
+       while (cpu < NR_CPUS) {
+               struct vm_event_state *this = &per_cpu(vm_event_states, cpu);
+
+               cpu = next_cpu(cpu, *cpumask);
+
+               if (cpu < NR_CPUS)
+                       prefetch(&per_cpu(vm_event_states, cpu));
+
+
+               for (i = 0; i < NR_VM_EVENT_ITEMS; i++)
+                       ret[i] += this->event[i];
+       }
+}
+
+/*
+ * Accumulate the vm event counters across all CPUs.
+ * The result is unavoidably approximate - it can change
+ * during and after execution of this function.
+*/
+void all_vm_events(unsigned long *ret)
+{
+       sum_vm_events(ret, &cpu_online_map);
+}
+
+#ifdef CONFIG_HOTPLUG
+/*
+ * Fold the foreign cpu events into our own.
+ *
+ * This is adding to the events on one processor
+ * but keeps the global counts constant.
+ */
+void vm_events_fold_cpu(int cpu)
+{
+       struct vm_event_state *fold_state = &per_cpu(vm_event_states, cpu);
+       int i;
+
+       for (i = 0; i < NR_VM_EVENT_ITEMS; i++) {
+               count_vm_events(i, fold_state->event[i]);
+               fold_state->event[i] = 0;
+       }
+}
+#endif /* CONFIG_HOTPLUG */
+
+#endif /* CONFIG_VM_EVENT_COUNTERS */
+
+/*
+ * Manage combined zone based / global counters
+ *
+ * vm_stat contains the global counters
+ */
+atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS];
+EXPORT_SYMBOL(vm_stat);
+
+#ifdef CONFIG_SMP
+
+#define STAT_THRESHOLD 32
+
+/*
+ * Determine pointer to currently valid differential byte given a zone and
+ * the item number.
+ *
+ * Preemption must be off
+ */
+static inline s8 *diff_pointer(struct zone *zone, enum zone_stat_item item)
+{
+       return &zone_pcp(zone, smp_processor_id())->vm_stat_diff[item];
+}
+
+/*
+ * For use when we know that interrupts are disabled.
+ */
+void __mod_zone_page_state(struct zone *zone, enum zone_stat_item item,
+                               int delta)
+{
+       s8 *p;
+       long x;
+
+       p = diff_pointer(zone, item);
+       x = delta + *p;
+
+       if (unlikely(x > STAT_THRESHOLD || x < -STAT_THRESHOLD)) {
+               zone_page_state_add(x, zone, item);
+               x = 0;
+       }
+
+       *p = x;
+}
+EXPORT_SYMBOL(__mod_zone_page_state);
+
+/*
+ * For an unknown interrupt state
+ */
+void mod_zone_page_state(struct zone *zone, enum zone_stat_item item,
+                                       int delta)
+{
+       unsigned long flags;
+
+       local_irq_save(flags);
+       __mod_zone_page_state(zone, item, delta);
+       local_irq_restore(flags);
+}
+EXPORT_SYMBOL(mod_zone_page_state);
+
+/*
+ * Optimized increment and decrement functions.
+ *
+ * These are only for a single page and therefore can take a struct page *
+ * argument instead of struct zone *. This allows the inclusion of the code
+ * generated for page_zone(page) into the optimized functions.
+ *
+ * No overflow check is necessary and therefore the differential can be
+ * incremented or decremented in place which may allow the compilers to
+ * generate better code.
+ *
+ * The increment or decrement is known and therefore one boundary check can
+ * be omitted.
+ *
+ * Some processors have inc/dec instructions that are atomic vs an interrupt.
+ * However, the code must first determine the differential location in a zone
+ * based on the processor number and then inc/dec the counter. There is no
+ * guarantee without disabling preemption that the processor will not change
+ * in between and therefore the atomicity vs. interrupt cannot be exploited
+ * in a useful way here.
+ */
+static void __inc_zone_state(struct zone *zone, enum zone_stat_item item)
+{
+       s8 *p = diff_pointer(zone, item);
+
+       (*p)++;
+
+       if (unlikely(*p > STAT_THRESHOLD)) {
+               zone_page_state_add(*p, zone, item);
+               *p = 0;
+       }
+}
+
+void __inc_zone_page_state(struct page *page, enum zone_stat_item item)
+{
+       __inc_zone_state(page_zone(page), item);
+}
+EXPORT_SYMBOL(__inc_zone_page_state);
+
+void __dec_zone_page_state(struct page *page, enum zone_stat_item item)
+{
+       struct zone *zone = page_zone(page);
+       s8 *p = diff_pointer(zone, item);
+
+       (*p)--;
+
+       if (unlikely(*p < -STAT_THRESHOLD)) {
+               zone_page_state_add(*p, zone, item);
+               *p = 0;
+       }
+}
+EXPORT_SYMBOL(__dec_zone_page_state);
+
+void inc_zone_state(struct zone *zone, enum zone_stat_item item)
+{
+       unsigned long flags;
+
+       local_irq_save(flags);
+       __inc_zone_state(zone, item);
+       local_irq_restore(flags);
+}
+
+void inc_zone_page_state(struct page *page, enum zone_stat_item item)
+{
+       unsigned long flags;
+       struct zone *zone;
+
+       zone = page_zone(page);
+       local_irq_save(flags);
+       __inc_zone_state(zone, item);
+       local_irq_restore(flags);
+}
+EXPORT_SYMBOL(inc_zone_page_state);
+
+void dec_zone_page_state(struct page *page, enum zone_stat_item item)
+{
+       unsigned long flags;
+       struct zone *zone;
+       s8 *p;
+
+       zone = page_zone(page);
+       local_irq_save(flags);
+       p = diff_pointer(zone, item);
+
+       (*p)--;
+
+       if (unlikely(*p < -STAT_THRESHOLD)) {
+               zone_page_state_add(*p, zone, item);
+               *p = 0;
+       }
+       local_irq_restore(flags);
+}
+EXPORT_SYMBOL(dec_zone_page_state);
+
+/*
+ * Update the zone counters for one cpu.
+ */
+void refresh_cpu_vm_stats(int cpu)
+{
+       struct zone *zone;
+       int i;
+       unsigned long flags;
+
+       for_each_zone(zone) {
+               struct per_cpu_pageset *pcp;
+
+               pcp = zone_pcp(zone, cpu);
+
+               for (i = 0; i < NR_VM_ZONE_STAT_ITEMS; i++)
+                       if (pcp->vm_stat_diff[i]) {
+                               local_irq_save(flags);
+                               zone_page_state_add(pcp->vm_stat_diff[i],
+                                       zone, i);
+                               pcp->vm_stat_diff[i] = 0;
+                               local_irq_restore(flags);
+                       }
+       }
+}
+
+static void __refresh_cpu_vm_stats(void *dummy)
+{
+       refresh_cpu_vm_stats(smp_processor_id());
+}
+
+/*
+ * Consolidate all counters.
+ *
+ * Note that the result is less inaccurate but still inaccurate
+ * if concurrent processes are allowed to run.
+ */
+void refresh_vm_stats(void)
+{
+       on_each_cpu(__refresh_cpu_vm_stats, NULL, 0, 1);
+}
+EXPORT_SYMBOL(refresh_vm_stats);
+
+#endif
+
+#ifdef CONFIG_NUMA
+/*
+ * zonelist = the list of zones passed to the allocator
+ * z       = the zone from which the allocation occurred.
+ *
+ * Must be called with interrupts disabled.
+ */
+void zone_statistics(struct zonelist *zonelist, struct zone *z)
+{
+       if (z->zone_pgdat == zonelist->zones[0]->zone_pgdat) {
+               __inc_zone_state(z, NUMA_HIT);
+       } else {
+               __inc_zone_state(z, NUMA_MISS);
+               __inc_zone_state(zonelist->zones[0], NUMA_FOREIGN);
+       }
+       if (z->zone_pgdat == NODE_DATA(numa_node_id()))
+               __inc_zone_state(z, NUMA_LOCAL);
+       else
+               __inc_zone_state(z, NUMA_OTHER);
+}
+#endif
+
+#ifdef CONFIG_PROC_FS
+
+#include <linux/seq_file.h>
+
+static void *frag_start(struct seq_file *m, loff_t *pos)
+{
+       pg_data_t *pgdat;
+       loff_t node = *pos;
+       for (pgdat = first_online_pgdat();
+            pgdat && node;
+            pgdat = next_online_pgdat(pgdat))
+               --node;
+
+       return pgdat;
+}
+
+static void *frag_next(struct seq_file *m, void *arg, loff_t *pos)
+{
+       pg_data_t *pgdat = (pg_data_t *)arg;
+
+       (*pos)++;
+       return next_online_pgdat(pgdat);
+}
+
+static void frag_stop(struct seq_file *m, void *arg)
+{
+}
+
+/*
+ * This walks the free areas for each zone.
+ */
+static int frag_show(struct seq_file *m, void *arg)
+{
+       pg_data_t *pgdat = (pg_data_t *)arg;
+       struct zone *zone;
+       struct zone *node_zones = pgdat->node_zones;
+       unsigned long flags;
+       int order;
+
+       for (zone = node_zones; zone - node_zones < MAX_NR_ZONES; ++zone) {
+               if (!populated_zone(zone))
+                       continue;
+
+               spin_lock_irqsave(&zone->lock, flags);
+               seq_printf(m, "Node %d, zone %8s ", pgdat->node_id, zone->name);
+               for (order = 0; order < MAX_ORDER; ++order)
+                       seq_printf(m, "%6lu ", zone->free_area[order].nr_free);
+               spin_unlock_irqrestore(&zone->lock, flags);
+               seq_putc(m, '\n');
+       }
+       return 0;
+}
+
+struct seq_operations fragmentation_op = {
+       .start  = frag_start,
+       .next   = frag_next,
+       .stop   = frag_stop,
+       .show   = frag_show,
+};
+
+static char *vmstat_text[] = {
+       /* Zoned VM counters */
+       "nr_anon_pages",
+       "nr_mapped",
+       "nr_file_pages",
+       "nr_slab",
+       "nr_page_table_pages",
+       "nr_dirty",
+       "nr_writeback",
+       "nr_unstable",
+       "nr_bounce",
+
+#ifdef CONFIG_NUMA
+       "numa_hit",
+       "numa_miss",
+       "numa_foreign",
+       "numa_interleave",
+       "numa_local",
+       "numa_other",
+#endif
+
+#ifdef CONFIG_VM_EVENT_COUNTERS
+       "pgpgin",
+       "pgpgout",
+       "pswpin",
+       "pswpout",
+
+       "pgalloc_dma",
+       "pgalloc_dma32",
+       "pgalloc_normal",
+       "pgalloc_high",
+
+       "pgfree",
+       "pgactivate",
+       "pgdeactivate",
+
+       "pgfault",
+       "pgmajfault",
+
+       "pgrefill_dma",
+       "pgrefill_dma32",
+       "pgrefill_normal",
+       "pgrefill_high",
+
+       "pgsteal_dma",
+       "pgsteal_dma32",
+       "pgsteal_normal",
+       "pgsteal_high",
+
+       "pgscan_kswapd_dma",
+       "pgscan_kswapd_dma32",
+       "pgscan_kswapd_normal",
+       "pgscan_kswapd_high",
+
+       "pgscan_direct_dma",
+       "pgscan_direct_dma32",
+       "pgscan_direct_normal",
+       "pgscan_direct_high",
+
+       "pginodesteal",
+       "slabs_scanned",
+       "kswapd_steal",
+       "kswapd_inodesteal",
+       "pageoutrun",
+       "allocstall",
+
+       "pgrotated",
+#endif
+};
+
+/*
+ * Output information about zones in @pgdat.
+ */
+static int zoneinfo_show(struct seq_file *m, void *arg)
+{
+       pg_data_t *pgdat = arg;
+       struct zone *zone;
+       struct zone *node_zones = pgdat->node_zones;
+       unsigned long flags;
+
+       for (zone = node_zones; zone - node_zones < MAX_NR_ZONES; zone++) {
+               int i;
+
+               if (!populated_zone(zone))
+                       continue;
+
+               spin_lock_irqsave(&zone->lock, flags);
+               seq_printf(m, "Node %d, zone %8s", pgdat->node_id, zone->name);
+               seq_printf(m,
+                          "\n  pages free     %lu"
+                          "\n        min      %lu"
+                          "\n        low      %lu"
+                          "\n        high     %lu"
+                          "\n        active   %lu"
+                          "\n        inactive %lu"
+                          "\n        scanned  %lu (a: %lu i: %lu)"
+                          "\n        spanned  %lu"
+                          "\n        present  %lu",
+                          zone->free_pages,
+                          zone->pages_min,
+                          zone->pages_low,
+                          zone->pages_high,
+                          zone->nr_active,
+                          zone->nr_inactive,
+                          zone->pages_scanned,
+                          zone->nr_scan_active, zone->nr_scan_inactive,
+                          zone->spanned_pages,
+                          zone->present_pages);
+
+               for (i = 0; i < NR_VM_ZONE_STAT_ITEMS; i++)
+                       seq_printf(m, "\n    %-12s %lu", vmstat_text[i],
+                                       zone_page_state(zone, i));
+
+               seq_printf(m,
+                          "\n        protection: (%lu",
+                          zone->lowmem_reserve[0]);
+               for (i = 1; i < ARRAY_SIZE(zone->lowmem_reserve); i++)
+                       seq_printf(m, ", %lu", zone->lowmem_reserve[i]);
+               seq_printf(m,
+                          ")"
+                          "\n  pagesets");
+               for_each_online_cpu(i) {
+                       struct per_cpu_pageset *pageset;
+                       int j;
+
+                       pageset = zone_pcp(zone, i);
+                       for (j = 0; j < ARRAY_SIZE(pageset->pcp); j++) {
+                               if (pageset->pcp[j].count)
+                                       break;
+                       }
+                       if (j == ARRAY_SIZE(pageset->pcp))
+                               continue;
+                       for (j = 0; j < ARRAY_SIZE(pageset->pcp); j++) {
+                               seq_printf(m,
+                                          "\n    cpu: %i pcp: %i"
+                                          "\n              count: %i"
+                                          "\n              high:  %i"
+                                          "\n              batch: %i",
+                                          i, j,
+                                          pageset->pcp[j].count,
+                                          pageset->pcp[j].high,
+                                          pageset->pcp[j].batch);
+                       }
+               }
+               seq_printf(m,
+                          "\n  all_unreclaimable: %u"
+                          "\n  prev_priority:     %i"
+                          "\n  temp_priority:     %i"
+                          "\n  start_pfn:         %lu",
+                          zone->all_unreclaimable,
+                          zone->prev_priority,
+                          zone->temp_priority,
+                          zone->zone_start_pfn);
+               spin_unlock_irqrestore(&zone->lock, flags);
+               seq_putc(m, '\n');
+       }
+       return 0;
+}
+
+struct seq_operations zoneinfo_op = {
+       .start  = frag_start, /* iterate over all zones. The same as in
+                              * fragmentation. */
+       .next   = frag_next,
+       .stop   = frag_stop,
+       .show   = zoneinfo_show,
+};
+
+static void *vmstat_start(struct seq_file *m, loff_t *pos)
+{
+       unsigned long *v;
+#ifdef CONFIG_VM_EVENT_COUNTERS
+       unsigned long *e;
+#endif
+       int i;
+
+       if (*pos >= ARRAY_SIZE(vmstat_text))
+               return NULL;
+
+#ifdef CONFIG_VM_EVENT_COUNTERS
+       v = kmalloc(NR_VM_ZONE_STAT_ITEMS * sizeof(unsigned long)
+                       + sizeof(struct vm_event_state), GFP_KERNEL);
+#else
+       v = kmalloc(NR_VM_ZONE_STAT_ITEMS * sizeof(unsigned long),
+                       GFP_KERNEL);
+#endif
+       m->private = v;
+       if (!v)
+               return ERR_PTR(-ENOMEM);
+       for (i = 0; i < NR_VM_ZONE_STAT_ITEMS; i++)
+               v[i] = global_page_state(i);
+#ifdef CONFIG_VM_EVENT_COUNTERS
+       e = v + NR_VM_ZONE_STAT_ITEMS;
+       all_vm_events(e);
+       e[PGPGIN] /= 2;         /* sectors -> kbytes */
+       e[PGPGOUT] /= 2;
+#endif
+       return v + *pos;
+}
+
+static void *vmstat_next(struct seq_file *m, void *arg, loff_t *pos)
+{
+       (*pos)++;
+       if (*pos >= ARRAY_SIZE(vmstat_text))
+               return NULL;
+       return (unsigned long *)m->private + *pos;
+}
+
+static int vmstat_show(struct seq_file *m, void *arg)
+{
+       unsigned long *l = arg;
+       unsigned long off = l - (unsigned long *)m->private;
+
+       seq_printf(m, "%s %lu\n", vmstat_text[off], *l);
+       return 0;
+}
+
+static void vmstat_stop(struct seq_file *m, void *arg)
+{
+       kfree(m->private);
+       m->private = NULL;
+}
+
+struct seq_operations vmstat_op = {
+       .start  = vmstat_start,
+       .next   = vmstat_next,
+       .stop   = vmstat_stop,
+       .show   = vmstat_show,
+};
+
+#endif /* CONFIG_PROC_FS */
+
index 282c4ab1abe60836c79cccb39173cf2cbc918f92..2a27e37bc4cb263869b0e5a20643997064067713 100644 (file)
@@ -10,7 +10,6 @@
  *             v 1.0 03/22/99
  */
 
-#include <linux/config.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <linux/types.h>
index ac242a4bc346b541a09fe63456b17dcb64335ca5..797c6d961deba4468a83d7b1d19eeff23cedec56 100644 (file)
@@ -26,7 +26,6 @@
  *             Maciej W. Rozycki       :       IPv6 support
  */
  
-#include <linux/config.h>
 #include <linux/module.h>
 #include <asm/system.h>
 #include <linux/types.h>
index 700129556c13145b16355d2400d33b6b207843d7..ead56037398b58b6f8905beb935d93a267f5060c 100644 (file)
@@ -10,7 +10,6 @@
  *             2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/if_tr.h>
 #include <linux/sysctl.h>
index e9dc803f2fe0a67de78c4219227f4876352cd89a..d7d8f40c4fed0d17d0113eceb92de3d821e723fc 100644 (file)
@@ -17,7 +17,6 @@
 
 #include <asm/uaccess.h>
 #include <asm/system.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 3948949a609a63b5ad708c9e99fcf83295d22131..458031bfff558188f6820c5b02aa4fb46308899b 100644 (file)
@@ -364,6 +364,14 @@ static void vlan_transfer_operstate(const struct net_device *dev, struct net_dev
        }
 }
 
+/*
+ * vlan network devices have devices nesting below it, and are a special
+ * "super class" of normal network devices; split their locks off into a
+ * separate class since they always nest.
+ */
+static struct lock_class_key vlan_netdev_xmit_lock_key;
+
+
 /*  Attach a VLAN device to a mac address (ie Ethernet Card).
  *  Returns the device that was created, or NULL if there was
  *  an error of some kind.
@@ -460,6 +468,7 @@ static struct net_device *register_vlan_device(const char *eth_IF_name,
                    
        new_dev = alloc_netdev(sizeof(struct vlan_dev_info), name,
                               vlan_setup);
+
        if (new_dev == NULL)
                goto out_unlock;
 
@@ -518,6 +527,8 @@ static struct net_device *register_vlan_device(const char *eth_IF_name,
        if (register_netdevice(new_dev))
                goto out_free_newdev;
 
+       lockdep_set_class(&new_dev->_xmit_lock, &vlan_netdev_xmit_lock_key);
+
        new_dev->iflink = real_dev->ifindex;
        vlan_transfer_operstate(real_dev, new_dev);
        linkwatch_fire_event(new_dev); /* _MUST_ call rfc2863_policy() */
index 7b214cffc9566b8c6da537200fbbbf01f30fe63d..a8fc0de1f969a89e15382c54fd675e53f3eccd72 100644 (file)
@@ -17,7 +17,6 @@
  * Jan 20, 1998        Ben Greear     Initial Version
  *****************************************************************************/
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/stddef.h>      /* offsetof(), etc. */
 #include <linux/errno.h>       /* return codes */
index 7076097debc29e454e02856d232015ad44607f8c..f3777ec5bcb988bc9d33cb332aa96dc0dbeebd7d 100644 (file)
@@ -29,7 +29,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/if_arp.h>
 #include <net/sock.h>
 #include <net/datalink.h>
index dc4048dd98c1b60d68cf10ddcd1dadc169b48458..7ae4916cd26d9a2f78ef345867a3dfc4861c6ba5 100644 (file)
@@ -8,7 +8,6 @@
  *     Free Software Foundation, version 2.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
index 7b1eb9a4fc96881a68f9c23e92ea1679edc8cb4d..5ee96d4b40e9bef72712c3e0a1f114d67ab07481 100644 (file)
@@ -51,7 +51,6 @@
  * 
  */
 
-#include <linux/config.h>
 #include <linux/capability.h>
 #include <linux/module.h>
 #include <linux/if_arp.h>
index af7f0604395df7dab6fb1c64f3fd7910f1ad0c18..40b0af7437a2e0d5acbbcbfc59e5bc1ab37d5b6f 100644 (file)
@@ -6,7 +6,6 @@
  * Dynamic registration, added aarp entries. (5/30/97 Chris Horn)
  */
 
-#include <linux/config.h>
 #include <linux/sysctl.h>
 #include <net/sock.h>
 #include <linux/atalk.h>
index 680ccb12aae8652d194735c0645c78a040d1f8e9..a487233dc466f35e4b5964394b5f4d61da7fd9ce 100644 (file)
@@ -5,7 +5,6 @@ Author: Marcell GAL, 2000, XDSL Ltd, Hungary
 */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/list.h>
index f92f9c94d2c762c51ffe76031c7598e85759a574..121bf6f4914897713f0c9672e41b39f54501fd3b 100644 (file)
@@ -2,7 +2,6 @@
 
 /* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
 
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/kernel.h> /* for UINT_MAX */
@@ -24,6 +23,7 @@
 #include <linux/if.h> /* for IFF_UP */
 #include <linux/inetdevice.h>
 #include <linux/bitops.h>
+#include <linux/poison.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 #include <linux/rcupdate.h>
@@ -267,7 +267,7 @@ static void clip_neigh_destroy(struct neighbour *neigh)
        DPRINTK("clip_neigh_destroy (neigh %p)\n", neigh);
        if (NEIGH2ENTRY(neigh)->vccs)
                printk(KERN_CRIT "clip_neigh_destroy: vccs != NULL !!!\n");
-       NEIGH2ENTRY(neigh)->vccs = (void *) 0xdeadbeef;
+       NEIGH2ENTRY(neigh)->vccs = (void *) NEIGHBOR_DEAD;
 }
 
 static void clip_neigh_solicit(struct neighbour *neigh, struct sk_buff *skb)
index 35ab1a61e831471407bb0462782cd08bd65a2eba..fbabff49446830b45053103615095a44e0486c7d 100644 (file)
@@ -3,7 +3,6 @@
 /* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kmod.h>
 #include <linux/net.h>         /* struct socket, struct proto_ops */
index 851cfa6312af3288b9cdf14d1faa91028b583b88..8c2022c3e81dc05d0f9550e29c8bb9208fb4a4ac 100644 (file)
@@ -4,7 +4,6 @@
 /* 2003 John Levon  <levon@movementarian.org> */
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kmod.h>
 #include <linux/net.h>         /* struct socket, struct proto_ops */
index c4fc722fef9a2de2362b1b5ef52abba92d662996..4b68a18171cf4f0a8ae402cb6e0526bf7f05f383 100644 (file)
@@ -4,7 +4,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/bitops.h>
 #include <linux/capability.h>
index 6606082b29a87931eca6cddd91d1037edfc87c2e..c22a8bfa1f813bb0a61b9af087eb496a5daa91ae 100644 (file)
@@ -9,7 +9,6 @@
 #ifndef _LEC_H_
 #define _LEC_H_
 
-#include <linux/config.h>
 #include <linux/atmdev.h>
 #include <linux/netdevice.h>
 #include <linux/atmlec.h>
index 5fe77df0018693d3f872ae3c802f6df737f26ec1..9aafe1e2f04802a2398f51168cbcc4c4d53d300f 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/atmlec.h>
 #include <linux/atmmpc.h>
 /* Modular too */
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include "lec.h"
index 60834b5a14d60ad0608795e61b47b4cab8a52345..d37b8911b3abe938828d6737906d88d3bc05c814 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 
 #ifdef CONFIG_PROC_FS
 #include <linux/errno.h>
index 1489067c1e84474c8d958c6d829e83d06efc659a..76a7d8ff6c0e79f5ed940b76a514f1a53af464eb 100644 (file)
@@ -34,7 +34,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/skbuff.h>
 #include <linux/atm.h>
index 4041054e528252442b672830f710604d9a91b4c8..3f95b0886a6a659afd540ea8cb9f12011a03a3c5 100644 (file)
@@ -8,7 +8,6 @@
  * the reader.
  */
 
-#include <linux/config.h>
 #include <linux/module.h> /* for EXPORT_SYMBOL */
 #include <linux/string.h>
 #include <linux/types.h>
index f2c541774dcd77e14a7dc8cc47c53a36b3b6f3bb..b2148b43a42611c97780ff6dc8a0a8288527cf91 100644 (file)
@@ -3,7 +3,6 @@
 /* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
 
 
-#include <linux/config.h>
 #include <linux/net.h>         /* struct socket, struct proto_ops */
 #include <linux/atm.h>         /* ATM stuff */
 #include <linux/atmdev.h>      /* ATM devices */
index 534baf7040561448324537c50483d80fd97895b5..de25c6408b04024e0f5f7f85b8c22564839e148b 100644 (file)
@@ -8,7 +8,6 @@
  *          use the default destruct function initialized by sock_init_data */
 
 
-#include <linux/config.h>
 #include <linux/ctype.h>
 #include <linux/string.h>
 #include <linux/atmdev.h>
index 644989980c37f9b173cde5ca1ad3a5988922ff2a..1d004aaaeec1ac69d48b0b8deddb51737de668c2 100644 (file)
@@ -6,7 +6,6 @@
 #ifndef NET_ATM_RESOURCES_H
 #define NET_ATM_RESOURCES_H
 
-#include <linux/config.h>
 #include <linux/atmdev.h>
 #include <linux/mutex.h>
 
index a2e0dd047e9f66be4798cd2fadb2cec6d33c498a..10a3c0aa83987be6e563ed8439e7872f1a9419b4 100644 (file)
@@ -13,7 +13,6 @@
  * Copyright (C) Hans Alblas PE1AYX (hans@esrac.ele.tue.nl)
  * Copyright (C) Frederic Rible F1OAT (frible@teaser.fr)
  */
-#include <linux/config.h>
 #include <linux/capability.h>
 #include <linux/module.h>
 #include <linux/errno.h>
index dab77efe34a6620932d2a1063bcec9b8a129ad2b..47e6e790bd67951025681549b3b6d034fe8d0d9e 100644 (file)
@@ -6,7 +6,6 @@
  *
  * Copyright (C) Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk)
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/socket.h>
index 3bb152710b77cbe07cdc556b3700a42fc36094dc..77ba07c67682670f8d4a4035c98f6e166b9242e8 100644 (file)
@@ -6,7 +6,6 @@
  *
  * Copyright (C) Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk)
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/socket.h>
index a0b534f80f1774fc76a8daad66df1b2dc09aa656..136c3aefa9dec10983d1543c4cead6a876675019 100644 (file)
@@ -6,7 +6,6 @@
  *
  * Copyright (C) Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk)
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/socket.h>
@@ -104,11 +103,13 @@ int ax25_rebuild_header(struct sk_buff *skb)
 {
        struct sk_buff *ourskb;
        unsigned char *bp  = skb->data;
-       struct net_device *dev;
+       ax25_route *route;
+       struct net_device *dev = NULL;
        ax25_address *src, *dst;
+       ax25_digi *digipeat = NULL;
        ax25_dev *ax25_dev;
-       ax25_route _route, *route = &_route;
        ax25_cb *ax25;
+       char ip_mode = ' ';
 
        dst = (ax25_address *)(bp + 1);
        src = (ax25_address *)(bp + 8);
@@ -116,8 +117,12 @@ int ax25_rebuild_header(struct sk_buff *skb)
        if (arp_find(bp + 1, skb))
                return 1;
 
-       route = ax25_rt_find_route(route, dst, NULL);
-       dev      = route->dev;
+       route = ax25_get_route(dst, NULL);
+       if (route) {
+               digipeat = route->digipeat;
+               dev = route->dev;
+               ip_mode = route->ip_mode;
+       };
 
        if (dev == NULL)
                dev = skb->dev;
@@ -127,7 +132,7 @@ int ax25_rebuild_header(struct sk_buff *skb)
        }
 
        if (bp[16] == AX25_P_IP) {
-               if (route->ip_mode == 'V' || (route->ip_mode == ' ' && ax25_dev->values[AX25_VALUES_IPDEFMODE])) {
+               if (ip_mode == 'V' || (ip_mode == ' ' && ax25_dev->values[AX25_VALUES_IPDEFMODE])) {
                        /*
                         *      We copy the buffer and release the original thereby
                         *      keeping it straight
@@ -173,7 +178,7 @@ int ax25_rebuild_header(struct sk_buff *skb)
                            ourskb, 
                            ax25_dev->values[AX25_VALUES_PACLEN], 
                            &src_c,
-                           &dst_c, route->digipeat, dev);
+                           &dst_c, digipeat, dev);
                        if (ax25) {
                                ax25_cb_put(ax25);
                        }
@@ -191,7 +196,7 @@ int ax25_rebuild_header(struct sk_buff *skb)
 
        skb_pull(skb, AX25_KISS_HEADER_LEN);
 
-       if (route->digipeat != NULL) {
+       if (digipeat != NULL) {
                if ((ourskb = ax25_rt_build_path(skb, src, dst, route->digipeat)) == NULL) {
                        kfree_skb(skb);
                        goto put;
@@ -203,7 +208,8 @@ int ax25_rebuild_header(struct sk_buff *skb)
        ax25_queue_xmit(skb, dev);
 
 put:
-       ax25_put_route(route);
+       if (route)
+               ax25_put_route(route);
 
        return 1;
 }
index 5d99852b239cd9b932ddfe197a191acddf72ed11..d7736e58533656f32979ad81d3f17fc3747bf166 100644 (file)
@@ -8,7 +8,6 @@
  * Copyright (C) Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk)
  * Copyright (C) Joerg Reuter DL1BKE (jreuter@yaina.de)
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/socket.h>
index 5ac98250797bf8de2e1a0e5b158ce19315d55bd3..51b7bdaf27eb4877d0155b55b0a749a1f7cff8ff 100644 (file)
@@ -41,8 +41,6 @@
 static ax25_route *ax25_route_list;
 static DEFINE_RWLOCK(ax25_route_lock);
 
-static ax25_route *ax25_get_route(ax25_address *, struct net_device *);
-
 void ax25_rt_device_down(struct net_device *dev)
 {
        ax25_route *s, *t, *ax25_rt;
@@ -115,7 +113,7 @@ static int ax25_rt_add(struct ax25_routes_struct *route)
                return -ENOMEM;
        }
 
-       atomic_set(&ax25_rt->ref, 0);
+       atomic_set(&ax25_rt->refcount, 1);
        ax25_rt->callsign     = route->dest_addr;
        ax25_rt->dev          = ax25_dev->dev;
        ax25_rt->digipeat     = NULL;
@@ -140,23 +138,10 @@ static int ax25_rt_add(struct ax25_routes_struct *route)
        return 0;
 }
 
-static void ax25_rt_destroy(ax25_route *ax25_rt)
+void __ax25_put_route(ax25_route *ax25_rt)
 {
-       if (atomic_read(&ax25_rt->ref) == 0) {
-               kfree(ax25_rt->digipeat);
-               kfree(ax25_rt);
-               return;
-       }
-
-       /*
-        * Uh...  Route is still in use; we can't yet destroy it.  Retry later.
-        */
-       init_timer(&ax25_rt->timer);
-       ax25_rt->timer.data     = (unsigned long) ax25_rt;
-       ax25_rt->timer.function = (void *) ax25_rt_destroy;
-       ax25_rt->timer.expires  = jiffies + 5 * HZ;
-
-       add_timer(&ax25_rt->timer);
+       kfree(ax25_rt->digipeat);
+       kfree(ax25_rt);
 }
 
 static int ax25_rt_del(struct ax25_routes_struct *route)
@@ -177,12 +162,12 @@ static int ax25_rt_del(struct ax25_routes_struct *route)
                    ax25cmp(&route->dest_addr, &s->callsign) == 0) {
                        if (ax25_route_list == s) {
                                ax25_route_list = s->next;
-                               ax25_rt_destroy(s);
+                               ax25_put_route(s);
                        } else {
                                for (t = ax25_route_list; t != NULL; t = t->next) {
                                        if (t->next == s) {
                                                t->next = s->next;
-                                               ax25_rt_destroy(s);
+                                               ax25_put_route(s);
                                                break;
                                        }
                                }
@@ -362,7 +347,7 @@ struct file_operations ax25_route_fops = {
  *
  *     Only routes with a reference count of zero can be destroyed.
  */
-static ax25_route *ax25_get_route(ax25_address *addr, struct net_device *dev)
+ax25_route *ax25_get_route(ax25_address *addr, struct net_device *dev)
 {
        ax25_route *ax25_spe_rt = NULL;
        ax25_route *ax25_def_rt = NULL;
@@ -392,7 +377,7 @@ static ax25_route *ax25_get_route(ax25_address *addr, struct net_device *dev)
                ax25_rt = ax25_spe_rt;
 
        if (ax25_rt != NULL)
-               atomic_inc(&ax25_rt->ref);
+               ax25_hold_route(ax25_rt);
 
        read_unlock(&ax25_route_lock);
 
@@ -467,24 +452,6 @@ put:
        return 0;
 }
 
-ax25_route *ax25_rt_find_route(ax25_route * route, ax25_address *addr,
-       struct net_device *dev)
-{
-       ax25_route *ax25_rt;
-
-       if ((ax25_rt = ax25_get_route(addr, dev)))
-               return ax25_rt;
-
-       route->next     = NULL;
-       atomic_set(&route->ref, 1);
-       route->callsign = *addr;
-       route->dev      = dev;
-       route->digipeat = NULL;
-       route->ip_mode  = ' ';
-
-       return route;
-}
-
 struct sk_buff *ax25_rt_build_path(struct sk_buff *skb, ax25_address *src,
        ax25_address *dest, ax25_digi *digi)
 {
index ec254057f21239b8ab8124e9a16a2d90b2e1a5a7..72594867fab6005978e9df3c2753f6558410acb2 100644 (file)
@@ -12,7 +12,6 @@
  * Copyright (C) Frederic Rible F1OAT (frible@teaser.fr)
  * Copyright (C) 2002 Ralf Baechle DO1GRB (ralf@gnu.org)
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/socket.h>
index bdb64c36df12dc1b45d51ec0fa79a60c826b2629..369a75b160f2d688a898fe43a1b2f7203658bbd1 100644 (file)
@@ -6,7 +6,6 @@
  *
  * Copyright (C) 1996 Mike Shaver (shaver@zeroknowledge.com)
  */
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/sysctl.h>
 #include <linux/spinlock.h>
index 469eda0f0dfd713f0d998b5c830faaff2e9c71fd..788ea7a2b74498c10534501e62c3e91fd17c117e 100644 (file)
@@ -24,7 +24,6 @@
 
 /* Bluetooth address family and sockets. */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/types.h>
@@ -49,7 +48,7 @@
 #define BT_DBG(D...)
 #endif
 
-#define VERSION "2.8"
+#define VERSION "2.10"
 
 /* Bluetooth sockets */
 #define BT_MAX_PROTO   8
@@ -308,13 +307,21 @@ static struct net_proto_family bt_sock_family_ops = {
 
 static int __init bt_init(void)
 {
+       int err;
+
        BT_INFO("Core ver %s", VERSION);
 
-       sock_register(&bt_sock_family_ops);
+       err = bt_sysfs_init();
+       if (err < 0)
+               return err;
 
-       BT_INFO("HCI device and connection manager initialized");
+       err = sock_register(&bt_sock_family_ops);
+       if (err < 0) {
+               bt_sysfs_cleanup();
+               return err;
+       }
 
-       bt_sysfs_init();
+       BT_INFO("HCI device and connection manager initialized");
 
        hci_sock_init();
 
@@ -325,9 +332,9 @@ static void __exit bt_exit(void)
 {
        hci_sock_cleanup();
 
-       bt_sysfs_cleanup();
-
        sock_unregister(PF_BLUETOOTH);
+
+       bt_sysfs_cleanup();
 }
 
 subsys_initcall(bt_init);
index d908d49dc9f857cf753035badfba2c8785e285b9..e620061fb50fd83cd530167d863b1745f3f7a3fd 100644 (file)
@@ -29,7 +29,6 @@
  * $Id: core.c,v 1.20 2002/08/04 21:23:58 maxk Exp $
  */ 
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/kernel.h>
index 921204f95f4a108f5c4b62530238a9ac08374ed1..7f7b27db6a8fa50552fa21e0eca8490f1799dd8b 100644 (file)
@@ -29,7 +29,6 @@
  * $Id: netdev.c,v 1.8 2002/08/04 21:23:58 maxk Exp $
  */ 
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/socket.h>
index 2bfe796cf05dfb2a21305ddd4a58fd91ebe6cc13..28c55835422afb90f1bbf660f5dcb387bde3779b 100644 (file)
@@ -28,7 +28,6 @@
  * $Id: sock.c,v 1.4 2002/08/04 21:23:58 maxk Exp $
  */ 
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/types.h>
index b2e7e38531c602c72580570c331f1b3e6328536f..6fb47e00e188bb2c292f3d7e94a7689651b832f8 100644 (file)
@@ -20,7 +20,6 @@
    SOFTWARE IS DISCLAIMED.
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/types.h>
index 901eff7ebe74072d0c7f15df3ad5a420248b85a5..182254a580e26e504294ae22d4e042195cecfe58 100644 (file)
@@ -20,7 +20,6 @@
    SOFTWARE IS DISCLAIMED.
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/types.h>
index 8f8fad23f78afc0f81b577f82fcbb084bbe23bfb..10ad7fd91d833f26a188b073d46fea1ed1d2cd16 100644 (file)
@@ -20,7 +20,6 @@
    SOFTWARE IS DISCLAIMED.
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/types.h>
index f812ed129e589cc1929bdf06830eef5f60243006..420ed4d7e57e98e44615196248e7afb94d36498e 100644 (file)
@@ -24,7 +24,6 @@
 
 /* Bluetooth HCI connection handling. */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/types.h>
@@ -116,8 +115,8 @@ void hci_add_sco(struct hci_conn *conn, __u16 handle)
 
 static void hci_conn_timeout(unsigned long arg)
 {
-       struct hci_conn *conn = (void *)arg;
-       struct hci_dev  *hdev = conn->hdev;
+       struct hci_conn *conn = (void *) arg;
+       struct hci_dev *hdev = conn->hdev;
 
        BT_DBG("conn %p state %d", conn, conn->state);
 
@@ -133,11 +132,13 @@ static void hci_conn_timeout(unsigned long arg)
        return;
 }
 
-static void hci_conn_init_timer(struct hci_conn *conn)
+static void hci_conn_idle(unsigned long arg)
 {
-       init_timer(&conn->timer);
-       conn->timer.function = hci_conn_timeout;
-       conn->timer.data = (unsigned long)conn;
+       struct hci_conn *conn = (void *) arg;
+
+       BT_DBG("conn %p mode %d", conn, conn->mode);
+
+       hci_conn_enter_sniff_mode(conn);
 }
 
 struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst)
@@ -146,17 +147,27 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst)
 
        BT_DBG("%s dst %s", hdev->name, batostr(dst));
 
-       if (!(conn = kmalloc(sizeof(struct hci_conn), GFP_ATOMIC)))
+       conn = kzalloc(sizeof(struct hci_conn), GFP_ATOMIC);
+       if (!conn)
                return NULL;
-       memset(conn, 0, sizeof(struct hci_conn));
 
        bacpy(&conn->dst, dst);
-       conn->type   = type;
        conn->hdev   = hdev;
+       conn->type   = type;
+       conn->mode   = HCI_CM_ACTIVE;
        conn->state  = BT_OPEN;
 
+       conn->power_save = 1;
+
        skb_queue_head_init(&conn->data_q);
-       hci_conn_init_timer(conn);
+
+       init_timer(&conn->disc_timer);
+       conn->disc_timer.function = hci_conn_timeout;
+       conn->disc_timer.data = (unsigned long) conn;
+
+       init_timer(&conn->idle_timer);
+       conn->idle_timer.function = hci_conn_idle;
+       conn->idle_timer.data = (unsigned long) conn;
 
        atomic_set(&conn->refcnt, 0);
 
@@ -179,7 +190,9 @@ int hci_conn_del(struct hci_conn *conn)
 
        BT_DBG("%s conn %p handle %d", hdev->name, conn, conn->handle);
 
-       hci_conn_del_timer(conn);
+       del_timer(&conn->idle_timer);
+
+       del_timer(&conn->disc_timer);
 
        if (conn->type == SCO_LINK) {
                struct hci_conn *acl = conn->link;
@@ -365,6 +378,70 @@ int hci_conn_switch_role(struct hci_conn *conn, uint8_t role)
 }
 EXPORT_SYMBOL(hci_conn_switch_role);
 
+/* Enter active mode */
+void hci_conn_enter_active_mode(struct hci_conn *conn)
+{
+       struct hci_dev *hdev = conn->hdev;
+
+       BT_DBG("conn %p mode %d", conn, conn->mode);
+
+       if (test_bit(HCI_RAW, &hdev->flags))
+               return;
+
+       if (conn->mode != HCI_CM_SNIFF || !conn->power_save)
+               goto timer;
+
+       if (!test_and_set_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->pend)) {
+               struct hci_cp_exit_sniff_mode cp;
+               cp.handle = __cpu_to_le16(conn->handle);
+               hci_send_cmd(hdev, OGF_LINK_POLICY,
+                               OCF_EXIT_SNIFF_MODE, sizeof(cp), &cp);
+       }
+
+timer:
+       if (hdev->idle_timeout > 0)
+               mod_timer(&conn->idle_timer,
+                       jiffies + msecs_to_jiffies(hdev->idle_timeout));
+}
+
+/* Enter sniff mode */
+void hci_conn_enter_sniff_mode(struct hci_conn *conn)
+{
+       struct hci_dev *hdev = conn->hdev;
+
+       BT_DBG("conn %p mode %d", conn, conn->mode);
+
+       if (test_bit(HCI_RAW, &hdev->flags))
+               return;
+
+       if (!lmp_sniff_capable(hdev) || !lmp_sniff_capable(conn))
+               return;
+
+       if (conn->mode != HCI_CM_ACTIVE || !(conn->link_policy & HCI_LP_SNIFF))
+               return;
+
+       if (lmp_sniffsubr_capable(hdev) && lmp_sniffsubr_capable(conn)) {
+               struct hci_cp_sniff_subrate cp;
+               cp.handle             = __cpu_to_le16(conn->handle);
+               cp.max_latency        = __constant_cpu_to_le16(0);
+               cp.min_remote_timeout = __constant_cpu_to_le16(0);
+               cp.min_local_timeout  = __constant_cpu_to_le16(0);
+               hci_send_cmd(hdev, OGF_LINK_POLICY,
+                               OCF_SNIFF_SUBRATE, sizeof(cp), &cp);
+       }
+
+       if (!test_and_set_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->pend)) {
+               struct hci_cp_sniff_mode cp;
+               cp.handle       = __cpu_to_le16(conn->handle);
+               cp.max_interval = __cpu_to_le16(hdev->sniff_max_interval);
+               cp.min_interval = __cpu_to_le16(hdev->sniff_min_interval);
+               cp.attempt      = __constant_cpu_to_le16(4);
+               cp.timeout      = __constant_cpu_to_le16(1);
+               hci_send_cmd(hdev, OGF_LINK_POLICY,
+                               OCF_SNIFF_MODE, sizeof(cp), &cp);
+       }
+}
+
 /* Drop all connection on the device */
 void hci_conn_hash_flush(struct hci_dev *hdev)
 {
index a49a6975092dcc32e4830ca5ffcc830cc1d98704..54e8e5ea21542ef47d87dcb84e47ae9917a581b1 100644 (file)
@@ -24,7 +24,6 @@
 
 /* Bluetooth HCI core. */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kmod.h>
 
@@ -412,7 +411,7 @@ int hci_inquiry(void __user *arg)
        }
        hci_dev_unlock_bh(hdev);
 
-       timeo = ir.length * 2 * HZ;
+       timeo = ir.length * msecs_to_jiffies(2000);
        if (do_inquiry && (err = hci_request(hdev, hci_inq_req, (unsigned long)&ir, timeo)) < 0)
                goto done;
 
@@ -480,7 +479,8 @@ int hci_dev_open(__u16 dev)
                set_bit(HCI_INIT, &hdev->flags);
 
                //__hci_request(hdev, hci_reset_req, 0, HZ);
-               ret = __hci_request(hdev, hci_init_req, 0, HCI_INIT_TIMEOUT);
+               ret = __hci_request(hdev, hci_init_req, 0,
+                                       msecs_to_jiffies(HCI_INIT_TIMEOUT));
 
                clear_bit(HCI_INIT, &hdev->flags);
        }
@@ -547,7 +547,8 @@ static int hci_dev_do_close(struct hci_dev *hdev)
        atomic_set(&hdev->cmd_cnt, 1);
        if (!test_bit(HCI_RAW, &hdev->flags)) {
                set_bit(HCI_INIT, &hdev->flags);
-               __hci_request(hdev, hci_reset_req, 0, HZ/4);
+               __hci_request(hdev, hci_reset_req, 0,
+                                       msecs_to_jiffies(250));
                clear_bit(HCI_INIT, &hdev->flags);
        }
 
@@ -620,7 +621,8 @@ int hci_dev_reset(__u16 dev)
        hdev->acl_cnt = 0; hdev->sco_cnt = 0;
 
        if (!test_bit(HCI_RAW, &hdev->flags))
-               ret = __hci_request(hdev, hci_reset_req, 0, HCI_INIT_TIMEOUT);
+               ret = __hci_request(hdev, hci_reset_req, 0,
+                                       msecs_to_jiffies(HCI_INIT_TIMEOUT));
 
 done:
        tasklet_enable(&hdev->tx_task);
@@ -658,7 +660,8 @@ int hci_dev_cmd(unsigned int cmd, void __user *arg)
 
        switch (cmd) {
        case HCISETAUTH:
-               err = hci_request(hdev, hci_auth_req, dr.dev_opt, HCI_INIT_TIMEOUT);
+               err = hci_request(hdev, hci_auth_req, dr.dev_opt,
+                                       msecs_to_jiffies(HCI_INIT_TIMEOUT));
                break;
 
        case HCISETENCRYPT:
@@ -669,18 +672,19 @@ int hci_dev_cmd(unsigned int cmd, void __user *arg)
 
                if (!test_bit(HCI_AUTH, &hdev->flags)) {
                        /* Auth must be enabled first */
-                       err = hci_request(hdev, hci_auth_req,
-                                       dr.dev_opt, HCI_INIT_TIMEOUT);
+                       err = hci_request(hdev, hci_auth_req, dr.dev_opt,
+                                       msecs_to_jiffies(HCI_INIT_TIMEOUT));
                        if (err)
                                break;
                }
 
-               err = hci_request(hdev, hci_encrypt_req,
-                                       dr.dev_opt, HCI_INIT_TIMEOUT);
+               err = hci_request(hdev, hci_encrypt_req, dr.dev_opt,
+                                       msecs_to_jiffies(HCI_INIT_TIMEOUT));
                break;
 
        case HCISETSCAN:
-               err = hci_request(hdev, hci_scan_req, dr.dev_opt, HCI_INIT_TIMEOUT);
+               err = hci_request(hdev, hci_scan_req, dr.dev_opt,
+                                       msecs_to_jiffies(HCI_INIT_TIMEOUT));
                break;
 
        case HCISETPTYPE:
@@ -813,8 +817,8 @@ void hci_free_dev(struct hci_dev *hdev)
 {
        skb_queue_purge(&hdev->driver_init);
 
-       /* will free via class release */
-       class_device_put(&hdev->class_dev);
+       /* will free via device release */
+       put_device(&hdev->dev);
 }
 EXPORT_SYMBOL(hci_free_dev);
 
@@ -849,6 +853,10 @@ int hci_register_dev(struct hci_dev *hdev)
        hdev->pkt_type  = (HCI_DM1 | HCI_DH1 | HCI_HV1);
        hdev->link_mode = (HCI_LM_ACCEPT);
 
+       hdev->idle_timeout = 0;
+       hdev->sniff_max_interval = 800;
+       hdev->sniff_min_interval = 80;
+
        tasklet_init(&hdev->cmd_task, hci_cmd_task,(unsigned long) hdev);
        tasklet_init(&hdev->rx_task, hci_rx_task, (unsigned long) hdev);
        tasklet_init(&hdev->tx_task, hci_tx_task, (unsigned long) hdev);
@@ -1221,6 +1229,9 @@ static inline void hci_sched_acl(struct hci_dev *hdev)
        while (hdev->acl_cnt && (conn = hci_low_sent(hdev, ACL_LINK, &quote))) {
                while (quote-- && (skb = skb_dequeue(&conn->data_q))) {
                        BT_DBG("skb %p len %d", skb, skb->len);
+
+                       hci_conn_enter_active_mode(conn);
+
                        hci_send_frame(skb);
                        hdev->acl_last_tx = jiffies;
 
@@ -1299,6 +1310,8 @@ static inline void hci_acldata_packet(struct hci_dev *hdev, struct sk_buff *skb)
        if (conn) {
                register struct hci_proto *hp;
 
+               hci_conn_enter_active_mode(conn);
+
                /* Send to upper protocol */
                if ((hp = hci_proto[HCI_PROTO_L2CAP]) && hp->recv_acldata) {
                        hp->recv_acldata(conn, skb, flags);
index eb64555d1fb346d90ff34dad9ed16ef4700d0fdc..3896dabab11da70898640581f9c3e5b2195f7678 100644 (file)
@@ -24,7 +24,6 @@
 
 /* Bluetooth HCI event handling. */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/types.h>
@@ -84,6 +83,8 @@ static void hci_cc_link_policy(struct hci_dev *hdev, __u16 ocf, struct sk_buff *
 {
        struct hci_conn *conn;
        struct hci_rp_role_discovery *rd;
+       struct hci_rp_write_link_policy *lp;
+       void *sent;
 
        BT_DBG("%s ocf 0x%x", hdev->name, ocf);
 
@@ -107,6 +108,27 @@ static void hci_cc_link_policy(struct hci_dev *hdev, __u16 ocf, struct sk_buff *
                hci_dev_unlock(hdev);
                break;
 
+       case OCF_WRITE_LINK_POLICY:
+               sent = hci_sent_cmd_data(hdev, OGF_LINK_POLICY, OCF_WRITE_LINK_POLICY);
+               if (!sent)
+                       break;
+
+               lp = (struct hci_rp_write_link_policy *) skb->data;
+
+               if (lp->status)
+                       break;
+
+               hci_dev_lock(hdev);
+
+               conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(lp->handle));
+               if (conn) {
+                       __le16 policy = get_unaligned((__le16 *) (sent + 2));
+                       conn->link_policy = __le16_to_cpu(policy);
+               }
+
+               hci_dev_unlock(hdev);
+               break;
+
        default:
                BT_DBG("%s: Command complete: ogf LINK_POLICY ocf %x", 
                                hdev->name, ocf);
@@ -275,7 +297,7 @@ static void hci_cc_host_ctl(struct hci_dev *hdev, __u16 ocf, struct sk_buff *skb
 /* Command Complete OGF INFO_PARAM  */
 static void hci_cc_info_param(struct hci_dev *hdev, __u16 ocf, struct sk_buff *skb)
 {
-       struct hci_rp_read_loc_features *lf;
+       struct hci_rp_read_local_features *lf;
        struct hci_rp_read_buffer_size *bs;
        struct hci_rp_read_bd_addr *ba;
 
@@ -283,7 +305,7 @@ static void hci_cc_info_param(struct hci_dev *hdev, __u16 ocf, struct sk_buff *s
 
        switch (ocf) {
        case OCF_READ_LOCAL_FEATURES:
-               lf = (struct hci_rp_read_loc_features *) skb->data;
+               lf = (struct hci_rp_read_local_features *) skb->data;
 
                if (lf->status) {
                        BT_DBG("%s READ_LOCAL_FEATURES failed %d", hdev->name, lf->status);
@@ -320,9 +342,17 @@ static void hci_cc_info_param(struct hci_dev *hdev, __u16 ocf, struct sk_buff *s
                }
 
                hdev->acl_mtu  = __le16_to_cpu(bs->acl_mtu);
-               hdev->sco_mtu  = bs->sco_mtu ? bs->sco_mtu : 64;
-               hdev->acl_pkts = hdev->acl_cnt = __le16_to_cpu(bs->acl_max_pkt);
-               hdev->sco_pkts = hdev->sco_cnt = __le16_to_cpu(bs->sco_max_pkt);
+               hdev->sco_mtu  = bs->sco_mtu;
+               hdev->acl_pkts = __le16_to_cpu(bs->acl_max_pkt);
+               hdev->sco_pkts = __le16_to_cpu(bs->sco_max_pkt);
+
+               if (test_bit(HCI_QUIRK_FIXUP_BUFFER_SIZE, &hdev->quirks)) {
+                       hdev->sco_mtu  = 64;
+                       hdev->sco_pkts = 8;
+               }
+
+               hdev->acl_cnt = hdev->acl_pkts;
+               hdev->sco_cnt = hdev->sco_pkts;
 
                BT_DBG("%s mtu: acl %d, sco %d max_pkt: acl %d, sco %d", hdev->name,
                        hdev->acl_mtu, hdev->sco_mtu, hdev->acl_pkts, hdev->sco_pkts);
@@ -440,8 +470,46 @@ static void hci_cs_link_policy(struct hci_dev *hdev, __u16 ocf, __u8 status)
        BT_DBG("%s ocf 0x%x", hdev->name, ocf);
 
        switch (ocf) {
+       case OCF_SNIFF_MODE:
+               if (status) {
+                       struct hci_conn *conn;
+                       struct hci_cp_sniff_mode *cp = hci_sent_cmd_data(hdev, OGF_LINK_POLICY, OCF_SNIFF_MODE);
+
+                       if (!cp)
+                               break;
+
+                       hci_dev_lock(hdev);
+
+                       conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle));
+                       if (conn) {
+                               clear_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->pend);
+                       }
+
+                       hci_dev_unlock(hdev);
+               }
+               break;
+
+       case OCF_EXIT_SNIFF_MODE:
+               if (status) {
+                       struct hci_conn *conn;
+                       struct hci_cp_exit_sniff_mode *cp = hci_sent_cmd_data(hdev, OGF_LINK_POLICY, OCF_EXIT_SNIFF_MODE);
+
+                       if (!cp)
+                               break;
+
+                       hci_dev_lock(hdev);
+
+                       conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle));
+                       if (conn) {
+                               clear_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->pend);
+                       }
+
+                       hci_dev_unlock(hdev);
+               }
+               break;
+
        default:
-               BT_DBG("%s Command status: ogf HOST_POLICY ocf %x", hdev->name, ocf);
+               BT_DBG("%s Command status: ogf LINK_POLICY ocf %x", hdev->name, ocf);
                break;
        }
 }
@@ -623,14 +691,16 @@ static inline void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *sk
                else
                        cp.role = 0x01; /* Remain slave */
 
-               hci_send_cmd(hdev, OGF_LINK_CTL, OCF_ACCEPT_CONN_REQ, sizeof(cp), &cp);
+               hci_send_cmd(hdev, OGF_LINK_CTL,
+                               OCF_ACCEPT_CONN_REQ, sizeof(cp), &cp);
        } else {
                /* Connection rejected */
                struct hci_cp_reject_conn_req cp;
 
                bacpy(&cp.bdaddr, &ev->bdaddr);
                cp.reason = 0x0f;
-               hci_send_cmd(hdev, OGF_LINK_CTL, OCF_REJECT_CONN_REQ, sizeof(cp), &cp);
+               hci_send_cmd(hdev, OGF_LINK_CTL,
+                               OCF_REJECT_CONN_REQ, sizeof(cp), &cp);
        }
 }
 
@@ -638,7 +708,7 @@ static inline void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *sk
 static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
 {
        struct hci_ev_conn_complete *ev = (struct hci_ev_conn_complete *) skb->data;
-       struct hci_conn *conn = NULL;
+       struct hci_conn *conn;
 
        BT_DBG("%s", hdev->name);
 
@@ -660,12 +730,21 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s
                if (test_bit(HCI_ENCRYPT, &hdev->flags))
                        conn->link_mode |= HCI_LM_ENCRYPT;
 
+               /* Get remote features */
+               if (conn->type == ACL_LINK) {
+                       struct hci_cp_read_remote_features cp;
+                       cp.handle = ev->handle;
+                       hci_send_cmd(hdev, OGF_LINK_CTL,
+                               OCF_READ_REMOTE_FEATURES, sizeof(cp), &cp);
+               }
+
                /* Set link policy */
                if (conn->type == ACL_LINK && hdev->link_policy) {
                        struct hci_cp_write_link_policy cp;
                        cp.handle = ev->handle;
                        cp.policy = __cpu_to_le16(hdev->link_policy);
-                       hci_send_cmd(hdev, OGF_LINK_POLICY, OCF_WRITE_LINK_POLICY, sizeof(cp), &cp);
+                       hci_send_cmd(hdev, OGF_LINK_POLICY,
+                               OCF_WRITE_LINK_POLICY, sizeof(cp), &cp);
                }
 
                /* Set packet type for incoming connection */
@@ -676,7 +755,8 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s
                                __cpu_to_le16(hdev->pkt_type & ACL_PTYPE_MASK):
                                __cpu_to_le16(hdev->pkt_type & SCO_PTYPE_MASK);
 
-                       hci_send_cmd(hdev, OGF_LINK_CTL, OCF_CHANGE_CONN_PTYPE, sizeof(cp), &cp);
+                       hci_send_cmd(hdev, OGF_LINK_CTL,
+                               OCF_CHANGE_CONN_PTYPE, sizeof(cp), &cp);
                }
        } else
                conn->state = BT_CLOSED;
@@ -704,8 +784,7 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s
 static inline void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
 {
        struct hci_ev_disconn_complete *ev = (struct hci_ev_disconn_complete *) skb->data;
-       struct hci_conn *conn = NULL;
-       __u16 handle = __le16_to_cpu(ev->handle);
+       struct hci_conn *conn;
 
        BT_DBG("%s status %d", hdev->name, ev->status);
 
@@ -714,7 +793,7 @@ static inline void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff
 
        hci_dev_lock(hdev);
 
-       conn = hci_conn_hash_lookup_handle(hdev, handle);
+       conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle));
        if (conn) {
                conn->state = BT_CLOSED;
                hci_proto_disconn_ind(conn, ev->reason);
@@ -771,7 +850,7 @@ static inline void hci_num_comp_pkts_evt(struct hci_dev *hdev, struct sk_buff *s
 static inline void hci_role_change_evt(struct hci_dev *hdev, struct sk_buff *skb)
 {
        struct hci_ev_role_change *ev = (struct hci_ev_role_change *) skb->data;
-       struct hci_conn *conn = NULL;
+       struct hci_conn *conn;
 
        BT_DBG("%s status %d", hdev->name, ev->status);
 
@@ -794,18 +873,43 @@ static inline void hci_role_change_evt(struct hci_dev *hdev, struct sk_buff *skb
        hci_dev_unlock(hdev);
 }
 
+/* Mode Change */
+static inline void hci_mode_change_evt(struct hci_dev *hdev, struct sk_buff *skb)
+{
+       struct hci_ev_mode_change *ev = (struct hci_ev_mode_change *) skb->data;
+       struct hci_conn *conn;
+
+       BT_DBG("%s status %d", hdev->name, ev->status);
+
+       hci_dev_lock(hdev);
+
+       conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle));
+       if (conn) {
+               conn->mode = ev->mode;
+               conn->interval = __le16_to_cpu(ev->interval);
+
+               if (!test_and_clear_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->pend)) {
+                       if (conn->mode == HCI_CM_ACTIVE)
+                               conn->power_save = 1;
+                       else
+                               conn->power_save = 0;
+               }
+       }
+
+       hci_dev_unlock(hdev);
+}
+
 /* Authentication Complete */
 static inline void hci_auth_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
 {
        struct hci_ev_auth_complete *ev = (struct hci_ev_auth_complete *) skb->data;
-       struct hci_conn *conn = NULL;
-       __u16 handle = __le16_to_cpu(ev->handle);
+       struct hci_conn *conn;
 
        BT_DBG("%s status %d", hdev->name, ev->status);
 
        hci_dev_lock(hdev);
 
-       conn = hci_conn_hash_lookup_handle(hdev, handle);
+       conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle));
        if (conn) {
                if (!ev->status)
                        conn->link_mode |= HCI_LM_AUTH;
@@ -820,8 +924,7 @@ static inline void hci_auth_complete_evt(struct hci_dev *hdev, struct sk_buff *s
                                cp.handle  = __cpu_to_le16(conn->handle);
                                cp.encrypt = 1;
                                hci_send_cmd(conn->hdev, OGF_LINK_CTL,
-                                               OCF_SET_CONN_ENCRYPT,
-                                               sizeof(cp), &cp);
+                                       OCF_SET_CONN_ENCRYPT, sizeof(cp), &cp);
                        } else {
                                clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend);
                                hci_encrypt_cfm(conn, ev->status, 0x00);
@@ -836,14 +939,13 @@ static inline void hci_auth_complete_evt(struct hci_dev *hdev, struct sk_buff *s
 static inline void hci_encrypt_change_evt(struct hci_dev *hdev, struct sk_buff *skb)
 {
        struct hci_ev_encrypt_change *ev = (struct hci_ev_encrypt_change *) skb->data;
-       struct hci_conn *conn = NULL;
-       __u16 handle = __le16_to_cpu(ev->handle);
+       struct hci_conn *conn;
 
        BT_DBG("%s status %d", hdev->name, ev->status);
 
        hci_dev_lock(hdev);
 
-       conn = hci_conn_hash_lookup_handle(hdev, handle);
+       conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle));
        if (conn) {
                if (!ev->status) {
                        if (ev->encrypt)
@@ -864,14 +966,13 @@ static inline void hci_encrypt_change_evt(struct hci_dev *hdev, struct sk_buff *
 static inline void hci_change_conn_link_key_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
 {
        struct hci_ev_change_conn_link_key_complete *ev = (struct hci_ev_change_conn_link_key_complete *) skb->data;
-       struct hci_conn *conn = NULL;
-       __u16 handle = __le16_to_cpu(ev->handle);
+       struct hci_conn *conn;
 
        BT_DBG("%s status %d", hdev->name, ev->status);
 
        hci_dev_lock(hdev);
 
-       conn = hci_conn_hash_lookup_handle(hdev, handle);
+       conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle));
        if (conn) {
                if (!ev->status)
                        conn->link_mode |= HCI_LM_SECURE;
@@ -899,18 +1000,35 @@ static inline void hci_link_key_notify_evt(struct hci_dev *hdev, struct sk_buff
 {
 }
 
+/* Remote Features */
+static inline void hci_remote_features_evt(struct hci_dev *hdev, struct sk_buff *skb)
+{
+       struct hci_ev_remote_features *ev = (struct hci_ev_remote_features *) skb->data;
+       struct hci_conn *conn;
+
+       BT_DBG("%s status %d", hdev->name, ev->status);
+
+       hci_dev_lock(hdev);
+
+       conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle));
+       if (conn && !ev->status) {
+               memcpy(conn->features, ev->features, sizeof(conn->features));
+       }
+
+       hci_dev_unlock(hdev);
+}
+
 /* Clock Offset */
 static inline void hci_clock_offset_evt(struct hci_dev *hdev, struct sk_buff *skb)
 {
        struct hci_ev_clock_offset *ev = (struct hci_ev_clock_offset *) skb->data;
-       struct hci_conn *conn = NULL;
-       __u16 handle = __le16_to_cpu(ev->handle);
+       struct hci_conn *conn;
 
        BT_DBG("%s status %d", hdev->name, ev->status);
 
        hci_dev_lock(hdev);
 
-       conn = hci_conn_hash_lookup_handle(hdev, handle);
+       conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle));
        if (conn && !ev->status) {
                struct inquiry_entry *ie;
 
@@ -941,6 +1059,23 @@ static inline void hci_pscan_rep_mode_evt(struct hci_dev *hdev, struct sk_buff *
        hci_dev_unlock(hdev);
 }
 
+/* Sniff Subrate */
+static inline void hci_sniff_subrate_evt(struct hci_dev *hdev, struct sk_buff *skb)
+{
+       struct hci_ev_sniff_subrate *ev = (struct hci_ev_sniff_subrate *) skb->data;
+       struct hci_conn *conn;
+
+       BT_DBG("%s status %d", hdev->name, ev->status);
+
+       hci_dev_lock(hdev);
+
+       conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle));
+       if (conn) {
+       }
+
+       hci_dev_unlock(hdev);
+}
+
 void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb)
 {
        struct hci_event_hdr *hdr = (struct hci_event_hdr *) skb->data;
@@ -989,6 +1124,10 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb)
                hci_role_change_evt(hdev, skb);
                break;
 
+       case HCI_EV_MODE_CHANGE:
+               hci_mode_change_evt(hdev, skb);
+               break;
+
        case HCI_EV_AUTH_COMPLETE:
                hci_auth_complete_evt(hdev, skb);
                break;
@@ -1013,6 +1152,10 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb)
                hci_link_key_notify_evt(hdev, skb);
                break;
 
+       case HCI_EV_REMOTE_FEATURES:
+               hci_remote_features_evt(hdev, skb);
+               break;
+
        case HCI_EV_CLOCK_OFFSET:
                hci_clock_offset_evt(hdev, skb);
                break;
@@ -1021,6 +1164,10 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb)
                hci_pscan_rep_mode_evt(hdev, skb);
                break;
 
+       case HCI_EV_SNIFF_SUBRATE:
+               hci_sniff_subrate_evt(hdev, skb);
+               break;
+
        case HCI_EV_CMD_STATUS:
                cs = (struct hci_ev_cmd_status *) skb->data;
                skb_pull(skb, sizeof(cs));
index 97bdec73d17e9fcbc4ffdfcb75c5613c3b9e9c44..1a35d343e08a593f91cc71fce52306a50d991c4b 100644 (file)
@@ -24,7 +24,6 @@
 
 /* Bluetooth HCI sockets. */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/types.h>
index 0ed38740388c374262d90edac9eff42741a0e0da..3987d167f04e73225ea98556bd1f583c899e9223 100644 (file)
@@ -1,9 +1,10 @@
 /* Bluetooth HCI driver model support. */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 
+#include <linux/platform_device.h>
+
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
 
 #define BT_DBG(D...)
 #endif
 
-static ssize_t show_name(struct class_device *cdev, char *buf)
+static ssize_t show_name(struct device *dev, struct device_attribute *attr, char *buf)
 {
-       struct hci_dev *hdev = class_get_devdata(cdev);
+       struct hci_dev *hdev = dev_get_drvdata(dev);
        return sprintf(buf, "%s\n", hdev->name);
 }
 
-static ssize_t show_type(struct class_device *cdev, char *buf)
+static ssize_t show_type(struct device *dev, struct device_attribute *attr, char *buf)
 {
-       struct hci_dev *hdev = class_get_devdata(cdev);
+       struct hci_dev *hdev = dev_get_drvdata(dev);
        return sprintf(buf, "%d\n", hdev->type);
 }
 
-static ssize_t show_address(struct class_device *cdev, char *buf)
+static ssize_t show_address(struct device *dev, struct device_attribute *attr, char *buf)
 {
-       struct hci_dev *hdev = class_get_devdata(cdev);
+       struct hci_dev *hdev = dev_get_drvdata(dev);
        bdaddr_t bdaddr;
        baswap(&bdaddr, &hdev->bdaddr);
        return sprintf(buf, "%s\n", batostr(&bdaddr));
 }
 
-static ssize_t show_flags(struct class_device *cdev, char *buf)
+static ssize_t show_flags(struct device *dev, struct device_attribute *attr, char *buf)
 {
-       struct hci_dev *hdev = class_get_devdata(cdev);
+       struct hci_dev *hdev = dev_get_drvdata(dev);
        return sprintf(buf, "0x%lx\n", hdev->flags);
 }
 
-static ssize_t show_inquiry_cache(struct class_device *cdev, char *buf)
+static ssize_t show_inquiry_cache(struct device *dev, struct device_attribute *attr, char *buf)
 {
-       struct hci_dev *hdev = class_get_devdata(cdev);
+       struct hci_dev *hdev = dev_get_drvdata(dev);
        struct inquiry_cache *cache = &hdev->inq_cache;
        struct inquiry_entry *e;
        int n = 0;
@@ -62,94 +63,193 @@ static ssize_t show_inquiry_cache(struct class_device *cdev, char *buf)
        return n;
 }
 
-static CLASS_DEVICE_ATTR(name, S_IRUGO, show_name, NULL);
-static CLASS_DEVICE_ATTR(type, S_IRUGO, show_type, NULL);
-static CLASS_DEVICE_ATTR(address, S_IRUGO, show_address, NULL);
-static CLASS_DEVICE_ATTR(flags, S_IRUGO, show_flags, NULL);
-static CLASS_DEVICE_ATTR(inquiry_cache, S_IRUGO, show_inquiry_cache, NULL);
+static ssize_t show_idle_timeout(struct device *dev, struct device_attribute *attr, char *buf)
+{
+       struct hci_dev *hdev = dev_get_drvdata(dev);
+       return sprintf(buf, "%d\n", hdev->idle_timeout);
+}
 
-static struct class_device_attribute *bt_attrs[] = {
-       &class_device_attr_name,
-       &class_device_attr_type,
-       &class_device_attr_address,
-       &class_device_attr_flags,
-       &class_device_attr_inquiry_cache,
-       NULL
-};
+static ssize_t store_idle_timeout(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
+{
+       struct hci_dev *hdev = dev_get_drvdata(dev);
+       char *ptr;
+       __u32 val;
+
+       val = simple_strtoul(buf, &ptr, 10);
+       if (ptr == buf)
+               return -EINVAL;
 
-#ifdef CONFIG_HOTPLUG
-static int bt_uevent(struct class_device *cdev, char **envp, int num_envp, char *buf, int size)
+       if (val != 0 && (val < 500 || val > 3600000))
+               return -EINVAL;
+
+       hdev->idle_timeout = val;
+
+       return count;
+}
+
+static ssize_t show_sniff_max_interval(struct device *dev, struct device_attribute *attr, char *buf)
 {
-       struct hci_dev *hdev = class_get_devdata(cdev);
-       int n, i = 0;
+       struct hci_dev *hdev = dev_get_drvdata(dev);
+       return sprintf(buf, "%d\n", hdev->sniff_max_interval);
+}
 
-       envp[i++] = buf;
-       n = snprintf(buf, size, "INTERFACE=%s", hdev->name) + 1;
-       buf += n;
-       size -= n;
+static ssize_t store_sniff_max_interval(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
+{
+       struct hci_dev *hdev = dev_get_drvdata(dev);
+       char *ptr;
+       __u16 val;
 
-       if ((size <= 0) || (i >= num_envp))
-               return -ENOMEM;
+       val = simple_strtoul(buf, &ptr, 10);
+       if (ptr == buf)
+               return -EINVAL;
 
-       envp[i] = NULL;
-       return 0;
+       if (val < 0x0002 || val > 0xFFFE || val % 2)
+               return -EINVAL;
+
+       if (val < hdev->sniff_min_interval)
+               return -EINVAL;
+
+       hdev->sniff_max_interval = val;
+
+       return count;
+}
+
+static ssize_t show_sniff_min_interval(struct device *dev, struct device_attribute *attr, char *buf)
+{
+       struct hci_dev *hdev = dev_get_drvdata(dev);
+       return sprintf(buf, "%d\n", hdev->sniff_min_interval);
 }
-#endif
 
-static void bt_release(struct class_device *cdev)
+static ssize_t store_sniff_min_interval(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
 {
-       struct hci_dev *hdev = class_get_devdata(cdev);
+       struct hci_dev *hdev = dev_get_drvdata(dev);
+       char *ptr;
+       __u16 val;
 
-       kfree(hdev);
+       val = simple_strtoul(buf, &ptr, 10);
+       if (ptr == buf)
+               return -EINVAL;
+
+       if (val < 0x0002 || val > 0xFFFE || val % 2)
+               return -EINVAL;
+
+       if (val > hdev->sniff_max_interval)
+               return -EINVAL;
+
+       hdev->sniff_min_interval = val;
+
+       return count;
 }
 
-struct class bt_class = {
-       .name           = "bluetooth",
-       .release        = bt_release,
-#ifdef CONFIG_HOTPLUG
-       .uevent         = bt_uevent,
-#endif
+static DEVICE_ATTR(name, S_IRUGO, show_name, NULL);
+static DEVICE_ATTR(type, S_IRUGO, show_type, NULL);
+static DEVICE_ATTR(address, S_IRUGO, show_address, NULL);
+static DEVICE_ATTR(flags, S_IRUGO, show_flags, NULL);
+static DEVICE_ATTR(inquiry_cache, S_IRUGO, show_inquiry_cache, NULL);
+
+static DEVICE_ATTR(idle_timeout, S_IRUGO | S_IWUSR,
+                               show_idle_timeout, store_idle_timeout);
+static DEVICE_ATTR(sniff_max_interval, S_IRUGO | S_IWUSR,
+                               show_sniff_max_interval, store_sniff_max_interval);
+static DEVICE_ATTR(sniff_min_interval, S_IRUGO | S_IWUSR,
+                               show_sniff_min_interval, store_sniff_min_interval);
+
+static struct device_attribute *bt_attrs[] = {
+       &dev_attr_name,
+       &dev_attr_type,
+       &dev_attr_address,
+       &dev_attr_flags,
+       &dev_attr_inquiry_cache,
+       &dev_attr_idle_timeout,
+       &dev_attr_sniff_max_interval,
+       &dev_attr_sniff_min_interval,
+       NULL
 };
 
+struct class *bt_class = NULL;
 EXPORT_SYMBOL_GPL(bt_class);
 
+static struct bus_type bt_bus = {
+       .name   = "bluetooth",
+};
+
+static struct platform_device *bt_platform;
+
+static void bt_release(struct device *dev)
+{
+       struct hci_dev *hdev = dev_get_drvdata(dev);
+       kfree(hdev);
+}
+
 int hci_register_sysfs(struct hci_dev *hdev)
 {
-       struct class_device *cdev = &hdev->class_dev;
+       struct device *dev = &hdev->dev;
        unsigned int i;
        int err;
 
        BT_DBG("%p name %s type %d", hdev, hdev->name, hdev->type);
 
-       cdev->class = &bt_class;
-       class_set_devdata(cdev, hdev);
+       dev->class = bt_class;
+
+       if (hdev->parent)
+               dev->parent = hdev->parent;
+       else
+               dev->parent = &bt_platform->dev;
+
+       strlcpy(dev->bus_id, hdev->name, BUS_ID_SIZE);
+
+       dev->release = bt_release;
 
-       strlcpy(cdev->class_id, hdev->name, BUS_ID_SIZE);
-       err = class_device_register(cdev);
+       dev_set_drvdata(dev, hdev);
+
+       err = device_register(dev);
        if (err < 0)
                return err;
 
        for (i = 0; bt_attrs[i]; i++)
-               class_device_create_file(cdev, bt_attrs[i]);
+               device_create_file(dev, bt_attrs[i]);
 
        return 0;
 }
 
 void hci_unregister_sysfs(struct hci_dev *hdev)
 {
-       struct class_device * cdev = &hdev->class_dev;
+       struct device *dev = &hdev->dev;
 
        BT_DBG("%p name %s type %d", hdev, hdev->name, hdev->type);
 
-       class_device_del(cdev);
+       device_del(dev);
 }
 
 int __init bt_sysfs_init(void)
 {
-       return class_register(&bt_class);
+       int err;
+
+       bt_platform = platform_device_register_simple("bluetooth", -1, NULL, 0);
+       if (IS_ERR(bt_platform))
+               return PTR_ERR(bt_platform);
+
+       err = bus_register(&bt_bus);
+       if (err < 0) {
+               platform_device_unregister(bt_platform);
+               return err;
+       }
+
+       bt_class = class_create(THIS_MODULE, "bluetooth");
+       if (IS_ERR(bt_class)) {
+               bus_unregister(&bt_bus);
+               platform_device_unregister(bt_platform);
+               return PTR_ERR(bt_class);
+       }
+
+       return 0;
 }
 
 void __exit bt_sysfs_cleanup(void)
 {
-       class_unregister(&bt_class);
+       class_destroy(bt_class);
+
+       bus_unregister(&bt_bus);
+
+       platform_device_unregister(bt_platform);
 }
index cdb9cfafd960b5c45730b933f0515e1b79f1bfd4..b9c24a55425c90205baa23dcc7f9fe2b2bd0bb00 100644 (file)
@@ -20,7 +20,6 @@
    SOFTWARE IS DISCLAIMED.
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/types.h>
index b8f67761b8868ea8d01ef0f32ebf7900d68cc897..099646e4e2ef7407b45687f2188d0bfe2cd7402b 100644 (file)
@@ -20,7 +20,6 @@
    SOFTWARE IS DISCLAIMED.
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/types.h>
index f6b4a8085357a6c0973872665272118516f72816..eaaad658d11dcd34db3e606d6c2e58d5929cd73c 100644 (file)
@@ -24,7 +24,6 @@
 
 /* Bluetooth L2CAP core and sockets. */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/types.h>
@@ -64,11 +63,6 @@ static struct bt_sock_list l2cap_sk_list = {
        .lock = RW_LOCK_UNLOCKED
 };
 
-static int l2cap_conn_del(struct hci_conn *conn, int err);
-
-static void __l2cap_chan_add(struct l2cap_conn *conn, struct sock *sk, struct sock *parent);
-static void l2cap_chan_del(struct sock *sk, int err);
-
 static void __l2cap_sock_close(struct sock *sk, int reason);
 static void l2cap_sock_close(struct sock *sk);
 static void l2cap_sock_kill(struct sock *sk);
@@ -110,24 +104,177 @@ static void l2cap_sock_init_timer(struct sock *sk)
        sk->sk_timer.data = (unsigned long)sk;
 }
 
+/* ---- L2CAP channels ---- */
+static struct sock *__l2cap_get_chan_by_dcid(struct l2cap_chan_list *l, u16 cid)
+{
+       struct sock *s;
+       for (s = l->head; s; s = l2cap_pi(s)->next_c) {
+               if (l2cap_pi(s)->dcid == cid)
+                       break;
+       }
+       return s;
+}
+
+static struct sock *__l2cap_get_chan_by_scid(struct l2cap_chan_list *l, u16 cid)
+{
+       struct sock *s;
+       for (s = l->head; s; s = l2cap_pi(s)->next_c) {
+               if (l2cap_pi(s)->scid == cid)
+                       break;
+       }
+       return s;
+}
+
+/* Find channel with given SCID.
+ * Returns locked socket */
+static inline struct sock *l2cap_get_chan_by_scid(struct l2cap_chan_list *l, u16 cid)
+{
+       struct sock *s;
+       read_lock(&l->lock);
+       s = __l2cap_get_chan_by_scid(l, cid);
+       if (s) bh_lock_sock(s);
+       read_unlock(&l->lock);
+       return s;
+}
+
+static struct sock *__l2cap_get_chan_by_ident(struct l2cap_chan_list *l, u8 ident)
+{
+       struct sock *s;
+       for (s = l->head; s; s = l2cap_pi(s)->next_c) {
+               if (l2cap_pi(s)->ident == ident)
+                       break;
+       }
+       return s;
+}
+
+static inline struct sock *l2cap_get_chan_by_ident(struct l2cap_chan_list *l, u8 ident)
+{
+       struct sock *s;
+       read_lock(&l->lock);
+       s = __l2cap_get_chan_by_ident(l, ident);
+       if (s) bh_lock_sock(s);
+       read_unlock(&l->lock);
+       return s;
+}
+
+static u16 l2cap_alloc_cid(struct l2cap_chan_list *l)
+{
+       u16 cid = 0x0040;
+
+       for (; cid < 0xffff; cid++) {
+               if(!__l2cap_get_chan_by_scid(l, cid))
+                       return cid;
+       }
+
+       return 0;
+}
+
+static inline void __l2cap_chan_link(struct l2cap_chan_list *l, struct sock *sk)
+{
+       sock_hold(sk);
+
+       if (l->head)
+               l2cap_pi(l->head)->prev_c = sk;
+
+       l2cap_pi(sk)->next_c = l->head;
+       l2cap_pi(sk)->prev_c = NULL;
+       l->head = sk;
+}
+
+static inline void l2cap_chan_unlink(struct l2cap_chan_list *l, struct sock *sk)
+{
+       struct sock *next = l2cap_pi(sk)->next_c, *prev = l2cap_pi(sk)->prev_c;
+
+       write_lock(&l->lock);
+       if (sk == l->head)
+               l->head = next;
+
+       if (next)
+               l2cap_pi(next)->prev_c = prev;
+       if (prev)
+               l2cap_pi(prev)->next_c = next;
+       write_unlock(&l->lock);
+
+       __sock_put(sk);
+}
+
+static void __l2cap_chan_add(struct l2cap_conn *conn, struct sock *sk, struct sock *parent)
+{
+       struct l2cap_chan_list *l = &conn->chan_list;
+
+       BT_DBG("conn %p, psm 0x%2.2x, dcid 0x%4.4x", conn, l2cap_pi(sk)->psm, l2cap_pi(sk)->dcid);
+
+       l2cap_pi(sk)->conn = conn;
+
+       if (sk->sk_type == SOCK_SEQPACKET) {
+               /* Alloc CID for connection-oriented socket */
+               l2cap_pi(sk)->scid = l2cap_alloc_cid(l);
+       } else if (sk->sk_type == SOCK_DGRAM) {
+               /* Connectionless socket */
+               l2cap_pi(sk)->scid = 0x0002;
+               l2cap_pi(sk)->dcid = 0x0002;
+               l2cap_pi(sk)->omtu = L2CAP_DEFAULT_MTU;
+       } else {
+               /* Raw socket can send/recv signalling messages only */
+               l2cap_pi(sk)->scid = 0x0001;
+               l2cap_pi(sk)->dcid = 0x0001;
+               l2cap_pi(sk)->omtu = L2CAP_DEFAULT_MTU;
+       }
+
+       __l2cap_chan_link(l, sk);
+
+       if (parent)
+               bt_accept_enqueue(parent, sk);
+}
+
+/* Delete channel. 
+ * Must be called on the locked socket. */
+static void l2cap_chan_del(struct sock *sk, int err)
+{
+       struct l2cap_conn *conn = l2cap_pi(sk)->conn;
+       struct sock *parent = bt_sk(sk)->parent;
+
+       l2cap_sock_clear_timer(sk);
+
+       BT_DBG("sk %p, conn %p, err %d", sk, conn, err);
+
+       if (conn) { 
+               /* Unlink from channel list */
+               l2cap_chan_unlink(&conn->chan_list, sk);
+               l2cap_pi(sk)->conn = NULL;
+               hci_conn_put(conn->hcon);
+       }
+
+       sk->sk_state  = BT_CLOSED;
+       sock_set_flag(sk, SOCK_ZAPPED);
+
+       if (err)
+               sk->sk_err = err;
+
+       if (parent) {
+               bt_accept_unlink(sk);
+               parent->sk_data_ready(parent, 0);
+       } else
+               sk->sk_state_change(sk);
+}
+
 /* ---- L2CAP connections ---- */
 static struct l2cap_conn *l2cap_conn_add(struct hci_conn *hcon, u8 status)
 {
-       struct l2cap_conn *conn;
-
-       if ((conn = hcon->l2cap_data))
-               return conn;
+       struct l2cap_conn *conn = hcon->l2cap_data;
 
-       if (status)
+       if (conn || status)
                return conn;
 
-       if (!(conn = kmalloc(sizeof(struct l2cap_conn), GFP_ATOMIC)))
+       conn = kzalloc(sizeof(struct l2cap_conn), GFP_ATOMIC);
+       if (!conn)
                return NULL;
-       memset(conn, 0, sizeof(struct l2cap_conn));
 
        hcon->l2cap_data = conn;
        conn->hcon = hcon;
 
+       BT_DBG("hcon %p conn %p", hcon, conn);
+
        conn->mtu = hcon->hdev->acl_mtu;
        conn->src = &hcon->hdev->bdaddr;
        conn->dst = &hcon->dst;
@@ -135,17 +282,16 @@ static struct l2cap_conn *l2cap_conn_add(struct hci_conn *hcon, u8 status)
        spin_lock_init(&conn->lock);
        rwlock_init(&conn->chan_list.lock);
 
-       BT_DBG("hcon %p conn %p", hcon, conn);
        return conn;
 }
 
-static int l2cap_conn_del(struct hci_conn *hcon, int err)
+static void l2cap_conn_del(struct hci_conn *hcon, int err)
 {
-       struct l2cap_conn *conn;
+       struct l2cap_conn *conn = hcon->l2cap_data;
        struct sock *sk;
 
-       if (!(conn = hcon->l2cap_data)) 
-               return 0;
+       if (!conn)
+               return;
 
        BT_DBG("hcon %p conn %p, err %d", hcon, conn, err);
 
@@ -162,7 +308,6 @@ static int l2cap_conn_del(struct hci_conn *hcon, int err)
 
        hcon->l2cap_data = NULL;
        kfree(conn);
-       return 0;
 }
 
 static inline void l2cap_chan_add(struct l2cap_conn *conn, struct sock *sk, struct sock *parent)
@@ -926,160 +1071,6 @@ static int l2cap_sock_release(struct socket *sock)
        return err;
 }
 
-/* ---- L2CAP channels ---- */
-static struct sock *__l2cap_get_chan_by_dcid(struct l2cap_chan_list *l, u16 cid)
-{
-       struct sock *s;
-       for (s = l->head; s; s = l2cap_pi(s)->next_c) {
-               if (l2cap_pi(s)->dcid == cid)
-                       break;
-       }
-       return s;
-}
-
-static struct sock *__l2cap_get_chan_by_scid(struct l2cap_chan_list *l, u16 cid)
-{
-       struct sock *s;
-       for (s = l->head; s; s = l2cap_pi(s)->next_c) {
-               if (l2cap_pi(s)->scid == cid)
-                       break;
-       }
-       return s;
-}
-
-/* Find channel with given SCID.
- * Returns locked socket */
-static inline struct sock *l2cap_get_chan_by_scid(struct l2cap_chan_list *l, u16 cid)
-{
-       struct sock *s;
-       read_lock(&l->lock);
-       s = __l2cap_get_chan_by_scid(l, cid);
-       if (s) bh_lock_sock(s);
-       read_unlock(&l->lock);
-       return s;
-}
-
-static struct sock *__l2cap_get_chan_by_ident(struct l2cap_chan_list *l, u8 ident)
-{
-       struct sock *s;
-       for (s = l->head; s; s = l2cap_pi(s)->next_c) {
-               if (l2cap_pi(s)->ident == ident)
-                       break;
-       }
-       return s;
-}
-
-static inline struct sock *l2cap_get_chan_by_ident(struct l2cap_chan_list *l, u8 ident)
-{
-       struct sock *s;
-       read_lock(&l->lock);
-       s = __l2cap_get_chan_by_ident(l, ident);
-       if (s) bh_lock_sock(s);
-       read_unlock(&l->lock);
-       return s;
-}
-
-static u16 l2cap_alloc_cid(struct l2cap_chan_list *l)
-{
-       u16 cid = 0x0040;
-
-       for (; cid < 0xffff; cid++) {
-               if(!__l2cap_get_chan_by_scid(l, cid))
-                       return cid;
-       }
-
-       return 0;
-}
-
-static inline void __l2cap_chan_link(struct l2cap_chan_list *l, struct sock *sk)
-{
-       sock_hold(sk);
-
-       if (l->head)
-               l2cap_pi(l->head)->prev_c = sk;
-
-       l2cap_pi(sk)->next_c = l->head;
-       l2cap_pi(sk)->prev_c = NULL;
-       l->head = sk;
-}
-
-static inline void l2cap_chan_unlink(struct l2cap_chan_list *l, struct sock *sk)
-{
-       struct sock *next = l2cap_pi(sk)->next_c, *prev = l2cap_pi(sk)->prev_c;
-
-       write_lock(&l->lock);
-       if (sk == l->head)
-               l->head = next;
-
-       if (next)
-               l2cap_pi(next)->prev_c = prev;
-       if (prev)
-               l2cap_pi(prev)->next_c = next;
-       write_unlock(&l->lock);
-
-       __sock_put(sk);
-}
-
-static void __l2cap_chan_add(struct l2cap_conn *conn, struct sock *sk, struct sock *parent)
-{
-       struct l2cap_chan_list *l = &conn->chan_list;
-
-       BT_DBG("conn %p, psm 0x%2.2x, dcid 0x%4.4x", conn, l2cap_pi(sk)->psm, l2cap_pi(sk)->dcid);
-
-       l2cap_pi(sk)->conn = conn;
-
-       if (sk->sk_type == SOCK_SEQPACKET) {
-               /* Alloc CID for connection-oriented socket */
-               l2cap_pi(sk)->scid = l2cap_alloc_cid(l);
-       } else if (sk->sk_type == SOCK_DGRAM) {
-               /* Connectionless socket */
-               l2cap_pi(sk)->scid = 0x0002;
-               l2cap_pi(sk)->dcid = 0x0002;
-               l2cap_pi(sk)->omtu = L2CAP_DEFAULT_MTU;
-       } else {
-               /* Raw socket can send/recv signalling messages only */
-               l2cap_pi(sk)->scid = 0x0001;
-               l2cap_pi(sk)->dcid = 0x0001;
-               l2cap_pi(sk)->omtu = L2CAP_DEFAULT_MTU;
-       }
-
-       __l2cap_chan_link(l, sk);
-
-       if (parent)
-               bt_accept_enqueue(parent, sk);
-}
-
-/* Delete channel. 
- * Must be called on the locked socket. */
-static void l2cap_chan_del(struct sock *sk, int err)
-{
-       struct l2cap_conn *conn = l2cap_pi(sk)->conn;
-       struct sock *parent = bt_sk(sk)->parent;
-
-       l2cap_sock_clear_timer(sk);
-
-       BT_DBG("sk %p, conn %p, err %d", sk, conn, err);
-
-       if (conn) { 
-               /* Unlink from channel list */
-               l2cap_chan_unlink(&conn->chan_list, sk);
-               l2cap_pi(sk)->conn = NULL;
-               hci_conn_put(conn->hcon);
-       }
-
-       sk->sk_state  = BT_CLOSED;
-       sock_set_flag(sk, SOCK_ZAPPED);
-
-       if (err)
-               sk->sk_err = err;
-
-       if (parent) {
-               bt_accept_unlink(sk);
-               parent->sk_data_ready(parent, 0);
-       } else
-               sk->sk_state_change(sk);
-}
-
 static void l2cap_conn_ready(struct l2cap_conn *conn)
 {
        struct l2cap_chan_list *l = &conn->chan_list;
@@ -1835,7 +1826,9 @@ drop:
        kfree_skb(skb);
 
 done:
-       if (sk) bh_unlock_sock(sk);
+       if (sk)
+               bh_unlock_sock(sk);
+
        return 0;
 }
 
@@ -1926,18 +1919,18 @@ static int l2cap_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type)
 
 static int l2cap_connect_cfm(struct hci_conn *hcon, u8 status)
 {
+       struct l2cap_conn *conn;
+
        BT_DBG("hcon %p bdaddr %s status %d", hcon, batostr(&hcon->dst), status);
 
        if (hcon->type != ACL_LINK)
                return 0;
 
        if (!status) {
-               struct l2cap_conn *conn;
-
                conn = l2cap_conn_add(hcon, status);
                if (conn)
                        l2cap_conn_ready(conn);
-       } else 
+       } else
                l2cap_conn_del(hcon, bt_err(status));
 
        return 0;
@@ -1951,19 +1944,21 @@ static int l2cap_disconn_ind(struct hci_conn *hcon, u8 reason)
                return 0;
 
        l2cap_conn_del(hcon, bt_err(reason));
+
        return 0;
 }
 
 static int l2cap_auth_cfm(struct hci_conn *hcon, u8 status)
 {
        struct l2cap_chan_list *l;
-       struct l2cap_conn *conn;
+       struct l2cap_conn *conn = conn = hcon->l2cap_data;
        struct l2cap_conn_rsp rsp;
        struct sock *sk;
        int result;
 
-       if (!(conn = hcon->l2cap_data))
+       if (!conn)
                return 0;
+
        l = &conn->chan_list;
 
        BT_DBG("conn %p", conn);
@@ -2006,13 +2001,14 @@ static int l2cap_auth_cfm(struct hci_conn *hcon, u8 status)
 static int l2cap_encrypt_cfm(struct hci_conn *hcon, u8 status)
 {
        struct l2cap_chan_list *l;
-       struct l2cap_conn *conn;
+       struct l2cap_conn *conn = hcon->l2cap_data;
        struct l2cap_conn_rsp rsp;
        struct sock *sk;
        int result;
 
-       if (!(conn = hcon->l2cap_data))
+       if (!conn)
                return 0;
+
        l = &conn->chan_list;
 
        BT_DBG("conn %p", conn);
@@ -2220,7 +2216,7 @@ static int __init l2cap_init(void)
                goto error;
        }
 
-       class_create_file(&bt_class, &class_attr_l2cap);
+       class_create_file(bt_class, &class_attr_l2cap);
 
        BT_INFO("L2CAP ver %s", VERSION);
        BT_INFO("L2CAP socket layer initialized");
@@ -2234,7 +2230,7 @@ error:
 
 static void __exit l2cap_exit(void)
 {
-       class_remove_file(&bt_class, &class_attr_l2cap);
+       class_remove_file(bt_class, &class_attr_l2cap);
 
        if (bt_sock_unregister(BTPROTO_L2CAP) < 0)
                BT_ERR("L2CAP socket unregistration failed");
index ee6a66979913c8fb4c0d4dca00335bcc3e89c235..e5fd0cb70ae9e42ffa851e8d62874532a1115324 100644 (file)
@@ -24,7 +24,6 @@
 
 /* Bluetooth kernel library. */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/kernel.h>
index e99010ce8bb2780055efbf3e7a678543a8ce8745..155a2b93760e0ccf0fdcc5a74adbee4cc2255c2a 100644 (file)
@@ -27,7 +27,6 @@
  * $Id: core.c,v 1.42 2002/10/01 23:26:25 maxk Exp $
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
@@ -53,8 +52,9 @@
 #define BT_DBG(D...)
 #endif
 
-#define VERSION "1.7"
+#define VERSION "1.8"
 
+static int disable_cfc = 0;
 static unsigned int l2cap_mtu = RFCOMM_MAX_L2CAP_MTU;
 
 static struct task_struct *rfcomm_thread;
@@ -534,7 +534,7 @@ static struct rfcomm_session *rfcomm_session_add(struct socket *sock, int state)
        s->sock  = sock;
 
        s->mtu = RFCOMM_DEFAULT_MTU;
-       s->cfc = RFCOMM_CFC_UNKNOWN;
+       s->cfc = disable_cfc ? RFCOMM_CFC_DISABLED : RFCOMM_CFC_UNKNOWN;
 
        /* Do not increment module usage count for listening sessions.
         * Otherwise we won't be able to unload the module. */
@@ -1150,6 +1150,8 @@ static inline int rfcomm_check_link_mode(struct rfcomm_dlc *d)
 
 static void rfcomm_dlc_accept(struct rfcomm_dlc *d)
 {
+       struct sock *sk = d->session->sock->sk;
+
        BT_DBG("dlc %p", d);
 
        rfcomm_send_ua(d->session, d->dlci);
@@ -1159,6 +1161,9 @@ static void rfcomm_dlc_accept(struct rfcomm_dlc *d)
        d->state_change(d, 0);
        rfcomm_dlc_unlock(d);
 
+       if (d->link_mode & RFCOMM_LM_MASTER)
+               hci_conn_switch_role(l2cap_pi(sk)->conn->hcon, 0x00);
+
        rfcomm_send_msc(d->session, 1, d->dlci, d->v24_sig);
 }
 
@@ -1223,14 +1228,18 @@ static int rfcomm_apply_pn(struct rfcomm_dlc *d, int cr, struct rfcomm_pn *pn)
        BT_DBG("dlc %p state %ld dlci %d mtu %d fc 0x%x credits %d", 
                        d, d->state, d->dlci, pn->mtu, pn->flow_ctrl, pn->credits);
 
-       if (pn->flow_ctrl == 0xf0 || pn->flow_ctrl == 0xe0) {
-               d->cfc = s->cfc = RFCOMM_CFC_ENABLED;
+       if ((pn->flow_ctrl == 0xf0 && s->cfc != RFCOMM_CFC_DISABLED) ||
+                                               pn->flow_ctrl == 0xe0) {
+               d->cfc = RFCOMM_CFC_ENABLED;
                d->tx_credits = pn->credits;
        } else {
-               d->cfc = s->cfc = RFCOMM_CFC_DISABLED;
+               d->cfc = RFCOMM_CFC_DISABLED;
                set_bit(RFCOMM_TX_THROTTLED, &d->flags);
        }
 
+       if (s->cfc == RFCOMM_CFC_UNKNOWN)
+               s->cfc = d->cfc;
+
        d->priority = pn->priority;
 
        d->mtu = s->mtu = btohs(pn->mtu);
@@ -2036,7 +2045,7 @@ static int __init rfcomm_init(void)
 
        kernel_thread(rfcomm_run, NULL, CLONE_KERNEL);
 
-       class_create_file(&bt_class, &class_attr_rfcomm_dlc);
+       class_create_file(bt_class, &class_attr_rfcomm_dlc);
 
        rfcomm_init_sockets();
 
@@ -2051,7 +2060,7 @@ static int __init rfcomm_init(void)
 
 static void __exit rfcomm_exit(void)
 {
-       class_remove_file(&bt_class, &class_attr_rfcomm_dlc);
+       class_remove_file(bt_class, &class_attr_rfcomm_dlc);
 
        hci_unregister_cb(&rfcomm_cb);
 
@@ -2074,6 +2083,9 @@ static void __exit rfcomm_exit(void)
 module_init(rfcomm_init);
 module_exit(rfcomm_exit);
 
+module_param(disable_cfc, bool, 0644);
+MODULE_PARM_DESC(disable_cfc, "Disable credit based flow control");
+
 module_param(l2cap_mtu, uint, 0644);
 MODULE_PARM_DESC(l2cap_mtu, "Default MTU for the L2CAP connection");
 
index 757d2dd3b02f1bb710e49e982ca3c55a790cbae7..220fee04e7f274a3d31505f0133af59e742a4f74 100644 (file)
@@ -27,7 +27,6 @@
  * $Id: sock.c,v 1.24 2002/10/03 01:00:34 maxk Exp $
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/types.h>
@@ -945,7 +944,7 @@ int __init rfcomm_init_sockets(void)
        if (err < 0)
                goto error;
 
-       class_create_file(&bt_class, &class_attr_rfcomm);
+       class_create_file(bt_class, &class_attr_rfcomm);
 
        BT_INFO("RFCOMM socket layer initialized");
 
@@ -959,7 +958,7 @@ error:
 
 void __exit rfcomm_cleanup_sockets(void)
 {
-       class_remove_file(&bt_class, &class_attr_rfcomm);
+       class_remove_file(bt_class, &class_attr_rfcomm);
 
        if (bt_sock_unregister(BTPROTO_RFCOMM) < 0)
                BT_ERR("RFCOMM socket layer unregistration failed");
index b105a715fa93e76624b0af98bd9ba1c7126bc7b2..2ff2d5b87c933ce92207400de962f5edba04f4ea 100644 (file)
@@ -27,7 +27,6 @@
  * $Id: tty.c,v 1.24 2002/10/03 01:54:38 holtmann Exp $
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/tty.h>
index 0c2d13ad69bbf0c799f8bff6fbc2e78ffcc22763..85defccc028791bc7cde5f0b37de5c3dc7b5fa11 100644 (file)
@@ -24,7 +24,6 @@
 
 /* Bluetooth SCO sockets. */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/types.h>
@@ -970,7 +969,7 @@ static int __init sco_init(void)
                goto error;
        }
 
-       class_create_file(&bt_class, &class_attr_sco);
+       class_create_file(bt_class, &class_attr_sco);
 
        BT_INFO("SCO (Voice Link) ver %s", VERSION);
        BT_INFO("SCO socket layer initialized");
@@ -984,7 +983,7 @@ error:
 
 static void __exit sco_exit(void)
 {
-       class_remove_file(&bt_class, &class_attr_sco);
+       class_remove_file(bt_class, &class_attr_sco);
 
        if (bt_sock_unregister(BTPROTO_SCO) < 0)
                BT_ERR("SCO socket unregistration failed");
index 654401ceb2dbdf679522c8ce92c5699c5589c613..2994387999a846bc1673095a173484404b4fdafc 100644 (file)
@@ -13,7 +13,6 @@
  *     2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
index 881d7d1a732a884faa01873922364ca9a23862b7..06abb6634f5be777a374c389b1d4778cb79ee210 100644 (file)
@@ -117,12 +117,13 @@ static int br_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
                        continue;
 
                if (idx < s_idx)
-                       continue;
+                       goto cont;
 
                err = br_fill_ifinfo(skb, p, NETLINK_CB(cb->skb).pid,
                                     cb->nlh->nlmsg_seq, RTM_NEWLINK, NLM_F_MULTI);
                if (err <= 0)
                        break;
+cont:
                ++idx;
        }
        read_unlock(&dev_base_lock);
index ee5a51761260a96cceba34579892bd8b681185c1..02693a230dc1faae5d3252f62c4f9a2334ea3f00 100644 (file)
@@ -29,7 +29,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/spinlock.h>
 #include <linux/socket.h>
 #include <linux/skbuff.h>
index 08976b08df5b6b6c4d6d88d029179b9f06f981b4..066a60a75280bc6508c541e645aa5b5d9193e26e 100644 (file)
@@ -76,7 +76,6 @@
 #include <asm/system.h>
 #include <linux/bitops.h>
 #include <linux/capability.h>
-#include <linux/config.h>
 #include <linux/cpu.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 0f37266411b507a208c3f4dcd80240445cbc37d2..4b36114744c57f983c8af674ee45610f6e830ac1 100644 (file)
@@ -11,7 +11,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/netdevice.h>
 #include <linux/if.h>
index 50a8c73caf972ae64b963a02322f801669d77eaf..7ad681f5e71269c228112b539c6359c69d37c1f4 100644 (file)
@@ -15,7 +15,6 @@
  *     Harald Welte            Add neighbour cache statistics like rtstat
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
index 47a6fceb6771b00943ee9d845aff91c1ea9e5977..13472762b18b4c89f57c7bb27916bd8b67b47339 100644 (file)
@@ -10,7 +10,6 @@
  */
 
 #include <linux/capability.h>
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
 #include <linux/if_arp.h>
index f25aac17497a7e79d8ed4cdcdbc6bdca18c54c8e..20e5bb73f147b6c0f6d84d02e562560e8b500f63 100644 (file)
@@ -16,7 +16,6 @@
  *     Vitaly E. Lavrov                RTA_OK arithmetics was wrong.
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/module.h>
 #include <linux/types.h>
index a1c9ecf4f1e077c205a5e383cabce391b0243134..44f6a181a7545f1a4bc13dff16ca209924a66b8b 100644 (file)
@@ -38,7 +38,6 @@
  *     The functions in this file will not compile correctly with gcc 2.4.x
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 static kmem_cache_t *skbuff_head_cache __read_mostly;
 static kmem_cache_t *skbuff_fclone_cache __read_mostly;
 
+/*
+ * lockdep: lock class key used by skb_queue_head_init():
+ */
+struct lock_class_key skb_queue_lock_key;
+
+EXPORT_SYMBOL(skb_queue_lock_key);
+
 /*
  *     Keep out-of-line to prevent kernel bloat.
  *     __builtin_return_address is not used because it is not always
index 204a8dec65cc76503ff6bf209b8ec6c8956ac17e..51fcfbc041a73d38f0172a77c1e5e48b1224f0b7 100644 (file)
@@ -92,7 +92,6 @@
  */
 
 #include <linux/capability.h>
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/socket.h>
 #include <net/tcp.h>
 #endif
 
+/*
+ * Each address family might have different locking rules, so we have
+ * one slock key per address family:
+ */
+static struct lock_class_key af_family_keys[AF_MAX];
+static struct lock_class_key af_family_slock_keys[AF_MAX];
+
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+/*
+ * Make lock validator output more readable. (we pre-construct these
+ * strings build-time, so that runtime initialization of socket
+ * locks is fast):
+ */
+static const char *af_family_key_strings[AF_MAX+1] = {
+  "sk_lock-AF_UNSPEC", "sk_lock-AF_UNIX"     , "sk_lock-AF_INET"     ,
+  "sk_lock-AF_AX25"  , "sk_lock-AF_IPX"      , "sk_lock-AF_APPLETALK",
+  "sk_lock-AF_NETROM", "sk_lock-AF_BRIDGE"   , "sk_lock-AF_ATMPVC"   ,
+  "sk_lock-AF_X25"   , "sk_lock-AF_INET6"    , "sk_lock-AF_ROSE"     ,
+  "sk_lock-AF_DECnet", "sk_lock-AF_NETBEUI"  , "sk_lock-AF_SECURITY" ,
+  "sk_lock-AF_KEY"   , "sk_lock-AF_NETLINK"  , "sk_lock-AF_PACKET"   ,
+  "sk_lock-AF_ASH"   , "sk_lock-AF_ECONET"   , "sk_lock-AF_ATMSVC"   ,
+  "sk_lock-21"       , "sk_lock-AF_SNA"      , "sk_lock-AF_IRDA"     ,
+  "sk_lock-AF_PPPOX" , "sk_lock-AF_WANPIPE"  , "sk_lock-AF_LLC"      ,
+  "sk_lock-27"       , "sk_lock-28"          , "sk_lock-29"          ,
+  "sk_lock-AF_TIPC"  , "sk_lock-AF_BLUETOOTH", "sk_lock-AF_MAX"
+};
+static const char *af_family_slock_key_strings[AF_MAX+1] = {
+  "slock-AF_UNSPEC", "slock-AF_UNIX"     , "slock-AF_INET"     ,
+  "slock-AF_AX25"  , "slock-AF_IPX"      , "slock-AF_APPLETALK",
+  "slock-AF_NETROM", "slock-AF_BRIDGE"   , "slock-AF_ATMPVC"   ,
+  "slock-AF_X25"   , "slock-AF_INET6"    , "slock-AF_ROSE"     ,
+  "slock-AF_DECnet", "slock-AF_NETBEUI"  , "slock-AF_SECURITY" ,
+  "slock-AF_KEY"   , "slock-AF_NETLINK"  , "slock-AF_PACKET"   ,
+  "slock-AF_ASH"   , "slock-AF_ECONET"   , "slock-AF_ATMSVC"   ,
+  "slock-21"       , "slock-AF_SNA"      , "slock-AF_IRDA"     ,
+  "slock-AF_PPPOX" , "slock-AF_WANPIPE"  , "slock-AF_LLC"      ,
+  "slock-27"       , "slock-28"          , "slock-29"          ,
+  "slock-AF_TIPC"  , "slock-AF_BLUETOOTH", "slock-AF_MAX"
+};
+#endif
+
+/*
+ * sk_callback_lock locking rules are per-address-family,
+ * so split the lock classes by using a per-AF key:
+ */
+static struct lock_class_key af_callback_keys[AF_MAX];
+
 /* Take into consideration the size of the struct sk_buff overhead in the
  * determination of these values, since that is non-constant across
  * platforms.  This makes socket queueing behavior and performance
@@ -238,9 +284,16 @@ int sk_receive_skb(struct sock *sk, struct sk_buff *skb)
        skb->dev = NULL;
 
        bh_lock_sock(sk);
-       if (!sock_owned_by_user(sk))
+       if (!sock_owned_by_user(sk)) {
+               /*
+                * trylock + unlock semantics:
+                */
+               mutex_acquire(&sk->sk_lock.dep_map, 0, 1, _RET_IP_);
+
                rc = sk->sk_backlog_rcv(sk, skb);
-       else
+
+               mutex_release(&sk->sk_lock.dep_map, 1, _RET_IP_);
+       } else
                sk_add_backlog(sk, skb);
        bh_unlock_sock(sk);
 out:
@@ -750,6 +803,33 @@ lenout:
        return 0;
 }
 
+/*
+ * Initialize an sk_lock.
+ *
+ * (We also register the sk_lock with the lock validator.)
+ */
+static void inline sock_lock_init(struct sock *sk)
+{
+       spin_lock_init(&sk->sk_lock.slock);
+       sk->sk_lock.owner = NULL;
+       init_waitqueue_head(&sk->sk_lock.wq);
+       /*
+        * Make sure we are not reinitializing a held lock:
+        */
+       debug_check_no_locks_freed((void *)&sk->sk_lock, sizeof(sk->sk_lock));
+
+       /*
+        * Mark both the sk_lock and the sk_lock.slock as a
+        * per-address-family lock class:
+        */
+       lockdep_set_class_and_name(&sk->sk_lock.slock,
+                                  af_family_slock_keys + sk->sk_family,
+                                  af_family_slock_key_strings[sk->sk_family]);
+       lockdep_init_map(&sk->sk_lock.dep_map,
+                        af_family_key_strings[sk->sk_family],
+                        af_family_keys + sk->sk_family);
+}
+
 /**
  *     sk_alloc - All socket objects are allocated here
  *     @family: protocol family
@@ -849,6 +929,8 @@ struct sock *sk_clone(const struct sock *sk, const gfp_t priority)
 
                rwlock_init(&newsk->sk_dst_lock);
                rwlock_init(&newsk->sk_callback_lock);
+               lockdep_set_class(&newsk->sk_callback_lock,
+                                  af_callback_keys + newsk->sk_family);
 
                newsk->sk_dst_cache     = NULL;
                newsk->sk_wmem_queued   = 0;
@@ -1423,6 +1505,8 @@ void sock_init_data(struct socket *sock, struct sock *sk)
 
        rwlock_init(&sk->sk_dst_lock);
        rwlock_init(&sk->sk_callback_lock);
+       lockdep_set_class(&sk->sk_callback_lock,
+                          af_callback_keys + sk->sk_family);
 
        sk->sk_state_change     =       sock_def_wakeup;
        sk->sk_data_ready       =       sock_def_readable;
@@ -1450,24 +1534,34 @@ void sock_init_data(struct socket *sock, struct sock *sk)
 void fastcall lock_sock(struct sock *sk)
 {
        might_sleep();
-       spin_lock_bh(&(sk->sk_lock.slock));
+       spin_lock_bh(&sk->sk_lock.slock);
        if (sk->sk_lock.owner)
                __lock_sock(sk);
        sk->sk_lock.owner = (void *)1;
-       spin_unlock_bh(&(sk->sk_lock.slock));
+       spin_unlock(&sk->sk_lock.slock);
+       /*
+        * The sk_lock has mutex_lock() semantics here:
+        */
+       mutex_acquire(&sk->sk_lock.dep_map, 0, 0, _RET_IP_);
+       local_bh_enable();
 }
 
 EXPORT_SYMBOL(lock_sock);
 
 void fastcall release_sock(struct sock *sk)
 {
-       spin_lock_bh(&(sk->sk_lock.slock));
+       /*
+        * The sk_lock has mutex_unlock() semantics:
+        */
+       mutex_release(&sk->sk_lock.dep_map, 1, _RET_IP_);
+
+       spin_lock_bh(&sk->sk_lock.slock);
        if (sk->sk_backlog.tail)
                __release_sock(sk);
        sk->sk_lock.owner = NULL;
-        if (waitqueue_active(&(sk->sk_lock.wq)))
-               wake_up(&(sk->sk_lock.wq));
-       spin_unlock_bh(&(sk->sk_lock.slock));
+       if (waitqueue_active(&sk->sk_lock.wq))
+               wake_up(&sk->sk_lock.wq);
+       spin_unlock_bh(&sk->sk_lock.slock);
 }
 EXPORT_SYMBOL(release_sock);
 
index 7104536567210de3ad503915a7be27e2789a6653..02534131d88e9820126f061ac6962ce24477d6d9 100644 (file)
@@ -7,7 +7,6 @@
 
 #include <linux/mm.h>
 #include <linux/sysctl.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/socket.h>
 #include <net/sock.h>
index ec7a89bb7b396ceaeaac47c2714b00fe05848318..0adf4b56c34cfea4df0c9e57eed67e6682f05e9f 100644 (file)
@@ -11,7 +11,6 @@
  *     published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/compiler.h>
 #include <linux/list.h>
 #include <linux/time.h>
index d4f9e2d3345362d12796b91e4fae70538fdb6005..e9615627dcd65faae6945604d50ac179cea58f20 100644 (file)
@@ -30,7 +30,6 @@
  * - jiffies wrapping
  */
 
-#include <linux/config.h>
 #include "../ccid.h"
 #include "../dccp.h"
 #include "ccid2.h"
index b4a51d0355a58f590d721d09833307d60b87188e..c39bff706cfc08db3f32139869edbba36768320c 100644 (file)
@@ -34,7 +34,6 @@
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include "../ccid.h"
 #include "../dccp.h"
 #include "lib/packet_history.h"
index f18b96d4e5a25039e3d15c8ae57c54c49b755524..5ade4f668b2258e66b5ce96b697903457deac153 100644 (file)
@@ -36,7 +36,6 @@
 #ifndef _DCCP_CCID3_H_
 #define _DCCP_CCID3_H_
 
-#include <linux/config.h>
 #include <linux/list.h>
 #include <linux/time.h>
 #include <linux/types.h>
index 4c01a54143ad0ef2dcdb5d76d53d685210329d2a..5d7b7d8643854d1f7b56ad02a7f38c9e443ca7e9 100644 (file)
@@ -11,7 +11,6 @@
  *  (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include "loss_interval.h"
index 417d9d82df3e35519f887eae814fac396195c2b9..43bf78269d1d5f3fa96ec600ff420855e98da4cb 100644 (file)
@@ -13,7 +13,6 @@
  *  any later version.
  */
 
-#include <linux/config.h>
 #include <linux/list.h>
 #include <linux/slab.h>
 #include <linux/time.h>
index d3f9d205383005eaa08b58ad32ca25e0b69b6537..ad98d6a322eb8de1d5018d70789431ee145b93ea 100644 (file)
@@ -34,7 +34,6 @@
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/string.h>
 
index 122e96737ff6db3cbcdf960d5f6bcb28e8d474f7..673c209e4e856b966d6aac88a93d4cd92329ce29 100644 (file)
@@ -37,7 +37,6 @@
 #ifndef _DCCP_PKT_HIST_
 #define _DCCP_PKT_HIST_
 
-#include <linux/config.h>
 #include <linux/list.h>
 #include <linux/slab.h>
 #include <linux/time.h>
index add3cae65e2db7d9c5112ff3ad611c2b5f92770e..4fd2ebebf5a0d7a1eb2a4c46c9a4a33c62f0d2cf 100644 (file)
@@ -12,7 +12,6 @@
  *  (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <asm/div64.h>
index 1fe509148689d4d0ddd063e94683e3d32c8dfe9f..d00a2f4ee5dd7485184289235b23b78f0c256741 100644 (file)
@@ -12,7 +12,6 @@
  *     published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/dccp.h>
 #include <net/snmp.h>
 #include <net/sock.h>
index 0f25dc395967b5b0ef8ba61ff336f5ae70988cf4..0f3745585a9486e4e1aee74df934936949b5c040 100644 (file)
@@ -9,7 +9,6 @@
  *     published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 
 #include <linux/module.h>
 #include <linux/inet_diag.h>
index b39e2a5978896f23c7755c7fc8bc2ca935458b82..a1b0682ee77c7f9af2b72dae2afb38f4decd9f97 100644 (file)
@@ -10,7 +10,6 @@
  *      2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include "dccp.h"
index bfc53665516bf26a9d6066383c75ab21634fcd38..7f9dc6ac58c95429ff1b9b311a99f1a2c2488ca1 100644 (file)
@@ -10,7 +10,6 @@
  *     2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/dccp.h>
 #include <linux/skbuff.h>
 
index f2c011fd2ba128f92757aa816da604804d99394f..c3073e7e81d3ed6a225c3bc6ee9c4aa37a86fc09 100644 (file)
@@ -10,7 +10,6 @@
  *     2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/dccp.h>
 #include <linux/icmp.h>
 #include <linux/module.h>
index 65e2ab0886e62fd3a2bddde3e9d961b40b63a195..ff42bc43263d55cf7f56ad3074a017c1a62a14fd 100644 (file)
@@ -12,7 +12,6 @@
  *      2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/random.h>
 #include <linux/xfrm.h>
index e4d4e93092702001a7dd050ef290932595f777b4..6eef81fdbe566f5623fc0816370ac15b4c01dc5a 100644 (file)
@@ -11,7 +11,6 @@
  *     published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/dccp.h>
 #include <linux/ipv6.h>
 
index c0349e5b055158d041f2d4ea61da50f090d94f30..9045438d6b36953cd26b0b2edb12226336838745 100644 (file)
@@ -10,7 +10,6 @@
  *     2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/dccp.h>
 #include <linux/skbuff.h>
 #include <linux/timer.h>
index e9feb2a0c7706ef1a464d3d7428dac77cc36013d..c3cda1e39aa8ccc500e4e7a36b0e72679d94a8ed 100644 (file)
@@ -11,7 +11,6 @@
  *      as published by the Free Software Foundation; either version
  *      2 of the License, or (at your option) any later version.
  */
-#include <linux/config.h>
 #include <linux/dccp.h>
 #include <linux/module.h>
 #include <linux/types.h>
index 7409e4a3abdfb549bcfaa4463ef86f45684b4e0f..58669beee1329cde9edbe2eda112594917007b79 100644 (file)
@@ -10,7 +10,6 @@
  *     2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/dccp.h>
 #include <linux/kernel.h>
 #include <linux/skbuff.h>
index 5317fd3e66910ca25f5d73bf9dbd63e7fe400183..f4f0627ea41c0ccd53787845267330dc7eb3013b 100644 (file)
@@ -9,7 +9,6 @@
  *     published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/dccp.h>
 #include <linux/module.h>
 #include <linux/types.h>
index 64c89e9c229ea1d4298a83c947ff29837d9382ee..c1ba9451bc3dca6567ed58f8c1123031564262ab 100644 (file)
@@ -9,7 +9,6 @@
  *     as published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/sysctl.h>
 
index 5244415e5f1877762d98ba5763e0174f37ee4e7e..8447742f5615c6b615ee40ae086f5d4a1e6052d6 100644 (file)
@@ -10,7 +10,6 @@
  *     2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/dccp.h>
 #include <linux/skbuff.h>
 
index 2b289ef20ab3e57460b412181eb3d7322b2b4b05..5486247735f6a250eb0126ebc72a95e134f1159b 100644 (file)
@@ -99,7 +99,6 @@ Version 0.0.6    2.1.110   07-aug-98   Eduardo Marcelo Serrat
                                        dn_bind fixes
 *******************************************************************************/
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/types.h>
index a26ff9f44576fffb0c20dd7725a463c291db989e..98a25208440dcb39bcd181af751a91b3d5ab2ee6 100644 (file)
@@ -24,7 +24,6 @@
  *                             devices. All mtu based now.
  */
 
-#include <linux/config.h>
 #include <linux/capability.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
index bd4ce8681a1271efe57cc82de17f036017ea20f7..0375077391b7a39111e839dba86b6b5e4d48dbf5 100644 (file)
@@ -17,7 +17,6 @@
  *                                 this code was copied from it.
  *
  */
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/net.h>
 #include <linux/socket.h>
index 66e230c3b3287072124fa52e16c2577bdde9c7a9..5ce9c9e0565c1448e5e71333b36c3e464cc895a2 100644 (file)
@@ -24,7 +24,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/net.h>
 #include <linux/module.h>
 #include <linux/socket.h>
index a2ba9db1c37643aa5fd6d22359661a5564f3c9b0..86f7f3b28e7007c919abb574a73258b605387b2a 100644 (file)
@@ -45,7 +45,6 @@
     GNU General Public License for more details.
 *******************************************************************************/
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/socket.h>
index 5abf7057af00db705d4ec019a2c670312d6cdd5c..1355614ec11b90567f50d0073555a0aa1d57c185 100644 (file)
@@ -55,7 +55,6 @@
     GNU General Public License for more details.
 *******************************************************************************/
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/socket.h>
index 446faafe206596b11ec35bfbbaa3cc0b4cefa76b..06e785fe575798b5ae736317a44ec67d8ca07c11 100644 (file)
@@ -13,7 +13,6 @@
  * Changes:
  *
  */
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/net.h>
 #include <linux/socket.h>
index 0ebc46af1bddbb55a0b7c4aa3573339fd596d7ae..37d9d0a1ac8ce73d0f92141e92392d53df5934fc 100644 (file)
@@ -12,7 +12,6 @@
  * Changes:
  *
  */
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/net.h>
 #include <linux/socket.h>
index bda5920215fd2f04c05bf85aa912add450e45596..e246f054f368f692a13ed7cee98db0abbf971645 100644 (file)
@@ -13,7 +13,6 @@
  * Steve Whitehouse - Memory buffer settings, like the tcp ones
  *
  */
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/sysctl.h>
 #include <linux/fs.h>
index 868265619dbb1d98aa4e0511aff54b21a14fa113..309ae4c6549a9d3b12c28222a548a582b79d88b5 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/types.h>
index c971f14712ec207608dd48d8477516bcb9af054b..387c71c584ee398a6d9c5ad43c6a7e1194f4a3ca 100644 (file)
@@ -51,7 +51,6 @@
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
 #include <linux/errno.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/if_ether.h>
 #include <net/dst.h>
index 78b2d13e80e3638cba22d9a6f0bb7df727856829..492647382ad04caee03a90121fcc52012fb4e6ba 100644 (file)
@@ -9,7 +9,6 @@
  * more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
index 3fa5df2e1f0baeceb229fb95a6bd6dd0c2ff081c..34dba0ba545de66e55737d56390d673789d21c99 100644 (file)
@@ -9,7 +9,6 @@
  * more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
index 649e581fa565c323859e804cf4ea13f1e9c6359c..c5a87724aabeaf5f16e74bdc66ace2098d68b857 100644 (file)
@@ -9,7 +9,6 @@
  * more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
index 192243ab35ed2fce2c9d377aca926657e58a70dc..305a09de85a57d924a187abe72148c315b06868d 100644 (file)
@@ -24,7 +24,6 @@
 
 ******************************************************************************/
 #include <linux/compiler.h>
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/if_arp.h>
 #include <linux/in6.h>
index 2cb84d84f67136f08dd1c847893ee223ddbc6882..13b1e5fff7e4741de39c232ba35931ef84129b92 100644 (file)
@@ -31,7 +31,6 @@
 *******************************************************************************/
 
 #include <linux/compiler.h>
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/if_arp.h>
 #include <linux/in6.h>
index 2bf567fd5a17143a096518def05a21cf2f5ccdbc..47ccf159372ce0b0e1ee57526e01df6100f5fa43 100644 (file)
@@ -14,7 +14,6 @@
  */
 
 #include <linux/compiler.h>
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/if_arp.h>
 #include <linux/in6.h>
index 6a5de1b84459c147864406522e7c682a03e473ca..de148ae594f30cb370b2be6d6e17a8a7f6c584c4 100644 (file)
@@ -24,7 +24,6 @@
 
 ******************************************************************************/
 #include <linux/compiler.h>
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/if_arp.h>
 #include <linux/in6.h>
index 8d157157bf8e68c65ae3523b62c13ba0486437ab..318d4674faa188e8aba6c6c8c17862fed6ce6ee6 100644 (file)
@@ -1106,7 +1106,15 @@ static struct sk_buff *inet_gso_segment(struct sk_buff *skb, int features)
        int ihl;
        int id;
 
-       if (!pskb_may_pull(skb, sizeof(*iph)))
+       if (unlikely(skb_shinfo(skb)->gso_type &
+                    ~(SKB_GSO_TCPV4 |
+                      SKB_GSO_UDP |
+                      SKB_GSO_DODGY |
+                      SKB_GSO_TCP_ECN |
+                      0)))
+               goto out;
+
+       if (unlikely(!pskb_may_pull(skb, sizeof(*iph))))
                goto out;
 
        iph = skb->nh.iph;
@@ -1114,7 +1122,7 @@ static struct sk_buff *inet_gso_segment(struct sk_buff *skb, int features)
        if (ihl < sizeof(*iph))
                goto out;
 
-       if (!pskb_may_pull(skb, ihl))
+       if (unlikely(!pskb_may_pull(skb, ihl)))
                goto out;
 
        skb->h.raw = __skb_pull(skb, ihl);
@@ -1125,7 +1133,7 @@ static struct sk_buff *inet_gso_segment(struct sk_buff *skb, int features)
 
        rcu_read_lock();
        ops = rcu_dereference(inet_protos[proto]);
-       if (ops && ops->gso_segment)
+       if (likely(ops && ops->gso_segment))
                segs = ops->gso_segment(skb, features);
        rcu_read_unlock();
 
index c7782230080d21d76a7ffa70ef6df2eb6358df1b..8e748be36c5a5bf05c317e686f5fb8781ea8a20b 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/module.h>
 #include <net/ip.h>
 #include <net/xfrm.h>
index 4749d504c6292188f921b8b296c0394834f2851f..7b51b3bdb548060b7c5ad42851c530a8321782c8 100644 (file)
@@ -80,7 +80,6 @@
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/capability.h>
-#include <linux/config.h>
 #include <linux/socket.h>
 #include <linux/sockios.h>
 #include <linux/errno.h>
index c1b42b5257f8455d54c0388ac1ac25e76595b659..ec5da4fbd9f43d84fd961de6e855455591e49311 100644 (file)
@@ -11,7 +11,6 @@
  *     2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/ip.h>
index 54419b27686f86f33e370c4241235ef5bc723034..a7c65e9e5ec9d9b463140b0463e2b1d2511723fc 100644 (file)
@@ -27,7 +27,6 @@
  *                                     if no match found.
  */
 
-#include <linux/config.h>
 
 #include <asm/uaccess.h>
 #include <asm/system.h>
index 9bbdd4494551347b43bce292bb4406198aec4b18..4e112738b3fa15d789944b139a91eb131b12b17e 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/module.h>
 #include <net/ip.h>
 #include <net/xfrm.h>
index 31387abf53a21630ebbd9c2cc9993cfa715a2ade..ba2a70745a63e65f6733e2937806dd0c240e5c85 100644 (file)
@@ -15,7 +15,6 @@
  *             2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
index e2890ec8159ec39edabd8e9d463c20aa88defdaa..3c1d32ad35f2e0ec74ee06e94698a2911abfb95a 100644 (file)
@@ -15,7 +15,6 @@
  *             2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <linux/bitops.h>
index ec566f3e66c76d833ac5ef8fe3fb8ef2a2b9eebb..6c642d11d4ca4e18cf2f2da96bbda1ccd41e9f29 100644 (file)
@@ -19,7 +19,6 @@
  *             Marc Boucher    :       routing by fwmark
  */
 
-#include <linux/config.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <linux/bitops.h>
index 0f4145babb14cf78c324d83b6f99801eaf12d95a..5f87533684d5ab5b156fc02825097f200160e764 100644 (file)
@@ -15,7 +15,6 @@
  *             2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <linux/bitops.h>
index 95a639f2e3dbc654df393c3f985b20c4fa036560..1cb65305e1029b9bd47de0f041a469f098cb550f 100644 (file)
@@ -52,7 +52,6 @@
 
 #define VERSION "0.407"
 
-#include <linux/config.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <asm/bitops.h>
index 017900172f7d5fc01505b2ac9ea90f7628c4042c..4c86ac3d882deb0a5f7250714c84f49527cf90c1 100644 (file)
@@ -64,7 +64,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/jiffies.h>
index ab680c851aa204b5e2f1b2ee18dc023b7630764f..d299c8e547d6fc12bef77b60ceeaaed19c282715 100644 (file)
@@ -72,7 +72,6 @@
  *                                     Vinay Kulkarni
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
index 9a01bb81f8bf99f5d4202e7e459b88d597170621..e50a1bfd7ccc2c26306c85e27ffecb2d434c842a 100644 (file)
@@ -13,7 +13,6 @@
  *             2 of the License, or(at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/jhash.h>
 
index 457db99c76df79ca2724af4891f05940fbec46b7..8e7e41b66c799177f9b9d05691936e9beb83a08f 100644 (file)
@@ -11,7 +11,6 @@
  *      2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/fcntl.h>
index ee9b5515b9aea20fb28d61be5aedc04321f20676..95fac5532994dd0bd801009424f9ffac7764f007 100644 (file)
@@ -13,7 +13,6 @@
  *      2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/random.h>
 #include <linux/sched.h>
index 417f126c749e0539d335ee7c3e1c3a35a516a124..cdd805344c6183730f09be330a52ee4865a760b6 100644 (file)
@@ -8,7 +8,6 @@
  *             From code orinally in TCP
  */
 
-#include <linux/config.h>
 
 #include <net/inet_hashtables.h>
 #include <net/inet_timewait_sock.h>
index 9f0bb529ab70af99e2c79ee61521d38d19f9e1e0..a22d11d2911cd4f7772b2d6428a5d525c5cc2f59 100644 (file)
@@ -21,7 +21,6 @@
  *             Mike McLagan    :       Routing by source
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/mm.h>
 #include <linux/sched.h>
index da734c4391796e017ef55d5e3e4730bfe16a4490..b84b53a4752658e3f712328276f973f67069ea2a 100644 (file)
@@ -23,7 +23,6 @@
  */
 
 #include <linux/compiler.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/mm.h>
index ab99bebdcdc89da781df9997c002f9d3a27c6693..6ff9b10d9563c9ef972fb70e06fd88e521b323f9 100644 (file)
@@ -11,7 +11,6 @@
  */
 
 #include <linux/capability.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/sched.h>
index c9026dbf4c9342cca958490aed1dec45aa36abfa..e1a7dba2fa8ac6c381e3d0fb7c63d7ba99a857ea 100644 (file)
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/errno.h>
-#include <linux/config.h>
 
 #include <linux/net.h>
 #include <linux/socket.h>
index 7624fd1d8f9fe8860479db3d3e9d530a7cd69cda..ca0e714613fb504bf495dad4eb20b2e2579aecc3 100644 (file)
@@ -53,7 +53,6 @@
 #include <linux/mm.h>
 #include <linux/string.h>
 #include <linux/errno.h>
-#include <linux/config.h>
 
 #include <linux/socket.h>
 #include <linux/sockios.h>
@@ -744,7 +743,7 @@ static inline int ip_ufo_append_data(struct sock *sk,
        if (!err) {
                /* specify the length of each IP datagram fragment*/
                skb_shinfo(skb)->gso_size = mtu - fragheaderlen;
-               skb_shinfo(skb)->gso_type = SKB_GSO_UDPV4;
+               skb_shinfo(skb)->gso_type = SKB_GSO_UDP;
                __skb_queue_tail(&sk->sk_write_queue, skb);
 
                return 0;
@@ -1089,7 +1088,7 @@ ssize_t   ip_append_page(struct sock *sk, struct page *page,
        if ((sk->sk_protocol == IPPROTO_UDP) &&
            (rt->u.dst.dev->features & NETIF_F_UFO)) {
                skb_shinfo(skb)->gso_size = mtu - fragheaderlen;
-               skb_shinfo(skb)->gso_type = SKB_GSO_UDPV4;
+               skb_shinfo(skb)->gso_type = SKB_GSO_UDP;
        }
 
 
index 12e0bf19f24ad7c109382bbbfcc0a0ac572feccf..84f43a3c909811116ba8ed39cc01c98600c13afe 100644 (file)
@@ -17,7 +17,6 @@
  *             Mike McLagan    :       Routing by source
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/mm.h>
index 3ed8b57a1002c307d4fd74f021d6177de3d9aefe..8e0374847532970b502609fbfecb9d75332a8896 100644 (file)
@@ -13,7 +13,6 @@
  *   - Compression stats.
  *   - Adaptive compression.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <asm/scatterlist.h>
 #include <asm/semaphore.h>
index ea398ee43f28740d6b75eee0efe5ecdcd97c54ee..3291d5192aad93fe59c2baf911f30d62bf8d8d1d 100644 (file)
@@ -94,7 +94,6 @@
 
  
 #include <linux/capability.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/sched.h>
index 717ab7d6d7b6eb47d48f74b83623c45b820547d3..ba33f8621c6785fd71edf76e27e117a1cc1f397c 100644 (file)
@@ -28,7 +28,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <linux/types.h>
index c453e1e57f4bdd758b1210395c5447560bee3fc8..4c1940381ba0f38311c78e1d9f22407d2fe4d343 100644 (file)
@@ -13,7 +13,6 @@
  * Changes:
  *
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/jiffies.h>
 #include <linux/slab.h>
index db67373f9b348669de5045ba39c558105c7b1219..252e837b17a52d54079db9c1eb5a1f62d5889a4c 100644 (file)
@@ -12,7 +12,6 @@
  *             2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <linux/types.h>
index 5249dbe7c559f90fce4671405954a415aebb3b4c..b8c289f247cbb2622bbabe2fdfc0a2e028931962 100644 (file)
@@ -12,7 +12,6 @@
  *             2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <linux/types.h>
index b6cd2870478f9db2700e5a49839f07782ac758da..bba5abe5542d3a49dff281c9a222b335f0e2ee00 100644 (file)
@@ -12,7 +12,6 @@
  *             2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <linux/types.h>
index 342d0b9098f5f8ca9bdd5a019b6a7a0660ace097..d25ec4ae09e55ca2d9e0eb6d8dbc38de10b7849c 100644 (file)
@@ -12,7 +12,6 @@
  *             2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <linux/types.h>
index ad39bf640567caaf81e71fd40a83886739611537..80c73ca90116f51ecff0cc2e52b8e4201f747920 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/skbuff.h>
 #include <linux/netdevice.h>
index 7e4cf9a4d15f8509a4362466d7a4f26ef081f782..aa459177c3f8e11fd5ae0d516dc6c37586360d7c 100644 (file)
@@ -17,7 +17,6 @@
  *     - export ip_conntrack[_expect]_{find_get,put} functions
  * */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/icmp.h>
 #include <linux/ip.h>
index 4dcf526c394498c061bb4757d5f6d1e320b547e8..1d18c863f064d67fbba87db04c01020327c2025c 100644 (file)
@@ -8,7 +8,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/netfilter.h>
 #include <linux/ip.h>
index 0665674218c6987c0956f015be4069d41897a174..af35235672d58f9ce0ec320073b838930b0352a7 100644 (file)
@@ -11,7 +11,6 @@
  * For more information, please see http://nath323.sourceforge.net/
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/netfilter.h>
 #include <linux/ip.h>
index 8ccfe17bb253353693bb745c5c9fceff8ffa7de1..b020a33e65e94ca3b2a1cb4500b32923a8b24705 100644 (file)
@@ -46,7 +46,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/netfilter.h>
 #include <linux/ip.h>
index a2ac5ce544b2a9d75f2b0520f0303b7bc16a7777..44889075f3b2df3ed85807fb87cd5bc536e679aa 100644 (file)
@@ -22,7 +22,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/netfilter.h>
 #include <linux/ip.h>
index 21ee124c04636d686f1e3e360e4cb5f7d21c68f4..4ee016c427b4e4c0b573d7d0c6ba22799391b318 100644 (file)
@@ -23,7 +23,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/timer.h>
index 0416073c5600c109c56d85d3a49359a829fbc4cb..2d3612cd5f18cd1c442ac7407e7d5202c8d5ebbd 100644 (file)
@@ -254,7 +254,7 @@ static int do_basic_checks(struct ip_conntrack *conntrack,
        }
 
        DEBUGP("Basic checks passed\n");
-       return 0;
+       return count == 0;
 }
 
 static int new_state(enum ip_conntrack_dir dir,
index c5c2ce5cdeb88205ea3a17dc48d12dea4af3a5c3..fb920e76ec106744746b7716a3ea54be01333e94 100644 (file)
@@ -19,7 +19,6 @@
  * version 2.2
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/sched.h>
 #include <linux/timer.h>
index 88445aac3f280c06c02924e817c9987ee5191cfb..7bd3c22003a20a84b9e92479db92a0c1b871edcf 100644 (file)
@@ -12,7 +12,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/ip.h>
 #include <linux/netfilter.h>
index 5d506e0564d5f507b7209ddfea993e68366d52ec..cbcaa45370ae5a25476c9374fe4ee8e0ad3f5b87 100644 (file)
@@ -15,7 +15,6 @@
  *             - make ip_nat_resize_packet more generic (TCP and UDP)
  *             - add ip_nat_mangle_udp_packet
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kmod.h>
 #include <linux/types.h>
index f3977726ff09a7dfc145eadcc88744d4e6d1b8ec..1d149964dc38f0e944fb050ecae27cf5affd64a3 100644 (file)
@@ -35,7 +35,6 @@
  * 
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/ip.h>
 #include <linux/tcp.h>
index 96ceabaec4027932854f46479b112d45a4ac53d6..38acfdf540ebee653c74eb27a448697a43e75d83 100644 (file)
@@ -23,7 +23,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/ip.h>
 #include <linux/netfilter_ipv4/ip_nat.h>
index d20d557f915affc383308ebc793fbdcca8a8bf15..0b1b416759ccc948a54c9e78aabcda86b68fe89d 100644 (file)
@@ -43,7 +43,6 @@
  * 2000-08-06: Convert to new helper API (Harald Welte).
  *
  */
-#include <linux/config.h>
 #include <linux/in.h>
 #include <linux/module.h>
 #include <linux/types.h>
index 67e676783da9bd9cdf46fea59fcc287d5f9cf277..17de077a790169166533da0a12056012b668f77d 100644 (file)
@@ -18,7 +18,6 @@
  *     - now capable of multiple expectations for one master
  * */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/icmp.h>
 #include <linux/ip.h>
index 7aaaf92efb59ef755a6993a07023cd125a05faa5..fc5bdd5eb7d35aa7de0f4fd5a2c7a8bc794dd643 100644 (file)
@@ -14,7 +14,6 @@
  * 08 Oct 2005 Harald Welte <lafore@netfilter.org>
  *     - Generalize into "x_tables" layer and "{ip,ip6,arp}_tables"
  */
-#include <linux/config.h>
 #include <linux/cache.h>
 #include <linux/capability.h>
 #include <linux/skbuff.h>
index dbc83c5d7aa666f0521722460dbb6ce1f789e8a4..cbffeae3f565703d607c2431ebcce355e5925a37 100644 (file)
@@ -10,7 +10,6 @@
  *
  */
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/proc_fs.h>
 #include <linux/jhash.h>
 #include <linux/bitops.h>
index 8b3e7f99b8615e1e44b6951e0222e4358ca47d43..ebd94f2abf0d49674d8ba6d74e34dff475eb7588 100644 (file)
@@ -9,7 +9,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/inetdevice.h>
 #include <linux/ip.h>
index 2fcf1075b027aedb6bbe8bfbb7678e08bf82ff19..736c4b5a86a79f5158f114eec47c902af22c0cff 100644 (file)
@@ -10,7 +10,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/ip.h>
 #include <linux/module.h>
 #include <linux/netdevice.h>
index 431a3ce6f7b74b04df91966882811b8508a88d50..269bc2067cb80085588f132703399371468434cf 100644 (file)
@@ -12,7 +12,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/skbuff.h>
 #include <linux/ip.h>
index c84cc03389d8b717fa019886c3da5f65123381ba..d7dd7fe7051ca4413de76da6e631403499b67925 100644 (file)
@@ -47,7 +47,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/spinlock.h>
 #include <linux/socket.h>
 #include <linux/skbuff.h>
index 397b95cc026ba9841f4414ca79cc9622318654e1..4e7998beda635970bacb483dae78052180d649c8 100644 (file)
@@ -10,7 +10,6 @@
  *
  * Extended to all five netfilter hooks by Brad Chapman & Harald Welte
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/netfilter_ipv4/ip_tables.h>
 #include <linux/netdevice.h>
index 8cc8e1b3677894283bd047121a179fce74d80b8e..0af803df82b02ef645704099ea4d6f02b6d37701 100644 (file)
@@ -14,7 +14,6 @@
  * Derived from net/ipv4/netfilter/ip_conntrack_standalone.c
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/ip.h>
 #include <linux/netfilter.h>
index 291831e792aff067c46e8a3959c9a7058580ddbc..05f5114828eaf04d0393dda48038ed1c536639b6 100644 (file)
@@ -32,7 +32,6 @@
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/string.h>
-#include <linux/config.h>
 #include <linux/socket.h>
 #include <linux/in.h>
 #include <linux/inet.h>
index 60b11aece5c3971a321411b9247723b367ea4538..2dc6dbb284678916db25257405da673cfea06f72 100644 (file)
@@ -64,7 +64,6 @@
  *             2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
@@ -206,21 +205,27 @@ __u8 ip_tos2prio[16] = {
 struct rt_hash_bucket {
        struct rtable   *chain;
 };
-#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
+#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) || \
+       defined(CONFIG_PROVE_LOCKING)
 /*
  * Instead of using one spinlock for each rt_hash_bucket, we use a table of spinlocks
  * The size of this table is a power of two and depends on the number of CPUS.
+ * (on lockdep we have a quite big spinlock_t, so keep the size down there)
  */
-#if NR_CPUS >= 32
-#define RT_HASH_LOCK_SZ        4096
-#elif NR_CPUS >= 16
-#define RT_HASH_LOCK_SZ        2048
-#elif NR_CPUS >= 8
-#define RT_HASH_LOCK_SZ        1024
-#elif NR_CPUS >= 4
-#define RT_HASH_LOCK_SZ        512
+#ifdef CONFIG_LOCKDEP
+# define RT_HASH_LOCK_SZ       256
 #else
-#define RT_HASH_LOCK_SZ        256
+# if NR_CPUS >= 32
+#  define RT_HASH_LOCK_SZ      4096
+# elif NR_CPUS >= 16
+#  define RT_HASH_LOCK_SZ      2048
+# elif NR_CPUS >= 8
+#  define RT_HASH_LOCK_SZ      1024
+# elif NR_CPUS >= 4
+#  define RT_HASH_LOCK_SZ      512
+# else
+#  define RT_HASH_LOCK_SZ      256
+# endif
 #endif
 
 static spinlock_t      *rt_hash_locks;
index ce4cd5f355116e2d0d30e96aff51a2f6f2c0e90f..70cea9d08a38f7972b9a7ce0a7f17242de1ce41e 100644 (file)
@@ -10,7 +10,6 @@
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/sysctl.h>
-#include <linux/config.h>
 #include <linux/igmp.h>
 #include <linux/inetdevice.h>
 #include <net/snmp.h>
index 0336422c88a03becbf006d26c064b25504b62bf9..f6a2d9223d07ca1503aecfdaa9124e09b8e22247 100644 (file)
  *     TCP_CLOSE               socket is finished
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/fcntl.h>
@@ -643,7 +642,7 @@ static inline int select_size(struct sock *sk, struct tcp_sock *tp)
        int tmp = tp->mss_cache;
 
        if (sk->sk_route_caps & NETIF_F_SG) {
-               if (sk->sk_route_caps & NETIF_F_TSO)
+               if (sk_can_gso(sk))
                        tmp = 0;
                else {
                        int pgbreak = SKB_MAX_HEAD(MAX_TCP_HEADER);
@@ -2166,13 +2165,30 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features)
        if (!pskb_may_pull(skb, thlen))
                goto out;
 
-       segs = NULL;
-       if (skb_gso_ok(skb, features | NETIF_F_GSO_ROBUST))
-               goto out;
-
        oldlen = (u16)~skb->len;
        __skb_pull(skb, thlen);
 
+       if (skb_gso_ok(skb, features | NETIF_F_GSO_ROBUST)) {
+               /* Packet is from an untrusted source, reset gso_segs. */
+               int type = skb_shinfo(skb)->gso_type;
+               int mss;
+
+               if (unlikely(type &
+                            ~(SKB_GSO_TCPV4 |
+                              SKB_GSO_DODGY |
+                              SKB_GSO_TCP_ECN |
+                              SKB_GSO_TCPV6 |
+                              0) ||
+                            !(type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6))))
+                       goto out;
+
+               mss = skb_shinfo(skb)->gso_size;
+               skb_shinfo(skb)->gso_segs = (skb->len + mss - 1) / mss;
+
+               segs = NULL;
+               goto out;
+       }
+
        segs = skb_segment(skb, features);
        if (IS_ERR(segs))
                goto out;
@@ -2209,6 +2225,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features)
 out:
        return segs;
 }
+EXPORT_SYMBOL(tcp_tso_segment);
 
 extern void __skb_cb_too_small_for_tcp(int, int);
 extern struct tcp_congestion_ops tcp_reno;
index b2d9021ad22bfb0bef5d6c59a5ea2d4dc178fa01..b0134ab0837945bb4b4082a3435bd3f845c49440 100644 (file)
@@ -12,7 +12,6 @@
  * this behaves the same as the original Reno.
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <net/tcp.h>
index 857eefc52aab900c6a52f759f04d028f0af27516..5765f9d03174aad9c686a09106cd7943dd13a120 100644 (file)
@@ -6,7 +6,6 @@
  * Copyright (C) 2005 Stephen Hemminger <shemminger@osdl.org>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/mm.h>
 #include <linux/types.h>
index 78b7a6b9e4defed2a15d99ee6cc7356e52f69042..2be27980ca7854cd535555d6849746d4d499289e 100644 (file)
@@ -12,7 +12,6 @@
  * this behaves the same as the original Reno.
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <net/tcp.h>
index b56399c7cc12ac626372331768a7ac9effd2e946..57c5f0b10e6ccce7b90a51c75782a89bbac8112b 100644 (file)
@@ -11,7 +11,6 @@
  *      2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 
 #include <linux/module.h>
 #include <linux/inet_diag.h>
index 1120245b237341bb9e8d4664e0a9f2eb2ab824af..aaa1538c0692c2d842b244106e1f859817f28177 100644 (file)
@@ -6,7 +6,6 @@
  * John Heffner <jheffner@psc.edu>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <net/tcp.h>
 
index 3d92c185926702ce4db03bced99ae286903ddc61..6edfe5e4510eda643a0aef9c0f48db09e83b5e2d 100644 (file)
@@ -6,7 +6,6 @@
  * http://www.hamilton.ie/net/htcp3.pdf
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <net/tcp.h>
index 40dbb38775101c02b4c285b887f13d1ff0aecebb..7406e0c5fb8e45d85a18bc956accd781221944d0 100644 (file)
@@ -10,7 +10,6 @@
  *    root at danielinux.net
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <net/tcp.h>
 
index 7fa0b4a8a389c6e08c7eaf51ba1ceb922e1eede9..738dad9f7d498d40538aa77c3161900353470c7a 100644 (file)
@@ -63,7 +63,6 @@
  *             Pasi Sarolahti:         F-RTO for dealing with spurious RTOs
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/sysctl.h>
index 4c6ef47eb1c372d72ba2eab9d877672b7ca9646d..5a886e6efbbedfc79ba382d131fa70338b9138d6 100644 (file)
@@ -52,7 +52,6 @@
  *                                     a single port at the same time.
  */
 
-#include <linux/config.h>
 
 #include <linux/types.h>
 #include <linux/fcntl.h>
@@ -91,7 +90,7 @@ static struct socket *tcp_socket;
 void tcp_v4_send_check(struct sock *sk, int len, struct sk_buff *skb);
 
 struct inet_hashinfo __cacheline_aligned tcp_hashinfo = {
-       .lhash_lock     = RW_LOCK_UNLOCKED,
+       .lhash_lock     = __RW_LOCK_UNLOCKED(tcp_hashinfo.lhash_lock),
        .lhash_users    = ATOMIC_INIT(0),
        .lhash_wait     = __WAIT_QUEUE_HEAD_INITIALIZER(tcp_hashinfo.lhash_wait),
 };
@@ -242,6 +241,7 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
                goto failure;
 
        /* OK, now commit destination to socket.  */
+       sk->sk_gso_type = SKB_GSO_TCPV4;
        sk_setup_caps(sk, &rt->u.dst);
 
        if (!tp->write_seq)
@@ -884,6 +884,7 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
        if (!newsk)
                goto exit;
 
+       newsk->sk_gso_type = SKB_GSO_TCPV4;
        sk_setup_caps(newsk, dst);
 
        newtp                 = tcp_sk(newsk);
@@ -1089,7 +1090,7 @@ process:
 
        skb->dev = NULL;
 
-       bh_lock_sock(sk);
+       bh_lock_sock_nested(sk);
        ret = 0;
        if (!sock_owned_by_user(sk)) {
 #ifdef CONFIG_NET_DMA
index 54b2ef7d3efeb26e2fa7866d344604faa47c8bca..0ccb7cb22b1518a3fc14f4ed2d95829615716753 100644 (file)
@@ -20,7 +20,6 @@
  *             Jorge Cwik, <jorge@laser.satlink.net>
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/sysctl.h>
@@ -41,7 +40,7 @@ int sysctl_tcp_abort_on_overflow;
 struct inet_timewait_death_row tcp_death_row = {
        .sysctl_max_tw_buckets = NR_FILE * 2,
        .period         = TCP_TIMEWAIT_LEN / INET_TWDR_TWKILL_SLOTS,
-       .death_lock     = SPIN_LOCK_UNLOCKED,
+       .death_lock     = __SPIN_LOCK_UNLOCKED(tcp_death_row.death_lock),
        .hashinfo       = &tcp_hashinfo,
        .tw_timer       = TIMER_INITIALIZER(inet_twdr_hangman, 0,
                                            (unsigned long)&tcp_death_row),
index 5a7cb4a9c867f7a0cd4c1edf738dae2138a9e6c6..5c08ea20a18dfb8fa965fc23070729c176aba4f0 100644 (file)
@@ -510,8 +510,7 @@ static void tcp_queue_skb(struct sock *sk, struct sk_buff *skb)
 
 static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb, unsigned int mss_now)
 {
-       if (skb->len <= mss_now ||
-           !(sk->sk_route_caps & NETIF_F_TSO)) {
+       if (skb->len <= mss_now || !sk_can_gso(sk)) {
                /* Avoid the costly divide in the normal
                 * non-TSO case.
                 */
@@ -525,7 +524,7 @@ static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb, unsigned
                factor /= mss_now;
                skb_shinfo(skb)->gso_segs = factor;
                skb_shinfo(skb)->gso_size = mss_now;
-               skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4;
+               skb_shinfo(skb)->gso_type = sk->sk_gso_type;
        }
 }
 
@@ -824,9 +823,7 @@ unsigned int tcp_current_mss(struct sock *sk, int large_allowed)
 
        mss_now = tp->mss_cache;
 
-       if (large_allowed &&
-           (sk->sk_route_caps & NETIF_F_TSO) &&
-           !tp->urg_mode)
+       if (large_allowed && sk_can_gso(sk) && !tp->urg_mode)
                doing_tso = 1;
 
        if (dst) {
index 26d7486ee5019a842157d9b4b8aeea55abb2f26c..4624501e9680d14dc0ec462797cd9648b77541ea 100644 (file)
@@ -5,7 +5,6 @@
  * John Heffner <jheffner@sc.edu>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <net/tcp.h>
 
index 3b7403495052e31efb9bbaa4c33e740fd99685f2..490360b5b4bf19a8fd306ca178d2dd5da7a26e6d 100644 (file)
@@ -31,7 +31,6 @@
  *     assumed senders never went idle.
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/skbuff.h>
index 4247da1384bfb25487b51add257cb8d852ec8327..5446312ffd2add4204dcf3b57045e3aedf7547e5 100644 (file)
@@ -21,7 +21,6 @@
  * ssthresh after packet loss. The probing phase is as the original Reno.
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/skbuff.h>
index 3f93292b0ad8549366ce57938170e08116de1faf..9bfcddad695b0c4e3a2c3bb5dde02454ffa8266e 100644 (file)
@@ -91,7 +91,6 @@
 #include <linux/errno.h>
 #include <linux/timer.h>
 #include <linux/mm.h>
-#include <linux/config.h>
 #include <linux/inet.h>
 #include <linux/ipv6.h>
 #include <linux/netdevice.h>
index c0465284dfacba4dccd0063e357e865301023d40..8f50eae47d039e3d1fbb69dac42db60e1eb1b53e 100644 (file)
@@ -9,7 +9,6 @@
  */
 
 #include <linux/compiler.h>
-#include <linux/config.h>
 #include <linux/inetdevice.h>
 #include <net/xfrm.h>
 #include <net/ip.h>
index 4da664538f5204dd47f0299ada575435d719a3ca..c250d0af10d77c3fc76f90a842da7414d1b2ed1e 100644 (file)
@@ -40,7 +40,6 @@
  *                                             status etc.
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/socket.h>
index e19457fe4f6edb79ef059dbf88f93ed1836bc8d9..5a0ba58b86cc055845c74dba1ca8c6c0a47fdc31 100644 (file)
@@ -23,7 +23,6 @@
 
 #include <linux/module.h>
 #include <linux/capability.h>
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/socket.h>
@@ -660,8 +659,6 @@ int inet6_sk_rebuild_header(struct sock *sk)
                }
 
                ip6_dst_store(sk, dst, NULL);
-               sk->sk_route_caps = dst->dev->features &
-                       ~(NETIF_F_IP_CSUM | NETIF_F_TSO);
        }
 
        return 0;
index d31c0d6c04488c90cf7c8972851c9f526aa1f1f0..9d4831bd43355fd6d8ca1ff343fde85092b4de8d 100644 (file)
@@ -24,7 +24,6 @@
  *     This file is derived from net/ipv4/ah.c.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <net/ip.h>
 #include <net/ah.h>
index 39ec528923f630205f37a725987544222601dd99..f6881d7a038599ee190c3dfcee85cb12b222d876 100644 (file)
@@ -14,7 +14,6 @@
  */
 
 #include <linux/capability.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/types.h>
index a15a6f320f7000c5b512ff3f6f3085a33016c3df..a278d5e862fe38b9210b3d814604883f450ef339 100644 (file)
@@ -24,7 +24,6 @@
  *     This file is derived from net/ipv4/esp.c
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <net/ip.h>
 #include <net/xfrm.h>
index a18d4256372cf988e66d1feef51507b7163b8103..9d0ee7f0eeb5296dfb44514295c1c5c53027fb59 100644 (file)
@@ -179,7 +179,7 @@ static int ipv6_destopt_rcv(struct sk_buff **skbp)
 
 static struct inet6_protocol destopt_protocol = {
        .handler        =       ipv6_destopt_rcv,
-       .flags          =       INET6_PROTO_NOPOLICY,
+       .flags          =       INET6_PROTO_NOPOLICY | INET6_PROTO_GSO_EXTHDR,
 };
 
 void __init ipv6_destopt_init(void)
@@ -340,7 +340,7 @@ looped_back:
 
 static struct inet6_protocol rthdr_protocol = {
        .handler        =       ipv6_rthdr_rcv,
-       .flags          =       INET6_PROTO_NOPOLICY,
+       .flags          =       INET6_PROTO_NOPOLICY | INET6_PROTO_GSO_EXTHDR,
 };
 
 void __init ipv6_rthdr_init(void)
index eb2865d5ae286cdfffa2c098aa881c7c752b526e..5c950cc79d80a3c04384b8238e2573e9f827fdb5 100644 (file)
@@ -13,7 +13,6 @@
  *             2 of the License, or(at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/in6.h>
 #include <linux/ipv6.h>
@@ -187,8 +186,6 @@ int inet6_csk_xmit(struct sk_buff *skb, int ipfragok)
                }
 
                ip6_dst_store(sk, dst, NULL);
-               sk->sk_route_caps = dst->dev->features &
-                       ~(NETIF_F_IP_CSUM | NETIF_F_TSO);
        }
 
        skb->dst = dst_clone(dst);
index 2ae84c961678f17d258aaf1524a2d58a39f60835..d2f3fc990bfaa2a535bf4cbf2f6a4590b66abb71 100644 (file)
@@ -14,7 +14,6 @@
  *      2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/random.h>
 
index 2cb6149349bf89a4f6f8c4941fd9b8864f996483..764221220afd301411753bc00ef72b308304ab90 100644 (file)
@@ -19,7 +19,6 @@
  *                             remove ip6_null_entry from the top of
  *                             routing table.
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/net.h>
index f9ca63912fbf378f3ed4d8bd1461776a5ccc3d33..1d672b0547f25c9bed0fcb72a2125bc0b475c857 100644 (file)
@@ -10,7 +10,6 @@
  */
 
 #include <linux/capability.h>
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/socket.h>
index aceee252503dfe84f5ccb34b950949f284577d0a..df8f051c0fce2eb910429a9313ec0db8e3ba9462 100644 (file)
@@ -84,14 +84,9 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
         */
        IP6CB(skb)->iif = skb->dst ? ((struct rt6_info *)skb->dst)->rt6i_idev->dev->ifindex : dev->ifindex;
 
-       if (skb->len < sizeof(struct ipv6hdr))
+       if (unlikely(!pskb_may_pull(skb, sizeof(*hdr))))
                goto err;
 
-       if (!pskb_may_pull(skb, sizeof(struct ipv6hdr))) {
-               IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
-               goto drop;
-       }
-
        hdr = skb->nh.ipv6h;
 
        if (hdr->version != 6)
index abb94de3376876a02eb1adcb5081ed021a93a67d..2c5b44575af0fee96124d8e37580af9e2d2cb4b4 100644 (file)
@@ -28,7 +28,6 @@
  *                             for datagram xmit
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/string.h>
@@ -230,7 +229,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
        skb->priority = sk->sk_priority;
 
        mtu = dst_mtu(dst);
-       if ((skb->len <= mtu) || ipfragok) {
+       if ((skb->len <= mtu) || ipfragok || skb_shinfo(skb)->gso_size) {
                IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
                return NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev,
                                dst_output);
@@ -835,7 +834,7 @@ static inline int ip6_ufo_append_data(struct sock *sk,
                /* specify the length of each IP datagram fragment*/
                skb_shinfo(skb)->gso_size = mtu - fragheaderlen - 
                                            sizeof(struct frag_hdr);
-               skb_shinfo(skb)->gso_type = SKB_GSO_UDPV4;
+               skb_shinfo(skb)->gso_type = SKB_GSO_UDP;
                ipv6_select_ident(skb, &fhdr);
                skb_shinfo(skb)->ip6_frag_id = fhdr.identification;
                __skb_queue_tail(&sk->sk_write_queue, skb);
index a995796b5a577fb7b0f4a947d54a85897143a1ab..bc77c0e1a943520fd31f4caf6b0bd5f23b1bba5f 100644 (file)
@@ -19,7 +19,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/capability.h>
 #include <linux/errno.h>
index f28cd37feed3132444f84609cfaaed24ecfe3ede..b285b0357084adac5a81679d8a8e577863dd233d 100644 (file)
@@ -30,7 +30,6 @@
  *  The decompression of IP datagram MUST be done after the reassembly, 
  *  AH/ESP processing.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <net/ip.h>
 #include <net/xfrm.h>
index 4c20eeb3d56844859754cb207c8ad705f6558c4b..0c17dec11c8d1215725f780666056f8304ecf25f 100644 (file)
@@ -27,7 +27,6 @@
 
 #include <linux/module.h>
 #include <linux/capability.h>
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/socket.h>
 
 DEFINE_SNMP_STAT(struct ipstats_mib, ipv6_statistics) __read_mostly;
 
+static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb, int features)
+{
+       struct sk_buff *segs = ERR_PTR(-EINVAL);
+       struct ipv6hdr *ipv6h;
+       struct inet6_protocol *ops;
+       int proto;
+
+       if (unlikely(skb_shinfo(skb)->gso_type &
+                    ~(SKB_GSO_UDP |
+                      SKB_GSO_DODGY |
+                      SKB_GSO_TCP_ECN |
+                      SKB_GSO_TCPV6 |
+                      0)))
+               goto out;
+
+       if (unlikely(!pskb_may_pull(skb, sizeof(*ipv6h))))
+               goto out;
+
+       ipv6h = skb->nh.ipv6h;
+       proto = ipv6h->nexthdr;
+       __skb_pull(skb, sizeof(*ipv6h));
+
+       rcu_read_lock();
+       for (;;) {
+               struct ipv6_opt_hdr *opth;
+               int len;
+
+               if (proto != NEXTHDR_HOP) {
+                       ops = rcu_dereference(inet6_protos[proto]);
+
+                       if (unlikely(!ops))
+                               goto unlock;
+
+                       if (!(ops->flags & INET6_PROTO_GSO_EXTHDR))
+                               break;
+               }
+
+               if (unlikely(!pskb_may_pull(skb, 8)))
+                       goto unlock;
+
+               opth = (void *)skb->data;
+               len = opth->hdrlen * 8 + 8;
+
+               if (unlikely(!pskb_may_pull(skb, len)))
+                       goto unlock;
+
+               proto = opth->nexthdr;
+               __skb_pull(skb, len);
+       }
+
+       skb->h.raw = skb->data;
+       if (likely(ops->gso_segment))
+               segs = ops->gso_segment(skb, features);
+
+unlock:
+       rcu_read_unlock();
+
+       if (unlikely(IS_ERR(segs)))
+               goto out;
+
+       for (skb = segs; skb; skb = skb->next) {
+               ipv6h = skb->nh.ipv6h;
+               ipv6h->payload_len = htons(skb->len - skb->mac_len -
+                                          sizeof(*ipv6h));
+       }
+
+out:
+       return segs;
+}
+
 static struct packet_type ipv6_packet_type = {
        .type = __constant_htons(ETH_P_IPV6), 
        .func = ipv6_rcv,
+       .gso_segment = ipv6_gso_segment,
 };
 
 struct ip6_ra_chain *ip6_ra_chain;
index 16482785bdfddf322fad974dfe3e407285549ee2..dd4d1ce777699e66b57f2bfd097c09a4cbe000ea 100644 (file)
@@ -1,5 +1,4 @@
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <net/protocol.h>
 #include <net/ipv6.h>
index 6e871afbb2c7154bbb72723ade6a212773b00440..9d697d4dcffccde33651b99a5e9b7fe9b37ddf48 100644 (file)
@@ -28,7 +28,6 @@
  *             - MLDv2 support
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/types.h>
index dfa20d3be9b69ec23db998c2e5268e38ab60a41a..b50055b9278d8b1bf9752b30ff41ad5e648115d4 100644 (file)
@@ -48,7 +48,6 @@
 #endif
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/socket.h>
index 0b5bd5587a3e67926b9baf2322d7797b1c70dd34..f26898b003475cb1358d6ab5dc9e7c831bca21c9 100644 (file)
  */
 
 #include <linux/capability.h>
-#include <linux/config.h>
 #include <linux/in.h>
 #include <linux/skbuff.h>
 #include <linux/kmod.h>
 #include <linux/vmalloc.h>
 #include <linux/netdevice.h>
 #include <linux/module.h>
+#include <linux/poison.h>
 #include <linux/icmpv6.h>
 #include <net/ipv6.h>
 #include <asm/uaccess.h>
@@ -377,7 +377,7 @@ ip6t_do_table(struct sk_buff **pskb,
        } while (!hotdrop);
 
 #ifdef CONFIG_NETFILTER_DEBUG
-       ((struct ip6t_entry *)table_base)->comefrom = 0xdead57ac;
+       ((struct ip6t_entry *)table_base)->comefrom = NETFILTER_LINK_POISON;
 #endif
        read_unlock_bh(&table->lock);
 
index de1175c27f6dfde1d4639d6ac8f5251cf9bf9c57..8629ba195d2d8ae290ac921518f1905e78f7f34f 100644 (file)
@@ -15,7 +15,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/skbuff.h>
 #include <linux/icmpv6.h>
index 2a71c3b669f17993b562cd1875a7b4f04e082b38..c2ab38ff46af523159e7b1e090fdc008fc16f87d 100644 (file)
@@ -20,7 +20,6 @@
  *       structures.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/ipv6.h>
 #include <linux/in6.h>
index c32a029e43f0530a3c5e58c764ea3eef16247646..00d5583807f76c0e5f22f6c2a7f7fb9d74fc7a1b 100644 (file)
@@ -14,7 +14,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/string.h>
index 779ddf77f4d41d0455d449ad2e4b4f8eeaf8f984..efee7a6301a81269c4678dc0bb18fe48c471bf96 100644 (file)
@@ -17,7 +17,6 @@
  *             as published by the Free Software Foundation; either version
  *             2 of the License, or (at your option) any later version.
  */
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/socket.h>
 #include <linux/net.h>
index eef985e010ea7f85b06927d11fd181099825227f..4e299c69e1c60f1c469cd6dd8b8b90a3d0f016b0 100644 (file)
@@ -28,7 +28,6 @@
  *     YOSHIFUJI,H. @USAGI     Always remove fragment header to
  *                             calculate ICV correctly.
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/string.h>
index e728980160d2243400ed49cd2124bd7dfec5bb34..87c39c978cd0e12dc44ecddd521d5a220e40ff9f 100644 (file)
@@ -25,7 +25,6 @@
  */
 
 #include <linux/capability.h>
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/times.h>
index 6578c3080f47738fb1a2a4d35e4320c2c4d285a2..c56aeece2bf59cff97a63c91fb366327637e73f3 100644 (file)
@@ -18,7 +18,6 @@
  * Nate Thompson <nate@thebog.net>:            6to4 support
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/capability.h>
 #include <linux/errno.h>
index 8eff9fa1e983312b38926e1d5e3286d7474f84b6..7a4639db13464bf6f6c87af2312680fe736d2561 100644 (file)
@@ -7,7 +7,6 @@
 
 #include <linux/mm.h>
 #include <linux/sysctl.h>
-#include <linux/config.h>
 #include <linux/in6.h>
 #include <linux/ipv6.h>
 #include <net/ndisc.h>
index b36d5b2e7c30e8a4217b1d3945fe5983dc6bc42d..5bdcb9002cf733ee670c05d12e2801e3a9488302 100644 (file)
@@ -26,7 +26,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/socket.h>
@@ -270,9 +269,8 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
        ipv6_addr_copy(&np->saddr, saddr);
        inet->rcv_saddr = LOOPBACK4_IPV6;
 
+       sk->sk_gso_type = SKB_GSO_TCPV6;
        ip6_dst_store(sk, dst, NULL);
-       sk->sk_route_caps = dst->dev->features &
-               ~(NETIF_F_IP_CSUM | NETIF_F_TSO);
 
        icsk->icsk_ext_hdr_len = 0;
        if (np->opt)
@@ -930,9 +928,8 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
         * comment in that function for the gory details. -acme
         */
 
+       sk->sk_gso_type = SKB_GSO_TCPV6;
        ip6_dst_store(newsk, dst, NULL);
-       newsk->sk_route_caps = dst->dev->features &
-               ~(NETIF_F_IP_CSUM | NETIF_F_TSO);
 
        newtcp6sk = (struct tcp6_sock *)newsk;
        inet_sk(newsk)->pinet6 = &newtcp6sk->inet6;
@@ -1606,6 +1603,7 @@ struct proto tcpv6_prot = {
 static struct inet6_protocol tcpv6_protocol = {
        .handler        =       tcp_v6_rcv,
        .err_handler    =       tcp_v6_err,
+       .gso_segment    =       tcp_tso_segment,
        .flags          =       INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL,
 };
 
index 8d3432a70f3a6e25d1a32cb5793e91f8fa380bca..ccc57f434cd3cde752edbf840eb624d8b6edfe7a 100644 (file)
@@ -23,7 +23,6 @@
  *      2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/socket.h>
index ee715f2691e9cd49018c4bb64ec27135a8c85298..73cd250aecbb7afeca2fa667ee9652b52aa9ec16 100644 (file)
@@ -12,7 +12,6 @@
  */
 
 #include <linux/compiler.h>
-#include <linux/config.h>
 #include <linux/netdevice.h>
 #include <net/addrconf.h>
 #include <net/xfrm.h>
index d37768e5064f8c77c9d9b84cb29917accd13d911..6b44fe8516c3cb3438e08dc3dcec78e746374fdb 100644 (file)
@@ -21,7 +21,6 @@
  * Based on net/ipv4/xfrm4_tunnel.c
  *
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/xfrm.h>
 #include <linux/list.h>
index 811d998725bc6728bec208ad90ef81157f8235a0..aa34ff4b707ca9a4151c6ce783761370901eaf4c 100644 (file)
@@ -28,7 +28,6 @@
  *     See net/ipx/ChangeLog.
  */
 
-#include <linux/config.h>
 #include <linux/capability.h>
 #include <linux/errno.h>
 #include <linux/if_arp.h>
index 1f73d9ea434da9938b7750725cad19f561647aa7..4c0c71206e548e642caf07b11f60142b23c03946 100644 (file)
@@ -4,7 +4,6 @@
  *     Copyright(C) Arnaldo Carvalho de Melo <acme@conectiva.com.br>, 2002
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #ifdef CONFIG_PROC_FS
 #include <linux/proc_fs.h>
index bba3431cd9a5b5ad707a32fd534ba1e4d2af8b95..a30dbb1e08fb209dc0e3a2d916fd942c50385f41 100644 (file)
@@ -7,7 +7,6 @@
  *     See net/ipx/ChangeLog.
  */
 
-#include <linux/config.h>
 #include <linux/list.h>
 #include <linux/route.h>
 #include <linux/spinlock.h>
index 510eda96d10aa2d3480519474c6c0eddf0cff1e7..fa574735c76fa11ce74d4e475316183e03fba1db 100644 (file)
@@ -6,7 +6,6 @@
  * Added /proc/sys/net/ipx/ipx_pprop_broadcasting - acme March 4, 2001
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/sysctl.h>
 
index 2f37c9f35e272a5e9026947835584806ff3324cc..7fae48a53bffaddd35205424ed5ec452171b8911 100644 (file)
@@ -42,7 +42,6 @@
  *
  ********************************************************************/
 
-#include <linux/config.h>
 #include <linux/capability.h>
 #include <linux/module.h>
 #include <linux/types.h>
index 286881978858e53213f8ce2285b54e56e67f9559..9c4a902a9dba79c0bdb315e926484d26b7b21829 100644 (file)
@@ -29,7 +29,6 @@
  *     
  ********************************************************************/
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/proc_fs.h>
index b592c4bc33312a8d7efa7550936ff96182886386..b400f27851fc5885985ae05527716236b04de88c 100644 (file)
@@ -30,7 +30,6 @@
  *     
  ********************************************************************/
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/fs.h>
index e3debbdb67f5a0272db139cda75eef326e0db71b..ba40e5495f58d0dd640b7ea3eed4fdcdf9e3b6a4 100644 (file)
@@ -29,7 +29,6 @@
  *
  ********************************************************************/
 
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/proc_fs.h>
 #include <linux/skbuff.h>
index 2d2e2b1919f40f70230c1527edbf8bb0c23d5fa4..a0472652a44e4318a9a5633e2ee9a337e079e0e9 100644 (file)
@@ -24,7 +24,6 @@
  *
  ********************************************************************/
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/skbuff.h>
index 657d12210578eeb8e4a478ba14903fdda85d7992..bd659dd545accb924bc3f828ce24471a9c997d4a 100644 (file)
@@ -23,7 +23,6 @@
  *
  ********************************************************************/
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/kernel.h>
index 953e255d2bc86d030c0eded616504f982ba0bb4f..b0ccc455b74740a5d5f3d5db27ca9f18da5c50fd 100644 (file)
@@ -25,7 +25,6 @@
  *     
  ********************************************************************/
 
-#include <linux/config.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/inetdevice.h>
index a16528657b4c6a0a7e584df36e051cdcff6706ec..cade355ac8af51387b385d74052771ad9b6d32e4 100644 (file)
@@ -29,7 +29,6 @@
  *
  ********************************************************************/
 
-#include <linux/config.h>
 #include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/skbuff.h>
index a505b5457608097238f8da41cdd3b6318e243425..99faff68c399aa92422453f79497889113de9094 100644 (file)
@@ -25,7 +25,6 @@
  *
  ********************************************************************/
 
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
index 57ea160f470b8d433fbb2b0c2240520a0806115e..129ad64c15bbcd069f6c61086e510b7b7e50907d 100644 (file)
@@ -24,7 +24,6 @@
  *
  ********************************************************************/
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/string.h>
index 26649f6528e6c4388324c84895423d32304b9a23..4c90dd1b450317b22af7acaeb5b61ca3a19cd952 100644 (file)
@@ -24,7 +24,6 @@
  *
  ********************************************************************/
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 
 #include <net/irda/irda.h>
index 91cd268172fa0a5a2450480f6c0c98cc54b61e19..39761a1d18f53058e5c45490d44e5dfa3e647855 100644 (file)
@@ -24,7 +24,6 @@
  *
  ********************************************************************/
 
-#include <linux/config.h>
 #include <linux/skbuff.h>
 #include <linux/kernel.h>
 
index 634901dd156fc7b2154234f423417324032515a0..2869b16e417d273ac9bdbe4b355ee2d35bb2c295 100644 (file)
@@ -31,7 +31,6 @@
  * Jean II
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 
index ad6caba02a7be931439ae73f37f56c4b02a992ed..80887528e77efeb4c9655758371f6b73ccdac376 100644 (file)
 #include <linux/miscdevice.h>
 #include <linux/poll.h>
 #include <linux/capability.h>
-#include <linux/config.h>
 #include <linux/ctype.h>       /* isspace() */
 #include <asm/uaccess.h>
 #include <linux/init.h>
index 1b1c4193359ae9e580c304bbd4800f565a976eb1..86805c3d8324a0d6ae158292e55139d110ec9920 100644 (file)
@@ -23,7 +23,6 @@
  *     
  ********************************************************************/
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/ctype.h>
 #include <linux/sysctl.h>
index 8aff254cb41851e7e53e0f96f13bd83d1a6346b2..49c51c5f1a86774c3369d2ae057eb2321fa9dc38 100644 (file)
@@ -24,7 +24,6 @@
  *
  ********************************************************************/
 
-#include <linux/config.h>
 #include <linux/skbuff.h>
 #include <linux/init.h>
 #include <linux/seq_file.h>
index ddfb5c502a90468fcc25651080708fd287bfdee5..95a69c013ee84205f105d052ed74e8840c1e8d84 100644 (file)
@@ -30,7 +30,6 @@
  *     
  ********************************************************************/
 
-#include <linux/config.h>
 #include <asm/byteorder.h>
 
 #include <net/irda/irda.h>
index 0e17f976add69990b8ad346312b9f30133b257bb..3871a2b911f93722e78791203eccb048d7b95a13 100644 (file)
@@ -25,7 +25,6 @@
  ********************************************************************/
 
 #include <asm/system.h>
-#include <linux/config.h>
 #include <linux/delay.h>
 
 #include <net/irda/timer.h>
index d5e2121ea20775001af804c6504377c05c8c5d69..3a95b2ee469063a039dd856393eb7963d0521dd1 100644 (file)
@@ -14,7 +14,6 @@
  *             Derek Atkins <derek@ihtfp.com>
  */
 
-#include <linux/config.h>
 #include <linux/capability.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
index 75c9b1480801e2a52cc81ac96fbcfe21cbcc918e..d6cfe84d521ba9fdb9e7321e03d6c9c754f19ed1 100644 (file)
@@ -20,7 +20,6 @@
  *
  * See the GNU General Public License for more details.
  */
-#include <linux/config.h>
 #include <linux/compiler.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
index 5ae47be7dde0def38ae98d29a0805dd8f231373d..a89917130a7bd76e4aa9e64c4b2c8a1b78b6723a 100644 (file)
@@ -11,7 +11,6 @@
  *
  * See the GNU General Public License for more details.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
index bd531cb235a70c6ea22de33b935307ca04aeea24..19308fece3ad945ae58c4e92dcef5fcfa57812f6 100644 (file)
@@ -12,7 +12,6 @@
  * See the GNU General Public License for more details.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/proc_fs.h>
index f37dbf8ef126a1cdc8464d98f1320660f664a9f6..8275bd33bd9d6b3d0ad2cea55a1c579e14b5f9e5 100644 (file)
@@ -11,7 +11,6 @@
  *
  * See the GNU General Public License for more details.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <net/llc.h>
index d1eaddb1363377a5690705e5783696d07f378d51..45d7dd92a08804e2978a739b2db6f9d3296eb437 100644 (file)
@@ -4,7 +4,6 @@
  * Arnaldo Carvalho de Melo <acme@conectiva.com.br>
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/init.h>
 #include <linux/sysctl.h>
index 8455a32ea5c4df61e7cc8c78125f988e15b65cf3..5d29d5e23624d9ec9ffca2c35cb7707cdc236bac 100644 (file)
@@ -10,7 +10,6 @@
  * 15-Mar-2000:   Added NF_REPEAT --RR.
  * 08-May-2003:          Internal logging interface added by Jozsef Kadlecsik.
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/netfilter.h>
 #include <net/protocol.h>
index cd299f4b7db1989c5e5d1897698d987c370db48a..8f2261965a68bb4e1bc039b8df37c890314f21fc 100644 (file)
@@ -29,7 +29,6 @@
  * Derived from net/ipv4/netfilter/ip_conntrack_core.c
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/netfilter.h>
 #include <linux/module.h>
index 11d3be2435364ca09063026e09becee25c7b1939..960972d225f972a69f163506d2397401b35524a7 100644 (file)
@@ -15,7 +15,6 @@
  * Derived from net/ipv4/netfilter/ip_conntrack_ftp.c
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/netfilter.h>
index 3fc58e454d4e2b94bf1ac2da40762095d212680e..21e0bc91cf23da78002e9ea335fc1cfeb0ffb5dc 100644 (file)
@@ -15,7 +15,6 @@
  *     Yasuyuki Kozakai @USAGI <yasuyuki.kozakai@toshiba.co.jp>
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/ip.h>
 #include <linux/netfilter.h>
index 0839b701b9309f3fd9a98e58c31c0f1a4e897406..9bd8a7877fd54648e86ab904778d4e32159627cb 100644 (file)
@@ -261,7 +261,7 @@ static int do_basic_checks(struct nf_conn *conntrack,
        }
 
        DEBUGP("Basic checks passed\n");
-       return 0;
+       return count == 0;
 }
 
 static int new_state(enum ip_conntrack_dir dir,
index 12fb7c0a15098e9050e1779f41f2acd1939a086d..af8adcba23a7235da6a57206d36e53ef451fb67a 100644 (file)
@@ -24,7 +24,6 @@
  * version 2.2
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/sched.h>
 #include <linux/timer.h>
index e34c574f035133b509a402d4880a2b1f5bf035a8..5fcab2ef231f56d62d5f39deb8ec7b1bc0117e05 100644 (file)
@@ -17,7 +17,6 @@
  * Derived from net/ipv4/netfilter/ip_conntrack_standalone.c
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/netfilter.h>
 #include <linux/module.h>
index 6bdee2910617dac3176aef65361c9eae5399b7b5..86e392bfe8330e68484f6cab83cfc9749091cb97 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _NF_INTERNALS_H
 #define _NF_INTERNALS_H
 
-#include <linux/config.h>
 #include <linux/list.h>
 #include <linux/skbuff.h>
 #include <linux/netdevice.h>
index 3e76bd0824a25b7c31e60ea4a5d59e27745f12fc..8901b3a07f7e26a41d23bb6389c6c6d7731e61ca 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/module.h>
index ee8f70889f47d752b422b4eb01798c9e99266c7a..bb6fcee452ca37f8a683d89a4c63775ea250b004 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/module.h>
index 0a63d7dac7bea3015895b5fdd960e59926fd634c..c2e44e90e4374f0be18650a5e109fddb946d78a8 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/module.h>
index ec9f0efea6bb58e18bb7bcf9dbab66b333029fac..52fdfa2686c9f2c76aa54e75083f1deabc3ac949 100644 (file)
@@ -14,7 +14,6 @@
  * of the GNU General Public License, incorporated herein by reference.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/socket.h>
index 99293c63ff7348c71c38c9eaf3a3406876a0a3f3..174e8f97009510aad1471c6fd28c7a44b38646d7 100644 (file)
@@ -13,7 +13,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/socket.h>
 #include <linux/net.h>
index a3aa62fbda6f1311b05d56ea16bd92050df49427..ba1ca03abad326b4d37bf5dceb8338792294b17e 100644 (file)
@@ -8,7 +8,6 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/skbuff.h>
 #include <linux/init.h>
index 3862e73d14d731b1c3674d811412fe1b29eab6dc..55c0adc8f11501c6b1b130ffb68e6a0588165e62 100644 (file)
@@ -21,7 +21,6 @@
  *                                mandatory if CONFIG_NET=y these days
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/capability.h>
@@ -157,7 +156,7 @@ static void netlink_sock_destruct(struct sock *sk)
 
 static void netlink_table_grab(void)
 {
-       write_lock_bh(&nl_table_lock);
+       write_lock_irq(&nl_table_lock);
 
        if (atomic_read(&nl_table_users)) {
                DECLARE_WAITQUEUE(wait, current);
@@ -167,9 +166,9 @@ static void netlink_table_grab(void)
                        set_current_state(TASK_UNINTERRUPTIBLE);
                        if (atomic_read(&nl_table_users) == 0)
                                break;
-                       write_unlock_bh(&nl_table_lock);
+                       write_unlock_irq(&nl_table_lock);
                        schedule();
-                       write_lock_bh(&nl_table_lock);
+                       write_lock_irq(&nl_table_lock);
                }
 
                __set_current_state(TASK_RUNNING);
@@ -179,7 +178,7 @@ static void netlink_table_grab(void)
 
 static __inline__ void netlink_table_ungrab(void)
 {
-       write_unlock_bh(&nl_table_lock);
+       write_unlock_irq(&nl_table_lock);
        wake_up(&nl_table_wait);
 }
 
index fffef4ab276f08a27e6890bda232d83cb5e6ac68..dddbd15135a8712421c4148f32801861d0b7f7c4 100644 (file)
@@ -5,7 +5,6 @@
  *                             Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index edf084becd5ecafccb25a99ddc0c8cd997336125..a298f77cc3e38dc2d4d7997d1ae977622ec6c746 100644 (file)
@@ -5,7 +5,6 @@
  *                             Thomas Graf <tgraf@suug.ch>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index 3669cb953e6e7d49c05eb82c39ba1d43e80f9e3d..389a4119e1b405a9cebbf11f4a9076ff4b2d95c4 100644 (file)
@@ -8,7 +8,6 @@
  * Copyright Alan Cox GW4PTS (alan@lxorguk.ukuu.org.uk)
  * Copyright Darryl Miles G7LED (dlm@g7led.demon.co.uk)
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/capability.h>
@@ -801,7 +800,7 @@ static int nr_accept(struct socket *sock, struct socket *newsock, int flags)
 
        /* Now attach up the new socket */
        kfree_skb(skb);
-       sk->sk_ack_backlog--;
+       sk_acceptq_removed(sk);
        newsock->sk = newsk;
 
 out:
@@ -986,7 +985,7 @@ int nr_rx_frame(struct sk_buff *skb, struct net_device *dev)
        nr_make->vr        = 0;
        nr_make->vl        = 0;
        nr_make->state     = NR_STATE_3;
-       sk->sk_ack_backlog++;
+       sk_acceptq_added(sk);
 
        nr_insert_socket(make);
 
index 621e5586ab030c93d2f30aea69b39c4d8624b70c..9b8eb54971ab2ca97d2920c0c913d0271d4b945d 100644 (file)
@@ -6,7 +6,6 @@
  *
  * Copyright Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk)
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/proc_fs.h>
 #include <linux/kernel.h>
index 9db7dbdb16e6bd14c7ca23dc6c8dfe11e16f4566..f9cef3671593efaf7a513efacc3097fc27743507 100644 (file)
@@ -49,7 +49,6 @@
  *
  */
  
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
index 55564efccf1153fc051df3e8b9b26a7d515fa32c..d0a67bb31363de2e45468dd9d9a99739b4c29e0c 100644 (file)
@@ -10,7 +10,6 @@
  * Copyright (C) Tomi Manninen OH2BNS (oh2bns@sral.fi)
  */
 
-#include <linux/config.h>
 #include <linux/capability.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
@@ -753,7 +752,7 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le
 
                rose_insert_socket(sk);         /* Finish the bind */
        }
-
+rose_try_next_neigh:
        rose->dest_addr   = addr->srose_addr;
        rose->dest_call   = addr->srose_call;
        rose->rand        = ((long)rose & 0xFFFF) + rose->lci;
@@ -811,6 +810,11 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le
        }
 
        if (sk->sk_state != TCP_ESTABLISHED) {
+       /* Try next neighbour */
+               rose->neighbour = rose_get_neigh(&addr->srose_addr, &cause, &diagnostic);
+               if (rose->neighbour)
+                       goto rose_try_next_neigh;
+       /* No more neighbour */
                sock->state = SS_UNCONNECTED;
                return sock_error(sk);  /* Always set at this point */
        }
index 2a1bf8e119e52c4c45904bd8a47bd4d132195081..7c279e2659eca174aefaee1e8d942516ac5e6427 100644 (file)
@@ -6,7 +6,6 @@
  *
  * Copyright (C) Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk)
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/proc_fs.h>
 #include <linux/kernel.h>
@@ -60,6 +59,7 @@ static int rose_rebuild_header(struct sk_buff *skb)
        struct net_device_stats *stats = netdev_priv(dev);
        unsigned char *bp = (unsigned char *)skb->data;
        struct sk_buff *skbn;
+       unsigned int len;
 
 #ifdef CONFIG_INET
        if (arp_find(bp + 7, skb)) {
@@ -76,6 +76,8 @@ static int rose_rebuild_header(struct sk_buff *skb)
 
        kfree_skb(skb);
 
+       len = skbn->len;
+
        if (!rose_route_frame(skbn, NULL)) {
                kfree_skb(skbn);
                stats->tx_errors++;
@@ -83,7 +85,7 @@ static int rose_rebuild_header(struct sk_buff *skb)
        }
 
        stats->tx_packets++;
-       stats->tx_bytes += skbn->len;
+       stats->tx_bytes += len;
 #endif
        return 1;
 }
index 56adf16fed0c1ccf160a429372fa2ad62423d0fb..9896fd87a4d4916adc25105eb48eec5792e2cb38 100644 (file)
@@ -9,7 +9,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <rxrpc/transport.h>
index fbf98729c748b3acfc8276ef672ba8e03b7b3209..6374df7e77d1bfeb3558efd37e769e8e1b60f834 100644 (file)
@@ -9,7 +9,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/module.h>
index 13eeee582886d530947c0dd10cc7be8099b6d245..8298ea9ffe19289f3f8b335e407aecad19f629cf 100644 (file)
@@ -305,7 +305,7 @@ config NET_CLS_U32
        tristate "Universal 32bit comparisons w/ hashing (U32)"
        select NET_CLS
        ---help---
-         Say Y here to be able to classify packetes using a universal
+         Say Y here to be able to classify packets using a universal
          32bit pieces based comparison scheme.
 
          To compile this code as a module, choose M here: the
@@ -485,7 +485,7 @@ config NET_ACT_IPT
         tristate "IPtables targets"
         depends on NET_CLS_ACT && NETFILTER && IP_NF_IPTABLES
         ---help---
-         Say Y here to be able to invoke iptables targets after succesful
+         Say Y here to be able to invoke iptables targets after successful
          classification.
 
          To compile this code as a module, choose M here: the
@@ -537,8 +537,8 @@ config NET_ESTIMATOR
        ---help---
          Say Y here to allow using rate estimators to estimate the current
          rate-of-flow for network devices, queues, etc. This module is
-         automaticaly selected if needed but can be selected manually for
-         statstical purposes.
+         automatically selected if needed but can be selected manually for
+         statistical purposes.
 
 endif # NET_SCHED
 
index 2ffa11c6e8ded50080855fe7250642ebacc8cf2f..5b9397b33238fae1317aa21ee62485790dbcfea0 100644 (file)
@@ -14,7 +14,6 @@
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <linux/bitops.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index a1e68f78dcc291359e297786b564d8b062fc2ffd..e75a147ad60fcb66f71729d6d25d15b04f18c80d 100644 (file)
@@ -13,7 +13,6 @@
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <linux/bitops.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index 37640c6fc014c4c8a53a01609cbc78a51cbc7de6..d799e01248c4e64f34287db96675a351a8cdb8db 100644 (file)
@@ -14,7 +14,6 @@
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <asm/bitops.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index 4fcccbd5088590054847c338cd8e2c23d0b8d90e..fc562047ecc50f7e2061ef8551599007dd706674 100644 (file)
@@ -15,7 +15,6 @@
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <asm/bitops.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index 1742a68e0122a134a9e4430c5e96a762a3f3061a..58b3a8652042fa2d90c5061616b93ff83b888392 100644 (file)
@@ -12,7 +12,6 @@
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <asm/bitops.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index 24c348fa89222b3c8d11d5b4db2938d82f3d7ad6..47e00bd9625ef1864706e5d835481a61ed7aeead 100644 (file)
@@ -13,7 +13,6 @@
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <linux/bitops.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index e5f2e1f431e2a36d92ed5c8c4263b8fcefbd44fd..17105c82537fa2472c3bd4e33b7a0c4bdbd345fa 100644 (file)
@@ -10,7 +10,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
index b4d89fbb378212966b93d9cbc25596ce8add064c..7e14f14058e991393ca1a75aacc669a516e1906c 100644 (file)
@@ -17,7 +17,6 @@
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <linux/bitops.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index dfb300bb6baa067963a5e0e1e160087ae69d291d..61507f006b114e350fb5dee3febb3961ea965b9e 100644 (file)
@@ -9,7 +9,6 @@
  * Authors:    Thomas Graf <tgraf@suug.ch>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 75470486e4050edb23e4db439a3228adfbfc170e..d41de91fc4f6fc559bdc5f658dfd2c886131f651 100644 (file)
@@ -18,7 +18,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
index 520ff716dab2f0d744845747366f320dd83f9434..c2e71900f7bdd2f64ed400860623004342e12fd5 100644 (file)
@@ -10,7 +10,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <linux/bitops.h>
index 572f06be3b02a181447c1e125056a833687ef017..ba87419716290204d4f1708ac978f74183c09804 100644 (file)
@@ -65,7 +65,6 @@
    Well, as result, despite its simplicity, we get a pretty
    powerful classification engine.  */
 
-#include <linux/config.h>
 
 struct rsvp_head
 {
index 9f921174c8ab39d33e9544c9b78051b3b8a12cdf..7870e7bb0bacc033752366da5ccd31fdd9bfe890 100644 (file)
@@ -4,7 +4,6 @@
  * Written 1998,1999 by Werner Almesberger, EPFL ICA
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 78e052591fa99c299da13011277249548d1885a8..d712edcd1bcfc36d591342c2f53dec718ee1dc84 100644 (file)
@@ -33,7 +33,6 @@
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <linux/bitops.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index bf1f00f8b1bf76223e89e1aa58258430b0ddd90d..8ed93c39b4eaa5dcd76e2ebdeee3690dad3bb5eb 100644 (file)
@@ -9,7 +9,6 @@
  * Authors:    Thomas Graf <tgraf@suug.ch>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 700844d49d795d36acffd22815b5fb4f15ec3ce9..698372954f4db614e50b774467ce78788fa7d58b 100644 (file)
@@ -58,7 +58,6 @@
  *           only available if that subsytem is enabled in the kernel.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 71ea926a9f092fcce116144a94ea24d6eef76244..cc80babfd79ff6870cd4b982f446721b67da777f 100644 (file)
@@ -9,7 +9,6 @@
  * Authors:    Thomas Graf <tgraf@suug.ch>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 77beabc91fa37107d662bd837a448a3d23cb944f..aa17d8f7c4c873aca24d6ae54ec5247dd8fefd8d 100644 (file)
@@ -9,7 +9,6 @@
  * Authors:    Thomas Graf <tgraf@suug.ch>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 34e7e51e601e0f3e4baec3e5e1dba4ec1a0e8841..e3ddfce0ac8d9b28e7eee8d49c1f35920932363f 100644 (file)
@@ -12,7 +12,6 @@
  * Based on net/sched/cls_u32.c
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 5cb956b721e8e05a452262decdc114061cb0a0a0..2405a86093a2eeed7d7ebbed7ce92b5d4527a062 100644 (file)
@@ -81,7 +81,6 @@
  *      open up a beer to watch the compilation going.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 31570b9a6e9aa72cca60d1953c14e47938547ebe..c7844bacbbcbb3770804ff1d2e0afb7a18ce3ead 100644 (file)
@@ -15,7 +15,6 @@
  * Jamal Hadi Salim <hadi@nortelnetworks.com>: 990601: ingress support
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index ac7cb60d1e251da2591c42bae124011e02d2d98a..dbf44da0912fa1007dc1842503c6c4438d10f665 100644 (file)
@@ -3,7 +3,6 @@
 /* Written 1998-2000 by Werner Almesberger, EPFL ICA */
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/string.h>
index 81f0b8346d17ee3bb790b3dee89012076c35780c..cb0c456aa34929478c36c4bc64fb4f2df1cad6f8 100644 (file)
@@ -11,7 +11,6 @@
  * Note: Quantum tunneling is not supported.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 6cd81708bf710e0c307807bcbffc35176be452a2..80b7f6a8d008e85f6c220ec0b3bc2624bef18d79 100644 (file)
@@ -10,7 +10,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
index f6320ca70493943a64cb449b07e71a52f72095f4..11c8a2119b96aaf353a0d44c883826f30f8f9e2a 100644 (file)
@@ -3,7 +3,6 @@
 /* Written 1998-2000 by Werner Almesberger, EPFL ICA */
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/types.h>
index 033083bf0e741e6863a5cb999f58dbda6d3729a1..c2689f4ba8de9a3fdd364c6a4e3537852f1261a2 100644 (file)
@@ -9,7 +9,6 @@
  * Authors:    Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 74d4a1dceeeca0ab8d11bbcee83631d553c49383..d735f51686a19da66a22b0bf583e7cc81ec11c2f 100644 (file)
@@ -14,7 +14,6 @@
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <linux/bitops.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 29a2dd9f30296f613123118976c963f557e899d6..0cafdd5feb1bba315746c221ccb842485cd0ab84 100644 (file)
@@ -18,7 +18,6 @@
  *  For all the glorious comments look at include/net/red.h
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index f1c7bd29f2cdc3932941c86e529426923484dee1..6b1b4a981e883bca03a22e457d478a27298626c3 100644 (file)
@@ -50,7 +50,6 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/errno.h>
index 3ec95df4a85ed50c2548b69c591c33333e3edd63..34afe41fa2f3b6dd3d620214ded409d6fde9781a 100644 (file)
@@ -27,7 +27,6 @@
  *
  * $Id: sch_htb.c,v 1.25 2003/12/07 11:08:25 devik Exp devik $
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
index 8edc32a6ad2feadf6b310cdc80e44b857fb3613b..c3242f727d414667a26b89b4ff68d0895645a524 100644 (file)
@@ -7,7 +7,6 @@
  * Authors:     Jamal Hadi Salim 1999
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/skbuff.h>
index 5a4a4d0ae50226615a3c6661b544e5c333162521..c5bd8064e6d81e68ff1a1b41ffca80ede3778fa1 100644 (file)
@@ -13,7 +13,6 @@
  *             Catalin(ux aka Dino) BOIE <catab at umbrella dot ro>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/bitops.h>
 #include <linux/types.h>
index 3395ca7bcadfa76e3200e45cddf7944081965031..a5fa03c0c19b6c8167f2e68a4e4d3b052c0b0bcc 100644 (file)
@@ -11,7 +11,6 @@
  *              Init --  EINVAL when opt undefined
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
index 2be563cba72bce95879fabd9245a4790dae1bf1a..d65cadddea691020c0ce71e1ae08bf7af8975c78 100644 (file)
@@ -14,7 +14,6 @@
  * J Hadi Salim 980816:  ECN support
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index e057768f68b4806a1155e367fbf77ba5e00d2fc4..d0d6e595a78c8f824480b3f656815c2c0942839d 100644 (file)
@@ -9,7 +9,6 @@
  * Authors:    Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
index d8e03c74ca76f0c0a68159a49d865efe99ec7c74..d9a5d298d755539443fa2a618ff70ba4863126da 100644 (file)
@@ -12,7 +12,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
index b811691c35bf4eba764efa3eba3b0daeac6eca64..0a2c71d0d8aad858eb3408591c1af594d1d51587 100644 (file)
@@ -57,7 +57,6 @@
  * be incorporated into the next SCTP release.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/wait.h>
index 565f5e8d11913c797500a517c03835eee6e15ff9..b4848ce0d6ac44718a5e970996031343fb85ee8f 100644 (file)
@@ -58,7 +58,6 @@
  *     Based upon Swansea University Computer Society NET3.039
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/smp_lock.h>
 #include <linux/socket.h>
index f8bac6ccd524008a669c4e603d8526b9dabb006b..d88468d21c3783ebecc6bf0f25fbf835854fcf42 100644 (file)
@@ -224,7 +224,8 @@ EXPORT_SYMBOL(gss_service_to_auth_domain_name);
 void
 gss_mech_put(struct gss_api_mech * gm)
 {
-       module_put(gm->gm_owner);
+       if (gm)
+               module_put(gm->gm_owner);
 }
 
 EXPORT_SYMBOL(gss_mech_put);
@@ -307,8 +308,7 @@ gss_delete_sec_context(struct gss_ctx       **context_handle)
                (*context_handle)->mech_type->gm_ops
                        ->gss_delete_sec_context((*context_handle)
                                                        ->internal_ctx_id);
-       if ((*context_handle)->mech_type)
-               gss_mech_put((*context_handle)->mech_type);
+       gss_mech_put((*context_handle)->mech_type);
        kfree(*context_handle);
        *context_handle=NULL;
        return GSS_S_COMPLETE;
index d51e316c5821022690a88d93eadcf28b9ea31597..94217ec9e2dd5427a1b12cc559a46e114172e192 100644 (file)
@@ -425,6 +425,7 @@ static int rsc_parse(struct cache_detail *cd,
        struct rsc rsci, *rscp = NULL;
        time_t expiry;
        int status = -EINVAL;
+       struct gss_api_mech *gm = NULL;
 
        memset(&rsci, 0, sizeof(rsci));
        /* context handle */
@@ -453,7 +454,6 @@ static int rsc_parse(struct cache_detail *cd,
                set_bit(CACHE_NEGATIVE, &rsci.h.flags);
        else {
                int N, i;
-               struct gss_api_mech *gm;
 
                /* gid */
                if (get_int(&mesg, &rsci.cred.cr_gid))
@@ -488,21 +488,17 @@ static int rsc_parse(struct cache_detail *cd,
                status = -EINVAL;
                /* mech-specific data: */
                len = qword_get(&mesg, buf, mlen);
-               if (len < 0) {
-                       gss_mech_put(gm);
+               if (len < 0)
                        goto out;
-               }
                status = gss_import_sec_context(buf, len, gm, &rsci.mechctx);
-               if (status) {
-                       gss_mech_put(gm);
+               if (status)
                        goto out;
-               }
-               gss_mech_put(gm);
        }
        rsci.h.expiry_time = expiry;
        rscp = rsc_update(&rsci, rscp);
        status = 0;
 out:
+       gss_mech_put(gm);
        rsc_free(&rsci);
        if (rscp)
                cache_put(&rscp->h, &rsc_cache);
@@ -836,6 +832,74 @@ out:
        return stat;
 }
 
+static inline int
+total_buf_len(struct xdr_buf *buf)
+{
+       return buf->head[0].iov_len + buf->page_len + buf->tail[0].iov_len;
+}
+
+static void
+fix_priv_head(struct xdr_buf *buf, int pad)
+{
+       if (buf->page_len == 0) {
+               /* We need to adjust head and buf->len in tandem in this
+                * case to make svc_defer() work--it finds the original
+                * buffer start using buf->len - buf->head[0].iov_len. */
+               buf->head[0].iov_len -= pad;
+       }
+}
+
+static int
+unwrap_priv_data(struct svc_rqst *rqstp, struct xdr_buf *buf, u32 seq, struct gss_ctx *ctx)
+{
+       u32 priv_len, maj_stat;
+       int pad, saved_len, remaining_len, offset;
+
+       rqstp->rq_sendfile_ok = 0;
+
+       priv_len = ntohl(svc_getu32(&buf->head[0]));
+       if (rqstp->rq_deferred) {
+               /* Already decrypted last time through! The sequence number
+                * check at out_seq is unnecessary but harmless: */
+               goto out_seq;
+       }
+       /* buf->len is the number of bytes from the original start of the
+        * request to the end, where head[0].iov_len is just the bytes
+        * not yet read from the head, so these two values are different: */
+       remaining_len = total_buf_len(buf);
+       if (priv_len > remaining_len)
+               return -EINVAL;
+       pad = remaining_len - priv_len;
+       buf->len -= pad;
+       fix_priv_head(buf, pad);
+
+       /* Maybe it would be better to give gss_unwrap a length parameter: */
+       saved_len = buf->len;
+       buf->len = priv_len;
+       maj_stat = gss_unwrap(ctx, 0, buf);
+       pad = priv_len - buf->len;
+       buf->len = saved_len;
+       buf->len -= pad;
+       /* The upper layers assume the buffer is aligned on 4-byte boundaries.
+        * In the krb5p case, at least, the data ends up offset, so we need to
+        * move it around. */
+       /* XXX: This is very inefficient.  It would be better to either do
+        * this while we encrypt, or maybe in the receive code, if we can peak
+        * ahead and work out the service and mechanism there. */
+       offset = buf->head[0].iov_len % 4;
+       if (offset) {
+               buf->buflen = RPCSVC_MAXPAYLOAD;
+               xdr_shift_buf(buf, offset);
+               fix_priv_head(buf, pad);
+       }
+       if (maj_stat != GSS_S_COMPLETE)
+               return -EINVAL;
+out_seq:
+       if (ntohl(svc_getu32(&buf->head[0])) != seq)
+               return -EINVAL;
+       return 0;
+}
+
 struct gss_svc_data {
        /* decoded gss client cred: */
        struct rpc_gss_wire_cred        clcred;
@@ -1051,7 +1115,14 @@ svcauth_gss_accept(struct svc_rqst *rqstp, u32 *authp)
                        svc_putu32(resv, 0);
                        break;
                case RPC_GSS_SVC_PRIVACY:
-                       /* currently unsupported */
+                       if (unwrap_priv_data(rqstp, &rqstp->rq_arg,
+                                       gc->gc_seq, rsci->mechctx))
+                               goto auth_err;
+                       /* placeholders for length and seq. number: */
+                       svcdata->body_start = resv->iov_base + resv->iov_len;
+                       svc_putu32(resv, 0);
+                       svc_putu32(resv, 0);
+                       break;
                default:
                        goto auth_err;
                }
@@ -1076,8 +1147,8 @@ out:
        return ret;
 }
 
-static int
-svcauth_gss_release(struct svc_rqst *rqstp)
+static inline int
+svcauth_gss_wrap_resp_integ(struct svc_rqst *rqstp)
 {
        struct gss_svc_data *gsd = (struct gss_svc_data *)rqstp->rq_auth_data;
        struct rpc_gss_wire_cred *gc = &gsd->clcred;
@@ -1089,69 +1160,147 @@ svcauth_gss_release(struct svc_rqst *rqstp)
        int integ_offset, integ_len;
        int stat = -EINVAL;
 
+       p = gsd->body_start;
+       gsd->body_start = NULL;
+       /* move accept_stat to right place: */
+       memcpy(p, p + 2, 4);
+       /* Don't wrap in failure case: */
+       /* Counting on not getting here if call was not even accepted! */
+       if (*p != rpc_success) {
+               resbuf->head[0].iov_len -= 2 * 4;
+               goto out;
+       }
+       p++;
+       integ_offset = (u8 *)(p + 1) - (u8 *)resbuf->head[0].iov_base;
+       integ_len = resbuf->len - integ_offset;
+       BUG_ON(integ_len % 4);
+       *p++ = htonl(integ_len);
+       *p++ = htonl(gc->gc_seq);
+       if (xdr_buf_subsegment(resbuf, &integ_buf, integ_offset,
+                               integ_len))
+               BUG();
+       if (resbuf->page_len == 0
+                       && resbuf->head[0].iov_len + RPC_MAX_AUTH_SIZE
+                       < PAGE_SIZE) {
+               BUG_ON(resbuf->tail[0].iov_len);
+               /* Use head for everything */
+               resv = &resbuf->head[0];
+       } else if (resbuf->tail[0].iov_base == NULL) {
+               if (resbuf->head[0].iov_len + RPC_MAX_AUTH_SIZE > PAGE_SIZE)
+                       goto out_err;
+               resbuf->tail[0].iov_base = resbuf->head[0].iov_base
+                                               + resbuf->head[0].iov_len;
+               resbuf->tail[0].iov_len = 0;
+               rqstp->rq_restailpage = 0;
+               resv = &resbuf->tail[0];
+       } else {
+               resv = &resbuf->tail[0];
+       }
+       mic.data = (u8 *)resv->iov_base + resv->iov_len + 4;
+       if (gss_get_mic(gsd->rsci->mechctx, &integ_buf, &mic))
+               goto out_err;
+       svc_putu32(resv, htonl(mic.len));
+       memset(mic.data + mic.len, 0,
+                       round_up_to_quad(mic.len) - mic.len);
+       resv->iov_len += XDR_QUADLEN(mic.len) << 2;
+       /* not strictly required: */
+       resbuf->len += XDR_QUADLEN(mic.len) << 2;
+       BUG_ON(resv->iov_len > PAGE_SIZE);
+out:
+       stat = 0;
+out_err:
+       return stat;
+}
+
+static inline int
+svcauth_gss_wrap_resp_priv(struct svc_rqst *rqstp)
+{
+       struct gss_svc_data *gsd = (struct gss_svc_data *)rqstp->rq_auth_data;
+       struct rpc_gss_wire_cred *gc = &gsd->clcred;
+       struct xdr_buf *resbuf = &rqstp->rq_res;
+       struct page **inpages = NULL;
+       u32 *p;
+       int offset, *len;
+       int pad;
+
+       p = gsd->body_start;
+       gsd->body_start = NULL;
+       /* move accept_stat to right place: */
+       memcpy(p, p + 2, 4);
+       /* Don't wrap in failure case: */
+       /* Counting on not getting here if call was not even accepted! */
+       if (*p != rpc_success) {
+               resbuf->head[0].iov_len -= 2 * 4;
+               return 0;
+       }
+       p++;
+       len = p++;
+       offset = (u8 *)p - (u8 *)resbuf->head[0].iov_base;
+       *p++ = htonl(gc->gc_seq);
+       inpages = resbuf->pages;
+       /* XXX: Would be better to write some xdr helper functions for
+        * nfs{2,3,4}xdr.c that place the data right, instead of copying: */
+       if (resbuf->tail[0].iov_base && rqstp->rq_restailpage == 0) {
+               BUG_ON(resbuf->tail[0].iov_base >= resbuf->head[0].iov_base
+                                                       + PAGE_SIZE);
+               BUG_ON(resbuf->tail[0].iov_base < resbuf->head[0].iov_base);
+               if (resbuf->tail[0].iov_len + resbuf->head[0].iov_len
+                               + 2 * RPC_MAX_AUTH_SIZE > PAGE_SIZE)
+                       return -ENOMEM;
+               memmove(resbuf->tail[0].iov_base + RPC_MAX_AUTH_SIZE,
+                       resbuf->tail[0].iov_base,
+                       resbuf->tail[0].iov_len);
+               resbuf->tail[0].iov_base += RPC_MAX_AUTH_SIZE;
+       }
+       if (resbuf->tail[0].iov_base == NULL) {
+               if (resbuf->head[0].iov_len + 2*RPC_MAX_AUTH_SIZE > PAGE_SIZE)
+                       return -ENOMEM;
+               resbuf->tail[0].iov_base = resbuf->head[0].iov_base
+                       + resbuf->head[0].iov_len + RPC_MAX_AUTH_SIZE;
+               resbuf->tail[0].iov_len = 0;
+               rqstp->rq_restailpage = 0;
+       }
+       if (gss_wrap(gsd->rsci->mechctx, offset, resbuf, inpages))
+               return -ENOMEM;
+       *len = htonl(resbuf->len - offset);
+       pad = 3 - ((resbuf->len - offset - 1)&3);
+       p = (u32 *)(resbuf->tail[0].iov_base + resbuf->tail[0].iov_len);
+       memset(p, 0, pad);
+       resbuf->tail[0].iov_len += pad;
+       resbuf->len += pad;
+       return 0;
+}
+
+static int
+svcauth_gss_release(struct svc_rqst *rqstp)
+{
+       struct gss_svc_data *gsd = (struct gss_svc_data *)rqstp->rq_auth_data;
+       struct rpc_gss_wire_cred *gc = &gsd->clcred;
+       struct xdr_buf *resbuf = &rqstp->rq_res;
+       int stat = -EINVAL;
+
        if (gc->gc_proc != RPC_GSS_PROC_DATA)
                goto out;
        /* Release can be called twice, but we only wrap once. */
        if (gsd->body_start == NULL)
                goto out;
        /* normally not set till svc_send, but we need it here: */
-       resbuf->len = resbuf->head[0].iov_len
-               + resbuf->page_len + resbuf->tail[0].iov_len;
+       /* XXX: what for?  Do we mess it up the moment we call svc_putu32
+        * or whatever? */
+       resbuf->len = total_buf_len(resbuf);
        switch (gc->gc_svc) {
        case RPC_GSS_SVC_NONE:
                break;
        case RPC_GSS_SVC_INTEGRITY:
-               p = gsd->body_start;
-               gsd->body_start = NULL;
-               /* move accept_stat to right place: */
-               memcpy(p, p + 2, 4);
-               /* don't wrap in failure case: */
-               /* Note: counting on not getting here if call was not even
-                * accepted! */
-               if (*p != rpc_success) {
-                       resbuf->head[0].iov_len -= 2 * 4;
-                       goto out;
-               }
-               p++;
-               integ_offset = (u8 *)(p + 1) - (u8 *)resbuf->head[0].iov_base;
-               integ_len = resbuf->len - integ_offset;
-               BUG_ON(integ_len % 4);
-               *p++ = htonl(integ_len);
-               *p++ = htonl(gc->gc_seq);
-               if (xdr_buf_subsegment(resbuf, &integ_buf, integ_offset,
-                                       integ_len))
-                       BUG();
-               if (resbuf->page_len == 0
-                       && resbuf->head[0].iov_len + RPC_MAX_AUTH_SIZE
-                               < PAGE_SIZE) {
-                       BUG_ON(resbuf->tail[0].iov_len);
-                       /* Use head for everything */
-                       resv = &resbuf->head[0];
-               } else if (resbuf->tail[0].iov_base == NULL) {
-                       if (resbuf->head[0].iov_len + RPC_MAX_AUTH_SIZE
-                                       > PAGE_SIZE)
-                               goto out_err;
-                       resbuf->tail[0].iov_base =
-                               resbuf->head[0].iov_base
-                               + resbuf->head[0].iov_len;
-                       resbuf->tail[0].iov_len = 0;
-                       rqstp->rq_restailpage = 0;
-                       resv = &resbuf->tail[0];
-               } else {
-                       resv = &resbuf->tail[0];
-               }
-               mic.data = (u8 *)resv->iov_base + resv->iov_len + 4;
-               if (gss_get_mic(gsd->rsci->mechctx, &integ_buf, &mic))
+               stat = svcauth_gss_wrap_resp_integ(rqstp);
+               if (stat)
                        goto out_err;
-               svc_putu32(resv, htonl(mic.len));
-               memset(mic.data + mic.len, 0,
-                               round_up_to_quad(mic.len) - mic.len);
-               resv->iov_len += XDR_QUADLEN(mic.len) << 2;
-               /* not strictly required: */
-               resbuf->len += XDR_QUADLEN(mic.len) << 2;
-               BUG_ON(resv->iov_len > PAGE_SIZE);
                break;
        case RPC_GSS_SVC_PRIVACY:
+               stat = svcauth_gss_wrap_resp_priv(rqstp);
+               if (stat)
+                       goto out_err;
+               break;
        default:
                goto out_err;
        }
index d25b054ec921cd1e11d0497bf152fcaf7d105b96..623180f224c97990a0389299014520fc5f5412ca 100644 (file)
@@ -6,7 +6,6 @@
  * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/socket.h>
 #include <linux/kernel.h>
index dafe793c774e8aa16d8b380e3306dc6d325470cd..dc6cb93c88308ef0f966b13bf40d09978db0c7c6 100644 (file)
@@ -8,7 +8,6 @@
  * Copyright (c) 2002, Trond Myklebust <trond.myklebust@fys.uio.no>
  *
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/string.h>
@@ -516,7 +515,7 @@ rpc_depopulate(struct dentry *parent)
        struct dentry *dentry, *dvec[10];
        int n = 0;
 
-       mutex_lock(&dir->i_mutex);
+       mutex_lock_nested(&dir->i_mutex, I_MUTEX_CHILD);
 repeat:
        spin_lock(&dcache_lock);
        list_for_each_safe(pos, next, &parent->d_subdirs) {
@@ -632,7 +631,7 @@ rpc_lookup_negative(char *path, struct nameidata *nd)
        if ((error = rpc_lookup_parent(path, nd)) != 0)
                return ERR_PTR(error);
        dir = nd->dentry->d_inode;
-       mutex_lock(&dir->i_mutex);
+       mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT);
        dentry = lookup_one_len(nd->last.name, nd->dentry, nd->last.len);
        if (IS_ERR(dentry))
                goto out_err;
@@ -694,7 +693,7 @@ rpc_rmdir(char *path)
        if ((error = rpc_lookup_parent(path, &nd)) != 0)
                return error;
        dir = nd.dentry->d_inode;
-       mutex_lock(&dir->i_mutex);
+       mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT);
        dentry = lookup_one_len(nd.last.name, nd.dentry, nd.last.len);
        if (IS_ERR(dentry)) {
                error = PTR_ERR(dentry);
@@ -755,7 +754,7 @@ rpc_unlink(char *path)
        if ((error = rpc_lookup_parent(path, &nd)) != 0)
                return error;
        dir = nd.dentry->d_inode;
-       mutex_lock(&dir->i_mutex);
+       mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT);
        dentry = lookup_one_len(nd.last.name, nd.dentry, nd.last.len);
        if (IS_ERR(dentry)) {
                error = PTR_ERR(dentry);
index 769114f0f886972ec99ef3a4bf904497cd0cf27a..f38f939ce95fffd12aaabb4aeed3580cf2be7c9a 100644 (file)
@@ -6,7 +6,6 @@
  * Copyright (C) 1997 Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/types.h>
index b08419e1fc68456c545575a2a8505923729161ed..01ba60a4957260601322fd261e5bafc81dfc200c 100644 (file)
@@ -280,7 +280,10 @@ svc_process(struct svc_serv *serv, struct svc_rqst *rqstp)
        rqstp->rq_res.page_base = 0;
        rqstp->rq_res.page_len = 0;
        rqstp->rq_res.buflen = PAGE_SIZE;
+       rqstp->rq_res.tail[0].iov_base = NULL;
        rqstp->rq_res.tail[0].iov_len = 0;
+       /* Will be turned off only in gss privacy case: */
+       rqstp->rq_sendfile_ok = 1;
        /* tcp needs a space for the record length... */
        if (rqstp->rq_prot == IPPROTO_TCP)
                svc_putu32(resv, 0);
index 1065904841fd5796b9482a994f3caa3bcc9eaaea..d89b048ad6bba57a4964c72a216a93d3a3bff4fd 100644 (file)
@@ -7,7 +7,6 @@
  * impossible at the moment.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/linkage.h>
 #include <linux/ctype.h>
index 58a1b6b42dddba6c85c10330bacdb48f7438e4f4..cd4eafbab1b8e265b70657033cc9a1047a16bce2 100644 (file)
@@ -12,7 +12,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/sysctl.h>
 
index 86f54f3512f1733f746f26547e9d424457ba445b..762aac2572be88f768d6e6d0d2c3337508b7965a 100644 (file)
@@ -297,7 +297,10 @@ static inline struct tipc_msg *buf_msg(struct sk_buff *skb)
  * buf_acquire - creates a TIPC message buffer
  * @size: message size (including TIPC header)
  *
- * Returns a new buffer.  Space is reserved for a data link header.
+ * Returns a new buffer with data pointers set to the specified size.
+ * 
+ * NOTE: Headroom is reserved to allow prepending of a data link header.
+ *       There may also be unrequested tailroom present at the buffer's end.
  */
 
 static inline struct sk_buff *buf_acquire(u32 size)
index c6831c75cfa4dd9ec9c03fb3da7cb451928f7a0c..c10e18a49b96b99d56fb8a71900ced7bebf98da6 100644 (file)
@@ -998,6 +998,8 @@ static int link_bundle_buf(struct link *l_ptr,
                return 0;
        if (skb_tailroom(bundler) < (pad + size))
                return 0;
+       if (link_max_pkt(l_ptr) < (to_pos + size))
+               return 0;
 
        skb_put(bundler, pad + size);
        memcpy(bundler->data + to_pos, buf->data, size);
index fd11d4048b5223c1fe7b39e4dc66f82b0f988f67..f70475bfb62a1c19d9d2215dcf479e9381427a9f 100644 (file)
@@ -83,7 +83,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
@@ -145,7 +144,7 @@ static inline void unix_set_secdata(struct scm_cookie *scm, struct sk_buff *skb)
        scm->seclen = *UNIXSECLEN(skb);
 }
 #else
-static void unix_get_peersec_dgram(struct sk_buff *skb)
+static inline void unix_get_peersec_dgram(struct sk_buff *skb)
 { }
 
 static inline void unix_set_secdata(struct scm_cookie *scm, struct sk_buff *skb)
@@ -566,6 +565,14 @@ static struct proto unix_proto = {
        .obj_size = sizeof(struct unix_sock),
 };
 
+/*
+ * AF_UNIX sockets do not interact with hardware, hence they
+ * dont trigger interrupts - so it's safe for them to have
+ * bh-unsafe locking for their sk_receive_queue.lock. Split off
+ * this special lock-class by reinitializing the spinlock key:
+ */
+static struct lock_class_key af_unix_sk_receive_queue_lock_key;
+
 static struct sock * unix_create1(struct socket *sock)
 {
        struct sock *sk = NULL;
@@ -581,6 +588,8 @@ static struct sock * unix_create1(struct socket *sock)
        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);
 
        sk->sk_write_space      = unix_write_space;
        sk->sk_max_ack_backlog  = sysctl_unix_max_dgram_qlen;
@@ -1046,7 +1055,7 @@ restart:
                goto out_unlock;
        }
 
-       unix_state_wlock(sk);
+       unix_state_wlock_nested(sk);
 
        if (sk->sk_state != st) {
                unix_state_wunlock(sk);
index b1265187b4a8f8cfe4c55ec5aa3f36742f30c917..a690cf773b6ae5123002de6a11196cd2774f67a4 100644 (file)
@@ -32,7 +32,6 @@
 *
 ******************************************************************************/
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
index c34833dc7cc161f6664f8a487e4162b871606fae..ad8e8a797790713b0b04c621b3dba215715506ea 100644 (file)
@@ -42,7 +42,6 @@
 * Jun 02, 1999  Gideon Hack    Updates for Linux 2.0.X and 2.2.X kernels.
 *****************************************************************************/
 
-#include <linux/config.h>
 #include <linux/stddef.h>      /* offsetof(), etc. */
 #include <linux/capability.h>
 #include <linux/errno.h>       /* return codes */
index c28ba5a47209c4488ec7d9da62637c200b5986ac..930ea59463ad2888890a5c45b6f8aea9e6d24d67 100644 (file)
@@ -20,7 +20,6 @@
 * Dec 13, 1996 Gene Kozin      Initial version (based on Sangoma's WANPIPE)
 *****************************************************************************/
 
-#include <linux/config.h>
 #include <linux/init.h>                /* __initfunc et al. */
 #include <linux/stddef.h>      /* offsetof(), etc. */
 #include <linux/errno.h>       /* return codes */
index 282ce4e40d7b575e4ae53864380817a14bc317be..52a2726d327fe68f6c7ea003894902b204f25e99 100644 (file)
@@ -35,7 +35,6 @@
  *                                     response
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/capability.h>
 #include <linux/errno.h>
index adfe7b8df35591d29ee2d8a91de8bca57e9a3052..47b68a301677a7e65ff647f6cf484abccba1b81f 100644 (file)
@@ -17,7 +17,6 @@
  *      2000-09-04     Henner Eisen    Prevent freeing a dangling skb.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
index dfb80116c59f5da90ba87d1315e06d1d717a6105..a11837d361d2dd7582794be5c56ef4ce744b031e 100644 (file)
@@ -17,7 +17,6 @@
  *     2002/10/06      Arnaldo Carvalho de Melo  seq_file support
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
index 6c5d37517035866e874cef3f82e1cda304fbafd4..2a3fe986b245f648f59a83bca138a72b22419482 100644 (file)
@@ -17,7 +17,6 @@
  *     X.25 001        Jonathan Naylor Started coding.
  */
 
-#include <linux/config.h>
 #include <linux/if_arp.h>
 #include <linux/init.h>
 #include <net/x25.h>
index 6ed3302312fb56f0ebb2784b9990df6dca740865..04e1aea58bc947b8bbef38a5bb39246228aa7910 100644 (file)
@@ -9,7 +9,6 @@
  * any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/pfkeyv2.h>
index b8936926c24b84dba699540b54b0630f2002d439..405b741dff4353048b5f385cc503e48d0075ed85 100644 (file)
@@ -13,7 +13,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/slab.h>
 #include <linux/kmod.h>
 #include <linux/list.h>
index b0d067be739056089fbb09a357bbacc5c0daf6b4..2180c88cfe89111a79cfb15bb8361aefcd067d59 100644 (file)
@@ -12,6 +12,10 @@ space   := $(empty) $(empty)
 # contain a comma
 depfile = $(subst $(comma),_,$(@D)/.$(@F).d)
 
+###
+# filename of target with directory and extension stripped
+basetarget = $(basename $(notdir $@))
+
 ###
 # Escape single quote for use in echo statements
 escsq = $(subst $(squote),'\$(squote)',$1)
index 02a7eea5fdbcb77221eca244d264d33c1eada5f5..3cb445cc7432fdac293fcea287a62e437fee921f 100644 (file)
@@ -117,7 +117,7 @@ $(real-objs-m:.o=.lst): quiet_modtag := [M]
 $(obj-m)              : quiet_modtag := [M]
 
 # Default for not multi-part modules
-modname = $(*F)
+modname = $(basetarget)
 
 $(multi-objs-m)         : modname = $(modname-multi)
 $(multi-objs-m:.o=.i)   : modname = $(modname-multi)
diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst
new file mode 100644 (file)
index 0000000..aa9990a
--- /dev/null
@@ -0,0 +1,158 @@
+# ==========================================================================
+# Installing headers
+#
+# header-y files will be installed verbatim
+# unifdef-y are the files where unifdef will be run before installing files
+# objhdr-y are generated files that will be installed verbatim
+#
+# ==========================================================================
+
+UNIFDEF := unifdef -U__KERNEL__
+
+# Eliminate the contents of (and inclusions of) compiler.h
+HDRSED  := sed         -e "s/ inline / __inline__ /g" \
+               -e "s/[[:space:]]__user[[:space:]]\+/ /g" \
+               -e "s/(__user[[:space:]]\+/ (/g" \
+               -e "s/[[:space:]]__force[[:space:]]\+/ /g" \
+               -e "s/(__force[[:space:]]\+/ (/g" \
+               -e "s/[[:space:]]__iomem[[:space:]]\+/ /g" \
+               -e "s/(__iomem[[:space:]]\+/ (/g" \
+               -e "s/[[:space:]]__attribute_const__[[:space:]]\+/\ /g" \
+               -e "s/[[:space:]]__attribute_const__$$//" \
+               -e "/^\#include <linux\/compiler.h>/d"
+
+_dst := $(if $(dst),$(dst),$(obj))
+
+.PHONY: __headersinst
+__headersinst:
+
+
+ifeq (,$(patsubst include/asm/%,,$(obj)/))
+# For producing the generated stuff in include/asm for biarch builds, include
+# both sets of Kbuild files; we'll generate anything which is mentioned in
+# _either_ arch, and recurse into subdirectories which are mentioned in either
+# arch. Since some directories may exist in one but not the other, we must
+# use '-include'.
+GENASM := 1
+archasm           := $(subst include/asm,asm-$(ARCH),$(obj))
+altarchasm := $(subst include/asm,asm-$(ALTARCH),$(obj))
+-include $(srctree)/include/$(archasm)/Kbuild
+-include $(srctree)/include/$(altarchasm)/Kbuild
+else
+include $(srctree)/$(obj)/Kbuild
+endif
+
+include scripts/Kbuild.include
+
+# If this is include/asm-$(ARCH) and there's no $(ALTARCH), then
+# override $(_dst) so that we install to include/asm directly.
+ifeq ($(obj)$(ALTARCH),include/asm-$(ARCH))
+     _dst := include/asm
+endif
+
+header-y       := $(sort $(header-y))
+unifdef-y      := $(sort $(unifdef-y))
+subdir-y       := $(patsubst %/,%,$(filter %/, $(header-y)))
+header-y       := $(filter-out %/, $(header-y))
+header-y       := $(filter-out $(unifdef-y),$(header-y))
+
+ifdef ALTARCH
+ifeq ($(obj),include/asm-$(ARCH))
+altarch-y      := altarch-dir
+endif
+endif
+
+# Make the definitions visible for recursive make invocations
+export ALTARCH
+export ARCHDEF
+export ALTARCHDEF
+
+quiet_cmd_o_hdr_install   = INSTALL $(_dst)/$@
+      cmd_o_hdr_install   = cp $(objtree)/$(obj)/$@ $(INSTALL_HDR_PATH)/$(_dst)
+
+quiet_cmd_headers_install = INSTALL $(_dst)/$@
+      cmd_headers_install = $(HDRSED) $(srctree)/$(obj)/$@             \
+                           > $(INSTALL_HDR_PATH)/$(_dst)/$@
+
+quiet_cmd_unifdef        = UNIFDEF $(_dst)/$@
+      cmd_unifdef        = $(UNIFDEF) $(srctree)/$(obj)/$@ | $(HDRSED) \
+                            > $(INSTALL_HDR_PATH)/$(_dst)/$@ || :
+
+quiet_cmd_check                  = CHECK   $(_dst)/$@
+      cmd_check                  = $(srctree)/scripts/hdrcheck.sh              \
+                              $(INSTALL_HDR_PATH)/include              \
+                             $(INSTALL_HDR_PATH)/$(_dst)/$@
+
+quiet_cmd_mkdir                  = MKDIR   $@
+      cmd_mkdir                  = mkdir -p $(INSTALL_HDR_PATH)/$@
+
+quiet_cmd_gen            = GEN     $(_dst)/$@
+      cmd_gen            = \
+STUBDEF=__ASM_STUB_`echo $@ | tr a-z. A-Z_`;                           \
+(echo "/* File autogenerated by 'make headers_install' */" ;           \
+echo "\#ifndef $$STUBDEF" ;                                            \
+echo "\#define $$STUBDEF" ;                                            \
+echo "\# if $(ARCHDEF)" ;                                              \
+if [ -r $(srctree)/include/$(archasm)/$@ ]; then                       \
+       echo "\#  include <$(archasm)/$@>" ;                            \
+else                                                                   \
+       echo "\#  error $(archasm)/$@ does not exist in"                \
+                       "the $(ARCH) architecture" ;                    \
+fi ;                                                                   \
+echo "\# elif $(ALTARCHDEF)" ;                                         \
+if [ -r $(srctree)/include/$(altarchasm)/$@ ]; then                    \
+       echo "\#  include <$(altarchasm)/$@>" ;                         \
+else                                                                   \
+       echo "\#  error $(altarchasm)/$@ does not exist in"             \
+                       "the $(ALTARCH) architecture" ;                 \
+fi ;                                                                   \
+echo "\# else" ;                                                       \
+echo "\#  warning This machine appears to be"                          \
+                "neither $(ARCH) nor $(ALTARCH)." ;                    \
+echo "\# endif" ;                                                      \
+echo "\#endif /* $$STUBDEF */" ;                                       \
+) > $(INSTALL_HDR_PATH)/$(_dst)/$@
+
+__headersinst: $(subdir-y) $(header-y) $(unifdef-y) $(altarch-y) $(objhdr-y)
+
+.PHONY: $(header-y) $(unifdef-y) $(subdir-y)
+
+ifdef HDRCHECK
+# Rules for checking headers
+$(objhdr-y) $(header-y) $(unifdef-y):
+       $(call cmd,check)
+else
+# Rules for installing headers
+
+$(objhdr-y) $(subdir-y) $(header-y) $(unifdef-y): $(_dst)
+
+.PHONY: $(_dst)
+$(_dst):
+       $(call cmd,mkdir)
+
+ifdef GENASM
+$(objhdr-y) $(header-y) $(unifdef-y):
+       $(call cmd,gen)
+
+else
+$(objhdr-y):
+       $(call cmd,o_hdr_install)
+
+$(header-y):
+       $(call cmd,headers_install)
+
+$(unifdef-y):
+       $(call cmd,unifdef)
+endif
+endif
+
+hdrinst := -rR -f $(srctree)/scripts/Makefile.headersinst obj
+
+.PHONY: altarch-dir
+altarch-dir:
+       $(Q)$(MAKE) $(hdrinst)=include/asm-$(ALTARCH) dst=include/asm-$(ALTARCH)
+       $(Q)$(MAKE) $(hdrinst)=include/asm dst=include/asm
+
+# Recursion
+$(subdir-y):
+       $(Q)$(MAKE) $(hdrinst)=$(obj)/$@ dst=$(_dst)/$@ rel=../$(rel)
index 2b066d12af2c30fe65c51a0b204cdfb6ac494f2b..18ecd4d5df7fe4ae76352cc926605cc304040958 100644 (file)
@@ -80,8 +80,10 @@ obj-dirs += $(host-objdirs)
 #####
 # Handle options to gcc. Support building with separate output directory
 
-_hostc_flags   = $(HOSTCFLAGS)   $(HOST_EXTRACFLAGS)   $(HOSTCFLAGS_$(*F).o)
-_hostcxx_flags = $(HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) $(HOSTCXXFLAGS_$(*F).o)
+_hostc_flags   = $(HOSTCFLAGS)   $(HOST_EXTRACFLAGS)   \
+                 $(HOSTCFLAGS_$(basetarget).o)
+_hostcxx_flags = $(HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) \
+                 $(HOSTCXXFLAGS_$(basetarget).o)
 
 ifeq ($(KBUILD_SRC),)
 __hostc_flags  = $(_hostc_flags)
index 2cb4935e85d1b0a8d3638783a8bd964489f984c1..fc498fee68edefe6c88afc2d546e0e459b9396d9 100644 (file)
@@ -82,12 +82,12 @@ obj-dirs    := $(addprefix $(obj)/,$(obj-dirs))
 #       than one module. In that case KBUILD_MODNAME will be set to foo_bar,
 #       where foo and bar are the name of the modules.
 name-fix = $(subst $(comma),_,$(subst -,_,$1))
-basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(*F)))"
+basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))"
 modname_flags  = $(if $(filter 1,$(words $(modname))),\
                  -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
 
-_c_flags       = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o)
-_a_flags       = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o)
+_c_flags       = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(basetarget).o)
+_a_flags       = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o)
 _cpp_flags     = $(CPPFLAGS) $(EXTRA_CPPFLAGS) $(CPPFLAGS_$(@F))
 
 # If building the kernel in a separate objtree expand all occurrences
index 576cce5e387f4472bc31a20fcfca2e08fcea6fdd..a49550205dcc5eab6147dab893334a96d34f9123 100644 (file)
@@ -72,7 +72,7 @@ $(modules:.ko=.mod.c): __modpost ;
 # Step 5), compile all *.mod.c files
 
 # modname is set to make c_flags define KBUILD_MODNAME
-modname = $(*F)
+modname = $(notdir $(@:.mod.o=))
 
 quiet_cmd_cc_o_c = CC      $@
       cmd_cc_o_c = $(CC) $(c_flags) $(CFLAGS_MODULE)   \
index 9f84e562318d68983c4cf4f6a9fb69670b7f3b3f..ec7d21161bdcb873ee38926c4097a23b44702880 100755 (executable)
@@ -1,7 +1,7 @@
 #! /usr/bin/perl
 #
-# checkversion find uses of LINUX_VERSION_CODE, KERNEL_VERSION, or
-# UTS_RELEASE without including <linux/version.h>, or cases of
+# checkversion find uses of LINUX_VERSION_CODE or KERNEL_VERSION
+# without including <linux/version.h>, or cases of
 # including <linux/version.h> that don't need it.
 # Copyright (C) 2003, Randy Dunlap <rdunlap@xenotime.net>
 
@@ -41,8 +41,7 @@ foreach $file (@ARGV)
        }
 
        # Look for uses: LINUX_VERSION_CODE, KERNEL_VERSION, UTS_RELEASE
-       if (($_ =~ /LINUX_VERSION_CODE/) || ($_ =~ /\WKERNEL_VERSION/) ||
-               ($_ =~ /UTS_RELEASE/)) {
+       if (($_ =~ /LINUX_VERSION_CODE/) || ($_ =~ /\WKERNEL_VERSION/)) {
            $fUseVersion = 1;
            last LINE if $iLinuxVersion;
        }
diff --git a/scripts/hdrcheck.sh b/scripts/hdrcheck.sh
new file mode 100755 (executable)
index 0000000..b3bb683
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+for FILE in `grep '^#include <' $2 | cut -f2 -d\< | cut -f1 -d\> | egrep ^linux\|^asm` ; do
+    if [ ! -r $1/$FILE ]; then
+       echo $2 requires $FILE, which does not exist
+       exit 1
+    fi
+done
index be0200e9cdaf759ae9de72a1b2e5bec65bbaae9e..79886413b6d52736689e29f8b5a5cd8e4a9c7532 100644 (file)
@@ -187,9 +187,12 @@ int dialog_checklist(const char *title, const char *prompt, int height,
 
        /* Print the list */
        for (i = 0; i < max_choice; i++) {
-               print_item(list, items[(scroll + i) * 3 + 1],
-                          status[i + scroll], i, i == choice);
+               if (i != choice)
+                       print_item(list, items[(scroll + i) * 3 + 1],
+                                  status[i + scroll], i, 0);
        }
+       print_item(list, items[(scroll + choice) * 3 + 1],
+                  status[choice + scroll], choice, 1);
 
        print_arrows(dialog, choice, item_no, scroll,
                     box_y, box_x + check_x + 5, list_height);
index 00e21297aefef05c64c415ce19a1ab3979256992..f9460a6218de414b04d4e3785b28de0b6e9331a2 100755 (executable)
@@ -1056,7 +1056,8 @@ sub output_struct_man(%) {
            # pointer-to-function
            print ".BI \"    ".$1."\" ".$parameter." \") (".$2.")"."\"\n;\n";
        } elsif ($type =~ m/^(.*?)\s*(:.*)/) {
-           print ".BI \"    ".$1."\" ".$parameter.$2." \""."\"\n;\n";
+           # bitfield
+           print ".BI \"    ".$1."\ \" ".$parameter.$2." \""."\"\n;\n";
        } else {
            $type =~ s/([^\*])$/$1 /;
            print ".BI \"    ".$type."\" ".$parameter." \""."\"\n;\n";
@@ -1118,7 +1119,10 @@ sub output_function_text(%) {
     my %args = %{$_[0]};
     my ($parameter, $section);
 
-    print "Function:\n\n";
+    print "Name:\n\n";
+    print $args{'function'}." - ".$args{'purpose'}."\n";
+
+    print "\nSynopsis:\n\n";
     my $start=$args{'functiontype'}." ".$args{'function'}." (";
     print $start;
     my $count = 0;
@@ -1169,6 +1173,7 @@ sub output_enum_text(%) {
     my $count;
     print "Enum:\n\n";
 
+    print "enum ".$args{'enum'}." - ".$args{'purpose'}."\n\n";
     print "enum ".$args{'enum'}." {\n";
     $count = 0;
     foreach $parameter (@{$args{'parameterlist'}}) {
@@ -1197,7 +1202,7 @@ sub output_typedef_text(%) {
     my $count;
     print "Typedef:\n\n";
 
-    print "typedef ".$args{'typedef'}."\n";
+    print "typedef ".$args{'typedef'}." - ".$args{'purpose'}."\n";
     output_section_text(@_);
 }
 
@@ -1206,7 +1211,7 @@ sub output_struct_text(%) {
     my %args = %{$_[0]};
     my ($parameter);
 
-    print $args{'type'}." ".$args{'struct'}.":\n\n";
+    print $args{'type'}." ".$args{'struct'}." - ".$args{'purpose'}."\n\n";
     print $args{'type'}." ".$args{'struct'}." {\n";
     foreach $parameter (@{$args{'parameterlist'}}) {
        if ($parameter =~ /^#/) {
index 0dd16177642de15ba6593c83ed5d12553d425f2e..dfde0e87a765e2e53c55f82fd505f22e76523999 100644 (file)
@@ -24,7 +24,10 @@ static int all_versions = 0;
 /* If we are modposting external module set to 1 */
 static int external_module = 0;
 /* How a symbol is exported */
-enum export {export_plain, export_gpl, export_gpl_future, export_unknown};
+enum export {
+       export_plain,      export_unused,     export_gpl,
+       export_unused_gpl, export_gpl_future, export_unknown
+};
 
 void fatal(const char *fmt, ...)
 {
@@ -191,7 +194,9 @@ static struct {
        enum export export;
 } export_list[] = {
        { .str = "EXPORT_SYMBOL",            .export = export_plain },
+       { .str = "EXPORT_UNUSED_SYMBOL",     .export = export_unused },
        { .str = "EXPORT_SYMBOL_GPL",        .export = export_gpl },
+       { .str = "EXPORT_UNUSED_SYMBOL_GPL", .export = export_unused_gpl },
        { .str = "EXPORT_SYMBOL_GPL_FUTURE", .export = export_gpl_future },
        { .str = "(unknown)",                .export = export_unknown },
 };
@@ -205,6 +210,8 @@ static const char *export_str(enum export ex)
 static enum export export_no(const char * s)
 {
        int i;
+       if (!s)
+               return export_unknown;
        for (i = 0; export_list[i].export != export_unknown; i++) {
                if (strcmp(export_list[i].str, s) == 0)
                        return export_list[i].export;
@@ -216,8 +223,12 @@ static enum export export_from_sec(struct elf_info *elf, Elf_Section sec)
 {
        if (sec == elf->export_sec)
                return export_plain;
+       else if (sec == elf->export_unused_sec)
+               return export_unused;
        else if (sec == elf->export_gpl_sec)
                return export_gpl;
+       else if (sec == elf->export_unused_gpl_sec)
+               return export_unused_gpl;
        else if (sec == elf->export_gpl_future_sec)
                return export_gpl_future;
        else
@@ -366,8 +377,12 @@ static void parse_elf(struct elf_info *info, const char *filename)
                        info->modinfo_len = sechdrs[i].sh_size;
                } else if (strcmp(secname, "__ksymtab") == 0)
                        info->export_sec = i;
+               else if (strcmp(secname, "__ksymtab_unused") == 0)
+                       info->export_unused_sec = i;
                else if (strcmp(secname, "__ksymtab_gpl") == 0)
                        info->export_gpl_sec = i;
+               else if (strcmp(secname, "__ksymtab_unused_gpl") == 0)
+                       info->export_unused_gpl_sec = i;
                else if (strcmp(secname, "__ksymtab_gpl_future") == 0)
                        info->export_gpl_future_sec = i;
 
@@ -1085,38 +1100,64 @@ void buf_write(struct buffer *buf, const char *s, int len)
        buf->pos += len;
 }
 
-void check_license(struct module *mod)
+static void check_for_gpl_usage(enum export exp, const char *m, const char *s)
+{
+       const char *e = is_vmlinux(m) ?"":".ko";
+
+       switch (exp) {
+       case export_gpl:
+               fatal("modpost: GPL-incompatible module %s%s "
+                     "uses GPL-only symbol '%s'\n", m, e, s);
+               break;
+       case export_unused_gpl:
+               fatal("modpost: GPL-incompatible module %s%s "
+                     "uses GPL-only symbol marked UNUSED '%s'\n", m, e, s);
+               break;
+       case export_gpl_future:
+               warn("modpost: GPL-incompatible module %s%s "
+                     "uses future GPL-only symbol '%s'\n", m, e, s);
+               break;
+       case export_plain:
+       case export_unused:
+       case export_unknown:
+               /* ignore */
+               break;
+       }
+}
+
+static void check_for_unused(enum export exp, const char* m, const char* s)
+{
+       const char *e = is_vmlinux(m) ?"":".ko";
+
+       switch (exp) {
+       case export_unused:
+       case export_unused_gpl:
+               warn("modpost: module %s%s "
+                     "uses symbol '%s' marked UNUSED\n", m, e, s);
+               break;
+       default:
+               /* ignore */
+               break;
+       }
+}
+
+static void check_exports(struct module *mod)
 {
        struct symbol *s, *exp;
 
        for (s = mod->unres; s; s = s->next) {
                const char *basename;
-               if (mod->gpl_compatible == 1) {
-                       /* GPL-compatible modules may use all symbols */
-                       continue;
-               }
                exp = find_symbol(s->name);
                if (!exp || exp->module == mod)
                        continue;
                basename = strrchr(mod->name, '/');
                if (basename)
                        basename++;
-               switch (exp->export) {
-                       case export_gpl:
-                               fatal("modpost: GPL-incompatible module %s "
-                                     "uses GPL-only symbol '%s'\n",
-                                basename ? basename : mod->name,
-                               exp->name);
-                               break;
-                       case export_gpl_future:
-                               warn("modpost: GPL-incompatible module %s "
-                                     "uses future GPL-only symbol '%s'\n",
-                                     basename ? basename : mod->name,
-                                     exp->name);
-                               break;
-                       case export_plain: /* ignore */ break;
-                       case export_unknown: /* ignore */ break;
-               }
+               else
+                       basename = mod->name;
+               if (!mod->gpl_compatible)
+                       check_for_gpl_usage(exp->export, basename, exp->name);
+               check_for_unused(exp->export, basename, exp->name);
         }
 }
 
@@ -1271,7 +1312,7 @@ static void write_if_changed(struct buffer *b, const char *fname)
 }
 
 /* parse Module.symvers file. line format:
- * 0x12345678<tab>symbol<tab>module[<tab>export]
+ * 0x12345678<tab>symbol<tab>module[[<tab>export]<tab>something]
  **/
 static void read_dump(const char *fname, unsigned int kernel)
 {
@@ -1284,7 +1325,7 @@ static void read_dump(const char *fname, unsigned int kernel)
                return;
 
        while ((line = get_next_line(&pos, file, size))) {
-               char *symname, *modname, *d, *export;
+               char *symname, *modname, *d, *export, *end;
                unsigned int crc;
                struct module *mod;
                struct symbol *s;
@@ -1297,7 +1338,8 @@ static void read_dump(const char *fname, unsigned int kernel)
                *modname++ = '\0';
                if ((export = strchr(modname, '\t')) != NULL)
                        *export++ = '\0';
-
+               if (export && ((end = strchr(export, '\t')) != NULL))
+                       *end = '\0';
                crc = strtoul(line, &d, 16);
                if (*symname == '\0' || *modname == '\0' || *d != '\0')
                        goto fail;
@@ -1396,7 +1438,7 @@ int main(int argc, char **argv)
        for (mod = modules; mod; mod = mod->next) {
                if (mod->skip)
                        continue;
-               check_license(mod);
+               check_exports(mod);
        }
 
        for (mod = modules; mod; mod = mod->next) {
index 2b00c606284408bb447de187da7911f341d567a7..d398c61e55ef5df49682dcbc81b5703052a6febb 100644 (file)
@@ -117,7 +117,9 @@ struct elf_info {
        Elf_Sym      *symtab_start;
        Elf_Sym      *symtab_stop;
        Elf_Section  export_sec;
+       Elf_Section  export_unused_sec;
        Elf_Section  export_gpl_sec;
+       Elf_Section  export_unused_gpl_sec;
        Elf_Section  export_gpl_future_sec;
        const char   *strtab;
        char         *modinfo;
index f9b35cc0b248f4ed49146651930fc49cad3b65d5..b868e7eda5f06fafa49ed73c21cf1d5332a77e40 100644 (file)
@@ -8,7 +8,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
index 57673ee07ceb59b45a05167ab1766eb551ad4ac8..f50fc298cf801991879bee1de094dd56671562c3 100644 (file)
@@ -8,7 +8,6 @@
  */
 
 #include <linux/capability.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
index 9135408085770e604dde12f53e32afdc898b8b72..bbbfda70e1316effbc0475687cd02fd210813e94 100644 (file)
@@ -15,7 +15,6 @@
 #undef DEBUG
 
 #include <linux/capability.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/mman.h>
@@ -506,6 +505,9 @@ static int dummy_task_getsid (struct task_struct *p)
        return 0;
 }
 
+static void dummy_task_getsecid (struct task_struct *p, u32 *secid)
+{ }
+
 static int dummy_task_setgroups (struct group_info *group_info)
 {
        return 0;
@@ -521,6 +523,11 @@ static int dummy_task_setioprio (struct task_struct *p, int ioprio)
        return 0;
 }
 
+static int dummy_task_getioprio (struct task_struct *p)
+{
+       return 0;
+}
+
 static int dummy_task_setrlimit (unsigned int resource, struct rlimit *new_rlim)
 {
        return 0;
@@ -548,7 +555,7 @@ static int dummy_task_wait (struct task_struct *p)
 }
 
 static int dummy_task_kill (struct task_struct *p, struct siginfo *info,
-                           int sig)
+                           int sig, u32 secid)
 {
        return 0;
 }
@@ -981,9 +988,11 @@ void security_fixup_ops (struct security_operations *ops)
        set_to_dummy_if_null(ops, task_setpgid);
        set_to_dummy_if_null(ops, task_getpgid);
        set_to_dummy_if_null(ops, task_getsid);
+       set_to_dummy_if_null(ops, task_getsecid);
        set_to_dummy_if_null(ops, task_setgroups);
        set_to_dummy_if_null(ops, task_setnice);
        set_to_dummy_if_null(ops, task_setioprio);
+       set_to_dummy_if_null(ops, task_getioprio);
        set_to_dummy_if_null(ops, task_setrlimit);
        set_to_dummy_if_null(ops, task_setscheduler);
        set_to_dummy_if_null(ops, task_getscheduler);
index 98a0df500dc6546e0b7271310a64ccbe3adf5ea8..47eb63480dac94ab2bd90c39a6894e38ebe71d71 100644 (file)
@@ -13,7 +13,6 @@
  */
 
 /* #define DEBUG */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/mount.h>
index 07651def2f782c20450b7d064d96bf4aa9ebe389..38dd4f3e641fc8a1891f145ff0f77f8745a64a33 100644 (file)
@@ -22,7 +22,6 @@
  *     License.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 441beaf1bbc1d104ea7c51706bd2f777feac44e2..c26dd7de04712482ad34144b033a9bce9fed2363 100644 (file)
@@ -16,7 +16,6 @@
  *     (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/kernel.h>
index 51ef509710b9d50bc7aa65d89cbf7bde359a6126..ee4e0701b6e0bbfb431c5d1fa5672ab036492fa0 100644 (file)
@@ -12,7 +12,6 @@
  */
 
 #include <linux/capability.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
index b85afcf3852774166aeb5b9b65200388e8ee4a72..24caaeec88941004c5acc65d63224ab3b207ab9f 100644 (file)
@@ -18,7 +18,6 @@
  *      as published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
@@ -2644,6 +2643,11 @@ static int selinux_task_getsid(struct task_struct *p)
        return task_has_perm(current, p, PROCESS__GETSESSION);
 }
 
+static void selinux_task_getsecid(struct task_struct *p, u32 *secid)
+{
+       selinux_get_task_sid(p, secid);
+}
+
 static int selinux_task_setgroups(struct group_info *group_info)
 {
        /* See the comment for setuid above. */
@@ -2666,6 +2670,11 @@ static int selinux_task_setioprio(struct task_struct *p, int ioprio)
        return task_has_perm(current, p, PROCESS__SETSCHED);
 }
 
+static int selinux_task_getioprio(struct task_struct *p)
+{
+       return task_has_perm(current, p, PROCESS__GETSCHED);
+}
+
 static int selinux_task_setrlimit(unsigned int resource, struct rlimit *new_rlim)
 {
        struct rlimit *old_rlim = current->signal->rlim + resource;
@@ -2700,12 +2709,14 @@ static int selinux_task_movememory(struct task_struct *p)
        return task_has_perm(current, p, PROCESS__SETSCHED);
 }
 
-static int selinux_task_kill(struct task_struct *p, struct siginfo *info, int sig)
+static int selinux_task_kill(struct task_struct *p, struct siginfo *info,
+                               int sig, u32 secid)
 {
        u32 perm;
        int rc;
+       struct task_security_struct *tsec;
 
-       rc = secondary_ops->task_kill(p, info, sig);
+       rc = secondary_ops->task_kill(p, info, sig, secid);
        if (rc)
                return rc;
 
@@ -2716,8 +2727,12 @@ static int selinux_task_kill(struct task_struct *p, struct siginfo *info, int si
                perm = PROCESS__SIGNULL; /* null signal; existence test */
        else
                perm = signal_to_av(sig);
-
-       return task_has_perm(current, p, perm);
+       tsec = p->security;
+       if (secid)
+               rc = avc_has_perm(secid, tsec->sid, SECCLASS_PROCESS, perm, NULL);
+       else
+               rc = task_has_perm(current, p, perm);
+       return rc;
 }
 
 static int selinux_task_prctl(int option,
@@ -4434,9 +4449,11 @@ static struct security_operations selinux_ops = {
        .task_setpgid =                 selinux_task_setpgid,
        .task_getpgid =                 selinux_task_getpgid,
        .task_getsid =                  selinux_task_getsid,
+       .task_getsecid =                selinux_task_getsecid,
        .task_setgroups =               selinux_task_setgroups,
        .task_setnice =                 selinux_task_setnice,
        .task_setioprio =               selinux_task_setioprio,
+       .task_getioprio =               selinux_task_getioprio,
        .task_setrlimit =               selinux_task_setrlimit,
        .task_setscheduler =            selinux_task_setscheduler,
        .task_getscheduler =            selinux_task_getscheduler,
index 7029bbc9bef8c1b897e4883bd8b9d587eb431eeb..00534c302ba2b11939807dd5668f3530cd73fd96 100644 (file)
@@ -9,7 +9,6 @@
  *     the Free Software Foundation, version 2.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/pagemap.h>
 #include <linux/slab.h>
index e9548bc049e1d9020161b92fb362743ee7261957..d2e80e62ff0c9595414f38d00e3d5e49487cb77d 100644 (file)
@@ -1845,15 +1845,20 @@ int selinux_audit_rule_init(u32 field, u32 op, char *rulestr,
                return -ENOTSUPP;
 
        switch (field) {
-       case AUDIT_SE_USER:
-       case AUDIT_SE_ROLE:
-       case AUDIT_SE_TYPE:
+       case AUDIT_SUBJ_USER:
+       case AUDIT_SUBJ_ROLE:
+       case AUDIT_SUBJ_TYPE:
+       case AUDIT_OBJ_USER:
+       case AUDIT_OBJ_ROLE:
+       case AUDIT_OBJ_TYPE:
                /* only 'equals' and 'not equals' fit user, role, and type */
                if (op != AUDIT_EQUAL && op != AUDIT_NOT_EQUAL)
                        return -EINVAL;
                break;
-       case AUDIT_SE_SEN:
-       case AUDIT_SE_CLR:
+       case AUDIT_SUBJ_SEN:
+       case AUDIT_SUBJ_CLR:
+       case AUDIT_OBJ_LEV_LOW:
+       case AUDIT_OBJ_LEV_HIGH:
                /* we do not allow a range, indicated by the presense of '-' */
                if (strchr(rulestr, '-'))
                        return -EINVAL;
@@ -1874,29 +1879,34 @@ int selinux_audit_rule_init(u32 field, u32 op, char *rulestr,
        tmprule->au_seqno = latest_granting;
 
        switch (field) {
-       case AUDIT_SE_USER:
+       case AUDIT_SUBJ_USER:
+       case AUDIT_OBJ_USER:
                userdatum = hashtab_search(policydb.p_users.table, rulestr);
                if (!userdatum)
                        rc = -EINVAL;
                else
                        tmprule->au_ctxt.user = userdatum->value;
                break;
-       case AUDIT_SE_ROLE:
+       case AUDIT_SUBJ_ROLE:
+       case AUDIT_OBJ_ROLE:
                roledatum = hashtab_search(policydb.p_roles.table, rulestr);
                if (!roledatum)
                        rc = -EINVAL;
                else
                        tmprule->au_ctxt.role = roledatum->value;
                break;
-       case AUDIT_SE_TYPE:
+       case AUDIT_SUBJ_TYPE:
+       case AUDIT_OBJ_TYPE:
                typedatum = hashtab_search(policydb.p_types.table, rulestr);
                if (!typedatum)
                        rc = -EINVAL;
                else
                        tmprule->au_ctxt.type = typedatum->value;
                break;
-       case AUDIT_SE_SEN:
-       case AUDIT_SE_CLR:
+       case AUDIT_SUBJ_SEN:
+       case AUDIT_SUBJ_CLR:
+       case AUDIT_OBJ_LEV_LOW:
+       case AUDIT_OBJ_LEV_HIGH:
                rc = mls_from_string(rulestr, &tmprule->au_ctxt, GFP_ATOMIC);
                break;
        }
@@ -1948,7 +1958,8 @@ int selinux_audit_rule_match(u32 ctxid, u32 field, u32 op,
        /* a field/op pair that is not caught here will simply fall through
           without a match */
        switch (field) {
-       case AUDIT_SE_USER:
+       case AUDIT_SUBJ_USER:
+       case AUDIT_OBJ_USER:
                switch (op) {
                case AUDIT_EQUAL:
                        match = (ctxt->user == rule->au_ctxt.user);
@@ -1958,7 +1969,8 @@ int selinux_audit_rule_match(u32 ctxid, u32 field, u32 op,
                        break;
                }
                break;
-       case AUDIT_SE_ROLE:
+       case AUDIT_SUBJ_ROLE:
+       case AUDIT_OBJ_ROLE:
                switch (op) {
                case AUDIT_EQUAL:
                        match = (ctxt->role == rule->au_ctxt.role);
@@ -1968,7 +1980,8 @@ int selinux_audit_rule_match(u32 ctxid, u32 field, u32 op,
                        break;
                }
                break;
-       case AUDIT_SE_TYPE:
+       case AUDIT_SUBJ_TYPE:
+       case AUDIT_OBJ_TYPE:
                switch (op) {
                case AUDIT_EQUAL:
                        match = (ctxt->type == rule->au_ctxt.type);
@@ -1978,9 +1991,12 @@ int selinux_audit_rule_match(u32 ctxid, u32 field, u32 op,
                        break;
                }
                break;
-       case AUDIT_SE_SEN:
-       case AUDIT_SE_CLR:
-               level = (field == AUDIT_SE_SEN ?
+       case AUDIT_SUBJ_SEN:
+       case AUDIT_SUBJ_CLR:
+       case AUDIT_OBJ_LEV_LOW:
+       case AUDIT_OBJ_LEV_HIGH:
+               level = ((field == AUDIT_SUBJ_SEN ||
+                         field == AUDIT_OBJ_LEV_LOW) ?
                         &ctxt->range.level[0] : &ctxt->range.level[1]);
                switch (op) {
                case AUDIT_EQUAL:
index 6633fb05931353502c350974551a1a1a33cd1bc7..6c985ced810279a8325f9aba4d26384c16e0bc4c 100644 (file)
@@ -26,7 +26,6 @@
  *   2. Emulating a reasonable SO_PEERSEC across machines
  *   3. Testing addition of sk_policy's with security context via setsockopt
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index bab97547a052ee66278df503aefbcfb2f109251f..7ae0c0bdfad8fec28e49f4bb3cde0c18e5c3ee9d 100644 (file)
@@ -112,12 +112,7 @@ static struct device_node *get_gpio(char *name,
 
 static void get_irq(struct device_node * np, int *irqptr)
 {
-       *irqptr = -1;
-       if (!np)
-               return;
-       if (np->n_intrs != 1)
-               return;
-       *irqptr = np->intrs[0].line;
+       *irqptr = irq_of_parse_and_map(np, 0);
 }
 
 /* 0x4 is outenable, 0x1 is out, thus 4 or 5 */
index f268dacdaa000b99b31c3b1bfd42275703da6a12..01c0724335a3058652e878de8299726cc65a116b 100644 (file)
@@ -129,7 +129,7 @@ static int i2sbus_add_dev(struct macio_dev *macio,
        if (strncmp(np->name, "i2s-", 4))
                return 0;
 
-       if (np->n_intrs != 3)
+       if (macio_irq_count(macio) != 3)
                return 0;
 
        dev = kzalloc(sizeof(struct i2sbus_dev), GFP_KERNEL);
@@ -183,9 +183,10 @@ static int i2sbus_add_dev(struct macio_dev *macio,
                snprintf(dev->rnames[i], sizeof(dev->rnames[i]), rnames[i], np->name);
        }
        for (i=0;i<3;i++) {
-               if (request_irq(np->intrs[i].line, ints[i], 0, dev->rnames[i], dev))
+               if (request_irq(macio_irq(macio, i), ints[i], 0,
+                               dev->rnames[i], dev))
                        goto err;
-               dev->interrupts[i] = np->intrs[i].line;
+               dev->interrupts[i] = macio_irq(macio, i);
        }
 
        for (i=0;i<3;i++) {
index 6b18225672c7ae6227a8ebb206c9aaf6460cee00..8435fdd1c87c1d13667104641e933dfe8580c5f6 100644 (file)
@@ -360,7 +360,7 @@ static int aaci_pcm_open(struct aaci *aaci, struct snd_pcm_substream *substream,
        if (ret)
                goto out;
 
-       ret = request_irq(aaci->dev->irq[0], aaci_irq, SA_SHIRQ|SA_INTERRUPT,
+       ret = request_irq(aaci->dev->irq[0], aaci_irq, IRQF_SHARED|IRQF_DISABLED,
                          DRIVER_NAME, aaci);
        if (ret)
                goto out;
index b88fb0c5a68a4869b3212f4815b7ff9ed1c048cd..c79a9afd0955e2b9a2fa98fb5872616cef819ac4 100644 (file)
@@ -59,7 +59,6 @@
 * 
 ***************************************************************************************************/
 
-#include <linux/config.h>
 #include <sound/driver.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
index 3fc6f97075ed87ae962562bfae0cf3ad14a8e9b6..bc0bd0910a6264a2fae71b74f50f672d98b7b9c7 100644 (file)
@@ -21,7 +21,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/proc_fs.h>
 #include <linux/init.h>
index d812dc886360286ff2e609efe7e1850145bd646e..4260de90f36fb39468d7a623649f7f7486a4ab9c 100644 (file)
@@ -380,6 +380,12 @@ static struct ops_list * create_driver(char *id)
        /* set up driver entry */
        strlcpy(ops->id, id, sizeof(ops->id));
        mutex_init(&ops->reg_mutex);
+       /*
+        * The ->reg_mutex locking rules are per-driver, so we create
+        * separate per-driver lock classes:
+        */
+       lockdep_set_class(&ops->reg_mutex, (struct lock_class_key *)id);
+
        ops->driver = DRIVER_EMPTY;
        INIT_LIST_HEAD(&ops->dev_list);
        /* lock this instance */
index d467b4f0ff2b18d50dae96e813a686f7a28821e6..8c64b58ff77bf3afb9e7f82e30209a15c68f0dc9 100644 (file)
@@ -514,7 +514,7 @@ int snd_seq_port_connect(struct snd_seq_client *connector,
        atomic_set(&subs->ref_count, 2);
 
        down_write(&src->list_mutex);
-       down_write(&dest->list_mutex);
+       down_write_nested(&dest->list_mutex, SINGLE_DEPTH_NESTING);
 
        exclusive = info->flags & SNDRV_SEQ_PORT_SUBS_EXCLUSIVE ? 1 : 0;
        err = -EBUSY;
@@ -587,7 +587,7 @@ int snd_seq_port_disconnect(struct snd_seq_client *connector,
        unsigned long flags;
 
        down_write(&src->list_mutex);
-       down_write(&dest->list_mutex);
+       down_write_nested(&dest->list_mutex, SINGLE_DEPTH_NESTING);
 
        /* look for the connection */
        list_for_each(p, &src->list_head) {
index 74745da9deb69f4cf171500dc6523435c1839752..6e4d4ab34632f009e3507e3ffc932066a2d3f567 100644 (file)
@@ -19,7 +19,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/vmalloc.h>
index 8b80024968be7d32f32e0b15fdfe5c1e6352425e..17cc105b26fcf68b43999d85379f043f2a990ec6 100644 (file)
@@ -83,7 +83,7 @@ static int snd_mpu401_create(int dev, struct snd_card **rcard)
        if ((err = snd_mpu401_uart_new(card, 0,
                                       MPU401_HW_MPU401,
                                       port[dev], 0,
-                                      irq[dev], irq[dev] >= 0 ? SA_INTERRUPT : 0, NULL)) < 0) {
+                                      irq[dev], irq[dev] >= 0 ? IRQF_DISABLED : 0, NULL)) < 0) {
                printk(KERN_ERR "MPU401 not detected at 0x%lx\n", port[dev]);
                goto _err;
        }
index 474eed06e70f731768432b9959082eb1f213f9b2..e064d6c5685bcf4939422798989caf7b0e00a94d 100644 (file)
@@ -590,7 +590,7 @@ static int __init snd_mtpav_get_ISA(struct mtpav * mcard)
                return -EBUSY;
        }
        mcard->port = port;
-       if (request_irq(irq, snd_mtpav_irqh, SA_INTERRUPT, "MOTU MTPAV", mcard)) {
+       if (request_irq(irq, snd_mtpav_irqh, IRQF_DISABLED, "MOTU MTPAV", mcard)) {
                snd_printk("MTVAP IRQ %d busy\n", irq);
                return -EBUSY;
        }
index 2330fec505daf952deb09041eae0a8f3c305f85e..52afb4bd2079acd0cc47bd3d8b0e7bbc462da9a2 100644 (file)
@@ -795,7 +795,7 @@ static int __init snd_uart16550_create(struct snd_card *card,
 
        if (irq >= 0 && irq != SNDRV_AUTO_IRQ) {
                if (request_irq(irq, snd_uart16550_interrupt,
-                               SA_INTERRUPT, "Serial MIDI", (void *) uart)) {
+                               IRQF_DISABLED, "Serial MIDI", (void *) uart)) {
                        snd_printk("irq %d busy. Using Polling.\n", irq);
                } else {
                        uart->irq = irq;
index 31f299aed2817e914cd5d29d740db4ebcf188205..b33a5fb59ec2144cf35d53acc9eafe74daca4f3e 100644 (file)
@@ -232,7 +232,7 @@ static int __devinit snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard
 
        if (mpu_port[dev] > 0) {
                if (snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401,
-                                       mpu_port[dev], 0, mpu_irq[dev], SA_INTERRUPT,
+                                       mpu_port[dev], 0, mpu_irq[dev], IRQF_DISABLED,
                                        NULL) < 0)
                        printk(KERN_ERR PFX "no MPU-401 device at 0x%lx.\n", mpu_port[dev]);
        }
index fd8fe16c09ee02a6409375c92d132dc9cd9daaaa..8fcf2c151823c8a3de0f429b1b83bfe539a5e7a6 100644 (file)
@@ -599,7 +599,7 @@ int __devinit snd_ad1816a_create(struct snd_card *card,
                snd_ad1816a_free(chip);
                return -EBUSY;
        }
-       if (request_irq(irq, snd_ad1816a_interrupt, SA_INTERRUPT, "AD1816A", (void *) chip)) {
+       if (request_irq(irq, snd_ad1816a_interrupt, IRQF_DISABLED, "AD1816A", (void *) chip)) {
                snd_printk(KERN_ERR "ad1816a: can't grab IRQ %d\n", irq);
                snd_ad1816a_free(chip);
                return -EBUSY;
index e0f8baa843b9c02cc31314f2cb149d98e41d8043..e711f87d5fd1a3f20854da2d510d56ffd2b5bbb7 100644 (file)
@@ -902,7 +902,7 @@ int snd_ad1848_create(struct snd_card *card,
                snd_ad1848_free(chip);
                return -EBUSY;
        }
-       if (request_irq(irq, snd_ad1848_interrupt, SA_INTERRUPT, "AD1848", (void *) chip)) {
+       if (request_irq(irq, snd_ad1848_interrupt, IRQF_DISABLED, "AD1848", (void *) chip)) {
                snd_printk(KERN_ERR "ad1848: can't grab IRQ %d\n", irq);
                snd_ad1848_free(chip);
                return -EBUSY;
index a52bd8a14c9ba64a6a27b640eab1366da2e89807..f2bcfb2cf5f576bae36135c33524ba2d1d3fd40e 100644 (file)
@@ -250,7 +250,7 @@ static int __devinit snd_card_als100_probe(int dev,
        if (mpu_port[dev] > 0 && mpu_port[dev] != SNDRV_AUTO_PORT) {
                if (snd_mpu401_uart_new(card, 0, MPU401_HW_ALS100,
                                        mpu_port[dev], 0, 
-                                       mpu_irq[dev], SA_INTERRUPT,
+                                       mpu_irq[dev], IRQF_DISABLED,
                                        NULL) < 0)
                        snd_printk(KERN_ERR PFX "no MPU-401 device at 0x%lx\n", mpu_port[dev]);
        }
index 15e59283aac6784771490d5fd53d212485124e4d..b615538a928d6e5570a480fd628e210c244bf044 100644 (file)
@@ -279,7 +279,7 @@ static int __devinit snd_card_azt2320_probe(int dev,
        if (mpu_port[dev] > 0 && mpu_port[dev] != SNDRV_AUTO_PORT) {
                if (snd_mpu401_uart_new(card, 0, MPU401_HW_AZT2320,
                                mpu_port[dev], 0,
-                               mpu_irq[dev], SA_INTERRUPT,
+                               mpu_irq[dev], IRQF_DISABLED,
                                NULL) < 0)
                        snd_printk(KERN_ERR PFX "no MPU-401 device at 0x%lx\n", mpu_port[dev]);
        }
index 397310f358b7c4ed1f0bfdefaebcb01bfc432442..696a5c86bcfae7c60f51e1e4dfd01355f7ff9283 100644 (file)
@@ -122,7 +122,7 @@ static int __init snd_cs4231_probe(struct platform_device *pdev)
                if (snd_mpu401_uart_new(card, 0, MPU401_HW_CS4232,
                                        mpu_port[dev], 0,
                                        mpu_irq[dev],
-                                       mpu_irq[dev] >= 0 ? SA_INTERRUPT : 0,
+                                       mpu_irq[dev] >= 0 ? IRQF_DISABLED : 0,
                                        NULL) < 0)
                        printk(KERN_WARNING "cs4231: MPU401 not detected\n");
        }
index 823db8246701933d8837f4ddbcff3e505052f52e..fbb20176cca4e6b8ac6a63ff5e4bcb37d5b1f186 100644 (file)
@@ -1454,7 +1454,7 @@ int snd_cs4231_create(struct snd_card *card,
                return -ENODEV;
        }
        chip->cport = cport;
-       if (!(hwshare & CS4231_HWSHARE_IRQ) && request_irq(irq, snd_cs4231_interrupt, SA_INTERRUPT, "CS4231", (void *) chip)) {
+       if (!(hwshare & CS4231_HWSHARE_IRQ) && request_irq(irq, snd_cs4231_interrupt, IRQF_DISABLED, "CS4231", (void *) chip)) {
                snd_printk(KERN_ERR "cs4231: can't grab IRQ %d\n", irq);
                snd_cs4231_free(chip);
                return -EBUSY;
index f7fa779347ffea800b407a5a555b1cf37855137e..07ffd5c22e81918eeb0c7647f3e19428f7832c99 100644 (file)
@@ -535,7 +535,7 @@ static int __devinit snd_cs423x_probe(struct snd_card *card, int dev)
                if (snd_mpu401_uart_new(card, 0, MPU401_HW_CS4232,
                                        mpu_port[dev], 0,
                                        mpu_irq[dev],
-                                       mpu_irq[dev] >= 0 ? SA_INTERRUPT : 0, NULL) < 0)
+                                       mpu_irq[dev] >= 0 ? IRQF_DISABLED : 0, NULL) < 0)
                        printk(KERN_WARNING IDENT ": MPU401 not detected\n");
        }
 
index 0acb4e5da47f46752586712e62833d37b41910ed..c20a4b1b1536532f93d8a0274b0d24d28cc81751 100644 (file)
@@ -240,7 +240,7 @@ static int __devinit snd_card_dt019x_probe(int dev, struct pnp_card_link *pcard,
                                        MPU401_HW_MPU401,
                                        mpu_port[dev], 0,
                                        mpu_irq[dev],
-                                       mpu_irq[dev] >= 0 ? SA_INTERRUPT : 0,
+                                       mpu_irq[dev] >= 0 ? IRQF_DISABLED : 0,
                                        NULL) < 0)
                        snd_printk(KERN_ERR PFX "no MPU-401 device at 0x%lx ?\n", mpu_port[dev]);
        }
index e90689ee162fac5174a3d4413cec954d6675fa40..7f29f56e405b29a26e0c62d43182e804f0555451 100644 (file)
@@ -153,7 +153,7 @@ static int __init snd_es1688_probe(struct platform_device *pdev)
                if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_ES1688,
                                               chip->mpu_port, 0,
                                               xmpu_irq,
-                                              SA_INTERRUPT,
+                                              IRQF_DISABLED,
                                               NULL)) < 0)
                        goto _err;
        }
index 702ad51ee9d5a6bc7c7200e16f50f42c82410992..7e985d3bc5105206877951ecfbce6d20389b15a2 100644 (file)
@@ -659,7 +659,7 @@ int snd_es1688_create(struct snd_card *card,
                snd_es1688_free(chip);
                return -EBUSY;
        }
-       if (request_irq(irq, snd_es1688_interrupt, SA_INTERRUPT, "ES1688", (void *) chip)) {
+       if (request_irq(irq, snd_es1688_interrupt, IRQF_DISABLED, "ES1688", (void *) chip)) {
                snd_printk(KERN_ERR "es1688: can't grab IRQ %d\n", irq);
                snd_es1688_free(chip);
                return -EBUSY;
index af60b0bc8115f59986b0be019adc050f8695f0cc..34998de9968c0ed071f79998785f00c801f43929 100644 (file)
@@ -1837,7 +1837,7 @@ static int __devinit snd_es18xx_new_device(struct snd_card *card,
                return -EBUSY;
        }
 
-       if (request_irq(irq, snd_es18xx_interrupt, SA_INTERRUPT, "ES18xx", (void *) chip)) {
+       if (request_irq(irq, snd_es18xx_interrupt, IRQF_DISABLED, "ES18xx", (void *) chip)) {
                snd_es18xx_free(chip);
                snd_printk(KERN_ERR PFX "unable to grap IRQ %d\n", irq);
                return -EBUSY;
index 53eeaf37007d15a79ce443d17dc2fc11af6bfeb6..b680fddf0d740f86aebd7998c10ad632055b22fa 100644 (file)
@@ -179,7 +179,7 @@ int snd_gus_create(struct snd_card *card,
                snd_gus_free(gus);
                return -EBUSY;
        }
-       if (irq >= 0 && request_irq(irq, snd_gus_interrupt, SA_INTERRUPT, "GUS GF1", (void *) gus)) {
+       if (irq >= 0 && request_irq(irq, snd_gus_interrupt, IRQF_DISABLED, "GUS GF1", (void *) gus)) {
                snd_printk(KERN_ERR "gus: can't grab irq %d\n", irq);
                snd_gus_free(gus);
                return -EBUSY;
index 05852fcc613bd32b54217af97f4ab850b8828916..22cdddbfd8247088ad8d63b4bcb5f52cb29c3404 100644 (file)
@@ -301,7 +301,7 @@ static int __init snd_gusextreme_probe(struct platform_device *pdev)
            (err = snd_mpu401_uart_new(card, 0, MPU401_HW_ES1688,
                                               es1688->mpu_port, 0,
                                               xmpu_irq,
-                                              SA_INTERRUPT,
+                                              IRQF_DISABLED,
                                               NULL)) < 0)
                goto out;
 
index fcf2c8fe6f94ba2b56dead0238e7b2816667a94f..ac11cae8589a1fd379042bad77d6e47c8432eda1 100644 (file)
@@ -292,7 +292,7 @@ static int __init snd_gusmax_probe(struct platform_device *pdev)
                goto _err;
        }
 
-       if (request_irq(xirq, snd_gusmax_interrupt, SA_INTERRUPT, "GUS MAX", (void *)maxcard)) {
+       if (request_irq(xirq, snd_gusmax_interrupt, IRQF_DISABLED, "GUS MAX", (void *)maxcard)) {
                snd_printk(KERN_ERR PFX "unable to grab IRQ %d\n", xirq);
                err = -EBUSY;
                goto _err;
index c1c86e0fa56df0056b7a18cb2586fc5a7dd13242..ea69f25506fb1a3b388413cdb2605ee6b293ba63 100644 (file)
@@ -706,7 +706,7 @@ static int __devinit snd_interwave_probe(struct snd_card *card, int dev)
        if ((err = snd_gus_initialize(gus)) < 0)
                return err;
 
-       if (request_irq(xirq, snd_interwave_interrupt, SA_INTERRUPT,
+       if (request_irq(xirq, snd_interwave_interrupt, IRQF_DISABLED,
                        "InterWave", iwcard)) {
                snd_printk(KERN_ERR PFX "unable to grab IRQ %d\n", xirq);
                return -EBUSY;
index 647a996791e9c0ce297c3fe46bbe89859db92495..4031b61b797fe895310c88bc3525f11825495cca 100644 (file)
@@ -683,7 +683,7 @@ static int __devinit snd_opl3sa2_probe(struct snd_card *card, int dev)
                chip->single_dma = 1;
        if ((err = snd_opl3sa2_detect(chip)) < 0)
                return err;
-       if (request_irq(xirq, snd_opl3sa2_interrupt, SA_INTERRUPT, "OPL3-SA2", chip)) {
+       if (request_irq(xirq, snd_opl3sa2_interrupt, IRQF_DISABLED, "OPL3-SA2", chip)) {
                snd_printk(KERN_ERR PFX "can't grab IRQ %d\n", xirq);
                return -ENODEV;
        }
index 283817f2de75945ea9402a02b37afa4c2314fe90..1dd98375ac85788f294ec5a7327fcd74ba2720c6 100644 (file)
@@ -1382,7 +1382,7 @@ static int __init snd_miro_probe(struct platform_device *devptr)
                rmidi = NULL;
        else
                if ((error = snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401,
-                               miro->mpu_port, 0, miro->mpu_irq, SA_INTERRUPT,
+                               miro->mpu_port, 0, miro->mpu_irq, IRQF_DISABLED,
                                &rmidi)))
                        snd_printk(KERN_WARNING "no MPU-401 device at 0x%lx?\n", miro->mpu_port);
 
index 8ee0d70536f9cc93998e37a26178004ed8768a89..9d528ae00bff1c7bcd63c4da1d512f2e761bac8d 100644 (file)
@@ -1291,7 +1291,7 @@ static int snd_opti93x_create(struct snd_card *card, struct snd_opti9xx *chip,
        }
        codec->dma2 = chip->dma2;
 
-       if (request_irq(chip->irq, snd_opti93x_interrupt, SA_INTERRUPT, DRIVER_NAME" - WSS", codec)) {
+       if (request_irq(chip->irq, snd_opti93x_interrupt, IRQF_DISABLED, DRIVER_NAME" - WSS", codec)) {
                snd_printk(KERN_ERR "opti9xx: can't grab IRQ %d\n", chip->irq);
                snd_opti93x_free(codec);
                return -EBUSY;
@@ -1863,7 +1863,7 @@ static int __init snd_opti9xx_probe(struct snd_card *card)
                rmidi = NULL;
        else
                if ((error = snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401,
-                               chip->mpu_port, 0, chip->mpu_irq, SA_INTERRUPT,
+                               chip->mpu_port, 0, chip->mpu_irq, IRQF_DISABLED,
                                &rmidi)))
                        snd_printk(KERN_WARNING "no MPU-401 device at 0x%lx?\n",
                                   chip->mpu_port);
index f343a8211d2dc810996b5978f2ca86f8d798ba1f..f17de2bdd9e08a80f93286fdc16a167e83881f46 100644 (file)
@@ -232,7 +232,7 @@ int snd_sbdsp_create(struct snd_card *card,
        chip->port = port;
        
        if (request_irq(irq, irq_handler, hardware == SB_HW_ALS4000 ?
-                       SA_INTERRUPT | SA_SHIRQ : SA_INTERRUPT,
+                       IRQF_DISABLED | IRQF_SHARED : IRQF_DISABLED,
                        "SoundBlaster", (void *) chip)) {
                snd_printk(KERN_ERR "sb: can't grab irq %d\n", irq);
                snd_sbdsp_free(chip);
index 09c8e8c6b5e3cf8a548fdbec09660ca88eb70dfb..8742fa5174910791ff6680ff962846a85e291e6a 100644 (file)
@@ -147,7 +147,7 @@ static int __init snd_sgalaxy_setup_wss(unsigned long port, int irq, int dma)
         if (tmp < 0)
                 return -EINVAL;
 
-       if (request_irq(irq, snd_sgalaxy_dummy_interrupt, SA_INTERRUPT, "sgalaxy", NULL)) {
+       if (request_irq(irq, snd_sgalaxy_dummy_interrupt, IRQF_DISABLED, "sgalaxy", NULL)) {
                snd_printk(KERN_ERR "sgalaxy: can't grab irq %d\n", irq);
                return -EIO;
        }
index 27271c9446dc669e978ae806ca2fda5d44a8415f..b1f25823c652cb8708226d1e38cac5eae86cdd61 100644 (file)
@@ -900,7 +900,7 @@ static int __devinit create_mpu401(struct snd_card *card, int devnum, unsigned l
        if ((err = snd_mpu401_uart_new(card, devnum,
                                       MPU401_HW_MPU401,
                                       port, MPU401_INFO_INTEGRATED,
-                                      irq, SA_INTERRUPT,
+                                      irq, IRQF_DISABLED,
                                       &rawmidi)) == 0) {
                struct snd_mpu401 *mpu = (struct snd_mpu401 *) rawmidi->private_data;
                mpu->open_input = mpu401_open;
index 9eb27082c659f16ca4f80c0ae4329426709285a3..a8f8d2fa9d7649dcdd8afb47dfa6b34e513dad45 100644 (file)
@@ -467,7 +467,7 @@ snd_wavefront_probe (struct snd_card *card, int dev)
                return -EBUSY;
        }
        if (request_irq(ics2115_irq[dev], snd_wavefront_ics2115_interrupt,
-                       SA_INTERRUPT, "ICS2115", acard)) {
+                       IRQF_DISABLED, "ICS2115", acard)) {
                snd_printk(KERN_ERR "unable to use ICS2115 IRQ %d\n", ics2115_irq[dev]);
                return -EBUSY;
        }
@@ -497,7 +497,7 @@ snd_wavefront_probe (struct snd_card *card, int dev)
                if ((err = snd_mpu401_uart_new(card, midi_dev, MPU401_HW_CS4232,
                                               cs4232_mpu_port[dev], 0,
                                               cs4232_mpu_irq[dev],
-                                              SA_INTERRUPT,
+                                              IRQF_DISABLED,
                                               NULL)) < 0) {
                        snd_printk (KERN_ERR "can't allocate CS4232 MPU-401 device\n");
                        return err;
index cf476fe1ac5616e604afdb24ccbd7e06dce67058..c31b38659221c4bfd4e141f60a6b85f5b89f1b8a 100644 (file)
@@ -465,13 +465,13 @@ snd_au1000_pcm_new(struct snd_au1000 *au1000)
 
        flags = claim_dma_lock();
        if ((au1000->stream[PLAYBACK]->dma = request_au1000_dma(DMA_ID_AC97C_TX,
-                       "AC97 TX", au1000_dma_interrupt, SA_INTERRUPT,
+                       "AC97 TX", au1000_dma_interrupt, IRQF_DISABLED,
                        au1000->stream[PLAYBACK])) < 0) {
                release_dma_lock(flags);
                return -EBUSY;
        }
        if ((au1000->stream[CAPTURE]->dma = request_au1000_dma(DMA_ID_AC97C_RX,
-                       "AC97 RX", au1000_dma_interrupt, SA_INTERRUPT,
+                       "AC97 RX", au1000_dma_interrupt, IRQF_DISABLED,
                        au1000->stream[CAPTURE])) < 0){
                release_dma_lock(flags);
                return -EBUSY;
index 95586de02028cf57d4a628044885953b92ba57f0..29057836c64425c2ddceab96d397d74fe0c10608 100644 (file)
@@ -41,7 +41,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
index e04fa49b0dc8e5509963e82ef6d4bc34692324d4..3b45e11e5303ca7cccdc37f4ddf32f4eec1d72f3 100644 (file)
@@ -41,7 +41,6 @@
  *             Tested. Believed fully functional.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/module.h>
index a4ca7569e700d81fa654e380bea7c3e24eab81c7..f56f870b48400e844a52d3547566fbefbb59ccf9 100644 (file)
@@ -26,7 +26,6 @@
  *
  * $Id: ad1889.c,v 1.3 2002/10/19 21:31:44 grundler Exp $
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/ioport.h>
@@ -1011,7 +1010,7 @@ static int __devinit ad1889_probe(struct pci_dev *pcidev, const struct pci_devic
                goto out2;
        }
 
-       if (request_irq(pcidev->irq, ad1889_interrupt, SA_SHIRQ, DEVNAME, dev) != 0) {
+       if (request_irq(pcidev->irq, ad1889_interrupt, IRQF_SHARED, DEVNAME, dev) != 0) {
                printk(KERN_ERR DEVNAME ": unable to request interrupt\n");
                goto out3;
        }
index b556263a57f5513fa44bb87dbdbfbad37a04d80e..51e1fde62e8d5685bed6fc44ef0fdd9bd0dc896a 100644 (file)
@@ -23,7 +23,6 @@
  * Include the main OSS Lite header file. It include all the os, OSS Lite, etc
  * headers needed by this source.
  */
-#include <linux/config.h>
 #include <linux/delay.h>
 #include <linux/module.h>
 #include <linux/init.h>
index 62bb936b1f3d49fca893b9d0b6c3a4d460642c35..70dcd703a66fc18436af8fd03af52854e29e0b9f 100644 (file)
@@ -3460,7 +3460,7 @@ static int __devinit ali_probe(struct pci_dev *pci_dev,
        card->channel[4].num = 4;
        /* claim our iospace and irq */
        request_region(card->iobase, 256, card_names[pci_id->driver_data]);
-       if (request_irq(card->irq, &ali_interrupt, SA_SHIRQ,
+       if (request_irq(card->irq, &ali_interrupt, IRQF_SHARED,
                        card_names[pci_id->driver_data], card)) {
                printk(KERN_ERR "ali_audio: unable to allocate irq %d\n",
                       card->irq);
index eacb0aef21e1831d6795225aba3b6d6cc00c46e4..e3796231452afcd34eac9a93dd87682e91845eb4 100644 (file)
@@ -2015,14 +2015,14 @@ static int __devinit au1000_probe(void)
        if ((s->dma_dac.dmanr = request_au1000_dma(DMA_ID_AC97C_TX,
                                                   "audio DAC",
                                                   dac_dma_interrupt,
-                                                  SA_INTERRUPT, s)) < 0) {
+                                                  IRQF_DISABLED, s)) < 0) {
                err("Can't get DAC DMA");
                goto err_dma1;
        }
        if ((s->dma_adc.dmanr = request_au1000_dma(DMA_ID_AC97C_RX,
                                                   "audio ADC",
                                                   adc_dma_interrupt,
-                                                  SA_INTERRUPT, s)) < 0) {
+                                                  IRQF_DISABLED, s)) < 0) {
                err("Can't get ADC DMA");
                goto err_dma2;
        }
index bfe3b534ef30277a1bd9faed9dbf691c11e7fc7a..324a81fd3a3b0e305adbd90859a361b45659e780 100644 (file)
@@ -966,7 +966,7 @@ static int __devinit btaudio_probe(struct pci_dev *pci_dev,
         btwrite(~0U, REG_INT_STAT);
        pci_set_master(pci_dev);
 
-       if ((rc = request_irq(bta->irq, btaudio_irq, SA_SHIRQ|SA_INTERRUPT,
+       if ((rc = request_irq(bta->irq, btaudio_irq, IRQF_SHARED|IRQF_DISABLED,
                              "btaudio",(void *)bta)) < 0) {
                printk(KERN_WARNING
                       "btaudio: can't request irq (rc=%d)\n",rc);
index de60a059ff5f783c60d10127c701335d363637dc..ea51aafaf40144895eed79a6db303d57605a5c5d 100644 (file)
@@ -3122,7 +3122,7 @@ static int __devinit cm_probe(struct pci_dev *pcidev, const struct pci_device_id
        wrmixer(s, DSP_MIX_DATARESETIDX, 0);
 
        /* request irq */
-       if ((ret = request_irq(s->irq, cm_interrupt, SA_SHIRQ, "cmpci", s))) {
+       if ((ret = request_irq(s->irq, cm_interrupt, IRQF_SHARED, "cmpci", s))) {
                printk(KERN_ERR "cmpci: irq %u in use\n", s->irq);
                goto err_irq;
        }
index 80f6c08e26e7fa73d40a9a8ee24e818d98e08355..b6924c7f1484f5c6c01f1684d3654dec21f7f0fe 100644 (file)
@@ -47,7 +47,6 @@
  *     Marcus Meissner         Added ISA PnP support.
  */
 
-#include <linux/config.h>
 #include <linux/pnp.h>
 #include <linux/module.h>
 #include <linux/init.h>
index 0004442f9b7e87cdbd3607fee20d8c0342702e67..0400a416dc9304eba92c2bd25b9193a6677f61f4 100644 (file)
@@ -4346,7 +4346,7 @@ static int __devinit cs4281_probe(struct pci_dev *pcidev,
        s->pcidev = pcidev;
        s->irq = pcidev->irq;
        if (request_irq
-           (s->irq, cs4281_interrupt, SA_SHIRQ, "Crystal CS4281", s)) {
+           (s->irq, cs4281_interrupt, IRQF_SHARED, "Crystal CS4281", s)) {
                CS_DBGOUT(CS_INIT | CS_ERROR, 1,
                          printk(KERN_ERR "cs4281: irq %u in use\n", s->irq));
                goto err_irq;
index 994c71e986e4f18bcfc3b16d14c8c7d5672ef8be..5195bf933cb893dffb481ae646329cc11ce9a46c 100644 (file)
@@ -5177,7 +5177,7 @@ static int __devinit cs46xx_probe(struct pci_dev *pci_dev,
                card->ba1.name.reg == 0)
                goto fail2;
                
-       if (request_irq(card->irq, &cs_interrupt, SA_SHIRQ, "cs46xx", card)) {
+       if (request_irq(card->irq, &cs_interrupt, IRQF_SHARED, "cs46xx", card)) {
                printk(KERN_ERR "cs46xx: unable to allocate irq %d\n", card->irq);
                goto fail2;
        }
index baf4244a54f2f9b6d81661c983eb117ae189fb3e..15ce7119c5f45ac605181566b2359712ae4f84f5 100644 (file)
@@ -547,7 +547,7 @@ int DMAbuf_activate_recording(int dev, struct dma_buffparms *dmap)
        }
        return 0;
 }
-/* aquires lock */
+/* acquires lock */
 int DMAbuf_getrdbuffer(int dev, char **buf, int *len, int dontblock)
 {
        struct audio_operations *adev = audio_devs[dev];
@@ -821,7 +821,7 @@ static int find_output_space(int dev, char **buf, int *size)
        *size = len & ~SAMPLE_ROUNDUP;
        return (*size > 0);
 }
-/* aquires lock  */
+/* acquires lock  */
 int DMAbuf_getwrbuffer(int dev, char **buf, int *size, int dontblock)
 {
        struct audio_operations *adev = audio_devs[dev];
@@ -855,7 +855,7 @@ int DMAbuf_getwrbuffer(int dev, char **buf, int *size, int dontblock)
        spin_unlock_irqrestore(&dmap->lock,flags);
        return 0;
 }
-/* has to aquire dmap->lock */
+/* has to acquire dmap->lock */
 int DMAbuf_move_wrpointer(int dev, int l)
 {
        struct audio_operations *adev = audio_devs[dev];
index a1b0b92af4b5acfdcf5c7e60aa75008604cf9db7..25dd5a318eb452d53ac68d3d4a0ecf82aeadaf1a 100644 (file)
@@ -13,7 +13,6 @@
 #define _dmasound_h_
 
 #include <linux/types.h>
-#include <linux/config.h>
 
 #define SND_NDEVS      256     /* Number of supported devices */
 #define SND_DEV_CTL    0       /* Control port /dev/mixer */
index c8e210326893b3f64940c570f95fb21bc8790cbb..4359903f43762291509212ed097c3b6d7661dc17 100644 (file)
@@ -67,7 +67,6 @@
 
 #include <linux/types.h>
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/delay.h>
@@ -375,10 +374,7 @@ setup_audio_gpio(const char *name, const char* compatible, int *gpio_addr, int*
                *gpio_pol = *pp;
        else
                *gpio_pol = 1;
-       if (np->n_intrs > 0)
-               return np->intrs[0].line;
-       
-       return 0;
+       return irq_of_parse_and_map(np, 0);
 }
 
 static inline void
@@ -2865,14 +2861,13 @@ printk("dmasound_pmac: couldn't find a Codec we can handle\n");
         * other info if necessary (early AWACS we want to read chip ids)
         */
 
-       if (of_get_address(io, 2, NULL, NULL) == NULL || io->n_intrs < 3) {
+       if (of_get_address(io, 2, NULL, NULL) == NULL) {
                /* OK - maybe we need to use the 'awacs' node (on earlier
                 * machines).
                 */
                if (awacs_node) {
                        io = awacs_node ;
-                       if (of_get_address(io, 2, NULL, NULL) == NULL ||
-                           io->n_intrs < 3) {
+                       if (of_get_address(io, 2, NULL, NULL) == NULL) {
                                printk("dmasound_pmac: can't use %s\n",
                                       io->full_name);
                                return -ENODEV;
@@ -2941,9 +2936,9 @@ printk("dmasound_pmac: couldn't find a Codec we can handle\n");
        if (awacs_revision == AWACS_SCREAMER && awacs)
                awacs_recalibrate();
 
-       awacs_irq = io->intrs[0].line;
-       awacs_tx_irq = io->intrs[1].line;
-       awacs_rx_irq = io->intrs[2].line;
+       awacs_irq = irq_of_parse_and_map(io, 0);
+       awacs_tx_irq = irq_of_parse_and_map(io, 1);
+       awacs_rx_irq = irq_of_parse_and_map(io, 2);
 
        /* Hack for legacy crap that will be killed someday */
        awacs_node = io;
index 494070a3f8702e27d95673f4b0253ca24eb29d13..68e1d8f6c359aa1b6b8be19a5b29c63e337afda3 100644 (file)
@@ -16,7 +16,6 @@
 
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/init.h>
 #include <linux/ioport.h>
index 3721c5857b9048eb76f655e01360e76d08580179..c4ce94d6e10cb6415e3aa29457842da519ab5998 100644 (file)
@@ -1301,7 +1301,7 @@ static int __devinit emu10k1_probe(struct pci_dev *pci_dev, const struct pci_dev
        card->pci_dev = pci_dev;
 
        /* Reserve IRQ Line */
-       if (request_irq(card->irq, emu10k1_interrupt, SA_SHIRQ, card_names[pci_id->driver_data], card)) {
+       if (request_irq(card->irq, emu10k1_interrupt, IRQF_SHARED, card_names[pci_id->driver_data], card)) {
                printk(KERN_ERR "emu10k1: IRQ in use\n");
                ret = -EBUSY;
                goto err_irq;
index 094f569cc6e07cb545b68e29bc2f4bfa37a06af5..13f4831497374535f7afe6acbf1155d69da8f4cb 100644 (file)
@@ -2650,7 +2650,7 @@ static int __devinit es1370_probe(struct pci_dev *pcidev, const struct pci_devic
                ret = -EBUSY;
                goto err_region;
        }
-       if ((ret=request_irq(s->irq, es1370_interrupt, SA_SHIRQ, "es1370",s))) {
+       if ((ret=request_irq(s->irq, es1370_interrupt, IRQF_SHARED, "es1370",s))) {
                printk(KERN_ERR "es1370: irq %u in use\n", s->irq);
                goto err_irq;
        }
index 4400c85386862a8f101f9c0742d89a5d0e99fe91..a2ffe723dad54c6e976d66cf4e43efbce0ec922b 100644 (file)
@@ -2905,7 +2905,7 @@ static int __devinit es1371_probe(struct pci_dev *pcidev, const struct pci_devic
                res = -EBUSY;
                goto err_region;
        }
-       if ((res=request_irq(s->irq, es1371_interrupt, SA_SHIRQ, "es1371",s))) {
+       if ((res=request_irq(s->irq, es1371_interrupt, IRQF_SHARED, "es1371",s))) {
                printk(KERN_ERR PFX "irq %u in use\n", s->irq);
                goto err_irq;
        }
index 6861563d7525edbc85e5b4e83f112ef62312553a..82f40a0a5c9c06b9cc11387f59efd36508cc742d 100644 (file)
@@ -2392,7 +2392,7 @@ static int __devinit solo1_probe(struct pci_dev *pcidev, const struct pci_device
                printk(KERN_ERR "solo1: io ports in use\n");
                goto err_region4;
        }
-       if ((ret=request_irq(s->irq,solo1_interrupt,SA_SHIRQ,"ESS Solo1",s))) {
+       if ((ret=request_irq(s->irq,solo1_interrupt,IRQF_SHARED,"ESS Solo1",s))) {
                printk(KERN_ERR "solo1: irq %u in use\n", s->irq);
                goto err_irq;
        }
index 44e578098d76e77768ea6a872ff077eb5e89be85..ea1c0207aef2f45bc466a504c898a1eda1cd4362 100644 (file)
@@ -2026,7 +2026,7 @@ forte_probe (struct pci_dev *pci_dev, const struct pci_device_id *pci_id)
        chip->iobase = pci_resource_start (pci_dev, 0);
        chip->irq = pci_dev->irq;
 
-       if (request_irq (chip->irq, forte_interrupt, SA_SHIRQ, DRIVER_NAME,
+       if (request_irq (chip->irq, forte_interrupt, IRQF_SHARED, DRIVER_NAME,
                         chip)) {
                printk (KERN_WARNING PFX "Unable to reserve IRQ");
                ret = -EIO;
index dd4f59d30a3ab7031b0b775da7ffbe3a41973134..80ab402dae9a5123760dcd9acfa019467656a2ff 100644 (file)
@@ -1479,7 +1479,7 @@ static int hal2_init_card(struct hal2_card **phal2, struct hpc3_regs *hpc3)
        hpc3->pbus_dmacfg[hal2->dac.pbus.pbusnr][0] = 0x8208844;
        hpc3->pbus_dmacfg[hal2->adc.pbus.pbusnr][0] = 0x8208844;
 
-       if (request_irq(SGI_HPCDMA_IRQ, hal2_interrupt, SA_SHIRQ,
+       if (request_irq(SGI_HPCDMA_IRQ, hal2_interrupt, IRQF_SHARED,
                        hal2str, hal2)) {
                printk(KERN_ERR "HAL2: Can't get irq %d\n", SGI_HPCDMA_IRQ);
                ret = -EAGAIN;
index dd2b871cdac56a2e8527f57f90c9b16a999a22be..ddcddc2347f7ec3450624b296f6e385b0013575a 100644 (file)
@@ -3413,7 +3413,7 @@ static int __devinit i810_probe(struct pci_dev *pci_dev, const struct pci_device
                goto out_iospace;
        }
 
-       if (request_irq(card->irq, &i810_interrupt, SA_SHIRQ,
+       if (request_irq(card->irq, &i810_interrupt, IRQF_SHARED,
                        card_names[pci_id->driver_data], card)) {
                printk(KERN_ERR "i810_audio: unable to allocate irq %d\n", card->irq);
                goto out_iospace;
index 00ac1c95a4290b0e20ac19cb779f4166ce0930b9..68aab3605d74572cf27f59c66b37a28c9acdb5a7 100644 (file)
@@ -2019,7 +2019,7 @@ static int __devinit it8172_probe(struct pci_dev *pcidev,
                    s->io, s->io + pci_resource_len(pcidev,0)-1);
                goto err_region;
        }
-       if (request_irq(s->irq, it8172_interrupt, SA_INTERRUPT,
+       if (request_irq(s->irq, it8172_interrupt, IRQF_DISABLED,
                        IT8172_MODULE_NAME, s)) {
                err("irq %u in use", s->irq);
                goto err_irq;
index 2835a7c038efadfa5163e07748a914d95f0428ee..12e7b3038be2bb8a05dcb2c27045d4023c340464 100644 (file)
@@ -27,7 +27,6 @@
  *     same manner.
  */
 
-#include <linux/config.h>
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/module.h>
index e647f2f862799445b49c3c52bf9a27300b0a6782..1d98d100d739f484fbe1a48730e535e70fd81444 100644 (file)
@@ -3545,7 +3545,7 @@ maestro_probe(struct pci_dev *pcidev,const struct pci_device_id *pdid)
                mixer_push_state(card);
        }
        
-       if((ret=request_irq(card->irq, ess_interrupt, SA_SHIRQ, card_names[card_type], card)))
+       if((ret=request_irq(card->irq, ess_interrupt, IRQF_SHARED, card_names[card_type], card)))
        {
                printk(KERN_ERR "maestro: unable to allocate irq %d,\n", card->irq);
                unregister_sound_mixer(card->dev_mixer);
index 4a5e4237a1106af30e0c7e08a93002bf6981e848..5548e3cff7ceb4476cd75263ab54cccc01f637f9 100644 (file)
@@ -2694,7 +2694,7 @@ static int __devinit m3_probe(struct pci_dev *pci_dev, const struct pci_device_i
         }
     }
     
-    if(request_irq(card->irq, m3_interrupt, SA_SHIRQ, card_names[card->card_type], card)) {
+    if(request_irq(card->irq, m3_interrupt, IRQF_SHARED, card_names[card->card_type], card)) {
 
         printk(KERN_ERR PFX "unable to allocate irq %d,\n", card->irq);
 
index 83c3c46ffffed1847134005271d2604e6f450618..7ffea5267f9699dd4ca22aa2557f1ca777505c91 100644 (file)
@@ -30,7 +30,6 @@
 #ifndef __MSND_CLASSIC_H
 #define __MSND_CLASSIC_H
 
-#include <linux/config.h>
 
 #define DSP_NUMIO                              0x10
 
index 0c2db657badd135a66a83b3b5ce142ac84d01435..6d7763dae8952f7913058e21d00f72cb9b474789 100644 (file)
@@ -39,7 +39,6 @@
  ********************************************************************/
 
 #include <linux/kernel.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/types.h>
index e85aef4a55e0915cab2c4e31dc78174f0e8b2773..cce91148700481b1ac28aa67729311d0ebcbf2e5 100644 (file)
@@ -30,7 +30,6 @@
 #ifndef __MSND_PINNACLE_H
 #define __MSND_PINNACLE_H
 
-#include <linux/config.h>
 
 #define DSP_NUMIO                              0x08
 
index 21c1954d91080a086fb961d946d3d97b29577738..6f7f2f0423e41b211d80c050edf22c730a00f4dc 100644 (file)
@@ -1909,7 +1909,7 @@ static int __devinit vrc5477_ac97_probe(struct pci_dev *pcidev,
                       s->io, s->io + pci_resource_len(pcidev,0)-1);
                goto err_region;
        }
-       if (request_irq(s->irq, vrc5477_ac97_interrupt, SA_INTERRUPT,
+       if (request_irq(s->irq, vrc5477_ac97_interrupt, IRQF_DISABLED,
                        VRC5477_AC97_MODULE_NAME, s)) {
                printk(KERN_ERR PFX "irq %u in use\n", s->irq);
                goto err_irq;
index 6e662ac009ae5f2ff04a08c8b86235be17da12ff..7760dddf2b32e4ddf1f44ef845c346e18e3f80a4 100644 (file)
@@ -733,7 +733,7 @@ static int
 nm256_grabInterrupt (struct nm256_info *card)
 {
     if (card->has_irq++ == 0) {
-       if (request_irq (card->irq, card->introutine, SA_SHIRQ,
+       if (request_irq (card->irq, card->introutine, IRQF_SHARED,
                         "NM256_audio", card) < 0) {
            printk (KERN_ERR "NM256: can't obtain IRQ %d\n", card->irq);
            return -1;
index 0e161c6a04770c313ed157a1d99acc8b2b349fc9..aec05a2bfc8717ddb2f4999e1dd638a509fd4471 100644 (file)
@@ -64,7 +64,6 @@
  *   
  */
 
-#include <linux/config.h>
 #include <linux/pnp.h>
 #include <linux/init.h>
 #include <linux/module.h>
index c9696dc9fdf956ebddf76c47bf7eb1297bfe56f3..97666007b274f4961625dcd836413609b52f8824 100644 (file)
@@ -4,7 +4,6 @@
  * Detection routine for the Pro Audio Spectrum cards.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/module.h>
index a617ccb40e006223e7ca88e9948e436980a69cf6..37ee234b587c86744918e49d49bc8fd34e1f6eb2 100644 (file)
@@ -57,7 +57,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
index a1ec9d131ab38f1ad8f356f096b24204fb3dbbca..f17d25b6f8369b62ba256cdd63a9ade83b55b4b2 100644 (file)
@@ -994,7 +994,7 @@ static int __devinit rme96xx_probe(struct pci_dev *pcidev, const struct pci_devi
 
        if (pci_enable_device(pcidev))
                goto err_irq;
-       if (request_irq(s->irq, rme96xx_interrupt, SA_SHIRQ, "rme96xx", s)) {
+       if (request_irq(s->irq, rme96xx_interrupt, IRQF_SHARED, "rme96xx", s)) {
                printk(KERN_ERR RME_MESS" irq %u in use\n", s->irq);
                goto err_irq;
        }
index 4708cbdc31497edded137e77ed4fc1b181856861..8666291c00523fccca590df1d6a5fbedbf6c28c7 100644 (file)
@@ -22,7 +22,6 @@
  * 02-07-2003 Bug made it into first release. Take two.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/init.h>
index 5f955e3d2e26926e6e59612416466d78bced3db3..35bab6e2f998a7f87442c99168715630750681ed 100644 (file)
@@ -26,7 +26,6 @@
  * Chris Rankin <rankinc@zipworld.com.au>
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/module.h>
@@ -678,7 +677,7 @@ int sb_dsp_init(struct address_info *hw_config, struct module *owner)
                 *      will get shared PCI irq lines we must cope.
                 */
                 
-               int i=(devc->caps&SB_PCI_IRQ)?SA_SHIRQ:0;
+               int i=(devc->caps&SB_PCI_IRQ)?IRQF_SHARED:0;
                
                if (request_irq(hw_config->irq, sbintr, i, "soundblaster", devc) < 0)
                {
index 3f7427cd195a03358ca5fc136d24690177c38ae1..7b168d85f4ab83ea42e682fc6ff84afb48a97832 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/sched.h>
@@ -298,7 +297,7 @@ static int __init dac_audio_init(void)
        dac_audio_set_rate();
 
        retval =
-           request_irq(TIMER1_IRQ, timer1_interrupt, SA_INTERRUPT, MODNAME, 0);
+           request_irq(TIMER1_IRQ, timer1_interrupt, IRQF_DISABLED, MODNAME, 0);
        if (retval < 0) {
                printk(KERN_ERR "sh_dac_audio: IRQ %d request failed\n",
                       TIMER1_IRQ);
index 42bd276cfc39081482eeeb6468d5052e9e5f8adb..8ea532d401983c58b096926eb11cad00ceb4db29 100644 (file)
@@ -2632,7 +2632,7 @@ static int __devinit sv_probe(struct pci_dev *pcidev, const struct pci_device_id
        wrindir(s, SV_CIPCMSR1, ((8000 * 65536 / FULLRATE) >> 8) & 0xff);
        wrindir(s, SV_CIADCOUTPUT, 0);
        /* request irq */
-       if ((ret=request_irq(s->irq,sv_interrupt,SA_SHIRQ,"S3 SonicVibes",s))) {
+       if ((ret=request_irq(s->irq,sv_interrupt,IRQF_SHARED,"S3 SonicVibes",s))) {
                printk(KERN_ERR "sv: irq %u in use\n", s->irq);
                goto err_irq;
        }
index 9f912b8a29698aad52a5f63292afb4c393ef5142..1a00a3210616231f7c271fe2f621d8a29c21b27c 100644 (file)
@@ -14,7 +14,6 @@
 #ifndef  _SOUND_CONFIG_H_
 #define  _SOUND_CONFIG_H_
 
-#include <linux/config.h>
 #include <linux/fs.h>
 #include <linux/sound.h>
 
index a332899489021a870ad67face6268f6f690197ff..0860d678971567e52b3766752e6ab65cd73ed1c0 100644 (file)
@@ -22,7 +22,6 @@
  * Christoph Hellwig : Some cleanup work (2000/03/01)
  */
 
-#include <linux/config.h>
 
 #include "sound_config.h"
 #include <linux/init.h>
index e61a454a815026252d4bf465ea476d493f3ac270..2813e4c8e365aafb6bc6b364b671c8d2e4720b10 100644 (file)
  *             sem     -       guard dmabuf, write re-entry etc
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/ctype.h>
@@ -4473,7 +4472,7 @@ trident_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id)
 
        /* claim our irq */
        rc = -ENODEV;
-       if (request_irq(card->irq, &trident_interrupt, SA_SHIRQ, 
+       if (request_irq(card->irq, &trident_interrupt, IRQF_SHARED,
                        card_names[pci_id->driver_data], card)) {
                printk(KERN_ERR "trident: unable to allocate irq %d\n", 
                       card->irq);
index 29a6e0cff79f793557f9ee49d7dae200efbf2018..08d8c94d01b21d42073bb84728bd46866f395115 100644 (file)
@@ -18,7 +18,6 @@
 #define VIA_VERSION    "1.9.1-ac4-2.5"
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/fs.h>
@@ -2014,7 +2013,7 @@ static int via_interrupt_init (struct via_info *card)
                        tmp8 |= VIA_CR48_FM_TRAP_TO_NMI;
                        pci_write_config_byte (card->pdev, VIA_FM_NMI_CTRL, tmp8);
                }
-               if (request_irq (card->pdev->irq, via_interrupt, SA_SHIRQ, VIA_MODULE_NAME, card)) {
+               if (request_irq (card->pdev->irq, via_interrupt, IRQF_SHARED, VIA_MODULE_NAME, card)) {
                        printk (KERN_ERR PFX "unable to obtain IRQ %d, aborting\n",
                                card->pdev->irq);
                        DPRINTK ("EXIT, returning -EBUSY\n");
@@ -2023,7 +2022,7 @@ static int via_interrupt_init (struct via_info *card)
        }
        else 
        {
-               if (request_irq (card->pdev->irq, via_new_interrupt, SA_SHIRQ, VIA_MODULE_NAME, card)) {
+               if (request_irq (card->pdev->irq, via_new_interrupt, IRQF_SHARED, VIA_MODULE_NAME, card)) {
                        printk (KERN_ERR PFX "unable to obtain IRQ %d, aborting\n",
                                card->pdev->irq);
                        DPRINTK ("EXIT, returning -EBUSY\n");
index 00fe5cec9dc124b9ae425d1009ef854390440da8..8932d89408efb294d2673d7da8f25625cd154046 100644 (file)
@@ -17,7 +17,6 @@
  * We currently support a mixer device, but it is currently non-functional.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
index afcb524a40eb52ce4fbd83080a3f25330d3b32f9..22d26624b34a040687a27a6591da33fe69caee7b 100644 (file)
@@ -35,7 +35,6 @@
 
 #include <linux/module.h>
 #include <linux/init.h>
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
index b1a4eeb9dc083fb3dff34e48be328e64a48b1d50..1dec3958cc7b0494aea66ded7f34b635a6625fb6 100644 (file)
@@ -2268,7 +2268,7 @@ static int __init wavefront_hw_reset (void)
        }
 
        if (request_irq (dev.irq, wavefrontintr,
-                        SA_INTERRUPT|SA_SHIRQ,
+                        IRQF_DISABLED|IRQF_SHARED,
                         "wavefront synth", &dev) < 0) {
                printk (KERN_WARNING LOGNAME "IRQ %d not available!\n",
                        dev.irq);
index 7b167b74375b5b5d3540d7dd58417ae989a57b6e..3f3a390014caf29165fa0d45b06b7739fe5bd1e5 100644 (file)
@@ -820,7 +820,7 @@ int __init install_wf_mpu (void)
 
        /* OK, now we're configured to handle an interrupt ... */
 
-       if (request_irq (phys_dev->irq, wf_mpuintr, SA_INTERRUPT|SA_SHIRQ,
+       if (request_irq (phys_dev->irq, wf_mpuintr, IRQF_DISABLED|IRQF_SHARED,
                         "wavefront midi", phys_dev) < 0) {
 
                printk (KERN_ERR "WF-MPU: Failed to allocate IRQ%d\n",
index bf90c124a7e61315a4eddd9bceb850918aa6e6ff..6e22472df952bdc19c08fc83ef7b227c5a4b793c 100644 (file)
@@ -2573,7 +2573,7 @@ static int __devinit ymf_probe_one(struct pci_dev *pcidev, const struct pci_devi
                goto out_disable_dsp;
        ymf_memload(codec);
 
-       if (request_irq(pcidev->irq, ymf_interrupt, SA_SHIRQ, "ymfpci", codec) != 0) {
+       if (request_irq(pcidev->irq, ymf_interrupt, IRQF_SHARED, "ymfpci", codec) != 0) {
                printk(KERN_ERR "ymfpci: unable to request IRQ %d\n",
                    pcidev->irq);
                goto out_memfree;
index d42bf4570367cc671c20cee60b6a66bcee779a93..f7aef8c9cf439d1c6678461132476b1330eff782 100644 (file)
@@ -947,7 +947,7 @@ snd_ad1889_create(struct snd_card *card,
        spin_lock_init(&chip->lock);    /* only now can we call ad1889_free */
 
        if (request_irq(pci->irq, snd_ad1889_interrupt,
-                       SA_INTERRUPT|SA_SHIRQ, card->driver, (void*)chip)) {
+                       IRQF_DISABLED|IRQF_SHARED, card->driver, (void*)chip)) {
                printk(KERN_ERR PFX "cannot obtain IRQ %d\n", pci->irq);
                snd_ad1889_free(chip);
                return -EBUSY;
index 5dfdbf6657f2a9f7b53d1ce3ae7b48f6d6e0c291..e0a815e53d1ce940eb3c5c989c93e86a433ea62d 100644 (file)
@@ -2185,7 +2185,7 @@ static int __devinit snd_ali_resources(struct snd_ali *codec)
                return err;
        codec->port = pci_resource_start(codec->pci, 0);
 
-       if (request_irq(codec->pci->irq, snd_ali_card_interrupt, SA_INTERRUPT|SA_SHIRQ, "ALI 5451", (void *)codec)) {
+       if (request_irq(codec->pci->irq, snd_ali_card_interrupt, IRQF_DISABLED|IRQF_SHARED, "ALI 5451", (void *)codec)) {
                snd_printk(KERN_ERR "Unable to request irq.\n");
                return -EBUSY;
        }
index 901b08ae91745f6f820f9b7cde3a4adc29e2a8ba..a9c38963188a2551f5bdd596e4c093469537de47 100644 (file)
@@ -724,7 +724,7 @@ static int __devinit snd_als300_create(snd_card_t *card,
        else
                irq_handler = snd_als300_interrupt;
 
-       if (request_irq(pci->irq, irq_handler, SA_INTERRUPT|SA_SHIRQ,
+       if (request_irq(pci->irq, irq_handler, IRQF_DISABLED|IRQF_SHARED,
                                        card->shortname, (void *)chip)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                snd_als300_free(chip);
index f18a8c0e4688301105a5553671314d9d6f025c35..9fbb065a810b2c8cea503c68d9122f358f9eb719 100644 (file)
@@ -1578,7 +1578,7 @@ static int __devinit snd_atiixp_create(struct snd_card *card,
                return -EIO;
        }
 
-       if (request_irq(pci->irq, snd_atiixp_interrupt, SA_INTERRUPT|SA_SHIRQ,
+       if (request_irq(pci->irq, snd_atiixp_interrupt, IRQF_DISABLED|IRQF_SHARED,
                        card->shortname, chip)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                snd_atiixp_free(chip);
index 40739057076b8af1bd8e872202148eece679431a..7dcf4941dce24fcc0669dee7982b763c344a791e 100644 (file)
@@ -1251,7 +1251,7 @@ static int __devinit snd_atiixp_create(struct snd_card *card,
                return -EIO;
        }
 
-       if (request_irq(pci->irq, snd_atiixp_interrupt, SA_INTERRUPT|SA_SHIRQ,
+       if (request_irq(pci->irq, snd_atiixp_interrupt, IRQF_DISABLED|IRQF_SHARED,
                        card->shortname, chip)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                snd_atiixp_free(chip);
index 8a3b118989bfcba6703dc969bd167634d6366624..ef189d7f09d387bad1ce3f85e70bc15284565d88 100644 (file)
@@ -197,7 +197,7 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)
        }
 
        if ((err = request_irq(pci->irq, vortex_interrupt,
-                              SA_INTERRUPT | SA_SHIRQ, CARD_NAME_SHORT,
+                              IRQF_DISABLED | IRQF_SHARED, CARD_NAME_SHORT,
                               chip)) != 0) {
                printk(KERN_ERR "cannot grab irq\n");
                goto irq_out;
index 6e62dafb66cd5f2725831ead36d3930caf1b8261..15447a3216dd70bea11ed95b3e92e3d168e59337 100644 (file)
@@ -1724,7 +1724,7 @@ snd_azf3328_create(struct snd_card *card,
        chip->synth_port = pci_resource_start(pci, 3);
        chip->mixer_port = pci_resource_start(pci, 4);
 
-       if (request_irq(pci->irq, snd_azf3328_interrupt, SA_INTERRUPT|SA_SHIRQ, card->shortname, (void *)chip)) {
+       if (request_irq(pci->irq, snd_azf3328_interrupt, IRQF_DISABLED|IRQF_SHARED, card->shortname, (void *)chip)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                err = -EBUSY;
                goto out_err;
index 497ed6b200608e8331fb3dd42656ebe05dca6c1d..4d4277d045aac5e5d5a646a94d386dd2a6530c79 100644 (file)
@@ -747,7 +747,7 @@ static int __devinit snd_bt87x_create(struct snd_card *card,
        snd_bt87x_writel(chip, REG_INT_MASK, 0);
        snd_bt87x_writel(chip, REG_INT_STAT, MY_INTERRUPTS);
 
-       if (request_irq(pci->irq, snd_bt87x_interrupt, SA_INTERRUPT | SA_SHIRQ,
+       if (request_irq(pci->irq, snd_bt87x_interrupt, IRQF_DISABLED | IRQF_SHARED,
                        "Bt87x audio", chip)) {
                snd_bt87x_free(chip);
                snd_printk(KERN_ERR "cannot grab irq\n");
index 59bf9bd02534a2a78f08651ef3afb2291a39e87c..a30c019bab64d353c86a1595611e3b2f618c3bb4 100644 (file)
@@ -1268,7 +1268,7 @@ static int __devinit snd_ca0106_create(struct snd_card *card,
        }
 
        if (request_irq(pci->irq, snd_ca0106_interrupt,
-                       SA_INTERRUPT|SA_SHIRQ, "snd_ca0106",
+                       IRQF_DISABLED|IRQF_SHARED, "snd_ca0106",
                        (void *)chip)) {
                snd_ca0106_free(chip);
                printk(KERN_ERR "cannot grab irq\n");
index 0938c158b5c9f78c270e47117c0ea1cb23136153..03766ad74998e1e731ce6fd922f2ba4dc18ab3e0 100644 (file)
@@ -2862,7 +2862,7 @@ static int __devinit snd_cmipci_create(struct snd_card *card, struct pci_dev *pc
        cm->iobase = pci_resource_start(pci, 0);
 
        if (request_irq(pci->irq, snd_cmipci_interrupt,
-                       SA_INTERRUPT|SA_SHIRQ, card->driver, cm)) {
+                       IRQF_DISABLED|IRQF_SHARED, card->driver, cm)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                snd_cmipci_free(cm);
                return -EBUSY;
index e77a4ce314b7a5f34ffab7d2828c82ee47a80ff4..d1802487f5beecea8a53655e3f2d3c9002f6d447 100644 (file)
@@ -1386,7 +1386,7 @@ static int __devinit snd_cs4281_create(struct snd_card *card,
                return -ENOMEM;
        }
        
-       if (request_irq(pci->irq, snd_cs4281_interrupt, SA_INTERRUPT|SA_SHIRQ,
+       if (request_irq(pci->irq, snd_cs4281_interrupt, IRQF_DISABLED|IRQF_SHARED,
                        "CS4281", chip)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                snd_cs4281_free(chip);
index 5c2114439204154178adce8c5058e4c2f1deebb9..894545ea41fd2b6f534a833a313302e348d4f5aa 100644 (file)
@@ -3853,7 +3853,7 @@ int __devinit snd_cs46xx_create(struct snd_card *card,
                }
        }
 
-       if (request_irq(pci->irq, snd_cs46xx_interrupt, SA_INTERRUPT|SA_SHIRQ,
+       if (request_irq(pci->irq, snd_cs46xx_interrupt, IRQF_DISABLED|IRQF_SHARED,
                        "CS46XX", chip)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                snd_cs46xx_free(chip);
index 3844d18af19ca00eae8aedf9314b6054f7c8b909..232b337852fff33f6cacba606a2a5b05136d7fe9 100644 (file)
@@ -180,6 +180,7 @@ static void _dsp_clear_sample_buffer (struct snd_cs46xx *chip, u32 sample_buffer
 void cs46xx_dsp_remove_scb (struct snd_cs46xx *chip, struct dsp_scb_descriptor * scb)
 {
        struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+       unsigned long flags;
 
        /* check integrety */
        snd_assert ( (scb->index >= 0 && 
@@ -194,9 +195,9 @@ void cs46xx_dsp_remove_scb (struct snd_cs46xx *chip, struct dsp_scb_descriptor *
                     goto _end);
 #endif
 
-       spin_lock(&scb->lock);
+       spin_lock_irqsave(&scb->lock, flags);
        _dsp_unlink_scb (chip,scb);
-       spin_unlock(&scb->lock);
+       spin_unlock_irqrestore(&scb->lock, flags);
 
        cs46xx_dsp_proc_free_scb_desc(scb);
        snd_assert (scb->scb_symbol != NULL, return );
index 91c18a11fe87d24eae508ffc0d583512d7228aa5..c12b24c679f2e1402150449d597c75c47a30b6de 100644 (file)
@@ -321,7 +321,7 @@ static int __devinit snd_cs5535audio_create(struct snd_card *card,
        cs5535au->port = pci_resource_start(pci, 0);
 
        if (request_irq(pci->irq, snd_cs5535audio_interrupt,
-                       SA_INTERRUPT|SA_SHIRQ, "CS5535 Audio", cs5535au)) {
+                       IRQF_DISABLED|IRQF_SHARED, "CS5535 Audio", cs5535au)) {
                snd_printk("unable to grab IRQ %d\n", pci->irq);
                err = -EBUSY;
                goto sndfail;
index 43b408ada1da5db8f9ff5f1a357006f3da8f2d0b..27a8dbe6f6a8ad9aadf564b40a2b6c368c7f5bc4 100644 (file)
@@ -1951,7 +1951,7 @@ static __devinit int snd_echo_create(struct snd_card *card,
        chip->dsp_registers = (volatile u32 __iomem *)
                ioremap_nocache(chip->dsp_registers_phys, sz);
 
-       if (request_irq(pci->irq, snd_echo_interrupt, SA_INTERRUPT | SA_SHIRQ,
+       if (request_irq(pci->irq, snd_echo_interrupt, IRQF_DISABLED | IRQF_SHARED,
                                                ECHOCARD_NAME, (void *)chip)) {
                snd_echo_free(chip);
                snd_printk(KERN_ERR "cannot grab irq\n");
index 42a358f989c323481fee4f01ea0ac2a1160c0c4e..d6f135fe29584b099bb172e69ca3a3807d402735 100644 (file)
@@ -1233,7 +1233,7 @@ int __devinit snd_emu10k1_create(struct snd_card *card,
        }
        emu->port = pci_resource_start(pci, 0);
 
-       if (request_irq(pci->irq, snd_emu10k1_interrupt, SA_INTERRUPT|SA_SHIRQ, "EMU10K1", (void *)emu)) {
+       if (request_irq(pci->irq, snd_emu10k1_interrupt, IRQF_DISABLED|IRQF_SHARED, "EMU10K1", (void *)emu)) {
                err = -EBUSY;
                goto error;
        }
index 0fb27e4be07b058ae5125474b545d0d9f65b87ef..2167279429b8382da8e8373573283787ff6553f4 100644 (file)
@@ -928,7 +928,7 @@ static int __devinit snd_emu10k1x_create(struct snd_card *card,
        }
 
        if (request_irq(pci->irq, snd_emu10k1x_interrupt,
-                       SA_INTERRUPT|SA_SHIRQ, "EMU10K1X",
+                       IRQF_DISABLED|IRQF_SHARED, "EMU10K1X",
                        (void *)chip)) {
                snd_printk(KERN_ERR "emu10k1x: cannot grab irq %d\n", pci->irq);
                snd_emu10k1x_free(chip);
index 9d46bbee2a406ac14b6eeb4fe52697465888431f..7a985c868007ade18693cfaee3a8eaaae266b752 100644 (file)
@@ -2135,7 +2135,7 @@ static int __devinit snd_ensoniq_create(struct snd_card *card,
                return err;
        }
        ensoniq->port = pci_resource_start(pci, 0);
-       if (request_irq(pci->irq, snd_audiopci_interrupt, SA_INTERRUPT|SA_SHIRQ,
+       if (request_irq(pci->irq, snd_audiopci_interrupt, IRQF_DISABLED|IRQF_SHARED,
                        "Ensoniq AudioPCI", ensoniq)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                snd_ensoniq_free(ensoniq);
index ca6603fe0b112fd72495754510daaf3a0180bbf0..1113b10259cf196e7a8341b3f14dec0fc1b9a714 100644 (file)
@@ -1429,7 +1429,7 @@ static int es1938_resume(struct pci_dev *pci)
        pci_restore_state(pci);
        pci_enable_device(pci);
        request_irq(pci->irq, snd_es1938_interrupt,
-                   SA_INTERRUPT|SA_SHIRQ, "ES1938", chip);
+                   IRQF_DISABLED|IRQF_SHARED, "ES1938", chip);
        chip->irq = pci->irq;
        snd_es1938_chip_init(chip);
 
@@ -1544,7 +1544,7 @@ static int __devinit snd_es1938_create(struct snd_card *card,
        chip->vc_port = pci_resource_start(pci, 2);
        chip->mpu_port = pci_resource_start(pci, 3);
        chip->game_port = pci_resource_start(pci, 4);
-       if (request_irq(pci->irq, snd_es1938_interrupt, SA_INTERRUPT|SA_SHIRQ,
+       if (request_irq(pci->irq, snd_es1938_interrupt, IRQF_DISABLED|IRQF_SHARED,
                        "ES1938", chip)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                snd_es1938_free(chip);
index bfa0876e715e87922995fc3e425e6bb08e6b1c67..a491c8f8a6a880346fd0bf1011a54b2ba64bb249 100644 (file)
@@ -2597,7 +2597,7 @@ static int __devinit snd_es1968_create(struct snd_card *card,
                return err;
        }
        chip->io_port = pci_resource_start(pci, 0);
-       if (request_irq(pci->irq, snd_es1968_interrupt, SA_INTERRUPT|SA_SHIRQ,
+       if (request_irq(pci->irq, snd_es1968_interrupt, IRQF_DISABLED|IRQF_SHARED,
                        "ESS Maestro", (void*)chip)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                snd_es1968_free(chip);
index 0afa573dd2441556e8499e7baaeff29b64b868ad..3aed27eace2c74e2e90fd1edeb4ec30327bacce2 100644 (file)
@@ -1371,7 +1371,7 @@ static int __devinit snd_fm801_create(struct snd_card *card,
                return err;
        }
        chip->port = pci_resource_start(pci, 0);
-       if (request_irq(pci->irq, snd_fm801_interrupt, SA_INTERRUPT|SA_SHIRQ,
+       if (request_irq(pci->irq, snd_fm801_interrupt, IRQF_DISABLED|IRQF_SHARED,
                        "FM801", chip)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", chip->irq);
                snd_fm801_free(chip);
index 4070b5cd9b6bac4e000899a88ff54765a2870e18..025af7c0c6e1439e9fa9125e92e316bd6caa5cf5 100644 (file)
@@ -1486,7 +1486,7 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
                goto errout;
        }
 
-       if (request_irq(pci->irq, azx_interrupt, SA_INTERRUPT|SA_SHIRQ,
+       if (request_irq(pci->irq, azx_interrupt, IRQF_DISABLED|IRQF_SHARED,
                        "HDA Intel", (void*)chip)) {
                snd_printk(KERN_ERR SFX "unable to grab IRQ %d\n", pci->irq);
                err = -EBUSY;
index 845907159b74cc8cbb230dd4f2f2eb736ed2f297..89a06dec436529cb2a6bfd7ab25aa2aa8050bcf1 100644 (file)
@@ -2606,7 +2606,7 @@ static int __devinit snd_ice1712_create(struct snd_card *card,
        ice->dmapath_port = pci_resource_start(pci, 2);
        ice->profi_port = pci_resource_start(pci, 3);
 
-       if (request_irq(pci->irq, snd_ice1712_interrupt, SA_INTERRUPT|SA_SHIRQ,
+       if (request_irq(pci->irq, snd_ice1712_interrupt, IRQF_DISABLED|IRQF_SHARED,
                        "ICE1712", ice)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                snd_ice1712_free(ice);
index 34a58c629f47ebf715dcaddd3db5ce927dcfb94b..ad69ed7c1b814230c6e019368b657a537c173763 100644 (file)
@@ -2253,7 +2253,7 @@ static int __devinit snd_vt1724_create(struct snd_card *card,
        ice->profi_port = pci_resource_start(pci, 1);
 
        if (request_irq(pci->irq, snd_vt1724_interrupt,
-                       SA_INTERRUPT|SA_SHIRQ, "ICE1724", ice)) {
+                       IRQF_DISABLED|IRQF_SHARED, "ICE1724", ice)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                snd_vt1724_free(ice);
                return -EIO;
index edc14475ef827f32332e2ebe7fc89d3a7acbe0ff..5634bc349257021d83cc2aefed9ccb740256e55a 100644 (file)
@@ -2475,7 +2475,7 @@ static int intel8x0_resume(struct pci_dev *pci)
        pci_restore_state(pci);
        pci_enable_device(pci);
        pci_set_master(pci);
-       request_irq(pci->irq, snd_intel8x0_interrupt, SA_INTERRUPT|SA_SHIRQ,
+       request_irq(pci->irq, snd_intel8x0_interrupt, IRQF_DISABLED|IRQF_SHARED,
                    card->shortname, chip);
        chip->irq = pci->irq;
        synchronize_irq(chip->irq);
@@ -2848,7 +2848,7 @@ static int __devinit snd_intel8x0_create(struct snd_card *card,
 
        /* request irq after initializaing int_sta_mask, etc */
        if (request_irq(pci->irq, snd_intel8x0_interrupt,
-                       SA_INTERRUPT|SA_SHIRQ, card->shortname, chip)) {
+                       IRQF_DISABLED|IRQF_SHARED, card->shortname, chip)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                snd_intel8x0_free(chip);
                return -EBUSY;
index 24703d75b65a5ca9da6fafebb12f9510efe54675..f28e273ae276061f8de292f2585ade7d8422cdf7 100644 (file)
@@ -1185,7 +1185,7 @@ static int __devinit snd_intel8x0m_create(struct snd_card *card,
        }
 
  port_inited:
-       if (request_irq(pci->irq, snd_intel8x0_interrupt, SA_INTERRUPT|SA_SHIRQ,
+       if (request_irq(pci->irq, snd_intel8x0_interrupt, IRQF_DISABLED|IRQF_SHARED,
                        card->shortname, chip)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                snd_intel8x0_free(chip);
index 6e97932de34f337a23cd2dd1cd81839d8126c347..2b4ce002794a1bb4eb5f320c0341045eea955aa6 100644 (file)
@@ -2237,7 +2237,7 @@ static int __devinit snd_korg1212_create(struct snd_card *card, struct pci_dev *
         }
 
         err = request_irq(pci->irq, snd_korg1212_interrupt,
-                          SA_INTERRUPT|SA_SHIRQ,
+                          IRQF_DISABLED|IRQF_SHARED,
                           "korg1212", korg1212);
 
         if (err) {
index 1c344fbd964de4a76f9c7915ba3970b87d299aab..828eab59253a98d5e5d2fe2930f79548c67f6300 100644 (file)
@@ -2760,7 +2760,7 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
 
        tasklet_init(&chip->hwvol_tq, snd_m3_update_hw_volume, (unsigned long)chip);
 
-       if (request_irq(pci->irq, snd_m3_interrupt, SA_INTERRUPT|SA_SHIRQ,
+       if (request_irq(pci->irq, snd_m3_interrupt, IRQF_DISABLED|IRQF_SHARED,
                        card->driver, chip)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                snd_m3_free(chip);
index 366c4a7e65c6a8f65f0d2a32af55ddfac88eb974..a4aaa7b9a231d0de96551af5f33b359b69be91cc 100644 (file)
@@ -1319,7 +1319,7 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
                                                   pci_resource_len(pci, i));
        }
 
-       if (request_irq(pci->irq, snd_mixart_interrupt, SA_INTERRUPT|SA_SHIRQ, CARD_NAME, (void *)mgr)) {
+       if (request_irq(pci->irq, snd_mixart_interrupt, IRQF_DISABLED|IRQF_SHARED, CARD_NAME, (void *)mgr)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                snd_mixart_free(mgr);
                return -EBUSY;
index b92d6600deb9731ec5d67fe87ba8fc8bc1d03958..56d7282e66512e9a7bb05072fe20494fe2088b45 100644 (file)
@@ -465,7 +465,7 @@ static int snd_nm256_acquire_irq(struct nm256 *chip)
 {
        mutex_lock(&chip->irq_mutex);
        if (chip->irq < 0) {
-               if (request_irq(chip->pci->irq, chip->interrupt, SA_INTERRUPT|SA_SHIRQ,
+               if (request_irq(chip->pci->irq, chip->interrupt, IRQF_DISABLED|IRQF_SHARED,
                                chip->card->driver, chip)) {
                        snd_printk(KERN_ERR "unable to grab IRQ %d\n", chip->pci->irq);
                        mutex_unlock(&chip->irq_mutex);
index 8198884b51ee1fc7141eebad28ae7743f187485b..ae980e11827f4154ebdc8c962bcacb6e45827204 100644 (file)
@@ -1250,7 +1250,7 @@ static int __devinit pcxhr_probe(struct pci_dev *pci, const struct pci_device_id
        mgr->pci = pci;
        mgr->irq = -1;
 
-       if (request_irq(pci->irq, pcxhr_interrupt, SA_INTERRUPT|SA_SHIRQ,
+       if (request_irq(pci->irq, pcxhr_interrupt, IRQF_DISABLED|IRQF_SHARED,
                        card_name, mgr)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                pcxhr_free(mgr);
index 5618ec9740bded1738a034868720d24db46ab239..5501a08ca23a3443ccd31c270c5aba905dfb0a8b 100644 (file)
@@ -1892,7 +1892,7 @@ snd_riptide_create(struct snd_card *card, struct pci_dev *pci,
        UNSET_AIE(hwport);
 
        if (request_irq
-           (pci->irq, snd_riptide_interrupt, SA_INTERRUPT | SA_SHIRQ,
+           (pci->irq, snd_riptide_interrupt, IRQF_DISABLED | IRQF_SHARED,
             "RIPTIDE", chip)) {
                snd_printk(KERN_ERR "Riptide: unable to grab IRQ %d\n",
                           pci->irq);
index 2cb9fe98db2f51f43ba2bbe1ba51c929f9d1c667..2e24b68d07aa47f4cf33d4522c0e48f2c240b79c 100644 (file)
@@ -1374,7 +1374,7 @@ static int __devinit snd_rme32_create(struct rme32 * rme32)
                return -ENOMEM;
        }
 
-       if (request_irq(pci->irq, snd_rme32_interrupt, SA_INTERRUPT | SA_SHIRQ, "RME32", (void *) rme32)) {
+       if (request_irq(pci->irq, snd_rme32_interrupt, IRQF_DISABLED | IRQF_SHARED, "RME32", (void *) rme32)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                return -EBUSY;
        }
index 991cb18c14f3d14ce19ced4d319bdf89b38c96e1..fde0f3e205304e1f3cc89c4420f89f607a371529 100644 (file)
@@ -1588,7 +1588,7 @@ snd_rme96_create(struct rme96 *rme96)
                return -ENOMEM;
        }
 
-       if (request_irq(pci->irq, snd_rme96_interrupt, SA_INTERRUPT|SA_SHIRQ, "RME96", (void *)rme96)) {
+       if (request_irq(pci->irq, snd_rme96_interrupt, IRQF_DISABLED|IRQF_SHARED, "RME96", (void *)rme96)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                return -EBUSY;
        }
index eaf3c22449ad62e2ff02f2c0650694b8ce2942e8..99cf86244acbb17f02ec30bca3e6027490df9fe2 100644 (file)
@@ -4912,7 +4912,7 @@ static int __devinit snd_hdsp_create(struct snd_card *card,
                return -EBUSY;
        }
 
-       if (request_irq(pci->irq, snd_hdsp_interrupt, SA_INTERRUPT|SA_SHIRQ, "hdsp", (void *)hdsp)) {
+       if (request_irq(pci->irq, snd_hdsp_interrupt, IRQF_DISABLED|IRQF_SHARED, "hdsp", (void *)hdsp)) {
                snd_printk(KERN_ERR "Hammerfall-DSP: unable to use IRQ %d\n", pci->irq);
                return -EBUSY;
        }
index bba1615504d3d78d7fe11dcd05e511d62d1536ea..7d03ae066d53c04b4c05ef76e3af92c59f222d0e 100644 (file)
@@ -3497,7 +3497,7 @@ static int __devinit snd_hdspm_create(struct snd_card *card, struct hdspm * hdsp
                   hdspm->port + io_extent - 1);
 
        if (request_irq(pci->irq, snd_hdspm_interrupt,
-                       SA_INTERRUPT | SA_SHIRQ, "hdspm",
+                       IRQF_DISABLED | IRQF_SHARED, "hdspm",
                        (void *) hdspm)) {
                snd_printk(KERN_ERR "HDSPM: unable to use IRQ %d\n", pci->irq);
                return -EBUSY;
index 3b945e8c1b154ee5b474a7ca0dfb3c2189d1dbf9..9534e183413881c715d5263f111c25acc4bf8805 100644 (file)
@@ -2500,7 +2500,7 @@ static int __devinit snd_rme9652_create(struct snd_card *card,
                return -EBUSY;
        }
        
-       if (request_irq(pci->irq, snd_rme9652_interrupt, SA_INTERRUPT|SA_SHIRQ, "rme9652", (void *)rme9652)) {
+       if (request_irq(pci->irq, snd_rme9652_interrupt, IRQF_DISABLED|IRQF_SHARED, "rme9652", (void *)rme9652)) {
                snd_printk(KERN_ERR "unable to request IRQ %d\n", pci->irq);
                return -EBUSY;
        }
index e5511606af04e9e58ff4b91f26a05aba41d20fba..c4303418668bae581ab5b832a94d43583bb8ae01 100644 (file)
@@ -1257,7 +1257,7 @@ static int __devinit snd_sonicvibes_create(struct snd_card *card,
        sonic->midi_port = pci_resource_start(pci, 3);
        sonic->game_port = pci_resource_start(pci, 4);
 
-       if (request_irq(pci->irq, snd_sonicvibes_interrupt, SA_INTERRUPT|SA_SHIRQ, "S3 SonicVibes", (void *)sonic)) {
+       if (request_irq(pci->irq, snd_sonicvibes_interrupt, IRQF_DISABLED|IRQF_SHARED, "S3 SonicVibes", (void *)sonic)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                snd_sonicvibes_free(sonic);
                return -EBUSY;
index d99ed7237750eb08e5c8706e09a6017ab979ebb5..4930cc6b054d6817d42bde0ece08a13c7799b7ec 100644 (file)
@@ -3599,7 +3599,7 @@ int __devinit snd_trident_create(struct snd_card *card,
        }
        trident->port = pci_resource_start(pci, 0);
 
-       if (request_irq(pci->irq, snd_trident_interrupt, SA_INTERRUPT|SA_SHIRQ,
+       if (request_irq(pci->irq, snd_trident_interrupt, IRQF_DISABLED|IRQF_SHARED,
                        "Trident Audio", trident)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                snd_trident_free(trident);
index 2527bbd958c551f30fc83655ee83d06161bee6d0..37bd5eb7a380d8deb10851c374adc15cf437f1d2 100644 (file)
@@ -2281,7 +2281,7 @@ static int __devinit snd_via82xx_create(struct snd_card *card,
        if (request_irq(pci->irq,
                        chip_type == TYPE_VIA8233 ?
                        snd_via8233_interrupt : snd_via686_interrupt,
-                       SA_INTERRUPT|SA_SHIRQ,
+                       IRQF_DISABLED|IRQF_SHARED,
                        card->driver, chip)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                snd_via82xx_free(chip);
index 577a2b03759fbc6503ab15e324dd7e963708bbc5..c1ede6c2a6d485369530d0f5a9eb226bd137e427 100644 (file)
@@ -1118,7 +1118,7 @@ static int __devinit snd_via82xx_create(struct snd_card *card,
                return err;
        }
        chip->port = pci_resource_start(pci, 0);
-       if (request_irq(pci->irq, snd_via82xx_interrupt, SA_INTERRUPT|SA_SHIRQ,
+       if (request_irq(pci->irq, snd_via82xx_interrupt, IRQF_DISABLED|IRQF_SHARED,
                        card->driver, chip)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                snd_via82xx_free(chip);
index 0f1ebb010a5ed2dfa9e775497b196a09e005067c..7deda25f7adc8499125a78aadf7e03541451ff56 100644 (file)
@@ -162,7 +162,7 @@ static int __devinit snd_vx222_create(struct snd_card *card, struct pci_dev *pci
        for (i = 0; i < 2; i++)
                vx->port[i] = pci_resource_start(pci, i + 1);
 
-       if (request_irq(pci->irq, snd_vx_irq_handler, SA_INTERRUPT|SA_SHIRQ,
+       if (request_irq(pci->irq, snd_vx_irq_handler, IRQF_DISABLED|IRQF_SHARED,
                        CARD_NAME, (void *) chip)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                snd_vx222_free(chip);
index f894752523bbd049120bef9f2a230513575e4546..a55b5fd7da64e5c5a04df607ca2d86551f17e760 100644 (file)
@@ -2288,7 +2288,7 @@ int __devinit snd_ymfpci_create(struct snd_card *card,
                snd_ymfpci_free(chip);
                return -EBUSY;
        }
-       if (request_irq(pci->irq, snd_ymfpci_interrupt, SA_INTERRUPT|SA_SHIRQ, "YMFPCI", (void *) chip)) {
+       if (request_irq(pci->irq, snd_ymfpci_interrupt, IRQF_DISABLED|IRQF_SHARED, "YMFPCI", (void *) chip)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                snd_ymfpci_free(chip);
                return -EBUSY;
index be98f63773392af7e9afa04c748acffc5d5c8b94..641430631505057f478f126fc7c91270e6fc921e 100644 (file)
@@ -1120,6 +1120,7 @@ int __init snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return)
        struct snd_pmac *chip;
        struct device_node *np;
        int i, err;
+       unsigned int irq;
        unsigned long ctrl_addr, txdma_addr, rxdma_addr;
        static struct snd_device_ops ops = {
                .dev_free =     snd_pmac_dev_free,
@@ -1153,10 +1154,6 @@ int __init snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return)
        if (chip->is_k2) {
                static char *rnames[] = {
                        "Sound Control", "Sound DMA" };
-               if (np->n_intrs < 3) {
-                       err = -ENODEV;
-                       goto __error;
-               }
                for (i = 0; i < 2; i ++) {
                        if (of_address_to_resource(np->parent, i,
                                                   &chip->rsrc[i])) {
@@ -1170,7 +1167,7 @@ int __init snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return)
                                               chip->rsrc[i].start + 1,
                                               rnames[i]) == NULL) {
                                printk(KERN_ERR "snd: can't request rsrc "
-                                      " %d (%s: 0x%016lx:%016lx)\n",
+                                      " %d (%s: 0x%016llx:%016llx)\n",
                                       i, rnames[i],
                                       (unsigned long long)chip->rsrc[i].start,
                                       (unsigned long long)chip->rsrc[i].end);
@@ -1185,10 +1182,6 @@ int __init snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return)
        } else {
                static char *rnames[] = {
                        "Sound Control", "Sound Tx DMA", "Sound Rx DMA" };
-               if (np->n_intrs < 3) {
-                       err = -ENODEV;
-                       goto __error;
-               }
                for (i = 0; i < 3; i ++) {
                        if (of_address_to_resource(np, i,
                                                   &chip->rsrc[i])) {
@@ -1220,28 +1213,30 @@ int __init snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return)
        chip->playback.dma = ioremap(txdma_addr, 0x100);
        chip->capture.dma = ioremap(rxdma_addr, 0x100);
        if (chip->model <= PMAC_BURGUNDY) {
-               if (request_irq(np->intrs[0].line, snd_pmac_ctrl_intr, 0,
+               irq = irq_of_parse_and_map(np, 0);
+               if (request_irq(irq, snd_pmac_ctrl_intr, 0,
                                "PMac", (void*)chip)) {
-                       snd_printk(KERN_ERR "pmac: unable to grab IRQ %d\n", np->intrs[0].line);
+                       snd_printk(KERN_ERR "pmac: unable to grab IRQ %d\n",
+                                  irq);
                        err = -EBUSY;
                        goto __error;
                }
-               chip->irq = np->intrs[0].line;
+               chip->irq = irq;
        }
-       if (request_irq(np->intrs[1].line, snd_pmac_tx_intr, 0,
-                       "PMac Output", (void*)chip)) {
-               snd_printk(KERN_ERR "pmac: unable to grab IRQ %d\n", np->intrs[1].line);
+       irq = irq_of_parse_and_map(np, 1);
+       if (request_irq(irq, snd_pmac_tx_intr, 0, "PMac Output", (void*)chip)){
+               snd_printk(KERN_ERR "pmac: unable to grab IRQ %d\n", irq);
                err = -EBUSY;
                goto __error;
        }
-       chip->tx_irq = np->intrs[1].line;
-       if (request_irq(np->intrs[2].line, snd_pmac_rx_intr, 0,
-                       "PMac Input", (void*)chip)) {
-               snd_printk(KERN_ERR "pmac: unable to grab IRQ %d\n", np->intrs[2].line);
+       chip->tx_irq = irq;
+       irq = irq_of_parse_and_map(np, 2);
+       if (request_irq(irq, snd_pmac_rx_intr, 0, "PMac Input", (void*)chip)) {
+               snd_printk(KERN_ERR "pmac: unable to grab IRQ %d\n", irq);
                err = -EBUSY;
                goto __error;
        }
-       chip->rx_irq = np->intrs[2].line;
+       chip->rx_irq = irq;
 
        snd_pmac_sound_feature(chip, 1);
 
index 70e4ebc70260deea11b06670272e863b29da7340..692c6117767859f3749602372b0cb61112466ece 100644 (file)
@@ -1121,7 +1121,7 @@ static long tumbler_find_device(const char *device, const char *platform,
        DBG("(I) GPIO device %s found, offset: %x, active state: %d !\n",
            device, gp->addr, gp->active_state);
 
-       return (node->n_intrs > 0) ? node->intrs[0].line : 0;
+       return irq_of_parse_and_map(node, 0);
 }
 
 /* reset audio */
@@ -1264,16 +1264,16 @@ static int __init tumbler_init(struct snd_pmac *chip)
                                    &mix->line_mute, 1);
        irq = tumbler_find_device("headphone-detect",
                                  NULL, &mix->hp_detect, 0);
-       if (irq < 0)
+       if (irq <= NO_IRQ)
                irq = tumbler_find_device("headphone-detect",
                                          NULL, &mix->hp_detect, 1);
-       if (irq < 0)
+       if (irq <= NO_IRQ)
                irq = tumbler_find_device("keywest-gpio15",
                                          NULL, &mix->hp_detect, 1);
        mix->headphone_irq = irq;
        irq = tumbler_find_device("line-output-detect",
                                  NULL, &mix->line_detect, 0);
-       if (irq < 0)
+       if (irq <= NO_IRQ)
                irq = tumbler_find_device("line-output-detect",
                                          NULL, &mix->line_detect, 1);
        mix->lineout_irq = irq;
index 7535ec821dcf8dfb53a55046853ad86b0cbff54d..62d4d0c812611e22227e064cfd43eb36583f70a4 100644 (file)
@@ -34,7 +34,6 @@
  *     locking at some point in 2.3.x.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
index ba1b2a3443d36e91f886ef1a2fc4179fbace3cb4..2bd8e40b854114436c8e50afcbf42e73141e7815 100644 (file)
@@ -973,7 +973,7 @@ static int __init snd_amd7930_create(struct snd_card *card,
        amd7930_idle(amd);
 
        if (request_irq(irq, snd_amd7930_interrupt,
-                       SA_INTERRUPT | SA_SHIRQ, "amd7930", amd)) {
+                       IRQF_DISABLED | IRQF_SHARED, "amd7930", amd)) {
                snd_printk("amd7930-%d: Unable to grab IRQ %d\n",
                           dev, irq);
                snd_amd7930_free(amd);
@@ -1033,10 +1033,10 @@ static int __init amd7930_attach_common(struct resource *rp, int irq)
 
        strcpy(card->driver, "AMD7930");
        strcpy(card->shortname, "Sun AMD7930");
-       sprintf(card->longname, "%s at 0x%02lx:0x%08lx, irq %d",
+       sprintf(card->longname, "%s at 0x%02lx:0x%08Lx, irq %d",
                card->shortname,
                rp->flags & 0xffL,
-               rp->start,
+               (unsigned long long)rp->start,
                irq);
 
        if ((err = snd_amd7930_create(card, rp,
index d9d14c2707dbf922a622b5889b9c2b78af74068b..9a06c3bd694406a9948dd2527e0941d947bada45 100644 (file)
@@ -8,7 +8,6 @@
  * Copyright (c) by Jaroslav Kysela <perex@suse.cz>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
@@ -2002,7 +2001,7 @@ static int __init snd_cs4231_sbus_create(struct snd_card *card,
        chip->c_dma.preallocate = sbus_dma_preallocate;
 
        if (request_irq(sdev->irqs[0], snd_cs4231_sbus_interrupt,
-                       SA_SHIRQ, "cs4231", chip)) {
+                       IRQF_SHARED, "cs4231", chip)) {
                snd_printdd("cs4231-%d: Unable to grab SBUS IRQ %d\n",
                            dev, sdev->irqs[0]);
                snd_cs4231_sbus_free(chip);
@@ -2037,7 +2036,7 @@ static int __init cs4231_sbus_attach(struct sbus_dev *sdev)
        if (err)
                return err;
 
-       sprintf(card->longname, "%s at 0x%02lx:0x%016lx, irq %d",
+       sprintf(card->longname, "%s at 0x%02lx:0x%016Lx, irq %d",
                card->shortname,
                rp->flags & 0xffL,
                (unsigned long long)rp->start,
index a7489a3dd75ac4f68fc328f128332e760a77a28f..f3ae6e23610e5277bad2d996a83fddd66430948b 100644 (file)
@@ -46,7 +46,7 @@
  *
  * I've tried to stick to the following function naming conventions:
  * snd_*       ALSA stuff
- * cs4215_*    CS4215 codec specfic stuff
+ * cs4215_*    CS4215 codec specific stuff
  * dbri_*      DBRI high-level stuff
  * other       DBRI low-level stuff
  */
@@ -2569,7 +2569,7 @@ static int __init snd_dbri_create(struct snd_card *card,
                return -EIO;
        }
 
-       err = request_irq(dbri->irq, snd_dbri_interrupt, SA_SHIRQ,
+       err = request_irq(dbri->irq, snd_dbri_interrupt, IRQF_SHARED,
                          "DBRI audio", dbri);
        if (err) {
                printk(KERN_ERR "DBRI: Can't get irq %d\n", dbri->irq);
@@ -2645,7 +2645,7 @@ static int __init dbri_attach(int prom_node, struct sbus_dev *sdev)
        strcpy(card->driver, "DBRI");
        strcpy(card->shortname, "Sun DBRI");
        rp = &sdev->resource[0];
-       sprintf(card->longname, "%s at 0x%02lx:0x%016lx, irq %d",
+       sprintf(card->longname, "%s at 0x%02lx:0x%016Lx, irq %d",
                card->shortname,
                rp->flags & 0xffL, (unsigned long long)rp->start, irq.pri);