]> err.no Git - linux-2.6/commitdiff
Merge branch 'genirq' of master.kernel.org:/home/rmk/linux-2.6-arm
authorLinus Torvalds <torvalds@g5.osdl.org>
Sun, 2 Jul 2006 22:07:45 +0000 (15:07 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sun, 2 Jul 2006 22:07:45 +0000 (15:07 -0700)
* 'genirq' of master.kernel.org:/home/rmk/linux-2.6-arm: (24 commits)
  [ARM] 3683/2:  ARM: Convert at91rm9200 to generic irq handling
  [ARM] 3682/2:  ARM: Convert ixp4xx to generic irq handling
  [ARM] 3702/1: ARM: Convert ixp23xx to generic irq handling
  [ARM] 3701/1: ARM: Convert plat-omap to generic irq handling
  [ARM] 3700/1: ARM: Convert lh7a40x to generic irq handling
  [ARM] 3699/1: ARM: Convert s3c2410 to generic irq handling
  [ARM] 3698/1: ARM: Convert sa1100 to generic irq handling
  [ARM] 3697/1: ARM: Convert shark to generic irq handling
  [ARM] 3696/1: ARM: Convert clps711x to generic irq handling
  [ARM] 3694/1: ARM: Convert ecard driver to generic irq handling
  [ARM] 3693/1: ARM: Convert omap1 to generic irq handling
  [ARM] 3691/1: ARM: Convert imx to generic irq handling
  [ARM] 3688/1: ARM: Convert clps7500 to generic irq handling
  [ARM] 3687/1: ARM: Convert integrator to generic irq handling
  [ARM] 3685/1: ARM: Convert pxa to generic irq handling
  [ARM] 3684/1: ARM: Convert l7200 to generic irq handling
  [ARM] 3681/1: ARM: Convert ixp2000 to generic irq handling
  [ARM] 3680/1: ARM: Convert footbridge to generic irq handling
  [ARM] 3695/1: ARM drivers/pcmcia: Fixup includes
  [ARM] 3689/1: ARM drivers/input/touchscreen: Fixup includes
  ...

Manual conflict resolved in kernel/irq/handle.c (butt-ugly ARM tickless
code).

910 files changed:
Documentation/DocBook/videobook.tmpl
Documentation/feature-removal-schedule.txt
Documentation/pci.txt
Documentation/scsi/tmscsim.txt
Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
Makefile
arch/alpha/kernel/irq.c
arch/alpha/kernel/irq_alpha.c
arch/alpha/kernel/sys_jensen.c
arch/alpha/kernel/sys_titan.c
arch/arm/Kconfig
arch/arm/Makefile
arch/arm/boot/compressed/head.S
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/asm-offsets.c
arch/arm/kernel/entry-armv.S
arch/arm/kernel/head.S
arch/arm/kernel/iwmmxt-notifier.c [new file with mode: 0644]
arch/arm/kernel/iwmmxt.S
arch/arm/kernel/process.c
arch/arm/kernel/setup.c
arch/arm/mach-at91rm9200/Kconfig
arch/arm/mach-at91rm9200/Makefile
arch/arm/mach-at91rm9200/at91rm9200.c [moved from arch/arm/mach-at91rm9200/common.c with 98% similarity]
arch/arm/mach-at91rm9200/at91rm9200_time.c [moved from arch/arm/mach-at91rm9200/time.c with 98% similarity]
arch/arm/mach-ep93xx/Kconfig
arch/arm/mach-ep93xx/Makefile
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-iop3xx/Kconfig
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-innovator.c
arch/arm/mach-omap1/board-osk.c
arch/arm/mach-omap1/clock.c
arch/arm/mach-omap1/pm.c
arch/arm/mach-omap1/time.c
arch/arm/mach-omap2/Kconfig
arch/arm/mach-omap2/Makefile
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/io.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/timer-gp.c
arch/arm/mach-pxa/Kconfig
arch/arm/mach-pxa/Makefile
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/trizeps4.c [new file with mode: 0644]
arch/arm/mach-sa1100/cpu-sa1110.c
arch/arm/mm/Kconfig
arch/arm/mm/ioremap.c
arch/arm/mm/mm-armv.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/plat-omap/Kconfig
arch/arm/plat-omap/clock.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/gpio.c
arch/arm/plat-omap/sram.c
arch/arm/plat-omap/timer32k.c
arch/arm26/kernel/irq.c
arch/arm26/kernel/time.c
arch/cris/arch-v10/drivers/gpio.c
arch/cris/arch-v10/kernel/time.c
arch/cris/arch-v32/drivers/gpio.c
arch/cris/arch-v32/kernel/arbiter.c
arch/cris/arch-v32/kernel/fasttimer.c
arch/cris/arch-v32/kernel/irq.c
arch/cris/arch-v32/kernel/smp.c
arch/cris/arch-v32/kernel/time.c
arch/cris/kernel/irq.c
arch/frv/kernel/irq-routing.c
arch/frv/kernel/irq.c
arch/frv/kernel/time.c
arch/h8300/kernel/ints.c
arch/h8300/platform/h8s/ints.c
arch/i386/kernel/Makefile
arch/i386/kernel/alternative.c
arch/i386/kernel/audit.c [new file with mode: 0644]
arch/i386/mach-default/setup.c
arch/i386/mach-visws/setup.c
arch/i386/mach-voyager/setup.c
arch/i386/mm/init.c
arch/i386/pci/irq.c
arch/ia64/hp/sim/simserial.c
arch/ia64/ia32/Makefile
arch/ia64/ia32/audit.c [new file with mode: 0644]
arch/ia64/kernel/Makefile
arch/ia64/kernel/audit.c [new file with mode: 0644]
arch/ia64/kernel/irq_ia64.c
arch/ia64/kernel/mca.c
arch/ia64/kernel/perfmon.c
arch/ia64/kernel/time.c
arch/ia64/sn/kernel/huberror.c
arch/ia64/sn/kernel/xpc_channel.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/kernel/time.c
arch/m68k/amiga/amiints.c
arch/m68k/amiga/cia.c
arch/m68k/kernel/ints.c
arch/m68knommu/platform/5307/pit.c
arch/m68knommu/platform/5307/timers.c
arch/mips/au1000/common/dbdma.c
arch/mips/au1000/common/irq.c
arch/mips/au1000/common/usbdev.c
arch/mips/basler/excite/excite_iodev.c
arch/mips/dec/setup.c
arch/mips/gt64120/common/time.c
arch/mips/kernel/rtlx.c
arch/mips/kernel/smp-mt.c
arch/mips/kernel/smtc.c
arch/mips/kernel/time.c
arch/mips/momentum/jaguar_atx/irq.c
arch/mips/momentum/ocelot_3/irq.c
arch/mips/momentum/ocelot_c/irq.c
arch/mips/momentum/ocelot_g/gt-irq.c
arch/mips/philips/pnx8550/common/int.c
arch/mips/sgi-ip22/ip22-int.c
arch/mips/sgi-ip27/ip27-irq.c
arch/mips/sgi-ip27/ip27-timer.c
arch/mips/sgi-ip32/ip32-irq.c
arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c
arch/parisc/kernel/irq.c
arch/parisc/mm/init.c
arch/powerpc/platforms/cell/interrupt.c
arch/powerpc/platforms/cell/spu_base.c
arch/powerpc/platforms/powermac/pic.c
arch/powerpc/platforms/powermac/smp.c
arch/powerpc/platforms/pseries/xics.c
arch/powerpc/sysdev/i8259.c
arch/powerpc/sysdev/mpic.c
arch/ppc/8260_io/fcc_enet.c
arch/ppc/platforms/85xx/mpc8560_ads.c
arch/ppc/platforms/85xx/mpc85xx_cds_common.c
arch/ppc/platforms/85xx/stx_gp3.c
arch/ppc/platforms/85xx/tqm85xx.c
arch/ppc/platforms/hdpu.c
arch/ppc/platforms/radstone_ppc7d.c
arch/ppc/platforms/sbc82xx.c
arch/ppc/syslib/gt64260_pic.c
arch/ppc/syslib/ibm440gx_common.c
arch/ppc/syslib/m82xx_pci.c
arch/ppc/syslib/mv64360_pic.c
arch/ppc/syslib/open_pic.c
arch/s390/kernel/entry.S
arch/s390/kernel/entry64.S
arch/s390/mm/init.c
arch/sh/boards/snapgear/setup.c
arch/sh/cchips/hd6446x/hd64461/setup.c
arch/sh/cchips/hd6446x/hd64465/gpio.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/pci-st40.c
arch/sh/kernel/timers/timer-tmu.c
arch/sh64/kernel/dma.c
arch/sh64/kernel/pci_sh5.c
arch/sh64/kernel/time.c
arch/sh64/mach-cayman/irq.c
arch/sparc/kernel/irq.c
arch/sparc/kernel/pcic.c
arch/sparc/kernel/sun4c_irq.c
arch/sparc/kernel/sun4d_irq.c
arch/sparc/kernel/sun4m_irq.c
arch/sparc/kernel/tick14.c
arch/sparc64/kernel/ebus.c
arch/sparc64/kernel/pci_psycho.c
arch/sparc64/kernel/pci_sabre.c
arch/sparc64/kernel/pci_schizo.c
arch/sparc64/kernel/sbus.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/ubd_kern.c
arch/um/drivers/xterm_kern.c
arch/um/kernel/irq.c
arch/um/kernel/sigio_kern.c
arch/um/kernel/skas/uaccess.c
arch/um/kernel/time_kern.c
arch/um/os-Linux/umid.c
arch/um/scripts/Makefile.rules
arch/v850/kernel/gbus_int.c
arch/v850/kernel/rte_me2_cb.c
arch/v850/kernel/time.c
arch/x86_64/ia32/Makefile
arch/x86_64/ia32/audit.c [new file with mode: 0644]
arch/x86_64/kernel/Makefile
arch/x86_64/kernel/audit.c [new file with mode: 0644]
arch/x86_64/kernel/time.c
arch/x86_64/mm/init.c
arch/xtensa/kernel/time.c
drivers/acorn/block/mfmhd.c
drivers/acpi/bus.c
drivers/acpi/osl.c
drivers/atm/ambassador.c
drivers/atm/eni.c
drivers/atm/firestream.c
drivers/atm/fore200e.c
drivers/atm/he.c
drivers/atm/horizon.c
drivers/atm/idt77252.c
drivers/atm/iphase.c
drivers/atm/lanai.c
drivers/atm/nicstar.c
drivers/atm/zatm.c
drivers/block/DAC960.c
drivers/block/cciss.c
drivers/block/cpqarray.c
drivers/block/nbd.c
drivers/block/ps2esdi.c
drivers/block/sx8.c
drivers/block/umem.c
drivers/cdrom/cdu31a.c
drivers/cdrom/mcdx.c
drivers/cdrom/sonycd535.c
drivers/char/amiserial.c
drivers/char/applicom.c
drivers/char/cyclades.c
drivers/char/drm/drm_irq.c
drivers/char/esp.c
drivers/char/ftape/lowlevel/fdc-io.c
drivers/char/hpet.c
drivers/char/hvc_console.c
drivers/char/hvcs.c
drivers/char/hvsi.c
drivers/char/ip2/ip2main.c
drivers/char/ipmi/ipmi_si_intf.c
drivers/char/isicom.c
drivers/char/ite_gpio.c
drivers/char/mbcs.c
drivers/char/mmtimer.c
drivers/char/mxser.c
drivers/char/nwbutton.c
drivers/char/qtronix.c
drivers/char/rio/rio_linux.c
drivers/char/riscom8.c
drivers/char/rtc.c
drivers/char/s3c2410-rtc.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/tlclk.c
drivers/char/tpm/tpm_tis.c
drivers/char/vme_scc.c
drivers/char/watchdog/eurotechwdt.c
drivers/char/watchdog/mpcore_wdt.c
drivers/char/watchdog/wdt.c
drivers/char/watchdog/wdt_pci.c
drivers/dma/ioatdma.c
drivers/edac/amd76x_edac.c
drivers/edac/e752x_edac.c
drivers/edac/e7xxx_edac.c
drivers/edac/edac_mc.h
drivers/edac/i82860_edac.c
drivers/edac/i82875p_edac.c
drivers/edac/r82600_edac.c
drivers/fc4/soc.c
drivers/fc4/socal.c
drivers/i2c/busses/i2c-mpc.c
drivers/i2c/busses/i2c-pxa.c
drivers/i2c/busses/i2c-s3c2410.c
drivers/i2c/chips/isp1301_omap.c
drivers/i2c/chips/tps65010.c
drivers/ide/ide-probe.c
drivers/ide/legacy/hd.c
drivers/ide/pci/it821x.c
drivers/ieee1394/ohci1394.c
drivers/ieee1394/pcilynx.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/input/keyboard/corgikbd.c
drivers/input/keyboard/spitzkbd.c
drivers/input/misc/ixp4xx-beeper.c
drivers/input/mouse/rpcmouse.c
drivers/input/serio/gscps2.c
drivers/input/serio/i8042.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/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/divasmain.c
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/diva.c
drivers/isdn/hisax/elsa.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/hisax_fcpcipnp.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/teles3.c
drivers/isdn/hisax/telespci.c
drivers/isdn/hisax/w6692.c
drivers/isdn/hysdn/boardergo.c
drivers/isdn/sc/init.c
drivers/macintosh/macio_asic.c
drivers/macintosh/smu.c
drivers/media/common/saa7146_core.c
drivers/media/dvb/b2c2/flexcop-pci.c
drivers/media/dvb/bt8xx/bt878.c
drivers/media/dvb/pluto2/pluto2.c
drivers/media/video/bt8xx/bttv-driver.c
drivers/media/video/cx88/cx88-alsa.c
drivers/media/video/cx88/cx88-mpeg.c
drivers/media/video/cx88/cx88-video.c
drivers/media/video/meye.c
drivers/media/video/saa7134/saa7134-alsa.c
drivers/media/video/saa7134/saa7134-core.c
drivers/media/video/saa7134/saa7134-oss.c
drivers/media/video/stradis.c
drivers/media/video/zoran_card.c
drivers/media/video/zr36120.c
drivers/message/fusion/mptbase.c
drivers/message/i2o/pci.c
drivers/mfd/ucb1x00-core.c
drivers/misc/ibmasm/module.c
drivers/mmc/at91_mci.c
drivers/mmc/au1xmmc.c
drivers/mmc/mmci.c
drivers/mmc/omap.c
drivers/mmc/sdhci.c
drivers/mmc/sdhci.h
drivers/mmc/wbsd.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/a2065.c
drivers/net/acenic.c
drivers/net/amd8111e.c
drivers/net/apne.c
drivers/net/arcnet/com20020-pci.c
drivers/net/ariadne.c
drivers/net/b44.c
drivers/net/bnx2.c
drivers/net/cassini.c
drivers/net/chelsio/cxgb2.c
drivers/net/cris/eth_v10.c
drivers/net/defxx.c
drivers/net/dgrs.c
drivers/net/dl2k.c
drivers/net/dm9000.c
drivers/net/e100.c
drivers/net/e1000/e1000_ethtool.c
drivers/net/e1000/e1000_main.c
drivers/net/eepro.c
drivers/net/eepro100.c
drivers/net/epic100.c
drivers/net/fealnx.c
drivers/net/forcedeth.c
drivers/net/fs_enet/fs_enet-main.c
drivers/net/gt96100eth.c
drivers/net/hamachi.c
drivers/net/hamradio/baycom_ser_fdx.c
drivers/net/hamradio/baycom_ser_hdx.c
drivers/net/hamradio/scc.c
drivers/net/hamradio/yam.c
drivers/net/hp100.c
drivers/net/hydra.c
drivers/net/ibmlana.c
drivers/net/ioc3-eth.c
drivers/net/irda/donauboe.c
drivers/net/irda/vlsi_ir.c
drivers/net/ixgb/ixgb_main.c
drivers/net/ixp2000/ixpdev.c
drivers/net/jazzsonic.c
drivers/net/lp486e.c
drivers/net/mipsnet.c
drivers/net/mv643xx_eth.c
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/pcnet_cs.c
drivers/net/pcnet32.c
drivers/net/phy/phy.c
drivers/net/r8169.c
drivers/net/rrunner.c
drivers/net/s2io.c
drivers/net/sb1250-mac.c
drivers/net/sis190.c
drivers/net/sis900.c
drivers/net/sk98lin/skge.c
drivers/net/sk_mca.c
drivers/net/skfp/skfddi.c
drivers/net/skge.c
drivers/net/sky2.c
drivers/net/smc-ultra32.c
drivers/net/smc911x.c
drivers/net/smc91x.h
drivers/net/spider_net.c
drivers/net/starfire.c
drivers/net/sun3lance.c
drivers/net/sunbmac.c
drivers/net/sundance.c
drivers/net/sungem.c
drivers/net/sunhme.c
drivers/net/sunlance.c
drivers/net/sunqe.c
drivers/net/tc35815.c
drivers/net/tg3.c
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/tmspci.c
drivers/net/tulip/de2104x.c
drivers/net/tulip/de4x5.c
drivers/net/tulip/dmfe.c
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/typhoon.c
drivers/net/via-rhine.c
drivers/net/via-velocity.c
drivers/net/wan/dscc4.c
drivers/net/wan/farsync.c
drivers/net/wan/hostess_sv11.c
drivers/net/wan/lmc/lmc_main.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/wanxl.c
drivers/net/wireless/airo.c
drivers/net/wireless/atmel.c
drivers/net/wireless/bcm43xx/bcm43xx_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/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/yellowfin.c
drivers/net/zorro8390.c
drivers/parisc/eisa.c
drivers/parisc/superio.c
drivers/parport/parport_ax88796.c
drivers/parport/parport_mfc3.c
drivers/parport/parport_sunbpp.c
drivers/pci/hotplug/cpci_hotplug_core.c
drivers/pci/hotplug/cpcihp_zt5550.c
drivers/pci/hotplug/cpqphp_core.c
drivers/pci/hotplug/pciehp_hpc.c
drivers/pci/hotplug/shpchp_hpc.c
drivers/pcmcia/at91_cf.c
drivers/pcmcia/hd64465_ss.c
drivers/pcmcia/i82092.c
drivers/pcmcia/i82365.c
drivers/pcmcia/omap_cf.c
drivers/pcmcia/pcmcia_resource.c
drivers/pcmcia/pd6729.c
drivers/pcmcia/soc_common.c
drivers/pcmcia/vrc4171_card.c
drivers/pcmcia/vrc4173_cardu.c
drivers/pcmcia/yenta_socket.c
drivers/pnp/resource.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/sbus/char/aurora.c
drivers/sbus/char/bbc_i2c.c
drivers/sbus/char/cpwatchdog.c
drivers/scsi/3w-9xxx.c
drivers/scsi/3w-xxxx.c
drivers/scsi/53c7xx.c
drivers/scsi/BusLogic.c
drivers/scsi/NCR5380.c
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/rkt.c
drivers/scsi/aacraid/rx.c
drivers/scsi/aacraid/sa.c
drivers/scsi/advansys.c
drivers/scsi/aha152x.c
drivers/scsi/aha1740.c
drivers/scsi/ahci.c
drivers/scsi/aic7xxx/aic7770_osm.c
drivers/scsi/aic7xxx/aic79xx_osm_pci.c
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
drivers/scsi/aic7xxx_old.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/atp870u.c
drivers/scsi/blz1230.c
drivers/scsi/blz2060.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_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/fd_mcs.c
drivers/scsi/fdomain.c
drivers/scsi/g_NCR5380.c
drivers/scsi/gdth.c
drivers/scsi/gvp11.c
drivers/scsi/hptiop.c
drivers/scsi/ibmmca.c
drivers/scsi/in2000.c
drivers/scsi/initio.c
drivers/scsi/ipr.c
drivers/scsi/ips.c
drivers/scsi/jazz_esp.c
drivers/scsi/lasi700.c
drivers/scsi/libata-bmdma.c
drivers/scsi/lpfc/lpfc_init.c
drivers/scsi/megaraid.c
drivers/scsi/megaraid/megaraid_mbox.c
drivers/scsi/megaraid/megaraid_sas.c
drivers/scsi/nsp32.c
drivers/scsi/oktagon_esp.c
drivers/scsi/pas16.c
drivers/scsi/pcmcia/nsp_cs.c
drivers/scsi/pcmcia/sym53c500_cs.c
drivers/scsi/pdc_adma.c
drivers/scsi/qla1280.c
drivers/scsi/qla2xxx/qla_os.c
drivers/scsi/qlogicpti.c
drivers/scsi/sata_mv.c
drivers/scsi/sata_promise.c
drivers/scsi/sata_qstor.c
drivers/scsi/sata_sil.c
drivers/scsi/sata_sil24.c
drivers/scsi/sata_svw.c
drivers/scsi/sata_sx4.c
drivers/scsi/sata_via.c
drivers/scsi/sata_vsc.c
drivers/scsi/seagate.c
drivers/scsi/sim710.c
drivers/scsi/sun3x_esp.c
drivers/scsi/sym53c8xx_2/sym_glue.c
drivers/scsi/t128.c
drivers/scsi/tmscsim.c
drivers/scsi/u14-34f.c
drivers/scsi/wd7000.c
drivers/scsi/zalon.c
drivers/serial/8250.c
drivers/serial/at91_serial.c
drivers/serial/crisv10.c
drivers/serial/dz.c
drivers/serial/icom.c
drivers/serial/imx.c
drivers/serial/ioc4_serial.c
drivers/serial/jsm/jsm_driver.c
drivers/serial/m32r_sio.c
drivers/serial/mcfserial.c
drivers/serial/mpc52xx_uart.c
drivers/serial/mpsc.c
drivers/serial/pmac_zilog.c
drivers/serial/serial_txx9.c
drivers/serial/sh-sci.c
drivers/serial/sn_console.c
drivers/serial/sunsab.c
drivers/serial/sunsu.c
drivers/serial/sunzilog.c
drivers/serial/v850e_uart.c
drivers/sn/ioc3.c
drivers/tc/zs.c
drivers/usb/core/hcd-pci.c
drivers/usb/gadget/at91_udc.c
drivers/usb/gadget/goku_udc.c
drivers/usb/gadget/lh7a40x_udc.c
drivers/usb/gadget/net2280.c
drivers/usb/gadget/omap_udc.c
drivers/usb/gadget/pxa2xx_udc.c
drivers/usb/host/ehci-au1xxx.c
drivers/usb/host/ehci-fsl.c
drivers/usb/host/isp116x-hcd.c
drivers/usb/host/ohci-at91.c
drivers/usb/host/ohci-au1xxx.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/sl811-hcd.c
drivers/video/arcfb.c
drivers/video/aty/atyfb_base.c
drivers/video/au1200fb.c
drivers/video/matrox/matroxfb_base.c
drivers/video/pxafb.c
drivers/video/s3c2410fb.c
drivers/video/sa1100fb.c
fs/reiserfs/inode.c
fs/ufs/balloc.c
fs/ufs/file.c
fs/ufs/inode.c
fs/ufs/truncate.c
fs/ufs/util.c
fs/ufs/util.h
include/asm-alpha/floppy.h
include/asm-alpha/signal.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/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/thread_info.h
include/asm-arm26/floppy.h
include/asm-arm26/signal.h
include/asm-cris/arch-v10/irq.h
include/asm-cris/arch-v32/irq.h
include/asm-cris/signal.h
include/asm-frv/irq-routing.h
include/asm-frv/signal.h
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/sections.h
include/asm-h8300/signal.h
include/asm-i386/alternative.h
include/asm-i386/floppy.h
include/asm-i386/signal.h
include/asm-ia64/irq.h
include/asm-ia64/signal.h
include/asm-m32r/signal.h
include/asm-m68k/floppy.h
include/asm-m68k/irq.h
include/asm-m68k/signal.h
include/asm-m68k/sun3xflop.h
include/asm-m68knommu/irq.h
include/asm-m68knommu/signal.h
include/asm-mips/mach-generic/floppy.h
include/asm-mips/mach-jazz/floppy.h
include/asm-mips/signal.h
include/asm-parisc/floppy.h
include/asm-parisc/signal.h
include/asm-powerpc/floppy.h
include/asm-powerpc/signal.h
include/asm-ppc/floppy.h
include/asm-s390/signal.h
include/asm-sh/floppy.h
include/asm-sh/mpc1211/keyboard.h
include/asm-sh/signal.h
include/asm-sh64/keyboard.h
include/asm-sh64/signal.h
include/asm-sparc/floppy.h
include/asm-sparc/signal.h
include/asm-sparc64/floppy.h
include/asm-sparc64/signal.h
include/asm-um/kmap_types.h
include/asm-v850/signal.h
include/asm-x86_64/alternative.h
include/asm-x86_64/floppy.h
include/asm-x86_64/signal.h
include/asm-xtensa/signal.h
include/linux/audit.h
include/linux/cpu.h
include/linux/err.h
include/linux/interrupt.h
include/linux/irq.h
include/linux/signal.h
include/linux/ufs_fs.h
include/net/irda/irda_device.h
include/sound/initval.h
kernel/audit.h
kernel/auditfilter.c
kernel/auditsc.c
kernel/futex.c
kernel/irq/handle.c
kernel/irq/manage.c
kernel/irq/spurious.c
scripts/Kbuild.include
scripts/Makefile.build
scripts/Makefile.host
scripts/Makefile.lib
scripts/Makefile.modpost
scripts/kconfig/lxdialog/checklist.c
scripts/kernel-doc
scripts/mod/modpost.c
scripts/mod/modpost.h
security/selinux/ss/services.c
sound/arm/aaci.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/ad1889.c
sound/oss/ali5455.c
sound/oss/au1000.c
sound/oss/btaudio.c
sound/oss/cmpci.c
sound/oss/cs4281/cs4281m.c
sound/oss/cs46xx.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/maestro.c
sound/oss/maestro3.c
sound/oss/nec_vrc5477.c
sound/oss/nm256_audio.c
sound/oss/rme96xx.c
sound/oss/sb_common.c
sound/oss/sh_dac_audio.c
sound/oss/sonicvibes.c
sound/oss/trident.c
sound/oss/via82cxxx_audio.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/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/sparc/amd7930.c
sound/sparc/cs4231.c
sound/sparc/dbri.c

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 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>
+
+---------------------------
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).
 
 
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 bb18115d51700abc3f3a02b1a54fffb70c23045e..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>
 
index e9560c6f8156983cb15328c767b594028354da8e..4dcf25d43fa6b1aeb30be44bdf0042fd94983ab9 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")
@@ -1060,8 +1061,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 +1353,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 bd193ffd6fe0db0aa833b8eb7da8187faf106495..729c475d2269a3f1f302e746168949d3aee89966 100644 (file)
@@ -94,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 ffa4ac543cf2da6c369e733af1d9c0b3e4b60f05..ddf5cf8dcb0bcefe44994ad9c10751f8caa5b09e 100644 (file)
@@ -214,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 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 a8bfc8c16a7d20da0d2c7d1fdf1ef9e5058a6682..302aab38d95f6ce902bce1c5737506fc9a58f05c 100644 (file)
@@ -279,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);
 
        /* 
@@ -348,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 531661ac01b4337e027f58a1bb798caf1124aafe..f81a62380addefde7db4f0cde3902cb872c1c061 100644 (file)
@@ -133,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"
@@ -559,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.
@@ -690,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 f7b5c6db30f52a5846769e70a827f5dadc3e89d9..14a9ff9c68df4bfcdbca3fe97dcea28f702588a0 100644 (file)
@@ -447,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 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 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 26f197afd2040b28b52e7a0c0f1f6cfc99d051e2..7ea5f01dfc7bebfb1417834ce1be2c74330b86f4 100644 (file)
@@ -589,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 518b80cd87de313817cc5f943a27448e545db0b8..2242f5f7cb7ddf5f8dc02c3c78e02617e5ad3b5e 100644 (file)
@@ -220,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
@@ -271,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
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 c3258b763c5d87438464126a775572dce33bf046..3079535afccd4be9daf1219c101ac8bc0959e7c7 100644 (file)
@@ -352,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)
@@ -362,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 7447a1987322973801fd4789adea5fd86a5fa6ed..7d6a516c0b9f4db182cc1a7d6b1df57b90331758 100644 (file)
@@ -344,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=%08x\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 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
similarity index 98%
rename from arch/arm/mach-at91rm9200/common.c
rename to arch/arm/mach-at91rm9200/at91rm9200.c
index cc55f4c28d956ecd0a4db8c246d977ee156d0828..7e1d072bdd802180808020e51dcfc771a04ca683 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * arch/arm/mach-at91rm9200/common.c
+ * arch/arm/mach-at91rm9200/at91rm9200.c
  *
  *  Copyright (C) 2005 SAN People
  *
similarity index 98%
rename from arch/arm/mach-at91rm9200/time.c
rename to arch/arm/mach-at91rm9200/at91rm9200_time.c
index 1f080e6ea509ed9492b46f459e606c87f1fabb69..0aa22650a00f2e8ac4564cc34f29573e717ba0fb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * linux/arch/arm/mach-at91rm9200/time.c
+ * linux/arch/arm/mach-at91rm9200/at91rm9200_time.c
  *
  *  Copyright (C) 2003 SAN People
  *  Copyright (C) 2003 ATMEL
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
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 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 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 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 ef7685d224d585b17739b69340b1cb70caacee02..91933301bb73268325f46152cefc358a279b732a 100644 (file)
@@ -33,7 +33,6 @@
 
 #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) {
@@ -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 ddf6b07dc9c78bbeb7480b28167621f903b210be..1b4e1d57afb1b402331d951a282359f4726aa6de 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);
index c2d3205bc592160a71658fa52156f1f517619492..a01f0efdae142f0327f1a1c0b5a5b9045892909e 100644 (file)
@@ -93,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.
  */
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 7edf0f69da1e0c36bc62781991344a5b7613ec7f..d1b648a4efbfde4ad325e1f136fab6d226fb2789 100644 (file)
@@ -659,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;
@@ -743,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;
@@ -783,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 4842ffe26705ee9c761f91c05872073d64825207..aa4322451e8b5dbe10cfd76cf58fff09b9384abf 100644 (file)
@@ -104,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)
@@ -112,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 20dd6e74e91d64c486fc8e3c886caa71a111a9f2..a0728c33e5d9e60de43b6f867b1efcfd61c1561f 100644 (file)
@@ -26,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
@@ -66,4 +67,5 @@ void __init omap2_init_common_hw(void)
 {
        omap2_mux_init();
        omap2_clk_init();
+       gpmc_init();
 }
index 4c5f2c04883ee0f7904b0ec7572fe113e9cd5aef..60ef084faffd04e8102ac9c3dbbc94d58b0cef2c 100644 (file)
@@ -52,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)
@@ -59,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 1d2f5ac2f69b8ec6d59f1bcaf41aeb53757e7816..cf78e6c5a2778a51b99f9f8d75c5c07f67b1ed6f 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          = SA_INTERRUPT | SA_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 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)
 
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);
 }
diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c
new file mode 100644 (file)
index 0000000..4ffff9e
--- /dev/null
@@ -0,0 +1,471 @@
+/*
+ *  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, SA_INTERRUPT | SA_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 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 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 7691cfdba56778d7f97768b66c243e66eb735dc2..7eac87f05180682ea45f3db06c0bdfe59e7739f1 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,42 @@ 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;
+       unsigned int cr = get_cr();
+
+       /*
+        * 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) && (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 +364,34 @@ 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);
+
+       /*
+        * 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);
+
+       if (!section_mapping)
+               vunmap(addr);
 }
 EXPORT_SYMBOL(__iounmap);
index b0242c6ea066a8850eb80e04cd72bc43ce150cbf..38769f5862bc4f0d414287bfdec754fdd431d2c7 100644 (file)
@@ -302,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] = {
@@ -327,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,
        }
@@ -375,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;
@@ -406,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 cc609666df059ed88b38035e8d0ff7af90e4410c..700297ae4a55c460f871be3389da3ec3ee52f651 100644 (file)
@@ -439,11 +439,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
@@ -455,12 +456,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
 
@@ -523,6 +521,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 117a946c28c8b1bb87593795b83e90b2dbf0cb76..0c33a5ed5a613adf7253badcf8b331f945ca34c1 100644 (file)
@@ -421,11 +421,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
@@ -437,12 +437,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
 
@@ -476,25 +473,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
@@ -505,6 +484,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 39b7c102180aac397d7810d4da70b1f117e02970..566a5565307241313e4b244bc133df0c7755b4da 100644 (file)
@@ -403,11 +403,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
@@ -420,12 +420,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
 
@@ -459,25 +456,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
@@ -488,6 +467,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 33e1ab8eb1d6eec93fe74451c06ba6534ee5284c..6ea76321d0df429741b8e968041303c58a58adfa 100644 (file)
@@ -398,11 +398,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
@@ -415,12 +415,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
 
@@ -455,25 +452,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
@@ -484,6 +463,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..0e6946ab6e5bbc5de65ea7a60a2b6ac68ee904f7 100644 (file)
@@ -169,11 +169,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 +183,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 +243,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 +268,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 6f0db29ab842867f78918609f280da3f8b61f413..4adb46b3a4e0d4f68b33c4c1f6979e4e59ae0d51 100644 (file)
@@ -390,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
 
@@ -404,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
 
@@ -443,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
@@ -472,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 1ad464cc7bcb6a1ca7ad9c850193e7e2df922231..571f082f0247e5c14b1201a695fdffe63ba8b7ba 100644 (file)
@@ -394,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
 
@@ -408,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
 
@@ -447,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
@@ -476,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 a55d56ce2264aa9c531b4c8a8f2684a97547bd6c..ad15f8503d51b9610bc7575b6254fc5f43f57f76 100644 (file)
@@ -454,11 +454,10 @@ __arm925_setup:
        mcr     p15, 7, r0, c15, c0, 0
 #endif
 
+       adr     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
@@ -471,12 +470,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
 
@@ -510,22 +506,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
@@ -536,6 +517,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 | \
@@ -555,6 +540,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 20275967663d36e01ee74a60bd7f998812f08ee5..1e89d40804743d16ca41a3788ad99bc242e6d20b 100644 (file)
@@ -403,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
@@ -420,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
 
@@ -459,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
@@ -491,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..e812246277cfbd31fe19b0d1361feb14568a7017 100644 (file)
@@ -185,11 +185,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 +200,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 +253,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..ba32cc6296a0d608475b573f8f3d1d85f546fc01 100644 (file)
@@ -198,11 +198,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 +212,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 +273,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 +296,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 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 c520e9dcdd8a43e9d283f89c9b3aacde26707fda..7f45c7c3e673d1898902fbac743de5e7cb655fd8 100644 (file)
@@ -27,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 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 ca486c9f36b508cf763765006486f8b9ac3bdac1..1812f237d12f9f0327531d73db6b302356847339 100644 (file)
@@ -104,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);
@@ -161,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,
        },
        {
@@ -190,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 2525633fcd09ca47224d098fa8825671007a3ca8..c2c05ef863488201988229c29ca0fc440f233fbc 100644 (file)
@@ -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 */
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 312ace515d170d93ac0ab10c774717ead09b4cae..cb0c21d384c066ec1441b346810355113dfa7bab 100644 (file)
@@ -536,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;
@@ -735,6 +778,8 @@ 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);
 
@@ -759,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
@@ -781,19 +830,54 @@ 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->disable_depth || d->running))) {
+                               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->disable_depth) {
+                                       /* Level triggered interrupts
+                                        * won't ever be reentered
+                                        */
+                                       BUG_ON(level_mask & irq_mask);
+                                       d->pending = 1;
+                               }
+                               continue;
+                       }
+                       d->running = 1;
                        desc_handle_irq(gpio_irq, d, regs);
+                       d->running = 0;
+                       if (unlikely(d->pending && !d->disable_depth)) {
+                               irq_mask = 1 <<
+                                       (gpio_irq - bank->virtual_irq_start);
+                               d->pending = 0;
+                               _enable_gpio_irqbank(bank, irq_mask, 1);
+                               retrigger |= irq_mask;
+                       }
                }
 
                if (cpu_is_omap24xx()) {
@@ -803,13 +887,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 72ce52ce815b4e64862f399dec841799dc8355cb..e75718301b0f460bc59ea9912905a5c0a34c6dc8 100644 (file)
@@ -157,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)
 {
@@ -184,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 053c18132ef44bc0b91d5340d37e4efa5e594798..ddf4360dea72ebf9ac0523791e1978bf0d4afaf8 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.
@@ -49,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;
 
@@ -78,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)
 
 /*
@@ -101,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);
 }
 
 /*
@@ -202,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)
@@ -268,9 +262,6 @@ static struct irqaction omap_32k_timer_irq = {
        .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
@@ -279,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);
 }
@@ -316,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 e08ba2955ec72539fb7efd0fde3e42f1ab98fbdf..d87d68b77d6678d97cbf2df175cca889b5e09123 100644 (file)
@@ -190,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;
@@ -201,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);
@@ -451,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.
@@ -471,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;
                }
@@ -526,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
  *
  */
 
@@ -542,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 718de9bed9500f27ce9a3acc0f80534c868ccc99..db63d75d0715927bda8d6379a63dcdb8dd224822 100644 (file)
@@ -205,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 25df4ada951afa4903ae436901e00ceb1f30044a..48fd801792d1dc2b79b7da8a7d9fd4744cf294d9 100644 (file)
@@ -937,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 fe65cb89f54c26119ab1bf80b05b329f06fcae57..9c22b76e129a32a18e49da042a675d23f8756ed2 100644 (file)
@@ -251,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 113bdff4fd3c58378fa662b01897d9a5a0b98933..00e9167de530911e5492afe6cdcc01e4f57792ad 100644 (file)
@@ -744,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 82d44c9afc1ecc2c8049606b6bdca175b324cc74..420a5312ed039ff451e73939a7dc25ddaf5a5859 100644 (file)
@@ -119,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");
 
index caaa86bd5e87292976ad88b046d2771602f862c2..5daeb6f7f3b7be5cc44fe2abe9c27ad71c171439 100644 (file)
@@ -981,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 e2d2b3fdb5b1c407c2fd5941e96f7f9f50246319..cc361bf578aef8ae4907491b87ec265f9b5c3c30 100644 (file)
@@ -268,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 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 4bac1d6c37fb6ea617ea640256890fb1fb398bb9..50f3f93293d64d33c8b1183a6971faf68eca0912 100644 (file)
@@ -241,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 1f9099627a725fa58b7bfd76c6eb134eddc1aaad..903ea62c6e21b6ac5fa6ed899cba5c5c261b6015 100644 (file)
@@ -85,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 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 5920f52bf9c824b630741b286a73e8e9f999bf6e..08967010be04a5c702ad1d42e9e96e6df47534a3 100644 (file)
@@ -341,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
  *
  */
 
@@ -365,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]);
@@ -576,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.
@@ -592,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 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 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 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 5e70c2fb273ae0a814f7148f61522a6f9040e02f..cbc1184e947386fcf712a7846120879eda63e918 100644 (file)
@@ -38,6 +38,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 50eb0e03777e4b1a7f0fe564f507b6ccfe358f18..7b421b3a053e0ce8827410566a601b7050a7ff76 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;
@@ -328,6 +330,8 @@ void alternatives_smp_switch(int smp)
        spin_unlock_irqrestore(&smp_alt, flags);
 }
 
+#endif
+
 void __init alternative_instructions(void)
 {
        if (no_replacement) {
@@ -349,6 +353,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 +375,5 @@ void __init alternative_instructions(void)
                                            _text, _etext);
                alternatives_smp_switch(0);
        }
+#endif
 }
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 77c8c83815c1eedf43f76f6b2e2897d316c6eabd..c511705c386cc6b251b6c3707864b356155a04bd 100644 (file)
@@ -79,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 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 9da9ef09068d782933de31c453fca9e30fd756f6..cfa16c151c8f96a298f318106424b84a0194c678 100644 (file)
@@ -40,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 dc5d8979cd647b11f2a48dac27ef7ef70a4c7188..89e8486aac3499f3f39b35f5268df100b95285ad 100644 (file)
@@ -725,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 bdb4896c56e6ca002ac4e247a74255f171ed728f..4a8995c9c76204a1d52636884c758dc9e75bebd1 100644 (file)
@@ -864,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 33a3bbc8f67fbffaedd70e693768f0ae89101f48..0daacc20ed36e26c8600176b5332a5ce4a65b10f 100644 (file)
@@ -46,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 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.
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 3e6fcb056bcb7d71dac5c557d2067a6af2f2d6a7..a041367f043bb8324ea854adcb9d0c801cd41597 100644 (file)
@@ -235,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 584df17728451c9abb7b1c80a3041229ed009f2c..eb8e8dc5ac8ebae770468caae99b323618b441d5 100644 (file)
@@ -1457,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 92b815d13418fcbbdcc120a4c63cf0c12f9359ea..c7ccd6ee1ddfe57d7668794098e716bc77192189 100644 (file)
@@ -6439,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 71ccddabc715400bc1b8d22d4508657225e7b361..6928ef0d64d852abc4a41b7ff5cfc2e1f14d5249 100644 (file)
@@ -231,7 +231,7 @@ ia64_init_itm (void)
 
 static struct irqaction timer_irqaction = {
        .handler =      timer_interrupt,
-       .flags =        SA_INTERRUPT,
+       .flags =        IRQF_DISABLED,
        .name =         "timer"
 };
 
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 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 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 efff6f5151df28f7c693e0059f9c5c7ae6a9008c..ded0be07a476f62aca9f42ed17ea3f757f0453f0 100644 (file)
@@ -237,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 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 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 e969f0477640381fcd20543a3cab6bfd6889e0f6..b33e37fb7b0e4eb88a78bfdfb282be42c1c9e61c 100644 (file)
@@ -192,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 994c893df1a4ede27b3acc3e2210e62762ae6a34..9dc5688f71b54040ce80daf6ea95357773b874bd 100644 (file)
@@ -48,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 c3a9755c2d1f2e6398d07dd849eb1909761d53fa..24781f009337ae69a4b7e33e10b1697daf2edd50 100644 (file)
@@ -61,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
@@ -125,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 69cabb7463ff5db5b343563f54f18e00dd065c6f..98244d51c15453c2f60ea5b0e450b2f087272450 100644 (file)
@@ -892,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 c0d56c130a59b8b5356654c8f037a870777ace32..29d6f8178badd55c4fc745cd37d2702f487ddc75 100644 (file)
@@ -309,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 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 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 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 c64a7723cafb35c12b9c375d41918e7218df0bc1..d837b26fbe517e5602be5aec2ae5cb4d3b4ff244 100644 (file)
@@ -77,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 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 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 c2b1fcf6024ffc8ed902c3f55f6ca1cd5503634e..2393c11d5a207fe530446024cce4ae17944a728c 100644 (file)
@@ -579,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 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 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 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 047457f3b97a36434effdb25fccefdefff044006..9fb2493fff02494c0bb8789d4e273f5ac786c4c4 100644 (file)
@@ -173,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 388a4df7304029bb6ff836ddc3086de605baa0ae..8aca317d462423e69bc38f890b98f1acacdd2f2b 100644 (file)
@@ -219,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 aee567dc372ae5046487a77082a690700f2bbecc..2d8762818d95f33a50b4073685fe77e6e6d01b9b 100644 (file)
@@ -272,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 a94e4c785805700648fcc3e192d672103af6f5ba..597ec73359b70ebda688f6f36517827fc3d334dc 100644 (file)
@@ -118,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 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 ee943cb1328cef6b27800141ffdcc93cdfd44710..ec0a0de3083d0c2ed7e3f9e858de07e6d87ac4f2 100644 (file)
@@ -337,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 52761d96f991a0aba0bd05ad61b7d90c041b0e35..5b8803cc3d69498c1bc916cee4bfd4467d14b61f 100644 (file)
@@ -366,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 b64602a99d8972f92ede87f71007ca00ef30f5f7..f2b96f1e0da75f731e9ae628b1db605cb755cd43 100644 (file)
@@ -27,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);
 
@@ -417,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
 
index 880c8083d16f5e19a093e48504dafaa2273e6be1..22da1335445a03ae2914b8f1adbbca472fce5459 100644 (file)
@@ -304,11 +304,11 @@ 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
+       /* IPIs are marked IRQF_DISABLED 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);
+       request_irq(irq, iic_ipi_action, IRQF_DISABLED, name, NULL);
 }
 
 void iic_request_IPIs(void)
index b306723abb87ba2f07f3169cfed713e54dc9e152..656c1ef5f4ad9a651ff4c21251c6a500f2634884 100644 (file)
@@ -274,19 +274,19 @@ spu_request_irqs(struct spu *spu)
 
        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);
+                spu_irq_class_0, IRQF_DISABLED, 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);
+                spu_irq_class_1, IRQF_DISABLED, spu->irq_c1, spu);
        if (ret)
                goto out1;
 
        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);
+                spu_irq_class_2, IRQF_DISABLED, spu->irq_c2, spu);
        if (ret)
                goto out2;
        goto out;
index 532bce57c0dce9030f52fae9d4f587fa1dcd74ea..c9b09a9e6050ef52ec5e495173f7b53a4155c785 100644 (file)
@@ -381,7 +381,7 @@ 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",
 };
index 63affcb24219b6c23e17e4442593b8c1d8c2090b..827b7121ffb84a8d0f038f98a7fe7245b0e841e7 100644 (file)
@@ -377,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 4d935d0817f2247eb1000fd0cb46fcc54b4aa5cd..2ffebe31cb2dfe9a22fe062a320b05473f608e25 100644 (file)
@@ -59,7 +59,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
 
@@ -586,9 +586,12 @@ void xics_request_IPIs(void)
 {
        virt_irq_to_real_map[XICS_IPI] = XICS_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);
+       /*
+        * IPIs are marked IRQF_DISABLED as they must run with irqs
+        * disabled
+        */
+       request_irq(irq_offset_up(XICS_IPI), xics_ipi_action,
+                   IRQF_DISABLED, "IPI", NULL);
        get_irq_desc(irq_offset_up(XICS_IPI))->status |= IRQ_PER_CPU;
 }
 #endif
index 2bff30f6d6357aa4b44a8bba2ae7ec17d2d17fcd..1a3ef1ab9d6e686f74298d0b0676a6d9d1f46270 100644 (file)
@@ -167,7 +167,7 @@ static struct resource pic_edgectrl_iores = {
 
 static struct irqaction i8259_irqaction = {
        .handler = no_action,
-       .flags = SA_INTERRUPT,
+       .flags = IRQF_DISABLED,
        .mask = CPU_MASK_NONE,
        .name = "82c59 secondary cascade",
 };
index 63ff89575cbb8b6e71c6b62438496b0216478885..7e469358895f8c8c2762b81b1c33e7ae1fac40e5 100644 (file)
@@ -540,7 +540,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);
@@ -1027,14 +1027,17 @@ void mpic_request_ipis(void)
        
        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,
+       /*
+        * IPIs are marked IRQF_DISABLED as they must run with irqs
+        * disabled
+        */
+       request_irq(mpic->ipi_offset+0, mpic_ipi_action, IRQF_DISABLED,
                    "IPI0 (call function)", mpic);
-       request_irq(mpic->ipi_offset+1, mpic_ipi_action, SA_INTERRUPT,
+       request_irq(mpic->ipi_offset+1, mpic_ipi_action, IRQF_DISABLED,
                   "IPI1 (reschedule)", mpic);
-       request_irq(mpic->ipi_offset+2, mpic_ipi_action, SA_INTERRUPT,
+       request_irq(mpic->ipi_offset+2, mpic_ipi_action, IRQF_DISABLED,
                   "IPI2 (unused)", mpic);
-       request_irq(mpic->ipi_offset+3, mpic_ipi_action, SA_INTERRUPT,
+       request_irq(mpic->ipi_offset+3, mpic_ipi_action, IRQF_DISABLED,
                   "IPI3 (debugger break)", mpic);
 
        printk("IPIs requested... \n");
index cd5f3faa4b20398e0a9bc58e5edcc60273a4576c..e347fe88316d4b375fd67a8bf4505da0ec8dda7d 100644 (file)
@@ -2116,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 026ace3207291e6301f1620bfc5d45c195c0beba..d90cd24d018e4e70f0f7df7a526cbdcd83f22d29 100644 (file)
@@ -131,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 139cf0d00855dd0333f5854fb3a8d005579f02ec..75204588a3e75f6935ba4c622d39fdba383e82e2 100644 (file)
@@ -136,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 224612412cbecca561598942d28f602eadf499d3..495aa79bb3a1d90a0061c9eb9719a24eafea805d 100644 (file)
@@ -166,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 1c90f113cc8f8b0b5314c02c8d6bda1ddd6c8132..189ed4175f9fb2dbb5bededc6e880fe9c0f2b71a 100644 (file)
@@ -190,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 71af4b4886214139ed5b71d5539fe3196b763a12..e0f112a1fd0b4926675cfc1d4eae7421e341dba4 100644 (file)
@@ -837,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) {
@@ -857,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 97d6c21091e0f127844e4487ecefaa3137209eca..3bb530af029774b865849e24d5fee27c8fe83a11 100644 (file)
@@ -1310,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 8cff1e3033499a56c3502ad7038ac91a8ee1a917..60b769c7f3fc97eb6ec62c6b3ca670e16ae82e0f 100644 (file)
@@ -145,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 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);
 
index 0440d8f4ce16fedc5582b947f2371576224fc6e4..4b77e6c8c87f9430cf0bb7775d9911de97fa0784 100644 (file)
@@ -149,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 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 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 08973663fa245a9e3d31194e3d2c72a3a106ff15..aa0b957887056a90a701cc192290c55f21f5dc1d 100644 (file)
@@ -575,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++ )
@@ -691,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 1a434a7004ee4f5432d37e8019c03d31e8265d26..d8948c342caf554aff4b657ce41363e415f8e8da 100644 (file)
@@ -228,8 +228,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)
@@ -330,9 +331,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)
@@ -1009,6 +1011,7 @@ cleanup_io_leave_insn:
 .Ltrace:       .long  syscall_trace
 .Lvfork:       .long  sys_vfork
 .Lschedtail:   .long  schedule_tail
+.Lsysc_table:  .long  sys_call_table
 
 .Lcritical_start:
                .long  __critical_start + 0x80000000
@@ -1017,8 +1020,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 edad607716733fcfba5c6538ae1f1a03cdd44c30..1ca499fa54b4b3c71cbff168b68eeaac08e23df0 100644 (file)
@@ -991,6 +991,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 81dce185f8361b2d695e1f56c5101d8bde49b17e..eb6ebfef134ae8b710def114b33533507e62a673 100644 (file)
@@ -23,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>
@@ -33,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);
 
@@ -89,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
@@ -116,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 */
        
@@ -143,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);
@@ -175,6 +173,7 @@ void __init paging_init(void)
 }
 
 #else /* CONFIG_64BIT */
+
 void __init paging_init(void)
 {
         pgd_t * pg_dir;
@@ -186,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;
@@ -231,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;
@@ -282,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 046b896d04f9e8c29023188b2b7863591e05a867..f1f7c70c9402d61384776b0c3ba7927729771d45 100644 (file)
@@ -50,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 9b361a91a1a6b0157ef1d12da2760a6a84cf6142..ad126016720ff227438c356b0a2398a2564756fe 100644 (file)
@@ -133,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 b2b0aa48a3a7fa34fab4aa3c1191a4b194921991..d2b2851bc44bcf702ba21c35ca282841401b2b02 100644 (file)
@@ -153,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 6a74464dab2deaa787c32c1b0208e51862c79ac2..0dc1fb8f9687626a71d6e1905bd52dc049c9e1a3 100644 (file)
@@ -165,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 fecd8f8d0466697b57c1e24f8418c0bb74dc9ffe..e028a2d2a4eac949d362f1fa7bfec19dc722896d 100644 (file)
@@ -90,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)
@@ -258,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 21f3017e5c281844a695748e63f6339968bbf77d..7c81b8b65bb505cbcaf58fad69364ee148cbc434 100644 (file)
@@ -447,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 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 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 3c04951ff736ba052989fbd8a57bf1525d8dc954..9dae689b6a9b0da641a9283c3a7ad749dc9a28d3 100644 (file)
@@ -473,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 ba9eb992f4a5b56cfc7f48338e90df79be1ebdb0..b8162e59030e447c6fcc1d12cdb0c59e15ce34e6 100644 (file)
@@ -484,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 cac94219dd5f70bc63fd639c2cab3ae8272520dd..228ce61c3515caf94191fc4542ec9c02e41f6fcf 100644 (file)
@@ -44,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 b81af076ef4828fc59e4b630369cafa867baee07..cde73327ca962b906cee82d0b40c6d1c09f63ecb 100644 (file)
@@ -191,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');
@@ -243,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;
        }
@@ -395,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. */
@@ -497,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 22422ff1060299ba7bd1e839d0d880a2f7dccbb8..bfd31aac2df3b2c7992f082fd08b9f5ba78da4c2 100644 (file)
@@ -745,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 50e988b9c8c3fae65d61abbe80fac21a8edb4c34..4be2c86ea540a5918bc71460f1c49331c2bfb586 100644 (file)
@@ -179,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 cbf8ee81cf5b3bef136ff38138317a7224bc7468..74eed9775ac04f32a1d7fba2c387638a5485bacb 100644 (file)
@@ -107,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;
@@ -160,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;
        }
@@ -298,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;
@@ -490,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 38ac672b1149b345607c910c30e01f3ba796b460..7cefa301efea61f3f0a84f5d12d074b2fc526a50 100644 (file)
@@ -278,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 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 a1023bb1a217fac630e8f779e9efa35f63c2b600..8a9b470e1b651883ca6023313295a94775d78566 100644 (file)
@@ -140,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 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 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 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 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 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 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;
index 820fa3615a3f7640a7e603b7517f31ae92cc5084..d7e044b5e5eec9d6f6e6c64f1b670102b80331e7 100644 (file)
@@ -195,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 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 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 df7027d854375cad745b4b4337757dd688eaa7c3..3be355a029e27766c21f823661b435a524d06277 100644 (file)
@@ -263,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 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 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 aeb9c560be88aef2fd7141c792221ed85f92266e..819e84ec5b64c4f6dafa88a154510a370b8a3cc5 100644 (file)
@@ -35,6 +35,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
 
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 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 72f140f81b70bfdc0d8b570b4be21a56557ee86c..d14fb2dfbfc4a742b399882482a877b9c2db9428 100644 (file)
@@ -678,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 4a2c365ba68464d32c03a4c6aa1c10c2e5b431d4..412ab32de391788de830fe5786adffe2ac3ca854 100644 (file)
@@ -52,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 d9c9a35961b34cfc6cccb132127d7e7d69cf7150..3dd6b7bb5d35937e1cfa3082e3e612c9c95ca9e4 100644 (file)
@@ -1278,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 dec044c04273de93a76ba97b2cbf8d227272a83a..ea5a0496a4fd9a63531dd1665975b44d810b0dbb 100644 (file)
@@ -192,7 +192,7 @@ int acpi_bus_set_power(acpi_handle handle, int state)
        /* Make sure this is a valid target state */
 
        if (!device->flags.power_manageable) {
-               printk(KERN_DEBUG "Device `[%s]is not power manageable",
+               printk(KERN_DEBUG "Device `[%s]is not power manageable",
                                device->kobj.name);
                return -ENODEV;
        }
index 5dd2ed11a38755a57dd27685fa783549bcfa5d80..5a468e2779aecf5c167e7ee4c8e433a965f43fb3 100644 (file)
@@ -280,7 +280,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;
        }
index 4048681f36d503ca2030d0954311ce97327cc183..d3b426313a41b57248aab4e1ff05cdfa9f3978c9 100644 (file)
@@ -2286,7 +2286,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 976ced1f019e511bce61bf16da8b1b3c8e068ba7..df359a6c14f6ab57a140c62bed4d6b274595f674 100644 (file)
@@ -1797,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 9be9a4055199659e1f6130e335a81b21d01ab0a6..98622130de5b65d9573d7d18856115d9579c7c52 100644 (file)
@@ -2123,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 a5cbd3d6e50f2680c98adb489619c857f1fcf076..d369130f423555bd2fde66ef09ddafe32abcaec4 100644 (file)
@@ -1007,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 8fdb30116f995962a67ca7a32e41a3167fb47c94..5d1c6c95262c780dd732e3fbd097e09238944a15 100644 (file)
@@ -3386,7 +3386,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);
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 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 b78612d3fa46ce64d52a8c72bb9ed19d75caac67..b8036899e56f467d18284dfa3ac852995d450069 100644 (file)
@@ -625,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 1699c934bad0d8baeb93b2dc53916f6a4bc43e46..2c65e82f0d6b855310cb8e4e95a8a5c8c27a47bb 100644 (file)
@@ -1270,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 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 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 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 aef5a0ccabc9a045ee2417c4b993cca9b10e8728..5537974fb2424603c89983ba9643b2aabab13015 100644 (file)
@@ -340,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 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 f675f97f2a7864469bf715d7cf140f1f0034969e..5d8925bd90454c68d33d00d3263e93dac09b91df 100644 (file)
@@ -1040,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 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 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 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 3e7dc7cbd74014d8983f24a961bdc5dc0cac8ca8..9d6713a93ed74ddb74adaf18aa85fd22e0ee6508 100644 (file)
@@ -2051,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..bcc4668835b5b11065256ba8a177f865a2f5dfe8 100644 (file)
@@ -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 1f61a6744a269f4f02ad5e4fd82dbe1f0fa5919b..c1c67281750da61ef1750706bb8351e780cb3e43 100644 (file)
@@ -4612,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);
@@ -4785,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);
@@ -4965,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);
@@ -5059,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 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 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 8b6c76f8ef0e8178de8664fcb26a470ef1867594..e5643f3aa73fdc33bb51cd7472fa8dd466339e2a 100644 (file)
@@ -395,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);
index 859e5005c785ae8cf23c49be41c9ed3cc4272a6f..ca2f538e549e3fe6e87a3a850d3961e9b06ffeb9 100644 (file)
@@ -346,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..8dc205b275e3119450e6699ed34c76f37ba57ec9 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);
index f9aa53c76f9911de2bbc50f92f218858c78ae9b7..a4200a2b081129850c101bd50674842533a6e87d 100644 (file)
@@ -491,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
 
@@ -753,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 c7f3e5c806668cb2d6828c6c774442279abe96ce..f57eba0bf253553135c1cd62495664baa46d6dae 100644 (file)
@@ -1041,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)
@@ -1051,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 c105b9540ad8e1a054c188a4805b27c7d8f03175..913be23e0a2427e16b07ae6e422ba9e8632bf7ea 100644 (file)
@@ -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 d1ed6ac950d1208891188d1972530262d46c85d9..747ba45e50e54664ff607be60a041f5e895b870d 100644 (file)
@@ -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 bb07c2766b27e6875bb8ba9b9ee7308440825e0f..0385650f6077892843b966f3c68018c254a46492 100644 (file)
@@ -592,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;
@@ -608,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);
@@ -628,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 95e8122b8068d47bd617fdc7726b78eafffbdb7c..70b774ff5aa411363c646546b67f5ea8338520a0 100644 (file)
@@ -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 eb1559fcb81a0270bd8fbdc994f08b4e515c5cd1..556abd3e0d0735e93ce55415fdf3c14834f69ba6 100644 (file)
@@ -94,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 94845dd12ca90230c31f5a29a3b5b6e6fa919b78..f240a104d250e6f14e70ca5fdfd4eb9f2dd4bf74 100644 (file)
@@ -223,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 1087530e58549ba6d3b60c0b636875d21332218e..9d134e98d2a0daa347ca72259579ddb7333b2083 100644 (file)
@@ -144,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 5332d1d4b0e4774c0657123c60462af9fc4fb09d..3afc6a47ebbcc71e3e2f2a1d5221cd362918b9fd 100644 (file)
@@ -1119,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 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 37dc2edd8d755ba6403851dabcfa7398bc583bbd..aefac4ac0bf5841a6a6d928e578d73e351236066 100644 (file)
@@ -220,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
@@ -958,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;
        }
@@ -976,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 56c8243cdb734b2d9212ec1eed9643560e82864b..203240b6c08f3fb60c962b4cb4c2ecb3e81524d4 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);
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 e19d4856e9fc0b07d5ee92e4e0ddc054df28e0df..45508a039508e56a4bb42740fddae6924f8c2b15 100644 (file)
@@ -1282,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 d4243fb80815621dcf1c8a439439abf2554792c3..cb2859249d49a9171899db66f9661f36fdcfdb90 100644 (file)
@@ -1015,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 f15df0e423e0f143e17ddbc4d5518bd0870c4770..ed7b8eaf0367416c0675d93832a52b9469531196 100644 (file)
@@ -2302,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;
@@ -2512,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..45c193aa11db37aeabb51742ef4d49ce12ca75a2 100644 (file)
@@ -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 03edccc8a82338cac5b5ba6b7b8e7d0b3c115fd2..e829594195c1d836c6dca220c74e47939a5f45ec 100644 (file)
@@ -3343,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 ba54df3cf60a6cbcf4222bc30085b9af8edf2763..1e443a233f5102e3eef924ef0cb114e82b6f8f43 100644 (file)
@@ -3835,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 dfc4437afefb8b5ee97dcd53ec062231232f9b7f..952b829e2cb48e6522a3a1a235eb70391acf5a9c 100644 (file)
@@ -208,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;
index 8ea70625f7ea08bbf2714933cf2e58acd1da44bf..abb0f2aeae66317fb94953ba3ba9a742ac87cb89 100644 (file)
@@ -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 b17a6e2bbca89a04f32cc800ba55f185048554d2..bfe5ea948f6a51a4acb6687efe4f45ab05d441ff 100644 (file)
@@ -203,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);
@@ -230,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);
@@ -273,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);
@@ -300,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);
 
        {
@@ -341,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);
@@ -368,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 e89cda010b498e6bc0780c99317b3c7a48424e5a..ea670de4fab795cc3782a1d1bdb5c7804a841c49 100644 (file)
@@ -420,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 9c11d920add543e585560c39490465b649b5e22d..c2d492c852fcfa69cf0a1a7c2343e76ff1481ea9 100644 (file)
@@ -355,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 2586e9e858e28285243fb3c57571b37333bca340..a1d972c8f44cf4929b677601f3324b572abf74d2 100644 (file)
@@ -580,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 c79cc9543d96b22d2ae980e45e732e818a32974a..7529ecdbabae1d8a479bff308a5fb24516ee4eca 100644 (file)
@@ -617,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 2801d14a5e42e0c193cd143397124a209970d951..ecad8f65d2d416faf2f66d38bafe8220230d24a6 100644 (file)
@@ -739,7 +739,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;
index d75864e35fef33edcba22a26f7bfcb3b2d07a614..f79f6b587bfa740383bb9f7dfe0616a4b6f0b099 100644 (file)
@@ -19,8 +19,8 @@
 #include <linux/slab.h>
 #include "edac_mc.h"
 
-#define AMD76X_REVISION        " Ver: 2.0.0 "  __DATE__
-
+#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)
index 815c3eb783de8297a186ecee94f356750d65089d..c82bc0ed7f143113fcea830717b60f388a46b3dd 100644 (file)
@@ -24,7 +24,8 @@
 #include <linux/slab.h>
 #include "edac_mc.h"
 
-#define E752X_REVISION " Ver: 2.0.0 " __DATE__
+#define E752X_REVISION " Ver: 2.0.1 " __DATE__
+#define EDAC_MOD_STR   "e752x_edac"
 
 static int force_function_unhide;
 
index 5a5ecd5a040977f4faabe78ebefaa49b56c7a968..310d91b41c96154bf0ba8154b5b017f126a441d1 100644 (file)
@@ -29,7 +29,8 @@
 #include <linux/slab.h>
 #include "edac_mc.h"
 
-#define        E7XXX_REVISION " Ver: 2.0.0 " __DATE__
+#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)
index 1be4947e28af6a3ce20cb6b5b79f0c0c2458ac6d..bf6ab8a8d5ed8700dce391de101a03b60ee72987 100644 (file)
@@ -78,10 +78,6 @@ 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, \
index e30a4a2eaf38bddf6a6b1f4d67497caf5ca5133c..e4bb298e613f4aea9a84d3320bfaa2fb21122d73 100644 (file)
@@ -16,7 +16,8 @@
 #include <linux/slab.h>
 #include "edac_mc.h"
 
-#define  I82860_REVISION " Ver: 2.0.0 " __DATE__
+#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)
index 9423ee5e7edd2140f8dc3e9b947047186aa6bbad..161fe09a6d3871200dd353b272b6b70f3413c9c9 100644 (file)
@@ -20,7 +20,8 @@
 #include <linux/slab.h>
 #include "edac_mc.h"
 
-#define I82875P_REVISION       " Ver: 2.0.0 " __DATE__
+#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)
index a0e248d11ed9a8b674a124c8387a170dd06d82e1..a49cf0a39398a4476e37c7105c02b6a3123daee4 100644 (file)
@@ -22,7 +22,8 @@
 #include <linux/slab.h>
 #include "edac_mc.h"
 
-#define R82600_REVISION        " Ver: 2.0.0 " __DATE__
+#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)
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 de93601de1785fbe6030e4314785269d9f43968f..377ab40944b8d3cbecfc02ab3c0fe1fb7673ec7c 100644 (file)
@@ -318,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 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 512b8791c3280d0f791f11b0174e75a681aae126..5d2950e91fc5fce62a6e3566791abcf2b1738d4c 100644 (file)
@@ -828,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 b638ac6e59f45121f4b9898bc0840be44b3f3691..f92505b94c61fb80b2907faacbfe1419df66d05b 100644 (file)
@@ -908,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;
 
@@ -1578,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 e27ee12245d39d88e40e035629dbc540d2e48bb2..e7e27049fbfa2d6ff350a040b00b1c4d633ffad7 100644 (file)
@@ -521,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;
@@ -536,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;
@@ -544,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 c5f71ac28d148638e3c3f57b164df42398344df0..9cadf0106c6c781d45a2add269b0b2961a1691aa 100644 (file)
@@ -1004,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.
@@ -1090,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 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 7fb3635683dce13d6785d881aa39c15b5c808632..3cb04424d351dcb9f88e0163a120ea103983b19c 100644 (file)
@@ -650,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 8de81ecd3ba6d6f02fcf47f9f75a36b2d5c0646b..d4bad6704bbe2dcf5d6f5ab6fcc4b0fd69f2080b 100644 (file)
@@ -3392,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 5b48f6ac5c7f074c68024b288707821b0ed7e5c7..e6f41238f5e8c6c2f579cb5de5ae1fe0d66ce224 100644 (file)
@@ -1253,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 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 97f142c5be13d75f6fad23f1be75d44b2083f8a1..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
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 5e31d0de849b1e8bd9a530a0760018c33084993b..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) {
                /*
@@ -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 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 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 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 22d02d53eb16a965a9087c8b20fb9326c0f0d905..cde036a92168150a8219a595437efe8c3cd8c0f1 100644 (file)
@@ -370,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 7fa4bc2225837dec57e6ef0b7da91d9e21453abd..06a3f25657dd29062455027e076cbab0c99165b5 100644 (file)
@@ -328,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;
        }
@@ -610,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 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 b3eaf23b17c82b2f77725a2765205a730b22c4bd..9b66271d3ba82feefd4104f59473b4c3f53f95cc 100644 (file)
@@ -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 7edf19b322998b9e5ad85edbb737a536fa739d14..90e2e6643d197abd44f499ed83efb4cc8a7eef0b 100644 (file)
@@ -97,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;
@@ -234,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 e7924a545d49e948da4afdf7dc281b4290fd8f0d..6c3d5f5f1f4bb40545b562e7689a6067da0bc0ea 100644 (file)
@@ -1172,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 af85511600d0b10fd87891e4cd70904c0bc02773..d1e253c94db4b751f353a58587f4378c0adc4666 100644 (file)
@@ -103,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 b05e35f7ccb18fc9df35841236b1f3da88f231bb..b7dadba13e828c325a358e0630cc1ff24f8c4e77 100644 (file)
@@ -486,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 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 93f3a5343a74eac355fe7f2202c2ad3108b8a243..04f5917bf5a14f7c58328c3fec48edf7a5f93f15 100644 (file)
@@ -808,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 de28cb54817dcb78c90e2276bad8b4c238d9c5b8..3cf1f2421789357caf588d3b3a4c882f2f0eacdc 100644 (file)
@@ -335,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 9d1abfb93dde5335061f4e51901ecb4f1bbdb4f7..15681f3e73b8b0b40a950d59e27d912afa69944d 100644 (file)
@@ -374,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 fbb9d02e3e2940216784201d75f8bd320f1ccefb..323a02ef38441b8a1f3c57a77183b6aca258f30e 100644 (file)
@@ -1076,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 7a5cdb1dee1ea5299eacba869c9d0367bfbb6f3f..3b3e318f6076ebf059ef61291400de58f8b5a15f 100644 (file)
@@ -85,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 */
@@ -102,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
 
@@ -259,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
@@ -334,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);
@@ -685,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);
@@ -693,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);
@@ -1012,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],
@@ -1061,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 5f48761846912a6fcc1c3e0055cee6bd16e2c83f..8fcbe2e7d765bb3b47a053eec74ddb8aa96d7072 100644 (file)
@@ -405,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 82a1d2e86ceea242407f4182a291b46eac9f501f..3e7d923035824bd8b7f01aed7343ef807cb8211d 100644 (file)
@@ -592,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 913fd27a1f5599dad07b5785ad4750e76fe93538..0f967b3df79dac9083d0f7634d2022bbfd471692 100644 (file)
@@ -1552,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 fa9615747e26aa1fd7b823508403b8bf6f1e7db7..7241e73879ba197d31ee130787189b8f89899a33 100644 (file)
@@ -1732,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 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 868762cf76c6ebf3aa1eb88761106c1747900020..79a97b1c381263d7ebc75602a3386ed8c422c765 100644 (file)
@@ -336,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 1b3ac46df52c96a51954da6122d3b3e36c005722..e5b900a6fa0b543db5da141037fe680657d46e0e 100644 (file)
@@ -271,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 7a6010eac60dd621efc498284a807849a029ab27..7002b09936d4efc848f2cb01596e8c245b88913c 100644 (file)
@@ -237,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 11ea456626b6eb53cbc70c803311133777ea24cc..8d8e8a299892381762140653beed8148dad2e175 100644 (file)
@@ -632,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;
@@ -809,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 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 a1bb73e288419f03b8acc4abf96345911ec2eb22..9382cdf04d8d94029ba1448821acd47485404614 100644 (file)
@@ -347,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 00e4fa2aef51f9cbfa36d3956bdf27a69ff700a2..6c68419c05ff928530bf631c47411698d8299c87 100644 (file)
@@ -1080,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 89fd531fbce622efbc42fe9808847dc6c844bb60..73afebdf80bdf868bb734517199c35b257698a3d 100644 (file)
@@ -435,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 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 d832e109b1b15cf0a1891c71066a73d663751ffd..40ae7b6a939da8c492afd1576d61ea24e89dac99 100644 (file)
@@ -427,10 +427,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
index 030130570e0a5da9ee35f3bfed2c5e4a97806415..ff6d9bfdc3d28aaf34ddeb4664ff17d989a09669 100644 (file)
@@ -555,7 +555,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);
@@ -565,7 +565,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 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 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 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 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 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 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 c538d99ec9f66024cfa6352d4c075586f49f84b8..2225d4b94140cb8f9079e751966ef4a3386b31d2 100644 (file)
@@ -1915,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);
index ddd62214bee5d92df37478c8d0220b23b4df38fb..e278753f8f25ad805fff678e32d21673d3bff674 100644 (file)
@@ -1881,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 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 535172f643b9273389427159ba7e1ee999300daa..6e97cc84ba8903c035ae3a6c605ddb35ab412391 100644 (file)
@@ -923,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);
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 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 33b32f3cf84e190eb5129e366ba13ab555e591eb..f2249ed25273bc5ded10a920e4891e587faf1c67 100644 (file)
@@ -1380,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 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 2544fc7af0f6fde84b1f0e2860c8ef7523c88ce0..57543603d6c806ac983e14289b107fda6769b37b 100644 (file)
@@ -1705,7 +1705,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,
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 6fe2ff5a63db08ebd859750bc31e6a202922328c..632bc218c86a0388328ff07c7b27ea336d892ff9 100644 (file)
@@ -508,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 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 075a2a07924e5394bf022b42702a43295840b814..6b7638b84290c0e91d4bc03e2be7328ee0388c64 100644 (file)
@@ -850,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 41069908f4a7ea301660c0e6953b20399cac2e9a..fb606165af3bb823ed5886fe2875faf545ac13fc 100644 (file)
@@ -886,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 9dfb34a857e3cb92865aef8715ee3f029473df20..1886562abdd40100956cc50b12962bd91bf484d3 100644 (file)
@@ -531,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 7a4840ec53b7e87d77ed535d3c01a0d02257b4fb..ddf06b32c159912f6b4213364c4f0bc294fd49d4 100644 (file)
@@ -60,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;
@@ -339,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++;
@@ -657,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;
        }
@@ -972,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) {
@@ -1002,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");
@@ -1031,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;
@@ -1056,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);
@@ -1085,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);
@@ -1099,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 8e9100bd57ef96596d9fd17884097f1da5b16f84..74134699cceeff096d3d6c7e857fca8ddcf29660 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;
+
 static const struct pci_device_id pci_ids[] __devinitdata = {
        /* handle any SD host controller */
        {PCI_DEVICE_CLASS((PCI_CLASS_SYSTEM_SDHCI << 8), 0xFFFF00)},
@@ -94,12 +92,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 +122,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 +187,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;
-
-       BUG_ON(!host->data);
+       int size;
 
-       if (host->num_sg == 0)
-               return;
+       DBG("PIO reading\n");
 
-       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 +284,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);
 
-       DBG("PIO transfer: %d bytes\n", bytes);
+               if (host->size == 0)
+                       break;
+
+               BUG_ON(host->num_sg == 0);
+       }
+
+       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 +383,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 +424,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);
        }
 
        /*
@@ -371,27 +469,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 +510,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 +567,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 +579,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 +600,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 +621,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 +707,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)
@@ -793,7 +922,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 +947,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 +1077,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 +1109,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 +1146,30 @@ 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 ((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 +1185,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 +1250,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 +1271,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 +1293,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 +1340,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 +1374,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 +1456,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 3fcd86c08ebd8fe2d224065e39038777ff2dd495..8a30ef3ae4191d52320516ae72b93c75f47a6aac 100644 (file)
@@ -1553,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 ac60f3f62db8edfb80ad399f7c920af1f8d88e20..4532b17e40ea04a9649baa2b197077a718dc8c04 100644 (file)
@@ -760,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 45125db44177810ff04f7ac255de0a29f3ed2d37..8ab03b4a885e5d0c4fa4b96832b3388f2d06a30b 100644 (file)
@@ -996,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;
@@ -1833,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;
        }
index 1d7af760c2b13b70ea57dacf9841f52d2d050eb5..1959654cbec8c06ee685f9a7b8fed7a3e61a2a59 100644 (file)
@@ -1203,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 d21e98f5adbc8039de6fcd2aef4e4a12e830f7c1..717506b2b13a5ab41b056ced8d277a8cbc532650 100644 (file)
@@ -1310,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 519390c033c3728ac6070ab543a1fec0d29e2086..f4ea62641acd59c41958bc96721051045f171bd3 100644 (file)
@@ -495,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 c290b5ae63b2093ea2a453f2e31b9bc5dc0de619..1c01e9b3d07c88cd2856232d268736ac77d87adc 100644 (file)
@@ -1194,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 c017c4f6b3b5a4c4b38445a7de1e204c93d2fdca..ed322a76980d760bd045630f0abdf2842d674a5b 100644 (file)
@@ -1376,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 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 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 7e32d4ea71e22ff27473091079c9472fd0335f92..4f4db5ae503b35a27fac24c4a5da51e4b966bc4e 100644 (file)
@@ -4260,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) {
@@ -4311,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 b89c7bb2c591a74ca700460d938183022018dece..d33130f647000d7f50c030df89d875feb7ff35f8 100644 (file)
@@ -4349,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 c490a862e79c029350dcfc765dfb89199ae8bca6..e67872433e9277bd1e778c3d1532710b53915015 100644 (file)
@@ -218,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 d3654fd71604408c3c4845ad515454cd8af94ef5..0eb1f8787ed740ddf72c9fc8e3f0c10e5f54e8c6 100644 (file)
@@ -671,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 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 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 29778055223bf8e838c7fa9ece389d6db1a63731..4b6ddb70f921b9ab734ba63c9aa9aea1295ffd47 100644 (file)
@@ -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 a1d676a0df7c62bfd71397ba10f50320317318dd..91ef5f2fd76883807eb23a5678fdff79014b6d50 100644 (file)
@@ -2063,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 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 1e2fbbbb966e3baa6956a17654d4d7962e5c0ecb..2ad327542927246ff70530be1653e6364e45089a 100644 (file)
@@ -977,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 b160abed8dd7ec1b14f014ddeea0c18dd998a6c8..9f3e09a3d88c8e5f9e50b5d95e4f692f4a9e6fc1 100644 (file)
@@ -713,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 21be4fa071b52b47a8e20f547e484a937db78dc9..3c90003f4230f0e8b61b2718ee2b1736f0f00f1f 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;
 
        }
index e96a93c94941c94ca56a89fe8284907c67f12db9..f6abff5846b35fd1ca5f3bccec6c62d639129bc6 100644 (file)
@@ -671,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 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 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 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 b9b10caa031cbd3cc75575e1d301e393a4e17ff0..df4b68142ac7b6dfdd1e43640ecfd83898f2f318 100644 (file)
@@ -1736,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 dd2f11c98530e4d5b8e39be445bec4d2c4007b31..f98f5777dfbb7807729e20c79651ee8c7291e1bb 100644 (file)
@@ -873,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 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 dbf67750d89918849298e82fb4e4b3cec4368ec0..68d8af7df08e31fe6e1bee61f7c495782ceba1ec 100644 (file)
@@ -1063,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 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 b9f28b14b3aee58877b872d8aedd3e7faca304b5..92d646cc9edcfc2e773332ce71b722b6be46b3c0 100644 (file)
@@ -1517,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 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 99229a0456d95b552ba3e5e80c3bb4bca19ef644..6eeb965b4d72b9214a3edddbfc52f6b8f7f21394 100644 (file)
@@ -235,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 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 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 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 19981065efb437507048c91b9eeac514f4604c3f..1b965a2b56e4fc22e0de85e5a9c2f0fbf60fe5ae 100644 (file)
@@ -1069,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 438c63f940b9a27e129005f445d179d92aaf78ce..9df2628be1e733add4e8b55e92217f52aa0583fa 100644 (file)
@@ -1574,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 deedd7b2af5d372bc6c581a5b68daa5b56e0e862..70429108c40d30e83f16c7d8fadb4e6a026480ea 100644 (file)
@@ -1881,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 978b95afc7216d6dc83c5af971b536085a14fe2d..3388ee1313ea33dc952bf8cefc2bb085b1f7ed09 100644 (file)
@@ -1075,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 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 44bcd3eb2b8370126407c1692cea340757e4cd56..7d5c2233c252fac78c386f6b6e3cc9bc4f21b88e 100644 (file)
@@ -556,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 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 757c542ac40a27da6a32a522f1be4a329407abf4..c3ed734cbe39cdabd5713c5c1e2214e9827b9513 100644 (file)
@@ -1252,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 001344c0763ed3eadba132cc37e6e6996145d0ef..c6b77acb35ef88ace82eb594e96adc6394cb1b4e 100644 (file)
@@ -3761,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);
@@ -3799,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",
index c7b5f0004e54fd5983ba135c0f8a183dfea21a0f..9ab1618e82a4a9e2a1ce1cfc0a39ec4bd921ceae 100644 (file)
@@ -2450,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 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 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 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 82df13be3d4070be79dbcb414f4a34db11e0d45a..82200bfaa8ed2bb5bef5ea7f959d1a183887f234 100644 (file)
@@ -3341,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 3f1b0fef13e7ca274b68a112f21bdd09af2c8b64..418f169a6a31e9f964964467b142e7691e7985ec 100644 (file)
@@ -3188,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);
@@ -3348,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 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 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 e0b72676922c14bf5131388b68fdf685b7b47299..fb1d5a8a45cf996c47623402b9a406dd7df8fa56 100644 (file)
@@ -1744,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 f91be95356a4bac7430bf48cf216126bb9ddf35c..ed1f59901ff4e08fff80d45b85ade4f0d277f24c 100644 (file)
@@ -1070,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 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 d85b83204f6b7c6acf0e534e207229ce980c5b16..8673fd4c08c7bfe76e5027a078d949a472fd0c78 100644 (file)
@@ -2194,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);
@@ -2608,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 5b0b60f4d20ecf452fcc2b7ecb82718ee8343fb2..1ef9fd39a79a9cfc3b1dacb6235088a0c0525e5d 100644 (file)
@@ -930,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 953255e926339b5509176a9bf339b39dc0e3afd3..e5e1b296293612e0dfccfc8bf169c1883484e408 100644 (file)
@@ -6702,12 +6702,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));
 }
@@ -6726,7 +6726,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;
 
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 77bb298129d7caa057a18198457caaef1468d997..465921e3874c933e7e114c71c7d1179b25ffabc5 100644 (file)
@@ -576,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 30dcdaebf41af52b2950467da70d519e5109a279..28d968ffd5d0ff37f6ed82fe67e0c23f40ee2844 100644 (file)
@@ -601,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 d7a30d99ae8fcaaad679e3aab0288f9e0a777d31..85831484bc40ce9914572d7d3525a103e2bb137b 100644 (file)
@@ -445,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 f2807ab5a2be17185f70b3770149d1c399def940..cd2e0251e2bc387c910622d2e0ee25e73690bc6d 100644 (file)
@@ -531,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;
        }
@@ -1061,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 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 354294c6271e1513d9acae610797fe8de36d00e7..d05c5aa254eeb1163ffcc80c438a79072f20b22b 100644 (file)
@@ -1371,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 2647a5bc52113cc58960753ab09ca7a642bf686a..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
@@ -1319,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 8f4f4840fc12fb657f7424c3d762bad43a4582c8..7351831f57cec5f96c9687515c017a2e51d33b00 100644 (file)
@@ -489,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);
@@ -1770,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 aecafdabbc91a459db7d20a875ba559855ed0401..091ebb7a62f6013e12253e5b3855b7d3a4c6fd91 100644 (file)
@@ -807,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 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 857d71c3c017de3058b028b1fa9ed167db12d5dc..ba2972ba3757c30e5977bfdcb442450bfb1bde19 100644 (file)
@@ -1750,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 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 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 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 f2d071272ceed554304d13801f635671024d62c2..fc75bec19029d6372c65a48d0a9cda92cb1a15bb 100644 (file)
@@ -1192,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 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 89328d119efa5662e37551d18a09a664757d2f64..a4dd1394271446192ccf51a26a82d70c4d0bf042 100644 (file)
@@ -2848,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 54e31fa2d402be390e2fc536fe7892aeba8ac785..995c7bea5897e9727ad66275eafd048658ec570f 100644 (file)
@@ -1577,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 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 5ea8ac835857821e5f5e16729caff0db3cfb7ec4..c2fa011be291d90c32f1e6d9a4ec70ba3f951847 100644 (file)
@@ -337,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 4ee6abbc65ecfe4108c88b7abec4a34723ad441b..49860fa61c307f0cea50df9e031ca485d10222e7 100644 (file)
@@ -550,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 27f744e43095d3c199b9a2097edcaf53244c1711..e955db435b30b4ef9e2c87106790ada253582fa6 100644 (file)
@@ -6229,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 4597fe1d19797a5ee3adb9deebcf0601ef65b367..bf05b907747eaae6e1f7ce03ec12584b465371e9 100644 (file)
@@ -198,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 de3eae082a0dd4ebb4ef7f91763b792cda4bb5f2..1759c543fbee9bc6da6ed8bc2572cd765edc12e5 100644 (file)
@@ -153,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 3f928b8939f03c15758928c9d7aa0466e3cc1102..7f006f6241711d0d6ad52e013d976e7284219b70 100644 (file)
@@ -237,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 160a642185f0fb92ec44717a0c349e6bd4f2ef05..0831721e4d6ccf38e5e5052190cd09d41e4df8d7 100644 (file)
@@ -139,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 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 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 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 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 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 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 30d87143b5d93393bb83a787d89c3015ab28097a..d5df5871cfa200eb5cfb1c67408340c31eff82b3 100644 (file)
@@ -347,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 584f8538da13cc852427967e0a8f2ee8bb1d3fc4..1c12e9171097cba1de5dffb6f13ea605e9116d59 100644 (file)
@@ -35,7 +35,8 @@
 #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"
 
@@ -219,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 e6e171f77c344770f0b8124a4fce427f88580089..1fc259913b68448b5a0b7e798d0b68ca08ae57e8 100644 (file)
@@ -1188,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 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 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 5256342e8532ae263359bc39f86aa2eb44100bfd..40569f40e90e8f44d54968413c3dc166de45d620 100644 (file)
@@ -267,7 +267,7 @@ static int __init at91_cf_probe(struct platform_device *pdev)
 
        /* 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);
@@ -280,7 +280,7 @@ static int __init at91_cf_probe(struct platform_device *pdev)
         */
        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;
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 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 3281e519e71414a6d503f55a2f631fd9bd574856..7bf25b88ea314ffdc730d5fef834232aa1116980 100644 (file)
@@ -801,9 +801,9 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
        /* Decide what type of interrupt we are registering */
        type = 0;
        if (s->functions > 1)           /* All of this ought to be handled higher up */
-               type = SA_SHIRQ;
+               type = IRQF_SHARED;
        if (req->Attributes & IRQ_TYPE_DYNAMIC_SHARING)
-               type = SA_SHIRQ;
+               type = IRQF_SHARED;
 
 #ifdef CONFIG_PCMCIA_PROBE
        if (s->irq.AssignedIRQ != 0) {
@@ -845,7 +845,7 @@ 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 = SA_SHIRQ;
+               type = IRQF_SHARED;
                irq = s->pci_irq;
        }
 
@@ -855,7 +855,7 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
        }
 
        /* Make sure the fact the request type was overridden is passed back */
-       if (type == SA_SHIRQ && !(req->Attributes & IRQ_TYPE_DYNAMIC_SHARING)) {
+       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");
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 8ef3f91310d24cd94a1fa1ea7296a5afda36308b..ecaa132fa5924aefd4ef7b0e8d4dc2ee5bc6c0b7 100644 (file)
@@ -523,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 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 47e57602d5ea590809bd728834fdab64e365f3e2..1344746381e8dce0fb6020760956d083fb5815ac 100644 (file)
@@ -923,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;
        }
@@ -1172,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);
index e7cf6bec737ecf1d71e44102146a842370c1398b..5c8ec21e1086c71a0440508f6774098d9a504a35 100644 (file)
@@ -395,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 d51afbe014e56bcdb551d28f93beeb9d6755d41f..f5b9f187a9300bcac74143cd0b5c999c406608ed 100644 (file)
@@ -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 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 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 c9bd0335995d2ece51d021eeb05ed13c2de3bf37..c690c2b89e41ddf59abb611a3a7c2f43448bbed8 100644 (file)
@@ -1070,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);
@@ -4232,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 259b47ec4f540ccaf9a67fdeee6e1884cb26c0e1..16a12a3b7b2bc8e07db215d43bab05cc4093a4e6 100644 (file)
@@ -1844,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 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 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 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 537136457ea02b022b1c3c4633f7f264051c0063..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.
 
@@ -5202,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 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 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 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 1b9900b5895642cfaa75955c47a81572cbcd3b9b..7621e3fa37b15fb96333eea7ed6cd2e6b89948b1 100644 (file)
@@ -3030,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 3ee4d4d3f445612ecc3556eac2c07eb62b20cf63..412f8301b757d8bdb916939188f24e5a863b9e02 100644 (file)
@@ -2751,7 +2751,7 @@ flash_ok_880:
                        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;
                }
@@ -2822,7 +2822,7 @@ flash_ok_880:
 #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;
                }
@@ -3004,7 +3004,7 @@ flash_ok_885:
                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;
                }
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 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 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 67c419402d8aa96aed629d5e6736eaadfa072f30..a5ff43b1b2633ba130f2cbd6273210d9f2282001 100644 (file)
@@ -1221,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 d8c9ec21e0efc840467a614caa864e5b097fea86..771b01984cbc9c1127240f15541344df96a619a9 100644 (file)
@@ -731,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 */
@@ -965,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 36c50b61f94da76057829677373852c2d968f9f5..10573c24a50bc02a514770d6b09272efdd73e30a 100644 (file)
@@ -778,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 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 03356887202dec8263b16b3e41933bc1af9f5384..b0694dcce246e435c3936f3a7a0b37509f39effb 100644 (file)
@@ -949,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 fbc8e16c8d1566315bb2f006aab9c75f3e02b885..67f1100f310361708647f4c28952895a608dc82f 100644 (file)
@@ -461,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 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 1cbc94842cc6331162bd9ad805ccfc6d07e66023..2be1dc5d852ad59c0bb864831503e9849497d5bc 100644 (file)
@@ -1510,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
@@ -1635,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++;
@@ -1696,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 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 43acb1fe90b48e167ee9e66ac5a992435ca7e5db..9e10dac61cfd2857dbd3560320f737694e9cafe8 100644 (file)
@@ -2867,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 e19bf690cdf112559aeae41ab29138b4a83f1603..01080b3acf5e7a7f0d97cc6a409f72cb15aaa236 100644 (file)
@@ -6428,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 7436793c3ad365339576ba50d7de36ad398f2177..3c639286ec1edeb7496e5d11aa47422da0a6c4a0 100644 (file)
@@ -7007,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);
@@ -7419,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 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 38bfebf4fe8fd6c10911c3dfa97b344e5e3d7dfb..9ce221f25954426af69ce124bb11a4beaf0feff2 100644 (file)
@@ -853,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 908d0f27706f9cc55591e6833161c7a41b7eefd0..5a28d9bf8e4de186cd349961d976a3f21699c49b 100644 (file)
@@ -1620,7 +1620,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 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..e5c017ccda595cf14804593c6b62ddc5bd16d3e8 100644 (file)
@@ -2191,7 +2191,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;
        }
index 5c55e152e7189f7ea6dd7ac287cd517bfa3a03cf..bd337a91429855f290859ea03b9e377cd1c6eda9 100644 (file)
@@ -2867,7 +2867,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);
+                         IRQF_SHARED | IRQF_SAMPLE_RANDOM, "nsp32", data);
        if (ret < 0) {
                nsp32_msg(KERN_ERR, "Unable to allocate IRQ for NinjaSCSI32 "
                          "SCSI PCI controller. Interrupt: %d", host->irq);
index d7a0bcc6c6708051842147c232edf7912506638c..dd67a68c5c23961e5617feda7c1686d0ada8227e 100644 (file)
@@ -197,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 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..7ff5851c040b290dcbf532c31de00d9a5a0e3fb2 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 | IRQF_SAMPLE_RANDOM);
 
        /* 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 a7e4183462b810ea265462e5765133f57ec42214..b818b9bfe678bfdfdca6ae22f7d101f905dabe4f 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
@@ -4369,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 ccaad0b08d35a4108e58daed4767ad0f0a2c2abb..93062593ebe7d23e9ff039f907f8b05e2e9806ba 100644 (file)
@@ -1541,7 +1541,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",
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 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 a958b45e597c709a75f21714efd09bccef87e35f..7d0858095e1fed49324d2ac20787e95fc83768ef 100644 (file)
@@ -428,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 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 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 2b2789345c13e67cc7b754ed9304e106883d0f44..b27e85428daab7a59decef0a2ba3e170afb0bca2 100644 (file)
@@ -133,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 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 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 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 7540f6a7529f72a81d6062957d177591441d9682..9404ff3d4c79233ff63a471a2f14901d03d167b2 100644 (file)
@@ -2584,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 35c043e38ed45c93f3c0eef40236e5647ec380f8..57449611e714ec86e44fd02c02c28044a248cb37 100644 (file)
@@ -872,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 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 9c5d36f501408a856fed964aac839653301c4ba6..0995430e4cf1ca3d4f5927856d0cb64739e0f7ac 100644 (file)
@@ -48,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;
@@ -1400,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 7b3b3f3d510159f109808e478a7e9c21b6834391..a7d664383dae48f2d2202fbfb8c5e3d499fd9274 100644 (file)
@@ -387,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 901be3483455ba01b8079d2950d199fdacab3eae..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
@@ -4942,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 ecf824bd2d4e2bd205c301a31bb9824fafeb4d17..d119c8296a78a96d69e697a61b7c60ebb96670d9 100644 (file)
@@ -797,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 ad1e753cbc535c05ad115dc26f7c28a5ed17c7b7..a3c00a2521497c7c326678853d32179de40e4e96 100644 (file)
@@ -1563,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 0b5f39d038b9ff4bf253c7b455094d495fbc841f..4a142d6b8f3890aa11c0bc16b3978806e42bb539 100644 (file)
@@ -404,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 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 fbaae96f4c938c54a2110793a82eb5e3cdbe90fc..e7fe4bb46ecaf2c3dc169a2fb7862449fd6b0baf 100644 (file)
@@ -542,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 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 1b8e554f674f48619ac1190e73fec4efece579e2..48eb22d3a63e32475af487955f3ac335146b1602 100644 (file)
@@ -190,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;
 
index 8c498f785e215b6f2efe307cf33c12c24d834bf6..63d2a66e563bac3823fbb699b11ecabce44cdbb3 100644 (file)
@@ -1412,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 4d9435451f4a202a6032b5d1a95f6f564aa079be..459c0231aef32d6467ec76d3f374d0843265b5f4 100644 (file)
@@ -934,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);
index 28c1881a6691eeb0def9e867924034bce5df83b5..b361669f85a17bf8372df6fa6417e0dbbc0fc13e 100644 (file)
@@ -495,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 2509c3237e8762fc73e245040212f168494f76b3..301573373c30ad856f02752c1b1306b27b81e12a 100644 (file)
@@ -841,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;
@@ -850,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 4b0afc8f12b96f2384c2c4f6ad91a96e12215be2..2f148e5b92557f17d0ca76aa92054984062fcbc3 100644 (file)
@@ -648,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 20a48697727c489bd68893fa74463ae7ba3c909a..0dbd4df44c05140499f03bbcb8e2d33be236d3fa 100644 (file)
@@ -1027,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 eabf477fee9581677a59cb0c1c319394960ff8b2..f9013baba05b4f09f6bb1b06e038e9db9b39f907 100644 (file)
@@ -667,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);
index 9ee7f3af9ae2c4e6491d0c065d78010f51d2bb78..a1456d9352cba115bb7471ba5a43aacc9c75f0e8 100644 (file)
@@ -1354,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 0040f10c9e39b3cbdd0364e3822b886e0e270a1a..6c7e0352d561f6ffdae0bfc568aea97f1baf4c2e 100644 (file)
@@ -706,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 {
@@ -714,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 {
@@ -723,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 93bc90b8ff92af51525908409bf762ea7e801807..5e8a27620f6f339045981b5994b4138c69be073a 100644 (file)
@@ -1791,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 9d16716d166e7517d5b0a23ac8dcb8f09835892c..5078fb3375e34e5c573ef86113b81437ffff1d32 100644 (file)
@@ -125,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 acb3c3d2e8886a84b4336dd539872d1872bb31fb..1c459ff037cef275d5e487da9de0f8362fee4b26 100644 (file)
@@ -1653,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 3f827ded8cdf5c0fad3dd16917a6dfd93a0bf05f..7cf2999e8616b3b8ae68a5e6a699ea26bcc90fe2 100644 (file)
@@ -1916,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..bb22b7e82877adbc236554f03d863dbc0250750d 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,
index 570996d7eb34083062001f162013c25805b84805..09243239d948cf4c034515c89838b41b769b7817 100644 (file)
@@ -2895,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 0d642ac700553278a56f56c6a000b563413b4085..2de9748ee6734c7763a2e4618f9769c91d36bce2 100644 (file)
@@ -772,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 ... */
@@ -2818,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);
@@ -2827,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);
@@ -2835,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 c88650dffdeb6b96e05957d8da863253e75e4a22..fff027d30a09d2e564f842baa4eba11a90a80ad2 100644 (file)
@@ -2521,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);
@@ -2533,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",
@@ -2544,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 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 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 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 c327168255cd43467229b43e1c9c7589ac3ebb20..fa34092bbcde1e82ac9338d7a2366aea48c2e1d3 100644 (file)
@@ -1749,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 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 85fcd22e6ed5a9d7258ce38faa741d5cdb6f5cbe..0c9706746d7955393b13c21b02833dc6c3cced76 100644 (file)
@@ -1567,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 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 8b5bf7972ee3c6631c0bb44428d83b82e033f77e..4a57dabb77d4a1cf028d47b5f84f8643fb00f663 100644 (file)
@@ -233,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 54663a9baf43e01b3680f2f99933be851191b6cd..bbb07106cd54b1b50f2a3de7cf769590a7a56536 100644 (file)
@@ -1334,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 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 553fd84af44fbc948d1c03105ca20adb5ea126a3..a2e6e7205d7e082b79a2428a35b406059fa59c3e 100644 (file)
@@ -1472,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 477eaa2fcf6aac9cccbf04eb949752afb91e7795..12dfdcfbee3dfb8666712f81fb8ca28f203568cb 100644 (file)
@@ -2932,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 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 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 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 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/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 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 8a7554f0398447af954cfb49049f96ac60d89b10..f28b236139ed4000ed907015601629bf99b26808 100644 (file)
@@ -111,6 +111,7 @@ 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
 
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 */
 
 
 /* 
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 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
 
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/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 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_ */
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
 
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);
 
 }
 
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 79479e2c6966b0cb468db6f348538e8b0e19d32f..8acb00190d5a4d2910f06a42f84764ecd76c8637 100644 (file)
@@ -14,6 +14,8 @@
 #define NR_IRQS                256
 #define NR_IRQ_VECTORS NR_IRQS
 
+#define IRQF_PERCPU    0x02000000
+
 static __inline__ int
 irq_canonicalize (int irq)
 {
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 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 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;
 }
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
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
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 */
 
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 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 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 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 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 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 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
 
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
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 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
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
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
 
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)
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 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 */
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 */
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 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 db2a63a11633cb9ebdfeb21dc9436b1a23bd92ea..cf682a73a6f97c67baf4bfa1346df00caa605f38 100644 (file)
 #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
+
+/*
+ * 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_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;
index 00b6ef8b2f936bf55f9ed5a6454b31be511eeeea..95d7aa7954d20b8aa706567e7eee52e391da8b00 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;
 
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 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 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 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;
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 6c91f938005db0719bac62a643fff9b411b7f594..15caf93e4a4379df3d1072bb82d286cb70a06a80 100644 (file)
@@ -630,8 +630,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;
@@ -1208,7 +1210,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 e71266c3803ef32f06a7620308d6450d4800274c..6d8b30114961a46669455b7e5721319751e94744 100644 (file)
@@ -142,7 +142,7 @@ irqreturn_t handle_IRQ_event(unsigned int irq, struct pt_regs *regs,
        }
 #endif
 
-       if (!(action->flags & SA_INTERRUPT))
+       if (!(action->flags & IRQF_DISABLED))
                local_irq_enable();
 
        do {
@@ -153,7 +153,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();
 
index b7117e81ac56b57e6f634275388c0370450abc9c..fede5fa351dfce046dca0f28113c937854c2ba5d 100644 (file)
@@ -114,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: {
@@ -167,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;
@@ -205,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.
@@ -227,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) && defined(IRQF_PERCPU)
                /* 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
 
@@ -249,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) && defined(IRQF_PERCPU)
+       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);
 
@@ -297,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;
@@ -365,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;
        }
@@ -396,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,
@@ -414,7 +416,7 @@ int request_irq(unsigned int irq,
         * 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 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)
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 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 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 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 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 0b09b8b4ec7d95d404b700b2a701046025383bfc..f56f870b48400e844a52d3547566fbefbb59ccf9 100644 (file)
@@ -1010,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 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 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 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 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 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 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 3e8ecac86a894e11e604b2e03d913dd8f70da152..35bab6e2f998a7f87442c99168715630750681ed 100644 (file)
@@ -677,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 cbf745db4b10e2baf32ba49e20b00527052b4d00..7b168d85f4ab83ea42e682fc6ff84afb48a97832 100644 (file)
@@ -297,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 420a866fb93387e688706c62b7b863311ac1a7cd..2813e4c8e365aafb6bc6b364b671c8d2e4720b10 100644 (file)
@@ -4472,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 3ada26b3fc7eb03e7c216cb54c6e5eb78e9d0188..08d8c94d01b21d42073bb84728bd46866f395115 100644 (file)
@@ -2013,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");
@@ -2022,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 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 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..90db9a1d1e0a18d0749f4eb68bd6a22a19236c40 100644 (file)
@@ -1170,7 +1170,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);
index ba1b2a3443d36e91f886ef1a2fc4179fbace3cb4..db3e22efd02ee04d44fcd279d9d4b9bea258d493 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);
index 44ad9616bf63a39d4df41e45440284fddc488604..5018fcf41df5883b7cbb722b28a1181d8dfe07b1 100644 (file)
@@ -2001,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);
index 63bef0aadf1e13dd11a4da275ddbd390a398981d..59a02a0d9afcb984276193522e795b78d2289cf8 100644 (file)
@@ -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);